+
    0j                     @   ^ RI t ^ RIt^ RIt^ RIt^ RIt^RIHt ]P                  '       d   ^ RIH	t	 ]P                  ! R4      t ! R R] P                  4      t]P                  ! ^@R7      R R	 l4       t]P                  ! ^@R7      R
 R l4       tR R ltR R ltR# )    N)
StrOrBytesSOCKS5ATypez'^\[(?P<address>[^\]]+)\]:(?P<port>\d+)$c                   H   a  ] tR t^t o RtRtRt]V 3R lR l4       tRt	V t
R# )AddressTypeIPV4IPV6DNc                "   < V ^8  d   QhRRRR/# )   socks5atyper   returnr    )format__classdict__s   "b/Users/mitch_tango/dev/rabbit-r1-livekit/agent/.venv/lib/python3.14/site-packages/socksio/utils.py__annotate__AddressType.__annotate__   s     	& 	&M 	&m 	&    c                    ^ RI Hp WP                  8X  d   \        P                  # WP
                  8X  d   \        P                  # WP                  8X  d   \        P                  # \        V4      h)r   r   )
socksio.socks5r   IPV4_ADDRESSr   r   DOMAIN_NAMEr
   IPV6_ADDRESSr	   
ValueError)clsr   r   s   && r   from_socks5_atypeAddressType.from_socks5_atype   sV    .222###333>>!444###%%r   r   N)__name__
__module____qualname____firstlineno__r   r	   r
   classmethodr   __static_attributes____classdictcell__)r   s   @r   r   r      s&     DD	B	& 	&r   r   )maxsizec                f    V ^8  d   QhR\         R\        P                  \        \        3,          /# )r   addrr   )r   typingTupler   bytes)r   s   "r   r   r   #   s(     	1 	1 	1[%5G(H 	1r   c                   \        V \        4      '       d   V P                  4       MT p  \        P                  \
        P                  ! \
        P                  V 4      3#   \         dm     \        P                  \
        P                  ! \
        P                  T 4      3u #   \         d&    \        P                  T P                  4       3u u # i ; ii ; i)zKDetermines the type of address and encodes it into the format SOCKS expects)
isinstancer+   decoder   r	   socket	inet_ptonAF_INET6OSErrorr   AF_INETr
   encode)r(   s   &r   encode_addressr5   "   s     'tU334;;=D1!1!1&//4!HHH 1	1##V%5%5fnnd%KKK 	1>>4;;=00	11s/   4A C+4B"C"+CCCCc                <    V ^8  d   QhR\         R\        R\        /# )r   address_typeencoded_addrr   )r   r+   str)r   s   "r   r   r   0   s!     % % %E %c %r   c                8   V \         P                  8X  d&   \        P                  ! \        P                  V4      # V \         P
                  8X  d&   \        P                  ! \        P                  V4      # V \         P                  8X  g   Q hVP                  4       # )z&Decodes the address from a SOCKS reply)	r   r	   r/   	inet_ntopr1   r   r3   r
   r.   )r7   r8   s   &&r   decode_addressr<   /   so     {'''>>	))	)=={~~---""$$r   c                f    V ^8  d   QhR\         R\        P                  \        \        3,          /# r   addressr   )r   r)   r*   r9   int)r   s   "r   r   r   ;   s'      J 6<<S;Q r   c                V   \        V \        4      '       d   V P                  4       MT p \        P                  ! \
        V 4      pV'       d#   VP                  R4      VP                  R4      r MV P                  R4      w  rp V \        V4      3#   \         d    \        R4      Rhi ; i)zReturns a tuple (address: str, port: int) from an address string with a port
i.e. '127.0.0.1:8080', '[0:0:0:0:0:0:0:1]:3080' or 'localhost:8080'.

Note no validation is done on the domain or IP itself.
r?   port:zInvalid address + port. Please supply a valid domain name, IPV4 or IPV6 address with the port as a suffix, i.e. `127.0.0.1:3080`, `[0:0:0:0:0:0:0:1]:3080` or `localhost:3080`N)
r-   r+   r.   rematchIP_V6_WITH_PORT_REGEXgroup	partitionr@   r   )r?   rE   str_port_s   &   r   split_address_port_from_stringrK   ;   s     #-We"<"<gnn'GHH*G4E!KK	2EKK4G&005HH%% ;
 		s   B B(c                    V ^8  d   QhR\         P                  \        \         P                  \        \        3,          3,          R\         P                  \
        \        3,          /# r>   )r)   Unionr   r*   r@   r9   )r   s   "r   r   r   R   sD      \\*fll:s?&CCD\\#s(r   c                    \        V \        4      '       dU   V w  r\        V \        4      '       d   V P                  4       p \        V\        \        34      '       d   \        V4      pW3# \        V 4      w  rW3# )z@Returns an (address, port) from an address string-like or tuple.)r-   tupler+   r.   r9   r@   rK   )r?   rB   s   & r   #get_address_port_tuple_from_addressrP   R   sk     '5!!gu%%nn&GdS%L))t9D = 7w?=r   )enum	functoolsrD   r/   r)   _typesr   TYPE_CHECKINGr   r   compilerF   Enumr   	lru_cacher5   r<   rK   rP   r   r   r   <module>rX      s      	   	* 

#MN &$)) &$ R 	1 !	1 R % !%.r   