UNPKG

@alan-ai/alan-sdk-web

Version:

Alan Web SDK: a lightweight JavaScript library for adding a voice experience to your website or web application

26 lines (23 loc) 9.41 MB
!function(A,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():A.alanBtn=e()}(this,function(){ /*! Bundled license information: lodash/lodash.js: (** * @license * Lodash <https://lodash.com/> * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> * Released under MIT license <https://lodash.com/license> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors *) juice/lib/utils.js: (** * Returns an array of the selectors. * * @license Sizzle CSS Selector Engine - MIT * @param {String} selectorText from mensch * @api public *) dompurify/dist/purify.cjs.js: (*! @license DOMPurify 3.4.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.1/LICENSE *) */ return window.MathJax={startup:{pageReady:function(){return window.mj=MathJax,MathJax.startup.defaultPageReady()}},tex:{inlineMath:[["$","$"],["\\(","\\)"]],processEscapes:!0}},function(A){var e={};function t(Q){if(e[Q])return e[Q].exports;var n=e[Q]={i:Q,l:!1,exports:{}};return A[Q].call(n.exports,n,n.exports,t),n.l=!0,n.exports}t.m=A,t.c=e,t.d=function(A,e,Q){t.o(A,e)||Object.defineProperty(A,e,{enumerable:!0,get:Q})},t.r=function(A){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},t.t=function(A,e){if(1&e&&(A=t(A)),8&e)return A;if(4&e&&"object"==typeof A&&A&&A.__esModule)return A;var Q=Object.create(null);if(t.r(Q),Object.defineProperty(Q,"default",{enumerable:!0,value:A}),2&e&&"string"!=typeof A)for(var n in A)t.d(Q,n,function(e){return A[e]}.bind(null,n));return Q},t.n=function(A){var e=A&&A.__esModule?function(){return A.default}:function(){return A};return t.d(e,"a",e),e},t.o=function(A,e){return Object.prototype.hasOwnProperty.call(A,e)},t.p="",t(t.s=230)}([function(A,e,t){"use strict";var Q,n=this&&this.__extends||(Q=function(A,e){return(Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)e.hasOwnProperty(t)&&(A[t]=e[t])})(A,e)},function(A,e){function t(){this.constructor=A}Q(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}),i=this&&this.__assign||function(){return(i=Object.assign||function(A){for(var e,t=1,Q=arguments.length;t<Q;t++)for(var n in e=arguments[t])Object.prototype.hasOwnProperty.call(e,n)&&(A[n]=e[n]);return A}).apply(this,arguments)},r=this&&this.__values||function(A){var e="function"==typeof Symbol&&A[Symbol.iterator],t=0;return e?e.call(A):{next:function(){return A&&t>=A.length&&(A=void 0),{value:A&&A[t++],done:!A}}}},o=this&&this.__read||function(A,e){var t="function"==typeof Symbol&&A[Symbol.iterator];if(!t)return A;var Q,n,i=t.call(A),r=[];try{for(;(void 0===e||0<e--)&&!(Q=i.next()).done;)r.push(Q.value)}catch(A){n={error:A}}finally{try{Q&&!Q.done&&(t=i.return)&&t.call(i)}finally{if(n)throw n.error}}return r};Object.defineProperty(e,"__esModule",{value:!0});var g=t(17),a=t(45);e.TEXCLASS={ORD:0,OP:1,BIN:2,REL:3,OPEN:4,CLOSE:5,PUNCT:6,INNER:7,VCENTER:8,NONE:-1},e.TEXCLASSNAMES=["ORD","OP","BIN","REL","OPEN","CLOSE","PUNCT","INNER","VCENTER"];var s=["","thinmathspace","mediummathspace","thickmathspace"],B=[[0,-1,2,3,0,0,0,1],[-1,-1,0,3,0,0,0,1],[2,2,0,0,2,0,0,2],[3,3,0,0,3,0,0,3],[0,0,0,0,0,0,0,0],[0,-1,2,3,0,0,0,1],[1,1,0,1,1,1,1,1],[1,-1,2,3,1,0,1,1]];e.indentAttributes=["indentalign","indentalignfirst","indentshift","indentshiftfirst"];var E,I=(n(C,E=a.AbstractNode),Object.defineProperty(C.prototype,"isToken",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(C.prototype,"isEmbellished",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(C.prototype,"isSpacelike",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(C.prototype,"linebreakContainer",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(C.prototype,"hasNewLine",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(C.prototype,"arity",{get:function(){return 1/0},enumerable:!0,configurable:!0}),Object.defineProperty(C.prototype,"isInferred",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(C.prototype,"Parent",{get:function(){for(var A=this.parent;A&&A.notParent;)A=A.Parent;return A},enumerable:!0,configurable:!0}),Object.defineProperty(C.prototype,"notParent",{get:function(){return!1},enumerable:!0,configurable:!0}),C.prototype.setChildren=function(A){return this.arity<0?this.childNodes[0].setChildren(A):E.prototype.setChildren.call(this,A)},C.prototype.appendChild=function(A){return this.arity<0?(this.childNodes[0].appendChild(A),A):E.prototype.appendChild.call(this,A)},C.prototype.replaceChild=function(A,e){return this.arity<0?(this.childNodes[0].replaceChild(A,e),A):E.prototype.replaceChild.call(this,A,e)},C.prototype.core=function(){return this},C.prototype.coreMO=function(){return this},C.prototype.coreIndex=function(){return 0},C.prototype.childPosition=function(){for(var A,e,t=this,Q=t.parent;Q&&Q.notParent;)Q=(t=Q).parent;if(Q){var n=0;try{for(var i=r(Q.childNodes),o=i.next();!o.done;o=i.next()){if(o.value===t)return n;n++}}catch(e){A={error:e}}finally{try{o&&!o.done&&(e=i.return)&&e.call(i)}finally{if(A)throw A.error}}}return null},C.prototype.setTeXclass=function(A){return this.getPrevClass(A),null!=this.texClass?this:A},C.prototype.updateTeXclass=function(A){A&&(this.prevClass=A.prevClass,this.prevLevel=A.prevLevel,A.prevClass=A.prevLevel=null,this.texClass=A.texClass)},C.prototype.getPrevClass=function(A){A&&(this.prevClass=A.texClass,this.prevLevel=A.attributes.get("scriptlevel"))},C.prototype.texSpacing=function(){var A=null!=this.prevClass?this.prevClass:e.TEXCLASS.NONE,t=this.texClass||e.TEXCLASS.ORD;if(A===e.TEXCLASS.NONE||t===e.TEXCLASS.NONE)return"";A===e.TEXCLASS.VCENTER&&(A=e.TEXCLASS.ORD),t===e.TEXCLASS.VCENTER&&(t=e.TEXCLASS.ORD);var Q=B[A][t];return(0<this.prevLevel||0<this.attributes.get("scriptlevel"))&&0<=Q?"":s[Math.abs(Q)]},C.prototype.hasSpacingAttributes=function(){return this.isEmbellished&&this.coreMO().hasSpacingAttributes()},C.prototype.setInheritedAttributes=function(A,e,t,Q){var n,i;void 0===A&&(A={}),void 0===e&&(e=!1),void 0===t&&(t=0),void 0===Q&&(Q=!1);var g=this.attributes.getAllDefaults();try{for(var a=r(Object.keys(A)),s=a.next();!s.done;s=a.next()){var B=s.value;if(g.hasOwnProperty(B)){var E=o(A[B],2),I=E[0],c=E[1];((C.noInherit[I]||{})[this.kind]||{})[B]||this.attributes.setInherited(B,c)}}}catch(A){n={error:A}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}void 0===this.attributes.getExplicit("displaystyle")&&this.attributes.setInherited("displaystyle",e),void 0===this.attributes.getExplicit("scriptlevel")&&this.attributes.setInherited("scriptlevel",t),Q&&this.setProperty("texprimestyle",Q);var l=this.arity;if(0<=l&&l!==1/0&&(1===l&&0===this.childNodes.length||1!==l&&this.childNodes.length!==l))if(l<this.childNodes.length)this.childNodes=this.childNodes.slice(0,l);else for(;this.childNodes.length<l;)this.appendChild(this.factory.create("mrow"));this.setChildInheritedAttributes(A,e,t,Q)},C.prototype.setChildInheritedAttributes=function(A,e,t,Q){var n,i;try{for(var o=r(this.childNodes),g=o.next();!g.done;g=o.next())g.value.setInheritedAttributes(A,e,t,Q)}catch(A){n={error:A}}finally{try{g&&!g.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},C.prototype.addInheritedAttributes=function(A,e){var t,Q,n=i({},A);try{for(var o=r(Object.keys(e)),g=o.next();!g.done;g=o.next()){var a=g.value;"displaystyle"!==a&&"scriptlevel"!==a&&"style"!==a&&(n[a]=[this.kind,e[a]])}}catch(A){t={error:A}}finally{try{g&&!g.done&&(Q=o.return)&&Q.call(o)}finally{if(t)throw t.error}}return n},C.prototype.inheritAttributesFrom=function(A){var e=A.attributes,t=e.get("displaystyle"),Q=e.get("scriptlevel"),n=e.isSet("mathsize")?{mathsize:["math",e.get("mathsize")]}:{},i=A.getProperty("texprimestyle")||!1;this.setInheritedAttributes(n,t,Q,i)},C.prototype.verifyTree=function(A){if(void 0===A&&(A=null),null!==A){this.verifyAttributes(A);var e=this.arity;A.checkArity&&0<=e&&e!==1/0&&(1===e&&0===this.childNodes.length||1!==e&&this.childNodes.length!==e)&&this.mError('Wrong number of children for "'+this.kind+'" node',A,!0),this.verifyChildren(A)}},C.prototype.verifyAttributes=function(A){var e,t;if(A.checkAttributes){var Q=this.attributes,n=[];try{for(var i=r(Q.getExplicitNames()),o=i.next();!o.done;o=i.next()){var g=o.value;"data-"===g.substr(0,5)||void 0!==Q.getDefault(g)||g.match(/^(?:class|style|id|(?:xlink:)?href)$/)||n.push(g)}}catch(A){e={error:A}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}n.length&&this.mError("Unknown attributes for "+this.kind+" node: "+n.join(", "),A)}},C.prototype.verifyChildren=function(A){var e,t;try{for(var Q=r(this.childNodes),n=Q.next();!n.done;n=Q.next())n.value.verifyTree(A)}catch(A){e={error:A}}finally{try{n&&!n.done&&(t=Q.return)&&t.call(Q)}finally{if(e)throw e.error}}},C.prototype.mError=function(A,e,t){if(void 0===t&&(t=!1),!this.parent||!this.parent.isKind("merror")){var Q=this.factory.create("merror");if(e.fullErrors||t){var n=this.factory.create("mtext"),i=this.factory.create("text");i.setText(e.fullErrors?A:this.kind),n.appendChild(i),Q.appendChild(n),this.parent.replaceChild(Q,this)}else this.parent.replaceChild(Q,this),Q.appendChild(this);return Q}},C.defaults={mathbackground:g.INHERIT,mathcolor:g.INHERIT,mathsize:g.INHERIT,dir:g.INHERIT},C.noInherit={mstyle:{mpadded:{width:!0,height:!0,depth:!0,lspace:!0,voffset:!0},mtable:{width:!0,height:!0,depth:!0,align:!0}},maligngroup:{mrow:{groupalign:!0},mtable:{groupalign:!0}}},C.verifyDefaults={checkArity:!0,checkAttributes:!1,fullErrors:!1,fixMmultiscripts:!0,fixMtables:!0},C);function C(A,e,t){void 0===e&&(e={}),void 0===t&&(t=[]);var Q=E.call(this,A)||this;return Q.texClass=null,Q.prevClass=null,Q.prevLevel=null,Q.arity<0&&(Q.childNodes=[A.create("inferredMrow")],Q.childNodes[0].parent=Q),Q.setChildren(t),Q.attributes=new g.Attributes(A.getNodeClass(Q.kind).defaults,A.getNodeClass("math").defaults),Q.attributes.setList(e),Q}e.AbstractMmlNode=I;var c,l=(n(T,c=I),Object.defineProperty(T.prototype,"isToken",{get:function(){return!0},enumerable:!0,configurable:!0}),T.prototype.getText=function(){var A,e,t="";try{for(var Q=r(this.childNodes),n=Q.next();!n.done;n=Q.next()){var i=n.value;i instanceof y&&(t+=i.getText())}}catch(e){A={error:e}}finally{try{n&&!n.done&&(e=Q.return)&&e.call(Q)}finally{if(A)throw A.error}}return t},T.prototype.setChildInheritedAttributes=function(A,e,t,Q){var n,i;try{for(var o=r(this.childNodes),g=o.next();!g.done;g=o.next()){var a=g.value;a instanceof I&&a.setInheritedAttributes(A,e,t,Q)}}catch(A){n={error:A}}finally{try{g&&!g.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},T.prototype.walkTree=function(A,e){var t,Q;A(this,e);try{for(var n=r(this.childNodes),i=n.next();!i.done;i=n.next()){var o=i.value;o instanceof I&&o.walkTree(A,e)}}catch(A){t={error:A}}finally{try{i&&!i.done&&(Q=n.return)&&Q.call(n)}finally{if(t)throw t.error}}return e},T.defaults=i({},I.defaults,{mathvariant:"normal",mathsize:g.INHERIT}),T);function T(){return null!==c&&c.apply(this,arguments)||this}e.AbstractMmlTokenNode=l;var d,h=(n(u,d=I),Object.defineProperty(u.prototype,"isSpacelike",{get:function(){return this.childNodes[0].isSpacelike},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"isEmbellished",{get:function(){return this.childNodes[0].isEmbellished},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"arity",{get:function(){return-1},enumerable:!0,configurable:!0}),u.prototype.core=function(){return this.childNodes[0]},u.prototype.coreMO=function(){return this.childNodes[0].coreMO()},u.prototype.setTeXclass=function(A){return A=this.childNodes[0].setTeXclass(A),this.updateTeXclass(this.childNodes[0]),A},u.defaults=I.defaults,u);function u(){return null!==d&&d.apply(this,arguments)||this}e.AbstractMmlLayoutNode=h;var D,w=(n(p,D=I),Object.defineProperty(p.prototype,"isEmbellished",{get:function(){return this.childNodes[0].isEmbellished},enumerable:!0,configurable:!0}),p.prototype.core=function(){return this.childNodes[0]},p.prototype.coreMO=function(){return this.childNodes[0].coreMO()},p.prototype.setTeXclass=function(A){var t,Q;this.getPrevClass(A),this.texClass=e.TEXCLASS.ORD;var n=this.childNodes[0];n?this.isEmbellished||n.isKind("mi")?(A=n.setTeXclass(A),this.updateTeXclass(this.core())):(n.setTeXclass(null),A=this):A=this;try{for(var i=r(this.childNodes.slice(1)),o=i.next();!o.done;o=i.next()){var g=o.value;g&&g.setTeXclass(null)}}catch(A){t={error:A}}finally{try{o&&!o.done&&(Q=i.return)&&Q.call(i)}finally{if(t)throw t.error}}return A},p.defaults=I.defaults,p);function p(){return null!==D&&D.apply(this,arguments)||this}e.AbstractMmlBaseNode=w;var m,f=(n(M,m=a.AbstractEmptyNode),Object.defineProperty(M.prototype,"isToken",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(M.prototype,"isEmbellished",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(M.prototype,"isSpacelike",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(M.prototype,"linebreakContainer",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(M.prototype,"hasNewLine",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(M.prototype,"arity",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(M.prototype,"isInferred",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(M.prototype,"notParent",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(M.prototype,"Parent",{get:function(){return this.parent},enumerable:!0,configurable:!0}),Object.defineProperty(M.prototype,"texClass",{get:function(){return e.TEXCLASS.NONE},enumerable:!0,configurable:!0}),Object.defineProperty(M.prototype,"prevClass",{get:function(){return e.TEXCLASS.NONE},enumerable:!0,configurable:!0}),Object.defineProperty(M.prototype,"prevLevel",{get:function(){return 0},enumerable:!0,configurable:!0}),M.prototype.hasSpacingAttributes=function(){return!1},Object.defineProperty(M.prototype,"attributes",{get:function(){return null},enumerable:!0,configurable:!0}),M.prototype.core=function(){return this},M.prototype.coreMO=function(){return this},M.prototype.coreIndex=function(){return 0},M.prototype.childPosition=function(){return 0},M.prototype.setTeXclass=function(A){return A},M.prototype.texSpacing=function(){return""},M.prototype.setInheritedAttributes=function(A,e,t,Q){},M.prototype.inheritAttributesFrom=function(A){},M.prototype.verifyTree=function(A){},M.prototype.mError=function(A,e,t){void 0===t&&(t=!1)},M);function M(){return null!==m&&m.apply(this,arguments)||this}e.AbstractMmlEmptyNode=f;var L,y=(n(S,L=f),Object.defineProperty(S.prototype,"kind",{get:function(){return"text"},enumerable:!0,configurable:!0}),S.prototype.getText=function(){return this.text},S.prototype.setText=function(A){return this.text=A,this},S.prototype.toString=function(){return this.text},S);function S(){var A=null!==L&&L.apply(this,arguments)||this;return A.text="",A}e.TextNode=y;var F,N=(n(R,F=f),Object.defineProperty(R.prototype,"kind",{get:function(){return"XML"},enumerable:!0,configurable:!0}),R.prototype.getXML=function(){return this.xml},R.prototype.setXML=function(A,e){return void 0===e&&(e=null),this.xml=A,this.adaptor=e,this},R.prototype.getSerializedXML=function(){return this.adaptor.outerHTML(this.xml)},R.prototype.toString=function(){return"XML data"},R);function R(){var A=null!==F&&F.apply(this,arguments)||this;return A.xml=null,A.adaptor=null,A}e.XMLNode=N},function(A,e,t){"use strict";var Q,n=this&&this.__extends||(Q=function(A,e){return(Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)e.hasOwnProperty(t)&&(A[t]=e[t])})(A,e)},function(A,e){function t(){this.constructor=A}Q(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}),i=this&&this.__values||function(A){var e="function"==typeof Symbol&&A[Symbol.iterator],t=0;return e?e.call(A):{next:function(){return A&&t>=A.length&&(A=void 0),{value:A&&A[t++],done:!A}}}},r=this&&this.__read||function(A,e){var t="function"==typeof Symbol&&A[Symbol.iterator];if(!t)return A;var Q,n,i=t.call(A),r=[];try{for(;(void 0===e||0<e--)&&!(Q=i.next()).done;)r.push(Q.value)}catch(A){n={error:A}}finally{try{Q&&!Q.done&&(t=i.return)&&t.call(i)}finally{if(n)throw n.error}}return r};Object.defineProperty(e,"__esModule",{value:!0});var o,g=t(122),a=t(78),s=(n(B,o=g.CommonWrapper),B.prototype.toSVG=function(A){this.addChildren(this.standardSVGnode(A))},B.prototype.addChildren=function(A){var e,t,Q=0;try{for(var n=i(this.childNodes),r=n.next();!r.done;r=n.next()){var o=r.value;o.toSVG(A),o.element&&o.place(Q+o.bbox.L*o.bbox.rscale,0),Q+=(o.bbox.L+o.bbox.w+o.bbox.R)*o.bbox.rscale}}catch(A){e={error:A}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},B.prototype.standardSVGnode=function(A){var e=this.createSVGnode(A);return this.handleStyles(),this.handleScale(),this.handleColor(),this.handleAttributes(),e},B.prototype.createSVGnode=function(A){var e=this.node.attributes.get("href");if(e){A=this.adaptor.append(A,this.svg("a",{href:e}));var t=this.getBBox(),Q=t.h,n=t.d,i=t.w;this.adaptor.append(A,this.svg("rect",{"data-hitbox":!0,fill:"none",stroke:"none","pointer-events":"all",width:this.fixed(i),height:this.fixed(Q+n),y:this.fixed(-n)}))}return this.element=this.adaptor.append(A,this.svg("g",{"data-mml-node":this.node.kind})),this.element},B.prototype.handleStyles=function(){if(this.styles){var A=this.styles.cssText;A&&this.adaptor.setAttribute(this.element,"style",A)}},B.prototype.handleScale=function(){if(1!==this.bbox.rscale){var A="scale("+this.fixed(this.bbox.rscale/1e3,3)+")";this.adaptor.setAttribute(this.element,"transform",A)}},B.prototype.handleColor=function(){var A=this.adaptor,e=this.node.attributes,t=e.getExplicit("mathcolor"),Q=e.getExplicit("color"),n=e.getExplicit("mathbackground"),i=e.getExplicit("background");if((t||Q)&&(A.setAttribute(this.element,"fill",t||Q),A.setAttribute(this.element,"stroke",t||Q)),n||i){var r=this.getBBox(),o=r.h,g=r.d,a=r.w,s=this.svg("rect",{fill:n||i,x:0,y:this.fixed(-g),width:this.fixed(a),height:this.fixed(o+g),"data-bgcolor":!0}),B=A.firstChild(this.element);B?A.insert(s,B):A.append(this.element,s)}},B.prototype.handleAttributes=function(){var A,e,t,Q,n=this.node.attributes,r=n.getAllDefaults(),o=B.skipAttributes;try{for(var g=i(n.getExplicitNames()),a=g.next();!a.done;a=g.next()){var s=a.value;!1!==o[s]&&(s in r||o[s]||this.adaptor.hasAttribute(this.element,s))||this.adaptor.setAttribute(this.element,s,n.getExplicit(s))}}catch(e){A={error:e}}finally{try{a&&!a.done&&(e=g.return)&&e.call(g)}finally{if(A)throw A.error}}if(n.get("class")){var E=n.get("class").trim().split(/ +/);try{for(var I=i(E),C=I.next();!C.done;C=I.next()){var c=C.value;this.adaptor.addClass(this.element,c)}}catch(e){t={error:e}}finally{try{C&&!C.done&&(Q=I.return)&&Q.call(I)}finally{if(t)throw t.error}}}},B.prototype.place=function(A,e,t){if(void 0===t&&(t=null),A||e){t=t||this.element;var Q=this.adaptor.getAttribute(t,"transform")||"";Q="translate("+this.fixed(A)+", "+this.fixed(e)+")"+(Q?" "+Q:""),this.adaptor.setAttribute(t,"transform",Q)}},B.prototype.placeChar=function(A,e,t,Q,n){var o,g;void 0===n&&(n=null),null===n&&(n=this.variant);var a=A.toString(16).toUpperCase(),s=r(this.getVariantChar(n,A),4),B=(s[0],s[1],s[2]),E=s[3];if("p"in E){var I=E.p?"M"+E.p+"Z":"";this.place(e,t,this.adaptor.append(Q,this.charNode(n,a,I)))}else if("c"in E){var C=this.adaptor.append(Q,this.svg("g",{"data-c":a}));this.place(e,t,C),e=0;try{for(var c=i(this.unicodeChars(E.c)),l=c.next();!l.done;l=c.next()){var T=l.value;e+=this.placeChar(T,e,t,C,n)}}catch(A){o={error:A}}finally{try{l&&!l.done&&(g=c.return)&&g.call(c)}finally{if(o)throw o.error}}}else if(E.unknown){var d=String.fromCharCode(A),h=this.adaptor.append(Q,this.jax.unknownText(d,n));return this.place(e,t,h),this.jax.measureTextNodeWithCache(h,d,n).w}return B},B.prototype.charNode=function(A,e,t){return"none"!==this.jax.options.fontCache?this.useNode(A,e,t):this.pathNode(e,t)},B.prototype.pathNode=function(A,e){return this.svg("path",{"data-c":A,d:e})},B.prototype.useNode=function(A,e,t){var Q=this.svg("use"),n="#"+this.jax.fontCache.cachePath(A,e,t);return this.adaptor.setAttribute(Q,"href",n,a.XLINKNS),Q},B.prototype.drawBBox=function(){var A=this.getBBox(),e=A.w,t=A.h,Q=A.d,n=this.svg("g",{style:{opacity:.25}},[this.svg("rect",{fill:"red",height:this.fixed(t),width:this.fixed(e)}),this.svg("rect",{fill:"green",height:this.fixed(Q),width:this.fixed(e),y:this.fixed(-Q)})]),i=this.element||this.parent.element;this.adaptor.append(i,n)},B.prototype.html=function(A,e,t){return void 0===e&&(e={}),void 0===t&&(t=[]),this.jax.html(A,e,t)},B.prototype.svg=function(A,e,t){return void 0===e&&(e={}),void 0===t&&(t=[]),this.jax.svg(A,e,t)},B.prototype.text=function(A){return this.jax.text(A)},B.prototype.createMo=function(A){return o.prototype.createMo.call(this,A)},B.prototype.coreMO=function(){return o.prototype.coreMO.call(this)},B.prototype.fixed=function(A,e){return void 0===e&&(e=1),this.jax.fixed(1e3*A,e)},B.kind="unknown",B);function B(){var A=null!==o&&o.apply(this,arguments)||this;return A.element=null,A}e.SVGWrapper=s},function(A,e,t){"use strict";var Q,n=this&&this.__extends||(Q=function(A,e){return(Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)e.hasOwnProperty(t)&&(A[t]=e[t])})(A,e)},function(A,e){function t(){this.constructor=A}Q(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}),i=this&&this.__values||function(A){var e="function"==typeof Symbol&&A[Symbol.iterator],t=0;return e?e.call(A):{next:function(){return A&&t>=A.length&&(A=void 0),{value:A&&A[t++],done:!A}}}};Object.defineProperty(e,"__esModule",{value:!0});var r=t(21);!function(A){for(var t in A)e.hasOwnProperty(t)||(e[t]=A[t])}(t(21));var o,g=(n(a,o=r.FontData),a.charOptions=function(A,e){return o.charOptions.call(this,A,e)},a);function a(){return null!==o&&o.apply(this,arguments)||this}e.SVGFontData=g,e.AddPaths=function(A,e,t){var Q,n,r,o;try{for(var a=i(Object.keys(e)),s=a.next();!s.done;s=a.next()){var B=s.value,E=parseInt(B);g.charOptions(A,E).p=e[E]}}catch(A){Q={error:A}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(Q)throw Q.error}}try{for(var I=i(Object.keys(t)),C=I.next();!C.done;C=I.next())B=C.value,E=parseInt(B),g.charOptions(A,E).c=t[E]}catch(A){r={error:A}}finally{try{C&&!C.done&&(o=I.return)&&o.call(I)}finally{if(r)throw r.error}}return A}},function(A,e,t){"use strict";var Q=this&&this.__values||function(A){var e="function"==typeof Symbol&&A[Symbol.iterator],t=0;return e?e.call(A):{next:function(){return A&&t>=A.length&&(A=void 0),{value:A&&A[t++],done:!A}}}},n=this&&this.__read||function(A,e){var t="function"==typeof Symbol&&A[Symbol.iterator];if(!t)return A;var Q,n,i=t.call(A),r=[];try{for(;(void 0===e||0<e--)&&!(Q=i.next()).done;)r.push(Q.value)}catch(A){n={error:A}}finally{try{Q&&!Q.done&&(t=i.return)&&t.call(i)}finally{if(n)throw n.error}}return r},i=this&&this.__spread||function(){for(var A=[],e=0;e<arguments.length;e++)A=A.concat(n(arguments[e]));return A};Object.defineProperty(e,"__esModule",{value:!0});var r={}.constructor;function o(A){return"object"==typeof A&&null!==A&&(A.constructor===r||A.constructor===g)}e.APPEND="[+]",e.REMOVE="[-]";var g=function(){};function a(A){return Object.assign(Object.create(g.prototype),A)}function s(A){return A?Object.keys(A).concat(Object.getOwnPropertySymbols(A)):[]}function B(A){var e,t,n={};try{for(var i=Q(s(A)),r=i.next();!r.done;r=i.next()){var I=r.value,C=Object.getOwnPropertyDescriptor(A,I),c=C.value;Array.isArray(c)?C.value=E([],c,!1):o(c)&&(C.value=B(c)),C.enumerable&&(n[I]=C)}}catch(A){e={error:A}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return Object.defineProperties(A.constructor===g?a({}):{},n)}function E(A,t,n){var r,a;function I(Q){if(n&&void 0===A[Q]&&A.constructor!==g)throw"symbol"==typeof Q&&(Q=Q.toString()),new Error('Invalid option "'+Q+'" (no default value).');var r=t[Q],a=A[Q];if(!o(r)||null===a||"object"!=typeof a&&"function"!=typeof a)Array.isArray(r)?(A[Q]=[],E(A[Q],r,!1)):o(r)?A[Q]=B(r):A[Q]=r;else{var I=s(r);Array.isArray(a)&&(1===I.length&&(I[0]===e.APPEND||I[0]===e.REMOVE)&&Array.isArray(r[I[0]])||2===I.length&&I.sort().join(",")===e.APPEND+","+e.REMOVE&&Array.isArray(r[e.APPEND])&&Array.isArray(r[e.REMOVE]))?(r[e.REMOVE]&&(a=A[Q]=a.filter(function(A){return r[e.REMOVE].indexOf(A)<0})),r[e.APPEND]&&(A[Q]=i(a,r[e.APPEND]))):E(a,r,n)}}void 0===n&&(n=!0);try{for(var C=Q(s(t)),c=C.next();!c.done;c=C.next())I(c.value)}catch(a){r={error:a}}finally{try{c&&!c.done&&(a=C.return)&&a.call(C)}finally{if(r)throw r.error}}return A}function I(A){for(var e,t,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var r={};try{for(var o=Q(n),g=o.next();!g.done;g=o.next()){var a=g.value;A.hasOwnProperty(a)&&(r[a]=A[a])}}catch(A){e={error:A}}finally{try{g&&!g.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return r}e.Expandable=g,e.expandable=a,e.makeArray=function(A){return Array.isArray(A)?A:[A]},e.keys=s,e.copy=B,e.insert=E,e.defaultOptions=function(A){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.forEach(function(e){return E(A,e,!1)}),A},e.userOptions=function(A){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.forEach(function(e){return E(A,e,!0)}),A},e.selectOptions=I,e.selectOptionsFromKeys=function(A,e){return I.apply(void 0,i([A],Object.keys(e)))},e.separateOptions=function(A){for(var e,t,n,i,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];var g=[];try{for(var a=Q(r),s=a.next();!s.done;s=a.next()){var B=s.value,E={},I={};try{for(var C=(n=void 0,Q(Object.keys(A||{}))),c=C.next();!c.done;c=C.next()){var l=c.value;(void 0===B[l]?I:E)[l]=A[l]}}catch(A){n={error:A}}finally{try{c&&!c.done&&(i=C.return)&&i.call(C)}finally{if(n)throw n.error}}g.push(E),A=I}}catch(A){e={error:A}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return g.unshift(A),g}},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var Q=(n.processString=function(A,e){for(var t=A.split(n.pattern),Q=1,i=t.length;Q<i;Q+=2){var r=t[Q].charAt(0);"0"<=r&&r<="9"?(t[Q]=e[parseInt(t[Q],10)-1],"number"==typeof t[Q]&&(t[Q]=t[Q].toString())):"{"===r&&("0"<=(r=t[Q].substr(1))&&r<="9"?(t[Q]=e[parseInt(t[Q].substr(1,t[Q].length-2),10)-1],"number"==typeof t[Q]&&(t[Q]=t[Q].toString())):t[Q].match(/^\{([a-z]+):%(\d+)\|(.*)\}$/)&&(t[Q]="%"+t[Q])),null==t[Q]&&(t[Q]="???")}return t.join("")},n.pattern=/%(\d+|\{\d+\}|\{[a-z]+:\%\d+(?:\|(?:%\{\d+\}|%.|[^\}])*)+\}|.)/g,n);function n(A,e){for(var t=[],Q=2;Q<arguments.length;Q++)t[Q-2]=arguments[Q];this.id=A,this.message=n.processString(e,t)}e.default=Q},function(A,e,t){"use strict";(function(A){var t=this&&this.__values||function(A){var e="function"==typeof Symbol&&A[Symbol.iterator],t=0;return e?e.call(A):{next:function(){return A&&t>=A.length&&(A=void 0),{value:A&&A[t++],done:!A}}}};function Q(A,e){var n,i;try{for(var r=t(Object.keys(e)),o=r.next();!o.done;o=r.next()){var g=o.value;"__esModule"!==g&&("object"==typeof A[g]&&"object"==typeof e[g]?Q(A[g],e[g]):null!==e[g]&&void 0!==e[g]&&(A[g]=e[g]))}}catch(A){n={error:A}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}return A}Object.defineProperty(e,"__esModule",{value:!0}),e.combineConfig=Q,e.combineDefaults=function A(e,Q,n){var i,r;e[Q]||(e[Q]={}),e=e[Q];try{for(var o=t(Object.keys(n)),g=o.next();!g.done;g=o.next()){var a=g.value;"object"==typeof e[a]&&"object"==typeof n[a]?A(e,a,n[a]):null==e[a]&&null!=n[a]&&(e[a]=n[a])}}catch(A){i={error:A}}finally{try{g&&!g.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return e},e.combineWithMathJax=function(A){return Q(e.MathJax,A)},void 0===A.MathJax&&(A.MathJax={}),A.MathJax.version||(A.MathJax={version:"3.0.1",_:{},config:A.MathJax}),e.MathJax=A.MathJax}).call(this,t(26))},function(A,e,t){"use strict";var Q=this&&this.__values||function(A){var e="function"==typeof Symbol&&A[Symbol.iterator],t=0;return e?e.call(A):{next:function(){return A&&t>=A.length&&(A=void 0),{value:A&&A[t++],done:!A}}}},n=this&&this.__read||function(A,e){var t="function"==typeof Symbol&&A[Symbol.iterator];if(!t)return A;var Q,n,i=t.call(A),r=[];try{for(;(void 0===e||0<e--)&&!(Q=i.next()).done;)r.push(Q.value)}catch(A){n={error:A}}finally{try{Q&&!Q.done&&(t=i.return)&&t.call(i)}finally{if(n)throw n.error}}return r},i=this&&this.__spread||function(){for(var A=[],e=0;e<arguments.length;e++)A=A.concat(n(arguments[e]));return A};Object.defineProperty(e,"__esModule",{value:!0});var r,o,g,a=t(0),s=t(24);function B(A,e){var t,n;try{for(var i=Q(Object.keys(e)),r=i.next();!r.done;r=i.next()){var o=r.value,a=e[o];"texClass"===o?(A.texClass=a,A.setProperty(o,a)):"movablelimits"===o?(A.setProperty("movablelimits",a),(A.isKind("mo")||A.isKind("mstyle"))&&A.attributes.set("movablelimits",a)):"inferred"===o||(g.has(o)?A.setProperty(o,a):A.attributes.set(o,a))}}catch(A){t={error:A}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}}function E(A,e,t){(A.childNodes[e]=t)&&(t.parent=A)}function I(A,e){return A.isKind(e)}o=r=r||{},g=new Map([["autoOP",!0],["fnOP",!0],["movesupsub",!0],["subsupOK",!0],["texprimestyle",!0],["useHeight",!0],["variantForm",!0],["withDelims",!0],["open",!0],["close",!0]]),o.createEntity=function(A){return String.fromCharCode(parseInt(A,16))},o.getChildren=function(A){return A.childNodes},o.getText=function(A){return A.getText()},o.appendChildren=function(A,e){var t,n;try{for(var i=Q(e),r=i.next();!r.done;r=i.next()){var o=r.value;A.appendChild(o)}}catch(A){t={error:A}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},o.setAttribute=function(A,e,t){A.attributes.set(e,t)},o.setProperty=function(A,e,t){A.setProperty(e,t)},o.setProperties=B,o.getProperty=function(A,e){return A.getProperty(e)},o.getAttribute=function(A,e){return A.attributes.get(e)},o.removeProperties=function(A){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];A.removeProperty.apply(A,i(e))},o.getChildAt=function(A,e){return A.childNodes[e]},o.setChild=E,o.copyChildren=function(A,e){for(var t=A.childNodes,Q=0;Q<t.length;Q++)E(e,Q,t[Q])},o.copyAttributes=function(A,e){e.attributes=A.attributes,B(e,A.getAllProperties())},o.isType=I,o.isEmbellished=function(A){return A.isEmbellished},o.getTexClass=function(A){return A.texClass},o.getCoreMO=function(A){return A.coreMO()},o.isNode=function(A){return A instanceof a.AbstractMmlNode||A instanceof a.AbstractMmlEmptyNode},o.isInferred=function(A){return A.isInferred},o.getForm=function(A){var e,t;if(!I(A,"mo"))return null;var n=A,i=n.getForms();try{for(var r=Q(i),o=r.next();!o.done;o=r.next()){var g=o.value,a=s.MmlMo.OPTABLE[g][n.getText()];if(a)return a}}catch(A){e={error:A}}finally{try{o&&!o.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return null},e.default=r},function(A,e,t){"use strict";var Q=this&&this.__read||function(A,e){var t="function"==typeof Symbol&&A[Symbol.iterator];if(!t)return A;var Q,n,i=t.call(A),r=[];try{for(;(void 0===e||0<e--)&&!(Q=i.next()).done;)r.push(Q.value)}catch(A){n={error:A}}finally{try{Q&&!Q.done&&(t=i.return)&&t.call(i)}finally{if(n)throw n.error}}return r},n=this&&this.__values||function(A){var e="function"==typeof Symbol&&A[Symbol.iterator],t=0;return e?e.call(A):{next:function(){return A&&t>=A.length&&(A=void 0),{value:A&&A[t++],done:!A}}}};Object.defineProperty(e,"__esModule",{value:!0});var i,r,o,g,a,s,B,E=t(0),I=t(6),C=t(19),c=t(4),l=t(13);function T(A,e){void 0===e&&(e=!1);var t,n,i,r,g,a=A.match(e?B:s);return a?(t=[a[1].replace(/,/,"."),a[4],a[0].length],i=(n=Q(t,3))[0],r=n[1],g=n[2],"mu"===r?[d(o[r](parseFloat(i||"1"))).slice(0,-2),"em",g]:[i,r,g]):[null,null,0]}function d(A){return Math.abs(A)<6e-4?"0em":A.toFixed(3).replace(/\.?0+$/,"")+"em"}function h(A,e,t){"{"!==e&&"}"!==e||(e="\\"+e);var Q="{\\bigg"+t+" "+e+"}",n="{\\big"+t+" "+e+"}";return new C.default("\\mathchoice"+Q+n+n+n,{},A).mml()}function u(A,e,t){e=e.replace(/^\s+/,l.entities.nbsp).replace(/\s+$/,l.entities.nbsp);var Q=A.create("text",e);return A.create("node","mtext",[],t,Q)}function D(A,e,t){if(t.match(/^[a-z]/i)&&e.match(/(^|[^\\])(\\\\)*\\[a-z]+$/i)&&(e+=" "),e.length+t.length>A.configuration.options.maxBuffer)throw new c.default("MaxBufferSize","MathJax internal buffer size exceeded; is there a recursive macro call?");return e+t}function w(A,e){for(;0<e;)A=A.trim().slice(1,-1),e--;return A.trim()}function p(A,e){for(var t=A.length,Q=0,n="",i=0,r=0,o=!0,g=!1;i<t;){var a=A[i++];switch(a){case" ":break;case"{":o?r++:(g=!1,Q<r&&(r=Q)),Q++;break;case"}":Q&&Q--,(o||g)&&(r--,g=!0),o=!1;break;default:if(!Q&&-1!==e.indexOf(a))return[g?"true":w(n,r),a,A.slice(i)];g=o=!1}n+=a}if(Q)throw new c.default("ExtraOpenMissingClose","Extra open brace or missing close brace");return[g?"true":w(n,r),"",A.slice(i)]}t(109),r=i=i||{},o={em:function(A){return A},ex:function(A){return.43*A},pt:function(A){return A/10},pc:function(A){return 1.2*A},px:function(A){return 7.2*A/72},in:function(A){return 7.2*A},cm:function(A){return 7.2*A/2.54},mm:function(A){return 7.2*A/25.4},mu:function(A){return A/18}},g="([-+]?([.,]\\d+|\\d+([.,]\\d*)?))",a="(pt|em|ex|mu|px|mm|cm|in|pc)",s=RegExp("^\\s*"+g+"\\s*"+a+"\\s*$"),B=RegExp("^\\s*"+g+"\\s*"+a+" ?"),r.matchDimen=T,r.dimen2em=function(A){var e=Q(T(A),3),t=e[0],n=e[1],i=(e[2],parseFloat(t||"1")),r=o[n];return r?r(i):0},r.Em=d,r.fenced=function(A,e,t,Q,n){void 0===n&&(n="");var i,r=A.nodeFactory,o=r.create("node","mrow",[],{open:e,close:Q,texClass:E.TEXCLASS.INNER});if(n)i=new C.default("\\"+n+"l"+e,A.parser.stack.env,A).mml();else{var g=r.create("text",e);i=r.create("node","mo",[],{fence:!0,stretchy:!0,symmetric:!0,texClass:E.TEXCLASS.OPEN},g)}if(I.default.appendChildren(o,[i]),I.default.isType(t,"mrow")&&I.default.isInferred(t)?I.default.appendChildren(o,I.default.getChildren(t)):I.default.appendChildren(o,[t]),n)i=new C.default("\\"+n+"r"+Q,A.parser.stack.env,A).mml();else{var a=r.create("text",Q);i=r.create("node","mo",[],{fence:!0,stretchy:!0,symmetric:!0,texClass:E.TEXCLASS.CLOSE},a)}return I.default.appendChildren(o,[i]),o},r.fixedFence=function(A,e,t,Q){var n=A.nodeFactory.create("node","mrow",[],{open:e,close:Q,texClass:E.TEXCLASS.ORD});return e&&I.default.appendChildren(n,[h(A,e,"l")]),I.default.isType(t,"mrow")?I.default.appendChildren(n,I.default.getChildren(t)):I.default.appendChildren(n,[t]),Q&&I.default.appendChildren(n,[h(A,Q,"r")]),n},r.mathPalette=h,r.fixInitialMO=function(A,e){for(var t=0,Q=e.length;t<Q;t++){var n=e[t];if(n&&!I.default.isType(n,"mspace")&&(!I.default.isType(n,"TeXAtom")||I.default.getChildren(n)[0]&&I.default.getChildren(I.default.getChildren(n)[0]).length)){if(I.default.isEmbellished(n)){var i=A.nodeFactory.create("node","mi");e.unshift(i)}break}}},r.internalMath=function(A,e,t){var Q,n,i=A.stack.env.font?{mathvariant:A.stack.env.font}:{},r=[],o=0,g=0,a="",s=0;if(e.match(/\\?[${}\\]|\\\(|\\(eq)?ref\s*\{/)){for(;o<e.length;)if("$"===(Q=e.charAt(o++)))"$"===a&&0===s?(n=A.create("node","TeXAtom",[new C.default(e.slice(g,o-1),{},A.configuration).mml()]),r.push(n),a="",g=o):""===a&&(g<o-1&&r.push(u(A,e.slice(g,o-1),i)),a="$",g=o);else if("{"===Q&&""!==a)s++;else if("}"===Q)if("}"===a&&0===s){var B=new C.default(e.slice(g,o),{},A.configuration).mml();n=A.create("node","TeXAtom",[B],i),r.push(n),a="",g=o}else""!==a&&s&&s--;else if("\\"===Q)if(""===a&&e.substr(o).match(/^(eq)?ref\s*\{/)){var E=RegExp["$&"].length;g<o-1&&r.push(u(A,e.slice(g,o-1),i)),a="}",g=o-1,o+=E}else"("===(Q=e.charAt(o++))&&""===a?(g<o-2&&r.push(u(A,e.slice(g,o-2),i)),a=")",g=o):")"===Q&&")"===a&&0===s?(n=A.create("node","TeXAtom",[new C.default(e.slice(g,o-2),{},A.configuration).mml()]),r.push(n),a="",g=o):Q.match(/[${}\\]/)&&""===a&&(o--,e=e.substr(0,o-1)+e.substr(o));if(""!==a)throw new c.default("MathNotTerminated","Math not terminated in text box")}return g<e.length&&r.push(u(A,e.slice(g),i)),null!=t?r=[A.create("node","mstyle",r,{displaystyle:!1,scriptlevel:t})]:1<r.length&&(r=[A.create("node","mrow",r)]),r},r.trimSpaces=function(A){if("string"!=typeof A)return A;var e=A.trim();return e.match(/\\$/)&&A.match(/ $/)&&(e+=" "),e},r.setArrayAlign=function(A,e){return"t"===(e=r.trimSpaces(e||""))?A.arraydef.align="baseline 1":"b"===e?A.arraydef.align="baseline -1":"c"===e?A.arraydef.align="center":e&&(A.arraydef.align=e),A},r.substituteArgs=function(A,e,t){for(var Q="",n="",i=0;i<t.length;){var r=t.charAt(i++);if("\\"===r)Q+=r+t.charAt(i++);else if("#"===r)if("#"===(r=t.charAt(i++)))Q+=r;else{if(!r.match(/[1-9]/)||parseInt(r,10)>e.length)throw new c.default("IllegalMacroParam","Illegal macro parameter reference");n=D(A,D(A,n,Q),e[parseInt(r,10)-1]),Q=""}else Q+=r}return D(A,n,Q)},r.addArgs=D,r.checkEqnEnv=function(A){if(A.stack.global.eqnenv)throw new c.default("ErroneousNestingEq","Erroneous nesting of equation structures");A.stack.global.eqnenv=!0},r.MmlFilterAttribute=function(A,e,t){return t},r.getFontDef=function(A){var e=A.stack.env.font;return e?{mathvariant:e}:{}},r.keyvalOptions=function(A,e,t){var i,r;void 0===e&&(e=null),void 0===t&&(t=!1);var o=function(A){for(var e,t,n,i,r,o={},g=A;g;)i=(e=Q(p(g,["=",","]),3))[0],n=e[1],g=e[2],"="===n?(r=(t=Q(p(g,[","]),3))[0],n=t[1],g=t[2],r="false"===r||"true"===r?JSON.parse(r):r,o[i]=r):i&&(o[i]=!0);return o}(A);if(e)try{for(var g=n(Object.keys(o)),a=g.next();!a.done;a=g.next()){var s=a.value;if(!e.hasOwnProperty(s)){if(t)throw new c.default("InvalidOption","Invalid optional argument: %1",s);delete o[s]}}}catch(A){i={error:A}}finally{try{a&&!a.done&&(r=g.return)&&r.call(g)}finally{if(i)throw i.error}}return o},e.default=i},function(A,e,t){"use strict";var Q,n,i,r=this&&this.__values||function(A){var e="function"==typeof Symbol&&A[Symbol.iterator],t=0;return e?e.call(A):{next:function(){return A&&t>=A.length&&(A=void 0),{value:A&&A[t++],done:!A}}}},o=this&&this.__read||function(A,e){var t="function"==typeof Symbol&&A[Symbol.iterator];if(!t)return A;var Q,n,i=t.call(A),r=[];try{for(;(void 0===e||0<e--)&&!(Q=i.next()).done;)r.push(Q.value)}catch(A){n={error:A}}finally{try{Q&&!Q.done&&(t=i.return)&&t.call(i)}finally{if(n)throw n.error}}return r};Object.defineProperty(e,"__esModule",{value:!0}),n=Q=e.MapHandler||(e.MapHandler={}),i=new Map,n.register=function(A){i.set(A.name,A)},n.getMap=function(A){return i.get(A)},e.ExtensionMaps={NEW_MACRO:"new-Macro",NEW_DELIMITER:"new-Delimiter",NEW_COMMAND:"new-Command",NEW_ENVIRONMENT:"new-Environment"};var g=(a.prototype.add=function(A){var e=Q.getMap(A);e?this._configuration.push(e):this.warn("Configuration "+A+" not found! Omitted.")},a.prototype.parse=function(A){var e,t;try{for(var Q=r(this._configuration),n=Q.next();!n.done;n=Q.next()){var i=n.value.parse(A);if(i)return i}}catch(A){e={error:A}}finally{try{n&&!n.done&&(t=Q.return)&&t.call(Q)}finally{if(e)throw e.error}}var g=o(A,2),a=g[0],s=g[1];this._fallback(a,s)},a.prototype.lookup=function(A){var e=this.applicable(A);return e?e.lookup(A):null},a.prototype.contains=function(A){return!!this.applicable(A)},a.prototype.toString=function(){return this._configuration.map(function(A){return A.name}).join(", ")},a.prototype.applicable=function(A){var e,t;try{for(var Q=r(this._configuration),n=Q.next();!n.done;n=Q.next()){var i=n.value;if(i.contains(A))return i}}catch(A){e={error:A}}finally{try{n&&!n.done&&(t=Q.return)&&t.call(Q)}finally{if(e)throw e.error}}return null},a.prototype.retrieve=function(A){return this._configuration.find(function(e){return e.name===A})},a.prototype.warn=function(A){console.log("TexParser Warning: "+A)},a);function a(A,e){var t,Q;this._fallback=e,this._configuration=[];try{for(var n=r(A),i=n.next();!i.done;i=n.next()){var o=i.value;this.add(o)}}catch(A){t={error:A}}finally{try{i&&!i.done&&(Q=n.return)&&Q.call(n)}finally{if(t)throw t.error}}}e.SubHandler=g;var s=(B.prototype.set=function(A,e){this.map.set(A,e)},B.prototype.get=function(A){return this.map.get(A)},B.prototype.retrieve=function(A){var e,t;try{for(var Q=r(this.map.values()),n=Q.next();!n.done;n=Q.next()){var i=n.value.retrieve(A);if(i)return i}}catch(A){e={error:A}}finally{try{n&&!n.done&&(t=Q.return)&&t.call(Q)}finally{if(e)throw e.error}}return null},B.prototype.keys=function(){return this.map.keys()},B);function B(A){var e,t;this.map=new Map;try{for(var Q=r(Object.keys(A.handler)),n=Q.next();!n.done;n=Q.next()){var i=n.value,o=new g(A.handler[i]||[],A.fallback[i]);this.set(i,o)}}catch(A){e={error:A}}finally{try{n&&!n.done&&(t=Q.return)&&t.call(Q)}finally{if(e)throw e.error}}}e.SubHandlers=s},function(A,e,t){"use strict";var Q,n=this&&this.__extends||(Q=function(A,e){return(Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)e.hasOwnProperty(t)&&(A[t]=e[t])})(A,e)},function(A,e){function t(){this.constructor=A}Q(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}),i=this&&this.__read||function(A,e){var t="function"==typeof Symbol&&A[Symbol.iterator];if(!t)return A;var Q,n,i=t.call(A),r=[];try{for(;(void 0===e||0<e--)&&!(Q=i.next()).done;)r.push(Q.value)}catch(A){n={error:A}}finally{try{Q&&!Q.done&&(t=i.return)&&t.call(i)}finally{if(n)throw n.error}}return r},r=this&&this.__values||function(A){var e="function"==typeof Symbol&&A[Symbol.iterator],t=0;return e?e.call(A):{next:function(){return A&&t>=A.length&&(A=void 0),{value:A&&A[t++],done:!A}}}},o=this&&this.__spread||function(){for(var A=[],e=0;e<arguments.length;e++)A=A.concat(i(arguments[e]));return A};Object.defineProperty(e,"__esModule",{value:!0});var g=t(20),a=t(8),s=(Object.defineProperty(B.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),B.prototype.parserFor=function(A){return this.contains(A)?this.parser:null},B.prototype.parse=function(A){var e=i(A,2),t=e[0],Q=e[1],n=this.parserFor(Q),r=this.lookup(Q);return n&&r?n(t,r)||!0:null},Object.defineProperty(B.prototype,"parser",{get:function(){return this._parser},set:function(A){this._parser=A},enumerable:!0,configurable:!0}),B);function B(A,e){this._name=A,this._parser=e,a.MapHandler.register(this)}e.AbstractSymbolMap=s;var E,I=(n(C,E=s),C.prototype.contains=function(A){return this._regExp.test(A)},C.prototype.lookup=function(A){return this.contains(A)?A:null},C);function C(A,e,t){var Q=E.call(this,A,e)||this;return Q._regExp=t,Q}e.RegExpMap=I;var c,l=(n(T,c=s),T.prototype.lookup=function(A){return this.map.get(A)},T.prototype.contains=function(A){return this.map.has(A)},T.prototype.add=function(A,e){this.map.set(A,e)},T);function T(){var A=null!==c&&c.apply(this,arguments)||this;return A.map=new Map,A}e.AbstractParseMap=l;var d,h=(n(u,d=l),u);function u(A,e,t){var Q,n,o=d.call(this,A,e)||this;try{for(var a=r(Object.keys(t)),s=a.next();!s.done;s=a.next()){var B=s.value,E=t[B],I=i("string"==typeof E?[E,null]:E,2),C=I[0],c=I[1],l=new g.Symbol(B,C,c);o.add(B,l)}}catch(A){Q={error:A}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(Q)throw Q.error}}return o}e.CharacterMap=h;var D,w=(n(p,D=h),p.prototype.parse=function(A){var e=i(A,2),t=e[0],Q=e[1];return D.prototype.parse.call(this,[t,"\\"+Q])},p);function p(){return null!==D&&D.apply(this,arguments)||this}e.DelimiterMap=w;var m,f=(n(M,m=l),M.prototype.parserFor=function(A){var e=this.lookup(A);return e?e.func:null},M.prototype.parse=function(A){var e=i(A,2),t=e[0],Q=e[1],n=this.lookup(Q),r=this.parserFor(Q);return n&&r?r.apply(void 0,o([t,n.symbol],n.args))||!0:null},M);function M(A,e,t){var Q,n,o=m.call(this,A,null)||this;try{for(var a=r(Object.keys(e)),s=a.next();!s.done;s=a.next()){var B=s.value,E=e[B],I=i("string"==typeof E?[E]:E),C=I[0],c=I.slice(1),l=new g.Macro(B,t[C],c);o.add(B,l)}}catch(A){Q={error:A}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(Q)throw Q.error}}return o}e.MacroMap=f;var L,y=(n(S,L=f),S.prototype.parse=function(A){var e=i(A,2),t=e[0],Q=e[1],n=this.lookup(Q),r=this.parserFor(Q);if(!n||!r)return null;if(["\\"+n.symbol].concat(n.args),!r)return null;var g=t.currentCS;t.currentCS="\\"+Q;var a=r.apply(void 0,o([t,"\\"+n.symbol],n.args));return t.currentCS=g,a||!0},S);function S(){return null!==L&&L.apply(this,arguments)||this}e.CommandMap=y;var F,N=(n(R,F=f),R.prototype.parse=function(A){var e=i(A,2),t=e[0],Q=e[1],n=this.lookup(Q),r=this.parserFor(Q);return n&&r?(this.parser(t,n.symbol,r,n.args),!0):null},R);function R(A,e,t,Q){var n=F.call(this,A,t,Q)||this;return n.parser=e,n}e.EnvironmentMap=N},function(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.protoItem=function(A,e,t,Q,n,i,r){return void 0===r&&(r=null),{open:A,math:e,close:t,n:Q,start:{n:n},end:{n:i},display:r}};var Q=(n.prototype.render=function(A){A.renderActions.renderMath(this,A)},n.prototype.rerender=function(A,t){void 0===t&&(t=e.STATE.RERENDER),this.state()>=t&&this.state(t-1),A.renderActions.renderMath(this,A,t)},n.prototype.convert=function(A,t){void 0===t&&(t=e.STATE.LAST),A.renderActions.renderConvert(this,A,t)},n.prototype.compile=function(A){this.state()<e.STATE.COMPILED&&(this.root=this.inputJax.compile(this,A),this.state(e.STATE.COMPILED))},n.prototype.typeset=function(A){this.state()<e.STATE.TYPESET&&(this.typesetRoot=A.outputJax[null===this.display?"escaped":"typeset"](this,A),this.state(e.STATE.TYPESET))},n.prototype.updateDocument=function(A){},n.prototype.removeFromDocument=function(A){void 0===A&&(A=!1)},n.prototype.setMetrics=function(A,e,t,Q,n){this.metrics={em:A,ex:e,containerWidth:t,lineWidth:Q,scale:n}},n.prototype.state=function(A,t){return void 0===A&&(A=null),void 0===t&&(t=!1),null!=A&&(A<e.STATE.INSERTED&&this._state>=e.STATE.INSERTED&&this.removeFromDocument(t),A<e.STATE.TYPESET&&this._state>=e.STATE.TYPESET&&(this.bbox={},this.outputData={}),A<e.STATE.COMPILED&&this._state>=e.STATE.COMPILED&&(this.inputData={}),this._state=A),this._state},n.prototype.reset=function(A){void 0===A&&(A=!1),this.state(e.STATE.UNPROCESSED)},n);function n(A,t,Q,n,i){void 0===Q&&(Q=!0),void 0===n&&(n={i:0,n:0,delim:""}),void 0===i&&(i={i:0,n:0,delim:""}),this.root=null,this.typesetRoot=null,this._state=e.STATE.UNPROCESSED,this.metrics={},this.bbox={},this.inputData={},this.outputData={},this.math=A,this.inputJax=t,this.display=Q,this.start=n,this.end=i,this.root=null,this.typesetRoot=null,this.metrics={},this.bbox={},this.inputData={},this.outputData={}}e.AbstractMathItem=Q,e.STATE={UNPROCESSED:0,FINDMATH:10,COMPILED:20,CONVERT:100,METRICS:110,RERENDER:125,TYPESET:150,INSERTED:200,LAST:1e4},e.newState=function(A,t){if(A in e.STATE)throw Error("State "+A+" already exists");e.STATE[A]=t}},function(A,e,t){"use strict";var Q=this&&this.__read||function(A,e){var t="function"==typeof Symbol&&A[Symbol.iterator];if(!t)return A;var Q,n,i=t.call(A),r=[];try{for(;(void 0===e||0<e--)&&!(Q=i.next()).done;)r.push(Q.value)}catch(A){n={error:A}}finally{try{Q&&!Q.done&&(t=i.return)&&t.call(i)}finally{if(n)throw n.error}}return r},n=this&&this.__values||function(A){var e="function"==typeof Symbol&&A[Symbol.iterator],t=0;return e?e.call(A):{next:function(){return A&&t>=A.length&&(A=void 0),{value:A&&A[t++],done:!A}}}};Object.defineProperty(e,"__esModule",{value:!0});var i,r,o,g=t(33),a=t(8),s=t(3),B=t(9),E=t(8),I=t(27),C=(c.create=function(A,e){return void 0===e&&(e={}),new c(A,e.handler||{},e.fallback||{},e.items||{},e.tags||{},e.options||{},e.nodes||{},e.preprocessors||[],e.postprocessors||[],[e.init,e.priority],[e.config,e.configPriority])},c.empty=function(){return c.create("empty")},c.extension=function(){return new B.MacroMap(a.ExtensionMaps.NEW_MACRO,{},{}),new B.DelimiterMap(a.ExtensionMaps.NEW_DELIMITER,g.default.delimiter,{}),new B.CommandMap(a.ExtensionMaps.NEW_COMMAND,{},{}),new B.EnvironmentMap(a.ExtensionMaps.NEW_ENVIRONMENT,g.default.environment,{},{}),c.create("extension",{handler:{character:[],delimiter:[a.ExtensionMaps.NEW_DELIMITER],macro:[a.ExtensionMaps.NEW_DELIMITER,a.ExtensionMaps.NEW_COMMAND,a.ExtensionMaps.NEW_MACRO],environment:[a.ExtensionMaps.NEW_ENVIRONMENT]}})},c.prototype.init=function(A){this.initMethod.execute(A)},c.prototype.config=function(A,e){var t,Q,i,r;this.configMethod.execute(A,e);try{for(var o=n(this.preprocessors),g=o.next();!g.done;g=o.next()){var a=g.value;"function"==typeof a?e.preFilters.add(a):e.preFilters.add(a[0],a[1])}}catch(A){t={error:A}}finally{try{g&&!g.done&&(Q=o.return)&&Q.call(o)}finally{if(t)throw t.error}}try{for(var s=n(this.postprocessors),B=s.next();!B.done;B=s.next()){var E=B.value;"function"==typeof E?e.postFilters.add(E):e.postFilters.add(E[0],E[1])}}catch(A){i={error:A}}finally{try{B&&!B.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}},c.prototype.append=function(A){var e,t,Q,i,r,o,g,a,B,E,I,C,c=Object.keys(A.handler);try{for(var l=n(c),T=l.next();!T.done;T=l.next()){var d=T.value;try{for(var h=(Q=void 0,n(A.handler[d])),u=h.next();!u.done;u=h.next()){var D=u.value;this.handler[d].unshift(D)}}catch(A){Q={error:A}}finally{try{u&&!u.done&&(i=h.return)&&i.call(h)}finally{if(Q)throw Q.error}}}}catch(A){e={error:A}}finally{try{T&&!T.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}Object.assign(this.fallback,A.fallback),Object.assign(this.items,A.items),Object.assign(this.tags,A.tags),s.defaultOptions(this.options,A.options),Object.assign(this.nodes,A.nodes);try{for(var w=n(A.preprocessors),p=w.