!function(t){var e={};function a(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=t,a.c=e,a.d=function(t,e,r){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)a.d(r,n,function(e){return t[e]}.bind(null,n));return r},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=17)}([function(t,e,a){"use strict";var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a])})(t,e)},function(t,e){function a(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(a.prototype=e.prototype,new a)});Object.defineProperty(e,"__esModule",{value:!0}),e.AutoOpen=void 0;var i=a(8),o=a(2),s=a(3),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),Object.defineProperty(e.prototype,"kind",{get:function(){return"auto open"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.toMml=function(){var e=this.factory.configuration.parser,a=this.getProperty("right");if(this.getProperty("smash")){var r=t.prototype.toMml.call(this),n=e.create("node","mpadded",[r],{height:0,depth:0});this.Clear(),this.Push(e.create("node","TeXAtom",[n]))}a&&this.Push(new s.default(a,e.stack.env,e.configuration).mml());var i=t.prototype.toMml.call(this);return o.default.fenced(this.factory.configuration,this.getProperty("open"),i,this.getProperty("close"),this.getProperty("big"))},e.prototype.checkItem=function(e){var a=e.getProperty("autoclose");return a&&a===this.getProperty("close")?this.getProperty("ignore")?(this.Clear(),[[],!0]):[[this.toMml()],!0]:t.prototype.checkItem.call(this,e)},e}(i.BaseItem);e.AutoOpen=c},function(t,e,a){"use strict";var r=this&&this.__read||function(t,e){var a="function"==typeof Symbol&&t[Symbol.iterator];if(!a)return t;var r,n,i=a.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(t){n={error:t}}finally{try{r&&!r.done&&(a=i.return)&&a.call(i)}finally{if(n)throw n.error}}return o};Object.defineProperty(e,"__esModule",{value:!0});var n=a(11),i=a(3),o=a(12),s=a(4),c=a(2),l=a(13),u=a(14),m={},d={"(":")","[":"]","{":"}","|":"|"},f=/^(b|B)i(g{1,2})$/;m.Quantity=function(t,e,a,r,n,u,m){void 0===a&&(a="("),void 0===r&&(r=")"),void 0===n&&(n=!1),void 0===u&&(u=""),void 0===m&&(m="");var p=!!n&&t.GetStar(),v=t.GetNext(),g=t.i,h=null;if("\\"===v){if(t.i++,!(h=t.GetCS()).match(f)){var x=t.create("node","mrow");return t.Push(c.default.fenced(t.configuration,a,x,r)),void(t.i=g)}v=t.GetNext()}var M=d[v];if(n&&"{"!==v)throw new o.default("MissingArgFor","Missing argument for %1",t.currentCS);if(!M){x=t.create("node","mrow");return t.Push(c.default.fenced(t.configuration,a,x,r)),void(t.i=g)}if(u){var y=t.create("token","mi",{texClass:s.TEXCLASS.OP},u);m&&l.default.setAttribute(y,"mathvariant",m),t.Push(t.itemFactory.create("fn",y))}if("{"===v){var b=t.GetArgument(e);return v=n?a:"\\{",M=n?r:"\\}",b=p?v+" "+b+" "+M:h?"\\"+h+"l"+v+" "+b+" \\"+h+"r"+M:"\\left"+v+" "+b+" \\right"+M,void t.Push(new i.default(b,t.stack.env,t.configuration).mml())}n&&(v=a,M=r),t.i++,t.Push(t.itemFactory.create("auto open").setProperties({open:v,close:M,big:h}))},m.Eval=function(t,e){var a=t.GetStar(),r=t.GetNext();if("{"!==r){if("("===r||"["===r)return t.i++,void t.Push(t.itemFactory.create("auto open").setProperties({open:r,close:"|",smash:a,right:"\\vphantom{\\int}"}));throw new o.default("MissingArgFor","Missing argument for %1",t.currentCS)}var n=t.GetArgument(e),i="\\left. "+(a?"\\smash{"+n+"}":n)+" \\vphantom{\\int}\\right|";t.string=t.string.slice(0,t.i)+i+t.string.slice(t.i)},m.Commutator=function(t,e,a,r){void 0===a&&(a="["),void 0===r&&(r="]");var n=t.GetStar(),s=t.GetNext(),c=null;if("\\"===s){if(t.i++,!(c=t.GetCS()).match(f))throw new o.default("MissingArgFor","Missing argument for %1",t.currentCS);s=t.GetNext()}if("{"!==s)throw new o.default("MissingArgFor","Missing argument for %1",t.currentCS);var l=t.GetArgument(e)+","+t.GetArgument(e);l=n?a+" "+l+" "+r:c?"\\"+c+"l"+a+" "+l+" \\"+c+"r"+r:"\\left"+a+" "+l+" \\right"+r,t.Push(new i.default(l,t.stack.env,t.configuration).mml())};var p=[65,90],v=[97,122],g=[913,937],h=[945,969],x=[48,57];function M(t,e){return t>=e[0]&&t<=e[1]}function y(t,e,a,r){var n=t.configuration.parser,i=u.NodeFactory.createToken(t,e,a,r),o=r.codePointAt(0);return 1===r.length&&!n.stack.env.font&&n.stack.env.vectorFont&&(M(o,p)||M(o,v)||M(o,g)||M(o,x)||M(o,h)&&n.stack.env.vectorStar||l.default.getAttribute(i,"accent"))&&l.default.setAttribute(i,"mathvariant",n.stack.env.vectorFont),i}m.VectorBold=function(t,e){var a=t.GetStar(),r=t.GetArgument(e),n=t.configuration.nodeFactory.get("token"),o=t.stack.env.font;delete t.stack.env.font,t.configuration.nodeFactory.set("token",y),t.stack.env.vectorFont=a?"bold-italic":"bold",t.stack.env.vectorStar=a;var s=new i.default(r,t.stack.env,t.configuration).mml();o&&(t.stack.env.font=o),delete t.stack.env.vectorFont,delete t.stack.env.vectorStar,t.configuration.nodeFactory.set("token",n),t.Push(s)},m.StarMacro=function(t,e,a){for(var r=[],n=3;nt.configuration.options.maxMacros)throw new o.default("MaxMacroSub1","MathJax maximum macro substitution count exceeded; is there a recursive macro call?")};var b=function(t,e,a,r,n){var o=new i.default(r,t.stack.env,t.configuration).mml();t.Push(t.itemFactory.create(e,o));var s=t.GetNext(),c=d[s];if(c){var l=-1!==n.indexOf(s);if("{"===s){var u=(l?"\\left\\{":"")+" "+t.GetArgument(a)+" "+(l?"\\right\\}":"");return t.string=u+t.string.slice(t.i),void(t.i=0)}l&&(t.i++,t.Push(t.itemFactory.create("auto open").setProperties({open:s,close:c})))}};function P(t,e,a){var n=r(t,3),i=n[0],o=n[1],s=n[2];return e&&a?"\\left\\langle{"+i+"}\\middle\\vert{"+o+"}\\middle\\vert{"+s+"}\\right\\rangle":e?"\\langle{"+i+"}\\vert{"+o+"}\\vert{"+s+"}\\rangle":"\\left\\langle{"+i+"}\\right\\vert{"+o+"}\\left\\vert{"+s+"}\\right\\rangle"}m.OperatorApplication=function(t,e,a){for(var r=[],n=3;n2&&c.length>2?(u="^{"+(c.length-1)+"}",l=!0):null!=o&&(a>2&&c.length>1&&(l=!0),m=u="^{"+o+"}");for(var d=n?"\\flatfrac":"\\frac",f=c.length>1?c[0]:"",p=c.length>1?c[1]:c[0],v="",g=2,h=void 0;h=c[g];g++)v+=r+" "+h;var x=d+"{"+r+u+f+"}{"+r+" "+p+m+" "+v+"}";t.Push(new i.default(x,t.stack.env,t.configuration).mml()),"("===t.GetNext()&&(t.i++,t.Push(t.itemFactory.create("auto open").setProperties({open:"(",close:")",ignore:l})))},m.Bra=function(t,e){var a=t.GetStar(),r=t.GetArgument(e),n="",o=!1,s=!1;if("\\"===t.GetNext()){var c=t.i;t.i++;var l=t.GetCS(),u=t.lookup("macro",l);u&&"ket"===u.symbol?(o=!0,c=t.i,s=t.GetStar(),"{"===t.GetNext()?n=t.GetArgument(l,!0):(t.i=c,s=!1)):t.i=c}var m="";m=o?a||s?"\\langle{"+r+"}\\vert{"+n+"}\\rangle":"\\left\\langle{"+r+"}\\middle\\vert{"+n+"}\\right\\rangle":a||s?"\\langle{"+r+"}\\vert":"\\left\\langle{"+r+"}\\right\\vert{"+n+"}",t.Push(new i.default(m,t.stack.env,t.configuration).mml())},m.Ket=function(t,e){var a=t.GetStar(),r=t.GetArgument(e),n=a?"\\vert{"+r+"}\\rangle":"\\left\\vert{"+r+"}\\right\\rangle";t.Push(new i.default(n,t.stack.env,t.configuration).mml())},m.BraKet=function(t,e){var a=t.GetStar(),r=t.GetArgument(e),n=null;"{"===t.GetNext()&&(n=t.GetArgument(e,!0));var o="";o=null==n?a?"\\langle{"+r+"}\\vert{"+r+"}\\rangle":"\\left\\langle{"+r+"}\\middle\\vert{"+r+"}\\right\\rangle":a?"\\langle{"+r+"}\\vert{"+n+"}\\rangle":"\\left\\langle{"+r+"}\\middle\\vert{"+n+"}\\right\\rangle",t.Push(new i.default(o,t.stack.env,t.configuration).mml())},m.KetBra=function(t,e){var a=t.GetStar(),r=t.GetArgument(e),n=null;"{"===t.GetNext()&&(n=t.GetArgument(e,!0));var o="";o=null==n?a?"\\vert{"+r+"}\\rangle\\!\\langle{"+r+"}\\vert":"\\left\\vert{"+r+"}\\middle\\rangle\\!\\middle\\langle{"+r+"}\\right\\vert":a?"\\vert{"+r+"}\\rangle\\!\\langle{"+n+"}\\vert":"\\left\\vert{"+r+"}\\middle\\rangle\\!\\middle\\langle{"+n+"}\\right\\vert",t.Push(new i.default(o,t.stack.env,t.configuration).mml())},m.Expectation=function(t,e){var a=t.GetStar(),r=a&&t.GetStar(),n=t.GetArgument(e),o=null;"{"===t.GetNext()&&(o=t.GetArgument(e,!0));var s=n&&o?P([o,n,o],a,r):a?"\\langle {"+n+"} \\rangle":"\\left\\langle {"+n+"} \\right\\rangle";t.Push(new i.default(s,t.stack.env,t.configuration).mml())},m.MatrixElement=function(t,e){var a=t.GetStar(),r=a&&t.GetStar(),n=P([t.GetArgument(e),t.GetArgument(e),t.GetArgument(e)],a,r);t.Push(new i.default(n,t.stack.env,t.configuration).mml())},m.MatrixQuantity=function(t,e,a){var r=t.GetStar(),n=a?"smallmatrix":"array",o="",s="",c="";switch(t.GetNext()){case"{":o=t.GetArgument(e);break;case"(":t.i++,s=r?"\\lgroup":"(",c=r?"\\rgroup":")",o=t.GetUpTo(e,")");break;case"[":t.i++,s="[",c="]",o=t.GetUpTo(e,"]");break;case"|":t.i++,s="|",c="|",o=t.GetUpTo(e,"|");break;default:s="(",c=")"}var l=(s?"\\left":"")+s+"\\begin{"+n+"}{} "+o+"\\end{"+n+"}"+(s?"\\right":"")+c;t.Push(new i.default(l,t.stack.env,t.configuration).mml())},m.IdentityMatrix=function(t,e){var a=t.GetArgument(e),r=parseInt(a,10);if(isNaN(r))throw new o.default("InvalidNumber","Invalid number");if(r<=1)return t.string="1"+t.string.slice(t.i),void(t.i=0);for(var n=Array(r).fill("0"),i=[],s=0;s=n){i.push(t.string.slice(s,n));break}s=t.i,i.push(o)}t.string=function(t,e){for(var a=t.length,r=[],n=0;n