Ë
    Eêñi¶_  ã                  óª  — U d dl mZ d dlZd dlZd dlmZmZmZmZm	Z	m
Z
 d dlmZ d dlmZmZmZ d dlmZ d dlZd dlmZmZ d dlmZmZ d d	lmZ  ee«      Zd
ed<   ee z  e!z  e"z  e#edf   z  Z$ e%ee e!e"h«      Z&ded<   ddd„Z' G d„ d«      Z( e(«       Z)d
ed<   dd„Z*dd„Z+dd„Z, G d„ de	eef   «      Z- G d„ de	eef   «      Z. e.«       Z/d
ed<   y) é    )ÚannotationsN)ÚCallableÚ	ItemsViewÚIteratorÚKeysViewÚMappingÚ
ValuesView)Údeepcopy)ÚAnyÚFinalÚNoReturn)ÚSignal)ÚconfigÚruntime)ÚStreamlitMaxRetriesErrorÚStreamlitSecretNotFoundError)Ú
get_loggerr   Ú_LOGGERÚSecretsValuezFinal[frozenset[type]]Ú_ALLOWED_SCALAR_TYPESc                ó†  — t        | t        «      ro| j                  «       D ][  \  }}t        |t        «      s/|rd|› d�nd}t	        dt        |«      j                  ›d|› d�«      ‚|r|› d|› �n|}t        ||«       Œ] yt        | «      t        vr1t        | «      j                  }|rd|› d�nd}t	        d	|› d|› d
�«      ‚y)a  Validate that a secrets value has an allowed type.

    Parameters
    ----------
    value
        The value to validate.
    path
        The dotted path to this value (for error messages).

    Raises
    ------
    TypeError
        If the value has an unsupported type.
    zin 'ú'zat top levelz0Dictionary keys in secrets must be strings, got ú ú.z at 'Ú zUnsupported type 'zH in secrets. Allowed types are: str, int, float, bool, and nested dicts.N)	Ú
isinstanceÚdictÚitemsÚstrÚ	TypeErrorÚtypeÚ__name__Ú_validate_secrets_valuer   )ÚvalueÚpathÚkeyÚnested_valueÚkey_pathÚnested_pathÚ	type_nameÚ	path_infos           ú[/var/www/pod-logistic/pod-ai/venv/lib/python3.12/site-packages/streamlit/runtime/secrets.pyr#   r#   ,   së   € ô �%œÔØ!&§¡£ò 	?ÑˆC�Ü˜c¤3Ô'Ù-1˜T $  q™>°~�ÜðÜ ›9×-Ñ-Ð0°°(°¸1ð>óð ñ .2˜T˜F ! C 5™/°sˆKÜ# L°+Õ>ñ	?ô 
ˆe‹Ô1Ñ	1Ü˜“K×(Ñ(ˆ	Ù'+�e˜D˜6 ‘O°ˆ	ÜØ   ¨1¨Y¨Kð 8Jð Kó
ð 	
ð 
2ó    c                  óˆ   — e Zd ZdZdd„Zdd„Zdd„Zdd„Z	 	 	 	 dd„Z	 	 	 	 dd„Z	dd„Z
dd	„Zdd
„Zdd„Zdd„Zdd„Zdd„Zy)ÚSecretErrorMessagesa"  SecretErrorMessages stores all error messages we use for secrets to allow customization
    for different environments.

    For example Streamlit Cloud can customize the message to be different than the open source.

    For internal use, may change in future releases without notice.
    c                ód   — d„ | _         d„ | _        d„ | _        d„ | _        d„ | _        d„ | _        y )Nc                ó   — d| › d�S )Nzst.secrets has no attribute "úÛ". Did you forget to add it to secrets.toml, mount it to secret directory, or the app settings on Streamlit Cloud? More info: https://docs.streamlit.io/deploy/streamlit-community-cloud/deploy-your-app/secrets-management© ©Ú	attr_names    r,   ú<lambda>z.SecretErrorMessages.__init__.<locals>.<lambda>Z   s   € Ø+¨I¨;ð 7lð lð r-   c                ó   — d| › d�S )Nzst.secrets has no key "r2   r3   ©r&   s    r,   r6   z.SecretErrorMessages.__init__.<locals>.<lambda>`   s   € Ø% c Uð +lð lð r-   c                ó*   — ddj                  | «      › �S )NzQNo secrets found. Valid paths for a secrets.toml file or secret directories are: z, )Újoin)Ú
file_pathss    r,   r6   z.SecretErrorMessages.__init__.<locals>.<lambda>f   s   € Ø_Ð`d×`iÑ`iÐjtÓ`uÐ_vÐwð r-   c                ó   — d| › d|› �S )NzError parsing secrets file at z: r3   )r%   Úexs     r,   r6   z.SecretErrorMessages.__init__.<locals>.<lambda>j   s   € Ð=¸d¸VÀ2ÀbÀTÐJ€ r-   c                ó   — | › d�S )Nzn is not a folder. To use directory based secrets, mount every secret in a subfolder under the secret directoryr3   )Úsub_folder_paths    r,   r6   z.SecretErrorMessages.__init__.<locals>.<lambda>m   s   € Ø"Ð#ð $oð oð r-   c                ó   — d| › d�S )NzInvalid secrets path: z): path is not a .toml file or a directoryr3   )r%   s    r,   r6   z.SecretErrorMessages.__init__.<locals>.<lambda>r   s   € Ø$ T FÐ*SÐTð r-   )Úmissing_attr_messageÚmissing_key_messageÚno_secrets_foundÚerror_parsing_file_at_pathÚsubfolder_path_is_not_a_folderÚinvalid_secret_path©Úselfs    r,   Ú__init__zSecretErrorMessages.__init__Y   sE   € ñ;
ˆÔ!ñ:
ˆÔ ñ=
ˆÔñ Kð 	Ô'ñð 	Ô+ñ:
ˆÕ r-   c                ó   — || _         y)z(Set the missing attribute error message.N©rA   ©rH   Úmessages     r,   Úset_missing_attr_messagez,SecretErrorMessages.set_missing_attr_messagev   s
   € à$+ˆÕ!r-   c                ó   — || _         y)z"Set the missing key error message.N©rB   rL   s     r,   Úset_missing_key_messagez+SecretErrorMessages.set_missing_key_messagez   ó
   € à#*ˆÕ r-   c                ó   — || _         y)z'Set the no secrets found error message.N©rC   rL   s     r,   Úset_no_secrets_found_messagez0SecretErrorMessages.set_no_secrets_found_message~   s
   € à 'ˆÕr-   c                ó   — || _         y)z1Set the error parsing file at path error message.N©rD   rL   s     r,   Ú&set_error_parsing_file_at_path_messagez:SecretErrorMessages.set_error_parsing_file_at_path_message‚   s   € ð +2ˆÕ'r-   c                ó   — || _         y)z5Set the subfolder path is not a folder error message.N©rE   rL   s     r,   Ú*set_subfolder_path_is_not_a_folder_messagez>SecretErrorMessages.set_subfolder_path_is_not_a_folder_messageˆ   s   € ð /6ˆÕ+r-   c                ó   — || _         y)z*Set the invalid secret path error message.N©rF   rL   s     r,   Úset_invalid_secret_path_messagez3SecretErrorMessages.set_invalid_secret_path_messageŽ   rR   r-   c                ó$   — | j                  |«      S )z(Get the missing attribute error message.rK   )rH   r5   s     r,   Úget_missing_attr_messagez,SecretErrorMessages.get_missing_attr_message’   s   € à×(Ñ(¨Ó3Ð3r-   c                ó$   — | j                  |«      S )z"Get the missing key error message.rP   ©rH   r&   s     r,   Úget_missing_key_messagez+SecretErrorMessages.get_missing_key_message–   s   € à×'Ñ'¨Ó,Ð,r-   c                ó$   — | j                  |«      S )z'Get the no secrets found error message.rT   )rH   r;   s     r,   Úget_no_secrets_found_messagez0SecretErrorMessages.get_no_secrets_found_messageš   s   € à×$Ñ$ ZÓ0Ð0r-   c                ó&   — | j                  ||«      S )z1Get the error parsing file at path error message.rW   )rH   r%   r=   s      r,   Ú&get_error_parsing_file_at_path_messagez:SecretErrorMessages.get_error_parsing_file_at_path_messagež   s   € à×.Ñ.¨t°RÓ8Ð8r-   c                ó$   — | j                  |«      S )z5Get the subfolder path is not a folder error message.rZ   )rH   r?   s     r,   Ú*get_subfolder_path_is_not_a_folder_messagez>SecretErrorMessages.get_subfolder_path_is_not_a_folder_message¢   s   € à×2Ñ2°?ÓCÐCr-   c                ó$   — | j                  |«      S )z*Get the invalid secret path error message.r]   )rH   r%   s     r,   Úget_invalid_secret_path_messagez3SecretErrorMessages.get_invalid_secret_path_message¦   s   € à×'Ñ'¨Ó-Ð-r-   N©ÚreturnÚNone)rM   zCallable[[str], str]rm   rn   )rM   zCallable[[list[str]], str]rm   rn   )rM   zCallable[[str, Exception], str]rm   rn   ©r5   r   rm   r   ©r&   r   rm   r   )r;   z	list[str]rm   r   )r%   r   r=   Ú	Exceptionrm   r   )r?   r   rm   r   )r%   r   rm   r   )r"   Ú
__module__Ú__qualname__Ú__doc__rI   rN   rQ   rU   rX   r[   r^   r`   rc   re   rg   ri   rk   r3   r-   r,   r/   r/   P   si   „ ñó
ó:,ó+ó(ð2Ø6ð2à	ó2ð6Ø+ð6à	ó6ó+ó4ó-ó1ó9óDô.r-   r/   Úsecret_error_messages_singletonc           	     óÖ   — t        | t        «      r| j                  «       S | j                  «       D ��ci c](  \  }}|t        |t        «      r|j                  «       n|“Œ* c}}S c c}}w )z4Convert Mapping or AttrDict objects to dictionaries.)r   ÚAttrDictÚto_dictr   )ÚobjÚkÚvs      r,   Ú_convert_to_dictr|   ®   sL   € ä�#”xÔ Ø�{‰{‹}ÐØILÏÉË×UÁÀÀAˆAœj¨¬HÔ5ˆq�y‰yŒ{¸1Ñ<ÓUÐUùÓUs   ´-A%c                ó,   — t         j                  | «      S ©N)ru   r`   r4   s    r,   Ú_missing_attr_error_messager   µ   s   € Ü*×CÑCÀIÓNÐNr-   c                ó,   — t         j                  | «      S r~   )ru   rc   r8   s    r,   Ú_missing_key_error_messager�   ¹   s   € Ü*×BÑBÀ3ÓGÐGr-   c                  ój   — e Zd ZdZdd„Zedd„«       Zdd„Zdd„Zdd„Z	dd„Z
dd„Zdd	„Zdd
„Zdd„Zy)rw   zkWe use AttrDict to wrap up dictionary values from secrets
    to provide dot access to nested secrets.
    c                ó4   — t        |«      | j                  d<   y )NÚ__nested_secrets__)r   Ú__dict__)rH   r$   s     r,   rI   zAttrDict.__init__Â   s   € Ü.2°5«kˆ�‰Ð*Ò+r-   c                ó<   — t        | t        «      s| S t        | «      S r~   )r   r   rw   )r$   s    r,   Ú_maybe_wrap_in_attr_dictz!AttrDict._maybe_wrap_in_attr_dictÅ   s   € ä˜%¤Ô)ØˆLÜ˜‹Ðr-   c                ó,   — t        | j                  «      S r~   )Úlenr„   rG   s    r,   Ú__len__zAttrDict.__len__Ë   s   € Ü�4×*Ñ*Ó+Ð+r-   c                ó,   — t        | j                  «      S r~   )Úiterr„   rG   s    r,   Ú__iter__zAttrDict.__iter__Î   ó   € Ü�D×+Ñ+Ó,Ð,r-   c                ó†   — 	 | j                   |   }| j                  |«      S # t        $ r t        t        |«      «      ‚w xY wr~   )r„   r‡   ÚKeyErrorr�   ©rH   r&   r$   s      r,   Ú__getitem__zAttrDict.__getitem__Ñ   sH   € ð	<Ø×+Ñ+¨CÑ0ˆEØ×0Ñ0°Ó7Ð7øÜò 	<ÜÔ5°cÓ:Ó;Ð;ð	<úó	   ‚" ¢A c                ó†   — 	 | j                   |   }| j                  |«      S # t        $ r t        t	        |«      «      ‚w xY wr~   )r„   r‡   r�   ÚAttributeErrorr   )rH   r5   r$   s      r,   Ú__getattr__zAttrDict.__getattr__Ø   sK   € ð	IØ×+Ñ+¨IÑ6ˆEØ×0Ñ0°Ó7Ð7øÜò 	IÜ Ô!<¸YÓ!GÓHÐHð	Iúr“   c                ó,   — t        | j                  «      S r~   )Úreprr„   rG   s    r,   Ú__repr__zAttrDict.__repr__ß   rŽ   r-   c                ó   — t        d«      ‚)Nz)Secrets does not support item assignment.©r    r‘   s      r,   Ú__setitem__zAttrDict.__setitem__â   s   € ÜÐCÓDÐDr-   c                ó   — t        d«      ‚)Nú.Secrets does not support attribute assignment.r›   r‘   s      r,   Ú__setattr__zAttrDict.__setattr__å   s   € ÜÐHÓIÐIr-   c                ó,   — t        | j                  «      S r~   )r
   r„   rG   s    r,   rx   zAttrDict.to_dictè   s   € Ü˜×/Ñ/Ó0Ð0r-   N)r$   úMapping[str, Any]rm   rn   )r$   r   rm   r   ©rm   Úint©rm   zIterator[str]©r&   r   rm   r   )r5   r   rm   r   ©rm   r   )r&   r   r$   r   rm   r   ©rm   údict[str, Any])r"   rr   rs   rt   rI   Ústaticmethodr‡   rŠ   r�   r’   r–   r™   rœ   rŸ   rx   r3   r-   r,   rw   rw   ½   sK   „ ñó:ð òó ðó
,ó-ó<óIó-óEóJô1r-   rw   c                  ó  ‡ — e Zd ZdZdd„Zdd„Z	 	 	 	 dd„Zdd„Zdd„Zdd„Z	dd„Z
d d	„Zd!d
„Z	 	 	 	 d"d„Z	 	 	 	 d"d„Zed#d„«       Zed#d„«       Zdd„Zd$d„Zd%d„Zd%d„Zd&ˆ fd„Zd'd„Zd(d„Zd)d„Zd*d„Zd+d„Zd,d„Zd-d„Zd.d„Zˆ xZS )/ÚSecretsz”A dict-like class that stores secrets.
    Parses secrets.toml on-demand. Cannot be externally mutated.

    Safe to use from multiple threads.
    c                ó‚   — d | _         t        j                  «       | _        d| _        d | _        t        d¬«      | _        y )NFz4Emitted when a `secrets.toml` file has been changed.)Údoc)Ú_secretsÚ	threadingÚRLockÚ_lockÚ_file_watchers_installedÚ_programmatic_secretsr   Úfile_change_listenerrG   s    r,   rI   zSecrets.__init__ó   s7   € à26ˆŒÜ—_‘_Ó&ˆŒ
Ø(-ˆÔ%àHLˆÔ"ä$*ØFô%
ˆÕ!r-   c                óD   — 	 | j                  «        y# t        $ r Y yw xY w)a(  Load secrets.toml files from disk if they exists. If none exist,
        no exception will be raised. (If a file exists but is malformed,
        an exception *will* be raised.).

        Returns True if a secrets.toml file was successfully parsed, False otherwise.

        Thread-safe.
        TF)Ú_parser   rG   s    r,   Úload_if_toml_existszSecrets.load_if_toml_existsÿ   s%   € ð	Ø�K‰KŒMàøÜ+ò 	áð	ús   ‚ “	žc                 ó   — y)ziLeft in place for compatibility with integrations until integration
        code can be updated.
        Nr3   )rH   Ú!suppress_print_error_on_exceptions     r,   Ú%set_suppress_print_error_on_exceptionz-Secrets.set_suppress_print_error_on_exception  s   � r-   c                óè   — | j                   5  | j                  €
	 ddd«       y| j                  j                  «       D ]  \  }}| j                  ||«       Œ d| _        ddd«       y# 1 sw Y   yxY w)zyClear the secrets dictionary and remove any secrets that were
        added to os.environ.

        Thread-safe.
        N)r±   r®   r   Ú"_maybe_delete_environment_variable)rH   rz   r{   s      r,   Ú_resetzSecrets._reset  sp   € ð �Z‰Zñ 	!Ø�}‰}Ð$Ø÷	!ð 	!ð Ÿ™×+Ñ+Ó-ò >‘��1Ø×7Ñ7¸¸1Õ=ð>à ˆDŒM÷	!÷ 	!ñ 	!ús   �A(¤;A(Á(A1c                ój  — i }d}	 t        |d¬«      5 }|j                  «       }ddd«       d}ddl}	 |j	                  |j                  «      «       ||fS # 1 sw Y   Œ4xY w# t        $ r i dfcY S w xY w# t        |j                  f$ r'}t        j                  ||«      }t        |«      |‚d}~ww xY w)z9Parse a TOML file and return the secrets as a dictionary.Fúutf-8©ÚencodingNTr   )ÚopenÚreadÚFileNotFoundErrorÚtomlÚupdateÚloadsr    ÚTomlDecodeErrorru   rg   r   )	rH   r%   ÚsecretsÚfound_secrets_fileÚfÚsecrets_file_strrÅ   r=   Úmsgs	            r,   Ú_parse_toml_filezSecrets._parse_toml_file%  sÒ   € àˆØ"Ðð	Ü�d WÔ-ð ,°Ø#$§6¡6£8Ð ÷,ð "&Ðó
 	ð	<Ø�N‰N˜4Ÿ:™:Ð&6Ó7Ô8ð Ð*Ð*Ð*÷),ð ,ûô !ò 	à�u�9Òð	ûô ˜4×/Ñ/Ð0ò 	<ä/×VÑVØ˜"óð ô
 /¨sÓ3¸Ð;ûð	<ús>   †A# “A¤
A# ³ A6 ÁA ÁA# Á#A3Á2A3Á6B2Â"B-Â-B2c                óÄ  — i }d}t        j                  |«      D �]4  }t         j                  j                  ||«      }t         j                  j	                  |«      s t
        j                  |«      }t        |«      ‚i }t        j                  |«      D ]{  }t         j                  j                  ||«      }	t         j                  j	                  |	«      rŒCt        |	d¬«      5 }
|
j                  «       j                  «       ||<   d}ddd«       Œ} t        |«      dk(  r*|t        t        |j                  «       «      «         ||<   �Œ0|||<   �Œ7 ||fS # 1 sw Y   ŒËxY w)a  Parse a directory for secrets. Directory style can be used to support Kubernetes secrets that are
        mounted to folders.

        Example structure:
        - top_level_secret_folder
            - user_pass_secret (folder)
                - username (file), content: myuser
                - password (file), content: mypassword
            - my_plain_secret (folder)
                - regular_secret (file), content: mysecret

        See: https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/#create-a-pod-that-has-access-to-the-secret-data-through-a-volume
        And: https://docs.snowflake.com/en/developer-guide/snowpark-container-services/additional-considerations-services-jobs#passing-secrets-in-local-container-files
        Fr¿   rÀ   TNé   )ÚosÚlistdirr%   r:   Úisdirru   ri   r   rÂ   rÃ   Ústripr‰   ÚnextrŒ   Úkeys)rH   r%   rÉ   rÊ   Údirnamer?   Ú	error_msgÚsub_secretsÚfilenameÚ	file_pathrË   s              r,   Ú_parse_directoryzSecrets._parse_directoryA  s=  € ð #%ˆØ"Ðä—z‘z $Ó'ó 	/ˆGÜ Ÿg™gŸl™l¨4°Ó9ˆOÜ—7‘7—=‘= Ô1Ü;×fÑfØ#ó�	ô 3°9Ó=Ð=ØˆKäŸJ™J Ó7ò 	.�ÜŸG™GŸL™L¨¸(ÓC�	ô —7‘7—=‘= Ô+Øä˜)¨gÔ6ð .¸!Ø,-¯F©F«H¯N©NÓ,<�K Ñ)Ø)-Ð&÷.ð .ð	.ô �;Ó 1Ò$à#.¬t´D¸×9IÑ9IÓ9KÓ4LÓ/MÑ#N�˜Ó à#.�˜Ó ð1	/ð4 Ð*Ð*Ð*÷.ð .ús   Ã$$EÅEc                óæ   — |j                  d«      r| j                  |«      S t        j                  j	                  |«      r| j                  |«      S t        j                  |«      }t        |«      ‚)Nú.toml)	ÚendswithrÎ   rÑ   r%   rÓ   rÜ   ru   rk   r   )rH   r%   rØ   s      r,   Ú_parse_file_pathzSecrets._parse_file_patho  s`   € Ø�=‰=˜Ô!Ø×(Ñ(¨Ó.Ð.ä�7‰7�=‰=˜ÔØ×(Ñ(¨Ó.Ð.ä3×SÑSØó
ˆ	ô +¨9Ó5Ð5r-   c                ó  — | j                   }|�|S | j                  5  | j                   �| j                   cddd«       S i }t        j                  d«      }d}|D ]-  }| j	                  |«      \  }}|xs |}|j                  |«       Œ/ |s t        j                  |«      }t        |«      ‚|j                  «       D ]  \  }}	| j                  ||	«       Œ || _         | j                  «        | j                   cddd«       S # 1 sw Y   yxY w)züParse our secrets.toml files if they're not already parsed.
        This function is safe to call from multiple threads.

        Raises
        ------
            StreamlitSecretNotFoundError
            Raised if secrets.toml doesn't exist.

        Núsecrets.filesF)r®   r±   r   Ú
get_optionrà   rÆ   ru   re   r   r   Ú_maybe_set_environment_variableÚ_maybe_install_file_watchers)
rH   rÉ   r;   rÊ   r%   Úpath_secretsÚfound_secrets_file_in_pathrØ   rz   r{   s
             r,   r¶   zSecrets._parse{  s  € ð —-‘-ˆØÐØˆNà�Z‰Zñ 	!Ø�}‰}Ð(Ø—}‘}÷	!ñ 	!ð ˆGä×*Ñ*¨?Ó;ˆJØ!&ÐØ"ò -�Ø;?×;PÑ;PÐQUÓ;VÑ8�Ð8Ø%7Ò%UÐ;UÐ"Ø—‘˜|Õ,ð-ñ
 &ä3×PÑPØ"óð ô
 3°9Ó=Ð=àŸ™›ò ;‘��1Ø×4Ñ4°Q¸Õ:ð;ð $ˆDŒMØ×-Ñ-Ô/à—=‘=÷7	!÷ 	!ò 	!ús   �D¿B9DÄDc                ó8   — | j                  «       }t        |«      S )z‰Converts the secrets store into a nested dictionary, where nested AttrDict objects are
        also converted into dictionaries.
        )r¶   r|   )rH   rÉ   s     r,   rx   zSecrets.to_dict¨  s   € ð —+‘+“-ˆÜ Ó(Ð(r-   c                óž   — t        t        |«      «       | j                  5  || _        | j	                  |«       ddd«       y# 1 sw Y   yxY w)au  Merge programmatic secrets into the secrets store.

        Programmatic secrets are shallow-merged with file-based secrets at the
        top level: entire top-level keys are replaced, not individual nested keys.

        Parameters
        ----------
        programmatic_secrets
            A dictionary of secrets to merge. Supported value types are:
            ``str``, ``int``, ``float``, ``bool``, and nested ``dict``.

        Raises
        ------
        TypeError
            If any value in the dictionary has an unsupported type.

        Notes
        -----
        This method is intended to be called once during application startup,
        after file-based secrets have been loaded. It is thread-safe.

        Top-level ``str``, ``int``, and ``float`` values are promoted to
        ``os.environ`` (as strings), matching the behavior of file-based secrets.
        N)r#   r   r±   r³   Ú_apply_programmatic_secrets)rH   Úprogrammatic_secretss     r,   Úmerge_programmatic_secretsz"Secrets.merge_programmatic_secrets¯  sI   € ô8 	 ¤Ð%9Ó :Ô;à�Z‰Zñ 	Cà)=ˆDÔ&Ø×,Ñ,Ð-AÔB÷	C÷ 	Cñ 	Cús   ¡AÁAc                óú   — | j                   �t        | j                   «      ni }|j                  «       D ]>  \  }}||v r| j                  |||   «       t	        |«      ||<   | j                  ||«       Œ@ || _         y)a7  Apply programmatic secrets to the secrets store.

        This is an internal helper that merges the given programmatic secrets
        into `self._secrets`. It does NOT store them in `_programmatic_secrets`
        (that is the caller's responsibility).

        Must be called with `self._lock` held.
        N)r®   r   r   r¼   r
   rä   )rH   rë   Úcurrent_secretsr&   r$   s        r,   rê   z#Secrets._apply_programmatic_secretsÒ  s†   € ð $(§=¡=Ð#<ŒD�—‘ÔÀ"ð 	ð /×4Ñ4Ó6ò 
	=‰JˆC�à�oÑ%Ø×7Ñ7¸¸_ÈSÑ=QÔRô $,¨E£?ˆO˜CÑ ð ×0Ñ0°°eÕ<ð
	=ð (ˆ�r-   c                óz   — t        |«      }|t        t        t        hv rt        |«      t        j
                  | <   yy)zdAdd the given key/value pair to os.environ if the value
        is a string, int, or float.
        N)r!   r   r£   ÚfloatrÑ   Úenviron©rz   r{   Ú
value_types      r,   rä   z'Secrets._maybe_set_environment_variableð  s2   € ô
 ˜!“Wˆ
Øœ#œs¤EÐ*Ñ*Ü ›FŒB�J‰J�qŠMð +r-   c                ó¼   — t        |«      }|t        t        t        hv r>t        j
                  j                  | «      t        |«      k(  rt        j
                  | = yyy)ziRemove the given key/value pair from os.environ if the value
        is a string, int, or float.
        N)r!   r   r£   rð   rÑ   rñ   Úgetrò   s      r,   r¼   z*Secrets._maybe_delete_environment_variableù  sH   € ô
 ˜!“Wˆ
àœ#œs¤EÐ*Ñ*¬r¯z©z¯~©~¸aÓ/@ÄCÈÃFÒ/JÜ—
‘
˜1‘ð 0KÐ*r-   c                óà  — | j                   5  | j                  r
	 d d d «       y t        j                  d«      }|D ]�  }	 |j	                  d«      r7t
        j                  j                  j                  || j                  d¬«       n6t
        j                  j                  j                  || j                  d¬«       Œƒ d| _        d d d «       y # t        t        f$ r Y Œ¥w xY w# 1 sw Y   y xY w)Nrâ   rÞ   Úpoll)Úwatcher_typeT)r±   r²   r   rã   rß   Ú	streamlitÚwatcherÚpath_watcherÚ
watch_fileÚ_on_secrets_changedÚ	watch_dirr   rÄ   )rH   r;   r%   s      r,   rå   z$Secrets._maybe_install_file_watchers  sò   € Ø�Z‰Zñ 	1Ø×,Ò,Ø÷	1ð 	1ô  ×*Ñ*¨?Ó;ˆJØ"ò �ðØ—}‘} WÔ-Ü!×)Ñ)×6Ñ6×AÑAØ Ø ×4Ñ4Ø)/ð Bõ ô "×)Ñ)×6Ñ6×@Ñ@Ø Ø ×4Ñ4Ø)/ð Aô øðð, -1ˆDÔ)÷7	1ð 	1øô& 1Ô2CÐDò ñ ð	ú÷'	1ð 	1ús4   �C$¤C$¿A>CÂ=	C$ÃC!ÃC$Ã C!Ã!C$Ã$C-c                ó4  — | j                   5  t        j                  d|«       | j                  «        | j	                  «        | j
                  r| j                  | j
                  «       d d d «       | j                  j                  «        y # 1 sw Y   Œ$xY w)Nz!Secret path %s changed, reloading)	r±   r   Údebugr½   r¶   r³   rê   r´   Úsend)rH   Úchanged_file_paths     r,   rý   zSecrets._on_secrets_changed!  su   € Ø�Z‰Zñ 	MÜ�M‰MÐ=Ð?PÔQØ�K‰KŒMØ�K‰KŒMà×)Ò)Ø×0Ñ0°×1KÑ1KÔL÷	Mð 	×!Ñ!×&Ñ&Õ(÷	Mð 	Mús   �ABÂBc                ó²   — 	 | j                  «       |   }t        |t        «      s|S t        |«      S # t        t
        f$ r t        t        |«      «      ‚w xY w)z{Return the value with the given key. If no such key
        exists, raise an AttributeError.

        Thread-safe.
        )r¶   r   r   rw   r�   rÄ   r•   r   r‘   s      r,   r–   zSecrets.__getattr__.  s[   € ð	CØ—K‘K“M #Ñ&ˆEÜ˜e¤WÔ-Ø�Ü˜E“?Ð"øô Ô+Ð,ò 	CÜ Ô!<¸SÓ!AÓBÐBð	Cús   ‚$2 §
2 ²$Ac                ó¦   — 	 | j                  «       |   }t        |t        «      s|S t        |«      S # t        $ r t	        t        |«      «      ‚w xY w)ztReturn the value with the given key. If no such key
        exists, raise a KeyError.

        Thread-safe.
        )r¶   r   r   rw   r�   r�   r‘   s      r,   r’   zSecrets.__getitem__>  sP   € ð	<Ø—K‘K“M #Ñ&ˆEÜ˜e¤WÔ-Ø�Ü˜E“?Ð"øÜò 	<ÜÔ5°cÓ:Ó;Ð;ð	<ús   ‚$2 §
2 ²Ac                óD   •— |dv rt         ‰| �  ||«       y t        d«      ‚)N>   r±   r®   r·   r´   r³   r²   Ú"_suppress_print_error_on_exceptionrž   )ÚsuperrŸ   r    )rH   r&   r$   Ú	__class__s      €r,   rŸ   zSecrets.__setattr__L  s-   ø€ àð 
ñ 
ô ‰GÑ  UÕ+äÐLÓMÐMr-   c                óŠ   — t        j                  «       s| j                  j                  › S t	        | j                  «       «      S )zAA string representation of the contents of the dict. Thread-safe.)r   Úexistsr  r"   r˜   r¶   rG   s    r,   r™   zSecrets.__repr__[  s2   € ô �~‰~ÔØ—n‘n×-Ñ-Ð.Ð/Ü�D—K‘K“MÓ"Ð"r-   c                ó4   — t        | j                  «       «      S )z/The number of entries in the dict. Thread-safe.)r‰   r¶   rG   s    r,   rŠ   zSecrets.__len__e  s   € ä�4—;‘;“=Ó!Ð!r-   c                ó&   — || j                  «       v S ©z2True if the given key is in the dict. Thread-safe.©r¶   )rH   rz   s     r,   Úhas_keyzSecrets.has_keyi  s   € à�D—K‘K“MÐ!Ð!r-   c                ó>   — | j                  «       j                  «       S )z,A view of the keys in the dict. Thread-safe.)r¶   rÖ   rG   s    r,   rÖ   zSecrets.keysm  s   € à�{‰{‹}×!Ñ!Ó#Ð#r-   c                ó>   — | j                  «       j                  «       S )z.A view of the values in the dict. Thread-safe.)r¶   ÚvaluesrG   s    r,   r  zSecrets.valuesq  s   € à�{‰{‹}×#Ñ#Ó%Ð%r-   c                ó>   — | j                  «       j                  «       S )z7A view of the key-value items in the dict. Thread-safe.)r¶   r   rG   s    r,   r   zSecrets.itemsu  s   € à�{‰{‹}×"Ñ"Ó$Ð$r-   c                ó&   — || j                  «       v S r  r  rb   s     r,   Ú__contains__zSecrets.__contains__y  s   € à�d—k‘k“mÐ#Ð#r-   c                ó4   — t        | j                  «       «      S )z3An iterator over the keys in the dict. Thread-safe.)rŒ   r¶   rG   s    r,   r�   zSecrets.__iter__}  s   € ä�D—K‘K“MÓ"Ð"r-   rl   )rm   Úbool)r¹   r  rm   rn   )r%   r   rm   ztuple[Mapping[str, Any], bool])rm   r¡   r§   )rë   zMapping[str, SecretsValue]rm   rn   )rz   r   r{   r   rm   rn   )r  r   rm   rn   r¥   )r&   r   r$   r   rm   rn   r¦   r¢   )rz   r   rm   r  )rm   zKeysView[str])rm   zValuesView[Any])rm   zItemsView[str, Any])r&   r   rm   r  r¤   ) r"   rr   rs   rt   rI   r·   rº   r½   rÎ   rÜ   rà   r¶   rx   rì   rê   r©   rä   r¼   rå   rý   r–   r’   rŸ   r™   rŠ   r  rÖ   r  r   r  r�   Ú__classcell__)r  s   @r,   r«   r«   ì   sà   ø„ ñó

óð"Ø15ðà	óó!ó+ó8,+ó\
6ó+!óZ)ð!CØ$>ð!Cà	ó!CðF(Ø$>ð(à	ó(ð< ò#ó ð#ð òó ðó1ó<)óCó <õNó#ó"ó"ó$ó&ó%ó$÷#r-   r«   Úsecrets_singleton)r   )r$   r   r%   r   rm   rn   )ry   zMapping[str, Any] | AttrDictrm   r¨   ro   rp   )0Ú
__future__r   rÑ   r¯   Úcollections.abcr   r   r   r   r   r	   Úcopyr
   Útypingr   r   r   Úblinkerr   Ústreamlit.watcher.path_watcherrù   r   r   Ústreamlit.errorsr   r   Ústreamlit.loggerr   r"   r   Ú__annotations__r   r£   rð   r  r   r   Ú	frozensetr   r#   r/   ru   r|   r   r�   rw   r«   r  r3   r-   r,   ú<module>r$     sõ   ðö #ã 	Û ß X× XÝ ÷ñ õ ã %ß %ß SÝ 'á˜HÓ%€ˆÓ %ð �S‰y˜5Ñ  4Ñ'¨$¨s°NÐ/BÑ*CÑC€ñ 1:¸3ÀÀUÈDÐ:QÓ0RÐ Ð-Ó Rô!
÷HX.ñ X.ñv *=Ó)>Ð  Ó >óVóOóHô,1ˆw�s˜C�xÑ ô ,1ô^S#ˆg�c˜3�hÑô S#ñl #›9Ð �5Ô $r-   