
    i                    ,   U d 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mZmZ ddlmZ ddlZddlZddlZddlmZmZmZ dd	lmZmZmZ dd
lm Z  ddl!m"Z" ddl#m$Z$m%Z% ddl&m'Z'm(Z(m)Z) ddl*m+Z+ ddl,m-Z- ddl.m/Z/ ddl0m1Z1 ddl2m3Z3m4Z4 ddl5m6Z6 ddl7m8Z8 dZ9erddl:m;Z;m<Z<m=Z= ddl>m?Z? ddl@mAZA ddlBm(ZC ddlDmEZE ddlFmGZGmHZH ddlImJZJ ddl*mKZK eejL        ejM        ejN        ejO        ejP        f         ZQdeRd<   eeSe3e-e1eGeHee1e-f         ee1e3f         f         ZTdeRd <   ee)e/e1e-e4e3e6eGeHe8f
         ZUdeRd!<    ed"d#d$%          ZV ed&d'd$%          ZW ed(d)*          ZX ed+d,*          ZY ed-d.*          ZZ ed/d0*          Z[ ed1d2*          Z\ ed3d4*          Z]ed5geXf         Z^deRd6<   eejM        ejN        ejO        ejP        f         Z_ ed7          Z`d8eRd7<   dzdAZad{dEZb G dF dGeeW                   Zc G dH dIeceW                   Zd G dJ dKeceW                   Ze G dL dMeceW                   Zf G dN dOeceW                   Zg G dP dQeceW                   Zheede         e$dRdRdRdRdRdRdRdRdS
d|dg            Zieeee         e$dRdRdRdRdRdRdRdRdRdhd}dl            Zieefe         e$dRdRdRdRdRdRdRdRdRdhd~do            Zieehe         e$dRdRdRdRdRdRdRdRdRdhddr            Zieege         e$e$dRdRdRdRdRdRdRdRdhddu            Ziede         e$e$de$dddve$dddhddyZidS )a:  
The MIT License (MIT)

Copyright (c) 2015-present Rapptz

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
    )annotations)AnyListLiteralOptionalTYPE_CHECKINGTupleTypeTypeVarCallableUnionDictoverloadSequence)
ContextVarN   )ItemContainedItemCallbackType_ItemCallback   )ChannelTypeComponentTypeSelectDefaultValueType)PartialEmoji)Emoji)MISSING_human_join)SelectOption
SelectMenuSelectDefaultValue)	Namespace)Member)Object)Role)User
ClientUser)GuildChannel)Thread)Select
UserSelect
RoleSelectMentionableSelectChannelSelectselect)	TypeAlias	TypeGuardSelf)BaseView)	ActionRow)r   )%SelectMessageComponentInteractionDataAppCommandChannelAppCommandThread)Interaction)
ResolveKeyr/   ValidSelectTypePossibleValueValidDefaultValuesSzUnion[BaseView, ActionRow]T)bound	covariantVr2   BaseSelectTzBaseSelect[Any])r>   SelectTzSelect[Any]UserSelectTzUserSelect[Any]RoleSelectTzRoleSelect[Any]ChannelSelectTzChannelSelect[Any]MentionableSelectTzMentionableSelect[Any] ItemCallbackType[S, BaseSelectT]SelectCallbackDecoratorselected_valuesz*ContextVar[Dict[str, List[PossibleValue]]]objr   component_typeDefaultSelectComponentTypestype_to_supported_classes;Dict[ValidSelectType, Tuple[Type[ValidDefaultValues], ...]]return#TypeGuard[Type[ValidDefaultValues]]c                .    t          | ||                   S N)
issubclass)rJ   rK   rM   s      R/usr/local/lib/hermes-agent/venv/lib/python3.11/site-packages/discord/ui/select.py_is_valid_object_typerU   ~   s    
 c4^DEEE    defaultsSequence[ValidDefaultValues]List[SelectDefaultValue]c                   | r	| t           u rg S ddlm}m} t          t
          j        t          t
          j        t          t
          j        t          t
          j
        t          t
          j        |t
          j        |t
          j        t          t
          j        i}t          j        t          t          t          t           ft          j        t          t           ft          j        t          ||t          t           ft          j        t          t          t          t          t           fi}g }| D ]M}t)          |t*                    r|                    |           .t)          |t                     s|j        n|j        }t3          |||          s9t5          d ||         D                       }	t7          d|	 d|j                   |t           u r^|t          j        u rt;          d          |t          j        u rt          }n+|t          j        u rt          }n|t          j        u rt          }t=          |t                    rt          }|                    t+          |j        ||                              O|S )Nr   r5   c                    g | ]	}|j         
S  )__name__).0cs     rT   
<listcomp>z+_handle_select_defaults.<locals>.<listcomp>   s    ,k,k,kAQZ,k,k,krV   zExpected an instance of z not zfObject must have a type specified for the chosen select type. Please pass one using the `type`` kwarg.)idtype) r   app_commandsr6   r7   r%   r   userr"   r&   r$   roler'   channelr(   r   user_selectr#   role_selectchannel_selectmentionable_select
isinstancer    append	__class__rb   rU   r   	TypeErrorr]   
ValueErrorrS   ra   )
rW   rK   r6   r7   cls_to_typerM   valuesrJ   object_typesupported_classess
             rT   _handle_select_defaultsrt      sC     x7**	BBBBBBBB 	$)&+*/$),41908&.	KK 	!D*ff#E!D&>$|5FHXZ`bh&i(4VT6*R	^ (*F T Tc-.. 	MM#+5c6+B+BPcmm$[.B[\\ 	g +,k,kAZ[iAj,k,k,k l le7Hee{Oceefff&  !AAA |    =#<<<"=#<<<"=#???*k<00 	'&K(CF[9QRRRSSSSMrV   c                  n    e Zd ZU dZdZdZded<   dZded<   eddddd	d	eeedd
dG fd!Z	dHd#Z
edId$            Zej        dJd&            ZedKd(            ZedLd)            Zej        dMd*            ZedNd+            Zej        dOd,            ZedPd.            Zej        dQd/            ZedPd0            Zej        dQd1            ZedRd2            Zej        dSd3            ZedRd4            Zej        dSd5            ZedPd6            ZdTd8ZdUd;ZdVdBZdWdCZdRdDZedXdF            Z xZS )Y
BaseSelecta  The base Select model that all other Select models inherit from.

    This class inherits from :class:`Item` and implements the common attributes.

    The following implement this class:

    - :class:`~discord.ui.Select`
    - :class:`~discord.ui.ChannelSelect`
    - :class:`~discord.ui.RoleSelect`
    - :class:`~discord.ui.MentionableSelect`
    - :class:`~discord.ui.UserSelect`

    .. versionadded:: 2.1

    Attributes
    ------------
    row: Optional[:class:`int`]
        The relative row this select menu belongs to. A Discord component can only have 5
        rows. By default, items are arranged automatically into those 5 rows. If you'd
        like to control the relative positioning of the row then passing an index is advised.
        For example, row=1 will show up before row=2. Defaults to ``None``, which is automatic
        ordering. The row number must be between 0 and 4 (i.e. zero indexed).
    )_provided_custom_id_underlyingrow_values)placeholder
min_values
max_valuesdisabledra   zTuple[str, ...]__item_repr_attributes__)	custom_idr{   r|   r}   r~   ra   __component_attributes__NF)r   ry   r{   r|   r}   r~   requiredoptionschannel_typesdefault_valuesra   rb   r:   r   strry   Optional[int]r{   Optional[str]r|   r}   r~   boolr   r   List[SelectOption]r   List[ChannelType]r   Sequence[SelectDefaultValue]ra   rO   Nonec                  t                                                       |t          u| _        |t          u r&t	          j        d                                          n|}t          |t                    st          d|j
        j                   t          j        ||||||||
t          u rg n|
|	t          u rg n|	|t          u rg n||          | _        || _        g | _        d S )N   z!expected custom_id to be str not )rb   r   r{   r|   r}   r~   r   r   r   r   ra   )super__init__r   rw   osurandomhexrk   r   rn   rm   r]   r   _raw_constructrx   ry   rz   )selfrb   r   ry   r{   r|   r}   r~   r   r   r   r   ra   rm   s                rT   r   zBaseSelect.__init__   s      	#,G#; ,5,@,@BJrNN&&(((i	)S)) 	`^	@S@\^^___%4#!! - 8 8""m!W,,BB'!/7!:!:22
 
 
 ,.rV   r1   c                    t          j         |           }t          |j        t                    r||j        _        | j        |_        |                    | j                   |S rR   )copyrk   callbackr   item_parent_update_viewview)r   news     rT   r   zBaseSelect.copy  sQ    iooclM22 	$ #CLl###
rV   c                    | j         j        S )z.Optional[:class:`int`]: The ID of this select.rx   ra   r   s    rT   ra   zBaseSelect.id  s     ""rV   valuec                    || j         _        d S rR   r   r   r   s     rT   ra   zBaseSelect.id  s    #rV   List[PossibleValue]c                v    t                               i           }|                    | j        | j                  S rR   )rI   getr   rz   )r   rq   s     rT   rq   zBaseSelect.values"  s-     $$R((zz$.$,777rV   c                    | j         j        S )zQ:class:`str`: The ID of the select menu that gets received during an interaction.)rx   r   r   s    rT   r   zBaseSelect.custom_id'  s     ))rV   c                t    t          |t                    st          d          || j        _        d| _        d S )Nzcustom_id must be a strT)rk   r   rn   rx   r   rw   r   s     rT   r   zBaseSelect.custom_id,  s<    %%% 	75666%*"#'   rV   c                    | j         j        S )zZOptional[:class:`str`]: The placeholder text that is shown if nothing is selected, if any.)rx   r{   r   s    rT   r{   zBaseSelect.placeholder4  s     ++rV   c                j    |$t          |t                    st          d          || j        _        d S )Nzplaceholder must be None or str)rk   r   rn   rx   r{   r   s     rT   r{   zBaseSelect.placeholder9  s7    Zs%;%;=>>>',$$$rV   intc                    | j         j        S )zS:class:`int`: The minimum number of items that must be chosen for this select menu.)rx   r|   r   s    rT   r|   zBaseSelect.min_values@       **rV   c                8    t          |          | j        _        d S rR   )r   rx   r|   r   s     rT   r|   zBaseSelect.min_valuesE      &)%jj###rV   c                    | j         j        S )zR:class:`int`: The maximum number of items that can be chosen for this select menu.)rx   r}   r   s    rT   r}   zBaseSelect.max_valuesI  r   rV   c                8    t          |          | j        _        d S rR   )r   rx   r}   r   s     rT   r}   zBaseSelect.max_valuesN  r   rV   c                    | j         j        S )z5:class:`bool`: Whether the select is disabled or not.)rx   r~   r   s    rT   r~   zBaseSelect.disabledR  s     ((rV   c                8    t          |          | j        _        d S rR   )r   rx   r~   r   s     rT   r~   zBaseSelect.disabledW      $(KK!!!rV   c                    | j         j        S )zw:class:`bool`: Whether the select is required or not. Only supported in modals.

        .. versionadded:: 2.6
        )rx   r   r   s    rT   r   zBaseSelect.required[  s     ((rV   c                8    t          |          | j        _        d S rR   )r   rx   r   r   s     rT   r   zBaseSelect.requiredc  r   rV   c                    dS )N   r\   r   s    rT   widthzBaseSelect.widthg  s    qrV   SelectMenuPayloadc                4    | j                                         S rR   )rx   to_dictr   s    rT   to_component_dictzBaseSelect.to_component_dictk  s    '')))rV   	componentr   c                    || _         d S rR   )rx   )r   r   s     rT   _refresh_componentzBaseSelect._refresh_componentn  s    $rV   interactionr8   datar4   resolvedDict[ResolveKey, Any]c                    t                               i           }|                    dg           fd|                                D             }|st                    }|x| _        || j        <   t                               |           d S )Nrq   c                ,    g | ]\  }}|j         v |S r\   )ra   )r^   kvstring_valuess      rT   r`   z-BaseSelect._handle_submit.<locals>.<listcomp>w  s)    KKKAQT]5J5J15J5J5JrV   )rI   r   itemslistrz   r   set)r   r   r   r   rq   payloadr   s         @rT   _handle_submitzBaseSelect._handle_submitq  s     !$$R((2..KKKK!1!1KKK 	*=))G077vdn-F#####rV   c                r   t                               i           }	 t          j        ||d                   }t	          |                                          }n3# t          $ r& t	          |                    dg                     }Y nw xY w|x| _        || j        <   t           	                    |           d S )Nr   rq   )
rI   r   r!   _get_resolved_itemsr   rq   KeyErrorrz   r   r   )r   r   r   rq   r   r   s         rT   _refresh_statezBaseSelect._refresh_state~  s    
 !$$R((	3 4Z  H 8??,,--GG 	3 	3 	3488Hb1122GGG	3 187vdn-F#####s   <A -B	B	c                    dS )NTr\   r   s    rT   is_dispatchablezBaseSelect.is_dispatchable  s    trV   BaseSelect[V]c           
     (   t           j        t          t           j        t          t           j        t          t           j        t          t           j	        t          i}|                    j        t                    }fd|j        D             } |di |S )Nc                2    i | ]}|t          |          S r\   )getattr)r^   keyr   s     rT   
<dictcomp>z-BaseSelect.from_component.<locals>.<dictcomp>  s%    ^^^#gi--^^^rV   r\   )r   string_selectr)   rg   r*   rh   r+   ri   r-   rj   r,   r   rb   r   )clsr   type_to_clsconstructorkwrgss    `   rT   from_componentzBaseSelect.from_component  s     '%z%z(-,.?C
 "ooinf==^^^^9]^^^{##U###rV   )rb   r:   r   r   ry   r   r{   r   r|   r   r}   r   r~   r   r   r   r   r   r   r   r   r   ra   r   rO   r   )rO   r1   )rO   r   )r   r   rO   r   )rO   r   )rO   r   )r   r   rO   r   )rO   r   )r   r   rO   r   )rO   r   )r   r   rO   r   )rO   r   )r   r   rO   r   )rO   r   )r   r   rO   r   )r   r8   r   r4   r   r   rO   r   )r   r8   r   r4   rO   r   )r   r   rO   r   )r]   
__module____qualname____doc__	__slots__r   __annotations__r   r   r   r   propertyra   setterrq   r   r{   r|   r}   r~   r   r   r   r   r   r   r   classmethodr   __classcell__rm   s   @rT   rv   rv      se         0 II1    1     !!%)$($(&-+27> %/ %/ %/ %/ %/ %/ %/ %/N    # # # X# Y$ $ $ Y$ 8 8 8 X8 * * * X* ( ( ( ( , , , X, - - - - + + + X+ 1 1 1 1 + + + X+ 1 1 1 1 ) ) ) X) _0 0 0 _0 ) ) ) X) _0 0 0 _0    X* * * *% % % %$ $ $ $$ $ $ $&    
$ 
$ 
$ [
$ 
$ 
$ 
$ 
$rV   rv   c            
           e Zd ZdZej        dz   Zedddeddddd	d+ fdZed, fd            Z	ed-d            Z
ed.d            Zej        d/d             Zedddd!d0d'Zd1d*Z xZS )2r)   a  Represents a UI select menu with a list of custom options. This is represented
    to the user as a dropdown menu.

    .. versionadded:: 2.0

    Parameters
    ------------
    custom_id: :class:`str`
        The ID of the select menu that gets received during an interaction.
        If not given then one is generated for you.
        Can only be up to 100 characters.
    placeholder: Optional[:class:`str`]
        The placeholder text that is shown if nothing is selected, if any.
        Can only be up to 150 characters.
    min_values: :class:`int`
        The minimum number of items that must be chosen for this select menu.
        Defaults to 1 and must be between 0 and 25.
    max_values: :class:`int`
        The maximum number of items that must be chosen for this select menu.
        Defaults to 1 and must be between 1 and 25.
    options: List[:class:`discord.SelectOption`]
        A list of options that can be selected in this menu.
        Can only contain up to 25 items.
    disabled: :class:`bool`
        Whether the select is disabled or not.
    required: :class:`bool`
        Whether the select is required. Only applicable within modals.

        .. versionadded:: 2.6
    row: Optional[:class:`int`]
        The relative row this select menu belongs to. A Discord component can only have 5
        rows. By default, items are arranged automatically into those 5 rows. If you'd
        like to control the relative positioning of the row then passing an index is advised.
        For example, row=1 will show up before row=2. Defaults to ``None``, which is automatic
        ordering. The row number must be between 0 and 4 (i.e. zero indexed).

        .. note::

            This parameter is ignored when used in a :class:`ActionRow` or v2 component.
    id: Optional[:class:`int`]
        The ID of the component. This must be unique across the view.

        .. versionadded:: 2.6
    )r   Nr   FT)	r   r{   r|   r}   r   r~   r   ry   ra   r   r   r{   r   r|   r   r}   r   r   r~   r   r   ry   r   ra   rO   r   c       	        h    t                                          | j        |||||||||	
  
         d S )N)	r   r{   r|   r}   r~   r   r   ry   ra   )r   r   rb   )r   r   r{   r|   r}   r   r~   r   ry   ra   rm   s             rT   r   zSelect.__init__  sP     	I#!! 	 	
 	
 	
 	
 	
rV   	List[str]c                *    t                      j        S )zIList[:class:`str`]: A list of values that have been selected by the user.r   rq   r   rm   s    rT   rq   zSelect.values       ww~rV   $Literal[ComponentType.string_select]c                    t           j        S z4:class:`.ComponentType`: The type of this component.)r   r   r   s    rT   rb   zSelect.type  s     **rV   c                    | j         j        S )zYList[:class:`discord.SelectOption`]: A list of options that can be selected in this menu.)rx   r   r   s    rT   r   zSelect.options  s     ''rV   r   c                    t          |t                    rt          d |D                       st          d          || j        _        d S )Nc              3  @   K   | ]}t          |t                    V  d S rR   )rk   r   r^   rJ   s     rT   	<genexpr>z!Select.options.<locals>.<genexpr>  s-      1a1aTW*S,2O2O1a1a1a1a1a1arV   z&options must be a list of SelectOption)rk   r   allrn   rx   r   r   s     rT   r   zSelect.options  sU    %&& 	Fc1a1a[`1a1a1a.a.a 	FDEEE#(   rV   )r   descriptionemojidefaultlabelr   r   )Optional[Union[str, Emoji, PartialEmoji]]r   c               X    t          |||||          }|                     |           dS )az  Adds an option to the select menu.

        To append a pre-existing :class:`discord.SelectOption` use the
        :meth:`append_option` method instead.

        Parameters
        -----------
        label: :class:`str`
            The label of the option. This is displayed to users.
            Can only be up to 100 characters.
        value: :class:`str`
            The value of the option. This is not displayed to users.
            If not given, defaults to the label.
            Can only be up to 100 characters.
        description: Optional[:class:`str`]
            An additional description of the option, if any.
            Can only be up to 100 characters.
        emoji: Optional[Union[:class:`str`, :class:`.Emoji`, :class:`.PartialEmoji`]]
            The emoji of the option, if available. This can either be a string representing
            the custom or unicode emoji or an instance of :class:`.PartialEmoji` or :class:`.Emoji`.
        default: :class:`bool`
            Whether this option is selected by default.

        Raises
        -------
        ValueError
            The number of options exceeds 25.
        )r   r   r   r   r   N)r   append_option)r   r   r   r   r   r   options          rT   
add_optionzSelect.add_option  sD    L #
 
 
 	6"""""rV   r  r   c                    t          | j        j                  dk    rt          d          | j        j                            |           dS )a  Appends an option to the select menu.

        Parameters
        -----------
        option: :class:`discord.SelectOption`
            The option to append to the select menu.

        Raises
        -------
        ValueError
            The number of options exceeds 25.
           z/maximum number of options already provided (25)N)lenrx   r   ro   rl   )r   r  s     rT   r  zSelect.append_option2  sL     t'((B..NOOO ''/////rV   )r   r   r{   r   r|   r   r}   r   r   r   r~   r   r   r   ry   r   ra   r   rO   r   )rO   r   )rO   r   )rO   r   )r   r   rO   r   )r   r   r   r   r   r   r   r   r   r   rO   r   )r  r   rO   r   )r]   r   r   r   rv   r   r   r   r   rq   rb   r   r   r  r  r   r   s   @rT   r)   r)     sL       + +Z  *B\Q
 !%)&-! 
 
 
 
 
 
 
 
4      X + + + X+ ( ( ( X( ^) ) ) ^) %);?.# .# .# .# .# .#`0 0 0 0 0 0 0 0rV   r)   c            
           e Zd ZdZej        dz   Zeddddddedd	d! fdZed"d            Z	ed# fd            Z
ed$d            Zej        d%d             Z xZS )&r*   a  Represents a UI select menu with a list of predefined options with the current members of the guild.

    If this is sent a private message, it will only allow the user to select the client
    or themselves. Every selected option in a private message will resolve to
    a :class:`discord.User`.

    .. versionadded:: 2.1

    Parameters
    ------------
    custom_id: :class:`str`
        The ID of the select menu that gets received during an interaction.
        If not given then one is generated for you.
        Can only be up to 100 characters.
    placeholder: Optional[:class:`str`]
        The placeholder text that is shown if nothing is selected, if any.
        Can only be up to 150 characters.
    min_values: :class:`int`
        The minimum number of items that must be chosen for this select menu.
        Defaults to 1 and must be between 0 and 25.
    max_values: :class:`int`
        The maximum number of items that must be chosen for this select menu.
        Defaults to 1 and must be between 1 and 25.
    disabled: :class:`bool`
        Whether the select is disabled or not.
    required: :class:`bool`
        Whether the select is required. Only applicable within modals.

        .. versionadded:: 2.6
    default_values: Sequence[:class:`~discord.abc.Snowflake`]
        A list of objects representing the users that should be selected by default.
        Number of items must be in range of ``min_values`` and ``max_values``.

        .. versionadded:: 2.4
    row: Optional[:class:`int`]
        The relative row this select menu belongs to. A Discord component can only have 5
        rows. By default, items are arranged automatically into those 5 rows. If you'd
        like to control the relative positioning of the row then passing an index is advised.
        For example, row=1 will show up before row=2. Defaults to ``None``, which is automatic
        ordering. The row number must be between 0 and 4 (i.e. zero indexed).

        .. note::

            This parameter is ignored when used in a :class:`ActionRow` or v2 component.
    id: Optional[:class:`int`]
        The ID of the component. This must be unique across the view.

        .. versionadded:: 2.6
    r   Nr   F	r   r{   r|   r}   r~   r   ry   r   ra   r   r   r{   r   r|   r   r}   r~   r   r   ry   r   r   rX   ra   rO   r   c       	            t                                          | j        |||||||t          || j                  |	
  
         d S Nr
  r   r   rb   rt   r   r   r{   r|   r}   r~   r   ry   r   ra   rm   s             rT   r   zUserSelect.__init__{  \     	I#!!2>49MM 	 	
 	
 	
 	
 	
rV   "Literal[ComponentType.user_select]c                    t           j        S r   )r   rg   r   s    rT   rb   zUserSelect.type       ((rV   List[Union[Member, User]]c                *    t                      j        S )a  List[Union[:class:`discord.Member`, :class:`discord.User`]]: A list of members
        and users that have been selected by the user.

        If this is sent a private message, it will only allow
        the user to select the client or themselves. Every selected option in a private
        message will resolve to a :class:`discord.User`.

        If invoked in a guild, the values will always resolve to :class:`discord.Member`.
        r   r   s    rT   rq   zUserSelect.values       ww~rV   rY   c                    | j         j        S zList[:class:`discord.SelectDefaultValue`]: A list of default values for the select menu.

        .. versionadded:: 2.4
        rx   r   r   s    rT   r   zUserSelect.default_values       ..rV   r   c                D    t          || j                  | j        _        d S rR   rt   rb   rx   r   r   s     rT   r   zUserSelect.default_values      *A%*S*S'''rV   r   r   r{   r   r|   r   r}   r   r~   r   r   r   ry   r   r   rX   ra   r   rO   r   )rO   r  )rO   r  rO   rY   r   rX   rO   r   r]   r   r   r   rv   r   r   r   r   rb   rq   r   r   r   r   s   @rT   r*   r*   F  s       0 0d  *BEXX
 !%)!7> 
 
 
 
 
 
 
 
4 ) ) ) X) 
 
 
 
 
 X
 / / / X/ T T T T T T T TrV   r*   c            
           e Zd ZdZej        dz   Zeddddddedd	d! fdZed"d            Z	ed# fd            Z
ed$d            Zej        d%d             Z xZS )&r+   aO  Represents a UI select menu with a list of predefined options with the current roles of the guild.

    Please note that if you use this in a private message with a user, no roles will be displayed to the user.

    .. versionadded:: 2.1

    Parameters
    ------------
    custom_id: :class:`str`
        The ID of the select menu that gets received during an interaction.
        If not given then one is generated for you.
        Can only be up to 100 characters.
    placeholder: Optional[:class:`str`]
        The placeholder text that is shown if nothing is selected, if any.
        Can only be up to 150 characters.
    min_values: :class:`int`
        The minimum number of items that must be chosen for this select menu.
        Defaults to 1 and must be between 0 and 25.
    max_values: :class:`int`
        The maximum number of items that must be chosen for this select menu.
        Defaults to 1 and must be between 1 and 25.
    disabled: :class:`bool`
        Whether the select is disabled or not.
    required: :class:`bool`
        Whether the select is required. Only applicable within modals.

        .. versionadded:: 2.6
    default_values: Sequence[:class:`~discord.abc.Snowflake`]
        A list of objects representing the roles that should be selected by default.
        Number of items must be in range of ``min_values`` and ``max_values``.

        .. versionadded:: 2.4
    row: Optional[:class:`int`]
        The relative row this select menu belongs to. A Discord component can only have 5
        rows. By default, items are arranged automatically into those 5 rows. If you'd
        like to control the relative positioning of the row then passing an index is advised.
        For example, row=1 will show up before row=2. Defaults to ``None``, which is automatic
        ordering. The row number must be between 0 and 4 (i.e. zero indexed).

        .. note::

            This parameter is ignored when used in a :class:`ActionRow` or v2 component.
    id: Optional[:class:`int`]
        The ID of the component. This must be unique across the view.

        .. versionadded:: 2.6
    r	  Nr   Fr
  r   r   r{   r   r|   r   r}   r~   r   r   ry   r   r   rX   ra   rO   r   c       	            t                                          | j        |||||||t          || j                  |	
  
         d S r  r  r  s             rT   r   zRoleSelect.__init__  r  rV   "Literal[ComponentType.role_select]c                    t           j        S r   )r   rh   r   s    rT   rb   zRoleSelect.type  r  rV   
List[Role]c                *    t                      j        S )zQList[:class:`discord.Role`]: A list of roles that have been selected by the user.r   r   s    rT   rq   zRoleSelect.values  r   rV   rY   c                    | j         j        S r  r  r   s    rT   r   zRoleSelect.default_values  r  rV   r   c                D    t          || j                  | j        _        d S rR   r  r   s     rT   r   zRoleSelect.default_values  r  rV   r  )rO   r#  )rO   r%  r  r  r   r   s   @rT   r+   r+     s       . .`  *BEXX
 !%)!7> 
 
 
 
 
 
 
 
4 ) ) ) X)      X / / / X/ T T T T T T T TrV   r+   c            
           e Zd ZdZej        dz   Zeddddddedd	d! fdZed"d            Z	ed# fd            Z
ed$d            Zej        d%d             Z xZS )&r,   aF	  Represents a UI select menu with a list of predefined options with the current members and roles in the guild.

    If this is sent in a private message, it will only allow the user to select
    the client or themselves. Every selected option in a private message
    will resolve to a :class:`discord.User`. It will not give the user any roles
    to select.

    .. versionadded:: 2.1

    Parameters
    ------------
    custom_id: :class:`str`
        The ID of the select menu that gets received during an interaction.
        If not given then one is generated for you.
        Can only be up to 100 characters.
    placeholder: Optional[:class:`str`]
        The placeholder text that is shown if nothing is selected, if any.
        Can only be up to 150 characters.
    min_values: :class:`int`
        The minimum number of items that must be chosen for this select menu.
        Defaults to 1 and must be between 0 and 25.
    max_values: :class:`int`
        The maximum number of items that must be chosen for this select menu.
        Defaults to 1 and must be between 1 and 25.
    disabled: :class:`bool`
        Whether the select is disabled or not.
    required: :class:`bool`
        Whether the select is required. Only applicable within modals.

        .. versionadded:: 2.6
    default_values: Sequence[:class:`~discord.abc.Snowflake`]
        A list of objects representing the users/roles that should be selected by default.
        if :class:`.Object` is passed, then the type must be specified in the constructor.
        Number of items must be in range of ``min_values`` and ``max_values``.

        .. versionadded:: 2.4
    row: Optional[:class:`int`]
        The relative row this select menu belongs to. A Discord component can only have 5
        rows. By default, items are arranged automatically into those 5 rows. If you'd
        like to control the relative positioning of the row then passing an index is advised.
        For example, row=1 will show up before row=2. Defaults to ``None``, which is automatic
        ordering. The row number must be between 0 and 4 (i.e. zero indexed).

        .. note::

            This parameter is ignored when used in a :class:`ActionRow` or v2 component.
    id: Optional[:class:`int`]
        The ID of the component. This must be unique across the view.

        .. versionadded:: 2.6
    r	  Nr   Fr
  r   r   r{   r   r|   r   r}   r~   r   r   ry   r   r   rX   ra   rO   r   c       	            t                                          | j        |||||||t          || j                  |	
  
         d S r  r  r  s             rT   r   zMentionableSelect.__init__O  r  rV   )Literal[ComponentType.mentionable_select]c                    t           j        S r   )r   rj   r   s    rT   rb   zMentionableSelect.typei  s     //rV   List[Union[Member, User, Role]]c                *    t                      j        S )a  List[Union[:class:`discord.Role`, :class:`discord.Member`, :class:`discord.User`]]: A list of roles, members,
        and users that have been selected by the user.

        If this is sent a private message, it will only allow
        the user to select the client or themselves. Every selected option in a private
        message will resolve to a :class:`discord.User`.

        If invoked in a guild, the values will always resolve to :class:`discord.Member`.
        r   r   s    rT   rq   zMentionableSelect.valuesn  r  rV   rY   c                    | j         j        S r  r  r   s    rT   r   z MentionableSelect.default_values{  r  rV   r   c                D    t          || j                  | j        _        d S rR   r  r   s     rT   r   z MentionableSelect.default_values  r  rV   r  )rO   r+  )rO   r-  r  r  r   r   s   @rT   r,   r,     s       2 2h  *BEXX
 !%)!7> 
 
 
 
 
 
 
 
4 0 0 0 X0 
 
 
 
 
 X
 / / / X/ T T T T T T T TrV   r,   c                       e Zd ZdZej        dz   Zeeddddddedd
d% fdZed&d            Z	ed'd            Z
e
j        d(d            Z
ed) fd!            Zed*d#            Zej        d+d$            Z xZS ),r-   a  Represents a UI select menu with a list of predefined options with the current channels in the guild.

    Please note that if you use this in a private message with a user, no channels will be displayed to the user.

    .. versionadded:: 2.1

    Parameters
    ------------
    custom_id: :class:`str`
        The ID of the select menu that gets received during an interaction.
        If not given then one is generated for you.
        Can only be up to 100 characters.
    channel_types: List[:class:`~discord.ChannelType`]
        The types of channels to show in the select menu. Defaults to all channels.
    placeholder: Optional[:class:`str`]
        The placeholder text that is shown if nothing is selected, if any.
        Can only be up to 150 characters.
    min_values: :class:`int`
        The minimum number of items that must be chosen for this select menu.
        Defaults to 1 and must be between 0 and 25.
    max_values: :class:`int`
        The maximum number of items that must be chosen for this select menu.
        Defaults to 1 and must be between 1 and 25.
    disabled: :class:`bool`
        Whether the select is disabled or not.
    required: :class:`bool`
        Whether the select is required. Only applicable within modals.

        .. versionadded:: 2.6
    default_values: Sequence[:class:`~discord.abc.Snowflake`]
        A list of objects representing the channels that should be selected by default.
        Number of items must be in range of ``min_values`` and ``max_values``.

        .. versionadded:: 2.4
    row: Optional[:class:`int`]
        The relative row this select menu belongs to. A Discord component can only have 5
        rows. By default, items are arranged automatically into those 5 rows. If you'd
        like to control the relative positioning of the row then passing an index is advised.
        For example, row=1 will show up before row=2. Defaults to ``None``, which is automatic
        ordering. The row number must be between 0 and 4 (i.e. zero indexed).

        .. note::

            This parameter is ignored when used in a :class:`ActionRow` or v2 component.
    id: Optional[:class:`int`]
        The ID of the component. This must be unique across the view.

        .. versionadded:: 2.6
    )r   r   Nr   F)
r   r   r{   r|   r}   r~   r   ry   r   ra   r   r   r   r   r{   r   r|   r   r}   r~   r   r   ry   r   r   rX   ra   rO   r   c       
            t                                          | j        ||||||||t          |	| j                  |
           d S )N)
r   r{   r|   r}   r~   r   ry   r   r   ra   r  )r   r   r   r{   r|   r}   r~   r   ry   r   ra   rm   s              rT   r   zChannelSelect.__init__  s_     	I#!!'2>49MM 	 	
 	
 	
 	
 	
rV   %Literal[ComponentType.channel_select]c                    t           j        S r   )r   ri   r   s    rT   rb   zChannelSelect.type  s     ++rV   c                    | j         j        S )zRList[:class:`~discord.ChannelType`]: A list of channel types that can be selected.)rx   r   r   s    rT   r   zChannelSelect.channel_types  s     --rV   r   c                    t          |t                    st          d          t          d |D                       st          d          || j        _        d S )Nz+channel_types must be a list of ChannelTypec              3  @   K   | ]}t          |t                    V  d S rR   )rk   r   r   s     rT   r   z.ChannelSelect.channel_types.<locals>.<genexpr>  s,      AAC:c;//AAAAAArV   z$all list items must be a ChannelType)rk   r   rn   r   rx   r   r   s     rT   r   zChannelSelect.channel_types  sd    %&& 	KIJJJAA5AAAAA 	DBCCC).&&&rV   0List[Union[AppCommandChannel, AppCommandThread]]c                *    t                      j        S )zList[Union[:class:`~discord.app_commands.AppCommandChannel`, :class:`~discord.app_commands.AppCommandThread`]]: A list of channels selected by the user.r   r   s    rT   rq   zChannelSelect.values  r   rV   rY   c                    | j         j        S r  r  r   s    rT   r   zChannelSelect.default_values  r  rV   c                D    t          || j                  | j        _        d S rR   r  r   s     rT   r   zChannelSelect.default_values  r  rV   )r   r   r   r   r{   r   r|   r   r}   r   r~   r   r   r   ry   r   r   rX   ra   r   rO   r   )rO   r3  )rO   r   )r   r   rO   r   )rO   r8  r  r  )r]   r   r   r   rv   r   r   r   r   rb   r   r   rq   r   r   r   s   @rT   r-   r-     sb       0 0d  *B F   !+2%)!7> 
 
 
 
 
 
 
 
8 , , , X, . . . X. / / / /      X / / / X/ T T T T T T T TrV   r-   .
r   r   r   r{   r   r|   r}   r~   ry   ra   r   Type[SelectT]r   r   r   r   r{   r   r   r   r|   r   r}   r~   r   ry   r   ra   #SelectCallbackDecorator[S, SelectT]c        
            d S rR   r\   r<  s
             rT   r.   r.     s	     +.#rV   r   r   r   r{   r   r|   r}   r~   r   ry   ra   Type[UserSelectT]r   'SelectCallbackDecorator[S, UserSelectT]c                    d S rR   r\   r@  s              rT   r.   r.     	     /2crV   Type[RoleSelectT]'SelectCallbackDecorator[S, RoleSelectT]c                    d S rR   r\   r@  s              rT   r.   r.   "  rD  rV   Type[ChannelSelectT]*SelectCallbackDecorator[S, ChannelSelectT]c                    d S rR   r\   r@  s              rT   r.   r.   3  s	     25rV   Type[MentionableSelectT].SelectCallbackDecorator[S, MentionableSelectT]c                    d S rR   r\   r@  s              rT   r.   r.   D  s	     69SrV   FType[BaseSelectT]'SelectCallbackDecorator[S, BaseSelectT]c                <    	
 d 
	fd}|S )a  A decorator that attaches a select menu to a component.

    The function being decorated should have three parameters, ``self`` representing
    the :class:`discord.ui.View`, the :class:`discord.Interaction` you receive and
    the chosen select class.

    To obtain the selected values inside the callback, you can use the ``values`` attribute of the chosen class in the callback. The list of values
    will depend on the type of select menu used. View the table below for more information.

    +----------------------------------------+-----------------------------------------------------------------------------------------------------------------+
    | Select Type                            | Resolved Values                                                                                                 |
    +========================================+=================================================================================================================+
    | :class:`discord.ui.Select`             | List[:class:`str`]                                                                                              |
    +----------------------------------------+-----------------------------------------------------------------------------------------------------------------+
    | :class:`discord.ui.UserSelect`         | List[Union[:class:`discord.Member`, :class:`discord.User`]]                                                     |
    +----------------------------------------+-----------------------------------------------------------------------------------------------------------------+
    | :class:`discord.ui.RoleSelect`         | List[:class:`discord.Role`]                                                                                     |
    +----------------------------------------+-----------------------------------------------------------------------------------------------------------------+
    | :class:`discord.ui.MentionableSelect`  | List[Union[:class:`discord.Role`, :class:`discord.Member`, :class:`discord.User`]]                              |
    +----------------------------------------+-----------------------------------------------------------------------------------------------------------------+
    | :class:`discord.ui.ChannelSelect`      | List[Union[:class:`~discord.app_commands.AppCommandChannel`, :class:`~discord.app_commands.AppCommandThread`]]  |
    +----------------------------------------+-----------------------------------------------------------------------------------------------------------------+

    .. versionchanged:: 2.1
        Added the following keyword-arguments: ``cls``, ``channel_types``

    Example
    ---------
    .. code-block:: python3

        class View(discord.ui.View):

            @discord.ui.select(cls=ChannelSelect, channel_types=[discord.ChannelType.text])
            async def select_channels(self, interaction: discord.Interaction, select: ChannelSelect):
                return await interaction.response.send_message(f'You selected {select.values[0].mention}')

    Parameters
    ------------
    cls: Union[Type[:class:`discord.ui.Select`], Type[:class:`discord.ui.UserSelect`], Type[:class:`discord.ui.RoleSelect`],         Type[:class:`discord.ui.MentionableSelect`], Type[:class:`discord.ui.ChannelSelect`]]
        The class to use for the select menu. Defaults to :class:`discord.ui.Select`. You can use other
        select types to display different select menus to the user. See the table above for the different
        values you can get from each select type. Subclasses work as well, however the callback in the subclass will
        get overridden.
    placeholder: Optional[:class:`str`]
        The placeholder text that is shown if nothing is selected, if any.
        Can only be up to 150 characters.
    custom_id: :class:`str`
        The ID of the select menu that gets received during an interaction.
        It is recommended not to set this parameter to prevent conflicts.
        Can only be up to 100 characters.
    row: Optional[:class:`int`]
        The relative row this select menu belongs to. A Discord component can only have 5
        rows. By default, items are arranged automatically into those 5 rows. If you'd
        like to control the relative positioning of the row then passing an index is advised.
        For example, row=1 will show up before row=2. Defaults to ``None``, which is automatic
        ordering. The row number must be between 0 and 4 (i.e. zero indexed).

        .. note::

            This parameter is ignored when used in a :class:`ActionRow` or v2 component.
    min_values: :class:`int`
        The minimum number of items that must be chosen for this select menu.
        Defaults to 1 and must be between 0 and 25.
    max_values: :class:`int`
        The maximum number of items that must be chosen for this select menu.
        Defaults to 1 and must be between 1 and 25.
    options: List[:class:`discord.SelectOption`]
        A list of options that can be selected in this menu. This can only be used with
        :class:`Select` instances.
        Can only contain up to 25 items.
    channel_types: List[:class:`~discord.ChannelType`]
        The types of channels to show in the select menu. Defaults to all channels. This can only be used
        with :class:`ChannelSelect` instances.
    disabled: :class:`bool`
        Whether the select is disabled or not. Defaults to ``False``.
    default_values: Sequence[:class:`~discord.abc.Snowflake`]
        A list of objects representing the default values for the select menu. This cannot be used with regular :class:`Select` instances.
        If ``cls`` is :class:`MentionableSelect` and :class:`.Object` is passed, then the type must be specified in the constructor.
        Number of items must be in range of ``min_values`` and ``max_values``.

        .. versionadded:: 2.4
    id: Optional[:class:`int`]
        The ID of the component. This must be unique across the view.

        .. versionadded:: 2.6
    funcrG   rO   c                   t          j        |           st          d          t          d          }t	          |t
                    s2d                    g d          }t          d| dj         d          || _        
	d| _	        t	          |t                    r
| j	        d	<   t	          |t                    r
| j	        d
<   t	          |t                    stt          t          j        t          t          j        t"          t          j        t          t          j        i}t(          u rt(          nt+          ||                   | j	        d<   | S )Nz,select function must be a coroutine function
__origin__z, )r-   r,   r+   r)   r*   zcls must be one of z# or a subclass of one of them, not .)r{   r   ry   r|   r}   r~   ra   r   r   r   )inspectiscoroutinefunctionrn   r   rS   rv   joinr]   __discord_ui_model_type____discord_ui_model_kwargs__r)   r-   r*   r   rg   r+   rh   r,   rj   ri   r   rt   )rQ  callback_clsrs   rp   r   r   r   r   r~   ra   r}   r|   r   r{   ry   s       rT   	decoratorzselect.<locals>.decorator  sq   *400 	LJKKKsL#66,
33 	y $		*v*v*v w ww2Cwwhkhtwwwxxx)5&&"$$ ,
 ,
( lF++ 	B:AD,Y7lM22 	N@MD,_=,// 	 M5M5!=#C};	  *W44:QR`bmnzb{:|:| ,-=> rV   )rQ  rG   rO   rG   r\   )r   r   r   r{   r   r|   r}   r~   r   ry   ra   r[  s   ``````````` rT   r.   r.   U  sg    L) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )V rV   )rJ   r   rK   rL   rM   rN   rO   rP   )rW   rX   rK   rL   rO   rY   )r   r=  r   r   r   r   r{   r   r   r   r|   r   r}   r   r~   r   ry   r   ra   r   rO   r>  )r   rA  r   r   r   r   r{   r   r   r   r|   r   r}   r   r~   r   r   rX   ry   r   ra   r   rO   rB  )r   rE  r   r   r   r   r{   r   r   r   r|   r   r}   r   r~   r   r   rX   ry   r   ra   r   rO   rF  )r   rH  r   r   r   r   r{   r   r   r   r|   r   r}   r   r~   r   r   rX   ry   r   ra   r   rO   rI  )r   rK  r   r   r   r   r{   r   r   r   r|   r   r}   r   r~   r   r   rX   ry   r   ra   r   rO   rL  )r   rN  r   r   r   r   r{   r   r   r   r|   r   r}   r   r~   r   r   rX   ry   r   ra   r   rO   rO  )jr   
__future__r   typingr   r   r   r   r   r	   r
   r   r   r   r   r   r   contextvarsr   r   rU  r   r   r   r   ItemCallbackTyper   enumsr   r   r   partial_emojir   r   r   utilsr   r   
componentsr   r   r    app_commands.namespacer!   memberr"   objectr#   re   r$   rd   r%   r&   abcr'   threadsr(   __all__typing_extensionsr/   r0   r1   r   r2   
action_rowr3   types.componentsr   types.interactionsr4   rc   r6   r7   interactionsr8   r9   r   rg   rh   ri   rj   r:   r   r   r;   r<   r=   r@   rA   rB   rC   rD   rE   rF   rH   rL   rI   rU   rt   rv   r)   r*   r+   r,   r-   r.   r\   rV   rT   <module>ro     s;    0 # " " " " "                              # " " " " "   				 T T T T T T T T T T F F F F F F F F F F ( ( ( ( ( (       ( ( ( ( ( ( ( (         
 / . . . . .                   # # # # # # # #               <<<<<<<<<<%%%%%%BBBBBBJJJJJJBBBBBBBB******333333!(#!!$(		*"O      %T64!24DeDRXLFY[`aegkak[ll M     %*		%     GC3tDDDGCzT222gm+<===
')=
1
1
1gm+<===gm+<===)1EFFFW19QRRR %-/Q.RT_._%`  ` ` ` `% $&  ?IjIZ>[>[ [ [ [ [F F F F6 6 6 6r`$ `$ `$ `$ `$a `$ `$ `$Fa0 a0 a0 a0 a0Z] a0 a0 a0HkT kT kT kT kTA kT kT kT\aT aT aT aT aTA aT aT aTHmT mT mT mT mT
1 mT mT mT`vT vT vT vT vTJqM vT vT vTr 
  ")'*!$. . . . . 
. 
 (_")'*!$362 2 2 2 2 
2  
 (_")'*!$362 2 2 2 2 
2  
 !.c 2")'*!$365 5 5 5 5 
5  
 %6c$:")'.!$369 9 9 9 9 
9$ $C[")'.!%3:Q Q Q Q Q Q Q QrV   