@korbiniankuhn/markdown-slides 1.0.0-rc.2 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- (()=>{var t,e,s={981(t,e){"use strict";function s(t,e){return void 0===e&&(e=Object),e&&"function"==typeof e.getOwnPropertyDescriptors&&(t=e.create(null,e.getOwnPropertyDescriptors(t))),e&&"function"==typeof e.freeze?e.freeze(t):t}function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var n=s({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0});var r=s({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});var o=s({script:!1,style:!1,textarea:!0,title:!0});function a(t){return t===l.HTML}var l=s({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),h=Object.keys(l).map(function(t){return l[t]});var c=s({HTML:"http://www.w3.org/1999/xhtml",SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});e.assign=function(t,e){if(null===t||"object"!=typeof t)throw new TypeError("target is not an object");for(var s in e)i(e,s)&&(t[s]=e[s]);return t},e.find=function(t,e,s){if(void 0===s&&(s=Array.prototype),t&&"function"==typeof s.find)return s.find.call(t,e);for(var n=0;n<t.length;n++)if(i(t,n)){var r=t[n];if(e.call(void 0,r,n,t))return r}},e.freeze=s,e.HTML_BOOLEAN_ATTRIBUTES=n,e.HTML_RAW_TEXT_ELEMENTS=o,e.HTML_VOID_ELEMENTS=r,e.hasDefaultHTMLNamespace=function(t){return a(t)||t===l.XML_XHTML_APPLICATION},e.hasOwn=i,e.isHTMLBooleanAttribute=function(t){return i(n,t.toLowerCase())},e.isHTMLRawTextElement=function(t){var e=t.toLowerCase();return i(o,e)&&!o[e]},e.isHTMLEscapableRawTextElement=function(t){var e=t.toLowerCase();return i(o,e)&&o[e]},e.isHTMLMimeType=a,e.isHTMLVoidElement=function(t){return i(r,t.toLowerCase())},e.isValidMimeType=function(t){return h.indexOf(t)>-1},e.MIME_TYPE=l,e.NAMESPACE=c},985(t,e,s){"use strict";var i=s(981),n=s(553),r=s(918),o=s(334),a=s(309),l=n.DOMImplementation,h=i.hasDefaultHTMLNamespace,c=i.isHTMLMimeType,d=i.isValidMimeType,u=i.MIME_TYPE,p=i.NAMESPACE,m=r.ParseError,f=a.XMLReader;function g(t){return t.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028\u2029]/g,"\n")}function b(t){if(void 0===(t=t||{}).locator&&(t.locator=!0),this.assign=t.assign||i.assign,this.domHandler=t.domHandler||E,this.onError=t.onError||t.errorHandler,t.errorHandler&&"function"!=typeof t.errorHandler)throw new TypeError("errorHandler object is no longer supported, switch to onError!");t.errorHandler&&t.errorHandler("warning","The `errorHandler` option has been deprecated, use `onError` instead!",this),this.normalizeLineEndings=t.normalizeLineEndings||g,this.locator=!!t.locator,this.xmlns=this.assign(Object.create(null),t.xmlns)}function E(t){var e=t||{};this.mimeType=e.mimeType||u.XML_APPLICATION,this.defaultNamespace=e.defaultNamespace||null,this.cdata=!1,this.currentElement=void 0,this.doc=void 0,this.locator=void 0,this.onError=e.onError}function x(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}function y(t,e,s){return"string"==typeof t?t.substr(e,s):t.length>=e+s||e?new java.lang.String(t,e,s)+"":t}function N(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}b.prototype.parseFromString=function(t,e){if(!d(e))throw new TypeError('DOMParser.parseFromString: the provided mimeType "'+e+'" is not valid.');var s=this.assign(Object.create(null),this.xmlns),n=o.XML_ENTITIES,r=s[""]||null;h(e)?(n=o.HTML_ENTITIES,r=p.HTML):e===u.XML_SVG_IMAGE&&(r=p.SVG),s[""]=r,s.xml=s.xml||p.XML;var a=new this.domHandler({mimeType:e,defaultNamespace:r,onError:this.onError}),l=this.locator?{}:void 0;this.locator&&a.setDocumentLocator(l);var c=new f;return c.errorHandler=a,c.domBuilder=a,!i.isHTMLMimeType(e)&&"string"!=typeof t&&c.errorHandler.fatalError("source is not a string"),c.parse(this.normalizeLineEndings(String(t)),s,n),a.doc.documentElement||c.errorHandler.fatalError("missing root element"),a.doc},E.prototype={startDocument:function(){var t=new l;this.doc=c(this.mimeType)?t.createHTMLDocument(!1):t.createDocument(this.defaultNamespace,"")},startElement:function(t,e,s,i){var n=this.doc,r=n.createElementNS(t,s||e),o=i.length;N(this,r),this.currentElement=r,this.locator&&x(this.locator,r);for(var a=0;a<o;a++){t=i.getURI(a);var l=i.getValue(a),h=(s=i.getQName(a),n.createAttributeNS(t,s));this.locator&&x(i.getLocator(a),h),h.value=h.nodeValue=l,r.setAttributeNode(h)}},endElement:function(t,e,s){this.currentElement=this.currentElement.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var s=this.doc.createProcessingInstruction(t,e);this.locator&&x(this.locator,s),N(this,s)},ignorableWhitespace:function(t,e,s){},characters:function(t,e,s){if(t=y.apply(this,arguments)){if(this.cdata)var i=this.doc.createCDATASection(t);else i=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(i):/^\s*$/.test(t)&&this.doc.appendChild(i),this.locator&&x(this.locator,i)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){t&&(t.lineNumber=0),this.locator=t},comment:function(t,e,s){t=y.apply(this,arguments);var i=this.doc.createComment(t);this.locator&&x(this.locator,i),N(this,i)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,s,i){var n=this.doc.implementation;if(n&&n.createDocumentType){var r=n.createDocumentType(t,e,s,i);this.locator&&x(this.locator,r),N(this,r),this.doc.doctype=r}},reportError:function(t,e){if("function"==typeof this.onError)try{this.onError(t,e,this)}catch(s){throw new m("Reporting "+t+' "'+e+'" caused '+s,this.locator)}else console.error("[xmldom "+t+"]\t"+e,function(t){if(t)return"\n@#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}(this.locator))},warning:function(t){this.reportError("warning",t)},error:function(t){this.reportError("error",t)},fatalError:function(t){throw this.reportError("fatalError",t),new m(t,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(t){E.prototype[t]=function(){return null}}),e.__DOMHandler=E,e.DOMParser=b,e.normalizeLineEndings=g,e.onErrorStopParsing=function(t){if("error"===t)throw"onErrorStopParsing"},e.onWarningStopParsing=function(){throw"onWarningStopParsing"}},553(t,e,s){"use strict";var i=s(981),n=i.find,r=i.hasDefaultHTMLNamespace,o=i.hasOwn,a=i.isHTMLMimeType,l=i.isHTMLRawTextElement,h=i.isHTMLVoidElement,c=i.MIME_TYPE,d=i.NAMESPACE,u=Symbol(),p=s(918),m=p.DOMException,f=p.DOMExceptionName,g=s(112);function b(t){if(t!==u)throw new TypeError("Illegal constructor")}function E(t){return""!==t}function x(t,e){return o(t,e)||(t[e]=!0),t}function y(t){if(!t)return[];var e=function(t){return t?t.split(/[\t\n\f\r ]+/).filter(E):[]}(t);return Object.keys(e.reduce(x,{}))}function N(t){if(!g.QName_exact.test(t))throw new m(m.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+t+'"')}function T(t,e){N(e),t=t||null;var s=null,n=e;if(e.indexOf(":")>=0){var r=e.split(":");s=r[0],n=r[1]}if(null!==s&&null===t)throw new m(m.NAMESPACE_ERR,"prefix is non-null and namespace is null");if("xml"===s&&t!==i.NAMESPACE.XML)throw new m(m.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if(("xmlns"===s||"xmlns"===e)&&t!==i.NAMESPACE.XMLNS)throw new m(m.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(t===i.NAMESPACE.XMLNS&&"xmlns"!==s&&"xmlns"!==e)throw new m(m.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return[t,s,n]}function v(t,e){for(var s in t)o(t,s)&&(e[s]=t[s])}function L(t,e){var s=t.prototype;if(!(s instanceof e)){function i(){}i.prototype=e.prototype,v(s,i=new i),t.prototype=s=i}s.constructor!=t&&("function"!=typeof t&&console.error("unknown Class:"+t),s.constructor=t)}var C={},R=C.ELEMENT_NODE=1,I=C.ATTRIBUTE_NODE=2,S=C.TEXT_NODE=3,A=C.CDATA_SECTION_NODE=4,w=C.ENTITY_REFERENCE_NODE=5,O=C.ENTITY_NODE=6,M=C.PROCESSING_INSTRUCTION_NODE=7,D=C.COMMENT_NODE=8,k=C.DOCUMENT_NODE=9,P=C.DOCUMENT_TYPE_NODE=10,B=C.DOCUMENT_FRAGMENT_NODE=11,j=C.NOTATION_NODE=12,_=i.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function F(t,e){if(e.length<t.length)return F(e,t);var s=null;for(var i in t){if(t[i]!==e[i])return s;s=t[i]}return s}function U(t){return t.guid||(t.guid=Math.random()),t.guid}function H(){}function W(t,e){this._node=t,this._refresh=e,V(this)}function V(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!==e){var s=t._refresh(t._node);if(wt(t,"length",s.length),!t.$$length||s.length<t.$$length)for(var i=s.length;i in t;i++)o(t,i)&&delete t[i];v(s,t),t._inc=e}}function q(){}function X(t,e){for(var s=0;s<t.length;){if(t[s]===e)return s;s++}}function z(t,e,s,i){if(i?e[X(e,i)]=s:(e[e.length]=s,e.length++),t){s.ownerElement=t;var n=t.ownerDocument;n&&(i&&tt(n,t,i),function(t,e,s){t&&t._inc++;var i=s.namespaceURI;i===d.XMLNS&&(e._nsMap[s.prefix?s.localName:""]=s.value)}(n,t,s))}}function G(t,e,s){var i=X(e,s);if(i>=0){for(var n=e.length-1;i<=n;)e[i]=e[++i];if(e.length=n,t){var r=t.ownerDocument;r&&tt(r,t,s),s.ownerElement=null}}}function J(){}function K(t){b(t)}function $(t){return("<"==t?"&lt;":">"==t&&"&gt;")||"&"==t&&"&amp;"||'"'==t&&"&quot;"||"&#"+t.charCodeAt()+";"}function Y(t,e){Q(t,null,{enter:function(t){return!e(t)||Q.STOP}})}function Q(t,e,s){for(var i=[{node:t,context:e,phase:Q.ENTER}];i.length>0;){var n=i.pop();if(n.phase===Q.ENTER){var r=s.enter(n.node,n.context);if(r===Q.STOP)return Q.STOP;if(i.push({node:n.node,context:r,phase:Q.EXIT}),null==r)continue;for(var o=n.node.lastChild;o;)i.push({node:o,context:r,phase:Q.ENTER}),o=o.previousSibling}else s.exit&&s.exit(n.node,n.context)}}function Z(t,e){b(t);var s=e||{};this.ownerDocument=this,this.contentType=s.contentType||c.XML_APPLICATION,this.type=a(this.contentType)?"html":"xml"}function tt(t,e,s,i){t&&t._inc++,s.namespaceURI===d.XMLNS&&delete e._nsMap[s.prefix?s.localName:""]}function et(t,e,s){if(t&&t._inc){t._inc++;var i=e.childNodes;if(s&&!s.nextSibling)i[i.length++]=s;else{for(var n=e.firstChild,r=0;n;)i[r++]=n,n=n.nextSibling;i.length=r,delete i[i.length]}}}function st(t,e){if(t!==e.parentNode)throw new m(m.NOT_FOUND_ERR,"child's parent is not parent");var s=e.previousSibling,i=e.nextSibling;return s?s.nextSibling=i:t.firstChild=i,i?i.previousSibling=s:t.lastChild=s,et(t.ownerDocument,t),e.parentNode=null,e.previousSibling=null,e.nextSibling=null,e}function it(t){return t&&t.nodeType===K.DOCUMENT_TYPE_NODE}function nt(t){return t&&t.nodeType===K.ELEMENT_NODE}function rt(t){return t&&t.nodeType===K.TEXT_NODE}function ot(t,e){var s=t.childNodes||[];if(n(s,nt)||it(e))return!1;var i=n(s,it);return!(e&&i&&s.indexOf(i)>s.indexOf(e))}function at(t,e){var s=t.childNodes||[];if(n(s,function(t){return nt(t)&&t!==e}))return!1;var i=n(s,it);return!(e&&i&&s.indexOf(i)>s.indexOf(e))}function lt(t,e,s){if(!function(t){return t&&(t.nodeType===K.DOCUMENT_NODE||t.nodeType===K.DOCUMENT_FRAGMENT_NODE||t.nodeType===K.ELEMENT_NODE)}(t))throw new m(m.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+t.nodeType);if(s&&s.parentNode!==t)throw new m(m.NOT_FOUND_ERR,"child not in parent");if(!function(t){return t&&(t.nodeType===K.CDATA_SECTION_NODE||t.nodeType===K.COMMENT_NODE||t.nodeType===K.DOCUMENT_FRAGMENT_NODE||t.nodeType===K.DOCUMENT_TYPE_NODE||t.nodeType===K.ELEMENT_NODE||t.nodeType===K.PROCESSING_INSTRUCTION_NODE||t.nodeType===K.TEXT_NODE)}(e)||it(e)&&t.nodeType!==K.DOCUMENT_NODE)throw new m(m.HIERARCHY_REQUEST_ERR,"Unexpected node type "+e.nodeType+" for parent node type "+t.nodeType)}function ht(t,e,s){var i=t.childNodes||[],r=e.childNodes||[];if(e.nodeType===K.DOCUMENT_FRAGMENT_NODE){var o=r.filter(nt);if(o.length>1||n(r,rt))throw new m(m.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(1===o.length&&!ot(t,s))throw new m(m.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(nt(e)&&!ot(t,s))throw new m(m.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(it(e)){if(n(i,it))throw new m(m.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=n(i,nt);if(s&&i.indexOf(a)<i.indexOf(s))throw new m(m.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!s&&a)throw new m(m.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}function ct(t,e,s){var i=t.childNodes||[],r=e.childNodes||[];if(e.nodeType===K.DOCUMENT_FRAGMENT_NODE){var o=r.filter(nt);if(o.length>1||n(r,rt))throw new m(m.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(1===o.length&&!at(t,s))throw new m(m.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(nt(e)&&!at(t,s))throw new m(m.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(it(e)){function l(t){return it(t)&&t!==s}if(n(i,l))throw new m(m.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=n(i,nt);if(s&&i.indexOf(a)<i.indexOf(s))throw new m(m.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}function dt(t,e,s,i){lt(t,e,s),t.nodeType===K.DOCUMENT_NODE&&(i||ht)(t,e,s);var n=e.parentNode;if(n&&n.removeChild(e),e.nodeType===B){var r=e.firstChild;if(null==r)return e;var o=e.lastChild}else r=o=e;var a=s?s.previousSibling:t.lastChild;r.previousSibling=a,o.nextSibling=s,a?a.nextSibling=r:t.firstChild=r,null==s?t.lastChild=o:s.previousSibling=o;do{r.parentNode=t}while(r!==o&&(r=r.nextSibling));return et(t.ownerDocument||t,t,e),e.nodeType==B&&(e.firstChild=e.lastChild=null),e}function ut(t){b(t),this._nsMap=Object.create(null)}function pt(t){b(t),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}function mt(t){b(t)}function ft(t){b(t)}function gt(t){b(t)}function bt(t){b(t)}function Et(t){b(t)}function xt(t){b(t)}function yt(t){b(t)}function Nt(t){b(t)}function Tt(t){b(t)}function vt(t){b(t)}function Lt(){}function Ct(t){var e;e="function"==typeof t?{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:t}:null!=t?{requireWellFormed:!!t.requireWellFormed,splitCDATASections:!1!==t.splitCDATASections,nodeFilter:t.nodeFilter||null}:{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};var s=[],i=this.nodeType===k&&this.documentElement||this,n=i.prefix,r=i.namespaceURI;if(r&&null==n&&null==(n=i.lookupPrefix(r)))var o=[{namespace:r,prefix:null}];return St(this,s,o,e),s.join("")}function Rt(t,e,s){var i=t.prefix||"",n=t.namespaceURI;if(!n)return!1;if("xml"===i&&n===d.XML||n===d.XMLNS)return!1;for(var r=s.length;r--;){var o=s[r];if(o.prefix===i)return o.namespace!==n}return!0}function It(t,e,s){t.push(" ",e,'="',s.replace(/[<>&"\t\n\r]/g,$),'"')}function St(t,e,s,i){s||(s=[]);var n=i.nodeFilter,r=i.requireWellFormed,o=i.splitCDATASections,a="html"===(t.nodeType===k?t:t.ownerDocument).type;Q(t,{ns:s},{enter:function(t,s){var c=s.ns;if(n){if(!(t=n(t)))return null;if("string"==typeof t)return e.push(t),null}switch(t.nodeType){case R:var u=t.attributes,p=u.length,b=t.tagName,E=b;if(!a&&!t.prefix&&t.namespaceURI){for(var x,y=0;y<u.length;y++)if("xmlns"===u.item(y).name){x=u.item(y).value;break}if(!x)for(var N=c.length-1;N>=0;N--){if(""===(T=c[N]).prefix&&T.namespace===t.namespaceURI){x=T.namespace;break}}if(x!==t.namespaceURI)for(N=c.length-1;N>=0;N--){var T;if((T=c[N]).namespace===t.namespaceURI){T.prefix&&(E=T.prefix+":"+b);break}}}e.push("<",E);for(var v=c.slice(),L=0;L<p;L++){"xmlns"==(C=u.item(L)).prefix?v.push({prefix:C.localName,namespace:C.value}):"xmlns"==C.nodeName&&v.push({prefix:"",namespace:C.value})}for(L=0;L<p;L++){var C;if(Rt(C=u.item(L),0,v)){var O=C.prefix||"",j=C.namespaceURI;It(e,O?"xmlns:"+O:"xmlns",j),v.push({prefix:O,namespace:j})}var _=n?n(C):C;_&&("string"==typeof _?e.push(_):It(e,_.name,_.value))}if(b===E&&Rt(t,0,v)){var F=t.prefix||"";j=t.namespaceURI;It(e,F?"xmlns:"+F:"xmlns",j),v.push({prefix:F,namespace:j})}var U=!t.firstChild;if(U&&(a||t.namespaceURI===d.HTML)&&(U=h(b)),U)return e.push("/>"),null;if(e.push(">"),a&&l(b)){for(var H=t.firstChild;H;)H.data?e.push(H.data):St(H,e,v.slice(),i),H=H.nextSibling;return e.push("</",E,">"),null}return{ns:v,tag:E};case k:case B:if(r&&t.nodeType===k&&null==t.documentElement)throw new m("The Document has no documentElement",f.InvalidStateError);return{ns:c};case I:return It(e,t.name,t.value),null;case S:if(r&&g.InvalidChar.test(t.data))throw new m("The Text node data contains characters outside the XML Char production",f.InvalidStateError);return e.push(t.data.replace(/[<&>]/g,$)),null;case A:if(r&&-1!==t.data.indexOf("]]>"))throw new m('The CDATASection data contains "]]>"',f.InvalidStateError);return o?e.push(g.CDATA_START,t.data.replace(/]]>/g,"]]]]><![CDATA[>"),g.CDATA_END):e.push(g.CDATA_START,t.data,g.CDATA_END),null;case D:if(r){if(g.InvalidChar.test(t.data))throw new m("The comment node data contains characters outside the XML Char production",f.InvalidStateError);if(-1!==t.data.indexOf("--")||"-"===t.data[t.data.length-1])throw new m('The comment node data contains "--" or ends with "-"',f.InvalidStateError)}return e.push(g.COMMENT_START,t.data,g.COMMENT_END),null;case P:var W=t.publicId,V=t.systemId;if(r){if(W&&!g.PubidLiteral_match.test(W))throw new m("DocumentType publicId is not a valid PubidLiteral",f.InvalidStateError);if(V&&"."!==V&&!g.SystemLiteral_match.test(V))throw new m("DocumentType systemId is not a valid SystemLiteral",f.InvalidStateError);if(t.internalSubset&&-1!==t.internalSubset.indexOf("]>"))throw new m('DocumentType internalSubset contains "]>"',f.InvalidStateError)}return e.push(g.DOCTYPE_DECL_START," ",t.name),W?(e.push(" ",g.PUBLIC," ",W),V&&"."!==V&&e.push(" ",V)):V&&"."!==V&&e.push(" ",g.SYSTEM," ",V),t.internalSubset&&e.push(" [",t.internalSubset,"]"),e.push(">"),null;case M:if(r){if(-1!==t.target.indexOf(":")||"xml"===t.target.toLowerCase())throw new m("The ProcessingInstruction target is not well-formed",f.InvalidStateError);if(g.InvalidChar.test(t.data))throw new m("The ProcessingInstruction data contains characters outside the XML Char production",f.InvalidStateError);if(-1!==t.data.indexOf("?>"))throw new m('The ProcessingInstruction data contains "?>"',f.InvalidStateError)}return e.push("<?",t.target," ",t.data,"?>"),null;case w:return e.push("&",t.nodeName,";"),null;default:return e.push("??",t.nodeName),null}},exit:function(t,s){s&&s.tag&&e.push("</",s.tag,">")}})}function At(t,e,s){var i;return Q(e,null,{enter:function(e,n){var r=new e.constructor(u);for(var a in e)if(o(e,a)){var l=e[a];"object"!=typeof l&&l!=r[a]&&(r[a]=l)}e.childNodes&&(r.childNodes=new H),r.ownerDocument=t;var h=s;switch(r.nodeType){case R:var c=e.attributes,d=r.attributes=new q,p=c.length;d._ownerElement=r;for(var m=0;m<p;m++)r.setAttributeNode(At(t,c.item(m),!0));break;case I:h=!0}return null!==n?n.appendChild(r):i=r,h?r:null}}),i}function wt(t,e,s){t[e]=s}function Ot(t){for(var e=[],s=t.firstChild;s;)s.nodeType===R&&e.push(s),s=s.nextSibling;return e}H.prototype={length:0,item:function(t){return t>=0&&t<this.length?this[t]:null},toString:function(t){var e;e="function"==typeof t?{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:t}:t?{requireWellFormed:!!t.requireWellFormed,splitCDATASections:!1!==t.splitCDATASections,nodeFilter:t.nodeFilter||null}:{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};for(var s=[],i=0;i<this.length;i++)St(this[i],s,null,e);return s.join("")},filter:function(t){return Array.prototype.filter.call(this,t)},indexOf:function(t){return Array.prototype.indexOf.call(this,t)}},H.prototype[Symbol.iterator]=function(){var t=this,e=0;return{next:function(){return e<t.length?{value:t[e++],done:!1}:{done:!0}},return:function(){return{done:!0}}}},W.prototype.item=function(t){return V(this),this[t]||null},L(W,H),q.prototype={length:0,item:H.prototype.item,getNamedItem:function(t){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(t=t.toLowerCase());for(var e=0;e<this.length;){var s=this[e];if(s.nodeName===t)return s;e++}return null},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!==this._ownerElement)throw new m(m.INUSE_ATTRIBUTE_ERR);var s=this.getNamedItemNS(t.namespaceURI,t.localName);return s===t?t:(z(this._ownerElement,this,t,s),s)},setNamedItemNS:function(t){return this.setNamedItem(t)},removeNamedItem:function(t){var e=this.getNamedItem(t);if(!e)throw new m(m.NOT_FOUND_ERR,t);return G(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var s=this.getNamedItemNS(t,e);if(!s)throw new m(m.NOT_FOUND_ERR,t?t+" : "+e:e);return G(this._ownerElement,this,s),s},getNamedItemNS:function(t,e){t||(t=null);for(var s=0;s<this.length;){var i=this[s];if(i.localName===e&&i.namespaceURI===t)return i;s++}return null}},q.prototype[Symbol.iterator]=function(){var t=this,e=0;return{next:function(){return e<t.length?{value:t[e++],done:!1}:{done:!0}},return:function(){return{done:!0}}}},J.prototype={hasFeature:function(t,e){return!0},createDocument:function(t,e,s){var i=c.XML_APPLICATION;t===d.HTML?i=c.XML_XHTML_APPLICATION:t===d.SVG&&(i=c.XML_SVG_IMAGE);var n=new Z(u,{contentType:i});if(n.implementation=this,n.childNodes=new H,n.doctype=s||null,s&&n.appendChild(s),e){var r=n.createElementNS(t,e);n.appendChild(r)}return n},createDocumentType:function(t,e,s,i){N(t);var n=new Et(u);return n.name=t,n.nodeName=t,n.publicId=e||"",n.systemId=s||"",n.internalSubset=i||"",n.childNodes=new H,n},createHTMLDocument:function(t){var e=new Z(u,{contentType:c.HTML});if(e.implementation=this,e.childNodes=new H,!1!==t){e.doctype=this.createDocumentType("html"),e.doctype.ownerDocument=e,e.appendChild(e.doctype);var s=e.createElement("html");e.appendChild(s);var i=e.createElement("head");if(s.appendChild(i),"string"==typeof t){var n=e.createElement("title");n.appendChild(e.createTextNode(t)),i.appendChild(n)}s.appendChild(e.createElement("body"))}return e}},K.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:"about:blank",get isConnected(){var t=this.getRootNode();return t&&t.nodeType===t.DOCUMENT_NODE},contains:function(t){if(!t)return!1;var e=t;do{if(this===e)return!0;e=e.parentNode}while(e);return!1},getRootNode:function(t){var e=this;do{if(!e.parentNode)return e;e=e.parentNode}while(e)},isEqualNode:function(t){if(!t)return!1;for(var e=[{node:this,other:t}];e.length>0;){var s=e.pop(),i=s.node,n=s.other;if(i.nodeType!==n.nodeType)return!1;switch(i.nodeType){case i.DOCUMENT_TYPE_NODE:if(i.name!==n.name)return!1;if(i.publicId!==n.publicId)return!1;if(i.systemId!==n.systemId)return!1;break;case i.ELEMENT_NODE:if(i.namespaceURI!==n.namespaceURI)return!1;if(i.prefix!==n.prefix)return!1;if(i.localName!==n.localName)return!1;if(i.attributes.length!==n.attributes.length)return!1;for(var r=0;r<i.attributes.length;r++){var o=i.attributes.item(r),a=n.getAttributeNodeNS(o.namespaceURI,o.localName);if(!a)return!1;e.push({node:o,other:a})}break;case i.ATTRIBUTE_NODE:if(i.namespaceURI!==n.namespaceURI)return!1;if(i.localName!==n.localName)return!1;if(i.value!==n.value)return!1;break;case i.PROCESSING_INSTRUCTION_NODE:if(i.target!==n.target||i.data!==n.data)return!1;break;case i.TEXT_NODE:case i.CDATA_SECTION_NODE:case i.COMMENT_NODE:if(i.data!==n.data)return!1}if(i.childNodes.length!==n.childNodes.length)return!1;for(r=i.childNodes.length-1;r>=0;r--)e.push({node:i.childNodes[r],other:n.childNodes[r]})}return!0},isSameNode:function(t){return this===t},insertBefore:function(t,e){return dt(this,t,e)},replaceChild:function(t,e){dt(this,t,e,ct),e&&this.removeChild(e)},removeChild:function(t){return st(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(t){return At(this.ownerDocument||this,this,t)},normalize:function(){Q(this,null,{enter:function(t){for(var e=t.firstChild;e;){var s=e.nextSibling;null!==s&&s.nodeType===S&&e.nodeType===S?(t.removeChild(s),e.appendData(s.data)):e=s}return!0}})},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},lookupPrefix:function(t){for(var e=this;e;){var s=e._nsMap;if(s)for(var i in s)if(o(s,i)&&s[i]===t)return i;e=e.nodeType==I?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var s=e._nsMap;if(s&&o(s,t))return s[t];e=e.nodeType==I?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){return null==this.lookupPrefix(t)},compareDocumentPosition:function(t){if(this===t)return 0;var e=t,s=this,i=null,n=null;if(e instanceof pt&&(e=(i=e).ownerElement),s instanceof pt&&(s=(n=s).ownerElement,i&&e&&s===e))for(var r,o=0;r=s.attributes[o];o++){if(r===i)return _.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+_.DOCUMENT_POSITION_PRECEDING;if(r===n)return _.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+_.DOCUMENT_POSITION_FOLLOWING}if(!e||!s||s.ownerDocument!==e.ownerDocument)return _.DOCUMENT_POSITION_DISCONNECTED+_.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(U(s.ownerDocument)>U(e.ownerDocument)?_.DOCUMENT_POSITION_FOLLOWING:_.DOCUMENT_POSITION_PRECEDING);if(n&&e===s)return _.DOCUMENT_POSITION_CONTAINS+_.DOCUMENT_POSITION_PRECEDING;if(i&&e===s)return _.DOCUMENT_POSITION_CONTAINED_BY+_.DOCUMENT_POSITION_FOLLOWING;for(var a=[],l=e.parentNode;l;){if(!n&&l===s)return _.DOCUMENT_POSITION_CONTAINED_BY+_.DOCUMENT_POSITION_FOLLOWING;a.push(l),l=l.parentNode}a.reverse();for(var h=[],c=s.parentNode;c;){if(!i&&c===e)return _.DOCUMENT_POSITION_CONTAINS+_.DOCUMENT_POSITION_PRECEDING;h.push(c),c=c.parentNode}h.reverse();var d=F(a,h);for(var u in d.childNodes){var p=d.childNodes[u];if(p===s)return _.DOCUMENT_POSITION_FOLLOWING;if(p===e)return _.DOCUMENT_POSITION_PRECEDING;if(h.indexOf(p)>=0)return _.DOCUMENT_POSITION_FOLLOWING;if(a.indexOf(p)>=0)return _.DOCUMENT_POSITION_PRECEDING}return 0}},v(C,K),v(C,K.prototype),v(_,K),v(_,K.prototype),Q.STOP=Symbol("walkDOM.STOP"),Q.ENTER=0,Q.EXIT=1,Z.prototype={implementation:null,nodeName:"#document",nodeType:k,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType===B){for(var s=t.firstChild;s;){var i=s.nextSibling;this.insertBefore(s,e),s=i}return t}return dt(this,t,e),t.ownerDocument=this,null===this.documentElement&&t.nodeType===R&&(this.documentElement=t),t},removeChild:function(t){var e=st(this,t);return e===this.documentElement&&(this.documentElement=null),e},replaceChild:function(t,e){dt(this,t,e,ct),t.ownerDocument=this,e&&this.removeChild(e),nt(t)&&(this.documentElement=t)},importNode:function(t,e){return function(t,e,s){var i;return Q(e,null,{enter:function(e,n){var r=e.cloneNode(!1);return r.ownerDocument=t,r.parentNode=null,null===n?i=r:n.appendChild(r),e.nodeType===I||s?r:null}}),i}(this,t,e)},getElementById:function(t){var e=null;return Y(this.documentElement,function(s){if(s.nodeType==R&&s.getAttribute("id")==t)return e=s,!0}),e},createElement:function(t){var e=new ut(u);return e.ownerDocument=this,"html"===this.type&&(t=t.toLowerCase()),r(this.contentType)&&(e.namespaceURI=d.HTML),e.nodeName=t,e.tagName=t,e.localName=t,e.childNodes=new H,(e.attributes=new q)._ownerElement=e,e},createDocumentFragment:function(){var t=new Tt(u);return t.ownerDocument=this,t.childNodes=new H,t},createTextNode:function(t){var e=new ft(u);return e.ownerDocument=this,e.childNodes=new H,e.appendData(t),e},createComment:function(t){var e=new gt(u);return e.ownerDocument=this,e.childNodes=new H,e.appendData(t),e},createCDATASection:function(t){if(-1!==t.indexOf("]]>"))throw new m(m.INVALID_CHARACTER_ERR,'data contains "]]>"');var e=new bt(u);return e.ownerDocument=this,e.childNodes=new H,e.appendData(t),e},createProcessingInstruction:function(t,e){var s=new vt(u);return s.ownerDocument=this,s.childNodes=new H,s.nodeName=s.target=t,s.nodeValue=s.data=e,s},createAttribute:function(t){if(!g.QName_exact.test(t))throw new m(m.INVALID_CHARACTER_ERR,'invalid character in name "'+t+'"');return"html"===this.type&&(t=t.toLowerCase()),this._createAttribute(t)},_createAttribute:function(t){var e=new pt(u);return e.ownerDocument=this,e.childNodes=new H,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){if(!g.Name.test(t))throw new m(m.INVALID_CHARACTER_ERR,'not a valid xml name "'+t+'"');if("html"===this.type)throw new m("document is an html document",f.NotSupportedError);var e=new Nt(u);return e.ownerDocument=this,e.childNodes=new H,e.nodeName=t,e},createElementNS:function(t,e){var s=T(t,e),i=new ut(u),n=i.attributes=new q;return i.childNodes=new H,i.ownerDocument=this,i.nodeName=e,i.tagName=e,i.namespaceURI=s[0],i.prefix=s[1],i.localName=s[2],n._ownerElement=i,i},createAttributeNS:function(t,e){var s=T(t,e),i=new pt(u);return i.ownerDocument=this,i.childNodes=new H,i.nodeName=e,i.name=e,i.specified=!0,i.namespaceURI=s[0],i.prefix=s[1],i.localName=s[2],i}},L(Z,K),ut.prototype={nodeType:R,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+":"+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return"html"===this.ownerDocument.type&&this.namespaceURI===d.HTML},hasAttributes:function(){return!(!this.attributes||!this.attributes.length)},hasAttribute:function(t){return!!this.getAttributeNode(t)},getAttribute:function(t){var e=this.getAttributeNode(t);return e?e.value:null},getAttributeNode:function(t){return this._isInHTMLDocumentAndNamespace()&&(t=t.toLowerCase()),this.attributes.getNamedItem(t)},setAttribute:function(t,e){this._isInHTMLDocumentAndNamespace()&&(t=t.toLowerCase());var s=this.getAttributeNode(t);s?s.value=s.nodeValue=""+e:((s=this.ownerDocument._createAttribute(t)).value=s.nodeValue=""+e,this.setAttributeNode(s))},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var s=this.getAttributeNodeNS(t,e);s&&this.removeAttributeNode(s)},hasAttributeNS:function(t,e){return null!=this.getAttributeNodeNS(t,e)},getAttributeNS:function(t,e){var s=this.getAttributeNodeNS(t,e);return s?s.value:null},setAttributeNS:function(t,e,s){var i=T(t,e)[2],n=this.getAttributeNodeNS(t,i);n?n.value=n.nodeValue=""+s:((n=this.ownerDocument.createAttributeNS(t,e)).value=n.nodeValue=""+s,this.setAttributeNode(n))},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByClassName:function(t){var e=y(t);return new W(this,function(s){var i=[];return e.length>0&&Y(s,function(n){if(n!==s&&n.nodeType===R){var r=n.getAttribute("class");if(r){var o=t===r;if(!o){var a=y(r);o=e.every((l=a,function(t){return l&&-1!==l.indexOf(t)}))}o&&i.push(n)}}var l}),i})},getElementsByTagName:function(t){var e="html"===(this.nodeType===k?this:this.ownerDocument).type,s=t.toLowerCase();return new W(this,function(i){var n=[];return Y(i,function(r){r!==i&&r.nodeType===R&&(("*"===t||r.getQualifiedName()===(e&&r.namespaceURI===d.HTML?s:t))&&n.push(r))}),n})},getElementsByTagNameNS:function(t,e){return new W(this,function(s){var i=[];return Y(s,function(n){n===s||n.nodeType!==R||"*"!==t&&n.namespaceURI!==t||"*"!==e&&n.localName!=e||i.push(n)}),i})}},Z.prototype.getElementsByClassName=ut.prototype.getElementsByClassName,Z.prototype.getElementsByTagName=ut.prototype.getElementsByTagName,Z.prototype.getElementsByTagNameNS=ut.prototype.getElementsByTagNameNS,L(ut,K),pt.prototype.nodeType=I,L(pt,K),mt.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,s){s=this.data.substring(0,t)+s+this.data.substring(t+e),this.nodeValue=this.data=s,this.length=s.length}},L(mt,K),ft.prototype={nodeName:"#text",nodeType:S,splitText:function(t){var e=this.data,s=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var i=this.ownerDocument.createTextNode(s);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}},L(ft,mt),gt.prototype={nodeName:"#comment",nodeType:D},L(gt,mt),bt.prototype={nodeName:"#cdata-section",nodeType:A},L(bt,ft),Et.prototype.nodeType=P,L(Et,K),xt.prototype.nodeType=j,L(xt,K),yt.prototype.nodeType=O,L(yt,K),Nt.prototype.nodeType=w,L(Nt,K),Tt.prototype.nodeName="#document-fragment",Tt.prototype.nodeType=B,L(Tt,K),vt.prototype.nodeType=M,L(vt,mt),Lt.prototype.serializeToString=function(t,e){return Ct.call(t,e)},K.prototype.toString=Ct;try{Object.defineProperty&&(Object.defineProperty(W.prototype,"length",{get:function(){return V(this),this.$$length}}),Object.defineProperty(K.prototype,"textContent",{get:function(){if(this.nodeType===R||this.nodeType===B){var t=[];return Q(this,null,{enter:function(e){return e.nodeType===R||e.nodeType===B||(e.nodeType===M||e.nodeType===D?null:void t.push(e.nodeValue))}}),t.join("")}return this.nodeValue},set:function(t){switch(this.nodeType){case R:case B:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),Object.defineProperty(ut.prototype,"children",{get:function(){return new W(this,Ot)}}),Object.defineProperty(Z.prototype,"children",{get:function(){return new W(this,Ot)}}),Object.defineProperty(Tt.prototype,"children",{get:function(){return new W(this,Ot)}}),wt=function(t,e,s){t["$$"+e]=s})}catch(t){}e._updateLiveList=V,e.Attr=pt,e.CDATASection=bt,e.CharacterData=mt,e.Comment=gt,e.Document=Z,e.DocumentFragment=Tt,e.DocumentType=Et,e.DOMImplementation=J,e.Element=ut,e.Entity=yt,e.EntityReference=Nt,e.LiveNodeList=W,e.NamedNodeMap=q,e.Node=K,e.NodeList=H,e.Notation=xt,e.Text=ft,e.ProcessingInstruction=vt,e.walkDOM=Q,e.XMLSerializer=Lt},334(t,e,s){"use strict";var i=s(981).freeze;e.XML_ENTITIES=i({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),e.HTML_ENTITIES=i({Aacute:"\xc1",aacute:"\xe1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223e",acd:"\u223f",acE:"\u223e\u0333",Acirc:"\xc2",acirc:"\xe2",acute:"\xb4",Acy:"\u0410",acy:"\u0430",AElig:"\xc6",aelig:"\xe6",af:"\u2061",Afr:"\u{1d504}",afr:"\u{1d51e}",Agrave:"\xc0",agrave:"\xe0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03b1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2a3f",AMP:"&",amp:"&",And:"\u2a53",and:"\u2227",andand:"\u2a55",andd:"\u2a5c",andslope:"\u2a58",andv:"\u2a5a",ang:"\u2220",ange:"\u29a4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29a8",angmsdab:"\u29a9",angmsdac:"\u29aa",angmsdad:"\u29ab",angmsdae:"\u29ac",angmsdaf:"\u29ad",angmsdag:"\u29ae",angmsdah:"\u29af",angrt:"\u221f",angrtvb:"\u22be",angrtvbd:"\u299d",angsph:"\u2222",angst:"\xc5",angzarr:"\u237c",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1d538}",aopf:"\u{1d552}",ap:"\u2248",apacir:"\u2a6f",apE:"\u2a70",ape:"\u224a",apid:"\u224b",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224a",Aring:"\xc5",aring:"\xe5",Ascr:"\u{1d49c}",ascr:"\u{1d4b6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224d",Atilde:"\xc3",atilde:"\xe3",Auml:"\xc4",auml:"\xe4",awconint:"\u2233",awint:"\u2a11",backcong:"\u224c",backepsilon:"\u03f6",backprime:"\u2035",backsim:"\u223d",backsimeq:"\u22cd",Backslash:"\u2216",Barv:"\u2ae7",barvee:"\u22bd",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23b5",bbrktbrk:"\u23b6",bcong:"\u224c",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201e",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29b0",bepsi:"\u03f6",bernou:"\u212c",Bernoullis:"\u212c",Beta:"\u0392",beta:"\u03b2",beth:"\u2136",between:"\u226c",Bfr:"\u{1d505}",bfr:"\u{1d51f}",bigcap:"\u22c2",bigcirc:"\u25ef",bigcup:"\u22c3",bigodot:"\u2a00",bigoplus:"\u2a01",bigotimes:"\u2a02",bigsqcup:"\u2a06",bigstar:"\u2605",bigtriangledown:"\u25bd",bigtriangleup:"\u25b3",biguplus:"\u2a04",bigvee:"\u22c1",bigwedge:"\u22c0",bkarow:"\u290d",blacklozenge:"\u29eb",blacksquare:"\u25aa",blacktriangle:"\u25b4",blacktriangledown:"\u25be",blacktriangleleft:"\u25c2",blacktriangleright:"\u25b8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20e5",bnequiv:"\u2261\u20e5",bNot:"\u2aed",bnot:"\u2310",Bopf:"\u{1d539}",bopf:"\u{1d553}",bot:"\u22a5",bottom:"\u22a5",bowtie:"\u22c8",boxbox:"\u29c9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250c",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252c",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229f",boxplus:"\u229e",boxtimes:"\u22a0",boxUL:"\u255d",boxUl:"\u255c",boxuL:"\u255b",boxul:"\u2518",boxUR:"\u255a",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256c",boxVh:"\u256b",boxvH:"\u256a",boxvh:"\u253c",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255f",boxvR:"\u255e",boxvr:"\u251c",bprime:"\u2035",Breve:"\u02d8",breve:"\u02d8",brvbar:"\xa6",Bscr:"\u212c",bscr:"\u{1d4b7}",bsemi:"\u204f",bsim:"\u223d",bsime:"\u22cd",bsol:"\\",bsolb:"\u29c5",bsolhsub:"\u27c8",bull:"\u2022",bullet:"\u2022",bump:"\u224e",bumpE:"\u2aae",bumpe:"\u224f",Bumpeq:"\u224e",bumpeq:"\u224f",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22d2",cap:"\u2229",capand:"\u2a44",capbrcup:"\u2a49",capcap:"\u2a4b",capcup:"\u2a47",capdot:"\u2a40",CapitalDifferentialD:"\u2145",caps:"\u2229\ufe00",caret:"\u2041",caron:"\u02c7",Cayleys:"\u212d",ccaps:"\u2a4d",Ccaron:"\u010c",ccaron:"\u010d",Ccedil:"\xc7",ccedil:"\xe7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2a4c",ccupssm:"\u2a50",Cdot:"\u010a",cdot:"\u010b",cedil:"\xb8",Cedilla:"\xb8",cemptyv:"\u29b2",cent:"\xa2",CenterDot:"\xb7",centerdot:"\xb7",Cfr:"\u212d",cfr:"\u{1d520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03a7",chi:"\u03c7",cir:"\u25cb",circ:"\u02c6",circeq:"\u2257",circlearrowleft:"\u21ba",circlearrowright:"\u21bb",circledast:"\u229b",circledcirc:"\u229a",circleddash:"\u229d",CircleDot:"\u2299",circledR:"\xae",circledS:"\u24c8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29c3",cire:"\u2257",cirfnint:"\u2a10",cirmid:"\u2aef",cirscir:"\u29c2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201d",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2a74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2a6d",Congruent:"\u2261",Conint:"\u222f",conint:"\u222e",ContourIntegral:"\u222e",Copf:"\u2102",copf:"\u{1d554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xa9",copy:"\xa9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21b5",Cross:"\u2a2f",cross:"\u2717",Cscr:"\u{1d49e}",cscr:"\u{1d4b8}",csub:"\u2acf",csube:"\u2ad1",csup:"\u2ad0",csupe:"\u2ad2",ctdot:"\u22ef",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22de",cuesc:"\u22df",cularr:"\u21b6",cularrp:"\u293d",Cup:"\u22d3",cup:"\u222a",cupbrcap:"\u2a48",CupCap:"\u224d",cupcap:"\u2a46",cupcup:"\u2a4a",cupdot:"\u228d",cupor:"\u2a45",cups:"\u222a\ufe00",curarr:"\u21b7",curarrm:"\u293c",curlyeqprec:"\u22de",curlyeqsucc:"\u22df",curlyvee:"\u22ce",curlywedge:"\u22cf",curren:"\xa4",curvearrowleft:"\u21b6",curvearrowright:"\u21b7",cuvee:"\u22ce",cuwed:"\u22cf",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232d",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21a1",dArr:"\u21d3",darr:"\u2193",dash:"\u2010",Dashv:"\u2ae4",dashv:"\u22a3",dbkarow:"\u290f",dblac:"\u02dd",Dcaron:"\u010e",dcaron:"\u010f",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21ca",DDotrahd:"\u2911",ddotseq:"\u2a77",deg:"\xb0",Del:"\u2207",Delta:"\u0394",delta:"\u03b4",demptyv:"\u29b1",dfisht:"\u297f",Dfr:"\u{1d507}",dfr:"\u{1d521}",dHar:"\u2965",dharl:"\u21c3",dharr:"\u21c2",DiacriticalAcute:"\xb4",DiacriticalDot:"\u02d9",DiacriticalDoubleAcute:"\u02dd",DiacriticalGrave:"`",DiacriticalTilde:"\u02dc",diam:"\u22c4",Diamond:"\u22c4",diamond:"\u22c4",diamondsuit:"\u2666",diams:"\u2666",die:"\xa8",DifferentialD:"\u2146",digamma:"\u03dd",disin:"\u22f2",div:"\xf7",divide:"\xf7",divideontimes:"\u22c7",divonx:"\u22c7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231e",dlcrop:"\u230d",dollar:"$",Dopf:"\u{1d53b}",dopf:"\u{1d555}",Dot:"\xa8",dot:"\u02d9",DotDot:"\u20dc",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22a1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222f",DoubleDot:"\xa8",DoubleDownArrow:"\u21d3",DoubleLeftArrow:"\u21d0",DoubleLeftRightArrow:"\u21d4",DoubleLeftTee:"\u2ae4",DoubleLongLeftArrow:"\u27f8",DoubleLongLeftRightArrow:"\u27fa",DoubleLongRightArrow:"\u27f9",DoubleRightArrow:"\u21d2",DoubleRightTee:"\u22a8",DoubleUpArrow:"\u21d1",DoubleUpDownArrow:"\u21d5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21d3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21f5",DownBreve:"\u0311",downdownarrows:"\u21ca",downharpoonleft:"\u21c3",downharpoonright:"\u21c2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295e",DownLeftVector:"\u21bd",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295f",DownRightVector:"\u21c1",DownRightVectorBar:"\u2957",DownTee:"\u22a4",DownTeeArrow:"\u21a7",drbkarow:"\u2910",drcorn:"\u231f",drcrop:"\u230c",Dscr:"\u{1d49f}",dscr:"\u{1d4b9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29f6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22f1",dtri:"\u25bf",dtrif:"\u25be",duarr:"\u21f5",duhar:"\u296f",dwangle:"\u29a6",DZcy:"\u040f",dzcy:"\u045f",dzigrarr:"\u27ff",Eacute:"\xc9",eacute:"\xe9",easter:"\u2a6e",Ecaron:"\u011a",ecaron:"\u011b",ecir:"\u2256",Ecirc:"\xca",ecirc:"\xea",ecolon:"\u2255",Ecy:"\u042d",ecy:"\u044d",eDDot:"\u2a77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1d508}",efr:"\u{1d522}",eg:"\u2a9a",Egrave:"\xc8",egrave:"\xe8",egs:"\u2a96",egsdot:"\u2a98",el:"\u2a99",Element:"\u2208",elinters:"\u23e7",ell:"\u2113",els:"\u2a95",elsdot:"\u2a97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25fb",emptyv:"\u2205",EmptyVerySmallSquare:"\u25ab",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014a",eng:"\u014b",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1d53c}",eopf:"\u{1d556}",epar:"\u22d5",eparsl:"\u29e3",eplus:"\u2a71",epsi:"\u03b5",Epsilon:"\u0395",epsilon:"\u03b5",epsiv:"\u03f5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2a96",eqslantless:"\u2a95",Equal:"\u2a75",equals:"=",EqualTilde:"\u2242",equest:"\u225f",Equilibrium:"\u21cc",equiv:"\u2261",equivDD:"\u2a78",eqvparsl:"\u29e5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212f",esdot:"\u2250",Esim:"\u2a73",esim:"\u2242",Eta:"\u0397",eta:"\u03b7",ETH:"\xd0",eth:"\xf0",Euml:"\xcb",euml:"\xeb",euro:"\u20ac",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\ufb03",fflig:"\ufb00",ffllig:"\ufb04",Ffr:"\u{1d509}",ffr:"\u{1d523}",filig:"\ufb01",FilledSmallSquare:"\u25fc",FilledVerySmallSquare:"\u25aa",fjlig:"fj",flat:"\u266d",fllig:"\ufb02",fltns:"\u25b1",fnof:"\u0192",Fopf:"\u{1d53d}",fopf:"\u{1d557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22d4",forkv:"\u2ad9",Fouriertrf:"\u2131",fpartint:"\u2a0d",frac12:"\xbd",frac13:"\u2153",frac14:"\xbc",frac15:"\u2155",frac16:"\u2159",frac18:"\u215b",frac23:"\u2154",frac25:"\u2156",frac34:"\xbe",frac35:"\u2157",frac38:"\u215c",frac45:"\u2158",frac56:"\u215a",frac58:"\u215d",frac78:"\u215e",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1d4bb}",gacute:"\u01f5",Gamma:"\u0393",gamma:"\u03b3",Gammad:"\u03dc",gammad:"\u03dd",gap:"\u2a86",Gbreve:"\u011e",gbreve:"\u011f",Gcedil:"\u0122",Gcirc:"\u011c",gcirc:"\u011d",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2a8c",gel:"\u22db",geq:"\u2265",geqq:"\u2267",geqslant:"\u2a7e",ges:"\u2a7e",gescc:"\u2aa9",gesdot:"\u2a80",gesdoto:"\u2a82",gesdotol:"\u2a84",gesl:"\u22db\ufe00",gesles:"\u2a94",Gfr:"\u{1d50a}",gfr:"\u{1d524}",Gg:"\u22d9",gg:"\u226b",ggg:"\u22d9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2aa5",glE:"\u2a92",glj:"\u2aa4",gnap:"\u2a8a",gnapprox:"\u2a8a",gnE:"\u2269",gne:"\u2a88",gneq:"\u2a88",gneqq:"\u2269",gnsim:"\u22e7",Gopf:"\u{1d53e}",gopf:"\u{1d558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22db",GreaterFullEqual:"\u2267",GreaterGreater:"\u2aa2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2a7e",GreaterTilde:"\u2273",Gscr:"\u{1d4a2}",gscr:"\u210a",gsim:"\u2273",gsime:"\u2a8e",gsiml:"\u2a90",Gt:"\u226b",GT:">",gt:">",gtcc:"\u2aa7",gtcir:"\u2a7a",gtdot:"\u22d7",gtlPar:"\u2995",gtquest:"\u2a7c",gtrapprox:"\u2a86",gtrarr:"\u2978",gtrdot:"\u22d7",gtreqless:"\u22db",gtreqqless:"\u2a8c",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\ufe00",gvnE:"\u2269\ufe00",Hacek:"\u02c7",hairsp:"\u200a",half:"\xbd",hamilt:"\u210b",HARDcy:"\u042a",hardcy:"\u044a",hArr:"\u21d4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21ad",Hat:"^",hbar:"\u210f",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22b9",Hfr:"\u210c",hfr:"\u{1d525}",HilbertSpace:"\u210b",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21ff",homtht:"\u223b",hookleftarrow:"\u21a9",hookrightarrow:"\u21aa",Hopf:"\u210d",hopf:"\u{1d559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210b",hscr:"\u{1d4bd}",hslash:"\u210f",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224e",HumpEqual:"\u224f",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xcd",iacute:"\xed",ic:"\u2063",Icirc:"\xce",icirc:"\xee",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xa1",iff:"\u21d4",Ifr:"\u2111",ifr:"\u{1d526}",Igrave:"\xcc",igrave:"\xec",ii:"\u2148",iiiint:"\u2a0c",iiint:"\u222d",iinfin:"\u29dc",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012a",imacr:"\u012b",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22b7",imped:"\u01b5",Implies:"\u21d2",in:"\u2208",incare:"\u2105",infin:"\u221e",infintie:"\u29dd",inodot:"\u0131",Int:"\u222c",int:"\u222b",intcal:"\u22ba",integers:"\u2124",Integral:"\u222b",intercal:"\u22ba",Intersection:"\u22c2",intlarhk:"\u2a17",intprod:"\u2a3c",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012e",iogon:"\u012f",Iopf:"\u{1d540}",iopf:"\u{1d55a}",Iota:"\u0399",iota:"\u03b9",iprod:"\u2a3c",iquest:"\xbf",Iscr:"\u2110",iscr:"\u{1d4be}",isin:"\u2208",isindot:"\u22f5",isinE:"\u22f9",isins:"\u22f4",isinsv:"\u22f3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xcf",iuml:"\xef",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1d50d}",jfr:"\u{1d527}",jmath:"\u0237",Jopf:"\u{1d541}",jopf:"\u{1d55b}",Jscr:"\u{1d4a5}",jscr:"\u{1d4bf}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039a",kappa:"\u03ba",kappav:"\u03f0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041a",kcy:"\u043a",Kfr:"\u{1d50e}",kfr:"\u{1d528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040c",kjcy:"\u045c",Kopf:"\u{1d542}",kopf:"\u{1d55c}",Kscr:"\u{1d4a6}",kscr:"\u{1d4c0}",lAarr:"\u21da",Lacute:"\u0139",lacute:"\u013a",laemptyv:"\u29b4",lagran:"\u2112",Lambda:"\u039b",lambda:"\u03bb",Lang:"\u27ea",lang:"\u27e8",langd:"\u2991",langle:"\u27e8",lap:"\u2a85",Laplacetrf:"\u2112",laquo:"\xab",Larr:"\u219e",lArr:"\u21d0",larr:"\u2190",larrb:"\u21e4",larrbfs:"\u291f",larrfs:"\u291d",larrhk:"\u21a9",larrlp:"\u21ab",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21a2",lat:"\u2aab",lAtail:"\u291b",latail:"\u2919",late:"\u2aad",lates:"\u2aad\ufe00",lBarr:"\u290e",lbarr:"\u290c",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298b",lbrksld:"\u298f",lbrkslu:"\u298d",Lcaron:"\u013d",lcaron:"\u013e",Lcedil:"\u013b",lcedil:"\u013c",lceil:"\u2308",lcub:"{",Lcy:"\u041b",lcy:"\u043b",ldca:"\u2936",ldquo:"\u201c",ldquor:"\u201e",ldrdhar:"\u2967",ldrushar:"\u294b",ldsh:"\u21b2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27e8",LeftArrow:"\u2190",Leftarrow:"\u21d0",leftarrow:"\u2190",LeftArrowBar:"\u21e4",LeftArrowRightArrow:"\u21c6",leftarrowtail:"\u21a2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27e6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21c3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230a",leftharpoondown:"\u21bd",leftharpoonup:"\u21bc",leftleftarrows:"\u21c7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21d4",leftrightarrow:"\u2194",leftrightarrows:"\u21c6",leftrightharpoons:"\u21cb",leftrightsquigarrow:"\u21ad",LeftRightVector:"\u294e",LeftTee:"\u22a3",LeftTeeArrow:"\u21a4",LeftTeeVector:"\u295a",leftthreetimes:"\u22cb",LeftTriangle:"\u22b2",LeftTriangleBar:"\u29cf",LeftTriangleEqual:"\u22b4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21bf",LeftUpVectorBar:"\u2958",LeftVector:"\u21bc",LeftVectorBar:"\u2952",lEg:"\u2a8b",leg:"\u22da",leq:"\u2264",leqq:"\u2266",leqslant:"\u2a7d",les:"\u2a7d",lescc:"\u2aa8",lesdot:"\u2a7f",lesdoto:"\u2a81",lesdotor:"\u2a83",lesg:"\u22da\ufe00",lesges:"\u2a93",lessapprox:"\u2a85",lessdot:"\u22d6",lesseqgtr:"\u22da",lesseqqgtr:"\u2a8b",LessEqualGreater:"\u22da",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2aa1",lesssim:"\u2272",LessSlantEqual:"\u2a7d",LessTilde:"\u2272",lfisht:"\u297c",lfloor:"\u230a",Lfr:"\u{1d50f}",lfr:"\u{1d529}",lg:"\u2276",lgE:"\u2a91",lHar:"\u2962",lhard:"\u21bd",lharu:"\u21bc",lharul:"\u296a",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22d8",ll:"\u226a",llarr:"\u21c7",llcorner:"\u231e",Lleftarrow:"\u21da",llhard:"\u296b",lltri:"\u25fa",Lmidot:"\u013f",lmidot:"\u0140",lmoust:"\u23b0",lmoustache:"\u23b0",lnap:"\u2a89",lnapprox:"\u2a89",lnE:"\u2268",lne:"\u2a87",lneq:"\u2a87",lneqq:"\u2268",lnsim:"\u22e6",loang:"\u27ec",loarr:"\u21fd",lobrk:"\u27e6",LongLeftArrow:"\u27f5",Longleftarrow:"\u27f8",longleftarrow:"\u27f5",LongLeftRightArrow:"\u27f7",Longleftrightarrow:"\u27fa",longleftrightarrow:"\u27f7",longmapsto:"\u27fc",LongRightArrow:"\u27f6",Longrightarrow:"\u27f9",longrightarrow:"\u27f6",looparrowleft:"\u21ab",looparrowright:"\u21ac",lopar:"\u2985",Lopf:"\u{1d543}",lopf:"\u{1d55d}",loplus:"\u2a2d",lotimes:"\u2a34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25ca",lozenge:"\u25ca",lozf:"\u29eb",lpar:"(",lparlt:"\u2993",lrarr:"\u21c6",lrcorner:"\u231f",lrhar:"\u21cb",lrhard:"\u296d",lrm:"\u200e",lrtri:"\u22bf",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1d4c1}",Lsh:"\u21b0",lsh:"\u21b0",lsim:"\u2272",lsime:"\u2a8d",lsimg:"\u2a8f",lsqb:"[",lsquo:"\u2018",lsquor:"\u201a",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226a",LT:"<",lt:"<",ltcc:"\u2aa6",ltcir:"\u2a79",ltdot:"\u22d6",lthree:"\u22cb",ltimes:"\u22c9",ltlarr:"\u2976",ltquest:"\u2a7b",ltri:"\u25c3",ltrie:"\u22b4",ltrif:"\u25c2",ltrPar:"\u2996",lurdshar:"\u294a",luruhar:"\u2966",lvertneqq:"\u2268\ufe00",lvnE:"\u2268\ufe00",macr:"\xaf",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21a6",mapsto:"\u21a6",mapstodown:"\u21a7",mapstoleft:"\u21a4",mapstoup:"\u21a5",marker:"\u25ae",mcomma:"\u2a29",Mcy:"\u041c",mcy:"\u043c",mdash:"\u2014",mDDot:"\u223a",measuredangle:"\u2221",MediumSpace:"\u205f",Mellintrf:"\u2133",Mfr:"\u{1d510}",mfr:"\u{1d52a}",mho:"\u2127",micro:"\xb5",mid:"\u2223",midast:"*",midcir:"\u2af0",middot:"\xb7",minus:"\u2212",minusb:"\u229f",minusd:"\u2238",minusdu:"\u2a2a",MinusPlus:"\u2213",mlcp:"\u2adb",mldr:"\u2026",mnplus:"\u2213",models:"\u22a7",Mopf:"\u{1d544}",mopf:"\u{1d55e}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1d4c2}",mstpos:"\u223e",Mu:"\u039c",mu:"\u03bc",multimap:"\u22b8",mumap:"\u22b8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20d2",nap:"\u2249",napE:"\u2a70\u0338",napid:"\u224b\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266e",natural:"\u266e",naturals:"\u2115",nbsp:"\xa0",nbump:"\u224e\u0338",nbumpe:"\u224f\u0338",ncap:"\u2a43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2a6d\u0338",ncup:"\u2a42",Ncy:"\u041d",ncy:"\u043d",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21d7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200b",NegativeThickSpace:"\u200b",NegativeThinSpace:"\u200b",NegativeVeryThinSpace:"\u200b",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226b",NestedLessLess:"\u226a",NewLine:"\n",nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1d511}",nfr:"\u{1d52b}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2a7e\u0338",nges:"\u2a7e\u0338",nGg:"\u22d9\u0338",ngsim:"\u2275",nGt:"\u226b\u20d2",ngt:"\u226f",ngtr:"\u226f",nGtv:"\u226b\u0338",nhArr:"\u21ce",nharr:"\u21ae",nhpar:"\u2af2",ni:"\u220b",nis:"\u22fc",nisd:"\u22fa",niv:"\u220b",NJcy:"\u040a",njcy:"\u045a",nlArr:"\u21cd",nlarr:"\u219a",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21cd",nleftarrow:"\u219a",nLeftrightarrow:"\u21ce",nleftrightarrow:"\u21ae",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2a7d\u0338",nles:"\u2a7d\u0338",nless:"\u226e",nLl:"\u22d8\u0338",nlsim:"\u2274",nLt:"\u226a\u20d2",nlt:"\u226e",nltri:"\u22ea",nltrie:"\u22ec",nLtv:"\u226a\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xa0",Nopf:"\u2115",nopf:"\u{1d55f}",Not:"\u2aec",not:"\xac",NotCongruent:"\u2262",NotCupCap:"\u226d",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226f",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226b\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2a7e\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224e\u0338",NotHumpEqual:"\u224f\u0338",notin:"\u2209",notindot:"\u22f5\u0338",notinE:"\u22f9\u0338",notinva:"\u2209",notinvb:"\u22f7",notinvc:"\u22f6",NotLeftTriangle:"\u22ea",NotLeftTriangleBar:"\u29cf\u0338",NotLeftTriangleEqual:"\u22ec",NotLess:"\u226e",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226a\u0338",NotLessSlantEqual:"\u2a7d\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2aa2\u0338",NotNestedLessLess:"\u2aa1\u0338",notni:"\u220c",notniva:"\u220c",notnivb:"\u22fe",notnivc:"\u22fd",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2aaf\u0338",NotPrecedesSlantEqual:"\u22e0",NotReverseElement:"\u220c",NotRightTriangle:"\u22eb",NotRightTriangleBar:"\u29d0\u0338",NotRightTriangleEqual:"\u22ed",NotSquareSubset:"\u228f\u0338",NotSquareSubsetEqual:"\u22e2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22e3",NotSubset:"\u2282\u20d2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2ab0\u0338",NotSucceedsSlantEqual:"\u22e1",NotSucceedsTilde:"\u227f\u0338",NotSuperset:"\u2283\u20d2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2afd\u20e5",npart:"\u2202\u0338",npolint:"\u2a14",npr:"\u2280",nprcue:"\u22e0",npre:"\u2aaf\u0338",nprec:"\u2280",npreceq:"\u2aaf\u0338",nrArr:"\u21cf",nrarr:"\u219b",nrarrc:"\u2933\u0338",nrarrw:"\u219d\u0338",nRightarrow:"\u21cf",nrightarrow:"\u219b",nrtri:"\u22eb",nrtrie:"\u22ed",nsc:"\u2281",nsccue:"\u22e1",nsce:"\u2ab0\u0338",Nscr:"\u{1d4a9}",nscr:"\u{1d4c3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22e2",nsqsupe:"\u22e3",nsub:"\u2284",nsubE:"\u2ac5\u0338",nsube:"\u2288",nsubset:"\u2282\u20d2",nsubseteq:"\u2288",nsubseteqq:"\u2ac5\u0338",nsucc:"\u2281",nsucceq:"\u2ab0\u0338",nsup:"\u2285",nsupE:"\u2ac6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20d2",nsupseteq:"\u2289",nsupseteqq:"\u2ac6\u0338",ntgl:"\u2279",Ntilde:"\xd1",ntilde:"\xf1",ntlg:"\u2278",ntriangleleft:"\u22ea",ntrianglelefteq:"\u22ec",ntriangleright:"\u22eb",ntrianglerighteq:"\u22ed",Nu:"\u039d",nu:"\u03bd",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224d\u20d2",nVDash:"\u22af",nVdash:"\u22ae",nvDash:"\u22ad",nvdash:"\u22ac",nvge:"\u2265\u20d2",nvgt:">\u20d2",nvHarr:"\u2904",nvinfin:"\u29de",nvlArr:"\u2902",nvle:"\u2264\u20d2",nvlt:"<\u20d2",nvltrie:"\u22b4\u20d2",nvrArr:"\u2903",nvrtrie:"\u22b5\u20d2",nvsim:"\u223c\u20d2",nwarhk:"\u2923",nwArr:"\u21d6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xd3",oacute:"\xf3",oast:"\u229b",ocir:"\u229a",Ocirc:"\xd4",ocirc:"\xf4",Ocy:"\u041e",ocy:"\u043e",odash:"\u229d",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2a38",odot:"\u2299",odsold:"\u29bc",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29bf",Ofr:"\u{1d512}",ofr:"\u{1d52c}",ogon:"\u02db",Ograve:"\xd2",ograve:"\xf2",ogt:"\u29c1",ohbar:"\u29b5",ohm:"\u03a9",oint:"\u222e",olarr:"\u21ba",olcir:"\u29be",olcross:"\u29bb",oline:"\u203e",olt:"\u29c0",Omacr:"\u014c",omacr:"\u014d",Omega:"\u03a9",omega:"\u03c9",Omicron:"\u039f",omicron:"\u03bf",omid:"\u29b6",ominus:"\u2296",Oopf:"\u{1d546}",oopf:"\u{1d560}",opar:"\u29b7",OpenCurlyDoubleQuote:"\u201c",OpenCurlyQuote:"\u2018",operp:"\u29b9",oplus:"\u2295",Or:"\u2a54",or:"\u2228",orarr:"\u21bb",ord:"\u2a5d",order:"\u2134",orderof:"\u2134",ordf:"\xaa",ordm:"\xba",origof:"\u22b6",oror:"\u2a56",orslope:"\u2a57",orv:"\u2a5b",oS:"\u24c8",Oscr:"\u{1d4aa}",oscr:"\u2134",Oslash:"\xd8",oslash:"\xf8",osol:"\u2298",Otilde:"\xd5",otilde:"\xf5",Otimes:"\u2a37",otimes:"\u2297",otimesas:"\u2a36",Ouml:"\xd6",ouml:"\xf6",ovbar:"\u233d",OverBar:"\u203e",OverBrace:"\u23de",OverBracket:"\u23b4",OverParenthesis:"\u23dc",par:"\u2225",para:"\xb6",parallel:"\u2225",parsim:"\u2af3",parsl:"\u2afd",part:"\u2202",PartialD:"\u2202",Pcy:"\u041f",pcy:"\u043f",percnt:"%",period:".",permil:"\u2030",perp:"\u22a5",pertenk:"\u2031",Pfr:"\u{1d513}",pfr:"\u{1d52d}",Phi:"\u03a6",phi:"\u03c6",phiv:"\u03d5",phmmat:"\u2133",phone:"\u260e",Pi:"\u03a0",pi:"\u03c0",pitchfork:"\u22d4",piv:"\u03d6",planck:"\u210f",planckh:"\u210e",plankv:"\u210f",plus:"+",plusacir:"\u2a23",plusb:"\u229e",pluscir:"\u2a22",plusdo:"\u2214",plusdu:"\u2a25",pluse:"\u2a72",PlusMinus:"\xb1",plusmn:"\xb1",plussim:"\u2a26",plustwo:"\u2a27",pm:"\xb1",Poincareplane:"\u210c",pointint:"\u2a15",Popf:"\u2119",popf:"\u{1d561}",pound:"\xa3",Pr:"\u2abb",pr:"\u227a",prap:"\u2ab7",prcue:"\u227c",prE:"\u2ab3",pre:"\u2aaf",prec:"\u227a",precapprox:"\u2ab7",preccurlyeq:"\u227c",Precedes:"\u227a",PrecedesEqual:"\u2aaf",PrecedesSlantEqual:"\u227c",PrecedesTilde:"\u227e",preceq:"\u2aaf",precnapprox:"\u2ab9",precneqq:"\u2ab5",precnsim:"\u22e8",precsim:"\u227e",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2ab9",prnE:"\u2ab5",prnsim:"\u22e8",prod:"\u220f",Product:"\u220f",profalar:"\u232e",profline:"\u2312",profsurf:"\u2313",prop:"\u221d",Proportion:"\u2237",Proportional:"\u221d",propto:"\u221d",prsim:"\u227e",prurel:"\u22b0",Pscr:"\u{1d4ab}",pscr:"\u{1d4c5}",Psi:"\u03a8",psi:"\u03c8",puncsp:"\u2008",Qfr:"\u{1d514}",qfr:"\u{1d52e}",qint:"\u2a0c",Qopf:"\u211a",qopf:"\u{1d562}",qprime:"\u2057",Qscr:"\u{1d4ac}",qscr:"\u{1d4c6}",quaternions:"\u210d",quatint:"\u2a16",quest:"?",questeq:"\u225f",QUOT:'"',quot:'"',rAarr:"\u21db",race:"\u223d\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221a",raemptyv:"\u29b3",Rang:"\u27eb",rang:"\u27e9",rangd:"\u2992",range:"\u29a5",rangle:"\u27e9",raquo:"\xbb",Rarr:"\u21a0",rArr:"\u21d2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21e5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291e",rarrhk:"\u21aa",rarrlp:"\u21ac",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21a3",rarrw:"\u219d",rAtail:"\u291c",ratail:"\u291a",ratio:"\u2236",rationals:"\u211a",RBarr:"\u2910",rBarr:"\u290f",rbarr:"\u290d",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298c",rbrksld:"\u298e",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201d",rdquor:"\u201d",rdsh:"\u21b3",Re:"\u211c",real:"\u211c",realine:"\u211b",realpart:"\u211c",reals:"\u211d",rect:"\u25ad",REG:"\xae",reg:"\xae",ReverseElement:"\u220b",ReverseEquilibrium:"\u21cb",ReverseUpEquilibrium:"\u296f",rfisht:"\u297d",rfloor:"\u230b",Rfr:"\u211c",rfr:"\u{1d52f}",rHar:"\u2964",rhard:"\u21c1",rharu:"\u21c0",rharul:"\u296c",Rho:"\u03a1",rho:"\u03c1",rhov:"\u03f1",RightAngleBracket:"\u27e9",RightArrow:"\u2192",Rightarrow:"\u21d2",rightarrow:"\u2192",RightArrowBar:"\u21e5",RightArrowLeftArrow:"\u21c4",rightarrowtail:"\u21a3",RightCeiling:"\u2309",RightDoubleBracket:"\u27e7",RightDownTeeVector:"\u295d",RightDownVector:"\u21c2",RightDownVectorBar:"\u2955",RightFloor:"\u230b",rightharpoondown:"\u21c1",rightharpoonup:"\u21c0",rightleftarrows:"\u21c4",rightleftharpoons:"\u21cc",rightrightarrows:"\u21c9",rightsquigarrow:"\u219d",RightTee:"\u22a2",RightTeeArrow:"\u21a6",RightTeeVector:"\u295b",rightthreetimes:"\u22cc",RightTriangle:"\u22b3",RightTriangleBar:"\u29d0",RightTriangleEqual:"\u22b5",RightUpDownVector:"\u294f",RightUpTeeVector:"\u295c",RightUpVector:"\u21be",RightUpVectorBar:"\u2954",RightVector:"\u21c0",RightVectorBar:"\u2953",ring:"\u02da",risingdotseq:"\u2253",rlarr:"\u21c4",rlhar:"\u21cc",rlm:"\u200f",rmoust:"\u23b1",rmoustache:"\u23b1",rnmid:"\u2aee",roang:"\u27ed",roarr:"\u21fe",robrk:"\u27e7",ropar:"\u2986",Ropf:"\u211d",ropf:"\u{1d563}",roplus:"\u2a2e",rotimes:"\u2a35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2a12",rrarr:"\u21c9",Rrightarrow:"\u21db",rsaquo:"\u203a",Rscr:"\u211b",rscr:"\u{1d4c7}",Rsh:"\u21b1",rsh:"\u21b1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22cc",rtimes:"\u22ca",rtri:"\u25b9",rtrie:"\u22b5",rtrif:"\u25b8",rtriltri:"\u29ce",RuleDelayed:"\u29f4",ruluhar:"\u2968",rx:"\u211e",Sacute:"\u015a",sacute:"\u015b",sbquo:"\u201a",Sc:"\u2abc",sc:"\u227b",scap:"\u2ab8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227d",scE:"\u2ab4",sce:"\u2ab0",Scedil:"\u015e",scedil:"\u015f",Scirc:"\u015c",scirc:"\u015d",scnap:"\u2aba",scnE:"\u2ab6",scnsim:"\u22e9",scpolint:"\u2a13",scsim:"\u227f",Scy:"\u0421",scy:"\u0441",sdot:"\u22c5",sdotb:"\u22a1",sdote:"\u2a66",searhk:"\u2925",seArr:"\u21d8",searr:"\u2198",searrow:"\u2198",sect:"\xa7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1d516}",sfr:"\u{1d530}",sfrown:"\u2322",sharp:"\u266f",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xad",Sigma:"\u03a3",sigma:"\u03c3",sigmaf:"\u03c2",sigmav:"\u03c2",sim:"\u223c",simdot:"\u2a6a",sime:"\u2243",simeq:"\u2243",simg:"\u2a9e",simgE:"\u2aa0",siml:"\u2a9d",simlE:"\u2a9f",simne:"\u2246",simplus:"\u2a24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2a33",smeparsl:"\u29e4",smid:"\u2223",smile:"\u2323",smt:"\u2aaa",smte:"\u2aac",smtes:"\u2aac\ufe00",SOFTcy:"\u042c",softcy:"\u044c",sol:"/",solb:"\u29c4",solbar:"\u233f",Sopf:"\u{1d54a}",sopf:"\u{1d564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\ufe00",sqcup:"\u2294",sqcups:"\u2294\ufe00",Sqrt:"\u221a",sqsub:"\u228f",sqsube:"\u2291",sqsubset:"\u228f",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25a1",Square:"\u25a1",square:"\u25a1",SquareIntersection:"\u2293",SquareSubset:"\u228f",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25aa",squf:"\u25aa",srarr:"\u2192",Sscr:"\u{1d4ae}",sscr:"\u{1d4c8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22c6",Star:"\u22c6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03f5",straightphi:"\u03d5",strns:"\xaf",Sub:"\u22d0",sub:"\u2282",subdot:"\u2abd",subE:"\u2ac5",sube:"\u2286",subedot:"\u2ac3",submult:"\u2ac1",subnE:"\u2acb",subne:"\u228a",subplus:"\u2abf",subrarr:"\u2979",Subset:"\u22d0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2ac5",SubsetEqual:"\u2286",subsetneq:"\u228a",subsetneqq:"\u2acb",subsim:"\u2ac7",subsub:"\u2ad5",subsup:"\u2ad3",succ:"\u227b",succapprox:"\u2ab8",succcurlyeq:"\u227d",Succeeds:"\u227b",SucceedsEqual:"\u2ab0",SucceedsSlantEqual:"\u227d",SucceedsTilde:"\u227f",succeq:"\u2ab0",succnapprox:"\u2aba",succneqq:"\u2ab6",succnsim:"\u22e9",succsim:"\u227f",SuchThat:"\u220b",Sum:"\u2211",sum:"\u2211",sung:"\u266a",Sup:"\u22d1",sup:"\u2283",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",supdot:"\u2abe",supdsub:"\u2ad8",supE:"\u2ac6",supe:"\u2287",supedot:"\u2ac4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27c9",suphsub:"\u2ad7",suplarr:"\u297b",supmult:"\u2ac2",supnE:"\u2acc",supne:"\u228b",supplus:"\u2ac0",Supset:"\u22d1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2ac6",supsetneq:"\u228b",supsetneqq:"\u2acc",supsim:"\u2ac8",supsub:"\u2ad4",supsup:"\u2ad6",swarhk:"\u2926",swArr:"\u21d9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292a",szlig:"\xdf",Tab:"\t",target:"\u2316",Tau:"\u03a4",tau:"\u03c4",tbrk:"\u23b4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20db",telrec:"\u2315",Tfr:"\u{1d517}",tfr:"\u{1d531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03b8",thetasym:"\u03d1",thetav:"\u03d1",thickapprox:"\u2248",thicksim:"\u223c",ThickSpace:"\u205f\u200a",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223c",THORN:"\xde",thorn:"\xfe",Tilde:"\u223c",tilde:"\u02dc",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xd7",timesb:"\u22a0",timesbar:"\u2a31",timesd:"\u2a30",tint:"\u222d",toea:"\u2928",top:"\u22a4",topbot:"\u2336",topcir:"\u2af1",Topf:"\u{1d54b}",topf:"\u{1d565}",topfork:"\u2ada",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25b5",triangledown:"\u25bf",triangleleft:"\u25c3",trianglelefteq:"\u22b4",triangleq:"\u225c",triangleright:"\u25b9",trianglerighteq:"\u22b5",tridot:"\u25ec",trie:"\u225c",triminus:"\u2a3a",TripleDot:"\u20db",triplus:"\u2a39",trisb:"\u29cd",tritime:"\u2a3b",trpezium:"\u23e2",Tscr:"\u{1d4af}",tscr:"\u{1d4c9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040b",tshcy:"\u045b",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226c",twoheadleftarrow:"\u219e",twoheadrightarrow:"\u21a0",Uacute:"\xda",uacute:"\xfa",Uarr:"\u219f",uArr:"\u21d1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040e",ubrcy:"\u045e",Ubreve:"\u016c",ubreve:"\u016d",Ucirc:"\xdb",ucirc:"\xfb",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21c5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296e",ufisht:"\u297e",Ufr:"\u{1d518}",ufr:"\u{1d532}",Ugrave:"\xd9",ugrave:"\xf9",uHar:"\u2963",uharl:"\u21bf",uharr:"\u21be",uhblk:"\u2580",ulcorn:"\u231c",ulcorner:"\u231c",ulcrop:"\u230f",ultri:"\u25f8",Umacr:"\u016a",umacr:"\u016b",uml:"\xa8",UnderBar:"_",UnderBrace:"\u23df",UnderBracket:"\u23b5",UnderParenthesis:"\u23dd",Union:"\u22c3",UnionPlus:"\u228e",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1d54c}",uopf:"\u{1d566}",UpArrow:"\u2191",Uparrow:"\u21d1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21c5",UpDownArrow:"\u2195",Updownarrow:"\u21d5",updownarrow:"\u2195",UpEquilibrium:"\u296e",upharpoonleft:"\u21bf",upharpoonright:"\u21be",uplus:"\u228e",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03d2",upsi:"\u03c5",upsih:"\u03d2",Upsilon:"\u03a5",upsilon:"\u03c5",UpTee:"\u22a5",UpTeeArrow:"\u21a5",upuparrows:"\u21c8",urcorn:"\u231d",urcorner:"\u231d",urcrop:"\u230e",Uring:"\u016e",uring:"\u016f",urtri:"\u25f9",Uscr:"\u{1d4b0}",uscr:"\u{1d4ca}",utdot:"\u22f0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25b5",utrif:"\u25b4",uuarr:"\u21c8",Uuml:"\xdc",uuml:"\xfc",uwangle:"\u29a7",vangrt:"\u299c",varepsilon:"\u03f5",varkappa:"\u03f0",varnothing:"\u2205",varphi:"\u03d5",varpi:"\u03d6",varpropto:"\u221d",vArr:"\u21d5",varr:"\u2195",varrho:"\u03f1",varsigma:"\u03c2",varsubsetneq:"\u228a\ufe00",varsubsetneqq:"\u2acb\ufe00",varsupsetneq:"\u228b\ufe00",varsupsetneqq:"\u2acc\ufe00",vartheta:"\u03d1",vartriangleleft:"\u22b2",vartriangleright:"\u22b3",Vbar:"\u2aeb",vBar:"\u2ae8",vBarv:"\u2ae9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22ab",Vdash:"\u22a9",vDash:"\u22a8",vdash:"\u22a2",Vdashl:"\u2ae6",Vee:"\u22c1",vee:"\u2228",veebar:"\u22bb",veeeq:"\u225a",vellip:"\u22ee",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200a",Vfr:"\u{1d519}",vfr:"\u{1d533}",vltri:"\u22b2",vnsub:"\u2282\u20d2",vnsup:"\u2283\u20d2",Vopf:"\u{1d54d}",vopf:"\u{1d567}",vprop:"\u221d",vrtri:"\u22b3",Vscr:"\u{1d4b1}",vscr:"\u{1d4cb}",vsubnE:"\u2acb\ufe00",vsubne:"\u228a\ufe00",vsupnE:"\u2acc\ufe00",vsupne:"\u228b\ufe00",Vvdash:"\u22aa",vzigzag:"\u299a",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2a5f",Wedge:"\u22c0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1d51a}",wfr:"\u{1d534}",Wopf:"\u{1d54e}",wopf:"\u{1d568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1d4b2}",wscr:"\u{1d4cc}",xcap:"\u22c2",xcirc:"\u25ef",xcup:"\u22c3",xdtri:"\u25bd",Xfr:"\u{1d51b}",xfr:"\u{1d535}",xhArr:"\u27fa",xharr:"\u27f7",Xi:"\u039e",xi:"\u03be",xlArr:"\u27f8",xlarr:"\u27f5",xmap:"\u27fc",xnis:"\u22fb",xodot:"\u2a00",Xopf:"\u{1d54f}",xopf:"\u{1d569}",xoplus:"\u2a01",xotime:"\u2a02",xrArr:"\u27f9",xrarr:"\u27f6",Xscr:"\u{1d4b3}",xscr:"\u{1d4cd}",xsqcup:"\u2a06",xuplus:"\u2a04",xutri:"\u25b3",xvee:"\u22c1",xwedge:"\u22c0",Yacute:"\xdd",yacute:"\xfd",YAcy:"\u042f",yacy:"\u044f",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042b",ycy:"\u044b",yen:"\xa5",Yfr:"\u{1d51c}",yfr:"\u{1d536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1d550}",yopf:"\u{1d56a}",Yscr:"\u{1d4b4}",yscr:"\u{1d4ce}",YUcy:"\u042e",yucy:"\u044e",Yuml:"\u0178",yuml:"\xff",Zacute:"\u0179",zacute:"\u017a",Zcaron:"\u017d",zcaron:"\u017e",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017b",zdot:"\u017c",zeetrf:"\u2128",ZeroWidthSpace:"\u200b",Zeta:"\u0396",zeta:"\u03b6",Zfr:"\u2128",zfr:"\u{1d537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21dd",Zopf:"\u2124",zopf:"\u{1d56b}",Zscr:"\u{1d4b5}",zscr:"\u{1d4cf}",zwj:"\u200d",zwnj:"\u200c"}),e.entityMap=e.HTML_ENTITIES},918(t,e,s){"use strict";function i(t,e){t.prototype=Object.create(Error.prototype,{constructor:{value:t},name:{value:t.name,enumerable:!0,writable:e}})}var n=s(981).freeze({Error:"Error",IndexSizeError:"IndexSizeError",DomstringSizeError:"DomstringSizeError",HierarchyRequestError:"HierarchyRequestError",WrongDocumentError:"WrongDocumentError",InvalidCharacterError:"InvalidCharacterError",NoDataAllowedError:"NoDataAllowedError",NoModificationAllowedError:"NoModificationAllowedError",NotFoundError:"NotFoundError",NotSupportedError:"NotSupportedError",InUseAttributeError:"InUseAttributeError",InvalidStateError:"InvalidStateError",SyntaxError:"SyntaxError",InvalidModificationError:"InvalidModificationError",NamespaceError:"NamespaceError",InvalidAccessError:"InvalidAccessError",ValidationError:"ValidationError",TypeMismatchError:"TypeMismatchError",SecurityError:"SecurityError",NetworkError:"NetworkError",AbortError:"AbortError",URLMismatchError:"URLMismatchError",QuotaExceededError:"QuotaExceededError",TimeoutError:"TimeoutError",InvalidNodeTypeError:"InvalidNodeTypeError",DataCloneError:"DataCloneError",EncodingError:"EncodingError",NotReadableError:"NotReadableError",UnknownError:"UnknownError",ConstraintError:"ConstraintError",DataError:"DataError",TransactionInactiveError:"TransactionInactiveError",ReadOnlyError:"ReadOnlyError",VersionError:"VersionError",OperationError:"OperationError",NotAllowedError:"NotAllowedError",OptOutError:"OptOutError"}),r=Object.keys(n);function o(t){return"number"==typeof t&&t>=1&&t<=25}function a(t,e){var s;o(t)?(this.name=r[t],this.message=e||""):(this.message=t,this.name="string"==typeof(s=e)&&s.substring(s.length-n.Error.length)===n.Error?e:n.Error),Error.captureStackTrace&&Error.captureStackTrace(this,a)}i(a,!0),Object.defineProperties(a.prototype,{code:{enumerable:!0,get:function(){var t=r.indexOf(this.name);return o(t)?t:0}}});for(var l={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},h=Object.entries(l),c=0;c<h.length;c++){a[h[c][0]]=h[c][1]}function d(t,e){this.message=t,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,d)}i(d),e.DOMException=a,e.DOMExceptionName=n,e.ExceptionCode=l,e.ParseError=d},112(t,e){"use strict";function s(t){try{"function"!=typeof t&&(t=RegExp);var e=new t("\u{1d306}","u").exec("\u{1d306}");return!!e&&2===e[0].length}catch(t){}return!1}var i=s();function n(t){if("["!==t.source[0])throw new Error(t+" can not be used with chars");return t.source.slice(1,t.source.lastIndexOf("]"))}function r(t,e){if("["!==t.source[0])throw new Error("/"+t.source+"/ can not be used with chars_without");if(!e||"string"!=typeof e)throw new Error(JSON.stringify(e)+" is not a valid search");if(-1===t.source.indexOf(e))throw new Error('"'+e+'" is not is /'+t.source+"/");if("-"===e&&1!==t.source.indexOf(e))throw new Error('"'+e+'" is not at the first postion of /'+t.source+"/");return new RegExp(t.source.replace(e,""),i?"u":"")}function o(t){var e=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(t){var s="string"==typeof t;if(s&&void 0===e&&"|"===t)throw new Error("use regg instead of reg to wrap expressions with `|`!");return s?t:t.source}).join(""),i?"mu":"m")}function a(t){if(0===arguments.length)throw new Error("no parameters provided");return o.apply(a,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}var l=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;i&&(l=o("[",n(l),"\\u{10000}-\\u{10FFFF}","]"));var h=new RegExp("[^"+n(l)+"]",i?"u":""),c=/[\x20\x09\x0D\x0A]/,d=n(c),u=o(c,"+"),p=o(c,"*"),m=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;i&&(m=o("[",n(m),"\\u{10000}-\\u{10FFFF}","]"));var f=o("[",n(m),n(/[-.0-9\xB7]/),n(/[\u0300-\u036F\u203F-\u2040]/),"]"),g=o(m,f,"*"),b=o(f,"+"),E=o("&",g,";"),x=a(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),y=a(E,"|",x),N=o("%",g,";"),T=a(o('"',a(/[^%&"]/,"|",N,"|",y),"*",'"'),"|",o("'",a(/[^%&']/,"|",N,"|",y),"*","'")),v=a('"',a(/[^<&"]/,"|",y),"*",'"',"|","'",a(/[^<&']/,"|",y),"*","'"),L=o(r(m,":"),r(f,":"),"*"),C=o(L,a(":",L),"?"),R=o("^",C,"$"),I=o("(",C,")"),S=a(/"[^"]*"|'[^']*'/),A=o(/^<\?/,"(",g,")",a(u,"(",l,"*?)"),"?",/\?>/),w=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,O=a('"',w,'*"',"|","'",r(w,"'"),"*'"),M="\x3c!--",D=o(M,a(r(l,"-"),"|",o("-",r(l,"-"))),"*","--\x3e"),k="#PCDATA",P=a(o(/\(/,p,k,a(p,/\|/,p,C),"*",p,/\)\*/),"|",o(/\(/,p,k,p,/\)/)),B=a("EMPTY","|","ANY","|",P,"|",o(/\([^>]+\)/,/[?*+]?/)),j=o("<!ELEMENT",u,a(C,"|",N),u,a(B,"|",N),p,">"),_=o("NOTATION",u,/\(/,p,g,a(p,/\|/,p,g),"*",p,/\)/),F=o(/\(/,p,b,a(p,/\|/,p,b),"*",p,/\)/),U=a(_,"|",F),H=a(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",U),W=a(/#REQUIRED|#IMPLIED/,"|",a(a("#FIXED",u),"?",v)),V=o("<!ATTLIST",u,g,a(u,g,u,H,u,W),"*",p,">"),q="about:legacy-compat",X=a('"'+q+'"',"|","'"+q+"'"),z="SYSTEM",G="PUBLIC",J=a(a(z,u,S),"|",a(G,u,O,u,S)),K=o("^",a(a(z,u,"(?<SystemLiteralOnly>",S,")"),"|",a(G,u,"(?<PubidLiteral>",O,")",u,"(?<SystemLiteral>",S,")"))),$=o("^",O,"$"),Y=o("^",S,"$"),Q=a(u,"NDATA",u,g),Z="<!ENTITY",tt=o(Z,u,g,u,a(T,"|",a(J,Q,"?")),p,">"),et=a(T,"|",J),st=a(tt,"|",o(Z,u,"%",u,g,u,et,p,">")),it=o(G,u,O),nt=o("<!NOTATION",u,g,u,a(J,"|",it),p,">"),rt=o(p,"=",p),ot=/1[.]\d+/,at=o(u,"version",rt,a("'",ot,"'","|",'"',ot,'"')),lt=/[A-Za-z][-A-Za-z0-9._]*/,ht=o(/^<\?xml/,at,a(u,"encoding",rt,a('"',lt,'"',"|","'",lt,"'")),"?",a(u,"standalone",rt,a("'",a("yes","|","no"),"'","|",'"',a("yes","|","no"),'"')),"?",p,/\?>/),ct=o(l,"*?",/\]\]>/),dt=o(/<!\[CDATA\[/,ct);e.chars=n,e.chars_without=r,e.detectUnicodeSupport=s,e.reg=o,e.regg=a,e.ABOUT_LEGACY_COMPAT=q,e.ABOUT_LEGACY_COMPAT_SystemLiteral=X,e.AttlistDecl=V,e.CDATA_START="<![CDATA[",e.CDATA_END="]]>",e.CDSect=dt,e.Char=l,e.Comment=D,e.COMMENT_START=M,e.COMMENT_END="--\x3e",e.DOCTYPE_DECL_START="<!DOCTYPE",e.elementdecl=j,e.EntityDecl=st,e.EntityValue=T,e.ExternalID=J,e.ExternalID_match=K,e.Name=g,e.NotationDecl=nt,e.Reference=y,e.PEReference=N,e.PI=A,e.PUBLIC=G,e.PubidLiteral=O,e.PubidLiteral_match=$,e.QName=C,e.QName_exact=R,e.QName_group=I,e.S=u,e.SChar_s=d,e.S_OPT=p,e.SYSTEM=z,e.SystemLiteral=S,e.SystemLiteral_match=Y,e.InvalidChar=h,e.UNICODE_REPLACEMENT_CHARACTER="\ufffd",e.UNICODE_SUPPORT=i,e.XMLDecl=ht},841(t,e,s){"use strict";var i=s(981);e.assign=i.assign,e.hasDefaultHTMLNamespace=i.hasDefaultHTMLNamespace,e.isHTMLMimeType=i.isHTMLMimeType,e.isValidMimeType=i.isValidMimeType,e.MIME_TYPE=i.MIME_TYPE,e.NAMESPACE=i.NAMESPACE;var n=s(918);e.DOMException=n.DOMException,e.DOMExceptionName=n.DOMExceptionName,e.ExceptionCode=n.ExceptionCode,e.ParseError=n.ParseError;var r=s(553);e.Attr=r.Attr,e.CDATASection=r.CDATASection,e.CharacterData=r.CharacterData,e.Comment=r.Comment,e.Document=r.Document,e.DocumentFragment=r.DocumentFragment,e.DocumentType=r.DocumentType,e.DOMImplementation=r.DOMImplementation,e.Element=r.Element,e.Entity=r.Entity,e.EntityReference=r.EntityReference,e.LiveNodeList=r.LiveNodeList,e.NamedNodeMap=r.NamedNodeMap,e.Node=r.Node,e.NodeList=r.NodeList,e.Notation=r.Notation,e.ProcessingInstruction=r.ProcessingInstruction,e.Text=r.Text,e.XMLSerializer=r.XMLSerializer;var o=s(985);e.DOMParser=o.DOMParser,e.normalizeLineEndings=o.normalizeLineEndings,e.onErrorStopParsing=o.onErrorStopParsing,e.onWarningStopParsing=o.onWarningStopParsing},309(t,e,s){"use strict";var i=s(981),n=s(112),r=s(918),o=i.isHTMLEscapableRawTextElement,a=i.isHTMLMimeType,l=i.isHTMLRawTextElement,h=i.hasOwn,c=i.NAMESPACE,d=r.ParseError,u=r.DOMException;function p(){}p.prototype={parse:function(t,e,s){var r=this.domBuilder;r.startDocument(),x(e,e=Object.create(null)),function(t,e,s,r,o){var l=a(r.mimeType);t.indexOf(n.UNICODE_REPLACEMENT_CHARACTER)>=0&&o.warning("Unicode replacement character detected, source encoding issues?");function c(t){if(t>65535){var e=55296+((t-=65536)>>10),s=56320+(1023&t);return String.fromCharCode(e,s)}return String.fromCharCode(t)}function p(t){var e=";"===t[t.length-1]?t:t+";";if(!l&&e!==t)return o.error("EntityRef: expecting ;"),t;var i=n.Reference.exec(e);if(!i||i[0].length!==e.length)return o.error("entity not matching Reference production: "+t),t;var r=e.slice(1,-1);return h(s,r)?s[r]:"#"===r.charAt(0)?c(parseInt(r.substring(1).replace("x","0x"))):(o.error("entity not found:"+t),t)}function x(e){if(e>w){var s=t.substring(w,e).replace(m,p);R&&I(w),r.characters(s,0,e-w),w=e}}var y=0,L=0,C=/\r\n?|\n|$/g,R=r.locator;function I(e,s){for(;e>=L&&(s=C.exec(t));)y=L,L=s.index+s[0].length,R.lineNumber++;R.columnNumber=e-y+1}var S=[{currentNSMap:e}],A=[],w=0;for(;;){try{var O=t.indexOf("<",w);if(O<0){if(!l&&A.length>0)return o.fatalError("unclosed xml tag(s): "+A.join(", "));if(!t.substring(w).match(/^\s*$/)){var M=r.doc,D=M.createTextNode(t.substring(w));if(M.documentElement)return o.error("Extra content at the end of the document");M.appendChild(D),r.currentElement=D}return}if(O>w){var k=t.substring(w,O);l||0!==A.length||(k=k.replace(new RegExp(n.S_OPT.source,"g"),""))&&o.error("Unexpected content outside root element: '"+k+"'"),x(O)}switch(t.charAt(O+1)){case"/":var P=t.indexOf(">",O+2),B=t.substring(O+2,P>0?P:void 0);if(!B)return o.fatalError("end tag name missing");var j=P>0&&n.reg("^",n.QName_group,n.S_OPT,"$").exec(B);if(!j)return o.fatalError('end tag name contains invalid characters: "'+B+'"');if(!r.currentElement&&!r.doc.documentElement)return;var _=A[A.length-1]||r.currentElement.tagName||r.doc.documentElement.tagName||"";if(_!==j[1]){var F=j[1].toLowerCase();if(!l||_.toLowerCase()!==F)return o.fatalError('Opening and ending tag mismatch: "'+_+'" != "'+B+'"')}var U=S.pop();A.pop();var H=U.localNSMap;if(r.endElement(U.uri,U.localName,_),H)for(var W in H)h(H,W)&&r.endPrefixMapping(W);P++;break;case"?":R&&I(O),P=T(t,O,r,o);break;case"!":R&&I(O),P=N(t,O,r,o,l);break;default:R&&I(O);var V=new v,q=S[S.length-1].currentNSMap,X=(P=g(t,O,V,q,p,o,l),V.length);if(V.closed||(l&&i.isHTMLVoidElement(V.tagName)?V.closed=!0:A.push(V.tagName)),R&&X){for(var z=f(R,{}),G=0;G<X;G++){var J=V[G];I(J.offset),J.locator=f(R,{})}r.locator=z,b(V,r,q)&&S.push(V),r.locator=R}else b(V,r,q)&&S.push(V);l&&!V.closed?P=E(t,P,V.tagName,p,r):P++}}catch(t){if(t instanceof d)throw t;if(t instanceof u)throw new d(t.name+": "+t.message,r.locator,t);o.error("element parse error: "+t),P=-1}P>w?w=P:x(Math.max(O,w)+1)}}(t,e,s,r,this.errorHandler),r.endDocument()}};var m=/&#?\w+;?/g;function f(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function g(t,e,s,i,n,r,o){function a(t,e,i){return h(s.attributeNames,t)?r.fatalError("Attribute "+t+" redefined"):!o&&e.indexOf("<")>=0?r.fatalError("Unescaped '<' not allowed in attributes values"):void s.addValue(t,e.replace(/[\t\n\r]/g," ").replace(m,n),i)}for(var l,c=++e,d=0;;){var u=t.charAt(c);switch(u){case"=":if(1===d)l=t.slice(e,c),d=3;else{if(2!==d)throw new Error("attribute equal must after attrName");d=3}break;case"'":case'"':if(3===d||1===d){if(1===d&&(r.warning('attribute value must after "="'),l=t.slice(e,c)),e=c+1,!((c=t.indexOf(u,e))>0))throw new Error("attribute value no end '"+u+"' match");a(l,p=t.slice(e,c),e-1),d=5}else{if(4!=d)throw new Error('attribute value must after "="');a(l,p=t.slice(e,c),e),r.warning('attribute "'+l+'" missed start quot('+u+")!!"),e=c+1,d=5}break;case"/":switch(d){case 0:s.setTagName(t.slice(e,c));case 5:case 6:case 7:d=7,s.closed=!0;case 4:case 1:break;case 2:s.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return r.error("unexpected end of input"),0==d&&s.setTagName(t.slice(e,c)),c;case">":switch(d){case 0:s.setTagName(t.slice(e,c));case 5:case 6:case 7:break;case 4:case 1:"/"===(p=t.slice(e,c)).slice(-1)&&(s.closed=!0,p=p.slice(0,-1));case 2:2===d&&(p=l),4==d?(r.warning('attribute "'+p+'" missed quot(")!'),a(l,p,e)):(o||r.warning('attribute "'+p+'" missed value!! "'+p+'" instead!!'),a(p,p,e));break;case 3:if(!o)return r.fatalError("AttValue: ' or \" expected")}return c;case"\x80":u=" ";default:if(u<=" ")switch(d){case 0:s.setTagName(t.slice(e,c)),d=6;break;case 1:l=t.slice(e,c),d=2;break;case 4:var p=t.slice(e,c);r.warning('attribute "'+p+'" missed quot(")!!'),a(l,p,e);case 5:d=6}else switch(d){case 2:o||r.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),a(l,l,e),e=c,d=1;break;case 5:r.warning('attribute space is required"'+l+'"!!');case 6:d=1,e=c;break;case 3:d=4,e=c;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function b(t,e,s){for(var i=t.tagName,n=null,r=t.length;r--;){var o=t[r],a=o.qName,l=o.value;if((m=a.indexOf(":"))>0)var d=o.prefix=a.slice(0,m),u=a.slice(m+1),p="xmlns"===d&&u;else u=a,d=null,p="xmlns"===a&&"";o.localName=u,!1!==p&&(null==n&&(n=Object.create(null),x(s,s=Object.create(null))),s[p]=n[p]=l,o.uri=c.XMLNS,e.startPrefixMapping(p,l))}for(r=t.length;r--;)(o=t[r]).prefix&&("xml"===o.prefix&&(o.uri=c.XML),"xmlns"!==o.prefix&&(o.uri=s[o.prefix]));var m;(m=i.indexOf(":"))>0?(d=t.prefix=i.slice(0,m),u=t.localName=i.slice(m+1)):(d=null,u=t.localName=i);var f=t.uri=s[d||""];if(e.startElement(f,u,i,t),!t.closed)return t.currentNSMap=s,t.localNSMap=n,!0;if(e.endElement(f,u,i),n)for(d in n)h(n,d)&&e.endPrefixMapping(d)}function E(t,e,s,i,n){var r=o(s);if(r||l(s)){var a=t.indexOf("</"+s+">",e),h=t.substring(e+1,a);return r&&(h=h.replace(m,i)),n.characters(h,0,h.length),a}return e+1}function x(t,e){for(var s in t)h(t,s)&&(e[s]=t[s])}function y(t,e){var s=e;function i(e){return e=e||0,t.charAt(s+e)}function r(t){s+=t=t||1}function o(){return t.substring(s)}return{char:i,getIndex:function(){return s},getMatch:function(t){var e=n.reg("^",t).exec(o());return e?(r(e[0].length),e[0]):null},getSource:function(){return t},skip:r,skipBlanks:function(){for(var e=0;s<t.length;){var n=i();if(" "!==n&&"\n"!==n&&"\t"!==n&&"\r"!==n)return e;e++,r()}return-1},substringFromIndex:o,substringStartsWith:function(e){return t.substring(s,s+e.length)===e},substringStartsWithCaseInsensitive:function(e){return t.substring(s,s+e.length).toUpperCase()===e.toUpperCase()}}}function N(t,e,s,i,r){var o=y(t,e);switch(r?o.char(2).toUpperCase():o.char(2)){case"-":var a=o.getMatch(n.Comment);return a?(s.comment(a,n.COMMENT_START.length,a.length-n.COMMENT_START.length-n.COMMENT_END.length),o.getIndex()):i.fatalError("comment is not well-formed at position "+o.getIndex());case"[":var l=o.getMatch(n.CDSect);return l?r||s.currentElement?(s.startCDATA(),s.characters(l,n.CDATA_START.length,l.length-n.CDATA_START.length-n.CDATA_END.length),s.endCDATA(),o.getIndex()):i.fatalError("CDATA outside of element"):i.fatalError("Invalid CDATA starting at position "+e);case"D":if(s.doc&&s.doc.documentElement)return i.fatalError("Doctype not allowed inside or after documentElement at position "+o.getIndex());if(r?!o.substringStartsWithCaseInsensitive(n.DOCTYPE_DECL_START):!o.substringStartsWith(n.DOCTYPE_DECL_START))return i.fatalError("Expected "+n.DOCTYPE_DECL_START+" at position "+o.getIndex());if(o.skip(n.DOCTYPE_DECL_START.length),o.skipBlanks()<1)return i.fatalError("Expected whitespace after "+n.DOCTYPE_DECL_START+" at position "+o.getIndex());var h={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(h.name=o.getMatch(n.Name),!h.name)return i.fatalError("doctype name missing or contains unexpected characters at position "+o.getIndex());if(r&&"html"!==h.name.toLowerCase()&&i.warning("Unexpected DOCTYPE in HTML document at position "+o.getIndex()),o.skipBlanks(),o.substringStartsWith(n.PUBLIC)||o.substringStartsWith(n.SYSTEM)){var c=n.ExternalID_match.exec(o.substringFromIndex());if(!c)return i.fatalError("doctype external id is not well-formed at position "+o.getIndex());void 0!==c.groups.SystemLiteralOnly?h.systemId=c.groups.SystemLiteralOnly:(h.systemId=c.groups.SystemLiteral,h.publicId=c.groups.PubidLiteral),o.skip(c[0].length)}else if(r&&o.substringStartsWithCaseInsensitive(n.SYSTEM)){if(o.skip(n.SYSTEM.length),o.skipBlanks()<1)return i.fatalError("Expected whitespace after "+n.SYSTEM+" at position "+o.getIndex());if(h.systemId=o.getMatch(n.ABOUT_LEGACY_COMPAT_SystemLiteral),!h.systemId)return i.fatalError("Expected "+n.ABOUT_LEGACY_COMPAT+" in single or double quotes after "+n.SYSTEM+" at position "+o.getIndex())}return r&&h.systemId&&!n.ABOUT_LEGACY_COMPAT_SystemLiteral.test(h.systemId)&&i.warning("Unexpected doctype.systemId in HTML document at position "+o.getIndex()),r||(o.skipBlanks(),h.internalSubset=function(t,e){function s(t,e){var s=n.PI.exec(t.substringFromIndex());return s?"xml"===s[1].toLowerCase()?e.fatalError("xml declaration is only allowed at the start of the document, but found at position "+t.getIndex()):(t.skip(s[0].length),s[0]):e.fatalError("processing instruction is not well-formed at position "+t.getIndex())}var i=t.getSource();if("["===t.char()){t.skip(1);for(var r=t.getIndex();t.getIndex()<i.length;){if(t.skipBlanks(),"]"===t.char()){var o=i.substring(r,t.getIndex());return t.skip(1),o}var a=null;if("<"===t.char()&&"!"===t.char(1))switch(t.char(2)){case"E":"L"===t.char(3)?a=t.getMatch(n.elementdecl):"N"===t.char(3)&&(a=t.getMatch(n.EntityDecl));break;case"A":a=t.getMatch(n.AttlistDecl);break;case"N":a=t.getMatch(n.NotationDecl);break;case"-":a=t.getMatch(n.Comment)}else if("<"===t.char()&&"?"===t.char(1))a=s(t,e);else{if("%"!==t.char())return e.fatalError("Error detected in Markup declaration");a=t.getMatch(n.PEReference)}if(!a)return e.fatalError("Error in internal subset at position "+t.getIndex())}return e.fatalError("doctype internal subset is not well-formed, missing ]")}}(o,i)),o.skipBlanks(),">"!==o.char()?i.fatalError("doctype not terminated with > at position "+o.getIndex()):(o.skip(1),s.startDTD(h.name,h.publicId,h.systemId,h.internalSubset),s.endDTD(),o.getIndex());default:return i.fatalError('Not well-formed XML starting with "<!" at position '+e)}}function T(t,e,s,i){var r=t.substring(e).match(n.PI);if(!r)return i.fatalError("Invalid processing instruction starting at position "+e);if("xml"===r[1].toLowerCase()){if(e>0)return i.fatalError("processing instruction at position "+e+" is an xml declaration which is only at the start of the document");if(!n.XMLDecl.test(t.substring(e)))return i.fatalError("xml declaration is not well-formed")}return s.processingInstruction(r[1],r[2]),e+r[0].length}function v(){this.attributeNames=Object.create(null)}v.prototype={setTagName:function(t){if(!n.QName_exact.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},addValue:function(t,e,s){if(!n.QName_exact.test(t))throw new Error("invalid attribute:"+t);this.attributeNames[t]=this.length,this[this.length++]={qName:t,value:e,offset:s}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}},e.XMLReader=p,e.parseUtils=y,e.parseDoctypeCommentOrCData=N},999(t,e,s){(function(){"use strict";var e=this;function s(t){return"string"==typeof t}function i(t,e,s){return t.call.apply(t.bind,arguments)}function n(t,e,s){if(!t)throw Error();if(2<arguments.length){var i=Array.prototype.slice.call(arguments,2);return function(){var s=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(s,i),t.apply(e,s)}}return function(){return t.apply(e,arguments)}}function r(t,e,s){return(r=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?i:n).apply(null,arguments)}function o(t){var e=ot;function s(){}s.prototype=e.prototype,t.G=e.prototype,t.prototype=new s,t.prototype.constructor=t,t.F=function(t,s,i){for(var n=Array(arguments.length-2),r=2;r<arguments.length;r++)n[r-2]=arguments[r];return e.prototype[s].apply(t,n)}}var a=String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};function l(t,e){return-1!=t.indexOf(e)}function h(t,e){return t<e?-1:t>e?1:0}var c,d=Array.prototype.indexOf?function(t,e,s){return Array.prototype.indexOf.call(t,e,s)}:function(t,e,i){if(i=null==i?0:0>i?Math.max(0,t.length+i):i,s(t))return s(e)&&1==e.length?t.indexOf(e,i):-1;for(;i<t.length;i++)if(i in t&&t[i]===e)return i;return-1},u=Array.prototype.forEach?function(t,e,s){Array.prototype.forEach.call(t,e,s)}:function(t,e,i){for(var n=t.length,r=s(t)?t.split(""):t,o=0;o<n;o++)o in r&&e.call(i,r[o],o,t)},p=Array.prototype.filter?function(t,e,s){return Array.prototype.filter.call(t,e,s)}:function(t,e,i){for(var n=t.length,r=[],o=0,a=s(t)?t.split(""):t,l=0;l<n;l++)if(l in a){var h=a[l];e.call(i,h,l,t)&&(r[o++]=h)}return r},m=Array.prototype.reduce?function(t,e,s,i){return i&&(e=r(e,i)),Array.prototype.reduce.call(t,e,s)}:function(t,e,s,i){var n=s;return u(t,function(s,r){n=e.call(i,n,s,r,t)}),n},f=Array.prototype.some?function(t,e,s){return Array.prototype.some.call(t,e,s)}:function(t,e,i){for(var n=t.length,r=s(t)?t.split(""):t,o=0;o<n;o++)if(o in r&&e.call(i,r[o],o,t))return!0;return!1};t:{var g=e.navigator;if(g){var b=g.userAgent;if(b){c=b;break t}}c=""}var E,x,y=l(c,"Opera")||l(c,"OPR"),N=l(c,"Trident")||l(c,"MSIE"),T=l(c,"Edge"),v=l(c,"Gecko")&&!(l(c.toLowerCase(),"webkit")&&!l(c,"Edge"))&&!(l(c,"Trident")||l(c,"MSIE"))&&!l(c,"Edge"),L=l(c.toLowerCase(),"webkit")&&!l(c,"Edge");function C(){var t=e.document;return t?t.documentMode:void 0}t:{var R="",I=(x=c,v?/rv\:([^\);]+)(\)|;)/.exec(x):T?/Edge\/([\d\.]+)/.exec(x):N?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(x):L?/WebKit\/(\S+)/.exec(x):y?/(?:Version)[ \/]?(\S+)/.exec(x):void 0);if(I&&(R=I?I[1]:""),N){var S=C();if(null!=S&&S>parseFloat(R)){E=String(S);break t}}E=R}var A={};function w(t){if(!A[t]){for(var e=0,s=a(String(E)).split("."),i=a(String(t)).split("."),n=Math.max(s.length,i.length),r=0;0==e&&r<n;r++){var o=s[r]||"",l=i[r]||"",c=/(\d*)(\D*)/g,d=/(\d*)(\D*)/g;do{var u=c.exec(o)||["","",""],p=d.exec(l)||["","",""];if(0==u[0].length&&0==p[0].length)break;e=h(0==u[1].length?0:parseInt(u[1],10),0==p[1].length?0:parseInt(p[1],10))||h(0==u[2].length,0==p[2].length)||h(u[2],p[2])}while(0==e)}A[t]=0<=e}}var O=e.document,M=O&&N?C()||("CSS1Compat"==O.compatMode?parseInt(E,10):5):void 0,D=N&&!(9<=Number(M)),k=N&&!(8<=Number(M));function P(t,e,s,i){this.a=t,this.nodeName=s,this.nodeValue=i,this.nodeType=2,this.parentNode=this.ownerElement=e}function B(t,e){var s=k&&"href"==e.nodeName?t.getAttribute(e.nodeName,2):e.nodeValue;return new P(e,t,e.nodeName,s)}function j(t){var e=null;if(1==(s=t.nodeType)&&(e=null==(e=null==(e=t.textContent)||null==e?t.innerText:e)||null==e?"":e),"string"!=typeof e)if(D&&"title"==t.nodeName.toLowerCase()&&1==s)e=t.text;else if(9==s||1==s){t=9==s?t.documentElement:t.firstChild;var s=0,i=[];for(e="";t;){do{1!=t.nodeType&&(e+=t.nodeValue),D&&"title"==t.nodeName.toLowerCase()&&(e+=t.text),i[s++]=t}while(t=t.firstChild);for(;s&&!(t=i[--s].nextSibling););}}else e=t.nodeValue;return""+e}function _(t,e,s){if(null===e)return!0;try{if(!t.getAttribute)return!1}catch(t){return!1}return k&&"class"==e&&(e="className"),null==s?!!t.getAttribute(e):t.getAttribute(e,2)==s}function F(t,e,i,n,r){return(D?U:H).call(null,t,e,s(i)?i:null,s(n)?n:null,r||new $)}function U(t,e,s,i,n){if(t instanceof kt||8==t.b||s&&null===t.b){var r=e.all;if(!r)return n;if("*"!=(t=X(t))&&!(r=e.getElementsByTagName(t)))return n;if(s){for(var o=[],a=0;e=r[a++];)_(e,s,i)&&o.push(e);r=o}for(a=0;e=r[a++];)"*"==t&&"!"==e.tagName||tt(n,e);return n}return q(t,e,s,i,n),n}function H(t,e,s,i,n){return e.getElementsByName&&i&&"name"==s&&!N?(e=e.getElementsByName(i),u(e,function(e){t.a(e)&&tt(n,e)})):e.getElementsByClassName&&i&&"class"==s?(e=e.getElementsByClassName(i),u(e,function(e){e.className==i&&t.a(e)&&tt(n,e)})):t instanceof Ct?q(t,e,s,i,n):e.getElementsByTagName&&(e=e.getElementsByTagName(t.f()),u(e,function(t){_(t,s,i)&&tt(n,t)})),n}function W(t,e,s,i,n){var r;if((t instanceof kt||8==t.b||s&&null===t.b)&&(r=e.childNodes)){var o=X(t);return"*"==o||(r=p(r,function(t){return t.tagName&&t.tagName.toLowerCase()==o}),r)?(s&&(r=p(r,function(t){return _(t,s,i)})),u(r,function(t){"*"==o&&("!"==t.tagName||"*"==o&&1!=t.nodeType)||tt(n,t)}),n):n}return V(t,e,s,i,n)}function V(t,e,s,i,n){for(e=e.firstChild;e;e=e.nextSibling)_(e,s,i)&&t.a(e)&&tt(n,e);return n}function q(t,e,s,i,n){for(e=e.firstChild;e;e=e.nextSibling)_(e,s,i)&&t.a(e)&&tt(n,e),q(t,e,s,i,n)}function X(t){if(t instanceof Ct){if(8==t.b)return"!";if(null===t.b)return"*"}return t.f()}function z(t,e){if(!t||!e)return!1;if(t.contains&&1==e.nodeType)return t==e||t.contains(e);if(void 0!==t.compareDocumentPosition)return t==e||!!(16&t.compareDocumentPosition(e));for(;e&&t!=e;)e=e.parentNode;return e==t}function G(t,s){if(t==s)return 0;if(t.compareDocumentPosition)return 2&t.compareDocumentPosition(s)?1:-1;if(N&&!(9<=Number(M))){if(9==t.nodeType)return-1;if(9==s.nodeType)return 1}if("sourceIndex"in t||t.parentNode&&"sourceIndex"in t.parentNode){var i=1==t.nodeType,n=1==s.nodeType;if(i&&n)return t.sourceIndex-s.sourceIndex;var r=t.parentNode,o=s.parentNode;return r==o?K(t,s):!i&&z(r,s)?-1*J(t,s):!n&&z(o,t)?J(s,t):(i?t.sourceIndex:r.sourceIndex)-(n?s.sourceIndex:o.sourceIndex)}return(i=(n=9==t.nodeType?t:t.ownerDocument||t.document).createRange()).selectNode(t),i.collapse(!0),(n=n.createRange()).selectNode(s),n.collapse(!0),i.compareBoundaryPoints(e.Range.START_TO_END,n)}function J(t,e){var s=t.parentNode;if(s==e)return-1;for(var i=e;i.parentNode!=s;)i=i.parentNode;return K(i,t)}function K(t,e){for(var s=e;s=s.previousSibling;)if(s==t)return-1;return 1}function $(){this.b=this.a=null,this.l=0}function Y(t){this.node=t,this.a=this.b=null}function Q(t,e){if(!t.a)return e;if(!e.a)return t;for(var s=t.a,i=e.a,n=null,r=null,o=0;s&&i;){r=s.node;var a=i.node;r==a||r instanceof P&&a instanceof P&&r.a==a.a?(r=s,s=s.a,i=i.a):0<G(s.node,i.node)?(r=i,i=i.a):(r=s,s=s.a),(r.b=n)?n.a=r:t.a=r,n=r,o++}for(r=s||i;r;)r.b=n,n=n.a=r,o++,r=r.a;return t.b=n,t.l=o,t}function Z(t,e){var s=new Y(e);s.a=t.a,t.b?t.a.b=s:t.a=t.b=s,t.a=s,t.l++}function tt(t,e){var s=new Y(e);s.b=t.b,t.a?t.b.a=s:t.a=t.b=s,t.b=s,t.l++}function et(t){return(t=t.a)?t.node:null}function st(t){return(t=et(t))?j(t):""}function it(t,e){return new nt(t,!!e)}function nt(t,e){this.f=t,this.b=(this.c=e)?t.b:t.a,this.a=null}function rt(t){var e=t.b;if(null==e)return null;var s=t.a=e;return t.b=t.c?e.b:e.a,s.node}function ot(t){this.i=t,this.b=this.g=!1,this.f=null}function at(t){return"\n "+t.toString().split("\n").join("\n ")}function lt(t,e){t.g=e}function ht(t,e){t.b=e}function ct(t,e){var s=t.a(e);return s instanceof $?+st(s):+s}function dt(t,e){var s=t.a(e);return s instanceof $?st(s):""+s}function ut(t,e){var s=t.a(e);return s instanceof $?!!s.l:!!s}function pt(t,e,s){ot.call(this,t.i),this.c=t,this.h=e,this.o=s,this.g=e.g||s.g,this.b=e.b||s.b,this.c==Et&&(s.b||s.g||4==s.i||0==s.i||!e.f?e.b||e.g||4==e.i||0==e.i||!s.f||(this.f={name:s.f.name,s:e}):this.f={name:e.f.name,s})}function mt(t,e,s,i,n){var r;if(e=e.a(i),s=s.a(i),e instanceof $&&s instanceof $){for(i=rt(e=it(e));i;i=rt(e))for(r=rt(n=it(s));r;r=rt(n))if(t(j(i),j(r)))return!0;return!1}if(e instanceof $||s instanceof $){e instanceof $?(n=e,i=s):(n=s,i=e);for(var o=typeof i,a=rt(r=it(n));a;a=rt(r)){switch(o){case"number":a=+j(a);break;case"boolean":a=!!j(a);break;case"string":a=j(a);break;default:throw Error("Illegal primitive type for comparison.")}if(n==e&&t(a,i)||n==s&&t(i,a))return!0}return!1}return n?"boolean"==typeof e||"boolean"==typeof s?t(!!e,!!s):"number"==typeof e||"number"==typeof s?t(+e,+s):t(e,s):t(+e,+s)}function ft(t,e,s,i){this.a=t,this.w=e,this.i=s,this.m=i}!v&&!N||N&&9<=Number(M)||v&&w("1.9.1"),N&&w("9"),o(pt),pt.prototype.a=function(t){return this.c.m(this.h,this.o,t)},pt.prototype.toString=function(){return"Binary Expression: "+this.c+at(this.h)+at(this.o)},ft.prototype.toString=function(){return this.a};var gt={};function bt(t,e,s,i){if(gt.hasOwnProperty(t))throw Error("Binary operator already created: "+t);return t=new ft(t,e,s,i),gt[t.toString()]=t}bt("div",6,1,function(t,e,s){return ct(t,s)/ct(e,s)}),bt("mod",6,1,function(t,e,s){return ct(t,s)%ct(e,s)}),bt("*",6,1,function(t,e,s){return ct(t,s)*ct(e,s)}),bt("+",5,1,function(t,e,s){return ct(t,s)+ct(e,s)}),bt("-",5,1,function(t,e,s){return ct(t,s)-ct(e,s)}),bt("<",4,2,function(t,e,s){return mt(function(t,e){return t<e},t,e,s)}),bt(">",4,2,function(t,e,s){return mt(function(t,e){return t>e},t,e,s)}),bt("<=",4,2,function(t,e,s){return mt(function(t,e){return t<=e},t,e,s)}),bt(">=",4,2,function(t,e,s){return mt(function(t,e){return t>=e},t,e,s)});var Et=bt("=",3,2,function(t,e,s){return mt(function(t,e){return t==e},t,e,s,!0)});function xt(t,e,s){this.a=t,this.b=e||1,this.f=s||1}function yt(t,e){if(e.a.length&&4!=t.i)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");ot.call(this,t.i),this.c=t,this.h=e,this.g=t.g,this.b=t.b}function Nt(t,e){if(e.length<t.A)throw Error("Function "+t.j+" expects at least"+t.A+" arguments, "+e.length+" given");if(null!==t.v&&e.length>t.v)throw Error("Function "+t.j+" expects at most "+t.v+" arguments, "+e.length+" given");t.B&&u(e,function(e,s){if(4!=e.i)throw Error("Argument "+s+" to function "+t.j+" is not of type Nodeset: "+e)}),ot.call(this,t.i),this.h=t,this.c=e,lt(this,t.g||f(e,function(t){return t.g})),ht(this,t.D&&!e.length||t.C&&!!e.length||f(e,function(t){return t.b}))}function Tt(t,e,s,i,n,r,o,a,l){this.j=t,this.i=e,this.g=s,this.D=i,this.C=n,this.m=r,this.A=o,this.v=void 0!==a?a:o,this.B=!!l}bt("!=",3,2,function(t,e,s){return mt(function(t,e){return t!=e},t,e,s,!0)}),bt("and",2,2,function(t,e,s){return ut(t,s)&&ut(e,s)}),bt("or",1,2,function(t,e,s){return ut(t,s)||ut(e,s)}),o(yt),yt.prototype.a=function(t){return t=this.c.a(t),Ht(this.h,t)},yt.prototype.toString=function(){return"Filter:"+at(this.c)+at(this.h)},o(Nt),Nt.prototype.a=function(t){return this.h.m.apply(null,function(t){return Array.prototype.concat.apply(Array.prototype,arguments)}(t,this.c))},Nt.prototype.toString=function(){var t="Function: "+this.h;if(this.c.length){var e=m(this.c,function(t,e){return t+at(e)},"Arguments:");t=t+at(e)}return t},Tt.prototype.toString=function(){return this.j};var vt={};function Lt(t,e,s,i,n,r,o,a){if(vt.hasOwnProperty(t))throw Error("Function already created: "+t+".");vt[t]=new Tt(t,e,s,i,!1,n,r,o,a)}function Ct(t,e){switch(this.h=t,this.c=void 0!==e?e:null,this.b=null,t){case"comment":this.b=8;break;case"text":this.b=3;break;case"processing-instruction":this.b=7;break;case"node":break;default:throw Error("Unexpected argument")}}function Rt(t){return"comment"==t||"text"==t||"processing-instruction"==t||"node"==t}function It(t){this.b=t,this.a=0}Lt("boolean",2,!1,!1,function(t,e){return ut(e,t)},1),Lt("ceiling",1,!1,!1,function(t,e){return Math.ceil(ct(e,t))},1),Lt("concat",3,!1,!1,function(t,e){return m(function(t,e,s){return 2>=arguments.length?Array.prototype.slice.call(t,e):Array.prototype.slice.call(t,e,s)}(arguments,1),function(e,s){return e+dt(s,t)},"")},2,null),Lt("contains",2,!1,!1,function(t,e,s){return l(dt(e,t),dt(s,t))},2),Lt("count",1,!1,!1,function(t,e){return e.a(t).l},1,1,!0),Lt("false",2,!1,!1,function(){return!1},0),Lt("floor",1,!1,!1,function(t,e){return Math.floor(ct(e,t))},1),Lt("id",4,!1,!1,function(t,e){function i(t){if(D){var e=n.all[t];if(e){if(e.nodeType&&t==e.id)return e;if(e.length)return function(t,e){var i;t:{i=t.length;for(var n=s(t)?t.split(""):t,r=0;r<i;r++)if(r in n&&e.call(void 0,n[r],r,t)){i=r;break t}i=-1}return 0>i?null:s(t)?t.charAt(i):t[i]}(e,function(e){return t==e.id})}return null}return n.getElementById(t)}var n=9==(r=t.a).nodeType?r:r.ownerDocument,r=dt(e,t).split(/\s+/),o=[];u(r,function(t){!(t=i(t))||0<=d(o,t)||o.push(t)}),o.sort(G);var a=new $;return u(o,function(t){tt(a,t)}),a},1),Lt("lang",2,!1,!1,function(){return!1},1),Lt("last",1,!0,!1,function(t){if(1!=arguments.length)throw Error("Function last expects ()");return t.f},0),Lt("local-name",3,!1,!0,function(t,e){var s=e?et(e.a(t)):t.a;return s?s.localName||s.nodeName.toLowerCase():""},0,1,!0),Lt("name",3,!1,!0,function(t,e){var s=e?et(e.a(t)):t.a;return s?s.nodeName.toLowerCase():""},0,1,!0),Lt("namespace-uri",3,!0,!1,function(){return""},0,1,!0),Lt("normalize-space",3,!1,!0,function(t,e){return(e?dt(e,t):j(t.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1),Lt("not",2,!1,!1,function(t,e){return!ut(e,t)},1),Lt("number",1,!1,!0,function(t,e){return e?ct(e,t):+j(t.a)},0,1),Lt("position",1,!0,!1,function(t){return t.b},0),Lt("round",1,!1,!1,function(t,e){return Math.round(ct(e,t))},1),Lt("starts-with",2,!1,!1,function(t,e,s){return e=dt(e,t),t=dt(s,t),0==e.lastIndexOf(t,0)},2),Lt("string",3,!1,!0,function(t,e){return e?dt(e,t):j(t.a)},0,1),Lt("string-length",1,!1,!0,function(t,e){return(e?dt(e,t):j(t.a)).length},0,1),Lt("substring",3,!1,!1,function(t,e,s,i){if(s=ct(s,t),isNaN(s)||1/0==s||-1/0==s)return"";if(i=i?ct(i,t):1/0,isNaN(i)||-1/0===i)return"";s=Math.round(s)-1;var n=Math.max(s,0);return t=dt(e,t),1/0==i?t.substring(n):t.substring(n,s+Math.round(i))},2,3),Lt("substring-after",3,!1,!1,function(t,e,s){return e=dt(e,t),t=dt(s,t),-1==(s=e.indexOf(t))?"":e.substring(s+t.length)},2),Lt("substring-before",3,!1,!1,function(t,e,s){return e=dt(e,t),t=dt(s,t),-1==(t=e.indexOf(t))?"":e.substring(0,t)},2),Lt("sum",1,!1,!1,function(t,e){for(var s=it(e.a(t)),i=0,n=rt(s);n;n=rt(s))i+=+j(n);return i},1,1,!0),Lt("translate",3,!1,!1,function(t,e,s,i){e=dt(e,t),s=dt(s,t);var n=dt(i,t);for(t={},i=0;i<s.length;i++){var r=s.charAt(i);r in t||(t[r]=n.charAt(i))}for(s="",i=0;i<e.length;i++)s+=(r=e.charAt(i))in t?t[r]:r;return s},3),Lt("true",2,!1,!1,function(){return!0},0),Ct.prototype.a=function(t){return null===this.b||this.b==t.nodeType},Ct.prototype.f=function(){return this.h},Ct.prototype.toString=function(){var t="Kind Test: "+this.h;return null===this.c||(t+=at(this.c)),t};var St=/\$?(?:(?![0-9-\.])(?:\*|[\w-\.]+):)?(?![0-9-\.])(?:\*|[\w-\.]+)|\/\/|\.\.|::|\d+(?:\.\d*)?|\.\d+|"[^"]*"|'[^']*'|[!<>]=|\s+|./g,At=/^\s/;function wt(t,e){return t.b[t.a+(e||0)]}function Ot(t){return t.b[t.a++]}function Mt(t){return t.b.length<=t.a}function Dt(t){ot.call(this,3),this.c=t.substring(1,t.length-1)}function kt(t,e){var s;this.j=t.toLowerCase(),s="*"==this.j?"*":"http://www.w3.org/1999/xhtml",this.c=e?e.toLowerCase():s}function Pt(t,e){if(ot.call(this,t.i),this.h=t,this.c=e,this.g=t.g,this.b=t.b,1==this.c.length){var s=this.c[0];s.u||s.c!=zt||"*"!=(s=s.o).f()&&(this.f={name:s.f(),s:null})}}function Bt(){ot.call(this,4)}function jt(){ot.call(this,4)}function _t(t){return"/"==t||"//"==t}function Ft(t){ot.call(this,4),this.c=t,lt(this,f(this.c,function(t){return t.g})),ht(this,f(this.c,function(t){return t.b}))}function Ut(t,e){this.a=t,this.b=!!e}function Ht(t,e,s){for(s=s||0;s<t.a.length;s++)for(var i,n=t.a[s],r=it(e),o=e.l,a=0;i=rt(r);a++){var l=t.b?o-a:a+1;if("number"==typeof(i=n.a(new xt(i,l,o))))l=l==i;else if("string"==typeof i||"boolean"==typeof i)l=!!i;else{if(!(i instanceof $))throw Error("Predicate.evaluate returned an unexpected type.");l=0<i.l}if(!l){if(i=(l=r).f,!(c=l.a))throw Error("Next must be called at least once before remove.");var h=c.b,c=c.a;h?h.a=c:i.a=c,c?c.b=h:i.b=h,i.l--,l.a=null}}return e}function Wt(t,e,s,i){ot.call(this,4),this.c=t,this.o=e,this.h=s||new Ut([]),this.u=!!i,e=0<(e=this.h).a.length?e.a[0].f:null,t.b&&e&&(t=e.name,t=D?t.toLowerCase():t,this.f={name:t,s:e.s});t:{for(t=this.h,e=0;e<t.a.length;e++)if((s=t.a[e]).g||1==s.i||0==s.i){t=!0;break t}t=!1}this.g=t}function Vt(t,e,s,i){this.j=t,this.f=e,this.a=s,this.b=i}o(Dt),Dt.prototype.a=function(){return this.c},Dt.prototype.toString=function(){return"Literal: "+this.c},kt.prototype.a=function(t){var e=t.nodeType;return(1==e||2==e)&&(e=void 0!==t.localName?t.localName:t.nodeName,("*"==this.j||this.j==e.toLowerCase())&&("*"==this.c||this.c==(t.namespaceURI?t.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")))},kt.prototype.f=function(){return this.j},kt.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.j},o(Pt),o(Bt),Bt.prototype.a=function(t){var e=new $;return 9==(t=t.a).nodeType?tt(e,t):tt(e,t.ownerDocument),e},Bt.prototype.toString=function(){return"Root Helper Expression"},o(jt),jt.prototype.a=function(t){var e=new $;return tt(e,t.a),e},jt.prototype.toString=function(){return"Context Helper Expression"},Pt.prototype.a=function(t){var e=this.h.a(t);if(!(e instanceof $))throw Error("Filter expression must evaluate to nodeset.");for(var s=0,i=(t=this.c).length;s<i&&e.l;s++){var n,r=t[s],o=it(e,r.c.a);if(r.g||r.c!=Kt)if(r.g||r.c!=Yt)for(n=rt(o),e=r.a(new xt(n));null!=(n=rt(o));)e=Q(e,n=r.a(new xt(n)));else n=rt(o),e=r.a(new xt(n));else{for(n=rt(o);(e=rt(o))&&(!n.contains||n.contains(e))&&8&e.compareDocumentPosition(n);n=e);e=r.a(new xt(n))}}return e},Pt.prototype.toString=function(){var t;if(t="Path Expression:"+at(this.h),this.c.length){var e=m(this.c,function(t,e){return t+at(e)},"Steps:");t+=at(e)}return t},o(Ft),Ft.prototype.a=function(t){var e=new $;return u(this.c,function(s){if(!((s=s.a(t))instanceof $))throw Error("Path expression must evaluate to NodeSet.");e=Q(e,s)}),e},Ft.prototype.toString=function(){return m(this.c,function(t,e){return t+at(e)},"Union Expression:")},Ut.prototype.toString=function(){return m(this.a,function(t,e){return t+at(e)},"Predicates:")},o(Wt),Wt.prototype.a=function(t){var e=t.a,s=null,i=null,n=null,r=0;if((s=this.f)&&(i=s.name,n=s.s?dt(s.s,t):null,r=1),this.u)if(this.g||this.c!=Gt)if(e=rt(t=it(new Wt(Jt,new Ct("node")).a(t))))for(s=this.m(e,i,n,r);null!=(e=rt(t));)s=Q(s,this.m(e,i,n,r));else s=new $;else s=F(this.o,e,i,n),s=Ht(this.h,s,r);else s=this.m(t.a,i,n,r);return s},Wt.prototype.m=function(t,e,s,i){return t=this.c.f(this.o,t,e,s),Ht(this.h,t,i)},Wt.prototype.toString=function(){var t;if(t="Step:"+at("Operator: "+(this.u?"//":"/")),this.c.j&&(t+=at("Axis: "+this.c)),t+=at(this.o),this.h.a.length){var e=m(this.h.a,function(t,e){return t+at(e)},"Predicates:");t+=at(e)}return t},Vt.prototype.toString=function(){return this.j};var qt={};function Xt(t,e,s,i){if(qt.hasOwnProperty(t))throw Error("Axis already created: "+t);return e=new Vt(t,e,s,!!i),qt[t]=e}Xt("ancestor",function(t,e){for(var s=new $,i=e;i=i.parentNode;)t.a(i)&&Z(s,i);return s},!0),Xt("ancestor-or-self",function(t,e){var s=new $,i=e;do{t.a(i)&&Z(s,i)}while(i=i.parentNode);return s},!0);var zt=Xt("attribute",function(t,e){var s=new $;if("style"==(r=t.f())&&D&&e.style)return tt(s,new P(e.style,e,"style",e.style.cssText)),s;var i=e.attributes;if(i)if(t instanceof Ct&&null===t.b||"*"==r)for(var n,r=0;n=i[r];r++)D?n.nodeValue&&tt(s,B(e,n)):tt(s,n);else(n=i.getNamedItem(r))&&(D?n.nodeValue&&tt(s,B(e,n)):tt(s,n));return s},!1),Gt=Xt("child",function(t,e,i,n,r){return(D?W:V).call(null,t,e,s(i)?i:null,s(n)?n:null,r||new $)},!1,!0);Xt("descendant",F,!1,!0);var Jt=Xt("descendant-or-self",function(t,e,s,i){var n=new $;return _(e,s,i)&&t.a(e)&&tt(n,e),F(t,e,s,i,n)},!1,!0),Kt=Xt("following",function(t,e,s,i){var n=new $;do{for(var r=e;r=r.nextSibling;)_(r,s,i)&&t.a(r)&&tt(n,r),n=F(t,r,s,i,n)}while(e=e.parentNode);return n},!1,!0);Xt("following-sibling",function(t,e){for(var s=new $,i=e;i=i.nextSibling;)t.a(i)&&tt(s,i);return s},!1),Xt("namespace",function(){return new $},!1);var $t=Xt("parent",function(t,e){var s=new $;if(9==e.nodeType)return s;if(2==e.nodeType)return tt(s,e.ownerElement),s;var i=e.parentNode;return t.a(i)&&tt(s,i),s},!1),Yt=Xt("preceding",function(t,e,s,i){var n=new $,r=[];do{r.unshift(e)}while(e=e.parentNode);for(var o=1,a=r.length;o<a;o++){var l=[];for(e=r[o];e=e.previousSibling;)l.unshift(e);for(var h=0,c=l.length;h<c;h++)_(e=l[h],s,i)&&t.a(e)&&tt(n,e),n=F(t,e,s,i,n)}return n},!0,!0);Xt("preceding-sibling",function(t,e){for(var s=new $,i=e;i=i.previousSibling;)t.a(i)&&Z(s,i);return s},!0);var Qt=Xt("self",function(t,e){var s=new $;return t.a(e)&&tt(s,e),s},!1);function Zt(t){ot.call(this,1),this.c=t,this.g=t.g,this.b=t.b}function te(t){ot.call(this,1),this.c=t}function ee(t,e){this.a=t,this.b=e}function se(t){for(var e,s=[];;){ie(t,"Missing right hand side of binary expression."),e=ce(t);var i=Ot(t.a);if(!i)break;var n=(i=gt[i]||null)&&i.w;if(!n){t.a.a--;break}for(;s.length&&n<=s[s.length-1].w;)e=new pt(s.pop(),s.pop(),e);s.push(e,i)}for(;s.length;)e=new pt(s.pop(),s.pop(),e);return e}function ie(t,e){if(Mt(t.a))throw Error(e)}function ne(t,e){var s=Ot(t.a);if(s!=e)throw Error("Bad token, expected: "+e+" got: "+s)}function re(t){if(")"!=(t=Ot(t.a)))throw Error("Bad token: "+t)}function oe(t){if(2>(t=Ot(t.a)).length)throw Error("Unclosed literal string");return new Dt(t)}function ae(t){var e,s,i=[];if(_t(wt(t.a))){if(e=Ot(t.a),s=wt(t.a),"/"==e&&(Mt(t.a)||"."!=s&&".."!=s&&"@"!=s&&"*"!=s&&!/(?![0-9])[\w]/.test(s)))return new Bt;s=new Bt,ie(t,"Missing next location step."),e=le(t,e),i.push(e)}else{t:{switch(s=(e=wt(t.a)).charAt(0)){case"$":throw Error("Variable reference not allowed in HTML XPath");case"(":Ot(t.a),e=se(t),ie(t,'unclosed "("'),ne(t,")");break;case'"':case"'":e=oe(t);break;default:if(isNaN(+e)){if(Rt(e)||!/(?![0-9])[\w]/.test(s)||"("!=wt(t.a,1)){e=null;break t}for(e=Ot(t.a),e=vt[e]||null,Ot(t.a),s=[];")"!=wt(t.a)&&(ie(t,"Missing function argument list."),s.push(se(t)),","==wt(t.a));)Ot(t.a);ie(t,"Unclosed function argument list."),re(t),e=new Nt(e,s)}else e=new te(+Ot(t.a))}"["==wt(t.a)&&(e=new yt(e,s=new Ut(he(t))))}if(e){if(!_t(wt(t.a)))return e;s=e}else e=le(t,"/"),s=new jt,i.push(e)}for(;_t(wt(t.a));)e=Ot(t.a),ie(t,"Missing next location step."),e=le(t,e),i.push(e);return new Pt(s,i)}function le(t,e){var s,i,n,r;if("/"!=e&&"//"!=e)throw Error('Step op should be "/" or "//"');if("."==wt(t.a))return i=new Wt(Qt,new Ct("node")),Ot(t.a),i;if(".."==wt(t.a))return i=new Wt($t,new Ct("node")),Ot(t.a),i;if("@"==wt(t.a))r=zt,Ot(t.a),ie(t,"Missing attribute name");else if("::"==wt(t.a,1)){if(!/(?![0-9])[\w]/.test(wt(t.a).charAt(0)))throw Error("Bad token: "+Ot(t.a));if(s=Ot(t.a),!(r=qt[s]||null))throw Error("No axis with name: "+s);Ot(t.a),ie(t,"Missing node name")}else r=Gt;if(s=wt(t.a),!/(?![0-9])[\w\*]/.test(s.charAt(0)))throw Error("Bad token: "+Ot(t.a));if("("==wt(t.a,1)){if(!Rt(s))throw Error("Invalid node type: "+s);if(!Rt(s=Ot(t.a)))throw Error("Invalid type name: "+s);ne(t,"("),ie(t,"Bad nodetype");var o=null;'"'!=(n=wt(t.a).charAt(0))&&"'"!=n||(o=oe(t)),ie(t,"Bad nodetype"),re(t),s=new Ct(s,o)}else if(-1==(n=(s=Ot(t.a)).indexOf(":")))s=new kt(s);else{var a;if("*"==(o=s.substring(0,n)))a="*";else if(!(a=t.b(o)))throw Error("Namespace prefix not declared: "+o);s=new kt(s=s.substr(n+1),a)}return n=new Ut(he(t),r.a),i||new Wt(r,s,n,"//"==e)}function he(t){for(var e=[];"["==wt(t.a);){Ot(t.a),ie(t,"Missing predicate expression.");var s=se(t);e.push(s),ie(t,"Unclosed predicate expression."),ne(t,"]")}return e}function ce(t){if("-"==wt(t.a))return Ot(t.a),new Zt(ce(t));var e=ae(t);if("|"!=wt(t.a))t=e;else{for(e=[e];"|"==Ot(t.a);)ie(t,"Missing next union location path."),e.push(ae(t));t.a.a--,t=new Ft(e)}return t}function de(t){switch(t.nodeType){case 1:return function(t,e){var s=Array.prototype.slice.call(arguments,1);return function(){var e=s.slice();return e.push.apply(e,arguments),t.apply(this,e)}}(pe,t);case 9:return de(t.documentElement);case 11:case 10:case 6:case 12:return ue;default:return t.parentNode?de(t.parentNode):ue}}function ue(){return null}function pe(t,e){if(t.prefix==e)return t.namespaceURI||"http://www.w3.org/1999/xhtml";var s=t.getAttributeNode("xmlns:"+e);return s&&s.specified?s.value||null:t.parentNode&&9!=t.parentNode.nodeType?pe(t.parentNode,e):null}function me(t,e){if(!t.length)throw Error("Empty XPath expression.");var s=function(t){t=t.match(St);for(var e=0;e<t.length;e++)At.test(t[e])&&t.splice(e,1);return new It(t)}(t);if(Mt(s))throw Error("Invalid XPath expression.");e?"function"==function(t){var e=typeof t;if("object"==e){if(!t)return"null";if(t instanceof Array)return"array";if(t instanceof Object)return e;var s=Object.prototype.toString.call(t);if("[object Window]"==s)return"object";if("[object Array]"==s||"number"==typeof t.length&&void 0!==t.splice&&void 0!==t.propertyIsEnumerable&&!t.propertyIsEnumerable("splice"))return"array";if("[object Function]"==s||void 0!==t.call&&void 0!==t.propertyIsEnumerable&&!t.propertyIsEnumerable("call"))return"function"}else if("function"==e&&void 0===t.call)return"object";return e}(e)||(e=r(e.lookupNamespaceURI,e)):e=function(){return null};var i=se(new ee(s,e));if(!Mt(s))throw Error("Bad token: "+Ot(s));this.evaluate=function(t,e){return new fe(i.a(new xt(t)),e)}}function fe(t,e){if(0==e)if(t instanceof $)e=4;else if("string"==typeof t)e=2;else if("number"==typeof t)e=1;else{if("boolean"!=typeof t)throw Error("Unexpected evaluation result.");e=3}if(2!=e&&1!=e&&3!=e&&!(t instanceof $))throw Error("value could not be converted to the specified type");var s;switch(this.resultType=e,e){case 2:this.stringValue=t instanceof $?st(t):""+t;break;case 1:this.numberValue=t instanceof $?+st(t):+t;break;case 3:this.booleanValue=t instanceof $?0<t.l:!!t;break;case 4:case 5:case 6:case 7:var i=it(t);s=[];for(var n=rt(i);n;n=rt(i))s.push(n instanceof P?n.a:n);this.snapshotLength=t.l,this.invalidIteratorState=!1;break;case 8:case 9:i=et(t),this.singleNodeValue=i instanceof P?i.a:i;break;default:throw Error("Unknown XPathResult type.")}var r=0;this.iterateNext=function(){if(4!=e&&5!=e)throw Error("iterateNext called with wrong result type");return r>=s.length?null:s[r++]},this.snapshotItem=function(t){if(6!=e&&7!=e)throw Error("snapshotItem called with wrong result type");return t>=s.length||0>t?null:s[t]}}function ge(t){this.lookupNamespaceURI=de(t)}function be(t,s){var i=t||e,n=i.Document&&i.Document.prototype||i.document;n.evaluate&&!s||(i.XPathResult=fe,n.evaluate=function(t,e,s,i){return new me(t,s).evaluate(e,i)},n.createExpression=function(t,e){return new me(t,e)},n.createNSResolver=function(t){return new ge(t)})}o(Zt),Zt.prototype.a=function(t){return-ct(this.c,t)},Zt.prototype.toString=function(){return"Unary Expression: -"+at(this.c)},o(te),te.prototype.a=function(){return this.c},te.prototype.toString=function(){return"Number: "+this.c},fe.ANY_TYPE=0,fe.NUMBER_TYPE=1,fe.STRING_TYPE=2,fe.BOOLEAN_TYPE=3,fe.UNORDERED_NODE_ITERATOR_TYPE=4,fe.ORDERED_NODE_ITERATOR_TYPE=5,fe.UNORDERED_NODE_SNAPSHOT_TYPE=6,fe.ORDERED_NODE_SNAPSHOT_TYPE=7,fe.ANY_UNORDERED_NODE_TYPE=8,fe.FIRST_ORDERED_NODE_TYPE=9;var Ee,xe=["wgxpath","install"],ye=e;xe[0]in ye||!ye.execScript||ye.execScript("var "+xe[0]);for(;xe.length&&(Ee=xe.shift());)xe.length||void 0===be?ye=ye[Ee]?ye[Ee]:ye[Ee]={}:ye[Ee]=be;t.exports.install=be,t.exports.XPathResultType={ANY_TYPE:0,NUMBER_TYPE:1,STRING_TYPE:2,BOOLEAN_TYPE:3,UNORDERED_NODE_ITERATOR_TYPE:4,ORDERED_NODE_ITERATOR_TYPE:5,UNORDERED_NODE_SNAPSHOT_TYPE:6,ORDERED_NODE_SNAPSHOT_TYPE:7,ANY_UNORDERED_NODE_TYPE:8,FIRST_ORDERED_NODE_TYPE:9}}).call(s.g)}},i={};function n(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={exports:{}};return s[t](r,r.exports,n),r.exports}e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,n.t=function(s,i){if(1&i&&(s=this(s)),8&i)return s;if("object"==typeof s&&s){if(4&i&&s.__esModule)return s;if(16&i&&"function"==typeof s.then)return s}var r=Object.create(null);n.r(r);var o={};t=t||[null,e({}),e([]),e(e)];for(var a=2&i&&s;("object"==typeof a||"function"==typeof a)&&!~t.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(t=>o[t]=()=>s[t]);return o.default=()=>s,n.d(r,o),r},n.d=(t,e)=>{for(var s in e)n.o(e,s)&&!n.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";var t={};n.r(t),n.d(t,{GLOBAL:()=>Ns,MathJax:()=>Rs,combineConfig:()=>vs,combineDefaults:()=>Ls,combineWithMathJax:()=>Cs,isObject:()=>Ts});var e={};n.r(e),n.d(e,{context:()=>As,hasWindow:()=>Is,isCJS:()=>Ss});var s={};n.r(s),n.d(s,{Package:()=>Os,PackageError:()=>ws});var i={};n.r(i),n.d(i,{PrioritizedList:()=>Ms});var r={};n.r(r),n.d(r,{FunctionList:()=>Ds});var o={};n.r(o),n.d(o,{CONFIG:()=>Us,Loader:()=>_s,MathJax:()=>Fs,PathFilters:()=>Bs});var a={};n.r(a),n.d(a,{APPEND:()=>Vs,Expandable:()=>zs,OPTIONS:()=>Xs,REMOVE:()=>qs,copy:()=>$s,defaultOptions:()=>Qs,expandable:()=>Gs,insert:()=>Ys,isObject:()=>Ws,keys:()=>Ks,lookup:()=>ii,makeArray:()=>Js,selectOptions:()=>ti,selectOptionsFromKeys:()=>ei,separateOptions:()=>si,userOptions:()=>Zs});var l={};n.r(l),n.d(l,{CONFIG:()=>ai,MathJax:()=>oi,Startup:()=>ri});var h={};n.r(h),n.d(h,{AbstractDOMAdaptor:()=>hi});var c={};n.r(c),n.d(c,{HTMLAdaptor:()=>di});var d={};n.r(d),n.d(d,{browserAdaptor:()=>pi});var u={};n.r(u),n.d(u,{AbstractFindMath:()=>mi});var p={};n.r(p),n.d(p,{AbstractInputJax:()=>fi});var m={};n.r(m),n.d(m,{AbstractOutputJax:()=>gi});var f={};n.r(f),n.d(f,{END:()=>bi,LinkedList:()=>xi,ListItem:()=>Ei});var g={};n.r(g),n.d(g,{AbstractMathList:()=>yi});var b={};n.r(b),n.d(b,{AbstractMathItem:()=>Ti,STATE:()=>vi,newState:()=>Li,protoItem:()=>Ni});var E={};n.r(E),n.d(E,{AbstractFactory:()=>Ci});var x={};n.r(x),n.d(x,{AbstractNodeFactory:()=>Ri});var y={};n.r(y),n.d(y,{Attributes:()=>Si,INHERIT:()=>Ii});var N={};n.r(N),n.d(N,{AbstractEmptyNode:()=>wi,AbstractNode:()=>Ai});var T={};n.r(T),n.d(T,{AbstractMmlBaseNode:()=>Ui,AbstractMmlEmptyNode:()=>Hi,AbstractMmlLayoutNode:()=>Fi,AbstractMmlNode:()=>ji,AbstractMmlTokenNode:()=>_i,MATHVARIANTS:()=>Pi,TEXCLASS:()=>Oi,TEXCLASSNAMES:()=>Mi,TextNode:()=>Wi,XMLNode:()=>Vi,indentAttributes:()=>Bi});var v={};n.r(v),n.d(v,{MmlMath:()=>qi});var L={};n.r(L),n.d(L,{MmlMi:()=>Xi});var C={};n.r(C),n.d(C,{MmlMn:()=>zi});var R={};n.r(R),n.d(R,{MMLSPACING:()=>Yi,MO:()=>Ji,OPDEF:()=>Gi,OPTABLE:()=>Qi,RANGES:()=>Ki,getRange:()=>$i});var I={};n.r(I),n.d(I,{isPercent:()=>nn,quotePattern:()=>tn,replaceUnicode:()=>on,sortLength:()=>Zi,split:()=>rn,toEntity:()=>an,unicodeChars:()=>en,unicodeString:()=>sn});var S={};n.r(S),n.d(S,{MmlMo:()=>ln});var A={};n.r(A),n.d(A,{MmlMtext:()=>hn});var w={};n.r(w),n.d(w,{MmlMspace:()=>cn});var O={};n.r(O),n.d(O,{MmlMs:()=>dn});var M={};n.r(M),n.d(M,{MmlInferredMrow:()=>pn,MmlMrow:()=>un});var D={};n.r(D),n.d(D,{MmlMfrac:()=>mn});var k={};n.r(k),n.d(k,{MmlMsqrt:()=>fn});var P={};n.r(P),n.d(P,{MmlMroot:()=>gn});var B={};n.r(B),n.d(B,{MmlMstyle:()=>bn});var j={};n.r(j),n.d(j,{MmlMerror:()=>En});var _={};n.r(_),n.d(_,{MmlMpadded:()=>xn});var F={};n.r(F),n.d(F,{MmlMphantom:()=>yn});var U={};n.r(U),n.d(U,{MmlMfenced:()=>Nn});var H={};n.r(H),n.d(H,{MmlMenclose:()=>Tn});var W={};n.r(W),n.d(W,{MmlMaction:()=>vn});var V={};n.r(V),n.d(V,{MmlMsub:()=>Cn,MmlMsubsup:()=>Ln,MmlMsup:()=>Rn});var q={};n.r(q),n.d(q,{MmlMover:()=>An,MmlMunder:()=>Sn,MmlMunderover:()=>In});var X={};n.r(X),n.d(X,{MmlMmultiscripts:()=>wn,MmlMprescripts:()=>On,MmlNone:()=>Mn});var z={};n.r(z),n.d(z,{MmlMtable:()=>Dn});var G={};n.r(G),n.d(G,{MmlMlabeledtr:()=>Pn,MmlMtr:()=>kn});var J={};n.r(J),n.d(J,{MmlMtd:()=>Bn});var K={};n.r(K),n.d(K,{MmlMaligngroup:()=>jn});var $={};n.r($),n.d($,{MmlMalignmark:()=>_n});var Y={};n.r(Y),n.d(Y,{MmlMglyph:()=>Fn});var Q={};n.r(Q),n.d(Q,{MmlAnnotation:()=>Wn,MmlAnnotationXML:()=>Hn,MmlSemantics:()=>Un});var Z={};n.r(Z),n.d(Z,{TeXAtom:()=>Vn});var tt={};n.r(tt),n.d(tt,{MathChoice:()=>qn});var et={};n.r(et),n.d(et,{HtmlNode:()=>Xn});var st={};n.r(st),n.d(st,{MML:()=>zn});var it={};n.r(it),n.d(it,{MmlFactory:()=>Gn});var nt={};n.r(nt),n.d(nt,{BitField:()=>Jn,BitFieldClass:()=>Kn});var rt={};n.r(rt),n.d(rt,{handleRetriesFor:()=>$n,retryAfter:()=>Yn});var ot={};n.r(ot),n.d(ot,{AbstractMathDocument:()=>rr,RenderList:()=>Zn,resetAllOptions:()=>er,resetOptions:()=>tr});var at={};n.r(at),n.d(at,{AbstractHandler:()=>ar});var lt={};n.r(lt),n.d(lt,{HandlerList:()=>lr});var ht={};n.r(ht),n.d(ht,{AbstractVisitor:()=>hr});var ct={};n.r(ct),n.d(ct,{DATAMJX:()=>cr,MmlVisitor:()=>dr});var dt={};n.r(dt),n.d(dt,{MathMLVisitor:()=>ur});var ut={};n.r(ut),n.d(ut,{SerializedMmlVisitor:()=>pr});var pt={};n.r(pt),n.d(pt,{AbstractWrapper:()=>mr});var mt={};n.r(mt),n.d(mt,{AbstractWrapperFactory:()=>fr});var ft={};n.r(ft),n.d(ft,{mathjax:()=>gr});var gt={};n.r(gt),n.d(gt,{HTMLMathItem:()=>br});var bt={};n.r(bt),n.d(bt,{HTMLMathList:()=>Er});var Et={};n.r(Et),n.d(Et,{HTMLDomStrings:()=>xr});var xt={};n.r(xt),n.d(xt,{HTMLDocument:()=>yr});var yt={};n.r(yt),n.d(yt,{HTMLHandler:()=>Nr});var Nt={};n.r(Nt),n.d(Nt,{RegisterHTMLHandler:()=>Tr});var Tt={};n.r(Tt),n.d(Tt,{StyleJsonSheet:()=>vr});var vt={};n.r(vt),n.d(vt,{DraggableDialog:()=>Rr,isDialog:()=>Cr});var Lt={};n.r(Lt),n.d(Lt,{InfoDialog:()=>Ir});var Ct={};n.r(Ct),n.d(Ct,{asyncLoad:()=>Sr});var Rt={};n.r(Rt),n.d(Rt,{BIGDIMEN:()=>Ar,MATHSPACE:()=>Mr,RELUNITS:()=>Or,UNITS:()=>wr,em:()=>Pr,length2em:()=>Dr,percent:()=>kr,px:()=>Br});var It={};n.r(It),n.d(It,{BBox:()=>jr});var St={};n.r(St),n.d(St,{add:()=>Hr,entities:()=>Fr,numeric:()=>Xr,options:()=>_r,remove:()=>Wr,translate:()=>Vr});var At={};n.r(At),n.d(At,{Styles:()=>ro,TRBL:()=>zr,WSC:()=>Gr});var wt={};n.r(wt),n.d(wt,{max:()=>ao,sum:()=>oo});var Ot={};n.r(Ot),n.d(Ot,{FindMathML:()=>ho});var Mt={};n.r(Mt),n.d(Mt,{MathMLCompile:()=>co});var Dt={};n.r(Dt),n.d(Dt,{MathML:()=>uo});var kt={};n.r(kt),n.d(kt,{DIRECTION:()=>po,H:()=>fo,V:()=>mo});var Pt={};n.r(Pt),n.d(Pt,{DIRECTION:()=>po,FontData:()=>No,HFUZZ:()=>Eo,NOSTRETCH:()=>xo,VFUZZ:()=>bo,mergeOptions:()=>yo});var Bt={};n.r(Bt),n.d(Bt,{LineBBox:()=>To});var jt={};n.r(jt),n.d(jt,{LinebreakVisitor:()=>Co,Linebreaks:()=>Lo,NOBREAK:()=>vo});var _t={};n.r(_t),n.d(_t,{CommonOutputJax:()=>Io,FONTPATH:()=>Ro});var Ft={};n.r(Ft),n.d(Ft,{CommonWrapperFactory:()=>So});var Ut={};n.r(Ut),n.d(Ut,{CommonWrapper:()=>Do,SPACE:()=>Mo});var Ht={};n.r(Ht),n.d(Ht,{ChtmlWrapper:()=>Po,FONTSIZE:()=>ko});var Wt={};n.r(Wt),n.d(Wt,{CommonMathMixin:()=>Bo});var Vt={};n.r(Vt),n.d(Vt,{ChtmlMath:()=>jo});var qt={};n.r(qt),n.d(qt,{CommonMiMixin:()=>_o});var Xt={};n.r(Xt),n.d(Xt,{ChtmlMi:()=>Fo});var zt={};n.r(zt),n.d(zt,{Usage:()=>Uo});var Gt={};n.r(Gt),n.d(Gt,{AddCSS:()=>Wo,ChtmlFontData:()=>Ho,DIRECTION:()=>po,FontData:()=>No,HFUZZ:()=>Eo,NOSTRETCH:()=>xo,VFUZZ:()=>bo,mergeOptions:()=>yo});var Jt={};n.r(Jt),n.d(Jt,{CommonMoMixin:()=>Vo});var Kt={};n.r(Kt),n.d(Kt,{ChtmlMo:()=>qo});var $t={};n.r($t),n.d($t,{CommonMnMixin:()=>Xo});var Yt={};n.r(Yt),n.d(Yt,{ChtmlMn:()=>zo});var Qt={};n.r(Qt),n.d(Qt,{CommonMsMixin:()=>Go});var Zt={};n.r(Zt),n.d(Zt,{ChtmlMs:()=>Jo});var te={};n.r(te),n.d(te,{CommonMtextMixin:()=>Ko});var ee={};n.r(ee),n.d(ee,{ChtmlMtext:()=>$o});var se={};n.r(se),n.d(se,{CommonMspaceMixin:()=>Yo});var ie={};n.r(ie),n.d(ie,{ChtmlMspace:()=>Qo});var ne={};n.r(ne),n.d(ne,{CommonMpaddedMixin:()=>Zo});var re={};n.r(re),n.d(re,{ChtmlMpadded:()=>ta});var oe={};n.r(oe),n.d(oe,{ARROWDX:()=>sa,ARROWX:()=>ea,ARROWY:()=>ia,CommonArrow:()=>Ta,CommonBorder:()=>Ea,CommonBorder2:()=>xa,CommonDiagonalArrow:()=>Na,CommonDiagonalStrike:()=>ya,PADDING:()=>ra,SOLID:()=>oa,THICKNESS:()=>na,arrowBBox:()=>ba,arrowBBoxHD:()=>pa,arrowBBoxW:()=>ma,arrowDef:()=>fa,arrowHead:()=>ua,diagonalArrowDef:()=>ga,fullBBox:()=>ha,fullBorder:()=>da,fullPadding:()=>ca,sideIndex:()=>aa,sideNames:()=>la});var ae={};n.r(ae),n.d(ae,{CommonMencloseMixin:()=>va});var le={};n.r(le),n.d(le,{ARROWDX:()=>sa,ARROWX:()=>ea,ARROWY:()=>ia,Arrow:()=>Aa,Border:()=>Ca,Border2:()=>Ra,CommonArrow:()=>Ta,CommonBorder:()=>Ea,CommonBorder2:()=>xa,CommonDiagonalArrow:()=>Na,CommonDiagonalStrike:()=>ya,DiagonalArrow:()=>Sa,DiagonalStrike:()=>Ia,PADDING:()=>ra,RenderElement:()=>La,SOLID:()=>oa,THICKNESS:()=>na,arrowBBox:()=>ba,arrowBBoxHD:()=>pa,arrowBBoxW:()=>ma,arrowDef:()=>fa,arrowHead:()=>ua,diagonalArrowDef:()=>ga,fullBBox:()=>ha,fullBorder:()=>da,fullPadding:()=>ca,sideIndex:()=>aa,sideNames:()=>la});var he={};n.r(he),n.d(he,{ChtmlMenclose:()=>Ma});var ce={};n.r(ce),n.d(ce,{CommonInferredMrowMixin:()=>ka,CommonMrowMixin:()=>Da});var de={};n.r(de),n.d(de,{ChtmlInferredMrow:()=>Ba,ChtmlMrow:()=>Pa});var ue={};n.r(ue),n.d(ue,{CommonMfencedMixin:()=>ja});var pe={};n.r(pe),n.d(pe,{ChtmlMfenced:()=>_a});var me={};n.r(me),n.d(me,{CommonMfracMixin:()=>Fa});var fe={};n.r(fe),n.d(fe,{ChtmlMfrac:()=>Ua});var ge={};n.r(ge),n.d(ge,{CommonMsqrtMixin:()=>Ha});var be={};n.r(be),n.d(be,{ChtmlMsqrt:()=>Wa});var Ee={};n.r(Ee),n.d(Ee,{CommonMrootMixin:()=>Va});var xe={};n.r(xe),n.d(xe,{ChtmlMroot:()=>qa});var ye={};n.r(ye),n.d(ye,{CommonMsubMixin:()=>Xa,CommonMsubsupMixin:()=>Ga,CommonMsupMixin:()=>za});var Ne={};n.r(Ne),n.d(Ne,{CommonScriptbaseMixin:()=>Ja});var Te={};n.r(Te),n.d(Te,{ChtmlScriptbase:()=>Ka});var ve={};n.r(ve),n.d(ve,{ChtmlMsub:()=>$a,ChtmlMsubsup:()=>Qa,ChtmlMsup:()=>Ya});var Le={};n.r(Le),n.d(Le,{CommonMoverMixin:()=>tl,CommonMunderMixin:()=>Za,CommonMunderoverMixin:()=>el});var Ce={};n.r(Ce),n.d(Ce,{ChtmlMover:()=>il,ChtmlMunder:()=>sl,ChtmlMunderover:()=>nl});var Re={};n.r(Re),n.d(Re,{CommonMmultiscriptsMixin:()=>al,NextScript:()=>rl,ScriptNames:()=>ol});var Ie={};n.r(Ie),n.d(Ie,{ChtmlMmultiscripts:()=>ll});var Se={};n.r(Se),n.d(Se,{BREAK_BELOW:()=>hl,CommonMtableMixin:()=>cl});var Ae={};n.r(Ae),n.d(Ae,{ChtmlMtable:()=>dl});var we={};n.r(we),n.d(we,{CommonMlabeledtrMixin:()=>pl,CommonMtrMixin:()=>ul});var Oe={};n.r(Oe),n.d(Oe,{ChtmlMlabeledtr:()=>fl,ChtmlMtr:()=>ml});var Me={};n.r(Me),n.d(Me,{CommonMtdMixin:()=>gl});var De={};n.r(De),n.d(De,{ChtmlMtd:()=>bl});var ke={};n.r(ke),n.d(ke,{CommonMactionMixin:()=>xl,TooltipData:()=>El});var Pe={};n.r(Pe),n.d(Pe,{ChtmlMaction:()=>yl});var Be={};n.r(Be),n.d(Be,{CommonMglyphMixin:()=>Nl});var je={};n.r(je),n.d(je,{ChtmlMglyph:()=>Tl});var _e={};n.r(_e),n.d(_e,{CommonSemanticsMixin:()=>vl});var Fe={};n.r(Fe),n.d(Fe,{CommonXmlNodeMixin:()=>Ll});var Ue={};n.r(Ue),n.d(Ue,{ChtmlAnnotation:()=>Rl,ChtmlAnnotationXML:()=>Il,ChtmlSemantics:()=>Cl,ChtmlXmlNode:()=>Sl});var He={};n.r(He),n.d(He,{CommonTeXAtomMixin:()=>Al});var We={};n.r(We),n.d(We,{ChtmlTeXAtom:()=>wl});var Ve={};n.r(Ve),n.d(Ve,{CommonTextNodeMixin:()=>Ol});var qe={};n.r(qe),n.d(qe,{ChtmlTextNode:()=>Ml});var Xe={};n.r(Xe),n.d(Xe,{ChtmlHtmlNode:()=>Dl});var ze={};n.r(ze),n.d(ze,{ChtmlWrappers:()=>kl});var Ge={};n.r(Ge),n.d(Ge,{ChtmlWrapperFactory:()=>Pl});var Je={};n.r(Je),n.d(Je,{DefaultFont:()=>jl,fontName:()=>Bl});var Ke={};n.r(Ke),n.d(Ke,{CHTML:()=>_l});var $e={};n.r($e),n.d($e,{AddFontIds:()=>Fl});var Ye={};n.r(Ye),n.d(Ye,{MJContextMenu:()=>_h});var Qe={};n.r(Qe),n.d(Qe,{addPreference:()=>Sm,engineSetup:()=>Cm,fromPreference:()=>Am,locales:()=>vm,parseDOM:()=>Im,setupEngine:()=>Lm,toEnriched:()=>Rm,toPreference:()=>wm});var Ze={};n.r(Ze),n.d(Ze,{clearspeakMenu:()=>Fm,localeMenu:()=>Hm});var ts={};n.r(ts),n.d(ts,{copyToClipboard:()=>Vm,isMac:()=>Wm});var es={};n.r(es),n.d(es,{annotation:()=>Gm,copyAnnotations:()=>Xm,showAnnotations:()=>qm});var ss={};n.r(ss),n.d(ss,{RadioCompare:()=>$m});var is={};n.r(is),n.d(is,{MmlVisitor:()=>Ym});var ns={};n.r(ns),n.d(ns,{Menu:()=>tf});var rs={};n.r(rs),n.d(rs,{MenuHandler:()=>nf,MenuMathDocumentMixin:()=>sf,MenuMathItemMixin:()=>ef});var os={};n.r(os),n.d(os,{EnrichHandler:()=>lf,EnrichedMathDocumentMixin:()=>af,EnrichedMathItemMixin:()=>of,enrichVisitor:()=>rf});var as={};n.r(as),n.d(as,{InPlace:()=>xf,SemAttr:()=>yf,buildLabel:()=>gf,buildSpeech:()=>bf,honk:()=>Ef,ssmlParsing:()=>cf});var ls={};n.r(ls),n.d(ls,{GeneratorPool:()=>Nf});var hs={};n.r(hs),n.d(hs,{WorkerHandler:()=>Lf});var cs={};n.r(cs),n.d(cs,{SpeechHandler:()=>wf,SpeechMathDocumentMixin:()=>Af,SpeechMathItemMixin:()=>Sf});var ds={};n.r(ds),n.d(ds,{AbstractRegion:()=>Of,DummyRegion:()=>Mf,HoverRegion:()=>jf,LiveRegion:()=>Pf,SpeechRegion:()=>Bf,StringRegion:()=>Df,ToolTip:()=>kf});var us={};n.r(us),n.d(us,{AbstractExplorer:()=>_f});var ps={};n.r(ps),n.d(ps,{SpeechExplorer:()=>Xf,hasModifiers:()=>qf,isContainer:()=>Vf});var ms={};n.r(ms),n.d(ms,{AbstractMouseExplorer:()=>Gf,ContentHoverer:()=>$f,FlameHoverer:()=>Yf,Hoverer:()=>Jf,ValueHoverer:()=>Kf});var fs={};n.r(fs),n.d(fs,{AbstractTreeExplorer:()=>Qf,ContrastPicker:()=>eg,FlameColorer:()=>Zf,TreeColorer:()=>tg});var gs={};n.r(gs),n.d(gs,{ATTR:()=>ng,getHighlighter:()=>lg});var bs={};n.r(bs),n.d(bs,{ExplorerPool:()=>ug,RegionPool:()=>cg});var Es={};n.r(Es),n.d(Es,{ExplorerHandler:()=>gg,ExplorerMathDocumentMixin:()=>fg,ExplorerMathItemMixin:()=>mg,setA11yOption:()=>Eg,setA11yOptions:()=>bg});const xs="4.1.3",ys={},Ns="undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof globalThis?globalThis:ys;function Ts(t){return"object"==typeof t&&null!==t}function vs(t,e,s=!1){var i;for(const n of Object.keys(e))"__esModule"!==n&&t[n]!==e[n]&&null!==e[n]&&void 0!==e[n]&&(Ts(t[n])&&Ts(e[n])?vs(t[n],e[n],s||"_"===n):s&&(null===(i=Object.getOwnPropertyDescriptor(t,n))||void 0===i?void 0:i.get)||(t[n]=e[n]));return t}function Ls(t,e,s){t[e]||(t[e]={}),t=t[e];for(const e of Object.keys(s))Ts(t[e])&&Ts(s[e])?Ls(t,e,s[e]):null==t[e]&&null!=s[e]&&(t[e]=s[e]);return t}function Cs(t){return vs(Rs,t)}void 0!==Ns.MathJax&&Ns.MathJax.constructor==={}.constructor||(Ns.MathJax={}),Ns.MathJax.version||(Ns.MathJax={version:xs,_:{},config:Ns.MathJax});const Rs=Ns.MathJax;!Object.hasOwn&&Rs.config.startup.polyfillHasOwn&&(Object.hasOwn=function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)});const Is="undefined"!=typeof window,Ss="undefined"!=typeof exports,As={window:Is?window:null,document:Is?window.document:null,os:(()=>{if(Is&&window.navigator){const t=window.navigator.appVersion,e=[["Win","Windows"],["Mac","MacOS"],["X11","Unix"],["Linux","Unix"]];for(const[s,i]of e)if(t.includes(s))return i;if(window.navigator.userAgent.includes("Android"))return"Unix"}else if("undefined"!=typeof process)return{linux:"Unix",android:"Unix",aix:"Unix",freebsd:"Unix",netbsd:"Unix",openbsd:"Unix",sunos:"Unix",darwin:"MacOS",win32:"Windows",cygwin:"Windows"}[process.platform]||process.platform;return"unknown"})(),path:t=>t};"Windows"===As.os&&(As.path=t=>t.match(/^[/\\]?[a-zA-Z]:[/\\]/)?(Ss?"":"file://")+t.replace(/\\/g,"/").replace(/^\//,""):t.replace(/^\//,"file:///"));class ws extends Error{constructor(t,e){super(t),this.package=e}}class Os{get canLoad(){return 0===this.dependencyCount&&!this.noLoad&&!this.isLoading&&!this.hasFailed}static loadPromise(t){const e=Us[t]||{},s=e.extraLoads?_s.load(...e.extraLoads):Promise.resolve(),i=e.checkReady||(()=>Promise.resolve());return s.then(()=>i())}static resolvePath(t,e=!0){const s={name:t,original:t,addExtension:e};return _s.pathFilters.execute(s),s.name}static loadAll(){for(const t of this.packages.values())t.canLoad&&t.load()}constructor(t,e=!1){this.isLoaded=!1,this.result={},this.isLoading=!1,this.hasFailed=!1,this.dependents=[],this.dependencies=[],this.dependencyCount=0,this.provided=[],this.name=t,this.noLoad=e,Os.packages.set(t,this),this.promise=this.makePromise(this.makeDependencies())}makeDependencies(){const t=[],e=Os.packages,s=this.noLoad,i=this.name,n=[];Object.hasOwn(Us.dependencies,i)?n.push(...Us.dependencies[i]):"core"!==i&&n.push("core");for(const i of n){const n=e.get(i)||new Os(i,s);this.dependencies.includes(n)||(n.addDependent(this,s),this.dependencies.push(n),n.isLoaded||(this.dependencyCount++,t.push(n.promise)))}return t}makePromise(t){let e=new Promise((t,e)=>{this.resolve=t,this.reject=e});const s=Us[this.name]||{};return s.ready&&(e=e.then(t=>s.ready(this.name))),t.length&&(t.push(e),e=Promise.all(t).then(t=>t.join(", "))),s.failed&&e.catch(t=>s.failed(new ws(t,this.name))),e}load(){if(!this.isLoaded&&!this.isLoading&&!this.noLoad){this.isLoading=!0;const t=Os.resolvePath(this.name);Us.require?this.loadCustom(t):this.loadScript(t)}}loadCustom(t){try{const e=Us.require(t);e instanceof Promise?e.then(t=>this.result=t).then(()=>this.checkLoad()).catch(e=>this.failed("Can't load \""+t+'"\n'+e.message.trim())):(this.result=e,this.checkLoad())}catch(t){this.failed(t.message)}}loadScript(t){const e=As.document.createElement("script");e.src=t,e.charset="UTF-8",e.onload=t=>this.checkLoad(),e.onerror=e=>this.failed("Can't load \""+t+'"'),As.document.head.appendChild(e)}loaded(){this.isLoaded=!0,this.isLoading=!1;for(const t of this.dependents)t.requirementSatisfied();for(const t of this.provided)t.loaded();this.resolve(this.name)}failed(t){this.hasFailed=!0,this.isLoading=!1,this.reject(new ws(t,this.name))}checkLoad(){Os.loadPromise(this.name).then(()=>this.loaded()).catch(t=>this.failed(t))}requirementSatisfied(){this.dependencyCount&&(this.dependencyCount--,this.canLoad&&this.load())}provides(t=[]){for(const e of t){let t=Os.packages.get(e);t||(Us.dependencies[e]||(Us.dependencies[e]=[]),Us.dependencies[e].push(e),t=new Os(e,!0),t.isLoading=!0),this.provided.push(t)}}addDependent(t,e){this.dependents.push(t),e||this.checkNoLoad()}checkNoLoad(){if(this.noLoad){this.noLoad=!1;for(const t of this.dependencies)t.checkNoLoad()}}}Os.packages=new Map;class Ms{constructor(){this.items=[],this.items=[]}[Symbol.iterator](){let t=0;const e=this.items;return{next:()=>({value:e[t++],done:t>e.length})}}add(t,e=Ms.DEFAULTPRIORITY){let s=this.items.length;do{s--}while(s>=0&&e<this.items[s].priority);return this.items.splice(s+1,0,{item:t,priority:e}),t}remove(t){let e=this.items.length;do{e--}while(e>=0&&this.items[e].item!==t);return e>=0&&this.items.splice(e,1),this}}Ms.DEFAULTPRIORITY=5;class Ds extends Ms{constructor(t=null){super(),t&&this.addList(t)}addList(t){for(const e of t)Array.isArray(e)?this.add(e[0],e[1]):this.add(e)}execute(...t){for(const e of this){if(!1===e.item(...t))return!1}return!0}asyncExecute(...t){let e=-1;const s=this.items;return new Promise((i,n)=>{!function r(){for(;++e<s.length;){const o=s[e].item(...t);if(o instanceof Promise)return void o.then(r).catch(t=>n(t));if(!1===o)return void i(!1)}i(!0)}()})}}const ks=Rs.config||{};var Ps=function(t,e,s,i){return new(s||(s=Promise))(function(n,r){function o(t){try{l(i.next(t))}catch(t){r(t)}}function a(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})};const Bs={source:t=>(Object.hasOwn(Us.source,t.name)&&(t.name=Us.source[t.name]),!0),normalize:t=>{const e=t.name;return e.match(/^(?:[a-z]+:\/)?\/|[a-z]:[/\\]|\[/i)||(t.name="[mathjax]/"+e.replace(/^\.\//,"")),!0},prefix:t=>{let e;for(;(e=t.name.match(/^\[([^\]]*)\]/))&&Object.hasOwn(Us.paths,e[1]);)t.name=Us.paths[e[1]]+t.name.substring(e[0].length);return!0},addExtension:t=>(t.addExtension&&!t.name.match(/\.[^/]+$/)&&(t.name+=".js"),!0)},js=Rs.version,_s={versions:new Map,nestedLoads:[],ready(...t){0===t.length&&(t=Array.from(Os.packages.keys()));const e=[];for(const s of t){const t=Os.packages.get(s)||new Os(s,!0);e.push(t.promise)}return Promise.all(e)},load(...t){if(0===t.length)return Promise.resolve([]);let e=[];this.nestedLoads.unshift(e);const s=Promise.resolve().then(()=>Ps(this,void 0,void 0,function*(){const s=[];for(const e of t){let t=Os.packages.get(e);t||(t=new Os(e),t.provides(Us.provides[e])),t.checkNoLoad(),s.push(t.promise.then(()=>(Us.versionWarnings&&t.isLoaded&&!_s.versions.has(Os.resolvePath(e))&&console.warn(`No version information available for component ${e}`),t.result)))}Os.loadAll();const i=yield Promise.all(s);for(;e.length;){const t=Promise.all(e);e=this.nestedLoads[this.nestedLoads.indexOf(e)]=[],yield t}return this.nestedLoads.splice(this.nestedLoads.indexOf(e),1),i}));return this.nestedLoads.slice(1).forEach(t=>t.push(s)),s},preLoaded(...t){for(const e of t){let t=Os.packages.get(e);t||(t=new Os(e,!0),t.provides(Us.provides[e])),t.loaded()}},addPackageData(t,e){let s=Us[t];s||(s=Us[t]={});for(const[t,i]of Object.entries(e))if(Array.isArray(i)){s[t]||(s[t]=[]);const e=new Set([...s[t],...i]);s[t]=[...e]}else s[t]=i},defaultReady(){void 0!==Fs.startup&&Fs.config.startup.ready()},getRoot(){if(As.document){const t=As.document.currentScript||As.document.getElementById("MathJax-script");if(t&&t instanceof HTMLScriptElement)return t.src.replace(/\/[^/]*$/,"")}return ks?.loader?.paths?.mathjax||ks?.__dirname||"/"},checkVersion(t,e,s){return this.saveVersion(t),!(!Us.versionWarnings||e===js)&&(console.warn(`Component ${t} uses ${e} of MathJax; version in use is ${js}`),!0)},saveVersion(t){_s.versions.set(Os.resolvePath(t),js)},pathFilters:new Ds};_s.pathFilters.add(Bs.source,0),_s.pathFilters.add(Bs.normalize,10),_s.pathFilters.add(Bs.prefix,20),_s.pathFilters.add(Bs.addExtension,30);const Fs=Rs;if(void 0===Fs.loader){Ls(Fs.config,"loader",{paths:{mathjax:_s.getRoot(),fonts:As.window?"https://cdn.jsdelivr.net/npm/@mathjax":"@mathjax"},source:{},dependencies:{},provides:{},load:[],ready:_s.defaultReady.bind(_s),failed:t=>console.log(`MathJax(${t.package||"?"}): ${t.message}`),require:null,pathFilters:[],versionWarnings:!0}),Cs({loader:_s});for(const t of Fs.config.loader.pathFilters)Array.isArray(t)?_s.pathFilters.add(t[0],t[1]):_s.pathFilters.add(t)}const Us=Fs.config.loader,Hs={}.constructor;function Ws(t){return"object"==typeof t&&null!==t&&(t.constructor===Hs||t.constructor===zs)}const Vs="[+]",qs="[-]",Xs={invalidOption:"warn",optionError:(t,e)=>{if("fatal"===Xs.invalidOption)throw new Error(t);console.warn("MathJax: "+t)}};class zs{}function Gs(t){return Object.assign(Object.create(zs.prototype),t)}function Js(t){return Array.isArray(t)?t:[t]}function Ks(t){return t?Object.keys(t).concat(Object.getOwnPropertySymbols(t)):[]}function $s(t){const e={};for(const s of Ks(t)){const i=Object.getOwnPropertyDescriptor(t,s),n=i.value;Array.isArray(n)?i.value=Ys([],n,!1):Ws(n)&&(i.value=$s(n)),i.enumerable&&(e[s]=i)}return Object.defineProperties(t.constructor===zs?Gs({}):{},e)}function Ys(t,e,s=!0){for(let i of Ks(e)){if(s&&void 0===t[i]&&t.constructor!==zs){"symbol"==typeof i&&(i=i.toString()),Xs.optionError(`Invalid option "${i}" (no default value).`,i);continue}const n=e[i];let r=t[i];if(!Ws(n)||null===r||"object"!=typeof r&&"function"!=typeof r)Array.isArray(n)?(t[i]=[],Ys(t[i],n,!1)):Ws(n)?t[i]=$s(n):t[i]=n;else{const e=Ks(n);Array.isArray(r)&&(1===e.length&&(e[0]===Vs||e[0]===qs)&&Array.isArray(n[e[0]])||2===e.length&&e.sort().join(",")===Vs+","+qs&&Array.isArray(n[Vs])&&Array.isArray(n[qs]))?(n[qs]&&(r=t[i]=r.filter(t=>n[qs].indexOf(t)<0)),n[Vs]&&(t[i]=[...r,...n[Vs]])):Ys(r,n,s)}}return t}function Qs(t,...e){return e.forEach(e=>Ys(t,e,!1)),t}function Zs(t,...e){return e.forEach(e=>Ys(t,e,!0)),t}function ti(t,...e){const s={};for(const i of e)Object.hasOwn(t,i)&&(s[i]=t[i]);return s}function ei(t,e){return ti(t,...Object.keys(e))}function si(t,...e){const s=[];for(const i of e){const e={},n={};for(const s of Object.keys(t||{}))(void 0===i[s]?n:e)[s]=t[s];s.push(e),t=n}return s.unshift(t),s}function ii(t,e,s=null){return Object.hasOwn(e,t)?e[t]:s}var ni=function(t,e,s,i){return new(s||(s=Promise))(function(n,r){function o(t){try{l(i.next(t))}catch(t){r(t)}}function a(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})};class ri{static toMML(t){return ri.visitor.visitTree(t,this.document)}static registerConstructor(t,e){ri.constructors[t]=e}static useHandler(t,e=!1){ai.handler&&!e||(ai.handler=t)}static useAdaptor(t,e=!1){ai.adaptor&&!e||(ai.adaptor=t)}static useInput(t,e=!1){li&&!e||ai.input.push(t)}static useOutput(t,e=!1){ai.output&&!e||(ai.output=t)}static extendHandler(t,e=10){ri.extensions.add(t,e)}static defaultReady(){ri.getComponents(),ri.makeMethods(),ri.pagePromise.then(()=>ai.pageReady()).then(()=>ri.promiseResolve()).catch(t=>ri.promiseReject(t))}static defaultPageReady(){return(ai.loadAllFontFiles&&ri.output.font?ri.output.font.loadDynamicFiles():Promise.resolve()).then(()=>{var t;return null===(t=ri.document.menu)||void 0===t?void 0:t.loadingPromise}).then(ai.typeset&&oi.typesetPromise?()=>ri.typesetPromise(ai.elements):Promise.resolve()).then(()=>ri.promiseResolve())}static typesetPromise(t){return this.hasTypeset=!0,ri.document.whenReady(()=>ni(this,void 0,void 0,function*(){ri.document.options.elements=t,ri.document.reset(),yield ri.document.renderPromise()}))}static getComponents(){ri.visitor=new oi._.core.MmlTree.SerializedMmlVisitor.SerializedMmlVisitor,ri.mathjax=oi._.mathjax.mathjax,ri.input=ri.getInputJax(),ri.output=ri.getOutputJax(),ri.adaptor=ri.getAdaptor(),ri.handler&&ri.mathjax.handlers.unregister(ri.handler),ri.handler=ri.getHandler(),ri.handler&&(ri.mathjax.handlers.register(ri.handler),ri.document=ri.getDocument())}static makeMethods(){ri.input&&ri.output&&ri.makeTypesetMethods();const t=ri.output?ri.output.name.toLowerCase():"";for(const e of ri.input){const s=e.name.toLowerCase();ri.makeMmlMethods(s,e),ri.makeResetMethod(s,e),ri.output&&ri.makeOutputMethods(s,t,e)}oi.done=()=>ri.document.done(),oi.whenReady=t=>ri.document.whenReady(t)}static makeTypesetMethods(){oi.typeset=(t=null)=>{this.hasTypeset=!0,ri.document.options.elements=t,ri.document.reset(),ri.document.render()},oi.typesetPromise=(t=null)=>ri.typesetPromise(t),oi.typesetClear=(t=null)=>{t?ri.document.clearMathItemsWithin(t):ri.document.clear()}}static makeOutputMethods(t,e,s){const i=t+"2"+e;oi[i]=(t,e={})=>(e=Object.assign(Object.assign({},e),{format:s.name}),ri.document.convert(t,e)),oi[i+"Promise"]=(t,e={})=>(e=Object.assign(Object.assign({},e),{format:s.name}),ri.document.convertPromise(t,e)),oi[e+"Stylesheet"]=()=>ri.output.styleSheet(ri.document),"getMetricsFor"in ri.output&&(oi.getMetricsFor=(t,e)=>ri.output.getMetricsFor(t,e))}static makeMmlMethods(t,e){const s=oi._.core.MathItem.STATE;oi[t+"2mml"]=(t,i={})=>(i=Object.assign(Object.assign({},i),{end:s.CONVERT,format:e.name}),ri.toMML(ri.document.convert(t,i))),oi[t+"2mmlPromise"]=(t,...i)=>ni(this,[t,...i],void 0,function*(t,i={}){i=Object.assign(Object.assign({},i),{end:s.CONVERT,format:e.name});const n=yield ri.document.convertPromise(t,i);return ri.toMML(n)})}static makeResetMethod(t,e){oi[t+"Reset"]=(...t)=>e.reset(...t)}static getInputJax(){const t=[];for(const e of ai.input){const s=ri.constructors[e];if(!s)throw Error('Input Jax "'+e+'" is not defined (has it been loaded?)');t[e]=new s(oi.config[e]),t.push(t[e])}return t}static getOutputJax(){const t=ai.output;if(!t)return null;const e=ri.constructors[t];if(!e)throw Error('Output Jax "'+t+'" is not defined (has it been loaded?)');return new e(oi.config[t])}static getAdaptor(){const t=ai.adaptor;if(!t||"none"===t)return null;const e=ri.constructors[t];if(!e)throw Error('DOMAdaptor "'+t+'" is not defined (has it been loaded?)');return e(oi.config[t])}static getHandler(){const t=ai.handler;if(!t||"none"===t||!ri.adaptor)return null;const e=ri.constructors[t];if(!e)throw Error('Handler "'+t+'" is not defined (has it been loaded?)');let s=new e(ri.adaptor,5);for(const t of ri.extensions)s=t.item(s);return s}static getDocument(t=null){return ri.mathjax.document(t||ai.document,Object.assign(Object.assign({},oi.config.options),{InputJax:ri.input,OutputJax:ri.output}))}}ri.extensions=new Ms,ri.constructors={},ri.input=[],ri.output=null,ri.handler=null,ri.adaptor=null,ri.elements=null,ri.document=null,ri.promise=new Promise((t,e)=>{ri.promiseResolve=t,ri.promiseReject=e}),ri.pagePromise=new Promise((t,e)=>{const s=Ns.document;if(s&&s.readyState&&"complete"!==s.readyState&&"interactive"!==s.readyState){const e=()=>t();s.defaultView.addEventListener("load",e,!0),s.defaultView.addEventListener("DOMContentLoaded",e,!0)}else t()}),ri.hasTypeset=!1,ri.defaultOptionError=Xs.optionError;const oi=Rs;void 0===oi._.startup&&(Ls(oi.config,"startup",{input:[],output:"",handler:null,adaptor:null,document:As.document||"",elements:null,typeset:!0,ready:ri.defaultReady.bind(ri),pageReady:ri.defaultPageReady.bind(ri),polyfillHasOwn:!0}),Cs({startup:ri,options:{}}),oi.config.startup.invalidOption&&(Xs.invalidOption=oi.config.startup.invalidOption),oi.config.startup.optionError&&(Xs.optionError=oi.config.startup.optionError));const ai=oi.config.startup,li=0!==ai.input.length;MathJax.loader&&MathJax.loader.checkVersion("startup",xs,"startup"),Cs({_:{components:{loader:o,package:s,startup:l}}});_s.preLoaded("loader","startup"),Ls(MathJax.config.loader,"dependencies",{"a11y/semantic-enrich":["input/mml","a11y/sre"],"a11y/speech":["a11y/semantic-enrich"],"a11y/complexity":["a11y/semantic-enrich"],"a11y/explorer":["a11y/speech"],"[mml]/mml3":["input/mml"],"[tex]/action":["input/tex-base"],"[tex]/ams":["input/tex-base","[tex]/newcommand"],"[tex]/amscd":["input/tex-base"],"[tex]/autoload":["input/tex-base","[tex]/require"],"[tex]/bbm":["input/tex-base"],"[tex]/bboldx":["input/tex-base","[tex]/textmacros"],"[tex]/bbox":["input/tex-base"],"[tex]/begingroup":["input/tex-base","[tex]/newcommand"],"[tex]/boldsymbol":["input/tex-base"],"[tex]/braket":["input/tex-base"],"[tex]/bussproofs":["input/tex-base"],"[tex]/cancel":["input/tex-base","[tex]/enclose"],"[tex]/cases":["[tex]/empheq"],"[tex]/centernot":["input/tex-base"],"[tex]/color":["input/tex-base"],"[tex]/colortbl":["input/tex-base","[tex]/color"],"[tex]/colorv2":["input/tex-base"],"[tex]/configmacros":["input/tex-base","[tex]/newcommand"],"[tex]/dsfont":["input/tex-base"],"[tex]/empheq":["input/tex-base","[tex]/ams"],"[tex]/enclose":["input/tex-base"],"[tex]/extpfeil":["input/tex-base","[tex]/newcommand","[tex]/ams"],"[tex]/gensymb":["input/tex-base"],"[tex]/html":["input/tex-base"],"[tex]/mathtools":["input/tex-base","[tex]/newcommand","[tex]/ams","[tex]/boldsymbol"],"[tex]/mhchem":["input/tex-base","[tex]/ams"],"[tex]/newcommand":["input/tex-base"],"[tex]/noerrors":["input/tex-base"],"[tex]/noundefined":["input/tex-base"],"[tex]/physics":["input/tex-base"],"[tex]/require":["input/tex-base"],"[tex]/setoptions":["input/tex-base"],"[tex]/tagformat":["input/tex-base"],"[tex]/texhtml":["input/tex-base"],"[tex]/textcomp":["input/tex-base","[tex]/textmacros"],"[tex]/textmacros":["input/tex-base"],"[tex]/unicode":["input/tex-base"],"[tex]/units":["input/tex-base"],"[tex]/upgreek":["input/tex-base"],"[tex]/verb":["input/tex-base"],"ui/menu":["a11y/sre"]}),Ls(MathJax.config.loader,"paths",{tex:"[mathjax]/input/tex/extensions",mml:"[mathjax]/input/mml/extensions",sre:"[mathjax]/sre",mathmaps:"[sre]/mathmaps"}),Ls(MathJax.config.loader,"provides",{startup:["loader"],"input/tex":["input/tex-base","[tex]/ams","[tex]/newcommand","[tex]/textmacros","[tex]/noundefined","[tex]/require","[tex]/autoload","[tex]/configmacros"]}),Ls(MathJax.config.loader,"source",{"[tex]/amsCd":"[tex]/amscd","[tex]/colorV2":"[tex]/colorv2","[tex]/configMacros":"[tex]/configmacros","[tex]/tagFormat":"[tex]/tagformat"});class hi{constructor(t=null){this.canMeasureNodes=!0,this.document=t}node(t,e={},s=[],i){const n=this.create(t,i);this.setAttributes(n,e);for(const t of s)this.append(n,t);return n}setProperty(t,e,s){t[e]=s}getProperty(t,e){return t[e]}setAttributes(t,e){if(e.style&&"string"!=typeof e.style)for(const s of Object.keys(e.style))this.setStyle(t,s.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()),e.style[s]);if(e.properties)for(const s of Object.keys(e.properties))t[s]=e.properties[s];for(const s of Object.keys(e))"style"===s&&"string"!=typeof e.style||"properties"===s||this.setAttribute(t,s,e[s])}replace(t,e){return this.insert(t,e),this.remove(e),e}childNode(t,e){return this.childNodes(t)[e]}allClasses(t){const e=this.getAttribute(t,"class");return e?e.replace(/ +/g," ").replace(/^ /,"").replace(/ $/,"").split(/ /):[]}cssText(t){return"style"===this.kind(t)?this.textContent(t):""}}var ci=function(t,e,s,i){return new(s||(s=Promise))(function(n,r){function o(t){try{l(i.next(t))}catch(t){r(t)}}function a(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})};class di extends hi{constructor(t){super(t.document),this.canMeasureNodes=!0,this.window=t,this.parser=new t.DOMParser}parse(t,e="text/html"){return this.parser.parseFromString(t,e)}create(t,e){return e?this.document.createElementNS(e,t):this.document.createElement(t)}text(t){return this.document.createTextNode(t)}head(t=this.document){return t.head||t}body(t=this.document){return t.body||t}root(t=this.document){return t.documentElement||t}doctype(t=this.document){return t.doctype?`<!DOCTYPE ${t.doctype.name}>`:""}tags(t,e,s=null){const i=s?t.getElementsByTagNameNS(s,e):t.getElementsByTagName(e);return Array.from(i)}getElements(t,e){let s=[];for(const e of t)"string"==typeof e?s=s.concat(Array.from(this.document.querySelectorAll(e))):Array.isArray(e)||e instanceof this.window.NodeList||e instanceof this.window.HTMLCollection?s=s.concat(Array.from(e)):s.push(e);return s}getElement(t,e=this.document){return e.querySelector(t)}contains(t,e){return t.contains(e)}parent(t){return t.parentNode}append(t,e){return t.appendChild(e)}insert(t,e){return this.parent(e).insertBefore(t,e)}remove(t){return this.parent(t).removeChild(t)}replace(t,e){return this.parent(e).replaceChild(t,e)}clone(t,e=!0){return t.cloneNode(e)}split(t,e){return t.splitText(e)}next(t){return t.nextSibling}previous(t){return t.previousSibling}firstChild(t){return t.firstChild}lastChild(t){return t.lastChild}childNodes(t){return Array.from(t.childNodes)}childNode(t,e){return t.childNodes[e]}kind(t){const e=t.nodeType;return 1===e||3===e||8===e?t.nodeName.toLowerCase():""}value(t){return t.nodeValue||""}textContent(t){return t.textContent}innerHTML(t){return t.innerHTML}outerHTML(t){return t.outerHTML}serializeXML(t){return(new this.window.XMLSerializer).serializeToString(t)}setAttribute(t,e,s,i=null){return i?(e=i.replace(/.*\//,"")+":"+e.replace(/^.*:/,""),t.setAttributeNS(i,e,s)):("style"===e&&(s=s.replace(/\n/g," ")),t.setAttribute(e,s))}getAttribute(t,e){return t.getAttribute(e)}removeAttribute(t,e){return t.removeAttribute(e)}hasAttribute(t,e){return t.hasAttribute(e)}allAttributes(t){return Array.from(t.attributes).map(t=>({name:t.name,value:t.value}))}addClass(t,e){t.classList?t.classList.add(e):t.className=(t.className+" "+e).trim()}removeClass(t,e){t.classList?t.classList.remove(e):t.className=t.className.split(/ /).filter(t=>t!==e).join(" ")}hasClass(t,e){return t.classList?t.classList.contains(e):t.className.split(/ /).includes(e)}setStyle(t,e,s){t.style[e]=String(s).replace(/\n/g," ")}getStyle(t,e){return t.style[e]}allStyles(t){return t.style.cssText}insertRules(t,e){for(const s of e)try{t.sheet.insertRule(s,t.sheet.cssRules.length)}catch(t){console.warn(`MathJax: can't insert css rule '${s}': ${t.message}`)}}cssText(t){return"style"!==this.kind(t)?"":Array.from(t.sheet.cssRules).map(t=>t.cssText).join("\n")}fontSize(t){const e=this.window.getComputedStyle(t);return parseFloat(e.fontSize||String(this.constructor.DEFAULT_FONT_SIZE))}fontFamily(t){return this.window.getComputedStyle(t).fontFamily||""}nodeSize(t,e=1,s=!1){if(s&&t.getBBox){const{width:s,height:i}=t.getBBox();return[s/e,i/e]}return[t.offsetWidth/e,t.offsetHeight/e]}nodeBBox(t){const{left:e,right:s,top:i,bottom:n}=t.getBoundingClientRect();return{left:e,right:s,top:i,bottom:n}}createWorker(t,e){return ci(this,void 0,void 0,function*(){const{path:s,maps:i,worker:n}=e,r=`${s}/${n}`,o=`\n self.maps = '${ui(i)}';\n importScripts('${ui(r)}');\n `,a=URL.createObjectURL(new Blob([o],{type:"text/javascript"})),l=new Worker(a);return l.onmessage=t,URL.revokeObjectURL(a),l})}}function ui(t){return[...t].map(t=>("\\"===t||"'"===t?t="\\"+t:(t<" "||t>"~")&&(t=`\\u{${t.codePointAt(0).toString(16)}}`),t)).join("")}function pi(){return new di(window)}di.DEFAULT_FONT_SIZE=16;class mi{constructor(t){const e=this.constructor;this.options=Zs(Qs({},e.OPTIONS),t)}}mi.OPTIONS={};class fi{constructor(t={}){this.adaptor=null,this.mmlFactory=null;const e=this.constructor;this.options=Zs(Qs({},e.OPTIONS),t),this.preFilters=new Ds(this.options.preFilters),this.postFilters=new Ds(this.options.postFilters)}get name(){return this.constructor.NAME}setAdaptor(t){this.adaptor=t}setMmlFactory(t){this.mmlFactory=t}initialize(){}reset(...t){}get processStrings(){return!0}findMath(t,e){return[]}executeFilters(t,e,s,i){const n={math:e,document:s,data:i};return t.execute(n),n.data}}fi.NAME="generic",fi.OPTIONS={preFilters:[],postFilters:[]};class gi{constructor(t={}){this.adaptor=null;const e=this.constructor;this.options=Zs(Qs({},e.OPTIONS),t),this.preFilters=new Ds(this.options.preFilters),this.postFilters=new Ds(this.options.postFilters)}get name(){return this.constructor.NAME}setAdaptor(t){this.adaptor=t}initialize(){}reset(...t){}getMetrics(t){}styleSheet(t){return null}pageElements(t){return null}executeFilters(t,e,s,i){const n={math:e,document:s,data:i};return t.execute(n),n.data}}gi.NAME="generic",gi.OPTIONS={preFilters:[],postFilters:[]};const bi=Symbol();class Ei{constructor(t=null){this.next=null,this.prev=null,this.data=t}}class xi{constructor(...t){this.list=new Ei(bi),this.list.next=this.list.prev=this.list,this.push(...t)}isBefore(t,e){return t<e}push(...t){for(const e of t){const t=new Ei(e);t.next=this.list,t.prev=this.list.prev,this.list.prev=t,t.prev.next=t}return this}pop(){const t=this.list.prev;return t.data===bi?null:(this.list.prev=t.prev,t.prev.next=this.list,t.next=t.prev=null,t.data)}unshift(...t){for(const e of t.slice(0).reverse()){const t=new Ei(e);t.next=this.list.next,t.prev=this.list,this.list.next=t,t.next.prev=t}return this}shift(){const t=this.list.next;return t.data===bi?null:(this.list.next=t.next,t.next.prev=this.list,t.next=t.prev=null,t.data)}remove(...t){const e=new Map;for(const s of t)e.set(s,!0);let s=this.list.next;for(;s.data!==bi;){const t=s.next;e.has(s.data)&&(s.prev.next=s.next,s.next.prev=s.prev,s.next=s.prev=null),s=t}return this}clear(){return this.list.next.prev=this.list.prev.next=null,this.list.next=this.list.prev=this.list,this}*[Symbol.iterator](){let t=this.list.next;for(;t.data!==bi;)yield t.data,t=t.next}*reversed(){let t=this.list.prev;for(;t.data!==bi;)yield t.data,t=t.prev}insert(t,e=null){null===e&&(e=this.isBefore.bind(this));const s=new Ei(t);let i=this.list.next;for(;i.data!==bi&&e(i.data,s.data);)i=i.next;return s.prev=i.prev,s.next=i,i.prev.next=i.prev=s,this}sort(t=null){null===t&&(t=this.isBefore.bind(this));const e=[];for(const t of this)e.push(new xi(t));for(this.list.next=this.list.prev=this.list;e.length>1;){const s=e.shift(),i=e.shift();s.merge(i,t),e.push(s)}return e.length&&(this.list=e[0].list),this}merge(t,e=null){null===e&&(e=this.isBefore.bind(this));let s=this.list.next,i=t.list.next;for(;s.data!==bi&&i.data!==bi;)e(i.data,s.data)?([i.prev.next,s.prev.next]=[s,i],[i.prev,s.prev]=[s.prev,i.prev],[this.list.prev.next,t.list.prev.next]=[t.list,this.list],[this.list.prev,t.list.prev]=[t.list.prev,this.list.prev],[s,i]=[i.next,s]):s=s.next;return i.data!==bi&&(this.list.prev.next=t.list.next,t.list.next.prev=this.list.prev,t.list.prev.next=this.list,this.list.prev=t.list.prev,t.list.next=t.list.prev=t.list),this}}class yi extends xi{isBefore(t,e){return t.start.i<e.start.i||t.start.i===e.start.i&&t.start.n<e.start.n}}function Ni(t,e,s,i,n,r,o=null){return{open:t,math:e,close:s,n:i,start:{n},end:{n:r},display:o}}class Ti{get isEscaped(){return null===this.display}constructor(t,e,s=!0,i={i:0,n:0,delim:""},n={i:0,n:0,delim:""}){this.root=null,this.typesetRoot=null,this.metrics={},this.inputData={},this.outputData={},this._state=vi.UNPROCESSED,this.math=t,this.inputJax=e,this.display=s,this.start=i,this.end=n,this.root=null,this.typesetRoot=null,this.metrics={},this.inputData={},this.outputData={}}render(t){t.renderActions.renderMath(this,t)}rerender(t,e=vi.RERENDER){this.state()>=e&&this.state(e-1),t.renderActions.renderMath(this,t,e)}convert(t,e=vi.LAST){t.renderActions.renderConvert(this,t,e)}compile(t){this.state()<vi.COMPILED&&(this.root=this.inputJax.compile(this,t),this.state(vi.COMPILED))}typeset(t){this.state()<vi.TYPESET&&(this.typesetRoot=t.outputJax[this.isEscaped?"escaped":"typeset"](this,t),this.state(vi.TYPESET))}updateDocument(t){}removeFromDocument(t=!1){this.clear()}setMetrics(t,e,s,i){this.metrics={em:t,ex:e,containerWidth:s,scale:i}}state(t=null,e=!1){return null!=t&&(t<vi.INSERTED&&this._state>=vi.INSERTED&&this.removeFromDocument(e),t<vi.TYPESET&&this._state>=vi.TYPESET&&(this.outputData={}),t<vi.COMPILED&&this._state>=vi.COMPILED&&(this.inputData={}),this._state=t),this._state}reset(t=!1){this.state(vi.UNPROCESSED,t)}clear(){}}const vi={UNPROCESSED:0,FINDMATH:10,COMPILED:20,CONVERT:100,METRICS:110,RERENDER:125,TYPESET:150,INSERTED:200,LAST:1e4};function Li(t,e){if(t in vi)throw Error("State "+t+" already exists");vi[t]=e}class Ci{constructor(t=null){this.defaultKind="unknown",this.nodeMap=new Map,this.node={},null===t&&(t=this.constructor.defaultNodes);for(const e of Object.keys(t))this.setNodeClass(e,t[e])}create(t,...e){return(this.node[t]||this.node[this.defaultKind])(...e)}setNodeClass(t,e){this.nodeMap.set(t,e);const s=this.nodeMap.get(t);this.node[t]=(...t)=>new s(this,...t)}getNodeClass(t){return this.nodeMap.get(t)}deleteNodeClass(t){this.nodeMap.delete(t),delete this.node[t]}nodeIsKind(t,e){return t instanceof this.getNodeClass(e)}getKinds(){return Array.from(this.nodeMap.keys())}}Ci.defaultNodes={};class Ri extends Ci{create(t,e={},s=[]){return this.node[t](e,s)}}const Ii="_inherit_";class Si{constructor(t,e){this.global=e,this.defaults=Object.create(e),this.inherited=Object.create(this.defaults),this.attributes=Object.create(this.inherited),Object.assign(this.defaults,t)}set(t,e){this.attributes[t]=e}setList(t){Object.assign(this.attributes,t)}unset(t){delete this.attributes[t]}get(t){let e=this.attributes[t];return e===Ii&&(e=this.global[t]),e}getExplicit(t){return this.hasExplicit(t)?this.attributes[t]:void 0}hasExplicit(t){return Object.hasOwn(this.attributes,t)}hasOneOf(t){for(const e of t)if(this.hasExplicit(e))return!0;return!1}getList(...t){const e={};for(const s of t)e[s]=this.get(s);return e}setInherited(t,e){this.inherited[t]=e}getInherited(t){return this.inherited[t]}getDefault(t){return this.defaults[t]}isSet(t){return Object.hasOwn(this.attributes,t)||Object.hasOwn(this.inherited,t)}hasDefault(t){return t in this.defaults}getExplicitNames(){return Object.keys(this.attributes)}getInheritedNames(){return Object.keys(this.inherited)}getDefaultNames(){return Object.keys(this.defaults)}getGlobalNames(){return Object.keys(this.global)}getAllAttributes(){return this.attributes}getAllInherited(){return this.inherited}getAllDefaults(){return this.defaults}getAllGlobals(){return this.global}}class Ai{constructor(t,e={},s=[]){this.factory=t,this.parent=null,this.properties={},this.childNodes=[];for(const t of Object.keys(e))this.setProperty(t,e[t]);s.length&&this.setChildren(s)}get kind(){return"unknown"}setProperty(t,e){this.properties[t]=e}getProperty(t){return this.properties[t]}getPropertyNames(){return Object.keys(this.properties)}getAllProperties(){return this.properties}removeProperty(...t){for(const e of t)delete this.properties[e]}isKind(t){return this.factory.nodeIsKind(this,t)}setChildren(t){this.childNodes=[];for(const e of t)this.appendChild(e)}appendChild(t){return this.childNodes.push(t),t.parent=this,t}replaceChild(t,e){const s=this.childIndex(e);return null!==s&&(this.childNodes[s]=t,t.parent=this,e.parent===this&&(e.parent=null)),t}removeChild(t){const e=this.childIndex(t);return null!==e&&(this.childNodes.splice(e,1),t.parent=null),t}childIndex(t){const e=this.childNodes.indexOf(t);return-1===e?null:e}copy(){const t=this.factory.create(this.kind);t.properties=Object.assign({},this.properties);for(const e of this.childNodes||[])e&&t.appendChild(e.copy());return t}findNodes(t){const e=[];return this.walkTree(s=>{s.isKind(t)&&e.push(s)}),e}walkTree(t,e){t(this,e);for(const s of this.childNodes)s&&s.walkTree(t,e);return e}toString(){return this.kind+"("+this.childNodes.join(",")+")"}}class wi extends Ai{setChildren(t){}appendChild(t){return t}replaceChild(t,e){return e}childIndex(t){return null}walkTree(t,e){return t(this,e),e}toString(){return this.kind}}const Oi={ORD:0,OP:1,BIN:2,REL:3,OPEN:4,CLOSE:5,PUNCT:6,INNER:7,NONE:-1},Mi=["ORD","OP","BIN","REL","OPEN","CLOSE","PUNCT","INNER"],Di=["","thinmathspace","mediummathspace","thickmathspace"],ki=[[0,-1,2,3,0,0,0,1],[-1,-1,0,3,0,0,0,1],[2,2,0,0,2,0,0,2],[3,3,0,0,3,0,0,3],[0,0,0,0,0,0,0,0],[0,-1,2,3,0,0,0,1],[1,1,0,1,1,1,1,1],[1,-1,2,3,1,0,1,1]],Pi=new Set(["normal","bold","italic","bold-italic","double-struck","fraktur","bold-fraktur","script","bold-script","sans-serif","bold-sans-serif","sans-serif-italic","sans-serif-bold-italic","monospace","inital","tailed","looped","stretched"]),Bi=["indentalign","indentalignfirst","indentshift","indentshiftfirst"];class ji extends Ai{constructor(t,e={},s=[]){super(t),this.prevClass=null,this.prevLevel=null,this.texclass=null,this.arity<0&&(this.childNodes=[t.create("inferredMrow")],this.childNodes[0].parent=this),this.setChildren(s),this.attributes=new Si(t.getNodeClass(this.kind).defaults,t.getNodeClass("math").defaults),this.attributes.setList(e)}copy(t=!1){const e=this.factory.create(this.kind);if(e.properties=Object.assign({},this.properties),this.attributes){const s=this.attributes.getAllAttributes();for(const i of Object.keys(s))("id"!==i||t)&&e.attributes.set(i,s[i])}if(this.childNodes&&this.childNodes.length){let t=this.childNodes;1===t.length&&t[0].isInferred&&(t=t[0].childNodes);for(const s of t)s?e.appendChild(s.copy()):e.childNodes.push(null)}return e}get texClass(){return this.texclass}set texClass(t){this.texclass=t}get isToken(){return!1}get isEmbellished(){return!1}get isSpacelike(){return!1}get linebreakContainer(){return!1}get linebreakAlign(){return"data-align"}get isEmpty(){for(const t of this.childNodes)if(t&&!t.isEmpty)return!1;return!0}get arity(){return 1/0}get isInferred(){return!1}get Parent(){let t=this.parent;for(;t&&t.notParent;)t=t.Parent;return t}get notParent(){return!1}setChildren(t){return this.arity<0?this.childNodes[0].setChildren(t):super.setChildren(t)}appendChild(t){if(this.arity<0)return this.childNodes[0].appendChild(t),t;if(t.isInferred){if(this.arity===1/0)return t.childNodes.forEach(t=>super.appendChild(t)),t;const e=t;(t=this.factory.create("mrow")).setChildren(e.childNodes),t.attributes=e.attributes;for(const s of e.getPropertyNames())t.setProperty(s,e.getProperty(s))}return super.appendChild(t)}replaceChild(t,e){return this.arity<0?(this.childNodes[0].replaceChild(t,e),t):super.replaceChild(t,e)}core(){return this}coreMO(){return this}coreIndex(){return 0}childPosition(){let t=null,e=this.parent;for(;e&&e.notParent;)t=e,e=e.parent;if(t=t||this,e){let s=0;for(const i of e.childNodes){if(i===t)return s;s++}}return null}setTeXclass(t){return this.getPrevClass(t),null!=this.texClass?this:t}updateTeXclass(t){t&&(this.prevClass=t.prevClass,this.prevLevel=t.prevLevel,t.prevClass=t.prevLevel=null,this.texClass=t.texClass)}getPrevClass(t){t&&(this.prevClass=t.texClass,this.prevLevel=t.attributes.get("scriptlevel"))}texSpacing(){const t=null!=this.prevClass?this.prevClass:Oi.NONE,e=this.texClass||Oi.ORD;if(t===Oi.NONE||e===Oi.NONE)return"";const s=ki[t][e];return(this.prevLevel>0||this.attributes.get("scriptlevel")>0)&&s>=0?"":Di[Math.abs(s)]}hasSpacingAttributes(){return this.isEmbellished&&this.coreMO().hasSpacingAttributes()}setInheritedAttributes(t={},e=!1,s=0,i=!1){var n,r,o;const a=this.attributes.getAllDefaults();for(const e of Object.keys(t)){if(Object.hasOwn(a,e)||Object.hasOwn(ji.alwaysInherit,e)){const[s,i]=t[e];(null===(r=null===(n=ji.noInherit[s])||void 0===n?void 0:n[this.kind])||void 0===r?void 0:r[e])||this.attributes.setInherited(e,i)}(null===(o=ji.stopInherit[this.kind])||void 0===o?void 0:o[e])&&delete(t=Object.assign({},t))[e]}void 0===this.attributes.getExplicit("displaystyle")&&this.attributes.setInherited("displaystyle",e);void 0===this.attributes.getExplicit("scriptlevel")&&this.attributes.setInherited("scriptlevel",s),i&&this.setProperty("texprimestyle",i);const l=this.arity;if(l>=0&&l!==1/0&&(1===l&&0===this.childNodes.length||1!==l&&this.childNodes.length!==l))if(l<this.childNodes.length)this.childNodes=this.childNodes.slice(0,l);else for(;this.childNodes.length<l;)this.appendChild(this.factory.create("mrow"));if(this.linebreakContainer&&!this.isEmbellished){const e=this.linebreakAlign;if(e){const s=this.attributes.get(e)||"left";t=this.addInheritedAttributes(t,{indentalign:s,indentshift:"0",indentalignfirst:s,indentshiftfirst:"0",indentalignlast:"indentalign",indentshiftlast:"indentshift"})}}this.setChildInheritedAttributes(t,e,s,i)}setChildInheritedAttributes(t,e,s,i){for(const n of this.childNodes)n.setInheritedAttributes(t,e,s,i)}addInheritedAttributes(t,e){const s=Object.assign({},t);for(const t of Object.keys(e))"displaystyle"!==t&&"scriptlevel"!==t&&"style"!==t&&(s[t]=[this.kind,e[t]]);return s}inheritAttributesFrom(t){const e=t.attributes,s=e.get("displaystyle"),i=e.get("scriptlevel"),n=e.isSet("mathsize")?{mathsize:["math",e.get("mathsize")]}:{},r=t.getProperty("texprimestyle")||!1;this.setInheritedAttributes(n,s,i,r)}verifyTree(t=null){if(null===t)return;this.verifyAttributes(t);const e=this.arity;t.checkArity&&e>=0&&e!==1/0&&(1===e&&0===this.childNodes.length||1!==e&&this.childNodes.length!==e)&&this.mError('Wrong number of children for "'+this.kind+'" node',t,!0),this.verifyChildren(t)}verifyAttributes(t){if(t.checkAttributes){const e=this.attributes,s=[];for(const t of e.getExplicitNames())"data-"===t.substring(0,5)||void 0!==e.getDefault(t)||t.match(/^(?:class|style|id|(?:xlink:)?href)$/)||s.push(t);s.length&&this.mError("Unknown attributes for "+this.kind+" node: "+s.join(", "),t)}if(t.checkMathvariants){const e=this.attributes.getExplicit("mathvariant");!e||Pi.has(e)||this.getProperty("ignore-variant")||this.mError(`Invalid mathvariant: ${e}`,t,!0)}}verifyChildren(t){for(const e of this.childNodes)e.verifyTree(t)}mError(t,e,s=!1){if(this.parent&&this.parent.isKind("merror"))return null;const i=this.factory.create("merror");if(i.attributes.set("data-mjx-message",t),e.fullErrors||s){const s=this.factory.create("mtext"),n=this.factory.create("text");n.setText(e.fullErrors?t:this.kind),s.appendChild(n),i.appendChild(s),this.parent.replaceChild(i,this),e.fullErrors||i.attributes.set("title",t)}else this.parent.replaceChild(i,this),i.appendChild(this);return i}}ji.defaults={mathbackground:Ii,mathcolor:Ii,mathsize:Ii,dir:Ii},ji.noInherit={mstyle:{mpadded:{width:!0,height:!0,depth:!0,lspace:!0,voffset:!0},mtable:{width:!0,height:!0,depth:!0,align:!0}},maligngroup:{mrow:{groupalign:!0},mtable:{groupalign:!0}},mtr:{msqrt:{"data-vertical-align":!0},mroot:{"data-vertical-align":!0}},mlabeledtr:{msqrt:{"data-vertical-align":!0},mroot:{"data-vertical-align":!0}}},ji.stopInherit={mtd:{columnalign:!0,rowalign:!0,groupalign:!0}},ji.alwaysInherit={scriptminsize:!0,scriptsizemultiplier:!0,infixlinebreakstyle:!0},ji.verifyDefaults={checkArity:!0,checkAttributes:!1,checkMathvariants:!0,fullErrors:!1,fixMmultiscripts:!0,fixMtables:!0};class _i extends ji{get isToken(){return!0}get isEmpty(){for(const t of this.childNodes)if(!(t instanceof Wi)||t.getText().length)return!1;return!0}getText(){let t="";for(const e of this.childNodes)e instanceof Wi?t+=e.getText():"textContent"in e&&(t+=e.textContent());return t}setChildInheritedAttributes(t,e,s,i){for(const n of this.childNodes)n instanceof ji&&n.setInheritedAttributes(t,e,s,i)}walkTree(t,e){t(this,e);for(const s of this.childNodes)s instanceof ji&&s.walkTree(t,e);return e}}_i.defaults=Object.assign(Object.assign({},ji.defaults),{mathvariant:"normal",mathsize:Ii});class Fi extends ji{get isSpacelike(){return this.childNodes[0].isSpacelike}get isEmbellished(){return this.childNodes[0].isEmbellished}get arity(){return-1}core(){return this.childNodes[0]}coreMO(){return this.childNodes[0].coreMO()}setTeXclass(t){return t=this.childNodes[0].setTeXclass(t),this.updateTeXclass(this.childNodes[0]),t}}Fi.defaults=ji.defaults;class Ui extends ji{get isEmbellished(){return this.childNodes[0].isEmbellished}core(){return this.childNodes[0]}coreMO(){return this.childNodes[0].coreMO()}setTeXclass(t){this.getPrevClass(t),this.texClass=Oi.ORD;const e=this.childNodes[0];let s=null;e&&(this.isEmbellished||e.isKind("mi")?(s=e.setTeXclass(t),this.updateTeXclass(this.core())):(e.setTeXclass(null),e.isKind("TeXAtom")&&(this.texClass=e.texClass)));for(const t of this.childNodes.slice(1))t&&t.setTeXclass(null);return s||this}}Ui.defaults=ji.defaults;class Hi extends wi{get isToken(){return!1}get isEmpty(){return!0}get isEmbellished(){return!1}get isSpacelike(){return!1}get linebreakContainer(){return!1}get linebreakAlign(){return""}get arity(){return 0}get isInferred(){return!1}get notParent(){return!1}get Parent(){return this.parent}get texClass(){return Oi.NONE}get prevClass(){return Oi.NONE}get prevLevel(){return 0}hasSpacingAttributes(){return!1}get attributes(){return null}core(){return this}coreMO(){return this}coreIndex(){return 0}childPosition(){return 0}setTeXclass(t){return t}texSpacing(){return""}setInheritedAttributes(t,e,s,i){}inheritAttributesFrom(t){}verifyTree(t){}mError(t,e,s=!1){return null}}class Wi extends Hi{constructor(){super(...arguments),this.text=""}get kind(){return"text"}getText(){return this.text}setText(t){return this.text=t,this}copy(){return this.factory.create(this.kind).setText(this.getText())}toString(){return this.text}}class Vi extends Hi{constructor(){super(...arguments),this.xml=null,this.adaptor=null}get kind(){return"XML"}getXML(){return this.xml}setXML(t,e=null){return this.xml=t,this.adaptor=e,this}getSerializedXML(){return this.adaptor.serializeXML(this.xml)}copy(){return this.factory.create(this.kind).setXML(this.adaptor.clone(this.xml))}toString(){return"XML data"}}class qi extends Fi{get kind(){return"math"}get linebreakContainer(){return!0}get linebreakAlign(){return""}setChildInheritedAttributes(t,e,s,i){"display"===this.attributes.get("mode")&&this.attributes.setInherited("display","block"),t=this.addInheritedAttributes(t,this.attributes.getAllAttributes()),e=!!this.attributes.get("displaystyle")||!this.attributes.get("displaystyle")&&"block"===this.attributes.get("display"),this.attributes.setInherited("displaystyle",e),s=this.attributes.get("scriptlevel")||this.constructor.defaults.scriptlevel,super.setChildInheritedAttributes(t,e,s,i)}verifyTree(t=null){super.verifyTree(t),this.parent&&this.mError("Improper nesting of math tags",t,!0)}}qi.defaults=Object.assign(Object.assign({},Fi.defaults),{mathvariant:"normal",mathsize:"normal",mathcolor:"",mathbackground:"transparent",dir:"ltr",scriptlevel:0,displaystyle:!1,display:"inline",maxwidth:"",overflow:"linebreak",altimg:"","altimg-width":"","altimg-height":"","altimg-valign":"",alttext:"",cdgroup:"",scriptsizemultiplier:1/Math.sqrt(2),scriptminsize:".4em",infixlinebreakstyle:"before",lineleading:"100%",linebreakmultchar:"\u2062",indentshift:"auto",indentalign:"auto",indenttarget:"",indentalignfirst:"indentalign",indentshiftfirst:"indentshift",indentalignlast:"indentalign",indentshiftlast:"indentshift"});class Xi extends _i{constructor(){super(...arguments),this.texclass=Oi.ORD}get kind(){return"mi"}setInheritedAttributes(t={},e=!1,s=0,i=!1){super.setInheritedAttributes(t,e,s,i);this.getText().match(Xi.singleCharacter)&&!t.mathvariant&&this.attributes.setInherited("mathvariant","italic")}setTeXclass(t){this.getPrevClass(t);const e=this.getText();return e.length>1&&e.match(Xi.operatorName)&&"normal"===this.attributes.get("mathvariant")&&void 0===this.getProperty("autoOP")&&void 0===this.getProperty("texClass")&&(this.texClass=Oi.OP,this.setProperty("autoOP",!0)),this}}Xi.defaults=Object.assign({},_i.defaults),Xi.operatorName=/^[a-z][a-z0-9]*$/i,Xi.singleCharacter=/^[\uD800-\uDBFF]?.[\u0300-\u036F\u1AB0-\u1ABE\u1DC0-\u1DFF\u20D0-\u20EF]*$/;class zi extends _i{constructor(){super(...arguments),this.texclass=Oi.ORD}get kind(){return"mn"}}function Gi(t,e,s=Oi.BIN,i=null){return[t,e,s,i]}zi.defaults=Object.assign({},_i.defaults);const Ji={REL:Gi(5,5,Oi.REL),WIDEREL:Gi(5,5,Oi.REL,{accent:!0,stretchy:!0}),BIN4:Gi(4,4,Oi.BIN),RELSTRETCH:Gi(5,5,Oi.REL,{stretchy:!0}),ORD:Gi(0,0,Oi.ORD),BIN3:Gi(3,3,Oi.BIN),OPEN:Gi(0,0,Oi.OPEN,{fence:!0,stretchy:!0,symmetric:!0}),CLOSE:Gi(0,0,Oi.CLOSE,{fence:!0,stretchy:!0,symmetric:!0}),INTEGRAL:Gi(3,3,Oi.OP,{largeop:!0,symmetric:!0}),ACCENT:Gi(0,0,Oi.ORD,{accent:!0}),WIDEACCENT:Gi(0,0,Oi.ORD,{accent:!0,stretchy:!0}),OP:Gi(3,3,Oi.OP,{largeop:!0,movablelimits:!0,symmetric:!0}),RELACCENT:Gi(5,5,Oi.REL,{accent:!0}),BIN0:Gi(0,0,Oi.BIN),BIN5:Gi(5,5,Oi.BIN),FENCE:Gi(0,0,Oi.ORD,{fence:!0,stretchy:!0,symmetric:!0}),INNER:Gi(1,1,Oi.INNER),ORD30:Gi(3,0,Oi.ORD),NONE:Gi(0,0,Oi.NONE),ORDSTRETCH0:Gi(0,0,Oi.ORD,{stretchy:!0}),BINSTRETCH0:Gi(0,0,Oi.BIN,{stretchy:!0}),RELSTRETCH0:Gi(0,0,Oi.REL,{stretchy:!0}),CLOSE0:Gi(0,0,Oi.CLOSE,{fence:!0}),ORD3:Gi(3,3,Oi.ORD),PUNCT03:Gi(0,3,Oi.PUNCT,{linebreakstyle:"after"}),OPEN0:Gi(0,0,Oi.OPEN,{fence:!0}),STRETCH4:Gi(4,4,Oi.BIN,{stretchy:!0})},Ki=[[32,127,Oi.REL,"mo"],[160,191,Oi.ORD,"mo"],[192,591,Oi.ORD,"mi"],[688,879,Oi.ORD,"mo"],[880,6688,Oi.ORD,"mi"],[6832,6911,Oi.ORD,"mo"],[6912,7615,Oi.ORD,"mi"],[7616,7679,Oi.ORD,"mo"],[7680,8191,Oi.ORD,"mi"],[8192,8303,Oi.ORD,"mo"],[8304,8351,Oi.ORD,"mo"],[8448,8527,Oi.ORD,"mi"],[8528,8591,Oi.ORD,"mn"],[8592,8703,Oi.REL,"mo"],[8704,8959,Oi.BIN,"mo"],[8960,9215,Oi.ORD,"mo"],[9312,9471,Oi.ORD,"mn"],[9472,10223,Oi.ORD,"mo"],[10224,10239,Oi.REL,"mo"],[10240,10495,Oi.ORD,"mtext"],[10496,10623,Oi.REL,"mo"],[10624,10751,Oi.ORD,"mo"],[10752,11007,Oi.BIN,"mo"],[11008,11055,Oi.ORD,"mo"],[11056,11087,Oi.REL,"mo"],[11088,11263,Oi.ORD,"mo"],[11264,11744,Oi.ORD,"mi"],[11776,11903,Oi.ORD,"mo"],[11904,12255,Oi.ORD,"mi","normal"],[12272,12351,Oi.ORD,"mo"],[12352,42143,Oi.ORD,"mi","normal"],[42192,43055,Oi.ORD,"mi"],[43056,43071,Oi.ORD,"mn"],[43072,55295,Oi.ORD,"mi"],[63744,64255,Oi.ORD,"mi","normal"],[64256,65023,Oi.ORD,"mi"],[65024,65135,Oi.ORD,"mo"],[65136,65791,Oi.ORD,"mi"],[65792,65935,Oi.ORD,"mn"],[65936,74751,Oi.ORD,"mi","normal"],[74752,74879,Oi.ORD,"mn"],[74880,113823,Oi.ORD,"mi","normal"],[113824,119391,Oi.ORD,"mo"],[119648,119679,Oi.ORD,"mn"],[119808,120781,Oi.ORD,"mi"],[120782,120831,Oi.ORD,"mn"],[122624,129023,Oi.ORD,"mo"],[129024,129279,Oi.REL,"mo"],[129280,129535,Oi.ORD,"mo"],[131072,195103,Oi.ORD,"mi","normal"]];function $i(t){const e=Qi.infix[t]||Qi.prefix[t]||Qi.postfix[t];if(e)return[0,0,e[2],"mo"];const s=t.codePointAt(0);for(const t of Ki)if(s<=t[1]){if(s>=t[0])return t;break}return[0,0,Oi.REL,"mo"]}const Yi=[[0,0],[1,2],[3,3],[4,4],[0,0],[0,0],[0,3],[1,1]],Qi={prefix:{"!":Ji.ORD,"(":Ji.OPEN,"+":Ji.BIN0,"-":Ji.BIN0,"[":Ji.OPEN,"{":Ji.OPEN,"|":Ji.OPEN,"||":Ji.BIN0,"\xac":Ji.ORD,"\xb1":Ji.BIN0,"\u2016":Ji.FENCE,"\u2018":Ji.OPEN0,"\u201c":Ji.OPEN0,\u2145:Ji.ORD30,\u2146:Ji.ORD30,"\u2200":Ji.ORD,"\u2201":Ji.ORD,"\u2202":Ji.ORD30,"\u2203":Ji.ORD,"\u2204":Ji.ORD,"\u2207":Ji.ORD,"\u220f":Ji.OP,"\u2210":Ji.OP,"\u2211":Ji.OP,"\u2212":Ji.BIN0,"\u2213":Ji.BIN0,"\u221a":[3,0,Oi.ORD,{stretchy:!0}],"\u221b":Ji.ORD30,"\u221c":Ji.ORD30,"\u221f":Ji.ORD,"\u2220":Ji.ORD,"\u2221":Ji.ORD,"\u2222":Ji.ORD,"\u222b":Ji.INTEGRAL,"\u222c":Ji.INTEGRAL,"\u222d":Ji.INTEGRAL,"\u222e":Ji.INTEGRAL,"\u222f":Ji.INTEGRAL,"\u2230":Ji.INTEGRAL,"\u2231":Ji.INTEGRAL,"\u2232":Ji.INTEGRAL,"\u2233":Ji.INTEGRAL,"\u2234":Ji.REL,"\u2235":Ji.REL,"\u223c":[0,0,Oi.REL,{}],"\u22be":Ji.ORD,"\u22bf":Ji.ORD,"\u22c0":Ji.OP,"\u22c1":Ji.OP,"\u22c2":Ji.OP,"\u22c3":Ji.OP,"\u2308":Ji.OPEN,"\u230a":Ji.OPEN,"\u2310":Ji.ORD,"\u2319":Ji.ORD,"\u2772":Ji.OPEN,"\u2795":Ji.ORD,"\u2796":Ji.ORD,"\u27c0":Ji.ORD,"\u27e6":Ji.OPEN,"\u27e8":Ji.OPEN,"\u27ea":Ji.OPEN,"\u27ec":Ji.OPEN,"\u27ee":Ji.OPEN,"\u2980":Ji.FENCE,"\u2983":Ji.OPEN,"\u2985":Ji.OPEN,"\u2987":Ji.OPEN,"\u2989":Ji.OPEN,"\u298b":Ji.OPEN,"\u298d":Ji.OPEN,"\u298f":Ji.OPEN,"\u2991":Ji.OPEN,"\u2993":Ji.OPEN,"\u2995":Ji.OPEN,"\u2997":Ji.OPEN,"\u2999":Ji.FENCE,"\u299b":Ji.ORD,"\u299c":Ji.ORD,"\u299d":Ji.ORD,"\u299e":Ji.ORD,"\u299f":Ji.ORD,"\u29a0":Ji.ORD,"\u29a1":Ji.ORD,"\u29a2":Ji.ORD,"\u29a3":Ji.ORD,"\u29a4":Ji.ORD,"\u29a5":Ji.ORD,"\u29a6":Ji.ORD,"\u29a7":Ji.ORD,"\u29a8":Ji.ORD,"\u29a9":Ji.ORD,"\u29aa":Ji.ORD,"\u29ab":Ji.ORD,"\u29ac":Ji.ORD,"\u29ad":Ji.ORD,"\u29ae":Ji.ORD,"\u29af":Ji.ORD,"\u29d8":Ji.OPEN,"\u29da":Ji.OPEN,"\u29fc":Ji.OPEN,"\u2a00":Ji.OP,"\u2a01":Ji.OP,"\u2a02":Ji.OP,"\u2a03":Ji.OP,"\u2a04":Ji.OP,"\u2a05":Ji.OP,"\u2a06":Ji.OP,"\u2a07":Ji.OP,"\u2a08":Ji.OP,"\u2a09":Ji.OP,"\u2a0a":Ji.OP,"\u2a0b":Ji.INTEGRAL,"\u2a0c":Ji.INTEGRAL,"\u2a0d":Ji.INTEGRAL,"\u2a0e":Ji.INTEGRAL,"\u2a0f":Ji.INTEGRAL,"\u2a10":Ji.INTEGRAL,"\u2a11":Ji.INTEGRAL,"\u2a12":Ji.INTEGRAL,"\u2a13":Ji.INTEGRAL,"\u2a14":Ji.INTEGRAL,"\u2a15":Ji.INTEGRAL,"\u2a16":Ji.INTEGRAL,"\u2a17":Ji.INTEGRAL,"\u2a18":Ji.INTEGRAL,"\u2a19":Ji.INTEGRAL,"\u2a1a":Ji.INTEGRAL,"\u2a1b":Ji.INTEGRAL,"\u2a1c":Ji.INTEGRAL,"\u2a1d":Ji.OP,"\u2a1e":Ji.OP,"\u2aec":Ji.ORD,"\u2aed":Ji.ORD,"\u2afc":Ji.OP,"\u2aff":Ji.OP,"\u3008":Ji.OPEN},postfix:{"!!":Ji.BIN0,"!":Ji.CLOSE0,'"':Ji.ORD,"%":Ji.ORD,"&":Ji.ORD,"'":Ji.ACCENT,")":Ji.CLOSE,"++":Ji.BIN0,"--":Ji.BIN0,"]":Ji.CLOSE,"^":Ji.WIDEACCENT,_:Ji.WIDEACCENT,"`":Ji.ACCENT,"|":Ji.CLOSE,"||":Ji.BIN0,"}":Ji.CLOSE,"~":Ji.WIDEACCENT,"\xa8":Ji.ACCENT,"\xaf":Ji.WIDEACCENT,"\xb0":Ji.ACCENT,"\xb2":Ji.ORD,"\xb3":Ji.ORD,"\xb4":Ji.ACCENT,"\xb8":Ji.ACCENT,"\xb9":Ji.ORD,\u02c6:Ji.WIDEACCENT,\u02c7:Ji.WIDEACCENT,\u02c9:Ji.WIDEACCENT,\u02ca:Ji.ACCENT,\u02cb:Ji.ACCENT,\u02cd:Ji.WIDEACCENT,"\u02d8":Ji.ACCENT,"\u02d9":Ji.ACCENT,"\u02da":Ji.ACCENT,"\u02dc":Ji.WIDEACCENT,"\u02dd":Ji.ACCENT,"\u02f7":Ji.WIDEACCENT,"\u0302":Ji.WIDEACCENT,"\u0311":Ji.ACCENT,"\u2016":Ji.FENCE,"\u2019":Ji.CLOSE0,"\u201a":Ji.ORD,"\u201b":Ji.ORD,"\u201d":Ji.CLOSE0,"\u201e":Ji.ORD,"\u201f":Ji.ORD,"\u2032":Ji.ORD,"\u2033":Ji.ORD,"\u2034":Ji.ORD,"\u2035":Ji.ORD,"\u2036":Ji.ORD,"\u2037":Ji.ORD,"\u203e":Ji.WIDEACCENT,"\u2057":Ji.ORD,"\u20db":Ji.ACCENT,"\u20dc":Ji.ACCENT,"\u2309":Ji.CLOSE,"\u230b":Ji.CLOSE,"\u2322":Ji.RELSTRETCH0,"\u2323":Ji.RELSTRETCH0,"\u23b4":Ji.WIDEACCENT,"\u23b5":Ji.WIDEACCENT,"\u23cd":Ji.ORD,"\u23dc":Ji.WIDEACCENT,"\u23dd":Ji.WIDEACCENT,"\u23de":Ji.WIDEACCENT,"\u23df":Ji.WIDEACCENT,"\u23e0":Ji.WIDEACCENT,"\u23e1":Ji.WIDEACCENT,"\u2773":Ji.CLOSE,"\u27e7":Ji.CLOSE,"\u27e9":Ji.CLOSE,"\u27eb":Ji.CLOSE,"\u27ed":Ji.CLOSE,"\u27ef":Ji.CLOSE,"\u2980":Ji.FENCE,"\u2984":Ji.CLOSE,"\u2986":Ji.CLOSE,"\u2988":Ji.CLOSE,"\u298a":Ji.CLOSE,"\u298c":Ji.CLOSE,"\u298e":Ji.CLOSE,"\u2990":Ji.CLOSE,"\u2992":Ji.CLOSE,"\u2994":Ji.CLOSE,"\u2996":Ji.CLOSE,"\u2998":Ji.CLOSE,"\u2999":Ji.FENCE,"\u29d9":Ji.CLOSE,"\u29db":Ji.CLOSE,"\u29fd":Ji.CLOSE,"\u3009":Ji.CLOSE,"\u{1eef0}":Ji.BINSTRETCH0,"\u{1eef1}":Ji.BINSTRETCH0},infix:{"!":Ji.ORD,"!=":Ji.BIN5,"#":Ji.ORD,$:Ji.ORD,"%":Ji.ORD3,"&&":Ji.BIN4,"**":Ji.BIN3,"*":Ji.BIN3,"*=":Ji.BIN5,"+":Ji.BIN4,"+=":Ji.BIN5,",":Ji.PUNCT03,"":Ji.ORD,"-":Ji.BIN4,"-=":Ji.BIN5,"->":Ji.BIN5,".":Ji.ORD3,"..":Ji.BIN3,"...":Ji.INNER,"/":[4,4,Oi.ORD,{}],"//":Ji.BIN5,"/=":Ji.BIN5,":":[0,3,Oi.REL,{}],":=":Ji.BIN5,";":Ji.PUNCT03,"<":Ji.REL,"<=":Ji.REL,"<>":[3,3,Oi.REL,{}],"=":Ji.REL,"==":Ji.REL,">":Ji.REL,">=":Ji.REL,"?":[3,3,Oi.CLOSE,{fence:!0}],"@":Ji.ORD3,"\\":Ji.ORD,"^":[3,3,Oi.ORD,{accent:!0,stretchy:!0}],_:Ji.WIDEACCENT,"|":[5,5,Oi.ORD,{}],"||":Ji.BIN5,"\xb1":Ji.BIN4,"\xb7":Ji.BIN3,"\xd7":Ji.BIN3,"\xf7":Ji.BIN4,\u02b9:Ji.ORD,"\u0300":Ji.ACCENT,"\u0301":Ji.ACCENT,"\u0303":Ji.WIDEACCENT,"\u0304":Ji.ACCENT,"\u0306":Ji.ACCENT,"\u0307":Ji.ACCENT,"\u0308":Ji.ACCENT,"\u030c":Ji.ACCENT,"\u0332":Ji.WIDEACCENT,"\u0338":Ji.REL,"\u03f6":Ji.REL,"\u2015":Ji.ORDSTRETCH0,"\u2017":Ji.ORDSTRETCH0,"\u2020":Ji.BIN3,"\u2021":Ji.BIN3,"\u2022":Ji.BIN3,"\u2026":Ji.INNER,"\u2043":Ji.BIN3,"\u2044":Ji.STRETCH4,"\u2061":Ji.NONE,"\u2062":Ji.NONE,"\u2063":[0,0,Oi.NONE,{linebreakstyle:"after"}],"\u2064":Ji.NONE,"\u20d7":Ji.ACCENT,\u2111:Ji.ORD,\u2113:Ji.ORD,\u2118:Ji.ORD,\u211c:Ji.ORD,"\u2190":Ji.WIDEREL,"\u2191":Ji.RELSTRETCH,"\u2192":Ji.WIDEREL,"\u2193":Ji.RELSTRETCH,"\u2194":Ji.WIDEREL,"\u2195":Ji.RELSTRETCH,"\u2196":Ji.REL,"\u2197":Ji.REL,"\u2198":Ji.REL,"\u2199":Ji.REL,"\u219a":Ji.WIDEREL,"\u219b":Ji.WIDEREL,"\u219c":Ji.WIDEREL,"\u219d":Ji.WIDEREL,"\u219e":Ji.WIDEREL,"\u219f":Ji.RELSTRETCH,"\u21a0":Ji.WIDEREL,"\u21a1":Ji.RELSTRETCH,"\u21a2":Ji.WIDEREL,"\u21a3":Ji.WIDEREL,"\u21a4":Ji.WIDEREL,"\u21a5":Ji.RELSTRETCH,"\u21a6":Ji.WIDEREL,"\u21a7":Ji.RELSTRETCH,"\u21a8":Ji.RELSTRETCH,"\u21a9":Ji.WIDEREL,"\u21aa":Ji.WIDEREL,"\u21ab":Ji.WIDEREL,"\u21ac":Ji.WIDEREL,"\u21ad":Ji.WIDEREL,"\u21ae":Ji.WIDEREL,"\u21af":Ji.REL,"\u21b0":Ji.RELSTRETCH,"\u21b1":Ji.RELSTRETCH,"\u21b2":Ji.RELSTRETCH,"\u21b3":Ji.RELSTRETCH,"\u21b4":Ji.RELSTRETCH,"\u21b5":Ji.RELSTRETCH,"\u21b6":Ji.REL,"\u21b7":Ji.REL,"\u21b8":Ji.REL,"\u21b9":Ji.WIDEREL,"\u21ba":Ji.REL,"\u21bb":Ji.REL,"\u21bc":Ji.WIDEREL,"\u21bd":Ji.WIDEREL,"\u21be":Ji.RELSTRETCH,"\u21bf":Ji.RELSTRETCH,"\u21c0":Ji.WIDEREL,"\u21c1":Ji.WIDEREL,"\u21c2":Ji.RELSTRETCH,"\u21c3":Ji.RELSTRETCH,"\u21c4":Ji.WIDEREL,"\u21c5":Ji.RELSTRETCH,"\u21c6":Ji.WIDEREL,"\u21c7":Ji.WIDEREL,"\u21c8":Ji.RELSTRETCH,"\u21c9":Ji.WIDEREL,"\u21ca":Ji.RELSTRETCH,"\u21cb":Ji.WIDEREL,"\u21cc":Ji.WIDEREL,"\u21cd":Ji.WIDEREL,"\u21ce":Ji.WIDEREL,"\u21cf":Ji.WIDEREL,"\u21d0":Ji.WIDEREL,"\u21d1":Ji.RELSTRETCH,"\u21d2":Ji.WIDEREL,"\u21d3":Ji.RELSTRETCH,"\u21d4":Ji.WIDEREL,"\u21d5":Ji.RELSTRETCH,"\u21d6":Ji.REL,"\u21d7":Ji.REL,"\u21d8":Ji.REL,"\u21d9":Ji.REL,"\u21da":Ji.WIDEREL,"\u21db":Ji.WIDEREL,"\u21dc":Ji.WIDEREL,"\u21dd":Ji.WIDEREL,"\u21de":Ji.RELSTRETCH,"\u21df":Ji.RELSTRETCH,"\u21e0":Ji.WIDEREL,"\u21e1":Ji.RELSTRETCH,"\u21e2":Ji.WIDEREL,"\u21e3":Ji.RELSTRETCH,"\u21e4":Ji.WIDEREL,"\u21e5":Ji.WIDEREL,"\u21e6":Ji.WIDEREL,"\u21e7":Ji.RELSTRETCH,"\u21e8":Ji.WIDEREL,"\u21e9":Ji.RELSTRETCH,"\u21ea":Ji.RELSTRETCH,"\u21eb":Ji.RELSTRETCH,"\u21ec":Ji.RELSTRETCH,"\u21ed":Ji.RELSTRETCH,"\u21ee":Ji.RELSTRETCH,"\u21ef":Ji.RELSTRETCH,"\u21f0":Ji.WIDEREL,"\u21f1":Ji.REL,"\u21f2":Ji.REL,"\u21f3":Ji.RELSTRETCH,"\u21f4":Ji.WIDEREL,"\u21f5":Ji.RELSTRETCH,"\u21f6":Ji.WIDEREL,"\u21f7":Ji.WIDEREL,"\u21f8":Ji.WIDEREL,"\u21f9":Ji.WIDEREL,"\u21fa":Ji.WIDEREL,"\u21fb":Ji.WIDEREL,"\u21fc":Ji.WIDEREL,"\u21fd":Ji.WIDEREL,"\u21fe":Ji.WIDEREL,"\u21ff":Ji.WIDEREL,"\u2205":Ji.ORD,"\u2206":Ji.ORD,"\u2208":Ji.REL,"\u2209":Ji.REL,"\u220a":Ji.REL,"\u220b":Ji.REL,"\u220c":Ji.REL,"\u220d":Ji.REL,"\u2212":Ji.BIN4,"\u2213":Ji.BIN4,"\u2214":Ji.BIN4,"\u2215":Ji.STRETCH4,"\u2216":Ji.BIN4,"\u2217":Ji.BIN3,"\u2218":Ji.BIN3,"\u2219":Ji.BIN3,"\u221d":Ji.REL,"\u221e":Ji.ORD,"\u2223":Ji.REL,"\u2224":Ji.REL,"\u2225":Ji.REL,"\u2226":Ji.REL,"\u2227":Ji.BIN4,"\u2228":Ji.BIN4,"\u2229":Ji.BIN4,"\u222a":Ji.BIN4,"\u2236":Ji.BIN4,"\u2237":Ji.REL,"\u2238":Ji.BIN4,"\u2239":Ji.REL,"\u223a":Ji.REL,"\u223b":Ji.REL,"\u223c":Ji.REL,"\u223d":Ji.REL,"\u223e":Ji.REL,"\u2240":Ji.BIN3,"\u2241":Ji.REL,"\u2242":Ji.REL,"\u2242\u0338":Ji.REL,"\u2243":Ji.REL,"\u2244":Ji.REL,"\u2245":Ji.REL,"\u2246":Ji.REL,"\u2247":Ji.REL,"\u2248":Ji.REL,"\u2249":Ji.REL,"\u224a":Ji.REL,"\u224b":Ji.REL,"\u224c":Ji.REL,"\u224d":Ji.REL,"\u224e":Ji.REL,"\u224f":Ji.REL,"\u2250":Ji.REL,"\u2251":Ji.REL,"\u2252":Ji.REL,"\u2253":Ji.REL,"\u2254":Ji.REL,"\u2255":Ji.REL,"\u2256":Ji.REL,"\u2257":Ji.REL,"\u2258":Ji.REL,"\u2259":Ji.REL,"\u225a":Ji.REL,"\u225b":Ji.REL,"\u225c":Ji.REL,"\u225d":Ji.REL,"\u225e":Ji.REL,"\u225f":Ji.REL,"\u2260":Ji.REL,"\u2261":Ji.REL,"\u2262":Ji.REL,"\u2263":Ji.REL,"\u2264":Ji.REL,"\u2265":Ji.REL,"\u2266":Ji.REL,"\u2266\u0338":Ji.REL,"\u2267":Ji.REL,"\u2267\u0338":Ji.REL,"\u2268":Ji.REL,"\u2269":Ji.REL,"\u226a":Ji.REL,"\u226a\u0338":Ji.REL,"\u226b":Ji.REL,"\u226b\u0338":Ji.REL,"\u226c":Ji.REL,"\u226d":Ji.REL,"\u226e":Ji.REL,"\u226f":Ji.REL,"\u2270":Ji.REL,"\u2271":Ji.REL,"\u2272":Ji.REL,"\u2273":Ji.REL,"\u2274":Ji.REL,"\u2275":Ji.REL,"\u2276":Ji.REL,"\u2277":Ji.REL,"\u2278":Ji.REL,"\u2279":Ji.REL,"\u227a":Ji.REL,"\u227b":Ji.REL,"\u227c":Ji.REL,"\u227d":Ji.REL,"\u227e":Ji.REL,"\u227e\u0338":Ji.REL,"\u227f":Ji.REL,"\u227f\u0338":Ji.REL,"\u2280":Ji.REL,"\u2281":Ji.REL,"\u2282":Ji.REL,"\u2283":Ji.REL,"\u2284":Ji.REL,"\u2285":Ji.REL,"\u2286":Ji.REL,"\u2287":Ji.REL,"\u2288":Ji.REL,"\u2289":Ji.REL,"\u228a":Ji.REL,"\u228b":Ji.REL,"\u228c":Ji.BIN4,"\u228d":Ji.BIN4,"\u228e":Ji.BIN4,"\u228f":Ji.REL,"\u228f\u0338":Ji.REL,"\u2290":Ji.REL,"\u2290\u0338":Ji.REL,"\u2291":Ji.REL,"\u2292":Ji.REL,"\u2293":Ji.BIN4,"\u2294":Ji.BIN4,"\u2295":Ji.BIN4,"\u2296":Ji.BIN4,"\u2297":Ji.BIN3,"\u2298":Ji.BIN4,"\u2299":Ji.BIN3,"\u229a":Ji.BIN3,"\u229b":Ji.BIN3,"\u229c":Ji.REL,"\u229d":Ji.BIN4,"\u229e":Ji.BIN4,"\u229f":Ji.BIN4,"\u22a0":Ji.BIN3,"\u22a1":Ji.BIN3,"\u22a2":Ji.REL,"\u22a3":Ji.REL,"\u22a4":Ji.ORD,"\u22a5":Ji.ORD,"\u22a6":Ji.REL,"\u22a7":Ji.REL,"\u22a8":Ji.REL,"\u22a9":Ji.REL,"\u22aa":Ji.REL,"\u22ab":Ji.REL,"\u22ac":Ji.REL,"\u22ad":Ji.REL,"\u22ae":Ji.REL,"\u22af":Ji.REL,"\u22b0":Ji.REL,"\u22b1":Ji.REL,"\u22b2":Ji.REL,"\u22b3":Ji.REL,"\u22b4":Ji.REL,"\u22b5":Ji.REL,"\u22b6":Ji.REL,"\u22b7":Ji.REL,"\u22b8":Ji.REL,"\u22ba":Ji.BIN3,"\u22bb":Ji.BIN4,"\u22bc":Ji.BIN4,"\u22bd":Ji.BIN4,"\u22c4":Ji.BIN3,"\u22c5":Ji.BIN3,"\u22c6":Ji.BIN3,"\u22c7":Ji.BIN3,"\u22c8":Ji.REL,"\u22c9":Ji.BIN3,"\u22ca":Ji.BIN3,"\u22cb":Ji.BIN3,"\u22cc":Ji.BIN3,"\u22cd":Ji.REL,"\u22ce":Ji.BIN4,"\u22cf":Ji.BIN4,"\u22d0":Ji.REL,"\u22d1":Ji.REL,"\u22d2":Ji.BIN4,"\u22d3":Ji.BIN4,"\u22d4":Ji.REL,"\u22d5":Ji.REL,"\u22d6":Ji.REL,"\u22d7":Ji.REL,"\u22d8":Ji.REL,"\u22d9":Ji.REL,"\u22da":Ji.REL,"\u22db":Ji.REL,"\u22dc":Ji.REL,"\u22dd":Ji.REL,"\u22de":Ji.REL,"\u22df":Ji.REL,"\u22e0":Ji.REL,"\u22e1":Ji.REL,"\u22e2":Ji.REL,"\u22e3":Ji.REL,"\u22e4":Ji.REL,"\u22e5":Ji.REL,"\u22e6":Ji.REL,"\u22e7":Ji.REL,"\u22e8":Ji.REL,"\u22e9":Ji.REL,"\u22ea":Ji.REL,"\u22eb":Ji.REL,"\u22ec":Ji.REL,"\u22ed":Ji.REL,"\u22ee":Ji.ORD,"\u22ef":Ji.INNER,"\u22f0":Ji.INNER,"\u22f1":Ji.INNER,"\u22f2":Ji.REL,"\u22f3":Ji.REL,"\u22f4":Ji.REL,"\u22f5":Ji.REL,"\u22f6":Ji.REL,"\u22f7":Ji.REL,"\u22f8":Ji.REL,"\u22f9":Ji.REL,"\u22fa":Ji.REL,"\u22fb":Ji.REL,"\u22fc":Ji.REL,"\u22fd":Ji.REL,"\u22fe":Ji.REL,"\u22ff":Ji.REL,"\u2301":Ji.REL,"\u2305":Ji.BIN3,"\u2306":Ji.BIN3,"\u2329":Ji.OPEN,"\u232a":Ji.CLOSE,"\u237c":Ji.REL,"\u238b":Ji.REL,"\u23aa":Ji.ORD,"\u23af":Ji.ORDSTRETCH0,"\u23b0":Ji.OPEN,"\u23b1":Ji.CLOSE,"\u2500":Ji.ORD,"\u25b3":Ji.BIN3,"\u25b5":Ji.BIN3,"\u25b9":Ji.BIN3,"\u25bd":Ji.BIN3,"\u25bf":Ji.BIN3,"\u25c3":Ji.BIN3,"\u25ef":Ji.BIN3,"\u2660":Ji.ORD,"\u2661":Ji.ORD,"\u2662":Ji.ORD,"\u2663":Ji.ORD,"\u266d":Ji.ORD,"\u266e":Ji.ORD,"\u266f":Ji.ORD,"\u2758":[5,5,Oi.REL,{stretchy:!0,symmetric:!0}],"\u2794":Ji.WIDEREL,"\u2795":Ji.BIN4,"\u2796":Ji.BIN4,"\u2797":Ji.BIN4,"\u2798":Ji.REL,"\u2799":Ji.WIDEREL,"\u279a":Ji.REL,"\u279b":Ji.WIDEREL,"\u279c":Ji.WIDEREL,"\u279d":Ji.WIDEREL,"\u279e":Ji.WIDEREL,"\u279f":Ji.WIDEREL,"\u27a0":Ji.WIDEREL,"\u27a1":Ji.WIDEREL,"\u27a5":Ji.WIDEREL,"\u27a6":Ji.WIDEREL,"\u27a7":Ji.RELACCENT,"\u27a8":Ji.WIDEREL,"\u27a9":Ji.WIDEREL,"\u27aa":Ji.WIDEREL,"\u27ab":Ji.WIDEREL,"\u27ac":Ji.WIDEREL,"\u27ad":Ji.WIDEREL,"\u27ae":Ji.WIDEREL,"\u27af":Ji.WIDEREL,"\u27b1":Ji.WIDEREL,"\u27b2":Ji.RELACCENT,"\u27b3":Ji.WIDEREL,"\u27b4":Ji.REL,"\u27b5":Ji.WIDEREL,"\u27b6":Ji.REL,"\u27b7":Ji.REL,"\u27b8":Ji.WIDEREL,"\u27b9":Ji.REL,"\u27ba":Ji.WIDEREL,"\u27bb":Ji.WIDEREL,"\u27bc":Ji.WIDEREL,"\u27bd":Ji.WIDEREL,"\u27be":Ji.WIDEREL,"\u27c2":Ji.REL,"\u27c2\u0338":Ji.REL,"\u27cb":Ji.BIN3,"\u27cd":Ji.BIN3,"\u27f0":Ji.RELSTRETCH,"\u27f1":Ji.RELSTRETCH,"\u27f2":Ji.REL,"\u27f3":Ji.REL,"\u27f4":Ji.RELSTRETCH,"\u27f5":Ji.WIDEREL,"\u27f6":Ji.WIDEREL,"\u27f7":Ji.WIDEREL,"\u27f8":Ji.WIDEREL,"\u27f9":Ji.WIDEREL,"\u27fa":Ji.WIDEREL,"\u27fb":Ji.WIDEREL,"\u27fc":Ji.WIDEREL,"\u27fd":Ji.WIDEREL,"\u27fe":Ji.WIDEREL,"\u27ff":Ji.WIDEREL,"\u2900":Ji.WIDEREL,"\u2901":Ji.WIDEREL,"\u2902":Ji.WIDEREL,"\u2903":Ji.WIDEREL,"\u2904":Ji.WIDEREL,"\u2905":Ji.WIDEREL,"\u2906":Ji.WIDEREL,"\u2907":Ji.WIDEREL,"\u2908":Ji.RELSTRETCH,"\u2909":Ji.RELSTRETCH,"\u290a":Ji.RELSTRETCH,"\u290b":Ji.RELSTRETCH,"\u290c":Ji.WIDEREL,"\u290d":Ji.WIDEREL,"\u290e":Ji.WIDEREL,"\u290f":Ji.WIDEREL,"\u2910":Ji.WIDEREL,"\u2911":Ji.WIDEREL,"\u2912":Ji.RELSTRETCH,"\u2913":Ji.RELSTRETCH,"\u2914":Ji.WIDEREL,"\u2915":Ji.WIDEREL,"\u2916":Ji.WIDEREL,"\u2917":Ji.WIDEREL,"\u2918":Ji.WIDEREL,"\u2919":Ji.WIDEREL,"\u291a":Ji.WIDEREL,"\u291b":Ji.WIDEREL,"\u291c":Ji.WIDEREL,"\u291d":Ji.WIDEREL,"\u291e":Ji.WIDEREL,"\u291f":Ji.WIDEREL,"\u2920":Ji.WIDEREL,"\u2921":Ji.REL,"\u2922":Ji.REL,"\u2923":Ji.REL,"\u2924":Ji.REL,"\u2925":Ji.REL,"\u2926":Ji.REL,"\u2927":Ji.REL,"\u2928":Ji.REL,"\u2929":Ji.REL,"\u292a":Ji.REL,"\u292b":Ji.REL,"\u292c":Ji.REL,"\u292d":Ji.REL,"\u292e":Ji.REL,"\u292f":Ji.REL,"\u2930":Ji.REL,"\u2931":Ji.REL,"\u2932":Ji.REL,"\u2933":Ji.RELACCENT,"\u2934":Ji.RELSTRETCH,"\u2935":Ji.RELSTRETCH,"\u2936":Ji.RELSTRETCH,"\u2937":Ji.RELSTRETCH,"\u2938":Ji.REL,"\u2939":Ji.REL,"\u293a":Ji.RELACCENT,"\u293b":Ji.RELACCENT,"\u293c":Ji.RELACCENT,"\u293d":Ji.RELACCENT,"\u293e":Ji.REL,"\u293f":Ji.REL,"\u2940":Ji.REL,"\u2941":Ji.REL,"\u2942":Ji.WIDEREL,"\u2943":Ji.WIDEREL,"\u2944":Ji.WIDEREL,"\u2945":Ji.RELSTRETCH,"\u2946":Ji.RELSTRETCH,"\u2947":Ji.WIDEREL,"\u2948":Ji.WIDEREL,"\u2949":Ji.RELSTRETCH,"\u294a":Ji.WIDEREL,"\u294b":Ji.WIDEREL,"\u294c":Ji.RELSTRETCH,"\u294d":Ji.RELSTRETCH,"\u294e":Ji.WIDEREL,"\u294f":Ji.RELSTRETCH,"\u2950":Ji.WIDEREL,"\u2951":Ji.RELSTRETCH,"\u2952":Ji.WIDEREL,"\u2953":Ji.WIDEREL,"\u2954":Ji.RELSTRETCH,"\u2955":Ji.RELSTRETCH,"\u2956":Ji.WIDEREL,"\u2957":Ji.WIDEREL,"\u2958":Ji.RELSTRETCH,"\u2959":Ji.RELSTRETCH,"\u295a":Ji.WIDEREL,"\u295b":Ji.WIDEREL,"\u295c":Ji.RELSTRETCH,"\u295d":Ji.RELSTRETCH,"\u295e":Ji.WIDEREL,"\u295f":Ji.WIDEREL,"\u2960":Ji.RELSTRETCH,"\u2961":Ji.RELSTRETCH,"\u2962":Ji.WIDEREL,"\u2963":Ji.RELSTRETCH,"\u2964":Ji.WIDEREL,"\u2965":Ji.RELSTRETCH,"\u2966":Ji.WIDEREL,"\u2967":Ji.WIDEREL,"\u2968":Ji.WIDEREL,"\u2969":Ji.WIDEREL,"\u296a":Ji.WIDEREL,"\u296b":Ji.WIDEREL,"\u296c":Ji.WIDEREL,"\u296d":Ji.WIDEREL,"\u296e":Ji.RELSTRETCH,"\u296f":Ji.RELSTRETCH,"\u2970":Ji.WIDEREL,"\u2971":Ji.WIDEREL,"\u2972":Ji.WIDEREL,"\u2973":Ji.WIDEREL,"\u2974":Ji.WIDEREL,"\u2975":Ji.WIDEREL,"\u2976":Ji.RELACCENT,"\u2977":Ji.RELACCENT,"\u2978":Ji.RELACCENT,"\u2979":Ji.RELACCENT,"\u297a":Ji.RELACCENT,"\u297b":Ji.RELACCENT,"\u297c":Ji.WIDEREL,"\u297d":Ji.WIDEREL,"\u297e":Ji.RELSTRETCH,"\u297f":Ji.RELSTRETCH,"\u2981":Ji.REL,"\u2982":Ji.REL,"\u29b6":Ji.REL,"\u29b7":Ji.REL,"\u29b8":Ji.BIN4,"\u29b9":Ji.REL,"\u29bc":Ji.BIN4,"\u29c0":Ji.REL,"\u29c1":Ji.REL,"\u29c4":Ji.BIN4,"\u29c5":Ji.BIN4,"\u29c6":Ji.BIN3,"\u29c7":Ji.BIN3,"\u29c8":Ji.BIN3,"\u29ce":Ji.REL,"\u29cf":Ji.REL,"\u29d0":Ji.REL,"\u29d1":Ji.REL,"\u29d2":Ji.REL,"\u29d3":Ji.REL,"\u29d4":Ji.BIN3,"\u29d5":Ji.BIN3,"\u29d6":Ji.BIN3,"\u29d7":Ji.BIN3,"\u29df":Ji.REL,"\u29e1":Ji.REL,"\u29e2":Ji.BIN3,"\u29e3":Ji.REL,"\u29e4":Ji.REL,"\u29e5":Ji.REL,"\u29e6":Ji.REL,"\u29f4":Ji.REL,"\u29f5":Ji.BIN4,"\u29f6":Ji.BIN4,"\u29f7":Ji.BIN4,"\u29f8":Ji.BIN4,"\u29f9":Ji.BIN4,"\u29fa":Ji.BIN4,"\u29fb":Ji.BIN4,"\u2a1d":Ji.BIN3,"\u2a1e":Ji.BIN3,"\u2a1f":Ji.BIN4,"\u2a20":Ji.BIN4,"\u2a21":Ji.BIN4,"\u2a22":Ji.BIN4,"\u2a23":Ji.BIN4,"\u2a24":Ji.BIN4,"\u2a25":Ji.BIN4,"\u2a26":Ji.BIN4,"\u2a27":Ji.BIN4,"\u2a28":Ji.BIN4,"\u2a29":Ji.BIN4,"\u2a2a":Ji.BIN4,"\u2a2b":Ji.BIN4,"\u2a2c":Ji.BIN4,"\u2a2d":Ji.BIN4,"\u2a2e":Ji.BIN4,"\u2a2f":Ji.BIN3,"\u2a30":Ji.BIN3,"\u2a31":Ji.BIN3,"\u2a32":Ji.BIN3,"\u2a33":Ji.BIN3,"\u2a34":Ji.BIN3,"\u2a35":Ji.BIN3,"\u2a36":Ji.BIN3,"\u2a37":Ji.BIN3,"\u2a38":Ji.BIN4,"\u2a39":Ji.BIN4,"\u2a3a":Ji.BIN4,"\u2a3b":Ji.BIN3,"\u2a3c":Ji.BIN3,"\u2a3d":Ji.BIN3,"\u2a3e":Ji.BIN4,"\u2a3f":Ji.BIN3,"\u2a40":Ji.BIN4,"\u2a41":Ji.BIN4,"\u2a42":Ji.BIN4,"\u2a43":Ji.BIN4,"\u2a44":Ji.BIN4,"\u2a45":Ji.BIN4,"\u2a46":Ji.BIN4,"\u2a47":Ji.BIN4,"\u2a48":Ji.BIN4,"\u2a49":Ji.BIN4,"\u2a4a":Ji.BIN4,"\u2a4b":Ji.BIN4,"\u2a4c":Ji.BIN4,"\u2a4d":Ji.BIN4,"\u2a4e":Ji.BIN4,"\u2a4f":Ji.BIN4,"\u2a50":Ji.BIN3,"\u2a51":Ji.BIN4,"\u2a52":Ji.BIN4,"\u2a53":Ji.BIN4,"\u2a54":Ji.BIN4,"\u2a55":Ji.BIN4,"\u2a56":Ji.BIN4,"\u2a57":Ji.BIN4,"\u2a58":Ji.BIN4,"\u2a59":Ji.BIN4,"\u2a5a":Ji.BIN4,"\u2a5b":Ji.BIN4,"\u2a5c":Ji.BIN4,"\u2a5d":Ji.BIN4,"\u2a5e":Ji.BIN4,"\u2a5f":Ji.BIN4,"\u2a60":Ji.BIN4,"\u2a61":Ji.BIN4,"\u2a62":Ji.BIN4,"\u2a63":Ji.BIN4,"\u2a64":Ji.BIN3,"\u2a65":Ji.BIN3,"\u2a66":Ji.REL,"\u2a67":Ji.REL,"\u2a68":Ji.REL,"\u2a69":Ji.REL,"\u2a6a":Ji.REL,"\u2a6b":Ji.REL,"\u2a6c":Ji.REL,"\u2a6d":Ji.REL,"\u2a6e":Ji.REL,"\u2a6f":Ji.REL,"\u2a70":Ji.REL,"\u2a71":Ji.REL,"\u2a72":Ji.REL,"\u2a73":Ji.REL,"\u2a74":Ji.REL,"\u2a75":Ji.REL,"\u2a76":Ji.REL,"\u2a77":Ji.REL,"\u2a78":Ji.REL,"\u2a79":Ji.REL,"\u2a7a":Ji.REL,"\u2a7b":Ji.REL,"\u2a7c":Ji.REL,"\u2a7d":Ji.REL,"\u2a7d\u0338":Ji.REL,"\u2a7e":Ji.REL,"\u2a7e\u0338":Ji.REL,"\u2a7f":Ji.REL,"\u2a80":Ji.REL,"\u2a81":Ji.REL,"\u2a82":Ji.REL,"\u2a83":Ji.REL,"\u2a84":Ji.REL,"\u2a85":Ji.REL,"\u2a86":Ji.REL,"\u2a87":Ji.REL,"\u2a88":Ji.REL,"\u2a89":Ji.REL,"\u2a8a":Ji.REL,"\u2a8b":Ji.REL,"\u2a8c":Ji.REL,"\u2a8d":Ji.REL,"\u2a8e":Ji.REL,"\u2a8f":Ji.REL,"\u2a90":Ji.REL,"\u2a91":Ji.REL,"\u2a92":Ji.REL,"\u2a93":Ji.REL,"\u2a94":Ji.REL,"\u2a95":Ji.REL,"\u2a96":Ji.REL,"\u2a97":Ji.REL,"\u2a98":Ji.REL,"\u2a99":Ji.REL,"\u2a9a":Ji.REL,"\u2a9b":Ji.REL,"\u2a9c":Ji.REL,"\u2a9d":Ji.REL,"\u2a9e":Ji.REL,"\u2a9f":Ji.REL,"\u2aa0":Ji.REL,"\u2aa1":Ji.REL,"\u2aa2":Ji.REL,"\u2aa3":Ji.REL,"\u2aa4":Ji.REL,"\u2aa5":Ji.REL,"\u2aa6":Ji.REL,"\u2aa7":Ji.REL,"\u2aa8":Ji.REL,"\u2aa9":Ji.REL,"\u2aaa":Ji.REL,"\u2aab":Ji.REL,"\u2aac":Ji.REL,"\u2aad":Ji.REL,"\u2aae":Ji.REL,"\u2aaf":Ji.REL,"\u2aaf\u0338":Ji.REL,"\u2ab0":Ji.REL,"\u2ab0\u0338":Ji.REL,"\u2ab1":Ji.REL,"\u2ab2":Ji.REL,"\u2ab3":Ji.REL,"\u2ab4":Ji.REL,"\u2ab5":Ji.REL,"\u2ab6":Ji.REL,"\u2ab7":Ji.REL,"\u2ab8":Ji.REL,"\u2ab9":Ji.REL,"\u2aba":Ji.REL,"\u2abb":Ji.REL,"\u2abc":Ji.REL,"\u2abd":Ji.REL,"\u2abe":Ji.REL,"\u2abf":Ji.REL,"\u2ac0":Ji.REL,"\u2ac1":Ji.REL,"\u2ac2":Ji.REL,"\u2ac3":Ji.REL,"\u2ac4":Ji.REL,"\u2ac5":Ji.REL,"\u2ac6":Ji.REL,"\u2ac7":Ji.REL,"\u2ac8":Ji.REL,"\u2ac9":Ji.REL,"\u2aca":Ji.REL,"\u2acb":Ji.REL,"\u2acc":Ji.REL,"\u2acd":Ji.REL,"\u2ace":Ji.REL,"\u2acf":Ji.REL,"\u2ad0":Ji.REL,"\u2ad1":Ji.REL,"\u2ad2":Ji.REL,"\u2ad3":Ji.REL,"\u2ad4":Ji.REL,"\u2ad5":Ji.REL,"\u2ad6":Ji.REL,"\u2ad7":Ji.REL,"\u2ad8":Ji.REL,"\u2ad9":Ji.REL,"\u2ada":Ji.REL,"\u2adb":Ji.BIN4,"\u2add":Ji.BIN3,"\u2add\u0338":Ji.REL,"\u2ade":Ji.REL,"\u2adf":Ji.REL,"\u2ae0":Ji.REL,"\u2ae1":Ji.REL,"\u2ae2":Ji.REL,"\u2ae3":Ji.REL,"\u2ae4":Ji.REL,"\u2ae5":Ji.REL,"\u2ae6":Ji.REL,"\u2ae7":Ji.REL,"\u2ae8":Ji.REL,"\u2ae9":Ji.REL,"\u2aea":Ji.REL,"\u2aeb":Ji.REL,"\u2aee":Ji.REL,"\u2af2":Ji.REL,"\u2af3":Ji.REL,"\u2af4":Ji.REL,"\u2af5":Ji.REL,"\u2af6":Ji.BIN4,"\u2af7":Ji.REL,"\u2af8":Ji.REL,"\u2af9":Ji.REL,"\u2afa":Ji.REL,"\u2afb":Ji.BIN4,"\u2afd":Ji.BIN4,"\u2afe":Ji.BIN3,"\u2b00":Ji.REL,"\u2b01":Ji.REL,"\u2b02":Ji.REL,"\u2b03":Ji.REL,"\u2b04":Ji.WIDEREL,"\u2b05":Ji.WIDEREL,"\u2b06":Ji.RELSTRETCH,"\u2b07":Ji.RELSTRETCH,"\u2b08":Ji.REL,"\u2b09":Ji.REL,"\u2b0a":Ji.REL,"\u2b0b":Ji.REL,"\u2b0c":Ji.WIDEREL,"\u2b0d":Ji.RELSTRETCH,"\u2b0e":Ji.RELSTRETCH,"\u2b0f":Ji.RELSTRETCH,"\u2b10":Ji.RELSTRETCH,"\u2b11":Ji.RELSTRETCH,"\u2b30":Ji.WIDEREL,"\u2b31":Ji.WIDEREL,"\u2b32":Ji.RELSTRETCH,"\u2b33":Ji.WIDEREL,"\u2b34":Ji.WIDEREL,"\u2b35":Ji.WIDEREL,"\u2b36":Ji.WIDEREL,"\u2b37":Ji.WIDEREL,"\u2b38":Ji.WIDEREL,"\u2b39":Ji.WIDEREL,"\u2b3a":Ji.WIDEREL,"\u2b3b":Ji.WIDEREL,"\u2b3c":Ji.WIDEREL,"\u2b3d":Ji.WIDEREL,"\u2b3e":Ji.WIDEREL,"\u2b3f":Ji.RELACCENT,"\u2b40":Ji.WIDEREL,"\u2b41":Ji.WIDEREL,"\u2b42":Ji.WIDEREL,"\u2b43":Ji.WIDEREL,"\u2b44":Ji.WIDEREL,"\u2b45":Ji.WIDEREL,"\u2b46":Ji.WIDEREL,"\u2b47":Ji.WIDEREL,"\u2b48":Ji.WIDEREL,"\u2b49":Ji.WIDEREL,"\u2b4a":Ji.WIDEREL,"\u2b4b":Ji.WIDEREL,"\u2b4c":Ji.WIDEREL,"\u2b4d":Ji.REL,"\u2b4e":Ji.REL,"\u2b4f":Ji.REL,"\u2b5a":Ji.REL,"\u2b5b":Ji.REL,"\u2b5c":Ji.REL,"\u2b5d":Ji.REL,"\u2b5e":Ji.REL,"\u2b5f":Ji.REL,"\u2b60":Ji.WIDEREL,"\u2b61":Ji.RELSTRETCH,"\u2b62":Ji.WIDEREL,"\u2b63":Ji.RELSTRETCH,"\u2b64":Ji.WIDEREL,"\u2b65":Ji.RELSTRETCH,"\u2b66":Ji.REL,"\u2b67":Ji.REL,"\u2b68":Ji.REL,"\u2b69":Ji.REL,"\u2b6a":Ji.WIDEREL,"\u2b6b":Ji.RELSTRETCH,"\u2b6c":Ji.WIDEREL,"\u2b6d":Ji.RELSTRETCH,"\u2b6e":Ji.REL,"\u2b6f":Ji.REL,"\u2b70":Ji.WIDEREL,"\u2b71":Ji.RELSTRETCH,"\u2b72":Ji.WIDEREL,"\u2b73":Ji.RELSTRETCH,"\u2b76":Ji.REL,"\u2b77":Ji.REL,"\u2b78":Ji.REL,"\u2b79":Ji.REL,"\u2b7a":Ji.WIDEREL,"\u2b7b":Ji.RELSTRETCH,"\u2b7c":Ji.WIDEREL,"\u2b7d":Ji.RELSTRETCH,"\u2b80":Ji.WIDEREL,"\u2b81":Ji.RELSTRETCH,"\u2b82":Ji.WIDEREL,"\u2b83":Ji.RELSTRETCH,"\u2b84":Ji.WIDEREL,"\u2b85":Ji.RELSTRETCH,"\u2b86":Ji.WIDEREL,"\u2b87":Ji.RELSTRETCH,"\u2b88":Ji.RELACCENT,"\u2b89":Ji.REL,"\u2b8a":Ji.RELACCENT,"\u2b8b":Ji.REL,"\u2b8c":Ji.REL,"\u2b8d":Ji.REL,"\u2b8e":Ji.REL,"\u2b8f":Ji.REL,"\u2b94":Ji.REL,"\u2b95":Ji.WIDEREL,"\u2ba0":Ji.RELSTRETCH,"\u2ba1":Ji.RELSTRETCH,"\u2ba2":Ji.RELSTRETCH,"\u2ba3":Ji.RELSTRETCH,"\u2ba4":Ji.RELSTRETCH,"\u2ba5":Ji.RELSTRETCH,"\u2ba6":Ji.RELSTRETCH,"\u2ba7":Ji.RELSTRETCH,"\u2ba8":Ji.WIDEREL,"\u2ba9":Ji.WIDEREL,"\u2baa":Ji.WIDEREL,"\u2bab":Ji.WIDEREL,"\u2bac":Ji.RELSTRETCH,"\u2bad":Ji.RELSTRETCH,"\u2bae":Ji.RELSTRETCH,"\u2baf":Ji.RELSTRETCH,"\u2bb0":Ji.REL,"\u2bb1":Ji.REL,"\u2bb2":Ji.REL,"\u2bb3":Ji.REL,"\u2bb4":Ji.REL,"\u2bb5":Ji.REL,"\u2bb6":Ji.REL,"\u2bb7":Ji.REL,"\u2bb8":Ji.RELSTRETCH,"\u2bd1":Ji.REL,\u3adc:Ji.BIN3,"\ufe37":Ji.WIDEACCENT,"\ufe38":Ji.WIDEACCENT}};function Zi(t,e){return t.length!==e.length?e.length-t.length:t===e?0:t<e?-1:1}function tn(t){return t.replace(/([\^$(){}.+*?\-|[\]:\\])/g,"\\$1")}function en(t){return Array.from(t).map(t=>t.codePointAt(0))}function sn(t){return String.fromCodePoint(...t)}function nn(t){return!!t.match(/%\s*$/)}function rn(t){return t.trim().split(/\s+/)}function on(t){return t.replace(/\\U(?:([0-9A-Fa-f]{4})|\{\s*([0-9A-Fa-f]{1,6})\s*\})|\\./g,(t,e,s)=>"\\\\"===t?"\\":String.fromCodePoint(parseInt(e||s,16)))}function an(t){return`&#x${t.codePointAt(0).toString(16).toUpperCase()};`}class ln extends _i{constructor(){super(...arguments),this._texClass=null,this.lspace=5/18,this.rspace=5/18}get texClass(){return null===this._texClass?this.getOperatorDef(this.getText())[2]:this._texClass}set texClass(t){this._texClass=t}get kind(){return"mo"}get isEmbellished(){return!0}coreParent(){let t=null,e=this;const s=this.factory.getNodeClass("math");for(;e&&e.isEmbellished&&e.coreMO()===this&&!(e instanceof s);)t=e,e=e.parent;return t||this}coreText(t){if(!t)return"";if(t.isEmbellished)return t.coreMO().getText();for(;((t.isKind("mrow")||t.isKind("TeXAtom")||t.isKind("mstyle")||t.isKind("mphantom"))&&1===t.childNodes.length||t.isKind("munderover"))&&t.childNodes[0];)t=t.childNodes[0];return t.isToken?t.getText():""}hasSpacingAttributes(){return this.attributes.isSet("lspace")||this.attributes.isSet("rspace")}get isAccent(){let t=!1;const e=this.coreParent().parent;if(e){const s=e.isKind("mover")?e.childNodes[e.over].coreMO()?"accent":"":e.isKind("munder")?e.childNodes[e.under].coreMO()?"accentunder":"":e.isKind("munderover")?this===e.childNodes[e.over].coreMO()?"accent":this===e.childNodes[e.under].coreMO()?"accentunder":"":"";if(s){t=void 0!==e.attributes.getExplicit(s)?t:this.attributes.get("accent")}}return t}setTeXclass(t){const{form:e,fence:s}=this.attributes.getList("form","fence");return void 0===this.getProperty("texClass")&&this.hasSpacingAttributes()?null:(s&&this.texClass===Oi.REL&&("prefix"===e&&(this.texClass=Oi.OPEN),"postfix"===e&&(this.texClass=Oi.CLOSE)),this.adjustTeXclass(t))}adjustTeXclass(t){const e=this.texClass;let s=this.prevClass;if(e===Oi.NONE)return t;if(t?(!t.getProperty("autoOP")||e!==Oi.BIN&&e!==Oi.REL||(s=t.texClass=Oi.ORD),s=this.prevClass=t.texClass||Oi.ORD,this.prevLevel=this.attributes.getInherited("scriptlevel")):s=this.prevClass=Oi.NONE,e!==Oi.BIN||s!==Oi.NONE&&s!==Oi.BIN&&s!==Oi.OP&&s!==Oi.REL&&s!==Oi.OPEN&&s!==Oi.PUNCT)if(s!==Oi.BIN||e!==Oi.REL&&e!==Oi.CLOSE&&e!==Oi.PUNCT){if(e===Oi.BIN){let t=null,e=this.parent;for(;e&&e.parent&&e.isEmbellished&&(1===e.childNodes.length||!e.isKind("mrow")&&e.core()===t);)t=e,e=e.parent;t=t||this,e.childNodes[e.childNodes.length-1]===t&&(this.texClass=Oi.ORD)}}else t.texClass=this.prevClass=Oi.ORD;else this.texClass=Oi.ORD;return this}setInheritedAttributes(t={},e=!1,s=0,i=!1){super.setInheritedAttributes(t,e,s,i);const n=this.getText();this.checkOperatorTable(n),this.checkPseudoScripts(n),this.checkPrimes(n),this.checkMathAccent(n)}getOperatorDef(t){const[e,s,i]=this.handleExplicitForm(this.getForms());this.attributes.setInherited("form",e);const n=this.constructor,r=n.OPTABLE,o=r[e][t]||r[s][t]||r[i][t];if(o)return o;this.setProperty("noDictDef",!0);const a=this.attributes.get("movablelimits");if((!!t.match(n.opPattern)||a)&&void 0===this.getProperty("texClass"))return Gi(1,2,Oi.OP);const l=$i(t),[h,c]=n.MMLSPACING[l[2]];return Gi(h,c,l[2])}checkOperatorTable(t){const e=this.getOperatorDef(t);void 0===this.getProperty("texClass")&&(this.texClass=e[2]);for(const t of Object.keys(e[3]||{}))this.attributes.setInherited(t,e[3][t]);this.lspace=e[0]/18,this.rspace=e[1]/18}getForms(){let t=null,e=this.parent,s=this.Parent;for(;s&&s.isEmbellished;)t=e,e=s.parent,s=s.Parent;if(t=t||this,e&&e.isKind("mrow")&&1!==e.nonSpaceLength()){if(e.firstNonSpace()===t)return["prefix","infix","postfix"];if(e.lastNonSpace()===t)return["postfix","infix","prefix"]}return["infix","prefix","postfix"]}handleExplicitForm(t){if(this.attributes.isSet("form")){const e=this.attributes.get("form");t=[e].concat(t.filter(t=>t!==e))}return t}checkPseudoScripts(t){const e=this.constructor.pseudoScripts;if(!t.match(e))return;const s=this.coreParent().Parent,i=!s||!(s.isKind("msubsup")&&!s.isKind("msub"));this.setProperty("pseudoscript",i),i&&(this.attributes.setInherited("lspace",0),this.attributes.setInherited("rspace",0))}checkPrimes(t){const e=this.constructor.primes;if(!t.match(e))return;const s=this.constructor.remapPrimes,i=sn(en(t).map(t=>s[t]));this.setProperty("primes",i)}checkMathAccent(t){const e=this.Parent;if(void 0!==this.getProperty("mathaccent")||!e||!e.isKind("munderover"))return;const[s,i,n]=e.childNodes;if(s.isEmbellished&&s.coreMO()===this)return;const r=!(!i||!i.isEmbellished||i.coreMO()!==this),o=!(!n||!n.isEmbellished||i.coreMO()!==this);(r||o)&&(this.isMathAccent(t)?this.setProperty("mathaccent",!0):this.isMathAccentWithWidth(t)&&this.setProperty("mathaccent",!1))}isMathAccent(t=this.getText()){const e=this.constructor.mathaccents;return!!t.match(e)}isMathAccentWithWidth(t=this.getText()){const e=this.constructor.mathaccentsWithWidth;return!!t.match(e)}}ln.defaults=Object.assign(Object.assign({},_i.defaults),{form:"infix",fence:!1,separator:!1,lspace:"thickmathspace",rspace:"thickmathspace",stretchy:!1,symmetric:!1,maxsize:"infinity",minsize:"0em",largeop:!1,movablelimits:!1,accent:!1,linebreak:"auto",lineleading:"100%",linebreakstyle:"before",indentalign:"auto",indentshift:"0",indenttarget:"",indentalignfirst:"indentalign",indentshiftfirst:"indentshift",indentalignlast:"indentalign",indentshiftlast:"indentshift"}),ln.MMLSPACING=Yi,ln.OPTABLE=Qi,ln.pseudoScripts=new RegExp(["^[\"'*`","\xaa","\xb0","\xb2-\xb4","\xb9","\xba","\u2018-\u201f","\u2032-\u2037\u2057","\u2070\u2071","\u2074-\u207f","\u2080-\u208e","]+$"].join("")),ln.primes=new RegExp(["^[\"'","\u2018-\u201f","]+$"].join("")),ln.opPattern=/^[a-zA-Z]{2,}$/,ln.remapPrimes={34:8243,39:8242,8216:8245,8217:8242,8218:8242,8219:8245,8220:8246,8221:8243,8222:8243,8223:8246},ln.mathaccents=new RegExp(["^[","\xb4\u0301\u02ca","`\u0300\u02cb","\xa8\u0308","~\u0303\u02dc","\xaf\u0304\u02c9","\u02d8\u0306","\u02c7\u030c","^\u0302\u02c6","\u20d0\u20d1","\u20d6\u20d7\u20e1","\u02d9\u0307","\u02da\u030a","\u20db","\u20dc","]$"].join("")),ln.mathaccentsWithWidth=new RegExp(["^[","\u2190\u2192\u2194","\u23dc\u23dd","\u23de\u23df","]$"].join(""));class hn extends _i{constructor(){super(...arguments),this.texclass=Oi.ORD}get kind(){return"mtext"}get isSpacelike(){return!!this.getText().match(/^\s*$/)&&!this.attributes.hasOneOf(hn.NONSPACELIKE)}}hn.NONSPACELIKE=["style","mathbackground","background"],hn.defaults=Object.assign({},_i.defaults);class cn extends _i{constructor(){super(...arguments),this.texclass=Oi.NONE}setTeXclass(t){return t}get kind(){return"mspace"}get arity(){return 0}get isSpacelike(){return!this.attributes.hasExplicit("linebreak")&&this.canBreak}get hasNewline(){const t=this.attributes.get("linebreak");return this.canBreak&&("newline"===t||"indentingnewline"===t)}get canBreak(){return!this.attributes.hasOneOf(cn.NONSPACELIKE)&&"-"!==String(this.attributes.get("width")).trim().charAt(0)}}cn.NONSPACELIKE=["height","depth","style","mathbackground","background"],cn.defaults=Object.assign(Object.assign({},_i.defaults),{width:"0em",height:"0ex",depth:"0ex",linebreak:"auto",indentshift:"auto",indentalign:"auto",indenttarget:"",indentalignfirst:"indentalign",indentshiftfirst:"indentshift",indentalignlast:"indentalign",indentshiftlast:"indentshift"});class dn extends _i{constructor(){super(...arguments),this.texclass=Oi.ORD}get kind(){return"ms"}}dn.defaults=Object.assign(Object.assign({},_i.defaults),{lquote:'"',rquote:'"'});class un extends ji{constructor(){super(...arguments),this._core=null}get kind(){return"mrow"}get isSpacelike(){for(const t of this.childNodes)if(!t.isSpacelike)return!1;return!0}get isEmbellished(){let t=!1,e=0;for(const s of this.childNodes){if(s)if(s.isEmbellished){if(t)return!1;t=!0,this._core=e}else if(!s.isSpacelike)return!1;e++}return t}core(){return this.isEmbellished&&null!=this._core?this.childNodes[this._core]:this}coreMO(){return this.isEmbellished&&null!=this._core?this.childNodes[this._core].coreMO():this}nonSpaceLength(){let t=0;for(const e of this.childNodes)e&&!e.isSpacelike&&t++;return t}firstNonSpace(){for(const t of this.childNodes)if(t&&!t.isSpacelike)return t;return null}lastNonSpace(){let t=this.childNodes.length;for(;--t>=0;){const e=this.childNodes[t];if(e&&!e.isSpacelike)return e}return null}setTeXclass(t){if(null!=this.getProperty("open")||null!=this.getProperty("close")){this.getPrevClass(t),t=null;for(const e of this.childNodes)t=e.setTeXclass(t);return null==this.texClass&&(this.texClass=Oi.INNER),this}for(const e of this.childNodes)t=e.setTeXclass(t);return this.childNodes[0]&&this.updateTeXclass(this.childNodes[0]),t}}un.defaults=Object.assign({},ji.defaults);class pn extends un{get kind(){return"inferredMrow"}get isInferred(){return!0}get notParent(){return!0}toString(){return"["+this.childNodes.join(",")+"]"}}pn.defaults=un.defaults;class mn extends Ui{get kind(){return"mfrac"}get arity(){return 2}get linebreakContainer(){return!0}get linebreakAlign(){return""}setTeXclass(t){this.getPrevClass(t);for(const t of this.childNodes)t.setTeXclass(null);return this}setChildInheritedAttributes(t,e,s,i){(!e||s>0)&&s++;const n=this.attributes.get("numalign"),r=this.attributes.get("denomalign"),o=this.addInheritedAttributes(Object.assign({},t),{numalign:n,indentshift:"0",indentalignfirst:n,indentshiftfirst:"0",indentalignlast:"indentalign",indentshiftlast:"indentshift"}),a=this.addInheritedAttributes(Object.assign({},t),{denalign:r,indentshift:"0",indentalignfirst:r,indentshiftfirst:"0",indentalignlast:"indentalign",indentshiftlast:"indentshift"});this.childNodes[0].setInheritedAttributes(o,!1,s,i),this.childNodes[1].setInheritedAttributes(a,!1,s,!0)}}mn.defaults=Object.assign(Object.assign({},Ui.defaults),{linethickness:"medium",numalign:"center",denomalign:"center",bevelled:!1});class fn extends ji{constructor(){super(...arguments),this.texclass=Oi.ORD}get kind(){return"msqrt"}get arity(){return-1}get linebreakContainer(){return!0}setTeXclass(t){return this.getPrevClass(t),this.childNodes[0].setTeXclass(null),this}setChildInheritedAttributes(t,e,s,i){this.childNodes[0].setInheritedAttributes(t,e,s,!0)}}fn.defaults=Object.assign(Object.assign({},ji.defaults),{"data-vertical-align":"bottom"});class gn extends ji{constructor(){super(...arguments),this.texclass=Oi.ORD}get kind(){return"mroot"}get arity(){return 2}get linebreakContainer(){return!0}setTeXclass(t){return this.getPrevClass(t),this.childNodes[0].setTeXclass(null),this.childNodes[1].setTeXclass(null),this}setChildInheritedAttributes(t,e,s,i){this.childNodes[0].setInheritedAttributes(t,e,s,!0),this.childNodes[1].setInheritedAttributes(t,!1,s+2,i)}}gn.defaults=Object.assign(Object.assign({},ji.defaults),{"data-vertical-align":"bottom"});class bn extends Fi{get kind(){return"mstyle"}get notParent(){return this.childNodes[0]&&1===this.childNodes[0].childNodes.length}setInheritedAttributes(t={},e=!1,s=0,i=!1){this.attributes.setInherited("displaystyle",e),this.attributes.setInherited("scriptlevel",s),super.setInheritedAttributes(t,e,s,i)}setChildInheritedAttributes(t,e,s,i){let n=this.attributes.getExplicit("scriptlevel");null!=n&&(n=n.toString(),n.match(/^\s*[-+]/)?s+=parseInt(n):s=parseInt(n),i=!1);const r=this.attributes.getExplicit("displaystyle");null!=r&&(e=!0===r,i=!1);const o=this.attributes.getExplicit("data-cramped");null!=o&&(i=o),t=this.addInheritedAttributes(t,this.attributes.getAllAttributes()),this.childNodes[0].setInheritedAttributes(t,e,s,i)}}bn.defaults=Object.assign(Object.assign({},Fi.defaults),{scriptlevel:Ii,displaystyle:Ii,scriptsizemultiplier:1/Math.sqrt(2),scriptminsize:".4em",mathbackground:Ii,mathcolor:Ii,dir:Ii,infixlinebreakstyle:"before"});class En extends ji{constructor(){super(...arguments),this.texclass=Oi.ORD}get kind(){return"merror"}get arity(){return-1}get linebreakContainer(){return!0}}En.defaults=Object.assign({},ji.defaults);class xn extends Fi{get kind(){return"mpadded"}get linebreakContainer(){return!0}setTeXclass(t){return this.getProperty("vbox")?(this.getPrevClass(t),this.texClass=Oi.ORD,this.childNodes[0].setTeXclass(null),this):super.setTeXclass(t)}}xn.defaults=Object.assign(Object.assign({},Fi.defaults),{width:"",height:"",depth:"",lspace:0,voffset:0});class yn extends Fi{constructor(){super(...arguments),this.texclass=Oi.ORD}get kind(){return"mphantom"}}yn.defaults=Object.assign({},Fi.defaults);class Nn extends ji{constructor(){super(...arguments),this.texclass=Oi.INNER,this.separators=[],this.open=null,this.close=null}get kind(){return"mfenced"}setTeXclass(t){this.getPrevClass(t),this.open&&(t=this.open.setTeXclass(t)),this.childNodes[0]&&(t=this.childNodes[0].setTeXclass(t));for(let e=1,s=this.childNodes.length;e<s;e++)this.separators[e-1]&&(t=this.separators[e-1].setTeXclass(t)),this.childNodes[e]&&(t=this.childNodes[e].setTeXclass(t));return this.close&&(t=this.close.setTeXclass(t)),this.open&&this.close||this.updateTeXclass(this.open||this.childNodes[0]||this.close),t}setChildInheritedAttributes(t,e,s,i){this.addFakeNodes();for(const n of[this.open,this.close].concat(this.separators))n&&n.setInheritedAttributes(t,e,s,i);super.setChildInheritedAttributes(t,e,s,i)}addFakeNodes(){let{open:t,close:e,separators:s}=this.attributes.getList("open","close","separators");if(t=t.replace(/[ \t\n\r]/g,""),e=e.replace(/[ \t\n\r]/g,""),s=s.replace(/[ \t\n\r]/g,""),t&&(this.open=this.fakeNode(t,{fence:!0,form:"prefix"},Oi.OPEN)),s){for(;s.length<this.childNodes.length-1;)s+=s.charAt(s.length-1);let t=0;for(const e of this.childNodes.slice(1))e&&this.separators.push(this.fakeNode(s.charAt(t++)))}e&&(this.close=this.fakeNode(e,{fence:!0,form:"postfix"},Oi.CLOSE))}fakeNode(t,e={},s=null){const i=this.factory.create("text").setText(t),n=this.factory.create("mo",e,[i]);return n.texClass=s,n.parent=this,n}}Nn.defaults=Object.assign(Object.assign({},ji.defaults),{open:"(",close:")",separators:","});class Tn extends ji{constructor(){super(...arguments),this.texclass=Oi.ORD}get kind(){return"menclose"}get arity(){return-1}get linebreakContainer(){return!0}setTeXclass(t){return t=this.childNodes[0].setTeXclass(t),this.updateTeXclass(this.childNodes[0]),t}}Tn.defaults=Object.assign(Object.assign({},ji.defaults),{notation:"longdiv"});class vn extends ji{get kind(){return"maction"}get arity(){return 1}get selected(){const t=this.attributes.get("selection"),e=Math.max(1,Math.min(this.childNodes.length,t))-1;return this.childNodes[e]||this.factory.create("mrow")}get isEmbellished(){return this.selected.isEmbellished}get isSpacelike(){return this.selected.isSpacelike}core(){return this.selected.core()}coreMO(){return this.selected.coreMO()}verifyAttributes(t){super.verifyAttributes(t),"toggle"!==this.attributes.get("actiontype")&&this.attributes.hasExplicit("selection")&&this.attributes.unset("selection")}setTeXclass(t){"tooltip"===this.attributes.get("actiontype")&&this.childNodes[1]&&this.childNodes[1].setTeXclass(null);const e=this.selected;return t=e.setTeXclass(t),this.updateTeXclass(e),t}nextToggleSelection(){let t=Math.max(1,parseInt(this.attributes.get("selection"))+1);t>this.childNodes.length&&(t=1),this.attributes.set("selection",t)}setChildInheritedAttributes(t,e,s,i){var n,r;"tooltip"===this.attributes.get("actiontype").toLowerCase()?(null===(n=this.childNodes[0])||void 0===n||n.setInheritedAttributes(t,e,s,i),null===(r=this.childNodes[1])||void 0===r||r.setInheritedAttributes(t,!1,1,!1)):super.setChildInheritedAttributes(t,e,s,i)}}vn.defaults=Object.assign(Object.assign({},ji.defaults),{actiontype:"toggle",selection:1});class Ln extends Ui{get kind(){return"msubsup"}get arity(){return 3}get base(){return 0}get sub(){return 1}get sup(){return 2}setChildInheritedAttributes(t,e,s,i){const n=this.childNodes;n[0].setInheritedAttributes(t,e,s,i),n[1].setInheritedAttributes(t,!1,s+1,i||1===this.sub),n[2]&&n[2].setInheritedAttributes(t,!1,s+1,i||2===this.sub)}}Ln.defaults=Object.assign(Object.assign({},Ui.defaults),{subscriptshift:"",superscriptshift:""});class Cn extends Ln{get kind(){return"msub"}get arity(){return 2}}Cn.defaults=Object.assign({},Ln.defaults);class Rn extends Ln{get kind(){return"msup"}get arity(){return 2}get sup(){return 1}get sub(){return 2}}Rn.defaults=Object.assign({},Ln.defaults);class In extends Ui{get kind(){return"munderover"}get arity(){return 3}get base(){return 0}get under(){return 1}get over(){return 2}get linebreakContainer(){return!0}setChildInheritedAttributes(t,e,s,i){const n=this.childNodes;n[0].setInheritedAttributes(t,e,s,i||!!n[this.over]);const r=!(e||!n[0].coreMO().attributes.get("movablelimits")),o=this.constructor.ACCENTS;n[1].setInheritedAttributes(t,!1,this.getScriptlevel(o[1],r,s),i||1===this.under),this.setInheritedAccent(1,o[1],e,s,i,r),n[2]&&(n[2].setInheritedAttributes(t,!1,this.getScriptlevel(o[2],r,s),i||2===this.under),this.setInheritedAccent(2,o[2],e,s,i,r))}getScriptlevel(t,e,s){return!e&&this.attributes.get(t)||s++,s}setInheritedAccent(t,e,s,i,n,r){const o=this.childNodes[t];if(!this.attributes.hasExplicit(e)&&o.isEmbellished){const t=o.coreMO().attributes.get("accent");this.attributes.setInherited(e,t),t!==this.attributes.getDefault(e)&&o.setInheritedAttributes({},s,this.getScriptlevel(e,r,i),n)}}}In.defaults=Object.assign(Object.assign({},Ui.defaults),{accent:!1,accentunder:!1,align:"center"}),In.ACCENTS=["","accentunder","accent"];class Sn extends In{get kind(){return"munder"}get arity(){return 2}}Sn.defaults=Object.assign({},In.defaults);class An extends In{get kind(){return"mover"}get arity(){return 2}get over(){return 1}get under(){return 2}}An.defaults=Object.assign({},In.defaults),An.ACCENTS=["","accent","accentunder"];class wn extends Ln{get kind(){return"mmultiscripts"}get arity(){return 1}setChildInheritedAttributes(t,e,s,i){this.childNodes[0].setInheritedAttributes(t,e,s,i);let n=!1;for(let e=1,r=0;e<this.childNodes.length;e++){const o=this.childNodes[e];if(o.isKind("mprescripts")){if(!n&&(n=!0,e%2==0)){const t=this.factory.create("none");this.childNodes.splice(e,0,t),t.parent=this,e++}}else{const e=i||r%2==0;o.setInheritedAttributes(t,!1,s+1,e),r++}}this.childNodes.length%2==(n?1:0)&&(this.appendChild(this.factory.create("none")),this.childNodes[this.childNodes.length-1].setInheritedAttributes(t,!1,s+1,i))}verifyChildren(t){let e=!1;const s=t.fixMmultiscripts;for(let i=0;i<this.childNodes.length;i++){const n=this.childNodes[i];n.isKind("mprescripts")&&(e?n.mError(n.kind+" can only appear once in "+this.kind,t,!0):(e=!0,i%2!=0||s||this.mError("There must be an equal number of prescripts of each type",t)))}this.childNodes.length%2!=(e?1:0)||s||this.mError("There must be an equal number of scripts of each type",t),super.verifyChildren(t)}}wn.defaults=Object.assign({},Ln.defaults);class On extends ji{get kind(){return"mprescripts"}get arity(){return 0}verifyTree(t){super.verifyTree(t),this.parent&&!this.parent.isKind("mmultiscripts")&&this.mError(this.kind+" must be a child of mmultiscripts",t,!0)}}On.defaults=Object.assign({},ji.defaults);class Mn extends ji{get kind(){return"none"}get arity(){return 0}verifyTree(t){super.verifyTree(t),this.parent&&!this.parent.isKind("mmultiscripts")&&this.mError(this.kind+" must be a child of mmultiscripts",t,!0)}}Mn.defaults=Object.assign({},ji.defaults);class Dn extends ji{constructor(){super(...arguments),this.properties={useHeight:!0},this.texclass=Oi.ORD}get kind(){return"mtable"}get linebreakContainer(){return!0}get linebreakAlign(){return""}setInheritedAttributes(t,e,s,i){for(const e of Bi)t[e]&&this.attributes.setInherited(e,t[e][1]),this.attributes.hasExplicit(e)&&this.attributes.unset(e);super.setInheritedAttributes(t,e,s,i)}setChildInheritedAttributes(t,e,s,i){for(const t of this.childNodes)t.isKind("mtr")||this.replaceChild(this.factory.create("mtr"),t).appendChild(t);e=!(!this.attributes.getExplicit("displaystyle")&&!this.attributes.getDefault("displaystyle")),t=this.addInheritedAttributes(t,{columnalign:this.attributes.get("columnalign"),rowalign:"center","data-break-align":this.attributes.get("data-break-align")});const n=this.attributes.getExplicit("data-cramped"),r=rn(this.attributes.get("rowalign"));for(const i of this.childNodes)t.rowalign[1]=r.shift()||t.rowalign[1],i.setInheritedAttributes(t,e,s,!!n)}verifyChildren(t){let e=null;const s=this.factory;for(let i=0;i<this.childNodes.length;i++){const n=this.childNodes[i];if(n.isKind("mtr"))e=null;else{const r=n.isKind("mtd");if(e?(this.removeChild(n),i--):e=this.replaceChild(s.create("mtr"),n),e.appendChild(r?n:s.create("mtd",{},[n])),!t.fixMtables){n.parent.removeChild(n),n.parent=this,r&&e.appendChild(s.create("mtd"));const i=n.mError("Children of "+this.kind+" must be mtr or mlabeledtr",t,r);e.childNodes[e.childNodes.length-1].appendChild(i)}}}super.verifyChildren(t)}setTeXclass(t){this.getPrevClass(t);for(const t of this.childNodes)t.setTeXclass(null);return this}}Dn.defaults=Object.assign(Object.assign({},ji.defaults),{align:"axis",rowalign:"baseline",columnalign:"center",groupalign:"{left}",alignmentscope:!0,columnwidth:"auto",width:"auto",rowspacing:"1ex",columnspacing:".8em",rowlines:"none",columnlines:"none",frame:"none",framespacing:"0.4em 0.5ex",equalrows:!1,equalcolumns:!1,displaystyle:!1,side:"right",minlabelspacing:"0.8em","data-break-align":"top"});class kn extends ji{get kind(){return"mtr"}get linebreakContainer(){return!0}get linebreakAlign(){return""}setChildInheritedAttributes(t,e,s,i){for(const t of this.childNodes)t.isKind("mtd")||this.replaceChild(this.factory.create("mtd"),t).appendChild(t);const n=rn(this.attributes.get("columnalign")),r=rn(this.attributes.get("data-break-align"));1===this.arity&&(n.unshift(this.parent.attributes.get("side")),r.unshift("top")),t=this.addInheritedAttributes(t,{rowalign:this.attributes.get("rowalign"),columnalign:"center","data-break-align":"top"});for(const o of this.childNodes)t.columnalign[1]=n.shift()||t.columnalign[1],t["data-vertical-align"]=[this.kind,r.shift()||t["data-break-align"][1]],o.setInheritedAttributes(t,e,s,i)}verifyChildren(t){if(!this.parent||this.parent.isKind("mtable")){for(const e of this.childNodes)if(!e.isKind("mtd")){this.replaceChild(this.factory.create("mtd"),e).appendChild(e),t.fixMtables||e.mError("Children of "+this.kind+" must be mtd",t)}super.verifyChildren(t)}else this.mError(this.kind+" can only be a child of an mtable",t,!0)}setTeXclass(t){this.getPrevClass(t);for(const t of this.childNodes)t.setTeXclass(null);return this}}kn.defaults=Object.assign(Object.assign({},ji.defaults),{rowalign:Ii,columnalign:Ii,groupalign:Ii,"data-break-align":"top"});class Pn extends kn{get kind(){return"mlabeledtr"}get arity(){return 1}}class Bn extends Ui{get kind(){return"mtd"}get arity(){return-1}get linebreakContainer(){return!0}get linebreakAlign(){return"columnalign"}verifyChildren(t){!this.parent||this.parent.isKind("mtr")?super.verifyChildren(t):this.mError(this.kind+" can only be a child of an mtr or mlabeledtr",t,!0)}setTeXclass(t){return this.getPrevClass(t),this.childNodes[0].setTeXclass(null),this}}Bn.defaults=Object.assign(Object.assign({},Ui.defaults),{rowspan:1,columnspan:1,rowalign:Ii,columnalign:Ii,groupalign:Ii,"data-vertical-align":"top"});class jn extends Fi{get kind(){return"maligngroup"}get isSpacelike(){return!0}setChildInheritedAttributes(t,e,s,i){t=this.addInheritedAttributes(t,this.attributes.getAllAttributes()),super.setChildInheritedAttributes(t,e,s,i)}}jn.defaults=Object.assign(Object.assign({},Fi.defaults),{groupalign:Ii});class _n extends ji{get kind(){return"malignmark"}get arity(){return 0}get isSpacelike(){return!0}}_n.defaults=Object.assign(Object.assign({},ji.defaults),{edge:"left"});class Fn extends _i{constructor(){super(...arguments),this.texclass=Oi.ORD}get kind(){return"mglyph"}verifyAttributes(t){const{src:e,fontfamily:s,index:i}=this.attributes.getList("src","fontfamily","index");""!==e||""!==s&&""!==i?super.verifyAttributes(t):this.mError("mglyph must have either src or fontfamily and index attributes",t,!0)}}Fn.defaults=Object.assign(Object.assign({},_i.defaults),{alt:"",src:"",index:"",width:"auto",height:"auto",valign:"0em"});class Un extends Ui{get kind(){return"semantics"}get arity(){return 1}get notParent(){return!0}}Un.defaults=Object.assign(Object.assign({},Ui.defaults),{definitionUrl:null,encoding:null});class Hn extends ji{get kind(){return"annotation-xml"}setChildInheritedAttributes(){}}Hn.defaults=Object.assign(Object.assign({},ji.defaults),{definitionUrl:null,encoding:null,cd:"mathmlkeys",name:"",src:null});class Wn extends Hn{constructor(){super(...arguments),this.properties={isChars:!0}}get kind(){return"annotation"}}Wn.defaults=Object.assign({},Hn.defaults);class Vn extends Ui{get kind(){return"TeXAtom"}get arity(){return-1}get notParent(){return!0}constructor(t,e,s){super(t,e,s),this.texclass=Oi.ORD,this.setProperty("texClass",this.texClass)}setTeXclass(t){return this.childNodes[0].setTeXclass(null),this.adjustTeXclass(t)}adjustTeXclass(t){return t}}Vn.defaults=Object.assign({},Ui.defaults),Vn.prototype.adjustTeXclass=ln.prototype.adjustTeXclass;class qn extends Ui{get kind(){return"MathChoice"}get arity(){return 4}get notParent(){return!0}setInheritedAttributes(t,e,s,i){const n=e?0:Math.max(0,Math.min(s,2))+1,r=this.childNodes[n]||this.factory.create("mrow");this.parent.replaceChild(r,this),r.setInheritedAttributes(t,e,s,i)}}qn.defaults=Object.assign({},Ui.defaults);class Xn extends Vi{get kind(){return"html"}getHTML(){return this.getXML()}setHTML(t,e=null){try{e.getAttribute(t,"data-mjx-hdw")}catch(s){t=e.node("span",{},[t])}return this.setXML(t,e)}getSerializedHTML(){return this.adaptor.outerHTML(this.xml)}textContent(){return this.adaptor.textContent(this.xml)}toString(){const t=this.adaptor.kind(this.xml);return`HTML=<${t}>...</${t}>`}verifyTree(t){!this.parent||this.parent.isToken||this.mError("HTML can only be a child of a token element",t,!0)}}const zn={[qi.prototype.kind]:qi,[Xi.prototype.kind]:Xi,[zi.prototype.kind]:zi,[ln.prototype.kind]:ln,[hn.prototype.kind]:hn,[cn.prototype.kind]:cn,[dn.prototype.kind]:dn,[un.prototype.kind]:un,[pn.prototype.kind]:pn,[mn.prototype.kind]:mn,[fn.prototype.kind]:fn,[gn.prototype.kind]:gn,[bn.prototype.kind]:bn,[En.prototype.kind]:En,[xn.prototype.kind]:xn,[yn.prototype.kind]:yn,[Nn.prototype.kind]:Nn,[Tn.prototype.kind]:Tn,[vn.prototype.kind]:vn,[Cn.prototype.kind]:Cn,[Rn.prototype.kind]:Rn,[Ln.prototype.kind]:Ln,[Sn.prototype.kind]:Sn,[An.prototype.kind]:An,[In.prototype.kind]:In,[wn.prototype.kind]:wn,[On.prototype.kind]:On,[Mn.prototype.kind]:Mn,[Dn.prototype.kind]:Dn,[Pn.prototype.kind]:Pn,[kn.prototype.kind]:kn,[Bn.prototype.kind]:Bn,[jn.prototype.kind]:jn,[_n.prototype.kind]:_n,[Fn.prototype.kind]:Fn,[Un.prototype.kind]:Un,[Wn.prototype.kind]:Wn,[Hn.prototype.kind]:Hn,[Vn.prototype.kind]:Vn,[qn.prototype.kind]:qn,[Wi.prototype.kind]:Wi,[Vi.prototype.kind]:Vi,[Xn.prototype.kind]:Xn};class Gn extends Ri{get MML(){return this.node}}Gn.defaultNodes=zn;class Jn{constructor(){this.bits=0}static allocate(...t){for(const e of t){if(this.has(e))throw new Error("Bit already allocated for "+e);if(this.next===Jn.MAXBIT)throw new Error("Maximum number of bits already allocated");this.names.set(e,this.next),this.next<<=1}}static has(t){return this.names.has(t)}set(t){this.bits|=this.getBit(t)}clear(t){this.bits&=~this.getBit(t)}isSet(t){return!!(this.bits&this.getBit(t))}reset(){this.bits=0}getBit(t){const e=this.constructor.names.get(t);if(!e)throw new Error("Unknown bit-field name: "+t);return e}}function Kn(...t){const e=class extends Jn{};return e.allocate(...t),e}function $n(t){return new Promise(function e(s,i){const n=t=>{var n;t.retry instanceof Promise?t.retry.then(()=>e(s,i)).catch(t=>i(t)):(null===(n=t.restart)||void 0===n?void 0:n.isCallback)?MathJax.Callback.After(()=>e(s,i),t.restart):i(t)};try{const e=t();e instanceof Promise?e.then(t=>s(t)).catch(t=>n(t)):s(e)}catch(t){n(t)}})}function Yn(t){const e=new Error("MathJax retry -- an asynchronous action is required; try using one of the promise-based functions and await its resolution.");throw e.retry=t,e}Jn.MAXBIT=1<<31,Jn.next=1,Jn.names=new Map;var Qn=function(t,e,s,i){return new(s||(s=Promise))(function(n,r){function o(t){try{l(i.next(t))}catch(t){r(t)}}function a(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})};class Zn extends Ms{static create(t){const e=new this;for(const s of Object.keys(t)){const[i,n]=this.action(s,t[s]);n&&e.add(i,n)}return e}static action(t,e){let s,i,n=!0;const r=e[0];if(1===e.length||"boolean"==typeof e[1])2===e.length&&(n=e[1]),[s,i]=this.methodActions(t);else if("string"==typeof e[1])if("string"==typeof e[2]){4===e.length&&(n=e[3]);const[t,r]=e.slice(1);[s,i]=this.methodActions(t,r)}else 3===e.length&&(n=e[2]),[s,i]=this.methodActions(e[1]);else 4===e.length&&(n=e[3]),[s,i]=e.slice(1);return[{id:t,renderDoc:s,renderMath:i,convert:n},r]}static methodActions(t,e=t){return[e=>(t&&e[t](),!1),(t,s)=>(e&&t[e](s),!1)]}renderDoc(t,e=vi.UNPROCESSED){for(const s of this.items)if(s.priority>=e&&s.item.renderDoc(t))return}renderMath(t,e,s=vi.UNPROCESSED){for(const i of this.items)if(i.priority>=s&&i.item.renderMath(t,e))return}renderConvert(t,e,s=vi.LAST){for(const i of this.items){if(i.priority>s)return;if(i.item.convert&&i.item.renderMath(t,e))return}}findID(t){for(const e of this.items)if(e.item.id===t)return e.item;return null}}const tr={all:!1,processed:!1,inputJax:null,outputJax:null},er={all:!0,processed:!0,inputJax:[],outputJax:[]};class sr extends fi{compile(t){return null}}class ir extends gi{typeset(t,e=null){return null}escaped(t,e){return null}}class nr extends yi{}class rr{constructor(t,e,s){const i=this.constructor;this.document=t,this.options=Zs(Qs({},i.OPTIONS),s),this.math=new(this.options.MathList||nr),this.renderActions=Zn.create(this.options.renderActions),this._actionPromises=[],this._readyPromise=Promise.resolve(),this.processed=new rr.ProcessBits,this.outputJax=this.options.OutputJax||new ir;let n=this.options.InputJax||[new sr];Array.isArray(n)||(n=[n]),this.inputJax=n,this.adaptor=e,this.outputJax.setAdaptor(e),this.inputJax.map(t=>t.setAdaptor(e)),this.mmlFactory=this.options.MmlFactory||new Gn,this.inputJax.map(t=>t.setMmlFactory(this.mmlFactory)),this.outputJax.initialize(),this.inputJax.map(t=>t.initialize())}get kind(){return this.constructor.KIND}addRenderAction(t,...e){const[s,i]=Zn.action(t,e);this.renderActions.add(s,i)}removeRenderAction(t){const e=this.renderActions.findID(t);e&&this.renderActions.remove(e)}render(){return this.clearPromises(),this.renderActions.renderDoc(this),this}renderPromise(){return this.whenReady(()=>$n(()=>Qn(this,void 0,void 0,function*(){return this.render(),yield this.actionPromises(),this.clearPromises(),this})))}rerender(t=vi.RERENDER){return this.state(t-1),this.render(),this}rerenderPromise(t=vi.RERENDER){return this.whenReady(()=>$n(()=>Qn(this,void 0,void 0,function*(){return this.rerender(t),yield this.actionPromises(),this.clearPromises(),this})))}convert(t,e={}){let{format:s,display:i,end:n,ex:r,em:o,containerWidth:a,scale:l,family:h}=Zs({format:this.inputJax[0].name,display:!0,end:vi.LAST,em:16,ex:8,containerWidth:null,scale:1,family:""},e);null===a&&(a=80*r);const c=this.inputJax.reduce((t,e)=>e.name===s?e:t,null),d=new this.options.MathItem(t,c,i);return d.start.node=this.adaptor.body(this.document),d.setMetrics(o,r,a,l),h&&this.outputJax.options.mtextInheritFont&&(d.outputData.mtextFamily=h),h&&this.outputJax.options.merrorInheritFont&&(d.outputData.merrorFamily=h),this.clearPromises(),d.convert(this,n),d.typesetRoot||d.root}convertPromise(t,e={}){return this.whenReady(()=>$n(()=>Qn(this,void 0,void 0,function*(){const s=this.convert(t,e);return yield this.actionPromises(),this.clearPromises(),s})))}whenReady(t){return this._readyPromise=this._readyPromise.catch(t=>{}).then(()=>{const e=this._readyPromise;this._readyPromise=Promise.resolve();const s=t(),i=this._readyPromise.then(()=>s);return this._readyPromise=e,i})}actionPromises(){return Promise.all(this._actionPromises)}clearPromises(){this._actionPromises=[]}savePromise(t){this._actionPromises.push(t)}findMath(t=null){return this.processed.set("findMath"),this}compile(){if(!this.processed.isSet("compile")){const t=[];for(const e of this.math)this.compileMath(e),void 0!==e.inputData.recompile&&t.push(e);for(const e of t){const t=e.inputData.recompile;e.state(t.state),e.inputData.recompile=t,this.compileMath(e)}this.processed.set("compile")}return this}compileMath(t){try{t.compile(this)}catch(e){if(e.retry||e.restart)throw e;this.options.compileError(this,t,e),t.inputData.error=e}}compileError(t,e){t.root=this.mmlFactory.create("math",null,[this.mmlFactory.create("merror",{"data-mjx-error":e.message,title:e.message},[this.mmlFactory.create("mtext",null,[this.mmlFactory.create("text").setText("Math input error")])])]),t.display&&t.root.attributes.set("display","block"),t.inputData.error=e.message}typeset(){if(!this.processed.isSet("typeset")){for(const t of this.math)try{t.typeset(this)}catch(e){if(e.retry||e.restart)throw e;this.options.typesetError(this,t,e),t.outputData.error=e}this.processed.set("typeset")}return this}typesetError(t,e){t.typesetRoot=this.adaptor.node("mjx-container",{class:"MathJax mjx-output-error",jax:this.outputJax.name},[this.adaptor.node("span",{"data-mjx-error":e.message,title:e.message,style:{color:"red","background-color":"yellow","line-height":"normal"}},[this.adaptor.text("Math output error")])]),t.display&&this.adaptor.setAttributes(t.typesetRoot,{style:{display:"block",margin:"1em 0","text-align":"center"}}),t.outputData.error=e.message}getMetrics(){return this.processed.isSet("getMetrics")||(this.outputJax.getMetrics(this),this.processed.set("getMetrics")),this}updateDocument(){if(!this.processed.isSet("updateDocument")){for(const t of this.math.reversed())t.updateDocument(this);this.processed.set("updateDocument")}return this}removeFromDocument(t=!1){return this}state(t,e=!1){for(const s of this.math)s.state(t,e);return t<vi.INSERTED&&this.processed.clear("updateDocument"),t<vi.TYPESET&&(this.processed.clear("typeset"),this.processed.clear("getMetrics")),t<vi.COMPILED&&this.processed.clear("compile"),t<vi.FINDMATH&&this.processed.clear("findMath"),this}reset(t={processed:!0}){return(t=Zs(Object.assign({},tr),t)).all&&Object.assign(t,er),t.processed&&this.processed.reset(),t.inputJax&&this.inputJax.forEach(e=>e.reset(...t.inputJax)),t.outputJax&&this.outputJax.reset(...t.outputJax),this}clear(){return this.reset(),this.math.clear(),this}done(){return Promise.resolve()}concat(t){return this.math.merge(t),this}clearMathItemsWithin(t){const e=this.getMathItemsWithin(t);for(const t of e.slice(0).reverse())t.clear();return this.math.remove(...e),e}getMathItemsWithin(t){Array.isArray(t)||(t=[t]);const e=this.adaptor,s=[],i=e.getElements(t,this.document);t:for(const t of this.math)for(const n of i)if(t.start.node&&e.contains(n,t.start.node)){s.push(t);continue t}return s}}rr.KIND="MathDocument",rr.OPTIONS={OutputJax:null,InputJax:null,MmlFactory:null,MathList:nr,MathItem:class extends Ti{},compileError:(t,e,s)=>{t.compileError(e,s)},typesetError:(t,e,s)=>{t.typesetError(e,s)},renderActions:Gs({find:[vi.FINDMATH,"findMath","",!1],compile:[vi.COMPILED],metrics:[vi.METRICS,"getMetrics","",!1],typeset:[vi.TYPESET],update:[vi.INSERTED,"updateDocument",!1]})},rr.ProcessBits=Kn("findMath","compile","getMetrics","typeset","updateDocument");class or extends rr{}class ar{constructor(t,e=5){this.documentClass=or,this.adaptor=t,this.priority=e}get name(){return this.constructor.NAME}handlesDocument(t){return!1}create(t,e){return new this.documentClass(t,this.adaptor,e)}}ar.NAME="generic";class lr extends Ms{register(t){return this.add(t,t.priority)}unregister(t){this.remove(t)}handlesDocument(t){for(const e of this){const s=e.item;if(s.handlesDocument(t))return s}throw new Error("Can't find handler for document")}document(t,e=null){return this.handlesDocument(t).create(t,e)}}class hr{static methodName(t){return"visit"+(t.charAt(0).toUpperCase()+t.substring(1)).replace(/[^a-z0-9_]/gi,"_")+"Node"}constructor(t){this.nodeHandlers=new Map;for(const e of t.getKinds()){const t=this[hr.methodName(e)];t&&this.nodeHandlers.set(e,t)}}visitTree(t,...e){return this.visitNode(t,...e)}visitNode(t,...e){return(this.nodeHandlers.get(t.kind)||this.visitDefault).call(this,t,...e)}visitDefault(t,...e){if("childNodes"in t)for(const s of t.childNodes)this.visitNode(s,...e)}setNodeHandler(t,e){this.nodeHandlers.set(t,e)}removeNodeHandler(t){this.nodeHandlers.delete(t)}}const cr="data-mjx-";class dr extends hr{constructor(t=null){t||(t=new Gn),super(t)}visitTextNode(t,...e){}visitXMLNode(t,...e){}visitHtmlNode(t,...e){}getKind(t){const e=t.kind;return ii(e,this.constructor.rename,e)}getAttributeList(t){const e=this.constructor,s=ii(t.kind,e.defaultAttributes,{}),i=Object.assign({},s,this.getDataAttributes(t),t.attributes.getAllAttributes()),n=e.variants;return Object.hasOwn(i,"mathvariant")&&(Object.hasOwn(n,i.mathvariant)?i.mathvariant=n[i.mathvariant]:t.getProperty("ignore-variant")&&delete i.mathvariant),i}getDataAttributes(t){const e={},s=t.attributes.getExplicit("mathvariant"),i=this.constructor.variants;s&&(t.getProperty("ignore-variant")||Object.hasOwn(i,s))&&this.setDataAttribute(e,"variant",s),t.getProperty("variantForm")&&this.setDataAttribute(e,"alternate","1"),t.getProperty("pseudoscript")&&this.setDataAttribute(e,"pseudoscript","true"),!1===t.getProperty("autoOP")&&this.setDataAttribute(e,"auto-op","false");const n=t.getProperty("vbox");n&&this.setDataAttribute(e,"vbox",n);const r=t.getProperty("scriptalign");r&&this.setDataAttribute(e,"script-align",r);const o=t.getProperty("mathaccent");void 0!==o&&(o&&!t.isMathAccent()||!o&&!t.isMathAccentWithWidth())&&this.setDataAttribute(e,"mathaccent",o.toString());const a=t.getProperty("texClass");if(void 0!==a){let s=!0;if(a===Oi.OP&&t.isKind("mi")){const e=t.getText();s=!(e.length>1&&e.match(Xi.operatorName))}s&&this.setDataAttribute(e,"texclass",a<0?"NONE":Mi[a])}return t.getProperty("smallmatrix")&&this.setDataAttribute(e,"smallmatrix","true"),e}setDataAttribute(t,e,s){t[cr+e]=s}}dr.rename={TeXAtom:"mrow"},dr.variants={"-tex-calligraphic":"script","-tex-bold-calligraphic":"bold-script","-tex-oldstyle":"normal","-tex-bold-oldstyle":"bold","-tex-mathit":"italic"},dr.defaultAttributes={math:{xmlns:"http://www.w3.org/1998/Math/MathML"}};class ur extends dr{constructor(){super(...arguments),this.document=null}visitTree(t,e){this.document=e;const s=e.createElement("top");return this.visitNode(t,s),this.document=null,s.firstChild}visitTextNode(t,e){e.appendChild(this.document.createTextNode(t.getText()))}visitXMLNode(t,e){e.appendChild(t.getXML().cloneNode(!0))}visitHtmlNode(t,e){e.appendChild(t.getHTML().cloneNode(!0))}visitInferredMrowNode(t,e){for(const s of t.childNodes)this.visitNode(s,e)}visitDefault(t,e){const s=this.document.createElement(this.getKind(t));this.addAttributes(t,s);for(const e of t.childNodes)this.visitNode(e,s);e.appendChild(s)}addAttributes(t,e){const s=this.getAttributeList(t);for(const t of Object.keys(s))e.setAttribute(t,s[t].toString())}}class pr extends dr{visitTree(t){return this.visitNode(t,"")}visitTextNode(t,e){return this.quoteHTML(t.getText())}visitXMLNode(t,e){return e+t.getSerializedXML()}visitHtmlNode(t,e){return t.getSerializedHTML()}visitInferredMrowNode(t,e){const s=[];for(const i of t.childNodes)s.push(this.visitNode(i,e));return s.join("\n")}visitAnnotationNode(t,e){const s=this.childNodeMml(t,"","");return`${e}<annotation${this.getAttributes(t)}>${s}</annotation>`}visitDefault(t,e){const s=this.getKind(t),[i,n]=t.isToken||0===t.childNodes.length?["",""]:["\n",e],r=this.childNodeMml(t,e+" ",i),o=r.match(/\S/)?i+r+n:"";return`${e}<${s}${this.getAttributes(t)}>${o}</${s}>`}childNodeMml(t,e,s){let i="";for(const n of t.childNodes)i+=this.visitNode(n,e)+s;return i}getAttributes(t){const e=[],s=this.getAttributeList(t);for(const t of Object.keys(s)){const i=String(s[t]);void 0!==i&&e.push(t+'="'+this.quoteHTML(i)+'"')}return e.length?" "+e.join(" "):""}quoteHTML(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/[\uD800-\uDBFF]./g,this.toEntity).replace(/[\u0080-\uD7FF\uE000-\uFFFF]/g,this.toEntity)}toEntity(t){return an(t)}}class mr{get kind(){return this.node.kind}constructor(t,e){this.factory=t,this.node=e}wrap(t){return this.factory.wrap(t)}walkTree(t,e){if(t(this,e),"childNodes"in this)for(const s of this.childNodes)s&&s.walkTree(t,e);return e}}class fr extends Ci{wrap(t,...e){return this.create(t.kind,t,...e)}}const gr={version:xs,context:As,handlers:new lr,document:function(t,e){return gr.handlers.document(t,e)},handleRetriesFor:$n,retryAfter:Yn,asyncLoad:null,asyncIsSynchronous:!1};class br extends Ti{get adaptor(){return this.inputJax.adaptor}constructor(t,e,s=!0,i={node:null,n:0,delim:""},n={node:null,n:0,delim:""}){super(t,e,s,i,n)}updateDocument(t){if(this.state()<vi.INSERTED){if(this.inputJax.processStrings){let t=this.start.node;if(t===this.end.node)this.end.n&&this.end.n<this.adaptor.value(this.end.node).length&&this.adaptor.split(this.end.node,this.end.n),this.start.n&&(t=this.adaptor.split(this.start.node,this.start.n)),this.adaptor.parent(t)&&this.adaptor.replace(this.typesetRoot,t);else{for(this.start.n&&(t=this.adaptor.split(t,this.start.n));t!==this.end.node;){const e=this.adaptor.next(t);this.adaptor.remove(t),t=e}this.adaptor.insert(this.typesetRoot,t),this.end.n<this.adaptor.value(t).length&&this.adaptor.split(t,this.end.n),this.adaptor.remove(t)}}else this.adaptor.replace(this.typesetRoot,this.start.node);this.start.node=this.end.node=this.typesetRoot,this.start.n=this.end.n=0,this.state(vi.INSERTED)}}updateStyleSheet(t){t.addStyleSheet()}removeFromDocument(t=!1){if(super.removeFromDocument(t),this.state()>=vi.TYPESET){const e=this.adaptor,s=this.start.node;let i=e.text("");if(t){const t=this.start.delim+this.math+this.end.delim;if(this.inputJax.processStrings)i=e.text(t);else{const s=e.parse(t,"text/html");i=e.firstChild(e.body(s))}}e.parent(s)&&e.replace(i,s),this.start.node=this.end.node=i,this.start.n=this.end.n=0}}}class Er extends yi{}class xr{constructor(t=null){const e=this.constructor;this.options=Zs(Qs({},e.OPTIONS),t),this.init(),this.getPatterns()}init(){this.strings=[],this.string="",this.snodes=[],this.nodes=[],this.stack=[]}getPatterns(){const t=Js(this.options.skipHtmlTags),e=Js(this.options.ignoreHtmlClass),s=Js(this.options.processHtmlClass);this.skipHtmlTags=new RegExp("^(?:"+t.join("|")+")$","i"),this.ignoreHtmlClass=new RegExp("(?:^| )(?:"+e.join("|")+")(?: |$)"),this.processHtmlClass=new RegExp("(?:^| )(?:"+s+")(?: |$)")}pushString(){this.string.match(/\S/)&&(this.strings.push(this.string),this.nodes.push(this.snodes)),this.string="",this.snodes=[]}extendString(t,e){this.snodes.push([t,e.length]),this.string+=e}handleText(t,e){return e||this.extendString(t,this.adaptor.value(t)),this.adaptor.next(t)}handleTag(t,e){if(!e){const e=this.options.includeHtmlTags[this.adaptor.kind(t)];e instanceof Function?this.extendString(t,e(t,this.adaptor)):this.extendString(t,e)}return this.adaptor.next(t)}handleContainer(t,e){this.pushString();const s=this.adaptor.getAttribute(t,"class")||"",i=this.adaptor.kind(t)||"",n=this.processHtmlClass.exec(s);let r=t;return!this.adaptor.firstChild(t)||this.adaptor.getAttribute(t,"data-MJX")||!n&&this.skipHtmlTags.exec(i)?r=this.adaptor.next(t):(this.adaptor.next(t)&&this.stack.push([this.adaptor.next(t),e]),r=this.adaptor.firstChild(t),e=(e||this.ignoreHtmlClass.exec(s))&&!n),[r,e]}handleOther(t,e){return this.pushString(),this.adaptor.next(t)}find(t){this.init();const e=this.adaptor.next(t);let s=!1;const i=this.options.includeHtmlTags;for(;t&&t!==e;){const e=this.adaptor.kind(t);"#text"===e?t=this.handleText(t,s):Object.hasOwn(i,e)?t=this.handleTag(t,s):e?[t,s]=this.handleContainer(t,s):t=this.handleOther(t,s),!t&&this.stack.length&&(this.pushString(),[t,s]=this.stack.pop())}this.pushString();const n=[this.strings,this.nodes];return this.init(),n}}xr.OPTIONS={skipHtmlTags:["script","noscript","style","textarea","pre","code","math","select","option","mjx-container"],includeHtmlTags:Gs({br:"\n",wbr:"","#comment":""}),ignoreHtmlClass:"mathjax_ignore",processHtmlClass:"mathjax_process"},Li("STYLES",vi.INSERTED+1);class yr extends rr{constructor(t,e,s){const[i,n]=si(s,xr.OPTIONS);super(t,e,i),this.domStrings=this.options.DomStrings||new xr(n),this.domStrings.adaptor=e,this.styles=[]}findPosition(t,e,s,i){const n=this.adaptor,r=1/(i[t].length||1);let o=t;for(const[a,l]of i[t]){if(e<=l&&"#text"===n.kind(a))return{i:o,node:a,n:Math.max(e,0),delim:s};e-=l,o+=r}return{node:null,n:0,delim:s}}mathItem(t,e,s){const i=t.math,n=this.findPosition(t.n,t.start.n,t.open,s),r=this.findPosition(t.n,t.end.n,t.close,s);return new this.options.MathItem(i,e,t.display,n,r)}findMath(t){if(!this.processed.isSet("findMath")){this.adaptor.document=this.document,t=Zs({elements:this.options.elements||[this.adaptor.body(this.document)]},t);const e=this.adaptor.getElements(t.elements,this.document);for(const t of this.inputJax){const s=t.processStrings?this.findMathFromStrings(t,e):this.findMathFromDOM(t,e);this.math.merge(s)}this.processed.set("findMath")}return this}findMathFromStrings(t,e){const s=[],i=[];for(const t of e){const[e,n]=this.domStrings.find(t);s.push(...e),i.push(...n)}const n=new this.options.MathList;for(const e of t.findMath(s))n.push(this.mathItem(e,t,i));return n}findMathFromDOM(t,e){const s=[];for(const i of e)for(const e of t.findMath(i))s.push(new this.options.MathItem(e.math,t,e.display,e.start,e.end));return new this.options.MathList(...s)}updateDocument(){return this.processed.isSet("updateDocument")||(this.addPageElements(),this.addStyleSheet(),super.updateDocument(),this.processed.set("updateDocument")),this}addPageElements(){const t=this.adaptor,e=t.body(this.document),s=this.documentPageElements();if(s){const i=t.firstChild(e);i?t.insert(s,i):t.append(e,s)}}addStyleSheet(){const t=this.documentStyleSheet(),e=this.adaptor;if(t&&!e.parent(t)){const s=e.head(this.document),i=this.findSheet(s,e.getAttribute(t,"id"));i?e.replace(t,i):e.append(s,t)}}findSheet(t,e){if(e)for(const s of this.adaptor.tags(t,"style"))if(this.adaptor.getAttribute(s,"id")===e)return s;return null}removeFromDocument(t=!1){if(this.processed.isSet("updateDocument"))for(const e of this.math)e.state()>=vi.INSERTED&&e.state(vi.TYPESET,t);return this.processed.clear("updateDocument"),this}documentStyleSheet(){return this.outputJax.styleSheet(this)}documentPageElements(){return this.outputJax.pageElements(this)}addStyles(t){this.styles.push(t),"insertStyles"in this.outputJax&&this.outputJax.insertStyles(t)}getStyles(){return this.styles}}yr.KIND="HTML",yr.OPTIONS=Object.assign(Object.assign({},rr.OPTIONS),{renderActions:Gs(Object.assign(Object.assign({},rr.OPTIONS.renderActions),{styles:[vi.STYLES,"","updateStyleSheet",!1]})),MathList:Er,MathItem:br,DomStrings:null});class Nr extends ar{constructor(){super(...arguments),this.documentClass=yr}handlesDocument(t){const e=this.adaptor;if("string"==typeof t)try{t=e.parse(t,"text/html")}catch(t){}return t instanceof e.window.Document||t instanceof e.window.HTMLElement||t instanceof e.window.DocumentFragment}create(t,e){const s=this.adaptor;if("string"==typeof t)t=s.parse(t,"text/html");else if(t instanceof s.window.HTMLElement||t instanceof s.window.DocumentFragment){const e=t;t=s.parse("","text/html"),s.append(s.body(t),e)}return super.create(t,e)}}function Tr(t){const e=new Nr(t);return gr.handlers.register(e),e}class vr{get cssText(){return this.getStyleString()}constructor(t=null){this.styles={},this.addStyles(t)}addStyles(t){if(t)for(const e of Object.keys(t))this.styles[e]||(this.styles[e]={}),Object.assign(this.styles[e],t[e])}removeStyles(...t){for(const e of t)delete this.styles[e]}clear(){this.styles={}}getStyleString(){return this.getStyleRules().join("\n\n")}getStyleRules(t=this.styles,e=""){const s=Object.keys(t),i=new Array(s.length);let n=0;for(const r of s){const s=t[r];i[n++]=`${e}${r} {\n${this.getStyleDefString(s,e)}\n${e}}`}return i}getStyleDefString(t,e){const s=Object.keys(t),i=new Array(s.length);let n=0;for(const r of s)i[n++]=t[r]instanceof Object?e+this.getStyleRules({[r]:t[r]},e+" ").join("\n"+e):" "+e+r+": "+t[r]+";";return i.join("\n"+e)}}var Lr;const Cr=!!(null===(Lr=As.window)||void 0===Lr?void 0:Lr.HTMLDialogElement);class Rr{constructor(t){this.minW=200,this.minH=80,this.tx=0,this.ty=0,this.dragging=!1,this.events=[["mousemove",this.MouseMove.bind(this)],["mouseup",this.MouseUp.bind(this)]],this.mode="",this.actions={down:{move:t=>{t.dialog.classList.add("mjx-moving")}},move:{move:(t,e)=>[e.x-t.x,e.y-t.y,0,0],top:(t,e)=>[0,(e.y-t.y)/2,0,t.y-e.y],bottom:(t,e)=>[0,(e.y-t.y)/2,0,e.y-t.y],left:(t,e)=>[(e.x-t.x)/2,0,t.x-e.x,0],right:(t,e)=>[(e.x-t.x)/2,0,e.x-t.x,0],topleft:(t,e)=>[(e.x-t.x)/2,(e.y-t.y)/2,t.x-e.x,t.y-e.y],topright:(t,e)=>[(e.x-t.x)/2,(e.y-t.y)/2,e.x-t.x,t.y-e.y],botleft:(t,e)=>[(e.x-t.x)/2,(e.y-t.y)/2,t.x-e.x,e.y-t.y],botright:(t,e)=>[(e.x-t.x)/2,(e.y-t.y)/2,e.x-t.x,e.y-t.y]},up:{move:t=>{t.dialog.classList.remove("mjx-moving")}},keymove:{left:()=>[-5,0,0,0],right:()=>[5,0,0,0],up:()=>[0,-5,0,0],down:()=>[0,5,0,0]},bigmove:{left:()=>[-20,0,0,0],right:()=>[20,0,0,0],up:()=>[0,-20,0,0],down:()=>[0,20,0,0]},keysize:{left:()=>[-3,0,-6,0],right:()=>[3,0,6,0],up:()=>[0,-3,0,-6],down:()=>[0,3,0,6]},bigsize:{left:()=>[-10,0,-20,0],right:()=>[10,0,20,0],up:()=>[0,-10,0,-20],down:()=>[0,10,0,20]}};const{adaptor:e,node:s=null}=t;this.init(e),this.node=s,this.background=Cr?null:e.node("mjx-dialog-background"),this.x=this.y=0,this.dragging=!1,this.action="",this.dialog=this.html(t),this.title=this.dialog.firstChild.firstChild.firstChild,this.content=this.dialog.firstChild.firstChild.nextSibling;const i=this.dialog.lastChild;i.addEventListener("click",this.closeDialog.bind(this)),i.addEventListener("keydown",this.actionKey.bind(this,this.closeDialog.bind(this)));const n=this.dialog.lastChild.previousSibling;n.addEventListener("click",this.helpDialog.bind(this,e)),n.addEventListener("keydown",this.actionKey.bind(this,this.helpDialog.bind(this,e))),this.noDrag=Array.from(this.dialog.querySelectorAll('[data-drag="none"]'))}init(t){const e=this.constructor;if(!t.document.head.querySelector("#"+e.styleId)){const s=t.node("style",{id:e.styleId});s.textContent=new vr(e.styles).cssText,t.document.head.append(s)}}html(t){const{title:e,message:s,adaptor:i,styles:n=null,extraNodes:r=[],className:o=Rr.className}=t;if(n){const t=i.node("style");t.textContent=new vr(n).cssText,r.unshift(t)}const a="mjx-dialog-label-"+Rr.id++,l=i.node("dialog",{closedby:"any",class:("mjx-dialog "+o).trim()},[i.node("mjx-dialog",{"aria-labeledby":a},[i.node("mjx-title",{},[i.node("h1",{id:a,tabIndex:0})]),i.node("div",{"data-drag":"none",tabIndex:0})]),...r,i.node("mjx-dialog-spacer",{"aria-hidden":!0}),i.node("mjx-dialog-drag",{"data-drag":"top","aria-hidden":!0}),i.node("mjx-dialog-drag",{"data-drag":"bottom","aria-hidden":!0}),i.node("mjx-dialog-drag",{"data-drag":"left","aria-hidden":!0}),i.node("mjx-dialog-drag",{"data-drag":"right","aria-hidden":!0}),i.node("mjx-dialog-drag",{"data-drag":"topleft","aria-hidden":!0}),i.node("mjx-dialog-drag",{"data-drag":"topright","aria-hidden":!0}),i.node("mjx-dialog-drag",{"data-drag":"botleft","aria-hidden":!0}),i.node("mjx-dialog-drag",{"data-drag":"botright","aria-hidden":!0}),i.node("mjx-dialog-help",{class:"mjx-dialog-button","data-drag":"none",tabIndex:0,role:"button","aria-label":"Dialog Help"},[i.node("mjx-dialog-icon",{"aria-hidden":!0},[i.text("?")])]),i.node("mjx-dialog-close",{class:"mjx-dialog-button","data-drag":"none",tabIndex:0,role:"button","aria-label":"Close Dialog Box"},[i.node("mjx-dialog-icon",{"aria-hidden":!0},[i.text("\xd7")])])]);return l.firstChild.firstChild.firstChild.innerHTML=e,l.firstChild.childNodes[1].innerHTML=s,l}attach(){Cr?(this.dialog.addEventListener("mousedown",this.MouseDown.bind(this)),this.dialog.addEventListener("keydown",this.KeyDown.bind(this),!0),document.body.append(this.dialog),this.dialog.showModal()):(this.background.addEventListener("mousedown",this.MouseDown.bind(this)),this.background.addEventListener("keydown",this.KeyDown.bind(this),!0),this.dialog.setAttribute("tabindex","0"),this.dialog.addEventListener("click",this.stop),this.background.append(this.dialog),document.body.append(this.background)),As.window.addEventListener("visibilitychange",this.Visibility.bind(this)),this.minW=Math.min(this.minW,this.dialog.clientWidth-8),this.minH=Math.min(this.minH,this.dialog.clientHeight-this.title.offsetHeight-8),this.title.focus()}dragAction(t,e=null){e&&this.stop(e);const s=this.actions[t][this.action],i=s?s(this,e):null;if(!i)return;let[n,r,o,a]=i;if(o){const t=this.w+o;t>=this.minW?(this.x=null==e?void 0:e.x,this.w=t,this.dialog.style.maxWidth=this.dialog.style.width=t+"px"):n=0}if(a){const t=this.h+a;t>=this.minH+this.title.offsetHeight?(this.y=null==e?void 0:e.y,this.h=t,this.dialog.style.maxHeight=this.dialog.style.height=t+"px"):r=0}(n||r)&&(n&&(this.x=null==e?void 0:e.x,this.tx+=n||0),r&&(this.y=null==e?void 0:e.y,this.ty+=r||0),this.dialog.style.transform=`translate(${this.tx}px, ${this.ty}px)`)}MouseDown(t){const e=t.target;if(!(1!==t.buttons||t.shiftKey||t.metaKey||t.altKey||t.ctrlKey))if(this.inDialog(t)){for(const t of this.noDrag)if(e===t||t.contains(e))return;this.action=e.getAttribute("data-drag")||"move",this.startDrag(t),this.dragAction("down",t)}else this.closeDialog(t)}MouseMove(t){1!==t.buttons&&this.endDrag(),this.dragging&&this.dragAction("move",t)}MouseUp(t){this.dragging&&(this.dragAction("up",t),this.endDrag())}Visibility(){As.document.hidden&&this.closeDialog()}KeyDown(t){const e=this.constructor.keyActions.get(t.key);e&&e(this,t)}escKey(t){this.closeDialog(t)}aKey(t){(t.ctrlKey||t.metaKey)&&(this.selectAll(),this.stop(t))}mKey(t){this.mode="move"===this.mode?"":"move",this.stop(t)}sKey(t){this.mode="size"===this.mode?"":"size",this.stop(t)}arrowKey(t,e){t.ctrlKey||this.dragging||(this.action=e,this.getWH(),t.altKey||"move"===this.mode?(this.dragAction(t.shiftKey?"bigmove":"keymove"),this.stop(t)):(t.metaKey||"size"===this.mode)&&(this.dragAction(t.shiftKey?"bigsize":"keysize"),this.stop(t)),this.action="")}actionKey(t,e){"Enter"!==e.code&&"Space"!==e.code||t(e)}selectAll(){document.getSelection().selectAllChildren(this.content)}copyToClipboard(){this.selectAll();try{document.execCommand("copy")}catch(t){alert(`Can't copy to clipboard: ${t.message}`)}document.getSelection().removeAllRanges()}startDrag(t){this.x=t.x,this.y=t.y,this.getWH(),this.dragging=!0;const e=this.background||this.dialog;for(const[t,s]of this.events)e.addEventListener(t,s)}getWH(){this.w=this.dialog.clientWidth-8,this.h=this.dialog.clientHeight-8}endDrag(){this.action="",this.dragging=!1;const t=this.background||this.dialog;for(const[e,s]of this.events)t.removeEventListener(e,s)}closeDialog(t){var e;Cr?(this.dialog.close(),this.dialog.remove()):this.background.remove(),null===(e=this.node)||void 0===e||e.focus(),t&&this.stop(t)}helpDialog(t,e){new Rr({title:"MathJax Dialog Help",message:this.constructor.helpMessage,adaptor:t,className:"mjx-dialog-help",styles:{".mjx-dialog-help":{"max-width":"calc(min(50em, 80%))"}}}).attach(),this.stop(e)}inDialog(t){if(!this.dialog.contains(t.target))return!1;const{x:e,y:s}=t,{left:i,right:n,top:r,bottom:o}=this.dialog.getBoundingClientRect();return e>=i&&e<=n&&s>=r&&s<=o}stop(t){t.preventDefault&&t.preventDefault(),t.stopImmediatePropagation?t.stopImmediatePropagation():t.stopPropagation&&t.stopPropagation()}}Rr.keyActions=new Map([["Escape",(t,e)=>t.escKey(e)],["a",(t,e)=>t.aKey(e)],["m",(t,e)=>t.mKey(e)],["s",(t,e)=>t.sKey(e)],["ArrowRight",(t,e)=>t.arrowKey(e,"right")],["ArrowLeft",(t,e)=>t.arrowKey(e,"left")],["ArrowUp",(t,e)=>t.arrowKey(e,"up")],["ArrowDown",(t,e)=>t.arrowKey(e,"down")]]),Rr.styleId="MJX-DIALOG-styles",Rr.className="",Rr.id=0,Rr.styles={"mjx-dialog-background":{display:"flex","flex-direction":"column","justify-content":"center",position:"fixed",top:0,left:0,right:0,bottom:0,"z-index":1001},".mjx-dialog":{"max-width":"calc(min(60em, 90%))","max-height":"calc(min(50em, 85%))",border:"3px outset","border-radius":"15px",color:"black","background-color":"#DDDDDD","box-shadow":"0px 10px 20px #808080",padding:"4px 4px",cursor:"grab",overflow:"visible",display:"flex","flex-direction":"column","align-items":"center",position:"fixed",top:"-4%"},".mjx-dialog *":{"box-sizing":"content-box"},".mjx-dialog.mjx-moving":{cursor:"grabbing"},'.mjx-dialog > input[type="button"]':{width:"fit-content"},".mjx-dialog > mjx-dialog-spacer":{display:"block",height:".75em","flex-shrink":0},".mjx-dialog::backdrop":{opacity:0,cursor:"default"},"mjx-dialog":{all:"initial",cursor:"inherit",width:"100%",display:"flex","flex-direction":"column","flex-grow":1,"flex-shrink":1,overflow:"hidden"},"mjx-dialog > mjx-title":{display:"block","text-align":"center",margin:".25em 1.75em",overflow:"hidden","white-space":"nowrap","-webkit-user-select":"none","user-select":"none","flex-shrink":0},"mjx-dialog > mjx-title > h1":{"font-size":"125%",margin:0},"mjx-dialog > div":{margin:"0 1em .5em",padding:"8px 18px",overflow:"auto",border:"2px inset black","background-color":"white","text-align":"left",cursor:"default","flex-grow":1,"flex-shrink":1},"mjx-dialog > div > pre":{margin:0},".mjx-dialog-button":{position:"absolute",top:"6px",height:"17px",width:"17px",cursor:"default",display:"block",border:"2px solid #AAA","border-radius":"18px","font-family":'"Courier New", Courier',"text-align":"center",color:"#F0F0F0","-webkit-user-select":"none","user-select":"none"},".mjx-dialog-button:hover":{color:"white !important",border:"2px solid #CCC !important"},".mjx-dialog-button > mjx-dialog-icon":{display:"block","background-color":"#AAA",border:"1.5px solid","border-radius":"18px","line-height":0,padding:"8px 0 6px"},".mjx-dialog-button > mjx-dialog-icon:hover":{"background-color":"#CCC !important"},"mjx-dialog-close":{right:"6px","font-size":"20px;"},"mjx-dialog-help":{left:"6px","font-size":"14px;","font-weight":"bold"},".mjx-dialog-help mjx-dialog-help":{display:"none"},"mjx-dialog kbd":{display:"inline-block",padding:"3px 5px","font-size":"11px","line-height":"10px",color:"#444d56","vertical-align":"middle","background-color":"#fafbfc",border:"solid 1.5px #c6cbd1","border-bottom-color":"#959da5","border-radius":"3px","box-shadow":"inset -.5px -1px 0 #959da5"},'mjx-dialog-drag[data-drag="top"]':{height:"5px",position:"absolute",top:"-3px",left:"10px",right:"10px",cursor:"ns-resize"},'mjx-dialog-drag[data-drag="bottom"]':{height:"5px",position:"absolute",bottom:"-3px",left:"10px",right:"10px",cursor:"ns-resize"},'mjx-dialog-drag[data-drag="left"]':{width:"5px",position:"absolute",left:"-3px",top:"10px",bottom:"10px",cursor:"ew-resize"},'mjx-dialog-drag[data-drag="right"]':{width:"5px",position:"absolute",right:"-3px",top:"10px",bottom:"10px",cursor:"ew-resize"},'mjx-dialog-drag[data-drag="topleft"]':{width:"13px",height:"13px",position:"absolute",left:"-3px",top:"-3px",cursor:"nwse-resize"},'mjx-dialog-drag[data-drag="topright"]':{width:"13px",height:"13px",position:"absolute",right:"-3px",top:"-3px",cursor:"nesw-resize"},'mjx-dialog-drag[data-drag="botleft"]':{width:"13px",height:"13px",position:"absolute",left:"-3px",bottom:"-3px",cursor:"nesw-resize"},'mjx-dialog-drag[data-drag="botright"]':{width:"13px",height:"13px",position:"absolute",right:"-3px",bottom:"-3px",cursor:"nwse-resize"},"@media (prefers-color-scheme: dark)":{".mjx-dialog":{"background-color":"#303030","box-shadow":"0px 10px 20px #000",border:"3px outset #7C7C7C"},"mjx-dialog":{color:"#E0E0E0"},"mjx-dialog > div":{border:"2px inset #7C7C7C","background-color":"#222025"},".mjx-dialog a[href]":{color:"#86A7F5"},".mjx-dialog a[href]:visited":{color:"#DD98E2"},"mjx-dialog kbd":{color:"#F8F8F8","background-color":"#545454",border:"solid 1.5px #7A7C7E","border-bottom-color":"#707070","box-shadow":"inset -.5px -1px 0 #818589"},".mjx-dialog-button":{border:"2px solid #686868",color:"#A4A4A4"},".mjx-dialog-button:hover":{color:"#CBCBCB !important",border:"2px solid #888888 !important"},".mjx-dialog-button > mjx-dialog-icon":{"background-color":"#646464"},".mjx-dialog-button > mjx-dialog-icon:hover":{"background-color":"#888888 !important"}}},Rr.helpMessage='\n <p>The dialog boxes in MathJax are movable and sizeable.</p>\n\n <p>For mouse users, dragging any of the edges will enlarge or shrink\n the dialog box by moving that side. Dragging any of the corners\n changes the two sides that meet at that corner. Dragging elsewhere on\n the dialog frame will move the dialog without changing its size.</p>\n\n <p>For keyboard users, there are two ways to adjust the position\n and size of the dialog box. The first is to hold the\n <kbd>Alt</kbd> or <kbd>Option</kbd> key and press any of the arrow\n keys to move the dialog box in the given direction. Hold the\n <kbd>Win</kbd> or <kbd>Command</kbd> key and press any of the\n arrow keys to enlarge or shrink the dialog box. Left and right\n move the right-hand edge of the dialog, while up and down move the\n bottom edge of the dialog.\n </p>\n\n <p>For some users, holding two keys down at once may be difficult,\n so the second way is to press the <kbd>m</kbd> to start "move"\n mode, then use the arrow keys to move the dialog box in the given\n direction. Press <kbd>m</kbd> again to stop moving the dialog.\n Similarly, press <kbd>s</kbd> to start and stop "sizing" mode,\n where the arrows will change the size of the dialog box.</p>\n\n <p>Holding a <kbd>shift</kbd> key along with the arrow key will\n make larger changes in the size or position, for either method\n described above.</p>\n\n <p>Use <kbd>Tab</kbd> to move among the text, buttons, and links\n within the dialog. The <kbd>Enter</kbd> or <kbd>Space</kbd> key\n activates the focused item. The <kbd>Escape</kbd> key closes the\n dialog, as does clicking outside the dialog box, or clicking the\n "\xd7" icon in the upper right-hand corner of the dialog.</p>\n ';class Ir extends Rr{static post(t){const e=new this(t);return e.attach(),e}}function Sr(t){return gr.asyncLoad?new Promise((e,s)=>{const i=gr.asyncLoad(t);i instanceof Promise?i.then(t=>e(t)).catch(t=>s(t)):e(i)}):Promise.reject(`Can't load '${t}': No mathjax.asyncLoad method specified`)}const Ar=1e6,wr={px:1,in:96,cm:96/2.54,mm:96/25.4},Or={em:1,ex:.431,pt:.1,pc:1.2,mu:1/18},Mr={veryverythinmathspace:1/18,verythinmathspace:2/18,thinmathspace:3/18,mediummathspace:4/18,thickmathspace:5/18,verythickmathspace:6/18,veryverythickmathspace:7/18,negativeveryverythinmathspace:-1/18,negativeverythinmathspace:-2/18,negativethinmathspace:-3/18,negativemediummathspace:-4/18,negativethickmathspace:-5/18,negativeverythickmathspace:-6/18,negativeveryverythickmathspace:-7/18,thin:.04,medium:.06,thick:.1,normal:1,big:2,small:1/Math.sqrt(2),infinity:Ar};function Dr(t,e=0,s=1,i=16){if("string"!=typeof t&&(t=String(t)),""===t||null==t)return e;if(Mr[t])return Mr[t];const n=t.match(/^\s*([-+]?(?:\.\d+|\d+(?:\.\d*)?))?(pt|em|ex|mu|px|pc|in|mm|cm|%)?/);if(!n||""===n[0])return e;const r=parseFloat(n[1]||"1"),o=n[2];return Object.hasOwn(wr,o)?r*wr[o]/i/s:Object.hasOwn(Or,o)?r*Or[o]:"%"===o?r/100*e:r*e}function kr(t){return(100*t).toFixed(1).replace(/\.?0+$/,"")+"%"}function Pr(t){return Math.abs(t)<.001?"0":t.toFixed(3).replace(/\.?0+$/,"")+"em"}function Br(t,e=-Ar,s=16){return t*=s,e&&t<e&&(t=e),Math.abs(t)<.1?"0":t.toFixed(1).replace(/\.0$/,"")+"px"}class jr{static zero(){return new jr({h:0,d:0,w:0})}static empty(){return new jr}constructor(t={w:0,h:-Ar,d:-Ar}){this.w=t.w||0,this.h="h"in t?t.h:-Ar,this.d="d"in t?t.d:-Ar,this.L=this.R=this.ic=this.oc=this.sk=this.dx=0,this.scale=this.rscale=1,this.pwidth=""}empty(){return this.w=0,this.h=this.d=-Ar,this}clean(){this.w===-Ar&&(this.w=0),this.h===-Ar&&(this.h=0),this.d===-Ar&&(this.d=0)}rescale(t){this.w*=t,this.h*=t,this.d*=t}combine(t,e=0,s=0){const i=t.rscale,n=e+i*(t.w+t.L+t.R),r=s+i*t.h,o=i*t.d-s;n>this.w&&(this.w=n),r>this.h&&(this.h=r),o>this.d&&(this.d=o)}append(t){const e=t.rscale;this.w+=e*(t.w+t.L+t.R),e*t.h>this.h&&(this.h=e*t.h),e*t.d>this.d&&(this.d=e*t.d)}updateFrom(t){this.h=t.h,this.d=t.d,this.w=t.w,t.pwidth&&(this.pwidth=t.pwidth)}copy(){const t=new jr;return Object.assign(t,this),t}}jr.fullWidth="100%",jr.boxSides=[["Top",0,"h"],["Right",1,"w"],["Bottom",2,"d"],["Left",3,"w"]];const _r={loadMissingEntities:!0},Fr={ApplyFunction:"\u2061",Backslash:"\u2216",Because:"\u2235",Breve:"\u02d8",Cap:"\u22d2",CenterDot:"\xb7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",Congruent:"\u2261",ContourIntegral:"\u222e",Coproduct:"\u2210",Cross:"\u2a2f",Cup:"\u22d3",CupCap:"\u224d",Dagger:"\u2021",Del:"\u2207",Delta:"\u0394",Diamond:"\u22c4",DifferentialD:"\u2146",DotEqual:"\u2250",DoubleDot:"\xa8",DoubleRightTee:"\u22a8",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownLeftVector:"\u21bd",DownRightVector:"\u21c1",DownTee:"\u22a4",Downarrow:"\u21d3",Element:"\u2208",EqualTilde:"\u2242",Equilibrium:"\u21cc",Exists:"\u2203",ExponentialE:"\u2147",FilledVerySmallSquare:"\u25aa",ForAll:"\u2200",Gamma:"\u0393",Gg:"\u22d9",GreaterEqual:"\u2265",GreaterEqualLess:"\u22db",GreaterFullEqual:"\u2267",GreaterLess:"\u2277",GreaterSlantEqual:"\u2a7e",GreaterTilde:"\u2273",Hacek:"\u02c7",Hat:"^",HumpDownHump:"\u224e",HumpEqual:"\u224f",Im:"\u2111",ImaginaryI:"\u2148",Integral:"\u222b",Intersection:"\u22c2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Lambda:"\u039b",Larr:"\u219e",LeftAngleBracket:"\u27e8",LeftArrow:"\u2190",LeftArrowRightArrow:"\u21c6",LeftCeiling:"\u2308",LeftDownVector:"\u21c3",LeftFloor:"\u230a",LeftRightArrow:"\u2194",LeftTee:"\u22a3",LeftTriangle:"\u22b2",LeftTriangleEqual:"\u22b4",LeftUpVector:"\u21bf",LeftVector:"\u21bc",Leftarrow:"\u21d0",Leftrightarrow:"\u21d4",LessEqualGreater:"\u22da",LessFullEqual:"\u2266",LessGreater:"\u2276",LessSlantEqual:"\u2a7d",LessTilde:"\u2272",Ll:"\u22d8",Lleftarrow:"\u21da",LongLeftArrow:"\u27f5",LongLeftRightArrow:"\u27f7",LongRightArrow:"\u27f6",Longleftarrow:"\u27f8",Longleftrightarrow:"\u27fa",Longrightarrow:"\u27f9",Lsh:"\u21b0",MinusPlus:"\u2213",NestedGreaterGreater:"\u226b",NestedLessLess:"\u226a",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotExists:"\u2204",NotGreater:"\u226f",NotGreaterEqual:"\u2271",NotLeftTriangle:"\u22ea",NotLeftTriangleEqual:"\u22ec",NotLess:"\u226e",NotLessEqual:"\u2270",NotPrecedes:"\u2280",NotPrecedesSlantEqual:"\u22e0",NotRightTriangle:"\u22eb",NotRightTriangleEqual:"\u22ed",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsSlantEqual:"\u22e1",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotVerticalBar:"\u2224",Omega:"\u03a9",OverBar:"\u203e",OverBrace:"\u23de",PartialD:"\u2202",Phi:"\u03a6",Pi:"\u03a0",PlusMinus:"\xb1",Precedes:"\u227a",PrecedesEqual:"\u2aaf",PrecedesSlantEqual:"\u227c",PrecedesTilde:"\u227e",Product:"\u220f",Proportional:"\u221d",Psi:"\u03a8",Rarr:"\u21a0",Re:"\u211c",ReverseEquilibrium:"\u21cb",RightAngleBracket:"\u27e9",RightArrow:"\u2192",RightArrowLeftArrow:"\u21c4",RightCeiling:"\u2309",RightDownVector:"\u21c2",RightFloor:"\u230b",RightTee:"\u22a2",RightTeeArrow:"\u21a6",RightTriangle:"\u22b3",RightTriangleEqual:"\u22b5",RightUpVector:"\u21be",RightVector:"\u21c0",Rightarrow:"\u21d2",Rrightarrow:"\u21db",Rsh:"\u21b1",Sigma:"\u03a3",SmallCircle:"\u2218",Sqrt:"\u221a",Square:"\u25a1",SquareIntersection:"\u2293",SquareSubset:"\u228f",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Star:"\u22c6",Subset:"\u22d0",SubsetEqual:"\u2286",Succeeds:"\u227b",SucceedsEqual:"\u2ab0",SucceedsSlantEqual:"\u227d",SucceedsTilde:"\u227f",SuchThat:"\u220b",Sum:"\u2211",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22d1",Therefore:"\u2234",Theta:"\u0398",Tilde:"\u223c",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",UnderBar:"_",UnderBrace:"\u23df",Union:"\u22c3",UnionPlus:"\u228e",UpArrow:"\u2191",UpDownArrow:"\u2195",UpTee:"\u22a5",Uparrow:"\u21d1",Updownarrow:"\u21d5",Upsilon:"\u03a5",Vdash:"\u22a9",Vee:"\u22c1",VerticalBar:"\u2223",VerticalTilde:"\u2240",Vvdash:"\u22aa",Wedge:"\u22c0",Xi:"\u039e",amp:"&",acute:"\xb4",aleph:"\u2135",alpha:"\u03b1",amalg:"\u2a3f",and:"\u2227",ang:"\u2220",angmsd:"\u2221",angsph:"\u2222",ape:"\u224a",backprime:"\u2035",backsim:"\u223d",backsimeq:"\u22cd",beta:"\u03b2",beth:"\u2136",between:"\u226c",bigcirc:"\u25ef",bigodot:"\u2a00",bigoplus:"\u2a01",bigotimes:"\u2a02",bigsqcup:"\u2a06",bigstar:"\u2605",bigtriangledown:"\u25bd",bigtriangleup:"\u25b3",biguplus:"\u2a04",blacklozenge:"\u29eb",blacktriangle:"\u25b4",blacktriangledown:"\u25be",blacktriangleleft:"\u25c2",bowtie:"\u22c8",boxdl:"\u2510",boxdr:"\u250c",boxminus:"\u229f",boxplus:"\u229e",boxtimes:"\u22a0",boxul:"\u2518",boxur:"\u2514",bsol:"\\",bull:"\u2022",cap:"\u2229",check:"\u2713",chi:"\u03c7",circ:"\u02c6",circeq:"\u2257",circlearrowleft:"\u21ba",circlearrowright:"\u21bb",circledR:"\xae",circledS:"\u24c8",circledast:"\u229b",circledcirc:"\u229a",circleddash:"\u229d",clubs:"\u2663",colon:":",comp:"\u2201",ctdot:"\u22ef",cuepr:"\u22de",cuesc:"\u22df",cularr:"\u21b6",cup:"\u222a",curarr:"\u21b7",curlyvee:"\u22ce",curlywedge:"\u22cf",dagger:"\u2020",daleth:"\u2138",ddarr:"\u21ca",deg:"\xb0",delta:"\u03b4",digamma:"\u03dd",div:"\xf7",divideontimes:"\u22c7",dot:"\u02d9",doteqdot:"\u2251",dotplus:"\u2214",dotsquare:"\u22a1",dtdot:"\u22f1",ecir:"\u2256",efDot:"\u2252",egs:"\u2a96",ell:"\u2113",els:"\u2a95",empty:"\u2205",epsi:"\u03b5",epsiv:"\u03f5",erDot:"\u2253",eta:"\u03b7",eth:"\xf0",flat:"\u266d",fork:"\u22d4",frown:"\u2322",gEl:"\u2a8c",gamma:"\u03b3",gap:"\u2a86",gimel:"\u2137",gnE:"\u2269",gnap:"\u2a8a",gne:"\u2a88",gnsim:"\u22e7",gt:">",gtdot:"\u22d7",harrw:"\u21ad",hbar:"\u210f",hellip:"\u2026",hookleftarrow:"\u21a9",hookrightarrow:"\u21aa",imath:"\u0131",infin:"\u221e",intcal:"\u22ba",iota:"\u03b9",jmath:"\u0237",kappa:"\u03ba",kappav:"\u03f0",lEg:"\u2a8b",lambda:"\u03bb",lap:"\u2a85",larrlp:"\u21ab",larrtl:"\u21a2",lbrace:"{",lbrack:"[",le:"\u2264",leftleftarrows:"\u21c7",leftthreetimes:"\u22cb",lessdot:"\u22d6",lmoust:"\u23b0",lnE:"\u2268",lnap:"\u2a89",lne:"\u2a87",lnsim:"\u22e6",longmapsto:"\u27fc",looparrowright:"\u21ac",lowast:"\u2217",loz:"\u25ca",lt:"<",ltimes:"\u22c9",ltri:"\u25c3",macr:"\xaf",malt:"\u2720",mho:"\u2127",mu:"\u03bc",multimap:"\u22b8",nLeftarrow:"\u21cd",nLeftrightarrow:"\u21ce",nRightarrow:"\u21cf",nVDash:"\u22af",nVdash:"\u22ae",natur:"\u266e",nearr:"\u2197",nharr:"\u21ae",nlarr:"\u219a",not:"\xac",nrarr:"\u219b",nu:"\u03bd",nvDash:"\u22ad",nvdash:"\u22ac",nwarr:"\u2196",omega:"\u03c9",omicron:"\u03bf",or:"\u2228",osol:"\u2298",period:".",phi:"\u03c6",phiv:"\u03d5",pi:"\u03c0",piv:"\u03d6",prap:"\u2ab7",precnapprox:"\u2ab9",precneqq:"\u2ab5",precnsim:"\u22e8",prime:"\u2032",psi:"\u03c8",quot:'"',rarrtl:"\u21a3",rbrace:"}",rbrack:"]",rho:"\u03c1",rhov:"\u03f1",rightrightarrows:"\u21c9",rightthreetimes:"\u22cc",ring:"\u02da",rmoust:"\u23b1",rtimes:"\u22ca",rtri:"\u25b9",scap:"\u2ab8",scnE:"\u2ab6",scnap:"\u2aba",scnsim:"\u22e9",sdot:"\u22c5",searr:"\u2198",sect:"\xa7",sharp:"\u266f",sigma:"\u03c3",sigmav:"\u03c2",simne:"\u2246",smile:"\u2323",spades:"\u2660",sub:"\u2282",subE:"\u2ac5",subnE:"\u2acb",subne:"\u228a",supE:"\u2ac6",supnE:"\u2acc",supne:"\u228b",swarr:"\u2199",tau:"\u03c4",theta:"\u03b8",thetav:"\u03d1",tilde:"\u02dc",times:"\xd7",triangle:"\u25b5",triangleq:"\u225c",upsi:"\u03c5",upuparrows:"\u21c8",veebar:"\u22bb",vellip:"\u22ee",weierp:"\u2118",xi:"\u03be",yen:"\xa5",zeta:"\u03b6",zigrarr:"\u21dd",nbsp:"\xa0",rsquo:"\u2019",lsquo:"\u2018"},Ur={};function Hr(t,e){Object.assign(Fr,t),Ur[e]=!0}function Wr(t){delete Fr[t]}function Vr(t){return t.replace(/&([a-z][a-z0-9]*|#(?:[0-9]+|x[0-9a-f]+));/gi,qr)}function qr(t,e){if("#"===e.charAt(0))return Xr(e.slice(1));if(Fr[e])return Fr[e];if(_r.loadMissingEntities){const t=e.match(/^[a-zA-Z](fr|scr|opf)$/)?RegExp.$1:e.charAt(0).toLowerCase();Ur[t]||(Ur[t]=!0,Yn(Sr("./util/entities/"+t+".js")))}return t}function Xr(t){const e="x"===t.charAt(0)?parseInt(t.slice(1),16):parseInt(t);return String.fromCodePoint(e)}const zr=["top","right","bottom","left"],Gr=["width","style","color"];function Jr(t){const e=t.split(/((?:'[^'\n]*'|"[^"\n]*"|,[\s\n]|[^\s\n])*)/g),s=[];for(;e.length>1;)e.shift(),s.push(e.shift());return s}function Kr(t){const e=Jr(this.styles[t]);0===e.length&&e.push(""),1===e.length&&e.push(e[0]),2===e.length&&e.push(e[0]),3===e.length&&e.push(e[1]);for(const s of ro.connect[t].children)this.setStyle(this.childName(t,s),e.shift())}function $r(t){const e=ro.connect[t].children,s=[];for(const i of e){const e=this.styles[this.childName(t,i)];if(!e)return void delete this.styles[t];s.push(e)}s[3]===s[1]&&(s.pop(),s[2]===s[0]&&(s.pop(),s[1]===s[0]&&s.pop())),this.styles[t]=s.join(" ")}function Yr(t){$r.call(this,t),this.combineChildren(t),Qr.call(this,t),this.combineParent(t)}function Qr(t){if(!ro.connect[t])return;const e=[...ro.connect[t].children],s=this.styles[this.childName(t,e.shift())];for(const i of e)if(this.styles[this.childName(t,i)]!==s)return void delete this.styles[t];s&&(this.styles[t]=s)}const Zr=/^(?:[\d.]+(?:[a-z]+)|thin|medium|thick|inherit|initial|unset)$/,to=/^(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|inherit|initial|unset)$/;function eo(t){const e={width:"",style:"",color:""};for(const s of Jr(this.styles[t]))s.match(Zr)&&""===e.width?e.width=s:s.match(to)&&""===e.style?e.style=s:e.color=s;for(const s of ro.connect[t].children)this.setStyle(this.childName(t,s),e[s])}function so(t){const e=[];for(const s of ro.connect[t].children){const i=this.styles[this.childName(t,s)];i&&e.push(i)}e.length>1?this.styles[t]=e.join(" "):delete this.styles[t]}const io={style:/^(?:normal|italic|oblique|inherit|initial|unset)$/,variant:new RegExp("^(?:"+["normal|none","inherit|initial|unset","common-ligatures|no-common-ligatures","discretionary-ligatures|no-discretionary-ligatures","historical-ligatures|no-historical-ligatures","contextual|no-contextual","(?:stylistic|character-variant|swash|ornaments|annotation)\\([^)]*\\)","small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps","lining-nums|oldstyle-nums|proportional-nums|tabular-nums","diagonal-fractions|stacked-fractions","ordinal|slashed-zero","jis78|jis83|jis90|jis04|simplified|traditional","full-width|proportional-width","ruby"].join("|")+")$"),weight:/^(?:normal|bold|bolder|lighter|[1-9]00|inherit|initial|unset)$/,stretch:new RegExp("^(?:"+["normal","(?:(?:ultra|extra|semi)-)?(?:condensed|expanded)","inherit|initial|unset"].join("|")+")$"),size:new RegExp("^(?:"+["xx-small|x-small|small|medium|large|x-large|xx-large|larger|smaller","[\\d.]+%|[\\d.]+[a-z]+","inherit|initial|unset"].join("|")+")(?:/(?:normal|[\\d.]+(?:%|[a-z]+)?))?$")};function no(t,e){for(const s of ro.connect[t].children){const i=this.childName(t,s);if(Array.isArray(e[s])){const t=e[s];t.length&&(this.styles[i]=t.join(" "))}else""!==e[s]&&(this.styles[i]=e[s])}}class ro{constructor(t=""){this.parse(t)}sanitizeValue(t){const e=this.constructor.pattern;if(!t.match(e.sanitize))return t;const s=(t=t.replace(e.value,"$1")).replace(/\\./g,"").replace(/(['"]).*?\1/g,"").replace(/[^'"]/g,"");return s.length&&(t+=s.charAt(0)),t}get cssText(){var t,e;const s=[];for(const i of Object.keys(this.styles)){const n=this.parentName(i),r=i.replace(/.*-/,""),o=this.childName(this.parentName(n),r);!this.styles[i]||this.styles[o]||this.styles[n]&&(null===(e=null===(t=ro.connect[n])||void 0===t?void 0:t.children)||void 0===e?void 0:e.includes(r))||s.push(`${i}: ${this.styles[i]};`)}return s.join(" ")}get styleList(){return Object.assign({},this.styles)}set(t,e){t=this.normalizeName(t),this.setStyle(t,String(e));const s=ro.connect[t];if(null==s?void 0:s.subPart)s.combine.call(this,t);else if(this.combineParent(t),t.match(/-.*-/)){const e=t.replace(/-.*-/,"-");Qr.call(this,e)}}combineParent(t){for(var e;t.match(/-/);){const s=t;t=this.parentName(t);const i=ro.connect[t];if(!ro.connect[s]&&!(null===(e=null==i?void 0:i.children)||void 0===e?void 0:e.includes(s.substring(t.length+1))))break;i.combine.call(this,t)}if(!this.styles[t])return;const s=ro.connect[t];for(const e of(null==s?void 0:s.parts)||[])delete this.styles[this.childName(t,e)]}get(t){return t=this.normalizeName(t),Object.hasOwn(this.styles,t)?this.styles[t]:""}setStyle(t,e){var s;this.styles[t]=this.sanitizeValue(e),(null===(s=ro.connect[t])||void 0===s?void 0:s.children)&&ro.connect[t].split.call(this,t),""===e&&delete this.styles[t]}combineChildren(t){const e=this.parentName(t);for(const s of ro.connect[t].children){const t=this.childName(e,s);ro.connect[t].combine.call(this,t)}}parentName(t){const e=t.replace(/-[^-]*$/,"");return t===e?"":e}childName(t,e){var s;return e.match(/-/)?e:((null===(s=ro.connect[t])||void 0===s?void 0:s.subPart)&&(e+=t.replace(/.*-/,"-"),t=this.parentName(t)),t+"-"+e)}normalizeName(t){return t.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}parse(t=""){const e=this.constructor.pattern;this.styles={};const s=t.replace(/\n/g," ").replace(e.comment,"").split(e.style);for(;s.length>1;){const[t,e,i]=s.splice(0,3);if(t.match(/[^\s\n;]/))return;this.set(e,i)}}}function oo(t){return t.reduce((t,e)=>t+e,0)}function ao(t){return t.reduce((t,e)=>Math.max(t,e),0)}if(ro.pattern={sanitize:/['";]/,value:/^((:?'(?:\\.|[^'])*(?:'|$)|"(?:\\.|[^"])*(?:"|$)|\n|\\.|[^'";])*?)[\s\n]*(?:;|$).*/,style:/([-a-z]+)[\s\n]*:[\s\n]*((?:'(?:\\.|[^'])*(?:'|$)|"(?:\\.|[^"])*(?:"|$)|\n|\\.|[^'";])*?)[\s\n]*(?:;|$)/g,comment:/\/\*[^]*?\*\//g},ro.connect={padding:{children:zr,split:Kr,combine:$r},margin:{children:zr,split:Kr,combine:$r},border:{children:zr,parts:Gr,split:function(t){for(const e of ro.connect[t].children)this.setStyle(this.childName(t,e),this.styles[t])},combine:Qr},"border-top":{children:Gr,split:eo,combine:so},"border-right":{children:Gr,split:eo,combine:so},"border-bottom":{children:Gr,split:eo,combine:so},"border-left":{children:Gr,split:eo,combine:so},"border-width":{children:zr,split:Kr,combine:Yr,subPart:!0},"border-style":{children:zr,split:Kr,combine:Yr,subPart:!0},"border-color":{children:zr,split:Kr,combine:Yr,subPart:!0},font:{children:["style","variant","weight","stretch","line-height","size","family"],split:function(t){const e=Jr(this.styles[t]),s={style:"",variant:[],weight:"",stretch:"",size:"",family:"","line-height":""};for(const t of e){s.family||(s.family=t);for(const e of Object.keys(io))if((Array.isArray(s[e])||""===s[e])&&t.match(io[e]))if(s.family===t&&(s.family=""),"size"===e){const[i,n]=t.split(/\//);s[e]=i,n&&(s["line-height"]=n)}else""===s.size&&(Array.isArray(s[e])?s[e].push(t):""===s[e]&&(s[e]=t))}no.call(this,t,s),delete this.styles[t]},combine:function(t){}}},MathJax.loader&&MathJax.loader.checkVersion("core",xs,"core"),Cs({_:{adaptors:{HTMLAdaptor:c,browserAdaptor:d},components:{global:t},core:{DOMAdaptor:h,FindMath:u,Handler:at,HandlerList:lt,InputJax:p,MathDocument:ot,MathItem:b,MathList:g,MmlTree:{Attributes:y,MML:st,MathMLVisitor:dt,MmlFactory:it,MmlNode:T,MmlNodes:{HtmlNode:et,TeXAtom:Z,maction:W,maligngroup:K,malignmark:$,math:v,mathchoice:tt,menclose:H,merror:j,mfenced:U,mfrac:D,mglyph:Y,mi:L,mmultiscripts:X,mn:C,mo:S,mpadded:_,mphantom:F,mroot:P,mrow:M,ms:O,mspace:w,msqrt:k,mstyle:B,msubsup:V,mtable:z,mtd:J,mtext:A,mtr:G,munderover:q,semantics:Q},MmlVisitor:ct,OperatorDictionary:R,SerializedMmlVisitor:ut},OutputJax:m,Tree:{Factory:E,Node:N,NodeFactory:x,Visitor:ht,Wrapper:pt,WrapperFactory:mt}},handlers:{html_ts:Nt,html:{HTMLDocument:xt,HTMLDomStrings:Et,HTMLHandler:yt,HTMLMathItem:gt,HTMLMathList:bt}},mathjax:ft,ui:{dialog:{DraggableDialog:vt,InfoDialog:Lt}},util:{AsyncLoad:Ct,BBox:It,BitField:nt,Entities:St,FunctionList:r,LinkedList:f,Options:a,PrioritizedList:i,Retries:rt,StyleJson:Tt,Styles:At,context:e,lengths:Rt,numeric:wt,string:I}}}),MathJax.startup&&(MathJax.startup.registerConstructor("HTMLHandler",Nr),MathJax.startup.registerConstructor("browserAdaptor",pi),MathJax.startup.useHandler("HTMLHandler"),MathJax.startup.useAdaptor("browserAdaptor")),MathJax.loader){const t=MathJax.config.loader;MathJax._.mathjax.mathjax.asyncLoad=e=>"node:"===e.substring(0,5)?t.require(e):MathJax.loader.load(e).then(t=>t[0])}const lo="http://www.w3.org/1998/Math/MathML";class ho extends mi{findMath(t){const e=new Set;this.findMathNodes(t,e),this.findMathPrefixed(t,e);const s=this.adaptor.root(this.adaptor.document);return"html"===this.adaptor.kind(s)&&0===e.size&&this.findMathNS(t,e),this.processMath(e)}findMathNodes(t,e){for(const s of this.adaptor.tags(t,"math"))e.add(s)}findMathPrefixed(t,e){const s=this.adaptor.root(this.adaptor.document);for(const i of this.adaptor.allAttributes(s))if("xmlns:"===i.name.substring(0,6)&&i.value===lo){const s=i.name.substring(6);for(const i of this.adaptor.tags(t,s+":math"))e.add(i)}}findMathNS(t,e){for(const s of this.adaptor.tags(t,"math",lo))e.add(s)}processMath(t){const e=this.adaptor,s=[];for(const i of t.values()){if("mjx-assistive-mml"===e.kind(e.parent(i)))continue;const t="block"===e.getAttribute(i,"display")||"display"===e.getAttribute(i,"mode"),n={node:i,n:0,delim:""},r={node:i,n:0,delim:""};s.push({math:e.outerHTML(i),start:n,end:r,display:t})}return s}}ho.OPTIONS={};class co{constructor(t={}){const e=this.constructor;this.options=Zs(Qs({},e.OPTIONS),t)}setMmlFactory(t){this.factory=t}compile(t){const e=this.makeNode(t);return e.verifyTree(this.options.verify),e.setInheritedAttributes({},!1,0,!1),e.walkTree(this.markMrows),e}makeNode(t){const e=this.adaptor;let s=!1;const i=e.kind(t).replace(/^.*:/,"");let n=e.getAttribute(t,"data-mjx-texclass")||"";n&&(n=this.filterAttribute("data-mjx-texclass",n)||"");let r=n&&"mrow"===i?"TeXAtom":i;for(const o of this.filterClassList(e.allClasses(t)))o.match(/^MJX-TeXAtom-/)&&"mrow"===i?(n=o.substring(12),r="TeXAtom"):"MJX-fixedlimits"===o&&(s=!0);return this.factory.getNodeClass(r)?this.createMml(r,t,n,s):this.unknownNode(r,t)}createMml(t,e,s,i){const n=this.factory.create(t);return"TeXAtom"!==t||"OP"!==s||i||(n.setProperty("movesupsub",!0),n.attributes.setInherited("movablelimits",!0)),s&&(n.texClass=Oi[s],n.setProperty("texClass",n.texClass)),this.addAttributes(n,e),this.checkClass(n,e),this.addChildren(n,e),n}unknownNode(t,e){return this.factory.getNodeClass("html")&&this.options.allowHtmlInTokenNodes?this.factory.create("html").setHTML(e,this.adaptor):(this.error('Unknown node type "'+t+'"'),null)}addAttributes(t,e){let s=!1;for(const i of this.adaptor.allAttributes(e)){const e=i.name,n=this.filterAttribute(e,i.value);if(null!==n&&"xmlns"!==e)if("data-mjx-"===e.substring(0,9))switch(e.substring(9)){case"alternate":t.setProperty("variantForm",!0);break;case"variant":t.attributes.set("mathvariant",n),t.setProperty("ignore-variant",!0),s=!0;break;case"smallmatrix":t.setProperty("smallmatrix",!0),t.setProperty("useHeight",!1);break;case"mathaccent":t.setProperty("mathaccent","true"===n);break;case"auto-op":t.setProperty("autoOP","true"===n);break;case"script-align":t.setProperty("scriptalign",n);break;case"vbox":t.setProperty("vbox",n);break;default:t.attributes.set(e,n)}else if("class"!==e){const i=n.toLowerCase();"true"===i||"false"===i?t.attributes.set(e,"true"===i):s&&"mathvariant"===e||t.attributes.set(e,n)}}}filterAttribute(t,e){return e}filterClassList(t){return t}addChildren(t,e){if(0===t.arity)return;const s=this.adaptor;for(const i of s.childNodes(e)){const e=s.kind(i);if("#comment"!==e)if("#text"===e)this.addText(t,i);else if(t.isKind("annotation-xml"))t.appendChild(this.factory.create("XML").setXML(i,s));else{const e=t.appendChild(this.makeNode(i));0===e.arity&&s.childNodes(i).length&&!e.isKind("html")&&(this.options.fixMisplacedChildren?this.addChildren(t,i):e.mError("There should not be children for "+e.kind+" nodes",this.options.verify,!0))}}t.isToken&&this.trimSpace(t)}addText(t,e){let s=this.adaptor.value(e);(t.isToken||t.getProperty("isChars"))&&t.arity?(t.isToken&&(s=Vr(s),s=this.normalizeSpace(s)),t.appendChild(this.factory.create("text").setText(s))):s.match(/\S/)&&this.error('Unexpected text node "'+s+'"')}checkClass(t,e){const s=[];for(const i of this.filterClassList(this.adaptor.allClasses(e)))"MJX-"===i.substring(0,4)?"MJX-variant"===i?t.setProperty("variantForm",!0):"MJX-TeXAtom"!==i.substring(0,11)&&t.attributes.set("mathvariant",this.fixCalligraphic(i.substring(3))):s.push(i);s.length&&t.attributes.set("class",s.join(" "))}fixCalligraphic(t){return t.replace(/caligraphic/,"calligraphic")}markMrows(t){if(t.isKind("mrow")&&!t.isInferred&&t.childNodes.length>=2){const e=t.childNodes[0],s=t.childNodes[t.childNodes.length-1];e.isKind("mo")&&e.attributes.get("fence")&&e.attributes.get("stretchy")&&s.isKind("mo")&&s.attributes.get("fence")&&s.attributes.get("stretchy")&&(e.childNodes.length&&t.setProperty("open",e.getText()),s.childNodes.length&&t.setProperty("close",s.getText()))}}normalizeSpace(t){return t.replace(/[\t\n\r]/g," ").replace(/ +/g," ")}trimSpace(t){let e=t.childNodes[0];e&&(e.isKind("text")&&e.setText(e.getText().replace(/^ +/,"")),e=t.childNodes[t.childNodes.length-1],e.isKind("text")&&e.setText(e.getText().replace(/ +$/,"")))}error(t){throw new Error(t)}}co.OPTIONS={MmlFactory:null,allowHtmlInTokenNodes:!1,fixMisplacedChildren:!0,verify:Object.assign({},ji.verifyDefaults),translateEntities:!0};class uo extends fi{constructor(t={}){const[e,s,i]=si(t,ho.OPTIONS,co.OPTIONS);super(e),this.findMathML=this.options.FindMathML||new ho(s),this.mathml=this.options.MathMLCompile||new co(i),this.mmlFilters=new Ds(this.options.mmlFilters)}setAdaptor(t){super.setAdaptor(t),this.findMathML.adaptor=t,this.mathml.adaptor=t}setMmlFactory(t){super.setMmlFactory(t),this.mathml.setMmlFactory(t)}get processStrings(){return!1}compile(t,e){let s=t.start.node;if(!s||!t.end.node||this.options.forceReparse||"#text"===this.adaptor.kind(s)){let i=this.executeFilters(this.preFilters,t,e,(t.math||"<math></math>").trim());"html"===this.options.parseAs&&(i=`<html><head></head><body>${i}</body></html>`);const n=this.checkForErrors(this.adaptor.parse(i,"text/"+this.options.parseAs)),r=this.adaptor.body(n);1!==this.adaptor.childNodes(r).length&&this.error("MathML must consist of a single element"),s=this.adaptor.remove(this.adaptor.firstChild(r)),"math"!==this.adaptor.kind(s).replace(/^[a-z]+:/,"")&&this.error("MathML must be formed by a <math> element, not <"+this.adaptor.kind(s)+">")}s=this.executeFilters(this.mmlFilters,t,e,s);let i=this.mathml.compile(s);return i=this.executeFilters(this.postFilters,t,e,i),t.display="block"===i.attributes.get("display"),i}checkForErrors(t){const e=this.adaptor.tags(this.adaptor.body(t),"parsererror")[0];return e&&(""===this.adaptor.textContent(e)&&this.error("Error processing MathML"),this.options.parseError.call(this,e)),t}error(t){throw new Error(t)}findMath(t){return this.findMathML.findMath(t)}}uo.NAME="MathML",uo.OPTIONS=Qs({parseAs:"html",forceReparse:!1,mmlFilters:[],FindMathML:null,MathMLCompile:null,parseError:function(t){this.error(this.adaptor.textContent(t).replace(/\n.*/g,""))}},fi.OPTIONS),MathJax.loader&&MathJax.loader.checkVersion("input/mml",xs,"input"),Cs({_:{input:{mathml_ts:Dt,mathml:{FindMathML:Ot,MathMLCompile:Mt}}}}),MathJax.loader&&MathJax.loader.pathFilters.add(t=>(t.name=t.name.replace(/\/util\/entities\/.*?\.js/,"/input/mml/entities.js"),!0)),MathJax.startup&&(MathJax.startup.registerConstructor("mml",uo),MathJax.startup.useInput("mml"));const po={None:"",Vertical:"v",Horizontal:"h"},mo=po.Vertical,fo=po.Horizontal;var go=function(t,e,s,i){return new(s||(s=Promise))(function(n,r){function o(t){try{l(i.next(t))}catch(t){r(t)}}function a(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})};const bo=.07,Eo=.07,xo={dir:po.None};function yo(t,e,s){return s?Qs(t,{[e]:s})[e]:t[e]}class No{get CLASS(){return this.constructor}static charOptions(t,e){const s=t[e];if(!Array.isArray(s))throw Error(`Character data hasn't been loaded for 0x${e.toString(16).toUpperCase()}`);return 3===s.length&&(s[3]={}),s[3]}static defineDynamicFiles(t,e=""){const s={};return(t||[]).forEach(([t,i,n])=>{s[t]={extension:e,file:t,variants:i,delimiters:n||[],promise:null,failed:!1,setup:e=>{s[t].failed=!0}}}),s}static dynamicSetup(t,e,s,i={},n=null){const r=t?this.dynamicExtensions.get(t):null;(t?r.files:this.dynamicFiles)[e].setup=e=>{Object.keys(s).forEach(t=>e.defineChars(t,s[t])),e.defineDelimiters(i),t&&this.adjustDelimiters(e.delimiters,Object.keys(i),r.sizeN,r.stretchN),n&&e.addDynamicFontCss(n)}}static adjustDelimiters(t,e,s,i){e.forEach(e=>{const n=t[parseInt(e)];"dir"in n&&(n.variants&&(n.variants=this.adjustArrayIndices(n.variants,s)),n.stretchv&&(n.stretchv=this.adjustArrayIndices(n.stretchv,i)))})}static adjustArrayIndices(t,e){return t.map(t=>t<0?e-1-t:t)}static addExtension(t,e=""){const s={name:t.name,prefix:e||`[${t.name}-extension]/${this.JAX.toLowerCase()}/dynamic`,files:this.defineDynamicFiles(t.ranges,t.name),sizeN:this.defaultSizeVariants.length,stretchN:this.defaultStretchVariants.length};this.dynamicExtensions.set(t.name,s);for(const[e,s]of[["options","OPTIONS"],["variants","defaultVariants"],["variantSmp","VariantSmp"],["cssFonts","defaultCssFonts"],["accentMap","defaultAccentMap"],["moMap","defaultMoMap"],["mnMap","defaultMnMap"],["parameters","defaultParams"],["chars","defaultChars"],["sizeVariants","defaultSizeVariants"],["stretchVariants","defaultStretchVariants"]])yo(this,s,t[e]);t.delimiters&&(Object.assign(this.defaultDelimiters,t.delimiters),this.adjustDelimiters(this.defaultDelimiters,Object.keys(t.delimiters),s.sizeN,s.stretchN))}constructor(t=null){this.variant={},this.delimiters={},this.cssFontMap={},this.cssFontPrefix="",this.remapChars={},this.skewIcFactor=.75;const e=this.CLASS;this.options=Zs(Qs({},e.OPTIONS),t),this.params=Object.assign({},e.defaultParams),this.sizeVariants=[...e.defaultSizeVariants],this.stretchVariants=[...e.defaultStretchVariants],this.defineCssFonts(e.defaultCssFonts),this.cssFamilyPrefix=e.defaultCssFamilyPrefix,this.createVariants(e.defaultVariants),this.defineDelimiters(e.defaultDelimiters),Object.keys(e.defaultChars).forEach(t=>this.defineChars(t,e.defaultChars[t])),this.defineRemap("accent",e.defaultAccentMap),this.defineRemap("mo",e.defaultMoMap),this.defineRemap("mn",e.defaultMnMap),this.defineDynamicCharacters(e.dynamicFiles),e.dynamicExtensions.forEach(t=>this.defineDynamicCharacters(t.files))}setOptions(t){Qs(this.options,t)}addExtension(t,e=""){const s=this.constructor.JAX.toLowerCase(),i={name:t.name,prefix:e||`[${t.name}-extension]/${s}/dynamic`,files:this.CLASS.defineDynamicFiles(t.ranges,e),sizeN:this.sizeVariants.length,stretchN:this.stretchVariants.length};this.CLASS.dynamicExtensions.set(t.name,i),Qs(this.options,t.options||{}),Qs(this.params,t.parameters||{}),yo(this,"sizeVariants",t.sizeVariants),yo(this,"stretchVariants",t.stretchVariants),yo(this.constructor,"VariantSmp",t.variantSmp),this.defineCssFonts(yo({cssFonts:{}},"cssFonts",t.cssFonts)),this.createVariants(yo({variants:[]},"variants",t.variants)),t.delimiters&&(this.defineDelimiters(yo({delimiters:{}},"delimiters",t.delimiters)),this.CLASS.adjustDelimiters(this.delimiters,Object.keys(t.delimiters),i.sizeN,i.stretchN));for(const e of Object.keys(t.chars||{}))this.defineChars(e,t.chars[e]);return this.defineRemap("accent",t.accentMap),this.defineRemap("mo",t.moMap),this.defineRemap("mn",t.mnMap),t.ranges&&this.defineDynamicCharacters(i.files),[]}get styles(){return this._styles}set styles(t){this._styles=t}createVariant(t,e=null,s=null){const i={linked:[],chars:Object.create(e?this.variant[e].chars:{})};this.variant[s]&&(Object.assign(i.chars,this.variant[s].chars),this.variant[s].linked.push(i.chars),i.chars=Object.create(i.chars)),this.remapSmpChars(i.chars,t),this.variant[t]=i}remapSmpChars(t,e){const s=this.CLASS;let i=s.VariantSmp[e];if("string"==typeof i&&(i=s.VariantSmp[i]),!i)return;const n=s.SmpRemap,r=[null,null,s.SmpRemapGreekU,s.SmpRemapGreekL];for(const[e,o,a]of s.SmpRanges){const s=i[e];if(s){for(let e=o;e<=a;e++){if(930===e)continue;const i=s+e-o;t[e]=this.smpChar(n[i]||i)}if(r[e])for(const i of Object.keys(r[e]).map(t=>parseInt(t)))t[i]=this.smpChar(s+r[e][i])}}const o=i[5]||{};for(const e of Object.keys(o))t[e]=this.smpChar(i[5][e])}smpChar(t){return[,,,{smp:t}]}createVariants(t){for(const e of t)this.createVariant(e[0],e[1],e[2])}defineChars(t,e){const s=this.variant[t];Object.assign(s.chars,e);for(const t of s.linked)Object.assign(t,e)}defineCssFonts(t){Object.assign(this.cssFontMap,t);for(const e of Object.keys(t))"unknown"===this.cssFontMap[e][0]&&(this.cssFontMap[e][0]=this.options.unknownFamily)}defineDelimiters(t){Object.assign(this.delimiters,t)}defineRemap(t,e){e&&(Object.hasOwn(this.remapChars,t)||(this.remapChars[t]={}),Object.assign(this.remapChars[t],e))}defineDynamicCharacters(t){for(const e of Object.keys(t)){const s=t[e];for(const t of Object.keys(s.variants))this.defineChars(t,this.flattenRanges(s.variants[t],s));this.defineDelimiters(this.flattenRanges(s.delimiters,s))}}flattenRanges(t,e){const s={};for(const i of t)if(Array.isArray(i))for(let t=i[0];t<=i[1];t++)s[t]=e;else s[i]=e;return s}dynamicFileName(t){const e=t.extension?this.CLASS.dynamicExtensions.get(t.extension).prefix:this.options.dynamicPrefix;return t.file.match(/^(?:[/[]|[a-z]+:\/\/|[a-z]:)/i)?t.file:e+"/"+t.file.replace(/(\.js)?$/,".js")}loadDynamicFile(t){return go(this,void 0,void 0,function*(){return t.failed?Promise.reject(new Error(`dynamic file '${t.file}' failed to load`)):(t.promise||(t.promise=Sr(this.dynamicFileName(t)).catch(e=>{t.failed=!0,console.warn(e)})),t.promise.then(()=>t.setup(this)))})}loadDynamicFiles(){const t=this.CLASS.dynamicFiles,e=Object.keys(t).map(e=>this.loadDynamicFile(t[e]));for(const t of this.CLASS.dynamicExtensions.values())e.push(...Object.keys(t.files).map(e=>this.loadDynamicFile(t.files[e])));return Promise.all(e)}loadDynamicFilesSync(){if(!gr.asyncIsSynchronous)throw Error("MathJax(loadDynamicFilesSync): mathjax.asyncLoad must be specified and synchronous\n Try importing #js/../components/require.mjs and #js/util/asyncLoad/node.js");const t=this.CLASS.dynamicFiles;Object.keys(t).forEach(e=>this.loadDynamicFileSync(t[e]));for(const t of this.CLASS.dynamicExtensions.values())Object.keys(t.files).forEach(e=>this.loadDynamicFileSync(t.files[e]))}loadDynamicFileSync(t){if(!t.promise){t.promise=Promise.resolve();try{gr.asyncLoad(this.dynamicFileName(t))}catch(e){t.failed=!0,console.warn(e)}t.setup(this)}}addDynamicFontCss(t,e){}getDelimiter(t){const e=this.delimiters[t];return e&&!("dir"in e)?(this.delimiters[t]=null,gr.asyncIsSynchronous?(this.loadDynamicFileSync(e),this.getDelimiter(t)):(Yn(this.loadDynamicFile(e)),null)):e}getSizeVariant(t,e){const s=this.getDelimiter(t);return s&&s.variants&&(e=s.variants[e]),this.sizeVariants[e]}getStretchVariant(t,e){const s=this.getDelimiter(t);return this.stretchVariants[s.stretchv?s.stretchv[e]:0]}getStretchVariants(t){return[0,1,2,3].map(e=>this.getStretchVariant(t,e))}getChar(t,e){const s=this.variant[t].chars[e];if(s&&!Array.isArray(s)){const i=this.variant[t];return delete i.chars[e],i.linked.forEach(t=>delete t[e]),gr.asyncIsSynchronous?(this.loadDynamicFileSync(s),this.getChar(t,e)):(Yn(this.loadDynamicFile(s)),null)}return s}getVariant(t){return this.variant[t]}getCssFont(t){return this.cssFontMap[t]||["serif",!1,!1]}getFamily(t){return this.cssFamilyPrefix?this.cssFamilyPrefix+", "+t:t}getRemappedChar(t,e){return(this.remapChars[t]||{})[e]}}No.OPTIONS={unknownFamily:"serif",dynamicPrefix:"."},No.JAX="common",No.NAME="",No.defaultVariants=[["normal"],["bold","normal"],["italic","normal"],["bold-italic","italic","bold"],["double-struck","bold"],["fraktur","normal"],["bold-fraktur","bold","fraktur"],["script","italic"],["bold-script","bold-italic","script"],["sans-serif","normal"],["bold-sans-serif","bold","sans-serif"],["sans-serif-italic","italic","sans-serif"],["sans-serif-bold-italic","bold-italic","bold-sans-serif"],["monospace","normal"],["-smallop","normal"],["-largeop","normal"],["-tex-calligraphic","italic"],["-tex-bold-calligraphic","bold-italic"],["-tex-oldstyle","normal"],["-tex-bold-oldstyle","bold"],["-tex-mathit","italic"],["-tex-variant","normal"]],No.defaultCssFonts={normal:["unknown",!1,!1],bold:["unknown",!1,!0],italic:["unknown",!0,!1],"bold-italic":["unknown",!0,!0],"double-struck":["unknown",!1,!0],fraktur:["unknown",!1,!1],"bold-fraktur":["unknown",!1,!0],script:["cursive",!1,!1],"bold-script":["cursive",!1,!0],"sans-serif":["sans-serif",!1,!1],"bold-sans-serif":["sans-serif",!1,!0],"sans-serif-italic":["sans-serif",!0,!1],"sans-serif-bold-italic":["sans-serif",!0,!0],monospace:["monospace",!1,!1],"-smallop":["unknown",!1,!1],"-largeop":["unknown",!1,!1],"-tex-calligraphic":["cursive",!0,!1],"-tex-bold-calligraphic":["cursive",!0,!0],"-tex-oldstyle":["unknown",!1,!1],"-tex-bold-oldstyle":["unknown",!1,!0],"-tex-mathit":["unknown",!0,!1],"-tex-variant":["unknown",!1,!1]},No.defaultCssFamilyPrefix="",No.VariantSmp={bold:[119808,119834,120488,120514,120782,{988:120778,989:120779}],italic:[119860,119886,120546,120572],"bold-italic":[119912,119938,120604,120630],script:[119964,119990],"bold-script":[120016,120042],fraktur:[120068,120094],"double-struck":[120120,120146,,,120792],"bold-fraktur":[120172,120198],"sans-serif":[120224,120250,,,120802],"bold-sans-serif":[120276,120302,120662,120688,120812],"sans-serif-italic":[120328,120354],"sans-serif-bold-italic":[120380,120406,120720,120746],monospace:[120432,120458,,,120822]},No.SmpRanges=[[0,65,90],[1,97,122],[2,913,937],[3,945,969],[4,48,57]],No.SmpRemap={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},No.SmpRemapGreekU={8711:25,1012:17},No.SmpRemapGreekL={977:27,981:29,982:31,1008:28,1009:30,1013:26,8706:25},No.defaultAccentMap={94:"\u02c6",126:"\u02dc",768:"\u02cb",769:"\u02ca",770:"\u02c6",771:"\u02dc",772:"\u02c9",774:"\u02d8",775:"\u02d9",776:"\xa8",778:"\u02da",780:"\u02c7",8594:"\u20d7"},No.defaultMoMap={45:"\u2212"},No.defaultMnMap={45:"\u2212"},No.defaultParams={x_height:.442,quad:1,num1:.676,num2:.394,num3:.444,denom1:.686,denom2:.345,sup1:.413,sup2:.363,sup3:.289,sub1:.15,sub2:.247,sup_drop:.386,sub_drop:.05,delim1:2.39,delim2:1,axis_height:.25,rule_thickness:.06,big_op_spacing1:.111,big_op_spacing2:.167,big_op_spacing3:.2,big_op_spacing4:.6,big_op_spacing5:.1,surd_height:.06,scriptspace:.05,nulldelimiterspace:.12,delimiterfactor:901,delimitershortfall:.3,rule_factor:1.25,min_rule_thickness:1.25,separation_factor:1.75,extra_ic:.033,extender_factor:.333},No.defaultDelimiters={},No.defaultChars={},No.defaultSizeVariants=[],No.defaultStretchVariants=[],No.dynamicFiles={},No.dynamicExtensions=new Map;class To extends jr{static from(t,e,s=null){const i=new this;return Object.assign(i,t),i.lineLeading=e,s&&(i.indentData=s),i}constructor(t,e=null){super(t),this.indentData=null,this.isFirst=!1,this.originalL=this.L,e&&(this.start=e)}append(t){this.isFirst&&(t.originalL+=t.L,t.L=0),t.indentData&&(this.indentData=t.indentData),this.lineLeading=t.lineLeading,super.append(t),this.isFirst=t.isFirst}copy(){const t=To.from(this,this.lineLeading);return t.indentData=this.indentData,t.lineLeading=this.lineLeading,t}getIndentData(t){let{indentalign:e,indentshift:s,indentalignfirst:i,indentshiftfirst:n,indentalignlast:r,indentshiftlast:o}=t.attributes.getAllAttributes();"indentalign"===i&&(i=t.attributes.getInherited("indentalign")),"indentshift"===n&&(n=t.attributes.getInherited("indentshift")),"indentalign"===r&&(r=e),"indentshift"===o&&(o=s),this.indentData=[[i,n],[e,s],[r,o]]}copyIndentData(t){return t.indentData.map(([t,e])=>[t,e])}}const vo=1e6;class Lo extends hr{breakToWidth(t,e){}}class Co extends Lo{constructor(){super(...arguments),this.PENALTY={newline:t=>0,nobreak:t=>vo,goodbreak:t=>t-200*this.state.depth,badbreak:t=>t+200*this.state.depth,auto:t=>t},this.FACTORS={depth:t=>t+800*this.state.depth,width:t=>t+Math.floor((this.state.width-this.state.w)/this.state.width*2500),tail:t=>t+Math.floor(this.state.width/Math.max(1e-4,this.state.mathLeft-this.state.w)*500),open:(t,e)=>{const s=e.node.prevClass;if(s===Oi.BIN||s===Oi.REL||s===Oi.OP)return t+5e3;const i=this.getPrevious(e);if(i&&("postfix"!==i.attributes.get("form")||"nobreak"===i.attributes.get("linebreak")))return t+5e3;const n=e.node.Parent;if((null==n?void 0:n.isKind("mmultiscripts"))&&e.node===this.getFirstToken(n)){if(!!n.childNodes.filter(t=>t.isKind("mprescripts")).length)return vo}return t-500},close:(t,e)=>{var s;const i=e.node.Parent;return!(null==i?void 0:i.isKind("msubsup"))||i.isKind("mmultiscripts")&&(null===(s=i.childNodes[1])||void 0===s?void 0:s.isKind("mprescripts"))||e.node!==this.getLastToken(i.childNodes[0])?t+500:vo},space:(t,e)=>{const s=e;if(!s.canBreak)return vo;const i=s.getBBox().w;return i<0?vo:i<1?t:t-100*(i+4)},separator:t=>t+500,fuzz:t=>.99*t},this.TEXCLASS={[Oi.BIN]:t=>t-250,[Oi.REL]:t=>t-500}}breakToWidth(t,e){const s=this.state;this.state=this.createState(t),this.state.width=e;const i=t.breakCount;for(let s=0;s<=i;s++){(t.lineBBox[s]||t.getLineBBox(s)).w>e&&this.breakLineToWidth(t,s)}for(const[t,e]of this.state.breaks){if(null===e){const e=t.coreMO();e.setBreakStyle(e.node.attributes.get("linebreakstyle")||"before")}else t.setBreakAt(e);t.invalidateBBox()}this.state=s}createState(t){const e=t.getBBox().w;return{breaks:new Set,potential:[],width:0,w:0,prevWidth:0,prevBreak:null,depth:0,mathWidth:e,mathLeft:e}}breakLineToWidth(t,e){const s=this.state;s.potential=[],s.w=0,s.prevWidth=0,s.prevBreak=null,s.depth=0,this.visitNode(t,e)}addWidth(t,e=null){null===e&&(e=t.L+t.w+t.R),e&&(e*=t.rscale,this.state.w+=e,this.state.potential.length&&(this.state.potential[0][4]+=e),this.processBreak())}processBreak(){const t=this.state;for(;t.potential.length&&t.w>this.state.width;){const e=t.potential.pop(),[s,,i,n,r]=e;t.breaks.add(s),t.w=t.potential.reduce((t,e)=>t+e[4],n+r),t.prevBreak&&t.prevWidth+i<=t.width?(t.breaks.delete(t.prevBreak[0]),t.prevWidth+=i):t.prevWidth=i+n,t.potential.forEach(t=>t[2]-=i),t.prevBreak=e,t.mathLeft-=i}}pushBreak(t,e,s,i){var n;const r=this.state;if(!(e>=vo||0===r.w&&0===r.prevWidth)){for(;r.potential.length&&r.potential[0][1]>this.FACTORS.fuzz(e);){const t=r.potential.shift();r.potential.length&&(r.potential[0][4]+=t[4])}r.potential.unshift([[t,i],e,r.w-((null===(n=r.prevBreak)||void 0===n?void 0:n[3])||0),s,0])}}getBorderLR(t){var e;const s=t.styleData;if(!s)return[0,0];const i=(null===(e=null==s?void 0:s.border)||void 0===e?void 0:e.width)||[0,0,0,0],n=(null==s?void 0:s.padding)||[0,0,0,0];return[i[3]+n[3],i[1]+n[1]]}getFirstToken(t){return t.isToken?t:this.getFirstToken(t.childNodes[0])}getLastToken(t){return t.isToken?t:this.getLastToken(t.childNodes[t.childNodes.length-1])}visitNode(t,e){t&&(this.state.depth++,t.node.isEmbellished&&!t.node.isKind("mo")?this.visitEmbellishedOperator(t,e):super.visitNode(t,e),this.state.depth--)}visitDefault(t,e){var s;const i=t.getLineBBox(e);if(t.node.isToken||t.node.linebreakContainer||!(null===(s=t.childNodes)||void 0===s?void 0:s[0]))this.addWidth(i);else{const[s,n]=this.getBorderLR(t);0===e&&this.addWidth(i,i.L+s),this.visitNode(t.childNodes[0],e),e===t.breakCount&&this.addWidth(i,i.R+n)}}visitEmbellishedOperator(t,e){const s=t.coreMO(),i=To.from(t.getOuterBBox(),t.linebreakOptions.lineleading);i.getIndentData(s.node);const n=s.getBreakStyle(s.node.attributes.get("linebreakstyle")),r=s.processIndent("",i.indentData[1][1],"",i.indentData[0][1],this.state.width)[1],o=this.moPenalty(s);if("before"===n)this.pushBreak(t,o,r-i.L,null),this.addWidth(i);else{this.addWidth(i);const e=("after"===n?0:s.multChar?s.multChar.getBBox().w:i.w)+r;this.pushBreak(t,o,e,null)}}visitMoNode(t,e){const s=t,i=To.from(s.getOuterBBox(),s.linebreakOptions.lineleading);i.getIndentData(s.node);const n=s.getBreakStyle(s.node.attributes.get("linebreakstyle")),r=s.processIndent("",i.indentData[1][1],"",i.indentData[0][1],this.state.width)[1],o=this.moPenalty(s);if("before"===n)this.pushBreak(t,o,r-i.L,null),this.addWidth(i);else{this.addWidth(i);const e=("after"===n?0:s.multChar?s.multChar.getBBox().w:i.w)+r;this.pushBreak(t,o,e,null)}}moPenalty(t){const{linebreak:e,fence:s,form:i}=t.node.attributes.getList("linebreak","fence","form"),n=this.FACTORS;let r=n.tail(n.width(0));const o=s&&"prefix"===i||t.node.texClass===Oi.OPEN,a=s&&"postfix"===i||t.node.texClass===Oi.CLOSE;return o&&(r=n.open(r,t),this.state.depth++),a&&(r=n.close(r,t),this.state.depth--),r=(this.TEXCLASS[t.node.texClass]||(t=>t))(r),(this.PENALTY[e]||(t=>t))(n.depth(r))}getPrevious(t){let e=t.node,s=e.parent,i=s.childIndex(e);for(;s&&(s.notParent||s.isKind("mrow"))&&0===i;)e=s,s=e.parent,i=s.childIndex(e);if(!s||!i)return null;const n=s.childNodes[i-1];return n.isEmbellished?n.coreMO():null}visitMspaceNode(t,e){const s=t.getLineBBox(e),i=t;if(i.canBreak){const e=this.mspacePenalty(i);s.getIndentData(t.node);const n=t.processIndent("",s.indentData[1][1],"",s.indentData[0][1],this.state.width)[1];this.pushBreak(t,e,n-s.w,null)}this.addWidth(s)}mspacePenalty(t){const e=t.node.attributes.get("linebreak"),s=this.FACTORS,i=s.space(s.tail(s.width(0)),t);return(this.PENALTY[e]||(t=>t))(s.depth(i))}visitMtextNode(t,e){if(!t.getText().match(/ /))return void this.visitDefault(t,e);const s=t;s.clearBreakPoints();const i=s.textWidth(" "),n=t.getBBox(),[r,o]=this.getBorderLR(t);this.addWidth(n,n.L+r);const a=s.childNodes;for(const e of a.keys()){const r=a[e];if(r.node.isKind("text")){const o=r.node.getText().split(/ /),a=o.pop();for(const r of o.keys())this.addWidth(n,s.textWidth(o[r])),this.pushBreak(t,this.mtextPenalty(),-i,[e,r+1]),this.addWidth(n,i);this.addWidth(n,s.textWidth(a))}else this.addWidth(r.getBBox())}this.addWidth(n,n.R+o)}mtextPenalty(){const t=this.FACTORS;return t.depth(t.tail(t.width(0)))}visitMrowNode(t,e){const s=t.lineBBox[e]||t.getLineBBox(e),[i,n]=s.start||[0,0],[r,o]=s.end||[t.childNodes.length-1,0],[a,l]=this.getBorderLR(t);this.addWidth(s,s.L+a);for(let e=i;e<=r;e++)this.visitNode(t.childNodes[e],e===i?n:e===r?o:0);this.addWidth(s,s.R+l)}visitInferredMrowNode(t,e){this.state.depth--,this.visitMrowNode(t,e),this.state.depth++}visitMfracNode(t,e){const s=t;!s.node.attributes.get("bevelled")&&s.getOuterBBox().w>this.state.width&&(this.breakToWidth(s.childNodes[0],this.state.width),this.breakToWidth(s.childNodes[1],this.state.width)),this.visitDefault(t,e)}visitMsqrtNode(t,e){if(t.getOuterBBox().w>this.state.width){const e=t,s=e.childNodes[e.base];this.breakToWidth(s,this.state.width-e.rootWidth()),e.getStretchedSurd()}this.visitDefault(t,e)}visitMrootNode(t,e){this.visitMsqrtNode(t,e)}visitMsubNode(t,e){this.visitDefault(t,e);const s=t,i=s.getOffset()[0],n=s.scriptChild.getOuterBBox(),[r,o]=this.getBorderLR(t);this.addWidth(s.getLineBBox(e),i+r+n.rscale*n.w+s.font.params.scriptspace+o)}visitMsupNode(t,e){this.visitDefault(t,e);const s=t,i=s.getOffset()[0],n=s.scriptChild.getOuterBBox(),[r,o]=this.getBorderLR(t);this.addWidth(s.getLineBBox(e),i+r+n.rscale*n.w+s.font.params.scriptspace+o)}visitMsubsupNode(t,e){this.visitDefault(t,e);const s=t,i=s.subChild.getOuterBBox(),n=s.supChild.getOuterBBox(),r=s.getAdjustedIc(),o=Math.max(i.rscale*i.w,r+n.rscale*n.w)+s.font.params.scriptspace,[a,l]=this.getBorderLR(t);this.addWidth(t.getLineBBox(e),a+o+l)}visitMmultiscriptsNode(t,e){const s=t,i=s.scriptData;if(i.numPrescripts){const n=Math.max(i.psup.rscale*i.psup.w,i.psub.rscale*i.psub.w);this.addWidth(t.getLineBBox(e),n+s.font.params.scriptspace)}if(this.visitDefault(t,e),i.numScripts){const n=Math.max(i.sup.rscale*i.sup.w,i.sub.rscale*i.sub.w);this.addWidth(t.getLineBBox(e),n+s.font.params.scriptspace)}}visitMfencedNode(t,e){const s=t,i=t.getLineBBox(e),[n,r]=this.getBorderLR(t);0===e&&this.addWidth(i,i.L+n),this.visitNode(s.mrow,e),e===t.breakCount&&this.addWidth(i,i.R+r)}visitMactionNode(t,e){const s=t,i=t.getLineBBox(e),[n,r]=this.getBorderLR(t);0===e&&this.addWidth(i,i.L+n),this.visitNode(s.selected,e),e===t.breakCount&&this.addWidth(i,i.R+r)}}!function(){for(const t of Object.keys(Qi.postfix)){const e=Qi.postfix[t][3];e&&e.fence&&(e.linebreakstyle="after")}Qi.infix["\u2061"]=[...Qi.infix["\u2061"]],Qi.infix["\u2061"][3]={linebreak:"nobreak"}}();const Ro="@mathjax/%%FONT%%-font";class Io extends gi{get forceInlineBreaks(){return!1}constructor(t={},e=null,s=null){const[i,n]=t.fontData instanceof No?[t.fontData.constructor,t.fontData]:[t.fontData||s,null],[r,o]=si(t,i.OPTIONS);super(r),this.factory=this.options.wrapperFactory||new e,this.factory.jax=this,this.styleJson=this.options.styleJson||new vr,this.font=n||new i(o),this.font.setOptions({mathmlSpacing:this.options.mathmlSpacing}),this.constructor.genericFont=i,this.unknownCache=new Map;const a=this.options.linebreaks.LinebreakVisitor||Co;this.linebreaks=new a(this.factory)}setAdaptor(t){super.setAdaptor(t),"auto"===this.options.htmlHDW&&(this.options.htmlHDW=t.canMeasureNodes?"ignore":"force")}addExtension(t,e=""){return this.font.addExtension(t,e)}typeset(t,e){const s=this.constructor,i=s.genericFont;s.genericFont=this.font.constructor,this.setDocument(e);const n=this.createNode();try{this.toDOM(t,n,e)}finally{s.genericFont=i}return n}createNode(){const t=this.constructor.NAME;return this.html("mjx-container",{class:"MathJax",jax:t})}setScale(t,e){let s=this.getInitialScale()*this.options.scale;if("scale"===e.node.attributes.get("overflow")&&this.math.display){const t=e.getOuterBBox().w,i=Math.max(0,this.math.metrics.containerWidth-4)/this.pxPerEm;t>i&&t&&(s*=i/t)}1!==s&&this.adaptor.setStyle(t,"fontSize",kr(s))}getInitialScale(){return this.math.metrics.scale}toDOM(t,e,s=null){var i;this.setDocument(s),this.math=t,this.container=e,this.pxPerEm=t.metrics.ex/this.font.params.x_height,this.executeFilters(this.preFilters,t,s,e),this.nodeMap=new Map,t.root.attributes.getAllInherited().overflow=this.options.displayOverflow;const n=t.root.attributes.get("overflow");this.adaptor.setAttribute(e,"overflow",n);"linebreak"===n&&this.getLinebreakWidth();const r=this.options.linebreaks.inline&&!t.display;let o=!!t.root.getProperty("inlineMarked");!o||r&&this.forceInlineBreaks===t.root.getProperty("inlineForced")||(this.unmarkInlineBreaks(t.root),t.root.removeProperty("inlineMarked"),t.root.removeProperty("inlineForced"),o=!1),r&&!o&&(this.markInlineBreaks(null===(i=t.root.childNodes)||void 0===i?void 0:i[0]),t.root.setProperty("inlineMarked",!0),t.root.setProperty("inlineForced",this.forceInlineBreaks)),t.root.setTeXclass(null);const a=this.factory.wrap(t.root);this.setScale(e,a),this.processMath(a,e),this.nodeMap=null,this.executeFilters(this.postFilters,t,s,e)}getBBox(t,e){this.setDocument(e),this.math=t,t.root.setTeXclass(null),this.nodeMap=new Map;const s=this.factory.wrap(t.root).getOuterBBox();return this.nodeMap=null,s}getLinebreakWidth(){const t=this.math.metrics.containerWidth/this.pxPerEm,e=this.math.root.attributes.get("maxwidth")||this.options.linebreaks.width;this.containerWidth=Dr(e,t,1,this.pxPerEm)}markInlineBreaks(t){if(!t)return;const e=this.forceInlineBreaks;let s=!1,i=!1,n="";for(const r of t.childNodes)if(n)i=this.markInlineBreak(i,e,n,t,r),n="",s=!1;else if(r.isEmbellished){if(r===t.childNodes[0])continue;const o=r.coreMO(),a=o.texClass,l=o.attributes.get("linebreak"),h=o.attributes.get("linebreakstyle");(a===Oi.BIN||a===Oi.REL||a===Oi.ORD&&o.hasSpacingAttributes()||"auto"!==l)&&"nobreak"!==l&&("before"===h?s&&"auto"===l||(i=this.markInlineBreak(i,e,l,t,r,o)):n=l),s="newline"===l&&"after"===h}else if(r.isKind("mspace")){const n=r.attributes.get("linebreak");"nobreak"!==n&&r.canBreak&&(i=this.markInlineBreak(i,e,n,t,r)),s="newline"===n}else s=!1,r.isKind("mstyle")&&!r.attributes.get("style")&&!r.attributes.hasExplicit("mathbackground")||r.isKind("semantics")?(this.markInlineBreaks(r.childNodes[0]),r.getProperty("process-breaks")&&(r.setProperty("inline-breaks",!0),r.childNodes[0].setProperty("inline-breaks",!0),t.parent.setProperty("process-breaks","true"))):r.isKind("mrow")&&r.attributes.get("data-semantic-added")&&(this.markInlineBreaks(r),r.getProperty("process-breaks")&&(r.setProperty("inline-breaks",!0),t.parent.setProperty("process-breaks","true")))}markInlineBreak(t,e,s,i,n,r=null){return n.setProperty("breakable",!0),e&&"newline"!==s?(n.setProperty("forcebreak",!0),null==r||r.setProperty("forcebreak",!0)):(n.removeProperty("forcebreak"),null==r||r.removeProperty("forcebreak"),"newline"===s&&n.setProperty("newline",!0)),t||(i.setProperty("process-breaks",!0),i.parent.setProperty("process-breaks",!0),t=!0),t}unmarkInlineBreaks(t){if(t&&(t.removeProperty("forcebreak"),t.removeProperty("breakable"),t.coreMO().removeProperty("forcebreak"),t.getProperty("process-breaks"))){t.removeProperty("process-breaks");for(const e of t.childNodes)this.unmarkInlineBreaks(e)}}getMetrics(t){this.setDocument(t);const e=this.adaptor,s=this.getMetricMaps(t);for(const i of t.math){const t=e.parent(i.start.node);if(i.state()<vi.METRICS&&t){const e=s[i.display?1:0],{em:n,ex:r,containerWidth:o,scale:a,family:l}=e.get(t);i.setMetrics(n,r,o,a),this.options.mtextInheritFont&&(i.outputData.mtextFamily=l),this.options.merrorInheritFont&&(i.outputData.merrorFamily=l),i.state(vi.METRICS)}}}getMetricsFor(t,e){const s=this.options.mtextInheritFont||this.options.merrorInheritFont,i=this.getTestElement(t,e),n=Object.assign(Object.assign({},this.measureMetrics(i,s)),{display:e});return this.adaptor.remove(i),n}getMetricMaps(t){const e=this.adaptor,s=[new Map,new Map];for(const i of t.math){const t=e.parent(i.start.node);if(t&&i.state()<vi.METRICS){const e=s[i.display?1:0];e.has(t)||e.set(t,this.getTestElement(t,i.display))}}const i=this.options.mtextInheritFont||this.options.merrorInheritFont,n=[new Map,new Map];for(const t of n.keys())for(const e of s[t].keys())n[t].set(e,this.measureMetrics(s[t].get(e),i));for(const t of n.keys())for(const i of s[t].values())e.remove(i);return n}getTestElement(t,e){const s=this.adaptor;if(!this.testInline){this.testInline=this.html("mjx-test",{style:{display:"inline-block",width:"100%","font-style":"normal","font-weight":"normal","font-size":"100%","font-size-adjust":"none","text-indent":0,"text-transform":"none","letter-spacing":"normal","word-spacing":"normal",overflow:"hidden",height:"1px","margin-right":"-1px"}},[this.html("mjx-left-box",{style:{display:"inline-block",width:0,float:"left"}}),this.html("mjx-ex-box",{style:{position:"absolute",overflow:"hidden",width:"1px",height:"60ex"}}),this.html("mjx-right-box",{style:{display:"inline-block",width:0,float:"right"}})]),this.testDisplay=s.clone(this.testInline),s.setStyle(this.testDisplay,"display","table"),s.setStyle(this.testDisplay,"margin-right",""),s.setStyle(s.firstChild(this.testDisplay),"display","none");const t=s.lastChild(this.testDisplay);s.setStyle(t,"display","table-cell"),s.setStyle(t,"width","10000em"),s.setStyle(t,"float","")}return s.append(t,s.clone(e?this.testDisplay:this.testInline))}measureMetrics(t,e){const s=this.adaptor,i=e?s.fontFamily(t):"",n=s.fontSize(t),[r,o]=s.nodeSize(s.childNode(t,1)),a=r?o/60:n*this.options.exFactor;return{em:n,ex:a,containerWidth:r?"table"===s.getStyle(t,"display")?s.nodeSize(s.lastChild(t))[0]-1:s.nodeBBox(s.lastChild(t)).left-s.nodeBBox(s.firstChild(t)).left-2:1e6,scale:Math.max(this.options.minScale,this.options.matchFontHeight?a/this.font.params.x_height/n:1),family:i}}styleSheet(t){if(this.setDocument(t),this.styleJson.clear(),this.styleJson.addStyles(this.constructor.commonStyles),"getStyles"in t)for(const e of t.getStyles())this.styleJson.addStyles(e);this.addWrapperStyles(this.styleJson),this.addFontStyles(this.styleJson);return this.html("style",{id:"MJX-styles"},[this.text("\n"+this.styleJson.cssText+"\n")])}addFontStyles(t){t.addStyles(this.font.styles)}addWrapperStyles(t){for(const e of this.factory.getKinds())this.addClassStyles(this.factory.getNodeClass(e),t)}addClassStyles(t,e){t.addStyles(e,this)}insertStyles(t){}setDocument(t){t&&(this.document=t,this.adaptor.document=t.document)}html(t,e={},s=[],i){return this.adaptor.node(t,e,s,i)}text(t){return this.adaptor.text(t)}fixed(t,e=3){return Math.abs(t)<6e-4?"0":t.toFixed(e).replace(/\.?0+$/,"")}measureText(t,e,s=["",!1,!1]){const i=this.unknownText(t,e);if("-explicitFont"===e){const t=this.cssFontStyles(s);this.adaptor.setAttributes(i,{style:t})}return this.measureTextNodeWithCache(i,t,e,s)}measureTextNodeWithCache(t,e,s,i=["",!1,!1]){"-explicitFont"===s&&(s=[i[0],i[1]?"T":"F",i[2]?"T":"F",""].join("-")),this.unknownCache.has(s)||this.unknownCache.set(s,new Map);const n=this.unknownCache.get(s),r=n.get(e);if(r)return r;const o=this.measureTextNode(t);return n.set(e,o),o}cssFontStyles(t,e={}){const[s,i,n]=t;return e["font-family"]=this.font.getFamily(s),i&&(e["font-style"]="italic"),n&&(e["font-weight"]="bold"),e}getFontData(t){return t||(t=new ro),[this.font.getFamily(t.get("font-family")),"italic"===t.get("font-style"),"bold"===t.get("font-weight")]}}Io.NAME="Common",Io.OPTIONS=Object.assign(Object.assign({},gi.OPTIONS),{scale:1,minScale:.5,mtextInheritFont:!1,merrorInheritFont:!1,mtextFont:"",merrorFont:"serif",mathmlSpacing:!1,skipAttributes:{},exFactor:.5,displayAlign:"center",displayIndent:"0",displayOverflow:"overflow",linebreaks:{inline:!0,width:"100%",lineleading:.2,LinebreakVisitor:null},font:"",fontExtensions:[],htmlHDW:"auto",wrapperFactory:null,fontData:null,fontPath:Ro,styleJson:null}),Io.commonStyles={'mjx-container[overflow="scroll"][display]':{overflow:"auto clip","min-width":"initial !important"},'mjx-container[overflow="truncate"][display]':{overflow:"hidden clip","min-width":"initial !important"},"mjx-container[display]":{display:"block","text-align":"center","justify-content":"center",margin:".7em 0",padding:".3em 2px"},'mjx-container[display][width="full"]':{display:"flex"},'mjx-container[justify="left"]':{"text-align":"left","justify-content":"left"},'mjx-container[justify="right"]':{"text-align":"right","justify-content":"right"}};class So extends fr{constructor(){super(...arguments),this.jax=null}get Wrappers(){return this.node}}So.defaultNodes={};const Ao=2/18,wo=5/18;function Oo(t,e,s){return e?t?Ao:wo:t?s<Ao?0:Ao:s}const Mo={[Pr(0)]:"0",[Pr(2/18)]:"1",[Pr(3/18)]:"2",[Pr(4/18)]:"3",[Pr(5/18)]:"4",[Pr(6/18)]:"5"};class Do extends mr{static addStyles(t,e){t.addStyles(this.styles)}get jax(){return this.factory.jax}get adaptor(){return this.factory.jax.adaptor}get metrics(){return this.factory.jax.math.metrics}get containerWidth(){return this.parent?this.parent.containerWidth:this.jax.containerWidth}get linebreaks(){return this.jax.linebreaks}get linebreakOptions(){return this.jax.options.linebreaks}get fixesPWidth(){return!this.node.notParent&&!this.node.isToken}get breakCount(){if(this._breakCount<0){const t=this.node;this._breakCount=t.isEmbellished?this.coreMO().embellishedBreakCount:t.arity<0&&!t.linebreakContainer&&this.childNodes[0].isStack?this.childNodes[0].breakCount:0}return this._breakCount}breakTop(t,e){return this.node.linebreakContainer||!this.parent?t:this.parent.breakTop(t,this)}constructor(t,e,s=null){super(t,e),this.parent=null,this.dom=null,this.removedStyles=null,this.styles=null,this.styleData=null,this.variant="",this.bboxComputed=!1,this._breakCount=-1,this.lineBBox=[],this.stretch=xo,this.font=null,this.parent=s,this.font=t.jax.font,this.bbox=jr.zero(),this.getStyles(),this.getStyleData(),this.getVariant(),this.getScale(),this.getSpace(),this.childNodes=e.childNodes.map(t=>{const s=this.wrap(t);return s.bbox.pwidth&&(e.notParent||e.isKind("math"))&&(this.bbox.pwidth=jr.fullWidth),s})}wrap(t,e=null){const s=this.factory.wrap(t,e||this);return e&&e.childNodes.push(s),this.jax.nodeMap.set(t,s),s}getBBox(t=!0){if(this.bboxComputed)return this.bbox;const e=t?this.bbox:jr.zero();return this.computeBBox(e),this.bboxComputed=t,e}getOuterBBox(t=!0){var e;const s=this.getBBox(t);if(!this.styleData)return s;const i=this.styleData.padding,n=(null===(e=this.styleData.border)||void 0===e?void 0:e.width)||[0,0,0,0],r=this.styleData.margin||[0,0,0,0],o=s.copy();for(const[,t,e]of jr.boxSides)o[e]+=i[t]+n[t]+r[t];return o}getUnbrokenHD(){const t=this.breakCount+1;let e=0,s=0;for(let i=0;i<t;i++){const{h:t,d:n}=this.getLineBBox(i);t>e&&(e=t),n>s&&(s=n)}return[e,s]}computeBBox(t,e=!1){t.empty();for(const e of this.childNodes)t.append(e.getOuterBBox());t.clean(),this.fixesPWidth&&this.setChildPWidths(e)&&this.computeBBox(t,!0)}getLineBBox(t){if(!this.lineBBox[t]){const e=this.breakCount;if(e){const s=this.embellishedBBox(t)||this.computeLineBBox(t);this.lineBBox[t]=s,0===t&&(!this.node.isKind("mo")&&this.node.isEmbellished?s.originalL=this.getBBox().L:s.L=this.getBBox().L),t===e&&(s.R=this.getBBox().R)}else{const e=this.getOuterBBox();this.lineBBox[t]=To.from(e,this.linebreakOptions.lineleading)}}return this.lineBBox[t]}embellishedBBox(t){if(!this.node.isEmbellished||this.node.isKind("mo"))return null;const e=this.coreMO();return e.moLineBBox(t,e.embellishedBreakStyle,this.getOuterBBox())}computeLineBBox(t){return this.getChildLineBBox(this.childNodes[0],t)}getBreakNode(t){var e,s;if(!t.start)return[this,null];const[i,n]=t.start;if(this.node.isEmbellished)return[this,this.coreMO()];const r=(null===(s=null===(e=this.childNodes[0])||void 0===e?void 0:e.node)||void 0===s?void 0:s.isInferred)||this.node.isKind("semantics")?this.childNodes[0].childNodes:this.childNodes;return this.node.isToken||!r[i]?[this,null]:r[i].getBreakNode(r[i].getLineBBox(n))}getChildLineBBox(t,e){const s=this.breakCount;let i=t.getLineBBox(e);return(this.styleData||this.bbox.L||this.bbox.R)&&(i=i.copy()),this.addMiddleBorders(i),0===e?(i.L+=this.bbox.L,this.addLeftBorders(i)):e===s&&(i.R+=this.bbox.R,this.addRightBorders(i)),i}sideStyleSize(t){var e;const s=this.styleData.border,i=this.styleData.padding,n=this.styleData.margin;return((null===(e=null==s?void 0:s.width)||void 0===e?void 0:e[t])||0)+((null==i?void 0:i[t])||0)+((null==n?void 0:n[t])||0)}addLeftBorders(t){this.styleData&&(t.w+=this.sideStyleSize(3))}addMiddleBorders(t){this.styleData&&(t.h+=this.sideStyleSize(0),t.d+=this.sideStyleSize(2))}addRightBorders(t){this.styleData&&(t.w+=this.sideStyleSize(1))}setChildPWidths(t,e=null,s=!0){if(t)return!1;s&&(this.bbox.pwidth="");let i=!1;for(const n of this.childNodes){const r=n.getBBox();r.pwidth&&n.setChildPWidths(t,null===e?r.w:e,s)&&(i=!0)}return i}breakToWidth(t){}invalidateBBox(t=!0){(this.bboxComputed||this._breakCount>=0)&&(this.bboxComputed=!1,this.lineBBox=[],this._breakCount=-1,this.parent&&t&&this.parent.invalidateBBox())}copySkewIC(t){var e,s,i;const n=this.childNodes[0];(null===(e=null==n?void 0:n.bbox)||void 0===e?void 0:e.sk)&&(t.sk=n.bbox.sk),(null===(s=null==n?void 0:n.bbox)||void 0===s?void 0:s.dx)&&(t.dx=n.bbox.dx);const r=this.childNodes[this.childNodes.length-1];(null===(i=null==r?void 0:r.bbox)||void 0===i?void 0:i.ic)&&(t.ic=r.bbox.ic,t.w+=t.ic)}getStyles(){const t=this.node.attributes.getExplicit("style");if(!t)return;const e=this.styles=new ro(t);for(let t=0,s=Do.removeStyles.length;t<s;t++){const s=Do.removeStyles[t];e.get(s)&&(this.removedStyles||(this.removedStyles={}),this.removedStyles[s]=e.get(s),e.set(s,""))}}getStyleData(){if(!this.styles)return;const t=Array(4).fill(0),e=Array(4).fill(0),s=Array(4).fill(0),i=Array(4),n=Array(4);let r=!1,o=!1,a=!1;for(const[l,h]of jr.boxSides){const c="border"+l,d=this.styles.get(c+"Width");d&&(o=!0,s[h]=Math.max(0,this.length2em(d,1)),i[h]=this.styles.get(c+"Style")||"solid",n[h]=this.styles.get(c+"Color"));const u=this.styles.get("padding"+l);u&&(r=!0,t[h]=Math.max(0,this.length2em(u,1)));const p=this.styles.get("margin"+l);p&&(a=!0,e[h]=this.length2em(p,1))}this.styleData=r||o||a?{padding:t,margin:e,border:o?{width:s,style:i,color:n}:null}:null}getVariant(){if(!this.node.isToken)return;const t=this.node.attributes;let e=t.get("mathvariant");if(t.hasExplicit("mathvariant"))this.font.getVariant(e)||(console.warn(`Invalid variant: ${e}`),e="normal");else{const s=t.getList("fontfamily","fontweight","fontstyle");if(this.removedStyles){const t=this.removedStyles;t.fontFamily&&(s.family=t.fontFamily),t.fontWeight&&(s.weight=t.fontWeight),t.fontStyle&&(s.style=t.fontStyle)}s.fontfamily&&(s.family=s.fontfamily),s.fontweight&&(s.weight=s.fontweight),s.fontstyle&&(s.style=s.fontstyle),s.weight&&s.weight.match(/^\d+$/)&&(s.weight=parseInt(s.weight)>600?"bold":"normal"),s.family?e=this.explicitVariant(s.family,s.weight,s.style):(this.node.getProperty("variantForm")&&(e="-tex-variant"),e=(Do.BOLDVARIANTS[s.weight]||{})[e]||e,e=(Do.ITALICVARIANTS[s.style]||{})[e]||e)}this.variant=e}explicitVariant(t,e,s){let i=this.styles;return i||(i=this.styles=new ro),i.set("fontFamily",t),e&&i.set("fontWeight",e),s&&i.set("fontStyle",s),"-explicitFont"}getScale(){let t=1;const e=this.parent,s=e?e.bbox.scale:1,i=this.node.attributes,n=Math.min(i.get("scriptlevel"),2);let r=i.get("fontsize"),o=this.node.isToken||this.node.isKind("mstyle")?i.get("mathsize"):i.getInherited("mathsize");if(0!==n&&(t=Math.pow(i.get("scriptsizemultiplier"),n)),this.removedStyles&&this.removedStyles.fontSize&&!r&&(r=this.removedStyles.fontSize),r&&!i.hasExplicit("mathsize")&&(o=r),"1"!==o&&(t*=this.length2em(o,1,1)),0!==n){const e=this.length2em(i.get("scriptminsize"),.4,1);t<e&&(t=e)}this.bbox.scale=t,this.bbox.rscale=t/s}getSpace(){const t=this.isTopEmbellished(),e=this.node.hasSpacingAttributes();this.jax.options.mathmlSpacing||e?t&&this.getMathMLSpacing():this.getTeXSpacing(t,e)}getMathMLSpacing(){const t=this.node.coreMO(),e=t.coreParent(),s=e.parent;if(!s||!s.isKind("mrow")||1===s.childNodes.length)return;const i=s.childIndex(e);if(null===i)return;const n=t.getProperty("noDictDef"),r=t.attributes,o=r.get("scriptlevel")>0;if(this.bbox.L=r.isSet("lspace")?Math.max(0,this.length2em(r.get("lspace"))):Oo(o,n,t.lspace),this.bbox.R=r.isSet("rspace")?Math.max(0,this.length2em(r.get("rspace"))):Oo(o,n,t.rspace),!i)return;const a=s.childNodes[i-1];if(!a.isEmbellished)return;const l=this.jax.nodeMap.get(a).getBBox();l.R&&(this.bbox.L=Math.max(0,this.bbox.L-l.R))}getTeXSpacing(t,e){if(!e){const t=this.node.texSpacing();t&&(this.bbox.L=this.length2em(t))}if(t||e){const t=this.node.coreMO().attributes;t.isSet("lspace")&&(this.bbox.L=Math.max(0,this.length2em(t.get("lspace")))),t.isSet("rspace")&&(this.bbox.R=Math.max(0,this.length2em(t.get("rspace"))))}}isTopEmbellished(){return this.node.isEmbellished&&!(this.node.parent&&this.node.parent.isEmbellished)}core(){return this.jax.nodeMap.get(this.node.core())}coreMO(){return this.jax.nodeMap.get(this.node.coreMO())}coreRScale(){let t=this.bbox.rscale,e=this.coreMO();for(;e!==this&&e;)t*=e.bbox.rscale,e=e.parent;return t}getRScale(){let t=1,e=this;for(;e;)t*=e.bbox.rscale,e=e.parent;return t}getText(){let t="";if(this.node.isToken)for(const e of this.node.childNodes)e instanceof Wi&&(t+=e.getText());return t}canStretch(t){if(this.stretch=xo,this.node.isEmbellished){const e=this.core();e&&e.node!==this.node&&e.canStretch(t)&&(this.stretch=e.stretch)}return this.stretch.dir!==po.None}getAlignShift(){let{indentalign:t,indentshift:e,indentalignfirst:s,indentshiftfirst:i}=this.node.attributes.getAllAttributes();return"indentalign"!==s&&(t=s),"indentshift"!==i&&(e=i),this.processIndent(t,e)}processIndent(t,e,s="",i="",n=this.metrics.containerWidth){if(!this.jax.math.display)return["left",0];s&&"auto"!==s||(s=this.jax.math.root.getProperty("inlineMarked")?"left":this.jax.options.displayAlign),i&&"auto"!==i||(i=this.jax.math.root.getProperty("inlineMarked")?"0":this.jax.options.displayIndent),"auto"===t&&(t=s),"auto"===e&&(e=i,"right"!==t||e.match(/^\s*0[a-z]*\s*$/)||(e=("-"+e.trim()).replace(/^--/,"")));return[t,this.length2em(e,n)]}getAlignX(t,e,s){return"right"===s?t-(e.w+e.R)*e.rscale:"left"===s?e.L*e.rscale:(t-e.w*e.rscale)/2}getAlignY(t,e,s,i,n){return"top"===n?t-s:"bottom"===n?i-e:"center"===n?(t-s-(e-i))/2:0}getWrapWidth(t){return this.childNodes[t].getBBox().w}getChildAlign(t){return"left"}percent(t){return kr(t)}em(t){return Pr(t)}px(t,e=-Ar){return Br(t,e,this.metrics.em)}length2em(t,e=1,s=null){null===s&&(s=this.bbox.scale);const i=this.font.params.rule_thickness,n=ii(t,{medium:1,thin:2/3,thick:5/3},0);return n?n*i:Dr(t,e,s,this.jax.pxPerEm)}unicodeChars(t,e=this.variant){let s=en(t);const i=this.font.getVariant(e);if(i&&i.chars){const t=i.chars;s=s.map(e=>{var s,i;return(null===(i=null===(s=t[e])||void 0===s?void 0:s[3])||void 0===i?void 0:i.smp)||e})}return s}remapChars(t){return t}mmlText(t){return this.node.factory.create("text").setText(t)}mmlNode(t,e={},s=[]){return this.node.factory.create(t,e,s)}createMo(t){const e=this.node.factory,s=e.create("text").setText(t),i=e.create("mo",{stretchy:!0},[s]);i.inheritAttributesFrom(this.node),i.parent=this.node.parent;const n=this.wrap(i);return n.parent=this,n}getVariantChar(t,e){const s=this.font.getChar(t,e)||[0,0,0,{unknown:!0}];return 3===s.length&&(s[3]={}),s}html(t,e={},s=[]){return this.jax.html(t,e,s)}}Do.kind="unknown",Do.styles={},Do.removeStyles=["fontSize","fontFamily","fontWeight","fontStyle","fontVariant","font"],Do.skipAttributes={fontfamily:!0,fontsize:!0,fontweight:!0,fontstyle:!0,color:!0,background:!0,class:!0,href:!0,style:!0,xmlns:!0},Do.BOLDVARIANTS={bold:{normal:"bold",italic:"bold-italic",fraktur:"bold-fraktur",script:"bold-script","sans-serif":"bold-sans-serif","sans-serif-italic":"sans-serif-bold-italic"},normal:{bold:"normal","bold-italic":"italic","bold-fraktur":"fraktur","bold-script":"script","bold-sans-serif":"sans-serif","sans-serif-bold-italic":"sans-serif-italic"}},Do.ITALICVARIANTS={italic:{normal:"italic",bold:"bold-italic","sans-serif":"sans-serif-italic","bold-sans-serif":"sans-serif-bold-italic"},normal:{italic:"normal","bold-italic":"bold","sans-serif-italic":"sans-serif","sans-serif-bold-italic":"bold-sans-serif"}};const ko={"70.7%":"s","70%":"s","50%":"ss","60%":"Tn","85%":"sm","120%":"lg","144%":"Lg","173%":"LG","207%":"hg","249%":"HG"};class Po extends Do{toCHTML(t){this.toEmbellishedCHTML(t)||this.addChildren(this.standardChtmlNodes(t))}toEmbellishedCHTML(t){if(t.length<=1||!this.node.isEmbellished)return!1;const e=this.adaptor;t.forEach(t=>e.append(t,this.html("mjx-linestrut")));const s=this.coreMO().embellishedBreakStyle,i=[];for(const[n,r]of[[t[0],"before"],[t[1],"after"]])s!==r?(this.toCHTML([n]),i.push(this.dom[0]),"after"===r&&e.removeAttribute(this.dom[0],"space")):i.push(this.createChtmlNodes([n])[0]);return this.dom=i,!0}addChildren(t){for(const e of this.childNodes)e.toCHTML(t)}standardChtmlNodes(t){this.markUsed();const e=this.createChtmlNodes(t);return this.handleStyles(),this.handleScale(),this.handleBorders(),this.handleColor(),this.handleSpace(),this.handleAttributes(),this.handlePWidth(),e}markUsed(){this.jax.wrapperUsage.add(this.kind)}createChtmlNodes(t){this.dom=t.map(t=>this.html("mjx-"+this.node.kind)),t=this.handleHref(t);for(const e of t.keys())this.adaptor.append(t[e],this.dom[e]);return this.dom}handleHref(t){const e=this.node.attributes.get("href");return e?t.map(t=>this.adaptor.append(t,this.html("a",{href:e}))):t}handleStyles(){if(!this.styles)return;const t=this.styles.cssText;if(t){const e=this.adaptor;this.dom.forEach(s=>e.setAttribute(s,"style",t));const s=this.styles.get("font-family");s&&this.dom.forEach(t=>e.setStyle(t,"font-family",this.font.cssFamilyPrefix+", "+s))}}handleScale(){this.dom.forEach(t=>this.setScale(t,this.bbox.rscale))}setScale(t,e){const s=Math.abs(e-1)<.001?1:e;if(t&&1!==s){const e=this.percent(s);ko[e]?this.adaptor.setAttribute(t,"size",ko[e]):this.adaptor.setStyle(t,"fontSize",e)}return t}handleSpace(){const t=this.adaptor,e=!!this.node.getProperty("breakable")&&!this.node.getProperty("newline"),s=this.dom.length-1;for(const i of[[this.getLineBBox(0).L,"space","marginLeft",0],[this.getLineBBox(s).R,"rspace","marginRight",s]]){const[s,n,r,o]=i,a=this.em(s);if(e&&"space"===n){const e=t.node("mjx-break",Mo[a]?{size:Mo[a]}:{style:`letter-spacing: ${this.em(s-1)}`},[t.text(" ")]);t.insert(e,this.dom[o])}else s&&(Mo[a]?t.setAttribute(this.dom[o],n,Mo[a]):t.setStyle(this.dom[o],r,a))}}handleBorders(){var t,e;const s=null===(t=this.styleData)||void 0===t?void 0:t.border,i=null===(e=this.styleData)||void 0===e?void 0:e.padding,n=this.dom.length-1;if(!s||!n)return;const r=this.adaptor;for(const t of this.dom.keys()){const e=this.dom[t];t&&(s.width[3]&&r.setStyle(e,"border-left"," none"),i[3]&&r.setStyle(e,"padding-left","0")),t!==n&&(s.width[1]&&r.setStyle(e,"border-right","none"),i[1]&&r.setStyle(e,"padding-right","0"))}}handleColor(){var t;const e=this.adaptor,s=this.node.attributes,i=s.getExplicit("mathcolor")||s.getExplicit("color"),n=s.getExplicit("mathbackground")||s.getExplicit("background")||(null===(t=this.styles)||void 0===t?void 0:t.get("background-color"));i&&this.dom.forEach(t=>e.setStyle(t,"color",i)),n&&this.dom.forEach(t=>e.setStyle(t,"backgroundColor",n))}handleAttributes(){const t=this.adaptor,e=this.node.attributes,s=e.getAllDefaults(),i=Po.skipAttributes;for(const n of e.getExplicitNames())if(!1===i[n]||!(n in s)&&!i[n]&&!t.hasAttribute(this.dom[0],n)){const s=e.getExplicit(n);this.dom.forEach(e=>t.setAttribute(e,n,s))}if(e.get("class")){const s=e.get("class").trim().split(/ +/);for(const e of s)this.dom.forEach(s=>t.addClass(s,e))}this.node.getProperty("inline-breaks")&&this.dom.forEach(e=>t.setAttribute(e,"inline-breaks","true"))}handlePWidth(){if(this.bbox.pwidth){const t=this.adaptor;this.bbox.pwidth===jr.fullWidth?this.dom.forEach(e=>t.setAttribute(e,"width","full")):this.dom.forEach(e=>t.setStyle(e,"width",this.bbox.pwidth))}}setIndent(t,e,s){const i=this.adaptor;if("center"===e||"left"===e){const e=this.getBBox().L;s+e&&i.setStyle(t,"margin-left",this.em(s+e))}if("center"===e||"right"===e){const e=this.getBBox().R;s+e&&i.setStyle(t,"margin-right",this.em(-s+e))}}drawBBox(){const{w:t,h:e,d:s,R:i}=this.getOuterBBox(),n=this.html("mjx-box",{style:{opacity:.25,"margin-left":this.em(-t-i)}},[this.html("mjx-box",{style:{height:this.em(e),width:this.em(t),"background-color":"red"}}),this.html("mjx-box",{style:{height:this.em(s),width:this.em(t),"margin-left":this.em(-t),"vertical-align":this.em(-s),"background-color":"green"}})]),r=this.dom[0]||this.parent.dom[0],o=this.adaptor.getAttribute(r,"size");o&&this.adaptor.setAttribute(n,"size",o);const a=this.adaptor.getStyle(r,"fontSize");a&&this.adaptor.setStyle(n,"fontSize",a),this.adaptor.append(this.adaptor.parent(r),n),this.adaptor.setStyle(r,"backgroundColor","#FFEE00")}html(t,e={},s=[]){return this.jax.html(t,e,s)}text(t){return this.jax.text(t)}char(t){return this.font.charSelector(t).substring(1)}}function Bo(t){return class extends t{getWrapWidth(t){return this.parent?this.getBBox().w:this.metrics.containerWidth/this.jax.pxPerEm}computeBBox(t,e=!1){super.computeBBox(t,e);const s=this.node.attributes;if(!this.parent&&this.jax.math.display&&"linebreak"===s.get("overflow")){const e=this.containerWidth;t.w>e&&this.childNodes[0].breakToWidth(e),t.updateFrom(this.childNodes[0].getBBox())}}}}Po.kind="unknown",Po.autoStyle=!0;const jo=function(){var t;const e=Bo(Po);return(t=class extends e{handleDisplay(t){const e=this.adaptor,[s,i]=this.getAlignShift();if("center"!==s&&e.setAttribute(t,"justify",s),this.bbox.pwidth===jr.fullWidth){if(e.setAttribute(t,"width","full"),this.jax.table){let{L:n,w:r,R:o}=this.jax.table.getOuterBBox();"right"===s?o=Math.max(o||-i,-i):"left"===s?n=Math.max(n||i,i):"center"===s&&(r+=2*Math.abs(i));const a=this.em(Math.max(0,n+r+o));e.setStyle(t,"min-width",a),e.setStyle(this.jax.table.dom[0],"min-width",a)}}else this.setIndent(this.dom[0],s,i)}handleInline(t){const e=this.adaptor,s=e.getStyle(this.dom[0],"margin-right");s&&(e.setStyle(this.dom[0],"margin-right",""),e.setStyle(t,"margin-right",s),e.setStyle(t,"width","0"))}toCHTML(t){super.toCHTML(t);const e=this.adaptor;"block"===this.node.attributes.get("display")?(e.setAttribute(this.dom[0],"display","true"),e.setAttribute(t[0],"display","true"),this.handleDisplay(t[0])):this.handleInline(t[0]),e.addClass(this.dom[0],`${this.font.cssFontPrefix}-N`)}setChildPWidths(t,e=null,s=!0){return!!this.parent&&super.setChildPWidths(t,e,s)}handleAttributes(){super.handleAttributes();const t=this.adaptor;this.node.getProperty("process-breaks")&&this.dom.forEach(e=>t.setAttribute(e,"breakable","true"))}}).kind=qi.prototype.kind,t.styles={"mjx-math":{"line-height":0,"text-align":"left","text-indent":0,"font-style":"normal","font-weight":"normal","font-size":"100%","font-size-adjust":"none","letter-spacing":"normal","word-wrap":"normal","word-spacing":"normal",direction:"ltr",padding:"1px 0"},'mjx-container[jax="CHTML"][display="true"] mjx-math':{padding:0},"mjx-math[breakable]":{display:"inline"},'mjx-container[jax="CHTML"] mjx-break':{"white-space":"normal","line-height":"0","clip-path":"rect(0 0 0 0)","font-family":"MJX-BRK !important"},'mjx-break[size="0"]':{"letter-spacing":"-0.999em"},'mjx-break[size="1"]':{"letter-spacing":"-0.889em"},'mjx-break[size="2"]':{"letter-spacing":"-0.833em"},'mjx-break[size="3"]':{"letter-spacing":"-0.778em"},'mjx-break[size="4"]':{"letter-spacing":"-0.722em"},'mjx-break[size="5"]':{"letter-spacing":"-0.667em"}},t}();function _o(t){return class extends t{computeBBox(t,e=!1){super.computeBBox(t),this.copySkewIC(t)}}}const Fo=function(){var t;const e=_o(Po);return(t=class extends e{}).kind=Xi.prototype.kind,t}();class Uo{constructor(){this.used=new Set,this.needsUpdate=[]}add(t){const e=JSON.stringify(t);this.used.has(e)||this.needsUpdate.push(t),this.used.add(e)}has(t){return this.used.has(JSON.stringify(t))}clear(){this.used.clear(),this.needsUpdate=[]}update(){const t=this.needsUpdate;return this.needsUpdate=[],t}}class Ho extends No{constructor(){super(...arguments),this.charUsage=new Uo,this.delimUsage=new Uo,this.fontUsage={},this.newFonts=0}static charOptions(t,e){return super.charOptions(t,e)}static addFontURLs(t,e,s){for(const i of Object.keys(e)){const n=Object.assign({},e[i]);n.src=n.src.replace(/%%URL%%/,s),t[i]=n}}static addDynamicFontCss(t,e,s){const i={};for(const s of e){const e=s.slice(4);i[`@font-face /* ${e} */`]={"font-family":s,src:`url("%%URL%%/${s.toLowerCase()}.woff2") format("woff2")`},t[`.${e}`]={"font-family":`${this.defaultCssFamilyPrefix}, ${s}`}}this.addFontURLs(t,i,s)}static addExtension(t,e=""){super.addExtension(t,e),t.fonts&&this.addDynamicFontCss(this.defaultStyles,t.fonts,t.fontURL)}addExtension(t,e=""){if(super.addExtension(t,e),!t.fonts||!this.options.adaptiveCSS)return[];const s={},i=new vr;return this.constructor.addDynamicFontCss(s,t.fonts,t.fontURL),i.addStyles(s),i.getStyleRules()}adaptiveCSS(t){this.options.adaptiveCSS=t}clearCache(){this.options.adaptiveCSS&&(this.charUsage.clear(),this.delimUsage.clear())}createVariant(t,e=null,s=null){super.createVariant(t,e,s),this.variant[t].letter=this.constructor.defaultVariantLetters[t]}defineChars(t,e){super.defineChars(t,e);const s=this.variant[t].letter,i=this.constructor;for(const t of Object.keys(e)){const n=parseInt(t);if(!Array.isArray(e[n]))continue;const r=i.charOptions(e,n);void 0===r.f&&(r.f=s);for(const[t,e]of i.combiningChars)if(n>=t&&n<=e){r.cmb=!0;break}}}addDynamicFontCss(t,e=this.options.fontURL){this.constructor.addDynamicFontCss(this.fontUsage,t,e)}updateDynamicStyles(){const t=this.fontUsage;return this.fontUsage={},this.options.adaptiveCSS||this.updateStyles(t),t}get styles(){const t=this.constructor,e=Object.assign(Object.assign({},t.defaultStyles),this.fontUsage);return this.fontUsage={},t.addFontURLs(e,t.defaultFonts,this.options.fontURL),this.options.adaptiveCSS?this.updateStyles(e):this.allStyles(e),e}updateStyles(t){for(const e of this.delimUsage.update())this.addDelimiterStyles(t,e,this.getDelimiter(e));for(const[e,s]of this.charUsage.update()){const i=this.variant[e];this.addCharStyles(t,i.letter,s,i.chars[s])}return t}allStyles(t){var e;for(const e of Object.keys(this.delimiters)){const s=parseInt(e);this.addDelimiterStyles(t,s,this.delimiters[s])}for(const s of Object.keys(this.variant)){const i=this.variant[s],n=i.letter;for(const s of Object.keys(i.chars)){const r=parseInt(s),o=i.chars[r];!(null===(e=null==o?void 0:o[3])||void 0===e?void 0:e.smp)&&Array.isArray(o)&&(o.length<4&&(o[3]={}),this.addCharStyles(t,n,r,o))}}}addDelimiterStyles(t,e,s){if(!s.stretch)return;const i=s.c&&s.c!==e?this.charSelector(s.c):this.charSelector(e);s.dir===po.Vertical?this.addDelimiterVStyles(t,e,i,s):this.addDelimiterHStyles(t,e,i,s)}addDelimiterVStyles(t,e,s,i){const n=i.HDW,[r,o,a,l]=i.stretch,[h,c,d,u]=this.getStretchVariants(e),p=this.addDelimiterVPart(t,s,"beg",r,h,n);this.addDelimiterVPart(t,s,"ext",o,c,n);const m=this.addDelimiterVPart(t,s,"end",a,d,n);if(l){const e=this.addDelimiterVPart(t,s,"mid",l,u,n),i=this.em(e/2-.03);t[`mjx-stretchy-v${s} > mjx-ext:first-of-type`]={height:"50%","border-width":`${this.em1(p-.03)} 0 ${i}`},t[`mjx-stretchy-v${s} > mjx-ext:last-of-type`]={height:"50%","border-width":`${i} 0 ${this.em1(m-.03)}`}}else(m||p)&&(t[`mjx-stretchy-v${s} > mjx-ext`]["border-width"]=`${this.em1(p-.03)} 0 ${this.em1(m-.03)}`)}addDelimiterVPart(t,e,s,i,n,r){if(!i)return 0;let o=0;const[a,l,h]=this.getChar(n,i),c={width:this.em0(h)};if("ext"!==s){const t=h>r[2]?this.em((r[2]-h)/2):"auto",e="beg"===s?a:"end"===s?-l:(a-l)/2;c.margin=`${this.em(e)} ${t} ${this.em(-e)}`}else{o=bo;const s=Math.max(bo,a+l-bo);c["line-height"]=this.em0(s);const i=a-s/2-bo;i&&(t[`mjx-stretchy-v${e} > mjx-ext > mjx-spacer`]={"margin-top":this.em(i)})}return t[`mjx-stretchy-v${e} > mjx-${s}`]=c,Math.max(0,a+l-o)}addDelimiterHStyles(t,e,s,i){const n=[...i.HDW],[r,o,a,l]=i.stretch,[h,c,d,u]=this.getStretchVariants(e);if(i.hd&&!this.options.mathmlSpacing){const t=this.params.extender_factor;n[0]=n[0]*(1-t)+i.hd[0]*t,n[1]=n[1]*(1-t)+i.hd[1]*t}const p=this.addDelimiterHPart(t,s,"beg",r,h,n);this.addDelimiterHPart(t,s,"ext",o,c,n);const m=this.addDelimiterHPart(t,s,"end",a,d,n);if(l){const e=this.addDelimiterHPart(t,s,"mid",l,u,n),i=this.em0(e/2-.03);t[`mjx-stretchy-h${s} > mjx-ext:first-of-type`]={width:"50%","border-width":`0 ${i} 0 ${this.em0(p-.03)}`},t[`mjx-stretchy-h${s} > mjx-ext:last-of-type`]={width:"50%","border-width":`0 ${this.em0(m-.03)} 0 ${i}`}}else(p||m)&&(t[`mjx-stretchy-h${s} > mjx-ext`]["border-width"]=`0 ${this.em0(m-.06)} 0 ${this.em0(p-.06)}`);i.ext&&(t[`mjx-stretchy-h${s} > mjx-ext > mjx-spacer`]["letter-spacing"]=this.em(-i.ext-Eo))}addDelimiterHPart(t,e,s,i,n,r){if(!i)return 0;let[,,o,a]=this.getChar(n,i);const l={padding:this.padding(r,o-r[2])};if("ext"===s){const i=l.padding.split(/ /);i[1]=i[3]="0",l.padding=i.join(" "),!o&&a.dx&&(o=2*a.dx-.06),t[`mjx-stretchy-h${e} > mjx-${s} > mjx-spacer`]={"margin-left":this.em(-o/2)},a.cmb&&(t[`mjx-stretchy-h${e} > mjx-${s} > mjx-c`]={width:this.em(o),"text-align":"right"})}else"mid"===s?l.margin=`0 ${this.em(-o/2)}`:l["end"==s?"margin-left":"margin-right"]=this.em(-o),this.checkCombiningChar(a,l);return t[`mjx-stretchy-h${e} > mjx-${s}`]=l,o}addCharStyles(t,e,s,i){const n=i[3],r=void 0!==n.f?n.f:e,o=n.ff||(r?`${this.cssFontPrefix}-${r}`:""),a="mjx-c"+this.charSelector(s)+(o?"."+o:""),l=n.oc||n.ic||0,h={padding:this.padding(i,l)};n.oc&&(t[a+"[noic]"]={"padding-right":this.em(i[2])}),this.checkCombiningChar(n,h),t[a+(h["margin-left"]&&!o?`:not([class*="${this.cssFontPrefix}-"])`:"")]=h}checkCombiningChar(t,e){if(!t.cmb)return;const s=e.padding.split(/ /);e.width=s[1],s[1]="0",s[3]||s.pop(),e.padding=s.join(" "),"0"===e.width&&t.dx&&(e.width=this.em(2*t.dx),e["margin-left"]="-"+e.width)}em(t){return Pr(t)}em0(t){return Pr(Math.max(0,t))}em1(t){const e=Pr(Math.max(0,t));return"0"===e?".1px":e}padding([t,e,s],i=0){return[t,s+i,e,0].map(this.em0).join(" ")}charSelector(t){return".mjx-c"+t.toString(16).toUpperCase()}}function Wo(t,e){for(const s of Object.keys(e)){const i=parseInt(s),n=e[i];n.c&&(n.c=n.c.replace(/\\[0-9A-F]+/gi,t=>String.fromCodePoint(parseInt(t.substring(1),16)))),Object.assign(No.charOptions(t,i),n)}return t}function Vo(t){return class extends t{get breakCount(){return this.breakStyle?1:0}get embellishedBreakCount(){return this.embellishedBreakStyle?1:0}get embellishedBreakStyle(){return this.breakStyle||this.getBreakStyle()}protoBBox(t){const e=this.stretch.dir!==po.None;e&&null===this.size&&this.getStretchedVariant([0]),e&&this.size<0||(super.computeBBox(t),0!==t.w||!this.node.attributes.hasExplicit("fence")||""!==this.node.getText()||this.node.texClass!==Oi.OPEN&&this.node.texClass!==Oi.CLOSE||this.jax.options.mathmlSpacing||(t.R=this.font.params.nulldelimiterspace),this.copySkewIC(t))}getAccentOffset(){const t=jr.empty();return this.protoBBox(t),-t.w/2}getCenterOffset(t=null){return t||(t=jr.empty(),super.computeBBox(t)),(t.h+t.d)/2+this.font.params.axis_height-t.h}getStretchedVariant(t,e=!1){if(this.stretch.dir===po.None)return;let s=this.getWH(t);const i=this.getSize("minsize",0),n=this.getSize("maxsize",1/0),r=this.node.getProperty("mathaccent");s=Math.max(i,Math.min(n,s));const o=this.font.params.delimiterfactor/1e3,a=this.font.params.delimitershortfall,l=i||e?s:r?Math.min(s/o,s+a):Math.max(s*o,s-a),h=this.getText().codePointAt(0);let c=this.stretch;this.size&&(this.stretch=c=this.font.getDelimiter(h),this.size=null);const d=c.c||h;let u=0;if(c.sizes)for(const t of c.sizes){if(t>=l)return r&&u&&u--,void this.setDelimSize(d,u);u++}c.stretch?(this.size=-1,this.invalidateBBox(),this.getStretchBBox(t,this.checkExtendedHeight(s,c),c)):this.setDelimSize(d,u-1)}setDelimSize(t,e){const s=this.stretch;this.variant=this.font.getSizeVariant(t,e),this.size=e;const i=s.schar&&s.schar[Math.min(e,s.schar.length-1)]||t;this.stretch=Object.assign(Object.assign({},s),{c:i}),this.childNodes[0].invalidateBBox()}getSize(t,e){const s=this.node.attributes;return s.isSet(t)&&(e=this.length2em(s.get(t),1,1)),e}getWH(t){if(0===t.length)return 0;if(1===t.length)return t[0];const[e,s]=t,i=this.font.params.axis_height;return this.node.attributes.get("symmetric")?2*Math.max(e-i,s+i):e+s}getStretchBBox(t,e,s){Object.hasOwn(s,"min")&&s.min>e&&(e=s.min);let[i,n,r]=s.HDW;if(this.stretch.dir===po.Vertical)[i,n]=this.getBaseline(t,e,s);else if(r=e,this.stretch.hd&&!this.jax.options.mathmlSpacing){const t=this.font.params.extender_factor;i=i*(1-t)+this.stretch.hd[0]*t,n=n*(1-t)+this.stretch.hd[1]*t}this.bbox.h=i,this.bbox.d=n,this.bbox.w=r}getBaseline(t,e,s){const i=2===t.length&&t[0]+t[1]===e,n=this.node.attributes.get("symmetric"),[r,o]=i?t:[e,0];let[a,l]=[r+o,0];if(n){const t=this.font.params.axis_height;i&&(a=2*Math.max(r-t,o+t)),l=a/2-t}else if(i)l=o;else{const[t,e]=s.HDW||[.75,.25];l=e*(a/(t+e))}return[a-l,l]}checkExtendedHeight(t,e){if(e.fullExt){const[s,i]=e.fullExt;t=i+Math.ceil(Math.max(0,t-i)/s)*s}return t}setBreakStyle(t=""){var e;if(this.breakStyle=(null===(e=this.node.parent)||void 0===e?void 0:e.isEmbellished)&&!t?"":this.getBreakStyle(t),this.breakCount&&this.multChar){const t=this.parent.node.childIndex(this.node),e=this.parent.node.childNodes[t+1];e&&e.setTeXclass(this.multChar.node)}}getBreakStyle(t=""){const e=this.node.attributes;let s=t||("newline"===e.get("linebreak")||this.node.getProperty("forcebreak")?e.get("linebreakstyle"):"");return"infixlinebreakstyle"===s&&(s=e.get(s)),s}getMultChar(){const t=this.node.attributes.get("linebreakmultchar");t&&"\u2062"===this.getText()&&"\u2062"!==t&&(this.multChar=this.createMo(t))}constructor(t,e,s=null){super(t,e,s),this.size=null,this.isAccent=this.node.isAccent,this.getMultChar(),this.setBreakStyle()}computeBBox(t,e=!1){if(this.protoBBox(t),this.node.attributes.get("symmetric")&&this.stretch.dir!==po.Horizontal){const e=this.getCenterOffset(t);t.h+=e,t.d-=e}this.node.getProperty("mathaccent")&&(this.stretch.dir===po.None||this.size>=0)&&(t.w=0)}computeLineBBox(t){return this.moLineBBox(t,this.breakStyle)}moLineBBox(t,e,s=null){const i=this.node.attributes.get("lineleading"),n=this.length2em(i,this.linebreakOptions.lineleading);if(0===t&&"before"===e){const t=To.from(jr.zero(),n);return t.originalL=this.bbox.L,this.bbox.L=0,t}let r=To.from(s||this.getOuterBBox(),n);return 1===t&&("after"===e?(r.w=r.h=r.d=0,r.isFirst=!0,this.bbox.R=0):"duplicate"===e?r.L=0:this.multChar&&(r=To.from(this.multChar.getOuterBBox(),n)),r.getIndentData(this.node)),r}canStretch(t){if(this.stretch.dir!==po.None)return this.stretch.dir===t;if(!this.node.attributes.get("stretchy"))return!1;const e=this.getText();if(1!==Array.from(e).length)return!1;const s=this.font.getDelimiter(e.codePointAt(0));return this.stretch=s&&s.dir===t?s:xo,this.stretch.dir!==po.None}getVariant(){this.node.attributes.get("largeop")?this.variant=this.node.attributes.get("displaystyle")?"-largeop":"-smallop":this.node.attributes.hasExplicit("mathvariant")||!1!==this.node.getProperty("pseudoscript")?super.getVariant():this.variant="-tex-variant"}remapChars(t){const e=this.node.getProperty("primes");if(e)return en(e);if(1===t.length){const e=this.node.coreParent().parent,s=this.isAccent&&!e.isKind("mrow")?"accent":"mo",i=this.font.getRemappedChar(s,t[0]);i&&(t=this.unicodeChars(i,this.variant))}return t}}}Ho.OPTIONS=Object.assign(Object.assign({},No.OPTIONS),{dynamicPrefix:"./chtml/dynamic",fontURL:"./chtml/woff2"}),Ho.JAX="CHTML",Ho.defaultVariantLetters={},Ho.defaultStyles={},Ho.defaultFonts={},Ho.combiningChars=[[768,879],[8400,8447]];const qo=function(){var t;const e=Vo(Po);return t=class extends e{toCHTML(t){const e=this.adaptor,s=this.node.attributes,i=s.get("symmetric")&&this.stretch.dir!==po.Horizontal,n=this.stretch.dir!==po.None;n&&null===this.size&&this.getStretchedVariant([]),t.length>1&&t.forEach(t=>e.append(t,this.html("mjx-linestrut")));const r=this.standardChtmlNodes(t);if(r.length>1&&"duplicate"!==this.breakStyle){const t="after"===this.breakStyle?1:0;e.remove(r[t]),r[t]=null}if(n&&this.size<0)this.stretchHTML(r);else{if(i||s.get("largeop")){const t=this.em(this.getCenterOffset());"0"!==t&&r.forEach(s=>s&&e.setStyle(s,"verticalAlign",t))}this.node.getProperty("mathaccent")&&r.forEach(t=>{e.setStyle(t,"width","0"),e.setStyle(t,"margin-left",this.em(this.getAccentOffset()))}),r[0]&&this.addChildren([r[0]]),r[1]&&(this.multChar||this).addChildren([r[1]])}}stretchHTML(t){const e=this.getText().codePointAt(0);this.font.delimUsage.add(e),this.childNodes[0].markUsed();const s=this.stretch,i=s.stretch,n=this.font.getStretchVariants(e),r=[],o=[];for(let t=0;t<i.length;t++)i[t]&&(o[t]=this.font.getChar(n[t],i[t]));const{h:a,d:l,w:h}=this.bbox,c={};if(s.dir===po.Vertical)this.createAssembly(o,i,n,r,a+l,bo,"\n"),r.push(this.html("mjx-mark")),c.height=this.em(a+l),c.verticalAlign=this.em(-l);else{const t=(s.ext||0)+Eo;this.createAssembly(o,i,n,r,h,t),c.width=this.em(h)}const d={class:this.char(s.c||e),style:c},u=this.html("mjx-stretchy-"+s.dir,d,r),p=this.adaptor;t[0]&&p.append(t[0],u),t[1]&&p.append(t[1],t[0]?p.clone(u):u)}createAssembly(t,e,s,i,n,r,o=""){t=[...t,null,null,null].slice(0,4);let[a,l,h,c]=t.map(t=>t?o?t[0]+t[1]:t[2]:0);l=Math.max(0,l-r);const[d,u]=t[3]?[(n-c)/2-a,(n-c)/2-h]:[n-a-h,0];this.createPart("mjx-beg",t[0],e[0],s[0],i),this.createPart("mjx-ext",t[1],e[1],s[1],i,d,l,o,a,c/2||h),t[3]&&(this.createPart("mjx-mid",t[3],e[3],s[3],i),this.createPart("mjx-ext",t[1],e[1],s[1],i,u,l,o,c/2,h)),this.createPart("mjx-end",t[2],e[2],s[2],i)}createPart(t,e,s,i,n,r=0,o=0,a="",l=0,h=0){if(s){const c=e[3],d=c.f||("normal"===i?"":this.font.getVariant(i).letter),u=c.ff||(d?`${this.font.cssFontPrefix}-${d}`:""),p=c.c||String.fromCodePoint(s);let m=[];if("mjx-ext"===t&&(o||c.dx)){if(r<0&&a)return void n.push(this.html(t,Object.assign(Object.assign({},u?{class:u}:{}),{style:{"border-width":`${this.em(l+r/2)} 0 ${this.em(h+r/2)}`,"clip-path":"none"}})));o||(o=Math.max(Eo,2*c.dx-Eo));const e=Math.min(Math.ceil(r/o)+1,500);if(c.cmb){m.push(this.html("mjx-spacer"));for(let t=0;t<e;t++)m.push(this.html("mjx-c",{},[this.text(p)]))}else m=[this.html("mjx-spacer",{},[this.text(Array(e).fill(p).join(a))])]}else m=[this.text(p)];n.push(this.html(t,u?{class:u}:{},m))}}},t.kind=ln.prototype.kind,t.styles={"mjx-stretchy-h":{display:"inline-block"},[["beg","ext","end","mid"].map(t=>`mjx-stretchy-h > mjx-${t}`).join(", ")]:{display:"inline-block",width:0,"text-align":"right"},"mjx-stretchy-h > mjx-ext":{"clip-path":"padding-box polygon(0 -1em, 100% -1em, 100% calc(100% + 1em), 0 calc(100% + 1em))",width:"100%",border:"0px solid transparent","box-sizing":"border-box","text-align":"left"},"mjx-stretchy-v":{display:"inline-block","text-align":"center"},[["beg","ext","end","mid"].map(t=>`mjx-stretchy-v > mjx-${t}`).join(", ")]:{display:"block",height:0,margin:"0 auto"},"mjx-stretchy-v > mjx-ext > mjx-spacer":{display:"block"},"mjx-stretchy-v > mjx-ext":{"clip-path":"padding-box polygon(-1em 0, calc(100% + 1em) 0, calc(100% + 1em) 100%, -1em 100%)",height:"100%",border:"0.1px solid transparent","box-sizing":"border-box","white-space":"pre"},"mjx-mark":{display:"inline-block",height:0}},t}();function Xo(t){return class extends t{remapChars(t){if(t.length){const e=this.font.getRemappedChar("mn",t[0]);if(e){const s=this.unicodeChars(e,this.variant);1===s.length?t[0]=s[0]:t=s.concat(t.slice(1))}}return t}}}const zo=function(){var t;const e=Xo(Po);return(t=class extends e{}).kind=zi.prototype.kind,t}();function Go(t){return class extends t{createText(t){const e=this.wrap(this.mmlText(t));return e.parent=this,e}constructor(t,e,s=null){super(t,e,s);const i=this.node.attributes,n=i.getList("lquote","rquote");"monospace"!==this.variant&&(i.isSet("lquote")||'"'!==n.lquote||(n.lquote="\u201c"),i.isSet("rquote")||'"'!==n.rquote||(n.rquote="\u201d")),this.childNodes.unshift(this.createText(n.lquote)),this.childNodes.push(this.createText(n.rquote))}}}const Jo=function(){var t;const e=Go(Po);return(t=class extends e{}).kind=dn.prototype.kind,t}();function Ko(t){var e;return e=class extends t{constructor(){super(...arguments),this.breakPoints=[]}textWidth(t){let e=this.textNode;if(!e){const t=this.node.factory.create("text");t.parent=this.node,e=this.textNode=this.factory.wrap(t),e.parent=this}return e.node.setText(t),e.invalidateBBox(!1),e.getBBox().w}get breakCount(){return this.breakPoints.length}getVariant(){const t=this.jax.options,e=this.jax.math.outputData,s=(!!e.merrorFamily||!!t.merrorFont)&&this.node.Parent.isKind("merror");if(e.mtextFamily||t.mtextFont||s){const i=this.node.attributes.get("mathvariant"),n=this.constructor.INHERITFONTS[i]||this.jax.font.getCssFont(i),r=n[0]||(s?e.merrorFamily||t.merrorFont:e.mtextFamily||t.mtextFont);return void(this.variant=this.explicitVariant(r,n[2]?"bold":"",n[1]?"italic":""))}super.getVariant()}setBreakAt(t){this.breakPoints.push(t)}clearBreakPoints(){this.breakPoints=[]}computeLineBBox(t){const e=To.from(this.getOuterBBox(),this.linebreakOptions.lineleading);return this.breakCount?(e.w=this.getBreakWidth(t),0===t?(e.R=0,this.addLeftBorders(e)):(e.L=0,e.indentData=[["left","0"],["left","0"],["left","0"]],t===this.breakCount&&this.addRightBorders(e)),e):e}getBreakWidth(t){const e=this.childNodes;let[s,i]=this.breakPoints[t-1]||[0,0];const[n,r]=this.breakPoints[t]||[e.length,0];let o=e[s].node.getText().split(/ /);if(s===n)return this.textWidth(o.slice(i,r).join(" "));let a=this.textWidth(o.slice(i).join(" "));for(;++s<n&&s<e.length;)a+=e[s].getBBox().w;return s<e.length&&(o=e[s].node.getText().split(/ /),a+=this.textWidth(o.slice(0,r).join(" "))),a}},e.INHERITFONTS={normal:["",!1,!1],bold:["",!1,!0],italic:["",!0,!1],"bold-italic":["",!0,!0]},e}const $o=function(){var t;const e=Ko(Po);return(t=class extends e{toCHTML(t){if(!this.breakCount)return void super.toCHTML(t);const e=this.standardChtmlNodes(t),s=this.textNode.node,i=this.childNodes;for(const t of e.keys()){const n=[e[t]];this.adaptor.append(e[t],this.html("mjx-linestrut"));let[r,o]=this.breakPoints[t-1]||[0,0];const[a,l]=this.breakPoints[t]||[i.length,0];let h=i[r].node.getText().split(/ /);if(r!==a){for(s.setText(h.slice(o).join(" ")),this.textNode.toCHTML(n);++r<a&&r<i.length;)i[r].toCHTML(n);r<i.length&&(h=i[r].node.getText().split(/ /),s.setText(h.slice(0,l).join(" ")),this.textNode.toCHTML(n))}else s.setText(h.slice(o,l).join(" ")),this.textNode.toCHTML(n)}}}).kind=hn.prototype.kind,t}();function Yo(t){return class extends t{get canBreak(){return this.node.canBreak}get breakCount(){return this.breakStyle?1:0}setBreakStyle(t=""){this.breakStyle=t||(this.node.hasNewline||this.node.getProperty("forcebreak")?"before":"")}constructor(t,e,s=null){super(t,e,s),this.setBreakStyle()}computeBBox(t,e=!1){const s=this.node.attributes;t.w=this.length2em(s.get("width"),0),t.h=this.length2em(s.get("height"),0),t.d=this.length2em(s.get("depth"),0)}computeLineBBox(t){const e=this.node.attributes.get("data-lineleading"),s=this.length2em(e,this.linebreakOptions.lineleading),i=To.from(jr.zero(),s);return 1===t&&(i.getIndentData(this.node),i.w=this.getBBox().w,i.isFirst=0===i.w),i}}}const Qo=function(){var t;const e=Yo(Po);return(t=class extends e{toCHTML(t){t.length>1&&t.forEach(t=>this.adaptor.append(t,this.html("mjx-linestrut")));const e=this.standardChtmlNodes(t);let{w:s,h:i,d:n}=this.getBBox();s<0&&(this.adaptor.setStyle(e[0],"marginRight",this.em(s)),s=0),s&&!this.breakCount&&this.adaptor.setStyle(e[0],"width",this.em(s)),i=Math.max(0,i+n),i&&this.adaptor.setStyle(e[0],"height",this.em(Math.max(0,i))),n&&this.adaptor.setStyle(e[0],"verticalAlign",this.em(-n))}}).kind=cn.prototype.kind,t}();function Zo(t){return class extends t{get containerWidth(){const t=this.node.attributes,e=t.get("width").toString();return e.match(/^[-+]|%$/)||"linebreak"!==t.get("data-overflow")?this.parent.containerWidth:this.length2em(e)}getDimens(){const t=this.node.attributes.getList("width","height","depth","lspace","voffset"),e=this.childNodes[0].getOuterBBox();let{w:s,h:i,d:n}=e;const r=s,o=i,a=n;let l=0,h=0,c=0;""!==t.width&&(s=this.dimen(t.width,e,"w",0)),""!==t.height&&(i=this.dimen(t.height,e,"h",0)),""!==t.depth&&(n=this.dimen(t.depth,e,"d",0)),""!==t.voffset&&(h=this.dimen(t.voffset,e)),""!==t.lspace&&(l=this.dimen(t.lspace,e));const d=this.node.attributes.get("data-align");return d&&(c=this.getAlignX(s,e,d)),[o,a,r,i-o,n-a,s-r,l,h,c]}dimen(t,e,s="",i=null){const n=(t=String(t)).match(/width|height|depth/),r=n?e[n[0].charAt(0)]:s?e[s]:0;let o=this.length2em(t,r)||0;return t.match(/^[-+]/)&&s&&(o+=r),null!=i&&(o=Math.max(i,o)),o}setBBoxDimens(t){const[e,s,i,n,r,o]=this.getDimens();t.w=i+o,t.h=e+n,t.d=s+r}computeBBox(t,e=!1){this.setBBoxDimens(t);if(this.childNodes[0].getOuterBBox().w>t.w){const e=this.node.attributes.get("data-overflow");("linebreak"===e||"auto"===e&&"linebreak"===this.jax.math.root.attributes.get("overflow"))&&(this.childNodes[0].breakToWidth(t.w),this.setBBoxDimens(t))}this.setChildPWidths(e,t.w)}getWrapWidth(t){return this.getBBox().w}getChildAlign(t){return this.node.attributes.get("data-align")||"left"}}}const ta=function(){var t;const e=Zo(Po);return(t=class extends e{toCHTML(t){if(this.toEmbellishedCHTML(t))return;let e=this.standardChtmlNodes(t);const s=[],i={},[,,n,r,o,a,l,h,c]=this.getDimens();if((a||this.childNodes[0].getBBox().pwidth)&&(i.width=this.em(n+a)),(r||o)&&(i.margin=this.em(r)+" 0 "+this.em(o)),l+c||h){i.position="relative";const t=this.html("mjx-rbox",{style:{left:this.em(l+c),top:this.em(-h),"max-width":i.width}});l+c&&this.childNodes[0].getBBox().pwidth&&(this.adaptor.setAttribute(t,"width","full"),this.adaptor.setStyle(t,"left",this.em(l))),s.push(t)}e=[this.adaptor.append(e[0],this.html("mjx-block",{style:i},s))],this.childNodes[0].childNodes.length?this.childNodes[0].toCHTML([s[0]||e[0]]):(r||o)&&this.adaptor.append(s[0]||e[0],this.html("mjx-box"))}}).kind=xn.prototype.kind,t.styles={"mjx-mpadded":{display:"inline-block"},"mjx-rbox":{display:"inline-block",position:"relative"}},t}(),ea=4,sa=1,ia=2,na=.067,ra=.2,oa=na+"em solid",aa={top:0,right:1,bottom:2,left:3},la=Object.keys(aa),ha=t=>new Array(4).fill(t.thickness+t.padding),ca=t=>new Array(4).fill(t.padding),da=t=>new Array(4).fill(t.thickness),ua=t=>Math.max(t.padding,t.thickness*(t.arrowhead.x+t.arrowhead.dx+1)),pa=(t,e)=>{if(t.childNodes[0]){const{h:s,d:i}=t.childNodes[0].getBBox();e[0]=e[2]=Math.max(0,t.thickness*t.arrowhead.y-(s+i)/2)}return e},ma=(t,e)=>{if(t.childNodes[0]){const{w:s}=t.childNodes[0].getBBox();e[1]=e[3]=Math.max(0,t.thickness*t.arrowhead.y-s/2)}return e},fa={up:[-Math.PI/2,!1,!0,"verticalstrike"],down:[Math.PI/2,!1,!0,"verticakstrike"],right:[0,!1,!1,"horizontalstrike"],left:[Math.PI,!1,!1,"horizontalstrike"],updown:[Math.PI/2,!0,!0,"verticalstrike uparrow downarrow"],leftright:[0,!0,!1,"horizontalstrike leftarrow rightarrow"]},ga={updiagonal:[-1,0,!1,"updiagonalstrike northeastarrow"],northeast:[-1,0,!1,"updiagonalstrike updiagonalarrow"],southeast:[1,0,!1,"downdiagonalstrike"],northwest:[1,Math.PI,!1,"downdiagonalstrike"],southwest:[-1,Math.PI,!1,"updiagonalstrike"],northeastsouthwest:[-1,0,!0,"updiagonalstrike northeastarrow updiagonalarrow southwestarrow"],northwestsoutheast:[1,0,!0,"downdiagonalstrike northwestarrow southeastarrow"]},ba={up:t=>ma(t,[ua(t),0,t.padding,0]),down:t=>ma(t,[t.padding,0,ua(t),0]),right:t=>pa(t,[0,ua(t),0,t.padding]),left:t=>pa(t,[0,t.padding,0,ua(t)]),updown:t=>ma(t,[ua(t),0,ua(t),0]),leftright:t=>pa(t,[0,ua(t),0,ua(t)])},Ea=function(t){return e=>{const s=aa[e];return[e,{renderer:t,bbox:t=>{const e=[0,0,0,0];return e[s]=t.thickness+t.padding,e},border:t=>{const e=[0,0,0,0];return e[s]=t.thickness,e}}]}},xa=function(t){return(e,s,i)=>{const n=aa[s],r=aa[i];return[e,{renderer:t,bbox:t=>{const e=t.thickness+t.padding,s=[0,0,0,0];return s[n]=s[r]=e,s},border:t=>{const e=[0,0,0,0];return e[n]=e[r]=t.thickness,e},remove:s+" "+i}]}},ya=function(t){return e=>{const s="mjx-"+e.charAt(0)+"strike";return[e+"diagonalstrike",{renderer:t(s),bbox:ha}]}},Na=function(t){return e=>{const[s,i,n,r]=ga[e];return[e+"arrow",{renderer:(e,r)=>{const[o,a]=e.arrowAW(),l=e.arrow(a,s*(o-i),n);t(e,l)},bbox:t=>{const{a:e,x:s,y:i}=t.arrowData(),[n,r,o]=[t.arrowhead.x,t.arrowhead.y,t.arrowhead.dx],[a,l]=t.getArgMod(n+o,r),h=i+(a>e?t.thickness*l*Math.sin(a-e):0),c=s+(a>Math.PI/2-e?t.thickness*l*Math.sin(a+e-Math.PI/2):0);return[h,c,h,c]},remove:r}]}},Ta=function(t){return e=>{const[s,i,n,r]=fa[e];return[e+"arrow",{renderer:(e,r)=>{const{w:o,h:a,d:l}=e.getBBox(),[h,c]=n?[a+l,"X"]:[o,"Y"],d=e.getOffset(c),u=e.arrow(h,s,i,c,d);t(e,u)},bbox:ba[e],remove:r}]}};function va(t){return class extends t{getParameters(){const t=this.node.attributes,e=t.get("data-padding");void 0!==e&&(this.padding=this.length2em(e,ra));const s=t.get("data-thickness");void 0!==s&&(this.thickness=this.length2em(s,na));const i=t.get("data-arrowhead");if(void 0!==i){const[t,e,s]=rn(i);this.arrowhead={x:t?parseFloat(t):ea,y:e?parseFloat(e):ia,dx:s?parseFloat(s):sa}}}getNotations(){const t=this.constructor.notations;for(const e of rn(this.node.attributes.get("notation"))){const s=t.get(e);s&&(this.notations[e]=s,s.renderChild&&(this.renderChild=s.renderer))}}removeRedundantNotations(){for(const t of Object.keys(this.notations))if(this.notations[t]){const e=this.notations[t].remove||"";for(const t of e.split(/ /))delete this.notations[t]}}initializeNotations(){for(const t of Object.keys(this.notations)){const e=this.notations[t].init;e&&e(this)}}getBBoxExtenders(){const t=[0,0,0,0];for(const e of Object.keys(this.notations))this.maximizeEntries(t,this.notations[e].bbox(this));return t}getPadding(){const t=[0,0,0,0];for(const e of Object.keys(this.notations)){const s=this.notations[e].border;s&&this.maximizeEntries(t,s(this))}return[0,1,2,3].map(e=>this.TRBL[e]-t[e])}maximizeEntries(t,e){for(let s=0;s<t.length;s++)t[s]<e[s]&&(t[s]=e[s])}getOffset(t){const[e,s,i,n]=this.TRBL,r=("X"===t?s-n:i-e)/2;return Math.abs(r)>.001?r:0}getArgMod(t,e){return[Math.atan2(e,t),Math.sqrt(t*t+e*e)]}arrow(t,e,s,i="",n=0){return null}arrowData(){const[t,e]=[this.padding,this.thickness],s=e*(this.arrowhead.x+Math.max(1,this.arrowhead.dx)),{h:i,d:n,w:r}=this.childNodes[0].getBBox(),o=i+n,a=Math.sqrt(o*o+r*r),l=Math.max(t,s*r/a),h=Math.max(t,s*o/a),[c,d]=this.getArgMod(r+2*l,o+2*h);return{a:c,W:d,x:l,y:h}}arrowAW(){const{h:t,d:e,w:s}=this.childNodes[0].getBBox(),[i,n,r,o]=this.TRBL;return this.getArgMod(o+s+n,i+t+e+r)}createMsqrt(t){const e=this.node.factory.create("msqrt");e.inheritAttributesFrom(this.node),e.childNodes[0]=t.node;const s=this.wrap(e);return s.parent=this,s}sqrtTRBL(){const t=this.msqrt.getBBox(),e=this.msqrt.childNodes[0].getBBox();return[t.h-e.h,0,t.d-e.d,t.w-e.w]}constructor(t,e,s=null){super(t,e,s),this.notations={},this.renderChild=null,this.msqrt=null,this.padding=ra,this.thickness=na,this.arrowhead={x:ea,y:ia,dx:sa},this.TRBL=[0,0,0,0],this.getParameters(),this.getNotations(),this.removeRedundantNotations(),this.initializeNotations(),this.TRBL=this.getBBoxExtenders()}computeBBox(t,e=!1){const[s,i,n,r]=this.TRBL,o=this.childNodes[0].getBBox();t.combine(o,r,0),t.h+=s,t.d+=n,t.w+=i,this.setChildPWidths(e)}}}const La=function(t,e=""){return(s,i)=>{const n=s.adjustBorder(s.html("mjx-"+t));if(e){const t=s.getOffset(e);if(s.thickness!==na||t){const i=`translate${e}(${s.Em(s.thickness/2-t)})`;s.adaptor.setStyle(n,"transform",i)}}s.adaptor.append(s.dom[0],n)}},Ca=function(t){return Ea((e,s)=>{e.adaptor.setStyle(s,"border-"+t,e.Em(e.thickness)+" solid")})(t)},Ra=function(t,e,s){return xa((t,i)=>{const n=t.Em(t.thickness)+" solid";t.adaptor.setStyle(i,"border-"+e,n),t.adaptor.setStyle(i,"border-"+s,n)})(t,e,s)},Ia=function(t,e){return ya(t=>(s,i)=>{const{w:n,h:r,d:o}=s.getBBox(),[a,l]=s.getArgMod(n,r+o),h=e*s.thickness/2,c=s.adjustBorder(s.html(t,{style:{width:s.Em(l),transform:"rotate("+s.fixed(-e*a)+"rad) translateY("+h+"em)"}}));s.adaptor.append(s.dom[0],c)})(t)},Sa=function(t){return Na((t,e)=>{t.adaptor.append(t.dom[0],e)})(t)},Aa=function(t){return Ta((t,e)=>{t.adaptor.append(t.dom[0],e)})(t)};function wa(t,e){return Math.atan2(t,e).toFixed(3).replace(/\.?0+$/,"")}const Oa=wa(sa,ia),Ma=function(){var t;const e=va(Po);return(t=class extends e{adjustArrow(t,e){const s=this.thickness,i=this.arrowhead;if(i.x===ea&&i.y===ia&&i.dx===sa&&s===na)return;const[n,r]=[s*i.x,s*i.y].map(t=>this.em(t)),o=wa(i.dx,i.y),[a,l,h,c,d]=this.adaptor.childNodes(t);this.adjustHead(l,[r,"0","1px",n],o),this.adjustHead(h,["1px","0",r,n],"-"+o),this.adjustHead(c,[r,n,"1px","0"],"-"+o),this.adjustHead(d,["1px",n,r,"0"],o),this.adjustLine(a,s,i.x,e)}adjustHead(t,e,s){t&&(this.adaptor.setStyle(t,"border-width",e.join(" ")),this.adaptor.setStyle(t,"transform","skewX("+s+"rad)"))}adjustLine(t,e,s,i){this.adaptor.setStyle(t,"borderTop",this.em(e)+" solid"),this.adaptor.setStyle(t,"top",this.em(-e/2)),this.adaptor.setStyle(t,"right",this.em(e*(s-1))),i&&this.adaptor.setStyle(t,"left",this.em(e*(s-1)))}moveArrow(t,e,s){if(!s)return;const i=this.adaptor.getStyle(t,"transform");this.adaptor.setStyle(t,"transform",`translate${e}(${this.em(-s)})${i?" "+i:""}`)}adjustBorder(t){return this.thickness!==na&&this.adaptor.setStyle(t,"borderWidth",this.em(this.thickness)),t}adjustThickness(t){return this.thickness!==na&&this.adaptor.setStyle(t,"strokeWidth",this.fixed(this.thickness)),t}fixed(t,e=3){return Math.abs(t)<6e-4?"0":t.toFixed(e).replace(/\.?0+$/,"")}Em(t){return super.em(t)}toCHTML(t){const e=this.adaptor,s=this.standardChtmlNodes(t),i=e.append(s[0],this.html("mjx-box"));this.renderChild?this.renderChild(this,i):this.childNodes[0].toCHTML([i]);for(const t of Object.keys(this.notations)){const e=this.notations[t];e.renderChild||e.renderer(this,i)}const n=this.getPadding();for(const t of la){const s=aa[t];n[s]>0&&e.setStyle(i,"padding-"+t,this.em(n[s]))}}arrow(t,e,s,i="",n=0){const r=this.getBBox().w,o={width:this.em(t)};r!==t&&(o.left=this.em((r-t)/2)),e&&(o.transform="rotate("+this.fixed(e)+"rad)");const a=this.html("mjx-arrow",{style:o},[this.html("mjx-aline"),this.html("mjx-rthead"),this.html("mjx-rbhead")]);return s&&(this.adaptor.append(a,this.html("mjx-lthead")),this.adaptor.append(a,this.html("mjx-lbhead")),this.adaptor.setAttribute(a,"double","true")),this.adjustArrow(a,s),this.moveArrow(a,i,n),a}}).kind=Tn.prototype.kind,t.styles={"mjx-menclose":{position:"relative"},"mjx-menclose > mjx-dstrike":{display:"inline-block",left:0,top:0,position:"absolute","border-top":oa,"transform-origin":"top left"},"mjx-menclose > mjx-ustrike":{display:"inline-block",left:0,bottom:0,position:"absolute","border-top":oa,"transform-origin":"bottom left"},"mjx-menclose > mjx-hstrike":{"border-top":oa,position:"absolute",left:0,right:0,bottom:"50%",transform:"translateY("+Pr(na/2)+")"},"mjx-menclose > mjx-vstrike":{"border-left":oa,position:"absolute",top:0,bottom:0,right:"50%",transform:"translateX("+Pr(na/2)+")"},"mjx-menclose > mjx-rbox":{position:"absolute",top:0,bottom:0,right:0,left:0,border:oa,"border-radius":Pr(na+ra)},"mjx-menclose > mjx-cbox":{position:"absolute",top:0,bottom:0,right:0,left:0,border:oa,"border-radius":"50%"},"mjx-menclose > mjx-arrow":{position:"absolute",left:0,bottom:"50%",height:0,width:0},"mjx-menclose > mjx-arrow > mjx-aline":{display:"block",position:"absolute","box-sizing":"border-box","transform-origin":"bottom",left:0,top:Pr(-na/2),right:Pr(na*(ea-1)),height:0,"border-top":Pr(na)+" solid","border-left":0,"border-right":0},"mjx-menclose > mjx-arrow[double] > mjx-aline":{display:"block",position:"absolute","box-sizing":"border-box","transform-origin":"bottom",left:Pr(na*(ea-1)),height:0,"border-left":Pr(na*ea)+" solid","border-right":0},"mjx-menclose > mjx-arrow > mjx-rthead":{display:"block",position:"absolute","box-sizing":"border-box","transform-origin":"bottom",transform:"skewX("+Oa+"rad)",right:0,bottom:"-1px","border-left":Pr(na*ea)+" solid","border-right":0,"border-bottom":"1px solid transparent","border-top":Pr(na*ia)+" solid transparent"},"mjx-menclose > mjx-arrow > mjx-rbhead":{display:"block",position:"absolute","box-sizing":"border-box",transform:"skewX(-"+Oa+"rad)","transform-origin":"top",right:0,top:"-1px","border-left":Pr(na*ea)+" solid","border-right":0,"border-top":"1px solid transparent","border-bottom":Pr(na*ia)+" solid transparent"},"mjx-menclose > mjx-arrow > mjx-lthead":{display:"block",position:"absolute","box-sizing":"border-box",transform:"skewX(-"+Oa+"rad)","transform-origin":"bottom",left:0,bottom:"-1px","border-left":0,"border-right":Pr(na*ea)+" solid","border-bottom":"1px solid transparent","border-top":Pr(na*ia)+" solid transparent"},"mjx-menclose > mjx-arrow > mjx-lbhead":{display:"block",position:"absolute","box-sizing":"border-box",transform:"skewX("+Oa+"rad)","transform-origin":"top",left:0,top:"-1px","border-left":0,"border-right":Pr(na*ea)+" solid","border-top":"1px solid transparent","border-bottom":Pr(na*ia)+" solid transparent"},"mjx-menclose > mjx-dbox-top":{position:"absolute",top:0,bottom:"50%",left:0,width:Pr(1.5*ra),"border-width":Pr(na),"border-style":"solid solid none none","border-radius":"0 100% 0 0","box-sizing":"border-box"},"mjx-menclose > mjx-dbox-bot":{position:"absolute",top:"50%",bottom:0,left:0,width:Pr(1.5*ra),"border-width":Pr(na),"border-style":"none solid solid none","border-radius":"0 0 100% 0","box-sizing":"border-box"}},t.notations=new Map([Ca("top"),Ca("right"),Ca("bottom"),Ca("left"),Ra("actuarial","top","right"),Ra("madruwb","bottom","right"),Ia("up",1),Ia("down",-1),["horizontalstrike",{renderer:La("hstrike","Y"),bbox:t=>[0,t.padding,0,t.padding]}],["verticalstrike",{renderer:La("vstrike","X"),bbox:t=>[t.padding,0,t.padding,0]}],["box",{renderer:(t,e)=>{t.adaptor.setStyle(e,"border",t.Em(t.thickness)+" solid")},bbox:ha,border:da,remove:"left right top bottom"}],["roundedbox",{renderer:La("rbox"),bbox:ha}],["circle",{renderer:La("cbox"),bbox:ha}],["phasorangle",{renderer:(t,e)=>{const{h:s,d:i}=t.getBBox(),[n,r]=t.getArgMod(1.75*t.padding,s+i),o=t.thickness*Math.sin(n)*.9;t.adaptor.setStyle(e,"border-bottom",t.Em(t.thickness)+" solid");const a=t.adjustBorder(t.html("mjx-ustrike",{style:{width:t.Em(r),transform:`translateX(${t.Em(o)}) rotate(${t.fixed(-n)}rad)`}}));t.adaptor.append(t.dom[0],a)},bbox:t=>{const e=t.padding/2,s=t.thickness;return[2*e,e,e+s,3*e+s]},border:t=>[0,0,t.thickness,0],remove:"bottom"}],Aa("up"),Aa("down"),Aa("left"),Aa("right"),Aa("updown"),Aa("leftright"),Sa("updiagonal"),Sa("northeast"),Sa("southeast"),Sa("northwest"),Sa("southwest"),Sa("northeastsouthwest"),Sa("northwestsoutheast"),["longdiv",{renderer:(t,e)=>{const s=t.adaptor;s.setStyle(e,"border-top",t.Em(t.thickness)+" solid");const i=s.append(t.dom[0],t.html("mjx-dbox-top")),n=s.append(t.dom[0],t.html("mjx-dbox-bot")),r=t.thickness,o=t.padding;r!==na&&(s.setStyle(i,"border-width",t.Em(r)),s.setStyle(n,"border-width",t.Em(r))),o!==ra&&(s.setStyle(i,"width",t.Em(1.5*o)),s.setStyle(n,"width",t.Em(1.5*o)))},bbox:t=>{const e=t.padding,s=t.thickness;return[e+s,e,e,2*e+s/2]}}],["radical",{renderer:(t,e)=>{t.msqrt.toCHTML([e]);const s=t.sqrtTRBL();t.adaptor.setStyle(t.msqrt.dom[0],"margin",s.map(e=>t.Em(-e)).join(" "))},init:t=>{t.msqrt=t.createMsqrt(t.childNodes[0])},bbox:t=>t.sqrtTRBL(),renderChild:!0}]]),t}();function Da(t){return class extends t{stretchChildren(){const t=[];for(const e of this.childNodes)e.canStretch(po.Vertical)&&t.push(e);const e=t.length,s=this.childNodes.length;if(e&&s>1){let i=0,n=0;const r=e>1&&e===s;for(const t of this.childNodes){const e=t.stretch.dir===po.None;if(r||e){const e=t.getBBox().rscale;let[s,r]=t.getUnbrokenHD();s*=e,r*=e,s>i&&(i=s),r>n&&(n=r)}}for(const e of t){const t=e.coreRScale();e.coreMO().getStretchedVariant([i/t,n/t])}}}get fixesPWidth(){return!1}get breakCount(){return this._breakCount<0&&(this._breakCount=this.childNodes.length?this.childNodes.reduce((t,e)=>t+e.breakCount,0):0),this._breakCount}breakTop(t,e){const s=this;return this.isStack?this.parent.breakTop(s,s):s}constructor(t,e,s=null){super(t,e,s),this.dh=0;const i=this;this.isStack=!this.parent||this.parent.node.isInferred||this.parent.breakTop(i,i)!==i,this.stretchChildren();for(const t of this.childNodes)if(t.bbox.pwidth){this.bbox.pwidth=jr.fullWidth;break}}computeBBox(t,e=!1){const s=this.breakCount;this.lineBBox=s?[new To({h:.75,d:.25,w:0},[0,0])]:[],t.empty();for(const e of this.childNodes.keys()){const i=this.childNodes[e];t.append(i.getOuterBBox()),s&&this.computeChildLineBBox(i,e)}t.clean(),s&&!this.coreMO().node.isEmbellished&&this.computeLinebreakBBox(t),this.fixesPWidth&&this.setChildPWidths(e)&&this.computeBBox(t,!0),this.vboxAdjust(t)}computeLinebreakBBox(t){var e;t.empty();const s=this.isStack,i=this.lineBBox,n=i.length-1;if(s)for(const t of i.keys()){const e=i[t];this.addMiddleBorders(e),0===t&&this.addLeftBorders(e),t===n&&this.addRightBorders(e)}let r=0;for(const s of i.keys()){const n=i[s];t.combine(n,0,r),r-=Math.max(.25,n.d)+n.lineLeading+Math.max(.75,(null===(e=i[s+1])||void 0===e?void 0:e.h)||0)}s?(i[0].L=this.bbox.L,i[n].R=this.bbox.R):(t.w=Math.max(...this.lineBBox.map(t=>t.w)),this.shiftLines(t),this.jax.math.display||this.linebreakOptions.inline||(t.pwidth=jr.fullWidth,this.node.isInferred&&(this.parent.bbox.pwidth=jr.fullWidth))),t.clean()}vboxAdjust(t){if(!this.parent)return;const e=this.breakCount,s=this.parent.node.attributes.get("data-vertical-align");if(e&&"bottom"===s)this.dh=e?t.d-this.lineBBox[e-1].d:0;else{if(!("center"===s||e&&"middle"===s))return void(this.dh=0);{const{h:e,d:s}=t,i=this.font.params.axis_height;this.dh=(e+s)/2+i-e}}t.h+=this.dh,t.d-=this.dh}computeChildLineBBox(t,e){const s=this.lineBBox[this.lineBBox.length-1];s.end=[e,0],s.append(t.getLineBBox(0));const i=t.breakCount+1;if(1!==i)for(let s=1;s<i;s++){const i=new To({h:.75,d:.25,w:0});i.start=i.end=[e,s],i.isFirst=!0,i.append(t.getLineBBox(s)),this.lineBBox.push(i)}}getLineBBox(t){return this.getBBox(),this.isStack?super.getLineBBox(t):To.from(this.getOuterBBox(),this.linebreakOptions.lineleading)}shiftLines(t){var e,s;const i=t.w,n=this.lineBBox,r=n.length-1,[o,a]=(null===(e=n[1].indentData)||void 0===e?void 0:e[0])||["left","0"];for(const e of n.keys()){const l=n[e],[h,c]=0===e?[o,a]:(null===(s=l.indentData)||void 0===s?void 0:s[e===r?2:1])||["left","0"],[d,u]=this.processIndent(h,c,o,a,i);l.L=0,l.L=this.getAlignX(i,l,d)+u;const p=l.L+l.w;p>t.w&&(t.w=p)}}setChildPWidths(t,e=null,s=!0){return this.breakCount?!t&&(null!==e&&this.bbox.w!==e&&(this.bbox.w=e,this.shiftLines(this.bbox)),!0):super.setChildPWidths(t,e,s)}breakToWidth(t){this.linebreaks.breakToWidth(this,t)}}}function ka(t){return class extends t{getScale(){this.bbox.scale=this.parent.bbox.scale,this.bbox.rscale=1}}}const Pa=function(){var t;const e=Da(Po);return t=class extends e{constructor(){super(...arguments),this.linebreakCount=0}toCHTML(t){const e=this.linebreakCount=this.isStack?0:this.breakCount;e||!this.node.isInferred?t=this.standardChtmlNodes(t):this.dom=t,this.addChildren(t),e?this.placeLines(t,e):(this.handleVerticalAlign(t[0]),this.handleNegativeWidth(t[0]))}placeLines(t,e){var s,i;this.getBBox();const n=this.lineBBox,r=this.adaptor,[o,a]=(null===(s=n[1].indentData)||void 0===s?void 0:s[0])||["left","0"];for(const s of t.keys()){const l=n[s],[h,c]=0===s?[o,a]:(null===(i=l.indentData)||void 0===i?void 0:i[s===e?2:1])||["left","0"],[d,u]=this.processIndent(h,c,o,a);r.setAttribute(t[s],"align",d),u&&r.setStyle(t[s],"margin-left",this.em(u)),s<e&&this.jax.math.display&&r.setStyle(t[s],"margin-bottom",this.em(l.lineLeading))}}handleVerticalAlign(t){this.dh&&this.adaptor.setStyle(this.adaptor.parent(t),"vertical-align",this.em(this.dh))}handleNegativeWidth(t){const{w:e}=this.getBBox();e<0&&(this.adaptor.setStyle(t,"width",this.em(Math.max(0,e))),this.adaptor.setStyle(t,"marginRight",this.em(e)))}createChtmlNodes(t){const e=this.linebreakCount;if(!e)return super.createChtmlNodes(t);const s=this.adaptor,i=this.node.isInferred?"mjx-linestack":"mjx-"+this.node.kind;if(this.dom=[s.append(t[0],this.html(i))],"mjx-mrow"!==i||this.isStack||s.setAttribute(this.dom[0],"break-top","true"),this.node.getProperty("process-breaks")&&s.setAttribute(this.dom[0],"breakable","true"),this.node.isInferred||!this.isStack){const t=this.parent.node.attributes.get("data-vertical-align");"middle"!==t&&"center"!==t&&"bottom"!==t||s.setAttribute(this.dom[0],"break-align",t)}this.dom=[s.append(this.handleHref(t)[0],this.dom[0])];const n=Array(e);for(let t=0;t<=e;t++)n[t]=s.append(this.dom[0],this.html("mjx-linebox",{lineno:t}));return n}addChildren(t){let e=0;for(const s of this.childNodes){const i=s.breakCount;s.toCHTML(t.slice(e,e+i+1)),e+=i}}},t.kind=un.prototype.kind,t.styles={"mjx-linestack, mjx-mrow[break-top]":{display:"inline-table",width:"100%"},'mjx-linestack[break-align="bottom"], mjx-mrow[break-top][break-align="bottom"]':{display:"inline-block"},'mjx-linestack[break-align="middle"], mjx-mrow[break-top][break-align="middle"]':{"vertical-align":"middle"},'mjx-linestack[break-align="center"], mjx-mrow[break-top][break-align="center"]':{"vertical-align":"middle"},"mjx-linestack[breakable]":{display:"inline"},"mjx-linestack[breakable] > mjx-linebox":{display:"inline"},"mjx-linestack[breakable] > mjx-linebox::before":{"white-space":"pre",content:'"\\A"'},"mjx-linestack[breakable] > mjx-linebox::after":{"white-space":"normal",content:'" "',"letter-spacing":"-.999em","font-family":"MJX-BRK"},"mjx-linestack[breakable] > mjx-linebox:first-of-type::before":{display:"none"},"mjx-linestack[breakable] > mjx-linebox:last-of-type::after":{display:"none"},"mjx-linebox":{display:"block"},'mjx-linebox[align="left"]':{"text-align":"left"},'mjx-linebox[align="center"]':{"text-align":"center"},'mjx-linebox[align="right"]':{"text-align":"right"},"mjx-linestrut":{display:"inline-block",height:"1em","vertical-align":"-.25em"}},t}(),Ba=function(){var t;const e=ka(Pa);return(t=class extends e{}).kind=pn.prototype.kind,t}();function ja(t){return class extends t{createMrow(){const t=this.node.factory.create("inferredMrow");t.inheritAttributesFrom(this.node),this.mrow=this.wrap(t),this.mrow.parent=this}addMrowChildren(){const t=this.node,e=this.mrow;this.addMo(t.open),this.childNodes.length&&e.childNodes.push(this.childNodes[0]);let s=0;for(const i of this.childNodes.slice(1))this.addMo(t.separators[s++]),e.childNodes.push(i);this.addMo(t.close),e.stretchChildren()}addMo(t){if(!t)return;const e=this.wrap(t);this.mrow.childNodes.push(e),e.parent=this.mrow}constructor(t,e,s=null){super(t,e,s),this.mrow=null,this.createMrow(),this.addMrowChildren()}computeBBox(t,e=!1){t.updateFrom(this.mrow.getOuterBBox()),this.setChildPWidths(e)}get breakCount(){return this.mrow.breakCount}computeLineBBox(t){return this.mrow.getLineBBox(t)}}}const _a=function(){var t;const e=ja(Po);return(t=class extends e{toCHTML(t){const e=this.standardChtmlNodes(t);this.mrow.toCHTML(e)}}).kind=Nn.prototype.kind,t}();function Fa(t){return class extends t{getFractionBBox(t,e,s){const i=this.childNodes[0].getOuterBBox(),n=this.childNodes[1].getOuterBBox(),r=this.font.params.axis_height,{T:o,u:a,v:l}=this.getTUV(e,s);t.combine(i,0,r+o+Math.max(i.d*i.rscale,a)),t.combine(n,0,r-o-Math.max(n.h*n.rscale,l)),t.w+=2*this.pad+.2}getTUV(t,e){const s=this.font.params,i=s.axis_height,n=(t?3.5:1.5)*e;return{T:(t?3.5:1.5)*e,u:(t?s.num1:s.num2)-i-n,v:(t?s.denom1:s.denom2)+i-n}}getAtopBBox(t,e){const{u:s,v:i,nbox:n,dbox:r}=this.getUVQ(e);t.combine(n,0,s),t.combine(r,0,-i),t.w+=2*this.pad}getUVQ(t){const e=this.childNodes[0].getOuterBBox(),s=this.childNodes[1].getOuterBBox(),i=this.font.params;let[n,r]=t?[i.num1,i.denom1]:[i.num3,i.denom2];const o=(t?7:3)*i.rule_thickness;let a=n-e.d*e.scale-(s.h*s.scale-r);return a<o&&(n+=(o-a)/2,r+=(o-a)/2,a=o),{u:n,v:r,q:a,nbox:e,dbox:s}}getBevelledBBox(t,e){const{u:s,v:i,delta:n,nbox:r,dbox:o}=this.getBevelData(e),a=this.bevel.getOuterBBox();t.combine(r,0,s),t.combine(a,t.w-n/2,0),t.combine(o,t.w-n/2,i)}getBevelData(t){const e=this.childNodes[0].getOuterBBox(),s=this.childNodes[1].getOuterBBox(),i=t?.4:.15,n=Math.max(e.scale*(e.h+e.d),s.scale*(s.h+s.d))+2*i,r=this.font.params.axis_height;return{H:n,delta:i,u:e.scale*(e.d-e.h)/2+r+i,v:s.scale*(s.d-s.h)/2+r-i,nbox:e,dbox:s}}isDisplay(){const{displaystyle:t,scriptlevel:e}=this.node.attributes.getList("displaystyle","scriptlevel");return t&&0===e}constructor(t,e,s=null){if(super(t,e,s),this.bevel=null,this.pad=this.node.getProperty("withDelims")?0:this.font.params.nulldelimiterspace,this.node.attributes.get("bevelled")){const{H:t}=this.getBevelData(this.isDisplay()),e=this.bevel=this.createMo("/");e.node.attributes.set("symmetric",!0),e.canStretch(po.Vertical),e.getStretchedVariant([t],!0)}}computeBBox(t,e=!1){t.empty();const{linethickness:s,bevelled:i}=this.node.attributes.getList("linethickness","bevelled"),n=this.isDisplay();let r=null;if(i)this.getBevelledBBox(t,n);else{const e=this.length2em(String(s),.06);r=-2*this.pad,0===e?this.getAtopBBox(t,n):(this.getFractionBBox(t,n,e),r-=.2),r+=t.w}t.clean(),this.setChildPWidths(e,r)}canStretch(t){return!1}getChildAlign(t){const e=this.node.attributes;return e.get("bevelled")?"left":e.get(["numalign","denomalign"][t])}getWrapWidth(t){const e=this.node.attributes;if(e.get("bevelled"))return this.childNodes[t].getOuterBBox().w;return this.getBBox().w-(this.length2em(e.get("linethickness"))?.2:0)-2*this.pad}}}const Ua=function(){var t;const e=Fa(Po);return(t=class extends e{toCHTML(t){if(this.toEmbellishedCHTML(t))return;this.standardChtmlNodes(t);const{linethickness:e,bevelled:s}=this.node.attributes.getList("linethickness","bevelled"),i=this.isDisplay();if(s)this.makeBevelled(i);else{const t=this.length2em(String(e),.06);0===t?this.makeAtop(i):this.makeFraction(i,t)}}makeFraction(t,e){const{numalign:s,denomalign:i}=this.node.attributes.getList("numalign","denomalign"),n=t?{type:"d"}:{},r=this.node.getProperty("withDelims")?Object.assign(Object.assign({},n),{delims:"true"}):Object.assign({},n),o="center"!==s?{align:s}:{},a="center"!==i?{align:i}:{},l=Object.assign({},n),h=Object.assign({},n),c=this.font.params;if(.06!==e){const s=c.axis_height,i=this.font.params.rule_factor,o=this.em(e),{T:a,u:d,v:u}=this.getTUV(t,e),p=(t?this.em(3*e):o)+" -.1em";n.style={height:o,"border-top":this.em(e*i)+" solid",margin:p};const m=this.em(Math.max(0,d));h.style={height:m,"vertical-align":"-"+m},l.style={height:this.em(Math.max(0,u))},r.style={"vertical-align":this.em(s-a)}}let d,u;this.adaptor.append(this.dom[0],this.html("mjx-frac",r,[d=this.html("mjx-num",o,[this.html("mjx-nstrut",h)]),this.html("mjx-dbox",{},[this.html("mjx-dtable",{},[this.html("mjx-line",n),this.html("mjx-row",{},[u=this.html("mjx-den",a,[this.html("mjx-dstrut",l)])])])])])),this.childNodes[0].toCHTML([d]),this.childNodes[1].toCHTML([u])}makeAtop(t){const{numalign:e,denomalign:s}=this.node.attributes.getList("numalign","denomalign"),i=t?{type:"d",atop:!0}:{atop:!0},n=this.node.getProperty("withDelims")?Object.assign(Object.assign({},i),{delims:!0}):Object.assign({},i),r="center"!==e?{align:e}:{},o="center"!==s?{align:s}:{},{v:a,q:l}=this.getUVQ(t);let h,c;r.style={"padding-bottom":this.em(l)},n.style={"vertical-align":this.em(-a)},this.adaptor.append(this.dom[0],this.html("mjx-frac",n,[h=this.html("mjx-num",r),c=this.html("mjx-den",o)])),this.childNodes[0].toCHTML([h]),this.childNodes[1].toCHTML([c])}makeBevelled(t){const e=this.adaptor;e.setAttribute(this.dom[0],"bevelled","ture");const s=e.append(this.dom[0],this.html("mjx-num"));this.childNodes[0].toCHTML([s]),this.bevel.toCHTML(this.dom);const i=e.append(this.dom[0],this.html("mjx-den"));this.childNodes[1].toCHTML([i]);const{u:n,v:r,delta:o}=this.getBevelData(t);n&&e.setStyle(s,"verticalAlign",this.em(n)),r&&e.setStyle(i,"verticalAlign",this.em(r));const a=this.em(-o/2);e.setStyle(this.bevel.dom[0],"marginLeft",a),e.setStyle(this.bevel.dom[0],"marginRight",a)}}).kind=mn.prototype.kind,t.styles={"mjx-frac":{display:"inline-block","vertical-align":"0.17em",padding:"0 .22em"},'mjx-frac[type="d"]':{"vertical-align":".04em"},"mjx-frac[delims]":{padding:"0 .1em"},"mjx-frac[atop]":{padding:"0 .12em"},"mjx-frac[atop][delims]":{padding:"0"},"mjx-dtable":{display:"inline-table",width:"100%"},"mjx-dtable > mjx-line, mjx-dtable > mjx-row":{"font-size":"2000%"},"mjx-dbox":{display:"block","font-size":"5%"},"mjx-num":{display:"block","text-align":"center"},"mjx-den":{display:"block","text-align":"center"},"mjx-mfrac[bevelled] > mjx-num":{display:"inline-block"},"mjx-mfrac[bevelled] > mjx-den":{display:"inline-block"},'mjx-den[align="right"], mjx-num[align="right"]':{"text-align":"right"},'mjx-den[align="left"], mjx-num[align="left"]':{"text-align":"left"},"mjx-nstrut":{display:"inline-block",height:".054em",width:0,"vertical-align":"-.054em"},'mjx-nstrut[type="d"]':{height:".217em","vertical-align":"-.217em"},"mjx-dstrut":{display:"inline-block",height:".505em",width:0},'mjx-dstrut[type="d"]':{height:".726em"},"mjx-line":{display:"block","box-sizing":"border-box","min-height":"1px",height:".06em","border-top":".075em solid",margin:".06em -.1em",overflow:"hidden"},'mjx-line[type="d"]':{margin:".18em -.1em"}},t}();function Ha(t){return class extends t{get base(){return 0}get root(){return null}combineRootBBox(t,e,s){}getPQ(t){const e=this.font.params.rule_thickness,s=this.font.params.surd_height,i=this.node.attributes.get("displaystyle")?this.font.params.x_height:e;return[i,t.h+t.d>this.surdH?(t.h+t.d-(this.surdH-e-s-i/2))/2:s+i/4]}getRootDimens(t,e){return[0,0,0,0]}rootWidth(){return 1.25}getStretchedSurd(){const t=this.font.params.rule_thickness,e=this.font.params.surd_height,s=this.node.attributes.get("displaystyle")?this.font.params.x_height:t,{h:i,d:n}=this.childNodes[this.base].getOuterBBox();this.surdH=i+n+t+e+s/4,this.surd.getStretchedVariant([this.surdH-n,n],!0)}constructor(t,e,s=null){super(t,e,s),this.surd=this.createMo("\u221a"),this.surd.canStretch(po.Vertical),this.getStretchedSurd()}computeBBox(t,e=!1){t.empty();const s=this.surd.getBBox(),i=new jr(this.childNodes[this.base].getOuterBBox()),n=this.getPQ(s)[1],r=this.font.params.rule_thickness,o=this.font.params.surd_height,a=i.h+n+r,[l]=this.getRootDimens(s,a);t.h=a+o,this.combineRootBBox(t,s,a),t.combine(s,l,a-s.h),t.combine(i,l+s.w,0),t.clean(),this.setChildPWidths(e)}invalidateBBox(){super.invalidateBBox(),this.surd.childNodes[0].invalidateBBox()}}}const Wa=function(){var t;const e=Ha(Po);return t=class extends e{toCHTML(t){const e=this.surd,s=this.childNodes[this.base],i=e.getBBox(),n=s.getOuterBBox(),[,r]=this.getPQ(i),o=this.font.params.surd_height,a=n.h+r+o,l=this.adaptor,h=this.standardChtmlNodes(t);let c,d,u,p;null!=this.root&&(u=l.append(h[0],this.html("mjx-root")),p=this.childNodes[this.root]);const m=l.append(h[0],this.html("mjx-sqrt",{},[c=this.html("mjx-surd"),d=this.html("mjx-box",{style:{paddingTop:this.em(r)}})]));.06!==o&&l.setStyle(d,"border-top-width",this.em(o*this.font.params.rule_factor)),this.addRoot(u,p,i,a),e.toCHTML([c]),s.toCHTML([d]),e.size<0&&l.addClass(m,"mjx-tall")}addRoot(t,e,s,i){}},t.kind=fn.prototype.kind,t.styles={"mjx-root":{display:"inline-block","white-space":"nowrap"},"mjx-surd":{display:"inline-block","vertical-align":"top"},"mjx-sqrt":{display:"inline-block","padding-top":".075em"},"mjx-sqrt > mjx-box":{"border-top":".075em solid","padding-left":".03em","margin-left":"-.03em"},"mjx-sqrt.mjx-tall > mjx-box":{"padding-left":".3em","margin-left":"-.3em"}},t}();function Va(t){return class extends t{get root(){return 1}combineRootBBox(t,e,s){const i=this.childNodes[this.root].getOuterBBox(),n=this.getRootDimens(e,s)[1];t.combine(i,0,n)}getRootDimens(t,e){const s=this.surd,i=this.childNodes[this.root].getOuterBBox(),n=(s.size<0?.5:.6)*t.w,{w:r,rscale:o}=i,a=Math.max(r,n/o),l=Math.max(0,a-r);return[a*o-n,this.rootHeight(i,t,s.size,e),l]}rootHeight(t,e,s,i){const n=e.h+e.d;return(s<0?1.9:.55*n)-(n-i)+Math.max(0,t.d*t.rscale)}rootWidth(){const t=this.childNodes[this.root].getOuterBBox();return.4+t.w*t.rscale}}}const qa=function(){var t;const e=Va(Wa);return t=class extends e{addRoot(t,e,s,i){e.toCHTML([t]);const n=this.adaptor,[r,o,a]=this.getRootDimens(s,i);n.setStyle(t,"verticalAlign",this.em(o)),n.setStyle(t,"width",this.em(r)),a&&n.setStyle(n.firstChild(t),"paddingLeft",this.em(a))}},t.kind=gn.prototype.kind,t}();function Xa(t){var e;return(e=class extends t{get scriptChild(){return this.childNodes[this.node.sub]}getOffset(){return[this.baseIsChar?0:this.getAdjustedIc(),-this.getV()]}}).useIC=!1,e}function za(t){return class extends t{get scriptChild(){return this.childNodes[this.node.sup]}getOffset(){return[this.getAdjustedIc()-(this.baseRemoveIc?0:this.baseIc),this.getU()]}}}function Ga(t){var e;return e=class extends t{constructor(){super(...arguments),this.UVQ=null}get subChild(){return this.childNodes[this.node.sub]}get supChild(){return this.childNodes[this.node.sup]}get scriptChild(){return this.supChild}getUVQ(t=this.subChild.getOuterBBox(),e=this.supChild.getOuterBBox()){const s=this.baseCore,i=s.getLineBBox(s.breakCount);if(this.UVQ)return this.UVQ;const n=this.font.params,r=3*n.rule_thickness,o=this.length2em(this.node.attributes.get("subscriptshift"),n.sub2),a=this.baseCharZero(i.d*this.baseScale+n.sub_drop*t.rscale),l=e.d*e.rscale,h=t.h*t.rscale;let[c,d]=[this.getU(),Math.max(a,o)],u=c-l-(h-d);if(u<r){d+=r-u;const t=.8*n.x_height-(c-l);t>0&&(c+=t,d-=t)}return c=Math.max(this.length2em(this.node.attributes.get("superscriptshift"),c),c),d=Math.max(this.length2em(this.node.attributes.get("subscriptshift"),d),d),u=c-l-(h-d),this.UVQ=[c,-d,u],this.UVQ}appendScripts(t){const[e,s]=[this.subChild.getOuterBBox(),this.supChild.getOuterBBox()],i=this.getBaseWidth(),n=this.getAdjustedIc(),[r,o]=this.getUVQ(),a=t.d-this.baseChild.getLineBBox(this.baseChild.breakCount).d;return t.combine(e,i+(this.baseIsChar?0:n),o-a),t.combine(s,i+n,r-a),t.w+=this.font.params.scriptspace,t}},e.useIC=!1,e}function Ja(t){var e;return e=class extends t{get baseChild(){return this.childNodes[this.node.base]}get scriptChild(){return this.childNodes[1]}getBaseCore(){let t=this.getSemanticBase()||this.childNodes[0],e=null==t?void 0:t.node;for(;t&&(1===t.childNodes.length&&(e.isKind("mrow")||e.isKind("TeXAtom")||e.isKind("mstyle")||e.isKind("mpadded")&&!e.getProperty("vbox")||e.isKind("mphantom")||e.isKind("semantics"))||e.isKind("munderover")&&t.isMathAccent);)this.setBaseAccentsFor(t),t=t.childNodes[0],e=null==t?void 0:t.node;return t||(this.baseHasAccentOver=this.baseHasAccentUnder=!1),t||this.childNodes[0]}setBaseAccentsFor(t){t.node.isKind("munderover")&&(null===this.baseHasAccentOver&&(this.baseHasAccentOver=!!t.node.attributes.get("accent")),null===this.baseHasAccentUnder&&(this.baseHasAccentUnder=!!t.node.attributes.get("accentunder")))}getSemanticBase(){const t=this.node.attributes.getExplicit("data-semantic-fencepointer");return this.getBaseFence(this.baseChild,t)}getBaseFence(t,e){if(!t||!t.node.attributes||!e)return null;if(t.node.attributes.getExplicit("data-semantic-id")===e)return t;for(const s of t.childNodes){const t=this.getBaseFence(s,e);if(t)return t}return null}getBaseScale(){let t=this.baseCore,e=1;for(;t&&t!==this;){e*=t.getOuterBBox().rscale,t=t.parent}return e}getBaseIc(){return this.baseCore.getOuterBBox().ic*this.baseScale}getAdjustedIc(){return this.baseIc?1.05*this.baseIc+.05:0}isCharBase(){const t=this.baseCore;return(t.node.isKind("mo")&&null===t.size||t.node.isKind("mi")||t.node.isKind("mn"))&&1===t.bbox.rscale&&1===Array.from(t.getText()).length}checkLineAccents(){if(this.node.isKind("munderover"))if(this.node.isKind("mover"))this.isLineAbove=this.isLineAccent(this.scriptChild);else if(this.node.isKind("munder"))this.isLineBelow=this.isLineAccent(this.scriptChild);else{const t=this;this.isLineAbove=this.isLineAccent(t.overChild),this.isLineBelow=this.isLineAccent(t.underChild)}}isLineAccent(t){const e=t.coreMO().node;return e.isToken&&"\u2015"===e.getText()}getBaseWidth(){const t=this.baseChild.getLineBBox(this.baseChild.breakCount);return t.w*t.rscale-(this.baseRemoveIc?this.baseIc:0)+this.font.params.extra_ic}getOffset(){return[0,0]}baseCharZero(t){const e=!!this.baseCore.node.attributes.get("largeop"),s=!(!this.baseCore.node.isKind("mo")||!this.baseCore.size),i=this.baseScale;return!this.baseIsChar||e||s||1!==i?t:0}getV(){const t=this.baseCore,e=t.getLineBBox(t.breakCount),s=this.scriptChild.getOuterBBox(),i=this.font.params,n=this.length2em(this.node.attributes.get("subscriptshift"),i.sub1);return Math.max(this.baseCharZero(e.d*this.baseScale+i.sub_drop*s.rscale),n,s.h*s.rscale-.8*i.x_height)}getU(){const t=this.baseCore,e=t.getLineBBox(t.breakCount),s=this.scriptChild.getOuterBBox(),i=this.font.params,n=this.node.attributes.getList("displaystyle","superscriptshift"),r=this.node.getProperty("texprimestyle")?i.sup3:n.displaystyle?i.sup1:i.sup2,o=this.length2em(n.superscriptshift,r);return Math.max(this.baseCharZero(e.h*this.baseScale-i.sup_drop*s.rscale),o,s.d*s.rscale+1/4*i.x_height)}hasMovableLimits(){const t=this.node.attributes.get("displaystyle"),e=this.baseChild.coreMO().node;return!t&&!!e.attributes.get("movablelimits")}getOverKU(t,e){const s=this.node.attributes.get("accent"),i=this.font.params,n=e.d*e.rscale,r=i.rule_thickness*i.separation_factor,o=this.baseHasAccentOver?r:0,a=this.isLineAbove?3*i.rule_thickness:r,l=(s?a:Math.max(i.big_op_spacing1,i.big_op_spacing3-Math.max(0,n)))-o;return[l,t.h*t.rscale+l+n]}getUnderKV(t,e){const s=this.node.attributes.get("accentunder"),i=this.font.params,n=e.h*e.rscale,r=i.rule_thickness*i.separation_factor,o=this.baseHasAccentUnder?r:0,a=this.isLineBelow?3*i.rule_thickness:r,l=(s?a:Math.max(i.big_op_spacing2,i.big_op_spacing4-n))-o;return[l,-(t.d*t.rscale+l+n)]}getDeltaW(t,e=[0,0,0]){const s=this.node.attributes.get("align"),i=t.map(t=>t.w*t.rscale);i[0]-=this.baseRemoveIc&&!this.baseCore.node.attributes.get("largeop")?this.baseIc:0;const n=Math.max(...i),r=[];let o=0;for(const t of i.keys())r[t]=("center"===s?(n-i[t])/2:"right"===s?n-i[t]:0)+e[t],r[t]<o&&(o=-r[t]);if(o)for(const t of r.keys())r[t]+=o;return[1,2].map(e=>r[e]+=t[e]?t[e].dx*t[0].rscale:0),r}getDelta(t,e=!1){const s=this.node.attributes.get("accent");let{sk:i,ic:n}=this.baseCore.getOuterBBox();return s&&(i-=t.getOuterBBox().sk),((s&&!e?i:0)+this.font.skewIcFactor*n)*this.baseScale}stretchChildren(){const t=[];for(const e of this.childNodes)e.canStretch(po.Horizontal)&&t.push(e);const e=t.length,s=this.childNodes.length;if(e&&s>1){let i=0;const n=e>1&&e===s;for(const t of this.childNodes){const e=t.stretch.dir===po.None;if(n||e){const{w:s,rscale:n}=t.getOuterBBox(e);s*n>i&&(i=s*n)}}for(const e of t){const t=e.coreMO();null===t.size&&t.getStretchedVariant([i/e.coreRScale()])}}}constructor(t,e,s=null){super(t,e,s),this.baseScale=1,this.baseIc=0,this.baseRemoveIc=!1,this.baseIsChar=!1,this.baseHasAccentOver=null,this.baseHasAccentUnder=null,this.isLineAbove=!1,this.isLineBelow=!1,this.isMathAccent=!1;const i=this.baseCore=this.getBaseCore();i&&(this.setBaseAccentsFor(i),this.baseScale=this.getBaseScale(),this.baseIc=this.getBaseIc(),this.baseIsChar=this.isCharBase(),this.isMathAccent=this.baseIsChar&&this.scriptChild&&void 0!==this.scriptChild.coreMO().node.getProperty("mathaccent"),this.checkLineAccents(),this.baseRemoveIc=!this.isLineAbove&&!this.isLineBelow&&(!this.constructor.useIC||this.isMathAccent))}computeBBox(t,e=!1){t.empty(),t.append(this.baseChild.getOuterBBox()),this.appendScripts(t),t.clean(),this.setChildPWidths(e)}appendScripts(t){const e=this.getBaseWidth(),[s,i]=this.getOffset();return t.combine(this.scriptChild.getOuterBBox(),e+s,i),t.w+=this.font.params.scriptspace,t}get breakCount(){return this._breakCount<0&&(this._breakCount=this.node.isEmbellished?this.coreMO().embellishedBreakCount:this.node.linebreakContainer?0:this.childNodes[0].breakCount),this._breakCount}breakTop(t,e){return this.node.linebreakContainer||!this.parent||this.node.childIndex(e.node)?t:this.parent.breakTop(t,this)}computeLineBBox(t){const e=this.breakCount;if(!e)return To.from(this.getOuterBBox(),this.linebreakOptions.lineleading);const s=this.baseChild.getLineBBox(t).copy();return t<e?(0===t&&this.addLeftBorders(s),this.addMiddleBorders(s)):(this.appendScripts(s),this.addMiddleBorders(s),this.addRightBorders(s)),s}},e.useIC=!0,e}const Ka=function(){var t;const e=Ja(Po);return(t=class extends e{toCHTML(t){if(this.toEmbellishedCHTML(t))return;this.dom=this.standardChtmlNodes(t);const[e,s]=this.getOffset(),i=e-(this.baseRemoveIc?this.baseIc:0),n={"vertical-align":this.em(s)};i&&(n["margin-left"]=this.em(i)),this.baseChild.toCHTML(this.dom);const r=this.dom[this.dom.length-1];this.scriptChild.toCHTML([this.adaptor.append(r,this.html("mjx-script",{style:n}))])}markUsed(){super.markUsed(),this.jax.wrapperUsage.add(Qa.kind)}setDeltaW(t,e){for(let s=0;s<e.length;s++)e[s]&&this.adaptor.setStyle(t[s],"paddingLeft",this.em(e[s]))}adjustOverDepth(t,e){e.d>=0||this.adaptor.setStyle(t,"marginBottom",this.em(e.d*e.rscale))}adjustUnderDepth(t,e){if(e.d>=0)return;const s=this.adaptor,i=this.em(e.d),n=this.html("mjx-box",{style:{"margin-bottom":i,"vertical-align":i}});for(const e of s.childNodes(s.firstChild(t)))s.append(n,e);s.append(s.firstChild(t),n)}adjustBaseHeight(t,e){if(this.node.attributes.get("accent")){const s=this.font.params.x_height*this.baseScale;e.h<s&&(this.adaptor.setStyle(t,"paddingTop",this.em(s-e.h)),e.h=s)}}}).kind="scriptbase",t}(),$a=function(){var t;const e=Xa(Ka);return(t=class extends e{}).kind=Cn.prototype.kind,t}(),Ya=function(){var t;const e=za(Ka);return(t=class extends e{}).kind=Rn.prototype.kind,t}(),Qa=function(){var t;const e=Ga(Ka);return(t=class extends e{toCHTML(t){if(this.toEmbellishedCHTML(t))return;const e=this.adaptor,s=this.standardChtmlNodes(t),[i,n,r]=[this.baseChild,this.supChild,this.subChild],[,o,a]=this.getUVQ(),l={"vertical-align":this.em(o)};i.toCHTML(s);const h=e.append(s[s.length-1],this.html("mjx-script",{style:l}));n.toCHTML([h]),e.append(h,this.html("mjx-spacer",{style:{"margin-top":this.em(a)}})),r.toCHTML([h]);const c=this.getAdjustedIc();c&&(e.setStyle(n.dom[0],"marginLeft",this.em(c/n.bbox.rscale)),this.baseIsChar||e.setStyle(r.dom[0],"marginLeft",this.em(c/n.bbox.rscale))),this.baseRemoveIc&&e.setStyle(h,"marginLeft",this.em(-this.baseIc))}}).kind=Ln.prototype.kind,t.styles={"mjx-script":{display:"inline-block","padding-right":".05em","padding-left":".033em"},"mjx-script > mjx-spacer":{display:"block"}},t}();function Za(t){return class extends t{get scriptChild(){return this.childNodes[this.node.under]}constructor(...t){super(...t),this.stretchChildren()}computeBBox(t,e=!1){if(this.hasMovableLimits())return void super.computeBBox(t,e);t.empty();const s=this.baseChild.getOuterBBox(),i=this.scriptChild.getOuterBBox(),n=this.getUnderKV(s,i)[1],r=this.isLineBelow?0:this.getDelta(this.scriptChild,!0),[o,a]=this.getDeltaW([s,i],[0,-r]);t.combine(s,o,0),t.combine(i,a,n),t.d+=this.font.params.big_op_spacing5,t.clean(),this.setChildPWidths(e)}}}function tl(t){return class extends t{get scriptChild(){return this.childNodes[this.node.over]}constructor(...t){super(...t),this.stretchChildren()}computeBBox(t){if(this.hasMovableLimits())return void super.computeBBox(t);t.empty();const e=this.baseChild.getOuterBBox(),s=this.scriptChild.getOuterBBox();this.node.attributes.get("accent")&&(e.h=Math.max(e.h,this.font.params.x_height*this.baseScale));const i=this.getOverKU(e,s)[1],n=this.isLineAbove?0:this.getDelta(this.scriptChild),[r,o]=this.getDeltaW([e,s],[0,n]);t.combine(e,r,0),t.combine(s,o,i),t.h+=this.font.params.big_op_spacing5,t.clean()}}}function el(t){return class extends t{get underChild(){return this.childNodes[this.node.under]}get overChild(){return this.childNodes[this.node.over]}get subChild(){return this.underChild}get supChild(){return this.overChild}constructor(...t){super(...t),this.stretchChildren()}computeBBox(t){if(this.hasMovableLimits())return void super.computeBBox(t);t.empty();const e=this.overChild.getOuterBBox(),s=this.baseChild.getOuterBBox(),i=this.underChild.getOuterBBox();this.node.attributes.get("accent")&&(s.h=Math.max(s.h,this.font.params.x_height*this.baseScale));const n=this.getOverKU(s,e)[1],r=this.getUnderKV(s,i)[1],o=this.getDelta(this.overChild),a=this.getDelta(this.underChild,!0),[l,h,c]=this.getDeltaW([s,i,e],[0,this.isLineBelow?0:-a,this.isLineAbove?0:o]);t.combine(s,l,0),t.combine(e,c,n),t.combine(i,h,r);const d=this.font.params.big_op_spacing5;t.h+=d,t.d+=d,t.clean()}}}const sl=function(){var t;const e=Za($a);return(t=class extends e{toCHTML(t){if(this.toEmbellishedCHTML(t))return;if(this.hasMovableLimits())return super.toCHTML(t),void this.adaptor.setAttribute(this.dom[0],"limits","false");this.dom=this.standardChtmlNodes(t);const e=this.adaptor.append(this.adaptor.append(this.dom[0],this.html("mjx-row")),this.html("mjx-base")),s=this.adaptor.append(this.adaptor.append(this.dom[0],this.html("mjx-row")),this.html("mjx-under"));this.baseChild.toCHTML([e]),this.scriptChild.toCHTML([s]);const i=this.baseChild.getOuterBBox(),n=this.scriptChild.getOuterBBox(),r=this.getUnderKV(i,n)[0],o=this.isLineBelow?0:this.getDelta(this.scriptChild,!0);this.adaptor.setStyle(s,"paddingTop",this.em(r)),this.setDeltaW([e,s],this.getDeltaW([i,n],[0,-o])),this.adjustUnderDepth(s,n)}}).kind=Sn.prototype.kind,t.styles={"mjx-over":{"text-align":"left"},'mjx-munder:not([limits="false"])':{display:"inline-table"},"mjx-munder > mjx-row":{"text-align":"left"},"mjx-under":{"padding-bottom":".1em"}},t}(),il=function(){var t;const e=tl(Ya);return(t=class extends e{toCHTML(t){if(this.toEmbellishedCHTML(t))return;if(this.hasMovableLimits())return super.toCHTML(t),void this.adaptor.setAttribute(this.dom[0],"limits","false");this.dom=this.standardChtmlNodes(t);const e=this.adaptor.append(this.dom[0],this.html("mjx-over")),s=this.adaptor.append(this.dom[0],this.html("mjx-base"));this.scriptChild.toCHTML([e]),this.baseChild.toCHTML([s]);const i=this.scriptChild.getOuterBBox(),n=this.baseChild.getOuterBBox();this.adjustBaseHeight(s,n);const r=this.getOverKU(n,i)[0],o=this.isLineAbove?0:this.getDelta(this.scriptChild);this.adaptor.setStyle(e,"paddingBottom",this.em(r)),this.setDeltaW([s,e],this.getDeltaW([n,i],[0,o])),this.adjustOverDepth(e,i)}}).kind=An.prototype.kind,t.styles={'mjx-mover:not([limits="false"])':{"padding-top":".1em"},[["base","over"].map(t=>`mjx-mover:not([limits="false"]) > mjx-${t}`).join(", ")]:{display:"block","text-align":"left"}},t}(),nl=function(){var t;const e=el(Qa);return(t=class extends e{toCHTML(t){if(this.toEmbellishedCHTML(t))return;if(this.hasMovableLimits())return super.toCHTML(t),void this.adaptor.setAttribute(this.dom[0],"limits","false");this.dom=this.standardChtmlNodes(t);const e=this.adaptor.append(this.dom[0],this.html("mjx-over")),s=this.adaptor.append(this.adaptor.append(this.dom[0],this.html("mjx-box")),this.html("mjx-munder")),i=this.adaptor.append(this.adaptor.append(s,this.html("mjx-row")),this.html("mjx-base")),n=this.adaptor.append(this.adaptor.append(s,this.html("mjx-row")),this.html("mjx-under"));this.overChild.toCHTML([e]),this.baseChild.toCHTML([i]),this.underChild.toCHTML([n]);const r=this.overChild.getOuterBBox(),o=this.baseChild.getOuterBBox(),a=this.underChild.getOuterBBox();this.adjustBaseHeight(i,o);const l=this.getOverKU(o,r)[0],h=this.getUnderKV(o,a)[0],c=this.getDelta(this.overChild),d=this.getDelta(this.underChild,!0);this.adaptor.setStyle(e,"paddingBottom",this.em(l)),this.adaptor.setStyle(n,"paddingTop",this.em(h)),this.setDeltaW([i,n,e],this.getDeltaW([o,a,r],[0,this.isLineBelow?0:-d,this.isLineAbove?0:c])),this.adjustOverDepth(e,r),this.adjustUnderDepth(n,a)}}).kind=In.prototype.kind,t.styles={'mjx-munderover:not([limits="false"])':{"padding-top":".1em"},[["over","box"].map(t=>`mjx-munderover:not([limits="false"]) > mjx-${t}`).join(", ")]:{display:"block"}},t}(),rl={base:"subList",subList:"supList",supList:"subList",psubList:"psupList",psupList:"psubList"},ol=["sup","sup","psup","psub"];function al(t){return class extends t{combinePrePost(t,e){const s=new jr(t);return s.combine(e,0,0),s}getScriptData(){const t=this.scriptData={base:null,sub:jr.empty(),sup:jr.empty(),psub:jr.empty(),psup:jr.empty(),numPrescripts:0,numScripts:0},e=this.getScriptBBoxLists();this.combineBBoxLists(t.sub,t.sup,e.subList,e.supList),this.combineBBoxLists(t.psub,t.psup,e.psubList,e.psupList),t.base=e.base[0],t.numPrescripts=e.psubList.length,t.numScripts=e.subList.length}getScriptBBoxLists(){const t={base:[],subList:[],supList:[],psubList:[],psupList:[]};let e="base";for(const s of this.childNodes)s.node.isKind("mprescripts")?e="psubList":(t[e].push(s.getOuterBBox()),e=rl[e]);return this.firstPrescript=t.subList.length+t.supList.length+2,this.padLists(t.subList,t.supList),this.padLists(t.psubList,t.psupList),t}padLists(t,e){t.length>e.length&&e.push(jr.empty())}combineBBoxLists(t,e,s,i){for(let n=0;n<s.length;n++){const[r,o,a]=this.getScaledWHD(s[n]),[l,h,c]=this.getScaledWHD(i[n]),d=Math.max(r,l);t.w+=d,e.w+=d,o>t.h&&(t.h=o),a>t.d&&(t.d=a),h>e.h&&(e.h=h),c>e.d&&(e.d=c)}}getScaledWHD(t){const{w:e,h:s,d:i,rscale:n}=t;return[e*n,s*n,i*n]}getCombinedUV(){const t=this.scriptData,e=this.combinePrePost(t.sub,t.psub),s=this.combinePrePost(t.sup,t.psup);return this.getUVQ(e,s)}addPrescripts(t,e,s){const i=this.scriptData;if(i.numPrescripts){const n=this.font.params.scriptspace;t.combine(i.psup,n,e),t.combine(i.psub,n,s)}return t}addPostscripts(t,e,s){const i=this.scriptData;if(i.numScripts){const n=t.w;t.combine(i.sup,n,e),t.combine(i.sub,n,s),t.w+=this.font.params.scriptspace}return t}constructor(...t){super(...t),this.scriptData=null,this.firstPrescript=0,this.getScriptData()}appendScripts(t){t.empty();const[e,s]=this.getCombinedUV();return this.addPrescripts(t,e,s),t.append(this.scriptData.base),this.addPostscripts(t,e,s),t.clean(),t}computeLineBBox(t){const e=this.baseChild.breakCount,s=this.baseChild.getLineBBox(t).copy();let i=s;const[n,r]=this.getCombinedUV();return 0===t?(i=To.from(this.addPrescripts(jr.zero(),n,r),this.linebreakOptions.lineleading),i.append(s),this.addLeftBorders(i),i.L=this.bbox.L):t===e&&(i=this.addPostscripts(i,n,r),this.addRightBorders(i),i.R=this.bbox.R),this.addMiddleBorders(i),i}getUVQ(t,e){if(!this.UVQ){let[s,i,n]=[0,0,0];0===t.w?s=this.getU():0===e.w?s=-this.getV():[s,i,n]=super.getUVQ(t,e),this.UVQ=[s,i,n]}return this.UVQ}}}const ll=function(){var t;const e=al(Qa);return(t=class extends e{toCHTML(t){if(this.toEmbellishedCHTML(t))return;const e=this.standardChtmlNodes(t),s=this.scriptData,i=this.node.getProperty("scriptalign")||"right left",[n,r]=rn(i+" "+i),[o,a]=this.getCombinedUV();if(s.numPrescripts){const t=this.addScripts(this.dom[0],o,-a,!0,s.psub,s.psup,this.firstPrescript,s.numPrescripts);"right"!==n&&this.adaptor.setAttribute(t,"script-align",n)}if(this.childNodes[0].toCHTML(e),s.numScripts){const t=this.addScripts(this.dom[this.dom.length-1],o,-a,!1,s.sub,s.sup,1,s.numScripts);"left"!==r&&this.adaptor.setAttribute(t,"script-align",r)}}addScripts(t,e,s,i,n,r,o,a){const l=this.adaptor,h=e-r.d+(s-n.h),c=e<0&&0===s?n.h+e:e,d=h>0?{style:{height:this.em(h)}}:{},u=c?{style:{"vertical-align":this.em(c)}}:{},p=this.html("mjx-row"),m=this.html("mjx-row",d),f=this.html("mjx-row"),g="mjx-"+(i?"pre":"")+"scripts",b=o+2*a;for(;o<b;)this.childNodes[o++].toCHTML([l.append(f,this.html("mjx-cell"))]),this.childNodes[o++].toCHTML([l.append(p,this.html("mjx-cell"))]);return l.append(t,this.html(g,u,[p,m,f]))}}).kind=wn.prototype.kind,t.styles={"mjx-prescripts":{display:"inline-table","padding-left":".05em"},"mjx-scripts":{display:"inline-table","padding-right":".05em"},"mjx-prescripts > mjx-row > mjx-cell":{"text-align":"right"},'[script-align="left"] > mjx-row > mjx-cell':{"text-align":"left"},'[script-align="center"] > mjx-row > mjx-cell':{"text-align":"center"},'[script-align="right"] > mjx-row > mjx-cell':{"text-align":"right"},"mjx-none":{display:"inline-block",height:"1px"}},t}(),hl=.333;function cl(t){return class extends t{get tableRows(){return this.childNodes}findContainer(){let t=this,e=t.parent;for(;e&&(e.node.notParent||e.node.isKind("mrow"));)t=e,e=e.parent;this.container=e,this.containerI=t.node.childPosition()}getPercentageWidth(){if(this.hasLabels)this.bbox.pwidth=jr.fullWidth;else{const t=this.node.attributes.get("width");nn(t)&&(this.bbox.pwidth=t)}}stretchRows(){const t=this.node.attributes.get("equalrows"),e=t?this.getEqualRowHeight():0,{H:s,D:i}=t?this.getTableData():{H:[0],D:[0]},n=this.tableRows;for(let r=0;r<this.numRows;r++){const o=t?[(e+s[r]-i[r])/2,(e-s[r]+i[r])/2]:null;n[r].stretchChildren(o)}}stretchColumns(){const t=this.getColumnAttributes("columnwidth",0);for(let e=0;e<this.numCols;e++){const s="number"==typeof this.cWidths[e]?this.cWidths[e]:null;this.stretchColumn(e,s),null!==s&&this.breakColumn(e,s,t[e])}}stretchColumn(t,e){const s=[];for(const e of this.tableRows){const i=e.getChild(t);if(i){const t=i.childNodes[0];t.stretch.dir===po.None&&t.canStretch(po.Horizontal)&&s.push(t)}}const i=s.length;if(i&&null===e){e=0;const s=i===this.childNodes.length;for(const i of this.tableRows){const n=i.getChild(t);if(n){const t=n.childNodes[0],i=t.stretch.dir===po.None;if(s||i){const{w:s}=t.getBBox(i);s>e&&(e=s)}}}}if(null!==e){const i=this.getTableData().W;for(const n of s){let s=n.getBBox().w;n.coreMO().getStretchedVariant([Math.max(e,s)/n.coreRScale()]),s=n.getBBox().w,s>i[t]&&(i[t]=s)}}}breakColumn(t,e,s){if("linebreak"!==this.jax.math.root.attributes.get("overflow")||!this.jax.math.display)return;const{H:i,D:n}=this.getTableData();let r=0,o=0;for(const s of this.tableRows){const a=s.getChild(t);if(a){const l=s.getBBox().rscale,h=a.getBBox();if(a&&h.w*l>e){a.childNodes[0].breakToWidth(e);const o=s.node.attributes.get("rowalign");this.updateHDW(a,t,r,o,i,n)}h.w*l>o&&(o=h.w*l)}const l=s.getBBox();l.h=i[r],l.d=n[r],r++}("fit"===s||"auto"===s||nn(s)||o>this.cWidths[t])&&(this.cWidths[t]=o)}getTableData(){if(this.data)return this.data;const t=new Array(this.numRows).fill(0),e=new Array(this.numRows).fill(0),s=new Array(this.numCols).fill(0),i=new Array(this.numRows),n=new Array(this.numRows),r=[0],o=this.tableRows;for(let a=0;a<o.length;a++){const l=o[a],h=l.node.attributes.get("rowalign");for(let i=0;i<l.numCells;i++){const n=l.getChild(i);this.updateHDW(n,i,a,h,t,e,s),this.recordPWidthCell(n,i)}i[a]=t[a],n[a]=e[a],l.labeled&&this.updateHDW(l.childNodes[0],0,a,h,t,e,r),l.bbox.h=t[a],l.bbox.d=e[a]}const a=r[0];return this.data={H:t,D:e,W:s,NH:i,ND:n,L:a},this.data}updateHDW(t,e,s,i,n,r,o=null){let{h:a,d:l,w:h}=t.getBBox();const c=t.parent.bbox.rscale;1!==t.parent.bbox.rscale&&(a*=c,l*=c,h*=c),this.node.getProperty("useHeight")&&(a<.75&&(a=.75),l<.25&&(l=.25)),i=t.node.attributes.get("rowalign")||i,Object.hasOwn(this.adjustHD,i)||(i="other"),this.adjustHD[i](a,l,n,r,s),o&&h>o[e]&&(o[e]=h)}recordPWidthCell(t,e){t.childNodes[0]&&t.childNodes[0].getBBox().pwidth&&this.pwidthCells.push([t,e])}setColumnPWidths(){const t=this.cWidths;for(const[e,s]of this.pwidthCells)e.setChildPWidths(!1,t[s])&&(e.invalidateBBox(),e.getBBox())}getBBoxHD(t){const[e,s]=this.getAlignmentRow();if(null===s){const s=this.font.params.axis_height,i=t/2;return{top:[0,t],center:[i,i],bottom:[t,0],baseline:[i,i],axis:[i+s,i-s]}[e]||[i,i]}{const i=this.getVerticalPosition(s,e);return[i,t-i]}}getBBoxLR(){var t;if(this.hasLabels){const t=this.node.attributes,e=t.get("side");let[s,i]=this.getPadAlignShift(e);const n=this.hasLabels&&!!t.get("data-width-includes-label");return n&&this.frame&&this.fSpace[0]&&(s-=this.fSpace[0]),"center"!==i||n?"left"===e?[s,0]:[0,s]:[s,s]}return[(null===(t=this.bbox)||void 0===t?void 0:t.L)||0,0]}getPadAlignShift(t){const{L:e}=this.getTableData();let s=e+this.length2em(this.node.attributes.get("minlabelspacing"));const[i,n]=null==this.styles?["",""]:[this.styles.get("padding-left"),this.styles.get("padding-right")];(i||n)&&(s=Math.max(s,this.length2em(i||"0"),this.length2em(n||"0")));let[r,o]=this.getAlignShift();return r===t&&(o="left"===t?Math.max(s,o)-s:Math.min(-s,o)+s),[s,r,o]}getWidth(){return this.pWidth||this.getBBox().w}adjustWideTable(){const t=this.node.attributes;if("auto"!==t.get("width"))return;const[e,s]=this.getPadAlignShift(t.get("side")),i=Math.max(this.containerWidth/10,this.containerWidth-e-("center"===s?e:0));this.naturalWidth()>i&&this.adjustColumnWidths(i)}naturalWidth(){return oo(this.getComputedWidths().concat(this.cLines,this.cSpace))+2*this.fLine+this.fSpace[0]+this.fSpace[2]}getEqualRowHeight(){const{H:t,D:e}=this.getTableData(),s=Array.from(t.keys()).map(s=>t[s]+e[s]);return Math.max(...s)}getComputedWidths(){const t=this.getTableData().W;let e=Array.from(t.keys()).map(e=>"number"==typeof this.cWidths[e]?this.cWidths[e]:t[e]);return this.node.attributes.get("equalcolumns")&&(e=Array(e.length).fill(ao(e))),e}getColumnWidths(){const t=this.node.attributes.get("width");if(this.node.attributes.get("equalcolumns"))return this.getEqualColumns(t);const e=this.getColumnAttributes("columnwidth",0);return"auto"===t?this.getColumnWidthsAuto(e):nn(t)?this.getColumnWidthsPercent(e):this.getColumnWidthsFixed(e,this.length2em(t))}getEqualColumns(t){const e=Math.max(1,this.numCols);let s;if("auto"===t){const{W:t}=this.getTableData();s=ao(t)}else if(nn(t))s=this.percent(1/e);else{const i=oo([].concat(this.cLines,this.cSpace))+this.fSpace[0]+this.fSpace[2];s=Math.max(0,this.length2em(t)-i)/e}return Array(this.numCols).fill(s)}getColumnWidthsAuto(t){return t.map(t=>"auto"===t||"fit"===t?null:nn(t)?t:this.length2em(t))}getColumnWidthsPercent(t){const e=t.includes("fit"),{W:s}=e?this.getTableData():{W:null};return Array.from(t.keys()).map(i=>{const n=t[i];return"fit"===n?null:"auto"===n?e?s[i]:null:nn(n)?n:this.length2em(n)})}getColumnWidthsFixed(t,e){const s=Array.from(t.keys()),i=s.filter(e=>"fit"===t[e]),n=s.filter(e=>"auto"===t[e]),r=i.length||n.length,{W:o}=r?this.getTableData():{W:null},a=e-oo([].concat(this.cLines,this.cSpace))-this.fSpace[0]-this.fSpace[2];let l=a;s.forEach(e=>{const s=t[e];l-="fit"===s||"auto"===s?o[e]:this.length2em(s,a)});const h=r&&l>0?l/r:0;return s.map(e=>{const s=t[e];return"fit"===s?o[e]+h:"auto"===s?o[e]+(0===i.length?h:0):this.length2em(s,a)})}adjustColumnWidths(t){const{W:e}=this.getTableData(),s=this.getColumnAttributes("columnwidth",0),i=Array.from(s.keys()),n=[...i.filter(t=>"fit"===s[t]).sort((t,s)=>e[s]-e[t]),...i.filter(t=>"auto"===s[t]).sort((t,s)=>e[s]-e[t]),...i.filter(t=>nn(s[t])).sort((t,s)=>e[s]-e[t]),...i.filter(t=>"fit"!==s[t]&&"auto"!==s[t]&&!nn(s[t])).sort((t,s)=>e[s]-e[t])];if(!n.length)return;this.cWidths=i.map(t=>"number"==typeof this.cWidths[t]?this.cWidths[t]:e[t]);const r=t-oo([].concat(this.cLines,this.cSpace))-this.fSpace[0]-this.fSpace[2];let o=oo(this.cWidths)-r,a=0,l=0;for(;l<n.length&&(a+=e[n[l++]],!(a&&o/a<hl)););o=1-o/a,n.slice(0,l).forEach(t=>this.cWidths[t]*=o)}getVerticalPosition(t,e){const s=this.node.attributes.get("equalrows"),{H:i,D:n}=this.getTableData(),r=s?this.getEqualRowHeight():0,o=this.getRowHalfSpacing();let a=this.fLine;for(let e=0;e<t;e++)a+=o[e]+(s?r:i[e]+n[e])+o[e+1]+this.rLines[e];const[l,h]=s?[(r+i[t]-n[t])/2,(r-i[t]+n[t])/2]:[i[t],n[t]];return a+={top:0,center:o[t]+(l+h)/2,bottom:o[t]+l+h+o[t+1],baseline:o[t]+l,axis:o[t]+l-.25}[e]||0,a}getFrameSpacing(){const t=this.fframe?this.convertLengths(this.getAttributeArray("framespacing")):[0,0];t[2]=t[0];const e=this.node.attributes.get("data-array-padding");if(e){const[s,i]=this.convertLengths(rn(e));t[0]=s,t[2]=i}return t}getEmHalfSpacing(t,e,s=1){const i=this.addEm(e,2/s);return i.unshift(this.em(t[0]*s)),i.push(this.em(t[1]*s)),i}getRowHalfSpacing(){const t=this.rSpace.map(t=>t/2);return t.unshift(this.fSpace[1]),t.push(this.fSpace[1]),t}getColumnHalfSpacing(){const t=this.cSpace.map(t=>t/2);return t.unshift(this.fSpace[0]),t.push(this.fSpace[2]),t}getAlignmentRow(){const[t,e]=rn(this.node.attributes.get("align"));if(null==e)return[t,null];let s=parseInt(e);return s<0&&(s+=this.numRows+1),[t,s<1||s>this.numRows?null:s-1]}getColumnAttributes(t,e=1){const s=this.numCols-e,i=this.getAttributeArray(t);if(0===i.length)return null;for(;i.length<s;)i.push(i[i.length-1]);return i.length>s&&i.splice(s),i}getRowAttributes(t,e=1){const s=this.numRows-e,i=this.getAttributeArray(t);if(0===i.length)return null;for(;i.length<s;)i.push(i[i.length-1]);return i.length>s&&i.splice(s),i}getAttributeArray(t){const e=this.node.attributes.get(t);return e?rn(e):[this.node.attributes.getDefault(t)]}addEm(t,e=1){return t?t.map(t=>this.em(t/e)):null}convertLengths(t){return t?t.map(t=>this.length2em(t)):null}constructor(t,e,s=null){super(t,e,s),this.numCols=0,this.numRows=0,this.data=null,this.pwidthCells=[],this.pWidth=0,this.adjustHD={top:(t,e,s,i,n)=>{t>s[n]&&(i[n]-=t-s[n],s[n]=t),t+e>s[n]+i[n]&&(i[n]=t+e-s[n])},bottom:(t,e,s,i,n)=>{e>i[n]&&(s[n]-=e-i[n],i[n]=e),t+e>s[n]+i[n]&&(s[n]=t+e-i[n])},center:(t,e,s,i,n)=>{t+e>s[n]+i[n]&&(s[n]=i[n]=(t+e)/2)},other:(t,e,s,i,n)=>{t>s[n]&&(s[n]=t),e>i[n]&&(i[n]=e)}},this.numCols=ao(this.tableRows.map(t=>t.numCells)),this.numRows=this.childNodes.length,this.hasLabels=this.childNodes.reduce((t,e)=>t||e.node.isKind("mlabeledtr"),!1),this.findContainer(),this.isTop=!this.container||this.container.node.isKind("math")&&!this.container.parent,this.isTop&&(this.jax.table=this),this.getPercentageWidth();const i=this.node.attributes,n=i.get("frame");this.frame="none"!==n,this.fframe=this.frame||void 0!==i.get("data-frame-styles"),this.fLine=this.frame?.07:0,this.fSpace=this.getFrameSpacing(),this.cSpace=this.convertLengths(this.getColumnAttributes("columnspacing")),this.rSpace=this.convertLengths(this.getRowAttributes("rowspacing")),this.cLines=this.getColumnAttributes("columnlines").map(t=>"none"===t?0:.07),this.rLines=this.getRowAttributes("rowlines").map(t=>"none"===t?0:.07),this.cWidths=this.getColumnWidths(),this.adjustWideTable(),this.stretchColumns(),this.stretchRows()}getStyles(){super.getStyles();const t=this.node.attributes.get("data-frame-styles");if(!t)return;this.styles||(this.styles=new ro(""));const e=t.split(/ /);for(const t of zr.keys()){const s=e[t];"none"!==s&&this.styles.set(`border-${zr[t]}`,`.07em ${s}`)}}computeBBox(t,e=!1){const{H:s,D:i}=this.getTableData();let n,r;if(this.node.attributes.get("equalrows")){const t=this.getEqualRowHeight();n=oo([].concat(this.rLines,this.rSpace))+t*this.numRows}else n=oo(s.concat(i,this.rLines,this.rSpace));n+=2*(this.fLine+this.fSpace[1]),r=this.naturalWidth();const o=this.node.attributes.get("width");"auto"!==o&&(r=Math.max(this.length2em(o,0)+2*this.fLine,r));const[a,l]=this.getBBoxHD(n);t.h=a,t.d=l,t.w=r;const[h,c]=this.getBBoxLR();t.L=h,t.R=c,nn(o)||this.setColumnPWidths()}setChildPWidths(t,e,s){const i=this.node.attributes.get("width");if(!nn(i))return!1;this.hasLabels||(this.bbox.pwidth="",this.container.bbox.pwidth="");const{w:n,L:r,R:o}=this.bbox,a=this.node.attributes.get("data-width-includes-label"),l=Math.max(n,this.length2em(i,Math.max(e,r+n+o)))-(a?r+o:0),h=this.node.attributes.get("equalcolumns")?Array(this.numCols).fill(this.percent(1/Math.max(1,this.numCols))):this.getColumnAttributes("columnwidth",0);return this.cWidths=this.getColumnWidthsFixed(h,l),this.pWidth=this.naturalWidth(),this.isTop&&(this.bbox.w=this.pWidth),this.setColumnPWidths(),this.pWidth!==n&&this.parent.invalidateBBox(),this.pWidth!==n}getAlignShift(){return this.isTop?super.getAlignShift():[this.container.getChildAlign(this.containerI),0]}}}const dl=function(){var t;const e=cl(Po);return t=class extends e{constructor(t,e,s=null){super(t,e,s),this.itable=this.html("mjx-itable"),this.labels=this.html("mjx-itable")}getAlignShift(){const t=super.getAlignShift();return this.isTop||(t[1]=0),t}toCHTML(t){const e=this.standardChtmlNodes(t);this.adaptor.append(e[0],this.html("mjx-table",{},[this.itable]));for(const t of this.childNodes)t.toCHTML([this.itable]);this.padRows(),this.handleColumnSpacing(),this.handleColumnLines(),this.handleColumnWidths(),this.handleRowSpacing(),this.handleRowLines(),this.handleRowHeights(),this.handleFrame(),this.handleWidth(),this.handleLabels(),this.handleAlign(),this.handleJustify(),this.shiftColor()}shiftColor(){const t=this.adaptor,e=t.getStyle(this.dom[0],"backgroundColor");e&&(t.setStyle(this.dom[0],"backgroundColor",""),t.setStyle(this.itable,"backgroundColor",e))}padRows(){const t=this.adaptor;for(const e of t.childNodes(this.itable))for(;t.childNodes(e).length<this.numCols;)t.append(e,this.html("mjx-mtd",{extra:!0}))}handleColumnSpacing(){const t=this.childNodes[0]?1/this.childNodes[0].getBBox().rscale:1,e=this.getEmHalfSpacing([this.fSpace[0],this.fSpace[2]],this.cSpace,t);for(const t of this.tableRows){let s=0;for(const i of t.tableCells){const n=e[s++],r=e[s],o=i?i.dom[0]:this.adaptor.childNodes(t.dom[0])[s];(s>1&&"0.4em"!==n||"0"!==n&&1===s)&&this.adaptor.setStyle(o,"paddingLeft",n),(s<this.numCols&&"0.4em"!==r||"0"!==r&&s===this.numCols)&&this.adaptor.setStyle(o,"paddingRight",r)}}}handleColumnLines(){if("none"===this.node.attributes.get("columnlines"))return;const t=this.getColumnAttributes("columnlines");for(const e of this.childNodes){let s=0;const i=this.adaptor.childNodes(e.dom[0]).slice(1);for(const e of i){const i=t[s++];"none"!==i&&this.adaptor.setStyle(e,"borderLeft",".07em "+i)}}}handleColumnWidths(){for(const t of this.childNodes){let e=0;for(const s of this.adaptor.childNodes(t.dom[0])){const t=this.cWidths[e++];if(null!==t){const e="number"==typeof t?this.em(t):t;this.adaptor.setStyle(s,"width",e),this.adaptor.setStyle(s,"maxWidth",e),this.adaptor.setStyle(s,"minWidth",e)}}}}handleRowSpacing(){const t=this.childNodes[0]?1/this.childNodes[0].getBBox().rscale:1,e=this.getEmHalfSpacing([this.fSpace[1],this.fSpace[1]],this.rSpace,t),s=this.fframe;let i=0;for(const t of this.childNodes){const n=e[i++],r=e[i];for(const e of t.childNodes)(i>1&&"0.215em"!==n||s&&1===i)&&this.adaptor.setStyle(e.dom[0],"paddingTop",n),(i<this.numRows&&"0.215em"!==r||s&&i===this.numRows)&&this.adaptor.setStyle(e.dom[0],"paddingBottom",r)}}handleRowLines(){if("none"===this.node.attributes.get("rowlines"))return;const t=this.getRowAttributes("rowlines");let e=0;for(const s of this.childNodes.slice(1)){const i=t[e++];if("none"!==i)for(const t of this.adaptor.childNodes(s.dom[0]))this.adaptor.setStyle(t,"borderTop",".07em "+i)}}handleRowHeights(){this.node.attributes.get("equalrows")&&this.handleEqualRows()}handleEqualRows(){const t=this.getRowHalfSpacing(),{H:e,D:s,NH:i,ND:n}=this.getTableData(),r=this.getEqualRowHeight();for(let o=0;o<this.numRows;o++){const a=this.childNodes[o];this.setRowHeight(a,r+t[o]+t[o+1]+this.rLines[o]),r!==i[o]+n[o]&&this.setRowBaseline(a,r,(r-e[o]+s[o])/2)}}setRowHeight(t,e){this.adaptor.setStyle(t.dom[0],"height",this.em(e))}setRowBaseline(t,e,s){const i=t.node.attributes.get("rowalign");for(const n of t.childNodes)if(this.setCellBaseline(n,i,e,s))break}setCellBaseline(t,e,s,i){const n=t.node.attributes.get("rowalign");if("baseline"===n||"axis"===n){const n=this.adaptor,r=n.lastChild(t.dom[0]);n.setStyle(r,"height",this.em(s)),n.setStyle(r,"verticalAlign",this.em(-i));const o=t.parent;if(!(o.node.isKind("mlabeledtr")&&t===o.childNodes[0]||"baseline"!==e&&"axis"!==e))return!0}return!1}handleFrame(){if(this.frame&&this.fLine){const t=this.node.attributes.get("frame");this.adaptor.setStyle(this.itable,"border",`${this.em(this.fLine)} ${t}`)}}handleWidth(){const t=this.adaptor,e=this.dom[0],{w:s,L:i,R:n}=this.getBBox();t.setStyle(e,"minWidth",this.em(i+s+n));let r=this.node.attributes.get("width");if(nn(r))t.setStyle(e,"width",""),t.setAttribute(e,"width","full");else if(!this.hasLabels){if("auto"===r)return;r=this.em(this.length2em(r)+2*this.fLine)}const o=t.firstChild(e);if(t.setStyle(o,"width",r),t.setStyle(o,"minWidth",this.em(s)),i||n){t.setStyle(e,"margin","");const s=this.node.attributes.get("data-width-includes-label")?"padding":"margin";i===n?t.setStyle(o,s,"0 "+this.em(n)):t.setStyle(o,s,"0 "+this.em(n)+" 0 "+this.em(i))}t.setAttribute(this.itable,"width","full")}handleAlign(){const[t,e]=this.getAlignmentRow(),s=this.dom[0];if(null===e)"axis"!==t&&this.adaptor.setAttribute(s,"align",t);else{const i=this.getVerticalPosition(e,t);this.adaptor.setAttribute(s,"align","top"),this.adaptor.setStyle(s,"verticalAlign",this.em(i))}}handleJustify(){const t=this.getAlignShift()[0];"center"!==t&&this.adaptor.setAttribute(this.dom[0],"justify",t)}handleLabels(){if(!this.hasLabels)return;const t=this.labels,e=this.node.attributes,s=this.adaptor,i=e.get("side");s.setAttribute(this.dom[0],"side",i),s.setAttribute(t,"align",i),s.setStyle(t,i,"0");const[n,r]=this.addLabelPadding(i);if(r){const t=s.firstChild(this.dom[0]);this.setIndent(t,n,r)}this.updateRowHeights(),this.addLabelSpacing()}addLabelPadding(t){const[,e,s]=this.getPadAlignShift(t),i={};if("right"===t&&!this.node.attributes.get("data-width-includes-label")){const t=this.node.attributes.get("width"),{w:e,L:s,R:n}=this.getBBox();i.style={width:nn(t)?"calc("+t+" + "+this.em(s+n)+")":this.em(s+e+n)}}return this.adaptor.append(this.dom[0],this.html("mjx-labels",i,[this.labels])),[e,s]}updateRowHeights(){const{H:t,D:e,NH:s,ND:i}=this.getTableData(),n=this.getRowHalfSpacing();for(let r=0;r<this.numRows;r++){const o=this.childNodes[r];this.setRowHeight(o,t[r]+e[r]+n[r]+n[r+1]+this.rLines[r]),t[r]!==s[r]||e[r]!==i[r]?this.setRowBaseline(o,t[r]+e[r],e[r]):o.node.isKind("mlabeledtr")&&this.setCellBaseline(o.childNodes[0],"",t[r]+e[r],e[r])}}addLabelSpacing(){const t=this.adaptor,e=this.node.attributes.get("equalrows"),{H:s,D:i}=this.getTableData(),n=e?this.getEqualRowHeight():0,r=this.getRowHalfSpacing();let o=this.fLine,a=t.firstChild(this.labels);for(let l=0;l<this.numRows;l++){this.childNodes[l].node.isKind("mlabeledtr")?(o&&t.insert(this.html("mjx-mtr",{style:{height:this.em(o)}}),a),t.setStyle(a,"height",this.em((e?n:s[l]+i[l])+r[l]+r[l+1])),a=t.next(a),o=this.rLines[l]):o+=r[l]+(e?n:s[l]+i[l])+r[l+1]+this.rLines[l]}}},t.kind=Dn.prototype.kind,t.styles={"mjx-mtable":{"vertical-align":".25em","text-align":"center",position:"relative","box-sizing":"border-box","border-spacing":0,"border-collapse":"collapse"},'mjx-mstyle[size="s"] mjx-mtable':{"vertical-align":".354em"},"mjx-labels":{position:"absolute",left:0,top:0},"mjx-table":{display:"inline-block","vertical-align":"-.5ex","box-sizing":"border-box"},"mjx-table > mjx-itable":{"vertical-align":"middle","text-align":"left","box-sizing":"border-box"},"mjx-labels > mjx-itable":{position:"absolute",top:0},'mjx-mtable[justify="left"]':{"text-align":"left"},'mjx-mtable[justify="right"]':{"text-align":"right"},'mjx-mtable[justify="left"][side="left"]':{"padding-right":"0 ! important"},'mjx-mtable[justify="left"][side="right"]':{"padding-left":"0 ! important"},'mjx-mtable[justify="right"][side="left"]':{"padding-right":"0 ! important"},'mjx-mtable[justify="right"][side="right"]':{"padding-left":"0 ! important"},"mjx-mtable[align]":{"vertical-align":"baseline"},'mjx-mtable[align="top"] > mjx-table':{"vertical-align":"top"},'mjx-mtable[align="bottom"] > mjx-table':{"vertical-align":"bottom"},'mjx-mtable[side="right"] mjx-labels':{"min-width":"100%"}},t}();function ul(t){return class extends t{get numCells(){return this.childNodes.length}get labeled(){return!1}get tableCells(){return this.childNodes}getChild(t){return this.childNodes[t]}getChildBBoxes(){return this.childNodes.map(t=>t.getBBox())}stretchChildren(t=null){const e=[],s=this.labeled?this.childNodes.slice(1):this.childNodes;for(const t of s){const s=t.childNodes[0];s.canStretch(po.Vertical)&&e.push(s)}const i=e.length,n=this.childNodes.length;if(i&&n>1&&!t){let e=0,r=0;const o=i>1&&i===n;for(const t of s){const s=t.childNodes[0],i=s.stretch.dir===po.None;if(o||i){const{h:t,d:n}=s.getBBox(i);t>e&&(e=t),n>r&&(r=n)}}t=[e,r]}if(t)for(const s of e){const e=s.coreRScale();s.coreMO().getStretchedVariant(t.map(t=>t*e))}}get fixesPWidth(){return!1}}}function pl(t){return class extends t{get numCells(){return Math.max(0,this.childNodes.length-1)}get labeled(){return!0}get tableCells(){return this.childNodes.slice(1)}getChild(t){return this.childNodes[t+1]}getChildBBoxes(){return this.childNodes.slice(1).map(t=>t.getBBox())}}}const ml=function(){var t;const e=ul(Po);return(t=class extends e{toCHTML(t){super.toCHTML(t);const e=this.node.attributes.get("rowalign");"baseline"!==e&&this.adaptor.setAttribute(this.dom[0],"rowalign",e);const{h:s,d:i}=this.getBBox();this.adaptor.setStyle(this.dom[0],"height",this.em(s+i))}}).kind=kn.prototype.kind,t.styles={"mjx-mtr":{display:"table-row"},'mjx-mtr[rowalign="top"] > mjx-mtd':{"vertical-align":"top"},'mjx-mtr[rowalign="center"] > mjx-mtd':{"vertical-align":"middle"},'mjx-mtr[rowalign="bottom"] > mjx-mtd':{"vertical-align":"bottom"},'mjx-mtr[rowalign="baseline"] > mjx-mtd':{"vertical-align":"baseline"},'mjx-mtr[rowalign="axis"] > mjx-mtd':{"vertical-align":".25em"}},t}(),fl=function(){var t;const e=pl(ml);return(t=class extends e{toCHTML(t){super.toCHTML(t);const e=this.adaptor.firstChild(this.dom[0]);if(e){this.adaptor.remove(e);const t=this.node.attributes.get("rowalign"),s="baseline"!==t&&"axis"!==t?{rowalign:t}:{},i=this.html("mjx-mtr",s,[e]);this.adaptor.append(this.parent.labels,i)}}markUsed(){super.markUsed(),this.jax.wrapperUsage.add(ml.kind)}}).kind=Pn.prototype.kind,t.styles={"mjx-mlabeledtr":{display:"table-row"},'mjx-mlabeledtr[rowalign="top"] > mjx-mtd':{"vertical-align":"top"},'mjx-mlabeledtr[rowalign="center"] > mjx-mtd':{"vertical-align":"middle"},'mjx-mlabeledtr[rowalign="bottom"] > mjx-mtd':{"vertical-align":"bottom"},'mjx-mlabeledtr[rowalign="baseline"] > mjx-mtd':{"vertical-align":"baseline"},'mjx-mlabeledtr[rowalign="axis"] > mjx-mtd':{"vertical-align":".25em"}},t}();function gl(t){return class extends t{get fixesPWidth(){return!1}invalidateBBox(){this.bboxComputed=!1,this.lineBBox=[]}getWrapWidth(t){const e=this.parent.parent,s=this.parent,i=this.node.childPosition()-(s.labeled?1:0);return"number"==typeof e.cWidths[i]?e.cWidths[i]:e.getTableData().W[i]}getChildAlign(t){return this.node.attributes.get("columnalign")}}}const bl=function(){var t;const e=gl(Po);return(t=class extends e{toCHTML(t){super.toCHTML(t);const e=this.node.attributes.get("rowalign"),s=this.node.attributes.get("columnalign");e!==this.parent.node.attributes.get("rowalign")&&this.adaptor.setAttribute(this.dom[0],"rowalign",e),"center"===s||"mlabeledtr"===this.parent.kind&&this===this.parent.childNodes[0]&&s===this.parent.parent.node.attributes.get("side")||this.adaptor.setStyle(this.dom[0],"textAlign",s),this.parent.parent.node.getProperty("useHeight")&&this.adaptor.append(this.dom[0],this.html("mjx-tstrut"))}}).kind=Bn.prototype.kind,t.styles={"mjx-mtd":{display:"table-cell","text-align":"center",padding:".215em .4em"},"mjx-mtd:first-child":{"padding-left":0},"mjx-mtd:last-child":{"padding-right":0},"mjx-mtable > * > mjx-itable > *:first-child > mjx-mtd":{"padding-top":0},"mjx-mtable > * > mjx-itable > *:last-child > mjx-mtd":{"padding-bottom":0},"mjx-tstrut":{display:"inline-block",height:"1em","vertical-align":"-.25em"},'mjx-labels[align="left"] > mjx-mtr > mjx-mtd':{"text-align":"left"},'mjx-labels[align="right"] > mjx-mtr > mjx-mtd':{"text-align":"right"},"mjx-mtd[extra]":{padding:0},'mjx-mtd[rowalign="top"]':{"vertical-align":"top"},'mjx-mtd[rowalign="center"]':{"vertical-align":"middle"},'mjx-mtd[rowalign="bottom"]':{"vertical-align":"bottom"},'mjx-mtd[rowalign="baseline"]':{"vertical-align":"baseline"},'mjx-mtd[rowalign="axis"]':{"vertical-align":".25em"}},t}(),El={dx:".2em",dy:".1em",postDelay:600,clearDelay:100,hoverTimer:new Map,clearTimer:new Map,stopTimers:(t,e)=>{e.clearTimer.has(t)&&(clearTimeout(e.clearTimer.get(t)),e.clearTimer.delete(t)),e.hoverTimer.has(t)&&(clearTimeout(e.hoverTimer.get(t)),e.hoverTimer.delete(t))}};function xl(t){return class extends t{get selected(){const t=this.node.attributes.get("selection"),e=Math.max(1,Math.min(this.childNodes.length,t))-1;return this.childNodes[e]||this.wrap(this.node.selected)}getParameters(){const t=this.node.attributes.get("data-offsets"),[e,s]=rn(t||"");this.tipDx=this.length2em(e||El.dx),this.tipDy=this.length2em(s||El.dy)}constructor(t,e,s=null){super(t,e,s);const i=this.constructor.actions,n=this.node.attributes.get("actiontype"),[r,o]=i.get(n)||[(t,e)=>{},{}];this.action=r,this.data=o,this.getParameters()}computeBBox(t,e=!1){t.updateFrom(this.selected.getOuterBBox()),this.selected.setChildPWidths(e)}get breakCount(){return this.node.isEmbellished?this.selected.coreMO().embellishedBreakCount:this.selected.breakCount}computeLineBBox(t){return this.getChildLineBBox(this.selected,t)}}}const yl=function(){var t;const e=xl(Po);return(t=class extends e{setEventHandler(t,e,s=null){(s?[s]:this.dom).forEach(s=>s.addEventListener(t,e))}Em(t){return this.em(t)}toCHTML(t){if(this.toEmbellishedCHTML(t))return;const e=this.standardChtmlNodes(t);this.selected.toCHTML(e),this.action(this,this.data)}}).kind=vn.prototype.kind,t.styles={"mjx-maction":{position:"relative"},"mjx-maction > mjx-tool":{display:"none",position:"absolute",bottom:0,right:0,width:0,height:0,"z-index":500},"mjx-tool > mjx-tip":{display:"inline-block","line-height":0,padding:".2em",border:"1px solid #888","background-color":"#F8F8F8",color:"black","box-shadow":"2px 2px 5px #AAAAAA"},"mjx-maction[toggle]":{cursor:"pointer"},"mjx-status":{display:"block",position:"fixed",left:"1em",bottom:"1em","min-width":"25%",padding:".2em .4em",border:"1px solid #888","font-size":"90%","background-color":"#F8F8F8",color:"black"},"mjx-container [data-mjx-collapsed]":{color:"#55F"},"@media (prefers-color-scheme: dark) /* chtml maction */":{"mjx-tool > mjx-tip":{border:"1px solid #888","background-color":"#303030",color:"#E0E0E0","box-shadow":"2px 2px 5px #000"},"mjx-status":{"background-color":"#303030",color:"#E0E0E0"},"mjx-container [data-mjx-collapsed]":{color:"#88F"}}},t.actions=new Map([["toggle",[(t,e)=>{t.dom.forEach(e=>{t.adaptor.setAttribute(e,"toggle",t.node.attributes.get("selection"))});const s=t.factory.jax.math,i=t.factory.jax.document,n=t.node;t.setEventHandler("click",t=>{s.end.node||(s.start.node=s.end.node=s.typesetRoot,s.start.n=s.end.n=0),n.nextToggleSelection(),s.rerender(i,n.attributes.get("data-maction-id")?vi.ENRICHED:vi.RERENDER),t.stopPropagation()})},{}]],["tooltip",[(t,e)=>{const s=t.childNodes[1];if(s)if(s.node.isKind("mtext")){const e=s.node.getText();t.dom.forEach(s=>t.adaptor.setAttribute(s,"title",e))}else{const i=t.adaptor;for(const n of t.dom){const r=i.append(n,t.html("mjx-tool",{style:{bottom:t.Em(-t.tipDy),right:t.Em(-t.tipDx)}},[t.html("mjx-tip")]));s.toCHTML([i.firstChild(r)]),t.setEventHandler("mouseover",t=>{e.stopTimers(n,e);const s=setTimeout(()=>i.setStyle(r,"display","block"),e.postDelay);e.hoverTimer.set(n,s),t.stopPropagation()},n),t.setEventHandler("mouseout",t=>{e.stopTimers(n,e);const s=setTimeout(()=>i.setStyle(r,"display",""),e.clearDelay);e.clearTimer.set(n,s),t.stopPropagation()},n)}}},El]],["statusline",[(t,e)=>{const s=t.childNodes[1];if(s&&s.node.isKind("mtext")){const i=t.adaptor,n=s.node.getText();t.dom.forEach(t=>i.setAttribute(t,"statusline",n)),t.setEventHandler("mouseover",s=>{if(null===e.status){const s=i.body(i.document);e.status=i.append(s,t.html("mjx-status",{},[t.text(n)]))}s.stopPropagation()}),t.setEventHandler("mouseout",t=>{e.status&&(i.remove(e.status),e.status=null),t.stopPropagation()})}},{status:null}]]]),t}();function Nl(t){return class extends t{constructor(t,e,s=null){super(t,e,s),this.getParameters()}getParameters(){const{width:t,height:e,valign:s,src:i,index:n}=this.node.attributes.getList("width","height","valign","src","index");if(i)this.width="auto"===t?1:this.length2em(t),this.height="auto"===e?1:this.length2em(e),this.valign=this.length2em(s||"0");else{const t=String.fromCodePoint(parseInt(n)),e=this.node.factory;this.charWrapper=this.wrap(e.create("text").setText(t)),this.charWrapper.parent=this}}computeBBox(t,e=!1){this.charWrapper?t.updateFrom(this.charWrapper.getBBox()):(t.w=this.width,t.h=this.height+this.valign,t.d=-this.valign)}}}const Tl=function(){var t;const e=Nl(Po);return(t=class extends e{toCHTML(t){const e=this.standardChtmlNodes(t);if(this.charWrapper)return void this.charWrapper.toCHTML(e);const{src:s,alt:i}=this.node.attributes.getList("src","alt"),n={width:this.em(this.width),height:this.em(this.height)};this.valign&&(n.verticalAlign=this.em(this.valign));const r=this.html("img",{src:s,style:n,alt:i,title:i});this.adaptor.append(e[0],r)}}).kind=Fn.prototype.kind,t.styles={"mjx-mglyph > img":{display:"inline-block",border:0,padding:0}},t}();function vl(t){return class extends t{computeBBox(t,e=!1){if(this.childNodes.length){const{w:e,h:s,d:i}=this.childNodes[0].getBBox();t.w=e,t.h=s,t.d=i}}get breakCount(){return this.node.isEmbellished?this.coreMO().embellishedBreakCount:this.childNodes[0].breakCount}}}function Ll(t){class e extends t{constructor(t,e,s=null){super(t,e,s),this.rscale=this.getRScale()}computeBBox(t,e=!1){const s=this.node.getXML(),i=this.getHDW(s,"use","force"),{h:n,d:r,w:o}=i?this.splitHDW(i):this.measureXmlNode(s);t.w=o,t.h=n,t.d=r}getHTML(){let t=this.adaptor.clone(this.node.getXML());const e=this.getFontStyles();return(this.getHDW(t,"force")||1!==this.jax.options.scale)&&(t=this.addHDW(t,e)),this.html("mjx-html",{variant:this.parent.variant,style:e},[t])}getHDW(t,e,s=e){const i=this.jax.options.htmlHDW,n=this.adaptor.getAttribute(t,"data-mjx-hdw");return!n||i!==e&&i!==s?null:n}splitHDW(t){const e=1/this.metrics.scale,[s,i,n]=rn(t).map(t=>this.length2em(t||"0")*e);return{h:s,d:i,w:n}}getFontStyles(){var t;const e=this.adaptor,s=this.metrics;return{"font-family":(null===(t=this.parent.styles)||void 0===t?void 0:t.get("font-family"))||s.family||e.fontFamily(e.parent(this.jax.math.start.node))||"initial","font-size":this.jax.fixed(s.em*this.rscale)+"px"}}measureXmlNode(t){const e=this.adaptor,s=this.html("mjx-xml-block",{style:{display:"inline-block"}},[e.clone(t)]),i=this.html("mjx-baseline",{style:{display:"inline-block",width:0,height:0}}),n=this.getFontStyles(),r=this.html("mjx-measure-xml",{style:n},[i,s]),o=this.jax.container;e.append(e.parent(this.jax.math.start.node),o),e.append(o,r);const a=this.metrics,l=a.em*a.scale*this.rscale,{left:h,right:c,bottom:d,top:u}=e.nodeBBox(s),p=(c-h)/l,m=(e.nodeBBox(i).top-u)/l,f=(d-u)/l-m;return e.remove(o),e.remove(r),{w:p,h:m,d:f}}getStyles(){}getScale(){}getVariant(){}}return e.autoStyle=!1,e.styles={"mjx-measure-xml":{position:"absolute",left:0,top:0,display:"inline-block","line-height":"normal","white-space":"normal"},"mjx-html":{display:"inline-block","line-height":"normal","text-align":"initial","white-space":"initial"},"mjx-html-holder":{display:"block",position:"absolute",top:0,left:0,bottom:0,right:0}},e}const Cl=function(){var t;const e=vl(Po);return(t=class extends e{toCHTML(t){if(this.toEmbellishedCHTML(t))return;const e=this.standardChtmlNodes(t);this.childNodes.length&&this.childNodes[0].toCHTML(e)}}).kind=Un.prototype.kind,t}(),Rl=function(){var t;return(t=class extends Po{toCHTML(t){super.toCHTML(t)}computeBBox(){return this.bbox}}).kind=Wn.prototype.kind,t}(),Il=function(){var t;return(t=class extends Po{}).kind=Hn.prototype.kind,t.styles={"mjx-annotation-xml":{"font-family":"initial","line-height":"normal"}},t}(),Sl=function(){var t;const e=Ll(Po);return(t=class extends e{toCHTML(t){this.markUsed(),this.dom=[this.adaptor.append(t[0],this.getHTML())]}addHDW(t,e){const s=this.jax.options.scale,{h:i,d:n,w:r}=this.bbox,o=s*this.metrics.scale;return e.width=this.em(r*o),e.height=this.em((i+n)*o),e["vertical-align"]=this.em(-n*o),e.position="relative",this.html("mjx-html-holder",{style:{transform:`scale(${this.jax.fixed(s)})`,"transform-origin":"top left"}},[t])}}).kind=Vi.prototype.kind,t}();function Al(t){return class extends t{computeBBox(t,e=!1){super.computeBBox(t,e),this.childNodes[0]&&this.childNodes[0].bbox.ic&&(t.ic=this.childNodes[0].bbox.ic)}}}const wl=function(){var t;const e=Al(Po);return(t=class extends e{toCHTML(t){super.toCHTML(t),this.dom.forEach(t=>this.adaptor.setAttribute(t,"texclass",Mi[this.node.texClass]))}}).kind=Vn.prototype.kind,t}();function Ol(t){return class extends t{remappedText(t,e){const s=this.parent.stretch.c;return s?[s]:this.parent.remapChars(this.unicodeChars(t,e))}computeBBox(t,e=!1){const s=this.parent.variant,i=this.node.getText();if("-explicitFont"===s){const e=this.jax.getFontData(this.parent.styles),{w:n,h:r,d:o}=this.jax.measureText(i,s,e);t.h=r,t.d=o,t.w=n}else{const e=this.remappedText(i,s);let n="";t.empty();for(let i=0;i<e.length;i++){const[r,o,a,l]=this.getVariantChar(s,e[i]);if(l.unknown)n+=String.fromCodePoint(e[i]);else{if(n=this.addUtextBBox(t,n,s),this.updateBBox(t,r,o,a),t.ic=l.ic||0,t.sk=l.sk||0,t.dx=l.dx||0,!l.oc||i<e.length-1)continue;const h=this.parent.childNodes;if(this.node!==h[h.length-1].node)continue;const c=this.parent.parent.node;let d=c.isKind("mrow")||c.isInferred?c.childNodes[c.childIndex(this.parent.node)+1]:null;(null==d?void 0:d.isKind("mo"))&&"\u2062"===d.getText()&&(d=c.childNodes[c.childIndex(d)+1]),d&&d.attributes.get("mathvariant")===s?t.oc=l.oc:t.ic=l.oc}}this.addUtextBBox(t,n,s),e.length>1&&(t.sk=0),t.clean()}}addUtextBBox(t,e,s){if(e){const{h:i,d:n,w:r}=this.jax.measureText(e,s);this.updateBBox(t,i,n,r)}return""}updateBBox(t,e,s,i){t.w+=i,e>t.h&&(t.h=e),s>t.d&&(t.d=s)}getStyles(){}getVariant(){}getScale(){}getSpace(){}}}const Ml=function(){var t;const e=Ol(Po);return t=class extends e{toCHTML(t){this.markUsed();const e=t[0],s=this.adaptor,i=this.parent.variant,n=this.node.getText();if(0===n.length)return;const r=this.getBBox();if("-explicitFont"===i)s.append(e,this.jax.unknownText(n,i,r.w));else{let t="";const o=this.remappedText(n,i),a=o.length>1?this.em(this.parent.getBBox().h):"",l=o.length;for(let n=0;n<l;n++){const h=o[n],c=this.getVariantChar(i,h)[3];if(c.unknown)t+=String.fromCodePoint(h);else{t=this.addUtext(t,i,e);const o=c.ff||(c.f?`${this.font.cssFontPrefix}-${c.f}`:""),d=s.append(e,this.html("mjx-c",{class:this.char(h)+(o?" "+o:"")},[this.text(c.c||String.fromCodePoint(h))]));(n<l-1||r.oc)&&s.setAttribute(d,"noic","true"),a&&s.setStyle(d,"padding-top",a),this.font.charUsage.add([i,h])}}this.addUtext(t,i,e)}}addUtext(t,e,s){return t&&this.adaptor.append(s,this.jax.unknownText(t,e)),""}},t.kind=Wi.prototype.kind,t.autoStyle=!1,t.styles={"mjx-c":{display:"inline-block",width:0,"text-align":"right"},"mjx-utext":{display:"inline-block",padding:".75em 0 .2em 0"}},t}(),Dl=function(){var t;return(t=class extends Sl{}).kind=Xn.prototype.kind,t}(),kl={[jo.kind]:jo,[Pa.kind]:Pa,[Ba.kind]:Ba,[Fo.kind]:Fo,[qo.kind]:qo,[zo.kind]:zo,[Jo.kind]:Jo,[$o.kind]:$o,[Qo.kind]:Qo,[ta.kind]:ta,[Ma.kind]:Ma,[Ua.kind]:Ua,[Wa.kind]:Wa,[qa.kind]:qa,[$a.kind]:$a,[Ya.kind]:Ya,[Qa.kind]:Qa,[sl.kind]:sl,[il.kind]:il,[nl.kind]:nl,[ll.kind]:ll,[_a.kind]:_a,[dl.kind]:dl,[ml.kind]:ml,[fl.kind]:fl,[bl.kind]:bl,[yl.kind]:yl,[Tl.kind]:Tl,[Cl.kind]:Cl,[Rl.kind]:Rl,[Il.kind]:Il,[Sl.kind]:Sl,[wl.kind]:wl,[Ml.kind]:Ml,[Dl.kind]:Dl,[Po.kind]:Po};class Pl extends So{}Pl.defaultNodes=kl;const Bl="mathjax-newcm",jl=null;class _l extends Io{constructor(t={}){super(t,Pl,jl),this.chtmlStyles=null,this.font.adaptiveCSS(this.options.adaptiveCSS),this.wrapperUsage=new Uo}addExtension(t,e=""){const s=super.addExtension(t,e);return s.length&&this.options.adaptiveCSS&&this.chtmlStyles&&this.adaptor.insertRules(this.chtmlStyles,s),[]}escaped(t,e){return this.setDocument(e),this.html("span",{},[this.text(t.math)])}styleSheet(t){if(this.chtmlStyles){const t=new vr;return this.options.adaptiveCSS&&(this.addWrapperStyles(t),this.updateFontStyles(t)),t.addStyles(this.font.updateDynamicStyles()),this.adaptor.insertRules(this.chtmlStyles,t.getStyleRules()),this.chtmlStyles}const e=this.chtmlStyles=super.styleSheet(t);return this.adaptor.setAttribute(e,"id",_l.STYLESHEETID),this.wrapperUsage.update(),e}updateFontStyles(t){t.addStyles(this.font.updateStyles({}))}addWrapperStyles(t){if(this.options.adaptiveCSS)for(const e of this.wrapperUsage.update()){const s=this.factory.getNodeClass(e);s&&this.addClassStyles(s,t)}else super.addWrapperStyles(t)}addClassStyles(t,e){const s=t;s.autoStyle&&"unknown"!==s.kind&&e.addStyles({["mjx-"+s.kind]:{display:"inline-block","text-align":"left"}}),this.wrapperUsage.add(s.kind),super.addClassStyles(t,e)}insertStyles(t){this.chtmlStyles&&this.adaptor.insertRules(this.chtmlStyles,new vr(t).getStyleRules())}processMath(t,e){t.toCHTML([e])}clearCache(){this.styleJson.clear(),this.font.clearCache(),this.wrapperUsage.clear(),this.chtmlStyles=null}reset(){this.clearCache()}unknownText(t,e,s=null){const i={},n=100/this.math.metrics.scale;if(100!==n&&(i["font-size"]=this.fixed(n,1)+"%",i.padding=Pr(75/n)+" 0 "+Pr(20/n)+" 0"),"-explicitFont"!==e){const s=en(t);(1!==s.length||s[0]<119808||s[0]>120831)&&this.cssFontStyles(this.font.getCssFont(e),i)}return null!==s&&(i.width=this.fixed(s*this.math.metrics.scale)+"em"),this.html("mjx-utext",{variant:e,style:i},[this.text(t)])}measureTextNode(t){const e=this.adaptor,s=e.clone(t);e.setStyle(s,"font-family",e.getStyle(s,"font-family").replace(/MJXZERO, /g,""));const i=this.math.metrics.em,n={position:"absolute",top:0,left:0,"white-space":"nowrap","font-size":this.fixed(i,3)+"px"},r=this.html("mjx-measure-text",{style:n},[s]);e.append(e.parent(this.math.start.node),this.container),e.append(this.container,r);const o=e.nodeSize(s,i)[0];return e.remove(this.container),e.remove(r),{w:o,h:.75,d:.2}}}function Fl(t,e){const s={};for(const i of Object.keys(t)){const n=t[i];for(const t of Object.keys(n)){s[t]||(s[t]={});const r=n[t];if(i)for(const t of Object.keys(r)){const s=r[parseInt(t)];s[3]||(s[3]={}),e?s[3].ff=e+"-"+i:s[3].f=i}Object.assign(s[t],r)}}return s}function Ul(t,e,s,i=""){const n="https://cdn.jsdelivr.net"===(MathJax.config.loader?.paths?.fonts||"").substring(0,24)?"@%%VERSION%%":"",r=s.fontPath||`[fonts]/%%FONT%%-font${i}${n}`,o=t.match(/^[a-z]+:/)?(t.match(/[^/:\\]*$/)||[e])[0]:t;return Ls(MathJax.config.loader,"paths",{[o+i]:o===t?r.replace(/%%FONT%%/g,t).replace(/%%VERSION%%/g,gr.version):t}),`[${o}${i}]`}_l.NAME="CHTML",_l.OPTIONS=Object.assign(Object.assign({},Io.OPTIONS),{adaptiveCSS:!0,matchFontHeight:!0}),_l.commonStyles=Object.assign(Object.assign({},Io.commonStyles),{'mjx-container[jax="CHTML"]':{"white-space":"nowrap"},[["mjx-mo > mjx-c","mjx-mi > mjx-c","mjx-mn > mjx-c","mjx-ms > mjx-c","mjx-mtext > mjx-c"].join(", ")]:{"clip-path":"padding-box polygon("+["-1em -2px","calc(100% + 1em) -2px","calc(100% + 1em) calc(100% + 2px)","-1em calc(100% + 2px)"].join(", ")+")"},"mjx-stretchy-h":{"clip-path":"padding-box polygon(0 -2px, 100% -2px, 100% calc(100% + 2px), 0 calc(100% + 2px))"},"mjx-stretchy-v":{"clip-path":"padding-box polygon(-2px 0, calc(100% + 2px) 0, calc(100% + 2px) 100%, -2px 100%)"},'mjx-container [space="1"]':{"margin-left":".111em"},'mjx-container [space="2"]':{"margin-left":".167em"},'mjx-container [space="3"]':{"margin-left":".222em"},'mjx-container [space="4"]':{"margin-left":".278em"},'mjx-container [space="5"]':{"margin-left":".333em"},'mjx-container [rspace="1"]':{"margin-right":".111em"},'mjx-container [rspace="2"]':{"margin-right":".167em"},'mjx-container [rspace="3"]':{"margin-right":".222em"},'mjx-container [rspace="4"]':{"margin-right":".278em"},'mjx-container [rspace="5"]':{"margin-right":".333em"},'mjx-container [size="s"]':{"font-size":"70.7%"},'mjx-container [size="ss"]':{"font-size":"50%"},'mjx-container [size="Tn"]':{"font-size":"60%"},'mjx-container [size="sm"]':{"font-size":"85%"},'mjx-container [size="lg"]':{"font-size":"120%"},'mjx-container [size="Lg"]':{"font-size":"144%"},'mjx-container [size="LG"]':{"font-size":"173%"},'mjx-container [size="hg"]':{"font-size":"207%"},'mjx-container [size="HG"]':{"font-size":"249%"},'mjx-container [width="full"]':{width:"100%"},"mjx-box":{display:"inline-block"},"mjx-block":{display:"block"},"mjx-itable":{display:"inline-table"},"mjx-row":{display:"table-row"},[["cell","base","under","over","den"].map(t=>`mjx-row > mjx-${t}`).join(", ")]:{display:"table-cell"},"mjx-container [inline-breaks]":{display:"inline"},"mjx-container .mjx-selected":{outline:"2px solid black"},"@media (prefers-color-scheme: dark)":{"mjx-container .mjx-selected":{outline:"2px solid #C8C8C8"}},"mjx-mtext":{display:"inline-block"},"mjx-mstyle":{display:"inline-block"},"mjx-merror":{display:"inline-block",color:"red","background-color":"yellow"},"mjx-mphantom":{visibility:"hidden"}}),_l.STYLESHEETID="MJX-CHTML-styles",MathJax.loader&&MathJax.loader.checkVersion("output/chtml",xs,"output"),Cs({_:{output:{chtml_ts:Ke,chtml:{DefaultFont:Je,DynamicFonts:$e,FontData:Gt,Notation:le,Usage:zt,Wrapper:Ht,WrapperFactory:Ge,Wrappers_ts:ze,Wrappers:{HtmlNode:Xe,TeXAtom:We,TextNode:qe,maction:Pe,math:Vt,menclose:he,mfenced:pe,mfrac:fe,mglyph:je,mi:Xt,mmultiscripts:Ie,mn:Yt,mo:Kt,mpadded:re,mroot:xe,mrow:de,ms:Zt,mspace:ie,msqrt:be,msubsup:ve,mtable:Ae,mtd:De,mtext:ee,mtr:Oe,munderover:Ce,scriptbase:Te,semantics:Ue}},common_ts:_t,common:{Direction:kt,FontData:Pt,LineBBox:Bt,LinebreakVisitor:jt,Notation:oe,Wrapper:Ut,WrapperFactory:Ft,Wrappers:{TeXAtom:He,TextNode:Ve,XmlNode:Fe,maction:ke,math:Wt,menclose:ae,mfenced:ue,mfrac:me,mglyph:Be,mi:qt,mmultiscripts:Re,mn:$t,mo:Jt,mpadded:ne,mroot:Ee,mrow:ce,ms:Qt,mspace:se,msqrt:ge,msubsup:ye,mtable:Se,mtd:Me,mtext:te,mtr:we,munderover:Le,scriptbase:Ne,semantics:_e}}}}});const Hl={config(t,e,s,i){if(MathJax.loader){Ls(MathJax.config,t,MathJax.config.output||{});let e=MathJax.config[t],n=e.font||e.fontData||s;"string"!=typeof n&&(e.fontData=n,e.font=n=n.NAME),"["!==n.charAt(0)&&(n=Ul(n,t,e));const r=n.substring(1,n.length-1),o=function(t,e){const s=[];for(const i of e.fontExtensions||[]){const n=`${Ul(i,t,e,"-extension")}/${t}`;s.push(n)}return s}(t,e);if(o.length&&MathJax.loader.addPackageData(`${n}/${t}`,{extraLoads:o}),r===s&&i){const e=MathJax.config.loader[`${n}/${t}`]?.extraLoads;e&&MathJax.loader.addPackageData(`output/${t}`,{extraLoads:e}),Cs({_:{output:{fonts:{[r]:{[t+"_ts"]:{[i.NAME+"Font"]:i}}}}}}),Ls(MathJax,"config",{output:{font:n},[t]:{fontData:i,dynamicPrefix:`${n}/${t}/dynamic`}}),"chtml"===t&&Ls(MathJax.config,t,{fontURL:Os.resolvePath(`${n}/${t}/woff2`,!1)})}else MathJax.loader.addPackageData(`output/${t}`,{extraLoads:[`${n}/${t}`]})}MathJax.startup&&(MathJax.startup.registerConstructor(t,e),MathJax.startup.useOutput(t))},loadFont:(t,e,s,i)=>MathJax.loader?(i&&MathJax.loader.preLoaded(`[${s}]/${e}`),Os.loadPromise(`output/${e}`).then(t)):t};var Wl;Hl.config("chtml",_l,Bl,jl),function(t){t[t.RETURN=13]="RETURN",t[t.ESCAPE=27]="ESCAPE",t[t.SPACE=32]="SPACE",t[t.LEFT=37]="LEFT",t[t.UP=38]="UP",t[t.RIGHT=39]="RIGHT",t[t.DOWN=40]="DOWN"}(Wl||(Wl={}));const Vl="click",ql="dblclick",Xl="mousedown",zl="mouseup",Gl="mouseover",Jl="mouseout",Kl="selectstart";class $l{constructor(){this.bubble=!1}bubbleKey(){this.bubble=!0}keydown(t){switch(t.keyCode){case Wl.ESCAPE:this.escape(t);break;case Wl.RIGHT:this.right(t);break;case Wl.LEFT:this.left(t);break;case Wl.UP:this.up(t);break;case Wl.DOWN:this.down(t);break;case Wl.RETURN:case Wl.SPACE:this.space(t);break;default:return}this.bubble?this.bubble=!1:this.stop(t)}escape(t){}space(t){}left(t){}right(t){}up(t){}down(t){}stop(t){t&&(t.stopPropagation(),t.preventDefault(),t.cancelBubble=!0)}mousedown(t){return this.stop(t)}mouseup(t){return this.stop(t)}mouseover(t){return this.stop(t)}mouseout(t){return this.stop(t)}click(t){return this.stop(t)}addEvents(t){t.addEventListener(Xl,this.mousedown.bind(this)),t.addEventListener(zl,this.mouseup.bind(this)),t.addEventListener(Gl,this.mouseover.bind(this)),t.addEventListener(Jl,this.mouseout.bind(this)),t.addEventListener(Vl,this.click.bind(this)),t.addEventListener("keydown",this.keydown.bind(this)),t.addEventListener("dragstart",this.stop.bind(this)),t.addEventListener(Kl,this.stop.bind(this)),t.addEventListener("contextmenu",this.stop.bind(this)),t.addEventListener(ql,this.stop.bind(this))}}class Yl extends $l{addAttributes(t){for(const e in t)this.html.setAttribute(e,t[e])}get html(){return this._html||this.generateHtml(),this._html}set html(t){this._html=t,this.addEvents(t)}generateHtml(){const t=document.createElement("div");t.classList.add(this.className),t.setAttribute("role",this.role),this.html=t}focus(){const t=this.html;t.setAttribute("tabindex","0"),setTimeout(()=>t.focus(),50)}unfocus(){const t=this.html;t.hasAttribute("tabindex")&&t.setAttribute("tabindex","-1");try{t.blur()}catch(t){}t.blur()}}class Ql extends Yl{constructor(){super(...arguments),this.posted=!1}isPosted(){return this.posted}post(t,e){this.posted||(void 0!==t&&void 0!==e&&this.html.setAttribute("style","left: "+t+"px; top: "+e+"px;"),this.display(),this.posted=!0)}unpost(){if(!this.posted)return;const t=this.html;t.parentNode&&t.parentNode.removeChild(t),this.posted=!1}}function Zl(t){return"CtxtMenu_"+t}function th(t){return Zl(t)}function eh(t){return Zl(t)}const sh={ATTACHED:th("Attached"),CONTEXTMENU:th("ContextMenu"),MENU:th("Menu"),MENUARROW:th("MenuArrow"),MENUACTIVE:th("MenuActive"),MENUCHECK:th("MenuCheck"),MENUCLOSE:th("MenuClose"),MENUCOMBOBOX:th("MenuComboBox"),MENUDISABLED:th("MenuDisabled"),MENUFRAME:th("MenuFrame"),MENUITEM:th("MenuItem"),MENULABEL:th("MenuLabel"),MENURADIOCHECK:th("MenuRadioCheck"),MENUINPUTBOX:th("MenuInputBox"),MENURULE:th("MenuRule"),MENUSLIDER:th("MenuSlider"),MOUSEPOST:th("MousePost"),RTL:th("RTL"),INFO:th("Info"),INFOCLOSE:th("InfoClose"),INFOCONTENT:th("InfoContent"),INFOSIGNATURE:th("InfoSignature"),INFOTITLE:th("InfoTitle"),SLIDERVALUE:th("SliderValue"),SLIDERBAR:th("SliderBar"),SELECTION:th("Selection"),SELECTIONBOX:th("SelectionBox"),SELECTIONMENU:th("SelectionMenu"),SELECTIONDIVIDER:th("SelectionDivider"),SELECTIONITEM:th("SelectionItem")},ih={COUNTER:eh("Counter"),KEYDOWNFUNC:eh("keydownFunc"),CONTEXTMENUFUNC:eh("contextmenuFunc"),OLDTAB:eh("Oldtabindex"),TOUCHFUNC:eh("TouchFunc")};class nh extends Yl{constructor(t,e){super(),this._menu=t,this._type=e,this.className=sh.MENUITEM,this.role="menuitem",this.hidden=!1}get menu(){return this._menu}set menu(t){this._menu=t}get type(){return this._type}hide(){this.hidden=!0,this.menu.generateMenu()}show(){this.hidden=!1,this.menu.generateMenu()}isHidden(){return this.hidden}}function rh(t){const e=t.menu;e.baseMenu?e.baseMenu.unpost():e.unpost()}function oh(t){const e=t.menu;return(e.baseMenu?e.baseMenu:e).store.active}function ah(t,e){console.error("ContextMenu Error: "+e)}function lh(){return hh++}let hh=0;class ch extends nh{constructor(t,e,s,i){super(t,e),this._content=s,this.disabled=!1,this.callbacks=[],this._id=i||s}get content(){return this._content}set content(t){this._content=t,this.generateHtml(),this.menu&&this.menu.generateHtml()}get id(){return this._id}press(){this.disabled||(this.executeAction(),this.executeCallbacks_())}executeAction(){}registerCallback(t){-1===this.callbacks.indexOf(t)&&this.callbacks.push(t)}unregisterCallback(t){const e=this.callbacks.indexOf(t);-1!==e&&this.callbacks.splice(e,1)}mousedown(t){this.press(),this.stop(t)}mouseover(t){this.focus(),this.stop(t)}mouseout(t){this.deactivate(),this.stop(t)}generateHtml(){super.generateHtml();const t=this.html;t.setAttribute("aria-disabled","false"),t.textContent=this.content}activate(){this.disabled||this.html.classList.add(sh.MENUACTIVE)}deactivate(){this.html.classList.remove(sh.MENUACTIVE)}focus(){this.menu.focused=this,super.focus(),this.activate()}unfocus(){this.deactivate(),super.unfocus()}escape(t){rh(this)}up(t){this.menu.up(t)}down(t){this.menu.down(t)}left(t){this.menu.left(t)}right(t){this.menu.right(t)}space(t){this.press()}disable(){this.disabled=!0;const t=this.html;t.classList.add(sh.MENUDISABLED),t.setAttribute("aria-disabled","true")}enable(){this.disabled=!1;const t=this.html;t.classList.remove(sh.MENUDISABLED),t.removeAttribute("aria-disabled")}executeCallbacks_(){for(const t of this.callbacks)try{t(this)}catch(t){ah(0,"Callback for menu entry "+this.id+" failed.")}}}class dh extends ch{static fromJson(t,{content:e,menu:s,id:i},n){const r=new this(n,e,i),o=t.get("subMenu")(t,s,r);return r.submenu=o,r}constructor(t,e,s){super(t,"submenu",e,s),this._submenu=null}set submenu(t){this._submenu=t}get submenu(){return this._submenu}mouseover(t){this.focus(),this.stop(t)}mouseout(t){this.stop(t)}unfocus(){if(this.submenu.isPosted()){if(this.menu.focused!==this)return super.unfocus(),void this.menu.unpostSubmenus();this.html.setAttribute("tabindex","-1"),this.html.blur()}else super.unfocus()}focus(){super.focus(),this.submenu.isPosted()||this.disabled||this.submenu.post()}executeAction(){this.submenu.isPosted()?this.submenu.unpost():this.submenu.post()}generateHtml(){super.generateHtml();const t=this.html;this.span=document.createElement("span"),this.span.textContent="\u25ba",this.span.classList.add(sh.MENUARROW),this.span.setAttribute("aria-hidden","true"),t.appendChild(this.span),t.setAttribute("aria-haspopup","true")}left(t){this.submenu.isPosted()?this.submenu.unpost():super.left(t)}right(t){this.submenu.isPosted()?this.submenu.down(t):this.submenu.post()}toJson(){return{type:""}}}class uh extends Ql{constructor(){super(...arguments),this.className=sh.CONTEXTMENU,this.role="menu",this._items=[],this._baseMenu=null}set baseMenu(t){this._baseMenu=t}get baseMenu(){return this._baseMenu}get items(){return this._items}set items(t){this._items=t}get pool(){return this.variablePool}get focused(){return this._focused}set focused(t){if(this._focused===t)return;this._focused||this.unfocus();const e=this._focused;this._focused=t,e&&e.unfocus()}up(t){const e=this.items.filter(t=>t instanceof ch&&!t.isHidden());if(0===e.length)return;if(!this.focused)return void e[e.length-1].focus();let s=e.indexOf(this.focused);-1!==s&&(s=s?--s:e.length-1,e[s].focus())}down(t){const e=this.items.filter(t=>t instanceof ch&&!t.isHidden());if(0===e.length)return;if(!this.focused)return void e[0].focus();let s=e.indexOf(this.focused);-1!==s&&(s++,s=s===e.length?0:s,e[s].focus())}generateHtml(){super.generateHtml(),this.generateMenu()}generateMenu(){const t=this.html;t.classList.add(sh.MENU);for(const e of this.items){if(!e.isHidden()){t.appendChild(e.html);continue}const s=e.html;s.parentNode&&s.parentNode.removeChild(s)}}post(t,e){this.variablePool.update(),super.post(t,e)}unpostSubmenus(){const t=this.items.filter(t=>t instanceof dh);for(const e of t)e.submenu.unpost(),e!==this.focused&&e.unfocus()}unpost(){super.unpost(),this.unpostSubmenus(),this.focused=null}find(t){for(const e of this.items)if("rule"!==e.type){if(e.id===t)return e;if("submenu"===e.type){const s=e.submenu.find(t);if(s)return s}}return null}}class ph{constructor(t){this.menu=t,this.store=[],this._active=null,this.counter=0,this.attachedClass=sh.ATTACHED+"_"+lh(),this.taborder=!0,this.attrMap={}}set active(t){do{if(-1!==this.store.indexOf(t)){this._active=t;break}t=t.parentNode}while(t)}get active(){return this._active}next(){const t=this.store.length;if(0===t)return this.active=null,null;let e=this.store.indexOf(this.active);return e=-1===e?0:e<t-1?e+1:0,this.active=this.store[e],this.active}previous(){const t=this.store.length;if(0===t)return this.active=null,null;const e=t-1;let s=this.store.indexOf(this.active);return s=-1===s||0===s?e:s-1,this.active=this.store[s],this.active}clear(){this.remove(this.store)}insert(t){const e=t instanceof HTMLElement?[t]:t;for(const t of e)this.insertElement(t);this.sort()}remove(t){const e=t instanceof HTMLElement?[t]:t;for(const t of e)this.removeElement(t);this.sort()}inTaborder(t){this.taborder&&!t&&this.removeTaborder(),!this.taborder&&t&&this.insertTaborder(),this.taborder=t}insertTaborder(){this.taborder&&this.insertTaborder_()}removeTaborder(){this.taborder&&this.removeTaborder_()}insertElement(t){t.classList.contains(this.attachedClass)||(t.classList.add(this.attachedClass),this.taborder&&this.addTabindex(t),this.addEvents(t))}removeElement(t){t.classList.contains(this.attachedClass)&&(t.classList.remove(this.attachedClass),this.taborder&&this.removeTabindex(t),this.removeEvents(t))}sort(){const t=document.getElementsByClassName(this.attachedClass);this.store=[].slice.call(t)}insertTaborder_(){this.store.forEach(t=>t.setAttribute("tabindex","0"))}removeTaborder_(){this.store.forEach(t=>t.setAttribute("tabindex","-1"))}addTabindex(t){t.hasAttribute("tabindex")&&t.setAttribute(ih.OLDTAB,t.getAttribute("tabindex")),t.setAttribute("tabindex","0")}removeTabindex(t){t.hasAttribute(ih.OLDTAB)?(t.setAttribute("tabindex",t.getAttribute(ih.OLDTAB)),t.removeAttribute(ih.OLDTAB)):t.removeAttribute("tabindex")}addEvents(t){t.hasAttribute(ih.COUNTER)||(this.addEvent(t,"contextmenu",this.menu.post.bind(this.menu)),this.addEvent(t,"keydown",this.keydown.bind(this)),t.setAttribute(ih.COUNTER,this.counter.toString()),this.counter++)}addEvent(t,e,s){const i=ih[e.toUpperCase()+"FUNC"];this.attrMap[i+this.counter]=s,t.addEventListener(e,s)}removeEvents(t){if(!t.hasAttribute(ih.COUNTER))return;const e=t.getAttribute(ih.COUNTER);this.removeEvent(t,"contextmenu",e),this.removeEvent(t,"keydown",e),t.removeAttribute(ih.COUNTER)}removeEvent(t,e,s){const i=ih[e.toUpperCase()+"FUNC"],n=this.attrMap[i+s];t.removeEventListener(e,n)}keydown(t){t.keyCode===Wl.SPACE&&(this.menu.post(t),t.preventDefault(),t.stopImmediatePropagation())}}class mh{constructor(){this.pool={}}insert(t){this.pool[t.name]=t}lookup(t){return this.pool[t]}remove(t){delete this.pool[t]}update(){for(const t in this.pool)this.pool[t].update()}}class fh extends uh{static fromJson(t,{pool:e,items:s,id:i=""}){const n=new this(t);n.id=i;const r=t.get("variable");e.forEach(e=>r(t,e,n.pool));const o=t.get("items")(t,s,n);return n.items=o,n}constructor(t){super(),this.factory=t,this.id="",this.moving=!1,this._store=new ph(this),this.widgets=[],this.variablePool=new mh}generateHtml(){this.isPosted()&&this.unpost(),super.generateHtml(),this._frame=document.createElement("div"),this._frame.classList.add(sh.MENUFRAME);const t="left: 0px; top: 0px; z-index: 200; width: 100%; height: 100%; border: 0px; padding: 0px; margin: 0px;";this._frame.setAttribute("style","position: absolute; "+t);const e=document.createElement("div");e.setAttribute("style","position: fixed; "+t),this._frame.appendChild(e),e.addEventListener("mousedown",function(t){this.unpost(),this.unpostWidgets(),this.stop(t)}.bind(this))}display(){document.body.appendChild(this.frame),this.frame.appendChild(this.html),this.focus()}escape(t){this.unpost(),this.unpostWidgets()}unpost(){if(super.unpost(),this.widgets.length>0)return;this.frame.parentNode.removeChild(this.frame);const t=this.store;this.moving||t.insertTaborder(),t.active.focus()}left(t){this.move_(this.store.previous())}right(t){this.move_(this.store.next())}get frame(){return this._frame}get store(){return this._store}post(t,e){if(void 0!==e)return this.moving||this.store.removeTaborder(),void super.post(t,e);const s=t;let i,n,r;if(s instanceof Event?(i=s.target,this.stop(s)):i=s,s instanceof MouseEvent&&(n=s.pageX,r=s.pageY,n||r||!s.clientX||(n=s.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,r=s.clientY+document.body.scrollTop+document.documentElement.scrollTop)),!n&&!r&&i){const t=window.pageXOffset||document.documentElement.scrollLeft,e=window.pageYOffset||document.documentElement.scrollTop,s=i.getBoundingClientRect();n=(s.right+s.left)/2+t,r=(s.bottom+s.top)/2+e}this.store.active=i,this.anchor=this.store.active;const o=this.html;n+o.offsetWidth>document.body.offsetWidth-5&&(n=document.body.offsetWidth-o.offsetWidth-5),this.post(n,r)}registerWidget(t){this.widgets.push(t)}unregisterWidget(t){const e=this.widgets.indexOf(t);e>-1&&this.widgets.splice(e,1),0===this.widgets.length&&this.unpost()}unpostWidgets(){this.widgets.forEach(t=>t.unpost())}toJson(){return{type:""}}move_(t){this.anchor&&t!==this.anchor&&(this.moving=!0,this.unpost(),this.post(t),this.moving=!1)}}class gh extends uh{static fromJson(t,{items:e},s){const i=new this(s),n=t.get("items")(t,e,i);return i.items=n,i}constructor(t){super(),this._anchor=t,this.variablePool=this.anchor.menu.pool,this.setBaseMenu()}get anchor(){return this._anchor}post(){if(!this.anchor.menu.isPosted())return;let t=this.anchor.html;const e=this.html,s=this.baseMenu.frame,i=t.offsetWidth;let n=i-2,r=0;for(;t&&t!==s;)n+=t.offsetLeft,r+=t.offsetTop,t=t.parentNode;n+e.offsetWidth>document.body.offsetWidth-5&&(n=Math.max(5,n-i-e.offsetWidth+6)),super.post(n,r)}display(){this.baseMenu.frame.appendChild(this.html)}setBaseMenu(){let t=this;do{t=t.anchor.menu}while(t instanceof gh);this.baseMenu=t}left(t){this.focused=null,this.anchor.focus()}toJson(){return{type:""}}}class bh extends ch{generateHtml(){super.generateHtml();const t=this.html;this.span||this.generateSpan(),t.appendChild(this.span),this.update()}register(){this.variable.register(this)}unregister(){this.variable.unregister(this)}update(){this.updateAria(),this.span&&this.updateSpan()}}class Eh extends bh{static fromJson(t,{content:e,variable:s,id:i},n){return new this(n,e,s,i)}constructor(t,e,s,i){super(t,"radio",e,i),this.role="menuitemradio",this.variable=t.pool.lookup(s),this.register()}executeAction(){this.variable.setValue(this.id),rh(this)}generateSpan(){this.span=document.createElement("span"),this.span.textContent="\u2713",this.span.classList.add(sh.MENURADIOCHECK),this.span.setAttribute("aria-hidden","true")}updateAria(){this.html.setAttribute("aria-checked",this.variable.getValue()===this.id?"true":"false")}updateSpan(){this.span.style.display=this.variable.getValue()===this.id?"":"none"}toJson(){return{type:""}}}class xh extends nh{static fromJson(t,e,s){return new this(s)}constructor(t){super(t,"rule"),this.className=sh.MENUITEM,this.role="separator"}generateHtml(){super.generateHtml();const t=this.html;t.classList.add(sh.MENURULE),t.setAttribute("aria-orientation","vertical")}addEvents(t){}toJson(){return{type:"rule"}}}class yh extends ch{static fromJson(t,{content:e,action:s,id:i},n){return new this(n,e,s,i)}constructor(t,e,s,i){super(t,"command",e,i),this.command=s}mousedown(t){this.stop(t)}mouseup(t){this.press(),this.stop(t)}executeAction(){try{this.command(oh(this))}catch(t){ah(0,"Illegal command callback.")}rh(this)}toJson(){return{type:""}}}class Nh{static fromJson(t,{name:e,getter:s,setter:i},n){const r=new this(e,s,i);n.insert(r)}constructor(t,e,s){this._name=t,this.getter=e,this.setter=s,this.items=[]}get name(){return this._name}getValue(t){try{return this.getter(t)}catch(t){return ah(0,"Command of variable "+this.name+" failed."),null}}setValue(t,e){try{this.setter(t,e)}catch(t){ah(0,"Command of variable "+this.name+" failed.")}this.update()}register(t){-1===this.items.indexOf(t)&&this.items.push(t)}unregister(t){const e=this.items.indexOf(t);-1!==e&&this.items.splice(e,1)}update(){this.items.forEach(t=>t.update())}registerCallback(t){this.items.forEach(e=>e.registerCallback(t))}unregisterCallback(t){this.items.forEach(e=>e.unregisterCallback(t))}toJson(){return{type:"variable",name:this.name,getter:this.getter.toString(),setter:this.setter.toString()}}}class Th extends bh{static fromJson(t,{content:e,variable:s,id:i},n){return new this(n,e,s,i)}constructor(t,e,s,i){super(t,"checkbox",e,i),this.role="menuitemcheckbox",this.variable=t.pool.lookup(s),this.register()}executeAction(){this.variable.setValue(!this.variable.getValue()),rh(this)}generateSpan(){this.span=document.createElement("span"),this.span.textContent="\u2713",this.span.classList.add(sh.MENUCHECK),this.span.setAttribute("aria-hidden","true")}updateAria(){this.html.setAttribute("aria-checked",this.variable.getValue()?"true":"false")}updateSpan(){this.span.style.display=this.variable.getValue()?"":"none"}toJson(){return{type:""}}}class vh extends bh{static fromJson(t,{content:e,variable:s,id:i},n){return new this(n,e,s,i)}constructor(t,e,s,i){super(t,"combobox",e,i),this.role="combobox",this.inputEvent=!1,this.variable=t.pool.lookup(s),this.register()}executeAction(){this.variable.setValue(this.input.value,oh(this))}space(t){super.space(t),rh(this)}focus(){super.focus(),this.input.focus()}unfocus(){super.unfocus(),this.updateSpan()}generateHtml(){super.generateHtml();this.html.classList.add(sh.MENUCOMBOBOX)}generateSpan(){this.span=document.createElement("span"),this.span.classList.add(sh.MENUINPUTBOX),this.input=document.createElement("input"),this.input.addEventListener("keydown",this.inputKey.bind(this)),this.input.setAttribute("size","10em"),this.input.setAttribute("type","text"),this.input.setAttribute("tabindex","-1"),this.span.appendChild(this.input)}inputKey(t){this.bubbleKey(),this.inputEvent=!0}keydown(t){if(this.inputEvent&&t.keyCode!==Wl.ESCAPE&&t.keyCode!==Wl.RETURN)return this.inputEvent=!1,void t.stopPropagation();super.keydown(t),t.stopPropagation()}updateAria(){}updateSpan(){let t;try{t=this.variable.getValue(oh(this))}catch(e){t=""}this.input.value=t}toJson(){return{type:""}}}class Lh extends ch{static fromJson(t,{content:e,id:s},i){return new this(i,e,s)}constructor(t,e,s){super(t,"label",e,s)}generateHtml(){super.generateHtml();this.html.classList.add(sh.MENULABEL)}toJson(){return{type:""}}}class Ch extends bh{static fromJson(t,{content:e,variable:s,id:i},n){return new this(n,e,s,i)}constructor(t,e,s,i){super(t,"slider",e,i),this.role="slider",this.labelId="ctx_slideLabel"+lh(),this.valueId="ctx_slideValue"+lh(),this.inputEvent=!1,this.variable=t.pool.lookup(s),this.register()}executeAction(){this.variable.setValue(this.input.value,oh(this)),this.update()}space(t){super.space(t),rh(this)}focus(){super.focus(),this.input.focus()}unfocus(){super.unfocus(),this.updateSpan()}generateHtml(){super.generateHtml();this.html.classList.add(sh.MENUSLIDER),this.valueSpan=document.createElement("span"),this.valueSpan.setAttribute("id",this.valueId),this.valueSpan.classList.add(sh.SLIDERVALUE),this.html.appendChild(this.valueSpan)}generateSpan(){this.span=document.createElement("span"),this.labelSpan=document.createElement("span"),this.labelSpan.setAttribute("id",this.labelId),this.labelSpan.appendChild(this.html.childNodes[0]),this.html.appendChild(this.labelSpan),this.input=document.createElement("input"),this.input.setAttribute("type","range"),this.input.setAttribute("min","0"),this.input.setAttribute("max","100"),this.input.setAttribute("aria-valuemin","0"),this.input.setAttribute("aria-valuemax","100"),this.input.setAttribute("aria-labelledby",this.labelId),this.input.addEventListener("keydown",this.inputKey.bind(this)),this.input.addEventListener("input",this.executeAction.bind(this)),this.input.classList.add(sh.SLIDERBAR),this.span.appendChild(this.input)}inputKey(t){this.inputEvent=!0}mousedown(t){t.stopPropagation()}mouseup(t){rh(this),t.stopPropagation()}keydown(t){const e=t.keyCode;return e===Wl.UP||e===Wl.DOWN?(t.preventDefault(),void super.keydown(t)):this.inputEvent&&e!==Wl.ESCAPE&&e!==Wl.RETURN?(this.inputEvent=!1,void t.stopPropagation()):(super.keydown(t),void t.stopPropagation())}updateAria(){const t=this.variable.getValue();t&&this.input&&(this.input.setAttribute("aria-valuenow",t),this.input.setAttribute("aria-valuetext",t+"%"))}updateSpan(){let t;try{t=this.variable.getValue(oh(this)),this.valueSpan.innerHTML=t+"%"}catch(e){t=""}this.input.value=t}toJson(){return{type:""}}}class Rh extends Ql{constructor(t){super(),this.element=t,this.className=sh.MENUCLOSE,this.role="button"}generateHtml(){const t=document.createElement("span");t.classList.add(this.className),t.setAttribute("role",this.role),t.setAttribute("tabindex","0");const e=document.createElement("span");e.textContent="\xd7",t.appendChild(e),this.html=t}display(){}unpost(){super.unpost(),this.element.unpost()}keydown(t){this.bubbleKey(),super.keydown(t)}space(t){this.unpost(),this.stop(t)}mousedown(t){this.unpost(),this.stop(t)}}class Ih extends Ql{constructor(t,e,s){super(),this.title=t,this.signature=s,this.className=sh.INFO,this.role="dialog",this.contentDiv=this.generateContent(),this.close=this.generateClose(),this.content=e||function(){return""}}attachMenu(t){this.menu=t}generateHtml(){super.generateHtml();const t=this.html;t.appendChild(this.generateTitle()),t.appendChild(this.contentDiv),t.appendChild(this.generateSignature()),t.appendChild(this.close.html),t.setAttribute("tabindex","0")}post(){super.post();const t=document.documentElement,e=this.html,s=window.innerHeight||t.clientHeight||t.scrollHeight||0,i=Math.floor(-e.offsetWidth/2),n=Math.floor((s-e.offsetHeight)/3);e.setAttribute("style","margin-left: "+i+"px; top: "+n+"px;"),window.event instanceof MouseEvent&&e.classList.add(sh.MOUSEPOST),e.focus()}display(){this.menu.registerWidget(this),this.contentDiv.innerHTML=this.content();const t=this.menu.html;t.parentNode&&t.parentNode.removeChild(t),this.menu.frame.appendChild(this.html)}click(t){}keydown(t){this.bubbleKey(),super.keydown(t)}escape(t){this.unpost()}unpost(){super.unpost(),this.html.classList.remove(sh.MOUSEPOST),this.menu.unregisterWidget(this)}generateClose(){const t=new Rh(this),e=t.html;return e.classList.add(sh.INFOCLOSE),e.setAttribute("aria-label","Close Dialog Box"),t}generateTitle(){const t=document.createElement("span");return t.innerHTML=this.title,t.classList.add(sh.INFOTITLE),t}generateContent(){const t=document.createElement("div");return t.classList.add(sh.INFOCONTENT),t.setAttribute("tabindex","0"),t}generateSignature(){const t=document.createElement("span");return t.innerHTML=this.signature,t.classList.add(sh.INFOSIGNATURE),t}toJson(){return{type:""}}}class Sh extends uh{static fromJson(t,{title:e,values:s,variable:i},n){const r=new this(n),o=t.get("label")(t,{content:e||"",id:e||"id"},r),a=t.get("rule")(t,{},r),l=s.map(e=>t.get("radio")(t,{content:e,variable:i,id:e},r)),h=[o,a].concat(l);return r.items=h,r}constructor(t){super(),this.anchor=t,this.className=sh.SELECTIONMENU,this.variablePool=this.anchor.menu.pool,this.baseMenu=this.anchor.menu}generateHtml(){super.generateHtml(),this.items.forEach(t=>t.html.classList.add(sh.SELECTIONITEM))}display(){}right(t){this.anchor.right(t)}left(t){this.anchor.left(t)}}class Ah extends Ih{static fromJson(t,{title:e,signature:s,selections:i,order:n,grid:r},o){const a=new this(e,s,n,r);a.attachMenu(o);const l=i.map(e=>t.get("selectionMenu")(t,e,a));return a.selections=l,a}constructor(t,e,s="none",i="vertical"){super(t,null,e),this.style=s,this.grid=i,this._selections=[],this.prefix="ctxt-selection",this._balanced=!0}attachMenu(t){this.menu=t}get selections(){return this._selections}set selections(t){this._selections=[],t.forEach(t=>this.addSelection(t))}addSelection(t){t.anchor=this,this._selections.push(t)}rowDiv(t){const e=document.createElement("div");this.contentDiv.appendChild(e);const s=t.map(t=>(e.appendChild(t.html),t.html.id||(t.html.id=this.prefix+lh()),t.html.getBoundingClientRect())),i=s.map(t=>t.width),n=i.reduce((t,e)=>t+e,0),r=s.reduce((t,e)=>Math.max(t,e.height),0);return e.classList.add(sh.SELECTIONDIVIDER),e.setAttribute("style","height: "+r+"px;"),[e,n,r,i]}display(){if(super.display(),this.order(),!this.selections.length)return;const t=[];let e=0,s=[];const i=this.getChunkSize(this.selections.length);for(let n=0;n<this.selections.length;n+=i){const r=this.selections.slice(n,n+i),[o,a,l,h]=this.rowDiv(r);t.push(o),e=Math.max(e,a),r.forEach(t=>t.html.style.height=l+"px"),s=this.combineColumn(s,h)}this._balanced&&(this.balanceColumn(t,s),e=s.reduce((t,e)=>t+e,20)),t.forEach(t=>t.style.width=e+"px")}getChunkSize(t){switch(this.grid){case"square":return Math.floor(Math.sqrt(t));case"horizontal":return Math.floor(t/Ah.chunkSize);default:return Ah.chunkSize}}balanceColumn(t,e){t.forEach(t=>{const s=Array.from(t.children);for(let t,i=0;t=s[i];i++)t.style.width=e[i]+"px"})}combineColumn(t,e){let s=[],i=0;for(;t[i]||e[i];){if(!t[i]){s=s.concat(e.slice(i));break}if(!e[i]){s=s.concat(t.slice(i));break}s.push(Math.max(t[i],e[i])),i++}return s}left(t){this.move(t,t=>(0===t?this.selections.length:t)-1)}right(t){this.move(t,t=>t===this.selections.length-1?0:t+1)}generateHtml(){super.generateHtml(),this.html.classList.add(sh.SELECTION)}generateContent(){const t=super.generateContent();return t.classList.add(sh.SELECTIONBOX),t.removeAttribute("tabindex"),t}findSelection(t){const e=t.target;let s=null;if(e.id&&(s=this.selections.find(t=>t.html.id===e.id)),!s){const t=e.parentElement.id;s=this.selections.find(e=>e.html.id===t)}return s}move(t,e){const s=this.findSelection(t);s.focused&&s.focused.unfocus();const i=e(this.selections.indexOf(s));this.selections[i].focus()}order(){this.selections.sort(Ah.orderMethod.get(this.style))}toJson(){return{type:""}}}Ah.chunkSize=4,Ah.orderMethod=new Map([["alphabetical",(t,e)=>t.items[0].content.localeCompare(e.items[0].content)],["none",(t,e)=>1],["decreasing",(t,e)=>{const s=t.items.length,i=e.items.length;return s<i?1:i<s?-1:0}],["increasing",(t,e)=>{const s=t.items.length,i=e.items.length;return s<i?-1:i<s?1:0}]]);class wh{constructor(t){this._parser=new Map(t)}get(t){return this._parser.get(t)}add(t,e){this._parser.set(t,e)}}var Oh=function(t,e){var s={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(s[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(s[i[n]]=t[i[n]])}return s};class Mh{constructor(t=[]){this._initList=[["command",yh.fromJson.bind(yh)],["checkbox",Th.fromJson.bind(Th)],["combo",vh.fromJson.bind(vh)],["slider",Ch.fromJson.bind(Ch)],["label",Lh.fromJson.bind(Lh)],["radio",Eh.fromJson.bind(Eh)],["rule",xh.fromJson.bind(xh)],["submenu",dh.fromJson.bind(dh)],["contextMenu",fh.fromJson.bind(fh)],["subMenu",gh.fromJson.bind(gh)],["variable",Nh.fromJson.bind(Nh)],["items",this.items.bind(this)],["selectionMenu",Sh.fromJson.bind(Sh)],["selectionBox",Ah.fromJson.bind(Ah)]],this._factory=new wh(this._initList),t.forEach(([t,e])=>this.factory.add(t,e))}get factory(){return this._factory}items(t,e,s){const i=[];for(const t of e){const e=this.parse(t,s);e&&(s.items.push(e),t.disabled&&e.disable(),t.hidden&&i.push(e))}return i.forEach(t=>t.hide()),s.items}parse(t,...e){var{type:s}=t,i=Oh(t,["type"]);const n=this.factory.get(s);return n?n(this.factory,i,...e):null}}function Dh(t){return"."+(sh[t]||t)}function kh(t,e=";"){return"{\n "+t.join(e+"\n ")+";\n}"}const Ph={};Ph[Dh("MENU")]=kh(["position: absolute","background-color: white","color: black","width: auto","padding: 5px 0px","border: 1px solid #CCCCCC","margin: 0","cursor: default","font: menu","text-align: left","text-indent: 0","text-transform: none","line-height: normal","letter-spacing: normal","word-spacing: normal","word-wrap: normal","white-space: nowrap","float: none","z-index: 1001","border-radius: 5px","box-shadow: 0px 10px 20px #808080"]),Ph[Dh("MENUITEM")]=kh(["padding: 1px 2em","background: transparent"]),Ph[Dh("MENUARROW")]=kh(["position: absolute","right: 0.5em","padding-top: 0.25em","color: #666666","font-family: null","font-size: 0.75em"]),Ph[Dh("MENUACTIVE")+" "+Dh("MENUARROW")]=kh(["color: white"]),Ph[Dh("MENUARROW")+Dh("RTL")]=kh(["left: 0.5em","right: auto"]),Ph[Dh("MENUCHECK")]=kh(["position: absolute","left: 0.7em","font-family: null"]),Ph[Dh("MENUCHECK")+Dh("RTL")]=kh(["right: 0.7em","left: auto"]),Ph[Dh("MENURADIOCHECK")]=kh(["position: absolute","left: 0.7em"]),Ph[Dh("MENURADIOCHECK")+Dh("RTL")]=kh(["right: 0.7em","left: auto"]),Ph[Dh("MENUINPUTBOX")]=kh(["padding-left: 1em","right: 0.5em","color: #666666","font-family: null"]),Ph[Dh("MENUINPUTBOX")+Dh("RTL")]=kh(["left: 0.1em"]),Ph[Dh("MENUCOMBOBOX")]=kh(["left: 0.1em","padding-bottom: 0.5em"]),Ph[Dh("MENUSLIDER")]=kh(["left: 0.1em"]),Ph[Dh("SLIDERVALUE")]=kh(["position: absolute","right: 0.1em","padding-top: 0.25em","color: #333333","font-size: 0.75em"]),Ph[Dh("MENUACTIVE")+" "+Dh("SLIDERVALUE")]=kh(["color: #DDDDDD"]),Ph[Dh("SLIDERBAR")]=kh(["outline: none","background: #D3D3D3"]),Ph[Dh("MENULABEL")]=kh(["padding: 1px 2em 3px 1.33em","font-style: italic"]),Ph[Dh("MENURULE")]=kh(["border-top: 1px solid #DDDDDD","margin: 4px 3px"]),Ph[Dh("MENUDISABLED")]=kh(["color: #999"]),Ph[Dh("MENUACTIVE")]=kh(["background-color: #606872","color: white"]),Ph[Dh("MENUDISABLED")+":focus"]=kh(["background-color: #E8E8E8"]),Ph[Dh("MENULABEL")+":focus"]=kh(["background-color: #E8E8E8"]),Ph[Dh("CONTEXTMENU")+":focus"]=kh(["outline: none"]),Ph[Dh("CONTEXTMENU")+" "+Dh("MENUITEM")+":focus"]=kh(["outline: none"]),Ph[Dh("SELECTIONMENU")]=kh(["position: relative","float: left","border-bottom: none","box-shadow: none ! important","border-radius: 0px !important"]),Ph[Dh("SELECTIONITEM")]=kh(["padding-right: 1em"]),Ph[Dh("SELECTION")]=kh(["right: 40%","width: 50%"]),Ph[Dh("SELECTIONBOX")]=kh(["padding: 0em","max-height: 20em","max-width: none","background-color: #FFFFFF"]),Ph[Dh("SELECTIONDIVIDER")]=kh(["clear: both","border-top: 2px solid #000000"]),Ph[Dh("MENU")+" "+Dh("MENUCLOSE")]=kh(["top: -10px","left: -10px"]),Ph["@media (prefers-color-scheme: dark) /* menu */"]=kh([Dh("MENU")+" "+kh(["color: #E0E0E0","background-color: #242436","box-shadow: 0px 10px 20px #000","border: 1px solid #808080"]),Dh("SLIDERVALUE")+" "+kh(["color: #D0D0D0"]),Dh("MENUDISABLED")+":focus "+kh(["background-color: #383838"]),Dh("MENULABEL")+":focus "+kh(["background-color: #585858"]),Dh("MENURULE")+" "+kh(["border-top: 1px solid #808080"]),Dh("SELECTIONDIVIDER")+" "+kh(["border-top: 2px solid #808080"])],"");const Bh={};Bh[Dh("MENUCLOSE")]=kh(["position: absolute","cursor: pointer","display: inline-block","border: 2px solid #AAA","border-radius: 18px",'font-family: "Courier New", Courier',"font-size: 24px","color: #F0F0F0"]),Bh[Dh("MENUCLOSE")+" span"]=kh(["display: block","background-color: #AAA","border: 1.5px solid","border-radius: 18px","line-height: 0","padding: 8px 0 6px"]),Bh[Dh("MENUCLOSE")+":hover"]=kh(["color: white !important","border: 2px solid #CCC !important"]),Bh[Dh("MENUCLOSE")+":hover span"]=kh(["background-color: #CCC !important"]),Bh[Dh("MENUCLOSE")+":hover:focus"]=kh(["outline: none"]);function jh(t,e=document,s="MJX-Menu-styles"){if(e.head.querySelector("#"+s))return;const i=e.createElement("style");i.id=s;const n=[];for(const e in t)n.push(`${e} ${t[e]}`);i.textContent=n.join("\n"),e.head.appendChild(i)}class _h extends fh{constructor(){super(...arguments),this.mathItem=null,this.nofocus=!1,this.errorMsg=""}post(t,e){var s,i;if(this.mathItem){const n=null===(i=null===(s=this.mathItem)||void 0===s?void 0:s.explorers)||void 0===i?void 0:i.speech;(null==n?void 0:n.active)&&(n.restarted=n.semanticFocus()),void 0!==e&&(this.getOriginalMenu(),this.getSemanticsMenu(),this.getSpeechMenu(),this.getBrailleMenu(),this.getSvgMenu(),this.getErrorMessage(),this.dynamicSubmenus()),super.post(t,e)}}unpost(){this.posted&&super.unpost(),this.mathItem&&(this.mathItem.outputData.nofocus=this.nofocus),this.mathItem=null,this.nofocus=!1}findID(...t){let e=this,s=null;for(const i of t){if(!e)return null;for(s of e.items){if(s.id===i){e=s instanceof dh?s.submenu:null;break}e=s=null}}return s}setJax(t){this.jax=t}getOriginalMenu(){const t=this.mathItem.inputJax.name,e=this.findID("Show","Original");e.content="MathML"===t?"Original MathML":t+" Commands";this.findID("Copy","Original").content=e.content}getSemanticsMenu(){const t=this.findID("Settings","MathmlIncludes","semantics");"MathML"===this.mathItem.inputJax.name?t.disable():t.enable()}getSpeechMenu(){const t=this.mathItem.outputData.speech;this.findID("Show","Speech")[t?"enable":"disable"](),this.findID("Copy","Speech")[t?"enable":"disable"]()}getBrailleMenu(){const t=this.mathItem.outputData.braille;this.findID("Show","Braille")[t?"enable":"disable"](),this.findID("Copy","Braille")[t?"enable":"disable"]()}getSvgMenu(){const t=this.jax.SVG;this.findID("Show","SVG")[t?"enable":"disable"](),this.findID("Copy","SVG")[t?"enable":"disable"]()}getErrorMessage(){const t=this.mathItem.root.childNodes[0].childNodes;let e=!0;if(this.errorMsg="",1===t.length&&t[0].isKind("merror")){const s=t[0].attributes;this.errorMsg=s.get("data-mjx-error")||s.get("data-mjx-message")||"",e=!this.errorMsg}this.findID("Show","Error")[e?"disable":"enable"](),this.findID("Copy","Error")[e?"disable":"enable"]()}dynamicSubmenus(){for(const[t,[e,s]]of _h.DynamicSubmenus){const i=this.find(t);i&&e(this,i,t=>{var e;i.submenu=t,!(null===(e=null==t?void 0:t.items)||void 0===e?void 0:e.length)||s&&!this.settings[s]?i.disable():i.enable()})}}}_h.DynamicSubmenus=new Map;class Fh extends Ah{constructor(t,e,s,i,n,r){super(t,e,i,n),this.attachMenu(r);const o=r.factory;this.selections=s.map(t=>o.get("selectionMenu")(o,t,this))}post(){const t=Array.from(Object.values(this.menu.jax)).filter(t=>!!t)[0],e=new Ir({title:this.title,message:"",adaptor:t.adaptor,styles:{"mjx-dialog > div":{padding:0}}});e.attach(),this.contentDiv=e.content,this.display()}display(){const t=this;if(t.order(),!this.selections.length)return;const e=[];let s=0,i=[];const n=t.getChunkSize(this.selections.length);for(let r=0;r<this.selections.length;r+=n){const o=this.selections.slice(r,r+n),[a,l,h,c]=t.rowDiv(o);e.push(a),s=Math.max(s,l),o.forEach(t=>t.html.style.height=h+"px"),i=t.combineColumn(i,c)}t._balanced&&(t.balanceColumn(e,i),s=i.reduce((t,e)=>t+e-2,20)),e.forEach(t=>t.style.width=s+"px")}}var Uh,Hh,Wh;!function(t){t.DOMAIN="domain",t.STYLE="style",t.LOCALE="locale",t.TOPIC="topic",t.MODALITY="modality"}(Uh||(Uh={}));class Vh{static createProp(...t){const e=qh.DEFAULT_ORDER,s={};for(let i=0,n=t.length,r=e.length;i<n&&i<r;i++)s[e[i]]=t[i];return new Vh(s)}constructor(t,e=Object.keys(t)){this.properties=t,this.order=e}getProperties(){return this.properties}getOrder(){return this.order}getAxes(){return this.order}getProperty(t){return this.properties[t]}updateProperties(t){this.properties=t}allProperties(){const t=[];return this.order.forEach(e=>t.push(this.getProperty(e).slice())),t}toString(){const t=[];return this.order.forEach(e=>t.push(e+": "+this.getProperty(e).toString())),t.join("\n")}}class qh extends Vh{static createCstr(...t){const e=qh.DEFAULT_ORDER,s={};for(let i=0,n=t.length,r=e.length;i<n&&i<r;i++)s[e[i]]=t[i];return new qh(s)}static defaultCstr(){return qh.createCstr.apply(null,qh.DEFAULT_ORDER.map(function(t){return qh.DEFAULT_VALUES[t]}))}static validOrder(t){const e=qh.DEFAULT_ORDER.slice();return t.every(t=>{const s=e.indexOf(t);return-1!==s&&e.splice(s,1)})}constructor(t,e){const s={};for(const[e,i]of Object.entries(t))s[e]=[i];super(s,e),this.components=t}getComponents(){return this.components}getValue(t){return this.components[t]}getValues(){return this.order.map(t=>this.getValue(t))}allProperties(){const t=super.allProperties();for(let e,s,i=0;e=t[i],s=this.order[i];i++){const t=this.getValue(s);-1===e.indexOf(t)&&e.unshift(t)}return t}toString(){return this.getValues().join(".")}equal(t){const e=t.getAxes();if(this.order.length!==e.length)return!1;for(let s,i=0;s=e[i];i++){const e=this.getValue(s);if(!e||t.getValue(s)!==e)return!1}return!0}}qh.DEFAULT_ORDER=[Uh.LOCALE,Uh.MODALITY,Uh.DOMAIN,Uh.STYLE,Uh.TOPIC],qh.BASE_LOCALE="base",qh.DEFAULT_VALUE="default",qh.DEFAULT_VALUES={[Uh.LOCALE]:"en",[Uh.DOMAIN]:qh.DEFAULT_VALUE,[Uh.STYLE]:qh.DEFAULT_VALUE,[Uh.TOPIC]:qh.DEFAULT_VALUE,[Uh.MODALITY]:"speech"};class Xh{constructor(t){this.order=t}parse(t){const e=t.split("."),s={};if(e.length>this.order.length)throw new Error("Invalid dynamic constraint: "+s);let i=0;for(let t,n=0;t=this.order[n],e.length;n++,i++){const i=e.shift();s[t]=i}return new qh(s,this.order.slice(0,i))}}class zh{constructor(t,e=new Vh(t.getProperties(),t.getOrder())){this.reference=t,this.fallback=e,this.order=this.reference.getOrder()}getReference(){return this.reference}setReference(t,e){this.reference=t,this.fallback=e||new Vh(t.getProperties(),t.getOrder()),this.order=this.reference.getOrder()}match(t){const e=t.getAxes();return e.length===this.reference.getAxes().length&&e.every(e=>{const s=t.getValue(e);return s===this.reference.getValue(e)||-1!==this.fallback.getProperty(e).indexOf(s)})}compare(t,e){let s=!1;for(let i,n=0;i=this.order[n];n++){const n=t.getValue(i),r=e.getValue(i);if(!s){const t=this.reference.getValue(i);if(t===n&&t!==r)return-1;if(t===r&&t!==n)return 1;if(t===n&&t===r)continue;t!==n&&t!==r&&(s=!0)}const o=this.fallback.getProperty(i),a=o.indexOf(n),l=o.indexOf(r);if(a<l)return-1;if(l<a)return 1}return 0}toString(){return this.reference.toString()+"\n"+this.fallback.toString()}}!function(t){t.SYNC="sync",t.ASYNC="async",t.HTTP="http"}(Hh||(Hh={})),function(t){t.PITCH="pitch",t.RATE="rate",t.VOLUME="volume",t.PAUSE="pause",t.JOIN="join",t.LAYOUT="layout"}(Wh||(Wh={}));Wh.PITCH,Wh.RATE,Wh.VOLUME,Wh.PAUSE,Wh.JOIN;var Gh,Jh;!function(t){t.NONE="none",t.SHALLOW="shallow",t.DEEP="deep"}(Gh||(Gh={})),function(t){t.NONE="none",t.LAYOUT="layout",t.COUNTING="counting",t.PUNCTUATION="punctuation",t.SSML="ssml",t.ACSS="acss",t.SABLE="sable",t.VOICEXML="voicexml"}(Jh||(Jh={}));class Kh{static ensureLocale(t,e){return Kh.LOCALES.get(t)?t:(console.error(`Locale ${t} does not exist! Using ${Kh.LOCALES.get(e)} instead.`),e)}}Kh.VERSION="5.0.0-rc.4",Kh.LOCALES=new Map([["af","Afrikaans"],["ca","Catalan"],["da","Danish"],["de","German"],["en","English"],["es","Spanish"],["euro","Euro"],["fr","French"],["hi","Hindi"],["it","Italian"],["ko","Korean"],["nb","Bokm\xe5l"],["nn","Nynorsk"],["sv","Swedish"],["nemeth","Nemeth"]]),Kh.mathjaxVersion="4.1.2",Kh.url="https://cdn.jsdelivr.net/npm/speech-rule-engine@"+Kh.VERSION+"/lib/mathmaps";var $h=n(841),Yh=n.t($h,2),Qh=n(999),Zh=n.t(Qh,2);const tc=Yh,ec=(new tc.DOMImplementation).createDocument("",""),sc=(null==Zh?void 0:Qh.install)||window.wgxpath.install,ic=function(){const t={document:{},XPathResult:{}};return sc(t),t.document.XPathResult=t.XPathResult,t.document}(),nc={currentDocument:ec,evaluate:ic.evaluate,result:ic.XPathResult,createNSResolver:ic.createNSResolver},rc=!("undefined"==typeof window),oc=rc&&!(void 0===window.document),ac=!("undefined"==typeof DedicatedWorkerGlobalScope),lc=()=>{var t;return"undefined"!=typeof require||"undefined"!=typeof process&&null!=(null===(t=process.versions)||void 0===t?void 0:t.node)&&"undefined"!=typeof require?require:t=>null},hc={extRequire:t=>"undefined"!=typeof process&&"undefined"!=typeof require?lc()(t):null,windowSupported:rc,documentSupported:oc,webworker:ac,xmldom:tc,document:ec,fs:oc||ac?null:lc()("fs"),url:Kh.url,jsonPath:function(){if(oc||ac)return Kh.url;if(process.env.SRE_JSON_PATH||n.g.SRE_JSON_PATH)return process.env.SRE_JSON_PATH||n.g.SRE_JSON_PATH;try{return lc().resolve("speech-rule-engine").replace(/sre\.js$/,"")+"mathmaps"}catch(t){}try{return lc().resolve(".").replace(/sre\.js$/,"")+"mathmaps"}catch(t){}return"undefined"!=typeof __dirname?__dirname+(__dirname.match(/lib?$/)?"/mathmaps":"/lib/mathmaps"):process.cwd()+"/lib/mathmaps"}(),xpath:nc};function cc(t){return t.match("/$")?t:t+"/"}class dc{static getInstance(){return dc.instance=dc.instance||new dc,dc.instance}init(t){return t&&this.startDebugFile_(t),this.isActive_=!0,this.fileHandle}output(...t){this.isActive_&&this.output_(t)}generate(t){this.isActive_&&this.output_(t.apply(t,[]))}exit(t=()=>{}){this.stream_&&this.fileHandle.then(()=>{this.isActive_&&this.stream_&&(this.stream_.end("","",t),this.stream_=null)}),this.isActive_=!1}constructor(){this.isActive_=!1,this.fileHandle=Promise.resolve(),this.stream_=null}startDebugFile_(t){this.fileHandle=hc.fs.promises.open(t,"w"),this.fileHandle=this.fileHandle.then(e=>{this.stream_=e.createWriteStream(t),this.outputFunction=function(...t){this.stream_.write(t.join(" ")),this.stream_.write("\n")}.bind(this),this.stream_.on("error",function(t){console.info("Invalid log file. Debug information sent to console."),this.outputFunction=console.info}.bind(this)),this.stream_.on("finish",function(){console.info("Finalizing debug file.")})})}output_(t){this.stream_?this.fileHandle.then(()=>this.outputFunction.apply(this.outputFunction,["Speech Rule Engine Debugger:"].concat(t))):console.info(...["Speech Rule Engine Debugger:"].concat(t))}}class uc{constructor(t={}){this.delay=!1,this.domain="clearspeak",this.style=qh.DEFAULT_VALUES[Uh.STYLE],this.locale=qh.DEFAULT_VALUES[Uh.LOCALE],this.subiso="",this.modality=qh.DEFAULT_VALUES[Uh.MODALITY],this.speech=Gh.NONE,this.markup=Jh.NONE,this.mark=!0,this.automark=!1,this.character=!0,this.cleanpause=!0,this.cayleyshort=!0,this.linebreaks=!1,this.rate="100",this.walker="Table",this.structure=!1,this.aria=!1,this.tree=!1,this.strict=!1,this.pprint=!1,this.rules="",this.prune="",this.set(t)}set(t){this.ensureDomain(t);for(const[e,s]of Object.entries(t))(uc.BINARY_FEATURES.includes(e)||uc.STRING_FEATURES.includes(e))&&(this[e]=s)}json(){const t={};return[].concat(uc.STRING_FEATURES,uc.BINARY_FEATURES).forEach(e=>t[e]=this[e]),t}ensureDomain(t){if(t.modality&&"speech"!==t.modality||!t.modality&&"speech"!==this.modality)return;if(!t.domain&&!t.locale)return;if("default"===t.domain)return void(t.domain="mathspeak");const e=t.locale||this.locale,s=t.domain||this.domain;-1===pc.indexOf(e)||"mathspeak"===s?"en"!==e?"mathspeak"!==s&&"clearspeak"!==s&&(t.domain="mathspeak"):-1===mc.indexOf(s)&&(t.domain="mathspeak"):t.domain="mathspeak"}}uc.BINARY_FEATURES=["automark","mark","character","cleanpause","strict","structure","aria","pprint","cayleyshort","linebreaks","tree"],uc.STRING_FEATURES=["markup","style","domain","speech","walker","locale","delay","modality","rate","rules","subiso","prune"];const pc=["ca","da","es"],mc=["chromevox","clearspeak","mathspeak","emacspeak","html"];class fc extends Error{constructor(t=""){super(),this.message=t,this.name="SRE Error"}}class gc{set defaultLocale(t){this._defaultLocale=Kh.ensureLocale(t,this._defaultLocale)}get defaultLocale(){return this._defaultLocale}static getInstance(){return gc.instance=gc.instance||new gc,gc.instance}static defaultEvaluator(t,e){return t}static evaluateNode(t){return gc.nodeEvaluator(t)}getRate(){const t=parseInt(this.options.rate,10);return isNaN(t)?100:t}setDynamicCstr(t){if(this.defaultLocale&&(qh.DEFAULT_VALUES[Uh.LOCALE]=this.defaultLocale),t){const e=Object.keys(t);for(let s=0;s<e.length;s++){const i=e[s];if(-1!==qh.DEFAULT_ORDER.indexOf(i)){const e=t[i];this.options[i]=e}}}const e=[this.options.locale,this.options.modality,this.options.domain,this.options.style].join("."),s=Vh.createProp([qh.DEFAULT_VALUES[Uh.LOCALE]],[qh.DEFAULT_VALUES[Uh.MODALITY]],[qh.DEFAULT_VALUES[Uh.DOMAIN]],[qh.DEFAULT_VALUES[Uh.STYLE]]),i=this.comparators[this.options.domain],n=this.parsers[this.options.domain];this.parser=n||this.defaultParser,this.dynamicCstr=this.parser.parse(e),this.dynamicCstr.updateProperties(s.getProperties()),this.comparator=i?i():new zh(this.dynamicCstr)}constructor(){this.options=new uc,this.config=!1,this.customLoader=null,this.parsers={},this.comparator=null,this.mode=Hh.SYNC,this.init=!0,this.comparators={},this._defaultLocale=qh.DEFAULT_VALUES[Uh.LOCALE],this.options.locale=this.defaultLocale,this.evaluator=gc.defaultEvaluator,this.defaultParser=new Xh(qh.DEFAULT_ORDER),this.parser=this.defaultParser,this.dynamicCstr=qh.defaultCstr()}configurate(t){this.mode!==Hh.HTTP||hc.webworker||this.config||(!function(t){const e=document.documentElement.querySelectorAll('script[type="text/x-sre-config"]');for(let s=0,i=e.length;s<i;s++){let i;try{i=e[s].innerHTML;const n=JSON.parse(i);for(const[e,s]of Object.entries(n))t[e]=s}catch(t){dc.getInstance().output("Illegal configuration ",i)}}}(t),this.config=!0),function(t){if("undefined"!=typeof SREfeature)for(const[e,s]of Object.entries(SREfeature))t[e]=s}(t)}setCustomLoader(t){t&&(this.customLoader=t)}setup(t){void 0!==t.mode&&(this.mode=t.mode),this.configurate(t),this.options.set(t),t.json&&(hc.jsonPath=cc(t.json)),this.setCustomLoader(t.custom)}json(){return Object.assign({mode:this.mode},this.options.json())}reset(){this.options=new uc}}gc.nodeEvaluator=function(t){return[]};class bc{static get(t=gc.getInstance().options.locale){return bc.promises[t]||Promise.resolve("")}static getall(){return Promise.all(Object.values(bc.promises))}}bc.loaded={},bc.promises={};const Ec=hc.xpath,xc={xhtml:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",mml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function yc(t){return xc[t]||null}class Nc{constructor(){this.lookupNamespaceURI=yc}}function Tc(t,e,s){return Ec.evaluate(t,e,new Nc,s,null)}var vc;function Lc(t){const e=[];for(let s=0,i=t.length;s<i;s++)e.push(t[s]);return e}function Cc(t){const e=new hc.xmldom.DOMParser,s=function(t){return(t=t.replace(/&nbsp;/g,"\xa0")).replace(/>[ \f\n\r\t\v\u200b]+</g,"><").trim()}(t),i=!!s.match(/&(?!lt|gt|amp|quot|apos)\w+;/g);if(!s)throw new fc("Empty input!");try{const t=e.parseFromString(s,i?"text/html":"text/xml");return gc.getInstance().mode===Hh.HTTP?(Ec.currentDocument=t,i?t.body.childNodes[0]:t.documentElement):t.documentElement}catch(t){throw new fc("Illegal input: "+t.message)}}function Rc(t,e){t.parentNode&&(t.parentNode.insertBefore(e,t),t.parentNode.removeChild(t))}function Ic(t){return hc.document.createElement(t)}function Sc(t){let e="",s=/(>)(<)(\/*)/g,i=0,n=(t=t.replace(s,"$1\r\n$2$3")).split("\r\n");for(s=/(\.)*(<)(\/*)/g,n=n.map(t=>t.replace(s,"$1\r\n$2$3").split("\r\n")).reduce((t,e)=>t.concat(e),[]);n.length;){let t=n.shift();if(!t)continue;let s=0;if(t.match(/^<\w[^>/]*>[^>]+$/)){const e=Ac(t,n[0]);e[0]?e[1]?(t+=n.shift().slice(0,-e[1].length),e[1].trim()&&n.unshift(e[1])):t+=n.shift():s=1}else if(t.match(/^<\/\w/))0!==i&&(i-=1);else if(t.match(/^<\w[^>]*[^/]>.*$/))s=1;else if(t.match(/^<\w[^>]*\/>.+$/)){const e=t.indexOf(">")+1,s=t.slice(e);s.trim()&&n.unshift(),t=t.slice(0,e)+s}else s=0;e+=new Array(i+1).join(" ")+t+"\r\n",i+=s}return e}function Ac(t,e){if(!e)return[!1,""];const s=t.match(/^<([^> ]+).*>/),i=e.match(/^<\/([^>]+)>(.*)/);return s&&i&&s[1]===i[1]?[!0,i[2]]:[!1,""]}function wc(t,e){return t.querySelectorAll?Lc(t.querySelectorAll(`[${e}]`)):function(t,e){let s;try{s=Tc(t,e,Ec.result.ORDERED_NODE_ITERATOR_TYPE)}catch(t){return[]}const i=[];for(let t=s.iterateNext();t;t=s.iterateNext())i.push(t);return i}(`.//*[@${e}]`,t)}function Oc(t){return t.tagName.toUpperCase()}function Mc(t){return(new hc.xmldom.XMLSerializer).serializeToString(t)}!function(t){t[t.ELEMENT_NODE=1]="ELEMENT_NODE",t[t.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",t[t.TEXT_NODE=3]="TEXT_NODE",t[t.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",t[t.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",t[t.ENTITY_NODE=6]="ENTITY_NODE",t[t.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",t[t.COMMENT_NODE=8]="COMMENT_NODE",t[t.DOCUMENT_NODE=9]="DOCUMENT_NODE",t[t.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",t[t.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",t[t.NOTATION_NODE=12]="NOTATION_NODE"}(vc||(vc={}));class Dc{constructor(t,e,s){this.domain=t,this.name=e,this.func=s,this.active=!1}annotate(t){t.childNodes.forEach(this.annotate.bind(this)),t.contentNodes.forEach(this.annotate.bind(this)),t.addAnnotation(this.domain,this.func(t))}}class kc{constructor(t,e,s,i={}){this.domain=t,this.name=e,this.func=s,this.def=i,this.active=!1}visit(t,e){let s=this.func(t,e);t.addAnnotation(this.domain,s[0]);for(let e,i=0;e=t.childNodes[i];i++)s=this.visit(e,s[1]);for(let e,i=0;e=t.contentNodes[i];i++)s=this.visit(e,s[1]);return s}}const Pc=new Map,Bc=new Map;function jc(t){const e=t.domain+":"+t.name;t instanceof Dc?Pc.set(e,t):Bc.set(e,t)}function _c(t,e){const s=t+":"+e,i=Pc.get(s)||Bc.get(s);i&&(i.active=!0)}var Fc,Uc,Hc;function Wc(t){const e=t.toString(16).toUpperCase();return e.length>3?e:("000"+e).slice(-4)}function Vc([t,e],s){const i=parseInt(t,16),n=parseInt(e,16),r=[];for(let t=i;t<=n;t++){let e=Wc(t);!1!==s[e]&&(e=s[e]||e,r.push(e))}return r}function qc(t,e={}){return Vc(t,e).map(t=>String.fromCodePoint(parseInt(t,16)))}!function(t){t.BOLD="bold",t.BOLDFRAKTUR="bold-fraktur",t.BOLDITALIC="bold-italic",t.BOLDSCRIPT="bold-script",t.DOUBLESTRUCK="double-struck",t.DOUBLESTRUCKITALIC="double-struck-italic",t.FULLWIDTH="fullwidth",t.FRAKTUR="fraktur",t.ITALIC="italic",t.MONOSPACE="monospace",t.NORMAL="normal",t.SCRIPT="script",t.SANSSERIF="sans-serif",t.SANSSERIFITALIC="sans-serif-italic",t.SANSSERIFBOLD="sans-serif-bold",t.SANSSERIFBOLDITALIC="sans-serif-bold-italic"}(Fc||(Fc={})),function(t){t.SUPER="super",t.SUB="sub",t.CIRCLED="circled",t.PARENTHESIZED="parenthesized",t.PERIOD="period",t.NEGATIVECIRCLED="negative-circled",t.DOUBLECIRCLED="double-circled",t.CIRCLEDSANSSERIF="circled-sans-serif",t.NEGATIVECIRCLEDSANSSERIF="negative-circled-sans-serif",t.COMMA="comma",t.SQUARED="squared",t.NEGATIVESQUARED="negative-squared"}(Uc||(Uc={})),function(t){t.LATINCAP="latinCap",t.LATINSMALL="latinSmall",t.GREEKCAP="greekCap",t.GREEKSMALL="greekSmall",t.DIGIT="digit"}(Hc||(Hc={}));const Xc=[{interval:["1D400","1D419"],base:Hc.LATINCAP,subst:{},capital:!0,category:"Lu",font:Fc.BOLD},{interval:["1D41A","1D433"],base:Hc.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Fc.BOLD},{interval:["1D56C","1D585"],base:Hc.LATINCAP,subst:{},capital:!0,category:"Lu",font:Fc.BOLDFRAKTUR},{interval:["1D586","1D59F"],base:Hc.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Fc.BOLDFRAKTUR},{interval:["1D468","1D481"],base:Hc.LATINCAP,subst:{},capital:!0,category:"Lu",font:Fc.BOLDITALIC},{interval:["1D482","1D49B"],base:Hc.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Fc.BOLDITALIC},{interval:["1D4D0","1D4E9"],base:Hc.LATINCAP,subst:{},capital:!0,category:"Lu",font:Fc.BOLDSCRIPT},{interval:["1D4EA","1D503"],base:Hc.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Fc.BOLDSCRIPT},{interval:["1D538","1D551"],base:Hc.LATINCAP,subst:{"1D53A":"2102","1D53F":"210D","1D545":"2115","1D547":"2119","1D548":"211A","1D549":"211D","1D551":"2124"},capital:!0,category:"Lu",font:Fc.DOUBLESTRUCK},{interval:["1D552","1D56B"],base:Hc.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Fc.DOUBLESTRUCK},{interval:["1D504","1D51D"],base:Hc.LATINCAP,subst:{"1D506":"212D","1D50B":"210C","1D50C":"2111","1D515":"211C","1D51D":"2128"},capital:!0,category:"Lu",font:Fc.FRAKTUR},{interval:["1D51E","1D537"],base:Hc.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Fc.FRAKTUR},{interval:["FF21","FF3A"],base:Hc.LATINCAP,subst:{},capital:!0,category:"Lu",font:Fc.FULLWIDTH},{interval:["FF41","FF5A"],base:Hc.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Fc.FULLWIDTH},{interval:["1D434","1D44D"],base:Hc.LATINCAP,subst:{},capital:!0,category:"Lu",font:Fc.ITALIC},{interval:["1D44E","1D467"],base:Hc.LATINSMALL,subst:{"1D455":"210E"},capital:!1,category:"Ll",font:Fc.ITALIC},{interval:["1D670","1D689"],base:Hc.LATINCAP,subst:{},capital:!0,category:"Lu",font:Fc.MONOSPACE},{interval:["1D68A","1D6A3"],base:Hc.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Fc.MONOSPACE},{interval:["0041","005A"],base:Hc.LATINCAP,subst:{},capital:!0,category:"Lu",font:Fc.NORMAL},{interval:["0061","007A"],base:Hc.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Fc.NORMAL},{interval:["1D49C","1D4B5"],base:Hc.LATINCAP,subst:{"1D49D":"212C","1D4A0":"2130","1D4A1":"2131","1D4A3":"210B","1D4A4":"2110","1D4A7":"2112","1D4A8":"2133","1D4AD":"211B"},capital:!0,category:"Lu",font:Fc.SCRIPT},{interval:["1D4B6","1D4CF"],base:Hc.LATINSMALL,subst:{"1D4BA":"212F","1D4BC":"210A","1D4C4":"2134"},capital:!1,category:"Ll",font:Fc.SCRIPT},{interval:["1D5A0","1D5B9"],base:Hc.LATINCAP,subst:{},capital:!0,category:"Lu",font:Fc.SANSSERIF},{interval:["1D5BA","1D5D3"],base:Hc.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Fc.SANSSERIF},{interval:["1D608","1D621"],base:Hc.LATINCAP,subst:{},capital:!0,category:"Lu",font:Fc.SANSSERIFITALIC},{interval:["1D622","1D63B"],base:Hc.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Fc.SANSSERIFITALIC},{interval:["1D5D4","1D5ED"],base:Hc.LATINCAP,subst:{},capital:!0,category:"Lu",font:Fc.SANSSERIFBOLD},{interval:["1D5EE","1D607"],base:Hc.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Fc.SANSSERIFBOLD},{interval:["1D63C","1D655"],base:Hc.LATINCAP,subst:{},capital:!0,category:"Lu",font:Fc.SANSSERIFBOLDITALIC},{interval:["1D656","1D66F"],base:Hc.LATINSMALL,subst:{},capital:!1,category:"Ll",font:Fc.SANSSERIFBOLDITALIC},{interval:["0391","03A9"],base:Hc.GREEKCAP,subst:{"03A2":"03F4"},capital:!0,category:"Lu",font:Fc.NORMAL},{interval:["03B0","03D0"],base:Hc.GREEKSMALL,subst:{"03B0":"2207","03CA":"2202","03CB":"03F5","03CC":"03D1","03CD":"03F0","03CE":"03D5","03CF":"03F1","03D0":"03D6"},capital:!1,category:"Ll",font:Fc.NORMAL},{interval:["1D6A8","1D6C0"],base:Hc.GREEKCAP,subst:{},capital:!0,category:"Lu",font:Fc.BOLD},{interval:["1D6C1","1D6E1"],base:Hc.GREEKSMALL,subst:{},capital:!1,category:"Ll",font:Fc.BOLD},{interval:["1D6E2","1D6FA"],base:Hc.GREEKCAP,subst:{},capital:!0,category:"Lu",font:Fc.ITALIC},{interval:["1D6FB","1D71B"],base:Hc.GREEKSMALL,subst:{},capital:!1,category:"Ll",font:Fc.ITALIC},{interval:["1D71C","1D734"],base:Hc.GREEKCAP,subst:{},capital:!0,category:"Lu",font:Fc.BOLDITALIC},{interval:["1D735","1D755"],base:Hc.GREEKSMALL,subst:{},capital:!1,category:"Ll",font:Fc.BOLDITALIC},{interval:["1D756","1D76E"],base:Hc.GREEKCAP,subst:{},capital:!0,category:"Lu",font:Fc.SANSSERIFBOLD},{interval:["1D76F","1D78F"],base:Hc.GREEKSMALL,subst:{},capital:!1,category:"Ll",font:Fc.SANSSERIFBOLD},{interval:["1D790","1D7A8"],base:Hc.GREEKCAP,subst:{},capital:!0,category:"Lu",font:Fc.SANSSERIFBOLDITALIC},{interval:["1D7A9","1D7C9"],base:Hc.GREEKSMALL,subst:{},capital:!1,category:"Ll",font:Fc.SANSSERIFBOLDITALIC},{interval:["0030","0039"],base:Hc.DIGIT,subst:{},offset:0,category:"Nd",font:Fc.NORMAL},{interval:["2070","2079"],base:Hc.DIGIT,subst:{2071:"00B9",2072:"00B2",2073:"00B3"},offset:0,category:"No",font:Uc.SUPER},{interval:["2080","2089"],base:Hc.DIGIT,subst:{},offset:0,category:"No",font:Uc.SUB},{interval:["245F","2473"],base:Hc.DIGIT,subst:{"245F":"24EA"},offset:0,category:"No",font:Uc.CIRCLED},{interval:["3251","325F"],base:Hc.DIGIT,subst:{},offset:21,category:"No",font:Uc.CIRCLED},{interval:["32B1","32BF"],base:Hc.DIGIT,subst:{},offset:36,category:"No",font:Uc.CIRCLED},{interval:["2474","2487"],base:Hc.DIGIT,subst:{},offset:1,category:"No",font:Uc.PARENTHESIZED},{interval:["2487","249B"],base:Hc.DIGIT,subst:{2487:"1F100"},offset:0,category:"No",font:Uc.PERIOD},{interval:["2775","277F"],base:Hc.DIGIT,subst:{2775:"24FF"},offset:0,category:"No",font:Uc.NEGATIVECIRCLED},{interval:["24EB","24F4"],base:Hc.DIGIT,subst:{},offset:11,category:"No",font:Uc.NEGATIVECIRCLED},{interval:["24F5","24FE"],base:Hc.DIGIT,subst:{},offset:1,category:"No",font:Uc.DOUBLECIRCLED},{interval:["277F","2789"],base:Hc.DIGIT,subst:{"277F":"1F10B"},offset:0,category:"No",font:Uc.CIRCLEDSANSSERIF},{interval:["2789","2793"],base:Hc.DIGIT,subst:{2789:"1F10C"},offset:0,category:"No",font:Uc.NEGATIVECIRCLEDSANSSERIF},{interval:["FF10","FF19"],base:Hc.DIGIT,subst:{},offset:0,category:"Nd",font:Fc.FULLWIDTH},{interval:["1D7CE","1D7D7"],base:Hc.DIGIT,subst:{},offset:0,category:"Nd",font:Fc.BOLD},{interval:["1D7D8","1D7E1"],base:Hc.DIGIT,subst:{},offset:0,category:"Nd",font:Fc.DOUBLESTRUCK},{interval:["1D7E2","1D7EB"],base:Hc.DIGIT,subst:{},offset:0,category:"Nd",font:Fc.SANSSERIF},{interval:["1D7EC","1D7F5"],base:Hc.DIGIT,subst:{},offset:0,category:"Nd",font:Fc.SANSSERIFBOLD},{interval:["1D7F6","1D7FF"],base:Hc.DIGIT,subst:{},offset:0,category:"Nd",font:Fc.MONOSPACE},{interval:["1F101","1F10A"],base:Hc.DIGIT,subst:{},offset:0,category:"No",font:Uc.COMMA},{interval:["24B6","24CF"],base:Hc.LATINCAP,subst:{},capital:!0,category:"So",font:Uc.CIRCLED},{interval:["24D0","24E9"],base:Hc.LATINSMALL,subst:{},capital:!1,category:"So",font:Uc.CIRCLED},{interval:["1F110","1F129"],base:Hc.LATINCAP,subst:{},capital:!0,category:"So",font:Uc.PARENTHESIZED},{interval:["249C","24B5"],base:Hc.LATINSMALL,subst:{},capital:!1,category:"So",font:Uc.PARENTHESIZED},{interval:["1F130","1F149"],base:Hc.LATINCAP,subst:{},capital:!0,category:"So",font:Uc.SQUARED},{interval:["1F170","1F189"],base:Hc.LATINCAP,subst:{},capital:!0,category:"So",font:Uc.NEGATIVESQUARED},{interval:["1F150","1F169"],base:Hc.LATINCAP,subst:{},capital:!0,category:"So",font:Uc.NEGATIVECIRCLED}],zc=new Map;function Gc(t,e){return t+e.split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}for(const t of Xc){const e=Gc(t.base,t.font),s=qc(t.interval,t.subst);let i=zc.get(e);i?i.unicode=i.unicode.concat(s):(i=t,i.unicode=s,zc.set(e,i))}var Jc;!function(t){t.PUNCTUATION="punctuation",t.FENCE="fence",t.NUMBER="number",t.IDENTIFIER="identifier",t.TEXT="text",t.OPERATOR="operator",t.RELATION="relation",t.LARGEOP="largeop",t.FUNCTION="function",t.ACCENT="accent",t.FENCED="fenced",t.FRACTION="fraction",t.PUNCTUATED="punctuated",t.RELSEQ="relseq",t.MULTIREL="multirel",t.INFIXOP="infixop",t.PREFIXOP="prefixop",t.POSTFIXOP="postfixop",t.APPL="appl",t.INTEGRAL="integral",t.BIGOP="bigop",t.SQRT="sqrt",t.ROOT="root",t.LIMUPPER="limupper",t.LIMLOWER="limlower",t.LIMBOTH="limboth",t.SUBSCRIPT="subscript",t.SUPERSCRIPT="superscript",t.UNDERSCORE="underscore",t.OVERSCORE="overscore",t.TENSOR="tensor",t.TABLE="table",t.MULTILINE="multiline",t.MATRIX="matrix",t.VECTOR="vector",t.CASES="cases",t.ROW="row",t.LINE="line",t.CELL="cell",t.ENCLOSE="enclose",t.INFERENCE="inference",t.RULELABEL="rulelabel",t.CONCLUSION="conclusion",t.PREMISES="premises",t.UNKNOWN="unknown",t.EMPTY="empty"}(Jc||(Jc={}));const Kc=Object.assign({},Jc);var $c;!function(t){t.COMMA="comma",t.SEMICOLON="semicolon",t.ELLIPSIS="ellipsis",t.FULLSTOP="fullstop",t.QUESTION="question",t.EXCLAMATION="exclamation",t.QUOTES="quotes",t.DASH="dash",t.TILDE="tilde",t.PRIME="prime",t.DEGREE="degree",t.VBAR="vbar",t.COLON="colon",t.OPENFENCE="openfence",t.CLOSEFENCE="closefence",t.APPLICATION="application",t.DUMMY="dummy",t.UNIT="unit",t.LABEL="label",t.OPEN="open",t.CLOSE="close",t.TOP="top",t.BOTTOM="bottom",t.NEUTRAL="neutral",t.METRIC="metric",t.LATINLETTER="latinletter",t.GREEKLETTER="greekletter",t.OTHERLETTER="otherletter",t.NUMBERSET="numbersetletter",t.INTEGER="integer",t.FLOAT="float",t.OTHERNUMBER="othernumber",t.INFTY="infty",t.MIXED="mixed",t.MULTIACCENT="multiaccent",t.OVERACCENT="overaccent",t.UNDERACCENT="underaccent",t.UNDEROVER="underover",t.SUBSUP="subsup",t.LEFTSUB="leftsub",t.LEFTSUPER="leftsuper",t.RIGHTSUB="rightsub",t.RIGHTSUPER="rightsuper",t.LEFTRIGHT="leftright",t.ABOVEBELOW="abovebelow",t.INTERVAL="interval",t.SETEMPTY="set empty",t.SETEXT="set extended",t.SETSINGLE="set singleton",t.SETCOLLECT="set collection",t.STRING="string",t.SPACE="space",t.ANNOTATION="annotation",t.TEXT="text",t.SEQUENCE="sequence",t.ENDPUNCT="endpunct",t.STARTPUNCT="startpunct",t.NEGATIVE="negative",t.POSITIVE="positive",t.NEGATION="negation",t.MULTIOP="multiop",t.PREFIXOP="prefix operator",t.POSTFIXOP="postfix operator",t.LIMFUNC="limit function",t.INFIXFUNC="infix function",t.PREFIXFUNC="prefix function",t.POSTFIXFUNC="postfix function",t.SIMPLEFUNC="simple function",t.COMPFUNC="composed function",t.SUM="sum",t.INTEGRAL="integral",t.GEOMETRY="geometry",t.BOX="box",t.BLOCK="block",t.ADDITION="addition",t.MULTIPLICATION="multiplication",t.SUBTRACTION="subtraction",t.IMPLICIT="implicit",t.DIVISION="division",t.VULGAR="vulgar",t.EQUALITY="equality",t.INEQUALITY="inequality",t.ARROW="arrow",t.ELEMENT="element",t.NONELEMENT="nonelement",t.REELEMENT="reelement",t.RENONELEMENT="renonelement",t.SET="set",t.DETERMINANT="determinant",t.ROWVECTOR="rowvector",t.BINOMIAL="binomial",t.SQUAREMATRIX="squarematrix",t.CYCLE="cycle",t.MULTILINE="multiline",t.MATRIX="matrix",t.VECTOR="vector",t.CASES="cases",t.TABLE="table",t.CAYLEY="cayley",t.PROOF="proof",t.LEFT="left",t.RIGHT="right",t.UP="up",t.DOWN="down",t.FINAL="final",t.SINGLE="single",t.HYP="hyp",t.AXIOM="axiom",t.LOGIC="logic",t.UNKNOWN="unknown",t.MGLYPH="mglyph"}($c||($c={}));const Yc=Object.assign({},$c);var Qc;!function(t){t.CALIGRAPHIC="caligraphic",t.CALIGRAPHICBOLD="caligraphic-bold",t.OLDSTYLE="oldstyle",t.OLDSTYLEBOLD="oldstyle-bold",t.UNKNOWN="unknown"}(Qc||(Qc={}));const Zc=Object.assign(Object.assign(Object.assign({},Fc),Qc),Uc);var td;!function(t){t.ALLLETTERS="allLetters",t.D="d",t.BAR="bar",t.TILDE="tilde",t.CURLY="curly",t.PAREN="paren",t.BRACKET="bracket",t.FLOOR="floor",t.CEIL="ceil"}(td||(td={}));const ed=Object.assign(Object.assign({},Hc),td);var sd=function(t,e){var s={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(s[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(s[i[n]]=t[i[n]])}return s};const id={functionApplication:String.fromCodePoint(8289),invisibleTimes:String.fromCodePoint(8290),invisibleComma:String.fromCodePoint(8291),invisiblePlus:String.fromCodePoint(8292)};class nd extends Map{get(t){return super.get(t)||{role:Yc.UNKNOWN,type:Kc.UNKNOWN,font:Zc.UNKNOWN}}}class rd extends Map{set(t,e,s=""){return super.set(this.secKey(e,t),s||e),this}has(t,e){return super.has(this.secKey(e,t))}get(t,e){return super.get(this.secKey(e,t))}secKey(t,e){return e?`${t} ${e}`:`${t}`}}const od={Meaning:new nd,Secondary:new rd,FencesHoriz:new Map,FencesVert:new Map,FencesSecondary:new Map,LatexCommands:new Map};function ad(t,e){for(const s of t)od.Meaning.set(s,{role:e.role||Yc.UNKNOWN,type:e.type||Kc.UNKNOWN,font:e.font||Zc.UNKNOWN}),e.secondary&&od.Secondary.set(s,e.secondary)}function ld(t,e,s=1){const i={},n=function(t){let e=[];for(const s of t)Array.isArray(s)?e=e.concat(Vc(s,{}).map(t=>parseInt(t,16))):e.push(parseInt(s,16));return e}(e);for(const e of n)i[e]||(t.set(String.fromCodePoint(e),String.fromCodePoint(e+s)),i[e]=!0,i[e+s]=!0)}const hd=["0028","0029","207D","207E","208D","208E","2768","2769","276A","276B","27EE","27EF","FE59","FE5A","FF08","FF09"],cd=["005B","005D","2045","2046","298B","298C","298D","298E","298F","2990","FF3B","FF3D"],dd=["007B","007D","2774","2775","FE5B","FE5C","FF5B","FF5D"],ud=["2308","2309","2E22","2E23","300C","300E","FF62"],pd=["230A","230B","2E24","2E25","300D","300F","FF63"];function md(t,e){for(const s of t){const t=String.fromCodePoint(parseInt(s,16));od.Secondary.set(t,e),od.FencesSecondary.set(t,e)}}const fd=["cos","cot","csc","sec","sin","tan","arccos","arccot","arccsc","arcsec","arcsin","arctan"].concat(["cosh","coth","csch","sech","sinh","tanh","arcosh","arcoth","arcsch","arsech","arsinh","artanh"],["deg","det","dim","hom","ker","Tr"],["log","ln","lg","exp","gcd","lcm","arg","im","re","Pr"]);function gd(t,e,s,i,n,r=[],o={},a={}){const l=zc.get(Gc(t,i));l&&(l.unicode.forEach(t=>{od.Meaning.set(t,{type:e,role:s,font:n}),r.forEach(e=>od.Secondary.set(t,e))}),function(t,e){for(const[s,i]of Object.entries(e)){const e=t[s];void 0!==e&&od.Meaning.set(e,i)}}(l.unicode,o),function(t,e){for(const[s,i]of Object.entries(e)){const e=t[s];void 0!==e&&od.Secondary.set(e,i)}}(l.unicode,a))}[{set:["23","26","40","5c","a1","a7","b6","bf","2017",["2022","2025"],"2027","203b","203c",["2041","2043"],["2047","2049"],["204b","204d"],"2050","2055","2056",["2058","205e"],"2234","2235","fe45","fe46","fe5f","fe60","fe68","fe6b","ff03","ff06","ff0f","ff20","ff3c"],type:Kc.PUNCTUATION,role:Yc.UNKNOWN},{set:["22","ab","bb","2dd",["2018","201f"],"2039","203a",["301d","301f"],"fe10","ff02","ff07"],type:Kc.PUNCTUATION,role:Yc.QUOTES},{set:["3b","204f","2a1f","2a3e","fe14","fe54","ff1b"],type:Kc.PUNCTUATION,role:Yc.SEMICOLON},{set:["3f","203d","fe16","fe56","ff1f"],type:Kc.PUNCTUATION,role:Yc.QUESTION},{set:["21","fe15","fe57","ff01"],type:Kc.PUNCTUATION,role:Yc.EXCLAMATION},{set:["5e","60","a8","aa","b4","ba","2c7",["2d8","2da"],"2040","207a","207d","207e","ff3e","ff40"],type:Kc.PUNCTUATION,role:Yc.OVERACCENT},{set:["b8","2db","2038","203f","2054","208a","208d","208e"],type:Kc.PUNCTUATION,role:Yc.UNDERACCENT},{set:["3a","2982","fe13","fe30","fe55","ff1a"],type:Kc.PUNCTUATION,role:Yc.COLON},{set:["2c","2063","fe50","ff0c"],type:Kc.PUNCTUATION,role:Yc.COMMA},{set:["2026",["22ee","22f1"],"fe19"],type:Kc.PUNCTUATION,role:Yc.ELLIPSIS},{set:["2e","fe52","ff0e"],type:Kc.PUNCTUATION,role:Yc.FULLSTOP},{set:["2d","207b","208b","2212","2796","fe63","ff0d"],type:Kc.OPERATOR,role:Yc.DASH,secondary:ed.BAR},{set:["5f","af",["2010","2015"],"203e","208b",["fe49","fe4f"],"fe58","ff3f","ffe3"],type:Kc.PUNCTUATION,role:Yc.DASH,secondary:ed.BAR},{set:["7e","2dc","2f7","303","330","334","2053","223c","223d","301c","ff5e"],type:Kc.OPERATOR,role:Yc.TILDE,secondary:ed.TILDE},{set:["27","2b9","2ba",["2032","2037"],"2057"],type:Kc.PUNCTUATION,role:Yc.PRIME},{set:["b0"],type:Kc.PUNCTUATION,role:Yc.DEGREE},{set:["2b","b1","2064","2213","2214","2228","222a",["228c","228e"],"2294","2295","229d","229e","22bb","22bd","22c4","22ce","22d3","2304","271b","271c","2795","27cf","29fa","29fb","29fe",["2a22","2a28"],"2a2d","2a2e","2a39","2a42","2a45","2a46","2a48","2a4a","2a4c","2a4f","2a50","2a52","2a54","2a56","2a57","2a59","2a5b","2a5d",["2a61","2a63"],"2adc","2add","fe62","ff0b"],type:Kc.OPERATOR,role:Yc.ADDITION},{set:["2a","b7","d7","2020","2021","204e","2051","2062",["2217","2219"],"2227","2229","2240","2293","2297",["2299","229b"],"22a0","22a1","22b9","22bc",["22c5","22cc"],"22cf","22d2","22d4","2303","2305","2306","25cb","2715","2716","27ce","27d1",["29d1","29d7"],"29e2","2a1d",["2a2f","2a37"],["2a3b","2a3d"],"2a40","2a43","2a44","2a47","2a49","2a4b","2a4d","2a4e","2a51","2a53","2a55","2a58","2a5a","2a5c",["2a5e","2a60"],"2ada","2adb","fe61","ff0a"],type:Kc.OPERATOR,role:Yc.MULTIPLICATION},{set:["2d","af","2010","2011","2052","207b","208b","2212","2216","2238","2242","2296","229f","2796","29ff",["2a29","2a2c"],"2a3a","2a41","fe63","ff0d"],type:Kc.OPERATOR,role:Yc.SUBTRACTION},{set:["2f","f7","2044","2215","2298","2797","27cc","29bc",["29f5","29f9"],"2a38"],type:Kc.OPERATOR,role:Yc.DIVISION},{set:["25","2030","2031","ff05","fe6a"],type:Kc.OPERATOR,role:Yc.POSTFIXOP},{set:["ac","2200","2201","2203","2204","2206",["221a","221c"],"2310","ffe2"],type:Kc.OPERATOR,role:Yc.PREFIXOP},{set:["2320","2321","23aa","23ae","23af","23b2","23b3","23b6","23b7"],type:Kc.OPERATOR,role:Yc.PREFIXOP},{set:["1d7ca","1d7cb"],type:Kc.OPERATOR,role:Yc.PREFIXOP,font:Zc.BOLD},{set:["3d","7e","207c","208c","221d","2237",["223a","223f"],"2243","2245","2248",["224a","224e"],["2251","225f"],"2261","2263","229c","22cd","22d5","29e4","29e6","2a66","2a67",["2a6a","2a6c"],["2a6c","2a78"],"fe66","ff1d"],type:Kc.RELATION,role:Yc.EQUALITY},{set:["3c","3e","2241","2242","2244","2246","2247","2249","224f","2250","2260","2262",["2264","2281"],"22b0","22b1",["22d6","22e1"],["22e6","22e9"],["2976","2978"],"29c0","29c1","29e1","29e3","29e5",["2a79","2abc"],["2af7","2afa"],"fe64","fe65","ff1c","ff1e"],type:Kc.RELATION,role:Yc.INEQUALITY},{set:[["2282","228b"],["228f","2292"],["22b2","22b8"],"22d0","22d1",["22e2","22e5"],["22ea","22ed"],"27c3","27c4",["27c7","27c9"],["27d5","27d7"],"27dc",["2979","297b"],"29df",["2abd","2ad8"]],type:Kc.RELATION,role:Yc.SET},{set:["2236",["27e0","27e5"],"292b","292c",["29b5","29bb"],"29be","29bf",["29c2","29d0"]],type:Kc.RELATION,role:Yc.UNKNOWN},{set:["2205",["29b0","29b4"]],type:Kc.IDENTIFIER,role:Yc.SETEMPTY},{set:["1ab2","221e",["29dc","29de"]],type:Kc.IDENTIFIER,role:Yc.INFTY},{set:["22a2","22a3",["22a6","22af"],"27da","27db","27dd","27de","2ade",["2ae2","2ae6"],"2aec","2aed"],type:Kc.RELATION,role:Yc.LOGIC},{set:["22a4","22a5","22ba","27d8","27d9","27df","2adf","2ae0",["2ae7","2aeb"],"2af1"],type:Kc.IDENTIFIER,role:Yc.LOGIC},{set:[["2190","21ff"],"2301","2324","238b","2794",["2798","27af"],["27b1","27be"],["27f0","27ff"],["2900","292a"],["292d","2975"],["297c","297f"],["2b00","2b11"],["2b30","2b4c"],["ffe9","ffec"]],type:Kc.RELATION,role:Yc.ARROW},{set:["2208","220a",["22f2","22f9"],"22ff","27d2","2ad9"],type:Kc.OPERATOR,role:Yc.ELEMENT},{set:["2209"],type:Kc.OPERATOR,role:Yc.NONELEMENT},{set:["220b","220d",["22fa","22fe"]],type:Kc.OPERATOR,role:Yc.REELEMENT},{set:["220c"],type:Kc.OPERATOR,role:Yc.RENONELEMENT},{set:[["220f","2211"],["22c0","22c3"],["2a00","2a0b"],"2a3f","2afc","2aff"],type:Kc.LARGEOP,role:Yc.SUM},{set:["2140"],type:Kc.LARGEOP,role:Yc.SUM,font:Zc.DOUBLESTRUCK},{set:[["222b","2233"],["2a0c","2a17"],["2a17","2a1c"]],type:Kc.LARGEOP,role:Yc.INTEGRAL},{set:[["2500","257F"]],type:Kc.RELATION,role:Yc.BOX},{set:[["2580","259F"]],type:Kc.IDENTIFIER,role:Yc.BLOCK},{set:[["25A0","25FF"],["2B12","2B2F"],["2B50","2B59"]],type:Kc.RELATION,role:Yc.GEOMETRY},{set:["220e","2300","2302","2311","29bd","29e0",["29e8","29f3"],"2a1e","2afe","ffed","ffee"],type:Kc.OPERATOR,role:Yc.GEOMETRY},{set:[["221f","2222"],"22be","22bf",["2312","2314"],"237c","27c0",["299b","29af"]],type:Kc.OPERATOR,role:Yc.GEOMETRY},{set:["24",["a2","a5"],"b5","2123",["2125","2127"],"212a","212b","fe69","ff04","ffe0","ffe1","ffe5","ffe6"],type:Kc.IDENTIFIER,role:Yc.UNKNOWN},{set:["a9","ae","210f","2114","2116","2117",["211e","2122"],"212e","2132",["2139","213b"],["2141","2144"],"214d","214e",["1f12a","1f12c"],"1f18a"],type:Kc.IDENTIFIER,role:Yc.OTHERLETTER},{set:["2224","2226","2239","2307","27b0","27bf","27c1","27c2","27ca","27cb","27cd","27d0","27d3","27d4","2981","2999","299a","29e7","29f4","2a20","2a21","2a64","2a65","2a68","2a69","2ae1",["2aee","2af0"],"2af2","2af3","2af5","2af6","2afb","2afd"],type:Kc.OPERATOR,role:Yc.UNKNOWN},{set:["2605","2606","26aa","26ab",["2720","274d"]],type:Kc.OPERATOR,role:Yc.UNKNOWN},{set:[["2145","2149"]],type:Kc.IDENTIFIER,role:Yc.LATINLETTER,font:Zc.DOUBLESTRUCKITALIC,secondary:ed.ALLLETTERS},{set:[["213c","213f"]],type:Kc.IDENTIFIER,role:Yc.GREEKLETTER,font:Zc.DOUBLESTRUCK,secondary:ed.ALLLETTERS},{set:["3d0","3d7","3f6",["1d26","1d2a"],"1d5e","1d60",["1d66","1d6a"]],type:Kc.IDENTIFIER,role:Yc.GREEKLETTER,font:Zc.NORMAL,secondary:ed.ALLLETTERS},{set:[["2135","2138"]],type:Kc.IDENTIFIER,role:Yc.OTHERLETTER,font:Zc.NORMAL,secondary:ed.ALLLETTERS},{set:["131","237"],type:Kc.IDENTIFIER,role:Yc.LATINLETTER,font:Zc.NORMAL},{set:["1d6a4","1d6a5"],type:Kc.IDENTIFIER,role:Yc.LATINLETTER,font:Zc.ITALIC},{set:["2113","2118"],type:Kc.IDENTIFIER,role:Yc.LATINLETTER,font:Zc.SCRIPT},{set:[["c0","d6"],["d8","f6"],["f8","1bf"],["1c4","2af"],["1d00","1d25"],["1d6b","1d9a"],["1e00","1ef9"],["363","36f"],["1dd3","1de6"],["1d62","1d65"],"1dca","2071","207f",["2090","209c"],"2c7c"],type:Kc.IDENTIFIER,role:Yc.LATINLETTER,font:Zc.NORMAL},{set:[["00bc","00be"],["2150","215f"],"2189"],type:Kc.NUMBER,role:Yc.FLOAT},{set:["23E8",["3248","324f"]],type:Kc.NUMBER,role:Yc.INTEGER},{set:[["214A","214C"],"2705","2713","2714","2717","2718"],type:Kc.IDENTIFIER,role:Yc.UNKNOWN},{set:["20","a0","ad",["2000","200f"],["2028","202f"],["205f","2060"],"206a","206b","206e","206f","feff",["fff9","fffb"]],type:Kc.TEXT,role:Yc.SPACE},{set:["7c","a6","2223","23b8","23b9","23d0","2758",["fe31","fe34"],"ff5c","ffe4","ffe8"],type:Kc.FENCE,role:Yc.NEUTRAL},{set:["2016","2225","2980","2af4"],type:Kc.FENCE,role:Yc.METRIC}].forEach(t=>{var{set:e}=t,s=sd(t,["set"]);return ad(function(t){let e=[];for(const s of t)Array.isArray(s)?e=e.concat(qc(s)):e.push(String.fromCodePoint(parseInt(s,16)));return e}(e),s)}),ld(od.FencesVert,["23b4",["23dc","23e1"],["fe35","fe44"],"fe47"]),ld(od.FencesHoriz,["28","2045","207D","208D",["2308","230f"],["231c","231f"],"2329","23b0",["2768","2775"],"27c5",["27e6","27ef"],["2983","2998"],["29d8","29db"],"29fc",["2e22","2e29"],["3008","3011"],["3014","301b"],"fd3e","fe17",["fe59","fe5e"],"ff08","ff5f","ff62"]),ld(od.FencesHoriz,["5b","7b","ff3b","ff5b"],2),ld(od.FencesHoriz,[["239b","23a6"]],3),ld(od.FencesHoriz,[["23a7","23a9"]],4),ad([...od.FencesHoriz.keys()],{type:Kc.FENCE,role:Yc.OPEN}),ad([...od.FencesHoriz.values()],{type:Kc.FENCE,role:Yc.CLOSE}),ad([...od.FencesVert.keys()],{type:Kc.FENCE,role:Yc.TOP}),ad([...od.FencesVert.values()],{type:Kc.FENCE,role:Yc.BOTTOM}),md(hd,ed.PAREN),md(dd,ed.CURLY),md(cd,ed.BRACKET),md(ud,ed.CEIL),md(pd,ed.FLOOR),function(){for(const[t,e]of Object.entries(Zc)){const s=!!Uc[t]?Zc.UNKNOWN:e===Zc.FULLWIDTH?Zc.NORMAL:e;gd(Hc.LATINCAP,Kc.IDENTIFIER,Yc.LATINLETTER,e,s,[ed.ALLLETTERS]),gd(Hc.LATINSMALL,Kc.IDENTIFIER,Yc.LATINLETTER,e,s,[ed.ALLLETTERS],{},{3:ed.D}),gd(Hc.GREEKCAP,Kc.IDENTIFIER,Yc.GREEKLETTER,e,s,[ed.ALLLETTERS]),gd(Hc.GREEKSMALL,Kc.IDENTIFIER,Yc.GREEKLETTER,e,s,[ed.ALLLETTERS],{0:{type:Kc.OPERATOR,role:Yc.PREFIXOP,font:s},26:{type:Kc.OPERATOR,role:Yc.PREFIXOP,font:s}}),gd(Hc.DIGIT,Kc.NUMBER,Yc.INTEGER,e,s)}}(),ad(["inf","lim","liminf","limsup","max","min","sup","injlim","projlim"],{type:Kc.FUNCTION,role:Yc.LIMFUNC}),ad(fd,{type:Kc.FUNCTION,role:Yc.PREFIXFUNC}),ad(["mod","rem"],{type:Kc.OPERATOR,role:Yc.PREFIXFUNC});const bd=[];function Ed(t,e){for(let s,i=0;s=bd[i];i++){const i=s.compare(t,e);if(0!==i)return i}return 0}function xd(t){if(t.length<=1)return t;const e=t.slice();!function(t){t.sort(Ed)}(e);const s=[];let i;do{i=e.pop(),s.push(i)}while(i&&e.length&&0===Ed(e[e.length-1],i));return s}function yd(t,e){return t.match(/^.+:.+$/)||!e?t:t+":"+e}new class{constructor(t,e=null){this.comparator=t,this.type=e,function(t){bd.push(t)}(this)}compare(t,e){return this.type&&this.type===t.type&&this.type===e.type?this.comparator(t,e):0}}(function(t,e){return t.role===Yc.SIMPLEFUNC?1:e.role===Yc.SIMPLEFUNC?-1:0},Kc.IDENTIFIER);class Nd extends Map{set(t,e){return super.set(yd(t,e.font),e),this}setNode(t){this.set(t.textContent,t.meaning())}get(t,e=null){return super.get(yd(t,e))}getNode(t){return this.get(t.textContent,t.font)}}class Td extends Map{add(t,e){const s=this.get(t);s?s.push(e):super.set(t,[e])}get(t,e=null){return super.get(yd(t,e))}getNode(t){return this.get(t.textContent,t.font)}minimize(){for(const[t,e]of this)1===e.length&&this.delete(t)}isMultiValued(){for(const t of this.values())if(t.length>1)return!0;return!1}}class vd extends Td{add(t,e){super.add(yd(t,e.font),e)}addNode(t){this.add(t.textContent,t)}toString(){const t=[];for(const[e,s]of this){const i=Array(e.length+3).join(" "),n=s.map(t=>t.toString()).join("\n"+i);t.push(e+": "+n)}return t.join("\n")}collateMeaning(){const t=new Ld;for(const[e,s]of this)t.set(e,s.map(t=>t.meaning()));return t}}class Ld extends Td{add(t,e){const s=this.get(t,e.font);s&&s.find(function(t){return i=e,(s=t).type===i.type&&s.role===i.role&&s.font===i.font;var s,i})||super.add(yd(t,e.font),e)}addNode(t){this.add(t.textContent,t.meaning())}toString(){const t=[];for(const[e,s]of this){const i=Array(e.length+3).join(" "),n=s.map(t=>`{type: ${t.type}, role: ${t.role}, font: ${t.font}}`).join("\n"+i);t.push(e+": "+n)}return t.join("\n")}reduce(){for(const[t,e]of this)1!==e.length&&this.set(t,xd(e))}default(){const t=new Nd;for(const[e,s]of this)1===s.length&&t.set(e,s[0]);return t}newDefault(){const t=this.default();this.reduce();const e=this.default();return t.size!==e.size?e:null}}var Cd;!function(t){t.ANNOTATION="ANNOTATION",t.ANNOTATIONXML="ANNOTATION-XML",t.MACTION="MACTION",t.MALIGNGROUP="MALIGNGROUP",t.MALIGNMARK="MALIGNMARK",t.MATH="MATH",t.MENCLOSE="MENCLOSE",t.MERROR="MERROR",t.MFENCED="MFENCED",t.MFRAC="MFRAC",t.MGLYPH="MGLYPH",t.MI="MI",t.MLABELEDTR="MLABELEDTR",t.MMULTISCRIPTS="MMULTISCRIPTS",t.MN="MN",t.MO="MO",t.MOVER="MOVER",t.MPADDED="MPADDED",t.MPHANTOM="MPHANTOM",t.MPRESCRIPTS="MPRESCRIPTS",t.MROOT="MROOT",t.MROW="MROW",t.MS="MS",t.MSPACE="MSPACE",t.MSQRT="MSQRT",t.MSTYLE="MSTYLE",t.MSUB="MSUB",t.MSUBSUP="MSUBSUP",t.MSUP="MSUP",t.MTABLE="MTABLE",t.MTD="MTD",t.MTEXT="MTEXT",t.MTR="MTR",t.MUNDER="MUNDER",t.MUNDEROVER="MUNDEROVER",t.NONE="NONE",t.SEMANTICS="SEMANTICS"}(Cd||(Cd={}));const Rd=Object.values(Cd),Id=[Cd.MO,Cd.MI,Cd.MN,Cd.MTEXT,Cd.MS,Cd.MSPACE],Sd=[Cd.MERROR,Cd.MPHANTOM,Cd.MALIGNGROUP,Cd.MALIGNMARK,Cd.MPRESCRIPTS,Cd.ANNOTATION,Cd.ANNOTATIONXML],Ad=[Cd.MATH,Cd.MROW,Cd.MPADDED,Cd.MACTION,Cd.NONE,Cd.MSTYLE,Cd.SEMANTICS],wd=[Cd.MFRAC,Cd.MSUP,Cd.MSUB,Cd.MSUBSUP,Cd.MOVER,Cd.MUNDER,Cd.MUNDEROVER,Cd.MROOT,Cd.MMULTISCRIPTS],Od=[Cd.MROOT,Cd.MSQRT],Md=["aria-label","exact-speech","alt"];function Dd(t){return!!t&&Oc(t)===Cd.MATH}function kd(t){return!!t&&(Sd.includes(Oc(t))||!Rd.includes(Oc(t)))}function Pd(t){return!!t&&Ad.includes(Oc(t))}function Bd(t){return!!t&&Oc(t)===Cd.MGLYPH&&!function(t){return!!t&&Id.includes(Oc(t))}(t.parentNode)}function jd(t){return wd.includes(Oc(t))}const _d=1e4;function Fd(t,e){let s=0;return()=>{if(++s>t)throw new fc("function"==typeof e?e():e)}}function Ud(t,e){if(!t)return!1;const s=Fd(_d,"isDescendant cycle");let i=t.parentNode;for(;i;){if(s(),i===e)return!0;i=i.parentNode}return!1}function Hd(t){const e=[];for(let s,i=0;s=t[i];i++){if(s.nodeType!==vc.ELEMENT_NODE)continue;const t=Oc(s);Sd.includes(t)||(Ad.includes(t)&&0===s.childNodes.length||e.push(s))}return e}function Wd(t,e){var s;if(null===(s=e.attributes)||void 0===s?void 0:s.length){const s=e.attributes;for(let e=s.length-1;e>=0;e--){const i=s[e].name;i.match(/^ext/)&&(t.attributes[i]=s[e].value,t.nobreaking=!0),Md.includes(i)&&(t.attributes["ext-speech"]=s[e].value,t.nobreaking=!0),"href"===i&&(t.attributes.href=s[e].value,t.nobreaking=!0),"data-latex"!==i.toLowerCase()&&"latex"!==i.toLowerCase()||(t.attributes.latex=s[e].value),i.match(/texclass$/)&&(t.attributes.texclass=s[e].value),"color"!==i&&"mathcolor"!==i||(t.attributes.color=s[e].value)}}}function Vd(t){return t&&t.embellished&&t.childNodes.length>0?Vd(t.childNodes[0]):t}function qd(t,e,s){s&&t.reverse();const i=[];for(let n,r=0;n=t[r];r++){if(e(n))return s?{head:t.slice(r+1).reverse(),div:n,tail:i.reverse()}:{head:i,div:n,tail:t.slice(r+1)};i.push(n)}return s?{head:[],div:null,tail:i.reverse()}:{head:i,div:null,tail:[]}}function Xd(t,e){let s=t;const i=[],n=[];let r=null;do{r=qd(s,e),n.push(r.head),i.push(r.div),s=r.tail}while(r.div);return i.pop(),{rel:i,comp:n}}function zd(t,e){if(t.mathmlTree)return;const s=new Set;if(e.forEach(t=>{var e;return s.add((null===(e=t.mathmlTree)||void 0===e?void 0:e.parentElement)||null)}),1===s.size&&!s.has(null)){const i=[...s][0];return Pd(i)&&i.childNodes.length===e.length?void(t.mathmlTree=i):void 0}if(s.has(null)&&s.size<=2&&(s.delete(null),e.forEach(t=>{if(!t.mathmlTree){const e=new Set(t.mathml);t.mathml.forEach(t=>{t.parentElement&&!function(t,e){let s=t.parentElement;for(;s;){if(e.has(s))return!0;s=s.parentElement}return!1}(t,e)&&s.add(t.parentElement)})}})),1===s.size&&!s.has(null)){const e=[...s][0];if(Pd(e)&&Lc(e.childNodes).every(e=>t.mathml.includes(e)))return void(t.mathmlTree=e)}}function Gd(t){if(!t||Oc(t)!==Cd.MSPACE)return!1;const e=t.getAttribute("width"),s=e&&e.match(/[a-z]*$/);if(!s)return!1;const i=s[0],n=parseFloat(e.slice(0,s.index)),r={cm:.4,pc:.5,em:.5,ex:1,in:.15,pt:5,mm:5}[i];return!(!r||isNaN(n)||n<r)}var Jd;!function(t){t.EMBELLISHED="embellished",t.FENCEPOINTER="fencepointer",t.FONT="font",t.ID="id",t.ANNOTATION="annotation",t.ROLE="role",t.TYPE="type",t.CHILDREN="children",t.CONTENT="content",t.TEXT="$t"}(Jd||(Jd={}));class Kd{static fromXml(t){const e=parseInt(t.getAttribute("id"),10),s=new Kd(e);return s.type=t.tagName,Kd.setAttribute(s,t,"role"),Kd.setAttribute(s,t,"font"),Kd.setAttribute(s,t,"embellished"),Kd.setAttribute(s,t,"fencepointer","fencePointer"),t.getAttribute("annotation")&&s.parseAnnotation(t.getAttribute("annotation")),Wd(s,t),Kd.processChildren(s,t),s}static setAttribute(t,e,s,i){i=i||s;const n=e.getAttribute(s);n&&(t[i]=n)}static processChildren(t,e){for(const s of Lc(e.childNodes)){if(s.nodeType===vc.TEXT_NODE){t.textContent=s.textContent;continue}const e=Lc(s.childNodes).map(Kd.fromXml);e.forEach(e=>e.parent=t),"CONTENT"===Oc(s)?t.contentNodes=e:t.childNodes=e}}constructor(t){this.id=t,this.mathml=[],this.parent=null,this.type=Kc.UNKNOWN,this.role=Yc.UNKNOWN,this.font=Zc.UNKNOWN,this.embellished=null,this.fencePointer="",this.childNodes=[],this.textContent="",this.mathmlTree=null,this.contentNodes=[],this.annotation={},this.attributes={},this.nobreaking=!1,this.noupdate=!1}querySelectorAll(t){let e=[];for(let s,i=0;s=this.childNodes[i];i++)e=e.concat(s.querySelectorAll(t));for(let s,i=0;s=this.contentNodes[i];i++)e=e.concat(s.querySelectorAll(t));return t(this)&&e.unshift(this),e}xml(t,e){const s=function(s,i){const n=i.map(function(s){return s.xml(t,e)}),r=t.createElementNS("",s);for(let t,e=0;t=n[e];e++)r.appendChild(t);return r},i=t.createElementNS("",this.type);return e||this.xmlAttributes(i),i.textContent=this.textContent,this.contentNodes.length>0&&i.appendChild(s(Jd.CONTENT,this.contentNodes)),this.childNodes.length>0&&i.appendChild(s(Jd.CHILDREN,this.childNodes)),i}toString(t=!1){const e=Cc("<snode/>");return Mc(this.xml(e.ownerDocument,t))}allAttributes(){const t=[];return t.push([Jd.ROLE,this.role]),this.font!==Zc.UNKNOWN&&t.push([Jd.FONT,this.font]),Object.keys(this.annotation).length&&t.push([Jd.ANNOTATION,this.annotationXml()]),this.embellished&&t.push([Jd.EMBELLISHED,this.embellished]),this.fencePointer&&t.push([Jd.FENCEPOINTER,this.fencePointer]),t.push([Jd.ID,this.id.toString()]),t}annotationXml(){const t=[];for(const[e,s]of Object.entries(this.annotation))s.forEach(s=>t.push(e+":"+s));return t.join(";")}attributesXml(){const t=[];for(const[e,s]of Object.entries(this.attributes))t.push(e+":"+Kd.escapeValue(s));return t.join(";")}toJson(){const t={};t[Jd.TYPE]=this.type;const e=this.allAttributes();for(let s,i=0;s=e[i];i++)t[s[0]]=s[1].toString();return this.textContent&&(t[Jd.TEXT]=this.textContent),this.childNodes.length&&(t[Jd.CHILDREN]=this.childNodes.map(function(t){return t.toJson()})),this.contentNodes.length&&(t[Jd.CONTENT]=this.contentNodes.map(function(t){return t.toJson()})),t}updateContent(t,e){const s=e?t.replace(/^[ \f\n\r\t\v\u200b]*/,"").replace(/[ \f\n\r\t\v\u200b]*$/,""):t.trim();if(t=t&&!s?t:s,this.textContent===t)return;const i=od.Meaning.get(t.replace(/\s/g," "));this.textContent=t,this.role=i.role,this.type=i.type,this.font=i.font}addMathmlNodes(t){for(let e,s=0;e=t[s];s++)-1===this.mathml.indexOf(e)&&this.mathml.push(e)}appendChild(t){this.childNodes.push(t),this.addMathmlNodes(t.mathml),t.parent=this}replaceChild(t,e){const s=this.childNodes.indexOf(t);if(-1===s)return;t.parent=null,e.parent=this,this.childNodes[s]=e;const i=t.mathml.filter(function(t){return-1===e.mathml.indexOf(t)}),n=e.mathml.filter(function(e){return-1===t.mathml.indexOf(e)});this.removeMathmlNodes(i),this.addMathmlNodes(n)}appendContentNode(t){t&&(this.contentNodes.push(t),this.addMathmlNodes(t.mathml),t.parent=this)}removeContentNode(t){if(t){const e=this.contentNodes.indexOf(t);-1!==e&&this.contentNodes.slice(e,1)}}equals(t){if(!t)return!1;if(this.type!==t.type||this.role!==t.role||this.textContent!==t.textContent||this.childNodes.length!==t.childNodes.length||this.contentNodes.length!==t.contentNodes.length)return!1;for(let e,s,i=0;e=this.childNodes[i],s=t.childNodes[i];i++)if(!e.equals(s))return!1;for(let e,s,i=0;e=this.contentNodes[i],s=t.contentNodes[i];i++)if(!e.equals(s))return!1;return!0}displayTree(){console.info(this.displayTree_(0))}addAnnotation(t,e){e&&this.addAnnotation_(t,e)}getAnnotation(t){const e=this.annotation[t];return e||[]}hasAnnotation(t,e){const s=this.annotation[t];return!!s&&-1!==s.indexOf(e)}parseAnnotation(t){const e=t.split(";");for(let t=0,s=e.length;t<s;t++){const s=e[t].split(":");this.addAnnotation(s[0],s[1])}}meaning(){return{type:this.type,role:this.role,font:this.font}}xmlAttributes(t){const e=this.allAttributes();for(let s,i=0;s=e[i];i++)t.setAttribute(s[0],s[1]);this.addExternalAttributes(t)}addExternalAttributes(t){for(const[e,s]of Object.entries(this.attributes))t.setAttribute(e,s)}static escapeValue(t){return t.replace(/;/g,"\\0003B")}parseAttributes(t){if(!t)return;const e=t.split(";");for(let t=0,s=e.length;t<s;t++){const[s,...i]=e[t].split(":");s&&(this.attributes[s]=i.join(":").replace(/\\0003B/g,";"))}}removeMathmlNodes(t){const e=this.mathml;for(let s,i=0;s=t[i];i++){const t=e.indexOf(s);-1!==t&&e.splice(t,1)}this.mathml=e}displayTree_(t){t++;const e=Array(t).join(" ");let s="";s+="\n"+e+this.toString(),s+="\n"+e+"MathmlTree:",s+="\n"+e+this.mathmlTreeString(),s+="\n"+e+"MathML:";for(let t,i=0;t=this.mathml[i];i++)s+="\n"+e+t.toString();return s+="\n"+e+"Begin Content",this.contentNodes.forEach(function(e){s+=e.displayTree_(t)}),s+="\n"+e+"End Content",s+="\n"+e+"Begin Children",this.childNodes.forEach(function(e){s+=e.displayTree_(t)}),s+="\n"+e+"End Children",s}mathmlTreeString(){return this.mathmlTree?this.mathmlTree.toString():"EMPTY"}addAnnotation_(t,e){const s=this.annotation[t];s&&!s.includes(e)?s.push(e):this.annotation[t]=[e]}}class $d{constructor(){this.leafMap=new vd,this.defaultMap=new Nd,this.idCounter_=-1}makeNode(t){return this.createNode_(t)}makeUnprocessed(t){const e=this.createNode_();return e.addMathmlNodes([t]),e.mathmlTree=t,e}makeEmptyNode(){const t=this.createNode_();return t.type=Kc.EMPTY,t}makeContentNode(t){const e=this.createNode_();return e.updateContent(t),e}makeMultipleContentNodes(t,e){const s=[];for(let i=0;i<t;i++)s.push(this.makeContentNode(e));return s}makeLeafNode(t,e){if(!t)return this.makeEmptyNode();const s=this.makeContentNode(t);s.font=e||s.font;const i=this.defaultMap.getNode(s);return i&&(s.type=i.type,s.role=i.role,s.font=i.font),this.leafMap.addNode(s),s}makeBranchNode(t,e,s,i){const n=this.createNode_();return i&&n.updateContent(i),n.type=t,n.childNodes=e,n.contentNodes=s,e.concat(s).forEach(function(t){t.parent=n,n.addMathmlNodes(t.mathml)}),n}createNode_(t){return void 0!==t?this.idCounter_=Math.max(this.idCounter_,t):t=++this.idCounter_,new Kd(t)}}class Yd{constructor(t){this.type=t,this.factory_=new $d}getFactory(){return this.factory_}setFactory(t){this.factory_=t}getType(){return this.type}parseList(t){const e=[];for(let s,i=0;s=t[i];i++)e.push(this.parse(s));return e}}function Qd(t,e){return t.type===e}function Zd(t,e){return t.embellished===e}function tu(t,e){return t.role===e}function eu(t){return Qd(t,Kc.FENCE)||Qd(t,Kc.PUNCTUATION)||Qd(t,Kc.OPERATOR)||Qd(t,Kc.RELATION)}function su(t){return lu(t)&&!tu(t,Yc.DIVISION)||Qd(t,Kc.APPL)||ou(t)}function iu(t){return lu(t)||ou(t)}function nu(t,e){return!!e&&Qd(e,Kc.IDENTIFIER)&&od.Secondary.has(t.textContent,ed.D)}function ru(t){if(Qd(t,Kc.IDENTIFIER)){const e=t.textContent[0];return e&&t.textContent[1]&&od.Secondary.has(e,ed.D)}return!1}function ou(t){return hu(t)||cu(t)}function au(t){return t.embellished?t.embellished:(e=t.type)===Kc.OPERATOR||e===Kc.RELATION||e===Kc.FENCE||e===Kc.PUNCTUATION?t.type:null;var e}function lu(t){return Qd(t,Kc.OPERATOR)||Zd(t,Kc.OPERATOR)}function hu(t){return Qd(t,Kc.RELATION)||Zd(t,Kc.RELATION)}function cu(t){return Qd(t,Kc.PUNCTUATION)||Zd(t,Kc.PUNCTUATION)}function du(t){return Qd(t,Kc.FENCE)||Zd(t,Kc.FENCE)}function uu(t){return!(!t||!du(t))&&(!t.embellished||pu(t))}function pu(t){return!t.embellished||!function(t){return Qd(t,Kc.TENSOR)&&(!Qd(t.childNodes[1],Kc.EMPTY)||!Qd(t.childNodes[2],Kc.EMPTY))&&(!Qd(t.childNodes[3],Kc.EMPTY)||!Qd(t.childNodes[4],Kc.EMPTY))}(t)&&((!tu(t,Yc.CLOSE)||!Qd(t,Kc.TENSOR))&&((!tu(t,Yc.OPEN)||!Qd(t,Kc.SUBSCRIPT)&&!Qd(t,Kc.SUPERSCRIPT))&&pu(t.childNodes[0])))}function mu(t){return!!t&&(Qd(t,Kc.TABLE)||Qd(t,Kc.MULTILINE))}function fu(t){return!!t&&gu(t)&&mu(t.childNodes[0])}function gu(t){return!!t&&Qd(t,Kc.FENCED)&&(tu(t,Yc.LEFTRIGHT)||Ou(t))&&1===t.childNodes.length}function bu(t,e){return e.length>0&&tu(e[e.length-1],Yc.OPENFENCE)}function Eu(t){return t.childNodes.every(function(t){return t.childNodes.length<=1})}function xu(t){return Qd(t,Kc.LINE)&&t.contentNodes.length&&tu(t.contentNodes[0],Yc.LABEL)}function yu(t){return Qd(t,Kc.LARGEOP)||Qd(t,Kc.LIMBOTH)||Qd(t,Kc.LIMLOWER)||Qd(t,Kc.LIMUPPER)||Qd(t,Kc.FUNCTION)&&tu(t,Yc.LIMFUNC)||(Qd(t,Kc.OVERSCORE)||Qd(t,Kc.UNDERSCORE))&&yu(t.childNodes[0])}function Nu(t,e,s){return 1===e.length&&(t[s].type===Kc.PUNCTUATION||t[s].embellished===Kc.PUNCTUATION)&&t[s]===e[0]}function Tu(t){return Qd(t,Kc.IDENTIFIER)&&tu(t,Yc.SIMPLEFUNC)}const vu=[Kc.PUNCTUATION,Kc.PUNCTUATED,Kc.RELSEQ,Kc.MULTIREL,Kc.TABLE,Kc.MULTILINE,Kc.CASES,Kc.INFERENCE],Lu=[Kc.LIMUPPER,Kc.LIMLOWER,Kc.LIMBOTH,Kc.SUBSCRIPT,Kc.SUPERSCRIPT,Kc.UNDERSCORE,Kc.OVERSCORE,Kc.TENSOR];function Cu(t){const e=t.type;return-1===vu.indexOf(e)&&(e!==Kc.INFIXOP||t.role===Yc.IMPLICIT)&&(e===Kc.FENCED?t.role!==Yc.LEFTRIGHT||Cu(t.childNodes[0]):-1===Lu.indexOf(e)||Cu(t.childNodes[0]))}function Ru(t){return function(t){return t.type===Kc.NUMBER&&(t.role===Yc.INTEGER||t.role===Yc.FLOAT)}(t)||t.role===Yc.VULGAR||t.role===Yc.MIXED}function Iu(t){const e=t.childNodes;return t.role===Yc.UNIT&&(!e.length||e[0].role===Yc.UNIT)}function Su(t){const e=t.childNodes;return t.type===Kc.INFIXOP&&(t.role===Yc.MULTIPLICATION||t.role===Yc.IMPLICIT)&&e.length&&(Iu(e[0])||Ru(e[0]))&&t.childNodes.slice(1).every(Iu)}function Au(t){return t.type===Kc.INFIXOP&&(t.role===Yc.IMPLICIT||t.role===Yc.UNIT&&!!t.contentNodes.length&&t.contentNodes[0].textContent===id.invisibleTimes)}function wu(t){return t.type===Kc.INFIXOP&&t.role===Yc.IMPLICIT}function Ou(t){return t.role===Yc.NEUTRAL||t.role===Yc.METRIC}function Mu(t,e){return Ou(t)&&Ou(e)&&Vd(t).textContent===Vd(e).textContent}function Du(t){return!!Ou(t)&&(!t.embellished||t.type!==Kc.SUPERSCRIPT&&t.type!==Kc.SUBSCRIPT&&(t.type!==Kc.TENSOR||t.childNodes[3].type===Kc.EMPTY&&t.childNodes[4].type===Kc.EMPTY))}function ku(t){return!!Ou(t)&&(!t.embellished||(t.type!==Kc.TENSOR||t.childNodes[1].type===Kc.EMPTY&&t.childNodes[2].type===Kc.EMPTY))}function Pu(t){return[Yc.ELEMENT,Yc.NONELEMENT,Yc.REELEMENT,Yc.RENONELEMENT].includes(t.role)}const Bu={factory:null,options:new uc,updateFactory:function(t){Bu.factory=t},heuristics:new Map,flags:{combine_juxtaposition:!0,convert_juxtaposition:!0,multioperator:!0},blacklist:{},add:function(t){const e=t.name;Bu.heuristics.set(e,t),Bu.flags[e]||(Bu.flags[e]=!1)},run:function(t,e,s){const i=Bu.heuristics.get(t);return i&&!Bu.blacklist[t]&&(Bu.flags[t]||i.applicable(e))?i.apply(e):s?s(e):e}};class ju{static getInstance(){return ju.instance=ju.instance||new ju,ju.instance}static tableToMultiline(t){if(!Eu(t))return Bu.run("rewrite_subcases",t,ju.classifyTable);t.type=Kc.MULTILINE;for(let e,s=0;e=t.childNodes[s];s++)ju.rowToLine_(e,Yc.MULTILINE);return 1===t.childNodes.length&&!xu(t.childNodes[0])&&gu(t.childNodes[0].childNodes[0])&&ju.tableToMatrixOrVector_(ju.rewriteFencedLine_(t)),ju.classifyMultiline(t)}static number(t){t.type!==Kc.UNKNOWN&&t.type!==Kc.IDENTIFIER||(t.type=Kc.NUMBER),ju.meaningFromContent(t,ju.numberRole_),ju.exprFont_(t)}static classifyMultiline(t){return ju.binomialForm_(t),ju.classifyMultiline_(t),t}static classifyMultiline_(t){let e=0;const s=t.childNodes.length;let i;for(;e<s&&(!(i=t.childNodes[e])||!i.childNodes.length);)e++;if(e>=s)return;const n=i.childNodes[0].role;n!==Yc.UNKNOWN&&t.childNodes.every(function(t){const e=t.childNodes[0];return!e||e.role===n&&(Qd(e,Kc.RELATION)||Qd(e,Kc.RELSEQ))})&&(t.role=n)}static classifyTable(t){const e=ju.computeColumns_(t);return ju.classifyByColumns_(t,e,Yc.EQUALITY)||ju.classifyByColumns_(t,e,Yc.INEQUALITY,[Yc.EQUALITY])||ju.classifyByColumns_(t,e,Yc.ARROW)||ju.detectCaleyTable(t),t}static detectCaleyTable(t){if(!t.mathmlTree)return!1;const e=t.mathmlTree,s=e.getAttribute("columnlines"),i=e.getAttribute("rowlines");return!(!s||!i)&&(!(!ju.cayleySpacing(s)||!ju.cayleySpacing(i))&&(t.role=Yc.CAYLEY,!0))}static cayleySpacing(t){const e=t.split(" ");return("solid"===e[0]||"dashed"===e[0])&&e.slice(1).every(t=>"none"===t)}static proof(t,e,s){const i=ju.separateSemantics(e);return ju.getInstance().proof(t,i,s)}static findSemantics(t,e,s){const i=null==s?null:s,n=ju.getSemantics(t);return!!n&&(!!n[e]&&(null==i||n[e]===i))}static getSemantics(t){const e=t.getAttribute("semantics");return e?ju.separateSemantics(e):null}static removePrefix(t){const[,...e]=t.split("_");return e.join("_")}static separateSemantics(t){const e={};return t.split(";").forEach(function(t){const[s,i]=t.split(":");e[ju.removePrefix(s)]=i}),e}static matchSpaces_(t,e){for(let s,i=0;s=e[i];i++){const e=t[i].mathmlTree,n=t[i+1].mathmlTree;if(!e||!n)continue;const r=e.nextSibling;if(!r||r===n)continue;const o=ju.getSpacer_(r);o&&o!==n&&(s.addMathmlNodes([o]),s.mathmlTree=o,s.role=Yc.SPACE)}}static getSpacer_(t){if(Oc(t)===Cd.MSPACE)return t;for(;Pd(t)&&1===t.childNodes.length;)if(Oc(t=t.childNodes[0])===Cd.MSPACE)return t;return null}static fenceToPunct_(t){const e=ju.FENCE_TO_PUNCT_[t.role];if(e){for(;t.embellished;)t.embellished=Kc.PUNCTUATION,tu(t,Yc.SUBSUP)||tu(t,Yc.UNDEROVER)||(t.role=e),t=t.childNodes[0];t.type=Kc.PUNCTUATION,t.role=e}}static classifyFunction_(t,e){if(t.type===Kc.APPL||t.type===Kc.BIGOP||t.type===Kc.INTEGRAL)return"";if(e[0]&&e[0].textContent===id.functionApplication){ju.getInstance().funcAppls[t.id]=e.shift();let s=Yc.SIMPLEFUNC;return Bu.run("simple2prefix",t),t.role!==Yc.PREFIXFUNC&&t.role!==Yc.LIMFUNC||(s=t.role),ju.propagateFunctionRole_(t,s),"prefix"}const s=ju.CLASSIFY_FUNCTION_[t.role];return s||((i=t).type===Kc.IDENTIFIER||i.role===Yc.LATINLETTER||i.role===Yc.GREEKLETTER||i.role===Yc.OTHERLETTER?"simple":"");var i}static propagateFunctionRole_(t,e){if(t){if(t.type===Kc.INFIXOP)return;tu(t,Yc.SUBSUP)||tu(t,Yc.UNDEROVER)||(t.role=e),ju.propagateFunctionRole_(t.childNodes[0],e)}}static getFunctionOp_(t,e){if(e(t))return t;for(let s,i=0;s=t.childNodes[i];i++){const t=ju.getFunctionOp_(s,e);if(t)return t}return null}static tableToMatrixOrVector_(t){const e=t.childNodes[0];Qd(e,Kc.MULTILINE)?ju.tableToVector_(t):ju.tableToMatrix_(t),t.contentNodes.forEach(e.appendContentNode.bind(e));for(let t,s=0;t=e.childNodes[s];s++)ju.assignRoleToRow_(t,ju.getComponentRoles_(e));return e.parent=null,e}static tableToVector_(t){const e=t.childNodes[0];e.type=Kc.VECTOR,1!==e.childNodes.length?ju.binomialForm_(e):ju.tableToSquare_(t)}static binomialForm_(t){tu(t,Yc.UNKNOWN)&&(2===t.childNodes.length&&(t.role=Yc.BINOMIAL,t.childNodes[0].role=Yc.BINOMIAL,t.childNodes[1].role=Yc.BINOMIAL))}static tableToMatrix_(t){const e=t.childNodes[0];e.type=Kc.MATRIX,e.childNodes&&e.childNodes.length>0&&e.childNodes[0].childNodes&&e.childNodes.length===e.childNodes[0].childNodes.length?ju.tableToSquare_(t):e.childNodes&&1===e.childNodes.length&&(e.role=Yc.ROWVECTOR)}static tableToSquare_(t){const e=t.childNodes[0];tu(e,Yc.UNKNOWN)&&(Ou(t)?e.role=Yc.DETERMINANT:e.role=Yc.SQUAREMATRIX)}static getComponentRoles_(t){const e=t.role;return e&&e!==Yc.UNKNOWN?e:t.type.toLowerCase()||Yc.UNKNOWN}static tableToCases_(t,e){for(let e,s=0;e=t.childNodes[s];s++)ju.assignRoleToRow_(e,Yc.CASES);return t.type=Kc.CASES,t.appendContentNode(e),Eu(t)&&ju.binomialForm_(t),t}static rewriteFencedLine_(t){const e=t.childNodes[0],s=t.childNodes[0].childNodes[0],i=t.childNodes[0].childNodes[0].childNodes[0];return s.parent=t.parent,t.parent=s,i.parent=e,s.childNodes=[t],e.childNodes=[i],s}static rowToLine_(t,e){const s=e||Yc.UNKNOWN;Qd(t,Kc.ROW)&&(t.type=Kc.LINE,t.role=s,1===t.childNodes.length&&Qd(t.childNodes[0],Kc.CELL)&&(t.childNodes=t.childNodes[0].childNodes,t.childNodes.forEach(function(e){e.parent=t})))}static assignRoleToRow_(t,e){Qd(t,Kc.LINE)?t.role=e:Qd(t,Kc.ROW)&&(t.role=e,t.childNodes.forEach(function(t){Qd(t,Kc.CELL)&&(t.role=e)}))}static nextSeparatorFunction_(t){let e;if(t){if(t.match(/^\s+$/))return null;e=t.replace(/\s/g,"").split("").filter(function(t){return t})}else e=[","];return function(){return e.length>1?e.shift():e[0]}}static meaningFromContent(t,e){const s=[...t.textContent].filter(t=>t.match(/[^\s]/)),i=s.map(t=>od.Meaning.get(t));e(t,s,i)}static numberRole_(t,e,s){if(t.role===Yc.UNKNOWN)return s.every(function(t){return t.type===Kc.NUMBER&&t.role===Yc.INTEGER||t.type===Kc.PUNCTUATION&&t.role===Yc.COMMA})?(t.role=Yc.INTEGER,void("0"===e[0]&&t.addAnnotation("general","basenumber"))):void(s.every(function(t){return t.type===Kc.NUMBER&&t.role===Yc.INTEGER||t.type===Kc.PUNCTUATION})?t.role=Yc.FLOAT:t.role=Yc.OTHERNUMBER)}static exprFont_(t){t.font===Zc.UNKNOWN&&ju.compSemantics(t,"font",Zc)}static compSemantics(t,e,s){const i=[...t.textContent].map(t=>od.Meaning.get(t)).reduce(function(t,i){return t&&i[e]&&i[e]!==s.UNKNOWN&&i[e]!==t?t===s.UNKNOWN?i[e]:null:t},s.UNKNOWN);i&&(t[e]=i)}static purgeFences_(t){const e=t.rel,s=t.comp,i=[],n=[];for(;e.length>0;){const t=e.shift();let r=s.shift();uu(t)?(i.push(t),n.push(r)):(ju.fenceToPunct_(t),r.push(t),r=r.concat(s.shift()),s.unshift(r))}return n.push(s.shift()),{rel:i,comp:n}}static rewriteFencedNode_(t){const e=t.contentNodes[0],s=t.contentNodes[1];let i=ju.rewriteFence_(t,e);return t.contentNodes[0]=i.fence,i=ju.rewriteFence_(i.node,s),t.contentNodes[1]=i.fence,t.contentNodes[0].parent=t,t.contentNodes[1].parent=t,function(t){const e=od.FencesSecondary.get(t.contentNodes[0].textContent),s=od.FencesSecondary.get(t.contentNodes[1].textContent);e===s&&t.addAnnotation("fences",e)}(t),i.node.parent=null,i.node}static rewriteFence_(t,e){if(!e.embellished)return{node:t,fence:e};const s=e.childNodes[0],i=ju.rewriteFence_(t,s);return Qd(e,Kc.SUPERSCRIPT)||Qd(e,Kc.SUBSCRIPT)||Qd(e,Kc.TENSOR)?(tu(e,Yc.SUBSUP)||(e.role=t.role),s!==i.node&&(e.replaceChild(s,i.node),s.parent=t),ju.propagateFencePointer_(e,s),{node:e,fence:i.fence}):(e.replaceChild(s,i.fence),e.mathmlTree&&-1===e.mathml.indexOf(e.mathmlTree)&&e.addMathmlNodes([e.mathmlTree]),{node:i.node,fence:e})}static propagateFencePointer_(t,e){t.fencePointer=e.fencePointer||e.id.toString(),t.embellished=null}static classifyByColumns_(t,e,s,i=[]){const n=[s].concat(i);return!!(3===e.length&&ju.testColumns_(e,1,t=>ju.isPureRelation_(t,n))||2===e.length&&(ju.testColumns_(e,1,t=>ju.isEndRelation_(t,n)||ju.isPureRelation_(t,n))||ju.testColumns_(e,0,t=>ju.isEndRelation_(t,n,!0)||ju.isPureRelation_(t,n))))&&(t.role=s,!0)}static isEndRelation_(t,e,s){const i=s?t.childNodes.length-1:0;return Qd(t,Kc.RELSEQ)&&e.some(e=>tu(t,e))&&Qd(t.childNodes[i],Kc.EMPTY)}static isPureRelation_(t,e){return Qd(t,Kc.RELATION)&&e.some(e=>tu(t,e))}static computeColumns_(t){const e=[];for(let s,i=0;s=t.childNodes[i];i++)for(let t,i=0;t=s.childNodes[i];i++){e[i]?e[i].push(t):e[i]=[t]}return e}static testColumns_(t,e,s){const i=t[e];return!!i&&(i.some(function(t){return t.childNodes.length&&s(t.childNodes[0])})&&i.every(function(t){return!t.childNodes.length||s(t.childNodes[0])}))}setNodeFactory(t){ju.getInstance().factory_=t,Bu.updateFactory(ju.getInstance().factory_)}getNodeFactory(){return ju.getInstance().factory_}identifierNode(t,e,s){if("MathML-Unit"!==s||(i=t,[Yc.DEGREE].includes(i.role)||[].includes(i.type))){if(!e&&1===t.textContent.length&&(t.role===Yc.INTEGER||t.role===Yc.LATINLETTER||t.role===Yc.GREEKLETTER)&&t.font===Zc.NORMAL)return t.font=Zc.ITALIC,Bu.run("simpleNamedFunction",t)}else t.type=Kc.IDENTIFIER,t.role=Yc.UNIT;var i;return t.type===Kc.UNKNOWN&&(t.type=Kc.IDENTIFIER),ju.exprFont_(t),Bu.run("simpleNamedFunction",t)}implicitNode(t){if(t=ju.getInstance().getMixedNumbers_(t),t=ju.getInstance().combineUnits_(t),1===(t=ju.getInstance().combineScripts_(t)).length)return t[0];const e=ju.getInstance().implicitNode_(t);return Bu.run("combine_juxtaposition",e)}text(t,e){if(ju.exprFont_(t),t.type=Kc.TEXT,e===Cd.ANNOTATIONXML)return t.role=Yc.ANNOTATION,t;if(e===Cd.MS)return t.role=Yc.STRING,t;if(e===Cd.MSPACE||t.textContent.match(/^\s*$/))return t.role=Yc.SPACE,t;if(/\s/.exec(t.textContent))return t.role=Yc.TEXT,t;const s=[...t.textContent];if(1!==s.length)return t.role=Yc.UNKNOWN,t;const i=od.Meaning.get(s[0]);return i.type===Kc.UNKNOWN||i.type===Kc.IDENTIFIER||(t.type=i.type,t.role=i.role,t.font=i.font,t.addAnnotation("general","text")),t}row(t,e=!1){return 0===(t=t.filter(function(t){return!Qd(t,Kc.EMPTY)||t.hasAnnotation("empty","MFENCED")||e})).length?ju.getInstance().factory_.makeEmptyNode():(t=ju.getInstance().getFencesInRow_(t),t=ju.getInstance().tablesInRow(t),t=ju.getInstance().getPunctuationInRow_(t),t=ju.getInstance().getTextInRow_(t),t=ju.getInstance().getFunctionsInRow_(t),ju.getInstance().relationsInRow_(t))}limitNode(t,e){if(!e.length)return ju.getInstance().factory_.makeEmptyNode();let s=e[0];const{length:i}=ju.MML_TO_LIMIT_[t];if(e=e.slice(0,i+1),[t,e]=ju.getInstance().cleanLimitNode(t,e,i),!e[1])return s;let{type:n,length:r}=ju.MML_TO_LIMIT_[t];if(1===r&&e[1].role===Yc.DEGREE)return ju.getInstance().row([e[0],e[1]]);if(Bu.run("op_with_limits",e),yu(s)){if(1===r&&eu(e[1])||2===r&&eu(e[1])&&eu(e[2])){const i=ju.MML_TO_BOUNDS_[t];return ju.getInstance().accentNode_(s,e,i.type,i.length,i.accent)}if(2===r){if(eu(e[1]))return s=ju.getInstance().accentNode_(s,[s,e[1]],{MSUBSUP:Kc.SUBSCRIPT,MUNDEROVER:Kc.UNDERSCORE}[t],1,!0),e[2]?ju.getInstance().makeLimitNode_(s,[s,e[2]],null,Kc.LIMUPPER):s;if(e[2]&&eu(e[2]))return s=ju.getInstance().accentNode_(s,[s,e[2]],{MSUBSUP:Kc.SUPERSCRIPT,MUNDEROVER:Kc.OVERSCORE}[t],1,!0),ju.getInstance().makeLimitNode_(s,[s,e[1]],null,Kc.LIMLOWER);e[r]||(n=Kc.LIMLOWER)}return ju.getInstance().makeLimitNode_(s,e,null,n)}const o=ju.MML_TO_BOUNDS_[t];return ju.getInstance().accentNode_(s,e,o.type,o.length,o.accent)}cleanLimitNode(t,e,s){const i=t=>(t=>!t||Qd(t,Kc.EMPTY))(t)||(t=>t&&Qd(t,Kc.TEXT)&&tu(t,Yc.SPACE))(t);if(1===s)return i(e[1])?(e[0].noupdate=!0,[t,[Fu([t],e[0])]]):[t,e];const n=e[1],r=e[2];return i(n)&&i(r)?(e[0].noupdate=!0,[t,[Fu([t],e[0])]]):i(n)?[t===Cd.MSUBSUP?Cd.MSUP:Cd.MOVER,[e[0],r]]:i(r)?[t===Cd.MSUBSUP?Cd.MSUB:Cd.MUNDER,[e[0],n]]:[t,e]}tablesInRow(t){let e=Xd(t,fu),s=[];for(let t,i=0;t=e.rel[i];i++)s=s.concat(e.comp.shift()),s.push(ju.tableToMatrixOrVector_(t));s=s.concat(e.comp.shift()),e=Xd(s,mu),s=[];for(let t,i=0;t=e.rel[i];i++){const i=e.comp.shift();bu(0,i)&&ju.tableToCases_(t,i.pop()),s=s.concat(i),(s.length||e.comp[0].length)&&(t=ju.rewriteTrivialTable(t)),s.push(t)}return s.concat(e.comp.shift())}mfenced(t,e,s,i){if(s&&i.length>0){const t=ju.nextSeparatorFunction_(s),e=[i.shift()];i.forEach(s=>{e.push(ju.getInstance().factory_.makeContentNode(t())),e.push(s)}),i=e}return t&&e?ju.getInstance().horizontalFencedNode_(ju.getInstance().factory_.makeContentNode(t),ju.getInstance().factory_.makeContentNode(e),i):(t&&i.unshift(ju.getInstance().factory_.makeContentNode(t)),e&&i.push(ju.getInstance().factory_.makeContentNode(e)),ju.getInstance().row(i))}fractionLikeNode(t,e,s,i){let n;if(!i&&function(t){if(!t)return!1;if(["negativeveryverythinmathspace","negativeverythinmathspace","negativethinmathspace","negativemediummathspace","negativethickmathspace","negativeverythickmathspace","negativeveryverythickmathspace"].includes(t))return!0;const e=t.match(/[0-9.]+/);return!!e&&0===parseFloat(e[0])}(s)){const s=ju.getInstance().factory_.makeBranchNode(Kc.LINE,[t],[]),i=ju.getInstance().factory_.makeBranchNode(Kc.LINE,[e],[]);return n=ju.getInstance().factory_.makeBranchNode(Kc.MULTILINE,[s,i],[]),ju.classifyMultiline(n)}return n=ju.getInstance().fractionNode_(t,e),i&&n.addAnnotation("general","bevelled"),n}tensor(t,e,s,i,n){const r=ju.getInstance().factory_.makeBranchNode(Kc.TENSOR,[t,ju.getInstance().scriptNode_(e,Yc.LEFTSUB),ju.getInstance().scriptNode_(s,Yc.LEFTSUPER),ju.getInstance().scriptNode_(i,Yc.RIGHTSUB),ju.getInstance().scriptNode_(n,Yc.RIGHTSUPER)],[]);return r.role=t.role,r.embellished=au(t),r}pseudoTensor(t,e,s){const i=t=>!Qd(t,Kc.EMPTY),n=e.filter(i).length,r=s.filter(i).length;if(!n&&!r)return t;const o=n?r?Cd.MSUBSUP:Cd.MSUB:Cd.MSUP,a=[t];return n&&a.push(ju.getInstance().scriptNode_(e,Yc.RIGHTSUB,!0)),r&&a.push(ju.getInstance().scriptNode_(s,Yc.RIGHTSUPER,!0)),ju.getInstance().limitNode(o,a)}font(t){const e=ju.MATHJAX_FONTS[t];return e||t}proof(t,e,s){if(e.inference||e.axiom||console.log("Noise"),e.axiom){const e=ju.getInstance().cleanInference(t.childNodes),i=e.length?ju.getInstance().factory_.makeBranchNode(Kc.INFERENCE,s(e),[]):ju.getInstance().factory_.makeEmptyNode();return i.role=Yc.AXIOM,i.mathmlTree=t,i}const i=ju.getInstance().inference(t,e,s);return e.proof&&(i.role=Yc.PROOF,i.childNodes[0].role=Yc.FINAL),i}inference(t,e,s){if(e.inferenceRule){const e=ju.getInstance().getFormulas(t,[],s);return ju.getInstance().factory_.makeBranchNode(Kc.INFERENCE,[e.conclusion,e.premises],[])}const i=e.labelledRule,n=Lc(t.childNodes),r=[];"left"!==i&&"both"!==i||r.push(ju.getInstance().getLabel(t,n,s,Yc.LEFT)),"right"!==i&&"both"!==i||r.push(ju.getInstance().getLabel(t,n,s,Yc.RIGHT));const o=ju.getInstance().getFormulas(t,n,s),a=ju.getInstance().factory_.makeBranchNode(Kc.INFERENCE,[o.conclusion,o.premises],r);return a.mathmlTree=t,a}getLabel(t,e,s,i){const n=ju.getInstance().findNestedRow(e,"prooflabel",i),r=ju.getInstance().factory_.makeBranchNode(Kc.RULELABEL,s(Lc(n.childNodes)),[]);return r.role=i,r.mathmlTree=n,r}getFormulas(t,e,s){const i=e.length?ju.getInstance().findNestedRow(e,"inferenceRule"):t,n="up"===ju.getSemantics(i).inferenceRule,r=n?i.childNodes[1]:i.childNodes[0],o=n?i.childNodes[0]:i.childNodes[1],a=r.childNodes[0].childNodes[0],l=Lc(a.childNodes[0].childNodes),h=[];let c=1;for(const t of l)c%2&&h.push(t.childNodes[0]),c++;const d=s(h),u=s(Lc(o.childNodes[0].childNodes))[0],p=ju.getInstance().factory_.makeBranchNode(Kc.PREMISES,d,[]);p.mathmlTree=a;const m=ju.getInstance().factory_.makeBranchNode(Kc.CONCLUSION,[u],[]);return m.mathmlTree=o.childNodes[0].childNodes[0],{conclusion:m,premises:p}}findNestedRow(t,e,s){return ju.getInstance().findNestedRow_(t,e,0,s)}cleanInference(t){return Lc(t).filter(function(t){return"MSPACE"!==Oc(t)})}operatorNode(t){return t.type===Kc.UNKNOWN&&(t.type=Kc.OPERATOR),Bu.run("multioperator",t)}static rewriteTrivialTable(t){return Qd(e=t,Kc.MULTILINE)&&1===e.childNodes.length&&e.childNodes[0].childNodes.length&&!xu(e.childNodes[0])?ju.getInstance().unwrapTrivialTable(t):t;var e}unwrapTrivialTable(t){if(!t.childNodes[0].childNodes.length)return ju.getInstance().factory_.makeEmptyNode();const e=t.childNodes[0].childNodes[0];return e.parent=null,Fu([Cd.MTD,Cd.MTR,Cd.MTABLE],e),e}constructor(){this.funcAppls={},this.splitRoles=new Map([[Yc.SUBTRACTION,Yc.NEGATIVE],[Yc.ADDITION,Yc.POSITIVE]]),this.splitOps=["\u2212","-","\u2010","\u2011","+"],this.factory_=new $d,Bu.updateFactory(this.factory_)}implicitNode_(t){const e=ju.getInstance().factory_.makeMultipleContentNodes(t.length-1,id.invisibleTimes);ju.matchSpaces_(t,e);const s=ju.getInstance().infixNode_(t,e[0]);return s.role=Yc.IMPLICIT,e.forEach(function(t){t.parent=s}),s.contentNodes=e,s}infixNode_(t,e){let s=ju.getInstance().factory_.makeBranchNode(Kc.INFIXOP,t,[e],Vd(e).textContent);return s.role=e.role,s=Bu.run("propagateInterval",s),Bu.run("propagateSimpleFunction",s)}explicitMixed_(t){const e=Xd(t,function(t){return t.textContent===id.invisiblePlus});if(!e.rel.length)return t;let s=[];for(let t,i=0;t=e.rel[i];i++){const n=e.comp[i],r=e.comp[i+1],o=n.length-1;if(n[o]&&r[0]&&Qd(n[o],Kc.NUMBER)&&!tu(n[o],Yc.MIXED)&&Qd(r[0],Kc.FRACTION)){const t=ju.getInstance().factory_.makeBranchNode(Kc.NUMBER,[n[o],r[0]],[]);t.role=Yc.MIXED,s=s.concat(n.slice(0,o)),s.push(t),r.shift()}else s=s.concat(n),s.push(t)}return s.concat(e.comp[e.comp.length-1])}concatNode_(t,e,s){if(0===e.length)return t;const i=e.map(function(t){return Vd(t).textContent}).join(" "),n=ju.getInstance().factory_.makeBranchNode(s,[t],e,i);return e.length>1&&(n.role=Yc.MULTIOP),zd(n,[t,...e]),n}multiopNode_(t){const e=ju.getInstance().factory_.makeBranchNode(Kc.OPERATOR,t,[]);return e.role=Yc.MULTIOP,zd(e,t),e}prefixNode_(t,e){const s=this.splitSingles(e);let i=t;for(;s.length>0;){const t=s.pop();i=ju.getInstance().concatNode_(i,t,Kc.PREFIXOP),1===t.length&&-1!==this.splitOps.indexOf(t[0].textContent)&&(i.role=this.splitRoles.get(t[0].role))}return i}splitSingles(t){let e=0;const s=[];let i=0;for(;i<t.length;){const n=t[i];!this.splitRoles.has(n.role)||t[i-1]&&t[i-1].role===n.role||t[i+1]&&t[i+1].role===n.role||-1===this.splitOps.indexOf(n.textContent)||(s.push(t.slice(e,i)),s.push(t.slice(i,i+1)),e=i+1),i++}return e<i&&s.push(t.slice(e,i)),s}postfixNode_(t,e){return e.length?ju.getInstance().concatNode_(t,e,Kc.POSTFIXOP):t}combineScripts_(t){const e=Xd(t,t=>Qd(t,Kc.SUPERSCRIPT)&&Qd(t.childNodes[0],Kc.EMPTY)||Qd(t,Kc.SUBSCRIPT)&&Qd(t.childNodes[0],Kc.EMPTY));if(!e.rel.length)return t;let s=[];do{const t=e.comp.shift(),i=e.rel.shift();if(!t.length){s.push(i);continue}const n=t.pop();Qd(n,Kc.NUMBER)||Qd(n,Kc.IDENTIFIER)?(i.childNodes[0]=n,n.parent=i,i.role=n.type.toLowerCase(),i.addAnnotation("collapsed",n.type.toLowerCase()),s=s.concat(t),s.push(i)):Qd(n,Kc.SUBSCRIPT)&&Qd(i,Kc.SUPERSCRIPT)?(i.childNodes[0]=n,n.parent=i,i.role=n.type.toLowerCase(),i.addAnnotation("collapsed",n.type.toLowerCase()),n.role=Yc.SUBSUP,s=s.concat(t),s.push(i)):(s=s.concat(t),s.push(n),s.push(i))}while(e.rel.length);return s=s.concat(e.comp.pop()),s}combineUnits_(t){const e=Xd(t,function(t){return!tu(t,Yc.UNIT)});if(t.length===e.rel.length)return e.rel;const s=[];let i,n;do{const t=e.comp.shift();i=e.rel.shift();let r=null;n=s.pop(),n&&(t.length&&Ru(n)?t.unshift(n):s.push(n)),1===t.length&&(r=t.pop()),t.length>1&&(r=ju.getInstance().implicitNode_(t),r.role=Yc.UNIT),r&&s.push(r),i&&s.push(i)}while(i);return s}getMixedNumbers_(t){const e=Xd(t,function(t){return Qd(t,Kc.FRACTION)&&tu(t,Yc.VULGAR)});if(!e.rel.length)return t;let s=[];for(let t,i=0;t=e.rel[i];i++){const n=e.comp[i],r=n.length-1;if(n[r]&&Qd(n[r],Kc.NUMBER)&&(tu(n[r],Yc.INTEGER)||tu(n[r],Yc.FLOAT))){const e=ju.getInstance().factory_.makeBranchNode(Kc.NUMBER,[n[r],t],[]);e.role=Yc.MIXED,s=s.concat(n.slice(0,r)),s.push(e)}else s=s.concat(n),s.push(t)}return s.concat(e.comp[e.comp.length-1])}getTextInRow_(t){if(0===t.length)return t;if(1===t.length)return t[0].type===Kc.TEXT&&t[0].role===Yc.UNKNOWN&&(t[0].role=Yc.ANNOTATION),t;const{rel:e,comp:s}=Xd(t,t=>Qd(t,Kc.TEXT)&&!t.annotation.factor);if(0===e.length)return t;const i=[];let n=s.shift();for(;e.length>0;){let t=e.shift(),r=s.shift();const o=[];for(;!r.length&&e.length&&t.role!==Yc.SPACE&&e[0].role!==Yc.SPACE;)o.push(t),t=e.shift(),r=s.shift();if(o.length&&(o.push(t),t=ju.getInstance().dummyNode_(o)),t.role!==Yc.UNKNOWN){const e=_u(n,t,r);if(e){n=e;continue}n.length&&i.push(ju.getInstance().row(n)),i.push(t),n=r;continue}const a=od.Meaning.get(t.textContent);if(a.type!==Kc.UNKNOWN){t.type=a.type,t.role=a.role,t.font=a.font,t.addAnnotation("general","text"),n.push(t),n=n.concat(r);continue}if(ju.meaningFromContent(t,(t,e,s)=>{if(t.role===Yc.UNKNOWN){if(ju.numberRole_(t,e,s),t.role===Yc.OTHERNUMBER)return s.some(t=>t.type!==Kc.NUMBER&&t.type!==Kc.IDENTIFIER)?(t.type=Kc.TEXT,void(t.role=Yc.ANNOTATION)):void(t.role=Yc.UNKNOWN);t.type=Kc.NUMBER}}),t.role===Yc.UNKNOWN&&(e.length||r.length?r.length&&r[0].type===Kc.FENCED?(t.type=Kc.FUNCTION,t.role=Yc.PREFIXFUNC):t.role=Yc.TEXT:(t.type=Kc.IDENTIFIER,t.role=Yc.UNIT)),t.type!==Kc.TEXT){n.push(t),n=n.concat(r);continue}const l=_u(n,t,r);l?n=l:(n.length&&i.push(ju.getInstance().row(n)),i.push(t),n=r)}return n.length>0&&i.push(ju.getInstance().row(n)),i.length>1?[ju.getInstance().dummyNode_(i)]:i}relationsInRow_(t){const e=Xd(t,hu),s=e.rel[0];if(!s)return ju.getInstance().operationsInRow_(t);if(1===t.length)return t[0];const i=e.comp.map(ju.getInstance().operationsInRow_);let n;return e.rel.some(function(t){return!t.equals(s)})?(n=ju.getInstance().factory_.makeBranchNode(Kc.MULTIREL,i,e.rel),e.rel.every(function(t){return t.role===s.role})&&(n.role=s.role),n):(n=ju.getInstance().factory_.makeBranchNode(Kc.RELSEQ,i,e.rel,Vd(s).textContent),n.role=s.role,n)}operationsInRow_(t){if(0===t.length)return ju.getInstance().factory_.makeEmptyNode();if(1===(t=ju.getInstance().explicitMixed_(t)).length)return t[0];const e=[];for(;t.length>0&&lu(t[0]);)e.push(t.shift());if(0===t.length)return ju.getInstance().multiopNode_(e);if(1===t.length)return ju.getInstance().prefixNode_(t[0],e);const s=qd(t=Bu.run("convert_juxtaposition",t),lu),i=ju.getInstance().wrapFactor(e,s);return ju.getInstance().addFactor(i,s)}wrapPostfix(t){var e;(null===(e=t.div)||void 0===e?void 0:e.role)===Yc.POSTFIXOP&&(t.tail.length&&t.tail[0].type!==Kc.OPERATOR?t.div.role=Yc.DIVISION:(t.head=[ju.getInstance().postfixNode_(ju.getInstance().implicitNode(t.head),[t.div])],t.div=t.tail.shift(),ju.getInstance().wrapPostfix(t)))}wrapFactor(t,e){return ju.getInstance().wrapPostfix(e),ju.getInstance().prefixNode_(ju.getInstance().implicitNode(e.head),t)}addFactor(t,e){return e.div?ju.getInstance().operationsTree_(e.tail,t,e.div):(Su(t)&&(t.role=Yc.UNIT),t)}operationsTree_(t,e,s,i=[]){if(0===t.length){if(i.unshift(s),e.type===Kc.INFIXOP){const t=ju.getInstance().postfixNode_(e.childNodes.pop(),i);return e.appendChild(t),e}return ju.getInstance().postfixNode_(e,i)}const n=qd(t,lu);if(0===n.head.length)return i.push(n.div),ju.getInstance().operationsTree_(n.tail,e,s,i);const r=ju.getInstance().wrapFactor(i,n),o=ju.getInstance().appendOperand_(e,s,r);return ju.getInstance().addFactor(o,n)}appendOperand_(t,e,s){if(t.type!==Kc.INFIXOP)return ju.getInstance().infixNode_([t,s],e);const i=ju.getInstance().appendDivisionOp_(t,e,s);return i||(ju.getInstance().appendExistingOperator_(t,e,s)?t:e.role===Yc.MULTIPLICATION?ju.getInstance().appendMultiplicativeOp_(t,e,s):ju.getInstance().appendAdditiveOp_(t,e,s))}appendDivisionOp_(t,e,s){return e.role===Yc.DIVISION?Au(t)?ju.getInstance().infixNode_([t,s],e):ju.getInstance().appendLastOperand_(t,e,s):t.role===Yc.DIVISION?ju.getInstance().infixNode_([t,s],e):null}appendLastOperand_(t,e,s){let i=t,n=t.childNodes[t.childNodes.length-1];for(;n&&n.type===Kc.INFIXOP&&!Au(n);)i=n,n=i.childNodes[i.childNodes.length-1];const r=ju.getInstance().infixNode_([i.childNodes.pop(),s],e);return i.appendChild(r),t}appendMultiplicativeOp_(t,e,s){if(Au(t))return ju.getInstance().infixNode_([t,s],e);let i=t,n=t.childNodes[t.childNodes.length-1];for(;n&&n.type===Kc.INFIXOP&&!Au(n);)i=n,n=i.childNodes[i.childNodes.length-1];const r=ju.getInstance().infixNode_([i.childNodes.pop(),s],e);return i.appendChild(r),t}appendAdditiveOp_(t,e,s){return ju.getInstance().infixNode_([t,s],e)}appendExistingOperator_(t,e,s){return!(!t||t.type!==Kc.INFIXOP||Au(t))&&(t.contentNodes[0].equals(e)?(t.appendContentNode(e),t.appendChild(s),!0):ju.getInstance().appendExistingOperator_(t.childNodes[t.childNodes.length-1],e,s))}getFencesInRow_(t){let e=Xd(t,du);e=ju.purgeFences_(e);const s=e.comp.shift();return ju.getInstance().fences_(e.rel,e.comp,[],[s])}fences_(t,e,s,i){if(0===t.length&&0===s.length)return i[0];const n=Bu.run("bracketed_interval",[t[0],t[1],...e[0]||[]],()=>null);if(n){t.shift(),t.shift(),e.shift();const r=i.pop()||[];return i.push([...r,n,...e.shift()]),ju.getInstance().fences_(t,e,s,i)}const r=t=>tu(t,Yc.OPEN);if(0===t.length){const t=i.shift();for(;s.length>0;){if(r(s[0])){const e=s.shift();ju.fenceToPunct_(e),t.push(e)}else{const e=qd(s,r),n=e.head.length-1,o=ju.getInstance().neutralFences_(e.head,i.slice(0,n));i=i.slice(n),t.push(...o),e.div&&e.tail.unshift(e.div),s=e.tail}t.push(...i.shift())}return t}const o=s[s.length-1],a=t[0].role;if(a===Yc.OPEN||Ou(t[0])&&(!o||!Mu(t[0],o))){s.push(t.shift());const n=e.shift();return n&&i.push(n),ju.getInstance().fences_(t,e,s,i)}if(o&&a===Yc.CLOSE&&o.role===Yc.OPEN){const n=ju.getInstance().horizontalFencedNode_(s.pop(),t.shift(),i.pop());return i.push(i.pop().concat([n],e.shift())),ju.getInstance().fences_(t,e,s,i)}if(o&&Mu(t[0],o)){if(!Du(o)||!ku(t[0])){s.push(t.shift());const n=e.shift();return n&&i.push(n),ju.getInstance().fences_(t,e,s,i)}const n=ju.getInstance().horizontalFencedNode_(s.pop(),t.shift(),i.pop());return i.push(i.pop().concat([n],e.shift())),ju.getInstance().fences_(t,e,s,i)}if(o&&a===Yc.CLOSE&&Ou(o)&&s.some(r)){const n=qd(s,r,!0),o=i.pop(),a=i.length-n.tail.length+1,l=ju.getInstance().neutralFences_(n.tail,i.slice(a));i=i.slice(0,a);const h=ju.getInstance().horizontalFencedNode_(n.div,t.shift(),i.pop().concat(l,o));return i.push(i.pop().concat([h],e.shift())),ju.getInstance().fences_(t,e,n.head,i)}const l=t.shift();return ju.fenceToPunct_(l),i.push(i.pop().concat([l],e.shift())),ju.getInstance().fences_(t,e,s,i)}neutralFences_(t,e){if(0===t.length)return t;if(1===t.length)return ju.fenceToPunct_(t[0]),t;const s=t.shift();if(!Du(s)){ju.fenceToPunct_(s);const i=e.shift();return i.unshift(s),i.concat(ju.getInstance().neutralFences_(t,e))}const i=qd(t,function(t){return Mu(t,s)});if(!i.div){ju.fenceToPunct_(s);const i=e.shift();return i.unshift(s),i.concat(ju.getInstance().neutralFences_(t,e))}if(!ku(i.div))return ju.fenceToPunct_(i.div),t.unshift(s),ju.getInstance().neutralFences_(t,e);const n=ju.getInstance().combineFencedContent_(s,i.div,i.head,e);if(i.tail.length>0){const t=n.shift(),e=ju.getInstance().neutralFences_(i.tail,n);return t.concat(e)}return n[0]}combineFencedContent_(t,e,s,i){if(0===s.length){const s=ju.getInstance().horizontalFencedNode_(t,e,i.shift());return i.length>0?i[0].unshift(s):i=[[s]],i}const n=i.shift(),r=s.length-1,o=i.slice(0,r),a=(i=i.slice(r)).shift(),l=ju.getInstance().neutralFences_(s,o);n.push(...l),n.push(...a);const h=ju.getInstance().horizontalFencedNode_(t,e,n);return i.length>0?i[0].unshift(h):i=[[h]],i}horizontalFencedNode_(t,e,s){var i;const n=ju.getInstance().row(s),r=null===(i=t.mathmlTree)||void 0===i?void 0:i.nextSibling;Qd(n,Kc.EMPTY)&&!n.mathmlTree&&t.mathmlTree&&e.mathmlTree!==r&&!Ud(e.mathmlTree,r)&&(n.mathmlTree=r,n.addMathmlNodes([r]));let o=ju.getInstance().factory_.makeBranchNode(Kc.FENCED,[n],[t,e]);return t.role===Yc.OPEN?(ju.getInstance().classifyHorizontalFence_(o),o=Bu.run("propagateComposedFunction",o)):o.role=t.role,o=Bu.run("detect_cycle",o),ju.rewriteFencedNode_(o)}classifyHorizontalFence_(t){if(Bu.run("interval_heuristic",t),t.role===Yc.INTERVAL)return;t.role=Yc.LEFTRIGHT;const e=t.childNodes;if(!function(t){return function(t){return!!t&&-1!==["{","\ufe5b","\uff5b"].indexOf(t.textContent)}(Vd(t.contentNodes[0]))&&function(t){return!!t&&-1!==["}","\ufe5c","\uff5d"].indexOf(t.textContent)}(Vd(t.contentNodes[1]))}(t)||e.length>1)return;if(0===e.length||e[0].type===Kc.EMPTY)return void(t.role=Yc.SETEMPTY);const s=e[0].type;if(1===e.length&&Cu(e[0]))return void(t.role=Yc.SETSINGLE);const i=e[0].role;if(s===Kc.PUNCTUATED&&i===Yc.SEQUENCE){if(e[0].contentNodes[0].role!==Yc.COMMA)return 1!==e[0].contentNodes.length||e[0].contentNodes[0].role!==Yc.VBAR&&e[0].contentNodes[0].role!==Yc.COLON?void 0:(t.role=Yc.SETEXT,void ju.getInstance().setExtension_(t));t.role=Yc.SETCOLLECT}}setExtension_(t){const e=t.childNodes[0].childNodes[0];e&&e.type===Kc.INFIXOP&&1===e.contentNodes.length&&Pu(e.contentNodes[0])&&(e.addAnnotation("set","intensional"),e.contentNodes[0].addAnnotation("set","intensional"))}getPunctuationInRow_(t){if(t.length<=1)return t;const e=t=>{const e=t.type;return"punctuation"===e||"text"===e||"operator"===e||"relation"===e},s=Xd(t,function(s){if(!cu(s))return!1;if(cu(s)&&!tu(s,Yc.ELLIPSIS))return!0;const i=t.indexOf(s);if(0===i)return!t[1]||!e(t[1]);const n=t[i-1];if(i===t.length-1)return!e(n);const r=t[i+1];return!e(n)||!e(r)});if(0===s.rel.length)return t;let i=[],n=s.comp.shift();n.length>0&&i.push(ju.getInstance().row(n));let r=0;for(;s.comp.length>0;){let t=[];const e=r;do{t.push(s.rel[r++]),n=s.comp.shift()}while(s.rel[r]&&n&&0===n.length);t=Bu.run("ellipses",t),s.rel.splice(e,r-e,...t),r=e+t.length,i=i.concat(t),n&&n.length>0&&i.push(ju.getInstance().row(n))}return 1===i.length&&1===s.rel.length?i:[ju.getInstance().punctuatedNode_(i,s.rel)]}punctuatedNode_(t,e){const s=ju.getInstance().factory_.makeBranchNode(Kc.PUNCTUATED,t,e);if(e.length===t.length){const t=e[0].role;if(t!==Yc.UNKNOWN&&e.every(function(e){return e.role===t}))return s.role=t,s}const i=e[0];return Nu(t,e,0)?s.role=i.childNodes.length&&!i.embellished?i.role:Yc.STARTPUNCT:Nu(t,e,t.length-1)?s.role=i.childNodes.length&&!i.embellished?i.role:Yc.ENDPUNCT:e.every(t=>tu(t,Yc.DUMMY))?s.role=Yc.TEXT:e.every(t=>tu(t,Yc.SPACE))?s.role=Yc.SPACE:s.role=Yc.SEQUENCE,s}dummyNode_(t){const e=ju.getInstance().factory_.makeMultipleContentNodes(t.length-1,id.invisibleComma);return e.forEach(function(t){t.role=Yc.DUMMY}),ju.getInstance().punctuatedNode_(t,e)}accentRole_(t,e){if(!eu(t))return!1;const s=t.textContent,i=od.Secondary.get(s,ed.BAR)||od.Secondary.get(s,ed.TILDE)||t.role;return t.role=e===Kc.UNDERSCORE?Yc.UNDERACCENT:Yc.OVERACCENT,t.addAnnotation("accent",i),!0}accentNode_(t,e,s,i,n){const r=(e=e.slice(0,i+1))[1],o=e[2];let a;if(!n&&o&&(a=ju.getInstance().factory_.makeBranchNode(Kc.SUBSCRIPT,[t,r],[]),a.role=Yc.SUBSUP,e=[a,o],s=Kc.SUPERSCRIPT),n){const i=ju.getInstance().accentRole_(r,s);if(o){ju.getInstance().accentRole_(o,Kc.OVERSCORE)&&!i?(a=ju.getInstance().factory_.makeBranchNode(Kc.OVERSCORE,[t,o],[]),e=[a,r],s=Kc.UNDERSCORE):(a=ju.getInstance().factory_.makeBranchNode(Kc.UNDERSCORE,[t,r],[]),e=[a,o],s=Kc.OVERSCORE),a.role=Yc.UNDEROVER}}return ju.getInstance().makeLimitNode_(t,e,a,s)}makeLimitNode_(t,e,s,i){if(i===Kc.LIMUPPER&&t.type===Kc.LIMLOWER)return t.childNodes.push(e[1]),e[1].parent=t,t.type=Kc.LIMBOTH,t;if(i===Kc.LIMLOWER&&t.type===Kc.LIMUPPER)return t.childNodes.splice(1,-1,e[1]),e[1].parent=t,t.type=Kc.LIMBOTH,t;const n=ju.getInstance().factory_.makeBranchNode(i,e,[]),r=au(t);return s&&(s.embellished=r),n.embellished=r,n.role=t.role,n}getFunctionsInRow_(t,e){const s=e||[];if(0===t.length)return s;const i=t.shift(),n=ju.classifyFunction_(i,t);if(!n)return s.push(i),ju.getInstance().getFunctionsInRow_(t,s);const r=ju.getInstance().getFunctionsInRow_(t,[]),o=ju.getInstance().getFunctionArgs_(i,r,n);return s.concat(o)}getFunctionArgs_(t,e,s){let i,n,r;switch(s){case"integral":{const s=ju.getInstance().getIntegralArgs_(e);if(!s.intvar&&!s.integrand.length)return s.rest.unshift(t),s.rest;const i=ju.getInstance().row(s.integrand);return r=ju.getInstance().integralNode_(t,i,s.intvar),Bu.run("intvar_from_fraction",r),s.rest.unshift(r),s.rest}case"prefix":if(e[0]&&e[0].type===Kc.FENCED){const s=e.shift();return Ou(s)||(s.role=Yc.LEFTRIGHT),r=ju.getInstance().functionNode_(t,s),e.unshift(r),e}if(i=qd(e,su),i.head.length)n=ju.getInstance().row(i.head),i.div&&i.tail.unshift(i.div);else{if(!i.div||!Qd(i.div,Kc.APPL))return e.unshift(t),e;n=i.div}return r=ju.getInstance().functionNode_(t,n),i.tail.unshift(r),i.tail;case"bigop":return i=qd(e,iu),i.head.length?(n=ju.getInstance().row(i.head),r=ju.getInstance().bigOpNode_(t,n),i.div&&i.tail.unshift(i.div),i.tail.unshift(r),i.tail):(e.unshift(t),e);default:{if(0===e.length)return[t];const s=e[0];return s.type===Kc.FENCED&&!Ou(s)&&function(t){const e=t.childNodes;if(0===e.length)return!0;if(e.length>1)return!1;const s=e[0];if(s.type===Kc.INFIXOP){if(s.role!==Yc.IMPLICIT)return!1;if(s.childNodes.some(t=>Qd(t,Kc.INFIXOP)))return!1}return!0}(s)?(s.role=Yc.LEFTRIGHT,ju.propagateFunctionRole_(t,Yc.SIMPLEFUNC),r=ju.getInstance().functionNode_(t,e.shift()),e.unshift(r),e):(e.unshift(t),e)}}}getIntegralArgs_(t,e=[]){if(0===t.length){const t=qd(e,iu);return t.div&&t.tail.unshift(t.div),{integrand:t.head,intvar:null,rest:t.tail}}Bu.run("intvar_from_implicit",t);const s=t[0];if(ou(s)){const{integrand:s,rest:i}=ju.getInstance().getIntegralArgs_(e);return{integrand:s,intvar:null,rest:i.concat(t)}}if(ru(s))return s.role=Yc.INTEGRAL,{integrand:e,intvar:s,rest:t.slice(1)};if(t[1]&&nu(s,t[1])){const i=ju.getInstance().prefixNode_(t[1],[s]);return i.role=Yc.INTEGRAL,{integrand:e,intvar:i,rest:t.slice(2)}}return e.push(t.shift()),ju.getInstance().getIntegralArgs_(t,e)}functionNode_(t,e){const s=ju.getInstance().factory_.makeContentNode(id.functionApplication),i=ju.getInstance().funcAppls[t.id];i&&(s.mathmlTree=i.mathmlTree,s.addMathmlNodes(i.mathml),s.annotation=i.annotation,s.attributes=i.attributes,delete ju.getInstance().funcAppls[t.id]),s.type=Kc.PUNCTUATION,s.role=Yc.APPLICATION;const n=ju.getFunctionOp_(t,function(t){return Qd(t,Kc.FUNCTION)||Qd(t,Kc.IDENTIFIER)&&tu(t,Yc.SIMPLEFUNC)});return ju.getInstance().functionalNode_(Kc.APPL,[t,e],n,[s])}bigOpNode_(t,e){const s=ju.getFunctionOp_(t,t=>Qd(t,Kc.LARGEOP));return ju.getInstance().functionalNode_(Kc.BIGOP,[t,e],s,[])}integralNode_(t,e,s){e=e||ju.getInstance().factory_.makeEmptyNode(),s=s||ju.getInstance().factory_.makeEmptyNode();const i=ju.getFunctionOp_(t,t=>Qd(t,Kc.LARGEOP));return ju.getInstance().functionalNode_(Kc.INTEGRAL,[t,e,s],i,[])}functionalNode_(t,e,s,i){const n=e[0];let r;s&&(r=s.parent,i.push(s));const o=ju.getInstance().factory_.makeBranchNode(t,e,i);return o.role=n.role,r&&(s.parent=r),o}fractionNode_(t,e){const s=ju.getInstance().factory_.makeBranchNode(Kc.FRACTION,[t,e],[]);return s.role=s.childNodes.every(function(t){return Qd(t,Kc.NUMBER)&&tu(t,Yc.INTEGER)})?Yc.VULGAR:s.childNodes.every(Iu)?Yc.UNIT:Yc.DIVISION,Bu.run("propagateSimpleFunction",s)}scriptNode_(t,e,s){let i;switch(t.length){case 0:i=ju.getInstance().factory_.makeEmptyNode();break;case 1:if(i=t[0],s)return i;break;default:i=ju.getInstance().dummyNode_(t),i.addAnnotation("general","script")}return i.role=e,i}findNestedRow_(t,e,s,i){if(s>3)return null;for(let n,r=0;n=t[r];r++){const t=Oc(n);if(t!==Cd.MSPACE){if(t===Cd.MROW)return ju.getInstance().findNestedRow_(Lc(n.childNodes),e,s+1,i);if(ju.findSemantics(n,e,i))return n}}return null}}function _u(t,e,s){const i=t[t.length-1];if(i&&(i.type===Kc.RELATION||i.type===Kc.OPERATOR))return e.addAnnotation("factor",i.type),[...t,e,...s];const n=s[0];return!n||n.type!==Kc.RELATION&&n.type!==Kc.OPERATOR?null:(e.addAnnotation("factor",n.type),[...t,e,...s])}function Fu(t,e){return t.forEach(t=>e.addAnnotation("empty",t)),e}ju.FENCE_TO_PUNCT_={[Yc.METRIC]:Yc.METRIC,[Yc.NEUTRAL]:Yc.VBAR,[Yc.OPEN]:Yc.OPENFENCE,[Yc.CLOSE]:Yc.CLOSEFENCE},ju.MML_TO_LIMIT_={[Cd.MSUB]:{type:Kc.LIMLOWER,length:1},[Cd.MUNDER]:{type:Kc.LIMLOWER,length:1},[Cd.MSUP]:{type:Kc.LIMUPPER,length:1},[Cd.MOVER]:{type:Kc.LIMUPPER,length:1},[Cd.MSUBSUP]:{type:Kc.LIMBOTH,length:2},[Cd.MUNDEROVER]:{type:Kc.LIMBOTH,length:2}},ju.MML_TO_BOUNDS_={[Cd.MSUB]:{type:Kc.SUBSCRIPT,length:1,accent:!1},[Cd.MSUP]:{type:Kc.SUPERSCRIPT,length:1,accent:!1},[Cd.MSUBSUP]:{type:Kc.SUBSCRIPT,length:2,accent:!1},[Cd.MUNDER]:{type:Kc.UNDERSCORE,length:1,accent:!0},[Cd.MOVER]:{type:Kc.OVERSCORE,length:1,accent:!0},[Cd.MUNDEROVER]:{type:Kc.UNDERSCORE,length:2,accent:!0}},ju.CLASSIFY_FUNCTION_={[Yc.INTEGRAL]:"integral",[Yc.SUM]:"bigop",[Yc.PREFIXFUNC]:"prefix",[Yc.LIMFUNC]:"prefix",[Yc.SIMPLEFUNC]:"prefix",[Yc.COMPFUNC]:"prefix"},ju.MATHJAX_FONTS={"-tex-caligraphic":Zc.CALIGRAPHIC,"-tex-caligraphic-bold":Zc.CALIGRAPHICBOLD,"-tex-calligraphic":Zc.CALIGRAPHIC,"-tex-calligraphic-bold":Zc.CALIGRAPHICBOLD,"-tex-oldstyle":Zc.OLDSTYLE,"-tex-oldstyle-bold":Zc.OLDSTYLEBOLD,"-tex-mathit":Zc.ITALIC};class Uu extends Yd{static getAttribute_(t,e,s){if(!t.hasAttribute(e))return s;const i=t.getAttribute(e);return i.match(/^\s*$/)?null:i}constructor(t){super("MathML"),this.options=t,Bu.options=t,this.parseMap_=new Map([[Cd.SEMANTICS,this.semantics_.bind(this)],[Cd.MATH,this.rows_.bind(this)],[Cd.MROW,this.rows_.bind(this)],[Cd.MPADDED,this.rows_.bind(this)],[Cd.MSTYLE,this.rows_.bind(this)],[Cd.MFRAC,this.fraction_.bind(this)],[Cd.MSUB,this.limits_.bind(this)],[Cd.MSUP,this.limits_.bind(this)],[Cd.MSUBSUP,this.limits_.bind(this)],[Cd.MOVER,this.limits_.bind(this)],[Cd.MUNDER,this.limits_.bind(this)],[Cd.MUNDEROVER,this.limits_.bind(this)],[Cd.MROOT,this.root_.bind(this)],[Cd.MSQRT,this.sqrt_.bind(this)],[Cd.MTABLE,this.table_.bind(this)],[Cd.MLABELEDTR,this.tableLabeledRow_.bind(this)],[Cd.MTR,this.tableRow_.bind(this)],[Cd.MTD,this.tableCell_.bind(this)],[Cd.MS,this.text_.bind(this)],[Cd.MTEXT,this.text_.bind(this)],[Cd.MSPACE,this.space_.bind(this)],[Cd.ANNOTATIONXML,this.text_.bind(this)],[Cd.MI,this.identifier_.bind(this)],[Cd.MN,this.number_.bind(this)],[Cd.MO,this.operator_.bind(this)],[Cd.MFENCED,this.fenced_.bind(this)],[Cd.MENCLOSE,this.enclosed_.bind(this)],[Cd.MMULTISCRIPTS,this.multiscripts_.bind(this)],[Cd.ANNOTATION,this.empty_.bind(this)],[Cd.NONE,this.empty_.bind(this)],[Cd.MACTION,this.action_.bind(this)],[Cd.MPHANTOM,this.phantom_.bind(this)]]);const e={type:Kc.IDENTIFIER,role:Yc.NUMBERSET,font:Zc.DOUBLESTRUCK};["C","H","N","P","Q","R","Z","\u2102","\u210d","\u2115","\u2119","\u211a","\u211d","\u2124"].forEach((t=>this.getFactory().defaultMap.set(t,e)).bind(this))}parse(t){ju.getInstance().setNodeFactory(this.getFactory());const e=Lc(t.childNodes),s=Oc(t),i=this.parseMap_.get(s),n=(i||this.dummy_.bind(this))(t,e);return n.noupdate?n:(Wd(n,t),-1!==[Cd.MATH,Cd.MROW,Cd.MPADDED,Cd.MSTYLE,Cd.SEMANTICS,Cd.MACTION].indexOf(s)||(n.mathml.unshift(t),n.mathmlTree=t),n)}semantics_(t,e){return e.length?this.parse(e[0]):this.getFactory().makeEmptyNode()}rows_(t,e){const s=t.getAttribute("semantics");if(s&&s.match("bspr_"))return ju.proof(t,s,this.parseList.bind(this));let i;if(1===(e=Hd(e)).length)i=this.parse(e[0]),i.type!==Kc.EMPTY||i.mathmlTree||(i.mathmlTree=t);else{const s=Bu.run("function_from_identifiers",t),n=this.parseList(e),r=Oc(t)===Cd.MSTYLE;i=s&&s!==t?s:ju.getInstance().row(n,r)}return i.mathml.unshift(t),i}fraction_(t,e){if(!e.length)return this.getFactory().makeEmptyNode();const s=this.parse(e[0]),i=e[1]?this.parse(e[1]):this.getFactory().makeEmptyNode();return ju.getInstance().fractionLikeNode(s,i,t.getAttribute("linethickness"),"true"===t.getAttribute("bevelled"))}limits_(t,e){return ju.getInstance().limitNode(Oc(t),this.parseList(e))}root_(t,e){return e[1]?this.getFactory().makeBranchNode(Kc.ROOT,[this.parse(e[1]),this.parse(e[0])],[]):this.sqrt_(t,e)}sqrt_(t,e){const s=this.parseList(Hd(e));return this.getFactory().makeBranchNode(Kc.SQRT,[ju.getInstance().row(s)],[])}table_(t,e){const s=t.getAttribute("semantics");if(s&&s.match("bspr_"))return ju.proof(t,s,this.parseList.bind(this));const i=this.getFactory().makeBranchNode(Kc.TABLE,this.parseList(e),[]);return i.mathmlTree=t,ju.tableToMultiline(i)}tableRow_(t,e){const s=this.getFactory().makeBranchNode(Kc.ROW,this.parseList(e),[]);return s.role=Yc.TABLE,s}tableLabeledRow_(t,e){var s;if(!e.length)return this.tableRow_(t,e);const i=this.parse(e[0]);i.role=Yc.LABEL,(null===(s=i.childNodes[0])||void 0===s?void 0:s.type)===Kc.TEXT&&(i.childNodes[0].role=Yc.LABEL);const n=this.getFactory().makeBranchNode(Kc.ROW,this.parseList(e.slice(1)),[i]);return n.role=Yc.TABLE,n}tableCell_(t,e){const s=this.parseList(Hd(e));let i;i=s.length?1===s.length&&Qd(s[0],Kc.EMPTY)?s:[ju.getInstance().row(s)]:[];const n=this.getFactory().makeBranchNode(Kc.CELL,i,[]);return n.role=Yc.TABLE,n}phantom_(t,e){let s;return e.length?(s=this.getFactory().makeUnprocessed(t),s.type=Kc.TEXT,s.role=Yc.SPACE):s=this.empty_(t,e),s}space_(t,e){if(!Gd(t))return this.empty_(t,e);const s=this.getFactory().makeUnprocessed(t);return ju.getInstance().text(s,Oc(t))}text_(t,e){const s=this.leaf_(t,e);return t.textContent?(s.updateContent(t.textContent,!0),ju.getInstance().text(s,Oc(t))):s}identifier_(t,e){const s=this.leaf_(t,e);return ju.getInstance().identifierNode(s,ju.getInstance().font(t.getAttribute("mathvariant")),t.getAttribute("class"))}number_(t,e){const s=this.leaf_(t,e);return ju.number(s),s}operator_(t,e){const s=this.leaf_(t,e);return ju.getInstance().operatorNode(s),s}fenced_(t,e){const s=this.parseList(e);s.forEach(t=>{Qd(t,Kc.EMPTY)&&t.addAnnotation("empty","MFENCED")});const i=Uu.getAttribute_(t,"separators",","),n=Uu.getAttribute_(t,"open","("),r=Uu.getAttribute_(t,"close",")"),o=ju.getInstance().mfenced(n,r,i,s);o.mathmlTree=t,o.addMathmlNodes([t]);return ju.getInstance().tablesInRow([o])[0]}enclosed_(t,e){const s=this.parseList(Hd(e)),i=this.getFactory().makeBranchNode(Kc.ENCLOSE,[ju.getInstance().row(s)],[]);return i.role=t.getAttribute("notation")||Yc.UNKNOWN,i}multiscripts_(t,e){if(!e.length)return this.getFactory().makeEmptyNode();const s=this.parse(e.shift());if(!e.length)return s;const i=[],n=[],r=[],o=[];let a=!1,l=0;for(let t,s=0;t=e[s];s++)Oc(t)!==Cd.MPRESCRIPTS?(a?1&l?i.push(t):n.push(t):1&l?r.push(t):o.push(t),l++):(a=!0,l=0);return Hd(i).length||Hd(n).length?ju.getInstance().tensor(s,this.parseList(n),this.parseList(i),this.parseList(o),this.parseList(r)):ju.getInstance().pseudoTensor(s,this.parseList(o),this.parseList(r))}empty_(t,e){const s=this.getFactory().makeEmptyNode();return s.addMathmlNodes([t]),s.mathmlTree=t,s}action_(t,e){const s=e[t.hasAttribute("selection")?parseInt(t.getAttribute("selection"),10)-1:0],i=this.parse(s);return i.mathmlTree=s,i}dummy_(t,e){const s=this.getFactory().makeUnprocessed(t);return s.role=t.tagName,s.textContent=t.textContent,s}leaf_(t,e){if(1===e.length&&e[0].nodeType!==vc.TEXT_NODE){const s=this.getFactory().makeUnprocessed(t);return s.role=e[0].tagName,Wd(s,e[0]),s}const s=this.getFactory().makeLeafNode(t.textContent,ju.getInstance().font(t.getAttribute("mathvariant")));return t.hasAttribute("data-latex")&&od.LatexCommands.set(t.getAttribute("data-latex"),t.textContent),s}}class Hu{constructor(t,e,s=t=>!1){this.name=t,this.apply=e,this.applicable=s}}class Wu extends Hu{}class Vu extends Hu{}function qu(t,e){const s=[];for(;t.length||e.length;)t.length&&s.push(t.shift()),e.length&&s.push(e.shift());return s}const Xu="data-semantic-";var zu;!function(t){t.ADDED="data-semantic-added",t.ALTERNATIVE="data-semantic-alternative",t.CHILDREN="data-semantic-children",t.COLLAPSED="data-semantic-collapsed",t.CONTENT="data-semantic-content",t.EMBELLISHED="data-semantic-embellished",t.FENCEPOINTER="data-semantic-fencepointer",t.FONT="data-semantic-font",t.ID="data-semantic-id",t.ANNOTATION="data-semantic-annotation",t.ATTRIBUTES="data-semantic-attributes",t.OPERATOR="data-semantic-operator",t.OWNS="data-semantic-owns",t.PARENT="data-semantic-parent",t.POSTFIX="data-semantic-postfix",t.PREFIX="data-semantic-prefix",t.ROLE="data-semantic-role",t.SPEECH="data-semantic-speech",t.STRUCTURE="data-semantic-structure",t.SUMMARY="data-semantic-summary",t.TYPE="data-semantic-type"}(zu||(zu={}));const Gu=[zu.ADDED,zu.ALTERNATIVE,zu.CHILDREN,zu.COLLAPSED,zu.CONTENT,zu.EMBELLISHED,zu.FENCEPOINTER,zu.FONT,zu.ID,zu.ANNOTATION,zu.ATTRIBUTES,zu.OPERATOR,zu.OWNS,zu.PARENT,zu.POSTFIX,zu.PREFIX,zu.ROLE,zu.SPEECH,zu.STRUCTURE,zu.SUMMARY,zu.TYPE];function Ju(t){return t.map(function(t){return t.id}).join(",")}function Ku(t,e){t.setAttribute(zu.TYPE,e.type);const s=e.allAttributes();for(let e,i=0;e=s[i];i++)t.setAttribute(Xu+e[0].toLowerCase(),e[1]);e.childNodes.length&&t.setAttribute(zu.CHILDREN,Ju(e.childNodes)),e.contentNodes.length&&t.setAttribute(zu.CONTENT,Ju(e.contentNodes)),e.parent&&t.setAttribute(zu.PARENT,e.parent.id.toString());const i=e.attributesXml();i&&t.setAttribute(zu.ATTRIBUTES,i),function(t,e){const s=[];e.role===Yc.MGLYPH&&s.push("image");e.attributes.href&&s.push("link");s.length&&t.setAttribute(zu.POSTFIX,s.join(" "))}(t,e)}function $u(){const t=Ic("mrow");return t.setAttribute(zu.ADDED,"true"),t}class Yu{static fromTree(t){return Yu.fromNode(t.root)}static fromNode(t){return new Yu(Yu.fromNode_(t))}static fromString(t){return new Yu(Yu.fromString_(t))}static simpleCollapseStructure(t){return"number"==typeof t}static contentCollapseStructure(t){return!!t&&!Yu.simpleCollapseStructure(t)&&"c"===t[0]}static interleaveIds(t,e){return qu(Yu.collapsedLeafs(t),Yu.collapsedLeafs(e))}static collapsedLeafs(...t){return t.reduce((t,e)=>{return t.concat((s=e,Yu.simpleCollapseStructure(s)?[s]:Yu.contentCollapseStructure(s[1])?s.slice(2):s.slice(1)));var s},[])}static fromStructure(t,e,s){const i=new Map;t.hasAttribute(zu.ID)&&i.set(t.getAttribute(zu.ID),t);for(const e of wc(t,zu.ID))i.set(e.getAttribute(zu.ID),e);return new Yu(Yu.tree_(i,e.root,s))}static combineContentChildren(t,e,s,i){switch(t){case Kc.RELSEQ:case Kc.INFIXOP:case Kc.MULTIREL:return qu(i,s);case Kc.PREFIXOP:return s.concat(i);case Kc.POSTFIXOP:return i.concat(s);case Kc.MATRIX:case Kc.VECTOR:case Kc.FENCED:return i.unshift(s[0]),i.push(s[1]),i;case Kc.CASES:return i.unshift(s[0]),i;case Kc.APPL:return[i[0],s[0],i[1]];case Kc.ROOT:return[i[0],i[1]];case Kc.ROW:case Kc.LINE:return s.length&&i.push(s[0]),i;default:return i}}static makeSexp_(t){return Yu.simpleCollapseStructure(t)?t.toString():Yu.contentCollapseStructure(t)?"(c "+t.slice(1).map(Yu.makeSexp_).join(" ")+")":"("+t.map(Yu.makeSexp_).join(" ")+")"}static fromString_(t){let e=t.replace(/\(/g,"[");return e=e.replace(/\)/g,"]"),e=e.replace(/ /g,","),e=e.replace(/c/g,'"c"'),JSON.parse(e)}static fromNode_(t){if(!t)return[];const e=t.contentNodes;let s;e.length&&(s=e.map(Yu.fromNode_),s.unshift("c"));const i=t.childNodes;if(!i.length)return e.length?[t.id,s]:t.id;const n=i.map(Yu.fromNode_);return e.length&&n.unshift(s),n.unshift(t.id),n}static tree_(t,e,s,i=0,n=1,r=1){if(!e)return[];const o=e.id,a=[o],l=t.get(o.toString());if(!e.childNodes.length)return Yu.addAria(l,i,n,r,s),e.id;const h=Yu.combineContentChildren(e.type,e.role,e.contentNodes,e.childNodes);l&&Yu.addOwns_(l,h);for(let e,n=0,r=h.length;e=h[n];n++)a.push(Yu.tree_(t,e,s,i+1,n+1,r));return Yu.addAria(l,i,n,r,s),a}static addAria(t,e,s,i,n){const r=n.tree?e?"treeitem":"tree":"treeitem";n.aria&&t&&(t.setAttribute("aria-level",e.toString()),t.setAttribute("aria-posinset",s.toString()),t.setAttribute("aria-setsize",i.toString()),t.setAttribute("role",r),t.hasAttribute(zu.OWNS)&&t.setAttribute("aria-owns",t.getAttribute(zu.OWNS)))}static addOwns_(t,e){const s=t.getAttribute(zu.COLLAPSED),i=s?Yu.realLeafs_(Yu.fromString(s).array):e.map(t=>t.id);t.setAttribute(zu.OWNS,i.join(" "))}static realLeafs_(t){if(Yu.simpleCollapseStructure(t))return[t];if(Yu.contentCollapseStructure(t))return[];let e=[];for(let s=1;s<t.length;s++)e=e.concat(Yu.realLeafs_(t[s]));return e}constructor(t){this.parents=null,this.levelsMap=null,t=0===t?t:t||[],this.array=t}populate(){this.parents&&this.levelsMap||(this.parents={},this.levelsMap={},this.populate_(this.array,this.array,[]))}toString(){return Yu.makeSexp_(this.array)}populate_(t,e,s){if(Yu.simpleCollapseStructure(t))return this.levelsMap[t]=e,void(this.parents[t]=t===s[0]?s.slice(1):s);const i=Yu.contentCollapseStructure(t)?t.slice(1):t,n=[i[0]].concat(s);for(let e=0,s=i.length;e<s;e++){const s=i[e];this.populate_(s,t,n)}}isRoot(t){return t===this.levelsMap[t][0]}directChildren(t){if(!this.isRoot(t))return[];return this.levelsMap[t].slice(1).map(t=>Yu.simpleCollapseStructure(t)?t:Yu.contentCollapseStructure(t)?t[1]:t[0])}subtreeNodes(t){if(!this.isRoot(t))return[];const e=(t,s)=>{Yu.simpleCollapseStructure(t)?s.push(t):(Yu.contentCollapseStructure(t)&&(t=t.slice(1)),t.forEach(t=>e(t,s)))},s=this.levelsMap[t],i=[];return e(s.slice(1),i),i}}function Qu(t,e,s){let i=null;if(!t.length)return i;const n=s[s.length-1],r=n&&n.length,o=e&&e.length,a=ju.getInstance();if(r&&o){if(e[0].type===Kc.INFIXOP&&e[0].role===Yc.IMPLICIT)return i=t.pop(),n.push(a.postfixNode_(n.pop(),t)),i;i=t.shift();const s=a.prefixNode_(e.shift(),t);return e.unshift(s),i}return r?(n.push(a.postfixNode_(n.pop(),t)),i):(o&&e.unshift(a.prefixNode_(e.shift(),t)),i)}function Zu(t,e,s){if(!e.length)return t;const i=t.pop(),n=e.shift(),r=s.shift();if(n.type===Kc.INFIXOP&&(n.role===Yc.IMPLICIT||n.role===Yc.UNIT)){dc.getInstance().output("Juxta Heuristic Case 2");const o=(i?[i,n]:[n]).concat(r);return Zu(t.concat(o),e,s)}if(!i)return dc.getInstance().output("Juxta Heuristic Case 3"),Zu([n].concat(r),e,s);const o=r.shift();if(!o){dc.getInstance().output("Juxta Heuristic Case 9");const r=Bu.factory.makeBranchNode(Kc.INFIXOP,[i,e.shift()],[n],n.textContent);return r.role=Yc.IMPLICIT,Bu.run("combine_juxtaposition",r),e.unshift(r),Zu(t,e,s)}if(lu(i)||lu(o))return dc.getInstance().output("Juxta Heuristic Case 4"),Zu(t.concat([i,n,o]).concat(r),e,s);let a=null;return wu(i)&&wu(o)?(dc.getInstance().output("Juxta Heuristic Case 5"),i.contentNodes.push(n),i.contentNodes=i.contentNodes.concat(o.contentNodes),i.childNodes.push(o),i.childNodes=i.childNodes.concat(o.childNodes),o.childNodes.forEach(t=>t.parent=i),n.parent=i,i.addMathmlNodes(n.mathml),i.addMathmlNodes(o.mathml),a=i):wu(i)?(dc.getInstance().output("Juxta Heuristic Case 6"),i.contentNodes.push(n),i.childNodes.push(o),o.parent=i,n.parent=i,i.addMathmlNodes(n.mathml),i.addMathmlNodes(o.mathml),a=i):wu(o)?(dc.getInstance().output("Juxta Heuristic Case 7"),o.contentNodes.unshift(n),o.childNodes.unshift(i),i.parent=o,n.parent=o,o.addMathmlNodes(n.mathml),o.addMathmlNodes(i.mathml),a=o):(dc.getInstance().output("Juxta Heuristic Case 8"),a=Bu.factory.makeBranchNode(Kc.INFIXOP,[i,o],[n],n.textContent),a.role=Yc.IMPLICIT),t.push(a),Zu(t.concat(r),e,s)}function tp(t){return t.childNodes[0]&&t.childNodes[0].childNodes[0]&&Oc(t.childNodes[0])===Cd.MPADDED&&Oc(t.childNodes[0].childNodes[0])===Cd.MPADDED&&Oc(t.childNodes[0].childNodes[t.childNodes[0].childNodes.length-1])===Cd.MPHANTOM}Bu.add(new Wu("combine_juxtaposition",function(t){for(let e,s=t.childNodes.length-1;e=t.childNodes[s];s--)wu(e)&&!e.nobreaking&&(t.childNodes.splice(s,1,...e.childNodes),t.contentNodes.splice(s,0,...e.contentNodes),e.childNodes.concat(e.contentNodes).forEach(function(e){e.parent=t}),t.addMathmlNodes(e.mathml));return t})),Bu.add(new Wu("propagateSimpleFunction",t=>(t.type!==Kc.INFIXOP&&t.type!==Kc.FRACTION||!t.childNodes.every(Tu)||(t.role=Yc.COMPFUNC),t),t=>"clearspeak"===Bu.options.domain)),Bu.add(new Wu("simpleNamedFunction",t=>(t.role!==Yc.UNIT&&-1!==["f","g","h","F","G","H"].indexOf(t.textContent)&&(t.role=Yc.SIMPLEFUNC),t),t=>"clearspeak"===Bu.options.domain)),Bu.add(new Wu("propagateComposedFunction",t=>(t.type===Kc.FENCED&&t.childNodes[0].role===Yc.COMPFUNC&&(t.role=Yc.COMPFUNC),t),t=>"clearspeak"===Bu.options.domain)),Bu.add(new Wu("multioperator",t=>{t.role!==Yc.UNKNOWN||t.textContent.length<=1||(ju.compSemantics(t,"role",Yc),ju.compSemantics(t,"type",Kc))})),Bu.add(new Vu("convert_juxtaposition",t=>{let e=Xd(t,function(t){return t.textContent===id.invisibleTimes&&t.type===Kc.OPERATOR});e=e.rel.length?function(t){const e=[],s=[];let i=t.comp.shift(),n=null,r=[];for(;t.comp.length;)if(r=[],i.length)n&&e.push(n),s.push(i),n=t.rel.shift(),i=t.comp.shift();else{for(n&&r.push(n);!i.length&&t.comp.length;)i=t.comp.shift(),r.push(t.rel.shift());n=Qu(r,i,s)}r.length||i.length?(e.push(n),s.push(i)):(r.push(n),Qu(r,i,s));return{rel:e,comp:s}}(e):e,t=e.comp[0];for(let s,i,n=1;s=e.comp[n],i=e.rel[n-1];n++)t.push(i),t=t.concat(s);return e=Xd(t,function(t){return t.textContent===id.invisibleTimes&&(t.type===Kc.OPERATOR||t.type===Kc.INFIXOP)}),e.rel.length?Zu(e.comp.shift(),e.rel,e.comp):t})),Bu.add(new Wu("simple2prefix",t=>(t.textContent.length>1&&!t.textContent[0].match(/[A-Z]/)&&(t.role=Yc.PREFIXFUNC),t),t=>"braille"===Bu.options.modality&&t.type===Kc.IDENTIFIER)),Bu.add(new Wu("detect_cycle",t=>{t.type=Kc.MATRIX,t.role=Yc.CYCLE;const e=t.childNodes[0];return e.type=Kc.ROW,e.role=Yc.CYCLE,e.textContent="",e.contentNodes=[],t},t=>t.type===Kc.FENCED&&t.childNodes[0].type===Kc.INFIXOP&&t.childNodes[0].role===Yc.IMPLICIT&&t.childNodes[0].childNodes.every(function(t){return t.type===Kc.NUMBER})&&t.childNodes[0].contentNodes.every(function(t){return t.role===Yc.SPACE}))),Bu.add(new Vu("intvar_from_implicit",function(t){const e=t[0].childNodes;t.splice(0,1,...e),t.forEach(t=>t.parent=null)},t=>t[0]&&Au(t[0]))),Bu.add(new Wu("intvar_from_fraction",function(t){const e=t.childNodes[1],s=e.childNodes[0];if(ru(s))return void(s.role=Yc.INTEGRAL);if(!Au(s))return;const i=s.childNodes.length,n=s.childNodes[i-2],r=s.childNodes[i-1];if(ru(r))return void(r.role=Yc.INTEGRAL);if(nu(n,r)){const t=ju.getInstance().prefixNode_(r,[n]);t.role=Yc.INTEGRAL,2===i?e.childNodes[0]=t:(s.childNodes.pop(),s.contentNodes.pop(),s.childNodes[i-2]=t,t.parent=s)}},t=>{if(t.type!==Kc.INTEGRAL)return!1;const[,e,s]=t.childNodes;return s.type===Kc.EMPTY&&e.type===Kc.FRACTION})),Bu.add(new Wu("rewrite_subcases",function(t){t.addAnnotation("Emph","top");let e=[];if(t.hasAnnotation("Emph","left")){const s=sp(t.childNodes[0].childNodes[0].childNodes[0],!0);s.forEach(t=>t.addAnnotation("Emph","left")),e=e.concat(s);for(let e,s=0;e=t.childNodes[s];s++)e.childNodes.shift()}if(e.push(t),t.hasAnnotation("Emph","right")){const s=sp(t.childNodes[0].childNodes[t.childNodes[0].childNodes.length-1].childNodes[0]);s.forEach(t=>t.addAnnotation("Emph","left")),e=e.concat(s),t.childNodes[0].childNodes.pop()}ju.tableToMultiline(t);const s=ju.getInstance().row(e),i=t.annotation.Emph;return t.annotation.Emph=["table"],i.forEach(t=>s.addAnnotation("Emph",t)),s},t=>{let e=!0,s=!0;const i=t.childNodes[0].childNodes[0];if(!i)return!1;if(tp(i.mathmlTree)){for(let s,i=1;s=t.childNodes[i];i++)if(s.childNodes[0].childNodes.length){e=!1;break}}else e=!1;e&&t.addAnnotation("Emph","left");if(tp(t.childNodes[0].childNodes[t.childNodes[0].childNodes.length-1].mathmlTree)){const e=t.childNodes[0].childNodes.length;for(let i,n=1;i=t.childNodes[n];n++)if(i.childNodes.length>=e){s=!1;break}}else s=!1;return s&&t.addAnnotation("Emph","right"),e||s}));const ep=[Kc.PUNCTUATED,Kc.RELSEQ,Kc.MULTIREL,Kc.INFIXOP,Kc.PREFIXOP,Kc.POSTFIXOP];function sp(t,e){if(!t.childNodes.length)return np(t),[t];let s=null;if(t.type===Kc.PUNCTUATED&&(e?t.role===Yc.ENDPUNCT:t.role===Yc.STARTPUNCT)){const i=t.childNodes;np(i[e?i.length-1:0])&&(t=i[e?0:i.length-1],s=i[e?i.length-1:0])}if(-1!==ep.indexOf(t.type)){const i=t.childNodes;np(i[e?i.length-1:0]);const n=Yu.combineContentChildren(t.type,t.role,t.contentNodes,t.childNodes);return s&&(e?n.push(s):n.unshift(s)),n}return s?e?[t,s]:[s,t]:[t]}const ip={[Yc.METRIC]:Yc.METRIC,[Yc.VBAR]:Yc.NEUTRAL,[Yc.OPENFENCE]:Yc.OPEN,[Yc.CLOSEFENCE]:Yc.CLOSE};function np(t){if(t.type!==Kc.PUNCTUATION)return!1;const e=ip[t.role];return!!e&&(t.role=e,t.type=Kc.FENCE,t.addAnnotation("Emph","fence"),!0)}function rp(t,e,s,i=s){const n=[];for(;t&&t.role===s;)n.push(t),t=e.shift();return n.length?(t&&e.unshift(t),[1===n.length?n[0]:op(n,i),e]):[t,e]}function op(t,e){const s=Bu.factory.makeBranchNode(Kc.PUNCTUATION,t,[]);return s.role=e,s}function ap(t){return["[","\uff3b"].includes(t)}function lp(t){return["]","\uff3d"].includes(t)}function hp(t){return["(","\u207d","\u208d"].includes(t)}function cp(t){return[")","\u207e","\u208e"].includes(t)}function dp(t){return t.role===Yc.INFTY||t.type===Kc.PREFIXOP&&t.childNodes[0].role===Yc.INFTY}function up(t){const e=t.childNodes[0];if(t.type!==Kc.FENCED||(null==e?void 0:e.type)!==Kc.PUNCTUATED||3!==(null==e?void 0:e.childNodes.length)||1!==(null==e?void 0:e.contentNodes.length)||(null==e?void 0:e.childNodes[1].role)!==Yc.COMMA)return!1;const s=t.childNodes[0].childNodes[0],i=t.childNodes[0].childNodes[2],n=t.contentNodes[0].textContent,r=t.contentNodes[1].textContent;return!!(ap(n)&&cp(r)||hp(n)&&lp(r))||!(!hp(n)||!cp(r)||!dp(s)&&!dp(i))}function pp(t){return bp(t)||function(t){return fp(t)||t.type===Kc.INFIXOP&&t.role===Yc.IMPLICIT&&(2===t.childNodes.length&&(fp(t.childNodes[0])||bp(t.childNodes[0]))&&fp(t.childNodes[1])||3===t.childNodes.length&&bp(t.childNodes[0])&&fp(t.childNodes[1])&&fp(t.childNodes[2]))}(t)||function(t){return t.type===Kc.PUNCTUATED&&t.role===Yc.ENDPUNCT&&2===t.childNodes.length&&t.childNodes[1].role===Yc.DEGREE&&(fp(t.childNodes[0])||gp(t.childNodes[0])||t.childNodes[0].type===Kc.PREFIXOP&&t.childNodes[0].role===Yc.NEGATIVE&&(fp(t.childNodes[0].childNodes[0])||gp(t.childNodes[0].childNodes[0])))}(t)||function(t){return t.type===Kc.PREFIXOP&&t.role===Yc.NEGATIVE&&mp(t.childNodes[0])&&t.childNodes[0].type!==Kc.PREFIXOP&&t.childNodes[0].type!==Kc.APPL&&t.childNodes[0].type!==Kc.PUNCTUATED}(t)||function(t){return t.type===Kc.APPL&&(t.childNodes[0].role===Yc.PREFIXFUNC||t.childNodes[0].role===Yc.SIMPLEFUNC)&&(mp(t.childNodes[1])||t.childNodes[1].type===Kc.FENCED&&mp(t.childNodes[1].childNodes[0]))}(t)}function mp(t){return t.hasAnnotation("clearspeak","simple")}function fp(t){return t.type===Kc.IDENTIFIER&&(t.role===Yc.LATINLETTER||t.role===Yc.GREEKLETTER||t.role===Yc.OTHERLETTER||t.role===Yc.SIMPLEFUNC)}function gp(t){return t.type===Kc.NUMBER&&(t.role===Yc.INTEGER||t.role===Yc.FLOAT)}function bp(t){return gp(t)||function(t){if(Ep("Fraction_Over")||Ep("Fraction_FracOver"))return!1;if(t.type!==Kc.FRACTION||t.role!==Yc.VULGAR)return!1;if(Ep("Fraction_Ordinal"))return!0;const e=parseInt(t.childNodes[0].textContent,10),s=parseInt(t.childNodes[1].textContent,10);return e>0&&e<20&&s>0&&s<11}(t)}function Ep(t){return gc.getInstance().options.style===t}function xp(t){return t.type===Kc.TEXT&&t.role!==Yc.LABEL||t.type===Kc.PUNCTUATED&&t.role===Yc.TEXT&&gp(t.childNodes[0])&&function(t){for(let e=0;e<t.length-1;e++)if(t[e].type!==Kc.TEXT||""!==t[e].textContent)return!1;return t[t.length-1].type===Kc.TEXT}(t.childNodes.slice(1))||t.type===Kc.IDENTIFIER&&t.role===Yc.UNIT||t.type===Kc.INFIXOP&&(t.role===Yc.IMPLICIT||t.role===Yc.UNIT)}Bu.add(new Vu("ellipses",t=>{const e=[];let s=t.shift();for(;s;)[s,t]=rp(s,t,Yc.FULLSTOP,Yc.ELLIPSIS),[s,t]=rp(s,t,Yc.DASH),e.push(s),s=t.shift();return e},t=>t.length>1)),Bu.add(new Vu("op_with_limits",t=>{const e=t[0];return e.type=Kc.LARGEOP,e.role=Yc.SUM,t},t=>(t[0].type===Kc.OPERATOR||t[0].type===Kc.IDENTIFIER&&"OP"===t[0].attributes.texclass)&&t.slice(1).some(t=>t.type===Kc.RELSEQ||t.type===Kc.MULTIREL||t.type===Kc.INFIXOP&&t.role===Yc.ELEMENT||t.type===Kc.PUNCTUATED&&t.role===Yc.SEQUENCE))),Bu.add(new class extends Hu{}("function_from_identifiers",t=>{const e=Lc(t.childNodes).map(t=>t.textContent.trim()).join("");if(od.Meaning.get(e).type===Kc.UNKNOWN)return t;const s=Bu.factory.makeLeafNode(e,ju.getInstance().font(t.getAttribute("mathvariant")));return s.mathmlTree=t,s},t=>{const e=Lc(t.childNodes);return!(e.length<2)&&e.every(t=>Oc(t)===Cd.MI&&od.Meaning.get(t.textContent.trim()).role===Yc.LATINLETTER)})),Bu.add(new Vu("bracketed_interval",t=>{const e=t[0],s=t[1],i=t.slice(2),n=ju.getInstance().row(i),r=Bu.factory.makeBranchNode(Kc.FENCED,[n],[e,s]);return r.role=Yc.INTERVAL,r},t=>{const e=t[0],s=t[1],i=t.slice(2);if(!(e&&s&&(lp(e.textContent)&&(ap(s.textContent)||lp(s.textContent))||ap(s.textContent)&&(ap(e.textContent)||lp(e.textContent)))))return!1;if(1===i.length&&i[0].type===Kc.PUNCTUATED&&1===i[0].contentNodes.length)return!0;const n=Xd(i,cu);return!(1!==n.rel.length||!n.comp[0].length||!n.comp[1].length)})),Bu.add(new Wu("interval_heuristic",t=>(t.role=Yc.INTERVAL,t),t=>up(t))),Bu.add(new Wu("propagateInterval",t=>(t.childNodes.forEach(t=>{up(t)&&(t.role=Yc.INTERVAL)}),t),t=>Pu(t))),jc(new Dc("clearspeak","simple",function(t){return pp(t)?"simple":""})),_c("clearspeak","simple"),jc(new Dc("clearspeak","unit",function(t){return xp(t)?"unit":""})),_c("clearspeak","unit");const yp=[Kc.MULTIREL,Kc.RELSEQ,Kc.APPL,Kc.ROW,Kc.LINE],Np=[Kc.SUBSCRIPT,Kc.SUPERSCRIPT,Kc.OVERSCORE,Kc.UNDERSCORE];function Tp(t,e){const s=t.parent;if(!s)return!1;const i=s.type;return-1!==yp.indexOf(i)||i===Kc.PREFIXOP&&s.role===Yc.NEGATIVE&&!e.script&&!e.enclosed||i===Kc.PREFIXOP&&s.role===Yc.GEOMETRY||!(i!==Kc.PUNCTUATED||e.enclosed&&s.role!==Yc.TEXT)}jc(new kc("nemeth","number",function(t,e){return t.childNodes.length?(-1!==Np.indexOf(t.type)&&(e.script=!0),t.type===Kc.FENCED?(e.number=!1,e.enclosed=!0,["",e]):t.type===Kc.PREFIXOP&&t.role!==Yc.GEOMETRY&&t.role!==Yc.NEGATIVE?(e.number=!1,["",e]):(Tp(t,e)&&(e.number=!0,e.enclosed=!1),["",e])):(Tp(t,e)&&(e.number=!0,e.script=!1,e.enclosed=!1),[e.number?"number":"",{number:!1,enclosed:e.enclosed,script:e.script}])},{number:!0})),_c("nemeth","number"),jc(new kc("depth","depth",function(t){return t.parent?[parseInt(t.parent.annotation.depth[0])+1]:[1]})),_c("depth","depth");class vp{static empty(){const t=Cc("<math/>"),e=new vp(t,new uc);return e.mathml=t,e}static fromNode(t,e){const s=vp.empty();return s.root=t,e&&(s.mathml=e),s}static fromRoot(t,e){let s=t;for(;s.parent;)s=s.parent;const i=vp.fromNode(s);return e&&(i.mathml=e),i}static fromXml(t){const e=vp.empty();return t.childNodes[0]&&(e.root=Kd.fromXml(t.childNodes[0])),e}constructor(t,e){this.mathml=t,this.options=e,this.parser=new Uu(e),this.root=this.parser.parse(t),this.root=ju.rewriteTrivialTable(this.root),this.collator=this.parser.getFactory().leafMap.collateMeaning();const s=this.collator.newDefault();s&&(this.parser=new Uu(e),this.parser.getFactory().defaultMap=s,this.root=this.parser.parse(t)),Lp.visit(this.root,{}),function(t){for(const e of Pc.values())e.active&&e.annotate(t);for(const e of Bc.values())e.active&&e.visit(t,Object.assign({},e.def))}(this.root),dc.getInstance().generate(()=>function(t){const e=new Map,s=t=>{if(t.mathmlTree){const s=e.get(t.mathmlTree)||new Set;s.add(t),e.set(t.mathmlTree,s)}t.childNodes.forEach(s),t.contentNodes.forEach(s)};s(t);const i=[];for(const[t,s]of e)s.size>1&&i.push(`DUPLICATE mathmlTree: ${Oc(t)} shared by `+Array.from(s).map(t=>`${t.id}:${t.type}:${t.role}`).join(", "));return i}(this.root))}xml(t){const e=Cc("<stree></stree>"),s=this.root.xml(e.ownerDocument,t);return e.appendChild(s),e}toString(t){return Mc(this.xml(t))}formatXml(t){return Sc(this.toString(t))}displayTree(){this.root.displayTree()}replaceNode(t,e){const s=t.parent;s?s.replaceChild(t,e):this.root=e}toJson(){const t={};return t.stree=this.root.toJson(),t}}const Lp=new kc("general","unit",(t,e)=>(Su(t)&&(t.role=Yc.UNIT),!1));function Cp(t,e){return new vp(t,e)}const Rp=[],Ip=!0,Sp=new Map;function Ap(t){dc.getInstance().generate(()=>["WALKING START: ",t.toString()]);const e=function(t){for(let e,s=0;e=Rp[s];s++)if(e.test(t))return e.constr(t);return null}(t);let s;if(e)return s=e.getMathml(),dc.getInstance().generate(()=>["WALKING END (1): ",t.toString()]),qp(s,t);if(1===t.mathml.length){if(dc.getInstance().output("Walktree Case 0"),!t.childNodes.length){dc.getInstance().output("Walktree Case 0.1"),s=t.mathml[0],Ku(s,t),dc.getInstance().generate(()=>["WALKING END (2): ",t.toString()]);return qp(s,t.getAnnotation("empty").length&&!t.hasAnnotation("empty","MFENCED")?t:void 0)}const e=t.childNodes[0];if(1===t.childNodes.length&&e.type===Kc.EMPTY)return dc.getInstance().output("Walktree Case 0.2"),s=t.mathml[0],Ku(s,t),s.appendChild(Ap(e)),dc.getInstance().generate(()=>["WALKING END (3): ",t.toString()]),qp(s);t.childNodes.forEach(t=>{t.mathml.length||t.addMathmlNodes([Zp(t)])})}const i=t.contentNodes.map(Yp);tm(t,i);const n=t.childNodes.map(Ap),r=Yu.combineContentChildren(t.type,t.role,i,n);if(s=t.mathmlTree,null===s)dc.getInstance().output("Walktree Case 1"),s=wp(r,t);else{s=Qp(s);const e=Up(r);if(dc.getInstance().output("Walktree Case 2"),e){dc.getInstance().output("Walktree Case 2.1");const i=Kp(e);if(i&&t.parent&&e!==s&&Ud(s,i)){dc.getInstance().output("Walktree Case 2.1.fallback");const e=em(s);if(e!==s&&e.hasAttribute(zu.ID))return Dp(Kp(s)||s,r,t),Sp.has(t.id)||(Sp.set(t.id,!0),Ku(s,t)),dc.getInstance().generate(()=>["WALKING END (4): ",t.toString()]),qp(s,t);s=e}else s=i}else dc.getInstance().output("Walktree Case 2.2"),s=em(s)}return Dp(s,r,t),Sp.has(t.id)||(Sp.set(t.id,!0),Ku(s,t)),dc.getInstance().generate(()=>["WALKING END (5): ",t.toString()]),qp(s,t)}function wp(t,e){const s=function(t){const e=Up(t);if(!e)return{type:Fp.INVALID,node:null};const s=Up(t.slice().reverse());if(e===s)return{type:Fp.VALID,node:e};const i=Hp(e),n=function(t,e){let s=0;for(;t[s]&&-1===e.indexOf(t[s]);)s++;return t.slice(0,s+1)}(i,t),r=Hp(s,function(t){return-1!==n.indexOf(t)}),o=r[0],a=n.indexOf(o);if(-1===a)return{type:Fp.INVALID,node:null};return{type:n.length!==i.length?Fp.PRUNED:Wp(n[a+1],r[1])?Fp.VALID:Fp.INVALID,node:o}}(t);let i=s.node;const n=s.type;if(n!==Fp.VALID||!Pd(i)||!i.parentNode&&e.parent)if(dc.getInstance().output("Walktree Case 1.1"),i=$u(),n===Fp.PRUNED)dc.getInstance().output("Walktree Case 1.1.0"),i=function(t,e,s){let i=Xp(e);if(Dd(i)){dc.getInstance().output("Walktree Case 1.1.0.0"),Op(i,t),Lc(i.childNodes).forEach(function(e){t.appendChild(e)});const e=t;t=i,i=e}const n=s.indexOf(e);return s[n]=i,Rc(i,t),t.appendChild(i),s.forEach(function(e){t.appendChild(e)}),t}(i,s.node,t);else if(t[0]){dc.getInstance().output("Walktree Case 1.1.1");const s=Up(t);if(s){dc.getInstance().output("Walktree Case 1.1.1.0");const n=function(t,e){const s=Lc(t.childNodes);let i=1/0,n=-1/0;return e.forEach(function(t){const e=s.indexOf(t);-1!==e&&(i=Math.min(i,e),n=Math.max(n,e))}),s.slice(i,n+1)}(Kp(s),t);!function(t,e){if("postfixop"!==t.type)return;const s=e[e.length-1],i=s.nextSibling;i&&function(t){return Oc(t)===Cd.MROW&&"ORD"===t.getAttribute("data-mjx-texclass")&&0===t.childNodes.length}(i)&&e.push(i)}(e,n),Rc(s,i),n.forEach(function(t){i.appendChild(t)})}else dc.getInstance().output("Walktree Case 1.1.1.1"),Op(i,t[0]),i=t[0]}return e.mathmlTree||(e.mathmlTree=i),i}function Op(t,e){for(const s of Gu)t.hasAttribute(s)&&(e.setAttribute(s,t.getAttribute(s)),t.removeAttribute(s))}function Mp(t,e){const s=[];let i=Lc(t.childNodes);for(;i.length;){const t=i.shift();t.nodeType===vc.ELEMENT_NODE&&(t.hasAttribute(zu.TYPE)||-1!==e.indexOf(t)?s.push(t):i=Lc(t.childNodes).concat(i))}return s}function Dp(t,e,s){if(!e.length)return;if(1===e.length&&t===e[0])return;const i=s.role===Yc.IMPLICIT&&Bu.flags.combine_juxtaposition?function(t,e,s){const i=[];let n=Lc(t.childNodes),r=!1;for(;n.length;){const t=n.shift();if(t.hasAttribute(zu.TYPE)){i.push(t);continue}const s=Mp(t,e);0!==s.length&&(1!==s.length?(r?t.setAttribute("AuxiliaryImplicit",!0):r=!0,n=s.concat(n)):i.push(t))}const o=[],a=s.childNodes.map(function(t){return t.mathmlTree});for(;a.length;){const t=a.pop();if(t){if(-1!==i.indexOf(t))break;-1!==e.indexOf(t)&&o.unshift(t)}}return i.concat(o)}(t,e,s):Lc(t.childNodes);if(!i.length)return void e.forEach(function(e){Bp(t,e)||t.appendChild(e)});let n=0;const r=Fd(_d,"mergeChildren infinite loop");for(;e.length;){r();const s=e[0];if(i[n]===s||_p(i[n],s)){e.shift(),n++;continue}if(i[n]&&-1===e.indexOf(i[n])){n++;continue}if(Ud(s,t)){e.shift();continue}const o=i[n];if(!o){if(s.parentNode){t=Kp(s),e.shift();continue}const i=e[1];if(i&&i.parentNode){let n=Kp(i),r=i;for(;n&&n!==t&&jd(n);)r=n,n=Kp(n);Pp(t=n,s,r),e.shift(),e.shift();continue}Pp(t,s,null),e.shift();continue}kp(t,o,s),e.shift()}}function kp(t,e,s){let i=e,n=Kp(i);const r=Fd(_d,()=>`insertNewChild loop: next=${null==n?void 0:n.tagName} parent=${null==i?void 0:i.tagName}`);for(;n&&jp(n,i)&&!i.hasAttribute("AuxiliaryImplicit")&&n!==t;)r(),i=n,n=Kp(i);n&&(Pp(n,s,i),i.removeAttribute("AuxiliaryImplicit"))}function Pp(t,e,s){Bp(t,e)||(Oc(t)===Cd.MACTION?Pp(Kp(t),e,t):t.insertBefore(e,s))}function Bp(t,e){return t===e||Ud(t,e)}function jp(t,e){if(Oc(t)!==Cd.MACTION)return t.firstChild===e;const s=parseInt(t.getAttribute("selection"))||1;return t.childNodes[s-1]===e}function _p(t,e){const s=id.functionApplication;if(t&&e&&t.textContent&&e.textContent&&t.textContent===s&&e.textContent===s&&"true"===e.getAttribute(zu.ADDED)){for(let s,i=0;s=t.attributes[i];i++)e.hasAttribute(s.nodeName)||e.setAttribute(s.nodeName,s.nodeValue);return Rc(t,e),!0}return!1}var Fp;function Up(t){let e=0,s=null;for(;!s&&e<t.length;)t[e].parentNode&&(s=t[e]),e++;return s}function Hp(t,e){const s=e||(t=>!1),i=[t],n=Fd(_d,()=>{var e;return`pathToRoot infinite loop at ${t.tagName} parent=${null===(e=t.parentNode)||void 0===e?void 0:e.tagName}`});for(;!s(t)&&!Dd(t)&&t.parentNode;)n(),t=Kp(t),i.unshift(t);return i}function Wp(t,e){return!(!t||!e||Vp(t,"previousSibling")||Vp(e,"nextSibling"))}function Vp(t,e){let s=t[e];for(;s;){if(!Jp(s))return!0;s=s[e]}return!1}function qp(t,e){var s,i;const n=e&&!e.hasAnnotation("empty","MFENCED")&&e.getAnnotation("empty"),r=null===(s=null==e?void 0:e.parent)||void 0===s?void 0:s.mathmlTree,o=Fd(_d,()=>{var e;return`ascendNewNode infinite loop at ${t.tagName} parent=${null===(e=t.parentNode)||void 0===e?void 0:e.tagName}`}),a=!(!e||!e.parent);for(;t!==r&&!Dd(t)&&(!a||!Dd(Kp(t)))&&(zp(t)||n&&t.parentNode&&(!r||Ud(t,r))&&n.includes(null===(i=Kp(t).tagName)||void 0===i?void 0:i.toUpperCase())&&Gp(t));)o(),t=Kp(t);return t}function Xp(t){const e=Lc(t.childNodes);if(!e)return t;const s=e.filter(function(t){return t.nodeType===vc.ELEMENT_NODE&&!kd(t)});return 1===s.length&&Pd(s[0])&&!s[0].hasAttribute(zu.TYPE)?Xp(s[0]):t}function zp(t){const e=Kp(t);return!(!e||!Pd(e))&&Gp(t)}function Gp(t){const e=Kp(t);return!!e&&Lc(e.childNodes).every(function(e){return e===t||Jp(e)})}function Jp(t){if(t.nodeType!==vc.ELEMENT_NODE)return!0;if(!t||kd(t))return!0;const e=Lc(t.childNodes);return!(!Pd(t)&&e.length||function(t){return!!t&&Od.includes(Oc(t))}(t)||Gd(t)||t.hasAttribute(zu.TYPE)||Bd(t))&&Lc(t.childNodes).every(Jp)}function Kp(t){return t.parentNode}function $p(t,e){const s=new Yu(e);t.setAttribute(zu.COLLAPSED,s.toString())}function Yp(t){if(t.mathml.length)return qp(Ap(t),t);const e=Ip?Zp(t):$u();return t.addMathmlNodes([e]),e}function Qp(t){if(Oc(t)!==Cd.MFENCED)return t;const e=$u();for(let s,i=0;s=t.attributes[i];i++)-1===["open","close","separators"].indexOf(s.name)&&e.setAttribute(s.name,s.value);return Lc(t.childNodes).forEach(function(t){e.appendChild(t)}),Rc(t,e),e}function Zp(t){const e=Ic("mo"),s=(i=t.textContent,hc.document.createTextNode(i));var i;return e.appendChild(s),Ku(e,t),e.setAttribute(zu.ADDED,"true"),e}function tm(t,e){const s=t.type+(t.textContent?","+t.textContent:"");e.forEach(function(t){em(t).setAttribute(zu.OPERATOR,s)})}function em(t){if(kd(t))return t;const e=Lc(t.childNodes);if(!e)return t;const s=e.filter(function(t){return!Jp(t)}),i=[];for(let t,e=0;t=s[e];e++)if(Pd(t)&&t.getAttribute(zu.TYPE)!==Kc.PUNCTUATION){const e=em(t);e&&e!==t&&i.push(e)}else i.push(t);return 1===i.length?i[0]:t}function sm(t){return Sc(t.toString()).toString().replace(new RegExp(Xu,"g"),"")}function im(t,e){const s=!!e,i=e||[],n=t.parent,r=t.contentNodes.map(function(t){return t.id});r.unshift("c");const o=[t.id,r];for(let e,r=0;e=t.childNodes[r];r++){const t=Ap(e);i.push(t);const r=em(t);n&&!s&&r.setAttribute(zu.PARENT,n.id.toString()),o.push(e.id)}return o}!function(t){t.VALID="valid",t.INVALID="invalid",t.PRUNED="pruned"}(Fp||(Fp={}));class nm{constructor(t){this.semantic=t}}class rm extends nm{static test(t){return!t.mathmlTree&&t.type===Kc.LINE&&t.role===Yc.BINOMIAL}constructor(t){super(t),this.mml=t.mathmlTree}getMathml(){if(!this.semantic.childNodes.length)return this.mml;const t=this.semantic.childNodes[0];if(this.mml=Ap(t),this.mml.hasAttribute(zu.TYPE)){const t=$u();Rc(this.mml,t),t.appendChild(this.mml),this.mml=t}return Ku(this.mml,this.semantic),this.mml}}class om extends nm{static test(t){var e,s;return!!t.getAnnotation("collapsed").length&&(null===(s=null===(e=t.mathmlTree)||void 0===e?void 0:e.parentNode)||void 0===s?void 0:s.childNodes.length)>2}getMathml(){Ap(this.semantic.childNodes[0]),Ap(this.semantic.childNodes[1]);const t=this.semantic.mathmlTree,e=wp([this.semantic.childNodes[0].mathmlTree,t],this.semantic);return Ku(e,this.semantic),e}}class am extends nm{static test(t){if(!t.mathmlTree||!t.childNodes.length)return!1;const e=Oc(t.mathmlTree),s=t.childNodes[0].role;return e===Cd.MSUBSUP&&s===Yc.SUBSUP||e===Cd.MUNDEROVER&&s===Yc.UNDEROVER}constructor(t){super(t),this.mml=t.mathmlTree}getMathml(){const t=this.semantic.childNodes[0],e=t.childNodes[0],s=this.semantic.childNodes[1],i=t.childNodes[1],n=Ap(s),r=Ap(e),o=Ap(i);return Ku(this.mml,this.semantic),this.mml.setAttribute(zu.CHILDREN,Ju([e,i,s])),[r,o,n].forEach(t=>em(t).setAttribute(zu.PARENT,this.mml.getAttribute(zu.ID))),this.mml.setAttribute(zu.TYPE,t.role),$p(this.mml,[this.semantic.id,[t.id,e.id,i.id],s.id]),this.mml}}class lm extends nm{static multiscriptIndex(t){return t.type===Kc.PUNCTUATED&&t.contentNodes[0].role===Yc.DUMMY&&t.hasAnnotation("general","script")?im(t):(Ap(t),t.id)}static createNone_(t){const e=Ic("none");return t&&Ku(e,t),e.setAttribute(zu.ADDED,"true"),e}constructor(t){super(t),this.mml=t.mathmlTree}completeMultiscript(t,e){const s=Lc(this.mml.childNodes).slice(1);let i=0;const n=t=>{for(const e of t){const t=s[i];if(t&&e===parseInt(t.getAttribute(zu.ID)))t.setAttribute(zu.PARENT,this.semantic.id.toString()),i++;else if(t&&e===parseInt(em(t).getAttribute(zu.ID)))em(t).setAttribute(zu.PARENT,this.semantic.id.toString()),i++;else{const s=this.semantic.querySelectorAll(t=>t.id===e);this.mml.insertBefore(lm.createNone_(s[0]),t||null)}}};n(t),s[i]&&Oc(s[i])!==Cd.MPRESCRIPTS?this.mml.insertBefore(s[i],Ic("mprescripts")):i++,n(e)}}class hm extends lm{static test(t){if(!t.mathmlTree)return!1;return Oc(t.mathmlTree)===Cd.MMULTISCRIPTS&&(t.type===Kc.SUPERSCRIPT||t.type===Kc.SUBSCRIPT)}constructor(t){super(t)}getMathml(){let t,e,s;if(Ku(this.mml,this.semantic),this.semantic.childNodes[0]&&this.semantic.childNodes[0].role===Yc.SUBSUP){const i=this.semantic.childNodes[0];t=i.childNodes[0],e=lm.multiscriptIndex(this.semantic.childNodes[1]),s=lm.multiscriptIndex(i.childNodes[1]);const n=[this.semantic.id,[i.id,t.id,s],e];$p(this.mml,n),this.mml.setAttribute(zu.TYPE,i.role),this.completeMultiscript(Yu.interleaveIds(s,e),[])}else{t=this.semantic.childNodes[0],e=lm.multiscriptIndex(this.semantic.childNodes[1]);const s=[this.semantic.id,t.id,e];$p(this.mml,s)}const i=Yu.collapsedLeafs(s||[],e);return em(Ap(t)).setAttribute(zu.PARENT,this.semantic.id.toString()),i.unshift(t.id),this.mml.setAttribute(zu.CHILDREN,i.join(",")),this.mml}}class cm extends lm{static test(t){return!!t.mathmlTree&&t.type===Kc.TENSOR}constructor(t){super(t)}getMathml(){Ap(this.semantic.childNodes[0]);const t=lm.multiscriptIndex(this.semantic.childNodes[1]),e=lm.multiscriptIndex(this.semantic.childNodes[2]),s=lm.multiscriptIndex(this.semantic.childNodes[3]),i=lm.multiscriptIndex(this.semantic.childNodes[4]);Ku(this.mml,this.semantic);const n=[this.semantic.id,this.semantic.childNodes[0].id,t,e,s,i];$p(this.mml,n);const r=Yu.collapsedLeafs(t,e,s,i);return r.unshift(this.semantic.childNodes[0].id),this.mml.setAttribute(zu.CHILDREN,r.join(",")),this.completeMultiscript(Yu.interleaveIds(s,i),Yu.interleaveIds(t,e)),this.mml}}class dm extends nm{static test(t){return!(!t.mathmlTree||!t.fencePointer||t.mathmlTree.getAttribute("data-semantic-type"))}static makeEmptyNode_(t){const e=$u(),s=new Kd(t);return s.type=Kc.EMPTY,s.mathmlTree=e,s}static fencedMap_(t,e){e[t.id]=t.mathmlTree,t.embellished&&dm.fencedMap_(t.childNodes[0],e)}constructor(t){super(t),this.fenced=null,this.fencedMml=null,this.fencedMmlNodes=[],this.ofence=null,this.ofenceMml=null,this.ofenceMap={},this.cfence=null,this.cfenceMml=null,this.cfenceMap={},this.parentCleanup=[]}getMathml(){this.getFenced_(),this.fencedMml=qp(Ap(this.fenced),this.fenced),this.getFencesMml_(),this.fenced.type!==Kc.EMPTY||this.fencedMml.parentNode||(this.fencedMml.setAttribute(zu.ADDED,"true"),this.cfenceMml.parentNode.insertBefore(this.fencedMml,this.cfenceMml)),this.getFencedMml_();return this.rewrite_()}fencedElement(t){return t.type===Kc.FENCED||t.type===Kc.MATRIX||t.type===Kc.VECTOR}getFenced_(){let t=this.semantic;for(;!this.fencedElement(t);)t=t.childNodes[0];this.fenced=t.childNodes[0],this.ofence=t.contentNodes[0],this.cfence=t.contentNodes[1],dm.fencedMap_(this.ofence,this.ofenceMap),dm.fencedMap_(this.cfence,this.cfenceMap)}getFencedMml_(){let t=this.ofenceMml.nextSibling;for(t=t===this.fencedMml?t:this.fencedMml;t&&t!==this.cfenceMml&&(this.fencedMmlNodes.push(t),!Ud(this.cfenceMml,t));)t=t.nextSibling}getFencesMml_(){let t=this.semantic;const e=Object.keys(this.ofenceMap),s=Object.keys(this.cfenceMap);for(;!(this.ofenceMml&&this.cfenceMml||t===this.fenced);)-1===e.indexOf(t.fencePointer)||this.ofenceMml||(this.ofenceMml=t.mathmlTree),-1===s.indexOf(t.fencePointer)||this.cfenceMml||(this.cfenceMml=t.mathmlTree),t=t.childNodes[0];this.ofenceMml||(this.ofenceMml=this.ofence.mathmlTree),this.cfenceMml||(this.cfenceMml=this.cfence.mathmlTree),this.ofenceMml&&(this.ofenceMml=qp(this.ofenceMml)),this.cfenceMml&&(this.cfenceMml=qp(this.cfenceMml))}rewrite_(){let t=this.semantic,e=null;const s=this.introduceNewLayer_();for(Ku(s,this.fenced.parent);!this.fencedElement(t);){const i=t.mathmlTree,n=this.specialCase_(t,i);if(n)t=n;else{Ku(i,t);const e=[];for(let s,i=1;s=t.childNodes[i];i++)e.push(Ap(s));t=t.childNodes[0]}const r=Ic("dummy"),o=i.childNodes[0];Rc(i,r),Rc(s,i),Rc(i.childNodes[0],s),Rc(r,o),e||(e=i)}return Ap(this.ofence),Ap(this.cfence),this.cleanupParents_(),e||s}specialCase_(t,e){var s;const i=Oc(e);let n,r=null;if(i===Cd.MSUBSUP?(null===(s=t.childNodes[0])||void 0===s?void 0:s.role)===Yc.SUBSUP&&(r=t.childNodes[0],n=am):i===Cd.MMULTISCRIPTS&&(t.type===Kc.SUPERSCRIPT||t.type===Kc.SUBSCRIPT?n=hm:t.type===Kc.TENSOR&&(n=cm),r=n&&t.childNodes[0]&&t.childNodes[0].role===Yc.SUBSUP?t.childNodes[0]:t),!r)return null;const o=r.childNodes[0],a=dm.makeEmptyNode_(o.id);return r.childNodes[0]=a,e=new n(t).getMathml(),r.childNodes[0]=o,this.parentCleanup.push(e),r.childNodes[0]}introduceNewLayer_(){const t=this.fullFence(this.ofenceMml),e=this.fullFence(this.cfenceMml);let s=$u();if(Rc(this.fencedMml,s),this.fencedMmlNodes.forEach(t=>s.appendChild(t)),Bp(s,t)||s.insertBefore(t,this.fencedMml),Bp(s,e)||s.appendChild(e),!s.parentNode){const t=$u();for(;s.childNodes.length>0;)t.appendChild(s.childNodes[0]);s.appendChild(t),s=t}return s}fullFence(t){const e=this.fencedMml.parentNode;let s=t;for(;s.parentNode&&s.parentNode!==e;)s=s.parentNode;return s}cleanupParents_(){this.parentCleanup.forEach(function(t){const e=t.childNodes[1].getAttribute(zu.PARENT);t.childNodes[0].setAttribute(zu.PARENT,e)})}}class um extends nm{static test(t){return!!t.mathmlTree&&t.hasAnnotation("Emph","top")}constructor(t){super(t),this.mrows=[],this.mml=t.mathmlTree}getMathml(){if(this.recurseToTable(this.semantic),this.mrows.length){const t=$u();this.mml.parentNode.insertBefore(t,this.mml);for(const e of this.mrows)t.appendChild(e);t.appendChild(this.mml)}return this.mml}recurseToTable(t){var e,s;if(t.hasAnnotation("Emph","top")||t.hasAnnotation("Emph","fence")||!t.hasAnnotation("Emph","left")&&!t.hasAnnotation("Emph","right")){if(!t.mathmlTree||Oc(t.mathmlTree)===Cd.MTABLE&&(null===(e=t.annotation.Emph)||void 0===e?void 0:e.length)&&"table"!==t.annotation.Emph[0]){const e=$u();Ku(e,t),this.mrows.unshift(e)}else{if(Oc(t.mathmlTree)===Cd.MTABLE&&(null===(s=t.annotation.Emph)||void 0===s?void 0:s.length)&&"table"===t.annotation.Emph[0])return void this.finalizeTable(t);Ku(t.mathmlTree,t)}if(t.childNodes.forEach(this.recurseToTable.bind(this)),t.textContent||"punctuated"===t.type){const e=t.contentNodes.map(t=>{const e=Yp(t);return e.hasAttribute("data-semantic-added")?this.mrows.unshift(e):this.recurseToTable(t),e});return void tm(t,e)}t.contentNodes.forEach(this.recurseToTable.bind(this))}else Ap(t)}finalizeTable(t){Ku(t.mathmlTree,t),t.contentNodes.forEach(t=>{Ap(t)}),t.childNodes.forEach(t=>{Ap(t)})}}class pm extends nm{static test(t){if(!t.mathmlTree||!t.childNodes.length)return!1;const e=Oc(t.mathmlTree),s=t.type;return(s===Kc.LIMUPPER||s===Kc.LIMLOWER)&&(e===Cd.MSUBSUP||e===Cd.MUNDEROVER)||s===Kc.LIMBOTH&&(e===Cd.MSUB||e===Cd.MUNDER||e===Cd.MSUP||e===Cd.MOVER)}static walkTree_(t){t&&Ap(t)}constructor(t){super(t),this.mml=t.mathmlTree}getMathml(){const t=this.semantic.childNodes;return this.semantic.type!==Kc.LIMBOTH&&this.mml.childNodes.length>=3&&(this.mml=wp([this.mml],this.semantic)),Ku(this.mml,this.semantic),t[0].mathmlTree||(t[0].mathmlTree=this.semantic.mathmlTree),t.forEach(pm.walkTree_),this.mml}}class mm extends nm{static test(t){return!!t.mathmlTree&&t.type===Kc.LINE}constructor(t){super(t),this.mml=t.mathmlTree}getMathml(){return this.semantic.contentNodes.length&&Ap(this.semantic.contentNodes[0]),this.semantic.childNodes.length&&Ap(this.semantic.childNodes[0]),Ku(this.mml,this.semantic),this.mml}}class fm extends nm{static test(t){return!!t.mathmlTree&&(t.type===Kc.INFERENCE||t.type===Kc.PREMISES)}constructor(t){super(t),this.mml=t.mathmlTree}getMathml(){return this.semantic.childNodes.length?(this.semantic.contentNodes.forEach(function(t){Ap(t),Ku(t.mathmlTree,t)}),this.semantic.childNodes.forEach(function(t){Ap(t)}),Ku(this.mml,this.semantic),this.mml.getAttribute("data-semantic-id")===this.mml.getAttribute("data-semantic-parent")&&this.mml.removeAttribute("data-semantic-parent"),this.mml):this.mml}}class gm extends nm{static test(t){return t.type===Kc.MATRIX||t.type===Kc.VECTOR||t.type===Kc.CASES}constructor(t){super(t),this.inner=[],this.mml=t.mathmlTree}getMathml(){const t=Yp(this.semantic.contentNodes[0]),e=this.semantic.contentNodes[1]?Yp(this.semantic.contentNodes[1]):null;if(this.inner=this.semantic.childNodes.map(Ap),this.mml)if(Oc(this.mml)===Cd.MFENCED){const s=this.mml.childNodes;this.mml.insertBefore(t,s[0]||null),e&&this.mml.appendChild(e),this.mml=Qp(this.mml)}else{const s=[t,this.mml];e&&s.push(e),this.mml=wp(s,this.semantic)}else this.mml=wp([t].concat(this.inner,[e]),this.semantic);return Ku(this.mml,this.semantic),this.mml}}class bm extends nm{static test(t){return t.type===Kc.PUNCTUATED&&(t.role===Yc.TEXT||t.contentNodes.every(t=>t.role===Yc.DUMMY))}constructor(t){super(t),this.mml=t.mathmlTree}getMathml(){const t=[],e=im(this.semantic,t);return this.mml=wp(t,this.semantic),Ku(this.mml,this.semantic),this.mml.removeAttribute(zu.CONTENT),$p(this.mml,e),this.mml}}function Em(t,e){const s=function(t){return t.cloneNode(!0)}(t),i=function(t,e,s){return dc.getInstance().generate(()=>["Original MathML",sm(t)]),Sp.clear(),Ap(e.root),s.structure&&t.setAttribute(zu.STRUCTURE,Yu.fromStructure(t,e,s).toString()),dc.getInstance().generate(()=>["Semantic Tree\n",sm(e),"Semantically enriched MathML\n",sm(t)]),t}(s,Cp(s,e),e);return i}Rp.push({test:pm.test,constr:t=>new pm(t)},{test:dm.test,constr:t=>new dm(t)},{test:om.test,constr:t=>new om(t)},{test:am.test,constr:t=>new am(t)},{test:cm.test,constr:t=>new cm(t)},{test:hm.test,constr:t=>new hm(t)},{test:mm.test,constr:t=>new mm(t)},{test:rm.test,constr:t=>new rm(t)},{test:fm.test,constr:t=>new fm(t)},{test:um.test,constr:t=>new um(t)},{test:gm.test,constr:t=>new gm(t)},{test:bm.test,constr:t=>new bm(t)});const xm=new Vh({AbsoluteValue:["Auto","AbsEnd","Cardinality","Determinant"],Bar:["Auto","Conjugate"],Caps:["Auto","SayCaps"],CombinationPermutation:["Auto","ChoosePermute"],Currency:["Auto","Position","Prefix"],Ellipses:["Auto","AndSoOn"],Enclosed:["Auto","EndEnclose"],Exponent:["Auto","AfterPower","Ordinal","OrdinalPower","Exponent"],Fraction:["Auto","EndFrac","FracOver","General","GeneralEndFrac","Ordinal","Over","OverEndFrac","Per"],Functions:["Auto","None","Reciprocal"],Inference:["Auto","Long"],ImpliedTimes:["Auto","MoreImpliedTimes","None"],Log:["Auto","LnAsNaturalLog"],Matrix:["Auto","Combinatoric","EndMatrix","EndVector","SilentColNum","SpeakColNum","Vector"],MultiLineLabel:["Auto","Case","Constraint","Equation","Line","None","Row","Step"],MultiLineOverview:["Auto","None"],MultiLinePausesBetweenColumns:["Auto","Long","Short"],MultsymbolDot:["Auto","Dot"],MultsymbolX:["Auto","By","Cross"],Paren:["Auto","CoordPoint","Interval","Silent","Speak","SpeakNestingLevel"],Prime:["Auto","Angle","Length"],Roots:["Auto","PosNegSqRoot","PosNegSqRootEnd","RootEnd"],SetMemberSymbol:["Auto","Belongs","Element","Member","In"],Sets:["Auto","SilentBracket","woAll"],TriangleSymbol:["Auto","Delta"],Trig:["Auto","ArcTrig","TrigInverse","Reciprocal"],VerticalLine:["Auto","Divides","Given","SuchThat"]}),ym="Auto";function Nm(t){const e=t.split(":"),s={},i=xm.getProperties(),n=Object.keys(i);for(let t,r=0;t=e[r];r++){const e=t.split("_");if(-1===n.indexOf(e[0]))continue;const r=e[1];r&&r!==ym&&-1!==i[e[0]].indexOf(r)&&(s[e[0]]=e[1])}return s}function Tm(t){const e=Object.keys(t),s=[];for(let i=0;i<e.length;i++)s.push(e[i]+"_"+t[e[i]]);return s.length?s.join(":"):qh.DEFAULT_VALUE}const vm=Kh.LOCALES,Lm=t=>gc.getInstance().setup(t),Cm=()=>gc.getInstance().json(),Rm=t=>function(t,e){const s=Cc(t);try{return Em(s,e)}catch(t){return console.error(t),s}}(t,gc.getInstance().options),Im=Cc,Sm=function(t,e,s){if("default"===t)return e+"_"+s;const i=Nm(t);return i[e]=s,Tm(i)},Am=Nm,wm=Tm;var Om=function(t,e,s,i){return new(s||(s=Promise))(function(n,r){function o(t){try{l(i.next(t))}catch(t){r(t)}}function a(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})};let Mm={},Dm=null;function km(t){var e,s;const i=null==t?void 0:t.match(/^clearspeak-(.*)/);return Dm=null!==(s=null!==(e=i&&i[1])&&void 0!==e?e:Dm)&&void 0!==s?s:"default",Dm}const Pm=new Map;const Bm=new Map;let jm=0;function _m(t,e){const s=Pm.get(e);!function(t,e){const s=t.pool.lookup("speechRules"),i=km(t.settings.speechRules);Mm=Am(i);for(const i of e)t.factory.get("variable")(t.factory,{name:"csprf_"+i,setter:t=>{Mm[i]=t,s.setValue("clearspeak-"+wm(Mm))},getter:()=>Mm[i]||"Auto"},t.pool)}(t,Object.keys(s));const i=[];for(const t of Object.getOwnPropertyNames(s))i.push({title:t,values:s[t].map(e=>e.replace(RegExp("^"+t+"_"),"")),variable:"csprf_"+t});const n=new Fh("Clearspeak Preferences","",i,"alphabetical","square",t);return{type:"command",id:"ClearspeakPreferences",content:"Select Preferences",action:()=>n.post()}}function Fm(t,e,s){return Om(this,void 0,void 0,function*(){var i,n;const r=i=>{s(t.factory.get("subMenu")(t.factory,{items:i,id:"Clearspeak"},e))};if(!t.settings.speech||!t.settings.enrich)return void r([]);const o=t.pool.lookup("locale").getValue();if(yield function(t,e){return Om(this,void 0,void 0,function*(){Pm.has(e)||(yield t.mathItem.generatorPool.getLocalePreferences(Pm))})}(t,o),!Pm.get(o))return void r([]);const a=_m(t,o);let l=[];if(t.settings.speech){const e=t.mathItem,s=null===(i=null==e?void 0:e.explorers)||void 0===i?void 0:i.speech,r=km(t.settings.speechRules);l=l.concat(function(t){return[{type:"radio",content:"No Preferences",id:"clearspeak-default",variable:"speechRules"},{type:"radio",content:"Current Preferences",id:"clearspeak-"+t,variable:"speechRules"},{type:"rule"}]}(r));const a=null==s?void 0:s.refocus,h=null!==(n=null==a?void 0:a.getAttribute("data-semantic-id"))&&void 0!==n?n:null,c=jm++;yield e.generatorPool.getRelevantPreferences(e,h,Bm,c);const d=Bm.get(c);if(Bm.delete(c),d){const t=function(t,e,s){const i=Pm.get(s);return[{type:"label",content:"Preferences for "+e},{type:"rule"}].concat(i[e].map(function(e){const[s,i]=e.split("_");return{type:"radioCompare",content:i,id:"clearspeak-"+Sm(t,s,i),variable:"speechRules",comparator:(t,e)=>{if(t===e)return!0;if("Auto"!==i)return!1;const[n,r]=t.split("-"),[o]=e.split("-");return n===o&&!Am(r)[s]}}}))}(r,d,o);l=l.concat(t)}}l.splice(2,0,a),r(l)})}_h.DynamicSubmenus.set("Clearspeak",[Fm,"speech"]);let Um=null;function Hm(t,e,s){if(Um)return void s(Um);const i=[];for(const t of vm.keys())"nemeth"!==t&&"euro"!==t&&i.push({type:"radio",id:t,content:vm.get(t)||t,variable:"locale"});i.sort((t,e)=>t.content.localeCompare(e.content,"en")),Um=t.factory.get("subMenu")(t.factory,{items:i,id:"Language"},e),s(Um)}_h.DynamicSubmenus.set("A11yLanguage",[Hm,"speech"]);const Wm="MacOS"===As.os;function Vm(t){const e=As.document,s=e.createElement("textarea");s.value=t,s.setAttribute("readonly",""),s.style.cssText="height: 1px; width: 1px; padding: 1px; position: absolute; left: -10px",e.body.appendChild(s),s.select();try{e.execCommand("copy")}catch(t){alert(`Can't copy to clipboard: ${t.message}`)}e.body.removeChild(s)}function qm(t,e,s){return(i,n,r)=>{!function(t,e,s){if(!t)return;for(const i of t.childNodes)if(i.isKind("annotation")){const t=zm(i,e);if(t){const e=i.childNodes.reduce((t,e)=>t+e.toString(),"");s.push([t,e])}}}(function(t){var e;let s=null===(e=t.mathItem)||void 0===e?void 0:e.root;for(;s&&!s.isKind("semantics");){if(s.isToken||1!==s.childNodes.length)return null;s=s.childNodes[0]}return s}(i),e,s),r(Jm(i,n,s,t))}}function Xm(t){return(e,s,i)=>{const n=t.slice();t.length=0,i(Jm(e,s,n,()=>Vm(Gm.trim())))}}function zm(t,e){const s=t.attributes.get("encoding");for(const t of Object.keys(e))if(e[t].includes(s))return t;return null}let Gm="";function Jm(t,e,s,i){return t.factory.get("subMenu")(t.factory,{items:s.map(([t,e])=>({type:"command",id:t,content:t,action:()=>{Gm=e,i()}})),id:"annotations"},e)}class Km extends Ir{static post(t){return super.post(t)}html(t){var e;null!==(e=t.extraNodes)&&void 0!==e||(t.extraNodes=[]);const s=t.adaptor.node("input",{type:"button",value:"Copy to Clipboard","data-drag":"none"});return s.addEventListener("click",this.copyToClipboard.bind(this)),t.extraNodes.push(s),t.code&&(t.message="<pre>"+this.formatSource(t.message)+"</pre>"),super.html(t)}formatSource(t){return t.trim().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}}class $m extends Eh{static fromJson(t,{content:e,variable:s,id:i,comparator:n},r){return new this(r,e,s,i,n)}constructor(t,e,s,i,n){super(t,e,s,i),this.comparator=n,this.role="menuitemradiocompare"}updateAria(){this.html.setAttribute("aria-checked",this.comparator(this.variable.getValue(),this.id)?"true":"false")}updateSpan(){this.span.style.display=this.comparator(this.variable.getValue(),this.id)?"":"none"}}class Ym extends pr{constructor(){super(...arguments),this.options={filterSRE:!0,filterTex:!0,texHints:!0,semantics:!1},this.mathItem=null}visitTree(t,e=null,s={}){return this.mathItem=e,Zs(this.options,s),this.visitNode(t,"")}visitTeXAtomNode(t,e){return this.options.texHints?super.visitDefault(t,e):t.childNodes[0]&&1===t.childNodes[0].childNodes.length?this.visitNode(t.childNodes[0],e):`${e}<mrow${this.getAttributes(t)}>\n`+this.childNodeMml(t,e+" ","\n")+`${e}</mrow>`}visitMathNode(t,e){if(!this.options.semantics||"TeX"!==this.mathItem.inputJax.name)return super.visitDefault(t,e);const s=t.childNodes.length&&t.childNodes[0].childNodes.length>1;return`${e}<math${this.getAttributes(t)}>\n${e} <semantics>\n`+(s?e+" <mrow>\n":"")+this.childNodeMml(t,e+(s?" ":" "),"\n")+(s?e+" </mrow>\n":"")+`${e} <annotation encoding="application/x-tex">`+this.mathItem.math+`</annotation>\n${e} </semantics>\n${e}</math>`}getAttributeList(t){const e=super.getAttributeList(t);if(this.options.filterTex&&(delete e["data-latex"],delete e["data-latex-item"]),this.options.filterSRE){const t=Object.keys(e).filter(t=>t.match(/^(?:data-semantic-.*?|data-speech-node|role|aria-(?:level|posinset|setsize|owns))$/));for(const s of t)delete e[s]}return e}}var Qm=function(t,e,s,i){return new(s||(s=Promise))(function(n,r){function o(t){try{l(i.next(t))}catch(t){r(t)}}function a(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})};const Zm=Rs;class tf{get isLoading(){return tf.loading>0}get loadingPromise(){return this.isLoading?(tf._loadingPromise||(tf._loadingPromise=new Promise((t,e)=>{tf._loadingOK=t,tf._loadingFailed=e})),tf._loadingPromise):Promise.resolve()}about(){const t=[];if(t.push("Input Jax: "+this.document.inputJax.map(t=>t.name).join(", ")),t.push("Output Jax: "+this.document.outputJax.name),t.push("Document Type: "+this.document.kind),Zm&&Zm.loader){t.push("<hr/>Modules Loaded:");const e=Zm._.components.package.Package,s=Zm.loader.versions;for(const i of Array.from(e.packages.keys()).sort(this.sortPackages)){const n=s.get(e.resolvePath(i));n&&t.push(`&#xA0;&#xA0;&#xA0;&#xA0;${i} <mjx-v>(${n})</mjx-v>`)}}Ir.post({title:"MathJax <mjx-v>v"+gr.version+"</mjx-v>",message:t.join("<br/>"),adaptor:this.document.adaptor,styles:{".mjx-dialog":{"max-height":"calc(min(20em, 85%))"},"mjx-dialog > div":{"white-space":"nowrap"},"dialog.mjx-dialog-help > mjx-dialog > div":{"white-space":"normal"},"mjx-v":{"font-size":"80%"}},extraNodes:[this.document.adaptor.node("a",{href:"https://www.mathjax.org","data-drag":"false",target:"_blank"},[this.document.adaptor.text("https://www.mathjax.org")])]})}sortPackages(t,e){const[s,i]=t.includes("/")?t.split(/\//):["",t],[n,r]=e.includes("/")?e.split(/\//):["",e];return s===n?i<r?-1:1:"["===s.charAt(0)?"["===n.charAt(0)&&s<n?-1:1:"["===n.charAt(0)||s<n?-1:1}help(){Ir.post({title:"MathJax Help",message:["<p><b>MathJax</b> is a JavaScript library that allows page"," authors to include mathematics within their web pages."," As a reader, you don't need to do anything to make that happen.</p>","<p><b>Browsers</b>: MathJax works with all modern browsers including"," Edge, Firefox, Chrome, Safari, Opera, and most mobile browsers.</p>","<p><b>Math Menu</b>: MathJax adds a contextual menu to equations."," Right-click or CTRL-click on any mathematics to access the menu.</p>",'<div style="margin-left: 1em;">',"<p><b>Show Math As:</b> These options allow you to view the formula's"," source markup (as MathML or in its original format).</p>","<p><b>Copy to Clipboard:</b> These options copy the formula's source markup,"," as MathML or in its original format, to the clipboard"," (in browsers that support that).</p>","<p><b>Math Settings:</b> These give you control over features of MathJax,"," such the size of the mathematics, the mechanism used to display equations,"," how to handle equations that are too wide, and the language to use for"," MathJax's menus and error messages (not yet implemented in v4).","</p>","<p><b>Accessibility</b>: MathJax can work with screen"," readers to make mathematics accessible to the visually impaired."," Turn on speech or braille generation to enable creation of speech strings"," and the ability to investigate expressions interactively. You can control"," the style of the explorer in its menu.</p>","</div>","<p><b>Math Zoom</b>: If you are having difficulty reading an"," equation, MathJax can enlarge it to help you see it better, or"," you can scale all the math on the page to make it larger."," Turn these features on in the <b>Math Settings</b> menu.</p>","<p><b>Preferences</b>: MathJax uses your browser's localStorage database"," to save the preferences set via this menu locally in your browser. These"," are not used to track you, and are not transferred or used remotely by"," MathJax in any way.</p>"].join("\n"),adaptor:this.document.adaptor,extraNodes:[this.document.adaptor.node("a",{href:"https://www.mathjax.org","data-drag":"none"},[this.document.adaptor.text("https://www.mathjax.org")])]})}mathMLCode(){Km.post({title:"MathJax MathML Expression",message:this.menu.mathItem?this.toMML(this.menu.mathItem):"",adaptor:this.document.adaptor,code:!0})}originalText(){var t,e;Km.post({title:"MathJax Original Source",message:null!==(e=null===(t=this.menu.mathItem)||void 0===t?void 0:t.math)&&void 0!==e?e:"",adaptor:this.document.adaptor,code:!0})}annotationBox(){Km.post({title:"MathJax Annotation Text",message:Gm,adaptor:this.document.adaptor,code:!0})}svgImage(){return Qm(this,void 0,void 0,function*(){Km.post({title:"MathJax SVG Image",message:yield this.toSVG(this.menu.mathItem),adaptor:this.document.adaptor,code:!0})})}speechText(){var t,e,s;Km.post({title:"MathJax Speech Text",message:null!==(s=null===(e=null===(t=this.menu.mathItem)||void 0===t?void 0:t.outputData)||void 0===e?void 0:e.speech)&&void 0!==s?s:"",adaptor:this.document.adaptor,code:!0})}brailleText(){var t,e,s;Km.post({title:"MathJax Braille Text",message:null!==(s=null===(e=null===(t=this.menu.mathItem)||void 0===t?void 0:t.outputData)||void 0===e?void 0:e.braille)&&void 0!==s?s:"",adaptor:this.document.adaptor,code:!0})}errorMessage(){Km.post({title:"MathJax Error Message",message:this.menu.mathItem?this.menu.errorMsg:"",adaptor:this.document.adaptor,code:!0})}zoomBox(){let t="";if(this.menu.mathItem){const e=this.menu.mathItem.typesetRoot,s=this.document.adaptor.fontSize(e),i=e.cloneNode(!0);i.style.margin="0";t=`<div style="font-size: ${s*parseFloat(this.settings.zscale)/100}px">${i.outerHTML}</div>`}Ir.post({title:"MathJax Zoomed Expression",message:t,adaptor:this.document.adaptor,styles:{"mjx-dialog > div":{padding:"1.8em"}}})}constructor(t,e={}){this.settings=null,this.defaultSettings=null,this.menu=null,this.current=null,this.MmlVisitor=new Ym,this.initialized=!1,this.jax={CHTML:null,SVG:null},this.rerenderStart=vi.LAST,this.requiredExtensions=[],this.document=t,this.options=Zs(Qs({},this.constructor.OPTIONS),e),this.initSettings(),this.mergeUserSettings(),this.initMenu(),this.applySettings(),this.initialized=!0}initSettings(){var t;this.settings=this.options.settings,this.jax=this.options.jax;const e=this.document.outputJax;this.jax[e.name]=e,this.settings.renderer=e.name,this.settings.scale=e.options.scale,e.options.displayOverflow&&(this.settings.overflow=e.options.displayOverflow.substring(0,1).toUpperCase()+e.options.displayOverflow.substring(1).toLowerCase()),this.settings.breakInline=null===(t=e.options.linebreaks)||void 0===t?void 0:t.inline,this.defaultSettings=Object.assign({},this.document.options.a11y,this.settings),this.setA11y({roleDescription:this.settings.roleDescription})}initMenu(){const t=new Mh([["contextMenu",_h.fromJson.bind(_h)],["radioCompare",$m.fromJson.bind($m)]]);this.menu=t.parse({type:"contextMenu",id:"MathJax_Menu",pool:[this.variable("showSRE"),this.variable("showTex"),this.variable("texHints"),this.variable("semantics"),this.variable("zoom"),this.variable("zscale"),this.variable("renderer",t=>this.setRenderer(t)),this.variable("overflow",t=>this.setOverflow(t)),this.variable("breakInline",t=>this.setInlineBreaks(t)),this.variable("alt"),this.variable("cmd"),this.variable("ctrl"),this.variable("shift"),this.variable("scale",t=>this.setScale(t)),this.a11yVar("speech",t=>this.setSpeech(t)),this.a11yVar("braille",t=>this.setBraille(t)),this.variable("brailleCode",t=>this.setBrailleCode(t)),this.a11yVar("brailleSpeech",t=>this.setBrailleSpeech(t)),this.a11yVar("brailleCombine",t=>this.setBrailleCombine(t)),this.a11yVar("highlight",t=>this.setHighlight(t)),this.a11yVar("backgroundColor",t=>this.setColor("bg",t)),this.a11yVar("backgroundOpacity",t=>this.setColor("bg",null,t)),this.a11yVar("foregroundColor",t=>this.setColor("fg",t)),this.a11yVar("foregroundOpacity",t=>this.setColor("fg",null,t)),this.a11yVar("subtitles"),this.a11yVar("viewBraille"),this.a11yVar("voicing"),this.a11yVar("roleDescription",()=>this.setRoleDescription()),this.a11yVar("help"),this.a11yVar("locale",t=>this.setLocale(t)),this.variable("speechRules",t=>{const[e,s]=t.split("-");this.document.options.sre.domain=e,this.document.options.sre.style=s,this.rerender(vi.COMPILED)}),this.a11yVar("magnification"),this.a11yVar("magnify"),this.a11yVar("treeColoring"),this.a11yVar("infoType"),this.a11yVar("infoRole"),this.a11yVar("infoPrefix"),this.variable("autocollapse"),this.variable("collapsible",t=>this.setCollapsible(t)),this.variable("enrich",t=>this.setEnrichment(t)),this.a11yVar("inTabOrder",t=>this.setTabOrder(t)),this.a11yVar("tabSelects"),this.variable("assistiveMml",t=>this.setAssistiveMml(t))],items:[this.submenu("Show","Show Math As",[this.command("MathMLcode","MathML Code",()=>this.mathMLCode()),this.command("Original","Original Form",()=>this.originalText()),this.rule(),this.command("Speech","Speech Text",()=>this.speechText(),{disabled:!0}),this.command("Braille","Braille Code",()=>this.brailleText(),{disabled:!0}),this.command("SVG","SVG Image",()=>this.svgImage(),{disabled:!0}),this.submenu("ShowAnnotation","Annotation"),this.rule(),this.command("Error","Error Message",()=>this.errorMessage(),{disabled:!0})]),this.submenu("Copy","Copy to Clipboard",[this.command("MathMLcode","MathML Code",()=>this.copyMathML()),this.command("Original","Original Form",()=>this.copyOriginal()),this.rule(),this.command("Speech","Speech Text",()=>this.copySpeechText(),{disabled:!0}),this.command("Braille","Braille Code",()=>this.copyBrailleText(),{disabled:!0}),this.command("SVG","SVG Image",()=>this.copySvgImage(),{disabled:!0}),this.submenu("CopyAnnotation","Annotation"),this.rule(),this.command("Error","Error Message",()=>this.copyErrorMessage(),{disabled:!0})]),this.rule(),this.submenu("Settings","Math Settings",[this.submenu("Renderer","Math Renderer",this.radioGroup("renderer",[["CHTML"],["SVG"]])),this.submenu("Overflow","Wide Expressions",[this.radioGroup("overflow",[["Overflow"],["Scroll"],["Linebreak"],["Scale"],["Truncate"],["Elide"]]),this.rule(),this.checkbox("BreakInline","Allow In-line Breaks","breakInline")]),this.rule(),this.submenu("MathmlIncludes","MathML/SVG has",[this.checkbox("showSRE","Semantic attributes","showSRE"),this.checkbox("showTex","LaTeX attributes","showTex"),this.checkbox("texHints","TeX hints","texHints"),this.checkbox("semantics","Original as annotation","semantics")]),this.submenu("Language","Language"),this.rule(),this.submenu("ZoomTrigger","Zoom Trigger",[this.command("ZoomNow","Zoom Once Now",()=>this.zoom(null,"")),this.rule(),this.radioGroup("zoom",[["Click"],["DoubleClick","Double-Click"],["NoZoom","No Zoom"]]),this.rule(),this.label("TriggerRequires","Trigger Requires:"),this.checkbox(Wm?"Option":"Alt",Wm?"Option":"Alt","alt"),this.checkbox("Command","Command","cmd",{hidden:!Wm}),this.checkbox("Control","Control","ctrl",{hidden:Wm}),this.checkbox("Shift","Shift","shift")]),this.submenu("ZoomFactor","Zoom Factor",this.radioGroup("zscale",[["150%"],["175%"],["200%"],["250%"],["300%"],["400%"]])),this.rule(),this.command("Scale","Scale All Math...",()=>this.scaleAllMath()),this.rule(),this.command("Reset","Reset to defaults",()=>this.resetDefaults())]),this.rule(),this.label("Accessibility","\xa0\xa0 Accessibility:"),this.submenu("Speech","\xa0 \xa0 Speech",[this.checkbox("Generate","Generate","speech"),this.checkbox("Subtitles","Show Subtitles","subtitles"),this.checkbox("Auto Voicing","Auto Voicing","voicing"),this.rule(),this.label("Rules","Rules:"),this.submenu("Mathspeak","Mathspeak",this.radioGroup("speechRules",[["mathspeak-default","Verbose"],["mathspeak-brief","Brief"],["mathspeak-sbrief","Superbrief"]])),this.submenu("Clearspeak","Clearspeak",this.radioGroup("speechRules",[["clearspeak-default","Auto"]])),this.rule(),this.submenu("A11yLanguage","Language")]),this.submenu("Braille","\xa0 \xa0 Braille",[this.checkbox("Generate","Generate","braille"),this.checkbox("Subtitles","Show Subtitles","viewBraille"),this.checkbox("BrailleSpeech","Replace Speech","brailleSpeech",{hidden:!0}),this.checkbox("BrailleCombine","Combine with Speech","brailleCombine"),this.rule(),this.label("Code","Code Format:"),this.radioGroup("brailleCode",[["nemeth","Nemeth"],["ueb","UEB"],["euro","Euro"]])]),this.submenu("Explorer","\xa0 \xa0 Explorer",[this.submenu("Highlight","Highlight",[this.submenu("Background","Background",this.radioGroup("backgroundColor",[["Blue"],["Red"],["Green"],["Yellow"],["Cyan"],["Magenta"],["White"],["Black"]])),{type:"slider",variable:"backgroundOpacity",content:" "},this.submenu("Foreground","Foreground",this.radioGroup("foregroundColor",[["Black"],["White"],["Magenta"],["Cyan"],["Yellow"],["Green"],["Red"],["Blue"]])),{type:"slider",variable:"foregroundOpacity",content:" "},this.rule(),this.radioGroup("highlight",[["None"],["Hover"],["Flame"]]),this.rule(),this.checkbox("TreeColoring","Tree Coloring","treeColoring")]),this.submenu("Magnification","Magnification",[this.radioGroup("magnification",[["None"],["Keyboard"],["Mouse"]]),this.rule(),this.radioGroup("magnify",[["200%"],["300%"],["400%"],["500%"]])]),this.submenu("Semantic Info","Semantic Info",[this.checkbox("Type","Type","infoType"),this.checkbox("Role","Role","infoRole"),this.checkbox("Prefix","Prefix","infoPrefix")]),this.rule(),this.submenu("Role Description","Describe math as",[this.radioGroup("roleDescription",[["MathJax expression"],["MathJax"],["math"],["clickable math"],["explorable math"],["none"]])]),this.checkbox("Math Help","Help message on focus","help")]),this.submenu("Options","\xa0 \xa0 Options",[this.checkbox("Enrich","Semantic Enrichment","enrich"),this.checkbox("Collapsible","Collapsible Math","collapsible"),this.checkbox("AutoCollapse","Auto Collapse","autocollapse",{disabled:!0}),this.rule(),this.checkbox("InTabOrder","Include in Tab Order","inTabOrder"),this.submenu("TabSelects","Tabbing Focuses on",[this.radioGroup("tabSelects",[["all","Whole Expression"],["last","Last Explored Node"]])]),this.rule(),this.checkbox("AssistiveMml","Include Hidden MathML","assistiveMml")]),this.rule(),this.command("About","About MathJax",()=>this.about()),this.command("Help","MathJax Help",()=>this.help())]});const e=this.menu;e.settings=this.settings,e.findID("Settings","Overflow","Elide").disable(),e.findID("Braille","ueb").hide(),e.setJax(this.jax),this.checkLoadableItems();const s=[];_h.DynamicSubmenus.set("ShowAnnotation",[qm(()=>this.annotationBox(),this.options.annotationTypes,s),""]),_h.DynamicSubmenus.set("CopyAnnotation",[Xm(s),""]),function(t){jh(Object.assign(Object.assign({},Ph),Bh),t)}(this.document.document)}checkLoadableItems(){var t,e,s,i,n,r;if(Zm&&Zm._&&Zm.loader&&Zm.startup){const o=this.settings,a=this.document.options;(o.enrich||o.speech&&a.enableSpeech||o.braille&&a.enableBraille)&&!(null===(e=null===(t=Zm._)||void 0===t?void 0:t.a11y)||void 0===e?void 0:e.explorer)&&this.loadA11y("explorer"),o.collapsible&&!(null===(i=null===(s=Zm._)||void 0===s?void 0:s.a11y)||void 0===i?void 0:i.complexity)&&this.loadA11y("complexity"),o.assistiveMml&&!(null===(r=null===(n=Zm._)||void 0===n?void 0:n.a11y)||void 0===r?void 0:r["assistive-mml"])&&this.loadA11y("assistive-mml")}else{const t=this.menu;for(const e of Object.keys(this.jax))this.jax[e]||t.findID("Settings","Renderer",e).disable();t.findID("Speech").disable(),t.findID("Braille").disable(),t.findID("Explorer").disable(),t.findID("Options","AutoCollapse").disable(),t.findID("Options","Collapsible").disable(),t.findID("Options","Enrich").disable(),t.findID("Options","AssistiveMml").disable()}}enableAccessibilityItems(t,e){const s=this.menu.findID(t).submenu;for(const t of s.items.slice(1))t instanceof xh||(!e||t instanceof dh&&!t.submenu.items.length?t.disable():t.enable())}mergeUserSettings(){try{const t=localStorage.getItem(tf.MENU_STORAGE);if(!t)return;const e=JSON.parse(t);Object.assign(this.settings,e),this.setA11y(e)}catch(t){console.log("MathJax localStorage error: "+t.message)}}saveUserSettings(){const t={};for(const e of Object.keys(this.settings))this.settings[e]!==this.defaultSettings[e]&&(t[e]=this.settings[e]);try{Object.keys(t).length?localStorage.setItem(tf.MENU_STORAGE,JSON.stringify(t)):localStorage.removeItem(tf.MENU_STORAGE)}catch(t){console.log("MathJax localStorage error: "+t.message)}}setA11y(t){var e,s;(null===(s=null===(e=Zm._)||void 0===e?void 0:e.a11y)||void 0===s?void 0:s.explorer)&&Zm._.a11y.explorer_ts.setA11yOptions(this.document,t)}getA11y(t){var e,s;if(null===(s=null===(e=Zm._)||void 0===e?void 0:e.a11y)||void 0===s?void 0:s.explorer)return void 0!==this.document.options.a11y[t]?this.document.options.a11y[t]:this.document.options.sre[t]}applySettings(){this.setTabOrder(this.settings.inTabOrder);this.document.options.enableAssistiveMml=this.settings.assistiveMml,this.enableAccessibilityItems("Speech",this.settings.speech),this.enableAccessibilityItems("Braille",this.settings.braille),this.setAccessibilityMenus();const t=this.settings.renderer.replace(/[^a-zA-Z0-9]/g,"")||"CHTML";(tf._loadingPromise||Promise.resolve()).then(()=>{const e=this.settings;if(this.applyRendererOptions(this.document.outputJax),!e.speechRules){const t=this.document.options.sre;e.speechRules=`${t.domain||"clearspeak"}-${t.style||"default"}`}t!==this.defaultSettings.renderer&&this.document.whenReady(()=>this.setRenderer(t,!1))})}setOverflow(t){this.document.outputJax.options.displayOverflow=t.toLowerCase(),!tf.loading&&this.initialized&&this.document.rerenderPromise()}setInlineBreaks(t){this.document.outputJax.options.linebreaks.inline=t,!tf.loading&&this.initialized&&this.document.rerenderPromise()}setScale(t){this.document.outputJax.options.scale=parseFloat(t),!tf.loading&&this.initialized&&this.document.rerenderPromise()}setRenderer(t,e=!0){if(Object.hasOwn(this.jax,t)&&this.jax[t])return this.applyRendererOptions(this.jax[t]),this.setOutputJax(t,e);const s=t.toLowerCase();return new Promise((i,n)=>{this.loadComponent("output/"+s,()=>{const r=Zm.startup;if(!(s in r.constructors))return n(new Error(`Component ${s} not loaded`));r.useOutput(s,!0),r.output=this.applyRendererOptions(r.getOutputJax()),r.output.setAdaptor(this.document.adaptor),r.output.initialize(),this.jax[t]=r.output,this.setOutputJax(t,e).then(()=>i()).catch(t=>n(t))})})}applyRendererOptions(t){const e=this.settings,s=t.options;return s.scale=parseFloat(e.scale),s.displayOverflow=e.overflow.toLowerCase(),s.linebreaks&&(s.linebreaks.inline=e.breakInline),t}setOutputJax(t,e=!0){this.jax[t].setAdaptor(this.document.adaptor),this.document.outputJax=this.jax[t];const s=this.loadRequiredExtensions();return e?s.then(()=>gr.handleRetriesFor(()=>this.rerender())):s.then(()=>{})}loadRequiredExtensions(){const t=this.document.outputJax.name.toLowerCase(),e=[];for(const s of this.requiredExtensions)e.push(Zm.loader.load(`[${s}]/${t}`));return this.requiredExtensions=[],Promise.all(e)}addRequiredExtensions(t){if(t){const e=new Set([...this.requiredExtensions,...t]);this.requiredExtensions=[...e]}}setTabOrder(t){const e=this.menu.findID("Options","TabSelects");t?e.enable():e.disable(),this.menu.store.inTaborder(t)}setAssistiveMml(t){var e,s;this.document.options.enableAssistiveMml=t,t&&this.noRerender(()=>{this.settings.speech&&this.menu.pool.lookup("speech").setValue(!1),this.settings.braille&&this.menu.pool.lookup("braille").setValue(!1)}),!t||(null===(s=null===(e=Zm._)||void 0===e?void 0:e.a11y)||void 0===s?void 0:s["assistive-mml"])?this.rerender():this.loadA11y("assistive-mml")}setAccessibilityMenus(){const t=this.settings.enrich,e=t?"enable":"disable";["Speech","Braille","Explorer"].forEach(t=>this.menu.findID(t)[e]());const s=this.document.options;s.enableSpeech=s.enableBraille=s.enableExplorer=t,t||(this.settings.collapsible=!1,this.document.options.enableCollapsible=!1)}setSpeech(t){var e,s;this.enableAccessibilityItems("Speech",t),this.document.options.enableSpeech=t,t&&(this.settings.assistiveMml&&this.noRerender(()=>this.menu.pool.lookup("assistiveMml").setValue(!1)),this.settings.brailleSpeech&&this.noRerender(()=>this.menu.pool.lookup("brailleSpeech").setValue(!1))),!t||(null===(s=null===(e=Zm._)||void 0===e?void 0:e.a11y)||void 0===s?void 0:s.explorer)?this.rerender(vi.COMPILED):this.loadA11y("explorer")}setBraille(t){var e,s;this.enableAccessibilityItems("Braille",t),this.document.options.enableBraille=t,t&&this.settings.assistiveMml&&this.noRerender(()=>this.menu.pool.lookup("assistiveMml").setValue(!1)),!t||(null===(s=null===(e=Zm._)||void 0===e?void 0:e.a11y)||void 0===s?void 0:s.explorer)?this.rerender(vi.COMPILED):this.loadA11y("explorer")}setBrailleCode(t){this.document.options.sre.braille=t,this.rerender(vi.COMPILED)}setBrailleSpeech(t){t&&this.settings.speech?this.noRerender(()=>this.menu.pool.lookup("speech").setValue(!1)):this.enableAccessibilityItems("Speech",!0),this.settings.brailleCombine=this.document.options.a11y.brailleCombine=!1,this.rerender(vi.COMPILED)}setBrailleCombine(t){this.settings.brailleSpeech&&this.menu.pool.lookup("brailleSpeech").setValue(!1),this.settings.brailleSpeech=this.document.options.a11y.brailleSpeech=!1,this.rerender(vi.COMPILED)}setLocale(t){this.document.options.sre.locale=t,this.rerender(vi.COMPILED)}setRoleDescription(){this.rerender(vi.COMPILED)}setEnrichment(t){var e,s;this.document.options.enableEnrichment=t,this.setAccessibilityMenus(),!t||(null===(s=null===(e=Zm._)||void 0===e?void 0:e.a11y)||void 0===s?void 0:s.explorer)?this.rerender(vi.COMPILED):this.loadA11y("explorer")}setCollapsible(t){var e,s;this.document.options.enableComplexity=t,t&&!this.settings.enrich&&(this.settings.enrich=this.document.options.enableEnrichment=!0,this.setAccessibilityMenus()),t||this.menu.pool.lookup("highlight").setValue("None"),!t||(null===(s=null===(e=Zm._)||void 0===e?void 0:e.a11y)||void 0===s?void 0:s.complexity)?this.rerender(vi.COMPILED):this.loadA11y("complexity")}setHighlight(t){var e,s;if("None"!==t){if(!this.settings.collapsible){const t=this.menu.pool.lookup("collapsible");t.setValue(!0),null===(s=null===(e=t.items[0])||void 0===e?void 0:e.executeCallbacks_)||void 0===s||s.call(e)}tf.loadingPromises.has("a11y/complexity")||this.rerender(vi.COMPILED)}}setColor(t,e,s){const i=this.document.options.a11y;e||(e=i["fg"===t?"foregroundColor":"backgroundColor"]),s||(s=i["fg"===t?"foregroundOpacity":"backgroundOpacity"]),Zm._.a11y.explorer.Region.LiveRegion.setColor(t,1,e.toLowerCase(),parseInt(s)/100)}scaleAllMath(){const t=(100*parseFloat(this.settings.scale)).toFixed(1).replace(/.0$/,""),e=prompt("Scale all mathematics (compared to surrounding text) by",t+"%");if(this.current){const t=this.menu.mathItem.explorers.speech;t.refocus=this.current,t.focus()}if(e)if(e.match(/^\s*\d+(\.\d*)?\s*%?\s*$/)){const t=parseFloat(e)/100;t?this.menu.pool.lookup("scale").setValue(String(t)):alert("The scale should not be zero")}else alert("The scale should be a percentage (e.g., 120%)")}resetDefaults(){this.noRerender(()=>{const t=this.menu.pool,e=this.defaultSettings;for(const s of Object.keys(e)){const i=t.lookup(s);if(i){if(i.getValue()!==e[s]){i.setValue(e[s]);const t=i.items[0];t&&t.executeCallbacks_()}}else Object.hasOwn(this.settings,s)&&(this.settings[s]=e[s])}}),this.rerender(vi.COMPILED)}checkComponent(t){const e=tf.loadingPromises.get(t);e&&gr.retryAfter(e)}loadComponent(t,e){if(tf.loadingPromises.has(t))return;const s=Zm.loader;if(!s)return;tf.loading++;const i=s.load(t).then(()=>{tf.loading--,tf.loadingPromises.delete(t),0===tf.loading&&tf._loadingPromise&&(tf._loadingPromise=null,tf._loadingOK()),e()}).catch(t=>{tf._loadingPromise?(tf._loadingPromise=null,tf._loadingFailed(t)):console.log(t)});tf.loadingPromises.set(t,i)}loadA11y(t){const e=!vi.ENRICHED;this.loadComponent("a11y/"+t,()=>{var s,i;const n=Zm.startup;gr.handlers.unregister(n.handler),n.handler=n.getHandler(),gr.handlers.register(n.handler);const r=this.document;this.document=n.document=n.getDocument(),this.document.processed=r.processed,this.document.menu=this,r.webworker&&(this.document.webworker=r.webworker),this.setA11y(this.settings),this.defaultSettings=Object.assign({},this.document.options.a11y,(null===(i=null===(s=Zm.config)||void 0===s?void 0:s.options)||void 0===i?void 0:i.a11y)||{},this.defaultSettings),this.document.outputJax.reset(),this.transferMathList(r),this.document.processed=r.processed,tf._loadingPromise||(this.document.outputJax.reset(),gr.handleRetriesFor(()=>{this.rerender("complexity"===t||e?vi.COMPILED:vi.TYPESET)}))})}transferMathList(t){const e=this.document.options.MathItem;for(const s of t.math){const t=new e;Object.assign(t,s),this.document.math.push(t)}}toMML(t){return this.MmlVisitor.visitTree(t.root,t,{filterSRE:!this.settings.showSRE,filterTex:!this.settings.showTex,texHints:this.settings.texHints,semantics:this.settings.semantics&&"MathML"!==t.inputJax.name})}toSVG(t){return Qm(this,void 0,void 0,function*(){const e=this.jax.SVG;if(!e)return"SVG can't be produced.<br>Try switching to SVG output first.";const s=e.adaptor,i=e.options.fontCache,n=!!t.root.getProperty("process-breaks");if("global"!==i&&(t.display||!n)&&"SVG"===s.getAttribute(t.typesetRoot,"jax"))for(const e of s.childNodes(t.typesetRoot))if("svg"===s.kind(e))return this.formatSvg(s.serializeXML(e));return this.typesetSVG(t,i,n)})}typesetSVG(t,e,s){return Qm(this,void 0,void 0,function*(){const i=this.jax.SVG,n=i.html("div");"global"===e&&(i.options.fontCache="local");const r=t.root;return t.root=r.copy(!0),t.root.setInheritedAttributes({},t.display,0,!1),s&&(i.unmarkInlineBreaks(t.root),t.root.setProperty("inlineMarked",!1)),yield gr.handleRetriesFor(()=>{i.toDOM(t,n,i.document)}),t.root=r,i.options.fontCache=e,this.formatSvg(i.adaptor.serializeXML(n))})}formatSvg(t){const e=this.constructor.SvgCss,s=(t=(t=t.match(/^<svg.*?><defs>/)?t.replace(/<defs>/,`<defs><style>${e}</style>`):t.replace(/^(<svg.*?>)/,`$1<defs><style>${e}</style></defs>`)).replace(/ (?:role|focusable)=".*?"/g,"").replace(/"currentColor"/g,'"black"')).split(/(<\/?[a-zA-Z].*?>)/);for(let t=2,e="";t<s.length;t+=2){const i=s[t-1],n=s[t+1];"/"!==i.charAt(1)&&"/"!==i.charAt(i.length-2)&&(e+=" "),n&&("/"===n.charAt(1)&&(e=e.slice(2)),s[t+1]=n.replace(' xmlns:xlink="http://www.w3.org/1999/xlink"',"")),s[t]&&(s[t]="\n "+e+s[t].replace(/\n/g,"\n "+e)),s[t]+="\n"+e}return t=s.join(""),this.settings.showSRE||(t=t.replace(/ (?:data-semantic-.*?|data-speech-node)=".*?"/g,"")),this.settings.showTex||(t=t.replace(/ data-latex(?:-item)?=".*?"/g,"")),this.settings.texHints||(t=t.replace(/ data-mjx-(?:texclass|alternate|variant|pseudoscript|smallmatrix|mathaccent|auto-op|script-align|vbox)=".*?"/g,"").replace(/ data-mml-node="TeXAtom"/g,"")),`<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n${t}`}zoom(t,e){t&&!this.isZoomEvent(t,e)||this.zoomBox()}isZoomEvent(t,e){return this.settings.zoom===e&&(!this.settings.alt||t.altKey)&&(!this.settings.ctrl||t.ctrlKey)&&(!this.settings.cmd||t.metaKey)&&(!this.settings.shift||t.shiftKey)}rerender(t=vi.TYPESET){this.rerenderStart=Math.min(t,this.rerenderStart),!tf.loading&&Zm.startup.hasTypeset&&this.document.whenReady(()=>Qm(this,void 0,void 0,function*(){this.rerenderStart<=vi.COMPILED&&this.document.reset({inputJax:[]}),yield this.document.rerenderPromise(this.rerenderStart),this.rerenderStart=vi.LAST}))}noRerender(t){tf.loading++;try{t(),tf.loading--}catch(t){throw tf.loading--,t}}copyMathML(){Vm(this.toMML(this.menu.mathItem))}copyOriginal(){Vm(this.menu.mathItem.math.trim())}copySvgImage(){this.toSVG(this.menu.mathItem).then(t=>{Vm(t)})}copySpeechText(){Vm(this.menu.mathItem.outputData.speech)}copyBrailleText(){Vm(this.menu.mathItem.outputData.braille)}copyErrorMessage(){Vm(this.menu.errorMsg.trim())}addMenu(t){this.addEvents(t),this.menu.store.insert(t.typesetRoot),t.typesetRoot.tabIndex=this.settings.inTabOrder?0:-1}addEvents(t){const e=t.typesetRoot;e.addEventListener("mousedown",()=>{var e,s;this.menu.mathItem=t,this.current=null===(s=null===(e=t.explorers)||void 0===e?void 0:e.speech)||void 0===s?void 0:s.current},!0),e.addEventListener("contextmenu",()=>{var e;this.menu.mathItem=t;const s=null===(e=t.explorers)||void 0===e?void 0:e.speech;s&&(t.outputData.nofocus=!this.current,s.refocus=this.current)},!0),e.addEventListener("keydown",()=>this.menu.mathItem=t,!0),e.addEventListener("click",t=>this.zoom(t,"Click"),!0),e.addEventListener("dblclick",t=>this.zoom(t,"DoubleClick"),!0)}clear(){this.menu.store.clear()}variable(t,e){return{name:t,getter:()=>this.settings[t],setter:s=>{this.settings[t]=s,e&&e(s),this.saveUserSettings()}}}a11yVar(t,e){return{name:t,getter:()=>this.getA11y(t),setter:s=>{this.settings[t]=s,this.setA11y({[t]:s}),e&&e(s),this.saveUserSettings()}}}submenu(t,e,s=[],i=!1){let n=[];for(const t of s)Array.isArray(t)?n=n.concat(t):n.push(t);return{type:"submenu",id:t,content:e,menu:{items:n},disabled:0===n.length||i}}command(t,e,s,i={}){return Object.assign({type:"command",id:t,content:e,action:s},i)}checkbox(t,e,s,i={}){return Object.assign({type:"checkbox",id:t,content:e,variable:s},i)}radioGroup(t,e){return e.map(e=>this.radio(e[0],e[1]||e[0],t))}radio(t,e,s,i={}){return Object.assign({type:"radio",id:t,content:e,variable:s},i)}label(t,e){return{type:"label",id:t,content:e}}rule(){return{type:"rule"}}}function ef(t){return class extends t{addMenu(t,e=!1){this.state()>=vi.CONTEXT_MENU||(this.isEscaped||!t.options.enableMenu&&!e||t.menu.addMenu(this),this.state(vi.CONTEXT_MENU))}getMenus(t){t.menu.menu.store.sort()}checkLoading(t){t.checkLoading()}}}function sf(t){var e;return e=class extends t{constructor(...t){super(...t),this.menu=new this.options.MenuClass(this,this.options.menuOptions);const e=this.constructor.ProcessBits;e.has("context-menu")||e.allocate("context-menu"),this.options.MathItem=ef(this.options.MathItem);const s=this.menu.settings,i=this.options,n=i.enableEnrichment=s.enrich;i.enableSpeech=s.speech&&n,i.enableBraille=s.braille&&n,i.enableComplexity=s.collapsible&&n,i.enableExplorer=n}addMenu(){if(!this.processed.isSet("context-menu")){for(const t of this.math)t.addMenu(this);this.processed.set("context-menu")}return this}getMenus(){this.menu.menu.store.sort()}checkLoading(){let t=!0;try{this._checkLoading(),t=!1}catch(t){if(!t.retry)throw t}return t}_checkLoading(){return this.menu.isLoading&&gr.retryAfter(this.menu.loadingPromise.catch(t=>console.log(t))),this.options.enableComplexity&&this.menu.checkComponent("a11y/complexity"),this.options.enableExplorer&&this.menu.checkComponent("a11y/explorer"),this}state(t,e=!1){return super.state(t,e),t<vi.CONTEXT_MENU&&this.processed.clear("context-menu"),this}},e.OPTIONS=Object.assign(Object.assign({enableEnrichment:!0,enableComplexity:!0,enableSpeech:!0,enableBraille:!0,enableExplorer:!0,enableExplorerHelp:!0,enrichSpeech:"none",enrichError:(t,e,s)=>console.warn("Enrichment Error:",s)},t.OPTIONS),{MenuClass:tf,menuOptions:tf.OPTIONS,enableMenu:!0,sre:t.OPTIONS.sre||Gs({}),a11y:t.OPTIONS.a11y||Gs({}),renderActions:Gs(Object.assign(Object.assign({},t.OPTIONS.renderActions),{addMenu:[vi.CONTEXT_MENU],getMenus:[vi.INSERTED+5,!1],checkLoading:[vi.UNPROCESSED+1,t=>t.checkLoading(),"",!1]}))}),e}function nf(t){return t.documentClass=sf(t.documentClass),t}tf.MENU_STORAGE="MathJax-Menu-Settings",tf.OPTIONS={settings:{showSRE:!1,showTex:!1,texHints:!0,semantics:!1,zoom:"NoZoom",zscale:"200%",renderer:"CHTML",alt:!0,cmd:!1,ctrl:!1,shift:!1,scale:1,overflow:"Scroll",breakInline:!0,autocollapse:!1,collapsible:!1,enrich:!0,assistiveMml:!1,speech:!0,braille:!0,brailleCode:"nemeth",brailleSpeech:!1,brailleCombine:!1,speechRules:"clearspeak-default",roleDescription:"math",inTabOrder:!0,tabSelects:"all",help:!0},jax:{CHTML:null,SVG:null},annotationTypes:Gs({TeX:["TeX","LaTeX","application/x-tex"],StarMath:["StarMath 5.0"],Maple:["Maple"],ContentMathML:["MathML-Content","application/mathml-content+xml"],OpenMath:["OpenMath"]})},tf.SvgCss=["svg a{fill:blue;stroke:blue}",'[data-mml-node="merror"]>g{fill:red;stroke:red}','[data-mml-node="merror"]>rect[data-background]{fill:yellow;stroke:none}',"[data-frame],[data-line]{stroke-width:70px;fill:none}",".mjx-dashed{stroke-dasharray:140}",".mjx-dotted{stroke-linecap:round;stroke-dasharray:0,140}","use[data-c]{stroke-width:3px}"].join("\n"),tf.loading=0,tf.loadingPromises=new Map,tf._loadingPromise=null,tf._loadingOK=null,tf._loadingFailed=null,Li("CONTEXT_MENU",170),MathJax.loader&&MathJax.loader.checkVersion("ui/menu",xs,"ui"),Cs({_:{a11y:{speech:{SpeechMenu:Ze}},ui:{menu:{AnnotationMenu:es,MJContextMenu:Ye,Menu:ns,MenuHandler:rs,MenuUtil:ts,MmlVisitor:is,RadioCompare:ss}}}}),MathJax.startup&&Is&&MathJax.startup.extendHandler(t=>nf(t),20),MathJax.loader&&MathJax.loader.checkVersion("a11y/sre",xs,"a11y"),Cs({_:{a11y:{sre_ts:Qe}}}),Li("ENRICHED",vi.COMPILED+10);class rf extends pr{visitTree(t,e){this.mactionId=0;const s=super.visitTree(t);return this.mactionId&&(e.inputData.hasMaction=!0),s}visitHtmlNode(t,e){return t.getSerializedXML()}visitMactionNode(t,e){const[s,i]=0===t.childNodes.length?["",""]:["\n",e],n=this.childNodeMml(t,e+" ",s);let r=this.getAttributes(t);if("toggle"===t.attributes.get("actiontype")){const e=++this.mactionId;t.setProperty("mactionId",e),r=` data-maction-id="${e}" selection="${t.attributes.get("selection")}"`+r.replace(/ selection="\d+"/,"").replace(/ data-maction-id="\d+"/,"")}return`${e}<maction${r}>`+(n.match(/\S/)?s+n+i:"")+"</maction>"}}function of(t,e,s){return class extends t{constructor(){super(...arguments),this.toMathML=s}serializeMml(t){if("outerHTML"in t)return t.outerHTML;if("undefined"!=typeof Element&&"undefined"!=typeof window&&t instanceof Element){const e=window.document.createElement("div");return e.appendChild(t),e.innerHTML}return t.toString()}enrich(t,s=!1){if(!(this.state()>=vi.ENRICHED)){if(!this.isEscaped&&(t.options.enableEnrichment||s)){const s=new t.options.MathItem("",e);try{let e;e=this.inputData.originalMml?this.adjustSelections():this.inputData.originalMml=this.toMathML(this.root,this);const i=Rm(e);this.inputData.enrichedMml=s.math=this.serializeMml(i),s.math=s.math.replace(/ role="treeitem"/g,' data-speech-node="true"').replace(/ aria-level/g," data-semantic-level-number").replace(/ aria-(?:posinset|owns|setsize)=".*?"/g,""),s.display=this.display,s.compile(t),this.root=s.root}catch(e){t.options.enrichError(t,this,e)}}this.state(vi.ENRICHED)}}toEnriched(t){return this.serializeMml(Rm(t))}unEnrich(t){const s=this.inputData.originalMml;if(!s)return;const i=new t.options.MathItem("",e);i.math=s,i.display=this.display,i.compile(t),this.root=i.root}adjustSelections(){const t=this.inputData.originalMml;if(!this.inputData.hasMaction)return t;const e=[];return this.root.walkTree(t=>{t.isKind("maction")&&(e[t.attributes.get("data-maction-id")]=t)}),t.replace(/(data-maction-id="(\d+)" selection=)"\d+"/g,(t,s,i)=>`${s}"${e[i].attributes.get("selection")}"`)}}}function af(t,e){var s;return(s=class extends t{constructor(...t){super(...t),e.setMmlFactory(this.mmlFactory);const s=this.constructor.ProcessBits;s.has("enriched")||s.allocate("enriched");const i=new rf(this.mmlFactory);this.options.MathItem=of(this.options.MathItem,e,(t,e)=>i.visitTree(t,e))}enrich(){if(!this.processed.isSet("enriched")){if(this.options.enableEnrichment){Lm(this.options.sre);for(const t of this.math)t.enrich(this)}this.processed.set("enriched")}return this}enrichError(t,e,s){console.warn("Enrichment error:",s)}state(t,e=!1){if(super.state(t,e),t<vi.ENRICHED&&(this.processed.clear("enriched"),t>=vi.COMPILED))for(const t of this.math)t.unEnrich(this);return this}}).OPTIONS=Object.assign(Object.assign({},t.OPTIONS),{enableEnrichment:!0,enrichError:(t,e,s)=>t.enrichError(t,e,s),renderActions:Gs(Object.assign(Object.assign({},t.OPTIONS.renderActions),{enrich:[vi.ENRICHED]})),sre:Gs({speech:"none",locale:"en",domain:"clearspeak",style:"default",braille:"nemeth",structure:!0,aria:!0})}),s}function lf(t,e){return e.setAdaptor(t.adaptor),t.documentClass=af(t.documentClass,e),t}MathJax.loader&&MathJax.loader.checkVersion("a11y/semantic-enrich",xs,"a11y"),Cs({_:{a11y:{"semantic-enrich":os}}}),MathJax.startup&&MathJax.startup.extendHandler(t=>lf(t,new uo({allowHtmlInTokenNodes:!0})));const hf=["pitch","rate","volume"];function cf(t){const e=Im(t),s=[],i=[];return df(Array.from(e.childNodes),s,i),[i.join(" "),s]}function df(t,e,s,i={}){for(const n of t){if(3===n.nodeType){const t=n.textContent.trim();t&&(s.push(t),e.push(Object.assign({text:t},i)));continue}if(1===n.nodeType){const t=n,r=t.tagName;if("speak"===r)continue;if("prosody"===r){df(Array.from(n.childNodes),e,s,pf(t,i));continue}switch(r){case"break":e.push({pause:t.getAttribute("time")});break;case"mark":e.push({mark:t.getAttribute("name")});break;case"say-as":{const n=t.textContent;e.push(Object.assign({text:n,character:!0},i)),s.push(n);break}}}}}const uf={pitch:(t,e)=>t/100*1,volume:(t,e)=>t/100*.5,rate:(t,e)=>t/100*1};function pf(t,e){const s={};for(const i of hf)if(t.hasAttribute(i)){const[n,r]=ff(t.getAttribute(i));if(!n){s[i]="volume"===i?.5:1;continue}let o=e[i];o=o||("volume"===i?.5:1);const a=uf[i](parseInt(r,10),n);s[i]="-"===n?o-a:o+a}return s}const mf=/([+-]?)([0-9]+)%/;function ff(t){const e=t.match(mf);return e?[e[1],e[2]]:(console.warn("Something went wrong with the prosody matching."),["","100"])}function gf(t,e,s,i=" "){if(!t)return"";const n=[t];return e&&n.unshift(e),s&&n.push(s),n.join(i)}function bf(t,e="en",s="100"){return cf(`<?xml version="1.0"?><speak version="1.1" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="${e}"><prosody rate="${s}%">${t}</prosody></speak>`)}function Ef(){const t=new AudioContext,e=t.createOscillator();e.frequency.value=300,e.connect(t.destination),e.start(t.currentTime),e.stop(t.currentTime+.05)}var xf,yf;!function(t){t[t.NONE=0]="NONE",t[t.DEPTH=1]="DEPTH",t[t.SUMMARY=2]="SUMMARY"}(xf||(xf={})),function(t){t.SPEECH="data-semantic-speech-none",t.SPEECH_SSML="data-semantic-speech",t.SUMMARY="data-semantic-summary-none",t.SUMMARY_SSML="data-semantic-summary",t.PREFIX="data-semantic-prefix-none",t.PREFIX_SSML="data-semantic-prefix",t.POSTFIX="data-semantic-postfix-none",t.POSTFIX_SSML="data-semantic-postfix",t.BRAILLE="data-semantic-braille"}(yf||(yf={}));class Nf{constructor(){this.promise=Promise.resolve(),this.adaptor=null,this._options={},this._init=!1}set element(t){this._element=t}get element(){return this._element}set options(t){this._options=Object.assign({},(null==t?void 0:t.sre)||{},{enableSpeech:t.enableSpeech,enableBraille:t.enableBraille}),delete this._options.custom}get options(){return this._options}init(t,e,s){this.options=t,this._init||(this.adaptor=e,this.webworker=s,this._init=!0)}update(t){Object.assign(this.options,t)}Speech(t){const e=t.outputData.mml,s=Object.assign({},this.options,{modality:"speech"});return this.promise=this.webworker.Speech(e,s,t)}SpeechFor(t,e){const s=Object.assign({},this.options,{modality:"speech"});return this.webworker.speechFor(e,s,t)}cancel(t){var e;null===(e=this.webworker)||void 0===e||e.Cancel(t)}updateRegions(t,e,s){e.Update(this.getLabel(t)),s.Update(this.getBraille(t))}getOptions(t){var e,s,i,n;return{locale:null!==(e=this.adaptor.getAttribute(t,"data-semantic-locale"))&&void 0!==e?e:"",domain:null!==(s=this.adaptor.getAttribute(t,"data-semantic-domain"))&&void 0!==s?s:"",style:null!==(i=this.adaptor.getAttribute(t,"data-semantic-style"))&&void 0!==i?i:"",domain2style:null!==(n=this.adaptor.getAttribute(t,"data-semantic-domain2style"))&&void 0!==n?n:""}}nextRules(t){const e=this.getOptions(t.typesetRoot);return this.update(e),this.promise=this.webworker.nextRules(t.outputData.mml,Object.assign({},this.options,{modality:"speech"}),t)}nextStyle(t,e){const s=this.getOptions(e.typesetRoot);return this.update(s),this.promise=this.webworker.nextStyle(e.outputData.mml,Object.assign({},this.options,{modality:"speech"}),this.adaptor.getAttribute(t,"data-semantic-id"),e)}getLabel(t,e="",s=" "){const i=this.adaptor;return gf(i.getAttribute(t,yf.SPEECH_SSML),i.getAttribute(t,yf.PREFIX_SSML),i.getAttribute(t,yf.POSTFIX_SSML),s)||i.getAttribute(t,"aria-label")}getBraille(t){const e=this.adaptor;return e.getAttribute(t,"aria-braillelabel")||e.getAttribute(t,yf.BRAILLE)}getLocalePreferences(t){return this.promise=this.webworker.clearspeakLocalePreferences(this.options,t)}getRelevantPreferences(t,e,s,i){const n=t.outputData.mml;return this.promise=this.webworker.clearspeakRelevantPreferences(n,e,s,i)}}var Tf=function(t,e,s,i){return new(s||(s=Promise))(function(n,r){function o(t){try{l(i.next(t))}catch(t){r(t)}}function a(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})};class vf{constructor(t,e,s,i){this.cmd=t,this.item=e,this.resolve=s,this.reject=i}}class Lf{constructor(t,e){this.adaptor=t,this.options=e,this.ready=!1,this.tasks=[],this.Commands={Ready(t,e){t.ready=!0,t.postNext()},Finished(t,e){const s=t.tasks.shift();e.success?s.resolve(e.result):s.reject(e.error),t.postNext()},Log(t,e){t.options.debug&&console.log("Log:",e)}}}Start(){return Tf(this,void 0,void 0,function*(){if(this.ready)throw Error("Worker already started");this.worker=yield this.adaptor.createWorker(this.Listener.bind(this),this.options)})}debug(t,...e){this.options.debug&&console.info(t,...e)}Listener(t){this.debug("Worker >>> Client:",t.data),Object.hasOwn(this.Commands,t.data.cmd)?this.Commands[t.data.cmd](this,t.data.data):this.debug("Invalid command from worker: "+t.data.cmd)}Post(t,e){const s=new Promise((s,i)=>{this.tasks.push(new vf(t,e,s,i))});return this.ready&&1===this.tasks.length&&this.postNext(),s}postNext(){if(this.tasks.length){const t=Object.assign({},this.tasks[0].cmd,{debug:this.options.debug});this.worker.postMessage(t)}}Cancel(t){const e=this.tasks.findIndex(e=>e.item===t);e>0&&(this.tasks[e].reject(`Task ${this.tasks[e].cmd.cmd} cancelled`),this.tasks.splice(e,1))}Setup(t){return this.Post({cmd:"setup",data:{domain:t.domain,style:t.style,locale:t.locale,modality:t.modality}})}Speech(t,e,s){return Tf(this,void 0,void 0,function*(){this.Attach(s,e.enableSpeech,e.enableBraille,yield this.Post({cmd:"speech",data:{mml:t,options:e}},s))})}nextRules(t,e,s){return Tf(this,void 0,void 0,function*(){this.Attach(s,e.enableSpeech,e.enableBraille,yield this.Post({cmd:"nextRules",data:{mml:t,options:e}},s))})}nextStyle(t,e,s,i){return Tf(this,void 0,void 0,function*(){this.Attach(i,e.enableSpeech,e.enableBraille,yield this.Post({cmd:"nextStyle",data:{mml:t,options:e,nodeId:s}},i))})}speechFor(t,e,s){return Tf(this,void 0,void 0,function*(){const i=yield this.Post({cmd:"speech",data:{mml:t,options:e}},s);return JSON.parse(i)})}Attach(t,e,s,i){const n=JSON.parse(i),r=t.typesetRoot;if(!r)return;this.setSpecialAttributes(r,n.options,"data-semantic-",["locale","domain","style","domain2style"]);const o=this.adaptor;this.setSpecialAttributes(r,n.translations,"data-semantic-");for(const[t,e]of Object.entries(n.mactions)){let s=o.getElement("#"+t,r);s&&o.childNodes(s)[0]&&(s=o.childNodes(s)[0],"rect"===o.kind(s)&&(s=o.next(s)),o.setAttribute(s,"data-semantic-type","dummy"),this.setSpecialAttributes(s,e,""))}for(const t of o.childNodes(r))"mjx-math"!==o.kind(t)&&"svg"!==o.kind(t)||this.setSpeechAttributes(t,"",n,e,s);e&&(n.label&&(o.setAttribute(r,yf.SPEECH,n.label),o.setAttribute(r,yf.SPEECH_SSML,n.ssml),t.outputData.speech=n.label),o.setAttribute(r,"data-speech-attached","true")),s&&(n.braillelabel&&(o.setAttribute(r,yf.BRAILLE,n.braillelabel),t.outputData.braille=n.braillelabel),n.braille&&o.setAttribute(r,"data-braille-attached","true"))}setSpeechAttribute(t,e,s,i){var n,r;const o=this.adaptor,a=o.getAttribute(t,"data-semantic-id");if(o.removeAttribute(t,"data-speech-node"),s&&e.speech[a]["speech-none"]){o.setAttribute(t,"data-speech-node","true");for(let[s,i]of Object.entries(e.speech[a]))s=s.replace(/-ssml$/,""),i&&o.setAttribute(t,`data-semantic-${s}`,i)}if(i&&(null===(r=null===(n=e.braille)||void 0===n?void 0:n[a])||void 0===r?void 0:r["braille-none"])){o.setAttribute(t,"data-speech-node","true");const s=e.braille[a]["braille-none"];o.setAttribute(t,yf.BRAILLE,s)}}setSpeechAttributes(t,e,s,i,n){const r=this.adaptor;if(!t||"#text"===r.kind(t)||"#comment"===r.kind(t))return e;r.hasAttribute(t,"data-semantic-id")&&(this.setSpeechAttribute(t,s,i,n),e||r.hasAttribute(t,"data-semantic-parent")||(e=r.getAttribute(t,"data-semantic-id")));for(const o of Array.from(r.childNodes(t)))e=this.setSpeechAttributes(o,e,s,i,n);return e}setSpecialAttributes(t,e,s,i){if(e){i=i||Object.keys(e);for(const n of i){const i=e[n];i&&this.adaptor.setAttribute(t,`${s}${n.toLowerCase()}`,i)}}}Detach(t){const e=t.typesetRoot;this.adaptor.removeAttribute(e,"data-speech-attached"),this.adaptor.removeAttribute(e,"data-braille-attached"),this.detachSpeech(e)}detachSpeech(t){const e=this.adaptor,s=e.childNodes(t);if(s){if("#text"!==e.kind(t))for(const s of["none","summary-none","speech","speech-none","summary","braille"])e.removeAttribute(t,`data-semantic-${s}`);for(const t of s)this.detachSpeech(t)}}Terminate(){this.debug("Terminating pending tasks");for(const t of this.tasks)t.reject(`${t.cmd.data.cmd} cancelled by WorkerHandler termination`);return this.tasks=[],this.debug("Terminating worker"),this.worker.terminate()}Stop(){return Tf(this,void 0,void 0,function*(){if(!this.worker)throw Error("Worker has not been started");yield this.Terminate(),this.worker=null,this.ready=!1})}clearspeakLocalePreferences(t,e){return Tf(this,void 0,void 0,function*(){yield this.Post({cmd:"localePreferences",data:{options:t}}).then(s=>{e.set(t.locale,JSON.parse(s))})})}clearspeakRelevantPreferences(t,e,s,i){return Tf(this,void 0,void 0,function*(){yield this.Post({cmd:"relevantPreferences",data:{mml:t,id:e}}).then(t=>{s.set(i,t)})})}}const Cf=Rs.config||{},Rf=()=>(Cf?.loader?.paths?.mathjax||Cf?.__dirname||"/")+"/sre";var If=function(t,e,s,i){return new(s||(s=Promise))(function(n,r){function o(t){try{l(i.next(t))}catch(t){r(t)}}function a(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})};function Sf(t){return class extends t{constructor(){super(...arguments),this.generatorPool=new Nf}attachSpeech(t){if(this.outputData.speechPromise=null,this.state()>=vi.ATTACHSPEECH)return;if(this.state(vi.ATTACHSPEECH),this.isEscaped||!t.options.enableSpeech&&!t.options.enableBraille||!t.options.enableEnrichment)return;t.getWebworker(),this.generatorPool.init(t.options,t.adaptor,t.webworker),this.outputData.mml=this.toMathML(this.root,this);const e=this.generatorPool.Speech(this).catch(e=>t.options.speechError(t,this,e));t.savePromise(e),this.outputData.speechPromise=e}detachSpeech(t){t.webworker.Detach(this)}speechFor(t){return If(this,void 0,void 0,function*(){t=this.toEnriched(t);const e=yield this.generatorPool.SpeechFor(this,t);return[e.label,e.braillelabel]})}clear(){this.generatorPool.cancel(this)}}}function Af(t){var e;return e=class extends t{constructor(...t){super(...t),this.webworker=null;const e=this.constructor.ProcessBits;e.has("attach-speech")||e.allocate("attach-speech"),this.options.MathItem=Sf(this.options.MathItem)}getWebworker(){this.webworker||(this.webworker=new Lf(this.adaptor,this.options.worker),this.webworker.Start())}attachSpeech(){if(!this.processed.isSet("attach-speech")){const t=this.options;if(t.enableEnrichment&&(t.enableSpeech||t.enableBraille)){this.getWebworker();for(const t of this.math)t.attachSpeech(this)}this.processed.set("attach-speech")}return this}speechError(t,e,s){console.warn("Speech generation error:",s)}state(t,e=!1){if(super.state(t,e),t<vi.ATTACHSPEECH&&(this.processed.clear("attach-speech"),t>=vi.TYPESET))for(const t of this.math)t.detachSpeech(this);return this}done(){const t=Object.create(null,{done:{get:()=>super.done}});return If(this,void 0,void 0,function*(){var e;return yield null===(e=this.webworker)||void 0===e?void 0:e.Stop(),t.done.call(this)})}},e.OPTIONS=Object.assign(Object.assign({},t.OPTIONS),{enableSpeech:!0,enableBraille:!0,speechError:(t,e,s)=>t.speechError(t,e,s),renderActions:Gs(Object.assign(Object.assign({},t.OPTIONS.renderActions),{attachSpeech:[vi.ATTACHSPEECH]})),worker:{path:Rf(),maps:Rf().replace(/[cm]js\/a11y\/sre$/,"bundle/sre/mathmaps"),worker:"speech-worker.js",debug:!1},a11y:Gs({speech:!0,braille:!0})}),e}function wf(t,e){return!t.documentClass.prototype.enrich&&e&&(t=lf(t,e)),t.documentClass=Af(t.documentClass),t}if(Li("ATTACHSPEECH",vi.INSERTED+10),MathJax.loader&&MathJax.loader.checkVersion("a11y/speech",xs,"a11y"),Cs({_:{a11y:{speech_ts:cs,speech:{GeneratorPool:ls,SpeechUtil:as,WebWorker:hs}}}}),MathJax.loader){let t=Os.resolvePath("[sre]",!1),e=Os.resolvePath("[mathmaps]",!1);if(As.window)t=new URL(t,location).href,e=new URL(e,location).href;else{const s="undefined"!=typeof require?require:MathJax.config.loader.require;s?.resolve?(t=As.path(s.resolve(`${t}/require.mjs`)).replace(/\/[^\/]*$/,""),e=As.path(s.resolve(`${e}/base.json`)).replace(/\/[^\/]*$/,"")):t=e=""}t&&Ls(MathJax.config,"options",{worker:{path:t,maps:e}})}MathJax.startup&&MathJax.startup.extendHandler(t=>wf(t));class Of{constructor(t){this.document=t,this.CLASS=this.constructor,this.AddStyles()}static get sheetId(){return"MJX-"+this.name+"-styles"}static get styleSheet(){return document.head.querySelector("#"+this.sheetId)}AddStyles(){const t=this.CLASS.sheetId;if(!this.CLASS.style||this.document.adaptor.head().querySelector("#"+t))return;const e=this.document.adaptor.node("style",{id:t});e.innerHTML=this.CLASS.style.cssText,this.document.adaptor.head().appendChild(e)}AddElement(){if(this.div)return;const t=this.document.adaptor.node("div");t.classList.add(this.CLASS.className),this.div=t,this.inner=this.document.adaptor.node("div"),this.div.appendChild(this.inner),this.document.adaptor.body(this.document.adaptor.document).appendChild(this.div)}Show(t){this.AddElement(),this.position(t),this.div.classList.add(this.CLASS.className+"_Show")}Hide(){this.div&&(this.div.remove(),this.div=null,this.inner=null)}stackRegions(t){const e=t.getBoundingClientRect();let s=0,i=Number.POSITIVE_INFINITY;const n=this.document.adaptor.document.getElementsByClassName(this.CLASS.className+"_Show");for(let t,e=0;t=n[e];e++)t!==this.div&&(s=Math.max(t.getBoundingClientRect().bottom,s),i=Math.min(t.getBoundingClientRect().left,i));const r=(s||e.bottom+10)+window.scrollY,o=(i<Number.POSITIVE_INFINITY?i:e.left)+window.scrollX;this.div.style.top=r+"px",this.div.style.left=o+"px"}}class Mf extends Of{Clear(){}Update(){}Hide(){}Show(){}AddElement(){}AddStyles(){}position(){}}class Df extends Of{Clear(){this.div&&(this.Update(""),this.inner.style.top="",this.inner.style.backgroundColor="")}Update(t){t&&this.AddElement(),this.inner&&(this.inner.textContent="",this.inner.textContent=t||"\xa0")}position(t){this.stackRegions(t)}}class kf extends Df{}kf.className="MJX_ToolTip",kf.style=new vr({[`.${kf.className}`]:{width:"auto",height:"auto",opacity:1,"text-align":"center","border-radius":"4px",padding:0,"border-bottom":"1px dotted black",position:"absolute",display:"inline-block","background-color":"white","z-index":202},[`.${kf.className} > div`]:{"border-radius":"inherit",padding:"0 2px"},"@media (prefers-color-scheme: dark)":{["."+kf.className]:{"background-color":"#222025","box-shadow":"0px 5px 20px #000",border:"1px solid #7C7C7C"}}});class Pf extends Df{static setColor(t,e,s,i){const n=this.styleSheet;if(n){const r=n.sheet.cssRules[0].style,o=`--mjx-${t}${e}-color`,a=`rgba(var(--mjx-${t}-${s}), ${1===i?1:`var(--mjx-${t}${e}-alpha)`})`;r.getPropertyValue(o)!==a&&r.setProperty(o,a);const l=`--mjx-${t}${e}-alpha`;r.getPropertyValue(l)!==String(i)&&(r.setProperty(l,i),n.sheet.cssRules[1].cssRules[0].style.setProperty(l,Math.pow(i,.7071)))}}}Pf.className="MJX_LiveRegion",Pf.priority={primary:1,secondary:2},Pf.style=new vr({":root":{"--mjx-fg-red":"255, 0, 0","--mjx-fg-green":"0, 255, 0","--mjx-fg-blue":"0, 0, 255","--mjx-fg-yellow":"255, 255, 0","--mjx-fg-cyan":"0, 255, 255","--mjx-fg-magenta":"255, 0, 255","--mjx-fg-white":"255, 255, 255","--mjx-fg-black":"0, 0, 0","--mjx-bg-red":"255, 0, 0","--mjx-bg-green":"0, 255, 0","--mjx-bg-blue":"0, 0, 255","--mjx-bg-yellow":"255, 255, 0","--mjx-bg-cyan":"0, 255, 255","--mjx-bg-magenta":"255, 0, 255","--mjx-bg-white":"255, 255, 255","--mjx-bg-black":"0, 0, 0","--mjx-live-bg-color":"white","--mjx-live-shadow-color":"#888","--mjx-live-border-color":"#CCCCCC","--mjx-bg1-color":"rgba(var(--mjx-bg-blue), var(--mjx-bg1-alpha))","--mjx-fg1-color":"rgba(var(--mjx-fg-black), 1)","--mjx-bg2-color":"rgba(var(--mjx-bg-red), 1)","--mjx-fg2-color":"rgba(var(--mjx-fg-black), 1)","--mjx-bg1-alpha":.2,"--mjx-fg1-alpha":1,"--mjx-bg2-alpha":1,"--mjx-fg2-alpha":1},"@media (prefers-color-scheme: dark)":{":root":{"--mjx-bg-blue":"132, 132, 255","--mjx-bg-white":"0, 0, 0","--mjx-bg-black":"255, 255, 255","--mjx-fg-white":"0, 0, 0","--mjx-fg-black":"255, 255, 255","--mjx-live-bg-color":"#222025","--mjx-live-shadow-color":"black","--mjx-live-border-color":"#7C7C7C","--mjx-bg1-alpha":.3,"--mjx-fg1-alpha":1,"--mjx-bg2-alpha":1,"--mjx-fg2-alpha":1}},[`.${Pf.className}`]:{position:"absolute",top:0,display:"none",width:"auto",height:"auto",padding:0,opacity:1,"z-index":"202",left:0,right:0,margin:"0 auto","background-color":"var(--mjx-live-bg-color)","box-shadow":"0px 5px 20px var(--mjx-live-shadow-color)",border:"2px solid var(--mjx-live-border-color)"},[`.${Pf.className}_Show`]:{display:"block"},[`.${Pf.className} > div`]:{color:"var(--mjx-fg1-color)","background-color":"var(--mjx-bg1-color)"},"mjx-container [data-sre-highlight-1]:not([data-mjx-collapsed], rect)":{color:"var(--mjx-fg1-color) ! important",fill:"var(--mjx-fg1-color) ! important"},[["mjx-container:not([data-mjx-clone-container])","[data-sre-highlight-1]:not([data-sre-enclosed], rect)"].join(" ")]:{"background-color":"var(--mjx-bg1-color) ! important"},"mjx-container rect[data-sre-highlight-1]:not([data-sre-enclosed])":{fill:"var(--mjx-bg1-color) ! important"},"mjx-container [data-sre-highlight-2]":{color:"var(--mjx-fg2-color) ! important","background-color":"var(--mjx-bg2-color) ! important",fill:"var(--mjx-fg2-color) ! important"},"mjx-container rect[data-sre-highlight-2]":{fill:"var(--mjx-bg2-color) ! important"}});class Bf extends Pf{constructor(){super(...arguments),this.active=!1,this.node=null,this.clear=!1,this.voiceRequest=!1,this.voiceCancelled=!1}Show(t){super.Update("\xa0"),this.node=t,super.Show(t)}Update(t){if(this.voiceRequest)return void this.makeVoice(t);speechSynthesis.onvoiceschanged=(()=>this.voiceRequest=!0).bind(this);new Promise(t=>{setTimeout(()=>{this.voiceRequest?t(!0):setTimeout(()=>{this.voiceRequest=!0,t(!0)},100)},100)}).then(()=>this.makeVoice(t))}makeVoice(t){this.active=this.document.options.a11y.voicing&&!!speechSynthesis.getVoices().length,speechSynthesis.cancel(),this.clear=!0;const[e,s]=bf(t,this.document.options.sre.locale,this.document.options.sre.rate);super.Update(e),this.active&&e&&this.makeUtterances(s,this.document.options.sre.locale)}makeUtterances(t,e){this.voiceCancelled=!1;let s=null;for(const i of t)if(i.mark){if(!s){this.highlightNode(i.mark,!0);continue}s.addEventListener("end",t=>{this.voiceCancelled||this.highlightNode(i.mark)})}else{if(i.pause){const t=parseInt(i.pause.match(/^[0-9]+/)[0]);if(isNaN(t)||!s)continue;s.addEventListener("end",e=>{speechSynthesis.pause(),setTimeout(()=>{speechSynthesis.resume()},t)});continue}s=new SpeechSynthesisUtterance(i.text),i.rate&&(s.rate=i.rate),i.pitch&&(s.pitch=i.pitch),s.lang=e,speechSynthesis.speak(s)}s&&s.addEventListener("end",t=>{this.highlighter.unhighlight()})}Hide(){this.cancelVoice(),super.Hide()}cancelVoice(){this.voiceCancelled=!0,speechSynthesis.cancel(),this.highlighter.unhighlight()}highlightNode(t,e=!1){this.highlighter.unhighlight();const s=Array.from(this.node.querySelectorAll(`[data-semantic-id="${t}"]`));this.clear&&!e||this.highlighter.highlight(s),this.clear=!1}}Bf.style=null;class jf extends Of{position(t){const e=t.getBoundingClientRect(),s=this.div.getBoundingClientRect();let i,n=e.left+e.width/2-s.width/2;switch(n=n<0?0:n,n+=window.scrollX,this.document.options.a11y.align){case"top":i=e.top-s.height-10;break;case"bottom":i=e.bottom+10;break;default:i=e.top+e.height/2-s.height/2}i+=window.scrollY,i=i<0?0:i,this.div.style.top=i+"px",this.div.style.left=n+"px"}Show(t){this.AddElement(),this.div.style.fontSize=this.document.options.a11y.magnify,this.Update(t),super.Show(t)}Clear(){this.div&&(this.inner.textContent="",this.inner.style.top="",this.inner.style.backgroundColor="")}Update(t){if(!this.div)return;this.Clear();const e=this.cloneNode(t),s=e.querySelector("[data-mjx-clone]");this.inner.style.backgroundColor=t.style.backgroundColor,s.style.backgroundColor="",s.classList.remove("mjx-selected"),this.inner.appendChild(e),this.position(t)}cloneNode(t){let e=t.cloneNode(!0);if(e.setAttribute("data-mjx-clone","true"),"MJX-CONTAINER"!==e.nodeName){"g"!==e.nodeName&&(e.style.marginLeft=e.style.marginRight="0");const s=t.closest("mjx-container");if("MJX-MATH"!==e.nodeName&&"svg"!==e.nodeName){let i=s.firstChild;"MJX-BBOX"===i.nodeName&&(i=i.nextSibling),e=i.cloneNode(!1).appendChild(e).parentElement;const n=Array.from(s.querySelectorAll("[data-sre-enclosed]"));"svg"===i.nodeName?this.svgClone(t,n,e,s):this.chtmlClone(t,n,e)}e=s.cloneNode(!1).appendChild(e).parentElement,e.style.margin="0",e.style.minWidth=""}return e.setAttribute("data-mjx-clone-container","true"),e}chtmlClone(t,e,s){for(const i of e)if(i!==t){const t=i.getAttribute("data-semantic-id");t&&s.querySelector(`[data-semantic-id="${t}"]`)||s.appendChild(i.cloneNode(!0))}}svgClone(t,e,s,i){var n;let{x:r,y:o,width:a,height:l}=t.getBBox();if(e.length){s.firstChild.remove();const n=i.querySelector("g").cloneNode(!1);for(const s of e){const e=n.appendChild(s.cloneNode(!0));s===t&&e.setAttribute("data-mjx-clone","true");const[i,r]=this.xy(s);e.setAttribute("transform",`translate(${i}, ${r})`)}s.appendChild(n);const h=t.previousSibling,c=h.getBBox();a=c.width,l=c.height;const[d,u]=this.xy(h);r=d,o=u+c.y}const h=i.querySelector("g");if("full"===i.getAttribute("width")&&h.firstChild.lastChild===t)return s.innerHTML="",s.appendChild(i.cloneNode(!0).firstChild),s.querySelector(".mjx-selected").setAttribute("data-mjx-clone","true"),void(null===(n=s.querySelector("[data-sre-highlighter-added]"))||void 0===n||n.remove());s.firstChild.setAttribute("transform","scale(1, -1)");const c=parseFloat((s.getAttribute("viewBox")||s.getAttribute("data-mjx-viewBox")).split(/ /)[2]),d=parseFloat(s.style.minWidth||s.getAttribute("width"));s.setAttribute("viewBox",[r,-(o+l),a,l].join(" ")),s.removeAttribute("style"),s.setAttribute("width",d/c*a+"ex"),s.setAttribute("height",d/c*l+"ex")}xy(t){const e=DOMPoint.fromPoint({x:0,y:0}).matrixTransform(t.getCTM().inverse());return[-e.x,-e.y]}}jf.className="MJX_HoverRegion",jf.style=new vr({[`.${jf.className}`]:{display:"block",position:"absolute",width:"max-content",height:"auto",padding:0,opacity:1,"z-index":"202",margin:"0 auto","background-color":"white","line-height":0,"box-shadow":"0px 10px 20px #888",border:"2px solid #CCCCCC"},[`.${jf.className} > div`]:{overflow:"hidden",color:"var(--mjx-fg1-color)","background-color":"var(--mjx-bg1-color)"},"@media (prefers-color-scheme: dark)":{["."+jf.className]:{"background-color":"#222025","box-shadow":"0px 5px 20px #000",border:"1px solid #7C7C7C"}},"mjx-container[data-mjx-clone-container]":{padding:"2px ! important"},"mjx-math > mjx-mlabeledtr":{display:"inline-block","margin-right":".5em ! important"},"mjx-math > mjx-mtd":{float:"right"}});class _f{get highlighter(){return this.pool.highlighter}static stopEvent(t){t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopImmediatePropagation?t.stopImmediatePropagation():t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0}static create(t,e,s,i,...n){return new this(t,e,s,i,...n)}constructor(t,e,s,i,...n){this.document=t,this.pool=e,this.region=s,this.node=i,this.stoppable=!0,this.events=[],this._active=!1}Events(){return this.events}get active(){return this._active}set active(t){this._active=t}Attach(){this.AddEvents()}Detach(){this.RemoveEvents()}Start(){this.active=!0}Stop(){this.active&&(this.region.Clear(),this.region.Hide(),this.active=!1)}AddEvents(){for(const[t,e]of this.events)this.node.addEventListener(t,e)}RemoveEvents(){for(const[t,e]of this.events)this.node.removeEventListener(t,e)}Update(t=!1){}stopEvent(t){this.stoppable&&_f.stopEvent(t)}}var Ff=function(t,e,s,i){return new(s||(s=Promise))(function(n,r){function o(t){try{l(i.next(t))}catch(t){r(t)}}function a(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof s?e:new s(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})};const Uf="Windows"===As.os,Hf=Array(40).fill("\u2800").join(""),Wf="[data-speech-node]";function Vf(t){return t.matches("mjx-container")}function qf(t,e=!0){return t.shiftKey&&e||t.metaKey||t.altKey||t.ctrlKey}class Xf extends _f{static helpMessage(t,e,s){return`\n <h2 role="heading" aria-level="2">Exploring expressions ${t}</h2>\n\n <p>The mathematics on this page is being rendered by <a\n href="https://www.mathjax.org/" target="_blank">MathJax</a>, which\n generates both the text spoken by screen readers, as well as the\n visual layout for sighted users.</p>\n\n <p>Expressions typeset by MathJax can be explored interactively, and\n are focusable. You can use the <kbd>Tab</kbd> key to move to a typeset\n expression${e}. Initially, the expression will be read in full,\n but you can use the following keys to explore the expression\n further:</p>\n\n <ul>\n\n <li><kbd>Down Arrow</kbd> moves one level deeper into the\n expression to allow you to explore the current subexpression term by\n term.</li>\n\n <li><kbd>Up Arrow</kbd> moves back up a level within the\n expression.</li>\n\n <li><kbd>Right Arrow</kbd> moves to the next term in the\n current subexpression.</li>\n\n <li><kbd>Left Arrow</kbd> moves to the next term in the\n current subexpression.</li>\n\n <li><kbd>Shift</kbd>+<kbd>Arrow</kbd> moves to a\n neighboring cell within a table.</li>\n\n <li><kbd>0-9</kbd>+<kbd>0-9</kbd> jumps to a cell\n by its index in the table, where 0 = 10.</li>\n\n <li><kbd>Home</kbd> takes you to the top of the\n expression.</li>\n\n <li><kbd>Enter</kbd> or <kbd>Return</kbd> clicks a\n link or activates an active subexpression.</li>\n\n <li><kbd>Space</kbd> opens the MathJax contextual menu\n where you can view or copy the source format of the expression, or\n modify MathJax's settings.</li>\n\n <li><kbd>Escape</kbd> exits the expression\n explorer.</li>\n\n <li><kbd>x</kbd> gives a summary of the current\n subexpression.</li>\n\n <li><kbd>z</kbd> gives the full text of a collapsed\n expression.</li>\n\n <li><kbd>d</kbd> gives the current depth within the\n expression.</li>\n\n <li><kbd>s</kbd> starts or stops auto-voicing with\n synchronized highlighting.</li>\n\n <li><kbd>v</kbd> marks the current position in the\n expression.</li>\n\n <li><kbd>p</kbd> cycles through the marked positions in\n the expression.</li>\n\n <li><kbd>u</kbd> clears all marked positions and returns\n to the starting position.</li>\n\n <li><kbd>&gt;</kbd> cycles through the available speech\n rule sets (MathSpeak, ClearSpeak).</li>\n\n <li><kbd>&lt;</kbd> cycles through the verbosity levels\n for the current rule set.</li>\n\n <li><kbd>b</kbd> toggles whether Braille notation is combined\n with speech text for tactile Braille devices, as discussed\n below.\n\n <li><kbd>h</kbd> produces this help listing.</li>\n </ul>\n\n <p>The MathJax contextual menu allows you to enable or disable speech\n or Braille generation for mathematical expressions, the language to\n use for the spoken mathematics, and other features of MathJax. In\n particular, the Explorer submenu allows you to specify how the\n mathematics should be identified in the page (e.g., by saying "math"\n when the expression is spoken), and whether or not to include a\n message about the letter "h" bringing up this dialog box. Turning off\n speech and Braille will disable the expression explorer, its\n highlighting, and its help icon.</p>\n\n <p>Support for tactile Braille devices varies across screen readers,\n browsers, and operative systems. If you are using a Braille output\n device, you may need to select the "Combine with Speech" option in the\n contextual menu's Braille submenu in order to obtain Nemeth or Euro\n Braille output rather than the speech text on your Braille\n device. ${s}</p>\n\n <p>The contextual menu also provides options for viewing or copying a\n MathML version of the expression or its original source format,\n creating an SVG version of the expression, and viewing various other\n information.</p>\n\n <p>Finally, selecting the "Insert Hidden MathML" item from the options\n submenu will turn of MathJax's speech and Braille generation and\n instead use visually hidden MathML that some screen readers can voice,\n though support for this is not universal across all screen readers and\n operating systems. Selecting speech or Braille generation in their\n submenus will remove the hidden MathML again.</p>\n\n <p>For more help, see the <a\n href="https://docs.mathjax.org/en/latest/basic/accessibility.html"\n target="_blank">MathJax accessibility documentation.</a></p>\n `}get generators(){var t;return null===(t=this.item)||void 0===t?void 0:t.generatorPool}get role(){return this.item.ariaRole}get description(){return this.item.roleDescription}get none(){return this.document.options.a11y.brailleSpeech?this.item.brailleNone:this.item.none}get brailleNone(){return this.item.brailleNone}FocusIn(t){t.target.closest("mjx-html")||(this.item.outputData.nofocus?this.item.outputData.nofocus=!1:(this.clicked||(this.Start(),this.backTab=t.target===this.img),this.clicked=null))}FocusOut(t){this.current&&!this.focusSpeech&&(this.document.options.keepRegions||(this.setCurrent(null),this.Stop()),document.hasFocus()||this.focusTop())}KeyDown(t){if(this.pendingIndex.shift(),this.region.cancelVoice(),qf(t,!1))return;const e=this.constructor,s=1===t.key.length?t.key.toLowerCase():t.key,[i,n]=e.keyMap.get(s)||[],r=i?void 0===n||this.active?i(this,t):n:this.undefinedKey(t);r||(this.stopEvent(t),!1===r&&this.sound&&this.NoMove())}MouseDown(t){var e;if(this.pendingIndex=[],this.region.cancelVoice(),qf(t)||2===t.buttons)return void(this.item.outputData.nofocus=!0);const s=this.findClicked(t.target,t.x,t.y);s!==this.document.infoIcon?(null===(e=document.getSelection())||void 0===e||e.removeAllRanges(),t.target.getAttribute("sre-highlighter-added")?this.refocus=s:this.clicked=s):this.stopEvent(t)}Click(t){if(qf(t)||2===t.buttons||"Range"===document.getSelection().type)return void this.FocusOut(null);const e=this.findClicked(t.target,t.x,t.y);if(e===this.document.infoIcon)return this.stopEvent(t),void this.help();this.clicked||e&&!this.node.contains(e)||(this.refocus=e,this.triggerLinkMouse()||this.Start())}DblClick(t){var e;const s=null!==(e=document.getSelection().direction)&&void 0!==e?e:"none";qf(t)||2===t.buttons||"none"!==s?this.FocusOut(null):(this.refocus=this.rootNode(),this.Start())}spaceKey(){return this.refocus=this.current,!0}hKey(){if(!this.document.options.enableExplorerHelp)return!0;this.refocus=this.current,this.help()}escapeKey(t){return t.target.closest("mjx-html")?(this.refocus=t.target.closest(Wf),this.Start()):(this.Stop(),this.focusTop(),this.setCurrent(null)),!0}tabKey(t){var e;const s=null!==(e=this.current)&&void 0!==e?e:this.node.contains(document.activeElement)?document.activeElement:null;if(0===this.tabs.length||!s)return!0;if(this.backTab)return!t.shiftKey||void this.tabTo(this.tabs[this.tabs.length-1]);const[i,n,r]=t.shiftKey?[this.tabs.slice(0).reverse(),Node.DOCUMENT_POSITION_PRECEDING,this.current&&this.isLink()?this.getAnchor():s]:[this.tabs,Node.DOCUMENT_POSITION_FOLLOWING,s];for(const t of i)if(r.compareDocumentPosition(t)&n)return void this.tabTo(t);return t.shiftKey&&this.current===this.rootNode()&&this.tabOut(),!0}tabTo(t){t.getAttribute("data-mjx-href")?this.setCurrent(this.linkFor(t)):t.focus()}tabOut(){const t=Array.from(this.node.querySelectorAll("mjx-html"));t.length&&(t.forEach(t=>{t.style.display="none"}),setTimeout(()=>{t.forEach(t=>{t.style.display=""})},0))}enterKey(t){if(this.active)if(this.triggerLinkKeyboard(t))this.Stop();else{const t=this.actionable(this.current);if(t)return this.refocus=t,void t.dispatchEvent(new Event("click"));const e=this.getInternalTabs(this.current).filter(t=>!t.getAttribute("data-mjx-href"));if(e.length)return void e[0].focus()}else this.Start()}homeKey(){this.setCurrent(this.rootNode())}moveDown(t){return t?this.moveToNeighborCell(1,0):this.moveTo(this.firstNode(this.current))}moveUp(t){return t?this.moveToNeighborCell(-1,0):this.moveTo(this.getParent(this.current))}moveRight(t){return t?this.moveToNeighborCell(0,1):this.moveTo(this.nextSibling(this.current))}moveLeft(t){return t?this.moveToNeighborCell(0,-1):this.moveTo(this.prevSibling(this.current))}moveTo(t){if(!t)return!1;this.setCurrent(t)}moveToNeighborCell(t,e){const s=this.tableCell(this.current);if(!s)return!1;const[i,n]=this.cellPosition(s);if(null==i)return!1;const r=this.cellAt(this.cellTable(s),i+t,n+e);if(!r)return!1;this.setCurrent(r)}undefinedKey(t){return!this.active||qf(t)}addMark(){this.current===this.marks[this.marks.length-1]?this.setCurrent(this.current):(this.currentMark=this.marks.length-1,this.marks.push(this.current),this.speak("Position marked"))}prevMark(){if(this.currentMark<0){if(0===this.marks.length)return void this.setCurrent(this.lastMark||this.rootNode());this.currentMark=this.marks.length-1}const t=this.currentMark;this.setCurrent(this.marks[t]),this.currentMark=t-1}clearMarks(){this.marks=[],this.currentMark=-1,this.prevMark()}autoVoice(){const t=!this.document.options.a11y.voicing;this.document.menu?this.document.menu.menu.pool.lookup("voicing").setValue(t):this.document.options.a11y.voicing=t,this.Update()}toggleBraille(){const t=!this.document.options.a11y.brailleCombine;this.document.menu?this.document.menu.menu.pool.lookup("brailleCombine").setValue(t):this.document.options.a11y.brailleCombine=t}numberKey(t){if(!this.tableCell(this.current))return!1;if(0===t&&(t=10),this.pendingIndex.length){const e=this.cellTable(this.tableCell(this.current)),s=this.cellAt(e,this.pendingIndex[0]-1,t-1);if(this.pendingIndex=[],this.speak(String(t)),!s)return!1;setTimeout(()=>this.setCurrent(s),500)}else this.pendingIndex=[null,t],this.speak(`Jump to row ${t} and column`)}depth(){var t,e,s;if("d"===this.speechType)return void this.setCurrent(this.current);this.speechType="d";const i=[[null!==(t=this.node.getAttribute("data-semantic-level"))&&void 0!==t?t:"Level",null!==(e=this.current.getAttribute("data-semantic-level-number"))&&void 0!==e?e:"0"].join(" ").trim()],n=this.actionable(this.current);n&&i.unshift(null!==(s=this.node.getAttribute("1"===n.getAttribute("toggle")?"data-semantic-expandable":"data-semantic-collapsible"))&&void 0!==s?s:""),this.speak(i.join(" "),this.current.getAttribute(yf.BRAILLE))}summary(){if("x"===this.speechType)return void this.setCurrent(this.current);this.speechType="x";const t=this.current.getAttribute(yf.SUMMARY);this.speak(t,this.current.getAttribute(yf.BRAILLE),this.SsmlAttributes(this.current,yf.SUMMARY_SSML))}nextRules(){this.node.removeAttribute("data-speech-attached"),this.restartAfter(this.generators.nextRules(this.item))}nextStyle(){this.node.removeAttribute("data-speech-attached"),this.restartAfter(this.generators.nextStyle(this.current,this.item))}details(){const t=this.actionable(this.current);if(!t||!t.getAttribute("data-collapsible")||"1"!==t.getAttribute("toggle")||"z"===this.speechType)return void this.setCurrent(this.current);this.speechType="z";const e=this.nodeId(this.current);let s;this.item.root.walkTree(t=>{t.attributes.get("data-semantic-id")===e&&(s=t)});let i=this.item.toMathML(s,this.item);s.isKind("math")||(i=`<math>${i}</math>`),i=i.replace(/ (?:data-semantic-|aria-|data-speech-|data-latex).*?=".*?"/g,""),this.item.speechFor(i).then(([t,e])=>this.speak(t,e))}help(){if(!this.document.options.enableExplorerHelp)return;const t=this.constructor,[e,s,i]=t.helpData.get(As.os);Ir.post({title:"MathJax Expression Explorer Help",message:t.helpMessage(e,s,i),node:this.node,adaptor:this.document.adaptor,styles:{".mjx-dialog":{"max-height":"calc(min(35em, 90%))"},"mjx-dialog mjx-title":{"font-size":"133%",margin:".5em 1.75em"},"mjx-dialog h2":{"font-size":"20px",margin:".5em 0"},"mjx-dialog ul":{"list-style-type":"none"},"mjx-dialog li":{"margin-bottom":".5em"}}})}setCurrent(t,e=!1){if(this.backTab=!1,this.speechType="",document.hasFocus()||(this.refocus=this.current),this.node.setAttribute("aria-busy","true"),this.current){this.pool.unhighlight();for(const t of Array.from(this.node.querySelectorAll(".mjx-selected")))t.classList.remove("mjx-selected");"last"===this.document.options.a11y.tabSelects&&(this.refocus=this.current),t||(this.lastMark=this.current,this.removeSpeech()),this.current=null}if(this.current=t,this.currentMark=-1,this.current){const s=[...this.getSplitNodes(this.current)];this.highlighter.encloseNodes(s,this.node);for(const t of s)t.getAttribute("data-sre-enclosed")||t.classList.add("mjx-selected");this.pool.highlight(s),this.addSpeech(t,e),this.node.setAttribute("tabindex","-1"),this.Update()}this.node.removeAttribute("aria-busy")}getSplitNodes(t){const e=this.nodeId(t);if(!e)return[t];if(this.cacheParts.has(e))return this.cacheParts.get(e);const s=Array.from(this.node.querySelectorAll(`[data-semantic-id="${e}"]`)),i=this.subtree(e,s);return this.cacheParts.set(e,[...s,...i]),this.cacheParts.get(e)}subtree(t,e){const s=this.subtrees.get(t),i=new Set;for(const t of e)Array.from(t.querySelectorAll("[data-semantic-id]")).forEach(t=>i.add(this.nodeId(t)));return[...function(t,e){if(!t)return new Set;if(!e)return t;return new Set([...t].filter(t=>!e.has(t)))}(s,i)].map(t=>this.getNode(t)).filter(t=>null!==t)}addSpeech(t,e){var s;if(!this.document.options.enableSpeech&&!this.document.options.enableBraille)return;this.anchors.length?setTimeout(()=>{var t;return null===(t=this.img)||void 0===t?void 0:t.remove()},10):null===(s=this.img)||void 0===s||s.remove();let i=this.addComma([t.getAttribute(yf.PREFIX),t.getAttribute(yf.SPEECH),t.getAttribute(yf.POSTFIX)]).join(" ").trim();if(e){let t=this.description===this.none?"":", "+this.description;this.document.options.a11y.help&&this.document.options.enableExplorerHelp&&(t+=", press h for help"),i+=t}this.speak(i,t.getAttribute(yf.BRAILLE),this.SsmlAttributes(t,yf.SPEECH_SSML))}addComma(t){return t[2]&&(t[1]||t[0])&&(t[1]+=","),t}removeSpeech(){this.speech&&(this.unspeak(this.speech),this.speech=null,this.img&&this.node.append(this.img),this.node.setAttribute("tabindex",this.tabIndex))}speak(t,e="",s=null,i=this.none){const n=this.speech,r=this.speech=document.createElement("mjx-speech");if(r.setAttribute("role",this.role),r.setAttribute("aria-label",t||this.none),r.setAttribute("aria-roledescription",i||this.none),r.setAttribute(yf.SPEECH,t),s&&(r.setAttribute(yf.PREFIX_SSML,s[0]||""),r.setAttribute(yf.SPEECH_SSML,s[1]||""),r.setAttribute(yf.POSTFIX_SSML,s[2]||"")),e&&(this.document.options.a11y.brailleSpeech&&(r.setAttribute("aria-label",e),r.setAttribute("aria-roledescription",this.brailleNone)),r.setAttribute("aria-braillelabel",e),r.setAttribute("aria-brailleroledescription",this.brailleNone),this.document.options.a11y.brailleCombine&&r.setAttribute("aria-label",e+Hf+t)),r.setAttribute("tabindex","0"),Uf){const t=document.createElement("mjx-speech-container");t.setAttribute("role","application"),t.setAttribute("aria-roledescription",this.none),t.setAttribute("aria-brailleroledescription",this.brailleNone),t.append(r),this.node.append(t),r.setAttribute("role","img")}else this.node.append(r);this.focusSpeech=!0,r.focus(),this.focusSpeech=!1,this.Update(),n&&setTimeout(()=>this.unspeak(n),100)}unspeak(t){Uf&&(t=t.parentElement),t.remove()}attachSpeech(){var t;const e=this.item,s=this.node;if(!s.hasAttribute("has-speech")){for(const t of Array.from(s.childNodes))t.setAttribute("aria-hidden","true");s.setAttribute("has-speech","true")}const i=e.roleDescription,n=(s.getAttribute(yf.SPEECH)||"")+(i?", "+i:"");null===(t=this.img)||void 0===t||t.remove(),this.img=this.document.adaptor.node("mjx-speech",{"aria-label":n,role:"img","aria-roledescription":e.none});const r=s.getAttribute(yf.BRAILLE);r&&(this.document.options.a11y.brailleSpeech&&(this.img.setAttribute("aria-label",r),this.img.setAttribute("aria-roledescription",this.brailleNone)),this.img.setAttribute("aria-braillelabel",r),this.img.setAttribute("aria-brailleroledescription",this.brailleNone),this.document.options.a11y.brailleCombine&&this.img.setAttribute("aria-label",r+Hf+n)),s.appendChild(this.img),this.adjustAnchors(),this.getTabs()}detachSpeech(){var t;const e=this.node;null===(t=this.img)||void 0===t||t.remove(),e.removeAttribute("has-speech");for(const t of Array.from(e.childNodes))t.removeAttribute("aria-hidden");this.restoreAnchors()}adjustAnchors(){this.anchors=Array.from(this.node.querySelectorAll("a[href]"));for(const t of this.anchors){const e=t.getAttribute("href");t.setAttribute("data-mjx-href",e),t.removeAttribute("href")}this.anchors.length&&this.img.setAttribute("tabindex","0")}restoreAnchors(){for(const t of this.anchors)t.setAttribute("href",t.getAttribute("data-mjx-href")),t.removeAttribute("data-mjx-href");this.anchors=[]}getTabs(){this.tabs=this.getInternalTabs(this.node)}getInternalTabs(t){return Array.from(t.querySelectorAll('button, [data-mjx-href], input, select, textarea, [tabindex]:not([tabindex="-1"],mjx-speech)'))}focus(){this.node.focus()}nodeId(t){return t.getAttribute("data-semantic-id")}parentId(t){return t.getAttribute("data-semantic-parent")}getNode(t){return t?this.node.querySelector(`[data-semantic-id="${t}"]`):null}getParent(t){return this.getNode(this.parentId(t))}childArray(t){return t?t.getAttribute("data-semantic-children").split(/,/):[]}isCell(t){return!!t&&this.cellTypes.includes(t.getAttribute("data-semantic-type"))}isRow(t){return!!t&&"row"===t.getAttribute("data-semantic-type")}tableCell(t){for(;t&&t!==this.node;){if(this.isCell(t))return t;t=t.parentNode}return null}cellTable(t){const e=this.getParent(t);return this.isRow(e)?this.getParent(e):e}cellPosition(t){const e=this.getParent(t),s=this.childArray(e).indexOf(this.nodeId(t));if(!this.isRow(e))return[s,1];const i=this.getParent(e);return[this.childArray(i).indexOf(this.nodeId(e)),s]}cellAt(t,e,s){const i=this.getNode(this.childArray(t)[e]);if(!this.isRow(i))return 1===s?i:null;return this.getNode(this.childArray(i)[s])}firstNode(t){const e=t.getAttribute("data-semantic-owns");if(!e)return t.querySelector(Wf);const s=e.split(/ /);for(const t of s){const e=this.getNode(t);if(null==e?void 0:e.hasAttribute("data-speech-node"))return e}return t.querySelector(Wf)}rootNode(){const t=this.node.querySelector("[data-semantic-structure]");if(!t)return this.node.querySelector(Wf);const e=t.getAttribute("data-semantic-structure").split(/ /)[0].replace("(","");return this.getNode(e)}nextSibling(t){var e;const s=this.parentId(t);if(!s)return null;const i=null===(e=this.getNode(s).getAttribute("data-semantic-owns"))||void 0===e?void 0:e.split(/ /);if(!i)return null;let n,r=i.indexOf(this.nodeId(t));do{n=this.getNode(i[++r])}while(n&&!n.hasAttribute("data-speech-node"));return n}prevSibling(t){var e;const s=this.parentId(t);if(!s)return null;const i=null===(e=this.getNode(s).getAttribute("data-semantic-owns"))||void 0===e?void 0:e.split(/ /);if(!i)return null;let n,r=i.indexOf(this.nodeId(t));do{n=this.getNode(i[--r])}while(n&&!n.hasAttribute("data-speech-node"));return n}findClicked(t,e,s){const i=this.document.infoIcon;if(i===t||i.contains(t))return i;if("SVG"!==this.node.getAttribute("jax"))return t.closest(Wf);let n=null,r=this.node;for(;r;){r.matches(Wf)&&(n=r);const t=Array.from(r.childNodes);r=null;for(const i of t)if(i!==this.speech&&i!==this.img&&i.tagName&&"rect"!==i.tagName.toLowerCase()){const{left:t,right:n,top:o,bottom:a}=i.getBoundingClientRect();if(t<=e&&e<=n&&o<=s&&s<=a){r=i;break}}}return n}isLink(t=this.current){var e;return!!(null===(e=null==t?void 0:t.getAttribute("data-semantic-attributes"))||void 0===e?void 0:e.includes("href:"))}getAnchor(t=this.current){const e=t.closest("a");return e&&this.node.contains(e)?e:null}linkFor(t){return null==t?void 0:t.querySelector('[data-semantic-attributes*="href:"]')}parentLink(t){const e=null==t?void 0:t.closest('[data-semantic-attributes*="href:"]');return e&&this.node.contains(e)?e:null}focusTop(){this.focusSpeech=!0,this.node.focus(),this.focusSpeech=!1}SsmlAttributes(t,e){return[t.getAttribute(yf.PREFIX_SSML),t.getAttribute(e),t.getAttribute(yf.POSTFIX_SSML)]}restartAfter(t){return Ff(this,void 0,void 0,function*(){yield t,this.attachSpeech();const e=this.current;this.current=null,this.pool.unhighlight(),this.setCurrent(e)})}constructor(t,e,s,i,n,r,o,a){super(t,e,null,i),this.document=t,this.pool=e,this.region=s,this.node=i,this.brailleRegion=n,this.magnifyRegion=r,this.item=a,this.sound=!1,this.current=null,this.clicked=null,this.refocus=null,this.focusSpeech=!1,this.restarted=null,this.speech=null,this.speechType="",this.img=null,this.attached=!1,this.eventsAttached=!1,this.marks=[],this.currentMark=-1,this.lastMark=null,this.pendingIndex=[],this.cellTypes=["cell","line"],this.backTab=!1,this.events=super.Events().concat([["focusin",this.FocusIn.bind(this)],["focusout",this.FocusOut.bind(this)],["keydown",this.KeyDown.bind(this)],["mousedown",this.MouseDown.bind(this)],["click",this.Click.bind(this)],["dblclick",this.DblClick.bind(this)]]),this.subtrees=null,this.cacheParts=new Map}findStartNode(){let t=this.refocus||this.current;return!t&&this.restarted&&(t=this.node.querySelector(this.restarted)),this.refocus=this.restarted=null,t}Start(){const t=Object.create(null,{Start:{get:()=>super.Start}});return Ff(this,void 0,void 0,function*(){if(this.subtrees||(this.subtrees=new Map,this.getSubtrees()),!this.attached||this.active)return;if(this.document.activeItem=this.item,this.item.state()<vi.ATTACHSPEECH&&(this.item.attachSpeech(this.document),yield this.generators.promise),this.focusSpeech)return;this.node.classList.add("mjx-explorer-active"),this.document.options.enableExplorerHelp&&this.node.append(this.document.infoIcon);const e=this.findStartNode();this.setCurrent(e||this.rootNode(),!e),t.Start.call(this);const s=this.document.options,i=s.a11y;i.subtitles&&i.speech&&s.enableSpeech&&this.region.Show(this.node),i.viewBraille&&i.braille&&s.enableBraille&&this.brailleRegion.Show(this.node),i.keyMagnifier&&this.magnifyRegion.Show(this.current),this.Update()})}Stop(){this.active&&(this.node.classList.remove("mjx-explorer-active"),this.document.options.enableExplorerHelp&&this.document.infoIcon.remove(),this.pool.unhighlight(),this.magnifyRegion.Hide(),this.region.Hide(),this.brailleRegion.Hide()),super.Stop()}Update(){this.active&&(this.region.node=this.node,(this.document.options.enableSpeech||this.document.options.enableBraille)&&this.generators.updateRegions(this.speech||this.node,this.region,this.brailleRegion),this.magnifyRegion.Update(this.current))}get tabIndex(){return this.document.options.a11y.inTabOrder?"0":"-1"}Attach(){this.attached||(super.Attach(),this.node.setAttribute("tabindex",this.tabIndex),this.attached=!0)}Detach(){var t;super.RemoveEvents(),this.node.removeAttribute("role"),this.node.removeAttribute("aria-roledescription"),this.node.removeAttribute("aria-label"),null===(t=this.img)||void 0===t||t.remove(),this.active&&this.node.setAttribute("tabindex",this.tabIndex),this.attached=!1}NoMove(){Ef()}AddEvents(){this.eventsAttached||(super.AddEvents(),this.addHtmlEvents(),this.eventsAttached=!0)}addHtmlEvents(){for(const t of Array.from(this.node.querySelectorAll("mjx-html"))){const e=e=>{t.contains(document.activeElement)&&(e instanceof KeyboardEvent?(this.clicked=null,"Tab"!==e.key&&"Escape"!==e.key&&e.stopPropagation()):this.clicked=e.target)};t.addEventListener("mousedown",e),t.addEventListener("click",e),t.addEventListener("keydown",e),t.addEventListener("dblclick",e)}}actionable(t){const e=null==t?void 0:t.parentNode;return e&&this.highlighter.isMactionNode(e)?e:null}triggerLinkKeyboard(t){return this.current?this.triggerLink(this.current):t.target instanceof HTMLAnchorElement&&(t.target.dispatchEvent(new MouseEvent("click")),!0)}triggerLink(t){if(this.isLink(t)){const e=this.getAnchor(t);return e.classList.add("mjx-visited"),setTimeout(()=>this.FocusOut(null),50),window.location.href=e.getAttribute("data-mjx-href"),!0}return!1}triggerLinkMouse(){const t=this.parentLink(this.refocus);return!!this.triggerLink(t)}semanticFocus(){const t=[];let e="data-semantic-id",s=this.current||this.refocus||this.node;const i=this.actionable(s);i&&(e=i.hasAttribute("data-maction-id")?"data-maction-id":"id",s=i,t.push(Wf));const n=s.getAttribute(e);return n&&t.unshift(`[${e}="${n}"]`),t.join(" ")}getSubtrees(){const t=this.node.querySelector("[data-semantic-structure]");if(!t)return;const e=t.getAttribute("data-semantic-structure");const s=function(t){const e=[[]];for(const s of t)if("("===s){const t=[];e[e.length-1].push(t),e.push(t)}else")"===s?e.pop():e[e.length-1].push(s);return e[0][0]}(e.replace(/\(/g," ( ").replace(/\)/g," ) ").trim().split(/\s+/));zf(s,this.subtrees)}}function zf(t,e){if("string"==typeof t)return e.has(t)||e.set(t,new Set),new Set;const[s,...i]=t,n=s,r=new Set;for(const t of i){const s="string"==typeof t?t:t[0],i=zf(t,e);r.add(s),i.forEach(t=>r.add(t))}return e.set(n,r),r}Xf.helpData=new Map([["MacOS",["on MacOS and iOS using VoiceOver",", or the VoiceOver arrow keys to select an expression",""]],["Windows",["in Windows using NVDA or JAWS",". The screen reader should enter focus or forms mode automatically\n when the expression gets the browser focus, but if not, you can toggle\n focus mode using NVDA+space in NVDA; for JAWS, Enter should start\n forms mode while Numpad Plus leaves it. Also note that you can use\n the NVDA or JAWS key plus the arrow keys to explore the expression\n even in browse mode, and you can use NVDA+shift+arrow keys to\n navigate out of an expression that has the focus in NVDA","NVDA users need to select this option, while JAWS users should be able\n to get Braille output without changing this setting."]],["Unix",["in Unix using Orca",", and Orca should enter focus mode automatically. If not, use the\n Orca+a key to toggle focus mode on or off. Also note that you can use\n Orca+arrow keys to explore expressions even in browse mode",""]],["unknown",["with a Screen Reader.","",""]]]),Xf.keyMap=new Map([["Tab",[(t,e)=>t.tabKey(e)]],["Escape",[(t,e)=>t.escapeKey(e)]],["Enter",[(t,e)=>t.enterKey(e)]],["Home",[t=>t.homeKey()]],["ArrowDown",[(t,e)=>t.moveDown(e.shiftKey),!0]],["ArrowUp",[(t,e)=>t.moveUp(e.shiftKey),!0]],["ArrowLeft",[(t,e)=>t.moveLeft(e.shiftKey),!0]],["ArrowRight",[(t,e)=>t.moveRight(e.shiftKey),!0]],[" ",[t=>t.spaceKey()]],["h",[t=>t.hKey()]],[">",[t=>t.nextRules(),!1]],["<",[t=>t.nextStyle(),!1]],["x",[t=>t.summary(),!1]],["z",[t=>t.details(),!1]],["d",[t=>t.depth(),!1]],["v",[t=>t.addMark(),!1]],["p",[t=>t.prevMark(),!1]],["u",[t=>t.clearMarks(),!1]],["s",[t=>t.autoVoice(),!1]],["b",[t=>t.toggleBraille(),!1]],...[..."0123456789"].map(t=>[t,[e=>e.numberKey(parseInt(t)),!1]])]);class Gf extends _f{constructor(){super(...arguments),this.events=super.Events().concat([["mouseover",this.MouseOver.bind(this)],["mouseout",this.MouseOut.bind(this)]])}MouseOver(t){this.Start()}MouseOut(t){this.Stop()}}class Jf extends Gf{constructor(t,e,s,i,n,r){super(t,e,s,i),this.document=t,this.pool=e,this.region=s,this.node=i,this.nodeQuery=n,this.nodeAccess=r}MouseOut(t){this.highlighter.unhighlight(),this.region.Hide(),super.MouseOut(t)}MouseOver(t){super.MouseOver(t);const e=t.target,[s,i]=this.getNode(e);s&&(this.highlighter.unhighlight(),this.highlighter.highlight([s]),this.region.Update(i),this.region.Show(s))}getNode(t){const e=t;for(;t&&t!==this.node;){if(this.nodeQuery(t))return[t,this.nodeAccess(t)];t=t.parentNode}for(t=e;t;){if(this.nodeQuery(t))return[t,this.nodeAccess(t)];const e=t.childNodes[0];t=e&&"defs"===e.tagName?t.childNodes[1]:e}return[null,null]}}class Kf extends Jf{}class $f extends Jf{}class Yf extends Jf{constructor(t,e,s,i){super(t,e,new Mf(t),i,t=>this.highlighter.isMactionNode(t),()=>{}),this.document=t,this.pool=e,this.node=i}}class Qf extends _f{constructor(t,e,s,i,n){super(t,e,null,i),this.document=t,this.pool=e,this.region=s,this.node=i,this.mml=n,this.stoppable=!1}Attach(){super.Attach(),this.Start()}Detach(){this.Stop(),super.Detach()}}class Zf extends Qf{Start(){this.active||(this.active=!0,this.highlighter.highlightAll(this.node))}Stop(){this.active&&this.highlighter.unhighlightAll(),this.active=!1}}class tg extends Qf{constructor(){super(...arguments),this.contrast=new eg,this.leaves=[],this.modality="data-semantic-foreground"}Start(){this.active||(this.active=!0,this.node.hasAttribute("hasforegroundcolor")||(this.colorLeaves(),this.node.setAttribute("hasforegroundcolor","true")),this.leaves.forEach(t=>this.colorize(t)))}Stop(){this.active&&this.leaves.forEach(t=>this.uncolorize(t)),this.active=!1}colorLeaves(){this.leaves=Array.from(this.node.querySelectorAll("[data-semantic-id]:not([data-semantic-children])"));for(const t of this.leaves)t.setAttribute(this.modality,this.contrast.generate()),this.contrast.increment()}colorize(t){t.hasAttribute(this.modality)&&(t.setAttribute(this.modality+"-old",t.style.color),t.style.color=t.getAttribute(this.modality))}uncolorize(t){const e=this.modality+"-old";t.hasAttribute(e)&&(t.style.color=t.getAttribute(e))}}class eg{constructor(){this.hue=10,this.sat=100,this.light=50,this.incr=53}generate(){return eg.hsl2rgb(this.hue,this.sat,this.light)}increment(){this.hue=(this.hue+this.incr)%360}static hsl2rgb(t,e,s){e=e>1?e/100:e,s=s>1?s/100:s;const i=(1-Math.abs(2*s-1))*e,n=i*(1-Math.abs(t/60%2-1)),r=s-i/2;let o=0,a=0,l=0;return 0<=t&&t<60?[o,a,l]=[i,n,0]:60<=t&&t<120?[o,a,l]=[n,i,0]:120<=t&&t<180?[o,a,l]=[0,i,n]:180<=t&&t<240?[o,a,l]=[0,n,i]:240<=t&&t<300?[o,a,l]=[n,0,i]:300<=t&&t<360&&([o,a,l]=[i,0,n]),`rgb(${255*(o+r)}, ${255*(a+r)}, ${255*(l+r)})`}}const sg={color:"blue",alpha:.2},ig={color:"black",alpha:1},ng={ENCLOSED:"data-sre-enclosed",BBOX:"data-sre-highlighter-bbox",ADDED:"data-sre-highlighter-added"};class rg{constructor(t){this.currentHighlights=[],this.priority=t,this.ATTR="data-sre-highlight-"+t}highlight(t){this.currentHighlights.push(t);for(const e of t)this.highlightNode(e),this.setHighlighted(e)}highlightAll(t){const e=this.getMactionNodes(t);for(const t of e)this.highlight([t])}unhighlight(){const t=this.currentHighlights.pop();t&&t.forEach(t=>{this.isHighlighted(t)&&(this.unhighlightNode(t),this.unsetHighlighted(t))})}unhighlightAll(){for(;this.currentHighlights.length>0;)this.unhighlight()}encloseNodes(t,e){if(1===t.length)return t;const s=this.constructor,i=s.lineSelector,n=s.lineAttr,r=new Map;for(const e of t){const t=e.closest(i),s=t?t.getAttribute(n):"";r.has(s)||r.set(s,[]),r.get(s).push(e)}for(const s of r.values())if(s.length>1){let[i,n,r,o]=[1/0,1/0,-1/0,-1/0];for(const t of s){t.setAttribute(ng.ENCLOSED,"true");const{left:e,top:s,right:a,bottom:l}=t.getBoundingClientRect();s===l&&e===a||(e<i&&(i=e),s<n&&(n=s),l>o&&(o=l),a>r&&(r=a))}const a=this.createEnclosure(i,o,r-i,o-n,e,s[0]);t.push(a)}return t}setColorCSS(t,e,s){var i,n;const r=null!==(i=e.color)&&void 0!==i?i:s.color,o=null!==(n=e.alpha)&&void 0!==n?n:s.alpha;Pf.setColor(t,this.priority,r,o)}setColor(t,e){this.setColorCSS("fg",e,ig),this.setColorCSS("bg",t,sg)}isHighlighted(t){return t.hasAttribute(this.ATTR)}setHighlighted(t){t.setAttribute(this.ATTR,"true")}unsetHighlighted(t){t.removeAttribute(this.ATTR),t.removeAttribute(ng.ENCLOSED)}}class og extends rg{highlightNode(t){if(this.isHighlighted(t)||"svg"===t.tagName||"MJX-CONTAINER"===t.tagName||t.hasAttribute(ng.BBOX)||t.hasAttribute(ng.ENCLOSED))return;const{x:e,y:s,width:i,height:n}=t.getBBox(),r=this.createRect(e,s,i,n,t.getAttribute("transform"));this.setHighlighted(r),t.parentNode.insertBefore(r,t)}unhighlightNode(t){if(t.hasAttribute(ng.BBOX))return void t.remove();const e=t.previousSibling;(null==e?void 0:e.hasAttribute(ng.ADDED))&&e.remove()}createEnclosure(t,e,s,i,n,r){const[o,a]=this.screen2svg(t,e,r),[l,h]=this.screen2svg(t+s,e-i,r),c=this.createRect(o,a,l-o,h-a,r.getAttribute("transform"));return c.setAttribute(ng.BBOX,"true"),r.parentNode.insertBefore(c,r),c}screen2svg(t,e,s){const i=s,n=DOMPoint.fromPoint({x:t,y:e}).matrixTransform(i.getScreenCTM().inverse());return[n.x,n.y]}createRect(t,e,s,i,n){const r=document.createElementNS("http://www.w3.org/2000/svg","rect");return r.setAttribute(ng.ADDED,"true"),r.setAttribute("x",String(t-40)),r.setAttribute("y",String(e-40)),r.setAttribute("width",String(s+80)),r.setAttribute("height",String(i+80)),n&&r.setAttribute("transform",n),r}isMactionNode(t){return"maction"===t.getAttribute("data-mml-node")}getMactionNodes(t){return Array.from(t.querySelectorAll('[data-mml-node="maction"]'))}}og.lineSelector="[data-mjx-linebox]",og.lineAttr="data-mjx-lineno";class ag extends rg{highlightNode(t){}unhighlightNode(t){"mjx-bbox"===t.tagName.toLowerCase()&&t.remove()}createEnclosure(t,e,s,i,n){const r=n.getBoundingClientRect(),o=document.createElement("mjx-bbox");return o.style.width=s+"px",o.style.height=i+"px",o.style.left=t-r.left+"px",o.style.top=e-i-r.top+"px",o.style.position="absolute",n.prepend(o),o}isMactionNode(t){var e;return"mjx-maction"===(null===(e=t.tagName)||void 0===e?void 0:e.toLowerCase())}getMactionNodes(t){return Array.from(t.querySelectorAll("mjx-maction"))}}function lg(t,e,s,i){const n=new hg[i](t);return n.setColor(e,s),n}ag.lineSelector="mjx-linebox",ag.lineAttr="lineno";const hg={SVG:og,CHTML:ag,generic:ag};class cg{constructor(t){this.document=t,this.speechRegion=new Bf(this.document),this.brailleRegion=new Pf(this.document),this.magnifier=new jf(this.document),this.tooltip1=new kf(this.document),this.tooltip2=new kf(this.document),this.tooltip3=new kf(this.document)}}const dg={speech:(t,e,s,...i)=>{const n=Xf.create(t,e,t.explorerRegions.speechRegion,s,t.explorerRegions.brailleRegion,t.explorerRegions.magnifier,i[0],i[1]);return n.sound=!0,n},mouseMagnifier:(t,e,s,...i)=>$f.create(t,e,t.explorerRegions.magnifier,s,t=>t.hasAttribute("data-semantic-type"),t=>t),hover:(t,e,s,...i)=>Yf.create(t,e,null,s),infoType:(t,e,s,...i)=>Kf.create(t,e,t.explorerRegions.tooltip1,s,t=>t.hasAttribute("data-semantic-type"),t=>t.getAttribute("data-semantic-type")),infoRole:(t,e,s,...i)=>Kf.create(t,e,t.explorerRegions.tooltip2,s,t=>t.hasAttribute("data-semantic-role"),t=>t.getAttribute("data-semantic-role")),infoPrefix:(t,e,s,...i)=>Kf.create(t,e,t.explorerRegions.tooltip3,s,t=>{var e;return null===(e=t.hasAttribute)||void 0===e?void 0:e.call(t,"data-semantic-prefix-none")},t=>{var e;return null===(e=t.getAttribute)||void 0===e?void 0:e.call(t,"data-semantic-prefix-none")}),flame:(t,e,s,...i)=>Zf.create(t,e,null,s),treeColoring:(t,e,s,...i)=>tg.create(t,e,null,s,...i)};class ug{constructor(){this.explorers={},this.attached=[],this._restart=[],this.speechExplorerKeys=["speech","braille","keyMagnifier"]}get highlighter(){if(this._renderer!==this.document.outputJax.name)return this._renderer=this.document.outputJax.name,this.setPrimaryHighlighter(),this._highlighter;const[t,e]=this.colorOptions();return this._highlighter.setColor(e,t),this._highlighter}init(t,e,s,i){this.document=t,this.mml=s,this.node=e,this.setPrimaryHighlighter();for(const t of Object.keys(dg))this.explorers[t]=dg[t](this.document,this,this.node,this.mml,i);this.setSecondaryHighlighter(),this.attach()}attach(){this.attached=[];const t=[],e=this.document.options.a11y;for(const[s,i]of Object.entries(this.explorers))i instanceof Xf?(i.stoppable=!1,t.unshift(i),this.speechExplorerKeys.some(t=>this.document.options.a11y[t])?(i.Attach(),this.attached.push(s)):i.Detach()):e[s]||"speech"===s&&(e.braille||e.keyMagnifier)?(i.Attach(),this.attached.push(s)):i.Detach();for(const e of t)if(e.attached){e.stoppable=!0;break}}reattach(){for(const t of this.attached){const e=this.explorers[t];e.active&&(this._restart.push(t),e.Stop())}}restart(){this._restart.forEach(t=>{this.explorers[t].Start()}),this._restart=[]}setPrimaryHighlighter(){const[t,e]=this.colorOptions();this._highlighter=lg(Pf.priority.primary,e,t,this.document.outputJax.name)}setSecondaryHighlighter(){this.secondaryHighlighter=lg(Pf.priority.secondary,{color:"red",alpha:.8},{color:"black"},this.document.outputJax.name),this.speech.region.highlighter=this.secondaryHighlighter}highlight(t){this.highlighter.highlight(t)}unhighlight(){this.secondaryHighlighter.unhighlight(),this.highlighter.unhighlight()}get speech(){return this.explorers.speech}colorOptions(){const t=this.document.options.a11y;return[{color:t.foregroundColor.toLowerCase(),alpha:t.foregroundOpacity/100},{color:t.backgroundColor.toLowerCase(),alpha:t.backgroundOpacity/100}]}}const pg="Unix"===As.os;function mg(t,e){var s;return s=class extends t{constructor(){super(...arguments),this.refocus=null}get ariaRole(){return this.constructor.ariaRole}get roleDescription(){const t=this.constructor;return"none"===t.roleDescription?t.none:t.roleDescription}get none(){return this.constructor.none}get brailleNone(){return this.constructor.brailleNone}attachSpeech(t){var e,s;super.attachSpeech(t),null===(s=null===(e=this.outputData.speechPromise)||void 0===e?void 0:e.then(()=>this.explorers.speech.attachSpeech()))||void 0===s||s.then(()=>{var t;(null===(t=this.explorers)||void 0===t?void 0:t.speech)&&(this.explorers.speech.restarted=this.refocus),this.refocus=null,this.explorers&&this.explorers.restart()})}detachSpeech(t){super.detachSpeech(t),this.explorers.speech.detachSpeech()}explorable(t,s=!1){if(!(this.state()>=vi.EXPLORER)){if(!this.isEscaped&&(t.options.enableExplorer||s)){const s=this.typesetRoot,i=e(this.root);this.explorers||(this.explorers=new ug),this.explorers.init(t,s,i,this)}this.state(vi.EXPLORER)}}state(t=null,e=!1){if(t<vi.EXPLORER&&this.explorers)for(const t of Object.values(this.explorers.explorers))t.active&&t.Stop();return super.state(t,e)}rerender(t,e=vi.RERENDER){const s=this.setTemporaryFocus(t);super.rerender(t,e),this.clearTemporaryFocus(s)}setTemporaryFocus(t){var e;let s=null;if(this.explorers){const i=this.explorers.speech;if(s=(null==i?void 0:i.attached)?t.tmpFocus:null,s){this.refocus=null!==(e=i.semanticFocus())&&void 0!==e?e:null;const n=t.adaptor;n.append(n.body(),s)}this.explorers.reattach(),null==s||s.focus()}return s}clearTemporaryFocus(t){var e;if(t){(null!==(e=this.outputData.speechPromise)&&void 0!==e?e:Promise.resolve()).then(()=>setTimeout(()=>t.remove(),100))}}},s.ariaRole=pg?"tree":"application",s.roleDescription="math",s.none="\x91",s.brailleNone="\u2800",s}function fg(t){var e;return e=class extends t{constructor(...t){super(...t),this.explorerRegions=null,this.activeItem=null;const e=this.constructor.ProcessBits;e.has("explorer")||e.allocate("explorer");const s=new pr(this.mmlFactory),i=this.options;i.a11y.speechRules||(i.a11y.speechRules=`${i.sre.domain}-${i.sre.style}`);const n=i.MathItem=mg(i.MathItem,t=>s.visitTree(t));n.roleDescription=i.roleDescription,this.explorerRegions=new cg(this),"addStyles"in this&&this.addStyles(this.constructor.speechStyles);const r=this.adaptor,o="http://www.w3.org/2000/svg";this.infoIcon=r.node("mjx-help",{},[r.node("svg",{viewBox:"0 0 18 18",xmlns:o,"aria-hidden":"true"},[r.node("circle",{stroke:"none"},[],o),r.node("circle",{},[],o),r.node("line",{x1:9,y1:9,x2:9,y2:13},[],o),r.node("line",{x1:9,y1:5.5,x2:9,y2:5.5},[],o)],o)]),this.tmpFocus=r.node("mjx-focus",{tabIndex:0,style:{outline:"none",display:"block",position:"absolute",top:0,left:"-10px",width:"1px",height:"1px",overflow:"hidden"},role:n.ariaRole,"aria-label":n.none,"aria-roledescription":n.none})}explorable(){if(!this.processed.isSet("explorer")){if(this.options.enableExplorer)for(const t of this.math)t.explorable(this);this.processed.set("explorer")}return this}rerender(t){const e=this.activeItem,s=null==e?void 0:e.setTemporaryFocus(this);return super.rerender(t),null==e||e.clearTemporaryFocus(s),this}state(t,e=!1){return super.state(t,e),t<vi.EXPLORER&&this.processed.clear("explorer"),this}},e.OPTIONS=Object.assign(Object.assign({},t.OPTIONS),{enableExplorer:Is,enableExplorerHelp:!0,renderActions:Gs(Object.assign(Object.assign({},t.OPTIONS.renderActions),{explorable:[vi.EXPLORER]})),sre:Gs(Object.assign(Object.assign({},t.OPTIONS.sre),{speech:"none"})),a11y:Object.assign(Object.assign({},t.OPTIONS.a11y),{align:"top",backgroundColor:"Blue",backgroundOpacity:20,flame:!1,foregroundColor:"Black",foregroundOpacity:100,highlight:"None",hover:!1,infoPrefix:!1,infoRole:!1,infoType:!1,keyMagnifier:!1,magnification:"None",magnify:"400%",mouseMagnifier:!1,subtitles:!1,treeColoring:!1,viewBraille:!1,voicing:!1,brailleSpeech:!1,brailleCombine:!1,help:!0,roleDescription:"math",inTabOrder:!0,tabSelects:"all"})}),e.speechStyles={'mjx-container[has-speech="true"]':{position:"relative",cursor:"default"},"mjx-speech":{position:"absolute","z-index":-1,left:0,top:0,bottom:0,right:0},"mjx-speech:focus":{outline:"none"},"mjx-container .mjx-selected":{outline:"2px solid black"},"mjx-container a[data-mjx-href]":{color:"LinkText",cursor:"pointer"},"mjx-container a[data-mjx-href].mjx-visited":{color:"VisitedText"},"mjx-container > mjx-help":{display:"none",position:"absolute",top:"-.3em",right:"-.5em",width:".6em",height:".6em",cursor:"pointer"},'mjx-container[display="true"] > mjx-help':{position:"sticky",inset:"-100% 0 100% 0",margin:"-.3em -.5em 0 -.1em",right:0,top:"initial"},"mjx-help > svg":{stroke:"black",width:"100%",height:"100%"},"mjx-help > svg > circle":{"stroke-width":"1.5px",cx:"9px",cy:"9px",r:"9px",fill:"white"},"mjx-help > svg > circle:nth-child(2)":{fill:"var(--mjx-bg1-color)",r:"7px"},"mjx-help > svg > line":{"stroke-width":"2.5px","stroke-linecap":"round"},"mjx-help:hover > svg > circle:nth-child(2)":{fill:"white"},"mjx-container.mjx-explorer-active > mjx-help":{display:"inline-flex","align-items":"center"},"@media (prefers-color-scheme: dark) /* explorer */":{"mjx-help > svg":{stroke:"#E0E0E0"},"mjx-help > svg > circle":{fill:"#404040"},"mjx-help > svg > circle:nth-child(2)":{fill:"rgba(132, 132, 255, .3)"},"mjx-help:hover > svg > circle:nth-child(2)":{stroke:"#AAAAAA",fill:"#404040"}}},e}function gg(t,e=null){return t.documentClass.prototype.attachSpeech||(t=wf(t,e)),t.documentClass=fg(t.documentClass),t}function bg(t,e){var s;const i=Cm();for(const s in e)void 0!==t.options.a11y[s]?Eg(t,s,e[s]):void 0!==i[s]&&(t.options.sre[s]=e[s]);e.roleDescription&&(t.options.MathItem.roleDescription=e.roleDescription);for(const e of t.math)null===(s=null==e?void 0:e.explorers)||void 0===s||s.attach()}function Eg(t,e,s){switch(e){case"speechRules":{const[e,i]=s.split("-");t.options.sre.domain=e,t.options.sre.style=i;break}case"magnification":switch(s){case"None":t.options.a11y.magnification=s,t.options.a11y.keyMagnifier=!1,t.options.a11y.mouseMagnifier=!1;break;case"Keyboard":t.options.a11y.magnification=s,t.options.a11y.keyMagnifier=!0,t.options.a11y.mouseMagnifier=!1;break;case"Mouse":t.options.a11y.magnification=s,t.options.a11y.keyMagnifier=!1,t.options.a11y.mouseMagnifier=!0}break;case"highlight":switch(s){case"None":t.options.a11y.highlight=s,t.options.a11y.hover=!1,t.options.a11y.flame=!1;break;case"Hover":t.options.a11y.highlight=s,t.options.a11y.hover=!0,t.options.a11y.flame=!1;break;case"Flame":t.options.a11y.highlight=s,t.options.a11y.hover=!1,t.options.a11y.flame=!0}break;case"locale":t.options.sre.locale=s;break;default:t.options.a11y[e]=s}}Li("EXPLORER",vi.INSERTED+30),MathJax.loader&&MathJax.loader.checkVersion("a11y/explorer",xs,"a11y"),Cs({_:{a11y:{explorer_ts:Es,explorer:{Explorer:us,ExplorerPool:bs,Highlighter:gs,KeyExplorer:ps,MouseExplorer:ms,Region:ds,TreeExplorer:fs}}}}),MathJax.startup&&Is&&MathJax.startup.extendHandler(t=>gg(t)),_s.preLoaded("a11y/sre","a11y/semantic-enrich","a11y/speech","a11y/explorer","input/mml"),_s.preLoaded("loader","startup","core","input/mml","output/chtml","ui/menu"),_s.saveVersion("mml-chtml-nofont"),function(t,e){Hl.loadFont(t,"chtml",Bl,e)}(function(t){return _s.load(...Us.load).then(()=>(t||function(){})()).then(()=>Us.ready()).catch(t=>Us.failed(t))})})()})();