Ë
    EêñiTM  ã                  ó  — d dl mZ d dlZd dlZd dlmZ d dl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 d d	lmZ d d
lmZ d dlmZ dd„Zerd dlmZ  ed«      ddddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 dd„«       Z G d„ d«      Zy)é    )ÚannotationsN)ÚPath)ÚTYPE_CHECKINGÚLiteral)ÚStreamlitAPIExceptionÚStreamlitValueError)Úgather_metrics)Úget_script_run_ctx)Úpage_icon_and_name)Úvalidate_icon_or_emoji)Úis_url)Ú	calc_hashc                óÎ   — t        j                  dd| j                  «       «      }t        j                  dd|«      }|j                  d«      }t        j                  dd|«      }|S )z¼Sanitize a title string to be used as a URL path.

    Converts the title to lowercase, replaces whitespace with underscores,
    and removes special characters that are not URL-safe.
    z\s+Ú_z[&#?/\\:*\"<>|']Ú z_+)ÚreÚsubÚlowerÚstrip)ÚtitleÚpaths     ú[/var/www/pod-logistic/pod-ai/venv/lib/python3.12/site-packages/streamlit/navigation/page.pyÚ_sanitize_url_pathr      sS   € ô �6‰6�&˜#˜uŸ{™{›}Ó-€Dä�6‰6Ð% r¨4Ó0€Dà�:‰:�c‹?€Dä�6‰6�%˜˜dÓ#€DØ€Kó    )ÚCallableÚPageFÚvisible©r   ÚiconÚurl_pathÚdefaultÚ
visibilityÚStreamlitPagec               ó$   — t        | |||||¬«      S )u0  Configure a page for ``st.navigation`` in a multipage app.

    Call ``st.Page`` to initialize a ``StreamlitPage`` object, and pass it to
    ``st.navigation`` to declare a page in your app.

    When a user navigates to a page, ``st.navigation`` returns the selected
    ``StreamlitPage`` object. Call ``.run()`` on the returned ``StreamlitPage``
    object to execute the page. You can only run the page returned by
    ``st.navigation``, and you can only run it once per app rerun.

    A page can be defined by a Python file, ``Callable``, or external URL.

    Parameters
    ----------
    page : str, Path, or callable
        The source for the internal or external page. This can be one of the
        following values:

        - ``callable``: Streamlit executes the callable when it runs the page.
          The ``callable`` can't accept arguments.
        - Path to a Python file: Streamlit executes the Python script when it
          runs the page. The path can be a string or ``pathlib.Path``
          object. It can be absolute or relative to the entrypoint file.
        - URL: Streamlit opens the URL in a new tab when a user selects it
          in the navigation menu or a page link. In this case, the app doesn't
          rerun. The URL must contain an HTTP or HTTPS scheme, like
          ``"https://docs.streamlit.io"``. If the page is defined by a URL,
          then the ``title`` parameter is required.

    title : str or None
        The title of the page. If this is ``None`` (default), the page title
        (in the browser tab) and label (in the navigation menu) will be
        inferred from the filename or callable name in ``page``. For more
        information, see `Overview of multipage apps
        <https://docs.streamlit.io/st.page.automatic-page-labels>`_.

        The title supports GitHub-flavored Markdown of the following types:
        Bold, Italics, Strikethrough, Inline Code, and Images. Images display
        like icons, with a max height equal to the font height.

        Unsupported Markdown elements are unwrapped so only their children
        (text contents) render. Common block-level Markdown (headings,
        lists, blockquotes) is automatically escaped and displays as
        literal text in labels.

        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 or None
        An optional emoji or icon to display next to the page title and label.
        If ``icon`` is ``None`` (default), no icon is displayed next to the
        page label in the navigation menu, and a Streamlit icon is displayed
        next to the title (in the browser tab). 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. In this case, the
          spinner only displays next to the page label in the navigation menu.
          The spinner isn't used as the page favicon next to the title in the
          browser tab. The favicon is the default Streamlit icon unless
          otherwise specified with the ``page_icon`` parameter of
          ``st.set_page_config``.

    url_path : str or None
        The page's URL pathname, which is the path relative to the app's root
        URL. If this is ``None`` (default), the URL pathname will be inferred
        from the filename or callable name in ``page``. For more information,
        see `Overview of multipage apps
        <https://docs.streamlit.io/st.page.automatic-page-urls>`_.

        The default page will have a pathname of ``""``, indicating the root
        URL of the app. If you set ``default=True``, ``url_path`` is ignored.
        ``url_path`` can't include forward slashes; paths can't include
        subdirectories.

    default : bool
        Whether this page is the default page to be shown when the app is
        loaded. If ``default`` is ``False`` (default), the page will have a
        nonempty URL pathname. However, if no default page is passed to
        ``st.navigation`` and this is the first page, this page will become the
        default page. If ``default`` is ``True``, then the page will have
        an empty pathname and ``url_path`` will be ignored.

    visibility : "visible" or "hidden"
        Whether the page is shown in the navigation menu. If this is
        ``"visible"`` (default), the page appears in the navigation menu. If
        this is ``"hidden"``, the page is excluded from the navigation menu.
        Hidden pages defined by Python files or callables remain accessible
        by ``st.page_link`` and ``st.switch_page``. External URLs can always
        be accessed using ``st.page_link`` regardless of their inclusion or
        visibility in the navigation menu.

        .. note::

           Navigating to an internal page by URL starts a new session. For
           any internal page to be accessible by URL, it must be passed to
           ``st.navigation`` during the new session's initial script
           run. The page can be visible or hidden.

    Returns
    -------
    StreamlitPage
        The page object associated to the given script.

    Example
    -------
    .. code-block:: python
        :filename: streamlit_app.py

        import streamlit as st

        def page2():
            st.title("Second page")

        pg = st.navigation([
            st.Page("page1.py", title="First page", icon="ðŸ”¥"),
            st.Page(page2, title="Second page", icon=":material/favorite:"),
            st.Page(
                "https://docs.streamlit.io",
                title="Streamlit Docs",
                icon=":material/open_in_new:"
            ),
        ])
        pg.run()
    r   )r#   )Úpager   r   r    r!   r"   s         r   r   r   4   s$   € ôj ØØØØØØôð r   c                  óÆ   — e Zd ZdZddddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zedd„«       Zedd„«       Zedd	„«       Zedd
„«       Z	edd„«       Z
edd„«       Zdd„Zedd„«       Zy)r#   a‘  A page within a multipage Streamlit app.

    Use ``st.Page`` to initialize a ``StreamlitPage`` object.

    Attributes
    ----------
    icon : str
        The icon of the page.

        If no icon was declared in ``st.Page``, this property returns ``""``.

    title : str
        The title of the page.

        Unless declared otherwise in ``st.Page``, the page title is inferred
        from the filename or callable name. For more information, see
        `Overview of multipage apps
        <https://docs.streamlit.io/st.page.automatic-page-labels>`_.

        The title supports GitHub-flavored Markdown as described in ``st.Page``.

    url_path : str
        The page's URL pathname, which is the path relative to the app's root
        URL.

        Unless declared otherwise in ``st.Page``, the URL pathname is inferred
        from the filename or callable name. For more information, see
        `Overview of multipage apps
        <https://docs.streamlit.io/st.page.automatic-page-urls>`_.

        The default page will always have a ``url_path`` of ``""`` to indicate
        the root URL (e.g. homepage).

    visibility : Literal["visible", "hidden"]
        Whether the page is shown in the navigation menu. If this is
        ``"visible"`` (default), the page appears in the navigation menu. If
        this is ``"hidden"``, the page is excluded from the navigation menu.

        For internal pages, hidden pages remain accessible via direct URL,
        ``st.page_link``, or ``st.switch_page``. For external URL pages,
        hidden pages are not URL-accessible or switchable via
        ``st.switch_page``; they can still be linked with ``st.page_link``.

        .. note::

           Navigating to an internal page by URL starts a new session.
           For a hidden page to be accessible by URL, it must be passed
           to ``st.navigation`` during the new session's initial script
           run.

    NFr   r   c               óø  — || _         d | _        |dvrt        dddg«      ‚|| _        t	        «       }|sy t        |t        «      rót        |«      rè|€t        d|› �«      ‚|j                  «       dk(  rt        d|› �«      ‚|rt        d«      ‚|| _        d | _
        || _        |�t        |«       |xs d| _        |€t        |«      n|| _        | j                  j                  «       j                  d	«      | _        | j                  dk(  rt        d
«      ‚d	| j                  v rt        d«      ‚d| _        y |j"                  j$                  }t        |t        «      rt'        |«      }t        |t&        «      r<||z  j)                  «       }|j+                  «       st        d|j,                  › d�«      ‚d}	d}
t        |t&        «      rt/        |«      \  }
}	n/t1        |d«      rt        |j2                  «      }	n|€t        d«      ‚|| _
        |xs |	j5                  dd«      | _        |�t        |«       |xs |
| _        | j                  j                  «       dk(  rt        d«      ‚|	| _        |�a|j                  «       }|j                  d	«      }|j                  «       dk(  r|st        d«      ‚|| _        d	| j                  v rt        d«      ‚| j                  rt        | j                  «       d| _        y )N>   Úhiddenr   r"   r   r(   zTExternal URL pages require a `title` parameter. Please provide a title for the URL: r   z^External URL pages require a non-empty `title` parameter. Please provide a title for the URL: z5External URL pages cannot be set as the default page.ú/zwThe URL path cannot be empty. Please provide a valid `url_path` or a `title` that can be converted to a valid URL path.z9The URL path cannot contain a nested path (e.g. foo/bar).Fz!Unable to create Page. The file `z` could not be found.Ú__name__zHCannot infer page title for Callable. Set the `title=` keyword argument.r   ú zKThe title of the page cannot be empty or consist of underscores/spaces onlyzKThe URL path cannot be an empty string unless the page is the default page.)Ú_defaultÚ_external_urlr   Ú_visibilityr
   Ú
isinstanceÚstrr   r   r   Ú_pageÚ_titler   Ú_iconr   Ú	_url_pathÚ_can_be_calledÚpages_managerÚmain_script_parentr   ÚresolveÚis_fileÚnamer   Úhasattrr*   Úreplace)Úselfr%   r   r   r    r!   r"   ÚctxÚ	main_pathÚinferred_nameÚinferred_iconÚurl_path_trimmedÚstripped_url_paths                r   Ú__init__zStreamlitPage.__init__  s"  € ð &ˆŒØ)-ˆÔð Ð2Ñ2Ü% l°YÀÐ4IÓJÐJØ9CˆÔä Ó"ˆÙØô �dœCÔ ¤V¨D¤\Øˆ}Ü+ð;Ø;?¸&ðBóð ð �{‰{‹} Ò"Ü+ð;Ø;?¸&ðBóð ñ Ü+ØKóð ð "&ˆDÔØ;?ˆDŒJØ$ˆDŒKØÐÜ& tÔ,Ø"šj bˆDŒJð .6Ð-=Ô" 5Ô)À8ð ŒNð
 "Ÿ^™^×1Ñ1Ó3×9Ñ9¸#Ó>ˆDŒNØ�~‰~ Ò#Ü+ðNóð ð �d—n‘nÑ$Ü+ØOóð ð ).ˆDÔØà×%Ñ%×8Ñ8ˆ	Ü�dœCÔ Ü˜“:ˆDÜ�dœDÔ!Ø Ñ$×-Ñ-Ó/ˆDà—<‘<”>Ü+Ø7¸¿	¹	°{ÐBWÐXóð ð ˆØˆÜ�dœDÔ!Ü+=¸dÓ+CÑ(ˆM™=Ü�T˜:Ô&Ü §¡Ó.‰MØˆ]ô (ØZóð ð ˆŒ
ØÒ>˜}×4Ñ4°S¸#Ó>ˆŒàÐä" 4Ô(ØÒ*˜]ˆŒ
à�;‰;×ÑÓ "Ò$Ü'Ø]óð ð 'ˆŒØÐØ'Ÿ~™~Ó/ÐØ 0× 6Ñ 6°sÓ ;ÐØ ×&Ñ&Ó(¨BÒ.±wÜ+Øaóð ð /ˆDŒNØ�d—n‘nÑ$Ü+ØOóð ð �:Š:Ü" 4§:¡:Ô.ð $ˆÕr   c                ó   — | j                   S )an  The title of the page.

        Unless declared otherwise in ``st.Page``, the page title is inferred
        from the filename or callable name. For more information, see
        `Overview of multipage apps
        <https://docs.streamlit.io/st.page.automatic-page-labels>`_.

        The title supports GitHub-flavored Markdown as described in ``st.Page``.
        )r2   ©r=   s    r   r   zStreamlitPage.title‡  s   € ð �{‰{Ðr   c                ó   — | j                   S )zmThe icon of the page.

        If no icon was declared in ``st.Page``, this property returns ``""``.
        )r3   rF   s    r   r   zStreamlitPage.icon”  s   € ð �z‰zÐr   c                ó6   — | j                   rdS | j                  S )aÎ  The page's URL pathname, which is the path relative to the app's         root URL.

        Unless declared otherwise in ``st.Page``, the URL pathname is inferred
        from the filename or callable name. For more information, see
        `Overview of multipage apps
        <https://docs.streamlit.io/st.page.automatic-page-urls>`_.

        The default page will always have a ``url_path`` of ``""`` to indicate
        the root URL (e.g. homepage).
        r   )r,   r4   rF   s    r   r    zStreamlitPage.url_pathœ  s   € ð —]’]ˆrÐ6¨¯©Ð6r   c                ó   — | j                   S )a�  The visibility of the page in the navigation menu.

        This property returns ``"visible"`` (default) or ``"hidden"``.
        Hidden internal pages are not shown in the navigation menu but can
        still be accessed via URL or programmatically using ``st.switch_page``
        or ``st.page_link``. Hidden external pages can only be opened via
        ``st.page_link``.
        )r.   rF   s    r   r"   zStreamlitPage.visibility«  s   € ð ×ÑÐr   c                ó   — | j                   duS )zÔWhether this page is an external URL.

        If ``True``, clicking this page in the navigation menu will open
        the external URL in a new browser tab instead of navigating within
        the app.
        N©r-   rF   s    r   Úis_externalzStreamlitPage.is_external·  s   € ð ×!Ñ!¨Ð-Ð-r   c                ó   — | j                   S )z‚The external URL of the page, if this is an external link.

        Returns ``None`` if this is not an external URL page.
        rK   rF   s    r   Úexternal_urlzStreamlitPage.external_urlÁ  s   € ð ×!Ñ!Ð!r   c                óJ  — | j                   st        d«      ‚d| _         | j                  ryt        «       }|sy|j	                  | j
                  «      5  t        | j                  t        «      r…|j                  j                  t        | j                  «      «      }t        j                  d«      }t        | j                  «      |j                  d<   t        ||j                  «       	 ddd«       y| j                  �| j                  «        ddd«       y# 1 sw Y   yxY w)aÅ  Execute the page.

        When a page is returned by ``st.navigation``, use the ``.run()`` method
        within your entrypoint file to render the page. You can only call this
        method on the page returned by ``st.navigation``. You can only call
        this method once per run of your entrypoint file.

        For external URL pages, this method does nothing as the navigation
        to the external URL is handled by the frontend.

        zbThis page cannot be called directly. Only the page returned from st.navigation can be called once.FNÚ__main__Ú__file__)r5   r   rL   r
   Úrun_with_active_hashÚ_script_hashr/   r1   r   r6   Úget_page_script_byte_coder0   ÚtypesÚ
ModuleTypeÚ__dict__Úexec)r=   r>   ÚcodeÚmodules       r   ÚrunzStreamlitPage.runÉ  sî   € ð ×"Ò"Ü'Øtóð ð $ˆÔð ×ÒØä Ó"ˆÙØà×%Ñ% d×&7Ñ&7Ó8ñ 
	Ü˜$Ÿ*™*¤dÔ+Ø×(Ñ(×BÑBÄ3ÀtÇzÁzÃ?ÓS�Ü×)Ñ)¨*Ó5�ä.1°$·*±*«o�—‘ 
Ñ+Ü�T˜6Ÿ?™?Ô+Ø÷
	ð 
	ð �z‰zÐ%Ø—
‘
”÷
	÷ 
	ñ 
	ús   ÁBDÃ4DÄD"c                ó,   — t        | j                  «      S )N)r   r4   rF   s    r   rS   zStreamlitPage._script_hashð  s   € ä˜Ÿ™Ó(Ð(r   )r%   ústr | Path | Callable[[], None]r   ú
str | Noner   r^   r    r^   r!   Úboolr"   úLiteral['visible', 'hidden']ÚreturnÚNone)ra   r0   )ra   r`   )ra   r_   )ra   r^   )ra   rb   )r*   Ú
__module__Ú__qualname__Ú__doc__rD   Úpropertyr   r   r    r"   rL   rN   r[   rS   © r   r   r#   r#   Ó   sý   „ ñ2ðp !ØØ#ØØ3<ñ}$à-ð}$ð ð	}$ð
 ð}$ð ð}$ð ð}$ð 1ð}$ð 
ó}$ð~ ò
ó ð
ð òó ðð ò7ó ð7ð ò	 ó ð	 ð ò.ó ð.ð ò"ó ð"ó%ðN ò)ó ñ)r   )r   r0   ra   r0   )r%   r]   r   r^   r   r^   r    r^   r!   r_   r"   r`   ra   r#   )Ú
__future__r   r   rU   Úpathlibr   Útypingr   r   Ústreamlit.errorsr   r   Ústreamlit.runtime.metrics_utilr	   Ú7streamlit.runtime.scriptrunner_utils.script_run_contextr
   Ústreamlit.source_utilr   Ústreamlit.string_utilr   Ústreamlit.url_utilr   Ústreamlit.utilr   r   Úcollections.abcr   r   r#   rg   r   r   ú<module>rs      s¼   ðõ #ã 	Û Ý ß )ç GÝ 9Ý VÝ 4Ý 8Ý %Ý $óñ" Ý(ñ �Óð ØØØØ/8ñ[Ø
)ð[ð ð[ð ð	[ð
 ð[ð ð[ð -ð[ð ò[ó ð[÷|_)ò _)r   