
    Rj                        S SK r S SKrS SKJrJrJr  SSKJrJrJ	r	J
r
Jr  \R                  " S5      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\\ R,                     4S jr\ R0                  " \5        g)    N)AnyOptionalTuple   )	IDNAErroralabeldecodeencodeulabelu   [.。．｡]c            	       `    \ rS rSrSrS
S\S\S\\\4   4S jjr	S
S\S\S\\\4   4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`.
dataerrorsreturnc                 ~    US:w  a  [        SR                  U5      5      eU(       d  g[        U5      [        U5      4$ )NstrictUnsupported error handling "{}"    r   )r   formatr
   lenselfr   r   s      M/var/www/html/Sattelite-Image/venv/lib/python3.13/site-packages/idna/codec.pyr
   Codec.encode   s:    X=DDVLMMd|SY&&r   c                 ~    US:w  a  [        SR                  U5      5      eU(       d  g[        U5      [        U5      4$ )Nr   r    r   )r   r   r	   r   r   s      r   r	   Codec.decode   s:    X=DDVLMMd|SY&&r    N)r   )__name__
__module____qualname____firstlineno____doc__strr   bytesintr
   r	   __static_attributes__r!   r   r   r   r   
   sQ    '3 ' '5;L ''5 '# 'U38_ ' 'r   r   c            
       <    \ rS rSrSrS\S\S\S\\\	4   4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.
r   r   finalr   c                    US:w  a  [        SR                  U5      5      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X4$ )	Nr   r   r   r      .r   r   )r   r   _unicode_dots_resplitappendr   r   join)
r   r   r   r.   labelstrailing_dotresultsizelabelresult_bytess
             r   _buffer_encode!IncrementalEncoder._buffer_encode4   s    X=DDVLMM!''-":#2J2J#'LEMM&-(	CJD	  yy(<7L!!!!r   r!   N)r"   r#   r$   r%   r&   r'   boolr   r(   r)   r<   r*   r!   r   r   r,   r,   (   s2    	"3 " "D "U5RU:EV "r   r,   c            
       <    \ rS rSrSrS\S\S\S\\\	4   4S jr
Srg	)
IncrementalDecoderU   zIncremental 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.
r   r   r.   r   c                    US:w  a  [        SR                  U5      5      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X4$ )
Nr   r   r   asciir   r0   .r   r   )
r   r   
isinstancer'   r2   r3   r4   r   r   r5   )
r   r   r   r.   r6   r7   r8   r9   r:   
result_strs
             r   _buffer_decode!IncrementalDecoder._buffer_decode_   s    X=DDVLMM$$$tW%D!''-":"2J2J#&LEMM&-(	CJD	  XXf%4
L!!!!r   r!   N)r"   r#   r$   r%   r&   r   r'   r>   r   r)   rG   r*   r!   r   r   r@   r@   U   s1     "3  "  "D  "U3PS8_  "r   r@   c                       \ rS rSrSrg)StreamWriter   r!   Nr"   r#   r$   r%   r*   r!   r   r   rJ   rJ          r   rJ   c                       \ rS rSrSrg)StreamReader   r!   NrL   r!   r   r   rO   rO      rM   r   rO   namer   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)rQ   r
   r	   incrementalencoderincrementaldecoderstreamwriterstreamreader)	codecs	CodecInfor   r
   r	   r,   r@   rJ   rO   )rQ   s    r   search_functionrZ      sC     zw~~w~~--!! r   )rX   retypingr   r   r   corer   r   r	   r
   r   compiler2   r   BufferedIncrementalEncoderr,   BufferedIncrementalDecoderr@   rJ   rO   r'   rY   rZ   registerr!   r   r   <module>rb      s     	 ' ' ; ;:::; 'FLL '<*":: *"Z*":: *"Z	5&-- 		5&-- 	# (6+;+;"< 0   r   