o
    h)                     @  s   U d dl mZ d dlmZ d dlmZmZmZmZ d dl	m
Z
 d dlmZ d dlmZ d dlmZ d dlmZ erEd d	lmZ d d
lmZ G dd deZeeed df Zded< eeedf Zded< G dd dZdS )    )annotations)Enum)TYPE_CHECKINGLiteralUnioncast)	TypeAlias)StreamlitAPIException)Heading)gather_metrics)
clean_text)DeltaGenerator)SupportsStrc                   @  s   e Zd ZdZdZdZdS )HeadingProtoTagh1h2h3N)__name__
__module____qualname__	TITLE_TAG
HEADER_TAGSUBHEADER_TAG r   r   N/var/www/vscode/kcb/lib/python3.10/site-packages/streamlit/elements/heading.pyr       s    r   FNr   AnchorDividerc                   @  s   e Zd Zed	d"dddd#ddZed	d"dddd#ddZed	d"ddd$ddZed%ddZe	d&ddZ
e				d'd(d d!ZdS ))HeadingMixinheaderNF)helpdividerbodyr   anchorr   r   
str | Noner    r   returnr   c             
   C      | j dtjtj||||dS )u  Display text in header formatting.

        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

        anchor : str or False
            The anchor name of the header that can be accessed with #anchor
            in the URL. If omitted, it generates an anchor using the body.
            If False, the anchor is not shown in the UI.

        help : str or None
            A tooltip that gets displayed next to the header. If this is
            ``None`` (default), no tooltip is displayed.

            The tooltip can optionally contain GitHub-flavored Markdown,
            including the Markdown directives described in the ``body``
            parameter of ``st.markdown``.

        divider : bool or “blue”, “green”, “orange”, “red”, “violet”, “gray”/"grey", or “rainbow”
            Shows a colored divider below the header. If True, successive
            headers will cycle through divider colors. That is, the first
            header will have a blue line, the second header will have a
            green line, and so on. If a string, the color can be set to one of
            the following: blue, green, orange, red, violet, gray/grey, or
            rainbow.

        Examples
        --------
        >>> import streamlit as st
        >>>
        >>> st.header("_Streamlit_ is :blue[cool] :sunglasses:")
        >>> st.header("This is a header with a divider", divider="gray")
        >>> st.header("These headers have rotating dividers", divider=True)
        >>> st.header("One", divider=True)
        >>> st.header("Two", divider=True)
        >>> st.header("Three", divider=True)
        >>> st.header("Four", divider=True)

        .. output::
           https://doc-header.streamlit.app/
           height: 600px

        headingtagr!   r"   r   r    )dg_enqueuer   _create_heading_protor   r   selfr!   r"   r   r    r   r   r   r   +      =zHeadingMixin.header	subheaderc             
   C  r%   )u  Display text in subheader formatting.

        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

        anchor : str or False
            The anchor name of the header that can be accessed with #anchor
            in the URL. If omitted, it generates an anchor using the body.
            If False, the anchor is not shown in the UI.

        help : str or None
            A tooltip that gets displayed next to the subheader. If this is
            ``None`` (default), no tooltip is displayed.

            The tooltip can optionally contain GitHub-flavored Markdown,
            including the Markdown directives described in the ``body``
            parameter of ``st.markdown``.

        divider : bool or “blue”, “green”, “orange”, “red”, “violet”, “gray”/"grey", or “rainbow”
            Shows a colored divider below the header. If True, successive
            headers will cycle through divider colors. That is, the first
            header will have a blue line, the second header will have a
            green line, and so on. If a string, the color can be set to one of
            the following: blue, green, orange, red, violet, gray/grey, or
            rainbow.

        Examples
        --------
        >>> import streamlit as st
        >>>
        >>> st.subheader("_Streamlit_ is :blue[cool] :sunglasses:")
        >>> st.subheader("This is a subheader with a divider", divider="gray")
        >>> st.subheader("These subheaders have rotating dividers", divider=True)
        >>> st.subheader("One", divider=True)
        >>> st.subheader("Two", divider=True)
        >>> st.subheader("Three", divider=True)
        >>> st.subheader("Four", divider=True)

        .. output::
           https://doc-subheader.streamlit.app/
           height: 500px

        r&   r'   )r)   r*   r   r+   r   r   r,   r   r   r   r/   s   r.   zHeadingMixin.subheadertitle)r   c             	   C  s   | j dtjtj|||dS )a  Display text in title formatting.

        Each document should have a single `st.title()`, although this is not
        enforced.

        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

        anchor : str or False
            The anchor name of the header that can be accessed with #anchor
            in the URL. If omitted, it generates an anchor using the body.
            If False, the anchor is not shown in the UI.

        help : str or None
            A tooltip that gets displayed next to the title. If this is
            ``None`` (default), no tooltip is displayed.

            The tooltip can optionally contain GitHub-flavored Markdown,
            including the Markdown directives described in the ``body``
            parameter of ``st.markdown``.

        Examples
        --------
        >>> import streamlit as st
        >>>
        >>> st.title("This is a title")
        >>> st.title("_Streamlit_ is :blue[cool] :sunglasses:")

        .. output::
           https://doc-title.streamlit.app/
           height: 220px

        r&   )r(   r!   r"   r   )r)   r*   r   r+   r   r   )r-   r!   r"   r   r   r   r   r0      s   2
zHeadingMixin.titlec                 C  s
   t d| S )zGet our DeltaGenerator.r   )r   )r-   r   r   r   r)      s   
zHeadingMixin.dgstrc                 C  sB   | du rdS g d}| |v rt d| S td|  dd| d)	NTauto)bluegreenorangeredvioletgraygreyrainbowr1   z&Divider parameter has invalid value: `z`. Please choose from: z, .)r   r	   join)r    valid_colorsr   r   r   _handle_divider_color   s   

z"HeadingMixin._handle_divider_colorr(   r   HeadingProtoc                 C  s   t  }| j|_t||_|rt||_|d ur<|du r d|_nt	|t
r)||_n|du r3td| tdt|j |rA||_|S )NFTzSAnchor parameter has invalid value: %s. Supported values: None, any string or FalsezRAnchor parameter has invalid type: %s. Supported values: None, any string or False)r?   valuer(   r   r!   r   r>   r    hide_anchor
isinstancer1   r"   r	   typer   r   )r(   r!   r"   r   r    protor   r   r   r+     s0   

z"HeadingMixin._create_heading_proto)N)
r!   r   r"   r   r   r#   r    r   r$   r   )r!   r   r"   r   r   r#   r$   r   )r$   r   )r    r   r$   r1   )NNF)r(   r   r!   r   r"   r   r   r#   r    r   r$   r?   )r   r   r   r   r   r/   r0   propertyr)   staticmethodr>   r+   r   r   r   r   r   *   s6    GG8r   )
__future__r   enumr   typingr   r   r   r   typing_extensionsr   streamlit.errorsr	   streamlit.proto.Heading_pb2r
   r?   streamlit.runtime.metrics_utilr   streamlit.string_utilr   streamlit.delta_generatorr   streamlit.type_utilr   r   r1   r   __annotations__boolr   r   r   r   r   r   <module>   s   