Ë
    £èh³b  ã                  óò  — d dl mZ d dlmZmZmZ d dlmZ d dlZd dl	m
Z
 d dlmZmZmZmZmZ d dlmZmZmZmZmZ d dlmZ d d	lmZ d d
lmZmZ ddlmZm Z m!Z! ddl"m#Z# ddl$m%Z%m&Z& er d dlm'Z'm(Z( d dl)m*Z* d dl+m,Z, d dlm-Z- d dl.m/Z/ g d¢Z0 ejb                  d«      Z2 ed edd de
jf                  e¬«       edd e
jh                  d d«      e¬«      dœ«      Z5 ee5«      Z6dZ7dZ8e8d fZ9ejt                   G d!„ d"e#«      «       Z; ed#d$ ed%«      i«      Z< ee<«      Z=ejt                   G d&„ d'e;«      «       Z> ed( edd ¬)«       edd*¬)«      d+œ«      Z? ee?«      Z@ejt                   G d,„ d-e#«      «       ZAy).é    )Úannotations)ÚTYPE_CHECKINGÚUnionÚOptional)ÚSelfN)Ú	validator)ÚSUBCLASS_MARKERÚDXFKeyErrorÚDXFValueErrorÚDXFTypeErrorÚDXFStructureError)ÚDXFAttrÚDXFAttributesÚDefSubclassÚRETURN_DEFAULTÚgroup_code_mapping)Úis_valid_handle)Ú
AuditError)ÚfactoryÚ
DXFGraphicé   )Ú
base_classÚSubclassProcessorÚ	DXFEntity)Ú	DXFObject)Údefault_copyÚCopyNotSupported)ÚDXFNamespaceÚXRecord)ÚAbstractTagWriter)ÚDrawing)ÚAuditor)Úxref)Ú
DictionaryÚDictionaryWithDefaultÚDictionaryVarÚezdxfÚAcDbDictionaryi  T)ÚdefaultÚoptionalr   Úfixeri  é   )r)   r   r+   )Ú
hard_ownedÚcloningé   i^  ih  c                  óŠ  ‡ — e Zd ZdZdZ eee«      Zd'ˆ fd„Z	e
fd(d„Zd)d„Zd*ˆ fd„Zd'ˆ fd„Zd'd„Z	 d+	 	 	 d,ˆ fd	„Zd
„ Zd-ˆ fd„Zd.ˆ fd„Zd/d„Zed0d„«       Zd„ Zd„ Zd1d„Zd2d„Zd3d„Zd4d„Zd5d„ZeZd+d6d„Zd7d„Z d2d„Z!d8d„Z"d3d„Z#d3d„Z$d'd„Z%d'd„Z&d9d:d„Z'd;d„Z(d<d „Z)d;d!„Z*d=d"„Z+d9d>d#„Z,d?ˆ fd$„Z-d@d%„Z.d'ˆ fd&„Z/ˆ xZ0S )Ar$   aÊ  AutoCAD maintains items such as mline styles and group definitions as
    objects in dictionaries. Other applications are free to create and use
    their own dictionaries as they see fit. The prefix "ACAD_" is reserved
    for use by AutoCAD applications.

    Dictionary entries are (key, DXFEntity) pairs. DXFEntity could be a string,
    because at loading time not all objects are already stored in the EntityDB,
    and have to be acquired later.

    Ú
DICTIONARYc                óV   •— t         ‰| �  «        t        «       | _        t        | _        y ©N)ÚsuperÚ__init__ÚdictÚ_dataÚ
VALUE_CODEÚ_value_code©ÚselfÚ	__class__s    €ú9lib/python3.12/site-packages/ezdxf/entities/dictionary.pyr5   zDictionary.__init__k   s   ø€ Ü‰ÑÔÜ7;³vˆŒ
Ü%ˆÕó    c                óÞ  — t        |t        «      sJ ‚| j                  |_        | j                  j                  rQt        «       }| j                  «       D ],  \  }}t        |t        «      sŒ	 |j                  |¬«      ||<   Œ. ||_        yt        | j                  «      |_        y# t        $ r= |j                  j                  r#t        j                  dt        |«      › d�«       n‚ Y Œ—w xY w)zžCopy hard owned entities but do not store the copies in the entity
        database, this is a second step (factory.bind), this is just real copying.
        ©Úcopy_strategyzcopy process ignored z% - this may cause problems in AutoCADN)Ú
isinstancer$   r9   Údxfr-   r6   Úitemsr   Úcopyr   ÚsettingsÚ%ignore_copy_errors_in_linked_entitiesÚloggerÚwarningÚstrr7   )r;   ÚentityrA   ÚdataÚkeyÚents         r=   Ú	copy_datazDictionary.copy_datap   sÏ   € ô ˜&¤*Ô-Ð-Ð-Ø!×-Ñ-ˆÔØ�8‰8×Òä)-«ˆDØ ŸJ™JžL‘��Sô ˜c¤9Õ-ð"Ø$'§H¡H¸= HÓ$I˜˜Sš	ð )ð  ˆF�Lä §
¡
Ó+ˆF�Løô ,ò "Ø(×1Ñ1×WÒWÜ"ŸN™NØ"7¼¸C»°zÐAfÐ gõð "ñ	ð"ús   Á,B&Â&AC,Ã+C,c                ó
  — t        «       }| j                  s|S | j                  «       D ]W  \  }}t        |t        «      sŒ|j                  |«      }|sŒ+|j                  j                  ||j                  j                  <   ŒY |S )z,Returns handle mapping for in-object copies.)r6   Úis_hard_ownerrD   rB   r   ÚgetrC   Úhandle)r;   ÚcloneÚhandle_mappingrM   rK   Úcopied_entrys         r=   Úget_handle_mappingzDictionary.get_handle_mappingŠ   sq   € ä)-«ˆØ×!Ò!Ø!Ð!àŸ:™:ž<‰KˆC�Ü˜f¤iÔ0ØØ Ÿ9™9 S›>ˆLÚØ4@×4DÑ4D×4KÑ4K�˜vŸz™z×0Ñ0Ò1ð (ð Ðr>   c                ó2  •— t        |t        «      sJ ‚t        ‰| �  ||«       | j                  ryt        «       }| j                  «       D ]C  \  }}t        |t        «      sŒ|j                  |j                  j                  «      }|sŒ?|||<   ŒE ||_        y)z3Translate resources from self to the copied entity.N)rB   r$   r4   Úmap_resourcesrQ   r6   rD   r   Úget_reference_of_copyrC   rS   r7   )r;   rT   ÚmappingrL   rM   rK   Úentity_copyr<   s          €r=   rY   zDictionary.map_resources˜   s…   ø€ ä˜%¤Ô,Ð,Ð,Ü‰Ñ˜e WÔ-Ø×ÒØÜ‹vˆØŸ:™:ž<‰KˆC�Ü˜f¤iÔ0ØØ!×7Ñ7¸¿
¹
×8IÑ8IÓJˆKÚØ"��S’	ð (ð ˆ�r>   c                ó®   •— t         ‰| �  «        | j                  «       D ]3  \  }}t        |t        «      sŒ|j
                  sŒ$|j                  «        Œ5 y r3   )r4   Údel_source_of_copyrD   rB   r   Úis_alive)r;   Ú_rK   r<   s      €r=   r^   zDictionary.del_source_of_copy§   s>   ø€ Ü‰Ñ"Ô$ØŸ™ž‰IˆAˆvÜ˜&¤)Õ,°·³Ø×)Ñ)Õ+ñ &r>   c                ó6  — | j                   j                  sy| j                  }|€J ‚|j                  }| j                   j                  }| j                  «       D ]=  \  }}||j                   _        t        j                  ||«       |j                  |«       Œ? y)z­Called by binding a new or copied dictionary to the document,
        bind hard owned sub-entities to the same document and add them to the
        objects section.
        N)
rC   r-   ÚdocÚobjectsrS   rD   Úownerr   ÚbindÚ
add_object)r;   rb   Úobject_sectionÚowner_handler`   rK   s         r=   Úpost_bind_hookzDictionary.post_bind_hook­   s{   € ð
 �x‰x×"Ò"Øð �h‰hˆØˆÐˆØŸ™ˆØ—x‘x—‘ˆØŸ™ž‰IˆAˆvØ+ˆF�J‰JÔÜ�L‰L˜ Ô%à×%Ñ% fÕ-ñ	 &r>   c                ó~   •— t         ‰| �  |«      }|r*|j                  |t        dd¬«      }| j	                  |«       |S )Nr   F)Úlog)r4   Úload_dxf_attribsÚfast_load_dxfattribsÚacdb_dictionary_group_codesÚ	load_dict)r;   Ú	processorrC   Útagsr<   s       €r=   rl   zDictionary.load_dxf_attribsÀ   sI   ø€ ô ‰gÑ& yÓ1ˆÙØ×1Ñ1ØÔ0°!¸ð 2ó ˆDð �N‰N˜4Ô Øˆ
r>   c                óœ   — d }d }t         }|D ]6  \  }}|t        v r|}|}n|t        k(  r|}|sŒ!|sŒ$|| j                  |<   d }d }Œ8 || _        y r3   )r8   ÚSEARCH_CODESÚKEY_CODEr7   r9   )r;   rq   Úentry_handleÚdict_keyÚ
value_codeÚcodeÚvalues          r=   ro   zDictionary.load_dictË   sg   € ØˆØˆÜˆ
Û‰KˆD�%Ø”|Ñ#ð "�
Ø$‘ØœÒ!Ø �ÚšLà'3�—
‘
˜8Ñ$Ø#�Ø‘ð  ð &ˆÕr>   c                ó¸   •‡ ‡— t         ‰‰ �  |«       |j                  Šˆˆ fd„}t        ‰ «      r+t	         |«       «      D ]  \  }}‰ j                  ||«       Œ y y )Nc               3  óŒ   •K  — ‰j                  «       D ],  \  } }‰j                  |«      }|€Œ|j                  sŒ'| |f–— Œ. y ­wr3   )rD   rR   r_   )rM   rS   rK   Údbr;   s      €€r=   rD   z(Dictionary.post_load_hook.<locals>.itemsä   s>   øè ø€ Ø#Ÿz™zž|‘��VØŸ™ ›�ØÑ%¨&¯/«/Ø˜v˜+Ó%ñ  ,ùs   ƒ*A®A»	A)r4   Úpost_load_hookÚentitydbÚlenÚlistÚ__setitem__)r;   rb   rD   ÚkÚvr|   r<   s   `    @€r=   r}   zDictionary.post_load_hookà   sP   ú€ Ü‰Ñ˜sÔ#Ø�\‰\ˆõ	&ô ˆtŒ9Ü™U›Wž‘��1Ø× Ñ   AÕ&ñ &ð r>   c                óÊ   •— t         ‰| �  |«       |j                  t        t        j
                  «       | j                  j                  |ddg«       | j                  |«       y)ú(Export entity specific data as DXF tags.r-   r.   N)	r4   Úexport_entityÚ
write_tag2r	   Úacdb_dictionaryÚnamerC   Úexport_dxf_attribsÚexport_dict©r;   Ú	tagwriterr<   s     €r=   r†   zDictionary.export_entityî   sM   ø€ ä‰Ñ˜iÔ(Ø×Ñœ_¬o×.BÑ.BÔCØ�‰×#Ñ# I°¸iÐ/HÔIØ×Ñ˜Õ#r>   c           	     ó`  — | j                   j                  «       D ]‘  \  }}|j                  t        |«       t	        |t
        «      rJ|j                  r|j                  j                  }n't        j                  d|› dt        | «      › d�«       d}|j                  | j                  |«       Œ“ y )NzKey "z"" points to a destroyed entity in z , target replaced by "0" handle.Ú0)r7   rD   r‡   rt   rB   r   r_   rC   rS   rH   ÚdebugrJ   r9   )r;   r�   rM   ry   s       r=   r‹   zDictionary.export_dictõ   s–   € ð Ÿ*™*×*Ñ*Ö,‰JˆC�Ø× Ñ ¤¨3Ô/ä˜%¤Ô+Ø—>’>Ø!ŸI™I×,Ñ,‘Eä—L‘LØ ˜uð %Ü! $›i˜[Ð(HðJôð  �Eà× Ñ  ×!1Ñ!1°5Õ9ñ -r>   c                ó@   — t        | j                  j                  «      S )z�Returns ``True`` if the dictionary is hard owner of entities.
        Hard owned entities will be destroyed by deleting the dictionary.
        )ÚboolrC   r-   ©r;   s    r=   rQ   zDictionary.is_hard_owner
  s   € ô
 �D—H‘H×'Ñ'Ó(Ð(r>   c                ó6   — | j                   j                  «       S )z3Returns a :class:`KeysView` of all dictionary keys.)r7   Úkeysr“   s    r=   r•   zDictionary.keys  s   € à�z‰z�‰Ó Ð r>   c              #  ó`   K  — | j                  «       D ]  }|| j                  |«      f–— Œ y­w)z¨Returns an :class:`ItemsView` for all dictionary entries as
        (key, entity) pairs. An entity can be a handle string if the entity
        does not exist.
        N)r•   rR   ©r;   rM   s     r=   rD   zDictionary.items  s+   è ø€ ð
 —9‘9–;ˆCØ�t—x‘x “}Ð$Ó$ñ ùs   ‚,.c                óR   — || j                   v r| j                   |   S t        |«      ‚)z­Return self[`key`].

        The returned value can be a handle string if the entity does not exist.

        Raises:
            DXFKeyError: `key` does not exist

        )r7   r
   r—   s     r=   Ú__getitem__zDictionary.__getitem__  s)   € ð �$—*‘*ÑØ—:‘:˜c‘?Ð"ä˜cÓ"Ð"r>   c                ó&   — | j                  ||«      S )a  Set self[`key`] = `entity`.

        Only DXF objects stored in the OBJECTS section are allowed as content
        of :class:`Dictionary` objects. DXF entities stored in layouts are not
        allowed.

        Raises:
            DXFTypeError: invalid DXF type

        )Úadd©r;   rM   rK   s      r=   r�   zDictionary.__setitem__+  s   € ð �x‰x˜˜VÓ$Ð$r>   c                ó$   — | j                  |«      S )z\Delete self[`key`].

        Raises:
            DXFKeyError: `key` does not exist

        )Úremover—   s     r=   Ú__delitem__zDictionary.__delitem__8  s   € ð �{‰{˜3ÓÐr>   c                ó   — || j                   v S )zReturns `key` ``in`` self.)r7   r—   s     r=   Ú__contains__zDictionary.__contains__A  s   € à�d—j‘jÐ Ð r>   c                ó,   — t        | j                  «      S )z$Returns count of dictionary entries.)r   r7   r“   s    r=   Ú__len__zDictionary.__len__E  s   € ä�4—:‘:‹Ðr>   c                ó:   — | j                   j                  ||«      S )z¡Returns the :class:`DXFEntity` for `key`, if `key` exist else
        `default`. An entity can be a handle string if the entity
        does not exist.

        )r7   rR   )r;   rM   r)   s      r=   rR   zDictionary.getK  s   € ð �z‰z�~‰~˜c 7Ó+Ð+r>   c                óX   — | j                   j                  «       D ]  \  }}||u sŒ|c S  y)z`Returns the DICTIONARY key string for `entity` or an empty string if not
        found.
        Ú )r7   rD   )r;   rK   rM   Úentrys       r=   Úfind_keyzDictionary.find_keyS  s0   € ð Ÿ*™*×*Ñ*Ö,‰JˆC�Ø˜ŠØ’
ð -ð r>   c                ór  — t        |t        «      rt        |«      s�t        d|› d|› �«      ‚t        |t        «      rl| j
                  �D| j
                  j                  r.t        j                  dt        |«      › dt        | «      › �«       nt        d|j                  «       › �«      ‚|| j                  |<   y)a  Add entry (key, value).

        If the DICTIONARY is hard owner of its entries, the :meth:`add` does NOT take
        ownership of the entity automatically.

        Raises:
            DXFValueError: invalid entity handle
            DXFTypeError: invalid DXF type

        zInvalid entity handle #z	 for key NzInvalid entity z in zGraphic entities not allowed: )rB   rJ   r   r   r   rb   Ú
is_loadingrH   rI   r   Údxftyper7   rœ   s      r=   r›   zDictionary.add\  sœ   € ô �fœcÔ"Ü" 6Ô*Ü#Ð&=¸f¸XÀYÈsÈeÐ$TÓUÐUÜ˜¤
Ô+Ø�x‰xÐ#¨¯©×(;Ò(;ô
 —‘ ´°V³°¸TÄ#ÀdÃ)ÀÐMÕNô #Ð%CÀFÇNÁNÓDTÐCUÐ#VÓWÐWØ ˆ�
‰
�3Šr>   c                ór   — | j                  ||«       | j                  j                  |j                  _        y)z*Add entry (key, value) and take ownership.N)r›   rC   rS   rd   rœ   s      r=   Útake_ownershipzDictionary.take_ownershipw  s$   € à�‰��fÔØŸ8™8Ÿ?™?ˆ�
‰
Õr>   c                óà   — | j                   }||vrt        |«      ‚| j                  rD| j                  €J ‚| j	                  |«      }| j                  j
                  j                  |«       ||= y)z}Delete entry `key`. Raises :class:`DXFKeyError`, if `key` does not
        exist. Destroys hard owned DXF entities.

        N)r7   r
   rQ   rb   r™   rc   Údelete_entity)r;   rM   rL   rK   s       r=   rž   zDictionary.remove|  si   € ð
 �z‰zˆØ�d‰?Ü˜cÓ"Ð"à×ÒØ—8‘8Ð'Ð'Ð'Ø×%Ñ% cÓ*ˆFð �H‰H×Ñ×*Ñ*¨6Ô2Ø�‰Ir>   c                ó>   — 	 | j                   |= y# t        $ r Y yw xY w)z�Delete entry `key` if exists. Does not raise an exception if `key`
        doesn't exist and does not destroy hard owned DXF entities.

        N)r7   ÚKeyErrorr—   s     r=   ÚdiscardzDictionary.discard�  s$   € ð
	Ø—
‘
˜3‘øÜò 	Ùð	ús   ‚ �	›c                óp   — | j                   r| j                  «        | j                  j                  «        y)z]Delete all entries from the dictionary and destroys hard owned
        DXF entities.
        N)rQ   Ú_delete_hard_owned_entriesr7   Úclearr“   s    r=   rµ   zDictionary.clear—  s)   € ð ×ÒØ×+Ñ+Ô-Ø�
‰
×ÑÕr>   c                ó¤   — | j                   j                  }| j                  «       D ]'  \  }}t        |t        «      sŒ|j                  |«       Œ) y r3   )rb   rc   rD   rB   r   r¯   )r;   rc   rM   rK   s       r=   r´   z%Dictionary._delete_hard_owned_entriesŸ  s=   € à—(‘(×"Ñ"ˆØŸ:™:ž<‰KˆC�Ü˜&¤)Õ,Ø×%Ñ% fÕ-ñ (r>   c                ó    — | j                   j                  j                  | j                  j                  |¬«      }| j                  ||«       |S )zÂCreate a new sub-dictionary of type :class:`Dictionary`.

        Args:
            key: name of the sub-dictionary
            hard_owned: entries of the new dictionary are hard owned

        )rd   r-   )rb   rc   Úadd_dictionaryrC   rS   r›   ©r;   rM   r-   Údxf_dicts       r=   Úadd_new_dictzDictionary.add_new_dict¦  sE   € ð —8‘8×#Ñ#×2Ñ2Ø—(‘(—/‘/¨jð 3ó 
ˆð 	�‰��hÔØˆr>   c                ó    — | j                   j                  j                  | j                  j                  |¬«      }| j                  ||«       |S )z‹Add a new :class:`DictionaryVar`.

        Args:
             key: entry name as string
             value: entry value as string

        ©rd   ry   )rb   rc   Úadd_dictionary_varrC   rS   r›   )r;   rM   ry   Únew_vars       r=   Úadd_dict_varzDictionary.add_dict_var´  sE   € ð —(‘(×"Ñ"×5Ñ5Ø—(‘(—/‘/¨ð 6ó 
ˆð 	�‰��gÔØˆr>   c                óž   — | j                   j                  j                  | j                  j                  ¬«      }| j                  ||«       |S )z[Add a new :class:`XRecord`.

        Args:
             key: entry name as string

        ©rd   )rb   rc   Úadd_xrecordrC   rS   r›   )r;   rM   Únew_xrecords      r=   rÃ   zDictionary.add_xrecordÂ  sD   € ð —h‘h×&Ñ&×2Ñ2Ø—(‘(—/‘/ð 3ó 
ˆð 	�‰��kÔ"ØÐr>   c                ó  — || vrO| j                   j                  j                  | j                  j                  |¬«      }| j                  ||«       |S | j                  |«      }t        |«      |j                  _        |S )z�Set or add new :class:`DictionaryVar`.

        Args:
             key: entry name as string
             value: entry value as string

        r½   )	rb   rc   r¾   rC   rS   r›   rR   rJ   ry   )r;   rM   ry   Údict_vars       r=   Úset_or_add_dict_varzDictionary.set_or_add_dict_varÏ  sr   € ð �d‰?Ø—x‘x×'Ñ'×:Ñ:Ø—h‘h—o‘o¨Uð ;ó ˆHð �H‰H�S˜(Ô#ð ˆð —x‘x “}ˆHÜ!$ U£ˆH�L‰LÔØˆr>   c                óÊ   — t        |t        «      st        d|j                  «       › �«      ‚| j	                  ||«       | j
                  j                  |j
                  _        y)a   Add `obj` and set owner of `obj` to this dictionary.

        Graphical DXF entities have to reside in a layout and therefore can not
        be owned by a :class:`Dictionary`.

        Raises:
            DXFTypeError: `obj` has invalid DXF type

        zinvalid DXF type: N)rB   r   r   r«   r›   rC   rS   rd   )r;   r‰   Úobjs      r=   Úlink_dxf_objectzDictionary.link_dxf_objectá  sH   € ô ˜#œyÔ)ÜÐ!3°C·K±K³M°?ÐCÓDÐDØ�‰��sÔØŸ™Ÿ™ˆ�‰�r>   c                óª   — | j                  |«      }|€| j                  ||¬«      }|S t        |t        «      st	        dt        |«      › d|› �«      ‚|S )zYGet entry `key` or create a new :class:`Dictionary`,
        if `Key` not exist.
        )r-   z"expected a DICTIONARY entity, got z
 for key: )rR   r»   rB   r$   r   rJ   r¹   s       r=   Úget_required_dictzDictionary.get_required_dictð  sg   € ð —8‘8˜C“=ˆØÐØ×(Ñ(¨¸Ð(ÓDˆHð
 ˆô	 ˜H¤jÔ1Ü#Ø4´S¸³]°OÀ:ÈcÈUÐSóð ð ˆr>   c                ó`   •— | j                   sy t        ‰| �	  |«       | j                  |«       y r3   )r_   r4   ÚauditÚ _remove_keys_to_missing_entities)r;   Úauditorr<   s     €r=   rÎ   zDictionary.auditý  s'   ø€ Ø�}Š}ØÜ‰‰�gÔØ×-Ñ-¨gÕ6r>   c           
     ó°  — g }|j                   }|j                  }| j                  j                  «       D ]Y  \  }}t	        |t
        «      r||vsŒ ||«       Œ$|j                  r"|j                  j                  |vsŒI ||«       ŒR ||«       Œ[ |D ]A  }| j                  |= |j                  t        j                  d|› dt        | «      › �| |¬«       ŒC y )NzRemoved entry "z" with invalid handle in )rx   ÚmessageÚ
dxf_entityrL   )Úappendr~   r7   rD   rB   rJ   r_   rC   rS   Úfixed_errorr   ÚINVALID_DICTIONARY_ENTRY)r;   rÐ   ÚtrashrÔ   r|   rM   r§   s          r=   rÏ   z+Dictionary._remove_keys_to_missing_entities  sÆ   € ØˆØ—‘ˆØ×ÑˆØŸ*™*×*Ñ*Ö,‰JˆC�Ü˜%¤Ô%Ø ’?Ù˜3•KØ—’Ø—9‘9×#Ñ#¨2Ò-Ù˜3”KØá�s•ð -ó ˆCØ—
‘
˜3�Ø×ÑÜ×8Ñ8Ø)¨#¨Ð.GÌÈDË	À{ÐSØØð	  õ ñ r>   c                ót   •— | j                   sy | j                  r| j                  «        t        ‰| �  «        y r3   )r_   rQ   r´   r4   Údestroyr:   s    €r=   rÙ   zDictionary.destroy  s,   ø€ Ø�}Š}Øà×ÒØ×+Ñ+Ô-Ü‰‰Õr>   ©ÚreturnÚNone©rK   r   rÛ   rÜ   )rT   r$   rÛ   zdict[str, str])rT   r   r[   zxref.ResourceMapperrÛ   rÜ   r3   ©rp   zOptional[SubclassProcessor]rÛ   r   ©rb   r!   rÛ   rÜ   ©r�   r    rÛ   rÜ   )r�   r    )rÛ   r’   )rM   rJ   rÛ   r   )rM   rJ   rK   r   rÛ   rÜ   )rM   rJ   rÛ   rÜ   )rM   rJ   rÛ   r’   )rÛ   Úint©rM   rJ   r)   úOptional[DXFObject]rÛ   rã   )rK   r   rÛ   rJ   )rM   rJ   rK   r   )F)rM   rJ   r-   r’   rÛ   r$   )rM   rJ   ry   rJ   rÛ   r&   )rM   rJ   rÛ   r   )r‰   rJ   rÉ   r   rÛ   rÜ   )rM   rJ   rÛ   r$   ©rÐ   r"   rÛ   rÜ   )rÐ   r"   )1Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚDXFTYPEr   r   rˆ   Ú
DXFATTRIBSr5   r   rO   rW   rY   r^   ri   rl   ro   r}   r†   r‹   ÚpropertyrQ   r•   rD   r™   r�   rŸ   r¡   r£   ÚcountrR   r¨   r›   r­   rž   r²   rµ   r´   r»   rÀ   rÃ   rÇ   rÊ   rÌ   rÎ   rÏ   rÙ   Ú__classcell__©r<   s   @r=   r$   r$   [   s  ø„ ñ	ð €GÙ˜z¨?Ó;€Jõ&ð
 5Aô ,ó4õõ,ó.ð( 8<ð	Ø4ð	à	õ	ò&õ*'õ$ó:ð* ò)ó ð)ò!ò%ó#ó%ó ó!óð €Eô,óó!ó6+ó
ó"óó.ôóóóó$(ôõ7ó÷.ñ r>   r$   ÚAcDbDictionaryWithDefaultr)   iT  c                  ó    ‡ — e Zd ZdZ eeee«      Zdˆ fd„Z	e
fdˆ fd„Zdˆ fd„Z	 d	 	 	 dˆ fd„Zdˆ fd„Zdd„Zddˆ fd„Zdd	„Zdˆ fd
„Zˆ xZS )r%   ÚACDBDICTIONARYWDFLTc                ó0   •— t         ‰| �  «        d | _        y r3   )r4   r5   Ú_defaultr:   s    €r=   r5   zDictionaryWithDefault.__init__1  s   ø€ Ü‰ÑÔØ-1ˆ�r>   c                ón   •— t         ‰| �  ||¬«       t        |t        «      sJ ‚| j                  |_        y )Nr@   )r4   rO   rB   r%   ró   )r;   rK   rA   r<   s      €r=   rO   zDictionaryWithDefault.copy_data5  s1   ø€ Ü‰Ñ˜&°ÐÔ>Ü˜&Ô"7Ô8Ð8Ð8ØŸ-™-ˆ�r>   c                óŒ   •— |j                   j                  | j                  j                  «      | _        t
        ‰| �  |«       y r3   )r~   rR   rC   r)   ró   r4   r}   )r;   rb   r<   s     €r=   r}   z$DictionaryWithDefault.post_load_hook:  s2   ø€ ð Ÿ™×(Ñ(¨¯©×)9Ñ)9Ó:ˆŒÜ‰Ñ˜sÕ#r>   c                óX   •— t         ‰| �  |«      }|r|j                  |t        d«       |S )Né   )r4   rl   rm   Ú"acdb_dict_with_default_group_codes©r;   rp   rC   r<   s      €r=   rl   z&DictionaryWithDefault.load_dxf_attribsA  s0   ø€ ô ‰gÑ& yÓ1ˆÙØ×*Ñ*¨3Ô0RÐTUÔVØˆ
r>   c                ó¤   •— t         ‰| �  |«       |j                  t        t        j
                  «       | j                  j                  |d«       y )Nr)   )r4   r†   r‡   r	   Úacdb_dict_with_defaultr‰   rC   rŠ   rŒ   s     €r=   r†   z#DictionaryWithDefault.export_entityI  s;   ø€ Ü‰Ñ˜iÔ(Ø×Ñœ_Ô.D×.IÑ.IÔJØ�‰×#Ñ# I¨yÕ9r>   c                ó$   — | j                  |«      S r3   )rR   r—   s     r=   r™   z!DictionaryWithDefault.__getitem__N  s   € Ø�x‰x˜‹}Ðr>   c                ó:   •— t         ‰| �  || j                  ¬«      S )zÀReturns :class:`DXFEntity` for `key` or the predefined dictionary
        wide :attr:`dxf.default` entity if `key` does not exist or ``None``
        if default value also not exist.

        ©r)   )r4   rR   ró   )r;   rM   r)   r<   s      €r=   rR   zDictionaryWithDefault.getQ  s   ø€ ô ‰w‰{˜3¨¯©ˆ{Ó6Ð6r>   c                óp   — || _         | j                   j                  j                  | j                  _        y)ztSet dictionary wide default entry.

        Args:
            default: default entry as :class:`DXFEntity`

        N)ró   rC   rS   r)   )r;   r)   s     r=   Úset_defaultz!DictionaryWithDefault.set_defaultZ  s'   € ð  ˆŒØŸ=™=×,Ñ,×3Ñ3ˆ�‰Õr>   c                óÖ   •‡ ‡— ˆˆ fd„}‰ j                   �‰ j                   j                  s/‰j                  j                  r‰j	                  |«       n |«        t
        ‰‰ �  ‰«       y )Nc                 óø   •— ‰j                   j                  j                  ‰j                  j                  ¬«      } ‰j                  | «       ‰j                  t        j                  dt        ‰«      › d�¬«       y )NrÂ   z"Created missing default object in Ú.)rx   rÒ   )
rb   rc   Úadd_placeholderrC   rS   r   rÕ   r   ÚCREATED_MISSING_OBJECTrJ   )ÚplaceholderrÐ   r;   s    €€r=   Úcreate_missing_default_objectzBDictionaryWithDefault.audit.<locals>.create_missing_default_objecte  sb   ø€ ØŸ(™(×*Ñ*×:Ñ:ÀÇÁÇÁÐ:ÓQˆKØ×Ñ˜[Ô)Ø×ÑÜ×6Ñ6Ø<¼SÀ»Y¸KÀqÐIð  õ r>   )ró   r_   r~   ÚlockedÚadd_post_audit_jobr4   rÎ   )r;   rÐ   r  r<   s   `` €r=   rÎ   zDictionaryWithDefault.auditd  sP   ú€ õ	ð �=‰=Ð ¨¯©×(>Ò(>Ø×Ñ×&Ò&Ø×*Ñ*Ð+HÕIá-Ô/Ü‰‰�gÕr>   rÚ   rÝ   rß   r3   rÞ   rà   )rM   rJ   râ   )r)   r   rÛ   rÜ   rä   )rå   ræ   rç   ré   r   r   rˆ   rû   rê   r5   r   rO   r}   rl   r†   r™   rR   r   rÎ   rí   rî   s   @r=   r%   r%   ,  sd   ø„ à#€GÙ˜z¨?Ð<RÓS€Jõ2ð 5Aö (õ
$ð 8<ðØ4ðà	õõ:ó
ö7ó4÷ñ r>   r%   ÚDictionaryVariablesrþ   r¦   )Úschemary   c                  óˆ   ‡ — e Zd ZdZdZ eee«      Ze	dd„«       Z
e
j                  dd„«       Z
	 d		 	 	 d
ˆ fd„Zdˆ fd„Zˆ xZS )r&   a×  
    DICTIONARYVAR objects are used by AutoCAD as a means to store named values
    in the database for setvar / getvar purposes without the need to add entries
    to the DXF HEADER section. System variables that are stored as
    DICTIONARYVAR objects are the following:

        - DEFAULTVIEWCATEGORY
        - DIMADEC
        - DIMASSOC
        - DIMDSEP
        - DRAWORDERCTL
        - FIELDEVAL
        - HALOGAP
        - HIDETEXT
        - INDEXCTL
        - INDEXCTL
        - INTERSECTIONCOLOR
        - INTERSECTIONDISPLAY
        - MSOLESCALE
        - OBSCOLOR
        - OBSLTYPE
        - OLEFRAME
        - PROJECTNAME
        - SORTENTS
        - UPDATETHUMBNAIL
        - XCLIPFRAME
        - XCLIPFRAME

    ÚDICTIONARYVARc                ó:   — | j                   j                  dd«      S )z:Get/set the value of the :class:`DictionaryVar` as string.ry   r¦   )rC   rR   r“   s    r=   ry   zDictionaryVar.value£  s   € ð �x‰x�|‰|˜G RÓ(Ð(r>   c                óN   — | j                   j                  dt        |«      «       y )Nry   )rC   ÚsetrJ   )r;   rL   s     r=   ry   zDictionaryVar.value¨  s   € à�‰�‰�Wœc $›iÕ(r>   c                óX   •— t         ‰| �  |«      }|r|j                  |t        d«       |S )Nr   )r4   rl   rm   Úacdb_dict_var_group_codesrù   s      €r=   rl   zDictionaryVar.load_dxf_attribs¬  s/   ø€ ô ‰gÑ& yÓ1ˆÙØ×*Ñ*¨3Ô0IÈ1ÔMØˆ
r>   c                ó¨   •— t         ‰| �  |«       |j                  t        t        j
                  «       | j                  j                  |ddg«       y)r…   r  ry   N)r4   r†   r‡   r	   Úacdb_dict_varr‰   rC   rŠ   rŒ   s     €r=   r†   zDictionaryVar.export_entity´  s?   ø€ ä‰Ñ˜iÔ(Ø×Ñœ_¬m×.@Ñ.@ÔAØ�‰×#Ñ# I°¸'Ð/BÕCr>   )rÛ   rJ   )rL   rJ   rÛ   rÜ   r3   rÞ   rà   )rå   ræ   rç   rè   ré   r   r   r  rê   rë   ry   Úsetterrl   r†   rí   rî   s   @r=   r&   r&   €  sk   ø„ ñð< €GÙ˜z¨=Ó9€Jàò)ó ð)ð ‡\�\ò)ó ð)ð 8<ðØ4ðà	õ÷Dñ Dr>   r&   )BÚ
__future__r   Útypingr   r   r   Útyping_extensionsr   ÚloggingÚezdxf.lldxfr   Úezdxf.lldxf.constr	   r
   r   r   r   Úezdxf.lldxf.attributesr   r   r   r   r   Úezdxf.lldxf.typesr   Úezdxf.auditr   Úezdxf.entitiesr   r   Ú	dxfentityr   r   r   Údxfobjr   rE   r   r   r   r   Úezdxf.lldxf.tagwriterr    Úezdxf.documentr!   r"   r'   r#   Ú__all__Ú	getLoggerrH   Úis_integer_boolÚis_in_integer_rangerˆ   rn   rt   r8   rs   Úregister_entityr$   rû   rø   r%   r  r  r&   © r>   r=   Ú<module>r*     s¶  ðõ #ß 1Ñ 1Ý "Û Ý !÷õ ÷õ õ .Ý "ß .ß ?Ñ ?Ý ß 0áß4Ý7Ý&Ý#Ýâ
B€Ø	ˆ×	Ñ	˜7Ó	#€áØñ Øàð Ø×/Ñ/Ø ô	
ñ" ØØØ3�i×3Ñ3°A°qÓ9Ø ô	
ñ;)ó,€ñZ 1°ÓAÐ Ø€Ø€
à˜CÐ €ð 	×ÑôD�ó Dó ðDñN %Øà‘7˜3“<ðóÐ ñ &8Ð8NÓ%OÐ "ð 	×ÑôE˜Jó Eó ðEñP Øá˜# qÔ)á˜ BÔ'ñó€ñ /¨}Ó=Ð ð 	×Ñô7D�Ió 7Dó ñ7Dr>   