
    ͆h                        S SK Jr  S SKrS SKrS SKrS SKJrJrJr  S SK	r	S SK
r
 S SK
Jr  S SKJrJr  S SKJr  S SKJr  \R*                  " \5      r " S	 S
\\\4   5      rg! \ a	    S SK
Jr   NEf = f)    )annotationsN)Any
CollectionMutableMapping)CSafeLoader)
SafeLoader)localizationutils)ValidationError)	templatesc                      \ rS rSr% Sr SSSSS.         SS	 jjjrS\S'   \SS
 j5       r\SS j5       r	\SS j5       r
S\S'   S\S'   SS jrS S jrS!S jrS!S jrS"S jrS rS rS#S jrS$S jrSrg)%Theme   a(  
A Theme object.

Args:
    name: The name of the theme as defined by its entrypoint.
    custom_dir: User defined directory for custom templates.
    static_templates: A list of templates to render as static pages.

All other keywords are passed as-is and made available as a key/value mapping.
N )
custom_dirstatic_templateslocalename
str | Noner   c                  Xl         X l        USS.nX`l        [        R                  R                  [        R                  R                  [        5      5      n[        R                  R                  US5      n[        [        R                  " U5      5      U l        / U l        Ub  U R                  R                  U5        U(       a  U R                  U5        U R                  R                  U5        U R                  R                  U5        UR                  U5        Uc  US   n[         R"                  " U5      US'   g )Nen)r   r   r   r   )r   _custom_dir_Theme__varsospathabspathdirname__file__joinsetlistdirr   dirsappend_load_theme_configupdater	   parse_locale)	selfr   r   r   r   user_config_varspackage_dirmkdocs_templatess	            D/opt/services/DDDS/venv/lib/python3.13/site-packages/mkdocs/theme.py__init__Theme.__init__#   s     	%)- > ggoobggooh&?@77<<[A #BJJ/?$@ A 	!IIZ(##D) 			)* 	$$%56[! >8_F&33F;h    c                    U S   $ )Nr   r   r'   s    r,   r   Theme.localeM   s    H~r/   c                    U R                   $ N)r   r1   s    r,   r   Theme.custom_dirQ   s    r/   c                P    [         R                  " S[        5        U R                  $ )NzEDo not access Theme._vars, instead access the keys of Theme directly.)warningswarnDeprecationWarningr   r1   s    r,   r)   Theme._varsU   s     S	
 {{r/   z	list[str]r"   zset[str]c                    SR                  U R                  R                  U R                  U R                  U R
                  SR                  S U R                  5        5       5      5      $ )Nz3{}(name={!r}, dirs={!r}, static_templates={!r}, {}), c              3  6   #    U  H  u  pU S U< 3v   M     g7f)=Nr   ).0kvs      r,   	<genexpr>!Theme.__repr__.<locals>.<genexpr>g   s     <|tq1QEl|s   )format	__class____name__r   r"   r   r   itemsr1   s    r,   __repr__Theme.__repr__a   sQ    DKKNN##IIII!!II<tzz|<<
 	
r/   c                     U R                   U   $ r4   r   r'   keys     r,   __getitem__Theme.__getitem__j   s    {{3r/   c                     X R                   U'   g r4   rK   )r'   rM   values      r,   __setitem__Theme.__setitem__m   s     Cr/   c                    U R                   U	 g r4   rK   rL   s     r,   __delitem__Theme.__delitem__p   s    KKr/   c                    XR                   ;   $ r4   rK   )r'   items     r,   __contains__Theme.__contains__s   s    {{""r/   c                ,    [        U R                  5      $ r4   )lenr   r1   s    r,   __len__Theme.__len__v   s    4;;r/   c                ,    [        U R                  5      $ r4   )iterr   r1   s    r,   __iter__Theme.__iter__y   s    DKK  r/   c           
     r   [         R                  " U5      n[         R                  R                  5         U R                  R                  U5         [        R                  R                  US5      n[        US5       n[        R                  " U[        5      nSSS5        Wc  0 n[        R                  SU SU SU 35        UR#                  S	S5      =n(       aN  [         R$                  " 5       nXx;  a#  [!        SU S
U SSR                  U5       35      eU R'                  U5        U R(                  R+                  UR#                  S/ 5      5        U R,                  R+                  U5        g! , (       d  f       N= f! [         a)  n[        R                  U5        [!        SU S35      eSnAff = f)z-Recursively load theme and any parent themes.zmkdocs_theme.ymlrbNzThe theme 'za' does not appear to have a configuration file. Please upgrade to a current version of the theme.z Loaded theme configuration for 'z' from 'z': extendsz' inherits from 'zN', which does not appear to be installed. The available installed themes are: r<   r   )r
   get_theme_dir
get_themescache_clearr"   r#   r   r   r   openyamlloadr   OSErrorlogdebugr   popget_theme_namesr$   r   r%   r   )	r'   r   	theme_dir	file_pathftheme_configeparent_themethemess	            r,   r$   Theme._load_theme_config|   s   ''-	$$&		#		Y0BCIi&!#yyJ7 ' L		4TF(9+SQ]P^_`'++It<<<<**,F)%!$'8 G;;?99V;L:MO  ##L1$$\%5%56H"%MN<(1 '& 	IIaL!dV $D E 	s6   ,F =E2F 2
F <F  F 
F6$F11F6c                :   [         R                  " U R                  5      n[         R                  " USS9n[        R
                  UR                  S'   [        R                  UR                  S'   [        R                  " X R                  U R                  5        U$ )z)Return a Jinja environment for the theme.F)loaderauto_reloadurl
script_tag)jinja2FileSystemLoaderr"   Environmentr   
url_filterfiltersscript_tag_filterr	   install_translationsr   )r'   rz   envs      r,   get_envTheme.get_env   sm    ((3  EB&11E$-$?$?L!))#{{DIIF
r/   )__varsr   r"   r   r   r4   )
r   r   r   r   r   zCollection[str]r   r   returnNone)r   zlocalization.Locale)r   r   )r   zdict[str, Any])r   str)rM   r   r   r   )rM   r   )rX   objectr   bool)r   r   r   r   )r   zjinja2.Environment)rF   
__module____qualname____firstlineno____doc__r-   __annotations__propertyr   r   r)   rH   rN   rR   rU   rY   r]   ra   r$   r   __static_attributes__r   r/   r,   r   r      s    	  &< "&,.!&<&< 	&<
 *&< &< 
&<P         O
 !# ! )Dr/   r   )
__future__r   loggingr   r7   typingr   r   r   r~   rj   r   r   ImportErrormkdocsr	   r
   mkdocs.config.baser   mkdocs.utilsr   	getLoggerrF   rm   r   r   r   r/   r,   <module>r      sk    "  	  2 2   . ' . "!ON38$ O    s   A# #A21A2