Ë
    Ö—ÄjÇ‡  ã                  ó¸  — U d Z ddlmZ ddlZddlZddlmZ ddlmZm	Z	m
Z
mZmZmZmZmZmZmZmZ ddlmZ ddlmZmZ ddlmZ dd	lmZ dd
lmZmZmZ ddl m!Z! ddl"m#Z#m$Z$m%Z%m&Z&m'Z' ddl(m)Z) ddl*m+Z+m,Z,m-Z- ddl.m/Z/m0Z0m1Z1m2Z2m3Z3 erddl4m5Z5 ejl                   G d„ dejn                  «      «       Z8ee8e
de	f   f   Z9de:d<    ejv                  d¬«       G d„ d«      «       Z< ejv                  d¬«       G d„ d«      «       Z= ejv                  d¬«       G d„ dee1   «      «       Z> ejv                  d¬«       G d„ de>e1   «      «       Z?d d!œ	 	 	 	 	 	 	 d1d"„Z@d2d#„ZA	 	 d3	 	 	 	 	 	 	 	 	 d4d$„ZB	 	 	 	 	 	 	 	 d5d%„ZC	 d6	 	 	 	 	 	 	 d7d&„ZD	 	 	 	 	 	 	 	 	 	 d8d'„ZEd9d(„ZF	 	 	 	 	 	 	 	 	 	 d:d)„ZG	 d;	 	 	 	 	 	 	 d<d*„ZHd=d+„ZI	 	 	 	 	 	 d>d,„ZJd?d-„ZK	 	 	 	 d@d.„ZLdAd/„ZMdd0l4m5Z5mNZN y)BzHDefine the external facing argument definition types provided by a user.é    )ÚannotationsN)Úcached_property)ÚTYPE_CHECKINGÚAnyÚCallableÚGenericÚIterableÚLiteralÚSequenceÚSetÚTextIOÚUnionÚcast)Ú	TypeAlias)ÚFieldÚextract_dataclass_metadata)Úcomplete_choices)Ú
Completion)ÚDefaultÚDefaultFormatterÚ	ValueFrom)ÚResolved)ÚParserÚevaluate_parseÚparse_handlerÚparse_literalÚparse_value)ÚState)ÚEmptyÚ	EmptyTypeÚTypeView)ÚDocÚDocTypeÚTÚdetect_choicesÚfind_annotations©ÚDestructurec                  óv   — e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zedd
„«       Zedd„«       Zedd„«       Zed„ «       Zy)Ú	ArgActiona±  `Arg` action typee.

    Options:
      - set: Stores the given CLI value directly.
      - store_true: Stores a literal `True` value, causing options to not attempt to
        consume additional CLI arguments
      - store_false: Stores a literal `False` value, causing options to not attempt to
        consume additional CLI arguments
      - append: Produces a list, and accumulates the given value on top of prior values.
      - count: Increments an integer starting at 0
      - help: Cancels argument parsing and prints the help text
      - version: Cancels argument parsing and prints the CLI version
      - completion: Cancels argument parsing and enters "completion mode"
    ÚstoreÚ
store_trueÚstore_falseÚappendÚcountÚhelpÚversionÚ
completionc                óH   — | j                   | j                  | j                  hS ©N)r0   r1   r2   ©Úclss    úNC:\Users\pivot\Documents\cueki\casual-preloader\Lib\site-packages\cappa/arg.pyÚmeta_actionszArgAction.meta_actionsM   s   € à—‘˜#Ÿ+™+ s§~¡~Ð6Ð6ó    c                ó0   — |d uxr t        |t        «       S r4   )Ú
isinstancer*   ©r6   Úactions     r7   Ú	is_customzArgAction.is_customQ   s   € à˜TÐ!ÒG¬*°V¼YÓ*GÐ&GÐGr9   c                ó    — |t         j                  t         j                  t         j                  t         j                  t         j
                  hv S r4   )r*   r,   r-   r/   r1   r0   r<   s     r7   Úis_non_value_consumingz ArgAction.is_non_value_consumingU   s=   € àÜ× Ñ Ü×!Ñ!Ü�O‰OÜ×ÑÜ�N‰Nð
ð 
ð 	
r9   c                ó6   — | | j                   | j                  hv S r4   )r,   r-   ©Úselfs    r7   Úis_bool_actionzArgAction.is_bool_action_   s   € à˜Ÿ™¨×)9Ñ)9Ð:Ð:Ð:r9   N)ÚreturnzSet[ArgAction])r=   z%ArgAction | Callable[..., Any] | None)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úsetr,   r-   r.   r/   r0   r1   r2   Úclassmethodr8   r>   r@   ÚpropertyrD   © r9   r7   r*   r*   2   s�   „ ñð €CØ€JØ€KØ€FØ€Eà€DØ€GØ€Jàò7ó ð7ð òHó ðHð ò
ó ð
ð ñ;ó ñ;r9   r*   .r   ÚArgActionTypeT)Úfrozenc                  ó–   — e Zd ZU dZdZded<   dZded<   dZd	ed
<   ed„ «       Z	e	 	 	 d	 	 	 	 	 	 	 	 	 	 	 dd„«       Z
edd„«       Zdd„Zy)ÚNumArgsu‡  Control the number of values consumed for an argument, with optional-value support.

    Note: The vast majority of uses of `Arg.num_args` should be covered by supplying an integer value,
    or `NumArgs.unbounded()`.

    When `required=False`, the argument can be supplied without a value (e.g. `--foo`
    with no following value), yielding the `NumArgs.default` rather than the Arg's overall default.
    This maps to argparse's `nargs='?'` / `const` behaviour or click' s `is_flag=True` / `flag_value` behavior.

    Args:
        n: Number of values to consume. ``-1`` means unbounded. Defaults to ``1``.
        required: Whether a value is required when the option flag is present.
            When ``False``, ``--foo`` (no value) yields ``default`` and ``--foo VAL``
            yields the parsed ``VAL``. Defaults to ``True``.
        default: Value used when the flag is present but no value follows.
            Only meaningful when ``required=False``. Defaults to ``None``.

    Example::

        @dataclass
        class Args:
            # test.py          -> Args(foo=5)    (class default, flag not given)
            # test.py --foo    -> Args(foo=None) (flag given, no value â†’ NumArgs.default)
            # test.py --foo 4  -> Args(foo=4)    (flag given with value)
            foo: Annotated[
                int | None, Arg(long=True, num_args=NumArgs(required=False))
            ] = 5
    é   ÚintÚnTÚboolÚrequiredNr   Údefaultc                ó   —  | d¬«      S )Néÿÿÿÿ©rT   rM   r5   s    r7   Ú	unboundedzNumArgs.unboundedŠ   s   € á�RŒyÐr9   c                ó¢  — |rv|j                   �9t        |j                   t        «      r|j                   S  | |j                   ¬«      S |j                  r | «       S t        j                  |«      r	 | d¬«      S |j                  rät        «       }g }|j                  D ]g  }|j                  rŒ| j                  |||||¬«      }	|j                  |	j                  «       |j                  |j                  |	j                  f«       Œi t        |«      dk(  r | |j!                  «       ¬«      S dj#                  |D �
�cg c]  \  }
}d|
› d|› d�‘Œ c}}
«      }t%        d|› d	|› d
�«      ‚|j&                  r(|j(                  s | t        |j*                  «      ¬«      S |d u xs |j,                   xr | }|j(                  xs |j/                  t0        t        f«      }|r|r| j3                  «       S |j/                  t0        t        t4        f«      r2| j                  |j                  d   |«      } | |j                  ¬«      S  | «       S c c}}
w )NrZ   r   ©Úargr=   ÚlongrR   ú, Ú`z` produces `num_args=ú
On field 'z-', mismatch of arity between union variants. Ú.)Únum_argsr;   rQ   Úparser*   r@   Úis_unionrJ   Úinner_typesÚis_none_typeÚinferÚaddrT   r.   ÚrawÚlenÚpopÚjoinÚ
ValueErrorÚis_tupleÚis_variadic_tupleÚargsÚshortÚis_subclass_ofÚlistr[   Útuple)r6   Ú	type_viewÚ
field_namer^   r=   r_   Ú
distinct_nÚ
n_variantsÚtype_argÚinferredÚtrT   Úinvalid_kindsÚis_positionalÚis_sequenceÚinners                   r7   ri   zNumArgs.inferŽ   s  € ñ Ø�|‰|Ð'Ü˜cŸl™l¬GÔ4ØŸ<™<Ð'Ù˜SŸ\™\Ô*Ð*à�yŠyÙ“u�ä×/Ñ/°Ô7Ù˜Q”x�à×Òô $'£5ˆJØ02ˆJØ%×1Ô1�Ø×(Ò(ØØŸ9™9Ø˜j¨c¸&Àtð %ó �ð —‘˜xŸz™zÔ*Ø×!Ñ! 8§<¡<°·±Ð"<Õ=ð 2ô �:‹ !Ò#Ù˜ZŸ^™^Ó-Ô.Ð.à ŸI™IÙ>HÔI¹j±d°a¸�1�Q�CÐ,¨Q¨C¨qÒ1¸jÒIóˆMô Ø˜Z˜LÐ(UÐVcÐUdÐdeÐfóð ð ×Ò i×&AÒ&AÙœ˜YŸ^™^Ó,Ô-Ð-à˜t˜ÒC¨C¯I©I¨Ò(B¸d¸(ˆØ×1Ñ1ò 
°Y×5MÑ5MäÜðó6
ˆñ ™[Ø—=‘=“?Ð"ð ×#Ñ#¤T¬3´Ð$6Ô7Ø—I‘I˜i×3Ñ3°AÑ6¸
ÓCˆEÙ˜Ÿ™”>Ð!á‹uˆùó1 Js   Ä<I
c                ó>   — t        | t        «      r| j                  S | S )zHExtract the integer count from a raw (pre-normalization) num_args value.)r;   rQ   rT   )rd   s    r7   Úraw_nzNumArgs.raw_nÏ   s   € ô �h¤Ô(Ø—:‘:ÐØˆr9   c                ó,   — t        | j                  «      S r4   )ÚstrrT   rB   s    r7   Ú__str__zNumArgs.__str__Ö   s   € Ü�4—6‘6‹{Ðr9   )NNF)rw   úTypeView[Any]rx   r…   r^   zArg[Any] | Noner=   úArgActionType | Noner_   úlist[str] | Literal[False]rE   rQ   )rd   úint | NumArgs | NonerE   z
int | None)rE   r…   )rF   rG   rH   rI   rT   Ú__annotations__rV   rW   rK   r[   ri   Ústaticmethodrƒ   r†   rM   r9   r7   rQ   rQ   g   s«   … ñð: €A€sƒJØ€HˆdÓØ€GˆSÓàñó ðð ð
  $Ø'+Ø+0ð>à ð>ð ð>ð ð	>ð
 %ð>ð )ð>ð 
ò>ó ð>ð@ òó ðôr9   rQ   c                  óÜ   — e Zd ZU dZ ej
                  dd¬«      Zded<   dZded	<    ej
                  d
d¬«      Z	ded<   dZ
ded<   dZded<   ed„ «       Zdd„Ze	 d	 	 	 	 	 	 	 dd„«       Zy
)ÚGroupa5  Object used to control argument/subcommand grouping in generated help text.

    Note, when implicit group syntax is used, exclusive groups are automatically inferred,
    and the group identity is inferred to be the argument's `field_name`. E.g.
    `foo: Annotated[bool, Arg(long="--foo"), Arg(long="--bar")]`.

    Args:
        order: A number representing the relative ordering among different argument
            groups. Groups with the same order will be displayed alphabetically by
            name.
        name: The display name of the group in help text.
        exclusive: Used to control whether items in the group are mutually exclusive with each other.
            If `True`, the name of the group will be used to control group identity. If a string
            is provided, items with the same exclusive string will be considered part of the same
            exclusivity group.
        section: A secondary level of ordering. Sections have a higher order precedence
            than ``order``, in order to facilitate meta-ordering amongst kinds of groups
            (such as "meta" arguments (``--help``, ``--version``, etc) and subcommands).
            The default ``section`` for any normal argument/``Group`` is 0, for
            ``Subcommand`` it is 1, and for "meta" arguments it is 2.

    Examples:
        A non-exclusive group which just affects helptext display grouping
        >>> arg = Arg(group=Group(name="Colors"))

        An exclusive group, in which all "Colors"-named arguments are mutually exclusive
        >>> arg = Arg(group=Group(name="Colors", exclusive=True))

        An exclusive group, in which all "colors"-identity arguments are mutually exclusive,
        but whose helptext is grouped alongside all other "Options".
        >>> arg = Arg(group=Group(name="Options", exclusive="colors"))
    r   F)rW   ÚcomparerS   ÚorderÚ r…   ÚnameNTzbool | str | NoneÚ	exclusiveÚsectionÚidc                óp   — | j                   | j                  | j                  t        | j                  «      fS r4   )r”   r�   r’   rU   r“   rB   s    r7   Úkeyz	Group.key  s&   € à—‘˜dŸj™j¨$¯)©)´T¸$¿.¹.Ó5IÐJÐJr9   c           	     óè  — dg}t        j                  | «      D ]k  }|j                  s|j                  dk7  rŒt	        | |j                  «      }t	        ||j                  «      }||k7  sŒQ|j                  |j                  «       Œm |D �cg c]  }|› dt	        | |«      ›�‘Œ }}|D �cg c]  }|› dt	        ||«      ›�‘Œ }}ddj                  |«      › ddj                  |«      › d�S c c}w c c}w )z¾Return a string showing only the attributes that differ between two Groups.

        Returns a string in the format:
        "Group(attr=value, ...) != Group(attr=other_value, ...)"
        r•   Ú=zGroup(r`   z) != Group(Ú))ÚdataclassesÚfieldsr�   r’   Úgetattrr.   rn   )	rC   ÚotherÚdiffering_attrsÚfieldÚ
self_valueÚother_valueÚattrÚ
self_partsÚother_partss	            r7   Údiffz
Group.diff  sô   € ð '+ VˆÜ ×'Ñ'¨Ö-ˆEØ—=’= U§Z¡Z°4Ò%7Øä   u§z¡zÓ2ˆJÜ! %¨¯©Ó4ˆKØ˜[Ó(Ø×&Ñ& u§z¡zÕ2ð .ñ ETÓTÁO¸D˜˜˜a¤¨¨dÓ 3Ð6Ò7ÀOˆ
ÐTÙFUÓVÁo¸d˜$˜˜q¤¨°Ó!5Ð 8Ò9ÀoˆÐVà˜Ÿ	™	 *Ó-Ð.¨k¸$¿)¹)ÀKÓ:PÐ9QÐQRÐSÐSùò UùÚVs   ÂC*Â)C/c                óT  — d}d }d}t        |j                  t        «      r„|j                  j                  }|j                  j                  }|j                  j
                  r|j                  j
                  }|j                  j                  �|j                  j                  }t        |j                  t        «      r|j                  }t        |j                  t        «      r|j                  \  }}|€	|rd}nd}d}t        |t        «      r|}n|} | ||t        |«      ||¬«      S )Nr   ÚOptionsÚ	ArgumentsrR   )r’   r�   r“   r”   r•   )
r;   ÚgrouprŽ   r�   r”   r’   r“   r…   rv   rU   )r6   r^   Ú	is_optionr“   r�   r’   r”   Úidentitys           r7   ri   zGroup.infer  sñ   € ð ˆØˆØˆä�c—i‘i¤Ô'Ø—I‘I—O‘OˆEØ—i‘i×'Ñ'ˆGà�y‰y�~Š~Ø—y‘y—~‘~�Ø�y‰y×"Ñ"Ð.ØŸI™I×/Ñ/�	ä�c—i‘i¤Ô%Ø—9‘9ˆDä�c—i‘i¤Ô'ØŸ)™)‰KˆE�4àˆ<ÙØ ‘à"�Ø�ä�i¤Ô%Ø ‰HàˆHáØØÜ˜9“oØØô
ð 	
r9   )rž   rŽ   rE   r…   ©F)r^   úArg[Any]r«   rU   r“   ú
bool | strrE   rŽ   )rF   rG   rH   rI   r›   r    r�   r‹   r’   r“   r”   r•   r   r—   r¦   rK   ri   rM   r9   r7   rŽ   rŽ   Ú   s²   … ñðB #�×"Ñ"¨1°eÔ<€Eˆ3Ó<Ø€Dˆ#ƒNØ#4 ;×#4Ñ#4¸TÈ4Ô#P€IÐ ÓPØ€GˆSÓØ€BˆƒLàñKó ðKóTð* ð
 !&ð	+
àð+
ð ð+
ð ð	+
ð
 
ò+
ó ñ+
r9   rŽ   c                  óà  — e Zd ZU dZd„ ZeZded<   dZded<   dZ	ded<   dZ
d	ed
<   eZded<   dZded<   dZded<   dZd	ed<   eZded<   dZd	ed<   dZded<   dZded<   dZded<   dZded<   dZded <   eZded!<   dZd"ed#<   dZd$ed%<   dZd	ed&<   dZd'ed(<   dZded)<   dZd*ed+<   e	 	 	 	 d/	 	 	 	 	 	 	 	 	 	 	 	 	 d0d,„«       Zdddedddddddf	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d1d-„Zed.„ «       Z y)2ÚArgaõ  Describe a CLI argument.

    Arguments:
        value_name: Placeholder for the argument's value in the help message / usage.
            Defaults to the name of the corresponding class field.
        short: If `True`, uses first letter of the name to infer a (ex. `-s`) short
            flag. If a string is supplied, that will be used instead. If a string is supplied,
            it is split on '/' (forward slash), to support multiple options. Additionally
            accepts a list of strings.
        long: If `True`, uses first letter of the name to infer a (ex. `--long`) long
            flag. If a string is supplied, that will be used instead. If a string is supplied,
            it is split on '/' (forward slash), to support multiple options. Additionally
            accepts a list of strings.
        count: If `True` the resultant argument will count instances and accept zero
            arguments.
        default: An explicit default CLI value. When left unspecified, the default is
            inferred from the class' default or the adapter default/default_factory.
            Note, if the default value is used, it will not be coerced into the annotated
            type through the `parse` method.
        help: By default, the help text will be inferred from the containing class'
            arguments' section, if it exists. Alternatively, you can directly supply
            the help text here.
        parse: Optional function(s) which accepts the raw argument as input and
            return the parsed value. This can be either a single function, or a sequence of functions.
            If a sequence is provided, they will be called (in order) with their return value
            chained into the next function in the sequence.
        parse_inference: Whether to include the default inferred parser for the annotated.

        group: Optional group names for the argument. This affects how they're displayed
            in the backend's help text. Note this can also be a `Group` instance in order
            to control group order and/or group exclusivity.
        hidden: Whether the argument should be hidden in help text. Defaults to False.

        action: Generally automatically inferred from the data type. This allows to
            override the default.
        num_args: Generally automatically inferred from the data type. This allows to
            override the default.
        choices: Generally automatically inferred from the data type. This allows to
            override the default.
        completion: Used to provide custom completions. If specified, should be a function
            which accepts a partial string value and returns a list of
            [cappa.Completion](cappa.Completion) objects.
        required: Defaults to automatically inferring requiredness, based on whether the
            class's value has a default. By setting this, you can force a particular value.
        field_name: The name of the class field to populate with this arg. In most usecases,
            this field should be left unspecified and automatically inferred.
        deprecated: If supplied, the argument will be marked as deprecated. If given `True`,
            a default message will be generated, otherwise a supplied string will be
            used as the deprecation message.
        show_default: Whether to show the default value in help text. Defaults to `True`.
        destructure: When set, destructures the annotated type into current-level arguments.
            Generally prefer to use `field: Destructured[T]` syntax to setting this directly.
            See `Arg.destructure`.
        has_value: Whether the argument has a value that should be saved back to the destination
            type. For most `Arg`, this will default to `True`, however `--help` is an example
            of an `Arg` for which it is false.
        propagate: Specifies that an argument can be matched to all child. Global arguments only
            propagate down. When used at the top-level, in effect it creates a "global" argument.
    c                ó   — t        | «      S r4   )r•   rB   s    r7   Ú__hash__zArg.__hash__‰  s   € Ü�$‹xˆr9   zstr | EmptyTypeÚ
value_nameFzbool | str | list[str] | Noners   r_   rU   r/   zDefault | T | EmptyType | NonerW   Nú
str | Noner0   z6Callable[..., T] | Sequence[Callable[..., Any]] | Nonere   TÚparse_inferencez)str | tuple[int, str] | Group | EmptyTyperª   Úhiddenrˆ   r=   rŠ   rd   úlist[str] | NoneÚchoicesz&Callable[..., list[Completion]] | Noner2   úbool | NonerV   rx   r¯   Ú
deprecatedzbool | str | DefaultFormatterÚshow_defaultÚ	propagateúDestructure | bool | NoneÚdestructureÚ	has_valueúTypeView[Any] | Nonerw   c                óŽ  — t        || «      xs t        «       g}t        |«      dkD  r|j                  nd}t        |t        «      }	|	r|	d   j
                  n|}t        |t        «      }
|
r|
d   nd }t        |t        «      }|r|}g }t        |d¬«      D ]›  \  }}t        ||«      }t        ||||«      }|j                  ||||||||||t        |«      k(  r|j                  nd¬«
      }|j                  r*|j                  |j                  j                  «       «       Œ‹|j!                  |«       Œ� t#        t%        |«      «      S )NrR   Fr   )Ústart)	Úfallback_helpÚdefault_shortÚdefault_longr“   rx   rW   Ústater¿   r¼   )r&   r±   rl   r’   r"   Údocumentationr(   r   Ú	enumerateÚinfer_field_nameÚinfer_defaultÚ	normalizer¼   r¿   ÚextendÚexplode_argsr.   ru   Úexplode_negated_bool_args)r6   r    rw   rÄ   rÅ   rÆ   rÇ   rr   r“   ÚdocsÚdestructure_Údestructure_annotationÚfield_metadataÚresultÚir^   rx   rW   Únormalized_args                      r7   ÚcollectzArg.collect§  sA  € ô  0°	¸3Ó?ÒJÄCÃEÀ7ˆä"% d£)¨a¢-�E—J’J°Uˆ	ä.¨y¼#Ó>ˆÙ15˜˜Q™×-Ò-¸=ˆä*:¸9ÄkÓ*Rˆá+ˆL˜ŠO°ð 	ô
 *DÀEÌ3Ó)OˆÙØ!ˆDà>@ˆÜ ¨A×.‰FˆAˆsô *¨#¨uÓ5ˆJÜ# C¨°EÐ;QÓRˆGà Ÿ]™]ØØ+Ø+Ø)Ø#Ø%ØØØ2Ø12´c¸$³i²˜S×-Ò-ÀUð +ó ˆNð ×)Ò)Ø—‘˜n×8Ñ8×EÑEÓGÕHà—‘˜nÕ-ð/ /ô2 Ô-¨fÓ5Ó6Ð6r9   c                ó`  — |€t        t        «      }t        j                  || j                  «      }t        t        |xs | j                  «      }t        | ||«      }t        | |||«      }t        | |«      }|xs t        | |||«      }t        j                  ||| ||¬«      }t        | j                  || j                   |«      }t#        | ||	¬«      }t%        | |«      }t'        | |«      }t(        j                  | t+        |xs |«      |«      }t-        | ||«      }t/        | |«      }| j0                  r|s|st3        d«      ‚t5        j6                  |�|n| j8                  «      }t;        j<                  |||
xs | j>                  |||¬«      }
tA        di d| jB                  “d| jD                  “d| jF                  “d| j0                  “d	| jH                  “d
|“d|“d|“d|“d|“d|“d|“d|“d|“d|“d|“d|“d|“d|“d|
“d|“d|“Ž}tK        |||t+        | jL                  «      ¬«       |S )Nr]   ©rÇ   zK`Arg.propagate` requires a non-positional named option (`short` or `long`).)rÅ   rÆ   r/   r·   r»   r½   r¶   r´   rs   r_   rW   r0   re   rª   r=   rd   r¹   r2   rV   rx   r¼   r¿   rÀ   rw   ©Úhas_custom_parserM   )'r!   r   r   Úfallback_fromrW   r   r…   rx   Úinfer_shortÚ
infer_longÚinfer_choicesÚinfer_actionrQ   ri   Úinfer_requiredrV   rd   Úinfer_parseÚ
infer_helpÚinfer_completionrŽ   rU   Úinfer_value_nameÚinfer_has_valuer½   ro   r   Úfrom_unknownr¼   r(   r×   r¿   ÚFinalArgr/   r·   r»   r¶   Úverify_type_compatibilityre   )rC   rw   rÄ   r=   rW   rx   rÅ   rÆ   r“   rÇ   r¿   r¼   rs   r_   r¹   rd   rV   re   r0   r2   rª   r´   rÀ   Údefault_formatterrÔ   s                            r7   rÌ   zArg.normalizeÞ  sœ  € ð ÐÜ ¤›ˆIä×'Ñ'¨°·±Ó>ˆäœ#˜zÒ<¨T¯_©_Ó=ˆ
ä˜D *¨mÓ<ˆÜ˜$ 	¨:°|ÓDˆÜ  iÓ0ˆØÒGœ<¨¨i¸¸wÓGˆÜ—=‘=Ø�z t°FÀð !ó 
ˆô " $§-¡-°¸4¿=¹=È'ÓRˆä˜D )°5Ô9ˆÜ˜$ Ó.ˆÜ% d¨GÓ4ˆ
ä—‘˜D¤$ u¢}°Ó"5°yÓAˆä% d¨J¸ÓAˆ
Ü# D¨&Ó1ˆ	à�>Š>¡%±ÜØ]óð ô /?×.KÑ.KØ(Ð4‰L¸$×:KÑ:Kó/
Ðô "×)Ñ)ØØØÒ+˜4×+Ñ+ØØ'Ø%ô
ˆô !)ò !
à—*’*ð!
ð —;’;ð!
ð —’ð	!
ð
 —n’nð!
ð !×0Ò0ð!
ñ "ð!
ñ ð!
ñ ð!
ñ ð!
ñ ð!
ñ ð!
ñ ð!
ñ ð!
ñ  ð!!
ñ" ð#!
ñ$ "ð%!
ñ& ð'!
ñ( "ð)!
ñ* +ð+!
ñ, $ð-!
ñ.  ð/!
ñ0  ð1!
ˆô4 	"Ø�J 	¼DÀÇÁÓ<Lõ	
ð ˆr9   c                ó$   —  | t        «       ¬«      S )zNMark a an argument as destructured. See also the shorter `Destructured` alias.©r¿   r'   r5   s    r7   ÚdestructuredzArg.destructured6  s   € ñ œ{›}Ô-Ð-r9   )NFFN)r    r   rw   r‡   rÄ   rµ   rÅ   rU   rÆ   rU   rÇ   úState[Any] | NonerE   z+list[FinalArg[Any] | FinalDestructure[Any]])rw   rÁ   rÄ   rµ   r=   rˆ   rW   r   rx   rµ   rÅ   rU   rÆ   rU   r“   r¯   rÇ   rî   r¿   r¾   r¼   z$bool | str | DefaultFormatter | NonerE   úFinalArg[Any])!rF   rG   rH   rI   r³   r   r´   r‹   rs   r_   r/   rW   r0   re   r¶   rª   r·   r=   rd   r¹   r2   rV   rx   r»   r¼   r½   r¿   rÀ   rw   rK   r×   rÌ   rí   rM   r9   r7   r±   r±   K  s  … ñ:òxð #(€J�Ó'Ø+0€EÐ(Ó0Ø*/€DÐ
'Ó/Ø€Eˆ4ÓØ.3€GÐ+Ó3Ø€Dˆ*ÓØDH€EÐAÓHØ €O�TÓ à7<€EÐ4Ó<à€FˆDÓØ#'€FÐ Ó'Ø%)€HÐ"Ó)Ø $€GÐÓ$Ø9=€JÐ6Ó=Ø €HˆkÓ Ø"'€J�Ó'Ø"€J�
Ó"Ø26€LÐ/Ó6Ø€IˆtÓà-1€KÐ*Ó1Ø!€Iˆ{Ó!à&*€IÐ#Ó*àð
 %)Ø#Ø"Ø#'ð47àð47ð !ð47ð "ð	47ð
 ð47ð ð47ð !ð47ð 
5ò47ó ð47ðp +/Ø$(Ø'+ØØ!%Ø#Ø"Ø %Ø#'Ø15Ø=AðVà'ðVð "ðVð %ð	Vð
 ðVð ðVð ðVð ðVð ðVð !ðVð /ðVð ;ðVð 
óVðp ñ.ó ñ.r9   r±   c                  ó  — e Zd ZU dZdZded<   dZded<   dZded<    ej                  e
¬	«      Zd
ed<    ej                  e¬	«      Zded<   ej                  Zded<    ej                  e¬	«      Zded<   dZded<   dZded<   dZded<    ej                  d„ ¬	«      Zded<    ej                  e¬«      Zded<    ej                  e¬	«      Zded<   dZd ed!<   	 	 d(	 	 	 	 	 	 	 	 	 d)d"„Zd#d$œd*d%„Zd+d#d$œd,d&„Zed-d'„«       Z y).rè   zÞPost-normalization form of :class:`Arg` with narrowed field types.

    Produced exclusively by :meth:`Arg.normalize`. After normalization all
    previously-optional/Empty fields are guaranteed to be concrete values.
    r‘   r…   r´   Fr‰   rs   r_   )Údefault_factoryr   rW   rŽ   rª   rN   r=   rQ   rd   rU   rV   rx   TrÀ   c                 ó    — t        t        «      S r4   )r!   r   rM   r9   r7   Ú<lambda>zFinalArg.<lambda>N  s	   € ÌÔRUÌr9   r‡   rw   ©rW   úCallable[..., Any]re   r   r¼   NzFinalDestructure[Any] | Noner¿   c                óÈ   — | j                   }||v rd||   }}n| j                  ||¬«      \  }}t        | j                  ||| j	                  «       «      }t        |||f¬«      S )NF)rÇ   Úinput)rr   )rx   rW   r   re   Ú	names_strr   )	rC   ÚprogÚparsed_argsrÇ   r÷   rx   Ú	is_parsedÚvalueÚhandlers	            r7   Ú
map_resultzFinalArg.map_resultS  sg   € ð —_‘_ˆ
Ø˜Ñ$Ø$ k°*Ñ&=�u‰Ià#Ÿ|™|°%¸u˜|ÓEÑˆI�uÜ §
¡
¨D°%¸¿¹Ó9IÓJˆÜ˜ u¨iÐ&8Ô9Ð9r9   r   rZ   c               óV   — | j                   xs g | j                  xs g z   }|r|d | S |S r4   )rs   r_   )rC   rT   rÔ   s      r7   ÚnameszFinalArg.namesb  s0   € Ø—*‘*Ò"  t§y¡y¢°BÑ7ˆÙˆv�b�qˆzÐ* FÐ*r9   c               óŒ   — | j                   s| j                  r!|j                  | j                  |¬«      «      S | j                  S )NrZ   )rs   r_   rn   r   r´   )rC   Ú	delimiterrT   s      r7   rø   zFinalArg.names_strf  s2   € Ø�:Š:˜ŸšØ—>‘> $§*¡*¨q *£/Ó2Ð2Ø�‰Ðr9   c                óH   — t        | j                  xs | j                  «      S r4   )rU   rs   r_   rB   s    r7   r«   zFinalArg.is_optionk  s   € ä�D—J‘JÒ+ $§)¡)Ó,Ð,r9   ©NN)
rù   r…   rú   zdict[str, Any]rÇ   rî   r÷   zTextIO | NonerE   zResolved[T])rT   rS   rE   z	list[str])r`   )r  r…   rT   rS   rE   r…   )rE   rU   )!rF   rG   rH   rI   r´   r‹   rs   r_   r›   r    r   rW   rŽ   rª   r*   rJ   r=   rQ   rd   rV   rx   rÀ   rw   r   re   r   r¼   r¿   rþ   r   rø   r   r«   rM   r9   r7   rè   rè   <  sU  … ñð €J�ÓØ(-€EÐ%Ó-Ø',€DÐ
$Ó,Ø(�{×(Ñ(¸ÔA€GˆWÓAØ$�;×$Ñ$°UÔ;€Eˆ5Ó;Ø%ŸM™M€FˆMÓ)Ø)˜×)Ñ)¸'ÔB€HˆgÓBØ€HˆdÓØ€J�ÓØ€IˆtÓØ0˜{×0Ñ0ÑAVÔW€Iˆ}ÓWØ 1 × 1Ñ 1¸+Ô F€EÐÓFØ%6 [×%6Ñ%6ÐGWÔ%X€LÐ"ÓXØ04€KÐ-Ó4ð $(Ø#ð:àð:ð $ð:ð !ð	:ð
 ð:ð 
ó:ð !"õ +ð¸1õ ð
 ò-ó ñ-r9   rè   FrÚ   c               ó  — | j                   }|st        j                  |«      ry| j                  }|j                  s4|j
                  €(|j                  st        d|› d|j                  › d�«      ‚|j                  rc|j                  «       j                  D �ch c]"  }|j                  t        t        t        f«      ’Œ$ }}t!        |«      dkD  rt        d|› d�«      ‚y|j                  t        t        t        f«      rC|j"                  dv r4|t        j$                  dhvrt        d|› d|j                  › d	|› d
�«      ‚yy|j"                  dvs|t        j$                  u r"t        d|› d|j                  › d|› d|› d
�	«      ‚yc c}w )a  Verify classes of annotations are compatible with one another.

    Thus far:
        * Sequence and scalar types should not be mixed, unless an explicit `parse`
          is provided. Otherwise, they will always result in sequence-type results
          which will not map correctly to scalar types.

        * num_args!=1 should only be used with sequence types.
        * ArgAction.append should only be used with sequence types.
        * Non-required argument values with a None default must be Optional in the type annotation.
    Nrb   z`', `NumArgs(required=False, default=None)` requires the annotated type to include `None` (e.g. `zX | None`), since the absent-value default of `None` is not assignable to the field type.rR   a!  ', apparent mismatch of annotated type with `Arg` options. Unioning "sequence" types with non-sequence types is not currently supported, unless using `Arg(parse=...)` or `Arg(action=<callable>)`. See [documentation](https://cappa.readthedocs.io/en/latest/annotation.html) for more details.>   r   rR   z<', apparent mismatch of annotated type with `Arg` options. 'z9' type produces a sequence, whereas `num_args=1`/`action=zg` do not. See [documentation](https://cappa.readthedocs.io/en/latest/annotation.html) for more details.>   Nr   rR   z,' type produces a scalar, whereas `num_args=z
`/`action=)r=   r*   r>   rd   rV   rW   Úis_optionalro   Ú	repr_typerf   Ústrip_optionalrg   rt   ru   rv   rJ   rl   rT   r.   )r^   rx   rw   rÛ   r=   rd   ÚtaÚall_same_aritys           r7   ré   ré   p  sÚ  € ð$ �Z‰Z€FÙœ9×.Ñ.¨vÔ6Øà�|‰|€HØ×Ò ×!1Ñ!1Ð!9À)×BWÒBWÜØ˜˜ð %7Ø7@×7JÑ7JÐ6Kð L\ð\ó
ð 	
ð ×Òð  ×.Ñ.Ó0×<Ò<ó
á<�ð ×Ñœt¤U¬CÐ0Õ1Ø<ð 	ð 
ô ˆ~Ó Ò"ÜØ˜Z˜Lð )pð póð ð 	à×Ñ¤¤u¬cÐ 2Ô3Ø�:‰:˜Ñ F´9×3CÑ3CÀTÐ2JÑ$JÜØ˜Z˜Lð )Ø×'Ñ'Ð(Ð(aÐbhÐaið jpðpóð ð %KÐð �:‰:˜\Ñ)¨V´y×7GÑ7GÑ-GÜØ˜Z˜Lð )Ø×'Ñ'Ð(Ð(TÐU]ÐT^Ð^hÐioÐhpð qpðpóð ð .Hùò+
s   Â'Fc                óT   — | j                   t        urt        d«      ‚|j                  S )Nz8Arg 'name' cannot be set when using automatic inference.)rx   r   ro   r’   )r^   r    s     r7   rÊ   rÊ   ¬  s$   € Ø
‡~�~œUÑ"ÜÐSÓTÐTà�:‰:Ðr9   c                óÔ  — |r[t        | ||¬«      }|j                  t        ur||j                  z  S |j                  t        ur|t	        |j                  «      z  S |S | j                  }|t        urt        j                  |«      S |j                  rt        d ¬«      S |rt        t	        |j                  «      «      S |j                  t        «      rt        d¬«      S t        «       S )Nrì   rô   F)rË   rW   r   rñ   r   r   Ú
from_valuer  Ú
annotationrt   rU   )r^   rw   r    r¿   Úinferred_defaultrW   s         r7   rË   rË   ³  sÐ   € ñ Ü$1Ø�¨ô%
Ðð �=‰=¤Ñ%Ø# e§m¡mÑ3Ð3à× Ñ ¬Ñ-Ø#¤i°×0EÑ0EÓ&FÑFÐFàÐà�k‰k€GØ”eÑÜ×!Ñ! 'Ó*Ð*à×ÒÜ˜tÔ$Ð$áÜ”y ×!5Ñ!5Ó6Ó7Ð7à×Ñ¤Ô%Ü˜uÔ%Ð%ä‹9Ðr9   c                ó€   — | du ry|j                   r-| du rt        d«      ‚t        j                  |«      }|�|dk  ryyy)NTFz¡When specifying `required=False`, a default value must be supplied able to be supplied through type inference, `Arg(default=...)`, or through class-level defaultr   )rÀ   ro   rQ   rƒ   )rV   rd   Úraw_num_argsrW   rƒ   s        r7   rá   rá   Ö  sX   € ð �4ÑØà×ÒØ�uÑÜðfóð ô —‘˜lÓ+ˆØÐ ¨¢ØàØr9   c                óü   — | j                   xs |}|syt        |t        «      r|d   }d|› �gS t        |t        «      r|j	                  d«      }n|}|D �cg c]  }|j                  d«      r|nd|› �‘Œ c}S c c}w )NFr   Ú-Ú/)rs   r;   rU   r…   ÚsplitÚ
startswith)r^   r’   rW   rs   Ú
short_nameÚitems         r7   rÝ   rÝ   ñ  s†   € ð �I‰IÒ ˜€EÙØä�%œÔØ˜!‘Wˆ
Ø�J�<Ð Ð!Ð!ä�%œÔØ—‘˜CÓ ‰àˆáEJÓKÁU¸T�D—O‘O CÔ(‰D°°$°¨jÑ8ÀUÑKÐKùÒKs   ÁA9c                ó>  — | j                   xs |}|s|j                  t        «      syd}t        |t        «      r|j	                  dd«      }d|› �gS t        |t
        «      r|j                  d«      }|D �cg c]  }|j                  d«      r|nd|› �‘Œ c}S c c}w )NFTÚ_r  z--r  )r_   rt   rU   r;   Úreplacer…   r  r  )r^   rw   r’   rW   r_   r  s         r7   rÞ   rÞ     s˜   € ð �8‰8Ò�w€Dáà×'Ñ'¬Ô-Øàˆä�$œÔØ�|‰|˜C Ó%ˆØ�T�F�ˆ}Ðä�$œÔØ�z‰z˜#‹ˆáGKÓLÁt¸t�D—O‘O DÔ)‰D°°D°6¨{Ñ:ÀtÑLÐLùÒLs   Á8Bc                óŒ   — | j                   €t        |«      }n| j                   }|sy |D �cg c]  }t        |«      ‘Œ c}S c c}w r4   )r¹   r%   r…   )r^   rw   r¹   Úcs       r7   rß   rß     sA   € Ø
‡{�{ÐÜ  Ó+‰à—+‘+ˆáØá#Ó$™G�qŒC��F˜GÑ$Ð$ùÒ$s   ¬Ac                óÒ  — | j                   rt        j                   S | j                  �| j                  S |j                  «       }|j	                  t
        «      rG|j                  t        ur%t        |j                  «      rt        j                  S t        j                  S | j                  d u}| j                  d u}| j                   xr | }t        j                  | j                  «      }|dk(  }|s|s|r|r|r|dk7  rt        j                  S |j!                  t"        t        f«      rt        j$                  S |j&                  rt        j$                  S t        j                  S )NrY   rR   )r/   r*   r=   r  rt   rU   rW   r   r-   r,   re   rd   rs   rQ   rƒ   rJ   Úis_subtype_ofru   r.   rq   )	r^   rw   r_   rW   rÛ   Úhas_custom_num_argsr   rƒ   Úis_unboundeds	            r7   rà   rà   &  s  € ð ‡y‚yÜ�‰Ðà
‡z�zÐØ�z‰zÐà×(Ñ(Ó*€Ið ×Ñ¤Ô%Ø�?‰?¤%Ñ'¬D°·±Ô,AÜ×(Ñ(Ð(ä×#Ñ#Ð#à—y‘y¨Ð,ÐØŸ,™,¨dÐ2ÐàŸ	™	�MÒ.¨$ h€MÜ�M‰M˜#Ÿ,™,Ó'€EØ˜B‘;€Lñ 	ÙÙÑ"5Ù E¨Q¢Jä�}‰}Ðà×Ñ¤¤c˜{Ô+Ü×ÑÐà×"Ò"Ü×ÑÐä�=‰=Ðr9   c                ó|  — | j                   }t        |«      }g }|r-t        |t        «      rg t	        t        t
           |«      ¢}n|g}| j                  rIt        t        | j                  «         }t        |«      }t	        t        t        t
              g |¢|‘«      }| j                  rg |¢|‘}t        |||¬«      S )NrÙ   )re   r   r;   r   r   r   r¹   r
   rv   r   r   r¶   r   )r^   rw   rÇ   re   Údefault_parseÚparsersÚliteral_typeÚliteral_parses           r7   râ   râ   S  s²   € ð 25·±€EÜ 	Ó*€Mð &(€GÙÜ�eœXÔ&Ø3œœX¤c™]¨EÓ2Ð3‰Gà�gˆGà
‡{‚{Üœu S§[¡[Ó1Ñ2ˆÜ%2°<Ó%@ˆÜ”x¤¤s¡Ñ,Ð.G°Ð.G¸Ð.GÓHˆà
×ÒØ+�GÐ+˜]Ð+ˆä˜' 9°EÔ:Ð:r9   c                ó&   — | j                   }|€|}|S r4   ©r0   )r^   rÄ   r0   s      r7   rã   rã   m  s   € Ø�8‰8€DØ€|Øˆà€Kr9   c                óf   — | j                   r| j                   S |rt        || j                  ¬«      S y )Nr(  )r2   r   r0   )r^   r¹   s     r7   rä   rä   u  s,   € ð ‡~‚~Ø�~‰~ÐáÜ ¨c¯h©hÔ7Ð7àr9   c                óž   — | j                   t        ur| j                   S |j                  dkD  rdj                  |g|j                  z  «      S |S )NrR   Ú )r´   r   rT   rn   )r^   rx   rd   s      r7   rå   rå   �  sC   € Ø
‡~�~œUÑ"Ø�~‰~Ðà‡z�z�A‚~Ø�x‰x˜˜ x§z¡zÑ1Ó2Ð2àÐr9   c           	   #  óÞ  K  — | D �]Y  }t        |t        «      s|–— Œd}t        |j                  t        «      �r|j                  j                  �r|j
                  rù|j
                  }|D �cg c]	  }d|v sŒ|‘Œ }}|D �cg c]	  }d|vsŒ|‘Œ }}|rÃ|rÁt        |j                  t        «      sJ ‚t        j                  «       }t        j                  |j                  d|j                  ¬«      }t        j                  ||t        j                  ||d¬«      }	t        j                  ||t        j                  |j                   |¬«      }
|	–— |
–— d}|r�ŒV|–— �Œ\ yc c}w c c}w ­w)zòExpand `--foo/--no-foo` solo arguments into dual-arguments.

    Acts as a transform from `Arg(long='--foo/--no-foo')` to
    `Annotated[Arg(long='--foo', action=ArgAction.store_true), Arg(long='--no-foo', action=ArgAction.store_false)]`
    Fz--no-T)r“   r•   N)r_   r=   r¼   rª   r0   )r_   r=   r¼   rª   )r;   rè   r=   r*   rD   r_   rW   r   r   Údisabledr›   r  rª   rx   r,   r-   r¼   )rr   r^   Úyieldedr_   r  Ú	negativesÚ	positivesr-  rª   Úpositive_argÚnegative_args              r7   rÏ   rÏ   ‹  sK  è ø€ ô ˆä˜#œxÔ(ØŠIØàˆÜ�c—j‘j¤)Õ,°·±×1JÓ1JÈsÏxÊxØ—8‘8ˆDá*.ÓB©$ $°'¸T²/š¨$ˆIÐBÙ*.ÓF©$ $°'ÀÒ2Eš¨$ˆIÐFÙ™YÜ! #§+¡+¬wÔ7Ð7Ð7ä-=×-FÑ-FÓ-H�Ü#×+Ñ+Ø—I‘IØ"Ø—~‘~ô�ô  +×2Ñ2ØØ"Ü$×/Ñ/Ø!)ØØô �ô  +×2Ñ2ØØ"Ü$×0Ñ0Ø!$×!1Ñ!1Øô �ð #Ò"Ø"Ò"Ø�ãØŒIñW ùò CùÚFùs1   ‚A,E-Á.	E#Á8E#Á<E-Â	E(ÂE(ÂC	E-ÅE-c                ó‚   — | j                   �| j                   S t        |t        «      r|t        j                  «       v ryy)NFT)rÀ   r;   r*   r8   )r^   r=   s     r7   ræ   ræ   Á  s6   € Ø
‡}�}Ð Ø�}‰}Ðä�&œ)Ô$¨´9×3IÑ3IÓ3KÑ)KØàr9   )r(   ÚFinalDestructure)r^   rï   rx   r…   rw   r‡   rÛ   rU   )r^   r®   r    r   rE   r…   r  )
r^   r®   rw   r‡   r    zField | Noner¿   zDestructure | NonerE   r   )rV   rº   rd   rQ   r  rŠ   rW   r   r­   )r^   r®   r’   r…   rW   rU   rE   r‰   )
r^   r®   rw   r‡   r’   r…   rW   rU   rE   r‰   )r^   r®   rw   r‡   rE   r¸   )
r^   r®   rw   r‡   r_   r‰   rW   r   rE   rN   r4   )r^   r®   rw   r‡   rÇ   rî   rE   rõ   )r^   r®   rÄ   rµ   rE   rµ   )r^   r®   r¹   r¸   rE   z(Callable[[str], list[Completion]] | None)r^   r®   rx   r…   rd   rQ   rE   r…   )rr   z/Sequence[FinalArg[Any] | FinalDestructure[Any]]rE   z/Iterable[FinalArg[Any] | FinalDestructure[Any]])r^   r®   r=   rN   )OrI   Ú
__future__r   r›   ÚenumÚ	functoolsr   Útypingr   r   r   r   r	   r
   r   r   r   r   r   Útyping_extensionsr   Úcappa.class_inspectr   r   Úcappa.completion.completersr   Úcappa.completion.typesr   Úcappa.defaultr   r   r   Úcappa.invoke.typesr   Úcappa.parser   r   r   r   r   Úcappa.stater   Úcappa.type_viewr   r    r!   Úcappa.typingr"   r#   r$   r%   r&   Úcappa.destructurer(   ÚuniqueÚEnumr*   rN   r‹   Ú	dataclassrQ   rŽ   r±   rè   ré   rÊ   rË   rá   rÝ   rÞ   rß   rà   râ   rã   rä   rå   rÏ   ræ   r4  rM   r9   r7   Ú<module>rG     s  ðÚ Nå "ã Û Ý %÷÷ ÷ ñ õ (ç AÝ 8Ý -ß >Ñ >Ý '÷õ õ ß 6Ñ 6÷õ ñ Ý-ð ‡�ô.;�—	‘	ó .;ó ð.;ðb ! ¨H°S¸#°XÑ,>Ð!>Ñ?€ˆyÓ ?ð €×Ñ˜dÔ#÷oð oó $ðoðd €×Ñ˜dÔ#÷m
ð m
ó $ðm
ð` €×Ñ˜dÔ#ôm.ˆ'�!‰*ó m.ó $ðm.ð` €×Ñ˜dÔ#ô0-ˆs�1‰vó 0-ó $ð0-ðp #ñ9Ø	ð9àð9ð ð9ð
 ó9óxð Ø&*ð	 Ø	ð àð ð ð ð $ð	 ð
 ó ðFØðàðð 'ðð ó	ð8 /4ðLØ	ðLØðLØ'+ðLàóLð&MØ	ðMØ+ðMØ36ðMØAEðMàóMó,	%ð*Ø	ð*àð*ð %ð*ð ð	*ð
 ó*ð\ IMð;Ø	ð;Ø+ð;Ø4Eð;àó;ó4ð	Ø	ð	Ø,ð	à-ó	óð3Ø
9ð3à4ó3ól÷ <Ð ;r9   