+
    iD                       ^ RI Ht ^ RIt^ RIHt ^ RIHtHt ^ RIH	t	 ]P                  '       d   ^ RIHt ^ RIHt  ! R R	]4      tR
R.t]P                   ! R4      t]P                   ! R4      t]P                   ! R4      t]P(                  R]P*                  ]]3,          ]P.                  ]]]3,          ,          R	3,          t ! R R]4      tR R lt ! R R
]P8                  ]]3,          ]P:                  ]]3,          4      t ! R R]]]]3,          ,          4      t  ! R R]P:                  ]]3,          4      t!R# )    )annotationsN)OrderedDict)Enumauto)RLock)Protocol)Selfc                  .    ] tR t^tR R ltR R ltRtR# )HasGettableStringKeysc                   V ^8  d   QhRR/#    returnztyping.Iterator[str] )formats   "Z/Users/ahmad/.openclaw/workspace/venv/lib/python3.14/site-packages/urllib3/_collections.py__annotate__"HasGettableStringKeys.__annotate__   s    33.3    c                	    R # Nr   selfs   &r   keysHasGettableStringKeys.keys       r   c                    V ^8  d   QhRRRR/# r   keystrr   r   )r   s   "r   r   r      s    333333r   c                	    R # r   r   r   r   s   &&r   __getitem__!HasGettableStringKeys.__getitem__   r   r   r   N)__name__
__module____qualname____firstlineno__r   r#   __static_attributes__r   r   r   r   r      s    333r   r   RecentlyUsedContainerHTTPHeaderDict_KT_VT_DTc                  $    ] tR t^'t]! 4       tRtR# )	_Sentinelr   N)r%   r&   r'   r(   r   
not_passedr)   r   r   r   r0   r0   '   s	    Jr   r0   c                    V ^8  d   QhRRRR/# )r   	potentialobjectr   ValidHTTPHeaderSource | Noner   )r   s   "r   r   r   +   s      !r   c                   \        V \        4      '       d   V # \        V \        P                  4      '       d7   \        P                  ! \        P                  \
        \
        3,          V 4      # \        V \        P                  4      '       dB   \        P                  ! \        P                  \        \
        \
        3,          ,          V 4      # \        V R 4      '       d*   \        V R4      '       d   \        P                  ! RV 4      # R# )r   r#   r   N)	
isinstancer+   typingMappingcastr    Iterabletuplehasattr)r3   s   &r   %ensure_can_construct_http_header_dictr>   +   s     )^,,	Iv~~	.	. {{6>>#s(3Y??	Iv	/	/ {{6??5c?;YGG	F	#	#	=(I(I{{2I>>r   c                     a  ] tR t^?t$ RtR]R&   R]R&   R]R&   R]R	&   RR
 V 3R llltR R ltR R ltR R lt	R R lt
R R ltR R ltR R ltRtV ;t# )r*   am  
Provides a thread-safe dict-like container which maintains up to
``maxsize`` keys while throwing away the least-recently-used keys beyond
``maxsize``.

:param maxsize:
    Maximum number of recent elements to retain.

:param dispose_func:
    Every time an item is evicted from the container,
    ``dispose_func(value)`` is called.  Callback which will get called
ztyping.OrderedDict[_KT, _VT]
_containerint_maxsize#typing.Callable[[_VT], None] | Nonedispose_funcr   lockc               $    V ^8  d   QhRRRRRR/# )r   maxsizerA   rD   rC   r   Noner   )r   s   "r   r   "RecentlyUsedContainer.__annotate__R   s(     	 		 :	 
		r   c                	x   < \         SV `  4        Wn        W n        \	        4       V n        \        4       V n        R # r   )super__init__rB   rD   r   r@   r   rE   )r   rG   rD   	__class__s   &&&r   rL   RecentlyUsedContainer.__init__R   s-    
 	(%-G	r   c                    V ^8  d   QhRRRR/# )r   r   r,   r   r-   r   )r   s   "r   r   rI   ]   s      s s r   c                	    V P                   ;_uu_ 4        V P                  P                  V4      pW P                  V&   VuuR R R 4       #   + '       g   i     R # ; ir   )rE   r@   pop)r   r   items   && r   r#   !RecentlyUsedContainer.__getitem__]   s:    YYY??&&s+D#'OOC  YYYs   +AA	c               $    V ^8  d   QhRRRRRR/# )r   r   r,   valuer-   r   rH   r   )r   s   "r   r   rI   d   s!     - -s -3 -4 -r   c                	   R pV P                   ;_uu_ 4         WP                  P                  V4      3pW P                  V&   R R R 4       Ve,   V P                  '       d   Vw  rEV P                  V4       R # R # R #   \         dR    Y P                  T&   \	        T P                  4      T P
                  8  d   T P                  P                  RR7      p Li ; i  + '       g   i     L; i)NF)last)rE   r@   rQ   KeyErrorlenrB   popitemrD   )r   r   rU   evicted_item_evicted_values   &&&   r   __setitem__!RecentlyUsedContainer.__setitem__d   s    YYYG  #OO$7$7$<<',$ & #(9(9(9+Am, ):#  G (-$t'$--7 $(??#:#:#:#FLG Ys)   C*A<<ACCCCC+	c                    V ^8  d   QhRRRR/# )r   r   r,   r   rH   r   )r   s   "r   r   rI   }   s     % %s %t %r   c                	    V P                   ;_uu_ 4        V P                  P                  V4      pR R R 4       V P                  '       d   V P                  X4       R # R #   + '       g   i     L7; ir   )rE   r@   rQ   rD   )r   r   rU   s   && r   __delitem__!RecentlyUsedContainer.__delitem__}   sM    YYYOO'',E  e$  Ys   A  A0	c                   V ^8  d   QhRR/# r   r   rA   r   )r   s   "r   r   rI      s     ( ( (r   c                	    V P                   ;_uu_ 4        \        V P                  4      uuR R R 4       #   + '       g   i     R # ; ir   )rE   rY   r@   r   s   &r   __len__RecentlyUsedContainer.__len__   s#    YYYt' YYYs	   5A	c                   V ^8  d   QhRR/# )r   r   ztyping.NoReturnr   )r   s   "r   r   rI      s     
 
/ 
r   c                	    \        R 4      h)z7Iteration over this class is unlikely to be threadsafe.)NotImplementedErrorr   s   &r   __iter__RecentlyUsedContainer.__iter__   s    !E
 	
r   c                   V ^8  d   QhRR/# )r   r   rH   r   )r   s   "r   r   rI      s     ) )t )r   c                	<   V P                   ;_uu_ 4        \        V P                  P                  4       4      pV P                  P	                  4        R R R 4       V P
                  '       d   X F  pV P                  V4       K  	  R # R #   + '       g   i     L@; ir   )rE   listr@   valuesclearrD   )r   rq   rU   s   &  r   rr   RecentlyUsedContainer.clear   sj    YYY$//0023FOO!!# 
 !!%(    Ys   >BB	c                   V ^8  d   QhRR/# )r   r   zset[_KT]r   )r   s   "r   r   rI      s     / /h /r   c                	    V P                   ;_uu_ 4        \        V P                  P                  4       4      uuR R R 4       #   + '       g   i     R # ; ir   )rE   setr@   r   r   s   &r   r   RecentlyUsedContainer.keys   s,    YYYt++-. YYYs   #AA	)r@   rB   rD   rE   )
   N)r%   r&   r'   r(   __doc____annotations__rL   r#   r^   rb   rg   rl   rr   r   r)   __classcell__rM   s   @r   r*   r*   ?   sR     -,M55
K	 	-2%(

)/ /r   c                  V    ] tR t^t$ RtR]R&   R R ltR R ltR R	 ltR
 R lt	Rt
R# )HTTPHeaderDictItemViewa;  
HTTPHeaderDict is unusual for a Mapping[str, str] in that it has two modes of
address.

If we directly try to get an item with a particular name, we will get a string
back that is the concatenated version of all the values:

>>> d['X-Header-Name']
'Value1, Value2, Value3'

However, if we iterate over an HTTPHeaderDict's items, we will optionally combine
these values based on whether combine=True was called when building up the dictionary

>>> d = HTTPHeaderDict({"A": "1", "B": "foo"})
>>> d.add("A", "2", combine=True)
>>> d.add("B", "bar")
>>> list(d.items())
[
    ('A', '1, 2'),
    ('B', 'foo'),
    ('B', 'bar'),
]

This class conforms to the interface required by the MutableMapping ABC while
also giving us the nonstandard iteration behavior we want; items with duplicate
keys, ordered by time of first insertion.
r+   _headersc                    V ^8  d   QhRRRR/# )r   headersr+   r   rH   r   )r   s   "r   r   #HTTPHeaderDictItemView.__annotate__   s          4  r   c                	    Wn         R # r   r   )r   r   s   &&r   rL   HTTPHeaderDictItemView.__init__   s    r   c                   V ^8  d   QhRR/# re   r   )r   s   "r   r   r      s     4 4 4r   c                	Z    \        \        V P                  P                  4       4      4      # r   )rY   rp   r   	iteritemsr   s   &r   rg   HTTPHeaderDictItemView.__len__   s    4//1233r   c                   V ^8  d   QhRR/# r   r   z typing.Iterator[tuple[str, str]]r   )r   s   "r   r   r      s     ) ): )r   c                	6    V P                   P                  4       # r   )r   r   r   s   &r   rl   HTTPHeaderDictItemView.__iter__   s    }}&&((r   c                    V ^8  d   QhRRRR/# )r   rR   r4   r   boolr   )r   s   "r   r   r      s       D r   c                	    \        V\        4      '       d\   \        V4      ^8X  dL   Vw  r#\        V\        4      '       d2   \        V\        4      '       d   V P                  P                  W#4      # R# )r   F)r7   r<   rY   r    r   _has_value_for_header)r   rR   
passed_key
passed_vals   &&  r   __contains__#HTTPHeaderDictItemView.__contains__   sR    dE""s4yA~%)"J*c**z*c/J/J}}:::RRr   r   N)r%   r&   r'   r(   ry   rz   rL   rg   rl   r   r)   r   r   r   r~   r~      s(    8  4) r   r~   c                    a  ] tR t^t$ RtR]R&   R=R V 3R llltR R ltR R	 ltR
 R lt	R R lt
R>R V 3R llltR R ltR R ltR R ltR R ltR R ltRR/R R lltR R lt]P(                  R  R! l4       t]P(                  R" R# l4       t]P.                  3R$ R% lltR& R' lt]t]t]t]tR( R) ltR* R+ ltR, R- ltR. R/ lt R0 R1 lt!R2 R3 lt"R4 R5 lt#R6 R7 lt$R8 R9 lt%R: R; lt&R<t'V ;t(# )?r+   a  
:param headers:
    An iterable of field-value pairs. Must not contain multiple field names
    when compared case-insensitively.

:param kwargs:
    Additional field-value pairs to pass in to ``dict.update``.

A ``dict`` like container for storing HTTP Headers.

Field names are stored and compared case-insensitively in compliance with
RFC 7230. Iteration provides the first case-sensitive key seen for each
case-insensitive pair.

Using ``__setitem__`` syntax overwrites fields that compare equal
case-insensitively in order to maintain ``dict``'s api. For fields that
compare equal, instead create a new ``HTTPHeaderDict`` and use ``.add``
in a loop.

If multiple fields that are equal case-insensitively are passed to the
constructor or ``.update``, the behavior is undefined and some will be
lost.

>>> headers = HTTPHeaderDict()
>>> headers.add('Set-Cookie', 'foo=bar')
>>> headers.add('set-cookie', 'baz=quxx')
>>> headers['content-length'] = '7'
>>> headers['SET-cookie']
'foo=bar, baz=quxx'
>>> headers['Content-Length']
'7'
z%typing.MutableMapping[str, list[str]]r@   c                    V ^8  d   QhRRRR/# )r   r   r5   kwargsr    r   )r   s   "r   r   HTTPHeaderDict.__annotate__   s     	  	  < 	 s 	 r   c                	   < \         SV `  4        / V n        Ve:   \        V\        4      '       d   V P                  V4       MV P                  V4       V'       d   V P                  V4       R # R # r   )rK   rL   r@   r7   r+   
_copy_fromextend)r   r   r   rM   s   &&,r   rL   HTTPHeaderDict.__init__   sT    '>22(G$KK r   c               $    V ^8  d   QhRRRRRR/# )r   r   r    valr   rH   r   )r   s   "r   r   r      s!     2 2s 2 2 2r   c                	    \        V\        4      '       d   VP                  R 4      pW.V P                  VP	                  4       &   R# latin-1Nr7   bytesdecoder@   lowerr   r   r   s   &&&r   r^   HTTPHeaderDict.__setitem__   s3    c5!!**Y'C(+z		$r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r     s     " "s "s "r   c                	    \        V\        4      '       d   VP                  R 4      pV P                  VP	                  4       ,          pRP                  VR,          4      # )r   ,    NN)r7   r   r   r@   r   joinr   s   && r   r#   HTTPHeaderDict.__getitem__  sD    c5!!**Y'Coociik*yyR!!r   c                    V ^8  d   QhRRRR/# r   r   r    r   rH   r   )r   s   "r   r   r     s     ) )s )t )r   c                	    \        V\        4      '       d   VP                  R 4      pV P                  VP	                  4        R# r   r   r"   s   &&r   rb   HTTPHeaderDict.__delitem__  s/    c5!!**Y'COOCIIK(r   c                    V ^8  d   QhRRRR/# )r   r   r4   r   r   r   )r   s   "r   r   r     s       4 r   c                	    \        V\        4      '       d   VP                  R 4      p\        V\        4      '       d   VP	                  4       V P
                  9   # R# )r   F)r7   r   r   r    r   r@   r"   s   &&r   r   HTTPHeaderDict.__contains__  sB    c5!!**Y'Cc399;$//11r   c               $    V ^8  d   QhRRRRRR/# )r   r   r    defaultr   r   )r   s   "r   r   r     s!     0 0c 0C 0 0r   c                	"   < \         SV `  W4      # r   )rK   
setdefault)r   r   r   rM   s   &&&r   r   HTTPHeaderDict.setdefault  s    w!#//r   c                    V ^8  d   QhRRRR/# r   otherr4   r   r   r   )r   s   "r   r   r     s     	
 	
F 	
t 	
r   c                	,   \        V4      pVf   R# \        V 4      ! V4      pV P                  4        UUu/ uF  w  rEVP                  4       VbK  	  uppVP                  4        UUu/ uF  w  rEVP                  4       VbK  	  upp8H  # u uppi u uppi )NF)r>   type
itermergedr   )r   r   maybe_constructableother_as_http_header_dictkvs   &&    r   __eq__HTTPHeaderDict.__eq__  s    CEJ&(,T
3F(G%)-):;):	1):;%>%I%I%K@
%KTQAGGIqL%K@
 
 	
; @
s   B
(Bc                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   !  s     & &F &t &r   c                	.    V P                  V4      '       * # r   )r   )r   r   s   &&r   __ne__HTTPHeaderDict.__ne__!  s    ;;u%%%r   c                   V ^8  d   QhRR/# re   r   )r   s   "r   r   r   $  s     $ $ $r   c                	,    \        V P                  4      # r   )rY   r@   r   s   &r   rg   HTTPHeaderDict.__len__$  s    4??##r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   '  s      . r   c              #  	f   "   V P                   P                  4        F  pV^ ,          x  K  	  R# 5i)r   N)r@   rq   )r   valss   & r   rl   HTTPHeaderDict.__iter__'  s%     OO**,Dq'M -s   /1c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   ,  s      3 4 r   c                	0     W R #   \          d     R # i ; ir   )rX   r"   s   &&r   discardHTTPHeaderDict.discard,  s    		 		s    combineFc               (    V ^8  d   QhRRRRRRRR/# )r   r   r    r   r   r   r   rH   r   )r   s   "r   r   r   2  s(     !! !!s !! !!$ !!4 !!r   c               L   \        V\        4      '       d   VP                  R4      pVP                  4       pW.pV P                  P                  WE4      pWVJdJ   \        V4      ^8  g   Q hV'       d   VR,          R,           V,           VR&   R# VP                  V4       R# R# )a  Adds a (name, value) pair, doesn't overwrite the value if it already
exists.

If this is called with combine=True, instead of adding a new header value
as a distinct item during iteration, this will instead append the value to
any existing header value with a comma. If no existing header value exists
for the key, then the value will simply be added, ignoring the combine parameter.

>>> headers = HTTPHeaderDict(foo='bar')
>>> headers.add('Foo', 'baz')
>>> headers['foo']
'bar, baz'
>>> list(headers.items())
[('foo', 'bar'), ('foo', 'baz')]
>>> headers.add('foo', 'quz', combine=True)
>>> list(headers.items())
[('foo', 'bar, baz, quz')]
r   r   N)r7   r   r   r   r@   r   rY   append)r   r   r   r   	key_lowernew_valsr   s   &&&$   r   addHTTPHeaderDict.add2  s    ( c5!!**Y'CIIK	:)))> t9>!>8d?S0RC   r   c               $    V ^8  d   QhRRRRRR/# )r   argsValidHTTPHeaderSourcer   r    r   rH   r   )r   s   "r   r   r   U  s"     ! !1 !S !T !r   c                   \        V4      ^8  d   \        R\        V4       R24      h\        V4      ^8  d
   V^ ,          MRp\        V\        4      '       d-   VP	                  4        F  w  rEV P                  WE4       K  	  EM\        V\        P                  4      '       d,   VP                  4        F  w  rEV P                  WE4       K  	  M\        V\        P                  4      '       d_   \        P                  ! \        P                  \        \        \        3,          ,          V4      pV F  w  rFV P                  WF4       K  	  MS\        VR4      '       dB   \        VR4      '       d0   VP                  4        F  pV P                  WCV,          4       K  	  VP                  4        F  w  rFV P                  WF4       K  	  R# )zGeneric import function for any type of header-like object.
Adapted version of MutableMapping.update in order to insert items
with self.add instead of self.__setitem__
z/extend() takes at most 1 positional arguments (z given)r   r#   Nr   )rY   	TypeErrorr7   r+   r   r   r8   r9   itemsr;   r:   r<   r    r=   r   )r   r   r   r   r   r   rU   s   &*,    r   r   HTTPHeaderDict.extendU  sC   
 t9q=A#d)GT  t9>Qre^,,!OO-" .v~~..!KKM" *v//KKc3h @%HE#
$ $UF##}(E(E zz|Cj) $ !,,.JCHHS  )r   c                    V ^8  d   QhRRRR/# )r   r   r    r   z	list[str]r   )r   s   "r   r   r   w  s    113191r   c                	    R # r   r   r"   s   &&r   getlistHTTPHeaderDict.getlistv  s    .1r   c               $    V ^8  d   QhRRRRRR/# )r   r   r    r   r.   r   list[str] | _DTr   )r   s   "r   r   r   z  s    EE3EEEr   c                	    R # r   r   )r   r   r   s   &&&r   r   r   y  s    BEr   c               $    V ^8  d   QhRRRRRR/# )r   r   r    r   z_Sentinel | _DTr   r   r   )r   s   "r   r   r   |  s$      !0	r   c                    \        V\        4      '       d   VP                  R4      p V P                  VP	                  4       ,          pVR,          #   \
         d    T\        P                  J d   . u # Tu # i ; i)zeReturns a list of all the values for the named field. Returns an
empty list if the key doesn't exist.r   r   )r7   r   r   r@   r   rX   r0   r1   )r   r   r   r   s   &&& r   r   r   |  sl    
 c5!!**Y'C	??399;/D 8O  	)...	N	s   !A !A;6A;:A;c                   V ^8  d   QhRR/# r   r   r	   r   )r   s   "r   r   r     s      D r   c                B    . ROpV F  pV P                  V4       K  	  V # )z~
Remove content-specific header fields before changing the request
method to GET or HEAD according to RFC 9110, Section 15.4.
)zContent-EncodingzContent-LanguagezContent-LocationzContent-TypezContent-LengthDigestzLast-Modified)r   )r   content_specific_headersheaders   &  r   _prepare_for_method_change)HTTPHeaderDict._prepare_for_method_change  s'    
$
  /FLL  /r   c                   V ^8  d   QhRR/# )r   r   r    r   )r   s   "r   r   r     s     C C# Cr   c                	f    \        V 4      P                   R \        V P                  4       4       R2# )())r   r%   dictr   r   s   &r   __repr__HTTPHeaderDict.__repr__  s-    t*%%&aT__->(?'@BBr   c                    V ^8  d   QhRRRR/# )r   r   r+   r   rH   r   )r   s   "r   r   r     s     7 7 74 7r   c                	z    V F4  pVP                  V4      pV.VOV P                  VP                  4       &   K6  	  R # r   )r   r@   r   )r   r   r   r   s   &&  r   r   HTTPHeaderDict._copy_from  s4    C--$C,/;#;DOOCIIK( r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r     s      d r   c                	H    \        V 4      ! 4       pVP                  V 4       V# r   )r   r   )r   clones   & r   copyHTTPHeaderDict.copy  s     T
r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r     s     # #; #r   c              #     "   V  FA  pV P                   VP                  4       ,          pVR,           F  pV^ ,          V3x  K  	  KC  	  R# 5i)z8Iterate over all header lines, including duplicate ones.r   Nr@   r   )r   r   r   r   s   &   r   r   HTTPHeaderDict.iteritems  sA     C??399;/DBxx1gsl"   s   A
Ac                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r     s     - -< -r   c              #     "   V  FG  pV P                   VP                  4       ,          pV^ ,          RP                  VR,          4      3x  KI  	  R# 5i)z:Iterate over all headers, merging duplicate ones together.r   r   N)r@   r   r   r   s   &  r   r   HTTPHeaderDict.itermerged  s?     C//#))+.Ca&$))CG,,, s   AAc                   V ^8  d   QhRR/# )r   r   r~   r   )r   s   "r   r   r     s     , ,- ,r   c                	    \        V 4      # r   )r~   r   s   &r   r   HTTPHeaderDict.items  s    %d++r   c               $    V ^8  d   QhRRRRRR/# )r   header_namer    potential_valuer   r   r   )r   s   "r   r   r     s!       s t r   c                	f    W9   d+   W P                   VP                  4       ,          R ,          9   # R# )r   Fr	  )r   r  r  s   &&&r   r   $HTTPHeaderDict._has_value_for_header  s+    "ook6G6G6I&J2&NNNr   c                    V ^8  d   QhRRRR/# )r   r   r4   r   r+   r   )r   s   "r   r   r     s      V  r   c                	R    \        V4      pVf   \        # V P                  V4       V # r   )r>   NotImplementedr   )r   r   r   s   && r   __ior__HTTPHeaderDict.__ior__  s.     DEJ&!!'(r   c                    V ^8  d   QhRRRR/# r   r   r4   r   r	   r   )r   s   "r   r   r     s      F t r   c                	r    \        V4      pVf   \        # V P                  4       pVP                  V4       V# r   )r>   r  r  r   r   r   r   results   &&  r   __or__HTTPHeaderDict.__or__  s9     DEJ&!!)*r   c                    V ^8  d   QhRRRR/# r  r   )r   s   "r   r   r     s      V  r   c                	t    \        V4      pVf   \        # \        V 4      ! V4      pVP                  V 4       V# r   )r>   r  r   r   r  s   &&  r   __ror__HTTPHeaderDict.__ror__  s<     DEJ&!!d/0dr   )r@   r   ) ))r%   r&   r'   r(   ry   rz   rL   r^   r#   rb   r   r   r   r   rg   rl   r   r   r   r8   overloadr   r0   r1   r   
getheadersgetallmatchingheadersigetget_allr   r   r  r   r   r   r   r  r   r$  r)   r{   r|   s   @r   r+   r+      s    B 65	  	 2")
0 0	
&$
!! !!F!B __1 1__E E 4=3G3G(& J#D GC7

#-,
 r   )"
__future__r   r8   collectionsr   enumr   r   	threadingr   TYPE_CHECKINGr   typing_extensionsr	   r   __all__TypeVarr,   r-   r.   Unionr9   r    r;   r<   r   r0   r>   GenericMutableMappingr*   rv   r~   r+   r   r   r   <module>r7     s!   "  #  	  &4 4 #$4
5 nnUnnUnnU
NN38
OOE#s(O$  (Z/FNN384f6K6KCQTH6U Z/z-SsCx1 -`[V**384 [r   