Ë
    /æj•  ã                   ó˜   — d dl Z d dl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 d dlmZ dgZdZ G d„ de	«      Zdeeef   d	eedf   fd
„Zy)é    N)Ú	cookiejar)ÚCookieÚ	CookieJarÚCookiePolicyÚDefaultCookiePolicy)ÚTYPE_CHECKINGÚIndexedCookieJaréÿ   c                   ó4  ‡ — e Zd ZU dZeeeeeeef   f   f   ed<   ej                  ed<   e
ed<   ej                  Zeed<   er!dedej"                  j$                  dee   fd	„Zd
eddfˆ fd„Zdˆ fd„Zdej"                  j$                  dee   fˆ fd„Zˆ xZS )r	   ap  
    A `CookieJar` whose per-request cost does not grow with the number of stored cookies.

    Compared to `CookieJar`, on each request it:

    1. Looks up only the domains that can match the request host, instead of checking every stored domain.
    2. Skips the expiry sweep until the earliest known expiry has passed, instead of checking every stored cookie.
    Ú_cookiesÚ_cookies_lockÚ_policyÚ_next_expiryÚdomainÚrequestÚreturnc                  ó   — y ©N© )Úselfr   r   s      úR/root/repos/pocs/video-evals/.venv/lib/python3.12/site-packages/httpx2/_cookies.pyÚ_cookies_for_domainz$IndexedCookieJar._cookies_for_domain!   s   � ó    ÚcookieNc                 óÈ   •— | j                   5  t        ‰| �	  |«       |j                  �%t	        | j
                  |j                  «      | _        d d d «       y # 1 sw Y   y xY wr   )r   ÚsuperÚ
set_cookieÚexpiresÚminr   )r   r   Ú	__class__s     €r   r   zIndexedCookieJar.set_cookie#   sU   ø€ Ø×Ññ 	KÜ‰GÑ˜vÔ&Ø�~‰~Ð)Ü$'¨×(9Ñ(9¸6¿>¹>Ó$J�Ô!÷	K÷ 	Kñ 	Kús   ŽAAÁA!c                 óö   •— t        j                   «       | j                  k  ry | j                  5  t        ‰| �  «        t        d„ | D «       t        j                  ¬«      | _        d d d «       y # 1 sw Y   y xY w)Nc              3   óN   K  — | ]  }|j                   €Œ|j                   –— Œ y ­wr   )r   )Ú.0Úcs     r   ú	<genexpr>z9IndexedCookieJar.clear_expired_cookies.<locals>.<genexpr>.   s   è ø€ Ò$V°1ÀÇ	Á	Ñ@U Q§Y¥YÑ$Vùs   ‚%”%)Údefault)Útimer   r   r   Úclear_expired_cookiesr   ÚmathÚinf)r   r    s    €r   r(   z&IndexedCookieJar.clear_expired_cookies)   sc   ø€ Ü�9‰9‹;˜×*Ñ*Ò*ØØ×Ññ 	jÜ‰GÑ)Ô+Ü #Ñ$V¸Ô$VÔ`d×`hÑ`hÔ iˆDÔ÷	j÷ 	jñ 	jús   °6A/Á/A8c                 óv  •— t        j                  |«      }t        | j                  «      j                  t
        j                  u }|r t        t        t        |«      «      t        kD  rt        ‰| �-  |«      S g }t        |«      D ]2  }|| j                  v sŒ|j                  | j                  ||«      «       Œ4 |S r   )r   Úeff_request_hostÚtyper   Údomain_return_okr   ÚmaxÚmapÚlenÚMAX_HOST_LENGTHr   Ú_cookies_for_requestÚ_matching_domainsr   Úextendr   )r   r   ÚhostsÚuses_default_matchingÚcookiesr   r    s         €r   r3   z%IndexedCookieJar._cookies_for_request0   s    ø€ Ü!*×!;Ñ!;¸GÓ!DˆÜ $ T§\¡\Ó 2× CÑ CÔGZ×GkÑGkÐ kÐÙ$¬¬C´°U«OÓ(<¼Ò(NÜ‘7Ñ/°Ó8Ð8à "ˆÜ'¨Ó.ò 	JˆFØ˜Ÿ™Ò&Ø—‘˜t×7Ñ7¸ÀÓHÕIð	Jð ˆr   )r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚdictÚstrr   Ú__annotations__Ú	threadingÚRLockr   r)   r*   r   Úfloatr   Úurllibr   ÚRequestÚlistr   r   r(   r3   Ú__classcell__)r    s   @r   r	   r	      s³   ø… ñð �3˜˜S $ s¨F {Ñ"3Ð3Ñ4Ð4Ñ5Ó5Ø—?‘?Ó"ØÓØŸ(™(€L�%Ó"áàh¨cÐh¸F¿N¹N×<RÑ<RÐhÐW[Ð\bÑWcÓhðK ð K¨Dõ Kõjð
¨F¯N©N×,BÑ,Bð 
ÀtÈFÁ|÷ 
ñ 
r   r6   r   c                 óÀ   — ddi}| D ]T  }|j                  d«      r|nd|› �}t        t        |«      dz
  dd«      D ]  }||   dk(  sŒd|||d <   d|||dz   d <   Œ  ŒV |S )zî
    Every cookie domain `DefaultCookiePolicy.domain_return_ok` can accept for these hosts, least specific first.

    For `a.example.org` that is `""`, `.org`, `org`, `.example.org`, `example.org`, `.a.example.org`, `a.example.org`.
    Ú Nú.é   éÿÿÿÿ)Ú
startswithÚranger1   )r6   ÚdomainsÚhostÚdottedÚindexs        r   r4   r4   =   sŒ   € ð �4ˆj€GØò 4ˆØŸ™¨Ô-‘°Q°t°f°:ˆÜœ3˜v›;¨™?¨B°Ó3ò 	4ˆEØ�e‰} Ó#Ø*.�˜˜u˜v˜Ñ'Ø/3�˜˜u q™y˜{Ð+Ò,ñ	4ð4ð €Nr   )r)   r@   r'   Úurllib.requestrC   Úhttpr   Úhttp.cookiejarr   r   r   r   Útypingr   Ú__all__r2   r	   Útupler>   r=   r4   r   r   r   ú<module>rX      s\   ðÛ Û Û Û Ý ß OÓ OÝ  àÐ
€ð €ô*�yô *ðZ˜U 3¨ 8™_ð °°c¸4°i±ô r   