+
    Ĝi                         ^ RI Ht ^ RIHt ^ RIHt ^ RIHt ^ RIH	t	H
t
HtHtHtHtHt ^ RIHt ^ RIHtHtHt RR ltR	 t^R
IHt  ! R R]4      t ! R R]4      tR# )    )defaultdictchain)
itemgetter)Serialisable)BoolNoneSetStringSequenceAliasIntegerConvertible)
NestedText)rows_from_rangecoordinate_to_tupleget_column_letterc           	        \        V4      pR V  4       p\        \         4      p\        V\        ^4      R7       F  w  rVWF,          P	                  V4       K  	  VP                  4        F[  w  r`\        V4      pRp\        V 4      ^8X  d   RpVP                  V\        V 4      V\        V 4      4      pVP	                  V4       K]  	  RP                  V4      # )aK  Collapse a collection of cell co-ordinates down into an optimal
range or collection of ranges.

E.g. Cells A1, A2, A3, B1, B2 and B3 should have the data-validation
object applied, attempt to collapse down to a single range, A1:B3.

Currently only collapsing contiguous vertical ranges (i.e. above
example results in A1:A3 B1:B3).
c              3   8   "   T F  p\        V4      x  K  	  R # 5iN)r   ).0cells   & j/Users/mibo/.openclaw/workspace/.venv-ak/lib/python3.14/site-packages/openpyxl/worksheet/datavalidation.py	<genexpr>*collapse_cell_addresses.<locals>.<genexpr>(   s     >%d++   )keyz{0}{1}:{2}{3}z{0}{1} )listr   sortedr   appenditemsr   lenformatminmaxjoin)	cellsinput_rangesranges
raw_coordsgrouped_coordsrowcolfmtrs	   &&       r   collapse_cell_addressesr0      s     ,F ?>J !&N::a=9""3' : %**,
$u:?CJJsCJSZ8a - 88F    c                f    R V P                  4        4       pR V 4       p\        \        V!  4      # )z
Expand cell ranges to a sequence of addresses.
Reverse of collapse_cell_addresses
Eg. converts "A1:A2 B1:B2" to (A1, A2, B1, B2)
c              3   8   "   T F  p\        V4      x  K  	  R # 5ir   )r   )r   rss   & r   r   %expand_cell_ranges.<locals>.<genexpr>B   s     ?*>BOB*>r   c              3   4   "   T F  p\        V!  x  K  	  R # 5ir   r   )r   r,   s   & r   r   r5   C   s     )DSUC[Ds   )splitsetr   )range_stringrowsr'   s   &  r   expand_cell_rangesr;   ;   s1     @,*<*<*>?D)D)Eue}r1   )MultiCellRangec                     a  ] tR t^Jt o Rt]! ]R7      t]! R4      t	]! R4      t
]! RR7      t]! R4      t]! RR7      t]! RR7      t]! RR7      t]! R4      t]! RR7      t]! RR7      t]! RR7      t]! RR7      t]! R]R7      t]! R]R7      t]! RR	7      t]! RR	7      t]! RR	7      t]! RR	7      t]! R
4      t RR lt!R t"R t#Rt$V t%R# )DataValidationdataValidationexpected_typesqrefT
allow_noneshowDropDown
allowBlank)rD   rA   )valuestypeNc                    Wn         W`n        Wn        Wn        W n        W0n        Ve   TpWpn        W@n        WPn        Wn	        Wn
        Wn        Wn        Wn        Wn        R # r   )rB   rE   imeModeoperatorformula1formula2rF   showErrorMessageshowInputMessagerH   promptTitle
errorStyleerrorprompt
errorTitle)selfrH   rL   rM   rN   rO   rE   rF   rB   rP   rQ   rR   rS   rT   rJ   rK   allow_blanks   &&&&&&&&&&&&&&&&&r   __init__DataValidation.__init__j   s^    $ 
(   "$J$ 0 0	&$
$r1   c                t    \        VR4      '       d   VP                  pV ;P                  V,          un        R# )z0Adds a cell or cell coordinate to this validator
coordinateNhasattrrZ   rB   rU   r   s   &&r   addDataValidation.add   s&    4&&??D

d
r1   c                Z    \        VR 4      '       d   VP                  pWP                  9   # )rZ   r[   r]   s   &&r   __contains__DataValidation.__contains__   s%    4&&??Dzz!!r1   )rF   rR   rQ   rT   rL   rM   rJ   rK   rS   rP   rE   rN   rO   rB   rH   )wholedecimalr   datetime
textLengthcustom)stopwarninginformation)	noControloffondisabledhiraganafullKatakanahalfKatakana	fullAlpha	halfAlpha
fullHangul
halfHangul)between
notBetweenequalnotEquallessThanlessThanOrEqualgreaterThangreaterThanOrEqual)NNNFFFF NNNNNNNN)&__name__
__module____qualname____firstlineno__tagnamer   r<   rB   r   r'   r)   r   rE   hide_drop_downrO   rN   rF   rV   r
   rT   rR   rP   rS   r   strrL   rM   r	   rH   rQ   rJ   rK   validation_typerW   r^   ra   __static_attributes____classdictcell__)__classdict__s   @r   r>   r>   J   s     Gn5E'NE7^F4(L>*Nt,t,&J%KT*J%Ed+K&FT=HT=H 3 4D BCJ : ;G  c dHFmO"%J" "r1   r>   c                      a a ] tR t^t oRt]! RR7      t]! RR7      t]! RR7      t	]
! ]R7      tRtRtRR lt]R 4       tR tR tRV 3R	 lltR
tVtV ;t# )DataValidationListdataValidationsTrC   r@   c                6    Wn         W n        W0n        WPn        R # r   )disablePromptsxWindowyWindowr?   )rU   r   r   r   countr?   s   &&&&&&r   rW   DataValidationList.__init__   s     -,r1   c                    \        V 4      # r   )r"   rU   s   &r   r   DataValidationList.count   s    4yr1   c                ,    \        V P                  4      # r   )r"   r?   r   s   &r   __len__DataValidationList.__len__   s    4&&''r1   c                <    V P                   P                  V4       R # r   )r?   r    )rU   dvs   &&r   r    DataValidationList.append   s    ""2&r1   c                   < V P                   pV P                    Uu. uF"  p\        VP                  4      '       g   K   VNK$  	  upV n         \        SV `  V4      pW n         V# u upi )z3
Need to skip validations that have no cell ranges
)r?   boolrB   superto_tree)rU   r   r)   r/   xml	__class__s   &&   r   r   DataValidationList.to_tree   sZ     $$*.*=*=O*=Qaggqq*=Ogog&$
 Ps
   A#A#)r?   r   r   r   )r?   )r   r   r   r   )NNNNr   r   )r   r   r   r   r   r   r   r   r   r   r   r>   r?   __elements__	__attrs__rW   propertyr   r   r    r   r   r   __classcell__)r   r   s   @@r   r   r      si     GT*N&G&GN;N&LAI
-  (' r1   r   N)r   )collectionsr   	itertoolsr   rK   r   !openpyxl.descriptors.serialisabler   openpyxl.descriptorsr   r	   r
   r   r   r   r   openpyxl.descriptors.nestedr   openpyxl.utilsr   r   r   r0   r;   
cell_ranger<   r>   r   r   r1   r   <module>r      s\    $   :   3 B	 'O"\ O"d. .r1   