
    ͆hV                       S SK Jr  S SKrS SKrS SKrS SKrS SKJrJrJ	r	J
r
JrJr  S SKJr  S SKJrJrJr  S SKrS SKrS SKrS SKrS SKrS SKJr  S SKJr  S SKJr  S S	KJr  S S
K J!r!J"r"J#r#J$r$J%r%  S SK&J'r'  \(       a  S SK(J)r*  S SK+J,r,  S SK-J.r.J/r/  S SKJ0r0  \Rb                  " \25      r3 " S S\5      r4 " S S\Rj                  Rl                  5      r7 " S S\Rj                  Rl                  5      r8 " S S\Rr                  Rt                  5      r; " S S\Rx                  Rx                  Rz                  5      r> " S S\Rj                  Rl                  5      r? " S S\R                  5      rAg)    )annotationsN)TYPE_CHECKINGAnyCallableIteratorMutableMappingSequence)unquote)urljoinurlsplit
urlunsplit)AMP_SUBSTITUTE)utils)StructureItem)get_toc)_removesuffixget_build_dateget_markdown_titlemetaweak_property)get_heading_text)ElementTree)MkDocsConfig)FileFiles)TableOfContentsc                     \ rS rSr% S.S jrS/S jrS	 rS\S
'    S\S'    S\S'    S\S'    \S0S j5       r	S\S'    S\S'    S\S'    \S/S j5       r
\
R                  S1S j5       r
\S/S j5       rS\S'    \S/S j5       rS\S'    S\S'    SrS\S'    SrS\S'    SrS\S '    SrS\S!'    S2S" jr  S3       S4S# jjrS5S$ jrS6S% jr\S7S& j5       rS8S' jrSrS(\S)'    SrS*\S+'    S9S, jrS-rg):Page#   
str | Nonefiler   Nonec                   Xl         X l        Ub  Xl        S U l        S U l        S U l        SU l        [        5       U l        U R                  UR                  SS 5      5        U R                  UR                  SS 5      UR                  S5      UR                  S5      5        S U l        S U l        S U l        / U l        0 U l        g )NFsite_urlrepo_urledit_uriedit_uri_template)pager!   titlechildrenprevious_page	next_pageactiver   update_date_set_canonical_urlget_set_edit_urlmarkdown_title_from_rendercontenttocr   )selfr)   r!   configs       N/opt/services/DDDS/venv/lib/python3.13/site-packages/mkdocs/structure/pages.py__init__Page.__init__$   s    		J ! . 0

:t <=JJz4(&**Z*@&**M`Ba	

 .2	    boolc                    [        XR                  5      =(       a9    U R                  UR                  :H  =(       a    U R                  UR                  :H  $ N)
isinstance	__class__r)   r!   )r6   others     r8   __eq__Page.__eq__>   s=    unn- (

ekk)(		UZZ'	
r;   c                    U R                   R                  nU R                  b  U R                  < OSnU R                  =(       d    U R                  R
                  nU SU SU< S3$ )Nz[blank]z(title=z, url=))r@   __name__r)   abs_urlr!   url)r6   namer)   rH   s       r8   __repr__Page.__repr__E   sV    ~~&&%)ZZ%;4::.ll+diimmwugVC7!44r;   r2   r4   r   r5   zMutableMapping[str, Any]r   c                @    U R                   R                  nUS;   a  gU$ )z6The URL of the page relative to the MkDocs `site_dir`.)../ )r!   rH   )r6   rH   s     r8   rH   Page.urlZ   s!     iimm+
r;   rG   canonical_urlc                    U R                   $ )zXWhen `True`, indicates that this page is the currently viewed page. Defaults to `False`.)_Page__activer6   s    r8   r-   Page.activeq   s     }}r;   c                t    [        U5      U l        U R                  b  [        U5      U R                  l        gg)z(Set active status of page and ancestors.N)r<   rS   parentr-   )r6   values     r8   r-   rU   v   s.     U;;"!%eDKK #r;   c                4    U R                   R                  S:H  $ )Nindex)r!   rI   rT   s    r8   is_indexPage.is_index}   s    yy~~((r;   edit_urlc                    U R                   =(       a,    U R                  =(       a    U R                  R                  S;   $ )zQEvaluates to `True` for the homepage of the site and `False` for all other pages.)rM   rN   z
index.html)is_top_levelr[   r!   rH   rT   s    r8   is_homepagePage.is_homepage   s,       aT]]atyy}}Ha7aar;   zPage | Noner+   r,   Nr*   F
is_sectionTis_pageis_linkc                    U(       aR  UR                  S5      (       d  US-  n[        XR                  5      =U l        n[	        U5      R
                  U l        g S U l        S U l        g N/)endswithr   rH   rQ   r   pathrG   )r6   baserQ   s      r8   r/   Page._set_canonical_url   sT    ==%%18xx1HHD#M277DL!%DDLr;   c                   U(       d  U(       d  S U l         g U R                  R                  nUc  S U l         g U(       a)  [        R                  " U5      S   nUR                  XES9nOUb  UR                  S5      (       d   eX$-   nU(       a2  UR                  S5      (       d  UR                  S5      (       d  US-  nOH [        U5      nUR                  (       a  UR                  (       d  [        R                  SU< S35        [        U=(       d    SU5      U l         g ! [         a&  n[        R                  SU< SU 35         S nANFS nAff = f)	Nr   )ri   
path_noextrg   )?#z
edit_uri: z; is not a valid URL, it should include the http:// (scheme)z is not a valid URL: rO   )r]   r!   r&   	posixpathsplitextformatrh   
startswithr   schemenetloclogwarning
ValueErrorr   )	r6   r%   r&   r'   src_urinoextfile_edit_uri
parsed_urles	            r8   r1   Page._set_edit_url   s0    ! DM))$$? DM&&w/2E-44'4TM'H,=,=c,B,BBB$.M ++J77@Q@QRU@V@VCT%m4
!((
0A0AKK$]$55pq  B>  Tj(99NqcRSSTs   AD# #
E-EEc                   UR                   R                  XS9nUc   U R                  R                  n[        R                  " U5      u  U l        U l	        g ! [         a.    [
        R                  SU R                  R                   35        e [         a.    [
        R                  SU R                  R                   35        e f = f)N)r(   r7   zFile not found: zEncoding error reading file: )pluginson_page_read_sourcer!   content_stringOSErrorrv   errorsrc_pathrx   r   get_datar2   )r6   r7   sources      r8   read_sourcePage.read_source   s    333M>11 $(==#8 ty  		,TYY-?-?,@AB 		9$)):L:L9MNOs   A A.Cc                :    [         R                  " S[        5        g )Nz@_set_title is no longer used in MkDocs and will be removed soon.)warningswarnDeprecationWarningrT   s    r8   
_set_titlePage._set_title   s    NPb	
r;   c                   U R                   c  gSU R                  ;   a  U R                  S   $ U R                  (       a  U R                  $ U R                  c  [	        U R                   5      nUb  U$ U R
                  (       a  gU R                  R                  R                  SS5      R                  SS5      nUR                  5       U:X  a  UR                  5       nU$ )ac  
Returns the title for the current page.

Before calling `read_source()`, this value is empty. It can also be updated by `render()`.

Checks these in order and uses the first that returns a valid title:

- value provided on init (passed in from config)
- value of metadata 'title'
- content of the first H1 in Markdown content
- convert filename to title
Nr)   Home- _)r2   r   r3   r4   r   r`   r!   rI   replacelower
capitalize)r6   title_from_mdr)   s      r8   r)   
Page.title   s     == dii99W%%""***\\!.t}}=M($$		&&sC088cB;;=E!$$&Er;   c                   U R                   c  [        S5      e[         R                  " US   US   =(       d    0 S9n[        5       nUR	                  U5        [        U R                  X!5      nUR	                  U5        [        U R                  X!5      nUR	                  U5        [        5       nUR	                  U5        UR                  U R                   5      U l
        [        [        US/ 5      5      U l        UR                  U l        UR                   UR                   -  U l        ["        R%                  5       [&        R(                  :  a  UR*                  U l        gg)z;Convert the Markdown source file to HTML as per the config.Nz4`markdown` field hasn't been set (via `read_source`)markdown_extensionsmdx_configs)
extensionsextension_configs
toc_tokens)r2   RuntimeErrorMarkdown_RawHTMLPreprocessor	_register_ExtractAnchorsTreeprocessorr!   _RelativePathTreeprocessor_ExtractTitleTreeprocessorconvertr4   r   getattrr5   r)   r3   present_anchor_idsrv   getEffectiveLevelloggingDEBUGlinks_to_anchors)r6   r7   filesmdraw_html_extextract_anchors_extrelative_path_extextract_title_exts           r8   renderPage.render  s(   == UVV34$]39r

 ,-r":499eT%%b)6tyy%P##B'68##B'zz$--072|R89"3"9"922\5T5TT 	   "W]]2$5$F$FD! 3r;   zset[str] | Noner   z!dict[File, dict[str, str]] | Noner   c                  U R                   (       d  g U R                   R                  5        H  u  p4UR                  5        H  u  pVUR                  nUc  M  UR                  c  M%  XWR                  ;   a  M6  SnX0R                  :X  a  Sn	UR                  S5      (       a  SnOSUR                   SU S3n	[        R                  USU R                  R                   S	U S
U	 SU 35        M     M     g )NrO   z$there is no such anchor on this pagezfnref:z6 This seems to be a footnote that is never referenced.z	the doc 'z' does not contain an anchor '#'
Doc file '' contains a link 'z', but rM   )r   itemsr(   r   r!   rs   ry   rv   )
r6   r   	log_levelto_filelinksanchororiginal_linkr(   contextproblems
             r8   validate_anchor_linksPage.validate_anchor_links0  s    $$"3399;NG).%||<**2444ii'DG((22"Z )'//)::YZ`YaabcG !2!2 33F}oU\]d\eefgnfop *7 <r;   )__activer3   rG   r-   rQ   r*   r4   r]   r!   r   r2   r   r,   r   r+   r)   r5   r.   )r)   r    r!   r   r7   r   returnr"   )r   r<   )r   str)rX   r<   )rj   r    r   r"   )NN)r%   r    r&   r    r'   r    r   r"   )r7   r   r   r"   r   r"   )r   r    )r7   r   r   r   r   r"   )r   r   r   intr   r"   )rF   
__module____qualname____firstlineno__r9   rB   rJ   __annotations__propertyrH   r-   setterr[   r`   r*   rb   rc   rd   r/   r1   r   r   r   r)   r   r   r   r   __static_attributes__ r;   r8   r   r   #   s   4
5 6$ 
H #"M  Jg'
 
   ]]- - ) )  b b H H HdKJfGTbGTc   $(,	#?#? #? &	#?
 
#?J9

 ! !FG> +/.M:>7>r;   r   c                  2    \ rS rSrSS jrSS jrS	S jrSrg)
r   iI  c                "    [        5       U l        g r>   )setr   r6   r!   r   r7   s       r8   r9   %_ExtractAnchorsTreeprocessor.__init__J  s    ,/Er;   c                   U R                   R                  nUR                  5        HW  nUR                  S5      =n(       a  U" U5        UR                  S:X  d  M5  UR                  S5      =n(       d  MO  U" U5        MY     g )NidarI   )r   additerr0   tag)r6   rootr   elementr   s        r8   run _ExtractAnchorsTreeprocessor.runM  se    %%))yy{G T**v*F{{c!$[[0060K #r;   c                :    UR                   R                  U SSS9  g )Nmkdocs_extract_anchors   prioritytreeprocessorsregisterr6   r   s     r8   r   &_ExtractAnchorsTreeprocessor._registerV  s    
""4)AA"Nr;   r   Nr!   r   r   r   r7   r   r   r"   )r   etree.Elementr   r"   r   markdown.Markdownr   r"   )rF   r   r   r   r9   r   r   r   r   r;   r8   r   r   I  s    2 Or;   r   c                  |    \ rS rSrS
S jrSS jr\SS j5       r\ S         SS jj5       rSS jr	SS jr
Srg	)r   iZ  c                6    Xl         X l        X0l        0 U l        g r>   )r!   r   r7   r   r   s       r8   r9   #_RelativePathTreeprocessor.__init__[  s    	
<>r;   c                    UR                  5        Hc  nUR                  S:X  a  SnOUR                  S:X  a  SnOM+  UR                  U5      nUc   eU R                  U5      nUR	                  X55        Me     U$ )z
Update urls on anchors and images to make them relative.

Iterates through the full document tree looking for specific
tags and then makes them relative based on the site navigation
r   hrefimgsrc)r   r   r0   path_to_urlr   )r6   r   r   keyrH   new_urls         r8   r   _RelativePathTreeprocessor.runa  st     yy{G{{c!%++c"C?"?&&s+GKK% # r;   c                    [         R                  " [         R                  " [         R                  " U5      U5      R	                  S5      5      $ rf   )rp   normpathjoindirnamelstrip)clsr   	dest_paths      r8   _target_uri&_RelativePathTreeprocessor._target_uriw  s9    !!NN9,,X6	BII#N
 	
r;   c              #  J  #    U R                  UR                  U5      nUv   [        R                  " U5      S:X  a  UR                  v   gU1nXPR                  UR                  U5      /nUS   US   :X  a  UR                  5         / nU(       a  UR                  S 5        [        R                  " U5      S   (       d$  UR                  S 5        UR                  S 5        UR                  S5      (       dE  UR                  S	5      (       d/  U(       d  UR                  S
5      (       d  UR                  S 5        U H\  n	U HS  n
[        R                  " U
" U	5      5      nX;  d  M&  UR                  S5      (       a  M>  Uv   UR                  U5        MU     M^     g7f)zfFirst yields the resolved file uri for the link, then proceeds to yield guesses for possible mistakes.rM   Nr      c                    U $ r>   r   ps    r8   <lambda>B_RelativePathTreeprocessor._possible_target_uris.<locals>.<lambda>  s    ar;   c                0    [         R                  " U S5      $ )Nzindex.mdrp   r   r  s    r8   r  r	    s    innQ
&Cr;   c                0    [         R                  " U S5      $ )Nz	README.mdr  r  s    r8   r  r	    s    innQ&Dr;   .mdrg   c                     [        U S5      S-   $ )Nz.htmlr  )r   r  s    r8   r  r	    s    mAw&?%&Gr;   z../)r  ry   rp   r   rH   popappendrq   rh   rs   r   )r   r!   ri   use_directory_urlssuggest_absolute
target_uritriedprefixessuffixesprefsufguesss               r8   _possible_target_uris0_RelativePathTreeprocessor._possible_target_uris}  sF    
 __T\\48
d#s*,,$ ?@A;(1+%LLN/1OOK(!!*-b1OOCDOODE##C((MM%((#4==+=+=OOGHD!**3t95%e.>.>u.E.EKIIe$	   s   E'F#-F#F#c                p	   [        U5      u  p#pEnS nSu  pU(       d  U(       a  U$ UR                  S5      (       a]  U R                  R                  R                  R
                  nU[        R                  La  UnSU R                  R                   SU S3n	OQ[        U;   a  U$ U(       d>  U(       a5  U R                  R                  U R                  0 5      R                  Xa5        U$ [        U5      nU R                  U R                  X@R                  R                  5      n
U	(       a  UnS nO&[!        U
5      nU R"                  R%                  U5      nUc  U	(       d  [&        R(                  " U5      S   (       dK  UcH  U R                  R                  R                  R*                  nSU R                  R                   SU S3n	OfXR-                  S5      :w  a  S	U S
3OSnU R                  R                  R                  R.                  nSU R                  R                   SU SU S3n	U	(       Ga3  U R                  R0                  R3                  5       (       a  [5        [6        R8                  U5      nU[6        R:                  :  a  SnU
 H  nU R"                  R%                  U5      c  M!  U(       a  X@R                  R                  :X  a  SnOCU[        R                  L a  SU-   nO*[<        R>                  " X@R                  R                  5      n[A        SSXEU45      n  O   SU;   a  SU;   a  SU;  a  SU 3nU(       a	  U	SU S3-  n	[B        RC                  X5        U$ Uc   eUc   eU(       a+  U R                  R                  U0 5      R                  Xa5        UR0                  R3                  5       (       a  U R                  R0                  R3                  5       (       a  [6        R:                  nOB[5        [6        R8                  U R                  R                  R                  R.                  5      nSU R                  R                   SU S3n	[B        RC                  X5        [<        R>                  " URD                  U R                  RD                  5      n[A        SSXEU45      $ )N)r   rO   )rg   \r   z' contains an absolute link 'z', it was left as is.r
  z*' contains an unrecognized relative link 'rg   z 'r   rO   r   z', but the targetz( is not found among documentation files.@rM   zmailto:z Did you mean 'z'?z' contains a link to 'z(' which is excluded from the built site.)#r   rs   r7   
validationr   absolute_links_AbsoluteLinksValidationValueRELATIVE_TO_DOCSr!   ry   r   r   
setdefault
urlunquoter  r  nextr   get_file_from_pathrp   rq   unrecognized_linksr   	not_found	inclusionis_excludedminr   INFOr   r   get_relative_urlr   rv   rH   )r6   rH   rt   ru   ri   queryr   absolute_linkwarning_levelrw   possible_target_urisr  target_filetargetsuggest_urls                  r8   r   &_RelativePathTreeprocessor.path_to_url  s   .6sm+V!& VJ^^K(( KK2288GGM$A$R$RR -&tyy'8'8&99VWZV[[pqs"J%%00B?JJ6WJ$#99IIt[[;; 
 JK 23J**77
CKw%%d+B/M4I $ 6 6 < < O O !2!2 33]^a]b c) * 
 0:ZZ_/L2j\+RT $ 6 6 < < F F !2!2 33Fse L%%+H,TV 
 yy""..00 #GLL- @ w}}, 0Dzz44T:F!dii.?.?&?#%D*.K.\.\\#&:D#(#9#9$		@Q@Q#RD&0"b$v1N&O 1 czcSjS^(/uoR@@GGGM+J%%%&&&!!,,["=HHU  ,,..yy""..00 ' #GLL$++2H2H2N2N2X2X YTYY../ 0<GI  GGM+%%kootyy}}E2r4788r;   c                >    UR                   R                  U SS5        g )Nrelpathr   r   r   s     r8   r   $_RelativePathTreeprocessor._register  s    
""4A6r;   )r7   r!   r   r   Nr   r   r   r   r   )r   r   r   r   r   r   )F)
r!   r   ri   r   r  r<   r  r<   r   zIterator[str])rH   r   r   r   r   )rF   r   r   r   r9   r   classmethodr  r  r   r   r   r   r;   r8   r   r   Z  sl    ?, 
 

 W\#%#%"#%8<#%PT#%	#% #%Ja9F7r;   r   c                  @   ^  \ rS rSrSU 4S jjrSS jrSS jrSrU =r$ )	r   i
  c                @   > [         TU ]  5         [        5       U l        g r>   superr9   r   r   r6   r@   s    r8   r9   _RawHTMLPreprocessor.__init__      ,/Er;   c                    [        5       nUR                  SR                  U5      5        UR                  5         UR                  U l        U$ )N
)_HTMLHandlerfeedr   closer   )r6   linesparsers      r8   r   _RawHTMLPreprocessor.run  s:    DIIe$%"(";";r;   c                :    UR                   R                  U SSS9  g )Nmkdocs_raw_html   r   )preprocessorsr   r   s     r8   r   _RawHTMLPreprocessor._register  s#    
!!#b 	" 	
r;   r   r   )rH  	list[str]r   rP  r   )	rF   r   r   r   r9   r   r   r   __classcell__r@   s   @r8   r   r   
  s    2
 
r;   r   c                  <   ^  \ rS rSrSU 4S jjrSU 4S jjrSrU =r$ )rE  i  c                @   > [         TU ]  5         [        5       U l        g r>   r>  r@  s    r8   r9   _HTMLHandler.__init__  rB  r;   c                   > U H6  u  p4US:X  d  US:X  d  M  US:X  d  M  U R                   R                  U5        M8     [        TU ]  X5      $ )Nr   rI   r   )r   r   r?  handle_starttag)r6   r   attrskvr@   s        r8   rW  _HTMLHandler.handle_starttag!  sH    DADyQ&[SCZ''++A.  w&s22r;   r   r   )r   r   rX  zSequence[tuple[str, str]]r   r"   )rF   r   r   r   r9   rW  r   rQ  rR  s   @r8   rE  rE    s    23 3r;   rE  c                  B    \ rS rSr% SrS\S'   S\S'   S
S jrSS jrS	rg)r   i(  Nr    r)   r   r   c                n    U H.  nUR                   S:X  a  [        X R                  5      U l          U$    U$ )Nh1)r   r   r   r)   )r6   r   els      r8   r   _ExtractTitleTreeprocessor.run,  s6    Bvv~-b'':
	  r;   c                F    Xl         UR                  R                  U SSS9  g )Nmkdocs_extract_titler  r   )r   r   r   r   s     r8   r   $_ExtractTitleTreeprocessor._register3  s#    
""4)?!"Lr;   )r   r)   r:  r   )	rF   r   r   r   r)   r   r   r   r   r   r;   r8   r   r   (  s    E:Mr;   r   c                      \ rS rSrSrSrg)r"  i8  r
  r   N)rF   r   r   r   r#  r   r   r;   r8   r"  r"  8  s    r;   r"  )B
__future__r   enumr   rp   r   typingr   r   r   r   r   r	   urllib.parser
   r%  r   r   r   r2   markdown.extensions.tocmarkdown.htmlparsermarkdown.postprocessorsmarkdown.treeprocessorsmarkdown.utilr   mkdocsr   mkdocs.structurer   mkdocs.structure.tocr   mkdocs.utilsr   r   r   r   r   mkdocs.utils.renderingr   	xml.etreer   etreemkdocs.config.defaultsr   mkdocs.structure.filesr   r   r   	getLoggerrF   rv   r   r   Treeprocessorr   r   rN  Preprocessorr   
htmlparser
HTMLParserrE  r   IntEnumr"  r   r;   r8   <module>r}     s   "     S S . 6 6      (  * ( _ _ 3.324 !c= cL	O8#:#:#H#H O"m7!8!8!F!F m7`
811>> 
$	38&&11<< 	3M!8!8!F!F M DLL r;   