Ë
    úmxi2  ã                  ó€   — d dl mZ d dlmZmZmZ d dlmZmZm	Z	 d dl
mZ d dlmZ erd dlmZ  G d„ deeef   «      Zy	)
é    )Úannotations)ÚIterableÚIteratorÚMutableMapping)ÚTYPE_CHECKINGÚAnyÚoverload)Úgather_metrics)Úget_session_state)ÚSupportsKeysAndGetItemc                  óØ  — e Zd ZdZd d„Zd!d„Zd"d„Z ed«      d#d„«       Zd$d„Z	 ed«      d%d	„«       Z
 ed
«      d#d„«       Zd$d„Ze	 	 	 	 	 	 d&d„«       Ze	 	 	 	 	 	 d'd„«       Zed(d„«       Zd)d*d„Z ed«      d%d„«       Z ed«      d+d„«       Z ed«      d*d„«       Z ed«      d,d„«       Zed-d„«       Ze	 	 	 	 d.d„«       Z ed«      	 	 	 	 d/d„«       Zed#d„«       Zed#d„«       Zy)0ÚQueryParamsProxyz†
    A stateless singleton that proxies ``st.query_params`` interactions
    to the current script thread's QueryParams instance.
    c                ót   — t        «       j                  «       5 }t        |«      cd d d «       S # 1 sw Y   y xY w©N)r   Úquery_paramsÚiter©ÚselfÚqps     úa/home/htdocs/ttos/venv/lib/python3.12/site-packages/streamlit/runtime/state/query_params_proxy.pyÚ__iter__zQueryParamsProxy.__iter__!   s/   € ÜÓ ×-Ñ-Ó/ð 	°2Ü˜“8÷	÷ 	ò 	úó   ™.®7c                ót   — t        «       j                  «       5 }t        |«      cd d d «       S # 1 sw Y   y xY wr   )r   r   Úlenr   s     r   Ú__len__zQueryParamsProxy.__len__%   ó/   € ÜÓ ×-Ñ-Ó/ð 	°2Ü�r“7÷	÷ 	ò 	úr   c                ót   — t        «       j                  «       5 }t        |«      cd d d «       S # 1 sw Y   y xY wr   )r   r   Ústrr   s     r   Ú__str__zQueryParamsProxy.__str__)   r   r   zquery_params.get_itemc                ó¸   — t        «       j                  «       5 }	 ||   cd d d «       S # t        $ r t        | j                  |«      «      ‚w xY w# 1 sw Y   y xY wr   )r   r   ÚKeyErrorÚmissing_key_error_message©r   Úkeyr   s      r   Ú__getitem__zQueryParamsProxy.__getitem__-   sh   € äÓ ×-Ñ-Ó/ð 	D°2ðDØ˜#‘w÷	Dñ 	Døô ò DÜ˜t×=Ñ=¸cÓBÓCÐCðDú÷	Dð 	Dúó   ™A›)©$AÁAÁAc                ód   — t        «       j                  «       5 }||= d d d «       y # 1 sw Y   y xY wr   ©r   r   r#   s      r   Ú__delitem__zQueryParamsProxy.__delitem__5   s/   € ÜÓ ×-Ñ-Ó/ð 	°2Ø�3�÷	÷ 	ñ 	ús   ™&¦/zquery_params.set_itemc                óh   — t        «       j                  «       5 }|||<   d d d «       y # 1 sw Y   y xY wr   r(   ©r   r$   Úvaluer   s       r   Ú__setitem__zQueryParamsProxy.__setitem__9   ó1   € äÓ ×-Ñ-Ó/ð 	°2ØˆBˆs‰G÷	÷ 	ñ 	úó   ™(¨1zquery_params.get_attrc                ó¸   — t        «       j                  «       5 }	 ||   cd d d «       S # t        $ r t        | j	                  |«      «      ‚w xY w# 1 sw Y   y xY wr   )r   r   r!   ÚAttributeErrorÚmissing_attr_error_messager#   s      r   Ú__getattr__zQueryParamsProxy.__getattr__>   sh   € äÓ ×-Ñ-Ó/ð 	K°2ðKØ˜#‘w÷	Kñ 	Køô ò KÜ$ T×%DÑ%DÀSÓ%IÓJÐJðKú÷	Kð 	Kúr&   c                ó¶   — t        «       j                  «       5 }	 ||= 	 d d d «       y # t        $ r t        | j	                  |«      «      ‚w xY w# 1 sw Y   y xY wr   )r   r   r!   r1   r"   r#   s      r   Ú__delattr__zQueryParamsProxy.__delattr__F   sh   € ÜÓ ×-Ñ-Ó/ð 	J°2ðJØ�s‘G÷	Jð 	Jøô ò JÜ$ T×%CÑ%CÀCÓ%HÓIÐIðJú÷	Jð 	Jús   ™A›(¨$AÁAÁAc                ó   — y r   © ©r   ÚparamsÚkwdss      r   ÚupdatezQueryParamsProxy.updateM   ó   € ð ó    c                ó   — y r   r7   r8   s      r   r;   zQueryParamsProxy.updateR   r<   r=   c                 ó   — y r   r7   )r   r:   s     r   r;   zQueryParamsProxy.updateW   s   € Ø;>r=   c               ó„   — t        «       j                  «       5 } |j                  |fi |¤Ž ddd«       y# 1 sw Y   yxY w)aÍ  
        Update one or more values in query_params at once from a dictionary or
        dictionary-like object.

        See `Mapping.update()` from Python's `collections` library.

        Parameters
        ----------
        other: SupportsKeysAndGetItem[str, str] | Iterable[tuple[str, str]]
            A dictionary or mapping of strings to strings.
        **kwds: str
            Additional key/value pairs to update passed as keyword arguments.
        N)r   r   r;   )r   r9   r:   r   s       r   r;   zQueryParamsProxy.updateZ   s=   € ô Ó ×-Ñ-Ó/ð 	&°2ØˆB�I‰I�fÑ% Ò%÷	&÷ 	&ñ 	&ús   ™6¶?zquery_params.set_attrc                óh   — t        «       j                  «       5 }|||<   d d d «       y # 1 sw Y   y xY wr   r(   r+   s       r   Ú__setattr__zQueryParamsProxy.__setattr__k   r.   r/   zquery_params.get_allc                ó€   — t        «       j                  «       5 }|j                  |«      cddd«       S # 1 sw Y   yxY w)aK  
        Get a list of all query parameter values associated to a given key.

        When a key is repeated as a query parameter within the URL, this method
        allows all values to be obtained. In contrast, dict-like methods only
        retrieve the last value when a key is repeated in the URL.

        Parameters
        ----------
        key: str
            The label of the query parameter in the URL.

        Returns
        -------
        List[str]
            A list of values associated to the given key. May return zero, one,
            or multiple values.
        N)r   r   Úget_allr#   s      r   rD   zQueryParamsProxy.get_allp   s5   € ô( Ó ×-Ñ-Ó/ð 	#°2Ø—:‘:˜c“?÷	#÷ 	#ò 	#úó   ™4´=zquery_params.clearc                ó~   — t        «       j                  «       5 }|j                  «        ddd«       y# 1 sw Y   yxY w)zs
        Clear all query parameters from the URL of the app.

        Returns
        -------
        None
        N)r   r   Úclearr   s     r   rG   zQueryParamsProxy.clear‡   s3   € ô Ó ×-Ñ-Ó/ð 	°2Ø�H‰HŒJ÷	÷ 	ñ 	ús   ™3³<zquery_params.to_dictc                ó~   — t        «       j                  «       5 }|j                  «       cddd«       S # 1 sw Y   yxY w)a  
        Get all query parameters as a dictionary.

        This method primarily exists for internal use and is not needed for
        most cases. ``st.query_params`` returns an object that inherits from
        ``dict`` by default.

        When a key is repeated as a query parameter within the URL, this method
        will return only the last value of each unique key.

        Returns
        -------
        Dict[str,str]
            A dictionary of the current query parameters in the app's URL.
        N)r   r   Úto_dictr   s     r   rI   zQueryParamsProxy.to_dict“   s3   € ô" Ó ×-Ñ-Ó/ð 	 °2Ø—:‘:“<÷	 ÷ 	 ò 	 ús   ™3³<c                 ó   — y r   r7   ©r   r9   s     r   Ú	from_dictzQueryParamsProxy.from_dict§   s   € ØTWr=   c                 ó   — y r   r7   rK   s     r   rL   zQueryParamsProxy.from_dictª   r<   r=   zquery_params.from_dictc                ó€   — t        «       j                  «       5 }|j                  |«      cddd«       S # 1 sw Y   yxY w)a¦  
        Set all of the query parameters from a dictionary or dictionary-like object.

        This method primarily exists for advanced users who want to control
        multiple query parameters in a single update. To set individual query
        parameters, use key or attribute notation instead.

        This method inherits limitations from ``st.query_params`` and can't be
        used to set embedding options as described in `Embed your app         <https://docs.streamlit.io/deploy/streamlit-community-cloud/share-your-app/embed-your-app#embed-options>`_.

        To handle repeated keys, the value in a key-value pair should be a list.

        .. note::
            ``.from_dict()`` is not a direct inverse of ``.to_dict()`` if
            you are working with repeated keys. A true inverse operation is
            ``{key: st.query_params.get_all(key) for key in st.query_params}``.

        Parameters
        ----------
        params: dict
            A dictionary used to replace the current query parameters.

        Example
        -------
        >>> import streamlit as st
        >>>
        >>> st.query_params.from_dict({"foo": "bar", "baz": [1, "two"]})

        N)r   r   rL   )r   r9   r   s      r   rL   zQueryParamsProxy.from_dict¯   s7   € ôH Ó ×-Ñ-Ó/ð 	(°2Ø—<‘< Ó'÷	(÷ 	(ò 	(úrE   c                ó   — d| › d�S )z3Returns a formatted error message for missing keys.zst.query_params has no key "ú".r7   ©r$   s    r   r"   z*QueryParamsProxy.missing_key_error_messageÖ   s   € ð .¨c¨U°"Ð5Ð5r=   c                ó   — d| › d�S )z9Returns a formatted error message for missing attributes.z"st.query_params has no attribute "rP   r7   rQ   s    r   r2   z+QueryParamsProxy.missing_attr_error_messageÛ   s   € ð 4°C°5¸Ð;Ð;r=   N)ÚreturnzIterator[str])rS   Úint)rS   r   )r$   r   rS   r   )r$   r   rS   ÚNone)r$   r   r,   r   rS   rU   )r9   ú0SupportsKeysAndGetItem[str, str | Iterable[str]]r:   r   rS   rU   )r9   ú)Iterable[tuple[str, str | Iterable[str]]]r:   r   rS   rU   )r:   zstr | Iterable[str]rS   rU   )r7   )rS   rU   )r$   r   rS   z	list[str])rS   zdict[str, str])r9   rW   rS   rU   )r9   rV   rS   rU   )r9   z\SupportsKeysAndGetItem[str, str | Iterable[str]] | Iterable[tuple[str, str | Iterable[str]]]rS   rU   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r
   r%   r)   r-   r3   r5   r	   r;   rB   rD   rG   rI   rL   Ústaticmethodr"   r2   r7   r=   r   r   r      sÑ  „ ñó
óóñ Ð+Ó,òDó -ðDóñ Ð+Ó,òó -ðñ Ð+Ó,òKó -ðKóJð ðØFðØSVðà	òó ðð ðØ?ðØLOðà	òó ðð Ú>ó Ø>ô&ñ" Ð+Ó,òó -ðñ Ð*Ó+ò#ó ,ð#ñ, Ð(Ó)ò	ó *ð	ñ Ð*Ó+ò ó ,ð ð& ÚWó ØWàðØFðà	òó ðñ Ð,Ó-ð$(ð4ð$(ð 
ò	$(ó .ð$(ðL ò6ó ð6ð ò<ó ñ<r=   r   N)Ú
__future__r   Úcollections.abcr   r   r   Útypingr   r   r	   Ústreamlit.runtime.metrics_utilr
   Ú+streamlit.runtime.state.session_state_proxyr   Ú	_typeshedr   r   r   r7   r=   r   ú<module>rc      s9   ðõ #ç >Ñ >ß /Ñ /å 9Ý IáÝ0ôC<�~ c¨3 hÑ/õ C<r=   