o
    ۷i                     @  s^   d Z 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 e G dd de	Zd	S )
zgr.Navbar() component.    )annotations)AnyLiteral)document)	Component)Eventsc                      sp   e Zd ZdZejgZ	d"dddddddd# fddZd$ddZd%ddZ	d&ddZ
d'ddZd'd d!Z  ZS )(Navbara  
    Creates a navigation bar component for multipage Gradio apps. The navbar component allows customizing the
    appearance of the navbar for that page. Only one Navbar component can exist per page in a Blocks app,
    and it can be placed anywhere within the page.

    The Navbar component is designed to control the appearance of the navigation bar in multipage
    applications. When present in a Blocks app, its properties override the default navbar behavior.

    Example:
        ```python
        import gradio as gr

        with gr.Blocks() as demo:
            navbar = gr.Navbar(
                visible=True,
                main_page_name="My App",
                value=[("Analytics", "analytics"), ("About", "https://twitter.com/abidlabs")]
            )
            gr.Textbox(label="Main page content")

        with demo.route("About"):
            gr.Markdown("This is the about page")

        demo.launch()
        ```
    NTHome)visiblemain_page_nameelem_idelem_classesrenderkeyvaluelist[tuple[str, str]] | Noner
   boolr   str | Literal[False]r   
str | Noner   list[str] | str | Noner   r   (int | str | tuple[int | str, ...] | Nonec                  s(   || _ || _t j||||||d dS )a  
        Parameters:
            value: If a list of tuples of (page_name, page_path) are provided, these additional pages will be added to the navbar alongside the existing pages defined in the Blocks app. The page_path can be either a relative path for internal Gradio app pages (e.g., "analytics") or an absolute URL for external links (e.g., "https://twitter.com/username"). Otherwise, only the pages defined using the `Blocks.route` method will be displayed. Example: [("Dashboard", "dashboard"), ("About", "https://twitter.com/abidlabs")]
            visible: If True, the navbar will be visible. If False, the navbar will be hidden.
            main_page_name: The title to display in the navbar for the main page of the Gradio. If False, the main page will not be displayed in the navbar.
            elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.
            elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.
            render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
            key: in a gr.render, Components with the same key across re-renders are treated as the same component, not a new component.
        )r   r   r   r   r
   r   N)r
   r   super__init__)selfr   r
   r   r   r   r   r   	__class__ N/home/ubuntu/vllm_env/lib/python3.10/site-packages/gradio/components/navbar.pyr   ,   s   
zNavbar.__init__payloadreturnc                 C     |S Nr   )r   r   r   r   r   
preprocessM      zNavbar.preprocessc                 C  r    r!   r   )r   r   r   r   r   postprocessR   r#   zNavbar.postprocessdict[str, Any]c                 C  s   i S r!   r   r   r   r   r   api_infoW      zNavbar.api_infoc                 C     d S r!   r   r&   r   r   r   example_payloadZ   r(   zNavbar.example_payloadc                 C  r)   r!   r   r&   r   r   r   example_value]   r(   zNavbar.example_valuer!   )r   r   r
   r   r   r   r   r   r   r   r   r   r   r   )r   r   r   r   )r   r   r   r   )r   r%   )r   r   )__name__
__module____qualname____doc__r   changeEVENTSr   r"   r$   r'   r*   r+   __classcell__r   r   r   r   r      s"    
!


r   N)r/   
__future__r   typingr   r   gradio_client.documentationr   gradio.components.baser   gradio.eventsr   r   r   r   r   r   <module>   s    