Ë
    úmxi  ã                  ó”   — d dl mZ d dlmZmZmZ d dlmZmZ d dl	m
Z d dlmZ d dlmZmZ erd dlmZ d dlmZ dd	„Z G d
„ d«      Zy)é    )Úannotations)ÚTYPE_CHECKINGÚLiteralÚcast)ÚStreamlitAPIExceptionÚStreamlitValueError)ÚToast)Úgather_metrics)Ú
clean_textÚvalidate_icon_or_emoji)ÚDeltaGenerator)ÚSupportsStrc                ó8   — t        | «      dk(  rt        d«      ‚| S )NÚ z6Toast body cannot be blank - please provide a message.)Ústrr   )Ú
toast_texts    úO/home/htdocs/ttos/venv/lib/python3.12/site-packages/streamlit/elements/toast.pyÚvalidate_textr      s&   € Ü
ˆ:ƒ˜"ÒÜ#ØDó
ð 	
ð Ðó    c                  óR   — e Zd Z ed«      dddœ	 	 	 	 	 	 	 dd„«       Zedd„«       Zy)	Ú
ToastMixinÚtoastNÚshort)ÚiconÚdurationc               óL  — t        «       }t        t        |«      «      |_        t	        |«      |_        |dv st        |t        «      r4|dkD  r/|dk(  rd|_        n0|dk(  rd|_        n#|dk(  rd|_        n||_        nt        dg d	¢«      ‚| j                  j                  d
|«      S )uL  Display a short message, known as a notification "toast".
        The toast appears in the app's top-right corner and disappears after four seconds.

        .. warning::
            ``st.toast`` is not compatible with Streamlit's `caching             <https://docs.streamlit.io/develop/concepts/architecture/caching>`_ and
            cannot be called within a cached function.

        Parameters
        ----------
        body : str
            The string to display as GitHub-flavored Markdown. Syntax
            information can be found at: https://github.github.com/gfm.

            See the ``body`` parameter of |st.markdown|_ for additional,
            supported Markdown directives.

            .. |st.markdown| replace:: ``st.markdown``
            .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown

        icon : str, None
            An optional emoji or icon to display next to the alert. If ``icon``
            is ``None`` (default), no icon is displayed. If ``icon`` is a
            string, the following options are valid:

            - A single-character emoji. For example, you can set ``icon="ðŸš¨"``
              or ``icon="ðŸ”¥"``. Emoji short codes are not supported.

            - An icon from the Material Symbols library (rounded style) in the
              format ``":material/icon_name:"`` where "icon_name" is the name
              of the icon in snake case.

              For example, ``icon=":material/thumb_up:"`` will display the
              Thumb Up icon. Find additional icons in the `Material Symbols               <https://fonts.google.com/icons?icon.set=Material+Symbols&icon.style=Rounded>`_
              font library.

            - ``"spinner"``: Displays a spinner as an icon.

        duration : "short", "long", "infinite", or int
            The time to display the toast message. This can be one of the
            following:

            - ``"short"`` (default): Displays for 4 seconds.
            - ``"long"``: Displays for 10 seconds.
            - ``"infinite"``: Shows the toast until the user dismisses it.
            - An integer: Displays for the specified number of seconds.

        Examples
        --------
        **Example 1: Show a toast message**

        >>> import streamlit as st
        >>>
        >>> st.toast("Your edited image was saved!", icon="ðŸ˜�")

        .. output::
            https://doc-status-toast.streamlit.app
            height: 200px

        **Example 2: Show multiple toasts**

        When multiple toasts are generated, they will stack. Hovering over a
        toast will stop it from disappearing. When hovering ends, the toast
        will disappear after time specified in ``duration``.

        >>> import time
        >>> import streamlit as st
        >>>
        >>> if st.button("Three cheers"):
        >>>     st.toast("Hip!")
        >>>     time.sleep(0.5)
        >>>     st.toast("Hip!")
        >>>     time.sleep(0.5)
        >>>     st.toast("Hooray!", icon="ðŸŽ‰")

        .. output::
            https://doc-status-toast1.streamlit.app
            height: 300px

        **Example 3: Update a toast message**

        Toast messages can also be updated. Assign ``st.toast(my_message)`` to
        a variable and use the ``.toast()`` method to update it. If a toast has
        already disappeared or been dismissed, the update will not be seen.

        >>> import time
        >>> import streamlit as st
        >>>
        >>> def cook_breakfast():
        >>>     msg = st.toast("Gathering ingredients...")
        >>>     time.sleep(1)
        >>>     msg.toast("Cooking...")
        >>>     time.sleep(1)
        >>>     msg.toast("Ready!", icon="ðŸ¥ž")
        >>>
        >>> if st.button("Cook breakfast"):
        >>>     cook_breakfast()

        .. output::
            https://doc-status-toast2.streamlit.app
            height: 200px

        )r   ÚlongÚinfiniter   r   é   r   é
   r   r   )r   r   r   za positive integerr   )Ú
ToastProtor   r   Úbodyr   r   Ú
isinstanceÚintr   r   ÚdgÚ_enqueue)Úselfr"   r   r   Útoast_protos        r   r   zToastMixin.toast&   s¨   € ô` !“lˆÜ%¤m°DÓ&9Ó:ˆÔÜ1°$Ó7ˆÔàÐ4Ñ4Ü�x¤Ô%¨(°Qª,à˜7Ò"Ø'(�Õ$Ø˜VÒ#Ø')�Õ$Ø˜ZÒ'Ø'(�Õ$à'/�Õ$ä%ØÒOóð ð �w‰w×Ñ ¨Ó5Ð5r   c                ó   — t        d| «      S )zGet our DeltaGenerator.r   )r   )r'   s    r   r%   zToastMixin.dg¬   s   € ô Ð$ dÓ+Ð+r   )r"   r   r   z
str | Noner   z*Literal['short', 'long', 'infinite'] | intÚreturnr   )r*   r   )Ú__name__Ú
__module__Ú__qualname__r
   r   Úpropertyr%   © r   r   r   r   %   sb   „ Ù�GÓð
  Ø?FñC6àðC6ð ð	C6ð
 =ðC6ð 
òC6ó ðC6ðJ ò,ó ñ,r   r   N)r   r   r*   r   )Ú
__future__r   Útypingr   r   r   Ústreamlit.errorsr   r   Ústreamlit.proto.Toast_pb2r	   r!   Ústreamlit.runtime.metrics_utilr
   Ústreamlit.string_utilr   r   Ústreamlit.delta_generatorr   Ústreamlit.type_utilr   r   r   r/   r   r   ú<module>r8      s6   ðõ #ç /Ñ /ç GÝ 9Ý 9ß DáÝ8Ý/ó÷J,ò J,r   