+
     h  c                  s    ^ RI Ht ^ RIt^ RIt^ RIHtHtHt ^ RIHtH	t	H
t
 ^ RIHtHtHt ]'       d   ^ RIHt RtRR R	 lltR
 R lt ! R R4      t ! R R]4      t ! R R]4      t ! R R]4      tR# )i    )annotationsN)datetime	timedeltatimezone)
formatdate	parsedateparsedate_tz)TYPE_CHECKINGAnyMapping)HTTPResponsez%a, %d %b %Y %H:%M:%S GMTc               s$    V ^8  d   QhRRRRRR/# )   deltar   datezdatetime | Nonereturnr    Zformat   "H/usr/lib/python3.14/site-packages/pip/_vendor/cachecontrol/heuristics.py__annotate__r      s!      	  H     c                sn    T;'       g%    \         P                  ! \        P                  4      pW,           # N)r   nowr   utc)r   r      &&r   expire_afterr      s$    --8<<-D<r   c                    V ^8  d   QhRRRR/# )r   dtr   r   Zstrr   r   r   r   r   r      s     7 78 7 7r   c                s\    \        \        P                  ! V P                  4       4      4      # r   )r   calendartimegmZ	timetuple)r   s   &r   datetime_to_headerr      s    hooblln566r   c                  s:    ] tR t^tR R ltR R ltR R ltRtR# )	BaseHeuristicc               r   r   responser
   r   
str | Noner   r   r   r   r   BaseHeuristic.__annotate__   s     	+ 	+ 	+ 	+r   c                s    R# )z
Return a valid 1xx warning header value describing the cache
adjustments.

The response is provided too allow warnings like 113
http://tools.ietf.org/html/rfc7234#section-5.5.4 where we need
to explicitly say response is over 24 hours old.
z110 - "Response is Stale"r   selfr!   r   r   warningZBaseHeuristic.warning   s     +r   c               r   r   r!   r
   r   dict[str, str]r   r   r   r   r   r#   '   s      |  r   c                s    / # )zUpdate the response headers with any new headers.

NOTE: This SHOULD always include some Warning header to
      signify that the response was cached by the client, not
      by way of the provided headers.
r   r$   r   r   update_headersZBaseHeuristic.update_headers'   s	     	r   c               s     V ^8  d   QhRRRR/# )r   r!   r
   r   r   r   r   r   r   r#   0   s     	 	l 	| 	r   c                	s    V P                  V4      pV'       dN   VP                  P                  V4       V P                  V4      pVe   VP                  P                  RV/4       V# )NZWarning)r)   headersZupdater&   )r%   r!   Zupdated_headersZwarning_header_values   &&  r   applyZBaseHeuristic.apply0   s]    --h7##O4#'<<#9 #/  ''4H(IJr   r   N)__name__
__module____qualname____firstlineno__r&   r)   r+   __static_attributes__r   r   r   r   r      s    	+	 	r   r   c                  s&    ] tR t^<tRtR R ltRtR# )OneDayCachezA
Cache the response by providing an expires 1 day in the
future.
c               r   r'   r   r   r   r   r   ZOneDayCache.__annotate__B   s      |  r   c                	s    / pR VP                   9  de   \        VP                   R,          4      p\        \        ^R7      \	        VR,          R\
        P                  / R7      p\        V4      VR &   RVR&   V# )expiresr   )ZdaysNi   NZtzinfo)r   publiccache-control)r*   r   r   r   r   r   r   r   )r%   r!   r*   r   r2   s   &&   r   r)   ZOneDayCache.update_headersB   sq    H,,,X--f56D"q!tBx==G "4G!<GI'/GO$r   r   N)r,   r-   r.   r/   __doc__r)   r0   r   r   r   r1   r1   <   s    
 r   r1   c                  s>    ] tR t^PtRtR R ltR R ltR R ltRtR	# )
ExpiresAfterz3
Cache **all** requests for a defined time period.
c               r   )r   kwr   r   ZNoner   r   r   r   r   ExpiresAfter.__annotate__U   s     % %S %T %r   c                	s&    \        R/ VB V n        R # )Nr   )r   r   )r%   r8   s   &,r   __init__ZExpiresAfter.__init__U   s    __
r   c               r   r'   r   r   r   r   r   r9   X   s     S S| S Sr   c                	sJ    \        V P                  4      pR \        V4      RR/# )r2   r5   r4   )r   r   r   )r%   r!   r2      && r   r)   ZExpiresAfter.update_headersX   s%    tzz*-g6RRr   c               r   r    r   r   r   r   r   r9   \   s     ! ! ! !r   c                	s*    R pW P                   ,          # )z:110 - Automatically cached for %s. Response might be staler   )r%   r!   Ztmplr;   r   r&   ZExpiresAfter.warning\   s    Kjj  r   r<   N)	r,   r-   r.   r/   r6   r:   r)   r&   r0   r   r   r   r7   r7   P   s    %S! !r   r7   c                  s:    ] tR t^atRt0 RmtR R ltR R ltRtR# )	LastModifieda  
If there is no Expires header already, fall back on Last-Modified
using the heuristic from
http://tools.ietf.org/html/rfc7234#section-4.2.2
to calculate a reasonable value.

Firefox also does something like this per
https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching_FAQ
http://lxr.mozilla.org/mozilla-release/source/netwerk/protocol/http/nsHttpResponseHead.cpp#397
Unlike mozilla we limit this to 24-hr.
c               r   )r   respr
   r   r(   r   r   r   r   r   LastModified.__annotate__|   s     J J< JN Jr   c                	s   VP                   pR V9   d   / # RV9   d   VR,          R8w  d   / # VP                  V P                  9  d   / # RV9  g   RV9  d   / # \        VR,          4      pVf   Q h\        P
                  ! VR,          4      p\        VR,          4      pVf   / # \        P                  ! 4       p\        ^ Wd,
          4      pV\        P
                  ! V4      ,
          p\        ^ \        V^
,          R4      4      p	W8:  d   / # WI,           p
R \        P                  ! \        \        P                  ! V
4      4      /# )r2   r5   r4   r   zlast-modifiedr3   iQ )r*   Zstatuscacheable_by_default_statusesr   r   r   r   timeZmaxZminZstrftimeTIME_FMTZgmtime)r%   r>   r*   Z
time_tupler   Zlast_modifiedr   Zcurrent_ager   Zfreshness_lifetimer2   s   &&         r   r)   ZLastModified.update_headers|   s   %)\\Ig%'/*Bh*NI;;d@@@I O7$BI!'&/2
%%%z"~.!'/":; Iiik!SZ(x}55 C
I$>?,I+4==4;;w3GHIIr   c               r   )r   r>   r
   r   r"   r   r   r   r   r   r?      s      L Z r   c                	s    R # r   r   )r%   r>   r   r   r&   ZLastModified.warning   s    r   r   N>   i,  i-  i  i  i  i  i   i   i   i   i  )	r,   r-   r.   r/   r6   r@   r)   r&   r0   r   r   r   r=   r=   a   s     
%!J@ r   r=   r   )Z
__future__r    r   rA   r   r   r   Zemail.utilsr   r   r   Ztypingr   r   r	   Zpip._vendor.urllib3r
   rB   r   r   r   r1   r7   r=   r   r   r   <module>rC      sf    #   2 2 ; ; . .0&
7 B- (!= !"<= <r   