Ë
    ã/_i  ã                  ót   — U d dl mZ d dlmZmZmZ d dlmZ  ee«      Z	de
d<   erd dlmZ 	 	 	 	 	 	 	 	 d	d„Zy)
é    )Úannotations)ÚTYPE_CHECKINGÚAnyÚFinal)Ú
get_loggerr   Ú_LOGGER)ÚSessionStatec                óð   — 	 | j                  |«      }|t        |dd«      nd}|€|S t        |«      st        j	                  d||«       |S 	  ||| «      S # t
        $ r |cY S w xY w# t
        $ r |cY S w xY w)aÞ  Return the user-visible value for a widget if it has a ``presenter``.

    If the widget's metadata defines a ``presenter`` callable, it is used to
    transform the stored value into its presentation form. Any exception raised
    while resolving metadata or invoking the presenter is swallowed and
    ``base_value`` is returned, so presentation never interferes with core
    behavior.

    Notes
    -----
    Presentation is applied exclusively for user-facing access paths such as:
    - `st.session_state[... ]` via `SessionState.__getitem__`
    - `SessionState.filtered_state`

    Internal serialization paths (for example `WStates.as_widget_states()` and
    `SessionState.get_widget_states()`) must operate on base (unpresented)
    values to ensure stable and lossless serialization. Do not use
    `apply_presenter` in serialization code paths.

    Parameters
    ----------
    session_state : SessionState
        The current session state object that holds widget state and metadata.
    widget_id : str
        The identifier of the widget whose value is being presented.
    base_value : Any
        The raw value stored for the widget.

    Returns
    -------
    Any
        The value that should be shown to the user.
    NÚ	presenterzDWidget '%s' has a non-callable presenter (%r); returning base value.)Ú_get_widget_metadataÚgetattrÚcallabler   ÚwarningÚ	Exception)Úsession_stateÚ	widget_idÚ
base_valueÚmetar   s        úc/var/www/html/land_sniper/venv/lib/python3.12/site-packages/streamlit/runtime/state/presentation.pyÚapply_presenterr      s›   € ðJØ×1Ñ1°)Ó<ˆØ8<Ð8H”G˜D +¨tÔ4Èdˆ	ØÐØÐô ˜	Ô"ÜO‰OØVØØôð
 Ðð	Ù˜Z¨Ó7Ð7øÜò 	ØÒð	ûäò àÒðús4   ‚%A' ¨#A' ÁA ÁA$Á!A' Á#A$Á$A' Á'A5Á4A5N)r   r	   r   Ústrr   r   Úreturnr   )Ú
__future__r   Útypingr   r   r   Ústreamlit.loggerr   Ú__name__r   Ú__annotations__Ú%streamlit.runtime.state.session_stater	   r   © ó    r   ú<module>r!      sM   ðö #ç ,Ñ ,å 'á˜HÓ%€ˆÓ %áÝBð:Øð:Ø,/ð:Ø=@ð:àô:r    