§
    ÏÁ³g(.  ã                   óæ  — d dl Z d dlmZ d dlmZmZ d dlmZmZm	Z	m
Z
mZmZ ddlmZmZ ddlmZmZ ddlmZmZmZ g d	¢Z e j         ej        d
¦  «        ¦  «        Z e j         ej        d
¦  «        ¦  «        Z G d„ de¦  «        Z edd¬¦  «         G d„ de¦  «        ¦   «         Z edd¬¦  «         G d„ de¦  «        ¦   «         Z edd¬¦  «         G d„ de¦  «        ¦   «         Z edd¬¦  «         G d„ de¦  «        ¦   «         Z  edd¬¦  «         G d„ de¦  «        ¦   «         Z! edd¬¦  «         G d„ de¦  «        ¦   «         Z" ed¬¦  «         G d„ de¦  «        ¦   «         Z#dS )é    N)ÚABC)Ú	dataclassÚfield)ÚAnyÚcastÚDictÚListÚTupleÚUnioné   )ÚmethodÚrequest_target)ÚHeadersÚnormalize_and_validate)ÚbytesifyÚLocalProtocolErrorÚvalidate)ÚEventÚRequestÚInformationalResponseÚResponseÚDataÚEndOfMessageÚConnectionClosedÚasciic                   ó   — e Zd ZdZdZdS )r   z$
    Base class for h11 events.
    © N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   ó    úI/var/www/html/mpstechhub/venv/lib/python3.11/site-packages/h11/_events.pyr   r       s   € € € € € ðð ð €I€I€Ir#   r   FT)ÚinitÚfrozenc                   óð   ‡ — e Zd ZU dZdZeed<   eed<   eed<   eed<   ddd	œdeee	f         deee
eeef                  e
ee	e	f                  f         deee	f         deee	f         d
eddfˆ fd„ZdZˆ xZS )r   an  The beginning of an HTTP request.

    Fields:

    .. attribute:: method

       An HTTP method, e.g. ``b"GET"`` or ``b"POST"``. Always a byte
       string. :term:`Bytes-like objects <bytes-like object>` and native
       strings containing only ascii characters will be automatically
       converted to byte strings.

    .. attribute:: target

       The target of an HTTP request, e.g. ``b"/index.html"``, or one of the
       more exotic formats described in `RFC 7320, section 5.3
       <https://tools.ietf.org/html/rfc7230#section-5.3>`_. Always a byte
       string. :term:`Bytes-like objects <bytes-like object>` and native
       strings containing only ascii characters will be automatically
       converted to byte strings.

    .. attribute:: headers

       Request headers, represented as a list of (name, value) pairs. See
       :ref:`the header normalization rules <headers-format>` for details.

    .. attribute:: http_version

       The HTTP protocol version, represented as a byte string like
       ``b"1.1"``. See :ref:`the HTTP version normalization rules
       <http_version-format>` for details.

    )r   ÚheadersÚtargetÚhttp_versionr   r(   r)   r*   ó   1.1F)r*   Ú_parsedr,   ÚreturnNc                ó°  •— t          ¦   «                              ¦   «          t          |t          ¦  «        rt                               | d|¦  «         n+t                               | dt          ||¬¦  «        ¦  «         |s|t                               | dt          |¦  «        ¦  «         t                               | dt          |¦  «        ¦  «         t                               | dt          |¦  «        ¦  «         nTt                               | d|¦  «         t                               | d|¦  «         t                               | d|¦  «         d}| j        D ]\  }}|dk    r|dz  }Œ| j	        d	k    r|dk    rt          d
¦  «        ‚|dk    rt          d¦  «        ‚t          t          | j        d¦  «         t          t          | j        d¦  «         d S )Nr(   ©r,   r   r)   r*   r   s   hostr   r+   zMissing mandatory Host: headerzFound multiple Host: headerszIllegal method characterszIllegal target characters)ÚsuperÚ__init__Ú
isinstancer   ÚobjectÚ__setattr__r   r   r(   r*   r   r   Ú	method_rer   Úrequest_target_rer)   )
Úselfr   r(   r)   r*   r,   Ú
host_countÚnameÚvalueÚ	__class__s
            €r$   r1   zRequest.__init__R   sÈ  ø€ õ 	‰Œ×ÒÑÔÐÝ�g�wÑ'Ô'ð 	Ý×Ò˜t Y°Ñ8Ô8Ð8Ð8å×ÒØ�iÕ!7¸ÈÐ!QÑ!QÔ!Qñô ð ð ð 	CÝ×Ò˜t X­x¸Ñ/?Ô/?Ñ@Ô@Ð@Ý×Ò˜t X­x¸Ñ/?Ô/?Ñ@Ô@Ð@Ý×Ò˜t ^µX¸lÑ5KÔ5KÑLÔLÐLÐLå×Ò˜t X¨vÑ6Ô6Ð6Ý×Ò˜t X¨vÑ6Ô6Ð6Ý×Ò˜t ^°\ÑBÔBÐBð ˆ
Øœ<ð 	 ð 	 ‰KˆD�%Ø�wŠˆØ˜a‘�
øØÔ Ò&Ð&¨:¸ª?¨?Ý$Ð%EÑFÔFÐFØ˜Š>ˆ>Ý$Ð%CÑDÔDÐDå•˜DœKÐ)DÑEÔEÐEÝÕ" D¤KÐ1LÑMÔMÐMÐMÐMr#   )r   r   r    r!   r"   ÚbytesÚ__annotations__r   r   Ústrr	   r
   Úboolr1   Ú__hash__Ú__classcell__©r;   s   @r$   r   r   (   s  ø€ € € € € € ðð ðB @€Ià€M€M�MØÐÐÑØ€M€M�MØÐÐÑð +1Øð(Nð (Nð (Nð �e˜S�jÔ!ð(Nð �w  U¨5°%¨<Ô%8Ô 9¸4ÀÀcÈ3ÀhÄÔ;PÐPÔQð	(Nð
 �e˜S�jÔ!ð(Nð ˜E 3˜JÔ'ð(Nð ð(Nð 
ð(Nð (Nð (Nð (Nð (Nð (NðV €H€H€H€H€Hr#   r   c                   óæ   ‡ — e Zd ZU dZeed<   eed<   eed<   eed<   dddd	œdeee	e
eef                  e	e
eef                  f         dedeeef         deeef         d
eddfˆ fd„Zdd„ZdZˆ xZS )Ú_ResponseBase)r(   r*   ÚreasonÚstatus_coder(   r*   rE   rF   r+   r#   F)r*   rE   r,   r,   r-   Nc                ó  •— t          ¦   «                              ¦   «          t          |t          ¦  «        rt                               | d|¦  «         n+t                               | dt          ||¬¦  «        ¦  «         |s t                               | dt          |¦  «        ¦  «         t                               | dt          |¦  «        ¦  «         t          |t          ¦  «        st          d¦  «        ‚t                               | dt          |¦  «        ¦  «         nTt                               | d|¦  «         t                               | d|¦  «         t                               | d|¦  «         |  
                    ¦   «          d S )Nr(   r/   rE   r*   zstatus code must be integerrF   )r0   r1   r2   r   r3   r4   r   r   Úintr   Ú__post_init__)r7   r(   rF   r*   rE   r,   r;   s         €r$   r1   z_ResponseBase.__init__‰   sg  ø€ õ 	‰Œ×ÒÑÔÐÝ�g�wÑ'Ô'ð 	Ý×Ò˜t Y°Ñ8Ô8Ð8Ð8å×ÒØ�iÕ!7¸ÈÐ!QÑ!QÔ!Qñô ð ð ð 	AÝ×Ò˜t X­x¸Ñ/?Ô/?Ñ@Ô@Ð@Ý×Ò˜t ^µX¸lÑ5KÔ5KÑLÔLÐLÝ˜k­3Ñ/Ô/ð HÝ(Ð)FÑGÔGÐGõ ×Ò˜t ]µC¸Ñ4DÔ4DÑEÔEÐEÐEå×Ò˜t X¨vÑ6Ô6Ð6Ý×Ò˜t ^°\ÑBÔBÐBÝ×Ò˜t ]°KÑ@Ô@Ð@à×ÒÑÔÐÐÐr#   c                 ó   — d S )Nr   ©r7   s    r$   rI   z_ResponseBase.__post_init__¨   s   € Øˆr#   ©r-   N)r   r   r    r"   r   r=   r<   rH   r   r	   r
   r>   r?   r1   rI   r@   rA   rB   s   @r$   rD   rD   €   s
  ø€ € € € € € àD€IàÐÐÑØÐÐÑØ€M€M�MØÐÐÑð +1Ø$'Øðð ð ð �w  U¨5°%¨<Ô%8Ô 9¸4ÀÀcÈ3ÀhÄÔ;PÐPÔQðð ð	ð
 ˜E 3˜JÔ'ðð �e˜S�jÔ!ðð ðð 
ðð ð ð ð ð ð>ð ð ð ð €H€H€H€H€Hr#   rD   c                   ó   — e Zd ZdZdd„ZdZdS )r   a  An HTTP informational response.

    Fields:

    .. attribute:: status_code

       The status code of this response, as an integer. For an
       :class:`InformationalResponse`, this is always in the range [100,
       200).

    .. attribute:: headers

       Request headers, represented as a list of (name, value) pairs. See
       :ref:`the header normalization rules <headers-format>` for
       details.

    .. attribute:: http_version

       The HTTP protocol version, represented as a byte string like
       ``b"1.1"``. See :ref:`the HTTP version normalization rules
       <http_version-format>` for details.

    .. attribute:: reason

       The reason phrase of this response, as a byte string. For example:
       ``b"OK"``, or ``b"Not Found"``.

    r-   Nc                 ó|   — d| j         cxk    rdk     s)n t          d                     | j         ¦  «        ¦  «        ‚d S )Néd   éÈ   zGInformationalResponse status_code should be in range [100, 200), not {}©rF   r   ÚformatrK   s    r$   rI   z#InformationalResponse.__post_init__Î   sS   € Ø�tÔ'Ð-Ð-Ò-Ð-¨#Ò-Ð-Ð-Ð-Ý$ð%ß%+¢V¨DÔ,<Ñ%=Ô%=ñô ð ð .Ð-r#   rL   ©r   r   r    r!   rI   r@   r   r#   r$   r   r   ¯   s3   € € € € € ðð ð:ð ð ð ð €H€H€Hr#   r   c                   ó   — e Zd ZdZdd„ZdZdS )r   añ  The beginning of an HTTP response.

    Fields:

    .. attribute:: status_code

       The status code of this response, as an integer. For an
       :class:`Response`, this is always in the range [200,
       1000).

    .. attribute:: headers

       Request headers, represented as a list of (name, value) pairs. See
       :ref:`the header normalization rules <headers-format>` for details.

    .. attribute:: http_version

       The HTTP protocol version, represented as a byte string like
       ``b"1.1"``. See :ref:`the HTTP version normalization rules
       <http_version-format>` for details.

    .. attribute:: reason

       The reason phrase of this response, as a byte string. For example:
       ``b"OK"``, or ``b"Not Found"``.

    r-   Nc                 ó|   — d| j         cxk    rdk     s)n t          d                     | j         ¦  «        ¦  «        ‚d S )NrP   iè  z;Response status_code should be in range [200, 1000), not {}rQ   rK   s    r$   rI   zResponse.__post_init__÷   sW   € Ø�tÔ'Ð.Ð.Ò.Ð.¨$Ò.Ð.Ð.Ð.Ý$ØM×TÒTØÔ$ñô ñô ð ð /Ð.r#   rL   rS   r   r#   r$   r   r   Ù   s3   € € € € € ðð ð8ð ð ð ð €H€H€Hr#   r   c            	       óV   — e Zd ZU dZdZeed<   eed<   eed<   	 d
dedededdfd	„ZdZ	dS )r   a  Part of an HTTP message body.

    Fields:

    .. attribute:: data

       A :term:`bytes-like object` containing part of a message body. Or, if
       using the ``combine=False`` argument to :meth:`Connection.send`, then
       any object that your socket writing code knows what to do with, and for
       which calling :func:`len` returns the number of bytes that will be
       written -- see :ref:`sendfile` for details.

    .. attribute:: chunk_start

       A marker that indicates whether this data object is from the start of a
       chunked transfer encoding chunk. This field is ignored when when a Data
       event is provided to :meth:`Connection.send`: it is only valid on
       events emitted from :meth:`Connection.next_event`. You probably
       shouldn't use this attribute at all; see
       :ref:`chunk-delimiters-are-bad` for details.

    .. attribute:: chunk_end

       A marker that indicates whether this data object is the last for a
       given chunked transfer encoding chunk. This field is ignored when when
       a Data event is provided to :meth:`Connection.send`: it is only valid
       on events emitted from :meth:`Connection.next_event`. You probably
       shouldn't use this attribute at all; see
       :ref:`chunk-delimiters-are-bad` for details.

    )ÚdataÚchunk_startÚ	chunk_endrW   rX   rY   Fr-   Nc                 ó®   — t                                | d|¦  «         t                                | d|¦  «         t                                | d|¦  «         d S )NrW   rX   rY   )r3   r4   )r7   rW   rX   rY   s       r$   r1   zData.__init__+  sR   € õ 	×Ò˜4 ¨Ñ.Ô.Ð.Ý×Ò˜4 °Ñ<Ô<Ð<Ý×Ò˜4 ¨iÑ8Ô8Ð8Ð8Ð8r#   )FF)
r   r   r    r!   r"   r<   r=   r?   r1   r@   r   r#   r$   r   r     s‡   € € € € € € ðð ð@ 5€Ià
€K€K�KØÐÐÑØ€O€O�Oð INð9ð 9Øð9Ø(,ð9ØAEð9à	ð9ð 9ð 9ð 9ð €H€H€Hr#   r   c            	       ó˜   ‡ — e Zd ZU dZdZeed<   dddœdeeee	e
e
f                  ee	eef                  df         deddfˆ fd	„ZdZˆ xZS )
r   aj  The end of an HTTP message.

    Fields:

    .. attribute:: headers

       Default value: ``[]``

       Any trailing headers attached to this message, represented as a list of
       (name, value) pairs. See :ref:`the header normalization rules
       <headers-format>` for details.

       Must be empty unless ``Transfer-Encoding: chunked`` is in use.

    )r(   r(   NF)r(   r,   r,   r-   c                óð   •— t          ¦   «                              ¦   «          |€t          g ¦  «        }n&t          |t          ¦  «        st	          ||¬¦  «        }t
                               | d|¦  «         d S )Nr/   r(   )r0   r1   r   r2   r   r3   r4   )r7   r(   r,   r;   s      €r$   r1   zEndOfMessage.__init__Q  sp   ø€ õ 	‰Œ×ÒÑÔÐØˆ?Ý˜b‘k”kˆGˆGÝ˜G¥WÑ-Ô-ð 	GÝ,¨W¸gÐFÑFÔFˆGå×Ò˜4 ¨GÑ4Ô4Ð4Ð4Ð4r#   )r   r   r    r!   r"   r   r=   r   r	   r
   r<   r>   r?   r1   r@   rA   rB   s   @r$   r   r   ;  s³   ø€ € € € € € ðð ð  €IàÐÐÑð Øð5ð 5ð 5ð Ø�T˜%  u Ô-Ô.°°U¸3À¸8´_Ô0EÀtÐKô
ð5ð ð5ð 
ð5ð 5ð 5ð 5ð 5ð 5ð" €H€H€H€H€Hr#   r   )r&   c                   ó   — e Zd ZdZdS )r   aA  This event indicates that the sender has closed their outgoing
    connection.

    Note that this does not necessarily mean that they can't *receive* further
    data, because TCP connections are composed to two one-way channels which
    can be closed independently. See :ref:`closing` for details.

    No fields.
    N)r   r   r    r!   r   r#   r$   r   r   e  s   € € € € € ðð ð 	€Dr#   r   )$ÚreÚabcr   Údataclassesr   r   Útypingr   r   r   r	   r
   r   Ú_abnfr   r   Ú_headersr   r   Ú_utilr   r   r   Ú__all__ÚcompileÚencoder5   r6   r   r   rD   r   r   r   r   r   r   r#   r$   ú<module>rh      s2  ðð 
€	€	€	Ø Ð Ð Ð Ð Ð Ø (Ð (Ð (Ð (Ð (Ð (Ð (Ð (Ø 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6à )Ð )Ð )Ð )Ð )Ð )Ð )Ð )Ø 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ð 5Ø 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9ðð ð €ð ˆBŒJ�}�v”} WÑ-Ô-Ñ.Ô.€	Ø�B”JÐ4˜~Ô4°WÑ=Ô=Ñ>Ô>Ð ðð ð ð ð ˆCñ ô ð ð €�˜dÐ#Ñ#Ô#ðTð Tð Tð Tð Tˆeñ Tô Tñ $Ô#ðTðn €�˜dÐ#Ñ#Ô#ð+ð +ð +ð +ð +�Eñ +ô +ñ $Ô#ð+ð\ €�˜dÐ#Ñ#Ô#ð&ð &ð &ð &ð &˜Mñ &ô &ñ $Ô#ð&ðR €�˜dÐ#Ñ#Ô#ð&ð &ð &ð &ð &ˆ}ñ &ô &ñ $Ô#ð&ðR €�˜dÐ#Ñ#Ô#ð/ð /ð /ð /ð /ˆ5ñ /ô /ñ $Ô#ð/ðn €�˜dÐ#Ñ#Ô#ð&ð &ð &ð &ð &�5ñ &ô &ñ $Ô#ð&ðR €�$ÐÑÔð	ð 	ð 	ð 	ð 	�uñ 	ô 	ñ Ôð	ð 	ð 	r#   