
    	h                     "   S SK Jr  S SKrS SKJr  S SKJrJrJrJ	r	J
r
Jr  S SKJr  S SKJr  S SKJr  \" / SQ5      rS	R)                  \5      r\R,                  " S
R/                  \5      5      r " S S\5      r " S S\5      r " S S\5      rg)    )defaultdictN)Serialisable)AliasStringIntegerBoolSequence
Descriptor)safe_string)	Tokenizer)SHEETRANGE_RE)
Print_AreaPrint_TitlesCriteria_FilterDatabaseExtractConsolidate_AreaSheet_Title|z^_xlnm\.(?P<name>{0})c                   \   \ rS rSrSr\" 5       r\" SS9r\" SS9r\" SS9r	\" SS9r
\" SS9r\" SS9r\" SS9r\" SS9r\" SS9r\" SS9r\" SS9r\" SS9r\" SS9r\" SS9r\" 5       r\" S5      r                SS jr\S 5       r\S	 5       r\S
 5       r\S 5       r S r!Sr"g)DefinedName   definedNameT)
allow_none	attr_textNc                     Xl         X l        X0l        X@l        XPl        X`l        Xpl        Xl        Xl        Xl	        Xl
        Xl        Xl        Xl        Xl        UU l        g N)namecomment
customMenudescriptionhelp	statusBarlocalSheetIdhiddenfunctionvbProcedurexlmfunctionGroupIdshortcutKeypublishToServerworkbookParameterr   )selfr   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r   s                    P/var/www/html/env/lib/python3.13/site-packages/openpyxl/workbook/defined_name.py__init__DefinedName.__init__2   s]    $ 	$&	"( &.&.!2"    c                     [        SU R                  -   5      nUR                  S   nUR                  S:X  a  UR                  $ UR                  $ )N=r   OPERAND)r   valueitemstypesubtype)r-   tokparseds      r.   r7   DefinedName.typeV   sB    djj()1;;)#>>!{{r1   c              #   b  #    U R                   S:X  a  [        SU R                  -   5      nUR                   Hr  nUR                  S:X  d  M  [
        R                  " UR                  5      nUR                  S5      =(       d    UR                  S5      nXCR                  S5      4v   Mt     g g 7f)NRANGEr3   	notquotedquotedcells)r7   r   r5   r6   r8   r   matchgroup)r-   r9   partm	sheetnames        r.   destinationsDefinedName.destinations_   s     99C$**,-C		<<7*%++DJJ7A ! 4 I8II#WWW%555	 "  s   AB/A#B/c                 r    [         R                  U R                  5      nU(       a  UR                  S5      $ g )Nr   )RESERVED_REGEXrA   r   rB   )r-   rD   s     r.   is_reservedDefinedName.is_reservedj   s,      +776?" r1   c                 d    [         R                  " S5      R                  U R                  5      S L$ )Nz
^\[\d+\].*)recompilerA   r5   r-   s    r.   is_externalDefinedName.is_externalq   s%    zz-(..tzz:$FFr1   c              #      #    U R                    H9  nUS:X  a  M  [        X5      nUc  M  U[        ;   a  SU-   nU[        U5      4v   M;     g 7f)Nr   z_xlnm.)	__attrs__getattrRESERVEDr   )r-   keyvs      r.   __iter__DefinedName.__iter__v   sL     >>Ck!"A}= 1A;q>)) "s
   $A#A)r   r   r    r!   r&   r)   r"   r%   r$   r   r+   r*   r#   r'   r,   r(   )NNNNNNNNNNNNNNNN)#__name__
__module____qualname____firstlineno__tagnamer   r   r   r    r!   r"   r#   r   r$   r   r%   r&   r'   r(   r)   r*   r+   r,   r
   r   r   r5   r/   propertyr7   rF   rJ   rP   rX   __static_attributes__ r1   r.   r   r      s;   G8D%G4(JD)KT"D$'Id+LT"Ft$H$'K
$
C.OD)Kd+O-I+E  !"!!%!!%#'!!#H   6 6 # # G G*r1   r   c                   2   ^  \ rS rSrSrU 4S jrS rSrU =r$ )DefinedNameDict   zj
Utility class for storing defined names.
Allows access by name and separation of global and scoped names
c                    > [        U[        5      (       d  [        S5      eUR                  U:w  a  [	        S5      e[
        TU ]  X5        g )Nz*Value must be a an instance of DefinedNamez Key must be the same as the name)
isinstancer   	TypeErrorr   
ValueErrorsuper__setitem__)r-   rV   r5   	__class__s      r.   rj   DefinedNameDict.__setitem__   sA    %--HIIZZ3?@@C'r1   c                      XUR                   '   g)z9
Add names without worrying about key and name matching.
N)r   )r-   r5   s     r.   addDefinedNameDict.add   s     !UZZr1   ra   )	rZ   r[   r\   r]   __doc__rj   rn   r`   __classcell__)rk   s   @r.   rc   rc      s    
(! !r1   rc   c                   @    \ rS rSrSr\" \S9rS
S jrS r	S r
S rSrg	)DefinedNameList   definedNames)expected_typec                     Xl         g r   r   )r-   r   s     r.   r/   DefinedNameList.__init__   s    &r1   c                     [        [        5      nU R                   H[  nUR                  c%  UR                  S;   a  M"  X!S   UR                  '   M5  [        UR                  5      nX!U   UR                  '   M]     U$ )z0
Break names down into sheet locals and globals
)z_xlnm.Print_Titlesz_xlnm.Print_Areaz_xlnm._FilterDatabaseglobal)r   rc   r   r$   r   int)r-   namesdefnsheets       r.   by_sheetDefinedNameList.by_sheet   sq     O,$$D  (99 cc-1h		*D--.*.eTYY' % r1   c                     U R                    H;  nUR                  UR                  :X  d  M  UR                  UR                  :X  d  M;    g   g)zK
Check for whether DefinedName with the same name and scope already
exists
TN)r   r   r$   )r-   r~   ds      r.   
_duplicateDefinedNameList._duplicate   s8    
 !!Avv"q~~9J9J'J "r1   c                 ,    [        U R                  5      $ r   )lenr   rO   s    r.   __len__DefinedNameList.__len__   s    4##$$r1   rx   N)ra   )rZ   r[   r\   r]   r^   r	   r   r   r/   r   r   r   r`   ra   r1   r.   rs   rs      s%    G5K' %r1   rs   )collectionsr   rM   !openpyxl.descriptors.serialisabler   openpyxl.descriptorsr   r   r   r   r	   r
   openpyxl.compatr   openpyxl.formular   openpyxl.utils.cellr   	frozensetrU   join_namesrN   formatrI   r   dictrc   rs   ra   r1   r.   <module>r      s    $ 	 :  ( & - % & 
(	4;;FCDc*, c*L!d !,&%l &%r1   