
    Ti                       % S r SSKJr  SSKJr  SSKJrJrJr  S)S jr	 " S S\5      r
\" \
" SS	5      \
" S
S5      \
" SS5      \
" SS5      \
" SS5      \
" SS5      S9r0 rS\S'    " S S\5      r\ " S S\S95       r " S S\5      r " S S\5      r " S  S!\5      r " S" S#\5      r " S$ S%\5      r " S& S'\5      rg()*     )annotations)total_ordering)ClassVar
NamedTuplecastc                b    [        U [        5      (       a  U R                  5       $ [        U 5      $ )z,
normalize a byte/str/int or float to a str
)
isinstancebytesdecodestr)values    _/var/www/html/backend/Backoffice_Marketplace/venv/lib/python3.13/site-packages/limits/limits.pysafe_stringr   
   s'    
 %||~u:    c                  *    \ rS rSr% S\S'   S\S'   Srg)Granularity   intsecondsr   name N)__name__
__module____qualname____firstlineno____annotations____static_attributes__r   r   r   r   r      s    L
Ir   r   iQ dayi ' monthi yeari  hour<   minute   second)r   r    r!   r"   r$   r&   zdict[str, type[RateLimitItem]]GRANULARITIESc                  <   ^  \ rS rSr        SU 4S jjrSrU =r$ )RateLimitItemMeta&   c                   > SU;  a  / US'   [         TU ]  XX#5      nSU;   a$  [        [        [           U5      [
        US   S   '   U$ )N	__slots__GRANULARITYr%   )super__new__r   typeRateLimitItemr'   )clsr   parentsdctgranularity	__class__s        r   r/   RateLimitItemMeta.__new__'   sZ     c!!Cgoc>C37]#[4M#m,Q/0 r   r   )r   r   r3   ztuple[type, ...]r4   z"dict[str, Granularity | list[str]]returnr)   )r   r   r   r   r/   r   __classcell__)r6   s   @r   r)   r)   &   s3     " 0	
 
 r   r)   c                      \ rS rSr% Sr/ SQrS\S'     S     SS jjr\SS j5       r	SS jr
SS	 jrSS
 jrSS jrSS jrSS jrSrg)r1   :   aA  
defines a Rate limited resource which contains the characteristic
namespace, amount and granularity multiples of the rate limiting window.

:param amount: the rate limit amount
:param multiples: multiple of the 'per' :attr:`GRANULARITY`
 (e.g. 'n' per 'm' seconds)
:param namespace: category for the specific rate limit
)	namespaceamount	multipleszClassVar[Granularity]r-   c                b    X0l         [        U5      U l        [        U=(       d    S5      U l        g )Nr%   )r<   r   r=   r>   )selfr=   r>   r<   s       r   __init__RateLimitItem.__init__N   s$     #&kY^!,r   c                    UR                  5       U R                  R                  U R                  R                   S31;   $ )z
Checks if this instance matches a *granularity_string*
of type ``n per hour``, ``n per minute`` etc,
by comparing with :attr:`GRANULARITY`

s)lowerr-   r   )r2   granularity_strings     r   check_granularity_string&RateLimitItem.check_granularity_stringU   sA     "'')OO  ##$A&.
 
 	
r   c                H    U R                   R                  U R                  -  $ )z=
:return: the duration the limit is enforced for in seconds.
)r-   r   r>   r@   s    r   
get_expiryRateLimitItem.get_expiryc   s    
 ''$..88r   c                   SR                  U Vs/ s H  n[        U5      PM     sn[        U R                  5      [        U R                  5      U R                  R
                  /-   5      nU R                   SU 3$ s  snf )z
Constructs a key for the current limit and any additional
identifiers provided.

:param identifiers: a list of strings to append to the key
:return: a string key identifying this resource with
 each identifier separated with a '/' delimiter.
/)joinr   r=   r>   r-   r   r<   )r@   identifiersk	remainders       r   key_forRateLimitItem.key_forj   sv     HH%01[[^[1DKK(DNN+  %%
	 ..!9+.. 2s   A=c                    [        U[        5      (       aY  U R                  UR                  :H  =(       a9    U R                  UR                  :H  =(       a    U R                  UR                  :H  $ g)NF)r
   r1   r=   r-   r>   r@   others     r   __eq__RateLimitItem.__eq__~   sW    e]++u||+ 6$$(9(996NNeoo5
 r   c                f    U R                    SU R                   SU R                  R                   3$ )Nz per  )r=   r>   r-   r   rJ   s    r   __repr__RateLimitItem.__repr__   s/    ++eDNN#31T5E5E5J5J4KLLr   c                \    U R                   R                  UR                   R                  :  $ N)r-   r   rV   s     r   __lt__RateLimitItem.__lt__   s%    ''%*;*;*C*CCCr   c                p    [        U R                  U R                  U R                  U R                  45      $ r_   )hashr<   r=   r>   r-   rJ   s    r   __hash__RateLimitItem.__hash__   s(    T^^T[[$..$BRBRSTTr   )r=   r>   r<   N)r%   LIMITER)r=   r   r>   z
int | Noner<   r   )rF   r   r8   bool)r8   r   )rP   bytes | str | int | floatr8   r   )rW   objectr8   rg   )r8   r   )rW   r1   r8   rg   )r   r   r   r   __doc__r,   r   rA   classmethodrG   rK   rS   rX   r\   r`   rd   r   r   r   r   r1   r1   :   sr     5I&& HQ--&0-AD- 
 
9/(MDUr   r1   )	metaclassc                  "    \ rS rSrSr\S   rSrg)RateLimitItemPerYear   z!
per year rate limited resource.
r!   r   Nr   r   r   r   rj   
TIME_TYPESr-   r   r   r   r   rn   rn      s     V$Kr   rn   c                  "    \ rS rSrSr\S   rSrg)RateLimitItemPerMonth   z"
per month rate limited resource.
r    r   Nrp   r   r   r   rs   rs      s     W%Kr   rs   c                  "    \ rS rSrSr\S   rSrg)RateLimitItemPerDay   z 
per day rate limited resource.
r   r   Nrp   r   r   r   rv   rv      s     U#Kr   rv   c                  "    \ rS rSrSr\S   rSrg)RateLimitItemPerHour   z!
per hour rate limited resource.
r"   r   Nrp   r   r   r   ry   ry      s     V$Kr   ry   c                  "    \ rS rSrSr\S   rSrg)RateLimitItemPerMinute   z#
per minute rate limited resource.
r$   r   Nrp   r   r   r   r|   r|           X&Kr   r|   c                  "    \ rS rSrSr\S   rSrg)RateLimitItemPerSecond   z#
per second rate limited resource.
r&   r   Nrp   r   r   r   r   r      r~   r   r   N)r   rh   r8   r   )rj   
__future__r   	functoolsr   limits.typingr   r   r   r   r   dictrq   r'   r   r0   r)   r1   rn   rs   rv   ry   r|   r   r   r   r   <module>r      s     " $ 4 4* 
 L%(
'
1	+V	4	Wf	%r8$q(#
 13- 2 ( SU/ SU SUl= M - = ] ] r   