
    ՟fr
                         d Z ddlZddlZddlmZmZmZ  ed      Z ed      Z	 edej                        Zdee   d	ed
e	deeee	f   fdZ G d deej                        Z G d dej                        Zy)a  This module contains helper functions related to enums.

Warning:
    Contents of this module are intended to be used internally by the library and *not* by the
    user. Changes to this module are not considered breaking changes and may not be documented in
    the changelog.
    N)TypeTypeVarUnion_A_B_Enum)boundenum_clsvaluedefaultreturnc                 6    	  | |      S # t         $ r |cY S w xY w)zTries to call ``enum_cls(value)`` to convert the value into an enumeration member.
    If that fails, the ``default`` is returned.
    )
ValueError)r
   r   r   s      O/var/www/cvtools/html/venv/lib/python3.12/site-packages/telegram/_utils/enum.py
get_memberr   #   s%     s   
 c                   ,    e Zd ZdZdZdefdZdefdZy)
StringEnumzHelper class for string enums where ``str(member)`` prints the value, but ``repr(member)``
    gives ``EnumName.MEMBER_NAME``.
     r   c                 P    d| j                   j                   d| j                   dS N<.>	__class____name__nameselfs    r   __repr__zStringEnum.__repr__7   &    4>>**+1TYYKq99    c                 ,    t         j                  |       S N)str__str__r   s    r   r&   zStringEnum.__str__:   s    {{4  r"   N)r   
__module____qualname____doc__	__slots__r%   r    r&   r   r"   r   r   r   0   s&     I:# :! !r"   r   c                   L    e Zd ZdZdZdefdZej                  dk  rdefdZ	yy)IntEnumzHelper class for int enums where ``str(member)`` prints the value, but ``repr(member)``
    gives ``EnumName.MEMBER_NAME``.
    r   r   c                 P    d| j                   j                   d| j                   dS r   r   r   s    r   r    zIntEnum.__repr__F   r!   r"   )      c                 ,    t        | j                        S r$   )r%   r   r   s    r   r&   zIntEnum.__str__K   s    tzz?"r"   N)
r   r'   r(   r)   r*   r%   r    sysversion_infor&   r   r"   r   r,   r,   ?   s;     I:# : '!	#S 	# "r"   r,   )r)   enum_enumr1   typingr   r   r   r   r   Enumr   r   r%   r   r,   r   r"   r   <module>r7      s   &  
 ' 'T]T]uzz*e R " ubRT}AU !ejj !#emm #r"   