�
��g* � �| � d Z ddlZddlmZmZmZ ddlmZmZm Z ddl
mZ ddlm
Z
mZ e eeef Ze eee f Ze deeeef eeeef f Zded efd
�Zdeee eef ef d efd�Zdeee eef ef d efd
�Zdeded e edf fd�ZdS )zQuery string handling.� N)�Iterable�Mapping�Sequence)�Any�SupportsInt�Union)�istr� )�QUERY_PART_QUOTER�QUERY_QUOTER�v�returnc �& � t | � � }|t u rt | � � S t | t � � r| S t | t � � rbt j | � � rt d� � �t j | � � rt d� � �t t | � � � � S |t ur1t | t � � rt t | � � � � S t d� | |� � � � �)z%Convert a query variable to a string.zfloat('inf') is not supportedzfloat('nan') is not supportedzMInvalid variable type: value should be str, int or float, got {!r} of type {})
�type�int�str�
isinstance�float�math�isinf�
ValueError�isnan�boolr � TypeError�format)r
�clss �[/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/yarl/_query.py� query_varr s� � �
�q�'�'�C�
�c�z�z��1�v�v�
��!�S��� ����!�U��� ��:�a�=�=� >��<�=�=�=��:�a�=�=� >��<�=�=�=��5��8�8�}�}��
�$���:�a��5�5���3�q�6�6�{�{��
� ��V�A�s�^�^�� � � �itemsc �X �� t ��fd�| D � � }d� |� � S )z�Return a query string from a sequence of (key, value) pairs.
value is a single value or a sequence of values for the key
The sequence of values must be a list or tuple.
c
� �� g | ]}\ }}t |� � t urt |t t f� � r|n|fD ]@} �|� � � d �t |� � t u r|nt |� � � � � ���A�~S ��=)r r r �list�tupler )�.0�k�valr
�quoters �r �
<listcomp>z8get_str_query_from_sequence_iterable.<locals>.<listcomp>2 s� �� �
�
�
��A�s���9�9�C�'�'�J�s�T�5�M�,J�,J�'�C�C�QT�PV�
�
�
� �6�!�9�9�F�F�v�v�4��7�7�c�>�>�a�a�y��|�|�D�D�F�F�
�
�
�
r �&�r �join�r �pairsr* s @r �$get_str_query_from_sequence_iterabler1 ( sD �� � �F�
�
�
�
��
�
�
�E� �8�8�E�?�?�r c �X �� t ��fd�| D � � }d� |� � S )z�Return a query string from an iterable.
The iterable must contain (key, value) pairs.
The values are not allowed to be sequences, only single values are
allowed. For sequences, use `_get_str_query_from_sequence_iterable`.
c � �� g | ]C\ }} �|� � � d �t |� � t u r|nt |� � � � � ���DS r# )r r r )r'