Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/site-packages/werkzeug/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/site-packages/werkzeug/__pycache__/urls.cpython-312.pyc

�

'ٜg����ddlmZddlZddlZddlZddlZddlmZddlm	Z	ddlm
Z
ddlmZddlmZdd	l
mZdd
�Zej de�dd�Zeged
��d�d���j)�Zede�Zededz�Zededz�Zededz�Zdd�Zdd�Zdej8j:vr%ej8j:j=d�d d�Zd!d�Z y)"�)�annotationsN)�quote)�unquote)�	urlencode)�urlsplit)�
urlunsplit�)�iter_multi_itemsc�z�t|j|j|jd��}||jfS)zRUsed in :func:`uri_to_iri` after unquoting to re-quote any
    invalid bytes.
    ���safe)r�object�start�end)�e�outs  �8/usr/local/lib/python3.12/site-packages/werkzeug/urls.py�_codec_error_url_quoters1���������1�5�5�)��
3�C�����:���werkzeug.url_quotec���djd�t|�D��}tjd|�d�tj��d�fd�}d|��|_|S)z�Create a function that unquotes all percent encoded characters except those
    given. This allows working with unquoted characters if possible while not changing
    the meaning of a given part of a URL.
    �|c3�6K�|]}t|�d����y�w)�02XN)�ord)�.0�cs  r�	<genexpr>z%_make_unquote_part.<locals>.<genexpr>"s����>�
�1�#�a�&����
�s�z((?:%(?:z))+)c����t�j|��}g}|D]9}|jt|dd��|jt	|d���;dj|�S)Nzutf-8rr)�iter�split�appendr�next�join)�value�partsr�part�patterns    �r�_unquote_partialz,_make_unquote_part.<locals>._unquote_partial%s]����W�]�]�5�)�*�����D��J�J�w�t�W�.B�C�D��J�J�t�E�2��'���w�w�s�|�r�	_unquote_)r&�str�returnr,)r%�sorted�re�compile�I�__name__)�name�chars�choicesr*r)s    @r�_make_unquote_partr6sW���
�h�h�>��u�
�>�>�G��j�j�8�G�9�D�1�2�4�4�8�G��#,�D�6� 2����r�!�%��fragment�queryz&=+#�pathz/?#�userz:@/?#c��t|�}t|j�}t|j�}t|j�}|jrt|j�}nd}d|vrd|�d�}|jr|�d|j��}|jrDt|j�}|jrt|j�}|�d|��}|�d|��}t|j||||f�S)a-Convert a URI to an IRI. All valid UTF-8 characters are unquoted,
    leaving all reserved and invalid characters quoted. If the URL has
    a domain, it is decoded from Punycode.

    >>> uri_to_iri("http://xn--n3h.net/p%C3%A5th?q=%C3%A8ry%DF")
    'http://\u2603.net/p\xe5th?q=\xe8ry%DF'

    :param uri: The URI to convert.

    .. versionchanged:: 3.0
        Passing a tuple or bytes, and the ``charset`` and ``errors`` parameters,
        are removed.

    .. versionchanged:: 2.3
        Which characters remain quoted is specific to each part of the URL.

    .. versionchanged:: 0.15
        All reserved and invalid characters remain quoted. Previously,
        only some reserved characters were preserved, and invalid bytes
        were replaced instead of left quoted.

    .. versionadded:: 0.6
    r�:�[�]�@)r�
_unquote_pathr<�_unquote_queryr;�_unquote_fragmentr:�hostname�_decode_idna�port�username�
_unquote_user�passwordr�scheme)�urir'r<r;r:�netloc�authrKs        r�
uri_to_irirP=s���0
�S�M�E�����$�D��5�;�;�'�E� ����0�H��~�~��e�n�n�-����
�f�}��V�H�A����z�z��8�1�U�Z�Z�L�)���~�~��U�^�^�,���>�>�$�U�^�^�4�H��V�1�X�J�'�D��6��6�(�#���u�|�|�V�T�5�(�C�D�Drc�>�t|�}t|jd��}t|jd��}t|jd��}|j
r+|j
j
d�jd�}nd}d|vrd	|�d
�}|jr|�d|j��}|jrHt|jd��}|jrt|jd��}|�d|��}|�d|��}t|j||||f�S)
a,Convert an IRI to a URI. All non-ASCII and unsafe characters are
    quoted. If the URL has a domain, it is encoded to Punycode.

    >>> iri_to_uri('http://\u2603.net/p\xe5th?q=\xe8ry%DF')
    'http://xn--n3h.net/p%C3%A5th?q=%C3%A8ry%DF'

    :param iri: The IRI to convert.

    .. versionchanged:: 3.0
        Passing a tuple or bytes, the ``charset`` and ``errors`` parameters,
        and the ``safe_conversion`` parameter, are removed.

    .. versionchanged:: 2.3
        Which characters remain unquoted is specific to each part of the URL.

    .. versionchanged:: 0.15
        All reserved characters remain unquoted. Previously, only some reserved
        characters were left unquoted.

    .. versionchanged:: 0.9.6
       The ``safe_conversion`` parameter was added.

    .. versionadded:: 0.6
    z%!$&'()*+,/:;=@r
z%!$&'()*+,/:;=?@z%!#$&'()*+,/:;=?@�idna�asciirr?r@rAz%!$&'()*+,;=rB)
rrr<r;r:rF�encode�decoderHrIrKrrL)�irir'r<r;r:rNrOrKs        r�
iri_to_urirWqs��2
�S�M�E�����"3�4�D��%�+�+�$6�7�E��U�^�^�*=�>�H��~�~����&�&�v�.�5�5�g�>����
�f�}��V�H�A����z�z��8�1�U�Z�Z�L�)���~�~��U�^�^�.�9���>�>��U�^�^�.�A�H��V�1�X�J�'�D��6��6�(�#���u�|�|�V�T�5�(�C�D�Drz
itms-servicesc�|�	|jd�}	|jd�S#t$r|cYSwxYw#t$rYnwxYwg}|j	d�D]R}	|j|jd���%#t$r#|j|jd��Y�PwxYwdj
|�S)NrSrR�.�.)rT�UnicodeEncodeErrorrU�UnicodeDecodeErrorr"r#r%)�domain�datar'r(s    rrGrG�s�����}�}�W�%��

��{�{�6�"�"��
���
����
��
��
�E��
�
�4� ��	/��L�L����V�,�-��!�	/��L�L����W�-�.�	/��!��8�8�E�?�s-�%�6�3�3�	A�A� A=�=)B)�(B)c�b�t|�D�cgc]
}|d��	|��}}t|d��Scc}w)Nr	z!$'()*,/:;?@r
)r
r)r;�x�itemss   r�
_urlencoderb�s9��(��/�D�/�1�1�Q�4�3C�Q�/�E�D��U��0�0��
Es�
,�,)r�UnicodeErrorr-ztuple[str, int])r3r,r4r,r-zt.Callable[[str], str])rMr,r-r,)rVr,r-r,)r]r,r-r,)r;z1t.Mapping[str, str] | t.Iterable[tuple[str, str]]r-r,)!�
__future__r�codecsr/�typing�t�urllib.parse�urllibrrrrr�datastructuresr
r�register_errorr6�bytes�rangerU�_always_unsaferErDrCrJrPrW�parse�uses_netlocr#rGrb�rr�<module>rrs���"�
�	���� �"�!�#�,������*�,B�C��2�1��t��1�d�1�D�1�2�9�9�;��&�z�>�B��#�G�^�f�-D�E��"�6�>�E�+A�B�
�"�6�>�G�+C�D�
�1E�h4E�t�&�,�,�2�2�2�
�L�L���#�#�O�4��21r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists