o
    dO                     @   s$   d dl mZmZ G dd deZdS )    )	Component_explicitize_argsc                       sT   e Zd ZdZg ZdgZdZd Zee	j
e	j
e	j
e	j
e	j
e	j
e	j
f fdd	Z  ZS )LogoutButtona  A LogoutButton component.
    Logout button to submit a form post request to the `logout_url` prop.
    Usage is intended for dash-deployment-server authentication.

    DDS usage:

    `dcc.LogoutButton(logout_url=os.getenv('DASH_LOGOUT_URL'))`

    Custom usage:

    - Implement a login mechanism.
    - Create a flask route with a post method handler.
    `@app.server.route('/logout', methods=['POST'])`
      - The logout route should perform what's necessary for the user to logout.
      - If you store the session in a cookie, clear the cookie:
      `rep = flask.Response(); rep.set_cookie('session', '', expires=0)`

    - Create a logout button component and assign it the logout_url
    `dcc.LogoutButton(logout_url='/logout')`

    See https://dash.plotly.com/dash-core-components/logout_button
    for more documentation and examples.

    Keyword arguments:

    - id (string; optional):
        Id of the button.

    - className (string; optional):
        CSS class for the button.

    - label (string; default 'Logout'):
        Text of the button.

    - loading_state (dict; optional):
        Object that holds the loading state object coming from
        dash-renderer.

        `loading_state` is a dict with keys:

        - component_name (string; optional):
            Holds the name of the component that is loading.

        - is_loading (boolean; optional):
            Determines if the component is loading or not.

        - prop_name (string; optional):
            Holds which property is loading.

    - logout_url (string; optional):
        Url to submit a post logout request.

    - method (string; default 'post'):
        Http method to submit the logout form.

    - style (dict; optional):
        Style of the button.childrendash_core_componentsc                    sf   g d| _ g | _g d| _g | _|d}	t   |  fdd|	D }
tt| j	di |
 d S )N)id	classNamelabelloading_state
logout_urlmethodstyle_explicit_argsc                    s   i | ]}| | qS  r   ).0k_localsr   Z/var/www/html/visualizacion-main/env/lib/python3.10/site-packages/dash/dcc/LogoutButton.py
<dictcomp>i   s    z)LogoutButton.__init__.<locals>.<dictcomp>r   )
_prop_names_valid_wildcard_attributesavailable_propertiesavailable_wildcard_propertiespoplocalsupdatesuperr   __init__)selfr   r	   r   r   r   r   r
   kwargsr   args	__class__r   r   r   F   s   
	
	

zLogoutButton.__init__)__name__
__module____qualname____doc___children_props_base_nodes
_namespace_typer   r   	UNDEFINEDr   __classcell__r   r   r"   r   r      s    :r   N)dash.development.base_componentr   r   r   r   r   r   r   <module>   s   