UNPKG

mathjax

Version:

Beautiful and accessible math in all browsers. MathJax is an open-source JavaScript display engine for LaTeX, MathML, and AsciiMath notation that works in all browsers. This package includes the packaged components (install mathjax-full to get the source

1 lines 1.59 MB
!function(){"use strict";var Q={351:function(Q,t,T){var e,r=this&&this.__extends||(e=function(Q,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Q,t){Q.__proto__=t}||function(Q,t){for(var T in t)Object.prototype.hasOwnProperty.call(t,T)&&(Q[T]=t[T])})(Q,t)},function(Q,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function T(){this.constructor=Q}e(Q,t),Q.prototype=null===t?Object.create(t):(T.prototype=t.prototype,new T)}),n=this&&this.__assign||function(){return(n=Object.assign||function(Q){for(var t,T=1,e=arguments.length;T<e;T++)for(var r in t=arguments[T])Object.prototype.hasOwnProperty.call(t,r)&&(Q[r]=t[r]);return Q}).apply(this,arguments)},o=this&&this.__read||function(Q,t){var T="function"==typeof Symbol&&Q[Symbol.iterator];if(!T)return Q;var e,r,n=T.call(Q),o=[];try{for(;(void 0===t||t-- >0)&&!(e=n.next()).done;)o.push(e.value)}catch(Q){r={error:Q}}finally{try{e&&!e.done&&(T=n.return)&&T.call(n)}finally{if(r)throw r.error}}return o},i=this&&this.__spreadArray||function(Q,t){for(var T=0,e=t.length,r=Q.length;T<e;T++,r++)Q[r]=t[T];return Q},s=this&&this.__values||function(Q){var t="function"==typeof Symbol&&Symbol.iterator,T=t&&Q[t],e=0;if(T)return T.call(Q);if(Q&&"number"==typeof Q.length)return{next:function(){return Q&&e>=Q.length&&(Q=void 0),{value:Q&&Q[e++],done:!Q}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.AssistiveMmlHandler=t.AssistiveMmlMathDocumentMixin=t.AssistiveMmlMathItemMixin=t.LimitedMmlVisitor=void 0;var a=T(4474),l=T(9259),c=T(7233),u=function(Q){function t(){return null!==Q&&Q.apply(this,arguments)||this}return r(t,Q),t.prototype.getAttributes=function(t){return Q.prototype.getAttributes.call(this,t).replace(/ ?id=".*?"/,"")},t}(l.SerializedMmlVisitor);function L(Q){return function(Q){function t(){return null!==Q&&Q.apply(this,arguments)||this}return r(t,Q),t.prototype.assistiveMml=function(Q,t){if(void 0===t&&(t=!1),!(this.state()>=a.STATE.ASSISTIVEMML)){if(!this.isEscaped&&(Q.options.enableAssistiveMml||t)){var T=Q.adaptor,e=Q.toMML(this.root).replace(/\n */g,"").replace(/<!--.*?-->/g,""),r=T.firstChild(T.body(T.parse(e,"text/html"))),n=T.node("mjx-assistive-mml",{unselectable:"on",display:this.display?"block":"inline"},[r]);T.setAttribute(T.firstChild(this.typesetRoot),"aria-hidden","true"),T.setStyle(this.typesetRoot,"position","relative"),T.append(this.typesetRoot,n)}this.state(a.STATE.ASSISTIVEMML)}},t}(Q)}function p(Q){var t;return(t=function(Q){function t(){for(var t=[],T=0;T<arguments.length;T++)t[T]=arguments[T];var e=Q.apply(this,i([],o(t)))||this,r=e.constructor,n=r.ProcessBits;return n.has("assistive-mml")||n.allocate("assistive-mml"),e.visitor=new u(e.mmlFactory),e.options.MathItem=L(e.options.MathItem),"addStyles"in e&&e.addStyles(r.assistiveStyles),e}return r(t,Q),t.prototype.toMML=function(Q){return this.visitor.visitTree(Q)},t.prototype.assistiveMml=function(){var Q,t;if(!this.processed.isSet("assistive-mml")){try{for(var T=s(this.math),e=T.next();!e.done;e=T.next()){e.value.assistiveMml(this)}}catch(t){Q={error:t}}finally{try{e&&!e.done&&(t=T.return)&&t.call(T)}finally{if(Q)throw Q.error}}this.processed.set("assistive-mml")}return this},t.prototype.state=function(t,T){return void 0===T&&(T=!1),Q.prototype.state.call(this,t,T),t<a.STATE.ASSISTIVEMML&&this.processed.clear("assistive-mml"),this},t}(Q)).OPTIONS=n(n({},Q.OPTIONS),{enableAssistiveMml:!0,renderActions:c.expandable(n(n({},Q.OPTIONS.renderActions),{assistiveMml:[a.STATE.ASSISTIVEMML]}))}),t.assistiveStyles={"mjx-assistive-mml":{position:"absolute !important",top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)",padding:"1px 0px 0px 0px !important",border:"0px !important",display:"block !important",width:"auto !important",overflow:"hidden !important","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"},'mjx-assistive-mml[display="block"]':{width:"100% !important"}},t}t.LimitedMmlVisitor=u,a.newState("ASSISTIVEMML",153),t.AssistiveMmlMathItemMixin=L,t.AssistiveMmlMathDocumentMixin=p,t.AssistiveMmlHandler=function(Q){return Q.documentClass=p(Q.documentClass),Q}},444:function(Q,t,T){var e,r=this&&this.__extends||(e=function(Q,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Q,t){Q.__proto__=t}||function(Q,t){for(var T in t)Object.prototype.hasOwnProperty.call(t,T)&&(Q[T]=t[T])})(Q,t)},function(Q,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function T(){this.constructor=Q}e(Q,t),Q.prototype=null===t?Object.create(t):(T.prototype=t.prototype,new T)}),n=this&&this.__values||function(Q){var t="function"==typeof Symbol&&Symbol.iterator,T=t&&Q[t],e=0;if(T)return T.call(Q);if(Q&&"number"==typeof Q.length)return{next:function(){return Q&&e>=Q.length&&(Q=void 0),{value:Q&&Q[e++],done:!Q}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLAdaptor=void 0;var o=function(Q){function t(t){var T=Q.call(this,t.document)||this;return T.window=t,T.parser=new t.DOMParser,T}return r(t,Q),t.prototype.parse=function(Q,t){return void 0===t&&(t="text/html"),this.parser.parseFromString(Q,t)},t.prototype.create=function(Q,t){return t?this.document.createElementNS(t,Q):this.document.createElement(Q)},t.prototype.text=function(Q){return this.document.createTextNode(Q)},t.prototype.head=function(Q){return Q.head},t.prototype.body=function(Q){return Q.body},t.prototype.root=function(Q){return Q.documentElement},t.prototype.doctype=function(Q){return Q.doctype?"<!DOCTYPE "+Q.doctype.name+">":""},t.prototype.tags=function(Q,t,T){void 0===T&&(T=null);var e=T?Q.getElementsByTagNameNS(T,t):Q.getElementsByTagName(t);return Array.from(e)},t.prototype.getElements=function(Q,t){var T,e,r=[];try{for(var o=n(Q),i=o.next();!i.done;i=o.next()){var s=i.value;"string"==typeof s?r=r.concat(Array.from(this.document.querySelectorAll(s))):Array.isArray(s)||s instanceof this.window.NodeList||s instanceof this.window.HTMLCollection?r=r.concat(Array.from(s)):r.push(s)}}catch(Q){T={error:Q}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(T)throw T.error}}return r},t.prototype.contains=function(Q,t){return Q.contains(t)},t.prototype.parent=function(Q){return Q.parentNode},t.prototype.append=function(Q,t){return Q.appendChild(t)},t.prototype.insert=function(Q,t){return this.parent(t).insertBefore(Q,t)},t.prototype.remove=function(Q){return this.parent(Q).removeChild(Q)},t.prototype.replace=function(Q,t){return this.parent(t).replaceChild(Q,t)},t.prototype.clone=function(Q){return Q.cloneNode(!0)},t.prototype.split=function(Q,t){return Q.splitText(t)},t.prototype.next=function(Q){return Q.nextSibling},t.prototype.previous=function(Q){return Q.previousSibling},t.prototype.firstChild=function(Q){return Q.firstChild},t.prototype.lastChild=function(Q){return Q.lastChild},t.prototype.childNodes=function(Q){return Array.from(Q.childNodes)},t.prototype.childNode=function(Q,t){return Q.childNodes[t]},t.prototype.kind=function(Q){var t=Q.nodeType;return 1===t||3===t||8===t?Q.nodeName.toLowerCase():""},t.prototype.value=function(Q){return Q.nodeValue||""},t.prototype.textContent=function(Q){return Q.textContent},t.prototype.innerHTML=function(Q){return Q.innerHTML},t.prototype.outerHTML=function(Q){return Q.outerHTML},t.prototype.serializeXML=function(Q){return(new this.window.XMLSerializer).serializeToString(Q)},t.prototype.setAttribute=function(Q,t,T,e){return void 0===e&&(e=null),e?(t=e.replace(/.*\//,"")+":"+t.replace(/^.*:/,""),Q.setAttributeNS(e,t,T)):Q.setAttribute(t,T)},t.prototype.getAttribute=function(Q,t){return Q.getAttribute(t)},t.prototype.removeAttribute=function(Q,t){return Q.removeAttribute(t)},t.prototype.hasAttribute=function(Q,t){return Q.hasAttribute(t)},t.prototype.allAttributes=function(Q){return Array.from(Q.attributes).map((function(Q){return{name:Q.name,value:Q.value}}))},t.prototype.addClass=function(Q,t){Q.classList?Q.classList.add(t):Q.className=(Q.className+" "+t).trim()},t.prototype.removeClass=function(Q,t){Q.classList?Q.classList.remove(t):Q.className=Q.className.split(/ /).filter((function(Q){return Q!==t})).join(" ")},t.prototype.hasClass=function(Q,t){return Q.classList?Q.classList.contains(t):Q.className.split(/ /).indexOf(t)>=0},t.prototype.setStyle=function(Q,t,T){Q.style[t]=T},t.prototype.getStyle=function(Q,t){return Q.style[t]},t.prototype.allStyles=function(Q){return Q.style.cssText},t.prototype.insertRules=function(Q,t){var T,e;try{for(var r=n(t.reverse()),o=r.next();!o.done;o=r.next()){var i=o.value;try{Q.sheet.insertRule(i,0)}catch(Q){console.warn("MathJax: can't insert css rule '"+i+"': "+Q.message)}}}catch(Q){T={error:Q}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(T)throw T.error}}},t.prototype.fontSize=function(Q){var t=this.window.getComputedStyle(Q);return parseFloat(t.fontSize)},t.prototype.fontFamily=function(Q){return this.window.getComputedStyle(Q).fontFamily||""},t.prototype.nodeSize=function(Q,t,T){if(void 0===t&&(t=1),void 0===T&&(T=!1),T&&Q.getBBox){var e=Q.getBBox();return[e.width/t,e.height/t]}return[Q.offsetWidth/t,Q.offsetHeight/t]},t.prototype.nodeBBox=function(Q){var t=Q.getBoundingClientRect();return{left:t.left,right:t.right,top:t.top,bottom:t.bottom}},t}(T(5009).AbstractDOMAdaptor);t.HTMLAdaptor=o},6191:function(Q,t,T){Object.defineProperty(t,"__esModule",{value:!0}),t.browserAdaptor=void 0;var e=T(444);t.browserAdaptor=function(){return new e.HTMLAdaptor(window)}},9515:function(Q,t,T){var e=this&&this.__values||function(Q){var t="function"==typeof Symbol&&Symbol.iterator,T=t&&Q[t],e=0;if(T)return T.call(Q);if(Q&&"number"==typeof Q.length)return{next:function(){return Q&&e>=Q.length&&(Q=void 0),{value:Q&&Q[e++],done:!Q}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};function r(Q){return"object"==typeof Q&&null!==Q}function n(Q,t){var T,o;try{for(var i=e(Object.keys(t)),s=i.next();!s.done;s=i.next()){var a=s.value;"__esModule"!==a&&(!r(Q[a])||!r(t[a])||t[a]instanceof Promise?null!==t[a]&&void 0!==t[a]&&(Q[a]=t[a]):n(Q[a],t[a]))}}catch(Q){T={error:Q}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(T)throw T.error}}return Q}Object.defineProperty(t,"__esModule",{value:!0}),t.MathJax=t.combineWithMathJax=t.combineDefaults=t.combineConfig=t.isObject=void 0,t.isObject=r,t.combineConfig=n,t.combineDefaults=function Q(t,T,n){var o,i;t[T]||(t[T]={}),t=t[T];try{for(var s=e(Object.keys(n)),a=s.next();!a.done;a=s.next()){var l=a.value;r(t[l])&&r(n[l])?Q(t,l,n[l]):null==t[l]&&null!=n[l]&&(t[l]=n[l])}}catch(Q){o={error:Q}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}return t},t.combineWithMathJax=function(Q){return n(t.MathJax,Q)},void 0===T.g.MathJax&&(T.g.MathJax={}),T.g.MathJax.version||(T.g.MathJax={version:"3.2.0",_:{},config:T.g.MathJax}),t.MathJax=T.g.MathJax},235:function(Q,t,T){var e,r,n=this&&this.__values||function(Q){var t="function"==typeof Symbol&&Symbol.iterator,T=t&&Q[t],e=0;if(T)return T.call(Q);if(Q&&"number"==typeof Q.length)return{next:function(){return Q&&e>=Q.length&&(Q=void 0),{value:Q&&Q[e++],done:!Q}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.CONFIG=t.MathJax=t.Loader=t.PathFilters=t.PackageError=t.Package=void 0;var o=T(9515),i=T(265),s=T(265);Object.defineProperty(t,"Package",{enumerable:!0,get:function(){return s.Package}}),Object.defineProperty(t,"PackageError",{enumerable:!0,get:function(){return s.PackageError}});var a,l=T(7525);if(t.PathFilters={source:function(Q){return t.CONFIG.source.hasOwnProperty(Q.name)&&(Q.name=t.CONFIG.source[Q.name]),!0},normalize:function(Q){var t=Q.name;return t.match(/^(?:[a-z]+:\/)?\/|[a-z]:\\|\[/i)||(Q.name="[mathjax]/"+t.replace(/^\.\//,"")),Q.addExtension&&!t.match(/\.[^\/]+$/)&&(Q.name+=".js"),!0},prefix:function(Q){for(var T;(T=Q.name.match(/^\[([^\]]*)\]/))&&t.CONFIG.paths.hasOwnProperty(T[1]);)Q.name=t.CONFIG.paths[T[1]]+Q.name.substr(T[0].length);return!0}},function(Q){Q.ready=function(){for(var Q,t,T=[],e=0;e<arguments.length;e++)T[e]=arguments[e];0===T.length&&(T=Array.from(i.Package.packages.keys()));var r=[];try{for(var o=n(T),s=o.next();!s.done;s=o.next()){var a=s.value,l=i.Package.packages.get(a)||new i.Package(a,!0);r.push(l.promise)}}catch(t){Q={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(Q)throw Q.error}}return Promise.all(r)},Q.load=function(){for(var Q,T,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(0===e.length)return Promise.resolve();var o=[];try{for(var s=n(e),a=s.next();!a.done;a=s.next()){var l=a.value,c=i.Package.packages.get(l);c||(c=new i.Package(l)).provides(t.CONFIG.provides[l]),c.checkNoLoad(),o.push(c.promise)}}catch(t){Q={error:t}}finally{try{a&&!a.done&&(T=s.return)&&T.call(s)}finally{if(Q)throw Q.error}}return i.Package.loadAll(),Promise.all(o)},Q.preLoad=function(){for(var Q,T,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];try{for(var o=n(e),s=o.next();!s.done;s=o.next()){var a=s.value,l=i.Package.packages.get(a);l||(l=new i.Package(a,!0)).provides(t.CONFIG.provides[a]),l.loaded()}}catch(t){Q={error:t}}finally{try{s&&!s.done&&(T=o.return)&&T.call(o)}finally{if(Q)throw Q.error}}},Q.defaultReady=function(){void 0!==t.MathJax.startup&&t.MathJax.config.startup.ready()},Q.getRoot=function(){var Q="//../../es5";if("undefined"!=typeof document){var t=document.currentScript||document.getElementById("MathJax-script");t&&(Q=t.src.replace(/\/[^\/]*$/,""))}return Q},Q.pathFilters=new l.FunctionList,Q.pathFilters.add(t.PathFilters.source,0),Q.pathFilters.add(t.PathFilters.normalize,10),Q.pathFilters.add(t.PathFilters.prefix,20)}(a=t.Loader||(t.Loader={})),t.MathJax=o.MathJax,void 0===t.MathJax.loader){o.combineDefaults(t.MathJax.config,"loader",{paths:{mathjax:a.getRoot()},source:{},dependencies:{},provides:{},load:[],ready:a.defaultReady.bind(a),failed:function(Q){return console.log("MathJax("+(Q.package||"?")+"): "+Q.message)},require:null,pathFilters:[]}),o.combineWithMathJax({loader:a});try{for(var c=n(t.MathJax.config.loader.pathFilters),u=c.next();!u.done;u=c.next()){var L=u.value;Array.isArray(L)?a.pathFilters.add(L[0],L[1]):a.pathFilters.add(L)}}catch(Q){e={error:Q}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(e)throw e.error}}}t.CONFIG=t.MathJax.config.loader},265:function(Q,t,T){var e,r=this&&this.__extends||(e=function(Q,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Q,t){Q.__proto__=t}||function(Q,t){for(var T in t)Object.prototype.hasOwnProperty.call(t,T)&&(Q[T]=t[T])})(Q,t)},function(Q,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function T(){this.constructor=Q}e(Q,t),Q.prototype=null===t?Object.create(t):(T.prototype=t.prototype,new T)}),n=this&&this.__values||function(Q){var t="function"==typeof Symbol&&Symbol.iterator,T=t&&Q[t],e=0;if(T)return T.call(Q);if(Q&&"number"==typeof Q.length)return{next:function(){return Q&&e>=Q.length&&(Q=void 0),{value:Q&&Q[e++],done:!Q}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(Q,t){var T="function"==typeof Symbol&&Q[Symbol.iterator];if(!T)return Q;var e,r,n=T.call(Q),o=[];try{for(;(void 0===t||t-- >0)&&!(e=n.next()).done;)o.push(e.value)}catch(Q){r={error:Q}}finally{try{e&&!e.done&&(T=n.return)&&T.call(n)}finally{if(r)throw r.error}}return o},i=this&&this.__spreadArray||function(Q,t){for(var T=0,e=t.length,r=Q.length;T<e;T++,r++)Q[r]=t[T];return Q};Object.defineProperty(t,"__esModule",{value:!0}),t.Package=t.PackageError=void 0;var s=T(235),a=function(Q){function t(t,T){var e=Q.call(this,t)||this;return e.package=T,e}return r(t,Q),t}(Error);t.PackageError=a;var l=function(){function Q(t,T){void 0===T&&(T=!1),this.isLoaded=!1,this.isLoading=!1,this.hasFailed=!1,this.dependents=[],this.dependencies=[],this.dependencyCount=0,this.provided=[],this.name=t,this.noLoad=T,Q.packages.set(t,this),this.promise=this.makePromise(this.makeDependencies())}return Object.defineProperty(Q.prototype,"canLoad",{get:function(){return 0===this.dependencyCount&&!this.noLoad&&!this.isLoading&&!this.hasFailed},enumerable:!1,configurable:!0}),Q.resolvePath=function(Q,t){void 0===t&&(t=!0);var T={name:Q,original:Q,addExtension:t};return s.Loader.pathFilters.execute(T),T.name},Q.loadAll=function(){var Q,t;try{for(var T=n(this.packages.values()),e=T.next();!e.done;e=T.next()){var r=e.value;r.canLoad&&r.load()}}catch(t){Q={error:t}}finally{try{e&&!e.done&&(t=T.return)&&t.call(T)}finally{if(Q)throw Q.error}}},Q.prototype.makeDependencies=function(){var t,T,e=[],r=Q.packages,a=this.noLoad,l=this.name,c=[];s.CONFIG.dependencies.hasOwnProperty(l)?c.push.apply(c,i([],o(s.CONFIG.dependencies[l]))):"core"!==l&&c.push("core");try{for(var u=n(c),L=u.next();!L.done;L=u.next()){var p=L.value,h=r.get(p)||new Q(p,a);this.dependencies.indexOf(h)<0&&(h.addDependent(this,a),this.dependencies.push(h),h.isLoaded||(this.dependencyCount++,e.push(h.promise)))}}catch(Q){t={error:Q}}finally{try{L&&!L.done&&(T=u.return)&&T.call(u)}finally{if(t)throw t.error}}return e},Q.prototype.makePromise=function(Q){var t=this,T=new Promise((function(Q,T){t.resolve=Q,t.reject=T})),e=s.CONFIG[this.name]||{};return e.ready&&(T=T.then((function(Q){return e.ready(t.name)}))),Q.length&&(Q.push(T),T=Promise.all(Q).then((function(Q){return Q.join(", ")}))),e.failed&&T.catch((function(Q){return e.failed(new a(Q,t.name))})),T},Q.prototype.load=function(){if(!this.isLoaded&&!this.isLoading&&!this.noLoad){this.isLoading=!0;var t=Q.resolvePath(this.name);s.CONFIG.require?this.loadCustom(t):this.loadScript(t)}},Q.prototype.loadCustom=function(Q){var t=this;try{var T=s.CONFIG.require(Q);T instanceof Promise?T.then((function(){return t.checkLoad()})).catch((function(T){return t.failed("Can't load \""+Q+'"\n'+T.message.trim())})):this.checkLoad()}catch(Q){this.failed(Q.message)}},Q.prototype.loadScript=function(Q){var t=this,T=document.createElement("script");T.src=Q,T.charset="UTF-8",T.onload=function(Q){return t.checkLoad()},T.onerror=function(T){return t.failed("Can't load \""+Q+'"')},document.head.appendChild(T)},Q.prototype.loaded=function(){var Q,t,T,e;this.isLoaded=!0,this.isLoading=!1;try{for(var r=n(this.dependents),o=r.next();!o.done;o=r.next()){o.value.requirementSatisfied()}}catch(t){Q={error:t}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(Q)throw Q.error}}try{for(var i=n(this.provided),s=i.next();!s.done;s=i.next()){s.value.loaded()}}catch(Q){T={error:Q}}finally{try{s&&!s.done&&(e=i.return)&&e.call(i)}finally{if(T)throw T.error}}this.resolve(this.name)},Q.prototype.failed=function(Q){this.hasFailed=!0,this.isLoading=!1,this.reject(new a(Q,this.name))},Q.prototype.checkLoad=function(){var Q=this;((s.CONFIG[this.name]||{}).checkReady||function(){return Promise.resolve()})().then((function(){return Q.loaded()})).catch((function(t){return Q.failed(t)}))},Q.prototype.requirementSatisfied=function(){this.dependencyCount&&(this.dependencyCount--,this.canLoad&&this.load())},Q.prototype.provides=function(t){var T,e;void 0===t&&(t=[]);try{for(var r=n(t),o=r.next();!o.done;o=r.next()){var i=o.value,a=Q.packages.get(i);a||(s.CONFIG.dependencies[i]||(s.CONFIG.dependencies[i]=[]),s.CONFIG.dependencies[i].push(i),(a=new Q(i,!0)).isLoading=!0),this.provided.push(a)}}catch(Q){T={error:Q}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(T)throw T.error}}},Q.prototype.addDependent=function(Q,t){this.dependents.push(Q),t||this.checkNoLoad()},Q.prototype.checkNoLoad=function(){var Q,t;if(this.noLoad){this.noLoad=!1;try{for(var T=n(this.dependencies),e=T.next();!e.done;e=T.next()){e.value.checkNoLoad()}}catch(t){Q={error:t}}finally{try{e&&!e.done&&(t=T.return)&&t.call(T)}finally{if(Q)throw Q.error}}}},Q.packages=new Map,Q}();t.Package=l},2388:function(Q,t,T){var e=this&&this.__assign||function(){return(e=Object.assign||function(Q){for(var t,T=1,e=arguments.length;T<e;T++)for(var r in t=arguments[T])Object.prototype.hasOwnProperty.call(t,r)&&(Q[r]=t[r]);return Q}).apply(this,arguments)},r=this&&this.__values||function(Q){var t="function"==typeof Symbol&&Symbol.iterator,T=t&&Q[t],e=0;if(T)return T.call(Q);if(Q&&"number"==typeof Q.length)return{next:function(){return Q&&e>=Q.length&&(Q=void 0),{value:Q&&Q[e++],done:!Q}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},n=this&&this.__read||function(Q,t){var T="function"==typeof Symbol&&Q[Symbol.iterator];if(!T)return Q;var e,r,n=T.call(Q),o=[];try{for(;(void 0===t||t-- >0)&&!(e=n.next()).done;)o.push(e.value)}catch(Q){r={error:Q}}finally{try{e&&!e.done&&(T=n.return)&&T.call(n)}finally{if(r)throw r.error}}return o},o=this&&this.__spreadArray||function(Q,t){for(var T=0,e=t.length,r=Q.length;T<e;T++,r++)Q[r]=t[T];return Q};Object.defineProperty(t,"__esModule",{value:!0}),t.CONFIG=t.MathJax=t.Startup=void 0;var i,s=T(9515),a=T(8666),l=T(7233);!function(Q){var i,s,l=new a.PrioritizedList;function u(t){return i.visitTree(t,Q.document)}function L(){i=new t.MathJax._.core.MmlTree.SerializedMmlVisitor.SerializedMmlVisitor,s=t.MathJax._.mathjax.mathjax,Q.input=y(),Q.output=m(),Q.adaptor=V(),Q.handler&&s.handlers.unregister(Q.handler),Q.handler=v(),Q.handler&&(s.handlers.register(Q.handler),Q.document=M())}function p(){var t,T;Q.input&&Q.output&&h();var e=Q.output?Q.output.name.toLowerCase():"";try{for(var n=r(Q.input),o=n.next();!o.done;o=n.next()){var i=o.value,s=i.name.toLowerCase();d(s,i),H(s,i),Q.output&&f(s,e,i)}}catch(Q){t={error:Q}}finally{try{o&&!o.done&&(T=n.return)&&T.call(n)}finally{if(t)throw t.error}}}function h(){t.MathJax.typeset=function(t){void 0===t&&(t=null),Q.document.options.elements=t,Q.document.reset(),Q.document.render()},t.MathJax.typesetPromise=function(t){return void 0===t&&(t=null),Q.document.options.elements=t,Q.document.reset(),s.handleRetriesFor((function(){Q.document.render()}))},t.MathJax.typesetClear=function(t){void 0===t&&(t=null),t?Q.document.clearMathItemsWithin(t):Q.document.clear()}}function f(T,e,r){var n=T+"2"+e;t.MathJax[n]=function(t,T){return void 0===T&&(T={}),T.format=r.name,Q.document.convert(t,T)},t.MathJax[n+"Promise"]=function(t,T){return void 0===T&&(T={}),T.format=r.name,s.handleRetriesFor((function(){return Q.document.convert(t,T)}))},t.MathJax[e+"Stylesheet"]=function(){return Q.output.styleSheet(Q.document)},"getMetricsFor"in Q.output&&(t.MathJax.getMetricsFor=function(t,T){return Q.output.getMetricsFor(t,T)})}function d(T,e){var r=t.MathJax._.core.MathItem.STATE;t.MathJax[T+"2mml"]=function(t,T){return void 0===T&&(T={}),T.end=r.CONVERT,T.format=e.name,u(Q.document.convert(t,T))},t.MathJax[T+"2mmlPromise"]=function(t,T){return void 0===T&&(T={}),T.end=r.CONVERT,T.format=e.name,s.handleRetriesFor((function(){return u(Q.document.convert(t,T))}))}}function H(Q,T){t.MathJax[Q+"Reset"]=function(){for(var Q=[],t=0;t<arguments.length;t++)Q[t]=arguments[t];return T.reset.apply(T,o([],n(Q)))}}function y(){var T,e,n=[];try{for(var o=r(t.CONFIG.input),i=o.next();!i.done;i=o.next()){var s=i.value,a=Q.constructors[s];if(!a)throw Error('Input Jax "'+s+'" is not defined (has it been loaded?)');n.push(new a(t.MathJax.config[s]))}}catch(Q){T={error:Q}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(T)throw T.error}}return n}function m(){var T=t.CONFIG.output;if(!T)return null;var e=Q.constructors[T];if(!e)throw Error('Output Jax "'+T+'" is not defined (has it been loaded?)');return new e(t.MathJax.config[T])}function V(){var T=t.CONFIG.adaptor;if(!T||"none"===T)return null;var e=Q.constructors[T];if(!e)throw Error('DOMAdaptor "'+T+'" is not defined (has it been loaded?)');return e(t.MathJax.config[T])}function v(){var T,e,n=t.CONFIG.handler;if(!n||"none"===n||!Q.adaptor)return null;var o=Q.constructors[n];if(!o)throw Error('Handler "'+n+'" is not defined (has it been loaded?)');var i=new o(Q.adaptor,5);try{for(var s=r(l),a=s.next();!a.done;a=s.next()){i=a.value.item(i)}}catch(Q){T={error:Q}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(T)throw T.error}}return i}function M(T){return void 0===T&&(T=null),s.document(T||t.CONFIG.document,e(e({},t.MathJax.config.options),{InputJax:Q.input,OutputJax:Q.output}))}Q.constructors={},Q.input=[],Q.output=null,Q.handler=null,Q.adaptor=null,Q.elements=null,Q.document=null,Q.promise=new Promise((function(t,T){Q.promiseResolve=t,Q.promiseReject=T})),Q.pagePromise=new Promise((function(Q,t){var e=T.g.document;if(e&&e.readyState&&"complete"!==e.readyState&&"interactive"!==e.readyState){var r=function(){return Q()};e.defaultView.addEventListener("load",r,!0),e.defaultView.addEventListener("DOMContentLoaded",r,!0)}else Q()})),Q.toMML=u,Q.registerConstructor=function(t,T){Q.constructors[t]=T},Q.useHandler=function(Q,T){void 0===T&&(T=!1),t.CONFIG.handler&&!T||(t.CONFIG.handler=Q)},Q.useAdaptor=function(Q,T){void 0===T&&(T=!1),t.CONFIG.adaptor&&!T||(t.CONFIG.adaptor=Q)},Q.useInput=function(Q,T){void 0===T&&(T=!1),c&&!T||t.CONFIG.input.push(Q)},Q.useOutput=function(Q,T){void 0===T&&(T=!1),t.CONFIG.output&&!T||(t.CONFIG.output=Q)},Q.extendHandler=function(Q,t){void 0===t&&(t=10),l.add(Q,t)},Q.defaultReady=function(){L(),p(),Q.pagePromise.then((function(){return t.CONFIG.pageReady()})).then((function(){return Q.promiseResolve()})).catch((function(t){return Q.promiseReject(t)}))},Q.defaultPageReady=function(){return t.CONFIG.typeset&&t.MathJax.typesetPromise?t.MathJax.typesetPromise(t.CONFIG.elements):Promise.resolve()},Q.getComponents=L,Q.makeMethods=p,Q.makeTypesetMethods=h,Q.makeOutputMethods=f,Q.makeMmlMethods=d,Q.makeResetMethod=H,Q.getInputJax=y,Q.getOutputJax=m,Q.getAdaptor=V,Q.getHandler=v,Q.getDocument=M}(i=t.Startup||(t.Startup={})),t.MathJax=s.MathJax,void 0===t.MathJax._.startup&&(s.combineDefaults(t.MathJax.config,"startup",{input:[],output:"",handler:null,adaptor:null,document:"undefined"==typeof document?"":document,elements:null,typeset:!0,ready:i.defaultReady.bind(i),pageReady:i.defaultPageReady.bind(i)}),s.combineWithMathJax({startup:i,options:{}}),t.MathJax.config.startup.invalidOption&&(l.OPTIONS.invalidOption=t.MathJax.config.startup.invalidOption),t.MathJax.config.startup.optionError&&(l.OPTIONS.optionError=t.MathJax.config.startup.optionError)),t.CONFIG=t.MathJax.config.startup;var c=0!==t.CONFIG.input.length},5009:function(Q,t){var T=this&&this.__values||function(Q){var t="function"==typeof Symbol&&Symbol.iterator,T=t&&Q[t],e=0;if(T)return T.call(Q);if(Q&&"number"==typeof Q.length)return{next:function(){return Q&&e>=Q.length&&(Q=void 0),{value:Q&&Q[e++],done:!Q}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractDOMAdaptor=void 0;var e=function(){function Q(Q){void 0===Q&&(Q=null),this.document=Q}return Q.prototype.node=function(Q,t,e,r){var n,o;void 0===t&&(t={}),void 0===e&&(e=[]);var i=this.create(Q,r);this.setAttributes(i,t);try{for(var s=T(e),a=s.next();!a.done;a=s.next()){var l=a.value;this.append(i,l)}}catch(Q){n={error:Q}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return i},Q.prototype.setAttributes=function(Q,t){var e,r,n,o,i,s;if(t.style&&"string"!=typeof t.style)try{for(var a=T(Object.keys(t.style)),l=a.next();!l.done;l=a.next()){var c=l.value;this.setStyle(Q,c.replace(/-([a-z])/g,(function(Q,t){return t.toUpperCase()})),t.style[c])}}catch(Q){e={error:Q}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}if(t.properties)try{for(var u=T(Object.keys(t.properties)),L=u.next();!L.done;L=u.next()){Q[c=L.value]=t.properties[c]}}catch(Q){n={error:Q}}finally{try{L&&!L.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}try{for(var p=T(Object.keys(t)),h=p.next();!h.done;h=p.next()){"style"===(c=h.value)&&"string"!=typeof t.style||"properties"===c||this.setAttribute(Q,c,t[c])}}catch(Q){i={error:Q}}finally{try{h&&!h.done&&(s=p.return)&&s.call(p)}finally{if(i)throw i.error}}},Q.prototype.replace=function(Q,t){return this.insert(Q,t),this.remove(t),t},Q.prototype.childNode=function(Q,t){return this.childNodes(Q)[t]},Q.prototype.allClasses=function(Q){var t=this.getAttribute(Q,"class");return t?t.replace(/ +/g," ").replace(/^ /,"").replace(/ $/,"").split(/ /):[]},Q}();t.AbstractDOMAdaptor=e},3494:function(Q,t,T){Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractFindMath=void 0;var e=T(7233),r=function(){function Q(Q){var t=this.constructor;this.options=e.userOptions(e.defaultOptions({},t.OPTIONS),Q)}return Q.OPTIONS={},Q}();t.AbstractFindMath=r},3670:function(Q,t,T){var e,r=this&&this.__extends||(e=function(Q,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Q,t){Q.__proto__=t}||function(Q,t){for(var T in t)Object.prototype.hasOwnProperty.call(t,T)&&(Q[T]=t[T])})(Q,t)},function(Q,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function T(){this.constructor=Q}e(Q,t),Q.prototype=null===t?Object.create(t):(T.prototype=t.prototype,new T)});Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractHandler=void 0;var n=function(Q){function t(){return null!==Q&&Q.apply(this,arguments)||this}return r(t,Q),t}(T(5722).AbstractMathDocument),o=function(){function Q(Q,t){void 0===t&&(t=5),this.documentClass=n,this.adaptor=Q,this.priority=t}return Object.defineProperty(Q.prototype,"name",{get:function(){return this.constructor.NAME},enumerable:!1,configurable:!0}),Q.prototype.handlesDocument=function(Q){return!1},Q.prototype.create=function(Q,t){return new this.documentClass(Q,this.adaptor,t)},Q.NAME="generic",Q}();t.AbstractHandler=o},805:function(Q,t,T){var e,r=this&&this.__extends||(e=function(Q,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Q,t){Q.__proto__=t}||function(Q,t){for(var T in t)Object.prototype.hasOwnProperty.call(t,T)&&(Q[T]=t[T])})(Q,t)},function(Q,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function T(){this.constructor=Q}e(Q,t),Q.prototype=null===t?Object.create(t):(T.prototype=t.prototype,new T)}),n=this&&this.__values||function(Q){var t="function"==typeof Symbol&&Symbol.iterator,T=t&&Q[t],e=0;if(T)return T.call(Q);if(Q&&"number"==typeof Q.length)return{next:function(){return Q&&e>=Q.length&&(Q=void 0),{value:Q&&Q[e++],done:!Q}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.HandlerList=void 0;var o=function(Q){function t(){return null!==Q&&Q.apply(this,arguments)||this}return r(t,Q),t.prototype.register=function(Q){return this.add(Q,Q.priority)},t.prototype.unregister=function(Q){this.remove(Q)},t.prototype.handlesDocument=function(Q){var t,T;try{for(var e=n(this),r=e.next();!r.done;r=e.next()){var o=r.value.item;if(o.handlesDocument(Q))return o}}catch(Q){t={error:Q}}finally{try{r&&!r.done&&(T=e.return)&&T.call(e)}finally{if(t)throw t.error}}throw new Error("Can't find handler for document")},t.prototype.document=function(Q,t){return void 0===t&&(t=null),this.handlesDocument(Q).create(Q,t)},t}(T(8666).PrioritizedList);t.HandlerList=o},9206:function(Q,t,T){Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractInputJax=void 0;var e=T(7233),r=T(7525),n=function(){function Q(Q){void 0===Q&&(Q={}),this.adaptor=null,this.mmlFactory=null;var t=this.constructor;this.options=e.userOptions(e.defaultOptions({},t.OPTIONS),Q),this.preFilters=new r.FunctionList,this.postFilters=new r.FunctionList}return Object.defineProperty(Q.prototype,"name",{get:function(){return this.constructor.NAME},enumerable:!1,configurable:!0}),Q.prototype.setAdaptor=function(Q){this.adaptor=Q},Q.prototype.setMmlFactory=function(Q){this.mmlFactory=Q},Q.prototype.initialize=function(){},Q.prototype.reset=function(){for(var Q=[],t=0;t<arguments.length;t++)Q[t]=arguments[t]},Object.defineProperty(Q.prototype,"processStrings",{get:function(){return!0},enumerable:!1,configurable:!0}),Q.prototype.findMath=function(Q,t){return[]},Q.prototype.executeFilters=function(Q,t,T,e){var r={math:t,document:T,data:e};return Q.execute(r),r.data},Q.NAME="generic",Q.OPTIONS={},Q}();t.AbstractInputJax=n},5722:function(Q,t,T){var e,r=this&&this.__extends||(e=function(Q,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Q,t){Q.__proto__=t}||function(Q,t){for(var T in t)Object.prototype.hasOwnProperty.call(t,T)&&(Q[T]=t[T])})(Q,t)},function(Q,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function T(){this.constructor=Q}e(Q,t),Q.prototype=null===t?Object.create(t):(T.prototype=t.prototype,new T)}),n=this&&this.__values||function(Q){var t="function"==typeof Symbol&&Symbol.iterator,T=t&&Q[t],e=0;if(T)return T.call(Q);if(Q&&"number"==typeof Q.length)return{next:function(){return Q&&e>=Q.length&&(Q=void 0),{value:Q&&Q[e++],done:!Q}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(Q,t){var T="function"==typeof Symbol&&Q[Symbol.iterator];if(!T)return Q;var e,r,n=T.call(Q),o=[];try{for(;(void 0===t||t-- >0)&&!(e=n.next()).done;)o.push(e.value)}catch(Q){r={error:Q}}finally{try{e&&!e.done&&(T=n.return)&&T.call(n)}finally{if(r)throw r.error}}return o},i=this&&this.__spreadArray||function(Q,t){for(var T=0,e=t.length,r=Q.length;T<e;T++,r++)Q[r]=t[T];return Q};Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMathDocument=t.resetAllOptions=t.resetOptions=t.RenderList=void 0;var s=T(7233),a=T(9206),l=T(2975),c=T(9e3),u=T(4474),L=T(3909),p=T(6751),h=function(Q){function t(){return null!==Q&&Q.apply(this,arguments)||this}return r(t,Q),t.create=function(Q){var t,T,e=new this;try{for(var r=n(Object.keys(Q)),i=r.next();!i.done;i=r.next()){var s=i.value,a=o(this.action(s,Q[s]),2),l=a[0],c=a[1];c&&e.add(l,c)}}catch(Q){t={error:Q}}finally{try{i&&!i.done&&(T=r.return)&&T.call(r)}finally{if(t)throw t.error}}return e},t.action=function(Q,t){var T,e,r,n,i,s,a=!0,l=t[0];if(1===t.length||"boolean"==typeof t[1])2===t.length&&(a=t[1]),i=(T=o(this.methodActions(Q),2))[0],s=T[1];else if("string"==typeof t[1])if("string"==typeof t[2]){4===t.length&&(a=t[3]);var c=o(t.slice(1),2),u=c[0],L=c[1];i=(e=o(this.methodActions(u,L),2))[0],s=e[1]}else 3===t.length&&(a=t[2]),i=(r=o(this.methodActions(t[1]),2))[0],s=r[1];else 4===t.length&&(a=t[3]),i=(n=o(t.slice(1),2))[0],s=n[1];return[{id:Q,renderDoc:i,renderMath:s,convert:a},l]},t.methodActions=function(Q,t){return void 0===t&&(t=Q),[function(t){return Q&&t[Q](),!1},function(Q,T){return t&&Q[t](T),!1}]},t.prototype.renderDoc=function(Q,t){var T,e;void 0===t&&(t=u.STATE.UNPROCESSED);try{for(var r=n(this.items),o=r.next();!o.done;o=r.next()){var i=o.value;if(i.priority>=t&&i.item.renderDoc(Q))return}}catch(Q){T={error:Q}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(T)throw T.error}}},t.prototype.renderMath=function(Q,t,T){var e,r;void 0===T&&(T=u.STATE.UNPROCESSED);try{for(var o=n(this.items),i=o.next();!i.done;i=o.next()){var s=i.value;if(s.priority>=T&&s.item.renderMath(Q,t))return}}catch(Q){e={error:Q}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}},t.prototype.renderConvert=function(Q,t,T){var e,r;void 0===T&&(T=u.STATE.LAST);try{for(var o=n(this.items),i=o.next();!i.done;i=o.next()){var s=i.value;if(s.priority>T)return;if(s.item.convert&&s.item.renderMath(Q,t))return}}catch(Q){e={error:Q}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}},t.prototype.findID=function(Q){var t,T;try{for(var e=n(this.items),r=e.next();!r.done;r=e.next()){var o=r.value;if(o.item.id===Q)return o.item}}catch(Q){t={error:Q}}finally{try{r&&!r.done&&(T=e.return)&&T.call(e)}finally{if(t)throw t.error}}return null},t}(T(8666).PrioritizedList);t.RenderList=h,t.resetOptions={all:!1,processed:!1,inputJax:null,outputJax:null},t.resetAllOptions={all:!0,processed:!0,inputJax:[],outputJax:[]};var f=function(Q){function t(){return null!==Q&&Q.apply(this,arguments)||this}return r(t,Q),t.prototype.compile=function(Q){return null},t}(a.AbstractInputJax),d=function(Q){function t(){return null!==Q&&Q.apply(this,arguments)||this}return r(t,Q),t.prototype.typeset=function(Q,t){return void 0===t&&(t=null),null},t.prototype.escaped=function(Q,t){return null},t}(l.AbstractOutputJax),H=function(Q){function t(){return null!==Q&&Q.apply(this,arguments)||this}return r(t,Q),t}(c.AbstractMathList),y=function(Q){function t(){return null!==Q&&Q.apply(this,arguments)||this}return r(t,Q),t}(u.AbstractMathItem),m=function(){function Q(t,T,e){var r=this,n=this.constructor;this.document=t,this.options=s.userOptions(s.defaultOptions({},n.OPTIONS),e),this.math=new(this.options.MathList||H),this.renderActions=h.create(this.options.renderActions),this.processed=new Q.ProcessBits,this.outputJax=this.options.OutputJax||new d;var o=this.options.InputJax||[new f];Array.isArray(o)||(o=[o]),this.inputJax=o,this.adaptor=T,this.outputJax.setAdaptor(T),this.inputJax.map((function(Q){return Q.setAdaptor(T)})),this.mmlFactory=this.options.MmlFactory||new L.MmlFactory,this.inputJax.map((function(Q){return Q.setMmlFactory(r.mmlFactory)})),this.outputJax.initialize(),this.inputJax.map((function(Q){return Q.initialize()}))}return Object.defineProperty(Q.prototype,"kind",{get:function(){return this.constructor.KIND},enumerable:!1,configurable:!0}),Q.prototype.addRenderAction=function(Q){for(var t=[],T=1;T<arguments.length;T++)t[T-1]=arguments[T];var e=o(h.action(Q,t),2),r=e[0],n=e[1];this.renderActions.add(r,n)},Q.prototype.removeRenderAction=function(Q){var t=this.renderActions.findID(Q);t&&this.renderActions.remove(t)},Q.prototype.render=function(){return this.renderActions.renderDoc(this),this},Q.prototype.rerender=function(Q){return void 0===Q&&(Q=u.STATE.RERENDER),this.state(Q-1),this.render(),this},Q.prototype.convert=function(Q,t){void 0===t&&(t={});var T=s.userOptions({format:this.inputJax[0].name,display:!0,end:u.STATE.LAST,em:16,ex:8,containerWidth:null,lineWidth:1e6,scale:1,family:""},t),e=T.format,r=T.display,n=T.end,o=T.ex,i=T.em,a=T.containerWidth,l=T.lineWidth,c=T.scale,L=T.family;null===a&&(a=80*o);var p=this.inputJax.reduce((function(Q,t){return t.name===e?t:Q}),null),h=new this.options.MathItem(Q,p,r);return h.start.node=this.adaptor.body(this.document),h.setMetrics(i,o,a,l,c),this.outputJax.options.mtextInheritFont&&(h.outputData.mtextFamily=L),this.outputJax.options.merrorInheritFont&&(h.outputData.merrorFamily=L),h.convert(this,n),h.typesetRoot||h.root},Q.prototype.findMath=function(Q){return void 0===Q&&(Q=null),this.processed.set("findMath"),this},Q.prototype.compile=function(){var Q,t,T,e;if(!this.processed.isSet("compile")){var r=[];try{for(var o=n(this.math),i=o.next();!i.done;i=o.next()){var s=i.value;this.compileMath(s),void 0!==s.inputData.recompile&&r.push(s)}}catch(t){Q={error:t}}finally{try{i&&!i.done&&(t=o.return)&&t.call(o)}finally{if(Q)throw Q.error}}try{for(var a=n(r),l=a.next();!l.done;l=a.next()){var c=(s=l.value).inputData.recompile;s.state(c.state),s.inputData.recompile=c,this.compileMath(s)}}catch(Q){T={error:Q}}finally{try{l&&!l.done&&(e=a.return)&&e.call(a)}finally{if(T)throw T.error}}this.processed.set("compile")}return this},Q.prototype.compileMath=function(Q){try{Q.compile(this)}catch(t){if(t.retry||t.restart)throw t;this.options.compileError(this,Q,t),Q.inputData.error=t}},Q.prototype.compileError=function(Q,t){Q.root=this.mmlFactory.create("math",null,[this.mmlFactory.create("merror",{"data-mjx-error":t.message,title:t.message},[this.mmlFactory.create("mtext",null,[this.mmlFactory.create("text").setText("Math input error")])])]),Q.display&&Q.root.attributes.set("display","block"),Q.inputData.error=t.message},Q.prototype.typeset=function(){var Q,t;if(!this.processed.isSet("typeset")){try{for(var T=n(this.math),e=T.next();!e.done;e=T.next()){var r=e.value;try{r.typeset(this)}catch(Q){if(Q.retry||Q.restart)throw Q;this.options.typesetError(this,r,Q),r.outputData.error=Q}}}catch(t){Q={error:t}}finally{try{e&&!e.done&&(t=T.return)&&t.call(T)}finally{if(Q)throw Q.error}}this.processed.set("typeset")}return this},Q.prototype.typesetError=function(Q,t){Q.typesetRoot=this.adaptor.node("mjx-container",{class:"MathJax mjx-output-error",jax:this.outputJax.name},[this.adaptor.node("span",{"data-mjx-error":t.message,title:t.message,style:{color:"red","background-color":"yellow","line-height":"normal"}},[this.adaptor.text("Math output error")])]),Q.display&&this.adaptor.setAttributes(Q.typesetRoot,{style:{display:"block",margin:"1em 0","text-align":"center"}}),Q.outputData.error=t.message},Q.prototype.getMetrics=function(){return this.processed.isSet("getMetrics")||(this.outputJax.getMetrics(this),this.processed.set("getMetrics")),this},Q.prototype.updateDocument=function(){var Q,t;if(!this.processed.isSet("updateDocument")){try{for(var T=n(this.math.reversed()),e=T.next();!e.done;e=T.next()){e.value.updateDocument(this)}}catch(t){Q={error:t}}finally{try{e&&!e.done&&(t=T.return)&&t.call(T)}finally{if(Q)throw Q.error}}this.processed.set("updateDocument")}return this},Q.prototype.removeFromDocument=function(Q){return void 0===Q&&(Q=!1),this},Q.prototype.state=function(Q,t){var T,e;void 0===t&&(t=!1);try{for(var r=n(this.math),o=r.next();!o.done;o=r.next()){o.value.state(Q,t)}}catch(Q){T={error:Q}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(T)throw T.error}}return Q<u.STATE.INSERTED&&this.processed.clear("updateDocument"),Q<u.STATE.TYPESET&&(this.processed.clear("typeset"),this.processed.clear("getMetrics")),Q<u.STATE.COMPILED&&this.processed.clear("compile"),this},Q.prototype.reset=function(Q){var T;return void 0===Q&&(Q={processed:!0}),(Q=s.userOptions(Object.assign({},t.resetOptions),Q)).all&&Object.assign(Q,t.resetAllOptions),Q.processed&&this.processed.reset(),Q.inputJax&&this.inputJax.forEach((function(t){return t.reset.apply(t,i([],o(Q.inputJax)))})),Q.outputJax&&(T=this.outputJax).reset.apply(T,i([],o(Q.outputJax))),this},Q.prototype.clear=function(){return this.reset(),this.math.clear(),this},Q.prototype.concat=function(Q){return this.math.merge(Q),this},Q.prototype.clearMathItemsWithin=function(Q){var t,T=this.getMathItemsWithin(Q);return(t=this.math).remove.apply(t,i([],o(T))),T},Q.prototype.getMathItemsWithin=function(Q){var t,T,e,r;Array.isArray(Q)||(Q=[Q]);var o=this.adaptor,i=[],s=o.getElements(Q,this.document);try{Q:for(var a=n(this.math),l=a.next();!l.done;l=a.next()){var c=l.value;try{for(var u=(e=void 0,n(s)),L=u.next();!L.done;L=u.next()){var p=L.value;if(c.start.node&&o.contains(p,c.start.node)){i.push(c);continue Q}}}catch(Q){e={error:Q}}finally{try{L&&!L.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}}}catch(Q){t={error:Q}}finally{try{l&&!l.done&&(T=a.return)&&T.call(a)}finally{if(t)throw t.error}}return i},Q.KIND="MathDocument",Q.OPTIONS={OutputJax:null,InputJax:null,MmlFactory:null,MathList:H,MathItem:y,compileError:function(Q,t,T){Q.compileError(t,T)},typesetError:function(Q,t,T){Q.typesetError(t,T)},renderActions:s.expandable({find:[u.STATE.FINDMATH,"findMath","",!1],compile:[u.STATE.COMPILED],metrics:[u.STATE.METRICS,"getMetrics","",!1],typeset:[u.STATE.TYPESET],update:[u.STATE.INSERTED,"updateDocument",!1]})},Q.ProcessBits=p.BitFieldClass("findMath","compile","getMetrics","typeset","updateDocument"),Q}();t.AbstractMathDocument=m},4474:function(Q,t){Object.defineProperty(t,"__esModule",{value:!0}),t.newState=t.STATE=t.AbstractMathItem=t.protoItem=void 0,t.protoItem=function(Q,t,T,e,r,n,o){return void 0===o&&(o=null),{open:Q,math:t,close:T,n:e,start:{n:r},end:{n:n},display:o}};var T=function(){function Q(Q,T,e,r,n){void 0===e&&(e=!0),void 0===r&&(r={i:0,n:0,delim:""}),void 0===n&&(n={i:0,n:0,delim:""}),this.root=null,this.typesetRoot=null,this.metrics={},this.inputData={},this.outputData={},this._state=t.STATE.UNPROCESSED,this.math=Q,this.inputJax=T,this.display=e,this.start=r,this.end=n,this.root=null,this.typesetRoot=null,this.metrics={},this.inputData={},this.outputData={}}return Object.defineProperty(Q.prototype,"isEscaped",{get:function(){return null===this.display},enumerable:!1,configurable:!0}),Q.prototype.render=function(Q){Q.renderActions.renderMath(this,Q)},Q.prototype.rerender=function(Q,T){void 0===T&&(T=t.STATE.RERENDER),this.state()>=T&&this.state(T-1),Q.renderActions.renderMath(this,Q,T)},Q.prototype.convert=function(Q,T){void 0===T&&(T=t.STATE.LAST),Q.renderActions.renderConvert(this,Q,T)},Q.prototype.compile=function(Q){this.state()<t.STATE.COMPILED&&(this.root=this.inputJax.compile(this,Q),this.state(t.STATE.COMPILED))},Q.prototype.typeset=function(Q){this.state()<t.STATE.TYPESET&&(this.typesetRoot=Q.outputJax[this.isEscaped?"escaped":"typeset"](this,Q),this.state(t.STATE.TYPESET))},Q.prototype.updateDocument=function(Q){},Q.prototype.removeFromDocument=function(Q){void 0===Q&&(Q=!1)},Q.prototype.setMetrics=function(Q,t,T,e,r){this.metrics={em:Q,ex:t,containerWidth:T,lineWidth:e,scale:r}},Q.prototype.state=function(Q,T){return void 0===Q&&(Q=null),void 0===T&&(T=!1),null!=Q&&(Q<t.STATE.INSERTED&&this._state>=t.STATE.INSERTED&&this.removeFromDocument(T),Q<t.STATE.TYPESET&&this._state>=t.STATE.TYPESET&&(this.outputData={}),Q<t.STATE.COMPILED&&this._state>=t.STATE.COMPILED&&(this.inputData={}),this._state=Q),this._state},Q.prototype.reset=function(Q){void 0===Q&&(Q=!1),this.state(t.STATE.UNPROCESSED,Q)},Q}();t.AbstractMathItem=T,t.STATE={UNPROCESSED:0,FINDMATH:10,COMPILED:20,CONVERT:100,METRICS:110,RERENDER:125,TYPESET:150,INSERTED:200,LAST:1e4},t.newState=function(Q,T){if(Q in t.STATE)throw Error("State "+Q+" already exists");t.STATE[Q]=T}},9e3:function(Q,t,T){var e,r=this&&this.__extends||(e=function(Q,t){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Q,t){Q.__proto__=t}||function(Q,t){for(var T in t)Object.prototype.hasOwnProperty.call(t,T)&&(Q[T]=t[T])})(Q,t)},function(Q,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function T(){this.constructor=Q}e(Q,t),Q.prototype=null===t?Object.create(t):(T.prototype=t.prototype,new T)});Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMathList=void 0;var n=function(Q){function t(){return null!==Q&&Q.apply(this,arguments)||this}return r(t,Q),t.prototype.isBefore=function(Q,t){return Q.start.i<t.start.i||Q.start.i===t.start.i&&Q.start.n<t.start.n},t}(T(103).LinkedList);t.AbstractMathList=n},91:function(Q,t){var T=this&&this.__values||function(Q){var t="function"==typeof Symbol&&Symbol.iterator,T=t&&Q[t],e=0;if(T)return T.call(Q);if(Q&&"number"==typeof Q.length)return{next:function(){return Q&&e>=Q.length&&(Q=void 0),{value:Q&&Q[e++],done:!Q}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.Attributes=t.INHERIT=void 0,t.INHERIT="_inherit_";var e=function(){function Q(Q,t){this.global=t,this.defaults=Object.create(t),this.inherited=Object.create(this.defaults),this.attributes=Object.create(this.inherited),Object.assign(this.defaults,Q)}return Q.prototype.set=function(Q,t){this.attributes[Q]=t},Q.prototype.setList=function(Q){Object.assign(this.attributes,Q)},Q.prototype.get=function(Q){var T=this.attributes[Q];return T===t.INHERIT&&(T=this.global[Q]),T},Q.prototype.getExplicit=function(Q){if(this.attributes.hasOwnProperty(Q))return this.attributes[Q]},Q.prototype.getList=function(){for(var Q,t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n={};try{for(var o=T(e),i=o.next();!i.done;i=o.next()){var s=i.value;n[s]=this.get(s)}}catch(t){Q={error:t}}finally{try{i&&!i.done&&(t=o.return)&&t.call(o)}finally{if(Q)throw Q.error}}return n},Q.prototype.setInherited=function(Q,t){this.inherited[Q]=t},Q.prototype.getInherited=function(Q){return this.inherited[Q]},Q.prototype.getDefault=function(Q){return this.defaults[Q]},Q.prototype.isSet=function(Q){return this.attributes.hasOwnProperty(Q)||this.inherited.hasOwnProperty(Q)},Q.prototype.hasDefault=function(Q){return Q in this.defaults},Q.prototype.getExplicitNames=function(){return Object.keys(this.attributes)},Q.prototype.getInheritedNames=function(){return Object.keys(this.inherited)},Q.prototype.getDefaultNames=function(){return Object.keys(this.defaults)},Q.prototype.getGlobalNames=function(){return Object.keys(this.global)},Q.prototype.getAllAttributes=function(){return this.attributes},Q.prototype.getAllInherited=function(){return this.inherited},Q.prototype.getAllDefaults=function(){return this.defaults},Q.prototype.getAllGlobals=function(){return this.global},Q}();t.Attributes=e},6336:function(Q,t,T){var e;Object.defineProperty(t,"__esModule",{value:!0}),t.MML=void 0;var r=T(9007),n=T(3233),o=T(450),i=T(3050),s=T(2756),a=T(4770),l=T(6030),c=T(7265),u=T(9878),L=T(6850),p=T(7131),h=T(6145),f=T(1314),d=T(1581),H=T(7238),y=T(5741),m=T(5410),V=T(6661),v=T(9145),M=T(4461),b=T(5184),g=T(6405),O=T(1349),x=T(5022),_=T(4359),E=T(142),S=T(7590),w=T(3985),C=T(9102),A=T(3948),N=T(1334);t.MML=((e={})[n.MmlMath.prototype.kind]=n.MmlMath,e[o.MmlMi.prototype.kind]=o.MmlMi,e[i.MmlMn.prototype.kind]=i.MmlMn,e[s.MmlMo.prototype.kind]=s.MmlMo,e[a.MmlMtext.prototype.kind]=a.MmlMtext,e[l.MmlMspace.prototype.kind]=l.MmlMspace,e[c.MmlMs.prototype.kind]=c.MmlMs,e[u.MmlMrow.prototype.kind]=u.MmlMrow,e[u.MmlInferredMrow.prototype.kind]=u.MmlInferredMrow,e[L.MmlMfrac.prototype.kind]=L.MmlMfrac,e[p.MmlMsqrt.prototype.kind]=p.MmlMsqrt,e[h.MmlMroot.prototype.kind]=h.MmlMroot,e[f.MmlMstyle.prototype.kind]=f.MmlMstyle,e[d.MmlMerror.prototype.kind]