+
     h]   c                  s   ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^ RIHt ^RIH	t	 ]P                  '       d   ^RIHt R R ltR R	 ltRR
 R lltRR R lltR R ltR R ltR R lt ! R R4      tR R ltR R ltR# )    )annotationsN)
getproxies)PrimitiveDataURLc                    V ^8  d   QhRRRR/# )   valuer   returnstr Zformat   "1/usr/lib/python3.14/site-packages/httpx/_utils.py__annotate__r      s      - C     c                sD    V RJ d   R# V RJ d   R# V f   R# \        V 4      # )z{
Coerce a primitive data type into a string value.

Note that we prefer JSON-style 'true'/'false' for boolean values here.
TZtrueFZfalse )r
   r      &r   primitive_value_to_strr      s*     }	%	u:r   c                   V ^8  d   QhRR/# )r   r	   zdict[str, str | None]r   r   r   r   r   r      s     . .!6 .r   c                 s.   \        4       p / pR F7  pV P                  V4      '       g   K  W,          pRV9   d   TMRV 2W R2&   K9  	  V P                  RR4      P                  R4       Uu. uF  qDP                  4       NK  	  ppV F  pVR8X  d   / u # V'       g   K  RV9   d   RW&   K%  \	        V4      '       d   RVRV 2&   K@  \        V4      '       d   RVR	V R
2&   K\  VP                  4       R8X  d   RVRV 2&   K{  RVRV 2&   K  	  V# u upi )z+Gets proxy information from the environmentz://zhttp://Znor   Z,*Nzall://zall://[Z]Z	localhostzall://*)ZhttpZhttpsall)r   ZgetsplitZstripis_ipv4_hostnameis_ipv6_hostnameZlower)Z
proxy_infoZmountsschemehostnamehostZno_proxy_hostss         r   get_environment_proxiesr      s-    J$&F*>>&!!!)H!X-WXJ3G XS>" + 0:~~dB/G/M/Mc/RS/Rtjjl/RNS" s?
 IX  #' !(++.2z*+!(++04
!,-![0.2z*+/3
+,5 #8 M; Ts   -Dc               s$    V ^8  d   QhRRRRRR/# )r   r   str | bytesencodingr
   r	   Zbytesr   r   r   r   r   r   O   s&     G GK G3 GU Gr   c                sT    \        V \        4      '       d   V P                  V4      # T # N
isinstancer
   Zencoder   r       &&r   to_bytesr&   O   s"    %/s%;%;5<<!FFr   c               $    V ^8  d   QhRRRRRR/# )r   r   r   r    r
   r	   r   r   r   r   r   r   S   s&     G G+ G G3 Gr   c                sT    \        V \        4      '       d   V # V P                  V4      # r!   )r#   r
   Zdecoder$   r%   r   to_strr(   S   s"    uc**5FX0FFr   c               r'   )r   r   r
   match_type_ofztyping.AnyStrr	   r   r   r   r   r   r   W   s&     G G3 G} G Gr   c                sR    \        V\        4      '       d   V # V P                  4       # r!   r"   )r   r)   r%   r   to_bytes_or_strr*   W   s    }c225FFr   c               s     V ^8  d   QhRRRR/# )r   r   r
   r	   r   r   r   r   r   r   [   s     B B3 B3 Br   c                sP    V ^ ,          V R,          u;8X  d   R8X  d	   M MV ^R # T # )r    Z"ir   r   r   r   unquoter+   [   s'    (eBi63652;AEAr   c               r   )r   stream
typing.Anyr	   z
int | Noner   r   r   r   r   r   _   s       
 r   c                sN    V P                  4       p\        P                  ! V4      P                  pV#   \        \
        3 d`     T P                  4       pT P                  ^ \        P                  4      pT P                  T4        T#   \        \
        3 d      R# i ; ii ; i)zg
Given a file-like stream object, return its length in number of bytes
without reading it into memory.
N)	ZfilenoosZfstatZst_sizeZAttributeErrorZOSErrorZtellZseekZSEEK_END)r,   ZfdZlengthZoffset   &   r   peek_filelike_lengthr0   _   s    
]]_"%% M G$ 
	 [[]F[[BKK0FKK
 M	 ( 		
s(   04 B$AB

B B$B  B$c                  sl    ] tR t^xtRtR R ltR R lt]R R l4       tR R	 lt	R
 R lt
R R ltRtR# )
URLPatternaC  
A utility class currently used for making lookups against proxy keys...

# Wildcard matching...
>>> pattern = URLPattern("all://")
>>> pattern.matches(httpx.URL("http://example.com"))
True

# Witch scheme matching...
>>> pattern = URLPattern("https://")
>>> pattern.matches(httpx.URL("https://example.com"))
True
>>> pattern.matches(httpx.URL("http://example.com"))
False

# With domain matching...
>>> pattern = URLPattern("https://example.com")
>>> pattern.matches(httpx.URL("https://example.com"))
True
>>> pattern.matches(httpx.URL("http://example.com"))
False
>>> pattern.matches(httpx.URL("https://other.com"))
False

# Wildcard scheme, with domain matching...
>>> pattern = URLPattern("all://example.com")
>>> pattern.matches(httpx.URL("https://example.com"))
True
>>> pattern.matches(httpx.URL("http://example.com"))
True
>>> pattern.matches(httpx.URL("https://other.com"))
False

# With port matching...
>>> pattern = URLPattern("https://example.com:1234")
>>> pattern.matches(httpx.URL("https://example.com:1234"))
True
>>> pattern.matches(httpx.URL("https://example.com"))
False
c               r   )r   patternr
   r	   ZNoner   r   r   r   r   URLPattern.__annotate__   s     8 8 8 8r   c                	s   ^RI Hp V'       d   RV9  d   \        RV RV R24      hV! V4      pWn        VP                  R8X  d   RMVP                  V n        VP
                  R8X  d   RMVP
                  V n        VP                  V n        VP
                  '       d   VP
                  R8X  d
   R	V n        R	# VP
                  P                  R
4      '       dI   \        P                  ! VP
                  R,          4      p\        P                  ! RV R24      V n        R	# VP
                  P                  R4      '       dI   \        P                  ! VP
                  R,          4      p\        P                  ! RV R24      V n        R	# \        P                  ! VP
                  4      p\        P                  ! RV R24      V n        R	# )   r   Z:zUProxy keys should use proper URL forms rather than plain scheme strings. Instead of "z", use "z://"r   r   r   Nz*.:r   NNz^.+\.Z$:r4   NNz^(.+\.)?Z^)_urlsr   Z
ValueErrorr2   r   r   port
host_regexZ
startswithreZescapeZcompile)selfr2   r   ZurlZdomains   &&   r   __init__ZURLPattern.__init__   sK   s')&ixy>  'lJJ%/bSZZ((c/Bsxx	HH	xxx388s?:>DOXX  &&YYsxx|,F jj6&);<DOXX  %%YYsxx|,F jj9VHA)>?DO YYsxx(F jj1VHA7DOr   c               r   )r   otherr   r	   boolr   r   r   r   r   r3      s      S T r   c                	sT   V P                   '       d   V P                   VP                   8w  d   R # V P                  '       d<   V P                  e.   V P                  P                  VP                  4      '       g   R # V P                  e   V P                  VP                  8w  d   R # R# )FT)r   r   r7   Zmatchr6   r9   r;   r%   r   matchesZURLPattern.matches   sk    ;;;4;;%,,6III+OO))%**5599 TYY%**%<r   c               r   )r   r	   ztuple[int, int, int]r   r   r   r   r   r3      s     ? ?. ?r   c                s    V P                   e   ^ M^p\        V P                  4      ) p\        V P                  4      ) pWV3# )zu
The priority allows URLPattern instances to be sortable, so that
we can match from most specific to least specific.
)r6   Zlenr   r   )r9   Zport_priorityZhost_priorityZscheme_priorityr/   r   priorityZURLPattern.priority   s?     "YY2TYYt{{++o>>r   c               r   )r   r	   Zintr   r   r   r   r   r3      s     " "# "r   c                	s,    \        V P                  4      # r!   )Zhashr2   )r9   r   r   __hash__ZURLPattern.__hash__   s    DLL!!r   c               r   )r   r;   r1   r	   r<   r   r   r   r   r   r3      s     . .J .4 .r   c                	s4    V P                   VP                   8  # r!   )r?   r=   r%   r   __lt__ZURLPattern.__lt__   s    }}u~~--r   c               r   )r   r;   r-   r	   r<   r   r   r   r   r   r3      s     O OJ O4 Or   c                	sd    \        V\        4      ;'       d    V P                  VP                  8H  # r!   )r#   r1   r2   r=   r%   r   __eq__ZURLPattern.__eq__   s$    %,NN1NNr   )r   r7   r2   r6   r   N)Z__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__r:   r>   Zpropertyr?   r@   rA   rB   Z__static_attributes__r   r   r   r1   r1   x   s<    'R8< ? ?".O Or   r1   c               r   r   r   r
   r	   r<   r   r   r   r   r   r            s t r   c                     \         P                  ! V P                  R 4      ^ ,          4       R#   \         d     R# i ; iZ/FT)	ipaddressZIPv4Addressr   	Exceptionr   r   r   r   r      <    hnnS1!45      ,0 ??c               r   rC   r   r   r   r   r   r      rD   r   c                rE   rF   )rG   ZIPv6Addressr   rH   rI   r   r   r   r      rJ   rK   )zutf-8)Z
__future__r   rG   r.   r8   ZtypingZurllib.requestr   Z_typesr   ZTYPE_CHECKINGr5   r   r   r   r&   r(   r*   r+   r0   r1   r   r   r   r   r   <module>rL      sj    "  	 	  % !	.bGGGB2jO jOZr   