(()=>{"use strict";var t={d:(e,r)=>{for(var s in r)t.o(r,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:r[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{FindTeX:()=>st});var r={};t.r(r),t.d(r,{default:()=>ht});var s={};t.r(s),t.d(s,{default:()=>ft});var n={};t.r(n),t.d(n,{ConfigurationType:()=>bt,HandlerType:()=>At});var i={};t.r(i),t.d(i,{UnitUtil:()=>vt});var a={};t.r(a),t.d(a,{default:()=>kt});var o={};t.r(o),t.d(o,{default:()=>Mt});var c={};t.r(c),t.d(c,{BaseItem:()=>Tt,MmlStack:()=>xt});var l={};t.r(l),t.d(l,{TexConstant:()=>Pt});var h={};t.r(h),t.d(h,{default:()=>Et});var m={};t.r(m),t.d(m,{default:()=>It});var u={};t.r(u),t.d(u,{NodeFactory:()=>Nt});var d={};t.r(d),t.d(d,{KeyValueDef:()=>Rt,KeyValueTypes:()=>Dt,ParseUtil:()=>qt});var g={};t.r(g),t.d(g,{ColumnParser:()=>_t});var p={};t.r(p),t.d(p,{default:()=>jt});var f={};t.r(f),t.d(f,{AbstractTags:()=>Xt,AllTags:()=>Vt,Label:()=>Kt,NoTags:()=>$t,TagInfo:()=>zt,TagsFactory:()=>Yt});var b={};t.r(b),t.d(b,{Macro:()=>Zt,Token:()=>Qt});var A={};t.r(A),t.d(A,{AbstractParseMap:()=>se,AbstractTokenMap:()=>ee,CharacterMap:()=>ne,CommandMap:()=>oe,DelimiterMap:()=>ie,EnvironmentMap:()=>ce,MacroMap:()=>ae,RegExpMap:()=>re,parseResult:()=>te});var y={};t.r(y),t.d(y,{MapHandler:()=>ue,SubHandler:()=>de,SubHandlers:()=>ge});var v={};t.r(v),t.d(v,{Configuration:()=>pe,ConfigurationHandler:()=>be,ParserConfiguration:()=>Ae});var k={};t.r(k),t.d(k,{ArrayItem:()=>je,BeginItem:()=>Le,BreakItem:()=>Ne,CellItem:()=>Be,CloseItem:()=>xe,DotsItem:()=>Ue,EndItem:()=>Fe,EqnArrayItem:()=>Ke,EquationItem:()=>Xe,FnItem:()=>qe,LeftItem:()=>Se,Middle:()=>Oe,MmlItem:()=>Ge,MstyleItem:()=>ze,NonscriptItem:()=>He,NotItem:()=>_e,NullItem:()=>Te,OpenItem:()=>Me,OverItem:()=>Ce,PositionItem:()=>De,PrimeItem:()=>Pe,RightItem:()=>Ie,StartItem:()=>ke,StopItem:()=>we,StyleItem:()=>Re,SubsupItem:()=>Ee});var w={};t.r(w),t.d(w,{default:()=>rr,splitAlignArray:()=>Ze});var M={};t.r(M),t.d(M,{default:()=>ir});var x={};t.r(x),t.d(x,{BaseConfiguration:()=>pr,BaseTags:()=>gr,Other:()=>dr});var T={};t.r(T),t.d(T,{TeX:()=>fr});var P={};t.r(P),t.d(P,{FlalignItem:()=>Ar,MultlineItem:()=>br});var E={};t.r(E),t.d(E,{NewcommandPriority:()=>vr,NewcommandTables:()=>yr,NewcommandUtil:()=>kr});var C={};t.r(C),t.d(C,{AmsMethods:()=>xr});var S={};t.r(S),t.d(S,{BeginEnvItem:()=>Tr});var O={};t.r(O),t.d(O,{default:()=>Er});var I={};t.r(I),t.d(I,{NewcommandConfig:()=>Cr,NewcommandConfiguration:()=>Sr});var N={};t.r(N),t.d(N,{AmsConfiguration:()=>Ir,AmsTags:()=>Or});var L={};t.r(L),t.d(L,{RequireConfiguration:()=>Xr,RequireLoad:()=>jr,RequireMethods:()=>Kr,options:()=>zr});var F={};t.r(F),t.d(F,{AutoloadConfiguration:()=>Wr});var R={};t.r(R),t.d(R,{ConfigMacrosConfiguration:()=>es});var D={};t.r(D),t.d(D,{NoUndefinedConfiguration:()=>rs});var B={};t.r(B),t.d(B,{TextParser:()=>ss});var G={};t.r(G),t.d(G,{TextMacrosMethods:()=>as});var q={};t.r(q),t.d(q,{TextBaseConfiguration:()=>cs,TextMacrosConfiguration:()=>hs});const _=("undefined"!=typeof window?window:global).MathJax._.components.global,H=(_.GLOBAL,_.isObject,_.combineConfig,_.combineDefaults,_.combineWithMathJax),U=(_.MathJax,MathJax._.core.InputJax.AbstractInputJax),j=MathJax._.util.Options,K=(j.isObject,j.APPEND,j.REMOVE,j.OPTIONS,j.Expandable,j.expandable),z=(j.makeArray,j.keys,j.copy,j.insert),X=j.defaultOptions,$=j.userOptions,V=(j.selectOptions,j.selectOptionsFromKeys,j.separateOptions),J=j.lookup,W=MathJax._.core.FindMath.AbstractFindMath,Y=MathJax._.util.string,Q=Y.sortLength,Z=Y.quotePattern,tt=(Y.unicodeChars,Y.unicodeString,Y.isPercent,Y.split,Y.replaceUnicode),et=(Y.toEntity,MathJax._.core.MathItem),rt=et.protoItem;et.AbstractMathItem,et.STATE,et.newState;class st extends W{constructor(t){super(t),this.getPatterns()}getPatterns(){const t=this.options,e=[],r=[],s=[];this.end={},this.env=this.sub=0;let n=1;t.inlineMath.forEach((t=>this.addPattern(e,t,!1))),t.displayMath.forEach((t=>this.addPattern(e,t,!0))),e.length&&r.push(e.sort(Q).join("|")),t.processEnvironments&&(r.push("\\\\begin\\s*\\{([^}]*)\\}"),this.env=n,n++),t.processEscapes&&s.push("\\\\([\\\\$])"),t.processRefs&&s.push("(\\\\(?:eq)?ref\\s*\\{[^}]*\\})"),s.length&&(r.push("("+s.join("|")+")"),this.sub=n),this.start=new RegExp(r.join("|"),"g"),this.hasPatterns=r.length>0}addPattern(t,e,r){const[s,n]=e;t.push(Z(s)),this.end[s]=[n,r,this.endPattern(n)]}endPattern(t,e){return new RegExp((e||Z(t))+"|\\\\(?:[a-zA-Z]|.)|[{}]","g")}findEnd(t,e,r,s){const[n,i,a]=s,o=a.lastIndex=r.index+r[0].length;let c,l=0;for(;c=a.exec(t);){if((c[1]||c[0])===n&&0===l)return rt(r[0],t.substring(o,c.index),c[0],e,r.index,c.index+c[0].length,i);"{"===c[0]?l++:"}"===c[0]&&l&&l--}return null}findMathInString(t,e,r){let s,n;for(this.start.lastIndex=0;s=this.start.exec(r);){if(void 0!==s[this.env]&&this.env){const t="\\\\end\\s*(\\{"+Z(s[this.env])+"\\})";n=this.findEnd(r,e,s,["{"+s[this.env]+"}",!0,this.endPattern(null,t)]),n&&(n.math=n.open+n.math+n.close,n.open=n.close="")}else if(void 0!==s[this.sub]&&this.sub){const t=s[this.sub],r=s.index+s[this.sub].length;n=2===t.length?rt("\\",t.substring(1),"",e,s.index,r):rt("",t,"",e,s.index,r,!1)}else n=this.findEnd(r,e,s,this.end[s[0]]);n&&(t.push(n),this.start.lastIndex=n.end.n)}}findMath(t){const e=[];if(this.hasPatterns)for(let r=0,s=t.length;rString.fromCodePoint(parseInt(t,16)),getChildren:t=>t.childNodes,getText:t=>t.getText(),appendChildren(t,e){for(const r of e)t.appendChild(r)},setAttribute(t,e,r){t.attributes.set(e,r)},setProperty(t,e,r){t.setProperty(e,r)},setProperties(t,e){for(const r of Object.keys(e)){const s=e[r];"texClass"===r?(t.texClass=s,t.setProperty(r,s)):"movablelimits"===r?(t.setProperty("movablelimits",s),(t.isKind("mo")||t.isKind("mstyle"))&&t.attributes.set("movablelimits",s)):"inferred"===r||(lt.attrs.has(r)?t.setProperty(r,s):t.attributes.set(r,s))}},getProperty:(t,e)=>t.getProperty(e),getAttribute:(t,e)=>t.attributes.get(e),removeAttribute(t,e){t.attributes.unset(e)},removeProperties(t,...e){t.removeProperty(...e)},getChildAt:(t,e)=>t.childNodes[e],setChild(t,e,r){t.childNodes[e]=r,r&&(r.parent=t)},copyChildren(t,e){const r=t.childNodes;for(let t=0;tt.isKind(e),isEmbellished:t=>t.isEmbellished,getTexClass:t=>t.texClass,getCoreMO:t=>t.coreMO(),isNode:t=>t instanceof at||t instanceof ot,isInferred:t=>t.isInferred,getForm(t){if(!t.isKind("mo"))return null;const e=t,r=e.getForms();for(const t of r){const r=this.getOp(e,t);if(r)return r}return null},getOp:(t,e="infix")=>ct.OPTABLE[e][t.getText()]||null,getMoAttribute(t,e){var r,s;if(!t.attributes.isSet(e))for(const n of["infix","postfix","prefix"]){const i=null===(s=null===(r=this.getOp(t,n))||void 0===r?void 0:r[3])||void 0===s?void 0:s[e];if(void 0!==i)return i}return t.attributes.get(e)}},ht=lt;function mt(t,e,r){const s=e.attributes,n=r.attributes;t.forEach((t=>{const e=n.getExplicit(t);null!=e&&s.set(t,e)}))}function ut(t,e){const r=(t,e)=>t.getExplicitNames().filter((r=>r!==e&&("stretchy"!==r||t.getExplicit("stretchy"))&&"data-latex"!==r&&"data-latex-item"!==r)),s=t.attributes,n=e.attributes,i=r(s,"lspace"),a=r(n,"rspace");if(i.length!==a.length)return!1;for(const t of i)if(s.getExplicit(t)!==n.getExplicit(t))return!1;return!0}function dt(t,e,r){const s=[];for(const n of t.getList("m"+e+r)){const i=n.childNodes;if(i[n[e]]&&i[n[r]])continue;const a=n.parent,o=i[n[e]]?t.nodeFactory.create("node","m"+e,[i[n.base],i[n[e]]]):t.nodeFactory.create("node","m"+r,[i[n.base],i[n[r]]]);ht.copyAttributes(n,o),a.replaceChild(o,n),s.push(n)}t.removeFromList("m"+e+r,s)}function gt(t,e,r){const s=[];for(const n of t.getList(e)){if(n.attributes.get("displaystyle"))continue;const e=n.childNodes[n.base],i=e.coreMO();if(e.getProperty("movablelimits")&&!i.attributes.hasExplicit("movablelimits")){const e=t.nodeFactory.create("node",r,n.childNodes);ht.copyAttributes(n,e),n.parent.replaceChild(e,n),s.push(n)}}t.removeFromList(e,s)}const pt={cleanStretchy(t){const e=t.data;for(const t of e.getList("fixStretchy"))if(ht.getProperty(t,"fixStretchy")){const r=ht.getForm(t);r&&r[3]&&r[3].stretchy&&ht.setAttribute(t,"stretchy",!1);const s=t.parent;if(!(ht.getTexClass(t)||r&&r[2])){const r=e.nodeFactory.create("node","TeXAtom",[t]);s.replaceChild(r,t),r.inheritAttributesFrom(t)}ht.removeProperties(t,"fixStretchy")}},cleanAttributes(t){t.data.root.walkTree(((t,e)=>{const r=t.attributes,s=new Set((r.get("mjx-keep-attrs")||"").split(/ /));r.unset("mjx-keep-attrs");for(const e of r.getExplicitNames())s.has(e)||r.get(e)!==t.attributes.getInherited(e)||r.unset(e)}),{})},combineRelations(t){const e=[];for(const r of t.data.getList("mo")){if(r.getProperty("relationsCombined")||!r.parent||r.parent&&!ht.isType(r.parent,"mrow")||ht.getTexClass(r)!==it.REL)continue;let t;const s=r.parent.childNodes,n=s.indexOf(r)+1,i=ht.getProperty(r,"variantForm");for(;n"data-latex"!==t.substring(0,10))).length){const n=t.childNodes[0].childNodes[0];s.forEach((t=>n.attributes.set(t,e.get(t)))),t.parent.replaceChild(n,t),r.push(t)}}e.removeFromList("mstyle",r)}},ft=pt;var bt,At;!function(t){t.HANDLER="handler",t.FALLBACK="fallback",t.ITEMS="items",t.TAGS="tags",t.OPTIONS="options",t.NODES="nodes",t.PREPROCESSORS="preprocessors",t.POSTPROCESSORS="postprocessors",t.INIT="init",t.CONFIG="config",t.PRIORITY="priority",t.PARSER="parser"}(bt||(bt={})),function(t){t.DELIMITER="delimiter",t.MACRO="macro",t.CHARACTER="character",t.ENVIRONMENT="environment"}(At||(At={}));const yt=7.2;const vt={UNIT_CASES:new class{constructor(t){this.num="([-+]?([.,]\\d+|\\d+([.,]\\d*)?))",this.unit="",this.dimenEnd=/./,this.dimenRest=/./,this.map=new Map(t),this.updateDimen()}updateDimen(){this.unit=`(${Array.from(this.map.keys()).join("|")})`,this.dimenEnd=RegExp("^\\s*"+this.num+"\\s*"+this.unit+"\\s*$"),this.dimenRest=RegExp("^\\s*"+this.num+"\\s*"+this.unit+" ?")}set(t,e){return this.map.set(t,e),this.updateDimen(),this}get(t){return this.map.get(t)||this.map.get("pt")}delete(t){return!!this.map.delete(t)&&(this.updateDimen(),!0)}}([["em",1],["ex",.43],["pt",.1],["pc",1.2],["px",.1],["in",yt],["cm",yt/2.54],["mm",yt/25.4],["mu",1/18]]),matchDimen(t,e=!1){const r=t.match(e?vt.UNIT_CASES.dimenRest:vt.UNIT_CASES.dimenEnd);return r?function([t,e,r]){return"mu"!==e?[t,e,r]:[vt.em(vt.UNIT_CASES.get(e)*parseFloat(t)).slice(0,-2),"em",r]}([r[1].replace(/,/,"."),r[4],r[0].length]):[null,null,0]},dimen2em(t){const[e,r]=vt.matchDimen(t),s=parseFloat(e||"1");return vt.UNIT_CASES.get(r)*s},em:t=>Math.abs(t)<6e-4?"0em":t.toFixed(3).replace(/\.?0+$/,"")+"em",trimSpaces(t){if("string"!=typeof t)return t;let e=t.trim();return e.match(/\\$/)&&t.match(/ $/)&&(e+=" "),e}};class kt{constructor(t,e,r){this._factory=t,this._env=e,this.global={},this.stack=[],this.global={isInner:r},this.stack=[this._factory.create("start",this.global)],e&&(this.stack[0].env=e),this.env=this.stack[0].env}set env(t){this._env=t}get env(){return this._env}Push(...t){for(const e of t){if(!e)continue;const t=ht.isNode(e)?this._factory.create("mml",e):e;t.global=this.global;const[r,s]=this.stack.length?this.Top().checkItem(t):[null,!0];s&&(r?(this.Pop(),this.Push(...r)):(t.isKind("null")||this.stack.push(t),t.env?(t.copyEnv&&Object.assign(t.env,this.env),this.env=t.env):t.env=this.env))}}Pop(){const t=this.stack.pop();return t.isOpen||delete t.env,this.env=this.stack.length?this.Top().env:{},t}Top(t=1){return this.stack.length="0"&&s<="9")r[t]=e[parseInt(r[t],10)-1],"number"==typeof r[t]&&(r[t]=r[t].toString());else if("{"===s)if(s=r[t].substring(1),s>="0"&&s<="9")r[t]=e[parseInt(r[t].substring(1,r[t].length-1),10)-1],"number"==typeof r[t]&&(r[t]=r[t].toString());else{r[t].match(/^\{([a-z]+):%(\d+)\|(.*)\}$/)&&(r[t]="%"+r[t])}}return r.join("")}constructor(t,e,...r){this.id=t,this.message=wt.processString(e,r)}}wt.pattern=/%(\d+|\{\d+\}|\{[a-z]+:%\d+(?:\|(?:%\{\d+\}|%.|[^}])*)+\}|.)/g;const Mt=wt;class xt{constructor(t){this._nodes=t,this.startStr="",this.startI=0,this.stopI=0}get nodes(){return this._nodes}Push(...t){this._nodes.push(...t)}Pop(){return this._nodes.pop()}get First(){return this._nodes[this.Size()-1]}set First(t){this._nodes[this.Size()-1]=t}get Last(){return this._nodes[0]}set Last(t){this._nodes[0]=t}Peek(t){return null==t&&(t=1),this._nodes.slice(this.Size()-t)}Size(){return this._nodes.length}Clear(){this._nodes=[]}toMml(t=!0,e){return 1!==this._nodes.length||e?this.create("node",t?"inferredMrow":"mrow",this._nodes,{}):this.First}create(t,...e){return this.factory.configuration.nodeFactory.create(t,...e)}}class Tt extends xt{constructor(t,...e){super(e),this.factory=t,this.global={},this._properties={},this.isOpen&&(this._env={})}get kind(){return"base"}get env(){return this._env}set env(t){this._env=t}get copyEnv(){return!0}getProperty(t){return this._properties[t]}setProperty(t,e){return this._properties[t]=e,this}get isOpen(){return!1}get isClose(){return!1}get isFinal(){return!1}isKind(t){return t===this.kind}checkItem(t){if(t.isKind("over")&&this.isOpen&&(t.setProperty("num",this.toMml(!1)),this.Clear()),t.isKind("cell")&&this.isOpen){if(t.getProperty("linebreak"))return Tt.fail;throw new Mt("Misplaced","Misplaced %1",t.getName())}if(t.isClose&&this.getErrors(t.kind)){const[e,r]=this.getErrors(t.kind);throw new Mt(e,r,t.getName())}return t.isFinal?(this.Push(t.First),Tt.fail):Tt.success}clearEnv(){for(const t of Object.keys(this.env))delete this.env[t]}setProperties(t){return Object.assign(this._properties,t),this}getName(){return this.getProperty("name")}toString(){return this.kind+"["+this.nodes.join("; ")+"]"}getErrors(t){return this.constructor.errors[t]||Tt.errors[t]}}Tt.fail=[null,!1],Tt.success=[null,!0],Tt.errors={end:["MissingBeginExtraEnd","Missing \\begin{%1} or extra \\end{%1}"],close:["ExtraCloseMissingOpen","Extra close brace or missing open brace"],right:["MissingLeftExtraRight","Missing \\left or extra \\right"],middle:["ExtraMiddle","Extra \\middle"]};const Pt={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",BOLDCALLIGRAPHIC:"-tex-bold-calligraphic",OLDSTYLE:"-tex-oldstyle",BOLDOLDSTYLE:"-tex-bold-oldstyle",MATHITALIC:"-tex-mathit"},Form:{PREFIX:"prefix",INFIX:"infix",POSTFIX:"postfix"},LineBreak:{AUTO:"auto",NEWLINE:"newline",NOBREAK:"nobreak",GOODBREAK:"goodbreak",BADBREAK:"badbreak"},LineBreakStyle:{BEFORE:"before",AFTER:"after",DUPLICATE:"duplicate",INFIXLINBREAKSTYLE:"infixlinebreakstyle"},IndentAlign:{LEFT:"left",CENTER:"center",RIGHT:"right",AUTO:"auto",ID:"id",INDENTALIGN:"indentalign"},IndentShift:{INDENTSHIFT:"indentshift"},LineThickness:{THIN:"thin",MEDIUM:"medium",THICK:"thick"},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"},Align:{TOP:"top",BOTTOM:"bottom",CENTER:"center",BASELINE:"baseline",AXIS:"axis",LEFT:"left",RIGHT:"right"},Lines:{NONE:"none",SOLID:"solid",DASHED:"dashed"},Side:{LEFT:"left",RIGHT:"right",LEFTOVERLAP:"leftoverlap",RIGHTOVERLAP:"rightoverlap"},Width:{AUTO:"auto",FIT:"fit"},Actiontype:{TOGGLE:"toggle",STATUSLINE:"statusline",TOOLTIP:"tooltip",INPUT:"input"},Overflow:{LINBREAK:"linebreak",SCROLL:"scroll",ELIDE:"elide",TRUNCATE:"truncate",SCALE:"scale"},Unit:{EM:"em",EX:"ex",PX:"px",IN:"in",CM:"cm",MM:"mm",PT:"pt",PC:"pc"},Attr:{LATEX:"data-latex",LATEXITEM:"data-latex-item"}};class Et{constructor(t,e,r){this._string=t,this.configuration=r,this.macroCount=0,this.i=0,this.currentCS="",this.saveI=0;const s=Object.hasOwn(e,"isInner"),n=e.isInner;let i;if(delete e.isInner,e){i={};for(const t of Object.keys(e))i[t]=e[t]}this.configuration.pushParser(this),this.stack=new kt(this.itemFactory,i,!s||n),this.Parse(),this.Push(this.itemFactory.create("stop")),this.updateResult(this.string,this.i),this.stack.env=i}get options(){return this.configuration.options}get itemFactory(){return this.configuration.itemFactory}get tags(){return this.configuration.tags}set string(t){this._string=t}get string(){return this._string}parse(t,e){const r=this.saveI;this.saveI=this.i;const s=this.configuration.handlers.get(t).parse(e);return this.updateResult(e[1],r),this.saveI=r,s}lookup(t,e){return this.configuration.handlers.get(t).lookup(e)}contains(t,e){return this.configuration.handlers.get(t).contains(e)}toString(){let t="";for(const e of Array.from(this.configuration.handlers.keys()))t+=e+": "+this.configuration.handlers.get(e)+"\n";return t}Parse(){let t;for(;this.it.includes(e)),(t=>t))}constructor(t,e,r){this.name=t,this.verify=e,this.convert=r}}const Dt={boolean:new Rt("boolean",(t=>"true"===t||"false"===t),(t=>"true"===t)),number:new Rt("number",(t=>!!t.match(/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[-+]?\d+)?$/)),(t=>parseFloat(t))),integer:new Rt("integer",(t=>!!t.match(/^[-+]?\d+$/)),(t=>parseInt(t))),string:new Rt("string",(t=>!0),(t=>t)),dimen:new Rt("dimen",(t=>null!==vt.matchDimen(t)[0]),(t=>t))};function Bt(t,e){if(0===e)return t.replace(/^\s+/,"").replace(/([^\\\s]|^)((?:\\\\)*(?:\\\s)?)?\s+$/,"$1$2");for(;e>0;)t=t.trim().slice(1,-1),e--;return t}function Gt(t,e,r=!1,s=!1){const n=t.length;let i=0,a="",o=0,c=0,l=!0;for(;oi&&(c=i),l=!1}a+=s}if(i)throw new Mt("ExtraOpenMissingClose","Extra open brace or missing close brace");return s&&c?["","",Bt(a,1)]:[Bt(a,r?Math.min(1,c):c),"",t.slice(o)]}const qt={cols:(...t)=>t.map((t=>vt.em(t))).join(" "),fenced(t,e,r,s,n="",i=""){const a=t.nodeFactory,o=a.create("node","mrow",[],{open:e,close:s,texClass:it.INNER});let c;if(n)c=new Et("\\"+n+"l"+e,t.parser.stack.env,t).mml();else{const t=a.create("text",e);c=a.create("node","mo",[],{fence:!0,stretchy:!0,symmetric:!0,texClass:it.OPEN},t)}if(ht.appendChildren(o,[c,r]),n)c=new Et("\\"+n+"r"+s,t.parser.stack.env,t).mml();else{const t=a.create("text",s);c=a.create("node","mo",[],{fence:!0,stretchy:!0,symmetric:!0,texClass:it.CLOSE},t)}return i&&c.attributes.set("mathcolor",i),ht.appendChildren(o,[c]),o},fixedFence(t,e,r,s){const n=t.nodeFactory.create("node","mrow",[],{open:e,close:s,texClass:it.ORD});return e&&ht.appendChildren(n,[qt.mathPalette(t,e,"l")]),ht.isType(r,"mrow")?ht.appendChildren(n,ht.getChildren(r)):ht.appendChildren(n,[r]),s&&ht.appendChildren(n,[qt.mathPalette(t,s,"r")]),n},mathPalette(t,e,r){"{"!==e&&"}"!==e||(e="\\"+e);const s="{\\big"+r+" "+e+"}";return new Et("\\mathchoice"+("{\\bigg"+r+" "+e+"}")+s+s+s,{},t).mml()},fixInitialMO(t,e){for(let r=0,s=e.length;r1&&(c=[t.create("node","mrow",c)]),c},internalText(t,e,r){e=e.replace(/\n+/g," ").replace(/^ +/,Ft.nbsp).replace(/ +$/,Ft.nbsp);const s=t.create("text",e);return t.create("node","mtext",[],r,s)},underOver(t,e,r,s,n){if(qt.checkMovableLimits(e),ht.isType(e,"munderover")&&ht.isEmbellished(e)){ht.setProperties(ht.getCoreMO(e),{lspace:0,rspace:0});const r=t.create("node","mo",[],{rspace:0});e=t.create("node","mrow",[r,e])}const i=t.create("node","munderover",[e]);ht.setChild(i,"over"===s?i.over:i.under,r);let a=i;return n&&(a=t.create("node","TeXAtom",[t.create("node","mstyle",[i],{displaystyle:!0,scriptlevel:0})],{texClass:it.OP,movesupsub:!0})),ht.setProperty(a,"subsupOK",!0),a},checkMovableLimits(t){const e=ht.isType(t,"mo")?ht.getForm(t):null;(ht.getProperty(t,"movablelimits")||e&&e[3]&&e[3].movablelimits)&&ht.setProperties(t,{movablelimits:!1})},setArrayAlign:(t,e,r)=>(r||(e=vt.trimSpaces(e||"")),"t"===e?t.arraydef.align="baseline 1":"b"===e?t.arraydef.align="baseline -1":"c"===e?t.arraydef.align="axis":e&&(r?(r.string=`[${e}]`+r.string.slice(r.i),r.i=0):t.arraydef.align=e),t),substituteArgs(t,e,r){let s="",n="",i=0;for(;ie.length)throw new Mt("IllegalMacroParam","Illegal macro parameter reference");n=qt.addArgs(t,qt.addArgs(t,n,s),e[parseInt(a,10)-1]),s=""}else s+=a}return qt.addArgs(t,n,s)},addArgs(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 Mt("MaxBufferSize","MathJax internal buffer size exceeded; is there a recursive macro call?");return e+r},checkMaxMacros(t,e=!0){if(!(++t.macroCount<=t.configuration.options.maxMacros))throw e?new Mt("MaxMacroSub1","MathJax maximum macro substitution count exceeded; is here a recursive macro call?"):new Mt("MaxMacroSub2","MathJax maximum substitution count exceeded; is there a recursive latex environment?")},checkEqnEnv(t,e=!0){const r=t.stack.Top(),s=r.First;if(!(r.getProperty("nestable")&&e&&!s||r.getProperty("nestStart"))&&(!r.isKind("start")||s))throw new Mt("ErroneousNestingEq","Erroneous nesting of equation structures")},copyNode(t,e){const r=t.copy(),s=e.configuration;return r.walkTree((t=>{s.addNode(t.kind,t);const e=(t.getProperty("in-lists")||"").split(/,/);for(const r of e)r&&s.addNode(r,t)})),r},mmlFilterAttribute:(t,e,r)=>r,getFontDef(t){const e=t.stack.env.font;return e?{mathvariant:e}:{}},keyvalOptions(t,e=null,r=!1,s=!1){const n=function(t,e=!1){const r={};let s,n,i,a=t,o=!0;for(;a;)[n,s,a]=Gt(a,["=",","],e,o),o=!1,"="===s?([i,s,a]=Gt(a,[","],e),i="false"===i||"true"===i?JSON.parse(i):i,r[n]=i):n&&(r[n]=!0);return r}(t,s);if(e)for(const t of Object.keys(n))if(Object.hasOwn(e,t)){if(e[t]instanceof Rt){const r=e[t],s=String(n[t]);if(!r.verify(s))throw new Mt("InvalidValue","Value for key '%1' is not of the expected type",t);n[t]=r.convert(s)}}else{if(r)throw new Mt("InvalidOption","Invalid option: %1",t);delete n[t]}return n},isLatinOrGreekChar:t=>!!t.normalize("NFD").match(/[a-zA-Z\u0370-\u03F0]/)};class _t{constructor(){this.columnHandler={l:t=>t.calign[t.j++]="left",c:t=>t.calign[t.j++]="center",r:t=>t.calign[t.j++]="right",p:t=>this.getColumn(t,"top"),m:t=>this.getColumn(t,"middle"),b:t=>this.getColumn(t,"bottom"),w:t=>this.getColumn(t,"top",""),W:t=>this.getColumn(t,"top",""),"|":t=>this.addRule(t,"solid"),":":t=>this.addRule(t,"dashed"),">":t=>t.cstart[t.j]=(t.cstart[t.j]||"")+this.getBraces(t),"<":t=>t.cend[t.j-1]=(t.cend[t.j-1]||"")+this.getBraces(t),"@":t=>this.addAt(t,this.getBraces(t)),"!":t=>this.addBang(t,this.getBraces(t)),"*":t=>this.repeat(t),P:t=>this.macroColumn(t,">{$}p{#1}<{$}",1),M:t=>this.macroColumn(t,">{$}m{#1}<{$}",1),B:t=>this.macroColumn(t,">{$}b{#1}<{$}",1)," ":t=>{}},this.MAXCOLUMNS=1e4}process(t,e,r){const s={parser:t,template:e,i:0,j:0,c:"",cwidth:[],calign:[],cspace:[],clines:[],cstart:r.cstart,cend:r.cend,ralign:r.ralign,cextra:r.cextra};let n=0;for(;s.ithis.MAXCOLUMNS)throw new Mt("MaxColumns","Too many column specifiers (perhaps looping column definitions?)");const t=s.template.codePointAt(s.i),e=s.c=String.fromCodePoint(t);if(s.i+=e.length,!Object.hasOwn(this.columnHandler,e))throw new Mt("BadPreamToken","Illegal pream-token (%1)",e);this.columnHandler[e](s)}this.setColumnAlign(s,r),this.setColumnWidths(s,r),this.setColumnSpacing(s,r),this.setColumnLines(s,r),this.setPadding(s,r)}setColumnAlign(t,e){e.arraydef.columnalign=t.calign.join(" ")}setColumnWidths(t,e){if(!t.cwidth.length)return;const r=[...t.cwidth];r.lengtht||"auto")).join(" ")}setColumnSpacing(t,e){if(!t.cspace.length)return;const r=[...t.cspace];r.lengtht||"1em")).join(" ")}setColumnLines(t,e){if(!t.clines.length)return;const r=[...t.clines];r[0]&&e.frame.push(["left",r[0]]),r.length>t.calign.length?e.frame.push(["right",r.pop()]):r.length1&&(e.arraydef.columnlines=r.slice(1).map((t=>t||"none")).join(" "))}setPadding(t,e){if(!t.cextra[0]&&!t.cextra[t.calign.length-1])return;const r=t.calign.length-1,s=t.cspace,n=t.cextra[r]?s[r]:null;e.arraydef["data-array-padding"]=`${s[0]||".5em"} ${n||".5em"}`}getColumn(t,e,r="left"){t.calign[t.j]=r||this.getAlign(t),t.cwidth[t.j]=this.getDimen(t),t.ralign[t.j]=[e,t.cwidth[t.j],t.calign[t.j]],t.j++}getDimen(t){const e=this.getBraces(t);if(!vt.matchDimen(e)[0])throw new Mt("MissingColumnDimOrUnits","Missing dimension or its units for %1 column declaration",t.c);return e}getAlign(t){const e=this.getBraces(t);return J(e.toLowerCase(),{l:"left",c:"center",r:"right"},"")}getBraces(t){for(;" "===t.template[t.i];)t.i++;if(t.i>=t.template.length)throw new Mt("MissingArgForColumn","Missing argument for %1 column declaration",t.c);if("{"!==t.template[t.i])return t.template[t.i++];const e=++t.i;let r=1;for(;t.i0&&r--;)s.push(this.getBraces(t));t.template=qt.substituteArgs(t.parser,s,e)+t.template.slice(t.i),t.i=0}addRule(t,e){t.clines[t.j]&&this.addAt(t,"\\,"),t.clines[t.j]=e,"0"===t.cspace[t.j]&&(t.cstart[t.j]="\\hspace{.5em}")}addAt(t,e){const{cstart:r,cspace:s,j:n}=t;t.cextra[n]=!0,t.calign[n]="center",t.clines[n]&&(".5em"===s[n]?r[n-1]+="\\hspace{.25em}":s[n]||(t.cend[n-1]=(t.cend[n-1]||"")+"\\hspace{.5em}")),r[n]=e,s[n]="0",s[++t.j]="0"}addBang(t,e){const{cstart:r,cspace:s,j:n}=t;t.cextra[n]=!0,t.calign[n]="center",r[n]=("0"===s[n]&&t.clines[n]?"\\hspace{.25em}":"")+e,s[n]||(s[n]=".5em"),s[++t.j]=".5em"}repeat(t){const e=this.getBraces(t),r=this.getBraces(t),s=parseInt(e);if(String(s)!==e)throw new Mt("ColArgNotNum","First argument to %1 column specifier must be a number","*");t.template=new Array(s).fill(r).join("")+t.template.substring(t.i),t.i=0}}const Ht=Pt.Variant;class Ut{constructor(t,e=[]){this.options={},this.columnParser=new _t,this.packageData=new Map,this.parsers=[],this.root=null,this.nodeLists={},this.error=!1,this.handlers=t.handlers,this.nodeFactory=new Nt,this.nodeFactory.configuration=this,this.nodeFactory.setCreators(t.nodes),this.itemFactory=new It(t.items),this.itemFactory.configuration=this,X(this.options,...e),X(this.options,t.options),this.mathStyle=Ut.getVariant.get(this.options.mathStyle)||Ut.getVariant.get("TeX")}pushParser(t){this.parsers.unshift(t)}popParser(){this.parsers.shift()}get parser(){return this.parsers[0]}clear(){this.parsers=[],this.root=null,this.nodeLists={},this.error=!1,this.tags.resetTag()}addNode(t,e){let r=this.nodeLists[t];if(r||(r=this.nodeLists[t]=[]),r.push(e),e.kind!==t){const r=ht.getProperty(e,"in-lists")||"",s=(r?r.split(/,/):[]).concat(t).join(",");ht.setProperty(e,"in-lists",s)}}getList(t){const e=this.nodeLists[t]||[],r=[];for(const t of e)this.inTree(t)&&r.push(t);return this.nodeLists[t]=r,r}removeFromList(t,e){const r=this.nodeLists[t]||[];for(const t of e){const e=r.indexOf(t);e>=0&&r.splice(e,1)}}inTree(t){for(;t&&t!==this.root;)t=t.parent;return!!t}}Ut.getVariant=new Map([["TeX",(t,e)=>e&&t.match(/^[\u0391-\u03A9\u03F4]/)?Ht.NORMAL:""],["ISO",t=>Ht.ITALIC],["French",t=>t.normalize("NFD").match(/^[a-z]/)?Ht.ITALIC:Ht.NORMAL],["upright",t=>Ht.NORMAL]]);const jt=Ut;class Kt{constructor(t="???",e=""){this.tag=t,this.id=e}}class zt{constructor(t="",e=!1,r=!1,s=null,n="",i="",a=!1,o=""){this.env=t,this.taggable=e,this.defaultTags=r,this.tag=s,this.tagId=n,this.tagFormat=i,this.noTag=a,this.labelId=o}}class Xt{constructor(){this.counter=0,this.allCounter=0,this.configuration=null,this.ids={},this.allIds={},this.labels={},this.allLabels={},this.redo=!1,this.refUpdate=!1,this.currentTag=new zt,this.history=[],this.stack=[],this.enTag=function(t,e){const r=this.configuration.nodeFactory,s=r.create("node","mtd",[t]),n=r.create("node","mlabeledtr",[e,s]);return r.create("node","mtable",[n],{side:this.configuration.options.tagSide,minlabelspacing:this.configuration.options.tagIndent,displaystyle:!0})}}start(t,e,r){this.currentTag&&this.stack.push(this.currentTag);const s=this.label;this.currentTag=new zt(t,e,r),this.label=s}get env(){return this.currentTag.env}end(){this.history.push(this.currentTag);const t=this.label;this.currentTag=this.stack.pop(),t&&!this.label&&(this.label=t)}tag(t,e){this.currentTag.tag=t,this.currentTag.tagFormat=e?t:this.formatTag(t),this.currentTag.noTag=!1}notag(){this.tag("",!0),this.currentTag.noTag=!0}get noTag(){return this.currentTag.noTag}set label(t){this.currentTag.labelId=t}get label(){return this.currentTag.labelId}formatUrl(t,e){return e+"#"+encodeURIComponent(t)}formatTag(t){return"("+t+")"}formatRef(t){return this.formatTag(t)}formatId(t){return"mjx-eqn:"+t.replace(/\s/g,"_")}formatNumber(t){return t.toString()}autoTag(){null==this.currentTag.tag&&(this.counter++,this.tag(this.formatNumber(this.counter),!1))}clearTag(){this.tag(null,!0),this.currentTag.tagId=""}getTag(t=!1){if(t)return this.autoTag(),this.makeTag();const e=this.currentTag;return e.taggable&&!e.noTag&&(e.defaultTags&&this.autoTag(),e.tag)?this.makeTag():null}resetTag(){this.history=[],this.redo=!1,this.refUpdate=!1,this.clearTag()}reset(t=0){this.resetTag(),this.counter=this.allCounter=t,this.allLabels={},this.allIds={},this.label=""}startEquation(t){this.history=[],this.stack=[],this.clearTag(),this.currentTag=new zt("",void 0,void 0),this.labels={},this.ids={},this.counter=this.allCounter,this.redo=!1;const e=t.inputData.recompile;e&&(this.refUpdate=!0,this.counter=e.counter)}finishEquation(t){this.redo&&(t.inputData.recompile={state:t.state(),counter:this.allCounter}),this.refUpdate||(this.allCounter=this.counter),Object.assign(this.allIds,this.ids),Object.assign(this.allLabels,this.labels)}finalize(t,e){if(!e.display||this.currentTag.env||null==this.currentTag.tag)return t;const r=this.makeTag();return this.enTag(t,r)}makeId(){this.currentTag.tagId=this.formatId(this.configuration.options.useLabelIds&&this.label||this.currentTag.tag)}makeTag(){this.makeId(),this.label&&(this.labels[this.label]=new Kt(this.currentTag.tag,this.currentTag.tagId),this.label="");const t=new Et("\\text{"+this.currentTag.tagFormat+"}",{},this.configuration).mml();return this.configuration.nodeFactory.create("node","mtd",[t],{id:this.currentTag.tagId,rowalign:this.configuration.options.tagAlign})}}class $t extends Xt{autoTag(){}getTag(){return this.currentTag.tag?super.getTag():null}}class Vt extends Xt{finalize(t,e){if(!e.display||this.history.find((function(t){return t.taggable})))return t;const r=this.getTag(!0);return this.enTag(t,r)}}const Jt=new Map([["none",$t],["all",Vt]]);let Wt="none";const Yt={OPTIONS:{tags:Wt,tagSide:"right",tagIndent:"0.8em",useLabelIds:!0,ignoreDuplicateLabels:!1,tagAlign:"baseline"},add(t,e){Jt.set(t,e)},addTags(t){for(const e of Object.keys(t))Yt.add(e,t[e])},create(t){const e=Jt.get(t)||Jt.get(Wt);if(!e)throw Error("Unknown tags class");return new e},setDefault(t){Wt=t},getDefault:()=>Yt.create(Wt)};class Qt{constructor(t,e,r){this._token=t,this._char=e,this._attributes=r}get token(){return this._token}get char(){return this._char}get attributes(){return this._attributes}}class Zt{constructor(t,e,r=[]){this._token=t,this._func=e,this._args=r}get token(){return this._token}get func(){return this._func}get args(){return this._args}}function te(t){return void 0===t||t}class ee{constructor(t,e){this._name=t,this._parser=e,ue.register(this)}get name(){return this._name}parserFor(t){return this.contains(t)?this.parser:null}parse([t,e]){const r=this.parserFor(e),s=this.lookup(e);return r&&s?te(r(t,s)):null}set parser(t){this._parser=t}get parser(){return this._parser}}class re extends ee{constructor(t,e,r){super(t,e),this._regExp=r}contains(t){return this._regExp.test(t)}lookup(t){return this.contains(t)?t:null}}class se extends ee{constructor(){super(...arguments),this.map=new Map}lookup(t){return this.map.get(t)}contains(t){return this.map.has(t)}add(t,e){this.map.set(t,e)}remove(t){this.map.delete(t)}}class ne extends se{constructor(t,e,r){super(t,e);for(const t of Object.keys(r)){const e=r[t],[s,n]="string"==typeof e?[e,null]:e,i=new Qt(t,s,n);this.add(t,i)}}}class ie extends ne{parse([t,e]){return super.parse([t,"\\"+e])}}class ae extends se{constructor(t,e,r={}){super(t,null);const s=t=>"string"==typeof t?r[t]:t;for(const[t,r]of Object.entries(e)){let e,n;Array.isArray(r)?(e=s(r[0]),n=r.slice(1)):(e=s(r),n=[]);const i=new Zt(t,e,n);this.add(t,i)}}parserFor(t){const e=this.lookup(t);return e?e.func:null}parse([t,e]){const r=this.lookup(e),s=this.parserFor(e);return r&&s?te(s(t,r.token,...r.args)):null}}class oe extends ae{parse([t,e]){const r=this.lookup(e),s=this.parserFor(e);if(!r||!s)return null;const n=t.currentCS;t.currentCS="\\"+e;const i=s(t,"\\"+r.token,...r.args);return t.currentCS=n,te(i)}}class ce extends ae{constructor(t,e,r,s={}){super(t,r,s),this.parser=e}parse([t,e]){const r=this.lookup(e),s=this.parserFor(e);return r&&s?te(this.parser(t,r.token,s,r.args)):null}}const le=MathJax._.util.PrioritizedList.PrioritizedList,he=MathJax._.util.FunctionList.FunctionList,me=new Map,ue={register(t){me.set(t.name,t)},getMap:t=>me.get(t)};class de{constructor(){this._configuration=new le,this._fallback=new he}add(t,e,r=le.DEFAULTPRIORITY){for(const e of t.slice().reverse()){const t=ue.getMap(e);if(!t)return void this.warn(`Configuration '${e}' not found! Omitted.`);this._configuration.add(t,r)}e&&this._fallback.add(e,r)}remove(t,e=null){for(const e of t){const t=this.retrieve(e);t&&this._configuration.remove(t)}e&&this._fallback.remove(e)}parse(t){for(const{item:e}of this._configuration){const r=e.parse(t);if(r===de.FALLBACK)break;if(r)return r}const[e,r]=t;Array.from(this._fallback)[0].item(e,r)}lookup(t){const e=this.applicable(t);return e?e.lookup(t):null}contains(t){const e=this.applicable(t);return!(!e||e instanceof ne&&null===e.lookup(t).char)}toString(){const t=[];for(const{item:e}of this._configuration)t.push(e.name);return t.join(", ")}applicable(t){for(const{item:e}of this._configuration)if(e.contains(t))return e;return null}retrieve(t){for(const{item:e}of this._configuration)if(e.name===t)return e;return null}warn(t){console.log("TexParser Warning: "+t)}}de.FALLBACK=Symbol("fallback");class ge{constructor(){this.map=new Map}add(t,e,r=le.DEFAULTPRIORITY){for(const s of Object.keys(t)){const n=s;let i=this.get(n);i||(i=new de,this.set(n,i)),i.add(t[n],e[n],r)}}remove(t,e){for(const r of Object.keys(t)){const s=this.get(r);s&&s.remove(t[r],e[r])}}set(t,e){this.map.set(t,e)}get(t){return this.map.get(t)}retrieve(t){for(const e of this.map.values()){const r=e.retrieve(t);if(r)return r}return null}keys(){return this.map.keys()}}class pe{static makeProcessor(t,e){return Array.isArray(t)?t:[t,e]}static _create(t,e={}){var r;const s=null!==(r=e.priority)&&void 0!==r?r:le.DEFAULTPRIORITY,n=e.init?this.makeProcessor(e.init,s):null,i=e.config?this.makeProcessor(e.config,s):null,a=(e.preprocessors||[]).map((t=>this.makeProcessor(t,s))),o=(e.postprocessors||[]).map((t=>this.makeProcessor(t,s))),c=e.parser||"tex";return new pe(t,e[bt.HANDLER]||{},e[bt.FALLBACK]||{},e[bt.ITEMS]||{},e[bt.TAGS]||{},e[bt.OPTIONS]||{},e[bt.NODES]||{},a,o,n,i,s,c)}static create(t,e={}){const r=pe._create(t,e);return be.set(t,r),r}static local(t={}){return pe._create("",t)}constructor(t,e={},r={},s={},n={},i={},a={},o=[],c=[],l=null,h=null,m,u){this.name=t,this.handler=e,this.fallback=r,this.items=s,this.tags=n,this.options=i,this.nodes=a,this.preprocessors=o,this.postprocessors=c,this.initMethod=l,this.configMethod=h,this.priority=m,this.parser=u,this.handler=Object.assign({[At.CHARACTER]:[],[At.DELIMITER]:[],[At.MACRO]:[],[At.ENVIRONMENT]:[]},e)}get init(){return this.initMethod?this.initMethod[0]:null}get config(){return this.configMethod?this.configMethod[0]:null}}const fe=new Map,be={set(t,e){fe.set(t,e)},get:t=>fe.get(t),keys:()=>fe.keys()};class Ae{constructor(t,e=["tex"]){this.initMethod=new he,this.configMethod=new he,this.configurations=new le,this.parsers=[],this.handlers=new ge,this.items={},this.tags={},this.options={},this.nodes={},this.parsers=e;for(const e of t.slice().reverse())this.addPackage(e);for(const{item:t,priority:e}of this.configurations)this.append(t,e)}init(){this.initMethod.execute(this)}config(t){this.configMethod.execute(this,t);for(const e of this.configurations)this.addFilters(t,e.item)}addPackage(t){const e="string"==typeof t?t:t[0],r=this.getPackage(e);r&&this.configurations.add(r,"string"==typeof t?r.priority:t[1])}add(t,e,r={}){const s=this.getPackage(t);this.append(s),this.configurations.add(s,s.priority),this.init();const n=e.parseOptions;n.nodeFactory.setCreators(s.nodes);for(const t of Object.keys(s.items))n.itemFactory.setNodeClass(t,s.items[t]);Yt.addTags(s.tags),X(n.options,s.options),$(n.options,r),this.addFilters(e,s),s.config&&s.config(this,e)}getPackage(t){const e=be.get(t);if(e&&!this.parsers.includes(e.parser))throw Error(`Package '${t}' doesn't target the proper parser`);return e||this.warn(`Package '${t}' not found. Omitted.`),e}append(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),X(this.options,t.options),Object.assign(this.nodes,t.nodes)}addFilters(t,e){for(const[r,s]of e.preprocessors)t.preFilters.add(r,s);for(const[r,s]of e.postprocessors)t.postFilters.add(r,s)}warn(t){console.warn("MathJax Warning: "+t)}}const ye=MathJax._.util.Styles,ve=ye.TRBL;ye.WSC,ye.Styles;class ke extends Tt{constructor(t,e){super(t),this.global=e}get kind(){return"start"}get isOpen(){return!0}checkItem(t){if(t.isKind("stop")){let t=this.toMml();return this.global.isInner||(t=this.factory.configuration.tags.finalize(t,this.env)),[[this.factory.create("mml",t)],!0]}return super.checkItem(t)}}class we extends Tt{get kind(){return"stop"}get isClose(){return!0}}class Me extends Tt{get kind(){return"open"}get isOpen(){return!0}checkItem(t){if(t.isKind("close")){const e=this.toMml(),r=this.create("node","TeXAtom",[e]);return $e(r,t),[[this.factory.create("mml",r)],!0]}return super.checkItem(t)}}Me.errors=Object.assign(Object.create(Tt.errors),{stop:["ExtraOpenMissingClose","Extra open brace or missing close brace"]});class xe extends Tt{get kind(){return"close"}get isClose(){return!0}}class Te extends Tt{get kind(){return"null"}}class Pe extends Tt{get kind(){return"prime"}checkItem(t){const[e,r]=this.Peek(2),s=(ht.isType(e,"msubsup")||ht.isType(e,"msup"))&&!ht.getChildAt(e,e.sup),n=(ht.isType(e,"munderover")||ht.isType(e,"mover"))&&!ht.getChildAt(e,e.over)&&!ht.getProperty(e,"subsupOK");if(!s&&!n){return[[this.create("node",e.getProperty("movesupsub")?"mover":"msup",[e,r]),t],!0]}const i=s?e.sup:e.over;return ht.setChild(e,i,r),[[e,t],!0]}}class Ee extends Tt{get kind(){return"subsup"}checkItem(t){if(t.isKind("open")||t.isKind("left"))return Tt.success;const e=this.First,r=this.getProperty("position");if(t.isKind("mml")){if(this.getProperty("primes"))if(2!==r)ht.setChild(e,2,this.getProperty("primes"));else{ht.setProperty(this.getProperty("primes"),"variantForm",!0);const e=this.create("node","mrow",[this.getProperty("primes"),t.First]);t.First=e}ht.setChild(e,r,t.First),null!=this.getProperty("movesupsub")&&ht.setProperty(e,"movesupsub",this.getProperty("movesupsub"));return[[this.factory.create("mml",e)],!0]}super.checkItem(t);const s=this.getErrors(["","sub","sup"][r]);throw new Mt(s[0],s[1],...s.splice(2))}}Ee.errors=Object.assign(Object.create(Tt.errors),{stop:["MissingScript","Missing superscript or subscript argument"],sup:["MissingOpenForSup","Missing open brace for superscript"],sub:["MissingOpenForSub","Missing open brace for subscript"]});class Ce extends Tt{constructor(t){super(t),this.setProperty("name","\\over")}get kind(){return"over"}get isClose(){return!0}checkItem(t){if(t.isKind("over"))throw new Mt("AmbiguousUseOf","Ambiguous use of %1",t.getName());if(t.isClose){let e=this.create("node","mfrac",[this.getProperty("num"),this.toMml(!1)]);return null!=this.getProperty("thickness")&&ht.setAttribute(e,"linethickness",this.getProperty("thickness")),(this.getProperty("ldelim")||this.getProperty("rdelim"))&&(ht.setProperty(e,"withDelims",!0),e=qt.fixedFence(this.factory.configuration,this.getProperty("ldelim"),e,this.getProperty("rdelim"))),e.attributes.set(Pt.Attr.LATEXITEM,this.getProperty("name")),[[this.factory.create("mml",e),t],!0]}return super.checkItem(t)}toString(){return"over["+this.getProperty("num")+" / "+this.nodes.join("; ")+"]"}}class Se extends Tt{constructor(t,e){super(t),this.setProperty("delim",e)}get kind(){return"left"}get isOpen(){return!0}checkItem(t){if(t.isKind("right")){const e=qt.fenced(this.factory.configuration,this.getProperty("delim"),this.toMml(),t.getProperty("delim"),"",t.getProperty("color")),r=e.childNodes[0],s=e.childNodes[e.childNodes.length-1],n=this.factory.create("mml",e);return $e(r,this,"\\left"),$e(s,t,"\\right"),n.Peek()[0].attributes.set(Pt.Attr.LATEXITEM,"\\left"+t.startStr.slice(this.startI,t.stopI)),[[n],!0]}if(t.isKind("middle")){const e={stretchy:!0};t.getProperty("color")&&(e.mathcolor=t.getProperty("color"));const r=this.create("token","mo",e,t.getProperty("delim"));return $e(r,t,"\\middle"),this.Push(this.create("node","TeXAtom",[],{texClass:it.CLOSE}),r,this.create("node","TeXAtom",[],{texClass:it.OPEN})),this.env={},[[this],!0]}return super.checkItem(t)}}Se.errors=Object.assign(Object.create(Tt.errors),{stop:["ExtraLeftMissingRight","Extra \\left or missing \\right"]});class Oe extends Tt{constructor(t,e,r){super(t),this.setProperty("delim",e),r&&this.setProperty("color",r)}get kind(){return"middle"}get isClose(){return!0}}class Ie extends Tt{constructor(t,e,r){super(t),this.setProperty("delim",e),r&&this.setProperty("color",r)}get kind(){return"right"}get isClose(){return!0}}class Ne extends Tt{get kind(){return"break"}constructor(t,e,r){super(t),this.setProperty("linebreak",e),this.setProperty("insert",r)}checkItem(t){var e,r;const s=this.getProperty("linebreak");if(t.isKind("mml")){const n=t.First;if(n.isKind("mo")){if("after"!==((null===(r=null===(e=ht.getOp(n))||void 0===e?void 0:e[3])||void 0===r?void 0:r.linebreakstyle)||ht.getAttribute(n,"linebreakstyle")))return ht.setAttribute(n,"linebreak",s),[[t],!0];if(!this.getProperty("insert"))return[[t],!0]}}const n=this.create("token","mspace",{linebreak:s});return[[this.factory.create("mml",n),t],!0]}}class Le extends Tt{get kind(){return"begin"}get isOpen(){return!0}checkItem(t){if(t.isKind("end")){if(t.getName()!==this.getName())throw new Mt("EnvBadEnd","\\begin{%1} ended with \\end{%2}",this.getName(),t.getName());const e=this.toMml();return $e(e,t),[[this.factory.create("mml",e)],!0]}if(t.isKind("stop"))throw new Mt("EnvMissingEnd","Missing \\end{%1}",this.getName());return super.checkItem(t)}}class Fe extends Tt{get kind(){return"end"}get isClose(){return!0}}class Re extends Tt{get kind(){return"style"}checkItem(t){if(!t.isClose)return super.checkItem(t);const e=this.create("node","mstyle",this.nodes,this.getProperty("styles"));return[[this.factory.create("mml",e),t],!0]}}class De extends Tt{get kind(){return"position"}checkItem(t){if(t.isClose)throw new Mt("MissingBoxFor","Missing box for %1",this.getName());if(t.isFinal){let e=t.toMml();switch(this.getProperty("move")){case"vertical":return e=this.create("node","mpadded",[e],{height:this.getProperty("dh"),depth:this.getProperty("dd"),voffset:this.getProperty("dh")}),[[this.factory.create("mml",e)],!0];case"horizontal":return[[this.factory.create("mml",this.getProperty("left")),t,this.factory.create("mml",this.getProperty("right"))],!0]}}return super.checkItem(t)}}class Be extends Tt{get kind(){return"cell"}get isClose(){return!0}}class Ge extends Tt{get isFinal(){return!0}get kind(){return"mml"}}class qe extends Tt{get kind(){return"fn"}checkItem(t){const e=this.First;if(e){if(t.isOpen)return Tt.success;if(!t.isKind("fn")){let r=t.First;if(!t.isKind("mml")||!r)return[[e,t],!0];if(ht.isType(r,"mstyle")&&r.childNodes.length&&ht.isType(r.childNodes[0].childNodes[0],"mspace")||ht.isType(r,"mspace"))return[[e,t],!0];ht.isEmbellished(r)&&(r=ht.getCoreMO(r));const s=ht.getForm(r);if(null!=s&&[0,0,1,1,0,1,1,0,0,0][s[2]])return[[e,t],!0]}return[[e,this.create("token","mo",{texClass:it.NONE},Ft.ApplyFunction),t],!0]}return super.checkItem(t)}}class _e extends Tt{constructor(){super(...arguments),this.remap=ue.getMap("not_remap")}get kind(){return"not"}checkItem(t){let e,r,s;if(t.isKind("open")||t.isKind("left"))return Tt.success;if(t.isKind("mml")&&(ht.isType(t.First,"mo")||ht.isType(t.First,"mi")||ht.isType(t.First,"mtext"))&&(e=t.First,r=ht.getText(e),1===r.length&&!ht.getProperty(e,"movesupsub")&&1===ht.getChildren(e).length))return this.remap.contains(r)?(s=this.create("text",this.remap.lookup(r).char),ht.setChild(e,0,s)):(s=this.create("text","\u0338"),ht.appendChildren(e,[s])),[[t],!0];s=this.create("text","\u29f8");const n=this.create("node","mtext",[],{},s),i=this.create("node","mpadded",[n],{width:0});return e=this.create("node","TeXAtom",[i],{texClass:it.REL}),[[e,t],!0]}}class He extends Tt{get kind(){return"nonscript"}checkItem(t){if(t.isKind("mml")&&1===t.Size()){let e=t.First;if(e.isKind("mstyle")&&e.notParent&&(e=ht.getChildren(ht.getChildren(e)[0])[0]),e.isKind("mspace")){if(e!==t.First){const e=this.create("node","mrow",[t.Pop()]);t.Push(e)}this.factory.configuration.addNode("nonscript",t.First)}}return[[t],!0]}}class Ue extends Tt{get kind(){return"dots"}checkItem(t){if(t.isKind("open")||t.isKind("left"))return Tt.success;let e=this.getProperty("ldots");const r=t.First;if(t.isKind("mml")&&ht.isEmbellished(r)){const t=ht.getTexClass(ht.getCoreMO(r));t!==it.BIN&&t!==it.REL||(e=this.getProperty("cdots"))}return[[e,t],!0]}}class je extends Tt{constructor(){super(...arguments),this.table=[],this.row=[],this.frame=[],this.hfill=[],this.arraydef={},this.cstart=[],this.cend=[],this.cextra=[],this.atEnd=!1,this.ralign=[],this.breakAlign={cell:"",row:"",table:""},this.templateSubs=0}get kind(){return"array"}get isOpen(){return!0}get copyEnv(){return!1}checkItem(t){if(t.isClose&&!t.isKind("over")){if(t.getProperty("isEntry"))return this.EndEntry(),this.clearEnv(),this.StartEntry(),Tt.fail;if(t.getProperty("isCR"))return this.EndEntry(),this.EndRow(),this.clearEnv(),this.StartEntry(),Tt.fail;this.EndTable(),this.clearEnv();const e=this.factory.create("mml",this.createMml());if(this.getProperty("requireClose")){if(t.isKind("close"))return[[e],!0];throw new Mt("MissingCloseBrace","Missing close brace")}return[[e,t],!0]}return super.checkItem(t)}createMml(){const t=this.arraydef.scriptlevel;delete this.arraydef.scriptlevel;let e=this.create("node","mtable",this.table,this.arraydef);return t&&e.setProperty("smallmatrix",!0),this.breakAlign.table&&ht.setAttribute(e,"data-break-align",this.breakAlign.table),this.getProperty("arrayPadding")&&(ht.setAttribute(e,"data-frame-styles",""),ht.setAttribute(e,"framespacing",this.getProperty("arrayPadding"))),e=this.handleFrame(e),void 0!==t&&(e=this.create("node","mstyle",[e],{scriptlevel:t})),(this.getProperty("open")||this.getProperty("close"))&&(e=qt.fenced(this.factory.configuration,this.getProperty("open"),e,this.getProperty("close"))),e}handleFrame(t){if(!this.frame.length)return t;const e=new Map(this.frame),r=this.frame.reduce(((t,[,e])=>e===t?e:""),this.frame[0][1]);if(r){if(4===this.frame.length)return ht.setAttribute(t,"frame",r),ht.removeAttribute(t,"data-frame-styles"),t;if("solid"===r)return ht.setAttribute(t,"data-frame-styles",""),t=this.create("node","menclose",[t],{notation:Array.from(e.keys()).join(" "),"data-padding":0})}const s=ve.map((t=>e.get(t)||"none")).join(" ");return ht.setAttribute(t,"data-frame-styles",s),t}StartEntry(){const t=this.row.length;let e=this.cstart[t],r=this.cend[t];const s=this.ralign[t],n=this.cextra;if(!(e||r||s||n[t]||n[t+1]))return;let[i,a,o,c]=this.getEntry();if(!n[t]||this.atEnd&&!n[t+1]||(e+="&"),"&"!==o&&(c=!!a.trim()||!!(t||o&&"\\end"!==o.substring(0,4)),n[t+1]&&!n[t]&&(r=(r||"")+"&",this.atEnd=!0)),!c&&!i)return;const l=this.parser;if(c&&(e&&(a=qt.addArgs(l,e,a)),r&&(a=qt.addArgs(l,a,r)),s&&(a="\\text{"+a.trim()+"}"),(e||r||s)&&++this.templateSubs>l.configuration.options.maxTemplateSubtitutions))throw new Mt("MaxTemplateSubs","Maximum template substitutions exceeded; is there an invalid use of \\\\ in the template?");i&&(a=qt.addArgs(l,i,a)),l.string=qt.addArgs(l,a,l.string),l.i=0}getEntry(){const t=this.parser,e=/^([^]*?)([&{}]|\\\\|\\(?:begin|end)\s*\{array\}|\\cr|\\)/;let r,s=0,n=0,i=t.i;const a=["","","",!1];for(;null!==(r=t.string.slice(i).match(e));)switch(i+=r[0].length,r[2]){case"\\":i++;break;case"{":s++;break;case"}":if(!s)return a;s--;break;case"\\begin{array}":s||n++;break;case"\\end{array}":if(!s&&n){n--;break}default:{if(s||n)continue;i-=r[2].length;let e=t.string.slice(t.i,i).trim();const a=e.match(/^(?:\s*\\(?:h(?:dash)?line|hfil{1,3}|rowcolor\s*\{.*?\}))+/);return a&&(e=e.slice(a[0].length)),t.string=t.string.slice(i),t.i=0,[(null==a?void 0:a[0])||"",e,r[2],!0]}}return a}EndEntry(){const t=this.create("node","mtd",this.nodes);this.hfill.length&&(0===this.hfill[0]&&ht.setAttribute(t,"columnalign","right"),this.hfill[this.hfill.length-1]===this.Size()&&ht.setAttribute(t,"columnalign",ht.getAttribute(t,"columnalign")?"center":"left"));const e=this.ralign[this.row.length];if(e){const[r,s,n]=e,i=this.create("node","mpadded",t.childNodes[0].childNodes,{width:s,"data-overflow":"auto","data-align":n,"data-vertical-align":r});i.setProperty("vbox",r),t.childNodes[0].childNodes=[],t.appendChild(i)}else this.breakAlign.cell&&ht.setAttribute(t,"data-vertical-align",this.breakAlign.cell);this.breakAlign.cell="",this.row.push(t),this.Clear(),this.hfill=[]}EndRow(){let t="mtr";this.getProperty("isNumbered")&&3===this.row.length?(this.row.unshift(this.row.pop()),t="mlabeledtr"):this.getProperty("isLabeled")&&(t="mlabeledtr",this.setProperty("isLabeled",!1));const e=this.create("node",t,this.row);this.breakAlign.row&&(ht.setAttribute(e,"data-break-align",this.breakAlign.row),this.breakAlign.row=""),$e(e,this),this.table.push(e),this.row=[],this.atEnd=!1}EndTable(){(this.Size()||this.row.length)&&(this.EndEntry(),this.EndRow()),this.checkLines()}checkLines(){if(this.arraydef.rowlines){const t=this.arraydef.rowlines.split(/ /);t.length===this.table.length?(this.frame.push(["bottom",t.pop()]),t.length?this.arraydef.rowlines=t.join(" "):delete this.arraydef.rowlines):t.lengththis.maxrow&&(this.maxrow=this.row.length);const t=this.factory.configuration.tags.getTag();t&&(this.row=[t].concat(this.row),this.setProperty("isLabeled",!0)),this.factory.configuration.tags.clearTag(),super.EndRow()}EndTable(){super.EndTable(),this.factory.configuration.tags.end(),this.extendArray("columnalign",this.maxrow),this.extendArray("columnwidth",this.maxrow),this.extendArray("columnspacing",this.maxrow-1),this.extendArray("data-break-align",this.maxrow),this.addIndentshift()}extendArray(t,e){if(!this.arraydef[t])return;const r=this.arraydef[t].split(/ /),s=[...r];if(s.length>1){for(;s.length0){const t="center"===e?".7em":"2em";for(const e of this.table){const s=e.childNodes[e.isKind("mlabeledtr")?r+1:r];if(s){const e=this.create("node","mstyle",s.childNodes[0].childNodes,{indentshift:t});s.childNodes[0].childNodes=[],s.appendChild(e)}}}e=t[r]}}}class ze extends Le{get kind(){return"mstyle"}constructor(t,e,r){super(t),this.attrList=e,this.setProperty("name",r)}checkItem(t){if(t.isKind("end")&&t.getName()===this.getName()){return[[this.create("node","mstyle",[this.toMml()],this.attrList)],!0]}return super.checkItem(t)}}class Xe extends Tt{constructor(t,...e){super(t),this.factory.configuration.tags.start("equation",!0,e[0])}get kind(){return"equation"}get isOpen(){return!0}checkItem(t){if(t.isKind("end")){const e=this.toMml(),r=this.factory.configuration.tags.getTag();return this.factory.configuration.tags.end(),[[r?this.factory.configuration.tags.enTag(e,r):e,t],!0]}if(t.isKind("stop"))throw new Mt("EnvMissingEnd","Missing \\end{%1}",this.getName());return super.checkItem(t)}}function $e(t,e,r=""){const s=e.startStr.slice(e.startI,e.stopI);s&&(t.attributes.set(Pt.Attr.LATEXITEM,r?r+s:s),t.attributes.set(Pt.Attr.LATEX,r?r+s:s))}const Ve=MathJax._.util.lengths,Je=(Ve.BIGDIMEN,Ve.UNITS,Ve.RELUNITS,Ve.MATHSPACE),We=(Ve.length2em,Ve.percent,Ve.em),Ye=(Ve.px,1.2/.85),Qe={fontfamily:1,fontsize:1,fontweight:1,fontstyle:1,color:1,background:1,id:1,class:1,href:1,style:1};function Ze(t,e=1/0){const r=t.replace(/\s+/g,"").split("").map((t=>{const e={t:"top",b:"bottom",m:"middle",c:"center"}[t];if(!e)throw new Mt("BadBreakAlign","Invalid alignment character: %1",t);return e}));if(r.length>e)throw new Mt("TooManyAligns","Too many alignment characters: %1",t);return 1===e?r[0]:r.join(" ")}function tr(t,e){const r=t.stack.env,s=r.inRoot;r.inRoot=!0;const n=new Et(e,r,t.configuration);let i=n.mml();const a=n.stack.global;if(a.leftRoot||a.upRoot){const e={};a.leftRoot&&(e.width=a.leftRoot),a.upRoot&&(e.voffset=a.upRoot,e.height=a.upRoot),i=t.create("node","mpadded",[i],e)}return r.inRoot=s,i}const er={Open(t,e){t.Push(t.itemFactory.create("open"))},Close(t,e){t.Push(t.itemFactory.create("close"))},Bar(t,e){t.Push(t.create("token","mo",{stretchy:!1,texClass:it.ORD},e))},Tilde(t,e){t.Push(t.create("token","mtext",{},Ft.nbsp))},Space(t,e){},Superscript(t,e){let r,s;t.GetNext().match(/\d/)&&(t.string=t.string.substring(0,t.i+1)+" "+t.string.substring(t.i+1));const n=t.stack.Top();n.isKind("prime")?([s,r]=n.Peek(2),t.stack.Pop()):(s=t.stack.Prev(),s||(s=t.create("token","mi",{},"")));const i=ht.getProperty(s,"movesupsub");let a=ht.isType(s,"msubsup")?s.sup:s.over;if(ht.isType(s,"msubsup")&&!ht.isType(s,"msup")&&ht.getChildAt(s,s.sup)||ht.isType(s,"munderover")&&!ht.isType(s,"mover")&&ht.getChildAt(s,s.over)&&!ht.getProperty(s,"subsupOK"))throw new Mt("DoubleExponent","Double exponent: use braces to clarify");ht.isType(s,"msubsup")&&!ht.isType(s,"msup")||(i?((!ht.isType(s,"munderover")||ht.isType(s,"mover")||ht.getChildAt(s,s.over))&&(s=t.create("node","munderover",[s],{movesupsub:!0})),a=s.over):(s=t.create("node","msubsup",[s]),a=s.sup)),t.Push(t.itemFactory.create("subsup",s).setProperties({position:a,primes:r,movesupsub:i}))},Subscript(t,e){let r,s;t.GetNext().match(/\d/)&&(t.string=t.string.substring(0,t.i+1)+" "+t.string.substring(t.i+1));const n=t.stack.Top();n.isKind("prime")?([s,r]=n.Peek(2),t.stack.Pop()):(s=t.stack.Prev(),s||(s=t.create("token","mi",{},"")));const i=ht.getProperty(s,"movesupsub");let a=ht.isType(s,"msubsup")?s.sub:s.under;if(ht.isType(s,"msubsup")&&!ht.isType(s,"msup")&&ht.getChildAt(s,s.sub)||ht.isType(s,"munderover")&&!ht.isType(s,"mover")&&ht.getChildAt(s,s.under)&&!ht.getProperty(s,"subsupOK"))throw new Mt("DoubleSubscripts","Double subscripts: use braces to clarify");ht.isType(s,"msubsup")&&!ht.isType(s,"msup")||(i?((!ht.isType(s,"munderover")||ht.isType(s,"mover")||ht.getChildAt(s,s.under))&&(s=t.create("node","munderover",[s],{movesupsub:!0})),a=s.under):(s=t.create("node","msubsup",[s]),a=s.sub)),t.Push(t.itemFactory.create("subsup",s).setProperties({position:a,primes:r,movesupsub:i}))},Prime(t,e){let r=t.stack.Prev();if(r||(r=t.create("token","mi")),ht.isType(r,"msubsup")&&!ht.isType(r,"msup")&&ht.getChildAt(r,r.sup)||ht.isType(r,"munderover")&&!ht.isType(r,"mover")&&ht.getChildAt(r,r.over)&&!ht.getProperty(r,"subsupOK"))throw new Mt("DoubleExponentPrime","Prime causes double exponent: use braces to clarify");let s="";t.i--;do{s+=Ft.prime,t.i++,e=t.GetNext()}while("'"===e||e===Ft.rsquo);s=["","\u2032","\u2033","\u2034","\u2057"][s.length]||s;const n=t.create("token","mo",{variantForm:!0},s);t.Push(t.itemFactory.create("prime",r,n))},Comment(t,e){for(;t.ii.macroColumn(t,n,parseInt(s)),t.Push(t.itemFactory.create("null"))},BeginEnd(t,e){const r=t.GetArgument(e);if(r.match(/\\/))throw new Mt("InvalidEnv","Invalid environment name '%1'",r);const s=t.configuration.handlers.get(At.ENVIRONMENT).lookup(r);if(s&&"\\end"===e){if(!s.args[0]){const e=t.itemFactory.create("end").setProperty("name",r);return void t.Push(e)}t.stack.env.closing=r}qt.checkMaxMacros(t,!1),t.parse(At.ENVIRONMENT,[t,r])},Array(t,e,r,s,n,i,a,o,c){n||(n=t.GetArgument("\\begin{"+e.getName()+"}"));const l=t.itemFactory.create("array");return"array"===e.getName()&&l.setProperty("arrayPadding",".5em .125em"),l.parser=t,l.arraydef={columnspacing:i||"1em",rowspacing:a||"4pt"},t.configuration.columnParser.process(t,n,l),r&&l.setProperty("open",t.convertDelimiter(r)),s&&l.setProperty("close",t.convertDelimiter(s)),"'"===(o||"").charAt(1)&&(l.arraydef["data-cramped"]=!0,o=o.charAt(0)),"D"===o?l.arraydef.displaystyle=!0:o&&(l.arraydef.displaystyle=!1),l.arraydef.scriptlevel="S"===o?1:0,c&&(l.arraydef.useHeight=!1),t.Push(e),l.StartEntry(),l},AlignedArray(t,e,r=""){const s=t.GetBrackets("\\begin{"+e.getName()+"}"),n=er.Array(t,e,null,null,null,null,null,r);return qt.setArrayAlign(n,s)},IndentAlign(t,e){const r=`\\begin{${e.getName()}}`,s=t.GetBrackets(r,""),n=t.GetBrackets(r,""),i=t.GetBrackets(r,"");if(s&&!vt.matchDimen(s)[0]||n&&!vt.matchDimen(n)[0]||i&&!vt.matchDimen(i)[0])throw new Mt("BracketMustBeDimension","Bracket argument to %1 must be a dimension",r);const a=t.GetArgument(r);if(a&&!a.match(/^([lcr]{1,3})?$/))throw new Mt("BadAlignment","Alignment must be one to three copies of l, c, or r");const o=[...a].map((t=>({l:"left",c:"center",r:"right"}[t])));1===o.length&&o.push(o[0]);const c={};for(const[t,e]of[["indentshiftfirst",s],["indentshift",n||s],["indentshiftlast",i],["indentalignfirst",o[0]],["indentalign",o[1]],["indentalignlast",o[2]]])e&&(c[t]=e);t.Push(t.itemFactory.create("mstyle",c,e.getName()))},Equation:(t,e,r,s=!0)=>(t.configuration.mathItem.display=s,t.stack.env.display=s,qt.checkEqnEnv(t),t.Push(e),t.itemFactory.create("equation",r).setProperty("name",e.getName())),EqnArray(t,e,r,s,n,i,a){const o=e.getName(),c="gather"===o||"gather*"===o;s&&qt.checkEqnEnv(t,!c),t.Push(e),n=(n=n.replace(/[^clr]/g,"").split("").join(" ")).replace(/l/g,"left").replace(/r/g,"right").replace(/c/g,"center"),i=Ze(i);const l=t.itemFactory.create("eqnarray",o,r,s,t.stack.global);return l.arraydef={displaystyle:!0,columnalign:n,columnspacing:a||"1em",rowspacing:"3pt","data-break-align":i,side:t.options.tagSide,minlabelspacing:t.options.tagIndent},c&&l.setProperty("nestable",!0),l},HandleNoTag(t,e){t.tags.notag()},HandleLabel(t,e){const r=t.GetArgument(e);if(""!==r&&!t.tags.refUpdate){if(t.tags.label)throw new Mt("MultipleCommand","Multiple %1",t.currentCS);if(t.tags.label=r,(t.tags.allLabels[r]||t.tags.labels[r])&&!t.options.ignoreDuplicateLabels)throw new Mt("MultipleLabel","Label '%1' multiply defined",r);t.tags.labels[r]=new Kt}},HandleRef(t,e,r){const s=t.GetArgument(e);let n=t.tags.allLabels[s]||t.tags.labels[s];n||(t.tags.refUpdate||(t.tags.redo=!0),n=new Kt);let i=n.tag;r&&(i=t.tags.formatRef(i));const a=t.create("node","mrow",qt.internalMath(t,i),{href:t.tags.formatUrl(n.id,t.options.baseURL),class:"MathJax_ref"});t.Push(a)},Macro(t,e,r,s,n){if(s){const i=[];if(null!=n){const r=t.GetBrackets(e);i.push(null==r?n:r)}for(let r=i.length;r1&&(s.autoOP=!1)),!s.mathvariant&&qt.isLatinOrGreekChar(e)){const r=t.configuration.mathStyle(e);r&&(s.mathvariant=r)}const i=t.create("token","mi",s,e);t.Push(i)},digit(t,e){const r=t.configuration.options.numberPattern,s=t.string.slice(t.i-1).match(r),n=qt.getFontDef(t);if(!s)return!1;const i=t.create("token","mn",n,s[0].replace(/[{}]/g,""));return t.i+=s[0].length-1,t.Push(i),!0},controlSequence(t,e){const r=t.GetCS();t.parse(At.MACRO,[t,r])},lcGreek(t,e){const r={mathvariant:t.configuration.mathStyle(e.char)||sr.ITALIC},s=t.create("token","mi",r,e.char);t.Push(s)},ucGreek(t,e){const r={mathvariant:t.stack.env.font||t.configuration.mathStyle(e.char,!0)||sr.NORMAL},s=t.create("token","mi",r,e.char);t.Push(s)},mathchar0mi(t,e){const r=e.attributes||{mathvariant:sr.ITALIC},s=t.create("token","mi",r,e.char);t.Push(s)},mathchar0mo(t,e){const r=e.attributes||{};r.stretchy=!1;const s=t.create("token","mo",r,e.char);ht.setProperty(s,"fixStretchy",!0),t.configuration.addNode("fixStretchy",s),t.Push(s)},mathchar7(t,e){const r=e.attributes||{mathvariant:sr.NORMAL};t.stack.env.font&&(r.mathvariant=t.stack.env.font);const s=t.create("token","mi",r,e.char);t.Push(s)},delimiter(t,e){let r=e.attributes||{};r=Object.assign({fence:!1,stretchy:!1},r);const s=t.create("token","mo",r,e.char);t.Push(s)},environment(t,e,r,s){const n=t.itemFactory.create("begin").setProperty("name",e);t.Push(r(t,n,...s.slice(1)))}},ir=nr,ar=We(Je.thickmathspace),or=Pt.Variant;new re("letter",ir.variable,/[a-z]/i),new re("digit",ir.digit,/[0-9.,]/),new re("command",ir.controlSequence,/^\\/),new ae("special",{"{":rr.Open,"}":rr.Close,"~":rr.Tilde,"^":rr.Superscript,_:rr.Subscript,"|":rr.Bar," ":rr.Space,"\t":rr.Space,"\r":rr.Space,"\n":rr.Space,"'":rr.Prime,"%":rr.Comment,"&":rr.Entry,"#":rr.Hash,"\xa0":rr.Space,"\u2019":rr.Prime}),new ne("lcGreek",ir.lcGreek,{alpha:"\u03b1",beta:"\u03b2",gamma:"\u03b3",delta:"\u03b4",epsilon:"\u03f5",zeta:"\u03b6",eta:"\u03b7",theta:"\u03b8",iota:"\u03b9",kappa:"\u03ba",lambda:"\u03bb",mu:"\u03bc",nu:"\u03bd",xi:"\u03be",omicron:"\u03bf",pi:"\u03c0",rho:"\u03c1",sigma:"\u03c3",tau:"\u03c4",upsilon:"\u03c5",phi:"\u03d5",chi:"\u03c7",psi:"\u03c8",omega:"\u03c9",varepsilon:"\u03b5",vartheta:"\u03d1",varpi:"\u03d6",varrho:"\u03f1",varsigma:"\u03c2",varphi:"\u03c6"}),new ne("ucGreek",ir.ucGreek,{Gamma:"\u0393",Delta:"\u0394",Theta:"\u0398",Lambda:"\u039b",Xi:"\u039e",Pi:"\u03a0",Sigma:"\u03a3",Upsilon:"\u03a5",Phi:"\u03a6",Psi:"\u03a8",Omega:"\u03a9"}),new ne("mathchar0mi",ir.mathchar0mi,{AA:"\u212b",S:["\xa7",{mathvariant:or.NORMAL}],aleph:["\u2135",{mathvariant:or.NORMAL}],hbar:["\u210f",{variantForm:!0}],imath:"\u0131",jmath:"\u0237",ell:"\u2113",wp:["\u2118",{mathvariant:or.NORMAL}],Re:["\u211c",{mathvariant:or.NORMAL}],Im:["\u2111",{mathvariant:or.NORMAL}],partial:["\u2202",{mathvariant:or.ITALIC}],infty:["\u221e",{mathvariant:or.NORMAL}],prime:["\u2032",{variantForm:!0}],emptyset:["\u2205",{mathvariant:or.NORMAL}],nabla:["\u2207",{mathvariant:or.NORMAL}],top:["\u22a4",{mathvariant:or.NORMAL}],bot:["\u22a5",{mathvariant:or.NORMAL}],angle:["\u2220",{mathvariant:or.NORMAL}],triangle:["\u25b3",{mathvariant:or.NORMAL}],backslash:["\\",{mathvariant:or.NORMAL}],forall:["\u2200",{mathvariant:or.NORMAL}],exists:["\u2203",{mathvariant:or.NORMAL}],neg:["\xac",{mathvariant:or.NORMAL}],lnot:["\xac",{mathvariant:or.NORMAL}],flat:["\u266d",{mathvariant:or.NORMAL}],natural:["\u266e",{mathvariant:or.NORMAL}],sharp:["\u266f",{mathvariant:or.NORMAL}],clubsuit:["\u2663",{mathvariant:or.NORMAL}],diamondsuit:["\u2662",{mathvariant:or.NORMAL}],heartsuit:["\u2661",{mathvariant:or.NORMAL}],spadesuit:["\u2660",{mathvariant:or.NORMAL}]}),new ne("mathchar0mo",ir.mathchar0mo,{surd:"\u221a",coprod:["\u2210",{movesupsub:!0}],bigvee:["\u22c1",{movesupsub:!0}],bigwedge:["\u22c0",{movesupsub:!0}],biguplus:["\u2a04",{movesupsub:!0}],bigcap:["\u22c2",{movesupsub:!0}],bigcup:["\u22c3",{movesupsub:!0}],int:"\u222b",intop:["\u222b",{movesupsub:!0,movablelimits:!0}],iint:"\u222c",iiint:"\u222d",prod:["\u220f",{movesupsub:!0}],sum:["\u2211",{movesupsub:!0}],bigotimes:["\u2a02",{movesupsub:!0}],bigoplus:["\u2a01",{movesupsub:!0}],bigodot:["\u2a00",{movesupsub:!0}],oint:"\u222e",ointop:["\u222e",{movesupsub:!0,movablelimits:!0}],oiint:"\u222f",oiiint:"\u2230",bigsqcup:["\u2a06",{movesupsub:!0}],smallint:["\u222b",{largeop:!1}],triangleleft:"\u25c3",triangleright:"\u25b9",bigtriangleup:"\u25b3",bigtriangledown:"\u25bd",wedge:"\u2227",land:"\u2227",vee:"\u2228",lor:"\u2228",cap:"\u2229",cup:"\u222a",ddagger:"\u2021",dagger:"\u2020",sqcap:"\u2293",sqcup:"\u2294",uplus:"\u228e",amalg:"\u2a3f",diamond:"\u22c4",bullet:"\u2219",wr:"\u2240",div:"\xf7",odot:["\u2299",{largeop:!1}],oslash:["\u2298",{largeop:!1}],otimes:["\u2297",{largeop:!1}],ominus:["\u2296",{largeop:!1}],oplus:["\u2295",{largeop:!1}],mp:"\u2213",pm:"\xb1",circ:"\u2218",bigcirc:"\u25ef",setminus:"\u2216",cdot:"\u22c5",ast:"\u2217",times:"\xd7",star:"\u22c6",propto:"\u221d",sqsubseteq:"\u2291",sqsupseteq:"\u2292",parallel:"\u2225",mid:"\u2223",dashv:"\u22a3",vdash:"\u22a2",leq:"\u2264",le:"\u2264",geq:"\u2265",ge:"\u2265",lt:"<",gt:">",succ:"\u227b",prec:"\u227a",approx:"\u2248",succeq:"\u2ab0",preceq:"\u2aaf",supset:"\u2283",subset:"\u2282",supseteq:"\u2287",subseteq:"\u2286",in:"\u2208",ni:"\u220b",notin:"\u2209",owns:"\u220b",gg:"\u226b",ll:"\u226a",sim:"\u223c",simeq:"\u2243",perp:"\u27c2",equiv:"\u2261",asymp:"\u224d",smile:"\u2323",frown:"\u2322",ne:"\u2260",neq:"\u2260",cong:"\u2245",doteq:"\u2250",bowtie:"\u22c8",models:"\u22a7",notChar:"\u29f8",Leftrightarrow:"\u21d4",Leftarrow:"\u21d0",Rightarrow:"\u21d2",leftrightarrow:"\u2194",leftarrow:"\u2190",gets:"\u2190",rightarrow:"\u2192",to:["\u2192",{accent:!1}],mapsto:"\u21a6",leftharpoonup:"\u21bc",leftharpoondown:"\u21bd",rightharpoonup:"\u21c0",rightharpoondown:"\u21c1",nearrow:"\u2197",searrow:"\u2198",nwarrow:"\u2196",swarrow:"\u2199",rightleftharpoons:"\u21cc",hookrightarrow:"\u21aa",hookleftarrow:"\u21a9",longleftarrow:"\u27f5",Longleftarrow:"\u27f8",longrightarrow:"\u27f6",Longrightarrow:"\u27f9",Longleftrightarrow:"\u27fa",longleftrightarrow:"\u27f7",longmapsto:"\u27fc",ldots:"\u2026",cdots:"\u22ef",vdots:"\u22ee",ddots:"\u22f1",iddots:"\u22f0",dotsc:"\u2026",dotsb:"\u22ef",dotsm:"\u22ef",dotsi:"\u22ef",dotso:"\u2026",ldotp:[".",{texClass:it.PUNCT}],cdotp:["\u22c5",{texClass:it.PUNCT}],colon:[":",{texClass:it.PUNCT}]}),new ne("mathchar7",ir.mathchar7,{_:"_","#":"#",$:"$","%":"%","&":"&",And:"&"}),new ie("delimiter",ir.delimiter,{"(":"(",")":")","[":"[","]":"]","<":"\u27e8",">":"\u27e9","\\lt":"\u27e8","\\gt":"\u27e9","/":"/","|":["|",{texClass:it.ORD}],".":"","\\lmoustache":"\u23b0","\\rmoustache":"\u23b1","\\lgroup":"\u27ee","\\rgroup":"\u27ef","\\arrowvert":"\u23d0","\\Arrowvert":"\u2016","\\bracevert":"\u23aa","\\Vert":["\u2016",{texClass:it.ORD}],"\\|":["\u2016",{texClass:it.ORD}],"\\vert":["|",{texClass:it.ORD}],"\\uparrow":"\u2191","\\downarrow":"\u2193","\\updownarrow":"\u2195","\\Uparrow":"\u21d1","\\Downarrow":"\u21d3","\\Updownarrow":"\u21d5","\\backslash":"\\","\\rangle":"\u27e9","\\langle":"\u27e8","\\rbrace":"}","\\lbrace":"{","\\}":"}","\\{":"{","\\rceil":"\u2309","\\lceil":"\u2308","\\rfloor":"\u230b","\\lfloor":"\u230a","\\lbrack":"[","\\rbrack":"]"}),new oe("macros",{displaystyle:[rr.SetStyle,"D",!0,0],textstyle:[rr.SetStyle,"T",!1,0],scriptstyle:[rr.SetStyle,"S",!1,1],scriptscriptstyle:[rr.SetStyle,"SS",!1,2],rm:[rr.SetFont,or.NORMAL],mit:[rr.SetFont,or.ITALIC],oldstyle:[rr.SetFont,or.OLDSTYLE],cal:[rr.SetFont,or.CALLIGRAPHIC],it:[rr.SetFont,or.MATHITALIC],bf:[rr.SetFont,or.BOLD],sf:[rr.SetFont,or.SANSSERIF],tt:[rr.SetFont,or.MONOSPACE],frak:[rr.MathFont,or.FRAKTUR],Bbb:[rr.MathFont,or.DOUBLESTRUCK],mathrm:[rr.MathFont,or.NORMAL],mathup:[rr.MathFont,or.NORMAL],mathnormal:[rr.MathFont,""],mathbf:[rr.MathFont,or.BOLD],mathbfup:[rr.MathFont,or.BOLD],mathit:[rr.MathFont,or.MATHITALIC],mathbfit:[rr.MathFont,or.BOLDITALIC],mathbb:[rr.MathFont,or.DOUBLESTRUCK],mathfrak:[rr.MathFont,or.FRAKTUR],mathbffrak:[rr.MathFont,or.BOLDFRAKTUR],mathscr:[rr.MathFont,or.SCRIPT],mathbfscr:[rr.MathFont,or.BOLDSCRIPT],mathsf:[rr.MathFont,or.SANSSERIF],mathsfup:[rr.MathFont,or.SANSSERIF],mathbfsf:[rr.MathFont,or.BOLDSANSSERIF],mathbfsfup:[rr.MathFont,or.BOLDSANSSERIF],mathsfit:[rr.MathFont,or.SANSSERIFITALIC],mathbfsfit:[rr.MathFont,or.SANSSERIFBOLDITALIC],mathtt:[rr.MathFont,or.MONOSPACE],mathcal:[rr.MathFont,or.CALLIGRAPHIC],mathbfcal:[rr.MathFont,or.BOLDCALLIGRAPHIC],symrm:[rr.MathFont,or.NORMAL],symup:[rr.MathFont,or.NORMAL],symnormal:[rr.MathFont,""],symbf:[rr.MathFont,or.BOLD,or.BOLDITALIC],symbfup:[rr.MathFont,or.BOLD],symit:[rr.MathFont,or.ITALIC],symbfit:[rr.MathFont,or.BOLDITALIC],symbb:[rr.MathFont,or.DOUBLESTRUCK],symfrak:[rr.MathFont,or.FRAKTUR],symbffrak:[rr.MathFont,or.BOLDFRAKTUR],symscr:[rr.MathFont,or.SCRIPT],symbfscr:[rr.MathFont,or.BOLDSCRIPT],symsf:[rr.MathFont,or.SANSSERIF,or.SANSSERIFITALIC],symsfup:[rr.MathFont,or.SANSSERIF],symbfsf:[rr.MathFont,or.BOLDSANSSERIF],symbfsfup:[rr.MathFont,or.BOLDSANSSERIF],symsfit:[rr.MathFont,or.SANSSERIFITALIC],symbfsfit:[rr.MathFont,or.SANSSERIFBOLDITALIC],symtt:[rr.MathFont,or.MONOSPACE],symcal:[rr.MathFont,or.CALLIGRAPHIC],symbfcal:[rr.MathFont,or.BOLDCALLIGRAPHIC],textrm:[rr.HBox,null,or.NORMAL],textup:[rr.HBox,null,or.NORMAL],textnormal:[rr.HBox],textit:[rr.HBox,null,or.ITALIC],textbf:[rr.HBox,null,or.BOLD],textsf:[rr.HBox,null,or.SANSSERIF],texttt:[rr.HBox,null,or.MONOSPACE],tiny:[rr.SetSize,.5],Tiny:[rr.SetSize,.6],scriptsize:[rr.SetSize,.7],small:[rr.SetSize,.85],normalsize:[rr.SetSize,1],large:[rr.SetSize,1.2],Large:[rr.SetSize,1.44],LARGE:[rr.SetSize,1.73],huge:[rr.SetSize,2.07],Huge:[rr.SetSize,2.49],arcsin:rr.NamedFn,arccos:rr.NamedFn,arctan:rr.NamedFn,arg:rr.NamedFn,cos:rr.NamedFn,cosh:rr.NamedFn,cot:rr.NamedFn,coth:rr.NamedFn,csc:rr.NamedFn,deg:rr.NamedFn,det:rr.NamedOp,dim:rr.NamedFn,exp:rr.NamedFn,gcd:rr.NamedOp,hom:rr.NamedFn,inf:rr.NamedOp,ker:rr.NamedFn,lg:rr.NamedFn,lim:rr.NamedOp,liminf:[rr.NamedOp,"lim inf"],limsup:[rr.NamedOp,"lim sup"],ln:rr.NamedFn,log:rr.NamedFn,max:rr.NamedOp,min:rr.NamedOp,Pr:rr.NamedOp,sec:rr.NamedFn,sin:rr.NamedFn,sinh:rr.NamedFn,sup:rr.NamedOp,tan:rr.NamedFn,tanh:rr.NamedFn,limits:[rr.Limits,!0],nolimits:[rr.Limits,!1],overline:[rr.UnderOver,"2015"],underline:[rr.UnderOver,"2015"],overbrace:[rr.UnderOver,"23DE",!0],underbrace:[rr.UnderOver,"23DF",!0],overparen:[rr.UnderOver,"23DC"],underparen:[rr.UnderOver,"23DD"],overrightarrow:[rr.UnderOver,"2192"],underrightarrow:[rr.UnderOver,"2192"],overleftarrow:[rr.UnderOver,"2190"],underleftarrow:[rr.UnderOver,"2190"],overleftrightarrow:[rr.UnderOver,"2194"],underleftrightarrow:[rr.UnderOver,"2194"],overset:rr.Overset,underset:rr.Underset,overunderset:rr.Overunderset,stackrel:[rr.Macro,"\\mathrel{\\mathop{#2}\\limits^{#1}}",2],stackbin:[rr.Macro,"\\mathbin{\\mathop{#2}\\limits^{#1}}",2],over:rr.Over,overwithdelims:rr.Over,atop:rr.Over,atopwithdelims:rr.Over,above:rr.Over,abovewithdelims:rr.Over,brace:[rr.Over,"{","}"],brack:[rr.Over,"[","]"],choose:[rr.Over,"(",")"],frac:rr.Frac,sqrt:rr.Sqrt,root:rr.Root,uproot:[rr.MoveRoot,"upRoot"],leftroot:[rr.MoveRoot,"leftRoot"],left:rr.LeftRight,right:rr.LeftRight,middle:rr.LeftRight,llap:rr.Lap,rlap:rr.Lap,raise:rr.RaiseLower,lower:rr.RaiseLower,moveleft:rr.MoveLeftRight,moveright:rr.MoveLeftRight,",":[rr.Spacer,Je.thinmathspace],":":[rr.Spacer,Je.mediummathspace],">":[rr.Spacer,Je.mediummathspace],";":[rr.Spacer,Je.thickmathspace],"!":[rr.Spacer,Je.negativethinmathspace],enspace:[rr.Spacer,.5],quad:[rr.Spacer,1],qquad:[rr.Spacer,2],thinspace:[rr.Spacer,Je.thinmathspace],negthinspace:[rr.Spacer,Je.negativethinmathspace],"*":rr.DiscretionaryTimes,allowbreak:rr.AllowBreak,goodbreak:[rr.Linebreak,Pt.LineBreak.GOODBREAK],badbreak:[rr.Linebreak,Pt.LineBreak.BADBREAK],nobreak:[rr.Linebreak,Pt.LineBreak.NOBREAK],break:rr.Break,hskip:rr.Hskip,hspace:rr.Hskip,kern:[rr.Hskip,!0],mskip:rr.Hskip,mspace:rr.Hskip,mkern:[rr.Hskip,!0],rule:rr.rule,Rule:[rr.Rule],Space:[rr.Rule,"blank"],nonscript:rr.Nonscript,big:[rr.MakeBig,it.ORD,.85],Big:[rr.MakeBig,it.ORD,1.15],bigg:[rr.MakeBig,it.ORD,1.45],Bigg:[rr.MakeBig,it.ORD,1.75],bigl:[rr.MakeBig,it.OPEN,.85],Bigl:[rr.MakeBig,it.OPEN,1.15],biggl:[rr.MakeBig,it.OPEN,1.45],Biggl:[rr.MakeBig,it.OPEN,1.75],bigr:[rr.MakeBig,it.CLOSE,.85],Bigr:[rr.MakeBig,it.CLOSE,1.15],biggr:[rr.MakeBig,it.CLOSE,1.45],Biggr:[rr.MakeBig,it.CLOSE,1.75],bigm:[rr.MakeBig,it.REL,.85],Bigm:[rr.MakeBig,it.REL,1.15],biggm:[rr.MakeBig,it.REL,1.45],Biggm:[rr.MakeBig,it.REL,1.75],mathord:[rr.TeXAtom,it.ORD],mathop:[rr.TeXAtom,it.OP],mathopen:[rr.TeXAtom,it.OPEN],mathclose:[rr.TeXAtom,it.CLOSE],mathbin:[rr.TeXAtom,it.BIN],mathrel:[rr.TeXAtom,it.REL],mathpunct:[rr.TeXAtom,it.PUNCT],mathinner:[rr.TeXAtom,it.INNER],vtop:[rr.VBox,"top"],vcenter:[rr.VBox,"center"],vbox:[rr.VBox,"bottom"],hsize:rr.Hsize,parbox:rr.ParBox,breakAlign:rr.BreakAlign,buildrel:rr.BuildRel,hbox:[rr.HBox,0],text:rr.HBox,mbox:[rr.HBox,0],fbox:rr.FBox,boxed:[rr.Macro,"\\fbox{$\\displaystyle{#1}$}",1],framebox:rr.FrameBox,makebox:rr.MakeBox,strut:rr.Strut,mathstrut:[rr.Macro,"\\vphantom{(}"],phantom:rr.Phantom,vphantom:[rr.Phantom,1,0],hphantom:[rr.Phantom,0,1],smash:rr.Smash,acute:[rr.Accent,"00B4"],grave:[rr.Accent,"0060"],ddot:[rr.Accent,"00A8"],dddot:[rr.Accent,"20DB"],ddddot:[rr.Accent,"20DC"],tilde:[rr.Accent,"007E"],bar:[rr.Accent,"00AF"],breve:[rr.Accent,"02D8"],check:[rr.Accent,"02C7"],hat:[rr.Accent,"005E"],vec:[rr.Accent,"2192",!1],dot:[rr.Accent,"02D9"],widetilde:[rr.Accent,"007E",!0],widehat:[rr.Accent,"005E",!0],matrix:rr.Matrix,array:rr.Matrix,pmatrix:[rr.Matrix,"(",")"],cases:[rr.Matrix,"{","","left left",null,".2em",null,!0],eqalign:[rr.Matrix,null,null,"right left",ar,".5em","D"],displaylines:[rr.Matrix,null,null,"center",null,".5em","D"],cr:rr.Cr,"\\":rr.CrLaTeX,newline:[rr.CrLaTeX,!0],hline:rr.HLine,hdashline:[rr.HLine,"dashed"],eqalignno:[rr.Matrix,null,null,"right left",ar,".5em","D",null,"right"],leqalignno:[rr.Matrix,null,null,"right left",ar,".5em","D",null,"left"],hfill:rr.HFill,hfil:rr.HFill,hfilll:rr.HFill,bmod:[rr.Macro,'\\mmlToken{mo}[lspace="'+ar+'" rspace="'+ar+'"]{mod}'],pmod:[rr.Macro,"\\pod{\\mmlToken{mi}{mod}\\kern 6mu #1}",1],mod:[rr.Macro,"\\mathchoice{\\kern18mu}{\\kern12mu}{\\kern12mu}{\\kern12mu}\\mmlToken{mi}{mod}\\,\\,#1",1],pod:[rr.Macro,"\\mathchoice{\\kern18mu}{\\kern8mu}{\\kern8mu}{\\kern8mu}(#1)",1],iff:[rr.Macro,"\\;\\Longleftrightarrow\\;"],skew:[rr.Macro,"{{#2{#3\\mkern#1mu}\\mkern-#1mu}{}}",3],pmb:[rr.Macro,"\\rlap{#1}\\kern1px{#1}",1],TeX:[rr.Macro,"T\\kern-.14em\\lower.5ex{E}\\kern-.115em X"],LaTeX:[rr.Macro,"L\\kern-.325em\\raise.21em{\\scriptstyle{A}}\\kern-.17em\\TeX"],not:rr.Not,dots:rr.Dots,space:rr.Tilde,"\xa0":rr.Tilde," ":rr.Tilde,begin:rr.BeginEnd,end:rr.BeginEnd,label:rr.HandleLabel,ref:rr.HandleRef,nonumber:rr.HandleNoTag,newcolumntype:rr.NewColumnType,mathchoice:rr.MathChoice,mmlToken:rr.MmlToken}),new ce("environment",ir.environment,{displaymath:[rr.Equation,null,!1],math:[rr.Equation,null,!1,!1],array:[rr.AlignedArray],darray:[rr.AlignedArray,null,"D"],equation:[rr.Equation,null,!0],eqnarray:[rr.EqnArray,null,!0,!0,"rcl","bmt",qt.cols(0,Je.thickmathspace),".5em"],indentalign:[rr.IndentAlign]}),new ne("not_remap",null,{"\u2190":"\u219a","\u2192":"\u219b","\u2194":"\u21ae","\u21d0":"\u21cd","\u21d2":"\u21cf","\u21d4":"\u21ce","\u2208":"\u2209","\u220b":"\u220c","\u2223":"\u2224","\u2225":"\u2226","\u223c":"\u2241","~":"\u2241","\u2243":"\u2244","\u2245":"\u2247","\u2248":"\u2249","\u224d":"\u226d","=":"\u2260","\u2261":"\u2262","<":"\u226e",">":"\u226f","\u2264":"\u2270","\u2265":"\u2271","\u2272":"\u2274","\u2273":"\u2275","\u2276":"\u2278","\u2277":"\u2279","\u227a":"\u2280","\u227b":"\u2281","\u2282":"\u2284","\u2283":"\u2285","\u2286":"\u2288","\u2287":"\u2289","\u22a2":"\u22ac","\u22a8":"\u22ad","\u22a9":"\u22ae","\u22ab":"\u22af","\u227c":"\u22e0","\u227d":"\u22e1","\u2291":"\u22e2","\u2292":"\u22e3","\u22b2":"\u22ea","\u22b3":"\u22eb","\u22b4":"\u22ec","\u22b5":"\u22ed","\u2203":"\u2204"});const cr=MathJax._.core.MmlTree.OperatorDictionary,lr=(cr.OPDEF,cr.MO,cr.RANGES,cr.getRange),hr=(cr.MMLSPACING,cr.OPTABLE,MathJax._.util.context),mr=(hr.hasWindow,hr.context),ur=Pt.Variant;function dr(t,e){const r=t.stack.env.font,s=t.stack.env.italicFont,n=r?{mathvariant:r}:{},i=ue.getMap("remap").lookup(e),a=lr(e),o=a[3],c=t.create("token",o,n,i?i.char:e),l=qt.isLatinOrGreekChar(e)?t.configuration.mathStyle(e,!0)||s:"",h=a[4]||(r&&l===ur.NORMAL?"":l);h&&c.attributes.set("mathvariant",h),"mo"===o&&(ht.setProperty(c,"fixStretchy",!0),t.configuration.addNode("fixStretchy",c)),t.Push(c)}new ne("remap",null,{"-":"\u2212","*":"\u2217","`":"\u2018"});class gr extends Xt{}const pr=pe.create("base",{[bt.CONFIG]:function(t,e){const r=e.parseOptions.options;r.digits&&(r.numberPattern=r.digits),new re("digit",ir.digit,r.initialDigit),new re("letter",ir.variable,r.initialLetter);t.handlers.get(At.CHARACTER).add(["letter","digit"],null,4)},[bt.HANDLER]:{[At.CHARACTER]:["command","special"],[At.DELIMITER]:["delimiter"],[At.MACRO]:["delimiter","macros","lcGreek","ucGreek","mathchar0mi","mathchar0mo","mathchar7"],[At.ENVIRONMENT]:["environment"]},[bt.FALLBACK]:{[At.CHARACTER]:dr,[At.MACRO]:function(t,e){throw new Mt("UndefinedControlSequence","Undefined control sequence %1","\\"+e)},[At.ENVIRONMENT]:function(t,e){throw new Mt("UnknownEnv","Unknown environment '%1'",e)}},[bt.ITEMS]:{[ke.prototype.kind]:ke,[we.prototype.kind]:we,[Me.prototype.kind]:Me,[xe.prototype.kind]:xe,[Te.prototype.kind]:Te,[Pe.prototype.kind]:Pe,[Ee.prototype.kind]:Ee,[Ce.prototype.kind]:Ce,[Se.prototype.kind]:Se,[Oe.prototype.kind]:Oe,[Ie.prototype.kind]:Ie,[Ne.prototype.kind]:Ne,[Le.prototype.kind]:Le,[Fe.prototype.kind]:Fe,[Re.prototype.kind]:Re,[De.prototype.kind]:De,[Be.prototype.kind]:Be,[Ge.prototype.kind]:Ge,[qe.prototype.kind]:qe,[_e.prototype.kind]:_e,[He.prototype.kind]:He,[Ue.prototype.kind]:Ue,[je.prototype.kind]:je,[Ke.prototype.kind]:Ke,[Xe.prototype.kind]:Xe,[ze.prototype.kind]:ze},[bt.OPTIONS]:{maxMacros:1e3,digits:"",numberPattern:/^(?:[0-9]+(?:\{,\}[0-9]{3})*(?:\.[0-9]*)?|\.[0-9]+)/,initialDigit:/[0-9.,]/,identifierPattern:/^[a-zA-Z]+/,initialLetter:/[a-zA-Z]/,baseURL:mr.document&&0!==mr.document.getElementsByTagName("base").length?String(mr.document.location).replace(/#.*$/,""):""},[bt.TAGS]:{base:gr},[bt.POSTPROCESSORS]:[[function({data:t}){for(const e of t.getList("nonscript"))if(e.attributes.get("scriptlevel")>0){const r=e.parent;if(r.childNodes.splice(r.childIndex(e),1),t.removeFromList(e.kind,[e]),e.isKind("mrow")){const r=e.childNodes[0];t.removeFromList("mstyle",[r]),t.removeFromList("mspace",r.childNodes[0].childNodes)}}else e.isKind("mrow")&&(e.parent.replaceChild(e.childNodes[0],e),t.removeFromList("mrow",[e]))},-4]]});class fr extends U{static configure(t){const e=new Ae(t,["tex"]);return e.init(),e}static tags(t,e){Yt.addTags(e.tags),Yt.setDefault(t.options.tags),t.tags=Yt.getDefault(),t.tags.configuration=t}constructor(t={}){const[e,r,s]=V(t,fr.OPTIONS,st.OPTIONS);super(r),this.findTeX=this.options.FindTeX||new st(s);const n=this.options.packages,i=this.configuration=fr.configure(n),a=this._parseOptions=new jt(i,[this.options,Yt.OPTIONS]);$(a.options,e),i.config(this),fr.tags(a,i),this.postFilters.addList([[ft.cleanSubSup,-7],[ft.setInherited,-6],[ft.checkScriptlevel,-5],[ft.moveLimits,-4],[ft.cleanStretchy,-3],[ft.cleanAttributes,-2],[ft.combineRelations,-1]])}setMmlFactory(t){super.setMmlFactory(t),this._parseOptions.nodeFactory.setMmlFactory(t)}get parseOptions(){return this._parseOptions}reset(t=0){this.parseOptions.tags.reset(t)}compile(t,e){let r,s;this.parseOptions.clear(),this.parseOptions.mathItem=t,this.executeFilters(this.preFilters,t,e,this.parseOptions),this.latex=t.math,this.parseOptions.tags.startEquation(t);try{s=new Et(this.latex,{display:t.display,isInner:!1},this.parseOptions),r=s.mml()}catch(t){if(!(t instanceof Mt))throw t;this.parseOptions.error=!0,r=this.options.formatError(this,t)}return r=this.parseOptions.nodeFactory.create("node","math",[r]),r.attributes.set(Pt.Attr.LATEX,this.latex),t.display&&ht.setAttribute(r,"display","block"),this.parseOptions.tags.finishEquation(t),this.parseOptions.root=r,this.executeFilters(this.postFilters,t,e,this.parseOptions),s&&s.stack.env.hsize&&(ht.setAttribute(r,"maxwidth",s.stack.env.hsize),ht.setAttribute(r,"overflow","linebreak")),this.mathNode=this.parseOptions.root,this.mathNode}findMath(t){return this.findTeX.findMath(t)}formatError(t){const e=t.message.replace(/\n.*/,"");return this.parseOptions.nodeFactory.create("error",e,t.id,this.latex)}}fr.NAME="TeX",fr.OPTIONS=Object.assign(Object.assign({},U.OPTIONS),{FindTeX:null,packages:["base"],maxBuffer:5120,maxTemplateSubtitutions:1e4,mathStyle:"TeX",formatError:(t,e)=>t.formatError(e)});class br extends je{constructor(t,...e){super(t),this.factory.configuration.tags.start("multline",!0,e[0])}get kind(){return"multline"}EndEntry(){this.table.length&&qt.fixInitialMO(this.factory.configuration,this.nodes);const t=this.getProperty("shove"),e=this.create("node","mtd",this.nodes,t?{columnalign:t}:{});this.setProperty("shove",null),this.row.push(e),this.Clear()}EndRow(){if(1!==this.row.length)throw new Mt("MultlineRowsOneCol","The rows within the %1 environment must have exactly one column","multline");const t=this.create("node","mtr",this.row);this.table.push(t),this.row=[]}EndTable(){if(super.EndTable(),this.table.length){const t=this.table.length-1;let e=-1;ht.getAttribute(ht.getChildren(this.table[0])[0],"columnalign")||ht.setAttribute(ht.getChildren(this.table[0])[0],"columnalign",Pt.Align.LEFT),ht.getAttribute(ht.getChildren(this.table[t])[0],"columnalign")||ht.setAttribute(ht.getChildren(this.table[t])[0],"columnalign",Pt.Align.RIGHT);const r=this.factory.configuration.tags.getTag();if(r){e=this.arraydef.side===Pt.Align.LEFT?0:this.table.length-1;const t=this.table[e],s=this.create("node","mlabeledtr",[r].concat(ht.getChildren(t)));ht.copyAttributes(t,s),this.table[e]=s}}this.factory.configuration.tags.end()}}class Ar extends Ke{get kind(){return"flalign"}constructor(t,e,r,s,n){super(t),this.name=e,this.numbered=r,this.padded=s,this.center=n,this.factory.configuration.tags.start(e,r,r)}EndEntry(){super.EndEntry();const t=this.getProperty("xalignat");if(t&&this.row.length>t)throw new Mt("XalignOverflow","Extra %1 in row of %2","&",this.name)}EndRow(){let t;const e=this.row,r=this.getProperty("xalignat");for(;e.lengththis.maxrow&&(this.maxrow=this.row.length),super.EndRow();const s=this.table[this.table.length-1];if(this.getProperty("zeroWidthLabel")&&s.isKind("mlabeledtr")){const t=ht.getChildren(s)[0],e=this.factory.configuration.options.tagSide,r=Object.assign({width:0},"right"===e?{lspace:"-1width"}:{}),n=this.create("node","mpadded",ht.getChildren(t),r);t.setChildren([n])}}EndTable(){if(super.EndTable(),this.center&&this.maxrow<=2){delete this.arraydef.width,delete this.global.indentalign}}}var yr;!function(t){t.NEW_DELIMITER="new-Delimiter",t.NEW_COMMAND="new-Command",t.NEW_ENVIRONMENT="new-Environment"}(yr||(yr={}));const vr=-100,kr={GetCSname(t,e){if("\\"!==t.GetNext())throw new Mt("MissingCS","%1 must be followed by a control sequence",e);const r=vt.trimSpaces(t.GetArgument(e)).substring(1);return this.checkProtectedMacros(t,r),r},GetCsNameArgument(t,e){let r=vt.trimSpaces(t.GetArgument(e));if("\\"===r.charAt(0)&&(r=r.substring(1)),!r.match(/^(.|[a-z]+)$/i))throw new Mt("IllegalControlSequenceName","Illegal control sequence name for %1",e);return this.checkProtectedMacros(t,r),r},GetArgCount(t,e){let r=t.GetBrackets(e);if(r&&(r=vt.trimSpaces(r),!r.match(/^[0-9]+$/)))throw new Mt("IllegalParamNumber","Illegal number of parameters specified in %1",e);return r},GetTemplate(t,e,r){let s=t.GetNext();const n=[];let i=0,a=t.i;for(;t.i0?[i.toString()].concat(n):i;t.i++}throw new Mt("MissingReplacementString","Missing replacement string for definition of %1",e)},GetParameter(t,e,r){if(null==r)return t.GetArgument(e);let s=t.i,n=0,i=!1;for(;t.it.string.substring(t.i,t.i+e.length)!==e||e.match(/\\[a-z]+$/i)&&t.string.charAt(t.i+e.length).match(/[a-z]/i)?0:(t.i+=e.length,1),checkGlobal:(t,e,r)=>t.stack.env.isGlobal?t.configuration.packageData.get("begingroup").stack.checkGlobal(e,r):r.map((e=>t.configuration.handlers.retrieve(e))),checkProtectedMacros(t,e){var r;if(null===(r=t.options.protectedMacros)||void 0===r?void 0:r.includes(e))throw new Mt("ProtectedMacro","The control sequence %1 can't be redefined",`\\${e}`)},addDelimiter(t,e,r,s){const n=e.substring(1);this.checkProtectedMacros(t,n);const[i,a]=kr.checkGlobal(t,[n,e],[yr.NEW_COMMAND,yr.NEW_DELIMITER]);n!==e&&i.remove(n),a.add(e,new Qt(e,r,s)),delete t.stack.env.isGlobal},addMacro(t,e,r,s,n=""){this.checkProtectedMacros(t,e);const i=kr.checkGlobal(t,[e],[yr.NEW_COMMAND])[0];this.undefineDelimiter(t,"\\"+e),i.add(e,new Zt(n||e,r,s)),delete t.stack.env.isGlobal},addEnvironment(t,e,r,s){kr.checkGlobal(t,[e],[yr.NEW_ENVIRONMENT])[0].add(e,new Zt(e,r,s)),delete t.stack.env.isGlobal},undefineMacro(t,e){const r=kr.checkGlobal(t,[e],[yr.NEW_COMMAND])[0];r.remove(e),t.configuration.handlers.get(At.MACRO).applicable(e)&&(r.add(e,new Zt(e,(()=>de.FALLBACK),[])),this.undefineDelimiter(t,"\\"+e)),delete t.stack.env.isGlobal},undefineDelimiter(t,e){const r=kr.checkGlobal(t,[e],[yr.NEW_DELIMITER])[0];r.remove(e),t.configuration.handlers.get(At.DELIMITER).applicable(e)&&r.add(e,new Qt(e,null,{})),delete t.stack.env.isGlobal}};function wr(t){if(!t||t.isInferred&&0===t.childNodes.length)return[null,null];if(t.isKind("msubsup")&&Mr(t))return[t,null];const e=ht.getChildAt(t,0);return t.isInferred&&e&&Mr(e)?(t.childNodes.splice(0,1),[e,t]):[null,t]}function Mr(t){const e=t.childNodes[0];return e&&e.isKind("mi")&&""===e.getText()}const xr={AmsEqnArray(t,e,r,s,n,i,a,o){const c=t.GetBrackets("\\begin{"+e.getName()+"}"),l=rr.EqnArray(t,e,r,s,n,i,a,o);return qt.setArrayAlign(l,c,t)},AlignAt(t,e,r,s){const n=e.getName();let i,a="",o="";const c=[];s||(i=t.GetBrackets("\\begin{"+n+"}"));const l=t.GetArgument("\\begin{"+n+"}");if(l.match(/[^0-9]/))throw new Mt("PositiveIntegerArg","Argument to %1 must be a positive integer","\\begin{"+n+"}");let h=parseInt(l,10);for(;h>0;)a+="rl",o+="bt",c.push("0em 0em"),h--;const m=c.join(" ");if(s)return xr.EqnArray(t,e,r,s,a,o,m);const u=xr.EqnArray(t,e,r,s,a,o,m);return qt.setArrayAlign(u,i,t)},Multline(t,e,r){qt.checkEqnEnv(t),t.Push(e);const s=t.options.ams.multlineIndent,n=t.itemFactory.create("multline",r,t.stack);return n.arraydef={displaystyle:!0,rowspacing:".5em",columnspacing:"100%",width:t.options.ams.multlineWidth,side:t.options.tagSide,minlabelspacing:t.options.tagIndent,"data-array-padding":`${s} ${s}`,"data-width-includes-label":!0},n},XalignAt(t,e,r,s){const n=t.GetArgument("\\begin{"+e.getName()+"}");if(n.match(/[^0-9]/))throw new Mt("PositiveIntegerArg","Argument to %1 must be a positive integer","\\begin{"+e.getName()+"}");const i=s?"crl":"rlc",a=s?"mbt":"btm",o=s?"fit auto auto":"auto auto fit",c=xr.FlalignArray(t,e,r,s,!1,i,a,o,!0);return c.setProperty("xalignat",2*parseInt(n)),c},FlalignArray(t,e,r,s,n,i,a,o,c=!1){qt.checkEqnEnv(t),t.Push(e),i=i.split("").join(" ").replace(/r/g,"right").replace(/l/g,"left").replace(/c/g,"center"),a=Ze(a);const l=t.itemFactory.create("flalign",e.getName(),r,s,n,t.stack);return l.arraydef={width:"100%",displaystyle:!0,columnalign:i,columnspacing:"0em",columnwidth:o,rowspacing:"3pt","data-break-align":a,side:t.options.tagSide,minlabelspacing:c?"0":t.options.tagIndent,"data-width-includes-label":!0},l.setProperty("zeroWidthLabel",c),l},HandleDeclareOp(t,e){const r=t.GetStar()?"*":"",s=kr.GetCsNameArgument(t,e),n=t.GetArgument(e);kr.addMacro(t,s,xr.Macro,[`\\operatorname${r}{${n}}`]),t.Push(t.itemFactory.create("null"))},HandleOperatorName(t,e){const r=t.GetStar(),s=vt.trimSpaces(t.GetArgument(e));let n=new Et(s,Object.assign(Object.assign({},t.stack.env),{font:Pt.Variant.NORMAL,multiLetterIdentifiers:t.options.ams.operatornamePattern,operatorLetters:!0}),t.configuration).mml();if(n.isKind("mi")||(n=t.create("node","TeXAtom",[n])),ht.setProperties(n,{movesupsub:r,movablelimits:!0,texClass:it.OP}),!r){const e=t.GetNext(),r=t.i;"\\"===e&&++t.i&&"limits"!==t.GetCS()&&(t.i=r)}t.Push(t.itemFactory.create("fn",n))},SideSet(t,e){const[r,s]=wr(t.ParseArg(e)),[n,i]=wr(t.ParseArg(e)),a=t.ParseArg(e);let o=a;r&&(s?r.replaceChild(t.create("node","mphantom",[t.create("node","mpadded",[qt.copyNode(a,t)],{width:0})]),ht.getChildAt(r,0)):(o=t.create("node","mmultiscripts",[a]),n&&ht.appendChildren(o,[ht.getChildAt(n,1)||t.create("node","none"),ht.getChildAt(n,2)||t.create("node","none")]),ht.setProperty(o,"scriptalign","left"),ht.appendChildren(o,[t.create("node","mprescripts"),ht.getChildAt(r,1)||t.create("node","none"),ht.getChildAt(r,2)||t.create("node","none")]))),n&&o===a&&(n.replaceChild(a,ht.getChildAt(n,0)),o=n);const c=t.create("node","TeXAtom",[],{texClass:it.OP,movesupsub:!0,movablelimits:!0});s&&(r&&c.appendChild(r),c.appendChild(s)),c.appendChild(o),i&&c.appendChild(i),t.Push(c)},operatorLetter:(t,e)=>!!t.stack.env.operatorLetters&&ir.variable(t,e),MultiIntegral(t,e,r){let s=t.GetNext();if("\\"===s){const n=t.i;s=t.GetArgument(e),t.i=n,"\\limits"===s&&(r="\\!\\!\\mathop{\\,\\,"+r+"}")}t.string=r+" "+t.string.slice(t.i),t.i=0},xArrow(t,e,r,s,n,i=0){const a={width:"+"+vt.em((s+n)/18),lspace:vt.em(s/18)},o=t.GetBrackets(e),c=t.ParseArg(e),l=t.create("node","mspace",[],{depth:".2em"});let h=t.create("token","mo",{stretchy:!0,texClass:it.REL},String.fromCodePoint(r));i&&h.attributes.set("minsize",vt.em(i)),h=t.create("node","mstyle",[h],{scriptlevel:0});const m=t.create("node","munderover",[h]);let u=t.create("node","mpadded",[c,l],a);if(ht.setAttribute(u,"voffset","-.2em"),ht.setAttribute(u,"height","-.2em"),ht.setChild(m,m.over,u),o){const e=new Et(o,t.stack.env,t.configuration).mml(),r=t.create("node","mspace",[],{height:".75em"});u=t.create("node","mpadded",[e,r],a),ht.setAttribute(u,"voffset",".15em"),ht.setAttribute(u,"depth","-.15em"),ht.setChild(m,m.under,u)}ht.setProperty(m,"subsupOK",!0),t.Push(m)},HandleShove(t,e,r){const s=t.stack.Top();if("multline"!==s.kind)throw new Mt("CommandOnlyAllowedInEnv","%1 only allowed in %2 environment",t.currentCS,"multline");if(s.Size())throw new Mt("CommandAtTheBeginingOfLine","%1 must come at the beginning of the line",t.currentCS);s.setProperty("shove",r)},CFrac(t,e){let r=vt.trimSpaces(t.GetBrackets(e,""));const s=t.GetArgument(e),n=t.GetArgument(e),i={l:Pt.Align.LEFT,r:Pt.Align.RIGHT,"":""},a=new Et("\\strut\\textstyle{"+s+"}",t.stack.env,t.configuration).mml(),o=new Et("\\strut\\textstyle{"+n+"}",t.stack.env,t.configuration).mml(),c=t.create("node","mfrac",[a,o]);if(r=i[r],null==r)throw new Mt("IllegalAlign","Illegal alignment specified in %1",t.currentCS);r&&ht.setProperties(c,{numalign:r,denomalign:r}),t.Push(c)},Genfrac(t,e,r,s,n,i){null==r&&(r=t.GetDelimiterArg(e)),null==s&&(s=t.GetDelimiterArg(e)),null==n&&(n=t.GetArgument(e)),null==i&&(i=vt.trimSpaces(t.GetArgument(e)));const a=t.ParseArg(e),o=t.ParseArg(e);let c=t.create("node","mfrac",[a,o]);if(""!==n&&ht.setAttribute(c,"linethickness",n),(r||s)&&(ht.setProperty(c,"withDelims",!0),c=qt.fixedFence(t.configuration,r,c,s)),""!==i){const e=parseInt(i,10),r=["D","T","S","SS"][e];if(null==r)throw new Mt("BadMathStyleFor","Bad math style for %1",t.currentCS);c=t.create("node","mstyle",[c]),"D"===r?ht.setProperties(c,{displaystyle:!0,scriptlevel:0}):ht.setProperties(c,{displaystyle:!1,scriptlevel:e-1})}t.Push(c)},HandleTag(t,e){if(!t.tags.currentTag.taggable&&t.tags.env)throw new Mt("CommandNotAllowedInEnv","%1 not allowed in %2 environment",t.currentCS,t.tags.env);if(t.tags.currentTag.tag)throw new Mt("MultipleCommand","Multiple %1",t.currentCS);const r=t.GetStar(),s=vt.trimSpaces(t.GetArgument(e));t.tags.tag(s,r),t.Push(t.itemFactory.create("null"))},HandleNoTag:rr.HandleNoTag,HandleRef:rr.HandleRef,Macro:rr.Macro,Accent:rr.Accent,Tilde:rr.Tilde,Array:rr.Array,Spacer:rr.Spacer,NamedOp:rr.NamedOp,EqnArray:rr.EqnArray,Equation:rr.Equation};new ne("AMSmath-mathchar0mo",ir.mathchar0mo,{iiiint:["\u2a0c",{texClass:it.OP}]}),new re("AMSmath-operatorLetter",xr.operatorLetter,/[-*]/i),new oe("AMSmath-macros",{mathring:[xr.Accent,"02DA"],nobreakspace:xr.Tilde,negmedspace:[xr.Spacer,Je.negativemediummathspace],negthickspace:[xr.Spacer,Je.negativethickmathspace],idotsint:[xr.MultiIntegral,"\\int\\cdots\\int"],dddot:[xr.Accent,"20DB"],ddddot:[xr.Accent,"20DC"],sideset:xr.SideSet,boxed:[xr.Macro,"\\fbox{$\\displaystyle{#1}$}",1],tag:xr.HandleTag,notag:xr.HandleNoTag,eqref:[xr.HandleRef,!0],substack:[xr.Macro,"\\begin{subarray}{c}#1\\end{subarray}",1],injlim:[xr.NamedOp,"inj lim"],projlim:[xr.NamedOp,"proj lim"],varliminf:[xr.Macro,"\\mathop{\\underline{\\mmlToken{mi}{lim}}}"],varlimsup:[xr.Macro,"\\mathop{\\overline{\\mmlToken{mi}{lim}}}"],varinjlim:[xr.Macro,"\\mathop{\\underrightarrow{\\mmlToken{mi}{lim}}}"],varprojlim:[xr.Macro,"\\mathop{\\underleftarrow{\\mmlToken{mi}{lim}}}"],DeclareMathOperator:xr.HandleDeclareOp,operatorname:xr.HandleOperatorName,genfrac:xr.Genfrac,frac:[xr.Genfrac,"","","",""],tfrac:[xr.Genfrac,"","","","1"],dfrac:[xr.Genfrac,"","","","0"],binom:[xr.Genfrac,"(",")","0",""],tbinom:[xr.Genfrac,"(",")","0","1"],dbinom:[xr.Genfrac,"(",")","0","0"],cfrac:xr.CFrac,shoveleft:[xr.HandleShove,Pt.Align.LEFT],shoveright:[xr.HandleShove,Pt.Align.RIGHT],xrightarrow:[xr.xArrow,8594,5,10],xleftarrow:[xr.xArrow,8592,10,5]}),new ce("AMSmath-environment",ir.environment,{"equation*":[xr.Equation,null,!1],"eqnarray*":[xr.EqnArray,null,!1,!0,"rcl","bmt",qt.cols(0,Je.thickmathspace),".5em"],align:[xr.EqnArray,null,!0,!0,"rl","bt",qt.cols(0,2)],"align*":[xr.EqnArray,null,!1,!0,"rl","bt",qt.cols(0,2)],multline:[xr.Multline,null,!0],"multline*":[xr.Multline,null,!1],split:[xr.EqnArray,null,!1,!1,"rl","bt",qt.cols(0)],gather:[xr.EqnArray,null,!0,!0,"c","m"],"gather*":[xr.EqnArray,null,!1,!0,"c","m"],alignat:[xr.AlignAt,null,!0,!0],"alignat*":[xr.AlignAt,null,!1,!0],alignedat:[xr.AlignAt,null,!1,!1],aligned:[xr.AmsEqnArray,null,null,null,"rl","bt",qt.cols(0,2),".5em","D"],gathered:[xr.AmsEqnArray,null,null,null,"c","m",null,".5em","D"],xalignat:[xr.XalignAt,null,!0,!0],"xalignat*":[xr.XalignAt,null,!1,!0],xxalignat:[xr.XalignAt,null,!1,!1],flalign:[xr.FlalignArray,null,!0,!1,!0,"rlc","btm","auto auto fit"],"flalign*":[xr.FlalignArray,null,!1,!1,!0,"rlc","btm","auto auto fit"],subarray:[xr.Array,null,null,null,null,qt.cols(0),"0.1em","S",!0],smallmatrix:[xr.Array,null,null,null,"c",qt.cols(1/3),".2em","S",!0],matrix:[xr.Array,null,null,null,"c"],pmatrix:[xr.Array,null,"(",")","c"],bmatrix:[xr.Array,null,"[","]","c"],Bmatrix:[xr.Array,null,"\\{","\\}","c"],vmatrix:[xr.Array,null,"\\vert","\\vert","c"],Vmatrix:[xr.Array,null,"\\Vert","\\Vert","c"],cases:[xr.Array,null,"\\{",".","ll",null,".2em","T"]}),new ie("AMSmath-delimiter",ir.delimiter,{"\\lvert":["|",{texClass:it.OPEN}],"\\rvert":["|",{texClass:it.CLOSE}],"\\lVert":["\u2016",{texClass:it.OPEN}],"\\rVert":["\u2016",{texClass:it.CLOSE}]}),new ne("AMSsymbols-mathchar0mi",ir.mathchar0mi,{digamma:"\u03dd",varkappa:"\u03f0",varGamma:["\u0393",{mathvariant:Pt.Variant.ITALIC}],varDelta:["\u0394",{mathvariant:Pt.Variant.ITALIC}],varTheta:["\u0398",{mathvariant:Pt.Variant.ITALIC}],varLambda:["\u039b",{mathvariant:Pt.Variant.ITALIC}],varXi:["\u039e",{mathvariant:Pt.Variant.ITALIC}],varPi:["\u03a0",{mathvariant:Pt.Variant.ITALIC}],varSigma:["\u03a3",{mathvariant:Pt.Variant.ITALIC}],varUpsilon:["\u03a5",{mathvariant:Pt.Variant.ITALIC}],varPhi:["\u03a6",{mathvariant:Pt.Variant.ITALIC}],varPsi:["\u03a8",{mathvariant:Pt.Variant.ITALIC}],varOmega:["\u03a9",{mathvariant:Pt.Variant.ITALIC}],beth:"\u2136",gimel:"\u2137",daleth:"\u2138",backprime:["\u2035",{variantForm:!0}],hslash:"\u210f",varnothing:["\u2205",{variantForm:!0}],blacktriangle:"\u25b4",triangledown:["\u25bd",{variantForm:!0}],blacktriangledown:"\u25be",square:"\u25fb",Box:"\u25fb",blacksquare:"\u25fc",lozenge:"\u25ca",Diamond:"\u25ca",blacklozenge:"\u29eb",circledS:["\u24c8",{mathvariant:Pt.Variant.NORMAL}],bigstar:"\u2605",sphericalangle:"\u2222",measuredangle:"\u2221",nexists:"\u2204",complement:"\u2201",mho:"\u2127",eth:["\xf0",{mathvariant:Pt.Variant.NORMAL}],Finv:"\u2132",diagup:"\u2571",Game:"\u2141",diagdown:"\u2572",Bbbk:["k",{mathvariant:Pt.Variant.DOUBLESTRUCK}],yen:"\xa5",circledR:"\xae",checkmark:"\u2713",maltese:"\u2720"}),new ne("AMSsymbols-mathchar0mo",ir.mathchar0mo,{dotplus:"\u2214",ltimes:"\u22c9",smallsetminus:["\u2216",{variantForm:!0}],rtimes:"\u22ca",Cap:"\u22d2",doublecap:"\u22d2",leftthreetimes:"\u22cb",Cup:"\u22d3",doublecup:"\u22d3",rightthreetimes:"\u22cc",barwedge:"\u22bc",curlywedge:"\u22cf",veebar:"\u22bb",curlyvee:"\u22ce",doublebarwedge:"\u2a5e",boxminus:"\u229f",circleddash:"\u229d",boxtimes:"\u22a0",circledast:"\u229b",boxdot:"\u22a1",circledcirc:"\u229a",boxplus:"\u229e",centerdot:["\u22c5",{variantForm:!0}],divideontimes:"\u22c7",intercal:"\u22ba",leqq:"\u2266",geqq:"\u2267",leqslant:"\u2a7d",geqslant:"\u2a7e",eqslantless:"\u2a95",eqslantgtr:"\u2a96",lesssim:"\u2272",gtrsim:"\u2273",lessapprox:"\u2a85",gtrapprox:"\u2a86",approxeq:"\u224a",lessdot:"\u22d6",gtrdot:"\u22d7",lll:"\u22d8",llless:"\u22d8",ggg:"\u22d9",gggtr:"\u22d9",lessgtr:"\u2276",gtrless:"\u2277",lesseqgtr:"\u22da",gtreqless:"\u22db",lesseqqgtr:"\u2a8b",gtreqqless:"\u2a8c",doteqdot:"\u2251",Doteq:"\u2251",eqcirc:"\u2256",risingdotseq:"\u2253",circeq:"\u2257",fallingdotseq:"\u2252",triangleq:"\u225c",backsim:"\u223d",thicksim:["\u223c",{variantForm:!0}],backsimeq:"\u22cd",thickapprox:["\u2248",{variantForm:!0}],subseteqq:"\u2ac5",supseteqq:"\u2ac6",Subset:"\u22d0",Supset:"\u22d1",sqsubset:"\u228f",sqsupset:"\u2290",preccurlyeq:"\u227c",succcurlyeq:"\u227d",curlyeqprec:"\u22de",curlyeqsucc:"\u22df",precsim:"\u227e",succsim:"\u227f",precapprox:"\u2ab7",succapprox:"\u2ab8",vartriangleleft:"\u22b2",lhd:"\u22b2",vartriangleright:"\u22b3",rhd:"\u22b3",trianglelefteq:"\u22b4",unlhd:"\u22b4",trianglerighteq:"\u22b5",unrhd:"\u22b5",vDash:"\u22a8",Vdash:"\u22a9",Vvdash:"\u22aa",smallsmile:["\u2323",{variantForm:!0}],shortmid:["\u2223",{variantForm:!0}],smallfrown:["\u2322",{variantForm:!0}],shortparallel:["\u2225",{variantForm:!0}],bumpeq:"\u224f",between:"\u226c",Bumpeq:"\u224e",pitchfork:"\u22d4",varpropto:["\u221d",{variantForm:!0}],backepsilon:"\u220d",blacktriangleleft:"\u25c2",blacktriangleright:"\u25b8",therefore:"\u2234",because:"\u2235",eqsim:"\u2242",vartriangle:["\u25b3",{variantForm:!0}],Join:"\u22c8",nless:"\u226e",ngtr:"\u226f",nleq:"\u2270",ngeq:"\u2271",nleqslant:["\u2a87",{variantForm:!0}],ngeqslant:["\u2a88",{variantForm:!0}],nleqq:["\u2270",{variantForm:!0}],ngeqq:["\u2271",{variantForm:!0}],lneq:"\u2a87",gneq:"\u2a88",lneqq:"\u2268",gneqq:"\u2269",lvertneqq:["\u2268",{variantForm:!0}],gvertneqq:["\u2269",{variantForm:!0}],lnsim:"\u22e6",gnsim:"\u22e7",lnapprox:"\u2a89",gnapprox:"\u2a8a",nprec:"\u2280",nsucc:"\u2281",npreceq:["\u22e0",{variantForm:!0}],nsucceq:["\u22e1",{variantForm:!0}],precneqq:"\u2ab5",succneqq:"\u2ab6",precnsim:"\u22e8",succnsim:"\u22e9",precnapprox:"\u2ab9",succnapprox:"\u2aba",nsim:"\u2241",ncong:"\u2247",nshortmid:["\u2224",{variantForm:!0}],nshortparallel:["\u2226",{variantForm:!0}],nmid:"\u2224",nparallel:"\u2226",nvdash:"\u22ac",nvDash:"\u22ad",nVdash:"\u22ae",nVDash:"\u22af",ntriangleleft:"\u22ea",ntriangleright:"\u22eb",ntrianglelefteq:"\u22ec",ntrianglerighteq:"\u22ed",nsubseteq:"\u2288",nsupseteq:"\u2289",nsubseteqq:["\u2288",{variantForm:!0}],nsupseteqq:["\u2289",{variantForm:!0}],subsetneq:"\u228a",supsetneq:"\u228b",varsubsetneq:["\u228a",{variantForm:!0}],varsupsetneq:["\u228b",{variantForm:!0}],subsetneqq:"\u2acb",supsetneqq:"\u2acc",varsubsetneqq:["\u2acb",{variantForm:!0}],varsupsetneqq:["\u2acc",{variantForm:!0}],leftleftarrows:"\u21c7",rightrightarrows:"\u21c9",leftrightarrows:"\u21c6",rightleftarrows:"\u21c4",Lleftarrow:"\u21da",Rrightarrow:"\u21db",twoheadleftarrow:"\u219e",twoheadrightarrow:"\u21a0",leftarrowtail:"\u21a2",rightarrowtail:"\u21a3",looparrowleft:"\u21ab",looparrowright:"\u21ac",leftrightharpoons:"\u21cb",rightleftharpoons:["\u21cc",{variantForm:!0}],curvearrowleft:"\u21b6",curvearrowright:"\u21b7",circlearrowleft:"\u21ba",circlearrowright:"\u21bb",Lsh:"\u21b0",Rsh:"\u21b1",upuparrows:"\u21c8",downdownarrows:"\u21ca",upharpoonleft:"\u21bf",upharpoonright:"\u21be",downharpoonleft:"\u21c3",restriction:"\u21be",multimap:"\u22b8",downharpoonright:"\u21c2",leftrightsquigarrow:"\u21ad",rightsquigarrow:"\u21dd",leadsto:"\u21dd",dashrightarrow:"\u21e2",dashleftarrow:"\u21e0",nleftarrow:"\u219a",nrightarrow:"\u219b",nLeftarrow:"\u21cd",nRightarrow:"\u21cf",nleftrightarrow:"\u21ae",nLeftrightarrow:"\u21ce"}),new ie("AMSsymbols-delimiter",ir.delimiter,{"\\ulcorner":"\u231c","\\urcorner":"\u231d","\\llcorner":"\u231e","\\lrcorner":"\u231f"}),new oe("AMSsymbols-macros",{implies:[xr.Macro,"\\;\\Longrightarrow\\;"],impliedby:[xr.Macro,"\\;\\Longleftarrow\\;"]});class Tr extends Tt{get kind(){return"beginEnv"}get isOpen(){return!0}checkItem(t){if(t.isKind("end")){if(t.getName()!==this.getName())throw new Mt("EnvBadEnd","\\begin{%1} ended with \\end{%2}",this.getName(),t.getName());return[[this.factory.create("mml",this.toMml())],!0]}if(t.isKind("stop"))throw new Mt("EnvMissingEnd","Missing \\end{%1}",this.getName());return super.checkItem(t)}}const Pr={NewCommand(t,e){const r=kr.GetCsNameArgument(t,e),s=kr.GetArgCount(t,e),n=t.GetBrackets(e),i=t.GetArgument(e);kr.addMacro(t,r,Pr.Macro,[i,s,n]),t.Push(t.itemFactory.create("null"))},NewEnvironment(t,e){const r=vt.trimSpaces(t.GetArgument(e)),s=kr.GetArgCount(t,e),n=t.GetBrackets(e),i=t.GetArgument(e),a=t.GetArgument(e);kr.addEnvironment(t,r,Pr.BeginEnv,[!0,i,a,s,n]),t.Push(t.itemFactory.create("null"))},MacroDef(t,e){const r=kr.GetCSname(t,e),s=kr.GetTemplate(t,e,"\\"+r),n=t.GetArgument(e);s instanceof Array?kr.addMacro(t,r,Pr.MacroWithTemplate,[n].concat(s)):kr.addMacro(t,r,Pr.Macro,[n,s]),t.Push(t.itemFactory.create("null"))},Let(t,e){const r=kr.GetCSname(t,e);let s=t.GetNext();"="===s&&(t.i++,s=t.GetNext());const n=t.configuration.handlers;if(t.Push(t.itemFactory.create("null")),"\\"===s){if(r===(e=kr.GetCSname(t,e)))return;const s=n.get(At.MACRO).applicable(e);if(s instanceof ae){const n=s.lookup(e);return void kr.addMacro(t,r,n.func,n.args,n.token)}if(s instanceof ne&&!(s instanceof ie)){const n=s.lookup(e),i=t=>s.parser(t,n);return void kr.addMacro(t,r,i,[r,n.char])}const i=n.get(At.DELIMITER).lookup("\\"+e);return i?void kr.addDelimiter(t,"\\"+r,i.char,i.attributes):(kr.checkProtectedMacros(t,r),kr.undefineMacro(t,r),void kr.undefineDelimiter(t,"\\"+r))}t.i++;const i=n.get(At.DELIMITER).lookup(s);i?kr.addDelimiter(t,"\\"+r,i.char,i.attributes):kr.addMacro(t,r,Pr.Macro,[s])},MacroWithTemplate(t,e,r,s,...n){const i=parseInt(s,10);if(n.length){const s=[];if(t.GetNext(),n[0]&&!kr.MatchParam(t,n[0]))throw new Mt("MismatchUseDef","Use of %1 doesn't match its definition",e);if(i){for(let r=0;rUr(t,e,n)))):Ur(t,e,n)}}function Ur(t,e,r){const s=be.get(r);if(s){let n=_r[e]||{};s.options&&1===Object.keys(s.options).length&&s.options[r]&&(n={[r]:n}),t.configuration.add(r,t,n);const i=t.parseOptions.packageData.get("require").configured;s.preprocessors.length&&!i.has(r)&&(i.set(r,!0),qr.retryAfter(Promise.resolve()))}}function jr(t,e){var r,s;const n=t.options.require,i=n.allow,a=("["===e.substring(0,1)?"":n.prefix)+e;if(!(Object.hasOwn(i,a)?i[a]:Object.hasOwn(i,e)?i[e]:n.defaultAllow))throw new Mt("BadRequire",'Extension "%1" is not allowed to be loaded',a);const o=Rr.packages.get(a);if(o||qr.retryAfter(Br.load(a).catch((t=>{}))),o.hasFailed)throw new Mt("RequireFail",'Extension "%1" failed to load',e);const c=null===(r=Gr[a])||void 0===r?void 0:r.rendererExtensions,l=null===(s=Lr.startup.document)||void 0===s?void 0:s.menu;c&&l&&l.addRequiredExtensions(c),Hr(t.configuration.packageData.get("require").jax,a)}const Kr={Require(t,e){const r=t.GetArgument(e);if(r.match(/[^_a-zA-Z0-9]/)||""===r)throw new Mt("BadPackageName","Argument for %1 is not a valid package name",e);jr(t,r),t.Push(t.itemFactory.create("null"))}},zr={require:{allow:K({base:!1,autoload:!1,configmacros:!1,tagformat:!1,setoptions:!1,texhtml:!1}),defaultAllow:!0,prefix:"tex"}};new oe("require",{require:Kr.Require});const Xr=pe.create("require",{[bt.HANDLER]:{[At.MACRO]:["require"]},[bt.CONFIG]:function(t,e){e.parseOptions.packageData.set("require",{jax:e,required:[...e.options.packages],configured:new Map});const r=e.parseOptions.options.require,s=r.prefix;if(s.match(/[^_a-zA-Z0-9]/))throw Error("Illegal characters used in \\require prefix");Gr.paths[s]||(Gr.paths[s]="[mathjax]/input/tex/extensions"),r.prefix="["+s+"]/"},[bt.OPTIONS]:zr});function $r(t,e,r,s){if(Rr.packages.has(t.options.require.prefix+r)){const n=t.options.autoload[r],[i,a]=2===n.length&&Array.isArray(n[0])?n:[n,[]];for(const t of i)Vr.remove(t);for(const t of a)Jr.remove(t);t.string=(s?e+" ":"\\begin{"+e.slice(1)+"}")+t.string.slice(t.i),t.i=0}jr(t,r)}const Vr=new oe("autoload-macros",{}),Jr=new oe("autoload-environments",{}),Wr=pe.create("autoload",{[bt.HANDLER]:{[At.MACRO]:["autoload-macros"],[At.ENVIRONMENT]:["autoload-environments"]},[bt.OPTIONS]:{autoload:K({action:["toggle","mathtip","texttip"],amscd:[[],["CD"]],bbox:["bbox"],boldsymbol:["boldsymbol"],braket:["bra","ket","braket","set","Bra","Ket","Braket","Set","ketbra","Ketbra"],bussproofs:[[],["prooftree"]],cancel:["cancel","bcancel","xcancel","cancelto"],color:["color","definecolor","textcolor","colorbox","fcolorbox"],enclose:["enclose"],extpfeil:["xtwoheadrightarrow","xtwoheadleftarrow","xmapsto","xlongequal","xtofrom","Newextarrow"],html:["data","href","class","style","cssId"],mhchem:["ce","pu"],newcommand:["newcommand","renewcommand","newenvironment","renewenvironment","def","let"],unicode:["unicode","U","char"],verb:["verb"]})},[bt.CONFIG]:function(t,e){const r=e.parseOptions,s=r.handlers.get(At.MACRO),n=r.handlers.get(At.ENVIRONMENT),i=r.options.autoload;r.packageData.set("autoload",{Autoload:$r});for(const t of Object.keys(i)){const e=i[t],[r,a]=2===e.length&&Array.isArray(e[0])?e:[e,[]];for(const e of r)s.lookup(e)&&"color"!==e||Vr.add(e,new Zt(e,$r,[t,!0]));for(const e of a)n.lookup(e)||Jr.add(e,new Zt(e,$r,[t,!1]))}r.packageData.get("require")||Xr.config(t,e)},[bt.INIT]:function(t){t.options.require||X(t.options,Xr.options)},[bt.PRIORITY]:10}),Yr="configmacros-map",Qr="configmacros-active-map",Zr="configmacros-env-map";function ts(t,e,r){const s=r.parseOptions.handlers.retrieve(e),n=r.parseOptions.options[t];for(const t of Object.keys(n)){const e="string"==typeof n[t]?[n[t]]:n[t],r=Array.isArray(e[2])?new Zt(t,Er.MacroWithTemplate,e.slice(0,2).concat(e[2])):new Zt(t,Er.Macro,e);s.add(t,r)}}const es=pe.create("configmacros",{[bt.INIT]:function(t){new ae(Qr,{}),new oe(Yr,{}),new ce(Zr,ir.environment,{}),t.append(pe.local({handler:{[At.CHARACTER]:[Qr],[At.MACRO]:[Yr],[At.ENVIRONMENT]:[Zr]},priority:3}))},[bt.CONFIG]:function(t,e){!function(t){ts("active",Qr,t)}(e),function(t){ts("macros",Yr,t)}(e),function(t){const e=t.parseOptions.handlers.retrieve(Zr),r=t.parseOptions.options.environments;for(const t of Object.keys(r))e.add(t,new Zt(t,Er.BeginEnv,[!0].concat(r[t])))}(e)},[bt.ITEMS]:{[Tr.prototype.kind]:Tr},[bt.OPTIONS]:{active:K({}),macros:K({}),environments:K({})}});const rs=pe.create("noundefined",{[bt.FALLBACK]:{[At.MACRO]:function(t,e){const r=t.create("text","\\"+e),s=t.options.noundefined,n={};for(const t of["color","background","size"])s[t]&&(n["math"+t]=s[t]);t.Push(t.create("node","mtext",[],n,r))}},[bt.OPTIONS]:{noundefined:{color:"red",background:"",size:""}},[bt.PRIORITY]:3});class ss extends Et{get texParser(){return this.configuration.packageData.get("textmacros").texParser}get tags(){return this.texParser.tags}constructor(t,e,r,s){super(t,e,r),this.level=s}mml(){return this.copyLists(),this.configuration.popParser(),null!=this.level?this.create("node","mstyle",this.nodes,{displaystyle:!1,scriptlevel:this.level}):1===this.nodes.length?this.nodes[0]:this.create("node","mrow",this.nodes)}copyLists(){const t=this.texParser.configuration;for(const[e,r]of Object.entries(this.configuration.nodeLists))for(const s of r)t.addNode(e,s);this.configuration.nodeLists={}}Parse(){this.text="",this.nodes=[],this.envStack=[],super.Parse()}saveText(){if(this.text){const t=this.stack.env.mathvariant,e=qt.internalText(this,this.text,t?{mathvariant:t}:{});this.text="",this.Push(e)}}Push(t){if(this.text&&this.saveText(),t instanceof we)return super.Push(t);t instanceof Re?this.stack.env.mathcolor=this.stack.env.color:t instanceof at&&(this.addAttributes(t),this.nodes.push(t))}PushMath(t){const e=this.stack.env;for(const r of["mathsize","mathcolor"])e[r]&&!t.attributes.hasExplicit(r)&&(t.isToken||t.isKind("mstyle")||(t=this.create("node","mstyle",[t])),ht.setAttribute(t,r,e[r]));t.isInferred&&(t=this.create("node","mrow",t.childNodes)),t.isKind("TeXAtom")||(t=this.create("node","TeXAtom",[t])),this.nodes.push(t)}addAttributes(t){const e=this.stack.env;if(t.isToken)for(const r of["mathsize","mathcolor","mathvariant"])e[r]&&!t.attributes.hasExplicit(r)&&ht.setAttribute(t,r,e[r])}ParseTextArg(t,e){const r=this.GetArgument(t);return e=Object.assign(Object.assign({},this.stack.env),e),new ss(r,e,this.configuration).mml()}ParseArg(t){return new ss(this.GetArgument(t),this.stack.env,this.configuration).mml()}Error(t,e,...r){throw new Mt(t,e,...r)}}const ns=MathJax._.util.Retries,is=(ns.handleRetriesFor,ns.retryAfter),as={Comment(t,e){for(;t.i":[as.Spacer,Je.mediummathspace],";":[as.Spacer,Je.thickmathspace],"!":[as.Spacer,Je.negativethinmathspace],enspace:[as.Spacer,.5],quad:[as.Spacer,1],qquad:[as.Spacer,2],thinspace:[as.Spacer,Je.thinmathspace],negthinspace:[as.Spacer,Je.negativethinmathspace],hskip:as.Hskip,hspace:as.Hskip,kern:as.Hskip,mskip:as.Hskip,mspace:as.Hskip,mkern:as.Hskip,rule:as.rule,Rule:[as.Rule],Space:[as.Rule,"blank"],color:as.CheckAutoload,textcolor:as.CheckAutoload,colorbox:as.CheckAutoload,fcolorbox:as.CheckAutoload,href:as.CheckAutoload,style:as.CheckAutoload,class:as.CheckAutoload,data:as.CheckAutoload,cssId:as.CheckAutoload,unicode:as.CheckAutoload,U:as.CheckAutoload,char:as.CheckAutoload,ref:[as.HandleRef,!1],eqref:[as.HandleRef,!0],underline:[as.UnderOver,"2015"],llap:as.Lap,rlap:as.Lap,phantom:as.Phantom,vphantom:[as.Phantom,1,0],hphantom:[as.Phantom,0,1],smash:as.Smash,mmlToken:as.MmlToken});const cs=pe.create("text-base",{[bt.PARSER]:"text",[bt.PRIORITY]:1,[bt.HANDLER]:{[At.CHARACTER]:["command","text-special"],[At.MACRO]:["text-macros"]},[bt.FALLBACK]:{[At.CHARACTER]:(t,e)=>{t.text+=e},[At.MACRO]:(t,e)=>{const r=t.texParser,s=r.lookup(At.MACRO,e);s&&s._func!==as.Macro&&t.Error("MathMacro","%1 is only supported in math mode","\\"+e),r.parse(At.MACRO,[t,e])}},[bt.ITEMS]:{[ke.prototype.kind]:ke,[we.prototype.kind]:we,[Ge.prototype.kind]:Ge,[Re.prototype.kind]:Re}});function ls(t,e,r,s){const n=t.configuration.packageData.get("textmacros");return t instanceof ss||(n.texParser=t),n.parseOptions.clear(),[new ss(e,s?{mathvariant:s}:{},n.parseOptions,r).mml()]}const hs=pe.create("textmacros",{[bt.PRIORITY]:1,[bt.CONFIG]:(t,e)=>{const r=new Ae(e.parseOptions.options.textmacros.packages,["tex","text"]);r.init();const s=new jt(r,[]);s.options=e.parseOptions.options,r.config(e),Yt.addTags(r.tags),s.tags=Yt.getDefault(),s.tags.configuration=s,s.packageData=e.parseOptions.packageData,s.packageData.set("textmacros",{textConf:r,parseOptions:s,jax:e,texParser:null}),s.options.internalMath=ls},[bt.PREPROCESSORS]:[t=>{const e=t.data.packageData.get("textmacros");e.parseOptions.nodeFactory.setMmlFactory(e.jax.mmlFactory)}],[bt.OPTIONS]:{textmacros:{packages:["text-base"]}}});MathJax.loader&&MathJax.loader.checkVersion("input/tex","4.0.0","input"),H({_:{input:{tex_ts:T,tex:{ColumnParser:g,Configuration:v,FilterUtil:s,FindTeX:e,HandlerTypes:n,MapHandler:y,NodeFactory:u,NodeUtil:r,ParseMethods:M,ParseOptions:p,ParseUtil:d,Stack:a,StackItem:c,StackItemFactory:m,Tags:f,TexConstants:l,TexError:o,TexParser:h,Token:b,TokenMap:A,UnitUtil:i,ams:{AmsConfiguration:N,AmsItems:P,AmsMethods:C},autoload:{AutoloadConfiguration:F},base:{BaseConfiguration:x,BaseItems:k,BaseMethods:w},configmacros:{ConfigMacrosConfiguration:R},newcommand:{NewcommandConfiguration:I,NewcommandItems:S,NewcommandMethods:O,NewcommandUtil:E},noundefined:{NoUndefinedConfiguration:D},require:{RequireConfiguration:L},textmacros:{TextMacrosConfiguration:q,TextMacrosMethods:G,TextParser:B}}}}}),Br.preLoaded("input/tex-base","[tex]/ams","[tex]/newcommand","[tex]/textmacros","[tex]/noundefined","[tex]/require","[tex]/autoload","[tex]/configmacros"),function(t=[],e=!0){if(MathJax.startup){e&&(MathJax.startup.registerConstructor("tex",MathJax._.input.tex_ts.TeX),MathJax.startup.useInput("tex")),MathJax.config.tex||(MathJax.config.tex={});let r=MathJax.config.tex.packages;MathJax.config.tex.packages=t,r&&(Array.isArray(r)&&(r={"[+]":r.filter((e=>!t.includes(e)))}),z(MathJax.config.tex,{packages:r}))}}(["base","ams","newcommand","textmacros","noundefined","require","autoload","configmacros"])})();