+
    VBi{9                       R t ^ RIHt Rt^ RIt^ RIHu Ht R<t	  ! R R]P                  4      t ! R R]4      t ! R R	]4      t ! R
 R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R  R!]4      t ! R" R#]4      t ! R$ R%]4      t ! R& R']4      t ! R( R)]4      t ! R* R+]4      t ! R, R-]4      t ! R. R/]4      t  ! R0 R1]4      t! ! R2 R3]4      t" ! R4 R5] 4      t# ! R6 R7]4      t$ ! R8 R9]4      t% ! R: R;]4      t&R# )=ah  MathML element classes based on `xml.etree`.

The module is intended for programmatic generation of MathML
and covers the part of `MathML Core`_ that is required by
Docutil's *TeX math to MathML* converter.

This module is PROVISIONAL:
the API is not settled and may change with any minor Docutils version.

.. _MathML Core: https://www.w3.org/TR/mathml-core/
)annotationsreStructuredTextNc                     a  ] tR t^<tRtRt Rt R V 3R llt]R 4       t	R R lt
R R	 ltR
 V 3R lltR V 3R lltR tR tV 3R ltR tRR ltR tRR R lltR R ltRR ltRtV ;t# )MathElementzBase class for MathML elements.Nc                   V ^8  d   QhRR/#    returnNone )formats   "H/usr/lib/python3.14/site-packages/docutils/utils/math/mathml_elements.py__annotate__MathElement.__annotate__E   s      4     c                  < VP                  4        UUu/ uF%  w  r4VP                  4       V P                  V4      bK'  	  ppp\        SV `  ! V P
                  P                  3/ VB  V P                  V4       R# u uppi )a  Set up node with `children` and `attributes`.

Attribute names are normalised to lowercase.
You may use "CLASS" to set a "class" attribute.
Attribute values are converted to strings
(with True -> "true" and False -> "false").

>>> math(CLASS='test', level=3, split=True)
math(class='test', level='3', split='true')
>>> math(CLASS='test', level=3, split=True).toxml()
'<math class="test" level="3" split="true"></math>'

N)itemslowera_strsuper__init__	__class____name__extend)selfchildren
attributeskvattribr   s   &*,   r   r   MathElement.__init__E   sh     8B7G7G7IJ7Itq!'')TZZ]*7IJ00;F;H Ks   +A;c                	v    \        V \        4      '       d   \        V 4      P                  4       # \        V 4      # N)
isinstanceboolstrr   )r   s   &r   r   MathElement.a_strW   s*     aq6<<>!1vr   c                   V ^8  d   QhRR/# r   r	   r%   r   )r   s   "r   r   r   ^   s     
0 
0# 
0r   c                4   V  Uu. uF  p\        V4      NK  	  ppV P                  '       d%   VP                  \        V P                  4      4       V P                  V P                  P                  8w  d   VP                  RV P                   24       \        V RR4      '       d   VP                  R4       Y P                  4        UUu. uF  w  r4Vf   K  V RV: 2NK  	  upp,          pV P                   RRP                  V4       R2# u upi u uppi )	z"Return full string representation.z
nchildren=switchNzswitch=True=(, ))	reprtextappend	nchildrenr   getattrr   tagjoin)r   childargsr   r   s   &    r   __repr__MathElement.__repr__^   s    )-.U.999KKTYY(>>T^^555KK*T^^$45644((KK&**,H,$!!A3au,HH((1TYYt_-Q// / Is   DDDc                   V ^8  d   QhRR/# r(   r   )r   s   "r   r   r   j   s     % % %r   c                    V P                   '       d   \        V P                   4      pMRP                  R V  4       4      pV P                   RV R2# )z/Return concise, informal string representation.r-   c              3  &   "   T F  q x  K	  	  R # 5ir"   r   ).0r6   s   & r   	<genexpr>&MathElement.__str__.<locals>.<genexpr>o   s     :TEwZTs   r,   r.   )r0   r/   r5   r4   )r   r7   s   & r   __str__MathElement.__str__j   sC    999		?D99:T::D((1TF!$$r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   r   s     , , ,r   c                	D   < \         SV `  WP                  V4      4       R # r"   )r   setr   )r   keyvaluer   s   &&&r   rD   MathElement.setr   s    CE*+r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r   u   s     ( ( (r   c                	n  < V P                   ^ 8X  d   \        RV  R24      h\        V\        4      '       d   Wn        MgV P                   '       dG   \        V 4      \        V4      ,           V P                   8  d   \        RV  RV P                    R24      hV F	  pWn        K  	  \        SV `  W4       R# )    	Element "z" does not take children.z" takes only 	 childrenN)r2   	TypeErrorr#   r   parentlenr   __setitem__)r   rE   rF   er   s   &&& r   rP   MathElement.__setitem__u   s    >>Qiv-FGHHe[))L~~~#d)c%j"84>>"I)D6t~~>N +!, - - C'r   c                ^    V P                   RJ;'       d    \        V 4      V P                   8  # )z;Return boolean indicating whether children may be appended.N)r2   rO   r   s   &r   is_fullMathElement.is_full   s&    ~~T)IIc$i4>>.IIr   c                    \        V 4      V n        V P                  pVe%   VP                  4       '       d   VP                  pK(  V# )z:Close element and return first non-full anchestor or None.)rO   r2   rN   rU   )r   rN   s   & r   closeMathElement.close   s6    T V^^%5%5]]Fr   c                  < V P                  4       '       d8   V P                  '       d   RV P                   R2pMRp\        RV  RV R24      h\        SV `  V4       Wn        V P                  4       '       d   V P                  4       # V # )a$  Append `element` and return new "current node" (insertion point).

Append as child element and set the internal `parent` attribute.

If self is already full, raise TypeError.

If self is full after appending, call `self.close()`
(returns first non-full anchestor or None) else return `self`.
ztakes only rL   zdoes not take childrenrK   z" .)rU   r2   rM   r   r1   rN   rX   )r   elementstatusr   s   && r   r1   MathElement.append   sx     <<>>~~~&t~~&6i@1ivRxq9::w<<>>::<r   c                >    T pV F  pV P                  V4      pK  	  V# )zYSequentially append `elements`. Return new "current node".

Raise TypeError if overfull.
)r1   )r   elementscurrent_noder\   s   &&  r   r   MathElement.extend   s'    
 G;;w/L  r   c                	    W,          pW V# r"   r   )r   indexr\   s   && r   popMathElement.pop   s    +Kr   c                    V P                  R4      f    V P                  P                  4       # V P                  R4      R8H  #   \         d     R# i ; i)zReturn True, if `self` or an ancestor has ``display='block'``.

Used to find out whether we are in inline vs. displayed maths.
displayFblock)getrN   in_blockAttributeErrorrT   s   &r   rk   MathElement.in_block   sU    
 88I&{{++-- xx	"g-- " s   A AAc                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r      s     & & &r   c                4    \         P                  ! WV4       R# )zFormat XML output with indents.

Use with care:
  Formatting whitespace is permanently added to the
  `text` and `tail` attributes of `self` and anchestors!
N)ETindent)r   spacelevels   &&&r   
indent_xmlMathElement.indent_xml   s     			$u%r   c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   r      s     
) 
)d 
)r   c                (   V P                  4        F}  p\        V\        4      '       g2   VP                  '       d    VP                  P	                  4       Vn        VP
                  '       g   K^  VP
                  P	                  4       Vn        K  	  R# )zStrip whitespace at the end of `text` and `tail` attributes...

to revert changes made by the `indent_xml()` method.
Use with care, trailing whitespace from the original may be lost.
N)iterr#   	MathTokenr0   rstriptail)r   rQ   s   & r   unindent_xmlMathElement.unindent_xml   sT     Aa++vvv	 r   c                    \         P                  ! Y;'       g    RRR7      p VP                  RR4      pV#   \         d&    TP                  RP	                  T4      R4      p T# i ; i)a  Return an XML representation of the element.

By default, the return value is a `str` instance. With an explicit
`encoding` argument, the result is a `bytes` instance in the
specified encoding. The XML default encoding is UTF-8, any other
encoding must be specified in an XML document header.

Name and encoding handling match `xml.dom.minidom.Node.toxml()`
while `etree.Element.tostring()` returns `bytes` by default.
unicodeF)short_empty_elementsu   ⁡z&ApplyFunction;s   &ApplyFunction;)rp   tostringreplacerM   encode)r   encodingxmls   && r   toxmlMathElement.toxml   so     kk$ 5 5I/46	M++h(9:C 
  	M++hooh79KLC
	Ms   8 ,A('A()r2   ))z  rJ   r"   )r   
__module____qualname____firstlineno____doc__r2   rN   r   staticmethodr   r8   r@   rD   rP   rU   rX   r1   r   re   rk   rt   r|   r   __static_attributes____classcell__r   s   @r   r   r   <   s    )I-F- $  
0%, ,( (J,

.&
) r   r   c                      ] tR t^tRtRtR# )MathRowz:Base class for elements treating content as a single mrow.r   Nr   r   r   r   r   r   r   r   r   r   r      s    Dr   r   c                  B   a  ] tR t^tRt^tR V 3R lltV 3R ltRtV ;t	# )
MathSchemazBase class for schemata expecting 2 or more children.

The special attribute `switch` indicates that the last two child
elements are in reversed order and must be switched before XML-export.
See `msub` for an example.
c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   MathSchema.__annotate__  s     . .t .r   c                	V   < VP                  R R4      V n        \        SV `  ! V/ VB  R# )r*   FN)re   r*   r   r   )r   r   kwargsr   s   &*,r   r   MathSchema.__init__  s'    jj51(-f-r   c                   < \         SV `  V4      pV P                  '       d7   V P                  4       '       d!   V R,          V R,          uV R&   V R&   RV n        V# )z2Append element. Normalize order and close if full.Fr   )r   r1   r*   rU   )r   r\   ra   r   s   && r   r1   MathSchema.append  sM    w~g.;;;4<<>>!%b48DHd2hDKr   )r*   )
r   r   r   r   r   r2   r   r1   r   r   r   s   @r   r   r      s#     I. . r   r   c                  6   a  ] tR tRtRt^ tR V 3R lltRtV ;t# )ry   i  z_Token Element: contains textual data instead of children.

Expect text data on initialisation.
c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   MathToken.__annotate__  s      d r   c                	   < \         SV `  ! R/ VB  \        V\        \        P
                  34      '       g   \        R V R24      h\        V4      V n        R# )z0MathToken element expects `str` or number, not "z".Nr   )r   r   r#   r%   numbersNumber
ValueErrorr0   )r   r0   r   r   s   &&,r   r   MathToken.__init__  sR    &:&$gnn 566 &&*V2/ 0 0I	r   )r0   )	r   r   r   r   r   r2   r   r   r   r   s   @r   ry   ry     s     I r   ry   c                      ] tR tRtRtRtR# )mathi%  z8Top-level MathML element, a single mathematical formula.r   Nr   r   r   r   r   r   %  s    Br   r   c                      ] tR tRtRtRtR# )mtexti,  z*Arbitrary text with no notational meaning.r   Nr   r   r   r   r   r   ,  s    4r   r   c                      ] tR tRtRtRtR# )mii0  zCIdentifier, such as a function name, variable or symbolic constant.r   Nr   r   r   r   r   r   0  s    Mr   r   c                      ] tR tRtRtRtR# )mni4  zNumeric literal.

>>> mn(3.41).toxml()
'<mn>3.41</mn>'

Normally a sequence of digits with a possible separator (a dot or a comma).
(Values with comma must be specified as `str`.)
r   Nr   r   r   r   r   r   4  s    r   r   c                      ] tR tRtRtRtR# )moi?  zOperator, Fence, Separator, or Accent.

>>> mo('<').toxml()
'<mo>&lt;</mo>'

Besides operators in strict mathematical meaning, this element also
includes "operators" like parentheses, separators like comma and
semicolon, or "absolute value" bars.
r   Nr   r   r   r   r   r   ?  s    r   r   c                      ] tR tRtRt^ tRtR# )mspaceiK  zBlank space, whose size is set by its attributes.

Takes additional attributes `depth`, `height`, `width`.
Takes no children and no text.

See also `mphantom`.
r   Nr   r   r   r   r   r2   r   r   r   r   r   r   K  s     Ir   r   c                  8   a  ] tR tRtRtR R ltV 3R ltRtV ;t# )mrowiY  zqGeneric element to group children as a horizontal row.

Removed on closing if not required (see `mrow.close()`).
c                   V ^8  d   QhRR/# r   r   )r   s   "r   r   mrow.__annotate___  s      D r   c                ,   RRRR/pV P                  4        Fy  w  r4VR9   d]   V'       dU   VP                  V4      '       d>   W#,          P                  VP                  V4      P                  W#,          4      V34      pVP	                  W44       K{  	  R# )zTransfer attributes from self to other.

"List values" (class, style) are appended to existing values,
other values replace existing values.
class stylez; N)r   r   )r   rj   r5   rz   rD   )r   other
delimitersr   r   s   &&   r   transfer_attributesmrow.transfer_attributes_  sw     sGT2
JJLDA&&199Q<<"**1,,Z];Q?AAIIaO !r   c                
  < V P                   pVeN   \        V 4      ^8X  d>   V ^ ,          p W!\        V4      P                  V 4      &   Wn         T P                  T4       \        SV `!  4       #   \        \
        3 d     R# i ; i)zlClose element and return first non-full anchestor or None.

Remove <mrow> if it has only one child element.
N)	rN   rO   listrd   rl   r   r   r   rX   )r   rN   r6   r   s   &  r   rX   
mrow.closem  s}    
 #d)q.GE38tF|))$/0% $$U+w} #J/ s   "A- -BBr   )	r   r   r   r   r   r   rX   r   r   r   s   @r   r   r   Y  s    
 r   r   c                      ] tR tRtRtRtR# )mfraci  zAFractions or fraction-like objects such as binomial coefficients.r   Nr   r   r   r   r   r     s    Kr   r   c                      ] tR tRtRt^tRtR# )msqrti  zSquare root. See also `mroot`.r   Nr   r   r   r   r   r     s
    (Ir   r   c                      ] tR tRtRtRtR# )mrooti  z/Roots with an explicit index. See also `msqrt`.r   Nr   r   r   r   r   r         9r   r   c                      ] tR tRtRtRtR# )mstylei  zStyle Change.

In modern browsers, <mstyle> is equivalent to an <mrow> element.
However, <mstyle> may still be relevant for compatibility with
MathML implementations outside browsers.
r   Nr   r   r   r   r   r     s    r   r   c                      ] tR tRtRtRtR# )merrori  z#Display contents as error messages.r   Nr   r   r   r   r   r     s    -r   r   c                      ] tR tRtRt^tRtR# )menclosei  zRenders content inside an enclosing notation...

... specified by the notation attribute.

Non-standard but still required by Firefox for boxed expressions.
r   Nr   r   r   r   r   r     s     Ir   r   c                      ] tR tRtRtRtR# )mpaddedi  zAdjust space around content.r   Nr   r   r   r   r   r     s    &r   r   c                      ] tR tRtRt^tRtR# )mphantomi  z8Placeholder: Rendered invisibly but dimensions are kept.r   Nr   r   r   r   r   r     s
    BIr   r   c                      ] tR tRtRtRtR# )msubi  z$Attach a subscript to an expression.r   Nr   r   r   r   r   r     s    .r   r   c                      ] tR tRtRtRtR# )msupi  z&Attach a superscript to an expression.r   Nr   r   r   r   r   r     s    0r   r   c                      ] tR tRtRt^tRtR# )msubsupi  z;Attach both a subscript and a superscript to an expression.r   Nr   r   r   r   r   r     s
    EIr   r   c                      ] tR tRtRtRtR# )munderi  z0Attach an accent or a limit under an expression.r   Nr   r   r   r   r   r     s    :r   r   c                      ] tR tRtRtRtR# )moveri  z/Attach an accent or a limit over an expression.r   Nr   r   r   r   r   r     r   r   r   c                      ] tR tRtRtRtR# )
munderoveri  z;Attach accents or limits both under and over an expression.r   Nr   r   r   r   r   r     s    Er   r   c                      ] tR tRtRtRtR# )mtablei  zTable or matrix element.r   Nr   r   r   r   r   r     s    "r   r   c                      ] tR tRtRtRtR# )mtri  zRow in a table or a matrix.r   Nr   r   r   r   r   r         %r   r   c                      ] tR tRtRtRtR# )mtdi  zCell in a table or a matrixr   Nr   r   r   r   r   r     r   r   r   )r   dirdisplaystyleidnoncescriptlevelr   tabindex)'r   
__future__r   __docformat__r   xml.etree.ElementTreeetreeElementTreerp   GLOBAL_ATTRIBUTESElementr   r   r   ry   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   <module>r      s  
 #"  " " l"** lpEk E 2 $C7 C5I 5N N 	 	[ #7 #LLJ LG 
:J :W .W .w 'g '
w /: /1: 1j $;T ;:D :F F#[ #&' &&' &r   