erl-mathtextx-editor 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -399,7 +399,7 @@ l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
399
399
  |[ \r ]+
400
400
  ?)[ \r ]*`,p2="[̀-ͯ]",bue=new RegExp(p2+"+$"),yue="("+PM+"+)|"+(_ue+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(p2+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(p2+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+gue)+("|"+fue+")");let BM=class{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(yue,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new ji("EOF",new Yr(this,n,n));var r=this.tokenRegex.exec(t);if(r===null||r.index!==n)throw new Fe("Unexpected character: '"+t[n]+"'",new ji(t[n],new Yr(this,n,n+1)));var i=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=t.indexOf(`
401
401
  `,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new ji(i,new Yr(this,n,this.tokenRegex.lastIndex))}};class vue{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Fe("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,r){if(r===void 0&&(r=!1),r){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][t];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(t)&&(a[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var Eue=pM;W("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),W("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),W("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}}),W("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}}),W("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),W("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),W("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var FM={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};W("\\char",function(e){var t=e.popToken(),n,r="";if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")r=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new Fe("\\char` missing argument");r=t.text.charCodeAt(0)}else n=10;if(n){if(r=FM[t.text],r==null||r>=n)throw new Fe("Invalid base-"+n+" digit "+t.text);for(var i;(i=FM[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return"\\@char{"+r+"}"});var h2=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new Fe("\\newcommand's first argument must be a macro name");var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new Fe("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!o&&!n)throw new Fe("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",c=e.expandNextToken();c.text!=="]"&&c.text!=="EOF";)l+=c.text,c=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Fe("Invalid number of arguments: "+l);s=parseInt(l),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),""};W("\\newcommand",e=>h2(e,!1,!0,!1)),W("\\renewcommand",e=>h2(e,!0,!1,!1)),W("\\providecommand",e=>h2(e,!0,!0,!0)),W("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""}),W("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""}),W("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),ks[n],Qt.math[n],Qt.text[n]),""}),W("\\bgroup","{"),W("\\egroup","}"),W("~","\\nobreakspace"),W("\\lq","`"),W("\\rq","'"),W("\\aa","\\r a"),W("\\AA","\\r A"),W("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),W("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),W("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),W("ℬ","\\mathscr{B}"),W("ℰ","\\mathscr{E}"),W("ℱ","\\mathscr{F}"),W("ℋ","\\mathscr{H}"),W("ℐ","\\mathscr{I}"),W("ℒ","\\mathscr{L}"),W("ℳ","\\mathscr{M}"),W("ℛ","\\mathscr{R}"),W("ℭ","\\mathfrak{C}"),W("ℌ","\\mathfrak{H}"),W("ℨ","\\mathfrak{Z}"),W("\\Bbbk","\\Bbb{k}"),W("·","\\cdotp"),W("\\llap","\\mathllap{\\textrm{#1}}"),W("\\rlap","\\mathrlap{\\textrm{#1}}"),W("\\clap","\\mathclap{\\textrm{#1}}"),W("\\mathstrut","\\vphantom{(}"),W("\\underbar","\\underline{\\text{#1}}"),W("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}'),W("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),W("\\ne","\\neq"),W("≠","\\neq"),W("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),W("∉","\\notin"),W("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),W("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),W("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),W("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),W("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),W("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),W("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),W("⟂","\\perp"),W("‼","\\mathclose{!\\mkern-0.8mu!}"),W("∌","\\notni"),W("⌜","\\ulcorner"),W("⌝","\\urcorner"),W("⌞","\\llcorner"),W("⌟","\\lrcorner"),W("©","\\copyright"),W("®","\\textregistered"),W("️","\\textregistered"),W("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),W("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),W("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),W("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),W("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),W("⋮","\\vdots"),W("\\varGamma","\\mathit{\\Gamma}"),W("\\varDelta","\\mathit{\\Delta}"),W("\\varTheta","\\mathit{\\Theta}"),W("\\varLambda","\\mathit{\\Lambda}"),W("\\varXi","\\mathit{\\Xi}"),W("\\varPi","\\mathit{\\Pi}"),W("\\varSigma","\\mathit{\\Sigma}"),W("\\varUpsilon","\\mathit{\\Upsilon}"),W("\\varPhi","\\mathit{\\Phi}"),W("\\varPsi","\\mathit{\\Psi}"),W("\\varOmega","\\mathit{\\Omega}"),W("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),W("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),W("\\boxed","\\fbox{$\\displaystyle{#1}$}"),W("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),W("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),W("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),W("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),W("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var UM={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},xue=new Set(["bin","rel"]);W("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in UM?t=UM[n]:(n.slice(0,4)==="\\not"||n in Qt.math&&xue.has(Qt.math[n].group))&&(t="\\dotsb"),t});var m2={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};W("\\dotso",function(e){var t=e.future().text;return t in m2?"\\ldots\\,":"\\ldots"}),W("\\dotsc",function(e){var t=e.future().text;return t in m2&&t!==","?"\\ldots\\,":"\\ldots"}),W("\\cdots",function(e){var t=e.future().text;return t in m2?"\\@cdots\\,":"\\@cdots"}),W("\\dotsb","\\cdots"),W("\\dotsm","\\cdots"),W("\\dotsi","\\!\\cdots"),W("\\dotsx","\\ldots\\,"),W("\\DOTSI","\\relax"),W("\\DOTSB","\\relax"),W("\\DOTSX","\\relax"),W("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),W("\\,","\\tmspace+{3mu}{.1667em}"),W("\\thinspace","\\,"),W("\\>","\\mskip{4mu}"),W("\\:","\\tmspace+{4mu}{.2222em}"),W("\\medspace","\\:"),W("\\;","\\tmspace+{5mu}{.2777em}"),W("\\thickspace","\\;"),W("\\!","\\tmspace-{3mu}{.1667em}"),W("\\negthinspace","\\!"),W("\\negmedspace","\\tmspace-{4mu}{.2222em}"),W("\\negthickspace","\\tmspace-{5mu}{.277em}"),W("\\enspace","\\kern.5em "),W("\\enskip","\\hskip.5em\\relax"),W("\\quad","\\hskip1em\\relax"),W("\\qquad","\\hskip2em\\relax"),W("\\tag","\\@ifstar\\tag@literal\\tag@paren"),W("\\tag@paren","\\tag@literal{({#1})}"),W("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Fe("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),W("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),W("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),W("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),W("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),W("\\newline","\\\\\\relax"),W("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var zM=$e(Ca["Main-Regular"][84][1]-.7*Ca["Main-Regular"][65][1]);W("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+zM+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}"),W("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+zM+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}"),W("\\hspace","\\@ifstar\\@hspacer\\@hspace"),W("\\@hspace","\\hskip #1\\relax"),W("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),W("\\ordinarycolon",":"),W("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),W("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),W("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),W("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),W("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),W("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),W("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),W("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),W("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),W("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),W("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),W("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),W("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),W("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),W("∷","\\dblcolon"),W("∹","\\eqcolon"),W("≔","\\coloneqq"),W("≕","\\eqqcolon"),W("⩴","\\Coloneqq"),W("\\ratio","\\vcentcolon"),W("\\coloncolon","\\dblcolon"),W("\\colonequals","\\coloneqq"),W("\\coloncolonequals","\\Coloneqq"),W("\\equalscolon","\\eqqcolon"),W("\\equalscoloncolon","\\Eqqcolon"),W("\\colonminus","\\coloneq"),W("\\coloncolonminus","\\Coloneq"),W("\\minuscolon","\\eqcolon"),W("\\minuscoloncolon","\\Eqcolon"),W("\\coloncolonapprox","\\Colonapprox"),W("\\coloncolonsim","\\Colonsim"),W("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),W("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),W("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),W("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),W("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),W("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),W("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),W("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),W("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),W("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),W("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),W("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),W("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),W("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),W("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),W("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),W("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),W("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),W("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),W("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),W("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),W("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),W("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),W("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),W("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),W("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),W("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),W("\\imath","\\html@mathml{\\@imath}{ı}"),W("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),W("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),W("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),W("⟦","\\llbracket"),W("⟧","\\rrbracket"),W("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),W("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),W("⦃","\\lBrace"),W("⦄","\\rBrace"),W("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),W("⦵","\\minuso"),W("\\darr","\\downarrow"),W("\\dArr","\\Downarrow"),W("\\Darr","\\Downarrow"),W("\\lang","\\langle"),W("\\rang","\\rangle"),W("\\uarr","\\uparrow"),W("\\uArr","\\Uparrow"),W("\\Uarr","\\Uparrow"),W("\\N","\\mathbb{N}"),W("\\R","\\mathbb{R}"),W("\\Z","\\mathbb{Z}"),W("\\alef","\\aleph"),W("\\alefsym","\\aleph"),W("\\Alpha","\\mathrm{A}"),W("\\Beta","\\mathrm{B}"),W("\\bull","\\bullet"),W("\\Chi","\\mathrm{X}"),W("\\clubs","\\clubsuit"),W("\\cnums","\\mathbb{C}"),W("\\Complex","\\mathbb{C}"),W("\\Dagger","\\ddagger"),W("\\diamonds","\\diamondsuit"),W("\\empty","\\emptyset"),W("\\Epsilon","\\mathrm{E}"),W("\\Eta","\\mathrm{H}"),W("\\exist","\\exists"),W("\\harr","\\leftrightarrow"),W("\\hArr","\\Leftrightarrow"),W("\\Harr","\\Leftrightarrow"),W("\\hearts","\\heartsuit"),W("\\image","\\Im"),W("\\infin","\\infty"),W("\\Iota","\\mathrm{I}"),W("\\isin","\\in"),W("\\Kappa","\\mathrm{K}"),W("\\larr","\\leftarrow"),W("\\lArr","\\Leftarrow"),W("\\Larr","\\Leftarrow"),W("\\lrarr","\\leftrightarrow"),W("\\lrArr","\\Leftrightarrow"),W("\\Lrarr","\\Leftrightarrow"),W("\\Mu","\\mathrm{M}"),W("\\natnums","\\mathbb{N}"),W("\\Nu","\\mathrm{N}"),W("\\Omicron","\\mathrm{O}"),W("\\plusmn","\\pm"),W("\\rarr","\\rightarrow"),W("\\rArr","\\Rightarrow"),W("\\Rarr","\\Rightarrow"),W("\\real","\\Re"),W("\\reals","\\mathbb{R}"),W("\\Reals","\\mathbb{R}"),W("\\Rho","\\mathrm{P}"),W("\\sdot","\\cdot"),W("\\sect","\\S"),W("\\spades","\\spadesuit"),W("\\sub","\\subset"),W("\\sube","\\subseteq"),W("\\supe","\\supseteq"),W("\\Tau","\\mathrm{T}"),W("\\thetasym","\\vartheta"),W("\\weierp","\\wp"),W("\\Zeta","\\mathrm{Z}"),W("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),W("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),W("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),W("\\bra","\\mathinner{\\langle{#1}|}"),W("\\ket","\\mathinner{|{#1}\\rangle}"),W("\\braket","\\mathinner{\\langle{#1}\\rangle}"),W("\\Bra","\\left\\langle#1\\right|"),W("\\Ket","\\left|#1\\right\\rangle");var $M=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get("|"),s=t.macros.get("\\|");t.macros.beginGroup();var l=d=>p=>{e&&(p.macros.set("|",o),i.length&&p.macros.set("\\|",s));var h=d;if(!d&&i.length){var m=p.future();m.text==="|"&&(p.popToken(),h=!0)}return{tokens:h?i:r,numArgs:0}};t.macros.set("|",l(!1)),i.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,u=t.expandTokens([...a,...c,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};W("\\bra@ket",$M(!1)),W("\\bra@set",$M(!0)),W("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),W("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),W("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),W("\\angln","{\\angl n}"),W("\\blue","\\textcolor{##6495ed}{#1}"),W("\\orange","\\textcolor{##ffa500}{#1}"),W("\\pink","\\textcolor{##ff00af}{#1}"),W("\\red","\\textcolor{##df0030}{#1}"),W("\\green","\\textcolor{##28ae7b}{#1}"),W("\\gray","\\textcolor{gray}{#1}"),W("\\purple","\\textcolor{##9d38bd}{#1}"),W("\\blueA","\\textcolor{##ccfaff}{#1}"),W("\\blueB","\\textcolor{##80f6ff}{#1}"),W("\\blueC","\\textcolor{##63d9ea}{#1}"),W("\\blueD","\\textcolor{##11accd}{#1}"),W("\\blueE","\\textcolor{##0c7f99}{#1}"),W("\\tealA","\\textcolor{##94fff5}{#1}"),W("\\tealB","\\textcolor{##26edd5}{#1}"),W("\\tealC","\\textcolor{##01d1c1}{#1}"),W("\\tealD","\\textcolor{##01a995}{#1}"),W("\\tealE","\\textcolor{##208170}{#1}"),W("\\greenA","\\textcolor{##b6ffb0}{#1}"),W("\\greenB","\\textcolor{##8af281}{#1}"),W("\\greenC","\\textcolor{##74cf70}{#1}"),W("\\greenD","\\textcolor{##1fab54}{#1}"),W("\\greenE","\\textcolor{##0d923f}{#1}"),W("\\goldA","\\textcolor{##ffd0a9}{#1}"),W("\\goldB","\\textcolor{##ffbb71}{#1}"),W("\\goldC","\\textcolor{##ff9c39}{#1}"),W("\\goldD","\\textcolor{##e07d10}{#1}"),W("\\goldE","\\textcolor{##a75a05}{#1}"),W("\\redA","\\textcolor{##fca9a9}{#1}"),W("\\redB","\\textcolor{##ff8482}{#1}"),W("\\redC","\\textcolor{##f9685d}{#1}"),W("\\redD","\\textcolor{##e84d39}{#1}"),W("\\redE","\\textcolor{##bc2612}{#1}"),W("\\maroonA","\\textcolor{##ffbde0}{#1}"),W("\\maroonB","\\textcolor{##ff92c6}{#1}"),W("\\maroonC","\\textcolor{##ed5fa6}{#1}"),W("\\maroonD","\\textcolor{##ca337c}{#1}"),W("\\maroonE","\\textcolor{##9e034e}{#1}"),W("\\purpleA","\\textcolor{##ddd7ff}{#1}"),W("\\purpleB","\\textcolor{##c6b9fc}{#1}"),W("\\purpleC","\\textcolor{##aa87ff}{#1}"),W("\\purpleD","\\textcolor{##7854ab}{#1}"),W("\\purpleE","\\textcolor{##543b78}{#1}"),W("\\mintA","\\textcolor{##f5f9e8}{#1}"),W("\\mintB","\\textcolor{##edf2df}{#1}"),W("\\mintC","\\textcolor{##e0e5cc}{#1}"),W("\\grayA","\\textcolor{##f6f7f7}{#1}"),W("\\grayB","\\textcolor{##f0f1f2}{#1}"),W("\\grayC","\\textcolor{##e3e5e6}{#1}"),W("\\grayD","\\textcolor{##d6d8da}{#1}"),W("\\grayE","\\textcolor{##babec2}{#1}"),W("\\grayF","\\textcolor{##888d93}{#1}"),W("\\grayG","\\textcolor{##626569}{#1}"),W("\\grayH","\\textcolor{##3b3e40}{#1}"),W("\\grayI","\\textcolor{##21242c}{#1}"),W("\\kaBlue","\\textcolor{##314453}{#1}"),W("\\kaGreen","\\textcolor{##71B307}{#1}");var GM={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Sue{constructor(t,n,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(t),this.macros=new vue(Eue,n.macros),this.mode=r,this.stack=[]}feed(t){this.lexer=new BM(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,r,i;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:i,end:r}=this.consumeArg(["]"])}else({tokens:i,start:n,end:r}=this.consumeArg());return this.pushToken(new ji("EOF",r.loc)),this.pushTokens(i),new ji("",Yr.range(n,r))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],r=t&&t.length>0;r||this.consumeSpaces();var i=this.future(),a,o=0,s=0;do{if(a=this.popToken(),n.push(a),a.text==="{")++o;else if(a.text==="}"){if(--o,o===-1)throw new Fe("Extra }",a)}else if(a.text==="EOF")throw new Fe("Unexpected end of input in a macro argument, expected '"+(t&&r?t[s]:"}")+"'",a);if(t&&r)if((o===0||o===1&&t[s]==="{")&&a.text===t[s]){if(++s,s===t.length){n.splice(-s,s);break}}else s=0}while(o!==0||r);return i.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:i,end:a}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new Fe("The length of delimiters doesn't match the number of args!");for(var r=n[0],i=0;i<r.length;i++){var a=this.popToken();if(r[i]!==a.text)throw new Fe("Use of the macro doesn't match its definition",a)}}for(var o=[],s=0;s<t;s++)o.push(this.consumeArg(n&&n[s+1]).tokens);return o}countExpansion(t){if(this.expansionCount+=t,this.expansionCount>this.settings.maxExpand)throw new Fe("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var n=this.popToken(),r=n.text,i=n.noexpand?null:this._getExpansion(r);if(i==null||t&&i.unexpandable){if(t&&i==null&&r[0]==="\\"&&!this.isDefined(r))throw new Fe("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var a=i.tokens,o=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var s=a.length-1;s>=0;--s){var l=a[s];if(l.text==="#"){if(s===0)throw new Fe("Incomplete placeholder at end of macro body",l);if(l=a[--s],l.text==="#")a.splice(s+1,1);else if(/^[1-9]$/.test(l.text))a.splice(s,2,...o[+l.text-1]);else throw new Fe("Not a valid argument number",l)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}throw new Error}expandMacro(t){return this.macros.has(t)?this.expandTokens([new ji(t)]):void 0}expandTokens(t){var n=[],r=this.stack.length;for(this.pushTokens(t);this.stack.length>r;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),n.push(i)}return this.countExpansion(n.length),n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(r=>r.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var r=this.lexer.catcodes[t];if(r!=null&&r!==13)return}var i=typeof n=="function"?n(this):n;if(typeof i=="string"){var a=0;if(i.includes("#"))for(var o=i.replace(/##/g,"");o.includes("#"+(a+1));)++a;for(var s=new BM(i,this.settings),l=[],c=s.lex();c.text!=="EOF";)l.push(c),c=s.lex();l.reverse();var u={tokens:l,numArgs:a};return u}return i}isDefined(t){return this.macros.has(t)||ks.hasOwnProperty(t)||Qt.math.hasOwnProperty(t)||Qt.text.hasOwnProperty(t)||GM.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:ks.hasOwnProperty(t)&&!ks[t].primitive}}var HM=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,ug=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),f2={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},qM={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let WM=class UV{constructor(t,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Sue(t,n,this.mode),this.settings=n,this.leftrightDepth=0}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new Fe("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new ji("}")),this.gullet.pushTokens(t);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(t,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(UV.endOfExpression.has(i.text)||n&&i.text===n||t&&ks[i.text]&&ks[i.text].infix)break;var a=this.parseAtom(n);if(a){if(a.type==="internal")continue}else break;r.push(a)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(t){for(var n=-1,r,i=0;i<t.length;i++)if(t[i].type==="infix"){if(n!==-1)throw new Fe("only one infix operator per group",t[i].token);n=i,r=t[i].replaceWith}if(n!==-1&&r){var a,o,s=t.slice(0,n),l=t.slice(n+1);s.length===1&&s[0].type==="ordgroup"?a=s[0]:a={type:"ordgroup",mode:this.mode,body:s},l.length===1&&l[0].type==="ordgroup"?o=l[0]:o={type:"ordgroup",mode:this.mode,body:l};var c;return r==="\\\\abovefrac"?c=this.callFunction(r,[a,t[n],o],[]):c=this.callFunction(r,[a,o],[]),[c]}else return t}handleSupSubscript(t){var n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();var i;do{var a;i=this.parseGroup(t)}while(((a=i)==null?void 0:a.type)==="internal");if(!i)throw new Fe("Expected group after '"+r+"'",n);return i}formatUnsupportedCmd(t){for(var n=[],r=0;r<t.length;r++)n.push({type:"textord",mode:"text",text:t[r]});var i={type:"text",mode:this.mode,body:n},a={type:"color",mode:this.mode,color:this.settings.errorColor,body:[i]};return a}parseAtom(t){var n=this.parseGroup("atom",t);if((n==null?void 0:n.type)==="internal"||this.mode==="text")return n;for(var r,i;;){this.consumeSpaces();var a=this.fetch();if(a.text==="\\limits"||a.text==="\\nolimits"){if(n&&n.type==="op"){var o=a.text==="\\limits";n.limits=o,n.alwaysHandleSupSub=!0}else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=a.text==="\\limits");else throw new Fe("Limit controls must follow a math operator",a);this.consume()}else if(a.text==="^"){if(r)throw new Fe("Double superscript",a);r=this.handleSupSubscript("superscript")}else if(a.text==="_"){if(i)throw new Fe("Double subscript",a);i=this.handleSupSubscript("subscript")}else if(a.text==="'"){if(r)throw new Fe("Double superscript",a);var s={type:"textord",mode:this.mode,text:"\\prime"},l=[s];for(this.consume();this.fetch().text==="'";)l.push(s),this.consume();this.fetch().text==="^"&&l.push(this.handleSupSubscript("superscript")),r={type:"ordgroup",mode:this.mode,body:l}}else if(ug[a.text]){var c=HM.test(a.text),u=[];for(u.push(new ji(ug[a.text])),this.consume();;){var d=this.fetch().text;if(!ug[d]||HM.test(d)!==c)break;u.unshift(new ji(ug[d])),this.consume()}var p=this.subparse(u);c?i={type:"ordgroup",mode:"math",body:p}:r={type:"ordgroup",mode:"math",body:p}}else break}return r||i?{type:"supsub",mode:this.mode,base:n,sup:r,sub:i}:n}parseFunction(t,n){var r=this.fetch(),i=r.text,a=ks[i];if(!a)return null;if(this.consume(),n&&n!=="atom"&&!a.allowedInArgument)throw new Fe("Got function '"+i+"' with no arguments"+(n?" as "+n:""),r);if(this.mode==="text"&&!a.allowedInText)throw new Fe("Can't use function '"+i+"' in text mode",r);if(this.mode==="math"&&a.allowedInMath===!1)throw new Fe("Can't use function '"+i+"' in math mode",r);var{args:o,optArgs:s}=this.parseArguments(i,a);return this.callFunction(i,o,s,r,t)}callFunction(t,n,r,i,a){var o={funcName:t,parser:this,token:i,breakOnTokenText:a},s=ks[t];if(s&&s.handler)return s.handler(o,n,r);throw new Fe("No function handler for "+t)}parseArguments(t,n){var r=n.numArgs+n.numOptionalArgs;if(r===0)return{args:[],optArgs:[]};for(var i=[],a=[],o=0;o<r;o++){var s=n.argTypes&&n.argTypes[o],l=o<n.numOptionalArgs;(n.primitive&&s==null||n.type==="sqrt"&&o===1&&a[0]==null)&&(s="primitive");var c=this.parseGroupOfType("argument to '"+t+"'",s,l);if(l)a.push(c);else if(c!=null)i.push(c);else throw new Fe("Null argument, please report this as a bug")}return{args:i,optArgs:a}}parseGroupOfType(t,n,r){switch(n){case"color":return this.parseColorGroup(r);case"size":return this.parseSizeGroup(r);case"url":return this.parseUrlGroup(r);case"math":case"text":return this.parseArgumentGroup(r,n);case"hbox":{var i=this.parseArgumentGroup(r,"text");return i!=null?{type:"styling",mode:i.mode,body:[i],style:"text"}:null}case"raw":{var a=this.parseStringGroup("raw",r);return a!=null?{type:"raw",mode:"text",string:a.text}:null}case"primitive":{if(r)throw new Fe("A primitive argument cannot be optional");var o=this.parseGroup(t);if(o==null)throw new Fe("Expected group as "+t,this.fetch());return o}case"original":case null:case void 0:return this.parseArgumentGroup(r);default:throw new Fe("Unknown group type as "+t,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(t,n){var r=this.gullet.scanArgument(n);if(r==null)return null;for(var i="",a;(a=this.fetch()).text!=="EOF";)i+=a.text,this.consume();return this.consume(),r.text=i,r}parseRegexGroup(t,n){for(var r=this.fetch(),i=r,a="",o;(o=this.fetch()).text!=="EOF"&&t.test(a+o.text);)i=o,a+=i.text,this.consume();if(a==="")throw new Fe("Invalid "+n+": '"+r.text+"'",r);return r.range(i,a)}parseColorGroup(t){var n=this.parseStringGroup("color",t);if(n==null)return null;var r=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!r)throw new Fe("Invalid color: '"+n.text+"'",n);var i=r[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}}parseSizeGroup(t){var n,r=!1;if(this.gullet.consumeSpaces(),!t&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup("size",t),!n)return null;!t&&n.text.length===0&&(n.text="0pt",r=!0);var i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!i)throw new Fe("Invalid size: '"+n.text+"'",n);var a={number:+(i[1]+i[2]),unit:i[3]};if(!SO(a))throw new Fe("Invalid unit: '"+a.unit+"'",n);return{type:"size",mode:this.mode,value:a,isBlank:r}}parseUrlGroup(t){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var n=this.parseStringGroup("url",t);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;var r=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:r}}parseArgumentGroup(t,n){var r=this.gullet.scanArgument(t);if(r==null)return null;var i=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();var a=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var o={type:"ordgroup",mode:this.mode,loc:r.loc,body:a};return n&&this.switchMode(i),o}parseGroup(t,n){var r=this.fetch(),i=r.text,a;if(i==="{"||i==="\\begingroup"){this.consume();var o=i==="{"?"}":"\\endgroup";this.gullet.beginGroup();var s=this.parseExpression(!1,o),l=this.fetch();this.expect(o),this.gullet.endGroup(),a={type:"ordgroup",mode:this.mode,loc:Yr.range(r,l),body:s,semisimple:i==="\\begingroup"||void 0}}else if(a=this.parseFunction(n,t)||this.parseSymbol(),a==null&&i[0]==="\\"&&!GM.hasOwnProperty(i)){if(this.settings.throwOnError)throw new Fe("Undefined control sequence: "+i,r);a=this.formatUnsupportedCmd(i),this.consume()}return a}formLigatures(t){for(var n=t.length-1,r=0;r<n;++r){var i=t[r],a=i.text;a==="-"&&t[r+1].text==="-"&&(r+1<n&&t[r+2].text==="-"?(t.splice(r,3,{type:"textord",mode:"text",loc:Yr.range(i,t[r+2]),text:"---"}),n-=2):(t.splice(r,2,{type:"textord",mode:"text",loc:Yr.range(i,t[r+1]),text:"--"}),n-=1)),(a==="'"||a==="`")&&t[r+1].text===a&&(t.splice(r,2,{type:"textord",mode:"text",loc:Yr.range(i,t[r+1]),text:a+a}),n-=1)}}parseSymbol(){var t=this.fetch(),n=t.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var r=n.slice(5),i=r.charAt(0)==="*";if(i&&(r=r.slice(1)),r.length<2||r.charAt(0)!==r.slice(-1))throw new Fe(`\\verb assertion failed --
402
- please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:i}}qM.hasOwnProperty(n[0])&&!Qt[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',t),n=qM[n[0]]+n.slice(1));var a=bue.exec(n);a&&(n=n.substring(0,a.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var o;if(Qt[this.mode][n]){this.settings.strict&&this.mode==="math"&&Bx.includes(n)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',t);var s=Qt[this.mode][n].group,l=Yr.range(t),c;if(yce.hasOwnProperty(s)){var u=s;c={type:"atom",mode:this.mode,family:u,loc:l,text:n}}else c={type:s,mode:this.mode,loc:l,text:n};o=c}else if(n.charCodeAt(0)>=128)this.settings.strict&&(bO(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),o={type:"textord",mode:"text",loc:Yr.range(t),text:n};else return null;if(this.consume(),a)for(var d=0;d<a[0].length;d++){var p=a[0][d];if(!f2[p])throw new Fe("Unknown accent ' "+p+"'",t);var h=f2[p][this.mode]||f2[p].text;if(!h)throw new Fe("Accent "+p+" unsupported in "+this.mode+" mode",t);o={type:"accent",mode:this.mode,loc:Yr.range(t),label:h,isStretchy:!1,isShifty:!0,base:o}}return o}};WM.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var g2=function(t,n){if(!(typeof t=="string"||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new WM(t,n);delete r.gullet.macros.current["\\df@tag"];var i=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new Fe("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:r.subparse([new ji("\\df@tag")])}]}return i},VM=function(t,n,r){n.textContent="";var i=_2(t,r).toNode();n.appendChild(i)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),VM=function(){throw new Fe("KaTeX doesn't work in quirks mode.")});var Tue=function(t,n){var r=_2(t,n).toMarkup();return r},Cue=function(t,n){var r=new wx(n);return g2(t,r)},YM=function(t,n,r){if(r.throwOnError||!(t instanceof Fe))throw t;var i=Ie(["katex-error"],[new Ci(n)]);return i.setAttribute("title",t.toString()),i.setAttribute("style","color:"+r.errorColor),i},_2=function(t,n){var r=new wx(n);try{var i=g2(t,r);return Lce(i,t,r)}catch(a){return YM(a,t,r)}},wue=function(t,n){var r=new wx(n);try{var i=g2(t,r);return Pce(i,t,r)}catch(a){return YM(a,t,r)}},Due="0.16.33",Aue={Span:Kp,Anchor:Mx,SymbolNode:Ci,SvgNode:po,PathNode:Cs,LineNode:Ix},Jp={version:Due,render:VM,renderToString:Tue,ParseError:Fe,SETTINGS_SCHEMA:z0,__parse:Cue,__renderToDomTree:_2,__renderToHTMLTree:wue,__setFontMetrics:dce,__defineSymbol:C,__defineFunction:We,__defineMacro:W,__domTree:Aue};function KM(){return window.mathVirtualKeyboard}const Ct=()=>g.jsx("span",{className:"mt-ph"}),Ve=()=>g.jsx("span",{className:"mt-ph mt-ph--sm"}),ht=({t:e})=>g.jsx("span",{className:"mt-txt-icon",children:e}),b2=[{id:"frac",icon:"√▫·▫",tip:"Pecahan & Akar",rows:[[{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx(Ct,{})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx(Ct,{})})]}),latex:"\\frac{#?}{#?}",tip:"Pecahan"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx(Ct,{}),g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx(Ve,{})})]})]}),latex:"#?\\frac{#?}{#?}",tip:"Pecahan campuran"},{icon:g.jsxs("span",{className:"mt-icon-stack mt-icon-stack--lg",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx(Ct,{})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx(Ct,{})})]}),latex:"\\dfrac{#?}{#?}",tip:"Pecahan besar (display)"},{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx(Ct,{})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsxs("span",{className:"mt-icon-stack mt-icon-stack--sm",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx(Ve,{})})]})})]}),latex:"\\cfrac{#?}{\\cfrac{#?}{#?}}",tip:"Pecahan kontinu"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-icon-sqrt",children:"√"}),g.jsx("span",{className:"mt-icon-sqrt-bar",children:g.jsx(Ct,{})})]}),latex:"\\sqrt{#?}",tip:"Akar kuadrat"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("sup",{className:"mt-icon-idx",children:"3"}),g.jsx("span",{className:"mt-icon-sqrt",children:"√"}),g.jsx("span",{className:"mt-icon-sqrt-bar",children:g.jsx(Ct,{})})]}),latex:"\\sqrt[3]{#?}",tip:"Akar pangkat 3"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("sup",{className:"mt-icon-idx",children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-icon-sqrt",children:"√"}),g.jsx("span",{className:"mt-icon-sqrt-bar",children:g.jsx(Ct,{})})]}),latex:"\\sqrt[#?]{#?}",tip:"Akar pangkat n"}],[{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("sup",{children:g.jsx(Ve,{})})]}),latex:"#?^{#?}",tip:"Pangkat / Superscript"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("sub",{children:g.jsx(Ve,{})})]}),latex:"#?_{#?}",tip:"Subskrip"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("sub",{children:g.jsx(Ve,{})}),g.jsx("sup",{children:g.jsx(Ve,{})})]}),latex:"#?_{#?}^{#?}",tip:"Pangkat + subskrip"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("sup",{children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-sym",children:"log"})]}),latex:"{}^{#?}\\log(#?)",tip:"Logaritma basis a (Indo)"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"log"}),g.jsx("sub",{children:g.jsx(Ve,{})})]}),latex:"\\log_{#?}(#?)",tip:"Logaritma basis a (Intl)"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("sup",{children:"-1"})]}),latex:"#?^{-1}",tip:"Invers"},{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx(Ve,{})})]}),latex:"\\tfrac{#?}{#?}",tip:"Pecahan kecil (text)"}],[{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:"n"}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:"k"})]}),latex:"\\binom{#?}{#?}",tip:"Kombinasi (n choose k)"},{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:"1"}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx(Ct,{})})]}),latex:"\\frac{1}{#?}",tip:"Pecahan Unit"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-icon-sqrt",children:"√"}),g.jsx("span",{className:"mt-icon-sqrt-bar",children:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx(Ve,{})})]})})]}),latex:"\\sqrt{\\frac{#?}{#?}}",tip:"Akar dari pecahan"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx(Ct,{}),g.jsx("span",{className:"mt-icon-sqrt",children:"√"}),g.jsx("span",{className:"mt-icon-sqrt-bar",children:g.jsx(Ct,{})})]}),latex:"#?\\sqrt{#?}",tip:"Akar dengan koefisien"}],[{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("sup",{children:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:"1"}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:"2"})]})})]}),latex:"#?^{\\frac{1}{2}}",tip:"Pangkat 1/2 (√)"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("sup",{children:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:"1"}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:"3"})]})})]}),latex:"#?^{\\frac{1}{3}}",tip:"Pangkat 1/3 (³√)"},{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:"1"}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-icon-sqrt",children:"√"}),g.jsx("span",{className:"mt-icon-sqrt-bar",children:g.jsx(Ct,{})})]})})]}),latex:"\\frac{1}{\\sqrt{#?}}",tip:"Akar di penyebut"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-icon-sqrt",children:"√"}),g.jsx("span",{className:"mt-icon-sqrt-bar",children:g.jsx(Ct,{})}),g.jsx("span",{className:"mt-sym",children:"±"}),g.jsx("span",{className:"mt-icon-sqrt",children:"√"}),g.jsx("span",{className:"mt-icon-sqrt-bar",children:g.jsx(Ct,{})})]}),latex:"\\sqrt{#?} \\pm \\sqrt{#?}",tip:"Operasi akar"}],[{icon:g.jsx(ht,{t:"Rumus ABC"}),latex:"x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}",tip:"Rumus Kuadrat (ABC)",command:"formula"},{icon:g.jsx(ht,{t:"Pythagoras"}),latex:"a^2 + b^2 = c^2",tip:"Teorema Pythagoras",command:"formula"},{icon:g.jsx(ht,{t:"Diskriminan"}),latex:"D = b^2 - 4ac",tip:"Diskriminan",command:"formula"},{icon:g.jsx(ht,{t:"(a+b)²"}),latex:"(a+b)^2 = a^2 + 2ab + b^2",tip:"Kuadrat Sempurna",command:"formula"},{icon:g.jsx(ht,{t:"a²-b²"}),latex:"a^2 - b^2 = (a+b)(a-b)",tip:"Selisih Kuadrat",command:"formula"}]]},{id:"const",icon:"€ ∞",tip:"Konstanta & Spasi",rows:[[{icon:g.jsx("span",{className:"mt-sym-lg",children:"∞"}),latex:"\\infty",tip:"Tak hingga"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"π"}),latex:"\\pi",tip:"Pi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"e"}),latex:"e",tip:"Euler number"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"i"}),latex:"i",tip:"Unit imajiner"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"°"}),latex:"^{\\circ}",tip:"Derajat"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"%"}),latex:"\\%",tip:"Persen"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ℏ"}),latex:"\\hbar",tip:"H-bar (Planck)"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∂"}),latex:"\\partial",tip:"Parsial"}],[{icon:g.jsx("span",{className:"mt-sym-lg",children:"ℝ"}),latex:"\\mathbb{R}",tip:"Bilangan real"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ℕ"}),latex:"\\mathbb{N}",tip:"Bilangan asli"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ℤ"}),latex:"\\mathbb{Z}",tip:"Bilangan bulat"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ℚ"}),latex:"\\mathbb{Q}",tip:"Bilangan rasional"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ℂ"}),latex:"\\mathbb{C}",tip:"Bilangan kompleks"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∇"}),latex:"\\nabla",tip:"Nabla"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ℓ"}),latex:"\\ell",tip:"Script ℓ"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"‰"}),latex:"\\permil",tip:"Per mil"}],[{icon:g.jsx(ht,{t:"E=mc²"}),latex:"E = mc^2",tip:"Relativitas (Einstein)"},{icon:g.jsx(ht,{t:"F=ma"}),latex:"F = m a",tip:"Hukum Newton II"},{icon:g.jsx(ht,{t:"Induksi"}),latex:"B = \\frac{\\mu_0 I}{2\\pi r}",tip:"Medan Magnet"}]]},{id:"arrow",icon:"→ ·",tip:"Panah",rows:[[{icon:g.jsx("span",{className:"mt-sym-lg",children:"→"}),latex:"\\rightarrow",tip:"Panah kanan"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"←"}),latex:"\\leftarrow",tip:"Panah kiri"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"↑"}),latex:"\\uparrow",tip:"Panah atas"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"↓"}),latex:"\\downarrow",tip:"Panah bawah"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"↔"}),latex:"\\leftrightarrow",tip:"Panah dua arah"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⇒"}),latex:"\\Rightarrow",tip:"Implikasi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⇐"}),latex:"\\Leftarrow",tip:"Implikasi kiri"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⇔"}),latex:"\\Leftrightarrow",tip:"Bi-implikasi"}],[{icon:g.jsx("span",{className:"mt-sym-lg",children:"↦"}),latex:"\\mapsto",tip:"Maps to"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⟶"}),latex:"\\longrightarrow",tip:"Panah panjang"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⟵"}),latex:"\\longleftarrow",tip:"Panah panjang kiri"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⟹"}),latex:"\\Longrightarrow",tip:"Implikasi panjang"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⟺"}),latex:"\\Longleftrightarrow",tip:"Bi-implikasi panjang"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"↗"}),latex:"\\nearrow",tip:"Kanan atas"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"↘"}),latex:"\\searrow",tip:"Kanan bawah"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"↙"}),latex:"\\swarrow",tip:"Kiri bawah"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"↖"}),latex:"\\nwarrow",tip:"Kiri atas"}],[{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{style:{fontSize:"8px",marginBottom:-2},children:"□"}),g.jsx("span",{className:"mt-sym-lg",style:{lineHeight:.8},children:"→"})]}),latex:"\\xrightarrow{#?}",tip:"Panah Kanan (Atas)"},{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{style:{fontSize:"8px",marginBottom:-2},children:"□"}),g.jsx("span",{className:"mt-sym-lg",style:{lineHeight:.8},children:"←"})]}),latex:"\\xleftarrow{#?}",tip:"Panah Kiri (Atas)"},{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{style:{fontSize:"8px",marginBottom:-2},children:"□"}),g.jsx("span",{className:"mt-sym-lg",style:{lineHeight:.8},children:"→"}),g.jsx("span",{style:{fontSize:"8px",marginTop:-2},children:"□"})]}),latex:"\\xrightarrow[#?]{#?}",tip:"Panah Kanan (Atas+Bawah)"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⇀"}),latex:"\\rightharpoonup",tip:"Harpoon kanan"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⇁"}),latex:"\\rightharpoondown",tip:"Harpoon kanan bawah"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"↼"}),latex:"\\leftharpoonup",tip:"Harpoon kiri"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"↽"}),latex:"\\leftharpoondown",tip:"Harpoon kiri bawah"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⇌"}),latex:"\\rightleftharpoons",tip:"Kesetimbangan"}],[{icon:g.jsx(ht,{t:"f: A→B"}),latex:"f: A \\to B",tip:"Definisi Fungsi"},{icon:g.jsx(ht,{t:"x ↦ y"}),latex:"x \\mapsto f(x)",tip:"Pemetaan"},{icon:g.jsx(ht,{t:"v = u + at"}),latex:"v = u + at",tip:"GLBB 1"}]]},{id:"greek",icon:"α Ω",tip:"Huruf Yunani",rows:[[{icon:g.jsx("span",{className:"mt-sym-lg",children:"α"}),latex:"\\alpha",tip:"Alpha"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"β"}),latex:"\\beta",tip:"Beta"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"γ"}),latex:"\\gamma",tip:"Gamma"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"δ"}),latex:"\\delta",tip:"Delta"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ε"}),latex:"\\epsilon",tip:"Epsilon"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ζ"}),latex:"\\zeta",tip:"Zeta"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"η"}),latex:"\\eta",tip:"Eta"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"θ"}),latex:"\\theta",tip:"Theta"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ι"}),latex:"\\iota",tip:"Iota"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"κ"}),latex:"\\kappa",tip:"Kappa"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"λ"}),latex:"\\lambda",tip:"Lambda"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"μ"}),latex:"\\mu",tip:"Mu"}],[{icon:g.jsx("span",{className:"mt-sym-lg",children:"ν"}),latex:"\\nu",tip:"Nu"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ξ"}),latex:"\\xi",tip:"Xi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"π"}),latex:"\\pi",tip:"Pi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ρ"}),latex:"\\rho",tip:"Rho"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"σ"}),latex:"\\sigma",tip:"Sigma"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"τ"}),latex:"\\tau",tip:"Tau"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"φ"}),latex:"\\phi",tip:"Phi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"χ"}),latex:"\\chi",tip:"Chi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ψ"}),latex:"\\psi",tip:"Psi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ω"}),latex:"\\omega",tip:"Omega"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ϑ"}),latex:"\\vartheta",tip:"Vartheta"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ϕ"}),latex:"\\varphi",tip:"Varphi"}],[{icon:g.jsx("span",{className:"mt-sym-lg",children:"Γ"}),latex:"\\Gamma",tip:"Gamma besar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"Δ"}),latex:"\\Delta",tip:"Delta besar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"Θ"}),latex:"\\Theta",tip:"Theta besar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"Λ"}),latex:"\\Lambda",tip:"Lambda besar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"Ξ"}),latex:"\\Xi",tip:"Xi besar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"Π"}),latex:"\\Pi",tip:"Pi besar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"Σ"}),latex:"\\Sigma",tip:"Sigma besar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"Υ"}),latex:"\\Upsilon",tip:"Upsilon besar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"Φ"}),latex:"\\Phi",tip:"Phi besar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"Ψ"}),latex:"\\Psi",tip:"Psi besar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"Ω"}),latex:"\\Omega",tip:"Omega besar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"υ"}),latex:"\\upsilon",tip:"Upsilon"}],[{icon:g.jsx(ht,{t:"Area O"}),latex:"A = \\pi r^2",tip:"Luas Lingkaran"},{icon:g.jsx(ht,{t:"2πr"}),latex:"K = 2 \\pi r",tip:"Keliling Lingkaran"},{icon:g.jsx(ht,{t:"Vol Bola"}),latex:"V = \\frac{4}{3} \\pi r^3",tip:"Volume Bola"}]]},{id:"matrix",icon:"[▫▫]",tip:"Matriks",rows:[[{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak",children:"("}),g.jsxs("span",{className:"mt-icon-grid",children:[g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]}),g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]})]}),g.jsx("span",{className:"mt-brak",children:")"})]}),latex:"\\begin{pmatrix} #? & #? \\\\ #? & #? \\end{pmatrix}",tip:"Matriks 2×2"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak",children:"("}),g.jsxs("span",{className:"mt-icon-grid",children:[g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{}),g.jsx(Ve,{})]}),g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{}),g.jsx(Ve,{})]}),g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{}),g.jsx(Ve,{})]})]}),g.jsx("span",{className:"mt-brak",children:")"})]}),latex:"\\begin{pmatrix} #? & #? & #? \\\\ #? & #? & #? \\\\ #? & #? & #? \\end{pmatrix}",tip:"Matriks 3×3"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak",children:"["}),g.jsxs("span",{className:"mt-icon-grid",children:[g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]}),g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]})]}),g.jsx("span",{className:"mt-brak",children:"]"})]}),latex:"\\begin{bmatrix} #? & #? \\\\ #? & #? \\end{bmatrix}",tip:"Bracket matrix 2×2"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak",children:"["}),g.jsxs("span",{className:"mt-icon-grid",children:[g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{}),g.jsx(Ve,{})]}),g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{}),g.jsx(Ve,{})]}),g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{}),g.jsx(Ve,{})]})]}),g.jsx("span",{className:"mt-brak",children:"]"})]}),latex:"\\begin{bmatrix} #? & #? & #? \\\\ #? & #? & #? \\\\ #? & #? & #? \\end{bmatrix}",tip:"Bracket matrix 3×3"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak",children:"|"}),g.jsxs("span",{className:"mt-icon-grid",children:[g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]}),g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]})]}),g.jsx("span",{className:"mt-brak",children:"|"})]}),latex:"\\begin{vmatrix} #? & #? \\\\ #? & #? \\end{vmatrix}",tip:"Determinan 2×2"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak",children:"‖"}),g.jsxs("span",{className:"mt-icon-grid",children:[g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]}),g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]})]}),g.jsx("span",{className:"mt-brak",children:"‖"})]}),latex:"\\begin{Vmatrix} #? & #? \\\\ #? & #? \\end{Vmatrix}",tip:"Norm matrix 2×2"}],[{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak",children:"("}),g.jsxs("span",{className:"mt-icon-grid",children:[g.jsx("span",{className:"mt-icon-grid-row",children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-icon-grid-row",children:g.jsx(Ve,{})})]}),g.jsx("span",{className:"mt-brak",children:")"})]}),latex:"\\begin{pmatrix} #? \\\\ #? \\end{pmatrix}",tip:"Vektor kolom 2"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak",children:"("}),g.jsxs("span",{className:"mt-icon-grid",children:[g.jsx("span",{className:"mt-icon-grid-row",children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-icon-grid-row",children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-icon-grid-row",children:g.jsx(Ve,{})})]}),g.jsx("span",{className:"mt-brak",children:")"})]}),latex:"\\begin{pmatrix} #? \\\\ #? \\\\ #? \\end{pmatrix}",tip:"Vektor kolom 3"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak",children:"("}),g.jsx("span",{className:"mt-icon-grid",children:g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]})}),g.jsx("span",{className:"mt-brak",children:")"})]}),latex:"\\begin{pmatrix} #? & #? \\end{pmatrix}",tip:"Vektor baris 2"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak",children:"{"}),g.jsxs("span",{className:"mt-icon-grid",children:[g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]}),g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]})]})]}),latex:"\\begin{cases} #? & #? \\\\ #? & #? \\end{cases}",tip:"Kasus (2 baris)"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak",children:"{"}),g.jsxs("span",{className:"mt-icon-grid",children:[g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]}),g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]}),g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]})]})]}),latex:"\\begin{cases} #? & #? \\\\ #? & #? \\\\ #? & #? \\end{cases}",tip:"Kasus (3 baris)"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⋯ ⋮ ⋱"}),latex:"\\cdots \\quad \\vdots \\quad \\ddots",tip:"Dots (titik-titik)"}],[{icon:g.jsx("span",{className:"mt-txt-icon",children:"+R"}),command:"addRowAfter",tip:"Tambah Baris (Bawah)"},{icon:g.jsx("span",{className:"mt-txt-icon",children:"+C"}),command:"addColumnAfter",tip:"Tambah Kolom (Kanan)"},{icon:g.jsx("span",{className:"mt-txt-icon",children:"-R"}),command:"removeRow",tip:"Hapus Baris"},{icon:g.jsx("span",{className:"mt-txt-icon",children:"-C"}),command:"removeColumn",tip:"Hapus Kolom"}],[{icon:g.jsx(ht,{t:"Identitas"}),latex:"I = \\begin{pmatrix} 1 & 0 \\\\ 0 & 1 \\end{pmatrix}",tip:"Matriks Identitas 2x2"},{icon:g.jsx(ht,{t:"Determinan"}),latex:"\\det(A) = ad - bc",tip:"Determinan 2x2"}],[{icon:g.jsx(ht,{t:"Aligned"}),latex:"\\begin{aligned} #? &= #? \\\\ &= #? \\end{aligned}",tip:"Persamaan rata (aligned)"},{icon:g.jsx(ht,{t:"Gathered"}),latex:"\\begin{gathered} #? \\\\ #? \\end{gathered}",tip:"Persamaan terpusat (gathered)"},{icon:g.jsx(ht,{t:"Split"}),latex:"\\begin{split} #? &= #? \\\\ &= #? \\end{split}",tip:"Persamaan split"}]]},{id:"bracket",icon:"(▫) {▫}",tip:"Tanda Kurung",rows:[[{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"("}),g.jsx(Ct,{}),g.jsx("span",{className:"mt-brak mt-brak--lg",children:")"})]}),latex:"\\left( #? \\right)",tip:"Kurung biasa"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"["}),g.jsx(Ct,{}),g.jsx("span",{className:"mt-brak mt-brak--lg",children:"]"})]}),latex:"\\left[ #? \\right]",tip:"Kurung siku"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"{"}),g.jsx(Ct,{}),g.jsx("span",{className:"mt-brak mt-brak--lg",children:"}"})]}),latex:"\\left\\{ #? \\right\\}",tip:"Kurung kurawal"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"|"}),g.jsx(Ct,{}),g.jsx("span",{className:"mt-brak mt-brak--lg",children:"|"})]}),latex:"\\left| #? \\right|",tip:"Nilai mutlak"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"‖"}),g.jsx(Ct,{}),g.jsx("span",{className:"mt-brak mt-brak--lg",children:"‖"})]}),latex:"\\left\\| #? \\right\\|",tip:"Norm"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"⟨"}),g.jsx(Ct,{}),g.jsx("span",{className:"mt-brak mt-brak--lg",children:"⟩"})]}),latex:"\\langle #? \\rangle",tip:"Kurung sudut"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"⌊"}),g.jsx(Ct,{}),g.jsx("span",{className:"mt-brak mt-brak--lg",children:"⌋"})]}),latex:"\\lfloor #? \\rfloor",tip:"Floor"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"⌈"}),g.jsx(Ct,{}),g.jsx("span",{className:"mt-brak mt-brak--lg",children:"⌉"})]}),latex:"\\lceil #? \\rceil",tip:"Ceiling"}],[{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"("}),g.jsx(Ct,{}),g.jsx("span",{className:"mt-brak mt-brak--lg",children:"]"})]}),latex:"\\left( #? \\right]",tip:"Setengah terbuka kiri"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"["}),g.jsx(Ct,{}),g.jsx("span",{className:"mt-brak mt-brak--lg",children:")"})]}),latex:"\\left[ #? \\right)",tip:"Setengah terbuka kanan"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"("}),g.jsx(Ct,{})]}),latex:"\\left( #? \\right.",tip:"Kurung kiri saja"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx(Ct,{}),g.jsx("span",{className:"mt-brak mt-brak--lg",children:")"})]}),latex:"\\left. #? \\right)",tip:"Kurung kanan saja"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"{"}),g.jsx(Ct,{})]}),latex:"\\left\\{ #? \\right.",tip:"Kurawal kiri saja"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"‾"})]}),latex:"\\bar{#?}",tip:"Bar (rata-rata)"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"^"})]}),latex:"\\hat{#?}",tip:"Hat"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"→"})]}),latex:"\\vec{#?}",tip:"Vektor"}],[{icon:g.jsx(ht,{t:"{ x | ... }"}),latex:"\\{ x \\in \\mathbb{R} \\mid x > 0 \\}",tip:"Notasi Pembentuk Himpunan"},{icon:g.jsx(ht,{t:"[ a, b ]"}),latex:"[ a, b ] = \\{ x \\mid a \\le x \\le b \\}",tip:"Interval Tertutup"},{icon:g.jsx(ht,{t:"Binomial"}),latex:"\\binom{n}{k}",tip:"Koefisien Binomial"},{icon:g.jsx(ht,{t:"Bra-ket"}),latex:"\\bra{#?}\\ket{#?}",tip:"Bra-ket (Dirac)"},{icon:g.jsx(ht,{t:"Braket"}),latex:"\\braket{#?}{#?}",tip:"Braket (inner)"}]]},{id:"deco",icon:"x̄ x⃗",tip:"Aksen & Dekorasi",rows:[[{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"‾"})]}),latex:"\\bar{#?}",tip:"Bar"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"^"})]}),latex:"\\hat{#?}",tip:"Hat"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"→"})]}),latex:"\\vec{#?}",tip:"Vektor"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"~"})]}),latex:"\\tilde{#?}",tip:"Tilde"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"·"})]}),latex:"\\dot{#?}",tip:"Dot"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"··"})]}),latex:"\\ddot{#?}",tip:"Double dot"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"↔"})]}),latex:"\\overleftrightarrow{#?}",tip:"Panah dua arah di atas"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-under",children:"_"})]}),latex:"\\underline{#?}",tip:"Underline"}],[{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:g.jsx(Ct,{})}),g.jsx("span",{className:"mt-over",children:"‾‾"})]}),latex:"\\overline{#?}",tip:"Overline"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"˘"})]}),latex:"\\breve{#?}",tip:"Breve"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"ˇ"})]}),latex:"\\check{#?}",tip:"Check"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:g.jsx(Ct,{})}),g.jsx("span",{className:"mt-over",children:"→"})]}),latex:"\\overrightarrow{#?}",tip:"Panah kanan di atas"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:g.jsx(Ct,{})}),g.jsx("span",{className:"mt-over",children:"⌢"})]}),latex:"\\widehat{#?}",tip:"Wide hat"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:g.jsx(Ct,{})}),g.jsx("span",{className:"mt-over",children:"~"})]}),latex:"\\widetilde{#?}",tip:"Wide tilde"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-over",children:"⏞"}),g.jsx("span",{className:"mt-sym",children:g.jsx(Ct,{})})]}),latex:"\\overbrace{#?}",tip:"Overbrace"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:g.jsx(Ct,{})}),g.jsx("span",{className:"mt-under",children:"⏟"})]}),latex:"\\underbrace{#?}",tip:"Underbrace"}],[{icon:g.jsx(ht,{t:"Vektor Sum"}),latex:"\\vec{a} + \\vec{b} = \\vec{c}",tip:"Penjumlahan Vektor"},{icon:g.jsx(ht,{t:"Rata-rata"}),latex:"\\bar{x} = \\frac{1}{n} \\sum_{i=1}^n x_i",tip:"Rata-rata (Mean)"},{icon:g.jsx(ht,{t:"Estimasi"}),latex:"\\hat{y} = b_0 + b_1 x",tip:"Estimasi Regresi"}]]},{id:"sum",icon:"Σ ∪",tip:"Sigma, Produk, Himpunan",rows:[[{icon:g.jsx("span",{className:"mt-sym-xl",children:"Σ"}),latex:"\\sum #?",tip:"Sigma"},{icon:g.jsx("span",{className:"mt-icon-row",children:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("sup",{className:"mt-icon-idx",children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-sym-xl",children:"Σ"}),g.jsx("sub",{className:"mt-icon-idx",children:g.jsx(Ve,{})})]})}),latex:"\\sum_{#?}^{#?} #?",tip:"Sigma (batas)"},{icon:g.jsx("span",{className:"mt-sym-xl",children:"∏"}),latex:"\\prod #?",tip:"Produk"},{icon:g.jsx("span",{className:"mt-icon-row",children:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("sup",{className:"mt-icon-idx",children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-sym-xl",children:"∏"}),g.jsx("sub",{className:"mt-icon-idx",children:g.jsx(Ve,{})})]})}),latex:"\\prod_{#?}^{#?} #?",tip:"Produk (batas)"},{icon:g.jsx("span",{className:"mt-sym-xl",children:"∐"}),latex:"\\coprod_{#?}^{#?} #?",tip:"Koproduk"},{icon:g.jsx("span",{className:"mt-sym-xl",children:"⋂"}),latex:"\\bigcap_{#?}^{#?} #?",tip:"Irisan besar"}],[{icon:g.jsx("span",{className:"mt-sym-xl",children:"⋃"}),latex:"\\bigcup_{#?}^{#?} #?",tip:"Gabungan besar"},{icon:g.jsx("span",{className:"mt-sym-xl",children:"⋁"}),latex:"\\bigvee_{#?}^{#?} #?",tip:"Or besar"},{icon:g.jsx("span",{className:"mt-sym-xl",children:"⋀"}),latex:"\\bigwedge_{#?}^{#?} #?",tip:"And besar"},{icon:g.jsx("span",{className:"mt-sym-xl",children:"⨁"}),latex:"\\bigoplus_{#?}^{#?} #?",tip:"Plus langsung"},{icon:g.jsx("span",{className:"mt-sym-xl",children:"⨂"}),latex:"\\bigotimes_{#?}^{#?} #?",tip:"Tensor besar"},{icon:g.jsx("span",{className:"mt-sym-xl",children:"⨆"}),latex:"\\bigsqcup_{#?}^{#?} #?",tip:"Union persegi besar"}],[{icon:g.jsx(ht,{t:"Deret Ari"}),latex:"S_n = \\frac{n}{2}(a + U_n)",tip:"Deret Aritmatika"},{icon:g.jsx(ht,{t:"Deret Geo"}),latex:"S_\\infty = \\frac{a}{1-r}",tip:"Deret Geometri Tak Hingga"},{icon:g.jsx(ht,{t:"Sigma n"}),latex:"\\sum_{i=1}^n i = \\frac{n(n+1)}{2}",tip:"Jumlah n bilangan asli"}]]},{id:"calc",icon:"∫ lim",tip:"Integral & Kalkulus",rows:[[{icon:g.jsx("span",{className:"mt-sym-xl",children:"∫"}),latex:"\\int #?\\, d#?",tip:"Integral"},{icon:g.jsx("span",{className:"mt-icon-row",children:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("sup",{className:"mt-icon-idx",children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-sym-xl",children:"∫"}),g.jsx("sub",{className:"mt-icon-idx",children:g.jsx(Ve,{})})]})}),latex:"\\int_{#?}^{#?} #?\\, d#?",tip:"Integral tentu"},{icon:g.jsx("span",{className:"mt-sym-xl",children:"∬"}),latex:"\\iint_{#?} #?\\, dA",tip:"Integral ganda"},{icon:g.jsx("span",{className:"mt-sym-xl",children:"∭"}),latex:"\\iiint_{#?} #?\\, dV",tip:"Integral triple"},{icon:g.jsx("span",{className:"mt-sym-xl",children:"∮"}),latex:"\\oint_{#?} #?",tip:"Integral kontur"},{icon:g.jsx("span",{className:"mt-sym-fn",children:"lim"}),latex:"\\lim_{#? \\to #?} #?",tip:"Limit"}],[{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx("span",{className:"mt-sym-sm",children:"d"})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx("span",{className:"mt-sym-sm",children:"dx"})})]}),latex:"\\frac{d}{dx}",tip:"Turunan"},{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx("span",{className:"mt-sym-sm",children:"d²"})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx("span",{className:"mt-sym-sm",children:"dx²"})})]}),latex:"\\frac{d^2}{dx^2}",tip:"Turunan kedua"},{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx("span",{className:"mt-sym-sm",children:"∂"})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx("span",{className:"mt-sym-sm",children:"∂x"})})]}),latex:"\\frac{\\partial}{\\partial x}",tip:"Turunan parsial"},{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx("span",{className:"mt-sym-sm",children:"∂²"})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx("span",{className:"mt-sym-sm",children:"∂x²"})})]}),latex:"\\frac{\\partial^2}{\\partial x^2}",tip:"Turunan parsial kedua"},{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx("span",{className:"mt-sym-sm",children:"dy"})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx("span",{className:"mt-sym-sm",children:"dx"})})]}),latex:"\\frac{dy}{dx}",tip:"dy/dx"},{icon:g.jsxs("span",{className:"mt-sym-fn",children:["f'(",g.jsx(Ct,{}),")"]}),latex:"f'(#?)",tip:"f prime"}],[{icon:g.jsx(ht,{t:"Int Tentu"}),latex:"\\int_a^b f(x) \\, dx",tip:"Integral Tentu"},{icon:g.jsx(ht,{t:"Limit Inf"}),latex:"\\lim_{x \\to \\infty} f(x)",tip:"Limit Tak Hingga"},{icon:g.jsx(ht,{t:"Turunan"}),latex:"\\frac{df}{dx} = \\lim_{h \\to 0} \\frac{f(x+h)-f(x)}{h}",tip:"Definisi Turunan"}]]},{id:"oper",icon:"= ≠ ≤",tip:"Operator & Relasi",rows:[[{icon:g.jsx("span",{className:"mt-sym-lg",children:"+"}),latex:"+",tip:"Tambah"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"−"}),latex:"-",tip:"Kurang"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"×"}),latex:"\\times",tip:"Kali"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"÷"}),latex:"\\div",tip:"Bagi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"±"}),latex:"\\pm",tip:"Plus-minus"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∓"}),latex:"\\mp",tip:"Minus-plus"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"·"}),latex:"\\cdot",tip:"Dot"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∘"}),latex:"\\circ",tip:"Komposisi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"="}),latex:"=",tip:"Sama dengan"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"≠"}),latex:"\\neq",tip:"Tidak sama"}],[{icon:g.jsx("span",{className:"mt-sym-lg",children:"<"}),latex:"<",tip:"Kurang dari"},{icon:g.jsx("span",{className:"mt-sym-lg",children:">"}),latex:">",tip:"Lebih dari"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"≤"}),latex:"\\leq",tip:"Kurang/sama"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"≥"}),latex:"\\geq",tip:"Lebih/sama"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"≈"}),latex:"\\approx",tip:"Hampir sama"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"≡"}),latex:"\\equiv",tip:"Identik"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∈"}),latex:"\\in",tip:"Elemen dari"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∉"}),latex:"\\notin",tip:"Bukan elemen"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⊂"}),latex:"\\subset",tip:"Subset"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⊃"}),latex:"\\supset",tip:"Superset"}],[{icon:g.jsx("span",{className:"mt-sym-lg",children:"∪"}),latex:"\\cup",tip:"Gabungan"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∩"}),latex:"\\cap",tip:"Irisan"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∅"}),latex:"\\emptyset",tip:"Himpunan kosong"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∀"}),latex:"\\forall",tip:"Untuk semua"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∃"}),latex:"\\exists",tip:"Eksistensi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"¬"}),latex:"\\neg",tip:"Negasi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∧"}),latex:"\\wedge",tip:"AND"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∨"}),latex:"\\vee",tip:"OR"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∴"}),latex:"\\therefore",tip:"Maka"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∵"}),latex:"\\because",tip:"Karena"}],[{icon:g.jsx(ht,{t:"Mod"}),latex:"a \\equiv b \\pmod{n}",tip:"Modulo"},{icon:g.jsx(ht,{t:"For All"}),latex:"\\forall x \\in \\mathbb{R}",tip:"Untuk semua bilangan real"},{icon:g.jsx(ht,{t:"Exists"}),latex:"\\exists y \\text{ s.t. } y > x",tip:"Terdapat y sedemikian..."}]]},{id:"geom",icon:"∠ △",tip:"Geometri & Trigonometri",rows:[[{icon:g.jsx("span",{className:"mt-sym-lg",children:"∠"}),latex:"\\angle",tip:"Sudut"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"△"}),latex:"\\triangle",tip:"Segitiga"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⊥"}),latex:"\\perp",tip:"Tegak lurus"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∥"}),latex:"\\parallel",tip:"Sejajar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"≅"}),latex:"\\cong",tip:"Kongruen"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∼"}),latex:"\\sim",tip:"Sebangun"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"□"}),latex:"\\square",tip:"Persegi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⊙"}),latex:"\\odot",tip:"Titik pusat lingkaran"}],[{icon:g.jsx("span",{className:"mt-sym-fn",children:"sin"}),latex:"\\sin",tip:"Sinus"},{icon:g.jsx("span",{className:"mt-sym-fn",children:"cos"}),latex:"\\cos",tip:"Kosinus"},{icon:g.jsx("span",{className:"mt-sym-fn",children:"tan"}),latex:"\\tan",tip:"Tangen"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym-fn",children:"sin"}),g.jsx("sup",{children:"-1"})]}),latex:"\\sin^{-1}",tip:"Arcsin"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym-fn",children:"cos"}),g.jsx("sup",{children:"-1"})]}),latex:"\\cos^{-1}",tip:"Arccos"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym-fn",children:"tan"}),g.jsx("sup",{children:"-1"})]}),latex:"\\tan^{-1}",tip:"Arctan"},{icon:g.jsx("span",{className:"mt-sym-fn",children:"log"}),latex:"\\log",tip:"Logaritma"},{icon:g.jsx("span",{className:"mt-sym-fn",children:"ln"}),latex:"\\ln",tip:"Log natural"}],[{icon:g.jsx(ht,{t:"Identitas"}),latex:"\\sin^2 \\theta + \\cos^2 \\theta = 1",tip:"Identitas Trigonometri"},{icon:g.jsx(ht,{t:"Sin Rule"}),latex:"\\frac{a}{\\sin A} = \\frac{b}{\\sin B} = \\frac{c}{\\sin C}",tip:"Aturan Sinus"},{icon:g.jsx(ht,{t:"Cos Rule"}),latex:"c^2 = a^2 + b^2 - 2ab \\cos C",tip:"Aturan Cosinus"}]]},{id:"chem",icon:"🧪",tip:"Kimia (mhchem)",rows:[[{icon:g.jsx(ht,{t:"Insert ce"}),latex:"\\ce{#?}",tip:"Sisipkan Rumus Kimia (ce)"},{icon:g.jsx(ht,{t:"Reaksi"}),latex:"\\ce{#? -> #?}",tip:"Persamaan Reaksi"},{icon:g.jsx(ht,{t:"Keseimbangan"}),latex:"\\ce{#? <=> #?}",tip:"Kesetimbangan"},{icon:g.jsx(ht,{t:"Katalis"}),latex:"\\ce{#? ->[#?][#?] #?}",tip:"Reaksi dengan katalis"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"→"}),latex:"\\ce{->}",tip:"Panah Reaksi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⇌"}),latex:"\\ce{<=>}",tip:"Panah Kesetimbangan"},{icon:g.jsx("span",{className:"mt-sym",children:"Δ"}),latex:"\\ce{^\\Delta}",tip:"Panah Panas"}],[{icon:g.jsx("span",{className:"mt-sym",children:"n"}),latex:"n",tip:"Jumlah mol (n)"},{icon:g.jsx("span",{className:"mt-sym",children:"M"}),latex:"M",tip:"Molaritas (M)"},{icon:g.jsx("span",{className:"mt-sym",children:"m"}),latex:"m",tip:"Molalitas (m)"},{icon:g.jsx("span",{className:"mt-sym",children:"V"}),latex:"V",tip:"Volume (V)"},{icon:g.jsx("span",{className:"mt-sym",children:"P"}),latex:"P",tip:"Tekanan (P)"},{icon:g.jsx("span",{className:"mt-sym",children:"R"}),latex:"R",tip:"Tetapan Gas (R)"},{icon:g.jsx("span",{className:"mt-sym",children:"ΔH"}),latex:"\\Delta H",tip:"Perubahan Entalpi"},{icon:g.jsx("span",{className:"mt-sym",children:"ΔG"}),latex:"\\Delta G",tip:"Energi Bebas Gibbs"},{icon:g.jsx("span",{className:"mt-sym",children:"S"}),latex:"\\Delta S",tip:"Entropi"}],[{icon:g.jsxs("span",{className:"mt-sym",children:["[H",g.jsx("sup",{children:"+"}),"]"]}),latex:"[\\ce{H+}]",tip:"Konsentrasi H+"},{icon:g.jsxs("span",{className:"mt-sym",children:["[OH",g.jsx("sup",{children:"-"}),"]"]}),latex:"[\\ce{OH-}]",tip:"Konsentrasi OH-"},{icon:g.jsxs("span",{className:"mt-sym",children:["K",g.jsx("sub",{children:"a"})]}),latex:"K_a",tip:"Tetapan Asam"},{icon:g.jsxs("span",{className:"mt-sym",children:["K",g.jsx("sub",{children:"b"})]}),latex:"K_b",tip:"Tetapan Basa"},{icon:g.jsxs("span",{className:"mt-sym",children:["K",g.jsx("sub",{children:"sp"})]}),latex:"K_{sp}",tip:"Hasil Kali Kelarutan"},{icon:g.jsxs("span",{className:"mt-sym",children:["SO",g.jsx("sub",{children:"4"}),g.jsx("sup",{children:"2-"})]}),latex:"\\ce{SO4^{2-}}",tip:"Sulfat"},{icon:g.jsxs("span",{className:"mt-sym",children:["NO",g.jsx("sub",{children:"3"}),g.jsx("sup",{children:"-"})]}),latex:"\\ce{NO3-}",tip:"Nitrat"},{icon:g.jsxs("span",{className:"mt-sym",children:["PO",g.jsx("sub",{children:"4"}),g.jsx("sup",{children:"3-"})]}),latex:"\\ce{PO4^{3-}}",tip:"Fosfat"},{icon:g.jsx("span",{className:"mt-sym",children:"+"}),latex:" + ",tip:"Tambah"}],[{icon:g.jsx("span",{className:"mt-sym",children:"H"}),latex:"\\ce{H}",tip:"Hidrogen"},{icon:g.jsx("span",{className:"mt-sym",children:"C"}),latex:"\\ce{C}",tip:"Karbon"},{icon:g.jsx("span",{className:"mt-sym",children:"O"}),latex:"\\ce{O}",tip:"Oksigen"},{icon:g.jsx("span",{className:"mt-sym",children:"N"}),latex:"\\ce{N}",tip:"Nitrogen"},{icon:g.jsx("span",{className:"mt-sym",children:"P"}),latex:"\\ce{P}",tip:"Fosfor"},{icon:g.jsx("span",{className:"mt-sym",children:"S"}),latex:"\\ce{S}",tip:"Sulfur"},{icon:g.jsx("span",{className:"mt-sym",children:"Cl"}),latex:"\\ce{Cl}",tip:"Klorin"},{icon:g.jsx("span",{className:"mt-sym",children:"Na"}),latex:"\\ce{Na}",tip:"Natrium"},{icon:g.jsx("span",{className:"mt-sym",children:"Mg"}),latex:"\\ce{Mg}",tip:"Magnesium"},{icon:g.jsx("span",{className:"mt-sym",children:"Al"}),latex:"\\ce{Al}",tip:"Aluminium"}],[{icon:g.jsx("span",{className:"mt-sym",children:"K"}),latex:"\\ce{K}",tip:"Kalium"},{icon:g.jsx("span",{className:"mt-sym",children:"Ca"}),latex:"\\ce{Ca}",tip:"Kalsium"},{icon:g.jsx("span",{className:"mt-sym",children:"Fe"}),latex:"\\ce{Fe}",tip:"Besi (Ferrum)"},{icon:g.jsx("span",{className:"mt-sym",children:"Cu"}),latex:"\\ce{Cu}",tip:"Tembaga (Cuprum)"},{icon:g.jsx("span",{className:"mt-sym",children:"Zn"}),latex:"\\ce{Zn}",tip:"Seng (Zincum)"},{icon:g.jsx("span",{className:"mt-sym",children:"Ag"}),latex:"\\ce{Ag}",tip:"Perak (Argentum)"},{icon:g.jsx("span",{className:"mt-sym",children:"Au"}),latex:"\\ce{Au}",tip:"Emas (Aurum)"},{icon:g.jsx("span",{className:"mt-sym",children:"Pb"}),latex:"\\ce{Pb}",tip:"Timbal (Plumbum)"},{icon:g.jsx("span",{className:"mt-sym",children:"I"}),latex:"\\ce{I}",tip:"Iodin"},{icon:g.jsx("span",{className:"mt-sym",children:"Br"}),latex:"\\ce{Br}",tip:"Bromin"}],[{icon:g.jsx("span",{className:"mt-sym",children:"COOH"}),latex:"COOH",tip:"Asam Karboksilat"},{icon:g.jsx("span",{className:"mt-sym",children:"OH"}),latex:"OH",tip:"Hidroksil / Alkohol"},{icon:g.jsxs("span",{className:"mt-sym",children:["NH",g.jsx("sub",{children:"2"})]}),latex:"NH2",tip:"Amida / Amina"},{icon:g.jsxs("span",{className:"mt-sym",children:["CH",g.jsx("sub",{children:"3"})]}),latex:"CH3",tip:"Metil"},{icon:g.jsx("span",{className:"mt-sym",children:"CHO"}),latex:"CHO",tip:"Aldehid"},{icon:g.jsx("span",{className:"mt-sym",children:"CO"}),latex:"CO",tip:"Keton"},{icon:g.jsxs("span",{className:"mt-sym",children:["C",g.jsx("sub",{children:"6"}),"H",g.jsx("sub",{children:"5"})]}),latex:"C6H5",tip:"Fenil (Benzena)"},{icon:g.jsx("span",{className:"mt-sym",children:"R-"}),latex:"R-",tip:"Gugus Alkil"}]]}];function QM({isOpen:e,onInsert:t,onClose:n,initialLatex:r="",initialTab:i="frac"}){const[a,o]=V.useState(r),[s,l]=V.useState(i),[c,u]=V.useState("inline"),[d,p]=V.useState(!0),[h,m]=V.useState(null),[f,_]=V.useState(null),b=V.useRef(null),y=V.useRef(null),[v,E]=V.useState({x:0,y:0}),T=V.useRef({x:0,y:0}),S=V.useRef({startX:0,startY:0,isDragging:!1});V.useEffect(()=>{if(!e||!y.current)return;let x=!1,G=null,D=null;p(!0),Promise.resolve().then(()=>r$).then(I=>{if(x)return;if(!y.current){x||p(!1);return}const B=I;B.MathfieldElement&&(B.MathfieldElement.mathVirtualKeyboardPolicy="manual",B.MathfieldElement.keypressSound={spacebar:null,return:null,delete:null,default:null},B.MathfieldElement.keypressVibration=!1,B.MathfieldElement.plonkSound=null);try{const R=KM();R&&(R.visible=!1)}catch{}const $=document.createElement("math-field");$.setAttribute("virtual-keyboard-mode","off"),$.setAttribute("math-virtual-keyboard-policy","manual"),$.mathVirtualKeyboardPolicy="manual",$.setAttribute("smart-mode","true"),$.setAttribute("smart-fence","true"),$.setAttribute("smart-superscript","true"),$.style.width="100%",$.style.minHeight="120px",$.style.fontSize="24px",$.style.padding="12px 16px",$.style.border="none",$.style.outline="none",$.style.background="transparent",$.style.fontFamily="'KaTeX_Main', 'KaTeX_Math', 'Times New Roman', serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', 'Amiri', 'Malgun Gothic', 'SimSun'",!x&&(r&&$.setAttribute("value",r),D={},D.input=R=>{const L=R.target;o(L.value),m(null)},D.focus=()=>{var R,L;try{(L=(R=KM())==null?void 0:R.hide)==null||L.call(R)}catch{}},D.paste=R=>{var ne,ge,Ne,Ae,be,Re;const L=(ne=R.clipboardData)==null?void 0:ne.items;if(!L)return;for(const we of L)if(we.type==="text/latex"){we.getAsString(K=>{var ye;R.preventDefault(),(ye=$.executeCommand)==null||ye.call($,["insert",K,{focus:!0}]),o($.value||"")});return}const J=(ge=R.clipboardData)==null?void 0:ge.getData("text/plain");if(J){const we=J.trim(),K=we.replace(/^\\\[\s*([\s\S]*?)\s*\\\]$/,"$1").replace(/^\\\(\s*([\s\S]*?)\s*\\\)$/,"$1").replace(/^\$\$\s*([\s\S]*?)\s*\$\$$/,"$1").replace(/^\$\s*([\s\S]*?)\s*\$$/,"$1");if(K!==we){R.preventDefault(),(Ne=$.executeCommand)==null||Ne.call($,["insert",K,{focus:!0}]),o($.value||"");return}}const se=(Ae=R.clipboardData)==null?void 0:Ae.getData("text/html");if(se){let we=se.match(/<annotation encoding="application\/x-tex">([\s\S]*?)<\/annotation>/);if(we||(we=se.match(/<annotation encoding="(?:math\/tex|text\/latex)">([\s\S]*?)<\/annotation>/)),we){R.preventDefault(),(be=$.executeCommand)==null||be.call($,["insert",we[1].trim(),{focus:!0}]),o($.value||"");return}const K=se.match(/<img[^>]*alt="([^"]*)"[^>]*>/i);if(K&&K[1]&&K[1].length>2&&/\\\w+/.test(K[1])){R.preventDefault(),(Re=$.executeCommand)==null||Re.call($,["insert",K[1].trim(),{focus:!0}]),o($.value||"");return}}for(const we of L)if(we.type==="text/mathml"||we.type==="application/mathml+xml")return},$.addEventListener("input",D.input),$.addEventListener("focus",D.focus),$.addEventListener("paste",D.paste),!x&&(y.current.innerHTML="",y.current.appendChild($),b.current=$,p(!1),G=setTimeout(()=>$.focus(),100)))}).catch(()=>{x||p(!1)});const A=y.current;return()=>{if(x=!0,G!==null&&clearTimeout(G),A&&D){const I=A.querySelector("math-field");I&&(D.input&&I.removeEventListener("input",D.input),D.focus&&I.removeEventListener("focus",D.focus),D.paste&&I.removeEventListener("paste",D.paste)),A.innerHTML=""}b.current=null}},[e]),V.useEffect(()=>{if(!a.trim()){_(null),m(null);return}const x=a.replace(/\\placeholder(\[.*?\])?\{([^}]*)\}/g,(G,D,A)=>A||"\\text{?}").replace(/\\placeholder/g,"\\text{?}");if(!x.trim()){_('<span style="color:#94a3b8">(kosong)</span>'),m(null);return}try{const G=Jp.renderToString(x,{throwOnError:!0,displayMode:c==="block"});_(G),m(null)}catch(G){_(null),m(G instanceof Error?G.message:"Invalid LaTeX")}},[a,c]);const w=V.useCallback(x=>{var D;if(!b.current)return;const G=b.current;x.command?(D=G.executeCommand)==null||D.call(G,x.command):x.latex&&(G.executeCommand?G.executeCommand(["insert",x.latex,{focus:!0}]):G.value=(G.value||"")+x.latex),o(G.value||""),G.focus()},[]),M=V.useCallback(x=>{var A;if(!b.current)return;const G=b.current,D=`\\text{\\class{mt-font-${x}}{#@}}`;(A=G.executeCommand)==null||A.call(G,["insert",D,{focus:!0}]),o(G.value||""),G.focus()},[]),P=V.useCallback(x=>{var D;if(!b.current)return;const G=b.current;(D=G.executeCommand)==null||D.call(G,["applyStyle",x]),o(G.value||""),G.focus()},[]),z=V.useCallback(()=>{a.trim()&&t(a),n()},[a,t,n]),ee=V.useCallback(x=>{x.key==="Escape"&&n()},[n]);V.useEffect(()=>{e||(o(""),l(i),E({x:0,y:0}))},[e,i]),V.useEffect(()=>{T.current=v},[v]);const O=V.useCallback(x=>{if(x.target.closest("button"))return;S.current={isDragging:!0,startX:x.clientX,startY:x.clientY};const G=T.current.x,D=T.current.y,A=B=>{if(!S.current.isDragging)return;const $=B.clientX-S.current.startX,R=B.clientY-S.current.startY;E({x:G+$,y:D+R})},I=()=>{S.current.isDragging=!1,document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",I)};document.addEventListener("mousemove",A),document.addEventListener("mouseup",I)},[]);if(!e)return null;const H=b2.find(x=>x.id===s)||b2[0];return g.jsx("div",{className:"mt-overlay",onClick:n,onKeyDown:ee,role:"dialog","aria-modal":"true","aria-label":"Equation Editor",children:g.jsx("div",{style:{transform:`translate(${v.x}px, ${v.y}px)`},onClick:x=>x.stopPropagation(),children:g.jsxs("div",{className:"mt-dialog",children:[g.jsxs("div",{className:"mt-titlebar",onMouseDown:O,style:{cursor:"move"},children:[g.jsxs("div",{className:"mt-titlebar__left",children:[g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",style:{opacity:.9},children:g.jsx("path",{d:"M2 2l3 6-3 6h2.5l2-4 2 4H11l-3-6 3-6H8.5l-2 4-2-4H2zm9 0v2h4V2h-4zm0 5v2h4V7h-4zm0 5v2h4v-2h-4z"})}),g.jsx("span",{className:"mt-titlebar__title",children:"MathTextX — Equation Editor"})]}),g.jsx("button",{className:"mt-titlebar__close",onClick:n,title:"Tutup (Esc)",children:g.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",children:g.jsx("path",{d:"M1 0L0 1l4 4-4 4 1 1 4-4 4 4 1-1-4-4 4-4-1-1-4 4z"})})})]}),g.jsxs("div",{className:"mt-format-bar",children:[g.jsxs("select",{className:"mt-font-select",onChange:x=>{x.target.value&&M(x.target.value),x.target.value=""},defaultValue:"",children:[g.jsx("option",{value:"",disabled:!0,children:"Pilih Font..."}),g.jsx("option",{value:"serif",children:"Roman (Serif)"}),g.jsx("option",{value:"sans",children:"Sans Serif (Arial)"}),g.jsx("option",{value:"mono",children:"Monospace (Courier)"}),g.jsx("option",{value:"arabic",children:"Arabic (Amiri)"}),g.jsx("option",{value:"cjk",children:"Chinese (SimSun)"}),g.jsx("option",{value:"korean",children:"Korean (Malgun)"})]}),g.jsx("div",{style:{fontSize:"11px",color:"#666",borderLeft:"1px solid #ccc",paddingLeft:"8px",marginRight:"8px"},children:"Font"}),g.jsxs("div",{className:"mt-format-group",children:[g.jsx("button",{className:"mt-format-btn",onClick:()=>P({fontWeight:"bold"}),title:"Bold","data-tooltip":"Bold",children:g.jsx("b",{children:"B"})}),g.jsx("button",{className:"mt-format-btn",onClick:()=>P({fontStyle:"italic"}),title:"Italic","data-tooltip":"Italic",children:g.jsx("i",{children:"I"})}),g.jsx("button",{className:"mt-format-btn",onClick:()=>{var G;const x=b.current;(G=x==null?void 0:x.executeCommand)==null||G.call(x,["insert","\\underline{#@}",{focus:!0}])},title:"Underline","data-tooltip":"Underline",children:g.jsx("u",{children:"U"})})]}),g.jsx("div",{className:"mt-format-group",children:g.jsx("input",{type:"color",className:"mt-color-picker",onChange:x=>P({color:x.target.value}),title:"Text Color"})})]}),g.jsx("div",{className:"mt-tab-bar",children:b2.map(x=>g.jsx("button",{className:`mt-tab ${s===x.id?"is-active":""}`,onClick:()=>l(x.id),title:x.tip,"data-tooltip":x.tip,children:g.jsx("span",{className:"mt-tab__icon",children:x.icon})},x.id))}),s==="matrix"&&g.jsx($le,{onInsert:x=>{var D;if(!b.current)return;const G=b.current;(D=G.executeCommand)==null||D.call(G,["insert",x,{focus:!0}]),o(G.value||""),G.focus()}}),g.jsx("div",{className:"mt-grid",children:H.rows.map((x,G)=>g.jsx("div",{className:"mt-grid__row",children:x.map((D,A)=>g.jsx("button",{className:`mt-grid__btn${D.command==="formula"?" mt-grid__btn--formula":""}`,onClick:()=>w(D),title:D.tip,"data-tooltip":D.tip,children:D.icon},A))},G))}),g.jsxs("div",{className:"mt-editor",children:[d&&g.jsxs("div",{className:"mt-loading",children:[g.jsx("div",{className:"mt-loading__spinner"}),g.jsx("span",{className:"mt-loading__text",children:"Memuat Equation Editor..."})]}),g.jsx("div",{className:"mt-editor__field",ref:y})]}),g.jsxs("div",{className:"mt-latex-bar",children:[g.jsxs("div",{className:"mt-latex-bar__row",children:[g.jsx("span",{className:"mt-latex-bar__label",children:"LaTeX:"}),g.jsx("code",{className:"mt-latex-bar__code",children:a||"(ketik atau klik tombol di atas)"})]}),f&&g.jsx("div",{className:"mt-latex-bar__preview",dangerouslySetInnerHTML:{__html:f}}),h&&g.jsx("div",{className:"mt-latex-bar__error",children:h})]}),g.jsxs("div",{className:"mt-actions",children:[g.jsxs("div",{className:"mt-actions__hint",children:[g.jsx("button",{type:"button",className:`mt-display-mode-toggle ${c==="block"?"is-block":""}`,onClick:()=>u(x=>x==="inline"?"block":"inline"),title:c==="inline"?"Saat ini: Inline (klik untuk Block)":"Saat ini: Block (klik untuk Inline)","aria-pressed":c==="block",children:g.jsx("span",{className:"mt-display-mode-toggle__label",children:c==="inline"?"📝 Inline":"📐 Block"})}),g.jsx("kbd",{children:"Esc"})," tutup  ·  Klik tombol ",g.jsx("b",{children:"Sisipkan"})," untuk menyimpan"]}),g.jsxs("div",{className:"mt-actions__buttons",children:[g.jsx("button",{className:"mt-actions__cancel",onClick:n,children:"Batal"}),g.jsx("button",{className:"mt-actions__insert",onClick:z,disabled:!a.trim(),children:"✓ Sisipkan"})]})]})]})})})}let y2=null,XM=!1;function jM(){return y2||(y2=Promise.resolve().then(()=>r$).then(e=>{const t=window.MATHLIVE_FONTS_PATH||"/fonts";return e.MathfieldElement&&(e.MathfieldElement.fontsDirectory=t),e})),y2}async function Nue(){if(!XM)try{const e=await jM(),t=window.MATHLIVE_FONTS_PATH||"/fonts";e.loadFonts&&(await e.loadFonts({fontsDirectory:t}),XM=!0)}catch(e){so.warn("MathLive fonts could not be loaded:",e)}}function ZM(){return window.mathVirtualKeyboard}function JM(e){const t=V.useRef(null),n=V.useRef(null),[r,i]=V.useState(!1),[a,o]=V.useState(!1),[s,l]=V.useState(!1),c=e.node.attrs.display==="block",u=a&&!s,d=V.useCallback(()=>{i(!0)},[]),p=V.useCallback(()=>{i(!1),o(!1),l(!1)},[]),h=V.useCallback(m=>{e.updateAttributes({latex:m}),i(!1),o(!1),l(!1)},[e]);return V.useEffect(()=>{if(!t.current)return;const m=t.current;let f=!1;const _=[];let b=null,y=null;async function v(){await Nue();const E=await jM();if(!f){E.MathfieldElement&&(E.MathfieldElement.keypressVibration=!1,E.MathfieldElement.keypressSound={spacebar:null,return:null,delete:null,default:null},E.MathfieldElement.plonkSound=null,E.MathfieldElement.mathVirtualKeyboardPolicy="manual");try{const T=ZM();T&&(T.visible=!1)}catch{}if(!f&&(y=document.createElement("math-field"),y.setAttribute("virtual-keyboard-mode","off"),y.setAttribute("math-virtual-keyboard-policy","manual"),y.mathVirtualKeyboardPolicy="manual",y.setAttribute("smart-mode","true"),y.setAttribute("smart-fence","true"),y.setAttribute("smart-superscript","true"),e.node.attrs.latex&&y.setAttribute("value",e.node.attrs.latex),b={},b.input=T=>{const S=T.target;e.updateAttributes({latex:S.value})},b.focus=()=>{var T,S;l(!0);try{(S=(T=ZM())==null?void 0:T.hide)==null||S.call(T)}catch{}},b.blur=()=>{l(!1)},b.keydown=T=>{var ee;const S=T;if(S.key===" "){S.preventDefault(),S.stopPropagation(),(ee=y==null?void 0:y.executeCommand)==null||ee.call(y,["insert","\\,",{focus:!0}]);return}if(S.key!=="Enter")return;S.preventDefault(),S.stopPropagation();let w;try{w=e.getPos()}catch{return}const{editor:M}=e,P=w+e.node.nodeSize,z=M.state.tr;if(c){const O=M.schema.nodes.mathBlock.create({latex:"",display:"block"});z.insert(P,O)}else{const O=M.schema.nodes.hardBreak.create();z.insert(P,O);const H=M.schema.nodes.mathInline.create({latex:"",display:"inline"});z.insert(P+1,H)}z.setSelection(tt.near(z.doc.resolve(P+1))),M.view.dispatch(z),M.view.focus()},y.addEventListener("input",b.input),y.addEventListener("focus",b.focus),y.addEventListener("blur",b.blur),y.addEventListener("keydown",b.keydown),!f&&(m.innerHTML="",m.appendChild(y),n.current=y,!e.node.attrs.latex))){const T=setTimeout(()=>{y.focus()},50);_.push(T)}}}return v().catch(E=>so.error("Failed to initialize math field",E)),()=>{f=!0,_.forEach(E=>clearTimeout(E)),y&&b&&(b.input&&y.removeEventListener("input",b.input),b.focus&&y.removeEventListener("focus",b.focus),b.blur&&y.removeEventListener("blur",b.blur),b.keydown&&y.removeEventListener("keydown",b.keydown)),n.current=null,m.innerHTML=""}},[]),V.useEffect(()=>{const m=n.current;m&&e.node.attrs.latex!==m.value&&(m.value=e.node.attrs.latex||"")},[e.node.attrs.latex]),g.jsxs(g.Fragment,{children:[g.jsxs(AE,{className:`${c?"mtx-math-block":"mtx-math-inline"} ${e.node.attrs.latex?"":"is-empty"}`,"data-latex":e.node.attrs.latex,style:e.selected?{outline:"2px solid #2563eb",outlineOffset:"2px"}:void 0,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[g.jsx("div",{ref:t,style:{position:"relative",display:c?"block":"inline-block"}}),u&&g.jsxs("button",{type:"button",onClick:d,className:"mtx-math-edit-btn",title:"Edit rumus dengan Equation Editor",children:[g.jsx("span",{children:"✏️"}),g.jsx("span",{children:"Edit"})]})]}),r&&g.jsx(QM,{isOpen:r,initialLatex:e.node.attrs.latex,onInsert:h,onClose:p})]})}const e8=vn.create({name:"mathInline",group:"inline",inline:!0,atom:!0,addAttributes(){return{latex:{default:"",parseHTML:e=>e.getAttribute("data-latex"),renderHTML:e=>({"data-latex":e.latex})},display:{default:"inline",parseHTML:e=>e.getAttribute("data-display")||"inline",renderHTML:e=>({"data-display":e.display})}}},parseHTML(){return[{tag:'span[data-type="math-inline"]'},{tag:"span.mtx-math-inline"}]},renderHTML({HTMLAttributes:e}){return["span",vt(e,{"data-type":"math-inline",class:"mtx-math-inline"})]},addNodeView(){return Ff(JM)}}),t8=vn.create({name:"mathBlock",group:"block",atom:!0,addAttributes(){return{latex:{default:"",parseHTML:e=>e.getAttribute("data-latex"),renderHTML:e=>({"data-latex":e.latex})},display:{default:"block",parseHTML:e=>e.getAttribute("data-display")||"block",renderHTML:e=>({"data-display":e.display})}}},parseHTML(){return[{tag:'div[data-type="math-block"]'},{tag:"div.mtx-math-block"}]},renderHTML({HTMLAttributes:e}){return["div",vt(e,{"data-type":"math-block",class:"mtx-math-block"})]},addNodeView(){return Ff(JM)}}),eh={bold:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M4 2h5a3 3 0 0 1 2.1 5.15A3.5 3.5 0 0 1 9.5 14H4V2zm2 5h3a1 1 0 1 0 0-2H6v2zm0 2v3h3.5a1.5 1.5 0 0 0 0-3H6z"})}),italic:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M6 2h6v2h-2.2l-2.6 8H9v2H3v-2h2.2l2.6-8H6V2z"})}),underline:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M3 13h10v1.5H3V13zM4 2v6a4 4 0 0 0 8 0V2h-2v6a2 2 0 0 1-4 0V2H4z"})}),strike:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 7h12v1.5H2V7zm3.5-4.5h5c1.1 0 2 .9 2 2s-.9 2-2 2h-2V5h2a.5.5 0 0 0 0-1h-5a.5.5 0 0 0 0 1h1v1.5h-1c-1.1 0-2-.9-2-2s.9-2 2-2zm2 7V11h-1a.5.5.0 0 0 0 1h5a.5.5 0 0 0 0-1h-2V9.5h-2z"})}),h1:g.jsx("svg",{width:"20",height:"16",viewBox:"0 0 20 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3v10h2V9h4v4h2V3H8v4H4V3H2zm12 0v10h2V5.5l2 1V4.3l-3-1.8h-1z"})}),h2:g.jsx("svg",{width:"20",height:"16",viewBox:"0 0 20 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3v10h2V9h4v4h2V3H8v4H4V3H2zm10 10v-2c0-1.5 1.2-2.5 2.4-3.3L15.8 7C16.6 6.4 17 5.8 17 5c0-.8-.5-1.5-1.5-1.5S14 4.2 14 5h-2c0-1.9 1.3-3.5 3.5-3.5S19 3.1 19 5c0 1.3-.7 2.2-1.8 3l-1.5 1H19v2h-7z"})}),h3:g.jsx("svg",{width:"20",height:"16",viewBox:"0 0 20 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3v10h2V9h4v4h2V3H8v4H4V3H2zm10 3.5h2c.8 0 1.5-.3 1.5-1s-.7-1-1.5-1-1.5.3-1.5 1h-2c0-1.7 1.3-3 3.5-3s3.5 1.1 3.5 2.5c0 .9-.5 1.5-1.2 1.8.9.4 1.5 1.2 1.5 2.2 0 1.6-1.4 3-3.8 3S12 10.4 12 8.5h2c0 .8.7 1.5 1.5 1.5s1.5-.5 1.5-1.3-.6-1.2-1.5-1.2H14V6.5z"})}),h4:g.jsx("svg",{width:"20",height:"16",viewBox:"0 0 20 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3v10h2V9h4v4h2V3H8v4H4V3H2zm11 10v-3h4V7h-4V4h-2v10h2z"})}),paragraph:g.jsxs("svg",{width:"18",height:"16",viewBox:"0 0 18 16",fill:"currentColor",children:[g.jsx("path",{d:"M3 2h7a4 4 0 0 1 0 8H8v4H6V4H3V2zm5 2v4h2a2 2 0 1 0 0-4H8z"}),g.jsx("path",{d:"M12 2h2v12h-2z"})]}),bulletList:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("circle",{cx:"2.5",cy:"4",r:"1.5"}),g.jsx("rect",{x:"6",y:"3",width:"9",height:"2",rx:"0.5"}),g.jsx("circle",{cx:"2.5",cy:"8",r:"1.5"}),g.jsx("rect",{x:"6",y:"7",width:"9",height:"2",rx:"0.5"}),g.jsx("circle",{cx:"2.5",cy:"12",r:"1.5"}),g.jsx("rect",{x:"6",y:"11",width:"9",height:"2",rx:"0.5"})]}),orderedList:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("text",{x:"1",y:"5",fontSize:"5.5",fontWeight:"600",fontFamily:"sans-serif",children:"1."}),g.jsx("text",{x:"1",y:"9",fontSize:"5.5",fontWeight:"600",fontFamily:"sans-serif",children:"2."}),g.jsx("text",{x:"1",y:"13",fontSize:"5.5",fontWeight:"600",fontFamily:"sans-serif",children:"3."}),g.jsx("rect",{x:"6",y:"3",width:"9",height:"2",rx:"0.5"}),g.jsx("rect",{x:"6",y:"7",width:"9",height:"2",rx:"0.5"}),g.jsx("rect",{x:"6",y:"11",width:"9",height:"2",rx:"0.5"})]}),taskList:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("rect",{x:"1.5",y:"2.5",width:"3",height:"3",rx:"0.5",stroke:"currentColor",fill:"none",strokeWidth:"1.2"}),g.jsx("path",{d:"M2.2 4l.7.7 1.3-1.5",stroke:"currentColor",fill:"none",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("rect",{x:"6",y:"3",width:"9",height:"1.5",rx:"0.5"}),g.jsx("rect",{x:"1.5",y:"10.5",width:"3",height:"3",rx:"0.5",stroke:"currentColor",fill:"none",strokeWidth:"1.2"}),g.jsx("rect",{x:"6",y:"11",width:"9",height:"1.5",rx:"0.5"})]}),superscript:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M1 13l4-5.5L1.5 3H4l2.3 3.2L8.5 3H11L7.5 6.5 12 13H9.2L6.5 9.2 3.8 13H1zm10-9V2.5c0-.6.5-1 1.2-1.2l.8-.3c.3-.1.5-.3.5-.5 0-.3-.3-.5-.7-.5-.5 0-.8.3-.8.7h-1.2c0-1 .8-1.7 2-1.7s2 .7 2 1.6c0 .6-.4 1-1 1.3l-.7.3c-.3.1-.5.2-.6.4H15V4h-4z"})}),subscript:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M1 12l4-5.5L1.5 2H4l2.3 3.2L8.5 2H11L7.5 6.5 12 12H9.2L6.5 8.2 3.8 12H1zm10 3v-1.5c0-.6.5-1 1.2-1.2l.8-.3c.3-.1.5-.3.5-.5 0-.3-.3-.5-.7-.5-.5 0-.8.3-.8.7h-1.2c0-1 .8-1.7 2-1.7s2 .7 2 1.6c0 .6-.4 1-1 1.3l-.7.3c-.3.1-.5.2-.6.4H15V15h-4z"})}),link:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M6.9 11.1l-1.4 1.4a2 2 0 0 1-2.8-2.8l2.8-2.8a2 2 0 0 1 2.8 0l.7-.7a3 3 0 0 0-4.2 0L2.2 9a3 3 0 0 0 4.2 4.2l1.4-1.4-.7-.7zm2.2-6.2l1.4-1.4a2 2 0 0 1 2.8 2.8l-2.8 2.8a2 2 0 0 1-2.8 0l-.7.7a3 3 0 0 0 4.2 0l2.8-2.8a3 3 0 0 0-4.2-4.2L8.4 4.2l.7.7z"})}),image:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3zm1.5 8.5l2.5-3 2 2.5 3-4 3 4.5H3.5zm2-5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"})}),editImage:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M12.854 1.646a.5.5 0 0 1 .708 0l1.79 1.79a.5.5 0 0 1 0 .708l-8.5 8.5a.5.5 0 0 1-.224.128l-4 1a.5.5 0 0 1-.604-.604l1-4a.5.5 0 0 1 .128-.224l8.5-8.5zM13.5 2.707L5.707 10.5 5 13.293l2.793-.707 7.793-7.793-2.086-2.086zM3 14a1 1 0 1 1 2 0 1 1 0 0 1-2 0z"})}),table:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M1 2.5A1.5 1.5 0 0 1 2.5 1h11A1.5 1.5 0 0 1 15 2.5v11a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 1 13.5v-11zM2.5 2a.5.5 0 0 0-.5.5V5h5V2H2.5zM9 2v3h5V2.5a.5.5 0 0 0-.5-.5H9zM14 6H9v3h5V6zM14 10.5H9v3h4.5a.5.5 0 0 0 .5-.5V10.5zM7 13.5v-3H2v2.5a.5.5 0 0 0 .5.5H7zM2 9h5V6H2v3z"})}),rowAbove:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3h12v2H2V3zm0 4h12v6H2V7zm6-6 2.5 2.5h-1.5V6h-2V3.5H5.5L8 1z"})}),rowBelow:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3h12v6H2V3zm0 8h12v2H2v-2zm6 4-2.5-2.5h1.5V10h2v2.5h1.5L8 15z"})}),columnLeft:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M3 2h2v12H3V2zm4 0h7v12H7V2zM1 8l2.5-2.5V7H6v2H3.5v1.5L1 8z"})}),columnRight:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M11 2h2v12h-2V2zM2 2h7v12H2V2zm13 6-2.5 2.5V9H10V7h2.5V5.5L15 8z"})}),cellProperties:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 2h12v12H2V2zm1 1v3h3V3H3zm4 0v3h6V3H7zM3 7v6h3V7H3zm4 0v6h6V7H7zm1 2h4v1H8V9zm0 2h3v1H8v-1z"})}),deleteRow:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("path",{d:"M2 3h12v2H2V3zm0 4h12v6H2V7zm3 1h6v1.5H5V8.5z"}),g.jsx("path",{d:"M4.5 10.5h7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),deleteColumn:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 2h4v12H2V2zm5 0h7v12H7V2zm1.5 5.5h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),mergeCells:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("path",{d:"M2 2h5v5H2V2zm7 0h5v5H9V2zM2 9h12v5H2V9z"}),g.jsx("path",{d:"M6 4.5h4",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round"})]}),splitCell:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("path",{d:"M2 2h12v12H2V2zm5 0v12"}),g.jsx("path",{d:"M8 2v12",stroke:"#fff",strokeWidth:"1.5"})]}),headerRow:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("path",{d:"M2 2h12v3H2V2zm0 4h12v2H2V6zm0 3h12v2H2V9zm0 3h12v2H2v-2z"}),g.jsx("rect",{x:"2",y:"2",width:"12",height:"3",fill:"currentColor",opacity:"0.4"})]}),headerColumn:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("path",{d:"M2 2h12v12H2V2zm0 0h2.5v12H2V2zm5 0h2.5v12H7V2zm5 0h2v12h-2V2z"}),g.jsx("rect",{x:"2",y:"2",width:"2.5",height:"12",fill:"currentColor",opacity:"0.4"})]}),fixTable:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("path",{d:"M13.5 2.5l1 1-11 11-1-1 11-11z"}),g.jsx("path",{d:"M2 2h12v12H2V2zm1 1v10h10V3H3z",fill:"none",stroke:"currentColor",strokeWidth:"1"})]}),graph:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 2h1.5v10.5H14V14H2V2zm2 8.5 2.2-2.8 2 1.8 3.3-4.2 1.2.9-4.2 5.3-2-1.8-1.7 2.1L4 10.5z"})}),horizontalRule:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("rect",{x:"1",y:"7",width:"14",height:"2",rx:"1"})}),blockquote:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M3 3h4v4l-2 5H3l2-5H3V3zm6 0h4v4l-2 5H9l2-5H9V3z"})}),codeBlock:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M5.7 11.3l-1.4 1.4L0 8l4.3-4.7 1.4 1.4L2.8 8l2.9 3.3zm4.6 0l1.4 1.4L16 8l-4.3-4.7-1.4 1.4L13.2 8l-2.9 3.3z"})}),math:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 2l3 6-3 6h2.5l2-4 2 4H11l-3-6 3-6H8.5l-2 4-2-4H2zm9 0v2h4V2h-4zm0 5v2h4V7h-4zm0 5v2h4v-2h-4z"})}),undo:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M4 5h6a3 3 0 0 1 0 6H7v2h3a5 5 0 0 0 0-10H4V1L0 4.5 4 8V5z"})}),redo:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M12 5H6a3 3 0 0 0 0 6h3v2H6a5 5 0 0 1 0-10h6V1l4 3.5L12 8V5z"})}),chemistry:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M11 2h-1V1c0-.6-.4-1-1-1H7C6.4 0 6 .4 6 1v1H5c-.6 0-1 .4-1 1v1c0 .2.1.4.2.6L7 9.5v3.5c0 .6.4 1 1 1s1-.4 1-1V9.5l2.8-4.9c.1-.2.2-.4.2-.6V3c0-.6-.4-1-1-1zm-4 0V1h2v1H7zm1.5 6.5l-.5-.9-.5.9V13h1V8.5z"})}),download:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M8 11.5l-4-4h2.5V2h3v5.5H12L8 11.5zM2 13h12v1H2v-1z"})}),alignLeft:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3h12v1.5H2V3zm0 4h8v1.5H2V7zm0 4h12v1.5H2v-1.5zM2 11h6v1.5H2V11z"})}),alignCenter:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3h12v1.5H2V3zm3 4h6v1.5H5V7zm-3 4h12v1.5H2v-1.5zM5 11h6v1.5H5V11z"})}),alignRight:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3h12v1.5H2V3zm6 4h6v1.5H8V7zM2 11h12v1.5H2v-1.5zm6-4h6v1.5H8V7z"})}),alignJustify:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3h12v1.5H2V3zm0 4h12v1.5H2V7zm0 4h12v1.5H2v-1.5zm0 4h12v1.5H2v-1.5z"})}),indent:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3h12v1.5H2V3zm3 4h9v1.5H5V7zm3 4h6v1.5H8v-1.5zM2 11h12v1.5H2v-1.5zM2 7l3 2-3 2V7z"})}),outdent:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3h12v1.5H2V3zm3 4h9v1.5H5V7zm3 4h6v1.5H8v-1.5zM2 11h12v1.5H2v-1.5zM5 7l-3 2 3 2V7z"})}),highlight:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M3 2h4l4 4-4 4H3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm6 0l2 2 2-2-2-2-2 2zm-2 2l2 2 2-2-2-2-2 2z"})}),removeFormat:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("path",{d:"M2 2h12v1.5H2V2zm2 3h8v1.5H4V5zm2 3h4v1.5H6V8zm-4 3h12v1.5H2v-1.5zm2 3h8v1.5H4v-1.5z"}),g.jsx("path",{d:"M1 1l14 14",stroke:"currentColor",strokeWidth:"1.5"})]}),importDocx:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),g.jsx("polyline",{points:"14 2 14 8 20 8"}),g.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),g.jsx("polyline",{points:"9 15 12 12 15 15"})]}),tableDropdown:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M8 11l-4-4h8l-4 4z"})}),tableTemplates:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 2h5v5H2V2zm7 0h5v5H9V2zM2 9h5v5H2V9zm7 0h5v5H9V9z"})})},Et=(e,t,n,r,i)=>({id:e,icon:t,label:n,action:r,...i});function kue(e,t){const n=[];n.push({id:"undo",buttons:[Et("undo","undo","Undo (Ctrl+Z)",l=>l.chain().focus().undo().run(),{isDisabled:l=>!l.can().undo()}),Et("redo","redo","Redo (Ctrl+Y)",l=>l.chain().focus().redo().run(),{isDisabled:l=>!l.can().redo()})]}),e==="advanced"&&n.push({id:"font",buttons:[Et("fontFamily","bold","Font Family",t.fontFamily)]});const r=[Et("bold","bold","Bold (Ctrl+B)",l=>l.chain().focus().toggleBold().run(),{isActive:l=>l.isActive("bold")}),Et("italic","italic","Italic (Ctrl+I)",l=>l.chain().focus().toggleItalic().run(),{isActive:l=>l.isActive("italic")}),Et("underline","underline","Underline (Ctrl+U)",l=>l.chain().focus().toggleUnderline().run(),{isActive:l=>l.isActive("underline")})];e!=="olimpiade"&&r.push(Et("strike","strike","Strikethrough",l=>l.chain().focus().toggleStrike().run(),{isActive:l=>l.isActive("strike")}),Et("highlight","highlight","Highlight",l=>l.chain().focus().toggleHighlight().run(),{isActive:l=>l.isActive("highlight")})),n.push({id:"format",buttons:r}),e==="advanced"&&n.push({id:"script",buttons:[Et("superscript","superscript","Superscript",l=>l.chain().focus().toggleSuperscript().run(),{isActive:l=>l.isActive("superscript")}),Et("subscript","subscript","Subscript",l=>l.chain().focus().toggleSubscript().run(),{isActive:l=>l.isActive("subscript")})]}),e==="advanced"&&n.push({id:"color",buttons:[Et("textColor","bold","Text Color",t.textColor)]});const i=[Et("paragraph","paragraph","Paragraph",l=>l.chain().focus().setParagraph().run(),{isActive:l=>l.isActive("paragraph")}),Et("h1","h1","Heading 1",l=>l.chain().focus().toggleHeading({level:1}).run(),{isActive:l=>l.isActive("heading",{level:1})}),Et("h2","h2","Heading 2",l=>l.chain().focus().toggleHeading({level:2}).run(),{isActive:l=>l.isActive("heading",{level:2})})];e==="advanced"&&i.push(Et("h3","h3","Heading 3",l=>l.chain().focus().toggleHeading({level:3}).run(),{isActive:l=>l.isActive("heading",{level:3})}),Et("h4","h4","Heading 4",l=>l.chain().focus().toggleHeading({level:4}).run(),{isActive:l=>l.isActive("heading",{level:4})})),n.push({id:"heading",buttons:i});const a=[Et("bulletList","bulletList","Bullet List",l=>l.chain().focus().toggleBulletList().run(),{isActive:l=>l.isActive("bulletList")}),Et("orderedList","orderedList","Ordered List",l=>l.chain().focus().toggleOrderedList().run(),{isActive:l=>l.isActive("orderedList")})];e==="advanced"&&a.push(Et("taskList","taskList","Checklist",l=>l.chain().focus().toggleTaskList().run(),{isActive:l=>l.isActive("taskList")})),a.push(Et("outdent","outdent","Outdent",l=>l.chain().focus().outdent().run(),{isDisabled:l=>!l.can().outdent()}),Et("indent","indent","Indent",l=>l.chain().focus().indent().run(),{isDisabled:l=>!l.can().indent()})),n.push({id:"list",buttons:a}),e==="advanced"&&n.push({id:"align",buttons:[Et("alignLeft","alignLeft","Align Left",l=>l.chain().focus().setTextAlign("left").run(),{isActive:l=>l.isActive({textAlign:"left"})}),Et("alignCenter","alignCenter","Align Center",l=>l.chain().focus().setTextAlign("center").run(),{isActive:l=>l.isActive({textAlign:"center"})}),Et("alignRight","alignRight","Align Right",l=>l.chain().focus().setTextAlign("right").run(),{isActive:l=>l.isActive({textAlign:"right"})}),Et("alignJustify","alignJustify","Justify",l=>l.chain().focus().setTextAlign("justify").run(),{isActive:l=>l.isActive({textAlign:"justify"})})]}),e!=="olimpiade"&&n.push({id:"insert",buttons:[Et("link","link","Link",t.link,{isActive:l=>l.isActive("link")}),Et("image","image","Image",t.image),Et("table","table","Table",t.table),Et("graph","graph","Graph",t.graph)]}),e==="advanced"&&n.push({id:"block",buttons:[Et("horizontalRule","horizontalRule","Horizontal Rule",l=>l.chain().focus().setHorizontalRule().run()),Et("blockquote","blockquote","Blockquote",l=>l.chain().focus().toggleBlockquote().run(),{isActive:l=>l.isActive("blockquote")}),Et("codeBlock","codeBlock","Code Block",l=>l.chain().focus().toggleCodeBlock().run(),{isActive:l=>l.isActive("codeBlock")})]});const o=[Et("mathFormula","math","Math Formula",t.math)];e!=="basic"&&o.push(Et("chemistry","chemistry","Chemistry Formula",t.chemistry)),n.push({id:"math",buttons:o});const s=[Et("removeFormat","removeFormat","Remove Format",t.removeFormat)];return e==="advanced"&&s.push(Et("importDocx","importDocx","Import DOCX",t.importDocx)),n.push({id:"action",buttons:s}),n}const Oue=[{value:"Arial",label:"Arial"},{value:"Times New Roman",label:"Times New Roman"},{value:"Georgia",label:"Georgia"},{value:"Verdana",label:"Verdana"},{value:"Courier New",label:"Courier New"}],Mue={link:!1,insertTable:!1,cellProperties:!1,tableProperties:!1,tableTemplates:!1,image:!1,imageEdit:!1};function Iue(){const[e,t]=V.useState(Mue),[n,r]=V.useState({}),[i,a]=V.useState({}),[o,s]=V.useState(null),l=V.useCallback(d=>{t(p=>({...p,[d]:!0}))},[]),c=V.useCallback(d=>{t(p=>({...p,[d]:!1}))},[]),u=V.useCallback(d=>e[d],[e]);return{open:e,show:u,openDialog:l,closeDialog:c,cellData:n,setCellData:r,tableData:i,setTableData:a,imageEditData:o,setImageEditData:s}}const v2=V.memo(({isOpen:e,position:t,onClose:n,onAddRowBefore:r,onAddRowAfter:i,onDeleteRow:a,onAddColumnBefore:o,onAddColumnAfter:s,onDeleteColumn:l,onDeleteTable:c,onMergeCells:u,onSplitCell:d,onCellProperties:p,onTableProperties:h,onToggleHeaderRow:m,onToggleHeaderColumn:f,onFixTables:_})=>{const b=V.useCallback(v=>{v&&v(),n()},[n]),y=V.useMemo(()=>{if(!t)return{x:0,y:0};const v=typeof window<"u"?window.innerWidth:1280,E=typeof window<"u"?window.innerHeight:720;return{x:Math.min(t.x,v-260),y:Math.min(t.y,E-360)}},[t]);return!e||!t?null:g.jsxs(g.Fragment,{children:[g.jsx("button",{type:"button",className:"mtx-table-menu-overlay",onClick:n,"aria-label":"Close table menu"}),g.jsx("div",{className:"mtx-table-menu-dropdown",style:{left:y.x,top:y.y},children:g.jsxs("div",{className:"mtx-table-menu",onClick:v=>v.stopPropagation(),children:[g.jsxs("div",{className:"mtx-table-menu-group",children:[g.jsx("div",{className:"mtx-table-menu-label",children:"Rows"}),g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>b(r),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"⬆"}),g.jsx("span",{children:"Insert Row Above"})]}),g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>b(i),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"⬇"}),g.jsx("span",{children:"Insert Row Below"})]}),g.jsxs("button",{className:"mtx-table-menu-item mtx-table-menu-item--danger",onClick:()=>b(a),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"🗑"}),g.jsx("span",{children:"Delete Row"})]})]}),g.jsxs("div",{className:"mtx-table-menu-group",children:[g.jsx("div",{className:"mtx-table-menu-label",children:"Columns"}),g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>b(o),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"⬅"}),g.jsx("span",{children:"Insert Column Left"})]}),g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>b(s),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"➡"}),g.jsx("span",{children:"Insert Column Right"})]}),g.jsxs("button",{className:"mtx-table-menu-item mtx-table-menu-item--danger",onClick:()=>b(l),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"🗑"}),g.jsx("span",{children:"Delete Column"})]})]}),(u||d)&&g.jsxs("div",{className:"mtx-table-menu-group",children:[g.jsx("div",{className:"mtx-table-menu-label",children:"Cells"}),u&&g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>b(u),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"⊞"}),g.jsx("span",{children:"Merge Cells"})]}),d&&g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>b(d),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"⊟"}),g.jsx("span",{children:"Split Cell"})]})]}),(p||h)&&g.jsxs("div",{className:"mtx-table-menu-group",children:[g.jsx("div",{className:"mtx-table-menu-label",children:"Properties"}),p&&g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>b(p),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"⚙"}),g.jsx("span",{children:"Cell Properties"})]}),h&&g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>b(h),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"⚙"}),g.jsx("span",{children:"Table Properties"})]})]}),(m||f)&&g.jsxs("div",{className:"mtx-table-menu-group",children:[g.jsx("div",{className:"mtx-table-menu-label",children:"Headers"}),m&&g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>b(m),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"▤"}),g.jsx("span",{children:"Toggle Header Row"})]}),f&&g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>b(f),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"◫"}),g.jsx("span",{children:"Toggle Header Column"})]}),_&&g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>b(_),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"↻"}),g.jsx("span",{children:"Fix Table"})]})]}),g.jsxs("div",{className:"mtx-table-menu-group",children:[g.jsx("div",{className:"mtx-table-menu-label",children:"Danger Zone"}),g.jsxs("button",{className:"mtx-table-menu-item mtx-table-menu-item--danger",onClick:()=>b(c),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"🗑"}),g.jsx("span",{children:"Delete Table"})]})]})]})})]})});v2.displayName="TableMenu";const Rue=V.memo(function({isOpen:t,position:n,currentAlign:r,hasCustomPosition:i=!1,onClose:a,onSetAlign:o,onResetPosition:s,onCenterImage:l,onEditImage:c}){const u=V.useCallback(p=>{p==null||p(),a()},[a]),d=V.useMemo(()=>{if(!n)return{x:0,y:0};const p=typeof window<"u"?window.innerWidth:1280,h=typeof window<"u"?window.innerHeight:720;return{x:Math.min(n.x,p-240),y:Math.min(n.y,h-280)}},[n]);return!t||!n?null:g.jsxs(g.Fragment,{children:[g.jsx("button",{type:"button",className:"mtx-table-menu-overlay",onClick:a,"aria-label":"Close image menu"}),g.jsx("div",{className:"mtx-table-menu-dropdown",style:{left:d.x,top:d.y},children:g.jsxs("div",{className:"mtx-table-menu",onClick:p=>p.stopPropagation(),children:[g.jsxs("div",{className:"mtx-table-menu-group",children:[g.jsx("div",{className:"mtx-table-menu-label",children:"Text Wrapping"}),g.jsxs("button",{className:`mtx-table-menu-item ${r==="left"?"is-active":""}`,onClick:()=>u(()=>o("left")),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"◧"}),g.jsx("span",{children:"Wrap Left"})]}),g.jsxs("button",{className:`mtx-table-menu-item ${r==="center"?"is-active":""}`,onClick:()=>u(()=>o("center")),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"▣"}),g.jsx("span",{children:"Wrap Center"})]}),g.jsxs("button",{className:`mtx-table-menu-item ${r==="right"?"is-active":""}`,onClick:()=>u(()=>o("right")),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"◨"}),g.jsx("span",{children:"Wrap Right"})]}),g.jsxs("button",{className:`mtx-table-menu-item ${r==="full"?"is-active":""}`,onClick:()=>u(()=>o("full")),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"▤"}),g.jsx("span",{children:"Full Width"})]})]}),c&&g.jsxs("div",{className:"mtx-table-menu-group",children:[g.jsx("div",{className:"mtx-table-menu-label",children:"Image"}),s&&g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>u(s),disabled:!i,children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"↺"}),g.jsx("span",{children:"Reset Position"})]}),l&&g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>u(l),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"◎"}),g.jsx("span",{children:"Center & Reset"})]}),g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>u(c),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"✎"}),g.jsx("span",{children:"Edit Image"})]})]})]})})]})}),Lue=V.lazy(()=>Promise.resolve().then(()=>a$).then(e=>({default:e.LinkDialogImpl}))),Pue=V.lazy(()=>Promise.resolve().then(()=>s$).then(e=>({default:e.InsertTableDialogImpl}))),Bue=V.lazy(()=>Promise.resolve().then(()=>c$).then(e=>({default:e.CellPropertiesDialogImpl}))),Fue=V.lazy(()=>Promise.resolve().then(()=>d$).then(e=>({default:e.TablePropertiesDialogImpl}))),Uue=V.lazy(()=>Promise.resolve().then(()=>h$).then(e=>({default:e.TableTemplatesDialogImpl}))),zue=V.lazy(()=>Promise.resolve().then(()=>m$).then(e=>({default:e.ImageInsertDialog}))),E2=V.memo(function({icon:t,label:n,onClick:r,isActive:i,isDisabled:a,className:o}){return g.jsx("button",{type:"button",className:`mtx-toolbar-btn ${i?"is-active":""} ${o||""}`,onClick:r,disabled:a,"data-tooltip":n,"aria-label":n,children:t})});function x2(){return g.jsx("div",{className:"mtx-toolbar-divider"})}const n8=V.memo(({color:e,onChange:t,label:n,icon:r})=>{const i=V.useRef(null);return g.jsxs(g.Fragment,{children:[g.jsx("button",{type:"button",className:"mtx-toolbar-btn mtx-color-btn",onClick:()=>{var a;return(a=i.current)==null?void 0:a.click()},title:n,"aria-label":n,children:r}),g.jsx("input",{ref:i,type:"color",value:e,onChange:a=>t(a.target.value),className:"mtx-color-picker",style:{display:"none"}})]})}),$ue=V.memo(({value:e,onChange:t,options:n,label:r,className:i})=>g.jsx("select",{className:`mtx-toolbar-select ${i||""}`,value:e,onChange:a=>t(a.target.value),title:r,"aria-label":r,children:n.map(a=>g.jsx("option",{value:a.value,children:a.label},a.value))}));function Gue(e){var n;if(!e)return null;const t=e.state.selection.node;return((n=t==null?void 0:t.type)==null?void 0:n.name)==="image"?t.attrs||{}:e.state.selection.$from.parent.type.name==="image"?e.state.selection.$from.parent.attrs:null}const r8=V.memo(function({editor:t,toolbarMode:n,onInsertMath:r,onInsertBlockMath:i,onInsertImage:a,onEditImage:o,onSetImageAlign:s,onResetImagePosition:l,onImportDocx:c}){const[u,d]=V.useState("#000000"),[p,h]=V.useState("#fef08a"),[m,f]=V.useState("basic"),_=Iue(),[b,y]=V.useState(!1),[v,E]=V.useState(null),[T,S]=V.useState(!1),[w,M]=V.useState(null),P=n||m,z=!n,ee=V.useCallback(()=>_.openDialog("link"),[_]),O=V.useCallback(_e=>{if(!t)return;const{url:ve,text:Ue,target:Qe}=_e,rt=_e.title||void 0,un={href:ve,target:Qe||"_self",rel:Qe==="_blank"?"noopener noreferrer":void 0,title:rt};Ue?t.chain().focus().deleteSelection().insertContent(Ue).setLink(un).run():t.chain().focus().setLink(un).run(),_.closeDialog("link")},[t,_]),H=V.useCallback(()=>{t&&(t.chain().focus().unsetLink().run(),_.closeDialog("link"))},[t,_]),x=V.useCallback(()=>t?{url:t.getAttributes("link").href||"",text:t.state.selection.empty?"":t.state.doc.textBetween(t.state.selection.from,t.state.selection.to),title:t.getAttributes("link").title||"",target:t.getAttributes("link").target||"_blank"}:{},[t]),G=V.useCallback((_e,ve,Ue)=>{t&&t.chain().focus().insertTable({rows:_e,cols:ve,withHeaderRow:Ue}).run()},[t]),D=V.useCallback(()=>_.openDialog("insertTable"),[_]),A=V.useCallback(()=>{if(a){a();return}_.openDialog("image")},[a,_]),I=V.useCallback((_e,ve)=>{t&&(t.chain().focus().setImage({src:_e,alt:ve}).run(),_.closeDialog("image"))},[t,_]),B=V.useCallback(()=>{t&&t.chain().focus().insertContent({type:"graph",attrs:{formula:"sin(x)"}}).run()},[t]);V.useEffect(()=>{if(!t)return;const _e=Ue=>{const Qe=Ue,rt=Qe.target,Tt=rt.closest("figure.mtx-image-figure, .mtx-image-wrapper, img"),un=rt.closest("td, th");if(Tt){Qe.preventDefault(),Qe.stopPropagation();try{const dn=Tt.tagName==="IMG"?Tt:Tt.querySelector("img")||Tt,Xo=t.view.posAtDOM(dn,0);t.chain().focus().setNodeSelection(Xo).run()}catch(dn){so.warn("Cannot select image from context menu:",dn)}y(!1),M({x:Qe.clientX,y:Qe.clientY}),S(!0);return}un&&t.isActive("table")&&(Qe.preventDefault(),Qe.stopPropagation(),S(!1),E({x:Qe.clientX,y:Qe.clientY}),y(!0))},ve=t.view.dom;return ve.addEventListener("contextmenu",_e),()=>{ve.removeEventListener("contextmenu",_e)}},[t]);const $=V.useCallback(()=>{t==null||t.chain().focus().addRowBefore().run()},[t]),R=V.useCallback(()=>{t==null||t.chain().focus().addRowAfter().run()},[t]),L=V.useCallback(()=>{t==null||t.chain().focus().deleteRow().run()},[t]),J=V.useCallback(()=>{t==null||t.chain().focus().addColumnBefore().run()},[t]),se=V.useCallback(()=>{t==null||t.chain().focus().addColumnAfter().run()},[t]),ne=V.useCallback(()=>{t==null||t.chain().focus().deleteColumn().run()},[t]),ge=V.useCallback(()=>{t==null||t.chain().focus().deleteTable().run(),y(!1)},[t]),Ne=V.useCallback(_e=>{s==null||s(_e),S(!1)},[s]),Ae=V.useCallback(()=>{o==null||o(),S(!1)},[o]),be=V.useCallback(()=>{l==null||l(),S(!1)},[l]),Re=V.useCallback(()=>{s==null||s("center"),S(!1)},[s]),we=V.useCallback(()=>{if(!t)return;const _e=t.state.selection.$from.parent;if(_e.type.name!=="tableCell"&&_e.type.name!=="tableHeader")return;let ve=null;for(let Qe=t.state.selection.$from.depth;Qe>=0;Qe--){const rt=t.state.selection.$from.node(Qe);if(rt.type.name==="table"){const Tt=rt.attrs.colwidth;if(Array.isArray(Tt)&&Tt.length>0){const un=t.state.selection.$from.index(1);ve=Tt[un]??Tt[0]??null}break}}const Ue=_e.attrs.width||(typeof ve=="number"?`${ve}px`:"");_.setCellData({width:typeof Ue=="string"?Ue:Ue?String(Ue):"",backgroundColor:_e.attrs.backgroundColor||"",horizontalAlign:_e.attrs.textAlign||"left",verticalAlign:_e.attrs.verticalAlign||"top"}),y(!1),_.openDialog("cellProperties")},[t,_]),K=V.useCallback(_e=>{if(!t)return;const Ue=t.state.selection.$from.parent.type.name==="tableHeader"?"tableHeader":"tableCell";t.chain().focus().updateAttributes(Ue,{width:_e.width||null,backgroundColor:_e.backgroundColor||null,textAlign:_e.horizontalAlign||null,verticalAlign:_e.verticalAlign||null}).run()},[t]),ye=V.useCallback(()=>{if(t)try{t.chain().focus().mergeCells().run(),y(!1)}catch{}},[t]),N=V.useCallback(()=>{if(t)try{t.chain().focus().splitCell().run(),y(!1)}catch{}},[t]),X=V.useCallback(()=>{if(!t)return;const{state:_e}=t,{$from:ve}=_e.selection;for(let Ue=ve.depth;Ue>=0;Ue--){const Qe=ve.node(Ue);if(Qe.type.name==="table"){const rt=Qe.attrs.align||"left";_.setTableData({align:rt}),y(!1),_.openDialog("tableProperties");return}}},[t,_]),Y=V.useCallback(_e=>{t&&(t.chain().focus().updateAttributes("table",{align:_e.align}).run(),_.closeDialog("tableProperties"))},[t,_]),q=V.useCallback(()=>{t==null||t.chain().focus().toggleHeaderRow().run()},[t]),U=V.useCallback(()=>{t==null||t.chain().focus().toggleHeaderColumn().run()},[t]),Q=V.useCallback(()=>{t==null||t.chain().focus().fixTables().run()},[t]),me=V.useCallback(_e=>{!t||!t.isActive("table")||t.chain().focus().updateAttributes("table",{theme:_e.id}).run()},[t]),he=V.useCallback(_e=>{d(_e),t==null||t.chain().focus().setColor(_e).run()},[t]),le=V.useCallback(_e=>{h(_e),t==null||t.chain().focus().toggleHighlight({color:_e}).run()},[t]),Z=V.useCallback(()=>{t&&t.chain().focus().unsetBold().unsetItalic().unsetUnderline().unsetStrike().unsetSubscript().unsetSuperscript().unsetLink().unsetColor().unsetFontFamily().unsetHighlight().run()},[t]),ie=!!t&&t.isActive("table"),pe=Gue(t),ae=(pe==null?void 0:pe.align)||"center",oe=pe?Number(pe.offsetX||0)!==0||Number(pe.offsetY||0)!==0:!1;if(V.useEffect(()=>{!ie&&b&&y(!1)},[ie,b]),!t)return null;const fe=kue(P,{link:()=>ee(),image:()=>A(),table:()=>D(),graph:()=>B(),math:()=>r==null?void 0:r(),chemistry:()=>r==null?void 0:r("chem"),removeFormat:()=>Z(),importDocx:()=>c==null?void 0:c(),fontFamily:()=>{},textColor:()=>{}});return g.jsxs("div",{className:"mtx-toolbar",role:"toolbar","aria-label":"Editor toolbar",children:[z&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"mtx-toolbar-mode-switch",role:"group","aria-label":"Toolbar density",children:[g.jsx("button",{type:"button",className:`mtx-toolbar-mode-btn ${P==="basic"?"is-active":""}`,onClick:()=>f("basic"),"aria-pressed":P==="basic",children:"Basic"}),g.jsx("button",{type:"button",className:`mtx-toolbar-mode-btn ${P==="advanced"?"is-active":""}`,onClick:()=>f("advanced"),"aria-pressed":P==="advanced",children:"Advanced"}),g.jsx("button",{type:"button",className:`mtx-toolbar-mode-btn ${P==="olimpiade"?"is-active":""}`,onClick:()=>f("olimpiade"),"aria-pressed":P==="olimpiade",children:"Olimpiade"})]}),g.jsx(x2,{})]}),fe.map(_e=>g.jsxs(V.Fragment,{children:[g.jsx("div",{className:"mtx-toolbar-group",children:_e.buttons.map(ve=>{var Ue,Qe,rt;return ve.id==="fontFamily"?g.jsx($ue,{className:"mtx-font-select",value:t.getAttributes("textStyle").fontFamily||"Arial",onChange:Tt=>t.chain().focus().setFontFamily(Tt).run(),options:Oue,label:"Font Family"},ve.id):ve.id==="highlight"?g.jsxs(V.Fragment,{children:[g.jsx(E2,{icon:eh[ve.icon],label:ve.label,onClick:()=>ve.action(t),isActive:(Ue=ve.isActive)==null?void 0:Ue.call(ve,t)}),P!=="olimpiade"&&g.jsx(n8,{color:p,onChange:le,label:"Highlight Color",icon:g.jsx("span",{style:{width:"12px",height:"12px",background:p,borderRadius:"2px",display:"inline-block"}})})]},ve.id):ve.id==="textColor"?g.jsx(V.Fragment,{children:g.jsx(n8,{color:u,onChange:he,label:"Text Color",icon:g.jsx("span",{style:{width:"16px",height:"3px",background:u,display:"inline-block",borderRadius:"1px"}})})},ve.id):g.jsx(E2,{icon:eh[ve.icon],label:ve.label,onClick:()=>ve.action(t),isActive:(Qe=ve.isActive)==null?void 0:Qe.call(ve,t),isDisabled:(rt=ve.isDisabled)==null?void 0:rt.call(ve,t)},ve.id)})}),g.jsx(x2,{})]},_e.id)),P==="advanced"&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"mtx-toolbar-group",children:[g.jsx("button",{type:"button",className:"mtx-toolbar-btn mtx-toolbar-btn--dropdown",onClick:_e=>{if(!ie)return;const ve=_e.currentTarget.getBoundingClientRect();E({x:ve.left,y:ve.bottom+5}),y(!b)},title:"Table Operations","aria-label":"Table Operations",disabled:!ie,children:eh.tableDropdown}),g.jsx("button",{type:"button",className:"mtx-toolbar-btn",onClick:()=>ie&&_.openDialog("tableTemplates"),title:"Table Templates","aria-label":"Table Templates",disabled:!ie,children:eh.tableTemplates})]}),g.jsx(x2,{})]}),P==="olimpiade"&&i&&g.jsx(g.Fragment,{children:g.jsx("div",{className:"mtx-toolbar-group",children:g.jsx(E2,{icon:eh.math,label:"Block Math",onClick:i,className:"mtx-toolbar-btn--accent-secondary"})})}),_.open.link&&g.jsx(V.Suspense,{fallback:null,children:g.jsx(Lue,{isOpen:_.open.link,currentUrl:x().url,currentText:x().text,currentTarget:x().target,currentTitle:x().title,onInsert:O,onRemove:t!=null&&t.isActive("link")?H:void 0,onClose:()=>_.closeDialog("link")})}),_.open.insertTable&&g.jsx(V.Suspense,{fallback:null,children:g.jsx(Pue,{isOpen:_.open.insertTable,onInsert:G,onClose:()=>_.closeDialog("insertTable")})}),_.open.cellProperties&&g.jsx(V.Suspense,{fallback:null,children:g.jsx(Bue,{isOpen:_.open.cellProperties,initialData:_.cellData,onSave:K,onClose:()=>{_.closeDialog("cellProperties"),_.setCellData({})}})}),_.open.tableProperties&&g.jsx(V.Suspense,{fallback:null,children:g.jsx(Fue,{isOpen:_.open.tableProperties,initialData:_.tableData,onSave:Y,onClose:()=>{_.closeDialog("tableProperties"),_.setTableData({})}})}),_.open.tableTemplates&&g.jsx(V.Suspense,{fallback:null,children:g.jsx(Uue,{isOpen:_.open.tableTemplates,onSelect:me,onClose:()=>_.closeDialog("tableTemplates")})}),_.open.image&&g.jsx(V.Suspense,{fallback:null,children:g.jsx(zue,{isOpen:_.open.image,onClose:()=>_.closeDialog("image"),onInsert:I})}),g.jsx(v2,{isOpen:b,position:v||{x:200,y:300},onClose:()=>y(!1),onAddRowBefore:$,onAddRowAfter:R,onDeleteRow:L,onAddColumnBefore:J,onAddColumnAfter:se,onDeleteColumn:ne,onDeleteTable:ge,onCellProperties:we,onTableProperties:X,onMergeCells:ye,onSplitCell:N,onToggleHeaderRow:q,onToggleHeaderColumn:U,onFixTables:Q}),g.jsx(Rue,{isOpen:T,position:w||{x:200,y:300},currentAlign:ae,hasCustomPosition:oe,onClose:()=>S(!1),onSetAlign:Ne,onResetPosition:l?be:void 0,onCenterImage:s?Re:void 0,onEditImage:o?Ae:void 0})]})}),i8="mtx-math-toolbar-expanded-section",a8="mtx-math-toolbar-recent-items";function o8({label:e,latex:t,onClick:n,title:r,variant:i="default"}){return g.jsx("button",{type:"button",className:`mtx-math-btn ${i==="recent"?"mtx-math-btn--recent":""}`,onClick:()=>n(t),title:r,"data-tooltip":r,"aria-label":r,children:g.jsx("span",{className:"mtx-math-btn__label",children:e})})}const s8=[{label:"Basic",buttons:[{label:"x²",latex:"x^{2}",title:"Pangkat (Superscript)"},{label:"x₂",latex:"x_{2}",title:"Subscript / Index"},{label:"½",latex:"\\frac{a}{b}",title:"Pecahan (Fraction)"},{label:"√",latex:"\\sqrt{x}",title:"Akar kuadrat (Square Root)"},{label:"∛",latex:"\\sqrt[3]{x}",title:"Akar pangkat tiga"},{label:"π",latex:"\\pi",title:"Pi"},{label:"±",latex:"\\pm",title:"Plus minus"},{label:"×",latex:"\\times",title:"Perkalian"},{label:"÷",latex:"\\div",title:"Pembagian"}]},{label:"Relation",buttons:[{label:"=",latex:"=",title:"Sama dengan"},{label:"<",latex:"<",title:"Kurang dari"},{label:">",latex:">",title:"Lebih dari"},{label:"≠",latex:"\\neq",title:"Tidak sama dengan"},{label:"≤",latex:"\\leq",title:"Kurang dari atau sama dengan"},{label:"≥",latex:"\\geq",title:"Lebih dari atau sama dengan"},{label:"≈",latex:"\\approx",title:"Hampir sama dengan"},{label:"∞",latex:"\\infty",title:"Tak hingga (Infinity)"}]},{label:"Set",buttons:[{label:"∈",latex:"\\in",title:"Anggota himpunan"},{label:"∉",latex:"\\notin",title:"Bukan anggota himpunan"},{label:"∪",latex:"\\cup",title:"Union / Gabungan"},{label:"∩",latex:"\\cap",title:"Intersection / Irisan"}]},{label:"Calc",buttons:[{label:"Σ",latex:"\\sum_{i=1}^{n}",title:"Sigma / Penjumlahan"},{label:"∫",latex:"\\int_{a}^{b}",title:"Integral"},{label:"d/dx",latex:"\\frac{d}{dx}",title:"Turunan terhadap x"},{label:"lim",latex:"\\lim_{x \\to \\infty}",title:"Limit"},{label:"log",latex:"\\log_{b}(x)",title:"Logaritma"},{label:"sin",latex:"\\sin(x)",title:"Sinus"},{label:"cos",latex:"\\cos(x)",title:"Cosinus"},{label:"tan",latex:"\\tan(x)",title:"Tangen"}]},{label:"Structure",buttons:[{label:"vec",latex:"\\vec{v}",title:"Vektor"},{label:"hat",latex:"\\hat{x}",title:"Topi / Hat"},{label:"( )",latex:"\\left( \\right)",title:"Tanda kurung"},{label:"[ ]",latex:"\\left[ \\right]",title:"Kurung siku"},{label:"{ }",latex:"\\left\\{ \\right\\}",title:"Kurung kurawal"},{label:"|x|",latex:"\\left| x \\right|",title:"Nilai mutlak"},{label:"2x2",latex:"\\begin{bmatrix} a & b \\\\ c & d \\end{bmatrix}",title:"Matriks 2x2"},{label:"{x}",latex:"\\begin{cases} x_1 \\\\ x_2 \\end{cases}",title:"Piecewise / Cases"},{label:"Kimia",latex:"\\ce{#?}",title:"Rumus Kimia (ce)"}]}],Hue=[{label:"⊂",latex:"\\subset",title:"Subset"},{label:"⊃",latex:"\\supset",title:"Superset"},{label:"∅",latex:"\\emptyset",title:"Himpunan kosong"},{label:"∀",latex:"\\forall",title:"Untuk semua"},{label:"∃",latex:"\\exists",title:"Terdapat"}],que={label:"Greek",buttons:[{label:"α",latex:"\\alpha",title:"Alpha"},{label:"β",latex:"\\beta",title:"Beta"},{label:"γ",latex:"\\gamma",title:"Gamma"},{label:"δ",latex:"\\delta",title:"Delta"},{label:"θ",latex:"\\theta",title:"Theta"},{label:"λ",latex:"\\lambda",title:"Lambda"},{label:"μ",latex:"\\mu",title:"Mu"},{label:"π",latex:"\\pi",title:"Pi"},{label:"σ",latex:"\\sigma",title:"Sigma"},{label:"φ",latex:"\\phi",title:"Phi"},{label:"ω",latex:"\\omega",title:"Omega"}]},Wue=[{label:"Σ",latex:"\\sum_{i=1}^{n}",title:"Sigma / Penjumlahan"},{label:"∏",latex:"\\prod_{i=1}^{n}",title:"Produk"},{label:"∫",latex:"\\int_{a}^{b}",title:"Integral"},{label:"lim",latex:"\\lim_{x \\to \\infty}",title:"Limit"}];function Vue(e){return e.map(t=>t.label==="Set"?{...t,buttons:[...t.buttons,...Hue]}:t.label==="Structure"?{...t,buttons:[...t.buttons,...Wue]}:t).reduce((t,n)=>(t.push(n),n.label==="Set"&&t.push(que),t),[])}const Yue=Vue(s8),l8=6;function c8({onInsertLatex:e,onToggleSymbols:t,onToggleTemplates:n,mode:r="basic"}){const[i,a]=V.useState([]),[o,s]=V.useState("Basic"),[l,c]=V.useState(""),u=V.useMemo(()=>r==="olimpiade"?Yue:s8,[r]),d=V.useMemo(()=>u.flatMap(y=>y.buttons),[u]),p=V.useMemo(()=>new Map(d.map(y=>[y.latex,y])),[d]),h=V.useCallback(y=>{e(y),a(v=>[y,...v.filter(E=>E!==y)].slice(0,l8))},[e]),m=V.useMemo(()=>i.map(y=>p.get(y)).filter(y=>!!y),[p,i]),f=l.trim().toLowerCase(),_=V.useMemo(()=>f?u.map(y=>({...y,buttons:y.buttons.filter(v=>`${v.label} ${v.title} ${v.latex}`.toLowerCase().includes(f))})).filter(y=>y.buttons.length>0):u,[f,u]);V.useEffect(()=>{if(typeof window>"u")return;const y=window.localStorage.getItem(i8);y&&s(y);try{const v=window.localStorage.getItem(a8);if(v){const E=JSON.parse(v);Array.isArray(E)&&a(E.slice(0,l8))}}catch{}},[]),V.useEffect(()=>{typeof window>"u"||!o||window.localStorage.setItem(i8,o)},[o]),V.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(a8,JSON.stringify(i))},[i]),V.useEffect(()=>{f&&_.length>0&&s(_[0].label)},[_,f]);const b=V.useCallback(y=>{s(v=>v===y?"":y)},[]);return g.jsxs("div",{className:"mtx-math-toolbar",role:"toolbar","aria-label":"Math toolbar",children:[g.jsxs("div",{className:"mtx-math-toolbar__label",children:[g.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 2l3 6-3 6h2.5l2-4 2 4H11l-3-6 3-6H8.5l-2 4-2-4H2zm9 0v2h4V2h-4zm0 5v2h4V7h-4zm0 5v2h4v-2h-4z"})}),g.jsx("span",{children:"Math"})]}),g.jsx("div",{className:"mtx-math-toolbar__search-wrap",children:g.jsx("input",{type:"search",className:"mtx-math-toolbar__search",value:l,onChange:y=>c(y.target.value),placeholder:"Cari rumus...","aria-label":"Search math formulas"})}),g.jsxs("div",{className:"mtx-math-toolbar__buttons",children:[m.length>0&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"mtx-math-toolbar__section-label",children:"Recent"}),m.map(y=>g.jsx(o8,{label:y.label,latex:y.latex,onClick:h,title:`Terakhir dipakai: ${y.title}`,variant:"recent"},`recent-${y.latex}`)),g.jsx("div",{className:"mtx-math-toolbar__section-divider"})]}),_.map(y=>g.jsxs("div",{className:"mtx-math-toolbar__section",children:[g.jsxs("button",{type:"button",className:`mtx-math-toolbar__section-toggle ${o===y.label?"is-active":""}`,onClick:()=>b(y.label),"aria-expanded":o===y.label,"aria-label":`${y.label} group`,children:[g.jsx("span",{children:y.label}),g.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:g.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),o===y.label&&y.buttons.map(v=>g.jsx(o8,{label:v.label,latex:v.latex,onClick:h,title:v.title},v.latex))]},y.label)),f&&_.length===0&&g.jsx("div",{className:"mtx-math-toolbar__empty",children:"No formula matches your search."})]}),g.jsxs("div",{className:"mtx-math-toolbar__actions",children:[g.jsxs("button",{type:"button",className:"mtx-math-toolbar__action-btn",onClick:t,title:"Panel Simbol (α β γ)","data-tooltip":"Panel Simbol (α β γ)",children:[g.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M6.2 2C4.2 2 3 3.8 3 5.5S4.2 9 6.2 9c.8 0 1.5-.3 2-.7L6.7 13h2.1l1.1-3.2C10.7 11 12 12 13 12v-2c-.8 0-1.8-.7-2.2-1.7L12 4H9.9l-.7 2.3C8.7 4.4 7.7 2 6.2 2zm0 2c.9 0 1.5 1.1 1.5 1.5S7 7 6.2 7 4.8 6.2 4.8 5.5 5.3 4 6.2 4z"})}),g.jsx("span",{children:"Simbol"})]}),n&&g.jsxs("button",{type:"button",className:"mtx-math-toolbar__action-btn",onClick:n,title:"Template Rumus","data-tooltip":"Template Rumus",children:[g.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 2h5v5H2V2zm7 0h5v5H9V2zM2 9h5v5H2V9zm7 0h5v5H9V9zM3 3v3h3V3H3zm7 0v3h3V3h-3zM3 10v3h3v-3H3zm7 0v3h3v-3h-3z"})}),g.jsx("span",{children:"Template"})]})]})]})}const u8=[{name:"Huruf Yunani",symbols:[{char:"α",latex:"\\alpha",name:"alpha"},{char:"β",latex:"\\beta",name:"beta"},{char:"γ",latex:"\\gamma",name:"gamma"},{char:"δ",latex:"\\delta",name:"delta"},{char:"ε",latex:"\\epsilon",name:"epsilon"},{char:"ϑ",latex:"\\varepsilon",name:"varepsilon"},{char:"ζ",latex:"\\zeta",name:"zeta"},{char:"η",latex:"\\eta",name:"eta"},{char:"θ",latex:"\\theta",name:"theta"},{char:"λ",latex:"\\lambda",name:"lambda"},{char:"μ",latex:"\\mu",name:"mu"},{char:"π",latex:"\\pi",name:"pi"},{char:"σ",latex:"\\sigma",name:"sigma"},{char:"τ",latex:"\\tau",name:"tau"},{char:"φ",latex:"\\phi",name:"phi"},{char:"ω",latex:"\\omega",name:"omega"},{char:"Δ",latex:"\\Delta",name:"Delta"},{char:"Σ",latex:"\\Sigma",name:"Sigma"},{char:"Ω",latex:"\\Omega",name:"Omega"},{char:"Π",latex:"\\Pi",name:"Pi"},{char:"Φ",latex:"\\Phi",name:"Phi"}]},{name:"Operator",symbols:[{char:"±",latex:"\\pm",name:"plus minus"},{char:"∓",latex:"\\mp",name:"minus plus"},{char:"×",latex:"\\times",name:"kali"},{char:"÷",latex:"\\div",name:"bagi"},{char:"·",latex:"\\cdot",name:"dot"},{char:"∘",latex:"\\circ",name:"komposisi"},{char:"≠",latex:"\\neq",name:"tidak sama"},{char:"≈",latex:"\\approx",name:"kira-kira"},{char:"≡",latex:"\\equiv",name:"identik"},{char:"≤",latex:"\\leq",name:"kurang sama"},{char:"≥",latex:"\\geq",name:"lebih sama"},{char:"≪",latex:"\\ll",name:"jauh kurang"},{char:"≫",latex:"\\gg",name:"jauh lebih"},{char:"∝",latex:"\\propto",name:"sebanding"},{char:"∞",latex:"\\infty",name:"tak hingga"},{char:"∤",latex:"\\nmid",name:"tidak membagi"},{char:"⊕",latex:"\\oplus",name:"plus lingkaran"},{char:"⊗",latex:"\\otimes",name:"kali lingkaran"},{char:"⊖",latex:"\\ominus",name:"minus lingkaran"},{char:"∼",latex:"\\sim",name:"similar"},{char:"≃",latex:"\\simeq",name:"kira-kira sama"},{char:"⊥",latex:"\\perp",name:"tegak lurus"},{char:"∥",latex:"\\parallel",name:"sejajar"},{char:"∣",latex:"\\mid",name:"pembagi"}]},{name:"Himpunan",symbols:[{char:"∈",latex:"\\in",name:"anggota"},{char:"∉",latex:"\\notin",name:"bukan anggota"},{char:"⊂",latex:"\\subset",name:"subset"},{char:"⊃",latex:"\\supset",name:"superset"},{char:"⊆",latex:"\\subseteq",name:"subset sama"},{char:"∪",latex:"\\cup",name:"gabungan"},{char:"∩",latex:"\\cap",name:"irisan"},{char:"∖",latex:"\\setminus",name:"selisih"},{char:"∅",latex:"\\emptyset",name:"himpunan kosong"},{char:"ℕ",latex:"\\mathbb{N}",name:"bilangan asli"},{char:"ℤ",latex:"\\mathbb{Z}",name:"bilangan bulat"},{char:"ℝ",latex:"\\mathbb{R}",name:"bilangan real"},{char:"ℚ",latex:"\\mathbb{Q}",name:"bilangan rasional"},{char:"ℂ",latex:"\\mathbb{C}",name:"bilangan kompleks"}]},{name:"Panah",symbols:[{char:"→",latex:"\\to",name:"panah kanan"},{char:"←",latex:"\\leftarrow",name:"panah kiri"},{char:"↔",latex:"\\leftrightarrow",name:"panah dua arah"},{char:"⇒",latex:"\\Rightarrow",name:"implikasi"},{char:"⇐",latex:"\\Leftarrow",name:"implikasi balik"},{char:"⇔",latex:"\\Leftrightarrow",name:"biimplikasi"},{char:"↑",latex:"\\uparrow",name:"panah atas"},{char:"↓",latex:"\\downarrow",name:"panah bawah"}]},{name:"Logika & Kalkulus",symbols:[{char:"∀",latex:"\\forall",name:"untuk semua"},{char:"∃",latex:"\\exists",name:"ada"},{char:"¬",latex:"\\neg",name:"negasi"},{char:"∧",latex:"\\land",name:"konjungsi (dan)"},{char:"∨",latex:"\\lor",name:"disjungsi (atau)"},{char:"∂",latex:"\\partial",name:"parsial"},{char:"∇",latex:"\\nabla",name:"nabla"},{char:"∑",latex:"\\sum",name:"sigma"},{char:"∏",latex:"\\prod",name:"produk"},{char:"∫",latex:"\\int",name:"integral"},{char:"∬",latex:"\\iint",name:"integral ganda"},{char:"𝔼",latex:"\\mathbb{E}",name:"expected value"},{char:"𝒩",latex:"\\mathcal{N}",name:"caligraphic N"},{char:"â",latex:"\\widehat{x}",name:"widehat"},{char:"ã",latex:"\\widetilde{x}",name:"widetilde"},{char:"op",latex:"\\operatorname{#?}",name:"operator nama sendiri"}]}];function d8({onInsert:e,onClose:t}){const[n,r]=V.useState(""),i=V.useMemo(()=>{if(!n.trim())return u8;const a=n.toLowerCase();return u8.map(o=>({...o,symbols:o.symbols.filter(s=>s.name.toLowerCase().includes(a)||s.char.includes(a)||s.latex.toLowerCase().includes(a))})).filter(o=>o.symbols.length>0)},[n]);return g.jsxs("div",{className:"mtx-symbol-palette",role:"dialog","aria-label":"Symbol Palette",children:[g.jsxs("div",{className:"mtx-symbol-palette__header",children:[g.jsx("span",{className:"mtx-symbol-palette__title",children:"Simbol Matematika"}),g.jsx("button",{className:"mtx-symbol-palette__close",onClick:t,title:"Tutup","aria-label":"Tutup panel simbol",children:"×"})]}),g.jsx("input",{className:"mtx-symbol-palette__search",type:"text",placeholder:"Cari simbol... (cth: alpha, pi, integral)",value:n,onChange:a=>r(a.target.value),autoFocus:!0}),g.jsxs("div",{className:"mtx-symbol-palette__body",children:[i.length===0&&g.jsxs("div",{style:{padding:"20px",textAlign:"center",color:"#94a3b8",fontSize:"13px"},children:['Tidak ditemukan simbol untuk "',n,'"']}),i.map(a=>g.jsxs("div",{className:"mtx-symbol-palette__category",children:[g.jsx("div",{className:"mtx-symbol-palette__category-title",children:a.name}),g.jsx("div",{className:"mtx-symbol-palette__grid",children:a.symbols.map(o=>g.jsx("button",{className:"mtx-symbol-palette__item",onClick:()=>{e(o.latex),t()},title:`${o.name} (${o.latex})`,"aria-label":o.name,children:o.char},o.latex))})]},a.name))]})]})}/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */const{entries:p8,setPrototypeOf:h8,isFrozen:Kue,getPrototypeOf:Que,getOwnPropertyDescriptor:Xue}=Object;let{freeze:Mr,seal:Di,create:dg}=Object,{apply:S2,construct:T2}=typeof Reflect<"u"&&Reflect;Mr||(Mr=function(t){return t}),Di||(Di=function(t){return t}),S2||(S2=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];return t.apply(n,i)}),T2||(T2=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new t(...r)});const pg=Rr(Array.prototype.forEach),jue=Rr(Array.prototype.lastIndexOf),m8=Rr(Array.prototype.pop),th=Rr(Array.prototype.push),Zue=Rr(Array.prototype.splice),hg=Rr(String.prototype.toLowerCase),C2=Rr(String.prototype.toString),w2=Rr(String.prototype.match),nh=Rr(String.prototype.replace),Jue=Rr(String.prototype.indexOf),ede=Rr(String.prototype.trim),si=Rr(Object.prototype.hasOwnProperty),Ir=Rr(RegExp.prototype.test),rh=tde(TypeError);function Rr(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return S2(e,t,r)}}function tde(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return T2(e,n)}}function yt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:hg;h8&&h8(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const a=n(i);a!==i&&(Kue(t)||(t[r]=a),i=a)}e[i]=!0}return e}function nde(e){for(let t=0;t<e.length;t++)si(e,t)||(e[t]=null);return e}function Na(e){const t=dg(null);for(const[n,r]of p8(e))si(e,n)&&(Array.isArray(r)?t[n]=nde(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Na(r):t[n]=r);return t}function ih(e,t){for(;e!==null;){const r=Xue(e,t);if(r){if(r.get)return Rr(r.get);if(typeof r.value=="function")return Rr(r.value)}e=Que(e)}function n(){return null}return n}const f8=Mr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),D2=Mr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),A2=Mr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),rde=Mr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),N2=Mr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ide=Mr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),g8=Mr(["#text"]),_8=Mr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),k2=Mr(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),b8=Mr(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),mg=Mr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ade=Di(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ode=Di(/<%[\w\W]*|[\w\W]*%>/gm),sde=Di(/\$\{[\w\W]*/gm),lde=Di(/^data-[\-\w.\u00B7-\uFFFF]+$/),cde=Di(/^aria-[\-\w]+$/),y8=Di(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ude=Di(/^(?:\w+script|data):/i),dde=Di(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),v8=Di(/^html$/i),pde=Di(/^[a-z][.\w]*(-[.\w]+)+$/i);var E8=Object.freeze({__proto__:null,ARIA_ATTR:cde,ATTR_WHITESPACE:dde,CUSTOM_ELEMENT:pde,DATA_ATTR:lde,DOCTYPE_NAME:v8,ERB_EXPR:ode,IS_ALLOWED_URI:y8,IS_SCRIPT_OR_DATA:ude,MUSTACHE_EXPR:ade,TMPLIT_EXPR:sde});const ah={element:1,text:3,progressingInstruction:7,comment:8,document:9},hde=function(){return typeof window>"u"?null:window},mde=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const a="dompurify"+(r?"#"+r:"");try{return t.createPolicy(a,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},x8=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function S8(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:hde();const t=et=>S8(et);if(t.version="3.3.3",t.removed=[],!e||!e.document||e.document.nodeType!==ah.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:h}=e,m=l.prototype,f=ih(m,"cloneNode"),_=ih(m,"remove"),b=ih(m,"nextSibling"),y=ih(m,"childNodes"),v=ih(m,"parentNode");if(typeof o=="function"){const et=n.createElement("template");et.content&&et.content.ownerDocument&&(n=et.content.ownerDocument)}let E,T="";const{implementation:S,createNodeIterator:w,createDocumentFragment:M,getElementsByTagName:P}=n,{importNode:z}=r;let ee=x8();t.isSupported=typeof p8=="function"&&typeof v=="function"&&S&&S.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:O,ERB_EXPR:H,TMPLIT_EXPR:x,DATA_ATTR:G,ARIA_ATTR:D,IS_SCRIPT_OR_DATA:A,ATTR_WHITESPACE:I,CUSTOM_ELEMENT:B}=E8;let{IS_ALLOWED_URI:$}=E8,R=null;const L=yt({},[...f8,...D2,...A2,...N2,...g8]);let J=null;const se=yt({},[..._8,...k2,...b8,...mg]);let ne=Object.seal(dg(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ge=null,Ne=null;const Ae=Object.seal(dg(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let be=!0,Re=!0,we=!1,K=!0,ye=!1,N=!0,X=!1,Y=!1,q=!1,U=!1,Q=!1,me=!1,he=!0,le=!1;const Z="user-content-";let ie=!0,pe=!1,ae={},oe=null;const fe=yt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let _e=null;const ve=yt({},["audio","video","img","source","image","track"]);let Ue=null;const Qe=yt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),rt="http://www.w3.org/1998/Math/MathML",Tt="http://www.w3.org/2000/svg",un="http://www.w3.org/1999/xhtml";let dn=un,Xo=!1,ap=null;const ov=yt({},[rt,Tt,un],C2);let tu=yt({},["mi","mo","mn","ms","mtext"]),El=yt({},["annotation-xml"]);const xl=yt({},["title","style","font","a","script"]);let ha=null;const vV=["application/xhtml+xml","text/html"],EV="text/html";let kn=null,nu=null;const xV=n.createElement("form"),$D=function(ce){return ce instanceof RegExp||ce instanceof Function},sv=function(){let ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(nu&&nu===ce)){if((!ce||typeof ce!="object")&&(ce={}),ce=Na(ce),ha=vV.indexOf(ce.PARSER_MEDIA_TYPE)===-1?EV:ce.PARSER_MEDIA_TYPE,kn=ha==="application/xhtml+xml"?C2:hg,R=si(ce,"ALLOWED_TAGS")?yt({},ce.ALLOWED_TAGS,kn):L,J=si(ce,"ALLOWED_ATTR")?yt({},ce.ALLOWED_ATTR,kn):se,ap=si(ce,"ALLOWED_NAMESPACES")?yt({},ce.ALLOWED_NAMESPACES,C2):ov,Ue=si(ce,"ADD_URI_SAFE_ATTR")?yt(Na(Qe),ce.ADD_URI_SAFE_ATTR,kn):Qe,_e=si(ce,"ADD_DATA_URI_TAGS")?yt(Na(ve),ce.ADD_DATA_URI_TAGS,kn):ve,oe=si(ce,"FORBID_CONTENTS")?yt({},ce.FORBID_CONTENTS,kn):fe,ge=si(ce,"FORBID_TAGS")?yt({},ce.FORBID_TAGS,kn):Na({}),Ne=si(ce,"FORBID_ATTR")?yt({},ce.FORBID_ATTR,kn):Na({}),ae=si(ce,"USE_PROFILES")?ce.USE_PROFILES:!1,be=ce.ALLOW_ARIA_ATTR!==!1,Re=ce.ALLOW_DATA_ATTR!==!1,we=ce.ALLOW_UNKNOWN_PROTOCOLS||!1,K=ce.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ye=ce.SAFE_FOR_TEMPLATES||!1,N=ce.SAFE_FOR_XML!==!1,X=ce.WHOLE_DOCUMENT||!1,U=ce.RETURN_DOM||!1,Q=ce.RETURN_DOM_FRAGMENT||!1,me=ce.RETURN_TRUSTED_TYPE||!1,q=ce.FORCE_BODY||!1,he=ce.SANITIZE_DOM!==!1,le=ce.SANITIZE_NAMED_PROPS||!1,ie=ce.KEEP_CONTENT!==!1,pe=ce.IN_PLACE||!1,$=ce.ALLOWED_URI_REGEXP||y8,dn=ce.NAMESPACE||un,tu=ce.MATHML_TEXT_INTEGRATION_POINTS||tu,El=ce.HTML_INTEGRATION_POINTS||El,ne=ce.CUSTOM_ELEMENT_HANDLING||{},ce.CUSTOM_ELEMENT_HANDLING&&$D(ce.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ne.tagNameCheck=ce.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ce.CUSTOM_ELEMENT_HANDLING&&$D(ce.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ne.attributeNameCheck=ce.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ce.CUSTOM_ELEMENT_HANDLING&&typeof ce.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ne.allowCustomizedBuiltInElements=ce.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ye&&(Re=!1),Q&&(U=!0),ae&&(R=yt({},g8),J=dg(null),ae.html===!0&&(yt(R,f8),yt(J,_8)),ae.svg===!0&&(yt(R,D2),yt(J,k2),yt(J,mg)),ae.svgFilters===!0&&(yt(R,A2),yt(J,k2),yt(J,mg)),ae.mathMl===!0&&(yt(R,N2),yt(J,b8),yt(J,mg))),si(ce,"ADD_TAGS")||(Ae.tagCheck=null),si(ce,"ADD_ATTR")||(Ae.attributeCheck=null),ce.ADD_TAGS&&(typeof ce.ADD_TAGS=="function"?Ae.tagCheck=ce.ADD_TAGS:(R===L&&(R=Na(R)),yt(R,ce.ADD_TAGS,kn))),ce.ADD_ATTR&&(typeof ce.ADD_ATTR=="function"?Ae.attributeCheck=ce.ADD_ATTR:(J===se&&(J=Na(J)),yt(J,ce.ADD_ATTR,kn))),ce.ADD_URI_SAFE_ATTR&&yt(Ue,ce.ADD_URI_SAFE_ATTR,kn),ce.FORBID_CONTENTS&&(oe===fe&&(oe=Na(oe)),yt(oe,ce.FORBID_CONTENTS,kn)),ce.ADD_FORBID_CONTENTS&&(oe===fe&&(oe=Na(oe)),yt(oe,ce.ADD_FORBID_CONTENTS,kn)),ie&&(R["#text"]=!0),X&&yt(R,["html","head","body"]),R.table&&(yt(R,["tbody"]),delete ge.tbody),ce.TRUSTED_TYPES_POLICY){if(typeof ce.TRUSTED_TYPES_POLICY.createHTML!="function")throw rh('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ce.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw rh('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=ce.TRUSTED_TYPES_POLICY,T=E.createHTML("")}else E===void 0&&(E=mde(h,i)),E!==null&&typeof T=="string"&&(T=E.createHTML(""));Mr&&Mr(ce),nu=ce}},GD=yt({},[...D2,...A2,...rde]),HD=yt({},[...N2,...ide]),SV=function(ce){let Be=v(ce);(!Be||!Be.tagName)&&(Be={namespaceURI:dn,tagName:"template"});const je=hg(ce.tagName),nn=hg(Be.tagName);return ap[ce.namespaceURI]?ce.namespaceURI===Tt?Be.namespaceURI===un?je==="svg":Be.namespaceURI===rt?je==="svg"&&(nn==="annotation-xml"||tu[nn]):!!GD[je]:ce.namespaceURI===rt?Be.namespaceURI===un?je==="math":Be.namespaceURI===Tt?je==="math"&&El[nn]:!!HD[je]:ce.namespaceURI===un?Be.namespaceURI===Tt&&!El[nn]||Be.namespaceURI===rt&&!tu[nn]?!1:!HD[je]&&(xl[je]||!GD[je]):!!(ha==="application/xhtml+xml"&&ap[ce.namespaceURI]):!1},ma=function(ce){th(t.removed,{element:ce});try{v(ce).removeChild(ce)}catch{_(ce)}},Sl=function(ce,Be){try{th(t.removed,{attribute:Be.getAttributeNode(ce),from:Be})}catch{th(t.removed,{attribute:null,from:Be})}if(Be.removeAttribute(ce),ce==="is")if(U||Q)try{ma(Be)}catch{}else try{Be.setAttribute(ce,"")}catch{}},qD=function(ce){let Be=null,je=null;if(q)ce="<remove></remove>"+ce;else{const Cn=w2(ce,/^[\r\n\t ]+/);je=Cn&&Cn[0]}ha==="application/xhtml+xml"&&dn===un&&(ce='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ce+"</body></html>");const nn=E?E.createHTML(ce):ce;if(dn===un)try{Be=new p().parseFromString(nn,ha)}catch{}if(!Be||!Be.documentElement){Be=S.createDocument(dn,"template",null);try{Be.documentElement.innerHTML=Xo?T:nn}catch{}}const or=Be.body||Be.documentElement;return ce&&je&&or.insertBefore(n.createTextNode(je),or.childNodes[0]||null),dn===un?P.call(Be,X?"html":"body")[0]:X?Be.documentElement:or},WD=function(ce){return w.call(ce.ownerDocument||ce,ce,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},lv=function(ce){return ce instanceof d&&(typeof ce.nodeName!="string"||typeof ce.textContent!="string"||typeof ce.removeChild!="function"||!(ce.attributes instanceof u)||typeof ce.removeAttribute!="function"||typeof ce.setAttribute!="function"||typeof ce.namespaceURI!="string"||typeof ce.insertBefore!="function"||typeof ce.hasChildNodes!="function")},VD=function(ce){return typeof s=="function"&&ce instanceof s};function ja(et,ce,Be){pg(et,je=>{je.call(t,ce,Be,nu)})}const YD=function(ce){let Be=null;if(ja(ee.beforeSanitizeElements,ce,null),lv(ce))return ma(ce),!0;const je=kn(ce.nodeName);if(ja(ee.uponSanitizeElement,ce,{tagName:je,allowedTags:R}),N&&ce.hasChildNodes()&&!VD(ce.firstElementChild)&&Ir(/<[/\w!]/g,ce.innerHTML)&&Ir(/<[/\w!]/g,ce.textContent)||ce.nodeType===ah.progressingInstruction||N&&ce.nodeType===ah.comment&&Ir(/<[/\w]/g,ce.data))return ma(ce),!0;if(!(Ae.tagCheck instanceof Function&&Ae.tagCheck(je))&&(!R[je]||ge[je])){if(!ge[je]&&QD(je)&&(ne.tagNameCheck instanceof RegExp&&Ir(ne.tagNameCheck,je)||ne.tagNameCheck instanceof Function&&ne.tagNameCheck(je)))return!1;if(ie&&!oe[je]){const nn=v(ce)||ce.parentNode,or=y(ce)||ce.childNodes;if(or&&nn){const Cn=or.length;for(let Gr=Cn-1;Gr>=0;--Gr){const Za=f(or[Gr],!0);Za.__removalCount=(ce.__removalCount||0)+1,nn.insertBefore(Za,b(ce))}}}return ma(ce),!0}return ce instanceof l&&!SV(ce)||(je==="noscript"||je==="noembed"||je==="noframes")&&Ir(/<\/no(script|embed|frames)/i,ce.innerHTML)?(ma(ce),!0):(ye&&ce.nodeType===ah.text&&(Be=ce.textContent,pg([O,H,x],nn=>{Be=nh(Be,nn," ")}),ce.textContent!==Be&&(th(t.removed,{element:ce.cloneNode()}),ce.textContent=Be)),ja(ee.afterSanitizeElements,ce,null),!1)},KD=function(ce,Be,je){if(Ne[Be]||he&&(Be==="id"||Be==="name")&&(je in n||je in xV))return!1;if(!(Re&&!Ne[Be]&&Ir(G,Be))){if(!(be&&Ir(D,Be))){if(!(Ae.attributeCheck instanceof Function&&Ae.attributeCheck(Be,ce))){if(!J[Be]||Ne[Be]){if(!(QD(ce)&&(ne.tagNameCheck instanceof RegExp&&Ir(ne.tagNameCheck,ce)||ne.tagNameCheck instanceof Function&&ne.tagNameCheck(ce))&&(ne.attributeNameCheck instanceof RegExp&&Ir(ne.attributeNameCheck,Be)||ne.attributeNameCheck instanceof Function&&ne.attributeNameCheck(Be,ce))||Be==="is"&&ne.allowCustomizedBuiltInElements&&(ne.tagNameCheck instanceof RegExp&&Ir(ne.tagNameCheck,je)||ne.tagNameCheck instanceof Function&&ne.tagNameCheck(je))))return!1}else if(!Ue[Be]){if(!Ir($,nh(je,I,""))){if(!((Be==="src"||Be==="xlink:href"||Be==="href")&&ce!=="script"&&Jue(je,"data:")===0&&_e[ce])){if(!(we&&!Ir(A,nh(je,I,"")))){if(je)return!1}}}}}}}return!0},QD=function(ce){return ce!=="annotation-xml"&&w2(ce,B)},XD=function(ce){ja(ee.beforeSanitizeAttributes,ce,null);const{attributes:Be}=ce;if(!Be||lv(ce))return;const je={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:J,forceKeepAttr:void 0};let nn=Be.length;for(;nn--;){const or=Be[nn],{name:Cn,namespaceURI:Gr,value:Za}=or,ru=kn(Cn),cv=Za;let Qn=Cn==="value"?cv:ede(cv);if(je.attrName=ru,je.attrValue=Qn,je.keepAttr=!0,je.forceKeepAttr=void 0,ja(ee.uponSanitizeAttribute,ce,je),Qn=je.attrValue,le&&(ru==="id"||ru==="name")&&(Sl(Cn,ce),Qn=Z+Qn),N&&Ir(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Qn)){Sl(Cn,ce);continue}if(ru==="attributename"&&w2(Qn,"href")){Sl(Cn,ce);continue}if(je.forceKeepAttr)continue;if(!je.keepAttr){Sl(Cn,ce);continue}if(!K&&Ir(/\/>/i,Qn)){Sl(Cn,ce);continue}ye&&pg([O,H,x],ZD=>{Qn=nh(Qn,ZD," ")});const jD=kn(ce.nodeName);if(!KD(jD,ru,Qn)){Sl(Cn,ce);continue}if(E&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!Gr)switch(h.getAttributeType(jD,ru)){case"TrustedHTML":{Qn=E.createHTML(Qn);break}case"TrustedScriptURL":{Qn=E.createScriptURL(Qn);break}}if(Qn!==cv)try{Gr?ce.setAttributeNS(Gr,Cn,Qn):ce.setAttribute(Cn,Qn),lv(ce)?ma(ce):m8(t.removed)}catch{Sl(Cn,ce)}}ja(ee.afterSanitizeAttributes,ce,null)},TV=function et(ce){let Be=null;const je=WD(ce);for(ja(ee.beforeSanitizeShadowDOM,ce,null);Be=je.nextNode();)ja(ee.uponSanitizeShadowNode,Be,null),YD(Be),XD(Be),Be.content instanceof a&&et(Be.content);ja(ee.afterSanitizeShadowDOM,ce,null)};return t.sanitize=function(et){let ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Be=null,je=null,nn=null,or=null;if(Xo=!et,Xo&&(et="<!-->"),typeof et!="string"&&!VD(et))if(typeof et.toString=="function"){if(et=et.toString(),typeof et!="string")throw rh("dirty is not a string, aborting")}else throw rh("toString is not a function");if(!t.isSupported)return et;if(Y||sv(ce),t.removed=[],typeof et=="string"&&(pe=!1),pe){if(et.nodeName){const Za=kn(et.nodeName);if(!R[Za]||ge[Za])throw rh("root node is forbidden and cannot be sanitized in-place")}}else if(et instanceof s)Be=qD("<!---->"),je=Be.ownerDocument.importNode(et,!0),je.nodeType===ah.element&&je.nodeName==="BODY"||je.nodeName==="HTML"?Be=je:Be.appendChild(je);else{if(!U&&!ye&&!X&&et.indexOf("<")===-1)return E&&me?E.createHTML(et):et;if(Be=qD(et),!Be)return U?null:me?T:""}Be&&q&&ma(Be.firstChild);const Cn=WD(pe?et:Be);for(;nn=Cn.nextNode();)YD(nn),XD(nn),nn.content instanceof a&&TV(nn.content);if(pe)return et;if(U){if(Q)for(or=M.call(Be.ownerDocument);Be.firstChild;)or.appendChild(Be.firstChild);else or=Be;return(J.shadowroot||J.shadowrootmode)&&(or=z.call(r,or,!0)),or}let Gr=X?Be.outerHTML:Be.innerHTML;return X&&R["!doctype"]&&Be.ownerDocument&&Be.ownerDocument.doctype&&Be.ownerDocument.doctype.name&&Ir(v8,Be.ownerDocument.doctype.name)&&(Gr="<!DOCTYPE "+Be.ownerDocument.doctype.name+`>
402
+ please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:i}}qM.hasOwnProperty(n[0])&&!Qt[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',t),n=qM[n[0]]+n.slice(1));var a=bue.exec(n);a&&(n=n.substring(0,a.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var o;if(Qt[this.mode][n]){this.settings.strict&&this.mode==="math"&&Bx.includes(n)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',t);var s=Qt[this.mode][n].group,l=Yr.range(t),c;if(yce.hasOwnProperty(s)){var u=s;c={type:"atom",mode:this.mode,family:u,loc:l,text:n}}else c={type:s,mode:this.mode,loc:l,text:n};o=c}else if(n.charCodeAt(0)>=128)this.settings.strict&&(bO(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),o={type:"textord",mode:"text",loc:Yr.range(t),text:n};else return null;if(this.consume(),a)for(var d=0;d<a[0].length;d++){var p=a[0][d];if(!f2[p])throw new Fe("Unknown accent ' "+p+"'",t);var h=f2[p][this.mode]||f2[p].text;if(!h)throw new Fe("Accent "+p+" unsupported in "+this.mode+" mode",t);o={type:"accent",mode:this.mode,loc:Yr.range(t),label:h,isStretchy:!1,isShifty:!0,base:o}}return o}};WM.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var g2=function(t,n){if(!(typeof t=="string"||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new WM(t,n);delete r.gullet.macros.current["\\df@tag"];var i=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new Fe("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:r.subparse([new ji("\\df@tag")])}]}return i},VM=function(t,n,r){n.textContent="";var i=_2(t,r).toNode();n.appendChild(i)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),VM=function(){throw new Fe("KaTeX doesn't work in quirks mode.")});var Tue=function(t,n){var r=_2(t,n).toMarkup();return r},Cue=function(t,n){var r=new wx(n);return g2(t,r)},YM=function(t,n,r){if(r.throwOnError||!(t instanceof Fe))throw t;var i=Ie(["katex-error"],[new Ci(n)]);return i.setAttribute("title",t.toString()),i.setAttribute("style","color:"+r.errorColor),i},_2=function(t,n){var r=new wx(n);try{var i=g2(t,r);return Lce(i,t,r)}catch(a){return YM(a,t,r)}},wue=function(t,n){var r=new wx(n);try{var i=g2(t,r);return Pce(i,t,r)}catch(a){return YM(a,t,r)}},Due="0.16.33",Aue={Span:Kp,Anchor:Mx,SymbolNode:Ci,SvgNode:po,PathNode:Cs,LineNode:Ix},Jp={version:Due,render:VM,renderToString:Tue,ParseError:Fe,SETTINGS_SCHEMA:z0,__parse:Cue,__renderToDomTree:_2,__renderToHTMLTree:wue,__setFontMetrics:dce,__defineSymbol:C,__defineFunction:We,__defineMacro:W,__domTree:Aue};function KM(){return window.mathVirtualKeyboard}const Ct=()=>g.jsx("span",{className:"mt-ph"}),Ve=()=>g.jsx("span",{className:"mt-ph mt-ph--sm"}),ht=({t:e})=>g.jsx("span",{className:"mt-txt-icon",children:e}),b2=[{id:"frac",icon:"√▫·▫",tip:"Pecahan & Akar",rows:[[{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx(Ct,{})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx(Ct,{})})]}),latex:"\\frac{#?}{#?}",tip:"Pecahan"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx(Ct,{}),g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx(Ve,{})})]})]}),latex:"#?\\frac{#?}{#?}",tip:"Pecahan campuran"},{icon:g.jsxs("span",{className:"mt-icon-stack mt-icon-stack--lg",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx(Ct,{})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx(Ct,{})})]}),latex:"\\dfrac{#?}{#?}",tip:"Pecahan besar (display)"},{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx(Ct,{})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsxs("span",{className:"mt-icon-stack mt-icon-stack--sm",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx(Ve,{})})]})})]}),latex:"\\cfrac{#?}{\\cfrac{#?}{#?}}",tip:"Pecahan kontinu"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-icon-sqrt",children:"√"}),g.jsx("span",{className:"mt-icon-sqrt-bar",children:g.jsx(Ct,{})})]}),latex:"\\sqrt{#?}",tip:"Akar kuadrat"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("sup",{className:"mt-icon-idx",children:"3"}),g.jsx("span",{className:"mt-icon-sqrt",children:"√"}),g.jsx("span",{className:"mt-icon-sqrt-bar",children:g.jsx(Ct,{})})]}),latex:"\\sqrt[3]{#?}",tip:"Akar pangkat 3"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("sup",{className:"mt-icon-idx",children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-icon-sqrt",children:"√"}),g.jsx("span",{className:"mt-icon-sqrt-bar",children:g.jsx(Ct,{})})]}),latex:"\\sqrt[#?]{#?}",tip:"Akar pangkat n"}],[{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("sup",{children:g.jsx(Ve,{})})]}),latex:"#?^{#?}",tip:"Pangkat / Superscript"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("sub",{children:g.jsx(Ve,{})})]}),latex:"#?_{#?}",tip:"Subskrip"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("sub",{children:g.jsx(Ve,{})}),g.jsx("sup",{children:g.jsx(Ve,{})})]}),latex:"#?_{#?}^{#?}",tip:"Pangkat + subskrip"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("sup",{children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-sym",children:"log"})]}),latex:"{}^{#?}\\log(#?)",tip:"Logaritma basis a (Indo)"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"log"}),g.jsx("sub",{children:g.jsx(Ve,{})})]}),latex:"\\log_{#?}(#?)",tip:"Logaritma basis a (Intl)"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("sup",{children:"-1"})]}),latex:"#?^{-1}",tip:"Invers"},{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx(Ve,{})})]}),latex:"\\tfrac{#?}{#?}",tip:"Pecahan kecil (text)"}],[{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:"n"}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:"k"})]}),latex:"\\binom{#?}{#?}",tip:"Kombinasi (n choose k)"},{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:"1"}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx(Ct,{})})]}),latex:"\\frac{1}{#?}",tip:"Pecahan Unit"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-icon-sqrt",children:"√"}),g.jsx("span",{className:"mt-icon-sqrt-bar",children:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx(Ve,{})})]})})]}),latex:"\\sqrt{\\frac{#?}{#?}}",tip:"Akar dari pecahan"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx(Ct,{}),g.jsx("span",{className:"mt-icon-sqrt",children:"√"}),g.jsx("span",{className:"mt-icon-sqrt-bar",children:g.jsx(Ct,{})})]}),latex:"#?\\sqrt{#?}",tip:"Akar dengan koefisien"}],[{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("sup",{children:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:"1"}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:"2"})]})})]}),latex:"#?^{\\frac{1}{2}}",tip:"Pangkat 1/2 (√)"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("sup",{children:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:"1"}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:"3"})]})})]}),latex:"#?^{\\frac{1}{3}}",tip:"Pangkat 1/3 (³√)"},{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:"1"}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-icon-sqrt",children:"√"}),g.jsx("span",{className:"mt-icon-sqrt-bar",children:g.jsx(Ct,{})})]})})]}),latex:"\\frac{1}{\\sqrt{#?}}",tip:"Akar di penyebut"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-icon-sqrt",children:"√"}),g.jsx("span",{className:"mt-icon-sqrt-bar",children:g.jsx(Ct,{})}),g.jsx("span",{className:"mt-sym",children:"±"}),g.jsx("span",{className:"mt-icon-sqrt",children:"√"}),g.jsx("span",{className:"mt-icon-sqrt-bar",children:g.jsx(Ct,{})})]}),latex:"\\sqrt{#?} \\pm \\sqrt{#?}",tip:"Operasi akar"}],[{icon:g.jsx(ht,{t:"Rumus ABC"}),latex:"x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}",tip:"Rumus Kuadrat (ABC)",command:"formula"},{icon:g.jsx(ht,{t:"Pythagoras"}),latex:"a^2 + b^2 = c^2",tip:"Teorema Pythagoras",command:"formula"},{icon:g.jsx(ht,{t:"Diskriminan"}),latex:"D = b^2 - 4ac",tip:"Diskriminan",command:"formula"},{icon:g.jsx(ht,{t:"(a+b)²"}),latex:"(a+b)^2 = a^2 + 2ab + b^2",tip:"Kuadrat Sempurna",command:"formula"},{icon:g.jsx(ht,{t:"a²-b²"}),latex:"a^2 - b^2 = (a+b)(a-b)",tip:"Selisih Kuadrat",command:"formula"}]]},{id:"const",icon:"€ ∞",tip:"Konstanta & Spasi",rows:[[{icon:g.jsx("span",{className:"mt-sym-lg",children:"∞"}),latex:"\\infty",tip:"Tak hingga"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"π"}),latex:"\\pi",tip:"Pi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"e"}),latex:"e",tip:"Euler number"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"i"}),latex:"i",tip:"Unit imajiner"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"°"}),latex:"^{\\circ}",tip:"Derajat"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"%"}),latex:"\\%",tip:"Persen"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ℏ"}),latex:"\\hbar",tip:"H-bar (Planck)"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∂"}),latex:"\\partial",tip:"Parsial"}],[{icon:g.jsx("span",{className:"mt-sym-lg",children:"ℝ"}),latex:"\\mathbb{R}",tip:"Bilangan real"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ℕ"}),latex:"\\mathbb{N}",tip:"Bilangan asli"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ℤ"}),latex:"\\mathbb{Z}",tip:"Bilangan bulat"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ℚ"}),latex:"\\mathbb{Q}",tip:"Bilangan rasional"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ℂ"}),latex:"\\mathbb{C}",tip:"Bilangan kompleks"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∇"}),latex:"\\nabla",tip:"Nabla"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ℓ"}),latex:"\\ell",tip:"Script ℓ"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"‰"}),latex:"\\permil",tip:"Per mil"}],[{icon:g.jsx(ht,{t:"E=mc²"}),latex:"E = mc^2",tip:"Relativitas (Einstein)"},{icon:g.jsx(ht,{t:"F=ma"}),latex:"F = m a",tip:"Hukum Newton II"},{icon:g.jsx(ht,{t:"Induksi"}),latex:"B = \\frac{\\mu_0 I}{2\\pi r}",tip:"Medan Magnet"}]]},{id:"arrow",icon:"→ ·",tip:"Panah",rows:[[{icon:g.jsx("span",{className:"mt-sym-lg",children:"→"}),latex:"\\rightarrow",tip:"Panah kanan"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"←"}),latex:"\\leftarrow",tip:"Panah kiri"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"↑"}),latex:"\\uparrow",tip:"Panah atas"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"↓"}),latex:"\\downarrow",tip:"Panah bawah"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"↔"}),latex:"\\leftrightarrow",tip:"Panah dua arah"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⇒"}),latex:"\\Rightarrow",tip:"Implikasi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⇐"}),latex:"\\Leftarrow",tip:"Implikasi kiri"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⇔"}),latex:"\\Leftrightarrow",tip:"Bi-implikasi"}],[{icon:g.jsx("span",{className:"mt-sym-lg",children:"↦"}),latex:"\\mapsto",tip:"Maps to"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⟶"}),latex:"\\longrightarrow",tip:"Panah panjang"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⟵"}),latex:"\\longleftarrow",tip:"Panah panjang kiri"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⟹"}),latex:"\\Longrightarrow",tip:"Implikasi panjang"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⟺"}),latex:"\\Longleftrightarrow",tip:"Bi-implikasi panjang"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"↗"}),latex:"\\nearrow",tip:"Kanan atas"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"↘"}),latex:"\\searrow",tip:"Kanan bawah"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"↙"}),latex:"\\swarrow",tip:"Kiri bawah"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"↖"}),latex:"\\nwarrow",tip:"Kiri atas"}],[{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{style:{fontSize:"8px",marginBottom:-2},children:"□"}),g.jsx("span",{className:"mt-sym-lg",style:{lineHeight:.8},children:"→"})]}),latex:"\\xrightarrow{#?}",tip:"Panah Kanan (Atas)"},{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{style:{fontSize:"8px",marginBottom:-2},children:"□"}),g.jsx("span",{className:"mt-sym-lg",style:{lineHeight:.8},children:"←"})]}),latex:"\\xleftarrow{#?}",tip:"Panah Kiri (Atas)"},{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{style:{fontSize:"8px",marginBottom:-2},children:"□"}),g.jsx("span",{className:"mt-sym-lg",style:{lineHeight:.8},children:"→"}),g.jsx("span",{style:{fontSize:"8px",marginTop:-2},children:"□"})]}),latex:"\\xrightarrow[#?]{#?}",tip:"Panah Kanan (Atas+Bawah)"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⇀"}),latex:"\\rightharpoonup",tip:"Harpoon kanan"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⇁"}),latex:"\\rightharpoondown",tip:"Harpoon kanan bawah"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"↼"}),latex:"\\leftharpoonup",tip:"Harpoon kiri"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"↽"}),latex:"\\leftharpoondown",tip:"Harpoon kiri bawah"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⇌"}),latex:"\\rightleftharpoons",tip:"Kesetimbangan"}],[{icon:g.jsx(ht,{t:"f: A→B"}),latex:"f: A \\to B",tip:"Definisi Fungsi"},{icon:g.jsx(ht,{t:"x ↦ y"}),latex:"x \\mapsto f(x)",tip:"Pemetaan"},{icon:g.jsx(ht,{t:"v = u + at"}),latex:"v = u + at",tip:"GLBB 1"}]]},{id:"greek",icon:"α Ω",tip:"Huruf Yunani",rows:[[{icon:g.jsx("span",{className:"mt-sym-lg",children:"α"}),latex:"\\alpha",tip:"Alpha"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"β"}),latex:"\\beta",tip:"Beta"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"γ"}),latex:"\\gamma",tip:"Gamma"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"δ"}),latex:"\\delta",tip:"Delta"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ε"}),latex:"\\epsilon",tip:"Epsilon"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ζ"}),latex:"\\zeta",tip:"Zeta"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"η"}),latex:"\\eta",tip:"Eta"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"θ"}),latex:"\\theta",tip:"Theta"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ι"}),latex:"\\iota",tip:"Iota"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"κ"}),latex:"\\kappa",tip:"Kappa"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"λ"}),latex:"\\lambda",tip:"Lambda"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"μ"}),latex:"\\mu",tip:"Mu"}],[{icon:g.jsx("span",{className:"mt-sym-lg",children:"ν"}),latex:"\\nu",tip:"Nu"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ξ"}),latex:"\\xi",tip:"Xi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"π"}),latex:"\\pi",tip:"Pi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ρ"}),latex:"\\rho",tip:"Rho"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"σ"}),latex:"\\sigma",tip:"Sigma"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"τ"}),latex:"\\tau",tip:"Tau"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"φ"}),latex:"\\phi",tip:"Phi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"χ"}),latex:"\\chi",tip:"Chi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ψ"}),latex:"\\psi",tip:"Psi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ω"}),latex:"\\omega",tip:"Omega"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ϑ"}),latex:"\\vartheta",tip:"Vartheta"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"ϕ"}),latex:"\\varphi",tip:"Varphi"}],[{icon:g.jsx("span",{className:"mt-sym-lg",children:"Γ"}),latex:"\\Gamma",tip:"Gamma besar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"Δ"}),latex:"\\Delta",tip:"Delta besar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"Θ"}),latex:"\\Theta",tip:"Theta besar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"Λ"}),latex:"\\Lambda",tip:"Lambda besar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"Ξ"}),latex:"\\Xi",tip:"Xi besar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"Π"}),latex:"\\Pi",tip:"Pi besar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"Σ"}),latex:"\\Sigma",tip:"Sigma besar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"Υ"}),latex:"\\Upsilon",tip:"Upsilon besar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"Φ"}),latex:"\\Phi",tip:"Phi besar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"Ψ"}),latex:"\\Psi",tip:"Psi besar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"Ω"}),latex:"\\Omega",tip:"Omega besar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"υ"}),latex:"\\upsilon",tip:"Upsilon"}],[{icon:g.jsx(ht,{t:"Area O"}),latex:"A = \\pi r^2",tip:"Luas Lingkaran"},{icon:g.jsx(ht,{t:"2πr"}),latex:"K = 2 \\pi r",tip:"Keliling Lingkaran"},{icon:g.jsx(ht,{t:"Vol Bola"}),latex:"V = \\frac{4}{3} \\pi r^3",tip:"Volume Bola"}]]},{id:"matrix",icon:"[▫▫]",tip:"Matriks",rows:[[{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak",children:"("}),g.jsxs("span",{className:"mt-icon-grid",children:[g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]}),g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]})]}),g.jsx("span",{className:"mt-brak",children:")"})]}),latex:"\\begin{pmatrix} #? & #? \\\\ #? & #? \\end{pmatrix}",tip:"Matriks 2×2"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak",children:"("}),g.jsxs("span",{className:"mt-icon-grid",children:[g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{}),g.jsx(Ve,{})]}),g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{}),g.jsx(Ve,{})]}),g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{}),g.jsx(Ve,{})]})]}),g.jsx("span",{className:"mt-brak",children:")"})]}),latex:"\\begin{pmatrix} #? & #? & #? \\\\ #? & #? & #? \\\\ #? & #? & #? \\end{pmatrix}",tip:"Matriks 3×3"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak",children:"["}),g.jsxs("span",{className:"mt-icon-grid",children:[g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]}),g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]})]}),g.jsx("span",{className:"mt-brak",children:"]"})]}),latex:"\\begin{bmatrix} #? & #? \\\\ #? & #? \\end{bmatrix}",tip:"Bracket matrix 2×2"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak",children:"["}),g.jsxs("span",{className:"mt-icon-grid",children:[g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{}),g.jsx(Ve,{})]}),g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{}),g.jsx(Ve,{})]}),g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{}),g.jsx(Ve,{})]})]}),g.jsx("span",{className:"mt-brak",children:"]"})]}),latex:"\\begin{bmatrix} #? & #? & #? \\\\ #? & #? & #? \\\\ #? & #? & #? \\end{bmatrix}",tip:"Bracket matrix 3×3"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak",children:"|"}),g.jsxs("span",{className:"mt-icon-grid",children:[g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]}),g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]})]}),g.jsx("span",{className:"mt-brak",children:"|"})]}),latex:"\\begin{vmatrix} #? & #? \\\\ #? & #? \\end{vmatrix}",tip:"Determinan 2×2"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak",children:"‖"}),g.jsxs("span",{className:"mt-icon-grid",children:[g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]}),g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]})]}),g.jsx("span",{className:"mt-brak",children:"‖"})]}),latex:"\\begin{Vmatrix} #? & #? \\\\ #? & #? \\end{Vmatrix}",tip:"Norm matrix 2×2"}],[{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak",children:"("}),g.jsxs("span",{className:"mt-icon-grid",children:[g.jsx("span",{className:"mt-icon-grid-row",children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-icon-grid-row",children:g.jsx(Ve,{})})]}),g.jsx("span",{className:"mt-brak",children:")"})]}),latex:"\\begin{pmatrix} #? \\\\ #? \\end{pmatrix}",tip:"Vektor kolom 2"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak",children:"("}),g.jsxs("span",{className:"mt-icon-grid",children:[g.jsx("span",{className:"mt-icon-grid-row",children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-icon-grid-row",children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-icon-grid-row",children:g.jsx(Ve,{})})]}),g.jsx("span",{className:"mt-brak",children:")"})]}),latex:"\\begin{pmatrix} #? \\\\ #? \\\\ #? \\end{pmatrix}",tip:"Vektor kolom 3"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak",children:"("}),g.jsx("span",{className:"mt-icon-grid",children:g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]})}),g.jsx("span",{className:"mt-brak",children:")"})]}),latex:"\\begin{pmatrix} #? & #? \\end{pmatrix}",tip:"Vektor baris 2"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak",children:"{"}),g.jsxs("span",{className:"mt-icon-grid",children:[g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]}),g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]})]})]}),latex:"\\begin{cases} #? & #? \\\\ #? & #? \\end{cases}",tip:"Kasus (2 baris)"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak",children:"{"}),g.jsxs("span",{className:"mt-icon-grid",children:[g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]}),g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]}),g.jsxs("span",{className:"mt-icon-grid-row",children:[g.jsx(Ve,{}),g.jsx(Ve,{})]})]})]}),latex:"\\begin{cases} #? & #? \\\\ #? & #? \\\\ #? & #? \\end{cases}",tip:"Kasus (3 baris)"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⋯ ⋮ ⋱"}),latex:"\\cdots \\quad \\vdots \\quad \\ddots",tip:"Dots (titik-titik)"}],[{icon:g.jsx("span",{className:"mt-txt-icon",children:"+R"}),command:"addRowAfter",tip:"Tambah Baris (Bawah)"},{icon:g.jsx("span",{className:"mt-txt-icon",children:"+C"}),command:"addColumnAfter",tip:"Tambah Kolom (Kanan)"},{icon:g.jsx("span",{className:"mt-txt-icon",children:"-R"}),command:"removeRow",tip:"Hapus Baris"},{icon:g.jsx("span",{className:"mt-txt-icon",children:"-C"}),command:"removeColumn",tip:"Hapus Kolom"}],[{icon:g.jsx(ht,{t:"Identitas"}),latex:"I = \\begin{pmatrix} 1 & 0 \\\\ 0 & 1 \\end{pmatrix}",tip:"Matriks Identitas 2x2"},{icon:g.jsx(ht,{t:"Determinan"}),latex:"\\det(A) = ad - bc",tip:"Determinan 2x2"}],[{icon:g.jsx(ht,{t:"Aligned"}),latex:"\\begin{aligned} #? &= #? \\\\ &= #? \\end{aligned}",tip:"Persamaan rata (aligned)"},{icon:g.jsx(ht,{t:"Gathered"}),latex:"\\begin{gathered} #? \\\\ #? \\end{gathered}",tip:"Persamaan terpusat (gathered)"},{icon:g.jsx(ht,{t:"Split"}),latex:"\\begin{split} #? &= #? \\\\ &= #? \\end{split}",tip:"Persamaan split"}]]},{id:"bracket",icon:"(▫) {▫}",tip:"Tanda Kurung",rows:[[{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"("}),g.jsx(Ct,{}),g.jsx("span",{className:"mt-brak mt-brak--lg",children:")"})]}),latex:"\\left( #? \\right)",tip:"Kurung biasa"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"["}),g.jsx(Ct,{}),g.jsx("span",{className:"mt-brak mt-brak--lg",children:"]"})]}),latex:"\\left[ #? \\right]",tip:"Kurung siku"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"{"}),g.jsx(Ct,{}),g.jsx("span",{className:"mt-brak mt-brak--lg",children:"}"})]}),latex:"\\left\\{ #? \\right\\}",tip:"Kurung kurawal"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"|"}),g.jsx(Ct,{}),g.jsx("span",{className:"mt-brak mt-brak--lg",children:"|"})]}),latex:"\\left| #? \\right|",tip:"Nilai mutlak"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"‖"}),g.jsx(Ct,{}),g.jsx("span",{className:"mt-brak mt-brak--lg",children:"‖"})]}),latex:"\\left\\| #? \\right\\|",tip:"Norm"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"⟨"}),g.jsx(Ct,{}),g.jsx("span",{className:"mt-brak mt-brak--lg",children:"⟩"})]}),latex:"\\langle #? \\rangle",tip:"Kurung sudut"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"⌊"}),g.jsx(Ct,{}),g.jsx("span",{className:"mt-brak mt-brak--lg",children:"⌋"})]}),latex:"\\lfloor #? \\rfloor",tip:"Floor"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"⌈"}),g.jsx(Ct,{}),g.jsx("span",{className:"mt-brak mt-brak--lg",children:"⌉"})]}),latex:"\\lceil #? \\rceil",tip:"Ceiling"}],[{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"("}),g.jsx(Ct,{}),g.jsx("span",{className:"mt-brak mt-brak--lg",children:"]"})]}),latex:"\\left( #? \\right]",tip:"Setengah terbuka kiri"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"["}),g.jsx(Ct,{}),g.jsx("span",{className:"mt-brak mt-brak--lg",children:")"})]}),latex:"\\left[ #? \\right)",tip:"Setengah terbuka kanan"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"("}),g.jsx(Ct,{})]}),latex:"\\left( #? \\right.",tip:"Kurung kiri saja"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx(Ct,{}),g.jsx("span",{className:"mt-brak mt-brak--lg",children:")"})]}),latex:"\\left. #? \\right)",tip:"Kurung kanan saja"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-brak mt-brak--lg",children:"{"}),g.jsx(Ct,{})]}),latex:"\\left\\{ #? \\right.",tip:"Kurawal kiri saja"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"‾"})]}),latex:"\\bar{#?}",tip:"Bar (rata-rata)"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"^"})]}),latex:"\\hat{#?}",tip:"Hat"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"→"})]}),latex:"\\vec{#?}",tip:"Vektor"}],[{icon:g.jsx(ht,{t:"{ x | ... }"}),latex:"\\{ x \\in \\mathbb{R} \\mid x > 0 \\}",tip:"Notasi Pembentuk Himpunan"},{icon:g.jsx(ht,{t:"[ a, b ]"}),latex:"[ a, b ] = \\{ x \\mid a \\le x \\le b \\}",tip:"Interval Tertutup"},{icon:g.jsx(ht,{t:"Binomial"}),latex:"\\binom{n}{k}",tip:"Koefisien Binomial"},{icon:g.jsx(ht,{t:"Bra-ket"}),latex:"\\bra{#?}\\ket{#?}",tip:"Bra-ket (Dirac)"},{icon:g.jsx(ht,{t:"Braket"}),latex:"\\braket{#?}{#?}",tip:"Braket (inner)"}]]},{id:"deco",icon:"x̄ x⃗",tip:"Aksen & Dekorasi",rows:[[{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"‾"})]}),latex:"\\bar{#?}",tip:"Bar"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"^"})]}),latex:"\\hat{#?}",tip:"Hat"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"→"})]}),latex:"\\vec{#?}",tip:"Vektor"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"~"})]}),latex:"\\tilde{#?}",tip:"Tilde"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"·"})]}),latex:"\\dot{#?}",tip:"Dot"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"··"})]}),latex:"\\ddot{#?}",tip:"Double dot"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"↔"})]}),latex:"\\overleftrightarrow{#?}",tip:"Panah dua arah di atas"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-under",children:"_"})]}),latex:"\\underline{#?}",tip:"Underline"}],[{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:g.jsx(Ct,{})}),g.jsx("span",{className:"mt-over",children:"‾‾"})]}),latex:"\\overline{#?}",tip:"Overline"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"˘"})]}),latex:"\\breve{#?}",tip:"Breve"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:"x"}),g.jsx("span",{className:"mt-over",children:"ˇ"})]}),latex:"\\check{#?}",tip:"Check"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:g.jsx(Ct,{})}),g.jsx("span",{className:"mt-over",children:"→"})]}),latex:"\\overrightarrow{#?}",tip:"Panah kanan di atas"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:g.jsx(Ct,{})}),g.jsx("span",{className:"mt-over",children:"⌢"})]}),latex:"\\widehat{#?}",tip:"Wide hat"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:g.jsx(Ct,{})}),g.jsx("span",{className:"mt-over",children:"~"})]}),latex:"\\widetilde{#?}",tip:"Wide tilde"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-over",children:"⏞"}),g.jsx("span",{className:"mt-sym",children:g.jsx(Ct,{})})]}),latex:"\\overbrace{#?}",tip:"Overbrace"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym",children:g.jsx(Ct,{})}),g.jsx("span",{className:"mt-under",children:"⏟"})]}),latex:"\\underbrace{#?}",tip:"Underbrace"}],[{icon:g.jsx(ht,{t:"Vektor Sum"}),latex:"\\vec{a} + \\vec{b} = \\vec{c}",tip:"Penjumlahan Vektor"},{icon:g.jsx(ht,{t:"Rata-rata"}),latex:"\\bar{x} = \\frac{1}{n} \\sum_{i=1}^n x_i",tip:"Rata-rata (Mean)"},{icon:g.jsx(ht,{t:"Estimasi"}),latex:"\\hat{y} = b_0 + b_1 x",tip:"Estimasi Regresi"}]]},{id:"sum",icon:"Σ ∪",tip:"Sigma, Produk, Himpunan",rows:[[{icon:g.jsx("span",{className:"mt-sym-xl",children:"Σ"}),latex:"\\sum #?",tip:"Sigma"},{icon:g.jsx("span",{className:"mt-icon-row",children:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("sup",{className:"mt-icon-idx",children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-sym-xl",children:"Σ"}),g.jsx("sub",{className:"mt-icon-idx",children:g.jsx(Ve,{})})]})}),latex:"\\sum_{#?}^{#?} #?",tip:"Sigma (batas)"},{icon:g.jsx("span",{className:"mt-sym-xl",children:"∏"}),latex:"\\prod #?",tip:"Produk"},{icon:g.jsx("span",{className:"mt-icon-row",children:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("sup",{className:"mt-icon-idx",children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-sym-xl",children:"∏"}),g.jsx("sub",{className:"mt-icon-idx",children:g.jsx(Ve,{})})]})}),latex:"\\prod_{#?}^{#?} #?",tip:"Produk (batas)"},{icon:g.jsx("span",{className:"mt-sym-xl",children:"∐"}),latex:"\\coprod_{#?}^{#?} #?",tip:"Koproduk"},{icon:g.jsx("span",{className:"mt-sym-xl",children:"⋂"}),latex:"\\bigcap_{#?}^{#?} #?",tip:"Irisan besar"}],[{icon:g.jsx("span",{className:"mt-sym-xl",children:"⋃"}),latex:"\\bigcup_{#?}^{#?} #?",tip:"Gabungan besar"},{icon:g.jsx("span",{className:"mt-sym-xl",children:"⋁"}),latex:"\\bigvee_{#?}^{#?} #?",tip:"Or besar"},{icon:g.jsx("span",{className:"mt-sym-xl",children:"⋀"}),latex:"\\bigwedge_{#?}^{#?} #?",tip:"And besar"},{icon:g.jsx("span",{className:"mt-sym-xl",children:"⨁"}),latex:"\\bigoplus_{#?}^{#?} #?",tip:"Plus langsung"},{icon:g.jsx("span",{className:"mt-sym-xl",children:"⨂"}),latex:"\\bigotimes_{#?}^{#?} #?",tip:"Tensor besar"},{icon:g.jsx("span",{className:"mt-sym-xl",children:"⨆"}),latex:"\\bigsqcup_{#?}^{#?} #?",tip:"Union persegi besar"}],[{icon:g.jsx(ht,{t:"Deret Ari"}),latex:"S_n = \\frac{n}{2}(a + U_n)",tip:"Deret Aritmatika"},{icon:g.jsx(ht,{t:"Deret Geo"}),latex:"S_\\infty = \\frac{a}{1-r}",tip:"Deret Geometri Tak Hingga"},{icon:g.jsx(ht,{t:"Sigma n"}),latex:"\\sum_{i=1}^n i = \\frac{n(n+1)}{2}",tip:"Jumlah n bilangan asli"}]]},{id:"calc",icon:"∫ lim",tip:"Integral & Kalkulus",rows:[[{icon:g.jsx("span",{className:"mt-sym-xl",children:"∫"}),latex:"\\int #?\\, d#?",tip:"Integral"},{icon:g.jsx("span",{className:"mt-icon-row",children:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("sup",{className:"mt-icon-idx",children:g.jsx(Ve,{})}),g.jsx("span",{className:"mt-sym-xl",children:"∫"}),g.jsx("sub",{className:"mt-icon-idx",children:g.jsx(Ve,{})})]})}),latex:"\\int_{#?}^{#?} #?\\, d#?",tip:"Integral tentu"},{icon:g.jsx("span",{className:"mt-sym-xl",children:"∬"}),latex:"\\iint_{#?} #?\\, dA",tip:"Integral ganda"},{icon:g.jsx("span",{className:"mt-sym-xl",children:"∭"}),latex:"\\iiint_{#?} #?\\, dV",tip:"Integral triple"},{icon:g.jsx("span",{className:"mt-sym-xl",children:"∮"}),latex:"\\oint_{#?} #?",tip:"Integral kontur"},{icon:g.jsx("span",{className:"mt-sym-fn",children:"lim"}),latex:"\\lim_{#? \\to #?} #?",tip:"Limit"}],[{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx("span",{className:"mt-sym-sm",children:"d"})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx("span",{className:"mt-sym-sm",children:"dx"})})]}),latex:"\\frac{d}{dx}",tip:"Turunan"},{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx("span",{className:"mt-sym-sm",children:"d²"})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx("span",{className:"mt-sym-sm",children:"dx²"})})]}),latex:"\\frac{d^2}{dx^2}",tip:"Turunan kedua"},{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx("span",{className:"mt-sym-sm",children:"∂"})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx("span",{className:"mt-sym-sm",children:"∂x"})})]}),latex:"\\frac{\\partial}{\\partial x}",tip:"Turunan parsial"},{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx("span",{className:"mt-sym-sm",children:"∂²"})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx("span",{className:"mt-sym-sm",children:"∂x²"})})]}),latex:"\\frac{\\partial^2}{\\partial x^2}",tip:"Turunan parsial kedua"},{icon:g.jsxs("span",{className:"mt-icon-stack",children:[g.jsx("span",{className:"mt-icon-num",children:g.jsx("span",{className:"mt-sym-sm",children:"dy"})}),g.jsx("span",{className:"mt-icon-bar"}),g.jsx("span",{className:"mt-icon-den",children:g.jsx("span",{className:"mt-sym-sm",children:"dx"})})]}),latex:"\\frac{dy}{dx}",tip:"dy/dx"},{icon:g.jsxs("span",{className:"mt-sym-fn",children:["f'(",g.jsx(Ct,{}),")"]}),latex:"f'(#?)",tip:"f prime"}],[{icon:g.jsx(ht,{t:"Int Tentu"}),latex:"\\int_a^b f(x) \\, dx",tip:"Integral Tentu"},{icon:g.jsx(ht,{t:"Limit Inf"}),latex:"\\lim_{x \\to \\infty} f(x)",tip:"Limit Tak Hingga"},{icon:g.jsx(ht,{t:"Turunan"}),latex:"\\frac{df}{dx} = \\lim_{h \\to 0} \\frac{f(x+h)-f(x)}{h}",tip:"Definisi Turunan"}]]},{id:"oper",icon:"= ≠ ≤",tip:"Operator & Relasi",rows:[[{icon:g.jsx("span",{className:"mt-sym-lg",children:"+"}),latex:"+",tip:"Tambah"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"−"}),latex:"-",tip:"Kurang"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"×"}),latex:"\\times",tip:"Kali"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"÷"}),latex:"\\div",tip:"Bagi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"±"}),latex:"\\pm",tip:"Plus-minus"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∓"}),latex:"\\mp",tip:"Minus-plus"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"·"}),latex:"\\cdot",tip:"Dot"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∘"}),latex:"\\circ",tip:"Komposisi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"="}),latex:"=",tip:"Sama dengan"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"≠"}),latex:"\\neq",tip:"Tidak sama"}],[{icon:g.jsx("span",{className:"mt-sym-lg",children:"<"}),latex:"<",tip:"Kurang dari"},{icon:g.jsx("span",{className:"mt-sym-lg",children:">"}),latex:">",tip:"Lebih dari"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"≤"}),latex:"\\leq",tip:"Kurang/sama"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"≥"}),latex:"\\geq",tip:"Lebih/sama"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"≈"}),latex:"\\approx",tip:"Hampir sama"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"≡"}),latex:"\\equiv",tip:"Identik"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∈"}),latex:"\\in",tip:"Elemen dari"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∉"}),latex:"\\notin",tip:"Bukan elemen"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⊂"}),latex:"\\subset",tip:"Subset"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⊃"}),latex:"\\supset",tip:"Superset"}],[{icon:g.jsx("span",{className:"mt-sym-lg",children:"∪"}),latex:"\\cup",tip:"Gabungan"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∩"}),latex:"\\cap",tip:"Irisan"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∅"}),latex:"\\emptyset",tip:"Himpunan kosong"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∀"}),latex:"\\forall",tip:"Untuk semua"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∃"}),latex:"\\exists",tip:"Eksistensi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"¬"}),latex:"\\neg",tip:"Negasi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∧"}),latex:"\\wedge",tip:"AND"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∨"}),latex:"\\vee",tip:"OR"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∴"}),latex:"\\therefore",tip:"Maka"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∵"}),latex:"\\because",tip:"Karena"}],[{icon:g.jsx(ht,{t:"Mod"}),latex:"a \\equiv b \\pmod{n}",tip:"Modulo"},{icon:g.jsx(ht,{t:"For All"}),latex:"\\forall x \\in \\mathbb{R}",tip:"Untuk semua bilangan real"},{icon:g.jsx(ht,{t:"Exists"}),latex:"\\exists y \\text{ s.t. } y > x",tip:"Terdapat y sedemikian..."}]]},{id:"geom",icon:"∠ △",tip:"Geometri & Trigonometri",rows:[[{icon:g.jsx("span",{className:"mt-sym-lg",children:"∠"}),latex:"\\angle",tip:"Sudut"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"△"}),latex:"\\triangle",tip:"Segitiga"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⊥"}),latex:"\\perp",tip:"Tegak lurus"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∥"}),latex:"\\parallel",tip:"Sejajar"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"≅"}),latex:"\\cong",tip:"Kongruen"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"∼"}),latex:"\\sim",tip:"Sebangun"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"□"}),latex:"\\square",tip:"Persegi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⊙"}),latex:"\\odot",tip:"Titik pusat lingkaran"}],[{icon:g.jsx("span",{className:"mt-sym-fn",children:"sin"}),latex:"\\sin",tip:"Sinus"},{icon:g.jsx("span",{className:"mt-sym-fn",children:"cos"}),latex:"\\cos",tip:"Kosinus"},{icon:g.jsx("span",{className:"mt-sym-fn",children:"tan"}),latex:"\\tan",tip:"Tangen"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym-fn",children:"sin"}),g.jsx("sup",{children:"-1"})]}),latex:"\\sin^{-1}",tip:"Arcsin"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym-fn",children:"cos"}),g.jsx("sup",{children:"-1"})]}),latex:"\\cos^{-1}",tip:"Arccos"},{icon:g.jsxs("span",{className:"mt-icon-row",children:[g.jsx("span",{className:"mt-sym-fn",children:"tan"}),g.jsx("sup",{children:"-1"})]}),latex:"\\tan^{-1}",tip:"Arctan"},{icon:g.jsx("span",{className:"mt-sym-fn",children:"log"}),latex:"\\log",tip:"Logaritma"},{icon:g.jsx("span",{className:"mt-sym-fn",children:"ln"}),latex:"\\ln",tip:"Log natural"}],[{icon:g.jsx(ht,{t:"Identitas"}),latex:"\\sin^2 \\theta + \\cos^2 \\theta = 1",tip:"Identitas Trigonometri"},{icon:g.jsx(ht,{t:"Sin Rule"}),latex:"\\frac{a}{\\sin A} = \\frac{b}{\\sin B} = \\frac{c}{\\sin C}",tip:"Aturan Sinus"},{icon:g.jsx(ht,{t:"Cos Rule"}),latex:"c^2 = a^2 + b^2 - 2ab \\cos C",tip:"Aturan Cosinus"}]]},{id:"chem",icon:"🧪",tip:"Kimia (mhchem)",rows:[[{icon:g.jsx(ht,{t:"Insert ce"}),latex:"\\ce{#?}",tip:"Sisipkan Rumus Kimia (ce)"},{icon:g.jsx(ht,{t:"Reaksi"}),latex:"\\ce{#? -> #?}",tip:"Persamaan Reaksi"},{icon:g.jsx(ht,{t:"Keseimbangan"}),latex:"\\ce{#? <=> #?}",tip:"Kesetimbangan"},{icon:g.jsx(ht,{t:"Katalis"}),latex:"\\ce{#? ->[#?][#?] #?}",tip:"Reaksi dengan katalis"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"→"}),latex:"\\ce{->}",tip:"Panah Reaksi"},{icon:g.jsx("span",{className:"mt-sym-lg",children:"⇌"}),latex:"\\ce{<=>}",tip:"Panah Kesetimbangan"},{icon:g.jsx("span",{className:"mt-sym",children:"Δ"}),latex:"\\ce{^\\Delta}",tip:"Panah Panas"}],[{icon:g.jsx("span",{className:"mt-sym",children:"n"}),latex:"n",tip:"Jumlah mol (n)"},{icon:g.jsx("span",{className:"mt-sym",children:"M"}),latex:"M",tip:"Molaritas (M)"},{icon:g.jsx("span",{className:"mt-sym",children:"m"}),latex:"m",tip:"Molalitas (m)"},{icon:g.jsx("span",{className:"mt-sym",children:"V"}),latex:"V",tip:"Volume (V)"},{icon:g.jsx("span",{className:"mt-sym",children:"P"}),latex:"P",tip:"Tekanan (P)"},{icon:g.jsx("span",{className:"mt-sym",children:"R"}),latex:"R",tip:"Tetapan Gas (R)"},{icon:g.jsx("span",{className:"mt-sym",children:"ΔH"}),latex:"\\Delta H",tip:"Perubahan Entalpi"},{icon:g.jsx("span",{className:"mt-sym",children:"ΔG"}),latex:"\\Delta G",tip:"Energi Bebas Gibbs"},{icon:g.jsx("span",{className:"mt-sym",children:"S"}),latex:"\\Delta S",tip:"Entropi"}],[{icon:g.jsxs("span",{className:"mt-sym",children:["[H",g.jsx("sup",{children:"+"}),"]"]}),latex:"[\\ce{H+}]",tip:"Konsentrasi H+"},{icon:g.jsxs("span",{className:"mt-sym",children:["[OH",g.jsx("sup",{children:"-"}),"]"]}),latex:"[\\ce{OH-}]",tip:"Konsentrasi OH-"},{icon:g.jsxs("span",{className:"mt-sym",children:["K",g.jsx("sub",{children:"a"})]}),latex:"K_a",tip:"Tetapan Asam"},{icon:g.jsxs("span",{className:"mt-sym",children:["K",g.jsx("sub",{children:"b"})]}),latex:"K_b",tip:"Tetapan Basa"},{icon:g.jsxs("span",{className:"mt-sym",children:["K",g.jsx("sub",{children:"sp"})]}),latex:"K_{sp}",tip:"Hasil Kali Kelarutan"},{icon:g.jsxs("span",{className:"mt-sym",children:["SO",g.jsx("sub",{children:"4"}),g.jsx("sup",{children:"2-"})]}),latex:"\\ce{SO4^{2-}}",tip:"Sulfat"},{icon:g.jsxs("span",{className:"mt-sym",children:["NO",g.jsx("sub",{children:"3"}),g.jsx("sup",{children:"-"})]}),latex:"\\ce{NO3-}",tip:"Nitrat"},{icon:g.jsxs("span",{className:"mt-sym",children:["PO",g.jsx("sub",{children:"4"}),g.jsx("sup",{children:"3-"})]}),latex:"\\ce{PO4^{3-}}",tip:"Fosfat"},{icon:g.jsx("span",{className:"mt-sym",children:"+"}),latex:" + ",tip:"Tambah"}],[{icon:g.jsx("span",{className:"mt-sym",children:"H"}),latex:"\\ce{H}",tip:"Hidrogen"},{icon:g.jsx("span",{className:"mt-sym",children:"C"}),latex:"\\ce{C}",tip:"Karbon"},{icon:g.jsx("span",{className:"mt-sym",children:"O"}),latex:"\\ce{O}",tip:"Oksigen"},{icon:g.jsx("span",{className:"mt-sym",children:"N"}),latex:"\\ce{N}",tip:"Nitrogen"},{icon:g.jsx("span",{className:"mt-sym",children:"P"}),latex:"\\ce{P}",tip:"Fosfor"},{icon:g.jsx("span",{className:"mt-sym",children:"S"}),latex:"\\ce{S}",tip:"Sulfur"},{icon:g.jsx("span",{className:"mt-sym",children:"Cl"}),latex:"\\ce{Cl}",tip:"Klorin"},{icon:g.jsx("span",{className:"mt-sym",children:"Na"}),latex:"\\ce{Na}",tip:"Natrium"},{icon:g.jsx("span",{className:"mt-sym",children:"Mg"}),latex:"\\ce{Mg}",tip:"Magnesium"},{icon:g.jsx("span",{className:"mt-sym",children:"Al"}),latex:"\\ce{Al}",tip:"Aluminium"}],[{icon:g.jsx("span",{className:"mt-sym",children:"K"}),latex:"\\ce{K}",tip:"Kalium"},{icon:g.jsx("span",{className:"mt-sym",children:"Ca"}),latex:"\\ce{Ca}",tip:"Kalsium"},{icon:g.jsx("span",{className:"mt-sym",children:"Fe"}),latex:"\\ce{Fe}",tip:"Besi (Ferrum)"},{icon:g.jsx("span",{className:"mt-sym",children:"Cu"}),latex:"\\ce{Cu}",tip:"Tembaga (Cuprum)"},{icon:g.jsx("span",{className:"mt-sym",children:"Zn"}),latex:"\\ce{Zn}",tip:"Seng (Zincum)"},{icon:g.jsx("span",{className:"mt-sym",children:"Ag"}),latex:"\\ce{Ag}",tip:"Perak (Argentum)"},{icon:g.jsx("span",{className:"mt-sym",children:"Au"}),latex:"\\ce{Au}",tip:"Emas (Aurum)"},{icon:g.jsx("span",{className:"mt-sym",children:"Pb"}),latex:"\\ce{Pb}",tip:"Timbal (Plumbum)"},{icon:g.jsx("span",{className:"mt-sym",children:"I"}),latex:"\\ce{I}",tip:"Iodin"},{icon:g.jsx("span",{className:"mt-sym",children:"Br"}),latex:"\\ce{Br}",tip:"Bromin"}],[{icon:g.jsx("span",{className:"mt-sym",children:"COOH"}),latex:"COOH",tip:"Asam Karboksilat"},{icon:g.jsx("span",{className:"mt-sym",children:"OH"}),latex:"OH",tip:"Hidroksil / Alkohol"},{icon:g.jsxs("span",{className:"mt-sym",children:["NH",g.jsx("sub",{children:"2"})]}),latex:"NH2",tip:"Amida / Amina"},{icon:g.jsxs("span",{className:"mt-sym",children:["CH",g.jsx("sub",{children:"3"})]}),latex:"CH3",tip:"Metil"},{icon:g.jsx("span",{className:"mt-sym",children:"CHO"}),latex:"CHO",tip:"Aldehid"},{icon:g.jsx("span",{className:"mt-sym",children:"CO"}),latex:"CO",tip:"Keton"},{icon:g.jsxs("span",{className:"mt-sym",children:["C",g.jsx("sub",{children:"6"}),"H",g.jsx("sub",{children:"5"})]}),latex:"C6H5",tip:"Fenil (Benzena)"},{icon:g.jsx("span",{className:"mt-sym",children:"R-"}),latex:"R-",tip:"Gugus Alkil"}]]}];function QM({isOpen:e,onInsert:t,onClose:n,initialLatex:r="",initialTab:i="frac"}){const[a,o]=V.useState(r),[s,l]=V.useState(i),[c,u]=V.useState("inline"),[d,p]=V.useState(!0),[h,m]=V.useState(null),[f,_]=V.useState(null),b=V.useRef(null),y=V.useRef(null),[v,E]=V.useState({x:0,y:0}),T=V.useRef({x:0,y:0}),S=V.useRef({startX:0,startY:0,isDragging:!1});V.useEffect(()=>{if(!e||!y.current)return;let x=!1,G=null,D=null;p(!0),Promise.resolve().then(()=>r$).then(I=>{if(x)return;if(!y.current){x||p(!1);return}const B=I;B.MathfieldElement&&(B.MathfieldElement.mathVirtualKeyboardPolicy="manual",B.MathfieldElement.keypressSound={spacebar:null,return:null,delete:null,default:null},B.MathfieldElement.keypressVibration=!1,B.MathfieldElement.plonkSound=null);try{const R=KM();R&&(R.visible=!1)}catch{}const $=document.createElement("math-field");$.setAttribute("virtual-keyboard-mode","off"),$.setAttribute("math-virtual-keyboard-policy","manual"),$.mathVirtualKeyboardPolicy="manual",$.setAttribute("smart-mode","true"),$.setAttribute("smart-fence","true"),$.setAttribute("smart-superscript","true"),$.style.width="100%",$.style.minHeight="120px",$.style.fontSize="24px",$.style.padding="12px 16px",$.style.border="none",$.style.outline="none",$.style.background="transparent",$.style.fontFamily="'KaTeX_Main', 'KaTeX_Math', 'Times New Roman', serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', 'Amiri', 'Malgun Gothic', 'SimSun'",!x&&(r&&$.setAttribute("value",r),D={},D.input=R=>{const L=R.target;o(L.value),m(null)},D.focus=()=>{var R,L;try{(L=(R=KM())==null?void 0:R.hide)==null||L.call(R)}catch{}},D.paste=R=>{var ne,ge,Ne,Ae,be,Re;const L=(ne=R.clipboardData)==null?void 0:ne.items;if(!L)return;for(const we of L)if(we.type==="text/latex"){we.getAsString(K=>{var ye;R.preventDefault(),(ye=$.executeCommand)==null||ye.call($,["insert",K,{focus:!0}]),o($.value||"")});return}const J=(ge=R.clipboardData)==null?void 0:ge.getData("text/plain");if(J){const we=J.trim(),K=we.replace(/^\\\[\s*([\s\S]*?)\s*\\\]$/,"$1").replace(/^\\\(\s*([\s\S]*?)\s*\\\)$/,"$1").replace(/^\$\$\s*([\s\S]*?)\s*\$\$$/,"$1").replace(/^\$\s*([\s\S]*?)\s*\$$/,"$1");if(K!==we){R.preventDefault(),(Ne=$.executeCommand)==null||Ne.call($,["insert",K,{focus:!0}]),o($.value||"");return}}const se=(Ae=R.clipboardData)==null?void 0:Ae.getData("text/html");if(se){let we=se.match(/<annotation encoding="application\/x-tex">([\s\S]*?)<\/annotation>/);if(we||(we=se.match(/<annotation encoding="(?:math\/tex|text\/latex)">([\s\S]*?)<\/annotation>/)),we){R.preventDefault(),(be=$.executeCommand)==null||be.call($,["insert",we[1].trim(),{focus:!0}]),o($.value||"");return}const K=se.match(/<img[^>]*alt="([^"]*)"[^>]*>/i);if(K&&K[1]&&K[1].length>2&&/\\\w+/.test(K[1])){R.preventDefault(),(Re=$.executeCommand)==null||Re.call($,["insert",K[1].trim(),{focus:!0}]),o($.value||"");return}}for(const we of L)if(we.type==="text/mathml"||we.type==="application/mathml+xml")return},D.keydown=R=>{var J;const L=R;L.key===" "&&(L.preventDefault(),L.stopPropagation(),(J=$.executeCommand)==null||J.call($,["insert","\\,",{focus:!0}]),o($.value||""))},$.addEventListener("input",D.input),$.addEventListener("focus",D.focus),$.addEventListener("paste",D.paste),$.addEventListener("keydown",D.keydown),!x&&(y.current.innerHTML="",y.current.appendChild($),b.current=$,p(!1),G=setTimeout(()=>$.focus(),100)))}).catch(()=>{x||p(!1)});const A=y.current;return()=>{if(x=!0,G!==null&&clearTimeout(G),A&&D){const I=A.querySelector("math-field");I&&(D.input&&I.removeEventListener("input",D.input),D.focus&&I.removeEventListener("focus",D.focus),D.paste&&I.removeEventListener("paste",D.paste),D.keydown&&I.removeEventListener("keydown",D.keydown)),A.innerHTML=""}b.current=null}},[e]),V.useEffect(()=>{if(!a.trim()){_(null),m(null);return}const x=a.replace(/\\placeholder(\[.*?\])?\{([^}]*)\}/g,(G,D,A)=>A||"\\text{?}").replace(/\\placeholder/g,"\\text{?}");if(!x.trim()){_('<span style="color:#94a3b8">(kosong)</span>'),m(null);return}try{const G=Jp.renderToString(x,{throwOnError:!0,displayMode:c==="block"});_(G),m(null)}catch(G){_(null),m(G instanceof Error?G.message:"Invalid LaTeX")}},[a,c]);const w=V.useCallback(x=>{var D;if(!b.current)return;const G=b.current;x.command?(D=G.executeCommand)==null||D.call(G,x.command):x.latex&&(G.executeCommand?G.executeCommand(["insert",x.latex,{focus:!0}]):G.value=(G.value||"")+x.latex),o(G.value||""),G.focus()},[]),M=V.useCallback(x=>{var A;if(!b.current)return;const G=b.current,D=`\\text{\\class{mt-font-${x}}{#@}}`;(A=G.executeCommand)==null||A.call(G,["insert",D,{focus:!0}]),o(G.value||""),G.focus()},[]),P=V.useCallback(x=>{var D;if(!b.current)return;const G=b.current;(D=G.executeCommand)==null||D.call(G,["applyStyle",x]),o(G.value||""),G.focus()},[]),z=V.useCallback(()=>{a.trim()&&t(a),n()},[a,t,n]),ee=V.useCallback(x=>{x.key==="Escape"&&n()},[n]);V.useEffect(()=>{e||(o(""),l(i),E({x:0,y:0}))},[e,i]),V.useEffect(()=>{T.current=v},[v]);const O=V.useCallback(x=>{if(x.target.closest("button"))return;S.current={isDragging:!0,startX:x.clientX,startY:x.clientY};const G=T.current.x,D=T.current.y,A=B=>{if(!S.current.isDragging)return;const $=B.clientX-S.current.startX,R=B.clientY-S.current.startY;E({x:G+$,y:D+R})},I=()=>{S.current.isDragging=!1,document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",I)};document.addEventListener("mousemove",A),document.addEventListener("mouseup",I)},[]);if(!e)return null;const H=b2.find(x=>x.id===s)||b2[0];return g.jsx("div",{className:"mt-overlay",onClick:n,onKeyDown:ee,role:"dialog","aria-modal":"true","aria-label":"Equation Editor",children:g.jsx("div",{style:{transform:`translate(${v.x}px, ${v.y}px)`},onClick:x=>x.stopPropagation(),children:g.jsxs("div",{className:"mt-dialog",children:[g.jsxs("div",{className:"mt-titlebar",onMouseDown:O,style:{cursor:"move"},children:[g.jsxs("div",{className:"mt-titlebar__left",children:[g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",style:{opacity:.9},children:g.jsx("path",{d:"M2 2l3 6-3 6h2.5l2-4 2 4H11l-3-6 3-6H8.5l-2 4-2-4H2zm9 0v2h4V2h-4zm0 5v2h4V7h-4zm0 5v2h4v-2h-4z"})}),g.jsx("span",{className:"mt-titlebar__title",children:"MathTextX — Equation Editor"})]}),g.jsx("button",{className:"mt-titlebar__close",onClick:n,title:"Tutup (Esc)",children:g.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",children:g.jsx("path",{d:"M1 0L0 1l4 4-4 4 1 1 4-4 4 4 1-1-4-4 4-4-1-1-4 4z"})})})]}),g.jsxs("div",{className:"mt-format-bar",children:[g.jsxs("select",{className:"mt-font-select",onChange:x=>{x.target.value&&M(x.target.value),x.target.value=""},defaultValue:"",children:[g.jsx("option",{value:"",disabled:!0,children:"Pilih Font..."}),g.jsx("option",{value:"serif",children:"Roman (Serif)"}),g.jsx("option",{value:"sans",children:"Sans Serif (Arial)"}),g.jsx("option",{value:"mono",children:"Monospace (Courier)"}),g.jsx("option",{value:"arabic",children:"Arabic (Amiri)"}),g.jsx("option",{value:"cjk",children:"Chinese (SimSun)"}),g.jsx("option",{value:"korean",children:"Korean (Malgun)"})]}),g.jsx("div",{style:{fontSize:"11px",color:"#666",borderLeft:"1px solid #ccc",paddingLeft:"8px",marginRight:"8px"},children:"Font"}),g.jsxs("div",{className:"mt-format-group",children:[g.jsx("button",{className:"mt-format-btn",onClick:()=>P({fontWeight:"bold"}),title:"Bold","data-tooltip":"Bold",children:g.jsx("b",{children:"B"})}),g.jsx("button",{className:"mt-format-btn",onClick:()=>P({fontStyle:"italic"}),title:"Italic","data-tooltip":"Italic",children:g.jsx("i",{children:"I"})}),g.jsx("button",{className:"mt-format-btn",onClick:()=>{var G;const x=b.current;(G=x==null?void 0:x.executeCommand)==null||G.call(x,["insert","\\underline{#@}",{focus:!0}])},title:"Underline","data-tooltip":"Underline",children:g.jsx("u",{children:"U"})})]}),g.jsx("div",{className:"mt-format-group",children:g.jsx("input",{type:"color",className:"mt-color-picker",onChange:x=>P({color:x.target.value}),title:"Text Color"})})]}),g.jsx("div",{className:"mt-tab-bar",children:b2.map(x=>g.jsx("button",{className:`mt-tab ${s===x.id?"is-active":""}`,onClick:()=>l(x.id),title:x.tip,"data-tooltip":x.tip,children:g.jsx("span",{className:"mt-tab__icon",children:x.icon})},x.id))}),s==="matrix"&&g.jsx($le,{onInsert:x=>{var D;if(!b.current)return;const G=b.current;(D=G.executeCommand)==null||D.call(G,["insert",x,{focus:!0}]),o(G.value||""),G.focus()}}),g.jsx("div",{className:"mt-grid",children:H.rows.map((x,G)=>g.jsx("div",{className:"mt-grid__row",children:x.map((D,A)=>g.jsx("button",{className:`mt-grid__btn${D.command==="formula"?" mt-grid__btn--formula":""}`,onClick:()=>w(D),title:D.tip,"data-tooltip":D.tip,children:D.icon},A))},G))}),g.jsxs("div",{className:"mt-editor",children:[d&&g.jsxs("div",{className:"mt-loading",children:[g.jsx("div",{className:"mt-loading__spinner"}),g.jsx("span",{className:"mt-loading__text",children:"Memuat Equation Editor..."})]}),g.jsx("div",{className:"mt-editor__field",ref:y})]}),g.jsxs("div",{className:"mt-latex-bar",children:[g.jsxs("div",{className:"mt-latex-bar__row",children:[g.jsx("span",{className:"mt-latex-bar__label",children:"LaTeX:"}),g.jsx("code",{className:"mt-latex-bar__code",children:a||"(ketik atau klik tombol di atas)"})]}),f&&g.jsx("div",{className:"mt-latex-bar__preview",dangerouslySetInnerHTML:{__html:f}}),h&&g.jsx("div",{className:"mt-latex-bar__error",children:h})]}),g.jsxs("div",{className:"mt-actions",children:[g.jsxs("div",{className:"mt-actions__hint",children:[g.jsx("button",{type:"button",className:`mt-display-mode-toggle ${c==="block"?"is-block":""}`,onClick:()=>u(x=>x==="inline"?"block":"inline"),title:c==="inline"?"Saat ini: Inline (klik untuk Block)":"Saat ini: Block (klik untuk Inline)","aria-pressed":c==="block",children:g.jsx("span",{className:"mt-display-mode-toggle__label",children:c==="inline"?"📝 Inline":"📐 Block"})}),g.jsx("kbd",{children:"Esc"})," tutup  ·  Klik tombol ",g.jsx("b",{children:"Sisipkan"})," untuk menyimpan"]}),g.jsxs("div",{className:"mt-actions__buttons",children:[g.jsx("button",{className:"mt-actions__cancel",onClick:n,children:"Batal"}),g.jsx("button",{className:"mt-actions__insert",onClick:z,disabled:!a.trim(),children:"✓ Sisipkan"})]})]})]})})})}let y2=null,XM=!1;function jM(){return y2||(y2=Promise.resolve().then(()=>r$).then(e=>{const t=window.MATHLIVE_FONTS_PATH||"/fonts";return e.MathfieldElement&&(e.MathfieldElement.fontsDirectory=t),e})),y2}async function Nue(){if(!XM)try{const e=await jM(),t=window.MATHLIVE_FONTS_PATH||"/fonts";e.loadFonts&&(await e.loadFonts({fontsDirectory:t}),XM=!0)}catch(e){so.warn("MathLive fonts could not be loaded:",e)}}function ZM(){return window.mathVirtualKeyboard}function JM(e){const t=V.useRef(null),n=V.useRef(null),[r,i]=V.useState(!1),[a,o]=V.useState(!1),[s,l]=V.useState(!1),c=e.node.attrs.display==="block",u=a&&!s,d=V.useCallback(()=>{i(!0)},[]),p=V.useCallback(()=>{i(!1),o(!1),l(!1)},[]),h=V.useCallback(m=>{e.updateAttributes({latex:m}),i(!1),o(!1),l(!1)},[e]);return V.useEffect(()=>{if(!t.current)return;const m=t.current;let f=!1;const _=[];let b=null,y=null;async function v(){await Nue();const E=await jM();if(!f){E.MathfieldElement&&(E.MathfieldElement.keypressVibration=!1,E.MathfieldElement.keypressSound={spacebar:null,return:null,delete:null,default:null},E.MathfieldElement.plonkSound=null,E.MathfieldElement.mathVirtualKeyboardPolicy="manual");try{const T=ZM();T&&(T.visible=!1)}catch{}if(!f&&(y=document.createElement("math-field"),y.setAttribute("virtual-keyboard-mode","off"),y.setAttribute("math-virtual-keyboard-policy","manual"),y.mathVirtualKeyboardPolicy="manual",y.setAttribute("smart-mode","true"),y.setAttribute("smart-fence","true"),y.setAttribute("smart-superscript","true"),e.node.attrs.latex&&y.setAttribute("value",e.node.attrs.latex),b={},b.input=T=>{const S=T.target;e.updateAttributes({latex:S.value})},b.focus=()=>{var T,S;l(!0);try{(S=(T=ZM())==null?void 0:T.hide)==null||S.call(T)}catch{}},b.blur=()=>{l(!1)},b.keydown=T=>{var ee;const S=T;if(S.key===" "){S.preventDefault(),S.stopPropagation(),(ee=y==null?void 0:y.executeCommand)==null||ee.call(y,["insert","\\,",{focus:!0}]);return}if(S.key!=="Enter")return;S.preventDefault(),S.stopPropagation();let w;try{w=e.getPos()}catch{return}const{editor:M}=e,P=w+e.node.nodeSize,z=M.state.tr;if(c){const O=M.schema.nodes.mathBlock.create({latex:"",display:"block"});z.insert(P,O)}else{const O=M.schema.nodes.hardBreak.create();z.insert(P,O);const H=M.schema.nodes.mathInline.create({latex:"",display:"inline"});z.insert(P+1,H)}z.setSelection(tt.near(z.doc.resolve(P+1))),M.view.dispatch(z),M.view.focus()},y.addEventListener("input",b.input),y.addEventListener("focus",b.focus),y.addEventListener("blur",b.blur),y.addEventListener("keydown",b.keydown),!f&&(m.innerHTML="",m.appendChild(y),n.current=y,!e.node.attrs.latex))){const T=setTimeout(()=>{y.focus()},50);_.push(T)}}}return v().catch(E=>so.error("Failed to initialize math field",E)),()=>{f=!0,_.forEach(E=>clearTimeout(E)),y&&b&&(b.input&&y.removeEventListener("input",b.input),b.focus&&y.removeEventListener("focus",b.focus),b.blur&&y.removeEventListener("blur",b.blur),b.keydown&&y.removeEventListener("keydown",b.keydown)),n.current=null,m.innerHTML=""}},[]),V.useEffect(()=>{const m=n.current;m&&e.node.attrs.latex!==m.value&&(m.value=e.node.attrs.latex||"")},[e.node.attrs.latex]),g.jsxs(g.Fragment,{children:[g.jsxs(AE,{className:`${c?"mtx-math-block":"mtx-math-inline"} ${e.node.attrs.latex?"":"is-empty"}`,"data-latex":e.node.attrs.latex,style:e.selected?{outline:"2px solid #2563eb",outlineOffset:"2px"}:void 0,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),children:[g.jsx("div",{ref:t,style:{position:"relative",display:c?"block":"inline-block"}}),u&&g.jsxs("button",{type:"button",onClick:d,className:"mtx-math-edit-btn",title:"Edit rumus dengan Equation Editor",children:[g.jsx("span",{children:"✏️"}),g.jsx("span",{children:"Edit"})]})]}),r&&g.jsx(QM,{isOpen:r,initialLatex:e.node.attrs.latex,onInsert:h,onClose:p})]})}const e8=vn.create({name:"mathInline",group:"inline",inline:!0,atom:!0,addAttributes(){return{latex:{default:"",parseHTML:e=>e.getAttribute("data-latex"),renderHTML:e=>({"data-latex":e.latex})},display:{default:"inline",parseHTML:e=>e.getAttribute("data-display")||"inline",renderHTML:e=>({"data-display":e.display})}}},parseHTML(){return[{tag:'span[data-type="math-inline"]'},{tag:"span.mtx-math-inline"}]},renderHTML({HTMLAttributes:e}){return["span",vt(e,{"data-type":"math-inline",class:"mtx-math-inline"})]},addNodeView(){return Ff(JM)}}),t8=vn.create({name:"mathBlock",group:"block",atom:!0,addAttributes(){return{latex:{default:"",parseHTML:e=>e.getAttribute("data-latex"),renderHTML:e=>({"data-latex":e.latex})},display:{default:"block",parseHTML:e=>e.getAttribute("data-display")||"block",renderHTML:e=>({"data-display":e.display})}}},parseHTML(){return[{tag:'div[data-type="math-block"]'},{tag:"div.mtx-math-block"}]},renderHTML({HTMLAttributes:e}){return["div",vt(e,{"data-type":"math-block",class:"mtx-math-block"})]},addNodeView(){return Ff(JM)}}),eh={bold:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M4 2h5a3 3 0 0 1 2.1 5.15A3.5 3.5 0 0 1 9.5 14H4V2zm2 5h3a1 1 0 1 0 0-2H6v2zm0 2v3h3.5a1.5 1.5 0 0 0 0-3H6z"})}),italic:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M6 2h6v2h-2.2l-2.6 8H9v2H3v-2h2.2l2.6-8H6V2z"})}),underline:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M3 13h10v1.5H3V13zM4 2v6a4 4 0 0 0 8 0V2h-2v6a2 2 0 0 1-4 0V2H4z"})}),strike:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 7h12v1.5H2V7zm3.5-4.5h5c1.1 0 2 .9 2 2s-.9 2-2 2h-2V5h2a.5.5 0 0 0 0-1h-5a.5.5 0 0 0 0 1h1v1.5h-1c-1.1 0-2-.9-2-2s.9-2 2-2zm2 7V11h-1a.5.5.0 0 0 0 1h5a.5.5 0 0 0 0-1h-2V9.5h-2z"})}),h1:g.jsx("svg",{width:"20",height:"16",viewBox:"0 0 20 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3v10h2V9h4v4h2V3H8v4H4V3H2zm12 0v10h2V5.5l2 1V4.3l-3-1.8h-1z"})}),h2:g.jsx("svg",{width:"20",height:"16",viewBox:"0 0 20 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3v10h2V9h4v4h2V3H8v4H4V3H2zm10 10v-2c0-1.5 1.2-2.5 2.4-3.3L15.8 7C16.6 6.4 17 5.8 17 5c0-.8-.5-1.5-1.5-1.5S14 4.2 14 5h-2c0-1.9 1.3-3.5 3.5-3.5S19 3.1 19 5c0 1.3-.7 2.2-1.8 3l-1.5 1H19v2h-7z"})}),h3:g.jsx("svg",{width:"20",height:"16",viewBox:"0 0 20 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3v10h2V9h4v4h2V3H8v4H4V3H2zm10 3.5h2c.8 0 1.5-.3 1.5-1s-.7-1-1.5-1-1.5.3-1.5 1h-2c0-1.7 1.3-3 3.5-3s3.5 1.1 3.5 2.5c0 .9-.5 1.5-1.2 1.8.9.4 1.5 1.2 1.5 2.2 0 1.6-1.4 3-3.8 3S12 10.4 12 8.5h2c0 .8.7 1.5 1.5 1.5s1.5-.5 1.5-1.3-.6-1.2-1.5-1.2H14V6.5z"})}),h4:g.jsx("svg",{width:"20",height:"16",viewBox:"0 0 20 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3v10h2V9h4v4h2V3H8v4H4V3H2zm11 10v-3h4V7h-4V4h-2v10h2z"})}),paragraph:g.jsxs("svg",{width:"18",height:"16",viewBox:"0 0 18 16",fill:"currentColor",children:[g.jsx("path",{d:"M3 2h7a4 4 0 0 1 0 8H8v4H6V4H3V2zm5 2v4h2a2 2 0 1 0 0-4H8z"}),g.jsx("path",{d:"M12 2h2v12h-2z"})]}),bulletList:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("circle",{cx:"2.5",cy:"4",r:"1.5"}),g.jsx("rect",{x:"6",y:"3",width:"9",height:"2",rx:"0.5"}),g.jsx("circle",{cx:"2.5",cy:"8",r:"1.5"}),g.jsx("rect",{x:"6",y:"7",width:"9",height:"2",rx:"0.5"}),g.jsx("circle",{cx:"2.5",cy:"12",r:"1.5"}),g.jsx("rect",{x:"6",y:"11",width:"9",height:"2",rx:"0.5"})]}),orderedList:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("text",{x:"1",y:"5",fontSize:"5.5",fontWeight:"600",fontFamily:"sans-serif",children:"1."}),g.jsx("text",{x:"1",y:"9",fontSize:"5.5",fontWeight:"600",fontFamily:"sans-serif",children:"2."}),g.jsx("text",{x:"1",y:"13",fontSize:"5.5",fontWeight:"600",fontFamily:"sans-serif",children:"3."}),g.jsx("rect",{x:"6",y:"3",width:"9",height:"2",rx:"0.5"}),g.jsx("rect",{x:"6",y:"7",width:"9",height:"2",rx:"0.5"}),g.jsx("rect",{x:"6",y:"11",width:"9",height:"2",rx:"0.5"})]}),taskList:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("rect",{x:"1.5",y:"2.5",width:"3",height:"3",rx:"0.5",stroke:"currentColor",fill:"none",strokeWidth:"1.2"}),g.jsx("path",{d:"M2.2 4l.7.7 1.3-1.5",stroke:"currentColor",fill:"none",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),g.jsx("rect",{x:"6",y:"3",width:"9",height:"1.5",rx:"0.5"}),g.jsx("rect",{x:"1.5",y:"10.5",width:"3",height:"3",rx:"0.5",stroke:"currentColor",fill:"none",strokeWidth:"1.2"}),g.jsx("rect",{x:"6",y:"11",width:"9",height:"1.5",rx:"0.5"})]}),superscript:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M1 13l4-5.5L1.5 3H4l2.3 3.2L8.5 3H11L7.5 6.5 12 13H9.2L6.5 9.2 3.8 13H1zm10-9V2.5c0-.6.5-1 1.2-1.2l.8-.3c.3-.1.5-.3.5-.5 0-.3-.3-.5-.7-.5-.5 0-.8.3-.8.7h-1.2c0-1 .8-1.7 2-1.7s2 .7 2 1.6c0 .6-.4 1-1 1.3l-.7.3c-.3.1-.5.2-.6.4H15V4h-4z"})}),subscript:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M1 12l4-5.5L1.5 2H4l2.3 3.2L8.5 2H11L7.5 6.5 12 12H9.2L6.5 8.2 3.8 12H1zm10 3v-1.5c0-.6.5-1 1.2-1.2l.8-.3c.3-.1.5-.3.5-.5 0-.3-.3-.5-.7-.5-.5 0-.8.3-.8.7h-1.2c0-1 .8-1.7 2-1.7s2 .7 2 1.6c0 .6-.4 1-1 1.3l-.7.3c-.3.1-.5.2-.6.4H15V15h-4z"})}),link:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M6.9 11.1l-1.4 1.4a2 2 0 0 1-2.8-2.8l2.8-2.8a2 2 0 0 1 2.8 0l.7-.7a3 3 0 0 0-4.2 0L2.2 9a3 3 0 0 0 4.2 4.2l1.4-1.4-.7-.7zm2.2-6.2l1.4-1.4a2 2 0 0 1 2.8 2.8l-2.8 2.8a2 2 0 0 1-2.8 0l-.7.7a3 3 0 0 0 4.2 0l2.8-2.8a3 3 0 0 0-4.2-4.2L8.4 4.2l.7.7z"})}),image:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3zm1.5 8.5l2.5-3 2 2.5 3-4 3 4.5H3.5zm2-5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z"})}),editImage:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M12.854 1.646a.5.5 0 0 1 .708 0l1.79 1.79a.5.5 0 0 1 0 .708l-8.5 8.5a.5.5 0 0 1-.224.128l-4 1a.5.5 0 0 1-.604-.604l1-4a.5.5 0 0 1 .128-.224l8.5-8.5zM13.5 2.707L5.707 10.5 5 13.293l2.793-.707 7.793-7.793-2.086-2.086zM3 14a1 1 0 1 1 2 0 1 1 0 0 1-2 0z"})}),table:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M1 2.5A1.5 1.5 0 0 1 2.5 1h11A1.5 1.5 0 0 1 15 2.5v11a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 1 13.5v-11zM2.5 2a.5.5 0 0 0-.5.5V5h5V2H2.5zM9 2v3h5V2.5a.5.5 0 0 0-.5-.5H9zM14 6H9v3h5V6zM14 10.5H9v3h4.5a.5.5 0 0 0 .5-.5V10.5zM7 13.5v-3H2v2.5a.5.5 0 0 0 .5.5H7zM2 9h5V6H2v3z"})}),rowAbove:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3h12v2H2V3zm0 4h12v6H2V7zm6-6 2.5 2.5h-1.5V6h-2V3.5H5.5L8 1z"})}),rowBelow:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3h12v6H2V3zm0 8h12v2H2v-2zm6 4-2.5-2.5h1.5V10h2v2.5h1.5L8 15z"})}),columnLeft:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M3 2h2v12H3V2zm4 0h7v12H7V2zM1 8l2.5-2.5V7H6v2H3.5v1.5L1 8z"})}),columnRight:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M11 2h2v12h-2V2zM2 2h7v12H2V2zm13 6-2.5 2.5V9H10V7h2.5V5.5L15 8z"})}),cellProperties:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 2h12v12H2V2zm1 1v3h3V3H3zm4 0v3h6V3H7zM3 7v6h3V7H3zm4 0v6h6V7H7zm1 2h4v1H8V9zm0 2h3v1H8v-1z"})}),deleteRow:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("path",{d:"M2 3h12v2H2V3zm0 4h12v6H2V7zm3 1h6v1.5H5V8.5z"}),g.jsx("path",{d:"M4.5 10.5h7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),deleteColumn:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 2h4v12H2V2zm5 0h7v12H7V2zm1.5 5.5h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),mergeCells:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("path",{d:"M2 2h5v5H2V2zm7 0h5v5H9V2zM2 9h12v5H2V9z"}),g.jsx("path",{d:"M6 4.5h4",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round"})]}),splitCell:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("path",{d:"M2 2h12v12H2V2zm5 0v12"}),g.jsx("path",{d:"M8 2v12",stroke:"#fff",strokeWidth:"1.5"})]}),headerRow:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("path",{d:"M2 2h12v3H2V2zm0 4h12v2H2V6zm0 3h12v2H2V9zm0 3h12v2H2v-2z"}),g.jsx("rect",{x:"2",y:"2",width:"12",height:"3",fill:"currentColor",opacity:"0.4"})]}),headerColumn:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("path",{d:"M2 2h12v12H2V2zm0 0h2.5v12H2V2zm5 0h2.5v12H7V2zm5 0h2v12h-2V2z"}),g.jsx("rect",{x:"2",y:"2",width:"2.5",height:"12",fill:"currentColor",opacity:"0.4"})]}),fixTable:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("path",{d:"M13.5 2.5l1 1-11 11-1-1 11-11z"}),g.jsx("path",{d:"M2 2h12v12H2V2zm1 1v10h10V3H3z",fill:"none",stroke:"currentColor",strokeWidth:"1"})]}),graph:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 2h1.5v10.5H14V14H2V2zm2 8.5 2.2-2.8 2 1.8 3.3-4.2 1.2.9-4.2 5.3-2-1.8-1.7 2.1L4 10.5z"})}),horizontalRule:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("rect",{x:"1",y:"7",width:"14",height:"2",rx:"1"})}),blockquote:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M3 3h4v4l-2 5H3l2-5H3V3zm6 0h4v4l-2 5H9l2-5H9V3z"})}),codeBlock:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M5.7 11.3l-1.4 1.4L0 8l4.3-4.7 1.4 1.4L2.8 8l2.9 3.3zm4.6 0l1.4 1.4L16 8l-4.3-4.7-1.4 1.4L13.2 8l-2.9 3.3z"})}),math:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 2l3 6-3 6h2.5l2-4 2 4H11l-3-6 3-6H8.5l-2 4-2-4H2zm9 0v2h4V2h-4zm0 5v2h4V7h-4zm0 5v2h4v-2h-4z"})}),undo:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M4 5h6a3 3 0 0 1 0 6H7v2h3a5 5 0 0 0 0-10H4V1L0 4.5 4 8V5z"})}),redo:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M12 5H6a3 3 0 0 0 0 6h3v2H6a5 5 0 0 1 0-10h6V1l4 3.5L12 8V5z"})}),chemistry:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M11 2h-1V1c0-.6-.4-1-1-1H7C6.4 0 6 .4 6 1v1H5c-.6 0-1 .4-1 1v1c0 .2.1.4.2.6L7 9.5v3.5c0 .6.4 1 1 1s1-.4 1-1V9.5l2.8-4.9c.1-.2.2-.4.2-.6V3c0-.6-.4-1-1-1zm-4 0V1h2v1H7zm1.5 6.5l-.5-.9-.5.9V13h1V8.5z"})}),download:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M8 11.5l-4-4h2.5V2h3v5.5H12L8 11.5zM2 13h12v1H2v-1z"})}),alignLeft:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3h12v1.5H2V3zm0 4h8v1.5H2V7zm0 4h12v1.5H2v-1.5zM2 11h6v1.5H2V11z"})}),alignCenter:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3h12v1.5H2V3zm3 4h6v1.5H5V7zm-3 4h12v1.5H2v-1.5zM5 11h6v1.5H5V11z"})}),alignRight:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3h12v1.5H2V3zm6 4h6v1.5H8V7zM2 11h12v1.5H2v-1.5zm6-4h6v1.5H8V7z"})}),alignJustify:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3h12v1.5H2V3zm0 4h12v1.5H2V7zm0 4h12v1.5H2v-1.5zm0 4h12v1.5H2v-1.5z"})}),indent:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3h12v1.5H2V3zm3 4h9v1.5H5V7zm3 4h6v1.5H8v-1.5zM2 11h12v1.5H2v-1.5zM2 7l3 2-3 2V7z"})}),outdent:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 3h12v1.5H2V3zm3 4h9v1.5H5V7zm3 4h6v1.5H8v-1.5zM2 11h12v1.5H2v-1.5zM5 7l-3 2 3 2V7z"})}),highlight:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M3 2h4l4 4-4 4H3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm6 0l2 2 2-2-2-2-2 2zm-2 2l2 2 2-2-2-2-2 2z"})}),removeFormat:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[g.jsx("path",{d:"M2 2h12v1.5H2V2zm2 3h8v1.5H4V5zm2 3h4v1.5H6V8zm-4 3h12v1.5H2v-1.5zm2 3h8v1.5H4v-1.5z"}),g.jsx("path",{d:"M1 1l14 14",stroke:"currentColor",strokeWidth:"1.5"})]}),importDocx:g.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[g.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),g.jsx("polyline",{points:"14 2 14 8 20 8"}),g.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),g.jsx("polyline",{points:"9 15 12 12 15 15"})]}),tableDropdown:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M8 11l-4-4h8l-4 4z"})}),tableTemplates:g.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 2h5v5H2V2zm7 0h5v5H9V2zM2 9h5v5H2V9zm7 0h5v5H9V9z"})})},Et=(e,t,n,r,i)=>({id:e,icon:t,label:n,action:r,...i});function kue(e,t){const n=[];n.push({id:"undo",buttons:[Et("undo","undo","Undo (Ctrl+Z)",l=>l.chain().focus().undo().run(),{isDisabled:l=>!l.can().undo()}),Et("redo","redo","Redo (Ctrl+Y)",l=>l.chain().focus().redo().run(),{isDisabled:l=>!l.can().redo()})]}),e==="advanced"&&n.push({id:"font",buttons:[Et("fontFamily","bold","Font Family",t.fontFamily)]});const r=[Et("bold","bold","Bold (Ctrl+B)",l=>l.chain().focus().toggleBold().run(),{isActive:l=>l.isActive("bold")}),Et("italic","italic","Italic (Ctrl+I)",l=>l.chain().focus().toggleItalic().run(),{isActive:l=>l.isActive("italic")}),Et("underline","underline","Underline (Ctrl+U)",l=>l.chain().focus().toggleUnderline().run(),{isActive:l=>l.isActive("underline")})];e!=="olimpiade"&&r.push(Et("strike","strike","Strikethrough",l=>l.chain().focus().toggleStrike().run(),{isActive:l=>l.isActive("strike")}),Et("highlight","highlight","Highlight",l=>l.chain().focus().toggleHighlight().run(),{isActive:l=>l.isActive("highlight")})),n.push({id:"format",buttons:r}),e==="advanced"&&n.push({id:"script",buttons:[Et("superscript","superscript","Superscript",l=>l.chain().focus().toggleSuperscript().run(),{isActive:l=>l.isActive("superscript")}),Et("subscript","subscript","Subscript",l=>l.chain().focus().toggleSubscript().run(),{isActive:l=>l.isActive("subscript")})]}),e==="advanced"&&n.push({id:"color",buttons:[Et("textColor","bold","Text Color",t.textColor)]});const i=[Et("paragraph","paragraph","Paragraph",l=>l.chain().focus().setParagraph().run(),{isActive:l=>l.isActive("paragraph")}),Et("h1","h1","Heading 1",l=>l.chain().focus().toggleHeading({level:1}).run(),{isActive:l=>l.isActive("heading",{level:1})}),Et("h2","h2","Heading 2",l=>l.chain().focus().toggleHeading({level:2}).run(),{isActive:l=>l.isActive("heading",{level:2})})];e==="advanced"&&i.push(Et("h3","h3","Heading 3",l=>l.chain().focus().toggleHeading({level:3}).run(),{isActive:l=>l.isActive("heading",{level:3})}),Et("h4","h4","Heading 4",l=>l.chain().focus().toggleHeading({level:4}).run(),{isActive:l=>l.isActive("heading",{level:4})})),n.push({id:"heading",buttons:i});const a=[Et("bulletList","bulletList","Bullet List",l=>l.chain().focus().toggleBulletList().run(),{isActive:l=>l.isActive("bulletList")}),Et("orderedList","orderedList","Ordered List",l=>l.chain().focus().toggleOrderedList().run(),{isActive:l=>l.isActive("orderedList")})];e==="advanced"&&a.push(Et("taskList","taskList","Checklist",l=>l.chain().focus().toggleTaskList().run(),{isActive:l=>l.isActive("taskList")})),a.push(Et("outdent","outdent","Outdent",l=>l.chain().focus().outdent().run(),{isDisabled:l=>!l.can().outdent()}),Et("indent","indent","Indent",l=>l.chain().focus().indent().run(),{isDisabled:l=>!l.can().indent()})),n.push({id:"list",buttons:a}),e==="advanced"&&n.push({id:"align",buttons:[Et("alignLeft","alignLeft","Align Left",l=>l.chain().focus().setTextAlign("left").run(),{isActive:l=>l.isActive({textAlign:"left"})}),Et("alignCenter","alignCenter","Align Center",l=>l.chain().focus().setTextAlign("center").run(),{isActive:l=>l.isActive({textAlign:"center"})}),Et("alignRight","alignRight","Align Right",l=>l.chain().focus().setTextAlign("right").run(),{isActive:l=>l.isActive({textAlign:"right"})}),Et("alignJustify","alignJustify","Justify",l=>l.chain().focus().setTextAlign("justify").run(),{isActive:l=>l.isActive({textAlign:"justify"})})]}),e!=="olimpiade"&&n.push({id:"insert",buttons:[Et("link","link","Link",t.link,{isActive:l=>l.isActive("link")}),Et("image","image","Image",t.image),Et("table","table","Table",t.table),Et("graph","graph","Graph",t.graph)]}),e==="advanced"&&n.push({id:"block",buttons:[Et("horizontalRule","horizontalRule","Horizontal Rule",l=>l.chain().focus().setHorizontalRule().run()),Et("blockquote","blockquote","Blockquote",l=>l.chain().focus().toggleBlockquote().run(),{isActive:l=>l.isActive("blockquote")}),Et("codeBlock","codeBlock","Code Block",l=>l.chain().focus().toggleCodeBlock().run(),{isActive:l=>l.isActive("codeBlock")})]});const o=[Et("mathFormula","math","Math Formula",t.math)];e!=="basic"&&o.push(Et("chemistry","chemistry","Chemistry Formula",t.chemistry)),n.push({id:"math",buttons:o});const s=[Et("removeFormat","removeFormat","Remove Format",t.removeFormat)];return e==="advanced"&&s.push(Et("importDocx","importDocx","Import DOCX",t.importDocx)),n.push({id:"action",buttons:s}),n}const Oue=[{value:"Arial",label:"Arial"},{value:"Times New Roman",label:"Times New Roman"},{value:"Georgia",label:"Georgia"},{value:"Verdana",label:"Verdana"},{value:"Courier New",label:"Courier New"}],Mue={link:!1,insertTable:!1,cellProperties:!1,tableProperties:!1,tableTemplates:!1,image:!1,imageEdit:!1};function Iue(){const[e,t]=V.useState(Mue),[n,r]=V.useState({}),[i,a]=V.useState({}),[o,s]=V.useState(null),l=V.useCallback(d=>{t(p=>({...p,[d]:!0}))},[]),c=V.useCallback(d=>{t(p=>({...p,[d]:!1}))},[]),u=V.useCallback(d=>e[d],[e]);return{open:e,show:u,openDialog:l,closeDialog:c,cellData:n,setCellData:r,tableData:i,setTableData:a,imageEditData:o,setImageEditData:s}}const v2=V.memo(({isOpen:e,position:t,onClose:n,onAddRowBefore:r,onAddRowAfter:i,onDeleteRow:a,onAddColumnBefore:o,onAddColumnAfter:s,onDeleteColumn:l,onDeleteTable:c,onMergeCells:u,onSplitCell:d,onCellProperties:p,onTableProperties:h,onToggleHeaderRow:m,onToggleHeaderColumn:f,onFixTables:_})=>{const b=V.useCallback(v=>{v&&v(),n()},[n]),y=V.useMemo(()=>{if(!t)return{x:0,y:0};const v=typeof window<"u"?window.innerWidth:1280,E=typeof window<"u"?window.innerHeight:720;return{x:Math.min(t.x,v-260),y:Math.min(t.y,E-360)}},[t]);return!e||!t?null:g.jsxs(g.Fragment,{children:[g.jsx("button",{type:"button",className:"mtx-table-menu-overlay",onClick:n,"aria-label":"Close table menu"}),g.jsx("div",{className:"mtx-table-menu-dropdown",style:{left:y.x,top:y.y},children:g.jsxs("div",{className:"mtx-table-menu",onClick:v=>v.stopPropagation(),children:[g.jsxs("div",{className:"mtx-table-menu-group",children:[g.jsx("div",{className:"mtx-table-menu-label",children:"Rows"}),g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>b(r),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"⬆"}),g.jsx("span",{children:"Insert Row Above"})]}),g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>b(i),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"⬇"}),g.jsx("span",{children:"Insert Row Below"})]}),g.jsxs("button",{className:"mtx-table-menu-item mtx-table-menu-item--danger",onClick:()=>b(a),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"🗑"}),g.jsx("span",{children:"Delete Row"})]})]}),g.jsxs("div",{className:"mtx-table-menu-group",children:[g.jsx("div",{className:"mtx-table-menu-label",children:"Columns"}),g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>b(o),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"⬅"}),g.jsx("span",{children:"Insert Column Left"})]}),g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>b(s),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"➡"}),g.jsx("span",{children:"Insert Column Right"})]}),g.jsxs("button",{className:"mtx-table-menu-item mtx-table-menu-item--danger",onClick:()=>b(l),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"🗑"}),g.jsx("span",{children:"Delete Column"})]})]}),(u||d)&&g.jsxs("div",{className:"mtx-table-menu-group",children:[g.jsx("div",{className:"mtx-table-menu-label",children:"Cells"}),u&&g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>b(u),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"⊞"}),g.jsx("span",{children:"Merge Cells"})]}),d&&g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>b(d),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"⊟"}),g.jsx("span",{children:"Split Cell"})]})]}),(p||h)&&g.jsxs("div",{className:"mtx-table-menu-group",children:[g.jsx("div",{className:"mtx-table-menu-label",children:"Properties"}),p&&g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>b(p),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"⚙"}),g.jsx("span",{children:"Cell Properties"})]}),h&&g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>b(h),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"⚙"}),g.jsx("span",{children:"Table Properties"})]})]}),(m||f)&&g.jsxs("div",{className:"mtx-table-menu-group",children:[g.jsx("div",{className:"mtx-table-menu-label",children:"Headers"}),m&&g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>b(m),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"▤"}),g.jsx("span",{children:"Toggle Header Row"})]}),f&&g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>b(f),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"◫"}),g.jsx("span",{children:"Toggle Header Column"})]}),_&&g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>b(_),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"↻"}),g.jsx("span",{children:"Fix Table"})]})]}),g.jsxs("div",{className:"mtx-table-menu-group",children:[g.jsx("div",{className:"mtx-table-menu-label",children:"Danger Zone"}),g.jsxs("button",{className:"mtx-table-menu-item mtx-table-menu-item--danger",onClick:()=>b(c),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"🗑"}),g.jsx("span",{children:"Delete Table"})]})]})]})})]})});v2.displayName="TableMenu";const Rue=V.memo(function({isOpen:t,position:n,currentAlign:r,hasCustomPosition:i=!1,onClose:a,onSetAlign:o,onResetPosition:s,onCenterImage:l,onEditImage:c}){const u=V.useCallback(p=>{p==null||p(),a()},[a]),d=V.useMemo(()=>{if(!n)return{x:0,y:0};const p=typeof window<"u"?window.innerWidth:1280,h=typeof window<"u"?window.innerHeight:720;return{x:Math.min(n.x,p-240),y:Math.min(n.y,h-280)}},[n]);return!t||!n?null:g.jsxs(g.Fragment,{children:[g.jsx("button",{type:"button",className:"mtx-table-menu-overlay",onClick:a,"aria-label":"Close image menu"}),g.jsx("div",{className:"mtx-table-menu-dropdown",style:{left:d.x,top:d.y},children:g.jsxs("div",{className:"mtx-table-menu",onClick:p=>p.stopPropagation(),children:[g.jsxs("div",{className:"mtx-table-menu-group",children:[g.jsx("div",{className:"mtx-table-menu-label",children:"Text Wrapping"}),g.jsxs("button",{className:`mtx-table-menu-item ${r==="left"?"is-active":""}`,onClick:()=>u(()=>o("left")),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"◧"}),g.jsx("span",{children:"Wrap Left"})]}),g.jsxs("button",{className:`mtx-table-menu-item ${r==="center"?"is-active":""}`,onClick:()=>u(()=>o("center")),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"▣"}),g.jsx("span",{children:"Wrap Center"})]}),g.jsxs("button",{className:`mtx-table-menu-item ${r==="right"?"is-active":""}`,onClick:()=>u(()=>o("right")),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"◨"}),g.jsx("span",{children:"Wrap Right"})]}),g.jsxs("button",{className:`mtx-table-menu-item ${r==="full"?"is-active":""}`,onClick:()=>u(()=>o("full")),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"▤"}),g.jsx("span",{children:"Full Width"})]})]}),c&&g.jsxs("div",{className:"mtx-table-menu-group",children:[g.jsx("div",{className:"mtx-table-menu-label",children:"Image"}),s&&g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>u(s),disabled:!i,children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"↺"}),g.jsx("span",{children:"Reset Position"})]}),l&&g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>u(l),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"◎"}),g.jsx("span",{children:"Center & Reset"})]}),g.jsxs("button",{className:"mtx-table-menu-item",onClick:()=>u(c),children:[g.jsx("span",{className:"mtx-table-menu-icon",children:"✎"}),g.jsx("span",{children:"Edit Image"})]})]})]})})]})}),Lue=V.lazy(()=>Promise.resolve().then(()=>a$).then(e=>({default:e.LinkDialogImpl}))),Pue=V.lazy(()=>Promise.resolve().then(()=>s$).then(e=>({default:e.InsertTableDialogImpl}))),Bue=V.lazy(()=>Promise.resolve().then(()=>c$).then(e=>({default:e.CellPropertiesDialogImpl}))),Fue=V.lazy(()=>Promise.resolve().then(()=>d$).then(e=>({default:e.TablePropertiesDialogImpl}))),Uue=V.lazy(()=>Promise.resolve().then(()=>h$).then(e=>({default:e.TableTemplatesDialogImpl}))),zue=V.lazy(()=>Promise.resolve().then(()=>m$).then(e=>({default:e.ImageInsertDialog}))),E2=V.memo(function({icon:t,label:n,onClick:r,isActive:i,isDisabled:a,className:o}){return g.jsx("button",{type:"button",className:`mtx-toolbar-btn ${i?"is-active":""} ${o||""}`,onClick:r,disabled:a,"data-tooltip":n,"aria-label":n,children:t})});function x2(){return g.jsx("div",{className:"mtx-toolbar-divider"})}const n8=V.memo(({color:e,onChange:t,label:n,icon:r})=>{const i=V.useRef(null);return g.jsxs(g.Fragment,{children:[g.jsx("button",{type:"button",className:"mtx-toolbar-btn mtx-color-btn",onClick:()=>{var a;return(a=i.current)==null?void 0:a.click()},title:n,"aria-label":n,children:r}),g.jsx("input",{ref:i,type:"color",value:e,onChange:a=>t(a.target.value),className:"mtx-color-picker",style:{display:"none"}})]})}),$ue=V.memo(({value:e,onChange:t,options:n,label:r,className:i})=>g.jsx("select",{className:`mtx-toolbar-select ${i||""}`,value:e,onChange:a=>t(a.target.value),title:r,"aria-label":r,children:n.map(a=>g.jsx("option",{value:a.value,children:a.label},a.value))}));function Gue(e){var n;if(!e)return null;const t=e.state.selection.node;return((n=t==null?void 0:t.type)==null?void 0:n.name)==="image"?t.attrs||{}:e.state.selection.$from.parent.type.name==="image"?e.state.selection.$from.parent.attrs:null}const r8=V.memo(function({editor:t,toolbarMode:n,onInsertMath:r,onInsertBlockMath:i,onInsertImage:a,onEditImage:o,onSetImageAlign:s,onResetImagePosition:l,onImportDocx:c}){const[u,d]=V.useState("#000000"),[p,h]=V.useState("#fef08a"),[m,f]=V.useState("basic"),_=Iue(),[b,y]=V.useState(!1),[v,E]=V.useState(null),[T,S]=V.useState(!1),[w,M]=V.useState(null),P=n||m,z=!n,ee=V.useCallback(()=>_.openDialog("link"),[_]),O=V.useCallback(_e=>{if(!t)return;const{url:ve,text:Ue,target:Qe}=_e,rt=_e.title||void 0,un={href:ve,target:Qe||"_self",rel:Qe==="_blank"?"noopener noreferrer":void 0,title:rt};Ue?t.chain().focus().deleteSelection().insertContent(Ue).setLink(un).run():t.chain().focus().setLink(un).run(),_.closeDialog("link")},[t,_]),H=V.useCallback(()=>{t&&(t.chain().focus().unsetLink().run(),_.closeDialog("link"))},[t,_]),x=V.useCallback(()=>t?{url:t.getAttributes("link").href||"",text:t.state.selection.empty?"":t.state.doc.textBetween(t.state.selection.from,t.state.selection.to),title:t.getAttributes("link").title||"",target:t.getAttributes("link").target||"_blank"}:{},[t]),G=V.useCallback((_e,ve,Ue)=>{t&&t.chain().focus().insertTable({rows:_e,cols:ve,withHeaderRow:Ue}).run()},[t]),D=V.useCallback(()=>_.openDialog("insertTable"),[_]),A=V.useCallback(()=>{if(a){a();return}_.openDialog("image")},[a,_]),I=V.useCallback((_e,ve)=>{t&&(t.chain().focus().setImage({src:_e,alt:ve}).run(),_.closeDialog("image"))},[t,_]),B=V.useCallback(()=>{t&&t.chain().focus().insertContent({type:"graph",attrs:{formula:"sin(x)"}}).run()},[t]);V.useEffect(()=>{if(!t)return;const _e=Ue=>{const Qe=Ue,rt=Qe.target,Tt=rt.closest("figure.mtx-image-figure, .mtx-image-wrapper, img"),un=rt.closest("td, th");if(Tt){Qe.preventDefault(),Qe.stopPropagation();try{const dn=Tt.tagName==="IMG"?Tt:Tt.querySelector("img")||Tt,Xo=t.view.posAtDOM(dn,0);t.chain().focus().setNodeSelection(Xo).run()}catch(dn){so.warn("Cannot select image from context menu:",dn)}y(!1),M({x:Qe.clientX,y:Qe.clientY}),S(!0);return}un&&t.isActive("table")&&(Qe.preventDefault(),Qe.stopPropagation(),S(!1),E({x:Qe.clientX,y:Qe.clientY}),y(!0))},ve=t.view.dom;return ve.addEventListener("contextmenu",_e),()=>{ve.removeEventListener("contextmenu",_e)}},[t]);const $=V.useCallback(()=>{t==null||t.chain().focus().addRowBefore().run()},[t]),R=V.useCallback(()=>{t==null||t.chain().focus().addRowAfter().run()},[t]),L=V.useCallback(()=>{t==null||t.chain().focus().deleteRow().run()},[t]),J=V.useCallback(()=>{t==null||t.chain().focus().addColumnBefore().run()},[t]),se=V.useCallback(()=>{t==null||t.chain().focus().addColumnAfter().run()},[t]),ne=V.useCallback(()=>{t==null||t.chain().focus().deleteColumn().run()},[t]),ge=V.useCallback(()=>{t==null||t.chain().focus().deleteTable().run(),y(!1)},[t]),Ne=V.useCallback(_e=>{s==null||s(_e),S(!1)},[s]),Ae=V.useCallback(()=>{o==null||o(),S(!1)},[o]),be=V.useCallback(()=>{l==null||l(),S(!1)},[l]),Re=V.useCallback(()=>{s==null||s("center"),S(!1)},[s]),we=V.useCallback(()=>{if(!t)return;const _e=t.state.selection.$from.parent;if(_e.type.name!=="tableCell"&&_e.type.name!=="tableHeader")return;let ve=null;for(let Qe=t.state.selection.$from.depth;Qe>=0;Qe--){const rt=t.state.selection.$from.node(Qe);if(rt.type.name==="table"){const Tt=rt.attrs.colwidth;if(Array.isArray(Tt)&&Tt.length>0){const un=t.state.selection.$from.index(1);ve=Tt[un]??Tt[0]??null}break}}const Ue=_e.attrs.width||(typeof ve=="number"?`${ve}px`:"");_.setCellData({width:typeof Ue=="string"?Ue:Ue?String(Ue):"",backgroundColor:_e.attrs.backgroundColor||"",horizontalAlign:_e.attrs.textAlign||"left",verticalAlign:_e.attrs.verticalAlign||"top"}),y(!1),_.openDialog("cellProperties")},[t,_]),K=V.useCallback(_e=>{if(!t)return;const Ue=t.state.selection.$from.parent.type.name==="tableHeader"?"tableHeader":"tableCell";t.chain().focus().updateAttributes(Ue,{width:_e.width||null,backgroundColor:_e.backgroundColor||null,textAlign:_e.horizontalAlign||null,verticalAlign:_e.verticalAlign||null}).run()},[t]),ye=V.useCallback(()=>{if(t)try{t.chain().focus().mergeCells().run(),y(!1)}catch{}},[t]),N=V.useCallback(()=>{if(t)try{t.chain().focus().splitCell().run(),y(!1)}catch{}},[t]),X=V.useCallback(()=>{if(!t)return;const{state:_e}=t,{$from:ve}=_e.selection;for(let Ue=ve.depth;Ue>=0;Ue--){const Qe=ve.node(Ue);if(Qe.type.name==="table"){const rt=Qe.attrs.align||"left";_.setTableData({align:rt}),y(!1),_.openDialog("tableProperties");return}}},[t,_]),Y=V.useCallback(_e=>{t&&(t.chain().focus().updateAttributes("table",{align:_e.align}).run(),_.closeDialog("tableProperties"))},[t,_]),q=V.useCallback(()=>{t==null||t.chain().focus().toggleHeaderRow().run()},[t]),U=V.useCallback(()=>{t==null||t.chain().focus().toggleHeaderColumn().run()},[t]),Q=V.useCallback(()=>{t==null||t.chain().focus().fixTables().run()},[t]),me=V.useCallback(_e=>{!t||!t.isActive("table")||t.chain().focus().updateAttributes("table",{theme:_e.id}).run()},[t]),he=V.useCallback(_e=>{d(_e),t==null||t.chain().focus().setColor(_e).run()},[t]),le=V.useCallback(_e=>{h(_e),t==null||t.chain().focus().toggleHighlight({color:_e}).run()},[t]),Z=V.useCallback(()=>{t&&t.chain().focus().unsetBold().unsetItalic().unsetUnderline().unsetStrike().unsetSubscript().unsetSuperscript().unsetLink().unsetColor().unsetFontFamily().unsetHighlight().run()},[t]),ie=!!t&&t.isActive("table"),pe=Gue(t),ae=(pe==null?void 0:pe.align)||"center",oe=pe?Number(pe.offsetX||0)!==0||Number(pe.offsetY||0)!==0:!1;if(V.useEffect(()=>{!ie&&b&&y(!1)},[ie,b]),!t)return null;const fe=kue(P,{link:()=>ee(),image:()=>A(),table:()=>D(),graph:()=>B(),math:()=>r==null?void 0:r(),chemistry:()=>r==null?void 0:r("chem"),removeFormat:()=>Z(),importDocx:()=>c==null?void 0:c(),fontFamily:()=>{},textColor:()=>{}});return g.jsxs("div",{className:"mtx-toolbar",role:"toolbar","aria-label":"Editor toolbar",children:[z&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"mtx-toolbar-mode-switch",role:"group","aria-label":"Toolbar density",children:[g.jsx("button",{type:"button",className:`mtx-toolbar-mode-btn ${P==="basic"?"is-active":""}`,onClick:()=>f("basic"),"aria-pressed":P==="basic",children:"Basic"}),g.jsx("button",{type:"button",className:`mtx-toolbar-mode-btn ${P==="advanced"?"is-active":""}`,onClick:()=>f("advanced"),"aria-pressed":P==="advanced",children:"Advanced"}),g.jsx("button",{type:"button",className:`mtx-toolbar-mode-btn ${P==="olimpiade"?"is-active":""}`,onClick:()=>f("olimpiade"),"aria-pressed":P==="olimpiade",children:"Olimpiade"})]}),g.jsx(x2,{})]}),fe.map(_e=>g.jsxs(V.Fragment,{children:[g.jsx("div",{className:"mtx-toolbar-group",children:_e.buttons.map(ve=>{var Ue,Qe,rt;return ve.id==="fontFamily"?g.jsx($ue,{className:"mtx-font-select",value:t.getAttributes("textStyle").fontFamily||"Arial",onChange:Tt=>t.chain().focus().setFontFamily(Tt).run(),options:Oue,label:"Font Family"},ve.id):ve.id==="highlight"?g.jsxs(V.Fragment,{children:[g.jsx(E2,{icon:eh[ve.icon],label:ve.label,onClick:()=>ve.action(t),isActive:(Ue=ve.isActive)==null?void 0:Ue.call(ve,t)}),P!=="olimpiade"&&g.jsx(n8,{color:p,onChange:le,label:"Highlight Color",icon:g.jsx("span",{style:{width:"12px",height:"12px",background:p,borderRadius:"2px",display:"inline-block"}})})]},ve.id):ve.id==="textColor"?g.jsx(V.Fragment,{children:g.jsx(n8,{color:u,onChange:he,label:"Text Color",icon:g.jsx("span",{style:{width:"16px",height:"3px",background:u,display:"inline-block",borderRadius:"1px"}})})},ve.id):g.jsx(E2,{icon:eh[ve.icon],label:ve.label,onClick:()=>ve.action(t),isActive:(Qe=ve.isActive)==null?void 0:Qe.call(ve,t),isDisabled:(rt=ve.isDisabled)==null?void 0:rt.call(ve,t)},ve.id)})}),g.jsx(x2,{})]},_e.id)),P==="advanced"&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"mtx-toolbar-group",children:[g.jsx("button",{type:"button",className:"mtx-toolbar-btn mtx-toolbar-btn--dropdown",onClick:_e=>{if(!ie)return;const ve=_e.currentTarget.getBoundingClientRect();E({x:ve.left,y:ve.bottom+5}),y(!b)},title:"Table Operations","aria-label":"Table Operations",disabled:!ie,children:eh.tableDropdown}),g.jsx("button",{type:"button",className:"mtx-toolbar-btn",onClick:()=>ie&&_.openDialog("tableTemplates"),title:"Table Templates","aria-label":"Table Templates",disabled:!ie,children:eh.tableTemplates})]}),g.jsx(x2,{})]}),P==="olimpiade"&&i&&g.jsx(g.Fragment,{children:g.jsx("div",{className:"mtx-toolbar-group",children:g.jsx(E2,{icon:eh.math,label:"Block Math",onClick:i,className:"mtx-toolbar-btn--accent-secondary"})})}),_.open.link&&g.jsx(V.Suspense,{fallback:null,children:g.jsx(Lue,{isOpen:_.open.link,currentUrl:x().url,currentText:x().text,currentTarget:x().target,currentTitle:x().title,onInsert:O,onRemove:t!=null&&t.isActive("link")?H:void 0,onClose:()=>_.closeDialog("link")})}),_.open.insertTable&&g.jsx(V.Suspense,{fallback:null,children:g.jsx(Pue,{isOpen:_.open.insertTable,onInsert:G,onClose:()=>_.closeDialog("insertTable")})}),_.open.cellProperties&&g.jsx(V.Suspense,{fallback:null,children:g.jsx(Bue,{isOpen:_.open.cellProperties,initialData:_.cellData,onSave:K,onClose:()=>{_.closeDialog("cellProperties"),_.setCellData({})}})}),_.open.tableProperties&&g.jsx(V.Suspense,{fallback:null,children:g.jsx(Fue,{isOpen:_.open.tableProperties,initialData:_.tableData,onSave:Y,onClose:()=>{_.closeDialog("tableProperties"),_.setTableData({})}})}),_.open.tableTemplates&&g.jsx(V.Suspense,{fallback:null,children:g.jsx(Uue,{isOpen:_.open.tableTemplates,onSelect:me,onClose:()=>_.closeDialog("tableTemplates")})}),_.open.image&&g.jsx(V.Suspense,{fallback:null,children:g.jsx(zue,{isOpen:_.open.image,onClose:()=>_.closeDialog("image"),onInsert:I})}),g.jsx(v2,{isOpen:b,position:v||{x:200,y:300},onClose:()=>y(!1),onAddRowBefore:$,onAddRowAfter:R,onDeleteRow:L,onAddColumnBefore:J,onAddColumnAfter:se,onDeleteColumn:ne,onDeleteTable:ge,onCellProperties:we,onTableProperties:X,onMergeCells:ye,onSplitCell:N,onToggleHeaderRow:q,onToggleHeaderColumn:U,onFixTables:Q}),g.jsx(Rue,{isOpen:T,position:w||{x:200,y:300},currentAlign:ae,hasCustomPosition:oe,onClose:()=>S(!1),onSetAlign:Ne,onResetPosition:l?be:void 0,onCenterImage:s?Re:void 0,onEditImage:o?Ae:void 0})]})}),i8="mtx-math-toolbar-expanded-section",a8="mtx-math-toolbar-recent-items";function o8({label:e,latex:t,onClick:n,title:r,variant:i="default"}){return g.jsx("button",{type:"button",className:`mtx-math-btn ${i==="recent"?"mtx-math-btn--recent":""}`,onClick:()=>n(t),title:r,"data-tooltip":r,"aria-label":r,children:g.jsx("span",{className:"mtx-math-btn__label",children:e})})}const s8=[{label:"Basic",buttons:[{label:"x²",latex:"x^{2}",title:"Pangkat (Superscript)"},{label:"x₂",latex:"x_{2}",title:"Subscript / Index"},{label:"½",latex:"\\frac{a}{b}",title:"Pecahan (Fraction)"},{label:"√",latex:"\\sqrt{x}",title:"Akar kuadrat (Square Root)"},{label:"∛",latex:"\\sqrt[3]{x}",title:"Akar pangkat tiga"},{label:"π",latex:"\\pi",title:"Pi"},{label:"±",latex:"\\pm",title:"Plus minus"},{label:"×",latex:"\\times",title:"Perkalian"},{label:"÷",latex:"\\div",title:"Pembagian"}]},{label:"Relation",buttons:[{label:"=",latex:"=",title:"Sama dengan"},{label:"<",latex:"<",title:"Kurang dari"},{label:">",latex:">",title:"Lebih dari"},{label:"≠",latex:"\\neq",title:"Tidak sama dengan"},{label:"≤",latex:"\\leq",title:"Kurang dari atau sama dengan"},{label:"≥",latex:"\\geq",title:"Lebih dari atau sama dengan"},{label:"≈",latex:"\\approx",title:"Hampir sama dengan"},{label:"∞",latex:"\\infty",title:"Tak hingga (Infinity)"}]},{label:"Set",buttons:[{label:"∈",latex:"\\in",title:"Anggota himpunan"},{label:"∉",latex:"\\notin",title:"Bukan anggota himpunan"},{label:"∪",latex:"\\cup",title:"Union / Gabungan"},{label:"∩",latex:"\\cap",title:"Intersection / Irisan"}]},{label:"Calc",buttons:[{label:"Σ",latex:"\\sum_{i=1}^{n}",title:"Sigma / Penjumlahan"},{label:"∫",latex:"\\int_{a}^{b}",title:"Integral"},{label:"d/dx",latex:"\\frac{d}{dx}",title:"Turunan terhadap x"},{label:"lim",latex:"\\lim_{x \\to \\infty}",title:"Limit"},{label:"log",latex:"\\log_{b}(x)",title:"Logaritma"},{label:"sin",latex:"\\sin(x)",title:"Sinus"},{label:"cos",latex:"\\cos(x)",title:"Cosinus"},{label:"tan",latex:"\\tan(x)",title:"Tangen"}]},{label:"Structure",buttons:[{label:"vec",latex:"\\vec{v}",title:"Vektor"},{label:"hat",latex:"\\hat{x}",title:"Topi / Hat"},{label:"( )",latex:"\\left( \\right)",title:"Tanda kurung"},{label:"[ ]",latex:"\\left[ \\right]",title:"Kurung siku"},{label:"{ }",latex:"\\left\\{ \\right\\}",title:"Kurung kurawal"},{label:"|x|",latex:"\\left| x \\right|",title:"Nilai mutlak"},{label:"2x2",latex:"\\begin{bmatrix} a & b \\\\ c & d \\end{bmatrix}",title:"Matriks 2x2"},{label:"{x}",latex:"\\begin{cases} x_1 \\\\ x_2 \\end{cases}",title:"Piecewise / Cases"},{label:"Kimia",latex:"\\ce{#?}",title:"Rumus Kimia (ce)"}]}],Hue=[{label:"⊂",latex:"\\subset",title:"Subset"},{label:"⊃",latex:"\\supset",title:"Superset"},{label:"∅",latex:"\\emptyset",title:"Himpunan kosong"},{label:"∀",latex:"\\forall",title:"Untuk semua"},{label:"∃",latex:"\\exists",title:"Terdapat"}],que={label:"Greek",buttons:[{label:"α",latex:"\\alpha",title:"Alpha"},{label:"β",latex:"\\beta",title:"Beta"},{label:"γ",latex:"\\gamma",title:"Gamma"},{label:"δ",latex:"\\delta",title:"Delta"},{label:"θ",latex:"\\theta",title:"Theta"},{label:"λ",latex:"\\lambda",title:"Lambda"},{label:"μ",latex:"\\mu",title:"Mu"},{label:"π",latex:"\\pi",title:"Pi"},{label:"σ",latex:"\\sigma",title:"Sigma"},{label:"φ",latex:"\\phi",title:"Phi"},{label:"ω",latex:"\\omega",title:"Omega"}]},Wue=[{label:"Σ",latex:"\\sum_{i=1}^{n}",title:"Sigma / Penjumlahan"},{label:"∏",latex:"\\prod_{i=1}^{n}",title:"Produk"},{label:"∫",latex:"\\int_{a}^{b}",title:"Integral"},{label:"lim",latex:"\\lim_{x \\to \\infty}",title:"Limit"}];function Vue(e){return e.map(t=>t.label==="Set"?{...t,buttons:[...t.buttons,...Hue]}:t.label==="Structure"?{...t,buttons:[...t.buttons,...Wue]}:t).reduce((t,n)=>(t.push(n),n.label==="Set"&&t.push(que),t),[])}const Yue=Vue(s8),l8=6;function c8({onInsertLatex:e,onToggleSymbols:t,onToggleTemplates:n,mode:r="basic"}){const[i,a]=V.useState([]),[o,s]=V.useState("Basic"),[l,c]=V.useState(""),u=V.useMemo(()=>r==="olimpiade"?Yue:s8,[r]),d=V.useMemo(()=>u.flatMap(y=>y.buttons),[u]),p=V.useMemo(()=>new Map(d.map(y=>[y.latex,y])),[d]),h=V.useCallback(y=>{e(y),a(v=>[y,...v.filter(E=>E!==y)].slice(0,l8))},[e]),m=V.useMemo(()=>i.map(y=>p.get(y)).filter(y=>!!y),[p,i]),f=l.trim().toLowerCase(),_=V.useMemo(()=>f?u.map(y=>({...y,buttons:y.buttons.filter(v=>`${v.label} ${v.title} ${v.latex}`.toLowerCase().includes(f))})).filter(y=>y.buttons.length>0):u,[f,u]);V.useEffect(()=>{if(typeof window>"u")return;const y=window.localStorage.getItem(i8);y&&s(y);try{const v=window.localStorage.getItem(a8);if(v){const E=JSON.parse(v);Array.isArray(E)&&a(E.slice(0,l8))}}catch{}},[]),V.useEffect(()=>{typeof window>"u"||!o||window.localStorage.setItem(i8,o)},[o]),V.useEffect(()=>{typeof window>"u"||window.localStorage.setItem(a8,JSON.stringify(i))},[i]),V.useEffect(()=>{f&&_.length>0&&s(_[0].label)},[_,f]);const b=V.useCallback(y=>{s(v=>v===y?"":y)},[]);return g.jsxs("div",{className:"mtx-math-toolbar",role:"toolbar","aria-label":"Math toolbar",children:[g.jsxs("div",{className:"mtx-math-toolbar__label",children:[g.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 2l3 6-3 6h2.5l2-4 2 4H11l-3-6 3-6H8.5l-2 4-2-4H2zm9 0v2h4V2h-4zm0 5v2h4V7h-4zm0 5v2h4v-2h-4z"})}),g.jsx("span",{children:"Math"})]}),g.jsx("div",{className:"mtx-math-toolbar__search-wrap",children:g.jsx("input",{type:"search",className:"mtx-math-toolbar__search",value:l,onChange:y=>c(y.target.value),placeholder:"Cari rumus...","aria-label":"Search math formulas"})}),g.jsxs("div",{className:"mtx-math-toolbar__buttons",children:[m.length>0&&g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"mtx-math-toolbar__section-label",children:"Recent"}),m.map(y=>g.jsx(o8,{label:y.label,latex:y.latex,onClick:h,title:`Terakhir dipakai: ${y.title}`,variant:"recent"},`recent-${y.latex}`)),g.jsx("div",{className:"mtx-math-toolbar__section-divider"})]}),_.map(y=>g.jsxs("div",{className:"mtx-math-toolbar__section",children:[g.jsxs("button",{type:"button",className:`mtx-math-toolbar__section-toggle ${o===y.label?"is-active":""}`,onClick:()=>b(y.label),"aria-expanded":o===y.label,"aria-label":`${y.label} group`,children:[g.jsx("span",{children:y.label}),g.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:g.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),o===y.label&&y.buttons.map(v=>g.jsx(o8,{label:v.label,latex:v.latex,onClick:h,title:v.title},v.latex))]},y.label)),f&&_.length===0&&g.jsx("div",{className:"mtx-math-toolbar__empty",children:"No formula matches your search."})]}),g.jsxs("div",{className:"mtx-math-toolbar__actions",children:[g.jsxs("button",{type:"button",className:"mtx-math-toolbar__action-btn",onClick:t,title:"Panel Simbol (α β γ)","data-tooltip":"Panel Simbol (α β γ)",children:[g.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M6.2 2C4.2 2 3 3.8 3 5.5S4.2 9 6.2 9c.8 0 1.5-.3 2-.7L6.7 13h2.1l1.1-3.2C10.7 11 12 12 13 12v-2c-.8 0-1.8-.7-2.2-1.7L12 4H9.9l-.7 2.3C8.7 4.4 7.7 2 6.2 2zm0 2c.9 0 1.5 1.1 1.5 1.5S7 7 6.2 7 4.8 6.2 4.8 5.5 5.3 4 6.2 4z"})}),g.jsx("span",{children:"Simbol"})]}),n&&g.jsxs("button",{type:"button",className:"mtx-math-toolbar__action-btn",onClick:n,title:"Template Rumus","data-tooltip":"Template Rumus",children:[g.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:g.jsx("path",{d:"M2 2h5v5H2V2zm7 0h5v5H9V2zM2 9h5v5H2V9zm7 0h5v5H9V9zM3 3v3h3V3H3zm7 0v3h3V3h-3zM3 10v3h3v-3H3zm7 0v3h3v-3h-3z"})}),g.jsx("span",{children:"Template"})]})]})]})}const u8=[{name:"Huruf Yunani",symbols:[{char:"α",latex:"\\alpha",name:"alpha"},{char:"β",latex:"\\beta",name:"beta"},{char:"γ",latex:"\\gamma",name:"gamma"},{char:"δ",latex:"\\delta",name:"delta"},{char:"ε",latex:"\\epsilon",name:"epsilon"},{char:"ϑ",latex:"\\varepsilon",name:"varepsilon"},{char:"ζ",latex:"\\zeta",name:"zeta"},{char:"η",latex:"\\eta",name:"eta"},{char:"θ",latex:"\\theta",name:"theta"},{char:"λ",latex:"\\lambda",name:"lambda"},{char:"μ",latex:"\\mu",name:"mu"},{char:"π",latex:"\\pi",name:"pi"},{char:"σ",latex:"\\sigma",name:"sigma"},{char:"τ",latex:"\\tau",name:"tau"},{char:"φ",latex:"\\phi",name:"phi"},{char:"ω",latex:"\\omega",name:"omega"},{char:"Δ",latex:"\\Delta",name:"Delta"},{char:"Σ",latex:"\\Sigma",name:"Sigma"},{char:"Ω",latex:"\\Omega",name:"Omega"},{char:"Π",latex:"\\Pi",name:"Pi"},{char:"Φ",latex:"\\Phi",name:"Phi"}]},{name:"Operator",symbols:[{char:"±",latex:"\\pm",name:"plus minus"},{char:"∓",latex:"\\mp",name:"minus plus"},{char:"×",latex:"\\times",name:"kali"},{char:"÷",latex:"\\div",name:"bagi"},{char:"·",latex:"\\cdot",name:"dot"},{char:"∘",latex:"\\circ",name:"komposisi"},{char:"≠",latex:"\\neq",name:"tidak sama"},{char:"≈",latex:"\\approx",name:"kira-kira"},{char:"≡",latex:"\\equiv",name:"identik"},{char:"≤",latex:"\\leq",name:"kurang sama"},{char:"≥",latex:"\\geq",name:"lebih sama"},{char:"≪",latex:"\\ll",name:"jauh kurang"},{char:"≫",latex:"\\gg",name:"jauh lebih"},{char:"∝",latex:"\\propto",name:"sebanding"},{char:"∞",latex:"\\infty",name:"tak hingga"},{char:"∤",latex:"\\nmid",name:"tidak membagi"},{char:"⊕",latex:"\\oplus",name:"plus lingkaran"},{char:"⊗",latex:"\\otimes",name:"kali lingkaran"},{char:"⊖",latex:"\\ominus",name:"minus lingkaran"},{char:"∼",latex:"\\sim",name:"similar"},{char:"≃",latex:"\\simeq",name:"kira-kira sama"},{char:"⊥",latex:"\\perp",name:"tegak lurus"},{char:"∥",latex:"\\parallel",name:"sejajar"},{char:"∣",latex:"\\mid",name:"pembagi"}]},{name:"Himpunan",symbols:[{char:"∈",latex:"\\in",name:"anggota"},{char:"∉",latex:"\\notin",name:"bukan anggota"},{char:"⊂",latex:"\\subset",name:"subset"},{char:"⊃",latex:"\\supset",name:"superset"},{char:"⊆",latex:"\\subseteq",name:"subset sama"},{char:"∪",latex:"\\cup",name:"gabungan"},{char:"∩",latex:"\\cap",name:"irisan"},{char:"∖",latex:"\\setminus",name:"selisih"},{char:"∅",latex:"\\emptyset",name:"himpunan kosong"},{char:"ℕ",latex:"\\mathbb{N}",name:"bilangan asli"},{char:"ℤ",latex:"\\mathbb{Z}",name:"bilangan bulat"},{char:"ℝ",latex:"\\mathbb{R}",name:"bilangan real"},{char:"ℚ",latex:"\\mathbb{Q}",name:"bilangan rasional"},{char:"ℂ",latex:"\\mathbb{C}",name:"bilangan kompleks"}]},{name:"Panah",symbols:[{char:"→",latex:"\\to",name:"panah kanan"},{char:"←",latex:"\\leftarrow",name:"panah kiri"},{char:"↔",latex:"\\leftrightarrow",name:"panah dua arah"},{char:"⇒",latex:"\\Rightarrow",name:"implikasi"},{char:"⇐",latex:"\\Leftarrow",name:"implikasi balik"},{char:"⇔",latex:"\\Leftrightarrow",name:"biimplikasi"},{char:"↑",latex:"\\uparrow",name:"panah atas"},{char:"↓",latex:"\\downarrow",name:"panah bawah"}]},{name:"Logika & Kalkulus",symbols:[{char:"∀",latex:"\\forall",name:"untuk semua"},{char:"∃",latex:"\\exists",name:"ada"},{char:"¬",latex:"\\neg",name:"negasi"},{char:"∧",latex:"\\land",name:"konjungsi (dan)"},{char:"∨",latex:"\\lor",name:"disjungsi (atau)"},{char:"∂",latex:"\\partial",name:"parsial"},{char:"∇",latex:"\\nabla",name:"nabla"},{char:"∑",latex:"\\sum",name:"sigma"},{char:"∏",latex:"\\prod",name:"produk"},{char:"∫",latex:"\\int",name:"integral"},{char:"∬",latex:"\\iint",name:"integral ganda"},{char:"𝔼",latex:"\\mathbb{E}",name:"expected value"},{char:"𝒩",latex:"\\mathcal{N}",name:"caligraphic N"},{char:"â",latex:"\\widehat{x}",name:"widehat"},{char:"ã",latex:"\\widetilde{x}",name:"widetilde"},{char:"op",latex:"\\operatorname{#?}",name:"operator nama sendiri"}]}];function d8({onInsert:e,onClose:t}){const[n,r]=V.useState(""),i=V.useMemo(()=>{if(!n.trim())return u8;const a=n.toLowerCase();return u8.map(o=>({...o,symbols:o.symbols.filter(s=>s.name.toLowerCase().includes(a)||s.char.includes(a)||s.latex.toLowerCase().includes(a))})).filter(o=>o.symbols.length>0)},[n]);return g.jsxs("div",{className:"mtx-symbol-palette",role:"dialog","aria-label":"Symbol Palette",children:[g.jsxs("div",{className:"mtx-symbol-palette__header",children:[g.jsx("span",{className:"mtx-symbol-palette__title",children:"Simbol Matematika"}),g.jsx("button",{className:"mtx-symbol-palette__close",onClick:t,title:"Tutup","aria-label":"Tutup panel simbol",children:"×"})]}),g.jsx("input",{className:"mtx-symbol-palette__search",type:"text",placeholder:"Cari simbol... (cth: alpha, pi, integral)",value:n,onChange:a=>r(a.target.value),autoFocus:!0}),g.jsxs("div",{className:"mtx-symbol-palette__body",children:[i.length===0&&g.jsxs("div",{style:{padding:"20px",textAlign:"center",color:"#94a3b8",fontSize:"13px"},children:['Tidak ditemukan simbol untuk "',n,'"']}),i.map(a=>g.jsxs("div",{className:"mtx-symbol-palette__category",children:[g.jsx("div",{className:"mtx-symbol-palette__category-title",children:a.name}),g.jsx("div",{className:"mtx-symbol-palette__grid",children:a.symbols.map(o=>g.jsx("button",{className:"mtx-symbol-palette__item",onClick:()=>{e(o.latex),t()},title:`${o.name} (${o.latex})`,"aria-label":o.name,children:o.char},o.latex))})]},a.name))]})]})}/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */const{entries:p8,setPrototypeOf:h8,isFrozen:Kue,getPrototypeOf:Que,getOwnPropertyDescriptor:Xue}=Object;let{freeze:Mr,seal:Di,create:dg}=Object,{apply:S2,construct:T2}=typeof Reflect<"u"&&Reflect;Mr||(Mr=function(t){return t}),Di||(Di=function(t){return t}),S2||(S2=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];return t.apply(n,i)}),T2||(T2=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new t(...r)});const pg=Rr(Array.prototype.forEach),jue=Rr(Array.prototype.lastIndexOf),m8=Rr(Array.prototype.pop),th=Rr(Array.prototype.push),Zue=Rr(Array.prototype.splice),hg=Rr(String.prototype.toLowerCase),C2=Rr(String.prototype.toString),w2=Rr(String.prototype.match),nh=Rr(String.prototype.replace),Jue=Rr(String.prototype.indexOf),ede=Rr(String.prototype.trim),si=Rr(Object.prototype.hasOwnProperty),Ir=Rr(RegExp.prototype.test),rh=tde(TypeError);function Rr(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return S2(e,t,r)}}function tde(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return T2(e,n)}}function yt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:hg;h8&&h8(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const a=n(i);a!==i&&(Kue(t)||(t[r]=a),i=a)}e[i]=!0}return e}function nde(e){for(let t=0;t<e.length;t++)si(e,t)||(e[t]=null);return e}function Na(e){const t=dg(null);for(const[n,r]of p8(e))si(e,n)&&(Array.isArray(r)?t[n]=nde(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Na(r):t[n]=r);return t}function ih(e,t){for(;e!==null;){const r=Xue(e,t);if(r){if(r.get)return Rr(r.get);if(typeof r.value=="function")return Rr(r.value)}e=Que(e)}function n(){return null}return n}const f8=Mr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),D2=Mr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),A2=Mr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),rde=Mr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),N2=Mr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),ide=Mr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),g8=Mr(["#text"]),_8=Mr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),k2=Mr(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),b8=Mr(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),mg=Mr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ade=Di(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ode=Di(/<%[\w\W]*|[\w\W]*%>/gm),sde=Di(/\$\{[\w\W]*/gm),lde=Di(/^data-[\-\w.\u00B7-\uFFFF]+$/),cde=Di(/^aria-[\-\w]+$/),y8=Di(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ude=Di(/^(?:\w+script|data):/i),dde=Di(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),v8=Di(/^html$/i),pde=Di(/^[a-z][.\w]*(-[.\w]+)+$/i);var E8=Object.freeze({__proto__:null,ARIA_ATTR:cde,ATTR_WHITESPACE:dde,CUSTOM_ELEMENT:pde,DATA_ATTR:lde,DOCTYPE_NAME:v8,ERB_EXPR:ode,IS_ALLOWED_URI:y8,IS_SCRIPT_OR_DATA:ude,MUSTACHE_EXPR:ade,TMPLIT_EXPR:sde});const ah={element:1,text:3,progressingInstruction:7,comment:8,document:9},hde=function(){return typeof window>"u"?null:window},mde=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const a="dompurify"+(r?"#"+r:"");try{return t.createPolicy(a,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},x8=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function S8(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:hde();const t=et=>S8(et);if(t.version="3.3.3",t.removed=[],!e||!e.document||e.document.nodeType!==ah.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:h}=e,m=l.prototype,f=ih(m,"cloneNode"),_=ih(m,"remove"),b=ih(m,"nextSibling"),y=ih(m,"childNodes"),v=ih(m,"parentNode");if(typeof o=="function"){const et=n.createElement("template");et.content&&et.content.ownerDocument&&(n=et.content.ownerDocument)}let E,T="";const{implementation:S,createNodeIterator:w,createDocumentFragment:M,getElementsByTagName:P}=n,{importNode:z}=r;let ee=x8();t.isSupported=typeof p8=="function"&&typeof v=="function"&&S&&S.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:O,ERB_EXPR:H,TMPLIT_EXPR:x,DATA_ATTR:G,ARIA_ATTR:D,IS_SCRIPT_OR_DATA:A,ATTR_WHITESPACE:I,CUSTOM_ELEMENT:B}=E8;let{IS_ALLOWED_URI:$}=E8,R=null;const L=yt({},[...f8,...D2,...A2,...N2,...g8]);let J=null;const se=yt({},[..._8,...k2,...b8,...mg]);let ne=Object.seal(dg(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ge=null,Ne=null;const Ae=Object.seal(dg(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let be=!0,Re=!0,we=!1,K=!0,ye=!1,N=!0,X=!1,Y=!1,q=!1,U=!1,Q=!1,me=!1,he=!0,le=!1;const Z="user-content-";let ie=!0,pe=!1,ae={},oe=null;const fe=yt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let _e=null;const ve=yt({},["audio","video","img","source","image","track"]);let Ue=null;const Qe=yt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),rt="http://www.w3.org/1998/Math/MathML",Tt="http://www.w3.org/2000/svg",un="http://www.w3.org/1999/xhtml";let dn=un,Xo=!1,ap=null;const ov=yt({},[rt,Tt,un],C2);let tu=yt({},["mi","mo","mn","ms","mtext"]),El=yt({},["annotation-xml"]);const xl=yt({},["title","style","font","a","script"]);let ha=null;const vV=["application/xhtml+xml","text/html"],EV="text/html";let kn=null,nu=null;const xV=n.createElement("form"),$D=function(ce){return ce instanceof RegExp||ce instanceof Function},sv=function(){let ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(nu&&nu===ce)){if((!ce||typeof ce!="object")&&(ce={}),ce=Na(ce),ha=vV.indexOf(ce.PARSER_MEDIA_TYPE)===-1?EV:ce.PARSER_MEDIA_TYPE,kn=ha==="application/xhtml+xml"?C2:hg,R=si(ce,"ALLOWED_TAGS")?yt({},ce.ALLOWED_TAGS,kn):L,J=si(ce,"ALLOWED_ATTR")?yt({},ce.ALLOWED_ATTR,kn):se,ap=si(ce,"ALLOWED_NAMESPACES")?yt({},ce.ALLOWED_NAMESPACES,C2):ov,Ue=si(ce,"ADD_URI_SAFE_ATTR")?yt(Na(Qe),ce.ADD_URI_SAFE_ATTR,kn):Qe,_e=si(ce,"ADD_DATA_URI_TAGS")?yt(Na(ve),ce.ADD_DATA_URI_TAGS,kn):ve,oe=si(ce,"FORBID_CONTENTS")?yt({},ce.FORBID_CONTENTS,kn):fe,ge=si(ce,"FORBID_TAGS")?yt({},ce.FORBID_TAGS,kn):Na({}),Ne=si(ce,"FORBID_ATTR")?yt({},ce.FORBID_ATTR,kn):Na({}),ae=si(ce,"USE_PROFILES")?ce.USE_PROFILES:!1,be=ce.ALLOW_ARIA_ATTR!==!1,Re=ce.ALLOW_DATA_ATTR!==!1,we=ce.ALLOW_UNKNOWN_PROTOCOLS||!1,K=ce.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ye=ce.SAFE_FOR_TEMPLATES||!1,N=ce.SAFE_FOR_XML!==!1,X=ce.WHOLE_DOCUMENT||!1,U=ce.RETURN_DOM||!1,Q=ce.RETURN_DOM_FRAGMENT||!1,me=ce.RETURN_TRUSTED_TYPE||!1,q=ce.FORCE_BODY||!1,he=ce.SANITIZE_DOM!==!1,le=ce.SANITIZE_NAMED_PROPS||!1,ie=ce.KEEP_CONTENT!==!1,pe=ce.IN_PLACE||!1,$=ce.ALLOWED_URI_REGEXP||y8,dn=ce.NAMESPACE||un,tu=ce.MATHML_TEXT_INTEGRATION_POINTS||tu,El=ce.HTML_INTEGRATION_POINTS||El,ne=ce.CUSTOM_ELEMENT_HANDLING||{},ce.CUSTOM_ELEMENT_HANDLING&&$D(ce.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ne.tagNameCheck=ce.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ce.CUSTOM_ELEMENT_HANDLING&&$D(ce.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ne.attributeNameCheck=ce.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ce.CUSTOM_ELEMENT_HANDLING&&typeof ce.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ne.allowCustomizedBuiltInElements=ce.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ye&&(Re=!1),Q&&(U=!0),ae&&(R=yt({},g8),J=dg(null),ae.html===!0&&(yt(R,f8),yt(J,_8)),ae.svg===!0&&(yt(R,D2),yt(J,k2),yt(J,mg)),ae.svgFilters===!0&&(yt(R,A2),yt(J,k2),yt(J,mg)),ae.mathMl===!0&&(yt(R,N2),yt(J,b8),yt(J,mg))),si(ce,"ADD_TAGS")||(Ae.tagCheck=null),si(ce,"ADD_ATTR")||(Ae.attributeCheck=null),ce.ADD_TAGS&&(typeof ce.ADD_TAGS=="function"?Ae.tagCheck=ce.ADD_TAGS:(R===L&&(R=Na(R)),yt(R,ce.ADD_TAGS,kn))),ce.ADD_ATTR&&(typeof ce.ADD_ATTR=="function"?Ae.attributeCheck=ce.ADD_ATTR:(J===se&&(J=Na(J)),yt(J,ce.ADD_ATTR,kn))),ce.ADD_URI_SAFE_ATTR&&yt(Ue,ce.ADD_URI_SAFE_ATTR,kn),ce.FORBID_CONTENTS&&(oe===fe&&(oe=Na(oe)),yt(oe,ce.FORBID_CONTENTS,kn)),ce.ADD_FORBID_CONTENTS&&(oe===fe&&(oe=Na(oe)),yt(oe,ce.ADD_FORBID_CONTENTS,kn)),ie&&(R["#text"]=!0),X&&yt(R,["html","head","body"]),R.table&&(yt(R,["tbody"]),delete ge.tbody),ce.TRUSTED_TYPES_POLICY){if(typeof ce.TRUSTED_TYPES_POLICY.createHTML!="function")throw rh('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ce.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw rh('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=ce.TRUSTED_TYPES_POLICY,T=E.createHTML("")}else E===void 0&&(E=mde(h,i)),E!==null&&typeof T=="string"&&(T=E.createHTML(""));Mr&&Mr(ce),nu=ce}},GD=yt({},[...D2,...A2,...rde]),HD=yt({},[...N2,...ide]),SV=function(ce){let Be=v(ce);(!Be||!Be.tagName)&&(Be={namespaceURI:dn,tagName:"template"});const je=hg(ce.tagName),nn=hg(Be.tagName);return ap[ce.namespaceURI]?ce.namespaceURI===Tt?Be.namespaceURI===un?je==="svg":Be.namespaceURI===rt?je==="svg"&&(nn==="annotation-xml"||tu[nn]):!!GD[je]:ce.namespaceURI===rt?Be.namespaceURI===un?je==="math":Be.namespaceURI===Tt?je==="math"&&El[nn]:!!HD[je]:ce.namespaceURI===un?Be.namespaceURI===Tt&&!El[nn]||Be.namespaceURI===rt&&!tu[nn]?!1:!HD[je]&&(xl[je]||!GD[je]):!!(ha==="application/xhtml+xml"&&ap[ce.namespaceURI]):!1},ma=function(ce){th(t.removed,{element:ce});try{v(ce).removeChild(ce)}catch{_(ce)}},Sl=function(ce,Be){try{th(t.removed,{attribute:Be.getAttributeNode(ce),from:Be})}catch{th(t.removed,{attribute:null,from:Be})}if(Be.removeAttribute(ce),ce==="is")if(U||Q)try{ma(Be)}catch{}else try{Be.setAttribute(ce,"")}catch{}},qD=function(ce){let Be=null,je=null;if(q)ce="<remove></remove>"+ce;else{const Cn=w2(ce,/^[\r\n\t ]+/);je=Cn&&Cn[0]}ha==="application/xhtml+xml"&&dn===un&&(ce='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ce+"</body></html>");const nn=E?E.createHTML(ce):ce;if(dn===un)try{Be=new p().parseFromString(nn,ha)}catch{}if(!Be||!Be.documentElement){Be=S.createDocument(dn,"template",null);try{Be.documentElement.innerHTML=Xo?T:nn}catch{}}const or=Be.body||Be.documentElement;return ce&&je&&or.insertBefore(n.createTextNode(je),or.childNodes[0]||null),dn===un?P.call(Be,X?"html":"body")[0]:X?Be.documentElement:or},WD=function(ce){return w.call(ce.ownerDocument||ce,ce,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},lv=function(ce){return ce instanceof d&&(typeof ce.nodeName!="string"||typeof ce.textContent!="string"||typeof ce.removeChild!="function"||!(ce.attributes instanceof u)||typeof ce.removeAttribute!="function"||typeof ce.setAttribute!="function"||typeof ce.namespaceURI!="string"||typeof ce.insertBefore!="function"||typeof ce.hasChildNodes!="function")},VD=function(ce){return typeof s=="function"&&ce instanceof s};function ja(et,ce,Be){pg(et,je=>{je.call(t,ce,Be,nu)})}const YD=function(ce){let Be=null;if(ja(ee.beforeSanitizeElements,ce,null),lv(ce))return ma(ce),!0;const je=kn(ce.nodeName);if(ja(ee.uponSanitizeElement,ce,{tagName:je,allowedTags:R}),N&&ce.hasChildNodes()&&!VD(ce.firstElementChild)&&Ir(/<[/\w!]/g,ce.innerHTML)&&Ir(/<[/\w!]/g,ce.textContent)||ce.nodeType===ah.progressingInstruction||N&&ce.nodeType===ah.comment&&Ir(/<[/\w]/g,ce.data))return ma(ce),!0;if(!(Ae.tagCheck instanceof Function&&Ae.tagCheck(je))&&(!R[je]||ge[je])){if(!ge[je]&&QD(je)&&(ne.tagNameCheck instanceof RegExp&&Ir(ne.tagNameCheck,je)||ne.tagNameCheck instanceof Function&&ne.tagNameCheck(je)))return!1;if(ie&&!oe[je]){const nn=v(ce)||ce.parentNode,or=y(ce)||ce.childNodes;if(or&&nn){const Cn=or.length;for(let Gr=Cn-1;Gr>=0;--Gr){const Za=f(or[Gr],!0);Za.__removalCount=(ce.__removalCount||0)+1,nn.insertBefore(Za,b(ce))}}}return ma(ce),!0}return ce instanceof l&&!SV(ce)||(je==="noscript"||je==="noembed"||je==="noframes")&&Ir(/<\/no(script|embed|frames)/i,ce.innerHTML)?(ma(ce),!0):(ye&&ce.nodeType===ah.text&&(Be=ce.textContent,pg([O,H,x],nn=>{Be=nh(Be,nn," ")}),ce.textContent!==Be&&(th(t.removed,{element:ce.cloneNode()}),ce.textContent=Be)),ja(ee.afterSanitizeElements,ce,null),!1)},KD=function(ce,Be,je){if(Ne[Be]||he&&(Be==="id"||Be==="name")&&(je in n||je in xV))return!1;if(!(Re&&!Ne[Be]&&Ir(G,Be))){if(!(be&&Ir(D,Be))){if(!(Ae.attributeCheck instanceof Function&&Ae.attributeCheck(Be,ce))){if(!J[Be]||Ne[Be]){if(!(QD(ce)&&(ne.tagNameCheck instanceof RegExp&&Ir(ne.tagNameCheck,ce)||ne.tagNameCheck instanceof Function&&ne.tagNameCheck(ce))&&(ne.attributeNameCheck instanceof RegExp&&Ir(ne.attributeNameCheck,Be)||ne.attributeNameCheck instanceof Function&&ne.attributeNameCheck(Be,ce))||Be==="is"&&ne.allowCustomizedBuiltInElements&&(ne.tagNameCheck instanceof RegExp&&Ir(ne.tagNameCheck,je)||ne.tagNameCheck instanceof Function&&ne.tagNameCheck(je))))return!1}else if(!Ue[Be]){if(!Ir($,nh(je,I,""))){if(!((Be==="src"||Be==="xlink:href"||Be==="href")&&ce!=="script"&&Jue(je,"data:")===0&&_e[ce])){if(!(we&&!Ir(A,nh(je,I,"")))){if(je)return!1}}}}}}}return!0},QD=function(ce){return ce!=="annotation-xml"&&w2(ce,B)},XD=function(ce){ja(ee.beforeSanitizeAttributes,ce,null);const{attributes:Be}=ce;if(!Be||lv(ce))return;const je={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:J,forceKeepAttr:void 0};let nn=Be.length;for(;nn--;){const or=Be[nn],{name:Cn,namespaceURI:Gr,value:Za}=or,ru=kn(Cn),cv=Za;let Qn=Cn==="value"?cv:ede(cv);if(je.attrName=ru,je.attrValue=Qn,je.keepAttr=!0,je.forceKeepAttr=void 0,ja(ee.uponSanitizeAttribute,ce,je),Qn=je.attrValue,le&&(ru==="id"||ru==="name")&&(Sl(Cn,ce),Qn=Z+Qn),N&&Ir(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Qn)){Sl(Cn,ce);continue}if(ru==="attributename"&&w2(Qn,"href")){Sl(Cn,ce);continue}if(je.forceKeepAttr)continue;if(!je.keepAttr){Sl(Cn,ce);continue}if(!K&&Ir(/\/>/i,Qn)){Sl(Cn,ce);continue}ye&&pg([O,H,x],ZD=>{Qn=nh(Qn,ZD," ")});const jD=kn(ce.nodeName);if(!KD(jD,ru,Qn)){Sl(Cn,ce);continue}if(E&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!Gr)switch(h.getAttributeType(jD,ru)){case"TrustedHTML":{Qn=E.createHTML(Qn);break}case"TrustedScriptURL":{Qn=E.createScriptURL(Qn);break}}if(Qn!==cv)try{Gr?ce.setAttributeNS(Gr,Cn,Qn):ce.setAttribute(Cn,Qn),lv(ce)?ma(ce):m8(t.removed)}catch{Sl(Cn,ce)}}ja(ee.afterSanitizeAttributes,ce,null)},TV=function et(ce){let Be=null;const je=WD(ce);for(ja(ee.beforeSanitizeShadowDOM,ce,null);Be=je.nextNode();)ja(ee.uponSanitizeShadowNode,Be,null),YD(Be),XD(Be),Be.content instanceof a&&et(Be.content);ja(ee.afterSanitizeShadowDOM,ce,null)};return t.sanitize=function(et){let ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Be=null,je=null,nn=null,or=null;if(Xo=!et,Xo&&(et="<!-->"),typeof et!="string"&&!VD(et))if(typeof et.toString=="function"){if(et=et.toString(),typeof et!="string")throw rh("dirty is not a string, aborting")}else throw rh("toString is not a function");if(!t.isSupported)return et;if(Y||sv(ce),t.removed=[],typeof et=="string"&&(pe=!1),pe){if(et.nodeName){const Za=kn(et.nodeName);if(!R[Za]||ge[Za])throw rh("root node is forbidden and cannot be sanitized in-place")}}else if(et instanceof s)Be=qD("<!---->"),je=Be.ownerDocument.importNode(et,!0),je.nodeType===ah.element&&je.nodeName==="BODY"||je.nodeName==="HTML"?Be=je:Be.appendChild(je);else{if(!U&&!ye&&!X&&et.indexOf("<")===-1)return E&&me?E.createHTML(et):et;if(Be=qD(et),!Be)return U?null:me?T:""}Be&&q&&ma(Be.firstChild);const Cn=WD(pe?et:Be);for(;nn=Cn.nextNode();)YD(nn),XD(nn),nn.content instanceof a&&TV(nn.content);if(pe)return et;if(U){if(Q)for(or=M.call(Be.ownerDocument);Be.firstChild;)or.appendChild(Be.firstChild);else or=Be;return(J.shadowroot||J.shadowrootmode)&&(or=z.call(r,or,!0)),or}let Gr=X?Be.outerHTML:Be.innerHTML;return X&&R["!doctype"]&&Be.ownerDocument&&Be.ownerDocument.doctype&&Be.ownerDocument.doctype.name&&Ir(v8,Be.ownerDocument.doctype.name)&&(Gr="<!DOCTYPE "+Be.ownerDocument.doctype.name+`>
403
403
  `+Gr),ye&&pg([O,H,x],Za=>{Gr=nh(Gr,Za," ")}),E&&me?E.createHTML(Gr):Gr},t.setConfig=function(){let et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};sv(et),Y=!0},t.clearConfig=function(){nu=null,Y=!1},t.isValidAttribute=function(et,ce,Be){nu||sv({});const je=kn(et),nn=kn(ce);return KD(je,nn,Be)},t.addHook=function(et,ce){typeof ce=="function"&&th(ee[et],ce)},t.removeHook=function(et,ce){if(ce!==void 0){const Be=jue(ee[et],ce);return Be===-1?void 0:Zue(ee[et],Be,1)[0]}return m8(ee[et])},t.removeHooks=function(et){ee[et]=[]},t.removeAllHooks=function(){ee=x8()},t}var O2=S8();const fde=/<(p|h[1-4]|li)\b([^>]*)>/gi;function T8(e,t,n){const r=new RegExp(`\\s${t}=(['"]).*?\\1`,"i");return r.test(e)?e.replace(r,` ${t}="${n}"`):`${e} ${t}="${n}"`}function M2(e){return e.replace(fde,(t,n,r="")=>{var u;const i=r.match(/\sclass=(['"])(.*?)\1/i),a=r.match(/\sdata-indent=(['"])(\d+)\1/i),s=((u=i==null?void 0:i[2].match(/(?:^|\s)tt-indent-(\d+)(?:\s|$)/))==null?void 0:u[1])||(a==null?void 0:a[2]);if(!s)return t;const l=new Set(((i==null?void 0:i[2])||"").split(/\s+/).filter(Boolean));l.add("tt-indent"),l.add(`tt-indent-${s}`);let c=r;return c=T8(c,"class",Array.from(l).join(" ")),c=T8(c,"data-indent",s),`<${n}${c}>`})}function I2(e){const n=e.getHTML().replace(/<math-field\b([^>]*)>[\s\S]*?<\/math-field>/gi,(r,i)=>{var l,c;const a=(((l=i.match(/data-latex="([^"]*)"/))==null?void 0:l[1])??"").replace(/"/g,"&quot;"),o=((c=i.match(/data-display="([^"]*)"/))==null?void 0:c[1])??"inline";return`<span class="${o==="block"?"mtx-math-block":"mtx-math-inline"}" data-type="math-${o}" data-latex="${a}" data-display="${o}"></span>`}).replace(/<style\b[\s\S]*?<\/style>/gi,"").replace(/<link\b[^>]*\/?>/gi,"");return M2(n)}function gde(e){return e.getJSON()}function C8(e){if(!e)return"";let t=e;return t=t.replace(/\s*data-cke-[a-z-]*="[^"]*"/gi,""),t=t.replace(/\s*contenteditable="[^"]*"/gi,""),t=t.replace(/<span[^>]*class="[^"]*cke_widget[^"]*"[^>]*>/gi,""),t=t.replace(/<img[^>]*class="[^"]*Wirisformula[^"]*"[^>]*data-mathml="([^"]*)"[^>]*\/?>/gi,(n,r)=>{const i=decodeURIComponent(r);return`<span class="mtx-math-inline" data-mathml="${encodeURIComponent(i)}">${i}</span>`}),t=O2.sanitize(t,{ALLOWED_TAGS:["p","br","b","strong","i","em","u","s","sub","sup","h1","h2","h3","h4","h5","h6","ul","ol","li","table","thead","tbody","tfoot","tr","td","th","div","span","a","img","figure","figcaption","pre","code","blockquote","hr","br","wbr","col","colgroup","caption","math-field","math","mi","mo","mn","msup","msub","mrow","mfrac","msqrt","mroot","mover","munder","munderover","mspace","mstyle","mtext","menclose","mfenced","merror","mpadded","mphantom","mprescripts","none"],ALLOWED_ATTR:["href","target","rel","title","src","alt","width","height","class","id","style","align","data-align","data-theme","data-colwidth","data-rowheight","data-latex","data-type","data-display","data-offset-x","data-offset-y","data-table-width","lang","dir","hidden","value","virtual-keyboard-mode","math-virtual-keyboard-policy","smart-mode","smart-fence","smart-superscript"],ALLOW_DATA_ATTR:!0}),M2(t)}function _de(e){if(!e)return"";let t=e;return t=t.replace(/<span[^>]*class="mtx-math[^"]*"[^>]*data-latex="([^"]*)"[^>]*>.*?<\/span>/gi,(n,r)=>`<span class="mtx-math-inline" data-latex="${r}">\\(${r}\\)</span>`),M2(t)}function bde(e){return e.replace(/class="MsoNormal"/g,"").replace(/class="MsoListParagraph"/g,"").replace(/style="[^"]*mso-[^"]*"/g,"").replace(/<!--\[if[\s\S]*?<!\[endif\]-->/g,"").replace(/<o:p>.*?<\/o:p>/g,"").replace(/<w:.*?>.*?<\/w:.*?>/g,"").replace(/<style[\s\S]*?<\/style>/g,"").replace(/<meta[\s\S]*?>/g,"").replace(/\n/g,"<br>")}function yde(e){let t=e;return t=t.replace(/<span style="([^"]*font-weight:\s*[7-9]\d{2}[^"]*)"([^>]*)>/g,'<strong style="$1"$2>'),t=t.replace(/<\/strong>\s*<strong style="([^"]*)"([^>]*)>/g,""),t=t.replace(/<span style="([^"]*font-style:\s*italic[^"]*)"([^>]*)>/g,'<em style="$1"$2>'),t=t.replace(/<span style="([^"]*text-decoration:\s*underline[^"]*)"([^>]*)>/g,'<u style="$1"$2>'),t=t.replace(/<span style="([^"]*text-decoration:\s*line-through[^"]*)"([^>]*)>/g,'<s style="$1"$2>'),t}function vde(e){let t=e;return t=t.replace(/<meta[^>]*>/gi,""),t=t.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),t=t.replace(/<b\s+[^>]*id="docs-internal-guid-[^"]*"[^>]*>([\s\S]*?)<\/b>/i,"$1"),t=t.replace(/<span\s+class="[^"]*c\d+[^"]*"[^>]*>\s*<\/span>/gi,""),t=t.replace(/<span[^>]*>\s*<\/span>/g,""),t=t.replace(/margin-left:\s*\d+\.?\d*pt[^"']*/g,""),t=t.replace(/text-indent:\s*-?\d+\.?\d*pt[^"']*/g,""),t=t.replace(/font-family:\s*[^;"']+[;"']?\s*/g,""),t}function Ede(e){let t=e;return t=t.replace(/<table([^>]*)>/g,(n,r)=>`<table${r.replace(/border-collapse:\s*collapse;?/g,"").replace(/border-spacing:\s*\d+px;?/g,"").replace(/margin-left:\s*[^;"']+[;"']?/g,"").replace(/width:\s*[^;"']+[;"']?/g,"")}>`),t=t.replace(/cellpadding="[^"]*"/g,""),t=t.replace(/cellspacing="[^"]*"/g,""),t=t.replace(/<(t[dh])([^>]*)>/g,(n,r,i)=>{const a=i.replace(/padding:\s*[^;"']+[;"']?/g,"").replace(/border-color:\s*[^;"']+[;"']?/g,"").replace(/overflow-wrap:\s*[^;"']+[;"']?/g,"").replace(/vertical-align:\s*baseline;?/g,"").replace(/width:\s*\d+px;?/g,"").replace(/height:\s*\d+px;?/g,"");return`<${r}${a}>`}),t=t.replace(/class="[^"]*lst-kix[^"]*"/g,""),t}function xde(e){let t=e;return t=yde(t),t=vde(t),t=Ede(t),t=t.replace(/class="([^"]*?)c\d+[^"]*"/g,'class=""'),t=t.replace(/ class=""/g,""),t=t.replace(/class="[^"]*kix-[^"]*"/g,""),t=t.replace(/class="[^"]*lst-kix[^"]*"/g,""),t=t.replace(/ style=""/g,""),t=t.replace(/ style="\s*"/g,""),t=t.replace(/\s+id="docs-internal-guid[^"]*"/g,""),t=t.replace(/\s+id="[^"]*"/g,""),t=t.replace(/<a([^>]*)class="[^"]*"[^>]*>/g,(n,r)=>`<a${r}>`),t=t.replace(/\s+style="\s*"/g,""),t}function Sde(e,t,n){var c,u;const r=(c=t.clipboardData)==null?void 0:c.getData("text/html"),i=(u=t.clipboardData)==null?void 0:u.getData("text/plain");if(!r&&i||!r)return!1;const a=r.includes("mso-")||r.includes("MsoNormal")||r.includes("<o:p>"),o=r.includes("kix-")||r.includes("docs-internal-guid"),l=/<img\b[^>]*>/i.test(r)&&n;return a||o||l?(t.preventDefault(),(async()=>{let p=r;if(a&&(p=bde(r)),o&&(p=xde(p)),l)try{p=await n(p)}catch{}p=O2.sanitize(p,{ALLOWED_TAGS:["p","br","b","strong","i","em","u","s","sub","sup","h1","h2","h3","h4","h5","h6","ul","ol","li","table","thead","tbody","tfoot","tr","td","th","div","span","a","img","figure","figcaption","pre","code","blockquote","hr","br","wbr","col","colgroup","caption"],ALLOWED_ATTR:["href","target","rel","title","src","alt","width","height","class","id","style","align","data-align","data-theme","data-colwidth","data-rowheight","data-latex","data-type","data-offset-x","data-offset-y","data-table-width","lang","dir","hidden"],ALLOW_DATA_ATTR:!0}),e.chain().focus().insertContent(p).run()})(),!0):!1}function Tde(e,t){var r;const n=t;if(n.shiftKey&&(n.ctrlKey||n.metaKey)){t.preventDefault();const i=(r=t.clipboardData)==null?void 0:r.getData("text/plain");if(i)return e.chain().focus().insertContent(i).run(),!0}return!1}function Cde(e){let t=e;return t=t.replace(/<td>\s*<\/td>/gi,"<td><p><br></p></td>"),t=t.replace(/<th>\s*<\/th>/gi,"<th><p><br></p></th>"),t=t.replace(/<td><p>\s*<\/p><\/td>/gi,"<td><p><br></p></td>"),t=t.replace(/<th><p>\s*<\/p><\/th>/gi,"<th><p><br></p></th>"),t=t.replace(/(<p>\s*<\/p>\s*){2,}/gi,"<p><br></p>"),t=t.replace(/<a\s[^>]*>(<[^>]+><\/[^>]+>)<\/a>/gi,"$1"),t}async function wde(e,t){const n=await e.arrayBuffer(),r=new Map,i=await Promise.resolve().then(()=>lDe),a=i.default??i,o=await a.convertToHtml({arrayBuffer:n},{convertImage:a.images.imgElement(l=>l.readAsArrayBuffer().then(c=>{const u=`img-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return r.set(u,{contentType:l.contentType||"image/png",arrayBuffer:c}),{src:`data:${l.contentType||"image/png"};base64,placeholder`}}))});let s=Cde(o.value);if(t){const l=[],c=[];for(const[u,d]of r)l.push(t(u,d.contentType,d.arrayBuffer).then(p=>{c.push({placeholder:`data:${d.contentType};base64,placeholder`,url:p})}));await Promise.allSettled(l);for(const{placeholder:u,url:d}of c)s=s.replace(u,d)}return{html:s,warnings:o.messages.map(l=>l.message),images:r}}async function Dde(e,t,n){if(!e.name.endsWith(".docx"))throw new Error("Hanya file .docx yang didukung");const r=await wde(e,n);if(!r.html.trim())throw new Error("File .docx kosong atau tidak bisa dibaca");try{t.chain().focus().insertContent(r.html).run()}catch(i){throw i instanceof Error&&i.message.includes("Invalid content for node")?new Error("Format .docx tidak sepenuhnya kompatibel. Coba save ulang file dari Word/Google Docs, lalu coba lagi. (Error: tabel/konten tidak dikenali)"):i}return r.warnings}function R2(e){let t=0;return e.descendants(n=>{var r;n.isText&&(t+=((r=n.text)==null?void 0:r.split(/\s+/).filter(i=>i.length>0).length)||0)}),t}function L2(e,t=!0){var r;let n=0;return e.descendants(i=>{var a;i.isText&&(n+=((a=i.text)==null?void 0:a.length)||0)}),t?n:n-(((r=e.textContent)==null?void 0:r.split(" ").length)-1||0)}const Ade=120,w8=V.memo(({editor:e})=>{const[t,n]=V.useState({words:0,chars:0}),r=V.useRef(null);return V.useEffect(()=>{if(!e)return;const i=()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{n({words:R2(e.state.doc),chars:L2(e.state.doc,!0)})},Ade)};return n({words:R2(e.state.doc),chars:L2(e.state.doc,!0)}),e.on("transaction",i),()=>{e.off("transaction",i),r.current&&clearTimeout(r.current)}},[e]),g.jsxs("div",{className:"mtx-word-count",children:[g.jsxs("span",{children:[t.words," ",t.words===1?"word":"words"]}),g.jsxs("span",{children:[t.chars," ",t.chars===1?"character":"characters"]})]})});class Nde extends V.Component{constructor(n){super(n);MV(this,"handleRetry",()=>{this.setState({hasError:!1,error:null})});this.state={hasError:!1,error:null}}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,r){var i,a;so.error("ErrorBoundary caught: "+n.message),(a=(i=this.props).onError)==null||a.call(i,n,r)}render(){var n;return this.state.hasError?this.props.fallback?this.props.fallback:g.jsxs("div",{style:{padding:"24px",background:"#fef2f2",border:"1px solid #fecaca",borderRadius:"8px",color:"#991b1b",fontFamily:"'Segoe UI', system-ui, sans-serif"},children:[g.jsx("div",{style:{fontSize:"16px",fontWeight:600,marginBottom:"8px"},children:"Terjadi kesalahan pada editor"}),g.jsx("div",{style:{fontSize:"13px",marginBottom:"12px",color:"#b91c1c"},children:((n=this.state.error)==null?void 0:n.message)||"Unknown error"}),g.jsx("button",{onClick:this.handleRetry,style:{padding:"6px 16px",border:"1px solid #fca5a5",borderRadius:"6px",background:"white",color:"#991b1b",cursor:"pointer",fontSize:"13px",fontWeight:500},type:"button",children:"Coba Lagi"})]}):this.props.children}}const kde=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function D8(e){return Array.from(e.querySelectorAll(kde)).filter(t=>!t.hasAttribute("disabled")&&t.getAttribute("aria-hidden")!=="true")}function Jl({isOpen:e,dialogRef:t,onClose:n}){V.useEffect(()=>{if(!e||!t.current)return;const r=t.current,i=document.activeElement instanceof HTMLElement?document.activeElement:null,a=D8(r);(a.find(l=>l.hasAttribute("autofocus"))||a[0]||r).focus();const s=l=>{if(l.key==="Escape"){l.preventDefault(),n();return}if(l.key!=="Tab")return;const c=D8(r);if(c.length===0){l.preventDefault(),r.focus();return}const u=c[0],d=c[c.length-1],p=document.activeElement;if(l.shiftKey){(p===u||p===r)&&(l.preventDefault(),d.focus());return}p===d&&(l.preventDefault(),u.focus())};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),i==null||i.focus()}},[t,e,n])}const P2={width:720,height:"auto",align:"center",alt:"",title:"",maintainAspectRatio:!0};function A8({isOpen:e,onClose:t,onApply:n,initialData:r}){const i=V.useId(),a=V.useRef(null),[o,s]=V.useState({...P2,...r});V.useEffect(()=>{r&&s({...P2,...r})},[r]),Jl({isOpen:e,dialogRef:a,onClose:t});const l=V.useCallback(p=>{s(h=>{const m=p;if(h.maintainAspectRatio&&h.naturalWidth&&h.naturalHeight&&!String(p).endsWith("%")){const f=Number(String(p).replace(/[^0-9.]/g,""));if(!Number.isNaN(f)&&f>0){const _=h.naturalHeight/h.naturalWidth,b=Math.round(f*_);return{...h,width:m,height:b}}}return{...h,width:m}})},[]),c=V.useCallback(p=>{s(h=>{const m=p;if(h.maintainAspectRatio&&h.naturalWidth&&h.naturalHeight&&!String(p).endsWith("%")){const f=Number(String(p).replace(/[^0-9.]/g,""));if(!Number.isNaN(f)&&f>0){const _=h.naturalWidth/h.naturalHeight,b=Math.round(f*_);return{...h,width:b,height:m}}}return{...h,height:m}})},[]),u=V.useCallback(()=>{n(o),t()},[o,n,t]),d=V.useCallback(()=>{s({...P2,...r})},[r]);return e?g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"mtx-dialog-overlay",onClick:t}),g.jsxs("div",{className:"mtx-image-edit-dialog",ref:a,role:"dialog","aria-modal":"true","aria-labelledby":i,tabIndex:-1,children:[g.jsxs("div",{className:"mtx-image-edit-dialog__header",children:[g.jsx("h3",{id:i,children:"Edit Gambar"}),g.jsx("button",{className:"mtx-image-edit-dialog__close",onClick:t,"aria-label":"Tutup",children:"✕"})]}),g.jsxs("div",{className:"mtx-image-edit-dialog__body",children:[g.jsxs("div",{className:"mtx-image-edit-dialog__section",children:[g.jsx("h4",{children:"Ukuran"}),g.jsxs("div",{className:"mtx-image-edit-dialog__row",children:[g.jsx("label",{children:"Lebar (px atau %)"}),g.jsx("input",{type:"text",value:o.width,onChange:p=>l(p.target.value),placeholder:"100% atau 300"})]}),g.jsxs("div",{className:"mtx-image-edit-dialog__row",children:[g.jsx("label",{children:"Tinggi (px atau auto)"}),g.jsx("input",{type:"text",value:o.height,onChange:p=>c(p.target.value),placeholder:"auto atau 200"})]}),g.jsxs("div",{className:"mtx-image-edit-dialog__checkbox-row",children:[g.jsx("input",{type:"checkbox",id:"maintain-aspect",checked:o.maintainAspectRatio,onChange:p=>s(h=>({...h,maintainAspectRatio:p.target.checked}))}),g.jsx("label",{htmlFor:"maintain-aspect",children:"Pertahankan proporsi"})]}),g.jsxs("div",{className:"mtx-image-edit-dialog__size-presets",children:[g.jsx("button",{onClick:()=>l("25%"),className:"mtx-btn-sm",children:"25%"}),g.jsx("button",{onClick:()=>l("50%"),className:"mtx-btn-sm",children:"50%"}),g.jsx("button",{onClick:()=>l("75%"),className:"mtx-btn-sm",children:"75%"}),g.jsx("button",{onClick:()=>l("100%"),className:"mtx-btn-sm",children:"100%"})]})]}),g.jsxs("div",{className:"mtx-image-edit-dialog__section",children:[g.jsx("h4",{children:"Posisi & Alignment"}),g.jsxs("div",{className:"mtx-image-edit-dialog__alignment-options",children:[g.jsxs("button",{className:`mtx-align-btn ${o.align==="left"?"is-active":""}`,onClick:()=>s(p=>({...p,align:"left"})),title:"Kiri (Text Wrapping)",children:[g.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:[g.jsx("rect",{x:"3",y:"5",width:"8",height:"14",rx:"1",fill:"currentColor",opacity:"0.5"}),g.jsx("line",{x1:"13",y1:"7",x2:"21",y2:"7",stroke:"currentColor",strokeWidth:"2"}),g.jsx("line",{x1:"13",y1:"11",x2:"21",y2:"11",stroke:"currentColor",strokeWidth:"2"}),g.jsx("line",{x1:"13",y1:"15",x2:"21",y2:"15",stroke:"currentColor",strokeWidth:"2"}),g.jsx("line",{x1:"13",y1:"19",x2:"18",y2:"19",stroke:"currentColor",strokeWidth:"2"})]}),g.jsx("span",{children:"Kiri"})]}),g.jsxs("button",{className:`mtx-align-btn ${o.align==="center"?"is-active":""}`,onClick:()=>s(p=>({...p,align:"center"})),title:"Tengah",children:[g.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:g.jsx("rect",{x:"8",y:"5",width:"8",height:"14",rx:"1",fill:"currentColor",opacity:"0.5"})}),g.jsx("span",{children:"Tengah"})]}),g.jsxs("button",{className:`mtx-align-btn ${o.align==="right"?"is-active":""}`,onClick:()=>s(p=>({...p,align:"right"})),title:"Kanan (Text Wrapping)",children:[g.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:[g.jsx("rect",{x:"13",y:"5",width:"8",height:"14",rx:"1",fill:"currentColor",opacity:"0.5"}),g.jsx("line",{x1:"3",y1:"7",x2:"11",y2:"7",stroke:"currentColor",strokeWidth:"2"}),g.jsx("line",{x1:"3",y1:"11",x2:"11",y2:"11",stroke:"currentColor",strokeWidth:"2"}),g.jsx("line",{x1:"3",y1:"15",x2:"11",y2:"15",stroke:"currentColor",strokeWidth:"2"}),g.jsx("line",{x1:"3",y1:"19",x2:"8",y2:"19",stroke:"currentColor",strokeWidth:"2"})]}),g.jsx("span",{children:"Kanan"})]}),g.jsxs("button",{className:`mtx-align-btn ${o.align==="full"?"is-active":""}`,onClick:()=>s(p=>({...p,align:"full"})),title:"Full Width",children:[g.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:g.jsx("rect",{x:"3",y:"5",width:"18",height:"14",rx:"1",fill:"currentColor",opacity:"0.5"})}),g.jsx("span",{children:"Full"})]})]}),g.jsx("div",{className:"mtx-image-edit-dialog__hint",children:g.jsxs("p",{children:["💡 ",g.jsx("strong",{children:"Tip:"}),' Pilih "Kiri" atau "Kanan" untuk text wrapping']})})]}),g.jsxs("div",{className:"mtx-image-edit-dialog__section",children:[g.jsx("h4",{children:"Aksesibilitas"}),g.jsxs("div",{className:"mtx-image-edit-dialog__row",children:[g.jsx("label",{children:"Alt Text (deskripsi untuk screen readers)"}),g.jsx("input",{type:"text",value:o.alt,onChange:p=>s(h=>({...h,alt:p.target.value})),placeholder:"Deskripsi gambar..."})]}),g.jsxs("div",{className:"mtx-image-edit-dialog__row",children:[g.jsx("label",{children:"Title (tooltip saat hover)"}),g.jsx("input",{type:"text",value:o.title,onChange:p=>s(h=>({...h,title:p.target.value})),placeholder:"Judul gambar..."})]})]})]}),g.jsxs("div",{className:"mtx-image-edit-dialog__footer",children:[g.jsx("button",{className:"mtx-image-edit-dialog__btn mtx-image-edit-dialog__btn--reset",onClick:d,children:"Reset"}),g.jsxs("div",{className:"mtx-image-edit-dialog__actions",children:[g.jsx("button",{className:"mtx-image-edit-dialog__btn mtx-image-edit-dialog__btn--cancel",onClick:t,children:"Batal"}),g.jsx("button",{className:"mtx-image-edit-dialog__btn mtx-image-edit-dialog__btn--apply",onClick:u,children:"Terapkan"})]})]})]})]}):null}const N8=[{name:"Aritmatika Dasar",icon:"🔢",level:"SD",templates:[{label:"Penjumlahan",latex:"a + b = c",preview:"a + b = c"},{label:"Pengurangan",latex:"a - b = c",preview:"a - b = c"},{label:"Perkalian",latex:"a \\times b = c",preview:"a × b = c"},{label:"Pembagian",latex:"a \\div b = c",preview:"a ÷ b = c"},{label:"Sisa bagi",latex:"a \\div b = c \\text{ sisa } r",preview:"a ÷ b = c sisa r"},{label:"Pecahan biasa",latex:"\\frac{a}{b}",preview:"a/b"},{label:"Pecahan campuran",latex:"a\\frac{b}{c}",preview:"a b/c"},{label:"Persen",latex:"\\frac{a}{100} = a\\%",preview:"a/100 = a%"},{label:"Desimal",latex:"0{,}5 = \\frac{1}{2}",preview:"0,5 = 1/2"},{label:"Perbandingan",latex:"a : b = c : d",preview:"a : b = c : d"}]},{name:"Pengukuran & Satuan",icon:"📏",level:"SD",templates:[{label:"Keliling persegi",latex:"K = 4 \\times s",preview:"K = 4 × s"},{label:"Luas persegi",latex:"L = s \\times s = s^{2}",preview:"L = s²"},{label:"Keliling persegi panjang",latex:"K = 2 \\times (p + l)",preview:"K = 2(p + l)"},{label:"Luas persegi panjang",latex:"L = p \\times l",preview:"L = p × l"},{label:"Keliling lingkaran",latex:"K = 2\\pi r",preview:"K = 2πr"},{label:"Luas lingkaran",latex:"L = \\pi r^{2}",preview:"L = πr²"},{label:"Luas segitiga",latex:"L = \\frac{1}{2} \\times a \\times t",preview:"L = ½ × a × t"},{label:"Luas trapesium",latex:"L = \\frac{1}{2}(a + b) \\times t",preview:"L = ½(a+b) × t"},{label:"Volume balok",latex:"V = p \\times l \\times t",preview:"V = p × l × t"},{label:"Volume kubus",latex:"V = s^{3}",preview:"V = s³"}]},{name:"KPK & FPB",icon:"🧮",level:"SD",templates:[{label:"FPB",latex:"\\text{FPB}(a, b) = \\ldots",preview:"FPB(a, b)"},{label:"KPK",latex:"\\text{KPK}(a, b) = \\ldots",preview:"KPK(a, b)"},{label:"Relasi FPB-KPK",latex:"a \\times b = \\text{FPB}(a,b) \\times \\text{KPK}(a,b)",preview:"a×b = FPB×KPK"},{label:"Faktorisasi prima",latex:"n = p_1^{a_1} \\times p_2^{a_2} \\times \\ldots",preview:"n = p₁ᵃ¹ × p₂ᵃ² × ..."}]},{name:"Aljabar Dasar",icon:"🔤",level:"SMP",templates:[{label:"Pecahan",latex:"\\frac{a}{b}",preview:"a/b"},{label:"Pangkat",latex:"x^{n}",preview:"xⁿ"},{label:"Akar kuadrat",latex:"\\sqrt{x}",preview:"√x"},{label:"Akar pangkat n",latex:"\\sqrt[n]{x}",preview:"ⁿ√x"},{label:"Nilai mutlak",latex:"\\left| x \\right|",preview:"|x|"},{label:"Persamaan linear",latex:"ax + b = 0",preview:"ax + b = 0"},{label:"SPLDV",latex:"\\begin{cases} ax + by = c \\\\ dx + ey = f \\end{cases}",preview:"ax+by=c, dx+ey=f"},{label:"Persamaan kuadrat",latex:"ax^{2} + bx + c = 0",preview:"ax² + bx + c = 0"},{label:"Rumus ABC",latex:"x = \\frac{-b \\pm \\sqrt{b^{2} - 4ac}}{2a}",preview:"x = (-b±√(b²-4ac))/2a"},{label:"Diskriminan",latex:"D = b^{2} - 4ac",preview:"D = b² - 4ac"}]},{name:"Geometri SMP",icon:"📐",level:"SMP",templates:[{label:"Pythagoras",latex:"c^{2} = a^{2} + b^{2}",preview:"c² = a² + b²"},{label:"Jarak dua titik",latex:"d = \\sqrt{(x_2-x_1)^{2} + (y_2-y_1)^{2}}",preview:"d = √((x₂-x₁)²+(y₂-y₁)²)"},{label:"Gradien",latex:"m = \\frac{y_2 - y_1}{x_2 - x_1}",preview:"m = (y₂-y₁)/(x₂-x₁)"},{label:"Persamaan garis",latex:"y = mx + c",preview:"y = mx + c"},{label:"Volume tabung",latex:"V = \\pi r^{2} t",preview:"V = πr²t"},{label:"Volume kerucut",latex:"V = \\frac{1}{3}\\pi r^{2} t",preview:"V = ⅓πr²t"},{label:"Volume bola",latex:"V = \\frac{4}{3}\\pi r^{3}",preview:"V = 4/3 πr³"},{label:"Luas permukaan bola",latex:"L = 4\\pi r^{2}",preview:"Lp = 4πr²"},{label:"Kesebangunan",latex:"\\frac{AB}{DE} = \\frac{BC}{EF} = \\frac{AC}{DF}",preview:"AB/DE = BC/EF = AC/DF"},{label:"Transformasi: translasi",latex:"T = \\begin{pmatrix} a \\\\ b \\end{pmatrix}",preview:"T = (a, b)"}]},{name:"Statistika SMP",icon:"📊",level:"SMP",templates:[{label:"Rata-rata",latex:"\\bar{x} = \\frac{\\sum x_i}{n}",preview:"x̄ = Σxᵢ/n"},{label:"Median",latex:"Me = x_{\\frac{n+1}{2}}",preview:"Me = x_(n+1)/2"},{label:"Modus",latex:"Mo = \\text{nilai yang paling sering muncul}",preview:"Mo = ..."},{label:"Jangkauan",latex:"J = x_{\\max} - x_{\\min}",preview:"J = xmax - xmin"},{label:"Peluang",latex:"P(A) = \\frac{n(A)}{n(S)}",preview:"P(A) = n(A)/n(S)"}]},{name:"Persamaan & Fungsi",icon:"⚖️",level:"SMA",templates:[{label:"Fungsi kuadrat",latex:"f(x) = ax^{2} + bx + c",preview:"f(x) = ax² + bx + c"},{label:"Titik puncak",latex:"\\left( \\frac{-b}{2a},\\, \\frac{-(b^2-4ac)}{4a} \\right)",preview:"(-b/2a, -D/4a)"},{label:"Jumlah akar",latex:"x_1 + x_2 = \\frac{-b}{a}",preview:"x₁+x₂ = -b/a"},{label:"Hasil kali akar",latex:"x_1 \\cdot x_2 = \\frac{c}{a}",preview:"x₁·x₂ = c/a"},{label:"Fungsi komposisi",latex:"(f \\circ g)(x) = f(g(x))",preview:"(f∘g)(x) = f(g(x))"},{label:"Fungsi invers",latex:"f^{-1}(x)",preview:"f⁻¹(x)"},{label:"Fungsi per bagian",latex:"f(x) = \\begin{cases} x^2 & x \\geq 0 \\\\ -x & x < 0 \\end{cases}",preview:"Piecewise function"},{label:"Pertidaksamaan kuadrat",latex:"ax^{2} + bx + c > 0",preview:"ax² + bx + c > 0"},{label:"Sistem 3 variabel",latex:"\\begin{cases} a_1x + b_1y + c_1z = d_1 \\\\ a_2x + b_2y + c_2z = d_2 \\\\ a_3x + b_3y + c_3z = d_3 \\end{cases}",preview:"SPL 3 variabel"},{label:"Program linear",latex:"z = ax + by \\quad \\text{(maks/min)}",preview:"z = ax + by (optimal)"}]},{name:"Logika & Himpunan",icon:"집합",level:"SMA",templates:[{label:"Himpunan kosong",latex:"\\emptyset",preview:"∅"},{label:"Irisan",latex:"A \\cap B",preview:"A ∩ B"},{label:"Gabungan",latex:"A \\cup B",preview:"A ∪ B"},{label:"Bagian dari",latex:"A \\subseteq B",preview:"A ⊆ B"},{label:"Bukan bagian",latex:"A \\nsubseteq B",preview:"A ⊈ B"},{label:"Elemen dari",latex:"x \\in A",preview:"x ∈ A"},{label:"Implikasi",latex:"p \\implies q",preview:"p ⇒ q"},{label:"Bi-implikasi",latex:"p \\iff q",preview:"p ⇔ q"},{label:"Semua (For all)",latex:"\\forall x \\in A",preview:"∀x ∈ A"},{label:"Ada (Exists)",latex:"\\exists x \\in A",preview:"∃x ∈ A"},{label:"Negasi",latex:"\\neg p",preview:"¬p"},{label:"Hukum De Morgan",latex:"\\neg(p \\land q) \\equiv \\neg p \\lor \\neg q",preview:"¬(p∧q)≡¬p∨¬q"},{label:"Tabel Kebenaran",latex:"\\begin{array}{|c|c|c|} \\hline p & q & p \\land q \\\\ \\hline T & T & T \\\\ T & F & F \\\\ F & T & F \\\\ F & F & F \\\\ \\hline \\end{array}",preview:"Tabel Kebenaran"}]},{name:"Trigonometri",icon:"📐",level:"SMA",templates:[{label:"sin/cos/tan dasar",latex:"\\sin\\theta = \\frac{\\text{depan}}{\\text{miring}}",preview:"sinθ = dpn/mrg"},{label:"Identitas Pythagoras",latex:"\\sin^{2}\\theta + \\cos^{2}\\theta = 1",preview:"sin²θ + cos²θ = 1"},{label:"tan = sin/cos",latex:"\\tan\\theta = \\frac{\\sin\\theta}{\\cos\\theta}",preview:"tanθ = sinθ/cosθ"},{label:"Sudut ganda sin",latex:"\\sin 2\\alpha = 2\\sin\\alpha \\cos\\alpha",preview:"sin 2α = 2sinα cosα"},{label:"Sudut ganda cos",latex:"\\cos 2\\alpha = \\cos^{2}\\alpha - \\sin^{2}\\alpha",preview:"cos 2α = cos²α - sin²α"},{label:"Jumlah sudut sin",latex:"\\sin(A \\pm B) = \\sin A \\cos B \\pm \\cos A \\sin B",preview:"sin(A±B)"},{label:"Jumlah sudut cos",latex:"\\cos(A \\pm B) = \\cos A \\cos B \\mp \\sin A \\sin B",preview:"cos(A±B)"},{label:"Aturan sinus",latex:"\\frac{a}{\\sin A} = \\frac{b}{\\sin B} = \\frac{c}{\\sin C} = 2R",preview:"a/sinA = b/sinB = 2R"},{label:"Aturan cosinus",latex:"c^{2} = a^{2} + b^{2} - 2ab\\cos C",preview:"c² = a²+b²-2ab·cosC"},{label:"Luas segitiga trig",latex:"L = \\frac{1}{2}ab\\sin C",preview:"L = ½ab sinC"},{label:"Persamaan trig dasar",latex:"\\sin x = \\sin \\alpha \\Rightarrow x = \\alpha + k \\cdot 360°",preview:"sinx = sinα → ..."},{label:"Grafik sin",latex:"y = A \\sin(Bx + C) + D",preview:"y = A sin(Bx+C)+D"}]},{name:"Logaritma & Eksponen",icon:"📊",level:"SMA",templates:[{label:"Log basis a (Indo)",latex:"{}^{a}\\log(x)",preview:"ᵃlog(x)"},{label:"Log basis a (Intl)",latex:"\\log_{a}(x) = n",preview:"logₐ(x) = n"},{label:"log basis 10",latex:"\\log(x)",preview:"log(x)"},{label:"ln (natural log)",latex:"\\ln(x)",preview:"ln(x)"},{label:"log perkalian",latex:"\\log(ab) = \\log a + \\log b",preview:"log(ab) = log a + log b"},{label:"log pembagian",latex:"\\log\\frac{a}{b} = \\log a - \\log b",preview:"log(a/b) = log a - log b"},{label:"log pangkat",latex:"\\log a^{n} = n \\log a",preview:"log aⁿ = n log a"},{label:"Konversi basis",latex:"\\log_{a}b = \\frac{\\log b}{\\log a}",preview:"logₐb = logb/loga"},{label:"Eksponen perkalian",latex:"a^{m} \\cdot a^{n} = a^{m+n}",preview:"aᵐ·aⁿ = aᵐ⁺ⁿ"},{label:"Eksponen pembagian",latex:"\\frac{a^{m}}{a^{n}} = a^{m-n}",preview:"aᵐ/aⁿ = aᵐ⁻ⁿ"},{label:"Eksponen negatif",latex:"a^{-n} = \\frac{1}{a^{n}}",preview:"a⁻ⁿ = 1/aⁿ"}]},{name:"Barisan & Deret",icon:"🔢",level:"SMA",templates:[{label:"Un aritmetika",latex:"U_n = a + (n-1)b",preview:"Uₙ = a + (n-1)b"},{label:"Sn aritmetika",latex:"S_n = \\frac{n}{2}(2a + (n-1)b)",preview:"Sₙ = n/2(2a+(n-1)b)"},{label:"Un geometri",latex:"U_n = a \\cdot r^{n-1}",preview:"Uₙ = a·rⁿ⁻¹"},{label:"Sn geometri",latex:"S_n = \\frac{a(1 - r^{n})}{1 - r}",preview:"Sₙ = a(1-rⁿ)/(1-r)"},{label:"Deret tak hingga",latex:"S_{\\infty} = \\frac{a}{1 - r},\\; |r| < 1",preview:"S∞ = a/(1-r)"},{label:"Sigma",latex:"\\sum_{i=1}^{n} a_i",preview:"Σᵢ₌₁ⁿ aᵢ"},{label:"Σi",latex:"\\sum_{i=1}^{n} i = \\frac{n(n+1)}{2}",preview:"Σi = n(n+1)/2"},{label:"Σi²",latex:"\\sum_{i=1}^{n} i^{2} = \\frac{n(n+1)(2n+1)}{6}",preview:"Σi² = n(n+1)(2n+1)/6"},{label:"Σi³",latex:"\\sum_{i=1}^{n} i^{3} = \\left[\\frac{n(n+1)}{2}\\right]^{2}",preview:"Σi³ = [n(n+1)/2]²"}]},{name:"Matriks & Vektor",icon:"🔲",level:"SMA",templates:[{label:"Matriks 2×2",latex:"\\begin{pmatrix} a & b \\\\ c & d \\end{pmatrix}",preview:"[a b; c d]"},{label:"Matriks 3×3",latex:"\\begin{pmatrix} a & b & c \\\\ d & e & f \\\\ g & h & i \\end{pmatrix}",preview:"3×3 matrix"},{label:"Determinan 2×2",latex:"\\det(A) = ad - bc",preview:"det(A) = ad - bc"},{label:"Invers 2×2",latex:"A^{-1} = \\frac{1}{ad-bc}\\begin{pmatrix} d & -b \\\\ -c & a \\end{pmatrix}",preview:"A⁻¹ = 1/det ..."},{label:"Perkalian matriks",latex:"C_{ij} = \\sum_{k} A_{ik} B_{kj}",preview:"Cᵢⱼ = Σ AᵢₖBₖⱼ"},{label:"Vektor 2D",latex:"\\vec{v} = \\begin{pmatrix} x \\\\ y \\end{pmatrix}",preview:"v⃗ = (x,y)ᵀ"},{label:"Vektor 3D",latex:"\\vec{v} = \\begin{pmatrix} x \\\\ y \\\\ z \\end{pmatrix}",preview:"v⃗ = (x,y,z)ᵀ"},{label:"Dot product",latex:"\\vec{a} \\cdot \\vec{b} = |a||b|\\cos\\theta",preview:"a⃗·b⃗ = |a||b|cosθ"},{label:"Cross product",latex:"\\vec{a} \\times \\vec{b} = |a||b|\\sin\\theta\\,\\hat{n}",preview:"a⃗ × b⃗"},{label:"Transformasi linear",latex:"\\begin{pmatrix} x' \\\\ y' \\end{pmatrix} = \\begin{pmatrix} a & b \\\\ c & d \\end{pmatrix} \\begin{pmatrix} x \\\\ y \\end{pmatrix}",preview:"x'y' = M·xy"}]},{name:"Statistika & Peluang SMA",icon:"🎲",level:"SMA",templates:[{label:"Rata-rata data kelompok",latex:"\\bar{x} = \\frac{\\sum f_i x_i}{\\sum f_i}",preview:"x̄ = Σfᵢxᵢ/Σfᵢ"},{label:"Varians",latex:"s^{2} = \\frac{\\sum f_i(x_i - \\bar{x})^{2}}{n-1}",preview:"s² = Σfᵢ(xᵢ-x̄)²/(n-1)"},{label:"Simpangan baku",latex:"s = \\sqrt{\\frac{\\sum f_i(x_i - \\bar{x})^{2}}{n-1}}",preview:"s = √(...)"},{label:"Quartil",latex:"Q_k = x_{\\frac{k(n+1)}{4}}",preview:"Qₖ = x_k(n+1)/4"},{label:"Kombinasi (Indo)",latex:"{}_{n}\\text{C}_{k}",preview:"ₙCₖ"},{label:"Permutasi (Indo)",latex:"{}_{n}\\text{P}_{k}",preview:"ₙPₖ"},{label:"Kombinasi (Intl)",latex:"C(n,k) = \\binom{n}{k} = \\frac{n!}{k!(n-k)!}",preview:"C(n,k) = n!/(k!(n-k)!)"},{label:"Permutasi (Intl)",latex:"P(n,k) = \\frac{n!}{(n-k)!}",preview:"P(n,k) = n!/(n-k)!"},{label:"Peluang komplemen",latex:"P(A') = 1 - P(A)",preview:"P(A') = 1 - P(A)"},{label:"Peluang gabungan",latex:"P(A \\cup B) = P(A) + P(B) - P(A \\cap B)",preview:"P(A∪B) = P(A)+P(B)-P(A∩B)"},{label:"Peluang bersyarat",latex:"P(A|B) = \\frac{P(A \\cap B)}{P(B)}",preview:"P(A|B) = P(A∩B)/P(B)"},{label:"Binomial",latex:"P(X=k) = \\binom{n}{k} p^{k} (1-p)^{n-k}",preview:"P(X=k) binomial"}]},{name:"Limit & Turunan",icon:"∫",level:"SMA",templates:[{label:"Limit fungsi",latex:"\\lim_{x \\to a} f(x) = L",preview:"lim x→a f(x) = L"},{label:"Limit tak hingga",latex:"\\lim_{x \\to \\infty} f(x)",preview:"lim x→∞"},{label:"Limit 0/0",latex:"\\lim_{x \\to a} \\frac{f(x)}{g(x)}",preview:"lim f/g (0/0)"},{label:"Limit trig",latex:"\\lim_{x \\to 0} \\frac{\\sin x}{x} = 1",preview:"lim sinx/x = 1"},{label:"Turunan definisi",latex:"f'(x) = \\lim_{h \\to 0} \\frac{f(x+h) - f(x)}{h}",preview:"f'(x) = lim Δf/Δx"},{label:"Turunan pangkat",latex:"\\frac{d}{dx}x^{n} = nx^{n-1}",preview:"d/dx xⁿ = nxⁿ⁻¹"},{label:"Turunan perkalian",latex:"(fg)' = f'g + fg'",preview:"(fg)' = f'g + fg'"},{label:"Turunan pembagian",latex:"\\left(\\frac{f}{g}\\right)' = \\frac{f'g - fg'}{g^2}",preview:"(f/g)' = (f'g-fg')/g²"},{label:"Aturan rantai",latex:"\\frac{dy}{dx} = \\frac{dy}{du} \\cdot \\frac{du}{dx}",preview:"dy/dx = dy/du·du/dx"},{label:"Garis singgung",latex:"y - y_1 = m(x - x_1)",preview:"y-y₁ = m(x-x₁)"}]},{name:"Integral SMA",icon:"∫",level:"SMA",templates:[{label:"Integral tak tentu",latex:"\\int f(x)\\, dx",preview:"∫ f(x) dx"},{label:"Integral pangkat",latex:"\\int x^{n}\\, dx = \\frac{x^{n+1}}{n+1} + C",preview:"∫xⁿ dx = xⁿ⁺¹/(n+1)+C"},{label:"Integral tentu",latex:"\\int_{a}^{b} f(x)\\, dx",preview:"∫ₐᵇ f(x) dx"},{label:"Integral tentu evaluasi",latex:"\\int_{a}^{b} f(x)\\, dx = F(b) - F(a)",preview:"∫ₐᵇ = F(b)-F(a)"},{label:"Luas daerah",latex:"L = \\int_{a}^{b} |f(x) - g(x)|\\, dx",preview:"L = ∫|f-g|dx"},{label:"Volume putar (cakram)",latex:"V = \\pi \\int_{a}^{b} [f(x)]^{2}\\, dx",preview:"V = π∫[f(x)]²dx"},{label:"Volume putar (cincin)",latex:"V = \\pi \\int_{a}^{b} ([f(x)]^{2} - [g(x)]^{2})\\, dx",preview:"V = π∫(f²-g²)dx"}]},{name:"Kalkulus Lanjut",icon:"∫",level:"Kuliah",templates:[{label:"Integral ganda",latex:"\\iint_{D} f(x,y)\\, dA",preview:"∬ f(x,y) dA"},{label:"Integral triple",latex:"\\iiint_{V} f(x,y,z)\\, dV",preview:"∭ f(x,y,z) dV"},{label:"Integral garis",latex:"\\int_{C} \\vec{F} \\cdot d\\vec{r}",preview:"∫_C F⃗·dr⃗"},{label:"Integral permukaan",latex:"\\iint_{S} \\vec{F} \\cdot d\\vec{S}",preview:"∬_S F⃗·dS⃗"},{label:"Teorema Green",latex:"\\oint_{C} (P\\,dx + Q\\,dy) = \\iint_{D} \\left(\\frac{\\partial Q}{\\partial x} - \\frac{\\partial P}{\\partial y}\\right) dA",preview:"Teorema Green"},{label:"Teorema Stokes",latex:"\\oint_{C} \\vec{F} \\cdot d\\vec{r} = \\iint_{S} (\\nabla \\times \\vec{F}) \\cdot d\\vec{S}",preview:"Teorema Stokes"},{label:"Teorema Divergensi",latex:"\\iiint_{V} (\\nabla \\cdot \\vec{F})\\, dV = \\oiint_{S} \\vec{F} \\cdot d\\vec{S}",preview:"Teorema Gauss"},{label:"Deret Taylor",latex:"f(x) = \\sum_{n=0}^{\\infty} \\frac{f^{(n)}(a)}{n!}(x-a)^{n}",preview:"Deret Taylor"},{label:"Deret Maclaurin",latex:"f(x) = \\sum_{n=0}^{\\infty} \\frac{f^{(n)}(0)}{n!}x^{n}",preview:"Deret Maclaurin"},{label:"Deret Fourier",latex:"f(x) = \\frac{a_0}{2} + \\sum_{n=1}^{\\infty}\\left(a_n \\cos\\frac{n\\pi x}{L} + b_n \\sin\\frac{n\\pi x}{L}\\right)",preview:"Deret Fourier"},{label:"Aturan L'Hôpital",latex:"\\lim_{x \\to a} \\frac{f(x)}{g(x)} = \\lim_{x \\to a} \\frac{f'(x)}{g'(x)}",preview:"L'Hôpital"},{label:"Jacobian",latex:"J = \\frac{\\partial(x,y)}{\\partial(u,v)} = \\begin{vmatrix} \\frac{\\partial x}{\\partial u} & \\frac{\\partial x}{\\partial v} \\\\ \\frac{\\partial y}{\\partial u} & \\frac{\\partial y}{\\partial v} \\end{vmatrix}",preview:"Jacobian"}]},{name:"Persamaan Diferensial",icon:"🔄",level:"Kuliah",templates:[{label:"PD orde 1",latex:"\\frac{dy}{dx} = f(x, y)",preview:"dy/dx = f(x,y)"},{label:"PD separabel",latex:"g(y)\\,dy = f(x)\\,dx",preview:"g(y)dy = f(x)dx"},{label:"PD linear orde 1",latex:"\\frac{dy}{dx} + P(x)y = Q(x)",preview:"y' + P(x)y = Q(x)"},{label:"Faktor integrasi",latex:"\\mu(x) = e^{\\int P(x)\\,dx}",preview:"μ(x) = e^(∫P dx)"},{label:"PD orde 2 homogen",latex:"y'' + py' + qy = 0",preview:"y'' + py' + qy = 0"},{label:"Persamaan karakteristik",latex:"r^{2} + pr + q = 0",preview:"r² + pr + q = 0"},{label:"Solusi umum (akar real)",latex:"y = C_1 e^{r_1 x} + C_2 e^{r_2 x}",preview:"y = c₁e^r₁x + c₂e^r₂x"},{label:"Solusi umum (akar kompleks)",latex:"y = e^{\\alpha x}(C_1 \\cos\\beta x + C_2 \\sin\\beta x)",preview:"y = eᵅˣ(c₁cosβx+c₂sinβx)"},{label:"Laplace transform",latex:"\\mathcal{L}\\{f(t)\\} = \\int_{0}^{\\infty} e^{-st} f(t)\\, dt",preview:"L{f(t)} = ∫e⁻ˢᵗf(t)dt"},{label:"Invers Laplace",latex:"f(t) = \\mathcal{L}^{-1}\\{F(s)\\}",preview:"f(t) = L⁻¹{F(s)}"}]},{name:"Aljabar Linear",icon:"🔲",level:"Kuliah",templates:[{label:"Matriks n×n",latex:"A = [a_{ij}]_{m \\times n}",preview:"A = [aᵢⱼ]ₘₓₙ"},{label:"Determinan (Sarrus)",latex:"\\det(A) = \\sum_{j=1}^{n} (-1)^{1+j} a_{1j} M_{1j}",preview:"det = Σ cofactor"},{label:"Eigenvalue",latex:"\\det(A - \\lambda I) = 0",preview:"det(A-λI) = 0"},{label:"Eigenvector",latex:"(A - \\lambda I)\\vec{v} = \\vec{0}",preview:"(A-λI)v⃗ = 0⃗"},{label:"Diagonalisasi",latex:"A = PDP^{-1}",preview:"A = PDP⁻¹"},{label:"Gram-Schmidt",latex:"\\vec{u}_k = \\vec{v}_k - \\sum_{j=1}^{k-1} \\text{proj}_{\\vec{u}_j}(\\vec{v}_k)",preview:"Gram-Schmidt"},{label:"Proyeksi vektor",latex:"\\text{proj}_{\\vec{u}}(\\vec{v}) = \\frac{\\vec{v} \\cdot \\vec{u}}{\\vec{u} \\cdot \\vec{u}} \\vec{u}",preview:"proj_u(v)"},{label:"Rank matriks",latex:"\\text{rank}(A) = \\dim(\\text{Col}(A))",preview:"rank(A) = dim Col(A)"},{label:"Norma vektor",latex:"\\|\\vec{v}\\| = \\sqrt{\\sum_{i=1}^{n} v_i^{2}}",preview:"‖v⃗‖ = √(Σvᵢ²)"},{label:"Matriks transpos",latex:"(A^{T})_{ij} = A_{ji}",preview:"(Aᵀ)ᵢⱼ = Aⱼᵢ"}]},{name:"Statistika & Probabilitas",icon:"🎲",level:"Kuliah",templates:[{label:"Ekspektasi",latex:"E(X) = \\sum_{i} x_i P(x_i)",preview:"E(X) = ΣxᵢP(xᵢ)"},{label:"Ekspektasi kontinu",latex:"E(X) = \\int_{-\\infty}^{\\infty} x f(x)\\, dx",preview:"E(X) = ∫xf(x)dx"},{label:"Varians",latex:"Var(X) = E(X^2) - [E(X)]^2",preview:"Var(X) = E(X²)-[E(X)]²"},{label:"Distribusi normal",latex:"f(x) = \\frac{1}{\\sigma\\sqrt{2\\pi}} e^{-\\frac{(x-\\mu)^2}{2\\sigma^2}}",preview:"Distribusi normal"},{label:"Z-score",latex:"z = \\frac{x - \\mu}{\\sigma}",preview:"z = (x-μ)/σ"},{label:"Distribusi Poisson",latex:"P(X=k) = \\frac{e^{-\\lambda} \\lambda^{k}}{k!}",preview:"P(X=k) = e⁻λλᵏ/k!"},{label:"Korelasi Pearson",latex:"r = \\frac{\\sum(x_i - \\bar{x})(y_i - \\bar{y})}{\\sqrt{\\sum(x_i-\\bar{x})^2 \\sum(y_i-\\bar{y})^2}}",preview:"r = Σ(x-x̄)(y-ȳ)/..."},{label:"Regresi linear",latex:"\\hat{y} = a + bx,\\quad b = \\frac{n\\sum xy - \\sum x \\sum y}{n\\sum x^2 - (\\sum x)^2}",preview:"ŷ = a + bx"},{label:"Interval kepercayaan",latex:"\\bar{x} \\pm z_{\\alpha/2} \\frac{\\sigma}{\\sqrt{n}}",preview:"x̄ ± z·σ/√n"},{label:"Uji-t",latex:"t = \\frac{\\bar{x} - \\mu_0}{s / \\sqrt{n}}",preview:"t = (x̄-μ₀)/(s/√n)"},{label:"Chi-square",latex:"\\chi^2 = \\sum \\frac{(O_i - E_i)^2}{E_i}",preview:"χ² = Σ(O-E)²/E"},{label:"Bayes",latex:"P(A|B) = \\frac{P(B|A)P(A)}{P(B)}",preview:"Teorema Bayes"}]},{name:"Analisis Kompleks",icon:"🌀",level:"Kuliah",templates:[{label:"Bilangan kompleks",latex:"z = a + bi",preview:"z = a + bi"},{label:"Modulus",latex:"|z| = \\sqrt{a^2 + b^2}",preview:"|z| = √(a²+b²)"},{label:"Konjugat",latex:"\\bar{z} = a - bi",preview:"z̄ = a - bi"},{label:"Euler",latex:"e^{i\\theta} = \\cos\\theta + i\\sin\\theta",preview:"Euler: e^iθ = cosθ + isinθ"},{label:"De Moivre",latex:"(\\cos\\theta + i\\sin\\theta)^n = \\cos n\\theta + i\\sin n\\theta",preview:"De Moivre"},{label:"Integral Cauchy",latex:"f(z_0) = \\frac{1}{2\\pi i}\\oint_C \\frac{f(z)}{z - z_0}\\, dz",preview:"Rumus integral Cauchy"},{label:"Deret Laurent",latex:"f(z) = \\sum_{n=-\\infty}^{\\infty} c_n (z-z_0)^n",preview:"Deret Laurent"},{label:"Residu",latex:"\\oint_C f(z)\\,dz = 2\\pi i \\sum \\text{Res}(f, z_k)",preview:"Teorema Residu"}]},{name:"Ekonomi & Keuangan",icon:"💰",level:"SMA",templates:[{label:"Bunga Tunggal",latex:"M_n = M_0 (1 + n \\cdot i)",preview:"Mn = M₀(1+ni)"},{label:"Bunga Majemuk",latex:"M_n = M_0 (1 + i)^n",preview:"Mn = M₀(1+i)ⁿ"},{label:"Pertumbuhan",latex:"P_n = P_0 (1 + r)^n",preview:"Pn = P₀(1+r)ⁿ"},{label:"Peluruhan",latex:"P_n = P_0 (1 - r)^n",preview:"Pn = P₀(1-r)ⁿ"},{label:"Anuitas",latex:"A = \\frac{M \\cdot i}{1 - (1+i)^{-n}}",preview:"A = M·i/(1-(1+i)⁻ⁿ)"},{label:"Elastisitas",latex:"E = \\frac{\\% \\Delta Q}{\\% \\Delta P} = \\frac{P}{Q} \\cdot \\frac{dQ}{dP}",preview:"E = %ΔQ/%ΔP"},{label:"Fungsi Biaya",latex:"TC = FC + VC",preview:"TC = FC + VC"},{label:"Biaya Marginal",latex:"MC = \\frac{dTC}{dQ}",preview:"MC = dTC/dQ"},{label:"Penerimaan Marginal",latex:"MR = \\frac{dTR}{dQ}",preview:"MR = dTR/dQ"},{label:"Laba Maksimum",latex:"MR = MC",preview:"MR = MC"}]},{name:"Fisika Lanjut",icon:"⚛️",level:"Kuliah",templates:[{label:"Hukum Gay-Lussac",latex:"\\frac{P_1}{T_1} = \\frac{P_2}{T_2}",preview:"P₁/T₁ = P₂/T₂"},{label:"Gas Ideal",latex:"PV = nRT = N K_B T",preview:"PV = nRT"},{label:"Termodinamika I",latex:"\\Delta U = Q - W",preview:"ΔU = Q - W"},{label:"Efisiensi Mesin",latex:"\\eta = 1 - \\frac{T_C}{T_H}",preview:"η = 1 - Tc/Th"},{label:"Entropi",latex:"\\Delta S = \\int \\frac{dQ}{T}",preview:"ΔS = ∫dQ/T"},{label:"Bernoulli",latex:"P + \\frac{1}{2}\\rho v^2 + \\rho gh = \\text{konstan}",preview:"Bernoulli"},{label:"Relativitas Waktu",latex:"\\Delta t' = \\frac{\\Delta t}{\\sqrt{1 - v^2/c^2}}",preview:"Dilatasi Waktu"},{label:"Massa Relativistik",latex:"m = \\frac{m_0}{\\sqrt{1 - v^2/c^2}}",preview:"m = m₀/γ"},{label:"Heisenberg",latex:"\\Delta x \\Delta p \\geq \\frac{\\hbar}{2}",preview:"ΔxΔp ≥ ℏ/2"},{label:"Pers. Gelombang",latex:"\\frac{\\partial^2 y}{\\partial x^2} = \\frac{1}{v^2} \\frac{\\partial^2 y}{\\partial t^2}",preview:"∂²y/∂x² = ..."}]},{name:"Kimia Dasar",icon:"⚗️",level:"SMP",templates:[{label:"Air",latex:"\\ce{H2O}",preview:"H2O"},{label:"Garam Dapur",latex:"\\ce{NaCl}",preview:"NaCl"},{label:"Gula (Glukosa)",latex:"\\ce{C6H12O6}",preview:"Glukosa"},{label:"Karbon Dioksida",latex:"\\ce{CO2}",preview:"CO2"},{label:"Oksigen",latex:"\\ce{O2}",preview:"O2"},{label:"Asam Klorida",latex:"\\ce{HCl}",preview:"HCl"},{label:"Natrium Hidroksida",latex:"\\ce{NaOH}",preview:"NaOH"},{label:"Wujud Gas",latex:"\\ce{(g)}",preview:"(g)"},{label:"Wujud Cair",latex:"\\ce{(l)}",preview:"(l)"},{label:"Wujud Padat",latex:"\\ce{(s)}",preview:"(s)"},{label:"Larutan",latex:"\\ce{(aq)}",preview:"(aq)"}]},{name:"Stoikiometri & Larutan",icon:"⚖️",level:"SMA",templates:[{label:"Mol dari Massa",latex:"n = \\frac{m}{M_r}",preview:"n = m/Mr"},{label:"Mol dari Molaritas",latex:"n = M \\cdot V",preview:"n = M · V"},{label:"Mol dari Partikel",latex:"n = \\frac{N}{N_A}",preview:"n = N/NA"},{label:"Mol Gas (STP)",latex:"n = \\frac{V}{22,4}",preview:"n = V/22,4"},{label:"Mol Gas Ideal",latex:"n = \\frac{PV}{RT}",preview:"n = PV/RT"},{label:"Molaritas",latex:"M = \\frac{n}{V}",preview:"M = n/V"},{label:"Molalitas",latex:"m = \\frac{n}{p}",preview:"m = n/p"},{label:"Fraksi Mol",latex:"X_A = \\frac{n_A}{n_A + n_B}",preview:"XA = nA/(nA+nB)"},{label:"pH Asam",latex:"pH = -\\log[\\ce{H+}]",preview:"pH = -log[H+]"},{label:"pOH Basa",latex:"pOH = -\\log[\\ce{OH-}]",preview:"pOH = -log[OH-]"},{label:"Titik Didih",latex:"\\Delta T_b = m \\cdot K_b \\cdot i",preview:"ΔTb = m·Kb·i"},{label:"Titik Beku",latex:"\\Delta T_f = m \\cdot K_f \\cdot i",preview:"ΔTf = m·Kf·i"},{label:"Tekanan Osmotik",latex:"\\pi = M \\cdot R \\cdot T \\cdot i",preview:"π = MRTi"},{label:"Hasil Kali Kelarutan",latex:"K_{sp} = [x\\ce{A}]^x [y\\ce{B}]^y",preview:"Ksp"}]},{name:"Kimia Fisik Lanjut",icon:"⚛️",level:"Kuliah",templates:[{label:"Gas Van der Waals",latex:"\\left( P + \\frac{an^{2}}{V^{2}} \\right) (V - nb) = nRT",preview:"P_vdw"},{label:"Persamaan Bragg",latex:"n\\lambda = 2d \\sin\\theta",preview:"Diffraction"},{label:"Hukum Raoult",latex:"P_A = X_A P_A^\\circ",preview:"Raoult"},{label:"Pers. Clausius-Clapeyron",latex:"\\ln\\left(\\frac{P_2}{P_1}\\right) = \\frac{-\\Delta H_{vap}}{R} \\left(\\frac{1}{T_2} - \\frac{1}{T_1}\\right)",preview:"Clapeyron"},{label:"Pers. Langmuir",latex:"\\theta = \\frac{KP}{1 + KP}",preview:"Adsorpsi"},{label:"Kekuatan Ionik",latex:"I = \\frac{1}{2} \\sum c_i z_i^{2}",preview:"Ionic Strength"},{label:"Debye-Hückel",latex:"\\log \\gamma_{\\pm} = -A |z_+ z_-| \\sqrt{I}",preview:"DH Law"}]},{name:"Termokimia & Kinetika",icon:"🔥",level:"Master",templates:[{label:"Hukum Hess",latex:"\\Delta H_{rxn} = \\sum \\Delta H_f^{\\circ}(\\text{prod}) - \\sum \\Delta H_f^{\\circ}(\\text{reak})",preview:"ΔH Hess"},{label:"ΔG Gibbs",latex:"\\Delta G = \\Delta H - T\\Delta S",preview:"ΔG = ΔH - TΔS"},{label:"Energi Bebas & K",latex:"\\Delta G^\\circ = -RT \\ln K",preview:"ΔG° = -RT lnK"},{label:"Pers. Vant Hoff",latex:"\\ln\\left(\\frac{K_2}{K_1}\\right) = \\frac{\\Delta H^\\circ}{R} \\left(\\frac{1}{T_1} - \\frac{1}{T_2}\\right)",preview:"Vant Hoff"},{label:"Pers. Arrhenius",latex:"k = A e^{-\\frac{E_a}{RT}}",preview:"k = Ae^(-Ea/RT)"},{label:"Laju Reaksi Orde n",latex:"\\frac{1}{[\\ce{A}]^{n-1}} - \\frac{1}{[\\ce{A}]_0^{n-1}} = (n-1)kt",preview:"Orde n"},{label:"Michaelis-Menten",latex:"v = \\frac{V_{max}[\\ce{S}]}{K_m + [\\ce{S}]}",preview:"Enzim"},{label:"Energi Aktivasi",latex:"\\ln k = -\\frac{E_a}{R} \\left( \\frac{1}{T} \\right) + \\ln A",preview:"Plot Arrhenius"}]},{name:"Elektrokimia",icon:"🔋",level:"Kuliah",templates:[{label:"Pers. Nernst",latex:"E = E^\\circ - \\frac{RT}{nF} \\ln Q",preview:"Nernst"},{label:"Nernst (25°C)",latex:"E = E^\\circ - \\frac{0.0592}{n} \\log Q",preview:"Nernst 25C"},{label:"Hukum Faraday I",latex:"w = \\frac{e \\cdot i \\cdot t}{96500}",preview:"w = eit/F"},{label:"Potensial Sel",latex:"E_{sel} = E_{katoda} - E_{anoda}",preview:"Esel"},{label:"Hubungan ΔG & E",latex:"\\Delta G = -nFE",preview:"ΔG = -nFE"},{label:"Konduktivitas Molar",latex:"\\Lambda_m = \\frac{\\kappa}{c}",preview:"Λm = к/c"}]},{name:"Kimia Organik",icon:"🌳",level:"Master",templates:[{label:"Benzena",latex:"\\ce{C6H6}",preview:"C6H6"},{label:"Alkana Umum",latex:"\\ce{C_{n}H_{2n+2}}",preview:"Alkana"},{label:"Asam Karboksilat",latex:"\\ce{R-COOH}",preview:"R-COOH"},{label:"Ester",latex:"\\ce{R-COOR'}",preview:"R-COOR'"},{label:"Amida",latex:"\\ce{R-CONH2}",preview:"R-CONH2"},{label:"Amina",latex:"\\ce{R-NH2}",preview:"R-NH2"},{label:"Grignard",latex:"\\ce{R-MgX}",preview:"R-MgX"},{label:"Nukleofilik SN2",latex:"\\ce{Nu^{-} + R-X -> R-Nu + X^{-}}",preview:"SN2"},{label:"Eliminasi E1",latex:"\\ce{Base + H-C-C-L -> C=C + Base-H + L^{-}}",preview:"E1"},{label:"Diels-Alder",latex:"\\ce{Diene + Dienophile -> Cyclohexene}",preview:"Diels-Alder"},{label:"Polimerisasi",latex:"\\ce{n CH2=CH2 -> -[-CH2-CH2-]-_{n}}",preview:"Polimer"}]},{name:"Kimia Analitik",icon:"🔬",level:"Kuliah",templates:[{label:"Beer-Lambert",latex:"A = \\epsilon b c",preview:"A = εbc"},{label:"Transmitansi",latex:"A = -\\log T = \\log\\left(\\frac{100}{\\%T}\\right)",preview:"A = -log T"},{label:"Standar Deviasi",latex:"s = \\sqrt{\\frac{\\sum(x_i - \\bar{x})^{2}}{n-1}}",preview:"Analytic s"},{label:"Koefisien Variasi",latex:"CV = \\frac{s}{\\bar{x}} \\times 100\\%",preview:"CV"},{label:"Limit Deteksi (LOD)",latex:"LOD = \\frac{3s_b}{m}",preview:"LOD"},{label:"Pers. Henderson-Hasselbalch",latex:"pH = pK_a + \\log\\frac{[\\ce{A-}]}{[\\ce{HA}]}",preview:"Buffer pH"}]},{name:"Kimia Anorganik & Inti",icon:"🌌",level:"Master",templates:[{label:"Peluruhan Radioaktif",latex:"N_t = N_0 e^{-\\lambda t}",preview:"Nt = N0 e^-λt"},{label:"Waktu Paruh",latex:"t_{1/2} = \\frac{\\ln 2}{\\lambda}",preview:"t½ = 0.693/λ"},{label:"Defek Massa",latex:"\\Delta m = (Z m_p + N m_n) - M_{inti}",preview:"Δm"},{label:"Energi Ikat Inti",latex:"BE = \\Delta m \\cdot c^{2}",preview:"BE = Δmc²"},{label:"Crystal Field Splitting",latex:"\\Delta_o = 10Dq",preview:"CFSE"},{label:"Kecepatan Photon",latex:"E = hf = \\frac{hc}{\\lambda}",preview:"E=hf"},{label:"Pers. de Broglie",latex:"\\lambda = \\frac{h}{mv}",preview:"λ = h/p"}]},{name:"Fisika",icon:"⚛️",level:"Kuliah",templates:[{label:"Kecepatan",latex:"v = \\frac{ds}{dt}",preview:"v = ds/dt"},{label:"Percepatan",latex:"a = \\frac{dv}{dt} = \\frac{d^2s}{dt^2}",preview:"a = dv/dt"},{label:"Hukum Newton II",latex:"\\vec{F} = m\\vec{a}",preview:"F⃗ = ma⃗"},{label:"Energi kinetik",latex:"E_k = \\frac{1}{2}mv^{2}",preview:"Eₖ = ½mv²"},{label:"Energi potensial",latex:"E_p = mgh",preview:"Eₚ = mgh"},{label:"Kerja",latex:"W = \\int \\vec{F} \\cdot d\\vec{r}",preview:"W = ∫F⃗·dr⃗"},{label:"Gravitasi Newton",latex:"F = G\\frac{m_1 m_2}{r^{2}}",preview:"F = Gm₁m₂/r²"},{label:"Hukum Coulomb",latex:"F = k\\frac{q_1 q_2}{r^{2}}",preview:"F = kq₁q₂/r²"},{label:"Hukum Ohm",latex:"V = IR",preview:"V = IR"},{label:"GLBB",latex:"s = v_0 t + \\frac{1}{2}at^{2}",preview:"s = v₀t + ½at²"},{label:"Pers. Schrödinger",latex:"i\\hbar \\frac{\\partial}{\\partial t}\\Psi = \\hat{H}\\Psi",preview:"iℏ ∂Ψ/∂t = ĤΨ"},{label:"Maxwell (Gauss)",latex:"\\nabla \\cdot \\vec{E} = \\frac{\\rho}{\\epsilon_0}",preview:"∇·E⃗ = ρ/ε₀"},{label:"Maxwell (Faraday)",latex:"\\nabla \\times \\vec{E} = -\\frac{\\partial \\vec{B}}{\\partial t}",preview:"∇×E⃗ = -∂B⃗/∂t"},{label:"E = mc²",latex:"E = mc^{2}",preview:"E = mc²"}]},{name:"Geometri Analitik",icon:"📐",level:"Kuliah",templates:[{label:"Persamaan lingkaran",latex:"(x-a)^{2} + (y-b)^{2} = r^{2}",preview:"(x-a)²+(y-b)²=r²"},{label:"Ellips",latex:"\\frac{x^2}{a^2} + \\frac{y^2}{b^2} = 1",preview:"x²/a² + y²/b² = 1"},{label:"Hiperbola",latex:"\\frac{x^2}{a^2} - \\frac{y^2}{b^2} = 1",preview:"x²/a² - y²/b² = 1"},{label:"Parabola",latex:"y^2 = 4ax",preview:"y² = 4ax"},{label:"Pers. bidang",latex:"ax + by + cz = d",preview:"ax + by + cz = d"},{label:"Pers. garis 3D",latex:"\\frac{x-x_0}{a} = \\frac{y-y_0}{b} = \\frac{z-z_0}{c}",preview:"Garis parametrik 3D"},{label:"Jarak titik ke garis",latex:"d = \\frac{|ax_1 + by_1 + c|}{\\sqrt{a^2 + b^2}}",preview:"d = |ax₁+by₁+c|/√(a²+b²)"},{label:"Jarak titik ke bidang",latex:"d = \\frac{|ax_0 + by_0 + cz_0 - d|}{\\sqrt{a^2 + b^2 + c^2}}",preview:"Jarak titik-bidang"},{label:"Koordinat polar",latex:"x = r\\cos\\theta,\\quad y = r\\sin\\theta",preview:"x=rcosθ, y=rsinθ"},{label:"Koordinat silinder",latex:"x = r\\cos\\theta,\\; y = r\\sin\\theta,\\; z = z",preview:"x=rcosθ, y=rsinθ, z=z"},{label:"Koordinat bola",latex:"x = \\rho\\sin\\phi\\cos\\theta,\\; y = \\rho\\sin\\phi\\sin\\theta,\\; z = \\rho\\cos\\phi",preview:"x=ρsinφcosθ, y=ρsinφsinθ..."}]},{name:"Teori Bilangan",icon:"🔣",level:"Kuliah",templates:[{label:"Modular aritmetika",latex:"a \\equiv b \\pmod{n}",preview:"a ≡ b (mod n)"},{label:"GCD (FPB)",latex:"\\gcd(a, b)",preview:"gcd(a, b)"},{label:"LCM (KPK)",latex:"\\text{lcm}(a, b) = \\frac{|a \\cdot b|}{\\gcd(a, b)}",preview:"lcm = |ab|/gcd"},{label:"Teorema Euler",latex:"a^{\\phi(n)} \\equiv 1 \\pmod{n}",preview:"Teorema Euler"},{label:"Fermat kecil",latex:"a^{p-1} \\equiv 1 \\pmod{p}",preview:"Fermat kecil"},{label:"Binomial Newton",latex:"(a+b)^n = \\sum_{k=0}^{n} \\binom{n}{k} a^{n-k} b^{k}",preview:"Binomial Newton"},{label:"Fibonacci",latex:"F_n = F_{n-1} + F_{n-2}",preview:"Fₙ = Fₙ₋₁ + Fₙ₋₂"},{label:"Faktorial",latex:"n! = n \\times (n-1) \\times \\ldots \\times 1",preview:"n! = n×(n-1)×...×1"}]},{name:"Konstanta & Satuan",icon:"⚖️",level:"SMA",templates:[{label:"Kecepatan Cahaya (c)",latex:"c = 2.998 \\times 10^8 \\text{ m/s}",preview:"c = 2.998e8 m/s"},{label:"Konstanta Gravitasi (G)",latex:"G = 6.674 \\times 10^{-11} \\text{ m}^3\\text{kg}^{-1}\\text{s}^{-2}",preview:"G = 6.674e-11"},{label:"Konstanta Planck (h)",latex:"h = 6.626 \\times 10^{-34} \\text{ J}\\cdot\\text{s}",preview:"h = 6.626e-34"},{label:"Bilangan Avogadro (N_A)",latex:"N_A = 6.022 \\times 10^{23} \\text{ mol}^{-1}",preview:"Na = 6.022e23"},{label:"Konstanta Gas (R)",latex:"R = 8.314 \\text{ J}/(\\text{mol}\\cdot\\text{K})",preview:"R = 8.314 J/molK"},{label:"Muatan Elementer (e)",latex:"e = 1.602 \\times 10^{-19} \\text{ C}",preview:"e = 1.602e-19"},{label:"Massa Elektron (m_e)",latex:"m_e = 9.109 \\times 10^{-31} \\text{ kg}",preview:"me = 9.109e-31"},{label:"Percepatan Gravitasi (g)",latex:"g = 9.807 \\text{ m/s}^2",preview:"g = 9.807 m/s²"}]},{name:"Tabel Kalkulus",icon:"📊",level:"Kuliah",templates:[{label:"Turunan x^n",latex:"\\frac{d}{dx} x^n = n x^{n-1}",preview:"(xⁿ)' = nxⁿ⁻¹"},{label:"Turunan sin x",latex:"\\frac{d}{dx} \\sin x = \\cos x",preview:"(sin x)' = cos x"},{label:"Turunan cos x",latex:"\\frac{d}{dx} \\cos x = -\\sin x",preview:"(cos x)' = -sin x"},{label:"Turunan e^x",latex:"\\frac{d}{dx} e^x = e^x",preview:"(eˣ)' = eˣ"},{label:"Turunan ln x",latex:"\\frac{d}{dx} \\ln x = \\frac{1}{x}",preview:"(ln x)' = 1/x"},{label:"Integral x^n",latex:"\\int x^n dx = \\frac{1}{n+1} x^{n+1} + C",preview:"∫xⁿ dx = xⁿ⁺¹/(n+1)"},{label:"Integral e^x",latex:"\\int e^x dx = e^x + C",preview:"∫eˣ dx = eˣ + C"},{label:"Integral 1/x",latex:"\\int \\frac{1}{x} dx = \\ln |x| + C",preview:"∫1/x dx = ln|x|"},{label:"Integral sin x",latex:"\\int \\sin x dx = -\\cos x + C",preview:"∫sin x dx = -cos x"},{label:"Integral cos x",latex:"\\int \\cos x dx = \\sin x + C",preview:"∫cos x dx = sin x"}]}],Ode=[{id:"all",label:"Semua Level",icon:"📚"},{id:"SD",label:"SD",icon:"🏫"},{id:"SMP",label:"SMP",icon:"🏫"},{id:"SMA",label:"SMA",icon:"🏫"},{id:"Kuliah",label:"Kuliah",icon:"🎓"},{id:"Master",label:"Master",icon:"🧪"}];function k8({onInsert:e,onClose:t}){const[n,r]=V.useState(""),[i,a]=V.useState("all"),[o,s]=V.useState(""),l=V.useMemo(()=>{let h=N8;if(i!=="all"&&(h=h.filter(m=>m.level===i)),n.trim()){const m=n.toLowerCase();h=h.map(f=>({...f,templates:f.templates.filter(_=>_.label.toLowerCase().includes(m)||_.preview.toLowerCase().includes(m)||_.desc&&_.desc.toLowerCase().includes(m))})).filter(f=>f.templates.length>0)}return h},[n,i]),c=l.map(h=>h.name),u=c.includes(o)?o:c[0]||"",d=n.trim()?l:l.filter(h=>h.name===u),p=N8.reduce((h,m)=>h+m.templates.length,0);return g.jsxs("div",{className:"mtx-template-panel",role:"dialog","aria-label":"Template Panel",children:[g.jsxs("div",{className:"mtx-template-panel__header",children:[g.jsxs("span",{className:"mtx-template-panel__title",children:["📋 Template Rumus (",p," template)"]}),g.jsx("button",{className:"mtx-template-panel__close",onClick:t,title:"Tutup",children:"×"})]}),g.jsx("div",{className:"mtx-template-panel__levels",children:Ode.map(h=>g.jsxs("button",{className:`mtx-template-panel__level ${i===h.id?"is-active":""}`,onClick:()=>{a(h.id),s("")},children:[g.jsx("span",{children:h.icon})," ",h.label]},h.id))}),g.jsx("input",{className:"mtx-template-panel__search",type:"text",placeholder:"Cari template... (cth: kuadrat, integral, luas, pH)",value:n,onChange:h=>r(h.target.value),autoFocus:!0}),g.jsxs("div",{className:"mtx-template-panel__body",children:[!n.trim()&&g.jsx("div",{className:"mtx-template-panel__tabs",children:l.map(h=>g.jsxs("button",{className:`mtx-template-panel__tab ${u===h.name?"is-active":""}`,onClick:()=>s(h.name),title:`${h.name} (${h.level})`,children:[g.jsx("span",{className:"mtx-template-panel__tab-icon",children:h.icon}),g.jsx("span",{className:"mtx-template-panel__tab-label",children:h.name}),g.jsx("span",{className:"mtx-template-panel__tab-badge",children:h.level})]},h.name))}),g.jsxs("div",{className:"mtx-template-panel__content",children:[d.length===0&&g.jsxs("div",{className:"mtx-template-panel__empty",children:['Tidak ditemukan template untuk "',n,'"']}),d.map(h=>g.jsxs("div",{className:"mtx-template-panel__group",children:[n.trim()&&g.jsxs("div",{className:"mtx-template-panel__group-title",children:[h.icon," ",h.name," ",g.jsx("span",{className:"mtx-template-panel__group-level",children:h.level})]}),g.jsx("div",{className:"mtx-template-panel__grid",children:h.templates.map(m=>g.jsxs("button",{className:"mtx-template-card",onClick:()=>{e(m.latex),t()},title:m.desc||m.label,children:[g.jsx("span",{className:"mtx-template-card__preview",children:m.preview}),g.jsx("span",{className:"mtx-template-card__label",children:m.label})]},m.latex))})]},h.name))]})]})]})}const Mde=V.lazy(()=>Promise.resolve().then(()=>m$).then(e=>({default:e.ImageInsertDialog})));async function B2(e){return new Promise((t,n)=>{const r=new window.Image;r.onload=()=>{t({width:r.naturalWidth||r.width,height:r.naturalHeight||r.height})},r.onerror=()=>n(new Error("Image load failed")),r.src=e})}function oh(e,t){const n=e&&e>0?e:720,r=Math.max(240,n-32);return Math.max(120,Math.min(t,r))}function fg(e,t,n){return{src:e,alt:t,width:n,height:"auto",offsetX:0,offsetY:0,align:"center"}}function gg(e){var i;const{selection:t}=e.state,n=t.node;if(((i=n==null?void 0:n.type)==null?void 0:i.name)==="image")return{node:{attrs:n.attrs||{}},pos:t.from};const r=t.$from.parent;return r.type.name==="image"?{node:r,pos:t.$from.before()}:null}const Ide=150;function O8(e,t=380,n=460){const i=window.innerWidth,a=window.innerHeight;let o=e.bottom+8;o+n>a-8&&(o=Math.max(8,e.top-n-8));let s=i-e.right;return e.right-t<8&&(s=Math.max(8,i-t-8)),{top:`${Math.round(o)}px`,right:`${Math.round(s)}px`}}function Rde({content:e="",onChange:t,onSave:n,editable:r=!0,placeholder:i="Tulis soal di sini...",toolbarMode:a,toolbar:o,mathToolbar:s,templates:l,outputFormat:c,className:u,minHeight:d="200px",maxHeight:p,autoFocus:h=!1,onImageUpload:m,onBeforePasteHTML:f}){const[_,b]=V.useState(!1),[y,v]=V.useState(!1),[E,T]=V.useState(!1),[S,w]=V.useState(!1),[M,P]=V.useState(null),[z,ee]=V.useState(!1),[O,H]=V.useState(null),x=V.useRef(null),[G,D]=V.useState(null),A=V.useRef(null),I=V.useRef(null),B=V.useRef(null),$=C8(e),R=NZ({extensions:[..._O({placeholder:i}),e8,t8],content:$,editable:r,autofocus:h?"end":!1,immediatelyRender:!1,shouldRerenderOnTransaction:!1,onUpdate:({editor:X})=>{I.current&&clearTimeout(I.current),I.current=setTimeout(()=>{const Y=I2(X);t==null||t(Y)},Ide)},onDestroy:()=>{I.current&&clearTimeout(I.current)},editorProps:{handleKeyDown:(X,Y)=>{if((Y.ctrlKey||Y.metaKey)&&Y.key==="s")return Y.preventDefault(),R&&(n==null||n(I2(R))),!0;if((Y.ctrlKey||Y.metaKey)&&Y.key==="k"){Y.preventDefault();const q=A.current,U=q==null?void 0:q.querySelector('[aria-label="Link"]');return U==null||U.click(),!0}if((Y.ctrlKey||Y.metaKey)&&Y.shiftKey&&Y.key==="T"){Y.preventDefault();const q=A.current,U=q==null?void 0:q.querySelector('[aria-label="Table"]');return U==null||U.click(),!0}return(Y.ctrlKey||Y.metaKey)&&Y.key==="m"?(Y.preventDefault(),L(),!0):!1},handleDrop:(X,Y)=>{var U;const q=(U=Y.dataTransfer)==null?void 0:U.files;if(q&&q.length>0){const Q=q[0];if(Q.type.startsWith("image/"))return Y.preventDefault(),Re(Q),!0;if(Q.name.endsWith(".docx"))return Y.preventDefault(),be(Q),!0}return!1},handlePaste:(X,Y)=>{var U;const q=(U=Y.clipboardData)==null?void 0:U.items;if(q){for(const Q of q)if(Q.type.startsWith("image/")){Y.preventDefault();const me=Q.getAsFile();return me&&Re(me),!0}}return!!(R&&Tde(R,Y)||R&&Sde(R,Y,f))}}}),L=V.useCallback((X="")=>{R&&R.chain().focus().insertContent({type:"mathInline",attrs:{latex:X,display:"inline"}}).run()},[R]),J=V.useCallback((X="")=>{R&&R.chain().focus().insertContent({type:"mathBlock",attrs:{latex:X,display:"block"}}).run()},[R]),se=V.useCallback(X=>{L(X)},[L]),ne=V.useCallback(X=>{L(X)},[L]),ge=V.useCallback(X=>{X.includes("\\begin{")||X.includes("\\frac")||X.length>30?J(X):L(X)},[L,J]),Ne=V.useCallback(async(X,Y)=>{var U,Q;if(!R)return;let q;try{const me=await B2(X);q=oh((U=A.current)==null?void 0:U.clientWidth,me.width)}catch{q=oh((Q=A.current)==null?void 0:Q.clientWidth,720)}R.chain().focus().insertContent({type:"image",attrs:fg(X,Y||"",q)}).run()},[R]),Ae=V.useCallback(()=>{var X;(X=B.current)==null||X.click()},[]),be=V.useCallback(async X=>{if(R){H(null),ee(!0);try{const Y=await Dde(X,R,async(q,U,Q)=>{if(m){const le=new File([Q],`${q}.${U.split("/")[1]||"png"}`,{type:U});return m(le)}const he=new Uint8Array(Q).reduce((le,Z)=>le+String.fromCharCode(Z),"");return`data:${U};base64,${btoa(he)}`});Y.length>0&&so.warn("DOCX import warnings:",Y)}catch(Y){const q=Y instanceof Error?Y.message:"Unknown error";so.error("DOCX import failed:",Y),H(`Gagal mengimpor .docx: ${q}`)}finally{ee(!1)}}},[R,m]),Re=V.useCallback(async X=>{var Y;if(R)if(m)try{const q=await m(X),U=await B2(q),Q=oh((Y=A.current)==null?void 0:Y.clientWidth,U.width);R.chain().focus().insertContent({type:"image",attrs:fg(q,"",Q)}).run()}catch{so.error("Image upload failed")}else{const q=new FileReader;q.onload=()=>{const U=q.result;B2(U).then(Q=>{var he;const me=oh((he=A.current)==null?void 0:he.clientWidth,Q.width);R.chain().focus().insertContent({type:"image",attrs:fg(U,"",me)}).run()}).catch(()=>{var me;const Q=oh((me=A.current)==null?void 0:me.clientWidth,720);R.chain().focus().insertContent({type:"image",attrs:fg(U,"",Q)}).run()})},q.readAsDataURL(X)}},[R,m]),we=V.useCallback(()=>{if(!R)return;const X=gg(R);if(!X)return;let Y,q;try{const Q=R.view.dom.querySelector(`img[src="${X.node.attrs.src}"]`);Q&&Q.naturalWidth>0&&(Y=Q.naturalWidth,q=Q.naturalHeight)}catch{}const U={width:X.node.attrs.width||Y||720,height:X.node.attrs.height||q||"auto",align:X.node.attrs.align||"center",alt:String(X.node.attrs.alt||""),title:String(X.node.attrs.title||""),maintainAspectRatio:!0,naturalWidth:Y,naturalHeight:q};P(U),w(!0)},[R]),K=V.useCallback(X=>{if(!R)return;const Y=gg(R);if(!Y)return;const q=R.state.tr;q.setNodeMarkup(Y.pos,void 0,{...Y.node.attrs,width:X.width,height:X.height,align:X.align,alt:X.alt,title:X.title}),R.view.dispatch(q),w(!1),P(null)},[R]),ye=V.useCallback(X=>{if(!R)return;const Y=gg(R);if(!Y)return;const q=R.state.tr;q.setNodeMarkup(Y.pos,void 0,{...Y.node.attrs,align:X,offsetX:0,offsetY:0}),R.view.dispatch(q)},[R]),N=V.useCallback(()=>{if(!R)return;const X=gg(R);if(!X)return;const Y=R.state.tr;Y.setNodeMarkup(X.pos,void 0,{...X.node.attrs,offsetX:0,offsetY:0}),R.view.dispatch(Y)},[R]);return g.jsx(Nde,{children:g.jsxs("div",{className:`mtx-editor ${u||""}`,ref:A,style:{"--mtx-min-height":d,"--mtx-max-height":p||"none"},children:[z&&g.jsxs("div",{className:"mtx-import-overlay",children:[g.jsx("div",{className:"mtx-import-overlay__spinner"}),g.jsx("span",{className:"mtx-import-overlay__text",children:"Mengimpor .docx..."})]}),O&&g.jsxs("div",{className:"mtx-import-error",children:[g.jsx("span",{children:O}),g.jsx("button",{type:"button",className:"mtx-import-error__close",onClick:()=>H(null),children:"×"})]}),r&&g.jsx(r8,{editor:R,toolbarMode:a,onInsertMath:()=>L(),onInsertBlockMath:J,onInsertImage:()=>T(!0),onEditImage:we,onSetImageAlign:ye,onResetImagePosition:N,onImportDocx:Ae}),r&&g.jsx("div",{ref:x,style:{position:"relative"},children:g.jsx(c8,{mode:a,onInsertLatex:se,onToggleSymbols:()=>{if(!_&&x.current){const X=x.current.getBoundingClientRect();D(O8(X,380,460))}b(X=>!X),v(!1)},onToggleTemplates:()=>{if(!y&&x.current){const X=x.current.getBoundingClientRect();D(O8(X,540,560))}v(X=>!X),b(!1)}})}),r&&_&&G&&ef.createPortal(g.jsx("div",{style:{position:"fixed",top:G.top,right:G.right,zIndex:9999},children:g.jsx(d8,{onInsert:ne,onClose:()=>b(!1)})}),document.body),r&&y&&G&&ef.createPortal(g.jsx("div",{style:{position:"fixed",top:G.top,right:G.right,zIndex:9999},children:g.jsx(k8,{onInsert:ge,onClose:()=>v(!1)})}),document.body),g.jsx("div",{id:"mtx-editor-content",className:"mtx-content",style:{minHeight:d,maxHeight:p||void 0,overflowY:p?"auto":void 0},children:g.jsx(yZ,{editor:R})}),R&&g.jsx(w8,{editor:R}),E&&g.jsx(V.Suspense,{fallback:null,children:g.jsx(Mde,{isOpen:E,onClose:()=>T(!1),onInsert:Ne,onImageUpload:m})}),S&&M&&g.jsx(A8,{isOpen:S,onClose:()=>{w(!1),P(null)},onApply:K,initialData:M}),g.jsx("input",{ref:B,type:"file",accept:".docx",style:{display:"none"},onChange:X=>{var q;const Y=(q=X.target.files)==null?void 0:q[0];Y&&(be(Y),X.target.value="")}})]})})}Jp.__defineMacro("\\ce",function(e){return M8(e.consumeArgs(1)[0],"ce")}),Jp.__defineMacro("\\pu",function(e){return M8(e.consumeArgs(1)[0],"pu")}),Jp.__defineMacro("\\tripledash","{\\vphantom{-}\\raisebox{2.56mu}{$\\mkern2mu\\tiny\\text{-}\\mkern1mu\\text{-}\\mkern1mu\\text{-}\\mkern2mu$}}");var M8=function(t,n){for(var r="",i=t.length&&t[t.length-1].loc.start,a=t.length-1;a>=0;a--)t[a].loc.start>i&&(r+=" ",i=t[a].loc.start),r+=t[a].text,i+=t[a].text.length;var o=Vt.go(Te.go(r,n));return o},Te={go:function(t,n){if(!t)return[];n===void 0&&(n="ce");var r="0",i={};i.parenthesisLevel=0,t=t.replace(/\n/g," "),t=t.replace(/[\u2212\u2013\u2014\u2010]/g,"-"),t=t.replace(/[\u2026]/g,"...");for(var a,o=10,s=[];;){a!==t?(o=10,a=t):o--;var l=Te.stateMachines[n],c=l.transitions[r]||l.transitions["*"];e:for(var u=0;u<c.length;u++){var d=Te.patterns.match_(c[u].pattern,t);if(d){for(var p=c[u].task,h=0;h<p.action_.length;h++){var m;if(l.actions[p.action_[h].type_])m=l.actions[p.action_[h].type_](i,d.match_,p.action_[h].option);else if(Te.actions[p.action_[h].type_])m=Te.actions[p.action_[h].type_](i,d.match_,p.action_[h].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+p.action_[h].type_+")"];Te.concatArray(s,m)}if(r=p.nextState||r,t.length>0){if(p.revisit||(t=d.remainder),!p.toContinue)break e}else return s}}if(o<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(t,n){if(n)if(Array.isArray(n))for(var r=0;r<n.length;r++)t.push(n[r]);else t.push(n)},patterns:{patterns:{empty:/^$/,else:/^./,else2:/^./,space:/^\s/,"space A":/^\s(?=[A-Z\\$])/,space$:/^\s$/,"a-z":/^[a-z]/,x:/^x/,x$:/^x$/,i$:/^i$/,letters:/^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,"\\greek":/^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,"one lowercase latin letter $":/^(?:([a-z])(?:$|[^a-zA-Z]))$/,"$one lowercase latin letter$ $":/^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,"one lowercase greek letter $":/^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,digits:/^[0-9]+/,"-9.,9":/^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,"-9.,9 no missing 0":/^[+\-]?[0-9]+(?:[.,][0-9]+)?/,"(-)(9.,9)(e)(99)":function(t){var n=t.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:([eE]|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);return n&&n[0]?{match_:n.splice(1),remainder:t.substr(n[0].length)}:null},"(-)(9)^(-9)":function(t){var n=t.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);return n&&n[0]?{match_:n.splice(1),remainder:t.substr(n[0].length)}:null},"state of aggregation $":function(t){var n=Te.patterns.findObserveGroups(t,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(n&&n.remainder.match(/^($|[\s,;\)\]\}])/))return n;var r=t.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);return r?{match_:r[0],remainder:t.substr(r[0].length)}:null},"_{(state of aggregation)}$":/^_\{(\([a-z]{1,3}\))\}/,"{[(":/^(?:\\\{|\[|\()/,")]}":/^(?:\)|\]|\\\})/,", ":/^[,;]\s*/,",":/^[,;]/,".":/^[.]/,". ":/^([.\u22C5\u00B7\u2022])\s*/,"...":/^\.\.\.(?=$|[^.])/,"* ":/^([*])\s*/,"^{(...)}":function(t){return Te.patterns.findObserveGroups(t,"^{","","","}")},"^($...$)":function(t){return Te.patterns.findObserveGroups(t,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(t){return Te.patterns.findObserveGroups(t,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(t){return Te.patterns.findObserveGroups(t,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(t){return Te.patterns.findObserveGroups(t,"_{","","","}")},"_($...$)":function(t){return Te.patterns.findObserveGroups(t,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(t){return Te.patterns.findObserveGroups(t,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(t){return Te.patterns.findObserveGroups(t,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(t){return Te.patterns.findObserveGroups(t,"","{","}","")},"{(...)}":function(t){return Te.patterns.findObserveGroups(t,"{","","","}")},"$...$":function(t){return Te.patterns.findObserveGroups(t,"","$","$","")},"${(...)}$":function(t){return Te.patterns.findObserveGroups(t,"${","","","}$")},"$(...)$":function(t){return Te.patterns.findObserveGroups(t,"$","","","$")},"=<>":/^[=<>]/,"#":/^[#\u2261]/,"+":/^\+/,"-$":/^-(?=[\s_},;\]/]|$|\([a-z]+\))/,"-9":/^-(?=[0-9])/,"- orbital overlap":/^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,"-":/^-/,"pm-operator":/^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,operator:/^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,arrowUpDown:/^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,"\\bond{(...)}":function(t){return Te.patterns.findObserveGroups(t,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(t){return Te.patterns.findObserveGroups(t,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(t){return Te.patterns.findObserveGroups(t,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(t){return Te.patterns.findObserveGroups(t,"",/^\\[a-zA-Z]+\{/,"}","")},"\\ca":/^\\ca(?:\s+|(?![a-zA-Z]))/,"\\x":/^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,orbital:/^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,others:/^[\/~|]/,"\\frac{(...)}":function(t){return Te.patterns.findObserveGroups(t,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(t){return Te.patterns.findObserveGroups(t,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(t){return Te.patterns.findObserveGroups(t,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(t){return Te.patterns.findObserveGroups(t,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(t){return Te.patterns.findObserveGroups(t,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(t){return Te.patterns.findObserveGroups(t,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(t){return Te.patterns.findObserveGroups(t,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(t){return Te.patterns.findObserveGroups(t,"\\ce{","","","}")},oxidation$:/^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"d-oxidation$":/^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"roman numeral":/^[IVX]+/,"1/2$":/^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,amount:function(t){var n;if(n=t.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/),n)return{match_:n[0],remainder:t.substr(n[0].length)};var r=Te.patterns.findObserveGroups(t,"","$","$","");return r&&(n=r.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/),n)?{match_:n[0],remainder:t.substr(n[0].length)}:null},amount2:function(t){return this.amount(t)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(t){if(t.match(/^\([a-z]+\)$/))return null;var n=t.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return n?{match_:n[0],remainder:t.substr(n[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(t,n,r,i,a,o,s,l,c,u){var d=function(v,E){if(typeof E=="string")return v.indexOf(E)!==0?null:E;var T=v.match(E);return T?T[0]:null},p=function(v,E,T){for(var S=0;E<v.length;){var w=v.charAt(E),M=d(v.substr(E),T);if(M!==null&&S===0)return{endMatchBegin:E,endMatchEnd:E+M.length};if(w==="{")S++;else if(w==="}"){if(S===0)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];S--}E++}return S>0,null},h=d(t,n);if(h===null||(t=t.substr(h.length),h=d(t,r),h===null))return null;var m=p(t,h.length,i||a);if(m===null)return null;var f=t.substring(0,i?m.endMatchEnd:m.endMatchBegin);if(o||s){var _=this.findObserveGroups(t.substr(m.endMatchEnd),o,s,l,c);if(_===null)return null;var b=[f,_.match_];return{match_:u?b.join(""):b,remainder:_.remainder}}else return{match_:f,remainder:t.substr(m.endMatchEnd)}},match_:function(t,n){var r=Te.patterns.patterns[t];if(r===void 0)throw["MhchemBugP","mhchem bug P. Please report. ("+t+")"];if(typeof r=="function")return Te.patterns.patterns[t](n);var i=n.match(r);if(i){var a;return i[2]?a=[i[1],i[2]]:i[1]?a=i[1]:a=i[0],{match_:a,remainder:n.substr(i[0].length)}}return null}},actions:{"a=":function(t,n){t.a=(t.a||"")+n},"b=":function(t,n){t.b=(t.b||"")+n},"p=":function(t,n){t.p=(t.p||"")+n},"o=":function(t,n){t.o=(t.o||"")+n},"q=":function(t,n){t.q=(t.q||"")+n},"d=":function(t,n){t.d=(t.d||"")+n},"rm=":function(t,n){t.rm=(t.rm||"")+n},"text=":function(t,n){t.text_=(t.text_||"")+n},insert:function(t,n,r){return{type_:r}},"insert+p1":function(t,n,r){return{type_:r,p1:n}},"insert+p1+p2":function(t,n,r){return{type_:r,p1:n[0],p2:n[1]}},copy:function(t,n){return n},rm:function(t,n){return{type_:"rm",p1:n||""}},text:function(t,n){return Te.go(n,"text")},"{text}":function(t,n){var r=["{"];return Te.concatArray(r,Te.go(n,"text")),r.push("}"),r},"tex-math":function(t,n){return Te.go(n,"tex-math")},"tex-math tight":function(t,n){return Te.go(n,"tex-math tight")},bond:function(t,n,r){return{type_:"bond",kind_:r||n}},"color0-output":function(t,n){return{type_:"color0",color:n[0]}},ce:function(t,n){return Te.go(n)},"1/2":function(t,n){var r=[];n.match(/^[+\-]/)&&(r.push(n.substr(0,1)),n=n.substr(1));var i=n.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return i[1]=i[1].replace(/\$/g,""),r.push({type_:"frac",p1:i[1],p2:i[2]}),i[3]&&(i[3]=i[3].replace(/\$/g,""),r.push({type_:"tex-math",p1:i[3]})),r},"9,9":function(t,n){return Te.go(n,"9,9")}},createTransitions:function(t){var n,r,i,a,o={};for(n in t)for(r in t[n])for(i=r.split("|"),t[n][r].stateArray=i,a=0;a<i.length;a++)o[i[a]]=[];for(n in t)for(r in t[n])for(i=t[n][r].stateArray||[],a=0;a<i.length;a++){var s=t[n][r];if(s.action_){s.action_=[].concat(s.action_);for(var l=0;l<s.action_.length;l++)typeof s.action_[l]=="string"&&(s.action_[l]={type_:s.action_[l]})}else s.action_=[];for(var c=n.split("|"),u=0;u<c.length;u++)if(i[a]==="*")for(var d in o)o[d].push({pattern:c[u],task:s});else o[i[a]].push({pattern:c[u],task:s})}return o},stateMachines:{}};Te.stateMachines={ce:{transitions:Te.createTransitions({empty:{"*":{action_:"output"}},else:{"0|1|2":{action_:"beginsWithBond=false",revisit:!0,toContinue:!0}},oxidation$:{0:{action_:"oxidation-output"}},CMT:{r:{action_:"rdt=",nextState:"rt"},rd:{action_:"rqt=",nextState:"rdt"}},arrowUpDown:{"0|1|2|as":{action_:["sb=false","output","operator"],nextState:"1"}},uprightEntities:{"0|1|2":{action_:["o=","output"],nextState:"1"}},orbital:{"0|1|2|3":{action_:"o=",nextState:"o"}},"->":{"0|1|2|3":{action_:"r=",nextState:"r"},"a|as":{action_:["output","r="],nextState:"r"},"*":{action_:["output","r="],nextState:"r"}},"+":{o:{action_:"d= kv",nextState:"d"},"d|D":{action_:"d=",nextState:"d"},q:{action_:"d=",nextState:"qd"},"qd|qD":{action_:"d=",nextState:"qd"},dq:{action_:["output","d="],nextState:"d"},3:{action_:["sb=false","output","operator"],nextState:"0"}},amount:{"0|2":{action_:"a=",nextState:"a"}},"pm-operator":{"0|1|2|a|as":{action_:["sb=false","output",{type_:"operator",option:"\\pm"}],nextState:"0"}},operator:{"0|1|2|a|as":{action_:["sb=false","output","operator"],nextState:"0"}},"-$":{"o|q":{action_:["charge or bond","output"],nextState:"qd"},d:{action_:"d=",nextState:"d"},D:{action_:["output",{type_:"bond",option:"-"}],nextState:"3"},q:{action_:"d=",nextState:"qd"},qd:{action_:"d=",nextState:"qd"},"qD|dq":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},"-9":{"3|o":{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"3"}},"- orbital overlap":{o:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},d:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"}},"-":{"0|1|2":{action_:[{type_:"output",option:1},"beginsWithBond=true",{type_:"bond",option:"-"}],nextState:"3"},3:{action_:{type_:"bond",option:"-"}},a:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},as:{action_:[{type_:"output",option:2},{type_:"bond",option:"-"}],nextState:"3"},b:{action_:"b="},o:{action_:{type_:"- after o/d",option:!1},nextState:"2"},q:{action_:{type_:"- after o/d",option:!1},nextState:"2"},"d|qd|dq":{action_:{type_:"- after o/d",option:!0},nextState:"2"},"D|qD|p":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},amount2:{"1|3":{action_:"a=",nextState:"a"}},letters:{"0|1|2|3|a|as|b|p|bp|o":{action_:"o=",nextState:"o"},"q|dq":{action_:["output","o="],nextState:"o"},"d|D|qd|qD":{action_:"o after d",nextState:"o"}},digits:{o:{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},q:{action_:["output","o="],nextState:"o"},a:{action_:"o=",nextState:"o"}},"space A":{"b|p|bp":{}},space:{a:{nextState:"as"},0:{action_:"sb=false"},"1|2":{action_:"sb=true"},"r|rt|rd|rdt|rdq":{action_:"output",nextState:"0"},"*":{action_:["output","sb=true"],nextState:"1"}},"1st-level escape":{"1|2":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}]},"*":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}],nextState:"0"}},"[(...)]":{"r|rt":{action_:"rd=",nextState:"rd"},"rd|rdt":{action_:"rq=",nextState:"rdq"}},"...":{"o|d|D|dq|qd|qD":{action_:["output",{type_:"bond",option:"..."}],nextState:"3"},"*":{action_:[{type_:"output",option:1},{type_:"insert",option:"ellipsis"}],nextState:"1"}},". |* ":{"*":{action_:["output",{type_:"insert",option:"addition compound"}],nextState:"1"}},"state of aggregation $":{"*":{action_:["output","state of aggregation"],nextState:"1"}},"{[(":{"a|as|o":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"0|1|2|3":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"*":{action_:["output","o=","output","parenthesisLevel++"],nextState:"2"}},")]}":{"0|1|2|3|b|p|bp|o":{action_:["o=","parenthesisLevel--"],nextState:"o"},"a|as|d|D|q|qd|qD|dq":{action_:["output","o=","parenthesisLevel--"],nextState:"o"}},", ":{"*":{action_:["output","comma"],nextState:"0"}},"^_":{"*":{}},"^{(...)}|^($...$)":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"D"},q:{action_:"d=",nextState:"qD"},"d|D|qd|qD|dq":{action_:["output","d="],nextState:"D"}},"^a|^\\x{}{}|^\\x{}|^\\x|'":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"d"},q:{action_:"d=",nextState:"qd"},"d|qd|D|qD":{action_:"d="},dq:{action_:["output","d="],nextState:"d"}},"_{(state of aggregation)}$":{"d|D|q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x":{"0|1|2|as":{action_:"p=",nextState:"p"},b:{action_:"p=",nextState:"bp"},"3|o":{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},"q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"=<>":{"0|1|2|3|a|as|o|q|d|D|qd|qD|dq":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"#":{"0|1|2|3|a|as|o":{action_:[{type_:"output",option:2},{type_:"bond",option:"#"}],nextState:"3"}},"{}":{"*":{action_:{type_:"output",option:1},nextState:"1"}},"{...}":{"0|1|2|3|a|as|b|p|bp":{action_:"o=",nextState:"o"},"o|d|D|q|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"$...$":{a:{action_:"a="},"0|1|2|3|as|b|p|bp|o":{action_:"o=",nextState:"o"},"as|o":{action_:"o="},"q|d|D|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"\\bond{(...)}":{"*":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"\\frac{(...)}":{"*":{action_:[{type_:"output",option:1},"frac-output"],nextState:"3"}},"\\overset{(...)}":{"*":{action_:[{type_:"output",option:2},"overset-output"],nextState:"3"}},"\\underset{(...)}":{"*":{action_:[{type_:"output",option:2},"underset-output"],nextState:"3"}},"\\underbrace{(...)}":{"*":{action_:[{type_:"output",option:2},"underbrace-output"],nextState:"3"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:[{type_:"output",option:2},"color-output"],nextState:"3"}},"\\color{(...)}0":{"*":{action_:[{type_:"output",option:2},"color0-output"]}},"\\ce{(...)}":{"*":{action_:[{type_:"output",option:2},"ce"],nextState:"3"}},"\\,":{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"1"}},"\\x{}{}|\\x{}|\\x":{"0|1|2|3|a|as|b|p|bp|o|c0":{action_:["o=","output"],nextState:"3"},"*":{action_:["output","o=","output"],nextState:"3"}},others:{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"3"}},else2:{a:{action_:"a to o",nextState:"o",revisit:!0},as:{action_:["output","sb=true"],nextState:"1",revisit:!0},"r|rt|rd|rdt|rdq":{action_:["output"],nextState:"0",revisit:!0},"*":{action_:["output","copy"],nextState:"3"}}}),actions:{"o after d":function(t,n){var r;if((t.d||"").match(/^[0-9]+$/)){var i=t.d;t.d=void 0,r=this.output(t),t.b=i}else r=this.output(t);return Te.actions["o="](t,n),r},"d= kv":function(t,n){t.d=n,t.dType="kv"},"charge or bond":function(t,n){if(t.beginsWithBond){var r=[];return Te.concatArray(r,this.output(t)),Te.concatArray(r,Te.actions.bond(t,n,"-")),r}else t.d=n},"- after o/d":function(t,n,r){var i=Te.patterns.match_("orbital",t.o||""),a=Te.patterns.match_("one lowercase greek letter $",t.o||""),o=Te.patterns.match_("one lowercase latin letter $",t.o||""),s=Te.patterns.match_("$one lowercase latin letter$ $",t.o||""),l=n==="-"&&(i&&i.remainder===""||a||o||s);l&&!t.a&&!t.b&&!t.p&&!t.d&&!t.q&&!i&&o&&(t.o="$"+t.o+"$");var c=[];return l?(Te.concatArray(c,this.output(t)),c.push({type_:"hyphen"})):(i=Te.patterns.match_("digits",t.d||""),r&&i&&i.remainder===""?(Te.concatArray(c,Te.actions["d="](t,n)),Te.concatArray(c,this.output(t))):(Te.concatArray(c,this.output(t)),Te.concatArray(c,Te.actions.bond(t,n,"-")))),c},"a to o":function(t){t.o=t.a,t.a=void 0},"sb=true":function(t){t.sb=!0},"sb=false":function(t){t.sb=!1},"beginsWithBond=true":function(t){t.beginsWithBond=!0},"beginsWithBond=false":function(t){t.beginsWithBond=!1},"parenthesisLevel++":function(t){t.parenthesisLevel++},"parenthesisLevel--":function(t){t.parenthesisLevel--},"state of aggregation":function(t,n){return{type_:"state of aggregation",p1:Te.go(n,"o")}},comma:function(t,n){var r=n.replace(/\s*$/,""),i=r!==n;return i&&t.parenthesisLevel===0?{type_:"comma enumeration L",p1:r}:{type_:"comma enumeration M",p1:r}},output:function(t,n,r){var i;if(!t.r)i=[],!t.a&&!t.b&&!t.p&&!t.o&&!t.q&&!t.d&&!r||(t.sb&&i.push({type_:"entitySkip"}),!t.o&&!t.q&&!t.d&&!t.b&&!t.p&&r!==2?(t.o=t.a,t.a=void 0):!t.o&&!t.q&&!t.d&&(t.b||t.p)?(t.o=t.a,t.d=t.b,t.q=t.p,t.a=t.b=t.p=void 0):t.o&&t.dType==="kv"&&Te.patterns.match_("d-oxidation$",t.d||"")?t.dType="oxidation":t.o&&t.dType==="kv"&&!t.q&&(t.dType=void 0),i.push({type_:"chemfive",a:Te.go(t.a,"a"),b:Te.go(t.b,"bd"),p:Te.go(t.p,"pq"),o:Te.go(t.o,"o"),q:Te.go(t.q,"pq"),d:Te.go(t.d,t.dType==="oxidation"?"oxidation":"bd"),dType:t.dType}));else{var a;t.rdt==="M"?a=Te.go(t.rd,"tex-math"):t.rdt==="T"?a=[{type_:"text",p1:t.rd||""}]:a=Te.go(t.rd);var o;t.rqt==="M"?o=Te.go(t.rq,"tex-math"):t.rqt==="T"?o=[{type_:"text",p1:t.rq||""}]:o=Te.go(t.rq),i={type_:"arrow",r:t.r,rd:a,rq:o}}for(var s in t)s!=="parenthesisLevel"&&s!=="beginsWithBond"&&delete t[s];return i},"oxidation-output":function(t,n){var r=["{"];return Te.concatArray(r,Te.go(n,"oxidation")),r.push("}"),r},"frac-output":function(t,n){return{type_:"frac-ce",p1:Te.go(n[0]),p2:Te.go(n[1])}},"overset-output":function(t,n){return{type_:"overset",p1:Te.go(n[0]),p2:Te.go(n[1])}},"underset-output":function(t,n){return{type_:"underset",p1:Te.go(n[0]),p2:Te.go(n[1])}},"underbrace-output":function(t,n){return{type_:"underbrace",p1:Te.go(n[0]),p2:Te.go(n[1])}},"color-output":function(t,n){return{type_:"color",color1:n[0],color2:Te.go(n[1])}},"r=":function(t,n){t.r=n},"rdt=":function(t,n){t.rdt=n},"rd=":function(t,n){t.rd=n},"rqt=":function(t,n){t.rqt=n},"rq=":function(t,n){t.rq=n},operator:function(t,n,r){return{type_:"operator",kind_:r||n}}}},a:{transitions:Te.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},"$(...)$":{"*":{action_:"tex-math tight",nextState:"1"}},",":{"*":{action_:{type_:"insert",option:"commaDecimal"}}},else2:{"*":{action_:"copy"}}}),actions:{}},o:{transitions:Te.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},letters:{"*":{action_:"rm"}},"\\ca":{"*":{action_:{type_:"insert",option:"circa"}}},"\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"{text}"}},else2:{"*":{action_:"copy"}}}),actions:{}},text:{transitions:Te.createTransitions({empty:{"*":{action_:"output"}},"{...}":{"*":{action_:"text="}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"\\greek":{"*":{action_:["output","rm"]}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:["output","copy"]}},else:{"*":{action_:"text="}}}),actions:{output:function(t){if(t.text_){var n={type_:"text",p1:t.text_};for(var r in t)delete t[r];return n}}}},pq:{transitions:Te.createTransitions({empty:{"*":{}},"state of aggregation $":{"*":{action_:"state of aggregation"}},i$:{0:{nextState:"!f",revisit:!0}},"(KV letters),":{0:{action_:"rm",nextState:"0"}},formula$:{0:{nextState:"f",revisit:!0}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"!f",revisit:!0}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"a-z":{f:{action_:"tex-math"}},letters:{"*":{action_:"rm"}},"-9.,9":{"*":{action_:"9,9"}},",":{"*":{action_:{type_:"insert+p1",option:"comma enumeration S"}}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"state of aggregation":function(t,n){return{type_:"state of aggregation subscript",p1:Te.go(n,"o")}},"color-output":function(t,n){return{type_:"color",color1:n[0],color2:Te.go(n[1],"pq")}}}},bd:{transitions:Te.createTransitions({empty:{"*":{}},x$:{0:{nextState:"!f",revisit:!0}},formula$:{0:{nextState:"f",revisit:!0}},else:{0:{nextState:"!f",revisit:!0}},"-9.,9 no missing 0":{"*":{action_:"9,9"}},".":{"*":{action_:{type_:"insert",option:"electron dot"}}},"a-z":{f:{action_:"tex-math"}},x:{"*":{action_:{type_:"insert",option:"KV x"}}},letters:{"*":{action_:"rm"}},"'":{"*":{action_:{type_:"insert",option:"prime"}}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"color-output":function(t,n){return{type_:"color",color1:n[0],color2:Te.go(n[1],"bd")}}}},oxidation:{transitions:Te.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(t,n){return{type_:"roman numeral",p1:n||""}}}},"tex-math":{transitions:Te.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(t){if(t.o){var n={type_:"tex-math",p1:t.o};for(var r in t)delete t[r];return n}}}},"tex-math tight":{transitions:Te.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(t,n){t.o=(t.o||"")+"{"+n+"}"},output:function(t){if(t.o){var n={type_:"tex-math",p1:t.o};for(var r in t)delete t[r];return n}}}},"9,9":{transitions:Te.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:Te.createTransitions({empty:{"*":{action_:"output"}},space$:{"*":{action_:["output","space"]}},"{[(|)]}":{"0|a":{action_:"copy"}},"(-)(9)^(-9)":{0:{action_:"number^",nextState:"a"}},"(-)(9.,9)(e)(99)":{0:{action_:"enumber",nextState:"a"}},space:{"0|a":{}},"pm-operator":{"0|a":{action_:{type_:"operator",option:"\\pm"},nextState:"0"}},operator:{"0|a":{action_:"copy",nextState:"0"}},"//":{d:{action_:"o=",nextState:"/"}},"/":{d:{action_:"o=",nextState:"/"}},"{...}|else":{"0|d":{action_:"d=",nextState:"d"},a:{action_:["space","d="],nextState:"d"},"/|q":{action_:"q=",nextState:"q"}}}),actions:{enumber:function(t,n){var r=[];return n[0]==="+-"||n[0]==="+/-"?r.push("\\pm "):n[0]&&r.push(n[0]),n[1]&&(Te.concatArray(r,Te.go(n[1],"pu-9,9")),n[2]&&(n[2].match(/[,.]/)?Te.concatArray(r,Te.go(n[2],"pu-9,9")):r.push(n[2])),n[3]=n[4]||n[3],n[3]&&(n[3]=n[3].trim(),n[3]==="e"||n[3].substr(0,1)==="*"?r.push({type_:"cdot"}):r.push({type_:"times"}))),n[3]&&r.push("10^{"+n[5]+"}"),r},"number^":function(t,n){var r=[];return n[0]==="+-"||n[0]==="+/-"?r.push("\\pm "):n[0]&&r.push(n[0]),Te.concatArray(r,Te.go(n[1],"pu-9,9")),r.push("^{"+n[2]+"}"),r},operator:function(t,n,r){return{type_:"operator",kind_:r||n}},space:function(){return{type_:"pu-space-1"}},output:function(t){var n,r=Te.patterns.match_("{(...)}",t.d||"");r&&r.remainder===""&&(t.d=r.match_);var i=Te.patterns.match_("{(...)}",t.q||"");if(i&&i.remainder===""&&(t.q=i.match_),t.d&&(t.d=t.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),t.d=t.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),t.q){t.q=t.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),t.q=t.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F");var a={d:Te.go(t.d,"pu"),q:Te.go(t.q,"pu")};t.o==="//"?n={type_:"pu-frac",p1:a.d,p2:a.q}:(n=a.d,a.d.length>1||a.q.length>1?n.push({type_:" / "}):n.push({type_:"/"}),Te.concatArray(n,a.q))}else n=Te.go(t.d,"pu-2");for(var o in t)delete t[o];return n}}},"pu-2":{transitions:Te.createTransitions({empty:{"*":{action_:"output"}},"*":{"*":{action_:["output","cdot"],nextState:"0"}},"\\x":{"*":{action_:"rm="}},space:{"*":{action_:["output","space"],nextState:"0"}},"^{(...)}|^(-1)":{1:{action_:"^(-1)"}},"-9.,9":{0:{action_:"rm=",nextState:"0"},1:{action_:"^(-1)",nextState:"0"}},"{...}|else":{"*":{action_:"rm=",nextState:"1"}}}),actions:{cdot:function(){return{type_:"tight cdot"}},"^(-1)":function(t,n){t.rm+="^{"+n+"}"},space:function(){return{type_:"pu-space-2"}},output:function(t){var n=[];if(t.rm){var r=Te.patterns.match_("{(...)}",t.rm||"");r&&r.remainder===""?n=Te.go(r.match_,"pu"):n={type_:"rm",p1:t.rm}}for(var i in t)delete t[i];return n}}},"pu-9,9":{transitions:Te.createTransitions({empty:{0:{action_:"output-0"},o:{action_:"output-o"}},",":{0:{action_:["output-0","comma"],nextState:"o"}},".":{0:{action_:["output-0","copy"],nextState:"o"}},else:{"*":{action_:"text="}}}),actions:{comma:function(){return{type_:"commaDecimal"}},"output-0":function(t){var n=[];if(t.text_=t.text_||"",t.text_.length>4){var r=t.text_.length%3;r===0&&(r=3);for(var i=t.text_.length-3;i>0;i-=3)n.push(t.text_.substr(i,3)),n.push({type_:"1000 separator"});n.push(t.text_.substr(0,r)),n.reverse()}else n.push(t.text_);for(var a in t)delete t[a];return n},"output-o":function(t){var n=[];if(t.text_=t.text_||"",t.text_.length>4){for(var r=t.text_.length-3,i=0;i<r;i+=3)n.push(t.text_.substr(i,3)),n.push({type_:"1000 separator"});n.push(t.text_.substr(i))}else n.push(t.text_);for(var a in t)delete t[a];return n}}}};var Vt={go:function(t,n){if(!t)return"";for(var r="",i=!1,a=0;a<t.length;a++){var o=t[a];typeof o=="string"?r+=o:(r+=Vt._go2(o),o.type_==="1st-level escape"&&(i=!0))}return!n&&!i&&r&&(r="{"+r+"}"),r},_goInner:function(t){return t&&Vt.go(t,!0)},_go2:function(t){var n;switch(t.type_){case"chemfive":n="";var r={a:Vt._goInner(t.a),b:Vt._goInner(t.b),p:Vt._goInner(t.p),o:Vt._goInner(t.o),q:Vt._goInner(t.q),d:Vt._goInner(t.d)};r.a&&(r.a.match(/^[+\-]/)&&(r.a="{"+r.a+"}"),n+=r.a+"\\,"),(r.b||r.p)&&(n+="{\\vphantom{X}}",n+="^{\\hphantom{"+(r.b||"")+"}}_{\\hphantom{"+(r.p||"")+"}}",n+="{\\vphantom{X}}",n+="^{\\smash[t]{\\vphantom{2}}\\mathllap{"+(r.b||"")+"}}",n+="_{\\vphantom{2}\\mathllap{\\smash[t]{"+(r.p||"")+"}}}"),r.o&&(r.o.match(/^[+\-]/)&&(r.o="{"+r.o+"}"),n+=r.o),t.dType==="kv"?((r.d||r.q)&&(n+="{\\vphantom{X}}"),r.d&&(n+="^{"+r.d+"}"),r.q&&(n+="_{\\smash[t]{"+r.q+"}}")):t.dType==="oxidation"?(r.d&&(n+="{\\vphantom{X}}",n+="^{"+r.d+"}"),r.q&&(n+="{\\vphantom{X}}",n+="_{\\smash[t]{"+r.q+"}}")):(r.q&&(n+="{\\vphantom{X}}",n+="_{\\smash[t]{"+r.q+"}}"),r.d&&(n+="{\\vphantom{X}}",n+="^{"+r.d+"}"));break;case"rm":n="\\mathrm{"+t.p1+"}";break;case"text":t.p1.match(/[\^_]/)?(t.p1=t.p1.replace(" ","~").replace("-","\\text{-}"),n="\\mathrm{"+t.p1+"}"):n="\\text{"+t.p1+"}";break;case"roman numeral":n="\\mathrm{"+t.p1+"}";break;case"state of aggregation":n="\\mskip2mu "+Vt._goInner(t.p1);break;case"state of aggregation subscript":n="\\mskip1mu "+Vt._goInner(t.p1);break;case"bond":if(n=Vt._getBond(t.kind_),!n)throw["MhchemErrorBond","mhchem Error. Unknown bond type ("+t.kind_+")"];break;case"frac":var i="\\frac{"+t.p1+"}{"+t.p2+"}";n="\\mathchoice{\\textstyle"+i+"}{"+i+"}{"+i+"}{"+i+"}";break;case"pu-frac":var a="\\frac{"+Vt._goInner(t.p1)+"}{"+Vt._goInner(t.p2)+"}";n="\\mathchoice{\\textstyle"+a+"}{"+a+"}{"+a+"}{"+a+"}";break;case"tex-math":n=t.p1+" ";break;case"frac-ce":n="\\frac{"+Vt._goInner(t.p1)+"}{"+Vt._goInner(t.p2)+"}";break;case"overset":n="\\overset{"+Vt._goInner(t.p1)+"}{"+Vt._goInner(t.p2)+"}";break;case"underset":n="\\underset{"+Vt._goInner(t.p1)+"}{"+Vt._goInner(t.p2)+"}";break;case"underbrace":n="\\underbrace{"+Vt._goInner(t.p1)+"}_{"+Vt._goInner(t.p2)+"}";break;case"color":n="{\\color{"+t.color1+"}{"+Vt._goInner(t.color2)+"}}";break;case"color0":n="\\color{"+t.color+"}";break;case"arrow":var o={rd:Vt._goInner(t.rd),rq:Vt._goInner(t.rq)},s="\\x"+Vt._getArrow(t.r);o.rq&&(s+="[{"+o.rq+"}]"),o.rd?s+="{"+o.rd+"}":s+="{}",n=s;break;case"operator":n=Vt._getOperator(t.kind_);break;case"1st-level escape":n=t.p1+" ";break;case"space":n=" ";break;case"entitySkip":n="~";break;case"pu-space-1":n="~";break;case"pu-space-2":n="\\mkern3mu ";break;case"1000 separator":n="\\mkern2mu ";break;case"commaDecimal":n="{,}";break;case"comma enumeration L":n="{"+t.p1+"}\\mkern6mu ";break;case"comma enumeration M":n="{"+t.p1+"}\\mkern3mu ";break;case"comma enumeration S":n="{"+t.p1+"}\\mkern1mu ";break;case"hyphen":n="\\text{-}";break;case"addition compound":n="\\,{\\cdot}\\,";break;case"electron dot":n="\\mkern1mu \\bullet\\mkern1mu ";break;case"KV x":n="{\\times}";break;case"prime":n="\\prime ";break;case"cdot":n="\\cdot ";break;case"tight cdot":n="\\mkern1mu{\\cdot}\\mkern1mu ";break;case"times":n="\\times ";break;case"circa":n="{\\sim}";break;case"^":n="uparrow";break;case"v":n="downarrow";break;case"ellipsis":n="\\ldots ";break;case"/":n="/";break;case" / ":n="\\,/\\,";break;default:throw["MhchemBugT","mhchem bug T. Please report."]}return n},_getArrow:function(t){switch(t){case"->":return"rightarrow";case"→":return"rightarrow";case"⟶":return"rightarrow";case"<-":return"leftarrow";case"<->":return"leftrightarrow";case"<-->":return"rightleftarrows";case"<=>":return"rightleftharpoons";case"⇌":return"rightleftharpoons";case"<=>>":return"rightequilibrium";case"<<=>":return"leftequilibrium";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getBond:function(t){switch(t){case"-":return"{-}";case"1":return"{-}";case"=":return"{=}";case"2":return"{=}";case"#":return"{\\equiv}";case"3":return"{\\equiv}";case"~":return"{\\tripledash}";case"~-":return"{\\mathrlap{\\raisebox{-.1em}{$-$}}\\raisebox{.1em}{$\\tripledash$}}";case"~=":return"{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$\\tripledash$}}-}";case"~--":return"{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$\\tripledash$}}-}";case"-~-":return"{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$-$}}\\tripledash}";case"...":return"{{\\cdot}{\\cdot}{\\cdot}}";case"....":return"{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";case"->":return"{\\rightarrow}";case"<-":return"{\\leftarrow}";case"<":return"{<}";case">":return"{>}";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getOperator:function(t){switch(t){case"+":return" {}+{} ";case"-":return" {}-{} ";case"=":return" {}={} ";case"<":return" {}<{} ";case">":return" {}>{} ";case"<<":return" {}\\ll{} ";case">>":return" {}\\gg{} ";case"\\pm":return" {}\\pm{} ";case"\\approx":return" {}\\approx{} ";case"$\\approx$":return" {}\\approx{} ";case"v":return" \\downarrow{} ";case"(v)":return" \\downarrow{} ";case"^":return" \\uparrow{} ";case"(^)":return" \\uparrow{} ";default:throw["MhchemBugT","mhchem bug T. Please report."]}}};function Lde(e){if(e.querySelector(".katex"))return;const t=e.getAttribute("data-latex")||e.getAttribute("latex");if(!t)return;const n=e.classList.contains("mtx-math-block");try{Jp.render(t,e,{throwOnError:!1,displayMode:n,output:"htmlAndMathml"})}catch{e.textContent=n?`$$${t}$$`:`$${t}$`}}function Pde({content:e,className:t}){const n=V.useRef(null),r=V.useMemo(()=>O2.sanitize(e,{ADD_TAGS:["math-field","span","div"],ADD_ATTR:["data-latex","latex","data-type","data-mathml"],FORBID_TAGS:["script","style","iframe","object","embed"],FORBID_ATTR:["onerror","onload","onclick","onmouseover","onmouseout","onfocus","onblur"]}),[e]);return V.useEffect(()=>{if(!n.current)return;n.current.querySelectorAll('.mtx-math-inline, .mtx-math-block, [data-type="math-inline"], [data-type="math-block"]').forEach(Lde)},[r]),g.jsx("div",{ref:n,className:`mtx-content-viewer${t?` ${t}`:""}`,dangerouslySetInnerHTML:{__html:r}})}const Bde=V.lazy(()=>Promise.resolve().then(()=>a$).then(e=>({default:e.LinkDialogImpl}))),I8=V.memo(function(t){return g.jsx(V.Suspense,{fallback:null,children:g.jsx(Bde,{...t})})});I8.displayName="LinkDialog";const Fde=V.lazy(()=>Promise.resolve().then(()=>s$).then(e=>({default:e.InsertTableDialogImpl}))),R8=V.memo(function(t){return g.jsx(V.Suspense,{fallback:null,children:g.jsx(Fde,{...t})})});R8.displayName="InsertTableDialog";const Ude=V.lazy(()=>Promise.resolve().then(()=>c$).then(e=>({default:e.CellPropertiesDialogImpl}))),L8=V.memo(function(t){return g.jsx(V.Suspense,{fallback:null,children:g.jsx(Ude,{...t})})});L8.displayName="CellPropertiesDialog";const zde=V.lazy(()=>Promise.resolve().then(()=>d$).then(e=>({default:e.TablePropertiesDialogImpl}))),P8=V.memo(function(t){return g.jsx(V.Suspense,{fallback:null,children:g.jsx(zde,{...t})})});P8.displayName="TablePropertiesDialog";const $de=V.lazy(()=>Promise.resolve().then(()=>h$).then(e=>({default:e.TableTemplatesDialogImpl}))),B8=V.memo(function(t){return g.jsx(V.Suspense,{fallback:null,children:g.jsx($de,{...t})})});B8.displayName="TableTemplatesDialog";function Gde(e){const t={};return e.headerStyle==="light"?t.th="background-color: #f1f5f9; font-weight: 600;":e.headerStyle==="dark"?t.th="background-color: #1e293b; color: white; font-weight: 600;":e.headerStyle==="blue"&&(t.th="background-color: #3b82f6; color: white; font-weight: 600;"),e.borderStyle==="all"?t["td, th"]="border: 1px solid #cbd5e1;":e.borderStyle==="horizontal"?t["td, th"]="border-top: 1px solid #cbd5e1; border-bottom: 1px solid #cbd5e1;":e.borderStyle==="vertical"&&(t["td, th"]="border-left: 1px solid #cbd5e1; border-right: 1px solid #cbd5e1;"),t}const Hde=[{id:"quad-formula",label:"Rumus ABC (Kuadrat)",latex:"x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}",category:"Algebra",level:"smp"},{id:"quad-eq",label:"Persamaan Kuadrat",latex:"ax^2 + bx + c = 0",category:"Algebra",level:"smp"},{id:"linear-eq",label:"Persamaan Linear",latex:"y = mx + c",category:"Algebra",level:"smp"},{id:"factoring",label:"Pemfaktoran",latex:"a^2 - b^2 = (a+b)(a-b)",category:"Algebra",level:"smp"},{id:"binomial-sq",label:"Kuadrat Binomial",latex:"(a+b)^2 = a^2 + 2ab + b^2",category:"Algebra",level:"smp"},{id:"abs-value",label:"Nilai Mutlak",latex:"|x - a| = b",category:"Algebra",level:"sma"},{id:"log-def",label:"Logaritma",latex:"\\log_a b = c \\iff a^c = b",category:"Algebra",level:"sma"},{id:"exponent-rule",label:"Aturan Eksponen",latex:"a^m \\cdot a^n = a^{m+n}",category:"Algebra",level:"smp"}],qde=[{id:"pythagoras",label:"Teorema Pythagoras",latex:"a^2 + b^2 = c^2",category:"Geometri",level:"smp"},{id:"circle-area",label:"Luas Lingkaran",latex:"L = \\pi r^2",category:"Geometri",level:"sd"},{id:"circle-circumference",label:"Keliling Lingkaran",latex:"K = 2\\pi r",category:"Geometri",level:"sd"},{id:"triangle-area",label:"Luas Segitiga",latex:"L = \\frac{1}{2} \\times a \\times t",category:"Geometri",level:"sd"},{id:"rect-area",label:"Luas Persegi Panjang",latex:"L = p \\times l",category:"Geometri",level:"sd"},{id:"sphere-volume",label:"Volume Bola",latex:"V = \\frac{4}{3} \\pi r^3",category:"Geometri",level:"smp"},{id:"cylinder-volume",label:"Volume Tabung",latex:"V = \\pi r^2 t",category:"Geometri",level:"smp"},{id:"cone-volume",label:"Volume Kerucut",latex:"V = \\frac{1}{3} \\pi r^2 t",category:"Geometri",level:"smp"},{id:"distance-2d",label:"Jarak Dua Titik",latex:"d = \\sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}",category:"Geometri",level:"sma"}],Wde=[{id:"sin-def",label:"Sinus",latex:"\\sin \\theta = \\frac{\\text{depan}}{\\text{miring}}",category:"Trigonometri",level:"sma"},{id:"cos-def",label:"Cosinus",latex:"\\cos \\theta = \\frac{\\text{samping}}{\\text{miring}}",category:"Trigonometri",level:"sma"},{id:"tan-def",label:"Tangen",latex:"\\tan \\theta = \\frac{\\sin \\theta}{\\cos \\theta}",category:"Trigonometri",level:"sma"},{id:"pyth-identity",label:"Identitas Pythagoras",latex:"\\sin^2 \\theta + \\cos^2 \\theta = 1",category:"Trigonometri",level:"sma"},{id:"sin-rule",label:"Aturan Sinus",latex:"\\frac{a}{\\sin A} = \\frac{b}{\\sin B} = \\frac{c}{\\sin C}",category:"Trigonometri",level:"sma"},{id:"cos-rule",label:"Aturan Cosinus",latex:"c^2 = a^2 + b^2 - 2ab\\cos C",category:"Trigonometri",level:"sma"},{id:"double-angle-sin",label:"Sudut Ganda (Sin)",latex:"\\sin 2\\theta = 2\\sin \\theta \\cos \\theta",category:"Trigonometri",level:"sma"}],Vde=[{id:"derivative-def",label:"Definisi Turunan",latex:"f'(x) = \\lim_{h \\to 0} \\frac{f(x+h) - f(x)}{h}",category:"Kalkulus",level:"sma"},{id:"power-rule",label:"Aturan Pangkat",latex:"\\frac{d}{dx} x^n = nx^{n-1}",category:"Kalkulus",level:"sma"},{id:"chain-rule",label:"Aturan Rantai",latex:"\\frac{dy}{dx} = \\frac{dy}{du} \\cdot \\frac{du}{dx}",category:"Kalkulus",level:"sma"},{id:"definite-integral",label:"Integral Tentu",latex:"\\int_a^b f(x)\\, dx = F(b) - F(a)",category:"Kalkulus",level:"sma"},{id:"indef-integral",label:"Integral Tak Tentu",latex:"\\int x^n\\, dx = \\frac{x^{n+1}}{n+1} + C",category:"Kalkulus",level:"sma"},{id:"limit-def",label:"Limit",latex:"\\lim_{x \\to a} f(x) = L",category:"Kalkulus",level:"sma"}],Yde=[{id:"mean",label:"Rata-rata (Mean)",latex:"\\bar{x} = \\frac{\\sum_{i=1}^{n} x_i}{n}",category:"Statistik",level:"smp"},{id:"median",label:"Median",latex:"Me = x_{\\frac{n+1}{2}}",category:"Statistik",level:"smp"},{id:"std-dev",label:"Simpangan Baku",latex:"s = \\sqrt{\\frac{\\sum_{i=1}^{n}(x_i - \\bar{x})^2}{n-1}}",category:"Statistik",level:"sma"},{id:"variance",label:"Variansi",latex:"s^2 = \\frac{\\sum_{i=1}^{n}(x_i - \\bar{x})^2}{n-1}",category:"Statistik",level:"sma"},{id:"combination",label:"Kombinasi",latex:"C(n, r) = \\binom{n}{r} = \\frac{n!}{r!(n-r)!}",category:"Statistik",level:"sma"},{id:"permutation",label:"Permutasi",latex:"P(n, r) = \\frac{n!}{(n-r)!}",category:"Statistik",level:"sma"},{id:"probability",label:"Peluang",latex:"P(A) = \\frac{n(A)}{n(S)}",category:"Statistik",level:"smp"}],Kde=[{id:"velocity",label:"Kecepatan",latex:"v = \\frac{s}{t}",category:"Fisika",level:"smp"},{id:"acceleration",label:"Percepatan",latex:"a = \\frac{\\Delta v}{\\Delta t}",category:"Fisika",level:"smp"},{id:"newton-2",label:"Hukum Newton II",latex:"F = m \\cdot a",category:"Fisika",level:"smp"},{id:"kinetic-energy",label:"Energi Kinetik",latex:"E_k = \\frac{1}{2}mv^2",category:"Fisika",level:"sma"},{id:"potential-energy",label:"Energi Potensial",latex:"E_p = mgh",category:"Fisika",level:"sma"},{id:"work",label:"Usaha",latex:"W = F \\cdot s \\cdot \\cos \\theta",category:"Fisika",level:"sma"},{id:"ohm-law",label:"Hukum Ohm",latex:"V = I \\cdot R",category:"Fisika",level:"sma"},{id:"power-physics",label:"Daya",latex:"P = \\frac{W}{t}",category:"Fisika",level:"sma"},{id:"gravity",label:"Gravitasi Newton",latex:"F = G \\frac{m_1 m_2}{r^2}",category:"Fisika",level:"sma"}],Qde=[{id:"mol",label:"Jumlah Mol",latex:"n = \\frac{m}{M_r}",category:"Kimia",level:"sma"},{id:"molar-conc",label:"Molaritas",latex:"M = \\frac{n}{V}",category:"Kimia",level:"sma"},{id:"ideal-gas",label:"Gas Ideal",latex:"PV = nRT",category:"Kimia",level:"sma"},{id:"ph",label:"pH",latex:"pH = -\\log [H^+]",category:"Kimia",level:"sma"},{id:"dilution",label:"Pengenceran",latex:"M_1 V_1 = M_2 V_2",category:"Kimia",level:"sma"}],sh=[...Hde,...qde,...Wde,...Vde,...Yde,...Kde,...Qde];function Xde(e){if(e==="all")return sh;const n={sd:["sd"],smp:["sd","smp"],sma:["sd","smp","sma"]}[e]||["sd","smp","sma"];return sh.filter(r=>n.includes(r.level))}function jde(e){return sh.filter(t=>t.category===e)}function Zde(){return[...new Set(sh.map(e=>e.category))]}var F2={};typeof window<"u"&&function(e,t){try{e.querySelector(":scope body")}catch{["querySelector","querySelectorAll"].forEach(function(r){const i=t[r];t[r]=function(a){if(/(^|,)\s*:scope/.test(a)){const o=this.id;this.id="ID_"+Date.now(),a=a.replace(/((^|,)\s*):scope/g,"$1#"+this.id);const s=e[r](a);return this.id=o,s}else return i.call(this,a)}})}}(window.document,Element.prototype);var _g={};function mt(e){return function(){return e}}const F8=Math.abs,pr=Math.atan2,go=Math.cos,Jde=Math.max,Iu=Math.min,Qr=Math.sin,tn=Math.sqrt,hr=1e-12,Os=Math.PI,bg=Os/2,Ms=2*Os;function epe(e){return e>1?0:e<-1?Os:Math.acos(e)}function U8(e){return e>=1?bg:e<=-1?-bg:Math.asin(e)}const U2=Math.PI,z2=2*U2,ec=1e-6,tpe=z2-ec;function z8(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function npe(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return z8;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class rpe{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?z8:npe(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,o){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,s=this._y1,l=r-t,c=i-n,u=o-t,d=s-n,p=u*u+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(p>ec)if(!(Math.abs(d*l-c*u)>ec)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let h=r-o,m=i-s,f=l*l+c*c,_=h*h+m*m,b=Math.sqrt(f),y=Math.sqrt(p),v=a*Math.tan((U2-Math.acos((f+p-_)/(2*b*y)))/2),E=v/y,T=v/b;Math.abs(E-1)>ec&&this._append`L${t+E*u},${n+E*d}`,this._append`A${a},${a},0,0,${+(d*h>u*m)},${this._x1=t+T*l},${this._y1=n+T*c}`}}arc(t,n,r,i,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),l=r*Math.sin(i),c=t+s,u=n+l,d=1^o,p=o?i-a:a-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>ec||Math.abs(this._y1-u)>ec)&&this._append`L${c},${u}`,r&&(p<0&&(p=p%z2+z2),p>tpe?this._append`A${r},${r},0,1,${d},${t-s},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=u}`:p>ec&&this._append`A${r},${r},0,${+(p>=U2)},${d},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function lh(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new rpe(t)}function ipe(e){return e.innerRadius}function ape(e){return e.outerRadius}function ope(e){return e.startAngle}function spe(e){return e.endAngle}function lpe(e){return e&&e.padAngle}function cpe(e,t,n,r,i,a,o,s){var l=n-e,c=r-t,u=o-i,d=s-a,p=d*l-u*c;if(!(p*p<hr))return p=(u*(t-a)-d*(e-i))/p,[e+p*l,t+p*c]}function yg(e,t,n,r,i,a,o){var s=e-n,l=t-r,c=(o?a:-a)/tn(s*s+l*l),u=c*l,d=-c*s,p=e+u,h=t+d,m=n+u,f=r+d,_=(p+m)/2,b=(h+f)/2,y=m-p,v=f-h,E=y*y+v*v,T=i-a,S=p*f-m*h,w=(v<0?-1:1)*tn(Jde(0,T*T*E-S*S)),M=(S*v-y*w)/E,P=(-S*y-v*w)/E,z=(S*v+y*w)/E,ee=(-S*y+v*w)/E,O=M-_,H=P-b,x=z-_,G=ee-b;return O*O+H*H>x*x+G*G&&(M=z,P=ee),{cx:M,cy:P,x01:-u,y01:-d,x11:M*(i/T-1),y11:P*(i/T-1)}}function upe(){var e=ipe,t=ape,n=mt(0),r=null,i=ope,a=spe,o=lpe,s=null,l=lh(c);function c(){var u,d,p=+e.apply(this,arguments),h=+t.apply(this,arguments),m=i.apply(this,arguments)-bg,f=a.apply(this,arguments)-bg,_=F8(f-m),b=f>m;if(s||(s=u=l()),h<p&&(d=h,h=p,p=d),!(h>hr))s.moveTo(0,0);else if(_>Ms-hr)s.moveTo(h*go(m),h*Qr(m)),s.arc(0,0,h,m,f,!b),p>hr&&(s.moveTo(p*go(f),p*Qr(f)),s.arc(0,0,p,f,m,b));else{var y=m,v=f,E=m,T=f,S=_,w=_,M=o.apply(this,arguments)/2,P=M>hr&&(r?+r.apply(this,arguments):tn(p*p+h*h)),z=Iu(F8(h-p)/2,+n.apply(this,arguments)),ee=z,O=z,H,x;if(P>hr){var G=U8(P/p*Qr(M)),D=U8(P/h*Qr(M));(S-=G*2)>hr?(G*=b?1:-1,E+=G,T-=G):(S=0,E=T=(m+f)/2),(w-=D*2)>hr?(D*=b?1:-1,y+=D,v-=D):(w=0,y=v=(m+f)/2)}var A=h*go(y),I=h*Qr(y),B=p*go(T),$=p*Qr(T);if(z>hr){var R=h*go(v),L=h*Qr(v),J=p*go(E),se=p*Qr(E),ne;if(_<Os)if(ne=cpe(A,I,J,se,R,L,B,$)){var ge=A-ne[0],Ne=I-ne[1],Ae=R-ne[0],be=L-ne[1],Re=1/Qr(epe((ge*Ae+Ne*be)/(tn(ge*ge+Ne*Ne)*tn(Ae*Ae+be*be)))/2),we=tn(ne[0]*ne[0]+ne[1]*ne[1]);ee=Iu(z,(p-we)/(Re-1)),O=Iu(z,(h-we)/(Re+1))}else ee=O=0}w>hr?O>hr?(H=yg(J,se,A,I,h,O,b),x=yg(R,L,B,$,h,O,b),s.moveTo(H.cx+H.x01,H.cy+H.y01),O<z?s.arc(H.cx,H.cy,O,pr(H.y01,H.x01),pr(x.y01,x.x01),!b):(s.arc(H.cx,H.cy,O,pr(H.y01,H.x01),pr(H.y11,H.x11),!b),s.arc(0,0,h,pr(H.cy+H.y11,H.cx+H.x11),pr(x.cy+x.y11,x.cx+x.x11),!b),s.arc(x.cx,x.cy,O,pr(x.y11,x.x11),pr(x.y01,x.x01),!b))):(s.moveTo(A,I),s.arc(0,0,h,y,v,!b)):s.moveTo(A,I),!(p>hr)||!(S>hr)?s.lineTo(B,$):ee>hr?(H=yg(B,$,R,L,p,-ee,b),x=yg(A,I,J,se,p,-ee,b),s.lineTo(H.cx+H.x01,H.cy+H.y01),ee<z?s.arc(H.cx,H.cy,ee,pr(H.y01,H.x01),pr(x.y01,x.x01),!b):(s.arc(H.cx,H.cy,ee,pr(H.y01,H.x01),pr(H.y11,H.x11),!b),s.arc(0,0,p,pr(H.cy+H.y11,H.cx+H.x11),pr(x.cy+x.y11,x.cx+x.x11),b),s.arc(x.cx,x.cy,ee,pr(x.y11,x.x11),pr(x.y01,x.x01),!b))):s.arc(0,0,p,T,E,b)}if(s.closePath(),u)return s=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Os/2;return[go(d)*u,Qr(d)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:mt(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:mt(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:mt(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:mt(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:mt(+u),c):i},c.endAngle=function(u){return arguments.length?(a=typeof u=="function"?u:mt(+u),c):a},c.padAngle=function(u){return arguments.length?(o=typeof u=="function"?u:mt(+u),c):o},c.context=function(u){return arguments.length?(s=u??null,c):s},c}var dpe=Array.prototype.slice;function vg(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function $8(e){this._context=e}$8.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Eg(e){return new $8(e)}function $2(e){return e[0]}function G2(e){return e[1]}function H2(e,t){var n=mt(!0),r=null,i=Eg,a=null,o=lh(s);e=typeof e=="function"?e:e===void 0?$2:mt(e),t=typeof t=="function"?t:t===void 0?G2:mt(t);function s(l){var c,u=(l=vg(l)).length,d,p=!1,h;for(r==null&&(a=i(h=o())),c=0;c<=u;++c)!(c<u&&n(d=l[c],c,l))===p&&((p=!p)?a.lineStart():a.lineEnd()),p&&a.point(+e(d,c,l),+t(d,c,l));if(h)return a=null,h+""||null}return s.x=function(l){return arguments.length?(e=typeof l=="function"?l:mt(+l),s):e},s.y=function(l){return arguments.length?(t=typeof l=="function"?l:mt(+l),s):t},s.defined=function(l){return arguments.length?(n=typeof l=="function"?l:mt(!!l),s):n},s.curve=function(l){return arguments.length?(i=l,r!=null&&(a=i(r)),s):i},s.context=function(l){return arguments.length?(l==null?r=a=null:a=i(r=l),s):r},s}function G8(e,t,n){var r=null,i=mt(!0),a=null,o=Eg,s=null,l=lh(c);e=typeof e=="function"?e:e===void 0?$2:mt(+e),t=typeof t=="function"?t:mt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?G2:mt(+n);function c(d){var p,h,m,f=(d=vg(d)).length,_,b=!1,y,v=new Array(f),E=new Array(f);for(a==null&&(s=o(y=l())),p=0;p<=f;++p){if(!(p<f&&i(_=d[p],p,d))===b)if(b=!b)h=p,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),m=p-1;m>=h;--m)s.point(v[m],E[m]);s.lineEnd(),s.areaEnd()}b&&(v[p]=+e(_,p,d),E[p]=+t(_,p,d),s.point(r?+r(_,p,d):v[p],n?+n(_,p,d):E[p]))}if(y)return s=null,y+""||null}function u(){return H2().defined(i).curve(o).context(a)}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:mt(+d),r=null,c):e},c.x0=function(d){return arguments.length?(e=typeof d=="function"?d:mt(+d),c):e},c.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:mt(+d),c):r},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:mt(+d),n=null,c):t},c.y0=function(d){return arguments.length?(t=typeof d=="function"?d:mt(+d),c):t},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:mt(+d),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(d){return arguments.length?(i=typeof d=="function"?d:mt(!!d),c):i},c.curve=function(d){return arguments.length?(o=d,a!=null&&(s=o(a)),c):o},c.context=function(d){return arguments.length?(d==null?a=s=null:s=o(a=d),c):a},c}function ppe(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function hpe(e){return e}function mpe(){var e=hpe,t=ppe,n=null,r=mt(0),i=mt(Ms),a=mt(0);function o(s){var l,c=(s=vg(s)).length,u,d,p=0,h=new Array(c),m=new Array(c),f=+r.apply(this,arguments),_=Math.min(Ms,Math.max(-Ms,i.apply(this,arguments)-f)),b,y=Math.min(Math.abs(_)/c,a.apply(this,arguments)),v=y*(_<0?-1:1),E;for(l=0;l<c;++l)(E=m[h[l]=l]=+e(s[l],l,s))>0&&(p+=E);for(t!=null?h.sort(function(T,S){return t(m[T],m[S])}):n!=null&&h.sort(function(T,S){return n(s[T],s[S])}),l=0,d=p?(_-c*v)/p:0;l<c;++l,f=b)u=h[l],E=m[u],b=f+(E>0?E*d:0)+v,m[u]={data:s[u],index:l,value:E,startAngle:f,endAngle:b,padAngle:y};return m}return o.value=function(s){return arguments.length?(e=typeof s=="function"?s:mt(+s),o):e},o.sortValues=function(s){return arguments.length?(t=s,n=null,o):t},o.sort=function(s){return arguments.length?(n=s,t=null,o):n},o.startAngle=function(s){return arguments.length?(r=typeof s=="function"?s:mt(+s),o):r},o.endAngle=function(s){return arguments.length?(i=typeof s=="function"?s:mt(+s),o):i},o.padAngle=function(s){return arguments.length?(a=typeof s=="function"?s:mt(+s),o):a},o}var H8=q2(Eg);function q8(e){this._curve=e}q8.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function q2(e){function t(n){return new q8(e(n))}return t._curve=e,t}function ch(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(n){return arguments.length?t(q2(n)):t()._curve},e}function W8(){return ch(H2().curve(H8))}function V8(){var e=G8().curve(H8),t=e.curve,n=e.lineX0,r=e.lineX1,i=e.lineY0,a=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return ch(n())},delete e.lineX0,e.lineEndAngle=function(){return ch(r())},delete e.lineX1,e.lineInnerRadius=function(){return ch(i())},delete e.lineY0,e.lineOuterRadius=function(){return ch(a())},delete e.lineY1,e.curve=function(o){return arguments.length?t(q2(o)):t()._curve},e}function uh(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}class Y8{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}class fpe{constructor(t){this._context=t}lineStart(){this._point=0}lineEnd(){}point(t,n){if(t=+t,n=+n,this._point===0)this._point=1;else{const r=uh(this._x0,this._y0),i=uh(this._x0,this._y0=(this._y0+n)/2),a=uh(t,this._y0),o=uh(t,n);this._context.moveTo(...r),this._context.bezierCurveTo(...i,...a,...o)}this._x0=t,this._y0=n}}function K8(e){return new Y8(e,!0)}function Q8(e){return new Y8(e,!1)}function gpe(e){return new fpe(e)}function _pe(e){return e.source}function bpe(e){return e.target}function xg(e){let t=_pe,n=bpe,r=$2,i=G2,a=null,o=null,s=lh(l);function l(){let c;const u=dpe.call(arguments),d=t.apply(this,u),p=n.apply(this,u);if(a==null&&(o=e(c=s())),o.lineStart(),u[0]=d,o.point(+r.apply(this,u),+i.apply(this,u)),u[0]=p,o.point(+r.apply(this,u),+i.apply(this,u)),o.lineEnd(),c)return o=null,c+""||null}return l.source=function(c){return arguments.length?(t=c,l):t},l.target=function(c){return arguments.length?(n=c,l):n},l.x=function(c){return arguments.length?(r=typeof c=="function"?c:mt(+c),l):r},l.y=function(c){return arguments.length?(i=typeof c=="function"?c:mt(+c),l):i},l.context=function(c){return arguments.length?(c==null?a=o=null:o=e(a=c),l):a},l}function ype(){return xg(K8)}function vpe(){return xg(Q8)}function Epe(){const e=xg(gpe);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}const xpe=tn(3),X8={draw(e,t){const n=tn(t+Iu(t/28,.75))*.59436,r=n/2,i=r*xpe;e.moveTo(0,n),e.lineTo(0,-n),e.moveTo(-i,-r),e.lineTo(i,r),e.moveTo(-i,r),e.lineTo(i,-r)}},Sg={draw(e,t){const n=tn(t/Os);e.moveTo(n,0),e.arc(0,0,n,0,Ms)}},j8={draw(e,t){const n=tn(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},Z8=tn(1/3),Spe=Z8*2,J8={draw(e,t){const n=tn(t/Spe),r=n*Z8;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},eI={draw(e,t){const n=tn(t)*.62625;e.moveTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.lineTo(-n,0),e.closePath()}},tI={draw(e,t){const n=tn(t-Iu(t/7,2))*.87559;e.moveTo(-n,0),e.lineTo(n,0),e.moveTo(0,n),e.lineTo(0,-n)}},nI={draw(e,t){const n=tn(t),r=-n/2;e.rect(r,r,n,n)}},rI={draw(e,t){const n=tn(t)*.4431;e.moveTo(n,n),e.lineTo(n,-n),e.lineTo(-n,-n),e.lineTo(-n,n),e.closePath()}},Tpe=.8908130915292852,iI=Qr(Os/10)/Qr(7*Os/10),Cpe=Qr(Ms/10)*iI,wpe=-go(Ms/10)*iI,aI={draw(e,t){const n=tn(t*Tpe),r=Cpe*n,i=wpe*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=Ms*a/5,s=go(o),l=Qr(o);e.lineTo(l*n,-s*n),e.lineTo(s*r-l*i,l*r+s*i)}e.closePath()}},W2=tn(3),oI={draw(e,t){const n=-tn(t/(W2*3));e.moveTo(0,n*2),e.lineTo(-W2*n,-n),e.lineTo(W2*n,-n),e.closePath()}},Dpe=tn(3),sI={draw(e,t){const n=tn(t)*.6824,r=n/2,i=n*Dpe/2;e.moveTo(0,-n),e.lineTo(i,r),e.lineTo(-i,r),e.closePath()}},Ai=-.5,Ni=tn(3)/2,V2=1/tn(12),Ape=(V2/2+1)*3,lI={draw(e,t){const n=tn(t/Ape),r=n/2,i=n*V2,a=r,o=n*V2+n,s=-a,l=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,l),e.lineTo(Ai*r-Ni*i,Ni*r+Ai*i),e.lineTo(Ai*a-Ni*o,Ni*a+Ai*o),e.lineTo(Ai*s-Ni*l,Ni*s+Ai*l),e.lineTo(Ai*r+Ni*i,Ai*i-Ni*r),e.lineTo(Ai*a+Ni*o,Ai*o-Ni*a),e.lineTo(Ai*s+Ni*l,Ai*l-Ni*s),e.closePath()}},Y2={draw(e,t){const n=tn(t-Iu(t/6,1.7))*.6189;e.moveTo(-n,-n),e.lineTo(n,n),e.moveTo(-n,n),e.lineTo(n,-n)}},cI=[Sg,j8,J8,nI,aI,oI,lI],Npe=[Sg,tI,Y2,sI,X8,rI,eI];function kpe(e,t){let n=null,r=lh(i);e=typeof e=="function"?e:mt(e||Sg),t=typeof t=="function"?t:mt(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:mt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:mt(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function Is(){}function Tg(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Cg(e){this._context=e}Cg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Tg(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Tg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ope(e){return new Cg(e)}function uI(e){this._context=e}uI.prototype={areaStart:Is,areaEnd:Is,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Tg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Mpe(e){return new uI(e)}function dI(e){this._context=e}dI.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Tg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ipe(e){return new dI(e)}function pI(e,t){this._basis=new Cg(e),this._beta=t}pI.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],a=e[n]-r,o=t[n]-i,s=-1,l;++s<=n;)l=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+l*a),this._beta*t[s]+(1-this._beta)*(i+l*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const Rpe=function e(t){function n(r){return t===1?new Cg(r):new pI(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function wg(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function K2(e,t){this._context=e,this._k=(1-t)/6}K2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:wg(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:wg(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Lpe=function e(t){function n(r){return new K2(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Q2(e,t){this._context=e,this._k=(1-t)/6}Q2.prototype={areaStart:Is,areaEnd:Is,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:wg(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Ppe=function e(t){function n(r){return new Q2(r,t)}return n.tension=function(r){return e(+r)},n}(0);function X2(e,t){this._context=e,this._k=(1-t)/6}X2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:wg(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Bpe=function e(t){function n(r){return new X2(r,t)}return n.tension=function(r){return e(+r)},n}(0);function j2(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>hr){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>hr){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*c+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}function hI(e,t){this._context=e,this._alpha=t}hI.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:j2(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Fpe=function e(t){function n(r){return t?new hI(r,t):new K2(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function mI(e,t){this._context=e,this._alpha=t}mI.prototype={areaStart:Is,areaEnd:Is,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:j2(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const Upe=function e(t){function n(r){return t?new mI(r,t):new Q2(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function fI(e,t){this._context=e,this._alpha=t}fI.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:j2(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const zpe=function e(t){function n(r){return t?new fI(r,t):new X2(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function gI(e){this._context=e}gI.prototype={areaStart:Is,areaEnd:Is,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function $pe(e){return new gI(e)}function _I(e){return e<0?-1:1}function bI(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(_I(a)+_I(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function yI(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Z2(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function Dg(e){this._context=e}Dg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Z2(this,this._t0,yI(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Z2(this,yI(this,n=bI(this,e,t)),n);break;default:Z2(this,this._t0,n=bI(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function vI(e){this._context=new EI(e)}(vI.prototype=Object.create(Dg.prototype)).point=function(e,t){Dg.prototype.point.call(this,t,e)};function EI(e){this._context=e}EI.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Gpe(e){return new Dg(e)}function Hpe(e){return new vI(e)}function xI(e){this._context=e}xI.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=SI(e),i=SI(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function SI(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function qpe(e){return new xI(e)}function Ag(e,t){this._context=e,this._t=t}Ag.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function Wpe(e){return new Ag(e,.5)}function Vpe(e){return new Ag(e,0)}function Ype(e){return new Ag(e,1)}function Ru(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Lu(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Kpe(e,t){return e[t]}function Qpe(e){const t=[];return t.key=e,t}function Xpe(){var e=mt([]),t=Lu,n=Ru,r=Kpe;function i(a){var o=Array.from(e.apply(this,arguments),Qpe),s,l=o.length,c=-1,u;for(const d of a)for(s=0,++c;s<l;++s)(o[s][c]=[0,+r(d,o[s].key,c,a)]).data=d;for(s=0,u=vg(t(o));s<l;++s)o[u[s]].index=s;return n(o,u),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:mt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:mt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?Lu:typeof a=="function"?a:mt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??Ru,i):n},i}function jpe(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}Ru(e,t)}}function Zpe(e,t){if((l=e.length)>0)for(var n,r=0,i,a,o,s,l,c=e[t[0]].length;r<c;++r)for(o=s=0,n=0;n<l;++n)(a=(i=e[t[n]][r])[1]-i[0])>0?(i[0]=o,i[1]=o+=a):a<0?(i[1]=s,i[0]=s+=a):(i[0]=0,i[1]=a)}function Jpe(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}Ru(e,t)}}function ehe(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,l=0,c=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,p=u[r-1][1]||0,h=(d-p)/2,m=0;m<s;++m){var f=e[t[m]],_=f[r][1]||0,b=f[r-1][1]||0;h+=_-b}l+=d,c+=h*d}i[r-1][1]+=i[r-1][0]=n,l&&(n-=c/l)}i[r-1][1]+=i[r-1][0]=n,Ru(e,t)}}function TI(e){var t=e.map(the);return Lu(e).sort(function(n,r){return t[n]-t[r]})}function the(e){for(var t=-1,n=0,r=e.length,i,a=-1/0;++t<r;)(i=+e[t][1])>a&&(a=i,n=t);return n}function CI(e){var t=e.map(wI);return Lu(e).sort(function(n,r){return t[n]-t[r]})}function wI(e){for(var t=0,n=-1,r=e.length,i;++n<r;)(i=+e[n][1])&&(t+=i);return t}function nhe(e){return CI(e).reverse()}function rhe(e){var t=e.length,n,r,i=e.map(wI),a=TI(e),o=0,s=0,l=[],c=[];for(n=0;n<t;++n)r=a[n],o<s?(o+=i[r],l.push(r)):(s+=i[r],c.push(r));return c.reverse().concat(l)}function ihe(e){return Lu(e).reverse()}const Ng=Sa(Object.freeze(Object.defineProperty({__proto__:null,arc:upe,area:G8,areaRadial:V8,curveBasis:Ope,curveBasisClosed:Mpe,curveBasisOpen:Ipe,curveBumpX:K8,curveBumpY:Q8,curveBundle:Rpe,curveCardinal:Lpe,curveCardinalClosed:Ppe,curveCardinalOpen:Bpe,curveCatmullRom:Fpe,curveCatmullRomClosed:Upe,curveCatmullRomOpen:zpe,curveLinear:Eg,curveLinearClosed:$pe,curveMonotoneX:Gpe,curveMonotoneY:Hpe,curveNatural:qpe,curveStep:Wpe,curveStepAfter:Ype,curveStepBefore:Vpe,line:H2,lineRadial:W8,link:xg,linkHorizontal:ype,linkRadial:Epe,linkVertical:vpe,pie:mpe,pointRadial:uh,radialArea:V8,radialLine:W8,stack:Xpe,stackOffsetDiverging:Zpe,stackOffsetExpand:jpe,stackOffsetNone:Ru,stackOffsetSilhouette:Jpe,stackOffsetWiggle:ehe,stackOrderAppearance:TI,stackOrderAscending:CI,stackOrderDescending:nhe,stackOrderInsideOut:rhe,stackOrderNone:Lu,stackOrderReverse:ihe,symbol:kpe,symbolAsterisk:X8,symbolCircle:Sg,symbolCross:j8,symbolDiamond:J8,symbolDiamond2:eI,symbolPlus:tI,symbolSquare:nI,symbolSquare2:rI,symbolStar:aI,symbolTimes:Y2,symbolTriangle:oI,symbolTriangle2:sI,symbolWye:lI,symbolX:Y2,symbols:cI,symbolsFill:cI,symbolsStroke:Npe},Symbol.toStringTag,{value:"Module"})));function ahe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function kg(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Pu(e){return e=kg(Math.abs(e)),e?e[1]:NaN}function ohe(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),a.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function she(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var lhe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Bu(e){if(!(t=lhe.exec(e)))throw new Error("invalid format: "+e);var t;return new Og({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Bu.prototype=Og.prototype;function Og(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Og.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function che(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Mg;function uhe(e,t){var n=kg(e,t);if(!n)return Mg=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Mg=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+kg(e,Math.max(0,t+a-1))[0]}function DI(e,t){var n=kg(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const AI={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:ahe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>DI(e*100,t),r:DI,s:uhe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function NI(e){return e}var kI=Array.prototype.map,OI=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function MI(e){var t=e.grouping===void 0||e.thousands===void 0?NI:ohe(kI.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?NI:she(kI.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(d,p){d=Bu(d);var h=d.fill,m=d.align,f=d.sign,_=d.symbol,b=d.zero,y=d.width,v=d.comma,E=d.precision,T=d.trim,S=d.type;S==="n"?(v=!0,S="g"):AI[S]||(E===void 0&&(E=12),T=!0,S="g"),(b||h==="0"&&m==="=")&&(b=!0,h="0",m="=");var w=(p&&p.prefix!==void 0?p.prefix:"")+(_==="$"?n:_==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():""),M=(_==="$"?r:/[%p]/.test(S)?o:"")+(p&&p.suffix!==void 0?p.suffix:""),P=AI[S],z=/[defgprs%]/.test(S);E=E===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function ee(O){var H=w,x=M,G,D,A;if(S==="c")x=P(O)+x,O="";else{O=+O;var I=O<0||1/O<0;if(O=isNaN(O)?l:P(Math.abs(O),E),T&&(O=che(O)),I&&+O==0&&f!=="+"&&(I=!1),H=(I?f==="("?f:s:f==="-"||f==="("?"":f)+H,x=(S==="s"&&!isNaN(O)&&Mg!==void 0?OI[8+Mg/3]:"")+x+(I&&f==="("?")":""),z){for(G=-1,D=O.length;++G<D;)if(A=O.charCodeAt(G),48>A||A>57){x=(A===46?i+O.slice(G+1):O.slice(G))+x,O=O.slice(0,G);break}}}v&&!b&&(O=t(O,1/0));var B=H.length+O.length+x.length,$=B<y?new Array(y-B+1).join(h):"";switch(v&&b&&(O=t($+O,$.length?y-x.length:1/0),$=""),m){case"<":O=H+O+x+$;break;case"=":O=H+$+O+x;break;case"^":O=$.slice(0,B=$.length>>1)+H+O+x+$.slice(B);break;default:O=$+H+O+x;break}return a(O)}return ee.toString=function(){return d+""},ee}function u(d,p){var h=Math.max(-8,Math.min(8,Math.floor(Pu(p)/3)))*3,m=Math.pow(10,-h),f=c((d=Bu(d),d.type="f",d),{suffix:OI[8+h/3]});return function(_){return f(m*_)}}return{format:c,formatPrefix:u}}var Ig,Rg,J2;II({thousands:",",grouping:[3],currency:["$",""]});function II(e){return Ig=MI(e),Rg=Ig.format,J2=Ig.formatPrefix,Ig}function RI(e){return Math.max(0,-Pu(Math.abs(e)))}function LI(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Pu(t)/3)))*3-Pu(Math.abs(e)))}function PI(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Pu(t)-Pu(e))+1}const dhe=Sa(Object.freeze(Object.defineProperty({__proto__:null,FormatSpecifier:Og,get format(){return Rg},formatDefaultLocale:II,formatLocale:MI,get formatPrefix(){return J2},formatSpecifier:Bu,precisionFixed:RI,precisionPrefix:LI,precisionRound:PI},Symbol.toStringTag,{value:"Module"})));function Rs(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function phe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function eS(e){let t,n,r;e.length!==2?(t=Rs,n=(s,l)=>Rs(e(s),l),r=(s,l)=>e(s)-l):(t=e===Rs||e===phe?e:hhe,n=e,r=e);function i(s,l,c=0,u=s.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(s[d],l)<0?c=d+1:u=d}while(c<u)}return c}function a(s,l,c=0,u=s.length){if(c<u){if(t(l,l)!==0)return u;do{const d=c+u>>>1;n(s[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function o(s,l,c=0,u=s.length){const d=i(s,l,c,u-1);return d>c&&r(s[d-1],l)>-r(s[d],l)?d-1:d}return{left:i,center:o,right:a}}function hhe(){return 0}function BI(e){return e===null?NaN:+e}function*mhe(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const dh=eS(Rs).right;eS(BI).center;class FI extends Map{constructor(t,n=_he){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(UI(this,t))}has(t){return super.has(UI(this,t))}set(t,n){return super.set(fhe(this,t),n)}delete(t){return super.delete(ghe(this,t))}}function UI({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function fhe({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function ghe({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function _he(e){return e!==null&&typeof e=="object"?e.valueOf():e}function bhe(e=Rs){if(e===Rs)return zI;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function zI(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const yhe=Math.sqrt(50),vhe=Math.sqrt(10),Ehe=Math.sqrt(2);function Lg(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=yhe?10:a>=vhe?5:a>=Ehe?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/o,s=Math.round(e*c),l=Math.round(t*c),s/c<e&&++s,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*o,s=Math.round(e/c),l=Math.round(t/c),s*c<e&&++s,l*c>t&&--l),l<s&&.5<=n&&n<2?Lg(e,t,n*2):[s,l,c]}function tS(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,o]=r?Lg(t,e,n):Lg(e,t,n);if(!(a>=i))return[];const s=a-i+1,l=new Array(s);if(r)if(o<0)for(let c=0;c<s;++c)l[c]=(a-c)/-o;else for(let c=0;c<s;++c)l[c]=(a-c)*o;else if(o<0)for(let c=0;c<s;++c)l[c]=(i+c)/-o;else for(let c=0;c<s;++c)l[c]=(i+c)*o;return l}function nS(e,t,n){return t=+t,e=+e,n=+n,Lg(e,t,n)[2]}function rS(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?nS(t,e,n):nS(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function $I(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function GI(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function HI(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?zI:bhe(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),d=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*d*(l-d)/l)*(c-l/2<0?-1:1),h=Math.max(n,Math.floor(t-c*d/l+p)),m=Math.min(r,Math.floor(t+(l-c)*d/l+p));HI(e,t,h,m,i)}const a=e[t];let o=n,s=r;for(ph(e,n,t),i(e[r],a)>0&&ph(e,n,r);o<s;){for(ph(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?ph(e,n,s):(++s,ph(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function ph(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function xhe(e,t,n){if(e=Float64Array.from(mhe(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return GI(e);if(t>=1)return $I(e);var r,i=(r-1)*t,a=Math.floor(i),o=$I(HI(e,a).subarray(0,a+1)),s=GI(e.subarray(a+1));return o+(s-o)*(i-a)}}function She(e,t,n=BI){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e),s=+n(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function The(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function ki(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function _o(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const iS=Symbol("implicit");function aS(){var e=new FI,t=[],n=[],r=iS;function i(a){let o=e.get(a);if(o===void 0){if(r!==iS)return r;e.set(a,o=t.push(a)-1)}return n[o%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new FI;for(const o of a)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return aS(t,n).unknown(r)},ki.apply(i,arguments),i}function oS(){var e=aS().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,l=0,c=0,u=.5;delete e.unknown;function d(){var p=t().length,h=i<r,m=h?i:r,f=h?r:i;a=(f-m)/Math.max(1,p-l+c*2),s&&(a=Math.floor(a)),m+=(f-m-a*(p-l))*u,o=a*(1-l),s&&(m=Math.round(m),o=Math.round(o));var _=The(p).map(function(b){return m+a*b});return n(h?_.reverse():_)}return e.domain=function(p){return arguments.length?(t(p),d()):t()},e.range=function(p){return arguments.length?([r,i]=p,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(p){return[r,i]=p,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(p){return arguments.length?(s=!!p,d()):s},e.padding=function(p){return arguments.length?(l=Math.min(1,c=+p),d()):l},e.paddingInner=function(p){return arguments.length?(l=Math.min(1,p),d()):l},e.paddingOuter=function(p){return arguments.length?(c=+p,d()):c},e.align=function(p){return arguments.length?(u=Math.max(0,Math.min(1,p)),d()):u},e.copy=function(){return oS(t(),[r,i]).round(s).paddingInner(l).paddingOuter(c).align(u)},ki.apply(d(),arguments)}function qI(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return qI(t())},e}function Che(){return qI(oS.apply(null,arguments).paddingInner(1))}function Fu(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function hh(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ls(){}var tc=.7,Uu=1/tc,zu="\\s*([+-]?\\d+)\\s*",mh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ka="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",whe=/^#([0-9a-f]{3,8})$/,Dhe=new RegExp(`^rgb\\(${zu},${zu},${zu}\\)$`),Ahe=new RegExp(`^rgb\\(${ka},${ka},${ka}\\)$`),Nhe=new RegExp(`^rgba\\(${zu},${zu},${zu},${mh}\\)$`),khe=new RegExp(`^rgba\\(${ka},${ka},${ka},${mh}\\)$`),Ohe=new RegExp(`^hsl\\(${mh},${ka},${ka}\\)$`),Mhe=new RegExp(`^hsla\\(${mh},${ka},${ka},${mh}\\)$`),WI={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Fu(Ls,Ps,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:VI,formatHex:VI,formatHex8:Ihe,formatHsl:Rhe,formatRgb:YI,toString:YI});function VI(){return this.rgb().formatHex()}function Ihe(){return this.rgb().formatHex8()}function Rhe(){return ZI(this).formatHsl()}function YI(){return this.rgb().formatRgb()}function Ps(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=whe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?KI(t):n===3?new $n(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Pg(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Pg(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Dhe.exec(e))?new $n(t[1],t[2],t[3],1):(t=Ahe.exec(e))?new $n(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Nhe.exec(e))?Pg(t[1],t[2],t[3],t[4]):(t=khe.exec(e))?Pg(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ohe.exec(e))?jI(t[1],t[2]/100,t[3]/100,1):(t=Mhe.exec(e))?jI(t[1],t[2]/100,t[3]/100,t[4]):WI.hasOwnProperty(e)?KI(WI[e]):e==="transparent"?new $n(NaN,NaN,NaN,0):null}function KI(e){return new $n(e>>16&255,e>>8&255,e&255,1)}function Pg(e,t,n,r){return r<=0&&(e=t=n=NaN),new $n(e,t,n,r)}function sS(e){return e instanceof Ls||(e=Ps(e)),e?(e=e.rgb(),new $n(e.r,e.g,e.b,e.opacity)):new $n}function fh(e,t,n,r){return arguments.length===1?sS(e):new $n(e,t,n,r??1)}function $n(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Fu($n,fh,hh(Ls,{brighter(e){return e=e==null?Uu:Math.pow(Uu,e),new $n(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?tc:Math.pow(tc,e),new $n(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new $n(nc(this.r),nc(this.g),nc(this.b),Bg(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:QI,formatHex:QI,formatHex8:Lhe,formatRgb:XI,toString:XI}));function QI(){return`#${rc(this.r)}${rc(this.g)}${rc(this.b)}`}function Lhe(){return`#${rc(this.r)}${rc(this.g)}${rc(this.b)}${rc((isNaN(this.opacity)?1:this.opacity)*255)}`}function XI(){const e=Bg(this.opacity);return`${e===1?"rgb(":"rgba("}${nc(this.r)}, ${nc(this.g)}, ${nc(this.b)}${e===1?")":`, ${e})`}`}function Bg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function nc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rc(e){return e=nc(e),(e<16?"0":"")+e.toString(16)}function jI(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Zi(e,t,n,r)}function ZI(e){if(e instanceof Zi)return new Zi(e.h,e.s,e.l,e.opacity);if(e instanceof Ls||(e=Ps(e)),!e)return new Zi;if(e instanceof Zi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,l=(a+i)/2;return s?(t===a?o=(n-r)/s+(n<r)*6:n===a?o=(r-t)/s+2:o=(t-n)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=l>0&&l<1?0:o,new Zi(o,s,l,e.opacity)}function Fg(e,t,n,r){return arguments.length===1?ZI(e):new Zi(e,t,n,r??1)}function Zi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Fu(Zi,Fg,hh(Ls,{brighter(e){return e=e==null?Uu:Math.pow(Uu,e),new Zi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?tc:Math.pow(tc,e),new Zi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new $n(lS(e>=240?e-240:e+120,i,r),lS(e,i,r),lS(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Zi(JI(this.h),Ug(this.s),Ug(this.l),Bg(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Bg(this.opacity);return`${e===1?"hsl(":"hsla("}${JI(this.h)}, ${Ug(this.s)*100}%, ${Ug(this.l)*100}%${e===1?")":`, ${e})`}`}}));function JI(e){return e=(e||0)%360,e<0?e+360:e}function Ug(e){return Math.max(0,Math.min(1,e||0))}function lS(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const e7=Math.PI/180,t7=180/Math.PI,zg=18,n7=.96422,r7=1,i7=.82521,a7=4/29,$u=6/29,o7=3*$u*$u,Phe=$u*$u*$u;function s7(e){if(e instanceof Ji)return new Ji(e.l,e.a,e.b,e.opacity);if(e instanceof Oa)return c7(e);e instanceof $n||(e=sS(e));var t=pS(e.r),n=pS(e.g),r=pS(e.b),i=cS((.2225045*t+.7168786*n+.0606169*r)/r7),a,o;return t===n&&n===r?a=o=i:(a=cS((.4360747*t+.3850649*n+.1430804*r)/n7),o=cS((.0139322*t+.0971045*n+.7141733*r)/i7)),new Ji(116*i-16,500*(a-i),200*(i-o),e.opacity)}function Bhe(e,t){return new Ji(e,0,0,t??1)}function $g(e,t,n,r){return arguments.length===1?s7(e):new Ji(e,t,n,r??1)}function Ji(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}Fu(Ji,$g,hh(Ls,{brighter(e){return new Ji(this.l+zg*(e??1),this.a,this.b,this.opacity)},darker(e){return new Ji(this.l-zg*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=n7*uS(t),e=r7*uS(e),n=i7*uS(n),new $n(dS(3.1338561*t-1.6168667*e-.4906146*n),dS(-.9787684*t+1.9161415*e+.033454*n),dS(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function cS(e){return e>Phe?Math.pow(e,1/3):e/o7+a7}function uS(e){return e>$u?e*e*e:o7*(e-a7)}function dS(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function pS(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function l7(e){if(e instanceof Oa)return new Oa(e.h,e.c,e.l,e.opacity);if(e instanceof Ji||(e=s7(e)),e.a===0&&e.b===0)return new Oa(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*t7;return new Oa(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Fhe(e,t,n,r){return arguments.length===1?l7(e):new Oa(n,t,e,r??1)}function Gg(e,t,n,r){return arguments.length===1?l7(e):new Oa(e,t,n,r??1)}function Oa(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function c7(e){if(isNaN(e.h))return new Ji(e.l,0,0,e.opacity);var t=e.h*e7;return new Ji(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Fu(Oa,Gg,hh(Ls,{brighter(e){return new Oa(this.h,this.c,this.l+zg*(e??1),this.opacity)},darker(e){return new Oa(this.h,this.c,this.l-zg*(e??1),this.opacity)},rgb(){return c7(this).rgb()}}));var u7=-.14861,hS=1.78277,mS=-.29227,Hg=-.90649,gh=1.97294,d7=gh*Hg,p7=gh*hS,h7=hS*mS-Hg*u7;function Uhe(e){if(e instanceof ic)return new ic(e.h,e.s,e.l,e.opacity);e instanceof $n||(e=sS(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(h7*r+d7*t-p7*n)/(h7+d7-p7),a=r-i,o=(gh*(n-i)-mS*a)/Hg,s=Math.sqrt(o*o+a*a)/(gh*i*(1-i)),l=s?Math.atan2(o,a)*t7-120:NaN;return new ic(l<0?l+360:l,s,i,e.opacity)}function qg(e,t,n,r){return arguments.length===1?Uhe(e):new ic(e,t,n,r??1)}function ic(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Fu(ic,qg,hh(Ls,{brighter(e){return e=e==null?Uu:Math.pow(Uu,e),new ic(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?tc:Math.pow(tc,e),new ic(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*e7,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new $n(255*(t+n*(u7*r+hS*i)),255*(t+n*(mS*r+Hg*i)),255*(t+n*(gh*r)),this.opacity)}}));const zhe=Object.freeze(Object.defineProperty({__proto__:null,color:Ps,cubehelix:qg,gray:Bhe,hcl:Gg,hsl:Fg,lab:$g,lch:Fhe,rgb:fh},Symbol.toStringTag,{value:"Module"}));function m7(e,t,n,r,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*n+(1+3*e+3*a-3*o)*r+o*i)/6}function f7(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),i=e[r],a=e[r+1],o=r>0?e[r-1]:2*i-a,s=r<t-1?e[r+2]:2*a-i;return m7((n-r/t)*t,o,i,a,s)}}function g7(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),i=e[(r+t-1)%t],a=e[r%t],o=e[(r+1)%t],s=e[(r+2)%t];return m7((n-r/t)*t,i,a,o,s)}}const Wg=e=>()=>e;function _7(e,t){return function(n){return e+n*t}}function $he(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Vg(e,t){var n=t-e;return n?_7(e,n>180||n<-180?n-360*Math.round(n/360):n):Wg(isNaN(e)?t:e)}function Ghe(e){return(e=+e)==1?Gn:function(t,n){return n-t?$he(t,n,e):Wg(isNaN(t)?n:t)}}function Gn(e,t){var n=t-e;return n?_7(e,n):Wg(isNaN(e)?t:e)}const _h=function e(t){var n=Ghe(t);function r(i,a){var o=n((i=fh(i)).r,(a=fh(a)).r),s=n(i.g,a.g),l=n(i.b,a.b),c=Gn(i.opacity,a.opacity);return function(u){return i.r=o(u),i.g=s(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=e,r}(1);function b7(e){return function(t){var n=t.length,r=new Array(n),i=new Array(n),a=new Array(n),o,s;for(o=0;o<n;++o)s=fh(t[o]),r[o]=s.r||0,i[o]=s.g||0,a[o]=s.b||0;return r=e(r),i=e(i),a=e(a),s.opacity=1,function(l){return s.r=r(l),s.g=i(l),s.b=a(l),s+""}}}var Hhe=b7(f7),qhe=b7(g7);function fS(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function y7(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Whe(e,t){return(y7(t)?fS:v7)(e,t)}function v7(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=ac(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(s){for(o=0;o<r;++o)a[o]=i[o](s);return a}}function E7(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Oi(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function x7(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=ac(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var gS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_S=new RegExp(gS.source,"g");function Vhe(e){return function(){return e}}function Yhe(e){return function(t){return e(t)+""}}function bS(e,t){var n=gS.lastIndex=_S.lastIndex=0,r,i,a,o=-1,s=[],l=[];for(e=e+"",t=t+"";(r=gS.exec(e))&&(i=_S.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:Oi(r,i)})),n=_S.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?l[0]?Yhe(l[0].x):Vhe(t):(t=l.length,function(c){for(var u=0,d;u<t;++u)s[(d=l[u]).i]=d.x(c);return s.join("")})}function ac(e,t){var n=typeof t,r;return t==null||n==="boolean"?Wg(t):(n==="number"?Oi:n==="string"?(r=Ps(t))?(t=r,_h):bS:t instanceof Ps?_h:t instanceof Date?E7:y7(t)?fS:Array.isArray(t)?v7:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?x7:Oi)(e,t)}function Khe(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function Qhe(e,t){var n=Vg(+e,+t);return function(r){var i=n(r);return i-360*Math.floor(i/360)}}function Yg(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var S7=180/Math.PI,yS={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function T7(e,t,n,r,i,a){var o,s,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*S7,skewX:Math.atan(l)*S7,scaleX:o,scaleY:s}}var Kg;function Xhe(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?yS:T7(t.a,t.b,t.c,t.d,t.e,t.f)}function jhe(e){return e==null||(Kg||(Kg=document.createElementNS("http://www.w3.org/2000/svg","g")),Kg.setAttribute("transform",e),!(e=Kg.transform.baseVal.consolidate()))?yS:(e=e.matrix,T7(e.a,e.b,e.c,e.d,e.e,e.f))}function C7(e,t,n,r){function i(c){return c.length?c.pop()+" ":""}function a(c,u,d,p,h,m){if(c!==d||u!==p){var f=h.push("translate(",null,t,null,n);m.push({i:f-4,x:Oi(c,d)},{i:f-2,x:Oi(u,p)})}else(d||p)&&h.push("translate("+d+t+p+n)}function o(c,u,d,p){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),p.push({i:d.push(i(d)+"rotate(",null,r)-2,x:Oi(c,u)})):u&&d.push(i(d)+"rotate("+u+r)}function s(c,u,d,p){c!==u?p.push({i:d.push(i(d)+"skewX(",null,r)-2,x:Oi(c,u)}):u&&d.push(i(d)+"skewX("+u+r)}function l(c,u,d,p,h,m){if(c!==d||u!==p){var f=h.push(i(h)+"scale(",null,",",null,")");m.push({i:f-4,x:Oi(c,d)},{i:f-2,x:Oi(u,p)})}else(d!==1||p!==1)&&h.push(i(h)+"scale("+d+","+p+")")}return function(c,u){var d=[],p=[];return c=e(c),u=e(u),a(c.translateX,c.translateY,u.translateX,u.translateY,d,p),o(c.rotate,u.rotate,d,p),s(c.skewX,u.skewX,d,p),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,p),c=u=null,function(h){for(var m=-1,f=p.length,_;++m<f;)d[(_=p[m]).i]=_.x(h);return d.join("")}}}var w7=C7(Xhe,"px, ","px)","deg)"),D7=C7(jhe,", ",")",")"),Zhe=1e-12;function A7(e){return((e=Math.exp(e))+1/e)/2}function Jhe(e){return((e=Math.exp(e))-1/e)/2}function eme(e){return((e=Math.exp(2*e))-1)/(e+1)}const N7=function e(t,n,r){function i(a,o){var s=a[0],l=a[1],c=a[2],u=o[0],d=o[1],p=o[2],h=u-s,m=d-l,f=h*h+m*m,_,b;if(f<Zhe)b=Math.log(p/c)/t,_=function(w){return[s+w*h,l+w*m,c*Math.exp(t*w*b)]};else{var y=Math.sqrt(f),v=(p*p-c*c+r*f)/(2*c*n*y),E=(p*p-c*c-r*f)/(2*p*n*y),T=Math.log(Math.sqrt(v*v+1)-v),S=Math.log(Math.sqrt(E*E+1)-E);b=(S-T)/t,_=function(w){var M=w*b,P=A7(T),z=c/(n*y)*(P*eme(t*M+T)-Jhe(T));return[s+z*h,l+z*m,c*P/A7(t*M+T)]}}return _.duration=b*1e3*t/Math.SQRT2,_}return i.rho=function(a){var o=Math.max(.001,+a),s=o*o,l=s*s;return e(o,s,l)},i}(Math.SQRT2,2,4);function k7(e){return function(t,n){var r=e((t=Fg(t)).h,(n=Fg(n)).h),i=Gn(t.s,n.s),a=Gn(t.l,n.l),o=Gn(t.opacity,n.opacity);return function(s){return t.h=r(s),t.s=i(s),t.l=a(s),t.opacity=o(s),t+""}}}const tme=k7(Vg);var nme=k7(Gn);function rme(e,t){var n=Gn((e=$g(e)).l,(t=$g(t)).l),r=Gn(e.a,t.a),i=Gn(e.b,t.b),a=Gn(e.opacity,t.opacity);return function(o){return e.l=n(o),e.a=r(o),e.b=i(o),e.opacity=a(o),e+""}}function O7(e){return function(t,n){var r=e((t=Gg(t)).h,(n=Gg(n)).h),i=Gn(t.c,n.c),a=Gn(t.l,n.l),o=Gn(t.opacity,n.opacity);return function(s){return t.h=r(s),t.c=i(s),t.l=a(s),t.opacity=o(s),t+""}}}const ime=O7(Vg);var ame=O7(Gn);function M7(e){return function t(n){n=+n;function r(i,a){var o=e((i=qg(i)).h,(a=qg(a)).h),s=Gn(i.s,a.s),l=Gn(i.l,a.l),c=Gn(i.opacity,a.opacity);return function(u){return i.h=o(u),i.s=s(u),i.l=l(Math.pow(u,n)),i.opacity=c(u),i+""}}return r.gamma=t,r}(1)}const ome=M7(Vg);var sme=M7(Gn);function I7(e,t){t===void 0&&(t=e,e=ac);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(o){var s=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[s](o-s)}}function lme(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}const cme=Object.freeze(Object.defineProperty({__proto__:null,interpolate:ac,interpolateArray:Whe,interpolateBasis:f7,interpolateBasisClosed:g7,interpolateCubehelix:ome,interpolateCubehelixLong:sme,interpolateDate:E7,interpolateDiscrete:Khe,interpolateHcl:ime,interpolateHclLong:ame,interpolateHsl:tme,interpolateHslLong:nme,interpolateHue:Qhe,interpolateLab:rme,interpolateNumber:Oi,interpolateNumberArray:fS,interpolateObject:x7,interpolateRgb:_h,interpolateRgbBasis:Hhe,interpolateRgbBasisClosed:qhe,interpolateRound:Yg,interpolateString:bS,interpolateTransformCss:w7,interpolateTransformSvg:D7,interpolateZoom:N7,piecewise:I7,quantize:lme},Symbol.toStringTag,{value:"Module"}));function ume(e){return function(){return e}}function Qg(e){return+e}var R7=[0,1];function Lr(e){return e}function vS(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:ume(isNaN(t)?NaN:.5)}function dme(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function pme(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=vS(i,r),a=n(o,a)):(r=vS(r,i),a=n(a,o)),function(s){return a(r(s))}}function hme(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=vS(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(s){var l=dh(e,s,1,r)-1;return a[l](i[l](s))}}function bh(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Xg(){var e=R7,t=R7,n=ac,r,i,a,o=Lr,s,l,c;function u(){var p=Math.min(e.length,t.length);return o!==Lr&&(o=dme(e[0],e[p-1])),s=p>2?hme:pme,l=c=null,d}function d(p){return p==null||isNaN(p=+p)?a:(l||(l=s(e.map(r),t,n)))(r(o(p)))}return d.invert=function(p){return o(i((c||(c=s(t,e.map(r),Oi)))(p)))},d.domain=function(p){return arguments.length?(e=Array.from(p,Qg),u()):e.slice()},d.range=function(p){return arguments.length?(t=Array.from(p),u()):t.slice()},d.rangeRound=function(p){return t=Array.from(p),n=Yg,u()},d.clamp=function(p){return arguments.length?(o=p?!0:Lr,u()):o!==Lr},d.interpolate=function(p){return arguments.length?(n=p,u()):n},d.unknown=function(p){return arguments.length?(a=p,d):a},function(p,h){return r=p,i=h,u()}}function ES(){return Xg()(Lr,Lr)}function L7(e,t,n,r){var i=rS(e,t,n),a;switch(r=Bu(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=LI(i,o))&&(r.precision=a),J2(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=PI(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=RI(i))&&(r.precision=a-(r.type==="%")*2);break}}return Rg(r)}function Bs(e){var t=e.domain;return e.ticks=function(n){var r=t();return tS(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return L7(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],l,c,u=10;for(s<o&&(c=o,o=s,s=c,c=i,i=a,a=c);u-- >0;){if(c=nS(o,s,n),c===l)return r[i]=o,r[a]=s,t(r);if(c>0)o=Math.floor(o/c)*c,s=Math.ceil(s/c)*c;else if(c<0)o=Math.ceil(o*c)/c,s=Math.floor(s*c)/c;else break;l=c}return e},e}function P7(){var e=ES();return e.copy=function(){return bh(e,P7())},ki.apply(e,arguments),Bs(e)}function B7(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Qg),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return B7(e).unknown(t)},e=arguments.length?Array.from(e,Qg):[0,1],Bs(n)}function F7(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function U7(e){return Math.log(e)}function z7(e){return Math.exp(e)}function mme(e){return-Math.log(-e)}function fme(e){return-Math.exp(-e)}function gme(e){return isFinite(e)?+("1e"+e):e<0?0:e}function _me(e){return e===10?gme:e===Math.E?Math.exp:t=>Math.pow(e,t)}function bme(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function $7(e){return(t,n)=>-e(-t,n)}function xS(e){const t=e(U7,z7),n=t.domain;let r=10,i,a;function o(){return i=bme(r),a=_me(r),n()[0]<0?(i=$7(i),a=$7(a),e(mme,fme)):e(U7,z7),t}return t.base=function(s){return arguments.length?(r=+s,o()):r},t.domain=function(s){return arguments.length?(n(s),o()):n()},t.ticks=s=>{const l=n();let c=l[0],u=l[l.length-1];const d=u<c;d&&([c,u]=[u,c]);let p=i(c),h=i(u),m,f;const _=s==null?10:+s;let b=[];if(!(r%1)&&h-p<_){if(p=Math.floor(p),h=Math.ceil(h),c>0){for(;p<=h;++p)for(m=1;m<r;++m)if(f=p<0?m/a(-p):m*a(p),!(f<c)){if(f>u)break;b.push(f)}}else for(;p<=h;++p)for(m=r-1;m>=1;--m)if(f=p>0?m/a(-p):m*a(p),!(f<c)){if(f>u)break;b.push(f)}b.length*2<_&&(b=tS(c,u,_))}else b=tS(p,h,Math.min(h-p,_)).map(a);return d?b.reverse():b},t.tickFormat=(s,l)=>{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Bu(l)).precision==null&&(l.trim=!0),l=Rg(l)),s===1/0)return l;const c=Math.max(1,r*s/t.ticks().length);return u=>{let d=u/a(Math.round(i(u)));return d*r<r-.5&&(d*=r),d<=c?l(u):""}},t.nice=()=>n(F7(n(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function G7(){const e=xS(Xg()).domain([1,10]);return e.copy=()=>bh(e,G7()).base(e.base()),ki.apply(e,arguments),e}function H7(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function q7(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function SS(e){var t=1,n=e(H7(t),q7(t));return n.constant=function(r){return arguments.length?e(H7(t=+r),q7(t)):t},Bs(n)}function W7(){var e=SS(Xg());return e.copy=function(){return bh(e,W7()).constant(e.constant())},ki.apply(e,arguments)}function V7(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function yme(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function vme(e){return e<0?-e*e:e*e}function TS(e){var t=e(Lr,Lr),n=1;function r(){return n===1?e(Lr,Lr):n===.5?e(yme,vme):e(V7(n),V7(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Bs(t)}function CS(){var e=TS(Xg());return e.copy=function(){return bh(e,CS()).exponent(e.exponent())},ki.apply(e,arguments),e}function Eme(){return CS.apply(null,arguments).exponent(.5)}function Y7(e){return Math.sign(e)*e*e}function xme(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function K7(){var e=ES(),t=[0,1],n=!1,r;function i(a){var o=xme(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(Y7(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,Qg)).map(Y7)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return K7(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},ki.apply(i,arguments),Bs(i)}function Q7(){var e=[],t=[],n=[],r;function i(){var o=0,s=Math.max(1,t.length);for(n=new Array(s-1);++o<s;)n[o-1]=She(e,o/s);return a}function a(o){return o==null||isNaN(o=+o)?r:t[dh(n,o)]}return a.invertExtent=function(o){var s=t.indexOf(o);return s<0?[NaN,NaN]:[s>0?n[s-1]:e[0],s<n.length?n[s]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let s of o)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Rs),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return Q7().domain(e).range(t).unknown(r)},ki.apply(a,arguments)}function X7(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(l){return l!=null&&l<=l?i[dh(r,l,0,n)]:a}function s(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*t-(l-n)*e)/(n+1);return o}return o.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,s()):[e,t]},o.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,s()):i.slice()},o.invertExtent=function(l){var c=i.indexOf(l);return c<0?[NaN,NaN]:c<1?[e,r[0]]:c>=n?[r[n-1],t]:[r[c-1],r[c]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return r.slice()},o.copy=function(){return X7().domain([e,t]).range(i).unknown(a)},ki.apply(Bs(o),arguments)}function j7(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[dh(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return j7().domain(e).range(t).unknown(n)},ki.apply(i,arguments)}const wS=new Date,DS=new Date;function Mn(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o<s-a?o:s},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const l=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a<o)||!(s>0))return l;let c;do l.push(c=new Date(+a)),t(a,s),e(a);while(c<a&&a<o);return l},i.filter=a=>Mn(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),n&&(i.count=(a,o)=>(wS.setTime(+a),DS.setTime(+o),e(wS),e(DS),Math.floor(n(wS,DS))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?o=>r(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const jg=Mn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);jg.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Mn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):jg),jg.range;const bo=1e3,Mi=bo*60,yo=Mi*60,vo=yo*24,AS=vo*7,Z7=vo*30,NS=vo*365,oc=Mn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*bo)},(e,t)=>(t-e)/bo,e=>e.getUTCSeconds());oc.range;const kS=Mn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*bo)},(e,t)=>{e.setTime(+e+t*Mi)},(e,t)=>(t-e)/Mi,e=>e.getMinutes());kS.range;const OS=Mn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Mi)},(e,t)=>(t-e)/Mi,e=>e.getUTCMinutes());OS.range;const MS=Mn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*bo-e.getMinutes()*Mi)},(e,t)=>{e.setTime(+e+t*yo)},(e,t)=>(t-e)/yo,e=>e.getHours());MS.range;const IS=Mn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*yo)},(e,t)=>(t-e)/yo,e=>e.getUTCHours());IS.range;const yh=Mn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Mi)/vo,e=>e.getDate()-1);yh.range;const Zg=Mn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/vo,e=>e.getUTCDate()-1);Zg.range;const J7=Mn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/vo,e=>Math.floor(e/vo));J7.range;function sc(e){return Mn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Mi)/AS)}const Jg=sc(0),e_=sc(1),Sme=sc(2),Tme=sc(3),Gu=sc(4),Cme=sc(5),wme=sc(6);Jg.range,e_.range,Sme.range,Tme.range,Gu.range,Cme.range,wme.range;function lc(e){return Mn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/AS)}const t_=lc(0),n_=lc(1),Dme=lc(2),Ame=lc(3),Hu=lc(4),Nme=lc(5),kme=lc(6);t_.range,n_.range,Dme.range,Ame.range,Hu.range,Nme.range,kme.range;const RS=Mn(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());RS.range;const LS=Mn(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());LS.range;const Eo=Mn(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Eo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Mn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Eo.range;const xo=Mn(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());xo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Mn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),xo.range;function eR(e,t,n,r,i,a){const o=[[oc,1,bo],[oc,5,5*bo],[oc,15,15*bo],[oc,30,30*bo],[a,1,Mi],[a,5,5*Mi],[a,15,15*Mi],[a,30,30*Mi],[i,1,yo],[i,3,3*yo],[i,6,6*yo],[i,12,12*yo],[r,1,vo],[r,2,2*vo],[n,1,AS],[t,1,Z7],[t,3,3*Z7],[e,1,NS]];function s(c,u,d){const p=u<c;p&&([c,u]=[u,c]);const h=d&&typeof d.range=="function"?d:l(c,u,d),m=h?h.range(c,+u+1):[];return p?m.reverse():m}function l(c,u,d){const p=Math.abs(u-c)/d,h=eS(([,,_])=>_).right(o,p);if(h===o.length)return e.every(rS(c/NS,u/NS,d));if(h===0)return jg.every(Math.max(rS(c,u,d),1));const[m,f]=o[p/o[h-1][2]<o[h][2]/p?h-1:h];return m.every(f)}return[s,l]}const[Ome,Mme]=eR(xo,LS,t_,J7,IS,OS),[Ime,Rme]=eR(Eo,RS,Jg,yh,MS,kS);function PS(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function BS(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function vh(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Lme(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,l=e.shortMonths,c=Eh(i),u=xh(i),d=Eh(a),p=xh(a),h=Eh(o),m=xh(o),f=Eh(s),_=xh(s),b=Eh(l),y=xh(l),v={a:A,A:I,b:B,B:$,c:null,d:oR,e:oR,f:ife,g:mfe,G:gfe,H:tfe,I:nfe,j:rfe,L:sR,m:afe,M:ofe,p:R,q:L,Q:hR,s:mR,S:sfe,u:lfe,U:cfe,V:ufe,w:dfe,W:pfe,x:null,X:null,y:hfe,Y:ffe,Z:_fe,"%":pR},E={a:J,A:se,b:ne,B:ge,c:null,d:cR,e:cR,f:Efe,g:Ofe,G:Ife,H:bfe,I:yfe,j:vfe,L:uR,m:xfe,M:Sfe,p:Ne,q:Ae,Q:hR,s:mR,S:Tfe,u:Cfe,U:wfe,V:Dfe,w:Afe,W:Nfe,x:null,X:null,y:kfe,Y:Mfe,Z:Rfe,"%":pR},T={a:z,A:ee,b:O,B:H,c:x,d:iR,e:iR,f:jme,g:rR,G:nR,H:aR,I:aR,j:Yme,L:Xme,m:Vme,M:Kme,p:P,q:Wme,Q:Jme,s:efe,S:Qme,u:zme,U:$me,V:Gme,w:Ume,W:Hme,x:G,X:D,y:rR,Y:nR,Z:qme,"%":Zme};v.x=S(n,v),v.X=S(r,v),v.c=S(t,v),E.x=S(n,E),E.X=S(r,E),E.c=S(t,E);function S(be,Re){return function(we){var K=[],ye=-1,N=0,X=be.length,Y,q,U;for(we instanceof Date||(we=new Date(+we));++ye<X;)be.charCodeAt(ye)===37&&(K.push(be.slice(N,ye)),(q=tR[Y=be.charAt(++ye)])!=null?Y=be.charAt(++ye):q=Y==="e"?" ":"0",(U=Re[Y])&&(Y=U(we,q)),K.push(Y),N=ye+1);return K.push(be.slice(N,ye)),K.join("")}}function w(be,Re){return function(we){var K=vh(1900,void 0,1),ye=M(K,be,we+="",0),N,X;if(ye!=we.length)return null;if("Q"in K)return new Date(K.Q);if("s"in K)return new Date(K.s*1e3+("L"in K?K.L:0));if(Re&&!("Z"in K)&&(K.Z=0),"p"in K&&(K.H=K.H%12+K.p*12),K.m===void 0&&(K.m="q"in K?K.q:0),"V"in K){if(K.V<1||K.V>53)return null;"w"in K||(K.w=1),"Z"in K?(N=BS(vh(K.y,0,1)),X=N.getUTCDay(),N=X>4||X===0?n_.ceil(N):n_(N),N=Zg.offset(N,(K.V-1)*7),K.y=N.getUTCFullYear(),K.m=N.getUTCMonth(),K.d=N.getUTCDate()+(K.w+6)%7):(N=PS(vh(K.y,0,1)),X=N.getDay(),N=X>4||X===0?e_.ceil(N):e_(N),N=yh.offset(N,(K.V-1)*7),K.y=N.getFullYear(),K.m=N.getMonth(),K.d=N.getDate()+(K.w+6)%7)}else("W"in K||"U"in K)&&("w"in K||(K.w="u"in K?K.u%7:"W"in K?1:0),X="Z"in K?BS(vh(K.y,0,1)).getUTCDay():PS(vh(K.y,0,1)).getDay(),K.m=0,K.d="W"in K?(K.w+6)%7+K.W*7-(X+5)%7:K.w+K.U*7-(X+6)%7);return"Z"in K?(K.H+=K.Z/100|0,K.M+=K.Z%100,BS(K)):PS(K)}}function M(be,Re,we,K){for(var ye=0,N=Re.length,X=we.length,Y,q;ye<N;){if(K>=X)return-1;if(Y=Re.charCodeAt(ye++),Y===37){if(Y=Re.charAt(ye++),q=T[Y in tR?Re.charAt(ye++):Y],!q||(K=q(be,we,K))<0)return-1}else if(Y!=we.charCodeAt(K++))return-1}return K}function P(be,Re,we){var K=c.exec(Re.slice(we));return K?(be.p=u.get(K[0].toLowerCase()),we+K[0].length):-1}function z(be,Re,we){var K=h.exec(Re.slice(we));return K?(be.w=m.get(K[0].toLowerCase()),we+K[0].length):-1}function ee(be,Re,we){var K=d.exec(Re.slice(we));return K?(be.w=p.get(K[0].toLowerCase()),we+K[0].length):-1}function O(be,Re,we){var K=b.exec(Re.slice(we));return K?(be.m=y.get(K[0].toLowerCase()),we+K[0].length):-1}function H(be,Re,we){var K=f.exec(Re.slice(we));return K?(be.m=_.get(K[0].toLowerCase()),we+K[0].length):-1}function x(be,Re,we){return M(be,t,Re,we)}function G(be,Re,we){return M(be,n,Re,we)}function D(be,Re,we){return M(be,r,Re,we)}function A(be){return o[be.getDay()]}function I(be){return a[be.getDay()]}function B(be){return l[be.getMonth()]}function $(be){return s[be.getMonth()]}function R(be){return i[+(be.getHours()>=12)]}function L(be){return 1+~~(be.getMonth()/3)}function J(be){return o[be.getUTCDay()]}function se(be){return a[be.getUTCDay()]}function ne(be){return l[be.getUTCMonth()]}function ge(be){return s[be.getUTCMonth()]}function Ne(be){return i[+(be.getUTCHours()>=12)]}function Ae(be){return 1+~~(be.getUTCMonth()/3)}return{format:function(be){var Re=S(be+="",v);return Re.toString=function(){return be},Re},parse:function(be){var Re=w(be+="",!1);return Re.toString=function(){return be},Re},utcFormat:function(be){var Re=S(be+="",E);return Re.toString=function(){return be},Re},utcParse:function(be){var Re=w(be+="",!0);return Re.toString=function(){return be},Re}}}var tR={"-":"",_:" ",0:"0"},Hn=/^\s*\d+/,Pme=/^%/,Bme=/[\\^$*+?|[\]().{}]/g;function Mt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function Fme(e){return e.replace(Bme,"\\$&")}function Eh(e){return new RegExp("^(?:"+e.map(Fme).join("|")+")","i")}function xh(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Ume(e,t,n){var r=Hn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function zme(e,t,n){var r=Hn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function $me(e,t,n){var r=Hn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Gme(e,t,n){var r=Hn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Hme(e,t,n){var r=Hn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function nR(e,t,n){var r=Hn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function rR(e,t,n){var r=Hn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function qme(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Wme(e,t,n){var r=Hn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Vme(e,t,n){var r=Hn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function iR(e,t,n){var r=Hn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Yme(e,t,n){var r=Hn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function aR(e,t,n){var r=Hn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Kme(e,t,n){var r=Hn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Qme(e,t,n){var r=Hn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Xme(e,t,n){var r=Hn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function jme(e,t,n){var r=Hn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Zme(e,t,n){var r=Pme.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Jme(e,t,n){var r=Hn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function efe(e,t,n){var r=Hn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function oR(e,t){return Mt(e.getDate(),t,2)}function tfe(e,t){return Mt(e.getHours(),t,2)}function nfe(e,t){return Mt(e.getHours()%12||12,t,2)}function rfe(e,t){return Mt(1+yh.count(Eo(e),e),t,3)}function sR(e,t){return Mt(e.getMilliseconds(),t,3)}function ife(e,t){return sR(e,t)+"000"}function afe(e,t){return Mt(e.getMonth()+1,t,2)}function ofe(e,t){return Mt(e.getMinutes(),t,2)}function sfe(e,t){return Mt(e.getSeconds(),t,2)}function lfe(e){var t=e.getDay();return t===0?7:t}function cfe(e,t){return Mt(Jg.count(Eo(e)-1,e),t,2)}function lR(e){var t=e.getDay();return t>=4||t===0?Gu(e):Gu.ceil(e)}function ufe(e,t){return e=lR(e),Mt(Gu.count(Eo(e),e)+(Eo(e).getDay()===4),t,2)}function dfe(e){return e.getDay()}function pfe(e,t){return Mt(e_.count(Eo(e)-1,e),t,2)}function hfe(e,t){return Mt(e.getFullYear()%100,t,2)}function mfe(e,t){return e=lR(e),Mt(e.getFullYear()%100,t,2)}function ffe(e,t){return Mt(e.getFullYear()%1e4,t,4)}function gfe(e,t){var n=e.getDay();return e=n>=4||n===0?Gu(e):Gu.ceil(e),Mt(e.getFullYear()%1e4,t,4)}function _fe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Mt(t/60|0,"0",2)+Mt(t%60,"0",2)}function cR(e,t){return Mt(e.getUTCDate(),t,2)}function bfe(e,t){return Mt(e.getUTCHours(),t,2)}function yfe(e,t){return Mt(e.getUTCHours()%12||12,t,2)}function vfe(e,t){return Mt(1+Zg.count(xo(e),e),t,3)}function uR(e,t){return Mt(e.getUTCMilliseconds(),t,3)}function Efe(e,t){return uR(e,t)+"000"}function xfe(e,t){return Mt(e.getUTCMonth()+1,t,2)}function Sfe(e,t){return Mt(e.getUTCMinutes(),t,2)}function Tfe(e,t){return Mt(e.getUTCSeconds(),t,2)}function Cfe(e){var t=e.getUTCDay();return t===0?7:t}function wfe(e,t){return Mt(t_.count(xo(e)-1,e),t,2)}function dR(e){var t=e.getUTCDay();return t>=4||t===0?Hu(e):Hu.ceil(e)}function Dfe(e,t){return e=dR(e),Mt(Hu.count(xo(e),e)+(xo(e).getUTCDay()===4),t,2)}function Afe(e){return e.getUTCDay()}function Nfe(e,t){return Mt(n_.count(xo(e)-1,e),t,2)}function kfe(e,t){return Mt(e.getUTCFullYear()%100,t,2)}function Ofe(e,t){return e=dR(e),Mt(e.getUTCFullYear()%100,t,2)}function Mfe(e,t){return Mt(e.getUTCFullYear()%1e4,t,4)}function Ife(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Hu(e):Hu.ceil(e),Mt(e.getUTCFullYear()%1e4,t,4)}function Rfe(){return"+0000"}function pR(){return"%"}function hR(e){return+e}function mR(e){return Math.floor(+e/1e3)}var qu,fR,gR;Lfe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Lfe(e){return qu=Lme(e),fR=qu.format,qu.parse,gR=qu.utcFormat,qu.utcParse,qu}function Pfe(e){return new Date(e)}function Bfe(e){return e instanceof Date?+e:+new Date(+e)}function FS(e,t,n,r,i,a,o,s,l,c){var u=ES(),d=u.invert,p=u.domain,h=c(".%L"),m=c(":%S"),f=c("%I:%M"),_=c("%I %p"),b=c("%a %d"),y=c("%b %d"),v=c("%B"),E=c("%Y");function T(S){return(l(S)<S?h:s(S)<S?m:o(S)<S?f:a(S)<S?_:r(S)<S?i(S)<S?b:y:n(S)<S?v:E)(S)}return u.invert=function(S){return new Date(d(S))},u.domain=function(S){return arguments.length?p(Array.from(S,Bfe)):p().map(Pfe)},u.ticks=function(S){var w=p();return e(w[0],w[w.length-1],S??10)},u.tickFormat=function(S,w){return w==null?T:c(w)},u.nice=function(S){var w=p();return(!S||typeof S.range!="function")&&(S=t(w[0],w[w.length-1],S??10)),S?p(F7(w,S)):u},u.copy=function(){return bh(u,FS(e,t,n,r,i,a,o,s,l,c))},u}function Ffe(){return ki.apply(FS(Ime,Rme,Eo,RS,Jg,yh,MS,kS,oc,fR).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Ufe(){return ki.apply(FS(Ome,Mme,xo,LS,t_,Zg,IS,OS,oc,gR).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function r_(){var e=0,t=1,n,r,i,a,o=Lr,s=!1,l;function c(d){return d==null||isNaN(d=+d)?l:o(i===0?.5:(d=(a(d)-n)*i,s?Math.max(0,Math.min(1,d)):d))}c.domain=function(d){return arguments.length?([e,t]=d,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),c):[e,t]},c.clamp=function(d){return arguments.length?(s=!!d,c):s},c.interpolator=function(d){return arguments.length?(o=d,c):o};function u(d){return function(p){var h,m;return arguments.length?([h,m]=p,o=d(h,m),c):[o(0),o(1)]}}return c.range=u(ac),c.rangeRound=u(Yg),c.unknown=function(d){return arguments.length?(l=d,c):l},function(d){return a=d,n=d(e),r=d(t),i=n===r?0:1/(r-n),c}}function Fs(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function _R(){var e=Bs(r_()(Lr));return e.copy=function(){return Fs(e,_R())},_o.apply(e,arguments)}function bR(){var e=xS(r_()).domain([1,10]);return e.copy=function(){return Fs(e,bR()).base(e.base())},_o.apply(e,arguments)}function yR(){var e=SS(r_());return e.copy=function(){return Fs(e,yR()).constant(e.constant())},_o.apply(e,arguments)}function US(){var e=TS(r_());return e.copy=function(){return Fs(e,US()).exponent(e.exponent())},_o.apply(e,arguments)}function zfe(){return US.apply(null,arguments).exponent(.5)}function vR(){var e=[],t=Lr;function n(r){if(r!=null&&!isNaN(r=+r))return t((dh(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Rs),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>xhe(e,a/r))},n.copy=function(){return vR(t).domain(e)},_o.apply(n,arguments)}function i_(){var e=0,t=.5,n=1,r=1,i,a,o,s,l,c=Lr,u,d=!1,p;function h(f){return isNaN(f=+f)?p:(f=.5+((f=+u(f))-a)*(r*f<r*a?s:l),c(d?Math.max(0,Math.min(1,f)):f))}h.domain=function(f){return arguments.length?([e,t,n]=f,i=u(e=+e),a=u(t=+t),o=u(n=+n),s=i===a?0:.5/(a-i),l=a===o?0:.5/(o-a),r=a<i?-1:1,h):[e,t,n]},h.clamp=function(f){return arguments.length?(d=!!f,h):d},h.interpolator=function(f){return arguments.length?(c=f,h):c};function m(f){return function(_){var b,y,v;return arguments.length?([b,y,v]=_,c=I7(f,[b,y,v]),h):[c(0),c(.5),c(1)]}}return h.range=m(ac),h.rangeRound=m(Yg),h.unknown=function(f){return arguments.length?(p=f,h):p},function(f){return u=f,i=f(e),a=f(t),o=f(n),s=i===a?0:.5/(a-i),l=a===o?0:.5/(o-a),r=a<i?-1:1,h}}function ER(){var e=Bs(i_()(Lr));return e.copy=function(){return Fs(e,ER())},_o.apply(e,arguments)}function xR(){var e=xS(i_()).domain([.1,1,10]);return e.copy=function(){return Fs(e,xR()).base(e.base())},_o.apply(e,arguments)}function SR(){var e=SS(i_());return e.copy=function(){return Fs(e,SR()).constant(e.constant())},_o.apply(e,arguments)}function zS(){var e=TS(i_());return e.copy=function(){return Fs(e,zS()).exponent(e.exponent())},_o.apply(e,arguments)}function $fe(){return zS.apply(null,arguments).exponent(.5)}const Gfe=Sa(Object.freeze(Object.defineProperty({__proto__:null,scaleBand:oS,scaleDiverging:ER,scaleDivergingLog:xR,scaleDivergingPow:zS,scaleDivergingSqrt:$fe,scaleDivergingSymlog:SR,scaleIdentity:B7,scaleImplicit:iS,scaleLinear:P7,scaleLog:G7,scaleOrdinal:aS,scalePoint:Che,scalePow:CS,scaleQuantile:Q7,scaleQuantize:X7,scaleRadial:K7,scaleSequential:_R,scaleSequentialLog:bR,scaleSequentialPow:US,scaleSequentialQuantile:vR,scaleSequentialSqrt:zfe,scaleSequentialSymlog:yR,scaleSqrt:Eme,scaleSymlog:W7,scaleThreshold:j7,scaleTime:Ffe,scaleUtc:Ufe,tickFormat:L7},Symbol.toStringTag,{value:"Module"})));function Hfe(e){return e}var a_=1,o_=2,$S=3,Sh=4,TR=1e-6;function qfe(e){return"translate("+e+",0)"}function Wfe(e){return"translate(0,"+e+")"}function Vfe(e){return t=>+e(t)}function Yfe(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function Kfe(){return!this.__axis}function s_(e,t){var n=[],r=null,i=null,a=6,o=6,s=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=e===a_||e===Sh?-1:1,u=e===Sh||e===o_?"x":"y",d=e===a_||e===$S?qfe:Wfe;function p(h){var m=r??(t.ticks?t.ticks.apply(t,n):t.domain()),f=i??(t.tickFormat?t.tickFormat.apply(t,n):Hfe),_=Math.max(a,0)+s,b=t.range(),y=+b[0]+l,v=+b[b.length-1]+l,E=(t.bandwidth?Yfe:Vfe)(t.copy(),l),T=h.selection?h.selection():h,S=T.selectAll(".domain").data([null]),w=T.selectAll(".tick").data(m,t).order(),M=w.exit(),P=w.enter().append("g").attr("class","tick"),z=w.select("line"),ee=w.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),w=w.merge(P),z=z.merge(P.append("line").attr("stroke","currentColor").attr(u+"2",c*a)),ee=ee.merge(P.append("text").attr("fill","currentColor").attr(u,c*_).attr("dy",e===a_?"0em":e===$S?"0.71em":"0.32em")),h!==T&&(S=S.transition(h),w=w.transition(h),z=z.transition(h),ee=ee.transition(h),M=M.transition(h).attr("opacity",TR).attr("transform",function(O){return isFinite(O=E(O))?d(O+l):this.getAttribute("transform")}),P.attr("opacity",TR).attr("transform",function(O){var H=this.parentNode.__axis;return d((H&&isFinite(H=H(O))?H:E(O))+l)})),M.remove(),S.attr("d",e===Sh||e===o_?o?"M"+c*o+","+y+"H"+l+"V"+v+"H"+c*o:"M"+l+","+y+"V"+v:o?"M"+y+","+c*o+"V"+l+"H"+v+"V"+c*o:"M"+y+","+l+"H"+v),w.attr("opacity",1).attr("transform",function(O){return d(E(O)+l)}),z.attr(u+"2",c*a),ee.attr(u,c*_).text(f),T.filter(Kfe).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===o_?"start":e===Sh?"end":"middle"),T.each(function(){this.__axis=E})}return p.scale=function(h){return arguments.length?(t=h,p):t},p.ticks=function(){return n=Array.from(arguments),p},p.tickArguments=function(h){return arguments.length?(n=h==null?[]:Array.from(h),p):n.slice()},p.tickValues=function(h){return arguments.length?(r=h==null?null:Array.from(h),p):r&&r.slice()},p.tickFormat=function(h){return arguments.length?(i=h,p):i},p.tickSize=function(h){return arguments.length?(a=o=+h,p):a},p.tickSizeInner=function(h){return arguments.length?(a=+h,p):a},p.tickSizeOuter=function(h){return arguments.length?(o=+h,p):o},p.tickPadding=function(h){return arguments.length?(s=+h,p):s},p.offset=function(h){return arguments.length?(l=+h,p):l},p}function Qfe(e){return s_(a_,e)}function Xfe(e){return s_(o_,e)}function jfe(e){return s_($S,e)}function Zfe(e){return s_(Sh,e)}const Jfe=Sa(Object.freeze(Object.defineProperty({__proto__:null,axisBottom:jfe,axisLeft:Zfe,axisRight:Xfe,axisTop:Qfe},Symbol.toStringTag,{value:"Module"})));var e0e={value:()=>{}};function GS(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new l_(n)}function l_(e){this._=e}function t0e(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}l_.prototype=GS.prototype={constructor:l_,on:function(e,t){var n=this._,r=t0e(e+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=n0e(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=CR(n[i],e.name,t);else if(t==null)for(i in n)n[i]=CR(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new l_(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function n0e(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function CR(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=e0e,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var HS="http://www.w3.org/1999/xhtml";const qS={svg:"http://www.w3.org/2000/svg",xhtml:HS,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Th(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),qS.hasOwnProperty(t)?{space:qS[t],local:e}:e}function r0e(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===HS&&t.documentElement.namespaceURI===HS?t.createElement(e):t.createElementNS(n,e)}}function i0e(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function c_(e){var t=Th(e);return(t.local?i0e:r0e)(t)}function a0e(){}function u_(e){return e==null?a0e:function(){return this.querySelector(e)}}function o0e(e){typeof e!="function"&&(e=u_(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=new Array(o),l,c,u=0;u<o;++u)(l=a[u])&&(c=e.call(l,l.__data__,u,a))&&("__data__"in l&&(c.__data__=l.__data__),s[u]=c);return new Pr(r,this._parents)}function wR(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function s0e(){return[]}function WS(e){return e==null?s0e:function(){return this.querySelectorAll(e)}}function l0e(e){return function(){return wR(e.apply(this,arguments))}}function c0e(e){typeof e=="function"?e=l0e(e):e=WS(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,l,c=0;c<s;++c)(l=o[c])&&(r.push(e.call(l,l.__data__,c,o)),i.push(l));return new Pr(r,i)}function VS(e){return function(){return this.matches(e)}}function DR(e){return function(t){return t.matches(e)}}var u0e=Array.prototype.find;function d0e(e){return function(){return u0e.call(this.children,e)}}function p0e(){return this.firstElementChild}function h0e(e){return this.select(e==null?p0e:d0e(typeof e=="function"?e:DR(e)))}var m0e=Array.prototype.filter;function f0e(){return Array.from(this.children)}function g0e(e){return function(){return m0e.call(this.children,e)}}function _0e(e){return this.selectAll(e==null?f0e:g0e(typeof e=="function"?e:DR(e)))}function b0e(e){typeof e!="function"&&(e=VS(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],l,c=0;c<o;++c)(l=a[c])&&e.call(l,l.__data__,c,a)&&s.push(l);return new Pr(r,this._parents)}function AR(e){return new Array(e.length)}function y0e(){return new Pr(this._enter||this._groups.map(AR),this._parents)}function d_(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}d_.prototype={constructor:d_,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function v0e(e){return function(){return e}}function E0e(e,t,n,r,i,a){for(var o=0,s,l=t.length,c=a.length;o<c;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new d_(e,a[o]);for(;o<l;++o)(s=t[o])&&(i[o]=s)}function x0e(e,t,n,r,i,a,o){var s,l,c=new Map,u=t.length,d=a.length,p=new Array(u),h;for(s=0;s<u;++s)(l=t[s])&&(p[s]=h=o.call(l,l.__data__,s,t)+"",c.has(h)?i[s]=l:c.set(h,l));for(s=0;s<d;++s)h=o.call(e,a[s],s,a)+"",(l=c.get(h))?(r[s]=l,l.__data__=a[s],c.delete(h)):n[s]=new d_(e,a[s]);for(s=0;s<u;++s)(l=t[s])&&c.get(p[s])===l&&(i[s]=l)}function S0e(e){return e.__data__}function T0e(e,t){if(!arguments.length)return Array.from(this,S0e);var n=t?x0e:E0e,r=this._parents,i=this._groups;typeof e!="function"&&(e=v0e(e));for(var a=i.length,o=new Array(a),s=new Array(a),l=new Array(a),c=0;c<a;++c){var u=r[c],d=i[c],p=d.length,h=C0e(e.call(u,u&&u.__data__,c,r)),m=h.length,f=s[c]=new Array(m),_=o[c]=new Array(m),b=l[c]=new Array(p);n(u,d,f,_,b,h,t);for(var y=0,v=0,E,T;y<m;++y)if(E=f[y]){for(y>=v&&(v=y+1);!(T=_[v])&&++v<m;);E._next=T||null}}return o=new Pr(o,r),o._enter=s,o._exit=l,o}function C0e(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function w0e(){return new Pr(this._exit||this._groups.map(AR),this._parents)}function D0e(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function A0e(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=new Array(i),l=0;l<o;++l)for(var c=n[l],u=r[l],d=c.length,p=s[l]=new Array(d),h,m=0;m<d;++m)(h=c[m]||u[m])&&(p[m]=h);for(;l<i;++l)s[l]=n[l];return new Pr(s,this._parents)}function N0e(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function k0e(e){e||(e=O0e);function t(d,p){return d&&p?e(d.__data__,p.__data__):!d-!p}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,l=i[a]=new Array(s),c,u=0;u<s;++u)(c=o[u])&&(l[u]=c);l.sort(t)}return new Pr(i,this._parents).order()}function O0e(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function M0e(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function I0e(){return Array.from(this)}function R0e(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function L0e(){let e=0;for(const t of this)++e;return e}function P0e(){return!this.node()}function B0e(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function F0e(e){return function(){this.removeAttribute(e)}}function U0e(e){return function(){this.removeAttributeNS(e.space,e.local)}}function z0e(e,t){return function(){this.setAttribute(e,t)}}function $0e(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function G0e(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function H0e(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function q0e(e,t){var n=Th(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?U0e:F0e:typeof t=="function"?n.local?H0e:G0e:n.local?$0e:z0e)(n,t))}function YS(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function W0e(e){return function(){this.style.removeProperty(e)}}function V0e(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Y0e(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function K0e(e,t,n){return arguments.length>1?this.each((t==null?W0e:typeof t=="function"?Y0e:V0e)(e,t,n??"")):cc(this.node(),e)}function cc(e,t){return e.style.getPropertyValue(t)||YS(e).getComputedStyle(e,null).getPropertyValue(t)}function Q0e(e){return function(){delete this[e]}}function X0e(e,t){return function(){this[e]=t}}function j0e(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Z0e(e,t){return arguments.length>1?this.each((t==null?Q0e:typeof t=="function"?j0e:X0e)(e,t)):this.node()[e]}function NR(e){return e.trim().split(/^|\s+/)}function KS(e){return e.classList||new kR(e)}function kR(e){this._node=e,this._names=NR(e.getAttribute("class")||"")}kR.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function OR(e,t){for(var n=KS(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function MR(e,t){for(var n=KS(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function J0e(e){return function(){OR(this,e)}}function ege(e){return function(){MR(this,e)}}function tge(e,t){return function(){(t.apply(this,arguments)?OR:MR)(this,e)}}function nge(e,t){var n=NR(e+"");if(arguments.length<2){for(var r=KS(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?tge:t?J0e:ege)(n,t))}function rge(){this.textContent=""}function ige(e){return function(){this.textContent=e}}function age(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function oge(e){return arguments.length?this.each(e==null?rge:(typeof e=="function"?age:ige)(e)):this.node().textContent}function sge(){this.innerHTML=""}function lge(e){return function(){this.innerHTML=e}}function cge(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function uge(e){return arguments.length?this.each(e==null?sge:(typeof e=="function"?cge:lge)(e)):this.node().innerHTML}function dge(){this.nextSibling&&this.parentNode.appendChild(this)}function pge(){return this.each(dge)}function hge(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function mge(){return this.each(hge)}function fge(e){var t=typeof e=="function"?e:c_(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function gge(){return null}function _ge(e,t){var n=typeof e=="function"?e:c_(e),r=t==null?gge:typeof t=="function"?t:u_(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function bge(){var e=this.parentNode;e&&e.removeChild(this)}function yge(){return this.each(bge)}function vge(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ege(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function xge(e){return this.select(e?Ege:vge)}function Sge(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Tge(e){return function(t){e.call(this,t,this.__data__)}}function Cge(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function wge(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function Dge(e,t,n){return function(){var r=this.__on,i,a=Tge(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Age(e,t,n){var r=Cge(e+""),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,c=s.length,u;l<c;++l)for(i=0,u=s[l];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?Dge:wge,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function IR(e,t,n){var r=YS(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Nge(e,t){return function(){return IR(this,e,t)}}function kge(e,t){return function(){return IR(this,e,t.apply(this,arguments))}}function Oge(e,t){return this.each((typeof t=="function"?kge:Nge)(e,t))}function*Mge(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var QS=[null];function Pr(e,t){this._groups=e,this._parents=t}function Wu(){return new Pr([[document.documentElement]],QS)}function Ige(){return this}Pr.prototype=Wu.prototype={constructor:Pr,select:o0e,selectAll:c0e,selectChild:h0e,selectChildren:_0e,filter:b0e,data:T0e,enter:y0e,exit:w0e,join:D0e,merge:A0e,selection:Ige,order:N0e,sort:k0e,call:M0e,nodes:I0e,node:R0e,size:L0e,empty:P0e,each:B0e,attr:q0e,style:K0e,property:Z0e,classed:nge,text:oge,html:uge,raise:pge,lower:mge,append:fge,insert:_ge,remove:yge,clone:xge,datum:Sge,on:Age,dispatch:Oge,[Symbol.iterator]:Mge};function So(e){return typeof e=="string"?new Pr([[document.querySelector(e)]],[document.documentElement]):new Pr([[e]],QS)}function Rge(e){return So(c_(e).call(document.documentElement))}var Lge=0;function RR(){return new XS}function XS(){this._="@"+(++Lge).toString(36)}XS.prototype=RR.prototype={constructor:XS,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}};function LR(e){let t;for(;t=e.sourceEvent;)e=t;return e}function To(e,t){if(e=LR(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}function Pge(e,t){return e.target&&(e=LR(e),t===void 0&&(t=e.currentTarget),e=e.touches||[e]),Array.from(e,n=>To(n,t))}function Bge(e){return typeof e=="string"?new Pr([document.querySelectorAll(e)],[document.documentElement]):new Pr([wR(e)],QS)}const Fge=Object.freeze(Object.defineProperty({__proto__:null,create:Rge,creator:c_,local:RR,matcher:VS,namespace:Th,namespaces:qS,pointer:To,pointers:Pge,select:So,selectAll:Bge,selection:Wu,selector:u_,selectorAll:WS,style:cc,window:YS},Symbol.toStringTag,{value:"Module"})),jS={capture:!0,passive:!1};function ZS(e){e.preventDefault(),e.stopImmediatePropagation()}function Uge(e){var t=e.document.documentElement,n=So(e).on("dragstart.drag",ZS,jS);"onselectstart"in t?n.on("selectstart.drag",ZS,jS):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function zge(e,t){var n=e.document.documentElement,r=So(e).on("dragstart.drag",null);t&&(r.on("click.drag",ZS,jS),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Vu=0,Ch=0,wh=0,PR=1e3,p_,Dh,h_=0,uc=0,m_=0,Ah=typeof performance=="object"&&performance.now?performance:Date,BR=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function JS(){return uc||(BR($ge),uc=Ah.now()+m_)}function $ge(){uc=0}function f_(){this._call=this._time=this._next=null}f_.prototype=FR.prototype={constructor:f_,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?JS():+n)+(t==null?0:+t),!this._next&&Dh!==this&&(Dh?Dh._next=this:p_=this,Dh=this),this._call=e,this._time=n,eT()},stop:function(){this._call&&(this._call=null,this._time=1/0,eT())}};function FR(e,t,n){var r=new f_;return r.restart(e,t,n),r}function Gge(){JS(),++Vu;for(var e=p_,t;e;)(t=uc-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Vu}function UR(){uc=(h_=Ah.now())+m_,Vu=Ch=0;try{Gge()}finally{Vu=0,qge(),uc=0}}function Hge(){var e=Ah.now(),t=e-h_;t>PR&&(m_-=t,h_=e)}function qge(){for(var e,t=p_,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:p_=n);Dh=e,eT(r)}function eT(e){if(!Vu){Ch&&(Ch=clearTimeout(Ch));var t=e-uc;t>24?(e<1/0&&(Ch=setTimeout(UR,e-Ah.now()-m_)),wh&&(wh=clearInterval(wh))):(wh||(h_=Ah.now(),wh=setInterval(Hge,PR)),Vu=1,BR(UR))}}function zR(e,t,n){var r=new f_;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var Wge=GS("start","end","cancel","interrupt"),Vge=[],$R=0,GR=1,tT=2,g_=3,HR=4,nT=5,__=6;function b_(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Yge(e,n,{name:t,index:r,group:i,on:Wge,tween:Vge,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:$R})}function rT(e,t){var n=ea(e,t);if(n.state>$R)throw new Error("too late; already scheduled");return n}function Ma(e,t){var n=ea(e,t);if(n.state>g_)throw new Error("too late; already running");return n}function ea(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Yge(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=FR(a,0,n.time);function a(c){n.state=GR,n.timer.restart(o,n.delay,n.time),n.delay<=c&&o(c-n.delay)}function o(c){var u,d,p,h;if(n.state!==GR)return l();for(u in r)if(h=r[u],h.name===n.name){if(h.state===g_)return zR(o);h.state===HR?(h.state=__,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[u]):+u<t&&(h.state=__,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[u])}if(zR(function(){n.state===g_&&(n.state=HR,n.timer.restart(s,n.delay,n.time),s(c))}),n.state=tT,n.on.call("start",e,e.__data__,n.index,n.group),n.state===tT){for(n.state=g_,i=new Array(p=n.tween.length),u=0,d=-1;u<p;++u)(h=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=h);i.length=d+1}}function s(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=nT,1),d=-1,p=i.length;++d<p;)i[d].call(e,u);n.state===nT&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=__,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function y_(e,t){var n=e.__transition,r,i,a=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>tT&&r.state<nT,r.state=__,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function Kge(e){return this.each(function(){y_(this,e)})}function Qge(e,t){var n,r;return function(){var i=Ma(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Xge(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=Ma(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===t){i[l]=s;break}l===c&&i.push(s)}a.tween=i}}function jge(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=ea(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Qge:Xge)(n,e,t))}function iT(e,t,n){var r=e._id;return e.each(function(){var i=Ma(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return ea(i,r).value[t]}}function qR(e,t){var n;return(typeof t=="number"?Oi:t instanceof Ps?_h:(n=Ps(t))?(t=n,_h):bS)(e,t)}function Zge(e){return function(){this.removeAttribute(e)}}function Jge(e){return function(){this.removeAttributeNS(e.space,e.local)}}function e_e(e,t,n){var r,i=n+"",a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function t_e(e,t,n){var r,i=n+"",a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function n_e(e,t,n){var r,i,a;return function(){var o,s=n(this),l;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),l=s+"",o===l?null:o===r&&l===i?a:(i=l,a=t(r=o,s)))}}function r_e(e,t,n){var r,i,a;return function(){var o,s=n(this),l;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),l=s+"",o===l?null:o===r&&l===i?a:(i=l,a=t(r=o,s)))}}function i_e(e,t){var n=Th(e),r=n==="transform"?D7:qR;return this.attrTween(e,typeof t=="function"?(n.local?r_e:n_e)(n,r,iT(this,"attr."+e,t)):t==null?(n.local?Jge:Zge)(n):(n.local?t_e:e_e)(n,r,t))}function a_e(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function o_e(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function s_e(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&o_e(e,a)),n}return i._value=t,i}function l_e(e,t){var n,r;function i(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&a_e(e,a)),n}return i._value=t,i}function c_e(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Th(e);return this.tween(n,(r.local?s_e:l_e)(r,t))}function u_e(e,t){return function(){rT(this,e).delay=+t.apply(this,arguments)}}function d_e(e,t){return t=+t,function(){rT(this,e).delay=t}}function p_e(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?u_e:d_e)(t,e)):ea(this.node(),t).delay}function h_e(e,t){return function(){Ma(this,e).duration=+t.apply(this,arguments)}}function m_e(e,t){return t=+t,function(){Ma(this,e).duration=t}}function f_e(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?h_e:m_e)(t,e)):ea(this.node(),t).duration}function g_e(e,t){if(typeof t!="function")throw new Error;return function(){Ma(this,e).ease=t}}function __e(e){var t=this._id;return arguments.length?this.each(g_e(t,e)):ea(this.node(),t).ease}function b_e(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ma(this,e).ease=n}}function y_e(e){if(typeof e!="function")throw new Error;return this.each(b_e(this._id,e))}function v_e(e){typeof e!="function"&&(e=VS(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],l,c=0;c<o;++c)(l=a[c])&&e.call(l,l.__data__,c,a)&&s.push(l);return new Co(r,this._parents,this._name,this._id)}function E_e(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=new Array(r),s=0;s<a;++s)for(var l=t[s],c=n[s],u=l.length,d=o[s]=new Array(u),p,h=0;h<u;++h)(p=l[h]||c[h])&&(d[h]=p);for(;s<r;++s)o[s]=t[s];return new Co(o,this._parents,this._name,this._id)}function x_e(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function S_e(e,t,n){var r,i,a=x_e(t)?rT:Ma;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function T_e(e,t){var n=this._id;return arguments.length<2?ea(this.node(),n).on.on(e):this.each(S_e(n,e,t))}function C_e(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function w_e(){return this.on("end.remove",C_e(this._id))}function D_e(e){var t=this._name,n=this._id;typeof e!="function"&&(e=u_(e));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var s=r[o],l=s.length,c=a[o]=new Array(l),u,d,p=0;p<l;++p)(u=s[p])&&(d=e.call(u,u.__data__,p,s))&&("__data__"in u&&(d.__data__=u.__data__),c[p]=d,b_(c[p],t,n,p,c,ea(u,n)));return new Co(a,this._parents,t,n)}function A_e(e){var t=this._name,n=this._id;typeof e!="function"&&(e=WS(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var l=r[s],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var p=e.call(u,u.__data__,d,l),h,m=ea(u,n),f=0,_=p.length;f<_;++f)(h=p[f])&&b_(h,t,n,f,p,m);a.push(p),o.push(u)}return new Co(a,o,t,n)}var N_e=Wu.prototype.constructor;function k_e(){return new N_e(this._groups,this._parents)}function O_e(e,t){var n,r,i;return function(){var a=cc(this,e),o=(this.style.removeProperty(e),cc(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function WR(e){return function(){this.style.removeProperty(e)}}function M_e(e,t,n){var r,i=n+"",a;return function(){var o=cc(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function I_e(e,t,n){var r,i,a;return function(){var o=cc(this,e),s=n(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(e),cc(this,e))),o===l?null:o===r&&l===i?a:(i=l,a=t(r=o,s))}}function R_e(e,t){var n,r,i,a="style."+t,o="end."+a,s;return function(){var l=Ma(this,e),c=l.on,u=l.value[a]==null?s||(s=WR(t)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(o,i=u),l.on=r}}function L_e(e,t,n){var r=(e+="")=="transform"?w7:qR;return t==null?this.styleTween(e,O_e(e,r)).on("end.style."+e,WR(e)):typeof t=="function"?this.styleTween(e,I_e(e,r,iT(this,"style."+e,t))).each(R_e(this._id,e)):this.styleTween(e,M_e(e,r,t),n).on("end.style."+e,null)}function P_e(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function B_e(e,t,n){var r,i;function a(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&P_e(e,o,n)),r}return a._value=t,a}function F_e(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,B_e(e,t,n??""))}function U_e(e){return function(){this.textContent=e}}function z_e(e){return function(){var t=e(this);this.textContent=t??""}}function $_e(e){return this.tween("text",typeof e=="function"?z_e(iT(this,"text",e)):U_e(e==null?"":e+""))}function G_e(e){return function(t){this.textContent=e.call(this,t)}}function H_e(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&G_e(i)),t}return r._value=e,r}function q_e(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,H_e(e))}function W_e(){for(var e=this._name,t=this._id,n=VR(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,l,c=0;c<s;++c)if(l=o[c]){var u=ea(l,t);b_(l,e,n,c,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Co(r,this._parents,e,n)}function V_e(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},l={value:function(){--i===0&&a()}};n.each(function(){var c=Ma(this,r),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),c.on=t}),i===0&&a()})}var Y_e=0;function Co(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function VR(){return++Y_e}var wo=Wu.prototype;Co.prototype={constructor:Co,select:D_e,selectAll:A_e,selectChild:wo.selectChild,selectChildren:wo.selectChildren,filter:v_e,merge:E_e,selection:k_e,transition:W_e,call:wo.call,nodes:wo.nodes,node:wo.node,size:wo.size,empty:wo.empty,each:wo.each,on:T_e,attr:i_e,attrTween:c_e,style:L_e,styleTween:F_e,text:$_e,textTween:q_e,remove:w_e,tween:jge,delay:p_e,duration:f_e,ease:__e,easeVarying:y_e,end:V_e,[Symbol.iterator]:wo[Symbol.iterator]};function K_e(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Q_e={time:null,delay:0,duration:250,ease:K_e};function X_e(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function j_e(e){var t,n;e instanceof Co?(t=e._id,e=e._name):(t=VR(),(n=Q_e).time=JS(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,l,c=0;c<s;++c)(l=o[c])&&b_(l,e,t,c,o,n||X_e(l,t));return new Co(r,this._parents,e,t)}Wu.prototype.interrupt=Kge,Wu.prototype.transition=j_e;const v_=e=>()=>e;function Z_e(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Ia(e,t,n){this.k=e,this.x=t,this.y=n}Ia.prototype={constructor:Ia,scale:function(e){return e===1?this:new Ia(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ia(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var E_=new Ia(1,0,0);YR.prototype=Ia.prototype;function YR(e){for(;!e.__zoom;)if(!(e=e.parentNode))return E_;return e.__zoom}function aT(e){e.stopImmediatePropagation()}function Nh(e){e.preventDefault(),e.stopImmediatePropagation()}function J_e(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function ebe(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function KR(){return this.__zoom||E_}function tbe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function nbe(){return navigator.maxTouchPoints||"ontouchstart"in this}function rbe(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function ibe(){var e=J_e,t=ebe,n=rbe,r=tbe,i=nbe,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,l=N7,c=GS("start","zoom","end"),u,d,p,h=500,m=150,f=0,_=10;function b(x){x.property("__zoom",KR).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",z).filter(i).on("touchstart.zoom",ee).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(x,G,D,A){var I=x.selection?x.selection():x;I.property("__zoom",KR),x!==I?T(x,G,D,A):I.interrupt().each(function(){S(this,arguments).event(A).start().zoom(null,typeof G=="function"?G.apply(this,arguments):G).end()})},b.scaleBy=function(x,G,D,A){b.scaleTo(x,function(){var I=this.__zoom.k,B=typeof G=="function"?G.apply(this,arguments):G;return I*B},D,A)},b.scaleTo=function(x,G,D,A){b.transform(x,function(){var I=t.apply(this,arguments),B=this.__zoom,$=D==null?E(I):typeof D=="function"?D.apply(this,arguments):D,R=B.invert($),L=typeof G=="function"?G.apply(this,arguments):G;return n(v(y(B,L),$,R),I,o)},D,A)},b.translateBy=function(x,G,D,A){b.transform(x,function(){return n(this.__zoom.translate(typeof G=="function"?G.apply(this,arguments):G,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),o)},null,A)},b.translateTo=function(x,G,D,A,I){b.transform(x,function(){var B=t.apply(this,arguments),$=this.__zoom,R=A==null?E(B):typeof A=="function"?A.apply(this,arguments):A;return n(E_.translate(R[0],R[1]).scale($.k).translate(typeof G=="function"?-G.apply(this,arguments):-G,typeof D=="function"?-D.apply(this,arguments):-D),B,o)},A,I)};function y(x,G){return G=Math.max(a[0],Math.min(a[1],G)),G===x.k?x:new Ia(G,x.x,x.y)}function v(x,G,D){var A=G[0]-D[0]*x.k,I=G[1]-D[1]*x.k;return A===x.x&&I===x.y?x:new Ia(x.k,A,I)}function E(x){return[(+x[0][0]+ +x[1][0])/2,(+x[0][1]+ +x[1][1])/2]}function T(x,G,D,A){x.on("start.zoom",function(){S(this,arguments).event(A).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(A).end()}).tween("zoom",function(){var I=this,B=arguments,$=S(I,B).event(A),R=t.apply(I,B),L=D==null?E(R):typeof D=="function"?D.apply(I,B):D,J=Math.max(R[1][0]-R[0][0],R[1][1]-R[0][1]),se=I.__zoom,ne=typeof G=="function"?G.apply(I,B):G,ge=l(se.invert(L).concat(J/se.k),ne.invert(L).concat(J/ne.k));return function(Ne){if(Ne===1)Ne=ne;else{var Ae=ge(Ne),be=J/Ae[2];Ne=new Ia(be,L[0]-Ae[0]*be,L[1]-Ae[1]*be)}$.zoom(null,Ne)}})}function S(x,G,D){return!D&&x.__zooming||new w(x,G)}function w(x,G){this.that=x,this.args=G,this.active=0,this.sourceEvent=null,this.extent=t.apply(x,G),this.taps=0}w.prototype={event:function(x){return x&&(this.sourceEvent=x),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(x,G){return this.mouse&&x!=="mouse"&&(this.mouse[1]=G.invert(this.mouse[0])),this.touch0&&x!=="touch"&&(this.touch0[1]=G.invert(this.touch0[0])),this.touch1&&x!=="touch"&&(this.touch1[1]=G.invert(this.touch1[0])),this.that.__zoom=G,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(x){var G=So(this.that).datum();c.call(x,this.that,new Z_e(x,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:c}),G)}};function M(x,...G){if(!e.apply(this,arguments))return;var D=S(this,G).event(x),A=this.__zoom,I=Math.max(a[0],Math.min(a[1],A.k*Math.pow(2,r.apply(this,arguments)))),B=To(x);if(D.wheel)(D.mouse[0][0]!==B[0]||D.mouse[0][1]!==B[1])&&(D.mouse[1]=A.invert(D.mouse[0]=B)),clearTimeout(D.wheel);else{if(A.k===I)return;D.mouse=[B,A.invert(B)],y_(this),D.start()}Nh(x),D.wheel=setTimeout($,m),D.zoom("mouse",n(v(y(A,I),D.mouse[0],D.mouse[1]),D.extent,o));function $(){D.wheel=null,D.end()}}function P(x,...G){if(p||!e.apply(this,arguments))return;var D=x.currentTarget,A=S(this,G,!0).event(x),I=So(x.view).on("mousemove.zoom",L,!0).on("mouseup.zoom",J,!0),B=To(x,D),$=x.clientX,R=x.clientY;Uge(x.view),aT(x),A.mouse=[B,this.__zoom.invert(B)],y_(this),A.start();function L(se){if(Nh(se),!A.moved){var ne=se.clientX-$,ge=se.clientY-R;A.moved=ne*ne+ge*ge>f}A.event(se).zoom("mouse",n(v(A.that.__zoom,A.mouse[0]=To(se,D),A.mouse[1]),A.extent,o))}function J(se){I.on("mousemove.zoom mouseup.zoom",null),zge(se.view,A.moved),Nh(se),A.event(se).end()}}function z(x,...G){if(e.apply(this,arguments)){var D=this.__zoom,A=To(x.changedTouches?x.changedTouches[0]:x,this),I=D.invert(A),B=D.k*(x.shiftKey?.5:2),$=n(v(y(D,B),A,I),t.apply(this,G),o);Nh(x),s>0?So(this).transition().duration(s).call(T,$,A,x):So(this).call(b.transform,$,A,x)}}function ee(x,...G){if(e.apply(this,arguments)){var D=x.touches,A=D.length,I=S(this,G,x.changedTouches.length===A).event(x),B,$,R,L;for(aT(x),$=0;$<A;++$)R=D[$],L=To(R,this),L=[L,this.__zoom.invert(L),R.identifier],I.touch0?!I.touch1&&I.touch0[2]!==L[2]&&(I.touch1=L,I.taps=0):(I.touch0=L,B=!0,I.taps=1+!!u);u&&(u=clearTimeout(u)),B&&(I.taps<2&&(d=L[0],u=setTimeout(function(){u=null},h)),y_(this),I.start())}}function O(x,...G){if(this.__zooming){var D=S(this,G).event(x),A=x.changedTouches,I=A.length,B,$,R,L;for(Nh(x),B=0;B<I;++B)$=A[B],R=To($,this),D.touch0&&D.touch0[2]===$.identifier?D.touch0[0]=R:D.touch1&&D.touch1[2]===$.identifier&&(D.touch1[0]=R);if($=D.that.__zoom,D.touch1){var J=D.touch0[0],se=D.touch0[1],ne=D.touch1[0],ge=D.touch1[1],Ne=(Ne=ne[0]-J[0])*Ne+(Ne=ne[1]-J[1])*Ne,Ae=(Ae=ge[0]-se[0])*Ae+(Ae=ge[1]-se[1])*Ae;$=y($,Math.sqrt(Ne/Ae)),R=[(J[0]+ne[0])/2,(J[1]+ne[1])/2],L=[(se[0]+ge[0])/2,(se[1]+ge[1])/2]}else if(D.touch0)R=D.touch0[0],L=D.touch0[1];else return;D.zoom("touch",n(v($,R,L),D.extent,o))}}function H(x,...G){if(this.__zooming){var D=S(this,G).event(x),A=x.changedTouches,I=A.length,B,$;for(aT(x),p&&clearTimeout(p),p=setTimeout(function(){p=null},h),B=0;B<I;++B)$=A[B],D.touch0&&D.touch0[2]===$.identifier?delete D.touch0:D.touch1&&D.touch1[2]===$.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&($=To($,this),Math.hypot(d[0]-$[0],d[1]-$[1])<_)){var R=So(this).on("dblclick.zoom");R&&R.apply(this,arguments)}}}return b.wheelDelta=function(x){return arguments.length?(r=typeof x=="function"?x:v_(+x),b):r},b.filter=function(x){return arguments.length?(e=typeof x=="function"?x:v_(!!x),b):e},b.touchable=function(x){return arguments.length?(i=typeof x=="function"?x:v_(!!x),b):i},b.extent=function(x){return arguments.length?(t=typeof x=="function"?x:v_([[+x[0][0],+x[0][1]],[+x[1][0],+x[1][1]]]),b):t},b.scaleExtent=function(x){return arguments.length?(a[0]=+x[0],a[1]=+x[1],b):[a[0],a[1]]},b.translateExtent=function(x){return arguments.length?(o[0][0]=+x[0][0],o[1][0]=+x[1][0],o[0][1]=+x[0][1],o[1][1]=+x[1][1],b):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},b.constrain=function(x){return arguments.length?(n=x,b):n},b.duration=function(x){return arguments.length?(s=+x,b):s},b.interpolate=function(x){return arguments.length?(l=x,b):l},b.on=function(){var x=c.on.apply(c,arguments);return x===c?b:x},b.clickDistance=function(x){return arguments.length?(f=(x=+x)*x,b):Math.sqrt(f)},b.tapDistance=function(x){return arguments.length?(_=+x,b):_},b}const abe=Sa(Object.freeze(Object.defineProperty({__proto__:null,ZoomTransform:Ia,zoom:ibe,zoomIdentity:E_,zoomTransform:YR},Symbol.toStringTag,{value:"Module"}))),Ra=Sa(Fge),obe=Sa(cme);var oT={exports:{}},Yu=typeof Reflect=="object"?Reflect:null,QR=Yu&&typeof Yu.apply=="function"?Yu.apply:function(t,n,r){return Function.prototype.apply.call(t,n,r)},x_;Yu&&typeof Yu.ownKeys=="function"?x_=Yu.ownKeys:Object.getOwnPropertySymbols?x_=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:x_=function(t){return Object.getOwnPropertyNames(t)};function sbe(e){console&&console.warn&&console.warn(e)}var XR=Number.isNaN||function(t){return t!==t};function Gt(){Gt.init.call(this)}oT.exports=Gt,oT.exports.once=dbe,Gt.EventEmitter=Gt,Gt.prototype._events=void 0,Gt.prototype._eventsCount=0,Gt.prototype._maxListeners=void 0;var jR=10;function S_(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(Gt,"defaultMaxListeners",{enumerable:!0,get:function(){return jR},set:function(e){if(typeof e!="number"||e<0||XR(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");jR=e}}),Gt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Gt.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||XR(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function ZR(e){return e._maxListeners===void 0?Gt.defaultMaxListeners:e._maxListeners}Gt.prototype.getMaxListeners=function(){return ZR(this)},Gt.prototype.emit=function(t){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var i=t==="error",a=this._events;if(a!==void 0)i=i&&a.error===void 0;else if(!i)return!1;if(i){var o;if(n.length>0&&(o=n[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[t];if(l===void 0)return!1;if(typeof l=="function")QR(l,this,n);else for(var c=l.length,u=r9(l,c),r=0;r<c;++r)QR(u[r],this,n);return!0};function JR(e,t,n,r){var i,a,o;if(S_(n),a=e._events,a===void 0?(a=e._events=Object.create(null),e._eventsCount=0):(a.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]),o===void 0)o=a[t]=n,++e._eventsCount;else if(typeof o=="function"?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),i=ZR(e),i>0&&o.length>i&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=o.length,sbe(s)}return e}Gt.prototype.addListener=function(t,n){return JR(this,t,n,!1)},Gt.prototype.on=Gt.prototype.addListener,Gt.prototype.prependListener=function(t,n){return JR(this,t,n,!0)};function lbe(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function e9(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=lbe.bind(r);return i.listener=n,r.wrapFn=i,i}Gt.prototype.once=function(t,n){return S_(n),this.on(t,e9(this,t,n)),this},Gt.prototype.prependOnceListener=function(t,n){return S_(n),this.prependListener(t,e9(this,t,n)),this},Gt.prototype.removeListener=function(t,n){var r,i,a,o,s;if(S_(n),i=this._events,i===void 0)return this;if(r=i[t],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||n));else if(typeof r!="function"){for(a=-1,o=r.length-1;o>=0;o--)if(r[o]===n||r[o].listener===n){s=r[o].listener,a=o;break}if(a<0)return this;a===0?r.shift():cbe(r,a),r.length===1&&(i[t]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",t,s||n)}return this},Gt.prototype.off=Gt.prototype.removeListener,Gt.prototype.removeAllListeners=function(t){var n,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var a=Object.keys(r),o;for(i=0;i<a.length;++i)o=a[i],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(n=r[t],typeof n=="function")this.removeListener(t,n);else if(n!==void 0)for(i=n.length-1;i>=0;i--)this.removeListener(t,n[i]);return this};function t9(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?ube(i):r9(i,i.length)}Gt.prototype.listeners=function(t){return t9(this,t,!0)},Gt.prototype.rawListeners=function(t){return t9(this,t,!1)},Gt.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):n9.call(e,t)},Gt.prototype.listenerCount=n9;function n9(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}Gt.prototype.eventNames=function(){return this._eventsCount>0?x_(this._events):[]};function r9(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function cbe(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function ube(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function dbe(e,t){return new Promise(function(n,r){function i(o){e.removeListener(t,a),r(o)}function a(){typeof e.removeListener=="function"&&e.removeListener("error",i),n([].slice.call(arguments))}i9(e,t,a,{once:!0}),t!=="error"&&pbe(e,i,{once:!0})})}function pbe(e,t,n){typeof e.on=="function"&&i9(e,"error",t,n)}function i9(e,t,n,r){if(typeof e.on=="function")r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var hbe=oT.exports,sT={};Object.defineProperty(sT,"__esModule",{value:!0});const mbe=Ng,fbe=Ra;function gbe(e){const t=e.owner.meta.xScale,n=e.owner.meta.yScale,r=(0,mbe.line)().x(function(i){return i[0]}).y(function(i){return i[1]});return function(i){i.each(function(){const o=(0,fbe.select)(this).selectAll("g.annotations").data(function(m){return m.annotations||[]}),s=o.enter().append("g").attr("class","annotations"),l=n.range(),c=t.range(),u=o.merge(s).selectAll("path").data(function(m){return"x"in m?[[[0,l[0]],[0,l[1]]]]:[[[c[0],0],[c[1],0]]]}),d=u.enter().append("path");u.merge(d).attr("stroke","#eee").attr("d",r),u.exit().remove();const p=o.merge(s).selectAll("text").data(function(m){return[{text:m.text||"",hasX:"x"in m}]}),h=p.enter().append("text");p.merge(h).text(function(m){return m.text}).attr("y",function(m){return m.hasX?3:0}).attr("x",function(m){return m.hasX?0:3}).attr("dy",function(m){return m.hasX?5:-5}).attr("text-anchor",function(m){return m.hasX?"end":""}).attr("transform",function(m){return m.hasX?"rotate(-90)":""}),p.exit().remove(),o.merge(s).attr("transform",function(m){return"x"in m?"translate("+t(m.x)+", 0)":"translate(0, "+n(m.y)+")"}),o.exit().remove()})}}sT.default=gbe;var lT={},ta={},Do={};const cT=Sa(zhe);Object.defineProperty(Do,"__esModule",{value:!0}),Do.registerGraphType=void 0;const _be=cT,kh={COLORS:["steelblue","red","#05b378","orange","#4040e8","yellow","brown","magenta","cyan"].map(function(e){return(0,_be.hsl)(e)}),DEFAULT_WIDTH:550,DEFAULT_HEIGHT:350,DEFAULT_ITERATIONS:null,TIP_X_EPS:1,MAX_ITERATIONS:0,graphTypes:{}};kh.MAX_ITERATIONS=kh.DEFAULT_WIDTH*10;function bbe(e,t){if(Object.hasOwn(kh.graphTypes,e))throw new Error(`registerGraphType: graphType ${e} is already registered.`);kh.graphTypes[e]=t}Do.registerGraphType=bbe,Do.default=kh;var ybe=ze&&ze.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ta,"__esModule",{value:!0});const a9=ybe(Do),vbe={linspace:function(e,t,n){const r=(t-e)/(n-1);return Array.from({length:n},(i,a)=>e+r*a)},logspace:function(e,t,n){return this.linspace(e,t,n).map(r=>Math.pow(10,r))},isValidNumber:function(e){return typeof e=="number"&&!isNaN(e)},space:function(e,t,n){const r=t[0],i=t[1];return e.type==="log"?this.logspace(Math.log10(r),Math.log10(i),n):this.linspace(r,i,n)},getterSetter:function(e,t){const n=this;this[t]=function(r){return arguments.length?(e[t]=r,n):e[t]}},sgn:function(e){return e<0?-1:e>0?1:0},clamp:function(e,t,n){return e<t?t:e>n?n:e},color:function(e,t){const n=t%a9.default.COLORS.length;return e.color||a9.default.COLORS[n].hex()},infinity:function(){return 9007199254740991}};ta.default=vbe;var Ii={},uT={exports:{}},Oh={},o9={EOF:0,DELIMITER:1,NUMBER:2,STRING:3,SYMBOL:4},dc=o9,Ebe={n:`
404
404
  `,f:"\f",r:"\r",t:" ",v:"\v","'":"'",'"':'"'},xbe={",":!0,"(":!0,")":!0,"[":!0,"]":!0,";":!0,"~":!0,"!":!0,"+":!0,"-":!0,"*":!0,"/":!0,"%":!0,"^":!0,"**":!0,"|":!0,"&":!0,"^|":!0,"=":!0,":":!0,"?":!0,"||":!0,"&&":!0,xor:!0,"==":!0,"!=":!0,"===":!0,"!==":!0,"<":!0,">":!0,">=":!0,"<=":!0,">>>":!0,"<<":!0,">>":!0};function Ao(e){return e>="0"&&e<="9"}function s9(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"}function Sbe(e){return e===" "||e==="\r"||e===" "||e===`
405
405
  `||e==="\v"||e===" "}function dT(e){return xbe[e]}function Tbe(e){return e==="'"||e==='"'}function Us(){}Us.prototype.throwError=function(e,t){t=typeof t>"u"?this.index:t;var n=new Error(e+" at index "+t);throw n.index=t,n.description=e,n},Us.prototype.lex=function(e){for(this.text=e,this.index=0,this.tokens=[];this.index<this.text.length;){for(;Sbe(this.peek());)this.consume();var t=this.peek(),n=t+this.peek(1),r=n+this.peek(2);dT(r)?(this.tokens.push({type:dc.DELIMITER,value:r}),this.consume(),this.consume(),this.consume()):dT(n)?(this.tokens.push({type:dc.DELIMITER,value:n}),this.consume(),this.consume()):dT(t)?(this.tokens.push({type:dc.DELIMITER,value:t}),this.consume()):Ao(t)||t==="."&&Ao(this.peek(1))?this.tokens.push({type:dc.NUMBER,value:this.readNumber()}):Tbe(t)?this.tokens.push({type:dc.STRING,value:this.readString()}):s9(t)?this.tokens.push({type:dc.SYMBOL,value:this.readIdentifier()}):this.throwError("unexpected character "+t)}return this.tokens.push({type:dc.EOF}),this.tokens},Us.prototype.peek=function(e){if(e=e||0,!(this.index+e>=this.text.length))return this.text.charAt(this.index+e)},Us.prototype.consume=function(){var e=this.peek();return this.index+=1,e},Us.prototype.readNumber=function(){var e="";if(this.peek()===".")e+=this.consume(),Ao(this.peek())||this.throwError("number expected");else{for(;Ao(this.peek());)e+=this.consume();this.peek()==="."&&(e+=this.consume())}for(;Ao(this.peek());)e+=this.consume();if(this.peek()==="e"||this.peek()==="E")for(e+=this.consume(),Ao(this.peek())||this.peek()==="+"||this.peek()==="-"||this.throwError(),(this.peek()==="+"||this.peek()==="-")&&(e+=this.consume()),Ao(this.peek())||this.throwError("number expected");Ao(this.peek());)e+=this.consume();return e},Us.prototype.readIdentifier=function(){for(var e="";s9(this.peek())||Ao(this.peek());)e+=this.consume();return e},Us.prototype.readString=function(){for(var e=this.consume(),t="",n;;){var r=this.consume();if(r||this.throwError("string is not closed"),n){if(r==="u"){var i=this.text.substring(this.index+1,this.index+5);i.match(/[\da-f]{4}/i)||this.throwError("invalid unicode escape"),this.index+=4,t+=String.fromCharCode(parseInt(i,16))}else{var a=Ebe[r];a?t+=a:t+=r}n=!1}else{if(r===e)break;r==="\\"?n=!0:t+=r}}return t};var l9=Us;function c9(){}c9.prototype.type="Node";var La=c9,Cbe=La,wbe={number:!0,string:!0,boolean:!0,undefined:!0,null:!0};function pT(e,t){if(!wbe[t])throw Error("unsupported type '"+t+"'");this.value=e,this.valueType=t}pT.prototype=Object.create(Cbe.prototype),pT.prototype.type="ConstantNode";var u9=pT,Dbe=La;function hT(e,t){this.op=e,this.args=t||[]}hT.prototype=Object.create(Dbe.prototype),hT.prototype.type="OperatorNode";var d9=hT,Abe=La;function mT(e,t){this.op=e,this.argument=t}mT.prototype=Object.create(Abe.prototype),mT.prototype.type="UnaryNode";var p9=mT,Nbe=La;function fT(e){this.name=e}fT.prototype=Object.create(Nbe.prototype),fT.prototype.type="SymbolNode";var h9=fT,kbe=La;function gT(e,t){this.name=e,this.args=t}gT.prototype=Object.create(kbe.prototype),gT.prototype.type="FunctionNode";var m9=gT,Obe=La;function _T(e){this.nodes=e}_T.prototype=Object.create(Obe.prototype),_T.prototype.type="ArrayNode";var f9=_T,Mbe=La;function bT(e,t,n){this.condition=e,this.trueExpr=t,this.falseExpr=n}bT.prototype=Object.create(Mbe.prototype),bT.prototype.type="ConditionalNode";var g9=bT,Ibe=La;function yT(e,t){this.name=e,this.expr=t}yT.prototype=Object.create(Ibe.prototype),yT.prototype.type="AssignmentNode";var _9=yT,Rbe=La;function vT(e){this.blocks=e}vT.prototype=Object.create(Rbe.prototype),vT.prototype.type="BlockNode";var b9=vT,pc=o9,Lbe=l9,ET=u9,li=d9,Pbe=p9,y9=h9,Bbe=m9,Fbe=f9,Ube=g9,zbe=_9,$be=b9;function It(){this.lexer=new Lbe,this.tokens=null}It.prototype.current=function(){return this.tokens[0]},It.prototype.next=function(){return this.tokens[1]},It.prototype.peek=function(){if(this.tokens.length){for(var e=this.tokens[0],t=0;t<arguments.length;t+=1)if(e.value===arguments[t])return!0}},It.prototype.consume=function(e){return this.tokens.shift()},It.prototype.expect=function(e){if(!this.peek(e))throw Error("expected "+e);return this.consume()},It.prototype.isEOF=function(){return this.current().type===pc.EOF},It.prototype.parse=function(e){return this.tokens=this.lexer.lex(e),this.program()},It.prototype.program=function(){for(var e=[];!this.isEOF();)e.push(this.assignment()),this.peek(";")&&this.consume();return this.end(),new $be(e)},It.prototype.assignment=function(){var e=this.ternary();return e instanceof y9&&this.peek("=")?(this.consume(),new zbe(e.name,this.assignment())):e},It.prototype.ternary=function(){var e=this.logicalOR();if(this.peek("?")){this.consume();var t=this.ternary();this.expect(":");var n=this.ternary();return new Ube(e,t,n)}return e},It.prototype.logicalOR=function(){var e=this.logicalXOR();if(this.peek("||")){var t=this.consume(),n=this.logicalOR();return new li(t.value,[e,n])}return e},It.prototype.logicalXOR=function(){var e=this.logicalAND();if(this.current().value==="xor"){var t=this.consume(),n=this.logicalXOR();return new li(t.value,[e,n])}return e},It.prototype.logicalAND=function(){var e=this.bitwiseOR();if(this.peek("&&")){var t=this.consume(),n=this.logicalAND();return new li(t.value,[e,n])}return e},It.prototype.bitwiseOR=function(){var e=this.bitwiseXOR();if(this.peek("|")){var t=this.consume(),n=this.bitwiseOR();return new li(t.value,[e,n])}return e},It.prototype.bitwiseXOR=function(){var e=this.bitwiseAND();if(this.peek("^|")){var t=this.consume(),n=this.bitwiseXOR();return new li(t.value,[e,n])}return e},It.prototype.bitwiseAND=function(){var e=this.relational();if(this.peek("&")){var t=this.consume(),n=this.bitwiseAND();return new li(t.value,[e,n])}return e},It.prototype.relational=function(){var e=this.shift();if(this.peek("==","===","!=","!==",">=","<=",">","<")){var t=this.consume(),n=this.shift();return new li(t.value,[e,n])}return e},It.prototype.shift=function(){var e=this.additive();if(this.peek(">>","<<",">>>")){var t=this.consume(),n=this.shift();return new li(t.value,[e,n])}return e},It.prototype.additive=function(){for(var e=this.multiplicative();this.peek("+","-");){var t=this.consume();e=new li(t.value,[e,this.multiplicative()])}return e},It.prototype.multiplicative=function(){for(var e,t,n=this.unary();this.peek("*","/","%");)e=this.consume(),n=new li(e.value,[n,this.unary()]);return this.current().type===pc.SYMBOL||this.peek("(")||!(n.type instanceof ET)&&this.current().type===pc.NUMBER?(t=this.multiplicative(),new li("*",[n,t])):n},It.prototype.unary=function(){if(this.peek("-","+","~")){var e=this.consume(),t=this.unary();return new Pbe(e.value,t)}return this.pow()},It.prototype.pow=function(){var e=this.factorial();if(this.peek("^","**")){var t=this.consume(),n=this.unary();return new li(t.value,[e,n])}return e},It.prototype.factorial=function(){var e=this.symbol();if(this.peek("!")){var t=this.consume();return new li(t.value,[e])}return e},It.prototype.symbol=function(){var e=this.current();if(e.type===pc.SYMBOL){var t=this.consume(),n=this.functionCall(t);return n}return this.string()},It.prototype.functionCall=function(e){var t=e.value;if(this.peek("(")){this.consume();for(var n=[];!this.peek(")")&&!this.isEOF();)n.push(this.assignment()),this.peek(",")&&this.consume();return this.expect(")"),new Bbe(t,n)}return new y9(t)},It.prototype.string=function(){return this.current().type===pc.STRING?new ET(this.consume().value,"string"):this.array()},It.prototype.array=function(){if(this.peek("[")){this.consume();for(var e=[];!this.peek("]")&&!this.isEOF();)e.push(this.assignment()),this.peek(",")&&this.consume();return this.expect("]"),new Fbe(e)}return this.number()},It.prototype.number=function(){var e=this.current();return e.type===pc.NUMBER?new ET(this.consume().value,"number"):this.parentheses()},It.prototype.parentheses=function(){var e=this.current();if(e.value==="("){this.consume();var t=this.assignment();return this.expect(")"),t}return this.end()},It.prototype.end=function(){var e=this.current();if(e.type!==pc.EOF)throw Error("unexpected end of expression")};var Gbe=It,Hbe={ArrayNode:f9,AssignmentNode:_9,BlockNode:b9,ConditionalNode:g9,ConstantNode:u9,FunctionNode:m9,Node:La,OperatorNode:d9,SymbolNode:h9,UnaryNode:p9};Oh.Lexer=l9,Oh.Parser=Gbe,Oh.nodeTypes=Hbe;var T_=Object.prototype.hasOwnProperty,v9=Object.prototype.toString,E9=Object.defineProperty,x9=Object.getOwnPropertyDescriptor,S9=function(t){return typeof Array.isArray=="function"?Array.isArray(t):v9.call(t)==="[object Array]"},T9=function(t){if(!t||v9.call(t)!=="[object Object]")return!1;var n=T_.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&T_.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||T_.call(t,i)},C9=function(t,n){E9&&n.name==="__proto__"?E9(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},w9=function(t,n){if(n==="__proto__")if(T_.call(t,n)){if(x9)return x9(t,n).value}else return;return t[n]},D9=function e(){var t,n,r,i,a,o,s=arguments[0],l=1,c=arguments.length,u=!1;for(typeof s=="boolean"&&(u=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=w9(s,n),i=w9(t,n),s!==i&&(u&&i&&(T9(i)||(a=S9(i)))?(a?(a=!1,o=r&&S9(r)?r:[]):o=r&&T9(r)?r:{},C9(s,{name:n,newValue:e(u,o,i)})):typeof i<"u"&&C9(s,{name:n,newValue:i}));return s},qbe=function(e){const t=this;let n=[];this.rawify(this.options.rawArrayExpressionElements,function(){n=e.nodes.map(function(i){return t.next(i)})});const r="["+n.join(",")+"]";return this.options.raw?r:this.options.factory+"("+r+")"},Wbe=function(e){return'scope["'+e.name+'"] = '+this.next(e.expr)},Vbe=function(e){const t="!!("+this.next(e.condition)+")",n=this.next(e.trueExpr),r=this.next(e.falseExpr);return"("+t+" ? ("+n+") : ("+r+") )"},Ybe=function(e){return this.options.raw?e.value:this.options.factory+"("+e.value+")"},xT={exports:{}};const Kbe=Oh.nodeTypes.SymbolNode,A9=function(e){return"$$mathCodegen.functionProxy("+this.next(new Kbe(e.name))+', "'+e.name+'")'};xT.exports=function(e){const t=this,n=A9.call(this,e);let r=[];return this.rawify(this.options.rawCallExpressionElements,function(){r=e.args.map(function(i){return t.next(i)})}),n+"("+r.join(", ")+")"},xT.exports.functionProxy=A9;var Qbe=xT.exports,Xbe={"+":"add","-":"sub","*":"mul","/":"div","^":"pow","%":"mod","!":"factorial","|":"bitwiseOR","^|":"bitwiseXOR","&":"bitwiseAND","||":"logicalOR",xor:"logicalXOR","&&":"logicalAND","<":"lessThan",">":"greaterThan","<=":"lessEqualThan",">=":"greaterEqualThan","===":"strictlyEqual","==":"equal","!==":"strictlyNotEqual","!=":"notEqual",">>":"shiftRight","<<":"shiftLeft",">>>":"unsignedRightShift"};const jbe=Xbe;var Zbe=function(e){if(this.options.raw)return["("+this.next(e.args[0]),e.op,this.next(e.args[1])+")"].join(" ");const t=jbe[e.op];if(!t)throw TypeError("unidentified operator");return this.FunctionNode({name:t,args:e.args})},Jbe=function(e){return'$$mathCodegen.getProperty("'+e.name+'", scope, ns)'},e1e={"+":"positive","-":"negative","~":"oneComplement"};const N9=e1e;var t1e=function(e){if(this.options.raw)return e.op+this.next(e.argument);if(!(e.op in N9))throw new SyntaxError(e.op+" not implemented");const t=N9[e.op];return this.FunctionNode({name:t,args:[e.argument]})};const k9=D9,n1e={ArrayNode:qbe,AssignmentNode:Wbe,ConditionalNode:Vbe,ConstantNode:Ybe,FunctionNode:Qbe,OperatorNode:Zbe,SymbolNode:Jbe,UnaryNode:t1e},C_=function(e,t){this.owner=e,this.options=k9({factory:"ns.factory",raw:!1,rawArrayExpressionElements:!0,rawCallExpressionElements:!1,applyFactoryToScope:!1},t)};k9(C_.prototype,n1e),C_.prototype.next=function(e){if(!(e.type in this))throw new TypeError("the node type "+e.type+" is not implemented");return this[e.type](e)},C_.prototype.rawify=function(e,t){const n=this.options.raw;e&&(this.options.raw=!0),t(),e&&(this.options.raw=n)};var r1e=C_;const i1e=Oh.Parser,a1e=r1e,o1e=D9;function w_(e,t){this.statements=[],this.defs=t||{},this.interpreter=new a1e(this,e)}w_.prototype.setDefs=function(e){return this.defs=o1e(this.defs,e),this},w_.prototype.compile=function(e){const t=this;if(!e||!(typeof e=="object"||typeof e=="function"))throw TypeError("namespace must be an object");if(typeof e.factory!="function")throw TypeError("namespace.factory must be a function");this.defs.ns=e,this.defs.$$mathCodegen={getProperty:function(o,s,l){function c(u){return t.interpreter.options.applyFactoryToScope&&typeof u!="function"?l.factory(u):u}if(o in s)return c(s[o]);if(o in l)return c(l[o]);throw SyntaxError('symbol "'+o+'" is undefined')},functionProxy:function(o,s){if(typeof o!="function")throw SyntaxError('symbol "'+s+'" must be a function');return o}},this.defs.$$processScope=this.defs.$$processScope||function(){};const n=Object.keys(this.defs).map(function(o){return"var "+o+' = defs["'+o+'"]'});if(!this.statements.length)throw Error("there are no statements saved in this generator, make sure you parse an expression before compiling it");this.statements[this.statements.length-1]="return "+this.statements[this.statements.length-1];const r=this.statements.join(";"),i=n.join(`