ó
    ÷Þ j¶  ã                  óH  • S SK Jr  S SKrS SKJr  SSKJrJrJrJ	r	J
r
Jr   " S S\R                  5      r " S S	\R                  5      r " S
 S\R                  5      r " S S\\R"                  5      r " S S\\R$                  5      rSS jr\R(                  " \5        g)é    )ÚannotationsN)ÚAnyé   )Ú	IDNAErrorÚ_unicode_dots_reÚalabelÚdecodeÚencodeÚulabelc                  ó4   • \ rS rSrSrSSS jjrSS	S jjrSrg)
ÚCodecé	   aN  Stateless IDNA 2008 codec.

Implements the :class:`codecs.Codec` protocol so that the whole-domain
encoder (:func:`idna.encode`) and decoder (:func:`idna.decode`) are
accessible through the standard codec machinery as ``"idna2008"``.

Only the ``"strict"`` error handler is supported; any other handler
raises :exc:`~idna.IDNAError`.
c                óf   • US:w  a  [        SU S3SS9eU(       d  g[        U5      [        U5      4$ )NÚstrictúUnsupported error handling "Ú"Úunsupported_errors©Úcode©ó    r   )r   r
   Úlen©ÚselfÚdataÚerrorss      ÚD/var/www/html/gaurav/venv/lib/python3.13/site-packages/idna/codec.pyr
   ÚCodec.encode   s;   € Ø�XÓÜÐ:¸6¸(À!ÐDÐK_Ñ`Ð`æØä�d‹|œS ›YÐ&Ð&r   c                óf   • US:w  a  [        SU S3SS9eU(       d  g[        U5      [        U5      4$ )Nr   r   r   r   r   ©Ú r   )r   r	   r   r   s      r   r	   ÚCodec.decode   s;   € Ø�XÓÜÐ:¸6¸(À!ÐDÐK_Ñ`Ð`æØä�d‹|œS ›YÐ&Ð&r   © N)r   )r   Ústrr   r$   Úreturnútuple[bytes, int])r   Úbytesr   r$   r%   útuple[str, int])Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r
   r	   Ú__static_attributes__r#   r   r   r   r   	   s   † ñö'÷'ñ 'r   r   c                  ó"   • \ rS rSrSrSS jrSrg)ÚIncrementalEncoderé'   a›  Incremental IDNA 2008 encoder.

Buffers a partial trailing label across calls until either the next
label separator is seen or ``final=True``, so that streamed input is
encoded one whole label at a time. Any of the four Unicode label
separators (``U+002E``, ``U+3002``, ``U+FF0E``, ``U+FF61``) ends a
label; the result always uses ``U+002E`` as the separator.

Only the ``"strict"`` error handler is supported.
c                óŠ  • US:w  a  [        SU S3SS9eU(       d  g[        R                  " U5      nSnU(       a#  US   (       d  S	nUS	 OU(       d  US	 U(       a  S	n/ nS
nU H7  nUR                  [	        U5      5        U(       a  US-  nU[        U5      -  nM9     S	R                  U5      U-   n	U[        U5      -  nX—4$ )Nr   r   r   r   r   r   r   éÿÿÿÿó   .r   r   )r   r   ÚsplitÚappendr   r   Újoin)
r   r   r   ÚfinalÚlabelsÚtrailing_dotÚresultÚsizeÚlabelÚresult_bytess
             r   Ú_buffer_encodeÚ!IncrementalEncoder._buffer_encode3   sÐ   € Ø�XÓÜÐ:¸6¸(À!ÐDÐK_Ñ`Ð`æØä!×'Ò'¨Ó-ˆØˆÞØ˜"—:Ø#�Ø˜2‘JÞà˜2�JÞØ#'�LàˆØˆÛˆEØ�M‰Mœ& ›-Ô(ÞØ˜‘	�Ø”C˜“JÑŠDñ	 ð —y‘y Ó(¨<Ñ7ˆØ”�LÓ!Ñ!ˆØÐ!Ð!r   r#   N)r   r$   r   r$   r8   Úboolr%   r&   )r)   r*   r+   r,   r-   r?   r.   r#   r   r   r0   r0   '   s   † ñ	÷"r   r0   c                  ó"   • \ rS rSrSrSS jrSrg)ÚIncrementalDecoderéS   zÿIncremental IDNA 2008 decoder.

Buffers a partial trailing label across calls until either the next
label separator is seen or ``final=True``, so that streamed input is
decoded one whole label at a time.

Only the ``"strict"`` error handler is supported.
c                ó  • US:w  a  [        SU S3SS9eU(       d  g[        U[        5      (       d   [        US5      n[        R
                  " U5      nS
nU(       a#  US   (       d  SnUS	 OU(       d  US	 U(       a  Sn/ nSnU H7  n	UR                  [        U	5      5        U(       a  US-  nU[        U	5      -  nM9     SR                  U5      U-   n
U[        U5      -  nX¨4$ ! [         a  n[        SS	S9UeS nAff = f)Nr   r   r   r   r   r    ÚasciizInvalid ASCII in A-labelÚinvalid_asciir!   r3   Ú.r   r   )
r   Ú
isinstancer$   ÚUnicodeDecodeErrorr   r5   r6   r   r   r7   )r   r   r   r8   Úerrr9   r:   r;   r<   r=   Ú
result_strs              r   Ú_buffer_decodeÚ!IncrementalDecoder._buffer_decode]   s  € Ø�XÓÜÐ:¸6¸(À!ÐDÐK_Ñ`Ð`æØä˜$¤×$Ñ$ð[Ü˜4 Ó)�ô "×'Ò'¨Ó-ˆØˆÞØ˜"—:Ø"�Ø˜2‘JÞà˜2�JÞØ#&�LàˆØˆÛˆEØ�M‰Mœ& ›-Ô(ÞØ˜‘	�Ø”C˜“JÑŠDñ	 ð —X‘X˜fÓ%¨Ñ4ˆ
Ø”�LÓ!Ñ!ˆØÐ!Ð!øô3 &ó [ÜÐ :ÀÑQÐWZÐZûð[ús   ³C' Ã'
DÃ1C<Ã<Dr#   N)r   r   r   r$   r8   rA   r%   r(   )r)   r*   r+   r,   r-   rM   r.   r#   r   r   rC   rC   S   s   † ñ÷#"r   rC   c                  ó   • \ rS rSrSrg)ÚStreamWriteréƒ   r#   N©r)   r*   r+   r,   r.   r#   r   r   rP   rP   ƒ   ó   † Úr   rP   c                  ó   • \ rS rSrSrg)ÚStreamReaderé‡   r#   NrR   r#   r   r   rU   rU   ‡   rS   r   rU   c           
     ó¬   • U S:w  a  g[         R                  " U [        5       R                  [        5       R                  [
        [        [        [        S9$ )a‡  Codec search function registered with :mod:`codecs`.

Returns a :class:`codecs.CodecInfo` for the ``"idna2008"`` codec name
so that ``str.encode("idna2008")`` and ``bytes.decode("idna2008")``
invoke the IDNA 2008 codec defined in this module.

:param name: The codec name being looked up.
:returns: A :class:`codecs.CodecInfo` instance if ``name`` is
    ``"idna2008"``, otherwise ``None``.
Úidna2008N)Únamer
   r	   ÚincrementalencoderÚincrementaldecoderÚstreamwriterÚstreamreader)	ÚcodecsÚ	CodecInfor   r
   r	   r0   rC   rP   rU   )rY   s    r   Úsearch_functionr`   ‹   sC   € ð ˆzÓØÜ×ÒØÜ‹w�~‰~Ü‹w�~‰~Ü-Ü-Ü!Ü!ñð r   )rY   r$   r%   zcodecs.CodecInfo | None)Ú
__future__r   r^   Útypingr   Úcorer   r   r   r	   r
   r   r   ÚBufferedIncrementalEncoderr0   ÚBufferedIncrementalDecoderrC   rP   rU   r`   Úregisterr#   r   r   Ú<module>rg      s…   ðÝ "ã Ý ç M× Mô'ˆF�L‰Lô 'ô<)"˜×:Ñ:ô )"ôX-"˜×:Ñ:ô -"ô`	�5˜&×-Ñ-ô 	ô	�5˜&×-Ñ-ô 	ôð0 ‡‚�Õ  r   