UNPKG

vditor

Version:

♏ 易于使用的 Markdown 编辑器,为适配不同的应用场景而生

1 lines 270 kB
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)r.d(n,a,function(e){return t[e]}.bind(null,a));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=95)}([function(t,e,r){"use strict";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.")},a=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,a,o=r.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(t){a={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(a)throw a.error}}return i};Object.defineProperty(e,"__esModule",{value:!0}),e.ParserConfiguration=e.ConfigurationHandler=e.Configuration=void 0;var o,i=r(10),s=r(16),l=r(73),c=r(72),u=r(9),p=function(){function t(t,e,r,n,a,o,i,s,l,c,u,p){void 0===e&&(e={}),void 0===r&&(r={}),void 0===n&&(n={}),void 0===a&&(a={}),void 0===o&&(o={}),void 0===i&&(i={}),void 0===s&&(s=[]),void 0===l&&(l=[]),void 0===c&&(c=null),void 0===u&&(u=null),this.name=t,this.handler=e,this.fallback=r,this.items=n,this.tags=a,this.options=o,this.nodes=i,this.preprocessors=s,this.postprocessors=l,this.initMethod=c,this.configMethod=u,this.priority=p,this.handler=Object.assign({character:[],delimiter:[],macro:[],environment:[]},e)}return t.makeProcessor=function(t,e){return Array.isArray(t)?t:[t,e]},t._create=function(e,r){var n=this;void 0===r&&(r={});var a=r.priority||c.PrioritizedList.DEFAULTPRIORITY,o=r.init?this.makeProcessor(r.init,a):null,i=r.config?this.makeProcessor(r.config,a):null,s=(r.preprocessors||[]).map((function(t){return n.makeProcessor(t,a)})),l=(r.postprocessors||[]).map((function(t){return n.makeProcessor(t,a)}));return new t(e,r.handler||{},r.fallback||{},r.items||{},r.tags||{},r.options||{},r.nodes||{},s,l,o,i,a)},t.create=function(e,r){void 0===r&&(r={});var n=t._create(e,r);return o.set(e,n),n},t.local=function(e){return void 0===e&&(e={}),t._create("",e)},Object.defineProperty(t.prototype,"init",{get:function(){return this.initMethod?this.initMethod[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"config",{get:function(){return this.configMethod?this.configMethod[0]:null},enumerable:!1,configurable:!0}),t}();e.Configuration=p,function(t){var e=new Map;t.set=function(t,r){e.set(t,r)},t.get=function(t){return e.get(t)},t.keys=function(){return e.keys()}}(o=e.ConfigurationHandler||(e.ConfigurationHandler={}));var f=function(){function t(t){var e,r,a,o;this.initMethod=new l.FunctionList,this.configMethod=new l.FunctionList,this.configurations=new c.PrioritizedList,this.handlers=new s.SubHandlers,this.items={},this.tags={},this.options={},this.nodes={};try{for(var i=n(t.slice().reverse()),u=i.next();!u.done;u=i.next()){var p=u.value;this.addPackage(p)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}try{for(var f=n(this.configurations),d=f.next();!d.done;d=f.next()){var h=d.value,m=h.item,g=h.priority;this.append(m,g)}}catch(t){a={error:t}}finally{try{d&&!d.done&&(o=f.return)&&o.call(f)}finally{if(a)throw a.error}}}return t.prototype.init=function(){this.initMethod.execute(this)},t.prototype.config=function(t){var e,r;this.configMethod.execute(this,t);try{for(var a=n(this.configurations),o=a.next();!o.done;o=a.next()){var i=o.value;this.addFilters(t,i.item)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}},t.prototype.addPackage=function(t){var e="string"==typeof t?t:t[0],r=o.get(e);r&&this.configurations.add(r,"string"==typeof t?r.priority:t[1])},t.prototype.add=function(t,e,r){var a,o;void 0===r&&(r={}),this.append(t),this.configurations.add(t,t.priority),this.init();var s=e.parseOptions;s.nodeFactory.setCreators(t.nodes);try{for(var l=n(Object.keys(t.items)),c=l.next();!c.done;c=l.next()){var p=c.value;s.itemFactory.setNodeClass(p,t.items[p])}}catch(t){a={error:t}}finally{try{c&&!c.done&&(o=l.return)&&o.call(l)}finally{if(a)throw a.error}}u.TagsFactory.addTags(t.tags),i.defaultOptions(s.options,t.options),i.userOptions(s.options,r),this.addFilters(e,t),t.config&&t.config(this,e)},t.prototype.append=function(t,e){e=e||t.priority,t.initMethod&&this.initMethod.add(t.initMethod[0],t.initMethod[1]),t.configMethod&&this.configMethod.add(t.configMethod[0],t.configMethod[1]),this.handlers.add(t.handler,t.fallback,e),Object.assign(this.items,t.items),Object.assign(this.tags,t.tags),i.defaultOptions(this.options,t.options),Object.assign(this.nodes,t.nodes)},t.prototype.addFilters=function(t,e){var r,o,i,s;try{for(var l=n(e.preprocessors),c=l.next();!c.done;c=l.next()){var u=a(c.value,2),p=u[0],f=u[1];t.preFilters.add(p,f)}}catch(t){r={error:t}}finally{try{c&&!c.done&&(o=l.return)&&o.call(l)}finally{if(r)throw r.error}}try{for(var d=n(e.postprocessors),h=d.next();!h.done;h=d.next()){var m=a(h.value,2),g=m[0];f=m[1];t.postFilters.add(g,f)}}catch(t){i={error:t}}finally{try{h&&!h.done&&(s=d.return)&&s.call(d)}finally{if(i)throw i.error}}},t}();e.ParserConfiguration=f},function(t,e,r){"use strict";var n,a=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)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,a,o=r.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(t){a={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(a)throw a.error}}return i},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.")},s=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(o(arguments[e]));return t};Object.defineProperty(e,"__esModule",{value:!0}),e.EnvironmentMap=e.CommandMap=e.MacroMap=e.DelimiterMap=e.CharacterMap=e.AbstractParseMap=e.RegExpMap=e.AbstractSymbolMap=void 0;var l=r(14),c=r(16),u=function(){function t(t,e){this._name=t,this._parser=e,c.MapHandler.register(this)}return Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),t.prototype.parserFor=function(t){return this.contains(t)?this.parser:null},t.prototype.parse=function(t){var e=o(t,2),r=e[0],n=e[1],a=this.parserFor(n),i=this.lookup(n);return a&&i?a(r,i)||!0:null},Object.defineProperty(t.prototype,"parser",{get:function(){return this._parser},set:function(t){this._parser=t},enumerable:!1,configurable:!0}),t}();e.AbstractSymbolMap=u;var p=function(t){function e(e,r,n){var a=t.call(this,e,r)||this;return a._regExp=n,a}return a(e,t),e.prototype.contains=function(t){return this._regExp.test(t)},e.prototype.lookup=function(t){return this.contains(t)?t:null},e}(u);e.RegExpMap=p;var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.map=new Map,e}return a(e,t),e.prototype.lookup=function(t){return this.map.get(t)},e.prototype.contains=function(t){return this.map.has(t)},e.prototype.add=function(t,e){this.map.set(t,e)},e.prototype.remove=function(t){this.map.delete(t)},e}(u);e.AbstractParseMap=f;var d=function(t){function e(e,r,n){var a,s,c=t.call(this,e,r)||this;try{for(var u=i(Object.keys(n)),p=u.next();!p.done;p=u.next()){var f=p.value,d=n[f],h=o("string"==typeof d?[d,null]:d,2),m=h[0],g=h[1],v=new l.Symbol(f,m,g);c.add(f,v)}}catch(t){a={error:t}}finally{try{p&&!p.done&&(s=u.return)&&s.call(u)}finally{if(a)throw a.error}}return c}return a(e,t),e}(f);e.CharacterMap=d;var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.parse=function(e){var r=o(e,2),n=r[0],a=r[1];return t.prototype.parse.call(this,[n,"\\"+a])},e}(d);e.DelimiterMap=h;var m=function(t){function e(e,r,n){var a,s,c=t.call(this,e,null)||this;try{for(var u=i(Object.keys(r)),p=u.next();!p.done;p=u.next()){var f=p.value,d=r[f],h=o("string"==typeof d?[d]:d),m=h[0],g=h.slice(1),v=new l.Macro(f,n[m],g);c.add(f,v)}}catch(t){a={error:t}}finally{try{p&&!p.done&&(s=u.return)&&s.call(u)}finally{if(a)throw a.error}}return c}return a(e,t),e.prototype.parserFor=function(t){var e=this.lookup(t);return e?e.func:null},e.prototype.parse=function(t){var e=o(t,2),r=e[0],n=e[1],a=this.lookup(n),i=this.parserFor(n);return a&&i?i.apply(void 0,s([r,a.symbol],a.args))||!0:null},e}(f);e.MacroMap=m;var g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.parse=function(t){var e=o(t,2),r=e[0],n=e[1],a=this.lookup(n),i=this.parserFor(n);if(!a||!i)return null;if(!i)return null;var l=r.currentCS;r.currentCS="\\"+n;var c=i.apply(void 0,s([r,"\\"+a.symbol],a.args));return r.currentCS=l,c||!0},e}(m);e.CommandMap=g;var v=function(t){function e(e,r,n,a){var o=t.call(this,e,n,a)||this;return o.parser=r,o}return a(e,t),e.prototype.parse=function(t){var e=o(t,2),r=e[0],n=e[1],a=this.lookup(n),i=this.parserFor(n);return a&&i?(this.parser(r,a.symbol,i,a.args),!0):null},e}(m);e.EnvironmentMap=v},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(e,r){for(var n=[],a=2;a<arguments.length;a++)n[a-2]=arguments[a];this.id=e,this.message=t.processString(r,n)}return t.processString=function(e,r){for(var n=e.split(t.pattern),a=1,o=n.length;a<o;a+=2){var i=n[a].charAt(0);if(i>="0"&&i<="9")n[a]=r[parseInt(n[a],10)-1],"number"==typeof n[a]&&(n[a]=n[a].toString());else if("{"===i){if((i=n[a].substr(1))>="0"&&i<="9")n[a]=r[parseInt(n[a].substr(1,n[a].length-2),10)-1],"number"==typeof n[a]&&(n[a]=n[a].toString());else n[a].match(/^\{([a-z]+):%(\d+)\|(.*)\}$/)&&(n[a]="%"+n[a])}null==n[a]&&(n[a]="???")}return n.join("")},t.pattern=/%(\d+|\{\d+\}|\{[a-z]+:\%\d+(?:\|(?:%\{\d+\}|%.|[^\}])*)+\}|.)/g,t}();e.default=n},function(t,e,r){"use strict";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.")},a=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,a,o=r.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(t){a={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(a)throw a.error}}return i},o=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(a(arguments[e]));return t};Object.defineProperty(e,"__esModule",{value:!0});var i,s=r(5),l=r(80);!function(t){var e=new Map([["autoOP",!0],["fnOP",!0],["movesupsub",!0],["subsupOK",!0],["texprimestyle",!0],["useHeight",!0],["variantForm",!0],["withDelims",!0],["open",!0],["close",!0]]);function r(t,r){var a,o;try{for(var i=n(Object.keys(r)),s=i.next();!s.done;s=i.next()){var l=s.value,c=r[l];"texClass"===l?(t.texClass=c,t.setProperty(l,c)):"movablelimits"===l?(t.setProperty("movablelimits",c),(t.isKind("mo")||t.isKind("mstyle"))&&t.attributes.set("movablelimits",c)):"inferred"===l||(e.has(l)?t.setProperty(l,c):t.attributes.set(l,c))}}catch(t){a={error:t}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(a)throw a.error}}}function a(t,e,r){t.childNodes[e]=r,r&&(r.parent=t)}function i(t,e){return t.isKind(e)}t.createEntity=function(t){return String.fromCodePoint(parseInt(t,16))},t.getChildren=function(t){return t.childNodes},t.getText=function(t){return t.getText()},t.appendChildren=function(t,e){var r,a;try{for(var o=n(e),i=o.next();!i.done;i=o.next()){var s=i.value;t.appendChild(s)}}catch(t){r={error:t}}finally{try{i&&!i.done&&(a=o.return)&&a.call(o)}finally{if(r)throw r.error}}},t.setAttribute=function(t,e,r){t.attributes.set(e,r)},t.setProperty=function(t,e,r){t.setProperty(e,r)},t.setProperties=r,t.getProperty=function(t,e){return t.getProperty(e)},t.getAttribute=function(t,e){return t.attributes.get(e)},t.removeProperties=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];t.removeProperty.apply(t,o(e))},t.getChildAt=function(t,e){return t.childNodes[e]},t.setChild=a,t.copyChildren=function(t,e){for(var r=t.childNodes,n=0;n<r.length;n++)a(e,n,r[n])},t.copyAttributes=function(t,e){e.attributes=t.attributes,r(e,t.getAllProperties())},t.isType=i,t.isEmbellished=function(t){return t.isEmbellished},t.getTexClass=function(t){return t.texClass},t.getCoreMO=function(t){return t.coreMO()},t.isNode=function(t){return t instanceof s.AbstractMmlNode||t instanceof s.AbstractMmlEmptyNode},t.isInferred=function(t){return t.isInferred},t.getForm=function(t){var e,r;if(!i(t,"mo"))return null;var a=t,o=a.getForms();try{for(var s=n(o),c=s.next();!c.done;c=s.next()){var u=c.value,p=l.MmlMo.OPTABLE[u][a.getText()];if(p)return p}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}return null}}(i||(i={})),e.default=i},function(t,e,r){"use strict";var n=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,a,o=r.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(t){a={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(a)throw a.error}}return i},a=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});var o,i=r(5),s=r(3),l=r(6),c=r(2),u=r(13);r(71),function(t){var e={em:function(t){return t},ex:function(t){return.43*t},pt:function(t){return t/10},pc:function(t){return 1.2*t},px:function(t){return 7.2*t/72},in:function(t){return 7.2*t},cm:function(t){return 7.2*t/2.54},mm:function(t){return 7.2*t/25.4},mu:function(t){return t/18}},r="([-+]?([.,]\\d+|\\d+([.,]\\d*)?))",o="(pt|em|ex|mu|px|mm|cm|in|pc)",p=RegExp("^\\s*"+r+"\\s*"+o+"\\s*$"),f=RegExp("^\\s*"+r+"\\s*"+o+" ?");function d(t,r){void 0===r&&(r=!1);var a=t.match(r?f:p);return a?function(t){var r=n(t,3),a=r[0],o=r[1],i=r[2];if("mu"!==o)return[a,o,i];return[h(e[o](parseFloat(a||"1"))).slice(0,-2),"em",i]}([a[1].replace(/,/,"."),a[4],a[0].length]):[null,null,0]}function h(t){return Math.abs(t)<6e-4?"0em":t.toFixed(3).replace(/\.?0+$/,"")+"em"}function m(t,e,r){"{"!==e&&"}"!==e||(e="\\"+e);var n="{\\bigg"+r+" "+e+"}",a="{\\big"+r+" "+e+"}";return new l.default("\\mathchoice"+n+a+a+a,{},t).mml()}function g(t,e,r){e=e.replace(/^\s+/,u.entities.nbsp).replace(/\s+$/,u.entities.nbsp);var n=t.create("text",e);return t.create("node","mtext",[],r,n)}function v(t,e,r){if(r.match(/^[a-z]/i)&&e.match(/(^|[^\\])(\\\\)*\\[a-z]+$/i)&&(e+=" "),e.length+r.length>t.configuration.options.maxBuffer)throw new c.default("MaxBufferSize","MathJax internal buffer size exceeded; is there a recursive macro call?");return e+r}function y(t,e){for(;e>0;)t=t.trim().slice(1,-1),e--;return t.trim()}function b(t,e){for(var r=t.length,n=0,a="",o=0,i=0,s=!0,l=!1;o<r;){var u=t[o++];switch(u){case" ":break;case"{":s?i++:(l=!1,i>n&&(i=n)),n++;break;case"}":n&&n--,(s||l)&&(i--,l=!0),s=!1;break;default:if(!n&&-1!==e.indexOf(u))return[l?"true":y(a,i),u,t.slice(o)];s=!1,l=!1}a+=u}if(n)throw new c.default("ExtraOpenMissingClose","Extra open brace or missing close brace");return[l?"true":y(a,i),"",t.slice(o)]}t.matchDimen=d,t.dimen2em=function(t){var r=n(d(t),2),a=r[0],o=r[1],i=parseFloat(a||"1"),s=e[o];return s?s(i):0},t.Em=h,t.fenced=function(t,e,r,n,a){void 0===a&&(a="");var o,c=t.nodeFactory,u=c.create("node","mrow",[],{open:e,close:n,texClass:i.TEXCLASS.INNER});if(a)o=new l.default("\\"+a+"l"+e,t.parser.stack.env,t).mml();else{var p=c.create("text",e);o=c.create("node","mo",[],{fence:!0,stretchy:!0,symmetric:!0,texClass:i.TEXCLASS.OPEN},p)}if(s.default.appendChildren(u,[o]),s.default.isType(r,"mrow")&&s.default.isInferred(r)?s.default.appendChildren(u,s.default.getChildren(r)):s.default.appendChildren(u,[r]),a)o=new l.default("\\"+a+"r"+n,t.parser.stack.env,t).mml();else{var f=c.create("text",n);o=c.create("node","mo",[],{fence:!0,stretchy:!0,symmetric:!0,texClass:i.TEXCLASS.CLOSE},f)}return s.default.appendChildren(u,[o]),u},t.fixedFence=function(t,e,r,n){var a=t.nodeFactory.create("node","mrow",[],{open:e,close:n,texClass:i.TEXCLASS.ORD});return e&&s.default.appendChildren(a,[m(t,e,"l")]),s.default.isType(r,"mrow")?s.default.appendChildren(a,s.default.getChildren(r)):s.default.appendChildren(a,[r]),n&&s.default.appendChildren(a,[m(t,n,"r")]),a},t.mathPalette=m,t.fixInitialMO=function(t,e){for(var r=0,n=e.length;r<n;r++){var a=e[r];if(a&&!s.default.isType(a,"mspace")&&(!s.default.isType(a,"TeXAtom")||s.default.getChildren(a)[0]&&s.default.getChildren(s.default.getChildren(a)[0]).length)){if(s.default.isEmbellished(a)||s.default.isType(a,"TeXAtom")&&s.default.getTexClass(a)===i.TEXCLASS.REL){var o=t.nodeFactory.create("node","mi");e.unshift(o)}break}}},t.internalMath=function(t,e,r,n){if(t.configuration.options.internalMath)return t.configuration.options.internalMath(t,e,r,n);var a,o,i=n||t.stack.env.font,s=i?{mathvariant:i}:{},u=[],p=0,f=0,d="",h=0;if(e.match(/\\?[${}\\]|\\\(|\\(eq)?ref\s*\{/)){for(;p<e.length;)if("$"===(a=e.charAt(p++)))"$"===d&&0===h?(o=t.create("node","TeXAtom",[new l.default(e.slice(f,p-1),{},t.configuration).mml()]),u.push(o),d="",f=p):""===d&&(f<p-1&&u.push(g(t,e.slice(f,p-1),s)),d="$",f=p);else if("{"===a&&""!==d)h++;else if("}"===a)if("}"===d&&0===h){var m=new l.default(e.slice(f,p),{},t.configuration).mml();o=t.create("node","TeXAtom",[m],s),u.push(o),d="",f=p}else""!==d&&h&&h--;else if("\\"===a)if(""===d&&e.substr(p).match(/^(eq)?ref\s*\{/)){var v=RegExp["$&"].length;f<p-1&&u.push(g(t,e.slice(f,p-1),s)),d="}",f=p-1,p+=v}else"("===(a=e.charAt(p++))&&""===d?(f<p-2&&u.push(g(t,e.slice(f,p-2),s)),d=")",f=p):")"===a&&")"===d&&0===h?(o=t.create("node","TeXAtom",[new l.default(e.slice(f,p-2),{},t.configuration).mml()]),u.push(o),d="",f=p):a.match(/[${}\\]/)&&""===d&&(p--,e=e.substr(0,p-1)+e.substr(p));if(""!==d)throw new c.default("MathNotTerminated","Math not terminated in text box")}return f<e.length&&u.push(g(t,e.slice(f),s)),null!=r?u=[t.create("node","mstyle",u,{displaystyle:!1,scriptlevel:r})]:u.length>1&&(u=[t.create("node","mrow",u)]),u},t.internalText=g,t.trimSpaces=function(t){if("string"!=typeof t)return t;var e=t.trim();return e.match(/\\$/)&&t.match(/ $/)&&(e+=" "),e},t.setArrayAlign=function(e,r){return"t"===(r=t.trimSpaces(r||""))?e.arraydef.align="baseline 1":"b"===r?e.arraydef.align="baseline -1":"c"===r?e.arraydef.align="center":r&&(e.arraydef.align=r),e},t.substituteArgs=function(t,e,r){for(var n="",a="",o=0;o<r.length;){var i=r.charAt(o++);if("\\"===i)n+=i+r.charAt(o++);else if("#"===i)if("#"===(i=r.charAt(o++)))n+=i;else{if(!i.match(/[1-9]/)||parseInt(i,10)>e.length)throw new c.default("IllegalMacroParam","Illegal macro parameter reference");a=v(t,v(t,a,n),e[parseInt(i,10)-1]),n=""}else n+=i}return v(t,a,n)},t.addArgs=v,t.checkEqnEnv=function(t){if(t.stack.global.eqnenv)throw new c.default("ErroneousNestingEq","Erroneous nesting of equation structures");t.stack.global.eqnenv=!0},t.MmlFilterAttribute=function(t,e,r){return r},t.getFontDef=function(t){var e=t.stack.env.font;return e?{mathvariant:e}:{}},t.keyvalOptions=function(t,e,r){var o,i;void 0===e&&(e=null),void 0===r&&(r=!1);var s=function(t){var e,r,a,o,i,s={},l=t;for(;l;)o=(e=n(b(l,["=",","]),3))[0],a=e[1],l=e[2],"="===a?(i=(r=n(b(l,[","]),3))[0],a=r[1],l=r[2],i="false"===i||"true"===i?JSON.parse(i):i,s[o]=i):o&&(s[o]=!0);return s}(t);if(e)try{for(var l=a(Object.keys(s)),u=l.next();!u.done;u=l.next()){var p=u.value;if(!e.hasOwnProperty(p)){if(r)throw new c.default("InvalidOption","Invalid optional argument: %1",p);delete s[p]}}}catch(t){o={error:t}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}return s}}(o||(o={})),e.default=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TEXCLASS=MathJax._.core.MmlTree.MmlNode.TEXCLASS,e.TEXCLASSNAMES=MathJax._.core.MmlTree.MmlNode.TEXCLASSNAMES,e.indentAttributes=MathJax._.core.MmlTree.MmlNode.indentAttributes,e.AbstractMmlNode=MathJax._.core.MmlTree.MmlNode.AbstractMmlNode,e.AbstractMmlTokenNode=MathJax._.core.MmlTree.MmlNode.AbstractMmlTokenNode,e.AbstractMmlLayoutNode=MathJax._.core.MmlTree.MmlNode.AbstractMmlLayoutNode,e.AbstractMmlBaseNode=MathJax._.core.MmlTree.MmlNode.AbstractMmlBaseNode,e.AbstractMmlEmptyNode=MathJax._.core.MmlTree.MmlNode.AbstractMmlEmptyNode,e.TextNode=MathJax._.core.MmlTree.MmlNode.TextNode,e.XMLNode=MathJax._.core.MmlTree.MmlNode.XMLNode},function(t,e,r){"use strict";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.")},a=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,a,o=r.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(t){a={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(a)throw a.error}}return i},o=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(a(arguments[e]));return t};Object.defineProperty(e,"__esModule",{value:!0});var i=r(4),s=r(23),l=r(2),c=r(5),u=function(){function t(t,e,r){var a,o;this._string=t,this.configuration=r,this.macroCount=0,this.i=0,this.currentCS="";var i,l=e.hasOwnProperty("isInner"),c=e.isInner;if(delete e.isInner,e){i={};try{for(var u=n(Object.keys(e)),p=u.next();!p.done;p=u.next()){var f=p.value;i[f]=e[f]}}catch(t){a={error:t}}finally{try{p&&!p.done&&(o=u.return)&&o.call(u)}finally{if(a)throw a.error}}}this.configuration.pushParser(this),this.stack=new s.default(this.itemFactory,i,!l||c),this.Parse(),this.Push(this.itemFactory.create("stop"))}return Object.defineProperty(t.prototype,"options",{get:function(){return this.configuration.options},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"itemFactory",{get:function(){return this.configuration.itemFactory},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tags",{get:function(){return this.configuration.tags},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"string",{get:function(){return this._string},set:function(t){this._string=t},enumerable:!1,configurable:!0}),t.prototype.parse=function(t,e){return this.configuration.handlers.get(t).parse(e)},t.prototype.lookup=function(t,e){return this.configuration.handlers.get(t).lookup(e)},t.prototype.contains=function(t,e){return this.configuration.handlers.get(t).contains(e)},t.prototype.toString=function(){var t,e,r="";try{for(var a=n(Array.from(this.configuration.handlers.keys())),o=a.next();!o.done;o=a.next()){var i=o.value;r+=i+": "+this.configuration.handlers.get(i)+"\n"}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return r},t.prototype.Parse=function(){for(var t;this.i<this.string.length;)t=this.getCodePoint(),this.i+=t.length,this.parse("character",[this,t])},t.prototype.Push=function(t){t instanceof c.AbstractMmlNode&&t.isInferred?this.PushAll(t.childNodes):this.stack.Push(t)},t.prototype.PushAll=function(t){var e,r;try{for(var a=n(t),o=a.next();!o.done;o=a.next()){var i=o.value;this.stack.Push(i)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}},t.prototype.mml=function(){if(!this.stack.Top().isKind("mml"))return null;var t=this.stack.Top().First;return this.configuration.popParser(),t},t.prototype.convertDelimiter=function(t){var e=this.lookup("delimiter",t);return e?e.char:null},t.prototype.getCodePoint=function(){var t=this.string.codePointAt(this.i);return void 0===t?"":String.fromCodePoint(t)},t.prototype.nextIsSpace=function(){return!!this.string.charAt(this.i).match(/\s/)},t.prototype.GetNext=function(){for(;this.nextIsSpace();)this.i++;return this.getCodePoint()},t.prototype.GetCS=function(){var t=this.string.slice(this.i).match(/^(([a-z]+) ?|[\uD800-\uDBFF].|.)/i);return t?(this.i+=t[0].length,t[2]||t[1]):(this.i++," ")},t.prototype.GetArgument=function(t,e){switch(this.GetNext()){case"":if(!e)throw new l.default("MissingArgFor","Missing argument for %1",this.currentCS);return null;case"}":if(!e)throw new l.default("ExtraCloseMissingOpen","Extra close brace or missing open brace");return null;case"\\":return this.i++,"\\"+this.GetCS();case"{":for(var r=++this.i,n=1;this.i<this.string.length;)switch(this.string.charAt(this.i++)){case"\\":this.i++;break;case"{":n++;break;case"}":if(0==--n)return this.string.slice(r,this.i-1)}throw new l.default("MissingCloseBrace","Missing close brace")}var a=this.getCodePoint();return this.i+=a.length,a},t.prototype.GetBrackets=function(t,e){if("["!==this.GetNext())return e;for(var r=++this.i,n=0;this.i<this.string.length;)switch(this.string.charAt(this.i++)){case"{":n++;break;case"\\":this.i++;break;case"}":if(n--<=0)throw new l.default("ExtraCloseLooking","Extra close brace while looking for %1","']'");break;case"]":if(0===n)return this.string.slice(r,this.i-1)}throw new l.default("MissingCloseBracket","Could not find closing ']' for argument to %1",this.currentCS)},t.prototype.GetDelimiter=function(t,e){var r=this.GetNext();if(this.i+=r.length,this.i<=this.string.length&&("\\"===r?r+=this.GetCS():"{"===r&&e&&(this.i--,r=this.GetArgument(t)),this.contains("delimiter",r)))return this.convertDelimiter(r);throw new l.default("MissingOrUnrecognizedDelim","Missing or unrecognized delimiter for %1",this.currentCS)},t.prototype.GetDimen=function(t){if("{"===this.GetNext()){var e=this.GetArgument(t),r=a(i.default.matchDimen(e),2),n=r[0],o=r[1];if(n)return n+o}else{e=this.string.slice(this.i);var s=a(i.default.matchDimen(e,!0),3),c=(n=s[0],o=s[1],s[2]);if(n)return this.i+=c,n+o}throw new l.default("MissingDimOrUnits","Missing dimension or its units for %1",this.currentCS)},t.prototype.GetUpTo=function(t,e){for(;this.nextIsSpace();)this.i++;for(var r=this.i,n=0;this.i<this.string.length;){var a=this.i,o=this.GetNext();switch(this.i+=o.length,o){case"\\":o+=this.GetCS();break;case"{":n++;break;case"}":if(0===n)throw new l.default("ExtraCloseLooking","Extra close brace while looking for %1",e);n--}if(0===n&&o===e)return this.string.slice(r,a)}throw new l.default("TokenNotFoundForCommand","Could not find %1 for %2",e,this.currentCS)},t.prototype.ParseArg=function(e){return new t(this.GetArgument(e),this.stack.env,this.configuration).mml()},t.prototype.ParseUpTo=function(e,r){return new t(this.GetUpTo(e,r),this.stack.env,this.configuration).mml()},t.prototype.GetDelimiterArg=function(t){var e=i.default.trimSpaces(this.GetArgument(t));if(""===e)return null;if(this.contains("delimiter",e))return e;throw new l.default("MissingOrUnrecognizedDelim","Missing or unrecognized delimiter for %1",this.currentCS)},t.prototype.GetStar=function(){var t="*"===this.GetNext();return t&&this.i++,t},t.prototype.create=function(t){for(var e,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return(e=this.configuration.nodeFactory).create.apply(e,o([t],r))},t}();e.default=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TexConstant=void 0,function(t){t.Variant={NORMAL:"normal",BOLD:"bold",ITALIC:"italic",BOLDITALIC:"bold-italic",DOUBLESTRUCK:"double-struck",FRAKTUR:"fraktur",BOLDFRAKTUR:"bold-fraktur",SCRIPT:"script",BOLDSCRIPT:"bold-script",SANSSERIF:"sans-serif",BOLDSANSSERIF:"bold-sans-serif",SANSSERIFITALIC:"sans-serif-italic",SANSSERIFBOLDITALIC:"sans-serif-bold-italic",MONOSPACE:"monospace",INITIAL:"inital",TAILED:"tailed",LOOPED:"looped",STRETCHED:"stretched",CALLIGRAPHIC:"-tex-calligraphic",OLDSTYLE:"-tex-oldstyle"},t.Form={PREFIX:"prefix",INFIX:"infix",POSTFIX:"postfix"},t.LineBreak={AUTO:"auto",NEWLINE:"newline",NOBREAK:"nobreak",GOODBREAK:"goodbreak",BADBREAK:"badbreak"},t.LineBreakStyle={BEFORE:"before",AFTER:"after",DUPLICATE:"duplicate",INFIXLINBREAKSTYLE:"infixlinebreakstyle"},t.IndentAlign={LEFT:"left",CENTER:"center",RIGHT:"right",AUTO:"auto",ID:"id",INDENTALIGN:"indentalign"},t.IndentShift={INDENTSHIFT:"indentshift"},t.LineThickness={THIN:"thin",MEDIUM:"medium",THICK:"thick"},t.Notation={LONGDIV:"longdiv",ACTUARIAL:"actuarial",PHASORANGLE:"phasorangle",RADICAL:"radical",BOX:"box",ROUNDEDBOX:"roundedbox",CIRCLE:"circle",LEFT:"left",RIGHT:"right",TOP:"top",BOTTOM:"bottom",UPDIAGONALSTRIKE:"updiagonalstrike",DOWNDIAGONALSTRIKE:"downdiagonalstrike",VERTICALSTRIKE:"verticalstrike",HORIZONTALSTRIKE:"horizontalstrike",NORTHEASTARROW:"northeastarrow",MADRUWB:"madruwb",UPDIAGONALARROW:"updiagonalarrow"},t.Align={TOP:"top",BOTTOM:"bottom",CENTER:"center",BASELINE:"baseline",AXIS:"axis",LEFT:"left",RIGHT:"right"},t.Lines={NONE:"none",SOLID:"solid",DASHED:"dashed"},t.Side={LEFT:"left",RIGHT:"right",LEFTOVERLAP:"leftoverlap",RIGHTOVERLAP:"rightoverlap"},t.Width={AUTO:"auto",FIT:"fit"},t.Actiontype={TOGGLE:"toggle",STATUSLINE:"statusline",TOOLTIP:"tooltip",INPUT:"input"},t.Length={VERYVERYTHINMATHSPACE:"veryverythinmathspace",VERYTHINMATHSPACE:"verythinmathspace",THINMATHSPACE:"thinmathspace",MEDIUMMATHSPACE:"mediummathspace",THICKMATHSPACE:"thickmathspace",VERYTHICKMATHSPACE:"verythickmathspace",VERYVERYTHICKMATHSPACE:"veryverythickmathspace",NEGATIVEVERYVERYTHINMATHSPACE:"negativeveryverythinmathspace",NEGATIVEVERYTHINMATHSPACE:"negativeverythinmathspace",NEGATIVETHINMATHSPACE:"negativethinmathspace",NEGATIVEMEDIUMMATHSPACE:"negativemediummathspace",NEGATIVETHICKMATHSPACE:"negativethickmathspace",NEGATIVEVERYTHICKMATHSPACE:"negativeverythickmathspace",NEGATIVEVERYVERYTHICKMATHSPACE:"negativeveryverythickmathspace"},t.Overflow={LINBREAK:"linebreak",SCROLL:"scroll",ELIDE:"elide",TRUNCATE:"truncate",SCALE:"scale"},t.Unit={EM:"em",EX:"ex",PX:"px",IN:"in",CM:"cm",MM:"mm",PT:"pt",PC:"pc"}}(e.TexConstant||(e.TexConstant={}))},function(t,e,r){"use strict";var n=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,a,o=r.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(t){a={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(a)throw a.error}}return i};Object.defineProperty(e,"__esModule",{value:!0});var a=r(15),o=r(3),i=r(2),s=r(6),l=r(7),c=r(4),u=r(5),p=r(9),f=r(13);r(71),r(83),r(84);var d={},h={fontfamily:1,fontsize:1,fontweight:1,fontstyle:1,color:1,background:1,id:1,class:1,href:1,style:1};function m(t,e){var r=t.stack.env,n=r.inRoot;r.inRoot=!0;var a=new s.default(e,r,t.configuration),o=a.mml(),i=a.stack.global;if(i.leftRoot||i.upRoot){var l={};i.leftRoot&&(l.width=i.leftRoot),i.upRoot&&(l.voffset=i.upRoot,l.height=i.upRoot),o=t.create("node","mpadded",[o],l)}return r.inRoot=n,o}d.Open=function(t,e){t.Push(t.itemFactory.create("open"))},d.Close=function(t,e){t.Push(t.itemFactory.create("close"))},d.Tilde=function(t,e){t.Push(t.create("token","mtext",{},f.entities.nbsp))},d.Space=function(t,e){},d.Superscript=function(t,e){var r,a,s;t.GetNext().match(/\d/)&&(t.string=t.string.substr(0,t.i+1)+" "+t.string.substr(t.i+1));var l=t.stack.Top();l.isKind("prime")?(s=(r=n(l.Peek(2),2))[0],a=r[1],t.stack.Pop()):(s=t.stack.Prev())||(s=t.create("token","mi",{},""));var c=o.default.getProperty(s,"movesupsub"),u=o.default.isType(s,"msubsup")?s.sup:s.over;if(o.default.isType(s,"msubsup")&&!o.default.isType(s,"msup")&&o.default.getChildAt(s,s.sup)||o.default.isType(s,"munderover")&&!o.default.isType(s,"mover")&&o.default.getChildAt(s,s.over)&&!o.default.getProperty(s,"subsupOK"))throw new i.default("DoubleExponent","Double exponent: use braces to clarify");o.default.isType(s,"msubsup")&&!o.default.isType(s,"msup")||(c?((!o.default.isType(s,"munderover")||o.default.isType(s,"mover")||o.default.getChildAt(s,s.over))&&(s=t.create("node","munderover",[s],{movesupsub:!0})),u=s.over):u=(s=t.create("node","msubsup",[s])).sup),t.Push(t.itemFactory.create("subsup",s).setProperties({position:u,primes:a,movesupsub:c}))},d.Subscript=function(t,e){var r,a,s;t.GetNext().match(/\d/)&&(t.string=t.string.substr(0,t.i+1)+" "+t.string.substr(t.i+1));var l=t.stack.Top();l.isKind("prime")?(s=(r=n(l.Peek(2),2))[0],a=r[1],t.stack.Pop()):(s=t.stack.Prev())||(s=t.create("token","mi",{},""));var c=o.default.getProperty(s,"movesupsub"),u=o.default.isType(s,"msubsup")?s.sub:s.under;if(o.default.isType(s,"msubsup")&&!o.default.isType(s,"msup")&&o.default.getChildAt(s,s.sub)||o.default.isType(s,"munderover")&&!o.default.isType(s,"mover")&&o.default.getChildAt(s,s.under)&&!o.default.getProperty(s,"subsupOK"))throw new i.default("DoubleSubscripts","Double subscripts: use braces to clarify");o.default.isType(s,"msubsup")&&!o.default.isType(s,"msup")||(c?((!o.default.isType(s,"munderover")||o.default.isType(s,"mover")||o.default.getChildAt(s,s.under))&&(s=t.create("node","munderover",[s],{movesupsub:!0})),u=s.under):u=(s=t.create("node","msubsup",[s])).sub),t.Push(t.itemFactory.create("subsup",s).setProperties({position:u,primes:a,movesupsub:c}))},d.Prime=function(t,e){var r=t.stack.Prev();if(r||(r=t.create("node","mi")),o.default.isType(r,"msubsup")&&!o.default.isType(r,"msup")&&o.default.getChildAt(r,r.sup))throw new i.default("DoubleExponentPrime","Prime causes double exponent: use braces to clarify");var n="";t.i--;do{n+=f.entities.prime,t.i++,e=t.GetNext()}while("'"===e||e===f.entities.rquote);n=["","\u2032","\u2033","\u2034","\u2057"][n.length]||n;var a=t.create("token","mo",{},n);t.Push(t.itemFactory.create("prime",r,a))},d.Comment=function(t,e){for(;t.i<t.string.length&&"\n"!==t.string.charAt(t.i);)t.i++},d.Hash=function(t,e){throw new i.default("CantUseHash1","You can't use 'macro parameter character #' in math mode")},d.SetFont=function(t,e,r){t.stack.env.font=r},d.SetStyle=function(t,e,r,n,a){t.stack.env.style=r,t.stack.env.level=a,t.Push(t.itemFactory.create("style").setProperty("styles",{displaystyle:n,scriptlevel:a}))},d.SetSize=function(t,e,r){t.stack.env.size=r,t.Push(t.itemFactory.create("style").setProperty("styles",{mathsize:r+"em"}))},d.Spacer=function(t,e,r){var n=t.create("node","mspace",[],{width:r}),a=t.create("node","mstyle",[n],{scriptlevel:0});t.Push(a)},d.LeftRight=function(t,e){var r=e.substr(1);t.Push(t.itemFactory.create(r).setProperty("delim",t.GetDelimiter(e)))},d.Middle=function(t,e){var r=t.GetDelimiter(e),n=t.create("node","TeXAtom",[],{texClass:u.TEXCLASS.CLOSE});if(t.Push(n),!t.stack.Top().isKind("left"))throw new i.default("MisplacedMiddle","%1 must be within \\left and \\right",t.currentCS);n=t.create("token","mo",{stretchy:!0},r),t.Push(n),n=t.create("node","TeXAtom",[],{texClass:u.TEXCLASS.OPEN}),t.Push(n)},d.NamedFn=function(t,e,r){r||(r=e.substr(1));var n=t.create("token","mi",{texClass:u.TEXCLASS.OP},r);t.Push(t.itemFactory.create("fn",n))},d.NamedOp=function(t,e,r){r||(r=e.substr(1)),r=r.replace(/&thinsp;/,"\u2006");var n=t.create("token","mo",{movablelimits:!0,movesupsub:!0,form:l.TexConstant.Form.PREFIX,texClass:u.TEXCLASS.OP},r);t.Push(n)},d.Limits=function(t,e,r){var n=t.stack.Prev(!0);if(!n||o.default.getTexClass(o.default.getCoreMO(n))!==u.TEXCLASS.OP&&null==o.default.getProperty(n,"movesupsub"))throw new i.default("MisplacedLimits","%1 is allowed only on operators",t.currentCS);var a,s=t.stack.Top();o.default.isType(n,"munderover")&&!r?(a=t.create("node","msubsup"),o.default.copyChildren(n,a),n=s.Last=a):o.default.isType(n,"msubsup")&&r&&(a=t.create("node","munderover"),o.default.copyChildren(n,a),n=s.Last=a),o.default.setProperty(n,"movesupsub",!!r),o.default.setProperties(o.default.getCoreMO(n),{movablelimits:!1}),(o.default.getAttribute(n,"movablelimits")||o.default.getProperty(n,"movablelimits"))&&o.default.setProperties(n,{movablelimits:!1})},d.Over=function(t,e,r,n){var a=t.itemFactory.create("over").setProperty("name",t.currentCS);r||n?(a.setProperty("open",r),a.setProperty("close",n)):e.match(/withdelims$/)&&(a.setProperty("open",t.GetDelimiter(e)),a.setProperty("close",t.GetDelimiter(e))),e.match(/^\\above/)?a.setProperty("thickness",t.GetDimen(e)):(e.match(/^\\atop/)||r||n)&&a.setProperty("thickness",0),t.Push(a)},d.Frac=function(t,e){var r=t.ParseArg(e),n=t.ParseArg(e),a=t.create("node","mfrac",[r,n]);t.Push(a)},d.Sqrt=function(t,e){var r=t.GetBrackets(e),n=t.GetArgument(e);"\\frac"===n&&(n+="{"+t.GetArgument(n)+"}{"+t.GetArgument(n)+"}");var a=new s.default(n,t.stack.env,t.configuration).mml();a=r?t.create("node","mroot",[a,m(t,r)]):t.create("node","msqrt",[a]),t.Push(a)},d.Root=function(t,e){var r=t.GetUpTo(e,"\\of"),n=t.ParseArg(e),a=t.create("node","mroot",[n,m(t,r)]);t.Push(a)},d.MoveRoot=function(t,e,r){if(!t.stack.env.inRoot)throw new i.default("MisplacedMoveRoot","%1 can appear only within a root",t.currentCS);if(t.stack.global[r])throw new i.default("MultipleMoveRoot","Multiple use of %1",t.currentCS);var n=t.GetArgument(e);if(!n.match(/-?[0-9]+/))throw new i.default("IntegerArg","The argument to %1 must be an integer",t.currentCS);"-"!==(n=parseInt(n,10)/15+"em").substr(0,1)&&(n="+"+n),t.stack.global[r]=n},d.Accent=function(t,e,r,n){var a=t.ParseArg(e),i=c.default.getFontDef(t);i.accent=!0;var s=o.default.createEntity(r),l=t.create("token","mo",i,s);o.default.setAttribute(l,"stretchy",!!n);var u=o.default.isEmbellished(a)?o.default.getCoreMO(a):a;o.default.isType(u,"mo")&&o.default.setProperties(u,{movablelimits:!1});var p=t.create("node","munderover");o.default.setChild(p,0,a),o.default.setChild(p,1,null),o.default.setChild(p,2,l);var f=t.create("node","TeXAtom",[p]);t.Push(f)},d.UnderOver=function(t,e,r,n,a){var i,s=t.ParseArg(e),l=o.default.getForm(s);(l&&l[3]&&l[3].movablelimits||o.default.getProperty(s,"movablelimits"))&&o.default.setProperties(s,{movablelimits:!1}),o.default.isType(s,"munderover")&&o.default.isEmbellished(s)&&(o.default.setProperties(o.default.getCoreMO(s),{lspace:0,rspace:0}),i=t.create("node","mo",[],{rspace:0}),s=t.create("node","mrow",[i,s]));var c=t.create("node","munderover",[s]),p=o.default.createEntity(r);i=t.create("token","mo",{stretchy:!0,accent:!a},p),o.default.setChild(c,"o"===e.charAt(1)?c.over:c.under,i);var f=c;n&&(f=t.create("node","TeXAtom",[c],{texClass:u.TEXCLASS.OP,movesupsub:!0})),o.default.setProperty(f,"subsupOK",!0),t.Push(f)},d.Overset=function(t,e){var r=t.ParseArg(e),n=t.ParseArg(e);(o.default.getAttribute(n,"movablelimits")||o.default.getProperty(n,"movablelimits"))&&o.default.setProperties(n,{movablelimits:!1});var a=t.create("node","mover",[n,r]);t.Push(a)},d.Underset=function(t,e){var r=t.ParseArg(e),n=t.ParseArg(e);(o.default.isType(n,"mo")||o.default.getProperty(n,"movablelimits"))&&o.default.setProperties(n,{movablelimits:!1});var a=t.create("node","munder",[n,r]);t.Push(a)},d.TeXAtom=function(t,e,r){var n,a,o,i={texClass:r};if(r===u.TEXCLASS.OP){i.movesupsub=i.movablelimits=!0;var c=t.GetArgument(e),p=c.match(/^\s*\\rm\s+([a-zA-Z0-9 ]+)$/);p?(i.mathvariant=l.TexConstant.Variant.NORMAL,a=t.create("token","mi",i,p[1])):(o=new s.default(c,t.stack.env,t.configuration).mml(),a=t.create("node","TeXAtom",[o],i)),n=t.itemFactory.create("fn",a)}else o=t.ParseArg(e),n=t.create("node","TeXAtom",[o],i);t.Push(n)},d.MmlToken=function(t,e){var r,n=t.GetArgument(e),a=t.GetBrackets(e,"").replace(/^\s+/,""),s=t.GetArgument(e),l={};try{r=t.create("node",n)}catch(t){r=null}if(!r||!r.isToken)throw new i.default("NotMathMLToken","%1 is not a token element",n);for(;""!==a;){var u=a.match(/^([a-z]+)\s*=\s*('[^']*'|"[^"]*"|[^ ,]*)\s*,?\s*/i);if(!u)throw new i.default("InvalidMathMLAttr","Invalid MathML attribute: %1",a);if(!r.attributes.hasDefault(u[1])&&!h[u[1]])throw new i.default("UnknownAttrForElement","%1 is not a recognized attribute for %2",u[1],n);var p=c.default.MmlFilterAttribute(t,u[1],u[2].replace(/^(['"])(.*)\1$/,"$2"));p&&("true"===p.toLowerCase()?p=!0:"false"===p.toLowerCase()&&(p=!1),l[u[1]]=p),a=a.substr(u[0].length)}var f=t.create("text",s);r.appendChild(f),o.default.setProperties(r,l),t.Push(r)},d.Strut=function(t,e){var r=t.create("node","mrow"),n=t.create("node","mpadded",[r],{height:"8.6pt",depth:"3pt",width:0});t.Push(n)},d.Phantom=function(t,e,r,n){var a=t.create("node","mphantom",[t.ParseArg(e)]);(r||n)&&(a=t.create("node","mpadded",[a]),n&&(o.default.setAttribute(a,"height",0),o.default.setAttribute(a,"depth",0)),r&&o.default.setAttribute(a,"width",0));var i=t.create("node","TeXAtom",[a]);t.Push(i)},d.Smash=function(t,e){var r=c.default.trimSpaces(t.GetBrackets(e,"")),n=t.create("node","mpadded",[t.ParseArg(e)]);switch(r){case"b":o.default.setAttribute(n,"depth",0);break;case"t":o.default.setAttribute(n,"height",0);break;default:o.default.setAttribute(n,"height",0),o.default.setAttribute(n,"depth",0)}var a=t.create("node","TeXAtom",[n]);t.Push(a)},d.Lap=function(t,e){var r=t.create("node","mpadded",[t.ParseArg(e)],{width:0});"\\llap"===e&&o.default.setAttribute(r,"lspace","-1width");var n=t.create("node","TeXAtom",[r]);t.Push(n)},d.RaiseLower=function(t,e){var r=t.GetDimen(e),n=t.itemFactory.create("position").setProperties({name:t.currentCS,move:"vertical"});"-"===r.charAt(0)&&(r=r.slice(1),e="raise"===e.substr(1)?"\\lower":"\\raise"),"\\lower"===e?(n.setProperty("dh","-"+r),n.setProperty("dd","+"+r)):(n.setProperty("dh","+"+r),n.setProperty("dd","-"+r)),t.Push(n)},d.MoveLeftRight=function(t,e){var r=t.GetDimen(e),n="-"===r.charAt(0)?r.slice(1):"-"+r;if("\\moveleft"===e){var a=r;r=n,n=a}t.Push(t.itemFactory.create("position").setProperties({name:t.currentCS,move:"horizontal",left:t.create("node","mspace",[],{width:r}),right:t.create("node","mspace",[],{width:n})}))},d.Hskip=function(t,e){var r=t.create("node","mspace",[],{width:t.GetDimen(e)});t.Push(r)},d.Rule=function(t,e,r){var n={width:t.GetDimen(e),height:t.GetDimen(e),depth:t.GetDimen(e)};"blank"!==r&&(n.mathbackground=t.stack.env.color||"black");var a=t.create("node","mspace",[],n);t.Push(a)},d.rule=function(t,e){var r=t.GetBrackets(e),n=t.GetDimen(e),a=t.GetDimen(e),i=t.create("node","mspace",[],{width:n,height:a,mathbackground:t.stack.env.color||"black"});r&&(i=t.create("node","mpadded",[i],{voffset:r}),r.match(/^\-/)?(o.default.setAttribute(i,"height",r),o.default.setAttribute(i,"depth","+"+r.substr(1))):o.default.setAttribute(i,"height","+"+r)),t.Push(i)},d.MakeBig=function(t,e,r,n){var a=String(n*=1.411764705882353).replace(/(\.\d\d\d).+/,"$1")+"em",o=t.GetDelimiter(e,!0),i=t.create("token","mo",{minsize:a,maxsize:a,fence:!0,stretchy:!0,symmetric:!0},o),s=t.create("node","TeXAtom",[i],{texClass:r});t.Push(s)},d.BuildRel=function(t,e){var r=t.ParseUpTo(e,"\\over"),n=t.ParseArg(e),a=t.create("node","munderover");o.default.setChild(a,0,n),o.default.setChild(a,1,null),o.default.setChild(a,2,r);var i=t.create("node","TeXAtom",[a],{texClass:u.TEXCLASS.REL});t.Push(i)},d.HBox=function(t,e,r,n){t.PushAll(c.default.internalMath(t,t.GetArgument(e),r,n))},d.FBox=function(t,e){var r=c.default.internalMath(t,t.GetArgument(e)),n=t.create("node","menclose",r,{notation:"box"});t.Push(n)},d.Not=function(t,e){t.Push(t.itemFactory.create("not"))},d.Dots=function(t,e){var r=o.default.createEntity("2026"),n=o.default.createEntity("22EF"),a=t.create("token","mo",{stretchy:!1},r),i=t.create("token","mo",{stretchy:!1},n);t.Push(t.itemFactory.create("dots").setProperties({ldots:a,cdots:i}))},d.Matrix=function(t,e,r,n,a,o,s,l,c,u){var p=t.GetNext();if(""===p)throw new i.default("MissingArgFor","Missing argument for %1",t.currentCS);"{"===p?t.i++:(t.string=p+"}"+t.string.slice(t.i+1),t.i=0);var f=t.itemFactory.create("array").setProperty("requireClose",!0);f.arraydef={rowspacing:s||"4pt",columnspacing:o||"1em"},c&&f.setProperty("isCases",!0),u&&(f.setProperty("isNumbered",!0),f.arraydef.side=u),(r||n)&&(f.setProperty("open",r),f.setProperty("close",n)),"D"===l&&(f.arraydef.displaystyle=!0),null!=a&&(f.arraydef.columnalign=a),t.Push(f)},d.Entry=function(t,e){if(t.Push(t.itemFactory.create("cell").setProperties({isEntry:!0,name:e})),t.stack.Top().getProperty("isCases")){for(var r=t.string,n=0,a=-1,o=t.i,s=r.length;o<s;){var l=r.charAt(o);if("{"===l)n++,o++;else if("}"===l)0===n?s=0:(0===--n&&a<0&&(a=o-t.i),o++);else{if("&"===l&&0===n)throw new i.default("ExtraAlignTab","Extra alignment tab in \\cases text");"\\"===l?r.substr(o).match(/^((\\cr)[^a-zA-Z]|\\\\)/)?s=0:o+=2:o++}}var u=r.substr(t.i,o-t.i);if(!u.match(/^\s*\\text[^a-zA-Z]/)||a!==u.replace(/\s+$/,"").length-1){var p=c.default.internalMath(t,u,0);t.PushAll(p),t.i=o}}},d.Cr=function(t,e){t.Push(t.itemFactory.create("cell").setProperties({isCR:!0,name:e}))},d.CrLaTeX=function(t,e,r){var o;if(void 0===r&&(r=!1),!r&&"["===t.string.charAt(t.i)){var s=t.GetBrackets(e,""),u=n(c.default.matchDimen(s),2),p=u[0],f=u[1];if(s&&!p)throw new i.default("BracketMustBeDimension","Bracket argument to %1 must be a dimension",t.currentCS);o=p+f}t.Push(t.itemFactory.create("cell").setProperties({isCR:!0,name:e,linebreak:!0}));var d,h=t.stack.Top();if(h instanceof a.ArrayItem){if(o&&h.arraydef.rowspacing){var m=h.arraydef.rowspacing.split(/ /);if(!h.getProperty("rowspacing")){var g=c.default.dimen2em(m[0]);h.setProperty("rowspacing",g)}for(var v=h.getProperty("rowspacing");m.length<h.table.length;)m.push(c.default.Em(v));m[h.table.length-1]=c.default.Em(Math.max(0,v+c.default.dimen2em(o))),h.arraydef.rowspacing=m.join(" ")}}else o&&(d=t.create("node","mspace",[],{depth:o}),t.Push(d)),d=t.create("node","mspace",[],{linebreak:l.TexConstant.LineBreak.NEWLINE}),t.Push(d)},d.HLine=function(t,e,r){null==r&&(r="solid");var n=t.stack.Top();if(!(n instanceof a.ArrayItem)||n.Size())throw new i.default("Misplaced","Misplaced %1",t.currentCS);if(n.table.length){for(var o=n.arraydef.rowlines?n.arraydef.rowlines.split(/ /):[];o.length<n.table.length;)o.push("none");o[n.table.length-1]=r,n.arraydef.rowlines=o.join(" ")}else n.frame.push("top")},d.HFill=function(t,e){var r=t.stack.Top();if(!(r instanceof a.ArrayItem))throw new i.default("UnsupportedHFill","Unsupported use of %1",t.currentCS);r.hfill.push(r.Size())},d.BeginEnd=function(t,e){var r=t.GetArgument(e);if(r.match(/\\/i))throw new i.default("InvalidEnv","Invalid environment name '%1'",r);var n=t.configuration.handlers.get("environment").lookup(r);if(n&&"\\end"===e){if(!n.args[0]){var a=t.itemFactory.create("end").setProperty("name",r);return void t.Push(a)}t.stack.env.closing=r}if(++t.macroCount>t.configuration.options.maxMacros)throw new i.default("MaxMacroSub2","MathJax maximum substitution count exceeded; is there a recursive latex environment?");t.parse("environment",[t,r])},d.Array=function(t,e,r,n,a,o,i,s,l){a||(a=t.GetArgument("\\begin{"+e.getName()+"}"));var c=("c"+a).replace(/[^clr|:]/g,"").replace(/[^|:]([|:])+/g,"$1");a=(a=a.replace(/[^clr]/g,"").split("").join(" ")).replace(/l/g,"left").replace(/r/g,"right").replace(/c/g,"center");var u=t.itemFactory.create("array");return u.arraydef={columnalign:a,columnspacing:o||"1em",rowspacing:i||"4pt"},c.match(/[|:]/)&&(c.charAt(0).match(/[|:]/)&&(u.frame.push("left"),u.dashed=":"===c.charAt(0)),c.charAt(c.length-1).match(/[|:]/)&&u.frame.push("right"),c=c.substr(1,c.length-2),u.arraydef.columnlines=c.split("").join(" ").replace(/[^|: ]/g,"none").replace(/\|/g,"solid").replace(/:/g,"dashed")),r&&u.setProperty("open",t.convertDelimiter(r)),n&&u.setProperty("close",t.convertDelimiter(n)),"D"===s?u.arraydef.displaystyle=!0:s&&(u.arraydef.displaystyle=!1),"S"===s&&(u.arraydef.scriptlevel=1),l&&(u.arraydef.useHeight=!1),t.Push(e),u},d.AlignedArray=function(t,e){var r=t.GetBrackets("\\begin{"+e.getName()+"}"),n=d.Array(t,e);return c.default.setArrayAlign(n,r)},d.Equation=function(t,e,r){return t.Push(e),c.default.checkEqnEnv(t),t.itemFactory.create("equation",r).setProperty("name",e.getName())},d.EqnArray=function(t,e,r,n,a,o){t.Push(e),n&&c.default.checkEqnEnv(t),a=(a=a.replace(/[^clr]/g,"").split("").join(" ")).replace(/l/g,"left").replace(/r/g,"right").replace(/c/g,"center");var i=t.itemFactory.create("eqnarray",e.getName(),r,n,t.stack.global);return i.arraydef={displaystyle:!0,columnalign:a,columnspacing:o||"1em",rowspacing:"3pt",side:t.options.tagSide,minlabelspacing:t.options.tagIndent},i},d.HandleNoTag=function(t,e){t.tags.notag()},d.HandleLabel=function(t,e){var r=t.GetArgument(e);if(""!==r&&!t.tags.refUpdate){if(t.tags.label)throw new i.default("MultipleCommand","Multiple %1",t.currentCS);if(t.tags.label=r,(t.tags.allLabels[r]||t.tags.labels[r])&&!t.options.ignoreDuplicateLabels)throw new i.default("MultipleLabel","Label '%1' multiply d