HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/sphinx/domains/__pycache__/citation.cpython-310.pyc
o

�$�a��@sdZddlmZmZmZmZmZmZmZm	Z	ddl
mZddlm
Z
ddlmZddlmZddlmZddlmZdd	lmZdd
lmZmZer\ddlmZddlmZdd
lm Z e�!e"�Z#Gdd�de�Z$Gdd�de�Z%Gdd�de�Z&dddee'effdd�Z(dS)z�
    sphinx.domains.citation
    ~~~~~~~~~~~~~~~~~~~~~~~

    The citation domain.

    :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
�)�
TYPE_CHECKING�Any�Dict�List�Optional�Set�Tuple�cast)�nodes)�Element)�pending_xref)�Domain)�__)�SphinxTransform)�logging)�copy_source_info�make_refnode)�Sphinx)�Builder)�BuildEnvironmentc@seZdZdZdZdZddiZedee	e
e	e	efffdd��Zedee	e
e	ffdd	��Zd
e	ddfdd
�Zdee	deddfdd�Zdejddfdd�Zdeddfdd�Zd%dd�Zddde	ddde	de	ded edeefd!d"�Zddde	ddde	ded edee
e	effd#d$�ZdS)&�CitationDomainzDomain for citations.�citation�refzcitation not found: %(target)s�returncC�|j�di�S)N�	citations��data�
setdefault��self�r!�9/usr/lib/python3/dist-packages/sphinx/domains/citation.pyr*�zCitationDomain.citationscCr)N�
citation_refsrrr!r!r"r$.r#zCitationDomain.citation_refs�docnameNcCspt|j���D]\}\}}}||kr|j|=qt|j���D]\}}||hkr,|j|=q||vr5|�|�qdS)N)�listr�itemsr$�remove)r r%�key�fn�_l�lineno�docnamesr!r!r"�	clear_doc2s�


��zCitationDomain.clear_docr-�	otherdatacCsr|d��D]\}}|d|vr||j|<q|d��D]\}}|j�|t��}|D]}||vr5|�|�q*qdS)Nrrr$)r'rr$r�set�add)r r-r/r)rr$r%r!r!r"�merge_domaindata<s
�
���zCitationDomain.merge_domaindata�nodecCsh|d��}||jvr#|j�|j|d�}tjtd�|||ddd�|d|dd|jf|j|<dS)Nrz+duplicate citation %s, other instance in %srr)�location�type�subtyper%�ids)�astextr�env�doc2path�logger�warningr�line)r r3�label�pathr!r!r"�
note_citationGs
�"zCitationDomain.note_citationcCs&|j�|dt��}|�|jj�dS)N�	reftarget)r$rr0r1r9r%)r r3r-r!r!r"�note_citation_referenceOsz&CitationDomain.note_citation_referencecCsD|j��D]\}\}}}||jvrtjtd�|dd||fd�qdS)Nz Citation [%s] is not referenced.rr)r5r6r4)rr'r$r;r<r)r �namer%�labelidr,r!r!r"�check_consistencySs

���z CitationDomain.check_consistencyr9r�fromdocname�builderr�typ�target�contnodecCs,|j�|d�\}}	}
|sdSt||||	|�S)N)�rKr)r�getr)r r9rFrGrHrIr3rJr%rDr,r!r!r"�resolve_xrefYs�zCitationDomain.resolve_xrefc	Cs,|�|||d|||�}|durgSd|fgS)Nr)rM)r r9rFrGrIr3rJ�refnoder!r!r"�resolve_any_xrefcs
zCitationDomain.resolve_any_xref)rN)�__name__�
__module__�__qualname__�__doc__rCr>�dangling_warnings�propertyr�strr�intrrr$r.rr2r
rr@rrBrErrrMrOr!r!r!r"r sF�"

����
�
����rc@�&eZdZdZdZdeddfdd�ZdS)�CitationDefinitionTransformz3Mark citation definition labels as not smartquoted.�k�kwargsrNcKsXtt|j�d��}|j�tj�D]}|jj|d<|�	|�ttj
|d�}d|d<qdS)Nrr%rF�support_smartquotes)r	rr9�
get_domain�document�traverser
rr%r@r>)r r[�domainr3r>r!r!r"�applyqs

�z!CitationDefinitionTransform.apply�rPrQrRrS�default_priorityrrar!r!r!r"rYmsrYc@rX)�CitationReferenceTransformz|
    Replace citation references by pending_xref nodes before the default
    docutils transform tries to resolve them.
    rZr[rNc
Ks�tt|j�d��}|j�tj�D]1}|��}t	|dd|dd|d|�
dg�d�}|t�|d|�7}t||�|�
|�|�|�qdS)	NrrTFr7�classes)�	refdomain�reftyperA�refwarnr\r7rez[%s])r	rr9r]r^r_r
�citation_referencer8rrL�inliner�replace_selfrB)r r[r`r3rIrr!r!r"ra�s
�

�z CitationReferenceTransform.applyrbr!r!r!r"rd}srd�apprrcCs,|�t�|�t�|�t�ddddd�S)N�builtin�T)�version�env_version�parallel_read_safe�parallel_write_safe)�
add_domainr�
add_transformrYrd)rlr!r!r"�setup�s


�ruN))rS�typingrrrrrrrr	�docutilsr
�docutils.nodesr�sphinx.addnodesr�sphinx.domainsr
�
sphinx.localer�sphinx.transformsr�sphinx.utilr�sphinx.util.nodesrr�sphinx.applicationr�sphinx.buildersr�sphinx.environmentr�	getLoggerrPr;rrYrdrVrur!r!r!r"�<module>s&(

M