o
    Yh.                     @  s
  U d Z ddlmZ ddlZddlZddlZddlZddlZddlZ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mZmZmZmZ dd	lmZ dd
lmZ e
ddZded< e  Z!e
 Z"ded< da#ded< dZ$ded< dZ%ded< dZ&ded< dZ'ded< e(e)Z*ded< G dd de+eZ,G dd  d e+eZ-e%fd`d(d)Z.dad*d+Z/dbd,d-Z0dcd0d1Z1ddd3d4Z2ddd5d6d5ddde+d5d5fdedEdFZ3ddd6e+fdfdJdKZ4dgdLdMZ5e2dNdO e3dPdQd5e6dR e3dSdTdUe6dR e3dVdWe6dXej7dhdYdZZ8e3d[d\dWd5e6d] e3d^d_dWd5e6d] e3d`dadWd5e6d] e3dbdcdWd5e6d] e3dddedWdfe9d] e3dgdhdWdie:d] e2djdk e3dle+dmdidndoZ;e3dpe+dmdidqdrZ<e3dsdWe6dUdtej7dhdudvZ=e2dwdx e3dydze,j>j?e+dUd{ e3d|d}d~e+dUd{ e3dddUe6dUd{ e2dd e3dddUe6dR e3dddUe6dWd e3dddUe6dR e3ddd5e6dR e3ddde+dR e2dd e3ddg dUd e3ddg dUd e3ddd~e+dR e3de+dUdej7diddZ@e3de6dmdhddZAe3dddUe6dR e3ddd5e6dR e3dddWdUe6d] e3ddjddZBe3ddde:dR e3ddWdd5e6d e3ddde+dR e3ddde+dWd e3dddUe6dR e3ddg dUd e3dddUe6dR e3ddde:dR e3ddde:dR e3dddWd5dUe6d e3ddd5e6dR e3ddde:dR e3ddd5e6dR e3ddde:dR e3ddi e+dWd e2dd̓ e3ddde+dR e3dddUe6dR e3de:dmdkddքZCdgZDe3ddeD dڝdۍ e3ddeD dڝdۍ e2dd߃ e3ddd5e6dWd e2dd e3ddde+dUdUddd e2dd e3dddWd5e6d] e3dddWd5e6d] e2dd eEe-D ]ZFe2deFj? deFj? d qe4ddgdd e4dde-jGgdd e4dde-jGgdd e4dde-jGgdd e4dde-jGgdd e4dde-jGgd d e4dde-jGgde6d e4dde-jGgdd e4dde-jGgdd e4ddgd	d e4d
dgde:d e4ddgde:d e4dde-jGgdd e4dde-jGgdd e4dde-jGgdd e4dde-jGgdd e4dde-jGgdd e4dde-jGgde:d e4dde-jGgdd e4dde-jGgdd e4dde-jGgdd e4d de-jGgd!d e4d"de-jGgd#d e4d$de-jGgd%e6d e4d&dgd'e6d e4d(dgd)d e4d*dgd+d e2d,d- e3d.dUd/dld1d2ZHdmd3d4ZIdnd6d7ZJdnd8d9ZKdod:d;ZLd`d<d=ZMdpd?d@ZNdqdBdCZOdrdDdEZPdsdGdHZQedIdJZRdtdLdMZS	dudvdQdRZTdodSdTZUdodUdVZVdodWdXZW	5dwdxd]d^ZXeXeUdUd_ eXeV eXeWdUd_ dS (y  zLoads the configuration data.    )annotationsN)OrderedDict)Enum)AnyCallableFinalLiteral)Signal)config_utildevelopmentenv_util	file_utilutil)ConfigOption)StreamlitAPIExceptionz.Special test section just used for unit tests.)_testzOrderedDict[str, str]_section_descriptionsdict[str, ConfigOption]_config_options_templatezdict[str, ConfigOption] | None_config_options
str | None_main_script_pathz<user defined>r   _USER_DEFINEDz-command-line argument or environment variable_DEFINED_BY_FLAGzenvironment variable_DEFINED_BY_ENV_VAR_LOGGERc                   @  s<   e Zd ZdZdZdZdZdZedd
dZ	edddZ
dS )ShowErrorDetailsConfigOptionsz7Valid options for the "client.showErrorDetails" config.full
stacktracetypenoneval
str | boolreturnboolc                 C     | dv S )N)trueTrueT r!   r(   r(   Q/var/www/html/Persson_Maskin/env/lib/python3.10/site-packages/streamlit/config.pyis_true_variationS      z/ShowErrorDetailsConfigOptions.is_true_variationc                 C  r%   )N)falseFalseFr(   r)   r(   r(   r*   is_false_variationW   r,   z0ShowErrorDetailsConfigOptions.is_false_variationN)r!   r"   r#   r$   )__name__
__module____qualname____doc__FULL
STACKTRACETYPENONEstaticmethodr+   r/   r(   r(   r(   r*   r   K   s    r   c                   @  s   e Zd ZdZdZdS )CustomThemeCategoriesz:Theme categories that can be set with custom theme config.sidebarN)r0   r1   r2   r3   SIDEBARr(   r(   r(   r*   r9   a   s    r9   keystrvaluer   where_definedr#   Nonec                 C  s<   t  t  t| || W d   dS 1 sw   Y  dS )a  Set config option.

    Run `streamlit config show` in the terminal to see all available options.

    This is an internal API. The public `st.set_option` API is implemented
    in `set_user_option`.

    Parameters
    ----------
    key : str
        The config option key of the form "section.optionName". To see all
        available options, run `streamlit config show` on a terminal.

    value
        The new value to assign to this config option.

    where_defined : str
        Tells the config system where this was set.
    N)_config_lockget_config_options_set_option)r<   r>   r?   r(   r(   r*   
set_optiong   s   "rD   c              
   C  s^   zt |  }W n ty } ztd|  |d}~ww |jr%t| | dS t|  d|  d)a  Set a configuration option.

    Currently, only ``client`` configuration options can be set within the
    script itself:

        - ``client.showErrorDetails``
        - ``client.showSidebarNavigation``
        - ``client.toolbarMode``

    Calling ``st.set_option`` with any other option will raise a
    ``StreamlitAPIException``. When changing a configuration option in a
    running app, you may need to trigger a rerun after changing the option to
    see the effects.

    Run ``streamlit config show`` in a terminal to see all available options.

    Parameters
    ----------
    key : str
        The config option key of the form "section.optionName". To see all
        available options, run ``streamlit config show`` in a terminal.

    value
        The new value to assign to this config option.

    Example
    -------

    >>> import streamlit as st
    >>>
    >>> st.set_option("client.showErrorDetails", True)

    zUnrecognized config option: NzV cannot be set on the fly. Set as command line option, e.g. streamlit run script.py --z, or in config.toml instead.)r   KeyErrorr   
scriptablerD   )r<   r>   optker(   r(   r*   set_user_option   s   "
rI   c                 C  sP   t  t }| |vrtd|  d||  jW  d   S 1 s!w   Y  dS )a  Return the current value of a given Streamlit configuration option.

    Run ``streamlit config show`` in a terminal to see all available options.

    Parameters
    ----------
    key : str
        The config option key of the form "section.optionName". To see all
        available options, run ``streamlit config show`` in a terminal.

    Example
    -------

    >>> import streamlit as st
    >>>
    >>> color = st.get_option("theme.primaryColor")

    Config key "" not defined.N)rA   rB   RuntimeErrorr>   )r<   config_optionsr(   r(   r*   
get_option   s   $rN   sectiondict[str, Any]c                 C  sZ   t ! t }i }| D ]}|j| kr|j||j< q|W  d   S 1 s&w   Y  dS )a  Get all of the config options for the given section.

    Run `streamlit config show` in the terminal to see all available options.

    Parameters
    ----------
    section : str
        The name of the config section to fetch options for.

    Returns
    -------
    dict[str, Any]
        A dict mapping the names of the options in the given section (without
        the section name as a prefix) to their values.
    N)rA   rB   valuesrO   r>   name)rO   rM   options_for_sectionoptionr(   r(   r*   get_options_for_section   s   
$rU   descriptionc                 C  s$   | t v rtd|  d|t | < dS )z=Create a config section and store it globally in this module.zCannot define section "" twice.N)r   rL   )rO   rV   r(   r(   r*   _create_section   s   rX   Fvisibledefault_val
Any | NonerF   r$   
visibility
deprecateddeprecation_textexpiration_datereplaced_bytype_r   	sensitivemultipler   c                 C  sp   t | |||||||||	|
|d}|jtvr&td|j ddt  d| tv r2td|  d|t| < |S )a  Create a ConfigOption and store it globally in this module.

    There are two ways to create a ConfigOption:

        (1) Simple, constant config options are created as follows:

            _create_option('section.optionName',
                description = 'Put the description here.',
                default_val = 12345)

        (2) More complex, programmable config options use decorator syntax to
        resolve their values at runtime:

            @_create_option('section.optionName')
            def _section_option_name():
                """Put the description here."""
                return 12345

    To achieve this sugar, _create_option() returns a *callable object* of type
    ConfigObject, which then decorates the function.

    NOTE: ConfigObjects call their evaluation functions *every time* the option
    is requested. To prevent this, use the `streamlit.util.memoize` decorator as
    follows:

            @_create_option('section.memoizedOptionName')
            @util.memoize
            def _section_memoized_option_name():
                """Put the description here."""

                (This function is only called once.)
                """
                return 12345

    )rV   rZ   rF   r\   r]   r^   r_   r`   ra   rb   rc   z	Section "z" must be one of z, .zCannot define option "rW   )r   rO   r   rL   joinkeysr   )r<   rV   rZ   rF   r\   r]   r^   r_   r`   ra   rb   rc   rT   r(   r(   r*   _create_option   s,   1
rg   rR   
categories.list[Literal['theme'] | CustomThemeCategories]c                 C  sN   |D ]"}|dkr
|nd|j  }t| d|  ||||ddddddd qdS )z
    Create ConfigOption(s) for a theme-related config option and store it globally in
    this module.

    The same config option can be supported for multiple categories, e.g. "theme"
    and "theme.sidebar".
    themetheme.rd   FN)
rV   rZ   r\   ra   rF   r]   r^   r_   r`   rb   )r>   rg   )rR   rh   rV   rZ   r\   ra   catrO   r(   r(   r*   _create_theme_options7  s    rm   c                 C  s8   t du rtdz	t| = t | = W dS  ty   Y dS w )zVRemove a ConfigOption by key from the global store.

    Only for use in testing.
    NJ_config_options should always be populated here. This should never happen.)r   rL   r   	Exception)r<   r(   r(   r*   _delete_optionX  s   rp   globalz2Global options that apply across all of Streamlit.z+global.disableWidgetStateDuplicationWarninga  
        By default, Streamlit displays a warning when a user sets both a widget
        default value in the function defining the widget and a widget value via
        the widget's key in `st.session_state`.

        If you'd like to turn off this warning, set this to True.
    )rV   rZ   ra   z#global.showWarningOnDirectExecutionzu
        If True, will show a warning when you run a Streamlit-enabled script
        via "python my_script.py".
    Tglobal.developmentModehidden)r\   ra   c                   C  s"   t   odtvodtvodtvS )zzAre we in development mode.

    This option defaults to True if and only if Streamlit wasn't installed
    normally.
    zsite-packageszdist-packages__pypackages__)r   is_pex__file__r(   r(   r(   r*   _global_development_mode  s   
	rw   zglobal.e2eTestzUAre we in an e2e (playwright) test? Set automatically when our e2e tests are running.)rV   r\   rZ   ra   zglobal.unitTestzAre we in a unit test?zglobal.appTestzNAre we in an app test? Set automatically when the AppTest framework is runningz"global.suppressDeprecationWarningsz/Hide deprecation warnings in the streamlit app.zglobal.minCachedMessageSizezT
        Only cache ForwardMsgs that are greater than or equal to this minimum.
    g     @zglobal.maxCachedMessageAgez
        Expire cached ForwardMsgs whose age is greater than this
        value. A message's age is defined by how many times its script has
        finished running since the message has been accessed.
       loggerz-Settings to customize Streamlit log messages.zlogger.level)ra   c                   C  s   t drdS dS )zwLevel of logging for Streamlit's internal logger: "error", "warning",
    "info", or "debug".

    Default: "info"
    rr   debuginfo)rN   r(   r(   r(   r*   _logger_log_level  s   r|   zlogger.messageFormatc                  C  s   t drddlm}  | S dS )a;  String format for logging messages. If logger.datetimeFormat is set,
    logger messages will default to `%(asctime)s.%(msecs)03d %(message)s`.

    See Python's documentation for available attributes:
    https://docs.python.org/3/library/logging.html#formatter-objects

    Default: "%(asctime)s %(message)s"
    rr   r   DEFAULT_LOG_MESSAGEz%(asctime)s %(message)s)rN   streamlit.loggerr~   r}   r(   r(   r*   _logger_message_format  s   
r   zlogger.enableRich)r\   ra   rF   c                  C  s$   zddl } W dS  ty   Y dS w )a  
    Controls whether uncaught app exceptions are logged via the rich library.

    If True and if rich is installed, exception tracebacks will be logged with
    syntax highlighting and formatting. Rich tracebacks are easier to read and
    show more code than standard Python tracebacks.

    If set to False, the default Python traceback formatting will be used.

    Defaults to True if rich is installed, False otherwise.
    r   NTF)richro   )r   r(   r(   r*   _logger_enable_rich  s   r   clientz(Settings for scripts that use Streamlit.zclient.showErrorDetailsa  
        Controls whether uncaught app exceptions and deprecation warnings
        are displayed in the browser. This can be one of the following:

        - "full"       : In the browser, Streamlit displays app deprecation
                         warnings and exceptions, including exception types,
                         exception messages, and associated tracebacks.
        - "stacktrace" : In the browser, Streamlit displays exceptions,
                         including exception types, generic exception messages,
                         and associated tracebacks. Deprecation warnings and
                         full exception messages will only print to the
                         console.
        - "type"       : In the browser, Streamlit displays exception types and
                         generic exception messages. Deprecation warnings, full
                         exception messages, and associated tracebacks only
                         print to the console.
        - "none"       : In the browser, Streamlit displays generic exception
                         messages. Deprecation warnings, full exception
                         messages, associated tracebacks, and exception types
                         will only print to the console.
        - True         : This is deprecated. Streamlit displays "full"
                         error details.
        - False        : This is deprecated. Streamlit displays "stacktrace"
                         error details.
    )rV   rZ   ra   rF   zclient.toolbarModea  
        Change the visibility of items in the toolbar, options menu,
        and settings dialog (top right of the app).

        Allowed values:
        - "auto"      : Show the developer options if the app is accessed through
                        localhost or through Streamlit Community Cloud as a developer.
                        Hide them otherwise.
        - "developer" : Show the developer options.
        - "viewer"    : Hide the developer options.
        - "minimal"   : Show only options set externally (e.g. through
                        Streamlit Community Cloud) or through st.set_page_config.
                        If there are no options left, hide the menu.
    autozclient.showSidebarNavigationz
        Controls whether to display the default sidebar page navigation in a
        multi-page app. This only applies when app's pages are defined by the
        `pages/` directory.
    runnerz/Settings for how Streamlit executes your scriptzrunner.magicEnabledz
        Allows you to type a variable or string by itself in a single line of
        Python code to write it to the app.
    zrunner.postScriptGCz
        Run the Python Garbage Collector after each script execution.

        This can help avoid excess memory use in Streamlit apps, but could
        introduce delay in rerunning the app script for high-memory-use
        applications.
    )rV   rZ   ra   r\   zrunner.fastRerunsa[  
        Handle script rerun requests immediately, rather than waiting for
        script execution to reach a yield point.

        This makes Streamlit much more responsive to user interaction, but it
        can lead to race conditions in apps that mutate session_state data
        outside of explicit session_state assignment statements.
    z&runner.enforceSerializableSessionStateaF  
        Raise an exception after adding unserializable data to Session State.

        Some execution environments may require serializing all data in Session
        State, so it may be useful to detect incompatibility during development,
        or when the execution environment will stop supporting it in the future.
    zrunner.enumCoercionaK  
        Adjust how certain 'options' widgets like radio, selectbox, and
        multiselect coerce Enum members.

        This is useful when the Enum class gets re-defined during a script
        re-run. For more information, check out the docs:
        https://docs.streamlit.io/develop/concepts/design/custom-classes#enums

        Allowed values:
        - "off": Disables Enum coercion.
        - "nameOnly": Enum classes can be coerced if their member names match.
        - "nameAndValue": Enum classes can be coerced if their member names AND
          member values match.
    nameOnlyserverz!Settings for the Streamlit serverzserver.folderWatchLista  
        List of directories to watch for changes.

        By default, Streamlit watches files in the current working directory
        and its subdirectories. Use this option to specify additional
        directories to watch. Paths must be absolute.
    )rV   rZ   rc   zserver.folderWatchBlacklista}  
        List of directories to ignore for changes.

        By default, Streamlit watches files in the current working directory
        and its subdirectories. Use this option to specify exceptions within
        watched directories. Paths can be absolute or relative to the current
        working directory.

        Example: ['/home/user1/env', 'relative/path/to/folder']
    zserver.fileWatcherTypea  
        Change the type of file watcher used by Streamlit, or turn it off
        completely.

        Allowed values:
        - "auto"     : Streamlit will attempt to use the watchdog module, and
                       falls back to polling if watchdog isn't available.
        - "watchdog" : Force Streamlit to use the watchdog module.
        - "poll"     : Force Streamlit to always use polling.
        - "none"     : Streamlit will not watch files.
    zserver.cookieSecret)ra   rb   c                   C  s   t  S )zSymmetric key used to produce signed cookies. If deploying on multiple
    replicas, this should be set to the same value across all replicas to ensure
    they all share the same secret.

    Default: randomly generated secret key.
    )secrets	token_hexr(   r(   r(   r*   _server_cookie_secret     	r   zserver.headlessc                   C  s   t jotd otd S )zIf false, will attempt to open a browser window on start.

    Default: false unless (1) we are on a Linux box where DISPLAY is unset, or
    (2) we are running in the Streamlit Atom plugin.
    DISPLAYWAYLAND_DISPLAY)r   IS_LINUX_OR_BSDosgetenvr(   r(   r(   r*   _server_headless  s
   	

r   zserver.showEmailPromptz
        Whether to show a terminal prompt for the user's email address when
        they run Streamlit (locally) for the first time. If you set
        `server.headless=True`, Streamlit will not show this prompt.
    zserver.runOnSavezK
        Automatically rerun script when the file is modified on disk.
    zserver.allowRunOnSavezF
        Allows users to automatically rerun when app is updated.
    zserver.addressc                   C  s   dS )a   The address where the server will listen for client and browser
    connections.

    Use this if you want to bind the server to a specific address.
    If set, the server will only be accessible from this address, and not from
    any aliases (like localhost).

    Default: (unset)
    Nr(   r(   r(   r(   r*   _server_address  s   r   server.portzL
        The port where the server will listen for browser connections.
    i5!  zserver.scriptHealthCheckEnableda  
        Flag for enabling the script health check endpoint. It's used for checking if
        a script loads successfully. On success, the endpoint will return a 200
        HTTP status code. On failure, the endpoint will return a 503 HTTP status code.

        Note: This is an experimental Streamlit internal API. The API is subject
        to change anytime so this should be used at your own risk
    )r\   rV   rZ   ra   zserver.baseUrlPathzN
        The base path for the URL where Streamlit should be served from.
     z!server.customComponentBaseUrlPatha&  
        The base path for the URL where Streamlit should serve custom
        components. If this config var is set and a call to ``declare_component``
        does not specify a URL, the component's URL will be set to
        ``f"{server.customComponentBaseUrlPath}/{component_name}/"``.
    server.enableCORSz
        Enables support for Cross-Origin Resource Sharing (CORS) protection,
        for added security.

        If XSRF protection is enabled and CORS protection is disabled at the
        same time, Streamlit will enable them both instead.
    zserver.corsAllowedOriginsah  
        Allowed list of origins.

        If CORS protection is enabled (`server.enableCORS=True`), use this
        option to set a list of allowed origins that the Streamlit server will
        accept traffic from.

        This config option does nothing if CORS protection is disabled.

        Example: ['http://example.com', 'https://streamlit.io']
    server.enableXsrfProtectionz
        Enables support for Cross-Site Request Forgery (XSRF) protection, for
        added security.

        If XSRF protection is enabled and CORS protection is disabled at the
        same time, Streamlit will enable them both instead.
    zserver.maxUploadSizezP
        Max size, in megabytes, for files uploaded with the file_uploader.
       zserver.maxMessageSizezh
        Max size, in megabytes, of messages that can be sent via the WebSocket
        connection.
    zserver.enableArrowTruncationz
        Enable automatically truncating all data structures that get serialized
        into Arrow (e.g. DataFrames) to ensure that the size is under
        `server.maxMessageSize`.
    )rV   r\   rZ   rF   ra   z!server.enableWebsocketCompressionz8
        Enables support for websocket compression.
    zserver.websocketPingIntervala,  
        The interval (in seconds) at which the server pings the client to keep
        the websocket connection alive.

        The default value should work for most deployments. However, if you're
        experiencing frequent disconnections in certain proxy setups (e.g.,
        "Connection error" messages), you may want to try adjusting this value.

        Note: When you set this option, Streamlit automatically sets the ping
        timeout to match this interval. For Tornado >=6.5, a value less than 30
        may cause connection issues.
    zserver.enableStaticServingzd
        Enable serving files from a `static` directory in the running app's
        directory.
    zserver.disconnectedSessionTTLa  
        TTL in seconds for sessions whose websockets have been disconnected.

        The server may choose to clean up session state, uploaded files, etc
        for a given session with no active websocket connection at any point
        after this time has passed. If you are using load balancing or
        replication in your deployment, you must enable session stickiness
        in your proxy to guarantee reconnection to the existing session. For
        more information, see https://docs.streamlit.io/replication.
    x   server.trustedUserHeadersa  
        HTTP headers to embed in st.user.

        Configures HTTP headers whose values, on websocket connect, will be saved in
        st.user. Each key is the header name to map, and each value is the key in
        st.user to save the value under. If the configured header occurs multiple times
        in the request, the first value will be used. Multiple headers may not point to
        the same user key, and an error will be thrown on initialization if this is
        done.

        If configured using an environment variable or CLI option, it should be a
        single JSON-formatted dict of string-to-string.

        Note: This is an experimental API subject to change.
    browserz(Configuration of non-UI browser options.zbrowser.serverAddressa7  
        Internet address where users should point their browsers in order to
        connect to the app. Can be IP address or DNS name and path.

        This is used to:
        - Set the correct URL for CORS and XSRF protection purposes.
        - Show the URL on the terminal
        - Open the browser
    	localhostzbrowser.gatherUsageStatsz<
        Whether to send usage statistics to Streamlit.
    browser.serverPortintc                   C  s   t tdS )a  Port where users should point their browsers in order to connect to the
    app.

    This is used to:
    - Set the correct URL for XSRF protection purposes.
    - Show the URL on the terminal (part of `streamlit run`).
    - Open the browser automatically (part of `streamlit run`).

    This option is for advanced use cases. To change the port of your app, use
    `server.Port` instead.

    Default: whatever value is set in server.port.
    r   )r   rN   r(   r(   r(   r*   _browser_server_port  s   r   zDO NOT USE THIS OPTION IN A PRODUCTION ENVIRONMENT. It has not gone through security audits or performance tests. For the production environment, we recommend performing SSL termination by the load balancer or the reverse proxy.zserver.sslCertFilez
        Server certificate file for connecting via HTTPS.
        Must be set at the same time as "server.sslKeyFile".

        z	
        )rV   zserver.sslKeyFilez
        Cryptographic key file for connecting via HTTPS.
        Must be set at the same time as "server.sslCertFile".

        uiz6Configuration of UI elements displayed in the browser.zui.hideTopBarz
        Flag to hide most of the UI elements found at the top of a Streamlit app.

        NOTE: This does *not* hide the main menu in the top-right of an app.
    mapboxz2Mapbox configuration that is being used by DeckGL.zmapbox.tokenzw
        If you'd like to show maps using Mapbox rather than Carto, use this
        to pass the Mapbox API token.
    z
        Instead of this, you should use either the MAPBOX_API_KEY environment
        variable or PyDeck's `api_keys` argument.
    z
2026-05-01)rV   rZ   ra   rb   r]   r^   r_   magicz4Settings for how Streamlit pre-processes your scriptzmagic.displayRootDocStringa%  
        Streamlit's "magic" parser typically skips strings that appear to be
        docstrings. When this flag is set to True, Streamlit will instead display
        the root-level docstring in the app, just like any other magic string.
        This is useful for things like notebooks.
    z"magic.displayLastExprIfNoSemicolonz
        Make Streamlit's "magic" parser always display the last expression in the
        root file if it has no semicolon at the end. This matches the behavior of
        Jupyter notebooks, for example.
    rj   z9Settings to define a custom theme for your Streamlit app.rk   zSettings to define a custom z theme in your Streamlit app.basez
        The preset Streamlit theme that your custom theme inherits from.

        This can be one of the following: "light" or "dark".
    )rh   rV   primaryColorz#
        Primary accent color.
    backgroundColorz*
        Background color of the app.
    secondaryBackgroundColorzA
        Background color used for most interactive widgets.
    	textColorz-
        Color used for almost all text.
    	linkColorz'
        Color used for all links.
    linkUnderlinezI
        Whether or not links should be displayed with an underline.
    )rh   rV   ra   codeBackgroundColorz4
        Background color used for code blocks.
    fonta  
        The font family for all text, except code blocks.

        This can be one of the following:
        - "sans-serif"
        - "serif"
        - "monospace"
        - The `family` value for a custom font table under [[theme.fontFaces]]
        - A comma-separated list of these (as a single string) to specify
          fallbacks

        For example, you can use the following:

            font = "cool-font, fallback-cool-font, sans-serif"
    	fontFacesae  
        An array of fonts to use in your app.

        Each font in the array is a table (dictionary) that can have the
        following attributes, closely resembling CSS font-face definitions:
        - family
        - url
        - weight (optional)
        - style (optional)
        - unicodeRange (optional)

        To host a font with your app, enable static file serving with
        `server.enableStaticServing=true`.

        You can define multiple [[theme.fontFaces]] tables, including multiple
        tables with the same family if your font is defined by multiple files.

        For example, a font hosted with your app may have a [[theme.fontFaces]]
        table as follows:

            [[theme.fontFaces]]
            family = "font_name"
            url = "app/static/font_file.woff"
            weight = "400"
            style = "normal"
    baseFontSizez
        The root font size (in pixels) for the app.

        This determines the overall scale of text and UI elements. This is a
        positive integer.

        If this isn't set, the font size will be 16px.
    baseFontWeighta  
        The root font weight for the app.

        This determines the overall weight of text and UI elements. This is an
        integer multiple of 100. Values can be between 100 and 600, inclusive.

        If this isn't set, the font weight will be set to 400 (normal weight).
    headingFonta  
        The font family to use for headings.

        This can be one of the following:
        - "sans-serif"
        - "serif"
        - "monospace"
        - The `family` value for a custom font table under [[theme.fontFaces]]
        - A comma-separated list of these (as a single string) to specify
          fallbacks

        If this isn't set, Streamlit uses `theme.font` for headings.
    headingFontSizesa  
        One or more font sizes for h1-h6 headings.

        If no sizes are set, Streamlit will use the default sizes for h1-h6
        headings. Heading font sizes set in [theme] are not inherited by
        [theme.sidebar]. The following sizes are used by default:
        [
            "2.75rem", # h1 (1.5rem for sidebar)
            "2.25rem", # h2 (1.25rem for sidebar)
            "1.75rem", # h3 (1.125rem for sidebar)
            "1.5rem",  # h4 (1rem for sidebar)
            "1.25rem", # h5 (0.875rem for sidebar)
            "1rem",    # h6 (0.75rem for sidebar)
        ]

        If you specify an array with fewer than six sizes, the unspecified
        heading sizes will be the default values. For example, you can use the
        following array to set the font sizes for h1-h3 headings while keeping
        h4-h6 headings at their default sizes:
            headingFontSizes = ["3rem", "2.875rem", "2.75rem"]

        Setting a single value (not in an array) will set the font size for all
        h1-h6 headings to that value:
            headingFontSizes = "2.75rem"

        Font sizes can be specified in pixels or rem, but rem is recommended.
    headingFontWeightsa  
        One or more font weights for h1-h6 headings.

        If no weights are set, Streamlit will use the default weights for h1-h6
        headings. Heading font weights set in [theme] are not inherited by
        [theme.sidebar]. The following weights are used by default:
        [
            700, # h1 (bold)
            600, # h2 (semi-bold)
            600, # h3 (semi-bold)
            600, # h4 (semi-bold)
            600, # h5 (semi-bold)
            600, # h6 (semi-bold)
        ]

        If you specify an array with fewer than six weights, the unspecified
        heading weights will be the default values. For example, you can use
        the following array to set the font weights for h1-h2 headings while
        keeping h3-h6 headings at their default weights:
            headingFontWeights = [800, 700]

        Setting a single value (not in an array) will set the font weight for
        all h1-h6 headings to that value:
            headingFontWeights = 500
    codeFonta`  
        The font family to use for code (monospace) in the sidebar.

        This can be one of the following:
        - "sans-serif"
        - "serif"
        - "monospace"
        - The `family` value for a custom font table under [[theme.fontFaces]]
        - A comma-separated list of these (as a single string) to specify
          fallbacks
    codeFontSizea"  
        The font size (in pixels or rem) for code blocks and code text.

        This applies to font in code blocks, `st.json`, and `st.help`. It
        doesn't apply to inline code, which is set by default to 0.75em.

        If this isn't set, the code font size will be 0.875rem.
    codeFontWeightaA  
        The font weight for code blocks and code text.

        This applies to font in inline code, code blocks, `st.json`, and
        `st.help`. This is an integer multiple of 100. Values can be between
        100 and 600, inclusive.

        If this isn't set, the code font weight will be 400 (normal weight).
    
baseRadiusa  
        The radius used as basis for the corners of most UI elements.

        This can be one of the following:
        - "none"
        - "small"
        - "medium"
        - "large"
        - "full"
        - The number in pixels or rem.

        For example, you can use "10px", "0.5rem", or "2rem". To follow best
        practices, use rem instead of pixels when specifying a numeric size.
    buttonRadiusa  
        The radius used as basis for the corners of buttons.

        This can be one of the following:
        - "none"
        - "small"
        - "medium"
        - "large"
        - "full"
        - The number in pixels or rem.

        For example, you can use "10px", "0.5rem", or "2rem". To follow best
        practices, use rem instead of pixels when specifying a numeric size.

        If this isn't set, Streamlit uses `theme.baseRadius` instead.
    borderColorz6
        The color of the border around elements.
    dataframeBorderColorz
        The color of the border around dataframes and tables.

        If this isn't set, Streamlit uses `theme.borderColor` instead.
    dataframeHeaderBackgroundColora  
        The background color of the dataframe's header.

        This color applies to all non-interior cells of the dataframe. This
        includes the header row, the row-selection column (if present), and
        the bottom row of data editors with a dynamic number of rows. If this
        isn't set, Streamlit uses a mix of `theme.backgroundColor` and
        `theme.secondaryBackgroundColor`.
    showWidgetBorderz<
        Whether to show a border around input widgets.
    showSidebarBorderzi
        Whether to show a vertical separator between the sidebar and the main
        content area.
    chartCategoricalColorsa  
        An array of colors to use for categorical chart data.

        This is a list of one or more color strings which are applied in order
        to categorical data. These colors apply to Plotly, Altair, and
        Vega-Lite charts.

        Invalid colors are skipped, and colors repeat cyclically if there are
        more categories than colors. If no chart categorical colors are set,
        Streamlit uses a default set of colors.

        For light themes, the following colors are the default:
        [
            "#0068c9", # blue80
            "#83c9ff", # blue40
            "#ff2b2b", # red80
            "#ffabab", # red40
            "#29b09d", # blueGreen80
            "#7defa1", # green40
            "#ff8700", # orange80
            "#ffd16a", # orange50
            "#6d3fc0", # purple80
            "#d5dae5", # gray40
        ]
        For dark themes, the following colors are the default:
        [
            "#83c9ff", # blue40
            "#0068c9", # blue80
            "#ffabab", # red40
            "#ff2b2b", # red80
            "#7defa1", # green40
            "#29b09d", # blueGreen80
            "#ffd16a", # orange50
            "#ff8700", # orange80
            "#6d3fc0", # purple80
            "#d5dae5", # gray40
        ]
    chartSequentialColorsaw  
        An array of ten colors to use for sequential or continuous chart data.

        The ten colors create a gradient color scale. These colors apply to
        Plotly, Altair, and Vega-Lite charts.

        Invalid color strings are skipped. If there are not exactly ten
        valid colors specified, Streamlit uses a default set of colors.

         For light themes, the following colors are the default:
        [
            "#e4f5ff", #blue10
            "#c7ebff", #blue20
            "#a6dcff", #blue30
            "#83c9ff", #blue40
            "#60b4ff", #blue50
            "#3d9df3", #blue60
            "#1c83e1", #blue70
            "#0068c9", #blue80
            "#0054a3", #blue90
            "#004280", #blue100
        ]
        For dark themes, the following colors are the default:
        [
            "#004280", #blue100
            "#0054a3", #blue90
            "#0068c9", #blue80
            "#1c83e1", #blue70
            "#3d9df3", #blue60
            "#60b4ff", #blue50
            "#83c9ff", #blue40
            "#a6dcff", #blue30
            "#c7ebff", #blue20
            "#e4f5ff", #blue10
        ]
    r   zSecrets configuration.zsecrets.files)rc   	list[str]c                   C  s   t dS )a  List of locations where secrets are searched.

    An entry can be a path to a TOML file or directory path where
    Kubernetes style secrets are saved. Order is important, import is
    first to last, so secrets in later files will take precedence over
    earlier ones.
    zsecrets.toml)get_config_filesr(   r(   r(   r*   _secrets_filesG  r   r   c                 C  sT   t  t }| |vrd|  d}t|||  jW  d   S 1 s#w   Y  dS )zIndicate where (e.g. in which file) this option was defined.

    Parameters
    ----------
    key : str
        The config option key of the form "section.optionName"

    rJ   rK   N)rA   rB   rL   r?   )r<   rM   msgr(   r(   r*   get_where_definedS  s   	$r   option_namec                 C  s   t | tjkS )zCheck if a given option has not been set by the user.

    Parameters
    ----------
    option_name : str
        The option to check


    Returns
    -------
    bool
        True if the option has not been set by the user.

    )r   r   DEFAULT_DEFINITIONr   r(   r(   r*   	_is_unsete  s   r   c                 C  s   t | tjtjfvS )zCheck if a given option was actually defined by the user.

    Parameters
    ----------
    option_name : str
        The option to check


    Returns
    -------
    bool
        True if the option has been set by the user.

    )r   r   r   STREAMLIT_DEFINITIONr   r(   r(   r*   is_manually_setw  s   r   c                   C  sF   t  tdu rtdttt W d   dS 1 sw   Y  dS )z)Print all config options to the terminal.Nrn   )rA   r   rL   r
   show_configr   r(   r(   r(   r*   r     s   "r   c                 C  sP   t du rtd| t vrddlm} |t}|d|  dS t |  || dS )a  Set a config option by key / value pair.

    This function assumes that the _config_options dictionary has already been
    populated and thus should only be used within this file and by tests.

    Parameters
    ----------
    key : str
        The key of the option, like "logger.level".
    value
        The value of the option.
    where_defined : str
        Tells the config system where this was set.

    Nz0_config_options should always be populated here.r   
get_loggerzj"%s" is not a valid config option. If you previously had this config option set, it may have been removed.)r   rL   r   r   r0   warning	set_value)r<   r>   r?   r   ry   r(   r(   r*   rC     s   rC   rM   c                 C  sB   |   D ]\}}|jsqtj|j}|du rqt||t qdS )z{Update the config system by parsing the environment variable.

    This should only be called from get_config_options.
    N)itemsrb   r   environgetenv_varrC   r   )rM   opt_nameopt_valenv_var_valuer(   r(   r*   %_update_config_with_sensitive_env_var  s   r   raw_tomlc                   sf   zddl }|| }W n ty   td Y dS w d fd
d | D ]	\}} || q'dS )a)  Update the config system by parsing this string.

    This should only be called from get_config_options.

    Parameters
    ----------
    raw_toml : str
        The TOML file to parse to update the config values.
    where_defined : str
        Tells the config system where this was set.

    r   NzzError parsing config toml. This is most likely due to a syntax error in the config.toml file. Please fix it and try again.section_pathr=   section_datarP   r#   r@   c                   sN   |  D ] \}}|  d| }|tjjfv r || qt|t| qdS )a  Recursively process nested sections of the config file.

        Parameters
        ----------
        section_path : str
            The dot-separated path to the current section (e.g., "server" or "theme")
        section_data : dict[str, Any]
            The dictionary containing configuration values for this section

        Notes
        -----
        TOML's hierarchical structure gets parsed into nested dictionaries.
        For example:
            [main]
            option = "value"

            [main.subsection]
            another = "value2"

        Will be loaded by the TOML parser as:
            {
                "main": {
                    "option": "value",
                    "subsection": {
                        "another": "value2"
                    }
                }
            }

        This function traverses these nested dictionaries and converts them
        to dot-notation config options.
        rd   N)r   r9   r;   r>   rC   _maybe_read_env_variable)r   r   rR   r>   r   process_sectionr?   r(   r*   r     s   "z1_update_config_with_toml.<locals>.process_section)r   r=   r   rP   r#   r@   )tomlloadsro   r   	exceptionr   )r   r?   r   parsed_config_filerO   optionsr(   r   r*   _update_config_with_toml  s   	+r   c                 C  sh   t | tr2| dr2| tdd }tj|}|du r.ddlm} |t	}|
d| | S t|S | S )aU  If value is "env:foo", return value of environment variable "foo".

    If value is not in the shape above, returns the value right back.

    Parameters
    ----------
    value : any
        The value to check

    Returns
    -------
    any
        Either returns value right back, or the value of the environment
        variable.

    zenv:Nr   r   z!No environment variable called %s)
isinstancer=   
startswithlenr   r   r   r   r   r0   error_maybe_convert_to_number)r>   var_namer   r   ry   r(   r(   r*   r     s   r   vc                 C  s>   zt | W S  ty   Y nw zt| W S  ty   Y | S w )z-Convert v to int or float, or leave it as is.)r   ro   float)r   r(   r(   r*   r   7  s   

r   z'Emitted when the config file is parsed.)doc	file_namec                 C  s>   t | t | g}tdurt t| }||vr|| |S )zReturn the list of config files (e.g. config.toml or secrets.toml) to be parsed.

    Order is important, import is first to last, so options in later files
    will take precedence over earlier ones.
    N)r   get_streamlit_file_pathget_project_streamlit_file_pathr   #get_main_script_streamlit_file_pathappend)r   config_filesscript_level_configr(   r(   r*   r   K  s   	
r   force_reparseoptions_from_flagsdict[str, Any] | Nonec              
   C  s"  |si }t }|r| s|S ty t r| st W  d   S t }tta tdD ](}tj|s0q't	|dd}|
 }W d   n1 sEw   Y  t|| q'tt  | D ]
\}}t||t qX|rzt|t rzddlm}	 |	t}
|
d t  t W  d   S 1 sw   Y  dS )a  Create and return a dict mapping config option names to their values,
    returning a cached dict if possible.

    Config option values are sourced from the following locations. Values
    set in locations further down the list overwrite those set earlier.
      1. default values defined in this file
      2. the global `~/.streamlit/config.toml` file
      3. per-project `$CWD/.streamlit/config.toml` files
      4. environment variables such as `STREAMLIT_SERVER_PORT`
      5. command line flags passed to `streamlit run`

    Parameters
    ----------
    force_reparse : bool
        Force config files to be parsed so that we pick up any changes to them.

    options_from_flags : dict[str, any] or None
        Config options that we received via CLI flag.

    Returns
    -------
    dict[str, ConfigOption]
        An ordered dict that maps config option names to their values.
    Nzconfig.tomlzutf-8)encodingr   r   z{An update to the [server] config option section was detected. To have these changes be reflected, please restart streamlit.)r   rA   copydeepcopyr   r   r   pathexistsopenreadr   r   r   rC   r   r
   server_option_changedr   r   r0   r   _on_config_parsedsend)r   r   rM   old_optionsfilenamefilefile_contentsr   r   r   ry   r(   r(   r*   rB   d  s@   

$rB   c                  C  sj   ddl m}  | t}tdrtdstdtdstdtdr1td	r*tdr3|d
 d S d S d S )Nr   r   rr   r   z>server.port does not work when global.developmentMode is true.r   zEbrowser.serverPort does not work when global.developmentMode is true.r   r   a  
Warning: the config option 'server.enableCORS=false' is not compatible with
'server.enableXsrfProtection=true'.
As a result, 'server.enableCORS' is being overridden to 'true'.

More information:
In order to protect against CSRF attacks, we send a cookie with each request.
To do so, we must specify allowable origins, which places a restriction on
cross-origin resource sharing.

If cross origin resource sharing is required, please disable server.enableXsrfProtection.
            )r   r   r0   rN   r   rL   r   )r   ry   r(   r(   r*   _check_conflicts  s(   	r  c                   C  s   t dt_d S )Nrr   )rN   r   is_development_moder(   r(   r(   r*   _set_development_mode     r  c            
   
   C  s   t  } | d }t|jtrTz1t|j}t|tstd| D ]\}}t|ts4td| d| q!t	d||j
d W n tjyS } ztd|j d}~ww | d j}t }g }| D ]}	|	|v rm||	 ||	 qb|r|td| dS )	a  Convert string-valued server.trustedUserHeaders to a dict.

    If server.trustedUserHeaders is configured from an environment variable or from
    the CLI, it will be a JSON string. Parse this and set the value to the resulting
    dict, after validation.
    r   z0server.trustedUserHeaders JSON must be an objectzTserver.trustedUserHeaders JSON must only have string values. got bad value for key "z": )r?   z.bad JSON value for server.trustedUserHeaders: Nz@server.trustedUserHeaders had multiple mappings for user key(s) )rB   r   r>   r=   jsonr   dictrL   r   rD   r?   JSONDecodeErrorr   setrQ   r   add)
r   trusted_user_headersparsed_valuejson_key
json_valuejdefinal_config_valuerQ   bad_keysuser_keyr(   r(   r*   _parse_trusted_user_headers  sP   





r  funcCallable[[], None]force_connectlockc                   sP   dfdddfdd}d fd	d
|st s#tjdd |S   |S )aS  Wait for the config file to be parsed then call func.

    If the config file has already been parsed, just calls func immediately
    unless force_connect is set.

    Parameters
    ----------
    func : Callable[[], None]
        A function to run on config parse.

    force_connect : bool
        Wait until the next config file parse to run func, even if config files
        have already been parsed.

    lock : bool
        If set, grab _config_lock before running func.

    Returns
    -------
    Callable[[], None]
        A function that the caller can use to deregister func.
    _r   r#   r@   c                   s
      d S Nr(   )r  )func_with_lockr(   r*   receiver3  s   
z"on_config_parsed.<locals>.receiverc                     s   t   d S r  )r   
disconnectr(   )r  r(   r*   r  6  r  z$on_config_parsed.<locals>.disconnectc                     s>   rt     W d    d S 1 sw   Y  d S    d S r  )rA   r(   )r  r  r(   r*   r  9  s
   "
z(on_config_parsed.<locals>.func_with_lockF)weakN)r  r   r#   r@   r#   r@   )r   r   connect)r  r  r  r  r(   )r  r  r  r  r*   on_config_parsed  s   r   )r  )r<   r=   r>   r   r?   r=   r#   r@   )r<   r=   r>   r   r#   r@   )r<   r=   r#   r   )rO   r=   r#   rP   )rO   r=   rV   r=   r#   r@   )r<   r=   rV   r   rZ   r[   rF   r$   r\   r=   r]   r$   r^   r   r_   r   r`   r   ra   r   rb   r$   rc   r$   r#   r   )rR   r=   rh   ri   rV   r   rZ   r[   r\   r=   ra   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  )rM   r   r#   r@   )r   r=   r?   r=   r#   r@   )r>   r   r#   r   )r   r   r#   r   )r   r=   r#   r   )FN)r   r$   r   r   r#   r   )FF)r  r  r  r$   r  r$   r#   r  )Yr3   
__future__r   r   r  loggingr   r   	threadingcollectionsr   enumr   typingr   r   r   r   blinkerr	   	streamlitr
   r   r   r   r   streamlit.config_optionr   streamlit.errorsr   r   __annotations__RLockrA   r   r   r   r   r   r   	getLoggerr0   r   r=   r   r9   rD   rI   rN   rU   rX   rg   rm   rp   r$   memoizerw   r   r   r|   r   r   r4   r>   r   r   r   r   _SSL_PRODUCTION_WARNINGlistrl   r;   r   r   r   r   r   rC   r   r   r   r   r   r   rB   r  r  r  r   r(   r(   r(   r*   <module>   sL  1	L!





 





			
	


	







	 	
	++#I"N,39