
    %h%                       S SK Jr  S SKJr  S SKrS SKJr  SSK	J
r
  SSKJr  SS.         SS jjr " S	 S
\\\R                  \   4   5      r " S S\
\\R                  \   4   \5      r " S S\5      rSSKJr  g)    )annotationsN)cleandoc   )ImmutableDictMixin)CallbackDictdocc               x  ^ ^^ Uc  ST  S3/nT[         L a  UR                  S5        O^Tc  UR                  S5        OUR                  STR                   S35        Tb  UR                  ST< S35        UR                  S	5        S
R                  U5      n[	        UU U4S jU U4S jU 4S j[        U5      S9$ )a  Return a new property object for a cache header. Useful if you
want to add support for a cache extension in a subclass.

:param key: The attribute name present in the parsed cache-control header dict.
:param empty: The value to use if the key is present without a value.
:param type: The type to convert the string value to instead of a string. If
    conversion raises a ``ValueError``, the returned value is ``None``.
:param doc: The docstring for the property. If not given, it is generated
    based on the other params.

.. versionchanged:: 3.1
    Added the ``doc`` param.

.. versionchanged:: 2.0
    Renamed from ``cache_property``.
zThe ``z`` attribute.z"A ``bool``, either present or not.z
A ``str``,zA ``z``,z``z`` if present with no value,zor ``None`` if not present. c                *   > U R                  TTT5      $ N)_get_cache_value)xemptykeytypes    ]/var/www/auris/envauris/lib/python3.13/site-packages/werkzeug/datastructures/cache_control.py<lambda>(cache_control_property.<locals>.<lambda>1   s    !$$S%6    c                *   > U R                  TUT5      $ r   )_set_cache_value)r   vr   r   s     r   r   r   2   s    Q''Q5r   c                &   > U R                  T5      $ r   )_del_cache_value)r   r   s    r   r   r   3   s    !$$S)r   r   )boolappend__name__joinpropertyr   )r   r   r   r	   partss   ```  r   cache_control_propertyr"      s    & {#m,-4<LL=>|\*tDMM?#67 r%*FGHLL67hhuo65)SM	 r   c                  $  ^  \ rS rSr% Sr\" SS\5      rS\S'   \" SS\	5      r
S\S	'   \" S
S\5      rS\S'   \" SS\	5      rS\S'     S   SU 4S jjj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\" \5      rSrU =r$ )_CacheControl8   ad  Subclass of a dict that stores values for a Cache-Control header.  It
has accessors for all the cache-control directives specified in RFC 2616.
The class does not differentiate between request and response directives.

Because the cache-control directives in the HTTP header use dashes the
python descriptors use underscores for that.

To get a header of the :class:`CacheControl` object again you can convert
the object into a string or call the :meth:`to_header` method.  If you plan
to subclass it and add your own items have a look at the sourcecode for
that class.

.. versionchanged:: 3.1
    Dict values are always ``str | None``. Setting properties will
    convert the value to a string. Setting a non-bool property to
    ``False`` is equivalent to setting it to ``None``. Getting typed
    properties will return ``None`` if conversion raises
    ``ValueError``, rather than the string.

.. versionchanged:: 2.1
    Setting int properties such as ``max_age`` will convert the
    value to an int.

.. versionchanged:: 0.4
   Setting ``no_cache`` or ``private`` to ``True`` will set the
   implicit value ``"*"``.
zno-storeNr   no_storezmax-age
int | Nonemax_agezno-transformno_transformzstale-if-errorstale_if_errorc                6   > [         TU ]  X5        US LU l        g r   )super__init__provided)selfvalues	on_update	__class__s      r   r-   _CacheControl.__init__Z   s    
 	+d*r   c                z    U[         L a  X;   $ X;  a  gX   =nc  U$ Ub   U" U5      nU$ U$ ! [         a     gf = f+Used internally by the accessor properties.N)r   
ValueError)r/   r   r   r   values        r   r   _CacheControl._get_cache_valueb   s`     4<;?YE'LU u  s   - 
::c                    U[         L a  U(       a  SX'   gU R                  US5        gUb  USL a  U R                  US5        gUSL a  SX'   gUb  U" U5      n[        U5      X'   g)r6   NFT)r   popstr)r/   r   r8   r   s       r   r   _CacheControl._set_cache_valuew   sd     4< 	d#]eunHHS$d]DIUE
DIr   c                    X;   a  X	 ggr5    )r/   r   s     r   r   _CacheControl._del_cache_value   s    ;	 r   c                .    [         R                  " U 5      $ )z6Convert the stored values into a cache control header.)httpdump_headerr/   s    r   	to_header_CacheControl.to_header   s    %%r   c                "    U R                  5       $ r   )rE   rD   s    r   __str___CacheControl.__str__   s    ~~r   c                    SR                  S [        U R                  5       5       5       5      nS[        U 5      R                   SU S3$ )Nr   c              3  6   #    U  H  u  pU S U< 3v   M     g7f)=Nr?   ).0kr   s      r   	<genexpr>)_CacheControl.__repr__.<locals>.<genexpr>   s     H3G41QCq,3Gs   <>)r   sorteditemsr   r   )r/   kv_strs     r   __repr___CacheControl.__repr__   sA    H6$**,3GHH4:&&'q22r   )r.   )r?   N)r0   zBcabc.Mapping[str, t.Any] | cabc.Iterable[tuple[str, t.Any]] | Noner1   z+cabc.Callable[[_CacheControl], None] | None)r   r<   r   t.Anyr   type[t.Any] | NonereturnrX   )r   r<   r8   rX   r   rY   rZ   None)r   r<   rZ   r[   )rZ   r<   )r   
__module____qualname____firstlineno____doc__r"   r   r&   __annotations__intr(   r)   r*   r-   r   r   r   rE   rH   rV   staticmethodcache_property__static_attributes____classcell__)r2   s   @r   r$   r$   8   s    8 ,JdCHdC0D#FGZF/dKL$K!78H$PS!TNJT VXAE+R+ ?+ +$,>	*##$#,>#	#&
& 3 ""89Nr   r$   c                      \ rS rSr% Sr\" SS\5      rS\S'   \" SS\	5      r
S	\S
'   \" SS\	5      rS\S'   \" SS\5      rS\S'   Srg)RequestCacheControl   a  A cache control for requests.  This is immutable and gives access
to all the request-relevant cache control headers.

To get a header of the :class:`RequestCacheControl` object again you can
convert the object into a string or call the :meth:`to_header` method.  If
you plan to subclass it and add your own items have a look at the sourcecode
for that class.

.. versionchanged:: 3.1
    Dict values are always ``str | None``. Setting properties will
    convert the value to a string. Setting a non-bool property to
    ``False`` is equivalent to setting it to ``None``. Getting typed
    properties will return ``None`` if conversion raises
    ``ValueError``, rather than the string.

.. versionchanged:: 3.1
   ``max_age`` is ``None`` if present without a value, rather
   than ``-1``.

.. versionchanged:: 3.1
    ``no_cache`` is a boolean, it is ``True`` instead of ``"*"``
    when present.

.. versionchanged:: 3.1
    ``max_stale`` is ``True`` if present without a value, rather
    than ``"*"``.

.. versionchanged:: 3.1
   ``no_transform`` is a boolean. Previously it was mistakenly
   always ``None``.

.. versionchanged:: 3.1
   ``min_fresh`` is ``None`` if present without a value, rather
   than ``"*"``.

.. versionchanged:: 2.1
    Setting int properties such as ``max_age`` will convert the
    value to an int.

.. versionadded:: 0.5
    Response-only properties are not present on this request class.
no-cacheNr   no_cachez	max-staleTzint | t.Literal[True] | None	max_stalez	min-freshr'   	min_freshzonly-if-cachedonly_if_cachedr?   )r   r\   r]   r^   r_   r"   r   rj   r`   ra   rk   rl   rm   rd   r?   r   r   rg   rg      sa    )V ,JdCHdC.D/I+ 
 3;cJIzJ12BD$ONDOr   rg   c                  (   \ rS rSr% Sr\" SSS5      rS\S'   \" SS\5      r	S	\S'   \" S
SS5      r
S\S
'   \" SS\5      rS	\S'   \" SS\5      rS	\S'   \" SS\5      rS\S'   \" SS\5      rS	\S'   \" SS\5      rS	\S'   \" SS\5      rS\S'   Srg)ResponseCacheControl   a  A cache control for responses.  Unlike :class:`RequestCacheControl`
this is mutable and gives access to response-relevant cache control
headers.

To get a header of the :class:`ResponseCacheControl` object again you can
convert the object into a string or call the :meth:`to_header` method.  If
you plan to subclass it and add your own items have a look at the sourcecode
for that class.

.. versionchanged:: 3.1
    Dict values are always ``str | None``. Setting properties will
    convert the value to a string. Setting a non-bool property to
    ``False`` is equivalent to setting it to ``None``. Getting typed
    properties will return ``None`` if conversion raises
    ``ValueError``, rather than the string.

.. versionchanged:: 3.1
    ``no_cache`` is ``True`` if present without a value, rather than
    ``"*"``.

.. versionchanged:: 3.1
    ``private`` is ``True`` if present without a value, rather than
    ``"*"``.

.. versionchanged:: 3.1
   ``no_transform`` is a boolean. Previously it was mistakenly
   always ``None``.

.. versionchanged:: 3.1
    Added the ``must_understand``, ``stale_while_revalidate``, and
    ``stale_if_error`` properties.

.. versionchanged:: 2.1.1
    ``s_maxage`` converts the value to an int.

.. versionchanged:: 2.1
    Setting int properties such as ``max_age`` will convert the
    value to an int.

.. versionadded:: 0.5
   Request-only properties are not present on this response class.
ri   TNzstr | t.Literal[True] | Nonerj   publicr   privatezmust-revalidatemust_revalidatezproxy-revalidateproxy_revalidatezs-maxager'   s_maxage	immutablezmust-understandmust_understandzstale-while-revalidatestale_while_revalidater?   )r   r\   r]   r^   r_   r"   rj   r`   r   rq   rr   rs   rt   ra   ru   rv   rw   rx   rd   r?   r   r   ro   ro      s    )V .DD$.H*  *(D$?FD?,B4-G)  33DdDQOTQ34FdSdS1*dCHHjH,[$EItE23DdDQOTQ)? $*J r   ro      )rB   )
r   r<   r   rX   r   rY   r	   z
str | NonerZ   rX   )
__future__r   collections.abcabccabctypingtinspectr   mixinsr   
structuresr   r"   r<   Optionalr$   rg   ro    rB   r?   r   r   <module>r      s    "    & $ LP*	**"4*>H*
*Zb:Lajjo!56 b:J3P,S!**S/-ABM 3Pl:= :| r   