
    g"                    x    d dl 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  G d d	      Zy
)    )annotations)TYPE_CHECKINGcast)Alert)gather_metrics)
clean_textvalidate_icon_or_emoji)DeltaGenerator)SupportsStrc                      e Zd Z ed      dd	 	 	 	 	 dd       Z ed      dd	 	 	 	 	 dd       Z ed      dd	 	 	 	 	 dd       Z ed	      dd	 	 	 	 	 dd
       Zedd       Z	y)
AlertMixinerrorN)iconc                   t               }t        |      |_        t        |      |_        t         j
                  |_        | j                  j                  d|      S )u  Display error message.

        Parameters
        ----------
        body : str
            The text 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.

        Example
        -------
        >>> import streamlit as st
        >>>
        >>> st.error('This is an error', icon="🚨")

        alert)	
AlertProtor	   r   r   bodyERRORformatdg_enqueueselfr   r   alert_protos       M/var/www/openai/venv/lib/python3.12/site-packages/streamlit/elements/alert.pyr   zAlertMixin.error   sK    X !l1$7%d+'--ww55    warningc                   t               }t        |      |_        t        |      |_        t         j
                  |_        | j                  j                  d|      S )u  Display warning message.

        Parameters
        ----------
        body : str
            The text 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.

        Example
        -------
        >>> import streamlit as st
        >>>
        >>> st.warning('This is a warning', icon="⚠️")

        r   )	r   r   r   r	   r   WARNINGr   r   r   r   s       r   r   zAlertMixin.warningP   K    X !l%d+1$7'//ww55r   infoc                   t               }t        |      |_        t        |      |_        t         j
                  |_        | j                  j                  d|      S )u  Display an informational message.

        Parameters
        ----------
        body : str
            The text 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.

        Example
        -------
        >>> import streamlit as st
        >>>
        >>> st.info('This is a purely informational message', icon="ℹ️")

        r   )	r   r   r   r	   r   INFOr   r   r   r   s       r   r!   zAlertMixin.info   sI    Z !l%d+1$7'__ww55r   successc                   t               }t        |      |_        t        |      |_        t         j
                  |_        | j                  j                  d|      S )u  Display a success message.

        Parameters
        ----------
        body : str
            The text 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.

        Example
        -------
        >>> import streamlit as st
        >>>
        >>> st.success('This is a success message!', icon="✅")

        r   )	r   r   r   r	   r   SUCCESSr   r   r   r   s       r   r$   zAlertMixin.success   r    r   c                    t        d|       S )zGet our DeltaGenerator.r
   )r   )r   s    r   r   zAlertMixin.dg   s     $d++r   )r   r   r   z
str | Nonereturnr
   )r(   r
   )
__name__
__module____qualname__r   r   r   r!   r$   propertyr    r   r   r   r      s    G
  	0606 	06
 
06 06d I
  	/6/6 	/6
 
/6 /6b F
  	0606 	06
 
06 06d I
  	/6/6 	/6
 
/6 /6b , ,r   r   N)
__future__r   typingr   r   streamlit.proto.Alert_pb2r   r   streamlit.runtime.metrics_utilr   streamlit.string_utilr   r	   streamlit.delta_generatorr
   streamlit.type_utilr   r   r-   r   r   <module>r5      s+    # & 9 9 D8/N, N,r   