ó
    ‰*£h	  ã                  óü   • S r SSKJr  SSKJrJrJrJr  SSKJ	r	  SSK
JrJr  \(       a  SSKJr  \	R                  " 5       r\	R"                  " SSS	9r\R'                  \5        SS
 jrSS jr  S       SS jjrg)zXML parser for python-docx.é    )Úannotations)ÚTYPE_CHECKINGÚDictÚTypeÚcast)Úetree)ÚNamespacePrefixedTagÚnsmap)ÚBaseOxmlElementTF)Úremove_blank_textÚresolve_entitiesc                óL   • [        S[        R                  " U [        5      5      $ )z«Root lxml element obtained by parsing XML character string `xml`.

The custom parser is used, so custom element classes are produced for elements in
`xml` that have them.
r   )r   r   Ú
fromstringÚoxml_parser)Úxmls    ÚM/home/mande/repo/quber/.venv/lib/python3.13/site-packages/docx/oxml/parser.pyÚ	parse_xmlr      s   € ô Ð!¤5×#3Ò#3°C¼Ó#EÓFÐFó    c                ój   • U R                  S5      u  p#[        R                  [        U   5      nXU'   g)zãRegister an lxml custom element-class to use for `tag`.

A instance of `cls` to be constructed when the oxml parser encounters an element
with matching `tag`. `tag` is a string of the form `nspfx:tagroot`, e.g.
`'w:document'`.
Ú:N)ÚsplitÚelement_class_lookupÚget_namespacer
   )ÚtagÚclsÚnspfxÚtagrootÚ	namespaces        r   Úregister_element_clsr       s/   € ð —Y‘Y˜s“^�N€EÜ$×2Ñ2´5¸±<Ó@€IØˆgÒr   Nc                ór   • [        U 5      nUc  UR                  n[        R                  UR                  XS9$ )aL  Return a 'loose' lxml element having the tag specified by `nsptag_str`.

The tag in `nsptag_str` must contain the standard namespace prefix, e.g. `a:tbl`.
The resulting element is an instance of the custom element class for this tag name
if one is defined. A dictionary of attribute values may be provided as `attrs`; they
are set if present. All namespaces defined in the dict `nsdecls` are declared in the
element using the key as the prefix and the value as the namespace name. If
`nsdecls` is not provided, a single namespace declaration is added based on the
prefix on `nsptag_str`.
)Úattribr
   )r	   r
   r   ÚmakeelementÚ
clark_name)Ú
nsptag_strÚattrsÚnsdeclsÚnsptags       r   ÚOxmlElementr(   ,   s8   € ô " *Ó-€FØ�Ø—,‘,ˆÜ×"Ñ" 6×#4Ñ#4¸UÐ"ÐRÐRr   )r   zstr | bytesÚreturnz'BaseOxmlElement')r   Ústrr   zType['BaseOxmlElement'])NN)r$   r*   r%   úDict[str, str] | Noner&   r+   r)   z BaseOxmlElement | etree._Element)Ú__doc__Ú
__future__r   Útypingr   r   r   r   Úlxmlr   Údocx.oxml.nsr	   r
   Údocx.oxml.xmlchemyr   ÚElementNamespaceClassLookupr   Ú	XMLParserr   Úset_element_class_lookupr   r   r(   © r   r   Ú<module>r6      s�   ðñ "å "ç 2Ó 2å ç 4æÝ2ð ×8Ò8Ó:Ð Ø�oŠo°ÀuÑM€Ø × $Ñ $Ð%9Ô :ôGô	ð $(Ø%)ðSØðSà ðSð #ðSð &ö	Sr   