ó
    ÖÁ“i=  ã                  óþ  • S SK Jr  S SKrS SK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	QrS
R$                  " \R&                  6 r\R*                  R-                  SS\ S\ 35      r\R*                  R-                  SS\ S\ 35      r\" \R*                  R-                  SS5      5      r\" \R*                  R-                  SS5      5      r\" \R*                  R-                  SS5      5      rSS jr\R<                  " S5      r\R<                  " S5      r \RB                   " S S5      5       r"\RB                   " S S5      5       r#    S S jr$    S!S jr%            S"S jr&g)#é    )ÚannotationsN)Ú	Generator)ÚCallableé   )ÚHeaders)ÚSecurityError)Úversion)ÚSERVERÚ
USER_AGENTÚRequestÚResponsez{}.{}ÚWEBSOCKETS_USER_AGENTzPython/z websockets/ÚWEBSOCKETS_SERVERÚWEBSOCKETS_MAX_NUM_HEADERSÚ128ÚWEBSOCKETS_MAX_LINE_LENGTHÚ8192ÚWEBSOCKETS_MAX_BODY_SIZEÚ	1_048_576c                ó    • U R                  SS9$ )z?
Decode a bytestring for interpolating into an error message.

Úbackslashreplace©Úerrors)Údecode)Úvalues    ÚN/home/mande/repo/quber/.venv/lib/python3.13/site-packages/websockets/http11.pyÚdr   2   s   € ð
 �<‰<Ð1ˆ<Ð2Ð2ó    s   [-!#$%&\'*+.^_`|~0-9a-zA-Z]+s   [\x09\x20-\x7e\x80-\xff]*c                  óv   • \ rS rSr% SrS\S'   S\S'   SrS\S	'   \SS
 j5       r\	    SS j5       r
SS jrSrg)r   éN   z{
WebSocket handshake request.

Attributes:
    path: Request path, including optional query.
    headers: Request headers.
ÚstrÚpathr   ÚheadersNúException | NoneÚ
_exceptionc                óP   • [         R                  " S[        5        U R                  $ )NzIRequest.exception is deprecated; use ServerProtocol.handshake_exc instead©ÚwarningsÚwarnÚDeprecationWarningr%   ©Úselfs    r   Ú	exceptionÚRequest.exception^   s    € ä�ŠØWÜô	
ð �‰Ðr   c              #  ó$  #   •  [        U5       Sh  v•N n UR                  SS5      u  pEnUS:w  a  [        S[	        U5       35      eUS:w  a  [        S	[	        U5       35      eUR                  S
S5      n[        U5       Sh  v•N nSU;   a  [        S5      eSU;   a  [        US   5      S:w  a  [        S5      eU " Xx5      $  Nµ! [         a  n[        S5      UeSnAff = f! [         a    [        S[	        U5       35      Sef = f N†7f)a)  
Parse a WebSocket handshake request.

This is a generator-based coroutine.

The request path isn't URL-decoded or validated in any way.

The request path and headers are expected to contain only ASCII
characters. Other characters are represented with surrogate escapes.

:meth:`parse` doesn't attempt to read the request body because
WebSocket handshake requests don't have one. If the request contains a
body, it may be read from the data stream after :meth:`parse` returns.

Args:
    read_line: Generator-based coroutine that reads a LF-terminated
        line or raises an exception if there isn't enough data

Raises:
    EOFError: If the connection is closed without a full HTTP request.
    SecurityError: If the request exceeds a security limit.
    ValueError: If the request isn't well formatted.

Nz1connection closed while reading HTTP request lineó    é   zinvalid HTTP request line: ó   HTTP/1.1ú)unsupported protocol; expected HTTP/1.1: s   GETz+unsupported HTTP method; expected GET; got ÚasciiÚsurrogateescapeúTransfer-Encodingz!transfer codings aren't supportedúContent-Lengthr   zunsupported request body)	Ú
parse_lineÚEOFErrorÚsplitÚ
ValueErrorr   r   Úparse_headersÚNotImplementedErrorÚint)	ÚclsÚ	read_lineÚrequest_lineÚexcÚmethodÚraw_pathÚprotocolr"   r#   s	            r   ÚparseÚRequest.parsef   s=  é € ðF	YÜ&0°Ó&;×;ˆLð	XØ)5×);Ñ);¸DÀ!Ó)DÑ&ˆF˜hð �{Ó"ÜØ;¼A¸l»OÐ;LÐMóð ð �VÓÜÐJÌ1ÈVË9È+ÐVÓWÐWØ�‰˜wÐ(9Ó:ˆä*¨9Ó5×5ˆð  'Ó)Ü%Ð&IÓJÐJà˜wÓ&ô �7Ð+Ñ,Ó-°Ó2Ü Ð!;Ó<Ð<á�4Ó!Ð!ñ; <øÜó 	YÜÐNÓOÐUXÐXûð	Yûô
 ó 	XÜÐ:¼1¸\»?Ð:KÐLÓMÐSWÐWð	Xúñ 6ùsV   ‚D„C
 ’C“C
 ˜C( ­ADÂDÂA DÃC
 Ã

C%ÃC Ã C%Ã%DÃ(#DÄDc                óz   • SU R                    S3R                  5       nXR                  R                  5       -  nU$ )z+
Serialize a WebSocket handshake request.

zGET z HTTP/1.1
)r"   Úencoder#   Ú	serialize)r,   Úrequests     r   rJ   ÚRequest.serialize©   s9   € ð ˜Ÿ™˜ =Ð1×8Ñ8Ó:ˆØ—<‘<×)Ñ)Ó+Ñ+ˆØˆr   © ©Úreturnr$   )r@   ú9Callable[[int], Generator[None, None, bytes | bytearray]]rO   zGenerator[None, None, Request]©rO   Úbytes)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__r%   Úpropertyr-   ÚclassmethodrF   rJ   Ú__static_attributes__rM   r   r   r   r   N   sc   ‡ ñð ƒIØÓð $(€JÐ Ó'àóó ðð ð@"àLð@"ð 
(ó@"ó ð@"÷D	r   r   c                  óž   • \ rS rSr% SrS\S'   S\S'   S\S'   S	rS
\S'   SrS\S'   \SS j5       r	\
 S         SS jj5       rSS jrSrg)r   éµ   z©
WebSocket handshake response.

Attributes:
    status_code: Response code.
    reason_phrase: Response reason.
    headers: Response headers.
    body: Response body.

r>   Ústatus_coder!   Úreason_phraser   r#   r   úbytes | bytearrayÚbodyNr$   r%   c                óP   • [         R                  " S[        5        U R                  $ )NzJResponse.exception is deprecated; use ClientProtocol.handshake_exc insteadr'   r+   s    r   r-   ÚResponse.exceptionÉ   s"   € ä�Šð7äô	
ð
 �‰Ðr   c              #  ó$  #   •  [        U5       Sh  v•N n UR                  SS5      u  pxn	U(       a  US;  a  [        S[	        U5       35      eOUS:w  a  [        S	[	        U5       35      e [        U5      n
SU
s=::  a  S:  d  O  [        S[	        U5       35      e[        R                  U	5      (       d  [        S[	        U	5       35      eU	R                  SS5      n[        U5       Sh  v•N nU(       a  SnO[        X¬XU5       Sh  v•N nU " X«XÍ5      $  GN! [         a  n[        S5      UeSnAff = f! [         a    [        S[	        U5       35      Sef = f! [         a    [        S
[	        U5       35      Sef = f N™ N|7f)a:  
Parse a WebSocket handshake response.

This is a generator-based coroutine.

The reason phrase and headers are expected to contain only ASCII
characters. Other characters are represented with surrogate escapes.

Args:
    read_line: Generator-based coroutine that reads a LF-terminated
        line or raises an exception if there isn't enough data.
    read_exact: Generator-based coroutine that reads the requested
        bytes or raises an exception if there isn't enough data.
    read_to_eof: Generator-based coroutine that reads until the end
        of the stream.

Raises:
    EOFError: If the connection is closed without a full HTTP response.
    SecurityError: If the response exceeds a security limit.
    LookupError: If the response isn't well formatted.
    ValueError: If the response isn't well formatted.

Nz0connection closed while reading HTTP status liner0   r1   zinvalid HTTP status line: )r2   s   HTTP/1.0z5unsupported protocol; expected HTTP/1.1 or HTTP/1.0: r2   r3   z+invalid status code; expected integer; got éd   iX  u-   invalid status code; expected 100â€“599; got zinvalid HTTP reason phrase: r4   r5   r   )r8   r9   r:   r;   r   r>   Ú	_value_reÚ	fullmatchr   r<   Ú	read_body)r?   r@   Ú
read_exactÚread_to_eofÚproxyÚstatus_linerB   rE   Úraw_status_codeÚ
raw_reasonr^   Úreasonr#   ra   s                 r   rF   ÚResponse.parseÒ   sÐ  é € ðB	XÜ%/°	Ó%:×:ˆKð	VØ4?×4EÑ4EÀdÈAÓ4NÑ1ˆH zö ØÐ9Ó9Ü ØKÜ˜“~Ð&ð(óð ð :ð ˜;Ó&Ü Ø?ÄÀ+ÃÐ?OÐPóð ð	Ü˜oÓ.ˆKð
 �kÕ' CÕ'ÜØ?ÄÀ/Ó@RÐ?SÐTóð ô ×"Ñ" :×.Ñ.ÜÐ;¼A¸j»M¸?ÐKÓLÐLØ×"Ñ" 7Ð,=Ó>ˆä*¨9Ó5×5ˆö Ø‰Dä'Ø i¸[ó÷ ˆDñ �;¨Ó6Ð6òW ;øÜó 	XÜÐMÓNÐTWÐWûð	Xûô
 ó 	VÜÐ9¼!¸K».Ð9IÐJÓKÐQUÐUð	Vûô ó 	ÜØ=¼aÀÓ>PÐ=QÐRóàðð	úñ 6ñùs€   ‚F„D" ’D“D" ˜E  ­AFÁ0E& Á;A7FÃ2FÃ3FÄFÄFÄD" Ä"
D=Ä,D8Ä8D=Ä=FÅ #E#Å#FÅ&#F	Æ	FÆFc                ó°   • SU R                    SU R                   S3R                  5       nXR                  R	                  5       -  nXR
                  -  nU$ )z,
Serialize a WebSocket handshake response.

z	HTTP/1.1 Ú z
)r^   r_   rI   r#   rJ   ra   )r,   Úresponses     r   rJ   ÚResponse.serialize!  sU   € ð ˜t×/Ñ/Ð0°°$×2DÑ2DÐ1EÀTÐJ×QÑQÓSˆØ—L‘L×*Ñ*Ó,Ñ,ˆØ—I‘IÑˆØˆr   rM   rN   )F)
r@   rP   ri   rP   rj   rP   rk   ÚboolrO   zGenerator[None, None, Response]rQ   )rS   rT   rU   rV   rW   rX   ra   r%   rY   r-   rZ   rF   rJ   r[   rM   r   r   r   r   µ   s›   ‡ ñ	ð ÓØÓØÓØ!€DÐ
Ó!à#'€JÐ Ó'àóó ðð ð ðL7àLðL7ð NðL7ð Oð	L7ð
 ðL7ð 
)ôL7ó ðL7÷\
r   r   c              #  ó¶   #   •  U " [         5       Sh  v•N nUR                  S5      (       d  [	        S5      eUSS $  N*! [         a    [        S5      ef = f7f)aK  
Parse a single line.

CRLF is stripped from the return value.

Args:
    read_line: Generator-based coroutine that reads a LF-terminated line
        or raises an exception if there isn't enough data.

Raises:
    EOFError: If the connection is closed without a CRLF.
    SecurityError: If the response exceeds a security limit.

Nzline too longó   
zline without CRLFéþÿÿÿ)ÚMAX_LINE_LENGTHÚRuntimeErrorr   Úendswithr9   )r@   Úlines     r   r8   r8   .  s^   é € ð"-Ù#¤OÓ4×4ˆð �=‰=˜×!Ñ!ÜÐ*Ó+Ð+Ø��ˆ9Ðñ 5øÜó -Ü˜OÓ,Ð,ð-üs)   ‚A„A  “>”A  ˜&A¾A  Á AÁAc              #  óŠ  #   • [        5       n[        [        S-   5       HÏ  n [        U 5       Sh  v•N nUS:X  a    U$  UR                  SS5      u  pV[        R                  U5      (       d  [        S[        U5       35      eUR                  S5      n[        R                  U5      (       d  [        S	[        U5       35      eUR                  S
5      nUR                  S
S5      nX�U'   MÑ     [        S5      e NË! [         a  n[	        S5      UeSnAff = f! [         a    [        S[        U5       35      Sef = f7f)a�  
Parse HTTP headers.

Non-ASCII characters are represented with surrogate escapes.

Args:
    read_line: Generator-based coroutine that reads a LF-terminated line
        or raises an exception if there isn't enough data.

Raises:
    EOFError: If the connection is closed without complete headers.
    SecurityError: If the request exceeds a security limit.
    ValueError: If the request isn't well formatted.

r   Nz,connection closed while reading HTTP headersr   ó   :zinvalid HTTP header line: zinvalid HTTP header name: s    	zinvalid HTTP header value: r4   r5   ztoo many HTTP headers)r   ÚrangeÚMAX_NUM_HEADERSr8   r9   r:   r;   r   Ú	_token_rerg   Ústriprf   r   r   )	r@   r#   Ú_r|   rB   Úraw_nameÚ	raw_valueÚnamer   s	            r   r<   r<   I  sG  é € ô, ‹i€GÜ”? QÑ&Ö'ˆð	TÜ(¨Ó3×3ˆDð �3‹;Øð& €Nð#	OØ"&§*¡*¨T°1Ó"5ÑˆHô ×"Ñ" 8×,Ñ,ÜÐ9¼!¸H»+¸ÐGÓHÐHØ—O‘O FÓ+ˆ	Ü×"Ñ" 9×-Ñ-ÜÐ:¼1¸Y»<¸.ÐIÓJÐJà�‰˜wÓ'ˆØ× Ñ  Ð*;Ó<ˆØ�‹ñ) (ô. Ð3Ó4Ð4ñ+ 4øÜó 	TÜÐIÓJÐPSÐSûð	Tûô ó 	OÜÐ9¼!¸D»'¸ÐCÓDÈ$ÐNð	OüsP   ‚ E£C?±C=²C?¶	EÁ DÁB)EÃ=C?Ã?
DÄ	DÄDÄEÄ#E Å Ec              #  ó®  #   • SU s=::  a  S:  d  O  U S:X  d  U S:X  a  gUR                  S5      =nbù  US:w  a  [        SU S	35      eSn [        U5       S h  v•N nUR                  S
S5      S   n[	        U5      S:”  a  UR                  SS9n	[        SU	 S35      e[        US5      n
U
S:X  a  Od[	        U5      U
-   [        :”  a  [        SU
 S[	        U5       S35      eXc" U
5       S h  v•N -  nU" S5       S h  v•N S:w  a  [        S5      eMÌ  [        U5       S h  v•N   U$ UR                  S5      =nbR  [	        U5      S:”  a  [        SU S35      e[        U5      nU[        :”  a  [        SU S35      eU" U5       S h  v•N $  U" [        5       S h  v•N $  GNN Nº Nª Nˆ N" N! [         a    [        S[         S35      ef = f7f)Nre   éÈ   éÌ   i0  r   r6   Úchunkedztransfer coding z isn't supportedó   ;r   r   é   r   r   zchunk too large: 0xz bytesé   zchunk too large: z bytes after r1   rw   zchunk without CRLFr7   é   zbody too large: zbody too large: over )Úgetr=   r8   r:   Úlenr   r   r>   ÚMAX_BODY_SIZEr;   r<   rz   )r^   r#   r@   ri   rj   Úcodingra   Úchunk_size_lineÚraw_chunk_sizeÚstr_chunk_sizeÚ
chunk_sizeÚraw_content_lengthÚcontent_lengths                r   rh   rh   |  s  é € ð ˆkÕ˜CÕ ;°#Ó#5¸ÈÓ9KØð —K‘KÐ 3Ó4Ð
4ˆ&Ñ	AØ�YÓÜ%Ð(8¸¸Ð@PÐ&QÓRÐRàˆØÜ)3°IÓ)>×>ˆOØ,×2Ñ2°4¸Ó;¸AÑ>ˆNä�>Ó" RÓ'Ø!/×!6Ñ!6Ð>PÐ!6Ð!Q�Ü#Ð&9¸.Ð9IÈÐ$PÓQÐQÜ˜^¨RÓ0ˆJØ˜Q‹ØÜ�4‹y˜:Ñ%¬Ó5Ü#Ø'¨
 |°=ÄÀTÃÀÈ6ÐRóð ð ˜z¨*Ó5×5Ñ5ˆDÙ% a›=×(¨WÓ4Ü Ð!5Ó6Ð6ñ! ô$ ! Ó+×+Ð+Øˆà '§¡Ð,<Ó =Ð
=Ð
Ñ	JäÐ!Ó" RÓ'ÜÐ"2Ð3EÐ2FÀfÐ MÓNÐNÜÐ/Ó0ˆØœMÓ)ÜÐ"2°>Ð2BÀ&Ð IÓJÐJÙ% nÓ5×5Ð6ð	OÙ*¬=Ó9×9Ð:ò? ?ñ 6Ù(ñ 	,ñ 6ñ :øÜó 	OÜÐ"7¼°ÀfÐ MÓNÐNð	Oüs†   ‚AGÁF'ÁBGÃ/F*Ã0GÄF,Ä#GÄ%F.Ä&A'GÆF0ÆGÆF4 Æ"F2Æ#F4 Æ&GÆ*GÆ,GÆ.GÆ0GÆ2F4 Æ4GÇG)r   r`   rO   r!   )r@   rP   rO   ú(Generator[None, None, bytes | bytearray])r@   rP   rO   zGenerator[None, None, Headers])r^   r>   r#   r   r@   rP   ri   rP   rj   rP   rO   r™   )'Ú
__future__r   ÚdataclassesÚosÚreÚsysr(   Úcollections.abcr   Útypingr   Údatastructuresr   Ú
exceptionsr   r	   Úwebsockets_versionÚ__all__ÚformatÚversion_infoÚPYTHON_VERSIONÚenvironr�   r   r
   r>   r€   ry   r‘   r   Úcompiler�   rf   Ú	dataclassr   r   r8   r<   rh   rM   r   r   Ú<module>r«      sÊ  ðÝ "ã Û 	Û 	Û 
Û Ý %Ý å #Ý %Ý 2ò€ð —’ ×!1Ñ!1Ð2€ð �Z‰Z�^‰^ØØˆnÐ˜\Ð*<Ð)=Ð>ó€
ð 
�‰�‰ØØˆnÐ˜\Ð*<Ð)=Ð>ó
€ñ �b—j‘j—n‘nÐ%AÀ5ÓIÓJ€ñ �b—j‘j—n‘nÐ%AÀ6ÓJÓK€ñ �B—J‘J—N‘NÐ#=¸{ÓKÓL€ô3ð �JŠJÐ7Ó8€	ð �JŠJÐ4Ó5€	ð ×Ñ÷cð có ðcðL ×Ñ÷uð uó ðuðpØHðà-ôð60ØHð0à#ô0ðf:OØð:Oàð:Oð Ið:Oð Jð	:Oð
 Kð:Oð .õ:Or   