
    i              	          S SK r S SKJr  S SKJrJrJrJrJrJ	r	J
r
  \" S5      r\" S5      r\" S\S9r\
SSS	\\\   /\\   4   4S
 j5       r\
S\\   S	\\   4S j5       r SS\\\      S	\	\\\   /\\   4   \\   4   4S jjr\ R                  S:  a	  S SKJrJr  O"\ " S S\\5      5       r\ " S S\\5      5       r\ R                  S:  a  S SKJr  g " S S\\\4   5      rg)    N)Enum)CallableGenericOptionalTypeTypeVarUnionoverloadTRE)boundclsreturnc                     g N r   s    ;/app/mltbenv/lib/python3.13/site-packages/aioqbt/_compat.py	repr_enumr   
           c                     g r   r   r   s    r   r   r      r   r   c                 Z    S[         [           S[         [           4S jnU c  U$ U" U 5      $ )aY  
Preserve str() and format() behavior of enum types from underlying
data type.

Decorate an enum subclass mixed with a data type such that str() and
format() return the equivalent result similar to the function
directly operated on the objects of the data type.

Mimic ReprEnum on Python 3.11.
See https://github.com/python/cpython/issues/85955
r   r   c                    [        U [        5      (       d  [        SU < 35      e[        U R                  5      n[        S [        USS  S5       5       5      nX   nUSU nU R                  nU[        L d  XT;  a  [        S5      eU R                  UR                  L a  UR                  U l	        U R                  UR                  L a<  UR                  [        R                  L a  UR                  nOUR                  nX`l
        U $ )Nz$require subclass of Enum instead of c              3   X   #    U  H   u  p[        U[        5      (       d  M  Uv   M"     g 7fr   )
issubclassr   ).0iss      r   	<genexpr>.repr_enum.<locals>.decorate.<locals>.<genexpr>*   s     S&;daz!T?R&;s   *	*   z;repr_enum() only decorate enum types mixed with a data type)r   r   	TypeErrortuple__mro__next	enumerate_member_type_object
__format____str____repr__)r   mroenum_idx	enum_typemixin_typesmember_type
str_methods          r   decoraterepr_enum.<locals>.decorate#   s    #t$$B3'JKKCKK  SiAB&;SSM	!Ho''& K$BYZZ >>Y111(33CN;;)+++""fnn4(11
(00
$K
r   )r   r   )r   r4   s     r   r   r      s4    d1g $q' B {}r   )      )IntEnumStrEnumc                       \ rS rSrSrg)r9   Q   r   N__name__
__module____qualname____firstlineno____static_attributes__r   r   r   r9   r9   Q       r   r9   c                       \ rS rSrSrg)r8   U   r   Nr<   r   r   r   r8   r8   U   rB   r   r8   )r6      )cached_propertyc            	           \ rS rSrSrS\\/\4   SS4S jrS\S\	SS4S	 jr
\ SS
SS\\\      SS4S jj5       r\ SS
\S\\\      S\4S jj5       r SS
\\   S\\\      S\S\4   4S jjrSrg)rF   `   zJ
Modified from the functools.cached_property implementation on Python 3.8
funcr   Nc                 @    Xl         S U l        UR                  U l        g r   )rI   name__doc__)selfrI   s     r   __init__cached_property.__init__e   s    I'+DI<<DLr   ownerrK   c                     U R                   c  X l         g U R                   U:w  a  [        SU R                   < SU< S35      eg )Nz?cached_property cannot be associated with two different names (z and ))rK   r$   )rM   rP   rK   s      r   __set_name__cached_property.__set_name__j   sJ    yy  	d"U4(!5  #r   instancezcached_property[T, R]c                     g r   r   rM   rU   rP   s      r   __get__cached_property.__get__s   s    
 '*r   c                     g r   r   rW   s      r   rX   rY   z   s    
 r   c                    Uc  U $ U R                   c  [        S5      e UR                  n X0R                      nU$ ! [         a    [        S5      S ef = f! [         a#    U R                  U5      nXCU R                   '    U$ f = f)Nz.cached_property must be associated with a namez9cached_property require __dict__ attribute to cache value)rK   r$   __dict__AttributeErrorKeyErrorrI   )rM   rU   rP   cachevalues        r   rX   rY      s    
 yy  PQQ )))ii( L " O  )		(+#(dii L)s   < A A)BB)rL   rI   rK   ).r   )r=   r>   r?   r@   rL   r   r   r   rN   strrS   r
   r   r   rX   r	   rA   r   r   r   rF   rF   `   s    		(1#q&!1 	(d 	(
	a 	s 	t 	 
 (+	*	* DG$	* %		* 
	* 
 (+		 DG$	 		 
	 (,	qk	 DG$	 *A-.		 	r   rF   r   )sysenumr   typingr   r   r   r   r   r	   r
   r   r   r   r   version_infor8   r9   ra   int	functoolsrF   r   r   r   <module>rh      sT   
  N N NCLCLCt 
	4 	Hd1gYQ%78 	 
	 
	47 	tAw 	 
	
 "3	$q'	3
8T!WItAw&'a013l w%  #t   #t   v<8'!Q$- 8r   