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