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 2.09 MB
(function(){"use strict";var __webpack_modules__={351:function(e,t,r){var a,n=this&&this.__extends||(a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},a(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},o.apply(this,arguments)},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var a,n,o=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(a=o.next()).done;)i.push(a.value)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},l=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var a,n=0,o=t.length;n<o;n++)!a&&n in t||(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))},s=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};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 u=r(4474),c=r(9259),d=r(7233),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.getAttributes=function(t){return e.prototype.getAttributes.call(this,t).replace(/ ?id=".*?"/,"")},t}(c.SerializedMmlVisitor);function f(e){return function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.assistiveMml=function(e,t){if(void 0===t&&(t=!1),!(this.state()>=u.STATE.ASSISTIVEMML)){if(!this.isEscaped&&(e.options.enableAssistiveMml||t)){var r=e.adaptor,a=e.toMML(this.root).replace(/\n */g,"").replace(/<!--.*?-->/g,""),n=r.firstChild(r.body(r.parse(a,"text/html"))),o=r.node("mjx-assistive-mml",{unselectable:"on",display:this.display?"block":"inline"},[n]);r.setAttribute(r.firstChild(this.typesetRoot),"aria-hidden","true"),r.setStyle(this.typesetRoot,"position","relative"),r.append(this.typesetRoot,o)}this.state(u.STATE.ASSISTIVEMML)}},t}(e)}function m(e){var t;return t=function(e){function t(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var a=e.apply(this,l([],i(t),!1))||this,n=a.constructor,o=n.ProcessBits;return o.has("assistive-mml")||o.allocate("assistive-mml"),a.visitor=new p(a.mmlFactory),a.options.MathItem=f(a.options.MathItem),"addStyles"in a&&a.addStyles(n.assistiveStyles),a}return n(t,e),t.prototype.toMML=function(e){return this.visitor.visitTree(e)},t.prototype.assistiveMml=function(){var e,t;if(!this.processed.isSet("assistive-mml")){try{for(var r=s(this.math),a=r.next();!a.done;a=r.next()){a.value.assistiveMml(this)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.processed.set("assistive-mml")}return this},t.prototype.state=function(t,r){return void 0===r&&(r=!1),e.prototype.state.call(this,t,r),t<u.STATE.ASSISTIVEMML&&this.processed.clear("assistive-mml"),this},t}(e),t.OPTIONS=o(o({},e.OPTIONS),{enableAssistiveMml:!0,renderActions:(0,d.expandable)(o(o({},e.OPTIONS.renderActions),{assistiveMml:[u.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=p,(0,u.newState)("ASSISTIVEMML",153),t.AssistiveMmlMathItemMixin=f,t.AssistiveMmlMathDocumentMixin=m,t.AssistiveMmlHandler=function(e){return e.documentClass=m(e.documentClass),e}},5282:function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=new Map;t.default=r},5445:function(e,t,r){var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,n)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return n(t,e),t},i=this&&this.__awaiter||function(e,t,r,a){return new(r||(r=Promise))((function(n,o){function i(e){try{s(a.next(e))}catch(e){o(e)}}function l(e){try{s(a.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,l)}s((a=a.apply(e,t||[])).next())}))},l=this&&this.__generator||function(e,t){var r,a,n,o,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(o){return function(l){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,a&&(n=2&o[0]?a.return:o[0]?a.throw||((n=a.return)&&n.call(a),0):a.next)&&!(n=n.call(a,o[1])).done)return n;switch(a=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,a=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(n=i.trys,(n=n.length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){i.label=o[1];break}if(6===o[0]&&i.label<n[1]){i.label=n[1],n=o;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(o);break}n[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],a=0}finally{r=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,l])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.sreReady=t.Sre=void 0;var u,c=o(r(2998)),d=o(r(3362)),p=o(r(9552)),f=o(r(4440)),m=s(r(5897)),h=r(8504),g=o(r(3090)),y=r(1377),b=s(r(5282));!function(e){e.locales=y.Variables.LOCALES,e.sreReady=c.engineReady,e.setupEngine=c.setupEngine,e.engineSetup=c.engineSetup,e.toEnriched=c.toEnriched,e.toSpeech=c.toSpeech,e.clearspeakPreferences=h.ClearspeakPreferences,e.getHighlighter=g.highlighter,e.getSpeechGenerator=p.generator,e.getWalker=d.walker,e.clearspeakStyle=function(){return f.DOMAIN_TO_STYLES.clearspeak},e.preloadLocales=function(e){return i(this,void 0,void 0,(function(){var t;return l(this,(function(r){return[2,(t=b.default.get(e))?new Promise((function(e,r){return e(JSON.stringify(t))})):c.localeLoader()(e)]}))}))}}(u=t.Sre||(t.Sre={})),t.sreReady=u.sreReady,m.default.getInstance().delay=!0,t.default=u},444:function(e,t,r){var a,n=this&&this.__extends||(a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},a(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLAdaptor=void 0;var i=function(e){function t(t){var r=e.call(this,t.document)||this;return r.window=t,r.parser=new t.DOMParser,r}return n(t,e),t.prototype.parse=function(e,t){return void 0===t&&(t="text/html"),this.parser.parseFromString(e,t)},t.prototype.create=function(e,t){return t?this.document.createElementNS(t,e):this.document.createElement(e)},t.prototype.text=function(e){return this.document.createTextNode(e)},t.prototype.head=function(e){return e.head||e},t.prototype.body=function(e){return e.body||e},t.prototype.root=function(e){return e.documentElement||e},t.prototype.doctype=function(e){return e.doctype?"<!DOCTYPE ".concat(e.doctype.name,">"):""},t.prototype.tags=function(e,t,r){void 0===r&&(r=null);var a=r?e.getElementsByTagNameNS(r,t):e.getElementsByTagName(t);return Array.from(a)},t.prototype.getElements=function(e,t){var r,a,n=[];try{for(var i=o(e),l=i.next();!l.done;l=i.next()){var s=l.value;"string"==typeof s?n=n.concat(Array.from(this.document.querySelectorAll(s))):Array.isArray(s)||s instanceof this.window.NodeList||s instanceof this.window.HTMLCollection?n=n.concat(Array.from(s)):n.push(s)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(a=i.return)&&a.call(i)}finally{if(r)throw r.error}}return n},t.prototype.contains=function(e,t){return e.contains(t)},t.prototype.parent=function(e){return e.parentNode},t.prototype.append=function(e,t){return e.appendChild(t)},t.prototype.insert=function(e,t){return this.parent(t).insertBefore(e,t)},t.prototype.remove=function(e){return this.parent(e).removeChild(e)},t.prototype.replace=function(e,t){return this.parent(t).replaceChild(e,t)},t.prototype.clone=function(e){return e.cloneNode(!0)},t.prototype.split=function(e,t){return e.splitText(t)},t.prototype.next=function(e){return e.nextSibling},t.prototype.previous=function(e){return e.previousSibling},t.prototype.firstChild=function(e){return e.firstChild},t.prototype.lastChild=function(e){return e.lastChild},t.prototype.childNodes=function(e){return Array.from(e.childNodes)},t.prototype.childNode=function(e,t){return e.childNodes[t]},t.prototype.kind=function(e){var t=e.nodeType;return 1===t||3===t||8===t?e.nodeName.toLowerCase():""},t.prototype.value=function(e){return e.nodeValue||""},t.prototype.textContent=function(e){return e.textContent},t.prototype.innerHTML=function(e){return e.innerHTML},t.prototype.outerHTML=function(e){return e.outerHTML},t.prototype.serializeXML=function(e){return(new this.window.XMLSerializer).serializeToString(e)},t.prototype.setAttribute=function(e,t,r,a){return void 0===a&&(a=null),a?(t=a.replace(/.*\//,"")+":"+t.replace(/^.*:/,""),e.setAttributeNS(a,t,r)):e.setAttribute(t,r)},t.prototype.getAttribute=function(e,t){return e.getAttribute(t)},t.prototype.removeAttribute=function(e,t){return e.removeAttribute(t)},t.prototype.hasAttribute=function(e,t){return e.hasAttribute(t)},t.prototype.allAttributes=function(e){return Array.from(e.attributes).map((function(e){return{name:e.name,value:e.value}}))},t.prototype.addClass=function(e,t){e.classList?e.classList.add(t):e.className=(e.className+" "+t).trim()},t.prototype.removeClass=function(e,t){e.classList?e.classList.remove(t):e.className=e.className.split(/ /).filter((function(e){return e!==t})).join(" ")},t.prototype.hasClass=function(e,t){return e.classList?e.classList.contains(t):e.className.split(/ /).indexOf(t)>=0},t.prototype.setStyle=function(e,t,r){e.style[t]=r},t.prototype.getStyle=function(e,t){return e.style[t]},t.prototype.allStyles=function(e){return e.style.cssText},t.prototype.insertRules=function(e,t){var r,a;try{for(var n=o(t.reverse()),i=n.next();!i.done;i=n.next()){var l=i.value;try{e.sheet.insertRule(l,0)}catch(e){console.warn("MathJax: can't insert css rule '".concat(l,"': ").concat(e.message))}}}catch(e){r={error:e}}finally{try{i&&!i.done&&(a=n.return)&&a.call(n)}finally{if(r)throw r.error}}},t.prototype.fontSize=function(e){var t=this.window.getComputedStyle(e);return parseFloat(t.fontSize)},t.prototype.fontFamily=function(e){return this.window.getComputedStyle(e).fontFamily||""},t.prototype.nodeSize=function(e,t,r){if(void 0===t&&(t=1),void 0===r&&(r=!1),r&&e.getBBox){var a=e.getBBox();return[a.width/t,a.height/t]}return[e.offsetWidth/t,e.offsetHeight/t]},t.prototype.nodeBBox=function(e){var t=e.getBoundingClientRect();return{left:t.left,right:t.right,top:t.top,bottom:t.bottom}},t}(r(5009).AbstractDOMAdaptor);t.HTMLAdaptor=i},6191:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.browserAdaptor=void 0;var a=r(444);t.browserAdaptor=function(){return new a.HTMLAdaptor(window)}},9515:function(e,t,r){var a=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.MathJax=t.combineWithMathJax=t.combineDefaults=t.combineConfig=t.isObject=void 0;var n=r(3282);function o(e){return"object"==typeof e&&null!==e}function i(e,t){var r,n;try{for(var l=a(Object.keys(t)),s=l.next();!s.done;s=l.next()){var u=s.value;"__esModule"!==u&&(!o(e[u])||!o(t[u])||t[u]instanceof Promise?null!==t[u]&&void 0!==t[u]&&(e[u]=t[u]):i(e[u],t[u]))}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}return e}t.isObject=o,t.combineConfig=i,t.combineDefaults=function e(t,r,n){var i,l;t[r]||(t[r]={}),t=t[r];try{for(var s=a(Object.keys(n)),u=s.next();!u.done;u=s.next()){var c=u.value;o(t[c])&&o(n[c])?e(t,c,n[c]):null==t[c]&&null!=n[c]&&(t[c]=n[c])}}catch(e){i={error:e}}finally{try{u&&!u.done&&(l=s.return)&&l.call(s)}finally{if(i)throw i.error}}return t},t.combineWithMathJax=function(e){return i(t.MathJax,e)},void 0===r.g.MathJax&&(r.g.MathJax={}),r.g.MathJax.version||(r.g.MathJax={version:n.VERSION,_:{},config:r.g.MathJax}),t.MathJax=r.g.MathJax},235:function(e,t,r){var a,n,o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};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 i=r(9515),l=r(265),s=r(265);Object.defineProperty(t,"Package",{enumerable:!0,get:function(){return s.Package}}),Object.defineProperty(t,"PackageError",{enumerable:!0,get:function(){return s.PackageError}});var u,c=r(7525);if(t.PathFilters={source:function(e){return t.CONFIG.source.hasOwnProperty(e.name)&&(e.name=t.CONFIG.source[e.name]),!0},normalize:function(e){var t=e.name;return t.match(/^(?:[a-z]+:\/)?\/|[a-z]:\\|\[/i)||(e.name="[mathjax]/"+t.replace(/^\.\//,"")),e.addExtension&&!t.match(/\.[^\/]+$/)&&(e.name+=".js"),!0},prefix:function(e){for(var r;(r=e.name.match(/^\[([^\]]*)\]/))&&t.CONFIG.paths.hasOwnProperty(r[1]);)e.name=t.CONFIG.paths[r[1]]+e.name.substr(r[0].length);return!0}},function(e){var r=i.MathJax.version;e.versions=new Map,e.ready=function(){for(var e,t,r=[],a=0;a<arguments.length;a++)r[a]=arguments[a];0===r.length&&(r=Array.from(l.Package.packages.keys()));var n=[];try{for(var i=o(r),s=i.next();!s.done;s=i.next()){var u=s.value,c=l.Package.packages.get(u)||new l.Package(u,!0);n.push(c.promise)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return Promise.all(n)},e.load=function(){for(var r,a,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(0===n.length)return Promise.resolve();var s=[],u=function(r){var a=l.Package.packages.get(r);a||(a=new l.Package(r)).provides(t.CONFIG.provides[r]),a.checkNoLoad(),s.push(a.promise.then((function(){t.CONFIG.versionWarnings&&a.isLoaded&&!e.versions.has(l.Package.resolvePath(r))&&console.warn("No version information available for component ".concat(r))})))};try{for(var c=o(n),d=c.next();!d.done;d=c.next()){var p=d.value;u(p)}}catch(e){r={error:e}}finally{try{d&&!d.done&&(a=c.return)&&a.call(c)}finally{if(r)throw r.error}}return l.Package.loadAll(),Promise.all(s)},e.preLoad=function(){for(var e,r,a=[],n=0;n<arguments.length;n++)a[n]=arguments[n];try{for(var i=o(a),s=i.next();!s.done;s=i.next()){var u=s.value,c=l.Package.packages.get(u);c||(c=new l.Package(u,!0)).provides(t.CONFIG.provides[u]),c.loaded()}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}},e.defaultReady=function(){void 0!==t.MathJax.startup&&t.MathJax.config.startup.ready()},e.getRoot=function(){var e="//../../es5";if("undefined"!=typeof document){var t=document.currentScript||document.getElementById("MathJax-script");t&&(e=t.src.replace(/\/[^\/]*$/,""))}return e},e.checkVersion=function(a,n,o){return e.versions.set(l.Package.resolvePath(a),r),!(!t.CONFIG.versionWarnings||n===r)&&(console.warn("Component ".concat(a," uses ").concat(n," of MathJax; version in use is ").concat(r)),!0)},e.pathFilters=new c.FunctionList,e.pathFilters.add(t.PathFilters.source,0),e.pathFilters.add(t.PathFilters.normalize,10),e.pathFilters.add(t.PathFilters.prefix,20)}(u=t.Loader||(t.Loader={})),t.MathJax=i.MathJax,void 0===t.MathJax.loader){(0,i.combineDefaults)(t.MathJax.config,"loader",{paths:{mathjax:u.getRoot()},source:{},dependencies:{},provides:{},load:[],ready:u.defaultReady.bind(u),failed:function(e){return console.log("MathJax(".concat(e.package||"?","): ").concat(e.message))},require:null,pathFilters:[],versionWarnings:!0}),(0,i.combineWithMathJax)({loader:u});try{for(var d=o(t.MathJax.config.loader.pathFilters),p=d.next();!p.done;p=d.next()){var f=p.value;Array.isArray(f)?u.pathFilters.add(f[0],f[1]):u.pathFilters.add(f)}}catch(e){a={error:e}}finally{try{p&&!p.done&&(n=d.return)&&n.call(d)}finally{if(a)throw a.error}}}t.CONFIG=t.MathJax.config.loader},265:function(e,t,r){var a,n=this&&this.__extends||(a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},a(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var a,n,o=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(a=o.next()).done;)i.push(a.value)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},l=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var a,n=0,o=t.length;n<o;n++)!a&&n in t||(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Package=t.PackageError=void 0;var s=r(235),u=function(e){function t(t,r){var a=e.call(this,t)||this;return a.package=r,a}return n(t,e),t}(Error);t.PackageError=u;var c=function(){function e(t,r){void 0===r&&(r=!1),this.isLoaded=!1,this.isLoading=!1,this.hasFailed=!1,this.dependents=[],this.dependencies=[],this.dependencyCount=0,this.provided=[],this.name=t,this.noLoad=r,e.packages.set(t,this),this.promise=this.makePromise(this.makeDependencies())}return Object.defineProperty(e.prototype,"canLoad",{get:function(){return 0===this.dependencyCount&&!this.noLoad&&!this.isLoading&&!this.hasFailed},enumerable:!1,configurable:!0}),e.resolvePath=function(e,t){void 0===t&&(t=!0);var r={name:e,original:e,addExtension:t};return s.Loader.pathFilters.execute(r),r.name},e.loadAll=function(){var e,t;try{for(var r=o(this.packages.values()),a=r.next();!a.done;a=r.next()){var n=a.value;n.canLoad&&n.load()}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}},e.prototype.makeDependencies=function(){var t,r,a=[],n=e.packages,u=this.noLoad,c=this.name,d=[];s.CONFIG.dependencies.hasOwnProperty(c)?d.push.apply(d,l([],i(s.CONFIG.dependencies[c]),!1)):"core"!==c&&d.push("core");try{for(var p=o(d),f=p.next();!f.done;f=p.next()){var m=f.value,h=n.get(m)||new e(m,u);this.dependencies.indexOf(h)<0&&(h.addDependent(this,u),this.dependencies.push(h),h.isLoaded||(this.dependencyCount++,a.push(h.promise)))}}catch(e){t={error:e}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}return a},e.prototype.makePromise=function(e){var t=this,r=new Promise((function(e,r){t.resolve=e,t.reject=r})),a=s.CONFIG[this.name]||{};return a.ready&&(r=r.then((function(e){return a.ready(t.name)}))),e.length&&(e.push(r),r=Promise.all(e).then((function(e){return e.join(", ")}))),a.failed&&r.catch((function(e){return a.failed(new u(e,t.name))})),r},e.prototype.load=function(){if(!this.isLoaded&&!this.isLoading&&!this.noLoad){this.isLoading=!0;var t=e.resolvePath(this.name);s.CONFIG.require?this.loadCustom(t):this.loadScript(t)}},e.prototype.loadCustom=function(e){var t=this;try{var r=s.CONFIG.require(e);r instanceof Promise?r.then((function(){return t.checkLoad()})).catch((function(r){return t.failed("Can't load \""+e+'"\n'+r.message.trim())})):this.checkLoad()}catch(e){this.failed(e.message)}},e.prototype.loadScript=function(e){var t=this,r=document.createElement("script");r.src=e,r.charset="UTF-8",r.onload=function(e){return t.checkLoad()},r.onerror=function(r){return t.failed("Can't load \""+e+'"')},document.head.appendChild(r)},e.prototype.loaded=function(){var e,t,r,a;this.isLoaded=!0,this.isLoading=!1;try{for(var n=o(this.dependents),i=n.next();!i.done;i=n.next()){i.value.requirementSatisfied()}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}try{for(var l=o(this.provided),s=l.next();!s.done;s=l.next()){s.value.loaded()}}catch(e){r={error:e}}finally{try{s&&!s.done&&(a=l.return)&&a.call(l)}finally{if(r)throw r.error}}this.resolve(this.name)},e.prototype.failed=function(e){this.hasFailed=!0,this.isLoading=!1,this.reject(new u(e,this.name))},e.prototype.checkLoad=function(){var e=this;((s.CONFIG[this.name]||{}).checkReady||function(){return Promise.resolve()})().then((function(){return e.loaded()})).catch((function(t){return e.failed(t)}))},e.prototype.requirementSatisfied=function(){this.dependencyCount&&(this.dependencyCount--,this.canLoad&&this.load())},e.prototype.provides=function(t){var r,a;void 0===t&&(t=[]);try{for(var n=o(t),i=n.next();!i.done;i=n.next()){var l=i.value,u=e.packages.get(l);u||(s.CONFIG.dependencies[l]||(s.CONFIG.dependencies[l]=[]),s.CONFIG.dependencies[l].push(l),(u=new e(l,!0)).isLoading=!0),this.provided.push(u)}}catch(e){r={error:e}}finally{try{i&&!i.done&&(a=n.return)&&a.call(n)}finally{if(r)throw r.error}}},e.prototype.addDependent=function(e,t){this.dependents.push(e),t||this.checkNoLoad()},e.prototype.checkNoLoad=function(){var e,t;if(this.noLoad){this.noLoad=!1;try{for(var r=o(this.dependencies),a=r.next();!a.done;a=r.next()){a.value.checkNoLoad()}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}}},e.packages=new Map,e}();t.Package=c},2388:function(e,t,r){var a=this&&this.__assign||function(){return a=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},a.apply(this,arguments)},n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var a,n,o=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(a=o.next()).done;)i.push(a.value)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},i=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var a,n=0,o=t.length;n<o;n++)!a&&n in t||(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.CONFIG=t.MathJax=t.Startup=void 0;var l,s=r(9515),u=r(8666),c=r(7233);!function(e){var l,s,c=new u.PrioritizedList;function p(t){return l.visitTree(t,e.document)}function f(){l=new t.MathJax._.core.MmlTree.SerializedMmlVisitor.SerializedMmlVisitor,s=t.MathJax._.mathjax.mathjax,e.input=v(),e.output=k(),e.adaptor=S(),e.handler&&s.handlers.unregister(e.handler),e.handler=w(),e.handler&&(s.handlers.register(e.handler),e.document=A())}function m(){var t,r;e.input&&e.output&&h();var a=e.output?e.output.name.toLowerCase():"";try{for(var o=n(e.input),i=o.next();!i.done;i=o.next()){var l=i.value,s=l.name.toLowerCase();y(s,l),b(s,l),e.output&&g(s,a,l)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}}function h(){t.MathJax.typeset=function(t){void 0===t&&(t=null),e.document.options.elements=t,e.document.reset(),e.document.render()},t.MathJax.typesetPromise=function(t){return void 0===t&&(t=null),e.document.options.elements=t,e.document.reset(),s.handleRetriesFor((function(){e.document.render()}))},t.MathJax.typesetClear=function(t){void 0===t&&(t=null),t?e.document.clearMathItemsWithin(t):e.document.clear()}}function g(r,a,n){var o=r+"2"+a;t.MathJax[o]=function(t,r){return void 0===r&&(r={}),r.format=n.name,e.document.convert(t,r)},t.MathJax[o+"Promise"]=function(t,r){return void 0===r&&(r={}),r.format=n.name,s.handleRetriesFor((function(){return e.document.convert(t,r)}))},t.MathJax[a+"Stylesheet"]=function(){return e.output.styleSheet(e.document)},"getMetricsFor"in e.output&&(t.MathJax.getMetricsFor=function(t,r){return e.output.getMetricsFor(t,r)})}function y(r,a){var n=t.MathJax._.core.MathItem.STATE;t.MathJax[r+"2mml"]=function(t,r){return void 0===r&&(r={}),r.end=n.CONVERT,r.format=a.name,p(e.document.convert(t,r))},t.MathJax[r+"2mmlPromise"]=function(t,r){return void 0===r&&(r={}),r.end=n.CONVERT,r.format=a.name,s.handleRetriesFor((function(){return p(e.document.convert(t,r))}))}}function b(e,r){t.MathJax[e+"Reset"]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r.reset.apply(r,i([],o(e),!1))}}function v(){var r,a,o=[];try{for(var i=n(t.CONFIG.input),l=i.next();!l.done;l=i.next()){var s=l.value,u=e.constructors[s];if(!u)throw Error('Input Jax "'+s+'" is not defined (has it been loaded?)');o.push(new u(t.MathJax.config[s]))}}catch(e){r={error:e}}finally{try{l&&!l.done&&(a=i.return)&&a.call(i)}finally{if(r)throw r.error}}return o}function k(){var r=t.CONFIG.output;if(!r)return null;var a=e.constructors[r];if(!a)throw Error('Output Jax "'+r+'" is not defined (has it been loaded?)');return new a(t.MathJax.config[r])}function S(){var r=t.CONFIG.adaptor;if(!r||"none"===r)return null;var a=e.constructors[r];if(!a)throw Error('DOMAdaptor "'+r+'" is not defined (has it been loaded?)');return a(t.MathJax.config[r])}function w(){var r,a,o=t.CONFIG.handler;if(!o||"none"===o||!e.adaptor)return null;var i=e.constructors[o];if(!i)throw Error('Handler "'+o+'" is not defined (has it been loaded?)');var l=new i(e.adaptor,5);try{for(var s=n(c),u=s.next();!u.done;u=s.next()){l=u.value.item(l)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(r)throw r.error}}return l}function A(r){return void 0===r&&(r=null),s.document(r||t.CONFIG.document,a(a({},t.MathJax.config.options),{InputJax:e.input,OutputJax:e.output}))}e.constructors={},e.input=[],e.output=null,e.handler=null,e.adaptor=null,e.elements=null,e.document=null,e.promise=new Promise((function(t,r){e.promiseResolve=t,e.promiseReject=r})),e.pagePromise=new Promise((function(e,t){var a=r.g.document;if(a&&a.readyState&&"complete"!==a.readyState&&"interactive"!==a.readyState){var n=function(){return e()};a.defaultView.addEventListener("load",n,!0),a.defaultView.addEventListener("DOMContentLoaded",n,!0)}else e()})),e.toMML=p,e.registerConstructor=function(t,r){e.constructors[t]=r},e.useHandler=function(e,r){void 0===r&&(r=!1),t.CONFIG.handler&&!r||(t.CONFIG.handler=e)},e.useAdaptor=function(e,r){void 0===r&&(r=!1),t.CONFIG.adaptor&&!r||(t.CONFIG.adaptor=e)},e.useInput=function(e,r){void 0===r&&(r=!1),d&&!r||t.CONFIG.input.push(e)},e.useOutput=function(e,r){void 0===r&&(r=!1),t.CONFIG.output&&!r||(t.CONFIG.output=e)},e.extendHandler=function(e,t){void 0===t&&(t=10),c.add(e,t)},e.defaultReady=function(){f(),m(),e.pagePromise.then((function(){return t.CONFIG.pageReady()})).then((function(){return e.promiseResolve()})).catch((function(t){return e.promiseReject(t)}))},e.defaultPageReady=function(){return t.CONFIG.typeset&&t.MathJax.typesetPromise?t.MathJax.typesetPromise(t.CONFIG.elements):Promise.resolve()},e.getComponents=f,e.makeMethods=m,e.makeTypesetMethods=h,e.makeOutputMethods=g,e.makeMmlMethods=y,e.makeResetMethod=b,e.getInputJax=v,e.getOutputJax=k,e.getAdaptor=S,e.getHandler=w,e.getDocument=A}(l=t.Startup||(t.Startup={})),t.MathJax=s.MathJax,void 0===t.MathJax._.startup&&((0,s.combineDefaults)(t.MathJax.config,"startup",{input:[],output:"",handler:null,adaptor:null,document:"undefined"==typeof document?"":document,elements:null,typeset:!0,ready:l.defaultReady.bind(l),pageReady:l.defaultPageReady.bind(l)}),(0,s.combineWithMathJax)({startup:l,options:{}}),t.MathJax.config.startup.invalidOption&&(c.OPTIONS.invalidOption=t.MathJax.config.startup.invalidOption),t.MathJax.config.startup.optionError&&(c.OPTIONS.optionError=t.MathJax.config.startup.optionError)),t.CONFIG=t.MathJax.config.startup;var d=0!==t.CONFIG.input.length},3282:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="3.2.2"},5009:function(e,t){var r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractDOMAdaptor=void 0;var a=function(){function e(e){void 0===e&&(e=null),this.document=e}return e.prototype.node=function(e,t,a,n){var o,i;void 0===t&&(t={}),void 0===a&&(a=[]);var l=this.create(e,n);this.setAttributes(l,t);try{for(var s=r(a),u=s.next();!u.done;u=s.next()){var c=u.value;this.append(l,c)}}catch(e){o={error:e}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}return l},e.prototype.setAttributes=function(e,t){var a,n,o,i,l,s;if(t.style&&"string"!=typeof t.style)try{for(var u=r(Object.keys(t.style)),c=u.next();!c.done;c=u.next()){var d=c.value;this.setStyle(e,d.replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()})),t.style[d])}}catch(e){a={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(a)throw a.error}}if(t.properties)try{for(var p=r(Object.keys(t.properties)),f=p.next();!f.done;f=p.next()){e[d=f.value]=t.properties[d]}}catch(e){o={error:e}}finally{try{f&&!f.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}try{for(var m=r(Object.keys(t)),h=m.next();!h.done;h=m.next()){"style"===(d=h.value)&&"string"!=typeof t.style||"properties"===d||this.setAttribute(e,d,t[d])}}catch(e){l={error:e}}finally{try{h&&!h.done&&(s=m.return)&&s.call(m)}finally{if(l)throw l.error}}},e.prototype.replace=function(e,t){return this.insert(e,t),this.remove(t),t},e.prototype.childNode=function(e,t){return this.childNodes(e)[t]},e.prototype.allClasses=function(e){var t=this.getAttribute(e,"class");return t?t.replace(/ +/g," ").replace(/^ /,"").replace(/ $/,"").split(/ /):[]},e}();t.AbstractDOMAdaptor=a},3494:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractFindMath=void 0;var a=r(7233),n=function(){function e(e){var t=this.constructor;this.options=(0,a.userOptions)((0,a.defaultOptions)({},t.OPTIONS),e)}return e.OPTIONS={},e}();t.AbstractFindMath=n},3670:function(e,t,r){var a,n=this&&this.__extends||(a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},a(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractHandler=void 0;var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(r(5722).AbstractMathDocument),i=function(){function e(e,t){void 0===t&&(t=5),this.documentClass=o,this.adaptor=e,this.priority=t}return Object.defineProperty(e.prototype,"name",{get:function(){return this.constructor.NAME},enumerable:!1,configurable:!0}),e.prototype.handlesDocument=function(e){return!1},e.prototype.create=function(e,t){return new this.documentClass(e,this.adaptor,t)},e.NAME="generic",e}();t.AbstractHandler=i},805:function(e,t,r){var a,n=this&&this.__extends||(a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},a(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.HandlerList=void 0;var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.register=function(e){return this.add(e,e.priority)},t.prototype.unregister=function(e){this.remove(e)},t.prototype.handlesDocument=function(e){var t,r;try{for(var a=o(this),n=a.next();!n.done;n=a.next()){var i=n.value.item;if(i.handlesDocument(e))return i}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}throw new Error("Can't find handler for document")},t.prototype.document=function(e,t){return void 0===t&&(t=null),this.handlesDocument(e).create(e,t)},t}(r(8666).PrioritizedList);t.HandlerList=i},9206:function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractInputJax=void 0;var a=r(7233),n=r(7525),o=function(){function e(e){void 0===e&&(e={}),this.adaptor=null,this.mmlFactory=null;var t=this.constructor;this.options=(0,a.userOptions)((0,a.defaultOptions)({},t.OPTIONS),e),this.preFilters=new n.FunctionList,this.postFilters=new n.FunctionList}return Object.defineProperty(e.prototype,"name",{get:function(){return this.constructor.NAME},enumerable:!1,configurable:!0}),e.prototype.setAdaptor=function(e){this.adaptor=e},e.prototype.setMmlFactory=function(e){this.mmlFactory=e},e.prototype.initialize=function(){},e.prototype.reset=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},Object.defineProperty(e.prototype,"processStrings",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.findMath=function(e,t){return[]},e.prototype.executeFilters=function(e,t,r,a){var n={math:t,document:r,data:a};return e.execute(n),n.data},e.NAME="generic",e.OPTIONS={},e}();t.AbstractInputJax=o},5722:function(e,t,r){var a,n=this&&this.__extends||(a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},a(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var a,n,o=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(a=o.next()).done;)i.push(a.value)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},l=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var a,n=0,o=t.length;n<o;n++)!a&&n in t||(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractMathDocument=t.resetAllOptions=t.resetOptions=t.RenderList=void 0;var s=r(7233),u=r(9206),c=r(2975),d=r(9e3),p=r(4474),f=r(3909),m=r(6751),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.create=function(e){var t,r,a=new this;try{for(var n=o(Object.keys(e)),l=n.next();!l.done;l=n.next()){var s=l.value,u=i(this.action(s,e[s]),2),c=u[0],d=u[1];d&&a.add(c,d)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return a},t.action=function(e,t){var r,a,n,o,l,s,u=!0,c=t[0];if(1===t.length||"boolean"==typeof t[1])2===t.length&&(u=t[1]),l=(r=i(this.methodActions(e),2))[0],s=r[1];else if("string"==typeof t[1])if("string"==typeof t[2]){4===t.length&&(u=t[3]);var d=i(t.slice(1),2),p=d[0],f=d[1];l=(a=i(this.methodActions(p,f),2))[0],s=a[1]}else 3===t.length&&(u=t[2]),l=(n=i(this.methodActions(t[1]),2))[0],s=n[1];else 4===t.length&&(u=t[3]),l=(o=i(t.slice(1),2))[0],s=o[1];return[{id:e,renderDoc:l,renderMath:s,convert:u},c]},t.methodActions=function(e,t){return void 0===t&&(t=e),[function(t){return e&&t[e](),!1},function(e,r){return t&&e[t](r),!1}]},t.prototype.renderDoc=function(e,t){var r,a;void 0===t&&(t=p.STATE.UNPROCESSED);try{for(var n=o(this.items),i=n.next();!i.done;i=n.next()){var l=i.value;if(l.priority>=t&&l.item.renderDoc(e))return}}catch(e){r={error:e}}finally{try{i&&!i.done&&(a=n.return)&&a.call(n)}finally{if(r)throw r.error}}},t.prototype.renderMath=function(e,t,r){var a,n;void 0===r&&(r=p.STATE.UNPROCESSED);try{for(var i=o(this.items),l=i.next();!l.done;l=i.next()){var s=l.value;if(s.priority>=r&&s.item.renderMath(e,t))return}}catch(e){a={error:e}}finally{try{l&&!l.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}},t.prototype.renderConvert=function(e,t,r){var a,n;void 0===r&&(r=p.STATE.LAST);try{for(var i=o(this.items),l=i.next();!l.done;l=i.next()){var s=l.value;if(s.priority>r)return;if(s.item.convert&&s.item.renderMath(e,t))return}}catch(e){a={error:e}}finally{try{l&&!l.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}},t.prototype.findID=function(e){var t,r;try{for(var a=o(this.items),n=a.next();!n.done;n=a.next()){var i=n.value;if(i.item.id===e)return i.item}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return null},t}(r(8666).PrioritizedList);t.RenderList=h,t.resetOptions={all:!1,processed:!1,inputJax:null,outputJax:null},t.resetAllOptions={all:!0,processed:!0,inputJax:[],outputJax:[]};var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.compile=function(e){return null},t}(u.AbstractInputJax),y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.typeset=function(e,t){return void 0===t&&(t=null),null},t.prototype.escaped=function(e,t){return null},t}(c.AbstractOutputJax),b=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(d.AbstractMathList),v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(p.AbstractMathItem),k=function(){function e(t,r,a){var n=this,o=this.constructor;this.document=t,this.options=(0,s.userOptions)((0,s.defaultOptions)({},o.OPTIONS),a),this.math=new(this.options.MathList||b),this.renderActions=h.create(this.options.renderActions),this.processed=new e.ProcessBits,this.outputJax=this.options.OutputJax||new y;var i=this.options.InputJax||[new g];Array.isArray(i)||(i=[i]),this.inputJax=i,this.adaptor=r,this.outputJax.setAdaptor(r),this.inputJax.map((function(e){return e.setAdaptor(r)})),this.mmlFactory=this.options.MmlFactory||new f.MmlFactory,this.inputJax.map((function(e){return e.setMmlFactory(n.mmlFactory)})),this.outputJax.initialize(),this.inputJax.map((function(e){return e.initialize()}))}return Object.defineProperty(e.prototype,"kind",{get:function(){return this.constructor.KIND},enumerable:!1,configurable:!0}),e.prototype.addRenderAction=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var a=i(h.action(e,t),2),n=a[0],o=a[1];this.renderActions.add(n,o)},e.prototype.removeRenderAction=function(e){var t=this.renderActions.findID(e);t&&this.renderActions.remove(t)},e.prototype.render=function(){return this.renderActions.renderDoc(this),this},e.prototype.rerender=function(e){return void 0===e&&(e=p.STATE.RERENDER),this.state(e-1),this.render(),this},e.prototype.convert=function(e,t){void 0===t&&(t={});var r=(0,s.userOptions)({format:this.inputJax[0].name,display:!0,end:p.STATE.LAST,em:16,ex:8,containerWidth:null,lineWidth:1e6,scale:1,family:""},t),a=r.format,n=r.display,o=r.end,i=r.ex,l=r.em,u=r.containerWidth,c=r.lineWidth,d=r.scale,f=r.family;null===u&&(u=80*i);var m=this.inputJax.reduce((function(e,t){return t.name===a?t:e}),null),h=new this.options.MathItem(e,m,n);return h.start.node=this.adaptor.body(this.document),h.setMetrics(l,i,u,c,d),this.outputJax.options.mtextInheritFont&&(h.outputData.mtextFamily=f),this.outputJax.options.merrorInheritFont&&(h.outputData.merrorFamily=f),h.convert(this,o),h.typesetRoot||h.root},e.prototype.findMath=function(e){return void 0===e&&(e=null),this.processed.set("findMath"),this},e.prototype.compile=function(){var e,t,r,a;if(!this.processed.isSet("compile")){var n=[];try{for(var i=o(this.math),l=i.next();!l.done;l=i.next()){var s=l.value;this.compileMath(s),void 0!==s.inputData.recompile&&n.push(s)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}try{for(var u=o(n),c=u.next();!c.done;c=u.next()){var d=(s=c.value).inputData.recompile;s.state(d.state),s.inputData.recompile=d,this.compileMath(s)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(r)throw r.error}}this.processed.set("compile")}return this},e.prototype.compileMath=function(e){try{e.compile(this)}catch(t){if(t.retry||t.restart)throw t;this.options.compileError(this,e,t),e.inputData.error=t}},e.prototype.compileError=function(e,t){e.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")])])]),e.display&&e.root.attributes.set("display","block"),e.inputData.error=t.message},e.prototype.typeset=function(){var e,t;if(!this.processed.isSet("typeset")){try{for(var r=o(this.math),a=r.next();!a.done;a=r.next()){var n=a.value;try{n.typeset(this)}catch(e){if(e.retry||e.restart)throw e;this.options.typesetError(this,n,e),n.outputData.error=e}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.processed.set("typeset")}return this},e.prototype.typesetError=function(e,t){e.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")])]),e.display&&this.adaptor.setAttributes(e.typesetRoot,{style:{display:"block",margin:"1em 0","text-align":"center"}}),e.outputData.error=t.message},e.prototype.getMetrics=function(){return this.processed.isSet("getMetrics")||(this.outputJax.getMetrics(this),this.processed.set("getMetrics")),this},e.prototype.updateDocument=function(){var e,t;if(!this.processed.isSet("updateDocument")){try{for(var r=o(this.math.reversed()),a=r.next();!a.done;a=r.next()){a.value.updateDocument(this)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.processed.set("updateDocument")}return this},e.prototype.removeFromDocument=function(e){return void 0===e&&(e=!1),this},e.prototype.state=function(e,t){var r,a;void 0===t&&(t=!1);try{for(var n=o(this.math),i=n.next();!i.done;i=n.next()){i.value.state(e,t)}}catch(e){r={error:e}}finally{try{i&&!i.done&&(a=n.return)&&a.call(n)}finally{if(r)throw r.error}}return e<p.STATE.INSERTED&&this.processed.clear("updateDocument"),e<p.STATE.TYPESET&&(this.processed.clear("typeset"),this.processed.clear("getMetrics")),e<p.STATE.COMPILED&&this.processed.clear("compile"),this},e.prototype.reset=function(e){var r;return void 0===e&&(e={processed:!0}),(e=(0,s.userOptions)(Object.assign({},t.resetOptions),e)).all&&Object.assign(e,t.resetAllOptions),e.processed&&this.processed.reset(),e.inputJax&&this.inputJax.forEach((function(t){return t.reset.apply(t,l([],i(e.inputJax),!1))})),e.outputJax&&(r=this.outputJax).reset.apply(r,l([],i(e.outputJax),!1)),this},e.prototype.clear=function(){return this.reset(),this.math.clear(),this},e.prototype.concat=function(e){return this.math.merge(e),this},e.prototype.clearMathItemsWithin=function(e){var t,r=this.getMathItemsWithin(e);return(t=this.math).remove.apply(t,l([],i(r),!1)),r},e.prototype.getMathItemsWithin=function(e){var t,r,a,n;Array.isArray(e)||(e=[e]);var i=this.adaptor,l=[],s=i.getElements(e,this.document);try{e:for(var u=o(this.math),c=u.next();!c.done;c=u.next()){var d=c.value;try{for(var p=(a=void 0,o(s)),f=p.next();!f.done;f=p.next()){var m=f.value;if(d.start.node&&i.contains(m,d.start.node)){l.push(d);continue e}}}catch(e){a={error:e}}finally{try{f&&!f.done&&(n=p.return)&&n.call(p)}finally{if(a)throw a.error}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}return l},e.KIND="MathDocument",e.OPTIONS={OutputJax:null,InputJax:null,MmlFactory:null,MathList:b,MathItem:v,compileError:function(e,t,r){e.compileError(t,r)},typesetError:function(e,t,r){e.typesetError(t,r)},renderActions:(0,s.expandable)({find:[p.STATE.FINDMATH,"findMath","",!1],compile:[p.STATE.COMPILED],metrics:[p.STATE.METRICS,"getMetrics","",!1],typeset:[p.STATE.TYPESET],update:[p.STATE.INSERTED,"updateDocument",!1]})},e.ProcessBits=(0,m.BitFieldClass)("findMath","compile","getMetrics","typeset","updateDocument"),e}();t.AbstractMathDocument=k},4474:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.newState=t.STATE=t.AbstractMathItem=t.protoItem=void 0,t.protoItem=function(e,t,r,a,n,o,i){return void 0===i&&(i=null),{open:e,math:t,close:r,n:a,start:{n:n},end:{n:o},display:i}};var r=function(){function e(e,r,a,n,o){void 0===a&&(a=!0),void 0===n&&(n={i:0,n:0,delim:""}),void 0===o&&(o={i:0,n:0,delim:""}),this.root=null,this.typesetRoot=null,this.metrics={},this.inputData={},this.outputData={},this._state=t.STATE.UNPROCESSED,this.math=e,this.inputJax=r,this.display=a,this.start=n,this.end=o,this.root=null,this.typesetRoot=null,this.metrics={},this.inputData={},this.outputData={}}return Object.defineProperty(e.prototype,"isEscaped",{get:function(){return null===this.display},enumerable:!1,configurable:!0}),e.prototype.render=function(e){e.renderActions.renderMath(this,e)},e.prototype.rerender=function(e,r){void 0===r&&(r=t.STATE.RERENDER),this.state()>=r&&this.state(r-1),e.renderActions.renderMath(this,e,r)},e.prototype.convert=function(e,r){void 0===r&&(r=t.STATE.LAST),e.renderActions.renderConvert(this,e,r)},e.prototype.compile=function(e){this.state()<t.STATE.COMPILED&&(this.root=this.inputJax.compile(this,e),this.state(t.STATE.COMPILED))},e.prototype.typeset=function(e){this.state()<t.STATE.TYPESET&&(this.typesetRoot=e.outputJax[this.isEscaped?"escaped":"typeset"](this,e),this.state(t.STATE.TYPESET))},e.prototype.updateDocument=function(e){},e.prototype.removeFromDocument=function(e){void 0===e&&(e=!1)},e.prototype.setMetrics=function(e,t,r,a,n){this.metrics={em:e,ex:t,containerWidth:r,lineWidth:a,scale:n}},e.prototype.state=function(e,r){return void 0===e&&(e=null),void 0===r&&(r=!1),null!=e&&(e<t.STATE.INSERTED&&this._state>=t.STATE.INSERTED&&this.removeFromDocument(r),e<t.STATE.TYPESET&&this._state>=t.STATE.TYPESET&&(this.outputData={}),e<t.STATE.COMPILED&&this._state>=t.ST