Ë
    úmxi[  ã                  ó\   — d dl mZ d dlmZmZ erd dlmZ d dlmZ d dl	m
Z
  G d„ d«      Zy)	é    )Úannotations)ÚTYPE_CHECKINGÚAny)ÚMutableMapping)ÚPath)ÚComponentManifestc                  óD   — e Zd ZdZdd„Z	 	 	 	 	 	 d	d„Zd
d„Zdd„Zdd„Zy)ÚComponentManifestHandlerzEHandles component registration from parsed ComponentManifest objects.c                ó    — i | _         i | _        y )N)Ú	_metadataÚ_asset_roots©Úselfs    úi/home/htdocs/ttos/venv/lib/python3.12/site-packages/streamlit/components/v2/component_manifest_handler.pyÚ__init__z!ComponentManifestHandler.__init__   s   € àACˆŒà79ˆÕó    c                óÚ   — |j                   }i }|j                  D ]M  }|j                   }|› d|› �}|j                  |«      }|�|| j                  |<   d|i||<   || j                  |<   ŒO |S )af  Process a manifest and return component definitions to register.

        Parameters
        ----------
        manifest : ComponentManifest
            The manifest to process
        package_root : Path
            The package root directory

        Returns
        -------
        dict[str, dict[str, Any]]
            Dictionary mapping component names to their definitions

        Raises
        ------
        StreamlitComponentRegistryError
            If a declared ``asset_dir`` does not exist, is not a directory, or
            resolves (after following symlinks) outside of ``package_root``.
        ú.Úname)r   Ú
componentsÚresolve_asset_rootr   r   )	r   ÚmanifestÚpackage_rootÚ	base_nameÚcomponent_definitionsÚcomp_configÚ	comp_nameÚcomponent_nameÚ
asset_roots	            r   Úprocess_manifestz)ComponentManifestHandler.process_manifest#   s™   € ð. —M‘Mˆ	Ø "Ðð $×.Ñ.ò 	6ˆKØ#×(Ñ(ˆIà )˜{¨!¨I¨;Ð7ˆNð %×7Ñ7¸ÓEˆJØÐ%Ø4>�×!Ñ! .Ñ1ð ˜ð5Ð! .Ñ1ð
 .6ˆD�N‰N˜>Ò*ð#	6ð& %Ð$r   c                ó8   — | j                   j                  |«      S )aP  Get metadata for a specific component.

        Parameters
        ----------
        component_name : str
            Fully-qualified component name (e.g., ``"package.component"``).

        Returns
        -------
        ComponentManifest | None
            The manifest that declared this component, or ``None`` if unknown.
        )r   Úget©r   r   s     r   Úget_metadataz%ComponentManifestHandler.get_metadataS   s   € ð �~‰~×!Ñ! .Ó1Ð1r   c                ó8   — | j                   j                  |«      S )a_  Get the absolute asset root directory for a component if declared.

        Parameters
        ----------
        component_name : str
            Fully-qualified component name (e.g. "package.component").

        Returns
        -------
        Path | None
            Absolute path to the component's asset root if present, otherwise None.
        )r   r"   r#   s     r   Úget_asset_rootz'ComponentManifestHandler.get_asset_rootb   s   € ð × Ñ ×$Ñ$ ^Ó4Ð4r   c                ó,   — t        | j                  «      S )zöGet a mapping of component names to their asset root directories.

        Returns
        -------
        dict[str, Path]
            A shallow copy mapping fully-qualified component names to absolute
            asset root directories.
        )Údictr   r   s    r   Úget_asset_watch_rootsz.ComponentManifestHandler.get_asset_watch_rootsq   s   € ô �D×%Ñ%Ó&Ð&r   N)ÚreturnÚNone)r   r   r   r   r*   zdict[str, dict[str, Any]])r   Ústrr*   zComponentManifest | None)r   r,   r*   zPath | None)r*   zdict[str, Path])	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r    r$   r&   r)   © r   r   r
   r
      s7   „ ÙOó:ð.%Ø)ð.%Ø9=ð.%à	"ó.%ó`2ó5ô	'r   r
   N)Ú
__future__r   Útypingr   r   Úcollections.abcr   Úpathlibr   Ú(streamlit.components.v2.manifest_scannerr   r
   r1   r   r   ú<module>r7      s%   ðõ #ç %áÝ.ÝåJ÷`'ò `'r   