+
    xȇi[2                        R t ^ RIHt ^ RIt^ RIHt ^ RIt^ RIHt ^ RI	H
t
 ]'       d   ^ RIHtHtHtHt R R ltRR	 R
 llt ! R R4      tR# )zN
Utilities for interpreting CSS from Stylers for formatting non-HTML outputs.
)annotationsN)TYPE_CHECKING)
CSSWarning)find_stack_level)Callable	GeneratorIterableIteratorc                    V ^8  d   QhRRRR/# )   prop_fmtstrreturnr    )formats   "e/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/io/formats/css.py__annotate__r      s     ( (S (X (    c                   a  R V 3R llpV# )a  
Wrapper to expand shorthand property into top, right, bottom, left properties

Parameters
----------
side : str
    The border side to expand into properties

Returns
-------
    function: Return to call when a 'border(-{side}): {value}' string is encountered
c               (    V ^8  d   QhRRRRRRRR/# r   selfCSSResolverpropr   valuer   Generator[tuple[str, str]]r   )r   s   "r   r   $_side_expander.<locals>.__annotate__%   s)     4 4[ 4 4C 4<V 4r   c              3  ^  <"   VP                  4       p V P                  \        V4      ,          p\        T P                  TRR7       F   w  rVSP                  T4      Y6,          3x  K"  	  R#   \         d1    \        P
                  ! RT RT R2\        \        4       R7        R# i ; i5i)z
Expand shorthand property into side-specific property (top, right, bottom, left)

Parameters
----------
    prop (str): CSS property name
    value (str): String token for property

Yields
------
    Tuple (str, str): Expanded property, value
zCould not expand "z: "
stacklevelNT)strict)splitSIDE_SHORTHANDSlenKeyErrorwarningswarnr   r   zipSIDESr   )r   r   r   tokensmappingkeyidxr   s   &&&    r   expand_side_expander.<locals>.expand%   s      	**3v;7G DJJ=HC//#&33 >  	MM$TF"UG15+-
 	s'   B-A/ >B-/7B*&B-)B**B-r   )r   r.   s   f r   _side_expanderr0      s    4 44 Mr   c                    V ^8  d   QhRRRR/# )r   sider   r   r   r   )r   s   "r   r   r   B   s     9 93 9 9r   c                2   a  S R8w  d   RS  2o R V 3R llpV# )a
  
Wrapper to expand 'border' property into border color, style, and width properties

Parameters
----------
side : str
    The border side to expand into properties

Returns
-------
    function: Return to call when a 'border(-{side}): {value}' string is encountered
 -c               (    V ^8  d   QhRRRRRRRR/# r   r   )r   s   "r   r   &_border_expander.<locals>.__annotate__R   s)     '= '=[ '= '=C '=<V '=r   c              3  t  <a"   VP                  4       p\        V4      ^ 8X  g   \        V4      ^8  d*   \        P                  ! RV R2\        \        4       R7       RS R2RRS R2RRS R	2R
/pV F  oSP                  4       V P                  9   d   SVRS R2&   K-  \        ;QJ d)    V3R lV P                   4       F  '       g   K   RM	  RM! V3R lV P                   4       4      '       d   SVRS R	2&   K  SVRS R2&   K  	  V P                  VP                  4       4       Rj  xL
  R#  L5i)z
Expand border into color, style, and width tuples

Parameters
----------
    prop : str
        CSS property name passed to styler
    value : str
        Value passed to styler for property

Yields
------
    Tuple (str, str): Expanded property, value
zToo many tokens provided to "z" (expected 1-3)r   borderz-colorblackz-stylenone-widthmediumc              3  H   <"   T F  qSP                  4       9   x  K  	  R # 5iN)lower).0ratiotokens   & r   	<genexpr>3_border_expander.<locals>.expand.<locals>.<genexpr>r   s     R9Qekkm+9Qs   "TFN)r"   r$   r&   r'   r   r   r@   BORDER_STYLESanyBORDER_WIDTH_RATIOSatomizeitems)r   r   r   r*   border_declarationsrC   r2   s   &&&  @r   r.    _border_expander.<locals>.expandR   s&     v;!s6{QMM/v5EF+- TF&!7TF&!6TF&!8

 E{{} 2 22=B#fTF&$9:R9Q9QRR9Q9QRRR=B#fTF&$9:=B#fTF&$9:  << 3 9 9 ;<<<s$   B'D8,D8'D85:D8/D60D8r   )r2   r.   s   f r   _border_expanderrM   B   s)     rz4&z'= '=R Mr   c                     ] tR t^~tRtRR5RR6RR7RR8RR9RR7RR:R	R;R
R<RR=RR>/t]P                  4       t]P                  RR?RR@RRARRBRRCRRDRRERRFRRGRRHRR6/4       ]P                  4       t	]	P                  RRI/4       ]P                  4       t
]
P                  RRIRRJRRKRRL/4       . RMOt^. RNO^. ROO^. RPO^. RQO/tRRt/ RS U u/ uF  p V '       d   RV  2MR\        V 4      bK  	  up CRT U u/ uF  p RV  2\        RV  24      bK  	  up CR]! R4      R]! R 4      /CtRUR" R# lltR$ R% ltR& R' ltR( R) ltR* R+ ltR, R- ltR!]3R. R/ lltR0 R1 ltR2 R3 ltR4tR!# u up i u up i )Vr   z@
A callable for parsing and resolving CSS to atomic properties.
ptemremexpxpcincmmmqz	!!default%zxx-smallzx-smallsmallr=   largezx-largezxx-largesmallerlargerr;   thickthinborder-r9   zborder-{:s}-marginzmargin-{:s}paddingzpadding-{:s}Nc               $    V ^8  d   QhRRRRRR/# )r   declarationszstr | Iterable[tuple[str, str]]	inheritedzdict[str, str] | Noner   dict[str, str]r   )r   s   "r   r   CSSResolver.__annotate__   s(     7/ 7/57/ )7/ 
	7/r   c                    \        V\        4      '       d   V P                  V4      p\        V P	                  V4      4      pVf   / pV P                  W24      pV P                  W24      pV P                  V4      # )a  
The given declarations to atomic properties.

Parameters
----------
declarations_str : str | Iterable[tuple[str, str]]
    A CSS string or set of CSS declaration tuples
    e.g. "font-weight: bold; background: blue" or
    {("font-weight", "bold"), ("background", "blue")}
inherited : dict, optional
    Atomic properties indicating the inherited style context in which
    declarations_str is to be resolved. ``inherited`` should already
    be resolved, i.e. valid output of this method.

Returns
-------
dict
    Atomic CSS 2.2 properties.

Examples
--------
>>> resolve = CSSResolver()
>>> inherited = {"font-family": "serif", "font-weight": "bold"}
>>> out = resolve(
...     '''
...               border-color: BLUE RED;
...               font-size: 1em;
...               font-size: 2em;
...               font-weight: normal;
...               font-weight: inherit;
...               ''',
...     inherited,
... )
>>> sorted(out.items())  # doctest: +NORMALIZE_WHITESPACE
[('border-bottom-color', 'blue'),
 ('border-left-color', 'red'),
 ('border-right-color', 'red'),
 ('border-top-color', 'blue'),
 ('font-family', 'serif'),
 ('font-size', '24pt'),
 ('font-weight', 'bold')]
)
isinstancer   parsedictrI   _update_initial_update_font_size_update_other_units)r   rd   re   propss   &&& r   __call__CSSResolver.__call__   so    ^ lC((::l3LT\\,/0I$$U6&&u8''..r   c               $    V ^8  d   QhRRRRRR/# r   ro   rf   re   r   r   )r   s   "r   r   rg     s(       " 
	r   c                	    VP                  4        F  w  r4W19  g   K  WAV&   K  	  VP                  4       pVP                  4        F-  w  r4VR 8X  d   VP                  VR4      pVR9   d   WS K)  WEV&   K/  	  V# )inheritinitial)rv   N)rJ   copyget)r   ro   re   r   val	new_propss   &&&   r   rl   CSSResolver._update_initial  sx     #*ID !d + JJL	IDimmD)4''O"%$ ' r   c               $    V ^8  d   QhRRRRRR/# rs   r   )r   s   "r   r   rg   *  s(       " 
	r   c                	    VP                  R 4      '       d8   V P                  VR ,          V P                  V4      V P                  R7      VR &   V# )	font-sizeconversions)rx   
size_to_pt_get_font_sizeFONT_SIZE_RATIOS)r   ro   re   s   &&&r   rm   CSSResolver._update_font_size*  sQ     99[!!!%k"##I. 11 "1 "E+
 r   c                    V ^8  d   QhRRRR/# )r   ro   rf   r   float | Noner   )r   s   "r   r   rg   8  s      N | r   c                	h    VP                  R 4      '       d   VR ,          pV P                  V4      # R# )r~   N)rx   _get_float_font_size_from_pt)r   ro   font_size_strings   && r   r   CSSResolver._get_font_size8  s1    99[!!$[1445EFFr   c                    V ^8  d   QhRRRR/# )r   r   r   r   floatr   )r   s   "r   r   rg   >  s     4 4S 4U 4r   c                	h    VP                  R 4      '       g   Q h\        VP                  R 4      4      # )rO   )endswithr   rstrip)r   r   s   &&r   r   (CSSResolver._get_float_font_size_from_pt>  s0    ((....%,,T233r   c                    V ^8  d   QhRRRR/# )r   ro   rf   r   r   )r   s   "r   r   rg   B  s       N r   c                	0   V P                  V4      pV P                   Ft  pR V R2pWA9   d'   V P                  W,          VV P                  R7      W&   RV 2RV 23 F1  pWA9   g   K  V P                  W,          VV P                  R7      W&   K3  	  Kv  	  V# )r`   r<   )em_ptr   zmargin-zpadding-)r   r)   r   rH   MARGIN_RATIOS)r   ro   	font_sizer2   r   s   &&   r   rn   CSSResolver._update_other_unitsB  s    ''.	JJDTF&)D}"ooK# $ 8 8 .  #4&)XdV+<=="&//'$($6$6 #2 #EK > " r   c               (    V ^8  d   QhRRRRRRRR/# )r   in_valr   r   r   r   rk   r   r   )r   s   "r   r   rg   X  s,     - --".-DH-	-r   c                	  a aa R  VVV 3R llp\         P                  ! RS4      pVf   V! 4       # VP                  4       w  rgVR8X  d   ^pM \        V4      pVR8w  d1   VR8X  d   Vf   RpM
Wb,          pRpK!   SV,          w  rxYh,          pK7  \        V^4      p\        V4      V8X  d   \        V4      R R2p	V	# VR R2p	V	#   \         d    T! 4       u # i ; i  \
         d    T! 4       u # i ; i)	c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   ,CSSResolver.size_to_pt.<locals>.__annotate__[  s     	J 	J 	Jr   c                 |   < \         P                  ! R S: 2\        \        4       R7       SP	                  RS R7      # )zUnhandled size: r   z
1!!defaultr   )r&   r'   r   r   r   )r   r   r   s   r   _error&CSSResolver.size_to_pt.<locals>._error[  s7    MM"6*-+-
 ??<[?IIr   z^(\S*?)([a-zA-Z%!].*)r4   rO   rP   rQ   df)rematchgroupsr   
ValueErrorr%   roundint)
r   r   r   r   r   r   ry   unitmulsize_fmts
   ff&f      r   r   CSSResolver.size_to_ptX  s
   	J 	J 16:=8OLLN	"9C Cj dlt|= DLCD '-	 JCCms8s?c(1R(H  a|H/   x    x s$   C ;C CCC21C2c                    V ^8  d   QhRRRR/# )r   rd   r   r   r   r   )r   s   "r   r   rg     s     " "H "1K "r   c              #  	   "   V F`  w  r#VP                  4       pVP                  4       pW P                  9   d'   V P                  V,          pV! WV4       R j  xL
  K[  W#3x  Kb  	  R #  L5ir?   )r@   CSS_EXPANSIONS)r   rd   r   r   r.   s   &&   r   rI   CSSResolver.atomize  s`     'KD::<DKKME***,,T2!$e444k! (
 5s   AA-A+A-c                    V ^8  d   QhRRRR/# )r   declarations_strr   r   zIterator[tuple[str, str]]r   )r   s   "r   r   rg     s      c .G r   c              #  ~  "   VP                  R4       F  pVP                  4       '       g   K  VP                  R4      w  r4pVP                  4       P                  4       pVP                  4       P                  4       pV'       d   W53x  Kz  \        P
                  ! RV: 2\        \        4       R7       K  	  R# 5i)z
Generates (prop, value) pairs from declarations.

In a future version may generate parsed tokens from tinycss/tinycss2

Parameters
----------
declarations_str : str
;:z-Ill-formatted attribute: expected a colon in r   N)r"   strip	partitionr@   r&   r'   r   r   )r   r   declr   sepry   s   &&    r   rj   CSSResolver.parse  s      %**3/D::<<!^^C0NDs::<%%'D))+##%CiCD8L/1 0s   B;B=r   )rO      )rP   r   )rO      )rP         ?)rO   g      ?)rO   H   )rU   gL&d2?)rU   g
BP(?)rW   g      ?)rP       )rP   g{Gz?)rQ   r   )rQ   g      ?)rQ   g?)rQ   r   )rQ   g      ?)rQ   g      ?)rQ   r   )rP   g?)rP   g333333?)rO   r   )rS      )rS   r   )rS   r   )r;   hiddendotteddashedsoliddoublegrooveridgeinsetoutsetmediumdashdot
dashdotdothairmediumdashdotdotdashdotslantdashdotmediumdashed)r   r   r   r   )r   r   r   r   )r   r   r   r   )r   r   r      )toprightbottomleft)r4   r   r   r   r   )colorstylewidthr?   )__name__
__module____qualname____firstlineno____doc__UNIT_RATIOSrw   r   updater   rH   rF   r#   r)   rM   r0   r   rp   rl   rm   r   r   rn   r   rI   rj   __static_attributes__)r   s   0r   r   r   ~   s   
 	iizkljj\YK #'')~\j^|
k	
   $$&M&),-%**,IYiI		
M* 	
<	<	<	<	O /E ?
> "&wtf86Ft6LL>
 4
3 dVn~dV-DEE3
 	./>.1N7/r,4. 26;-^" E

s   EE*E r   )r4   )r   
__future__r   r   typingr   r&   pandas.errorsr   pandas.util._exceptionsr   collections.abcr   r   r   r	   r0   rM   r   r   r   r   <module>r      sC    # 	    $ 4 (V9xk kr   