+
    Bii                        ^ RI t ^ RIHt ^ RIHtHt ^ RIHt ^ RIH	t	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Ht ^RIHtHt ^R	IHtHt ]]R
3,          t ! R R4      t ] ! R R
4      4       t!]!! 4       t" ! R R4      t#R# )    N)	lru_cache)dumpsloads)randint)AnyDictIterableListOptionalTypeUnioncast)errors)ColorColorParseErrorColorSystem	blend_rgb)Result	rich_repr)DEFAULT_TERMINAL_THEMETerminalThemeStylec                   N   a  ] tR t^t o RtR.tV 3R lR ltV 3R lR ltRtV t	R# )	_Bitz.A descriptor to get/set a style attribute bit.bitc                $   < V ^8  d   QhRS[ RR/# )   bit_noreturnNint)format__classdict__s   ";/usr/lib/python3.14/site-packages/pip/_vendor/rich/style.py__annotate___Bit.__annotate__   s      s t     c                "    ^V,          V n         R# )   Nr   )selfr   s   &&r$   __init___Bit.__init__   s    ;r'   c                H   < V ^8  d   QhRRRS[ R,          RS[S[,          /# )r   objr   objtyper   )r   r   bool)r"   r#   s   "r$   r%   r&      s*      7 T'] x~ r'   c                    VP                   V P                  ,          '       d!   VP                  V P                  ,          ^ 8g  # R# )r   N)_set_attributesr   _attributes)r+   r/   r0   s   &&&r$   __get___Bit.__get__   s2    ))??TXX-22r'   r*   N)
__name__
__module____qualname____firstlineno____doc__	__slots__r,   r5   __static_attributes____classdictcell__r#   s   @r$   r   r      s#     8I  r'   r   c            "         a  ] tR t^t o Rt. RtOt^ R^R^R^R^R^R^R^R	^R
^	R^
R^R^R/t/ RRbRRbRRbRRbRRbRRbRRbRRbRRbRRbRRbRRbRRbRRbRRbRRbRRbR RR!R!R"R"R#R#R$R#/CtR%R&R'R&RR&RR&RR&RR&RR&RR&RR&RR&RR&RR&R!R&R"R&R#R&R(R&R)R&/V 3R* lR+ llt]	V 3R, lR- l4       t
]	RuV 3R. lR/ ll4       t]	V 3R0 lR1 l4       t]	RvV 3R2 lR3 ll4       t]! ^ 4      t]! ^4      t]! ^4      t]! ^4      t]! ^4      t]! ^4      t]! ^4      t]! ^4      t]! ^4      t]! ^	4      t]! ^
4      t]! ^4      t]! ^4      t]V 3R4 lR5 l4       tV 3R6 lR7 ltV 3R8 lR9 ltV 3R: lR; lt ]	]!! R<R=7      V 3R> lR? l4       4       t"]	V 3R@ lRA l4       t#V 3RB lRC lt$V 3RD lRE lt%V 3RF lRG lt&V 3RH lRI lt']V 3RJ lRK l4       t(]V 3RL lRM l4       t)]V 3RN lRO l4       t*]V 3RP lRQ l4       t+]V 3RR lRS l4       t,]V 3RT lRU l4       t-]V 3RV lRW l4       t.]	]!! RXR=7      V 3RY lRZ l4       4       t/]!! R<R=7      RvV 3R[ lR\ ll4       t0]	V 3R] lR^ l4       t1]	V 3R_ lR` l4       t2V 3Ra lRb lt3]!! ^R=7      V 3Rc lRd l4       t4RvV 3Re lRf llt5RwRg]6Pn                  RhRi/V 3Rj lRk lllt8RvV 3Rl lRm llt9]!! R<R=7      V 3Rn lRo l4       t:V 3Rp lRq lt;V 3Rr lt<Rst=V t>R&# )xr   a|  A terminal style.

A terminal style consists of a color (`color`), a background color (`bgcolor`), and a number of attributes, such
as bold, italic etc. The attributes have 3 states: they can either be on
(``True``), off (``False``), or not set (``None``).

Args:
    color (Union[Color, str], optional): Color of terminal text. Defaults to None.
    bgcolor (Union[Color, str], optional): Color of terminal background. Defaults to None.
    bold (bool, optional): Enable bold text. Defaults to None.
    dim (bool, optional): Enable dim text. Defaults to None.
    italic (bool, optional): Enable italic text. Defaults to None.
    underline (bool, optional): Enable underlined text. Defaults to None.
    blink (bool, optional): Enabled blinking text. Defaults to None.
    blink2 (bool, optional): Enable fast blinking text. Defaults to None.
    reverse (bool, optional): Enabled reverse text. Defaults to None.
    conceal (bool, optional): Enable concealed text. Defaults to None.
    strike (bool, optional): Enable strikethrough text. Defaults to None.
    underline2 (bool, optional): Enable doubly underlined text. Defaults to None.
    frame (bool, optional): Enable framed text. Defaults to None.
    encircle (bool, optional): Enable encircled text. Defaults to None.
    overline (bool, optional): Enable overlined text. Defaults to None.
    link (str, link): Link URL. Defaults to None.

12345678921515253dimdboldbitalici	underlineublinkblink2reverserconcealcstrikes
underline2uuframeencircleoverlineocolorNbgcolorlinkmetac          %        < V ^8  d   QhRS[ S[S[S[3,          ,          RS[ S[S[S[3,          ,          RS[ S[,          RS[ S[,          RS[ S[,          RS[ S[,          RS[ S[,          RS[ S[,          R	S[ S[,          R
S[ S[,          RS[ S[,          RS[ S[,          RS[ S[,          RS[ S[,          RS[ S[,          RS[ S[,          RS[ S[S[S[3,          ,          /# )r   rd   re   rP   rN   rR   rT   rV   rW   rX   rZ   r\   r^   r`   ra   rb   rf   rg   )r   r   r   strr1   r   r   )r"   r#   s   "r$   r%   Style.__annotate__z   s>    JT JT eSj)*JT %s
+,	JT
 tnJT d^JT JT D>JT ~JT JT $JT $JT JT TNJT ~JT  4.!JT" 4.#JT$ sm%JT& tCH~&'JTr'   c               |   R V n         R V n        R R lpVf   R MV! V4      V n        Vf   R MV! V4      V n        \	        VR JVR J;'       d    ^VR J;'       d    ^VR J;'       d    ^VR J;'       d    ^VR J;'       d    ^ V	R J;'       d    ^@V
R J;'       d    ^VR J;'       d    RVR J;'       d    RVR J;'       d    RVR J;'       d    RVR J;'       d    R34      V n        V P
                  '       Ed   \	        T;'       d    ^;'       g    ^ T;'       d    ^;'       g    ^ T;'       d    ^;'       g    ^ T;'       d    ^;'       g    ^ T;'       d    ^;'       g    ^ T;'       d    ^ ;'       g    ^ T	;'       d    ^@;'       g    ^ T
;'       d    ^;'       g    ^ T;'       d    R;'       g    ^ T;'       d    R;'       g    ^ T;'       d    R;'       g    ^ T;'       d    R;'       g    ^ T;'       d    R;'       g    ^ 34      M^ V n        VV n        Vf   R M
\        V4      V n	        V'       g	   V'       d$   \        ^ R4       \        V P                  4       2MR	V n        R V n        V P
                  ;'       g!    T;'       g    T;'       g    T;'       g    T'       * V n        R # )
Nc                R    V ^8  d   QhR\         \        \        3,          R\        /# )r   rd   r   )r   r   ri   )r"   s   "r$   r%   $Style.__init__.<locals>.__annotate__   s'     	M 	MuUCZ0 	MU 	Mr'   c                 ^    \        V \        4      '       d   V # \        P                  ! V 4      # N)
isinstancer   parse)rd   s   &r$   _make_color#Style.__init__.<locals>._make_color   s"    &ue445L%++e:LLr'                  ?B  )_ansi_style_definition_color_bgcolorsumr3   r4   _linkr   _metar   hash_link_id_hash_null)r+   rd   re   rP   rN   rR   rT   rV   rW   rX   rZ   r\   r^   r`   ra   rb   rf   rg   rr   s   &$$$$$$$$$$$$$$$$$ r$   r,   Style.__init__z   s   * %)
04	M $mdU1C '[5I"D 4%%Ad"((q%++!T!((bd"))rt#**t#++d"**s$&..3T!**d$--$-- 
F #### JJQOO!IIANNLLq%%AOO!((qLLb%%AMMr&&QNN''aOO((qNNs''a&&3++!NNd''a%%**%%**$ ' 	, 
!\TuT{
:>$wq&!"4

#3"45R 	 %)
..RR%RR7RRdRRdS
r'   c                   < V ^8  d   QhRR/# r   r   r    )r"   r#   s   "r$   r%   rj      s      W r'   c                    \         # )zCCreate an 'null' style, equivalent to Style(), but more performant.)
NULL_STYLE)clss   &r$   null
Style.null   s
     r'   c                J   < V ^8  d   QhRS[ S[,          RS[ S[,          RR/# )r   rd   re   r   r   r   r   )r"   r#   s   "r$   r%   rj      s-      UO5=e_	r'   c                    V P                  \        4      pRVn        RVn        Wn        W#n        ^ Vn        ^ Vn        RVn        RVn	        RVn
        T;'       g    T'       * Vn        RVn        V# )zCreate a new style with colors and no attributes.

Returns:
    color (Optional[Color]): A (foreground) color, or None for no color. Defaults to None.
    bgcolor (Optional[Color]): A (background) color, or None for no color. Defaults to None.
Nrz   )__new__r   r{   r|   r}   r~   r3   r4   r   r   r   r   r   )r   rd   re   styles   &&& r$   
from_colorStyle.from_color   sn     {{5)"&  ! ++G,r'   c                J   < V ^8  d   QhRS[ S[S[S[3,          ,          RR/# )r   rg   r   r   r   r   ri   r   )r"   r#   s   "r$   r%   rj      s(      Xd38n5 ' r'   c                (   V P                  \        4      pRVn        RVn        RVn        RVn        ^ Vn        ^ Vn        RVn        \        V4      Vn
        \        ^ R4       \        VP                  4       2Vn        RVn        V'       * Vn        V# )zCreate a new style with meta data.

Returns:
    meta (Optional[Dict[str, Any]]): A dictionary of meta data. Defaults to None.
Nry   )r   r   r{   r|   r}   r~   r3   r4   r   r   r   r   r   r   r   r   )r   rg   r   s   && r$   	from_metaStyle.from_meta   s     {{5)"& !Dk#Av./U[[0A/BCjr'   c                P   < V ^8  d   QhRS[ S[S[S[3,          ,          RS[RR/# )r   rg   handlersr   r   r   )r"   r#   s   "r$   r%   rj      s/     # #htCH~. #3 #7 #r'   c                    Vf   / MTpTP                  VP                  4        UUu/ uF  w  r4RV 2VbK  	  upp4       V P                  V4      # u uppi )a@  Create a blank style with meta information.

Example:
    style = Style.on(click=self.on_click)

Args:
    meta (Optional[Dict[str, Any]], optional): An optional dict of meta information.
    **handlers (Any): Keyword arguments are translated in to handlers.

Returns:
    Style: A Style with meta information attached.
@)updateitemsr   )r   rg   r   keyvalues   &&,  r$   onStyle.on   sU     \rt8HI8H*#qY%8HIJ}}T"" Js   A
c                    < V ^8  d   QhRS[ /# r   r   ri   )r"   r#   s   "r$   r%   rj     s       r'   c                    V P                   # )z+Get a link id, used in ansi code for links.)r   r+   s   &r$   link_idStyle.link_id       }}r'   c                    < V ^8  d   QhRS[ /# r   r   )r"   r#   s   "r$   r%   rj     s     ,& ,& ,&r'   c                t   V P                   Ef   . pVP                  pV P                  pV^,          '       d   V^,          '       d   T! V P                  '       d   RMR4       V^,          '       d   T! V P                  '       d   RMR4       V^,          '       d   T! V P
                  '       d   RMR4       V^,          '       d   T! V P                  '       d   RMR4       VR	,          '       d   V^,          '       d   T! V P                  '       d   R
MR4       V^ ,          '       d   T! V P                  '       d   RMR4       V^@,          '       d   T! V P                  '       d   RMR4       V^,          '       d   T! V P                  '       d   RMR4       VR!,          '       d   T! V P                  '       d   RMR4       VR,          '       d   VR",          '       d   T! V P                  '       d   RMR4       VR#,          '       d   T! V P                  '       d   RMR4       VR$,          '       d   T! V P                  '       d   RMR4       VR%,          '       d   T! V P                  '       d   RMR4       V P                   e   V! V P                   P"                  4       V P$                  e%   V! R4       V! V P$                  P"                  4       V P&                  '       d   V! R4       V! V P&                  4       RP)                  V4      ;'       g    R V n         V P                   # )&z-Re-generate style definition from attributes.rP   znot boldrN   znot dimrR   z
not italicrT   znot underline  rV   z	not blinkrW   z
not blink2rX   znot reverserZ   znot concealr\   z
not strike   r^   znot underline2r`   z	not framera   znot encirclerb   znot overliner   rf    nonert   ru   rv   rw   rx   )r|   appendr3   rP   rN   rR   rT   rV   rW   rX   rZ   r\   r^   r`   ra   rb   r}   namer~   r   join)r+   
attributesr   bitss   &   r$   __str__Style.__str__  s0   !!)$&J&&F''Do%%!88TYYY6J?6??DHHH5)<6??t{{{8E6??$...;oNo%%6??djjj7kB6??t{{{8E6??9-H6??9-H6??t{{{8Eo%%6??4???<@PQ7##djjj7kB7##:NK7##:NK{{&t{{''(}}(tt}}))*zzzvtzz"%(XXj%9%C%CVD"%%%r'   c                    < V ^8  d   QhRS[ /# r   r1   )r"   r#   s   "r$   r%   rj   K  s      $ r'   c                $    V P                   '       * # )z;A Style is false if it has no attributes, colors, or links.)r   r   s   &r$   __bool__Style.__bool__K  s    ::~r'   c                &   < V ^8  d   QhRS[ RS[/# )r   color_systemr   )r   ri   )r"   r#   s   "r$   r%   rj   O  s     ) )[ )S )r'   c                   V P                   Ef   . pVP                  pV P                  pV P                  V P                  ,          pV'       Ed	   V^,          '       d   V! V^ ,          4       V^,          '       d   V! V^,          4       V^,          '       d   V! V^,          4       V^,          '       d   V! V^,          4       VR,          '       d:   \        ^^	4       F)  pV^V,          ,          '       g   K  V! WF,          4       K+  	  VR,          '       d:   \        ^	^4       F)  pV^V,          ,          '       g   K  V! WF,          4       K+  	  V P                  e9   VP                  V P                  P                  V4      P                  4       4       V P                  e;   VP                  V P                  P                  V4      P                  RR7      4       RP                  V4      V n         V P                   # )zGenerate ANSI codes for this style.

Args:
    color_system (ColorSystem): Color system.

Returns:
    str: String containing codes.
r   r   F
foreground;)r{   r   
_style_mapr4   r3   ranger}   extend	downgradeget_ansi_codesr~   r   )r+   r   sgrr   r   r   r   s   &&     r$   _make_ansi_codesStyle._make_ansi_codesO  s    ::CZZFJ))D,@,@@Jz>>:a=)>>:a=)>>:a=)>>:a=)//$Q{%c22":?3  + //$Q|%c22":?3  , {{&

4;;00>MMOP}}(

MM++L9HH#( I 
 #DJzzr'   rv   )maxsizec                &   < V ^8  d   QhRS[ RS[ /# )r   r   r   r   )r"   r#   s   "r$   r%   rj   |  s     ) )c )c )r'   c                     \        V P                  V4      4      #   \        P                   d"    TP	                  4       P                  4       u # i ; i)zNormalize a style definition so that styles with the same effect have the same string
representation.

Args:
    style (str): A style definition.

Returns:
    str: Normal form of style definition.
)ri   rq   r   StyleSyntaxErrorstriplower)r   r   s   &&r$   	normalizeStyle.normalizez  sE    	)syy'((&& 	);;=&&((	)s    3AAc                6   < V ^8  d   QhRS[ S[,          RS[/# )r   valuesr   )r   	StyleType)r"   r#   s   "r$   r%   rj     s$     A A)!4 A Ar'   c                :    V F  pVf   K	  Vu # 	  \        R4      h)zPick first non-None style.z$expected at least one non-None style)
ValueError)r   r   r   s   &* r$   
pick_firstStyle.pick_first  s'     E   ?@@r'   c                    < V ^8  d   QhRS[ /# r   )r   )r"   r#   s   "r$   r%   rj     s     $ $v $r'   c              #  T  "   R V P                   R3x  RV P                  R3x  RV P                  R3x  RV P                  R3x  RV P                  R3x  RV P
                  R3x  RV P                  R3x  RV P                  R3x  R	V P                  R3x  R
V P                  R3x  RV P                  R3x  RV P                  R3x  RV P                  R3x  RV P                  R3x  RV P                  R3x  V P                  '       d   RV P                   3x  R# R# 5i)rd   Nre   rP   rN   rR   rT   rV   rW   rX   rZ   r\   r^   r`   ra   rf   rg   )rd   re   rP   rN   rR   rT   rV   rW   rX   rZ   r\   r^   r`   ra   rf   r   rg   r   s   &r$   __rich_repr__Style.__rich_repr__  s!    tzz4''t++dii&&TXXt$$T))4>>400tzz4''T))t++t++T))DOOT11tzz4''$----dii%%:::$))## s   D&D(c                &   < V ^8  d   QhRS[ RS[/# r   otherr   r   r1   )r"   r#   s   "r$   r%   rj          3 3C 3D 3r'   c                |    \        V\        4      '       g   \        # V P                  4       VP                  4       8H  # ro   rp   r   NotImplemented__hash__r+   r   s   &&r$   __eq__Style.__eq__  -    %''!!}}%.."222r'   c                &   < V ^8  d   QhRS[ RS[/# r   r   )r"   r#   s   "r$   r%   rj     r   r'   c                |    \        V\        4      '       g   \        # V P                  4       VP                  4       8g  # ro   r   r   s   &&r$   __ne__Style.__ne__  r   r'   c                    < V ^8  d   QhRS[ /# r   r    )r"   r#   s   "r$   r%   rj     s      # r'   c                    V P                   e   V P                   # \        V P                  V P                  V P                  V P
                  V P                  V P                  34      V n         V P                   # ro   )r   r   r}   r~   r4   r3   r   r   r   s   &r$   r   Style.__hash__  sa    ::!::  $$



	

 zzr'   c                0   < V ^8  d   QhRS[ S[,          /# r   r   )r"   r#   s   "r$   r%   rj     s      x r'   c                    V P                   # )z.The foreground color or None if it is not set.)r}   r   s   &r$   rd   Style.color  s     {{r'   c                0   < V ^8  d   QhRS[ S[,          /# r   r   )r"   r#   s   "r$   r%   rj     s      % r'   c                    V P                   # )z.The background color or None if it is not set.)r~   r   s   &r$   re   Style.bgcolor  r   r'   c                0   < V ^8  d   QhRS[ S[,          /# r   r   ri   )r"   r#   s   "r$   r%   rj     s      hsm r'   c                    V P                   # )zLink text, if set.)r   r   s   &r$   rf   
Style.link  s     zzr'   c                    < V ^8  d   QhRS[ /# r   r   )r"   r#   s   "r$   r%   rj     s     ? ? ?r'   c                Z    V P                   RJ ;'       g    V P                   P                  # )z6Check if the style specified a transparent background.N)re   
is_defaultr   s   &r$   transparent_backgroundStyle.transparent_background  s%     ||t#>>t||'>'>>r'   c                   < V ^8  d   QhRR/# r   r   )r"   r#   s   "r$   r%   rj     s     + +' +r'   c                .    \        V P                  R7      # )zA Style with background only.)re   )r   re   r   s   &r$   background_styleStyle.background_style  s     T\\**r'   c                6   < V ^8  d   QhRS[ S[S[3,          /# r   )r   ri   r   )r"   r#   s   "r$   r%   rj     s     U Ud38n Ur'   c                    V P                   f   / # \        \        \        \        3,          \        V P                   4      4      # )z=Get meta information (can not be changed after construction).)r   r   r   ri   r   r   r   s   &r$   rg   
Style.meta  s0     ZZ'rTT$sCx.%

BS-TTr'   c                   < V ^8  d   QhRR/# r   r   )r"   r#   s   "r$   r%   rj     s      w r'   c                t   V P                   '       d   \        # V P                  \        4      pRVn        RVn        RVn        RVn        V P                  Vn        V P                  Vn	        V P                  Vn
        V P                  '       d   \        ^ R4       MRVn        RVn         RVn        RVn        V# )z+Get a copy of the style with color removed.Nry   rz   F)r   r   r   r   r{   r|   r}   r~   r4   r3   r   r   r   r   r   r+   r   s   & r$   without_colorStyle.without_color  s     :::||E*"& ,, $ 4 4jj48JJJGAv./Br'   rx   c                $   < V ^8  d   QhRS[ RR/# )r   style_definitionr   r   r   )r"   r#   s   "r$   r%   rj     s     ? ?S ?W ?r'   c           	        VP                  4       R8X  g	   V'       g   V P                  4       # V P                  pRpRp/ pRp\        VP	                  4       4      pV EF	  pVP                  4       p	V	R8X  dF   \        VR4      p	V	'       g   \        P                  ! R4      h \        P                  ! V	4       T	pK`  V	R8X  dB   \        VR4      p	VP                  V	4      pVf   \        P                  ! R	V	: 24      hR
W[&   K  V	R8X  d/   \        VR4      p	V	'       g   \        P                  ! R4      hT	pK  W9   d   RWRV	,          &   K   \        P                  ! V	4       T	pEK  	  \        RRVRVRV/VB pV#   \         d$   p
\        P                  ! RT	: RT
 24      RhRp
?
ii ; i  \         d$   p
\        P                  ! RT	: RT
 24      RhRp
?
ii ; i)zParse a style definition.

Args:
    style_definition (str): A string containing a style.

Raises:
    errors.StyleSyntaxError: If the style definition syntax is invalid.

Returns:
    `Style`: A Style instance.
r   Nr   rz   zcolor expected after 'on'zunable to parse z as background color; notz,expected style attribute after 'not', found Frf   zURL expected after 'link'Tz as color; rd   re   r   )r   r   STYLE_ATTRIBUTESitersplitr   nextr   r   r   rq   r   getr   )r   r  r  rd   re   r   rf   wordsoriginal_wordworderror	attributer   s   &&           r$   rq   Style.parse  s    !!#v-5E88://#!%/1
"%++-."M &&(Dt|E2 112MNN KK%
 E2,006	$ 11FthO  ).
%E2 112MNN)59
D12 KK%
 O #P LEL7LLLC '   11*4(2HP  6 '   11*4(+eWE  s0   #E>F/>F,	F''F,/G:GGc                6   < V ^8  d   QhRS[ S[,          RS[/# )r   themer   )r   r   ri   )r"   r#   s   "r$   r%   rj   4  s      " "H]$; "s "r'   c                L   T;'       g    \         p. pVP                  pV P                  pV P                  pV P                  '       d   YTrTV P
                  '       dL   Vf   VP                  MVP                  V4      p\        P                  ! \        WaP                  R4      4      pVe<   VP                  V4      pV! RVP                   24       V! RVP                   24       Ve)   VP                  VRR7      pV! RVP                   24       V P                  '       d	   V! R4       V P                  '       d	   V! R4       V P                  '       d	   V! R	4       V P                   '       d	   V! R
4       V P"                  '       d	   V! R4       RP%                  V4      # )zGet a CSS style rule.g      ?zcolor: ztext-decoration-color: Fr   zbackground-color: zfont-weight: boldzfont-style: italicztext-decoration: underlineztext-decoration: line-throughztext-decoration: overlinez; )r   r   rd   re   rX   rN   foreground_colorget_truecolorr   from_tripletr   background_colorhexrP   rR   rT   r\   rb   r   )r+   r  cssr   rd   re   r!  theme_colors   &&      r$   get_html_styleStyle.get_html_style3  se    ///

,,<<<$7888*/-&&U=P=PQV=W  &&*,B,BCHE --e4KW[__-./,[__,=>?!//%/HK''89:999&';;;'(>>>/0;;;23===./yy~r'   c                2   < V ^8  d   QhRS[ R,          RR/# r   stylesr   r   )r	   )r"   r#   s   "r$   r%   rj   Y  s      
3 
3Xg. 
37 
3r'   c                B    \        V4      p\        V\        V4      4      # )zCombine styles and get result.

Args:
    styles (Iterable[Style]): Styles to combine.

Returns:
    Style: A new style instance.
r  r   r  r   r,  iter_styless   && r$   combineStyle.combineX       6l;[ 122r'   c                "   < V ^8  d   QhRRRR/# r+  r   )r"   r#   s   "r$   r%   rj   f  s     
3 
3G 
3 
3r'   c                B    \        V4      p\        V\        V4      4      # )zCombine styles from positional argument in to a single style.

Args:
    *styles (Iterable[Style]): Styles to combine.

Returns:
    Style: A new style instance.
r.  r/  s   &* r$   chainStyle.chaine  r3  r'   c                   < V ^8  d   QhRR/# r   r   )r"   r#   s   "r$   r%   rj   r  s      g r'   c                   V P                   '       d   \        # V P                  \        4      pV P                  Vn        V P
                  Vn        V P                  Vn        V P                  Vn        V P                  Vn        V P                  Vn	        V P                  Vn
        V P                  '       d   \        ^ R4       MRVn        V P                  Vn        RVn         V P                  Vn        V# )z_Get a copy of this style.

Returns:
    Style: A new Style instance with identical attributes.
ry   rz   F)r   r   r   r   r{   r|   r}   r~   r4   r3   r   r   r   r   r   r  s   & r$   copy
Style.copyr  s     :::||E*jj"&"8"8{{ ,, $ 4 4jj48JJJGAv./Bjjjjr'   c                   < V ^8  d   QhRR/# r   r   )r"   r#   s   "r$   r%   rj     s      g r'   c                r   V P                   '       d   \        # V P                  \        4      pV P                  Vn        V P
                  Vn        V P                  Vn        V P                  Vn        V P                  Vn        V P                  Vn	        RVn
        RVn        RVn        RVn         RVn        V# )zhGet a copy of this style with link and meta information removed.

Returns:
    Style: New style object.
Nrz   F)r   r   r   r   r{   r|   r}   r~   r4   r3   r   r   r   r   r  s   & r$   clear_meta_and_linksStyle.clear_meta_and_links  s     :::||E*jj"&"8"8{{ ,, $ 4 4r'   c                4   < V ^8  d   QhRS[ S[,          RR/# )r   rf   r   r   r   )r"   r#   s   "r$   r%   rj     s        r'   c                ~   V P                  \        4      pV P                  Vn        V P                  Vn        V P                  Vn        V P
                  Vn        V P                  Vn        V P                  Vn        Wn        V'       d   \        ^ R4       MRVn
        RVn        RVn        V P                  Vn        V# )zGet a copy with a different value for link.

Args:
    link (str, optional): New value for link. Defaults to None.

Returns:
    Style: A new Style instance.
ry   rz   NF)r   r   r{   r|   r}   r~   r4   r3   r   r   r   r   r   r   )r+   rf   r   s   && r$   update_linkStyle.update_link  s     ||E*jj"&"8"8{{ ,, $ 4 448GAv./bjjr'   r   legacy_windowsFc                B   < V ^8  d   QhRS[ RS[S[,          RS[RS[ /# )r   textr   rD  r   )ri   r   r   r1   )r"   r#   s   "r$   r%   rj     s8       {+	
  
r'   c                  V'       d   Vf   V# V P                   ;'       g    V P                  V4      pV'       d
   RV RV R2MTpV P                  '       d)   V'       g!   RV P                   RV P                   RV R2pV# )a  Render the ANSI codes for the style.

Args:
    text (str, optional): A string to style. Defaults to "".
    color_system (Optional[ColorSystem], optional): Color system to render to. Defaults to ColorSystem.TRUECOLOR.

Returns:
    str: A string containing ANSI style codes.
z[mz[0mz]8;id=r   z\z]8;;\)r{   r   r   r   )r+   rF  r   rD  attrsrendereds   &&$$  r$   renderStyle.render  s|      |+K

AAd33LA49U5'4&0t:::nT]]O1TZZLxjW  r'   c                4   < V ^8  d   QhRS[ S[,          RR/# )r   rF  r   Nr   )r"   r#   s   "r$   r%   rj     s     
3 
3# 
3$ 
3r'   c                    T;'       g    \        V 4      p\        P                  P                  V P	                  V4       R24       R# )zWrite text with style directly to terminal.

This method is for testing purposes only.

Args:
    text (Optional[str], optional): Text to style or None for style name.


N)ri   sysstdoutwriterK  )r+   rF  s   &&r$   test
Style.test  s8       s4y

DKK-.b12r'   c                2   < V ^8  d   QhRS[ R,          RR/# r   r   r   r   r   )r"   r#   s   "r$   r%   rj     s       (7+  r'   c                   Ve   VP                   '       d   V # V P                   '       d   V# V P                  \        4      pR Vn        R Vn        VP
                  ;'       g    V P
                  Vn        VP                  ;'       g    V P                  Vn        V P                  VP                  ( ,          VP                  VP                  ,          ,          Vn        V P                  VP                  ,          Vn        VP                  ;'       g    V P                  Vn	        VP                  ;'       g    V P                  Vn
        VP                   Vn         V P                  '       d<   VP                  '       d*   \        / V P                  CVP                  C4      Vn        M%V P                  ;'       g    VP                  Vn        R Vn        V# ro   )r   r   r   r{   r|   r}   r~   r4   r3   r   r   r   r   rg   r   )r+   r   	new_styles   && r$   _add
Style._add  sM   =EKKKK:::L<<.		&*	# <<664;;	"^^<<t}}	!%!1!1U5J5J4J!J 5 55!
	 %)$8$85;P;P$P	!++33	"^^<<t}}	++	:::%+++#$?tyy$?EJJ$?@IO"jj77EKKIO	r'   c                2   < V ^8  d   QhRS[ R,          RR/# rV  rW  )r"   r#   s   "r$   r%   rj     s$     P PXg. P7 Pr'   c                l    V P                  V4      pVP                  '       d   VP                  4       # T# ro   )rZ  rf   r:  )r+   r   combined_styles   && r$   __add__Style.__add__  s/    5)(6(;(;(;~""$OOr'   c                   < V ^8  d   Qh/ S[ S[,          ;R&   S[ S[,          ;R&   S[;R&   S[;R&   S[ S[,          ;R&   S[;R&   S[ S[,          ;R&   # )r   r}   r~   r4   r3   r   r   r   )r   r   r!   r1   bytes)r"   r#   s   "r$   r%   rj      su     8 UO9 : uo; < = > ? @ C=A B KC D E?E r'   )r{   r4   r~   r}   r   r   r   r   r   r3   r|   )r}   r~   r4   r3   r   r   r{   r|   r   r   r   )NNro   )rz   )?r7   r8   r9   r:   r;   r<   r   r  r,   classmethodr   r   r   r   r   rP   rN   rR   rT   rV   rW   rX   rZ   r\   r^   r`   ra   rb   propertyr   r   r   r   r   r   r   r   r   r   r   rd   re   rf   r  r  rg   r  rq   r(  r1  r6  r:  r>  rB  r   	TRUECOLORrK  rS  rZ  r_  __annotate_func__r=   r>   r?   s   @r$   r   r      s    DI  	
3	3	3	3	3	3	3	3	3	4
D
D
DJ uU 	 	V	
 	( 	X 	[ 	[ 	 	( 	9 	Y 	9 	Y 	(  	X!" 	l#$ 	lJJZ-2JT .2JT 04	JT
  $JT #JT "&JT %)JT !%JT "&JT #'JT #'JT "&JT &*JT !%JT  $(!JT" $(#JT$ #%JT& *.'JT JTX     .  ( # # #" 7D
q'C!WFQIGE!WF1gG1gG!WFaJHEBxHBxH ,& ,&\ ) )V t)  ) A A$ $&3 3
3 3
        ? ? + + U U  $ t?  ?B t" " "H 
3 
3 
3 
3 , s , . /:.C.C	
  % 4
3 
3 t 0P Po  r'   c                      a  ] tR tRt o RtR.tV 3R lR ltV 3R lR lt]V 3R lR	 l4       t	V 3R
 lR lt
V 3R lR ltRtV tR# )
StyleStacki  zA stack of styles._stackc                "   < V ^8  d   QhRRRR/# )r   default_styler   r   Nr   )r"   r#   s   "r$   r%   StyleStack.__annotate__  s     3 3g 3$ 3r'   c                    V.V n         R # ro   ri  )r+   rk  s   &&r$   r,   StyleStack.__init__  s    $1?r'   c                    < V ^8  d   QhRS[ /# r   r   )r"   r#   s   "r$   r%   rl    s     / /# /r'   c                $    R V P                   : R2# )z<stylestack >rn  r   s   &r$   __repr__StyleStack.__repr__  s    dkk_A..r'   c                    < V ^8  d   QhRS[ /# r   r   )r"   r#   s   "r$   r%   rl  	  s       r'   c                (    V P                   R,          # )z&Get the Style at the top of the stack.rn  r   s   &r$   currentStyleStack.current  s     {{2r'   c                $   < V ^8  d   QhRS[ RR/# )r   r   r   Nrv  )r"   r#   s   "r$   r%   rl    s     4 4% 4D 4r'   c                l    V P                   P                  V P                   R,          V,           4       R# )zePush a new style on to the stack.

Args:
    style (Style): New style to combine with current style.
Nrx  )ri  r   r  s   &&r$   pushStyleStack.push  s#     	4;;r?U23r'   c                    < V ^8  d   QhRS[ /# r   rv  )r"   r#   s   "r$   r%   rl    s      U r'   c                \    V P                   P                  4        V P                   R,          # )zePop last style and discard.

Returns:
    Style: New current style (also available as stack.current)
rx  )ri  popr   s   &r$   r  StyleStack.pop  s      	{{2r'   rn  N)r7   r8   r9   r:   r;   r<   r,   rs  rd  ry  r}  r  r=   r>   r?   s   @r$   rh  rh    sK     
I3 3/ /  4 4 r'   rh  )$rP  	functoolsr   marshalr   r   randomr   typingr   r   r	   r
   r   r   r   r   rz   r   rd   r   r   r   r   reprr   r   terminal_themer   r   ri   r   r   r   r   rh  r   r'   r$   <module>r     sv    
     I I I  A A # A #w,	  XP XP XPv W
 r'   