
    ]hH                       S SK J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  \R(                  (       a  S SKr\R.                  " S5      r\R2                  " S5      r\R2                  " S5      r\R8                  S\R:                  4   r\R2                  " SSS9rS/S jr S0S jr! S1     S2S jjr"SS.     S3S jjr#\R2                  " S\S9r$\RJ                  S4S j5       r&\RJ                          S5S j5       r&\RJ                   S6       S7S jj5       r&\RJ                   S8       S9S jj5       r&  S:       S;S jjr&\R2                  " S \S9r'\RJ                  S<S! j5       r(\RJ                          S=S" j5       r(\RJ                   S6       S>S# jj5       r(\RJ                   S8       S?S$ jj5       r(  S:       S@S% jjr(SAS& jr)SS'.       SBS( jjr*SS'.       SCS) jjr+SDS* jr,SDS+ jr- S6SSSS,.             SES- jjjr.SDS. jr/g)F    )annotationsNupdate_wrapper)gettext   Argument)Command)Context)GroupOption)	Parameterget_current_context)echoPRT.FCz_AnyCallable | Command)boundc                ,   ^  SU 4S jjn[        UT 5      $ )zUMarks a callback as wanting to receive the current context
object as first argument.
c                 ,   > T" [        5       /U Q70 UD6$ Nr   argskwargsfs     B/var/www/html/env/lib/python3.13/site-packages/click/decorators.pynew_funcpass_context.<locals>.new_func!   s    $&8888    r   zP.argsr   zP.kwargsreturnr   r   r   r    s   ` r   pass_contextr&      s    
9 (A&&r"   c                ,   ^  SU 4S jjn[        UT 5      $ )zSimilar to :func:`pass_context`, but only pass the object on the
context onwards (:attr:`Context.obj`).  This is useful if that object
represents the state of a nested system.
c                 @   > T" [        5       R                  /U Q70 UD6$ r   )r   objr   s     r   r    pass_obj.<locals>.new_func-   s"    $&**<T<V<<r"   r#   r   r%   s   ` r   pass_objr+   '   s    = (A&&r"   c                   ^ ^ SUU 4S jjnU$ )a  Given an object type this creates a decorator that will work
similar to :func:`pass_obj` but instead of passing the object of the
current context, it will find the innermost context of type
:func:`object_type`.

This generates a decorator that works roughly like this::

    from functools import update_wrapper

    def decorator(f):
        @pass_context
        def new_func(ctx, *args, **kwargs):
            obj = ctx.find_object(object_type)
            return ctx.invoke(f, obj, *args, **kwargs)
        return update_wrapper(new_func, f)
    return decorator

:param object_type: the type of the object to pass.
:param ensure: if set to `True`, a new object will be created and
               remembered on the context if it's not there yet.
c                2   >^  SUU U4S jjn[        UT 5      $ )Nc                    > [        5       nT(       a  UR                  T5      nOUR                  T5      nUc  [        STR                  < S35      eUR
                  " TU/U Q70 UD6$ )Nz<Managed to invoke callback without a context object of type z
 existing.)r   ensure_objectfind_objectRuntimeError__name__invoke)r   r   ctxr)   ensurer   object_types       r   r    8make_pass_decorator.<locals>.decorator.<locals>.new_funcM   sv    %'C ''4ook2{"''2';';&> !  ::a6t6v66r"   r#   r   )r   r    r5   r6   s   ` r   	decorator&make_pass_decorator.<locals>.decoratorL   s    	7 	7$ h**r"   r   z#t.Callable[te.Concatenate[T, P], R]r$   t.Callable[P, R] )r6   r5   r8   s   `` r   make_pass_decoratorr=   3   s    2+ +* r"   )doc_descriptionc               B   ^  SU 4S jjnUc  ST < S3nSU S3Ul         U$ )a[  Create a decorator that passes a key from
:attr:`click.Context.meta` as the first argument to the decorated
function.

:param key: Key in ``Context.meta`` to pass.
:param doc_description: Description of the object being passed,
    inserted into the decorator's docstring. Defaults to "the 'key'
    key from Context.meta".

.. versionadded:: 8.0
c                0   >^  SU U4S jjn[        UT 5      $ )Nc                 d   > [        5       nUR                  T   nUR                  " TU/U Q70 UD6$ r   )r   metar3   )r   r   r4   r)   r   keys       r   r    2pass_meta_key.<locals>.decorator.<locals>.new_funct   s3    %'C((3-C::a6t6v66r"   r#   r   )r   r    rC   s   ` r   r8    pass_meta_key.<locals>.decorators   s    	7 	7
 h**r"   zthe z$ key from :attr:`click.Context.meta`zDecorator that passes z1 as the first argument to the decorated function.r:   )__doc__)rC   r>   r8   s   `  r   pass_meta_keyrG   d   sC    +  'KL ! 1 2& 	&  r"   CmdTypec                    g r   r<   names    r   commandrL      s    ,/r"   c                    g r   r<   rK   clsattrss      r   rL   rL          
 +.r"   c                   g r   r<   rN   s      r   rL   rL           +.r"   c                    g r   r<   rN   s      r   rL   rL      s     +.r"   c                   ^ ^^ Sn[        T 5      (       a  T nSm Tb   S5       eT(       a   S5       eTc  [        R                  " S[        5      mSUUU 4S jjnUb  U" U5      $ U$ )a  Creates a new :class:`Command` and uses the decorated function as
callback.  This will also automatically attach all decorated
:func:`option`\s and :func:`argument`\s as parameters to the command.

The name of the command defaults to the name of the function, converted to
lowercase, with underscores ``_`` replaced by dashes ``-``, and the suffixes
``_command``, ``_cmd``, ``_group``, and ``_grp`` are removed. For example,
``init_data_command`` becomes ``init-data``.

All keyword arguments are forwarded to the underlying command class.
For the ``params`` argument, any decorated params are appended to
the end of the list.

Once decorated the function turns into a :class:`Command` instance
that can be invoked as a command line utility or be attached to a
command :class:`Group`.

:param name: The name of the command. Defaults to modifying the function's
    name as described above.
:param cls: The command class to create. Defaults to :class:`Command`.

.. versionchanged:: 8.2
    The suffixes ``_command``, ``_cmd``, ``_group``, and ``_grp`` are
    removed when generating the name.

.. versionchanged:: 8.1
    This decorator can be applied without parentheses.

.. versionchanged:: 8.1
    The ``params`` argument can be used. Decorated params are
    appended to the end of the list.
Nz4Use 'command(cls=cls)(callable)' to specify a class.z7Use 'command(**kwargs)(callable)' to provide arguments.type[CmdType]c                d  > [        U [        5      (       a  [        S5      eT	R                  SS 5      nUb  UO/ n U R                  nU ?UR                  [        U5      5        T	R                  S5      c  U R                  T	S'   [        R                  (       a  T
c   e[        T5      (       a   eTb  TnOMU R                  R                  5       R                  SS5      nUR!                  S5      u  pVnU(       a  US;   a  UnT
" SX@US.T	D6nU R                  Ul	        U$ ! [         a     Nf = f)	Nz5Attempted to convert a callback into a command twice.paramshelp_->   cmdgrpgrouprL   )rK   callbackrX   r<   )
isinstancer
   	TypeErrorpop__click_params__extendreversedAttributeErrorgetrF   tTYPE_CHECKINGcallabler2   lowerreplace
rpartition)r   attr_paramsrX   decorator_paramscmd_namecmd_leftsepsuffixr\   rP   rO   rK   s            r   r8   command.<locals>.decorator   s&   a!!STTii$/ + 7R	6 11 "MM(#34599V$IIE&M???"?~~%%Hzz'')11#s;H$,$7$7$<!H6v!CC#DxFDeDii
1  		s   D" "
D/.D/)r   _AnyCallabler$   rH   )rj   rh   castr
   )rK   rO   rP   funcr8   s   ```  r   rL   rL      st    L 6:D~~{RRR{SSSy
{ff_g.! !F r"   GrpTypec                    g r   r<   rJ   s    r   r^   r^     s    (+r"   c                    g r   r<   rN   s      r   r^   r^     rQ   r"   c                   g r   r<   rN   s      r   r^   r^     rS   r"   c                    g r   r<   rN   s      r   r^   r^     s     ),r"   c                    Uc  [         R                  " S[        5      n[        U 5      (       a  [	        SSU0UD6" U 5      $ [	        X40 UD6$ )zCreates a new :class:`Group` with a function as callback.  This
works otherwise the same as :func:`command` just that the `cls`
parameter is set to :class:`Group`.

.. versionchanged:: 8.1
    This decorator can be applied without parentheses.
type[GrpType]rO   r<   )rh   rv   r   rj   rL   rN   s      r   r^   r^   %  sJ     {ff_e,~~(3(%(..4&&&r"   c                    [        U [        5      (       a  U R                  R                  U5        g [	        U S5      (       d  / U l        U R
                  R                  U5        g )Nrc   )r`   r
   rX   appendhasattrrc   )r   params     r   _param_memor   :  sI    !W	q,--!#A	!!%(r"   )rO   c                2   ^ ^^ T c  [         m SUU U4S jjnU$ )a  Attaches an argument to the command.  All positional arguments are
passed as parameter declarations to :class:`Argument`; all keyword
arguments are forwarded unchanged (except ``cls``).
This is equivalent to creating an :class:`Argument` instance manually
and attaching it to the :attr:`Command.params` list.

For the default argument class, refer to :class:`Argument` and
:class:`Parameter` for descriptions of parameters.

:param cls: the argument class to instantiate.  This defaults to
            :class:`Argument`.
:param param_decls: Passed as positional arguments to the constructor of
    ``cls``.
:param attrs: Passed as keyword arguments to the constructor of ``cls``.
c                .   > [        U T" T40 TD65        U $ r   r   r   rP   rO   param_declss    r   r8   argument.<locals>.decoratorY      As;0%01r"   r   r   r$   r   r   rO   r   rP   r8   s   ``` r   argumentr   D  s!    $ {  r"   c                2   ^ ^^ T c  [         m SUU U4S jjnU$ )a  Attaches an option to the command.  All positional arguments are
passed as parameter declarations to :class:`Option`; all keyword
arguments are forwarded unchanged (except ``cls``).
This is equivalent to creating an :class:`Option` instance manually
and attaching it to the :attr:`Command.params` list.

For the default option class, refer to :class:`Option` and
:class:`Parameter` for descriptions of parameters.

:param cls: the option class to instantiate.  This defaults to
            :class:`Option`.
:param param_decls: Passed as positional arguments to the constructor of
    ``cls``.
:param attrs: Passed as keyword arguments to the constructor of ``cls``.
c                .   > [        U T" T40 TD65        U $ r   r   r   s    r   r8   option.<locals>.decoratoru  r   r"   r   r   r   s   ``` r   optionr   `  s!    $ {  r"   c                     SS jnU (       d  Sn UR                  SS5        UR                  SU5        UR                  SS5        UR                  SS	5        UR                  S
S5        [        U 0 UD6$ )a  Add a ``--yes`` option which shows a prompt before continuing if
not passed. If the prompt is declined, the program will exit.

:param param_decls: One or more option names. Defaults to the single
    value ``"--yes"``.
:param kwargs: Extra arguments are passed to :func:`option`.
c                4    U(       d  U R                  5         g g r   )abortr4   r   values      r   r_   %confirmation_option.<locals>.callback  s    IIK r"   )z--yesis_flagTr_   expose_valueFpromptzDo you want to continue?rY   z%Confirm the action without prompting.r4   r   r   r   r   boolr$   None
setdefaultr   )r   r   r_   s      r   confirmation_optionr   |  ss      
i&
j(+
ne,
h :;
fEF;)&))r"   c                     U (       d  Sn UR                  SS5        UR                  SS5        UR                  SS5        [        U 0 UD6$ )a  Add a ``--password`` option which prompts for a password, hiding
input and asking to enter the value again for confirmation.

:param param_decls: One or more option names. Defaults to the single
    value ``"--password"``.
:param kwargs: Extra arguments are passed to :func:`option`.
)z
--passwordr   Tconfirmation_prompt
hide_inputr   )r   r   s     r   password_optionr     sM     %
h%
+T2
lD);)&))r"   )package_name	prog_namemessagec                 ^ ^^^ Tc  [        S5      mT c  Tc~  [        R                  " 5       nUb  UR                  OSnUb  UR                  OSnAUbC  UR                  S5      mTS:X  a  UR                  S5      mT(       a  TR                  S5      S   mSUUUU 4S jjn	U(       d  S	nUR                  S
S5        UR                  SS5        UR                  SS5        UR                  S[        S5      5        XS'   [        U0 UD6$ )a  Add a ``--version`` option which immediately prints the version
number and exits the program.

If ``version`` is not provided, Click will try to detect it using
:func:`importlib.metadata.version` to get the version for the
``package_name``.

If ``package_name`` is not provided, Click will try to detect it by
inspecting the stack frames. This will be used to detect the
version, so it must match the name of the installed package.

:param version: The version number to show. If not provided, Click
    will try to detect it.
:param param_decls: One or more option names. Defaults to the single
    value ``"--version"``.
:param package_name: The package name to detect the version from. If
    not provided, Click will try to detect it.
:param prog_name: The name of the CLI to show in the message. If not
    provided, it will be detected from the command.
:param message: The message to show. The values ``%(prog)s``,
    ``%(package)s``, and ``%(version)s`` are available. Defaults to
    ``"%(prog)s, version %(version)s"``.
:param kwargs: Extra arguments are passed to :func:`option`.
:raise RuntimeError: ``version`` could not be detected.

.. versionchanged:: 8.0
    Add the ``package_name`` parameter, and the ``%(package)s``
    value for messages.

.. versionchanged:: 8.0
    Use :mod:`importlib.metadata` instead of ``pkg_resources``. The
    version is detected based on the package name, not the entry
    point name. The Python package name must match the installed
    package name, or be passed with ``package_name=``.
Nz%(prog)s, version %(version)sr2   __main____package__.r   c                  > U(       a  U R                   (       a  g Tc  U R                  5       R                  mTc#  Tb   SS Kn UR                  R                  T5      mTc  [        ST< S35      e[        TTTTS.-  U R                  S9  U R                  5         g ! UR                  R                   a    [        T< S35      S ef = f)Nr   z6 is not installed. Try passing 'package_name' instead.z$Could not determine the version for z automatically.)progpackageversioncolor)resilient_parsing	find_root	info_nameimportlib.metadatametadatar   PackageNotFoundErrorr1   r   r   exit)r4   r   r   	importlibr   r   r   r   s       r   r_    version_option.<locals>.callback  s    --
 11I?|7%#,,44\B ?6|6FoV  	y\gVV))	
 	
 %%:: "#& '/ / s   B +C)z	--versionr   Tr   Fis_eagerrY   zShow the version and exit.r_   r   )	rZ   inspectcurrentframef_back	f_globalsrg   	partitionr   r   )
r   r   r   r   r   r   framer   r   r_   s
   ````      r   version_optionr     s
   V 34</$$&!&!2(.(:F$$	  $==4Lz)(}}];+55c:1= @ $
i&
ne,
j$'
fa <=>!:;)&))r"   c                     SS jnU (       d  Sn UR                  SS5        UR                  SS5        UR                  SS5        UR                  S[        S	5      5        UR                  S
U5        [        U 0 UD6$ )zPre-configured ``--help`` option which immediately prints the help page
and exits the program.

:param param_decls: One or more option names. Defaults to the single
    value ``"--help"``.
:param kwargs: Extra arguments are passed to :func:`option`.
c                    U(       aE  U R                   (       d3  [        U R                  5       U R                  S9  U R	                  5         ggg)z<Callback that print the help page on ``<stdout>`` and exits.r   N)r   r   get_helpr   r   r   s      r   	show_helphelp_option.<locals>.show_help  s1    ..syy1HHJ /5r"   )z--helpr   Tr   Fr   rY   zShow this message and exit.r_   r   )r   rZ   r   )r   r   r   s      r   help_optionr     sw     !
i&
ne,
j$'
fa =>?
j),;)&))r"   )r   z)t.Callable[te.Concatenate[Context, P], R]r$   r;   r:   )F)r6   ztype[T]r5   r   r$   Ct.Callable[[t.Callable[te.Concatenate[T, P], R]], t.Callable[P, R]])rC   strr>   
str | Noner$   r   )rK   ru   r$   r
   )rK   r   rO   rV   rP   t.Anyr$   #t.Callable[[_AnyCallable], CmdType]r   )rK   r   rO   rV   rP   r   r$   r   ).N)rK   r   rO   r   rP   r   r$   z#t.Callable[[_AnyCallable], Command])NN)rK   str | _AnyCallable | NonerO   ztype[CmdType] | NonerP   r   r$   z7Command | t.Callable[[_AnyCallable], Command | CmdType])rK   ru   r$   r   )rK   r   rO   r~   rP   r   r$   #t.Callable[[_AnyCallable], GrpType])rK   r   rO   r~   rP   r   r$   r   )rK   r   rO   r   rP   r   r$   z!t.Callable[[_AnyCallable], Group])rK   r   rO   ztype[GrpType] | NonerP   r   r$   z3Group | t.Callable[[_AnyCallable], Group | GrpType])r   zt.Callable[..., t.Any]r   r   r$   r   )r   r   rO   ztype[Argument] | NonerP   r   r$   t.Callable[[FC], FC])r   r   rO   ztype[Option] | NonerP   r   r$   r   )r   r   r   r   r$   r   )r   r   r   r   r   r   r   r   r   r   r   r   r$   r   )0
__future__r   r   typingrh   	functoolsr   r   rZ   corer	   r
   r   r   r   r   globalsr   utilsr   ri   typing_extensionste	ParamSpecr   TypeVarr   r   CallableAnyru   r   r&   r+   r=   rG   rH   overloadrL   rx   r^   r   r   r   r   r   r   r   r<   r"   r   <module>r      s   "   $         ( ??"
SAIIcNIIcNzz#quu*%YYt34'	' */.."&.H.d 04	",HB ))IW
-  /  /
 .
.	. . )	. . .
. 
. 	.
 ). . (,.
.!%.7<.(. . '+ $W
#W	W W =	Wt ))IU
+  +  +
 .
.	. . )	. . .
. 
. 	.
 ). . (,,
,!%,7<,&, , '+ $'
#'	' ' 9	'*) 591CH: 37/AF8*0*$ g*  $ g*g*g* g* 	g*
 g* g* g*T*r"   