Ë
    Ä�©j<f  ã                  óZ  — 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	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 	 	 	 	 	 	 	 	 	 	 	 	 d6d„Zej,                  rd dlmZ  eddej2                  ¬«      Zn ej0                  dd¬«      Z G d„ dej6                  e   «      ZdZdZdZdZ  G d„ dejB                  «      Z" G d„ d«      Z# G d„ de#«      Z$ G d„ d e#«      Z% G d!„ d"e#«      Z& G d#„ d$e#«      Z'e$e&e'e%d%œZ(d&e)d'<    ej0                  d(d¬)«      Z*	 d7	 	 	 	 	 d8d*„Z+ejX                  d9d+„«       Z-ejX                  d:d,„«       Z-ejX                  d;d-„«       Z-ejX                  d<d.„«       Z-d<d/„Z-d=d0„Z.d>d1„Z/d?d2„Z0d@d3„Z1	 	 	 	 	 	 	 	 	 	 dAd4„Z2	 	 	 	 	 	 	 	 dBd5„Z3y)Cé    )ÚannotationsN)Úgettexté   )ÚArgument)ÚCommand)ÚContext)ÚGroup)ÚOption)Ú	Parameter)ÚParameterSource)Úechoc                ó  — |j                  d«      \  }}}t        |«      }|€y || |||«      }|dk(  r*t        |j                  «       j	                  «       d¬«       y|dk(  r(t        |j                  «       j	                  «       «       yy)a   Perform shell completion for the given CLI program.

    :param cli: Command being called.
    :param ctx_args: Extra arguments to pass to
        ``cli.make_context``.
    :param prog_name: Name of the executable in the shell.
    :param complete_var: Name of the environment variable that holds
        the completion instruction.
    :param instruction: Value of ``complete_var`` with the completion
        instruction and shell, in the form ``instruction_shell``.
    :return: Status code to exit with.
    Ú_r   ÚsourceF)Únlr   Úcomplete)Ú	partitionÚget_completion_classr   r   Úencoder   )	ÚcliÚctx_argsÚ	prog_nameÚcomplete_varÚinstructionÚshellr   Úcomp_clsÚcomps	            ú]/var/www/html/streamforge-license/venv/lib/python3.12/site-packages/click/shell_completion.pyÚshell_completer      s‰   € ð& (×1Ñ1°#Ó6Ñ€Eˆ1ˆkÜ# EÓ*€HàÐØá�C˜ 9¨lÓ;€Dð �hÒÜˆT�[‰[‹]×!Ñ!Ó#¨Õ.Øà�jÒ ÜˆT�]‰]‹_×#Ñ#Ó%Ô&Øàó    )ÚTypeVarÚ
_ValueT_coT)Ú	covariantÚdefault)r#   c                  ó<   — e Zd ZdZdZ	 	 d	 	 	 	 	 	 	 	 	 dd„Zdd„Zy)	ÚCompletionItema)  Represents a completion value and metadata about the value. The
    default metadata is ``type`` to indicate special shell handling,
    and ``help`` if a shell supports showing a help string next to the
    value.

    Arbitrary parameters can be passed when creating the object, and
    accessed using ``item.attr``. If an attribute wasn't passed,
    accessing it returns ``None``.

    :param value: The completion suggestion.
    :param type: Tells the shell script to provide special completion
        support for the type. Click uses ``"dir"`` and ``"file"``.
    :param help: String shown next to the value if supported.
    :param kwargs: Arbitrary metadata. The built-in implementations
        don't use this, but custom type completions paired with custom
        shell support could use it.
    ©ÚvalueÚtypeÚhelpÚ_infoNc                ó<   — || _         || _        || _        || _        y ©Nr'   )Úselfr(   r)   r*   Úkwargss        r   Ú__init__zCompletionItem.__init__X   s    € ð "'ˆŒ
ØˆŒ	Ø $ˆŒ	Øˆ�
r    c                ó8   — | j                   j                  |«      S r-   )r+   Úget)r.   Únames     r   Ú__getattr__zCompletionItem.__getattr__d   s   € Ø�z‰z�~‰~˜dÓ#Ð#r    )ÚplainN)
r(   r"   r)   Ústrr*   ú
str | Noner/   út.AnyÚreturnÚNone)r3   r6   r9   r8   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r0   r4   © r    r   r&   r&   C   sP   „ ñð$ 3€Ið
 Øð	
àð
ð ð
ð ð	
ð
 ð
ð 
ó
ô$r    r&   a¢  %(complete_func)s() {
    local IFS=$'\n'
    local response

    response=$(env COMP_WORDS="${COMP_WORDS[*]}" COMP_CWORD=$COMP_CWORD %(complete_var)s=bash_complete $1)

    for completion in $response; do
        IFS=',' read type value <<< "$completion"

        if [[ $type == 'dir' ]]; then
            COMPREPLY=()
            compopt -o dirnames
        elif [[ $type == 'file' ]]; then
            COMPREPLY=()
            compopt -o default
        elif [[ $type == 'plain' ]]; then
            COMPREPLY+=($value)
        fi
    done

    return 0
}

%(complete_func)s_setup() {
    complete -o nosort -F %(complete_func)s %(prog_name)s
}

%(complete_func)s_setup;
a¦  #compdef %(prog_name)s

%(complete_func)s() {
    local -a completions
    local -a completions_with_descriptions
    local -a response
    (( ! $+commands[%(prog_name)s] )) && return 1

    response=("${(@f)$(env COMP_WORDS="${words[*]}" COMP_CWORD=$((CURRENT-1)) %(complete_var)s=zsh_complete %(prog_name)s)}")

    for type key descr in ${response}; do
        if [[ "$type" == "plain" ]]; then
            if [[ "$descr" == "_" ]]; then
                completions+=("$key")
            else
                completions_with_descriptions+=("$key":"$descr")
            fi
        elif [[ "$type" == "dir" ]]; then
            _path_files -/
        elif [[ "$type" == "file" ]]; then
            _path_files -f
        fi
    done

    if [ -n "$completions_with_descriptions" ]; then
        _describe -V unsorted completions_with_descriptions -U
    fi

    if [ -n "$completions" ]; then
        compadd -U -V unsorted -a completions
    fi
}

if [[ $zsh_eval_context[-1] == loadautofunc ]]; then
    # autoload from fpath, call function directly
    %(complete_func)s "$@"
else
    # eval/source/. command, register function for later
    compdef %(complete_func)s %(prog_name)s
fi
af  function %(complete_func)s;
    set -l response (env %(complete_var)s=fish_complete COMP_WORDS=(commandline -cp) COMP_CWORD=(commandline -t) %(prog_name)s);

    for completion in $response;
        set -l metadata (string split "," $completion);

        if test $metadata[1] = "dir";
            __fish_complete_directories $metadata[2];
        else if test $metadata[1] = "file";
            __fish_complete_path $metadata[2];
        else if test $metadata[1] = "plain";
            echo $metadata[2];
        end;
    end;
end;

complete --no-files --command %(prog_name)s --arguments "(%(complete_func)s)";
aÉ  Register-ArgumentCompleter -Native -CommandName %(prog_name)s -ScriptBlock {
    param($wordToComplete, $commandAst, $cursorPosition)

    $prev_complete = $env:%(complete_var)s
    $prev_words = $env:COMP_WORDS
    $prev_cword = $env:COMP_CWORD

    $env:%(complete_var)s = 'powershell_complete'
    $env:COMP_WORDS = $commandAst.ToString()
    if ($wordToComplete) {
        $env:COMP_CWORD = $commandAst.CommandElements.Count - 1
    } else {
        $env:COMP_CWORD = $commandAst.CommandElements.Count
    }

    try {
        $response = & %(prog_name)s 2>$null
    } finally {
        $env:%(complete_var)s = $prev_complete
        $env:COMP_WORDS = $prev_words
        $env:COMP_CWORD = $prev_cword
    }

    if (-not $response) { return }

    $prefix = "$wordToComplete*"
    $lines = $response -split "`n"
    for ($i = 0; $i + 2 -lt $lines.Count; $i += 3) {
        $type = $lines[$i]
        $value = $lines[$i + 1]
        $descr = $lines[$i + 2]
        if (-not $type) { continue }

        if ($type -eq 'plain') {
            $tip = if ($descr -and $descr -ne '_') { $descr } else { $value }
            [System.Management.Automation.CompletionResult]::new(
                $value, $value, 'ParameterValue', $tip)
        } elseif ($type -eq 'dir') {
            Get-ChildItem -Directory -Path $prefix -ErrorAction SilentlyContinue |
                ForEach-Object {
                    [System.Management.Automation.CompletionResult]::new(
                        $_.FullName, $_.Name, 'ProviderContainer', $_.FullName)
                }
        } elseif ($type -eq 'file') {
            Get-ChildItem -Path $prefix -ErrorAction SilentlyContinue |
                ForEach-Object {
                    $kind = 'ProviderItem'
                    if ($_.PSIsContainer) { $kind = 'ProviderContainer' }
                    [System.Management.Automation.CompletionResult]::new(
                        $_.FullName, $_.Name, $kind, $_.FullName)
                }
        }
    }
}
c                  ó,   — e Zd ZU ded<   ded<   ded<   y)Ú_SourceVarsDictr6   Úcomplete_funcr   r   N)r;   r<   r=   Ú__annotations__r@   r    r   rB   rB     s   … ØÓØÓØ„Nr    rB   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d„Zedd„«       Zdd„Zdd„Z	dd„Z
	 	 	 	 	 	 dd„Zdd„Zdd„Zy)ÚShellCompletea¯  Base class for providing shell completion support. A subclass for
    a given shell will override attributes and methods to implement the
    completion instructions (``source`` and ``complete``).

    :param cli: Command being called.
    :param prog_name: Name of the executable in the shell.
    :param complete_var: Name of the environment variable that holds
        the completion instruction.

    .. versionadded:: 8.0
    út.ClassVar[str]r3   Úsource_templater   r   úcabc.MutableMapping[str, t.Any]r   r6   r   r   c                ó<   — || _         || _        || _        || _        y r-   )r   r   r   r   )r.   r   r   r   r   s        r   r0   zShellComplete.__init__3  s!   € ð ˆŒØ ˆŒØ"ˆŒØ(ˆÕr    c                ó�   — t        j                  dd| j                  j                  dd«      t         j                  ¬«      }d|› d�S )zQThe name of the shell function defined by the completion
        script.
        z\W*Ú ú-r   )ÚflagsÚ_completion)ÚreÚsubr   ÚreplaceÚASCII)r.   Ú	safe_names     r   Ú	func_namezShellComplete.func_name?  s<   € ô
 —F‘F˜6 2 t§~¡~×'=Ñ'=¸cÀ3Ó'GÌrÏxÉxÔXˆ	Ø�9�+˜[Ð)Ð)r    c                óJ   — | j                   | j                  | j                  dœS )z—Vars for formatting :attr:`source_template`.

        By default this provides ``complete_func``, ``complete_var``,
        and ``prog_name``.
        )rC   r   r   )rU   r   r   ©r.   s    r   Úsource_varszShellComplete.source_varsG  s%   € ð "Ÿ^™^Ø ×-Ñ-ØŸ™ñ
ð 	
r    c                ó<   — | j                   | j                  «       z  S )zÊProduce the shell script that defines the completion
        function. By default this ``%``-style formats
        :attr:`source_template` with the dict returned by
        :meth:`source_vars`.
        )rH   rX   rW   s    r   r   zShellComplete.sourceS  s   € ð ×#Ñ# d×&6Ñ&6Ó&8Ñ8Ð8r    c                ó   — t         ‚)z˜Use the env vars defined by the shell script to return a
        tuple of ``args, incomplete``. This must be implemented by
        subclasses.
        ©ÚNotImplementedErrorrW   s    r   Úget_completion_argsz!ShellComplete.get_completion_args[  s
   € ô
 "Ð!r    c                óž   — t        | j                  | j                  | j                  |«      }t	        |||«      \  }}|j                  ||«      S )aT  Determine the context and last complete command or parameter
        from the complete args. Call that object's ``shell_complete``
        method to get the completions for the incomplete value.

        :param args: List of complete args before the incomplete value.
        :param incomplete: Value being completed. May be empty.
        )Ú_resolve_contextr   r   r   Ú_resolve_incompleter   )r.   ÚargsÚ
incompleteÚctxÚobjs        r   Úget_completionszShellComplete.get_completionsb  sE   € ô ˜tŸx™x¨¯©¸¿¹ÈÓMˆÜ-¨c°4¸ÓD‰ˆˆZØ×!Ñ! # zÓ2Ð2r    c                ó   — t         ‚)z°Format a completion item into the form recognized by the
        shell script. This must be implemented by subclasses.

        :param item: Completion item to format.
        r[   ©r.   Úitems     r   Úformat_completionzShellComplete.format_completionp  s
   € ô "Ð!r    c                ó´   — | j                  «       \  }}| j                  ||«      }|D �cg c]  }| j                  |«      ‘Œ }}dj                  |«      S c c}w )zÛProduce the completion data to send back to the shell.

        By default this calls :meth:`get_completion_args`, gets the
        completions, then calls :meth:`format_completion` for each
        completion.
        ú
)r]   re   ri   Újoin)r.   ra   rb   Úcompletionsrh   Úouts         r   r   zShellComplete.completex  s[   € ð  ×3Ñ3Ó5ÑˆˆjØ×*Ñ*¨4°Ó<ˆØ8CÖD°ˆt×%Ñ% dÕ+ÐDˆÐDØ�y‰y˜‹~Ðùò Es   ªAN)
r   r   r   rI   r   r6   r   r6   r9   r:   ©r9   r6   )r9   rB   ©r9   ztuple[list[str], str])ra   ú	list[str]rb   r6   r9   zlist[CompletionItem[str]]©rh   zCompletionItem[str]r9   r6   )r;   r<   r=   r>   rD   r0   ÚpropertyrU   rX   r   r]   re   ri   r   r@   r    r   rF   rF     s¸   … ñ
ð Óðð
 %Ó$ðð 
ƒLØ-Ó-ØƒNØÓð
)àð
)ð 2ð
)ð ð	
)ð
 ð
)ð 
ó
)ð ò*ó ð*ó

ó9ó"ð3Øð3Ø+.ð3à	"ó3ó"ô
r    rF   c                  ód   ‡ — e Zd ZU dZdZded<   eZded<   ed
d„«       Z	dˆ fd„Z
dd„Zdd	„Zˆ xZS )ÚBashCompletezShell completion for Bash.ÚbashrG   r3   rH   c                 ó„  — dd l } dd l}| j                  d«      }|€d }nO|j                  |dddg|j                  ¬«      }t        j                  d|j                  j                  «       «      }|�;|j                  «       \  }}|dk  s
|dk(  r|dk  rt        t        d	«      d
¬«       y y y t        t        d«      d
¬«       y )Nr   rv   z--norcz-czecho "${BASH_VERSION}")Ústdoutz^(\d+)\.(\d+)\.\d+Ú4zCShell completion is not supported for Bash versions older than 4.4.T)Úerrz@Couldn't detect Bash version, shell completion is not supported.)ÚshutilÚ
subprocessÚwhichÚrunÚPIPErP   Úsearchrx   ÚdecodeÚgroupsr   r   )r{   r|   Úbash_exeÚmatchÚoutputÚmajorÚminors          r   Ú_check_versionzBashComplete._check_version‹  sÇ   € ãÛà—<‘< Ó'ˆàÐØ‰Eà—^‘^Ø˜8 TÐ+CÐDØ!—‘ð $ó ˆFô —I‘IÐ3°V·]±]×5IÑ5IÓ5KÓLˆEàÐØ Ÿ<™<›>‰LˆE�5à�sŠ{˜e sšl¨u°sª{ÜÜð4óð öð 0;˜lô ÜÐTÓUØör    c                ó@   •— | j                  «        t        ‰| �	  «       S r-   )rˆ   Úsuperr   )r.   Ú	__class__s    €r   r   zBashComplete.source¬  s   ø€ Ø×ÑÔÜ‰w‰~ÓÐr    c                ó¸   — t        t        j                  d   «      }t        t        j                  d   «      }|d| }	 ||   }||fS # t        $ r d}Y ||fS w xY w©NÚ
COMP_WORDSÚ
COMP_CWORDr   rL   ©Úsplit_arg_stringÚosÚenvironÚintÚ
IndexError©r.   ÚcwordsÚcwordra   rb   s        r   r]   z BashComplete.get_completion_args°  óo   € Ü!¤"§*¡*¨\Ñ":Ó;ˆÜ”B—J‘J˜|Ñ,Ó-ˆØ�a˜ˆˆð	Ø ™ˆJð �ZÐÐøô ò 	Ø‰Jà�ZÐÐð	úó   ¿A ÁAÁAc                ó8   — |j                   › d|j                  › �S )Nú,)r)   r(   rg   s     r   ri   zBashComplete.format_completion¼  s   € Ø—)‘)�˜A˜dŸj™j˜\Ð*Ð*r    )r9   r:   ro   rp   )rh   zCompletionItem[t.Any]r9   r6   )r;   r<   r=   r>   r3   rD   Ú_SOURCE_BASHrH   Ústaticmethodrˆ   r   r]   ri   Ú__classcell__)r‹   s   @r   ru   ru   …  s<   ø… Ù$à"€Dˆ/Ó"Ø'3€O�_Ó3àòó ðõ@ ó
 ÷+r    ru   c                  ó>   — e Zd ZU dZdZded<   eZded<   d	d„Zd
d„Z	y)ÚZshCompletezShell completion for Zsh.ÚzshrG   r3   rH   c                ó¸   — t        t        j                  d   «      }t        t        j                  d   «      }|d| }	 ||   }||fS # t        $ r d}Y ||fS w xY wr�   r�   r–   s        r   r]   zZshComplete.get_completion_argsÆ  r™   rš   c                ó¤   — |j                   xs d}|dk7  r|j                  j                  dd«      n|j                  }|j                  › d|› d|› �S )Nr   ú:z\:rk   )r*   r(   rR   r)   )r.   rh   Úhelp_r(   s       r   ri   zZshComplete.format_completionÒ  sO   € Ø—	‘	Ò ˜Sˆð 38¸3²,�—
‘
×"Ñ" 3¨Ô.ÀDÇJÁJˆØ—)‘)�˜B˜u˜g R¨ wÐ/Ð/r    Nrp   rr   )
r;   r<   r=   r>   r3   rD   Ú_SOURCE_ZSHrH   r]   ri   r@   r    r   r¡   r¡   À  s#   … Ù#à!€Dˆ/Ó!Ø'2€O�_Ó2ó
 ô0r    r¡   c                  ó>   — e Zd ZU dZdZded<   eZded<   d	d„Zd
d„Z	y)ÚFishCompletezShell completion for Fish.ÚfishrG   r3   rH   c                óÊ   — t        t        j                  d   «      }t        j                  d   }|rt        |«      d   }|dd  }|r|r|d   |k(  r|j                  «        ||fS )NrŽ   r�   r   r   éÿÿÿÿ)r‘   r’   r“   Úpop)r.   r—   rb   ra   s       r   r]   z FishComplete.get_completion_argsê  sf   € Ü!¤"§*¡*¨\Ñ":Ó;ˆÜ—Z‘Z Ñ-ˆ
ÙÜ)¨*Ó5°aÑ8ˆJØ�a�bˆzˆñ ™$ 4¨¡8¨zÒ#9Ø�H‰HŒJà�ZÐÐr    c                óä   — |j                   rJ|j                   j                  dd«      j                  dd«      }|j                  › d|j                  › d|› �S |j                  › d|j                  › �S )z¸
        .. versionchanged:: 8.4.2
            Escape newlines and replace tabs with spaces in the help text to
            fix completion errors with multi-line help strings.
        rk   z\nú	ú rœ   ©r*   rR   r)   r(   ©r.   rh   r¦   s      r   ri   zFishComplete.format_completionø  sf   € ð �9Š9Ø—I‘I×%Ñ% d¨EÓ2×:Ñ:¸4ÀÓEˆEØ—i‘i�[  $§*¡* ¨R°¨wÐ7Ð7à—)‘)�˜A˜dŸj™j˜\Ð*Ð*r    Nrp   rr   )
r;   r<   r=   r>   r3   rD   Ú_SOURCE_FISHrH   r]   ri   r@   r    r   r©   r©   ä  s#   … Ù$à"€Dˆ/Ó"Ø'3€O�_Ó3ó ô+r    r©   c                  ó>   — e Zd ZU dZdZded<   eZded<   d	d„Zd
d„Z	y)ÚPowerShellCompletezhShell completion for PowerShell (Windows PowerShell 5.1+ and pwsh 7+).

    .. versionadded:: 8.5.0
    Ú
powershellrG   r3   rH   c                ó¸   — t        t        j                  d   «      }t        t        j                  d   «      }|d| }	 ||   }||fS # t        $ r d}Y ||fS w xY wr�   r�   r–   s        r   r]   z&PowerShellComplete.get_completion_args  r™   rš   c                ó´   — |j                   r-|j                   j                  dd«      j                  dd«      }nd}|j                  › d|j                  › d|› �S )Núr°   rk   r   r±   r²   s      r   ri   z$PowerShellComplete.format_completion  sR   € ð �9Š9Ø—I‘I×%Ñ% d¨CÓ0×8Ñ8¸¸sÓC‰EàˆEØ—)‘)�˜B˜tŸz™z˜l¨"¨U¨GÐ4Ð4r    Nrp   rr   )
r;   r<   r=   r>   r3   rD   Ú_SOURCE_POWERSHELLrH   r]   ri   r@   r    r   rµ   rµ   	  s'   … ñð
 )€Dˆ/Ó(Ø'9€O�_Ó9ó
 ô
5r    rµ   )rv   rª   r¶   r¢   z't.Final[dict[str, type[ShellComplete]]]Ú_available_shellsÚ_ShellCompleteT)Úboundc                ó4   — |€| j                   }| t        |<   | S )am  Register a :class:`ShellComplete` subclass under the given name.
    The name will be provided by the completion instruction environment
    variable during completion.

    :param cls: The completion class that will handle completion for the
        shell.
    :param name: Name to register the class under. Defaults to the
        class's ``name`` attribute.
    )r3   r»   )Úclsr3   s     r   Úadd_completion_classrÀ   5  s"   € ð €|Ø�x‰xˆà!Ô�dÑà€Jr    c                 ó   — y r-   r@   ©r   s    r   r   r   I  ó   € ØJMr    c                 ó   — y r-   r@   rÂ   s    r   r   r   K  rÃ   r    c                 ó   — y r-   r@   rÂ   s    r   r   r   M  s   € ØHKr    c                 ó   — y r-   r@   rÂ   s    r   r   r   O  s   € ØDGr    c                ó,   — t         j                  | «      S )zñLook up a registered :class:`ShellComplete` subclass by the name
    provided by the completion instruction environment variable. If the
    name isn't registered, returns ``None``.

    :param shell: Name the class is registered under.
    )r»   r2   rÂ   s    r   r   r   Q  s   € ô × Ñ  Ó'Ð'r    c                óÎ   — ddl }|j                  | d¬«      }d|_        d|_        g }	 |j                  |«       |S # t        $ r |j                  |j                  «       Y |S w xY w)aó  Split an argument string as with :func:`shlex.split`, but don't
    fail if the string is incomplete. Ignores a missing closing quote or
    incomplete escape sequence and uses the partial token as-is.

    .. code-block:: python

        split_arg_string("example 'my file")
        ["example", "my file"]

        split_arg_string("example my\")
        ["example", "my"]

    :param string: String to split.

    .. versionchanged:: 8.2
        Moved to ``shell_completion`` from ``parser``.
    r   NT)ÚposixrL   )ÚshlexÚwhitespace_splitÚ
commentersÚextendÚ
ValueErrorÚappendÚtoken)ÚstringrÊ   Úlexrn   s       r   r‘   r‘   [  sl   € ó$ à
�+‰+�f Dˆ+Ó
)€CØ€CÔØ€C„NØ€CðØ�
‰
�3Œð €Jøô ò ð 	�
‰
�3—9‘9Õà€Jðús   ©< ¼$A$Á#A$c                ól  — t        |t        «      sy| j                  j                  |j                  «      }|j
                  dk(  xsn | j                  |j                  «      t        j                  uxsA |j
                  dkD  xr0 t        |t        t        f«      xr t        |«      |j
                  k  S )zìDetermine if the given parameter is an argument that can still
    accept values.

    :param ctx: Invocation context for the command represented by the
        parsed complete args.
    :param param: Argument object being checked.
    Fr¬   r   )Ú
isinstancer   Úparamsr2   r3   ÚnargsÚget_parameter_sourcer   ÚCOMMANDLINEÚtupleÚlistÚlen)rc   Úparamr(   s      r   Ú_is_incomplete_argumentrÝ     s”   € ô �eœXÔ&Øà�J‰J�N‰N˜5Ÿ:™:Ó&€Eà�‰�rÑò 	
Ø×#Ñ# E§J¡JÓ/´×7RÑ7RÐRò	
ð �K‰K˜!‰Oò )Ü˜5¤5¬$ -Ó0ò)ä�E“
˜UŸ[™[Ñ(ðr    c                ó.   — |sy|d   }|| j                   v S )z5Check if the value looks like the start of an option.Fr   )Ú_opt_prefixes)rc   r(   Úcs      r   Ú_start_of_optionrá   –  s"   € áØàˆa‰€AØ�×!Ñ!Ð!Ð!r    c                ó  — t        |t        «      sy|j                  s|j                  ryd}t	        t        |«      «      D ])  \  }}|dz   |j                  kD  r nt        | |«      sŒ'|} n |duxr ||j                  v S )zºDetermine if the given parameter is an option that needs a value.

    :param args: List of complete args before the incomplete value.
    :param param: Option object being checked.
    FNr   )	rÔ   r
   Úis_flagÚcountÚ	enumerateÚreversedrÖ   rá   Úopts)rc   ra   rÜ   Úlast_optionÚindexÚargs         r   Ú_is_incomplete_optionrë   Ÿ  s‚   € ô �eœVÔ$Øà‡}‚}˜ŸšØà€Kä¤¨£Ó/ò ‰
ˆˆsØ�1‰9�u—{‘{Ò"Ùä˜C Õ%ØˆKÙðð ˜dÐ"Ò@ {°e·j±jÐ'@Ð@r    c           	     óâ  — d|d<    | j                   ||j                  «       fi |¤Ž5 }|j                  |j                  z   }|rþ|j                  }t        |t        «      rÞ|j                  s]|j                  ||«      \  }}}|€|cddd«       S |j                  |||d¬«      5 }|}|j                  |j                  z   }ddd«       nv|}|rT|j                  ||«      \  }}}|€|cddd«       S |j                  |||ddd¬«      5 }	|	}|j                  }ddd«       |rŒT|}g |j                  ¢|j                  ¢}nn|rŒþddd«       |S # 1 sw Y   ŒxY w# 1 sw Y   ŒCxY w# 1 sw Y   S xY w)a`  Produce the context hierarchy starting with the command and
    traversing the complete arguments. This only follows the commands,
    it doesn't trigger input prompts or callbacks.

    :param cli: Command being called.
    :param prog_name: Name of the executable in the shell.
    :param args: List of complete args before the incomplete value.
    TÚresilient_parsingN)Úparentrí   F)rî   Úallow_extra_argsÚallow_interspersed_argsrí   )	Úmake_contextÚcopyÚ_protected_argsra   ÚcommandrÔ   r	   ÚchainÚresolve_command)
r   r   r   ra   rc   rô   r3   ÚcmdÚsub_ctxÚsub_sub_ctxs
             r   r_   r_   ¸  s®  € ð %)€HÐ Ñ!Ø	ˆ×	Ñ	˜) T§Y¡Y£[Ñ	=°HÑ	=ð )ÀØ×"Ñ" S§X¡XÑ-ˆáØ—k‘kˆGä˜'¤5Ô)Ø—}’}Ø&-×&=Ñ&=¸cÀ4Ó&H‘O�D˜#˜tà�{Ø"÷)ñ )ð ×)Ñ)Ø˜d¨3À$ð *ó ð >à Ø%˜Ø"×2Ñ2°S·X±XÑ=˜÷	>ð >ð "�GáØ*1×*AÑ*AÀ#ÀtÓ*L™˜˜c 4à˜;Ø#&÷3)ñ )ð6 !×-Ñ-Ø Ø Ø#&Ø-1Ø49Ø.2ð .ó ð 	0ð )Ø&1˜GØ#*§<¡<˜D÷	0ò ð" "�CØD˜W×4Ñ4ÐD°w·|±|ÐD‘DàòM ÷)ðV €J÷=>ð >ú÷	0ð 	0ú÷7)ðV €JúsN   ¨AE$ÂE$Â$EÃ &E$Ã0E$ÄEÄ
E$Ä! E$ÅE	ÅE$ÅE!	ÅE$Å$E.c                ór  — |dk(  rd}n6d|v r2t        | |«      r&|j                  d«      \  }}}|j                  |«       d|vrt        | |«      r| j                  |fS | j                  j	                  | «      }|D ]  }t        | ||«      sŒ||fc S  |D ]  }t        | |«      sŒ||fc S  | j                  |fS )ah  Find the Click object that will handle the completion of the
    incomplete value. Return the object and the incomplete value.

    :param ctx: Invocation context for the command represented by
        the parsed complete args.
    :param args: List of complete args before the incomplete value.
    :param incomplete: Value being completed. May be empty.
    ú=rL   z--)rá   r   rÏ   rô   Ú
get_paramsrë   rÝ   )rc   ra   rb   r3   r   rÕ   rÜ   s          r   r`   r`   õ  sÜ   € ð �SÒØ‰
Ø	�
Ñ	Ô/°°ZÔ@Ø(×2Ñ2°3Ó7Ñˆˆa�Ø�‰�DÔð �4ÑÔ,¨S°*Ô=Ø�{‰{˜JÐ&Ð&à�[‰[×#Ñ# CÓ(€Fð ò %ˆÜ   d¨EÕ2Ø˜*Ð$Ò$ð%ð ò %ˆÜ" 3¨Õ.Ø˜*Ð$Ò$ð%ð �;‰;˜
Ð"Ð"r    )r   r   r   rI   r   r6   r   r6   r   r6   r9   zt.Literal[0, 1]r-   )r¿   útype[_ShellCompleteT]r3   r7   r9   rý   )r   zt.Literal['bash']r9   ztype[BashComplete])r   zt.Literal['fish']r9   ztype[FishComplete])r   zt.Literal['zsh']r9   ztype[ZshComplete])r   r6   r9   ztype[ShellComplete] | None)rÑ   r6   r9   rq   )rc   r   rÜ   r   r9   Úbool)rc   r   r(   r6   r9   rþ   )rc   r   ra   rq   rÜ   r   r9   rþ   )
r   r   r   rI   r   r6   ra   rq   r9   r   )rc   r   ra   rq   rb   r6   r9   ztuple[Command | Parameter, str])4Ú
__future__r   Úcollections.abcÚabcÚcabcr’   rP   ÚtypingÚtr   r   Úcorer   r   r   r	   r
   r   r   Úutilsr   r   ÚTYPE_CHECKINGÚtyping_extensionsr!   ÚAnyr"   ÚGenericr&   r�   r§   r³   rº   Ú	TypedDictrB   rF   ru   r¡   r©   rµ   r»   rD   r¼   rÀ   Úoverloadr   r‘   rÝ   rá   rë   r_   r`   r@   r    r   ú<module>r     s9  ðÞ "å Û 	Û 	Û Ý  å Ý Ý Ý Ý Ý Ý !Ý ð$Ø	ð$à-ð$ð ð$ð ð	$ð
 ð$ð ó$ðN ‡?‚?Ý)ñ ˜°¸q¿u¹uÔE�Jà�—‘˜<°4Ô8€Jô"$�Q—Y‘Y˜zÑ*ô "$ðL€ðL*€ðX€ð67Ð ôt�a—k‘kô ÷lñ lô^8+�=ô 8+ôv!0�-ô !0ôH"+�=ô "+ôJ5˜ô 5ðF ØØ$Øñ	>Ð Ð:ó ð �!—)‘)Ð-°_ÔE€ð 48ðØ	ðØ&0ðàóð( ‡�Ú Mó Ø MØ‡�Ú Mó Ø MØ‡�Ú Kó Ø KØ‡�Ú Gó Ø Gó(ó!óHó."óAð2:Ø	ð:à-ð:ð ð:ð ð	:ð
 ó:ðz,#Ø	ð,#Ø!ð,#Ø/2ð,#à$ô,#r    