§
    #ˆtjZg  ã                  óR  — U 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 ej        rd d
lmZ ddlmZ e
j        dk    rej        d         Zded<   nej        d         Zded<   ee e!         e!ef         Z"ded<    G d„ d¦  «        Z#ej$        d+d„¦   «         Z% G d„ d¦  «        Z& G d„ dej'        ¦  «        Z( G d„ d¦  «        Z) G d„ d ej*        ¦  «        Z+d,d&„Z, G d'„ d(¦  «        Z- G d)„ d*¦  «        Z.dS )-é    )ÚannotationsN)ÚTracebackTypeé   )Ú_compat)Ú
formatting)Útermui)Úutils)Ú_find_binary_reader)ÚReadableBuffer)ÚCommandÚwin32Úsyszt.TypeAliasÚCaptureMode)r   ÚfdÚExceptionInfoc                  ó|   — e Zd ZU ded<   ded<   ded<   dd
„Zdd„Zd d„Zd!d"d„Zd!d"d„Zd!d"d„Z	d#d„Z
d$d„Zd%d„ZdS )&ÚEchoingStdinú
t.BinaryIOÚ_inputÚ_outputÚboolÚ_pausedÚinputÚoutputÚreturnÚNonec                ó0   — || _         || _        d| _        d S )NF)r   r   r   )Úselfr   r   s      úK/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/click/testing.pyÚ__init__zEchoingStdin.__init__%   s   € ØˆŒØˆŒØˆŒˆˆó    ÚxÚstrút.Anyc                ó,   — t          | j        |¦  «        S ©N)Úgetattrr   )r   r"   s     r   Ú__getattr__zEchoingStdin.__getattr__*   s   € Ý�t”{ AÑ&Ô&Ð&r!   ÚrvÚbytesc                óH   — | j         s| j                             |¦  «         |S r&   )r   r   Úwrite)r   r)   s     r   Ú_echozEchoingStdin._echo-   s'   € ØŒ|ð 	#ØŒL×Ò˜rÑ"Ô"Ð"àˆ	r!   éÿÿÿÿÚnÚintc                ó\   — |                       | j                             |¦  «        ¦  «        S r&   )r-   r   Úread©r   r/   s     r   r2   zEchoingStdin.read3   s$   € Ø�zŠz˜$œ+×*Ò*¨1Ñ-Ô-Ñ.Ô.Ð.r!   c                ó\   — |                       | j                             |¦  «        ¦  «        S r&   )r-   r   Úread1r3   s     r   r5   zEchoingStdin.read16   s$   € Ø�zŠz˜$œ+×+Ò+¨AÑ.Ô.Ñ/Ô/Ð/r!   c                ó\   — |                       | j                             |¦  «        ¦  «        S r&   )r-   r   Úreadliner3   s     r   r7   zEchoingStdin.readline9   s$   € Ø�zŠz˜$œ+×.Ò.¨qÑ1Ô1Ñ2Ô2Ð2r!   úlist[bytes]c                óN   ‡ — ˆ fd„‰ j                              ¦   «         D ¦   «         S )Nc                ó:   •— g | ]}‰                      |¦  «        ‘ŒS © ©r-   ©Ú.0r"   r   s     €r   ú
<listcomp>z*EchoingStdin.readlines.<locals>.<listcomp>=   s#   ø€ Ð?Ð?Ð? !�—
’
˜1‘”Ð?Ð?Ð?r!   )r   Ú	readlines©r   s   `r   r@   zEchoingStdin.readlines<   s+   ø€ Ø?Ð?Ð?Ð? t¤{×'<Ò'<Ñ'>Ô'>Ð?Ñ?Ô?Ð?r!   úcabc.Iterator[bytes]c                óD   ‡ — t          ˆ fd„‰ j        D ¦   «         ¦  «        S )Nc              3  óB   •K  — | ]}‰                      |¦  «        V — Œd S r&   r<   r=   s     €r   ú	<genexpr>z(EchoingStdin.__iter__.<locals>.<genexpr>@   s-   øè è € Ð7Ð7 a�D—J’J˜q‘M”MÐ7Ð7Ð7Ð7Ð7Ð7r!   )Úiterr   rA   s   `r   Ú__iter__zEchoingStdin.__iter__?   s(   ø€ ÝÐ7Ð7Ð7Ð7¨4¬;Ð7Ñ7Ô7Ñ7Ô7Ð7r!   c                ó*   — t          | j        ¦  «        S r&   )Úreprr   rA   s    r   Ú__repr__zEchoingStdin.__repr__B   s   € Ý�D”KÑ Ô Ð r!   N)r   r   r   r   r   r   )r"   r#   r   r$   )r)   r*   r   r*   )r.   )r/   r0   r   r*   )r   r8   )r   rB   ©r   r#   )Ú__name__Ú
__module__Ú__qualname__Ú__annotations__r    r(   r-   r2   r5   r7   r@   rG   rJ   r;   r!   r   r   r       sþ   € € € € € € ØÐÐÑØÐÐÑØ€M€M�Mðð ð ð ð
'ð 'ð 'ð 'ðð ð ð ð/ð /ð /ð /ð /ð0ð 0ð 0ð 0ð 0ð3ð 3ð 3ð 3ð 3ð@ð @ð @ð @ð8ð 8ð 8ð 8ð!ð !ð !ð !ð !ð !r!   r   ÚstreamúEchoingStdin | Noner   úcabc.Generator[None]c              #  ó>   K  — | €d V — d S d| _         d V — d| _         d S )NTF)r   )rP   s    r   Ú_pause_echorT   F   s3   è è € à€~ØˆˆˆˆˆàˆŒØˆˆˆØˆŒˆˆr!   c                  óJ   — e Zd ZU dZded<   ded<   ded<   dd
„Zdd„Zdd„ZdS )Ú
_FDCaptureaV  Redirect a file descriptor to a temporary file for capture.

    Saves the current target of *targetfd* via :func:`os.dup`, then
    redirects it to a temporary file via :func:`os.dup2`. On
    :meth:`stop`, restores the original ``fd`` and returns the captured
    bytes. Inspired by Pytest's ``FDCapture``.

    .. versionadded:: 8.4.0
    r0   Ú	_targetfdÚsaved_fdzt.BinaryIO | NoneÚ_tmpfileÚtargetfdr   r   c                ó0   — || _         d| _        d | _        d S ©Nr.   )rW   rX   rY   )r   rZ   s     r   r    z_FDCapture.__init___   s   € Ø!ˆŒØˆŒØˆŒˆˆr!   c                óØ   — t          j        | j        ¦  «        | _        t	          j        d¬¦  «        | _        t          j        | j                             ¦   «         | j        ¦  «         d S )Nr   )Ú	buffering)	ÚosÚduprW   rX   ÚtempfileÚTemporaryFilerY   Údup2ÚfilenorA   s    r   Ústartz_FDCapture.startd   sR   € Ýœ˜tœ~Ñ.Ô.ˆŒÝ Ô.¸Ð;Ñ;Ô;ˆŒÝ
Œ�”×$Ò$Ñ&Ô&¨¬Ñ7Ô7Ð7Ð7Ð7r!   r*   c                óL  — | j         €
J d¦   «         ‚t          j        | j        | j        ¦  «         t          j        | j        ¦  «         d| _        | j                              d¦  «         | j                              ¦   «         }| j                              ¦   «          d | _         |S )Nz!_FDCapture.start() was not calledr.   r   )rY   r_   rc   rX   rW   ÚcloseÚseekr2   )r   Údatas     r   Ústopz_FDCapture.stopi   s‘   € ØŒ}Ð(Ð(Ð*MÑ(Ô(Ð(Ý
Œ�”˜tœ~Ñ.Ô.Ð.Ý
Œ�”ÑÔÐØˆŒØŒ×Ò˜1ÑÔÐØŒ}×!Ò!Ñ#Ô#ˆØŒ×ÒÑÔÐØˆŒØˆr!   N)rZ   r0   r   r   ©r   r   )r   r*   )rL   rM   rN   Ú__doc__rO   r    re   rj   r;   r!   r   rV   rV   P   s|   € € € € € € ðð ð €N€N�NØ€M€M�MØÐÐÑðð ð ð ð
8ð 8ð 8ð 8ð
	ð 	ð 	ð 	ð 	ð 	r!   rV   c                  óH   ‡ — e Zd ZU dZded<   dˆ fd„Zdˆ fd„Zdˆ fd„Zˆ xZS )ÚBytesIOCopyzdPatch ``io.BytesIO`` to let the written stream be copied to another.

    .. versionadded:: 8.2
    ú
io.BytesIOÚcopy_tor   r   c                óV   •— t          ¦   «                              ¦   «          || _        d S r&   )Úsuperr    rp   )r   rp   Ú	__class__s     €r   r    zBytesIOCopy.__init__}   s$   ø€ Ý‰Œ×ÒÑÔÐØˆŒˆˆr!   c                óz   •— t          ¦   «                              ¦   «          | j                             ¦   «          d S r&   )rr   Úflushrp   ©r   rs   s    €r   ru   zBytesIOCopy.flush�   s.   ø€ Ý‰Œ�Š‰ŒˆØŒ×ÒÑÔÐÐÐr!   Úbr   r0   c                óz   •— | j                              |¦  «         t          ¦   «                              |¦  «        S r&   )rp   r,   rr   )r   rw   rs   s     €r   r,   zBytesIOCopy.write…   s/   ø€ ØŒ×Ò˜1ÑÔÐÝ‰wŒw�}Š}˜QÑÔÐr!   )rp   ro   r   r   rk   )rw   r   r   r0   )	rL   rM   rN   rl   rO   r    ru   r,   Ú__classcell__©rs   s   @r   rn   rn   u   s“   ø€ € € € € € ðð ð
 ÐÐÑðð ð ð ð ð ðð ð ð ð ð ð ð  ð  ð  ð  ð  ð  ð  ð  ð  r!   rn   c                  ó:   — e Zd ZU dZded<   ded<   ded<   dd	„Zd
S )ÚStreamMixerz‚Mixes `<stdout>` and `<stderr>` streams.

    The result is available in the ``output`` attribute.

    .. versionadded:: 8.2
    ro   r   rn   ÚstdoutÚstderrr   r   c                óž   — t          j        ¦   «         | _        t          | j        ¬¦  «        | _        t          | j        ¬¦  «        | _        d S )N)rp   )ÚioÚBytesIOr   rn   r}   r~   rA   s    r   r    zStreamMixer.__init__–   s;   € Ý”j‘l”lˆŒÝ!¨$¬+Ð6Ñ6Ô6ˆŒÝ!¨$¬+Ð6Ñ6Ô6ˆŒˆˆr!   Nrk   )rL   rM   rN   rl   rO   r    r;   r!   r   r|   r|   Š   sZ   € € € € € € ðð ð ÐÐÑØÐÐÑØÐÐÑð7ð 7ð 7ð 7ð 7ð 7r!   r|   c                  óˆ   ‡ — e Zd ZU dZded<   ded<   ded<   dˆ fd„Zdd„Zdˆ fd„Zedd„¦   «         Z	edd„¦   «         Z
ˆ xZS )Ú_NamedTextIOWrappera  A :class:`~io.TextIOWrapper` with custom ``name`` and ``mode``
    that does not close its underlying buffer.

    When ``CliRunner`` runs in ``fd`` mode, ``_original_fd`` is patched to
    point at the saved (pre-redirection) ``fd``, so C-level consumers that call
    :meth:`fileno` (like ``faulthandler`` or ``subprocess``) keep working. In
    the default ``sys`` mode ``_original_fd`` stays at ``-1`` and
    :meth:`fileno` raises :exc:`io.UnsupportedOperation`, matching the
    pre-``8.3.3`` behavior.
    r#   Ú_nameÚ_moder0   Ú_original_fdÚbufferr   ÚnameÚmodeÚkwargsr$   r   r   c                óf   •—  t          ¦   «         j        |fi |¤Ž || _        || _        d| _        d S r\   )rr   r    r„   r…   r†   )r   r‡   rˆ   r‰   rŠ   rs   s        €r   r    z_NamedTextIOWrapper.__init__¬   s@   ø€ ð 	�‰ŒÔ˜Ð*Ð* 6Ð*Ð*Ð*ØˆŒ
ØˆŒ
ØˆÔÐÐr!   c                ó   — dS )zÃThe buffer this object contains belongs to some other object,
        so prevent the default ``__del__`` implementation from closing
        that buffer.

        .. versionadded:: 8.3.2
        Nr;   rA   s    r   rg   z_NamedTextIOWrapper.close¸   s   € € € r!   c                óh   •— | j         dk    r| j         S t          ¦   «                              ¦   «         S )zÿReturn the file descriptor of the saved original stream when
        ``CliRunner`` runs in ``fd`` mode. Otherwise delegate to
        :class:`~io.TextIOWrapper`, which raises
        :exc:`io.UnsupportedOperation` for a ``BytesIO``-backed buffer.
        r   )r†   rr   rd   rv   s    €r   rd   z_NamedTextIOWrapper.filenoÀ   s0   ø€ ð Ô Ò!Ð!ØÔ$Ð$Ý‰wŒw�~Š~ÑÔÐr!   c                ó   — | j         S r&   )r„   rA   s    r   rˆ   z_NamedTextIOWrapper.nameÊ   ó
   € àŒzÐr!   c                ó   — | j         S r&   )r…   rA   s    r   r‰   z_NamedTextIOWrapper.modeÎ   r�   r!   )
r‡   r   rˆ   r#   r‰   r#   rŠ   r$   r   r   rk   )r   r0   rK   )rL   rM   rN   rl   rO   r    rg   rd   Úpropertyrˆ   r‰   ry   rz   s   @r   rƒ   rƒ   œ   sÛ   ø€ € € € € € ð	ð 	ð €J€J�JØ€J€J�JØÐÐÑð
ð 
ð 
ð 
ð 
ð 
ðð ð ð ð ð  ð  ð  ð  ð  ð ðð ð ñ „Xðð ðð ð ñ „Xðð ð ð ð r!   rƒ   r   ú str | bytes | t.IO[t.Any] | NoneÚcharsetr#   r   c                ó  — t          | d¦  «        r5t          t          j        d| ¦  «        ¦  «        }|�|S t	          d¦  «        ‚| €d} n*t          | t          ¦  «        r|                      |¦  «        } t          j	        | ¦  «        S )Nr2   zt.IO[t.Any]z.Could not find binary reader for input stream.r!   )
Úhasattrr
   ÚtÚcastÚ	TypeErrorÚ
isinstancer#   Úencoder€   r�   )r   r“   r)   s      r   Úmake_input_streamr›   Ó   sˆ   € õ ˆu�fÑÔð JÝ ¥¤¨°uÑ!=Ô!=Ñ>Ô>ˆàˆ>ØˆIåÐHÑIÔIÐIà€}ØˆˆÝ	�E�3Ñ	Ô	ð &Ø—’˜WÑ%Ô%ˆåŒ:�eÑÔÐr!   c                  óÀ   — e Zd ZU dZded<   ded<   ded<   ded<   ded	<   d
ed<   ded<   ded<   	 ddd„Zedd„¦   «         Zedd„¦   «         Zedd„¦   «         Z	dd„Z
dS )ÚResultaC  Holds the captured result of an invoked CLI script.

    :param runner: The runner that created the result
    :param stdout_bytes: The standard output as bytes.
    :param stderr_bytes: The standard error as bytes.
    :param output_bytes: A mix of ``stdout_bytes`` and ``stderr_bytes``, as the
        user would see  it in its terminal.
    :param return_value: The value returned from the invoked command.
    :param exit_code: The exit code as integer.
    :param exception: The exception that happened if one did.
    :param exc_info: Exception information (exception type, exception instance,
        traceback type).

    .. versionchanged:: 8.2
        ``stderr_bytes`` no longer optional, ``output_bytes`` introduced and
        ``mix_stderr`` has been removed.

    .. versionadded:: 8.0
        Added ``return_value``.
    Ú	CliRunnerÚrunnerr*   Ústdout_bytesÚstderr_bytesÚoutput_bytesr$   Úreturn_valuer0   Ú	exit_codeúBaseException | NoneÚ	exceptionúExceptionInfo | NoneÚexc_infoNr   r   c	                óv   — || _         || _        || _        || _        || _        || _        || _        || _        d S r&   ©rŸ   r    r¡   r¢   r£   r¤   r¦   r¨   )	r   rŸ   r    r¡   r¢   r£   r¤   r¦   r¨   s	            r   r    zResult.__init__  sD   € ð ˆŒØ(ˆÔØ(ˆÔØ(ˆÔØ(ˆÔØ"ˆŒØ"ˆŒØ ˆŒˆˆr!   r#   c                ót   — | j                              | j        j        d¦  «                             dd¦  «        S )a  The terminal output as unicode string, as the user would see it.

        .. versionchanged:: 8.2
            No longer a proxy for ``self.stdout``. Now has its own independent stream
            that is mixing `<stdout>` and `<stderr>`, in the order they were written.
        Úreplaceú
ú
)r¢   ÚdecoderŸ   r“   r¬   rA   s    r   r   zResult.output  s9   € ð Ô ×'Ò'¨¬Ô(;¸YÑGÔG×OÒOØ�Dñ
ô 
ð 	
r!   c                ót   — | j                              | j        j        d¦  «                             dd¦  «        S )z&The standard output as unicode string.r¬   r­   r®   )r    r¯   rŸ   r“   r¬   rA   s    r   r}   zResult.stdout&  s9   € ð Ô ×'Ò'¨¬Ô(;¸YÑGÔG×OÒOØ�Dñ
ô 
ð 	
r!   c                ót   — | j                              | j        j        d¦  «                             dd¦  «        S )zŸThe standard error as unicode string.

        .. versionchanged:: 8.2
            No longer raise an exception, always returns the `<stderr>` string.
        r¬   r­   r®   )r¡   r¯   rŸ   r“   r¬   rA   s    r   r~   zResult.stderr-  s9   € ð Ô ×'Ò'¨¬Ô(;¸YÑGÔG×OÒOØ�Dñ
ô 
ð 	
r!   c                ór   — | j         rt          | j         ¦  «        nd}dt          | ¦  «        j        › d|› d�S )NÚokayú<ú ú>)r¦   rI   ÚtyperL   )r   Úexc_strs     r   rJ   zResult.__repr__8  s?   € Ø*.¬.ÐD•$�t”~Ñ&Ô&Ð&¸fˆØ3•4˜‘:”:Ô&Ð3Ð3¨Ð3Ð3Ð3Ð3r!   r&   )rŸ   rž   r    r*   r¡   r*   r¢   r*   r£   r$   r¤   r0   r¦   r¥   r¨   r§   r   r   rK   )rL   rM   rN   rl   rO   r    r‘   r   r}   r~   rJ   r;   r!   r   r�   r�   ç   s  € € € € € € ðð ð* ÐÐÑØÐÐÑØÐÐÑØÐÐÑØÐÐÑØ€N€N�NØ#Ð#Ð#Ñ#Ø"Ð"Ð"Ñ"ð *.ð!ð !ð !ð !ð !ð( ð	
ð 	
ð 	
ñ „Xð	
ð ð
ð 
ð 
ñ „Xð
ð ð
ð 
ð 
ñ „Xð
ð4ð 4ð 4ð 4ð 4ð 4r!   r�   c                  óÒ   — e Zd ZU dZded<   ded<   ded<   ded<   d	ed
<   	 	 	 	 	 d)d*d„Zd+d„Z	 d,d-d„Zej	        	 	 	 d.d/d„¦   «         Z
	 	 	 	 	 d0d1d$„Zej	        	 d,d2d(„¦   «         ZdS )3rž   a‰  The CLI runner provides functionality to invoke a Click command line
    script for unittesting purposes in a isolated environment.  This only
    works in single-threaded systems without any concurrency as it changes the
    global interpreter state.

    :param charset: the character set for the input and output data.
    :param env: a dictionary with environment variables for overriding.
    :param echo_stdin: if this is set to `True`, then reading from `<stdin>` writes
                       to `<stdout>`.  This is useful for showing examples in
                       some circumstances.  Note that regular prompts
                       will automatically echo the input.
    :param catch_exceptions: Whether to catch any exceptions other than
                             ``SystemExit`` when running :meth:`~CliRunner.invoke`.
    :param capture: Selects the output capture strategy. ``sys`` (default)
        captures Python-level writes only and leaves
        :meth:`sys.stdout.fileno` raising :exc:`io.UnsupportedOperation`, so
        user code that calls :func:`os.dup2` on ``sys.stdout.fileno()`` cannot
        clobber the host runner's stdout. ``fd`` redirects file descriptors
        ``1`` and ``2`` via :func:`os.dup2` to a temporary file, also catching
        output from stale stream references, C extensions, and subprocesses.
        ``fd`` is not supported on Windows.

    .. versionchanged:: 8.4.0
        Added the ``capture`` parameter. The default ``sys`` mode no longer
        exposes the original fd through :meth:`fileno`, reverting the change
        introduced in ``8.3.3`` that broke Pytest's ``fd``-level capture
        teardown. Use ``capture="fd"`` to restore that behavior with proper
        isolation. :issue:`3384`

    .. versionchanged:: 8.2
        Added the ``catch_exceptions`` parameter.

    .. versionchanged:: 8.2
        ``mix_stderr`` parameter has been removed.
    r#   r“   úcabc.Mapping[str, str | None]Úenvr   Ú
echo_stdinÚcatch_exceptionsr   Úcaptureúutf-8NFTr   ú$cabc.Mapping[str, str | None] | Noner   r   c                óÐ   — |dvrt          d|›d�¦  «        ‚|dk    r#t          j        dk    rt          d|›d�¦  «        ‚|| _        |pi | _        || _        || _        || _        d S )N>   r   r   zcapture=z) is not valid. Choose from 'sys' or 'fd'.r   r   z( is not supported on Windows. Use 'sys'.)Ú
ValueErrorr   Úplatformr“   r»   r¼   r½   r¾   )r   r“   r»   r¼   r½   r¾   s         r   r    zCliRunner.__init__h  s”   € ð ˜-Ð'Ð'ÝØO˜7ÐOÐOÐOñô ð ð �dŠ?ˆ?�sœ|¨wÒ6Ð6ÝØN˜7ÐNÐNÐNñô ð ð ˆŒØ�9˜"ˆŒØ$ˆŒØ 0ˆÔØˆŒˆˆr!   Úclir   c                ó   — |j         pdS )zžGiven a command object it will return the default program name
        for it.  The default is the `name` attribute or ``"root"`` if not
        set.
        Úroot)rˆ   )r   rÄ   s     r   Úget_default_prog_namezCliRunner.get_default_prog_name~  s   € ð
 ŒxÐ!˜6Ð!r!   Ú	overridesc                ó\   — t          | j        ¦  «        }|r|                     |¦  «         |S )z8Returns the environment overrides for invoking a script.)Údictr»   Úupdate)r   rÈ   r)   s      r   Úmake_envzCliRunner.make_env…  s0   € õ �$”(‰^Œ^ˆØð 	!Ø�IŠI�iÑ Ô Ð Øˆ	r!   r   r’   Úcolorú9cabc.Generator[tuple[io.BytesIO, io.BytesIO, io.BytesIO]]c              #  ó¢  ‡‡‡K  — t          || j        ¦  «        }d}t          j        }t          j        }t          j        }t          j        }	dt          _        |                      |¦  «        }t          ¦   «         }
| j
        r4t          j        t          j        t          ||
j        ¦  «        ¦  «        x}}t          || j        dd¬¦  «        xt          _        Š| j
        rd‰_        t          |
j        | j        dd¬¦  «        t          _        t          |
j        | j        d	dd
¬¦  «        t          _        t#          |¦  «        d%d&ˆfd„¦   «         }t#          |¦  «        d%d&ˆfd„¦   «         }t#          |¦  «        d'd„¦   «         }|Š	 d(d)ˆfd„}t$          j        }t$          j        }t$          j        }t,          j        }t0          j        }t2          j        j        Š|t$          _        |t$          _        |t$          _        |t,          _        |t0          _        	 	 	 d*d+ˆfd$„}|t2          j        _        i }	 |                     ¦   «         D ]W\  }}t:          j                             |¦  «        ||<   |€	 t:          j        |= Œ8# t@          $ r Y ŒDw xY w|t:          j        |<   ŒX|
j        |
j        |
j!        fV — |                     ¦   «         D ]5\  }}|€	 t:          j        |= Œ# t@          $ r Y Œ"w xY w|t:          j        |<   Œ6|t          _        |t          _        |t          _        |t$          _        |t$          _        |t$          _        |t,          _        |t0          _        |	t          _        ‰t2          j        _        dS # |                     ¦   «         D ]5\  }}|€	 t:          j        |= Œ# t@          $ r Y Œ"w xY w|t:          j        |<   Œ6|t          _        |t          _        |t          _        |t$          _        |t$          _        |t$          _        |t,          _        |t0          _        |	t          _        ‰t2          j        _        w xY w),a\  A context manager that sets up the isolation for invoking of a
        command line tool.  This sets up `<stdin>` with the given input data
        and `os.environ` with the overrides from the given dictionary.
        This also rebinds some internals in Click to be mocked (like the
        prompt functionality).

        This is automatically done in the :meth:`invoke` method.

        :param input: the input stream to put into `sys.stdin`.
        :param env: the environment overrides as dictionary.
        :param color: whether the output should contain color codes. The
                      application can still override this explicitly.

        .. versionadded:: 8.2
            An additional output stream is returned, which is a mix of
            `<stdout>` and `<stderr>` streams.

        .. versionchanged:: 8.2
            Always returns the `<stderr>` stream.

        .. versionchanged:: 8.0
            `<stderr>` is opened with ``errors="backslashreplace"``
            instead of the default ``"strict"``.

        .. versionchanged:: 4.0
            Added the ``color`` parameter.
        NéP   z<stdin>Úr)Úencodingrˆ   r‰   r   z<stdout>Úwz<stderr>Úbackslashreplace)rÒ   rˆ   r‰   ÚerrorsÚpromptú
str | Noner   r#   c                óT  •— t           j                             | pd¦  «         	 t          ‰¦  «                             d¦  «        }n!# t
          $ r}t          ¦   «         |‚d }~ww xY wt           j                             |› d�¦  «         t           j                             ¦   «          |S )NÚ r­   r®   )r   r}   r,   ÚnextÚrstripÚStopIterationÚEOFErrorru   )rÖ   ÚvalÚeÚ
text_inputs      €r   Úvisible_inputz*CliRunner.isolation.<locals>.visible_inputÚ  sŸ   ø€ åŒJ×Ò˜V˜\ rÑ*Ô*Ð*ð(Ý˜:Ñ&Ô&×-Ò-¨fÑ5Ô5��øÝ ð (ð (ð (Ý‘j”j aÐ'øøøøð(øøøåŒJ×Ò ˜Z˜Z˜ZÑ(Ô(Ð(ÝŒJ×ÒÑÔÐØˆJs   ¤"A Á
A%ÁA Á A%c                ó  •— t           j                             | pd› d�¦  «         t           j                             ¦   «          	 t	          ‰¦  «                             d¦  «        S # t          $ r}t          ¦   «         |‚d }~ww xY w)NrÙ   r®   r­   )r   r}   r,   ru   rÚ   rÛ   rÜ   rÝ   )rÖ   rß   rà   s     €r   Úhidden_inputz)CliRunner.isolation.<locals>.hidden_inputå  s†   ø€ åŒJ×Ò  ¨"Ð0Ð0Ð0Ñ1Ô1Ð1ÝŒJ×ÒÑÔÐð(Ý˜JÑ'Ô'×.Ò.¨vÑ6Ô6Ð6øÝ ð (ð (ð (Ý‘j”j aÐ'øøøøð(øøøs   Á!A' Á'
BÁ1B Â BÚechor   c                óÂ   — t           j                             d¦  «        }| rt           j                             |¦  «         t           j                             ¦   «          |S )Nr   )r   Ústdinr2   r}   r,   ru   )rä   Úchars     r   Ú_getcharz%CliRunner.isolation.<locals>._getcharî  sL   € å”9—>’> !Ñ$Ô$ˆDàð 'Ý”
× Ò  Ñ&Ô&Ð&åŒJ×ÒÑÔÐØˆKr!   rP   út.IO[t.Any] | NonerÍ   úbool | Nonec                ó   •— |€‰ S | S r&   r;   )rP   rÍ   Údefault_colors     €r   Úshould_strip_ansiz.CliRunner.isolation.<locals>.should_strip_ansiú  s   ø€ ð ˆ}Ø(Ð(Ð(Ø�9Ðr!   Útabr   úpdb.PdbÚcompletekeyræ   út.IO[str] | Noner}   rŠ   r$   r   c                óZ   •— |€t           j        }|€t           j        } ‰| f|||dœ|¤Ž dS )ab  Default ``pdb.Pdb`` to real terminal streams during
            ``CliRunner`` isolation.

            Without this patch, ``pdb.Pdb.__init__`` inherits from
            ``cmd.Cmd`` which falls back to ``sys.stdin``/``sys.stdout``
            when no explicit streams are provided. During isolation
            those are ``BytesIO``-backed wrappers, so the debugger
            reads from an empty buffer and writes to captured output,
            making interactive debugging impossible.

            By defaulting to ``sys.__stdin__``/``sys.__stdout__`` (the
            original terminal streams Python preserves regardless of
            redirection), debuggers can interact with the user while
            ``click.echo`` output is still captured normally.

            This covers ``pdb.set_trace()``, ``breakpoint()``,
            ``pdb.post_mortem()``, and debuggers that subclass
            ``pdb.Pdb`` (ipdb, pdbpp). Explicit ``stdin``/``stdout``
            arguments are honored and not overridden. Debuggers that
            do not subclass ``pdb.Pdb`` (pudb, debugpy) are not
            covered.
            N)rð   ræ   r}   )r   Ú	__stdin__Ú
__stdout__)r   rð   ræ   r}   rŠ   Úold_pdb_inits        €r   Ú_patched_pdb_initz.CliRunner.isolation.<locals>._patched_pdb_init  sW   ø€ ð: ˆ}Ýœ�Øˆ~Ýœ�ØˆLØðØ"-°UÀ6ðð ØMSðð ð ð ð r!   r&   )rÖ   r×   r   r#   )rä   r   r   r#   )NN)rP   ré   rÍ   rê   r   r   )rî   NN)r   rï   rð   r#   ræ   rñ   r}   rñ   rŠ   r$   r   r   )"r›   r“   r   ræ   r}   r~   r   ÚFORCED_WIDTHrÌ   r|   r¼   r–   r—   ÚBinaryIOr   rƒ   Ú_CHUNK_SIZErT   r   Úvisible_prompt_funcÚhidden_prompt_funcrè   r	   rí   r   ÚpdbÚPdbr    Úitemsr_   ÚenvironÚgetÚ	Exceptionr   )r   r   r»   rÍ   Úbytes_inputÚ
echo_inputÚ	old_stdinÚ
old_stdoutÚ
old_stderrÚold_forced_widthÚstream_mixerrá   rã   rè   rí   Úold_visible_prompt_funcÚold_hidden_prompt_funcÚold__getchar_funcÚold_should_strip_ansiÚold__compat_should_strip_ansirö   Úold_envÚkeyÚvaluerì   rõ   rà   s                           @@@r   Ú	isolationzCliRunner.isolationŽ  sš  øøøè è € õD (¨¨t¬|Ñ<Ô<ˆØˆ
å”Iˆ	Ý”Zˆ
Ý”Zˆ
Ý%Ô2ÐØ"$�
Ôà�mŠm˜CÑ Ô ˆå"‘}”}ˆàŒ?ð 	Ý'(¤vÝ”
�L¨°lÔ6IÑJÔJñ(ô (ð ˆK˜*õ "5Ø $¤,°YÀSð"
ñ "
ô "
ð 	
�Œ	�Jð Œ?ð 	'ð &'ˆJÔ"å(ØÔØ”\ØØð	
ñ 
ô 
�Œ
õ )ØÔØ”\ØØØ%ð
ñ 
ô 
�Œ
õ 
�ZÑ	 Ô	 ð	ð 	ð 	ð 	ð 	ð 	ñ 
!Ô	 ð	õ 
�ZÑ	 Ô	 ð	(ð 	(ð 	(ð 	(ð 	(ð 	(ñ 
!Ô	 ð	(õ 
�ZÑ	 Ô	 ð	ð 	ð 	ñ 
!Ô	 ð	ð ˆð EIð	ð 	ð 	ð 	ð 	ð 	ð 	õ #)Ô"<ÐÝ!'Ô!:ÐÝ"œOÐÝ %Ô 7ÐÝ(/Ô(AÐ%Ý”wÔ'ˆØ%2�Ô"Ø$0�Ô!Ø"�ŒØ"3�ÔØ$5�Ô!ð  %Ø&*Ø'+ð	#	ð #	ð #	ð #	ð #	ð #	ð #	ðJ -�ŒÔàˆð	,Ø!Ÿiši™kœkð ,ð ,‘
��UÝ!œzŸ~š~¨cÑ2Ô2�˜‘Ø�=ðÝœJ s˜O˜OøÝ$ð ð ð Ø˜ðøøøð ',•B”J˜s‘O�OØÔ&¨Ô(;¸\Ô=PÐQÐQÐQÐQà%Ÿmšm™oœoð ,ð ,‘
��UØ�=ðÝœJ s˜O˜OøÝ$ð ð ð Ø˜ðøøøð ',•B”J˜s‘O�OØ#�CŒJØ#�CŒJØ!�CŒIØ)@�FÔ&Ø(>�FÔ%Ø/�FŒOØ&;�EÔ#Ø(E�GÔ%Ø&6�JÔ#Ø+�CŒGÔÐÐøð# &Ÿmšm™oœoð ,ð ,‘
��UØ�=ðÝœJ s˜O˜OøÝ$ð ð ð Ø˜ðøøøð ',•B”J˜s‘O�OØ#�CŒJØ#�CŒJØ!�CŒIØ)@�FÔ&Ø(>�FÔ%Ø/�FŒOØ&;�EÔ#Ø(E�GÔ%Ø&6�JÔ#Ø+�CŒGÔÐ+Ð+Ð+Ð+sg   È:=N É8JÊN Ê
JÊN ÊJÊ)N ËK&Ë&
K3Ë2K3ÎQÎ"N0Î/QÎ0
N=	Î:QÎ<N=	Î=BQÚargsústr | cabc.Sequence[str] | Nonerê   Úextrar$   r�   c           
     óh  — d}|€| j         }d}	d}
| j        dk    r\t          d¦  «        }	t          d¦  «        }
	 |	                     ¦   «          |
                     ¦   «          n# t          $ r dx}	}
Y nw xY w|                      |||¬¦  «        5 }|	�.|
�,|	j        t          j        _	        |
j        t          j
        _	        d}d}d}t          |t          ¦  «        rt          j        |¦  «        }	 |                     d¦  «        }n%# t           $ r |                      |¦  «        }Y nw xY w	  |j        d|pd|d	œ|¤Ž}nà# t&          $ r§}t          j        ¦   «         }t+          j        d
|j        ¦  «        }|€d}|dk    r|}t          |t0          ¦  «        sMt          j                             t          |¦  «        ¦  «         t          j                             d¦  «         d}|}Y d}~n4d}~wt4          $ r$}|s‚ |}d}t          j        ¦   «         }Y d}~nd}~ww xY wt          j                             ¦   «          t          j
                             ¦   «          |	�d|
�b|	                     ¦   «         }|
                     ¦   «         }|r|d                              |¦  «         |r|d                              |¦  «         |d                              ¦   «         }|d                              ¦   «         }|d                              ¦   «         }nõ# t          j                             ¦   «          t          j
                             ¦   «          |	�d|
�b|	                     ¦   «         }|
                     ¦   «         }|r|d                              |¦  «         |r|d                              |¦  «         |d                              ¦   «         }|d                              ¦   «         }|d                              ¦   «         }w xY w	 ddd¦  «         n# 1 swxY w Y   t=          | |||||||¬¦  «        S )a{  Invokes a command in an isolated environment.  The arguments are
        forwarded directly to the command line script, the `extra` keyword
        arguments are passed to the :meth:`~clickpkg.Command.main` function of
        the command.

        This returns a :class:`Result` object.

        :param cli: the command to invoke
        :param args: the arguments to invoke. It may be given as an iterable
                     or a string. When given as string it will be interpreted
                     as a Unix shell command. More details at
                     :func:`shlex.split`.
        :param input: the input data for `sys.stdin`.
        :param env: the environment overrides.
        :param catch_exceptions: Whether to catch any other exceptions than
                                 ``SystemExit``. If :data:`None`, the value
                                 from :class:`CliRunner` is used.
        :param extra: the keyword arguments to pass to :meth:`main`.
        :param color: whether the output should contain color codes. The
                      application can still override this explicitly.

        .. versionadded:: 8.2
            The result object has the ``output_bytes`` attribute with
            the mix of ``stdout_bytes`` and ``stderr_bytes``, as the user would
            see it in its terminal.

        .. versionchanged:: 8.2
            The result object always returns the ``stderr_bytes`` stream.

        .. versionchanged:: 8.0
            The result object has the ``return_value`` attribute with
            the value returned from the invoked command.

        .. versionchanged:: 4.0
            Added the ``color`` parameter.

        .. versionchanged:: 3.0
            Added the ``catch_exceptions`` parameter.

        .. versionchanged:: 3.0
            The result object has the ``exc_info`` attribute with the
            traceback if available.
        Nr   r   é   )r   r»   rÍ   r   Ú	prog_namer;   )r  r  zint | t.Any | Noner®   rª   )r½   r¾   rV   re   ÚOSErrorr  rX   r   r}   r†   r~   r™   r#   ÚshlexÚsplitÚpopÚKeyErrorrÇ   ÚmainÚ
SystemExitr¨   r–   r—   Úcoder0   r,   r  ru   rj   Úgetvaluer�   )r   rÄ   r  r   r»   r½   rÍ   r  r¨   Úcap_outÚcap_errÚ
outstreamsr£   r¦   r¤   r  rß   Úe_codeÚfd_outÚfd_errr}   r~   r   s                          r   ÚinvokezCliRunner.invokeT  s›  € ðj ˆØÐ#Ø#Ô4Ðð &*ˆØ%)ˆàŒ<˜4ÒÐÝ  ‘m”mˆGÝ  ‘m”mˆGð)Ø—’‘”�Ø—’‘”��øÝð )ð )ð )Ø$(Ð(�˜'˜'˜'ð)øøøð �^Š^ %¨S¸ˆ^Ñ>Ô>ð >	2À*ð Ð" wÐ':Ø*1Ô*:•”
Ô'Ø*1Ô*:•”
Ô'àˆLØ.2ˆIØˆIå˜$¥Ñ$Ô$ð )Ý”{ 4Ñ(Ô(�ð<Ø!ŸIšI kÑ2Ô2�	�	øÝð <ð <ð <Ø ×6Ò6°sÑ;Ô;�	�	�	ð<øøøð*2Ø'˜sœxÐV¨T¨Z°RÀ9ÐVÐVÐPUÐVÐV��øÝð #ð #ð #Ýœ<™>œ>�ÝœÐ 4°a´fÑ=Ô=�à�>Ø�Fà˜Q’;�;Ø !�Iå! &­#Ñ.Ô.ð Ý”J×$Ò$¥S¨¡[¤[Ñ1Ô1Ð1Ý”J×$Ò$ TÑ*Ô*Ð*Ø�Fà"�	�	�	�	�	�	øøøøåð *ð *ð *Ø'ð ØØ�	Ø�	Ýœ<™>œ>������øøøøð*øøøõ ”
× Ò Ñ"Ô"Ð"Ý”
× Ò Ñ"Ô"Ð"ð
 Ð&¨7Ð+>Ø$Ÿ\š\™^œ^�FØ$Ÿ\š\™^œ^�FØð 4Ø" 1œ×+Ò+¨FÑ3Ô3Ð3Øð 4Ø" 1œ×+Ò+¨FÑ3Ô3Ð3à# Aœ×/Ò/Ñ1Ô1�Ø# Aœ×/Ò/Ñ1Ô1�Ø# Aœ×/Ò/Ñ1Ô1��øõ! ”
× Ò Ñ"Ô"Ð"Ý”
× Ò Ñ"Ô"Ð"ð
 Ð&¨7Ð+>Ø$Ÿ\š\™^œ^�FØ$Ÿ\š\™^œ^�FØð 4Ø" 1œ×+Ò+¨FÑ3Ô3Ð3Øð 4Ø" 1œ×+Ò+¨FÑ3Ô3Ð3à# Aœ×/Ò/Ñ1Ô1�Ø# Aœ×/Ò/Ñ1Ô1�Ø# Aœ×/Ò/Ñ1Ô1�Ð1Ð1Ð1Ð1�ð}>	2ð >	2ð >	2ñ >	2ô >	2ð >	2ð >	2ð >	2ð >	2ð >	2ð >	2øøøð >	2ð >	2ð >	2ð >	2õ@ ØØØØØ%ØØØð	
ñ 	
ô 	
ð 		
s™   º(A# Á#A4Á3A4ÂA PÃ0DÄPÄD(Ä%PÄ'D(Ä(PÄ,D?Ä>LÄ?
HÅ	BG+Ç&LÇ+HÇ8HÈLÈHÈLÈC1PÌC2PÐPÐPÐPÚtemp_dirústr | os.PathLike[str] | Noneúcabc.Generator[str]c              #  óž  K  — t          j        ¦   «         }t          j        |¬¦  «        }t          j        |¦  «         	 |V — t          j        |¦  «         |€-ddl}	 |                     |¦  «         dS # t          $ r Y dS w xY wdS # t          j        |¦  «         |€+ddl}	 |                     |¦  «         w # t          $ r Y w w xY ww xY w)aã  A context manager that creates a temporary directory and
        changes the current working directory to it. This isolates tests
        that affect the contents of the CWD to prevent them from
        interfering with each other.

        :param temp_dir: Create the temporary directory under this
            directory. If given, the created directory is not removed
            when exiting.

        .. versionchanged:: 8.0
            Added the ``temp_dir`` parameter.
        )ÚdirNr   )r_   Úgetcwdra   ÚmkdtempÚchdirÚshutilÚrmtreer  )r   r(  ÚcwdÚdtr0  s        r   Úisolated_filesystemzCliRunner.isolated_filesystemå  s  è è € õ  Œi‰kŒkˆÝÔ (Ð+Ñ+Ô+ˆÝ
Œ�‰Œˆð	ØˆHˆHˆHåŒH�S‰MŒMˆMàÐØ���ðØ—M’M "Ñ%Ô%Ð%Ð%Ð%øÝð ð ð Ø�D�Dðøøøð  Ðøõ ŒH�S‰MŒMˆMàÐØ���ðØ—M’M "Ñ%Ô%Ð%Ð%øÝð ð ð Ø�Dðøøøð  øøøsB   Á B	 ÁA6 Á6
BÂBÂ	CÂ%B;Â:CÂ;
CÃCÃCÃC)r¿   NFTr   )r“   r#   r»   rÀ   r¼   r   r½   r   r¾   r   r   r   )rÄ   r   r   r#   r&   )rÈ   rÀ   r   rº   )NNF)r   r’   r»   rÀ   rÍ   r   r   rÎ   )NNNNF)rÄ   r   r  r  r   r’   r»   rÀ   r½   rê   rÍ   r   r  r$   r   r�   )r(  r)  r   r*  )rL   rM   rN   rl   rO   r    rÇ   rÌ   Ú
contextlibÚcontextmanagerr  r'  r4  r;   r!   r   rž   rž   =  sP  € € € € € € ð"ð "ðH €L€L�LØ&Ð&Ð&Ñ&ØÐÐÑØÐÐÑØÐÐÑð Ø48Ø Ø!%Ø$ðð ð ð ð ð,"ð "ð "ð "ð AEðð ð ð ð ð Ôð 37Ø48Øð	C,ð C,ð C,ð C,ñ ÔðC,ðP 15Ø26Ø48Ø(,ØðO
ð O
ð O
ð O
ð O
ðb Ôà8<ðð ð ð ñ Ôðð ð r!   rž   )rP   rQ   r   rR   )r   r’   r“   r#   r   r   )/Ú
__future__r   Úcollections.abcÚabcÚcabcr5  r€   r_   rü   r  r   ra   Útypingr–   Útypesr   rÙ   r   r   r   r	   r
   ÚTYPE_CHECKINGÚ	_typeshedr   Úcorer   rÃ   ÚLiteralr   rO   Útupler·   ÚBaseExceptionr   r   r6  rT   rV   r�   rn   r|   ÚTextIOWrapperrƒ   r›   r�   rž   r;   r!   r   ú<module>rD     sï  ðØ "Ð "Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ø 	€	€	€	Ø 	€	€	€	Ø 
€
€
€
Ø €€€Ø 
€
€
€
Ø €€€Ø Ð Ð Ð Ø Ð Ð Ð Ð Ð à Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø (Ð (Ð (Ð (Ð (Ð (à„?ð Ø(Ð(Ð(Ð(Ð(Ð(àÐÐÐÐÐà„<�7ÒÐØ œy¨Ô/€KÐ/Ð/Ð/Ñ/Ð/à œy¨Ô5€KÐ5Ð5Ð5Ñ5Ø" 4¨Ô#6¸À}Ð#TÔU€Ð UÐ UÐ UÑ Uð#!ð #!ð #!ð #!ð #!ñ #!ô #!ð #!ðL Ôðð ð ñ Ôðð"ð "ð "ð "ð "ñ "ô "ð "ðJ ð  ð  ð  ð  �"”*ñ  ô  ð  ð*7ð 7ð 7ð 7ð 7ñ 7ô 7ð 7ð$4ð 4ð 4ð 4ð 4˜"Ô*ñ 4ô 4ð 4ðnð ð ð ð(S4ð S4ð S4ð S4ð S4ñ S4ô S4ð S4ðlGð Gð Gð Gð Gñ Gô Gð Gð Gð Gr!   