
    i$                     :   S SK r S SKrS SKrS SKJr  S SKJr  S SKJr  S SKJr  S SKJ	r	  S SKJ
r
  S SKJr  S S	KJr  S S
KJr  S SKJr  S SKrS SKrS SKrS SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr   " S S\5      r\R>                  " \SSSS9r \ RC                  SSS9SHS j5       r"\" 5        " S S5      5       r#\ RI                  SSS9\RJ                  " SSSS 9\RJ                  " SS!S"S#SS$9\RJ                  " SS%S&S'SS$9\RJ                  " SS(SS$9\RJ                  " SS)SS$9\RJ                  " SS*S+S,SS$9\RJ                  " SS-S.S/SS$9\RJ                  " SS0S1S2S39\RJ                  " SS4S5S6S394	S7\RL                  S8\
\'   S9\
\'   S:\
\'   S;\
\(   S<\
\(   S=\
\(   S>\
\(   S?\
\(   S@\
\(   SS4SA jj5       r)SB\SC\4SD jr*\*\ l$        \(" \RV                  " SE5      5      r,\,(       d  \" \ 5        SF\R>                  S\\R>                  \4   4SG jr-\-" \ 5      r g)I    N)	dataclass)field)Any)Callable)Dict)Optional)Union)Sequence)List)cast)Table)
TyperGroup)__version__)console)load_registered_subcommands)ERROR_HANDLERSc                     ^  \ rS rSrS\R
                  R                  S\\   4S jr	     SS\
\\      S\
\   S\
\   S	\S
\S\SS4U 4S jjjr   SS\
\\      S\
\   S
\S\S\R
                  R                  4
S jjrSrU =r$ )ErrorHandledGroup   _returnc                 *    [        U R                  SS9$ )z<Return list of commands in the order they appear on the CLI.F)reverse)sortedcommands)selfr   s     5lib/python3.13/site-packages/anaconda_cli_base/cli.pylist_commandsErrorHandledGroup.list_commands   s    dmmU33    Nargs	prog_namecomplete_varstandalone_modewindows_expand_argsextrac                   >  [         TU ]  " UUUUU40 UD6  g ! [         a  nU R                  " XU40 UD6nUR                  R                  SS5      (       a  Ue[        [        U5         n	U	" U5      n
U
S:X  a  U R                  " UUUUU40 UD6   S nAg SR                  U=(       d    / 5      n[        R                  " SU S35        [        R                  " U
5         S nAg S nAff = f)NverboseF z[
To see a more detailed error message run the command again as
  [green]anaconda --verbose z[/green])supermain	Exception_get_contextparamsgetr   typejoinr   printsysexit)r   r!   r"   r#   r$   r%   r&   ectxcallback	exit_codecmd	__class__s               r   r,   ErrorHandledGroup.main    s    	$GL#   	$##D5HRERCzz~~i//%d1g.H IB		 #'  hhtzr*558EC ##-	$s    
C*A.C%A
C%%C*c                 .   U(       dN  [         R                  SS  n[        R                  S:X  a&  U(       a  [        R
                  R                  U5      nO[        U5      nUc  [        R
                  R                  5       nU R                  " X!40 UD6nU$ )N   nt)
r4   argvosnameclickutils_expand_argslist_detect_program_namemake_context)r   r!   r"   r%   r&   r7   s         r   r.   ErrorHandledGroup._get_contextJ   sv     88AB<D ww$#6{{//5:D88:I	959
r     )NNNTT)NNT)__name__
__module____qualname____firstlineno__rC   coreContextr   strr   r   r
   boolr   r,   r.   __static_attributes____classcell__)r;   s   @r   r   r      s    4uzz11 4d3i 4 )-#'&* $$(($x}%($ C=($ sm	($
 ($ "($ ($ 
($ ($X )-#'$(	x}% C= "	
  
		 r    r   FzWelcome to the Anaconda CLI!T)clsadd_completionhelppretty_exceptions_enableversions)hiddenr   c                      [        SSSS9n U R                  S[        5        [        R                  " U 5        [
        R                  " 5       e)NPackageVersionz
bold green)header_stylezanaconda-cli-base)r   add_rowr   r   r3   typerExit)tables    r   rY   rY   q   s7    )Y\BE	MM%{3MM%
**,r    c                   :    \ rS rSr% Sr\" \S9r\\	\
4   \S'   Srg)ContextExtrasy   zEncapsulates extra information we want to add to the `typer.Context`.

Used to pass down args from parent CLI to nested subcommands.

)default_factoryr/   rJ   N)rK   rL   rM   rN   __doc__r   dictr/   r   rQ   r   __annotations__rS   rJ   r    r   rd   rd   y   s      #48FDcN8r    rd   )invoke_without_commandno_args_is_helpz8Select the configured site to use by name or domain name)defaultrZ   rW   z-tz--tokenzPAuthentication token to use. A token string or path to a file containing a token)rW   rZ   z-sz--sitez&select the anaconda-client site to usezDisable SSL warningsz0Show the full traceback for chalmers user errorsz-vz	--verbosez'Print debug information to the console.z-qz--quietz+Only show warnings or errors on the consolez-Vz	--versionz@Show the version of this package and installed plugins and exit.)rW   z-hz--helpzShow this message and exit.r7   attokensitedisable_ssl_warningsshow_tracebackr(   quietversion	show_helpc
                    [        5       U l        U R                  R                  R                  U R                  R	                  5       5        Ub  US:w  a  U[
        R                  S'   U	(       a9  [        R                  " U R                  5       5        [        R                  " 5       eU(       aN  [        [        U R                  5      n
U
R                  U S5      n[        [         U5      nU R#                  U5        gg)zAnaconda CLI.Nzanaconda.orgANACONDA_DEFAULT_SITErY   )rd   objr/   updatecopyrA   environr   r3   get_helpr`   ra   r   r   commandget_commandr   invoke)r7   rm   rn   ro   rp   rq   r(   rr   rs   rt   r:   rY   funcs                r   r,   r,      s    x oCG GGNN#**//+,	~"..0

*+clln%jjl$ckk2??3
3Hh'

4	 r    r!   kwargsc                      S nU$ )Nc                      g )NrJ   )r!   r   s     r   wrapped _null_decorator.<locals>.wrapped   s    r    rJ   )r!   r   r   s      r   _null_decoratorr      s     Nr    ANACONDA_CLI_DISABLE_PLUGINSapp_c                    U R                    Vs/ s H  oR                  PM     nnUS/:H  n[        [        R                  " S5      5      n[        [        R                  " S5      5      nU(       a  U(       a  [        S5      eU=(       d    U=(       a    U(       + nU(       a   SSKJn  [        R                  " USS9$ U $ s  snf ! [         a     U $ f = f)	a  Select the main application to handle the `anaconda` entrypoint at the command line.

This function, and its execution below at the bottom of this module, can be removed once
we are fully confident that the `binstar_client.scripts.cli` CLI application (defined
inside `anaconda-client`) can be replaced with the modern `click`/`typer`-based application.

If there are no additional plugins registered besides `anaconda-client`, then we fall back
to the legacy CLI. If any additional plugins are installed, we use the new CLI.

One can force usage of the legacy CLI by setting the environment variable
`ANACONDA_CLIENT_FORCE_STANDALONE` to any value (e.g. `1`).

Users are encouraged to only use the fallback in cases where the new CLI breaks existing usage.
Please register a bug in that case.

orgANACONDA_CLI_FORCE_NEW ANACONDA_CLIENT_FORCE_STANDALONEz\Cannot set both ANACONDA_CLI_FORCE_NEW and ANACONDA_CLIENT_FORCE_STANDALONE at the same timer   )r,   F)allow_plugin_main)registered_groupsrB   rR   rA   getenv
ValueErrorbinstar_client.scripts.clir,   	functoolspartialImportError)r   gsubcommandsanaconda_client_is_only_pluginforce_new_cli_entrypointforce_legacy_cli_entrypointuse_legacy_cli_entrypointr,   s           r   _select_main_entrypoint_appr      s    " $(#9#9:#9a66#9K:%0UG%;"#BII.F$GH"&ryy1S'T"U"'?j
 	
 !< !&G/G+G  !	D7 $$TUCCK- ;"  	 K	s   C$C 
CC)r   N).r   rA   r4   dataclassesr   r   typingr   r   r   r   r	   r
   r   r   r`   
click.corerC   click.utils
rich.tabler   
typer.corer   anaconda_cli_baser   r   anaconda_cli_base.pluginsr   anaconda_cli_base.exceptionsr   r   Typerappr|   rY   rd   r8   OptionrP   rQ   rR   r,   r   r   disable_pluginsr   rJ   r    r   <module>r      s    	 
 !              ! ) % A 7F
 FR kk	'!	 Z% & 9 9 9 T4@ G
 !<<_  ,,5 ,1<<#,
 &+\\?&
 $ll6 "LL: $llO	 !&*	!gK	KK C=K 3-K* #4.+K4 TN5K> d^?KL D>MKZ d^[Kf ~gKr 
sK AKj3 #  ryy!?@A$'ekk 'eEKK<Q6R '\ "#&r    