
    @OOf                        d Z ddlZi ddddddd	d
dddddddddddddddddddddd d!d"d#d$Zd%Z	 d7d&ej
                  eej                  eeef   ef   d'ed(efd)Z		 	 	 	 	 	 	 	 	 	 	 d8d*ej                  d+ej                  ej
                  eej                  eeef   ef      d,ej                  ej
                  eej                  eeef   ef      d-ej                  e   d.ej                  e   d/ej                  e   d0ej                  e   d1ej                  e   d2ej                  e   d3ej                  e   d4ej                  e   ded(efd5Zd6gZy)9zS
SPDX-License-Identifier: BSD-3-Clause

A vendored copy of click.style() @ 4f7b255
    Nblack   red   green    yellow!   blue"   magenta#   cyan$   white%   reset'   bright_blackZ   
bright_red[   bright_green\   bright_yellow]   bright_blue^   bright_magenta_   bright_cyan`   bright_whitea   z[0mcoloroffsetreturnc                     t        | t              rd|z    d| dS t        | t        t        f      r| \  }}}d|z    d|dd|dd|dS t	        t
        |    |z         S )N&   z;5;dz;2;;)
isinstanceinttupleliststr_ansi_colors)r%   r&   rgbs        a/var/www/premiumrankchecker/venv/lib/python3.12/site-packages/mitmproxy/contrib/click/__init__.py_interpret_colorr6      sz     %v+c%++%%'1av+c!Aa!uAaU33|E"V+,,    textfgbgbolddim	underlineoverlineitalicblinkreversestrikethroughc                 T   t        | t              st        |       } g }|r	 |j                  dt        |       d       |r 	 |j                  dt        |d       d       ||j                  d|rdnd d       ||j                  d|rdnd d       ||j                  d|rd	nd
 d       ||j                  d|rdnd d       ||j                  d|rdnd d       ||j                  d|rdnd d       |	|j                  d|	rdnd d       |
|j                  d|
rdnd d       |j                  |        |r|j                  t               dj                  |      S # t        $ r t        d|      dw xY w# t        $ r t        d|      dw xY w)a  Styles a text with ANSI styles and returns the new string.  By
    default the styling is self contained which means that at the end
    of the string a reset code is issued.  This can be prevented by
    passing ``reset=False``.
    Examples::
        click.echo(click.style('Hello World!', fg='green'))
        click.echo(click.style('ATTENTION!', blink=True))
        click.echo(click.style('Some things', reverse=True, fg='cyan'))
        click.echo(click.style('More colors', fg=(255, 12, 128), bg=117))
    Supported color names:
    * ``black`` (might be a gray)
    * ``red``
    * ``green``
    * ``yellow`` (might be an orange)
    * ``blue``
    * ``magenta``
    * ``cyan``
    * ``white`` (might be light gray)
    * ``bright_black``
    * ``bright_red``
    * ``bright_green``
    * ``bright_yellow``
    * ``bright_blue``
    * ``bright_magenta``
    * ``bright_cyan``
    * ``bright_white``
    * ``reset`` (reset the color code only)
    If the terminal supports it, color may also be specified as:
    -   An integer in the interval [0, 255]. The terminal must support
        8-bit/256-color mode.
    -   An RGB tuple of three integers in [0, 255]. The terminal must
        support 24-bit/true-color mode.
    See https://en.wikipedia.org/wiki/ANSI_color and
    https://gist.github.com/XVilka/8346728 for more information.
    :param text: the string to style with ansi codes.
    :param fg: if provided this will become the foreground color.
    :param bg: if provided this will become the background color.
    :param bold: if provided this will enable or disable bold mode.
    :param dim: if provided this will enable or disable dim mode.  This is
                badly supported.
    :param underline: if provided this will enable or disable underline.
    :param overline: if provided this will enable or disable overline.
    :param italic: if provided this will enable or disable italic.
    :param blink: if provided this will enable or disable blinking.
    :param reverse: if provided this will enable or disable inverse
                    rendering (foreground becomes background and the
                    other way round).
    :param strikethrough: if provided this will enable or disable
        striking through text.
    :param reset: by default a reset-all code is added at the end of the
                  string which means that styles do not carry over.  This
                  can be disabled to compose styles.
    .. versionchanged:: 8.0
        A non-string ``message`` is converted to a string.
    .. versionchanged:: 8.0
       Added support for 256 and RGB color codes.
    .. versionchanged:: 8.0
        Added the ``strikethrough``, ``italic``, and ``overline``
        parameters.
    .. versionchanged:: 7.0
        Added support for bright colors.
    .. versionadded:: 2.0
    z[mzUnknown color N
                  5   7                     	       )r,   r0   appendr6   KeyError	TypeError_ansi_reset_alljoin)r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   r   bitss                r5   styler\   +   s   Z dC 4yD		?KK% 0 45Q78 
	?KK% 0R 89;< eA2.a01
eA"-Q/0eA3156e(B3156eAR023eAB/q12eAb134 eAB7q9:KKO$774=9  	?nRF34$>	?  	?nRF34$>	?s   E2 F 2FF'r\   )r   )NNNNNNNNNNT)__doc__typingtr1   rY   Unionr-   Tupler0   r6   AnyOptionalboolr\   __all__ r7   r5   <module>rg      s  
 R	2 R b	
 B r B R R B " B R 2 b  2!" B#&  EF
-773S#.34
->A
-
- AE@D! "&!%#" $&*q
%%q	

1773S# 6;<=q 	


1773S# 6;<=q **T
	q
 
D	q zz$q jjq JJtq ::dq ZZq ::d#q q 	qh )r7   