
    Gj{                       d Z ddlmZ ddlmZ ddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddlZddlmZ ddlmZ ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl m!Z! ddl m"Z"  ejF                  d      Z$ G d dejJ                        Z&	 	 	 	 d.dZ'e	jP                  dk(  rdZ)dZ*ndZ)dZ* G d dejV                  e$         Z, G d dejZ                        Z.	 d/	 	 	 d0d Z/ej`                  d/d1d!       Z1ej`                  	 d/	 	 	 	 	 d2d"       Z2ej`                  	 d/	 	 	 	 	 d2d#       Z3ej`                  	 d/	 	 	 	 	 d3d$       Z4 G d% d&      Z5d4d5d'Z6d6d(Z7ejp                  d)k(  rddl9Z9ej`                  d7d*       Z:d8d+Z;yddl<Z<ddl=Z=ej`                  d7d,       Z:d8d-Z;y)9z
This module contains implementations for the termui module. To keep the
import time of Click down, some infrequently used functionality is
placed in this module and only imported as needed.
    )annotationsN)gettext)StringIO)Path)TracebackType   )_default_text_stdout)CYGWIN)get_best_encoding)isatty)
strip_ansi)term_len)WIN)ClickException)echo)KeepOpenFileVc                      e Zd ZU ded<   y)_BufferedTextPagerStreamz
t.BinaryIObufferN)__name__
__module____qualname____annotations__     X/var/www/python/quitsure-support/venv/lib/python3.12/site-packages/click/_termui_impl.pyr   r   %   s    r   r   c                     t        | dd       d uS )Nr   )getattr)streams    r   _has_binary_bufferr!   )   s    
 68T*$66r   nt
z[?25lz[?25h
c                  6   e Zd Z	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddZ	 	 	 	 	 	 	 	 ddZddZddZddZe	dd       Z
e	dd	       Ze	dd
       ZddZddZddZddZddZddZddZdd dZddZddZy)!ProgressBarNc                   || _         || _        || _        || _        || _        || _        |	| _        |
| _        || _        |xs d| _	        |t               }|
t               }|| _        || _        || _        d| _        || _        |dk(  | _        |ddlm}  ||d      }|dk(  rd }|,|t)        d      t+        j,                  dt/        |            }t1        |      | _        || _        d| _        g | _        |  |  t9        j8                         x| _        | _        d| _        d| _         d | _!        d| _"        d | _#        tI        | j                        | _%        d | _&        y )N r   )length_hintziterable or length is requiredzcabc.Iterable[V]F)'	fill_char
empty_charbar_templateinfo_sephiddenshow_etashow_percentshow_positem_show_funclabelr	   r   filecolorupdate_min_steps_completed_intervalswidth	autowidthoperatorr)   	TypeErrortcastrangeiterlengthposavgtimestartlast_eta	eta_knownfinished	max_widthenteredcurrent_itemr   _is_atty
_last_line)selfiterablerA   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r9   r)   s                     r   __init__zProgressBar.__init__:   s]   & #$(  ( ,+2
<')D |z	
 0$%!
$z>, 2.F|~ @AAvv0%-@H&*8n	 "%)YY[0
T]$#%)"&*tyy)&*r   c                4    d| _         | j                          | S )NT)rJ   render_progressrN   s    r   	__enter__zProgressBar.__enter__   s    r   c                $    | j                          y N)render_finish)rN   exc_type	exc_valuetbs       r   __exit__zProgressBar.__exit__   s     	r   c                p    | j                   st        d      | j                          | j                         S )N.You need to use progress bars in a with block.)rJ   RuntimeErrorrR   	generatorrS   s    r   __iter__zProgressBar.__iter__   s.    ||OPP~~r   c                *    t        t        |             S rV   )nextr@   rS   s    r   __next__zProgressBar.__next__   s     DJr   c                    | j                   s| j                  sy | j                  j                  t               | j                  j                          y rV   )r/   rL   r5   write	AFTER_BARflushrS   s    r   rW   zProgressBar.render_finish   s0    ;;dmm			"		r   c                    | j                   ryt        | j                  t        | j                  xs d      xs dz  d      S )N      ?r   )rH   minrB   floatrA   rS   s    r   pctzProgressBar.pct   s5    ==488uT[[%5A6;!<cBBr   c                    | j                   syt        | j                         t        t        | j                               z  S Ng        )rC   sumrk   lenrS   s    r   time_per_iterationzProgressBar.time_per_iteration   s,    xx488}uS]333r   c                    | j                   2| j                  s&| j                  | j                   | j                  z
  z  S yrn   )rA   rH   rq   rB   rS   s    r   etazProgressBar.eta   s3    ;;"4==**dkkDHH.DEEr   c                    | j                   rdt        | j                        }|dz  }|dz  }|dz  }|dz  }|dz  }|dz  }|dkD  rdj                  |t	        d      |||      S |dd|dd|dS y	)
N<      r   z#{d}{day_label} {h:02}:{m:02}:{s:02}d)rw   	day_labelhms02:r(   )rG   intrs   format_)rN   r=   secondsminuteshourss        r   
format_etazProgressBar.format_eta   s    >>DHHA"fG"HA"fG"HAFE"HA1u<CCf D    1WRL'">>r   c                l    t        | j                        }| j                  |d| j                   z  }|S )N/)strrB   rA   )rN   rB   s     r   
format_poszProgressBar.format_pos   s3    $((m;;"Qt{{m$$C
r   c                @    t        | j                  dz        dddd  S )Nd   z 4%r   )r~   rl   rS   s    r   
format_pctzProgressBar.format_pct   s&    dhhn%b)+AB//r   c                F   | j                   Rt        | j                  | j                  z        }| j                  |z  }|| j
                  | j                  |z
  z  z  }|S | j                  r| j                  | j                  z  }|S t        | j
                  | j                  xs dz        }| j                  dk7  rU| j                  |t        t        j                  | j                  | j                  z        dz  dz   | j                  z        <   dj                  |      }|S )Nr   r   g       @g      ?r(   )rA   r~   rl   r9   r+   r,   rH   listrq   mathcosrB   join)rN   
bar_lengthbarcharss       r   
format_barzProgressBar.format_bar   s   ;;"TXX

23J..:-C4??djj:&=>>C 
 ]]..4::-C 
 DJJO!<=E&&!+ NN $((T-D-D"DEKcQ**% ''%.C
r   c                   | j                   }g }| j                  || j                   }| j                  r|j                  | j	                                |r|j                  | j                                | j                  r7| j                  r+| j                  s|j                  | j                                | j                  .| j                  | j                        }||j                  |       | j                  | j                  | j                         | j                  j!                  |      dz  j#                         S )N)r4   r   info)r1   rA   r2   appendr   r   r0   rG   rH   r   r3   rK   r-   r4   r   r.   r   rstrip)rN   r1   	info_bits	item_infos       r   format_progress_linez ProgressBar.format_progress_line   s   ((	;;"|';#}},L==T__./T__./==T^^DMMT__./*++D,=,=>I$  + (**95 &(	r   c                X   | j                   ry | j                  sW| j                  | j                  k7  r=| j                  | _        t	        | j                  | j
                  | j                         y g }| j                  rdd l}| j                  }d| _	        t        | j                               }t        d|j                         j                  |z
        }||k  rF| j                  :|j!                  t"               |j!                  d| j                  z         || _        || _	        | j                  }| j                  | j                  }|j!                  t"               | j                         }t        |      }| j                  | j                  |k  r|| _        |j!                  |       |j!                  d||z
  z         dj%                  |      }|| j                  k7  rE|| _        t	        || j
                  | j                  d       | j
                  j'                          y y )N)r5   r6   r    r(   F)r5   r6   nl)r/   rL   rM   r4   r   r5   r6   r:   shutilr9   r   r   maxget_terminal_sizecolumnsrI   r   
BEFORE_BARr   rg   )	rN   bufr   	old_widthclutter_length	new_widthclear_widthlineline_lens	            r   rR   zProgressBar.render_progress   s   ;;}}$**,"&**TZZdiitzzB>>

IDJ%d&?&?&ABNAv779AANRSI9$)C

:&

3/0!*"DJjj>>%..K

:((*D>>>!T^^h%>%DN

4

3+012wws| 4??""DODIITZZEBIIOO #r   c                   | xj                   |z  c_         | j                   | j                   | j                  k\  rd| _        t        j                         | j                  z
  dk  ry t        j                         | _        | j                   r/t        j                         | j
                  z
  | j                   z  }n!t        j                         | j
                  z
  }| j                  dd  |gz   | _        | j                  d u| _        y )NTri   i)rB   rA   rH   rD   rF   rE   rC   rG   )rN   n_stepssteps      r   	make_stepzProgressBar.make_step.  s    G;;"txx4;;'> DMIIK$--'3.		
 88IIK$**,8D99;+D88BC=D6)D0r   c                    ||| _         | xj                  |z  c_        | j                  | j                  k\  r3| j                  | j                         | j	                          d| _        yy)a  Update the progress bar by advancing a specified number of
        steps, and optionally set the ``current_item`` for this new
        position.

        :param n_steps: Number of steps to advance.
        :param current_item: Optional item to set as ``current_item``
            for the updated position.

        .. versionchanged:: 8.0
            Added the ``current_item`` optional parameter.

        .. versionchanged:: 8.0
            Only render when the number of steps meets the
            ``update_min_steps`` threshold.
        Nr   )rK   r8   r7   r   rR   )rN   r   rK   s      r   updatezProgressBar.updateD  sb      # ,D!!W,!$$(=(==NN4445  "()D% >r   c                .    d| _         d | _        d| _        y )NFT)rG   rK   rH   rS   s    r   finishzProgressBar.finish^  s     r   c              #  X  K   | j                   st        d      | j                  s| j                  E d{    y| j                  D ]=  }|| _        | j
                  dk(  r| j                          | | j                  d       ? | j                          | j                          y7 rw)zReturn a generator which yields the items added to the bar
        during construction, and updates the progress bar *after* the
        yielded block returns.
        r]   Nr   r   )	rJ   r^   rL   r@   rK   r8   rR   r   r   )rN   rvs     r   r_   zProgressBar.generatorc  s      ||OPP}}yy  ii 
$&!
 ,,1((*A
 KKM  " !s   3B*B(A3B*)N#r   z%(bar)sz  FTNFNNNNr      )"rO   zcabc.Iterable[V] | NonerA   z
int | Noner+   r   r,   r   r-   r   r.   r   r/   boolr0   r   r1   bool | Noner2   r   r3   z)t.Callable[[V | None], str | None] | Noner4   
str | Noner5   zt.TextIO | Noner6   r   r7   r~   r9   r~   returnNone)r   zProgressBar[V])rX   ztype[BaseException] | NonerY   zBaseException | NonerZ   zTracebackType | Noner   r   )r   zcabc.Iterator[V])r   r   )r   r   )r   rk   r   r   )r   r~   r   r   rV   )r   r~   rK   zV | Noner   r   )r   r   r   rP   rT   r[   r`   rc   rW   propertyrl   rq   rs   r   r   r   r   r   rR   r   r   r   r_   r   r   r   r&   r&   9   s    "%$(DH  $! !#E+)E+ E+ 	E+
 E+ E+ E+ E+ E+ "E+ E+ BE+ E+ E+ E+  !E+" #E+$ 
%E+N
, ( !	
 
   C C
 4 4
  
*0&6,\1,*4
#r   r&   c                  ,     e Zd Zd fdZd fdZ xZS )MaybeStripAnsic               4    t        |   |fi | || _        y rV   )superrP   r6   )rN   r    r6   kwargs	__class__s       r   rP   zMaybeStripAnsi.__init__  s    *6*
r   c                P    | j                   st        |      }t        |   |      S rV   )r6   r   r   re   )rN   textr   s     r   re   zMaybeStripAnsi.write  s#    zzd#Dw}T""r   )r    zt.IO[bytes]r6   r   r   zt.Any)r   r   r   r~   )r   r   r   rP   re   __classcell__)r   s   @r   r   r     s    # #r   r   c                   t               }|
t               }t        t        j                        rt        |      st        ||       S t        j                  t        j                  j                  dd            }|rt        rt        ||       S t        ||       S t        j                  j                  d      dv rt        ||       S t        st        j                  j                  d      rt        dg|       S t        dg|       S )z2Decide what method to use for paging through text.PAGERr(   TERM)dumbemacsos2moreless)r	   r   r   sysstdin
_nullpagershlexsplitosenvirongetr   _tempfilepager
_pipepagerplatform
startswith)r6   stdoutpager_cmd_partss      r   _pager_contextmanagerr     s     "#F ~#))F6N&%(( kk"**..""=>O!/599/511	zz~~f!22&%((
cll%%e,vh..vh&&r   c              #    K   t        |       5 \  }}} d}t        |      rt        |j                  | |      }|}	 t	        j
                  t        j                  |       	 |j                          ||j                          	 ddd       y# ||j                          w w xY w# 	 |j                          ||j                          w w # ||j                          w w xY wxY w# 1 sw Y   yxY ww)zContext manager.

    Yields a writable file-like object which can be used as an output pager.

    .. versionadded:: 8.4.0

    :param color: controls if the pager supports ANSI colors or not.  The
                  default is autodetection.
    )r6   N)r6   encoding)	r   r!   r   r   r=   r>   TextIOrg   detach)r6   r    r   wrappers       r   get_pager_filer     s      
U	+ %/H% *.f%$V]]%(SGF	% &&6**
% &NN$1% %. &NN$ '
% &NN$ '7&NN$ '/% %s]   C4,C(&B'#B3C(	C4B$$C('C%)C9C%C"	"C%%C((C1-C4c              #    K   | s0t               xs
 t               }t        ||      5 }| ddd       yddl}| d   }| dd }|j	                  |      }|s0t               xs
 t               }t        ||      5 }| ddd       yt        |      j                         }|j                  }	ddl}
t        t        j                        }|L|	dk(  rGt        j                  j                  dd       dj                  |       }|sd|d<   d	}n
d
|v sd|v rd	}|d}|
j                  t        |      g|z   d|
j                   |dd	      }t#        j$                  t"        j&                  |j(                        }t+        |      }	 |||f 	 |j3                          	 	 |j5                          y# 1 sw Y   yxY w# 1 sw Y   yxY w# t,        $ r Y Gt.        $ r}|j1                          |d}~ww xY w# t,        $ r Y cw xY w# t6        $ r Y nw xY wv# 	 |j3                          n# t,        $ r Y nw xY w	 	 |j5                          w # t6        $ r Y nw xY w"xY ww)a  Page through text by feeding it to another program.

    Invokes the pager via :class:`subprocess.Popen` with an ``argv`` list
    produced by :func:`shlex.split`. The command is resolved to an absolute
    path with :func:`shutil.which` as recommended by the
    :mod:`subprocess` docs for Windows compatibility.

    Invoking a pager through this might support colors: if piping to
    ``less`` and the user hasn't decided on colors, ``LESS=-R`` is set
    automatically.
    Nr   r   r   LESSr(   r   -RTrRFreplace)shellr   enverrorsr   )r	   r   r   r   whichr   absolutename
subprocessdictr   r   r   r   Popenr   PIPEr=   r>   BinaryIOr   r   BrokenPipeError	Exception	terminateclosewaitKeyboardInterrupt)	cmd_partsr6   r   r   r   cmd
cmd_paramscmd_filepathcmd_pathcmd_namer   r   
less_flagscr   r   es                    r   r   r     sx       &'58:& 	"H	
A,C12J<<$L &'58:& 	"H	
 L!**,H}}H rzz
C }V+

vr23CHHZ4H3IJ
CKEJ#"3E}	X*$oo 	 	A FF1::qww'E 'H#Xu$$	KKM  o		L   
 	
  		 %  	KKM  		   %  s   %IF-AI8F9=DIG 
G2 IH ,I-F62I9G>I	G/H G/G**G//H 2	G>;I=G>>I	H
IHIIH$#I$	H0-I/H00I5II	IIIIIc              #  @  K   | s0t               xs
 t               }t        ||      5 }| ddd       yddl}ddl}| d   }|j                  |      }|s0t               xs
 t               }t        ||      5 }| ddd       yt        |      j                         }ddl}	t        t        j                        }
|d}|	j                  dd      }	 t        j                  t        j                  |      |
|f |j!                          |j#                          |j%                  t'        |      |j(                  g       t+        j,                  |j(                         y# 1 sw Y   yxY w# 1 sw Y   yxY w# t+        j,                  |j(                         w xY ww)a   Page through text by invoking a program on a temporary file.

    Used as the primary pager strategy on Windows (where piping to
    ``more`` adds spurious ``\r\n``), and as a fallback on other
    platforms. The command is resolved to an absolute path with
    :func:`shutil.which`.
    Nr   Fwb)modedelete)r	   r   r   r   r   r   r   r   tempfiler   r   r   NamedTemporaryFiler=   r>   r   rg   r   callr   r   r   unlink)r   r6   r   r   r   r   r   r   r   r	  r   fs               r   r   r   C  sQ      &'58:& 	"H	
A,C<<$L &'58:& 	"H	
 L!**,H ,H} 	##e#<AffQZZ#Xu44				X/0
		!&&M		, 			!&&sN   %FE"AF7E.<AFA/E:  F"E+'F.E73F:!FFc              #  J   K   t        |       }|d}t        |       ||f yw)a  Simply print unformatted text. This is the ultimate fallback. Don't close the
    output stream in this case, since it's coming from elsewhere rather than our
    internal helpers.

    The stream is wrapped in :class:`~click.utils.KeepOpenFile` so that, as a
    borrowed stream, it is not closed by a ``with`` block. The wrapper that
    :func:`get_pager_file` builds around it is detached rather than closed.
    NF)r   r   )r    r6   r   s      r   r   r   |  s.      !(H}
v
%
//s   !#c                      e Zd Z	 	 	 	 d	 	 	 	 	 	 	 	 	 d	dZd
dZddZej                  dd       Zej                  dd       ZddZy)EditorNc                <    || _         || _        || _        || _        y rV   )editorr   require_save	extension)rN   r  r   r  r  s        r   rP   zEditor.__init__  s!     ("r   c                    | j                   | j                   S dD ]'  }t        j                  j                  |      }|s%|c S  t        ryddlm} dD ]  } ||      |c S  y)N)VISUALEDITORnotepadr   )r   )zsensible-editorvimnanovi)r  r   r   r   r   r   r   )rN   keyr   r   r  s        r   
get_editorzEditor.get_editor  sm    ;;";;% 	C$B		  6 	FV}(	 r   c                   ddl }ddl}| j                         }d}| j                  r9t        j
                  j                         }|j                  | j                         	 |j                   |j                  |      t        |      z   |      }|j                         }|dk7  r$t        t        d      j                  |            y# t        $ r+}t        t        d      j                  ||            |d}~ww xY w)z Open files in the user's editor.r   N)argsr   z{editor}: Editing failed)r  z{editor}: Editing failed: {e})r  r  )r   r   r  r   r   r   copyr   r   r   r   r   r   r   r   OSError)	rN   	filenamesr   r   r  r   r  	exit_coder  s	            r   
edit_fileszEditor.edit_files  s    ")-88jjoo'GNN488$	    U[[(4	?: ! A IA~$01888G    	 129919M	s   !A(C
 
	C>&C99C>c                     y rV   r   rN   r   s     r   editzEditor.edit  s    =@r   c                     y rV   r   r&  s     r   r'  zEditor.edit  s    47r   c                   dd l }|d}njt        |t        t        f      r|}nQ|r|j	                  d      s|dz  }t
        r"|j                  dd      j                  d      }n|j                  d      }|j                  d| j                        \  }}	 t        j                  |d	      5 }|j                  |       d d d        t        j                  |t        j                  j                  |      t        j                  j!                  |      d
z
  f       t        j                  j!                  |      }| j#                  |f       | j$                  r9t        j                  j!                  |      |k(  r	 t        j&                  |       y t)        |d      5 }|j+                         }d d d        t        |t        t        f      rt        j&                  |       S j-                  d      j                  dd      t        j&                  |       S # 1 sw Y   ]xY w# 1 sw Y   yxY w# t        j&                  |       w xY w)Nr   r   r$   z
z	utf-8-sigzutf-8zeditor-)prefixsuffixr     rb)r	  
isinstancebytes	bytearrayendswithr   r   encodemkstempr  r   fdopenre   utimepathgetatimegetmtimer$  r  r  openreaddecode)	rN   r   r	  datafdr   r  	timestampr   s	            r   r'  zEditor.edit  s   <&)Dui01DDMM$/||D&188E{{7+##9T^^#LD	2t$  HHTBGG,,T2BGG4D4DT4JQ4NOP ((.IOOTG$  RWW%5%5d%;y%H IIdO dD! QVVX $	 23 IIdO 99[)11&$?IIdO3 "  IIdOsI   H1 +H=B<H1 H1 H%-H1 " H1 H"H1 %H.*H1 1I)NNTz.txt)
r  r   r   zcabc.Mapping[str, str] | Noner  r   r  r   r   r   r   )r"  zcabc.Iterable[str]r   r   )r   zbytes | bytearrayr   zbytes | None)r   r   r   r   )r   zstr | bytes | bytearray | Noner   zstr | bytes | None)	r   r   r   rP   r  r$  r=   overloadr'  r   r   r   r  r    s|     "-1!
#
# +
# 	
#
 
# 

#"< ZZ@ @ ZZ7 7-r   r  c                6   dd l }dd}t        j                  dk(  r~dg}|r|j                  d       |r|j                  d       |j                   ||              t	        dd      }	 |j                  ||	      j                         |j                          S t        r8|r ||       } d
d| g}	 |j                  |      S 	 t        j                  |        yt        re|r* ||       } dt        j                  j                  |       g}n'dg}|r|j                  d       |j                  |        	 |j                  |      S 	 |r*t        j                  j                   ||             xs d} n ||       } |j                  d| g      }|r|j                         S y# |j                          w xY w# t        $ r Y yw xY w# t        $ r Y yw xY w# t        $ r Y yw xY w# t        $ r/ | j!                  d      r|s|sdd l}|j	                  |        Y yY yw xY w)Nr   c                J    ddl m} | j                  d      r || dd        } | S )Nr   )unquotezfile://   )urllib.parserB  r   )urlrB  s     r   _unquote_filezopen_url.<locals>._unquote_file  s&    (>>)$#ab'"C
r   darwinr9  z-Wr   z	/dev/nullw)stderrexplorerz/select,   cygstartz-w.zxdg-open)zhttp://zhttps://r   )rE  r   r   r   )r   r   r   r   r9  r   r   r   r   r  r!  r   	startfiler
   r6  dirnamer   
webbrowser)	rE  r   locater   rF  r  nullr  rP  s	            r   open_urlrS    s    ||xxKKKKM#&'K%	##D#6;;=JJL	$C
C0D!t,,S! 	$C 45D<DD!KK	??4((
''//-"45<C$Cj#./668OM JJL  
    		  >>126$OOC sU   ) F 0F3 G 2G AG  F03	F?>F?	GG	GG 3HHc                x    | dk(  r
t               | dk(  rt        s
t               | dk(  rt        r
t               y y )N)r   r   EOFError)chs    r   _translate_ch_to_excrZ  J  s;    	V|!!	V|Cj	V|j |r   win32c               #     K   d y w)Nr*   r   r   r   r   raw_terminalr]  X  s     s   c                8   | r<t        j                  t         j                  g t        f   t        j
                        }n;t        j                  t         j                  g t        f   t        j                        } |       }|dv r
| |       z  }t        |       |S )N)    à)r=   r>   Callabler   msvcrtgetwchegetwchrZ  )r   funcr   s      r   getcharrf  \  ss    > 66!**RW-v~~>D66!**RW-v}}=DV!! $&LBR 	r   c               #    K   t        t        j                        st        d      } | j	                         }n t        j                  j	                         }d } 	 t        j                  |      }	 t        j                  |       | t        j                  |t
        j                  |       t        j                  j                          | | j                          y y # t        j                  |t
        j                  |       t        j                  j                          | | j                          w w xY w# t
        j                  $ r Y y w xY ww)Nz/dev/tty)r   r   r   r9  filenotermios	tcgetattrttysetraw	tcsetattr	TCSADRAINr   rg   r   error)r  r=  old_settingss      r   r]  r]    s     
 cii Z AB!!#BA	",,R0L

2!!"g&7&7F

  "=GGI ! !!"g&7&7F

  "=GGI !}} 		sD   AED: /C AD: EAD77D: :EEEEc                J   t               5 }t        j                  |d      j                  t	        t
        j                        d      }| r8t        t
        j                        rt
        j                  j                  |       t        |       |cd d d        S # 1 sw Y   y xY w)N    r   )r]  r   r:  r;  r   r   r   r   r   re   rZ  )r   r=  rY  s      r   rf  rf    so    ^ 	rR''(9#))(DiPBszz*

  $ $	 	 	s   BBB")r    zt.BinaryIO | t.TextIOr   z%t.TypeGuard[_BufferedTextPagerStream]rV   )r6   r   r   z9t.ContextManager[tuple[t.BinaryIO | t.TextIO, str, bool]])r6   r   r   z!t.Generator[t.TextIO, None, None])r   z	list[str]r6   r   r   z3t.Iterator[tuple[t.BinaryIO | t.TextIO, str, bool]])r    zt.TextIOr6   r   r   z&t.Iterator[tuple[t.TextIO, str, bool]])FF)rE  r   r   r   rQ  r   r   r~   )rY  r   r   r   )r   zcabc.Iterator[int])r   r   r   r   )>__doc__
__future__r   collections.abcabccabc
contextlibior   r   r   r   rD   typingr=   r   r   r   pathlibr   typesr   _compatr	   r
   r   r   r   r   r   
exceptionsr   utilsr   r   TypeVarr   Protocolr   r!   r   r   rf   Genericr&   TextIOWrapperr   r   contextmanagerr   r   r   r   r  rS  rZ  r   rb  r]  rf  ri  rk  r   r   r   <module>r     s   #   	  	  
        )  &     &  AIIcNqzz 7!7*7 77d?JIJII#!))A, I#X
#R%% # ''>'> "% "%J /3jj!,j8j jZ /355!,585 5p +/00(0+0 0&q qhCL <<7 ,^  4r   