
    hZ                       S SK Jr  S SKrS SKrS SKrS SKJr  SSKJr  SSK	J
r
  SSK	Jr  SSK	Jr  SS	K	Jr  SS
K	Jr  \R                  " S5      r         S                   SS jjr\R                  " S\R$                  \R&                  -  S9r\R                  " S5      rSS jr    S         SS jjrSSKJr  g)    )annotationsN)datetime   )
_dt_as_utc)generate_etag)
parse_date)parse_etags)parse_if_range_header)unquote_etagz&([Ww]/)?(?:"(.*?)"|(.*?))(?:\s*,\s*|$)c	                   Uc  Ub  [        U5      nOUb  [        S5      eSn	[        U[        5      (       a  [	        U5      nUb  [        UR                  SS95      nSn
U(       d  U b  [        U5      n
U
b  U
R                  b  U
R                  nO[	        U5      nU(       a  U(       a  X{::  a  Sn	U(       a  [        U5      u  p\[        R                  " [        U5      nU
b8  U
R                  b+  [        U
R                  5      R                  U5      n	U	(       + $ [        U5      nU(       a  UR                  U5      n	[        U5      nU(       a  UR!                  U5      (       + n	U	(       + $ )a  Convenience method for conditional requests.
:param http_range: Range HTTP header
:param http_if_range: If-Range HTTP header
:param http_if_modified_since: If-Modified-Since HTTP header
:param http_if_none_match: If-None-Match HTTP header
:param http_if_match: If-Match HTTP header
:param etag: the etag for the response for comparison.
:param data: or alternatively the data of the response to automatically
             generate an etag using :func:`generate_etag`.
:param last_modified: an optional date of the last modification.
:param ignore_if_range: If `False`, `If-Range` header will be taken into
                        account.
:return: `True` if the resource was modified, otherwise `False`.

.. versionadded:: 2.2
Nzboth data and etag givenFr   )microsecondT)r   	TypeError
isinstancestrr   r   replacer
   dater   tcastetagr	   containscontains_weak	is_strong)
http_rangehttp_if_rangehttp_if_modified_sincehttp_if_none_matchhttp_if_matchr   datalast_modifiedignore_if_range
unmodifiedif_rangemodified_since_if_none_matchif_matchs                  iC:\Users\ROHAN GUPTA\OneDrive\Desktop\mathbuddy-assessment\venv\Lib\site-packages\werkzeug/sansio/http.pyis_resource_modifiedr(      sN   6 |(T"		233J-%%"=1  "=#8#8Q#8#GHHz5 )7 9*2--#$:;-M,K
t$vvc4 HMM$=$X]]3<<TBJ  > ((:;M +88>

 #=1H!)!3!3D!99
>    zr
    ([^=;]*)
    (?:\s*=\s*
      (
        "(?:[^\\"]|\\.)*"
      |
        .*?
      )
    )?
    \s*;\s*
    )flagss   \\([0-3][0-7]{2}|.)c                ~    U R                  S5      n[        U5      S:X  a  U$ [        US5      R                  SS5      $ )N      big)grouplenintto_bytes)mvs     r'   _cookie_unslash_replacer5   s   s8    	
A
1v{q!9a''r)   c                   Uc  [         R                  n[        U [        5      (       a*  [        R
                  " S[        SS9  U R                  5       n Ub  [        R
                  " S[        SS9  OSnUb  [        R
                  " S[        SS9  OSnU (       d  U" 5       $ U  S3n / n[        R                  U 5       H  u  pVUR                  5       nUR                  5       nU(       d  M.  [        U5      S:  aP  US	   US
   s=:X  a  S:X  a=  O  O:[        R                  [        USS
 R                  5       5      R                  X5      nUR!                  XV45        M     U" U5      $ )a'  Parse a cookie from a string.

The same key can be provided multiple times, the values are stored
in-order. The default :class:`MultiDict` will have the first value
first, and all values can be retrieved with
:meth:`MultiDict.getlist`.

:param cookie: The cookie header as a string.
:param cls: A dict-like class to store the parsed cookies in.
    Defaults to :class:`MultiDict`.

.. versionchanged:: 2.3
    Passing bytes, and the ``charset`` and ``errors`` parameters, are deprecated and
    will be removed in Werkzeug 3.0.

.. versionadded:: 2.2
zoThe 'cookie' parameter must be a string. Passing bytes is deprecated and will not be supported in Werkzeug 3.0.r   )
stacklevelzIThe 'charset' parameter is deprecated and will be removed in Werkzeug 3.0zutf-8zHThe 'errors' parameter is deprecated and will be removed in Werkzeug 3.0r   ;r   "r,   )ds	MultiDictr   byteswarningswarnDeprecationWarningdecode
_cookie_refindallstripr0   _cookie_unslash_resubr5   encodeappend)cookiecharseterrorsclsoutckcvs          r'   parse_cookierP   |   s=   . {ll&%  6		
 W	
 V	
 uxq\F
C$$V,XXZXXZr7a<BqERV2s2#'''Ab):fW%  	

B8 - s8Or)   )datastructures)	NNNNNNNNT)r   
str | Noner   rR   r   rR   r   rR   r   rR   r   rR   r   zbytes | Noner   zdatetime | str | Noner    boolreturnrS   )r3   zt.Match[bytes]rT   r=   )NNNN)
rI   rR   rJ   rR   rK   rR   rL   ztype[ds.MultiDict] | NonerT   zds.MultiDict[str, str])
__future__r   retypingr   r>   r   	_internalr   httpr   r   r	   r
   r   compile_etag_rer(   ASCIIVERBOSErB   rE   r5   rP    rQ   r;    r)   r'   <module>r`      sN   " 	    "     ( ::?@ " $)-%) $+/ MMM 'M #	M
 M M M )M M 
M` ZZ
 ((RZZ

 ZZ 78 ( %)	JJJ J 
#	J
 J\ $r)   