
    4iE                    d    d dl mZ d dlmZmZ d dlmZ  G d ded      Z G d d	e      Zdd
Z	y)    )annotations)Any	TypedDict)AttributeDictionaryc                      e Zd ZdZy)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__     v/home/obispo/Crisostomo_bridge/mision_env/lib/python3.12/site-packages/streamlit/components/v2/bidi_component/state.pyr   r      s    r   r   F)totalc                  4     e Zd ZdZ	 	 d	 	 	 	 	 d fdZ x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.

    c                <    |i }|i }t         |   i ||       y)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__)self
state_valstrigger_vals	__class__s      r   r   zBidiComponentResult.__init__6   sA     JL
  		
r   )NN)r   dict[str, Any] | Noner   r   returnNone)r	   r
   r   r   r   __classcell__)r   s   @r   r   r   "   s6    * -1.2
)
 ,
 
	
 
r   r   c                <    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)	raw_states    r   unwrap_component_stater"   U   s     )D94	?ArAr   N)r!   r   r   zdict[str, Any])

__future__r   typingr   r   streamlit.utilr   r   r   r"   r   r   r   <module>r&      s2    # ! .% 0
- 0
fBr   