
    ]hI                    f   % 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Jr  S SKJr  \	R                   R#                  S5      r\	R                   R#                  S5      rSrS\S'   \R,                  " S	5      r  S;           S<S
 jjrS=S jrS>S jr " S S\R6                  5      r " S S5      rS?S@S jjrS?S@S jjrSAS jr SAS jr!SBS jr"SCS jr#        SDS jr$  S;               SES jjr% S?         SFS jjr& S?         SGS jjr'SHS jr(SHS jr)SHS jr*SISJS jjr+SISJS jjr,SISJS  jjr-          SKS! jr.    SL           SMS" jjr/ " S# S$5      r0SNS% jr1SOS& jr2 SI     SPS' jjr3\	R                   R#                  S5      (       a&  \(       a  S(S)K4J5r5  SQS* jr6\" 5       r7S+\S,'   SRSSS- jjrOSQS. jr6        STS/ jr5SUS0 jr8SOS1 jr9      SVS2 jr:\:" S3 \+5      r;\:" S4 \,5      r<\:" S5 \-5      r=\(\)\*S6.r>S7\S8'   \+\,\-S6.r?S9\S:'   g)W    )annotationsN)TracebackTypeWeakKeyDictionarycygwinwinz't.Callable[[t.TextIO], t.TextIO] | Noneauto_wrap_for_ansiz\033\[[;?0-9]*[a-zA-Z]c           	     D    Uc  [        U 5      nUc  Sn[        U UUSUUS9$ )NreplaceT)line_bufferingforce_readableforce_writable)get_best_encoding_NonClosingTextIOWrapper)streamencodingerrorsr   r   s        ?/var/www/html/env/lib/python3.13/site-packages/click/_compat.py_make_text_streamr      s=     $V,~#%%     c                j     [         R                  " U 5      R                  S:H  $ ! [         a     gf = f)z$Checks if a given encoding is ascii.asciiF)codecslookupnameLookupError)r   s    r   is_ascii_encodingr   (   s3    }}X&++w66 s   "% 
22c                z    [        U SS5      =(       d    [        R                  " 5       n[        U5      (       a  gU$ )z1Returns the default stream encoding if not found.r   Nzutf-8)getattrsysgetdefaultencodingr   )r   rvs     r   r   r   0   s1    	T	*	Fc.D.D.FBIr   c                  b   ^  \ rS rSr  S             SU 4S jjjrSS jrS	S jrSrU =r$ )
r   8   c                   > [         R                  " [         R                  [        XU5      5      =U l        n[
        TU ]  " XU40 UD6  g N)tcastBinaryIO_FixupStream_streamsuper__init__)selfr   r   r   r   r   extra	__class__s          r   r-   !_NonClosingTextIOWrapper.__init__9   sB     !"JJV^L!
 	
v 	6;U;r   c                F     U R                  5         g ! [         a     g f = fr&   )detach	Exceptionr.   s    r   __del__ _NonClosingTextIOWrapper.__del__G   s"    	KKM 		s    
  c                6    U R                   R                  5       $ r&   )r+   isattyr5   s    r   r9   _NonClosingTextIOWrapper.isattyM   s    ||""$$r   )r+   FF)r   
t.BinaryIOr   
str | Noner   r=   r   boolr   r>   r/   t.AnyreturnNone)r@   rA   r@   r>   )	__name__
__module____qualname____firstlineno__r-   r6   r9   __static_attributes____classcell__)r0   s   @r   r   r   8   sh      %$<< < 	<
 < < < 
< <% %r   r   c                  f    \ rS rSrSr  S     SS jjrSS jrSS jrSS jrSS jr	SS jr
S	rg
)r*   R   a9  The new io interface needs more from streams than streams
traditionally implement.  As such, this fix-up code is necessary in
some circumstances.

The forcing of readable and writable flags are there because some tools
put badly patched objects on sys (one such offender are certain version
of jupyter notebook).
c                (    Xl         X l        X0l        g r&   )r+   _force_readable_force_writable)r.   r   r   r   s       r   r-   _FixupStream.__init__\   s     --r   c                .    [        U R                  U5      $ r&   )r   r+   r.   r   s     r   __getattr___FixupStream.__getattr__f   s    t||T**r   c                    [        U R                  SS 5      nUb!  [        R                  " [        U" U5      5      $ U R                  R                  U5      $ )Nread1)r   r+   r'   r(   bytesread)r.   sizefs      r   rT   _FixupStream.read1i   sC    DLL'40=66%4))||  &&r   c                    U R                   (       a  g[        U R                  SS 5      nUb   [        R                  " [
        U" 5       5      $  U R                  R                  S5        g! [         a     gf = f)NTreadabler   F)rL   r   r+   r'   r(   r>   rV   r4   r.   xs     r   r[   _FixupStream.readableq   sh    DLL*d3=66$$$	LLa    		s   A* *
A76A7c                N   U R                   (       a  g[        U R                  SS 5      nUb   [        R                  " [
        U" 5       5      $  U R                  R                  S5        g! [         a0     U R                  R                  S5         g! [         a      gf = ff = f)NTwritabler   F)rM   r   r+   r'   r(   r>   writer4   r\   s     r   r`   _FixupStream.writable}   s    DLL*d3=66$$$	LLs#   	""3'   	s*   A* *
B$5B
B B$B  B$c                    [        U R                  SS 5      nUb   [        R                  " [        U" 5       5      $  U R                  R                  U R                  R                  5       5        g! [         a     gf = f)NseekableFT)r   r+   r'   r(   r>   seektellr4   r\   s     r   rd   _FixupStream.seekable   si    DLL*d3=66$$$	LLdll//12   		s   3A0 0
A=<A=)rL   rM   r+   Nr;   )r   r<   r   r>   r   r>   r   strr@   r?   )rW   intr@   rU   rB   )rC   rD   rE   rF   __doc__r-   rQ   rT   r[   r`   rd   rG    r   r   r*   r*   R   sI      %$	.. . 	.+'
r   r*   c                f     [        U R                  S5      [        5      $ ! [         a    Us $ f = fNr   )
isinstancerV   rU   r4   r   defaults     r   _is_binary_readerrr      s0    &++a.%00 s   ! 00c                     U R                  S5        g! [         a)     U R                  S5         g! [         a     Of = fUs $ f = f)Nr    FT)ra   r4   rp   s     r   _is_binary_writerru      sT    S   	LL 		s%    
A2
?A?AAc                    [        U S5      (       a%  [        R                  " [        R                  U 5      $ [	        U SS 5      nUb6  [        US5      (       a%  [        R                  " [        R                  U5      $ g NFbufferT)rr   r'   r(   r)   r   r   bufs     r   _find_binary_readerr{      `    
 ''vvajj&))
&(D
)C ,S$77vvajj#&&r   c                    [        U S5      (       a%  [        R                  " [        R                  U 5      $ [	        U SS 5      nUb6  [        US5      (       a%  [        R                  " [        R                  U5      $ g rw   )ru   r'   r(   r)   r   ry   s     r   _find_binary_writerr~      r|   r   c                @    [        [        U SS5      =(       d    S5      $ )z3A stream is misconfigured if its encoding is ASCII.r   Nr   )r   r   r   s    r   _stream_is_misconfiguredr      s     WVZ>I'JJr   c                N    [        XS5      nX2:H  =(       d    USL =(       a    USL$ )zA stream attribute is compatible if it is equal to the
desired value or the desired value is unset and the attribute
has a value.
N)r   )r   attrvaluestream_values       r   _is_compat_stream_attrr      s,    
 6.L PUd]%O|47OPr   c                D    [        U SU5      =(       a    [        U SU5      $ )z[Check if a stream's encoding and errors attributes are
compatible with the desired values.
r   r   )r   )r   r   r   s      r   _is_compatible_text_streamr      s)     "
H ;
 6
:;r   c                B   U" U S5      (       a&  [         R                  " [         R                  U 5      nOZ[         R                  " [         R                  U 5      n [	        XU5      (       a  Uc  [        U 5      (       d  U $ U" U 5      nUc  U $ UnUc  Sn[        UUUUUS9$ )NFr   )r   r   )r'   r(   r)   TextIOr   r   r   )	text_streamr   r   	is_binaryfind_binaryr   r   binary_readerpossible_binary_readers	            r   _force_correct_text_streamr      s     e$$qzz;7ffQXX{3 &kVDD!9+!F!F "-[!9 "). ~ %% r   c           	     .    [        U UU[        [        US9$ )Nr   )r   rr   r{   )text_readerr   r   r   s       r   _force_correct_text_readerr     #     &% r   c           	     .    [        U UU[        [        US9$ )Nr   )r   ru   r~   )text_writerr   r   r   s       r   _force_correct_text_writerr   ,  r   r   c                 T    [        [        R                  5      n U c  [        S5      eU $ )Nz6Was not able to determine binary stream for sys.stdin.)r{   r    stdinRuntimeError)readers    r   get_binary_stdinr   <  s&     +F~STTMr   c                 T    [        [        R                  5      n U c  [        S5      eU $ )Nz7Was not able to determine binary stream for sys.stdout.)r~   r    stdoutr   writers    r   get_binary_stdoutr   C  &     ,F~TUUMr   c                 T    [        [        R                  5      n U c  [        S5      eU $ )Nz7Was not able to determine binary stream for sys.stderr.)r~   r    stderrr   r   s    r   get_binary_stderrr   J  r   r   c                r    [        [        R                  X5      nUb  U$ [        [        R                  XSS9$ )NTr   )_get_windows_console_streamr    r   r   r   r   r"   s      r   get_text_stdinr   Q  s0    	$SYY	AB	~	%ciiRVWWr   c                r    [        [        R                  X5      nUb  U$ [        [        R                  XSS9$ NTr   )r   r    r   r   r   s      r   get_text_stdoutr   X  0    	$SZZ	BB	~	%cjj(SWXXr   c                r    [        [        R                  X5      nUb  U$ [        [        R                  XSS9$ r   )r   r    r   r   r   s      r   get_text_stderrr   _  r   r   c                8    SU;   a  [        X5      $ [        XX#S9$ )z?Handles not passing ``encoding`` and ``errors`` in binary mode.br   r   )open)filemoder   r   s       r   _wrap_io_openr   f  s#     d{DX==r   c                2  ^ ST;   n[         R                  " U 5      n [         R                  " U 5      S:X  aV  [        U4S jS 5       5      (       a  U(       a  [	        5       S4$ [        X#S9S4$ U(       a  [        5       S4$ [        X#S9S4$ U(       d  [        U TX#5      S4$ ST;   a  [        S	5      eS
T;   a  [        S5      eST;  a  [        S5      eSS K
nSS Kn [         R                  " U 5      R                  n[         R                  [         R                   -  [         R"                  -  n	U(       a  U	[%        [         SS5      -  n	 [         R&                  R)                  [         R&                  R+                  U 5      SUR-                  S5      S 35      n
 [         R.                  " XUc  SOU5      n Ub  [         R>                  " X5        [        UTX#5      n[A        X[         R&                  RC                  U 5      5      n[D        RF                  " [D        RH                  [D        RJ                     U5      S4$ ! [         a    S n GNRf = f! [         a  nUR                  UR0                  :X  d  [         R2                  S:X  a  UR                  UR4                  :X  ai  [         R&                  R7                  UR8                  5      (       a;  [         R:                  " UR8                  [         R<                  5      (       a   S nAGM  e S nAff = f)Nr   -c              3  ,   >#    U  H	  oT;   v   M     g 7fr&   rl   ).0mr   s     r   	<genexpr>open_stream.<locals>.<genexpr>  s     2/QDy/s   )war]   Fr   Tr   zAppending to an existing file is not supported, because that would involve an expensive `copy`-operation to a temporary file. Open the file in normal `w`-mode and copy explicitly if that's what you're after.r]   z&Use the `overwrite`-parameter instead.r   z,Atomic writes only make sense with `w`-mode.r   O_BINARYz.__atomic-writel        08xi  nt)&osfspathfsdecodeanyr   r   r   r   r   
ValueErrorerrnorandomstatst_modeOSErrorO_RDWRO_CREATO_EXCLr   pathjoindirname	randranger   EEXISTr   EACCESisdirfilenameaccessW_OKchmod_AtomicFilerealpathr'   r(   IOAny)r   r   r   r   atomicbinaryr   r   permflagstmp_filenamefderX   afs    `             r   open_streamr   s  st    D[Fyy"H 
{{8#2/222(*E11"HDeKK#%u,,x?FF XtX>DD d{,
 	
 d{ABB
$GHH 778,44 II

"RYY.EZ++
ww||GGOOH%f..w7<=
	t|eNB 
$b$1A	Qbgg&6&6x&@	AB66!$$quu+r"D((?     	ww%,,&4GGu||+GGMM!**--IIajj"''22	s1    I I II
LB*LLLc                  x    \ rS rSrSS jr\SS j5       rSSS jjrSS jrSS jr	        SS jr
SS jrS	rg
)r   i  c                6    Xl         X l        X0l        SU l        g NF)_f_tmp_filename_real_filenameclosed)r.   rX   r   real_filenames       r   r-   _AtomicFile.__init__  s    )+r   c                    U R                   $ r&   )r   r5   s    r   r   _AtomicFile.name  s    """r   c                    U R                   (       a  g U R                  R                  5         [        R                  " U R
                  U R                  5        SU l         g )NT)r   r   closer   r   r   r   )r.   deletes     r   r   _AtomicFile.close  s:    ;;


4%%t':':;r   c                .    [        U R                  U5      $ r&   )r   r   rP   s     r   rQ   _AtomicFile.__getattr__  s    tww%%r   c                    U $ r&   rl   r5   s    r   	__enter___AtomicFile.__enter__  s    r   c                &    U R                  US LS9  g )N)r   )r   )r.   exc_type	exc_valuetbs       r   __exit___AtomicFile.__exit__  s     	

($.
/r   c                ,    [        U R                  5      $ r&   )reprr   r5   s    r   __repr___AtomicFile.__repr__  s    DGG}r   )r   r   r   r   N)rX   t.IO[t.Any]r   ri   r   ri   r@   rA   r@   ri   F)r   r>   r@   rA   rh   )r@   r   )r   ztype[BaseException] | Noner   zBaseException | Noner  zTracebackType | Noner@   rA   )rC   rD   rE   rF   r-   propertyr   r   rQ   r   r  r  rG   rl   r   r   r   r     sZ     # #&0,0 (0 !	0
 
0r   r   c                .    [         R                  SU 5      $ )Nrt   )_ansi_resub)r   s    r   
strip_ansir    s    <<E""r   c                    [        U [        [        45      (       a)  U R                  n [        U [        [        45      (       a  M)  U R                  R
                  R                  S5      $ )Nz
ipykernel.)ro   r*   r   r+   r0   rD   
startswithr   s    r   _is_jupyter_kernel_outputr    sR    
Vl,DE
F
F Vl,DE
F
F &&11,??r   c                    Uc:  U c  [         R                  n [        U 5      (       + =(       a    [        U 5      (       + $ U(       + $ r&   )r    r   r9   r  )r   colors     r   should_strip_ansir    s:     }>YYF&>!K*CF*K&KK9r      )r   c                 *    SS K n U R                  5       $ rn   )localegetpreferredencoding)r  s    r   _get_argv_encodingr    s    **,,r   z'cabc.MutableMapping[t.TextIO, t.TextIO]_ansi_stream_wrappersc                j  ^^  [         R                  U 5      nUb  U$ SSKn[	        X5      nUR                  XS9m[        R                  " [        R                  TR                  5      nUR                  mSUU4S jjnXel
         U[         U '   U$ ! [         a    Sn Nf = f! [         a     U$ f = f)zRSupport ANSI color and style codes on Windows by wrapping a
stream with colorama.
Nr   )stripc                T   >  T" U 5      $ ! [          a    TR                  5         e f = fr&   )BaseException	reset_all)s_writeansi_wrappers    r   _safe_write'auto_wrap_for_ansi.<locals>._safe_write  s0    ay   &&(s    ')r!  ri   r@   rj   )r  getr4   coloramar  AnsiToWin32r'   r(   r   r   ra   )	r   r  cachedr'  r  r"   r$  r"  r#  s	          @@r   r	   r	   
  s    	*..v6F M!&0++F+@VVAHHl112	 	 	,.!&) 	7  	F	0  			s#   B 	B$ B! B!$
B21B2c                 p    [        [        R                  SS 5      =(       d    [        R                  " 5       $ )Nr   )r   r    r   getfilesystemencodingrl   r   r   r  r  /  s#    syy*d3Rs7P7P7RRr   c                    g r&   rl   )rX   r   r   s      r   r   r   2  s     r   c                *    [        [        U 5      5      $ r&   )lenr  )r]   s    r   term_lenr/  8  s    z!}r   c                D     U R                  5       $ ! [         a     gf = fr   )r9   r4   r   s    r   r9   r9   <  s%    }} s    
c                4   ^ ^^ [        5       mSUU U4S jjnU$ )Nc                    > T" 5       n U c  g  TR                  U 5      nUb  U$ T" 5       n UTU '   U$ ! [         a    S n N"f = f! [         a     U$ f = fr&   )r&  r4   )r   r"   cachesrc_funcwrapper_funcs     r   func&_make_cached_stream_func.<locals>.funcI  s{    >	6"B >I^	E&M 	  	B	  			s    3 A AA
AA)r@   t.TextIO | Noner   )r4  r5  r6  r3  s   `` @r   _make_cached_stream_funcr9  C  s     6G5HE & Kr   c                 "    [         R                  $ r&   )r    r   rl   r   r   <lambda>r;  _  s    syyr   c                 "    [         R                  $ r&   )r    r   rl   r   r   r;  r;  `      

r   c                 "    [         R                  $ r&   )r    r   rl   r   r   r;  r;  a  r=  r   )r   r   r   z-cabc.Mapping[str, t.Callable[[], t.BinaryIO]]binary_streamszAcabc.Mapping[str, t.Callable[[str | None, str | None], t.TextIO]]text_streamsr;   )r   r<   r   r=   r   r=   r   r>   r   r>   r@   t.TextIO)r   ri   r@   r>   )r   r  r@   ri   r
  )r   r  rq   r>   r@   r>   )r   r  r@   zt.BinaryIO | None)r   rA  r@   r>   )r   rA  r   ri   r   r=   r@   r>   )r   rA  r   r=   r   r=   r@   r>   )r   r  r   r=   r   r=   r   z%t.Callable[[t.IO[t.Any], bool], bool]r   z,t.Callable[[t.IO[t.Any]], t.BinaryIO | None]r   r>   r   r>   r@   rA  )
r   r  r   r=   r   r=   r   r>   r@   rA  )
r   r  r   r=   r   r=   r   r>   r@   rA  )r@   r<   )NN)r   r=   r   r=   r@   rA  )
r   zstr | os.PathLike[str] | intr   ri   r   r=   r   r=   r@   r  )rNstrictF)r   zstr | os.PathLike[str]r   ri   r   r=   r   r=   r   r>   r@   ztuple[t.IO[t.Any], bool])r   ri   r@   ri   )r   r  r@   r>   )r   zt.IO[t.Any] | Noner  bool | Noner@   r>   r	  r&   )r   rA  r  rD  r@   rA  )rX   rA  r   r=   r   r=   r@   r8  )r]   ri   r@   rj   )r4  t.Callable[[], t.TextIO | None]r5  zt.Callable[[], t.TextIO]r@   rE  )@
__future__r   r   collections.abcabccabcior   rer    typingr'   typesr   weakrefr   platformr  CYGWINWINr	   __annotations__compiler  r   r   r   TextIOWrapperr   r*   rr   ru   r{   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  _winconsoler   r  r  r/  r9   r9  _default_text_stdin_default_text_stdout_default_text_stderrr?  r@  rl   r   r   <module>rY     s   "   	 	 	 
   %		 	 	*	lle$>B ; B::/0 !   	
  *%r// %4B BJ
$$KQ;; *;4>;	;" ! +++ + 5	+
 >+ + + +d !	  	
 ( !	  	
  XYY
>
&
>

> 
> 	
>
 
> !N)$N)
N) N) 	N)
 N) N)b! !H#@ =A.9	 <<5!!c8-
 FWEXBX!JS)3=	-* %8 //@.Q /0BOT /0BOT  A=  SO r   