+
    i  c                   s:   R t ^ RItR tR tR tR tR tRtR tR	 t	R
 t
R tR tR tR t ! R R]P                  4      t ! R R]P                   4      t ! R R]P"                  4      t ! R R]]P$                  4      t ! R R]]P&                  4      tR tR# )uX   Codec for the Punycode encoding, as specified in RFC 3492

Written by Martin v. Löwis.
Nc                s    \        4       p\        4       pV  F@  p\        V4      ^8  d   VP                  \        V4      4       K/  VP	                  V4       KB  	  \        V4      p\        V4      V3# )z 3.1 Basic code point segregation)	bytearrayZsetordappendZaddZsortedbytes)strbaseextendedc   &   +/usr/lib64/python3.14/encodings/punycode.py	segregater
   
   s[    ;DuHq6C<KKALLO	 
 hH;      c                sR    ^ pV  F  p\        V4      V8  g   K  V^,          pK   	  V# )z@Return the length of str, considering only characters below max.)r   )r   Zmaxresr   s   &&  r	   selective_lenr      s,    
Cq6C<1HC  Jr   c                s    \        V 4      p V^,          pW48X  d   R# W,          pWQ8X  d   V^,           V3# WQ8  g   K3  V^,          pK>  )a  Return a pair (index, pos), indicating the next occurrence of
char in str. index is the position of the character considering
only ordinals up to and including char, and pos is the position in
the full string. index/pos is the starting position in the full
string.)r   )len)r   charindexposZlr   s   &&&&  r	   selective_findr      sK     	CA
q8OH97C<XQJEr   c                s   ^p. pRpV Fx  pR;rg\        V4      p\        W4      p	V	^,           W,
          ,          p
 \        WWg4      w  rgVR8X  d   M-WV,
          ,          p
VP                  V
^,
          4       Tp^ p
KD  TpKz  	  V# )z3.2 Insertion unsort codingr   )r   r   r   r   )r   r   ZoldcharresultZoldindexr   r   r   r   Zcurlendeltas   &&         r	   insertion_unsortr   0   s    GFH1vs)dn-&sU7IE{X%%EMM%'"HE  Mr   c                 sX    ^$V ^,           ,          V,
          pV^8  d   ^# V^8  d   ^# V# )i$    )jbiasr   s   && r	   Tr   F   s+    
A,
C
Qwq
RxJr   s$   abcdefghijklmnopqrstuvwxyz0123456789c                s<   \        4       p^ p \        W14      pW8  d(   VP                  \        V ,          4       \	        V4      # VP                  \        W@V,
          ^$V,
          ,          ,           ,          4       W,
          ^$V,
          ,          p V^,          pK  )(3.3 Generalized variable-length integers)r    r   r   digitsr   )ZNr   r   r   ts   &&   r	   generate_generalized_integerr   N   ss    [F	A
aJ5MM&)$= fQq5R!V"4567UQ	Qr   c                 s    V'       d   V R ,          p M	V ^,          p W V,          ,          p ^ pV R8  d   V ^#,          p V^$,          pK  V^$V ,          V ^&,           ,          ,           pV# )i  i  r   )r   ZfirstZnumcharsZ	divisionsr   s   &&&  r	   adaptr   [   s^    #!	hEI
#+R	U
urz23DKr   c                s    \        4       p^Hp\        V4       F=  w  rE\        WS4      pVP                  V4       \	        WT^ 8H  W,           ^,           4      pK?  	  \        V4      # )z3.4 Bias adaptation)r    Z	enumerater   Zextendr   r   )Zbaselendeltasr   r   Zpointsr   Zs   &&     r	   generate_integersr"   j   sZ     [FD"6*(5aUAIw~a'78 + =r   c                 s    \        V 4      w  r\        W4      p\        \        V4      V4      pV'       d   VR ,           V,           # V# )   -)r
   r   r"   r   )textr   r   r    r   r	   punycode_encoder%   u   s>    t_NDd-F TF3Hd{X%%Or   c           
     s   ^ p^p^ p  W,          pT^,          p^ATu;8:  d   ^Z8:  d   M M
T^A,
          pMM^0Tu;8:  d   ^98:  d   M M
T^,
          pM1TR8X  d'   \        RY^,
          TRY^,
          ,           R24      hTR3# \        Yb4      p	YHT,          ,          pY8  d   Y3# T^$T	,
          ,          pT^,          pK    \          d+    TR8X  d   \        RYT^,           R4      hT^,           R3u # i ; i)r   strictpunycodezincomplete punycode stringNzInvalid extended code point 'Z')Z
IndexErrorUnicodeDecodeErrorr   )
r   extposr   errorsr   Zwr   r   Zdigitr   s
   &&&&      r	   decode_generalized_numberr+      s   F	A	A
	$#D 	!444KET!T!2IEx$Z!8V'DXUVhEWDXXY%Z\ \ 4<aJ!)9>!aL	Q)  	$!(Xvax)EG GA:t##		$s   C 2C65C6c           	     s   ^pRp^Hp^ pV\        V4      8  d   \        WWR4      w  rxVf   V # WH^,           ,          pW4\        V 4      ^,           ,          ,          pVR8  d,   VR8X  d   \        RW^,
          VRVR 24      h\        R4      pV\        V 4      ^,           ,          pV RV \	        V4      ,           WR ,           p \        W^ 8H  \        V 4      4      pTpK  V # )	z3.2 Insertion sort codingNi r&   r'   zInvalid character U+ZxZ?r   )r   r+   r(   r   Zchrr   )	r   r   r*   r   r   r   r)   Znewposr   s	   &&&      r	   insertion_sortr,      s     D
CDF
3x=
 1(26@= KQwD	A&&(?!(a%*4(35 5 s8DSY]#DSzCI%T
2Uq[3t95Kr   c                 s   \        V \        4      '       d   V P                  R 4      p \        V \        4      '       d   \	        V 4      p V P                  R4      pVR8X  d   RpV P                  4       pM* \        V RV R V4      pY^,           R P                  4       p \        W4V4      #   \         d3   p\        R YP                  TP                  TP                  4      RhRp?ii ; i  \         dI   pT^,           p\        RT YeP                  ,           YeP                  ,           TP                  4      RhRp?ii ; i)Zasciir#   Z Nr'   r   )Z
isinstancer   encodeZ
memoryviewr   ZrfindZupperr(   ZstartZendZreasonr,   )r$   r*   r   r   r   ZexcZoffsetr!   r	   punycode_decoder.      s   ${{7#$
##T{
**T
C
by::<	;tDSz7F3D A<%%'7df55 " 	;$WdIIsww%(ZZ16:;	;  7q T!'		!16''>!$-26	77s1   5B+ C+ +C(6-C##C(+D>6AD99D>c                   s4   a  ] tR t^t o RR ltRR ltRtV tR# )Codecc                s2    \        V4      pV\        V4      3# N)r%   r   selfinputr*   r      &&& r	   r-   ZCodec.encode   s    e$CJr   c                s\    VR9  d   \        RV 24      h\        W4      pV\        V4      3# r&   zUnsupported error handling: )r&   ZreplaceZignore)UnicodeErrorr.   r   r1   r4   r	   decodeZCodec.decode   s6    88!=fXFGGe,CJr   r   N)r&   )__name__
__module____qualname____firstlineno__r-   r7   __static_attributes____classdictcell__Z__classdict__   @r	   r/   r/      s      r   r/   c                   s*   a  ] tR t^t o RR ltRtV tR# )IncrementalEncoderc                s    \        V4      # r0   )r%   r2   r3   Zfinal   &&&r	   r-   ZIncrementalEncoder.encode   s    u%%r   r   NF)r8   r9   r:   r;   r-   r<   r=   r>   r?   r	   r@   r@      s     & &r   r@   c                   s*   a  ] tR t^t o RR ltRtV tR# )IncrementalDecoderc                s~    V P                   R9  d   \        RV P                    24      h\        WP                   4      # r5   )r*   r6   r.   rA   rB   r	   r7   ZIncrementalDecoder.decode   s5    ;;==!=dkk]KLLukk22r   r   NrC   )r8   r9   r:   r;   r7   r<   r=   r>   r?   r	   rD   rD      s     3 3r   rD   c                   s    ] tR t^tRtR# )StreamWriterr   Nr8   r9   r:   r;   r<   r   r   r	   rE   rE          r   rE   c                   s    ] tR t^tRtR# )StreamReaderr   NrF   r   r   r	   rH   rH      rG   r   rH   c            
      s    \         P                  ! R \        4       P                  \        4       P                  \
        \        \        \        R7      # )r'   )Znamer-   r7   ZincrementalencoderZincrementaldecoderZstreamwriterZstreamreader)	codecsZ	CodecInfor/   r-   r7   r@   rD   rE   rH   r   r   r	   getregentryrJ      s6    w~~w~~--!! r   )Z__doc__rI   r
   r   r   r   r   r   r   r   r"   r%   r+   r,   r.   r/   r@   rD   rE   rH   rJ   r   r   r	   <module>rK      s   
 
!$, 
1	><74
FLL 
&22 &322 3	5,, 		5,, 	
	r   