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