+
     h}  c                  s   ^ RI Ht ^ RIt^RIHtHt ^RIHt ^RIH	t	 ]P                  '       d2   ^ RIt^ RIt]P                  ]P                  ]P                  3,          t]P                  ]]P"                  3,          t]P&                  . ]P(                  ],          3,          t]P&                  ]P                  ]]P"                  3,          .]P(                  R,          3,          t]P&                  ]P                  ]]P"                  3,          ]].]P(                  R,          3,          tR.tR R ltR	 R
 lt ! R R]4      t ! R R]	4      tR# )    )annotationsN)RequestResponse)AsyncByteStream)AsyncBaseTransportASGITransportc                   V ^8  d   QhRR/# )   returnbool Zformat   ";/usr/lib/python3.14/site-packages/httpx/_transports/asgi.py__annotate__r      s           c                 sd     ^ RI p V P                  4       R8X  d   R#  R#   \         d     R# i ; i)r    NtrioTF)sniffioZcurrent_async_libraryZImportError)r   s    r   is_running_trior      sA    	 	((*f4 5
   s     //c               r   )r   r	   Eventr   r   r   r   r   r   ,   s      e r   c                 sv    \        4       '       d   ^ RIp V P                  ! 4       # ^ RIpVP                  ! 4       # )r    N)r   r   r   asyncio)r   r   s     r   create_eventr   ,   s)    zz|==?r   c                  s.    ] tR t^7tR R ltR R ltRtR# )ASGIResponseStreamc                    V ^8  d   QhRRRR/# )r   bodyzlist[bytes]r	   Noner   r   r   r   r   ASGIResponseStream.__annotate__8   s      [ T r   c                	s    Wn         R # N_body)selfr   s   &&r   __init__ZASGIResponseStream.__init__8   s    
r   c               r   )r   r	   ztyping.AsyncIterator[bytes]r   r   r   r   r   r   ;   s     # #!< #r   c               	sJ   "   R P                  V P                  4      5x  R# 5i)r   N)Zjoinr   )r   s   &r   	__aiter__ZASGIResponseStream.__aiter__;   s     hhtzz""s   !#r   N)__name__
__module____qualname____firstlineno__r    r!   __static_attributes__r   r   r   r   r   7   s    # #r   r   c                  s6    ] tR t^?tRtRR R lltR R ltRtR# )	r   a  
A custom AsyncTransport that handles sending requests directly to an ASGI app.

```python
transport = httpx.ASGITransport(
    app=app,
    root_path="/submount",
    client=("1.2.3.4", 123)
)
client = httpx.AsyncClient(transport=transport)
```

Arguments:

* `app` - The ASGI application.
* `raise_app_exceptions` - Boolean indicating if exceptions in the application
   should be raised. Default to `True`. Can be set to `False` for use cases
   such as testing the content of a client 500 response.
* `root_path` - The root path on which the ASGI application should be mounted.
* `client` - A two-tuple indicating the client IP and port of incoming requests.
```
c          
     s,    V ^8  d   QhRRRRRRRRR	R
/# )r   app_ASGIAppraise_app_exceptionsr
   	root_pathstrclientztuple[str, int]r	   r   r   r   r   r   r   ASGITransport.__annotate__W   s<     
 

 #
 	

  
 

r   c                	s6    Wn         W n        W0n        W@n        R # r   )r'   r)   r*   r,   )r   r'   r)   r*   r,   s   &&&&&r   r    ZASGITransport.__init__W   s     $8!"r   c               r   )r   requestr   r	   r   r   r   r   r   r   r-   c   s&     XN XNXN 
XNr   c                	s  aaa	a
aaaa"   R RRRR/RRRSP                   RSP                  P                   UUu. uF  w  r#VP                  4       V3NK  	  uppR	SP                  P
                  R
SP                  P                  RSP                  P                  P                  R4      ^ ,          RSP                  P                  RSP                  P                  SP                  P                  3RV P                  RV P                  /pSP                  P                  4       o	Ro
RoRo. oRo\!        4       oR V	V
V3R llpR VVVVVV3R llp V P#                  WEV4      G Rj  xL
  \+        S4      p\-        SSVR7      # u uppi  L#  \$         d3    T P&                  '       d   h SP)                  4        Sf   RoSf   / o L]i ; i5i)typeZhttpZasgiZversionz3.0Zhttp_versionz1.1methodheadersschemepathraw_paths   ?Zquery_stringZserverr,   r*   FNc               r   )r   r	   zdict[str, typing.Any]r   r   r   r   r   8ASGITransport.handle_async_request.<locals>.__annotate__   s     	M 	M4 	Mr   c                 s   <"   S'       d   SP                  4       G R j  xL
  RR/#  SP                  4       G R j  xL
 p RRRT RR/#  L) L  \         d    RoRRRRRR/u # i ; i5i)	Nr/   zhttp.disconnectTzhttp.requestr   r   	more_bodyF)ZwaitZ	__anext__ZStopAsyncIteration)r   request_body_chunksrequest_completeresponse_completes    r   receiveZ3ASGITransport.handle_async_request.<locals>.receive   s       ',,... 122Q0::<< NFD+tLL / =% Q#' [%PPQsB   A(A	A(A AA 	A(A A%"A($A%%A(c               r   )r   messagez&typing.MutableMapping[str, typing.Any]r	   r   r   r   r   r   r   r5      s     	, 	, F 	,4 	,r   c                sZ  <"   V R ,          R8X  d    V R,          oV P                  R. 4      oRoR# V R ,          R8X  dk   V P                  RR4      pV P                  RR	4      pV'       d#   SP                  R
8w  d   SP                  V4       V'       g   SP                  4        R# R# R# 5i)r/   zhttp.response.startZstatusr1   Tzhttp.response.bodyr   r   r6   FZHEADN)Zgetr0   Zappendset)	r;   r   r6   
body_partsr.   r9   response_headersresponse_startedstatus_codes	   &  r   sendZ0ASGITransport.handle_async_request.<locals>.send   s      v"77 &h/#*;;y"#= #' $88{{63/#KKU;	GNNf4%%d+ %))+ ! 9s   A'B++)B+B+i  )r1   stream)r0   r1   ZrawZlowerZurlr2   r3   r4   ZsplitZqueryZhostZportr,   r*   rB   r!   r   r'   Z	Exceptionr)   r<   r   r   )r   r.   ZkZvZscoper:   rA   rB   r=   r7   r8   r9   r>   r?   r@   s   &f      @@@@@@@r   handle_async_requestZ"ASGITransport.handle_async_requestc   s     FY&EgnnW__5H5HI5H6AA5HIgkk((GKK$$,,2248;GKK--w{{'')9)9:dkk
  &nn668  
 (N	M 	M	, 	,*
	&((54000 $J/-=fMMY Jv 1 	&(((!!#"!'#% 	&sM   /GFC>GF *F+F /GF G-G
GGG)r'   r,   r)   r*   N)TZ )z	127.0.0.1i{   )r"   r#   r$   r%   Z__doc__r    rC   r&   r   r   r   r   r   ?   s    .
XN XNr   )Z
__future__r   ZtypingZ_modelsr   r   Z_typesr   Zbaser   ZTYPE_CHECKINGr   r   ZUnionr   ZMutableMappingr+   ZAnyZ_MessageZCallableZ	AwaitableZ_ReceiveZ_Sendr(   Z__all__r   r   r   r   r   r   r   <module>rD      s   "  ' $ $	LL

23E   fjj1??2v//99:3

?+,f.>.>t.DD	 ??3

?+Xu=v?O?OPT?UU 
# #|N& |Nr   