o
    ,&]iE                     @  sZ   d dl mZ d dlmZmZ d dlmZ G dd deddZG dd	 d	eZdddZ	dS )    )annotations)Any	TypedDict)AttributeDictionaryc                   @  s   e Zd ZdZdS )BidiComponentStatez
    The schema for the state of a bidirectional component.

    The state is a flat dictionary-like object (key -> value) that supports
    both key and attribute notation via :class:`AttributeDictionary`.
    N)__name__
__module____qualname____doc__ r   r   j/var/www/html/IGF-ODF-V3/venv/lib/python3.10/site-packages/streamlit/components/v2/bidi_component/state.pyr      s    r   F)totalc                      s(   e Zd ZdZ		d
d fdd	Z  ZS )BidiComponentResulta  The schema for the custom component result object.

    The custom component result object is a dictionary-like object that
    supports both key and attribute notation. It contains all of the
    component's state and trigger values.

    Attributes
    ----------
    <state_keys> : Any
        All state values from the component. State values are persistent across
        app reruns until explicitly changed. You can have multiple state keys
        as attributes.
    <trigger_keys> : Any
        All trigger values from the component. Trigger values are transient and
        reset to ``None`` after one script run. You can have multiple trigger
        keys as attributes.

    N
state_valsdict[str, Any] | Nonetrigger_valsreturnNonec                   s0   |du ri }|du ri }t  i || dS )a'  Initialize a BidiComponentResult.

        Parameters
        ----------
        state_vals : dict[str, Any] or None
            A dictionary of state values from the component.
        trigger_vals : dict[str, Any] or None
            A dictionary of trigger values from the component.
        N)super__init__)selfr   r   	__class__r   r   r   6   s   zBidiComponentResult.__init__)NN)r   r   r   r   r   r   )r   r   r	   r
   r   __classcell__r   r   r   r   r   "   s
    r   	raw_stater   r   dict[str, Any]c                 C  s   t | tr	t| S i S )zReturn flat mapping when given a dict; otherwise, empty dict.

    The new canonical state is flat, so this is effectively an identity for
    dict inputs and a guard for other types.
    )
isinstancedict)r   r   r   r   unwrap_component_stateU   s   r   N)r   r   r   r   )

__future__r   typingr   r   streamlit.utilr   r   r   r   r   r   r   r   <module>   s   3