
    :)diH                    "   d Z ddlmZ ddlZddlZddlZddlmZ ddlm	Z	 ddl
m
Z
 ddlmZmZ ddlmZmZmZmZmZmZmZ ddlZdd	lmZ dd
lmZ ddlmZ ddlmZ ddlm Z m!Z! ddlm"Z# ddl$m%Z& ddl'm(Z(m)Z)m*Z*m+Z+ ddl,m-Z- ddl.m/Z/ dZ0dbdZ1 e	e&          dcd            Z% G d dej2                  Z3ddd$Z4ded*Z5 ed+d,d-id-.           ed/d0d1d23           ed4d5d6d78           ed9d: e3            d;<           ed=d> ej6        g d?d-@          dA<           edBdCdDdEF           edGdCd-dHdCdDdIJ           edKdCdCdDdLM           edNdOdPe5d-dCQ           e#dPR           edSdTdUdCdC e
dV          dPW           e dX           e dD           e dP          e!dfda                                                                                                                                                                                    Z7dS )gzThe command line interface.    )annotationsN)contextmanager)wraps)gettext)import_modulemetadata)AnyDict	GeneratorListLiteralOptionalTuple)ParameterSource)argument)command)option)option_panelpass_context)version_option)patch)COLORSFORMATSRichClickThemeNotFound	get_theme)RichContext)RichHelpConfigurationz[red]You can pass [b]--suppress-warnings[/b] to the rich-click CLI or set the [b]RICH_CLICK_CLI_SUPPRESS_WARNINGS[/b] environment variable to disable this message.[/red]groupstrreturn'metadata.EntryPoints'c                    t           j        dk    rt          j        |           S t          j                    }|                    | g           S )z:entry_points function that is compatible with Python 3.7+.)   
   r   )sysversion_infor   entry_pointsget)r   epgs     U/var/www/menimich/repos/protonApp/venv/lib/python3.11/site-packages/rich_click/cli.pyr(   r(   &   sF    
7""$51111


!
!C775"    argsr	   kwargsNonec                 R    dd l } |j        dt          d           t          | i |S )Nr   z`rich_click.cli.patch()` has moved to `rich_click.patch.patch()`. Importing `patch()` from `rich_click.cli` is deprecated; please import from `rich_click.patch` instead.   )
stacklevel)warningswarnDeprecationWarning_patch)r-   r.   r3   s      r+   r   r   0   sG    OOOHM	s	    4"6"""r,   c                  "    e Zd ZdZddZddZdS )_RichHelpConfigurationParamTypeJSONr    r   c                    dS )Nr9    )selfs    r+   __repr__z(_RichHelpConfigurationParamType.__repr__A   s    vr,   valueOptional[str]paramOptional[click.Parameter]ctxOptional[click.Context]Optional[Dict[str, Any]]c                   ||S 	 dd l }|                    d          rFt          |dd          d          5 }|                    |          }d d d            n# 1 swxY w Y   n|                    |          }t          |t                    st          d          |S # t          $ r`}|Q|j	        
                    dd          r6t          |                                           |                                 n|Y d }~d S d }~ww xY w)Nr   @   rz!--rich-config needs to be a JSON.	show_helpF)json
startswithopenloadloads
isinstancedict
ValueError	Exceptionparamsr)   printget_helpexit)r<   r>   r@   rB   rJ   fdataes           r+   convertz'_RichHelpConfigurationParamType.convertD   sY    =L##C(( -eABBi-- ,#yy||, , , , , , , , , , , , , , ,  ::e,,D!$-- J$%HIII    ?sz~~k5'I'I?#,,..)))HHJJJJG JJJJJs;   1B  AB  AB   A!>B   
D
*ADD
N)r    r   )r>   r?   r@   rA   rB   rC   r    rD   )__name__
__module____qualname__namer=   rZ   r;   r,   r+   r8   r8   >   sA        D        r,   r8   scriptsuppress_warningsboolTuple[str, str]c                   g }d}d}t          d          D ]}| |j        k    r{|sR|j                            dd          \  }}d|v r0|                    d          r|                    d          d         }|r n$|j        |vr|                    |j                   t          |          dk    r|s| t          j        v r<t          j        	                                }| d| ||
                    |           <   n	d	| d| g}dd l}|                    d
|  d|d| d| d| d| d|  dd                    |           dt                      d| v r|s|                     dd          \  }}|s| }||fS )N console_scriptsr%   :rG   z []r   
rich-clickz<[red]WARNING: Multiple entry_points correspond with script 'z': z.
This can happen when an 'egg-info' directory exists, you're using a virtualenv, and you have set a custom PYTHONPATH.

The selected script is 'zi', which is being executed now.

It is safer and recommended that you specify the MODULE:CLICK_COMMAND ('z') instead of the script ('z'), like this:[/]

>>>  

)r(   r^   r>   splitendswithappendlenr&   argvcopyindexrichrT   joinDISABLE_WARNINGS_NOTE)r_   r`   	_selectedmodule_pathfunction_names_argsrr   s           r+   "_get_module_path_and_function_namerz   b   s'   IKM 1222 	* 	*QV A-.W]]3-B-B*]=((]-C-CC-H-H($1$7$7$=$=a$@M  wi''  )))
9~~"3SXHMMOOE,7)I)I-)I)IE%++f%%&&!k#C#CM#C#CDE

+6 + +V_ + + ,7+ + :G+ +
 + +
 !.+ +
 KQ+ + xx+ + )+ +		
 		
 		
 f}}[}%+\\#q%9%9"] %%r,   rB   r   r@   click.Parameterr>   c                   |rddl m} ddlm} ddlm} ddlm} ddlm	} ddl
m} ddlm}	 |                                 }
 ||
j        j        |
j        j        |
j        j        |
j        j        	          }d
}d\  }}t)          j        d          }||                    d          rBddl}	 |                    |          }|                    d          }n# t4          $ r d}Y nw xY w|}|r]	 t7          |           d}d|v r|                    d          ^}}}n.|t:          v r|}d}n |t<          v r|}d}n# t>          $ r d
}Y nw xY w|d}n|sd|d}nd|d|pd d|pd } |dddddd|j         dd	  	        }d |j!        d         _"        d!|j!        d          _#        t=          j$                    D ]t}|j%        r
||j&        k    p|du o
|j&        d"k    }|'                    |rd#nd|j&        d$(                    d% |j)        dd&         D                       |j*                   u |ddddd|j         dd          }d!|j!        d          _#        t;          j$                    D ]A}||j&        k    p|du o
|j&        d'k    }|'                    |rd#nd|j&        |j*                   B | |	d(d)*          (                    |	+                    d+          |	+                    d,          |	+                    d-          |	+                    d.          |	+                    d/          g          d d
0          }|,                     | | ||d1d23           | ||d 4          d5d23           ||d67           ||d87          g          d
|j-        9                     | .                    d           dS dS ):zPrint all themes.r   )box)Console)Renderables)Padding)Panel)Table)Text)color_systemforce_terminalwidthlegacy_windowsF)NNRICH_CLICK_THEMEN{themeT-z([red bold]RICH_CLICK_THEME[/] is not setz#[red bold]RICH_CLICK_THEME[/]=[red]z[/] is not a valid theme.z.[blue bold]RICH_CLICK_THEME[/blue bold]=[blue]z[/blue]

[b]Colors:[/b] z[dim](null)[/]z
[b]Format:[/b] rd   NameColorsDescription)r   rG   dim)paddingborder_styler}   
show_linesexpandrG   bolddefault*ri   c                    g | ]}d | d	S )[u
   ]▓▓[/]r;   ).0_s     r+   
<listcomp>zlist_themes.<locals>.<listcomp>   s$    JJJ+a+++JJJr,   r#   r}   rj   fold)overflowz8[b]Themes[/b] are an easy way to style a rich-click CLI.zxAs an end-user of CLIs, you can set the [blue b]RICH_CLICK_THEME=[/blue b] env var to style all rich-click CLIs you use.zAs a developer, you can add a theme to your CLI with one line of code: [green b]@click.rich_config({'theme': 'name'})[/green b].zThemes consist of [b]Color Palettes[/b] and [b]Formats[/b], which can be mixed and matched: The name of a full theme has the following schema: [red]{color_palette}-{format}[/red].zjFor example, the [b]forest-slim[/b] theme uses the [b]forest[/b] color palette and the [b]slim[/b] format.)padr   z
How to used   )titler   )r   zLocal user settingzColor Palettes)r   Formats)r   r}   )/rr   r}   rich.consoler~   rich.containersr   rich.paddingr   
rich.panelr   
rich.tabler   	rich.textr   make_formatterconfigr   r   r   r   osgetenvrK   rJ   rN   r)   rR   r   rk   r   r   r   SIMPLE_HEADcolumns	max_widthstylevalueshiddenr^   add_rowrs   primary_colorsdescriptionfrom_markuprT   SIMPLErV   )rB   r@   r>   r}   r~   r   r   r   r   r   	formatterconsolefoundcrW   selectedrJ   rX   _themer   selected_textcolorsrH   selected_rowformats
how_to_uses                             r+   list_themesr      s    K((((((//////(((((($$$$$$$$$$$$""""""&&((	'")6$+:"($+:	
 
 
 19/00""3'' 	""::h//D!XXg..FF  " " "!FFF" " %%f%%% !Ef}}#)<<#4#41qq7**" $6))" $ . " " "!EEE" FMM 	g(gggMM< < <&'&;+;< <$%$9)9< <  

 

 

 '(q#"(q 		 		Ax ;M19+L99LLNN#+JJQ5Ebqb5IJJJKK	    %	
 	
 	
 $* !! 	P 	PA;I19+H5LOO<7CCROOOOWD&)))..$$%_``$$A  $$U  $$s  $$E  * /
 
 

4 	EjCHHHggm;;;CW_bcccf,<===gY777	  J  	
 	
 	
 	WK Ks$   0*C C*)C*2D< <E
Erh   allow_interspersed_argsF)context_settingsadd_help_optionscript_and_argsz#SCRIPT | MODULE[:CLICK_COMMAND] ...a  The script you want to run. If it's a Click CLI and you are rendering help text; then the help text will render [#FF6B6B bold]r[/][#FF8E53 bold]i[/][#FFB347 bold]c[/][#4ECDC4 bold]h[/][#45B7D1 bold]l[/][#74B9FF bold]y[/]. Otherwise, the script will run normally.)nargsmetavarhelpz--themez-tz%Set the theme to render the CLI with.THEME)r   r   z--rich-configz-ca6  Keyword arguments to pass into the [de]RichHelpConfiguration()[/] used to render the help text of the command. You can pass either a JSON directly, or a file prefixed with `@` (for example: '@rich_config.json'). Note that the --rich-config option is also used to render this help text you're reading right now!)typer   z--outputz-o)htmlsvgtext)case_sensitivezeOptionally render help text as HTML or SVG or plain text. By default, help text is rendered normally.z--errors-in-output-formatTzAdvanced OptionszIf set, forces the CLI to render CLI error messages in the format specified by the --output option. By default, error messages render normally, i.e. they are not converted to html or svg.)is_flagpanelr   z.--suppress-warnings/--do-not-suppress-warnings RICH_CLICK_CLI_SUPPRESS_WARNINGSz\Suppress warnings when there are conflicting entry_points. This situation is extremely rare.)r   r   envvarshow_envvarr   r   z(--patch-rich-click/--no-patch-rich-clickzsIf set, patch [reverse][option][b]rich_click.Command[/][/][/], not just [reverse][option][b]click.Command[/][/][/].)r   r   r   r   z--themesz#List all available themes and exit.Extra)r   r   callbackexpose_valuer   )r   z--helpz-hrI   zShow this message and exit.)is_eagerr   r   r   OptionsTuple[str, ...]r   outputLiteral[None, 'html', 'svg']errors_in_output_formatpatch_rich_clickrich_configrD   c	                ,    	 |r7|r#|                     d|           ddlm}	 ||	_        t	          j        di |}
n8|r#ddlm}	 ||	_        t	          j        |          }
nt	          j                    }
n:# t          $ r-}t          j        |j	        r|j	        d         nd          d}~ww xY w|s|s j
        syd|
_        d|
_        d|
_        |
j        d|
_        |
 _        t!                                                      |s|s                     d	                                d           t&          d fd            } |            5  t)          |
|           ddd           n# 1 swxY w Y   |^}}t*          j                                        }t*          j                            t2          j                            d                     	 t7          |          \  |t*          _        n# |t*          _        w xY wrdfd}n"                    d          rdfd}ndfd}                    dd          d         }|g|t*          _        |xt>          _          _         |xt>          _!         _!         |             dS )ak  
    The [link=https://github.com/ewels/rich-click]rich-click[/] CLI provides
    [#FF6B6B bold]r[/][#FF8E53 bold]i[/][#FFB347 bold]c[/][#4ECDC4 bold]h[/][#45B7D1 bold]l[/][#74B9FF bold]y[/]
    formatted help output from any
    tool using [link=https://click.palletsprojects.com/]click[/], formatted with
    [link=https://github.com/Textualize/rich]rich[/].

    Full docs here: [link=https://ewels.github.io/rich-click/latest/documentation/rich_click_cli/]https://ewels.github.io/rich-click/latest/documentation/rich_click_cli/[/]

    The rich-click command line tool can be prepended before any Python package
    using native click to provide attractive richified click help output.

    For example, if you have a package called [argument]my_package[/] that uses click,
    you can run:

    >>> [command]rich-click[/] [argument]my_package[/] [option]--help[/]

    When not rendering help text, the provided command will run normally,
    so it is safe to replace calls to the tool with [command]rich-click[/] in front, e.g.:

    >>> [command]rich-click[/] [argument]my_package[/] [argument]cmd[/] [option]--foo[/] 3
    r   r   N)r   zTheme not foundFTrr   r1   r    Generator[None, None, None]c               3    K                        d          t          j        k    r	 t          j                    5  t          j        dt                     d V  d d d            d S # 1 swxY w Y   d S # t          $ rX} sEt          d | j        D                       r-dd l	}|
                    dt                      Y d } ~ d S Y d } ~ d S Y d } ~ d S d } ~ ww xY wd V  d S )Ntypererror)categoryc              3     K   | ]}d |v V  	dS )TyperNr;   )r   as     r+   	<genexpr>z*main.<locals>.patch_ctx.<locals>.<genexpr>  s&      0N0N!A0N0N0N0N0N0Nr,   r   zK[red]WARNING: Attempted to patch Typer, but Typer is not installed.[/red]

)get_parameter_sourcer   ENVIRONMENTr3   catch_warningsfilterwarningsImportWarninganyr-   rr   rT   rt   )rY   rr   rB   r`   s     r+   	patch_ctxzmain.<locals>.patch_ctx  s     ##G,,0KKK,..  +GmLLLLEEE                  !   ( S0N0Nqv0N0N0N-N-N KKKJJ747 7                    EEEEEs;   A5  A(A5 (A,,A5 /A,0A5 5
C?ACC)r   r   .r/   c                    	 t                    } n# t          $ r 	 t          j                            t
          j                            d                     t                    } n:# t          $ r-}t          j        |j	        r|j	        d         nd          d }~ww xY wY nw xY w	 t          |           }n)# t          $ r t          j        d d d          w xY w |             d S )Nr   r   Unknown errorzModule 'z' has no attribute 'z'.)r   ModuleNotFoundErrorr&   pathrm   r   abspathclickClickExceptionr-   getattrAttributeError)modulerY   rW   rw   rv   s      r+   functionzmain.<locals>.function  s'   	Y&{33& Y Y YY HOOBGOOC$8$8999*;77FF* Y Y Y.AF/WqvayyXXXY FYjFM22! j j j*+hk+h+hWd+h+h+hiiijACCCCCs?    
B'AA*)B'*
B!4(BB!!B'&B'+B< <&C"z.pyc                     dd l } 	 |                     d           d S # t          $ r-}t          j        |j        r|j        d         nd          d }~ww xY w)Nr   __main__run_namer   )runpyrun_pathImportErrorr   r   r-   r  rY   rv   s     r+   r   zmain.<locals>.function  ss    LLLU{Z@@@@@ U U U*+S16!99OTTTUs     
A(AAc                 ~   dd l } 	 |                     d           d S # t          $ r t          j                            t          j                            d                     	 |                     d           Y d S # t          $ r-}t          j	        |j
        r|j
        d         nd          d }~ww xY ww xY w)Nr   r   r   r   r   )r  
run_moduler  r&   r   rm   r   r   r   r   r-   r  s     r+   r   zmain.<locals>.function  s    LLL	Y  z BBBBB Y Y Y  4 4555Y$$[:$FFFFFF" Y Y Y.AF/WqvayyXXXYYs(     AB<'B
B8(B33B88B<rG   r;   )r    r   )r    r/   )"
setdefaultrich_click.rich_click
rich_click_THEME_FROM_CLIr   load_from_globalsr   r   r   r-   resilient_parsinguse_markdownuse_rich_markuptext_markupshow_argumentshelp_configrT   rU   rV   r   r6   r&   r   rp   rm   r   r   rz   rl   rk   ro   r   export_console_asr   )rB   r   r   r   r   r`   r   r   rI   rccfgrY   r   r_   r-   	_sys_pathr   progrw   rv   s   `    `            @@r+   mainr  !  s   nO 	< +&&w666222222%*"'9HHKHHCC 	<......!&B'9FFFCC'9;;C! O O O"#M16!99<MNNNO 	 
 
#2G 
 " %!&Ccllnn 	 	HHQKKK      ^$ 
 C C31ABBBBC C C C C C C C C C C C C C C $MFT IHOOBGOOC(()))%GPa%b%b"]9 +Y	 	 	 	 	 	 	 	" 
		e	$	$ Y	U 	U 	U 	U 	U 	U 	U	Y 	Y 	Y 	Y 	Y 	Y S!$$Q'D}t}CH<BBK!C$9H__K'#*EHJJJJJs6   A1A8 8
B/(B**B/E22E69E6G< <H
)r   r   r    r!   )r-   r	   r.   r	   r    r/   )r_   r   r`   ra   r    rb   )rB   r   r@   r{   r>   ra   r    r/   )rB   r   r   r   r   r   r   r   r   ra   r`   ra   r   ra   r   rD   rI   ra   r    r/   )8__doc__
__future__r   r   r&   r3   
contextlibr   	functoolsr   r   	importlibr   r   typingr	   r
   r   r   r   r   r   r   
click.corer   rich_click.decoratorsr   _rich_argumentr   _rich_commandr   _rich_optionr   r   r   _rich_version_optionrich_click.patchr   r6   rich_click.rich_click_themer   r   r   r   rich_click.rich_contextr   "rich_click.rich_help_configurationr   rt   r(   	ParamTyper8   rz   r   Choicer  r;   r,   r+   <module>r+     s   ! ! " " " " " " 				 



  % % % % % %                    H G G G G G G G G G G G G G G G G G  & & & & & & < < < < < < : : : : : : 8 8 8 8 8 8 < < < < < < < < H H H H H H , , , , , , Z Z Z Z Z Z Z Z Z Z Z Z / / / / / / D D D D D D&     v
# 
# 
# 
#! ! ! ! !eo ! ! !H,& ,& ,& ,&^M M M M` /7  
 
1
U	   	0	   	(	(	*	*
N	   	---e	D	D	D	p	   

_	   4-
	g   .

<   	.
   G$$$ 	.	/	/
   i !!gS S S   "!   %$         jS S Sr,   