§
    JŠtj•  ã                  óB  — d dl mZ d dlZd dlZd dlZddlmZ ddlmZ ddgZ	 e
ej                             dd	¦  «        ¦  «        Z e
ej                             d
d¦  «        ¦  «        Zdd„Z ej        d¦  «        Z ej        d¦  «        Zdd„Zdd„Zdd„Zd d„ZdS )!é    )ÚannotationsNé   )ÚHeaders)ÚSecurityErrorÚread_requestÚread_responseÚWEBSOCKETS_MAX_NUM_HEADERSÚ128ÚWEBSOCKETS_MAX_LINE_LENGTHÚ8192ÚvalueÚbytesÚreturnÚstrc                ó.   — |                       d¬¦  «        S )zG
    Decode a bytestring for interpolating into an error message.

    Úbackslashreplace)Úerrors)Údecode)r   s    úT/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/websockets/legacy/http.pyÚdr      s   € ð
 �<Š<Ð1ˆ<Ñ2Ô2Ð2ó    s   [-!#$%&\'*+.^_`|~0-9a-zA-Z]+s   [\x09\x20-\x7e\x80-\xff]*Ústreamúasyncio.StreamReaderútuple[str, Headers]c              ƒ  óþ  K  — 	 t          | ¦  «        ƒ d{V —†}n"# t          $ r}t          d¦  «        |‚d}~ww xY w	 |                     dd¦  «        \  }}}n.# t          $ r! t          dt	          |¦  «        › �¦  «        d‚w xY w|dk    rt          dt	          |¦  «        › �¦  «        ‚|dk    rt          d	t	          |¦  «        › �¦  «        ‚|                     d
d¦  «        }t          | ¦  «        ƒ d{V —†}||fS )aó  
    Read an HTTP/1.1 GET request and return ``(path, headers)``.

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

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

    :func:`read_request` 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 ``stream`` after this coroutine returns.

    Args:
        stream: Input to read the request from.

    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ó    r   zinvalid HTTP request line: s   GETzunsupported HTTP method: ó   HTTP/1.1úunsupported HTTP version: ÚasciiÚsurrogateescape)Ú	read_lineÚEOFErrorÚsplitÚ
ValueErrorr   r   Úread_headers)r   Úrequest_lineÚexcÚmethodÚraw_pathÚversionÚpathÚheaderss           r   r   r   -   sS  è è € ð8UÝ& vÑ.Ô.Ð.Ð.Ð.Ð.Ð.Ð.ˆˆøÝð Uð Uð UÝÐJÑKÔKÐQTÐTøøøøðUøøøðTØ$0×$6Ò$6°t¸QÑ$?Ô$?Ñ!ˆ�˜'˜'øÝð Tð Tð TÝÐHµq¸±´ÐHÐHÑIÔIÈtÐSðTøøøð �ÒÐÝÐ@µQ°v±Y´YÐ@Ð@ÑAÔAÐAØ�+ÒÐÝÐBµa¸±j´jÐBÐBÑCÔCÐCØ�?Š?˜7Ð$5Ñ6Ô6€Då  Ñ(Ô(Ð(Ð(Ð(Ð(Ð(Ð(€Gà�ˆ=Ðs   „ š
9¤4´9½A Á+Bútuple[int, str, Headers]c              ƒ  óþ  K  — 	 t          | ¦  «        ƒ d{V —†}n"# t          $ r}t          d¦  «        |‚d}~ww xY w	 |                     dd¦  «        \  }}}n.# t          $ r! t          dt	          |¦  «        › �¦  «        d‚w xY w|dk    rt          dt	          |¦  «        › �¦  «        ‚	 t          |¦  «        }n.# t          $ r! t          dt	          |¦  «        › �¦  «        d‚w xY wd	|cxk    rd
k     s!n t          dt	          |¦  «        › �¦  «        ‚t                               |¦  «        st          dt	          |¦  «        › �¦  «        ‚|                     ¦   «         }t          | ¦  «        ƒ d{V —†}|||fS )aÏ  
    Read an HTTP/1.1 response and return ``(status_code, reason, headers)``.

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

    :func:`read_request` doesn't attempt to read the response body because
    WebSocket handshake responses don't have one. If the response contains a
    body, it may be read from ``stream`` after this coroutine returns.

    Args:
        stream: Input to read the response from.

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

    Nz0connection closed while reading HTTP status liner   r   zinvalid HTTP status line: r   r   zinvalid HTTP status code: éd   iè  zunsupported HTTP status code: zinvalid HTTP reason phrase: )
r!   r"   r#   r$   r   ÚintÚ	_value_reÚ	fullmatchr   r%   )	r   Ústatus_liner'   r*   Úraw_status_codeÚ
raw_reasonÚstatus_codeÚreasonr,   s	            r   r   r   ^   só  è è € ð2TÝ% fÑ-Ô-Ð-Ð-Ð-Ð-Ð-Ð-ˆˆøÝð Tð Tð TÝÐIÑJÔJÐPSÐSøøøøðTøøøðRØ/:×/@Ò/@ÀÀqÑ/IÔ/IÑ,ˆ� * *øÝð Rð Rð RÝÐFµa¸±n´nÐFÐFÑGÔGÈTÐQðRøøøð �+ÒÐÝÐBµa¸±j´jÐBÐBÑCÔCÐCðVÝ˜/Ñ*Ô*ˆˆøÝð Vð Vð VÝÐJµa¸Ñ6HÔ6HÐJÐJÑKÔKÐQUÐUðVøøøà�+Ð$Ð$Ò$Ð$ Ò$Ð$Ð$Ð$ÝÐN½!¸OÑ:LÔ:LÐNÐNÑOÔOÐOÝ×Ò˜zÑ*Ô*ð IÝÐG½¸*¹¼ÐGÐGÑHÔHÐHØ×ÒÑ Ô €Få  Ñ(Ô(Ð(Ð(Ð(Ð(Ð(Ð(€Gà˜ Ð'Ð's'   „ š
9¤4´9½A Á+BÂ,B< Â<+C'r   c              ƒ  ó   K  — t          ¦   «         }t          t          dz   ¦  «        D �]E}	 t          | ¦  «        ƒ d{V —†}n"# t          $ r}t	          d¦  «        |‚d}~ww xY w|dk    r �n	 |                     dd¦  «        \  }}n.# t          $ r! t          dt          |¦  «        › �¦  «        d‚w xY wt           	                    |¦  «        st          dt          |¦  «        › �¦  «        ‚| 
                    d¦  «        }t           	                    |¦  «        st          d	t          |¦  «        › �¦  «        ‚|                     d
¦  «        }|                     d
d¦  «        }|||<   �ŒGt          d¦  «        ‚|S )zo
    Read HTTP headers from ``stream``.

    Non-ASCII characters are represented with surrogate escapes.

    é   Nz,connection closed while reading HTTP headersr   ó   :zinvalid HTTP header line: zinvalid HTTP header name: s    	zinvalid HTTP header value: r   r    ztoo many HTTP headers)r   ÚrangeÚMAX_NUM_HEADERSr!   r"   r#   r$   r   Ú	_token_rer2   Ústripr1   r   r   )	r   r,   Ú_Úliner'   Úraw_nameÚ	raw_valueÚnamer   s	            r   r%   r%   ’   s¶  è è € õ ‰iŒi€GÝ•? QÑ&Ñ'Ô'ð 5ñ 5ˆð	TÝ" 6Ñ*Ô*Ð*Ð*Ð*Ð*Ð*Ð*ˆDˆDøÝð 	Tð 	Tð 	TÝÐIÑJÔJÐPSÐSøøøøð	Tøøøà�3Š;ˆ;Ø‰Eð	OØ"&§*¢*¨T°1Ñ"5Ô"5ÑˆH�i�iøÝð 	Oð 	Oð 	OÝÐC½!¸D¹'¼'ÐCÐCÑDÔDÈ$ÐNð	Oøøøå×"Ò" 8Ñ,Ô,ð 	IÝÐG½!¸H¹+¼+ÐGÐGÑHÔHÐHØ—O’O FÑ+Ô+ˆ	Ý×"Ò" 9Ñ-Ô-ð 	KÝÐI½1¸Y¹<¼<ÐIÐIÑJÔJÐJà�Š˜wÑ'Ô'ˆØ× Ò  Ð*;Ñ<Ô<ˆØˆ�‰‰õ Ð3Ñ4Ô4Ð4à€Ns#   ¬AÁ
A!ÁAÁA!Á.BÂ+B3c              ƒ  óä   K  — |                       ¦   «         ƒ d{V —†}t          |¦  «        t          k    rt          d¦  «        ‚|                     d¦  «        st          d¦  «        ‚|dd…         S )z[
    Read a single line from ``stream``.

    CRLF is stripped from the return value.

    Nzline too longs   
zline without CRLFéþÿÿÿ)ÚreadlineÚlenÚMAX_LINE_LENGTHr   Úendswithr"   )r   r@   s     r   r!   r!   º   sy   è è € ð —’Ñ"Ô"Ð"Ð"Ð"Ð"Ð"Ð"€Då
ˆ4�y„y•?Ò"Ð"Ý˜OÑ,Ô,Ð,à�=Š=˜Ñ!Ô!ð ,ÝÐ*Ñ+Ô+Ð+Ø���Œ9Ðr   )r   r   r   r   )r   r   r   r   )r   r   r   r-   )r   r   r   r   )r   r   r   r   )Ú
__future__r   ÚasyncioÚosÚreÚdatastructuresr   Ú
exceptionsr   Ú__all__r0   ÚenvironÚgetr<   rH   r   Úcompiler=   r1   r   r   r%   r!   © r   r   ú<module>rU      s;  ðØ "Ð "Ð "Ð "Ð "Ð "à €€€Ø 	€	€	€	Ø 	€	€	€	à $Ð $Ð $Ð $Ð $Ð $Ø &Ð &Ð &Ð &Ð &Ð &ð ˜?Ð
+€à�#�b”j—n’nÐ%AÀ5ÑIÔIÑJÔJ€Ø�#�b”j—n’nÐ%AÀ6ÑJÔJÑKÔK€ð3ð 3ð 3ð 3ð ˆBŒJÐ7Ñ8Ô8€	ð ˆBŒJÐ4Ñ5Ô5€	ð.ð .ð .ð .ðb1(ð 1(ð 1(ð 1(ðh%ð %ð %ð %ðPð ð ð ð ð r   