
    0h@                    v   S SK Jr  S SKrS SKJr  S SKrS SKrS SK	r	S SK
r
S SK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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#  \RH                  (       a  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\RX                  5      r-SxS jr.SyS jr/SzS jr0S{S jr1\Rd                   S|       S}S jj5       r3\Rd                   S~       SS jj5       r3 S|       SS jjr3SS jr4\Rj                  " S/SS \4SSS!9r6 " S" S#5      r7\Rp                  " \7SS$9r9\Rt                  " S%\Rv                  S\Rx                  4   S&9r=SS' jr> " S( S)\R~                  5      r@SS* jrA\Rj                  " S+S,/S-S.SS \AS/9rBSS0 jrC\Rj                  " S1/S2S \CS39rD        SS4 jrE\Rj                  " S5S6/\R                  " SS S79S8SS \ES99rG " S: S;\@5      rHSS< jrI S     SS= jjrJSS> jrK " S? S@\R                  5      rMSSA jrN " SB SC\R                  5      rO\R                  " SDSESF9\R                  " SGSHSISJSK9\R                  " SLSMSNSOSK9\R                  " SP\M" 5       SQSSR9\R                  " SS\R                  " SS SST9\NS SUSV9\R                  " SWSSXSK9\R                  " SYSSZSK9\R                  " S[SS\SK9\R                  " S]S\O" 5       S^\	R                  R                  < S_3S`9\R                  " SaS\O" 5       Sb\	R                  R                  < S_3S`9\9                    SSc j5       5       5       5       5       5       5       5       5       5       5       rT\TR                  R                  S \D5        \R                  " SdSeSF9\>SSf j5       5       rW\R                  " SgShSF9\R                  " SiSj\R                  " Sk5      SlSmSn9\R                  " SoSSpSq9\>SSr j5       5       5       5       rY\H" SsStSu9rZSSv jr[\\Sw:X  a  \[" 5         gg)    )annotationsN)update_wrapper)
itemgetter)
ModuleType)ParameterSource)
run_simple)is_running_from_reloader)import_string   )current_app)get_debug_flag)get_load_dotenv)StartResponse)WSGIApplication)WSGIEnvironmentFlaskc                      \ rS rSrSrSrg)NoAppException%   z3Raised if an application cannot be found or loaded. N)__name__
__module____qualname____firstlineno____doc____static_attributes__r       A/var/www/auris/envauris/lib/python3.13/site-packages/flask/cli.pyr   r   %   s    =r   r   c                   SSK Jn  S H#  n[        XS5      n[        X15      (       d  M!  Us  $    U R                  R                  5        Vs/ s H  n[        XA5      (       d  M  UPM     nn[        U5      S:X  a  US   $ [        U5      S:  a&  [        SU R                   SU R                   S35      eS	 HH  n[        XS5      n[        R                  " U5      (       d  M,   U" 5       n[        X15      (       a  Us  $ MJ     [        SU R                   SU R                   S35      es  snf ! [         aC  n[        U5      (       d  e [        S
U SU R                   SU R                   SU S3	5      UeSnAff = f)zoGiven a module instance this tries to find the best possible
application in the module or raises an exception.
r   r   )appapplicationNr   z0Detected multiple Flask applications in module 'z'. Use 'z":name' to specify the correct one.)
create_appmake_appzDetected factory 'z' in module 'z1', but could not call it without arguments. Use ':z(args)' to specify arguments.z7Failed to find Flask application or factory in module 'z:name' to specify one.) r   getattr
isinstance__dict__valueslenr   r   inspect
isfunction	TypeError_called_with_wrong_args)moduler   	attr_namer!   vmatchesapp_factoryes           r   find_best_appr6   )   s     ,	f.c!!J	 , !//002K2Qj6Jq2GK
7|qqz	W	!&//): ;++
 	
 0	f6k**!mc))J * 0( 	__Xfoo%6 7	 A L*  	.{;;$(=@Q R)9+ 6--
 		s$   D)$D)$D..
E;8>E66E;c                    [         R                  " 5       S   n Ub7  UR                  R                  U R                  L a   AgUR
                  nUb  M7   Ag! Af = f)zCheck whether calling a function raised a ``TypeError`` because
the call failed or because something in the factory raised the
error.

:param f: The function that was called.
:return: ``True`` if the call failed.
   FT)sysexc_infotb_framef_code__code__tb_next)ftbs     r   r/   r/   ^   s\     
	Bn{{!!QZZ/  B n  Bs   &A A Ac                   SSK Jn   [        R                  " UR	                  5       SS9R
                  n[        U[        R                  5      (       a  UR                  n/ n0 nGO[        U[        R                  5      (       a  [        UR                  [        R                  5      (       d  [        SU< S	35      eUR                  R                  n UR                   Vs/ s H  n[        R                  " U5      PM     nnUR                   Vs0 s H=  nUR                   c  M  UR                   [        R                  " UR"                  5      _M?     nnO[        SU< S35      e ['        X5      n	[,        R.                  " U	5      (       a
   U	" U0 UD6nOU	n[        X5      (       a  U$ [        SU R*                   SU S35      e! [         a    [        SU< S35      Sef = fs  snf s  snf ! [$         a    [        S
U< S	35      Sef = f! [(         a$  n
[        SU< SU R*                  < S	35      U
eSn
A
ff = f! [0         a5  n
[3        U	5      (       d  e [        SU< SU R*                  < S35      U
eSn
A
ff = f)zCheck if the given string is a variable name or a function. Call
a function to get the app instance, or return the variable directly.
r   r   eval)modezFailed to parse z' as an attribute name or function call.Nz*Function reference must be a simple name: .z-Failed to parse arguments as literal values: zFailed to find attribute z in zThe factory z in module z2 could not be called with the specified arguments.z1A valid Flask application was not obtained from 'r%   z'.)r&   r   astparsestripbodySyntaxErrorr   r(   NameidCallfuncargsliteral_evalkeywordsargvalue
ValueErrorr'   AttributeErrorr   r,   r-   r.   r/   )r0   app_namer   exprnamerN   kwargsrQ   kwattrr5   r!   s               r   find_app_by_stringr[   x   s    yy)7<< $!!ww	D#((	#	#$))SXX.. <XLJ  yy||	59YY?YcC$$S)YD? --'B66 3((22'  F xl*QR
 	
v$ $
	''C #

	__Qxj	, A  xl*QR
	( @
  	 !?|1M	  'xtFOO3FaH
	  	*400 xl +OO& '(( 			sk   -G G4 # G*G4 G/(/G/G4 +H I G'*
G4 4H
IH<<I
J0I>>Jc                   [         R                  R                  U 5      n [         R                  R                  U 5      u  pUS:X  a  Un [         R                  R	                  U 5      S:X  a  [         R                  R                  U 5      n / n [         R                  R                  U 5      u  pUR                  U5        [         R                  R                  [         R                  R                  U S5      5      (       d  OMw  [        R                  S   U :w  a   [        R                  R                  SU 5        SR                  USSS2   5      $ )zGiven a filename this will try to calculate the python path, add it
to the search path and return the actual module name that is expected.
z.py__init__z__init__.pyr   rD   N)ospathrealpathsplitextbasenamedirnamesplitappendexistsjoinr9   insert)r`   fnameextmodule_namerW   s        r   prepare_importrm      s     77D!D!!$'JE
e|	ww+wwt$K WW]]4(
4 ww~~bggll4?@@  xx{d4 88K"%&&r   Tc                    g Nr   rl   rU   raise_if_not_founds      r   
locate_apprr      s     r   .c                    g ro   r   rp   s      r   rr   rr      s     r   c                \    [        U 5        [        R                  U    nUc  [        U5      $ [        X15      $ ! [         ah    [        R                  " 5       S   R                  (       a&  [        SU < S[        R                  " 5        35      S eU(       a  [        SU < S35      S e g f = f)Nr8   zWhile importing z, an ImportError was raised:

zCould not import rD   )
__import__ImportErrorr9   r:   r>   r   	traceback
format_excmodulesr6   r[   )rl   rU   rq   r0   s       r   rr   rr      s    ; [[%FV$$!&33%   <<>!$$ ";/ 2(33568    #4[O1!EFDPs   9 A/B+*B+c                H   U(       a  U R                   (       a  g [        R                  R                  S5      n[        R                  R                  S5      n[        R
                  " S[        R                  " 5        SU SU 3U R                  S9  U R                  5         g )NflaskwerkzeugPython z
Flask z

Werkzeug )color)
resilient_parsing	importlibmetadataversionclickechoplatformpython_versionr~   exit)ctxparamrR   flask_versionwerkzeug_versions        r   get_versionr     s    C))&&..w7M ))11*=	JJ
())+, -  $%	' ii	 HHJr   z	--versionzShow the Flask version.F)helpexpose_valuecallbackis_flagis_eagerc                  J    \ rS rSrSr    S         SS jjrS	S jrSrg)

ScriptInfoi%  a  Helper object to deal with Flask applications.  This is usually not
necessary to interface with as it's used internally in the dispatching
to click.  In future versions of Flask this object will most likely play
a bigger role.  Typically it's created automatically by the
:class:`FlaskGroup` but you can also manually create it and pass it
onwards as click object.

.. versionchanged:: 3.1
    Added the ``load_dotenv_defaults`` parameter and attribute.
Nc                f    Xl         X l        0 U l        X0l        [	        U5      U l         S U l        g ro   )app_import_pathr#   dataset_debug_flagr   load_dotenv_defaults_loaded_app)selfr   r#   r   r   s        r   r]   ScriptInfo.__init__1  s=      / % )+	,$34H$I!	 *.r   c                   U R                   b  U R                   $ SnU R                  b  U R                  5       nOuU R                  (       a@  [        R                  " SU R                  SS9S/-   SS u  p#[        U5      n[        XC5      nO$S H  n[        U5      n[        USSS9nUc  M    O   Uc  [        S	5      eU R                  (       a  [        5       Ul
        Xl         U$ )
zLoads the Flask app (if not yet loaded) and returns it.  Calling
this multiple times will just result in the already loaded app to
be returned.
Nz
:(?![\\/])r   )maxsplitr8   )zwsgi.pyzapp.pyF)rq   zCould not locate a Flask application. Use the 'flask --app' option, 'FLASK_APP' environment variable, or a 'wsgi.py' or 'app.py' file in the current directory.)r   r#   r   rere   rm   rr   r   r   r   debug)r   r!   r`   rW   import_names        r   load_appScriptInfo.load_appM  s    
 '### ??&//#C##HH]D,@,@1MQUPVV1
 -T2 31D"0"6K$[$5QC 2 ; &   '(CI
r   )r   r   r#   r   r   r   )NNTT)
r   
str | Noner#   t.Callable[..., Flask] | Noner   boolr   r   returnNone)r   r   )r   r   r   r   r   r]   r   r   r   r   r   r   r   %  sO    	 '+48#%).#. 2. 	.
 #. 
.8'r   r   )ensureF)boundc                R   ^  [         R                  SU 4S jj5       n[        UT 5      $ )a  Wraps a callback so that it's guaranteed to be executed with the
script's application context.

Custom commands (and their options) registered under ``app.cli`` or
``blueprint.cli`` will always have an app context available, this
decorator is not required in that case.

.. versionchanged:: 2.2
    The app context is active for subcommands as well as the
    decorated callback. The app context is always available to
    ``app.cli`` command and parameter callbacks.
c                  > [         (       dB  U R                  [        5      R                  5       nU R	                  UR                  5       5        U R                  " T/UQ70 UD6$ ro   )r   ensure_objectr   r   with_resourceapp_contextinvoke)r   rN   rX   r!   r?   s       r   	decorator"with_appcontext.<locals>.decorator  sO    {##J/88:Ccoo/0zz!-d-f--r   )r   click.ContextrN   t.AnyrX   r   r   r   )r   pass_contextr   )r?   r   s   ` r   with_appcontextr   |  s,     . . )Q''r   c                  X   ^  \ rS rSrSr      SU 4S jjr      SU 4S jjrSrU =r$ )AppGroupi  zThis works similar to a regular click :class:`~click.Group` but it
changes the behavior of the :meth:`command` decorator so that it
automatically wraps the functions in :func:`with_appcontext`.

Not to be confused with :class:`FlaskGroup`.
c                L   >^ ^^^ TR                  SS5      mSUUUU U4S jjnU$ )zThis works exactly like the method of the same name on a regular
:class:`click.Group` but it wraps callbacks in :func:`with_appcontext`
unless it's disabled by passing ``with_appcontext=False``.
r   Tc                \   > T(       a  [        U 5      n [        [        T]  " T0 TD6" U 5      $ ro   )r   superr   command)r?   	__class__rN   rX   r   wrap_for_ctxs    r   r   #AppGroup.command.<locals>.decorator  s,    #A&40$A&A!DDr   )r?   zt.Callable[..., t.Any]r   zclick.Command)pop)r   rN   rX   r   r   r   s   ``` @r   r   AppGroup.command  s*     zz"3T:	E 	E
 r   c                P   > UR                  S[        5        [        TU ]  " U0 UD6$ )zThis works exactly like the method of the same name on a regular
:class:`click.Group` but it defaults the group class to
:class:`AppGroup`.
cls)
setdefaultr   r   group)r   rN   rX   r   s      r   r   AppGroup.group  s)     	%*w}d-f--r   r   )rN   r   rX   r   r   z3t.Callable[[t.Callable[..., t.Any]], click.Command])rN   r   rX   r   r   z1t.Callable[[t.Callable[..., t.Any]], click.Group])	r   r   r   r   r   r   r   r   __classcell__r   s   @r   r   r     sG    &+	< ..&+.	:. .r   r   c                D    Uc  g U R                  [        5      nX#l        U$ ro   )r   r   r   )r   r   rR   infos       r   _set_appr     s%    }Z(D Lr   z-Az--appIMPORTzThe Flask application or factory function to load, in the form 'module:name'. Module can be a dotted import or file path. Name is not required if it is 'app', 'application', 'create_app', or 'make_app', and can be 'name(args)' to pass arguments.)metavarr   r   r   r   c                    U R                  UR                  5      nUb%  U[        R                  [        R                  4;   a  g U(       a  SOS[
        R                  S'   U$ )N10FLASK_DEBUG)get_parameter_sourcerW   r   DEFAULTDEFAULT_MAPr_   environ)r   r   rR   sources       r   
_set_debugr     sZ     %%ejj1Ff##)   (-#BJJ}Lr   z--debug/--no-debugzSet debug mode.)r   r   r   c                     SS K nUc  U R                  R
                  (       a  [        X R                  R
                  S9  U$ ! [         a    Ub  [        R                  " SU US9S e Ncf = f)Nr   z4python-dotenv must be installed to load an env file.)r   r   )load_defaults)dotenvrv   r   BadParameterobjr   load_dotenv)r   r   rR   r   s       r   _env_file_callbackr     st    
 CGG88E)E)EFL   $$F 	 s   A $A*)A*z-ez
--env-file)rg   dir_okayzLoad environment variables from this file, taking precedence over those set by '.env' and '.flaskenv'. Variables set directly in the environment take highest precedence. python-dotenv must be installed.)typer   r   r   r   c                     ^  \ rS rSrSr     S
             SU 4S jjjrSS jrSU 4S jjrSU 4S jjr S         SU 4S jjjr	SU 4S jjr
S	rU =r$ )
FlaskGroupi  aA  Special subclass of the :class:`AppGroup` group that supports
loading more commands from the configured Flask app.  Normally a
developer does not have to interface with this class but there are
some very advanced use cases for which it makes sense to create an
instance of this. see :ref:`custom-scripts`.

:param add_default_commands: if this is True then the default run and
    shell commands will be added.
:param add_version_option: adds the ``--version`` option.
:param create_app: an optional callback that is passed the script info and
    returns the loaded app.
:param load_dotenv: Load the nearest :file:`.env` and :file:`.flaskenv`
    files to set environment variables. Will also change the working
    directory to the directory containing the first file found.
:param set_debug_flag: Set the app's debug flag.

.. versionchanged:: 3.1
    ``-e path`` takes precedence over default ``.env`` and ``.flaskenv`` files.

.. versionchanged:: 2.2
    Added the ``-A/--app``, ``--debug/--no-debug``, ``-e/--env-file`` options.

.. versionchanged:: 2.2
    An app context is pushed when running ``app.cli`` commands, so
    ``@with_appcontext`` is no longer required for those commands.

.. versionchanged:: 1.0
    If installed, python-dotenv will be used to load environment variables
    from :file:`.env` and :file:`.flaskenv` files.
c                  > [        UR                  SS 5      =(       d    S5      nUR                  [        [        [
        45        U(       a  UR                  [        5        SU;  a  0 US'   US   R                  SS5        [        TU ](  " SSU0UD6  X l        X@l        XPl        U(       a?  U R                  [        5        U R                  [         5        U R                  ["        5        SU l        g )Nparamsr   context_settingsauto_envvar_prefixFLASKF)listr   extend_env_file_option_app_option_debug_optionrf   version_optionr   r   r]   r#   r   r   add_commandrun_commandshell_commandroutes_command_loaded_plugin_commands)	r   add_default_commandsr#   add_version_optionr   r   extrar   r   s	           r   r]   FlaskGroup.__init__3  s     )-UYYx-F-L"(M
 	'mDEMM.)U*(*E$% !,,-A7K00%0$&,[)]+^,',$r   c                    U R                   (       a  g [        R                  S:  a  SSKJn  OSS KnUR                  SS9 H-  nU R                  UR                  5       UR                  5        M/     SU l         g )N)   
   r   )r   zflask.commands)r   T)
r   r9   version_infor   r   importlib_metadataentry_pointsr   loadrW   )r   r   eps      r   _load_plugin_commands FlaskGroup._load_plugin_commandsX  sb    ''w&*
 2''.>'?BRWWY0 @ (,$r   c                  > U R                  5         [        TU ]	  X5      nUb  U$ UR                  [        5      n UR                  5       n[        (       a  [        R                  " 5       ULa  UR                  UR                  5       5        UR                  R                  X5      $ ! [         a2  n[        R                  " SUR                  5        S3SSS9   S nAg S nAff = fNzError: 
Tred)errfg)r   r   get_commandr   r   r   r   r   sechoformat_messager   _get_current_objectr   r   cli)r   r   rW   rvr   r!   r5   r   s          r   r  FlaskGroup.get_commandi  s    ""$ W +>I  ,	--/C {k==?sJcoo/0ww""3--  	KK'!"2"2"4!5R8duM	s   B) )
C%3(C  C%c                  > U R                  5         [        [        TU ]  U5      5      nUR	                  [
        5      n UR                  UR                  5       R                  R                  U5      5        [!        U5      $ ! [         a2  n[        R                  " SUR                  5        S3SSS9   S nANBS nAf[         a/    [        R                  " [        R                  " 5        S3SSS9   N}f = fr  )r   setr   list_commandsr   r   updater   r  r   r   r  r	  	Exceptionrw   rx   sorted)r   r   r  r   r5   r   s        r   r  FlaskGroup.list_commands  s    ""$&s+,  ,		KIIdmmo))77<= bz  	N KK'!"2"2"4!5R8duM 	K KK9//12"54EJ	Ks    8B 
C6(B::9C65C6c                   > S[         R                  S'   SU;  a<  SU R                  ;  a,  [        U R                  U R
                  U R                  S9US'   [        TU ]   " X4SU0UD6$ )NtrueFLASK_RUN_FROM_CLIr   )r#   r   r   parent)	r_   r   r   r   r#   r   r   r   make_context)r   	info_namerN   r  r   r   s        r   r  FlaskGroup.make_context  sl     ,2

'(%t/D/D"D%??#22%)%5%5E%L w#ILFLeLLr   c                   > U(       d  U R                   (       d'  [        U5      S:X  aF  US   U R                  U5      ;   a.  [        R	                  U0 / 5        [
        R	                  U0 / 5        [        TU ]  X5      $ )Nr   r   )no_args_is_helpr+   get_help_option_namesr   handle_parse_resultr   r   
parse_args)r   r   rN   r   s      r   r   FlaskGroup.parse_args  se    --INtAw$*D*DS*II
 00b"=++CR8w!#,,r   )r   r#   r   r   )TNTTT)r   r   r#   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   r   rW   strr   zclick.Command | None)r   r   r   	list[str]ro   )
r  r   rN   r$  r  click.Context | Noner   r   r   r   )r   r   rN   r$  r   r$  )r   r   r   r   r   r]   r   r  r  r  r   r   r   r   s   @r   r   r     s    B &*48#' ##-"#- 2#- !	#-
 #- #- #- 
#- #-J,".62 (,	MM M %	M
 M 
M M*
- 
-r   r   c                    [         R                  R                  X[        U 5      S R	                  [         R
                  5      5      U:H  $ )zTake ``other`` and remove the length of ``path`` from it. Then join it
to ``path``. If it is the original value, ``path`` is an ancestor of
``other``.N)r_   r`   rh   r+   lstripsep)r`   others     r   _path_is_ancestorr*    s6     77<<CIK077?@EIIr   c                    SSK n0 nU(       a4  S
 H.  nUR                  USS9=n(       d  M  X2R                  USS9-  nM0     U b6  [        R                  R	                  U 5      (       a  X2R                  U SS9-  nUR                  5        H1  u  pgU[        R                  ;   d  Uc  M  U[        R                  U'   M3     [        U5      $ ! [         ah    U (       dH  [        R                  R	                  S5      (       d$  [        R                  R	                  S5      (       a  [
        R                  " SSSS9   g	f = f)a  Load "dotenv" files to set environment variables. A given path takes
precedence over ``.env``, which takes precedence over ``.flaskenv``. After
loading and combining these files, values are only set if the key is not
already set in ``os.environ``.

This is a no-op if `python-dotenv`_ is not installed.

.. _python-dotenv: https://github.com/theskumar/python-dotenv#readme

:param path: Load the file at this location.
:param load_defaults: Search for and load the default ``.flaskenv`` and
    ``.env`` files.
:return: ``True`` if at least one env var was loaded.

.. versionchanged:: 3.1
    Added the ``load_defaults`` parameter. A given path takes precedence
    over default files.

.. versionchanged:: 2.0
    The current directory is not changed to the location of the
    loaded file.

.. versionchanged:: 2.0
    When loading the env files, set the default encoding to UTF-8.

.. versionchanged:: 1.1.0
    Returns ``False`` when python-dotenv is not installed, or when
    the given path isn't a file.

.. versionadded:: 1.0
r   N.env	.flaskenvzH * Tip: There are .env files present. Install python-dotenv to use them.yellowT)r  r  F)r-  r,  )usecwdzutf-8)encoding)r   rv   r_   r`   isfiler   r  find_dotenvdotenv_valuesitemsr   r   )r`   r   r   r   default_namedefault_pathkeyrR   s           r   r   r     s   D #%D1L$*$6$6|D$6$QQLQ(((HHD	 2 BGGNN400$$TG$<<jjl
"**

3	 # :;  	277>>&))RWW^^K-H-HKK 	 	s   C A/D>=D>c                    [        5       (       a  gUb  [        R                  " SU S35        U b#  [        R                  " SU (       a  SOS 35        gg)zUShow extra startup messages the first time the server is run,
ignoring the reloader.
Nz * Serving Flask app ''z * Debug mode: onoff)r	   r   r   )r   r   s     r   show_server_bannerr<    sP      !!"

+O+<A>?

_UT$>?@ r   c                  @    \ rS rSrSrSrSS jr        S	S jrSrg)
CertParamTypei  zClick option type for the ``--cert`` option. Allows either an
existing file, the string ``'adhoc'``, or an import for a
:class:`~ssl.SSLContext` object.
r`   c                :    [         R                  " SSSS9U l        g )NTFrg   r   resolve_path)r   Path	path_type)r   s    r   r]   CertParamType.__init__  s    4%dSr   c                    SS K n U R	                  XU5      $ ! [         a    [        R                  " SUU5      S ef = f! [        R                   a    [        R
                  " XU5      R                  5       nUS:X  a1   SS KnO'! [         a    [        R                  " SUU5      S ef = fUs $ [        USS9n[        XdR                  5      (       a  Us $ e f = f)Nr   z?Using "--cert" requires Python to be compiled with SSL support.adhocz<Using ad-hoc certificates requires the cryptography library.T)silent)sslrv   r   r   rC  STRINGlowercryptographyr
   r(   
SSLContext)r   rR   r   r   rH  rK  r   s          r   convertCertParamType.convert  s    		>>%44  	$$Q 		 !! 	LLs399;E '"  ,,V  	   d3C#~~..
)	s7    A  $= ?C BC$B))C0&CC)rC  Nr"  rR   r   r   zclick.Parameter | Noner   r%  r   r   )	r   r   r   r   r   rW   r]   rM  r   r   r   r   r>  r>    s9    
 DT""#9"@T"	"r   r>  c                   U R                   R                  S5      nUS:H  n SSKn[        X5R                  5      nUbm  U(       a  [        R                  " SX5      eU(       a  [        R                  " SU U5      eU(       d  [        R                  " SX5      eX24U R                   S'   U$ U(       a%  U(       d  U(       d  [        R                  " S	X5      eU$ ! [
         a    Sn Nf = f)
zThe ``--key`` option must be specified when ``--cert`` is a file.
Modifies the ``cert`` param to be a ``(cert, key)`` pair if needed.
certrF  r   NFz.When "--cert" is "adhoc", "--key" is not used.z;When "--cert" is an SSLContext object, "--key" is not used.z "--cert" must also be specified.zRequired when using "--cert".)r   getrH  r(   rL  rv   r   r   )r   r   rR   rQ  is_adhocrH  
is_contexts          r   _validate_keyrU  D  s     ::>>&!DwH6  nn5
$$@#  $$M  $$%GTT![

6 L Z$$%DcQQL7  
s   C C('C(c                  @   ^  \ rS rSrSr        SU 4S jjrSrU =r$ )SeparatedPathTypeik  zClick option type that accepts a list of values separated by the
OS's path separator (``:``, ``;`` on Windows). Each value is
validated as a :class:`click.Path` type.
c                v   > U R                  U5      n[        TU ]  nU Vs/ s H  oe" XbU5      PM     sn$ s  snf ro   )split_envvar_valuer   rM  )r   rR   r   r   r4  super_convertitemr   s          r   rM  SeparatedPathType.convertq  s=     ''.<ABEDd3/EBBBs   6r   rO  )r   r   r   r   r   rM  r   r   r   s   @r   rW  rW  k  s8    
CC#9C@TC	C Cr   rW  runzRun a development server.)
short_helpz--hostz-hz	127.0.0.1zThe interface to bind to.)defaultr   z--portz-pi  zThe port to bind to.z--certz(Specify a certificate file to use HTTPS.)r   r   r   z--keyr@  z2The key file to use when specifying a certificate.)r   r   r   r   z--reload/--no-reloadzVEnable or disable the reloader. By default the reloader is active if debug is enabled.z--debugger/--no-debuggerzVEnable or disable the debugger. By default the debugger is active if debug is enabled.z --with-threads/--without-threadsz!Enable or disable multithreading.z--extra-fileszMExtra files that trigger a reload on change. Multiple paths are separated by rD   )r_  r   r   z--exclude-patternsznFiles matching these fnmatch patterns will not trigger a reload on change. Multiple patterns are separated by c	                8  ^  U R                  5       n	[        5       nUc  UnUc  Un[        XR                  5        [        UUU	UUUUUUS9	  g! [         aA  n
[        5       (       a*  [        R                  " 5         U
m      SU4S jjn	 Sn
A
N~U
SeSn
A
ff = f)zRun a local development server.

This server is for development purposes only. It does not provide
the stability, security, or performance of production WSGI servers.

The reloader and debugger are enabled by default with the '--debug'
option.
c                
   > TS ero   r   )r   start_responser  s     r   r!   run_command.<locals>.app  s     t#r   N)use_reloaderuse_debuggerthreadedssl_contextextra_filesexclude_patterns)r   r   rb  r   r   zcabc.Iterable[bytes])	r   r  r	   rw   	print_excr   r<  r   r   )r   hostportreloaddebuggerwith_threadsrQ  rh  ri  r!   r5   r   r  s               @r   r   r   z  s    P#}}$ E~u223)
7  #%% !C$($:G$%$ $ s   A 
B4BBBshellzRun a shell in the app context.c                    SSK n S[        R                   S[        R                   S[        R
                   S[        R                   3n0 n[        R                  R                  S5      nU(       a]  [        R                  R                  U5      (       a9  [        U5       n[        [        UR                  5       US5      U5        SSS5        UR!                  [        R"                  " 5       5        [%        [        S	S5      nUb3   SSKnSS
KJn  UR-                  U" U5      R.                  5        U" 5         U R3                  XS9  g! , (       d  f       N= f! [0         a     N4f = f)a&  Run an interactive Python shell in the context of a given
Flask application.  The application will populate the default
namespace of this shell according to its configuration.

This is useful for executing small snippets of management code
without having to manually configure the application.
r   Nr}   z on z
App: z
Instance: PYTHONSTARTUPexec__interactivehook__)	Completer)bannerlocal)coder9   r   r   r   r   instance_pathr_   r   rR  r`   r1  openrB   compilereadr  make_shell_contextr'   readlinerlcompleterru  set_completercompleterv   interact)rx  rv  r   startupr?   interactive_hookr~  ru  s           r   r   r     s$     #++d3<<. 1''( ) ../	1 
 C jjnn_-G277>>'**']a7F3S9  JJ{--/0
 s$94@#	<- ""9S>#:#:;MMM+/ ]  		s   "&E	
E 
E
E)(E)routeszShow the routes for the app.z--sortz-s)endpointmethodsdomainrulematchr  zgMethod to sort routes by. 'match' is the order that Flask will match routes when dispatching a request.)r   r_  r   z--all-methodszShow HEAD and OPTIONS methods.)r   r   c                B  ^
^ [        [        R                  R                  5       5      nU(       d  [        R
                  " S5        gU(       a
  [        5       OSS1n[        R                  R                  m[        U4S jU 5       5      n/ nU H  nUR                  SR                  [        UR                  =(       d
    [        5       U-
  5      5      /nU(       a7  UR                  T(       a  UR                  OUR                  =(       d    S5        UR                  UR                   5        UR                  U5        M     SS	/nS
S/n	U(       a+  UR                  T(       a  SOS5        U	R                  S5        UR                  S5        U	R                  S5         UR#                  [%        U	R'                  U 5      5      S9  UR+                  SU5        [-        [/        U5      5       V
^
s/ s H  m
[1        U
4S jU 5       5      PM     nn
UR+                  SU Vs/ s H  nSU-  PM
     sn5        SR                  S [3        U5       5       5      nU H&  n[        R
                  " UR4                  " U6 5        M(     g! [(         a     Nf = fs  sn
f s  snf )z6Show all registered routes with endpoints and methods.zNo routes were registered.NHEADOPTIONSc              3  b   >#    U  H$  nT(       a  UR                   OUR                  v   M&     g 7fro   )rk  	subdomain).0r  host_matchings     r   	<genexpr>!routes_command.<locals>.<genexpr>7  s"     VPU-TYYT^^CPUs   ,/z, r&   EndpointMethodsr  r  Host	Subdomainr  Ruler  )r7  r   c              3  @   >#    U  H  n[        UT   5      v   M     g 7fro   )r+   )r  rowis     r   r  r  V  s     .##c!f++s   r   -z  c              3  8   #    U  H  u  pS U SU S3v   M     g7f){z:<}Nr   )r  r  ws      r   r  r  X  s"     G5FTQ2aS1#R5Fs   )r   r   url_map
iter_rulesr   r   r  r  anyr  rh   r  r  rf   rk  r  r  sortr   indexrS   ri   ranger+   max	enumerateformat)r  all_methodsrulesignored_methods
has_domainrowsr  r  headerssortsr  widthsr  templater  s             `   @r   r   r      s    $$//12E

/0*ce0CO''55MVPUVVJDMMIIfdll3ceFGH

 JJ]		M2N

499C  9%G#EvK@XNN6	LL		jT!23	4 	KK78=c'l8KL8K1c...8KFLKKV,VC!GV,-yyGYv5FGGH

8??C()    M,s   "'J 2J#J

JJr{   zA general utility script for Flask applications.

An application to load must be given with the '--app' option,
'FLASK_APP' environment variable, or with a 'wsgi.py' or 'app.py' file
in the current directory.
)rW   r   c                 ,    [         R                  5         g ro   )r  mainr   r   r   r  r  j  s    HHJr   __main__)r0   r   r   r   )r?   zt.Callable[..., Flask]r   r   )r0   r   rU   r#  r   r   )r`   r#  r   r#  )T)rl   r#  rU   r   rq   zt.Literal[True]r   r   ).)rl   r#  rU   r   rq   zt.Literal[False]r   Flask | None)rl   r#  rU   r   rq   r   r   r  )r   r   r   click.ParameterrR   r   r   r   )r?   r   r   r   )r   r   r   click.OptionrR   r   r   r   )r   r   r   r  rR   r   r   zbool | None)r`   r#  r)  r#  r   r   )NT)r`   zstr | os.PathLike[str] | Noner   r   r   r   )r   r   r   r   r   r   )r   r   r   r  rR   r   r   r   )r   r   rk  r#  rl  intrm  r   rn  r   ro  r   rQ  zCssl.SSLContext | tuple[str, str | None] | t.Literal['adhoc'] | Nonerh  list[str] | Noneri  r  r   r   r"  )r  r#  r  r   r   r   )]
__future__r   rE   collections.abcabccabcimportlib.metadatar   r,   r_   r   r   r9   rw   typingt	functoolsr   operatorr   typesr   r   
click.corer   r|   r   werkzeug.servingr	   werkzeug.utilsr
   globalsr   helpersr   r   TYPE_CHECKINGrH  _typeshed.wsgir   r   r   r!   r   
UsageErrorr   r6   r/   r[   rm   overloadrr   r   Optionr   r   make_pass_decoratorpass_script_infoTypeVarCallableAnyr   r   Groupr   r   r   r   r   r   rB  r   r   r*  r   r<  	ParamTyper>  rU  rW  r   optionr`   pathsepr   r   ri   r   Choicer   r  r  r   r   r   r   <module>r     s|   " 
    	  	 
   $    &  5 (   # $??,..>U%% >2j4M`': RV *@O
 
 SV *@P  HL44 *4@D444  M	"O Od ,,ZE IIcCJ/0(2 .u{{  .F ll	7O	
 " 			+4>0 <<	<	4%	0	Q  e- e-PJ GKA
'A?CA	AHA-EOO -`$NC

 C u!<=hk8SThd1GH		3	 	4%d	C	= 
% 
% &	,
 			WW__/q	2 			GGOOa	!	 :
:
: : 	:
 : : N: ": ': 
: 	 I U >j:z     !] + w#DE,,  F,,^ x$BC	H	I	'	 ot2RS.*  T	 D.*b 	
	 zF r   