Ë
    7¾ªjÀk  ã                  óX  — 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
j6                  dk(  rej8                  d   Zded<   nej8                  d   Zded<   ee e!   e!ef   Z"ded<    G d„ d«      Z#ejH                  d"d„«       Z% G d„ d«      Z& G d„ dejN                  «      Z( G d„ d«      Z) G d„ dejT                  «      Z+	 	 	 	 	 	 d#d„Z, G d„ d«      Z- G d „ d!«      Z.y)$é    )ÚannotationsN)ÚTracebackTypeé   )Ú_compat)Ú
formatting)Útermui)Úutils)Ú_find_binary_reader)ÚReadableBuffer)ÚCommandÚwin32Úsyszt.TypeAliasÚCaptureMode)r   ÚfdÚExceptionInfoc                  óz   — 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y)ÚEchoingStdinú
t.BinaryIOÚ_inputÚ_outputÚboolÚ_pausedc                ó.   — || _         || _        d| _        y )NF)r   r   r   )ÚselfÚinputÚoutputs      úL/var/www/html/serviGia/entorno/lib/python3.12/site-packages/click/testing.pyÚ__init__zEchoingStdin.__init__%   s   € ØˆŒØˆŒØˆ�ó    c                ó.   — t        | j                  |«      S ©N)Úgetattrr   ©r   Úxs     r   Ú__getattr__zEchoingStdin.__getattr__*   s   € Ü�t—{‘{ AÓ&Ð&r   c                óT   — | j                   s| j                  j                  |«       |S r!   )r   r   Úwrite)r   Úrvs     r   Ú_echozEchoingStdin._echo-   s    € Ø�|Š|Ø�L‰L×Ñ˜rÔ"àˆ	r   c                óV   — | j                  | j                  j                  |«      «      S r!   )r)   r   Úread©r   Úns     r   r+   zEchoingStdin.read3   s    € Ø�z‰z˜$Ÿ+™+×*Ñ*¨1Ó-Ó.Ð.r   c                óV   — | j                  | j                  j                  |«      «      S r!   )r)   r   Úread1r,   s     r   r/   zEchoingStdin.read16   s    € Ø�z‰z˜$Ÿ+™+×+Ñ+¨AÓ.Ó/Ð/r   c                óV   — | j                  | j                  j                  |«      «      S r!   )r)   r   Úreadliner,   s     r   r1   zEchoingStdin.readline9   s    € Ø�z‰z˜$Ÿ+™+×.Ñ.¨qÓ1Ó2Ð2r   c                óz   — | j                   j                  «       D �cg c]  }| j                  |«      ‘Œ c}S c c}w r!   )r   Ú	readlinesr)   r#   s     r   r3   zEchoingStdin.readlines<   s+   € Ø'+§{¡{×'<Ñ'<Ó'>Ö? !�—
‘
˜1•Ò?Ð?ùÒ?s   �8c                ó@   ‡ — t        ˆ fd„‰ j                  D «       «      S )Nc              3  ó@   •K  — | ]  }‰j                  |«      –— Œ y ­wr!   )r)   )Ú.0r$   r   s     €r   ú	<genexpr>z(EchoingStdin.__iter__.<locals>.<genexpr>@   s   øè ø€ Ò7 a�D—J‘J˜q—MÑ7ùs   ƒ)Úiterr   ©r   s   `r   Ú__iter__zEchoingStdin.__iter__?   s   ø€ ÜÓ7¨4¯;©;Ô7Ó7Ð7r   c                ó,   — t        | j                  «      S r!   )Úreprr   r9   s    r   Ú__repr__zEchoingStdin.__repr__B   s   € Ü�D—K‘KÓ Ð r   N)r   r   r   r   ÚreturnÚNone)r$   Ústrr>   út.Any)r(   Úbytesr>   rB   )éÿÿÿÿ)r-   Úintr>   rB   )r>   zlist[bytes])r>   zcabc.Iterator[bytes]©r>   r@   )Ú__name__Ú
__module__Ú__qualname__Ú__annotations__r   r%   r)   r+   r/   r1   r3   r:   r=   © r   r   r   r       sA   … ØÓØÓØƒMóó
'óô/ô0ô3ó@ó8ô!r   r   c              #  ó>   K  — | €d –— y d| _         d –— d| _         y ­w)NTF)r   )Ústreams    r   Ú_pause_echorM   F   s   è ø€ à€~ÜàˆŒÛØˆ�ùs   ‚c                  óH   — 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y
)Ú
_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
    rD   Ú	_targetfdÚsaved_fdzt.BinaryIO | NoneÚ_tmpfilec                ó.   — || _         d| _        d | _        y ©NrC   )rP   rQ   rR   )r   Útargetfds     r   r   z_FDCapture.__init___   s   € Ø!ˆŒØˆŒØˆ�r   c                óò   — t        j                  | j                  «      | _        t	        j
                  d¬«      | _        t        j                  | j                  j                  «       | j                  «       y )Nr   )Ú	buffering)	ÚosÚduprP   rQ   ÚtempfileÚTemporaryFilerR   Údup2Úfilenor9   s    r   Ústartz_FDCapture.startd   sG   € ÜŸ™˜tŸ~™~Ó.ˆŒÜ ×.Ñ.¸Ô;ˆŒÜ
�‰�—‘×$Ñ$Ó&¨¯©Õ7r   c                óx  — | j                   €J d«       ‚t        j                  | j                  | j                  «       t        j
                  | j                  «       d| _        | j                   j                  d«       | j                   j                  «       }| j                   j                  «        d | _         |S )Nz!_FDCapture.start() was not calledrC   r   )rR   rX   r\   rQ   rP   ÚcloseÚseekr+   )r   Údatas     r   Ústopz_FDCapture.stopi   s…   € Ø�}‰}Ð(ÐMÐ*MÓMÐ(Ü
�‰�—‘˜tŸ~™~Ô.Ü
�‰�—‘ÔØˆŒØ�‰×Ñ˜1ÔØ�}‰}×!Ñ!Ó#ˆØ�‰×ÑÔØˆŒØˆr   N)rU   rD   r>   r?   ©r>   r?   )r>   rB   )rF   rG   rH   Ú__doc__rI   r   r^   rc   rJ   r   r   rO   rO   P   s(   … ñð ƒNØƒMØÓóó
8ô
	r   rO   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_toc                ó0   •— t         ‰| �  «        || _        y r!   )Úsuperr   ri   )r   ri   Ú	__class__s     €r   r   zBytesIOCopy.__init__}   s   ø€ Ü‰ÑÔØˆ�r   c                óV   •— t         ‰| �  «        | j                  j                  «        y r!   )rk   Úflushri   ©r   rl   s    €r   rn   zBytesIOCopy.flush�   s   ø€ Ü‰‰ŒØ�‰×ÑÕr   c                óX   •— | j                   j                  |«       t        ‰| �  |«      S r!   )ri   r'   rk   )r   Úbrl   s     €r   r'   zBytesIOCopy.write…   s$   ø€ Ø�‰×Ñ˜1ÔÜ‰w‰}˜QÓÐr   )ri   rh   r>   r?   rd   )rq   r   r>   rD   )	rF   rG   rH   re   rI   r   rn   r'   Ú__classcell__©rl   s   @r   rg   rg   u   s$   ø… ñð
 Óõõ÷ ñ  r   rg   c                  ó8   — e Zd ZU dZded<   ded<   ded<   d	d„Zy)
ÚStreamMixerz‚Mixes `<stdout>` and `<stderr>` streams.

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

    .. versionadded:: 8.2
    rh   r   rg   ÚstdoutÚstderrc                ó¢   — t        j                  «       | _        t        | j                  ¬«      | _        t        | j                  ¬«      | _        y )N)ri   )ÚioÚBytesIOr   rg   rv   rw   r9   s    r   r   zStreamMixer.__init__–   s/   € Ü—j‘j“lˆŒÜ!¨$¯+©+Ô6ˆŒÜ!¨$¯+©+Ô6ˆ�r   Nrd   )rF   rG   rH   re   rI   r   rJ   r   r   ru   ru   Š   s    … ñð ÓØÓØÓô7r   ru   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Ú_moderD   Ú_original_fdc                óP   •— t        ‰| �  |fi |¤Ž || _        || _        d| _        y rT   )rk   r   r}   r~   r   )r   ÚbufferÚnameÚmodeÚkwargsrl   s        €r   r   z_NamedTextIOWrapper.__init__¬   s-   ø€ ô 	‰Ñ˜Ñ* 6Ò*ØˆŒ
ØˆŒ
ØˆÕr   c                 ó   — y)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
        NrJ   r9   s    r   r`   z_NamedTextIOWrapper.close¸   s   � r   c                óV   •— | 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   rk   r]   ro   s    €r   r]   z_NamedTextIOWrapper.filenoÀ   s,   ø€ ð ×Ñ Ò!Ø×$Ñ$Ð$Ü‰w‰~ÓÐr   c                ó   — | j                   S r!   )r}   r9   s    r   r‚   z_NamedTextIOWrapper.nameÊ   ó   € à�z‰zÐr   c                ó   — | j                   S r!   )r~   r9   s    r   rƒ   z_NamedTextIOWrapper.modeÎ   rˆ   r   )
r�   r   r‚   r@   rƒ   r@   r„   rA   r>   r?   rd   )r>   rD   rE   )rF   rG   rH   re   rI   r   r`   r]   Úpropertyr‚   rƒ   rr   rs   s   @r   r|   r|   œ   s�   ø… ñ	ð ƒJØƒJØÓð
àð
ð ð
ð ð	
ð
 ð
ð 
õ
óõ ð òó ðð òó ôr   r|   c                óì   — t        | d«      r.t        t        j                  d| «      «      }|�|S t	        d«      ‚| €d} n!t        | t        «      r| j                  |«      } t        j                  | «      S )Nr+   zt.IO[t.Any]z.Could not find binary reader for input stream.r   )
Úhasattrr
   ÚtÚcastÚ	TypeErrorÚ
isinstancer@   Úencodery   rz   )r   Úcharsetr(   s      r   Úmake_input_streamr“   Ó   sj   € ô ˆu�fÔÜ ¤§¡¨°uÓ!=Ó>ˆàˆ>ØˆIäÐHÓ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
y)Ú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ÚrunnerrB   Ústdout_bytesÚstderr_bytesÚoutput_bytesrA   Úreturn_valuerD   Ú	exit_codeúBaseException | NoneÚ	exceptionúExceptionInfo | NoneÚexc_infoNc	                ót   — || _         || _        || _        || _        || _        || _        || _        || _        y r!   ©r—   r˜   r™   rš   r›   rœ   rž   r    )	r   r—   r˜   r™   rš   r›   rœ   rž   r    s	            r   r   zResult.__init__  s@   € ð ˆŒØ(ˆÔØ(ˆÔØ(ˆÔØ(ˆÔØ"ˆŒØ"ˆŒØ ˆ�r   c                ó‚   — | j                   j                  | j                  j                  d«      j	                  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¤   r9   s    r   r   zResult.output  s9   € ð × Ñ ×'Ñ'¨¯©×(;Ñ(;¸YÓG×OÑOØ�Dó
ð 	
r   c                ó‚   — | j                   j                  | j                  j                  d«      j	                  dd«      S )z&The standard output as unicode string.r¤   r¥   r¦   )r˜   r§   r—   r’   r¤   r9   s    r   rv   zResult.stdout&  s9   € ð × Ñ ×'Ñ'¨¯©×(;Ñ(;¸YÓG×OÑOØ�Dó
ð 	
r   c                ó‚   — | j                   j                  | j                  j                  d«      j	                  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¤   r9   s    r   rw   zResult.stderr-  s9   € ð × Ñ ×'Ñ'¨¯©×(;Ñ(;¸YÓG×OÑOØ�Dó
ð 	
r   c                ó€   — | j                   rt        | j                   «      nd}dt        | «      j                  › d|› d�S )NÚokayú<ú ú>)rž   r<   ÚtyperF   )r   Úexc_strs     r   r=   zResult.__repr__8  s8   € Ø*.¯.ª.”$�t—~‘~Ô&¸fˆØ”4˜“:×&Ñ&Ð' q¨¨	°Ð3Ð3r   r!   )r—   r–   r˜   rB   r™   rB   rš   rB   r›   rA   rœ   rD   rž   r�   r    rŸ   r>   r?   rE   )rF   rG   rH   re   rI   r   rŠ   r   rv   rw   r=   rJ   r   r   r•   r•   ç   sÛ   … ñð* ÓØÓØÓØÓØÓØƒNØ#Ó#Ø"Ó"ð *.ð!àð!ð ð!ð ð	!ð
 ð!ð ð!ð ð!ð (ð!ð 'ð!ð 
ó!ð( ò	
ó ð	
ð ò
ó ð
ð ò
ó ð
ô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
	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zej                  	 d	 	 	 dd„«       Zy)r–   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   ÚcaptureNc                óÆ   — |dvrt        d|›d�«      ‚|dk(  r"t        j                  dk(  rt        d|›d�«      ‚|| _        |xs i | _        || _        || _        || _        y )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~   € ð ˜-Ñ'ÜØ˜7˜+Ð%NÐOóð ð �dŠ?œsŸ|™|¨wÒ6ÜØ˜7˜+Ð%MÐNóð ð ˆŒØ’9˜"ˆŒØ$ˆŒØ 0ˆÔØˆ�r   c                ó"   — |j                   xs 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   Úclis     r   Úget_default_prog_namezCliRunner.get_default_prog_name~  s   € ð
 �x‰xÒ!˜6Ð!r   c                óV   — t        | j                  «      }|r|j                  |«       |S )z8Returns the environment overrides for invoking a script.)Údictr³   Úupdate)r   Ú	overridesr(   s      r   Úmake_envzCliRunner.make_env…  s%   € ô �$—(‘(‹^ˆÙØ�I‰I�iÔ Øˆ	r   c              #  ó@	  ‡‡‡K  — t        || j                  «      }d}t        j                  }t        j                  }t        j
                  }t        j                  }	dt        _        | j                  |«      }t        «       }
| j                  r:t        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        j4                  j6                  Š|t$        _        |t$        _        |t$        _        |t,        _        |t0        _        	 	 	 d	 	 	 	 	 	 	 	 	 	 	 dˆfd„}|t2        j4                  _        i }	 |j9                  «       D ]O  \  }}t:        j<                  j?                  |«      ||<   |€	 t:        j<                  |= Œ=|t:        j<                  |<   ŒQ |
j                  |
j
                  |
jB                  f–— |j9                  «       D ]-  \  }}|€	 t:        j<                  |= Œ|t:        j<                  |<   Œ/ |t        _        |t        _        |t        _        |t$        _        |t$        _        |t$        _        |t,        _        |t0        _        |	t        _        ‰t2        j4                  _        y# t@        $ r Y �Œ<w xY w# t@        $ r Y ŒÄw xY w# |j9                  «       D ]<  \  }}|€"	 t:        j<                  |= Œ# t@        $ r Y Œ&w xY w|t:        j<                  |<   Œ> |t        _        |t        _        |t        _        |t$        _        |t$        _        |t$        _        |t,        _        |t0        _        |	t        _        ‰t2        j4                  _        w xY w­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ƒ   Úerrorsc                ó<  •— t         j                  j                  | xs d«       	 t        ‰«      j	                  d«      }t         j                  j                  |› d�«       t         j                  j                  «        |S # t
        $ r}t        «       |‚d }~ww xY w)NÚ r¥   r¦   )r   rv   r'   ÚnextÚrstripÚStopIterationÚEOFErrorrn   )ÚpromptÚvalÚeÚ
text_inputs      €r   Úvisible_inputz*CliRunner.isolation.<locals>.visible_inputÚ  s~   ø€ ä�J‰J×Ñ˜Vš\ rÔ*ð(Ü˜:Ó&×-Ñ-¨fÓ5�ô �J‰J×Ñ ˜u B˜ZÔ(Ü�J‰J×ÑÔØˆJøô	 !ò (Ü“j aÐ'ûð(ús   ¦B Â	BÂBÂBc                óú   •— t         j                  j                  | xs d› d�«       t         j                  j                  «        	 t	        ‰«      j                  d«      S # t        $ r}t        «       |‚d }~ww xY w)NrË   r¦   r¥   )r   rv   r'   rn   rÌ   rÍ   rÎ   rÏ   )rÐ   rÒ   rÓ   s     €r   Úhidden_inputz)CliRunner.isolation.<locals>.hidden_inputå  se   ø€ ä�J‰J×Ñ ¢¨"˜~¨RÐ0Ô1Ü�J‰J×ÑÔð(Ü˜JÓ'×.Ñ.¨vÓ6Ð6øÜ ò (Ü“j aÐ'ûð(ús   ÁA! Á!	A:Á*A5Á5A:c                óÂ   — t         j                  j                  d«      }| rt         j                  j	                  |«       t         j                  j                  «        |S )Nr   )r   Ústdinr+   rv   r'   rn   )ÚechoÚchars     r   Ú_getcharz%CliRunner.isolation.<locals>._getcharî  s>   € ä—9‘9—>‘> !Ó$ˆDáÜ—
‘
× Ñ  Ô&ä�J‰J×ÑÔØˆKr   c                ó   •— |€‰ S | S r!   rJ   )rL   ÚcolorÚdefault_colors     €r   Úshould_strip_ansiz.CliRunner.isolation.<locals>.should_strip_ansiú  s   ø€ ð ˆ}Ø(Ð(Ð(Ø�9Ðr   c                óh   •— |€t         j                  }|€t         j                  } ‰| f|||dœ|¤Ž y)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)ÚcompletekeyrØ   rv   )r   Ú	__stdin__Ú
__stdout__)r   rá   rØ   rv   r„   Úold_pdb_inits        €r   Ú_patched_pdb_initz.CliRunner.isolation.<locals>._patched_pdb_init  s@   ø€ ð: ˆ}ÜŸ™�Øˆ~ÜŸ™�ÙØðØ"-°UÀ6ñØMSór   r!   )rÐ   z
str | Noner>   r@   )rÙ   r   r>   r@   )NN)rL   zt.IO[t.Any] | NonerÝ   úbool | Noner>   r   )ÚtabNN)r   zpdb.Pdbrá   r@   rØ   út.IO[str] | Nonerv   rè   r„   rA   r>   r?   )"r“   r’   r   rØ   rv   rw   r   ÚFORCED_WIDTHrÂ   ru   r´   r�   rŽ   ÚBinaryIOr   r|   Ú_CHUNK_SIZErM   r   Úvisible_prompt_funcÚhidden_prompt_funcrÛ   r	   rß   r   ÚpdbÚPdbr   ÚitemsrX   Ú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‘Iˆ	Ü—Z‘Zˆ
Ü—Z‘Zˆ
Ü%×2Ñ2ÐØ"$Œ
Ôà�m‰m˜CÓ ˆä"“}ˆà�?Š?Ü'(§v¡vÜ—
‘
œL¨°l×6IÑ6IÓJó(ð ˆK˜*ô "5Ø $§,¡,°YÀSô"
ð 	
ŒŒ	�Jð �?Š?ð &'ˆJÔ"ä(Ø×ÑØ—\‘\ØØô	
ŒŒ
ô )Ø×ÑØ—\‘\ØØØ%ô
ŒŒ
ô 
�ZÓ	 õ	ó 
!ð	ô 
�ZÓ	 õ	(ó 
!ð	(ô 
�ZÓ	 ò	ó 
!ð	ð ˆð EIð	Ø&ð	Ø6Að	àõ	ô #)×"<Ñ"<ÐÜ!'×!:Ñ!:ÐÜ"ŸO™OÐÜ %× 7Ñ 7ÐÜ(/×(AÑ(AÐ%Ü—w‘w×'Ñ'ˆØ%2ŒÔ"Ø$0ŒÔ!Ø"ŒŒØ"3ŒÔØ$5ŒÔ!ð  %Ø&*Ø'+ð	#	Øð#	àð#	ð $ð#	ð %ð	#	ð
 ð#	ð õ#	ðJ -Œ�‰Ôàˆð	,Ø!Ÿi™i›kò ,‘
��UÜ!Ÿz™zŸ~™~¨cÓ2�˜‘Ø�=ðÜŸJ™J s™Oð ',”B—J‘J˜s’Oð,ð  ×&Ñ&¨×(;Ñ(;¸\×=PÑ=PÐQÒQà%Ÿm™m›oò ,‘
��UØ�=ðÜŸJ™J s™Oð ',”B—J‘J˜s’Oð,ð $ŒCŒJØ#ŒCŒJØ!ŒCŒIØ)@ŒFÔ&Ø(>ŒFÔ%Ø/ŒFŒOØ&;ŒEÔ#Ø(EŒGÔ%Ø&6ŒJÔ#Ø+ŒC�G‰GÕøô/ %ò Úðûô %ò Ùðûð	 &Ÿm™m›oò ,‘
��UØ�=ðÜŸJ™J s™OøÜ$ò Ùðúð ',”B—J‘J˜s’Oð,ð $ŒCŒJØ#ŒCŒJØ!ŒCŒIØ)@ŒFÔ&Ø(>ŒFÔ%Ø/ŒFŒOØ&;ŒEÔ#Ø(EŒGÔ%Ø&6ŒJÔ#Ø+ŒC�G‰GÕüsŒ   …I-RÉ3:O Ê.N3Ê?;O Ë:RÌOÌ$BRÎ3	O Î<O Î?O Ï O Ï	OÏRÏOÏRÏRÏ,O>Ï=RÏ>	P
	ÐRÐ	P
	Ð
BRÒRc           
     ó¨  — d}|€| j                   }d}	d}
| j                  dk(  r7t        d«      }	t        d«      }
	 |	j                  «        |
j                  «        | j                  |||¬«      5 }|	�@|
�>|	j                  t        j                  _	        |
j                  t        j                  _	        d}d}d}t        |t        «      rt        j                  |«      }	 |j                  d«      }	  |j$                  d|xs d|d	œ|¤Ž}t        j                  j7                  «        t        j                  j7                  «        |	�N|
�L|	j9                  «       }|
j9                  «       }|r|d   j3                  |«       |r|d   j3                  |«       |d   j;                  «       }|d   j;                  «       }|d   j;                  «       }	 ddd«       t=        | |¬«      S # t        $ r dx}	}
Y �ŒŸw xY w# t         $ r | j#                  |«      }Y �Œ,w xY w# t&        $ r¥}t        j(                  «       }t+        j,                  d
|j.                  «      }|€d}|dk7  r|}t        |t0        «      sIt        j                  j3                  t        |«      «       t        j                  j3                  d«       d}|}Y d}~�Œ¿d}~wt4        $ r&}|s‚ |}d}t        j(                  «       }Y d}~�Œìd}~ww xY w# t        j                  j7                  «        t        j                  j7                  «        |	�N|
�L|	j9                  «       }|
j9                  «       }|r|d   j3                  |«       |r|d   j3                  |«       |d   j;                  «       }|d   j;                  «       }|d   j;                  «       }w xY w# 1 sw Y   �ŒúxY w)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_namerJ   )Úargsr  zint | t.Any | Noner¦   r¢   )rµ   r¶   rO   r^   ÚOSErrorr  rQ   r   rv   r   rw   r�   r@   ÚshlexÚsplitÚpopÚKeyErrorr½   ÚmainÚ
SystemExitr    r�   rŽ   ÚcoderD   r'   ró   rn   rc   Úgetvaluer•   )r   r¼   r  r   r³   rµ   rÝ   Úextrar    Úcap_outÚcap_errÚ
outstreamsr›   rž   rœ   r  rÒ   Úe_codeÚfd_outÚfd_errrv   rw   r   s                          r   ÚinvokezCliRunner.invokeT  so  € ðj ˆØÐ#Ø#×4Ñ4Ðð &*ˆØ%)ˆà�<‰<˜4ÒÜ  “mˆGÜ  “mˆGð)Ø—‘”Ø—‘”ð �^‰^ %¨S¸ˆ^Ó>ð >	2À*ð Ð" wÐ':Ø*1×*:Ñ*:”—
‘
Ô'Ø*1×*:Ñ*:”—
‘
Ô'àˆLØ.2ˆIØˆIä˜$¤Ô$Ü—{‘{ 4Ó(�ð<Ø!ŸI™I kÓ2�	ð*2Ø'˜sŸx™xÐV¨TªZ°RÀ9ÑVÐPUÑV�ô2 —
‘
× Ñ Ô"Ü—
‘
× Ñ Ô"ð
 Ð&¨7Ð+>Ø$Ÿ\™\›^�FØ$Ÿ\™\›^�FÙØ" 1™×+Ñ+¨FÔ3ÙØ" 1™×+Ñ+¨FÔ3à# A™×/Ñ/Ó1�Ø# A™×/Ñ/Ó1�Ø# A™×/Ñ/Ó1‘÷}>	2ô@ ØØØØØ%ØØØô	
ð 		
øôG ò )Ø$(Ð(�›'ð)ûô( ò <Ø ×6Ñ6°sÓ;“	ð<ûô
 ò #ÜŸ<™<›>�ÜŸ™Ð 4°a·f±fÓ=�à�>Ø�Fà˜Q’;Ø !�Iä! &¬#Ô.Ü—J‘J×$Ñ$¤S¨£[Ô1Ü—J‘J×$Ñ$ TÔ*Ø�Fà"–	ûäò *Ù'ØØ�	Ø�	ÜŸ<™<›>–ûð*ûô —
‘
× Ñ Ô"Ü—
‘
× Ñ Ô"ð
 Ð&¨7Ð+>Ø$Ÿ\™\›^�FØ$Ÿ\™\›^�FÙØ" 1™×+Ñ+¨FÔ3ÙØ" 1™×+Ñ+¨FÔ3à# A™×/Ñ/Ó1�Ø# A™×/Ñ/Ó1�Ø# A™×/Ñ/Ó1‘ú÷}>	2ñ >	2ús‡   » G* Á/A.OÃG>Ã0HÄ	COÇ*G;Ç:G;Ç>HÈOÈHÈOÈ	K:È(BKËK=ËK:ËK5Ë/K=Ë5K:Ë:K=Ë=COÏOÏOc              #  óÊ  K  — ddl }|j                  dt        d¬«       t        j                  «       }t        j                  |¬«      }t        j                  |«       	 |–— t        j                  |«       |€ddl}	 |j                  |«       yy# t        $ r Y yw xY w# t        j                  |«       |€&ddl}	 |j                  |«       w # t        $ r Y w w xY ww xY w­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.

        .. warning::
            This helper predates Python 3 and modern pytest, and is not
            thread-safe: it relies on :func:`os.chdir`, which mutates
            process-global state, and :meth:`invoke` swaps the
            process-global standard streams too. Parallelize tests with
            processes (``pytest-xdist``), not threads. Locking the
            runner (:pr:`3511`, :pr:`3520`, :pr:`3530`) and a
            ``set_filesystem()`` API (:issue:`3123`) were declined:
            neither removes the global-state mutation. See :issue:`3700`
            and :issue:`3501`.

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

        .. deprecated:: 8.5.0
            Will be removed in Click 9.0. Use
            :class:`tempfile.TemporaryDirectory` or pytest's
            ``tmp_path`` fixture with absolute paths instead.

        .. versionchanged:: 8.0
            Added the ``temp_dir`` parameter.
        r   Nz£'isolated_filesystem' is deprecated and will be removed in Click 9.0. Use 'tempfile.TemporaryDirectory' or pytest's 'tmp_path' fixture with absolute paths instead.é   )Ú
stacklevel)Údir)ÚwarningsÚwarnÚDeprecationWarningrX   ÚgetcwdrZ   ÚmkdtempÚchdirÚshutilÚrmtreer  )r   Útemp_dirr  ÚcwdÚdtr#  s         r   Úisolated_filesystemzCliRunner.isolated_filesystemå  sØ   è ø€ ó@ 	à�‰ð4ô Øð 	ô 	
ô �i‰i‹kˆÜ×Ñ (Ô+ˆÜ
�‰�Œð	ØŠHä�H‰H�SŒMàÐÛðØ—M‘M "Õ%ð	  øô
 ò Ùðûô �H‰H�SŒMàÐÛðØ—M‘M "Õ%øÜò Ùðúð  üsf   ‚AC#ÁB! Á#C#Á?B ÂC#Â	BÂC#ÂBÂC#Â!C Â>CÃC Ã	CÃC ÃCÃC Ã C#)zutf-8NFTr   )r’   r@   r³   ú$cabc.Mapping[str, str | None] | Noner´   r   rµ   r   r¶   r   r>   r?   )r¼   r   r>   r@   r!   )rÁ   r)  r>   r²   )NNF)r   ú str | bytes | t.IO[t.Any] | Noner³   r)  rÝ   r   r>   z9cabc.Generator[tuple[io.BytesIO, io.BytesIO, io.BytesIO]])NNNNF)r¼   r   r  zstr | cabc.Sequence[str] | Noner   r*  r³   r)  rµ   ræ   rÝ   r   r  rA   r>   r•   )r%  zstr | os.PathLike[str] | Noner>   zcabc.Generator[str])rF   rG   rH   re   rI   r   r½   rÂ   Ú
contextlibÚcontextmanagerr  r  r(  rJ   r   r   r–   r–   =  s†  … ñ"ðH ƒLØ	&Ó&ØÓØÓØÓð Ø48Ø Ø!%Ø$ðàðð 2ðð ð	ð
 ðð ðð 
óó,"ð AEðØ=ðà	&óð ×Ñð 37Ø48Øð	C,à/ðC,ð 2ðC,ð ð	C,ð
 
CòC,ó ðC,ðP 15Ø26Ø48Ø(,ØðO
àðO
ð .ðO
ð 0ð	O
ð
 2ðO
ð &ðO
ð ðO
ð ðO
ð 
óO
ðb ×Ñà8<ð8Ø5ð8à	ò8ó ñ8r   r–   )rL   zEchoingStdin | Noner>   zcabc.Generator[None])r   r*  r’   r@   r>   r   )/Ú
__future__r   Úcollections.abcÚabcÚcabcr+  ry   rX   rî   r	  r   rZ   Útypingr�   Útypesr   rË   r   r   r   r	   r
   ÚTYPE_CHECKINGÚ	_typeshedr   Úcorer   r¹   ÚLiteralr   rI   Útupler¯   ÚBaseExceptionr   r   r,  rM   rO   rz   rg   ru   ÚTextIOWrapperr|   r“   r•   r–   rJ   r   r   ú<module>r:     s"  ðÞ "å Û Û 	Û 	Û 
Û Û 
Û Û Ý å Ý Ý Ý Ý (à‡?‚?Ý(åà‡<�<�7ÒØ Ÿy™y¨Ñ/€K�Ô/à Ÿy™y¨Ñ5€K�Ó5Ø" 4¨Ñ#6¸À}Ð#TÑU€ˆ{Ó U÷#!ñ #!ðL ×Ñòó ð÷"ñ "ôJ �"—*‘*ô  ÷*7ñ 7ô$4˜"×*Ñ*ô 4ðnØ+ðØ69ðàó÷(S4ñ S4÷laò ar   