
    ͆h                        S r SSKJr  SSKJrJrJr   " S S\5      rSS jr " S S	5      r	 " S
 S\\	   5      r
SS jrg)a  
Deals with generating the per-page table of contents.

For the sake of simplicity we use the Python-Markdown `toc` extension to
generate a list of dicts for each toc item, and then store it as AnchorLinks to
maintain compatibility with older versions of MkDocs.
    )annotations)IterableIterator	TypedDictc                  >    \ rS rSr% S\S'   S\S'   S\S'   S\S'   S	rg
)	_TocToken   intlevelstridnamelist[_TocToken]children N)__name__
__module____qualname____firstlineno____annotations____static_attributes__r       L/opt/services/DDDS/venv/lib/python3.13/site-packages/mkdocs/structure/toc.pyr   r      s    JG
Ir   r   TableOfContentsc                    U  Vs/ s H  n[        U5      PM     nn[        U5      (       a
  SUS   l        [        U5      $ s  snf )NTr   )_parse_toc_tokenlenactiver   )
toc_tokensitocs      r   get_tocr"      s@    (2
3
1A
C
3
3xxA3	 4s   Ac                  t    \ rS rSr% SrSS jrS\S'    \SS j5       rS\S'    S	\S
'    SS jr	SSS jjr
Srg)
AnchorLink   z(A single entry in the table of contents.titler   r   r
   c                <    XUsU l         U l        U l        / U l        g N)r&   r   r   r   )selfr&   r   r   s       r   __init__AnchorLink.__init__   s    */U'
DGTZr   c                     SU R                   -   $ )z0The hash fragment of a URL pointing to the item.#)r   r)   s    r   urlAnchorLink.url&   s     TWW}r   list[AnchorLink]r   c                "    U R                  5       $ r(   )indent_printr.   s    r   __str__AnchorLink.__str__1   s      ""r   c                    SU-  nU U R                    SU R                   S3nU R                   H  nX4R                  US-   5      -  nM     U$ )Nz    z - 
   )r&   r/   r   r3   )r)   depthindentretitems        r   r3   AnchorLink.indent_print4   sS    %Cz4MMD$$UQY//C "
r   )r   r   r   r&   N)r&   r   r   r   r   r
   returnNoner>   r   )r   )r9   r
   r>   r   )r   r   r   r   __doc__r*   r   propertyr/   r4   r3   r   r   r   r   r$   r$      sH    2 J(  J+)# r   r$   c                  @    \ rS rSrSrS	S jrS
S jrSS jrSS jrSr	g)r   <   z2Represents the table of contents for a given page.c                    Xl         g r(   items)r)   rG   s     r   r*   TableOfContents.__init__?   s    
r   c                ,    [        U R                  5      $ r(   )iterrG   r.   s    r   __iter__TableOfContents.__iter__B   s    DJJr   c                ,    [        U R                  5      $ r(   )r   rG   r.   s    r   __len__TableOfContents.__len__E   s    4::r   c                2    SR                  S U  5       5      $ )N c              3  8   #    U  H  n[        U5      v   M     g 7fr(   )r   ).0r<   s     r   	<genexpr>*TableOfContents.__str__.<locals>.<genexpr>I   s     2TTs4yyTs   )joinr.   s    r   r4   TableOfContents.__str__H   s    ww2T222r   rF   N)rG   r1   r>   r?   )r>   zIterator[AnchorLink])r>   r
   r@   )
r   r   r   r   rA   r*   rK   rN   r4   r   r   r   r   r   r   <   s    < 3r   c                    [        U S   U S   U S   5      nU S    H'  nUR                  R                  [        U5      5        M)     U$ )Nr   r   r   r   )r$   r   appendr   )tokenanchorr    s      r   r   r   L   sH    fuT{E'NCF:/23 Mr   N)r   r   r>   r   )rZ   r   r>   r$   )rA   
__future__r   typingr   r   r   r   r"   r$   r   r   r   r   r   <module>r^      sG    # 0 0	   @3hz* 3 r   