You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Shixuns__Edit__body__Lev...

3419 lines
1.5 MiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

!(function(){var Il=Math.pow;var gu=(mn,Ut,ue)=>new Promise((be,tt)=>{var Fe=Ce=>{try{ye(ue.next(Ce))}catch(Me){tt(Me)}},qe=Ce=>{try{ye(ue.throw(Ce))}catch(Me){tt(Me)}},ye=Ce=>Ce.done?be(Ce.value):Promise.resolve(Ce.value).then(Fe,qe);ye((ue=ue.apply(mn,Ut)).next())});(self.webpackChunk=self.webpackChunk||[]).push([[21423],{18299:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return Me}});var be=ue(87462),tt=ue(67294),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},qe=Fe,ye=ue(84089),Ce=function(he,De){return tt.createElement(ye.Z,(0,be.Z)({},he,{ref:De,icon:qe}))},Me=tt.forwardRef(Ce)},42922:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return Me}});var be=ue(87462),tt=ue(67294),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},qe=Fe,ye=ue(84089),Ce=function(he,De){return tt.createElement(ye.Z,(0,be.Z)({},he,{ref:De,icon:qe}))},Me=tt.forwardRef(Ce)},25877:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return Me}});var be=ue(87462),tt=ue(67294),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},qe=Fe,ye=ue(84089),Ce=function(he,De){return tt.createElement(ye.Z,(0,be.Z)({},he,{ref:De,icon:qe}))},Me=tt.forwardRef(Ce)},63237:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return Me}});var be=ue(87462),tt=ue(67294),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},qe=Fe,ye=ue(84089),Ce=function(he,De){return tt.createElement(ye.Z,(0,be.Z)({},he,{ref:De,icon:qe}))},Me=tt.forwardRef(Ce)},99569:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return Me}});var be=ue(87462),tt=ue(67294),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},qe=Fe,ye=ue(84089),Ce=function(he,De){return tt.createElement(ye.Z,(0,be.Z)({},he,{ref:De,icon:qe}))},Me=tt.forwardRef(Ce)},38308:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return Me}});var be=ue(87462),tt=ue(67294),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},qe=Fe,ye=ue(84089),Ce=function(he,De){return tt.createElement(ye.Z,(0,be.Z)({},he,{ref:De,icon:qe}))},Me=tt.forwardRef(Ce)},17663:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return Me}});var be=ue(87462),tt=ue(67294),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},qe=Fe,ye=ue(84089),Ce=function(he,De){return tt.createElement(ye.Z,(0,be.Z)({},he,{ref:De,icon:qe}))},Me=tt.forwardRef(Ce)},72395:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return Me}});var be=ue(87462),tt=ue(67294),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},qe=Fe,ye=ue(84089),Ce=function(he,De){return tt.createElement(ye.Z,(0,be.Z)({},he,{ref:De,icon:qe}))},Me=tt.forwardRef(Ce)},53978:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return Me}});var be=ue(87462),tt=ue(67294),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},qe=Fe,ye=ue(84089),Ce=function(he,De){return tt.createElement(ye.Z,(0,be.Z)({},he,{ref:De,icon:qe}))},Me=tt.forwardRef(Ce)},71749:function(){"use strict"},30483:function(){"use strict"},71736:function(mn,Ut){"use strict";Ut.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},61016:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(){if(typeof window.GGBApplet=="function"){console.warn("deployggb.js was loaded twice");return}var isRenderGGBElementEnabled=!1,scriptLoadStarted=!1,html5AppletsToProcess=null,ggbHTML5LoadedCodebaseIsWebSimple=!1,ggbHTML5LoadedCodebaseVersion=null,ggbHTML5LoadedScript=null,GGBApplet=function(){"use strict";for(var mn={},Ut="5.0",ue={},be=null,tt=!1,Fe=!1,qe=null,ye=!1,Ce=null,Me=null,we=0;we<arguments.length;we++){var he=arguments[we];if(he!==null)switch(typeof he){case"number":Ut=he.toFixed(1);break;case"string":he.match(new RegExp("^[0-9]\\.[0-9]+$"))?Ut=he:qe=he;break;case"object":typeof he.is3D!="undefined"?be=he:ue=he;break;case"boolean":tt=he,Fe=!0;break}}be===null&&(be={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},ue.material_id!==void 0&&!Fe&&(tt=!0)),qe!==null&&ue.id===void 0&&(ue.id=qe);var De="",ct="",Ne=!1,Mt=null,ut=null,Qe=null,Xe=!1,Te=null,Et=null,Lt=null,et=null,lt=null;ue.height!==void 0&&(ue.height=Math.round(ue.height)),ue.width!==void 0&&(ue.width=Math.round(ue.width));var Ie=function(Je){return parseFloat(Je)>4?parseFloat(Je):5};mn.setHTML5Codebase=function(Je,rt){Me=Je,Tt(Je,rt)},mn.setJavaCodebase=mn.setJavaCodebaseVersion=mn.isCompiledInstalled=mn.setPreCompiledScriptPath=mn.setPreCompiledResourcePath=function(){},mn.setHTML5CodebaseVersion=function(Je,rt){var Ht=parseFloat(Je);if(Ht!==NaN&&Ht<5){console.log("The GeoGebra HTML5 codebase version "+Ht+" is deprecated. Using version latest instead.");return}Ce=Je,Ee(Je,rt)},mn.getHTML5CodebaseVersion=function(){return ut},mn.getParameters=function(){return ue},mn.setFontsCSSURL=function(Je){et=Je},mn.setGiacJSURL=function(Je){},mn.setJNLPFile=function(Je){De=Je},mn.setJNLPBaseDir=function(Je){},mn.inject=function(){function Je(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var rt="auto",Ht=ue.id,Sn,sn=!1,$t=0;$t<arguments.length;$t++){var Bt=arguments[$t];typeof Bt=="string"?(Bt=Bt.toLowerCase(),Bt.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?rt=Bt:Ht=arguments[$t]):typeof Bt=="boolean"?sn=Bt:Bt instanceof HTMLElement&&(Sn=Bt)}bn();function bn(){if(!ye){setTimeout(bn,200);return}rt=Zn(rt);var dn=Sn||document.getElementById(Ht);if(!dn){console.log("possibly bug on ajax loading? ");return}if(mn.removeExistingApplet(dn,!1),ue.width===void 0&&dn.clientWidth&&(ue.width=dn.clientWidth),ue.height===void 0&&dn.clientHeight&&(ue.height=dn.clientHeight),!(ue.width&&ue.height)&&rt==="html5"&&(delete ue.width,delete ue.height),Mt=rt,rt==="screenshot")kt(dn,ue);else{var ke=!1;ue.hasOwnProperty("playButton")&&ue.playButton||ue.hasOwnProperty("clickToLoad")&&ue.clickToLoad?ke=!0:ue.hasOwnProperty("playButtonAutoDecide")&&ue.playButtonAutoDecide&&(ke=(!_e()||Je())&&Ue()),ke?(Mt="screenshot",qt(dn,ue,sn,rt)):Ot(dn,ue,sn)}}};function _e(){try{return window.self!==window.top}catch(Je){return!0}}function Ue(){return ue.hasOwnProperty("screenshotGenerator")&&ue.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}mn.getViews=function(){return be},mn.isJavaInstalled=function(){return!1};var Ze=function(Je){var rt=function($t){var Bt=JSON.parse($t),bn=function(ce){return ce.type=="G"||ce.type=="E"},dn=Bt.elements?Bt.elements.filter(bn)[0]:Bt;if(!dn||!dn.url){Ht();return}ue.fileName=dn.url,At(dn.settings||{}),be.is3D=!0;var ke="https://www.geogebra.org/images/";mn.setPreviewImage(Te||dn.previewUrl,ke+"GeoGebra_loading.png",ke+"applet_play.png"),Je()},Ht=function(){ue.onError&&ue.onError(),gn("Error: Fetching material (id "+ue.material_id+") failed.",ue)},Sn=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",sn="/materials/"+ue.material_id+"?scope=basic";bt("https://"+Sn+"/api/proxy.php?path="+encodeURIComponent(sn),rt,Ht)};function At(Je){var rt=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(Ht){Je[Ht]=!!Je[Ht]}),rt.forEach(function(Ht){ue[Ht]===void 0&&Je[Ht]!==void 0&&(ue[Ht]=Je[Ht])}),ue.showToolBarHelp===void 0&&(ue.showToolBarHelp=ue.showToolBar)}function bt(Je,rt,Ht){var Sn=new XMLHttpRequest;Sn.open("GET",Je),Sn.onload=function(){rt(Sn.responseText)},Sn.onerror=Ht,Sn.send()}mn.isHTML5Installed=function(){return!0},mn.getLoadedAppletType=function(){return Mt},mn.setPreviewImage=function(Je,rt,Ht){Te=Je,Et=rt,Lt=Ht},mn.removeExistingApplet=function(Je,rt){var Ht;typeof Je=="string"&&(Je=document.getElementById(Je)),Mt=null;var Sn=null;for(Ht=0;Ht<Je.childNodes.length;Ht++){var sn=Je.childNodes[Ht],$t=sn.className;$t==="applet_screenshot"?rt?(sn.style.display="block",Mt="screenshot"):sn.style.display="none":$t!=="applet_scaler prerender"&&(Je.removeChild(sn),Sn=$t&&$t.indexOf("appletParameters")!=-1?sn.id:null,Ht--)}var Bt=ue.id!==void 0?ue.id:Sn,bn=window[Bt];bn&&typeof bn.getBase64=="function"&&(bn.remove(),window[Bt]=null)},mn.refreshHitPoints=function(){if(Ie(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var Je=mn.getAppletObject();return Je&&typeof Je.recalculateEnvironments=="function"?(Je.recalculateEnvironments(),!0):!1},mn.startAnimation=function(){var Je=mn.getAppletObject();return Je&&typeof Je.startAnimation=="function"?(Je.startAnimation(),!0):!1},mn.stopAnimation=function(){var Je=mn.getAppletObject();return Je&&typeof Je.stopAnimation=="function"?(Je.stopAnimation(),!0):!1},mn.getAppletObject=function(){var Je=ue.id!==void 0?ue.id:"ggbApplet";return window[Je]},mn.resize=function(){};var xt=function(Je,rt,Ht){var Sn=document.createElement("param");Sn.setAttribute("name",rt),Sn.setAttribute("value",Ht),Je.appendChild(Sn)},Ge=function(Je){return Je&&Je!=="false"},Ot=function(Je,rt,Ht){Ie(ut)<=4.2&&(Ht=!0);var Sn=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==ut||ggbHTML5LoadedCodebaseIsWebSimple&&!Xe)&&(Sn=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var sn=document.createElement("div");sn.classList.add("appletParameters","notranslate");var $t=rt.width,Bt=rt.height;if(rt.disableAutoScale=rt.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():rt.disableAutoScale,rt.width!==void 0)if(Ie(ut)<=4.4)Ge(rt.showToolBar)&&(rt.height-=7),Ge(rt.showAlgebraInput)&&(rt.height-=37),rt.width<605&&Ge(rt.showToolBar)&&(rt.width=605,$t=605);else{var bn=100;(Ge(rt.showToolBar)||Ge(rt.showMenuBar))&&(rt.hasOwnProperty("customToolBar")&&(rt.customToolbar=rt.customToolBar),bn=Ge(rt.showMenuBar)?245:155),$t<bn&&(rt.width=bn,$t=bn)}sn.style.border="none",sn.style.display="inline-block";for(var dn in rt)rt.hasOwnProperty(dn)&&dn!=="appletOnLoad"&&sn.setAttribute("data-param-"+dn,rt[dn]);et&&sn.setAttribute("data-param-fontscssurl",et),mn.resize=function(){GGBAppletUtils.responsiveResize(Je,rt)},window.addEventListener("resize",function(Jt){mn.resize()});var ke=typeof rt.appletOnLoad=="function"?rt.appletOnLoad:function(){};if(!Ht&&rt.width!==void 0){rt.hasOwnProperty("showSplash")||sn.setAttribute("data-param-showSplash","false");var ce=Je.querySelector(".applet_scaler.prerender"),le=ce!==null;if(le)var ve=ce.querySelector(".ggb_preview");else{var ve=An($t,Bt,rt.borderColor,!1);ce=document.createElement("div"),ce.className="applet_scaler",ce.style.position="relative",ce.style.display="block",ce.style.width=$t+"px",ce.style.height=Bt+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(ce,"66%"),Ie(ut)>=5?(rt.appletOnLoad=function(Jt){var Cr=Je.querySelector(".ggb_preview");Cr&&Cr.parentNode.removeChild(Cr),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(ce),window.GGBT_wsf_view&&$(window).trigger("resize"),ke(Jt)},le||ce.appendChild(ve)):sn.appendChild(ve),ce.appendChild(sn),le||Je.appendChild(ce),setTimeout(function(){mn.resize()},1)}else{var pe=document.createElement("div");pe.className="applet_scaler",pe.style.position="relative",pe.style.display="block",pe.appendChild(sn),Je.appendChild(pe),rt.appletOnLoad=function(Jt){mn.resize(),ke(Jt)}}function oe(Jt,Cr){Cr&&typeof Cr.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(Jt,Cr.appletOnLoad):renderGGBElement(Jt),gn("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",Cr)}function ze(Jt,Cr){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:Jt,params:Cr}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(Tr){oe(Tr.article,Tr.params)}),html5AppletsToProcess=null)},Ie(ut)<5&&(Jt.className+=" geogebraweb")):oe(Jt,Cr)}if(Sn){scriptLoadStarted=!0;for(var yt=0;yt<sn.childNodes.length;yt++){var Vt=sn.childNodes[yt].tagName;Vt==="TABLE"&&(sn.removeChild(sn.childNodes[yt]),yt--)}if(ggbHTML5LoadedScript!==null){var en=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');en!=null&&en.parentNode.removeChild(en)}var un=document.createElement("script"),yn=function(){ze(sn,rt)};un.src=ct+Qe,ggbHTML5LoadedCodebaseIsWebSimple=Xe,ggbHTML5LoadedCodebaseVersion=ut,ggbHTML5LoadedScript=un.src,gn("GeoGebra HTML5 codebase loaded: '"+ct+"'.",rt),!Me&&(!Ce||Ce=="5.0")?(Xe?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),yn()):ct.requirejs?__webpack_require__.e(12).then(function(){var Jt=[__webpack_require__(12)];yn.apply(null,Jt)}.bind(this)).catch(__webpack_require__.oe):(un.onload=yn,Je.appendChild(un))}else ze(sn,rt);rt.height=Bt,rt.width=$t},kt=function(Je,rt,Ht){var Sn=An(rt.width,rt.height,rt.borderColor,Ht),sn=document.createElement("div");sn.style.position="relative",sn.style.display="block",sn.style.width=rt.width+"px",sn.style.height=rt.height+"px",sn.className="applet_screenshot applet_scaler"+(Ht?" applet_screenshot_play":""),sn.appendChild(Sn);var $t=GGBAppletUtils.getScale(rt,Je,Ht);Ht?(Je.appendChild(cn()),window.GGBT_wsf_view||(Je.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(sn,"66%"),Je.appendChild(sn),$t!==1&&!isNaN($t)&&(GGBAppletUtils.scaleElement(sn,$t),sn.style.width=rt.width+"px",sn.style.height=rt.height+"px",sn.parentNode.style.width=rt.width*$t+"px",sn.parentNode.style.height=rt.height*$t+"px"),mn.resize=function(){vn(Je,Sn,sn,Ht)},window.addEventListener("resize",function(Bt){mn.resize()}),mn.resize()};function vn(Je,rt,Ht,Sn){if(Je.contains(rt)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Je.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(Je)}var sn=GGBAppletUtils.getScale(ue,Je,Sn);Ht.parentNode!==null&&(!isNaN(sn)&&sn!==1?(GGBAppletUtils.scaleElement(Ht,sn),Ht.parentNode.style.width=ue.width*sn+"px",Ht.parentNode.style.height=ue.height*sn+"px"):(GGBAppletUtils.scaleElement(Ht,1),Ht.parentNode.style.width=ue.width+"px",Ht.parentNode.style.height=ue.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(Je),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}mn.onExitFullscreen=function(Je,rt){rt.appendChild(Je)};var qt=function(Je,rt,Ht,Sn){kt(Je,rt,!0);for(var sn=function(){var bn=[];for(Bt=0;Bt<Je.childNodes.length;Bt++)bn.push(Je.childNodes[Bt]);if(window.GGBT_wsf_view){var dn=window.GGBT_wsf_view.renderFullScreen(Je,rt.id),ke=document.getElementById("fullscreencontainer"),ce=jQuery(Je).find(".fullscreencontent");ce.length>0?(dn.remove(),ce.attr("id","fullscreencontent").show(),jQuery(ke).append(ce),window.dispatchEvent(new Event("resize"))):Ot(dn,rt,!1),window.GGBT_wsf_view.launchFullScreen(ke)}else Mt=Sn,Ot(Je,rt,!1);if(!window.GGBT_wsf_view)for(Bt=0;Bt<bn.length;Bt++)Je.removeChild(bn[Bt])},$t=Je.getElementsByClassName("ggb_preview_play"),Bt=0;Bt<$t.length;Bt++)$t[Bt].addEventListener("click",sn,!1),$t[Bt].addEventListener("ontouchstart",sn,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(Je),Ue()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},cn=function(){var Je=document.createElement("div");if(Je.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var rt='.icon-applet-play { width: 100%; height: 100%;box-sizing: border-box;position: absolute;z-index: 1001;cursor: pointer;border-width: 0px; background-color: transparent;background-repeat: no-repeat;left: 0;top: 0;background-position: center center; background-image: url("https://www.geogebra.org/images/worksheet/icon-start-applet.png");}.icon-applet-play:hover {background-image: url("https://www.geogebra.org/images/worksheet/icon-start-applet-hover.png");}',Ht=document.createElement("style");Ht.styleSheet?Ht.styleSheet.cssText=rt:Ht.appendChild(document.createTextNode(rt)),document.getElementsByTagName("head")[0].appendChild(Ht)}return Je},An=function(Je,rt,Ht,Sn){var sn=document.createElement("div");sn.className="ggb_preview",sn.style.position="absolute",sn.style.zIndex="90",sn.style.width=Je-2+"px",sn.style.height=rt-2+"px",sn.style.top="0px",sn.style.left="0px",sn.style.overflow="hidden",sn.style.backgroundColor="white";var $t="lightgrey";Ht!==void 0&&(Ht==="none"?$t="transparent":$t=Ht),sn.style.border="1px solid "+$t;var Bt=document.createElement("img");if(Bt.style.position="relative",Bt.style.zIndex="1000",Bt.style.top="-1px",Bt.style.left="-1px",Te!==null&&Bt.setAttribute("src",Te),Bt.style.opacity=.7,Et!==null){var bn,dn,ke;if(!Sn){bn=document.createElement("img"),bn.style.position="absolute",bn.style.zIndex="1001",bn.style.opacity=1,Bt.style.opacity=.3,dn=360,dn>Je/4*3&&(dn=Je/4*3),ke=dn/5.8,bn.setAttribute("src",Et),bn.setAttribute("width",dn),bn.setAttribute("height",ke);var ce=(Je-dn)/2,le=(rt-ke)/2;bn.style.left=ce+"px",bn.style.top=le+"px",sn.appendChild(bn)}}return sn.appendChild(Bt),sn},Zn=function(Je){return Je=Je.toLowerCase(),Je==="html5"||Je==="screenshot"?Je:"html5"},Ye=["web","webSimple","web3d","tablet","tablet3d","phone"],Ee=function(Je,rt){if(ut=Je,rt){Tt(ut,!0);return}var Ht=!tt;if(Ht){var Sn=Ie(ut);!isNaN(Sn)&&Sn<4.4&&(Ht=!1)}var sn,$t;window.location.protocol.substr(0,4)==="http"?sn=window.location.protocol:sn="http:";var Bt=ut.indexOf("//");Bt>0?$t=ut:Bt===0?$t=sn+ut:$t="https://www.geogebra.org/apps/5.2.814.0/";for(var bn in Ye)if(ut.slice(Ye[bn].length*-1)===Ye[bn]||ut.slice((Ye[bn].length+1)*-1)===Ye[bn]+"/"){Tt($t,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&Ht&&!be.is3D&&!be.AV&&!be.SV&&!be.CV&&!be.EV2&&!be.CP&&!be.PC&&!be.DA&&!be.FI&&!be.PV&&!Ge(ue.showToolBar)&&!Ge(ue.showMenuBar)&&!Ge(ue.showAlgebraInput)&&!Ge(ue.enableRightClick)&&(!ue.appName||ue.appName=="classic")?$t+="webSimple/":$t+="web3d/",Tt($t,!1)},Tt=function(Je,rt){if(Je.requirejs){ct=Je;return}Je.slice(-1)!=="/"&&(Je+="/"),ct=Je,rt===null&&(rt=Je.indexOf("http")===-1),Ne=rt,Qe="web.nocache.js",Xe=!1;var Ht=ct.split("/");Ht.length>1&&(!rt&&Ht[Ht.length-2]==="webSimple"?(Qe="webSimple.nocache.js",Xe=!0):Ye.indexOf(Ht[Ht.length-2])>=0&&(Qe=Ht[Ht.length-2]+".nocache.js")),Ht=Je.split("/"),ut=Ht[Ht.length-3],ut.substr(0,4)==="test"?ut=ut.substr(4,1)+"."+ut.substr(5,1):(ut.substr(0,3)==="war"||ut.substr(0,4)==="beta")&&(ut="5.0");var Sn=parseFloat(ut);Sn!==NaN&&Sn<5&&Je.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+Sn+" is deprecated. Using version latest instead."),Ee("5.0",rt))},gn=function(Je,rt){window.console&&window.console.log&&(!rt||typeof rt.showLogging=="undefined"||rt.showLogging&&rt.showLogging!=="false")&&console.log(Je)};ue.material_id!==void 0?Ze(Xt):Xt();function Xt(){var Je=Ut;Ce!==null?Je=Ce:parseFloat(Je)<5&&(Je="5.0"),Ee(Je,!1),Me!==null&&Tt(Me,Ne),ye=!0}return mn},GGBAppletUtils=function(){"use strict";function mn(){return window.GGBT_wsf_edit!==void 0}function Ut(ye,Ce){Ce!=1?(ye.style.transformOrigin="0% 0% 0px",ye.style.webkitTransformOrigin="0% 0% 0px",ye.style.transform="scale("+Ce+","+Ce+")",ye.style.webkitTransform="scale("+Ce+","+Ce+")",ye.style.maxWidth="initial",ye.querySelector(".ggb_preview")!==null&&(ye.querySelector(".ggb_preview").style.maxWidth="initial"),ye.querySelectorAll(".ggb_preview img")[0]!==void 0&&(ye.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),ye.querySelectorAll(".ggb_preview img")[1]!==void 0&&(ye.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(ye.style.transform="none",ye.style.webkitTransform="none")}function ue(ye,Ce,Me,we,he,De){var ct=null;if(De!=null&&De!="")for(var Ne=ye.parentNode;Ne!=null;)if((" "+Ne.className+" ").indexOf(" "+De+" ")>-1){ct=Ne;break}else Ne=Ne.parentNode;var Mt=0,ut=0,Qe=0,Xe=0,Te=0,Et=0,Lt=0;if(ct)Mt=ct.offsetWidth,ut=Math.max(we?ct.offsetWidth:0,ct.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(Mt=Math.min(window.innerWidth,document.documentElement.clientWidth),ut=Math.min(window.innerHeight,document.documentElement.clientHeight),Qe=Mt):(Mt=window.innerWidth,ut=window.innerHeight,Qe=window.innerWidth),ye){var et=ye.getBoundingClientRect();et.left>0&&et.left<=Mt&&(he===void 0||!he)&&(document.dir==="rtl"?(Te=Mt-et.width-et.left,Et=Qe<=480?10:30):(Et=et.left,Te=Qe<=480?10:30),Xe=Et+Te)}if(ye&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var lt=ye.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(Xe=40,Lt=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(Xe=0,Lt=40)}}return ye&&((Me===void 0||!Me)&&Ce>0&&Ce+Xe<Mt?Mt=Ce:Mt-=Xe,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Me===void 0||!Me)&&(ut-=Lt)),{width:Mt,height:ut}}function be(ye,Ce,Me,we,he){if(ye.isScreenshoGenerator)return 1;var De=we!==void 0&&we,ct=ye.noScaleMargin!=null&&ye.noScaleMargin,Ne=function(lt){return lt&&lt!=="false"},Mt=Ne(ye.autoHeight),ut=ue(Ce,ye.width,Me,Mt,De&&window.GGBT_wsf_view||ct,he),Qe=parseInt(ut.width),Xe=ye.width,Te=ye.height;if(Xe===void 0){var Et=Ce.querySelector(".appletParameters");Et&&(Xe=Et.offsetWidth,Te=Et.offsetHeight)}var Lt=Qe/Xe,et=De?1:ut.height/Te;return Me!==void 0&&!Me&&(Lt=Math.min(1,Lt),et=Math.min(1,et)),Math.min(Lt,et)}function tt(ye,Ce,Me){var we=1,he,De=!1;if(ye.hasOwnProperty("allowUpscale")&&(De=ye.allowUpscale),ye.hasOwnProperty("scale")&&(we=parseFloat(ye.scale),(isNaN(we)||we===null||we===0)&&(we=1),we>1&&(De=!0)),Ce&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(De=!0),!(ye.hasOwnProperty("disableAutoScale")&&ye.disableAutoScale))he=be(ye,Ce,De,Me,ye.scaleContainerClass);else return we;return De&&(!ye.hasOwnProperty("scale")||we===1)?he:Math.min(we,he)}function Fe(ye){var Ce=Math.min(window.innerWidth,document.documentElement.clientWidth),Me=Math.min(window.innerHeight,document.documentElement.clientHeight),we=ye.getBoundingClientRect(),he=(Ce-we.width)/2,De=(Me-we.height)/2;De<0&&(De=0),ye.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(he<40?ye.style.left="40px":ye.style.left=he+"px",ye.style.top=De+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(De<40?ye.style.top="40px":ye.style.top=De+"px",ye.style.left=he+"px")}function qe(ye,Ce){var Me=ye.querySelector(".appletParameters");if(Me){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Ce.id!==Me.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(ye)}if(Me.parentElement&&/fullscreen/.test(Me.parentElement.className))return;var we=tt(Ce,ye);mn()&&Me.setAttribute("data-param-scale",we);for(var he=null,De=0;De<ye.childNodes.length;De++)if(ye.childNodes[De].className!==void 0&&ye.childNodes[De].className.match(/^applet_scaler/)){he=ye.childNodes[De];break}if(he!==null&&he.querySelector(".noscale")!==null)return;var ct=Ce.id!==void 0?Ce.id:"ggbApplet",Ne=window[ct];(Ne==null||!Ne.recalculateEnvironments)&&he!==null&&!he.className.match(/fullscreen/)&&(he.parentNode.style.transform="",!isNaN(we)&&we!==1?(he.parentNode.style.width=Ce.width*we+"px",he.parentNode.style.height=Ce.height*we+"px",Ut(he,we)):(Ut(he,1),he.parentNode.style.width=Ce.width+"px",he.parentNode.style.height=Ce.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&Fe(ye),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(Me).parents(".content-added-content"))}}return{responsiveResize:qe,isFlexibleWorksheetEditor:mn,positionCenter:Fe,getScale:tt,scaleElement:Ut}}();__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return GGBApplet}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),__WEBPACK_AMD_DEFINE_RESULT__!==void 0&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__),GGBAppletUtils.makeModule=function(name,permutation){function webModule(){var H="bootstrap",I="begin",J="gwt.codesvr."+name+"=",K="gwt.codesvr=",L=name,M="startup",N="DUMMY",O=0,P=1,Q="iframe",R="position:absolute; width:0; height:0; border:none; left: -1000px;",S=" top: -1000px;",T="Chrome",U="CSS1Compat",V="<!doctype html>",W="",X="<html><head></head><body></body></html>",Y="undefined",Z="readystatechange",$=10,_="script",ab="javascript",bb="Failed to load ",cb="moduleStartup",db="scriptTagAdded",eb="moduleRequested",fb="meta",gb="name",hb=name+"::",ib="::",jb="gwt:property",kb="content",lb="=",mb="gwt:onPropertyErrorFn",nb='Bad handler "',ob='" for "gwt:onPropertyErrorFn"',pb="gwt:onLoadErrorFn",qb='" for "gwt:onLoadErrorFn"',rb="#",sb="?",tb="/",ub="img",vb="clear.cache.gif",wb="baseUrl",xb=name+".nocache.js",yb="base",zb="//",Ab="selectingPermutation",Bb=name+".devmode.js",Cb=permutation,Db=":",Eb=".cache.js",Fb="loadExternalRefs",Gb="end",n=window,o=document;function p(){var mn=n.location.search;return mn.indexOf(J)!=-1||mn.indexOf(K)!=-1}function q(mn,Ut){}webModule.__sendStats=q,webModule.__moduleName=L,webModule.__errFn=null,webModule.__moduleBase=N,webModule.__softPermutationId=O,webModule.__computePropValue=null,webModule.__getPropMap=null,webModule.__installRunAsyncCode=function(){},webModule.__gwtStartLoadingFragment=function(){return null},webModule.__gwt_isKnownPropertyValue=function(){return!1},webModule.__gwt_getMetaProperty=function(){return null};var r=null,s=n.__gwt_activeModules=n.__gwt_activeModules||{};s[L]={moduleName:L},webModule.__moduleStartupDone=function(mn){var Ut=s[L].bindings;s[L].bindings=function(){for(var ue=Ut?Ut():{},be=mn[webModule.__softPermutationId],tt=O;tt<be.length;tt++){var Fe=be[tt];ue[Fe[O]]=Fe[P]}return ue}};var t;function u(){return v(),t}function v(){if(!t){var mn=o.createElement(Q);if(mn.id=L,mn.style.cssText=R+S,mn.tabIndex=-1,o.body.appendChild(mn),t=mn.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var Ut=document.compatMode==U?V:W;t.write(Ut+X),t.close()}}}function w(mn){function Ut(be){function tt(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var Fe=tt();if(Fe){be();return}function qe(){if(!Fe){if(!tt())return;Fe=!0,be(),o.removeEventListener&&o.removeEventListener(Z,qe,!1),ye&&clearInterval(ye)}}o.addEventListener&&o.addEventListener(Z,qe,!1);var ye=setInterval(function(){qe()},$)}function ue(be){var tt=u(),Fe=tt.body,qe=tt.createElement(_);qe.language=ab,qe.crossOrigin=W,qe.src=be,webModule.__errFn&&(qe.onerror=function(){webModule.__errFn(L,new Error(bb+be))}),Fe.appendChild(qe)}Ut(function(){ue(mn)})}webModule.__startLoadingFragment=function(mn){return C(mn)},webModule.__installRunAsyncCode=function(mn){var Ut=u(),ue=Ut.body,be=Ut.createElement(_);be.language=ab,be.text=mn,ue.appendChild(be),ue.removeChild(be)};function A(){for(var c={},d,e,f=o.getElementsByTagName(fb),g=O,h=f.length;g<h;++g){var i=f[g],j=i.getAttribute(gb),k;if(j){if(j=j.replace(hb,W),j.indexOf(ib)>=O)continue;if(j==jb){if(k=i.getAttribute(kb),k){var l,m=k.indexOf(lb);m>=O?(j=k.substring(O,m),l=k.substring(m+P)):(j=k,l=W),c[j]=l}}else if(j==mb){if(k=i.getAttribute(kb),k)try{d=eval(k)}catch(mn){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(mn){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(mn){var Ut=c[mn];return Ut==null?null:Ut},r=d,webModule.__errFn=e}function B(){function mn(ye){var Ce=ye.lastIndexOf(rb);Ce==-1&&(Ce=ye.length);var Me=ye.indexOf(sb);Me==-1&&(Me=ye.length);var we=ye.lastIndexOf(tb,Math.min(Me,Ce));return we>=O?ye.substring(O,we+P):W}function Ut(ye){if(!ye.match(/^\w+:\/\//)){var Ce=o.createElement(ub);Ce.src=ye+vb,ye=mn(Ce.src)}return ye}function ue(){var ye=__gwt_getMetaProperty(wb);return ye!=null?ye:W}function be(){for(var ye=o.getElementsByTagName(_),Ce=O;Ce<ye.length;++Ce)if(ye[Ce].src.indexOf(xb)!=-1)return mn(ye[Ce].src);return W}function tt(){var ye=o.getElementsByTagName(yb);return ye.length>O?ye[ye.length-P].href:W}function Fe(){var ye=o.location;return ye.href==ye.protocol+zb+ye.host+ye.pathname+ye.search+ye.hash}var qe=ue();return qe==W&&(qe=be()),qe==W&&(qe=tt()),qe==W&&Fe()&&(qe=mn(o.location.href)),qe=Ut(qe),qe}function C(mn){return mn.match(/^\//)||mn.match(/^[a-zA-Z]+:\/\//)?mn:webModule.__moduleBase+mn}function D(){var mn=[],Ut=O,ue=[],be=[];function tt(ye){var Ce=be[ye](),Me=ue[ye];if(Ce in Me)return Ce;var we=[];for(var he in Me)we[Me[he]]=he;throw r&&r(ye,we,Ce),null}if(__gwt_isKnownPropertyValue=function(ye,Ce){return Ce in ue[ye]},webModule.__getPropMap=function(){var ye={};for(var Ce in ue)ue.hasOwnProperty(Ce)&&(ye[Ce]=tt(Ce));return ye},webModule.__computePropValue=tt,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var Fe;try{Fe=Cb;var qe=Fe.indexOf(Db);qe!=-1&&(Ut=parseInt(Fe.substring(qe+P),$),Fe=Fe.substring(O,qe))}catch(ye){}return webModule.__softPermutationId=Ut,C(Fe+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}A(),webModule.__moduleBase=window.ENV==="build"?"/react/build/js/mathematicalGraphics/"+name+"/":"/js/mathematicalGraphics/"+name+"/",s[L].moduleBase=webModule.__moduleBase;var G=D();return F(),w(G),!0}return webModule},typeof window.web3d!="function"&&(window.web3d=GGBAppletUtils.makeModule("web3d","A18F540516513B1292CA7CEF2F6AFC7E")),typeof window.webSimple!="function"&&(window.webSimple=GGBAppletUtils.makeModule("webSimple","96B09BF1B436BF53F0DF54116700F16A")),window.GGBApplet=GGBApplet})()},15476:function(mn,Ut,ue){"use strict";ue.d(Ut,{Ax:function(){return qe},Ds:function(){return ye},KI:function(){return Me},SI:function(){return Fe},f1:function(){return tt}});var be=ue(11320);function tt(we){let he=!0;if(we.length>0){for(let De=0;De<we.length;De++)if(we[De].compile_success==0||!we[De].compile_success){he=!1;break}}else he=!1;return he}function Fe(we,he=""){let De=[];for(let ct=0;ct<we.length;ct++){let Ne=we[ct],Mt=he?`${he}/${Ne.name}`:`${Ne.name}`;De.push({title:Ne.name,type:Ne.type,isLeaf:Ne.type!=="tree",key:Mt})}return De}function qe(we,he,De){for(let ct=0;ct<we.length;ct++){let Ne=we[ct];if(Ne.key===he){Ne.children=De;break}Ne.children&&qe(Ne.children,he,De)}return we}function ye(we,he,De){let ct;return function(){let Ne=this,Mt=arguments,ut=function(){ct=null,De||we.apply(Ne,Mt)},Qe=De&&!ct;clearTimeout(ct),ct=setTimeout(ut,he),Qe&&we.apply(Ne,Mt)}}const Ce=!0,Me=be.Z.API_SERVER},96670:function(mn,Ut,ue){"use strict";ue.d(Ut,{t:function(){return Ne}});var be=ue(67294),tt=ue(71577),Fe={buttonFixed:"buttonFixed___vyq30",button:"button___hxmYv",buttonWrap:"buttonWrap___uK8dl"},qe=ue(94184),ye=ue.n(qe),Ce=Object.defineProperty,Me=Object.getOwnPropertySymbols,we=Object.prototype.hasOwnProperty,he=Object.prototype.propertyIsEnumerable,De=(Mt,ut,Qe)=>ut in Mt?Ce(Mt,ut,{enumerable:!0,configurable:!0,writable:!0,value:Qe}):Mt[ut]=Qe,ct=(Mt,ut)=>{for(var Qe in ut||(ut={}))we.call(ut,Qe)&&De(Mt,Qe,ut[Qe]);if(Me)for(var Qe of Me(ut))he.call(ut,Qe)&&De(Mt,Qe,ut[Qe]);return Mt};const Ne=({cancelText:Mt="\u53D6\u6D88",okText:ut="\u786E\u5B9A",loading:Qe=!1,hasOkBtn:Xe=!0,hasCancelBtn:Te=!0,okButtonProps:Et={},onCancel:Lt=()=>{},onOk:et=()=>{},className:lt=""})=>be.createElement("div",{className:ye()(Fe.buttonFixed,lt)},be.createElement("div",{className:Fe.buttonWrap},Te&&be.createElement(tt.ZP,{size:"middle",className:`${Fe.button} mr20`,onClick:Lt},Mt),Xe&&be.createElement(tt.ZP,ct({size:"middle",type:"primary",className:`${Fe.button} mr20`,loading:Qe,onClick:et},Et),ut)))},63205:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return ct}});var be=ue(67294),tt={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},Fe=ue(94184),qe=ue.n(Fe),ye=ue(57953),Ce=ue(15979),Me=ue(33170),we=ue(28706),he=(Ne,Mt,ut)=>new Promise((Qe,Xe)=>{var Te=et=>{try{Lt(ut.next(et))}catch(lt){Xe(lt)}},Et=et=>{try{Lt(ut.throw(et))}catch(lt){Xe(lt)}},Lt=et=>et.done?Qe(et.value):Promise.resolve(et.value).then(Te,Et);Lt((ut=ut.apply(Ne,Mt)).next())}),ct=({data:Ne,className:Mt,fullWidth:ut,style:Qe={},onClose:Xe,onOk:Te,showFullTools:Et,noAssociationId:Lt})=>{const et=(0,be.useRef)(null),lt=(0,be.useRef)(null),Ie=(0,be.useRef)(null),_e=(0,be.useRef)(null),[Ue,Ze]=(0,be.useState)(!1),[At,bt]=(0,be.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,be.useEffect)(()=>{Ie.current||(Ie.current=document.createElement("style"),document.head.appendChild(Ie.current)),Ne!=null&&Ne.visible?(document.body.setAttribute("data-custom","y-hidden"),Ie.current.innerHTML=" html { overflow-y: hidden; }",Ne!=null&&Ne.src&&xt()):(document.body.removeAttribute("data-custom"),Ie.current&&(document.head.removeChild(Ie.current),Ie.current=null))},[Ne==null?void 0:Ne.visible]);const xt=()=>he(void 0,null,function*(){Ze(!0),bt("\u6B63\u5728\u52A0\u8F7D\u4E2D");const qt=yield(0,we.ZJ)(Ne==null?void 0:Ne.src);et.current.src="",et.current.src=qt,et.current.onload=function(){vn()},Ze(!1),bt("")}),Ge=()=>{document.body.removeAttribute("data-custom"),Ie.current.innerHTML=" ",Xe()},Ot=qt=>he(void 0,null,function*(){Ze(!0),bt("\u6B63\u5728\u4FDD\u5B58\u4E2D");const cn=yield(0,Me.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Ne.title,file:qt.dataUrl}});cn!=null&&cn.id&&!Lt?(yield(0,Me.ZP)(`/api/attachments/${Ne.id}/add_subitem.json`,{method:"post",body:{subitem_id:cn==null?void 0:cn.id,settings:JSON.stringify(qt.state)}})).status===0&&Te():cn!=null&&cn.id&&Te(cn),document.body.removeAttribute("data-custom"),Ie.current.innerHTML=" ",Ze(!1),bt("")}),kt=()=>{const qt=document.querySelector('a[href="https://markerjs.com/"]');qt&&qt.parentNode&&(qt.parentNode.style.display="none"),[{name:'[data-action="select"]',title:"\u9009\u62E9"},{name:'[data-action="delete"]',title:"\u5220\u9664\u5143\u7D20"},{name:'[data-action="undo"]',title:"\u64A4\u9500"},{name:'[data-type-name="FrameMarker"]',title:"\u77E9\u5F62"},{name:'[data-type-name="FreehandMarker"]',title:"\u753B\u7EBF"},{name:'[data-type-name="ArrowMarker"]',title:"\u7BAD\u5934"},{name:'[data-type-name="TextMarker"]',title:"\u6587\u672C"},{name:'[data-type-name="EllipseMarker"]',title:"\u692D\u5706"},{name:'[data-type-name="HighlightMarker"]',title:"\u65B9\u5757"},{name:'[data-type-name="CalloutMarker"]',title:"\u6CE8\u91CA"},{name:'[data-action="render"]',title:"\u4FDD\u5B58"},{name:'[data-action="close"]',title:"\u9000\u51FA"}].forEach(An=>{const Zn=document.querySelector(An.name);Zn&&Zn.setAttribute("title",An.title)})},vn=()=>{lt.current=new Ce.hP(et.current),lt.current.targetRoot=_e.current,lt.current.addEventListener("render",Ot),lt.current.addEventListener("beforeclose",Ge),Et&&(lt.current.availableMarkerTypes=lt.current.ALL_MARKER_TYPES,lt.current.uiStyleSettings.redoButtonVisible=!0,lt.current.uiStyleSettings.notesButtonVisible=!0,lt.current.uiStyleSettings.zoomButtonVisible=!0,lt.current.uiStyleSettings.zoomOutButtonVisible=!0,lt.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=lt.current.uiStyleSettings,lt.current.show(),Ne!=null&&Ne.snapshotData&&lt.current.restoreState(Ne.snapshotData),setTimeout(()=>{window.scrollTo(0,0),kt()},300)};return be.createElement(be.Fragment,null,(Ne==null?void 0:Ne.visible)&&be.createElement(ye.Z,{spinning:Ue,tip:At,style:{position:"absolute"}},be.createElement("div",{ref:_e,className:qe()(tt.imageDimensions,Mt,ut?tt.fullWidth:""),style:Qe},be.createElement("img",{className:tt.img,ref:et}))))}},36527:function(mn,Ut,ue){"use strict";var be=ue(67294),tt=ue(71230),Fe=ue(15746),qe=ue(66368),ye=ue(71577),Ce=ue(35598),Me=ue(71736),we=ue(84279),he=ue(67294);const De=(0,be.forwardRef)(({callback:ct,showSaveButton:Ne,value:Mt=""},ut)=>{const Qe=(0,be.useRef)(),Xe=[{name:"\u5206\u6570\u5F97\u5206",value:"\\frac{x}{y}",children:[{name:"\u5206\u6570 Fractions",data:[{value:"\\frac{a}{b}"},{value:"x\\tfrac{x}{a} "},{value:"\\mathrm{d}t"},{value:"\\partial t"},{value:"\\frac{\\partial y}{\\partial x}"},{value:"\\nabla\\psi"},{value:"\\frac{\\partial^2}{\\partial x_1\\partial x_2}y"},{value:"\\cfrac{1}{a + \\cfrac{7}{b + \\cfrac{2}{9}}} = c"}]},{name:"\u5BFC\u6570 Derivative",data:[{value:"\\dot{a} "},{value:"\\ddot{a}"},{value:"{f}^{\\prime}"},{value:"{f}^{\\prime\\prime}"},{value:"{f}^{(n)}"}]},{name:"\u6A21\u7B97\u672F Modular arithmetic",data:[{value:"a \\bmod b"},{value:"a \\equiv b \\pmod{m} "},{value:"\\gcd(m, n) "},{value:"\\operatorname{lcm}(m, n) "}]}]},{name:"\u6839\u5F0F\u89D2\u6807",value:"\\sqrt{x}",children:[{name:"\u6839\u5F0F Radicals",data:[{value:"\\sqrt{x}"},{value:"\\sqrt[y]{x}"}]},{name:"\u4E0A\u4E0B\u6807 Sub&Super",data:[{value:"x^{a}"},{value:"x_{a}"},{value:"x_{a}^{b} "},{value:"_{a}^{b} x"},{value:"x_{a}^{b} "}]},{name:"\u91CD\u97F3\u7B26\u53CA\u5176\u4ED6 Accents and Others",data:[{value:"\\hat{a} "},{value:"\\sqrt[y]{x}"},{value:"\\check{} "},{value:"\\grave{a} "},{value:"\\acute{a}"},{value:"\\tilde{a}"},{value:"\\breve{a}"},{value:"\\bar{a}"},{value:"\\vec{a}"},{value:"\\not{a}"},{value:"\\widetilde{abc}"},{value:"\\widehat{abc}"},{value:"\\overleftarrow{abc} "},{value:"\\overrightarrow{abc}"},{value:"\\overline{abc}"},{value:"\\underline{abc}"},{value:"\\overbrace{abc}"},{value:"\\underbrace{abc}"},{value:"\\overset{a}{abc}"},{value:"\\underset{a}{abc} \\stackrel\\frown{ab}"},{value:"\\overline{ab} "},{value:"\\overleftrightarrow{ab}"},{value:"\\overset{a}{\\leftarrow}"},{value:"\\overset{a}{\\rightarrow}"},{value:"\\xleftarrow[abc]{a}"},{value:"\\xrightarrow[abc]{a} "}]}]},{name:"\u6781\u9650\u5BF9\u6570",value:"\\lim_{x \\to 0}",children:[{name:"\u6781\u9650 Limits",data:[{value:"\\lim a"},{value:"\\lim_{x \\to 0}"},{value:"\\lim_{x \\to \\infty}"},{value:"\\max_b{a}"},{value:"\\min_a{b}"}]},{name:"\u5BF9\u6570\u6307\u6570 Logarithms and exponentials",data:[{value:"\\log_{a}{b}"},{value:"\\lg_{a}{b}"},{value:"\\ln_{a}{b}"},{value:"\\exp a"}]},{name:"\u754C\u9650 Bounds",data:[{value:"\\min x"},{value:"\\sup t"},{value:"\\inf s"},{value:"\\lim u"},{value:"\\limsup w"},{value:"\\dim p"},{value:"\\ker\\phi "}]}]},{name:"\u4E09\u89D2\u51FD\u6570",value:"\\sin a",children:[{name:"\u4E09\u89D2\u51FD\u6570 Trigonometric functions",data:[{value:"\\sin a"},{value:"\\cos a"},{value:"\\tan a"},{value:"\\cot a "},{value:"\\sec a "},{value:"\\csc a "}]},{name:"\u53CD\u4E09\u89D2\u51FD\u6570 Inverse trigonometric functions",data:[{value:"\\sin^{-1}"},{value:"\\cos^{-1}"},{value:"\\tan^{-1}"},{value:"\\cot^{-1}"},{value:"\\sec^{-1}"},{value:"\\csc^{-1}"},{value:"\\arcsin a"},{value:"\\arccos a"},{value:"\\arctan a"},{value:"\\operatorname{arccot} a"},{value:"\\operatorname{arcsec} a"},{value:"\\operatorname{arccsc} a"}]},{name:"\u53CC\u66F2\u51FD\u6570 Hyperblic functions",data:[{value:"\\sinh a"},{value:"\\cosh a"},{value:"\\tanh a"},{value:"\\coth a"},{value:"\\operatorname{sech} a"},{value:"\\operatorname{csch} a"}]},{name:"\u53CD\u53CC\u66F2\u51FD\u6570 Inverse hyperbolic functions",data:[{value:"\\sinh^{-1}"},{value:"a\\cosh^{-1} a"},{value:"\\tanh^{-1} a"},{value:"\\coth^{-1} a"},{value:"\\operatorname{sech}^{-1} a"},{value:"\\operatorname{csch}^{-1} a"}]}]},{name:"\u79EF\u5206\u8FD0\u7B97",value:"\\int_{a}^{b}",children:[{name:"\u79EF\u5206 Integral",data:[{value:"\\int"},{value:"\\int_{a}^{b}"},{value:"\\int\\limits_{a}^{b}"}]},{name:"\u53CC\u91CD\u79EF\u5206 Double integral",data:[{value:"\\iint"},{value:"\\iint_{a}^{b} "},{value:"\\iint\\limits_{a}^{b} "}]},{name:"\u4E09\u91CD\u79EF\u5206 Triple integral",data:[{value:"\\iiint"},{value:"\\iiint_{a}^{b}"},{value:"\\iiint\\limits_{a}^{b} "}]},{name:"\u66F2\u7EBF\u79EF\u5206 Closed line or path integral",data:[{value:"\\oint"},{value:"\\oint_{a}^{b} "}]}]},{name:"\u5927\u578B\u8FD0\u7B97",value:"\\sum_{a}^{b}",children:[{name:"\u6C42\u548C Summation",data:[{value:"\\sum"},{value:"\\sum_{a}^{b}"},{value:"{\\textstyle \\sum_{a}^{b}} "}]},{name:"\u4E58\u79EF\u4F59\u79EF Product and coproduct",data:[{value:"\\prod"},{value:"\\prod_{a}^{b}"},{value:"{\\textstyle \\prod_{a}^{b}}"},{value:"\\coprod"},{value:"\\coprod_{a}^{b}"},{value:"{\\textstyle \\coprod_{a}^{b}} "}]},{name:"\u5E76\u96C6\u4EA4\u96C6 Union and intersection",data:[{value:"\\bigcup"},{value:"\\bigcup_{a}^{b}"},{value:"{\\textstyle \\bigcup_{a}^{b}}"},{value:"\\bigcap"},{value:"\\bigcap_{a}^{b}"}]},{name:"\u6790\u53D6\u5408\u53D6 Disjunction and conjunction",data:[{value:"\\bigvee"},{value:"\\bigvee_{a}^{b}"},{value:"\\bigwedge"},{value:"\\bigwedge_{a}^{b}"}]}]},{name:"\u62EC\u53F7\u53D6\u6574",value:"\\left [ \\left ( \\right ) \\right ] ",children:[{name:"\u62EC\u53F7 Brackets",data:[{value:"\\left ( \\right )"},{value:"\\left [ \\right ]"},{value:"\\left \\langle \\right \\rangle "},{value:"\\left | \\right | "},{value:"\\left \\lfloor \\right \\rfloor "},{value:"\\left \\lceil \\right \\rceil "}]}]}],Te=[{name:"\u4EE3\u6570",value:"\\sqrt{a^2+b^2}",children:[{data:[{value:"\\left(x-1\\right)\\left(x+3\\right) "},{value:"\\sqrt{a^2+b^2}"},{value:"\\left ( \\frac{a}{b}\\right )^{n}= \\frac{a^{n}}{b^{n}}"},{value:"\\frac{a}{b}\\pm \\frac{c}{d}= \\frac{ad \\pm bc}{bd} "},{value:"\\frac{x^{2}}{a^{2}}-\\frac{y^{2}}{b^{2}}=1 "},{value:"\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0 "},{value:"\\sqrt[n]{a^{n}}=\\left ( \\sqrt[n]{a}\\right )^{n} "},{value:"x ={-b \\pm \\sqrt{b^2-4ac}\\over 2a} "},{value:"y-y_{1}=k \\left( x-x_{1}\\right) "},{value:`\\left\\{\\begin{matrix} \r
x=a + r\\text{cos}\\theta \\ \r
y=b + r\\text{sin}\\theta \r
\\end{matrix}\\right. `},{value:`\\begin{array}{l} \r
\\text{\u5BF9\u4E8E\u65B9\u7A0B\u5F62\u5982\uFF1A}x^{3}-1=0 \\ \r
\\text{\u8BBE}\\text{:}\\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r
x_{1}=1,x_{2}= \\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r
x_{3}= \\omega ^{2}=\\frac{-1-\\sqrt{3}i}{2} \r
\\end{array} `},{value:`\\begin{array}{l} \r
a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r
\\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r
\\left\\{\\begin{matrix} \r
\\Delta \\gt 0\\text{\u65B9\u7A0B\u6709\u4E24\u4E2A\u4E0D\u76F8\u7B49\u7684\u5B9E\u6839} \\ \r
\\Delta = 0\\text{\u65B9\u7A0B\u6709\u4E24\u4E2A\u76F8\u7B49\u7684\u5B9E\u6839} \\ \r
\\Delta \\lt 0\\text{\u65B9\u7A0B\u65E0\u5B9E\u6839} \r
\\end{matrix}\\right. \r
\\end{array} `},{value:`\\begin{array}{l} \r
a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r
\\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r
\\mathop{{x}}\\nolimits_{{1,2}}=\\frac{{-b \\pm \r
\\sqrt{{\\mathop{{b}}\\nolimits^{{2}}-4ac}}}}{{2a}} \\ \r
\\mathop{{x}}\\nolimits_{{1}}+\\mathop{{x}}\\nolimits_{{2}}=-\\frac{{b}}{{a}} \\ \r
\\mathop{{x}}\\nolimits_{{1}}\\mathop{{x}}\\nolimits_{{2}}=\\frac{{c}}{{a}} \r
\\end{array} `}]}]},{name:"\u51E0\u4F55",value:"\\Delta A B C ",children:[{data:[{value:"\\Delta A B C "},{value:"a \\parallel c,b \\parallel c \\Rightarrow a \\parallel b "},{value:"l \\perp \\beta ,l \\subset \\alpha \\Rightarrow \\alpha \\perp \\beta"},{value:`\\left.\\begin{matrix} \r
a \\perp \\alpha \\ \r
b \\perp \\alpha \r
\\end{matrix}\\right\\}\\Rightarrow a \\parallel b`},{value:"P \\in \\alpha ,P \\in \\beta , \\alpha \\cap \\beta =l \\Rightarrow P \\in l "},{value:`\\alpha \\perp \\beta , \\alpha \\cap \\beta =l,a \\subset \\alpha ,a \\perp l \r
\\Rightarrow a \\perp \\beta `},{value:`\\left.\\begin{matrix} \r
a \\subset \\beta ,b \\subset \\beta ,a \\cap b=P \\ \r
a \\parallel \\partial ,b \\parallel \\partial \r
\\end{matrix}\\right\\}\\Rightarrow \\beta \\parallel \\alpha `},{value:"\\alpha \\parallel \\beta , \\gamma \\cap \\alpha =a, \\gamma \\cap \\beta =b \\Rightarrow a \\parallel b "},{value:"A \\in l,B \\in l,A \\in \\alpha ,B \\in \\alpha \\Rightarrow l \\subset \\alpha "},{value:`\\left.\\begin{matrix} \r
m \\subset \\alpha ,n \\subset \\alpha ,m \\cap n=P \\ \r
a \\perp m,a \\perp n \r
\\end{matrix}\\right\\}\\Rightarrow a \\perp \\alpha `},{value:`\\begin{array}{c} \r
\\text{\u76F4\u89D2\u4E09\u89D2\u5F62\u4E2D,\u76F4\u89D2\u8FB9\u957Fa,b,\u659C\u8FB9\u8FB9\u957Fc} \\ \r
a^{2}+b^{2}=c^{2} \r
\\end{array}`}]}]},{name:"\u4E0D\u7B49\u5F0F",value:"a > b",children:[{data:[{value:"a > b,b > c \\Rightarrow a > c "},{value:"a > b,c > d \\Rightarrow a+c > b+d "},{value:"a > b > 0,c > d > 0 \\Rightarrow ac bd "},{value:`\\begin{array}{c} \r
a \\gt b,c \\gt 0 \\Rightarrow ac \\gt bc \\ \r
a \\gt b,c \\lt 0 \\Rightarrow ac \\lt bc \r
\\end{array}`},{value:"\\left | a-b \\right | \\geqslant \\left | a \\right | -\\left | b \\right | "},{value:"-\\left | a \\right |\\leq a\\leqslant \\left | a \\right | "},{value:"\\left | a \\right |\\leqslant b \\Rightarrow -b \\leqslant a \\leqslant \\left | b \\right | "},{value:"\\left | a+b \\right | \\leqslant \\left | a \\right | + \\left | b \\right | "},{value:`\\begin{array}{c} \r
a \\gt b \\gt 0,n \\in N^{\\ast},n \\gt 1 \\ \r
\\Rightarrow a^{n}\\gt b^{n}, \\sqrt[n]{a}\\gt \\sqrt[n]{b} \r
\\end{array}`},{value:`\\left( \\sum_{k=1}^n a_k b_k \\right)^{\\!\\!2}\\leq \r
\\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right) `},{value:`\\begin{array}{c} \r
a,b \\in R^{+} \\ \r
\\Rightarrow \\frac{a+b}{{2}}\\ge \\sqrt{ab} \\ \r
\\left( \\text{\u5F53\u4E14\u4EC5\u5F53}a=b\\text{\u65F6\u53D6\u201C}=\\text{\u201D\u53F7}\\right) \r
\\end{array}`},{value:`\\begin{array}{c} \r
a,b \\in R \\ \r
\\Rightarrow a^{2}+b^{2}\\gt 2ab \\ \r
\\left( \\text{\u5F53\u4E14\u4EC5\u5F53}a=b\\text{\u65F6\u53D6\u201C}=\\text{\u201D\u53F7}\\right) \r
\\end{array}`},{value:`\\begin{array}{c} \r
H_{n}=\\frac{n}{\\sum \\limits_{i=1}^{n}\\frac{1}{x_{i}}}= \\frac{n}{\\frac{1}{x_{1}}+ \\frac{1}{x_{2}}+ \\cdots + \\frac{1}{x_{n}}} \\ G_{n}=\\sqrt[n]{\\prod \\limits_{i=1}^{n}x_{i}}= \\sqrt[n]{x_{1}x_{2}\\cdots x_{n}} \\ A_{n}=\\frac{1}{n}\\sum \\limits_{i=1}^{n}x_{i}=\\frac{x_{1}+ x_{2}+ \\cdots + x_{n}}{n} \\ Q_{n}=\\sqrt{\\sum \\limits_{i=1}^{n}x_{i}^{2}}= \\sqrt{\\frac{x_{1}^{2}+ x_{2}^{2}+ \\cdots + x_{n}^{2}}{n}} \\ H_{n}\\leq G_{n}\\leq A_{n}\\leq Q_{n} \r
\\end{array}`}]}]},{name:"\u79EF\u5206",value:"\\frac{\\mathrm{d}\\partial}{\\partial x}",children:[{data:[{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}x^n=nx^{n-1} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}e^{ax}=a\\,e^{ax} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\ln(x)=\\frac{1}{x} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\sin x=\\cos x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cos x=-\\sin x "},{value:"\\int k\\mathrm{d}x = kx+C "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\tan x=\\sec^2 x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cot x=-\\csc^2 x "},{value:"\\int \\frac{1}{x}\\mathrm{d}x= \\ln \\left| x \\right| +C "},{value:"\\int \\frac{1}{\\sqrt{1-x^{2}}}\\mathrm{d}x= \\arcsin x +C "},{value:"\\int \\frac{1}{1+x^{2}}\\mathrm{d}x= \\arctan x +C "},{value:"\\int u \\frac{\\mathrm{d}v}{\\mathrm{d}x}\\,\\mathrm{d}x=uv-\\int \\frac{\\mathrm{d}u}{\\mathrm{d}x}v\\,\\mathrm{d}x "},{value:"f(x) = \\int_{-\\infty}^\\infty \\hat f(x)\\xi\\,e^{2 \\pi i \\xi x} \\,\\mathrm{d}\\xi "},{value:"\\int x^{\\mu}\\mathrm{d}x=\\frac{x^{\\mu +1}}{\\mu +1}+C, \\left({\\mu \\neq -1}\\right) "}]}]},{name:"\u4E09\u89D2",value:"e^{i \\theta}",children:[{name:"\u6C42\u548C Summation",data:[{value:"e^{i \\theta} "},{value:"\\left(\\frac{\\pi}{2}-\\theta \\right ) "},{value:"\\text{sin}^{2}\\frac{\\alpha}{2}=\\frac{1- \\text{cos}\\alpha}{2} "},{value:"\\text{cos}^{2}\\frac{\\alpha}{2}=\\frac{1+ \\text{cos}\\alpha}{2} "},{value:"\\text{tan}\\frac{\\alpha}{2}=\\frac{\\text{sin}\\alpha}{1+ \\text{cos}\\alpha} "},{value:"\\sin \\alpha + \\sin \\beta =2 \\sin \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\sin \\alpha - \\sin \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha + \\cos \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha - \\cos \\beta =-2\\sin \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"a^{2}=b^{2}+c^{2}-2bc\\cos A "},{value:"\\frac{\\sin A}{a}=\\frac{\\sin B}{b}=\\frac{\\sin C}{c}=\\frac{1}{2R} "},{value:"\\sin \\left ( \\frac{\\pi}{2}-\\alpha \\right ) = \\cos \\alpha "},{value:"\\sin \\left ( \\frac{\\pi}{2}+\\alpha \\right ) = \\cos \\alpha "}]}]},{name:"\u7EDF\u8BA1",value:"C_{r}^{n}",children:[{data:[{value:"C_{r}^{n} "},{value:"\\frac{n!}{r!(n-r)!} "},{value:"\\sum_{i=1}^{n}{X_i} "},{value:"\\sum_{i=1}^{n}{X_i^2} "},{value:"X_1, \\cdots,X_n "},{value:"\\frac{x-\\mu}{\\sigma} "},{value:"\\sum_{i=1}^{n}{(X_i - \\overline{X})^2} "},{value:`\\begin{array}{c} \r
\\text{\u82E5}P \\left( AB \\right) =P \\left( A \\right) P \\left( B \\right) \\\\ \r
\\text{\u5219}P \\left( A \\left| B\\right. \\right) =P \\left({B}\\right) \r
\\end{array}`},{value:"P(E) ={n \\choose k}p^k (1-p)^{n-k} "},{value:"P \\left( A \\right) = \\lim \\limits_{n \\to \\infty}f_{n}\\left ( A \\right ) "},{value:"P \\left( \\bigcup \\limits_{i=1}^{+ \\infty}A_{i}\\right) = \\prod \\limits_{i=1}^{+ \\infty}P{\\left( A_{i}\\right)} "},{value:`\\begin{array}{c} \r
P \\left( \\emptyset \\right) =0 \\\\ \r
P \\left( S \\right) =1 \r
\\end{array}`},{value:`\\begin{array}{c} \r
\\forall A \\in S \\\\ \r
P \\left( A \\right) \\ge 0 \r
\\end{array}`},{value:"P \\left( \\bigcup \\limits_{i=1}^{n}A_{i}\\right) = \\prod \\limits_{i=1}^{n}P \\left( A_{i}\\right) "},{value:`\\begin{array}{c} \r
S= \\binom{N}{n},A_{k}=\\binom{M}{k}\\cdot \\binom{N-M}{n-k} \\\\ \r
P\\left ( A_{k}\\right ) = \\frac{\\binom{M}{k}\\cdot \\binom{N-M}{n-k}}{\\binom{N}{n}} \r
\\end{array}`},{value:`\\begin{array}{c} \r
P_{n}=n! \\\\ \r
A_{n}^{k}=\\frac{n!}{\\left( n-k \\left) !\\right. \\right.} \r
\\end{array}`}]}]}],Et=lt=>{Qe.current.setValue(Qe.current.getValue()+" "+lt.value+" ")},Lt=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:he.createElement(tt.Z,{className:Me.Z.lists,gutter:[10,10]},Xe.map((lt,Ie)=>he.createElement(Fe.Z,{flex:"110px",className:Me.Z.item},he.createElement("div",null,he.createElement(Ce.Z,{value:`$$${lt.value}$$`}),lt.name),he.createElement("div",{className:Me.Z.children},lt.children.map((_e,Ue)=>he.createElement("div",{key:Ue},he.createElement("h1",null,_e.name),he.createElement(tt.Z,{gutter:[10,10]},_e.data.map((Ze,At)=>he.createElement(Fe.Z,{key:At,onClick:()=>Et(Ze),className:Me.Z.diamond},he.createElement(Ce.Z,{value:"`$$"+Ze.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:he.createElement(tt.Z,{className:Me.Z.lists,gutter:[10,10]},Te.map((lt,Ie)=>he.createElement(Fe.Z,{flex:"110px",className:Me.Z.item},he.createElement("div",null,he.createElement(Ce.Z,{value:"`$$"+lt.value+"$$`"}),lt.name),he.createElement("div",{className:Me.Z.children},lt.children.map((_e,Ue)=>he.createElement("div",{key:Ue},_e.name&&he.createElement("h1",null,_e.name),he.createElement(tt.Z,{gutter:[10,10]},_e.data.map((Ze,At)=>he.createElement(Fe.Z,{key:At,onClick:()=>Et(Ze),className:Me.Z.diamond},he.createElement(Ce.Z,{value:"`$$"+Ze.value+"$$`"}))))))))))}],et=()=>{var lt=document.createElement("div");lt.innerHTML=Qe.current.getValue();var Ie=lt.innerText;return ct&&ct(Ie),Ie};return(0,be.useImperativeHandle)(ut,()=>({getData:et})),he.createElement("div",{className:Me.Z.mathWrap},he.createElement(qe.default,{defaultActiveKey:"1",items:Lt}),he.createElement("math-field",{locale:"zh_cn",className:Me.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:Qe,style:{width:800,marginTop:30,fontSize:18}},Mt||""),Ne&&he.createElement("div",{className:Me.Z.button},he.createElement(ye.ZP,{size:"large",onClick:et,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});Ut.Z=De},57444:function(mn,Ut,ue){"use strict";ue.d(Ut,{h:function(){return lt}});var be=ue(67294),tt=ue(11713),Fe=ue(22150),qe=ue(71577),ye=ue(4631),Ce=ue.n(ye),Me=ue(71749),we=ue(30483),he=Object.defineProperty,De=Object.defineProperties,ct=Object.getOwnPropertyDescriptors,Ne=Object.getOwnPropertySymbols,Mt=Object.prototype.hasOwnProperty,ut=Object.prototype.propertyIsEnumerable,Qe=(Ie,_e,Ue)=>_e in Ie?he(Ie,_e,{enumerable:!0,configurable:!0,writable:!0,value:Ue}):Ie[_e]=Ue,Xe=(Ie,_e)=>{for(var Ue in _e||(_e={}))Mt.call(_e,Ue)&&Qe(Ie,Ue,_e[Ue]);if(Ne)for(var Ue of Ne(_e))ut.call(_e,Ue)&&Qe(Ie,Ue,_e[Ue]);return Ie},Te=(Ie,_e)=>De(Ie,ct(_e));const Et=tt.default.Option,Lt={labelCol:{span:4},wrapperCol:{span:20}},et={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Ut.Z=({callback:Ie,onCancel:_e})=>{const[Ue,Ze]=(0,be.useState)("python");function At(xt){Ze(et[xt][1])}function bt(xt){Ie(xt)}return be.createElement(Fe.default,Te(Xe({},Lt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:bt,style:{width:500}}),be.createElement(Fe.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},be.createElement(tt.default,{getPopupContainer:xt=>xt.parentNode,onChange:At},Object.keys(et).map(xt=>be.createElement(Et,{key:xt,value:xt},et[xt][0])))),be.createElement(Fe.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},be.createElement(lt,{mode:Ue})),be.createElement("div",{className:"flex-container flex-end"},be.createElement(qe.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),be.createElement(qe.ZP,{type:"ghost",onClick:_e},"\u53D6\u6D88")))};function lt({value:Ie,onChange:_e,mode:Ue,options:Ze={}}){const At=(0,be.useRef)(),[bt,xt]=(0,be.useState)();return(0,be.useEffect)(()=>{if(bt){let Ge=function(Ot){const kt=Ot.getValue();_e&&_e(kt)};return bt.on("change",Ge),()=>{bt.off("change",Ge)}}},[bt,_e]),(0,be.useEffect)(()=>{bt&&bt.setOption("mode",Ue)},[bt,Ue]),(0,be.useEffect)(()=>{bt&&(Ie!==bt.getValue()||Ie==="")&&setTimeout(()=>{bt.setValue(Ie||"")},300)},[bt,Ie]),(0,be.useEffect)(()=>{if(At.current&&!bt){const Ge=Ce().fromTextArea(At.current,Xe({mode:Ue,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Ze));xt(Ge)}},[At.current,bt]),be.createElement("div",{className:"my-codemirror-container"},be.createElement("textarea",{ref:At}))}},91304:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return ur}});var be=ue(67294),tt=ue(4631),Fe=ue.n(tt),qe=ue(91033),ye=ue(71749),Ce=ue(57341),Me=ue(82801),we=ue(88386),he=ue(49047),De=ue(80785),ct=ue(35598),Ne=({value:Hn="",className:je,showTextOnly:it,showLines:St,style:Wt={}})=>{const He=(0,be.useMemo)(()=>"",[Hn]);return be.createElement(be.Fragment,null,be.createElement("div",{dangerouslySetInnerHTML:{__html:He}}))},Mt=ue(67294),ut=Object.defineProperty,Qe=Object.defineProperties,Xe=Object.getOwnPropertyDescriptors,Te=Object.getOwnPropertySymbols,Et=Object.prototype.hasOwnProperty,Lt=Object.prototype.propertyIsEnumerable,et=(Hn,je,it)=>je in Hn?ut(Hn,je,{enumerable:!0,configurable:!0,writable:!0,value:it}):Hn[je]=it,lt=(Hn,je)=>{for(var it in je||(je={}))Et.call(je,it)&&et(Hn,it,je[it]);if(Te)for(var it of Te(je))Lt.call(je,it)&&et(Hn,it,je[it]);return Hn},Ie=(Hn,je)=>Qe(Hn,Xe(je));let _e=[{title:"\u7C97\u4F53",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"md-iconfont icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"\u6570\u5B66\u56FE\u50CF",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"iconfont icon-jisuan1",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"\u63D2\u5165\u753B\u56FE",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"\u63D2\u5165\u6D41\u7A0B\u56FE",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"\u8868\u683C",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function Ue({onActionCallback:Hn,title:je,icon:it,actionName:St,className:Wt="",children:He}){function ht(){Hn(St)}return Mt.createElement("a",{title:je,className:Wt,onClick:ht},Mt.createElement("i",{className:`${it}`}),He)}var Ze=({watch:Hn,showNullButton:je,showNullProgramButton:it,onActionCallback:St,fullScreen:Wt,insertTemp:He,hidetoolBar:ht,extraUse:Dt})=>{const _t=[..._e,{title:`${Hn?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${Hn?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return Mt.createElement("ul",{className:"markdown-toolbar-container"},!ht&&_t.map((Nt,Pt)=>Mt.createElement("li",{key:Pt},Nt.actionName?Mt.createElement(Ue,Ie(lt({},Nt),{onActionCallback:St})):Mt.createElement("span",{className:"v-line"}))),je?Mt.createElement("li",null,Mt.createElement(Ue,{icon:"iconfont icon-tianjia5 insert-blank",className:"btn-null ml5",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:St},Mt.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u65B0\u589E\u586B\u7A7A\u9879"))):null,it?Mt.createElement(Mt.Fragment,null,Mt.createElement("li",null,Mt.createElement(Ue,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:St},Mt.createElement("span",{className:"fill-tip"},"+\u5355\u884C\u586B\u7A7A\u9879"))),Mt.createElement("li",null,Mt.createElement(Ue,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:St},Mt.createElement("span",{className:"fill-tip"},"+\u591A\u884C\u586B\u7A7A\u9879")))):null,He&&Mt.createElement("li",null,Mt.createElement(Ue,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${He}`,onActionCallback:St},Mt.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),Dt&&Mt.createElement("li",null,Dt),Mt.createElement("li",{className:"btn-full-screen"},Mt.createElement(Ue,{icon:`${Wt?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:Wt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:St})))},At=ue(76621),bt=ue(22150),xt=ue(69677),Ge=ue(71577),Ot=Object.defineProperty,kt=Object.defineProperties,vn=Object.getOwnPropertyDescriptors,qt=Object.getOwnPropertySymbols,cn=Object.prototype.hasOwnProperty,An=Object.prototype.propertyIsEnumerable,Zn=(Hn,je,it)=>je in Hn?Ot(Hn,je,{enumerable:!0,configurable:!0,writable:!0,value:it}):Hn[je]=it,Ye=(Hn,je)=>{for(var it in je||(je={}))cn.call(je,it)&&Zn(Hn,it,je[it]);if(qt)for(var it of qt(je))An.call(je,it)&&Zn(Hn,it,je[it]);return Hn},Ee=(Hn,je)=>kt(Hn,vn(je));const Tt={labelCol:{span:4},wrapperCol:{span:20}};var gn=({callback:Hn,onCancel:je})=>{function it(St){Hn(St)}return be.createElement(bt.default,Ee(Ye({},Tt),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:it,style:{width:500}}),be.createElement(bt.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},be.createElement(xt.default,null)),be.createElement(bt.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},be.createElement(xt.default,null)),be.createElement("div",{className:"flex-container flex-end"},be.createElement(Ge.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),be.createElement(Ge.ZP,{type:"ghost",onClick:je},"\u53D6\u6D88")))},Xt=ue(57444),Je=ue(70859),rt=ue(14446),Ht=ue(71230),Sn=ue(63205),sn=ue(67294),$t=({callback:Hn,onCancel:je})=>{const it=document.createElement("canvas"),St=it.getContext("2d");it.width=1e3,it.height=800,St.fillStyle="#ffffff",St.fillRect(0,0,it.width,it.height);const Wt=it.toDataURL("image/png");return sn.createElement(rt.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},sn.createElement(Ht.Z,{style:{height:"100vh"}},sn.createElement(Sn.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:Wt,visible:!0,title:String(Date.now())},onOk:He=>{Hn({src:He.url})},onClose:je})))},Bt=ue(72565),bn=ue(15746),dn=ue(2453),ke={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},ce=ue(67294),ve=(0,be.forwardRef)(({onCancel:Hn,editImgId:je,callback:it},St)=>{let Wt=(0,be.useRef)(),He=(0,be.useRef)(),ht=(0,be.useRef)(),Dt=(0,be.useRef)(!1);const _t=(0,be.useRef)(!1);console.log("ref:",St);const[Nt,Pt]=(0,be.useState)(0),[Bn,cr]=(0,be.useState)("100vh");return(0,be.useEffect)(()=>{Pt(1);try{indexedDB.databases().then(Wn=>{Wn.forEach(Un=>indexedDB.deleteDatabase(Un.name))})}catch(Wn){}},[]),(0,be.useImperativeHandle)(St,()=>({setHeight:cr})),ce.createElement("div",{ref:_t,className:"body-overflow-initial"},ce.createElement(Bt.Z,{width:"100vw",height:Bn,footer:null,closable:!0,placement:"bottom",open:!!Nt,destroyOnClose:!0,maskClosable:!1,mask:!1,rootClassName:`zIndex-9999 ${ke.drawerWrap}`,onClose:()=>{window.saveDrawData(Wn=>{it({src:`/api/attachments/${Wn}`,id:Wn})})},title:ce.createElement(Ht.Z,{align:"middle"},ce.createElement(bn.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),ce.createElement(bn.Z,{onClick:()=>{cr(Bn==="60px"?"100vh":"60px")}},ce.createElement("span",{className:"current c-blue",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77")),ce.createElement(bn.Z,{onClick:()=>{window.saveDrawData(Wn=>{if(Wn===null){dn.ZP.warning({content:"\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u8BF7\u5148\u7ED8\u5236\u6D41\u7A0B\u56FE",key:"saveFlowChart"});return}dn.ZP.success({content:"\u4FDD\u5B58\u6210\u529F",key:"saveFlowChart",style:{zIndex:999999999}}),it({src:`/api/attachments/${Wn}`,id:Wn,disabledClose:!0})})}},ce.createElement(Ge.ZP,{type:"primary",className:"ml20"},"\u4FDD\u5B58")))},ce.createElement("iframe",{src:`${window.ENV==="build"?"/react/build":""}/drawio/src/main/webapp/?id=${je||""}&gapi=0&od=0&db=0&gh=0&gl=0&local=0`,width:"100%",height:"100%",frameBorder:"0",ref:He})))}),pe=ue(11320),oe=ue(78045),ze=ue(31795);const yt=oe.ZP.Group,Vt={margin:"0 8px"};var en=({callback:Hn,onCancel:je})=>{function it(St){Hn(St)}return be.createElement(bt.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:it},be.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},be.createElement("span",{style:Vt},"\u5355\u5143\u683C\u6570\uFF1A"),be.createElement("span",{style:Vt},"\u884C\u6570"),be.createElement(bt.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},be.createElement(ze.Z,null)),be.createElement("span",{style:Vt},"\u5217\u6570"),be.createElement(bt.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},be.createElement(ze.Z,null))),be.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},be.createElement("span",{style:Vt},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),be.createElement(bt.default.Item,{name:"align"},be.createElement(yt,null,be.createElement(oe.ZP,{value:"default"},be.createElement("i",{className:"fa fa-align-justify"})),be.createElement(oe.ZP,{value:"left"},be.createElement("i",{className:"fa fa-align-left"})),be.createElement(oe.ZP,{value:"center"},be.createElement("i",{className:"fa fa-align-center"})),be.createElement(oe.ZP,{value:"right"},be.createElement("i",{className:"fa fa-align-right"}))))),be.createElement("div",{className:"flex-container flex-end"},be.createElement(Ge.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),be.createElement(Ge.ZP,{type:"ghost",onClick:je},"\u53D6\u6D88")))},un=ue(47897),yn=ue(61016),Jt=ue.n(yn),Tr=(0,be.forwardRef)(({use3d:Hn,width:je,height:it,callback:St,showSaveButton:Wt},He)=>{const ht=(0,be.useRef)(),Dt=(0,be.useRef)(),[_t,Nt]=(0,be.useState)(!1),Pt=(0,be.useRef)({id:ht,appName:"graphing",width:je||1e3,height:it||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,be.useEffect)(()=>{Dt.current=new(Jt())(Pt.current,!0),window.onload=function(){Dt.current.inject("applet_container")}},[]);const Bn=()=>{var cr=window.ggbApplet.getPNGBase64(1,!0,72);return St&&St(cr),cr};return(0,be.useEffect)(()=>{Pt.current.appName=_t?"3D":"graphing",Dt.current.inject("applet_container")},[_t]),(0,be.useEffect)(()=>{Nt(Hn)},[Hn]),(0,be.useImperativeHandle)(He,()=>({getImgData:Bn})),be.createElement(be.Fragment,null,be.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:ht}),be.createElement(Ht.Z,{align:"middle"},be.createElement(bn.Z,{flex:1},be.createElement(un.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:_t,onChange:cr=>Nt(cr)})),be.createElement(bn.Z,null,be.createElement(Ge.ZP,{size:"large",onClick:Bn,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),Rt=ue(36527),Ln=ue(25934);const Nr="link",Qr="upload-image",Gn="add-flowchart",Fr="draw-image",Da="add-flowchart",Fi="code-block",Oi="add-table",Ei="------------",ua={default:Ei,left:`:${Ei}`,center:`:${Ei}:`,right:`${Ei}:`};var ba=ue(99914),ka=(Hn,je,it)=>new Promise((St,Wt)=>{var He=_t=>{try{Dt(it.next(_t))}catch(Nt){Wt(Nt)}},ht=_t=>{try{Dt(it.throw(_t))}catch(Nt){Wt(Nt)}},Dt=_t=>_t.done?St(_t.value):Promise.resolve(_t.value).then(He,ht);Dt((it=it.apply(Hn,je)).next())});function ca(){}let Hr=0;const La=1e4,fo="\u2581",Za="@\u2581\u2581@",Wa="@\u2581@",ha=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`,wt=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"];function _n(Hn){return/^\d+$/.test(Hn)?`${Hn}px`:Hn}const Pn=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",xr={[Pn+"-B"]:"bold",[Pn+"-I"]:"italic"},nr={[Nr]:"\u6DFB\u52A0\u94FE\u63A5",[Fi]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[Qr]:"\u6DFB\u52A0\u56FE\u7247",[Fr]:"\u6DFB\u52A0\u753B\u56FE",[Gn]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[Oi]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var ur=({defaultValue:Hn="",onChange:je,width:it="100%",height:St=400,miniToolbar:Wt=!1,isFocus:He=!1,watch:ht,insertTemp:Dt,mode:_t="markdown",id:Nt="markdown-editor-id",showResizeBar:Pt=!1,noStorage:Bn=!1,showNullButton:cr=!1,showNullProgramButton:Wn=!1,hidetoolBar:Un=!1,fullScreen:qn=!1,onBlur:Jn,onCMBeforeChange:Mr,onFullScreen:an,className:Fn="",disablePaste:ci=!1,disabled:gi=!1,disabledFill:Vr=!1,placeholder:Dr="",values:wi="",extraUse:or,onAddBlank:oi})=>{const[hn,Vi]=(0,be.useState)(null),[Si,pa]=(0,be.useState)(Hn),[Wi,_i]=(0,be.useState)(ht),[ia,Ki]=(0,be.useState)(qn),[yi,Gi]=(0,be.useState)(""),[xa,Xi]=(0,be.useState)(0),[Ti,wa]=(0,be.useState)(St),[Aa,aa]=(0,be.useState)(!1),ni=(0,be.useRef)((0,Ln.Z)()),pt=(0,be.useRef)(!1),dt=(0,be.useRef)(),[It,Qt]=(0,be.useState)(0),[Cn,vr]=(0,be.useState)(0),gr=(0,be.useRef)(),Er=(0,be.useRef)(),Br=(0,be.useRef)(),kr=(0,be.useRef)(),Yr=(0,be.useRef)(),si=(0,be.useRef)(),bi=()=>ka(void 0,null,function*(){var tn;const Yt=yield Fetch("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:ni.current}});(tn=Yt==null?void 0:Yt.attachments)!=null&&tn.length&&(console.log("cm:",hn,gr),Yt.attachments.map(fn=>{fn.content_type.indexOf("image")>-1?hn.replaceSelection(`![,](/api/attachments/${fn.id}?type=${fn.content_type})`):fn.content_type.indexOf("video")>-1?hn.replaceSelection(`<video width="100%" controls src="${pe.Z.API_SERVER}/api/attachments/${data.id}"></video>`):fn.content_type.indexOf("pdf")>-1?hn.replaceSelection(`<a href="${pe.Z.API_SERVER}/api/attachments/${fn.id}?type=${fn.content_type}&disposition=inline" target="_blank">${fn.name}</a>`):hn.replaceSelection(`[${fn.name}](${pe.Z.API_SERVER}/api/attachments/${fn.id}?type=${fn.content_type})`)}))});(0,be.useEffect)(()=>{const tn=window.scrollY||window.pageYOffset;pa(wi),hn==null||hn.setValue(wi),window.scrollTo(0,tn)},[wi]),(0,be.useEffect)(()=>{an==null||an(ia)},[ia]),(0,be.useEffect)(()=>{if(gr.current){let tn=function(fn,xn){var Yn;if(ci){xn.preventDefault();return}const $n=xn.clipboardData;if($n){const On=$n.types.toString(),Kn=$n.items;if(On==="Files"||$n.types.indexOf("Files")>-1){if(xn.preventDefault(),_t=="stex")return;try{let zn=Kn[1];((Yn=Kn[0])==null?void 0:Yn.kind)==="file"&&(zn=Kn[0]);const tr=zn.getAsFile(),$e=tr.name.split(".").pop();(0,Je.I)(tr,Ke=>{var Ct,ft,Kt;Ke.id?((Ct=tr==null?void 0:tr.type)==null?void 0:Ct.indexOf("image"))>-1?Yt.replaceSelection(`<img width="100%" src="/api/attachments/${Ke.id}?type=${Ke.content_type})" alt="" />`):((ft=tr==null?void 0:tr.type)==null?void 0:ft.indexOf("video"))>-1?Yt.replaceSelection(`<video width="100%" controls src="/api/attachments/${Ke.id}"></video>`):((Kt=tr==null?void 0:tr.type)==null?void 0:Kt.indexOf("pdf"))>-1?Yt.replaceSelection(`<a href="/api/attachments/${Ke.id}?type=${tr.type}&disposition=inline" target="_blank">${tr.name}</a>`):wt.includes($e)?Yt.replaceSelection(`<a href="/api/attachments/${Ke.id}?type=office&disposition=inline" target="_blank">${tr.name}</a>`):Yt.replaceSelection(`[${tr.name}](/api/attachments/${Ke.id}?type=${Ke.content_type})`):(Ke==null?void 0:Ke.status)===401&&(dn.ZP.warning((Ke==null?void 0:Ke.message)||"\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C"),document.location.href="/user/login")})}catch(zn){dn.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const Yt=Fe().fromTextArea(gr.current,{mode:_t,lineNumbers:!Wt,lineWrapping:!0,value:Hn,autoCloseTags:!Wn,autoCloseBrackets:!0});return Yt.on("keyup",function(fn,xn){xn.keyCode===8&&(fn.getValue()==""?Yt.setOption("placeholder",Dr):Yt.setOption("placeholder",null))}),Yt.on("keydown",function(fn,xn){if(xn.keyCode===8){var Yn=Ri(fn);Yn&&xn.preventDefault()}}),He&&Yt.focus(),Yt.on("paste",tn),Yt.on("dragleave",function(fn,xn){Er.current.classList.remove("mouse-hover-md")}),gi&&Yt.on("beforeChange",function(fn,xn){(xn.origin==="paste"||xn.origin==="+input")&&xn.cancel()}),Vi(Yt),()=>{Yt.off("paste",tn)}}},[]);const Hi=(0,be.useCallback)(()=>{if(Er.current)try{}catch(tn){console.log(tn,"---- to set md editor body height")}},[Ti,Er,ia]);(0,be.useEffect)(()=>{function tn(){let Yt=new qe.Z(fn=>{for(let xn of fn)(xn.target.offsetHeight>0||xn.target.offsetWidth>0)&&(Hi(),hn.setSize("100%","100%"),hn.refresh())});return Yt.observe(gr.current.parentElement),Yt}if(hn){const Yt=tn();return()=>{var fn,xn;(fn=gr.current)!=null&&fn.parentElement&&Yt.unobserve((xn=gr.current)==null?void 0:xn.parentElement)}}},[hn,Hi]),(0,be.useEffect)(()=>{if(hn){let tn=[];for(const[Yt,fn]of Object.entries(xr)){let xn={[Yt]:()=>{Di(fn)}};tn.push(xn),hn.addKeyMap(xn)}return dt.current=setInterval(()=>{pt.current&&bi()},4e3),()=>{clearInterval(dt.current);for(let Yt of tn)hn.removeKeyMap(Yt)}}},[hn]),(0,be.useEffect)(()=>{qn!==ia&&Ki(qn)},[qn]),(0,ba.Z)(()=>{if(!Bn&&xa>0){let tn=new Date().getTime(),Yt=window.sessionStorage.getItem(Nt);tn>=xa+La&&(!Yt||Yt!==Si)&&(window.sessionStorage.setItem(Nt,Si),aa(!0))}},La),(0,be.useEffect)(()=>{_i(ht)},[hn,ht]),(0,be.useEffect)(()=>{hn&&He&&hn.focus()},[hn,He]),(0,be.useEffect)(()=>{if(Wi&&hn){let tn=function(fn){let xn=fn.target;if(kr.current){let Yn=xn.scrollTop/xn.scrollHeight;kr.current.scrollTop=kr.current.scrollHeight*Yn}};const Yt=hn.getScrollerElement();return Yt.addEventListener("scroll",tn),()=>{Yt.removeEventListener("scroll",tn)}}},[hn,Wi]),(0,be.useEffect)(()=>{if(hn&&Mr){let tn=function(Yt,fn){Mr(Yt,fn)};return hn.on("beforeChange",tn),()=>{hn.off("beforeChange",tn)}}},[hn,Mr]),(0,be.useEffect)(()=>{if(hn&&Jn){let tn=function(){Jn(hn.getValue())};return hn.on("blur",tn),()=>{hn.off("blur",tn)}}},[hn,Jn]);function Ri(tn,Yt){var fn=tn.getDoc(),xn=fn.getCursor(),Yn=fn.getLine(xn.line),$n=Yn.charAt(xn.ch-1),On=Yn.lastIndexOf("@\u2581@",xn.ch),Kn=Yn.lastIndexOf("@\u2581\u2581@",xn.ch),zn=On>Kn?On:Kn,tr=On>Kn?3:4;if(Za.indexOf($n)===-1)return null;if(console.log("change1:",Yt,tn,Yn,xn,zn,On,Kn,$n),zn>=0&&xn.ch-zn<5){var $e=zn+tr;return fn.replaceRange("",{line:xn.line,ch:zn},{line:xn.line,ch:$e}),{line:xn.line,ch:$e}}return null}(0,be.useEffect)(()=>{if(hn){let tn=function(Yt,fn){const xn=Yt.getValue();pa(xn),Xi(new Date().getTime()),Yt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),je&&(Wn?je(xn,zt(xn)):je(xn))};return hn.on("change",tn),()=>{hn.off("change",tn)}}},[hn,je]),(0,be.useEffect)(()=>{if(hn)if(Hn==null)hn.setValue(""),pa("");else{const tn=window.scrollY||window.pageYOffset;Hn!==hn.getValue()&&(hn.setValue(Hn),pa(Hn),hn.setCursor(gi?1:hn.lineCount(),0),window.scrollTo(0,tn))}},[hn,Hn]);const Di=(0,be.useCallback)(tn=>{const Yt=hn.getCursor(),fn=hn.getSelection();let xn=fn.split(`
`);switch(tn){case"bold":return hn.replaceSelection("**"+fn+"**"),fn===""&&hn.setCursor(Yt.line,Yt.ch+2),hn.focus();case"italic":return hn.replaceSelection("*"+fn+"*"),fn===""&&hn.setCursor(Yt.line,Yt.ch+1),hn.focus();case"code":return hn.replaceSelection("`"+fn+"`"),fn===""&&hn.setCursor(Yt.line,Yt.ch+1),hn.focus();case"inline-latex":return Gi("inline-latex"),hn.focus();case"latex":return hn.replaceSelection("```latex\n"+fn+"\n```"),hn.setCursor(Yt.line+1,fn.length+1),hn.focus();case"line-break":return hn.replaceSelection(`<br/>
`),hn.focus();case"list-ul":return fn===""?hn.replaceSelection("- "+fn):hn.replaceSelection(xn.map(Yn=>Yn===""?"":`- ${Yn}`).join(`
`)),hn.focus();case"list-ol":return fn===""?hn.replaceSelection("1. "+fn):hn.replaceSelection(xn.map((Yn,$n)=>Yn===""?"":`${$n+1}. ${Yn}`).join(`
`)),hn.focus();case"add-null-ch":oi==null||oi();return;case"add-signal":return fn===""&&hn.setCursor(Yt.line,Yt.ch),hn.replaceSelection(Wa),hn.focus();case"add-multiple":return fn===""&&hn.setCursor(Yt.line,Yt.ch),hn.replaceSelection(Za),hn.focus();case"inster-template-1":return fn===""&&hn.setCursor(Yt.line,Yt.ch),hn.replaceSelection(ha),hn.focus();case"eraser":return hn.setValue(""),hn.focus();case"trigger-watch":return _i(!Wi),hn.focus();case"trigger-full-screen":return Ki(!ia),hn.focus();case Nr:Gi(Nr);return;case Fi:Gi(Fi);return;case Qr:Gi(Qr);return;case Fr:Gi(Fr);return;case"maths-latex":Gi("maths-latex");return;case Gn:Yr.current="",sessionStorage.removeItem("file_id"),Gi(Gn);return;case Oi:Gi(Oi);return;default:throw new Error}},[hn,Wi,ia]),Le=(0,be.useCallback)((tn,Yt)=>{var fn,xn,Yn,$n,On,Kn;Gi("");const{src:zn,alt:tr,id:$e}=tn||{};switch(yi){case Nr:const{title:on,link:nn}=tn;return hn.replaceSelection(`[${on}](${nn})`),hn.focus();case Fi:const{language:En,content:pn}=tn;return hn.replaceSelection(["```"+En,pn,"```"].join(`
`)),hn.focus();case"maths-latex":for(var Ke=atob(tn),Ct=new Uint8Array(Ke.length),ft=0;ft<Ke.length;ft++)Ct[ft]=Ke.charCodeAt(ft);var Kt=new Blob([Ct],{type:"image/png"});(0,Je.I)(Kt,Lr=>{Lr.id?hn.replaceSelection(`![,](/api/attachments/${Lr.id}?type=${Lr.content_type})`):(Lr==null?void 0:Lr.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":hn.replaceSelection("`$$"+tn+"$$`");break;case Da:if(!$e)return;hn.focus(),hn.getValue().indexOf(zn)===-1?hn.replaceSelection(`<center><img id="${$e}" width="80%" src="${zn}" class="draw-flowchart" alt="${tr||""}" /></center>`):document.getElementById($e).src=pe.Z.API_SERVER+zn+"?t="+Date.now();try{setTimeout(()=>{Jn(hn.getValue())},100)}catch(Lr){}break;case Qr:case Fr:const Zt=Yt,wn=(Yn=(xn=(fn=Zt==null?void 0:Zt.name)==null?void 0:fn.split("."))==null?void 0:xn.pop)==null?void 0:Yn.call(xn);return(($n=Zt==null?void 0:Zt.type)==null?void 0:$n.indexOf("image"))>-1||!(Zt!=null&&Zt.type)?Zt!=null&&Zt.align||Zt!=null&&Zt.width?hn.replaceSelection(`<p style="text-align:${Zt.align||"initial"}"><img width="${Zt.width?Zt.width+"%":"initial"}" src="${zn}" alt="${tr||""}" /></p>`):hn.replaceSelection(`<img width="100%" src="${zn}" alt="${tr||""}" />`):((On=Zt==null?void 0:Zt.type)==null?void 0:On.indexOf("video"))>-1?hn.replaceSelection(`<video width="100%" controls src="${zn}"></video>`):((Kn=Zt==null?void 0:Zt.type)==null?void 0:Kn.indexOf("pdf"))>-1?hn.replaceSelection(`<a href="${zn}?type=${Zt.type}&disposition=inline" target="_blank">${Zt.name}</a>`):wt.includes(wn)?hn.replaceSelection(`<a href="${zn}?type=office&disposition=inline" target="_blank">${Zt.name}</a>`):hn.replaceSelection(`[${Zt.name}](${zn})`),hn.focus();case Oi:const{row:kn,col:er,align:Mn}=tn;let dr=`
`;for(let Lr=0;Lr<kn;Lr++){let pr=[],wr=[];for(let ir=0;ir<er;ir++)Lr===1&&wr.push(ua[Mn]),pr.push(" ");Lr===1&&(dr+=`| ${wr.join(" | ")} |
`),dr+=`| ${pr.join(er===1?"":" | ")} |
`}return hn.replaceSelection(dr+`
`),hn.focus();default:throw new Error}},[hn,yi]),Re=(0,be.useMemo)(()=>{switch(yi){case Nr:return be.createElement(gn,{callback:Le,onCancel:Oe});case Fi:return be.createElement(Xt.Z,{callback:Le,onCancel:Oe});case Qr:return be.createElement(Je.Z,{callback:Le,onCancel:Oe});case Gn:return be.createElement(ve,{editImgId:Yr.current,callback:Le,onCancel:Oe});case Oi:return be.createElement(en,{callback:Le,onCancel:Oe});case"maths-latex":return be.createElement(Tr,{showSaveButton:!0,callback:Le});case"inline-latex":return be.createElement(Rt.Z,{showSaveButton:!0,callback:Le});default:return null}},[yi]);function Oe(){Gi("")}(0,be.useEffect)(()=>{if(Br.current){let tn=function(On){Yn=!0,$n=On.pageY},Yt=function(){Yn=!1},fn=function(On){if(Yn){let Kn=On.pageY-$n;Kn<0&&(Kn=0),Kn>300&&(Kn=300);let zn=St+Kn+"px";wa(zn)}},xn=Br.current,Yn=!1,$n=0;return xn.addEventListener("mousedown",tn),document.addEventListener("mousemove",fn),document.addEventListener("mouseup",Yt),()=>{xn.removeEventListener("mousedown",tn),document.removeEventListener("mousemove",fn),document.removeEventListener("mouseup",Yt)}}},[hn,Br]),(0,be.useEffect)(()=>{wa(St)},[St]);const We=_n(it),nt=_n(Ti),st={width:We,height:nt},mt=(0,be.useMemo)(()=>{if(xa){let tn=new Date(xa),Yt=tn.getHours(),fn=tn.getMinutes(),xn=tn.getSeconds();return Yt=Yt<10?"0"+Yt:Yt,fn=fn<10?"0"+fn:fn,xn=xn<10?"0"+xn:xn,`${Yt}:${fn}:${xn}`}return 0},[xa]),zt=tn=>{const Yt=[];if(Wn){let fn=-1;tn=tn.replace(/(@▁▁@|@▁@)/g,function(xn,Yn,$n){Yt.push({multiLine:xn!==Wa})})}return Yt};function jt(){window.sessionStorage.removeItem(Nt),aa(!1),Xi(0)}function Nn(){aa(!1),Xi(0),hn.setValue(window.sessionStorage.getItem(Nt))}(0,be.useEffect)(()=>{nr[yi]&&yi!==Fr&&yi!==Gn&&setTimeout(()=>{const tn=document.getElementsByClassName("markdown-popup-form")[0],Yt=window.innerWidth/2-tn.offsetWidth/2,fn=window.innerHeight/2-tn.offsetHeight/2;Qt(Yt),vr(fn)},0)},[yi]);const Qn=tn=>{tn.preventDefault();const Yt=tn.clientX-It,fn=tn.clientY-Cn;document.body.onmousemove=xn=>{let Yn=xn.clientX-Yt,$n=xn.clientY-fn;const On=document.getElementsByClassName("markdown-popup-form")[0],Kn=window.innerWidth-On.offsetWidth,zn=window.innerHeight-On.offsetHeight;Yn=Math.max(0,Math.min(Yn,Kn)),$n=Math.max(0,Math.min($n,zn)),Dn(xn.clientX,xn.clientY,Yt,fn)&&(Qt(Yn),vr($n))},document.body.onmouseup=function(){document.body.onmousemove=null}},Dn=(tn,Yt,fn,xn)=>{const Yn=document.body.clientHeight,$n=document.body.clientWidth;return tn<20&&fn>tn||tn>$n-20&&fn<tn||Yt<20&&xn>Yt||Yt>Yn-20&&xn<Yt?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return be.createElement(be.Fragment,null,be.createElement("div",{className:"markdown-editor-wrapper",ref:Er},be.createElement("div",{className:`markdown-editor-container ${Fn} ${Wi?"on-preview":""} ${Wt?"mini":""} ${ia?"full-screen":""}`,style:st},be.createElement(Ze,{insertTemp:Dt,watch:Wi,fullScreen:ia,showNullButton:cr,showNullProgramButton:Wn,onActionCallback:Di,hidetoolBar:Un,extraUse:or}),be.createElement("div",{className:"markdown-editor-body"},be.createElement("div",{className:"codemirror-container"},be.createElement("textarea",{ref:gr,placeholder:Dr})),Wi?be.createElement("div",{ref:kr,className:"preview-container"},_t==="stex"&&be.createElement(Ne,{value:Si}),_t!=="stex"&&be.createElement(ct.Z,{edit:!0,disabledFill:Vr,showProgramFill:Wn,value:Si,openEditor:tn=>{var Yt;Yr.current=tn,(Yt=si.current)==null||Yt.setHeight("100vh"),setTimeout(()=>{Gi("add-flowchart")},150)}})):null))),Pt?be.createElement("a",{ref:Br,className:"editor-resize"}):null,yi===Fr&&be.createElement($t,{callback:Le,onCancel:Oe}),yi===Gn&&be.createElement(ve,{ref:si,editImgId:Yr.current,callback:Le,onCancel:Oe}),be.createElement(At.Z,null,nr[yi]&&yi!==Fr&&yi!==Gn?be.createElement(rt.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:It,top:Cn},title:be.createElement("div",{style:{cursor:"move"},onMouseDown:Qn},nr[yi]),open:!0,onCancel:Oe,footer:null,destroyOnClose:!0,width:yi===Gn?"1200px":null,height:yi===Gn?"80vh":null,className:"markdown-popup-form"},Re):null))}},70859:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return Ue},I:function(){return At}});var be=ue(22150),tt=ue(2453),Fe=ue(69677),qe=ue(93421),ye=ue(31795),Ce=ue(78045),Me=ue(71577),we=ue(15476),he=ue(67294),De=ue(52262),ct=ue(67294),Ne=Object.defineProperty,Mt=Object.defineProperties,ut=Object.getOwnPropertyDescriptors,Qe=Object.getOwnPropertySymbols,Xe=Object.prototype.hasOwnProperty,Te=Object.prototype.propertyIsEnumerable,Et=(bt,xt,Ge)=>xt in bt?Ne(bt,xt,{enumerable:!0,configurable:!0,writable:!0,value:Ge}):bt[xt]=Ge,Lt=(bt,xt)=>{for(var Ge in xt||(xt={}))Xe.call(xt,Ge)&&Et(bt,Ge,xt[Ge]);if(Qe)for(var Ge of Qe(xt))Te.call(xt,Ge)&&Et(bt,Ge,xt[Ge]);return bt},et=(bt,xt)=>Mt(bt,ut(xt));const{useForm:lt}=be.default,Ie={width:280,marginRight:10},_e={labelCol:{span:5},wrapperCol:{span:19}};var Ue=({callback:bt,onCancel:xt})=>{const[Ge]=lt();let Ot=(0,he.useRef)();function kt(cn){Ot.current.width=Ge.getFieldValue("width"),Ot.current.align=Ge.getFieldValue("align"),bt(cn,Ot.current)}function vn(cn,An){if(cn.status===-1){tt.ZP.error(cn.message);return}Ge.setFieldsValue({src:`/api/attachments/${cn.id}`,type:An.type})}function qt(cn){let An=cn.target.files[0];Ot.current=An,At(An,vn)}return ct.createElement(be.default,et(Lt({form:Ge},_e),{className:"upload-image-panel",onFinish:kt,style:{width:470,overflow:"hidden"}}),ct.createElement(be.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},ct.createElement("div",{className:"flex-container"},ct.createElement(be.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},ct.createElement(Fe.default,{style:Ie})),ct.createElement(Ze,{onFileChange:qt}))),ct.createElement(be.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},ct.createElement(Fe.default,{style:{width:264}})),ct.createElement(be.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},ct.createElement(qe.Z,null,ct.createElement(be.default.Item,{name:"width",style:{margin:0}},ct.createElement(ye.Z,{style:{width:264}})),ct.createElement("span",{className:"ml8"},"%"))),ct.createElement(be.default.Item,{label:"\u5BF9\u9F50\u65B9\u5F0F",name:"align"},ct.createElement(Ce.ZP.Group,{name:"align",defaultValue:1,options:[{value:"left",label:"\u5DE6\u5BF9\u9F50"},{value:"center",label:"\u5C45\u4E2D\u5BF9\u9F50"},{value:"right",label:"\u53F3\u5BF9\u9F50"}]})),ct.createElement("aside",null,ct.createElement(be.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},ct.createElement(Me.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),ct.createElement(Me.ZP,{type:"default",onClick:xt},"\u53D6\u6D88"))))};function Ze({onFileChange:bt}){return ct.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",ct.createElement("input",{type:"file",onChange:bt}))}function At(bt,xt){if(!bt)throw new String("\u6CA1\u6709\u6587\u4EF6");if(!(0,De.bg)())throw tt.ZP.warning("\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C"),new String("\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C");let Ge=new FormData;Ge.append("editormd-image-file",bt),Ge.append("file_param_name","editormd-image-file"),Ge.append("byxhr","true");var Ot=new window.XMLHttpRequest;Ot.withCredentials=!0,Ot.addEventListener("load",function(kt){xt(JSON.parse(kt.target.responseText),bt)},!1),Ot.addEventListener("error",function(kt){console.error(kt)},!1),Ot.open("POST",`${we.KI}/api/attachments.json`),Ot.send(Ge)}},76621:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return Fe}});var be=ue(67294),tt=ue(73935);class Fe extends be.Component{constructor(ye){super(ye);const Ce=window.document;this.node=Ce.createElement("div"),Ce.body.appendChild(this.node)}render(){const{children:ye}=this.props;return(0,tt.createPortal)(ye,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},99914:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return tt}});var be=ue(67294);function tt(Fe,qe){const ye=(0,be.useRef)();(0,be.useEffect)(()=>{ye.current=Fe}),(0,be.useEffect)(()=>{function Ce(){ye.current()}if(qe!==null){let Me=setInterval(Ce,qe);return()=>clearInterval(Me)}},[qe])}},80358:function(mn,Ut,ue){"use strict";ue.r(Ut),ue.d(Ut,{default:function(){return qt}});var be=ue(67294),tt=ue(35973),Fe=ue(11713),qe=ue(69677),ye=ue(14446),Ce=ue(84567),Me=ue(83062),we=ue(31795),he=ue(71577),De=ue(2453),ct=ue(91304),Ne=ue(93686),Mt=ue(96486),ut={flex_box_center:"flex_box_center___WDeol",flex_space_between:"flex_space_between___IWsL9",flex_box_vertical_center:"flex_box_vertical_center___oFPfv",flex_box_center_end:"flex_box_center_end___Upl2t",flex_box_column:"flex_box_column___Fg5BW",bg:"bg___Mm1RQ",flexRow:"flexRow___O5kWk",flexJustifyCenter:"flexJustifyCenter___zJfFU",flexAlignEnd:"flexAlignEnd___dNXu7",flexAlingCenter:"flexAlingCenter___VH6yX",flexAlignCenter:"flexAlignCenter___gLYIu",flexColumn:"flexColumn___F9Lnl",formWrap:"formWrap___TOxFp",titleWrap:"titleWrap____eUj3",fieldWrap:"fieldWrap___A8TH3",mdWrap:"mdWrap___b3UIq",backgroundFa:"backgroundFa___tmpwD",button:"button___RPcpM",icons:"icons___Q_4QK",navBar:"navBar___WTBHk",active:"active___hgO9F",tipWrap:"tipWrap___sN5ih",tip:"tip___CiN7X",width300:"width300___rIz4g",popover:"popover___YKxuI",groupWrap:"groupWrap___qLGlB",check:"check___mpaLs"},Qe=ue(96670),Xe=ue(33753),Te=ue(25741),Et=ue(85909),Lt=ue(67294),et=Object.defineProperty,lt=Object.defineProperties,Ie=Object.getOwnPropertyDescriptors,_e=Object.getOwnPropertySymbols,Ue=Object.prototype.hasOwnProperty,Ze=Object.prototype.propertyIsEnumerable,At=(cn,An,Zn)=>An in cn?et(cn,An,{enumerable:!0,configurable:!0,writable:!0,value:Zn}):cn[An]=Zn,bt=(cn,An)=>{for(var Zn in An||(An={}))Ue.call(An,Zn)&&At(cn,Zn,An[Zn]);if(_e)for(var Zn of _e(An))Ze.call(An,Zn)&&At(cn,Zn,An[Zn]);return cn},xt=(cn,An)=>lt(cn,Ie(An)),Ge=(cn,An,Zn)=>new Promise((Ye,Ee)=>{var Tt=Je=>{try{Xt(Zn.next(Je))}catch(rt){Ee(rt)}},gn=Je=>{try{Xt(Zn.throw(Je))}catch(rt){Ee(rt)}},Xt=Je=>Je.done?Ye(Je.value):Promise.resolve(Je.value).then(Tt,gn);Xt((Zn=Zn.apply(cn,An)).next())});const{Option:Ot}=Fe.default,{TextArea:kt}=qe.default,vn=({shixunsDetail:cn,dispatch:An,practiceSetting:Zn})=>{const Ye=(0,tt.useParams)(),[Ee,Tt]=(0,be.useState)({}),[gn,Xt]=(0,be.useState)([]),[Je,rt]=(0,be.useState)(!1),Ht=(0,be.useRef)(null),Sn=(0,be.useRef)({editData:null,answerList:null}),[sn,$t]=(0,be.useState)(!0);(0,be.useEffect)(()=>{Bt()},[]),(0,be.useEffect)(()=>{ce()},[Ee,gn]);const Bt=()=>Ge(void 0,null,function*(){$t(!0),yield bn(),yield dn(),$t(!1)}),bn=()=>Ge(void 0,null,function*(){const pe=yield(0,Ne.ii)({id:Ye.id,challengeId:Ye.challengesId,tab:2});Sn.current.editData=pe,pe&&Tt(pe)}),dn=()=>Ge(void 0,null,function*(){const pe=yield(0,Ne.AE)({id:Ye.id,challengeId:Ye.challengesId}),oe=pe.map(ze=>xt(bt({},ze),{contents:(0,Et.S)(ze.contents)}));Sn.current.answerList=oe,pe&&Xt(oe)}),ke=(pe=!1,oe=1)=>Ge(void 0,null,function*(){var ze;rt(!0);const yt=yield(0,Ne.xK)({id:Ye.id,challengeId:Ye.challengesId,challenge_answer:gn,hide_answer:Ee==null?void 0:Ee.hide_answer,disable_copy:Ee==null?void 0:Ee.disable_copy,sync_origin_shixun:pe});rt(!1),An({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}}),yt.status===1&&((ze=cn==null?void 0:cn.detail)!=null&&ze.copy_for_exercise&&(0,Et.m)(An,cn,Ye.id,oe),tt.history.push(`/shixuns/${Ye.id}/edit/${Ye.challengesId}/tab=4`))}),ce=()=>{clearTimeout(Ht.current),Ht.current=setTimeout(le,500)},le=()=>{!(0,Mt.isEqual)(Sn.current.editData,Ee)||!(0,Mt.isEqual)(Sn.current.answerList,gn)?An({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!0}}):An({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})},ve=()=>{var pe;const oe=()=>{tt.history.push(`/shixuns/${Ye.id}/challenges`),An({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};(pe=Zn==null?void 0:Zn.sideBar)!=null&&pe.confirmLeave?ye.default.confirm({title:"\u79BB\u5F00\u6B64\u9875\u63D0\u793A",content:"\u7CFB\u7EDF\u53EF\u80FD\u4E0D\u4F1A\u4FDD\u5B58\u60A8\u6240\u505A\u7684\u66F4\u6539\u3002",okText:"\u79BB\u5F00",cancelText:"\u53D6\u6D88",onOk:()=>{oe()}}):oe()};return Lt.createElement("section",{className:ut.bg},Lt.createElement("div",{className:ut.formWrap},Lt.createElement(Xe.Z,{activeIndex:2}),Lt.createElement("div",{className:ut.check},Lt.createElement("div",null,Lt.createElement(Ce.default,{checked:Ee==null?void 0:Ee.hide_answer,onChange:pe=>Tt(xt(bt({},Ee),{hide_answer:pe.target.checked}))},"\u9690\u85CF\u53C2\u8003\u7B54\u6848\u6A21\u5757")),Lt.createElement("div",null,Lt.createElement(Ce.default,{checked:Ee==null?void 0:Ee.disable_copy,onChange:pe=>Tt(xt(bt({},Ee),{disable_copy:pe.target.checked}))},"\u7981\u6B62\u590D\u5236\u53C2\u8003\u7B54\u6848"))),Lt.createElement("div",{className:ut.fieldWrap},Lt.createElement("p",null,"\u53EF\u4EE5\u5C06\u53C2\u8003\u7B54\u6848\u5206\u7EA7\u8BBE\u7F6E\uFF0C\u8BA9\u5B66\u5458\u81EA\u884C\u9009\u62E9\u7EA7\u522B\uFF0C\u6BCF\u7EA7\u67E5\u770B\u540E\u6309\u7167\u6BD4\u4F8B\u6263\u5206\u503C\uFF08\u5B66\u5458\u5DF2\u5B8C\u6210\u4EFB\u52A1\u518D\u67E5\u770B\uFF0C\u5219\u4E0D\u5F71\u54CD\u5B66\u5458\u5DF2\u83B7\u5F97\u7684\u6210\u7EE9\uFF09"),Lt.createElement("p",null,"\u793A\u4F8B\uFF1A\u7EA7\u522B1\uFF0C\u6263\u51CF\u5206\u503C\u5360\u6BD425%\uFF1B\u7EA7\u522B2\uFF0C\u6263\u51CF\u5206\u503C\u5360\u6BD435%\uFF1B\u7EA7\u522B3\uFF0C\u6263\u51CF\u5206\u503C\u5360\u6BD440%\uFF1B"),Lt.createElement("p",null,"\u82E5\u5B66\u5458\u9009\u62E9\u67E5\u770B\u7EA7\u522B1\u7684\u7B54\u6848\uFF0C\u5C06\u88AB\u6263\u51CF25%\u7684\u5206\u503C\uFF1B\u9009\u62E9\u67E5\u770B\u7EA7\u522B2\u7684\u7B54\u6848\uFF0C\u5C06\u88AB\u6263\u51CF60%\u7684\u5206\u503C\uFF1B\u9009\u62E9\u67E5\u770B\u7EA7\u522B3\u7684\u7B54\u6848\uFF0C\u5C06\u88AB\u6263\u51CF100%\u7684\u5206\u503C\u3002"),gn==null?void 0:gn.map((pe,oe)=>Lt.createElement("div",{key:oe,className:"mt30 pb5"},Lt.createElement("div",{className:ut.flexRow},Lt.createElement("b",{className:"font16"},"\u7EA7\u522B\uFF1A",oe+1),Lt.createElement("div",{className:"tr flex1"},Lt.createElement(Me.Z,{placement:"bottom",title:"\u5220\u9664"},Lt.createElement("span",{className:"font14 c-red current",onClick:()=>{let ze=gn.filter((yt,Vt)=>Vt!==oe);Xt(ze)}},"\u5220\xA0\u9664")))),Lt.createElement("div",{className:ut.contentWrap},Lt.createElement("div",{className:ut.flexRow},Lt.createElement("div",null,Lt.createElement("p",{className:"font16"},"\u540D\u79F0\uFF1A"),Lt.createElement(qe.default,{bordered:!1,value:pe.name,onChange:ze=>{const yt=gn.map((Vt,en)=>en===oe?xt(bt({},Vt),{name:ze.target.value}):Vt);Xt(yt)}})),Lt.createElement("div",{className:"ml10"},Lt.createElement("p",{className:"font16"},"\u6263\u51CF\u5206\u503C\u5360\u6BD4\uFF1A"),Lt.createElement(we.Z,{min:0,max:100,precision:0,value:pe.score,onChange:ze=>{const yt=gn.map((Vt,en)=>en===oe?xt(bt({},Vt),{score:ze}):Vt);Xt(yt)}})))),Lt.createElement("div",{className:"mt10 mb10"},Lt.createElement("div",{className:"font16 mb20"},"\u5185\u5BB9\uFF1A"),Lt.createElement(ct.Z,{placeholder:"\u5EFA\u8BAE\u63D0\u4F9B\u5305\u62EC\u6587\u4EF6\u6240\u6709\u4EE3\u7801\u7684\u5B8C\u6574\u7B54\u6848",defaultValue:pe.contents,onChange:ze=>{const yt=gn.map((Vt,en)=>en===oe?xt(bt({},Vt),{contents:ze}):Vt);Xt(yt)}})))),Lt.createElement("div",null,Lt.createElement(he.ZP,{type:"primary",size:"middle",ghost:!0,style:{width:200},className:"mt10",onClick:()=>{let pe=[...gn,{name:`\u89E3\u9898\u601D\u8DEF${gn.length+1}`,contents:"",score:10,id:null,level:null}];Xt(pe)}},"\u65B0\u589E\u53C2\u8003\u7B54\u6848")))),Lt.createElement(Qe.t,{onOk:()=>{var pe,oe;if(!gn.every(ze=>ze.name)){rt(!1),De.ZP.info("\u8BF7\u5148\u586B\u5199\u53C2\u8003\u7B54\u6848\u540D\u79F0");return}if(!gn.every(ze=>ze.contents)){rt(!1),De.ZP.info("\u8BF7\u5148\u586B\u5199\u53C2\u8003\u7B54\u6848\u5185\u5BB9");return}(pe=cn==null?void 0:cn.detail)!=null&&pe.is_fork_from_creator&&((oe=cn==null?void 0:cn.detail)!=null&&oe.copy_for_exercise)&&(Ee!=null&&Ee.has_relation)?An({type:"classroomList/setActionTabs",payload:{key:"\u540C\u6B65\u4FEE\u6539",type:"taskLevel",fn:(ze,yt)=>{ke(ze,yt)}}}):ke()},className:"customFixedButton",onCancel:ve,loading:Je}),Lt.createElement(Te.Z,{loading:sn}))};var qt=(0,tt.connect)(({shixunsDetail:cn,newCourse:An,globalSetting:Zn,practiceSetting:Ye})=>({shixunsDetail:cn,newCourse:An,globalSetting:Zn,practiceSetting:Ye}))(vn)},33753:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return ye}});var be=ue(67294),tt=ue(14446),Fe=ue(35973);const qe=({activeIndex:Ce,isEdit:Me=!0,dispatch:we,practiceSetting:he})=>{const De=(0,Fe.useParams)(),{id:ct,challengesId:Ne}=De,Mt=(0,be.useMemo)(()=>[{name:"\u672C\u5173\u4EFB\u52A1",url:`/shixuns/${ct}/edit/${Ne}/editcheckpoint`},{name:"\u8BC4\u6D4B\u8BBE\u7F6E",url:`/shixuns/${ct}/edit/${Ne}/tab=2`},{name:"\u53C2\u8003\u7B54\u6848",url:`/shixuns/${ct}/edit/${Ne}/tab=3`},{name:"\u5173\u5361\u6392\u884C\u699C",url:`/shixuns/${ct}/edit/${Ne}/tab=4`}],[ct,Ne]),ut=Qe=>{var Xe;const Te=()=>{Fe.history.push(Qe),we({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};(Xe=he==null?void 0:he.sideBar)!=null&&Xe.confirmLeave?tt.default.confirm({title:"\u79BB\u5F00\u6B64\u9875\u63D0\u793A",content:"\u7CFB\u7EDF\u53EF\u80FD\u4E0D\u4F1A\u4FDD\u5B58\u60A8\u6240\u505A\u7684\u66F4\u6539\u3002",okText:"\u79BB\u5F00",cancelText:"\u53D6\u6D88",onOk:()=>{Te()}}):Te()};return be.createElement("ul",{className:"challenge-nav"},Me?Mt.map((Qe,Xe)=>Ce===Xe?be.createElement("li",{key:Qe.url}," ",be.createElement("a",{className:"active"},Qe.name)," "):be.createElement("li",{key:Qe.url}," ",be.createElement("a",{onClick:()=>ut(Qe.url)},Qe.name)," ")):be.createElement("li",{key:Mt[0].url}," ",be.createElement("a",{className:"active"},Mt[0].name)," "))};var ye=(0,Fe.connect)(({globalSetting:Ce,practiceSetting:Me})=>({globalSetting:Ce,practiceSetting:Me}))(qe)},25741:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return ye}});var be=ue(67294),tt=ue(57953),Fe={loading:"loading___lueiN"},ye=({loading:Ce})=>Ce?be.createElement("div",{className:Fe.loading},be.createElement(tt.Z,null)):be.createElement(be.Fragment,null)},85909:function(mn,Ut,ue){"use strict";ue.d(Ut,{S:function(){return Ce},m:function(){return Me}});var be=ue(28706),tt=ue(2453),Fe=ue(14446),qe=ue(67294),ye=(we,he,De)=>new Promise((ct,Ne)=>{var Mt=Xe=>{try{Qe(De.next(Xe))}catch(Te){Ne(Te)}},ut=Xe=>{try{Qe(De.throw(Xe))}catch(Te){Ne(Te)}},Qe=Xe=>Xe.done?ct(Xe.value):Promise.resolve(Xe.value).then(Mt,ut);Qe((De=De.apply(we,he)).next())});const Ce=we=>{let he=document.createElement("textarea");return he.value=we,he.value},Me=(we,he,De,ct,Ne)=>ye(void 0,null,function*(){var Mt,ut;const Qe=yield we({type:"shixunsDetail/saveCopyForExercise",payload:{id:De,save_type:ct}});ct===1?((Qe==null?void 0:Qe.status)==0&&tt.ZP.success("\u4FDD\u5B58\u6210\u529F"),(Mt=Qe==null?void 0:Qe.data)!=null&&Mt.exists_same_shixun_name?we({type:"classroomList/setActionTabs",payload:{key:"\u91CD\u540D\u4FEE\u6539",name:(ut=Qe==null?void 0:Qe.data)==null?void 0:ut.shixun_name}}):we({type:"classroomList/setActionTabs",payload:{}})):(we({type:"classroomList/setActionTabs",payload:{}}),(Qe==null?void 0:Qe.status)===0&&Fe.default.info({title:"\u63D0\u793A",width:460,icon:null,centered:!0,content:qe.createElement("div",null,qe.createElement("div",null,"\u5B9E\u8BAD\u540C\u6B65\u4FEE\u6539\u5B8C\u6210\uFF0C\u8BF7\u9A8C\u8BC1\u5B9E\u8BAD\u662F\u5426\u53EF\u4EE5\u6B63\u5E38\u4F7F\u7528\u3002")),okText:"\u524D\u5F80\u539F\u5B9E\u8BAD",onOk:()=>{var Xe,Te;(0,be.xg)(`/shixuns/${(Te=(Xe=he==null?void 0:he.detail)==null?void 0:Xe.fork_from)==null?void 0:Te.fork_identifier}/challenges`)}}))})},9708:function(mn,Ut,ue){"use strict";ue.d(Ut,{F:function(){return ye},Z:function(){return qe}});var be=ue(94184),tt=ue.n(be);const Fe=null;function qe(Ce,Me,we){return tt()({[`${Ce}-status-success`]:Me==="success",[`${Ce}-status-warning`]:Me==="warning",[`${Ce}-status-error`]:Me==="error",[`${Ce}-status-validating`]:Me==="validating",[`${Ce}-has-feedback`]:we})}const ye=(Ce,Me)=>Me||Ce},84567:function(mn,Ut,ue){"use strict";ue.d(Ut,{default:function(){return Ue}});var be=ue(94184),tt=ue.n(be),Fe=ue(95860),qe=ue(67294),ye=ue(53124),Ce=ue(98866),Me=ue(65223),he=qe.createContext(null),De=ue(63185),ct=ue(45353),Ne=ue(92429),Mt=function(Ze,At){var bt={};for(var xt in Ze)Object.prototype.hasOwnProperty.call(Ze,xt)&&At.indexOf(xt)<0&&(bt[xt]=Ze[xt]);if(Ze!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ge=0,xt=Object.getOwnPropertySymbols(Ze);Ge<xt.length;Ge++)At.indexOf(xt[Ge])<0&&Object.prototype.propertyIsEnumerable.call(Ze,xt[Ge])&&(bt[xt[Ge]]=Ze[xt[Ge]]);return bt};const ut=(Ze,At)=>{var bt;const{prefixCls:xt,className:Ge,rootClassName:Ot,children:kt,indeterminate:vn=!1,style:qt,onMouseEnter:cn,onMouseLeave:An,skipGroup:Zn=!1,disabled:Ye}=Ze,Ee=Mt(Ze,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]),{getPrefixCls:Tt,direction:gn,checkbox:Xt}=qe.useContext(ye.E_),Je=qe.useContext(he),{isFormItemInput:rt}=qe.useContext(Me.aM),Ht=qe.useContext(Ce.Z),Sn=(bt=(Je==null?void 0:Je.disabled)||Ye)!==null&&bt!==void 0?bt:Ht,sn=qe.useRef(Ee.value);qe.useEffect(()=>{Je==null||Je.registerValue(Ee.value)},[]),qe.useEffect(()=>{if(!Zn)return Ee.value!==sn.current&&(Je==null||Je.cancelValue(sn.current),Je==null||Je.registerValue(Ee.value),sn.current=Ee.value),()=>Je==null?void 0:Je.cancelValue(Ee.value)},[Ee.value]);const $t=Tt("checkbox",xt),[Bt,bn]=(0,De.ZP)($t),dn=Object.assign({},Ee);Je&&!Zn&&(dn.onChange=function(){Ee.onChange&&Ee.onChange.apply(Ee,arguments),Je.toggleOption&&Je.toggleOption({label:kt,value:Ee.value})},dn.name=Je.name,dn.checked=Je.value.includes(Ee.value));const ke=tt()(`${$t}-wrapper`,{[`${$t}-rtl`]:gn==="rtl",[`${$t}-wrapper-checked`]:dn.checked,[`${$t}-wrapper-disabled`]:Sn,[`${$t}-wrapper-in-form-item`]:rt},Xt==null?void 0:Xt.className,Ge,Ot,bn),ce=tt()({[`${$t}-indeterminate`]:vn},Ne.A,bn),le=vn?"mixed":void 0;return Bt(qe.createElement(ct.Z,{component:"Checkbox",disabled:Sn},qe.createElement("label",{className:ke,style:Object.assign(Object.assign({},Xt==null?void 0:Xt.style),qt),onMouseEnter:cn,onMouseLeave:An},qe.createElement(Fe.Z,Object.assign({"aria-checked":le},dn,{prefixCls:$t,className:ce,disabled:Sn,ref:At})),kt!==void 0&&qe.createElement("span",null,kt))))};var Xe=qe.forwardRef(ut),Te=ue(74902),Et=ue(10366),Lt=function(Ze,At){var bt={};for(var xt in Ze)Object.prototype.hasOwnProperty.call(Ze,xt)&&At.indexOf(xt)<0&&(bt[xt]=Ze[xt]);if(Ze!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ge=0,xt=Object.getOwnPropertySymbols(Ze);Ge<xt.length;Ge++)At.indexOf(xt[Ge])<0&&Object.prototype.propertyIsEnumerable.call(Ze,xt[Ge])&&(bt[xt[Ge]]=Ze[xt[Ge]]);return bt};const et=(Ze,At)=>{const{defaultValue:bt,children:xt,options:Ge=[],prefixCls:Ot,className:kt,rootClassName:vn,style:qt,onChange:cn}=Ze,An=Lt(Ze,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]),{getPrefixCls:Zn,direction:Ye}=qe.useContext(ye.E_),[Ee,Tt]=qe.useState(An.value||bt||[]),[gn,Xt]=qe.useState([]);qe.useEffect(()=>{"value"in An&&Tt(An.value||[])},[An.value]);const Je=qe.useMemo(()=>Ge.map(ve=>typeof ve=="string"||typeof ve=="number"?{label:ve,value:ve}:ve),[Ge]),rt=ve=>{Xt(pe=>pe.filter(oe=>oe!==ve))},Ht=ve=>{Xt(pe=>[].concat((0,Te.Z)(pe),[ve]))},Sn=ve=>{const pe=Ee.indexOf(ve.value),oe=(0,Te.Z)(Ee);pe===-1?oe.push(ve.value):oe.splice(pe,1),"value"in An||Tt(oe),cn==null||cn(oe.filter(ze=>gn.includes(ze)).sort((ze,yt)=>{const Vt=Je.findIndex(un=>un.value===ze),en=Je.findIndex(un=>un.value===yt);return Vt-en}))},sn=Zn("checkbox",Ot),$t=`${sn}-group`,[Bt,bn]=(0,De.ZP)(sn),dn=(0,Et.Z)(An,["value","disabled"]),ke=Ge.length?Je.map(ve=>qe.createElement(Xe,{prefixCls:sn,key:ve.value.toString(),disabled:"disabled"in ve?ve.disabled:An.disabled,value:ve.value,checked:Ee.includes(ve.value),onChange:ve.onChange,className:`${$t}-item`,style:ve.style,title:ve.title},ve.label)):xt,ce={toggleOption:Sn,value:Ee,disabled:An.disabled,name:An.name,registerValue:Ht,cancelValue:rt},le=tt()($t,{[`${$t}-rtl`]:Ye==="rtl"},kt,vn,bn);return Bt(qe.createElement("div",Object.assign({className:le,style:qt},dn,{ref:At}),qe.createElement(he.Provider,{value:ce},ke)))},lt=qe.forwardRef(et);var Ie=qe.memo(lt);const _e=Xe;_e.Group=Ie,_e.__ANT_CHECKBOX=!0;var Ue=_e},63185:function(mn,Ut,ue){"use strict";ue.d(Ut,{C2:function(){return ye}});var be=ue(14747),tt=ue(45503),Fe=ue(67968);const qe=Ce=>{const{checkboxCls:Me}=Ce,we=`${Me}-wrapper`;return[{[`${Me}-group`]:Object.assign(Object.assign({},(0,be.Wf)(Ce)),{display:"inline-flex",flexWrap:"wrap",columnGap:Ce.marginXS,[`> ${Ce.antCls}-row`]:{flex:1}}),[we]:Object.assign(Object.assign({},(0,be.Wf)(Ce)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${we}`]:{marginInlineStart:0},[`&${we}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[Me]:Object.assign(Object.assign({},(0,be.Wf)(Ce)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:Ce.borderRadiusSM,alignSelf:"center",[`${Me}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${Me}-inner`]:Object.assign({},(0,be.oN)(Ce))},[`${Me}-inner`]:{boxSizing:"border-box",position:"relative",top:0,insetInlineStart:0,display:"block",width:Ce.checkboxSize,height:Ce.checkboxSize,direction:"ltr",backgroundColor:Ce.colorBgContainer,border:`${Ce.lineWidth}px ${Ce.lineType} ${Ce.colorBorder}`,borderRadius:Ce.borderRadiusSM,borderCollapse:"separate",transition:`all ${Ce.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"21.5%",display:"table",width:Ce.checkboxSize/14*5,height:Ce.checkboxSize/14*8,border:`${Ce.lineWidthBold}px solid ${Ce.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${Ce.motionDurationFast} ${Ce.motionEaseInBack}, opacity ${Ce.motionDurationFast}`}},"& + span":{paddingInlineStart:Ce.paddingXS,paddingInlineEnd:Ce.paddingXS}})},{[`
${we}:not(${we}-disabled),
${Me}:not(${Me}-disabled)
`]:{[`&:hover ${Me}-inner`]:{borderColor:Ce.colorPrimary}},[`${we}:not(${we}-disabled)`]:{[`&:hover ${Me}-checked:not(${Me}-disabled) ${Me}-inner`]:{backgroundColor:Ce.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${Me}-checked:not(${Me}-disabled):after`]:{borderColor:Ce.colorPrimaryHover}}},{[`${Me}-checked`]:{[`${Me}-inner`]:{backgroundColor:Ce.colorPrimary,borderColor:Ce.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${Ce.motionDurationMid} ${Ce.motionEaseOutBack} ${Ce.motionDurationFast}`}}},[`
${we}-checked:not(${we}-disabled),
${Me}-checked:not(${Me}-disabled)
`]:{[`&:hover ${Me}-inner`]:{backgroundColor:Ce.colorPrimaryHover,borderColor:"transparent"}}},{[Me]:{"&-indeterminate":{[`${Me}-inner`]:{backgroundColor:Ce.colorBgContainer,borderColor:Ce.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:Ce.fontSizeLG/2,height:Ce.fontSizeLG/2,backgroundColor:Ce.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{[`${we}-disabled`]:{cursor:"not-allowed"},[`${Me}-disabled`]:{[`&, ${Me}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${Me}-inner`]:{background:Ce.colorBgContainerDisabled,borderColor:Ce.colorBorder,"&:after":{borderColor:Ce.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:Ce.colorTextDisabled},[`&${Me}-indeterminate ${Me}-inner::after`]:{background:Ce.colorTextDisabled}}}]};function ye(Ce,Me){const we=(0,tt.TS)(Me,{checkboxCls:`.${Ce}`,checkboxSize:Me.controlInteractiveSize});return[qe(we)]}Ut.ZP=(0,Fe.Z)("Checkbox",(Ce,Me)=>{let{prefixCls:we}=Me;return[ye(we,Ce)]})},88258:function(mn,Ut,ue){"use strict";var be=ue(67294),tt=ue(53124),Fe=ue(32983);const qe=ye=>{const{componentName:Ce}=ye,{getPrefixCls:Me}=(0,be.useContext)(tt.E_),we=Me("empty");switch(Ce){case"Table":case"List":return be.createElement(Fe.Z,{image:Fe.Z.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return be.createElement(Fe.Z,{image:Fe.Z.PRESENTED_IMAGE_SIMPLE,className:`${we}-small`});default:return be.createElement(Fe.Z,null)}};Ut.Z=qe},72565:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return ni}});var be=ue(94184),tt=ue.n(be),Fe=ue(1413),qe=ue(97685),ye=ue(67294),Ce=ue(73935);function Me(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var we={};function he(pt,dt){}function De(pt,dt){}function ct(){we={}}function Ne(pt,dt,It){!dt&&!we[It]&&(pt(!1,It),we[It]=!0)}function Mt(pt,dt){Ne(he,pt,dt)}function ut(pt,dt){Ne(De,pt,dt)}var Qe=null,Xe=ue(71002),Te=ue(18459);function Et(pt,dt,It){var Qt=ye.useRef({});return(!("value"in Qt.current)||It(Qt.current.condition,dt))&&(Qt.current.value=pt(),Qt.current.condition=dt),Qt.current.value}function Lt(pt,dt){typeof pt=="function"?pt(dt):(0,Xe.Z)(pt)==="object"&&pt&&"current"in pt&&(pt.current=dt)}function et(){for(var pt=arguments.length,dt=new Array(pt),It=0;It<pt;It++)dt[It]=arguments[It];var Qt=dt.filter(function(Cn){return Cn});return Qt.length<=1?Qt[0]:function(Cn){dt.forEach(function(vr){Lt(vr,Cn)})}}function lt(){for(var pt=arguments.length,dt=new Array(pt),It=0;It<pt;It++)dt[It]=arguments[It];return Et(function(){return et.apply(void 0,dt)},dt,function(Qt,Cn){return Qt.length===Cn.length&&Qt.every(function(vr,gr){return vr===Cn[gr]})})}function Ie(pt){var dt,It,Qt=(0,Te.isMemo)(pt)?pt.type.type:pt.type;return!(typeof Qt=="function"&&!((dt=Qt.prototype)!==null&&dt!==void 0&&dt.render)||typeof pt=="function"&&!((It=pt.prototype)!==null&&It!==void 0&&It.render))}var _e=ye.createContext(null),Ue=_e,Ze=ue(74902),At=Me()?ye.useLayoutEffect:ye.useEffect,bt=At,xt=function(dt,It){var Qt=React.useRef(!0);At(function(){if(!Qt.current)return dt()},It),At(function(){return Qt.current=!1,function(){Qt.current=!0}},[])},Ge=[];function Ot(pt,dt){var It=ye.useState(function(){if(!Me())return null;var Ri=document.createElement("div");return Ri}),Qt=(0,qe.Z)(It,1),Cn=Qt[0],vr=ye.useRef(!1),gr=ye.useContext(Ue),Er=ye.useState(Ge),Br=(0,qe.Z)(Er,2),kr=Br[0],Yr=Br[1],si=gr||(vr.current?void 0:function(Ri){Yr(function(Di){var Le=[Ri].concat((0,Ze.Z)(Di));return Le})});function bi(){Cn.parentElement||document.body.appendChild(Cn),vr.current=!0}function Hi(){var Ri;(Ri=Cn.parentElement)===null||Ri===void 0||Ri.removeChild(Cn),vr.current=!1}return bt(function(){return pt?gr?gr(bi):bi():Hi(),Hi},[pt]),bt(function(){kr.length&&(kr.forEach(function(Ri){return Ri()}),Yr(Ge))},[kr]),[Cn,si]}function kt(pt,dt){if(!pt)return!1;if(pt.contains)return pt.contains(dt);for(var It=dt;It;){if(It===pt)return!0;It=It.parentNode}return!1}var vn="data-rc-order",qt="rc-util-key",cn=new Map;function An(){var pt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},dt=pt.mark;return dt?dt.startsWith("data-")?dt:"data-".concat(dt):qt}function Zn(pt){if(pt.attachTo)return pt.attachTo;var dt=document.querySelector("head");return dt||document.body}function Ye(pt){return pt==="queue"?"prependQueue":pt?"prepend":"append"}function Ee(pt){return Array.from((cn.get(pt)||pt).children).filter(function(dt){return dt.tagName==="STYLE"})}function Tt(pt){var dt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Me())return null;var It=dt.csp,Qt=dt.prepend,Cn=document.createElement("style");Cn.setAttribute(vn,Ye(Qt)),It!=null&&It.nonce&&(Cn.nonce=It==null?void 0:It.nonce),Cn.innerHTML=pt;var vr=Zn(dt),gr=vr.firstChild;if(Qt){if(Qt==="queue"){var Er=Ee(vr).filter(function(Br){return["prepend","prependQueue"].includes(Br.getAttribute(vn))});if(Er.length)return vr.insertBefore(Cn,Er[Er.length-1].nextSibling),Cn}vr.insertBefore(Cn,gr)}else vr.appendChild(Cn);return Cn}function gn(pt){var dt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},It=Zn(dt);return Ee(It).find(function(Qt){return Qt.getAttribute(An(dt))===pt})}function Xt(pt){var dt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},It=gn(pt,dt);if(It){var Qt=Zn(dt);Qt.removeChild(It)}}function Je(pt,dt){var It=cn.get(pt);if(!It||!kt(document,It)){var Qt=Tt("",dt),Cn=Qt.parentNode;cn.set(pt,Cn),pt.removeChild(Qt)}}function rt(){cn.clear()}function Ht(pt,dt){var It=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Qt=Zn(It);Je(Qt,It);var Cn=gn(dt,It);if(Cn){var vr,gr;if((vr=It.csp)!==null&&vr!==void 0&&vr.nonce&&Cn.nonce!==((gr=It.csp)===null||gr===void 0?void 0:gr.nonce)){var Er;Cn.nonce=(Er=It.csp)===null||Er===void 0?void 0:Er.nonce}return Cn.innerHTML!==pt&&(Cn.innerHTML=pt),Cn}var Br=Tt(pt,It);return Br.setAttribute(An(It),dt),Br}var Sn;function sn(pt){if(typeof document=="undefined")return 0;if(pt||Sn===void 0){var dt=document.createElement("div");dt.style.width="100%",dt.style.height="200px";var It=document.createElement("div"),Qt=It.style;Qt.position="absolute",Qt.top="0",Qt.left="0",Qt.pointerEvents="none",Qt.visibility="hidden",Qt.width="200px",Qt.height="150px",Qt.overflow="hidden",It.appendChild(dt),document.body.appendChild(It);var Cn=dt.offsetWidth;It.style.overflow="scroll";var vr=dt.offsetWidth;Cn===vr&&(vr=It.clientWidth),document.body.removeChild(It),Sn=Cn-vr}return Sn}function $t(pt){var dt=pt.match(/^(.*)px$/),It=Number(dt==null?void 0:dt[1]);return Number.isNaN(It)?sn():It}function Bt(pt){if(typeof document=="undefined"||!pt||!(pt instanceof Element))return{width:0,height:0};var dt=getComputedStyle(pt,"::-webkit-scrollbar"),It=dt.width,Qt=dt.height;return{width:$t(It),height:$t(Qt)}}function bn(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var dn="rc-util-locker-".concat(Date.now()),ke=0;function ce(pt){var dt=!!pt,It=ye.useState(function(){return ke+=1,"".concat(dn,"_").concat(ke)}),Qt=(0,qe.Z)(It,1),Cn=Qt[0];bt(function(){if(dt){var vr=Bt(document.body).width,gr=bn();Ht(`
html body {
overflow-y: hidden;
`.concat(gr?"width: calc(100% - ".concat(vr,"px);"):"",`
}`),Cn)}else Xt(Cn);return function(){Xt(Cn)}},[dt,Cn])}var le=!1;function ve(pt){return typeof pt=="boolean"&&(le=pt),le}var pe=function(dt){return dt===!1?!1:!Me()||!dt?null:typeof dt=="string"?document.querySelector(dt):typeof dt=="function"?dt():dt},oe=ye.forwardRef(function(pt,dt){var It=pt.open,Qt=pt.autoLock,Cn=pt.getContainer,vr=pt.debug,gr=pt.autoDestroy,Er=gr===void 0?!0:gr,Br=pt.children,kr=ye.useState(It),Yr=(0,qe.Z)(kr,2),si=Yr[0],bi=Yr[1],Hi=si||It;ye.useEffect(function(){(Er||It)&&bi(It)},[It,Er]);var Ri=ye.useState(function(){return pe(Cn)}),Di=(0,qe.Z)(Ri,2),Le=Di[0],Re=Di[1];ye.useEffect(function(){var tn=pe(Cn);Re(tn!=null?tn:null)});var Oe=Ot(Hi&&!Le,vr),We=(0,qe.Z)(Oe,2),nt=We[0],st=We[1],mt=Le!=null?Le:nt;ce(Qt&&It&&Me()&&(mt===nt||mt===document.body));var zt=null;if(Br&&Ie(Br)&&dt){var jt=Br;zt=jt.ref}var Nn=lt(zt,dt);if(!Hi||!Me()||Le===void 0)return null;var Qn=mt===!1||ve(),Dn=Br;return dt&&(Dn=ye.cloneElement(Br,{ref:Nn})),ye.createElement(Ue.Provider,{value:st},Qn?Dn:(0,Ce.createPortal)(Dn,mt))}),ze=oe,yt=ze;function Vt(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var en=Vt()?ye.useLayoutEffect:ye.useEffect,un=function(dt,It){var Qt=ye.useRef(!0);en(function(){return dt(Qt.current)},It),en(function(){return Qt.current=!1,function(){Qt.current=!0}},[])},yn=function(dt,It){un(function(Qt){if(!Qt)return dt()},It)},Jt=un,Cr=ye.createContext(null),Tr=ye.createContext({}),Rt=Cr,Ln=ue(4942),Nr=ue(87462),Qr=ue(62874),Gn={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(dt){var It=dt.keyCode;if(dt.altKey&&!dt.ctrlKey||dt.metaKey||It>=Gn.F1&&It<=Gn.F12)return!1;switch(It){case Gn.ALT:case Gn.CAPS_LOCK:case Gn.CONTEXT_MENU:case Gn.CTRL:case Gn.DOWN:case Gn.END:case Gn.ESC:case Gn.HOME:case Gn.INSERT:case Gn.LEFT:case Gn.MAC_FF_META:case Gn.META:case Gn.NUMLOCK:case Gn.NUM_CENTER:case Gn.PAGE_DOWN:case Gn.PAGE_UP:case Gn.PAUSE:case Gn.PRINT_SCREEN:case Gn.RIGHT:case Gn.SHIFT:case Gn.UP:case Gn.WIN_KEY:case Gn.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(dt){if(dt>=Gn.ZERO&&dt<=Gn.NINE||dt>=Gn.NUM_ZERO&&dt<=Gn.NUM_MULTIPLY||dt>=Gn.A&&dt<=Gn.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&dt===0)return!0;switch(dt){case Gn.SPACE:case Gn.QUESTION_MARK:case Gn.NUM_PLUS:case Gn.NUM_MINUS:case Gn.NUM_PERIOD:case Gn.NUM_DIVISION:case Gn.SEMICOLON:case Gn.DASH:case Gn.EQUALS:case Gn.COMMA:case Gn.PERIOD:case Gn.SLASH:case Gn.APOSTROPHE:case Gn.SINGLE_QUOTE:case Gn.OPEN_SQUARE_BRACKET:case Gn.BACKSLASH:case Gn.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Fr=Gn,Da=`accept acceptCharset accessKey action allowFullScreen allowTransparency
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
charSet checked classID className colSpan cols content contentEditable contextMenu
controls coords crossOrigin data dateTime default defer dir disabled download draggable
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
mediaGroup method min minLength multiple muted name noValidate nonce open
optimum pattern placeholder poster preload radioGroup readOnly rel required
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
summary tabIndex target title type useMap value width wmode wrap`,Fi=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,Oi="".concat(Da," ").concat(Fi).split(/[\s\n]+/),Ei="aria-",ua="data-";function ba(pt,dt){return pt.indexOf(dt)===0}function ka(pt){var dt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,It;dt===!1?It={aria:!0,data:!0,attr:!0}:dt===!0?It={aria:!0}:It=(0,Fe.Z)({},dt);var Qt={};return Object.keys(pt).forEach(function(Cn){(It.aria&&(Cn==="role"||ba(Cn,Ei))||It.data&&ba(Cn,ua)||It.attr&&Oi.includes(Cn))&&(Qt[Cn]=pt[Cn])}),Qt}function ca(pt){var dt=React.useRef();dt.current=pt;var It=React.useCallback(function(){for(var Qt,Cn=arguments.length,vr=new Array(Cn),gr=0;gr<Cn;gr++)vr[gr]=arguments[gr];return(Qt=dt.current)===null||Qt===void 0?void 0:Qt.call.apply(Qt,[dt].concat(vr))},[]);return It}function Hr(pt){var dt=React.useRef(!1),It=React.useState(pt),Qt=_slicedToArray(It,2),Cn=Qt[0],vr=Qt[1];React.useEffect(function(){return dt.current=!1,function(){dt.current=!0}},[]);function gr(Er,Br){Br&&dt.current||vr(Er)}return[Cn,gr]}function La(pt){return pt!==void 0}function fo(pt,dt){var It=dt||{},Qt=It.defaultValue,Cn=It.value,vr=It.onChange,gr=It.postState,Er=useState(function(){return La(Cn)?Cn:La(Qt)?typeof Qt=="function"?Qt():Qt:typeof pt=="function"?pt():pt}),Br=_slicedToArray(Er,2),kr=Br[0],Yr=Br[1],si=Cn!==void 0?Cn:kr,bi=gr?gr(si):si,Hi=useEvent(vr),Ri=useState([si]),Di=_slicedToArray(Ri,2),Le=Di[0],Re=Di[1];useLayoutUpdateEffect(function(){var We=Le[0];kr!==We&&Hi(kr,We)},[Le]),useLayoutUpdateEffect(function(){La(Cn)||Yr(Cn)},[Cn]);var Oe=useEvent(function(We,nt){Yr(We,nt),Re([si],nt)});return[bi,Oe]}var Za=ue(33993);function Wa(pt,dt,It){var Qt=ye.useRef({});return(!("value"in Qt.current)||It(Qt.current.condition,dt))&&(Qt.current.value=pt(),Qt.current.condition=dt),Qt.current.value}function ha(pt,dt){typeof pt=="function"?pt(dt):(0,Xe.Z)(pt)==="object"&&pt&&"current"in pt&&(pt.current=dt)}function wt(){for(var pt=arguments.length,dt=new Array(pt),It=0;It<pt;It++)dt[It]=arguments[It];var Qt=dt.filter(function(Cn){return Cn});return Qt.length<=1?Qt[0]:function(Cn){dt.forEach(function(vr){ha(vr,Cn)})}}function _n(){for(var pt=arguments.length,dt=new Array(pt),It=0;It<pt;It++)dt[It]=arguments[It];return Wa(function(){return wt.apply(void 0,dt)},dt,function(Qt,Cn){return Qt.length!==Cn.length||Qt.every(function(vr,gr){return vr!==Cn[gr]})})}function Tn(pt){var dt,It,Qt=isMemo(pt)?pt.type.type:pt.type;return!(typeof Qt=="function"&&!((dt=Qt.prototype)!==null&&dt!==void 0&&dt.render)||typeof pt=="function"&&!((It=pt.prototype)!==null&&It!==void 0&&It.render))}function Pn(pt){return!isValidElement(pt)||isFragment(pt)?!1:Tn(pt)}function xr(pt,dt,It,Qt){if(!dt.length)return It;var Cn=_toArray(dt),vr=Cn[0],gr=Cn.slice(1),Er;return!pt&&typeof vr=="number"?Er=[]:Array.isArray(pt)?Er=_toConsumableArray(pt):Er=_objectSpread({},pt),Qt&&It===void 0&&gr.length===1?delete Er[vr][gr[0]]:Er[vr]=xr(Er[vr],gr,It,Qt),Er}function nr(pt,dt,It){var Qt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return dt.length&&Qt&&It===void 0&&!get(pt,dt.slice(0,-1))?pt:xr(pt,dt,It,Qt)}function ur(pt){return _typeof(pt)==="object"&&pt!==null&&Object.getPrototypeOf(pt)===Object.prototype}function Hn(pt){return Array.isArray(pt)?[]:{}}var je=typeof Reflect=="undefined"?Object.keys:Reflect.ownKeys;function it(){for(var pt=arguments.length,dt=new Array(pt),It=0;It<pt;It++)dt[It]=arguments[It];var Qt=Hn(dt[0]);return dt.forEach(function(Cn){function vr(gr,Er){var Br=new Set(Er),kr=get(Cn,gr),Yr=Array.isArray(kr);if(Yr||ur(kr)){if(!Br.has(kr)){Br.add(kr);var si=get(Qt,gr);Yr?Qt=nr(Qt,gr,[]):(!si||_typeof(si)!=="object")&&(Qt=nr(Qt,gr,Hn(kr))),je(kr).forEach(function(bi){vr([].concat(_toConsumableArray(gr),[bi]),Br)})}}else Qt=nr(Qt,gr,kr)}vr([])}),Qt}var St={},Wt=[],He=function(dt){Wt.push(dt)};function ht(pt,dt){if(0)var It}function Dt(pt,dt){if(0)var It}function _t(){St={}}function Nt(pt,dt,It){!dt&&!St[It]&&(pt(!1,It),St[It]=!0)}function Pt(pt,dt){Nt(ht,pt,dt)}function Bn(pt,dt){Nt(Dt,pt,dt)}Pt.preMessage=He,Pt.resetWarned=_t,Pt.noteOnce=Bn;var cr=Pt,Wn=function(dt){var It=dt.prefixCls,Qt=dt.className,Cn=dt.style,vr=dt.children,gr=dt.containerRef,Er=dt.id,Br=dt.onMouseEnter,kr=dt.onMouseOver,Yr=dt.onMouseLeave,si=dt.onClick,bi=dt.onKeyDown,Hi=dt.onKeyUp,Ri={onMouseEnter:Br,onMouseOver:kr,onMouseLeave:Yr,onClick:si,onKeyDown:bi,onKeyUp:Hi},Di=ye.useContext(Tr),Le=Di.panel,Re=_n(Le,gr);return ye.createElement(ye.Fragment,null,ye.createElement("div",(0,Nr.Z)({id:Er,className:tt()("".concat(It,"-content"),Qt),style:(0,Fe.Z)({},Cn),"aria-modal":"true",role:"dialog",ref:Re},Ri),vr))},Un=Wn;function qn(pt){return typeof pt=="string"&&String(Number(pt))===pt?(cr(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(pt)):pt}function Jn(pt){warning(!("wrapperClassName"in pt),"'wrapperClassName' is removed. Please use 'rootClassName' instead."),warning(canUseDom()||!pt.open,"Drawer with 'open' in SSR is not work since no place to createPortal. Please move to 'useEffect' instead.")}var Mr={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function an(pt,dt){var It,Qt,Cn,vr,gr=pt.prefixCls,Er=pt.open,Br=pt.placement,kr=pt.inline,Yr=pt.push,si=pt.forceRender,bi=pt.autoFocus,Hi=pt.keyboard,Ri=pt.rootClassName,Di=pt.rootStyle,Le=pt.zIndex,Re=pt.className,Oe=pt.id,We=pt.style,nt=pt.motion,st=pt.width,mt=pt.height,zt=pt.children,jt=pt.contentWrapperStyle,Nn=pt.mask,Qn=pt.maskClosable,Dn=pt.maskMotion,tn=pt.maskClassName,Yt=pt.maskStyle,fn=pt.afterOpenChange,xn=pt.onClose,Yn=pt.onMouseEnter,$n=pt.onMouseOver,On=pt.onMouseLeave,Kn=pt.onClick,zn=pt.onKeyDown,tr=pt.onKeyUp,$e=ye.useRef(),Ke=ye.useRef(),Ct=ye.useRef();ye.useImperativeHandle(dt,function(){return $e.current});var ft=function(yr){var Ir=yr.keyCode,$r=yr.shiftKey;switch(Ir){case Fr.TAB:{if(Ir===Fr.TAB){if(!$r&&document.activeElement===Ct.current){var mr;(mr=Ke.current)===null||mr===void 0||mr.focus({preventScroll:!0})}else if($r&&document.activeElement===Ke.current){var Wr;(Wr=Ct.current)===null||Wr===void 0||Wr.focus({preventScroll:!0})}}break}case Fr.ESC:{xn&&Hi&&(yr.stopPropagation(),xn(yr));break}}};ye.useEffect(function(){if(Er&&bi){var ir;(ir=$e.current)===null||ir===void 0||ir.focus({preventScroll:!0})}},[Er]);var Kt=ye.useState(!1),on=(0,qe.Z)(Kt,2),nn=on[0],En=on[1],pn=ye.useContext(Rt),Zt;Yr===!1?Zt={distance:0}:Yr===!0?Zt={}:Zt=Yr||{};var wn=(It=(Qt=(Cn=Zt)===null||Cn===void 0?void 0:Cn.distance)!==null&&Qt!==void 0?Qt:pn==null?void 0:pn.pushDistance)!==null&&It!==void 0?It:180,kn=ye.useMemo(function(){return{pushDistance:wn,push:function(){En(!0)},pull:function(){En(!1)}}},[wn]);ye.useEffect(function(){if(Er){var ir;pn==null||(ir=pn.push)===null||ir===void 0||ir.call(pn)}else{var yr;pn==null||(yr=pn.pull)===null||yr===void 0||yr.call(pn)}},[Er]),ye.useEffect(function(){return function(){var ir;pn==null||(ir=pn.pull)===null||ir===void 0||ir.call(pn)}},[]);var er=Nn&&ye.createElement(Qr.Z,(0,Nr.Z)({key:"mask"},Dn,{visible:Er}),function(ir,yr){var Ir=ir.className,$r=ir.style;return ye.createElement("div",{className:tt()("".concat(gr,"-mask"),Ir,tn),style:(0,Fe.Z)((0,Fe.Z)({},$r),Yt),onClick:Qn&&Er?xn:void 0,ref:yr})}),Mn=typeof nt=="function"?nt(Br):nt,dr={};if(nn&&wn)switch(Br){case"top":dr.transform="translateY(".concat(wn,"px)");break;case"bottom":dr.transform="translateY(".concat(-wn,"px)");break;case"left":dr.transform="translateX(".concat(wn,"px)");break;default:dr.transform="translateX(".concat(-wn,"px)");break}Br==="left"||Br==="right"?dr.width=qn(st):dr.height=qn(mt);var Lr={onMouseEnter:Yn,onMouseOver:$n,onMouseLeave:On,onClick:Kn,onKeyDown:zn,onKeyUp:tr},pr=ye.createElement(Qr.Z,(0,Nr.Z)({key:"panel"},Mn,{visible:Er,forceRender:si,onVisibleChanged:function(yr){fn==null||fn(yr)},removeOnLeave:!1,leavedClassName:"".concat(gr,"-content-wrapper-hidden")}),function(ir,yr){var Ir=ir.className,$r=ir.style;return ye.createElement("div",(0,Nr.Z)({className:tt()("".concat(gr,"-content-wrapper"),Ir),style:(0,Fe.Z)((0,Fe.Z)((0,Fe.Z)({},dr),$r),jt)},ka(pt,{data:!0})),ye.createElement(Un,(0,Nr.Z)({id:Oe,containerRef:yr,prefixCls:gr,className:Re,style:We},Lr),zt))}),wr=(0,Fe.Z)({},Di);return Le&&(wr.zIndex=Le),ye.createElement(Rt.Provider,{value:kn},ye.createElement("div",{className:tt()(gr,"".concat(gr,"-").concat(Br),Ri,(vr={},(0,Ln.Z)(vr,"".concat(gr,"-open"),Er),(0,Ln.Z)(vr,"".concat(gr,"-inline"),kr),vr)),style:wr,tabIndex:-1,ref:$e,onKeyDown:ft},er,ye.createElement("div",{tabIndex:0,ref:Ke,style:Mr,"aria-hidden":"true","data-sentinel":"start"}),pr,ye.createElement("div",{tabIndex:0,ref:Ct,style:Mr,"aria-hidden":"true","data-sentinel":"end"})))}var Fn=ye.forwardRef(an),ci=Fn,gi=function(dt){var It=dt.open,Qt=It===void 0?!1:It,Cn=dt.prefixCls,vr=Cn===void 0?"rc-drawer":Cn,gr=dt.placement,Er=gr===void 0?"right":gr,Br=dt.autoFocus,kr=Br===void 0?!0:Br,Yr=dt.keyboard,si=Yr===void 0?!0:Yr,bi=dt.width,Hi=bi===void 0?378:bi,Ri=dt.mask,Di=Ri===void 0?!0:Ri,Le=dt.maskClosable,Re=Le===void 0?!0:Le,Oe=dt.getContainer,We=dt.forceRender,nt=dt.afterOpenChange,st=dt.destroyOnClose,mt=dt.onMouseEnter,zt=dt.onMouseOver,jt=dt.onMouseLeave,Nn=dt.onClick,Qn=dt.onKeyDown,Dn=dt.onKeyUp,tn=dt.panelRef,Yt=ye.useState(!1),fn=(0,qe.Z)(Yt,2),xn=fn[0],Yn=fn[1],$n=ye.useState(!1),On=(0,qe.Z)($n,2),Kn=On[0],zn=On[1];Jt(function(){zn(!0)},[]);var tr=Kn?Qt:!1,$e=ye.useRef(),Ke=ye.useRef();Jt(function(){tr&&(Ke.current=document.activeElement)},[tr]);var Ct=function(En){var pn;if(Yn(En),nt==null||nt(En),!En&&Ke.current&&!((pn=$e.current)!==null&&pn!==void 0&&pn.contains(Ke.current))){var Zt;(Zt=Ke.current)===null||Zt===void 0||Zt.focus({preventScroll:!0})}},ft=ye.useMemo(function(){return{panel:tn}},[tn]);if(!We&&!xn&&!tr&&st)return null;var Kt={onMouseEnter:mt,onMouseOver:zt,onMouseLeave:jt,onClick:Nn,onKeyDown:Qn,onKeyUp:Dn},on=(0,Fe.Z)((0,Fe.Z)({},dt),{},{open:tr,prefixCls:vr,placement:Er,autoFocus:kr,keyboard:si,width:Hi,mask:Di,maskClosable:Re,inline:Oe===!1,afterOpenChange:Ct,ref:$e},Kt);return ye.createElement(Tr.Provider,{value:ft},ye.createElement(yt,{open:tr||We||xn,autoDestroy:!1,getContainer:Oe,autoLock:Di&&(tr||xn)},ye.createElement(ci,on)))},Vr=gi,Dr=Vr,wi=ue(33603),or=ue(53124),oi=ue(65223),hn=ue(69760),Si=pt=>{const{prefixCls:dt,title:It,footer:Qt,extra:Cn,closeIcon:vr,closable:gr,onClose:Er,headerStyle:Br,drawerStyle:kr,bodyStyle:Yr,footerStyle:si,children:bi}=pt,Hi=ye.useCallback(Oe=>ye.createElement("button",{type:"button",onClick:Er,"aria-label":"Close",className:`${dt}-close`},Oe),[Er]),[Ri,Di]=(0,hn.Z)(gr,vr,Hi,void 0,!0),Le=ye.useMemo(()=>!It&&!Ri?null:ye.createElement("div",{style:Br,className:tt()(`${dt}-header`,{[`${dt}-header-close-only`]:Ri&&!It&&!Cn})},ye.createElement("div",{className:`${dt}-header-title`},Di,It&&ye.createElement("div",{className:`${dt}-title`},It)),Cn&&ye.createElement("div",{className:`${dt}-extra`},Cn)),[Ri,Di,Cn,Br,dt,It]),Re=ye.useMemo(()=>{if(!Qt)return null;const Oe=`${dt}-footer`;return ye.createElement("div",{className:Oe,style:si},Qt)},[Qt,si,dt]);return ye.createElement("div",{className:`${dt}-wrapper-body`,style:kr},Le,ye.createElement("div",{className:`${dt}-body`,style:Yr},bi),Re)},pa=ue(4173),Wi=ue(67968),_i=ue(45503),Ki=pt=>{const{componentCls:dt,motionDurationSlow:It}=pt,Qt={"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${It}`}}};return{[dt]:{[`${dt}-mask-motion`]:{"&-enter, &-appear, &-leave":{"&-active":{transition:`all ${It}`}},"&-enter, &-appear":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}}},[`${dt}-panel-motion`]:{"&-left":[Qt,{"&-enter, &-appear":{"&-start":{transform:"translateX(-100%) !important"},"&-active":{transform:"translateX(0)"}},"&-leave":{transform:"translateX(0)","&-active":{transform:"translateX(-100%)"}}}],"&-right":[Qt,{"&-enter, &-appear":{"&-start":{transform:"translateX(100%) !important"},"&-active":{transform:"translateX(0)"}},"&-leave":{transform:"translateX(0)","&-active":{transform:"translateX(100%)"}}}],"&-top":[Qt,{"&-enter, &-appear":{"&-start":{transform:"translateY(-100%) !important"},"&-active":{transform:"translateY(0)"}},"&-leave":{transform:"translateY(0)","&-active":{transform:"translateY(-100%)"}}}],"&-bottom":[Qt,{"&-enter, &-appear":{"&-start":{transform:"translateY(100%) !important"},"&-active":{transform:"translateY(0)"}},"&-leave":{transform:"translateY(0)","&-active":{transform:"translateY(100%)"}}}]}}}};const yi=pt=>{const{componentCls:dt,zIndexPopup:It,colorBgMask:Qt,colorBgElevated:Cn,motionDurationSlow:vr,motionDurationMid:gr,padding:Er,paddingLG:Br,fontSizeLG:kr,lineHeightLG:Yr,lineWidth:si,lineType:bi,colorSplit:Hi,marginSM:Ri,colorIcon:Di,colorIconHover:Le,colorText:Re,fontWeightStrong:Oe,footerPaddingBlock:We,footerPaddingInline:nt}=pt,st=`${dt}-content-wrapper`;return{[dt]:{position:"fixed",inset:0,zIndex:It,pointerEvents:"none","&-pure":{position:"relative",background:Cn,[`&${dt}-left`]:{boxShadow:pt.boxShadowDrawerLeft},[`&${dt}-right`]:{boxShadow:pt.boxShadowDrawerRight},[`&${dt}-top`]:{boxShadow:pt.boxShadowDrawerUp},[`&${dt}-bottom`]:{boxShadow:pt.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${dt}-mask`]:{position:"absolute",inset:0,zIndex:It,background:Qt,pointerEvents:"auto"},[st]:{position:"absolute",zIndex:It,maxWidth:"100vw",transition:`all ${vr}`,"&-hidden":{display:"none"}},[`&-left > ${st}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:pt.boxShadowDrawerLeft},[`&-right > ${st}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:pt.boxShadowDrawerRight},[`&-top > ${st}`]:{top:0,insetInline:0,boxShadow:pt.boxShadowDrawerUp},[`&-bottom > ${st}`]:{bottom:0,insetInline:0,boxShadow:pt.boxShadowDrawerDown},[`${dt}-content`]:{width:"100%",height:"100%",overflow:"auto",background:Cn,pointerEvents:"auto"},[`${dt}-wrapper-body`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%"},[`${dt}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${Er}px ${Br}px`,fontSize:kr,lineHeight:Yr,borderBottom:`${si}px ${bi} ${Hi}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${dt}-extra`]:{flex:"none"},[`${dt}-close`]:{display:"inline-block",marginInlineEnd:Ri,color:Di,fontWeight:Oe,fontSize:kr,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,outline:0,cursor:"pointer",transition:`color ${gr}`,textRendering:"auto","&:focus, &:hover":{color:Le,textDecoration:"none"}},[`${dt}-title`]:{flex:1,margin:0,color:Re,fontWeight:pt.fontWeightStrong,fontSize:kr,lineHeight:Yr},[`${dt}-body`]:{flex:1,minWidth:0,minHeight:0,padding:Br,overflow:"auto"},[`${dt}-footer`]:{flexShrink:0,padding:`${We}px ${nt}px`,borderTop:`${si}px ${bi} ${Hi}`},"&-rtl":{direction:"rtl"}}}};var Gi=(0,Wi.Z)("Drawer",pt=>{const dt=(0,_i.TS)(pt,{});return[yi(dt),Ki(dt)]},pt=>({zIndexPopup:pt.zIndexPopupBase,footerPaddingBlock:pt.paddingXS,footerPaddingInline:pt.padding})),xa=ue(16569),Xi=function(pt,dt){var It={};for(var Qt in pt)Object.prototype.hasOwnProperty.call(pt,Qt)&&dt.indexOf(Qt)<0&&(It[Qt]=pt[Qt]);if(pt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Cn=0,Qt=Object.getOwnPropertySymbols(pt);Cn<Qt.length;Cn++)dt.indexOf(Qt[Cn])<0&&Object.prototype.propertyIsEnumerable.call(pt,Qt[Cn])&&(It[Qt[Cn]]=pt[Qt[Cn]]);return It};const Ti=null,wa={distance:180},Aa=pt=>{var dt;const{rootClassName:It,width:Qt,height:Cn,size:vr="default",mask:gr=!0,push:Er=wa,open:Br,afterOpenChange:kr,onClose:Yr,prefixCls:si,getContainer:bi,style:Hi,className:Ri,visible:Di,afterVisibleChange:Le}=pt,Re=Xi(pt,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","style","className","visible","afterVisibleChange"]),{getPopupContainer:Oe,getPrefixCls:We,direction:nt,drawer:st}=ye.useContext(or.E_),mt=We("drawer",si),[zt,jt]=Gi(mt),Nn=bi===void 0&&Oe?()=>Oe(document.body):bi,Qn=tt()({"no-mask":!gr,[`${mt}-rtl`]:nt==="rtl"},It,jt),Dn=ye.useMemo(()=>Qt!=null?Qt:vr==="large"?736:378,[Qt,vr]),tn=ye.useMemo(()=>Cn!=null?Cn:vr==="large"?736:378,[Cn,vr]),Yt={motionName:(0,wi.m)(mt,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},fn=Yn=>({motionName:(0,wi.m)(mt,`panel-motion-${Yn}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),xn=(0,xa.H)();return zt(ye.createElement(pa.BR,null,ye.createElement(oi.Ux,{status:!0,override:!0},ye.createElement(Dr,Object.assign({prefixCls:mt,onClose:Yr,maskMotion:Yt,motion:fn},Re,{open:Br!=null?Br:Di,mask:gr,push:Er,width:Dn,height:tn,style:Object.assign(Object.assign({},st==null?void 0:st.style),Hi),className:tt()(st==null?void 0:st.className,Ri),rootClassName:Qn,getContainer:Nn,afterOpenChange:kr!=null?kr:Le,panelRef:xn}),ye.createElement(Si,Object.assign({prefixCls:mt},Re,{onClose:Yr}))))))},aa=pt=>{const{prefixCls:dt,style:It,className:Qt,placement:Cn="right"}=pt,vr=Xi(pt,["prefixCls","style","className","placement"]),{getPrefixCls:gr}=ye.useContext(or.E_),Er=gr("drawer",dt),[Br,kr]=Gi(Er),Yr=tt()(Er,`${Er}-pure`,`${Er}-${Cn}`,kr,Qt);return Br(ye.createElement("div",{className:Yr,style:It},ye.createElement(Si,Object.assign({prefixCls:Er},vr))))};Aa._InternalPanelDoNotUseOrYouWillBeFired=aa;var ni=Aa},32983:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return et}});var be=ue(94184),tt=ue.n(be),Fe=ue(67294),qe=ue(53124),ye=ue(10110),Ce=ue(84780),Me=ue(29691),he=()=>{const[,lt]=(0,Me.Z)(),_e=new Ce.C(lt.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return Fe.createElement("svg",{style:_e,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},Fe.createElement("g",{fill:"none",fillRule:"evenodd"},Fe.createElement("g",{transform:"translate(24 31.67)"},Fe.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),Fe.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),Fe.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),Fe.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),Fe.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),Fe.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),Fe.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},Fe.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),Fe.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},ct=()=>{const[,lt]=(0,Me.Z)(),{colorFill:Ie,colorFillTertiary:_e,colorFillQuaternary:Ue,colorBgContainer:Ze}=lt,{borderColor:At,shadowColor:bt,contentColor:xt}=(0,Fe.useMemo)(()=>({borderColor:new Ce.C(Ie).onBackground(Ze).toHexShortString(),shadowColor:new Ce.C(_e).onBackground(Ze).toHexShortString(),contentColor:new Ce.C(Ue).onBackground(Ze).toHexShortString()}),[Ie,_e,Ue,Ze]);return Fe.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},Fe.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},Fe.createElement("ellipse",{fill:bt,cx:"32",cy:"33",rx:"32",ry:"7"}),Fe.createElement("g",{fillRule:"nonzero",stroke:At},Fe.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),Fe.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:xt}))))},Ne=ue(67968),Mt=ue(45503);const ut=lt=>{const{componentCls:Ie,margin:_e,marginXS:Ue,marginXL:Ze,fontSize:At,lineHeight:bt}=lt;return{[Ie]:{marginInline:Ue,fontSize:At,lineHeight:bt,textAlign:"center",[`${Ie}-image`]:{height:lt.emptyImgHeight,marginBottom:Ue,opacity:lt.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${Ie}-description`]:{color:lt.colorText},[`${Ie}-footer`]:{marginTop:_e},"&-normal":{marginBlock:Ze,color:lt.colorTextDisabled,[`${Ie}-description`]:{color:lt.colorTextDisabled},[`${Ie}-image`]:{height:lt.emptyImgHeightMD}},"&-small":{marginBlock:Ue,color:lt.colorTextDisabled,[`${Ie}-image`]:{height:lt.emptyImgHeightSM}}}}};var Qe=(0,Ne.Z)("Empty",lt=>{const{componentCls:Ie,controlHeightLG:_e}=lt,Ue=(0,Mt.TS)(lt,{emptyImgCls:`${Ie}-img`,emptyImgHeight:_e*2.5,emptyImgHeightMD:_e,emptyImgHeightSM:_e*.875});return[ut(Ue)]}),Xe=function(lt,Ie){var _e={};for(var Ue in lt)Object.prototype.hasOwnProperty.call(lt,Ue)&&Ie.indexOf(Ue)<0&&(_e[Ue]=lt[Ue]);if(lt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ze=0,Ue=Object.getOwnPropertySymbols(lt);Ze<Ue.length;Ze++)Ie.indexOf(Ue[Ze])<0&&Object.prototype.propertyIsEnumerable.call(lt,Ue[Ze])&&(_e[Ue[Ze]]=lt[Ue[Ze]]);return _e};const Te=Fe.createElement(he,null),Et=Fe.createElement(ct,null),Lt=lt=>{var{className:Ie,rootClassName:_e,prefixCls:Ue,image:Ze=Te,description:At,children:bt,imageStyle:xt,style:Ge}=lt,Ot=Xe(lt,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:kt,direction:vn,empty:qt}=Fe.useContext(qe.E_),cn=kt("empty",Ue),[An,Zn]=Qe(cn),[Ye]=(0,ye.Z)("Empty"),Ee=typeof At!="undefined"?At:Ye==null?void 0:Ye.description,Tt=typeof Ee=="string"?Ee:"empty";let gn=null;return typeof Ze=="string"?gn=Fe.createElement("img",{alt:Tt,src:Ze}):gn=Ze,An(Fe.createElement("div",Object.assign({className:tt()(Zn,cn,qt==null?void 0:qt.className,{[`${cn}-normal`]:Ze===Et,[`${cn}-rtl`]:vn==="rtl"},Ie,_e),style:Object.assign(Object.assign({},qt==null?void 0:qt.style),Ge)},Ot),Fe.createElement("div",{className:`${cn}-image`,style:xt},gn),Ee&&Fe.createElement("div",{className:`${cn}-description`},Ee),bt&&Fe.createElement("div",{className:`${cn}-footer`},bt)))};Lt.PRESENTED_IMAGE_DEFAULT=Te,Lt.PRESENTED_IMAGE_SIMPLE=Et;var et=Lt},22150:function(mn,Ut,ue){"use strict";ue.d(Ut,{default:function(){return Wt}});var be=ue(74902),tt=ue(94184),Fe=ue.n(tt),qe=ue(38379),ye=ue(67294),Ce=ue(33603),Me=ue(65223);function we(He){const[ht,Dt]=ye.useState(He);return ye.useEffect(()=>{const _t=setTimeout(()=>{Dt(He)},He.length?0:10);return()=>{clearTimeout(_t)}},[He]),ht}var he=ue(14747),De=ue(50438),ct=ue(33507),Ne=ue(45503),Mt=ue(67968),Qe=He=>{const{componentCls:ht}=He,Dt=`${ht}-show-help`,_t=`${ht}-show-help-item`;return{[Dt]:{transition:`opacity ${He.motionDurationSlow} ${He.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[_t]:{overflow:"hidden",transition:`height ${He.motionDurationSlow} ${He.motionEaseInOut},
opacity ${He.motionDurationSlow} ${He.motionEaseInOut},
transform ${He.motionDurationSlow} ${He.motionEaseInOut} !important`,[`&${_t}-appear, &${_t}-enter`]:{transform:"translateY(-5px)",opacity:0,"&-active":{transform:"translateY(0)",opacity:1}},[`&${_t}-leave-active`]:{transform:"translateY(-5px)"}}}}};const Xe=He=>({legend:{display:"block",width:"100%",marginBottom:He.marginLG,padding:0,color:He.colorTextDescription,fontSize:He.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:`${He.lineWidth}px ${He.lineType} ${He.colorBorder}`},label:{fontSize:He.fontSize},'input[type="search"]':{boxSizing:"border-box"},'input[type="radio"], input[type="checkbox"]':{lineHeight:"normal"},'input[type="file"]':{display:"block"},'input[type="range"]':{display:"block",width:"100%"},"select[multiple], select[size]":{height:"auto"},"input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus":{outline:0,boxShadow:`0 0 0 ${He.controlOutlineWidth}px ${He.controlOutline}`},output:{display:"block",paddingTop:15,color:He.colorText,fontSize:He.fontSize,lineHeight:He.lineHeight}}),Te=(He,ht)=>{const{formItemCls:Dt}=He;return{[Dt]:{[`${Dt}-label > label`]:{height:ht},[`${Dt}-control-input`]:{minHeight:ht}}}},Et=He=>{const{componentCls:ht}=He;return{[He.componentCls]:Object.assign(Object.assign(Object.assign({},(0,he.Wf)(He)),Xe(He)),{[`${ht}-text`]:{display:"inline-block",paddingInlineEnd:He.paddingSM},"&-small":Object.assign({},Te(He,He.controlHeightSM)),"&-large":Object.assign({},Te(He,He.controlHeightLG))})}},Lt=He=>{const{formItemCls:ht,iconCls:Dt,componentCls:_t,rootPrefixCls:Nt,labelRequiredMarkColor:Pt,labelColor:Bn,labelFontSize:cr,labelHeight:Wn,labelColonMarginInlineStart:Un,labelColonMarginInlineEnd:qn,itemMarginBottom:Jn}=He;return{[ht]:Object.assign(Object.assign({},(0,he.Wf)(He)),{marginBottom:Jn,verticalAlign:"top","&-with-help":{transition:"none"},[`&-hidden,
&-hidden.${Nt}-row`]:{display:"none"},"&-has-warning":{[`${ht}-split`]:{color:He.colorError}},"&-has-error":{[`${ht}-split`]:{color:He.colorWarning}},[`${ht}-label`]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:`${He.lineHeight} - 0.25em`,whiteSpace:"unset"},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:Wn,color:Bn,fontSize:cr,[`> ${Dt}`]:{fontSize:He.fontSize,verticalAlign:"top"},[`&${ht}-required:not(${ht}-required-mark-optional)::before`]:{display:"inline-block",marginInlineEnd:He.marginXXS,color:Pt,fontSize:He.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"',[`${_t}-hide-required-mark &`]:{display:"none"}},[`${ht}-optional`]:{display:"inline-block",marginInlineStart:He.marginXXS,color:He.colorTextDescription,[`${_t}-hide-required-mark &`]:{display:"none"}},[`${ht}-tooltip`]:{color:He.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:He.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:Un,marginInlineEnd:qn},[`&${ht}-no-colon::after`]:{content:'"\\a0"'}}},[`${ht}-control`]:{"--ant-display":"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${Nt}-col-'"]):not([class*="' ${Nt}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:He.controlHeight,"&-content":{flex:"auto",maxWidth:"100%"}}},[ht]:{"&-explain, &-extra":{clear:"both",color:He.colorTextDescription,fontSize:He.fontSize,lineHeight:He.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:He.controlHeightSM,transition:`color ${He.motionDurationMid} ${He.motionEaseOut}`},"&-explain":{"&-error":{color:He.colorError},"&-warning":{color:He.colorWarning}}},[`&-with-help ${ht}-explain`]:{height:"auto",opacity:1},[`${ht}-feedback-icon`]:{fontSize:He.fontSize,textAlign:"center",visibility:"visible",animationName:De.kr,animationDuration:He.motionDurationMid,animationTimingFunction:He.motionEaseOutBack,pointerEvents:"none","&-success":{color:He.colorSuccess},"&-error":{color:He.colorError},"&-warning":{color:He.colorWarning},"&-validating":{color:He.colorPrimary}}})}},et=He=>{const{componentCls:ht,formItemCls:Dt}=He;return{[`${ht}-horizontal`]:{[`${Dt}-label`]:{flexGrow:0},[`${Dt}-control`]:{flex:"1 1 0",minWidth:0},[`${Dt}-label[class$='-24'], ${Dt}-label[class*='-24 ']`]:{[`& + ${Dt}-control`]:{minWidth:"unset"}}}}},lt=He=>{const{componentCls:ht,formItemCls:Dt}=He;return{[`${ht}-inline`]:{display:"flex",flexWrap:"wrap",[Dt]:{flex:"none",marginInlineEnd:He.margin,marginBottom:0,"&-row":{flexWrap:"nowrap"},[`> ${Dt}-label,
> ${Dt}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${Dt}-label`]:{flex:"none"},[`${ht}-text`]:{display:"inline-block"},[`${Dt}-has-feedback`]:{display:"inline-block"}}}}},Ie=He=>({padding:He.verticalLabelPadding,margin:He.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),_e=He=>{const{componentCls:ht,formItemCls:Dt,rootPrefixCls:_t}=He;return{[`${Dt} ${Dt}-label`]:Ie(He),[ht]:{[Dt]:{flexWrap:"wrap",[`${Dt}-label, ${Dt}-control`]:{[`&:not([class*=" ${_t}-col-xs"])`]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},Ue=He=>{const{componentCls:ht,formItemCls:Dt,rootPrefixCls:_t}=He;return{[`${ht}-vertical`]:{[Dt]:{"&-row":{flexDirection:"column"},"&-label > label":{height:"auto"},[`${ht}-item-control`]:{width:"100%"}}},[`${ht}-vertical ${Dt}-label,
.${_t}-col-24${Dt}-label,
.${_t}-col-xl-24${Dt}-label`]:Ie(He),[`@media (max-width: ${He.screenXSMax}px)`]:[_e(He),{[ht]:{[`.${_t}-col-xs-24${Dt}-label`]:Ie(He)}}],[`@media (max-width: ${He.screenSMMax}px)`]:{[ht]:{[`.${_t}-col-sm-24${Dt}-label`]:Ie(He)}},[`@media (max-width: ${He.screenMDMax}px)`]:{[ht]:{[`.${_t}-col-md-24${Dt}-label`]:Ie(He)}},[`@media (max-width: ${He.screenLGMax}px)`]:{[ht]:{[`.${_t}-col-lg-24${Dt}-label`]:Ie(He)}}}},Ze=(He,ht)=>(0,Ne.TS)(He,{formItemCls:`${He.componentCls}-item`,rootPrefixCls:ht});var At=(0,Mt.Z)("Form",(He,ht)=>{let{rootPrefixCls:Dt}=ht;const _t=Ze(He,Dt);return[Et(_t),Lt(_t),Qe(_t),et(_t),lt(_t),Ue(_t),(0,ct.Z)(_t),De.kr]},He=>({labelRequiredMarkColor:He.colorError,labelColor:He.colorTextHeading,labelFontSize:He.fontSize,labelHeight:He.controlHeight,labelColonMarginInlineStart:He.marginXXS/2,labelColonMarginInlineEnd:He.marginXS,itemMarginBottom:He.marginLG,verticalLabelPadding:`0 0 ${He.paddingXS}px`,verticalLabelMargin:0}),{order:-1e3});const bt=[];function xt(He,ht,Dt){let _t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof He=="string"?He:`${ht}-${_t}`,error:He,errorStatus:Dt}}var Ot=He=>{let{help:ht,helpStatus:Dt,errors:_t=bt,warnings:Nt=bt,className:Pt,fieldId:Bn,onVisibleChanged:cr}=He;const{prefixCls:Wn}=ye.useContext(Me.Rk),Un=`${Wn}-item-explain`,[,qn]=At(Wn),Jn=(0,ye.useMemo)(()=>(0,Ce.Z)(Wn),[Wn]),Mr=we(_t),an=we(Nt),Fn=ye.useMemo(()=>ht!=null?[xt(ht,"help",Dt)]:[].concat((0,be.Z)(Mr.map((gi,Vr)=>xt(gi,"error","error",Vr))),(0,be.Z)(an.map((gi,Vr)=>xt(gi,"warning","warning",Vr)))),[ht,Dt,Mr,an]),ci={};return Bn&&(ci.id=`${Bn}_help`),ye.createElement(qe.default,{motionDeadline:Jn.motionDeadline,motionName:`${Wn}-show-help`,visible:!!Fn.length,onVisibleChanged:cr},gi=>{const{className:Vr,style:Dr}=gi;return ye.createElement("div",Object.assign({},ci,{className:Fe()(Un,Vr,Pt,qn),style:Dr,role:"alert"}),ye.createElement(qe.CSSMotionList,Object.assign({keys:Fn},(0,Ce.Z)(Wn),{motionName:`${Wn}-show-help-item`,component:!1}),wi=>{const{key:or,error:oi,errorStatus:hn,className:Vi,style:Si}=wi;return ye.createElement("div",{key:or,className:Fe()(Vi,{[`${Un}-${hn}`]:hn}),style:Si},oi)}))})},kt=ue(46660),vn=ue(53124),qt=ue(98866),cn=ue(97647),An=ue(98675),Zn=ue(17423);const Ye=["parentNode"],Ee="form_item";function Tt(He){return He===void 0||He===!1?[]:Array.isArray(He)?He:[He]}function gn(He,ht){if(!He.length)return;const Dt=He.join("_");return ht?`${ht}_${Dt}`:Ye.includes(Dt)?`${Ee}_${Dt}`:Dt}function Xt(He,ht,Dt,_t,Nt,Pt){let Bn=_t;return Pt!==void 0?Bn=Pt:Dt.validating?Bn="validating":He.length?Bn="error":ht.length?Bn="warning":(Dt.touched||Nt&&Dt.validated)&&(Bn="success"),Bn}function Je(He){return Tt(He).join("_")}function rt(He){const[ht]=(0,kt.useForm)(),Dt=ye.useRef({}),_t=ye.useMemo(()=>He!=null?He:Object.assign(Object.assign({},ht),{__INTERNAL__:{itemRef:Nt=>Pt=>{const Bn=Je(Nt);Pt?Dt.current[Bn]=Pt:delete Dt.current[Bn]}},scrollToField:function(Nt){let Pt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const Bn=Tt(Nt),cr=gn(Bn,_t.__INTERNAL__.name),Wn=cr?document.getElementById(cr):null;Wn&&(0,Zn.Z)(Wn,Object.assign({scrollMode:"if-needed",block:"nearest"},Pt))},getFieldInstance:Nt=>{const Pt=Je(Nt);return Dt.current[Pt]}}),[He,ht]);return[_t]}var Ht=ue(37920),Sn=function(He,ht){var Dt={};for(var _t in He)Object.prototype.hasOwnProperty.call(He,_t)&&ht.indexOf(_t)<0&&(Dt[_t]=He[_t]);if(He!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Nt=0,_t=Object.getOwnPropertySymbols(He);Nt<_t.length;Nt++)ht.indexOf(_t[Nt])<0&&Object.prototype.propertyIsEnumerable.call(He,_t[Nt])&&(Dt[_t[Nt]]=He[_t[Nt]]);return Dt};const sn=(He,ht)=>{const Dt=ye.useContext(qt.Z),{getPrefixCls:_t,direction:Nt,form:Pt}=ye.useContext(vn.E_),{prefixCls:Bn,className:cr,rootClassName:Wn,size:Un,disabled:qn=Dt,form:Jn,colon:Mr,labelAlign:an,labelWrap:Fn,labelCol:ci,wrapperCol:gi,hideRequiredMark:Vr,layout:Dr="horizontal",scrollToFirstError:wi,requiredMark:or,onFinishFailed:oi,name:hn,style:Vi,feedbackIcons:Si}=He,pa=Sn(He,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons"]),Wi=(0,An.Z)(Un),_i=ye.useContext(Ht.Z),ia=(0,ye.useMemo)(()=>or!==void 0?or:Pt&&Pt.requiredMark!==void 0?Pt.requiredMark:!Vr,[Vr,or,Pt]),Ki=Mr!=null?Mr:Pt==null?void 0:Pt.colon,yi=_t("form",Bn),[Gi,xa]=At(yi),Xi=Fe()(yi,`${yi}-${Dr}`,{[`${yi}-hide-required-mark`]:ia===!1,[`${yi}-rtl`]:Nt==="rtl",[`${yi}-${Wi}`]:Wi},xa,Pt==null?void 0:Pt.className,cr,Wn),[Ti]=rt(Jn),{__INTERNAL__:wa}=Ti;wa.name=hn;const Aa=(0,ye.useMemo)(()=>({name:hn,labelAlign:an,labelCol:ci,labelWrap:Fn,wrapperCol:gi,vertical:Dr==="vertical",colon:Ki,requiredMark:ia,itemRef:wa.itemRef,form:Ti,feedbackIcons:Si}),[hn,an,ci,gi,Dr,Ki,ia,Ti,Si]);ye.useImperativeHandle(ht,()=>Ti);const aa=(pt,dt)=>{if(pt){let It={block:"nearest"};typeof pt=="object"&&(It=pt),Ti.scrollToField(dt,It)}},ni=pt=>{if(oi==null||oi(pt),pt.errorFields.length){const dt=pt.errorFields[0].name;if(wi!==void 0){aa(wi,dt);return}Pt&&Pt.scrollToFirstError!==void 0&&aa(Pt.scrollToFirstError,dt)}};return Gi(ye.createElement(qt.n,{disabled:qn},ye.createElement(cn.q,{size:Wi},ye.createElement(Me.RV,Object.assign({},{validateMessages:_i}),ye.createElement(Me.q3.Provider,{value:Aa},ye.createElement(kt.default,Object.assign({id:hn},pa,{name:hn,onFinishFailed:ni,form:Ti,style:Object.assign(Object.assign({},Pt==null?void 0:Pt.style),Vi),className:Xi})))))))};var Bt=ye.forwardRef(sn),bn=ue(9475),dn=ue(17799),ke=ue(96159),ce=ue(37419);function le(He){if(typeof He=="function")return He;const ht=(0,ce.Z)(He);return ht.length<=1?ht[0]:ht}const ve=()=>{const{status:He,errors:ht=[],warnings:Dt=[]}=(0,ye.useContext)(Me.aM);return{status:He,errors:ht,warnings:Dt}};ve.Context=Me.aM;var pe=ve,oe=ue(96523);function ze(He){const[ht,Dt]=ye.useState(He),_t=(0,ye.useRef)(null),Nt=(0,ye.useRef)([]),Pt=(0,ye.useRef)(!1);ye.useEffect(()=>(Pt.current=!1,()=>{Pt.current=!0,oe.Z.cancel(_t.current),_t.current=null}),[]);function Bn(cr){Pt.current||(_t.current===null&&(Nt.current=[],_t.current=(0,oe.Z)(()=>{_t.current=null,Dt(Wn=>{let Un=Wn;return Nt.current.forEach(qn=>{Un=qn(Un)}),Un})})),Nt.current.push(cr))}return[ht,Bn]}function yt(){const{itemRef:He}=ye.useContext(Me.q3),ht=ye.useRef({});function Dt(_t,Nt){const Pt=Nt&&typeof Nt=="object"&&Nt.ref,Bn=_t.join("_");return(ht.current.name!==Bn||ht.current.originRef!==Pt)&&(ht.current.name=Bn,ht.current.originRef=Pt,ht.current.ref=(0,dn.sQ)(He(_t),Pt)),ht.current.ref}return Dt}var Vt=ue(48130),en=ue(14075),un=ue(10366),yn=ue(92820),Jt=ue(21584);const Cr=He=>{const{formItemCls:ht}=He;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${ht}-control`]:{display:"flex"}}}};var Tr=(0,Mt.b)(["Form","item-item"],(He,ht)=>{let{rootPrefixCls:Dt}=ht;const _t=Ze(He,Dt);return[Cr(_t)]}),Ln=He=>{const{prefixCls:ht,status:Dt,wrapperCol:_t,children:Nt,errors:Pt,warnings:Bn,_internalItemRender:cr,extra:Wn,help:Un,fieldId:qn,marginBottom:Jn,onErrorVisibleChanged:Mr}=He,an=`${ht}-item`,Fn=ye.useContext(Me.q3),ci=_t||Fn.wrapperCol||{},gi=Fe()(`${an}-control`,ci.className),Vr=ye.useMemo(()=>Object.assign({},Fn),[Fn]);delete Vr.labelCol,delete Vr.wrapperCol;const Dr=ye.createElement("div",{className:`${an}-control-input`},ye.createElement("div",{className:`${an}-control-input-content`},Nt)),wi=ye.useMemo(()=>({prefixCls:ht,status:Dt}),[ht,Dt]),or=Jn!==null||Pt.length||Bn.length?ye.createElement("div",{style:{display:"flex",flexWrap:"nowrap"}},ye.createElement(Me.Rk.Provider,{value:wi},ye.createElement(Ot,{fieldId:qn,errors:Pt,warnings:Bn,help:Un,helpStatus:Dt,className:`${an}-explain-connected`,onVisibleChanged:Mr})),!!Jn&&ye.createElement("div",{style:{width:0,height:Jn}})):null,oi={};qn&&(oi.id=`${qn}_extra`);const hn=Wn?ye.createElement("div",Object.assign({},oi,{className:`${an}-extra`}),Wn):null,Vi=cr&&cr.mark==="pro_table_render"&&cr.render?cr.render(He,{input:Dr,errorList:or,extra:hn}):ye.createElement(ye.Fragment,null,Dr,or,hn);return ye.createElement(Me.q3.Provider,{value:Vr},ye.createElement(Jt.Z,Object.assign({},ci,{className:gi}),Vi),ye.createElement(Tr,{prefixCls:ht}))},Nr=ue(17663),Qr=ue(24457),Gn=ue(10110),Fr=ue(83062),Da=function(He,ht){var Dt={};for(var _t in He)Object.prototype.hasOwnProperty.call(He,_t)&&ht.indexOf(_t)<0&&(Dt[_t]=He[_t]);if(He!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Nt=0,_t=Object.getOwnPropertySymbols(He);Nt<_t.length;Nt++)ht.indexOf(_t[Nt])<0&&Object.prototype.propertyIsEnumerable.call(He,_t[Nt])&&(Dt[_t[Nt]]=He[_t[Nt]]);return Dt};function Fi(He){return He?typeof He=="object"&&!ye.isValidElement(He)?He:{title:He}:null}var Ei=He=>{let{prefixCls:ht,label:Dt,htmlFor:_t,labelCol:Nt,labelAlign:Pt,colon:Bn,required:cr,requiredMark:Wn,tooltip:Un}=He;var qn;const[Jn]=(0,Gn.Z)("Form"),{vertical:Mr,labelAlign:an,labelCol:Fn,labelWrap:ci,colon:gi}=ye.useContext(Me.q3);if(!Dt)return null;const Vr=Nt||Fn||{},Dr=Pt||an,wi=`${ht}-item-label`,or=Fe()(wi,Dr==="left"&&`${wi}-left`,Vr.className,{[`${wi}-wrap`]:!!ci});let oi=Dt;const hn=Bn===!0||gi!==!1&&Bn!==!1;hn&&!Mr&&typeof Dt=="string"&&Dt.trim()!==""&&(oi=Dt.replace(/[:|]\s*$/,""));const Si=Fi(Un);if(Si){const{icon:ia=ye.createElement(Nr.Z,null)}=Si,Ki=Da(Si,["icon"]),yi=ye.createElement(Fr.Z,Object.assign({},Ki),ye.cloneElement(ia,{className:`${ht}-item-tooltip`,title:""}));oi=ye.createElement(ye.Fragment,null,oi,yi)}const pa=Wn==="optional",Wi=typeof Wn=="function";Wi?oi=Wn(oi,{required:!!cr}):pa&&!cr&&(oi=ye.createElement(ye.Fragment,null,oi,ye.createElement("span",{className:`${ht}-item-optional`,title:""},(Jn==null?void 0:Jn.optional)||((qn=Qr.Z.Form)===null||qn===void 0?void 0:qn.optional))));const _i=Fe()({[`${ht}-item-required`]:cr,[`${ht}-item-required-mark-optional`]:pa||Wi,[`${ht}-item-no-colon`]:!hn});return ye.createElement(Jt.Z,Object.assign({},Vr,{className:or}),ye.createElement("label",{htmlFor:_t,className:_i,title:typeof Dt=="string"?Dt:""},oi))},ua=ue(87725),ba=ue(16646),ka=ue(87995),ca=ue(3407);const Hr={success:ua.Z,warning:ka.Z,error:ba.Z,validating:ca.Z};function La(He){let{children:ht,errors:Dt,warnings:_t,hasFeedback:Nt,validateStatus:Pt,prefixCls:Bn,meta:cr,noStyle:Wn}=He;const Un=`${Bn}-item`,{feedbackIcons:qn}=ye.useContext(Me.q3),Jn=Xt(Dt,_t,cr,null,!!Nt,Pt),{isFormItemInput:Mr,status:an}=ye.useContext(Me.aM),Fn=ye.useMemo(()=>{var ci;let gi;if(Nt){const wi=Nt!==!0&&Nt.icons||qn,or=Jn&&((ci=wi==null?void 0:wi({status:Jn,errors:Dt,warnings:_t}))===null||ci===void 0?void 0:ci[Jn]),oi=Jn&&Hr[Jn];gi=or!==!1&&oi?ye.createElement("span",{className:Fe()(`${Un}-feedback-icon`,`${Un}-feedback-icon-${Jn}`)},or||ye.createElement(oi,null)):null}let Vr=!0,Dr=Jn||"";return Wn&&(Vr=Mr,Dr=(Jn!=null?Jn:an)||""),{status:Dr,errors:Dt,warnings:_t,hasFeedback:!!Nt,feedbackIcon:gi,isFormItemInput:Vr}},[Jn,Nt,Wn,Mr,an]);return ye.createElement(Me.aM.Provider,{value:Fn},ht)}var fo=function(He,ht){var Dt={};for(var _t in He)Object.prototype.hasOwnProperty.call(He,_t)&&ht.indexOf(_t)<0&&(Dt[_t]=He[_t]);if(He!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Nt=0,_t=Object.getOwnPropertySymbols(He);Nt<_t.length;Nt++)ht.indexOf(_t[Nt])<0&&Object.prototype.propertyIsEnumerable.call(He,_t[Nt])&&(Dt[_t[Nt]]=He[_t[Nt]]);return Dt};function Za(He){const{prefixCls:ht,className:Dt,rootClassName:_t,style:Nt,help:Pt,errors:Bn,warnings:cr,validateStatus:Wn,meta:Un,hasFeedback:qn,hidden:Jn,children:Mr,fieldId:an,required:Fn,isRequired:ci,onSubItemMetaChange:gi}=He,Vr=fo(He,["prefixCls","className","rootClassName","style","help","errors","warnings","validateStatus","meta","hasFeedback","hidden","children","fieldId","required","isRequired","onSubItemMetaChange"]),Dr=`${ht}-item`,{requiredMark:wi}=ye.useContext(Me.q3),or=ye.useRef(null),oi=we(Bn),hn=we(cr),Vi=Pt!=null,Si=!!(Vi||Bn.length||cr.length),pa=!!or.current&&(0,Vt.Z)(or.current),[Wi,_i]=ye.useState(null);(0,en.Z)(()=>{if(Si&&or.current){const xa=getComputedStyle(or.current);_i(parseInt(xa.marginBottom,10))}},[Si,pa]);const ia=xa=>{xa||_i(null)},yi=function(){let xa=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const Xi=xa?oi:Un.errors,Ti=xa?hn:Un.warnings;return Xt(Xi,Ti,Un,"",!!qn,Wn)}(),Gi=Fe()(Dr,Dt,_t,{[`${Dr}-with-help`]:Vi||oi.length||hn.length,[`${Dr}-has-feedback`]:yi&&qn,[`${Dr}-has-success`]:yi==="success",[`${Dr}-has-warning`]:yi==="warning",[`${Dr}-has-error`]:yi==="error",[`${Dr}-is-validating`]:yi==="validating",[`${Dr}-hidden`]:Jn});return ye.createElement("div",{className:Gi,style:Nt,ref:or},ye.createElement(yn.Z,Object.assign({className:`${Dr}-row`},(0,un.Z)(Vr,["_internalItemRender","colon","dependencies","extra","fieldKey","getValueFromEvent","getValueProps","htmlFor","id","initialValue","isListField","label","labelAlign","labelCol","labelWrap","messageVariables","name","normalize","noStyle","preserve","requiredMark","rules","shouldUpdate","trigger","tooltip","validateFirst","validateTrigger","valuePropName","wrapperCol","validateDebounce"])),ye.createElement(Ei,Object.assign({htmlFor:an},He,{requiredMark:wi,required:Fn!=null?Fn:ci,prefixCls:ht})),ye.createElement(Ln,Object.assign({},He,Un,{errors:oi,warnings:hn,prefixCls:ht,status:yi,help:Pt,marginBottom:Wi,onErrorVisibleChanged:ia}),ye.createElement(Me.qI.Provider,{value:gi},ye.createElement(La,{prefixCls:ht,meta:Un,errors:Un.errors,warnings:Un.warnings,hasFeedback:qn,validateStatus:yi},Mr)))),!!Wi&&ye.createElement("div",{className:`${Dr}-margin-offset`,style:{marginBottom:-Wi}}))}const Wa="__SPLIT__",ha=null,wt=ye.memo(He=>{let{children:ht}=He;return ht},(He,ht)=>He.value===ht.value&&He.update===ht.update&&He.childProps.length===ht.childProps.length&&He.childProps.every((Dt,_t)=>Dt===ht.childProps[_t]));function _n(He){return He!=null}function Tn(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function Pn(He){const{name:ht,noStyle:Dt,className:_t,dependencies:Nt,prefixCls:Pt,shouldUpdate:Bn,rules:cr,children:Wn,required:Un,label:qn,messageVariables:Jn,trigger:Mr="onChange",validateTrigger:an,hidden:Fn,help:ci}=He,{getPrefixCls:gi}=ye.useContext(vn.E_),{name:Vr}=ye.useContext(Me.q3),Dr=le(Wn),wi=typeof Dr=="function",or=ye.useContext(Me.qI),{validateTrigger:oi}=ye.useContext(kt.FieldContext),hn=an!==void 0?an:oi,Vi=_n(ht),Si=gi("form",Pt),[pa,Wi]=At(Si),_i=ye.useContext(kt.ListContext),ia=ye.useRef(),[Ki,yi]=ze({}),[Gi,xa]=(0,bn.Z)(()=>Tn()),Xi=dt=>{const It=_i==null?void 0:_i.getKey(dt.name);if(xa(dt.destroy?Tn():dt,!0),Dt&&ci!==!1&&or){let Qt=dt.name;if(dt.destroy)Qt=ia.current||Qt;else if(It!==void 0){const[Cn,vr]=It;Qt=[Cn].concat((0,be.Z)(vr)),ia.current=Qt}or(dt,Qt)}},Ti=(dt,It)=>{yi(Qt=>{const Cn=Object.assign({},Qt),gr=[].concat((0,be.Z)(dt.name.slice(0,-1)),(0,be.Z)(It)).join(Wa);return dt.destroy?delete Cn[gr]:Cn[gr]=dt,Cn})},[wa,Aa]=ye.useMemo(()=>{const dt=(0,be.Z)(Gi.errors),It=(0,be.Z)(Gi.warnings);return Object.values(Ki).forEach(Qt=>{dt.push.apply(dt,(0,be.Z)(Qt.errors||[])),It.push.apply(It,(0,be.Z)(Qt.warnings||[]))}),[dt,It]},[Ki,Gi.errors,Gi.warnings]),aa=yt();function ni(dt,It,Qt){return Dt&&!Fn?ye.createElement(La,{prefixCls:Si,hasFeedback:He.hasFeedback,validateStatus:He.validateStatus,meta:Gi,errors:wa,warnings:Aa,noStyle:!0},dt):ye.createElement(Za,Object.assign({key:"row"},He,{className:Fe()(_t,Wi),prefixCls:Si,fieldId:It,isRequired:Qt,errors:wa,warnings:Aa,meta:Gi,onSubItemMetaChange:Ti}),dt)}if(!Vi&&!wi&&!Nt)return pa(ni(Dr));let pt={};return typeof qn=="string"?pt.label=qn:ht&&(pt.label=String(ht)),Jn&&(pt=Object.assign(Object.assign({},pt),Jn)),pa(ye.createElement(kt.Field,Object.assign({},He,{messageVariables:pt,trigger:Mr,validateTrigger:hn,onMetaChange:Xi}),(dt,It,Qt)=>{const Cn=Tt(ht).length&&It?It.name:[],vr=gn(Cn,Vr),gr=Un!==void 0?Un:!!(cr&&cr.some(kr=>{if(kr&&typeof kr=="object"&&kr.required&&!kr.warningOnly)return!0;if(typeof kr=="function"){const Yr=kr(Qt);return Yr&&Yr.required&&!Yr.warningOnly}return!1})),Er=Object.assign({},dt);let Br=null;if(Array.isArray(Dr)&&Vi)Br=Dr;else if(!(wi&&(!(Bn||Nt)||Vi))){if(!(Nt&&!wi&&!Vi))if((0,ke.l$)(Dr)){const kr=Object.assign(Object.assign({},Dr.props),Er);if(kr.id||(kr.id=vr),ci||wa.length>0||Aa.length>0||He.extra){const bi=[];(ci||wa.length>0)&&bi.push(`${vr}_help`),He.extra&&bi.push(`${vr}_extra`),kr["aria-describedby"]=bi.join(" ")}wa.length>0&&(kr["aria-invalid"]="true"),gr&&(kr["aria-required"]="true"),(0,dn.Yr)(Dr)&&(kr.ref=aa(Cn,Dr)),new Set([].concat((0,be.Z)(Tt(Mr)),(0,be.Z)(Tt(hn)))).forEach(bi=>{kr[bi]=function(){for(var Hi,Ri,Di,Le,Re,Oe=arguments.length,We=new Array(Oe),nt=0;nt<Oe;nt++)We[nt]=arguments[nt];(Di=Er[bi])===null||Di===void 0||(Hi=Di).call.apply(Hi,[Er].concat(We)),(Re=(Le=Dr.props)[bi])===null||Re===void 0||(Ri=Re).call.apply(Ri,[Le].concat(We))}});const si=[kr["aria-required"],kr["aria-invalid"],kr["aria-describedby"]];Br=ye.createElement(wt,{value:Er[He.valuePropName||"value"],update:Dr,childProps:si},(0,ke.Tm)(Dr,kr))}else wi&&(Bn||Nt)&&!Vi?Br=Dr(Qt):Br=Dr}return ni(Br,vr,gr)}))}const xr=Pn;xr.useStatus=pe;var nr=xr,ur=function(He,ht){var Dt={};for(var _t in He)Object.prototype.hasOwnProperty.call(He,_t)&&ht.indexOf(_t)<0&&(Dt[_t]=He[_t]);if(He!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Nt=0,_t=Object.getOwnPropertySymbols(He);Nt<_t.length;Nt++)ht.indexOf(_t[Nt])<0&&Object.prototype.propertyIsEnumerable.call(He,_t[Nt])&&(Dt[_t[Nt]]=He[_t[Nt]]);return Dt},je=He=>{var{prefixCls:ht,children:Dt}=He,_t=ur(He,["prefixCls","children"]);const{getPrefixCls:Nt}=ye.useContext(vn.E_),Pt=Nt("form",ht),Bn=ye.useMemo(()=>({prefixCls:Pt,status:"error"}),[Pt]);return ye.createElement(kt.List,Object.assign({},_t),(cr,Wn,Un)=>ye.createElement(Me.Rk.Provider,{value:Bn},Dt(cr.map(qn=>Object.assign(Object.assign({},qn),{fieldKey:qn.key})),Wn,{errors:Un.errors,warnings:Un.warnings})))};function it(){const{form:He}=(0,ye.useContext)(Me.q3);return He}const St=Bt;St.Item=nr,St.List=je,St.ErrorList=Ot,St.useForm=rt,St.useFormInstance=it,St.useWatch=kt.useWatch,St.Provider=Me.RV,St.create=()=>{};var Wt=St},31795:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return Hn}});var be=ue(42922),tt=ue(53978),Fe=ue(94184),qe=ue.n(Fe),ye=ue(87462),Ce=ue(4942),Me=ue(71002),we=ue(97685),he=ue(45987),De=ue(15671),ct=ue(43144);function Ne(){return typeof BigInt=="function"}function Mt(je){return!je&&je!==0&&!Number.isNaN(je)||!String(je).trim()}function ut(je){var it=je.trim(),St=it.startsWith("-");St&&(it=it.slice(1)),it=it.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),it.startsWith(".")&&(it="0".concat(it));var Wt=it||"0",He=Wt.split("."),ht=He[0]||"0",Dt=He[1]||"0";ht==="0"&&Dt==="0"&&(St=!1);var _t=St?"-":"";return{negative:St,negativeStr:_t,trimStr:Wt,integerStr:ht,decimalStr:Dt,fullStr:"".concat(_t).concat(Wt)}}function Qe(je){var it=String(je);return!Number.isNaN(Number(it))&&it.includes("e")}function Xe(je){var it=String(je);if(Qe(je)){var St=Number(it.slice(it.indexOf("e-")+2)),Wt=it.match(/\.(\d+)/);return Wt!=null&&Wt[1]&&(St+=Wt[1].length),St}return it.includes(".")&&Et(it)?it.length-it.indexOf(".")-1:0}function Te(je){var it=String(je);if(Qe(je)){if(je>Number.MAX_SAFE_INTEGER)return String(Ne()?BigInt(je).toString():Number.MAX_SAFE_INTEGER);if(je<Number.MIN_SAFE_INTEGER)return String(Ne()?BigInt(je).toString():Number.MIN_SAFE_INTEGER);it=je.toFixed(Xe(it))}return ut(it).fullStr}function Et(je){return typeof je=="number"?!Number.isNaN(je):je?/^\s*-?\d+(\.\d+)?\s*$/.test(je)||/^\s*-?\d+\.\s*$/.test(je)||/^\s*-?\.\d+\s*$/.test(je):!1}var Lt=function(){function je(it){if((0,De.Z)(this,je),(0,Ce.Z)(this,"origin",""),(0,Ce.Z)(this,"negative",void 0),(0,Ce.Z)(this,"integer",void 0),(0,Ce.Z)(this,"decimal",void 0),(0,Ce.Z)(this,"decimalLen",void 0),(0,Ce.Z)(this,"empty",void 0),(0,Ce.Z)(this,"nan",void 0),Mt(it)){this.empty=!0;return}if(this.origin=String(it),it==="-"||Number.isNaN(it)){this.nan=!0;return}var St=it;if(Qe(St)&&(St=Number(St)),St=typeof St=="string"?St:Te(St),Et(St)){var Wt=ut(St);this.negative=Wt.negative;var He=Wt.trimStr.split(".");this.integer=BigInt(He[0]);var ht=He[1]||"0";this.decimal=BigInt(ht),this.decimalLen=ht.length}else this.nan=!0}return(0,ct.Z)(je,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(St){var Wt="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(St,"0"));return BigInt(Wt)}},{key:"negate",value:function(){var St=new je(this.toString());return St.negative=!St.negative,St}},{key:"cal",value:function(St,Wt,He){var ht=Math.max(this.getDecimalStr().length,St.getDecimalStr().length),Dt=this.alignDecimal(ht),_t=St.alignDecimal(ht),Nt=Wt(Dt,_t).toString(),Pt=He(ht),Bn=ut(Nt),cr=Bn.negativeStr,Wn=Bn.trimStr,Un="".concat(cr).concat(Wn.padStart(Pt+1,"0"));return new je("".concat(Un.slice(0,-Pt),".").concat(Un.slice(-Pt)))}},{key:"add",value:function(St){if(this.isInvalidate())return new je(St);var Wt=new je(St);return Wt.isInvalidate()?this:this.cal(Wt,function(He,ht){return He+ht},function(He){return He})}},{key:"multi",value:function(St){var Wt=new je(St);return this.isInvalidate()||Wt.isInvalidate()?new je(NaN):this.cal(Wt,function(He,ht){return He*ht},function(He){return He*2})}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(St){return this.toString()===(St==null?void 0:St.toString())}},{key:"lessEquals",value:function(St){return this.add(St.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var St=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return St?this.isInvalidate()?"":ut("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),je}(),et=function(){function je(it){if((0,De.Z)(this,je),(0,Ce.Z)(this,"origin",""),(0,Ce.Z)(this,"number",void 0),(0,Ce.Z)(this,"empty",void 0),Mt(it)){this.empty=!0;return}this.origin=String(it),this.number=Number(it)}return(0,ct.Z)(je,[{key:"negate",value:function(){return new je(-this.toNumber())}},{key:"add",value:function(St){if(this.isInvalidate())return new je(St);var Wt=Number(St);if(Number.isNaN(Wt))return this;var He=this.number+Wt;if(He>Number.MAX_SAFE_INTEGER)return new je(Number.MAX_SAFE_INTEGER);if(He<Number.MIN_SAFE_INTEGER)return new je(Number.MIN_SAFE_INTEGER);var ht=Math.max(Xe(this.number),Xe(Wt));return new je(He.toFixed(ht))}},{key:"multi",value:function(St){var Wt=Number(St);if(this.isInvalidate()||Number.isNaN(Wt))return new je(NaN);var He=this.number*Wt;if(He>Number.MAX_SAFE_INTEGER)return new je(Number.MAX_SAFE_INTEGER);if(He<Number.MIN_SAFE_INTEGER)return new je(Number.MIN_SAFE_INTEGER);var ht=Math.max(Xe(this.number),Xe(Wt));return new je(He.toFixed(ht))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return Number.isNaN(this.number)}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(St){return this.toNumber()===(St==null?void 0:St.toNumber())}},{key:"lessEquals",value:function(St){return this.add(St.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var St=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return St?this.isInvalidate()?"":Te(this.number):this.origin}}]),je}();function lt(je){return Ne()?new Lt(je):new et(je)}function Ie(je,it,St){var Wt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(je==="")return"";var He=ut(je),ht=He.negativeStr,Dt=He.integerStr,_t=He.decimalStr,Nt="".concat(it).concat(_t),Pt="".concat(ht).concat(Dt);if(St>=0){var Bn=Number(_t[St]);if(Bn>=5&&!Wt){var cr=lt(je).add("".concat(ht,"0.").concat("0".repeat(St)).concat(10-Bn));return Ie(cr.toString(),it,St,Wt)}return St===0?Pt:"".concat(Pt).concat(it).concat(_t.padEnd(St,"0").slice(0,St))}return Nt===".0"?Pt:"".concat(Pt).concat(Nt)}var _e=lt,Ue=ue(67656),Ze=ue(67294);function At(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var bt=At()?Ze.useLayoutEffect:Ze.useEffect,xt=function(it,St){var Wt=Ze.useRef(!0);bt(function(){return it(Wt.current)},St),bt(function(){return Wt.current=!1,function(){Wt.current=!0}},[])},Ge=function(it,St){xt(function(Wt){if(!Wt)return it()},St)},Ot=xt,kt=ue(27183);function vn(je,it,St){var Wt=React.useRef({});return(!("value"in Wt.current)||St(Wt.current.condition,it))&&(Wt.current.value=je(),Wt.current.condition=it),Wt.current.value}function qt(je,it){typeof je=="function"?je(it):(0,Me.Z)(je)==="object"&&je&&"current"in je&&(je.current=it)}function cn(){for(var je=arguments.length,it=new Array(je),St=0;St<je;St++)it[St]=arguments[St];var Wt=it.filter(function(He){return He});return Wt.length<=1?Wt[0]:function(He){it.forEach(function(ht){qt(ht,He)})}}function An(){for(var je=arguments.length,it=new Array(je),St=0;St<je;St++)it[St]=arguments[St];return useMemo(function(){return cn.apply(void 0,it)},it,function(Wt,He){return Wt.length!==He.length||Wt.every(function(ht,Dt){return ht!==He[Dt]})})}function Zn(je){var it,St,Wt=isMemo(je)?je.type.type:je.type;return!(typeof Wt=="function"&&!((it=Wt.prototype)!==null&&it!==void 0&&it.render)||typeof je=="function"&&!((St=je.prototype)!==null&&St!==void 0&&St.render))}function Ye(je){return!isValidElement(je)||isFragment(je)?!1:Zn(je)}var Ee={},Tt=[],gn=function(it){Tt.push(it)};function Xt(je,it){if(0)var St}function Je(je,it){if(0)var St}function rt(){Ee={}}function Ht(je,it,St){!it&&!Ee[St]&&(je(!1,St),Ee[St]=!0)}function Sn(je,it){Ht(Xt,je,it)}function sn(je,it){Ht(Je,je,it)}Sn.preMessage=gn,Sn.resetWarned=rt,Sn.noteOnce=sn;var $t=Sn;function Bt(je,it){var St=(0,Ze.useRef)(null);function Wt(){try{var ht=je.selectionStart,Dt=je.selectionEnd,_t=je.value,Nt=_t.substring(0,ht),Pt=_t.substring(Dt);St.current={start:ht,end:Dt,value:_t,beforeTxt:Nt,afterTxt:Pt}}catch(Bn){}}function He(){if(je&&St.current&&it)try{var ht=je.value,Dt=St.current,_t=Dt.beforeTxt,Nt=Dt.afterTxt,Pt=Dt.start,Bn=ht.length;if(ht.endsWith(Nt))Bn=ht.length-St.current.afterTxt.length;else if(ht.startsWith(_t))Bn=_t.length;else{var cr=_t[Pt-1],Wn=ht.indexOf(cr,Pt-1);Wn!==-1&&(Bn=Wn+1)}je.setSelectionRange(Bn,Bn)}catch(Un){$t(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(Un.message))}}return[Wt,He]}var bn=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var je=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(je)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(je==null?void 0:je.substr(0,4))},dn=function(){var it=(0,Ze.useState)(!1),St=(0,we.Z)(it,2),Wt=St[0],He=St[1];return Ot(function(){He(bn())},[]),Wt},ke=dn,ce=function(it){return+setTimeout(it,16)},le=function(it){return clearTimeout(it)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(ce=function(it){return window.requestAnimationFrame(it)},le=function(it){return window.cancelAnimationFrame(it)});var ve=0,pe=new Map;function oe(je){pe.delete(je)}var ze=function(it){var St=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;ve+=1;var Wt=ve;function He(ht){if(ht===0)oe(Wt),it();else{var Dt=ce(function(){He(ht-1)});pe.set(Wt,Dt)}}return He(St),Wt};ze.cancel=function(je){var it=pe.get(je);return oe(it),le(it)};var yt=ze,Vt=200,en=600;function un(je){var it=je.prefixCls,St=je.upNode,Wt=je.downNode,He=je.upDisabled,ht=je.downDisabled,Dt=je.onStep,_t=Ze.useRef(),Nt=Ze.useRef([]),Pt=Ze.useRef();Pt.current=Dt;var Bn=function(){clearTimeout(_t.current)},cr=function(ci,gi){ci.preventDefault(),Bn(),Pt.current(gi);function Vr(){Pt.current(gi),_t.current=setTimeout(Vr,Vt)}_t.current=setTimeout(Vr,en)};Ze.useEffect(function(){return function(){Bn(),Nt.current.forEach(function(Fn){return yt.cancel(Fn)})}},[]);var Wn=ke();if(Wn)return null;var Un="".concat(it,"-handler"),qn=qe()(Un,"".concat(Un,"-up"),(0,Ce.Z)({},"".concat(Un,"-up-disabled"),He)),Jn=qe()(Un,"".concat(Un,"-down"),(0,Ce.Z)({},"".concat(Un,"-down-disabled"),ht)),Mr=function(){return Nt.current.push(yt(Bn))},an={unselectable:"on",role:"button",onMouseUp:Mr,onMouseLeave:Mr};return Ze.createElement("div",{className:"".concat(Un,"-wrap")},Ze.createElement("span",(0,ye.Z)({},an,{onMouseDown:function(ci){cr(ci,!0)},"aria-label":"Increase Value","aria-disabled":He,className:qn}),St||Ze.createElement("span",{unselectable:"on",className:"".concat(it,"-handler-up-inner")})),Ze.createElement("span",(0,ye.Z)({},an,{onMouseDown:function(ci){cr(ci,!1)},"aria-label":"Decrease Value","aria-disabled":ht,className:Jn}),Wt||Ze.createElement("span",{unselectable:"on",className:"".concat(it,"-handler-down-inner")})))}function yn(je){var it=typeof je=="number"?Te(je):ut(je).fullStr,St=it.includes(".");return St?ut(it.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:je+"0"}var Jt=ue(87887),Cr=function(){var je=(0,Ze.useRef)(0),it=function(){yt.cancel(je.current)};return(0,Ze.useEffect)(function(){return it},[]),function(St){it(),je.current=yt(function(){St()})}},Tr=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],Rt=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","classes","className","classNames"],Ln=function(it,St){return it||St.isEmpty()?St.toString():St.toNumber()},Nr=function(it){var St=_e(it);return St.isInvalidate()?null:St},Qr=Ze.forwardRef(function(je,it){var St,Wt=je.prefixCls,He=Wt===void 0?"rc-input-number":Wt,ht=je.className,Dt=je.style,_t=je.min,Nt=je.max,Pt=je.step,Bn=Pt===void 0?1:Pt,cr=je.defaultValue,Wn=je.value,Un=je.disabled,qn=je.readOnly,Jn=je.upHandler,Mr=je.downHandler,an=je.keyboard,Fn=je.controls,ci=Fn===void 0?!0:Fn,gi=je.classNames,Vr=je.stringMode,Dr=je.parser,wi=je.formatter,or=je.precision,oi=je.decimalSeparator,hn=je.onChange,Vi=je.onInput,Si=je.onPressEnter,pa=je.onStep,Wi=(0,he.Z)(je,Tr),_i="".concat(He,"-input"),ia=Ze.useRef(null),Ki=Ze.useState(!1),yi=(0,we.Z)(Ki,2),Gi=yi[0],xa=yi[1],Xi=Ze.useRef(!1),Ti=Ze.useRef(!1),wa=Ze.useRef(!1),Aa=Ze.useState(function(){return _e(Wn!=null?Wn:cr)}),aa=(0,we.Z)(Aa,2),ni=aa[0],pt=aa[1];function dt($n){Wn===void 0&&pt($n)}var It=Ze.useCallback(function($n,On){if(!On)return or>=0?or:Math.max(Xe($n),Xe(Bn))},[or,Bn]),Qt=Ze.useCallback(function($n){var On=String($n);if(Dr)return Dr(On);var Kn=On;return oi&&(Kn=Kn.replace(oi,".")),Kn.replace(/[^\w.-]+/g,"")},[Dr,oi]),Cn=Ze.useRef(""),vr=Ze.useCallback(function($n,On){if(wi)return wi($n,{userTyping:On,input:String(Cn.current)});var Kn=typeof $n=="number"?Te($n):$n;if(!On){var zn=It(Kn,On);if(Et(Kn)&&(oi||zn>=0)){var tr=oi||".";Kn=Ie(Kn,tr,zn)}}return Kn},[wi,It,oi]),gr=Ze.useState(function(){var $n=cr!=null?cr:Wn;return ni.isInvalidate()&&["string","number"].includes((0,Me.Z)($n))?Number.isNaN($n)?"":$n:vr(ni.toString(),!1)}),Er=(0,we.Z)(gr,2),Br=Er[0],kr=Er[1];Cn.current=Br;function Yr($n,On){kr(vr($n.isInvalidate()?$n.toString(!1):$n.toString(!On),On))}var si=Ze.useMemo(function(){return Nr(Nt)},[Nt,or]),bi=Ze.useMemo(function(){return Nr(_t)},[_t,or]),Hi=Ze.useMemo(function(){return!si||!ni||ni.isInvalidate()?!1:si.lessEquals(ni)},[si,ni]),Ri=Ze.useMemo(function(){return!bi||!ni||ni.isInvalidate()?!1:ni.lessEquals(bi)},[bi,ni]),Di=Bt(ia.current,Gi),Le=(0,we.Z)(Di,2),Re=Le[0],Oe=Le[1],We=function(On){return si&&!On.lessEquals(si)?si:bi&&!bi.lessEquals(On)?bi:null},nt=function(On){return!We(On)},st=function(On,Kn){var zn=On,tr=nt(zn)||zn.isEmpty();if(!zn.isEmpty()&&!Kn&&(zn=We(zn)||zn,tr=!0),!qn&&!Un&&tr){var $e=zn.toString(),Ke=It($e,Kn);return Ke>=0&&(zn=_e(Ie($e,".",Ke)),nt(zn)||(zn=_e(Ie($e,".",Ke,!0)))),zn.equals(ni)||(dt(zn),hn==null||hn(zn.isEmpty()?null:Ln(Vr,zn)),Wn===void 0&&Yr(zn,Kn)),zn}return ni},mt=Cr(),zt=function $n(On){if(Re(),Cn.current=On,kr(On),!Ti.current){var Kn=Qt(On),zn=_e(Kn);zn.isNaN()||st(zn,!0)}Vi==null||Vi(On),mt(function(){var tr=On;Dr||(tr=On.replace(/。/g,".")),tr!==On&&$n(tr)})},jt=function(){Ti.current=!0},Nn=function(){Ti.current=!1,zt(ia.current.value)},Qn=function(On){zt(On.target.value)},Dn=function(On){var Kn;if(!(On&&Hi||!On&&Ri)){Xi.current=!1;var zn=_e(wa.current?yn(Bn):Bn);On||(zn=zn.negate());var tr=(ni||_e(0)).add(zn.toString()),$e=st(tr,!1);pa==null||pa(Ln(Vr,$e),{offset:wa.current?yn(Bn):Bn,type:On?"up":"down"}),(Kn=ia.current)===null||Kn===void 0||Kn.focus()}},tn=function(On){var Kn=_e(Qt(Br)),zn=Kn;Kn.isNaN()?zn=st(ni,On):zn=st(Kn,On),Wn!==void 0?Yr(ni,!1):zn.isNaN()||Yr(zn,!1)},Yt=function(){Xi.current=!0},fn=function(On){var Kn=On.key,zn=On.shiftKey;Xi.current=!0,wa.current=zn,Kn==="Enter"&&(Ti.current||(Xi.current=!1),tn(!1),Si==null||Si(On)),an!==!1&&!Ti.current&&["Up","ArrowUp","Down","ArrowDown"].includes(Kn)&&(Dn(Kn==="Up"||Kn==="ArrowUp"),On.preventDefault())},xn=function(){Xi.current=!1,wa.current=!1},Yn=function(){tn(!1),xa(!1),Xi.current=!1};return Ge(function(){ni.isInvalidate()||Yr(ni,!1)},[or]),Ge(function(){var $n=_e(Wn);pt($n);var On=_e(Qt(Br));(!$n.equals(On)||!Xi.current||wi)&&Yr($n,Xi.current)},[Wn]),Ge(function(){wi&&Oe()},[Br]),Ze.createElement("div",{className:qe()(He,gi==null?void 0:gi.input,ht,(St={},(0,Ce.Z)(St,"".concat(He,"-focused"),Gi),(0,Ce.Z)(St,"".concat(He,"-disabled"),Un),(0,Ce.Z)(St,"".concat(He,"-readonly"),qn),(0,Ce.Z)(St,"".concat(He,"-not-a-number"),ni.isNaN()),(0,Ce.Z)(St,"".concat(He,"-out-of-range"),!ni.isInvalidate()&&!nt(ni)),St)),style:Dt,onFocus:function(){xa(!0)},onBlur:Yn,onKeyDown:fn,onKeyUp:xn,onCompositionStart:jt,onCompositionEnd:Nn,onBeforeInput:Yt},ci&&Ze.createElement(un,{prefixCls:He,upNode:Jn,downNode:Mr,upDisabled:Hi,downDisabled:Ri,onStep:Dn}),Ze.createElement("div",{className:"".concat(_i,"-wrap")},Ze.createElement("input",(0,ye.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":_t,"aria-valuemax":Nt,"aria-valuenow":ni.isInvalidate()?null:ni.toString(),step:Bn},Wi,{ref:cn(ia,it),className:_i,value:Br,onChange:Qn,disabled:Un,readOnly:qn}))))}),Gn=Ze.forwardRef(function(je,it){var St=je.disabled,Wt=je.style,He=je.prefixCls,ht=je.value,Dt=je.prefix,_t=je.suffix,Nt=je.addonBefore,Pt=je.addonAfter,Bn=je.classes,cr=je.className,Wn=je.classNames,Un=(0,he.Z)(je,Rt),qn=Ze.useRef(null),Jn=function(an){qn.current&&(0,Jt.nH)(qn.current,an)};return Ze.createElement(Ue.BaseInput,{inputElement:Ze.createElement(Qr,(0,ye.Z)({prefixCls:He,disabled:St,classNames:Wn,ref:cn(qn,it)},Un)),className:cr,triggerFocus:Jn,prefixCls:He,value:ht,disabled:St,style:Wt,prefix:Dt,suffix:_t,addonAfter:Pt,addonBefore:Nt,classes:Bn,classNames:Wn,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}})});Gn.displayName="InputNumber";var Fr=Gn,Da=Fr,Fi=ue(9708),Oi=ue(53124),Ei=ue(46735),ua=ue(98866),ba=ue(98675),ka=ue(65223),ca=ue(4173),Hr=ue(47673),La=ue(14747),fo=ue(80110),Za=ue(67968),Wa=ue(45503);const ha=(je,it)=>{let{componentCls:St,borderRadiusSM:Wt,borderRadiusLG:He}=je;const ht=it==="lg"?He:Wt;return{[`&-${it}`]:{[`${St}-handler-wrap`]:{borderStartEndRadius:ht,borderEndEndRadius:ht},[`${St}-handler-up`]:{borderStartEndRadius:ht},[`${St}-handler-down`]:{borderEndEndRadius:ht}}}},wt=je=>{const{componentCls:it,lineWidth:St,lineType:Wt,colorBorder:He,borderRadius:ht,fontSizeLG:Dt,controlHeightLG:_t,controlHeightSM:Nt,colorError:Pt,paddingInlineSM:Bn,colorTextDescription:cr,motionDurationMid:Wn,handleHoverColor:Un,paddingInline:qn,paddingBlock:Jn,handleBg:Mr,handleActiveBg:an,colorTextDisabled:Fn,borderRadiusSM:ci,borderRadiusLG:gi,controlWidth:Vr,handleVisible:Dr,handleBorderColor:wi}=je;return[{[it]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,La.Wf)(je)),(0,Hr.ik)(je)),(0,Hr.bi)(je,it)),{display:"inline-block",width:Vr,margin:0,padding:0,border:`${St}px ${Wt} ${He}`,borderRadius:ht,"&-rtl":{direction:"rtl",[`${it}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:Dt,borderRadius:gi,[`input${it}-input`]:{height:_t-2*St}},"&-sm":{padding:0,borderRadius:ci,[`input${it}-input`]:{height:Nt-2*St,padding:`0 ${Bn}px`}},"&:hover":Object.assign({},(0,Hr.pU)(je)),"&-focused":Object.assign({},(0,Hr.M1)(je)),"&-out-of-range":{[`${it}-input-wrap`]:{input:{color:Pt}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,La.Wf)(je)),(0,Hr.s7)(je)),{"&-wrapper":{display:"inline-block",textAlign:"start",verticalAlign:"top",[`${it}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${it}-group-addon`]:{borderRadius:gi,fontSize:je.fontSizeLG}},"&-sm":{[`${it}-group-addon`]:{borderRadius:ci}},[`${it}-wrapper-disabled > ${it}-group-addon`]:Object.assign({},(0,Hr.Xy)(je))}}),[`&-disabled ${it}-input`]:{cursor:"not-allowed"},[it]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,La.Wf)(je)),{width:"100%",padding:`${Jn}px ${qn}px`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:ht,outline:0,transition:`all ${Wn} linear`,appearance:"textfield",fontSize:"inherit"}),(0,Hr.nz)(je.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[it]:Object.assign(Object.assign(Object.assign({[`&:hover ${it}-handler-wrap, &-focused ${it}-handler-wrap`]:{opacity:1},[`${it}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:je.handleWidth,height:"100%",background:Mr,borderStartStartRadius:0,borderStartEndRadius:ht,borderEndEndRadius:ht,borderEndStartRadius:0,opacity:Dr===!0?1:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${Wn} linear ${Wn}`,[`${it}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[`
${it}-handler-up-inner,
${it}-handler-down-inner
`]:{marginInlineEnd:0,fontSize:je.handleFontSize}}},[`${it}-handler`]:{height:"50%",overflow:"hidden",color:cr,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:`${St}px ${Wt} ${wi}`,transition:`all ${Wn} linear`,"&:active":{background:an},"&:hover":{height:"60%",[`
${it}-handler-up-inner,
${it}-handler-down-inner
`]:{color:Un}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,La.Ro)()),{color:cr,transition:`all ${Wn} linear`,userSelect:"none"})},[`${it}-handler-up`]:{borderStartEndRadius:ht},[`${it}-handler-down`]:{borderBlockStart:`${St}px ${Wt} ${wi}`,borderEndEndRadius:ht}},ha(je,"lg")),ha(je,"sm")),{"&-disabled, &-readonly":{[`${it}-handler-wrap`]:{display:"none"},[`${it}-input`]:{color:"inherit"}},[`
${it}-handler-up-disabled,
${it}-handler-down-disabled
`]:{cursor:"not-allowed"},[`
${it}-handler-up-disabled:hover &-handler-up-inner,
${it}-handler-down-disabled:hover &-handler-down-inner
`]:{color:Fn}})},{[`${it}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${it}-handler-down`]:{borderBlockStartWidth:0}}}]},_n=je=>{const{componentCls:it,paddingBlock:St,paddingInline:Wt,inputAffixPadding:He,controlWidth:ht,borderRadiusLG:Dt,borderRadiusSM:_t}=je;return{[`${it}-affix-wrapper`]:Object.assign(Object.assign(Object.assign({},(0,Hr.ik)(je)),(0,Hr.bi)(je,`${it}-affix-wrapper`)),{position:"relative",display:"inline-flex",width:ht,padding:0,paddingInlineStart:Wt,"&-lg":{borderRadius:Dt},"&-sm":{borderRadius:_t},[`&:not(${it}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},(0,Hr.pU)(je)),{zIndex:1}),"&-focused, &:focus":{zIndex:1},[`&-disabled > ${it}-disabled`]:{background:"transparent"},[`> div${it}`]:{width:"100%",border:"none",outline:"none",[`&${it}-focused`]:{boxShadow:"none !important"}},[`input${it}-input`]:{padding:`${St}px 0`},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${it}-handler-wrap`]:{zIndex:2},[it]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:He},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:Wt,marginInlineStart:He}}})}};var Tn=(0,Za.Z)("InputNumber",je=>{const it=(0,Wa.TS)(je,(0,Hr.e5)(je));return[wt(it),_n(it),(0,fo.c)(it)]},je=>Object.assign(Object.assign({},(0,Hr.TM)(je)),{controlWidth:90,handleWidth:je.controlHeightSM-je.lineWidth*2,handleFontSize:je.fontSize/2,handleVisible:"auto",handleActiveBg:je.colorFillAlter,handleBg:je.colorBgContainer,handleHoverColor:je.colorPrimary,handleBorderColor:je.colorBorder})),Pn=function(je,it){var St={};for(var Wt in je)Object.prototype.hasOwnProperty.call(je,Wt)&&it.indexOf(Wt)<0&&(St[Wt]=je[Wt]);if(je!=null&&typeof Object.getOwnPropertySymbols=="function")for(var He=0,Wt=Object.getOwnPropertySymbols(je);He<Wt.length;He++)it.indexOf(Wt[He])<0&&Object.prototype.propertyIsEnumerable.call(je,Wt[He])&&(St[Wt[He]]=je[Wt[He]]);return St};const xr=Ze.forwardRef((je,it)=>{const{getPrefixCls:St,direction:Wt}=Ze.useContext(Oi.E_),He=Ze.useRef(null);Ze.useImperativeHandle(it,()=>He.current);const{className:ht,rootClassName:Dt,size:_t,disabled:Nt,prefixCls:Pt,addonBefore:Bn,addonAfter:cr,prefix:Wn,bordered:Un=!0,readOnly:qn,status:Jn,controls:Mr}=je,an=Pn(je,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls"]),Fn=St("input-number",Pt),[ci,gi]=Tn(Fn),{compactSize:Vr,compactItemClassnames:Dr}=(0,ca.ri)(Fn,Wt);let wi=Ze.createElement(tt.Z,{className:`${Fn}-handler-up-inner`}),or=Ze.createElement(be.Z,{className:`${Fn}-handler-down-inner`});const oi=typeof Mr=="boolean"?Mr:void 0;typeof Mr=="object"&&(wi=typeof Mr.upIcon=="undefined"?wi:Ze.createElement("span",{className:`${Fn}-handler-up-inner`},Mr.upIcon),or=typeof Mr.downIcon=="undefined"?or:Ze.createElement("span",{className:`${Fn}-handler-down-inner`},Mr.downIcon));const{hasFeedback:hn,status:Vi,isFormItemInput:Si,feedbackIcon:pa}=Ze.useContext(ka.aM),Wi=(0,Fi.F)(Vi,Jn),_i=(0,ba.Z)(Xi=>{var Ti;return(Ti=_t!=null?_t:Vr)!==null&&Ti!==void 0?Ti:Xi}),ia=Ze.useContext(ua.Z),Ki=Nt!=null?Nt:ia,yi=qe()({[`${Fn}-lg`]:_i==="large",[`${Fn}-sm`]:_i==="small",[`${Fn}-rtl`]:Wt==="rtl",[`${Fn}-borderless`]:!Un,[`${Fn}-in-form-item`]:Si},(0,Fi.Z)(Fn,Wi),Dr,gi),Gi=`${Fn}-group`,xa=Ze.createElement(Da,Object.assign({ref:He,disabled:Ki,className:qe()(ht,Dt),upHandler:wi,downHandler:or,prefixCls:Fn,readOnly:qn,controls:oi,prefix:Wn,suffix:hn&&pa,addonAfter:cr&&Ze.createElement(ca.BR,null,Ze.createElement(ka.Ux,{override:!0,status:!0},cr)),addonBefore:Bn&&Ze.createElement(ca.BR,null,Ze.createElement(ka.Ux,{override:!0,status:!0},Bn)),classNames:{input:yi},classes:{affixWrapper:qe()((0,Fi.Z)(`${Fn}-affix-wrapper`,Wi,hn),{[`${Fn}-affix-wrapper-sm`]:_i==="small",[`${Fn}-affix-wrapper-lg`]:_i==="large",[`${Fn}-affix-wrapper-rtl`]:Wt==="rtl",[`${Fn}-affix-wrapper-borderless`]:!Un},gi),wrapper:qe()({[`${Gi}-rtl`]:Wt==="rtl",[`${Fn}-wrapper-disabled`]:Ki},gi),group:qe()({[`${Fn}-group-wrapper-sm`]:_i==="small",[`${Fn}-group-wrapper-lg`]:_i==="large",[`${Fn}-group-wrapper-rtl`]:Wt==="rtl"},(0,Fi.Z)(`${Fn}-group-wrapper`,Wi,hn),gi)}},an));return ci(xa)}),nr=xr,ur=je=>Ze.createElement(Ei.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},Ze.createElement(xr,Object.assign({},je)));nr._InternalPanelDoNotUseOrYouWillBeFired=ur;var Hn=nr},82586:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return Lt},n:function(){return Te}});var be=ue(16646),tt=ue(94184),Fe=ue.n(tt),qe=ue(67656),ye=ue(17799),Ce=ue(67294),Me=ue(9708),we=ue(53124),he=ue(98866),De=ue(98675),ct=ue(65223),Ne=ue(4173),Mt=ue(72922),ut=ue(47673);function Qe(et){return!!(et.prefix||et.suffix||et.allowClear)}var Xe=function(et,lt){var Ie={};for(var _e in et)Object.prototype.hasOwnProperty.call(et,_e)&&lt.indexOf(_e)<0&&(Ie[_e]=et[_e]);if(et!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ue=0,_e=Object.getOwnPropertySymbols(et);Ue<_e.length;Ue++)lt.indexOf(_e[Ue])<0&&Object.prototype.propertyIsEnumerable.call(et,_e[Ue])&&(Ie[_e[Ue]]=et[_e[Ue]]);return Ie};function Te(et,lt){if(!et)return;et.focus(lt);const{cursor:Ie}=lt||{};if(Ie){const _e=et.value.length;switch(Ie){case"start":et.setSelectionRange(0,0);break;case"end":et.setSelectionRange(_e,_e);break;default:et.setSelectionRange(0,_e);break}}}var Lt=(0,Ce.forwardRef)((et,lt)=>{var Ie;const{prefixCls:_e,bordered:Ue=!0,status:Ze,size:At,disabled:bt,onBlur:xt,onFocus:Ge,suffix:Ot,allowClear:kt,addonAfter:vn,addonBefore:qt,className:cn,style:An,styles:Zn,rootClassName:Ye,onChange:Ee,classNames:Tt}=et,gn=Xe(et,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames"]),{getPrefixCls:Xt,direction:Je,input:rt}=Ce.useContext(we.E_),Ht=Xt("input",_e),Sn=(0,Ce.useRef)(null),[sn,$t]=(0,ut.ZP)(Ht),{compactSize:Bt,compactItemClassnames:bn}=(0,Ne.ri)(Ht,Je),dn=(0,De.Z)(Tr=>{var Rt;return(Rt=At!=null?At:Bt)!==null&&Rt!==void 0?Rt:Tr}),ke=Ce.useContext(he.Z),ce=bt!=null?bt:ke,{status:le,hasFeedback:ve,feedbackIcon:pe}=(0,Ce.useContext)(ct.aM),oe=(0,Me.F)(le,Ze),ze=Qe(et)||!!ve,yt=(0,Ce.useRef)(ze);(0,Ce.useEffect)(()=>{var Tr;ze&&yt.current,yt.current=ze},[ze]);const Vt=(0,Mt.Z)(Sn,!0),en=Tr=>{Vt(),xt==null||xt(Tr)},un=Tr=>{Vt(),Ge==null||Ge(Tr)},yn=Tr=>{Vt(),Ee==null||Ee(Tr)},Jt=(ve||Ot)&&Ce.createElement(Ce.Fragment,null,Ot,ve&&pe);let Cr;return typeof kt=="object"&&(kt!=null&&kt.clearIcon)?Cr=kt:kt&&(Cr={clearIcon:Ce.createElement(be.Z,null)}),sn(Ce.createElement(qe.default,Object.assign({ref:(0,ye.sQ)(lt,Sn),prefixCls:Ht,autoComplete:rt==null?void 0:rt.autoComplete},gn,{disabled:ce,onBlur:en,onFocus:un,style:Object.assign(Object.assign({},rt==null?void 0:rt.style),An),styles:Object.assign(Object.assign({},rt==null?void 0:rt.styles),Zn),suffix:Jt,allowClear:Cr,className:Fe()(cn,Ye,bn,rt==null?void 0:rt.className),onChange:yn,addonAfter:vn&&Ce.createElement(Ne.BR,null,Ce.createElement(ct.Ux,{override:!0,status:!0},vn)),addonBefore:qt&&Ce.createElement(Ne.BR,null,Ce.createElement(ct.Ux,{override:!0,status:!0},qt)),classNames:Object.assign(Object.assign(Object.assign({},Tt),rt==null?void 0:rt.classNames),{input:Fe()({[`${Ht}-sm`]:dn==="small",[`${Ht}-lg`]:dn==="large",[`${Ht}-rtl`]:Je==="rtl",[`${Ht}-borderless`]:!Ue},!ze&&(0,Me.Z)(Ht,oe),Tt==null?void 0:Tt.input,(Ie=rt==null?void 0:rt.classNames)===null||Ie===void 0?void 0:Ie.input,$t)}),classes:{affixWrapper:Fe()({[`${Ht}-affix-wrapper-sm`]:dn==="small",[`${Ht}-affix-wrapper-lg`]:dn==="large",[`${Ht}-affix-wrapper-rtl`]:Je==="rtl",[`${Ht}-affix-wrapper-borderless`]:!Ue},(0,Me.Z)(`${Ht}-affix-wrapper`,oe,ve),$t),wrapper:Fe()({[`${Ht}-group-rtl`]:Je==="rtl"},$t),group:Fe()({[`${Ht}-group-wrapper-sm`]:dn==="small",[`${Ht}-group-wrapper-lg`]:dn==="large",[`${Ht}-group-wrapper-rtl`]:Je==="rtl",[`${Ht}-group-wrapper-disabled`]:ce},(0,Me.Z)(`${Ht}-group-wrapper`,oe,ve),$t)}})))})},96330:function(mn,Ut,ue){"use strict";var be=ue(16646),tt=ue(94184),Fe=ue.n(tt),qe=ue(64701),ye=ue(67294),Ce=ue(9708),Me=ue(53124),we=ue(98866),he=ue(98675),De=ue(65223),ct=ue(82586),Ne=ue(47673),Mt=function(Qe,Xe){var Te={};for(var Et in Qe)Object.prototype.hasOwnProperty.call(Qe,Et)&&Xe.indexOf(Et)<0&&(Te[Et]=Qe[Et]);if(Qe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Lt=0,Et=Object.getOwnPropertySymbols(Qe);Lt<Et.length;Lt++)Xe.indexOf(Et[Lt])<0&&Object.prototype.propertyIsEnumerable.call(Qe,Et[Lt])&&(Te[Et[Lt]]=Qe[Et[Lt]]);return Te};const ut=(0,ye.forwardRef)((Qe,Xe)=>{const{prefixCls:Te,bordered:Et=!0,size:Lt,disabled:et,status:lt,allowClear:Ie,showCount:_e,classNames:Ue,rootClassName:Ze,className:At}=Qe,bt=Mt(Qe,["prefixCls","bordered","size","disabled","status","allowClear","showCount","classNames","rootClassName","className"]),{getPrefixCls:xt,direction:Ge}=ye.useContext(Me.E_),Ot=(0,he.Z)(Lt),kt=ye.useContext(we.Z),vn=et!=null?et:kt,{status:qt,hasFeedback:cn,feedbackIcon:An}=ye.useContext(De.aM),Zn=(0,Ce.F)(qt,lt),Ye=ye.useRef(null);ye.useImperativeHandle(Xe,()=>{var Je;return{resizableTextArea:(Je=Ye.current)===null||Je===void 0?void 0:Je.resizableTextArea,focus:rt=>{var Ht,Sn;(0,ct.n)((Sn=(Ht=Ye.current)===null||Ht===void 0?void 0:Ht.resizableTextArea)===null||Sn===void 0?void 0:Sn.textArea,rt)},blur:()=>{var rt;return(rt=Ye.current)===null||rt===void 0?void 0:rt.blur()}}});const Ee=xt("input",Te);let Tt;typeof Ie=="object"&&(Ie!=null&&Ie.clearIcon)?Tt=Ie:Ie&&(Tt={clearIcon:ye.createElement(be.Z,null)});const[gn,Xt]=(0,Ne.ZP)(Ee);return gn(ye.createElement(qe.default,Object.assign({},bt,{disabled:vn,allowClear:Tt,className:Fe()(At,Ze),classes:{affixWrapper:Fe()(`${Ee}-textarea-affix-wrapper`,{[`${Ee}-affix-wrapper-rtl`]:Ge==="rtl",[`${Ee}-affix-wrapper-borderless`]:!Et,[`${Ee}-affix-wrapper-sm`]:Ot==="small",[`${Ee}-affix-wrapper-lg`]:Ot==="large",[`${Ee}-textarea-show-count`]:_e},(0,Ce.Z)(`${Ee}-affix-wrapper`,Zn),Xt)},classNames:Object.assign(Object.assign({},Ue),{textarea:Fe()({[`${Ee}-borderless`]:!Et,[`${Ee}-sm`]:Ot==="small",[`${Ee}-lg`]:Ot==="large"},(0,Ce.Z)(Ee,Zn),Xt,Ue==null?void 0:Ue.textarea)}),prefixCls:Ee,suffix:cn&&ye.createElement("span",{className:`${Ee}-textarea-suffix`},An),showCount:_e,ref:Ye})))});Ut.Z=ut},72922:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return tt}});var be=ue(67294);function tt(Fe,qe){const ye=(0,be.useRef)([]),Ce=()=>{ye.current.push(setTimeout(()=>{var Me,we,he,De;!((Me=Fe.current)===null||Me===void 0)&&Me.input&&((we=Fe.current)===null||we===void 0?void 0:we.input.getAttribute("type"))==="password"&&(!((he=Fe.current)===null||he===void 0)&&he.input.hasAttribute("value"))&&((De=Fe.current)===null||De===void 0||De.input.removeAttribute("value"))}))};return(0,be.useEffect)(()=>(qe&&Ce(),()=>ye.current.forEach(Me=>{Me&&clearTimeout(Me)})),[]),Ce}},69677:function(mn,Ut,ue){"use strict";ue.d(Ut,{default:function(){return Ot}});var be=ue(94184),tt=ue.n(be),Fe=ue(67294),qe=ue(53124),ye=ue(65223),Ce=ue(47673),we=kt=>{const{getPrefixCls:vn,direction:qt}=(0,Fe.useContext)(qe.E_),{prefixCls:cn,className:An}=kt,Zn=vn("input-group",cn),Ye=vn("input"),[Ee,Tt]=(0,Ce.ZP)(Ye),gn=tt()(Zn,{[`${Zn}-lg`]:kt.size==="large",[`${Zn}-sm`]:kt.size==="small",[`${Zn}-compact`]:kt.compact,[`${Zn}-rtl`]:qt==="rtl"},Tt,An),Xt=(0,Fe.useContext)(ye.aM),Je=(0,Fe.useMemo)(()=>Object.assign(Object.assign({},Xt),{isFormItemInput:!1}),[Xt]);return Ee(Fe.createElement("span",{className:gn,style:kt.style,onMouseEnter:kt.onMouseEnter,onMouseLeave:kt.onMouseLeave,onFocus:kt.onFocus,onBlur:kt.onBlur},Fe.createElement(ye.aM.Provider,{value:Je},kt.children)))},he=ue(82586),De=ue(63237),ct=ue(99569),Ne=ue(10366),Mt=ue(17799),ut=ue(72922),Qe=function(kt,vn){var qt={};for(var cn in kt)Object.prototype.hasOwnProperty.call(kt,cn)&&vn.indexOf(cn)<0&&(qt[cn]=kt[cn]);if(kt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var An=0,cn=Object.getOwnPropertySymbols(kt);An<cn.length;An++)vn.indexOf(cn[An])<0&&Object.prototype.propertyIsEnumerable.call(kt,cn[An])&&(qt[cn[An]]=kt[cn[An]]);return qt};const Xe=kt=>kt?Fe.createElement(ct.Z,null):Fe.createElement(De.Z,null),Te={click:"onClick",hover:"onMouseOver"};var Lt=Fe.forwardRef((kt,vn)=>{const{visibilityToggle:qt=!0}=kt,cn=typeof qt=="object"&&qt.visible!==void 0,[An,Zn]=(0,Fe.useState)(()=>cn?qt.visible:!1),Ye=(0,Fe.useRef)(null);Fe.useEffect(()=>{cn&&Zn(qt.visible)},[cn,qt]);const Ee=(0,ut.Z)(Ye),Tt=()=>{const{disabled:ce}=kt;ce||(An&&Ee(),Zn(le=>{var ve;const pe=!le;return typeof qt=="object"&&((ve=qt.onVisibleChange)===null||ve===void 0||ve.call(qt,pe)),pe}))},gn=ce=>{const{action:le="click",iconRender:ve=Xe}=kt,pe=Te[le]||"",oe=ve(An),ze={[pe]:Tt,className:`${ce}-icon`,key:"passwordIcon",onMouseDown:yt=>{yt.preventDefault()},onMouseUp:yt=>{yt.preventDefault()}};return Fe.cloneElement(Fe.isValidElement(oe)?oe:Fe.createElement("span",null,oe),ze)},{className:Xt,prefixCls:Je,inputPrefixCls:rt,size:Ht}=kt,Sn=Qe(kt,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:sn}=Fe.useContext(qe.E_),$t=sn("input",rt),Bt=sn("input-password",Je),bn=qt&&gn(Bt),dn=tt()(Bt,Xt,{[`${Bt}-${Ht}`]:!!Ht}),ke=Object.assign(Object.assign({},(0,Ne.Z)(Sn,["suffix","iconRender","visibilityToggle"])),{type:An?"text":"password",className:dn,prefixCls:$t,suffix:bn});return Ht&&(ke.size=Ht),Fe.createElement(he.Z,Object.assign({ref:(0,Mt.sQ)(vn,Ye)},ke))}),et=ue(72395),lt=ue(96159),Ie=ue(71577),_e=ue(98675),Ue=ue(4173),Ze=function(kt,vn){var qt={};for(var cn in kt)Object.prototype.hasOwnProperty.call(kt,cn)&&vn.indexOf(cn)<0&&(qt[cn]=kt[cn]);if(kt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var An=0,cn=Object.getOwnPropertySymbols(kt);An<cn.length;An++)vn.indexOf(cn[An])<0&&Object.prototype.propertyIsEnumerable.call(kt,cn[An])&&(qt[cn[An]]=kt[cn[An]]);return qt},bt=Fe.forwardRef((kt,vn)=>{const{prefixCls:qt,inputPrefixCls:cn,className:An,size:Zn,suffix:Ye,enterButton:Ee=!1,addonAfter:Tt,loading:gn,disabled:Xt,onSearch:Je,onChange:rt,onCompositionStart:Ht,onCompositionEnd:Sn}=kt,sn=Ze(kt,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:$t,direction:Bt}=Fe.useContext(qe.E_),bn=Fe.useRef(!1),dn=$t("input-search",qt),ke=$t("input",cn),{compactSize:ce}=(0,Ue.ri)(dn,Bt),le=(0,_e.Z)(Ln=>{var Nr;return(Nr=Zn!=null?Zn:ce)!==null&&Nr!==void 0?Nr:Ln}),ve=Fe.useRef(null),pe=Ln=>{Ln&&Ln.target&&Ln.type==="click"&&Je&&Je(Ln.target.value,Ln,{source:"clear"}),rt&&rt(Ln)},oe=Ln=>{var Nr;document.activeElement===((Nr=ve.current)===null||Nr===void 0?void 0:Nr.input)&&Ln.preventDefault()},ze=Ln=>{var Nr,Qr;Je&&Je((Qr=(Nr=ve.current)===null||Nr===void 0?void 0:Nr.input)===null||Qr===void 0?void 0:Qr.value,Ln,{source:"input"})},yt=Ln=>{bn.current||gn||ze(Ln)},Vt=typeof Ee=="boolean"?Fe.createElement(et.Z,null):null,en=`${dn}-button`;let un;const yn=Ee||{},Jt=yn.type&&yn.type.__ANT_BUTTON===!0;Jt||yn.type==="button"?un=(0,lt.Tm)(yn,Object.assign({onMouseDown:oe,onClick:Ln=>{var Nr,Qr;(Qr=(Nr=yn==null?void 0:yn.props)===null||Nr===void 0?void 0:Nr.onClick)===null||Qr===void 0||Qr.call(Nr,Ln),ze(Ln)},key:"enterButton"},Jt?{className:en,size:le}:{})):un=Fe.createElement(Ie.ZP,{className:en,type:Ee?"primary":void 0,size:le,disabled:Xt,key:"enterButton",onMouseDown:oe,onClick:ze,loading:gn,icon:Vt},Ee),Tt&&(un=[un,(0,lt.Tm)(Tt,{key:"addonAfter"})]);const Cr=tt()(dn,{[`${dn}-rtl`]:Bt==="rtl",[`${dn}-${le}`]:!!le,[`${dn}-with-button`]:!!Ee},An),Tr=Ln=>{bn.current=!0,Ht==null||Ht(Ln)},Rt=Ln=>{bn.current=!1,Sn==null||Sn(Ln)};return Fe.createElement(he.Z,Object.assign({ref:(0,Mt.sQ)(ve,vn),onPressEnter:yt},sn,{size:le,onCompositionStart:Tr,onCompositionEnd:Rt,prefixCls:ke,addonAfter:un,suffix:Ye,onChange:pe,className:Cr,disabled:Xt}))}),xt=ue(96330);const Ge=he.Z;Ge.Group=we,Ge.Search=bt,Ge.TextArea=xt.Z,Ge.Password=Lt;var Ot=Ge},47673:function(mn,Ut,ue){"use strict";ue.d(Ut,{M1:function(){return Me},TM:function(){return lt},Xy:function(){return we},bi:function(){return ct},e5:function(){return et},ik:function(){return Ne},nz:function(){return ye},pU:function(){return Ce},s7:function(){return Mt},x0:function(){return De}});var be=ue(14747),tt=ue(80110),Fe=ue(45503),qe=ue(67968);const ye=Ie=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:Ie,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),Ce=Ie=>({borderColor:Ie.hoverBorderColor}),Me=Ie=>({borderColor:Ie.activeBorderColor,boxShadow:Ie.activeShadow,outline:0}),we=Ie=>({color:Ie.colorTextDisabled,backgroundColor:Ie.colorBgContainerDisabled,borderColor:Ie.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},Ce((0,Fe.TS)(Ie,{hoverBorderColor:Ie.colorBorder})))}),he=Ie=>{const{paddingBlockLG:_e,fontSizeLG:Ue,lineHeightLG:Ze,borderRadiusLG:At,paddingInlineLG:bt}=Ie;return{padding:`${_e}px ${bt}px`,fontSize:Ue,lineHeight:Ze,borderRadius:At}},De=Ie=>({padding:`${Ie.paddingBlockSM}px ${Ie.paddingInlineSM}px`,borderRadius:Ie.borderRadiusSM}),ct=(Ie,_e)=>{const{componentCls:Ue,colorError:Ze,colorWarning:At,errorActiveShadow:bt,warningActiveShadow:xt,colorErrorBorderHover:Ge,colorWarningBorderHover:Ot}=Ie;return{[`&-status-error:not(${_e}-disabled):not(${_e}-borderless)${_e}`]:{borderColor:Ze,"&:hover":{borderColor:Ge},"&:focus, &-focused":Object.assign({},Me((0,Fe.TS)(Ie,{activeBorderColor:Ze,activeShadow:bt}))),[`${Ue}-prefix, ${Ue}-suffix`]:{color:Ze}},[`&-status-warning:not(${_e}-disabled):not(${_e}-borderless)${_e}`]:{borderColor:At,"&:hover":{borderColor:Ot},"&:focus, &-focused":Object.assign({},Me((0,Fe.TS)(Ie,{activeBorderColor:At,activeShadow:xt}))),[`${Ue}-prefix, ${Ue}-suffix`]:{color:At}}}},Ne=Ie=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${Ie.paddingBlock}px ${Ie.paddingInline}px`,color:Ie.colorText,fontSize:Ie.fontSize,lineHeight:Ie.lineHeight,backgroundColor:Ie.colorBgContainer,backgroundImage:"none",borderWidth:Ie.lineWidth,borderStyle:Ie.lineType,borderColor:Ie.colorBorder,borderRadius:Ie.borderRadius,transition:`all ${Ie.motionDurationMid}`},ye(Ie.colorTextPlaceholder)),{"&:hover":Object.assign({},Ce(Ie)),"&:focus, &-focused":Object.assign({},Me(Ie)),"&-disabled, &[disabled]":Object.assign({},we(Ie)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:"transparent",border:"none",boxShadow:"none"}},"textarea&":{maxWidth:"100%",height:"auto",minHeight:Ie.controlHeight,lineHeight:Ie.lineHeight,verticalAlign:"bottom",transition:`all ${Ie.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},he(Ie)),"&-sm":Object.assign({},De(Ie)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),Mt=Ie=>{const{componentCls:_e,antCls:Ue}=Ie;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:Ie.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${_e}, &-lg > ${_e}-group-addon`]:Object.assign({},he(Ie)),[`&-sm ${_e}, &-sm > ${_e}-group-addon`]:Object.assign({},De(Ie)),[`&-lg ${Ue}-select-single ${Ue}-select-selector`]:{height:Ie.controlHeightLG},[`&-sm ${Ue}-select-single ${Ue}-select-selector`]:{height:Ie.controlHeightSM},[`> ${_e}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${_e}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${Ie.paddingInline}px`,color:Ie.colorText,fontWeight:"normal",fontSize:Ie.fontSize,textAlign:"center",backgroundColor:Ie.colorFillAlter,border:`${Ie.lineWidth}px ${Ie.lineType} ${Ie.colorBorder}`,borderRadius:Ie.borderRadius,transition:`all ${Ie.motionDurationSlow}`,lineHeight:1,[`${Ue}-select`]:{margin:`-${Ie.paddingBlock+1}px -${Ie.paddingInline}px`,[`&${Ue}-select-single:not(${Ue}-select-customize-input)`]:{[`${Ue}-select-selector`]:{backgroundColor:"inherit",border:`${Ie.lineWidth}px ${Ie.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${Ue}-select-selector`]:{color:Ie.colorPrimary}}},[`${Ue}-cascader-picker`]:{margin:`-9px -${Ie.paddingInline}px`,backgroundColor:"transparent",[`${Ue}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${_e}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${_e}-search-with-button &`]:{zIndex:0}}},[`> ${_e}:first-child, ${_e}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${Ue}-select ${Ue}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${_e}-affix-wrapper`]:{[`&:not(:first-child) ${_e}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${_e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${_e}:last-child, ${_e}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${Ue}-select ${Ue}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${_e}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${_e}-search &`]:{borderStartStartRadius:Ie.borderRadius,borderEndStartRadius:Ie.borderRadius}},[`&:not(:first-child), ${_e}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${_e}-group-compact`]:Object.assign(Object.assign({display:"block"},(0,be.dF)()),{[`${_e}-group-addon, ${_e}-group-wrap, > ${_e}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:Ie.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`
& > ${_e}-affix-wrapper,
& > ${_e}-number-affix-wrapper,
& > ${Ue}-picker-range
`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-Ie.lineWidth,borderInlineEndWidth:Ie.lineWidth},[`${_e}`]:{float:"none"},[`& > ${Ue}-select > ${Ue}-select-selector,
& > ${Ue}-select-auto-complete ${_e},
& > ${Ue}-cascader-picker ${_e},
& > ${_e}-group-wrapper ${_e}`]:{borderInlineEndWidth:Ie.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${Ue}-select-focused`]:{zIndex:1},[`& > ${Ue}-select > ${Ue}-select-arrow`]:{zIndex:1},[`& > *:first-child,
& > ${Ue}-select:first-child > ${Ue}-select-selector,
& > ${Ue}-select-auto-complete:first-child ${_e},
& > ${Ue}-cascader-picker:first-child ${_e}`]:{borderStartStartRadius:Ie.borderRadius,borderEndStartRadius:Ie.borderRadius},[`& > *:last-child,
& > ${Ue}-select:last-child > ${Ue}-select-selector,
& > ${Ue}-cascader-picker:last-child ${_e},
& > ${Ue}-cascader-picker-focused:last-child ${_e}`]:{borderInlineEndWidth:Ie.lineWidth,borderStartEndRadius:Ie.borderRadius,borderEndEndRadius:Ie.borderRadius},[`& > ${Ue}-select-auto-complete ${_e}`]:{verticalAlign:"top"},[`${_e}-group-wrapper + ${_e}-group-wrapper`]:{marginInlineStart:-Ie.lineWidth,[`${_e}-affix-wrapper`]:{borderRadius:0}},[`${_e}-group-wrapper:not(:last-child)`]:{[`&${_e}-search > ${_e}-group`]:{[`& > ${_e}-group-addon > ${_e}-search-button`]:{borderRadius:0},[`& > ${_e}`]:{borderStartStartRadius:Ie.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:Ie.borderRadius}}}})}},ut=Ie=>{const{componentCls:_e,controlHeightSM:Ue,lineWidth:Ze}=Ie,bt=(Ue-Ze*2-16)/2;return{[_e]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,be.Wf)(Ie)),Ne(Ie)),ct(Ie,_e)),{'&[type="color"]':{height:Ie.controlHeight,[`&${_e}-lg`]:{height:Ie.controlHeightLG},[`&${_e}-sm`]:{height:Ue,paddingTop:bt,paddingBottom:bt}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},Qe=Ie=>{const{componentCls:_e}=Ie;return{[`${_e}-clear-icon`]:{margin:0,color:Ie.colorTextQuaternary,fontSize:Ie.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${Ie.motionDurationSlow}`,"&:hover":{color:Ie.colorTextTertiary},"&:active":{color:Ie.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${Ie.inputAffixPadding}px`}}}},Xe=Ie=>{const{componentCls:_e,inputAffixPadding:Ue,colorTextDescription:Ze,motionDurationSlow:At,colorIcon:bt,colorIconHover:xt,iconCls:Ge}=Ie;return{[`${_e}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Ne(Ie)),{display:"inline-flex",[`&:not(${_e}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},Ce(Ie)),{zIndex:1,[`${_e}-search-with-button &`]:{zIndex:0}}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${_e}[disabled]`]:{background:"transparent"}},[`> input${_e}`]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${_e}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:Ie.paddingXS}},"&-show-count-suffix":{color:Ze},"&-show-count-has-suffix":{marginInlineEnd:Ie.paddingXXS},"&-prefix":{marginInlineEnd:Ue},"&-suffix":{marginInlineStart:Ue}}}),Qe(Ie)),{[`${Ge}${_e}-password-icon`]:{color:bt,cursor:"pointer",transition:`all ${At}`,"&:hover":{color:xt}}}),ct(Ie,`${_e}-affix-wrapper`))}},Te=Ie=>{const{componentCls:_e,colorError:Ue,colorWarning:Ze,borderRadiusLG:At,borderRadiusSM:bt}=Ie;return{[`${_e}-group`]:Object.assign(Object.assign(Object.assign({},(0,be.Wf)(Ie)),Mt(Ie)),{"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${_e}-group-addon`]:{borderRadius:At,fontSize:Ie.fontSizeLG}},"&-sm":{[`${_e}-group-addon`]:{borderRadius:bt}},"&-status-error":{[`${_e}-group-addon`]:{color:Ue,borderColor:Ue}},"&-status-warning":{[`${_e}-group-addon`]:{color:Ze,borderColor:Ze}},"&-disabled":{[`${_e}-group-addon`]:Object.assign({},we(Ie))},[`&:not(${_e}-compact-first-item):not(${_e}-compact-last-item)${_e}-compact-item`]:{[`${_e}, ${_e}-group-addon`]:{borderRadius:0}},[`&:not(${_e}-compact-last-item)${_e}-compact-first-item`]:{[`${_e}, ${_e}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${_e}-compact-first-item)${_e}-compact-last-item`]:{[`${_e}, ${_e}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}})}},Et=Ie=>{const{componentCls:_e,antCls:Ue}=Ie,Ze=`${_e}-search`;return{[Ze]:{[`${_e}`]:{"&:hover, &:focus":{borderColor:Ie.colorPrimaryHover,[`+ ${_e}-group-addon ${Ze}-button:not(${Ue}-btn-primary)`]:{borderInlineStartColor:Ie.colorPrimaryHover}}},[`${_e}-affix-wrapper`]:{borderRadius:0},[`${_e}-lg`]:{lineHeight:Ie.lineHeightLG-2e-4},[`> ${_e}-group`]:{[`> ${_e}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${Ze}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:Ie.borderRadius,borderEndEndRadius:Ie.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${Ze}-button:not(${Ue}-btn-primary)`]:{color:Ie.colorTextDescription,"&:hover":{color:Ie.colorPrimaryHover},"&:active":{color:Ie.colorPrimaryActive},[`&${Ue}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${Ze}-button`]:{height:Ie.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${Ze}-button`]:{height:Ie.controlHeightLG},[`&-small ${Ze}-button`]:{height:Ie.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${_e}-compact-item`]:{[`&:not(${_e}-compact-last-item)`]:{[`${_e}-group-addon`]:{[`${_e}-search-button`]:{marginInlineEnd:-Ie.lineWidth,borderRadius:0}}},[`&:not(${_e}-compact-first-item)`]:{[`${_e},${_e}-affix-wrapper`]:{borderRadius:0}},[`> ${_e}-group-addon ${_e}-search-button,
> ${_e},
${_e}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${_e}-affix-wrapper-focused`]:{zIndex:2}}}}},Lt=Ie=>{const{componentCls:_e,paddingLG:Ue}=Ie,Ze=`${_e}-textarea`;return{[Ze]:{position:"relative","&-show-count":{[`> ${_e}`]:{height:"100%"},[`${_e}-data-count`]:{position:"absolute",bottom:-Ie.fontSize*Ie.lineHeight,insetInlineEnd:0,color:Ie.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${_e}`]:{paddingInlineEnd:Ue}},[`&-affix-wrapper${Ze}-has-feedback`]:{[`${_e}`]:{paddingInlineEnd:Ue}},[`&-affix-wrapper${_e}-affix-wrapper`]:{padding:0,[`> textarea${_e}`]:{fontSize:"inherit",border:"none",outline:"none","&:focus":{boxShadow:"none !important"}},[`${_e}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${_e}-clear-icon`]:{position:"absolute",insetInlineEnd:Ie.paddingXS,insetBlockStart:Ie.paddingXS},[`${Ze}-suffix`]:{position:"absolute",top:0,insetInlineEnd:Ie.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}};function et(Ie){return(0,Fe.TS)(Ie,{inputAffixPadding:Ie.paddingXXS})}const lt=Ie=>{const{controlHeight:_e,fontSize:Ue,lineHeight:Ze,lineWidth:At,controlHeightSM:bt,controlHeightLG:xt,fontSizeLG:Ge,lineHeightLG:Ot,paddingSM:kt,controlPaddingHorizontalSM:vn,controlPaddingHorizontal:qt,colorFillAlter:cn,colorPrimaryHover:An,controlOutlineWidth:Zn,controlOutline:Ye,colorErrorOutline:Ee,colorWarningOutline:Tt}=Ie;return{paddingBlock:Math.max(Math.round((_e-Ue*Ze)/2*10)/10-At,3),paddingBlockSM:Math.max(Math.round((bt-Ue*Ze)/2*10)/10-At,0),paddingBlockLG:Math.ceil((xt-Ge*Ot)/2*10)/10-At,paddingInline:kt-At,paddingInlineSM:vn-At,paddingInlineLG:qt-At,addonBg:cn,activeBorderColor:An,hoverBorderColor:An,activeShadow:`0 0 0 ${Zn}px ${Ye}`,errorActiveShadow:`0 0 0 ${Zn}px ${Ee}`,warningActiveShadow:`0 0 0 ${Zn}px ${Tt}`}};Ut.ZP=(0,qe.Z)("Input",Ie=>{const _e=(0,Fe.TS)(Ie,et(Ie));return[ut(_e),Lt(_e),Xe(_e),Te(_e),Et(_e),(0,tt.c)(_e)]},lt)},78045:function(mn,Ut,ue){"use strict";ue.d(Ut,{ZP:function(){return Ye}});var be=ue(94184),tt=ue.n(be),Fe=ue(5663),qe=ue(1337),ye=ue(67294),Ce=ue(53124),Me=ue(98675);const we=ye.createContext(null),he=we.Provider;var De=we;const ct=ye.createContext(null),Ne=ct.Provider;var Mt=ue(95860),ut=ue(17799),Qe=ue(98866),Xe=ue(65223),Te=ue(14747),Et=ue(67968),Lt=ue(45503);const et=Ee=>{const{componentCls:Tt,antCls:gn}=Ee,Xt=`${Tt}-group`;return{[Xt]:Object.assign(Object.assign({},(0,Te.Wf)(Ee)),{display:"inline-block",fontSize:0,[`&${Xt}-rtl`]:{direction:"rtl"},[`${gn}-badge ${gn}-badge-count`]:{zIndex:1},[`> ${gn}-badge:not(:first-child) > ${gn}-button-wrapper`]:{borderInlineStart:"none"}})}},lt=Ee=>{const{componentCls:Tt,wrapperMarginInlineEnd:gn,colorPrimary:Xt,radioSize:Je,motionDurationSlow:rt,motionDurationMid:Ht,motionEaseInOutCirc:Sn,colorBgContainer:sn,colorBorder:$t,lineWidth:Bt,dotSize:bn,colorBgContainerDisabled:dn,colorTextDisabled:ke,paddingXS:ce,dotColorDisabled:le,lineType:ve,radioDotDisabledSize:pe,wireframe:oe,colorWhite:ze}=Ee,yt=`${Tt}-inner`;return{[`${Tt}-wrapper`]:Object.assign(Object.assign({},(0,Te.Wf)(Ee)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:gn,cursor:"pointer",[`&${Tt}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:Ee.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${Tt}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${Bt}px ${ve} ${Xt}`,borderRadius:"50%",visibility:"hidden",content:'""'},[Tt]:Object.assign(Object.assign({},(0,Te.Wf)(Ee)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${Tt}-wrapper:hover &,
&:hover ${yt}`]:{borderColor:Xt},[`${Tt}-input:focus-visible + ${yt}`]:Object.assign({},(0,Te.oN)(Ee)),[`${Tt}:hover::after, ${Tt}-wrapper:hover &::after`]:{visibility:"visible"},[`${Tt}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:Je,height:Je,marginBlockStart:Je/-2,marginInlineStart:Je/-2,backgroundColor:oe?Xt:ze,borderBlockStart:0,borderInlineStart:0,borderRadius:Je,transform:"scale(0)",opacity:0,transition:`all ${rt} ${Sn}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:Je,height:Je,backgroundColor:sn,borderColor:$t,borderStyle:"solid",borderWidth:Bt,borderRadius:"50%",transition:`all ${Ht}`},[`${Tt}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${Tt}-checked`]:{[yt]:{borderColor:Xt,backgroundColor:oe?sn:Xt,"&::after":{transform:`scale(${bn/Je})`,opacity:1,transition:`all ${rt} ${Sn}`}}},[`${Tt}-disabled`]:{cursor:"not-allowed",[yt]:{backgroundColor:dn,borderColor:$t,cursor:"not-allowed","&::after":{backgroundColor:le}},[`${Tt}-input`]:{cursor:"not-allowed"},[`${Tt}-disabled + span`]:{color:ke,cursor:"not-allowed"},[`&${Tt}-checked`]:{[yt]:{"&::after":{transform:`scale(${pe/Je})`}}}},[`span${Tt} + *`]:{paddingInlineStart:ce,paddingInlineEnd:ce}})}},Ie=Ee=>{const{buttonColor:Tt,controlHeight:gn,componentCls:Xt,lineWidth:Je,lineType:rt,colorBorder:Ht,motionDurationSlow:Sn,motionDurationMid:sn,buttonPaddingInline:$t,fontSize:Bt,buttonBg:bn,fontSizeLG:dn,controlHeightLG:ke,controlHeightSM:ce,paddingXS:le,borderRadius:ve,borderRadiusSM:pe,borderRadiusLG:oe,buttonCheckedBg:ze,buttonSolidCheckedColor:yt,colorTextDisabled:Vt,colorBgContainerDisabled:en,buttonCheckedBgDisabled:un,buttonCheckedColorDisabled:yn,colorPrimary:Jt,colorPrimaryHover:Cr,colorPrimaryActive:Tr,buttonSolidCheckedBg:Rt,buttonSolidCheckedHoverBg:Ln,buttonSolidCheckedActiveBg:Nr}=Ee;return{[`${Xt}-button-wrapper`]:{position:"relative",display:"inline-block",height:gn,margin:0,paddingInline:$t,paddingBlock:0,color:Tt,fontSize:Bt,lineHeight:`${gn-Je*2}px`,background:bn,border:`${Je}px ${rt} ${Ht}`,borderBlockStartWidth:Je+.02,borderInlineStartWidth:0,borderInlineEndWidth:Je,cursor:"pointer",transition:[`color ${sn}`,`background ${sn}`,`box-shadow ${sn}`].join(","),a:{color:Tt},[`> ${Xt}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:-Je,insetInlineStart:-Je,display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:Je,paddingInline:0,backgroundColor:Ht,transition:`background-color ${Sn}`,content:'""'}},"&:first-child":{borderInlineStart:`${Je}px ${rt} ${Ht}`,borderStartStartRadius:ve,borderEndStartRadius:ve},"&:last-child":{borderStartEndRadius:ve,borderEndEndRadius:ve},"&:first-child:last-child":{borderRadius:ve},[`${Xt}-group-large &`]:{height:ke,fontSize:dn,lineHeight:`${ke-Je*2}px`,"&:first-child":{borderStartStartRadius:oe,borderEndStartRadius:oe},"&:last-child":{borderStartEndRadius:oe,borderEndEndRadius:oe}},[`${Xt}-group-small &`]:{height:ce,paddingInline:le-Je,paddingBlock:0,lineHeight:`${ce-Je*2}px`,"&:first-child":{borderStartStartRadius:pe,borderEndStartRadius:pe},"&:last-child":{borderStartEndRadius:pe,borderEndEndRadius:pe}},"&:hover":{position:"relative",color:Jt},"&:has(:focus-visible)":Object.assign({},(0,Te.oN)(Ee)),[`${Xt}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${Xt}-button-wrapper-disabled)`]:{zIndex:1,color:Jt,background:ze,borderColor:Jt,"&::before":{backgroundColor:Jt},"&:first-child":{borderColor:Jt},"&:hover":{color:Cr,borderColor:Cr,"&::before":{backgroundColor:Cr}},"&:active":{color:Tr,borderColor:Tr,"&::before":{backgroundColor:Tr}}},[`${Xt}-group-solid &-checked:not(${Xt}-button-wrapper-disabled)`]:{color:yt,background:Rt,borderColor:Rt,"&:hover":{color:yt,background:Ln,borderColor:Ln},"&:active":{color:yt,background:Nr,borderColor:Nr}},"&-disabled":{color:Vt,backgroundColor:en,borderColor:Ht,cursor:"not-allowed","&:first-child, &:hover":{color:Vt,backgroundColor:en,borderColor:Ht}},[`&-disabled${Xt}-button-wrapper-checked`]:{color:yn,backgroundColor:un,borderColor:Ht,boxShadow:"none"}}}},_e=Ee=>Ee-4*2;var Ue=(0,Et.Z)("Radio",Ee=>{const{controlOutline:Tt,controlOutlineWidth:gn,radioSize:Xt}=Ee,Je=`0 0 0 ${gn}px ${Tt}`,rt=Je,Ht=_e(Xt),Sn=(0,Lt.TS)(Ee,{radioDotDisabledSize:Ht,radioFocusShadow:Je,radioButtonFocusShadow:rt});return[et(Sn),lt(Sn),Ie(Sn)]},Ee=>{const{wireframe:Tt,padding:gn,marginXS:Xt,lineWidth:Je,fontSizeLG:rt,colorText:Ht,colorBgContainer:Sn,colorTextDisabled:sn,controlItemBgActiveDisabled:$t,colorTextLightSolid:Bt,colorPrimary:bn,colorPrimaryHover:dn,colorPrimaryActive:ke}=Ee,ce=4,le=rt,ve=Tt?_e(le):le-(ce+Je)*2;return{radioSize:le,dotSize:ve,dotColorDisabled:sn,buttonSolidCheckedColor:Bt,buttonSolidCheckedBg:bn,buttonSolidCheckedHoverBg:dn,buttonSolidCheckedActiveBg:ke,buttonBg:Sn,buttonCheckedBg:Sn,buttonColor:Ht,buttonCheckedBgDisabled:$t,buttonCheckedColorDisabled:sn,buttonPaddingInline:gn-Je,wrapperMarginInlineEnd:Xt}}),Ze=ue(45353),At=ue(92429),bt=function(Ee,Tt){var gn={};for(var Xt in Ee)Object.prototype.hasOwnProperty.call(Ee,Xt)&&Tt.indexOf(Xt)<0&&(gn[Xt]=Ee[Xt]);if(Ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Je=0,Xt=Object.getOwnPropertySymbols(Ee);Je<Xt.length;Je++)Tt.indexOf(Xt[Je])<0&&Object.prototype.propertyIsEnumerable.call(Ee,Xt[Je])&&(gn[Xt[Je]]=Ee[Xt[Je]]);return gn};const xt=(Ee,Tt)=>{var gn,Xt;const Je=ye.useContext(De),rt=ye.useContext(ct),{getPrefixCls:Ht,direction:Sn,radio:sn}=ye.useContext(Ce.E_),$t=ye.useRef(null),Bt=(0,ut.sQ)(Tt,$t),{isFormItemInput:bn}=ye.useContext(Xe.aM),dn=Tr=>{var Rt,Ln;(Rt=Ee.onChange)===null||Rt===void 0||Rt.call(Ee,Tr),(Ln=Je==null?void 0:Je.onChange)===null||Ln===void 0||Ln.call(Je,Tr)},{prefixCls:ke,className:ce,rootClassName:le,children:ve,style:pe}=Ee,oe=bt(Ee,["prefixCls","className","rootClassName","children","style"]),ze=Ht("radio",ke),yt=((Je==null?void 0:Je.optionType)||rt)==="button",Vt=yt?`${ze}-button`:ze,[en,un]=Ue(ze),yn=Object.assign({},oe),Jt=ye.useContext(Qe.Z);Je&&(yn.name=Je.name,yn.onChange=dn,yn.checked=Ee.value===Je.value,yn.disabled=(gn=yn.disabled)!==null&&gn!==void 0?gn:Je.disabled),yn.disabled=(Xt=yn.disabled)!==null&&Xt!==void 0?Xt:Jt;const Cr=tt()(`${Vt}-wrapper`,{[`${Vt}-wrapper-checked`]:yn.checked,[`${Vt}-wrapper-disabled`]:yn.disabled,[`${Vt}-wrapper-rtl`]:Sn==="rtl",[`${Vt}-wrapper-in-form-item`]:bn},sn==null?void 0:sn.className,ce,le,un);return en(ye.createElement(Ze.Z,{component:"Radio",disabled:yn.disabled},ye.createElement("label",{className:Cr,style:Object.assign(Object.assign({},sn==null?void 0:sn.style),pe),onMouseEnter:Ee.onMouseEnter,onMouseLeave:Ee.onMouseLeave},ye.createElement(Mt.Z,Object.assign({},yn,{className:tt()(yn.className,!yt&&At.A),type:"radio",prefixCls:Vt,ref:Bt})),ve!==void 0?ye.createElement("span",null,ve):null)))};var Ot=ye.forwardRef(xt);const kt=ye.forwardRef((Ee,Tt)=>{const{getPrefixCls:gn,direction:Xt}=ye.useContext(Ce.E_),[Je,rt]=(0,Fe.Z)(Ee.defaultValue,{value:Ee.value}),Ht=Rt=>{const Ln=Je,Nr=Rt.target.value;"value"in Ee||rt(Nr);const{onChange:Qr}=Ee;Qr&&Nr!==Ln&&Qr(Rt)},{prefixCls:Sn,className:sn,rootClassName:$t,options:Bt,buttonStyle:bn="outline",disabled:dn,children:ke,size:ce,style:le,id:ve,onMouseEnter:pe,onMouseLeave:oe,onFocus:ze,onBlur:yt}=Ee,Vt=gn("radio",Sn),en=`${Vt}-group`,[un,yn]=Ue(Vt);let Jt=ke;Bt&&Bt.length>0&&(Jt=Bt.map(Rt=>typeof Rt=="string"||typeof Rt=="number"?ye.createElement(Ot,{key:Rt.toString(),prefixCls:Vt,disabled:dn,value:Rt,checked:Je===Rt},Rt):ye.createElement(Ot,{key:`radio-group-value-options-${Rt.value}`,prefixCls:Vt,disabled:Rt.disabled||dn,value:Rt.value,checked:Je===Rt.value,title:Rt.title,style:Rt.style},Rt.label)));const Cr=(0,Me.Z)(ce),Tr=tt()(en,`${en}-${bn}`,{[`${en}-${Cr}`]:Cr,[`${en}-rtl`]:Xt==="rtl"},sn,$t,yn);return un(ye.createElement("div",Object.assign({},(0,qe.Z)(Ee,{aria:!0,data:!0}),{className:Tr,style:le,onMouseEnter:pe,onMouseLeave:oe,onFocus:ze,onBlur:yt,id:ve,ref:Tt}),ye.createElement(he,{value:{onChange:Ht,value:Je,disabled:Ee.disabled,name:Ee.name,optionType:Ee.optionType}},Jt)))});var vn=ye.memo(kt),qt=function(Ee,Tt){var gn={};for(var Xt in Ee)Object.prototype.hasOwnProperty.call(Ee,Xt)&&Tt.indexOf(Xt)<0&&(gn[Xt]=Ee[Xt]);if(Ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Je=0,Xt=Object.getOwnPropertySymbols(Ee);Je<Xt.length;Je++)Tt.indexOf(Xt[Je])<0&&Object.prototype.propertyIsEnumerable.call(Ee,Xt[Je])&&(gn[Xt[Je]]=Ee[Xt[Je]]);return gn};const cn=(Ee,Tt)=>{const{getPrefixCls:gn}=ye.useContext(Ce.E_),{prefixCls:Xt}=Ee,Je=qt(Ee,["prefixCls"]),rt=gn("radio",Xt);return ye.createElement(Ne,{value:"button"},ye.createElement(Ot,Object.assign({prefixCls:rt},Je,{type:"radio",ref:Tt})))};var An=ye.forwardRef(cn);const Zn=Ot;Zn.Button=An,Zn.Group=vn,Zn.__ANT_RADIO=!0;var Ye=Zn},11713:function(mn,Ut,ue){"use strict";ue.d(Ut,{default:function(){return tr}});var be=ue(94184),tt=ue.n(be),Fe=ue(87462),qe=ue(74902),ye=ue(4942),Ce=ue(1413),Me=ue(97685),we=ue(45987),he=ue(71002),De=ue(67294);function ct($e){var Ke=De.useRef();Ke.current=$e;var Ct=De.useCallback(function(){for(var ft,Kt=arguments.length,on=new Array(Kt),nn=0;nn<Kt;nn++)on[nn]=arguments[nn];return(ft=Ke.current)===null||ft===void 0?void 0:ft.call.apply(ft,[Ke].concat(on))},[]);return Ct}function Ne(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Mt=Ne()?De.useLayoutEffect:De.useEffect,ut=Mt,Qe=function(Ke,Ct){var ft=De.useRef(!0);Mt(function(){if(!ft.current)return Ke()},Ct),Mt(function(){return ft.current=!1,function(){ft.current=!0}},[])};function Xe($e){var Ke=De.useRef(!1),Ct=De.useState($e),ft=(0,Me.Z)(Ct,2),Kt=ft[0],on=ft[1];De.useEffect(function(){return Ke.current=!1,function(){Ke.current=!0}},[]);function nn(En,pn){pn&&Ke.current||on(En)}return[Kt,nn]}function Te($e){return $e!==void 0}function Et($e,Ke){var Ct=Ke||{},ft=Ct.defaultValue,Kt=Ct.value,on=Ct.onChange,nn=Ct.postState,En=Xe(function(){return Te(Kt)?Kt:Te(ft)?typeof ft=="function"?ft():ft:typeof $e=="function"?$e():$e}),pn=(0,Me.Z)(En,2),Zt=pn[0],wn=pn[1],kn=Kt!==void 0?Kt:Zt,er=nn?nn(kn):kn,Mn=ct(on),dr=Xe([kn]),Lr=(0,Me.Z)(dr,2),pr=Lr[0],wr=Lr[1];Qe(function(){var yr=pr[0];Zt!==yr&&Mn(Zt,yr)},[pr]),Qe(function(){Te(Kt)||wn(Kt)},[Kt]);var ir=ct(function(yr,Ir){wn(yr,Ir),wr([kn],Ir)});return[er,ir]}var Lt={};function et($e,Ke){}function lt($e,Ke){}function Ie(){Lt={}}function _e($e,Ke,Ct){!Ke&&!Lt[Ct]&&($e(!1,Ct),Lt[Ct]=!0)}function Ue($e,Ke){_e(et,$e,Ke)}function Ze($e,Ke){_e(lt,$e,Ke)}var At=Ue,bt=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var $e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test($e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test($e==null?void 0:$e.substr(0,4))},xt={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(Ke){var Ct=Ke.keyCode;if(Ke.altKey&&!Ke.ctrlKey||Ke.metaKey||Ct>=xt.F1&&Ct<=xt.F12)return!1;switch(Ct){case xt.ALT:case xt.CAPS_LOCK:case xt.CONTEXT_MENU:case xt.CTRL:case xt.DOWN:case xt.END:case xt.ESC:case xt.HOME:case xt.INSERT:case xt.LEFT:case xt.MAC_FF_META:case xt.META:case xt.NUMLOCK:case xt.NUM_CENTER:case xt.PAGE_DOWN:case xt.PAGE_UP:case xt.PAUSE:case xt.PRINT_SCREEN:case xt.RIGHT:case xt.SHIFT:case xt.UP:case xt.WIN_KEY:case xt.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(Ke){if(Ke>=xt.ZERO&&Ke<=xt.NINE||Ke>=xt.NUM_ZERO&&Ke<=xt.NUM_MULTIPLY||Ke>=xt.A&&Ke<=xt.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&Ke===0)return!0;switch(Ke){case xt.SPACE:case xt.QUESTION_MARK:case xt.NUM_PLUS:case xt.NUM_MINUS:case xt.NUM_PERIOD:case xt.NUM_DIVISION:case xt.SEMICOLON:case xt.DASH:case xt.EQUALS:case xt.COMMA:case xt.PERIOD:case xt.SLASH:case xt.APOSTROPHE:case xt.SINGLE_QUOTE:case xt.OPEN_SQUARE_BRACKET:case xt.BACKSLASH:case xt.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Ge=xt,Ot=ue(47655);function kt($e,Ke,Ct){var ft=De.useRef({});return(!("value"in ft.current)||Ct(ft.current.condition,Ke))&&(ft.current.value=$e(),ft.current.condition=Ke),ft.current.value}function vn($e,Ke){typeof $e=="function"?$e(Ke):(0,he.Z)($e)==="object"&&$e&&"current"in $e&&($e.current=Ke)}function qt(){for(var $e=arguments.length,Ke=new Array($e),Ct=0;Ct<$e;Ct++)Ke[Ct]=arguments[Ct];var ft=Ke.filter(function(Kt){return Kt});return ft.length<=1?ft[0]:function(Kt){Ke.forEach(function(on){vn(on,Kt)})}}function cn(){for(var $e=arguments.length,Ke=new Array($e),Ct=0;Ct<$e;Ct++)Ke[Ct]=arguments[Ct];return kt(function(){return qt.apply(void 0,Ke)},Ke,function(ft,Kt){return ft.length===Kt.length&&ft.every(function(on,nn){return on===Kt[nn]})})}function An($e){var Ke,Ct,ft=isMemo($e)?$e.type.type:$e.type;return!(typeof ft=="function"&&!((Ke=ft.prototype)!==null&&Ke!==void 0&&Ke.render)||typeof $e=="function"&&!((Ct=$e.prototype)!==null&&Ct!==void 0&&Ct.render))}var Zn=function(Ke){var Ct=Ke.className,ft=Ke.customizeIcon,Kt=Ke.customizeIconProps,on=Ke.onMouseDown,nn=Ke.onClick,En=Ke.children,pn;return typeof ft=="function"?pn=ft(Kt):pn=ft,De.createElement("span",{className:Ct,onMouseDown:function(wn){wn.preventDefault(),on&&on(wn)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:nn,"aria-hidden":!0},pn!==void 0?pn:De.createElement("span",{className:tt()(Ct.split(/\s+/).map(function(Zt){return"".concat(Zt,"-icon")}))},En))},Ye=Zn;function Ee($e,Ke,Ct,ft,Kt){var on=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,nn=arguments.length>6?arguments[6]:void 0,En=arguments.length>7?arguments[7]:void 0,pn=De.useMemo(function(){if((0,he.Z)(ft)==="object")return ft.clearIcon;if(Kt)return Kt},[ft,Kt]),Zt=De.useMemo(function(){return!!(!on&&ft&&(Ct.length||nn)&&!(En==="combobox"&&nn===""))},[ft,on,Ct.length,nn,En]);return{allowClear:Zt,clearIcon:De.createElement(Ye,{className:"".concat($e,"-clear"),onMouseDown:Ke,customizeIcon:pn},"\xD7")}}var Tt=De.createContext(null);function gn(){return De.useContext(Tt)}function Xt(){var $e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,Ke=De.useState(!1),Ct=(0,Me.Z)(Ke,2),ft=Ct[0],Kt=Ct[1],on=De.useRef(null),nn=function(){window.clearTimeout(on.current)};De.useEffect(function(){return nn},[]);var En=function(Zt,wn){nn(),on.current=window.setTimeout(function(){Kt(Zt),wn&&wn()},$e)};return[ft,En,nn]}function Je(){var $e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,Ke=De.useRef(null),Ct=De.useRef(null);De.useEffect(function(){return function(){window.clearTimeout(Ct.current)}},[]);function ft(Kt){(Kt||Ke.current===null)&&(Ke.current=Kt),window.clearTimeout(Ct.current),Ct.current=window.setTimeout(function(){Ke.current=null},$e)}return[function(){return Ke.current},ft]}function rt($e,Ke,Ct,ft){var Kt=De.useRef(null);Kt.current={open:Ke,triggerOpen:Ct,customizedTrigger:ft},De.useEffect(function(){function on(nn){var En;if(!((En=Kt.current)!==null&&En!==void 0&&En.customizedTrigger)){var pn=nn.target;pn.shadowRoot&&nn.composed&&(pn=nn.composedPath()[0]||pn),Kt.current.open&&$e().filter(function(Zt){return Zt}).every(function(Zt){return!Zt.contains(pn)&&Zt!==pn})&&Kt.current.triggerOpen(!1)}}return window.addEventListener("mousedown",on),function(){return window.removeEventListener("mousedown",on)}},[])}var Ht=`accept acceptCharset accessKey action allowFullScreen allowTransparency
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
charSet checked classID className colSpan cols content contentEditable contextMenu
controls coords crossOrigin data dateTime default defer dir disabled download draggable
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
mediaGroup method min minLength multiple muted name noValidate nonce open
optimum pattern placeholder poster preload radioGroup readOnly rel required
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
summary tabIndex target title type useMap value width wmode wrap`,Sn=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,sn="".concat(Ht," ").concat(Sn).split(/[\s\n]+/),$t="aria-",Bt="data-";function bn($e,Ke){return $e.indexOf(Ke)===0}function dn($e){var Ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ct;Ke===!1?Ct={aria:!0,data:!0,attr:!0}:Ke===!0?Ct={aria:!0}:Ct=(0,Ce.Z)({},Ke);var ft={};return Object.keys($e).forEach(function(Kt){(Ct.aria&&(Kt==="role"||bn(Kt,$t))||Ct.data&&bn(Kt,Bt)||Ct.attr&&sn.includes(Kt))&&(ft[Kt]=$e[Kt])}),ft}var ke=ue(48555),ce=ue(14075),le=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],ve=void 0;function pe($e,Ke){var Ct=$e.prefixCls,ft=$e.invalidate,Kt=$e.item,on=$e.renderItem,nn=$e.responsive,En=$e.responsiveDisabled,pn=$e.registerSize,Zt=$e.itemKey,wn=$e.className,kn=$e.style,er=$e.children,Mn=$e.display,dr=$e.order,Lr=$e.component,pr=Lr===void 0?"div":Lr,wr=(0,we.Z)($e,le),ir=nn&&!Mn;function yr(li){pn(Zt,li)}De.useEffect(function(){return function(){yr(null)}},[]);var Ir=on&&Kt!==ve?on(Kt):er,$r;ft||($r={opacity:ir?0:1,height:ir?0:ve,overflowY:ir?"hidden":ve,order:nn?dr:ve,pointerEvents:ir?"none":ve,position:ir?"absolute":ve});var mr={};ir&&(mr["aria-hidden"]=!0);var Wr=De.createElement(pr,(0,Fe.Z)({className:tt()(!ft&&Ct,wn),style:(0,Ce.Z)((0,Ce.Z)({},$r),kn)},mr,wr,{ref:Ke}),Ir);return nn&&(Wr=De.createElement(ke.Z,{onResize:function(Ii){var Ci=Ii.offsetWidth;yr(Ci)},disabled:En},Wr)),Wr}var oe=De.forwardRef(pe);oe.displayName="Item";var ze=oe,yt=ue(77527),Vt=ue(73935),en=ue(96523);function un($e){if(typeof MessageChannel=="undefined")(0,en.Z)($e);else{var Ke=new MessageChannel;Ke.port1.onmessage=function(){return $e()},Ke.port2.postMessage(void 0)}}function yn(){var $e=De.useRef(null),Ke=function(ft){$e.current||($e.current=[],un(function(){(0,Vt.unstable_batchedUpdates)(function(){$e.current.forEach(function(Kt){Kt()}),$e.current=null})})),$e.current.push(ft)};return Ke}function Jt($e,Ke){var Ct=De.useState(Ke),ft=(0,Me.Z)(Ct,2),Kt=ft[0],on=ft[1],nn=(0,yt.Z)(function(En){$e(function(){on(En)})});return[Kt,nn]}var Cr=De.createContext(null),Tr=["component"],Rt=["className"],Ln=["className"],Nr=function(Ke,Ct){var ft=De.useContext(Cr);if(!ft){var Kt=Ke.component,on=Kt===void 0?"div":Kt,nn=(0,we.Z)(Ke,Tr);return De.createElement(on,(0,Fe.Z)({},nn,{ref:Ct}))}var En=ft.className,pn=(0,we.Z)(ft,Rt),Zt=Ke.className,wn=(0,we.Z)(Ke,Ln);return De.createElement(Cr.Provider,{value:null},De.createElement(ze,(0,Fe.Z)({ref:Ct,className:tt()(En,Zt)},pn,wn)))},Qr=De.forwardRef(Nr);Qr.displayName="RawItem";var Gn=Qr,Fr=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Da="responsive",Fi="invalidate";function Oi($e){return"+ ".concat($e.length," ...")}function Ei($e,Ke){var Ct=$e.prefixCls,ft=Ct===void 0?"rc-overflow":Ct,Kt=$e.data,on=Kt===void 0?[]:Kt,nn=$e.renderItem,En=$e.renderRawItem,pn=$e.itemKey,Zt=$e.itemWidth,wn=Zt===void 0?10:Zt,kn=$e.ssr,er=$e.style,Mn=$e.className,dr=$e.maxCount,Lr=$e.renderRest,pr=$e.renderRawRest,wr=$e.suffix,ir=$e.component,yr=ir===void 0?"div":ir,Ir=$e.itemComponent,$r=$e.onVisibleChange,mr=(0,we.Z)($e,Fr),Wr=kn==="full",li=yn(),Ii=Jt(li,null),Ci=(0,Me.Z)(Ii,2),di=Ci[0],ki=Ci[1],Li=di||0,Gr=Jt(li,new Map),fi=(0,Me.Z)(Gr,2),Ar=fi[0],Ur=fi[1],ri=Jt(li,0),Mi=(0,Me.Z)(ri,2),Ba=Mi[0],Oa=Mi[1],Sa=Jt(li,0),Ui=(0,Me.Z)(Sa,2),Ai=Ui[0],Jr=Ui[1],Ta=Jt(li,0),ei=(0,Me.Z)(Ta,2),Pr=ei[0],pi=ei[1],Zi=(0,De.useState)(null),xi=(0,Me.Z)(Zi,2),Ni=xi[0],Zr=xi[1],Ji=(0,De.useState)(null),oa=(0,Me.Z)(Ji,2),qi=oa[0],sa=oa[1],ma=De.useMemo(function(){return qi===null&&Wr?Number.MAX_SAFE_INTEGER:qi||0},[qi,di]),Va=(0,De.useState)(!1),Yi=(0,Me.Z)(Va,2),ga=Yi[0],Ya=Yi[1],ja="".concat(ft,"-item"),oo=Math.max(Ba,Ai),Ra=dr===Da,da=on.length&&Ra,ti=dr===Fi,mi=da||typeof dr=="number"&&on.length>dr,ji=(0,De.useMemo)(function(){var $i=on;return da?di===null&&Wr?$i=on:$i=on.slice(0,Math.min(on.length,Li/wn)):typeof dr=="number"&&($i=on.slice(0,dr)),$i},[on,wn,di,dr,da]),la=(0,De.useMemo)(function(){return da?on.slice(ma+1):on.slice(ji.length)},[on,ji,da,ma]),Fa=(0,De.useCallback)(function($i,fr){var Xr;return typeof pn=="function"?pn($i):(Xr=pn&&($i==null?void 0:$i[pn]))!==null&&Xr!==void 0?Xr:fr},[pn]),ro=(0,De.useCallback)(nn||function($i){return $i},[nn]);function ho($i,fr,Xr){qi===$i&&(fr===void 0||fr===Ni)||(sa($i),Xr||(Ya($i<on.length-1),$r==null||$r($i)),fr!==void 0&&Zr(fr))}function Bo($i,fr){ki(fr.clientWidth)}function Oo($i,fr){Ur(function(Xr){var qr=new Map(Xr);return fr===null?qr.delete($i):qr.set($i,fr),qr})}function so($i,fr){Jr(fr),Oa(Ai)}function Ao($i,fr){pi(fr)}function Pi($i){return Ar.get(Fa(ji[$i],$i))}(0,ce.Z)(function(){if(Li&&typeof oo=="number"&&ji){var $i=Pr,fr=ji.length,Xr=fr-1;if(!fr){ho(0,null);return}for(var qr=0;qr<fr;qr+=1){var ii=Pi(qr);if(Wr&&(ii=ii||0),ii===void 0){ho(qr-1,void 0,!0);break}if($i+=ii,Xr===0&&$i<=Li||qr===Xr-1&&$i+Pi(Xr)<=Li){ho(Xr,null);break}else if($i+oo>Li){ho(qr-1,$i-ii-Pr+Ai);break}}wr&&Pi(0)+Pr>Li&&Zr(null)}},[Li,Ar,Ai,Pr,Fa,ji]);var ui=ga&&!!la.length,Ca={};Ni!==null&&da&&(Ca={position:"absolute",left:Ni,top:0});var va={prefixCls:ja,responsive:da,component:Ir,invalidate:ti},lo=En?function($i,fr){var Xr=Fa($i,fr);return De.createElement(Cr.Provider,{key:Xr,value:(0,Ce.Z)((0,Ce.Z)({},va),{},{order:fr,item:$i,itemKey:Xr,registerSize:Oo,display:fr<=ma})},En($i,fr))}:function($i,fr){var Xr=Fa($i,fr);return De.createElement(ze,(0,Fe.Z)({},va,{order:fr,key:Xr,item:$i,renderItem:ro,itemKey:Xr,registerSize:Oo,display:fr<=ma}))},io,hs={order:ui?ma:Number.MAX_SAFE_INTEGER,className:"".concat(ja,"-rest"),registerSize:so,display:ui};if(pr)pr&&(io=De.createElement(Cr.Provider,{value:(0,Ce.Z)((0,Ce.Z)({},va),hs)},pr(la)));else{var Qo=Lr||Oi;io=De.createElement(ze,(0,Fe.Z)({},va,hs),typeof Qo=="function"?Qo(la):Qo)}var ps=De.createElement(yr,(0,Fe.Z)({className:tt()(!ti&&ft,Mn),style:er,ref:Ke},mr),ji.map(lo),mi?io:null,wr&&De.createElement(ze,(0,Fe.Z)({},va,{responsive:Ra,responsiveDisabled:!da,order:ma,className:"".concat(ja,"-suffix"),registerSize:Ao,display:!0,style:Ca}),wr));return Ra&&(ps=De.createElement(ke.Z,{onResize:Bo,disabled:!da},ps)),ps}var ua=De.forwardRef(Ei);ua.displayName="Overflow",ua.Item=Gn,ua.RESPONSIVE=Da,ua.INVALIDATE=Fi;var ba=ua,ka=ba,ca=function(Ke,Ct){var ft,Kt,on=Ke.prefixCls,nn=Ke.id,En=Ke.inputElement,pn=Ke.disabled,Zt=Ke.tabIndex,wn=Ke.autoFocus,kn=Ke.autoComplete,er=Ke.editable,Mn=Ke.activeDescendantId,dr=Ke.value,Lr=Ke.maxLength,pr=Ke.onKeyDown,wr=Ke.onMouseDown,ir=Ke.onChange,yr=Ke.onPaste,Ir=Ke.onCompositionStart,$r=Ke.onCompositionEnd,mr=Ke.open,Wr=Ke.attrs,li=En||De.createElement("input",null),Ii=li,Ci=Ii.ref,di=Ii.props,ki=di.onKeyDown,Li=di.onChange,Gr=di.onMouseDown,fi=di.onCompositionStart,Ar=di.onCompositionEnd,Ur=di.style;return"maxLength"in li.props,li=De.cloneElement(li,(0,Ce.Z)((0,Ce.Z)((0,Ce.Z)({type:"search"},di),{},{id:nn,ref:qt(Ct,Ci),disabled:pn,tabIndex:Zt,autoComplete:kn||"off",autoFocus:wn,className:tt()("".concat(on,"-selection-search-input"),(ft=li)===null||ft===void 0||(Kt=ft.props)===null||Kt===void 0?void 0:Kt.className),role:"combobox","aria-label":"Search","aria-expanded":mr||!1,"aria-haspopup":"listbox","aria-owns":"".concat(nn,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(nn,"_list"),"aria-activedescendant":mr?Mn:void 0},Wr),{},{value:er?dr:"",maxLength:Lr,readOnly:!er,unselectable:er?null:"on",style:(0,Ce.Z)((0,Ce.Z)({},Ur),{},{opacity:er?null:0}),onKeyDown:function(Mi){pr(Mi),ki&&ki(Mi)},onMouseDown:function(Mi){wr(Mi),Gr&&Gr(Mi)},onChange:function(Mi){ir(Mi),Li&&Li(Mi)},onCompositionStart:function(Mi){Ir(Mi),fi&&fi(Mi)},onCompositionEnd:function(Mi){$r(Mi),Ar&&Ar(Mi)},onPaste:yr})),li},Hr=De.forwardRef(ca);Hr.displayName="Input";var La=Hr;function fo($e){return Array.isArray($e)?$e:$e!==void 0?[$e]:[]}var Za=typeof window!="undefined"&&window.document&&window.document.documentElement,Wa=Za;function ha($e){return $e!=null}function wt($e){return!$e&&$e!==0}function _n($e){return["string","number"].includes((0,he.Z)($e))}function Tn($e){var Ke=void 0;return $e&&(_n($e.title)?Ke=$e.title.toString():_n($e.label)&&(Ke=$e.label.toString())),Ke}function Pn($e,Ke){Wa?De.useLayoutEffect($e,Ke):De.useEffect($e,Ke)}function xr($e){var Ke;return(Ke=$e.key)!==null&&Ke!==void 0?Ke:$e.value}var nr=function(Ke){Ke.preventDefault(),Ke.stopPropagation()},ur=function(Ke){var Ct=Ke.id,ft=Ke.prefixCls,Kt=Ke.values,on=Ke.open,nn=Ke.searchValue,En=Ke.autoClearSearchValue,pn=Ke.inputRef,Zt=Ke.placeholder,wn=Ke.disabled,kn=Ke.mode,er=Ke.showSearch,Mn=Ke.autoFocus,dr=Ke.autoComplete,Lr=Ke.activeDescendantId,pr=Ke.tabIndex,wr=Ke.removeIcon,ir=Ke.maxTagCount,yr=Ke.maxTagTextLength,Ir=Ke.maxTagPlaceholder,$r=Ir===void 0?function(Zr){return"+ ".concat(Zr.length," ...")}:Ir,mr=Ke.tagRender,Wr=Ke.onToggleOpen,li=Ke.onRemove,Ii=Ke.onInputChange,Ci=Ke.onInputPaste,di=Ke.onInputKeyDown,ki=Ke.onInputMouseDown,Li=Ke.onInputCompositionStart,Gr=Ke.onInputCompositionEnd,fi=De.useRef(null),Ar=(0,De.useState)(0),Ur=(0,Me.Z)(Ar,2),ri=Ur[0],Mi=Ur[1],Ba=(0,De.useState)(!1),Oa=(0,Me.Z)(Ba,2),Sa=Oa[0],Ui=Oa[1],Ai="".concat(ft,"-selection"),Jr=on||kn==="multiple"&&En===!1||kn==="tags"?nn:"",Ta=kn==="tags"||kn==="multiple"&&En===!1||er&&(on||Sa);Pn(function(){Mi(fi.current.scrollWidth)},[Jr]);function ei(Zr,Ji,oa,qi,sa){return De.createElement("span",{className:tt()("".concat(Ai,"-item"),(0,ye.Z)({},"".concat(Ai,"-item-disabled"),oa)),title:Tn(Zr)},De.createElement("span",{className:"".concat(Ai,"-item-content")},Ji),qi&&De.createElement(Ye,{className:"".concat(Ai,"-item-remove"),onMouseDown:nr,onClick:sa,customizeIcon:wr},"\xD7"))}function Pr(Zr,Ji,oa,qi,sa){var ma=function(Yi){nr(Yi),Wr(!on)};return De.createElement("span",{onMouseDown:ma},mr({label:Ji,value:Zr,disabled:oa,closable:qi,onClose:sa}))}function pi(Zr){var Ji=Zr.disabled,oa=Zr.label,qi=Zr.value,sa=!wn&&!Ji,ma=oa;if(typeof yr=="number"&&(typeof oa=="string"||typeof oa=="number")){var Va=String(ma);Va.length>yr&&(ma="".concat(Va.slice(0,yr),"..."))}var Yi=function(Ya){Ya&&Ya.stopPropagation(),li(Zr)};return typeof mr=="function"?Pr(qi,ma,Ji,sa,Yi):ei(Zr,ma,Ji,sa,Yi)}function Zi(Zr){var Ji=typeof $r=="function"?$r(Zr):$r;return ei({title:Ji},Ji,!1)}var xi=De.createElement("div",{className:"".concat(Ai,"-search"),style:{width:ri},onFocus:function(){Ui(!0)},onBlur:function(){Ui(!1)}},De.createElement(La,{ref:pn,open:on,prefixCls:ft,id:Ct,inputElement:null,disabled:wn,autoFocus:Mn,autoComplete:dr,editable:Ta,activeDescendantId:Lr,value:Jr,onKeyDown:di,onMouseDown:ki,onChange:Ii,onPaste:Ci,onCompositionStart:Li,onCompositionEnd:Gr,tabIndex:pr,attrs:dn(Ke,!0)}),De.createElement("span",{ref:fi,className:"".concat(Ai,"-search-mirror"),"aria-hidden":!0},Jr,"\xA0")),Ni=De.createElement(ka,{prefixCls:"".concat(Ai,"-overflow"),data:Kt,renderItem:pi,renderRest:Zi,suffix:xi,itemKey:xr,maxCount:ir});return De.createElement(De.Fragment,null,Ni,!Kt.length&&!Jr&&De.createElement("span",{className:"".concat(Ai,"-placeholder")},Zt))},Hn=ur,je=function(Ke){var Ct=Ke.inputElement,ft=Ke.prefixCls,Kt=Ke.id,on=Ke.inputRef,nn=Ke.disabled,En=Ke.autoFocus,pn=Ke.autoComplete,Zt=Ke.activeDescendantId,wn=Ke.mode,kn=Ke.open,er=Ke.values,Mn=Ke.placeholder,dr=Ke.tabIndex,Lr=Ke.showSearch,pr=Ke.searchValue,wr=Ke.activeValue,ir=Ke.maxLength,yr=Ke.onInputKeyDown,Ir=Ke.onInputMouseDown,$r=Ke.onInputChange,mr=Ke.onInputPaste,Wr=Ke.onInputCompositionStart,li=Ke.onInputCompositionEnd,Ii=Ke.title,Ci=De.useState(!1),di=(0,Me.Z)(Ci,2),ki=di[0],Li=di[1],Gr=wn==="combobox",fi=Gr||Lr,Ar=er[0],Ur=pr||"";Gr&&wr&&!ki&&(Ur=wr),De.useEffect(function(){Gr&&Li(!1)},[Gr,wr]);var ri=wn!=="combobox"&&!kn&&!Lr?!1:!!Ur,Mi=Ii===void 0?Tn(Ar):Ii,Ba=function(){if(Ar)return null;var Sa=ri?{visibility:"hidden"}:void 0;return De.createElement("span",{className:"".concat(ft,"-selection-placeholder"),style:Sa},Mn)};return De.createElement(De.Fragment,null,De.createElement("span",{className:"".concat(ft,"-selection-search")},De.createElement(La,{ref:on,prefixCls:ft,id:Kt,open:kn,inputElement:Ct,disabled:nn,autoFocus:En,autoComplete:pn,editable:fi,activeDescendantId:Zt,value:Ur,onKeyDown:yr,onMouseDown:Ir,onChange:function(Sa){Li(!0),$r(Sa)},onPaste:mr,onCompositionStart:Wr,onCompositionEnd:li,tabIndex:dr,attrs:dn(Ke,!0),maxLength:Gr?ir:void 0})),!Gr&&Ar?De.createElement("span",{className:"".concat(ft,"-selection-item"),title:Mi,style:ri?{visibility:"hidden"}:void 0},Ar.label):null,Ba())},it=je;function St($e){return![Ge.ESC,Ge.SHIFT,Ge.BACKSPACE,Ge.TAB,Ge.WIN_KEY,Ge.ALT,Ge.META,Ge.WIN_KEY_RIGHT,Ge.CTRL,Ge.SEMICOLON,Ge.EQUALS,Ge.CAPS_LOCK,Ge.CONTEXT_MENU,Ge.F1,Ge.F2,Ge.F3,Ge.F4,Ge.F5,Ge.F6,Ge.F7,Ge.F8,Ge.F9,Ge.F10,Ge.F11,Ge.F12].includes($e)}var Wt=function(Ke,Ct){var ft=(0,De.useRef)(null),Kt=(0,De.useRef)(!1),on=Ke.prefixCls,nn=Ke.open,En=Ke.mode,pn=Ke.showSearch,Zt=Ke.tokenWithEnter,wn=Ke.autoClearSearchValue,kn=Ke.onSearch,er=Ke.onSearchSubmit,Mn=Ke.onToggleOpen,dr=Ke.onInputKeyDown,Lr=Ke.domRef;De.useImperativeHandle(Ct,function(){return{focus:function(){ft.current.focus()},blur:function(){ft.current.blur()}}});var pr=Je(0),wr=(0,Me.Z)(pr,2),ir=wr[0],yr=wr[1],Ir=function(Ur){var ri=Ur.which;(ri===Ge.UP||ri===Ge.DOWN)&&Ur.preventDefault(),dr&&dr(Ur),ri===Ge.ENTER&&En==="tags"&&!Kt.current&&!nn&&(er==null||er(Ur.target.value)),St(ri)&&Mn(!0)},$r=function(){yr(!0)},mr=(0,De.useRef)(null),Wr=function(Ur){kn(Ur,!0,Kt.current)!==!1&&Mn(!0)},li=function(){Kt.current=!0},Ii=function(Ur){Kt.current=!1,En!=="combobox"&&Wr(Ur.target.value)},Ci=function(Ur){var ri=Ur.target.value;if(Zt&&mr.current&&/[\r\n]/.test(mr.current)){var Mi=mr.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");ri=ri.replace(Mi,mr.current)}mr.current=null,Wr(ri)},di=function(Ur){var ri=Ur.clipboardData,Mi=ri.getData("text");mr.current=Mi},ki=function(Ur){var ri=Ur.target;if(ri!==ft.current){var Mi=document.body.style.msTouchAction!==void 0;Mi?setTimeout(function(){ft.current.focus()}):ft.current.focus()}},Li=function(Ur){var ri=ir();Ur.target!==ft.current&&!ri&&En!=="combobox"&&Ur.preventDefault(),(En!=="combobox"&&(!pn||!ri)||!nn)&&(nn&&wn!==!1&&kn("",!0,!1),Mn())},Gr={inputRef:ft,onInputKeyDown:Ir,onInputMouseDown:$r,onInputChange:Ci,onInputPaste:di,onInputCompositionStart:li,onInputCompositionEnd:Ii},fi=En==="multiple"||En==="tags"?De.createElement(Hn,(0,Fe.Z)({},Ke,Gr)):De.createElement(it,(0,Fe.Z)({},Ke,Gr));return De.createElement("div",{ref:Lr,className:"".concat(on,"-selector"),onClick:ki,onMouseDown:Li},fi)},He=De.forwardRef(Wt);He.displayName="Selector";var ht=He,Dt=ue(62709),_t=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],Nt=function(Ke){var Ct=Ke===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:Ct,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:Ct,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:Ct,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:Ct,adjustY:1},htmlRegion:"scroll"}}},Pt=function(Ke,Ct){var ft=Ke.prefixCls,Kt=Ke.disabled,on=Ke.visible,nn=Ke.children,En=Ke.popupElement,pn=Ke.animation,Zt=Ke.transitionName,wn=Ke.dropdownStyle,kn=Ke.dropdownClassName,er=Ke.direction,Mn=er===void 0?"ltr":er,dr=Ke.placement,Lr=Ke.builtinPlacements,pr=Ke.dropdownMatchSelectWidth,wr=Ke.dropdownRender,ir=Ke.dropdownAlign,yr=Ke.getPopupContainer,Ir=Ke.empty,$r=Ke.getTriggerDOMNode,mr=Ke.onPopupVisibleChange,Wr=Ke.onPopupMouseEnter,li=(0,we.Z)(Ke,_t),Ii="".concat(ft,"-dropdown"),Ci=En;wr&&(Ci=wr(En));var di=De.useMemo(function(){return Lr||Nt(pr)},[Lr,pr]),ki=pn?"".concat(Ii,"-").concat(pn):Zt,Li=typeof pr=="number",Gr=De.useMemo(function(){return Li?null:pr===!1?"minWidth":"width"},[pr,Li]),fi=wn;Li&&(fi=(0,Ce.Z)((0,Ce.Z)({},fi),{},{width:pr}));var Ar=De.useRef(null);return De.useImperativeHandle(Ct,function(){return{getPopupElement:function(){return Ar.current}}}),De.createElement(Dt.Z,(0,Fe.Z)({},li,{showAction:mr?["click"]:[],hideAction:mr?["click"]:[],popupPlacement:dr||(Mn==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:di,prefixCls:Ii,popupTransitionName:ki,popup:De.createElement("div",{ref:Ar,onMouseEnter:Wr},Ci),stretch:Gr,popupAlign:ir,popupVisible:on,getPopupContainer:yr,popupClassName:tt()(kn,(0,ye.Z)({},"".concat(Ii,"-empty"),Ir)),popupStyle:fi,getTriggerDOMNode:$r,onPopupVisibleChange:mr}),nn)},Bn=De.forwardRef(Pt);Bn.displayName="SelectTrigger";var cr=Bn,Wn=ue(84506);function Un($e,Ke){var Ct=$e.key,ft;return"value"in $e&&(ft=$e.value),Ct!=null?Ct:ft!==void 0?ft:"rc-index-key-".concat(Ke)}function qn($e,Ke){var Ct=$e||{},ft=Ct.label,Kt=Ct.value,on=Ct.options,nn=Ct.groupLabel,En=ft||(Ke?"children":"label");return{label:En,value:Kt||"value",options:on||"options",groupLabel:nn||En}}function Jn($e){var Ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ct=Ke.fieldNames,ft=Ke.childrenAsData,Kt=[],on=qn(Ct,!1),nn=on.label,En=on.value,pn=on.options,Zt=on.groupLabel;function wn(kn,er){kn.forEach(function(Mn){if(er||!(pn in Mn)){var dr=Mn[En];Kt.push({key:Un(Mn,Kt.length),groupOption:er,data:Mn,label:Mn[nn],value:dr})}else{var Lr=Mn[Zt];Lr===void 0&&ft&&(Lr=Mn.label),Kt.push({key:Un(Mn,Kt.length),group:!0,data:Mn,label:Lr}),wn(Mn[pn],!0)}})}return wn($e,!1),Kt}function Mr($e){var Ke=(0,Ce.Z)({},$e);return"props"in Ke||Object.defineProperty(Ke,"props",{get:function(){return At(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),Ke}}),Ke}function an($e,Ke){if(!Ke||!Ke.length)return null;var Ct=!1;function ft(on,nn){var En=(0,Wn.Z)(nn),pn=En[0],Zt=En.slice(1);if(!pn)return[on];var wn=on.split(pn);return Ct=Ct||wn.length>1,wn.reduce(function(kn,er){return[].concat((0,qe.Z)(kn),(0,qe.Z)(ft(er,Zt)))},[]).filter(function(kn){return kn})}var Kt=ft($e,Ke);return Ct?Kt:null}var Fn=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],ci=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function gi($e){return $e==="tags"||$e==="multiple"}var Vr=De.forwardRef(function($e,Ke){var Ct,ft,Kt=$e.id,on=$e.prefixCls,nn=$e.className,En=$e.showSearch,pn=$e.tagRender,Zt=$e.direction,wn=$e.omitDomProps,kn=$e.displayValues,er=$e.onDisplayValuesChange,Mn=$e.emptyOptions,dr=$e.notFoundContent,Lr=dr===void 0?"Not Found":dr,pr=$e.onClear,wr=$e.mode,ir=$e.disabled,yr=$e.loading,Ir=$e.getInputElement,$r=$e.getRawInputElement,mr=$e.open,Wr=$e.defaultOpen,li=$e.onDropdownVisibleChange,Ii=$e.activeValue,Ci=$e.onActiveValueChange,di=$e.activeDescendantId,ki=$e.searchValue,Li=$e.autoClearSearchValue,Gr=$e.onSearch,fi=$e.onSearchSplit,Ar=$e.tokenSeparators,Ur=$e.allowClear,ri=$e.suffixIcon,Mi=$e.clearIcon,Ba=$e.OptionList,Oa=$e.animation,Sa=$e.transitionName,Ui=$e.dropdownStyle,Ai=$e.dropdownClassName,Jr=$e.dropdownMatchSelectWidth,Ta=$e.dropdownRender,ei=$e.dropdownAlign,Pr=$e.placement,pi=$e.builtinPlacements,Zi=$e.getPopupContainer,xi=$e.showAction,Ni=xi===void 0?[]:xi,Zr=$e.onFocus,Ji=$e.onBlur,oa=$e.onKeyUp,qi=$e.onKeyDown,sa=$e.onMouseDown,ma=(0,we.Z)($e,Fn),Va=gi(wr),Yi=(En!==void 0?En:Va)||wr==="combobox",ga=(0,Ce.Z)({},ma);ci.forEach(function(Ea){delete ga[Ea]}),wn==null||wn.forEach(function(Ea){delete ga[Ea]});var Ya=De.useState(!1),ja=(0,Me.Z)(Ya,2),oo=ja[0],Ra=ja[1];De.useEffect(function(){Ra(bt())},[]);var da=De.useRef(null),ti=De.useRef(null),mi=De.useRef(null),ji=De.useRef(null),la=De.useRef(null),Fa=Xt(),ro=(0,Me.Z)(Fa,3),ho=ro[0],Bo=ro[1],Oo=ro[2];De.useImperativeHandle(Ke,function(){var Ea,Qi;return{focus:(Ea=ji.current)===null||Ea===void 0?void 0:Ea.focus,blur:(Qi=ji.current)===null||Qi===void 0?void 0:Qi.blur,scrollTo:function(es){var ea;return(ea=la.current)===null||ea===void 0?void 0:ea.scrollTo(es)}}});var so=De.useMemo(function(){var Ea;if(wr!=="combobox")return ki;var Qi=(Ea=kn[0])===null||Ea===void 0?void 0:Ea.value;return typeof Qi=="string"||typeof Qi=="number"?String(Qi):""},[ki,wr,kn]),Ao=wr==="combobox"&&typeof Ir=="function"&&Ir()||null,Pi=typeof $r=="function"&&$r(),ui=cn(ti,Pi==null||(Ct=Pi.props)===null||Ct===void 0?void 0:Ct.ref),Ca=De.useState(!1),va=(0,Me.Z)(Ca,2),lo=va[0],io=va[1];ut(function(){io(!0)},[]);var hs=Et(!1,{defaultValue:Wr,value:mr}),Qo=(0,Me.Z)(hs,2),ps=Qo[0],$i=Qo[1],fr=lo?ps:!1,Xr=!Lr&&Mn;(ir||Xr&&fr&&wr==="combobox")&&(fr=!1);var qr=Xr?!1:fr,ii=De.useCallback(function(Ea){var Qi=Ea!==void 0?Ea:!fr;ir||($i(Qi),fr!==Qi&&(li==null||li(Qi)))},[ir,fr,$i,li]),$a=De.useMemo(function(){return(Ar||[]).some(function(Ea){return[`
`,`\r
`].includes(Ea)})},[Ar]),Ua=function(Qi,Ho,es){var ea=!0,Na=Qi;Ci==null||Ci(null);var Ia=es?null:an(Qi,Ar);return wr!=="combobox"&&Ia&&(Na="",fi==null||fi(Ia),ii(!1),ea=!1),Gr&&so!==Na&&Gr(Na,{source:Ho?"typing":"effect"}),ea},$o=function(Qi){!Qi||!Qi.trim()||Gr(Qi,{source:"submit"})};De.useEffect(function(){!fr&&!Va&&wr!=="combobox"&&Ua("",!1,!1)},[fr]),De.useEffect(function(){ps&&ir&&$i(!1),ir&&Bo(!1)},[ir]);var Vo=Je(),ls=(0,Me.Z)(Vo,2),ta=ls[0],Ro=ls[1],us=function(Qi){var Ho=ta(),es=Qi.which;if(es===Ge.ENTER&&(wr!=="combobox"&&Qi.preventDefault(),fr||ii(!0)),Ro(!!so),es===Ge.BACKSPACE&&!Ho&&Va&&!so&&kn.length){for(var ea=(0,qe.Z)(kn),Na=null,Ia=ea.length-1;Ia>=0;Ia-=1){var po=ea[Ia];if(!po.disabled){ea.splice(Ia,1),Na=po;break}}Na&&er(ea,{type:"remove",values:[Na]})}for(var is=arguments.length,Hs=new Array(is>1?is-1:0),gs=1;gs<is;gs++)Hs[gs-1]=arguments[gs];if(fr&&la.current){var Jl;(Jl=la.current).onKeyDown.apply(Jl,[Qi].concat(Hs))}qi==null||qi.apply(void 0,[Qi].concat(Hs))},cl=function(Qi){for(var Ho=arguments.length,es=new Array(Ho>1?Ho-1:0),ea=1;ea<Ho;ea++)es[ea-1]=arguments[ea];if(fr&&la.current){var Na;(Na=la.current).onKeyUp.apply(Na,[Qi].concat(es))}oa==null||oa.apply(void 0,[Qi].concat(es))},As=function(Qi){var Ho=kn.filter(function(es){return es!==Qi});er(Ho,{type:"remove",values:[Qi]})},ms=De.useRef(!1),zo=function(){Bo(!0),ir||(Zr&&!ms.current&&Zr.apply(void 0,arguments),Ni.includes("focus")&&ii(!0)),ms.current=!0},Ts=function(){Bo(!1,function(){ms.current=!1,ii(!1)}),!ir&&(so&&(wr==="tags"?Gr(so,{source:"submit"}):wr==="multiple"&&Gr("",{source:"blur"})),Ji&&Ji.apply(void 0,arguments))},Ds=[];De.useEffect(function(){return function(){Ds.forEach(function(Ea){return clearTimeout(Ea)}),Ds.splice(0,Ds.length)}},[]);var Ys=function(Qi){var Ho,es=Qi.target,ea=(Ho=mi.current)===null||Ho===void 0?void 0:Ho.getPopupElement();if(ea&&ea.contains(es)){var Na=setTimeout(function(){var Hs=Ds.indexOf(Na);if(Hs!==-1&&Ds.splice(Hs,1),Oo(),!oo&&!ea.contains(document.activeElement)){var gs;(gs=ji.current)===null||gs===void 0||gs.focus()}});Ds.push(Na)}for(var Ia=arguments.length,po=new Array(Ia>1?Ia-1:0),is=1;is<Ia;is++)po[is-1]=arguments[is];sa==null||sa.apply(void 0,[Qi].concat(po))},ao=De.useState({}),Ma=(0,Me.Z)(ao,2),Ga=Ma[1];function go(){Ga({})}var yo;Pi&&(yo=function(Qi){ii(Qi)}),rt(function(){var Ea;return[da.current,(Ea=mi.current)===null||Ea===void 0?void 0:Ea.getPopupElement()]},qr,ii,!!Pi);var Ko=De.useMemo(function(){return(0,Ce.Z)((0,Ce.Z)({},$e),{},{notFoundContent:Lr,open:fr,triggerOpen:qr,id:Kt,showSearch:Yi,multiple:Va,toggleOpen:ii})},[$e,Lr,qr,fr,Kt,Yi,Va,ii]),wo=!!ri||yr,xs;wo&&(xs=De.createElement(Ye,{className:tt()("".concat(on,"-arrow"),(0,ye.Z)({},"".concat(on,"-arrow-loading"),yr)),customizeIcon:ri,customizeIconProps:{loading:yr,searchValue:so,open:fr,focused:ho,showSearch:Yi}}));var Xl=function(){var Qi;pr==null||pr(),(Qi=ji.current)===null||Qi===void 0||Qi.focus(),er([],{type:"clear",values:kn}),Ua("",!1,!1)},ql=Ee(on,Xl,kn,Ur,Mi,ir,so,wr),vu=ql.allowClear,Xu=ql.clearIcon,Ks=De.createElement(Ba,{ref:la}),Is=tt()(on,nn,(ft={},(0,ye.Z)(ft,"".concat(on,"-focused"),ho),(0,ye.Z)(ft,"".concat(on,"-multiple"),Va),(0,ye.Z)(ft,"".concat(on,"-single"),!Va),(0,ye.Z)(ft,"".concat(on,"-allow-clear"),Ur),(0,ye.Z)(ft,"".concat(on,"-show-arrow"),wo),(0,ye.Z)(ft,"".concat(on,"-disabled"),ir),(0,ye.Z)(ft,"".concat(on,"-loading"),yr),(0,ye.Z)(ft,"".concat(on,"-open"),fr),(0,ye.Z)(ft,"".concat(on,"-customize-input"),Ao),(0,ye.Z)(ft,"".concat(on,"-show-search"),Yi),ft)),yu=De.createElement(cr,{ref:mi,disabled:ir,prefixCls:on,visible:qr,popupElement:Ks,animation:Oa,transitionName:Sa,dropdownStyle:Ui,dropdownClassName:Ai,direction:Zt,dropdownMatchSelectWidth:Jr,dropdownRender:Ta,dropdownAlign:ei,placement:Pr,builtinPlacements:pi,getPopupContainer:Zi,empty:Mn,getTriggerDOMNode:function(){return ti.current},onPopupVisibleChange:yo,onPopupMouseEnter:go},Pi?De.cloneElement(Pi,{ref:ui}):De.createElement(ht,(0,Fe.Z)({},$e,{domRef:ti,prefixCls:on,inputElement:Ao,ref:ji,id:Kt,showSearch:Yi,autoClearSearchValue:Li,mode:wr,activeDescendantId:di,tagRender:pn,values:kn,open:fr,onToggleOpen:ii,activeValue:Ii,searchValue:so,onSearch:Ua,onSearchSubmit:$o,onRemove:As,tokenWithEnter:$a}))),Yl;return Pi?Yl=yu:Yl=De.createElement("div",(0,Fe.Z)({className:Is},ga,{ref:da,onMouseDown:Ys,onKeyDown:us,onKeyUp:cl,onFocus:zo,onBlur:Ts}),ho&&!fr&&De.createElement("span",{style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0},"aria-live":"polite"},"".concat(kn.map(function(Ea){var Qi=Ea.label,Ho=Ea.value;return["number","string"].includes((0,he.Z)(Qi))?Qi:Ho}).join(", "))),yu,xs,vu&&Xu),De.createElement(Tt.Provider,{value:Ko},Yl)}),Dr=Vr,wi=function($e,Ke){var Ct=De.useRef({values:new Map,options:new Map}),ft=De.useMemo(function(){var on=Ct.current,nn=on.values,En=on.options,pn=$e.map(function(kn){if(kn.label===void 0){var er;return(0,Ce.Z)((0,Ce.Z)({},kn),{},{label:(er=nn.get(kn.value))===null||er===void 0?void 0:er.label})}return kn}),Zt=new Map,wn=new Map;return pn.forEach(function(kn){Zt.set(kn.value,kn),wn.set(kn.value,Ke.get(kn.value)||En.get(kn.value))}),Ct.current.values=Zt,Ct.current.options=wn,pn},[$e,Ke]),Kt=De.useCallback(function(on){return Ke.get(on)||Ct.current.options.get(on)},[Ke]);return[ft,Kt]};function or($e,Ke){return fo($e).join("").toUpperCase().includes(Ke)}var oi=function($e,Ke,Ct,ft,Kt){return De.useMemo(function(){if(!Ct||ft===!1)return $e;var on=Ke.options,nn=Ke.label,En=Ke.value,pn=[],Zt=typeof ft=="function",wn=Ct.toUpperCase(),kn=Zt?ft:function(Mn,dr){return Kt?or(dr[Kt],wn):dr[on]?or(dr[nn!=="children"?nn:"label"],wn):or(dr[En],wn)},er=Zt?function(Mn){return Mr(Mn)}:function(Mn){return Mn};return $e.forEach(function(Mn){if(Mn[on]){var dr=kn(Ct,er(Mn));if(dr)pn.push(Mn);else{var Lr=Mn[on].filter(function(pr){return kn(Ct,er(pr))});Lr.length&&pn.push((0,Ce.Z)((0,Ce.Z)({},Mn),{},(0,ye.Z)({},on,Lr)))}return}kn(Ct,er(Mn))&&pn.push(Mn)}),pn},[$e,ft,Kt,Ct,Ke])},hn=0,Vi=Ne();function Si(){var $e;return Vi?($e=hn,hn+=1):$e="TEST_OR_SSR",$e}function pa($e){var Ke=De.useState(),Ct=(0,Me.Z)(Ke,2),ft=Ct[0],Kt=Ct[1];return De.useEffect(function(){Kt("rc_select_".concat(Si()))},[]),$e||ft}function Wi($e){var Ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ct=[];return De.Children.forEach($e,function(ft){ft==null&&!Ke.keepEmpty||(Array.isArray(ft)?Ct=Ct.concat(Wi(ft)):(0,Ot.isFragment)(ft)&&ft.props?Ct=Ct.concat(Wi(ft.props.children,Ke)):Ct.push(ft))}),Ct}var _i=["children","value"],ia=["children"];function Ki($e){var Ke=$e,Ct=Ke.key,ft=Ke.props,Kt=ft.children,on=ft.value,nn=(0,we.Z)(ft,_i);return(0,Ce.Z)({key:Ct,value:on!==void 0?on:Ct,children:Kt},nn)}function yi($e){var Ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Wi($e).map(function(Ct,ft){if(!De.isValidElement(Ct)||!Ct.type)return null;var Kt=Ct,on=Kt.type.isSelectOptGroup,nn=Kt.key,En=Kt.props,pn=En.children,Zt=(0,we.Z)(En,ia);return Ke||!on?Ki(Ct):(0,Ce.Z)((0,Ce.Z)({key:"__RC_SELECT_GRP__".concat(nn===null?ft:nn,"__"),label:nn},Zt),{},{options:yi(pn)})}).filter(function(Ct){return Ct})}function Gi($e,Ke,Ct,ft,Kt){return De.useMemo(function(){var on=$e,nn=!$e;nn&&(on=yi(Ke));var En=new Map,pn=new Map,Zt=function(er,Mn,dr){dr&&typeof dr=="string"&&er.set(Mn[dr],Mn)};function wn(kn){for(var er=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Mn=0;Mn<kn.length;Mn+=1){var dr=kn[Mn];!dr[Ct.options]||er?(En.set(dr[Ct.value],dr),Zt(pn,dr,Ct.label),Zt(pn,dr,ft),Zt(pn,dr,Kt)):wn(dr[Ct.options],!0)}}return wn(on),{options:on,valueOptions:En,labelOptions:pn}},[$e,Ke,Ct,ft,Kt])}function xa($e){var Ke=De.useRef();Ke.current=$e;var Ct=De.useCallback(function(){return Ke.current.apply(Ke,arguments)},[]);return Ct}var Xi=function(){return null};Xi.isSelectOptGroup=!0;var Ti=Xi,wa=function(){return null};wa.isSelectOption=!0;var Aa=wa;function aa($e,Ke){var Ct=(0,Ce.Z)({},$e);return Array.isArray(Ke)&&Ke.forEach(function(ft){delete Ct[ft]}),Ct}var ni=ue(73299),pt=De.createContext(null),dt=pt;function It(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var Qt=["disabled","title","children","style","className"];function Cn($e){return typeof $e=="string"||typeof $e=="number"}var vr=function(Ke,Ct){var ft=gn(),Kt=ft.prefixCls,on=ft.id,nn=ft.open,En=ft.multiple,pn=ft.mode,Zt=ft.searchValue,wn=ft.toggleOpen,kn=ft.notFoundContent,er=ft.onPopupScroll,Mn=De.useContext(dt),dr=Mn.flattenOptions,Lr=Mn.onActiveValue,pr=Mn.defaultActiveFirstOption,wr=Mn.onSelect,ir=Mn.menuItemSelectedIcon,yr=Mn.rawValues,Ir=Mn.fieldNames,$r=Mn.virtual,mr=Mn.direction,Wr=Mn.listHeight,li=Mn.listItemHeight,Ii="".concat(Kt,"-item"),Ci=kt(function(){return dr},[nn,dr],function(ei,Pr){return Pr[0]&&ei[1]!==Pr[1]}),di=De.useRef(null),ki=function(Pr){Pr.preventDefault()},Li=function(Pr){di.current&&di.current.scrollTo(typeof Pr=="number"?{index:Pr}:Pr)},Gr=function(Pr){for(var pi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Zi=Ci.length,xi=0;xi<Zi;xi+=1){var Ni=(Pr+xi*pi+Zi)%Zi,Zr=Ci[Ni],Ji=Zr.group,oa=Zr.data;if(!Ji&&!oa.disabled)return Ni}return-1},fi=De.useState(function(){return Gr(0)}),Ar=(0,Me.Z)(fi,2),Ur=Ar[0],ri=Ar[1],Mi=function(Pr){var pi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;ri(Pr);var Zi={source:pi?"keyboard":"mouse"},xi=Ci[Pr];if(!xi){Lr(null,-1,Zi);return}Lr(xi.value,Pr,Zi)};(0,De.useEffect)(function(){Mi(pr!==!1?Gr(0):-1)},[Ci.length,Zt]);var Ba=De.useCallback(function(ei){return yr.has(ei)&&pn!=="combobox"},[pn,(0,qe.Z)(yr).toString(),yr.size]);(0,De.useEffect)(function(){var ei=setTimeout(function(){if(!En&&nn&&yr.size===1){var pi=Array.from(yr)[0],Zi=Ci.findIndex(function(xi){var Ni=xi.data;return Ni.value===pi});Zi!==-1&&(Mi(Zi),Li(Zi))}});if(nn){var Pr;(Pr=di.current)===null||Pr===void 0||Pr.scrollTo(void 0)}return function(){return clearTimeout(ei)}},[nn,Zt,dr.length]);var Oa=function(Pr){Pr!==void 0&&wr(Pr,{selected:!yr.has(Pr)}),En||wn(!1)};if(De.useImperativeHandle(Ct,function(){return{onKeyDown:function(Pr){var pi=Pr.which,Zi=Pr.ctrlKey;switch(pi){case Ge.N:case Ge.P:case Ge.UP:case Ge.DOWN:{var xi=0;if(pi===Ge.UP?xi=-1:pi===Ge.DOWN?xi=1:It()&&Zi&&(pi===Ge.N?xi=1:pi===Ge.P&&(xi=-1)),xi!==0){var Ni=Gr(Ur+xi,xi);Li(Ni),Mi(Ni,!0)}break}case Ge.ENTER:{var Zr=Ci[Ur];Zr&&!Zr.data.disabled?Oa(Zr.value):Oa(void 0),nn&&Pr.preventDefault();break}case Ge.ESC:wn(!1),nn&&Pr.stopPropagation()}},onKeyUp:function(){},scrollTo:function(Pr){Li(Pr)}}}),Ci.length===0)return De.createElement("div",{role:"listbox",id:"".concat(on,"_list"),className:"".concat(Ii,"-empty"),onMouseDown:ki},kn);var Sa=Object.keys(Ir).map(function(ei){return Ir[ei]}),Ui=function(Pr){return Pr.label};function Ai(ei,Pr){var pi=ei.group;return{role:pi?"presentation":"option",id:"".concat(on,"_list_").concat(Pr)}}var Jr=function(Pr){var pi=Ci[Pr];if(!pi)return null;var Zi=pi.data||{},xi=Zi.value,Ni=pi.group,Zr=dn(Zi,!0),Ji=Ui(pi);return pi?De.createElement("div",(0,Fe.Z)({"aria-label":typeof Ji=="string"&&!Ni?Ji:null},Zr,{key:Pr},Ai(pi,Pr),{"aria-selected":Ba(xi)}),xi):null},Ta={role:"listbox",id:"".concat(on,"_list")};return De.createElement(De.Fragment,null,$r&&De.createElement("div",(0,Fe.Z)({},Ta,{style:{height:0,width:0,overflow:"hidden"}}),Jr(Ur-1),Jr(Ur),Jr(Ur+1)),De.createElement(ni.Z,{itemKey:"key",ref:di,data:Ci,height:Wr,itemHeight:li,fullHeight:!1,onMouseDown:ki,onScroll:er,virtual:$r,direction:mr,innerProps:$r?null:Ta},function(ei,Pr){var pi,Zi=ei.group,xi=ei.groupOption,Ni=ei.data,Zr=ei.label,Ji=ei.value,oa=Ni.key;if(Zi){var qi,sa=(qi=Ni.title)!==null&&qi!==void 0?qi:Cn(Zr)?Zr.toString():void 0;return De.createElement("div",{className:tt()(Ii,"".concat(Ii,"-group")),title:sa},Zr!==void 0?Zr:oa)}var ma=Ni.disabled,Va=Ni.title,Yi=Ni.children,ga=Ni.style,Ya=Ni.className,ja=(0,we.Z)(Ni,Qt),oo=aa(ja,Sa),Ra=Ba(Ji),da="".concat(Ii,"-option"),ti=tt()(Ii,da,Ya,(pi={},(0,ye.Z)(pi,"".concat(da,"-grouped"),xi),(0,ye.Z)(pi,"".concat(da,"-active"),Ur===Pr&&!ma),(0,ye.Z)(pi,"".concat(da,"-disabled"),ma),(0,ye.Z)(pi,"".concat(da,"-selected"),Ra),pi)),mi=Ui(ei),ji=!ir||typeof ir=="function"||Ra,la=typeof mi=="number"?mi:mi||Ji,Fa=Cn(la)?la.toString():void 0;return Va!==void 0&&(Fa=Va),De.createElement("div",(0,Fe.Z)({},dn(oo),$r?{}:Ai(ei,Pr),{"aria-selected":Ra,className:ti,title:Fa,onMouseMove:function(){Ur===Pr||ma||Mi(Pr)},onClick:function(){ma||Oa(Ji)},style:ga}),De.createElement("div",{className:"".concat(da,"-content")},la),De.isValidElement(ir)||Ra,ji&&De.createElement(Ye,{className:"".concat(Ii,"-option-state"),customizeIcon:ir,customizeIconProps:{isSelected:Ra}},Ra?"\u2713":null))}))},gr=De.forwardRef(vr);gr.displayName="OptionList";var Er=gr;function Br($e){var Ke=$e.mode,Ct=$e.options,ft=$e.children,Kt=$e.backfill,on=$e.allowClear,nn=$e.placeholder,En=$e.getInputElement,pn=$e.showSearch,Zt=$e.onSearch,wn=$e.defaultOpen,kn=$e.autoFocus,er=$e.labelInValue,Mn=$e.value,dr=$e.inputValue,Lr=$e.optionLabelProp,pr=isMultiple(Ke),wr=pn!==void 0?pn:pr||Ke==="combobox",ir=Ct||convertChildrenToData(ft);if(warning(Ke!=="tags"||ir.every(function(mr){return!mr.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Ke==="tags"||Ke==="combobox"){var yr=ir.some(function(mr){return mr.options?mr.options.some(function(Wr){return typeof("value"in Wr?Wr.value:Wr.key)=="number"}):typeof("value"in mr?mr.value:mr.key)=="number"});warning(!yr,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(Ke!=="combobox"||!Lr,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(Ke==="combobox"||!Kt,"`backfill` only works with `combobox` mode."),warning(Ke==="combobox"||!En,"`getInputElement` only work with `combobox` mode."),noteOnce(Ke!=="combobox"||!En||!on||!nn,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Zt&&!wr&&Ke!=="combobox"&&Ke!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!wn||kn,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Mn!=null){var Ir=toArray(Mn);warning(!er||Ir.every(function(mr){return _typeof(mr)==="object"&&("key"in mr||"value"in mr)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!pr||Array.isArray(Mn),"`value` should be array when `mode` is `multiple` or `tags`")}if(ft){var $r=null;toNodeArray(ft).some(function(mr){if(!React.isValidElement(mr)||!mr.type)return!1;var Wr=mr,li=Wr.type;if(li.isSelectOption)return!1;if(li.isSelectOptGroup){var Ii=toNodeArray(mr.props.children).every(function(Ci){return!React.isValidElement(Ci)||!mr.type||Ci.type.isSelectOption?!0:($r=Ci.type,!1)});return!Ii}return $r=li,!0}),$r&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat($r.displayName||$r.name||$r,"`.")),warning(dr===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function kr($e,Ke){if($e){var Ct=function ft(Kt){for(var on=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,nn=0;nn<Kt.length;nn++){var En=Kt[nn];if(En[Ke==null?void 0:Ke.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!on&&Array.isArray(En[Ke==null?void 0:Ke.options])&&ft(En[Ke==null?void 0:Ke.options],!0))break}};Ct($e)}}var Yr=null,si=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","value","defaultValue","labelInValue","onChange"],bi=["inputValue"];function Hi($e){return!$e||(0,he.Z)($e)!=="object"}var Ri=De.forwardRef(function($e,Ke){var Ct=$e.id,ft=$e.mode,Kt=$e.prefixCls,on=Kt===void 0?"rc-select":Kt,nn=$e.backfill,En=$e.fieldNames,pn=$e.inputValue,Zt=$e.searchValue,wn=$e.onSearch,kn=$e.autoClearSearchValue,er=kn===void 0?!0:kn,Mn=$e.onSelect,dr=$e.onDeselect,Lr=$e.dropdownMatchSelectWidth,pr=Lr===void 0?!0:Lr,wr=$e.filterOption,ir=$e.filterSort,yr=$e.optionFilterProp,Ir=$e.optionLabelProp,$r=$e.options,mr=$e.children,Wr=$e.defaultActiveFirstOption,li=$e.menuItemSelectedIcon,Ii=$e.virtual,Ci=$e.direction,di=$e.listHeight,ki=di===void 0?200:di,Li=$e.listItemHeight,Gr=Li===void 0?20:Li,fi=$e.value,Ar=$e.defaultValue,Ur=$e.labelInValue,ri=$e.onChange,Mi=(0,we.Z)($e,si),Ba=pa(Ct),Oa=gi(ft),Sa=!!(!$r&&mr),Ui=De.useMemo(function(){return wr===void 0&&ft==="combobox"?!1:wr},[wr,ft]),Ai=De.useMemo(function(){return qn(En,Sa)},[JSON.stringify(En),Sa]),Jr=Et("",{value:Zt!==void 0?Zt:pn,postState:function(Xr){return Xr||""}}),Ta=(0,Me.Z)(Jr,2),ei=Ta[0],Pr=Ta[1],pi=Gi($r,mr,Ai,yr,Ir),Zi=pi.valueOptions,xi=pi.labelOptions,Ni=pi.options,Zr=De.useCallback(function(fr){var Xr=fo(fr);return Xr.map(function(qr){var ii,$a,Ua,$o,Vo;if(Hi(qr))ii=qr;else{var ls;Ua=qr.key,$a=qr.label,ii=(ls=qr.value)!==null&&ls!==void 0?ls:Ua}var ta=Zi.get(ii);if(ta){var Ro;if($a===void 0&&($a=ta==null?void 0:ta[Ir||Ai.label]),Ua===void 0&&(Ua=(Ro=ta==null?void 0:ta.key)!==null&&Ro!==void 0?Ro:ii),$o=ta==null?void 0:ta.disabled,Vo=ta==null?void 0:ta.title,0)var us}return{label:$a,value:ii,key:Ua,disabled:$o,title:Vo}})},[Ai,Ir,Zi]),Ji=Et(Ar,{value:fi}),oa=(0,Me.Z)(Ji,2),qi=oa[0],sa=oa[1],ma=De.useMemo(function(){var fr,Xr=Zr(qi);return ft==="combobox"&&wt((fr=Xr[0])===null||fr===void 0?void 0:fr.value)?[]:Xr},[qi,Zr,ft]),Va=wi(ma,Zi),Yi=(0,Me.Z)(Va,2),ga=Yi[0],Ya=Yi[1],ja=De.useMemo(function(){if(!ft&&ga.length===1){var fr=ga[0];if(fr.value===null&&(fr.label===null||fr.label===void 0))return[]}return ga.map(function(Xr){var qr;return(0,Ce.Z)((0,Ce.Z)({},Xr),{},{label:(qr=Xr.label)!==null&&qr!==void 0?qr:Xr.value})})},[ft,ga]),oo=De.useMemo(function(){return new Set(ga.map(function(fr){return fr.value}))},[ga]);De.useEffect(function(){if(ft==="combobox"){var fr,Xr=(fr=ga[0])===null||fr===void 0?void 0:fr.value;Pr(ha(Xr)?String(Xr):"")}},[ga]);var Ra=xa(function(fr,Xr){var qr,ii=Xr!=null?Xr:fr;return qr={},(0,ye.Z)(qr,Ai.value,fr),(0,ye.Z)(qr,Ai.label,ii),qr}),da=De.useMemo(function(){if(ft!=="tags")return Ni;var fr=(0,qe.Z)(Ni),Xr=function(ii){return Zi.has(ii)};return(0,qe.Z)(ga).sort(function(qr,ii){return qr.value<ii.value?-1:1}).forEach(function(qr){var ii=qr.value;Xr(ii)||fr.push(Ra(ii,qr.label))}),fr},[Ra,Ni,Zi,ga,ft]),ti=oi(da,Ai,ei,Ui,yr),mi=De.useMemo(function(){return ft!=="tags"||!ei||ti.some(function(fr){return fr[yr||"value"]===ei})||ti.some(function(fr){return fr[Ai.value]===ei})?ti:[Ra(ei)].concat((0,qe.Z)(ti))},[Ra,yr,ft,ti,ei,Ai]),ji=De.useMemo(function(){return ir?(0,qe.Z)(mi).sort(function(fr,Xr){return ir(fr,Xr)}):mi},[mi,ir]),la=De.useMemo(function(){return Jn(ji,{fieldNames:Ai,childrenAsData:Sa})},[ji,Ai,Sa]),Fa=function(Xr){var qr=Zr(Xr);if(sa(qr),ri&&(qr.length!==ga.length||qr.some(function(Ua,$o){var Vo;return((Vo=ga[$o])===null||Vo===void 0?void 0:Vo.value)!==(Ua==null?void 0:Ua.value)}))){var ii=Ur?qr:qr.map(function(Ua){return Ua.value}),$a=qr.map(function(Ua){return Mr(Ya(Ua.value))});ri(Oa?ii:ii[0],Oa?$a:$a[0])}},ro=De.useState(null),ho=(0,Me.Z)(ro,2),Bo=ho[0],Oo=ho[1],so=De.useState(0),Ao=(0,Me.Z)(so,2),Pi=Ao[0],ui=Ao[1],Ca=Wr!==void 0?Wr:ft!=="combobox",va=De.useCallback(function(fr,Xr){var qr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},ii=qr.source,$a=ii===void 0?"keyboard":ii;ui(Xr),nn&&ft==="combobox"&&fr!==null&&$a==="keyboard"&&Oo(String(fr))},[nn,ft]),lo=function(Xr,qr,ii){var $a=function(){var ms,zo=Ya(Xr);return[Ur?{label:zo==null?void 0:zo[Ai.label],value:Xr,key:(ms=zo==null?void 0:zo.key)!==null&&ms!==void 0?ms:Xr}:Xr,Mr(zo)]};if(qr&&Mn){var Ua=$a(),$o=(0,Me.Z)(Ua,2),Vo=$o[0],ls=$o[1];Mn(Vo,ls)}else if(!qr&&dr&&ii!=="clear"){var ta=$a(),Ro=(0,Me.Z)(ta,2),us=Ro[0],cl=Ro[1];dr(us,cl)}},io=xa(function(fr,Xr){var qr,ii=Oa?Xr.selected:!0;ii?qr=Oa?[].concat((0,qe.Z)(ga),[fr]):[fr]:qr=ga.filter(function($a){return $a.value!==fr}),Fa(qr),lo(fr,ii),ft==="combobox"?Oo(""):(!gi||er)&&(Pr(""),Oo(""))}),hs=function(Xr,qr){Fa(Xr);var ii=qr.type,$a=qr.values;(ii==="remove"||ii==="clear")&&$a.forEach(function(Ua){lo(Ua.value,!1,ii)})},Qo=function(Xr,qr){if(Pr(Xr),Oo(null),qr.source==="submit"){var ii=(Xr||"").trim();if(ii){var $a=Array.from(new Set([].concat((0,qe.Z)(oo),[ii])));Fa($a),lo(ii,!0),Pr("")}return}qr.source!=="blur"&&(ft==="combobox"&&Fa(Xr),wn==null||wn(Xr))},ps=function(Xr){var qr=Xr;ft!=="tags"&&(qr=Xr.map(function($a){var Ua=xi.get($a);return Ua==null?void 0:Ua.value}).filter(function($a){return $a!==void 0}));var ii=Array.from(new Set([].concat((0,qe.Z)(oo),(0,qe.Z)(qr))));Fa(ii),ii.forEach(function($a){lo($a,!0)})},$i=De.useMemo(function(){var fr=Ii!==!1&&pr!==!1;return(0,Ce.Z)((0,Ce.Z)({},pi),{},{flattenOptions:la,onActiveValue:va,defaultActiveFirstOption:Ca,onSelect:io,menuItemSelectedIcon:li,rawValues:oo,fieldNames:Ai,virtual:fr,direction:Ci,listHeight:ki,listItemHeight:Gr,childrenAsData:Sa})},[pi,la,va,Ca,io,li,oo,Ai,Ii,pr,ki,Gr,Sa]);return De.createElement(dt.Provider,{value:$i},De.createElement(Dr,(0,Fe.Z)({},Mi,{id:Ba,prefixCls:on,ref:Ke,omitDomProps:bi,mode:ft,displayValues:ja,onDisplayValuesChange:hs,direction:Ci,searchValue:ei,onSearch:Qo,autoClearSearchValue:er,onSearchSplit:ps,dropdownMatchSelectWidth:pr,OptionList:Er,emptyOptions:!la.length,activeValue:Bo,activeDescendantId:"".concat(Ba,"_list_").concat(Pi)})))}),Di=Ri;Di.Option=Aa,Di.OptGroup=Ti;var Le=Di,Re=Le,Oe=ue(10366),We=ue(8745),nt=ue(33603),st=ue(9708),mt=ue(53124),zt=ue(98866),jt=ue(88258),Nn=ue(98675),Qn=ue(65223),Dn=ue(4173),tn=ue(87244),Yt=ue(13458),fn=ue(78642),xn=ue(46163),Yn=function($e,Ke){var Ct={};for(var ft in $e)Object.prototype.hasOwnProperty.call($e,ft)&&Ke.indexOf(ft)<0&&(Ct[ft]=$e[ft]);if($e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Kt=0,ft=Object.getOwnPropertySymbols($e);Kt<ft.length;Kt++)Ke.indexOf(ft[Kt])<0&&Object.prototype.propertyIsEnumerable.call($e,ft[Kt])&&(Ct[ft[Kt]]=$e[ft[Kt]]);return Ct};const $n="SECRET_COMBOBOX_MODE_DO_NOT_USE",On=($e,Ke)=>{var Ct,{prefixCls:ft,bordered:Kt=!0,className:on,rootClassName:nn,getPopupContainer:En,popupClassName:pn,dropdownClassName:Zt,listHeight:wn=256,placement:kn,listItemHeight:er=24,size:Mn,disabled:dr,notFoundContent:Lr,status:pr,builtinPlacements:wr,dropdownMatchSelectWidth:ir,popupMatchSelectWidth:yr,direction:Ir,style:$r,allowClear:mr}=$e,Wr=Yn($e,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:li,getPrefixCls:Ii,renderEmpty:Ci,direction:di,virtual:ki,popupMatchSelectWidth:Li,popupOverflow:Gr,select:fi}=De.useContext(mt.E_),Ar=Ii("select",ft),Ur=Ii(),ri=Ir!=null?Ir:di,{compactSize:Mi,compactItemClassnames:Ba}=(0,Dn.ri)(Ar,ri),[Oa,Sa]=(0,tn.Z)(Ar),Ui=De.useMemo(()=>{const{mode:da}=Wr;if(da!=="combobox")return da===$n?"combobox":da},[Wr.mode]),Ai=Ui==="multiple"||Ui==="tags",Jr=(0,fn.Z)(Wr.suffixIcon,Wr.showArrow),Ta=(Ct=yr!=null?yr:ir)!==null&&Ct!==void 0?Ct:Li,{status:ei,hasFeedback:Pr,isFormItemInput:pi,feedbackIcon:Zi}=De.useContext(Qn.aM),xi=(0,st.F)(ei,pr);let Ni;Lr!==void 0?Ni=Lr:Ui==="combobox"?Ni=null:Ni=(Ci==null?void 0:Ci("Select"))||De.createElement(jt.Z,{componentName:"Select"});const{suffixIcon:Zr,itemIcon:Ji,removeIcon:oa,clearIcon:qi}=(0,xn.Z)(Object.assign(Object.assign({},Wr),{multiple:Ai,hasFeedback:Pr,feedbackIcon:Zi,showSuffixIcon:Jr,prefixCls:Ar,showArrow:Wr.showArrow,componentName:"Select"})),sa=mr===!0?{clearIcon:qi}:mr,ma=(0,Oe.Z)(Wr,["suffixIcon","itemIcon"]),Va=tt()(pn||Zt,{[`${Ar}-dropdown-${ri}`]:ri==="rtl"},nn,Sa),Yi=(0,Nn.Z)(da=>{var ti;return(ti=Mn!=null?Mn:Mi)!==null&&ti!==void 0?ti:da}),ga=De.useContext(zt.Z),Ya=dr!=null?dr:ga,ja=tt()({[`${Ar}-lg`]:Yi==="large",[`${Ar}-sm`]:Yi==="small",[`${Ar}-rtl`]:ri==="rtl",[`${Ar}-borderless`]:!Kt,[`${Ar}-in-form-item`]:pi},(0,st.Z)(Ar,xi,Pr),Ba,fi==null?void 0:fi.className,on,nn,Sa),oo=De.useMemo(()=>kn!==void 0?kn:ri==="rtl"?"bottomRight":"bottomLeft",[kn,ri]),Ra=(0,Yt.Z)(wr,Gr);return Oa(De.createElement(Re,Object.assign({ref:Ke,virtual:ki,showSearch:fi==null?void 0:fi.showSearch},ma,{style:Object.assign(Object.assign({},fi==null?void 0:fi.style),$r),dropdownMatchSelectWidth:Ta,builtinPlacements:Ra,transitionName:(0,nt.m)(Ur,"slide-up",Wr.transitionName),listHeight:wn,listItemHeight:er,mode:Ui,prefixCls:Ar,placement:oo,direction:ri,suffixIcon:Zr,menuItemSelectedIcon:Ji,removeIcon:oa,allowClear:sa,notFoundContent:Ni,className:ja,getPopupContainer:En||li,dropdownClassName:Va,disabled:Ya})))},Kn=De.forwardRef(On),zn=(0,We.Z)(Kn);Kn.SECRET_COMBOBOX_MODE_DO_NOT_USE=$n,Kn.Option=Aa,Kn.OptGroup=Ti,Kn._InternalPanelDoNotUseOrYouWillBeFired=zn;var tr=Kn},87244:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return Ie}});var be=ue(14747),tt=ue(80110),Fe=ue(45503),qe=ue(67968),ye=ue(67771),Ce=ue(33297);const Me=_e=>{const{optionHeight:Ue,optionFontSize:Ze,optionLineHeight:At,optionPadding:bt}=_e;return{position:"relative",display:"block",minHeight:Ue,padding:bt,color:_e.colorText,fontWeight:"normal",fontSize:Ze,lineHeight:At,boxSizing:"border-box"}};var he=_e=>{const{antCls:Ue,componentCls:Ze}=_e,At=`${Ze}-item`,bt=`&${Ue}-slide-up-enter${Ue}-slide-up-enter-active`,xt=`&${Ue}-slide-up-appear${Ue}-slide-up-appear-active`,Ge=`&${Ue}-slide-up-leave${Ue}-slide-up-leave-active`,Ot=`${Ze}-dropdown-placement-`;return[{[`${Ze}-dropdown`]:Object.assign(Object.assign({},(0,be.Wf)(_e)),{position:"absolute",top:-9999,zIndex:_e.zIndexPopup,boxSizing:"border-box",padding:_e.paddingXXS,overflow:"hidden",fontSize:_e.fontSize,fontVariant:"initial",backgroundColor:_e.colorBgElevated,borderRadius:_e.borderRadiusLG,outline:"none",boxShadow:_e.boxShadowSecondary,[`
${bt}${Ot}bottomLeft,
${xt}${Ot}bottomLeft
`]:{animationName:ye.fJ},[`
${bt}${Ot}topLeft,
${xt}${Ot}topLeft,
${bt}${Ot}topRight,
${xt}${Ot}topRight
`]:{animationName:ye.Qt},[`${Ge}${Ot}bottomLeft`]:{animationName:ye.Uw},[`
${Ge}${Ot}topLeft,
${Ge}${Ot}topRight
`]:{animationName:ye.ly},"&-hidden":{display:"none"},[`${At}`]:Object.assign(Object.assign({},Me(_e)),{cursor:"pointer",transition:`background ${_e.motionDurationSlow} ease`,borderRadius:_e.borderRadiusSM,"&-group":{color:_e.colorTextDescription,fontSize:_e.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},be.vS),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${At}-option-disabled)`]:{backgroundColor:_e.optionActiveBg},[`&-selected:not(${At}-option-disabled)`]:{color:_e.optionSelectedColor,fontWeight:_e.optionSelectedFontWeight,backgroundColor:_e.optionSelectedBg,[`${At}-option-state`]:{color:_e.colorPrimary}},"&-disabled":{[`&${At}-option-selected`]:{backgroundColor:_e.colorBgContainerDisabled},color:_e.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:_e.controlPaddingHorizontal*2}}}),"&-rtl":{direction:"rtl"}})},(0,ye.oN)(_e,"slide-up"),(0,ye.oN)(_e,"slide-down"),(0,Ce.Fm)(_e,"move-up"),(0,Ce.Fm)(_e,"move-down")]};const De=2,ct=_e=>{let{controlHeightSM:Ue,controlHeight:Ze,lineWidth:At}=_e;const bt=(Ze-Ue)/2-At,xt=Math.ceil(bt/2);return[bt,xt]};function Ne(_e,Ue){const{componentCls:Ze,iconCls:At}=_e,bt=`${Ze}-selection-overflow`,xt=_e.multipleSelectItemHeight,[Ge]=ct(_e),Ot=Ue?`${Ze}-${Ue}`:"";return{[`${Ze}-multiple${Ot}`]:{fontSize:_e.fontSize,[bt]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${Ze}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",padding:`${Ge-De}px ${De*2}px`,borderRadius:_e.borderRadius,[`${Ze}-show-search&`]:{cursor:"text"},[`${Ze}-disabled&`]:{background:_e.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${De}px 0`,lineHeight:`${xt}px`,visibility:"hidden",content:'"\\a0"'}},[`
&${Ze}-show-arrow ${Ze}-selector,
&${Ze}-allow-clear ${Ze}-selector
`]:{paddingInlineEnd:_e.fontSizeIcon+_e.controlPaddingHorizontal},[`${Ze}-selection-item`]:{position:"relative",display:"flex",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:xt,marginTop:De,marginBottom:De,lineHeight:`${xt-_e.lineWidth*2}px`,background:_e.multipleItemBg,border:`${_e.lineWidth}px ${_e.lineType} ${_e.multipleItemBorderColor}`,borderRadius:_e.borderRadiusSM,cursor:"default",transition:`font-size ${_e.motionDurationSlow}, line-height ${_e.motionDurationSlow}, height ${_e.motionDurationSlow}`,userSelect:"none",marginInlineEnd:De*2,paddingInlineStart:_e.paddingXS,paddingInlineEnd:_e.paddingXS/2,[`${Ze}-disabled&`]:{color:_e.multipleItemColorDisabled,borderColor:_e.multipleItemBorderColorDisabled,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:_e.paddingXS/2,overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},(0,be.Ro)()),{display:"inline-flex",alignItems:"center",color:_e.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${At}`]:{verticalAlign:"-0.2em"},"&:hover":{color:_e.colorIconHover}})},[`${bt}-item + ${bt}-item`]:{[`${Ze}-selection-search`]:{marginInlineStart:0}},[`${Ze}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:_e.inputPaddingHorizontalBase-Ge,"\n &-input,\n &-mirror\n ":{height:xt,fontFamily:_e.fontFamily,lineHeight:`${xt}px`,transition:`all ${_e.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${Ze}-selection-placeholder `]:{position:"absolute",top:"50%",insetInlineStart:_e.inputPaddingHorizontalBase,insetInlineEnd:_e.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${_e.motionDurationSlow}`}}}}var ut=_e=>{const{componentCls:Ue}=_e,Ze=(0,Fe.TS)(_e,{controlHeight:_e.controlHeightSM,multipleSelectItemHeight:_e.controlHeightXS,borderRadius:_e.borderRadiusSM,borderRadiusSM:_e.borderRadiusXS}),At=(0,Fe.TS)(_e,{fontSize:_e.fontSizeLG,controlHeight:_e.controlHeightLG,multipleSelectItemHeight:_e.multipleItemHeightLG,borderRadius:_e.borderRadiusLG,borderRadiusSM:_e.borderRadius}),[,bt]=ct(_e);return[Ne(_e),Ne(Ze,"sm"),{[`${Ue}-multiple${Ue}-sm`]:{[`${Ue}-selection-placeholder`]:{insetInline:_e.controlPaddingHorizontalSM-_e.lineWidth},[`${Ue}-selection-search`]:{marginInlineStart:bt}}},Ne(At,"lg")]};function Qe(_e,Ue){const{componentCls:Ze,inputPaddingHorizontalBase:At,borderRadius:bt}=_e,xt=_e.controlHeight-_e.lineWidth*2,Ge=Math.ceil(_e.fontSize*1.25),Ot=Ue?`${Ze}-${Ue}`:"";return{[`${Ze}-single${Ot}`]:{fontSize:_e.fontSize,[`${Ze}-selector`]:Object.assign(Object.assign({},(0,be.Wf)(_e)),{display:"flex",borderRadius:bt,[`${Ze}-selection-search`]:{position:"absolute",top:0,insetInlineStart:At,insetInlineEnd:At,bottom:0,"&-input":{width:"100%"}},[`
${Ze}-selection-item,
${Ze}-selection-placeholder
`]:{padding:0,lineHeight:`${xt}px`,transition:`all ${_e.motionDurationSlow}, visibility 0s`,"@supports (-moz-appearance: meterbar)":{lineHeight:`${xt}px`}},[`${Ze}-selection-item`]:{position:"relative",userSelect:"none"},[`${Ze}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${Ze}-selection-item:after`,`${Ze}-selection-placeholder:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[`
&${Ze}-show-arrow ${Ze}-selection-item,
&${Ze}-show-arrow ${Ze}-selection-placeholder
`]:{paddingInlineEnd:Ge},[`&${Ze}-open ${Ze}-selection-item`]:{color:_e.colorTextPlaceholder},[`&:not(${Ze}-customize-input)`]:{[`${Ze}-selector`]:{width:"100%",height:_e.controlHeight,padding:`0 ${At}px`,[`${Ze}-selection-search-input`]:{height:xt},"&:after":{lineHeight:`${xt}px`}}},[`&${Ze}-customize-input`]:{[`${Ze}-selector`]:{"&:after":{display:"none"},[`${Ze}-selection-search`]:{position:"static",width:"100%"},[`${Ze}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${At}px`,"&:after":{display:"none"}}}}}}}function Xe(_e){const{componentCls:Ue}=_e,Ze=_e.controlPaddingHorizontalSM-_e.lineWidth;return[Qe(_e),Qe((0,Fe.TS)(_e,{controlHeight:_e.controlHeightSM,borderRadius:_e.borderRadiusSM}),"sm"),{[`${Ue}-single${Ue}-sm`]:{[`&:not(${Ue}-customize-input)`]:{[`${Ue}-selection-search`]:{insetInlineStart:Ze,insetInlineEnd:Ze},[`${Ue}-selector`]:{padding:`0 ${Ze}px`},[`&${Ue}-show-arrow ${Ue}-selection-search`]:{insetInlineEnd:Ze+_e.fontSize*1.5},[`
&${Ue}-show-arrow ${Ue}-selection-item,
&${Ue}-show-arrow ${Ue}-selection-placeholder
`]:{paddingInlineEnd:_e.fontSize*1.5}}}},Qe((0,Fe.TS)(_e,{controlHeight:_e.singleItemHeightLG,fontSize:_e.fontSizeLG,borderRadius:_e.borderRadiusLG}),"lg")]}const Te=_e=>{const{componentCls:Ue,selectorBg:Ze}=_e;return{position:"relative",backgroundColor:Ze,border:`${_e.lineWidth}px ${_e.lineType} ${_e.colorBorder}`,transition:`all ${_e.motionDurationMid} ${_e.motionEaseInOut}`,input:{cursor:"pointer"},[`${Ue}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit"}},[`${Ue}-disabled&`]:{color:_e.colorTextDisabled,background:_e.colorBgContainerDisabled,cursor:"not-allowed",[`${Ue}-multiple&`]:{background:_e.multipleSelectorBgDisabled},input:{cursor:"not-allowed"}}}},Et=function(_e,Ue){let Ze=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const{componentCls:At,borderHoverColor:bt,outlineColor:xt,antCls:Ge}=Ue,Ot=Ze?{[`${At}-selector`]:{borderColor:bt}}:{};return{[_e]:{[`&:not(${At}-disabled):not(${At}-customize-input):not(${Ge}-pagination-size-changer)`]:Object.assign(Object.assign({},Ot),{[`${At}-focused& ${At}-selector`]:{borderColor:bt,boxShadow:`0 0 0 ${Ue.controlOutlineWidth}px ${xt}`,outline:0},[`&:hover ${At}-selector`]:{borderColor:bt}})}}},Lt=_e=>{const{componentCls:Ue}=_e;return{[`${Ue}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},et=_e=>{const{componentCls:Ue,inputPaddingHorizontalBase:Ze,iconCls:At}=_e;return{[Ue]:Object.assign(Object.assign({},(0,be.Wf)(_e)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${Ue}-customize-input) ${Ue}-selector`]:Object.assign(Object.assign({},Te(_e)),Lt(_e)),[`${Ue}-selection-item`]:Object.assign({flex:1,fontWeight:"normal"},be.vS),[`${Ue}-selection-placeholder`]:Object.assign(Object.assign({},be.vS),{flex:1,color:_e.colorTextPlaceholder,pointerEvents:"none"}),[`${Ue}-arrow`]:Object.assign(Object.assign({},(0,be.Ro)()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:Ze,height:_e.fontSizeIcon,marginTop:-_e.fontSizeIcon/2,color:_e.colorTextQuaternary,fontSize:_e.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",[At]:{verticalAlign:"top",transition:`transform ${_e.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${Ue}-suffix)`]:{pointerEvents:"auto"}},[`${Ue}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${Ue}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:Ze,zIndex:1,display:"inline-block",width:_e.fontSizeIcon,height:_e.fontSizeIcon,marginTop:-_e.fontSizeIcon/2,color:_e.colorTextQuaternary,fontSize:_e.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",background:_e.clearBg,cursor:"pointer",opacity:0,transition:`color ${_e.motionDurationMid} ease, opacity ${_e.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:_e.colorTextTertiary}},"&:hover":{[`${Ue}-clear`]:{opacity:1}}}),[`${Ue}-has-feedback`]:{[`${Ue}-clear`]:{insetInlineEnd:Ze+_e.fontSize+_e.paddingXS}}}},lt=_e=>{const{componentCls:Ue}=_e;return[{[Ue]:{[`&-borderless ${Ue}-selector`]:{backgroundColor:"transparent !important",borderColor:"transparent !important",boxShadow:"none !important"},[`&${Ue}-in-form-item`]:{width:"100%"}}},et(_e),Xe(_e),ut(_e),he(_e),{[`${Ue}-rtl`]:{direction:"rtl"}},Et(Ue,(0,Fe.TS)(_e,{borderHoverColor:_e.colorPrimaryHover,outlineColor:_e.controlOutline})),Et(`${Ue}-status-error`,(0,Fe.TS)(_e,{borderHoverColor:_e.colorErrorHover,outlineColor:_e.colorErrorOutline}),!0),Et(`${Ue}-status-warning`,(0,Fe.TS)(_e,{borderHoverColor:_e.colorWarningHover,outlineColor:_e.colorWarningOutline}),!0),(0,tt.c)(_e,{borderElCls:`${Ue}-selector`,focusElCls:`${Ue}-focused`})]};var Ie=(0,qe.Z)("Select",(_e,Ue)=>{let{rootPrefixCls:Ze}=Ue;const At=(0,Fe.TS)(_e,{rootPrefixCls:Ze,inputPaddingHorizontalBase:_e.paddingSM-1,multipleSelectItemHeight:_e.multipleItemHeight});return[lt(At)]},_e=>{const{fontSize:Ue,lineHeight:Ze,controlHeight:At,controlPaddingHorizontal:bt,zIndexPopupBase:xt,colorText:Ge,fontWeightStrong:Ot,controlItemBgActive:kt,controlItemBgHover:vn,colorBgContainer:qt,colorFillSecondary:cn,controlHeightLG:An,controlHeightSM:Zn,colorBgContainerDisabled:Ye,colorTextDisabled:Ee}=_e;return{zIndexPopup:xt+50,optionSelectedColor:Ge,optionSelectedFontWeight:Ot,optionSelectedBg:kt,optionActiveBg:vn,optionPadding:`${(At-Ue*Ze)/2}px ${bt}px`,optionFontSize:Ue,optionLineHeight:Ze,optionHeight:At,selectorBg:qt,clearBg:qt,singleItemHeightLG:An,multipleItemBg:cn,multipleItemBorderColor:"transparent",multipleItemHeight:Zn,multipleItemHeightLG:At,multipleSelectorBgDisabled:Ye,multipleItemColorDisabled:Ee,multipleItemBorderColorDisabled:"transparent"}})},13458:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return tt}});const be=Fe=>{const ye={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:Fe==="scroll"?"scroll":"visible",_experimental:{dynamicInset:!0}};return{bottomLeft:Object.assign(Object.assign({},ye),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},ye),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},ye),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},ye),{points:["br","tr"],offset:[0,-4]})}};function tt(Fe,qe){return Fe||be(qe)}},78642:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return be}});function be(tt,Fe){return Fe!==void 0?Fe:tt!==null}},46163:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return we}});var be=ue(18299),tt=ue(16646),Fe=ue(73475),qe=ue(42922),ye=ue(3407),Ce=ue(72395),Me=ue(67294);function we(he){let{suffixIcon:De,clearIcon:ct,menuItemSelectedIcon:Ne,removeIcon:Mt,loading:ut,multiple:Qe,hasFeedback:Xe,prefixCls:Te,showSuffixIcon:Et,feedbackIcon:Lt,showArrow:et,componentName:lt}=he;const Ie=ct!=null?ct:Me.createElement(tt.Z,null),_e=bt=>De===null&&!Xe&&!et?null:Me.createElement(Me.Fragment,null,Et!==!1&&bt,Xe&&Lt);let Ue=null;if(De!==void 0)Ue=_e(De);else if(ut)Ue=_e(Me.createElement(ye.Z,{spin:!0}));else{const bt=`${Te}-suffix`;Ue=xt=>{let{open:Ge,showSearch:Ot}=xt;return _e(Ge&&Ot?Me.createElement(Ce.Z,{className:bt}):Me.createElement(qe.Z,{className:bt}))}}let Ze=null;Ne!==void 0?Ze=Ne:Qe?Ze=Me.createElement(be.Z,null):Ze=null;let At=null;return Mt!==void 0?At=Mt:At=Me.createElement(Fe.Z,null),{clearIcon:Ie,suffixIcon:Ue,itemIcon:Ze,removeIcon:At}}},33507:function(mn,Ut){"use strict";const ue=be=>({[be.componentCls]:{[`${be.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${be.motionDurationMid} ${be.motionEaseInOut},
opacity ${be.motionDurationMid} ${be.motionEaseInOut} !important`}},[`${be.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${be.motionDurationMid} ${be.motionEaseInOut},
opacity ${be.motionDurationMid} ${be.motionEaseInOut} !important`}}});Ut.Z=ue},33297:function(mn,Ut,ue){"use strict";ue.d(Ut,{Fm:function(){return Ne}});var be=ue(34367),tt=ue(93590);const Fe=new be.Keyframes("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),qe=new be.Keyframes("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),ye=new be.Keyframes("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Ce=new be.Keyframes("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),Me=new be.Keyframes("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),we=new be.Keyframes("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),he=new be.Keyframes("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),De=new be.Keyframes("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),ct={"move-up":{inKeyframes:he,outKeyframes:De},"move-down":{inKeyframes:Fe,outKeyframes:qe},"move-left":{inKeyframes:ye,outKeyframes:Ce},"move-right":{inKeyframes:Me,outKeyframes:we}},Ne=(Mt,ut)=>{const{antCls:Qe}=Mt,Xe=`${Qe}-${ut}`,{inKeyframes:Te,outKeyframes:Et}=ct[ut];return[(0,tt.R)(Xe,Te,Et,Mt.motionDurationMid),{[`
${Xe}-enter,
${Xe}-appear
`]:{opacity:0,animationTimingFunction:Mt.motionEaseOutCirc},[`${Xe}-leave`]:{animationTimingFunction:Mt.motionEaseInOutCirc}}]}},67771:function(mn,Ut,ue){"use strict";ue.d(Ut,{Qt:function(){return ye},Uw:function(){return qe},fJ:function(){return Fe},ly:function(){return Ce},oN:function(){return Ne}});var be=ue(34367),tt=ue(93590);const Fe=new be.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),qe=new be.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),ye=new be.Keyframes("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),Ce=new be.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),Me=new be.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),we=new be.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),he=new be.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),De=new be.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),ct={"slide-up":{inKeyframes:Fe,outKeyframes:qe},"slide-down":{inKeyframes:ye,outKeyframes:Ce},"slide-left":{inKeyframes:Me,outKeyframes:we},"slide-right":{inKeyframes:he,outKeyframes:De}},Ne=(Mt,ut)=>{const{antCls:Qe}=Mt,Xe=`${Qe}-${ut}`,{inKeyframes:Te,outKeyframes:Et}=ct[ut];return[(0,tt.R)(Xe,Te,Et,Mt.motionDurationMid),{[`
${Xe}-enter,
${Xe}-appear
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:Mt.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${Xe}-leave`]:{animationTimingFunction:Mt.motionEaseInQuint}}]}},47897:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return ve}});var be=ue(3407),tt=ue(94184),Fe=ue.n(tt);function qe(){return qe=Object.assign?Object.assign.bind():function(pe){for(var oe=1;oe<arguments.length;oe++){var ze=arguments[oe];for(var yt in ze)Object.prototype.hasOwnProperty.call(ze,yt)&&(pe[yt]=ze[yt])}return pe},qe.apply(this,arguments)}function ye(pe){"@babel/helpers - typeof";return ye=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(oe){return typeof oe}:function(oe){return oe&&typeof Symbol=="function"&&oe.constructor===Symbol&&oe!==Symbol.prototype?"symbol":typeof oe},ye(pe)}function Ce(pe,oe){if(ye(pe)!=="object"||pe===null)return pe;var ze=pe[Symbol.toPrimitive];if(ze!==void 0){var yt=ze.call(pe,oe||"default");if(ye(yt)!=="object")return yt;throw new TypeError("@@toPrimitive must return a primitive value.")}return(oe==="string"?String:Number)(pe)}function Me(pe){var oe=Ce(pe,"string");return ye(oe)==="symbol"?oe:String(oe)}function we(pe,oe,ze){return oe=Me(oe),oe in pe?Object.defineProperty(pe,oe,{value:ze,enumerable:!0,configurable:!0,writable:!0}):pe[oe]=ze,pe}function he(pe){if(Array.isArray(pe))return pe}function De(pe,oe){var ze=pe==null?null:typeof Symbol!="undefined"&&pe[Symbol.iterator]||pe["@@iterator"];if(ze!=null){var yt,Vt,en,un,yn=[],Jt=!0,Cr=!1;try{if(en=(ze=ze.call(pe)).next,oe===0){if(Object(ze)!==ze)return;Jt=!1}else for(;!(Jt=(yt=en.call(ze)).done)&&(yn.push(yt.value),yn.length!==oe);Jt=!0);}catch(Tr){Cr=!0,Vt=Tr}finally{try{if(!Jt&&ze.return!=null&&(un=ze.return(),Object(un)!==un))return}finally{if(Cr)throw Vt}}return yn}}function ct(pe,oe){(oe==null||oe>pe.length)&&(oe=pe.length);for(var ze=0,yt=new Array(oe);ze<oe;ze++)yt[ze]=pe[ze];return yt}function Ne(pe,oe){if(pe){if(typeof pe=="string")return ct(pe,oe);var ze=Object.prototype.toString.call(pe).slice(8,-1);if(ze==="Object"&&pe.constructor&&(ze=pe.constructor.name),ze==="Map"||ze==="Set")return Array.from(pe);if(ze==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ze))return ct(pe,oe)}}function Mt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ut(pe,oe){return he(pe)||De(pe,oe)||Ne(pe,oe)||Mt()}function Qe(pe,oe){if(pe==null)return{};var ze={},yt=Object.keys(pe),Vt,en;for(en=0;en<yt.length;en++)Vt=yt[en],!(oe.indexOf(Vt)>=0)&&(ze[Vt]=pe[Vt]);return ze}function Xe(pe,oe){if(pe==null)return{};var ze=Qe(pe,oe),yt,Vt;if(Object.getOwnPropertySymbols){var en=Object.getOwnPropertySymbols(pe);for(Vt=0;Vt<en.length;Vt++)yt=en[Vt],!(oe.indexOf(yt)>=0)&&Object.prototype.propertyIsEnumerable.call(pe,yt)&&(ze[yt]=pe[yt])}return ze}var Te=ue(67294);function Et(pe){if(Array.isArray(pe))return pe}function Lt(pe,oe){var ze=pe==null?null:typeof Symbol!="undefined"&&pe[Symbol.iterator]||pe["@@iterator"];if(ze!=null){var yt,Vt,en,un,yn=[],Jt=!0,Cr=!1;try{if(en=(ze=ze.call(pe)).next,oe===0){if(Object(ze)!==ze)return;Jt=!1}else for(;!(Jt=(yt=en.call(ze)).done)&&(yn.push(yt.value),yn.length!==oe);Jt=!0);}catch(Tr){Cr=!0,Vt=Tr}finally{try{if(!Jt&&ze.return!=null&&(un=ze.return(),Object(un)!==un))return}finally{if(Cr)throw Vt}}return yn}}function et(pe,oe){(oe==null||oe>pe.length)&&(oe=pe.length);for(var ze=0,yt=new Array(oe);ze<oe;ze++)yt[ze]=pe[ze];return yt}function lt(pe,oe){if(pe){if(typeof pe=="string")return et(pe,oe);var ze=Object.prototype.toString.call(pe).slice(8,-1);if(ze==="Object"&&pe.constructor&&(ze=pe.constructor.name),ze==="Map"||ze==="Set")return Array.from(pe);if(ze==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ze))return et(pe,oe)}}function Ie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _e(pe,oe){return Et(pe)||Lt(pe,oe)||lt(pe,oe)||Ie()}function Ue(pe){var oe=Te.useRef();oe.current=pe;var ze=Te.useCallback(function(){for(var yt,Vt=arguments.length,en=new Array(Vt),un=0;un<Vt;un++)en[un]=arguments[un];return(yt=oe.current)===null||yt===void 0?void 0:yt.call.apply(yt,[oe].concat(en))},[]);return ze}function Ze(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var At=Ze()?Te.useLayoutEffect:Te.useEffect,bt=function(oe,ze){var yt=Te.useRef(!0);At(function(){return oe(yt.current)},ze),At(function(){return yt.current=!1,function(){yt.current=!0}},[])},xt=function(oe,ze){bt(function(yt){if(!yt)return oe()},ze)},Ge=null;function Ot(pe){var oe=Te.useRef(!1),ze=Te.useState(pe),yt=_e(ze,2),Vt=yt[0],en=yt[1];Te.useEffect(function(){return oe.current=!1,function(){oe.current=!0}},[]);function un(yn,Jt){Jt&&oe.current||en(yn)}return[Vt,un]}function kt(pe){return pe!==void 0}function vn(pe,oe){var ze=oe||{},yt=ze.defaultValue,Vt=ze.value,en=ze.onChange,un=ze.postState,yn=Ot(function(){return kt(Vt)?Vt:kt(yt)?typeof yt=="function"?yt():yt:typeof pe=="function"?pe():pe}),Jt=_e(yn,2),Cr=Jt[0],Tr=Jt[1],Rt=Vt!==void 0?Vt:Cr,Ln=un?un(Rt):Rt,Nr=Ue(en),Qr=Ot([Rt]),Gn=_e(Qr,2),Fr=Gn[0],Da=Gn[1];xt(function(){var Oi=Fr[0];Cr!==Oi&&Nr(Cr,Oi)},[Fr]),xt(function(){kt(Vt)||Tr(Vt)},[Vt]);var Fi=Ue(function(Oi,Ei){Tr(Oi,Ei),Da([Rt],Ei)});return[Ln,Fi]}var qt={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(oe){var ze=oe.keyCode;if(oe.altKey&&!oe.ctrlKey||oe.metaKey||ze>=qt.F1&&ze<=qt.F12)return!1;switch(ze){case qt.ALT:case qt.CAPS_LOCK:case qt.CONTEXT_MENU:case qt.CTRL:case qt.DOWN:case qt.END:case qt.ESC:case qt.HOME:case qt.INSERT:case qt.LEFT:case qt.MAC_FF_META:case qt.META:case qt.NUMLOCK:case qt.NUM_CENTER:case qt.PAGE_DOWN:case qt.PAGE_UP:case qt.PAUSE:case qt.PRINT_SCREEN:case qt.RIGHT:case qt.SHIFT:case qt.UP:case qt.WIN_KEY:case qt.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(oe){if(oe>=qt.ZERO&&oe<=qt.NINE||oe>=qt.NUM_ZERO&&oe<=qt.NUM_MULTIPLY||oe>=qt.A&&oe<=qt.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&oe===0)return!0;switch(oe){case qt.SPACE:case qt.QUESTION_MARK:case qt.NUM_PLUS:case qt.NUM_MINUS:case qt.NUM_PERIOD:case qt.NUM_DIVISION:case qt.SEMICOLON:case qt.DASH:case qt.EQUALS:case qt.COMMA:case qt.PERIOD:case qt.SLASH:case qt.APOSTROPHE:case qt.SINGLE_QUOTE:case qt.OPEN_SQUARE_BRACKET:case qt.BACKSLASH:case qt.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},cn=qt,An=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],Zn=Te.forwardRef(function(pe,oe){var ze,yt=pe.prefixCls,Vt=yt===void 0?"rc-switch":yt,en=pe.className,un=pe.checked,yn=pe.defaultChecked,Jt=pe.disabled,Cr=pe.loadingIcon,Tr=pe.checkedChildren,Rt=pe.unCheckedChildren,Ln=pe.onClick,Nr=pe.onChange,Qr=pe.onKeyDown,Gn=Xe(pe,An),Fr=vn(!1,{value:un,defaultValue:yn}),Da=ut(Fr,2),Fi=Da[0],Oi=Da[1];function Ei(ca,Hr){var La=Fi;return Jt||(La=ca,Oi(La),Nr==null||Nr(La,Hr)),La}function ua(ca){ca.which===cn.LEFT?Ei(!1,ca):ca.which===cn.RIGHT&&Ei(!0,ca),Qr==null||Qr(ca)}function ba(ca){var Hr=Ei(!Fi,ca);Ln==null||Ln(Hr,ca)}var ka=Fe()(Vt,en,(ze={},we(ze,"".concat(Vt,"-checked"),Fi),we(ze,"".concat(Vt,"-disabled"),Jt),ze));return Te.createElement("button",qe({},Gn,{type:"button",role:"switch","aria-checked":Fi,disabled:Jt,className:ka,ref:oe,onKeyDown:ua,onClick:ba}),Cr,Te.createElement("span",{className:"".concat(Vt,"-inner")},Te.createElement("span",{className:"".concat(Vt,"-inner-checked")},Tr),Te.createElement("span",{className:"".concat(Vt,"-inner-unchecked")},Rt)))});Zn.displayName="Switch";var Ye=Zn,Ee=ue(45353),Tt=ue(53124),gn=ue(98866),Xt=ue(98675),Je=ue(84780),rt=ue(14747),Ht=ue(67968),Sn=ue(45503);const sn=pe=>{const{componentCls:oe,trackHeightSM:ze,trackPadding:yt,trackMinWidthSM:Vt,innerMinMarginSM:en,innerMaxMarginSM:un,handleSizeSM:yn}=pe,Jt=`${oe}-inner`;return{[oe]:{[`&${oe}-small`]:{minWidth:Vt,height:ze,lineHeight:`${ze}px`,[`${oe}-inner`]:{paddingInlineStart:un,paddingInlineEnd:en,[`${Jt}-checked`]:{marginInlineStart:`calc(-100% + ${yn+yt*2}px - ${un*2}px)`,marginInlineEnd:`calc(100% - ${yn+yt*2}px + ${un*2}px)`},[`${Jt}-unchecked`]:{marginTop:-ze,marginInlineStart:0,marginInlineEnd:0}},[`${oe}-handle`]:{width:yn,height:yn},[`${oe}-loading-icon`]:{top:(yn-pe.switchLoadingIconSize)/2,fontSize:pe.switchLoadingIconSize},[`&${oe}-checked`]:{[`${oe}-inner`]:{paddingInlineStart:en,paddingInlineEnd:un,[`${Jt}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${Jt}-unchecked`]:{marginInlineStart:`calc(100% - ${yn+yt*2}px + ${un*2}px)`,marginInlineEnd:`calc(-100% + ${yn+yt*2}px - ${un*2}px)`}},[`${oe}-handle`]:{insetInlineStart:`calc(100% - ${yn+yt}px)`}},[`&:not(${oe}-disabled):active`]:{[`&:not(${oe}-checked) ${Jt}`]:{[`${Jt}-unchecked`]:{marginInlineStart:pe.marginXXS/2,marginInlineEnd:-pe.marginXXS/2}},[`&${oe}-checked ${Jt}`]:{[`${Jt}-checked`]:{marginInlineStart:-pe.marginXXS/2,marginInlineEnd:pe.marginXXS/2}}}}}}},$t=pe=>{const{componentCls:oe,handleSize:ze}=pe;return{[oe]:{[`${oe}-loading-icon${pe.iconCls}`]:{position:"relative",top:(ze-pe.fontSize)/2,color:pe.switchLoadingIconColor,verticalAlign:"top"},[`&${oe}-checked ${oe}-loading-icon`]:{color:pe.switchColor}}}},Bt=pe=>{const{componentCls:oe,motion:ze,trackPadding:yt,handleBg:Vt,handleShadow:en,handleSize:un}=pe,yn=`${oe}-handle`;return{[oe]:{[yn]:{position:"absolute",top:yt,insetInlineStart:yt,width:un,height:un,transition:`all ${pe.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:Vt,borderRadius:un/2,boxShadow:en,transition:`all ${pe.switchDuration} ease-in-out`,content:'""'}},[`&${oe}-checked ${yn}`]:{insetInlineStart:`calc(100% - ${un+yt}px)`},[`&:not(${oe}-disabled):active`]:ze?{[`${yn}::before`]:{insetInlineEnd:pe.switchHandleActiveInset,insetInlineStart:0},[`&${oe}-checked ${yn}::before`]:{insetInlineEnd:0,insetInlineStart:pe.switchHandleActiveInset}}:{}}}},bn=pe=>{const{componentCls:oe,trackHeight:ze,trackPadding:yt,innerMinMargin:Vt,innerMaxMargin:en,handleSize:un}=pe,yn=`${oe}-inner`;return{[oe]:{[yn]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:en,paddingInlineEnd:Vt,transition:`padding-inline-start ${pe.switchDuration} ease-in-out, padding-inline-end ${pe.switchDuration} ease-in-out`,[`${yn}-checked, ${yn}-unchecked`]:{display:"block",color:pe.colorTextLightSolid,fontSize:pe.fontSizeSM,transition:`margin-inline-start ${pe.switchDuration} ease-in-out, margin-inline-end ${pe.switchDuration} ease-in-out`,pointerEvents:"none"},[`${yn}-checked`]:{marginInlineStart:`calc(-100% + ${un+yt*2}px - ${en*2}px)`,marginInlineEnd:`calc(100% - ${un+yt*2}px + ${en*2}px)`},[`${yn}-unchecked`]:{marginTop:-ze,marginInlineStart:0,marginInlineEnd:0}},[`&${oe}-checked ${yn}`]:{paddingInlineStart:Vt,paddingInlineEnd:en,[`${yn}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${yn}-unchecked`]:{marginInlineStart:`calc(100% - ${un+yt*2}px + ${en*2}px)`,marginInlineEnd:`calc(-100% + ${un+yt*2}px - ${en*2}px)`}},[`&:not(${oe}-disabled):active`]:{[`&:not(${oe}-checked) ${yn}`]:{[`${yn}-unchecked`]:{marginInlineStart:yt*2,marginInlineEnd:-yt*2}},[`&${oe}-checked ${yn}`]:{[`${yn}-checked`]:{marginInlineStart:-yt*2,marginInlineEnd:yt*2}}}}}},dn=pe=>{const{componentCls:oe,trackHeight:ze,trackMinWidth:yt}=pe;return{[oe]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,rt.Wf)(pe)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:yt,height:ze,lineHeight:`${ze}px`,verticalAlign:"middle",background:pe.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${pe.motionDurationMid}`,userSelect:"none",[`&:hover:not(${oe}-disabled)`]:{background:pe.colorTextTertiary}}),(0,rt.Qy)(pe)),{[`&${oe}-checked`]:{background:pe.switchColor,[`&:hover:not(${oe}-disabled)`]:{background:pe.colorPrimaryHover}},[`&${oe}-loading, &${oe}-disabled`]:{cursor:"not-allowed",opacity:pe.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${oe}-rtl`]:{direction:"rtl"}})}};var ke=(0,Ht.Z)("Switch",pe=>{const oe=(0,Sn.TS)(pe,{switchDuration:pe.motionDurationMid,switchColor:pe.colorPrimary,switchDisabledOpacity:pe.opacityLoading,switchLoadingIconSize:pe.fontSizeIcon*.75,switchLoadingIconColor:`rgba(0, 0, 0, ${pe.opacityLoading})`,switchHandleActiveInset:"-30%"});return[dn(oe),bn(oe),Bt(oe),$t(oe),sn(oe)]},pe=>{const{fontSize:oe,lineHeight:ze,controlHeight:yt,colorWhite:Vt}=pe,en=oe*ze,un=yt/2,yn=2,Jt=en-yn*2,Cr=un-yn*2;return{trackHeight:en,trackHeightSM:un,trackMinWidth:Jt*2+yn*4,trackMinWidthSM:Cr*2+yn*2,trackPadding:yn,handleBg:Vt,handleSize:Jt,handleSizeSM:Cr,handleShadow:`0 2px 4px 0 ${new Je.C("#00230b").setAlpha(.2).toRgbString()}`,innerMinMargin:Jt/2,innerMaxMargin:Jt+yn+yn*2,innerMinMarginSM:Cr/2,innerMaxMarginSM:Cr+yn+yn*2}}),ce=function(pe,oe){var ze={};for(var yt in pe)Object.prototype.hasOwnProperty.call(pe,yt)&&oe.indexOf(yt)<0&&(ze[yt]=pe[yt]);if(pe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Vt=0,yt=Object.getOwnPropertySymbols(pe);Vt<yt.length;Vt++)oe.indexOf(yt[Vt])<0&&Object.prototype.propertyIsEnumerable.call(pe,yt[Vt])&&(ze[yt[Vt]]=pe[yt[Vt]]);return ze};const le=Te.forwardRef((pe,oe)=>{const{prefixCls:ze,size:yt,disabled:Vt,loading:en,className:un,rootClassName:yn,style:Jt}=pe,Cr=ce(pe,["prefixCls","size","disabled","loading","className","rootClassName","style"]),{getPrefixCls:Tr,direction:Rt,switch:Ln}=Te.useContext(Tt.E_),Nr=Te.useContext(gn.Z),Qr=(Vt!=null?Vt:Nr)||en,Gn=Tr("switch",ze),Fr=Te.createElement("div",{className:`${Gn}-handle`},en&&Te.createElement(be.Z,{className:`${Gn}-loading-icon`})),[Da,Fi]=ke(Gn),Oi=(0,Xt.Z)(yt),Ei=Fe()(Ln==null?void 0:Ln.className,{[`${Gn}-small`]:Oi==="small",[`${Gn}-loading`]:en,[`${Gn}-rtl`]:Rt==="rtl"},un,yn,Fi),ua=Object.assign(Object.assign({},Ln==null?void 0:Ln.style),Jt);return Da(Te.createElement(Ee.Z,{component:"Switch"},Te.createElement(Ye,Object.assign({},Cr,{prefixCls:Gn,className:Ei,style:ua,disabled:Qr,ref:oe,loadingIcon:Fr}))))});le.__ANT_SWITCH=!0;var ve=le},66368:function(mn,Ut,ue){"use strict";ue.d(Ut,{default:function(){return Di}});var be=ue(73475),tt=ue(25877),Fe=ue(38308),qe=ue(94184),ye=ue.n(qe),Ce=ue(87462),Me=ue(4942),we=ue(1413),he=ue(97685),De=ue(71002),ct=ue(45987),Ne=ue(67294),Mt=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Le=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(Le)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(Le==null?void 0:Le.substr(0,4))};function ut(Le){var Re=Ne.useRef();Re.current=Le;var Oe=Ne.useCallback(function(){for(var We,nt=arguments.length,st=new Array(nt),mt=0;mt<nt;mt++)st[mt]=arguments[mt];return(We=Re.current)===null||We===void 0?void 0:We.call.apply(We,[Re].concat(st))},[]);return Oe}function Qe(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Xe=Qe()?Ne.useLayoutEffect:Ne.useEffect,Te=function(Re,Oe){var We=Ne.useRef(!0);Xe(function(){return Re(We.current)},Oe),Xe(function(){return We.current=!1,function(){We.current=!0}},[])},Et=function(Re,Oe){Te(function(We){if(!We)return Re()},Oe)},Lt=null;function et(Le){var Re=Ne.useRef(!1),Oe=Ne.useState(Le),We=(0,he.Z)(Oe,2),nt=We[0],st=We[1];Ne.useEffect(function(){return Re.current=!1,function(){Re.current=!0}},[]);function mt(zt,jt){jt&&Re.current||st(zt)}return[nt,mt]}function lt(Le){return Le!==void 0}function Ie(Le,Re){var Oe=Re||{},We=Oe.defaultValue,nt=Oe.value,st=Oe.onChange,mt=Oe.postState,zt=et(function(){return lt(nt)?nt:lt(We)?typeof We=="function"?We():We:typeof Le=="function"?Le():Le}),jt=(0,he.Z)(zt,2),Nn=jt[0],Qn=jt[1],Dn=nt!==void 0?nt:Nn,tn=mt?mt(Dn):Dn,Yt=ut(st),fn=et([Dn]),xn=(0,he.Z)(fn,2),Yn=xn[0],$n=xn[1];Et(function(){var Kn=Yn[0];Nn!==Kn&&Yt(Nn,Kn)},[Yn]),Et(function(){lt(nt)||Qn(nt)},[nt]);var On=ut(function(Kn,zn){Qn(Kn,zn),$n([Dn],zn)});return[tn,On]}var _e=ue(62874),Ue=(0,Ne.createContext)(null),Ze=Ne.forwardRef(function(Le,Re){var Oe=Le.prefixCls,We=Le.className,nt=Le.style,st=Le.id,mt=Le.active,zt=Le.tabKey,jt=Le.children;return Ne.createElement("div",{id:st&&"".concat(st,"-panel-").concat(zt),role:"tabpanel",tabIndex:mt?0:-1,"aria-labelledby":st&&"".concat(st,"-tab-").concat(zt),"aria-hidden":!mt,style:nt,className:ye()(Oe,mt&&"".concat(Oe,"-active"),We),ref:Re},jt)}),At=Ze,bt=["key","forceRender","style","className"];function xt(Le){var Re=Le.id,Oe=Le.activeKey,We=Le.animated,nt=Le.tabPosition,st=Le.destroyInactiveTabPane,mt=Ne.useContext(Ue),zt=mt.prefixCls,jt=mt.tabs,Nn=We.tabPane,Qn="".concat(zt,"-tabpane");return Ne.createElement("div",{className:ye()("".concat(zt,"-content-holder"))},Ne.createElement("div",{className:ye()("".concat(zt,"-content"),"".concat(zt,"-content-").concat(nt),(0,Me.Z)({},"".concat(zt,"-content-animated"),Nn))},jt.map(function(Dn){var tn=Dn.key,Yt=Dn.forceRender,fn=Dn.style,xn=Dn.className,Yn=(0,ct.Z)(Dn,bt),$n=tn===Oe;return Ne.createElement(_e.Z,(0,Ce.Z)({key:tn,visible:$n,forceRender:Yt,removeOnLeave:!!st,leavedClassName:"".concat(Qn,"-hidden")},We.tabPaneMotion),function(On,Kn){var zn=On.style,tr=On.className;return Ne.createElement(At,(0,Ce.Z)({},Yn,{prefixCls:Qn,id:Re,tabKey:tn,animated:Nn,active:$n,style:(0,we.Z)((0,we.Z)({},fn),zn),className:ye()(xn,tr),ref:Kn}))})})))}var Ge=ue(74902),Ot=ue(48555),kt=ue(59864);function vn(Le,Re,Oe){var We=Ne.useRef({});return(!("value"in We.current)||Oe(We.current.condition,Re))&&(We.current.value=Le(),We.current.condition=Re),We.current.value}function qt(Le,Re){typeof Le=="function"?Le(Re):(0,De.Z)(Le)==="object"&&Le&&"current"in Le&&(Le.current=Re)}function cn(){for(var Le=arguments.length,Re=new Array(Le),Oe=0;Oe<Le;Oe++)Re[Oe]=arguments[Oe];var We=Re.filter(function(nt){return nt});return We.length<=1?We[0]:function(nt){Re.forEach(function(st){qt(st,nt)})}}function An(){for(var Le=arguments.length,Re=new Array(Le),Oe=0;Oe<Le;Oe++)Re[Oe]=arguments[Oe];return vn(function(){return cn.apply(void 0,Re)},Re,function(We,nt){return We.length===nt.length&&We.every(function(st,mt){return st===nt[mt]})})}function Zn(Le){var Re,Oe,We=isMemo(Le)?Le.type.type:Le.type;return!(typeof We=="function"&&!((Re=We.prototype)!==null&&Re!==void 0&&Re.render)||typeof Le=="function"&&!((Oe=Le.prototype)!==null&&Oe!==void 0&&Oe.render))}var Ye={width:0,height:0,left:0,top:0};function Ee(Le,Re,Oe){return(0,Ne.useMemo)(function(){for(var We,nt=new Map,st=Re.get((We=Le[0])===null||We===void 0?void 0:We.key)||Ye,mt=st.left+st.width,zt=0;zt<Le.length;zt+=1){var jt=Le[zt].key,Nn=Re.get(jt);if(!Nn){var Qn;Nn=Re.get((Qn=Le[zt-1])===null||Qn===void 0?void 0:Qn.key)||Ye}var Dn=nt.get(jt)||(0,we.Z)({},Nn);Dn.right=mt-Dn.left-Dn.width,nt.set(jt,Dn)}return nt},[Le.map(function(We){return We.key}).join("_"),Re,Oe])}function Tt(Le,Re){var Oe=Ne.useRef(Le),We=Ne.useState({}),nt=(0,he.Z)(We,2),st=nt[1];function mt(zt){var jt=typeof zt=="function"?zt(Oe.current):zt;jt!==Oe.current&&Re(jt,Oe.current),Oe.current=jt,st({})}return[Oe.current,mt]}var gn=.1,Xt=.01,Je=20,rt=Math.pow(.995,Je);function Ht(Le,Re){var Oe=(0,Ne.useState)(),We=(0,he.Z)(Oe,2),nt=We[0],st=We[1],mt=(0,Ne.useState)(0),zt=(0,he.Z)(mt,2),jt=zt[0],Nn=zt[1],Qn=(0,Ne.useState)(0),Dn=(0,he.Z)(Qn,2),tn=Dn[0],Yt=Dn[1],fn=(0,Ne.useState)(),xn=(0,he.Z)(fn,2),Yn=xn[0],$n=xn[1],On=(0,Ne.useRef)();function Kn(ft){var Kt=ft.touches[0],on=Kt.screenX,nn=Kt.screenY;st({x:on,y:nn}),window.clearInterval(On.current)}function zn(ft){if(nt){ft.preventDefault();var Kt=ft.touches[0],on=Kt.screenX,nn=Kt.screenY;st({x:on,y:nn});var En=on-nt.x,pn=nn-nt.y;Re(En,pn);var Zt=Date.now();Nn(Zt),Yt(Zt-jt),$n({x:En,y:pn})}}function tr(){if(nt&&(st(null),$n(null),Yn)){var ft=Yn.x/tn,Kt=Yn.y/tn,on=Math.abs(ft),nn=Math.abs(Kt);if(Math.max(on,nn)<gn)return;var En=ft,pn=Kt;On.current=window.setInterval(function(){if(Math.abs(En)<Xt&&Math.abs(pn)<Xt){window.clearInterval(On.current);return}En*=rt,pn*=rt,Re(En*Je,pn*Je)},Je)}}var $e=(0,Ne.useRef)();function Ke(ft){var Kt=ft.deltaX,on=ft.deltaY,nn=0,En=Math.abs(Kt),pn=Math.abs(on);En===pn?nn=$e.current==="x"?Kt:on:En>pn?(nn=Kt,$e.current="x"):(nn=on,$e.current="y"),Re(-nn,-nn)&&ft.preventDefault()}var Ct=(0,Ne.useRef)(null);Ct.current={onTouchStart:Kn,onTouchMove:zn,onTouchEnd:tr,onWheel:Ke},Ne.useEffect(function(){function ft(En){Ct.current.onTouchStart(En)}function Kt(En){Ct.current.onTouchMove(En)}function on(En){Ct.current.onTouchEnd(En)}function nn(En){Ct.current.onWheel(En)}return document.addEventListener("touchmove",Kt,{passive:!1}),document.addEventListener("touchend",on,{passive:!1}),Le.current.addEventListener("touchstart",ft,{passive:!1}),Le.current.addEventListener("wheel",nn),function(){document.removeEventListener("touchmove",Kt),document.removeEventListener("touchend",on)}},[])}function Sn(Le){var Re=(0,Ne.useState)(0),Oe=(0,he.Z)(Re,2),We=Oe[0],nt=Oe[1],st=(0,Ne.useRef)(0),mt=(0,Ne.useRef)();return mt.current=Le,Et(function(){var zt;(zt=mt.current)===null||zt===void 0||zt.call(mt)},[We]),function(){st.current===We&&(st.current+=1,nt(st.current))}}function sn(Le){var Re=(0,Ne.useRef)([]),Oe=(0,Ne.useState)({}),We=(0,he.Z)(Oe,2),nt=We[1],st=(0,Ne.useRef)(typeof Le=="function"?Le():Le),mt=Sn(function(){var jt=st.current;Re.current.forEach(function(Nn){jt=Nn(jt)}),Re.current=[],st.current=jt,nt({})});function zt(jt){Re.current.push(jt),mt()}return[st.current,zt]}var $t={width:0,height:0,left:0,top:0,right:0};function Bt(Le,Re,Oe,We,nt,st,mt){var zt=mt.tabs,jt=mt.tabPosition,Nn=mt.rtl,Qn,Dn,tn;return["top","bottom"].includes(jt)?(Qn="width",Dn=Nn?"right":"left",tn=Math.abs(Oe)):(Qn="height",Dn="top",tn=-Oe),(0,Ne.useMemo)(function(){if(!zt.length)return[0,0];for(var Yt=zt.length,fn=Yt,xn=0;xn<Yt;xn+=1){var Yn=Le.get(zt[xn].key)||$t;if(Yn[Dn]+Yn[Qn]>tn+Re){fn=xn-1;break}}for(var $n=0,On=Yt-1;On>=0;On-=1){var Kn=Le.get(zt[On].key)||$t;if(Kn[Dn]<tn){$n=On+1;break}}return $n>=fn?[0,0]:[$n,fn]},[Le,Re,We,nt,st,tn,jt,zt.map(function(Yt){return Yt.key}).join("_"),Nn])}function bn(Le){var Re;return Le instanceof Map?(Re={},Le.forEach(function(Oe,We){Re[We]=Oe})):Re=Le,JSON.stringify(Re)}var dn="TABS_DQ";function ke(Le){return String(Le).replace(/"/g,dn)}function ce(Le,Re,Oe,We){return!(!Oe||We||Le===!1||Le===void 0&&(Re===!1||Re===null))}function le(Le,Re){var Oe=Le.prefixCls,We=Le.editable,nt=Le.locale,st=Le.style;return!We||We.showAdd===!1?null:Ne.createElement("button",{ref:Re,type:"button",className:"".concat(Oe,"-nav-add"),style:st,"aria-label":(nt==null?void 0:nt.addAriaLabel)||"Add tab",onClick:function(zt){We.onEdit("add",{event:zt})}},We.addIcon||"+")}var ve=Ne.forwardRef(le),pe=Ne.forwardRef(function(Le,Re){var Oe=Le.position,We=Le.prefixCls,nt=Le.extra;if(!nt)return null;var st,mt={};return(0,De.Z)(nt)==="object"&&!Ne.isValidElement(nt)?mt=nt:mt.right=nt,Oe==="right"&&(st=mt.right),Oe==="left"&&(st=mt.left),st?Ne.createElement("div",{className:"".concat(We,"-extra-content"),ref:Re},st):null}),oe=pe,ze=ue(62709);function yt(Le,Re,Oe){var We=React.useRef({});return(!("value"in We.current)||Oe(We.current.condition,Re))&&(We.current.value=Le(),We.current.condition=Re),We.current.value}function Vt(Le,Re){typeof Le=="function"?Le(Re):(0,De.Z)(Le)==="object"&&Le&&"current"in Le&&(Le.current=Re)}function en(){for(var Le=arguments.length,Re=new Array(Le),Oe=0;Oe<Le;Oe++)Re[Oe]=arguments[Oe];var We=Re.filter(function(nt){return nt});return We.length<=1?We[0]:function(nt){Re.forEach(function(st){Vt(st,nt)})}}function un(){for(var Le=arguments.length,Re=new Array(Le),Oe=0;Oe<Le;Oe++)Re[Oe]=arguments[Oe];return useMemo(function(){return en.apply(void 0,Re)},Re,function(We,nt){return We.length===nt.length&&We.every(function(st,mt){return st===nt[mt]})})}function yn(Le){var Re,Oe,We=(0,kt.isMemo)(Le)?Le.type.type:Le.type;return!(typeof We=="function"&&!((Re=We.prototype)!==null&&Re!==void 0&&Re.render)||typeof Le=="function"&&!((Oe=Le.prototype)!==null&&Oe!==void 0&&Oe.render))}var Jt={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(Re){var Oe=Re.keyCode;if(Re.altKey&&!Re.ctrlKey||Re.metaKey||Oe>=Jt.F1&&Oe<=Jt.F12)return!1;switch(Oe){case Jt.ALT:case Jt.CAPS_LOCK:case Jt.CONTEXT_MENU:case Jt.CTRL:case Jt.DOWN:case Jt.END:case Jt.ESC:case Jt.HOME:case Jt.INSERT:case Jt.LEFT:case Jt.MAC_FF_META:case Jt.META:case Jt.NUMLOCK:case Jt.NUM_CENTER:case Jt.PAGE_DOWN:case Jt.PAGE_UP:case Jt.PAUSE:case Jt.PRINT_SCREEN:case Jt.RIGHT:case Jt.SHIFT:case Jt.UP:case Jt.WIN_KEY:case Jt.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(Re){if(Re>=Jt.ZERO&&Re<=Jt.NINE||Re>=Jt.NUM_ZERO&&Re<=Jt.NUM_MULTIPLY||Re>=Jt.A&&Re<=Jt.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&Re===0)return!0;switch(Re){case Jt.SPACE:case Jt.QUESTION_MARK:case Jt.NUM_PLUS:case Jt.NUM_MINUS:case Jt.NUM_PERIOD:case Jt.NUM_DIVISION:case Jt.SEMICOLON:case Jt.DASH:case Jt.EQUALS:case Jt.COMMA:case Jt.PERIOD:case Jt.SLASH:case Jt.APOSTROPHE:case Jt.SINGLE_QUOTE:case Jt.OPEN_SQUARE_BRACKET:case Jt.BACKSLASH:case Jt.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Cr=Jt,Tr=function(Re){return+setTimeout(Re,16)},Rt=function(Re){return clearTimeout(Re)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(Tr=function(Re){return window.requestAnimationFrame(Re)},Rt=function(Re){return window.cancelAnimationFrame(Re)});var Ln=0,Nr=new Map;function Qr(Le){Nr.delete(Le)}var Gn=function(Re){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Ln+=1;var We=Ln;function nt(st){if(st===0)Qr(We),Re();else{var mt=Tr(function(){nt(st-1)});Nr.set(We,mt)}}return nt(Oe),We};Gn.cancel=function(Le){var Re=Nr.get(Le);return Qr(Re),Rt(Re)};var Fr=Gn,Da=Cr.ESC,Fi=Cr.TAB;function Oi(Le){var Re=Le.visible,Oe=Le.triggerRef,We=Le.onVisibleChange,nt=Le.autoFocus,st=Le.overlayRef,mt=Ne.useRef(!1),zt=function(){if(Re){var Dn,tn;(Dn=Oe.current)===null||Dn===void 0||(tn=Dn.focus)===null||tn===void 0||tn.call(Dn),We==null||We(!1)}},jt=function(){var Dn;return(Dn=st.current)!==null&&Dn!==void 0&&Dn.focus?(st.current.focus(),mt.current=!0,!0):!1},Nn=function(Dn){switch(Dn.keyCode){case Da:zt();break;case Fi:{var tn=!1;mt.current||(tn=jt()),tn?Dn.preventDefault():zt();break}}};Ne.useEffect(function(){return Re?(window.addEventListener("keydown",Nn),nt&&Fr(jt,3),function(){window.removeEventListener("keydown",Nn),mt.current=!1}):function(){mt.current=!1}},[Re])}var Ei=(0,Ne.forwardRef)(function(Le,Re){var Oe=Le.overlay,We=Le.arrow,nt=Le.prefixCls,st=(0,Ne.useMemo)(function(){var zt;return typeof Oe=="function"?zt=Oe():zt=Oe,zt},[Oe]),mt=en(Re,st==null?void 0:st.ref);return Ne.createElement(Ne.Fragment,null,We&&Ne.createElement("div",{className:"".concat(nt,"-arrow")}),Ne.cloneElement(st,{ref:yn(st)?mt:void 0}))}),ua=Ei,ba={adjustX:1,adjustY:1},ka=[0,0],ca={topLeft:{points:["bl","tl"],overflow:ba,offset:[0,-4],targetOffset:ka},top:{points:["bc","tc"],overflow:ba,offset:[0,-4],targetOffset:ka},topRight:{points:["br","tr"],overflow:ba,offset:[0,-4],targetOffset:ka},bottomLeft:{points:["tl","bl"],overflow:ba,offset:[0,4],targetOffset:ka},bottom:{points:["tc","bc"],overflow:ba,offset:[0,4],targetOffset:ka},bottomRight:{points:["tr","br"],overflow:ba,offset:[0,4],targetOffset:ka}},Hr=ca,La=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function fo(Le,Re){var Oe,We=Le.arrow,nt=We===void 0?!1:We,st=Le.prefixCls,mt=st===void 0?"rc-dropdown":st,zt=Le.transitionName,jt=Le.animation,Nn=Le.align,Qn=Le.placement,Dn=Qn===void 0?"bottomLeft":Qn,tn=Le.placements,Yt=tn===void 0?Hr:tn,fn=Le.getPopupContainer,xn=Le.showAction,Yn=Le.hideAction,$n=Le.overlayClassName,On=Le.overlayStyle,Kn=Le.visible,zn=Le.trigger,tr=zn===void 0?["hover"]:zn,$e=Le.autoFocus,Ke=Le.overlay,Ct=Le.children,ft=Le.onVisibleChange,Kt=(0,ct.Z)(Le,La),on=Ne.useState(),nn=(0,he.Z)(on,2),En=nn[0],pn=nn[1],Zt="visible"in Le?Kn:En,wn=Ne.useRef(null),kn=Ne.useRef(null),er=Ne.useRef(null);Ne.useImperativeHandle(Re,function(){return wn.current});var Mn=function(mr){pn(mr),ft==null||ft(mr)};Oi({visible:Zt,triggerRef:er,onVisibleChange:Mn,autoFocus:$e,overlayRef:kn});var dr=function(mr){var Wr=Le.onOverlayClick;pn(!1),Wr&&Wr(mr)},Lr=function(){return Ne.createElement(ua,{ref:kn,overlay:Ke,prefixCls:mt,arrow:nt})},pr=function(){return typeof Ke=="function"?Lr:Lr()},wr=function(){var mr=Le.minOverlayWidthMatchTrigger,Wr=Le.alignPoint;return"minOverlayWidthMatchTrigger"in Le?mr:!Wr},ir=function(){var mr=Le.openClassName;return mr!==void 0?mr:"".concat(mt,"-open")},yr=Ne.cloneElement(Ct,{className:ye()((Oe=Ct.props)===null||Oe===void 0?void 0:Oe.className,Zt&&ir()),ref:yn(Ct)?en(er,Ct.ref):void 0}),Ir=Yn;return!Ir&&tr.indexOf("contextMenu")!==-1&&(Ir=["click"]),Ne.createElement(ze.Z,(0,Ce.Z)({builtinPlacements:Yt},Kt,{prefixCls:mt,ref:wn,popupClassName:ye()($n,(0,Me.Z)({},"".concat(mt,"-show-arrow"),nt)),popupStyle:On,action:tr,showAction:xn,hideAction:Ir,popupPlacement:Dn,popupAlign:Nn,popupTransitionName:zt,popupAnimation:jt,popupVisible:Zt,stretch:wr()?"minWidth":"",popup:pr(),onPopupVisibleChange:Mn,onPopupClick:dr,getPopupContainer:fn}),yr)}var Za=Ne.forwardRef(fo),Wa=Za,ha=ue(78595),wt={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(Re){var Oe=Re.keyCode;if(Re.altKey&&!Re.ctrlKey||Re.metaKey||Oe>=wt.F1&&Oe<=wt.F12)return!1;switch(Oe){case wt.ALT:case wt.CAPS_LOCK:case wt.CONTEXT_MENU:case wt.CTRL:case wt.DOWN:case wt.END:case wt.ESC:case wt.HOME:case wt.INSERT:case wt.LEFT:case wt.MAC_FF_META:case wt.META:case wt.NUMLOCK:case wt.NUM_CENTER:case wt.PAGE_DOWN:case wt.PAGE_UP:case wt.PAUSE:case wt.PRINT_SCREEN:case wt.RIGHT:case wt.SHIFT:case wt.UP:case wt.WIN_KEY:case wt.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(Re){if(Re>=wt.ZERO&&Re<=wt.NINE||Re>=wt.NUM_ZERO&&Re<=wt.NUM_MULTIPLY||Re>=wt.A&&Re<=wt.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&Re===0)return!0;switch(Re){case wt.SPACE:case wt.QUESTION_MARK:case wt.NUM_PLUS:case wt.NUM_MINUS:case wt.NUM_PERIOD:case wt.NUM_DIVISION:case wt.SEMICOLON:case wt.DASH:case wt.EQUALS:case wt.COMMA:case wt.PERIOD:case wt.SLASH:case wt.APOSTROPHE:case wt.SINGLE_QUOTE:case wt.OPEN_SQUARE_BRACKET:case wt.BACKSLASH:case wt.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},_n=wt;function Tn(Le,Re){var Oe=Le.prefixCls,We=Le.id,nt=Le.tabs,st=Le.locale,mt=Le.mobile,zt=Le.moreIcon,jt=zt===void 0?"More":zt,Nn=Le.moreTransitionName,Qn=Le.style,Dn=Le.className,tn=Le.editable,Yt=Le.tabBarGutter,fn=Le.rtl,xn=Le.removeAriaLabel,Yn=Le.onTabClick,$n=Le.getPopupContainer,On=Le.popupClassName,Kn=(0,Ne.useState)(!1),zn=(0,he.Z)(Kn,2),tr=zn[0],$e=zn[1],Ke=(0,Ne.useState)(null),Ct=(0,he.Z)(Ke,2),ft=Ct[0],Kt=Ct[1],on="".concat(We,"-more-popup"),nn="".concat(Oe,"-dropdown"),En=ft!==null?"".concat(on,"-").concat(ft):null,pn=st==null?void 0:st.dropdownAriaLabel;function Zt(pr,wr){pr.preventDefault(),pr.stopPropagation(),tn.onEdit("remove",{key:wr,event:pr})}var wn=Ne.createElement(ha.ZP,{onClick:function(wr){var ir=wr.key,yr=wr.domEvent;Yn(ir,yr),$e(!1)},prefixCls:"".concat(nn,"-menu"),id:on,tabIndex:-1,role:"listbox","aria-activedescendant":En,selectedKeys:[ft],"aria-label":pn!==void 0?pn:"expanded dropdown"},nt.map(function(pr){var wr=pr.closable,ir=pr.disabled,yr=pr.closeIcon,Ir=pr.key,$r=pr.label,mr=ce(wr,yr,tn,ir);return Ne.createElement(ha.sN,{key:Ir,id:"".concat(on,"-").concat(Ir),role:"option","aria-controls":We&&"".concat(We,"-panel-").concat(Ir),disabled:ir},Ne.createElement("span",null,$r),mr&&Ne.createElement("button",{type:"button","aria-label":xn||"remove",tabIndex:0,className:"".concat(nn,"-menu-item-remove"),onClick:function(li){li.stopPropagation(),Zt(li,Ir)}},yr||tn.removeIcon||"\xD7"))}));function kn(pr){for(var wr=nt.filter(function(mr){return!mr.disabled}),ir=wr.findIndex(function(mr){return mr.key===ft})||0,yr=wr.length,Ir=0;Ir<yr;Ir+=1){ir=(ir+pr+yr)%yr;var $r=wr[ir];if(!$r.disabled){Kt($r.key);return}}}function er(pr){var wr=pr.which;if(!tr){[_n.DOWN,_n.SPACE,_n.ENTER].includes(wr)&&($e(!0),pr.preventDefault());return}switch(wr){case _n.UP:kn(-1),pr.preventDefault();break;case _n.DOWN:kn(1),pr.preventDefault();break;case _n.ESC:$e(!1);break;case _n.SPACE:case _n.ENTER:ft!==null&&Yn(ft,pr);break}}(0,Ne.useEffect)(function(){var pr=document.getElementById(En);pr&&pr.scrollIntoView&&pr.scrollIntoView(!1)},[ft]),(0,Ne.useEffect)(function(){tr||Kt(null)},[tr]);var Mn=(0,Me.Z)({},fn?"marginRight":"marginLeft",Yt);nt.length||(Mn.visibility="hidden",Mn.order=1);var dr=ye()((0,Me.Z)({},"".concat(nn,"-rtl"),fn)),Lr=mt?null:Ne.createElement(Wa,{prefixCls:nn,overlay:wn,trigger:["hover"],visible:nt.length?tr:!1,transitionName:Nn,onVisibleChange:$e,overlayClassName:ye()(dr,On),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:$n},Ne.createElement("button",{type:"button",className:"".concat(Oe,"-nav-more"),style:Mn,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":on,id:"".concat(We,"-more"),"aria-expanded":tr,onKeyDown:er},jt));return Ne.createElement("div",{className:ye()("".concat(Oe,"-nav-operations"),Dn),style:Qn,ref:Re},Lr,Ne.createElement(ve,{prefixCls:Oe,locale:st,editable:tn}))}var Pn=Ne.memo(Ne.forwardRef(Tn),function(Le,Re){return Re.tabMoving});function xr(Le){var Re,Oe=Le.prefixCls,We=Le.id,nt=Le.active,st=Le.tab,mt=st.key,zt=st.label,jt=st.disabled,Nn=st.closeIcon,Qn=Le.closable,Dn=Le.renderWrapper,tn=Le.removeAriaLabel,Yt=Le.editable,fn=Le.onClick,xn=Le.onFocus,Yn=Le.style,$n="".concat(Oe,"-tab"),On=ce(Qn,Nn,Yt,jt);function Kn($e){jt||fn($e)}function zn($e){$e.preventDefault(),$e.stopPropagation(),Yt.onEdit("remove",{key:mt,event:$e})}var tr=Ne.createElement("div",{key:mt,"data-node-key":ke(mt),className:ye()($n,(Re={},(0,Me.Z)(Re,"".concat($n,"-with-remove"),On),(0,Me.Z)(Re,"".concat($n,"-active"),nt),(0,Me.Z)(Re,"".concat($n,"-disabled"),jt),Re)),style:Yn,onClick:Kn},Ne.createElement("div",{role:"tab","aria-selected":nt,id:We&&"".concat(We,"-tab-").concat(mt),className:"".concat($n,"-btn"),"aria-controls":We&&"".concat(We,"-panel-").concat(mt),"aria-disabled":jt,tabIndex:jt?null:0,onClick:function(Ke){Ke.stopPropagation(),Kn(Ke)},onKeyDown:function(Ke){[_n.SPACE,_n.ENTER].includes(Ke.which)&&(Ke.preventDefault(),Kn(Ke))},onFocus:xn},zt),On&&Ne.createElement("button",{type:"button","aria-label":tn||"remove",tabIndex:0,className:"".concat($n,"-remove"),onClick:function(Ke){Ke.stopPropagation(),zn(Ke)}},Nn||Yt.removeIcon||"\xD7"));return Dn?Dn(tr):tr}var nr=xr,ur=function(Re){return+setTimeout(Re,16)},Hn=function(Re){return clearTimeout(Re)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(ur=function(Re){return window.requestAnimationFrame(Re)},Hn=function(Re){return window.cancelAnimationFrame(Re)});var je=0,it=new Map;function St(Le){it.delete(Le)}var Wt=function(Re){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;je+=1;var We=je;function nt(st){if(st===0)St(We),Re();else{var mt=ur(function(){nt(st-1)});it.set(We,mt)}}return nt(Oe),We};Wt.cancel=function(Le){var Re=it.get(Le);return St(Re),Hn(Re)};var He=Wt,ht=function(Re){var Oe=Re.activeTabOffset,We=Re.horizontal,nt=Re.rtl,st=Re.indicatorSize,mt=(0,Ne.useState)(),zt=(0,he.Z)(mt,2),jt=zt[0],Nn=zt[1],Qn=(0,Ne.useRef)(),Dn=function(fn){return typeof st=="function"?st(fn):typeof st=="number"?st:fn};function tn(){He.cancel(Qn.current)}return(0,Ne.useEffect)(function(){var Yt={};return Oe&&(We?(nt?(Yt.right=Oe.right+Oe.width/2,Yt.transform="translateX(50%)"):(Yt.left=Oe.left+Oe.width/2,Yt.transform="translateX(-50%)"),Yt.width=Dn(Oe.width)):(Yt.top=Oe.top+Oe.height/2,Yt.transform="translateY(-50%)",Yt.height=Dn(Oe.height))),tn(),Qn.current=He(function(){Nn(Yt)}),tn},[Oe,We,nt,st]),{style:jt}},Dt=ht,_t=function(Re){var Oe=Re.current||{},We=Oe.offsetWidth,nt=We===void 0?0:We,st=Oe.offsetHeight,mt=st===void 0?0:st;return[nt,mt]},Nt=function(Re,Oe){return Re[Oe?0:1]};function Pt(Le,Re){var Oe,We=Ne.useContext(Ue),nt=We.prefixCls,st=We.tabs,mt=Le.className,zt=Le.style,jt=Le.id,Nn=Le.animated,Qn=Le.activeKey,Dn=Le.rtl,tn=Le.extra,Yt=Le.editable,fn=Le.locale,xn=Le.tabPosition,Yn=Le.tabBarGutter,$n=Le.children,On=Le.onTabClick,Kn=Le.onTabScroll,zn=Le.indicatorSize,tr=(0,Ne.useRef)(),$e=(0,Ne.useRef)(),Ke=(0,Ne.useRef)(),Ct=(0,Ne.useRef)(),ft=(0,Ne.useRef)(),Kt=(0,Ne.useRef)(),on=(0,Ne.useRef)(),nn=xn==="top"||xn==="bottom",En=Tt(0,function(Pi,ui){nn&&Kn&&Kn({direction:Pi>ui?"left":"right"})}),pn=(0,he.Z)(En,2),Zt=pn[0],wn=pn[1],kn=Tt(0,function(Pi,ui){!nn&&Kn&&Kn({direction:Pi>ui?"top":"bottom"})}),er=(0,he.Z)(kn,2),Mn=er[0],dr=er[1],Lr=(0,Ne.useState)([0,0]),pr=(0,he.Z)(Lr,2),wr=pr[0],ir=pr[1],yr=(0,Ne.useState)([0,0]),Ir=(0,he.Z)(yr,2),$r=Ir[0],mr=Ir[1],Wr=(0,Ne.useState)([0,0]),li=(0,he.Z)(Wr,2),Ii=li[0],Ci=li[1],di=(0,Ne.useState)([0,0]),ki=(0,he.Z)(di,2),Li=ki[0],Gr=ki[1],fi=sn(new Map),Ar=(0,he.Z)(fi,2),Ur=Ar[0],ri=Ar[1],Mi=Ee(st,Ur,$r[0]),Ba=Nt(wr,nn),Oa=Nt($r,nn),Sa=Nt(Ii,nn),Ui=Nt(Li,nn),Ai=Ba<Oa+Sa,Jr=Ai?Ba-Ui:Ba-Sa,Ta="".concat(nt,"-nav-operations-hidden"),ei=0,Pr=0;nn&&Dn?(ei=0,Pr=Math.max(0,Oa-Jr)):(ei=Math.min(0,Jr-Oa),Pr=0);function pi(Pi){return Pi<ei?ei:Pi>Pr?Pr:Pi}var Zi=(0,Ne.useRef)(),xi=(0,Ne.useState)(),Ni=(0,he.Z)(xi,2),Zr=Ni[0],Ji=Ni[1];function oa(){Ji(Date.now())}function qi(){window.clearTimeout(Zi.current)}Ht(Ct,function(Pi,ui){function Ca(va,lo){va(function(io){var hs=pi(io+lo);return hs})}return Ai?(nn?Ca(wn,Pi):Ca(dr,ui),qi(),oa(),!0):!1}),(0,Ne.useEffect)(function(){return qi(),Zr&&(Zi.current=window.setTimeout(function(){Ji(0)},100)),qi},[Zr]);var sa=Bt(Mi,Jr,nn?Zt:Mn,Oa,Sa,Ui,(0,we.Z)((0,we.Z)({},Le),{},{tabs:st})),ma=(0,he.Z)(sa,2),Va=ma[0],Yi=ma[1],ga=ut(function(){var Pi=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Qn,ui=Mi.get(Pi)||{width:0,height:0,left:0,right:0,top:0};if(nn){var Ca=Zt;Dn?ui.right<Zt?Ca=ui.right:ui.right+ui.width>Zt+Jr&&(Ca=ui.right+ui.width-Jr):ui.left<-Zt?Ca=-ui.left:ui.left+ui.width>-Zt+Jr&&(Ca=-(ui.left+ui.width-Jr)),dr(0),wn(pi(Ca))}else{var va=Mn;ui.top<-Mn?va=-ui.top:ui.top+ui.height>-Mn+Jr&&(va=-(ui.top+ui.height-Jr)),wn(0),dr(pi(va))}}),Ya={};xn==="top"||xn==="bottom"?Ya[Dn?"marginRight":"marginLeft"]=Yn:Ya.marginTop=Yn;var ja=st.map(function(Pi,ui){var Ca=Pi.key;return Ne.createElement(nr,{id:jt,prefixCls:nt,key:Ca,tab:Pi,style:ui===0?void 0:Ya,closable:Pi.closable,editable:Yt,active:Ca===Qn,renderWrapper:$n,removeAriaLabel:fn==null?void 0:fn.removeAriaLabel,onClick:function(lo){On(Ca,lo)},onFocus:function(){ga(Ca),oa(),Ct.current&&(Dn||(Ct.current.scrollLeft=0),Ct.current.scrollTop=0)}})}),oo=function(){return ri(function(){var ui=new Map;return st.forEach(function(Ca){var va,lo=Ca.key,io=(va=ft.current)===null||va===void 0?void 0:va.querySelector('[data-node-key="'.concat(ke(lo),'"]'));io&&ui.set(lo,{width:io.offsetWidth,height:io.offsetHeight,left:io.offsetLeft,top:io.offsetTop})}),ui})};(0,Ne.useEffect)(function(){oo()},[st.map(function(Pi){return Pi.key}).join("_")]);var Ra=Sn(function(){var Pi=_t(tr),ui=_t($e),Ca=_t(Ke);ir([Pi[0]-ui[0]-Ca[0],Pi[1]-ui[1]-Ca[1]]);var va=_t(on);Ci(va);var lo=_t(Kt);Gr(lo);var io=_t(ft);mr([io[0]-va[0],io[1]-va[1]]),oo()}),da=st.slice(0,Va),ti=st.slice(Yi+1),mi=[].concat((0,Ge.Z)(da),(0,Ge.Z)(ti)),ji=Mi.get(Qn),la=Dt({activeTabOffset:ji,horizontal:nn,rtl:Dn,indicatorSize:zn}),Fa=la.style;(0,Ne.useEffect)(function(){ga()},[Qn,ei,Pr,bn(ji),bn(Mi),nn]),(0,Ne.useEffect)(function(){Ra()},[Dn]);var ro=!!mi.length,ho="".concat(nt,"-nav-wrap"),Bo,Oo,so,Ao;return nn?Dn?(Oo=Zt>0,Bo=Zt!==Pr):(Bo=Zt<0,Oo=Zt!==ei):(so=Mn<0,Ao=Mn!==ei),Ne.createElement(Ot.Z,{onResize:Ra},Ne.createElement("div",{ref:An(Re,tr),role:"tablist",className:ye()("".concat(nt,"-nav"),mt),style:zt,onKeyDown:function(){oa()}},Ne.createElement(oe,{ref:$e,position:"left",extra:tn,prefixCls:nt}),Ne.createElement(Ot.Z,{onResize:Ra},Ne.createElement("div",{className:ye()(ho,(Oe={},(0,Me.Z)(Oe,"".concat(ho,"-ping-left"),Bo),(0,Me.Z)(Oe,"".concat(ho,"-ping-right"),Oo),(0,Me.Z)(Oe,"".concat(ho,"-ping-top"),so),(0,Me.Z)(Oe,"".concat(ho,"-ping-bottom"),Ao),Oe)),ref:Ct},Ne.createElement(Ot.Z,{onResize:Ra},Ne.createElement("div",{ref:ft,className:"".concat(nt,"-nav-list"),style:{transform:"translate(".concat(Zt,"px, ").concat(Mn,"px)"),transition:Zr?"none":void 0}},ja,Ne.createElement(ve,{ref:on,prefixCls:nt,locale:fn,editable:Yt,style:(0,we.Z)((0,we.Z)({},ja.length===0?void 0:Ya),{},{visibility:ro?"hidden":null})}),Ne.createElement("div",{className:ye()("".concat(nt,"-ink-bar"),(0,Me.Z)({},"".concat(nt,"-ink-bar-animated"),Nn.inkBar)),style:Fa}))))),Ne.createElement(Pn,(0,Ce.Z)({},Le,{removeAriaLabel:fn==null?void 0:fn.removeAriaLabel,ref:Kt,prefixCls:nt,tabs:mi,className:!ro&&Ta,tabMoving:!!Zr})),Ne.createElement(oe,{ref:Ke,position:"right",extra:tn,prefixCls:nt})))}var Bn=Ne.forwardRef(Pt),cr=["renderTabBar"],Wn=["label","key"];function Un(Le){var Re=Le.renderTabBar,Oe=(0,ct.Z)(Le,cr),We=Ne.useContext(Ue),nt=We.tabs;if(Re){var st=(0,we.Z)((0,we.Z)({},Oe),{},{panes:nt.map(function(mt){var zt=mt.label,jt=mt.key,Nn=(0,ct.Z)(mt,Wn);return Ne.createElement(At,(0,Ce.Z)({tab:zt,key:jt,tabKey:jt},Nn))})});return Re(st,Bn)}return Ne.createElement(Bn,Oe)}var qn={},Jn=[],Mr=function(Re){Jn.push(Re)};function an(Le,Re){if(0)var Oe}function Fn(Le,Re){if(0)var Oe}function ci(){qn={}}function gi(Le,Re,Oe){!Re&&!qn[Oe]&&(Le(!1,Oe),qn[Oe]=!0)}function Vr(Le,Re){gi(an,Le,Re)}function Dr(Le,Re){gi(Fn,Le,Re)}Vr.preMessage=Mr,Vr.resetWarned=ci,Vr.noteOnce=Dr;var wi=null;function or(){var Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},Re;return Le===!1?Re={inkBar:!1,tabPane:!1}:Le===!0?Re={inkBar:!0,tabPane:!1}:Re=(0,we.Z)({inkBar:!0},(0,De.Z)(Le)==="object"?Le:{}),Re.tabPaneMotion&&Re.tabPane===void 0&&(Re.tabPane=!0),!Re.tabPaneMotion&&Re.tabPane&&(Re.tabPane=!1),Re}var oi=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicatorSize"],hn=0;function Vi(Le,Re){var Oe,We=Le.id,nt=Le.prefixCls,st=nt===void 0?"rc-tabs":nt,mt=Le.className,zt=Le.items,jt=Le.direction,Nn=Le.activeKey,Qn=Le.defaultActiveKey,Dn=Le.editable,tn=Le.animated,Yt=Le.tabPosition,fn=Yt===void 0?"top":Yt,xn=Le.tabBarGutter,Yn=Le.tabBarStyle,$n=Le.tabBarExtraContent,On=Le.locale,Kn=Le.moreIcon,zn=Le.moreTransitionName,tr=Le.destroyInactiveTabPane,$e=Le.renderTabBar,Ke=Le.onChange,Ct=Le.onTabClick,ft=Le.onTabScroll,Kt=Le.getPopupContainer,on=Le.popupClassName,nn=Le.indicatorSize,En=(0,ct.Z)(Le,oi),pn=Ne.useMemo(function(){return(zt||[]).filter(function(Gr){return Gr&&(0,De.Z)(Gr)==="object"&&"key"in Gr})},[zt]),Zt=jt==="rtl",wn=or(tn),kn=(0,Ne.useState)(!1),er=(0,he.Z)(kn,2),Mn=er[0],dr=er[1];(0,Ne.useEffect)(function(){dr(Mt())},[]);var Lr=Ie(function(){var Gr;return(Gr=pn[0])===null||Gr===void 0?void 0:Gr.key},{value:Nn,defaultValue:Qn}),pr=(0,he.Z)(Lr,2),wr=pr[0],ir=pr[1],yr=(0,Ne.useState)(function(){return pn.findIndex(function(Gr){return Gr.key===wr})}),Ir=(0,he.Z)(yr,2),$r=Ir[0],mr=Ir[1];(0,Ne.useEffect)(function(){var Gr=pn.findIndex(function(Ar){return Ar.key===wr});if(Gr===-1){var fi;Gr=Math.max(0,Math.min($r,pn.length-1)),ir((fi=pn[Gr])===null||fi===void 0?void 0:fi.key)}mr(Gr)},[pn.map(function(Gr){return Gr.key}).join("_"),wr,$r]);var Wr=Ie(null,{value:We}),li=(0,he.Z)(Wr,2),Ii=li[0],Ci=li[1];(0,Ne.useEffect)(function(){We||(Ci("rc-tabs-".concat(hn)),hn+=1)},[]);function di(Gr,fi){Ct==null||Ct(Gr,fi);var Ar=Gr!==wr;ir(Gr),Ar&&(Ke==null||Ke(Gr))}var ki={id:Ii,activeKey:wr,animated:wn,tabPosition:fn,rtl:Zt,mobile:Mn},Li=(0,we.Z)((0,we.Z)({},ki),{},{editable:Dn,locale:On,moreIcon:Kn,moreTransitionName:zn,tabBarGutter:xn,onTabClick:di,onTabScroll:ft,extra:$n,style:Yn,panes:null,getPopupContainer:Kt,popupClassName:on,indicatorSize:nn});return Ne.createElement(Ue.Provider,{value:{tabs:pn,prefixCls:st}},Ne.createElement("div",(0,Ce.Z)({ref:Re,id:We,className:ye()(st,"".concat(st,"-").concat(fn),(Oe={},(0,Me.Z)(Oe,"".concat(st,"-mobile"),Mn),(0,Me.Z)(Oe,"".concat(st,"-editable"),Dn),(0,Me.Z)(Oe,"".concat(st,"-rtl"),Zt),Oe),mt)},En),Ne.createElement(Un,(0,Ce.Z)({},Li,{renderTabBar:$e})),Ne.createElement(xt,(0,Ce.Z)({destroyInactiveTabPane:tr},ki,{animated:wn}))))}var Si=Ne.forwardRef(Vi),pa=Si,Wi=pa,_i=ue(53124),ia=ue(98675),yi=()=>null,Gi=ue(33603);const xa={motionAppear:!1,motionEnter:!0,motionLeave:!0};function Xi(Le){let Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},Oe;return Re===!1?Oe={inkBar:!1,tabPane:!1}:Re===!0?Oe={inkBar:!0,tabPane:!0}:Oe=Object.assign({inkBar:!0},typeof Re=="object"?Re:{}),Oe.tabPane&&(Oe.tabPaneMotion=Object.assign(Object.assign({},xa),{motionName:(0,Gi.m)(Le,"switch")})),Oe}var Ti=ue(37419),wa=function(Le,Re){var Oe={};for(var We in Le)Object.prototype.hasOwnProperty.call(Le,We)&&Re.indexOf(We)<0&&(Oe[We]=Le[We]);if(Le!=null&&typeof Object.getOwnPropertySymbols=="function")for(var nt=0,We=Object.getOwnPropertySymbols(Le);nt<We.length;nt++)Re.indexOf(We[nt])<0&&Object.prototype.propertyIsEnumerable.call(Le,We[nt])&&(Oe[We[nt]]=Le[We[nt]]);return Oe};function Aa(Le){return Le.filter(Re=>Re)}function aa(Le,Re){if(Le)return Le;const Oe=(0,Ti.Z)(Re).map(We=>{if(Ne.isValidElement(We)){const{key:nt,props:st}=We,mt=st||{},{tab:zt}=mt,jt=wa(mt,["tab"]);return Object.assign(Object.assign({key:String(nt)},jt),{label:zt})}return null});return Aa(Oe)}var ni=ue(14747),pt=ue(67968),dt=ue(45503),It=ue(67771),Cn=Le=>{const{componentCls:Re,motionDurationSlow:Oe}=Le;return[{[Re]:{[`${Re}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${Oe}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${Oe}`}}}}},[(0,It.oN)(Le,"slide-up"),(0,It.oN)(Le,"slide-down")]]};const vr=Le=>{const{componentCls:Re,tabsCardPadding:Oe,cardBg:We,cardGutter:nt,colorBorderSecondary:st,itemSelectedColor:mt}=Le;return{[`${Re}-card`]:{[`> ${Re}-nav, > div > ${Re}-nav`]:{[`${Re}-tab`]:{margin:0,padding:Oe,background:We,border:`${Le.lineWidth}px ${Le.lineType} ${st}`,transition:`all ${Le.motionDurationSlow} ${Le.motionEaseInOut}`},[`${Re}-tab-active`]:{color:mt,background:Le.colorBgContainer},[`${Re}-ink-bar`]:{visibility:"hidden"}},[`&${Re}-top, &${Re}-bottom`]:{[`> ${Re}-nav, > div > ${Re}-nav`]:{[`${Re}-tab + ${Re}-tab`]:{marginLeft:{_skip_check_:!0,value:`${nt}px`}}}},[`&${Re}-top`]:{[`> ${Re}-nav, > div > ${Re}-nav`]:{[`${Re}-tab`]:{borderRadius:`${Le.borderRadiusLG}px ${Le.borderRadiusLG}px 0 0`},[`${Re}-tab-active`]:{borderBottomColor:Le.colorBgContainer}}},[`&${Re}-bottom`]:{[`> ${Re}-nav, > div > ${Re}-nav`]:{[`${Re}-tab`]:{borderRadius:`0 0 ${Le.borderRadiusLG}px ${Le.borderRadiusLG}px`},[`${Re}-tab-active`]:{borderTopColor:Le.colorBgContainer}}},[`&${Re}-left, &${Re}-right`]:{[`> ${Re}-nav, > div > ${Re}-nav`]:{[`${Re}-tab + ${Re}-tab`]:{marginTop:`${nt}px`}}},[`&${Re}-left`]:{[`> ${Re}-nav, > div > ${Re}-nav`]:{[`${Re}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Le.borderRadiusLG}px 0 0 ${Le.borderRadiusLG}px`}},[`${Re}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:Le.colorBgContainer}}}},[`&${Re}-right`]:{[`> ${Re}-nav, > div > ${Re}-nav`]:{[`${Re}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Le.borderRadiusLG}px ${Le.borderRadiusLG}px 0`}},[`${Re}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:Le.colorBgContainer}}}}}}},gr=Le=>{const{componentCls:Re,itemHoverColor:Oe,dropdownEdgeChildVerticalPadding:We}=Le;return{[`${Re}-dropdown`]:Object.assign(Object.assign({},(0,ni.Wf)(Le)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:Le.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${Re}-dropdown-menu`]:{maxHeight:Le.tabsDropdownHeight,margin:0,padding:`${We}px 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:Le.colorBgContainer,backgroundClip:"padding-box",borderRadius:Le.borderRadiusLG,outline:"none",boxShadow:Le.boxShadowSecondary,"&-item":Object.assign(Object.assign({},ni.vS),{display:"flex",alignItems:"center",minWidth:Le.tabsDropdownWidth,margin:0,padding:`${Le.paddingXXS}px ${Le.paddingSM}px`,color:Le.colorText,fontWeight:"normal",fontSize:Le.fontSize,lineHeight:Le.lineHeight,cursor:"pointer",transition:`all ${Le.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:Le.marginSM},color:Le.colorTextDescription,fontSize:Le.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:Oe}},"&:hover":{background:Le.controlItemBgHover},"&-disabled":{"&, &:hover":{color:Le.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},Er=Le=>{const{componentCls:Re,margin:Oe,colorBorderSecondary:We,horizontalMargin:nt,verticalItemPadding:st,verticalItemMargin:mt}=Le;return{[`${Re}-top, ${Re}-bottom`]:{flexDirection:"column",[`> ${Re}-nav, > div > ${Re}-nav`]:{margin:nt,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${Le.lineWidth}px ${Le.lineType} ${We}`,content:"''"},[`${Re}-ink-bar`]:{height:Le.lineWidthBold,"&-animated":{transition:`width ${Le.motionDurationSlow}, left ${Le.motionDurationSlow},
right ${Le.motionDurationSlow}`}},[`${Re}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:Le.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:Le.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:Le.boxShadowTabsOverflowRight},[`&${Re}-nav-wrap-ping-left::before`]:{opacity:1},[`&${Re}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${Re}-top`]:{[`> ${Re}-nav,
> div > ${Re}-nav`]:{"&::before":{bottom:0},[`${Re}-ink-bar`]:{bottom:0}}},[`${Re}-bottom`]:{[`> ${Re}-nav, > div > ${Re}-nav`]:{order:1,marginTop:`${Oe}px`,marginBottom:0,"&::before":{top:0},[`${Re}-ink-bar`]:{top:0}},[`> ${Re}-content-holder, > div > ${Re}-content-holder`]:{order:0}},[`${Re}-left, ${Re}-right`]:{[`> ${Re}-nav, > div > ${Re}-nav`]:{flexDirection:"column",minWidth:Le.controlHeight*1.25,[`${Re}-tab`]:{padding:st,textAlign:"center"},[`${Re}-tab + ${Re}-tab`]:{margin:mt},[`${Re}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:Le.controlHeight},"&::before":{top:0,boxShadow:Le.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:Le.boxShadowTabsOverflowBottom},[`&${Re}-nav-wrap-ping-top::before`]:{opacity:1},[`&${Re}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${Re}-ink-bar`]:{width:Le.lineWidthBold,"&-animated":{transition:`height ${Le.motionDurationSlow}, top ${Le.motionDurationSlow}`}},[`${Re}-nav-list, ${Re}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${Re}-left`]:{[`> ${Re}-nav, > div > ${Re}-nav`]:{[`${Re}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${Re}-content-holder, > div > ${Re}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${Le.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${Le.lineWidth}px ${Le.lineType} ${Le.colorBorder}`},[`> ${Re}-content > ${Re}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:Le.paddingLG}}}},[`${Re}-right`]:{[`> ${Re}-nav, > div > ${Re}-nav`]:{order:1,[`${Re}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${Re}-content-holder, > div > ${Re}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-Le.lineWidth},borderRight:{_skip_check_:!0,value:`${Le.lineWidth}px ${Le.lineType} ${Le.colorBorder}`},[`> ${Re}-content > ${Re}-tabpane`]:{paddingRight:{_skip_check_:!0,value:Le.paddingLG}}}}}},Br=Le=>{const{componentCls:Re,cardPaddingSM:Oe,cardPaddingLG:We,horizontalItemPaddingSM:nt,horizontalItemPaddingLG:st}=Le;return{[Re]:{"&-small":{[`> ${Re}-nav`]:{[`${Re}-tab`]:{padding:nt,fontSize:Le.titleFontSizeSM}}},"&-large":{[`> ${Re}-nav`]:{[`${Re}-tab`]:{padding:st,fontSize:Le.titleFontSizeLG}}}},[`${Re}-card`]:{[`&${Re}-small`]:{[`> ${Re}-nav`]:{[`${Re}-tab`]:{padding:Oe}},[`&${Re}-bottom`]:{[`> ${Re}-nav ${Re}-tab`]:{borderRadius:`0 0 ${Le.borderRadius}px ${Le.borderRadius}px`}},[`&${Re}-top`]:{[`> ${Re}-nav ${Re}-tab`]:{borderRadius:`${Le.borderRadius}px ${Le.borderRadius}px 0 0`}},[`&${Re}-right`]:{[`> ${Re}-nav ${Re}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Le.borderRadius}px ${Le.borderRadius}px 0`}}},[`&${Re}-left`]:{[`> ${Re}-nav ${Re}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Le.borderRadius}px 0 0 ${Le.borderRadius}px`}}}},[`&${Re}-large`]:{[`> ${Re}-nav`]:{[`${Re}-tab`]:{padding:We}}}}}},kr=Le=>{const{componentCls:Re,itemActiveColor:Oe,itemHoverColor:We,iconCls:nt,tabsHorizontalItemMargin:st,horizontalItemPadding:mt,itemSelectedColor:zt,itemColor:jt}=Le,Nn=`${Re}-tab`;return{[Nn]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:mt,fontSize:Le.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:jt,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:Oe}},(0,ni.Qy)(Le)),"&-btn":{outline:"none",transition:"all 0.3s"},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:-Le.marginXXS},marginLeft:{_skip_check_:!0,value:Le.marginXS},color:Le.colorTextDescription,fontSize:Le.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${Le.motionDurationSlow}`,"&:hover":{color:Le.colorTextHeading}},"&:hover":{color:We},[`&${Nn}-active ${Nn}-btn`]:{color:zt,textShadow:Le.tabsActiveTextShadow},[`&${Nn}-disabled`]:{color:Le.colorTextDisabled,cursor:"not-allowed"},[`&${Nn}-disabled ${Nn}-btn, &${Nn}-disabled ${Re}-remove`]:{"&:focus, &:active":{color:Le.colorTextDisabled}},[`& ${Nn}-remove ${nt}`]:{margin:0},[nt]:{marginRight:{_skip_check_:!0,value:Le.marginSM}}},[`${Nn} + ${Nn}`]:{margin:{_skip_check_:!0,value:st}}}},Yr=Le=>{const{componentCls:Re,tabsHorizontalItemMarginRTL:Oe,iconCls:We,cardGutter:nt}=Le;return{[`${Re}-rtl`]:{direction:"rtl",[`${Re}-nav`]:{[`${Re}-tab`]:{margin:{_skip_check_:!0,value:Oe},[`${Re}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[We]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${Le.marginSM}px`}},[`${Re}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${Le.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${Le.marginXXS}px`},[We]:{margin:0}}}},[`&${Re}-left`]:{[`> ${Re}-nav`]:{order:1},[`> ${Re}-content-holder`]:{order:0}},[`&${Re}-right`]:{[`> ${Re}-nav`]:{order:0},[`> ${Re}-content-holder`]:{order:1}},[`&${Re}-card${Re}-top, &${Re}-card${Re}-bottom`]:{[`> ${Re}-nav, > div > ${Re}-nav`]:{[`${Re}-tab + ${Re}-tab`]:{marginRight:{_skip_check_:!0,value:nt},marginLeft:{_skip_check_:!0,value:0}}}}},[`${Re}-dropdown-rtl`]:{direction:"rtl"},[`${Re}-menu-item`]:{[`${Re}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},si=Le=>{const{componentCls:Re,tabsCardPadding:Oe,cardHeight:We,cardGutter:nt,itemHoverColor:st,itemActiveColor:mt,colorBorderSecondary:zt}=Le;return{[Re]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,ni.Wf)(Le)),{display:"flex",[`> ${Re}-nav, > div > ${Re}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${Re}-nav-wrap`]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:`opacity ${Le.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${Re}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${Le.motionDurationSlow}`},[`${Re}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${Re}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${Re}-nav-more`]:{position:"relative",padding:Oe,background:"transparent",border:0,color:Le.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:Le.controlHeightLG/8,transform:"translateY(100%)",content:"''"}},[`${Re}-nav-add`]:Object.assign({minWidth:We,marginLeft:{_skip_check_:!0,value:nt},padding:`0 ${Le.paddingXS}px`,background:"transparent",border:`${Le.lineWidth}px ${Le.lineType} ${zt}`,borderRadius:`${Le.borderRadiusLG}px ${Le.borderRadiusLG}px 0 0`,outline:"none",cursor:"pointer",color:Le.colorText,transition:`all ${Le.motionDurationSlow} ${Le.motionEaseInOut}`,"&:hover":{color:st},"&:active, &:focus:not(:focus-visible)":{color:mt}},(0,ni.Qy)(Le))},[`${Re}-extra-content`]:{flex:"none"},[`${Re}-ink-bar`]:{position:"absolute",background:Le.inkBarColor,pointerEvents:"none"}}),kr(Le)),{[`${Re}-content`]:{position:"relative",width:"100%"},[`${Re}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${Re}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${Re}-centered`]:{[`> ${Re}-nav, > div > ${Re}-nav`]:{[`${Re}-nav-wrap`]:{[`&:not([class*='${Re}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}};var bi=(0,pt.Z)("Tabs",Le=>{const Re=(0,dt.TS)(Le,{tabsCardPadding:Le.cardPadding||`${(Le.cardHeight-Math.round(Le.fontSize*Le.lineHeight))/2-Le.lineWidth}px ${Le.padding}px`,dropdownEdgeChildVerticalPadding:Le.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${Le.horizontalItemGutter}px`,tabsHorizontalItemMarginRTL:`0 0 0 ${Le.horizontalItemGutter}px`});return[Br(Re),Yr(Re),Er(Re),gr(Re),vr(Re),si(Re),Cn(Re)]},Le=>{const Re=Le.controlHeightLG;return{zIndexPopup:Le.zIndexPopupBase+50,cardBg:Le.colorFillAlter,cardHeight:Re,cardPadding:"",cardPaddingSM:`${Le.paddingXXS*1.5}px ${Le.padding}px`,cardPaddingLG:`${Le.paddingXS}px ${Le.padding}px ${Le.paddingXXS*1.5}px`,titleFontSize:Le.fontSize,titleFontSizeLG:Le.fontSizeLG,titleFontSizeSM:Le.fontSize,inkBarColor:Le.colorPrimary,horizontalMargin:`0 0 ${Le.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${Le.paddingSM}px 0`,horizontalItemPaddingSM:`${Le.paddingXS}px 0`,horizontalItemPaddingLG:`${Le.padding}px 0`,verticalItemPadding:`${Le.paddingXS}px ${Le.paddingLG}px`,verticalItemMargin:`${Le.margin}px 0 0 0`,itemColor:Le.colorText,itemSelectedColor:Le.colorPrimary,itemHoverColor:Le.colorPrimaryHover,itemActiveColor:Le.colorPrimaryActive,cardGutter:Le.marginXXS/2}}),Hi=function(Le,Re){var Oe={};for(var We in Le)Object.prototype.hasOwnProperty.call(Le,We)&&Re.indexOf(We)<0&&(Oe[We]=Le[We]);if(Le!=null&&typeof Object.getOwnPropertySymbols=="function")for(var nt=0,We=Object.getOwnPropertySymbols(Le);nt<We.length;nt++)Re.indexOf(We[nt])<0&&Object.prototype.propertyIsEnumerable.call(Le,We[nt])&&(Oe[We[nt]]=Le[We[nt]]);return Oe};const Ri=Le=>{const{type:Re,className:Oe,rootClassName:We,size:nt,onEdit:st,hideAdd:mt,centered:zt,addIcon:jt,popupClassName:Nn,children:Qn,items:Dn,animated:tn,style:Yt,indicatorSize:fn}=Le,xn=Hi(Le,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize"]),{prefixCls:Yn,moreIcon:$n=Ne.createElement(tt.Z,null)}=xn,{direction:On,tabs:Kn,getPrefixCls:zn,getPopupContainer:tr}=Ne.useContext(_i.E_),$e=zn("tabs",Yn),[Ke,Ct]=bi($e);let ft;Re==="editable-card"&&(ft={onEdit:(Zt,wn)=>{let{key:kn,event:er}=wn;st==null||st(Zt==="add"?er:kn,Zt)},removeIcon:Ne.createElement(be.Z,null),addIcon:jt||Ne.createElement(Fe.Z,null),showAdd:mt!==!0});const Kt=zn(),on=aa(Dn,Qn),nn=Xi($e,tn),En=(0,ia.Z)(nt),pn=Object.assign(Object.assign({},Kn==null?void 0:Kn.style),Yt);return Ke(Ne.createElement(Wi,Object.assign({direction:On,getPopupContainer:tr,moreTransitionName:`${Kt}-slide-up`},xn,{items:on,className:ye()({[`${$e}-${En}`]:En,[`${$e}-card`]:["card","editable-card"].includes(Re),[`${$e}-editable-card`]:Re==="editable-card",[`${$e}-centered`]:zt},Kn==null?void 0:Kn.className,Oe,We,Ct),popupClassName:ye()(Nn,Ct),style:pn,editable:ft,moreIcon:$n,prefixCls:$e,animated:nn,indicatorSize:fn!=null?fn:Kn==null?void 0:Kn.indicatorSize})))};Ri.TabPane=yi;var Di=Ri},41771:function(mn,Ut){"use strict";var ue;var be=typeof Symbol=="function"&&Symbol.for,tt=be?Symbol.for("react.element"):60103,Fe=be?Symbol.for("react.portal"):60106,qe=be?Symbol.for("react.fragment"):60107,ye=be?Symbol.for("react.strict_mode"):60108,Ce=be?Symbol.for("react.profiler"):60114,Me=be?Symbol.for("react.provider"):60109,we=be?Symbol.for("react.context"):60110,he=be?Symbol.for("react.async_mode"):60111,De=be?Symbol.for("react.concurrent_mode"):60111,ct=be?Symbol.for("react.forward_ref"):60112,Ne=be?Symbol.for("react.suspense"):60113,Mt=be?Symbol.for("react.suspense_list"):60120,ut=be?Symbol.for("react.memo"):60115,Qe=be?Symbol.for("react.lazy"):60116,Xe=be?Symbol.for("react.block"):60121,Te=be?Symbol.for("react.fundamental"):60117,Et=be?Symbol.for("react.responder"):60118,Lt=be?Symbol.for("react.scope"):60119;function et(Ie){if(typeof Ie=="object"&&Ie!==null){var _e=Ie.$$typeof;switch(_e){case tt:switch(Ie=Ie.type,Ie){case he:case De:case qe:case Ce:case ye:case Ne:return Ie;default:switch(Ie=Ie&&Ie.$$typeof,Ie){case we:case ct:case Qe:case ut:case Me:return Ie;default:return _e}}case Fe:return _e}}}function lt(Ie){return et(Ie)===De}ue=he,ue=De,ue=we,ue=Me,ue=tt,ue=ct,ue=qe,ue=Qe,ue=ut,ue=Fe,ue=Ce,ue=ye,ue=Ne,ue=function(Ie){return lt(Ie)||et(Ie)===he},ue=lt,ue=function(Ie){return et(Ie)===we},ue=function(Ie){return et(Ie)===Me},ue=function(Ie){return typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===tt},ue=function(Ie){return et(Ie)===ct},Ut.isFragment=function(Ie){return et(Ie)===qe},ue=function(Ie){return et(Ie)===Qe},ue=function(Ie){return et(Ie)===ut},ue=function(Ie){return et(Ie)===Fe},ue=function(Ie){return et(Ie)===Ce},ue=function(Ie){return et(Ie)===ye},ue=function(Ie){return et(Ie)===Ne},ue=function(Ie){return typeof Ie=="string"||typeof Ie=="function"||Ie===qe||Ie===De||Ie===Ce||Ie===ye||Ie===Ne||Ie===Mt||typeof Ie=="object"&&Ie!==null&&(Ie.$$typeof===Qe||Ie.$$typeof===ut||Ie.$$typeof===Me||Ie.$$typeof===we||Ie.$$typeof===ct||Ie.$$typeof===Te||Ie.$$typeof===Et||Ie.$$typeof===Lt||Ie.$$typeof===Xe)},ue=et},47655:function(mn,Ut,ue){"use strict";mn.exports=ue(41771)},64701:function(mn,Ut,ue){"use strict";ue.r(Ut),ue.d(Ut,{ResizableTextArea:function(){return gn},default:function(){return sn}});var be=ue(87462),tt=ue(1413),Fe=ue(4942),qe=ue(71002),ye=ue(97685),Ce=ue(45987),Me=ue(74902),we=ue(94184),he=ue.n(we),De=ue(67656),ct=ue(87887),Ne=ue(67294);function Mt($t){var Bt=Ne.useRef();Bt.current=$t;var bn=Ne.useCallback(function(){for(var dn,ke=arguments.length,ce=new Array(ke),le=0;le<ke;le++)ce[le]=arguments[le];return(dn=Bt.current)===null||dn===void 0?void 0:dn.call.apply(dn,[Bt].concat(ce))},[]);return bn}function ut(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Qe=ut()?Ne.useLayoutEffect:Ne.useEffect,Xe=Qe,Te=function(Bt,bn){var dn=Ne.useRef(!0);Qe(function(){if(!dn.current)return Bt()},bn),Qe(function(){return dn.current=!1,function(){dn.current=!0}},[])};function Et($t){var Bt=Ne.useRef(!1),bn=Ne.useState($t),dn=(0,ye.Z)(bn,2),ke=dn[0],ce=dn[1];Ne.useEffect(function(){return Bt.current=!1,function(){Bt.current=!0}},[]);function le(ve,pe){pe&&Bt.current||ce(ve)}return[ke,le]}function Lt($t){return $t!==void 0}function et($t,Bt){var bn=Bt||{},dn=bn.defaultValue,ke=bn.value,ce=bn.onChange,le=bn.postState,ve=Et(function(){return Lt(ke)?ke:Lt(dn)?typeof dn=="function"?dn():dn:typeof $t=="function"?$t():$t}),pe=(0,ye.Z)(ve,2),oe=pe[0],ze=pe[1],yt=ke!==void 0?ke:oe,Vt=le?le(yt):yt,en=Mt(ce),un=Et([yt]),yn=(0,ye.Z)(un,2),Jt=yn[0],Cr=yn[1];Te(function(){var Rt=Jt[0];oe!==Rt&&en(oe,Rt)},[Jt]),Te(function(){Lt(ke)||ze(ke)},[ke]);var Tr=Mt(function(Rt,Ln){ze(Rt,Ln),Cr([yt],Ln)});return[Vt,Tr]}var lt=ue(48555),Ie=function(Bt){return+setTimeout(Bt,16)},_e=function(Bt){return clearTimeout(Bt)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(Ie=function(Bt){return window.requestAnimationFrame(Bt)},_e=function(Bt){return window.cancelAnimationFrame(Bt)});var Ue=0,Ze=new Map;function At($t){Ze.delete($t)}var bt=function(Bt){var bn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Ue+=1;var dn=Ue;function ke(ce){if(ce===0)At(dn),Bt();else{var le=Ie(function(){ke(ce-1)});Ze.set(dn,le)}}return ke(bn),dn};bt.cancel=function($t){var Bt=Ze.get($t);return At(Bt),_e(Bt)};var xt=bt,Ge=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important;
pointer-events: none !important;
`,Ot=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],kt={},vn;function qt($t){var Bt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,bn=$t.getAttribute("id")||$t.getAttribute("data-reactid")||$t.getAttribute("name");if(Bt&&kt[bn])return kt[bn];var dn=window.getComputedStyle($t),ke=dn.getPropertyValue("box-sizing")||dn.getPropertyValue("-moz-box-sizing")||dn.getPropertyValue("-webkit-box-sizing"),ce=parseFloat(dn.getPropertyValue("padding-bottom"))+parseFloat(dn.getPropertyValue("padding-top")),le=parseFloat(dn.getPropertyValue("border-bottom-width"))+parseFloat(dn.getPropertyValue("border-top-width")),ve=Ot.map(function(oe){return"".concat(oe,":").concat(dn.getPropertyValue(oe))}).join(";"),pe={sizingStyle:ve,paddingSize:ce,borderSize:le,boxSizing:ke};return Bt&&bn&&(kt[bn]=pe),pe}function cn($t){var Bt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,bn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,dn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;vn||(vn=document.createElement("textarea"),vn.setAttribute("tab-index","-1"),vn.setAttribute("aria-hidden","true"),document.body.appendChild(vn)),$t.getAttribute("wrap")?vn.setAttribute("wrap",$t.getAttribute("wrap")):vn.removeAttribute("wrap");var ke=qt($t,Bt),ce=ke.paddingSize,le=ke.borderSize,ve=ke.boxSizing,pe=ke.sizingStyle;vn.setAttribute("style","".concat(pe,";").concat(Ge)),vn.value=$t.value||$t.placeholder||"";var oe=void 0,ze=void 0,yt,Vt=vn.scrollHeight;if(ve==="border-box"?Vt+=le:ve==="content-box"&&(Vt-=ce),bn!==null||dn!==null){vn.value=" ";var en=vn.scrollHeight-ce;bn!==null&&(oe=en*bn,ve==="border-box"&&(oe=oe+ce+le),Vt=Math.max(oe,Vt)),dn!==null&&(ze=en*dn,ve==="border-box"&&(ze=ze+ce+le),yt=Vt>ze?"":"hidden",Vt=Math.min(ze,Vt))}var un={height:Vt,overflowY:yt,resize:"none"};return oe&&(un.minHeight=oe),ze&&(un.maxHeight=ze),un}var An=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],Zn=0,Ye=1,Ee=2,Tt=Ne.forwardRef(function($t,Bt){var bn=$t,dn=bn.prefixCls,ke=bn.onPressEnter,ce=bn.defaultValue,le=bn.value,ve=bn.autoSize,pe=bn.onResize,oe=bn.className,ze=bn.style,yt=bn.disabled,Vt=bn.onChange,en=bn.onInternalAutoSize,un=(0,Ce.Z)(bn,An),yn=et(ce,{value:le,postState:function(Pn){return Pn!=null?Pn:""}}),Jt=(0,ye.Z)(yn,2),Cr=Jt[0],Tr=Jt[1],Rt=function(Pn){Tr(Pn.target.value),Vt==null||Vt(Pn)},Ln=Ne.useRef();Ne.useImperativeHandle(Bt,function(){return{textArea:Ln.current}});var Nr=Ne.useMemo(function(){return ve&&(0,qe.Z)(ve)==="object"?[ve.minRows,ve.maxRows]:[]},[ve]),Qr=(0,ye.Z)(Nr,2),Gn=Qr[0],Fr=Qr[1],Da=!!ve,Fi=function(){try{if(document.activeElement===Ln.current){var Pn=Ln.current,xr=Pn.selectionStart,nr=Pn.selectionEnd,ur=Pn.scrollTop;Ln.current.setSelectionRange(xr,nr),Ln.current.scrollTop=ur}}catch(Hn){}},Oi=Ne.useState(Ee),Ei=(0,ye.Z)(Oi,2),ua=Ei[0],ba=Ei[1],ka=Ne.useState(),ca=(0,ye.Z)(ka,2),Hr=ca[0],La=ca[1],fo=function(){ba(Zn)};Xe(function(){Da&&fo()},[le,Gn,Fr,Da]),Xe(function(){if(ua===Zn)ba(Ye);else if(ua===Ye){var Tn=cn(Ln.current,!1,Gn,Fr);ba(Ee),La(Tn)}else Fi()},[ua]);var Za=Ne.useRef(),Wa=function(){xt.cancel(Za.current)},ha=function(Pn){ua===Ee&&(pe==null||pe(Pn),ve&&(Wa(),Za.current=xt(function(){fo()})))};Ne.useEffect(function(){return Wa},[]);var wt=Da?Hr:null,_n=(0,tt.Z)((0,tt.Z)({},ze),wt);return(ua===Zn||ua===Ye)&&(_n.overflowY="hidden",_n.overflowX="hidden"),Ne.createElement(lt.Z,{onResize:ha,disabled:!(ve||pe)},Ne.createElement("textarea",(0,be.Z)({},un,{ref:Ln,style:_n,className:he()(dn,oe,(0,Fe.Z)({},"".concat(dn,"-disabled"),yt)),disabled:yt,value:Cr,onChange:Rt})))}),gn=Tt,Xt=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","classes","showCount","className","style","disabled","hidden","classNames","styles","onResize"];function Je($t,Bt){return(0,Me.Z)($t||"").slice(0,Bt).join("")}function rt($t,Bt,bn,dn){var ke=bn;return $t?ke=Je(bn,dn):(0,Me.Z)(Bt||"").length<bn.length&&(0,Me.Z)(bn||"").length>dn&&(ke=Bt),ke}var Ht=Ne.forwardRef(function($t,Bt){var bn,dn=$t.defaultValue,ke=$t.value,ce=$t.onFocus,le=$t.onBlur,ve=$t.onChange,pe=$t.allowClear,oe=$t.maxLength,ze=$t.onCompositionStart,yt=$t.onCompositionEnd,Vt=$t.suffix,en=$t.prefixCls,un=en===void 0?"rc-textarea":en,yn=$t.classes,Jt=$t.showCount,Cr=$t.className,Tr=$t.style,Rt=$t.disabled,Ln=$t.hidden,Nr=$t.classNames,Qr=$t.styles,Gn=$t.onResize,Fr=(0,Ce.Z)($t,Xt),Da=et(dn,{value:ke,defaultValue:dn}),Fi=(0,ye.Z)(Da,2),Oi=Fi[0],Ei=Fi[1],ua=(0,Ne.useRef)(null),ba=Ne.useState(!1),ka=(0,ye.Z)(ba,2),ca=ka[0],Hr=ka[1],La=Ne.useState(!1),fo=(0,ye.Z)(La,2),Za=fo[0],Wa=fo[1],ha=Ne.useRef(),wt=Ne.useRef(0),_n=Ne.useState(null),Tn=(0,ye.Z)(_n,2),Pn=Tn[0],xr=Tn[1],nr=function(){var qn;(qn=ua.current)===null||qn===void 0||qn.textArea.focus()};(0,Ne.useImperativeHandle)(Bt,function(){return{resizableTextArea:ua.current,focus:nr,blur:function(){var qn;(qn=ua.current)===null||qn===void 0||qn.textArea.blur()}}}),(0,Ne.useEffect)(function(){Hr(function(Un){return!Rt&&Un})},[Rt]);var ur=Number(oe)>0,Hn=function(qn){Wa(!0),ha.current=Oi,wt.current=qn.currentTarget.selectionStart,ze==null||ze(qn)},je=function(qn){Wa(!1);var Jn=qn.currentTarget.value;if(ur){var Mr,an=wt.current>=oe+1||wt.current===((Mr=ha.current)===null||Mr===void 0?void 0:Mr.length);Jn=rt(an,ha.current,Jn,oe)}Jn!==Oi&&(Ei(Jn),(0,ct.rJ)(qn.currentTarget,qn,ve,Jn)),yt==null||yt(qn)},it=function(qn){var Jn=qn.target.value;if(!Za&&ur){var Mr=qn.target.selectionStart>=oe+1||qn.target.selectionStart===Jn.length||!qn.target.selectionStart;Jn=rt(Mr,Oi,Jn,oe)}Ei(Jn),(0,ct.rJ)(qn.currentTarget,qn,ve,Jn)},St=function(qn){var Jn=Fr.onPressEnter,Mr=Fr.onKeyDown;qn.key==="Enter"&&Jn&&Jn(qn),Mr==null||Mr(qn)},Wt=function(qn){Hr(!0),ce==null||ce(qn)},He=function(qn){Hr(!1),le==null||le(qn)},ht=function(qn){var Jn;Ei(""),nr(),(0,ct.rJ)((Jn=ua.current)===null||Jn===void 0?void 0:Jn.textArea,qn,ve)},Dt=(0,ct.D7)(Oi);!Za&&ur&&ke==null&&(Dt=Je(Dt,oe));var _t=Vt,Nt;if(Jt){var Pt=(0,Me.Z)(Dt).length;(0,qe.Z)(Jt)==="object"?Nt=Jt.formatter({value:Dt,count:Pt,maxLength:oe}):Nt="".concat(Pt).concat(ur?" / ".concat(oe):""),_t=Ne.createElement(Ne.Fragment,null,_t,Ne.createElement("span",{className:he()("".concat(un,"-data-count"),Nr==null?void 0:Nr.count),style:Qr==null?void 0:Qr.count},Nt))}var Bn=function(qn){var Jn;Gn==null||Gn(qn),(Jn=ua.current)!==null&&Jn!==void 0&&Jn.textArea.style.height&&xr(!0)},cr=!Fr.autoSize&&!Jt&&!pe,Wn=Ne.createElement(De.BaseInput,{value:Dt,allowClear:pe,handleReset:ht,suffix:_t,prefixCls:un,classes:{affixWrapper:he()(yn==null?void 0:yn.affixWrapper,(bn={},(0,Fe.Z)(bn,"".concat(un,"-show-count"),Jt),(0,Fe.Z)(bn,"".concat(un,"-textarea-allow-clear"),pe),bn))},disabled:Rt,focused:ca,className:Cr,style:(0,tt.Z)((0,tt.Z)({},Tr),Pn&&!cr?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof Nt=="string"?Nt:void 0}},hidden:Ln,inputElement:Ne.createElement(gn,(0,be.Z)({},Fr,{onKeyDown:St,onChange:it,onFocus:Wt,onBlur:He,onCompositionStart:Hn,onCompositionEnd:je,className:Nr==null?void 0:Nr.textarea,style:(0,tt.Z)((0,tt.Z)({},Qr==null?void 0:Qr.textarea),{},{resize:Tr==null?void 0:Tr.resize}),disabled:Rt,prefixCls:un,onResize:Bn,ref:ua}))});return Wn}),Sn=Ht,sn=Sn},1337:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return we}});var be=ue(1413),tt=`accept acceptCharset accessKey action allowFullScreen allowTransparency
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
charSet checked classID className colSpan cols content contentEditable contextMenu
controls coords crossOrigin data dateTime default defer dir disabled download draggable
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
mediaGroup method min minLength multiple muted name noValidate nonce open
optimum pattern placeholder poster preload radioGroup readOnly rel required
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
summary tabIndex target title type useMap value width wmode wrap`,Fe=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,qe="".concat(tt," ").concat(Fe).split(/[\s\n]+/),ye="aria-",Ce="data-";function Me(he,De){return he.indexOf(De)===0}function we(he){var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ct;De===!1?ct={aria:!0,data:!0,attr:!0}:De===!0?ct={aria:!0}:ct=(0,be.Z)({},De);var Ne={};return Object.keys(he).forEach(function(Mt){(ct.aria&&(Mt==="role"||Me(Mt,ye))||ct.data&&Me(Mt,Ce)||ct.attr&&qe.includes(Mt))&&(Ne[Mt]=he[Mt])}),Ne}},88386:function(mn,Ut,ue){(function(be){be(ue(4631))})(function(be){be.defineOption("placeholder","",function(we,he,De){var ct=De&&De!=be.Init;if(he&&!ct)we.on("blur",ye),we.on("change",Ce),we.on("swapDoc",Ce),be.on(we.getInputField(),"compositionupdate",we.state.placeholderCompose=function(){qe(we)}),Ce(we);else if(!he&&ct){we.off("blur",ye),we.off("change",Ce),we.off("swapDoc",Ce),be.off(we.getInputField(),"compositionupdate",we.state.placeholderCompose),tt(we);var Ne=we.getWrapperElement();Ne.className=Ne.className.replace(" CodeMirror-empty","")}he&&!we.hasFocus()&&ye(we)});function tt(we){we.state.placeholder&&(we.state.placeholder.parentNode.removeChild(we.state.placeholder),we.state.placeholder=null)}function Fe(we){tt(we);var he=we.state.placeholder=document.createElement("pre");he.style.cssText="height: 0; overflow: visible",he.style.direction=we.getOption("direction"),he.className="CodeMirror-placeholder CodeMirror-line-like";var De=we.getOption("placeholder");typeof De=="string"&&(De=document.createTextNode(De)),he.appendChild(De),we.display.lineSpace.insertBefore(he,we.display.lineSpace.firstChild)}function qe(we){setTimeout(function(){var he=!1,De=we.getInputField();De.nodeName=="TEXTAREA"?he=!De.value:we.lineCount()==1&&(he=!/[^\u200b]/.test(De.querySelector(".CodeMirror-line").textContent)),he?Fe(we):tt(we)},20)}function ye(we){Me(we)&&Fe(we)}function Ce(we){var he=we.getWrapperElement(),De=Me(we);he.className=he.className.replace(" CodeMirror-empty","")+(De?" CodeMirror-empty":""),De?Fe(we):tt(we)}function Me(we){return we.lineCount()===1&&we.getLine(0)===""}})},82801:function(mn,Ut,ue){(function(be){be(ue(4631))})(function(be){var tt={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},Fe=be.Pos;be.defineOption("autoCloseBrackets",!1,function(Qe,Xe,Te){Te&&Te!=be.Init&&(Qe.removeKeyMap(ye),Qe.state.closeBrackets=null),Xe&&(Ce(qe(Xe,"pairs")),Qe.state.closeBrackets=Xe,Qe.addKeyMap(ye))});function qe(Qe,Xe){return Xe=="pairs"&&typeof Qe=="string"?Qe:typeof Qe=="object"&&Qe[Xe]!=null?Qe[Xe]:tt[Xe]}var ye={Backspace:he,Enter:De};function Ce(Qe){for(var Xe=0;Xe<Qe.length;Xe++){var Te=Qe.charAt(Xe),Et="'"+Te+"'";ye[Et]||(ye[Et]=Me(Te))}}Ce(tt.pairs+"`");function Me(Qe){return function(Xe){return Ne(Xe,Qe)}}function we(Qe){var Xe=Qe.state.closeBrackets;if(!Xe||Xe.override)return Xe;var Te=Qe.getModeAt(Qe.getCursor());return Te.closeBrackets||Xe}function he(Qe){var Xe=we(Qe);if(!Xe||Qe.getOption("disableInput"))return be.Pass;for(var Te=qe(Xe,"pairs"),Et=Qe.listSelections(),Lt=0;Lt<Et.length;Lt++){if(!Et[Lt].empty())return be.Pass;var et=Mt(Qe,Et[Lt].head);if(!et||Te.indexOf(et)%2!=0)return be.Pass}for(var Lt=Et.length-1;Lt>=0;Lt--){var lt=Et[Lt].head;Qe.replaceRange("",Fe(lt.line,lt.ch-1),Fe(lt.line,lt.ch+1),"+delete")}}function De(Qe){var Xe=we(Qe),Te=Xe&&qe(Xe,"explode");if(!Te||Qe.getOption("disableInput"))return be.Pass;for(var Et=Qe.listSelections(),Lt=0;Lt<Et.length;Lt++){if(!Et[Lt].empty())return be.Pass;var et=Mt(Qe,Et[Lt].head);if(!et||Te.indexOf(et)%2!=0)return be.Pass}Qe.operation(function(){var lt=Qe.lineSeparator()||`
`;Qe.replaceSelection(lt+lt,null),Qe.execCommand("goCharLeft"),Et=Qe.listSelections();for(var Ie=0;Ie<Et.length;Ie++){var _e=Et[Ie].head.line;Qe.indentLine(_e,null,!0),Qe.indentLine(_e+1,null,!0)}})}function ct(Qe){var Xe=be.cmpPos(Qe.anchor,Qe.head)>0;return{anchor:new Fe(Qe.anchor.line,Qe.anchor.ch+(Xe?-1:1)),head:new Fe(Qe.head.line,Qe.head.ch+(Xe?1:-1))}}function Ne(Qe,Xe){var Te=we(Qe);if(!Te||Qe.getOption("disableInput"))return be.Pass;var Et=qe(Te,"pairs"),Lt=Et.indexOf(Xe);if(Lt==-1)return be.Pass;for(var et=qe(Te,"closeBefore"),lt=qe(Te,"triples"),Ie=Et.charAt(Lt+1)==Xe,_e=Qe.listSelections(),Ue=Lt%2==0,Ze,At=0;At<_e.length;At++){var bt=_e[At],xt=bt.head,Ge,Ot=Qe.getRange(xt,Fe(xt.line,xt.ch+1));if(Ue&&!bt.empty())Ge="surround";else if((Ie||!Ue)&&Ot==Xe)Ie&&ut(Qe,xt)?Ge="both":lt.indexOf(Xe)>=0&&Qe.getRange(xt,Fe(xt.line,xt.ch+3))==Xe+Xe+Xe?Ge="skipThree":Ge="skip";else if(Ie&&xt.ch>1&&lt.indexOf(Xe)>=0&&Qe.getRange(Fe(xt.line,xt.ch-2),xt)==Xe+Xe){if(xt.ch>2&&/\bstring/.test(Qe.getTokenTypeAt(Fe(xt.line,xt.ch-2))))return be.Pass;Ge="addFour"}else if(Ie){var kt=xt.ch==0?" ":Qe.getRange(Fe(xt.line,xt.ch-1),xt);if(!be.isWordChar(Ot)&&kt!=Xe&&!be.isWordChar(kt))Ge="both";else return be.Pass}else if(Ue&&(Ot.length===0||/\s/.test(Ot)||et.indexOf(Ot)>-1))Ge="both";else return be.Pass;if(!Ze)Ze=Ge;else if(Ze!=Ge)return be.Pass}var vn=Lt%2?Et.charAt(Lt-1):Xe,qt=Lt%2?Xe:Et.charAt(Lt+1);Qe.operation(function(){if(Ze=="skip")Qe.execCommand("goCharRight");else if(Ze=="skipThree")for(var cn=0;cn<3;cn++)Qe.execCommand("goCharRight");else if(Ze=="surround"){for(var An=Qe.getSelections(),cn=0;cn<An.length;cn++)An[cn]=vn+An[cn]+qt;Qe.replaceSelections(An,"around"),An=Qe.listSelections().slice();for(var cn=0;cn<An.length;cn++)An[cn]=ct(An[cn]);Qe.setSelections(An)}else Ze=="both"?(Qe.replaceSelection(vn+qt,null),Qe.triggerElectric(vn+qt),Qe.execCommand("goCharLeft")):Ze=="addFour"&&(Qe.replaceSelection(vn+vn+vn+vn,"before"),Qe.execCommand("goCharRight"))})}function Mt(Qe,Xe){var Te=Qe.getRange(Fe(Xe.line,Xe.ch-1),Fe(Xe.line,Xe.ch+1));return Te.length==2?Te:null}function ut(Qe,Xe){var Te=Qe.getTokenAt(Fe(Xe.line,Xe.ch+1));return/\bstring/.test(Te.type)&&Te.start==Xe.ch&&(Xe.ch==0||!/\bstring/.test(Qe.getTokenTypeAt(Xe)))}})},57341:function(mn,Ut,ue){(function(be){be(ue(4631),ue(4786))})(function(be){be.defineOption("autoCloseTags",!1,function(he,De,ct){if(ct!=be.Init&&ct&&he.removeKeyMap("autoCloseTags"),!!De){var Ne={name:"autoCloseTags"};(typeof De!="object"||De.whenClosing!==!1)&&(Ne["'/'"]=function(Mt){return Ce(Mt)}),(typeof De!="object"||De.whenOpening!==!1)&&(Ne["'>'"]=function(Mt){return qe(Mt)}),he.addKeyMap(Ne)}});var tt=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],Fe=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function qe(he){if(he.getOption("disableInput"))return be.Pass;for(var De=he.listSelections(),ct=[],Ne=he.getOption("autoCloseTags"),Mt=0;Mt<De.length;Mt++){if(!De[Mt].empty())return be.Pass;var ut=De[Mt].head,Qe=he.getTokenAt(ut),Xe=be.innerMode(he.getMode(),Qe.state),Te=Xe.state,Et=Xe.mode.xmlCurrentTag&&Xe.mode.xmlCurrentTag(Te),Lt=Et&&Et.name;if(!Lt)return be.Pass;var et=Xe.mode.configuration=="html",lt=typeof Ne=="object"&&Ne.dontCloseTags||et&&tt,Ie=typeof Ne=="object"&&Ne.indentTags||et&&Fe;Qe.end>ut.ch&&(Lt=Lt.slice(0,Lt.length-Qe.end+ut.ch));var _e=Lt.toLowerCase();if(!Lt||Qe.type=="string"&&(Qe.end!=ut.ch||!/[\"\']/.test(Qe.string.charAt(Qe.string.length-1))||Qe.string.length==1)||Qe.type=="tag"&&Et.close||Qe.string.indexOf("/")==ut.ch-Qe.start-1||lt&&Me(lt,_e)>-1||we(he,Xe.mode.xmlCurrentContext&&Xe.mode.xmlCurrentContext(Te)||[],Lt,ut,!0))return be.Pass;var Ue=typeof Ne=="object"&&Ne.emptyTags;if(Ue&&Me(Ue,Lt)>-1){ct[Mt]={text:"/>",newPos:be.Pos(ut.line,ut.ch+2)};continue}var Ze=Ie&&Me(Ie,_e)>-1;ct[Mt]={indent:Ze,text:">"+(Ze?`
`:"")+"</"+Lt+">",newPos:Ze?be.Pos(ut.line+1,0):be.Pos(ut.line,ut.ch+1)}}for(var At=typeof Ne=="object"&&Ne.dontIndentOnAutoClose,Mt=De.length-1;Mt>=0;Mt--){var bt=ct[Mt];he.replaceRange(bt.text,De[Mt].head,De[Mt].anchor,"+insert");var xt=he.listSelections().slice(0);xt[Mt]={head:bt.newPos,anchor:bt.newPos},he.setSelections(xt),!At&&bt.indent&&(he.indentLine(bt.newPos.line,null,!0),he.indentLine(bt.newPos.line+1,null,!0))}}function ye(he,De){for(var ct=he.listSelections(),Ne=[],Mt=De?"/":"</",ut=he.getOption("autoCloseTags"),Qe=typeof ut=="object"&&ut.dontIndentOnSlash,Xe=0;Xe<ct.length;Xe++){if(!ct[Xe].empty())return be.Pass;var Te=ct[Xe].head,Et=he.getTokenAt(Te),Lt=be.innerMode(he.getMode(),Et.state),et=Lt.state;if(De&&(Et.type=="string"||Et.string.charAt(0)!="<"||Et.start!=Te.ch-1))return be.Pass;var lt,Ie=Lt.mode.name!="xml"&&he.getMode().name=="htmlmixed";if(Ie&&Lt.mode.name=="javascript")lt=Mt+"script";else if(Ie&&Lt.mode.name=="css")lt=Mt+"style";else{var _e=Lt.mode.xmlCurrentContext&&Lt.mode.xmlCurrentContext(et);if(!_e||_e.length&&we(he,_e,_e[_e.length-1],Te))return be.Pass;lt=Mt+_e[_e.length-1]}he.getLine(Te.line).charAt(Et.end)!=">"&&(lt+=">"),Ne[Xe]=lt}if(he.replaceSelections(Ne),ct=he.listSelections(),!Qe)for(var Xe=0;Xe<ct.length;Xe++)(Xe==ct.length-1||ct[Xe].head.line<ct[Xe+1].head.line)&&he.indentLine(ct[Xe].head.line)}function Ce(he){return he.getOption("disableInput")?be.Pass:ye(he,!0)}be.commands.closeTag=function(he){return ye(he)};function Me(he,De){if(he.indexOf)return he.indexOf(De);for(var ct=0,Ne=he.length;ct<Ne;++ct)if(he[ct]==De)return ct;return-1}function we(he,De,ct,Ne,Mt){if(!be.scanForClosingTag)return!1;var ut=Math.min(he.lastLine()+1,Ne.line+500),Qe=be.scanForClosingTag(he,Ne,null,ut);if(!Qe||Qe.tag!=ct)return!1;for(var Xe=Mt?1:0,Te=De.length-1;Te>=0&&De[Te]==ct;Te--)++Xe;Ne=Qe.to;for(var Te=1;Te<Xe;Te++){var Et=be.scanForClosingTag(he,Ne,null,ut);if(!Et||Et.tag!=ct)return!1;Ne=Et.to}return!0}})},4786:function(mn,Ut,ue){(function(be){be(ue(4631))})(function(be){"use strict";var tt=be.Pos;function Fe(Te,Et){return Te.line-Et.line||Te.ch-Et.ch}var qe="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ye=qe+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Ce=new RegExp("<(/?)(["+qe+"]["+ye+"]*)","g");function Me(Te,Et,Lt,et){this.line=Et,this.ch=Lt,this.cm=Te,this.text=Te.getLine(Et),this.min=et?Math.max(et.from,Te.firstLine()):Te.firstLine(),this.max=et?Math.min(et.to-1,Te.lastLine()):Te.lastLine()}function we(Te,Et){var Lt=Te.cm.getTokenTypeAt(tt(Te.line,Et));return Lt&&/\btag\b/.test(Lt)}function he(Te){if(!(Te.line>=Te.max))return Te.ch=0,Te.text=Te.cm.getLine(++Te.line),!0}function De(Te){if(!(Te.line<=Te.min))return Te.text=Te.cm.getLine(--Te.line),Te.ch=Te.text.length,!0}function ct(Te){for(;;){var Et=Te.text.indexOf(">",Te.ch);if(Et==-1){if(he(Te))continue;return}if(!we(Te,Et+1)){Te.ch=Et+1;continue}var Lt=Te.text.lastIndexOf("/",Et),et=Lt>-1&&!/\S/.test(Te.text.slice(Lt+1,Et));return Te.ch=Et+1,et?"selfClose":"regular"}}function Ne(Te){for(;;){var Et=Te.ch?Te.text.lastIndexOf("<",Te.ch-1):-1;if(Et==-1){if(De(Te))continue;return}if(!we(Te,Et+1)){Te.ch=Et;continue}Ce.lastIndex=Et,Te.ch=Et;var Lt=Ce.exec(Te.text);if(Lt&&Lt.index==Et)return Lt}}function Mt(Te){for(;;){Ce.lastIndex=Te.ch;var Et=Ce.exec(Te.text);if(!Et){if(he(Te))continue;return}if(!we(Te,Et.index+1)){Te.ch=Et.index+1;continue}return Te.ch=Et.index+Et[0].length,Et}}function ut(Te){for(;;){var Et=Te.ch?Te.text.lastIndexOf(">",Te.ch-1):-1;if(Et==-1){if(De(Te))continue;return}if(!we(Te,Et+1)){Te.ch=Et;continue}var Lt=Te.text.lastIndexOf("/",Et),et=Lt>-1&&!/\S/.test(Te.text.slice(Lt+1,Et));return Te.ch=Et+1,et?"selfClose":"regular"}}function Qe(Te,Et){for(var Lt=[];;){var et=Mt(Te),lt,Ie=Te.line,_e=Te.ch-(et?et[0].length:0);if(!et||!(lt=ct(Te)))return;if(lt!="selfClose")if(et[1]){for(var Ue=Lt.length-1;Ue>=0;--Ue)if(Lt[Ue]==et[2]){Lt.length=Ue;break}if(Ue<0&&(!Et||Et==et[2]))return{tag:et[2],from:tt(Ie,_e),to:tt(Te.line,Te.ch)}}else Lt.push(et[2])}}function Xe(Te,Et){for(var Lt=[];;){var et=ut(Te);if(!et)return;if(et=="selfClose"){Ne(Te);continue}var lt=Te.line,Ie=Te.ch,_e=Ne(Te);if(!_e)return;if(_e[1])Lt.push(_e[2]);else{for(var Ue=Lt.length-1;Ue>=0;--Ue)if(Lt[Ue]==_e[2]){Lt.length=Ue;break}if(Ue<0&&(!Et||Et==_e[2]))return{tag:_e[2],from:tt(Te.line,Te.ch),to:tt(lt,Ie)}}}}be.registerHelper("fold","xml",function(Te,Et){for(var Lt=new Me(Te,Et.line,0);;){var et=Mt(Lt);if(!et||Lt.line!=Et.line)return;var lt=ct(Lt);if(!lt)return;if(!et[1]&&lt!="selfClose"){var Ie=tt(Lt.line,Lt.ch),_e=Qe(Lt,et[2]);return _e&&Fe(_e.from,Ie)>0?{from:Ie,to:_e.from}:null}}}),be.findMatchingTag=function(Te,Et,Lt){var et=new Me(Te,Et.line,Et.ch,Lt);if(!(et.text.indexOf(">")==-1&&et.text.indexOf("<")==-1)){var lt=ct(et),Ie=lt&&tt(et.line,et.ch),_e=lt&&Ne(et);if(!(!lt||!_e||Fe(et,Et)>0)){var Ue={from:tt(et.line,et.ch),to:Ie,tag:_e[2]};return lt=="selfClose"?{open:Ue,close:null,at:"open"}:_e[1]?{open:Xe(et,_e[2]),close:Ue,at:"close"}:(et=new Me(Te,Ie.line,Ie.ch,Lt),{open:Ue,close:Qe(et,_e[2]),at:"open"})}}},be.findEnclosingTag=function(Te,Et,Lt,et){for(var lt=new Me(Te,Et.line,Et.ch,Lt);;){var Ie=Xe(lt,et);if(!Ie)break;var _e=new Me(Te,Et.line,Et.ch,Lt),Ue=Qe(_e,Ie.tag);if(Ue)return{open:Ie,close:Ue}}},be.scanForClosingTag=function(Te,Et,Lt,et){var lt=new Me(Te,Et.line,Et.ch,et?{from:0,to:et}:null);return Qe(lt,Lt)}})},4631:function(mn){(function(Ut,ue){mn.exports=ue()})(this,function(){"use strict";var Ut=navigator.userAgent,ue=navigator.platform,be=/gecko\/\d/i.test(Ut),tt=/MSIE \d/.test(Ut),Fe=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ut),qe=/Edge\/(\d+)/.exec(Ut),ye=tt||Fe||qe,Ce=ye&&(tt?document.documentMode||6:+(qe||Fe)[1]),Me=!qe&&/WebKit\//.test(Ut),we=Me&&/Qt\/\d+\.\d+/.test(Ut),he=!qe&&/Chrome\//.test(Ut),De=/Opera\//.test(Ut),ct=/Apple Computer/.test(navigator.vendor),Ne=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Ut),Mt=/PhantomJS/.test(Ut),ut=!qe&&/AppleWebKit/.test(Ut)&&/Mobile\/\w+/.test(Ut),Qe=/Android/.test(Ut),Xe=ut||Qe||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Ut),Te=ut||/Mac/.test(ue),Et=/\bCrOS\b/.test(Ut),Lt=/win/i.test(ue),et=De&&Ut.match(/Version\/(\d*\.\d*)/);et&&(et=Number(et[1])),et&&et>=15&&(De=!1,Me=!0);var lt=Te&&(we||De&&(et==null||et<12.11)),Ie=be||ye&&Ce>=9;function _e(x){return new RegExp("(^|\\s)"+x+"(?:$|\\s)\\s*")}var Ue=function(x,z){var ne=x.className,te=_e(z).exec(ne);if(te){var ie=ne.slice(te.index+te[0].length);x.className=ne.slice(0,te.index)+(ie?te[1]+ie:"")}};function Ze(x){for(var z=x.childNodes.length;z>0;--z)x.removeChild(x.firstChild);return x}function At(x,z){return Ze(x).appendChild(z)}function bt(x,z,ne,te){var ie=document.createElement(x);if(ne&&(ie.className=ne),te&&(ie.style.cssText=te),typeof z=="string")ie.appendChild(document.createTextNode(z));else if(z)for(var se=0;se<z.length;++se)ie.appendChild(z[se]);return ie}function xt(x,z,ne,te){var ie=bt(x,z,ne,te);return ie.setAttribute("role","presentation"),ie}var Ge;document.createRange?Ge=function(x,z,ne,te){var ie=document.createRange();return ie.setEnd(te||x,ne),ie.setStart(x,z),ie}:Ge=function(x,z,ne){var te=document.body.createTextRange();try{te.moveToElementText(x.parentNode)}catch(ie){return te}return te.collapse(!0),te.moveEnd("character",ne),te.moveStart("character",z),te};function Ot(x,z){if(z.nodeType==3&&(z=z.parentNode),x.contains)return x.contains(z);do if(z.nodeType==11&&(z=z.host),z==x)return!0;while(z=z.parentNode)}function kt(){var x;try{x=document.activeElement}catch(z){x=document.body||null}for(;x&&x.shadowRoot&&x.shadowRoot.activeElement;)x=x.shadowRoot.activeElement;return x}function vn(x,z){var ne=x.className;_e(z).test(ne)||(x.className+=(ne?" ":"")+z)}function qt(x,z){for(var ne=x.split(" "),te=0;te<ne.length;te++)ne[te]&&!_e(ne[te]).test(z)&&(z+=" "+ne[te]);return z}var cn=function(x){x.select()};ut?cn=function(x){x.selectionStart=0,x.selectionEnd=x.value.length}:ye&&(cn=function(x){try{x.select()}catch(z){}});function An(x){var z=Array.prototype.slice.call(arguments,1);return function(){return x.apply(null,z)}}function Zn(x,z,ne){z||(z={});for(var te in x)x.hasOwnProperty(te)&&(ne!==!1||!z.hasOwnProperty(te))&&(z[te]=x[te]);return z}function Ye(x,z,ne,te,ie){z==null&&(z=x.search(/[^\s\u00a0]/),z==-1&&(z=x.length));for(var se=te||0,me=ie||0;;){var Se=x.indexOf(" ",se);if(Se<0||Se>=z)return me+(z-se);me+=Se-se,me+=ne-me%ne,se=Se+1}}var Ee=function(){this.id=null,this.f=null,this.time=0,this.handler=An(this.onTimeout,this)};Ee.prototype.onTimeout=function(x){x.id=0,x.time<=+new Date?x.f():setTimeout(x.handler,x.time-+new Date)},Ee.prototype.set=function(x,z){this.f=z;var ne=+new Date+x;(!this.id||ne<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,x),this.time=ne)};function Tt(x,z){for(var ne=0;ne<x.length;++ne)if(x[ne]==z)return ne;return-1}var gn=50,Xt={toString:function(){return"CodeMirror.Pass"}},Je={scroll:!1},rt={origin:"*mouse"},Ht={origin:"+move"};function Sn(x,z,ne){for(var te=0,ie=0;;){var se=x.indexOf(" ",te);se==-1&&(se=x.length);var me=se-te;if(se==x.length||ie+me>=z)return te+Math.min(me,z-ie);if(ie+=se-te,ie+=ne-ie%ne,te=se+1,ie>=z)return te}}var sn=[""];function $t(x){for(;sn.length<=x;)sn.push(Bt(sn)+" ");return sn[x]}function Bt(x){return x[x.length-1]}function bn(x,z){for(var ne=[],te=0;te<x.length;te++)ne[te]=z(x[te],te);return ne}function dn(x,z,ne){for(var te=0,ie=ne(z);te<x.length&&ne(x[te])<=ie;)te++;x.splice(te,0,z)}function ke(){}function ce(x,z){var ne;return Object.create?ne=Object.create(x):(ke.prototype=x,ne=new ke),z&&Zn(z,ne),ne}var le=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ve(x){return/\w/.test(x)||x>"\x80"&&(x.toUpperCase()!=x.toLowerCase()||le.test(x))}function pe(x,z){return z?z.source.indexOf("\\w")>-1&&ve(x)?!0:z.test(x):ve(x)}function oe(x){for(var z in x)if(x.hasOwnProperty(z)&&x[z])return!1;return!0}var ze=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function yt(x){return x.charCodeAt(0)>=768&&ze.test(x)}function Vt(x,z,ne){for(;(ne<0?z>0:z<x.length)&&yt(x.charAt(z));)z+=ne;return z}function en(x,z,ne){for(var te=z>ne?-1:1;;){if(z==ne)return z;var ie=(z+ne)/2,se=te<0?Math.ceil(ie):Math.floor(ie);if(se==z)return x(se)?z:ne;x(se)?ne=se:z=se+te}}function un(x,z,ne,te){if(!x)return te(z,ne,"ltr",0);for(var ie=!1,se=0;se<x.length;++se){var me=x[se];(me.from<ne&&me.to>z||z==ne&&me.to==z)&&(te(Math.max(me.from,z),Math.min(me.to,ne),me.level==1?"rtl":"ltr",se),ie=!0)}ie||te(z,ne,"ltr")}var yn=null;function Jt(x,z,ne){var te;yn=null;for(var ie=0;ie<x.length;++ie){var se=x[ie];if(se.from<z&&se.to>z)return ie;se.to==z&&(se.from!=se.to&&ne=="before"?te=ie:yn=ie),se.from==z&&(se.from!=se.to&&ne!="before"?te=ie:yn=ie)}return te!=null?te:yn}var Cr=function(){var x="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",z="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function ne(Pe){return Pe<=247?x.charAt(Pe):1424<=Pe&&Pe<=1524?"R":1536<=Pe&&Pe<=1785?z.charAt(Pe-1536):1774<=Pe&&Pe<=2220?"r":8192<=Pe&&Pe<=8203?"w":Pe==8204?"b":"L"}var te=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,ie=/[stwN]/,se=/[LRr]/,me=/[Lb1n]/,Se=/[1n]/;function Ae(Pe,at,vt){this.level=Pe,this.from=at,this.to=vt}return function(Pe,at){var vt=at=="ltr"?"L":"R";if(Pe.length==0||at=="ltr"&&!te.test(Pe))return!1;for(var Gt=Pe.length,Ft=[],Rn=0;Rn<Gt;++Rn)Ft.push(ne(Pe.charCodeAt(Rn)));for(var Xn=0,hr=vt;Xn<Gt;++Xn){var _r=Ft[Xn];_r=="m"?Ft[Xn]=hr:hr=_r}for(var Or=0,Sr=vt;Or<Gt;++Or){var Rr=Ft[Or];Rr=="1"&&Sr=="r"?Ft[Or]="n":se.test(Rr)&&(Sr=Rr,Rr=="r"&&(Ft[Or]="R"))}for(var hi=1,vi=Ft[0];hi<Gt-1;++hi){var ra=Ft[hi];ra=="+"&&vi=="1"&&Ft[hi+1]=="1"?Ft[hi]="1":ra==","&&vi==Ft[hi+1]&&(vi=="1"||vi=="n")&&(Ft[hi]=vi),vi=ra}for(var eo=0;eo<Gt;++eo){var Wo=Ft[eo];if(Wo==",")Ft[eo]="N";else if(Wo=="%"){var bo=void 0;for(bo=eo+1;bo<Gt&&Ft[bo]=="%";++bo);for(var cs=eo&&Ft[eo-1]=="!"||bo<Gt&&Ft[bo]=="1"?"1":"N",ds=eo;ds<bo;++ds)Ft[ds]=cs;eo=bo-1}}for(var Io=0,fs=vt;Io<Gt;++Io){var zi=Ft[Io];fs=="L"&&zi=="1"?Ft[Io]="L":se.test(zi)&&(fs=zi)}for(var So=0;So<Gt;++So)if(ie.test(Ft[So])){var xo=void 0;for(xo=So+1;xo<Gt&&ie.test(Ft[xo]);++xo);for(var Co=(So?Ft[So-1]:vt)=="L",_o=(xo<Gt?Ft[xo]:vt)=="L",Wl=Co==_o?Co?"L":"R":vt,ys=So;ys<xo;++ys)Ft[ys]=Wl;So=xo-1}for(var Go=[],za,No=0;No<Gt;)if(me.test(Ft[No])){var Ec=No;for(++No;No<Gt&&me.test(Ft[No]);++No);Go.push(new Ae(0,Ec,No))}else{var sl=No,xl=Go.length,Zs=at=="rtl"?1:0;for(++No;No<Gt&&Ft[No]!="L";++No);for(var Po=sl;Po<No;)if(Se.test(Ft[Po])){sl<Po&&(Go.splice(xl,0,new Ae(1,sl,Po)),xl+=Zs);var Vl=Po;for(++Po;Po<No&&Se.test(Ft[Po]);++Po);Go.splice(xl,0,new Ae(2,Vl,Po)),xl+=Zs,sl=Po}else++Po;sl<No&&Go.splice(xl,0,new Ae(1,sl,No))}return at=="ltr"&&(Go[0].level==1&&(za=Pe.match(/^\s+/))&&(Go[0].from=za[0].length,Go.unshift(new Ae(0,0,za[0].length))),Bt(Go).level==1&&(za=Pe.match(/\s+$/))&&(Bt(Go).to-=za[0].length,Go.push(new Ae(0,Gt-za[0].length,Gt)))),at=="rtl"?Go.reverse():Go}}();function Tr(x,z){var ne=x.order;return ne==null&&(ne=x.order=Cr(x.text,z)),ne}var Rt=[],Ln=function(x,z,ne){if(x.addEventListener)x.addEventListener(z,ne,!1);else if(x.attachEvent)x.attachEvent("on"+z,ne);else{var te=x._handlers||(x._handlers={});te[z]=(te[z]||Rt).concat(ne)}};function Nr(x,z){return x._handlers&&x._handlers[z]||Rt}function Qr(x,z,ne){if(x.removeEventListener)x.removeEventListener(z,ne,!1);else if(x.detachEvent)x.detachEvent("on"+z,ne);else{var te=x._handlers,ie=te&&te[z];if(ie){var se=Tt(ie,ne);se>-1&&(te[z]=ie.slice(0,se).concat(ie.slice(se+1)))}}}function Gn(x,z){var ne=Nr(x,z);if(ne.length)for(var te=Array.prototype.slice.call(arguments,2),ie=0;ie<ne.length;++ie)ne[ie].apply(null,te)}function Fr(x,z,ne){return typeof z=="string"&&(z={type:z,preventDefault:function(){this.defaultPrevented=!0}}),Gn(x,ne||z.type,x,z),ba(z)||z.codemirrorIgnore}function Da(x){var z=x._handlers&&x._handlers.cursorActivity;if(z)for(var ne=x.curOp.cursorActivityHandlers||(x.curOp.cursorActivityHandlers=[]),te=0;te<z.length;++te)Tt(ne,z[te])==-1&&ne.push(z[te])}function Fi(x,z){return Nr(x,z).length>0}function Oi(x){x.prototype.on=function(z,ne){Ln(this,z,ne)},x.prototype.off=function(z,ne){Qr(this,z,ne)}}function Ei(x){x.preventDefault?x.preventDefault():x.returnValue=!1}function ua(x){x.stopPropagation?x.stopPropagation():x.cancelBubble=!0}function ba(x){return x.defaultPrevented!=null?x.defaultPrevented:x.returnValue==!1}function ka(x){Ei(x),ua(x)}function ca(x){return x.target||x.srcElement}function Hr(x){var z=x.which;return z==null&&(x.button&1?z=1:x.button&2?z=3:x.button&4&&(z=2)),Te&&x.ctrlKey&&z==1&&(z=3),z}var La=function(){if(ye&&Ce<9)return!1;var x=bt("div");return"draggable"in x||"dragDrop"in x}(),fo;function Za(x){if(fo==null){var z=bt("span","\u200B");At(x,bt("span",[z,document.createTextNode("x")])),x.firstChild.offsetHeight!=0&&(fo=z.offsetWidth<=1&&z.offsetHeight>2&&!(ye&&Ce<8))}var ne=fo?bt("span","\u200B"):bt("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return ne.setAttribute("cm-text",""),ne}var Wa;function ha(x){if(Wa!=null)return Wa;var z=At(x,document.createTextNode("A\u062EA")),ne=Ge(z,0,1).getBoundingClientRect(),te=Ge(z,1,2).getBoundingClientRect();return Ze(x),!ne||ne.left==ne.right?!1:Wa=te.right-ne.right<3}var wt=`
b`.split(/\n/).length!=3?function(x){for(var z=0,ne=[],te=x.length;z<=te;){var ie=x.indexOf(`
`,z);ie==-1&&(ie=x.length);var se=x.slice(z,x.charAt(ie-1)=="\r"?ie-1:ie),me=se.indexOf("\r");me!=-1?(ne.push(se.slice(0,me)),z+=me+1):(ne.push(se),z=ie+1)}return ne}:function(x){return x.split(/\r\n?|\n/)},_n=window.getSelection?function(x){try{return x.selectionStart!=x.selectionEnd}catch(z){return!1}}:function(x){var z;try{z=x.ownerDocument.selection.createRange()}catch(ne){}return!z||z.parentElement()!=x?!1:z.compareEndPoints("StartToEnd",z)!=0},Tn=function(){var x=bt("div");return"oncopy"in x?!0:(x.setAttribute("oncopy","return;"),typeof x.oncopy=="function")}(),Pn=null;function xr(x){if(Pn!=null)return Pn;var z=At(x,bt("span","x")),ne=z.getBoundingClientRect(),te=Ge(z,0,1).getBoundingClientRect();return Pn=Math.abs(ne.left-te.left)>1}var nr={},ur={};function Hn(x,z){arguments.length>2&&(z.dependencies=Array.prototype.slice.call(arguments,2)),nr[x]=z}function je(x,z){ur[x]=z}function it(x){if(typeof x=="string"&&ur.hasOwnProperty(x))x=ur[x];else if(x&&typeof x.name=="string"&&ur.hasOwnProperty(x.name)){var z=ur[x.name];typeof z=="string"&&(z={name:z}),x=ce(z,x),x.name=z.name}else{if(typeof x=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(x))return it("application/xml");if(typeof x=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(x))return it("application/json")}return typeof x=="string"?{name:x}:x||{name:"null"}}function St(x,z){z=it(z);var ne=nr[z.name];if(!ne)return St(x,"text/plain");var te=ne(x,z);if(Wt.hasOwnProperty(z.name)){var ie=Wt[z.name];for(var se in ie)ie.hasOwnProperty(se)&&(te.hasOwnProperty(se)&&(te["_"+se]=te[se]),te[se]=ie[se])}if(te.name=z.name,z.helperType&&(te.helperType=z.helperType),z.modeProps)for(var me in z.modeProps)te[me]=z.modeProps[me];return te}var Wt={};function He(x,z){var ne=Wt.hasOwnProperty(x)?Wt[x]:Wt[x]={};Zn(z,ne)}function ht(x,z){if(z===!0)return z;if(x.copyState)return x.copyState(z);var ne={};for(var te in z){var ie=z[te];ie instanceof Array&&(ie=ie.concat([])),ne[te]=ie}return ne}function Dt(x,z){for(var ne;x.innerMode&&(ne=x.innerMode(z),!(!ne||ne.mode==x));)z=ne.state,x=ne.mode;return ne||{mode:x,state:z}}function _t(x,z,ne){return x.startState?x.startState(z,ne):!0}var Nt=function(x,z,ne){this.pos=this.start=0,this.string=x,this.tabSize=z||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=ne};Nt.prototype.eol=function(){return this.pos>=this.string.length},Nt.prototype.sol=function(){return this.pos==this.lineStart},Nt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Nt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Nt.prototype.eat=function(x){var z=this.string.charAt(this.pos),ne;if(typeof x=="string"?ne=z==x:ne=z&&(x.test?x.test(z):x(z)),ne)return++this.pos,z},Nt.prototype.eatWhile=function(x){for(var z=this.pos;this.eat(x););return this.pos>z},Nt.prototype.eatSpace=function(){for(var x=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>x},Nt.prototype.skipToEnd=function(){this.pos=this.string.length},Nt.prototype.skipTo=function(x){var z=this.string.indexOf(x,this.pos);if(z>-1)return this.pos=z,!0},Nt.prototype.backUp=function(x){this.pos-=x},Nt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Ye(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Ye(this.string,this.lineStart,this.tabSize):0)},Nt.prototype.indentation=function(){return Ye(this.string,null,this.tabSize)-(this.lineStart?Ye(this.string,this.lineStart,this.tabSize):0)},Nt.prototype.match=function(x,z,ne){if(typeof x=="string"){var te=function(me){return ne?me.toLowerCase():me},ie=this.string.substr(this.pos,x.length);if(te(ie)==te(x))return z!==!1&&(this.pos+=x.length),!0}else{var se=this.string.slice(this.pos).match(x);return se&&se.index>0?null:(se&&z!==!1&&(this.pos+=se[0].length),se)}},Nt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Nt.prototype.hideFirstChars=function(x,z){this.lineStart+=x;try{return z()}finally{this.lineStart-=x}},Nt.prototype.lookAhead=function(x){var z=this.lineOracle;return z&&z.lookAhead(x)},Nt.prototype.baseToken=function(){var x=this.lineOracle;return x&&x.baseToken(this.pos)};function Pt(x,z){if(z-=x.first,z<0||z>=x.size)throw new Error("There is no line "+(z+x.first)+" in the document.");for(var ne=x;!ne.lines;)for(var te=0;;++te){var ie=ne.children[te],se=ie.chunkSize();if(z<se){ne=ie;break}z-=se}return ne.lines[z]}function Bn(x,z,ne){var te=[],ie=z.line;return x.iter(z.line,ne.line+1,function(se){var me=se.text;ie==ne.line&&(me=me.slice(0,ne.ch)),ie==z.line&&(me=me.slice(z.ch)),te.push(me),++ie}),te}function cr(x,z,ne){var te=[];return x.iter(z,ne,function(ie){te.push(ie.text)}),te}function Wn(x,z){var ne=z-x.height;if(ne)for(var te=x;te;te=te.parent)te.height+=ne}function Un(x){if(x.parent==null)return null;for(var z=x.parent,ne=Tt(z.lines,x),te=z.parent;te;z=te,te=te.parent)for(var ie=0;te.children[ie]!=z;++ie)ne+=te.children[ie].chunkSize();return ne+z.first}function qn(x,z){var ne=x.first;e:do{for(var te=0;te<x.children.length;++te){var ie=x.children[te],se=ie.height;if(z<se){x=ie;continue e}z-=se,ne+=ie.chunkSize()}return ne}while(!x.lines);for(var me=0;me<x.lines.length;++me){var Se=x.lines[me],Ae=Se.height;if(z<Ae)break;z-=Ae}return ne+me}function Jn(x,z){return z>=x.first&&z<x.first+x.size}function Mr(x,z){return String(x.lineNumberFormatter(z+x.firstLineNumber))}function an(x,z,ne){if(ne===void 0&&(ne=null),!(this instanceof an))return new an(x,z,ne);this.line=x,this.ch=z,this.sticky=ne}function Fn(x,z){return x.line-z.line||x.ch-z.ch}function ci(x,z){return x.sticky==z.sticky&&Fn(x,z)==0}function gi(x){return an(x.line,x.ch)}function Vr(x,z){return Fn(x,z)<0?z:x}function Dr(x,z){return Fn(x,z)<0?x:z}function wi(x,z){return Math.max(x.first,Math.min(z,x.first+x.size-1))}function or(x,z){if(z.line<x.first)return an(x.first,0);var ne=x.first+x.size-1;return z.line>ne?an(ne,Pt(x,ne).text.length):oi(z,Pt(x,z.line).text.length)}function oi(x,z){var ne=x.ch;return ne==null||ne>z?an(x.line,z):ne<0?an(x.line,0):x}function hn(x,z){for(var ne=[],te=0;te<z.length;te++)ne[te]=or(x,z[te]);return ne}var Vi=function(x,z){this.state=x,this.lookAhead=z},Si=function(x,z,ne,te){this.state=z,this.doc=x,this.line=ne,this.maxLookAhead=te||0,this.baseTokens=null,this.baseTokenPos=1};Si.prototype.lookAhead=function(x){var z=this.doc.getLine(this.line+x);return z!=null&&x>this.maxLookAhead&&(this.maxLookAhead=x),z},Si.prototype.baseToken=function(x){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=x;)this.baseTokenPos+=2;var z=this.baseTokens[this.baseTokenPos+1];return{type:z&&z.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-x}},Si.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Si.fromSaved=function(x,z,ne){return z instanceof Vi?new Si(x,ht(x.mode,z.state),ne,z.lookAhead):new Si(x,ht(x.mode,z),ne)},Si.prototype.save=function(x){var z=x!==!1?ht(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Vi(z,this.maxLookAhead):z};function pa(x,z,ne,te){var ie=[x.state.modeGen],se={};Ti(x,z.text,x.doc.mode,ne,function(Pe,at){return ie.push(Pe,at)},se,te);for(var me=ne.state,Se=function(Pe){ne.baseTokens=ie;var at=x.state.overlays[Pe],vt=1,Gt=0;ne.state=!0,Ti(x,z.text,at.mode,ne,function(Ft,Rn){for(var Xn=vt;Gt<Ft;){var hr=ie[vt];hr>Ft&&ie.splice(vt,1,Ft,ie[vt+1],hr),vt+=2,Gt=Math.min(Ft,hr)}if(Rn)if(at.opaque)ie.splice(Xn,vt-Xn,Ft,"overlay "+Rn),vt=Xn+2;else for(;Xn<vt;Xn+=2){var _r=ie[Xn+1];ie[Xn+1]=(_r?_r+" ":"")+"overlay "+Rn}},se),ne.state=me,ne.baseTokens=null,ne.baseTokenPos=1},Ae=0;Ae<x.state.overlays.length;++Ae)Se(Ae);return{styles:ie,classes:se.bgClass||se.textClass?se:null}}function Wi(x,z,ne){if(!z.styles||z.styles[0]!=x.state.modeGen){var te=_i(x,Un(z)),ie=z.text.length>x.options.maxHighlightLength&&ht(x.doc.mode,te.state),se=pa(x,z,te);ie&&(te.state=ie),z.stateAfter=te.save(!ie),z.styles=se.styles,se.classes?z.styleClasses=se.classes:z.styleClasses&&(z.styleClasses=null),ne===x.doc.highlightFrontier&&(x.doc.modeFrontier=Math.max(x.doc.modeFrontier,++x.doc.highlightFrontier))}return z.styles}function _i(x,z,ne){var te=x.doc,ie=x.display;if(!te.mode.startState)return new Si(te,!0,z);var se=wa(x,z,ne),me=se>te.first&&Pt(te,se-1).stateAfter,Se=me?Si.fromSaved(te,me,se):new Si(te,_t(te.mode),se);return te.iter(se,z,function(Ae){ia(x,Ae.text,Se);var Pe=Se.line;Ae.stateAfter=Pe==z-1||Pe%5==0||Pe>=ie.viewFrom&&Pe<ie.viewTo?Se.save():null,Se.nextLine()}),ne&&(te.modeFrontier=Se.line),Se}function ia(x,z,ne,te){var ie=x.doc.mode,se=new Nt(z,x.options.tabSize,ne);for(se.start=se.pos=te||0,z==""&&Ki(ie,ne.state);!se.eol();)yi(ie,se,ne.state),se.start=se.pos}function Ki(x,z){if(x.blankLine)return x.blankLine(z);if(x.innerMode){var ne=Dt(x,z);if(ne.mode.blankLine)return ne.mode.blankLine(ne.state)}}function yi(x,z,ne,te){for(var ie=0;ie<10;ie++){te&&(te[0]=Dt(x,ne).mode);var se=x.token(z,ne);if(z.pos>z.start)return se}throw new Error("Mode "+x.name+" failed to advance stream.")}var Gi=function(x,z,ne){this.start=x.start,this.end=x.pos,this.string=x.current(),this.type=z||null,this.state=ne};function xa(x,z,ne,te){var ie=x.doc,se=ie.mode,me;z=or(ie,z);var Se=Pt(ie,z.line),Ae=_i(x,z.line,ne),Pe=new Nt(Se.text,x.options.tabSize,Ae),at;for(te&&(at=[]);(te||Pe.pos<z.ch)&&!Pe.eol();)Pe.start=Pe.pos,me=yi(se,Pe,Ae.state),te&&at.push(new Gi(Pe,me,ht(ie.mode,Ae.state)));return te?at:new Gi(Pe,me,Ae.state)}function Xi(x,z){if(x)for(;;){var ne=x.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!ne)break;x=x.slice(0,ne.index)+x.slice(ne.index+ne[0].length);var te=ne[1]?"bgClass":"textClass";z[te]==null?z[te]=ne[2]:new RegExp("(?:^|\\s)"+ne[2]+"(?:$|\\s)").test(z[te])||(z[te]+=" "+ne[2])}return x}function Ti(x,z,ne,te,ie,se,me){var Se=ne.flattenSpans;Se==null&&(Se=x.options.flattenSpans);var Ae=0,Pe=null,at=new Nt(z,x.options.tabSize,te),vt,Gt=x.options.addModeClass&&[null];for(z==""&&Xi(Ki(ne,te.state),se);!at.eol();){if(at.pos>x.options.maxHighlightLength?(Se=!1,me&&ia(x,z,te,at.pos),at.pos=z.length,vt=null):vt=Xi(yi(ne,at,te.state,Gt),se),Gt){var Ft=Gt[0].name;Ft&&(vt="m-"+(vt?Ft+" "+vt:Ft))}if(!Se||Pe!=vt){for(;Ae<at.start;)Ae=Math.min(at.start,Ae+5e3),ie(Ae,Pe);Pe=vt}at.start=at.pos}for(;Ae<at.pos;){var Rn=Math.min(at.pos,Ae+5e3);ie(Rn,Pe),Ae=Rn}}function wa(x,z,ne){for(var te,ie,se=x.doc,me=ne?-1:z-(x.doc.mode.innerMode?1e3:100),Se=z;Se>me;--Se){if(Se<=se.first)return se.first;var Ae=Pt(se,Se-1),Pe=Ae.stateAfter;if(Pe&&(!ne||Se+(Pe instanceof Vi?Pe.lookAhead:0)<=se.modeFrontier))return Se;var at=Ye(Ae.text,null,x.options.tabSize);(ie==null||te>at)&&(ie=Se-1,te=at)}return ie}function Aa(x,z){if(x.modeFrontier=Math.min(x.modeFrontier,z),!(x.highlightFrontier<z-10)){for(var ne=x.first,te=z-1;te>ne;te--){var ie=Pt(x,te).stateAfter;if(ie&&(!(ie instanceof Vi)||te+ie.lookAhead<z)){ne=te+1;break}}x.highlightFrontier=Math.min(x.highlightFrontier,ne)}}var aa=!1,ni=!1;function pt(){aa=!0}function dt(){ni=!0}function It(x,z,ne){this.marker=x,this.from=z,this.to=ne}function Qt(x,z){if(x)for(var ne=0;ne<x.length;++ne){var te=x[ne];if(te.marker==z)return te}}function Cn(x,z){for(var ne,te=0;te<x.length;++te)x[te]!=z&&(ne||(ne=[])).push(x[te]);return ne}function vr(x,z){x.markedSpans=x.markedSpans?x.markedSpans.concat([z]):[z],z.marker.attachLine(x)}function gr(x,z,ne){var te;if(x)for(var ie=0;ie<x.length;++ie){var se=x[ie],me=se.marker,Se=se.from==null||(me.inclusiveLeft?se.from<=z:se.from<z);if(Se||se.from==z&&me.type=="bookmark"&&(!ne||!se.marker.insertLeft)){var Ae=se.to==null||(me.inclusiveRight?se.to>=z:se.to>z);(te||(te=[])).push(new It(me,se.from,Ae?null:se.to))}}return te}function Er(x,z,ne){var te;if(x)for(var ie=0;ie<x.length;++ie){var se=x[ie],me=se.marker,Se=se.to==null||(me.inclusiveRight?se.to>=z:se.to>z);if(Se||se.from==z&&me.type=="bookmark"&&(!ne||se.marker.insertLeft)){var Ae=se.from==null||(me.inclusiveLeft?se.from<=z:se.from<z);(te||(te=[])).push(new It(me,Ae?null:se.from-z,se.to==null?null:se.to-z))}}return te}function Br(x,z){if(z.full)return null;var ne=Jn(x,z.from.line)&&Pt(x,z.from.line).markedSpans,te=Jn(x,z.to.line)&&Pt(x,z.to.line).markedSpans;if(!ne&&!te)return null;var ie=z.from.ch,se=z.to.ch,me=Fn(z.from,z.to)==0,Se=gr(ne,ie,me),Ae=Er(te,se,me),Pe=z.text.length==1,at=Bt(z.text).length+(Pe?ie:0);if(Se)for(var vt=0;vt<Se.length;++vt){var Gt=Se[vt];if(Gt.to==null){var Ft=Qt(Ae,Gt.marker);Ft?Pe&&(Gt.to=Ft.to==null?null:Ft.to+at):Gt.to=ie}}if(Ae)for(var Rn=0;Rn<Ae.length;++Rn){var Xn=Ae[Rn];if(Xn.to!=null&&(Xn.to+=at),Xn.from==null){var hr=Qt(Se,Xn.marker);hr||(Xn.from=at,Pe&&(Se||(Se=[])).push(Xn))}else Xn.from+=at,Pe&&(Se||(Se=[])).push(Xn)}Se&&(Se=kr(Se)),Ae&&Ae!=Se&&(Ae=kr(Ae));var _r=[Se];if(!Pe){var Or=z.text.length-2,Sr;if(Or>0&&Se)for(var Rr=0;Rr<Se.length;++Rr)Se[Rr].to==null&&(Sr||(Sr=[])).push(new It(Se[Rr].marker,null,null));for(var hi=0;hi<Or;++hi)_r.push(Sr);_r.push(Ae)}return _r}function kr(x){for(var z=0;z<x.length;++z){var ne=x[z];ne.from!=null&&ne.from==ne.to&&ne.marker.clearWhenEmpty!==!1&&x.splice(z--,1)}return x.length?x:null}function Yr(x,z,ne){var te=null;if(x.iter(z.line,ne.line+1,function(Ft){if(Ft.markedSpans)for(var Rn=0;Rn<Ft.markedSpans.length;++Rn){var Xn=Ft.markedSpans[Rn].marker;Xn.readOnly&&(!te||Tt(te,Xn)==-1)&&(te||(te=[])).push(Xn)}}),!te)return null;for(var ie=[{from:z,to:ne}],se=0;se<te.length;++se)for(var me=te[se],Se=me.find(0),Ae=0;Ae<ie.length;++Ae){var Pe=ie[Ae];if(!(Fn(Pe.to,Se.from)<0||Fn(Pe.from,Se.to)>0)){var at=[Ae,1],vt=Fn(Pe.from,Se.from),Gt=Fn(Pe.to,Se.to);(vt<0||!me.inclusiveLeft&&!vt)&&at.push({from:Pe.from,to:Se.from}),(Gt>0||!me.inclusiveRight&&!Gt)&&at.push({from:Se.to,to:Pe.to}),ie.splice.apply(ie,at),Ae+=at.length-3}}return ie}function si(x){var z=x.markedSpans;if(z){for(var ne=0;ne<z.length;++ne)z[ne].marker.detachLine(x);x.markedSpans=null}}function bi(x,z){if(z){for(var ne=0;ne<z.length;++ne)z[ne].marker.attachLine(x);x.markedSpans=z}}function Hi(x){return x.inclusiveLeft?-1:0}function Ri(x){return x.inclusiveRight?1:0}function Di(x,z){var ne=x.lines.length-z.lines.length;if(ne!=0)return ne;var te=x.find(),ie=z.find(),se=Fn(te.from,ie.from)||Hi(x)-Hi(z);if(se)return-se;var me=Fn(te.to,ie.to)||Ri(x)-Ri(z);return me||z.id-x.id}function Le(x,z){var ne=ni&&x.markedSpans,te;if(ne)for(var ie=void 0,se=0;se<ne.length;++se)ie=ne[se],ie.marker.collapsed&&(z?ie.from:ie.to)==null&&(!te||Di(te,ie.marker)<0)&&(te=ie.marker);return te}function Re(x){return Le(x,!0)}function Oe(x){return Le(x,!1)}function We(x,z){var ne=ni&&x.markedSpans,te;if(ne)for(var ie=0;ie<ne.length;++ie){var se=ne[ie];se.marker.collapsed&&(se.from==null||se.from<z)&&(se.to==null||se.to>z)&&(!te||Di(te,se.marker)<0)&&(te=se.marker)}return te}function nt(x,z,ne,te,ie){var se=Pt(x,z),me=ni&&se.markedSpans;if(me)for(var Se=0;Se<me.length;++Se){var Ae=me[Se];if(Ae.marker.collapsed){var Pe=Ae.marker.find(0),at=Fn(Pe.from,ne)||Hi(Ae.marker)-Hi(ie),vt=Fn(Pe.to,te)||Ri(Ae.marker)-Ri(ie);if(!(at>=0&&vt<=0||at<=0&&vt>=0)&&(at<=0&&(Ae.marker.inclusiveRight&&ie.inclusiveLeft?Fn(Pe.to,ne)>=0:Fn(Pe.to,ne)>0)||at>=0&&(Ae.marker.inclusiveRight&&ie.inclusiveLeft?Fn(Pe.from,te)<=0:Fn(Pe.from,te)<0)))return!0}}}function st(x){for(var z;z=Re(x);)x=z.find(-1,!0).line;return x}function mt(x){for(var z;z=Oe(x);)x=z.find(1,!0).line;return x}function zt(x){for(var z,ne;z=Oe(x);)x=z.find(1,!0).line,(ne||(ne=[])).push(x);return ne}function jt(x,z){var ne=Pt(x,z),te=st(ne);return ne==te?z:Un(te)}function Nn(x,z){if(z>x.lastLine())return z;var ne=Pt(x,z),te;if(!Qn(x,ne))return z;for(;te=Oe(ne);)ne=te.find(1,!0).line;return Un(ne)+1}function Qn(x,z){var ne=ni&&z.markedSpans;if(ne){for(var te=void 0,ie=0;ie<ne.length;++ie)if(te=ne[ie],!!te.marker.collapsed){if(te.from==null)return!0;if(!te.marker.widgetNode&&te.from==0&&te.marker.inclusiveLeft&&Dn(x,z,te))return!0}}}function Dn(x,z,ne){if(ne.to==null){var te=ne.marker.find(1,!0);return Dn(x,te.line,Qt(te.line.markedSpans,ne.marker))}if(ne.marker.inclusiveRight&&ne.to==z.text.length)return!0;for(var ie=void 0,se=0;se<z.markedSpans.length;++se)if(ie=z.markedSpans[se],ie.marker.collapsed&&!ie.marker.widgetNode&&ie.from==ne.to&&(ie.to==null||ie.to!=ne.from)&&(ie.marker.inclusiveLeft||ne.marker.inclusiveRight)&&Dn(x,z,ie))return!0}function tn(x){x=st(x);for(var z=0,ne=x.parent,te=0;te<ne.lines.length;++te){var ie=ne.lines[te];if(ie==x)break;z+=ie.height}for(var se=ne.parent;se;ne=se,se=ne.parent)for(var me=0;me<se.children.length;++me){var Se=se.children[me];if(Se==ne)break;z+=Se.height}return z}function Yt(x){if(x.height==0)return 0;for(var z=x.text.length,ne,te=x;ne=Re(te);){var ie=ne.find(0,!0);te=ie.from.line,z+=ie.from.ch-ie.to.ch}for(te=x;ne=Oe(te);){var se=ne.find(0,!0);z-=te.text.length-se.from.ch,te=se.to.line,z+=te.text.length-se.to.ch}return z}function fn(x){var z=x.display,ne=x.doc;z.maxLine=Pt(ne,ne.first),z.maxLineLength=Yt(z.maxLine),z.maxLineChanged=!0,ne.iter(function(te){var ie=Yt(te);ie>z.maxLineLength&&(z.maxLineLength=ie,z.maxLine=te)})}var xn=function(x,z,ne){this.text=x,bi(this,z),this.height=ne?ne(this):1};xn.prototype.lineNo=function(){return Un(this)},Oi(xn);function Yn(x,z,ne,te){x.text=z,x.stateAfter&&(x.stateAfter=null),x.styles&&(x.styles=null),x.order!=null&&(x.order=null),si(x),bi(x,ne);var ie=te?te(x):1;ie!=x.height&&Wn(x,ie)}function $n(x){x.parent=null,si(x)}var On={},Kn={};function zn(x,z){if(!x||/^\s*$/.test(x))return null;var ne=z.addModeClass?Kn:On;return ne[x]||(ne[x]=x.replace(/\S+/g,"cm-$&"))}function tr(x,z){var ne=xt("span",null,null,Me?"padding-right: .1px":null),te={pre:xt("pre",[ne],"CodeMirror-line"),content:ne,col:0,pos:0,cm:x,trailingSpace:!1,splitSpaces:x.getOption("lineWrapping")};z.measure={};for(var ie=0;ie<=(z.rest?z.rest.length:0);ie++){var se=ie?z.rest[ie-1]:z.line,me=void 0;te.pos=0,te.addToken=Ke,ha(x.display.measure)&&(me=Tr(se,x.doc.direction))&&(te.addToken=ft(te.addToken,me)),te.map=[];var Se=z!=x.display.externalMeasured&&Un(se);on(se,te,Wi(x,se,Se)),se.styleClasses&&(se.styleClasses.bgClass&&(te.bgClass=qt(se.styleClasses.bgClass,te.bgClass||"")),se.styleClasses.textClass&&(te.textClass=qt(se.styleClasses.textClass,te.textClass||""))),te.map.length==0&&te.map.push(0,0,te.content.appendChild(Za(x.display.measure))),ie==0?(z.measure.map=te.map,z.measure.cache={}):((z.measure.maps||(z.measure.maps=[])).push(te.map),(z.measure.caches||(z.measure.caches=[])).push({}))}if(Me){var Ae=te.content.lastChild;(/\bcm-tab\b/.test(Ae.className)||Ae.querySelector&&Ae.querySelector(".cm-tab"))&&(te.content.className="cm-tab-wrap-hack")}return Gn(x,"renderLine",x,z.line,te.pre),te.pre.className&&(te.textClass=qt(te.pre.className,te.textClass||"")),te}function $e(x){var z=bt("span","\u2022","cm-invalidchar");return z.title="\\u"+x.charCodeAt(0).toString(16),z.setAttribute("aria-label",z.title),z}function Ke(x,z,ne,te,ie,se,me){if(z){var Se=x.splitSpaces?Ct(z,x.trailingSpace):z,Ae=x.cm.state.specialChars,Pe=!1,at;if(!Ae.test(z))x.col+=z.length,at=document.createTextNode(Se),x.map.push(x.pos,x.pos+z.length,at),ye&&Ce<9&&(Pe=!0),x.pos+=z.length;else{at=document.createDocumentFragment();for(var vt=0;;){Ae.lastIndex=vt;var Gt=Ae.exec(z),Ft=Gt?Gt.index-vt:z.length-vt;if(Ft){var Rn=document.createTextNode(Se.slice(vt,vt+Ft));ye&&Ce<9?at.appendChild(bt("span",[Rn])):at.appendChild(Rn),x.map.push(x.pos,x.pos+Ft,Rn),x.col+=Ft,x.pos+=Ft}if(!Gt)break;vt+=Ft+1;var Xn=void 0;if(Gt[0]==" "){var hr=x.cm.options.tabSize,_r=hr-x.col%hr;Xn=at.appendChild(bt("span",$t(_r),"cm-tab")),Xn.setAttribute("role","presentation"),Xn.setAttribute("cm-text"," "),x.col+=_r}else Gt[0]=="\r"||Gt[0]==`
`?(Xn=at.appendChild(bt("span",Gt[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Xn.setAttribute("cm-text",Gt[0]),x.col+=1):(Xn=x.cm.options.specialCharPlaceholder(Gt[0]),Xn.setAttribute("cm-text",Gt[0]),ye&&Ce<9?at.appendChild(bt("span",[Xn])):at.appendChild(Xn),x.col+=1);x.map.push(x.pos,x.pos+1,Xn),x.pos++}}if(x.trailingSpace=Se.charCodeAt(z.length-1)==32,ne||te||ie||Pe||se||me){var Or=ne||"";te&&(Or+=te),ie&&(Or+=ie);var Sr=bt("span",[at],Or,se);if(me)for(var Rr in me)me.hasOwnProperty(Rr)&&Rr!="style"&&Rr!="class"&&Sr.setAttribute(Rr,me[Rr]);return x.content.appendChild(Sr)}x.content.appendChild(at)}}function Ct(x,z){if(x.length>1&&!/ /.test(x))return x;for(var ne=z,te="",ie=0;ie<x.length;ie++){var se=x.charAt(ie);se==" "&&ne&&(ie==x.length-1||x.charCodeAt(ie+1)==32)&&(se="\xA0"),te+=se,ne=se==" "}return te}function ft(x,z){return function(ne,te,ie,se,me,Se,Ae){ie=ie?ie+" cm-force-border":"cm-force-border";for(var Pe=ne.pos,at=Pe+te.length;;){for(var vt=void 0,Gt=0;Gt<z.length&&(vt=z[Gt],!(vt.to>Pe&&vt.from<=Pe));Gt++);if(vt.to>=at)return x(ne,te,ie,se,me,Se,Ae);x(ne,te.slice(0,vt.to-Pe),ie,se,null,Se,Ae),se=null,te=te.slice(vt.to-Pe),Pe=vt.to}}}function Kt(x,z,ne,te){var ie=!te&&ne.widgetNode;ie&&x.map.push(x.pos,x.pos+z,ie),!te&&x.cm.display.input.needsContentAttribute&&(ie||(ie=x.content.appendChild(document.createElement("span"))),ie.setAttribute("cm-marker",ne.id)),ie&&(x.cm.display.input.setUneditable(ie),x.content.appendChild(ie)),x.pos+=z,x.trailingSpace=!1}function on(x,z,ne){var te=x.markedSpans,ie=x.text,se=0;if(!te){for(var me=1;me<ne.length;me+=2)z.addToken(z,ie.slice(se,se=ne[me]),zn(ne[me+1],z.cm.options));return}for(var Se=ie.length,Ae=0,Pe=1,at="",vt,Gt,Ft=0,Rn,Xn,hr,_r,Or;;){if(Ft==Ae){Rn=Xn=hr=Gt="",Or=null,_r=null,Ft=1/0;for(var Sr=[],Rr=void 0,hi=0;hi<te.length;++hi){var vi=te[hi],ra=vi.marker;if(ra.type=="bookmark"&&vi.from==Ae&&ra.widgetNode)Sr.push(ra);else if(vi.from<=Ae&&(vi.to==null||vi.to>Ae||ra.collapsed&&vi.to==Ae&&vi.from==Ae)){if(vi.to!=null&&vi.to!=Ae&&Ft>vi.to&&(Ft=vi.to,Xn=""),ra.className&&(Rn+=" "+ra.className),ra.css&&(Gt=(Gt?Gt+";":"")+ra.css),ra.startStyle&&vi.from==Ae&&(hr+=" "+ra.startStyle),ra.endStyle&&vi.to==Ft&&(Rr||(Rr=[])).push(ra.endStyle,vi.to),ra.title&&((Or||(Or={})).title=ra.title),ra.attributes)for(var eo in ra.attributes)(Or||(Or={}))[eo]=ra.attributes[eo];ra.collapsed&&(!_r||Di(_r.marker,ra)<0)&&(_r=vi)}else vi.from>Ae&&Ft>vi.from&&(Ft=vi.from)}if(Rr)for(var Wo=0;Wo<Rr.length;Wo+=2)Rr[Wo+1]==Ft&&(Xn+=" "+Rr[Wo]);if(!_r||_r.from==Ae)for(var bo=0;bo<Sr.length;++bo)Kt(z,0,Sr[bo]);if(_r&&(_r.from||0)==Ae){if(Kt(z,(_r.to==null?Se+1:_r.to)-Ae,_r.marker,_r.from==null),_r.to==null)return;_r.to==Ae&&(_r=!1)}}if(Ae>=Se)break;for(var cs=Math.min(Se,Ft);;){if(at){var ds=Ae+at.length;if(!_r){var Io=ds>cs?at.slice(0,cs-Ae):at;z.addToken(z,Io,vt?vt+Rn:Rn,hr,Ae+Io.length==Ft?Xn:"",Gt,Or)}if(ds>=cs){at=at.slice(cs-Ae),Ae=cs;break}Ae=ds,hr=""}at=ie.slice(se,se=ne[Pe++]),vt=zn(ne[Pe++],z.cm.options)}}}function nn(x,z,ne){this.line=z,this.rest=zt(z),this.size=this.rest?Un(Bt(this.rest))-ne+1:1,this.node=this.text=null,this.hidden=Qn(x,z)}function En(x,z,ne){for(var te=[],ie,se=z;se<ne;se=ie){var me=new nn(x.doc,Pt(x.doc,se),se);ie=se+me.size,te.push(me)}return te}var pn=null;function Zt(x){pn?pn.ops.push(x):x.ownsGroup=pn={ops:[x],delayedCallbacks:[]}}function wn(x){var z=x.delayedCallbacks,ne=0;do{for(;ne<z.length;ne++)z[ne].call(null);for(var te=0;te<x.ops.length;te++){var ie=x.ops[te];if(ie.cursorActivityHandlers)for(;ie.cursorActivityCalled<ie.cursorActivityHandlers.length;)ie.cursorActivityHandlers[ie.cursorActivityCalled++].call(null,ie.cm)}}while(ne<z.length)}function kn(x,z){var ne=x.ownsGroup;if(ne)try{wn(ne)}finally{pn=null,z(ne)}}var er=null;function Mn(x,z){var ne=Nr(x,z);if(ne.length){var te=Array.prototype.slice.call(arguments,2),ie;pn?ie=pn.delayedCallbacks:er?ie=er:(ie=er=[],setTimeout(dr,0));for(var se=function(Se){ie.push(function(){return ne[Se].apply(null,te)})},me=0;me<ne.length;++me)se(me)}}function dr(){var x=er;er=null;for(var z=0;z<x.length;++z)x[z]()}function Lr(x,z,ne,te){for(var ie=0;ie<z.changes.length;ie++){var se=z.changes[ie];se=="text"?yr(x,z):se=="gutter"?$r(x,z,ne,te):se=="class"?Ir(x,z):se=="widget"&&mr(x,z,te)}z.changes=null}function pr(x){return x.node==x.text&&(x.node=bt("div",null,null,"position: relative"),x.text.parentNode&&x.text.parentNode.replaceChild(x.node,x.text),x.node.appendChild(x.text),ye&&Ce<8&&(x.node.style.zIndex=2)),x.node}function wr(x,z){var ne=z.bgClass?z.bgClass+" "+(z.line.bgClass||""):z.line.bgClass;if(ne&&(ne+=" CodeMirror-linebackground"),z.background)ne?z.background.className=ne:(z.background.parentNode.removeChild(z.background),z.background=null);else if(ne){var te=pr(z);z.background=te.insertBefore(bt("div",null,ne),te.firstChild),x.display.input.setUneditable(z.background)}}function ir(x,z){var ne=x.display.externalMeasured;return ne&&ne.line==z.line?(x.display.externalMeasured=null,z.measure=ne.measure,ne.built):tr(x,z)}function yr(x,z){var ne=z.text.className,te=ir(x,z);z.text==z.node&&(z.node=te.pre),z.text.parentNode.replaceChild(te.pre,z.text),z.text=te.pre,te.bgClass!=z.bgClass||te.textClass!=z.textClass?(z.bgClass=te.bgClass,z.textClass=te.textClass,Ir(x,z)):ne&&(z.text.className=ne)}function Ir(x,z){wr(x,z),z.line.wrapClass?pr(z).className=z.line.wrapClass:z.node!=z.text&&(z.node.className="");var ne=z.textClass?z.textClass+" "+(z.line.textClass||""):z.line.textClass;z.text.className=ne||""}function $r(x,z,ne,te){if(z.gutter&&(z.node.removeChild(z.gutter),z.gutter=null),z.gutterBackground&&(z.node.removeChild(z.gutterBackground),z.gutterBackground=null),z.line.gutterClass){var ie=pr(z);z.gutterBackground=bt("div",null,"CodeMirror-gutter-background "+z.line.gutterClass,"left: "+(x.options.fixedGutter?te.fixedPos:-te.gutterTotalWidth)+"px; width: "+te.gutterTotalWidth+"px"),x.display.input.setUneditable(z.gutterBackground),ie.insertBefore(z.gutterBackground,z.text)}var se=z.line.gutterMarkers;if(x.options.lineNumbers||se){var me=pr(z),Se=z.gutter=bt("div",null,"CodeMirror-gutter-wrapper","left: "+(x.options.fixedGutter?te.fixedPos:-te.gutterTotalWidth)+"px");if(x.display.input.setUneditable(Se),me.insertBefore(Se,z.text),z.line.gutterClass&&(Se.className+=" "+z.line.gutterClass),x.options.lineNumbers&&(!se||!se["CodeMirror-linenumbers"])&&(z.lineNumber=Se.appendChild(bt("div",Mr(x.options,ne),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+te.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+x.display.lineNumInnerWidth+"px"))),se)for(var Ae=0;Ae<x.display.gutterSpecs.length;++Ae){var Pe=x.display.gutterSpecs[Ae].className,at=se.hasOwnProperty(Pe)&&se[Pe];at&&Se.appendChild(bt("div",[at],"CodeMirror-gutter-elt","left: "+te.gutterLeft[Pe]+"px; width: "+te.gutterWidth[Pe]+"px"))}}}function mr(x,z,ne){z.alignable&&(z.alignable=null);for(var te=_e("CodeMirror-linewidget"),ie=z.node.firstChild,se=void 0;ie;ie=se)se=ie.nextSibling,te.test(ie.className)&&z.node.removeChild(ie);li(x,z,ne)}function Wr(x,z,ne,te){var ie=ir(x,z);return z.text=z.node=ie.pre,ie.bgClass&&(z.bgClass=ie.bgClass),ie.textClass&&(z.textClass=ie.textClass),Ir(x,z),$r(x,z,ne,te),li(x,z,te),z.node}function li(x,z,ne){if(Ii(x,z.line,z,ne,!0),z.rest)for(var te=0;te<z.rest.length;te++)Ii(x,z.rest[te],z,ne,!1)}function Ii(x,z,ne,te,ie){if(z.widgets)for(var se=pr(ne),me=0,Se=z.widgets;me<Se.length;++me){var Ae=Se[me],Pe=bt("div",[Ae.node],"CodeMirror-linewidget"+(Ae.className?" "+Ae.className:""));Ae.handleMouseEvents||Pe.setAttribute("cm-ignore-events","true"),Ci(Ae,Pe,ne,te),x.display.input.setUneditable(Pe),ie&&Ae.above?se.insertBefore(Pe,ne.gutter||ne.text):se.appendChild(Pe),Mn(Ae,"redraw")}}function Ci(x,z,ne,te){if(x.noHScroll){(ne.alignable||(ne.alignable=[])).push(z);var ie=te.wrapperWidth;z.style.left=te.fixedPos+"px",x.coverGutter||(ie-=te.gutterTotalWidth,z.style.paddingLeft=te.gutterTotalWidth+"px"),z.style.width=ie+"px"}x.coverGutter&&(z.style.zIndex=5,z.style.position="relative",x.noHScroll||(z.style.marginLeft=-te.gutterTotalWidth+"px"))}function di(x){if(x.height!=null)return x.height;var z=x.doc.cm;if(!z)return 0;if(!Ot(document.body,x.node)){var ne="position: relative;";x.coverGutter&&(ne+="margin-left: -"+z.display.gutters.offsetWidth+"px;"),x.noHScroll&&(ne+="width: "+z.display.wrapper.clientWidth+"px;"),At(z.display.measure,bt("div",[x.node],null,ne))}return x.height=x.node.parentNode.offsetHeight}function ki(x,z){for(var ne=ca(z);ne!=x.wrapper;ne=ne.parentNode)if(!ne||ne.nodeType==1&&ne.getAttribute("cm-ignore-events")=="true"||ne.parentNode==x.sizer&&ne!=x.mover)return!0}function Li(x){return x.lineSpace.offsetTop}function Gr(x){return x.mover.offsetHeight-x.lineSpace.offsetHeight}function fi(x){if(x.cachedPaddingH)return x.cachedPaddingH;var z=At(x.measure,bt("pre","x","CodeMirror-line-like")),ne=window.getComputedStyle?window.getComputedStyle(z):z.currentStyle,te={left:parseInt(ne.paddingLeft),right:parseInt(ne.paddingRight)};return!isNaN(te.left)&&!isNaN(te.right)&&(x.cachedPaddingH=te),te}function Ar(x){return gn-x.display.nativeBarWidth}function Ur(x){return x.display.scroller.clientWidth-Ar(x)-x.display.barWidth}function ri(x){return x.display.scroller.clientHeight-Ar(x)-x.display.barHeight}function Mi(x,z,ne){var te=x.options.lineWrapping,ie=te&&Ur(x);if(!z.measure.heights||te&&z.measure.width!=ie){var se=z.measure.heights=[];if(te){z.measure.width=ie;for(var me=z.text.firstChild.getClientRects(),Se=0;Se<me.length-1;Se++){var Ae=me[Se],Pe=me[Se+1];Math.abs(Ae.bottom-Pe.bottom)>2&&se.push((Ae.bottom+Pe.top)/2-ne.top)}}se.push(ne.bottom-ne.top)}}function Ba(x,z,ne){if(x.line==z)return{map:x.measure.map,cache:x.measure.cache};for(var te=0;te<x.rest.length;te++)if(x.rest[te]==z)return{map:x.measure.maps[te],cache:x.measure.caches[te]};for(var ie=0;ie<x.rest.length;ie++)if(Un(x.rest[ie])>ne)return{map:x.measure.maps[ie],cache:x.measure.caches[ie],before:!0}}function Oa(x,z){z=st(z);var ne=Un(z),te=x.display.externalMeasured=new nn(x.doc,z,ne);te.lineN=ne;var ie=te.built=tr(x,te);return te.text=ie.pre,At(x.display.lineMeasure,ie.pre),te}function Sa(x,z,ne,te){return Jr(x,Ai(x,z),ne,te)}function Ui(x,z){if(z>=x.display.viewFrom&&z<x.display.viewTo)return x.display.view[Pi(x,z)];var ne=x.display.externalMeasured;if(ne&&z>=ne.lineN&&z<ne.lineN+ne.size)return ne}function Ai(x,z){var ne=Un(z),te=Ui(x,ne);te&&!te.text?te=null:te&&te.changes&&(Lr(x,te,ne,ho(x)),x.curOp.forceUpdate=!0),te||(te=Oa(x,z));var ie=Ba(te,z,ne);return{line:z,view:te,rect:null,map:ie.map,cache:ie.cache,before:ie.before,hasHeights:!1}}function Jr(x,z,ne,te,ie){z.before&&(ne=-1);var se=ne+(te||""),me;return z.cache.hasOwnProperty(se)?me=z.cache[se]:(z.rect||(z.rect=z.view.text.getBoundingClientRect()),z.hasHeights||(Mi(x,z.view,z.rect),z.hasHeights=!0),me=pi(x,z,ne,te),me.bogus||(z.cache[se]=me)),{left:me.left,right:me.right,top:ie?me.rtop:me.top,bottom:ie?me.rbottom:me.bottom}}var Ta={left:0,right:0,top:0,bottom:0};function ei(x,z,ne){for(var te,ie,se,me,Se,Ae,Pe=0;Pe<x.length;Pe+=3)if(Se=x[Pe],Ae=x[Pe+1],z<Se?(ie=0,se=1,me="left"):z<Ae?(ie=z-Se,se=ie+1):(Pe==x.length-3||z==Ae&&x[Pe+3]>z)&&(se=Ae-Se,ie=se-1,z>=Ae&&(me="right")),ie!=null){if(te=x[Pe+2],Se==Ae&&ne==(te.insertLeft?"left":"right")&&(me=ne),ne=="left"&&ie==0)for(;Pe&&x[Pe-2]==x[Pe-3]&&x[Pe-1].insertLeft;)te=x[(Pe-=3)+2],me="left";if(ne=="right"&&ie==Ae-Se)for(;Pe<x.length-3&&x[Pe+3]==x[Pe+4]&&!x[Pe+5].insertLeft;)te=x[(Pe+=3)+2],me="right";break}return{node:te,start:ie,end:se,collapse:me,coverStart:Se,coverEnd:Ae}}function Pr(x,z){var ne=Ta;if(z=="left")for(var te=0;te<x.length&&(ne=x[te]).left==ne.right;te++);else for(var ie=x.length-1;ie>=0&&(ne=x[ie]).left==ne.right;ie--);return ne}function pi(x,z,ne,te){var ie=ei(z.map,ne,te),se=ie.node,me=ie.start,Se=ie.end,Ae=ie.collapse,Pe;if(se.nodeType==3){for(var at=0;at<4;at++){for(;me&&yt(z.line.text.charAt(ie.coverStart+me));)--me;for(;ie.coverStart+Se<ie.coverEnd&&yt(z.line.text.charAt(ie.coverStart+Se));)++Se;if(ye&&Ce<9&&me==0&&Se==ie.coverEnd-ie.coverStart?Pe=se.parentNode.getBoundingClientRect():Pe=Pr(Ge(se,me,Se).getClientRects(),te),Pe.left||Pe.right||me==0)break;Se=me,me=me-1,Ae="right"}ye&&Ce<11&&(Pe=Zi(x.display.measure,Pe))}else{me>0&&(Ae=te="right");var vt;x.options.lineWrapping&&(vt=se.getClientRects()).length>1?Pe=vt[te=="right"?vt.length-1:0]:Pe=se.getBoundingClientRect()}if(ye&&Ce<9&&!me&&(!Pe||!Pe.left&&!Pe.right)){var Gt=se.parentNode.getClientRects()[0];Gt?Pe={left:Gt.left,right:Gt.left+ro(x.display),top:Gt.top,bottom:Gt.bottom}:Pe=Ta}for(var Ft=Pe.top-z.rect.top,Rn=Pe.bottom-z.rect.top,Xn=(Ft+Rn)/2,hr=z.view.measure.heights,_r=0;_r<hr.length-1&&!(Xn<hr[_r]);_r++);var Or=_r?hr[_r-1]:0,Sr=hr[_r],Rr={left:(Ae=="right"?Pe.right:Pe.left)-z.rect.left,right:(Ae=="left"?Pe.left:Pe.right)-z.rect.left,top:Or,bottom:Sr};return!Pe.left&&!Pe.right&&(Rr.bogus=!0),x.options.singleCursorHeightPerLine||(Rr.rtop=Ft,Rr.rbottom=Rn),Rr}function Zi(x,z){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!xr(x))return z;var ne=screen.logicalXDPI/screen.deviceXDPI,te=screen.logicalYDPI/screen.deviceYDPI;return{left:z.left*ne,right:z.right*ne,top:z.top*te,bottom:z.bottom*te}}function xi(x){if(x.measure&&(x.measure.cache={},x.measure.heights=null,x.rest))for(var z=0;z<x.rest.length;z++)x.measure.caches[z]={}}function Ni(x){x.display.externalMeasure=null,Ze(x.display.lineMeasure);for(var z=0;z<x.display.view.length;z++)xi(x.display.view[z])}function Zr(x){Ni(x),x.display.cachedCharWidth=x.display.cachedTextHeight=x.display.cachedPaddingH=null,x.options.lineWrapping||(x.display.maxLineChanged=!0),x.display.lineNumChars=null}function Ji(){return he&&Qe?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function oa(){return he&&Qe?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function qi(x){var z=0;if(x.widgets)for(var ne=0;ne<x.widgets.length;++ne)x.widgets[ne].above&&(z+=di(x.widgets[ne]));return z}function sa(x,z,ne,te,ie){if(!ie){var se=qi(z);ne.top+=se,ne.bottom+=se}if(te=="line")return ne;te||(te="local");var me=tn(z);if(te=="local"?me+=Li(x.display):me-=x.display.viewOffset,te=="page"||te=="window"){var Se=x.display.lineSpace.getBoundingClientRect();me+=Se.top+(te=="window"?0:oa());var Ae=Se.left+(te=="window"?0:Ji());ne.left+=Ae,ne.right+=Ae}return ne.top+=me,ne.bottom+=me,ne}function ma(x,z,ne){if(ne=="div")return z;var te=z.left,ie=z.top;if(ne=="page")te-=Ji(),ie-=oa();else if(ne=="local"||!ne){var se=x.display.sizer.getBoundingClientRect();te+=se.left,ie+=se.top}var me=x.display.lineSpace.getBoundingClientRect();return{left:te-me.left,top:ie-me.top}}function Va(x,z,ne,te,ie){return te||(te=Pt(x.doc,z.line)),sa(x,te,Sa(x,te,z.ch,ie),ne)}function Yi(x,z,ne,te,ie,se){te=te||Pt(x.doc,z.line),ie||(ie=Ai(x,te));function me(Rn,Xn){var hr=Jr(x,ie,Rn,Xn?"right":"left",se);return Xn?hr.left=hr.right:hr.right=hr.left,sa(x,te,hr,ne)}var Se=Tr(te,x.doc.direction),Ae=z.ch,Pe=z.sticky;if(Ae>=te.text.length?(Ae=te.text.length,Pe="before"):Ae<=0&&(Ae=0,Pe="after"),!Se)return me(Pe=="before"?Ae-1:Ae,Pe=="before");function at(Rn,Xn,hr){var _r=Se[Xn],Or=_r.level==1;return me(hr?Rn-1:Rn,Or!=hr)}var vt=Jt(Se,Ae,Pe),Gt=yn,Ft=at(Ae,vt,Pe=="before");return Gt!=null&&(Ft.other=at(Ae,Gt,Pe!="before")),Ft}function ga(x,z){var ne=0;z=or(x.doc,z),x.options.lineWrapping||(ne=ro(x.display)*z.ch);var te=Pt(x.doc,z.line),ie=tn(te)+Li(x.display);return{left:ne,right:ne,top:ie,bottom:ie+te.height}}function Ya(x,z,ne,te,ie){var se=an(x,z,ne);return se.xRel=ie,te&&(se.outside=te),se}function ja(x,z,ne){var te=x.doc;if(ne+=x.display.viewOffset,ne<0)return Ya(te.first,0,null,-1,-1);var ie=qn(te,ne),se=te.first+te.size-1;if(ie>se)return Ya(te.first+te.size-1,Pt(te,se).text.length,null,1,1);z<0&&(z=0);for(var me=Pt(te,ie);;){var Se=ti(x,me,ie,z,ne),Ae=We(me,Se.ch+(Se.xRel>0||Se.outside>0?1:0));if(!Ae)return Se;var Pe=Ae.find(1);if(Pe.line==ie)return Pe;me=Pt(te,ie=Pe.line)}}function oo(x,z,ne,te){te-=qi(z);var ie=z.text.length,se=en(function(me){return Jr(x,ne,me-1).bottom<=te},ie,0);return ie=en(function(me){return Jr(x,ne,me).top>te},se,ie),{begin:se,end:ie}}function Ra(x,z,ne,te){ne||(ne=Ai(x,z));var ie=sa(x,z,Jr(x,ne,te),"line").top;return oo(x,z,ne,ie)}function da(x,z,ne,te){return x.bottom<=ne?!1:x.top>ne?!0:(te?x.left:x.right)>z}function ti(x,z,ne,te,ie){ie-=tn(z);var se=Ai(x,z),me=qi(z),Se=0,Ae=z.text.length,Pe=!0,at=Tr(z,x.doc.direction);if(at){var vt=(x.options.lineWrapping?ji:mi)(x,z,ne,se,at,te,ie);Pe=vt.level!=1,Se=Pe?vt.from:vt.to-1,Ae=Pe?vt.to:vt.from-1}var Gt=null,Ft=null,Rn=en(function(hi){var vi=Jr(x,se,hi);return vi.top+=me,vi.bottom+=me,da(vi,te,ie,!1)?(vi.top<=ie&&vi.left<=te&&(Gt=hi,Ft=vi),!0):!1},Se,Ae),Xn,hr,_r=!1;if(Ft){var Or=te-Ft.left<Ft.right-te,Sr=Or==Pe;Rn=Gt+(Sr?0:1),hr=Sr?"after":"before",Xn=Or?Ft.left:Ft.right}else{!Pe&&(Rn==Ae||Rn==Se)&&Rn++,hr=Rn==0?"after":Rn==z.text.length?"before":Jr(x,se,Rn-(Pe?1:0)).bottom+me<=ie==Pe?"after":"before";var Rr=Yi(x,an(ne,Rn,hr),"line",z,se);Xn=Rr.left,_r=ie<Rr.top?-1:ie>=Rr.bottom?1:0}return Rn=Vt(z.text,Rn,1),Ya(ne,Rn,hr,_r,te-Xn)}function mi(x,z,ne,te,ie,se,me){var Se=en(function(vt){var Gt=ie[vt],Ft=Gt.level!=1;return da(Yi(x,an(ne,Ft?Gt.to:Gt.from,Ft?"before":"after"),"line",z,te),se,me,!0)},0,ie.length-1),Ae=ie[Se];if(Se>0){var Pe=Ae.level!=1,at=Yi(x,an(ne,Pe?Ae.from:Ae.to,Pe?"after":"before"),"line",z,te);da(at,se,me,!0)&&at.top>me&&(Ae=ie[Se-1])}return Ae}function ji(x,z,ne,te,ie,se,me){var Se=oo(x,z,te,me),Ae=Se.begin,Pe=Se.end;/\s/.test(z.text.charAt(Pe-1))&&Pe--;for(var at=null,vt=null,Gt=0;Gt<ie.length;Gt++){var Ft=ie[Gt];if(!(Ft.from>=Pe||Ft.to<=Ae)){var Rn=Ft.level!=1,Xn=Jr(x,te,Rn?Math.min(Pe,Ft.to)-1:Math.max(Ae,Ft.from)).right,hr=Xn<se?se-Xn+1e9:Xn-se;(!at||vt>hr)&&(at=Ft,vt=hr)}}return at||(at=ie[ie.length-1]),at.from<Ae&&(at={from:Ae,to:at.to,level:at.level}),at.to>Pe&&(at={from:at.from,to:Pe,level:at.level}),at}var la;function Fa(x){if(x.cachedTextHeight!=null)return x.cachedTextHeight;if(la==null){la=bt("pre",null,"CodeMirror-line-like");for(var z=0;z<49;++z)la.appendChild(document.createTextNode("x")),la.appendChild(bt("br"));la.appendChild(document.createTextNode("x"))}At(x.measure,la);var ne=la.offsetHeight/50;return ne>3&&(x.cachedTextHeight=ne),Ze(x.measure),ne||1}function ro(x){if(x.cachedCharWidth!=null)return x.cachedCharWidth;var z=bt("span","xxxxxxxxxx"),ne=bt("pre",[z],"CodeMirror-line-like");At(x.measure,ne);var te=z.getBoundingClientRect(),ie=(te.right-te.left)/10;return ie>2&&(x.cachedCharWidth=ie),ie||10}function ho(x){for(var z=x.display,ne={},te={},ie=z.gutters.clientLeft,se=z.gutters.firstChild,me=0;se;se=se.nextSibling,++me){var Se=x.display.gutterSpecs[me].className;ne[Se]=se.offsetLeft+se.clientLeft+ie,te[Se]=se.clientWidth}return{fixedPos:Bo(z),gutterTotalWidth:z.gutters.offsetWidth,gutterLeft:ne,gutterWidth:te,wrapperWidth:z.wrapper.clientWidth}}function Bo(x){return x.scroller.getBoundingClientRect().left-x.sizer.getBoundingClientRect().left}function Oo(x){var z=Fa(x.display),ne=x.options.lineWrapping,te=ne&&Math.max(5,x.display.scroller.clientWidth/ro(x.display)-3);return function(ie){if(Qn(x.doc,ie))return 0;var se=0;if(ie.widgets)for(var me=0;me<ie.widgets.length;me++)ie.widgets[me].height&&(se+=ie.widgets[me].height);return ne?se+(Math.ceil(ie.text.length/te)||1)*z:se+z}}function so(x){var z=x.doc,ne=Oo(x);z.iter(function(te){var ie=ne(te);ie!=te.height&&Wn(te,ie)})}function Ao(x,z,ne,te){var ie=x.display;if(!ne&&ca(z).getAttribute("cm-not-content")=="true")return null;var se,me,Se=ie.lineSpace.getBoundingClientRect();try{se=z.clientX-Se.left,me=z.clientY-Se.top}catch(vt){return null}var Ae=ja(x,se,me),Pe;if(te&&Ae.xRel>0&&(Pe=Pt(x.doc,Ae.line).text).length==Ae.ch){var at=Ye(Pe,Pe.length,x.options.tabSize)-Pe.length;Ae=an(Ae.line,Math.max(0,Math.round((se-fi(x.display).left)/ro(x.display))-at))}return Ae}function Pi(x,z){if(z>=x.display.viewTo||(z-=x.display.viewFrom,z<0))return null;for(var ne=x.display.view,te=0;te<ne.length;te++)if(z-=ne[te].size,z<0)return te}function ui(x,z,ne,te){z==null&&(z=x.doc.first),ne==null&&(ne=x.doc.first+x.doc.size),te||(te=0);var ie=x.display;if(te&&ne<ie.viewTo&&(ie.updateLineNumbers==null||ie.updateLineNumbers>z)&&(ie.updateLineNumbers=z),x.curOp.viewChanged=!0,z>=ie.viewTo)ni&&jt(x.doc,z)<ie.viewTo&&va(x);else if(ne<=ie.viewFrom)ni&&Nn(x.doc,ne+te)>ie.viewFrom?va(x):(ie.viewFrom+=te,ie.viewTo+=te);else if(z<=ie.viewFrom&&ne>=ie.viewTo)va(x);else if(z<=ie.viewFrom){var se=lo(x,ne,ne+te,1);se?(ie.view=ie.view.slice(se.index),ie.viewFrom=se.lineN,ie.viewTo+=te):va(x)}else if(ne>=ie.viewTo){var me=lo(x,z,z,-1);me?(ie.view=ie.view.slice(0,me.index),ie.viewTo=me.lineN):va(x)}else{var Se=lo(x,z,z,-1),Ae=lo(x,ne,ne+te,1);Se&&Ae?(ie.view=ie.view.slice(0,Se.index).concat(En(x,Se.lineN,Ae.lineN)).concat(ie.view.slice(Ae.index)),ie.viewTo+=te):va(x)}var Pe=ie.externalMeasured;Pe&&(ne<Pe.lineN?Pe.lineN+=te:z<Pe.lineN+Pe.size&&(ie.externalMeasured=null))}function Ca(x,z,ne){x.curOp.viewChanged=!0;var te=x.display,ie=x.display.externalMeasured;if(ie&&z>=ie.lineN&&z<ie.lineN+ie.size&&(te.externalMeasured=null),!(z<te.viewFrom||z>=te.viewTo)){var se=te.view[Pi(x,z)];if(se.node!=null){var me=se.changes||(se.changes=[]);Tt(me,ne)==-1&&me.push(ne)}}}function va(x){x.display.viewFrom=x.display.viewTo=x.doc.first,x.display.view=[],x.display.viewOffset=0}function lo(x,z,ne,te){var ie=Pi(x,z),se,me=x.display.view;if(!ni||ne==x.doc.first+x.doc.size)return{index:ie,lineN:ne};for(var Se=x.display.viewFrom,Ae=0;Ae<ie;Ae++)Se+=me[Ae].size;if(Se!=z){if(te>0){if(ie==me.length-1)return null;se=Se+me[ie].size-z,ie++}else se=Se-z;z+=se,ne+=se}for(;jt(x.doc,ne)!=ne;){if(ie==(te<0?0:me.length-1))return null;ne+=te*me[ie-(te<0?1:0)].size,ie+=te}return{index:ie,lineN:ne}}function io(x,z,ne){var te=x.display,ie=te.view;ie.length==0||z>=te.viewTo||ne<=te.viewFrom?(te.view=En(x,z,ne),te.viewFrom=z):(te.viewFrom>z?te.view=En(x,z,te.viewFrom).concat(te.view):te.viewFrom<z&&(te.view=te.view.slice(Pi(x,z))),te.viewFrom=z,te.viewTo<ne?te.view=te.view.concat(En(x,te.viewTo,ne)):te.viewTo>ne&&(te.view=te.view.slice(0,Pi(x,ne)))),te.viewTo=ne}function hs(x){for(var z=x.display.view,ne=0,te=0;te<z.length;te++){var ie=z[te];!ie.hidden&&(!ie.node||ie.changes)&&++ne}return ne}function Qo(x){x.display.input.showSelection(x.display.input.prepareSelection())}function ps(x,z){z===void 0&&(z=!0);for(var ne=x.doc,te={},ie=te.cursors=document.createDocumentFragment(),se=te.selection=document.createDocumentFragment(),me=0;me<ne.sel.ranges.length;me++)if(!(!z&&me==ne.sel.primIndex)){var Se=ne.sel.ranges[me];if(!(Se.from().line>=x.display.viewTo||Se.to().line<x.display.viewFrom)){var Ae=Se.empty();(Ae||x.options.showCursorWhenSelecting)&&$i(x,Se.head,ie),Ae||Xr(x,Se,se)}}return te}function $i(x,z,ne){var te=Yi(x,z,"div",null,null,!x.options.singleCursorHeightPerLine),ie=ne.appendChild(bt("div","\xA0","CodeMirror-cursor"));if(ie.style.left=te.left+"px",ie.style.top=te.top+"px",ie.style.height=Math.max(0,te.bottom-te.top)*x.options.cursorHeight+"px",te.other){var se=ne.appendChild(bt("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));se.style.display="",se.style.left=te.other.left+"px",se.style.top=te.other.top+"px",se.style.height=(te.other.bottom-te.other.top)*.85+"px"}}function fr(x,z){return x.top-z.top||x.left-z.left}function Xr(x,z,ne){var te=x.display,ie=x.doc,se=document.createDocumentFragment(),me=fi(x.display),Se=me.left,Ae=Math.max(te.sizerWidth,Ur(x)-te.sizer.offsetLeft)-me.right,Pe=ie.direction=="ltr";function at(Sr,Rr,hi,vi){Rr<0&&(Rr=0),Rr=Math.round(Rr),vi=Math.round(vi),se.appendChild(bt("div",null,"CodeMirror-selected","position: absolute; left: "+Sr+`px;
top: `+Rr+"px; width: "+(hi==null?Ae-Sr:hi)+`px;
height: `+(vi-Rr)+"px"))}function vt(Sr,Rr,hi){var vi=Pt(ie,Sr),ra=vi.text.length,eo,Wo;function bo(Io,fs){return Va(x,an(Sr,Io),"div",vi,fs)}function cs(Io,fs,zi){var So=Ra(x,vi,null,Io),xo=fs=="ltr"==(zi=="after")?"left":"right",Co=zi=="after"?So.begin:So.end-(/\s/.test(vi.text.charAt(So.end-1))?2:1);return bo(Co,xo)[xo]}var ds=Tr(vi,ie.direction);return un(ds,Rr||0,hi==null?ra:hi,function(Io,fs,zi,So){var xo=zi=="ltr",Co=bo(Io,xo?"left":"right"),_o=bo(fs-1,xo?"right":"left"),Wl=Rr==null&&Io==0,ys=hi==null&&fs==ra,Go=So==0,za=!ds||So==ds.length-1;if(_o.top-Co.top<=3){var No=(Pe?Wl:ys)&&Go,Ec=(Pe?ys:Wl)&&za,sl=No?Se:(xo?Co:_o).left,xl=Ec?Ae:(xo?_o:Co).right;at(sl,Co.top,xl-sl,Co.bottom)}else{var Zs,Po,Vl,Xo;xo?(Zs=Pe&&Wl&&Go?Se:Co.left,Po=Pe?Ae:cs(Io,zi,"before"),Vl=Pe?Se:cs(fs,zi,"after"),Xo=Pe&&ys&&za?Ae:_o.right):(Zs=Pe?cs(Io,zi,"before"):Se,Po=!Pe&&Wl&&Go?Ae:Co.right,Vl=!Pe&&ys&&za?Se:_o.left,Xo=Pe?cs(fs,zi,"after"):Ae),at(Zs,Co.top,Po-Zs,Co.bottom),Co.bottom<_o.top&&at(Se,Co.bottom,null,_o.top),at(Vl,_o.top,Xo-Vl,_o.bottom)}(!eo||fr(Co,eo)<0)&&(eo=Co),fr(_o,eo)<0&&(eo=_o),(!Wo||fr(Co,Wo)<0)&&(Wo=Co),fr(_o,Wo)<0&&(Wo=_o)}),{start:eo,end:Wo}}var Gt=z.from(),Ft=z.to();if(Gt.line==Ft.line)vt(Gt.line,Gt.ch,Ft.ch);else{var Rn=Pt(ie,Gt.line),Xn=Pt(ie,Ft.line),hr=st(Rn)==st(Xn),_r=vt(Gt.line,Gt.ch,hr?Rn.text.length+1:null).end,Or=vt(Ft.line,hr?0:null,Ft.ch).start;hr&&(_r.top<Or.top-2?(at(_r.right,_r.top,null,_r.bottom),at(Se,Or.top,Or.left,Or.bottom)):at(_r.right,_r.top,Or.left-_r.right,_r.bottom)),_r.bottom<Or.top&&at(Se,_r.bottom,null,Or.top)}ne.appendChild(se)}function qr(x){if(x.state.focused){var z=x.display;clearInterval(z.blinker);var ne=!0;z.cursorDiv.style.visibility="",x.options.cursorBlinkRate>0?z.blinker=setInterval(function(){x.hasFocus()||$o(x),z.cursorDiv.style.visibility=(ne=!ne)?"":"hidden"},x.options.cursorBlinkRate):x.options.cursorBlinkRate<0&&(z.cursorDiv.style.visibility="hidden")}}function ii(x){x.state.focused||(x.display.input.focus(),Ua(x))}function $a(x){x.state.delayingBlurEvent=!0,setTimeout(function(){x.state.delayingBlurEvent&&(x.state.delayingBlurEvent=!1,$o(x))},100)}function Ua(x,z){x.state.delayingBlurEvent&&(x.state.delayingBlurEvent=!1),x.options.readOnly!="nocursor"&&(x.state.focused||(Gn(x,"focus",x,z),x.state.focused=!0,vn(x.display.wrapper,"CodeMirror-focused"),!x.curOp&&x.display.selForContextMenu!=x.doc.sel&&(x.display.input.reset(),Me&&setTimeout(function(){return x.display.input.reset(!0)},20)),x.display.input.receivedFocus()),qr(x))}function $o(x,z){x.state.delayingBlurEvent||(x.state.focused&&(Gn(x,"blur",x,z),x.state.focused=!1,Ue(x.display.wrapper,"CodeMirror-focused")),clearInterval(x.display.blinker),setTimeout(function(){x.state.focused||(x.display.shift=!1)},150))}function Vo(x){for(var z=x.display,ne=z.lineDiv.offsetTop,te=0;te<z.view.length;te++){var ie=z.view[te],se=x.options.lineWrapping,me=void 0,Se=0;if(!ie.hidden){if(ye&&Ce<8){var Ae=ie.node.offsetTop+ie.node.offsetHeight;me=Ae-ne,ne=Ae}else{var Pe=ie.node.getBoundingClientRect();me=Pe.bottom-Pe.top,!se&&ie.text.firstChild&&(Se=ie.text.firstChild.getBoundingClientRect().right-Pe.left-1)}var at=ie.line.height-me;if((at>.005||at<-.005)&&(Wn(ie.line,me),ls(ie.line),ie.rest))for(var vt=0;vt<ie.rest.length;vt++)ls(ie.rest[vt]);if(Se>x.display.sizerWidth){var Gt=Math.ceil(Se/ro(x.display));Gt>x.display.maxLineLength&&(x.display.maxLineLength=Gt,x.display.maxLine=ie.line,x.display.maxLineChanged=!0)}}}}function ls(x){if(x.widgets)for(var z=0;z<x.widgets.length;++z){var ne=x.widgets[z],te=ne.node.parentNode;te&&(ne.height=te.offsetHeight)}}function ta(x,z,ne){var te=ne&&ne.top!=null?Math.max(0,ne.top):x.scroller.scrollTop;te=Math.floor(te-Li(x));var ie=ne&&ne.bottom!=null?ne.bottom:te+x.wrapper.clientHeight,se=qn(z,te),me=qn(z,ie);if(ne&&ne.ensure){var Se=ne.ensure.from.line,Ae=ne.ensure.to.line;Se<se?(se=Se,me=qn(z,tn(Pt(z,Se))+x.wrapper.clientHeight)):Math.min(Ae,z.lastLine())>=me&&(se=qn(z,tn(Pt(z,Ae))-x.wrapper.clientHeight),me=Ae)}return{from:se,to:Math.max(me,se+1)}}function Ro(x,z){if(!Fr(x,"scrollCursorIntoView")){var ne=x.display,te=ne.sizer.getBoundingClientRect(),ie=null;if(z.top+te.top<0?ie=!0:z.bottom+te.top>(window.innerHeight||document.documentElement.clientHeight)&&(ie=!1),ie!=null&&!Mt){var se=bt("div","\u200B",null,`position: absolute;
top: `+(z.top-ne.viewOffset-Li(x.display))+`px;
height: `+(z.bottom-z.top+Ar(x)+ne.barHeight)+`px;
left: `+z.left+"px; width: "+Math.max(2,z.right-z.left)+"px;");x.display.lineSpace.appendChild(se),se.scrollIntoView(ie),x.display.lineSpace.removeChild(se)}}}function us(x,z,ne,te){te==null&&(te=0);var ie;!x.options.lineWrapping&&z==ne&&(z=z.ch?an(z.line,z.sticky=="before"?z.ch-1:z.ch,"after"):z,ne=z.sticky=="before"?an(z.line,z.ch+1,"before"):z);for(var se=0;se<5;se++){var me=!1,Se=Yi(x,z),Ae=!ne||ne==z?Se:Yi(x,ne);ie={left:Math.min(Se.left,Ae.left),top:Math.min(Se.top,Ae.top)-te,right:Math.max(Se.left,Ae.left),bottom:Math.max(Se.bottom,Ae.bottom)+te};var Pe=As(x,ie),at=x.doc.scrollTop,vt=x.doc.scrollLeft;if(Pe.scrollTop!=null&&(Ma(x,Pe.scrollTop),Math.abs(x.doc.scrollTop-at)>1&&(me=!0)),Pe.scrollLeft!=null&&(go(x,Pe.scrollLeft),Math.abs(x.doc.scrollLeft-vt)>1&&(me=!0)),!me)break}return ie}function cl(x,z){var ne=As(x,z);ne.scrollTop!=null&&Ma(x,ne.scrollTop),ne.scrollLeft!=null&&go(x,ne.scrollLeft)}function As(x,z){var ne=x.display,te=Fa(x.display);z.top<0&&(z.top=0);var ie=x.curOp&&x.curOp.scrollTop!=null?x.curOp.scrollTop:ne.scroller.scrollTop,se=ri(x),me={};z.bottom-z.top>se&&(z.bottom=z.top+se);var Se=x.doc.height+Gr(ne),Ae=z.top<te,Pe=z.bottom>Se-te;if(z.top<ie)me.scrollTop=Ae?0:z.top;else if(z.bottom>ie+se){var at=Math.min(z.top,(Pe?Se:z.bottom)-se);at!=ie&&(me.scrollTop=at)}var vt=x.options.fixedGutter?0:ne.gutters.offsetWidth,Gt=x.curOp&&x.curOp.scrollLeft!=null?x.curOp.scrollLeft:ne.scroller.scrollLeft-vt,Ft=Ur(x)-ne.gutters.offsetWidth,Rn=z.right-z.left>Ft;return Rn&&(z.right=z.left+Ft),z.left<10?me.scrollLeft=0:z.left<Gt?me.scrollLeft=Math.max(0,z.left+vt-(Rn?0:10)):z.right>Ft+Gt-3&&(me.scrollLeft=z.right+(Rn?0:10)-Ft),me}function ms(x,z){z!=null&&(Ys(x),x.curOp.scrollTop=(x.curOp.scrollTop==null?x.doc.scrollTop:x.curOp.scrollTop)+z)}function zo(x){Ys(x);var z=x.getCursor();x.curOp.scrollToPos={from:z,to:z,margin:x.options.cursorScrollMargin}}function Ts(x,z,ne){(z!=null||ne!=null)&&Ys(x),z!=null&&(x.curOp.scrollLeft=z),ne!=null&&(x.curOp.scrollTop=ne)}function Ds(x,z){Ys(x),x.curOp.scrollToPos=z}function Ys(x){var z=x.curOp.scrollToPos;if(z){x.curOp.scrollToPos=null;var ne=ga(x,z.from),te=ga(x,z.to);ao(x,ne,te,z.margin)}}function ao(x,z,ne,te){var ie=As(x,{left:Math.min(z.left,ne.left),top:Math.min(z.top,ne.top)-te,right:Math.max(z.right,ne.right),bottom:Math.max(z.bottom,ne.bottom)+te});Ts(x,ie.scrollLeft,ie.scrollTop)}function Ma(x,z){Math.abs(x.doc.scrollTop-z)<2||(be||Yu(x,{top:z}),Ga(x,z,!0),be&&Yu(x),is(x,100))}function Ga(x,z,ne){z=Math.max(0,Math.min(x.display.scroller.scrollHeight-x.display.scroller.clientHeight,z)),!(x.display.scroller.scrollTop==z&&!ne)&&(x.doc.scrollTop=z,x.display.scrollbars.setScrollTop(z),x.display.scroller.scrollTop!=z&&(x.display.scroller.scrollTop=z))}function go(x,z,ne,te){z=Math.max(0,Math.min(z,x.display.scroller.scrollWidth-x.display.scroller.clientWidth)),!((ne?z==x.doc.scrollLeft:Math.abs(x.doc.scrollLeft-z)<2)&&!te)&&(x.doc.scrollLeft=z,Zc(x),x.display.scroller.scrollLeft!=z&&(x.display.scroller.scrollLeft=z),x.display.scrollbars.setScrollLeft(z))}function yo(x){var z=x.display,ne=z.gutters.offsetWidth,te=Math.round(x.doc.height+Gr(x.display));return{clientHeight:z.scroller.clientHeight,viewHeight:z.wrapper.clientHeight,scrollWidth:z.scroller.scrollWidth,clientWidth:z.scroller.clientWidth,viewWidth:z.wrapper.clientWidth,barLeft:x.options.fixedGutter?ne:0,docHeight:te,scrollHeight:te+Ar(x)+z.barHeight,nativeBarWidth:z.nativeBarWidth,gutterWidth:ne}}var Ko=function(x,z,ne){this.cm=ne;var te=this.vert=bt("div",[bt("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),ie=this.horiz=bt("div",[bt("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");te.tabIndex=ie.tabIndex=-1,x(te),x(ie),Ln(te,"scroll",function(){te.clientHeight&&z(te.scrollTop,"vertical")}),Ln(ie,"scroll",function(){ie.clientWidth&&z(ie.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,ye&&Ce<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Ko.prototype.update=function(x){var z=x.scrollWidth>x.clientWidth+1,ne=x.scrollHeight>x.clientHeight+1,te=x.nativeBarWidth;if(ne){this.vert.style.display="block",this.vert.style.bottom=z?te+"px":"0";var ie=x.viewHeight-(z?te:0);this.vert.firstChild.style.height=Math.max(0,x.scrollHeight-x.clientHeight+ie)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(z){this.horiz.style.display="block",this.horiz.style.right=ne?te+"px":"0",this.horiz.style.left=x.barLeft+"px";var se=x.viewWidth-x.barLeft-(ne?te:0);this.horiz.firstChild.style.width=Math.max(0,x.scrollWidth-x.clientWidth+se)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&x.clientHeight>0&&(te==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:ne?te:0,bottom:z?te:0}},Ko.prototype.setScrollLeft=function(x){this.horiz.scrollLeft!=x&&(this.horiz.scrollLeft=x),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Ko.prototype.setScrollTop=function(x){this.vert.scrollTop!=x&&(this.vert.scrollTop=x),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Ko.prototype.zeroWidthHack=function(){var x=Te&&!Ne?"12px":"18px";this.horiz.style.height=this.vert.style.width=x,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ee,this.disableVert=new Ee},Ko.prototype.enableZeroWidthBar=function(x,z,ne){x.style.pointerEvents="auto";function te(){var ie=x.getBoundingClientRect(),se=ne=="vert"?document.elementFromPoint(ie.right-1,(ie.top+ie.bottom)/2):document.elementFromPoint((ie.right+ie.left)/2,ie.bottom-1);se!=x?x.style.pointerEvents="none":z.set(1e3,te)}z.set(1e3,te)},Ko.prototype.clear=function(){var x=this.horiz.parentNode;x.removeChild(this.horiz),x.removeChild(this.vert)};var wo=function(){};wo.prototype.update=function(){return{bottom:0,right:0}},wo.prototype.setScrollLeft=function(){},wo.prototype.setScrollTop=function(){},wo.prototype.clear=function(){};function xs(x,z){z||(z=yo(x));var ne=x.display.barWidth,te=x.display.barHeight;Xl(x,z);for(var ie=0;ie<4&&ne!=x.display.barWidth||te!=x.display.barHeight;ie++)ne!=x.display.barWidth&&x.options.lineWrapping&&Vo(x),Xl(x,yo(x)),ne=x.display.barWidth,te=x.display.barHeight}function Xl(x,z){var ne=x.display,te=ne.scrollbars.update(z);ne.sizer.style.paddingRight=(ne.barWidth=te.right)+"px",ne.sizer.style.paddingBottom=(ne.barHeight=te.bottom)+"px",ne.heightForcer.style.borderBottom=te.bottom+"px solid transparent",te.right&&te.bottom?(ne.scrollbarFiller.style.display="block",ne.scrollbarFiller.style.height=te.bottom+"px",ne.scrollbarFiller.style.width=te.right+"px"):ne.scrollbarFiller.style.display="",te.bottom&&x.options.coverGutterNextToScrollbar&&x.options.fixedGutter?(ne.gutterFiller.style.display="block",ne.gutterFiller.style.height=te.bottom+"px",ne.gutterFiller.style.width=z.gutterWidth+"px"):ne.gutterFiller.style.display=""}var ql={native:Ko,null:wo};function vu(x){x.display.scrollbars&&(x.display.scrollbars.clear(),x.display.scrollbars.addClass&&Ue(x.display.wrapper,x.display.scrollbars.addClass)),x.display.scrollbars=new ql[x.options.scrollbarStyle](function(z){x.display.wrapper.insertBefore(z,x.display.scrollbarFiller),Ln(z,"mousedown",function(){x.state.focused&&setTimeout(function(){return x.display.input.focus()},0)}),z.setAttribute("cm-not-content","true")},function(z,ne){ne=="horizontal"?go(x,z):Ma(x,z)},x),x.display.scrollbars.addClass&&vn(x.display.wrapper,x.display.scrollbars.addClass)}var Xu=0;function Ks(x){x.curOp={cm:x,viewChanged:!1,startHeight:x.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Xu},Zt(x.curOp)}function Is(x){var z=x.curOp;z&&kn(z,function(ne){for(var te=0;te<ne.ops.length;te++)ne.ops[te].cm.curOp=null;yu(ne)})}function yu(x){for(var z=x.ops,ne=0;ne<z.length;ne++)Yl(z[ne]);for(var te=0;te<z.length;te++)Ea(z[te]);for(var ie=0;ie<z.length;ie++)Qi(z[ie]);for(var se=0;se<z.length;se++)Ho(z[se]);for(var me=0;me<z.length;me++)es(z[me])}function Yl(x){var z=x.cm,ne=z.display;Jl(z),x.updateMaxLine&&fn(z),x.mustUpdate=x.viewChanged||x.forceUpdate||x.scrollTop!=null||x.scrollToPos&&(x.scrollToPos.from.line<ne.viewFrom||x.scrollToPos.to.line>=ne.viewTo)||ne.maxLineChanged&&z.options.lineWrapping,x.update=x.mustUpdate&&new gs(z,x.mustUpdate&&{top:x.scrollTop,ensure:x.scrollToPos},x.forceUpdate)}function Ea(x){x.updatedDisplay=x.mustUpdate&&qu(x.cm,x.update)}function Qi(x){var z=x.cm,ne=z.display;x.updatedDisplay&&Vo(z),x.barMeasure=yo(z),ne.maxLineChanged&&!z.options.lineWrapping&&(x.adjustWidthTo=Sa(z,ne.maxLine,ne.maxLine.text.length).left+3,z.display.sizerWidth=x.adjustWidthTo,x.barMeasure.scrollWidth=Math.max(ne.scroller.clientWidth,ne.sizer.offsetLeft+x.adjustWidthTo+Ar(z)+z.display.barWidth),x.maxScrollLeft=Math.max(0,ne.sizer.offsetLeft+x.adjustWidthTo-Ur(z))),(x.updatedDisplay||x.selectionChanged)&&(x.preparedSelection=ne.input.prepareSelection())}function Ho(x){var z=x.cm;x.adjustWidthTo!=null&&(z.display.sizer.style.minWidth=x.adjustWidthTo+"px",x.maxScrollLeft<z.doc.scrollLeft&&go(z,Math.min(z.display.scroller.scrollLeft,x.maxScrollLeft),!0),z.display.maxLineChanged=!1);var ne=x.focus&&x.focus==kt();x.preparedSelection&&z.display.input.showSelection(x.preparedSelection,ne),(x.updatedDisplay||x.startHeight!=z.doc.height)&&xs(z,x.barMeasure),x.updatedDisplay&&Qu(z,x.barMeasure),x.selectionChanged&&qr(z),z.state.focused&&x.updateInput&&z.display.input.reset(x.typing),ne&&ii(x.cm)}function es(x){var z=x.cm,ne=z.display,te=z.doc;if(x.updatedDisplay&&Uc(z,x.update),ne.wheelStartX!=null&&(x.scrollTop!=null||x.scrollLeft!=null||x.scrollToPos)&&(ne.wheelStartX=ne.wheelStartY=null),x.scrollTop!=null&&Ga(z,x.scrollTop,x.forceScroll),x.scrollLeft!=null&&go(z,x.scrollLeft,!0,!0),x.scrollToPos){var ie=us(z,or(te,x.scrollToPos.from),or(te,x.scrollToPos.to),x.scrollToPos.margin);Ro(z,ie)}var se=x.maybeHiddenMarkers,me=x.maybeUnhiddenMarkers;if(se)for(var Se=0;Se<se.length;++Se)se[Se].lines.length||Gn(se[Se],"hide");if(me)for(var Ae=0;Ae<me.length;++Ae)me[Ae].lines.length&&Gn(me[Ae],"unhide");ne.wrapper.offsetHeight&&(te.scrollTop=z.display.scroller.scrollTop),x.changeObjs&&Gn(z,"changes",z,x.changeObjs),x.update&&x.update.finish()}function ea(x,z){if(x.curOp)return z();Ks(x);try{return z()}finally{Is(x)}}function Na(x,z){return function(){if(x.curOp)return z.apply(x,arguments);Ks(x);try{return z.apply(x,arguments)}finally{Is(x)}}}function Ia(x){return function(){if(this.curOp)return x.apply(this,arguments);Ks(this);try{return x.apply(this,arguments)}finally{Is(this)}}}function po(x){return function(){var z=this.cm;if(!z||z.curOp)return x.apply(this,arguments);Ks(z);try{return x.apply(this,arguments)}finally{Is(z)}}}function is(x,z){x.doc.highlightFrontier<x.display.viewTo&&x.state.highlight.set(z,An(Hs,x))}function Hs(x){var z=x.doc;if(!(z.highlightFrontier>=x.display.viewTo)){var ne=+new Date+x.options.workTime,te=_i(x,z.highlightFrontier),ie=[];z.iter(te.line,Math.min(z.first+z.size,x.display.viewTo+500),function(se){if(te.line>=x.display.viewFrom){var me=se.styles,Se=se.text.length>x.options.maxHighlightLength?ht(z.mode,te.state):null,Ae=pa(x,se,te,!0);Se&&(te.state=Se),se.styles=Ae.styles;var Pe=se.styleClasses,at=Ae.classes;at?se.styleClasses=at:Pe&&(se.styleClasses=null);for(var vt=!me||me.length!=se.styles.length||Pe!=at&&(!Pe||!at||Pe.bgClass!=at.bgClass||Pe.textClass!=at.textClass),Gt=0;!vt&&Gt<me.length;++Gt)vt=me[Gt]!=se.styles[Gt];vt&&ie.push(te.line),se.stateAfter=te.save(),te.nextLine()}else se.text.length<=x.options.maxHighlightLength&&ia(x,se.text,te),se.stateAfter=te.line%5==0?te.save():null,te.nextLine();if(+new Date>ne)return is(x,x.options.workDelay),!0}),z.highlightFrontier=te.line,z.modeFrontier=Math.max(z.modeFrontier,te.line),ie.length&&ea(x,function(){for(var se=0;se<ie.length;se++)Ca(x,ie[se],"text")})}}var gs=function(x,z,ne){var te=x.display;this.viewport=z,this.visible=ta(te,x.doc,z),this.editorIsHidden=!te.wrapper.offsetWidth,this.wrapperHeight=te.wrapper.clientHeight,this.wrapperWidth=te.wrapper.clientWidth,this.oldDisplayWidth=Ur(x),this.force=ne,this.dims=ho(x),this.events=[]};gs.prototype.signal=function(x,z){Fi(x,z)&&this.events.push(arguments)},gs.prototype.finish=function(){for(var x=0;x<this.events.length;x++)Gn.apply(null,this.events[x])};function Jl(x){var z=x.display;!z.scrollbarsClipped&&z.scroller.offsetWidth&&(z.nativeBarWidth=z.scroller.offsetWidth-z.scroller.clientWidth,z.heightForcer.style.height=Ar(x)+"px",z.sizer.style.marginBottom=-z.nativeBarWidth+"px",z.sizer.style.borderRightWidth=Ar(x)+"px",z.scrollbarsClipped=!0)}function Ud(x){if(x.hasFocus())return null;var z=kt();if(!z||!Ot(x.display.lineDiv,z))return null;var ne={activeElt:z};if(window.getSelection){var te=window.getSelection();te.anchorNode&&te.extend&&Ot(x.display.lineDiv,te.anchorNode)&&(ne.anchorNode=te.anchorNode,ne.anchorOffset=te.anchorOffset,ne.focusNode=te.focusNode,ne.focusOffset=te.focusOffset)}return ne}function Zd(x){if(!(!x||!x.activeElt||x.activeElt==kt())&&(x.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(x.activeElt.nodeName)&&x.anchorNode&&Ot(document.body,x.anchorNode)&&Ot(document.body,x.focusNode))){var z=window.getSelection(),ne=document.createRange();ne.setEnd(x.anchorNode,x.anchorOffset),ne.collapse(!1),z.removeAllRanges(),z.addRange(ne),z.extend(x.focusNode,x.focusOffset)}}function qu(x,z){var ne=x.display,te=x.doc;if(z.editorIsHidden)return va(x),!1;if(!z.force&&z.visible.from>=ne.viewFrom&&z.visible.to<=ne.viewTo&&(ne.updateLineNumbers==null||ne.updateLineNumbers>=ne.viewTo)&&ne.renderedView==ne.view&&hs(x)==0)return!1;bu(x)&&(va(x),z.dims=ho(x));var ie=te.first+te.size,se=Math.max(z.visible.from-x.options.viewportMargin,te.first),me=Math.min(ie,z.visible.to+x.options.viewportMargin);ne.viewFrom<se&&se-ne.viewFrom<20&&(se=Math.max(te.first,ne.viewFrom)),ne.viewTo>me&&ne.viewTo-me<20&&(me=Math.min(ie,ne.viewTo)),ni&&(se=jt(x.doc,se),me=Nn(x.doc,me));var Se=se!=ne.viewFrom||me!=ne.viewTo||ne.lastWrapHeight!=z.wrapperHeight||ne.lastWrapWidth!=z.wrapperWidth;io(x,se,me),ne.viewOffset=tn(Pt(x.doc,ne.viewFrom)),x.display.mover.style.top=ne.viewOffset+"px";var Ae=hs(x);if(!Se&&Ae==0&&!z.force&&ne.renderedView==ne.view&&(ne.updateLineNumbers==null||ne.updateLineNumbers>=ne.viewTo))return!1;var Pe=Ud(x);return Ae>4&&(ne.lineDiv.style.display="none"),jd(x,ne.updateLineNumbers,z.dims),Ae>4&&(ne.lineDiv.style.display=""),ne.renderedView=ne.view,Zd(Pe),Ze(ne.cursorDiv),Ze(ne.selectionDiv),ne.gutters.style.height=ne.sizer.style.minHeight=0,Se&&(ne.lastWrapHeight=z.wrapperHeight,ne.lastWrapWidth=z.wrapperWidth,is(x,400)),ne.updateLineNumbers=null,!0}function Uc(x,z){for(var ne=z.viewport,te=!0;;te=!1){if(!te||!x.options.lineWrapping||z.oldDisplayWidth==Ur(x)){if(ne&&ne.top!=null&&(ne={top:Math.min(x.doc.height+Gr(x.display)-ri(x),ne.top)}),z.visible=ta(x.display,x.doc,ne),z.visible.from>=x.display.viewFrom&&z.visible.to<=x.display.viewTo)break}else te&&(z.visible=ta(x.display,x.doc,ne));if(!qu(x,z))break;Vo(x);var ie=yo(x);Qo(x),xs(x,ie),Qu(x,ie),z.force=!1}z.signal(x,"update",x),(x.display.viewFrom!=x.display.reportedViewFrom||x.display.viewTo!=x.display.reportedViewTo)&&(z.signal(x,"viewportChange",x,x.display.viewFrom,x.display.viewTo),x.display.reportedViewFrom=x.display.viewFrom,x.display.reportedViewTo=x.display.viewTo)}function Yu(x,z){var ne=new gs(x,z);if(qu(x,ne)){Vo(x),Uc(x,ne);var te=yo(x);Qo(x),xs(x,te),Qu(x,te),ne.finish()}}function jd(x,z,ne){var te=x.display,ie=x.options.lineNumbers,se=te.lineDiv,me=se.firstChild;function Se(Rn){var Xn=Rn.nextSibling;return Me&&Te&&x.display.currentWheelTarget==Rn?Rn.style.display="none":Rn.parentNode.removeChild(Rn),Xn}for(var Ae=te.view,Pe=te.viewFrom,at=0;at<Ae.length;at++){var vt=Ae[at];if(!vt.hidden)if(!vt.node||vt.node.parentNode!=se){var Gt=Wr(x,vt,Pe,ne);se.insertBefore(Gt,me)}else{for(;me!=vt.node;)me=Se(me);var Ft=ie&&z!=null&&z<=Pe&&vt.lineNumber;vt.changes&&(Tt(vt.changes,"gutter")>-1&&(Ft=!1),Lr(x,vt,Pe,ne)),Ft&&(Ze(vt.lineNumber),vt.lineNumber.appendChild(document.createTextNode(Mr(x.options,Pe)))),me=vt.node.nextSibling}Pe+=vt.size}for(;me;)me=Se(me)}function Ju(x){var z=x.gutters.offsetWidth;x.sizer.style.marginLeft=z+"px"}function Qu(x,z){x.display.sizer.style.minHeight=z.docHeight+"px",x.display.heightForcer.style.top=z.docHeight+"px",x.display.gutters.style.height=z.docHeight+x.display.barHeight+Ar(x)+"px"}function Zc(x){var z=x.display,ne=z.view;if(!(!z.alignWidgets&&(!z.gutters.firstChild||!x.options.fixedGutter))){for(var te=Bo(z)-z.scroller.scrollLeft+x.doc.scrollLeft,ie=z.gutters.offsetWidth,se=te+"px",me=0;me<ne.length;me++)if(!ne[me].hidden){x.options.fixedGutter&&(ne[me].gutter&&(ne[me].gutter.style.left=se),ne[me].gutterBackground&&(ne[me].gutterBackground.style.left=se));var Se=ne[me].alignable;if(Se)for(var Ae=0;Ae<Se.length;Ae++)Se[Ae].style.left=se}x.options.fixedGutter&&(z.gutters.style.left=te+ie+"px")}}function bu(x){if(!x.options.lineNumbers)return!1;var z=x.doc,ne=Mr(x.options,z.first+z.size-1),te=x.display;if(ne.length!=te.lineNumChars){var ie=te.measure.appendChild(bt("div",[bt("div",ne)],"CodeMirror-linenumber CodeMirror-gutter-elt")),se=ie.firstChild.offsetWidth,me=ie.offsetWidth-se;return te.lineGutter.style.width="",te.lineNumInnerWidth=Math.max(se,te.lineGutter.offsetWidth-me)+1,te.lineNumWidth=te.lineNumInnerWidth+me,te.lineNumChars=te.lineNumInnerWidth?ne.length:-1,te.lineGutter.style.width=te.lineNumWidth+"px",Ju(x.display),!0}return!1}function ec(x,z){for(var ne=[],te=!1,ie=0;ie<x.length;ie++){var se=x[ie],me=null;if(typeof se!="string"&&(me=se.style,se=se.className),se=="CodeMirror-linenumbers")if(z)te=!0;else continue;ne.push({className:se,style:me})}return z&&!te&&ne.push({className:"CodeMirror-linenumbers",style:null}),ne}function jc(x){var z=x.gutters,ne=x.gutterSpecs;Ze(z),x.lineGutter=null;for(var te=0;te<ne.length;++te){var ie=ne[te],se=ie.className,me=ie.style,Se=z.appendChild(bt("div",null,"CodeMirror-gutter "+se));me&&(Se.style.cssText=me),se=="CodeMirror-linenumbers"&&(x.lineGutter=Se,Se.style.width=(x.lineNumWidth||1)+"px")}z.style.display=ne.length?"":"none",Ju(x)}function Ql(x){jc(x.display),ui(x),Zc(x)}function Gd(x,z,ne,te){var ie=this;this.input=ne,ie.scrollbarFiller=bt("div",null,"CodeMirror-scrollbar-filler"),ie.scrollbarFiller.setAttribute("cm-not-content","true"),ie.gutterFiller=bt("div",null,"CodeMirror-gutter-filler"),ie.gutterFiller.setAttribute("cm-not-content","true"),ie.lineDiv=xt("div",null,"CodeMirror-code"),ie.selectionDiv=bt("div",null,null,"position: relative; z-index: 1"),ie.cursorDiv=bt("div",null,"CodeMirror-cursors"),ie.measure=bt("div",null,"CodeMirror-measure"),ie.lineMeasure=bt("div",null,"CodeMirror-measure"),ie.lineSpace=xt("div",[ie.measure,ie.lineMeasure,ie.selectionDiv,ie.cursorDiv,ie.lineDiv],null,"position: relative; outline: none");var se=xt("div",[ie.lineSpace],"CodeMirror-lines");ie.mover=bt("div",[se],null,"position: relative"),ie.sizer=bt("div",[ie.mover],"CodeMirror-sizer"),ie.sizerWidth=null,ie.heightForcer=bt("div",null,null,"position: absolute; height: "+gn+"px; width: 1px;"),ie.gutters=bt("div",null,"CodeMirror-gutters"),ie.lineGutter=null,ie.scroller=bt("div",[ie.sizer,ie.heightForcer,ie.gutters],"CodeMirror-scroll"),ie.scroller.setAttribute("tabIndex","-1"),ie.wrapper=bt("div",[ie.scrollbarFiller,ie.gutterFiller,ie.scroller],"CodeMirror"),ye&&Ce<8&&(ie.gutters.style.zIndex=-1,ie.scroller.style.paddingRight=0),!Me&&!(be&&Xe)&&(ie.scroller.draggable=!0),x&&(x.appendChild?x.appendChild(ie.wrapper):x(ie.wrapper)),ie.viewFrom=ie.viewTo=z.first,ie.reportedViewFrom=ie.reportedViewTo=z.first,ie.view=[],ie.renderedView=null,ie.externalMeasured=null,ie.viewOffset=0,ie.lastWrapHeight=ie.lastWrapWidth=0,ie.updateLineNumbers=null,ie.nativeBarWidth=ie.barHeight=ie.barWidth=0,ie.scrollbarsClipped=!1,ie.lineNumWidth=ie.lineNumInnerWidth=ie.lineNumChars=null,ie.alignWidgets=!1,ie.cachedCharWidth=ie.cachedTextHeight=ie.cachedPaddingH=null,ie.maxLine=null,ie.maxLineLength=0,ie.maxLineChanged=!1,ie.wheelDX=ie.wheelDY=ie.wheelStartX=ie.wheelStartY=null,ie.shift=!1,ie.selForContextMenu=null,ie.activeTouch=null,ie.gutterSpecs=ec(te.gutters,te.lineNumbers),jc(ie),ne.init(ie)}var xu=0,Uo=null;ye?Uo=-.53:be?Uo=15:he?Uo=-.7:ct&&(Uo=-1/3);function Pl(x){var z=x.wheelDeltaX,ne=x.wheelDeltaY;return z==null&&x.detail&&x.axis==x.HORIZONTAL_AXIS&&(z=x.detail),ne==null&&x.detail&&x.axis==x.VERTICAL_AXIS?ne=x.detail:ne==null&&(ne=x.wheelDelta),{x:z,y:ne}}function Gc(x){var z=Pl(x);return z.x*=Uo,z.y*=Uo,z}function Xc(x,z){var ne=Pl(z),te=ne.x,ie=ne.y,se=x.display,me=se.scroller,Se=me.scrollWidth>me.clientWidth,Ae=me.scrollHeight>me.clientHeight;if(te&&Se||ie&&Ae){if(ie&&Te&&Me){e:for(var Pe=z.target,at=se.view;Pe!=me;Pe=Pe.parentNode)for(var vt=0;vt<at.length;vt++)if(at[vt].node==Pe){x.display.currentWheelTarget=Pe;break e}}if(te&&!be&&!De&&Uo!=null){ie&&Ae&&Ma(x,Math.max(0,me.scrollTop+ie*Uo)),go(x,Math.max(0,me.scrollLeft+te*Uo)),(!ie||ie&&Ae)&&Ei(z),se.wheelStartX=null;return}if(ie&&Uo!=null){var Gt=ie*Uo,Ft=x.doc.scrollTop,Rn=Ft+se.wrapper.clientHeight;Gt<0?Ft=Math.max(0,Ft+Gt-50):Rn=Math.min(x.doc.height,Rn+Gt+50),Yu(x,{top:Ft,bottom:Rn})}xu<20&&(se.wheelStartX==null?(se.wheelStartX=me.scrollLeft,se.wheelStartY=me.scrollTop,se.wheelDX=te,se.wheelDY=ie,setTimeout(function(){if(se.wheelStartX!=null){var Xn=me.scrollLeft-se.wheelStartX,hr=me.scrollTop-se.wheelStartY,_r=hr&&se.wheelDY&&hr/se.wheelDY||Xn&&se.wheelDX&&Xn/se.wheelDX;se.wheelStartX=se.wheelStartY=null,_r&&(Uo=(Uo*xu+_r)/(xu+1),++xu)}},200)):(se.wheelDX+=te,se.wheelDY+=ie))}}var vs=function(x,z){this.ranges=x,this.primIndex=z};vs.prototype.primary=function(){return this.ranges[this.primIndex]},vs.prototype.equals=function(x){if(x==this)return!0;if(x.primIndex!=this.primIndex||x.ranges.length!=this.ranges.length)return!1;for(var z=0;z<this.ranges.length;z++){var ne=this.ranges[z],te=x.ranges[z];if(!ci(ne.anchor,te.anchor)||!ci(ne.head,te.head))return!1}return!0},vs.prototype.deepCopy=function(){for(var x=[],z=0;z<this.ranges.length;z++)x[z]=new Ha(gi(this.ranges[z].anchor),gi(this.ranges[z].head));return new vs(x,this.primIndex)},vs.prototype.somethingSelected=function(){for(var x=0;x<this.ranges.length;x++)if(!this.ranges[x].empty())return!0;return!1},vs.prototype.contains=function(x,z){z||(z=x);for(var ne=0;ne<this.ranges.length;ne++){var te=this.ranges[ne];if(Fn(z,te.from())>=0&&Fn(x,te.to())<=0)return ne}return-1};var Ha=function(x,z){this.anchor=x,this.head=z};Ha.prototype.from=function(){return Dr(this.anchor,this.head)},Ha.prototype.to=function(){return Vr(this.anchor,this.head)},Ha.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Es(x,z,ne){var te=x&&x.options.selectionsMayTouch,ie=z[ne];z.sort(function(Gt,Ft){return Fn(Gt.from(),Ft.from())}),ne=Tt(z,ie);for(var se=1;se<z.length;se++){var me=z[se],Se=z[se-1],Ae=Fn(Se.to(),me.from());if(te&&!me.empty()?Ae>0:Ae>=0){var Pe=Dr(Se.from(),me.from()),at=Vr(Se.to(),me.to()),vt=Se.empty()?me.from()==me.head:Se.from()==Se.head;se<=ne&&--ne,z.splice(--se,2,new Ha(vt?at:Pe,vt?Pe:at))}}return new vs(z,ne)}function Ps(x,z){return new vs([new Ha(x,z||x)],0)}function Js(x){return x.text?an(x.from.line+x.text.length-1,Bt(x.text).length+(x.text.length==1?x.from.ch:0)):x.to}function qc(x,z){if(Fn(x,z.from)<0)return x;if(Fn(x,z.to)<=0)return Js(z);var ne=x.line+z.text.length-(z.to.line-z.from.line)-1,te=x.ch;return x.line==z.to.line&&(te+=Js(z).ch-z.to.ch),an(ne,te)}function tc(x,z){for(var ne=[],te=0;te<x.sel.ranges.length;te++){var ie=x.sel.ranges[te];ne.push(new Ha(qc(ie.anchor,z),qc(ie.head,z)))}return Es(x.cm,ne,x.sel.primIndex)}function Bl(x,z,ne){return x.line==z.line?an(ne.line,x.ch-z.ch+ne.ch):an(ne.line+(x.line-z.line),x.ch)}function nc(x,z,ne){for(var te=[],ie=an(x.first,0),se=ie,me=0;me<z.length;me++){var Se=z[me],Ae=Bl(Se.from,ie,se),Pe=Bl(Js(Se),ie,se);if(ie=Se.to,se=Pe,ne=="around"){var at=x.sel.ranges[me],vt=Fn(at.head,at.anchor)<0;te[me]=new Ha(vt?Pe:Ae,vt?Ae:Pe)}else te[me]=new Ha(Ae,Ae)}return new vs(te,x.sel.primIndex)}function rc(x){x.doc.mode=St(x.options,x.doc.modeOption),Ol(x)}function Ol(x){x.doc.iter(function(z){z.stateAfter&&(z.stateAfter=null),z.styles&&(z.styles=null)}),x.doc.modeFrontier=x.doc.highlightFrontier=x.doc.first,is(x,100),x.state.modeGen++,x.curOp&&ui(x)}function Yc(x,z){return z.from.ch==0&&z.to.ch==0&&Bt(z.text)==""&&(!x.cm||x.cm.options.wholeLineUpdateBefore)}function ic(x,z,ne,te){function ie(Or){return ne?ne[Or]:null}function se(Or,Sr,Rr){Yn(Or,Sr,Rr,te),Mn(Or,"change",Or,z)}function me(Or,Sr){for(var Rr=[],hi=Or;hi<Sr;++hi)Rr.push(new xn(Pe[hi],ie(hi),te));return Rr}var Se=z.from,Ae=z.to,Pe=z.text,at=Pt(x,Se.line),vt=Pt(x,Ae.line),Gt=Bt(Pe),Ft=ie(Pe.length-1),Rn=Ae.line-Se.line;if(z.full)x.insert(0,me(0,Pe.length)),x.remove(Pe.length,x.size-Pe.length);else if(Yc(x,z)){var Xn=me(0,Pe.length-1);se(vt,vt.text,Ft),Rn&&x.remove(Se.line,Rn),Xn.length&&x.insert(Se.line,Xn)}else if(at==vt)if(Pe.length==1)se(at,at.text.slice(0,Se.ch)+Gt+at.text.slice(Ae.ch),Ft);else{var hr=me(1,Pe.length-1);hr.push(new xn(Gt+at.text.slice(Ae.ch),Ft,te)),se(at,at.text.slice(0,Se.ch)+Pe[0],ie(0)),x.insert(Se.line+1,hr)}else if(Pe.length==1)se(at,at.text.slice(0,Se.ch)+Pe[0]+vt.text.slice(Ae.ch),ie(0)),x.remove(Se.line+1,Rn);else{se(at,at.text.slice(0,Se.ch)+Pe[0],ie(0)),se(vt,Gt+vt.text.slice(Ae.ch),Ft);var _r=me(1,Pe.length-1);Rn>1&&x.remove(Se.line+1,Rn-1),x.insert(Se.line+1,_r)}Mn(x,"change",x,z)}function Qs(x,z,ne){function te(ie,se,me){if(ie.linked)for(var Se=0;Se<ie.linked.length;++Se){var Ae=ie.linked[Se];if(Ae.doc!=se){var Pe=me&&Ae.sharedHist;ne&&!Pe||(z(Ae.doc,Pe),te(Ae.doc,ie,Pe))}}}te(x,null,!0)}function wu(x,z){if(z.cm)throw new Error("This document is already in use.");x.doc=z,z.cm=x,so(x),rc(x),Su(x),x.options.lineWrapping||fn(x),x.options.mode=z.modeOption,ui(x)}function Su(x){(x.doc.direction=="rtl"?vn:Ue)(x.display.lineDiv,"CodeMirror-rtl")}function ac(x){ea(x,function(){Su(x),ui(x)})}function Cu(x){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=x||1}function oc(x,z){var ne={from:gi(z.from),to:Js(z),text:Bn(x,z.from,z.to)};return cc(x,ne,z.from.line,z.to.line+1),Qs(x,function(te){return cc(te,ne,z.from.line,z.to.line+1)},!0),ne}function Jc(x){for(;x.length;){var z=Bt(x);if(z.ranges)x.pop();else break}}function sc(x,z){if(z)return Jc(x.done),Bt(x.done);if(x.done.length&&!Bt(x.done).ranges)return Bt(x.done);if(x.done.length>1&&!x.done[x.done.length-2].ranges)return x.done.pop(),Bt(x.done)}function Mu(x,z,ne,te){var ie=x.history;ie.undone.length=0;var se=+new Date,me,Se;if((ie.lastOp==te||ie.lastOrigin==z.origin&&z.origin&&(z.origin.charAt(0)=="+"&&ie.lastModTime>se-(x.cm?x.cm.options.historyEventDelay:500)||z.origin.charAt(0)=="*"))&&(me=sc(ie,ie.lastOp==te)))Se=Bt(me.changes),Fn(z.from,z.to)==0&&Fn(z.from,Se.to)==0?Se.to=Js(z):me.changes.push(oc(x,z));else{var Ae=Bt(ie.done);for((!Ae||!Ae.ranges)&&Eu(x.sel,ie.done),me={changes:[oc(x,z)],generation:ie.generation},ie.done.push(me);ie.done.length>ie.undoDepth;)ie.done.shift(),ie.done[0].ranges||ie.done.shift()}ie.done.push(ne),ie.generation=++ie.maxGeneration,ie.lastModTime=ie.lastSelTime=se,ie.lastOp=ie.lastSelOp=te,ie.lastOrigin=ie.lastSelOrigin=z.origin,Se||Gn(x,"historyAdded")}function lc(x,z,ne,te){var ie=z.charAt(0);return ie=="*"||ie=="+"&&ne.ranges.length==te.ranges.length&&ne.somethingSelected()==te.somethingSelected()&&new Date-x.history.lastSelTime<=(x.cm?x.cm.options.historyEventDelay:500)}function uc(x,z,ne,te){var ie=x.history,se=te&&te.origin;ne==ie.lastSelOp||se&&ie.lastSelOrigin==se&&(ie.lastModTime==ie.lastSelTime&&ie.lastOrigin==se||lc(x,se,Bt(ie.done),z))?ie.done[ie.done.length-1]=z:Eu(z,ie.done),ie.lastSelTime=+new Date,ie.lastSelOrigin=se,ie.lastSelOp=ne,te&&te.clearRedo!==!1&&Jc(ie.undone)}function Eu(x,z){var ne=Bt(z);ne&&ne.ranges&&ne.equals(x)||z.push(x)}function cc(x,z,ne,te){var ie=z["spans_"+x.id],se=0;x.iter(Math.max(x.first,ne),Math.min(x.first+x.size,te),function(me){me.markedSpans&&((ie||(ie=z["spans_"+x.id]={}))[se]=me.markedSpans),++se})}function dc(x){if(!x)return null;for(var z,ne=0;ne<x.length;++ne)x[ne].marker.explicitlyCleared?z||(z=x.slice(0,ne)):z&&z.push(x[ne]);return z?z.length?z:null:x}function Xd(x,z){var ne=z["spans_"+x.id];if(!ne)return null;for(var te=[],ie=0;ie<z.text.length;++ie)te.push(dc(ne[ie]));return te}function Qc(x,z){var ne=Xd(x,z),te=Br(x,z);if(!ne)return te;if(!te)return ne;for(var ie=0;ie<ne.length;++ie){var se=ne[ie],me=te[ie];if(se&&me)e:for(var Se=0;Se<me.length;++Se){for(var Ae=me[Se],Pe=0;Pe<se.length;++Pe)if(se[Pe].marker==Ae.marker)continue e;se.push(Ae)}else me&&(ne[ie]=me)}return ne}function Rl(x,z,ne){for(var te=[],ie=0;ie<x.length;++ie){var se=x[ie];if(se.ranges){te.push(ne?vs.prototype.deepCopy.call(se):se);continue}var me=se.changes,Se=[];te.push({changes:Se});for(var Ae=0;Ae<me.length;++Ae){var Pe=me[Ae],at=void 0;if(Se.push({from:Pe.from,to:Pe.to,text:Pe.text}),z)for(var vt in Pe)(at=vt.match(/^spans_(\d+)$/))&&Tt(z,Number(at[1]))>-1&&(Bt(Se)[vt]=Pe[vt],delete Pe[vt])}}return te}function fc(x,z,ne,te){if(te){var ie=x.anchor;if(ne){var se=Fn(z,ie)<0;se!=Fn(ne,ie)<0?(ie=z,z=ne):se!=Fn(z,ne)<0&&(z=ne)}return new Ha(ie,z)}else return new Ha(ne||z,z)}function Nl(x,z,ne,te,ie){ie==null&&(ie=x.cm&&(x.cm.display.shift||x.extend)),To(x,new vs([fc(x.sel.primary(),z,ne,ie)],0),te)}function zr(x,z,ne){for(var te=[],ie=x.cm&&(x.cm.display.shift||x.extend),se=0;se<x.sel.ranges.length;se++)te[se]=fc(x.sel.ranges[se],z[se],null,ie);var me=Es(x.cm,te,x.sel.primIndex);To(x,me,ne)}function ws(x,z,ne,te){var ie=x.sel.ranges.slice(0);ie[z]=ne,To(x,Es(x.cm,ie,x.sel.primIndex),te)}function ed(x,z,ne,te){To(x,Ps(z,ne),te)}function qd(x,z,ne){var te={ranges:z.ranges,update:function(ie){this.ranges=[];for(var se=0;se<ie.length;se++)this.ranges[se]=new Ha(or(x,ie[se].anchor),or(x,ie[se].head))},origin:ne&&ne.origin};return Gn(x,"beforeSelectionChange",x,te),x.cm&&Gn(x.cm,"beforeSelectionChange",x.cm,te),te.ranges!=z.ranges?Es(x.cm,te.ranges,te.ranges.length-1):z}function as(x,z,ne){var te=x.history.done,ie=Bt(te);ie&&ie.ranges?(te[te.length-1]=z,_u(x,z,ne)):To(x,z,ne)}function To(x,z,ne){_u(x,z,ne),uc(x,x.sel,x.cm?x.cm.curOp.id:NaN,ne)}function _u(x,z,ne){(Fi(x,"beforeSelectionChange")||x.cm&&Fi(x.cm,"beforeSelectionChange"))&&(z=qd(x,z,ne));var te=ne&&ne.bias||(Fn(z.primary().head,x.sel.primary().head)<0?-1:1);Yd(x,Fl(x,z,te,!0)),!(ne&&ne.scroll===!1)&&x.cm&&zo(x.cm)}function Yd(x,z){z.equals(x.sel)||(x.sel=z,x.cm&&(x.cm.curOp.updateInput=1,x.cm.curOp.selectionChanged=!0,Da(x.cm)),Mn(x,"cursorActivity",x))}function Jd(x){Yd(x,Fl(x,x.sel,null,!1))}function Fl(x,z,ne,te){for(var ie,se=0;se<z.ranges.length;se++){var me=z.ranges[se],Se=z.ranges.length==x.sel.ranges.length&&x.sel.ranges[se],Ae=hc(x,me.anchor,Se&&Se.anchor,ne,te),Pe=hc(x,me.head,Se&&Se.head,ne,te);(ie||Ae!=me.anchor||Pe!=me.head)&&(ie||(ie=z.ranges.slice(0,se)),ie[se]=new Ha(Ae,Pe))}return ie?Es(x.cm,ie,z.primIndex):z}function os(x,z,ne,te,ie){var se=Pt(x,z.line);if(se.markedSpans)for(var me=0;me<se.markedSpans.length;++me){var Se=se.markedSpans[me],Ae=Se.marker,Pe="selectLeft"in Ae?!Ae.selectLeft:Ae.inclusiveLeft,at="selectRight"in Ae?!Ae.selectRight:Ae.inclusiveRight;if((Se.from==null||(Pe?Se.from<=z.ch:Se.from<z.ch))&&(Se.to==null||(at?Se.to>=z.ch:Se.to>z.ch))){if(ie&&(Gn(Ae,"beforeCursorEnter"),Ae.explicitlyCleared))if(se.markedSpans){--me;continue}else break;if(!Ae.atomic)continue;if(ne){var vt=Ae.find(te<0?1:-1),Gt=void 0;if((te<0?at:Pe)&&(vt=el(x,vt,-te,vt&&vt.line==z.line?se:null)),vt&&vt.line==z.line&&(Gt=Fn(vt,ne))&&(te<0?Gt<0:Gt>0))return os(x,vt,z,te,ie)}var Ft=Ae.find(te<0?-1:1);return(te<0?Pe:at)&&(Ft=el(x,Ft,te,Ft.line==z.line?se:null)),Ft?os(x,Ft,z,te,ie):null}}return z}function hc(x,z,ne,te,ie){var se=te||1,me=os(x,z,ne,se,ie)||!ie&&os(x,z,ne,se,!0)||os(x,z,ne,-se,ie)||!ie&&os(x,z,ne,-se,!0);return me||(x.cantEdit=!0,an(x.first,0))}function el(x,z,ne,te){return ne<0&&z.ch==0?z.line>x.first?or(x,an(z.line-1)):null:ne>0&&z.ch==(te||Pt(x,z.line)).text.length?z.line<x.first+x.size-1?an(z.line+1,0):null:new an(z.line,z.ch+ne)}function td(x){x.setSelection(an(x.firstLine(),0),an(x.lastLine()),Je)}function pc(x,z,ne){var te={canceled:!1,from:z.from,to:z.to,text:z.text,origin:z.origin,cancel:function(){return te.canceled=!0}};return ne&&(te.update=function(ie,se,me,Se){ie&&(te.from=or(x,ie)),se&&(te.to=or(x,se)),me&&(te.text=me),Se!==void 0&&(te.origin=Se)}),Gn(x,"beforeChange",x,te),x.cm&&Gn(x.cm,"beforeChange",x.cm,te),te.canceled?(x.cm&&(x.cm.curOp.updateInput=2),null):{from:te.from,to:te.to,text:te.text,origin:te.origin}}function dl(x,z,ne){if(x.cm){if(!x.cm.curOp)return Na(x.cm,dl)(x,z,ne);if(x.cm.state.suppressEdits)return}if(!((Fi(x,"beforeChange")||x.cm&&Fi(x.cm,"beforeChange"))&&(z=pc(x,z,!0),!z))){var te=aa&&!ne&&Yr(x,z.from,z.to);if(te)for(var ie=te.length-1;ie>=0;--ie)nd(x,{from:te[ie].from,to:te[ie].to,text:ie?[""]:z.text,origin:z.origin});else nd(x,z)}}function nd(x,z){if(!(z.text.length==1&&z.text[0]==""&&Fn(z.from,z.to)==0)){var ne=tc(x,z);Mu(x,z,ne,x.cm?x.cm.curOp.id:NaN),$l(x,z,ne,Br(x,z));var te=[];Qs(x,function(ie,se){!se&&Tt(te,ie.history)==-1&&(ku(ie.history,z),te.push(ie.history)),$l(ie,z,null,Br(ie,z))})}}function tl(x,z,ne){var te=x.cm&&x.cm.state.suppressEdits;if(!(te&&!ne)){for(var ie=x.history,se,me=x.sel,Se=z=="undo"?ie.done:ie.undone,Ae=z=="undo"?ie.undone:ie.done,Pe=0;Pe<Se.length&&(se=Se[Pe],!(ne?se.ranges&&!se.equals(x.sel):!se.ranges));Pe++);if(Pe!=Se.length){for(ie.lastOrigin=ie.lastSelOrigin=null;;)if(se=Se.pop(),se.ranges){if(Eu(se,Ae),ne&&!se.equals(x.sel)){To(x,se,{clearRedo:!1});return}me=se}else if(te){Se.push(se);return}else break;var at=[];Eu(me,Ae),Ae.push({changes:at,generation:ie.generation}),ie.generation=se.generation||++ie.maxGeneration;for(var vt=Fi(x,"beforeChange")||x.cm&&Fi(x.cm,"beforeChange"),Gt=function(Xn){var hr=se.changes[Xn];if(hr.origin=z,vt&&!pc(x,hr,!1))return Se.length=0,{};at.push(oc(x,hr));var _r=Xn?tc(x,hr):Bt(Se);$l(x,hr,_r,Qc(x,hr)),!Xn&&x.cm&&x.cm.scrollIntoView({from:hr.from,to:Js(hr)});var Or=[];Qs(x,function(Sr,Rr){!Rr&&Tt(Or,Sr.history)==-1&&(ku(Sr.history,hr),Or.push(Sr.history)),$l(Sr,hr,null,Qc(Sr,hr))})},Ft=se.changes.length-1;Ft>=0;--Ft){var Rn=Gt(Ft);if(Rn)return Rn.v}}}}function mc(x,z){if(z!=0&&(x.first+=z,x.sel=new vs(bn(x.sel.ranges,function(ie){return new Ha(an(ie.anchor.line+z,ie.anchor.ch),an(ie.head.line+z,ie.head.ch))}),x.sel.primIndex),x.cm)){ui(x.cm,x.first,x.first-z,z);for(var ne=x.cm.display,te=ne.viewFrom;te<ne.viewTo;te++)Ca(x.cm,te,"gutter")}}function $l(x,z,ne,te){if(x.cm&&!x.cm.curOp)return Na(x.cm,$l)(x,z,ne,te);if(z.to.line<x.first){mc(x,z.text.length-1-(z.to.line-z.from.line));return}if(!(z.from.line>x.lastLine())){if(z.from.line<x.first){var ie=z.text.length-1-(x.first-z.from.line);mc(x,ie),z={from:an(x.first,0),to:an(z.to.line+ie,z.to.ch),text:[Bt(z.text)],origin:z.origin}}var se=x.lastLine();z.to.line>se&&(z={from:z.from,to:an(se,Pt(x,se).text.length),text:[z.text[0]],origin:z.origin}),z.removed=Bn(x,z.from,z.to),ne||(ne=tc(x,z)),x.cm?Qd(x.cm,z,te):ic(x,z,te),_u(x,ne,Je),x.cantEdit&&hc(x,an(x.firstLine(),0))&&(x.cantEdit=!1)}}function Qd(x,z,ne){var te=x.doc,ie=x.display,se=z.from,me=z.to,Se=!1,Ae=se.line;x.options.lineWrapping||(Ae=Un(st(Pt(te,se.line))),te.iter(Ae,me.line+1,function(Ft){if(Ft==ie.maxLine)return Se=!0,!0})),te.sel.contains(z.from,z.to)>-1&&Da(x),ic(te,z,ne,Oo(x)),x.options.lineWrapping||(te.iter(Ae,se.line+z.text.length,function(Ft){var Rn=Yt(Ft);Rn>ie.maxLineLength&&(ie.maxLine=Ft,ie.maxLineLength=Rn,ie.maxLineChanged=!0,Se=!1)}),Se&&(x.curOp.updateMaxLine=!0)),Aa(te,se.line),is(x,400);var Pe=z.text.length-(me.line-se.line)-1;z.full?ui(x):se.line==me.line&&z.text.length==1&&!Yc(x.doc,z)?Ca(x,se.line,"text"):ui(x,se.line,me.line+1,Pe);var at=Fi(x,"changes"),vt=Fi(x,"change");if(vt||at){var Gt={from:se,to:me,text:z.text,removed:z.removed,origin:z.origin};vt&&Mn(x,"change",x,Gt),at&&(x.curOp.changeObjs||(x.curOp.changeObjs=[])).push(Gt)}x.display.selForContextMenu=null}function eu(x,z,ne,te,ie){var se;te||(te=ne),Fn(te,ne)<0&&(se=[te,ne],ne=se[0],te=se[1]),typeof z=="string"&&(z=x.splitLines(z)),dl(x,{from:ne,to:te,text:z,origin:ie})}function ef(x,z,ne,te){ne<x.line?x.line+=te:z<x.line&&(x.line=z,x.ch=0)}function tf(x,z,ne,te){for(var ie=0;ie<x.length;++ie){var se=x[ie],me=!0;if(se.ranges){se.copied||(se=x[ie]=se.deepCopy(),se.copied=!0);for(var Se=0;Se<se.ranges.length;Se++)ef(se.ranges[Se].anchor,z,ne,te),ef(se.ranges[Se].head,z,ne,te);continue}for(var Ae=0;Ae<se.changes.length;++Ae){var Pe=se.changes[Ae];if(ne<Pe.from.line)Pe.from=an(Pe.from.line+te,Pe.from.ch),Pe.to=an(Pe.to.line+te,Pe.to.ch);else if(z<=Pe.to.line){me=!1;break}}me||(x.splice(0,ie+1),ie=0)}}function ku(x,z){var ne=z.from.line,te=z.to.line,ie=z.text.length-(te-ne)-1;tf(x.done,ne,te,ie),tf(x.undone,ne,te,ie)}function Lu(x,z,ne,te){var ie=z,se=z;return typeof z=="number"?se=Pt(x,wi(x,z)):ie=Un(z),ie==null?null:(te(se,ie)&&x.cm&&Ca(x.cm,ie,ne),se)}function fl(x){this.lines=x,this.parent=null;for(var z=0,ne=0;ne<x.length;++ne)x[ne].parent=this,z+=x[ne].height;this.height=z}fl.prototype={chunkSize:function(){return this.lines.length},removeInner:function(x,z){for(var ne=x,te=x+z;ne<te;++ne){var ie=this.lines[ne];this.height-=ie.height,$n(ie),Mn(ie,"delete")}this.lines.splice(x,z)},collapse:function(x){x.push.apply(x,this.lines)},insertInner:function(x,z,ne){this.height+=ne,this.lines=this.lines.slice(0,x).concat(z).concat(this.lines.slice(x));for(var te=0;te<z.length;++te)z[te].parent=this},iterN:function(x,z,ne){for(var te=x+z;x<te;++x)if(ne(this.lines[x]))return!0}};function tu(x){this.children=x;for(var z=0,ne=0,te=0;te<x.length;++te){var ie=x[te];z+=ie.chunkSize(),ne+=ie.height,ie.parent=this}this.size=z,this.height=ne,this.parent=null}tu.prototype={chunkSize:function(){return this.size},removeInner:function(x,z){this.size-=z;for(var ne=0;ne<this.children.length;++ne){var te=this.children[ne],ie=te.chunkSize();if(x<ie){var se=Math.min(z,ie-x),me=te.height;if(te.removeInner(x,se),this.height-=me-te.height,ie==se&&(this.children.splice(ne--,1),te.parent=null),(z-=se)==0)break;x=0}else x-=ie}if(this.size-z<25&&(this.children.length>1||!(this.children[0]instanceof fl))){var Se=[];this.collapse(Se),this.children=[new fl(Se)],this.children[0].parent=this}},collapse:function(x){for(var z=0;z<this.children.length;++z)this.children[z].collapse(x)},insertInner:function(x,z,ne){this.size+=z.length,this.height+=ne;for(var te=0;te<this.children.length;++te){var ie=this.children[te],se=ie.chunkSize();if(x<=se){if(ie.insertInner(x,z,ne),ie.lines&&ie.lines.length>50){for(var me=ie.lines.length%25+25,Se=me;Se<ie.lines.length;){var Ae=new fl(ie.lines.slice(Se,Se+=25));ie.height-=Ae.height,this.children.splice(++te,0,Ae),Ae.parent=this}ie.lines=ie.lines.slice(0,me),this.maybeSpill()}break}x-=se}},maybeSpill:function(){if(!(this.children.length<=10)){var x=this;do{var z=x.children.splice(x.children.length-5,5),ne=new tu(z);if(x.parent){x.size-=ne.size,x.height-=ne.height;var ie=Tt(x.parent.children,x);x.parent.children.splice(ie+1,0,ne)}else{var te=new tu(x.children);te.parent=x,x.children=[te,ne],x=te}ne.parent=x.parent}while(x.children.length>10);x.parent.maybeSpill()}},iterN:function(x,z,ne){for(var te=0;te<this.children.length;++te){var ie=this.children[te],se=ie.chunkSize();if(x<se){var me=Math.min(z,se-x);if(ie.iterN(x,me,ne))return!0;if((z-=me)==0)break;x=0}else x-=se}}};var nu=function(x,z,ne){if(ne)for(var te in ne)ne.hasOwnProperty(te)&&(this[te]=ne[te]);this.doc=x,this.node=z};nu.prototype.clear=function(){var x=this.doc.cm,z=this.line.widgets,ne=this.line,te=Un(ne);if(!(te==null||!z)){for(var ie=0;ie<z.length;++ie)z[ie]==this&&z.splice(ie--,1);z.length||(ne.widgets=null);var se=di(this);Wn(ne,Math.max(0,ne.height-se)),x&&(ea(x,function(){nf(x,ne,-se),Ca(x,te,"widget")}),Mn(x,"lineWidgetCleared",x,this,te))}},nu.prototype.changed=function(){var x=this,z=this.height,ne=this.doc.cm,te=this.line;this.height=null;var ie=di(this)-z;ie&&(Qn(this.doc,te)||Wn(te,te.height+ie),ne&&ea(ne,function(){ne.curOp.forceUpdate=!0,nf(ne,te,ie),Mn(ne,"lineWidgetChanged",ne,x,Un(te))}))},Oi(nu);function nf(x,z,ne){tn(z)<(x.curOp&&x.curOp.scrollTop||x.doc.scrollTop)&&ms(x,ne)}function rf(x,z,ne,te){var ie=new nu(x,ne,te),se=x.cm;return se&&ie.noHScroll&&(se.display.alignWidgets=!0),Lu(x,z,"widget",function(me){var Se=me.widgets||(me.widgets=[]);if(ie.insertAt==null?Se.push(ie):Se.splice(Math.min(Se.length-1,Math.max(0,ie.insertAt)),0,ie),ie.line=me,se&&!Qn(x,me)){var Ae=tn(me)<x.scrollTop;Wn(me,me.height+di(ie)),Ae&&ms(se,ie.height),se.curOp.forceUpdate=!0}return!0}),se&&Mn(se,"lineWidgetAdded",se,ie,typeof z=="number"?z:Un(z)),ie}var af=0,hl=function(x,z){this.lines=[],this.type=z,this.doc=x,this.id=++af};hl.prototype.clear=function(){if(!this.explicitlyCleared){var x=this.doc.cm,z=x&&!x.curOp;if(z&&Ks(x),Fi(this,"clear")){var ne=this.find();ne&&Mn(this,"clear",ne.from,ne.to)}for(var te=null,ie=null,se=0;se<this.lines.length;++se){var me=this.lines[se],Se=Qt(me.markedSpans,this);x&&!this.collapsed?Ca(x,Un(me),"text"):x&&(Se.to!=null&&(ie=Un(me)),Se.from!=null&&(te=Un(me))),me.markedSpans=Cn(me.markedSpans,Se),Se.from==null&&this.collapsed&&!Qn(this.doc,me)&&x&&Wn(me,Fa(x.display))}if(x&&this.collapsed&&!x.options.lineWrapping)for(var Ae=0;Ae<this.lines.length;++Ae){var Pe=st(this.lines[Ae]),at=Yt(Pe);at>x.display.maxLineLength&&(x.display.maxLine=Pe,x.display.maxLineLength=at,x.display.maxLineChanged=!0)}te!=null&&x&&this.collapsed&&ui(x,te,ie+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,x&&Jd(x.doc)),x&&Mn(x,"markerCleared",x,this,te,ie),z&&Is(x),this.parent&&this.parent.clear()}},hl.prototype.find=function(x,z){x==null&&this.type=="bookmark"&&(x=1);for(var ne,te,ie=0;ie<this.lines.length;++ie){var se=this.lines[ie],me=Qt(se.markedSpans,this);if(me.from!=null&&(ne=an(z?se:Un(se),me.from),x==-1))return ne;if(me.to!=null&&(te=an(z?se:Un(se),me.to),x==1))return te}return ne&&{from:ne,to:te}},hl.prototype.changed=function(){var x=this,z=this.find(-1,!0),ne=this,te=this.doc.cm;!z||!te||ea(te,function(){var ie=z.line,se=Un(z.line),me=Ui(te,se);if(me&&(xi(me),te.curOp.selectionChanged=te.curOp.forceUpdate=!0),te.curOp.updateMaxLine=!0,!Qn(ne.doc,ie)&&ne.height!=null){var Se=ne.height;ne.height=null;var Ae=di(ne)-Se;Ae&&Wn(ie,ie.height+Ae)}Mn(te,"markerChanged",te,x)})},hl.prototype.attachLine=function(x){if(!this.lines.length&&this.doc.cm){var z=this.doc.cm.curOp;(!z.maybeHiddenMarkers||Tt(z.maybeHiddenMarkers,this)==-1)&&(z.maybeUnhiddenMarkers||(z.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(x)},hl.prototype.detachLine=function(x){if(this.lines.splice(Tt(this.lines,x),1),!this.lines.length&&this.doc.cm){var z=this.doc.cm.curOp;(z.maybeHiddenMarkers||(z.maybeHiddenMarkers=[])).push(this)}},Oi(hl);function nl(x,z,ne,te,ie){if(te&&te.shared)return uo(x,z,ne,te,ie);if(x.cm&&!x.cm.curOp)return Na(x.cm,nl)(x,z,ne,te,ie);var se=new hl(x,ie),me=Fn(z,ne);if(te&&Zn(te,se,!1),me>0||me==0&&se.clearWhenEmpty!==!1)return se;if(se.replacedWith&&(se.collapsed=!0,se.widgetNode=xt("span",[se.replacedWith],"CodeMirror-widget"),te.handleMouseEvents||se.widgetNode.setAttribute("cm-ignore-events","true"),te.insertLeft&&(se.widgetNode.insertLeft=!0)),se.collapsed){if(nt(x,z.line,z,ne,se)||z.line!=ne.line&&nt(x,ne.line,z,ne,se))throw new Error("Inserting collapsed marker partially overlapping an existing one");dt()}se.addToHistory&&Mu(x,{from:z,to:ne,origin:"markText"},x.sel,NaN);var Se=z.line,Ae=x.cm,Pe;if(x.iter(Se,ne.line+1,function(vt){Ae&&se.collapsed&&!Ae.options.lineWrapping&&st(vt)==Ae.display.maxLine&&(Pe=!0),se.collapsed&&Se!=z.line&&Wn(vt,0),vr(vt,new It(se,Se==z.line?z.ch:null,Se==ne.line?ne.ch:null)),++Se}),se.collapsed&&x.iter(z.line,ne.line+1,function(vt){Qn(x,vt)&&Wn(vt,0)}),se.clearOnEnter&&Ln(se,"beforeCursorEnter",function(){return se.clear()}),se.readOnly&&(pt(),(x.history.done.length||x.history.undone.length)&&x.clearHistory()),se.collapsed&&(se.id=++af,se.atomic=!0),Ae){if(Pe&&(Ae.curOp.updateMaxLine=!0),se.collapsed)ui(Ae,z.line,ne.line+1);else if(se.className||se.startStyle||se.endStyle||se.css||se.attributes||se.title)for(var at=z.line;at<=ne.line;at++)Ca(Ae,at,"text");se.atomic&&Jd(Ae.doc),Mn(Ae,"markerAdded",Ae,se)}return se}var na=function(x,z){this.markers=x,this.primary=z;for(var ne=0;ne<x.length;++ne)x[ne].parent=this};na.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var x=0;x<this.markers.length;++x)this.markers[x].clear();Mn(this,"clear")}},na.prototype.find=function(x,z){return this.primary.find(x,z)},Oi(na);function uo(x,z,ne,te,ie){te=Zn(te),te.shared=!1;var se=[nl(x,z,ne,te,ie)],me=se[0],Se=te.widgetNode;return Qs(x,function(Ae){Se&&(te.widgetNode=Se.cloneNode(!0)),se.push(nl(Ae,or(Ae,z),or(Ae,ne),te,ie));for(var Pe=0;Pe<Ae.linked.length;++Pe)if(Ae.linked[Pe].isParent)return;me=Bt(se)}),new na(se,me)}function pl(x){return x.findMarks(an(x.first,0),x.clipPos(an(x.lastLine())),function(z){return z.parent})}function of(x,z){for(var ne=0;ne<z.length;ne++){var te=z[ne],ie=te.find(),se=x.clipPos(ie.from),me=x.clipPos(ie.to);if(Fn(se,me)){var Se=nl(x,se,me,te.primary,te.primary.type);te.markers.push(Se),Se.parent=te}}}function Ss(x){for(var z=function(te){var ie=x[te],se=[ie.primary.doc];Qs(ie.primary.doc,function(Ae){return se.push(Ae)});for(var me=0;me<ie.markers.length;me++){var Se=ie.markers[me];Tt(se,Se.doc)==-1&&(Se.parent=null,ie.markers.splice(me--,1))}},ne=0;ne<x.length;ne++)z(ne)}var sf=0,Eo=function(x,z,ne,te,ie){if(!(this instanceof Eo))return new Eo(x,z,ne,te,ie);ne==null&&(ne=0),tu.call(this,[new fl([new xn("",null)])]),this.first=ne,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=ne;var se=an(ne,0);this.sel=Ps(se),this.history=new Cu(null),this.id=++sf,this.modeOption=z,this.lineSep=te,this.direction=ie=="rtl"?"rtl":"ltr",this.extend=!1,typeof x=="string"&&(x=this.splitLines(x)),ic(this,{from:se,to:se,text:x}),To(this,Ps(se),Je)};Eo.prototype=ce(tu.prototype,{constructor:Eo,iter:function(x,z,ne){ne?this.iterN(x-this.first,z-x,ne):this.iterN(this.first,this.first+this.size,x)},insert:function(x,z){for(var ne=0,te=0;te<z.length;++te)ne+=z[te].height;this.insertInner(x-this.first,z,ne)},remove:function(x,z){this.removeInner(x-this.first,z)},getValue:function(x){var z=cr(this,this.first,this.first+this.size);return x===!1?z:z.join(x||this.lineSeparator())},setValue:po(function(x){var z=an(this.first,0),ne=this.first+this.size-1;dl(this,{from:z,to:an(ne,Pt(this,ne).text.length),text:this.splitLines(x),origin:"setValue",full:!0},!0),this.cm&&Ts(this.cm,0,0),To(this,Ps(z),Je)}),replaceRange:function(x,z,ne,te){z=or(this,z),ne=ne?or(this,ne):z,eu(this,x,z,ne,te)},getRange:function(x,z,ne){var te=Bn(this,or(this,x),or(this,z));return ne===!1?te:te.join(ne||this.lineSeparator())},getLine:function(x){var z=this.getLineHandle(x);return z&&z.text},getLineHandle:function(x){if(Jn(this,x))return Pt(this,x)},getLineNumber:function(x){return Un(x)},getLineHandleVisualStart:function(x){return typeof x=="number"&&(x=Pt(this,x)),st(x)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(x){return or(this,x)},getCursor:function(x){var z=this.sel.primary(),ne;return x==null||x=="head"?ne=z.head:x=="anchor"?ne=z.anchor:x=="end"||x=="to"||x===!1?ne=z.to():ne=z.from(),ne},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:po(function(x,z,ne){ed(this,or(this,typeof x=="number"?an(x,z||0):x),null,ne)}),setSelection:po(function(x,z,ne){ed(this,or(this,x),or(this,z||x),ne)}),extendSelection:po(function(x,z,ne){Nl(this,or(this,x),z&&or(this,z),ne)}),extendSelections:po(function(x,z){zr(this,hn(this,x),z)}),extendSelectionsBy:po(function(x,z){var ne=bn(this.sel.ranges,x);zr(this,hn(this,ne),z)}),setSelections:po(function(x,z,ne){if(x.length){for(var te=[],ie=0;ie<x.length;ie++)te[ie]=new Ha(or(this,x[ie].anchor),or(this,x[ie].head));z==null&&(z=Math.min(x.length-1,this.sel.primIndex)),To(this,Es(this.cm,te,z),ne)}}),addSelection:po(function(x,z,ne){var te=this.sel.ranges.slice(0);te.push(new Ha(or(this,x),or(this,z||x))),To(this,Es(this.cm,te,te.length-1),ne)}),getSelection:function(x){for(var z=this.sel.ranges,ne,te=0;te<z.length;te++){var ie=Bn(this,z[te].from(),z[te].to());ne=ne?ne.concat(ie):ie}return x===!1?ne:ne.join(x||this.lineSeparator())},getSelections:function(x){for(var z=[],ne=this.sel.ranges,te=0;te<ne.length;te++){var ie=Bn(this,ne[te].from(),ne[te].to());x!==!1&&(ie=ie.join(x||this.lineSeparator())),z[te]=ie}return z},replaceSelection:function(x,z,ne){for(var te=[],ie=0;ie<this.sel.ranges.length;ie++)te[ie]=x;this.replaceSelections(te,z,ne||"+input")},replaceSelections:po(function(x,z,ne){for(var te=[],ie=this.sel,se=0;se<ie.ranges.length;se++){var me=ie.ranges[se];te[se]={from:me.from(),to:me.to(),text:this.splitLines(x[se]),origin:ne}}for(var Se=z&&z!="end"&&nc(this,te,z),Ae=te.length-1;Ae>=0;Ae--)dl(this,te[Ae]);Se?as(this,Se):this.cm&&zo(this.cm)}),undo:po(function(){tl(this,"undo")}),redo:po(function(){tl(this,"redo")}),undoSelection:po(function(){tl(this,"undo",!0)}),redoSelection:po(function(){tl(this,"redo",!0)}),setExtending:function(x){this.extend=x},getExtending:function(){return this.extend},historySize:function(){for(var x=this.history,z=0,ne=0,te=0;te<x.done.length;te++)x.done[te].ranges||++z;for(var ie=0;ie<x.undone.length;ie++)x.undone[ie].ranges||++ne;return{undo:z,redo:ne}},clearHistory:function(){var x=this;this.history=new Cu(this.history.maxGeneration),Qs(this,function(z){return z.history=x.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(x){return x&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(x){return this.history.generation==(x||this.cleanGeneration)},getHistory:function(){return{done:Rl(this.history.done),undone:Rl(this.history.undone)}},setHistory:function(x){var z=this.history=new Cu(this.history.maxGeneration);z.done=Rl(x.done.slice(0),null,!0),z.undone=Rl(x.undone.slice(0),null,!0)},setGutterMarker:po(function(x,z,ne){return Lu(this,x,"gutter",function(te){var ie=te.gutterMarkers||(te.gutterMarkers={});return ie[z]=ne,!ne&&oe(ie)&&(te.gutterMarkers=null),!0})}),clearGutter:po(function(x){var z=this;this.iter(function(ne){ne.gutterMarkers&&ne.gutterMarkers[x]&&Lu(z,ne,"gutter",function(){return ne.gutterMarkers[x]=null,oe(ne.gutterMarkers)&&(ne.gutterMarkers=null),!0})})}),lineInfo:function(x){var z;if(typeof x=="number"){if(!Jn(this,x)||(z=x,x=Pt(this,x),!x))return null}else if(z=Un(x),z==null)return null;return{line:z,handle:x,text:x.text,gutterMarkers:x.gutterMarkers,textClass:x.textClass,bgClass:x.bgClass,wrapClass:x.wrapClass,widgets:x.widgets}},addLineClass:po(function(x,z,ne){return Lu(this,x,z=="gutter"?"gutter":"class",function(te){var ie=z=="text"?"textClass":z=="background"?"bgClass":z=="gutter"?"gutterClass":"wrapClass";if(!te[ie])te[ie]=ne;else{if(_e(ne).test(te[ie]))return!1;te[ie]+=" "+ne}return!0})}),removeLineClass:po(function(x,z,ne){return Lu(this,x,z=="gutter"?"gutter":"class",function(te){var ie=z=="text"?"textClass":z=="background"?"bgClass":z=="gutter"?"gutterClass":"wrapClass",se=te[ie];if(se)if(ne==null)te[ie]=null;else{var me=se.match(_e(ne));if(!me)return!1;var Se=me.index+me[0].length;te[ie]=se.slice(0,me.index)+(!me.index||Se==se.length?"":" ")+se.slice(Se)||null}else return!1;return!0})}),addLineWidget:po(function(x,z,ne){return rf(this,x,z,ne)}),removeLineWidget:function(x){x.clear()},markText:function(x,z,ne){return nl(this,or(this,x),or(this,z),ne,ne&&ne.type||"range")},setBookmark:function(x,z){var ne={replacedWith:z&&(z.nodeType==null?z.widget:z),insertLeft:z&&z.insertLeft,clearWhenEmpty:!1,shared:z&&z.shared,handleMouseEvents:z&&z.handleMouseEvents};return x=or(this,x),nl(this,x,x,ne,"bookmark")},findMarksAt:function(x){x=or(this,x);var z=[],ne=Pt(this,x.line).markedSpans;if(ne)for(var te=0;te<ne.length;++te){var ie=ne[te];(ie.from==null||ie.from<=x.ch)&&(ie.to==null||ie.to>=x.ch)&&z.push(ie.marker.parent||ie.marker)}return z},findMarks:function(x,z,ne){x=or(this,x),z=or(this,z);var te=[],ie=x.line;return this.iter(x.line,z.line+1,function(se){var me=se.markedSpans;if(me)for(var Se=0;Se<me.length;Se++){var Ae=me[Se];!(Ae.to!=null&&ie==x.line&&x.ch>=Ae.to||Ae.from==null&&ie!=x.line||Ae.from!=null&&ie==z.line&&Ae.from>=z.ch)&&(!ne||ne(Ae.marker))&&te.push(Ae.marker.parent||Ae.marker)}++ie}),te},getAllMarks:function(){var x=[];return this.iter(function(z){var ne=z.markedSpans;if(ne)for(var te=0;te<ne.length;++te)ne[te].from!=null&&x.push(ne[te].marker)}),x},posFromIndex:function(x){var z,ne=this.first,te=this.lineSeparator().length;return this.iter(function(ie){var se=ie.text.length+te;if(se>x)return z=x,!0;x-=se,++ne}),or(this,an(ne,z))},indexFromPos:function(x){x=or(this,x);var z=x.ch;if(x.line<this.first||x.ch<0)return 0;var ne=this.lineSeparator().length;return this.iter(this.first,x.line,function(te){z+=te.text.length+ne}),z},copy:function(x){var z=new Eo(cr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return z.scrollTop=this.scrollTop,z.scrollLeft=this.scrollLeft,z.sel=this.sel,z.extend=!1,x&&(z.history.undoDepth=this.history.undoDepth,z.setHistory(this.getHistory())),z},linkedDoc:function(x){x||(x={});var z=this.first,ne=this.first+this.size;x.from!=null&&x.from>z&&(z=x.from),x.to!=null&&x.to<ne&&(ne=x.to);var te=new Eo(cr(this,z,ne),x.mode||this.modeOption,z,this.lineSep,this.direction);return x.sharedHist&&(te.history=this.history),(this.linked||(this.linked=[])).push({doc:te,sharedHist:x.sharedHist}),te.linked=[{doc:this,isParent:!0,sharedHist:x.sharedHist}],of(te,pl(this)),te},unlinkDoc:function(x){if(x instanceof Bi&&(x=x.doc),this.linked)for(var z=0;z<this.linked.length;++z){var ne=this.linked[z];if(ne.doc==x){this.linked.splice(z,1),x.unlinkDoc(this),Ss(pl(this));break}}if(x.history==this.history){var te=[x.id];Qs(x,function(ie){return te.push(ie.id)},!0),x.history=new Cu(null),x.history.done=Rl(this.history.done,te),x.history.undone=Rl(this.history.undone,te)}},iterLinkedDocs:function(x){Qs(this,x)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(x){return this.lineSep?x.split(this.lineSep):wt(x)},lineSeparator:function(){return this.lineSep||`
`},setDirection:po(function(x){x!="rtl"&&(x="ltr"),x!=this.direction&&(this.direction=x,this.iter(function(z){return z.order=null}),this.cm&&ac(this.cm))})}),Eo.prototype.eachLine=Eo.prototype.iter;var rd=0;function eh(x){var z=this;if(ru(z),!(Fr(z,x)||ki(z.display,x))){Ei(x),ye&&(rd=+new Date);var ne=Ao(z,x,!0),te=x.dataTransfer.files;if(!(!ne||z.isReadOnly()))if(te&&te.length&&window.FileReader&&window.File)for(var ie=te.length,se=Array(ie),me=0,Se=function(){++me==ie&&Na(z,function(){ne=or(z.doc,ne);var Ft={from:ne,to:ne,text:z.doc.splitLines(se.filter(function(Rn){return Rn!=null}).join(z.doc.lineSeparator())),origin:"paste"};dl(z.doc,Ft),as(z.doc,Ps(or(z.doc,ne),or(z.doc,Js(Ft))))})()},Ae=function(Ft,Rn){if(z.options.allowDropFileTypes&&Tt(z.options.allowDropFileTypes,Ft.type)==-1){Se();return}var Xn=new FileReader;Xn.onerror=function(){return Se()},Xn.onload=function(){var hr=Xn.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(hr)){Se();return}se[Rn]=hr,Se()},Xn.readAsText(Ft)},Pe=0;Pe<te.length;Pe++)Ae(te[Pe],Pe);else{if(z.state.draggingText&&z.doc.sel.contains(ne)>-1){z.state.draggingText(x),setTimeout(function(){return z.display.input.focus()},20);return}try{var at=x.dataTransfer.getData("Text");if(at){var vt;if(z.state.draggingText&&!z.state.draggingText.copy&&(vt=z.listSelections()),_u(z.doc,Ps(ne,ne)),vt)for(var Gt=0;Gt<vt.length;++Gt)eu(z.doc,"",vt[Gt].anchor,vt[Gt].head,"drag");z.replaceSelection(at,"around","paste"),z.display.input.focus()}}catch(Ft){}}}}function th(x,z){if(ye&&(!x.state.draggingText||+new Date-rd<100)){ka(z);return}if(!(Fr(x,z)||ki(x.display,z))&&(z.dataTransfer.setData("Text",x.getSelection()),z.dataTransfer.effectAllowed="copyMove",z.dataTransfer.setDragImage&&!ct)){var ne=bt("img",null,null,"position: fixed; left: 0; top: 0;");ne.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",De&&(ne.width=ne.height=1,x.display.wrapper.appendChild(ne),ne._top=ne.offsetTop),z.dataTransfer.setDragImage(ne,0,0),De&&ne.parentNode.removeChild(ne)}}function id(x,z){var ne=Ao(x,z);if(ne){var te=document.createDocumentFragment();$i(x,ne,te),x.display.dragCursor||(x.display.dragCursor=bt("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),x.display.lineSpace.insertBefore(x.display.dragCursor,x.display.cursorDiv)),At(x.display.dragCursor,te)}}function ru(x){x.display.dragCursor&&(x.display.lineSpace.removeChild(x.display.dragCursor),x.display.dragCursor=null)}function iu(x){if(document.getElementsByClassName){for(var z=document.getElementsByClassName("CodeMirror"),ne=[],te=0;te<z.length;te++){var ie=z[te].CodeMirror;ie&&ne.push(ie)}ne.length&&ne[0].operation(function(){for(var se=0;se<ne.length;se++)x(ne[se])})}}var sr=!1;function ad(){sr||(gc(),sr=!0)}function gc(){var x;Ln(window,"resize",function(){x==null&&(x=setTimeout(function(){x=null,iu(vc)},100))}),Ln(window,"blur",function(){return iu($o)})}function vc(x){var z=x.display;z.cachedCharWidth=z.cachedTextHeight=z.cachedPaddingH=null,z.scrollbarsClipped=!1,x.setSize()}for(var Bs={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Au=0;Au<10;Au++)Bs[Au+48]=Bs[Au+96]=String(Au);for(var yc=65;yc<=90;yc++)Bs[yc]=String.fromCharCode(yc);for(var Tu=1;Tu<=12;Tu++)Bs[Tu+111]=Bs[Tu+63235]="F"+Tu;var Ja={};Ja.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ja.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ja.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ja.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ja.default=Te?Ja.macDefault:Ja.pcDefault;function nh(x){var z=x.split(/-(?!$)/);x=z[z.length-1];for(var ne,te,ie,se,me=0;me<z.length-1;me++){var Se=z[me];if(/^(cmd|meta|m)$/i.test(Se))se=!0;else if(/^a(lt)?$/i.test(Se))ne=!0;else if(/^(c|ctrl|control)$/i.test(Se))te=!0;else if(/^s(hift)?$/i.test(Se))ie=!0;else throw new Error("Unrecognized modifier name: "+Se)}return ne&&(x="Alt-"+x),te&&(x="Ctrl-"+x),se&&(x="Cmd-"+x),ie&&(x="Shift-"+x),x}function od(x){var z={};for(var ne in x)if(x.hasOwnProperty(ne)){var te=x[ne];if(/^(name|fallthrough|(de|at)tach)$/.test(ne))continue;if(te=="..."){delete x[ne];continue}for(var ie=bn(ne.split(" "),nh),se=0;se<ie.length;se++){var me=void 0,Se=void 0;se==ie.length-1?(Se=ie.join(" "),me=te):(Se=ie.slice(0,se+1).join(" "),me="...");var Ae=z[Se];if(!Ae)z[Se]=me;else if(Ae!=me)throw new Error("Inconsistent bindings for "+Se)}delete x[ne]}for(var Pe in z)x[Pe]=z[Pe];return x}function rl(x,z,ne,te){z=ss(z);var ie=z.call?z.call(x,te):z[x];if(ie===!1)return"nothing";if(ie==="...")return"multi";if(ie!=null&&ne(ie))return"handled";if(z.fallthrough){if(Object.prototype.toString.call(z.fallthrough)!="[object Array]")return rl(x,z.fallthrough,ne,te);for(var se=0;se<z.fallthrough.length;se++){var me=rl(x,z.fallthrough[se],ne,te);if(me)return me}}}function Du(x){var z=typeof x=="string"?x:Bs[x.keyCode];return z=="Ctrl"||z=="Alt"||z=="Shift"||z=="Mod"}function ml(x,z,ne){var te=x;return z.altKey&&te!="Alt"&&(x="Alt-"+x),(lt?z.metaKey:z.ctrlKey)&&te!="Ctrl"&&(x="Ctrl-"+x),(lt?z.ctrlKey:z.metaKey)&&te!="Mod"&&(x="Cmd-"+x),!ne&&z.shiftKey&&te!="Shift"&&(x="Shift-"+x),x}function zl(x,z){if(De&&x.keyCode==34&&x.char)return!1;var ne=Bs[x.keyCode];return ne==null||x.altGraphKey?!1:(x.keyCode==3&&x.code&&(ne=x.code),ml(ne,x,z))}function ss(x){return typeof x=="string"?Ja[x]:x}function _s(x,z){for(var ne=x.doc.sel.ranges,te=[],ie=0;ie<ne.length;ie++){for(var se=z(ne[ie]);te.length&&Fn(se.from,Bt(te).to)<=0;){var me=te.pop();if(Fn(me.from,se.from)<0){se.from=me.from;break}}te.push(se)}ea(x,function(){for(var Se=te.length-1;Se>=0;Se--)eu(x.doc,"",te[Se].from,te[Se].to,"+delete");zo(x)})}function Zo(x,z,ne){var te=Vt(x.text,z+ne,ne);return te<0||te>x.text.length?null:te}function Ws(x,z,ne){var te=Zo(x,z.ch,ne);return te==null?null:new an(z.line,te,ne<0?"after":"before")}function Kl(x,z,ne,te,ie){if(x){z.doc.direction=="rtl"&&(ie=-ie);var se=Tr(ne,z.doc.direction);if(se){var me=ie<0?Bt(se):se[0],Se=ie<0==(me.level==1),Ae=Se?"after":"before",Pe;if(me.level>0||z.doc.direction=="rtl"){var at=Ai(z,ne);Pe=ie<0?ne.text.length-1:0;var vt=Jr(z,at,Pe).top;Pe=en(function(Gt){return Jr(z,at,Gt).top==vt},ie<0==(me.level==1)?me.from:me.to-1,Pe),Ae=="before"&&(Pe=Zo(ne,Pe,1))}else Pe=ie<0?me.to:me.from;return new an(te,Pe,Ae)}}return new an(te,ie<0?ne.text.length:0,ie<0?"before":"after")}function Vs(x,z,ne,te){var ie=Tr(z,x.doc.direction);if(!ie)return Ws(z,ne,te);ne.ch>=z.text.length?(ne.ch=z.text.length,ne.sticky="before"):ne.ch<=0&&(ne.ch=0,ne.sticky="after");var se=Jt(ie,ne.ch,ne.sticky),me=ie[se];if(x.doc.direction=="ltr"&&me.level%2==0&&(te>0?me.to>ne.ch:me.from<ne.ch))return Ws(z,ne,te);var Se=function(_r,Or){return Zo(z,_r instanceof an?_r.ch:_r,Or)},Ae,Pe=function(_r){return x.options.lineWrapping?(Ae=Ae||Ai(x,z),Ra(x,z,Ae,_r)):{begin:0,end:z.text.length}},at=Pe(ne.sticky=="before"?Se(ne,-1):ne.ch);if(x.doc.direction=="rtl"||me.level==1){var vt=me.level==1==te<0,Gt=Se(ne,vt?1:-1);if(Gt!=null&&(vt?Gt<=me.to&&Gt<=at.end:Gt>=me.from&&Gt>=at.begin)){var Ft=vt?"before":"after";return new an(ne.line,Gt,Ft)}}var Rn=function(_r,Or,Sr){for(var Rr=function(eo,Wo){return Wo?new an(ne.line,Se(eo,1),"before"):new an(ne.line,eo,"after")};_r>=0&&_r<ie.length;_r+=Or){var hi=ie[_r],vi=Or>0==(hi.level!=1),ra=vi?Sr.begin:Se(Sr.end,-1);if(hi.from<=ra&&ra<hi.to||(ra=vi?hi.from:Se(hi.to,-1),Sr.begin<=ra&&ra<Sr.end))return Rr(ra,vi)}},Xn=Rn(se+te,te,at);if(Xn)return Xn;var hr=te>0?at.end:Se(at.begin,-1);return hr!=null&&!(te>0&&hr==z.text.length)&&(Xn=Rn(te>0?0:ie.length-1,te,Pe(hr)),Xn)?Xn:null}var au={selectAll:td,singleSelection:function(x){return x.setSelection(x.getCursor("anchor"),x.getCursor("head"),Je)},killLine:function(x){return _s(x,function(z){if(z.empty()){var ne=Pt(x.doc,z.head.line).text.length;return z.head.ch==ne&&z.head.line<x.lastLine()?{from:z.head,to:an(z.head.line+1,0)}:{from:z.head,to:an(z.head.line,ne)}}else return{from:z.from(),to:z.to()}})},deleteLine:function(x){return _s(x,function(z){return{from:an(z.from().line,0),to:or(x.doc,an(z.to().line+1,0))}})},delLineLeft:function(x){return _s(x,function(z){return{from:an(z.from().line,0),to:z.from()}})},delWrappedLineLeft:function(x){return _s(x,function(z){var ne=x.charCoords(z.head,"div").top+5,te=x.coordsChar({left:0,top:ne},"div");return{from:te,to:z.from()}})},delWrappedLineRight:function(x){return _s(x,function(z){var ne=x.charCoords(z.head,"div").top+5,te=x.coordsChar({left:x.display.lineDiv.offsetWidth+100,top:ne},"div");return{from:z.from(),to:te}})},undo:function(x){return x.undo()},redo:function(x){return x.redo()},undoSelection:function(x){return x.undoSelection()},redoSelection:function(x){return x.redoSelection()},goDocStart:function(x){return x.extendSelection(an(x.firstLine(),0))},goDocEnd:function(x){return x.extendSelection(an(x.lastLine()))},goLineStart:function(x){return x.extendSelectionsBy(function(z){return sd(x,z.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(x){return x.extendSelectionsBy(function(z){return lf(x,z.head)},{origin:"+move",bias:1})},goLineEnd:function(x){return x.extendSelectionsBy(function(z){return ld(x,z.head.line)},{origin:"+move",bias:-1})},goLineRight:function(x){return x.extendSelectionsBy(function(z){var ne=x.cursorCoords(z.head,"div").top+5;return x.coordsChar({left:x.display.lineDiv.offsetWidth+100,top:ne},"div")},Ht)},goLineLeft:function(x){return x.extendSelectionsBy(function(z){var ne=x.cursorCoords(z.head,"div").top+5;return x.coordsChar({left:0,top:ne},"div")},Ht)},goLineLeftSmart:function(x){return x.extendSelectionsBy(function(z){var ne=x.cursorCoords(z.head,"div").top+5,te=x.coordsChar({left:0,top:ne},"div");return te.ch<x.getLine(te.line).search(/\S/)?lf(x,z.head):te},Ht)},goLineUp:function(x){return x.moveV(-1,"line")},goLineDown:function(x){return x.moveV(1,"line")},goPageUp:function(x){return x.moveV(-1,"page")},goPageDown:function(x){return x.moveV(1,"page")},goCharLeft:function(x){return x.moveH(-1,"char")},goCharRight:function(x){return x.moveH(1,"char")},goColumnLeft:function(x){return x.moveH(-1,"column")},goColumnRight:function(x){return x.moveH(1,"column")},goWordLeft:function(x){return x.moveH(-1,"word")},goGroupRight:function(x){return x.moveH(1,"group")},goGroupLeft:function(x){return x.moveH(-1,"group")},goWordRight:function(x){return x.moveH(1,"word")},delCharBefore:function(x){return x.deleteH(-1,"codepoint")},delCharAfter:function(x){return x.deleteH(1,"char")},delWordBefore:function(x){return x.deleteH(-1,"word")},delWordAfter:function(x){return x.deleteH(1,"word")},delGroupBefore:function(x){return x.deleteH(-1,"group")},delGroupAfter:function(x){return x.deleteH(1,"group")},indentAuto:function(x){return x.indentSelection("smart")},indentMore:function(x){return x.indentSelection("add")},indentLess:function(x){return x.indentSelection("subtract")},insertTab:function(x){return x.replaceSelection(" ")},insertSoftTab:function(x){for(var z=[],ne=x.listSelections(),te=x.options.tabSize,ie=0;ie<ne.length;ie++){var se=ne[ie].from(),me=Ye(x.getLine(se.line),se.ch,te);z.push($t(te-me%te))}x.replaceSelections(z)},defaultTab:function(x){x.somethingSelected()?x.indentSelection("add"):x.execCommand("insertTab")},transposeChars:function(x){return ea(x,function(){for(var z=x.listSelections(),ne=[],te=0;te<z.length;te++)if(z[te].empty()){var ie=z[te].head,se=Pt(x.doc,ie.line).text;if(se){if(ie.ch==se.length&&(ie=new an(ie.line,ie.ch-1)),ie.ch>0)ie=new an(ie.line,ie.ch+1),x.replaceRange(se.charAt(ie.ch-1)+se.charAt(ie.ch-2),an(ie.line,ie.ch-2),ie,"+transpose");else if(ie.line>x.doc.first){var me=Pt(x.doc,ie.line-1).text;me&&(ie=new an(ie.line,1),x.replaceRange(se.charAt(0)+x.doc.lineSeparator()+me.charAt(me.length-1),an(ie.line-1,me.length-1),ie,"+transpose"))}}ne.push(new Ha(ie,ie))}x.setSelections(ne)})},newlineAndIndent:function(x){return ea(x,function(){for(var z=x.listSelections(),ne=z.length-1;ne>=0;ne--)x.replaceRange(x.doc.lineSeparator(),z[ne].anchor,z[ne].head,"+input");z=x.listSelections();for(var te=0;te<z.length;te++)x.indentLine(z[te].from().line,null,!0);zo(x)})},openLine:function(x){return x.replaceSelection(`
`,"start")},toggleOverwrite:function(x){return x.toggleOverwrite()}};function sd(x,z){var ne=Pt(x.doc,z),te=st(ne);return te!=ne&&(z=Un(te)),Kl(!0,x,te,z,1)}function ld(x,z){var ne=Pt(x.doc,z),te=mt(ne);return te!=ne&&(z=Un(te)),Kl(!0,x,ne,z,-1)}function lf(x,z){var ne=sd(x,z.line),te=Pt(x.doc,ne.line),ie=Tr(te,x.doc.direction);if(!ie||ie[0].level==0){var se=Math.max(ne.ch,te.text.search(/\S/)),me=z.line==ne.line&&z.ch<=se&&z.ch;return an(ne.line,me?0:se,ne.sticky)}return ne}function Do(x,z,ne){if(typeof z=="string"&&(z=au[z],!z))return!1;x.display.input.ensurePolled();var te=x.display.shift,ie=!1;try{x.isReadOnly()&&(x.state.suppressEdits=!0),ne&&(x.display.shift=!1),ie=z(x)!=Xt}finally{x.display.shift=te,x.state.suppressEdits=!1}return ie}function Us(x,z,ne){for(var te=0;te<x.state.keyMaps.length;te++){var ie=rl(z,x.state.keyMaps[te],ne,x);if(ie)return ie}return x.options.extraKeys&&rl(z,x.options.extraKeys,ne,x)||rl(z,x.options.keyMap,ne,x)}var rh=new Ee;function ou(x,z,ne,te){var ie=x.state.keySeq;if(ie){if(Du(z))return"handled";if(/\'$/.test(z)?x.state.keySeq=null:rh.set(50,function(){x.state.keySeq==ie&&(x.state.keySeq=null,x.display.input.reset())}),bc(x,ie+" "+z,ne,te))return!0}return bc(x,z,ne,te)}function bc(x,z,ne,te){var ie=Us(x,z,te);return ie=="multi"&&(x.state.keySeq=z),ie=="handled"&&Mn(x,"keyHandled",x,z,ne),(ie=="handled"||ie=="multi")&&(Ei(ne),qr(x)),!!ie}function ya(x,z){var ne=zl(z,!0);return ne?z.shiftKey&&!x.state.keySeq?ou(x,"Shift-"+ne,z,function(te){return Do(x,te,!0)})||ou(x,ne,z,function(te){if(typeof te=="string"?/^go[A-Z]/.test(te):te.motion)return Do(x,te)}):ou(x,ne,z,function(te){return Do(x,te)}):!1}function su(x,z,ne){return ou(x,"'"+ne+"'",z,function(te){return Do(x,te,!0)})}var il=null;function Iu(x){var z=this;if(!(x.target&&x.target!=z.display.input.getField())&&(z.curOp.focus=kt(),!Fr(z,x))){ye&&Ce<11&&x.keyCode==27&&(x.returnValue=!1);var ne=x.keyCode;z.display.shift=ne==16||x.shiftKey;var te=ya(z,x);De&&(il=te?ne:null,!te&&ne==88&&!Tn&&(Te?x.metaKey:x.ctrlKey)&&z.replaceSelection("",null,"cut")),be&&!Te&&!te&&ne==46&&x.shiftKey&&!x.ctrlKey&&document.execCommand&&document.execCommand("cut"),ne==18&&!/\bCodeMirror-crosshair\b/.test(z.display.lineDiv.className)&&In(z)}}function In(x){var z=x.display.lineDiv;vn(z,"CodeMirror-crosshair");function ne(te){(te.keyCode==18||!te.altKey)&&(Ue(z,"CodeMirror-crosshair"),Qr(document,"keyup",ne),Qr(document,"mouseover",ne))}Ln(document,"keyup",ne),Ln(document,"mouseover",ne)}function uf(x){x.keyCode==16&&(this.doc.sel.shift=!1),Fr(this,x)}function cf(x){var z=this;if(!(x.target&&x.target!=z.display.input.getField())&&!(ki(z.display,x)||Fr(z,x)||x.ctrlKey&&!x.altKey||Te&&x.metaKey)){var ne=x.keyCode,te=x.charCode;if(De&&ne==il){il=null,Ei(x);return}if(!(De&&(!x.which||x.which<10)&&ya(z,x))){var ie=String.fromCharCode(te==null?ne:te);ie!="\b"&&(su(z,x,ie)||z.display.input.onKeyPress(x))}}}var ud=400,cd=function(x,z,ne){this.time=x,this.pos=z,this.button=ne};cd.prototype.compare=function(x,z,ne){return this.time+ud>x&&Fn(z,this.pos)==0&&ne==this.button};var al,Pu;function ih(x,z){var ne=+new Date;return Pu&&Pu.compare(ne,x,z)?(al=Pu=null,"triple"):al&&al.compare(ne,x,z)?(Pu=new cd(ne,x,z),al=null,"double"):(al=new cd(ne,x,z),Pu=null,"single")}function jo(x){var z=this,ne=z.display;if(!(Fr(z,x)||ne.activeTouch&&ne.input.supportsTouch())){if(ne.input.ensurePolled(),ne.shift=x.shiftKey,ki(ne,x)){Me||(ne.scroller.draggable=!1,setTimeout(function(){return ne.scroller.draggable=!0},100));return}if(!ts(z,x)){var te=Ao(z,x),ie=Hr(x),se=te?ih(te,ie):"single";window.focus(),ie==1&&z.state.selectingText&&z.state.selectingText(x),!(te&&gl(z,ie,te,se,x))&&(ie==1?te?wc(z,te,se,x):ca(x)==ne.scroller&&Ei(x):ie==2?(te&&Nl(z.doc,te),setTimeout(function(){return ne.input.focus()},20)):ie==3&&(Ie?z.display.input.onContextMenu(x):$a(z)))}}}function gl(x,z,ne,te,ie){var se="Click";return te=="double"?se="Double"+se:te=="triple"&&(se="Triple"+se),se=(z==1?"Left":z==2?"Middle":"Right")+se,ou(x,ml(se,ie),ie,function(me){if(typeof me=="string"&&(me=au[me]),!me)return!1;var Se=!1;try{x.isReadOnly()&&(x.state.suppressEdits=!0),Se=me(x,ne)!=Xt}finally{x.state.suppressEdits=!1}return Se})}function xc(x,z,ne){var te=x.getOption("configureMouse"),ie=te?te(x,z,ne):{};if(ie.unit==null){var se=Et?ne.shiftKey&&ne.metaKey:ne.altKey;ie.unit=se?"rectangle":z=="single"?"char":z=="double"?"word":"line"}return(ie.extend==null||x.doc.extend)&&(ie.extend=x.doc.extend||ne.shiftKey),ie.addNew==null&&(ie.addNew=Te?ne.metaKey:ne.ctrlKey),ie.moveOnDrag==null&&(ie.moveOnDrag=!(Te?ne.altKey:ne.ctrlKey)),ie}function wc(x,z,ne,te){ye?setTimeout(An(ii,x),0):x.curOp.focus=kt();var ie=xc(x,ne,te),se=x.doc.sel,me;x.options.dragDrop&&La&&!x.isReadOnly()&&ne=="single"&&(me=se.contains(z))>-1&&(Fn((me=se.ranges[me]).from(),z)<0||z.xRel>0)&&(Fn(me.to(),z)>0||z.xRel<0)?ah(x,te,z,ie):dd(x,te,z,ie)}function ah(x,z,ne,te){var ie=x.display,se=!1,me=Na(x,function(Pe){Me&&(ie.scroller.draggable=!1),x.state.draggingText=!1,Qr(ie.wrapper.ownerDocument,"mouseup",me),Qr(ie.wrapper.ownerDocument,"mousemove",Se),Qr(ie.scroller,"dragstart",Ae),Qr(ie.scroller,"drop",me),se||(Ei(Pe),te.addNew||Nl(x.doc,ne,null,null,te.extend),Me&&!ct||ye&&Ce==9?setTimeout(function(){ie.wrapper.ownerDocument.body.focus({preventScroll:!0}),ie.input.focus()},20):ie.input.focus())}),Se=function(Pe){se=se||Math.abs(z.clientX-Pe.clientX)+Math.abs(z.clientY-Pe.clientY)>=10},Ae=function(){return se=!0};Me&&(ie.scroller.draggable=!0),x.state.draggingText=me,me.copy=!te.moveOnDrag,ie.scroller.dragDrop&&ie.scroller.dragDrop(),Ln(ie.wrapper.ownerDocument,"mouseup",me),Ln(ie.wrapper.ownerDocument,"mousemove",Se),Ln(ie.scroller,"dragstart",Ae),Ln(ie.scroller,"drop",me),$a(x),setTimeout(function(){return ie.input.focus()},20)}function df(x,z,ne){if(ne=="char")return new Ha(z,z);if(ne=="word")return x.findWordAt(z);if(ne=="line")return new Ha(an(z.line,0),or(x.doc,an(z.line+1,0)));var te=ne(x,z);return new Ha(te.from,te.to)}function dd(x,z,ne,te){var ie=x.display,se=x.doc;Ei(z);var me,Se,Ae=se.sel,Pe=Ae.ranges;if(te.addNew&&!te.extend?(Se=se.sel.contains(ne),Se>-1?me=Pe[Se]:me=new Ha(ne,ne)):(me=se.sel.primary(),Se=se.sel.primIndex),te.unit=="rectangle")te.addNew||(me=new Ha(ne,ne)),ne=Ao(x,z,!0,!0),Se=-1;else{var at=df(x,ne,te.unit);te.extend?me=fc(me,at.anchor,at.head,te.extend):me=at}te.addNew?Se==-1?(Se=Pe.length,To(se,Es(x,Pe.concat([me]),Se),{scroll:!1,origin:"*mouse"})):Pe.length>1&&Pe[Se].empty()&&te.unit=="char"&&!te.extend?(To(se,Es(x,Pe.slice(0,Se).concat(Pe.slice(Se+1)),0),{scroll:!1,origin:"*mouse"}),Ae=se.sel):ws(se,Se,me,rt):(Se=0,To(se,new vs([me],0),rt),Ae=se.sel);var vt=ne;function Gt(Sr){if(Fn(vt,Sr)!=0)if(vt=Sr,te.unit=="rectangle"){for(var Rr=[],hi=x.options.tabSize,vi=Ye(Pt(se,ne.line).text,ne.ch,hi),ra=Ye(Pt(se,Sr.line).text,Sr.ch,hi),eo=Math.min(vi,ra),Wo=Math.max(vi,ra),bo=Math.min(ne.line,Sr.line),cs=Math.min(x.lastLine(),Math.max(ne.line,Sr.line));bo<=cs;bo++){var ds=Pt(se,bo).text,Io=Sn(ds,eo,hi);eo==Wo?Rr.push(new Ha(an(bo,Io),an(bo,Io))):ds.length>Io&&Rr.push(new Ha(an(bo,Io),an(bo,Sn(ds,Wo,hi))))}Rr.length||Rr.push(new Ha(ne,ne)),To(se,Es(x,Ae.ranges.slice(0,Se).concat(Rr),Se),{origin:"*mouse",scroll:!1}),x.scrollIntoView(Sr)}else{var fs=me,zi=df(x,Sr,te.unit),So=fs.anchor,xo;Fn(zi.anchor,So)>0?(xo=zi.head,So=Dr(fs.from(),zi.anchor)):(xo=zi.anchor,So=Vr(fs.to(),zi.head));var Co=Ae.ranges.slice(0);Co[Se]=ff(x,new Ha(or(se,So),xo)),To(se,Es(x,Co,Se),rt)}}var Ft=ie.wrapper.getBoundingClientRect(),Rn=0;function Xn(Sr){var Rr=++Rn,hi=Ao(x,Sr,!0,te.unit=="rectangle");if(hi)if(Fn(hi,vt)!=0){x.curOp.focus=kt(),Gt(hi);var vi=ta(ie,se);(hi.line>=vi.to||hi.line<vi.from)&&setTimeout(Na(x,function(){Rn==Rr&&Xn(Sr)}),150)}else{var ra=Sr.clientY<Ft.top?-20:Sr.clientY>Ft.bottom?20:0;ra&&setTimeout(Na(x,function(){Rn==Rr&&(ie.scroller.scrollTop+=ra,Xn(Sr))}),50)}}function hr(Sr){x.state.selectingText=!1,Rn=1/0,Sr&&(Ei(Sr),ie.input.focus()),Qr(ie.wrapper.ownerDocument,"mousemove",_r),Qr(ie.wrapper.ownerDocument,"mouseup",Or),se.history.lastSelOrigin=null}var _r=Na(x,function(Sr){Sr.buttons===0||!Hr(Sr)?hr(Sr):Xn(Sr)}),Or=Na(x,hr);x.state.selectingText=Or,Ln(ie.wrapper.ownerDocument,"mousemove",_r),Ln(ie.wrapper.ownerDocument,"mouseup",Or)}function ff(x,z){var ne=z.anchor,te=z.head,ie=Pt(x.doc,ne.line);if(Fn(ne,te)==0&&ne.sticky==te.sticky)return z;var se=Tr(ie);if(!se)return z;var me=Jt(se,ne.ch,ne.sticky),Se=se[me];if(Se.from!=ne.ch&&Se.to!=ne.ch)return z;var Ae=me+(Se.from==ne.ch==(Se.level!=1)?0:1);if(Ae==0||Ae==se.length)return z;var Pe;if(te.line!=ne.line)Pe=(te.line-ne.line)*(x.doc.direction=="ltr"?1:-1)>0;else{var at=Jt(se,te.ch,te.sticky),vt=at-me||(te.ch-ne.ch)*(Se.level==1?-1:1);at==Ae-1||at==Ae?Pe=vt<0:Pe=vt>0}var Gt=se[Ae+(Pe?-1:0)],Ft=Pe==(Gt.level==1),Rn=Ft?Gt.from:Gt.to,Xn=Ft?"after":"before";return ne.ch==Rn&&ne.sticky==Xn?z:new Ha(new an(ne.line,Rn,Xn),te)}function Bu(x,z,ne,te){var ie,se;if(z.touches)ie=z.touches[0].clientX,se=z.touches[0].clientY;else try{ie=z.clientX,se=z.clientY}catch(Gt){return!1}if(ie>=Math.floor(x.display.gutters.getBoundingClientRect().right))return!1;te&&Ei(z);var me=x.display,Se=me.lineDiv.getBoundingClientRect();if(se>Se.bottom||!Fi(x,ne))return ba(z);se-=Se.top-me.viewOffset;for(var Ae=0;Ae<x.display.gutterSpecs.length;++Ae){var Pe=me.gutters.childNodes[Ae];if(Pe&&Pe.getBoundingClientRect().right>=ie){var at=qn(x.doc,se),vt=x.display.gutterSpecs[Ae];return Gn(x,ne,x,at,vt.className,z),ba(z)}}}function ts(x,z){return Bu(x,z,"gutterClick",!0)}function vl(x,z){ki(x.display,z)||hf(x,z)||Fr(x,z,"contextmenu")||Ie||x.display.input.onContextMenu(z)}function hf(x,z){return Fi(x,"gutterContextMenu")?Bu(x,z,"gutterContextMenu",!1):!1}function fd(x){x.display.wrapper.className=x.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+x.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Zr(x)}var yl={toString:function(){return"CodeMirror.Init"}},pf={},Sc={};function oh(x){var z=x.optionHandlers;function ne(te,ie,se,me){x.defaults[te]=ie,se&&(z[te]=me?function(Se,Ae,Pe){Pe!=yl&&se(Se,Ae,Pe)}:se)}x.defineOption=ne,x.Init=yl,ne("value","",function(te,ie){return te.setValue(ie)},!0),ne("mode",null,function(te,ie){te.doc.modeOption=ie,rc(te)},!0),ne("indentUnit",2,rc,!0),ne("indentWithTabs",!1),ne("smartIndent",!0),ne("tabSize",4,function(te){Ol(te),Zr(te),ui(te)},!0),ne("lineSeparator",null,function(te,ie){if(te.doc.lineSep=ie,!!ie){var se=[],me=te.doc.first;te.doc.iter(function(Ae){for(var Pe=0;;){var at=Ae.text.indexOf(ie,Pe);if(at==-1)break;Pe=at+ie.length,se.push(an(me,at))}me++});for(var Se=se.length-1;Se>=0;Se--)eu(te.doc,ie,se[Se],an(se[Se].line,se[Se].ch+ie.length))}}),ne("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(te,ie,se){te.state.specialChars=new RegExp(ie.source+(ie.test(" ")?"":"| "),"g"),se!=yl&&te.refresh()}),ne("specialCharPlaceholder",$e,function(te){return te.refresh()},!0),ne("electricChars",!0),ne("inputStyle",Xe?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),ne("spellcheck",!1,function(te,ie){return te.getInputField().spellcheck=ie},!0),ne("autocorrect",!1,function(te,ie){return te.getInputField().autocorrect=ie},!0),ne("autocapitalize",!1,function(te,ie){return te.getInputField().autocapitalize=ie},!0),ne("rtlMoveVisually",!Lt),ne("wholeLineUpdateBefore",!0),ne("theme","default",function(te){fd(te),Ql(te)},!0),ne("keyMap","default",function(te,ie,se){var me=ss(ie),Se=se!=yl&&ss(se);Se&&Se.detach&&Se.detach(te,me),me.attach&&me.attach(te,Se||null)}),ne("extraKeys",null),ne("configureMouse",null),ne("lineWrapping",!1,mf,!0),ne("gutters",[],function(te,ie){te.display.gutterSpecs=ec(ie,te.options.lineNumbers),Ql(te)},!0),ne("fixedGutter",!0,function(te,ie){te.display.gutters.style.left=ie?Bo(te.display)+"px":"0",te.refresh()},!0),ne("coverGutterNextToScrollbar",!1,function(te){return xs(te)},!0),ne("scrollbarStyle","native",function(te){vu(te),xs(te),te.display.scrollbars.setScrollTop(te.doc.scrollTop),te.display.scrollbars.setScrollLeft(te.doc.scrollLeft)},!0),ne("lineNumbers",!1,function(te,ie){te.display.gutterSpecs=ec(te.options.gutters,ie),Ql(te)},!0),ne("firstLineNumber",1,Ql,!0),ne("lineNumberFormatter",function(te){return te},Ql,!0),ne("showCursorWhenSelecting",!1,Qo,!0),ne("resetSelectionOnContextMenu",!0),ne("lineWiseCopyCut",!0),ne("pasteLinesPerSelection",!0),ne("selectionsMayTouch",!1),ne("readOnly",!1,function(te,ie){ie=="nocursor"&&($o(te),te.display.input.blur()),te.display.input.readOnlyChanged(ie)}),ne("screenReaderLabel",null,function(te,ie){ie=ie===""?null:ie,te.display.input.screenReaderLabelChanged(ie)}),ne("disableInput",!1,function(te,ie){ie||te.display.input.reset()},!0),ne("dragDrop",!0,sh),ne("allowDropFileTypes",null),ne("cursorBlinkRate",530),ne("cursorScrollMargin",0),ne("cursorHeight",1,Qo,!0),ne("singleCursorHeightPerLine",!0,Qo,!0),ne("workTime",100),ne("workDelay",100),ne("flattenSpans",!0,Ol,!0),ne("addModeClass",!1,Ol,!0),ne("pollInterval",100),ne("undoDepth",200,function(te,ie){return te.doc.history.undoDepth=ie}),ne("historyEventDelay",1250),ne("viewportMargin",10,function(te){return te.refresh()},!0),ne("maxHighlightLength",1e4,Ol,!0),ne("moveInputWithCursor",!0,function(te,ie){ie||te.display.input.resetPosition()}),ne("tabindex",null,function(te,ie){return te.display.input.getField().tabIndex=ie||""}),ne("autofocus",null),ne("direction","ltr",function(te,ie){return te.doc.setDirection(ie)},!0),ne("phrases",null)}function sh(x,z,ne){var te=ne&&ne!=yl;if(!z!=!te){var ie=x.display.dragFunctions,se=z?Ln:Qr;se(x.display.scroller,"dragstart",ie.start),se(x.display.scroller,"dragenter",ie.enter),se(x.display.scroller,"dragover",ie.over),se(x.display.scroller,"dragleave",ie.leave),se(x.display.scroller,"drop",ie.drop)}}function mf(x){x.options.lineWrapping?(vn(x.display.wrapper,"CodeMirror-wrap"),x.display.sizer.style.minWidth="",x.display.sizerWidth=null):(Ue(x.display.wrapper,"CodeMirror-wrap"),fn(x)),so(x),ui(x),Zr(x),setTimeout(function(){return xs(x)},100)}function Bi(x,z){var ne=this;if(!(this instanceof Bi))return new Bi(x,z);this.options=z=z?Zn(z):{},Zn(pf,z,!1);var te=z.value;typeof te=="string"?te=new Eo(te,z.mode,null,z.lineSeparator,z.direction):z.mode&&(te.modeOption=z.mode),this.doc=te;var ie=new Bi.inputStyles[z.inputStyle](this),se=this.display=new Gd(x,te,ie,z);se.wrapper.CodeMirror=this,fd(this),z.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),vu(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Ee,keySeq:null,specialChars:null},z.autofocus&&!Xe&&se.input.focus(),ye&&Ce<11&&setTimeout(function(){return ne.display.input.reset(!0)},20),lh(this),ad(),Ks(this),this.curOp.forceUpdate=!0,wu(this,te),z.autofocus&&!Xe||this.hasFocus()?setTimeout(function(){ne.hasFocus()&&!ne.state.focused&&Ua(ne)},20):$o(this);for(var me in Sc)Sc.hasOwnProperty(me)&&Sc[me](this,z[me],yl);bu(this),z.finishInit&&z.finishInit(this);for(var Se=0;Se<hd.length;++Se)hd[Se](this);Is(this),Me&&z.lineWrapping&&getComputedStyle(se.lineDiv).textRendering=="optimizelegibility"&&(se.lineDiv.style.textRendering="auto")}Bi.defaults=pf,Bi.optionHandlers=Sc;function lh(x){var z=x.display;Ln(z.scroller,"mousedown",Na(x,jo)),ye&&Ce<11?Ln(z.scroller,"dblclick",Na(x,function(Ae){if(!Fr(x,Ae)){var Pe=Ao(x,Ae);if(!(!Pe||ts(x,Ae)||ki(x.display,Ae))){Ei(Ae);var at=x.findWordAt(Pe);Nl(x.doc,at.anchor,at.head)}}})):Ln(z.scroller,"dblclick",function(Ae){return Fr(x,Ae)||Ei(Ae)}),Ln(z.scroller,"contextmenu",function(Ae){return vl(x,Ae)}),Ln(z.input.getField(),"contextmenu",function(Ae){z.scroller.contains(Ae.target)||vl(x,Ae)});var ne,te={end:0};function ie(){z.activeTouch&&(ne=setTimeout(function(){return z.activeTouch=null},1e3),te=z.activeTouch,te.end=+new Date)}function se(Ae){if(Ae.touches.length!=1)return!1;var Pe=Ae.touches[0];return Pe.radiusX<=1&&Pe.radiusY<=1}function me(Ae,Pe){if(Pe.left==null)return!0;var at=Pe.left-Ae.left,vt=Pe.top-Ae.top;return at*at+vt*vt>20*20}Ln(z.scroller,"touchstart",function(Ae){if(!Fr(x,Ae)&&!se(Ae)&&!ts(x,Ae)){z.input.ensurePolled(),clearTimeout(ne);var Pe=+new Date;z.activeTouch={start:Pe,moved:!1,prev:Pe-te.end<=300?te:null},Ae.touches.length==1&&(z.activeTouch.left=Ae.touches[0].pageX,z.activeTouch.top=Ae.touches[0].pageY)}}),Ln(z.scroller,"touchmove",function(){z.activeTouch&&(z.activeTouch.moved=!0)}),Ln(z.scroller,"touchend",function(Ae){var Pe=z.activeTouch;if(Pe&&!ki(z,Ae)&&Pe.left!=null&&!Pe.moved&&new Date-Pe.start<300){var at=x.coordsChar(z.activeTouch,"page"),vt;!Pe.prev||me(Pe,Pe.prev)?vt=new Ha(at,at):!Pe.prev.prev||me(Pe,Pe.prev.prev)?vt=x.findWordAt(at):vt=new Ha(an(at.line,0),or(x.doc,an(at.line+1,0))),x.setSelection(vt.anchor,vt.head),x.focus(),Ei(Ae)}ie()}),Ln(z.scroller,"touchcancel",ie),Ln(z.scroller,"scroll",function(){z.scroller.clientHeight&&(Ma(x,z.scroller.scrollTop),go(x,z.scroller.scrollLeft,!0),Gn(x,"scroll",x))}),Ln(z.scroller,"mousewheel",function(Ae){return Xc(x,Ae)}),Ln(z.scroller,"DOMMouseScroll",function(Ae){return Xc(x,Ae)}),Ln(z.wrapper,"scroll",function(){return z.wrapper.scrollTop=z.wrapper.scrollLeft=0}),z.dragFunctions={enter:function(Ae){Fr(x,Ae)||ka(Ae)},over:function(Ae){Fr(x,Ae)||(id(x,Ae),ka(Ae))},start:function(Ae){return th(x,Ae)},drop:Na(x,eh),leave:function(Ae){Fr(x,Ae)||ru(x)}};var Se=z.input.getField();Ln(Se,"keyup",function(Ae){return uf.call(x,Ae)}),Ln(Se,"keydown",Na(x,Iu)),Ln(Se,"keypress",Na(x,cf)),Ln(Se,"focus",function(Ae){return Ua(x,Ae)}),Ln(Se,"blur",function(Ae){return $o(x,Ae)})}var hd=[];Bi.defineInitHook=function(x){return hd.push(x)};function Os(x,z,ne,te){var ie=x.doc,se;ne==null&&(ne="add"),ne=="smart"&&(ie.mode.indent?se=_i(x,z).state:ne="prev");var me=x.options.tabSize,Se=Pt(ie,z),Ae=Ye(Se.text,null,me);Se.stateAfter&&(Se.stateAfter=null);var Pe=Se.text.match(/^\s*/)[0],at;if(!te&&!/\S/.test(Se.text))at=0,ne="not";else if(ne=="smart"&&(at=ie.mode.indent(se,Se.text.slice(Pe.length),Se.text),at==Xt||at>150)){if(!te)return;ne="prev"}ne=="prev"?z>ie.first?at=Ye(Pt(ie,z-1).text,null,me):at=0:ne=="add"?at=Ae+x.options.indentUnit:ne=="subtract"?at=Ae-x.options.indentUnit:typeof ne=="number"&&(at=Ae+ne),at=Math.max(0,at);var vt="",Gt=0;if(x.options.indentWithTabs)for(var Ft=Math.floor(at/me);Ft;--Ft)Gt+=me,vt+=" ";if(Gt<at&&(vt+=$t(at-Gt)),vt!=Pe)return eu(ie,vt,an(z,0),an(z,Pe.length),"+input"),Se.stateAfter=null,!0;for(var Rn=0;Rn<ie.sel.ranges.length;Rn++){var Xn=ie.sel.ranges[Rn];if(Xn.head.line==z&&Xn.head.ch<Pe.length){var hr=an(z,Pe.length);ws(ie,Rn,new Ha(hr,hr));break}}}var Rs=null;function bl(x){Rs=x}function pd(x,z,ne,te,ie){var se=x.doc;x.display.shift=!1,te||(te=se.sel);var me=+new Date-200,Se=ie=="paste"||x.state.pasteIncoming>me,Ae=wt(z),Pe=null;if(Se&&te.ranges.length>1)if(Rs&&Rs.text.join(`
`)==z){if(te.ranges.length%Rs.text.length==0){Pe=[];for(var at=0;at<Rs.text.length;at++)Pe.push(se.splitLines(Rs.text[at]))}}else Ae.length==te.ranges.length&&x.options.pasteLinesPerSelection&&(Pe=bn(Ae,function(_r){return[_r]}));for(var vt=x.curOp.updateInput,Gt=te.ranges.length-1;Gt>=0;Gt--){var Ft=te.ranges[Gt],Rn=Ft.from(),Xn=Ft.to();Ft.empty()&&(ne&&ne>0?Rn=an(Rn.line,Rn.ch-ne):x.state.overwrite&&!Se?Xn=an(Xn.line,Math.min(Pt(se,Xn.line).text.length,Xn.ch+Bt(Ae).length)):Se&&Rs&&Rs.lineWise&&Rs.text.join(`
`)==Ae.join(`
`)&&(Rn=Xn=an(Rn.line,0)));var hr={from:Rn,to:Xn,text:Pe?Pe[Gt%Pe.length]:Ae,origin:ie||(Se?"paste":x.state.cutIncoming>me?"cut":"+input")};dl(x.doc,hr),Mn(x,"inputRead",x,hr)}z&&!Se&&gd(x,z),zo(x),x.curOp.updateInput<2&&(x.curOp.updateInput=vt),x.curOp.typing=!0,x.state.pasteIncoming=x.state.cutIncoming=-1}function md(x,z){var ne=x.clipboardData&&x.clipboardData.getData("Text");if(ne)return x.preventDefault(),!z.isReadOnly()&&!z.options.disableInput&&ea(z,function(){return pd(z,ne,0,null,"paste")}),!0}function gd(x,z){if(!(!x.options.electricChars||!x.options.smartIndent))for(var ne=x.doc.sel,te=ne.ranges.length-1;te>=0;te--){var ie=ne.ranges[te];if(!(ie.head.ch>100||te&&ne.ranges[te-1].head.line==ie.head.line)){var se=x.getModeAt(ie.head),me=!1;if(se.electricChars){for(var Se=0;Se<se.electricChars.length;Se++)if(z.indexOf(se.electricChars.charAt(Se))>-1){me=Os(x,ie.head.line,"smart");break}}else se.electricInput&&se.electricInput.test(Pt(x.doc,ie.head.line).text.slice(0,ie.head.ch))&&(me=Os(x,ie.head.line,"smart"));me&&Mn(x,"electricInput",x,ie.head.line)}}}function lu(x){for(var z=[],ne=[],te=0;te<x.doc.sel.ranges.length;te++){var ie=x.doc.sel.ranges[te].head.line,se={anchor:an(ie,0),head:an(ie+1,0)};ne.push(se),z.push(x.getRange(se.anchor,se.head))}return{text:z,ranges:ne}}function gf(x,z,ne,te){x.setAttribute("autocorrect",ne?"":"off"),x.setAttribute("autocapitalize",te?"":"off"),x.setAttribute("spellcheck",!!z)}function vd(){var x=bt("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),z=bt("div",[x],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return Me?x.style.width="1000px":x.setAttribute("wrap","off"),ut&&(x.style.border="1px solid black"),gf(x),z}function yd(x){var z=x.optionHandlers,ne=x.helpers={};x.prototype={constructor:x,focus:function(){window.focus(),this.display.input.focus()},setOption:function(te,ie){var se=this.options,me=se[te];se[te]==ie&&te!="mode"||(se[te]=ie,z.hasOwnProperty(te)&&Na(this,z[te])(this,ie,me),Gn(this,"optionChange",this,te))},getOption:function(te){return this.options[te]},getDoc:function(){return this.doc},addKeyMap:function(te,ie){this.state.keyMaps[ie?"push":"unshift"](ss(te))},removeKeyMap:function(te){for(var ie=this.state.keyMaps,se=0;se<ie.length;++se)if(ie[se]==te||ie[se].name==te)return ie.splice(se,1),!0},addOverlay:Ia(function(te,ie){var se=te.token?te:x.getMode(this.options,te);if(se.startState)throw new Error("Overlays may not be stateful.");dn(this.state.overlays,{mode:se,modeSpec:te,opaque:ie&&ie.opaque,priority:ie&&ie.priority||0},function(me){return me.priority}),this.state.modeGen++,ui(this)}),removeOverlay:Ia(function(te){for(var ie=this.state.overlays,se=0;se<ie.length;++se){var me=ie[se].modeSpec;if(me==te||typeof te=="string"&&me.name==te){ie.splice(se,1),this.state.modeGen++,ui(this);return}}}),indentLine:Ia(function(te,ie,se){typeof ie!="string"&&typeof ie!="number"&&(ie==null?ie=this.options.smartIndent?"smart":"prev":ie=ie?"add":"subtract"),Jn(this.doc,te)&&Os(this,te,ie,se)}),indentSelection:Ia(function(te){for(var ie=this.doc.sel.ranges,se=-1,me=0;me<ie.length;me++){var Se=ie[me];if(Se.empty())Se.head.line>se&&(Os(this,Se.head.line,te,!0),se=Se.head.line,me==this.doc.sel.primIndex&&zo(this));else{var Ae=Se.from(),Pe=Se.to(),at=Math.max(se,Ae.line);se=Math.min(this.lastLine(),Pe.line-(Pe.ch?0:1))+1;for(var vt=at;vt<se;++vt)Os(this,vt,te);var Gt=this.doc.sel.ranges;Ae.ch==0&&ie.length==Gt.length&&Gt[me].from().ch>0&&ws(this.doc,me,new Ha(Ae,Gt[me].to()),Je)}}}),getTokenAt:function(te,ie){return xa(this,te,ie)},getLineTokens:function(te,ie){return xa(this,an(te),ie,!0)},getTokenTypeAt:function(te){te=or(this.doc,te);var ie=Wi(this,Pt(this.doc,te.line)),se=0,me=(ie.length-1)/2,Se=te.ch,Ae;if(Se==0)Ae=ie[2];else for(;;){var Pe=se+me>>1;if((Pe?ie[Pe*2-1]:0)>=Se)me=Pe;else if(ie[Pe*2+1]<Se)se=Pe+1;else{Ae=ie[Pe*2+2];break}}var at=Ae?Ae.indexOf("overlay "):-1;return at<0?Ae:at==0?null:Ae.slice(0,at-1)},getModeAt:function(te){var ie=this.doc.mode;return ie.innerMode?x.innerMode(ie,this.getTokenAt(te).state).mode:ie},getHelper:function(te,ie){return this.getHelpers(te,ie)[0]},getHelpers:function(te,ie){var se=[];if(!ne.hasOwnProperty(ie))return se;var me=ne[ie],Se=this.getModeAt(te);if(typeof Se[ie]=="string")me[Se[ie]]&&se.push(me[Se[ie]]);else if(Se[ie])for(var Ae=0;Ae<Se[ie].length;Ae++){var Pe=me[Se[ie][Ae]];Pe&&se.push(Pe)}else Se.helperType&&me[Se.helperType]?se.push(me[Se.helperType]):me[Se.name]&&se.push(me[Se.name]);for(var at=0;at<me._global.length;at++){var vt=me._global[at];vt.pred(Se,this)&&Tt(se,vt.val)==-1&&se.push(vt.val)}return se},getStateAfter:function(te,ie){var se=this.doc;return te=wi(se,te==null?se.first+se.size-1:te),_i(this,te+1,ie).state},cursorCoords:function(te,ie){var se,me=this.doc.sel.primary();return te==null?se=me.head:typeof te=="object"?se=or(this.doc,te):se=te?me.from():me.to(),Yi(this,se,ie||"page")},charCoords:function(te,ie){return Va(this,or(this.doc,te),ie||"page")},coordsChar:function(te,ie){return te=ma(this,te,ie||"page"),ja(this,te.left,te.top)},lineAtHeight:function(te,ie){return te=ma(this,{top:te,left:0},ie||"page").top,qn(this.doc,te+this.display.viewOffset)},heightAtLine:function(te,ie,se){var me=!1,Se;if(typeof te=="number"){var Ae=this.doc.first+this.doc.size-1;te<this.doc.first?te=this.doc.first:te>Ae&&(te=Ae,me=!0),Se=Pt(this.doc,te)}else Se=te;return sa(this,Se,{top:0,left:0},ie||"page",se||me).top+(me?this.doc.height-tn(Se):0)},defaultTextHeight:function(){return Fa(this.display)},defaultCharWidth:function(){return ro(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(te,ie,se,me,Se){var Ae=this.display;te=Yi(this,or(this.doc,te));var Pe=te.bottom,at=te.left;if(ie.style.position="absolute",ie.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(ie),Ae.sizer.appendChild(ie),me=="over")Pe=te.top;else if(me=="above"||me=="near"){var vt=Math.max(Ae.wrapper.clientHeight,this.doc.height),Gt=Math.max(Ae.sizer.clientWidth,Ae.lineSpace.clientWidth);(me=="above"||te.bottom+ie.offsetHeight>vt)&&te.top>ie.offsetHeight?Pe=te.top-ie.offsetHeight:te.bottom+ie.offsetHeight<=vt&&(Pe=te.bottom),at+ie.offsetWidth>Gt&&(at=Gt-ie.offsetWidth)}ie.style.top=Pe+"px",ie.style.left=ie.style.right="",Se=="right"?(at=Ae.sizer.clientWidth-ie.offsetWidth,ie.style.right="0px"):(Se=="left"?at=0:Se=="middle"&&(at=(Ae.sizer.clientWidth-ie.offsetWidth)/2),ie.style.left=at+"px"),se&&cl(this,{left:at,top:Pe,right:at+ie.offsetWidth,bottom:Pe+ie.offsetHeight})},triggerOnKeyDown:Ia(Iu),triggerOnKeyPress:Ia(cf),triggerOnKeyUp:uf,triggerOnMouseDown:Ia(jo),execCommand:function(te){if(au.hasOwnProperty(te))return au[te].call(null,this)},triggerElectric:Ia(function(te){gd(this,te)}),findPosH:function(te,ie,se,me){var Se=1;ie<0&&(Se=-1,ie=-ie);for(var Ae=or(this.doc,te),Pe=0;Pe<ie&&(Ae=Cc(this.doc,Ae,Se,se,me),!Ae.hitSide);++Pe);return Ae},moveH:Ia(function(te,ie){var se=this;this.extendSelectionsBy(function(me){return se.display.shift||se.doc.extend||me.empty()?Cc(se.doc,me.head,te,ie,se.options.rtlMoveVisually):te<0?me.from():me.to()},Ht)}),deleteH:Ia(function(te,ie){var se=this.doc.sel,me=this.doc;se.somethingSelected()?me.replaceSelection("",null,"+delete"):_s(this,function(Se){var Ae=Cc(me,Se.head,te,ie,!1);return te<0?{from:Ae,to:Se.head}:{from:Se.head,to:Ae}})}),findPosV:function(te,ie,se,me){var Se=1,Ae=me;ie<0&&(Se=-1,ie=-ie);for(var Pe=or(this.doc,te),at=0;at<ie;++at){var vt=Yi(this,Pe,"div");if(Ae==null?Ae=vt.left:vt.left=Ae,Pe=vf(this,vt,Se,se),Pe.hitSide)break}return Pe},moveV:Ia(function(te,ie){var se=this,me=this.doc,Se=[],Ae=!this.display.shift&&!me.extend&&me.sel.somethingSelected();if(me.extendSelectionsBy(function(at){if(Ae)return te<0?at.from():at.to();var vt=Yi(se,at.head,"div");at.goalColumn!=null&&(vt.left=at.goalColumn),Se.push(vt.left);var Gt=vf(se,vt,te,ie);return ie=="page"&&at==me.sel.primary()&&ms(se,Va(se,Gt,"div").top-vt.top),Gt},Ht),Se.length)for(var Pe=0;Pe<me.sel.ranges.length;Pe++)me.sel.ranges[Pe].goalColumn=Se[Pe]}),findWordAt:function(te){var ie=this.doc,se=Pt(ie,te.line).text,me=te.ch,Se=te.ch;if(se){var Ae=this.getHelper(te,"wordChars");(te.sticky=="before"||Se==se.length)&&me?--me:++Se;for(var Pe=se.charAt(me),at=pe(Pe,Ae)?function(vt){return pe(vt,Ae)}:/\s/.test(Pe)?function(vt){return/\s/.test(vt)}:function(vt){return!/\s/.test(vt)&&!pe(vt)};me>0&&at(se.charAt(me-1));)--me;for(;Se<se.length&&at(se.charAt(Se));)++Se}return new Ha(an(te.line,me),an(te.line,Se))},toggleOverwrite:function(te){te!=null&&te==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?vn(this.display.cursorDiv,"CodeMirror-overwrite"):Ue(this.display.cursorDiv,"CodeMirror-overwrite"),Gn(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==kt()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ia(function(te,ie){Ts(this,te,ie)}),getScrollInfo:function(){var te=this.display.scroller;return{left:te.scrollLeft,top:te.scrollTop,height:te.scrollHeight-Ar(this)-this.display.barHeight,width:te.scrollWidth-Ar(this)-this.display.barWidth,clientHeight:ri(this),clientWidth:Ur(this)}},scrollIntoView:Ia(function(te,ie){te==null?(te={from:this.doc.sel.primary().head,to:null},ie==null&&(ie=this.options.cursorScrollMargin)):typeof te=="number"?te={from:an(te,0),to:null}:te.from==null&&(te={from:te,to:null}),te.to||(te.to=te.from),te.margin=ie||0,te.from.line!=null?Ds(this,te):ao(this,te.from,te.to,te.margin)}),setSize:Ia(function(te,ie){var se=this,me=function(Ae){return typeof Ae=="number"||/^\d+$/.test(String(Ae))?Ae+"px":Ae};te!=null&&(this.display.wrapper.style.width=me(te)),ie!=null&&(this.display.wrapper.style.height=me(ie)),this.options.lineWrapping&&Ni(this);var Se=this.display.viewFrom;this.doc.iter(Se,this.display.viewTo,function(Ae){if(Ae.widgets){for(var Pe=0;Pe<Ae.widgets.length;Pe++)if(Ae.widgets[Pe].noHScroll){Ca(se,Se,"widget");break}}++Se}),this.curOp.forceUpdate=!0,Gn(this,"refresh",this)}),operation:function(te){return ea(this,te)},startOperation:function(){return Ks(this)},endOperation:function(){return Is(this)},refresh:Ia(function(){var te=this.display.cachedTextHeight;ui(this),this.curOp.forceUpdate=!0,Zr(this),Ts(this,this.doc.scrollLeft,this.doc.scrollTop),Ju(this.display),(te==null||Math.abs(te-Fa(this.display))>.5||this.options.lineWrapping)&&so(this),Gn(this,"refresh",this)}),swapDoc:Ia(function(te){var ie=this.doc;return ie.cm=null,this.state.selectingText&&this.state.selectingText(),wu(this,te),Zr(this),this.display.input.reset(),Ts(this,te.scrollLeft,te.scrollTop),this.curOp.forceScroll=!0,Mn(this,"swapDoc",this,ie),ie}),phrase:function(te){var ie=this.options.phrases;return ie&&Object.prototype.hasOwnProperty.call(ie,te)?ie[te]:te},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Oi(x),x.registerHelper=function(te,ie,se){ne.hasOwnProperty(te)||(ne[te]=x[te]={_global:[]}),ne[te][ie]=se},x.registerGlobalHelper=function(te,ie,se,me){x.registerHelper(te,ie,me),ne[te]._global.push({pred:se,val:me})}}function Cc(x,z,ne,te,ie){var se=z,me=ne,Se=Pt(x,z.line),Ae=ie&&x.direction=="rtl"?-ne:ne;function Pe(){var Or=z.line+Ae;return Or<x.first||Or>=x.first+x.size?!1:(z=new an(Or,z.ch,z.sticky),Se=Pt(x,Or))}function at(Or){var Sr;if(te=="codepoint"){var Rr=Se.text.charCodeAt(z.ch+(te>0?0:-1));isNaN(Rr)?Sr=null:Sr=new an(z.line,Math.max(0,Math.min(Se.text.length,z.ch+ne*(Rr>=55296&&Rr<56320?2:1))),-ne)}else ie?Sr=Vs(x.cm,Se,z,ne):Sr=Ws(Se,z,ne);if(Sr==null)if(!Or&&Pe())z=Kl(ie,x.cm,Se,z.line,Ae);else return!1;else z=Sr;return!0}if(te=="char"||te=="codepoint")at();else if(te=="column")at(!0);else if(te=="word"||te=="group")for(var vt=null,Gt=te=="group",Ft=x.cm&&x.cm.getHelper(z,"wordChars"),Rn=!0;!(ne<0&&!at(!Rn));Rn=!1){var Xn=Se.text.charAt(z.ch)||`
`,hr=pe(Xn,Ft)?"w":Gt&&Xn==`
`?"n":!Gt||/\s/.test(Xn)?null:"p";if(Gt&&!Rn&&!hr&&(hr="s"),vt&&vt!=hr){ne<0&&(ne=1,at(),z.sticky="after");break}if(hr&&(vt=hr),ne>0&&!at(!Rn))break}var _r=hc(x,z,se,me,!0);return ci(se,_r)&&(_r.hitSide=!0),_r}function vf(x,z,ne,te){var ie=x.doc,se=z.left,me;if(te=="page"){var Se=Math.min(x.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Ae=Math.max(Se-.5*Fa(x.display),3);me=(ne>0?z.bottom:z.top)+ne*Ae}else te=="line"&&(me=ne>0?z.bottom+3:z.top-3);for(var Pe;Pe=ja(x,se,me),!!Pe.outside;){if(ne<0?me<=0:me>=ie.height){Pe.hitSide=!0;break}me+=ne*5}return Pe}var Xa=function(x){this.cm=x,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ee,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Xa.prototype.init=function(x){var z=this,ne=this,te=ne.cm,ie=ne.div=x.lineDiv;gf(ie,te.options.spellcheck,te.options.autocorrect,te.options.autocapitalize);function se(Se){for(var Ae=Se.target;Ae;Ae=Ae.parentNode){if(Ae==ie)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Ae.className))break}return!1}Ln(ie,"paste",function(Se){!se(Se)||Fr(te,Se)||md(Se,te)||Ce<=11&&setTimeout(Na(te,function(){return z.updateFromDOM()}),20)}),Ln(ie,"compositionstart",function(Se){z.composing={data:Se.data,done:!1}}),Ln(ie,"compositionupdate",function(Se){z.composing||(z.composing={data:Se.data,done:!1})}),Ln(ie,"compositionend",function(Se){z.composing&&(Se.data!=z.composing.data&&z.readFromDOMSoon(),z.composing.done=!0)}),Ln(ie,"touchstart",function(){return ne.forceCompositionEnd()}),Ln(ie,"input",function(){z.composing||z.readFromDOMSoon()});function me(Se){if(!(!se(Se)||Fr(te,Se))){if(te.somethingSelected())bl({lineWise:!1,text:te.getSelections()}),Se.type=="cut"&&te.replaceSelection("",null,"cut");else if(te.options.lineWiseCopyCut){var Ae=lu(te);bl({lineWise:!0,text:Ae.text}),Se.type=="cut"&&te.operation(function(){te.setSelections(Ae.ranges,0,Je),te.replaceSelection("",null,"cut")})}else return;if(Se.clipboardData){Se.clipboardData.clearData();var Pe=Rs.text.join(`
`);if(Se.clipboardData.setData("Text",Pe),Se.clipboardData.getData("Text")==Pe){Se.preventDefault();return}}var at=vd(),vt=at.firstChild;te.display.lineSpace.insertBefore(at,te.display.lineSpace.firstChild),vt.value=Rs.text.join(`
`);var Gt=document.activeElement;cn(vt),setTimeout(function(){te.display.lineSpace.removeChild(at),Gt.focus(),Gt==ie&&ne.showPrimarySelection()},50)}}Ln(ie,"copy",me),Ln(ie,"cut",me)},Xa.prototype.screenReaderLabelChanged=function(x){x?this.div.setAttribute("aria-label",x):this.div.removeAttribute("aria-label")},Xa.prototype.prepareSelection=function(){var x=ps(this.cm,!1);return x.focus=document.activeElement==this.div,x},Xa.prototype.showSelection=function(x,z){!x||!this.cm.display.view.length||((x.focus||z)&&this.showPrimarySelection(),this.showMultipleSelections(x))},Xa.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Xa.prototype.showPrimarySelection=function(){var x=this.getSelection(),z=this.cm,ne=z.doc.sel.primary(),te=ne.from(),ie=ne.to();if(z.display.viewTo==z.display.viewFrom||te.line>=z.display.viewTo||ie.line<z.display.viewFrom){x.removeAllRanges();return}var se=Mc(z,x.anchorNode,x.anchorOffset),me=Mc(z,x.focusNode,x.focusOffset);if(!(se&&!se.bad&&me&&!me.bad&&Fn(Dr(se,me),te)==0&&Fn(Vr(se,me),ie)==0)){var Se=z.display.view,Ae=te.line>=z.display.viewFrom&&yf(z,te)||{node:Se[0].measure.map[2],offset:0},Pe=ie.line<z.display.viewTo&&yf(z,ie);if(!Pe){var at=Se[Se.length-1].measure,vt=at.maps?at.maps[at.maps.length-1]:at.map;Pe={node:vt[vt.length-1],offset:vt[vt.length-2]-vt[vt.length-3]}}if(!Ae||!Pe){x.removeAllRanges();return}var Gt=x.rangeCount&&x.getRangeAt(0),Ft;try{Ft=Ge(Ae.node,Ae.offset,Pe.offset,Pe.node)}catch(Rn){}Ft&&(!be&&z.state.focused?(x.collapse(Ae.node,Ae.offset),Ft.collapsed||(x.removeAllRanges(),x.addRange(Ft))):(x.removeAllRanges(),x.addRange(Ft)),Gt&&x.anchorNode==null?x.addRange(Gt):be&&this.startGracePeriod()),this.rememberSelection()}},Xa.prototype.startGracePeriod=function(){var x=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){x.gracePeriod=!1,x.selectionChanged()&&x.cm.operation(function(){return x.cm.curOp.selectionChanged=!0})},20)},Xa.prototype.showMultipleSelections=function(x){At(this.cm.display.cursorDiv,x.cursors),At(this.cm.display.selectionDiv,x.selection)},Xa.prototype.rememberSelection=function(){var x=this.getSelection();this.lastAnchorNode=x.anchorNode,this.lastAnchorOffset=x.anchorOffset,this.lastFocusNode=x.focusNode,this.lastFocusOffset=x.focusOffset},Xa.prototype.selectionInEditor=function(){var x=this.getSelection();if(!x.rangeCount)return!1;var z=x.getRangeAt(0).commonAncestorContainer;return Ot(this.div,z)},Xa.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Xa.prototype.blur=function(){this.div.blur()},Xa.prototype.getField=function(){return this.div},Xa.prototype.supportsTouch=function(){return!0},Xa.prototype.receivedFocus=function(){var x=this;this.selectionInEditor()?this.pollSelection():ea(this.cm,function(){return x.cm.curOp.selectionChanged=!0});function z(){x.cm.state.focused&&(x.pollSelection(),x.polling.set(x.cm.options.pollInterval,z))}this.polling.set(this.cm.options.pollInterval,z)},Xa.prototype.selectionChanged=function(){var x=this.getSelection();return x.anchorNode!=this.lastAnchorNode||x.anchorOffset!=this.lastAnchorOffset||x.focusNode!=this.lastFocusNode||x.focusOffset!=this.lastFocusOffset},Xa.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var x=this.getSelection(),z=this.cm;if(Qe&&he&&this.cm.display.gutterSpecs.length&&uh(x.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var ne=Mc(z,x.anchorNode,x.anchorOffset),te=Mc(z,x.focusNode,x.focusOffset);ne&&te&&ea(z,function(){To(z.doc,Ps(ne,te),Je),(ne.bad||te.bad)&&(z.curOp.selectionChanged=!0)})}}},Xa.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var x=this.cm,z=x.display,ne=x.doc.sel.primary(),te=ne.from(),ie=ne.to();if(te.ch==0&&te.line>x.firstLine()&&(te=an(te.line-1,Pt(x.doc,te.line-1).length)),ie.ch==Pt(x.doc,ie.line).text.length&&ie.line<x.lastLine()&&(ie=an(ie.line+1,0)),te.line<z.viewFrom||ie.line>z.viewTo-1)return!1;var se,me,Se;te.line==z.viewFrom||(se=Pi(x,te.line))==0?(me=Un(z.view[0].line),Se=z.view[0].node):(me=Un(z.view[se].line),Se=z.view[se-1].node.nextSibling);var Ae=Pi(x,ie.line),Pe,at;if(Ae==z.view.length-1?(Pe=z.viewTo-1,at=z.lineDiv.lastChild):(Pe=Un(z.view[Ae+1].line)-1,at=z.view[Ae+1].node.previousSibling),!Se)return!1;for(var vt=x.doc.splitLines(ch(x,Se,at,me,Pe)),Gt=Bn(x.doc,an(me,0),an(Pe,Pt(x.doc,Pe).text.length));vt.length>1&&Gt.length>1;)if(Bt(vt)==Bt(Gt))vt.pop(),Gt.pop(),Pe--;else if(vt[0]==Gt[0])vt.shift(),Gt.shift(),me++;else break;for(var Ft=0,Rn=0,Xn=vt[0],hr=Gt[0],_r=Math.min(Xn.length,hr.length);Ft<_r&&Xn.charCodeAt(Ft)==hr.charCodeAt(Ft);)++Ft;for(var Or=Bt(vt),Sr=Bt(Gt),Rr=Math.min(Or.length-(vt.length==1?Ft:0),Sr.length-(Gt.length==1?Ft:0));Rn<Rr&&Or.charCodeAt(Or.length-Rn-1)==Sr.charCodeAt(Sr.length-Rn-1);)++Rn;if(vt.length==1&&Gt.length==1&&me==te.line)for(;Ft&&Ft>te.ch&&Or.charCodeAt(Or.length-Rn-1)==Sr.charCodeAt(Sr.length-Rn-1);)Ft--,Rn++;vt[vt.length-1]=Or.slice(0,Or.length-Rn).replace(/^\u200b+/,""),vt[0]=vt[0].slice(Ft).replace(/\u200b+$/,"");var hi=an(me,Ft),vi=an(Pe,Gt.length?Bt(Gt).length-Rn:0);if(vt.length>1||vt[0]||Fn(hi,vi))return eu(x.doc,vt,hi,vi,"+input"),!0},Xa.prototype.ensurePolled=function(){this.forceCompositionEnd()},Xa.prototype.reset=function(){this.forceCompositionEnd()},Xa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Xa.prototype.readFromDOMSoon=function(){var x=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(x.readDOMTimeout=null,x.composing)if(x.composing.done)x.composing=null;else return;x.updateFromDOM()},80))},Xa.prototype.updateFromDOM=function(){var x=this;(this.cm.isReadOnly()||!this.pollContent())&&ea(this.cm,function(){return ui(x.cm)})},Xa.prototype.setUneditable=function(x){x.contentEditable="false"},Xa.prototype.onKeyPress=function(x){x.charCode==0||this.composing||(x.preventDefault(),this.cm.isReadOnly()||Na(this.cm,pd)(this.cm,String.fromCharCode(x.charCode==null?x.keyCode:x.charCode),0))},Xa.prototype.readOnlyChanged=function(x){this.div.contentEditable=String(x!="nocursor")},Xa.prototype.onContextMenu=function(){},Xa.prototype.resetPosition=function(){},Xa.prototype.needsContentAttribute=!0;function yf(x,z){var ne=Ui(x,z.line);if(!ne||ne.hidden)return null;var te=Pt(x.doc,z.line),ie=Ba(ne,te,z.line),se=Tr(te,x.doc.direction),me="left";if(se){var Se=Jt(se,z.ch);me=Se%2?"right":"left"}var Ae=ei(ie.map,z.ch,me);return Ae.offset=Ae.collapse=="right"?Ae.end:Ae.start,Ae}function uh(x){for(var z=x;z;z=z.parentNode)if(/CodeMirror-gutter-wrapper/.test(z.className))return!0;return!1}function uu(x,z){return z&&(x.bad=!0),x}function ch(x,z,ne,te,ie){var se="",me=!1,Se=x.doc.lineSeparator(),Ae=!1;function Pe(Ft){return function(Rn){return Rn.id==Ft}}function at(){me&&(se+=Se,Ae&&(se+=Se),me=Ae=!1)}function vt(Ft){Ft&&(at(),se+=Ft)}function Gt(Ft){if(Ft.nodeType==1){var Rn=Ft.getAttribute("cm-text");if(Rn){vt(Rn);return}var Xn=Ft.getAttribute("cm-marker"),hr;if(Xn){var _r=x.findMarks(an(te,0),an(ie+1,0),Pe(+Xn));_r.length&&(hr=_r[0].find(0))&&vt(Bn(x.doc,hr.from,hr.to).join(Se));return}if(Ft.getAttribute("contenteditable")=="false")return;var Or=/^(pre|div|p|li|table|br)$/i.test(Ft.nodeName);if(!/^br$/i.test(Ft.nodeName)&&Ft.textContent.length==0)return;Or&&at();for(var Sr=0;Sr<Ft.childNodes.length;Sr++)Gt(Ft.childNodes[Sr]);/^(pre|p)$/i.test(Ft.nodeName)&&(Ae=!0),Or&&(me=!0)}else Ft.nodeType==3&&vt(Ft.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;Gt(z),z!=ne;)z=z.nextSibling,Ae=!1;return se}function Mc(x,z,ne){var te;if(z==x.display.lineDiv){if(te=x.display.lineDiv.childNodes[ne],!te)return uu(x.clipPos(an(x.display.viewTo-1)),!0);z=null,ne=0}else for(te=z;;te=te.parentNode){if(!te||te==x.display.lineDiv)return null;if(te.parentNode&&te.parentNode==x.display.lineDiv)break}for(var ie=0;ie<x.display.view.length;ie++){var se=x.display.view[ie];if(se.node==te)return dh(se,z,ne)}}function dh(x,z,ne){var te=x.text.firstChild,ie=!1;if(!z||!Ot(te,z))return uu(an(Un(x.line),0),!0);if(z==te&&(ie=!0,z=te.childNodes[ne],ne=0,!z)){var se=x.rest?Bt(x.rest):x.line;return uu(an(Un(se),se.text.length),ie)}var me=z.nodeType==3?z:null,Se=z;for(!me&&z.childNodes.length==1&&z.firstChild.nodeType==3&&(me=z.firstChild,ne&&(ne=me.nodeValue.length));Se.parentNode!=te;)Se=Se.parentNode;var Ae=x.measure,Pe=Ae.maps;function at(hr,_r,Or){for(var Sr=-1;Sr<(Pe?Pe.length:0);Sr++)for(var Rr=Sr<0?Ae.map:Pe[Sr],hi=0;hi<Rr.length;hi+=3){var vi=Rr[hi+2];if(vi==hr||vi==_r){var ra=Un(Sr<0?x.line:x.rest[Sr]),eo=Rr[hi]+Or;return(Or<0||vi!=hr)&&(eo=Rr[hi+(Or?1:0)]),an(ra,eo)}}}var vt=at(me,Se,ne);if(vt)return uu(vt,ie);for(var Gt=Se.nextSibling,Ft=me?me.nodeValue.length-ne:0;Gt;Gt=Gt.nextSibling){if(vt=at(Gt,Gt.firstChild,0),vt)return uu(an(vt.line,vt.ch-Ft),ie);Ft+=Gt.textContent.length}for(var Rn=Se.previousSibling,Xn=ne;Rn;Rn=Rn.previousSibling){if(vt=at(Rn,Rn.firstChild,-1),vt)return uu(an(vt.line,vt.ch+Xn),ie);Xn+=Rn.textContent.length}}var Qa=function(x){this.cm=x,this.prevInput="",this.pollingFast=!1,this.polling=new Ee,this.hasSelection=!1,this.composing=null};Qa.prototype.init=function(x){var z=this,ne=this,te=this.cm;this.createField(x);var ie=this.textarea;x.wrapper.insertBefore(this.wrapper,x.wrapper.firstChild),ut&&(ie.style.width="0px"),Ln(ie,"input",function(){ye&&Ce>=9&&z.hasSelection&&(z.hasSelection=null),ne.poll()}),Ln(ie,"paste",function(me){Fr(te,me)||md(me,te)||(te.state.pasteIncoming=+new Date,ne.fastPoll())});function se(me){if(!Fr(te,me)){if(te.somethingSelected())bl({lineWise:!1,text:te.getSelections()});else if(te.options.lineWiseCopyCut){var Se=lu(te);bl({lineWise:!0,text:Se.text}),me.type=="cut"?te.setSelections(Se.ranges,null,Je):(ne.prevInput="",ie.value=Se.text.join(`
`),cn(ie))}else return;me.type=="cut"&&(te.state.cutIncoming=+new Date)}}Ln(ie,"cut",se),Ln(ie,"copy",se),Ln(x.scroller,"paste",function(me){if(!(ki(x,me)||Fr(te,me))){if(!ie.dispatchEvent){te.state.pasteIncoming=+new Date,ne.focus();return}var Se=new Event("paste");Se.clipboardData=me.clipboardData,ie.dispatchEvent(Se)}}),Ln(x.lineSpace,"selectstart",function(me){ki(x,me)||Ei(me)}),Ln(ie,"compositionstart",function(){var me=te.getCursor("from");ne.composing&&ne.composing.range.clear(),ne.composing={start:me,range:te.markText(me,te.getCursor("to"),{className:"CodeMirror-composing"})}}),Ln(ie,"compositionend",function(){ne.composing&&(ne.poll(),ne.composing.range.clear(),ne.composing=null)})},Qa.prototype.createField=function(x){this.wrapper=vd(),this.textarea=this.wrapper.firstChild},Qa.prototype.screenReaderLabelChanged=function(x){x?this.textarea.setAttribute("aria-label",x):this.textarea.removeAttribute("aria-label")},Qa.prototype.prepareSelection=function(){var x=this.cm,z=x.display,ne=x.doc,te=ps(x);if(x.options.moveInputWithCursor){var ie=Yi(x,ne.sel.primary().head,"div"),se=z.wrapper.getBoundingClientRect(),me=z.lineDiv.getBoundingClientRect();te.teTop=Math.max(0,Math.min(z.wrapper.clientHeight-10,ie.top+me.top-se.top)),te.teLeft=Math.max(0,Math.min(z.wrapper.clientWidth-10,ie.left+me.left-se.left))}return te},Qa.prototype.showSelection=function(x){var z=this.cm,ne=z.display;At(ne.cursorDiv,x.cursors),At(ne.selectionDiv,x.selection),x.teTop!=null&&(this.wrapper.style.top=x.teTop+"px",this.wrapper.style.left=x.teLeft+"px")},Qa.prototype.reset=function(x){if(!(this.contextMenuPending||this.composing)){var z=this.cm;if(z.somethingSelected()){this.prevInput="";var ne=z.getSelection();this.textarea.value=ne,z.state.focused&&cn(this.textarea),ye&&Ce>=9&&(this.hasSelection=ne)}else x||(this.prevInput=this.textarea.value="",ye&&Ce>=9&&(this.hasSelection=null))}},Qa.prototype.getField=function(){return this.textarea},Qa.prototype.supportsTouch=function(){return!1},Qa.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!Xe||kt()!=this.textarea))try{this.textarea.focus()}catch(x){}},Qa.prototype.blur=function(){this.textarea.blur()},Qa.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Qa.prototype.receivedFocus=function(){this.slowPoll()},Qa.prototype.slowPoll=function(){var x=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){x.poll(),x.cm.state.focused&&x.slowPoll()})},Qa.prototype.fastPoll=function(){var x=!1,z=this;z.pollingFast=!0;function ne(){var te=z.poll();!te&&!x?(x=!0,z.polling.set(60,ne)):(z.pollingFast=!1,z.slowPoll())}z.polling.set(20,ne)},Qa.prototype.poll=function(){var x=this,z=this.cm,ne=this.textarea,te=this.prevInput;if(this.contextMenuPending||!z.state.focused||_n(ne)&&!te&&!this.composing||z.isReadOnly()||z.options.disableInput||z.state.keySeq)return!1;var ie=ne.value;if(ie==te&&!z.somethingSelected())return!1;if(ye&&Ce>=9&&this.hasSelection===ie||Te&&/[\uf700-\uf7ff]/.test(ie))return z.display.input.reset(),!1;if(z.doc.sel==z.display.selForContextMenu){var se=ie.charCodeAt(0);if(se==8203&&!te&&(te="\u200B"),se==8666)return this.reset(),this.cm.execCommand("undo")}for(var me=0,Se=Math.min(te.length,ie.length);me<Se&&te.charCodeAt(me)==ie.charCodeAt(me);)++me;return ea(z,function(){pd(z,ie.slice(me),te.length-me,null,x.composing?"*compose":null),ie.length>1e3||ie.indexOf(`
`)>-1?ne.value=x.prevInput="":x.prevInput=ie,x.composing&&(x.composing.range.clear(),x.composing.range=z.markText(x.composing.start,z.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Qa.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Qa.prototype.onKeyPress=function(){ye&&Ce>=9&&(this.hasSelection=null),this.fastPoll()},Qa.prototype.onContextMenu=function(x){var z=this,ne=z.cm,te=ne.display,ie=z.textarea;z.contextMenuPending&&z.contextMenuPending();var se=Ao(ne,x),me=te.scroller.scrollTop;if(!se||De)return;var Se=ne.options.resetSelectionOnContextMenu;Se&&ne.doc.sel.contains(se)==-1&&Na(ne,To)(ne.doc,Ps(se),Je);var Ae=ie.style.cssText,Pe=z.wrapper.style.cssText,at=z.wrapper.offsetParent.getBoundingClientRect();z.wrapper.style.cssText="position: static",ie.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(x.clientY-at.top-5)+"px; left: "+(x.clientX-at.left-5)+`px;
z-index: 1000; background: `+(ye?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var vt;Me&&(vt=window.scrollY),te.input.focus(),Me&&window.scrollTo(null,vt),te.input.reset(),ne.somethingSelected()||(ie.value=z.prevInput=" "),z.contextMenuPending=Ft,te.selForContextMenu=ne.doc.sel,clearTimeout(te.detectingSelectAll);function Gt(){if(ie.selectionStart!=null){var Xn=ne.somethingSelected(),hr="\u200B"+(Xn?ie.value:"");ie.value="\u21DA",ie.value=hr,z.prevInput=Xn?"":"\u200B",ie.selectionStart=1,ie.selectionEnd=hr.length,te.selForContextMenu=ne.doc.sel}}function Ft(){if(z.contextMenuPending==Ft&&(z.contextMenuPending=!1,z.wrapper.style.cssText=Pe,ie.style.cssText=Ae,ye&&Ce<9&&te.scrollbars.setScrollTop(te.scroller.scrollTop=me),ie.selectionStart!=null)){(!ye||ye&&Ce<9)&&Gt();var Xn=0,hr=function(){te.selForContextMenu==ne.doc.sel&&ie.selectionStart==0&&ie.selectionEnd>0&&z.prevInput=="\u200B"?Na(ne,td)(ne):Xn++<10?te.detectingSelectAll=setTimeout(hr,500):(te.selForContextMenu=null,te.input.reset())};te.detectingSelectAll=setTimeout(hr,200)}}if(ye&&Ce>=9&&Gt(),Ie){ka(x);var Rn=function(){Qr(window,"mouseup",Rn),setTimeout(Ft,20)};Ln(window,"mouseup",Rn)}else setTimeout(Ft,50)},Qa.prototype.readOnlyChanged=function(x){x||this.reset(),this.textarea.disabled=x=="nocursor",this.textarea.readOnly=!!x},Qa.prototype.setUneditable=function(){},Qa.prototype.needsContentAttribute=!1;function Hl(x,z){if(z=z?Zn(z):{},z.value=x.value,!z.tabindex&&x.tabIndex&&(z.tabindex=x.tabIndex),!z.placeholder&&x.placeholder&&(z.placeholder=x.placeholder),z.autofocus==null){var ne=kt();z.autofocus=ne==x||x.getAttribute("autofocus")!=null&&ne==document.body}function te(){x.value=Se.getValue()}var ie;if(x.form&&(Ln(x.form,"submit",te),!z.leaveSubmitMethodAlone)){var se=x.form;ie=se.submit;try{var me=se.submit=function(){te(),se.submit=ie,se.submit(),se.submit=me}}catch(Ae){}}z.finishInit=function(Ae){Ae.save=te,Ae.getTextArea=function(){return x},Ae.toTextArea=function(){Ae.toTextArea=isNaN,te(),x.parentNode.removeChild(Ae.getWrapperElement()),x.style.display="",x.form&&(Qr(x.form,"submit",te),!z.leaveSubmitMethodAlone&&typeof x.form.submit=="function"&&(x.form.submit=ie))}},x.style.display="none";var Se=Bi(function(Ae){return x.parentNode.insertBefore(Ae,x.nextSibling)},z);return Se}function cu(x){x.off=Qr,x.on=Ln,x.wheelEventPixels=Gc,x.Doc=Eo,x.splitLines=wt,x.countColumn=Ye,x.findColumn=Sn,x.isWordChar=ve,x.Pass=Xt,x.signal=Gn,x.Line=xn,x.changeEnd=Js,x.scrollbarModel=ql,x.Pos=an,x.cmpPos=Fn,x.modes=nr,x.mimeModes=ur,x.resolveMode=it,x.getMode=St,x.modeExtensions=Wt,x.extendMode=He,x.copyState=ht,x.startState=_t,x.innerMode=Dt,x.commands=au,x.keyMap=Ja,x.keyName=zl,x.isModifierKey=Du,x.lookupKey=rl,x.normalizeKeyMap=od,x.StringStream=Nt,x.SharedTextMarker=na,x.TextMarker=hl,x.LineWidget=nu,x.e_preventDefault=Ei,x.e_stopPropagation=ua,x.e_stop=ka,x.addClass=vn,x.contains=Ot,x.rmClass=Ue,x.keyNames=Bs}oh(Bi),yd(Bi);var ol="iter insert remove copy getEditor constructor".split(" ");for(var ks in Eo.prototype)Eo.prototype.hasOwnProperty(ks)&&Tt(ol,ks)<0&&(Bi.prototype[ks]=function(x){return function(){return x.apply(this.doc,arguments)}}(Eo.prototype[ks]));return Oi(Eo),Bi.inputStyles={textarea:Qa,contenteditable:Xa},Bi.defineMode=function(x){!Bi.defaults.mode&&x!="null"&&(Bi.defaults.mode=x),Hn.apply(this,arguments)},Bi.defineMIME=je,Bi.defineMode("null",function(){return{token:function(x){return x.skipToEnd()}}}),Bi.defineMIME("text/plain","null"),Bi.defineExtension=function(x,z){Bi.prototype[x]=z},Bi.defineDocExtension=function(x,z){Eo.prototype[x]=z},Bi.fromTextArea=Hl,cu(Bi),Bi.version="5.58.2",Bi})},49047:function(mn,Ut,ue){(function(be){be(ue(4631),ue(29589),ue(52539))})(function(be){"use strict";be.defineMode("markdown",function(tt,Fe){var qe=be.getMode(tt,"text/html"),ye=qe.name=="null";function Ce(Ye){if(be.findModeByName){var Ee=be.findModeByName(Ye);Ee&&(Ye=Ee.mime||Ee.mimes[0])}var Tt=be.getMode(tt,Ye);return Tt.name=="null"?null:Tt}Fe.highlightFormatting===void 0&&(Fe.highlightFormatting=!1),Fe.maxBlockquoteDepth===void 0&&(Fe.maxBlockquoteDepth=0),Fe.taskLists===void 0&&(Fe.taskLists=!1),Fe.strikethrough===void 0&&(Fe.strikethrough=!1),Fe.emoji===void 0&&(Fe.emoji=!1),Fe.fencedCodeBlockHighlighting===void 0&&(Fe.fencedCodeBlockHighlighting=!0),Fe.fencedCodeBlockDefaultMode===void 0&&(Fe.fencedCodeBlockDefaultMode="text/plain"),Fe.xml===void 0&&(Fe.xml=!0),Fe.tokenTypeOverrides===void 0&&(Fe.tokenTypeOverrides={});var Me={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var we in Me)Me.hasOwnProperty(we)&&Fe.tokenTypeOverrides[we]&&(Me[we]=Fe.tokenTypeOverrides[we]);var he=/^([*\-_])(?:\s*\1){2,}\s*$/,De=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,ct=/^\[(x| )\](?=\s)/i,Ne=Fe.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,Mt=/^ {0,3}(?:\={1,}|-{2,})\s*$/,ut=/^[^#!\[\]*_\\<>` "'(~:]+/,Qe=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,Xe=/^\s*\[[^\]]+?\]:.*$/,Te=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,Et=" ";function Lt(Ye,Ee,Tt){return Ee.f=Ee.inline=Tt,Tt(Ye,Ee)}function et(Ye,Ee,Tt){return Ee.f=Ee.block=Tt,Tt(Ye,Ee)}function lt(Ye){return!Ye||!/\S/.test(Ye.string)}function Ie(Ye){if(Ye.linkTitle=!1,Ye.linkHref=!1,Ye.linkText=!1,Ye.em=!1,Ye.strong=!1,Ye.strikethrough=!1,Ye.quote=0,Ye.indentedCode=!1,Ye.f==Ue){var Ee=ye;if(!Ee){var Tt=be.innerMode(qe,Ye.htmlState);Ee=Tt.mode.name=="xml"&&Tt.state.tagStart===null&&!Tt.state.context&&Tt.state.tokenize.isInText}Ee&&(Ye.f=xt,Ye.block=_e,Ye.htmlState=null)}return Ye.trailingSpace=0,Ye.trailingSpaceNewLine=!1,Ye.prevLine=Ye.thisLine,Ye.thisLine={stream:null},null}function _e(Ye,Ee){var Tt=Ye.column()===Ee.indentation,gn=lt(Ee.prevLine.stream),Xt=Ee.indentedCode,Je=Ee.prevLine.hr,rt=Ee.list!==!1,Ht=(Ee.listStack[Ee.listStack.length-1]||0)+3;Ee.indentedCode=!1;var Sn=Ee.indentation;if(Ee.indentationDiff===null&&(Ee.indentationDiff=Ee.indentation,rt)){for(Ee.list=null;Sn<Ee.listStack[Ee.listStack.length-1];)Ee.listStack.pop(),Ee.listStack.length?Ee.indentation=Ee.listStack[Ee.listStack.length-1]:Ee.list=!1;Ee.list!==!1&&(Ee.indentationDiff=Sn-Ee.listStack[Ee.listStack.length-1])}var sn=!gn&&!Je&&!Ee.prevLine.header&&(!rt||!Xt)&&!Ee.prevLine.fencedCodeEnd,$t=(Ee.list===!1||Je||gn)&&Ee.indentation<=Ht&&Ye.match(he),Bt=null;if(Ee.indentationDiff>=4&&(Xt||Ee.prevLine.fencedCodeEnd||Ee.prevLine.header||gn))return Ye.skipToEnd(),Ee.indentedCode=!0,Me.code;if(Ye.eatSpace())return null;if(Tt&&Ee.indentation<=Ht&&(Bt=Ye.match(Ne))&&Bt[1].length<=6)return Ee.quote=0,Ee.header=Bt[1].length,Ee.thisLine.header=!0,Fe.highlightFormatting&&(Ee.formatting="header"),Ee.f=Ee.inline,At(Ee);if(Ee.indentation<=Ht&&Ye.eat(">"))return Ee.quote=Tt?1:Ee.quote+1,Fe.highlightFormatting&&(Ee.formatting="quote"),Ye.eatSpace(),At(Ee);if(!$t&&!Ee.setext&&Tt&&Ee.indentation<=Ht&&(Bt=Ye.match(De))){var bn=Bt[1]?"ol":"ul";return Ee.indentation=Sn+Ye.current().length,Ee.list=!0,Ee.quote=0,Ee.listStack.push(Ee.indentation),Ee.em=!1,Ee.strong=!1,Ee.code=!1,Ee.strikethrough=!1,Fe.taskLists&&Ye.match(ct,!1)&&(Ee.taskList=!0),Ee.f=Ee.inline,Fe.highlightFormatting&&(Ee.formatting=["list","list-"+bn]),At(Ee)}else{if(Tt&&Ee.indentation<=Ht&&(Bt=Ye.match(Qe,!0)))return Ee.quote=0,Ee.fencedEndRE=new RegExp(Bt[1]+"+ *$"),Ee.localMode=Fe.fencedCodeBlockHighlighting&&Ce(Bt[2]||Fe.fencedCodeBlockDefaultMode),Ee.localMode&&(Ee.localState=be.startState(Ee.localMode)),Ee.f=Ee.block=Ze,Fe.highlightFormatting&&(Ee.formatting="code-block"),Ee.code=-1,At(Ee);if(Ee.setext||(!sn||!rt)&&!Ee.quote&&Ee.list===!1&&!Ee.code&&!$t&&!Xe.test(Ye.string)&&(Bt=Ye.lookAhead(1))&&(Bt=Bt.match(Mt)))return Ee.setext?(Ee.header=Ee.setext,Ee.setext=0,Ye.skipToEnd(),Fe.highlightFormatting&&(Ee.formatting="header")):(Ee.header=Bt[0].charAt(0)=="="?1:2,Ee.setext=Ee.header),Ee.thisLine.header=!0,Ee.f=Ee.inline,At(Ee);if($t)return Ye.skipToEnd(),Ee.hr=!0,Ee.thisLine.hr=!0,Me.hr;if(Ye.peek()==="[")return Lt(Ye,Ee,qt)}return Lt(Ye,Ee,Ee.inline)}function Ue(Ye,Ee){var Tt=qe.token(Ye,Ee.htmlState);if(!ye){var gn=be.innerMode(qe,Ee.htmlState);(gn.mode.name=="xml"&&gn.state.tagStart===null&&!gn.state.context&&gn.state.tokenize.isInText||Ee.md_inside&&Ye.current().indexOf(">")>-1)&&(Ee.f=xt,Ee.block=_e,Ee.htmlState=null)}return Tt}function Ze(Ye,Ee){var Tt=Ee.listStack[Ee.listStack.length-1]||0,gn=Ee.indentation<Tt,Xt=Tt+3;if(Ee.fencedEndRE&&Ee.indentation<=Xt&&(gn||Ye.match(Ee.fencedEndRE))){Fe.highlightFormatting&&(Ee.formatting="code-block");var Je;return gn||(Je=At(Ee)),Ee.localMode=Ee.localState=null,Ee.block=_e,Ee.f=xt,Ee.fencedEndRE=null,Ee.code=0,Ee.thisLine.fencedCodeEnd=!0,gn?et(Ye,Ee,Ee.block):Je}else return Ee.localMode?Ee.localMode.token(Ye,Ee.localState):(Ye.skipToEnd(),Me.code)}function At(Ye){var Ee=[];if(Ye.formatting){Ee.push(Me.formatting),typeof Ye.formatting=="string"&&(Ye.formatting=[Ye.formatting]);for(var Tt=0;Tt<Ye.formatting.length;Tt++)Ee.push(Me.formatting+"-"+Ye.formatting[Tt]),Ye.formatting[Tt]==="header"&&Ee.push(Me.formatting+"-"+Ye.formatting[Tt]+"-"+Ye.header),Ye.formatting[Tt]==="quote"&&(!Fe.maxBlockquoteDepth||Fe.maxBlockquoteDepth>=Ye.quote?Ee.push(Me.formatting+"-"+Ye.formatting[Tt]+"-"+Ye.quote):Ee.push("error"))}if(Ye.taskOpen)return Ee.push("meta"),Ee.length?Ee.join(" "):null;if(Ye.taskClosed)return Ee.push("property"),Ee.length?Ee.join(" "):null;if(Ye.linkHref?Ee.push(Me.linkHref,"url"):(Ye.strong&&Ee.push(Me.strong),Ye.em&&Ee.push(Me.em),Ye.strikethrough&&Ee.push(Me.strikethrough),Ye.emoji&&Ee.push(Me.emoji),Ye.linkText&&Ee.push(Me.linkText),Ye.code&&Ee.push(Me.code),Ye.image&&Ee.push(Me.image),Ye.imageAltText&&Ee.push(Me.imageAltText,"link"),Ye.imageMarker&&Ee.push(Me.imageMarker)),Ye.header&&Ee.push(Me.header,Me.header+"-"+Ye.header),Ye.quote&&(Ee.push(Me.quote),!Fe.maxBlockquoteDepth||Fe.maxBlockquoteDepth>=Ye.quote?Ee.push(Me.quote+"-"+Ye.quote):Ee.push(Me.quote+"-"+Fe.maxBlockquoteDepth)),Ye.list!==!1){var gn=(Ye.listStack.length-1)%3;gn?gn===1?Ee.push(Me.list2):Ee.push(Me.list3):Ee.push(Me.list1)}return Ye.trailingSpaceNewLine?Ee.push("trailing-space-new-line"):Ye.trailingSpace&&Ee.push("trailing-space-"+(Ye.trailingSpace%2?"a":"b")),Ee.length?Ee.join(" "):null}function bt(Ye,Ee){if(Ye.match(ut,!0))return At(Ee)}function xt(Ye,Ee){var Tt=Ee.text(Ye,Ee);if(typeof Tt!="undefined")return Tt;if(Ee.list)return Ee.list=null,At(Ee);if(Ee.taskList){var gn=Ye.match(ct,!0)[1]===" ";return gn?Ee.taskOpen=!0:Ee.taskClosed=!0,Fe.highlightFormatting&&(Ee.formatting="task"),Ee.taskList=!1,At(Ee)}if(Ee.taskOpen=!1,Ee.taskClosed=!1,Ee.header&&Ye.match(/^#+$/,!0))return Fe.highlightFormatting&&(Ee.formatting="header"),At(Ee);var Xt=Ye.next();if(Ee.linkTitle){Ee.linkTitle=!1;var Je=Xt;Xt==="("&&(Je=")"),Je=(Je+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var rt="^\\s*(?:[^"+Je+"\\\\]+|\\\\\\\\|\\\\.)"+Je;if(Ye.match(new RegExp(rt),!0))return Me.linkHref}if(Xt==="`"){var Ht=Ee.formatting;Fe.highlightFormatting&&(Ee.formatting="code"),Ye.eatWhile("`");var Sn=Ye.current().length;if(Ee.code==0&&(!Ee.quote||Sn==1))return Ee.code=Sn,At(Ee);if(Sn==Ee.code){var sn=At(Ee);return Ee.code=0,sn}else return Ee.formatting=Ht,At(Ee)}else if(Ee.code)return At(Ee);if(Xt==="\\"&&(Ye.next(),Fe.highlightFormatting)){var $t=At(Ee),Bt=Me.formatting+"-escape";return $t?$t+" "+Bt:Bt}if(Xt==="!"&&Ye.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return Ee.imageMarker=!0,Ee.image=!0,Fe.highlightFormatting&&(Ee.formatting="image"),At(Ee);if(Xt==="["&&Ee.imageMarker&&Ye.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return Ee.imageMarker=!1,Ee.imageAltText=!0,Fe.highlightFormatting&&(Ee.formatting="image"),At(Ee);if(Xt==="]"&&Ee.imageAltText){Fe.highlightFormatting&&(Ee.formatting="image");var $t=At(Ee);return Ee.imageAltText=!1,Ee.image=!1,Ee.inline=Ee.f=Ot,$t}if(Xt==="["&&!Ee.image)return Ee.linkText&&Ye.match(/^.*?\]/)||(Ee.linkText=!0,Fe.highlightFormatting&&(Ee.formatting="link")),At(Ee);if(Xt==="]"&&Ee.linkText){Fe.highlightFormatting&&(Ee.formatting="link");var $t=At(Ee);return Ee.linkText=!1,Ee.inline=Ee.f=Ye.match(/\(.*?\)| ?\[.*?\]/,!1)?Ot:xt,$t}if(Xt==="<"&&Ye.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){Ee.f=Ee.inline=Ge,Fe.highlightFormatting&&(Ee.formatting="link");var $t=At(Ee);return $t?$t+=" ":$t="",$t+Me.linkInline}if(Xt==="<"&&Ye.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){Ee.f=Ee.inline=Ge,Fe.highlightFormatting&&(Ee.formatting="link");var $t=At(Ee);return $t?$t+=" ":$t="",$t+Me.linkEmail}if(Fe.xml&&Xt==="<"&&Ye.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var bn=Ye.string.indexOf(">",Ye.pos);if(bn!=-1){var dn=Ye.string.substring(Ye.start,bn);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(dn)&&(Ee.md_inside=!0)}return Ye.backUp(1),Ee.htmlState=be.startState(qe),et(Ye,Ee,Ue)}if(Fe.xml&&Xt==="<"&&Ye.match(/^\/\w*?>/))return Ee.md_inside=!1,"tag";if(Xt==="*"||Xt==="_"){for(var ke=1,ce=Ye.pos==1?" ":Ye.string.charAt(Ye.pos-2);ke<3&&Ye.eat(Xt);)ke++;var le=Ye.peek()||" ",ve=!/\s/.test(le)&&(!Te.test(le)||/\s/.test(ce)||Te.test(ce)),pe=!/\s/.test(ce)&&(!Te.test(ce)||/\s/.test(le)||Te.test(le)),oe=null,ze=null;if(ke%2&&(!Ee.em&&ve&&(Xt==="*"||!pe||Te.test(ce))?oe=!0:Ee.em==Xt&&pe&&(Xt==="*"||!ve||Te.test(le))&&(oe=!1)),ke>1&&(!Ee.strong&&ve&&(Xt==="*"||!pe||Te.test(ce))?ze=!0:Ee.strong==Xt&&pe&&(Xt==="*"||!ve||Te.test(le))&&(ze=!1)),ze!=null||oe!=null){Fe.highlightFormatting&&(Ee.formatting=oe==null?"strong":ze==null?"em":"strong em"),oe===!0&&(Ee.em=Xt),ze===!0&&(Ee.strong=Xt);var sn=At(Ee);return oe===!1&&(Ee.em=!1),ze===!1&&(Ee.strong=!1),sn}}else if(Xt===" "&&(Ye.eat("*")||Ye.eat("_"))){if(Ye.peek()===" ")return At(Ee);Ye.backUp(1)}if(Fe.strikethrough){if(Xt==="~"&&Ye.eatWhile(Xt)){if(Ee.strikethrough){Fe.highlightFormatting&&(Ee.formatting="strikethrough");var sn=At(Ee);return Ee.strikethrough=!1,sn}else if(Ye.match(/^[^\s]/,!1))return Ee.strikethrough=!0,Fe.highlightFormatting&&(Ee.formatting="strikethrough"),At(Ee)}else if(Xt===" "&&Ye.match(/^~~/,!0)){if(Ye.peek()===" ")return At(Ee);Ye.backUp(2)}}if(Fe.emoji&&Xt===":"&&Ye.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){Ee.emoji=!0,Fe.highlightFormatting&&(Ee.formatting="emoji");var yt=At(Ee);return Ee.emoji=!1,yt}return Xt===" "&&(Ye.match(/^ +$/,!1)?Ee.trailingSpace++:Ee.trailingSpace&&(Ee.trailingSpaceNewLine=!0)),At(Ee)}function Ge(Ye,Ee){var Tt=Ye.next();if(Tt===">"){Ee.f=Ee.inline=xt,Fe.highlightFormatting&&(Ee.formatting="link");var gn=At(Ee);return gn?gn+=" ":gn="",gn+Me.linkInline}return Ye.match(/^[^>]+/,!0),Me.linkInline}function Ot(Ye,Ee){if(Ye.eatSpace())return null;var Tt=Ye.next();return Tt==="("||Tt==="["?(Ee.f=Ee.inline=vn(Tt==="("?")":"]"),Fe.highlightFormatting&&(Ee.formatting="link-string"),Ee.linkHref=!0,At(Ee)):"error"}var kt={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function vn(Ye){return function(Ee,Tt){var gn=Ee.next();if(gn===Ye){Tt.f=Tt.inline=xt,Fe.highlightFormatting&&(Tt.formatting="link-string");var Xt=At(Tt);return Tt.linkHref=!1,Xt}return Ee.match(kt[Ye]),Tt.linkHref=!0,At(Tt)}}function qt(Ye,Ee){return Ye.match(/^([^\]\\]|\\.)*\]:/,!1)?(Ee.f=cn,Ye.next(),Fe.highlightFormatting&&(Ee.formatting="link"),Ee.linkText=!0,At(Ee)):Lt(Ye,Ee,xt)}function cn(Ye,Ee){if(Ye.match(/^\]:/,!0)){Ee.f=Ee.inline=An,Fe.highlightFormatting&&(Ee.formatting="link");var Tt=At(Ee);return Ee.linkText=!1,Tt}return Ye.match(/^([^\]\\]|\\.)+/,!0),Me.linkText}function An(Ye,Ee){return Ye.eatSpace()?null:(Ye.match(/^[^\s]+/,!0),Ye.peek()===void 0?Ee.linkTitle=!0:Ye.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),Ee.f=Ee.inline=xt,Me.linkHref+" url")}var Zn={startState:function(){return{f:_e,prevLine:{stream:null},thisLine:{stream:null},block:_e,htmlState:null,indentation:0,inline:xt,text:bt,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(Ye){return{f:Ye.f,prevLine:Ye.prevLine,thisLine:Ye.thisLine,block:Ye.block,htmlState:Ye.htmlState&&be.copyState(qe,Ye.htmlState),indentation:Ye.indentation,localMode:Ye.localMode,localState:Ye.localMode?be.copyState(Ye.localMode,Ye.localState):null,inline:Ye.inline,text:Ye.text,formatting:!1,linkText:Ye.linkText,linkTitle:Ye.linkTitle,linkHref:Ye.linkHref,code:Ye.code,em:Ye.em,strong:Ye.strong,strikethrough:Ye.strikethrough,emoji:Ye.emoji,header:Ye.header,setext:Ye.setext,hr:Ye.hr,taskList:Ye.taskList,list:Ye.list,listStack:Ye.listStack.slice(0),quote:Ye.quote,indentedCode:Ye.indentedCode,trailingSpace:Ye.trailingSpace,trailingSpaceNewLine:Ye.trailingSpaceNewLine,md_inside:Ye.md_inside,fencedEndRE:Ye.fencedEndRE}},token:function(Ye,Ee){if(Ee.formatting=!1,Ye!=Ee.thisLine.stream){if(Ee.header=0,Ee.hr=!1,Ye.match(/^\s*$/,!0))return Ie(Ee),null;if(Ee.prevLine=Ee.thisLine,Ee.thisLine={stream:Ye},Ee.taskList=!1,Ee.trailingSpace=0,Ee.trailingSpaceNewLine=!1,!Ee.localState&&(Ee.f=Ee.block,Ee.f!=Ue)){var Tt=Ye.match(/^\s*/,!0)[0].replace(/\t/g,Et).length;if(Ee.indentation=Tt,Ee.indentationDiff=null,Tt>0)return null}}return Ee.f(Ye,Ee)},innerMode:function(Ye){return Ye.block==Ue?{state:Ye.htmlState,mode:qe}:Ye.localState?{state:Ye.localState,mode:Ye.localMode}:{state:Ye,mode:Zn}},indent:function(Ye,Ee,Tt){return Ye.block==Ue&&qe.indent?qe.indent(Ye.htmlState,Ee,Tt):Ye.localState&&Ye.localMode.indent?Ye.localMode.indent(Ye.localState,Ee,Tt):be.Pass},blankLine:Ie,getType:At,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Zn},"xml"),be.defineMIME("text/markdown","markdown"),be.defineMIME("text/x-markdown","markdown")})},52539:function(mn,Ut,ue){(function(be){be(ue(4631))})(function(be){"use strict";be.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var tt=0;tt<be.modeInfo.length;tt++){var Fe=be.modeInfo[tt];Fe.mimes&&(Fe.mime=Fe.mimes[0])}be.findModeByMIME=function(qe){qe=qe.toLowerCase();for(var ye=0;ye<be.modeInfo.length;ye++){var Ce=be.modeInfo[ye];if(Ce.mime==qe)return Ce;if(Ce.mimes){for(var Me=0;Me<Ce.mimes.length;Me++)if(Ce.mimes[Me]==qe)return Ce}}if(/\+xml$/.test(qe))return be.findModeByMIME("application/xml");if(/\+json$/.test(qe))return be.findModeByMIME("application/json")},be.findModeByExtension=function(qe){qe=qe.toLowerCase();for(var ye=0;ye<be.modeInfo.length;ye++){var Ce=be.modeInfo[ye];if(Ce.ext){for(var Me=0;Me<Ce.ext.length;Me++)if(Ce.ext[Me]==qe)return Ce}}},be.findModeByFileName=function(qe){for(var ye=0;ye<be.modeInfo.length;ye++){var Ce=be.modeInfo[ye];if(Ce.file&&Ce.file.test(qe))return Ce}var Me=qe.lastIndexOf("."),we=Me>-1&&qe.substring(Me+1,qe.length);if(we)return be.findModeByExtension(we)},be.findModeByName=function(qe){qe=qe.toLowerCase();for(var ye=0;ye<be.modeInfo.length;ye++){var Ce=be.modeInfo[ye];if(Ce.name.toLowerCase()==qe)return Ce;if(Ce.alias){for(var Me=0;Me<Ce.alias.length;Me++)if(Ce.alias[Me].toLowerCase()==qe)return Ce}}}})},80785:function(mn,Ut,ue){(function(be){be(ue(4631))})(function(be){"use strict";be.defineMode("stex",function(tt,Fe){"use strict";function qe(ut,Qe){ut.cmdState.push(Qe)}function ye(ut){return ut.cmdState.length>0?ut.cmdState[ut.cmdState.length-1]:null}function Ce(ut){var Qe=ut.cmdState.pop();Qe&&Qe.closeBracket()}function Me(ut){for(var Qe=ut.cmdState,Xe=Qe.length-1;Xe>=0;Xe--){var Te=Qe[Xe];if(Te.name!="DEFAULT")return Te}return{styleIdentifier:function(){return null}}}function we(ut,Qe,Xe){return function(){this.name=ut,this.bracketNo=0,this.style=Qe,this.styles=Xe,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var he={};he.importmodule=we("importmodule","tag",["string","builtin"]),he.documentclass=we("documentclass","tag",["","atom"]),he.usepackage=we("usepackage","tag",["atom"]),he.begin=we("begin","tag",["atom"]),he.end=we("end","tag",["atom"]),he.label=we("label","tag",["atom"]),he.ref=we("ref","tag",["atom"]),he.eqref=we("eqref","tag",["atom"]),he.cite=we("cite","tag",["atom"]),he.bibitem=we("bibitem","tag",["atom"]),he.Bibitem=we("Bibitem","tag",["atom"]),he.RBibitem=we("RBibitem","tag",["atom"]),he.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function De(ut,Qe){ut.f=Qe}function ct(ut,Qe){var Xe;if(ut.match(/^\\[a-zA-Z@]+/)){var Te=ut.current().slice(1);return Xe=he.hasOwnProperty(Te)?he[Te]:he.DEFAULT,Xe=new Xe,qe(Qe,Xe),De(Qe,Mt),Xe.style}if(ut.match(/^\\[$&%#{}_]/)||ut.match(/^\\[,;!\/\\]/))return"tag";if(ut.match("\\["))return De(Qe,function(Lt,et){return Ne(Lt,et,"\\]")}),"keyword";if(ut.match("\\("))return De(Qe,function(Lt,et){return Ne(Lt,et,"\\)")}),"keyword";if(ut.match("$$"))return De(Qe,function(Lt,et){return Ne(Lt,et,"$$")}),"keyword";if(ut.match("$"))return De(Qe,function(Lt,et){return Ne(Lt,et,"$")}),"keyword";var Et=ut.next();if(Et=="%")return ut.skipToEnd(),"comment";if(Et=="}"||Et=="]"){if(Xe=ye(Qe),Xe)Xe.closeBracket(Et),De(Qe,Mt);else return"error";return"bracket"}else return Et=="{"||Et=="["?(Xe=he.DEFAULT,Xe=new Xe,qe(Qe,Xe),"bracket"):/\d/.test(Et)?(ut.eatWhile(/[\w.%]/),"atom"):(ut.eatWhile(/[\w\-_]/),Xe=Me(Qe),Xe.name=="begin"&&(Xe.argument=ut.current()),Xe.styleIdentifier())}function Ne(ut,Qe,Xe){if(ut.eatSpace())return null;if(Xe&&ut.match(Xe))return De(Qe,ct),"keyword";if(ut.match(/^\\[a-zA-Z@]+/))return"tag";if(ut.match(/^[a-zA-Z]+/))return"variable-2";if(ut.match(/^\\[$&%#{}_]/)||ut.match(/^\\[,;!\/]/)||ut.match(/^[\^_&]/))return"tag";if(ut.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(ut.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var Te=ut.next();return Te=="{"||Te=="}"||Te=="["||Te=="]"||Te=="("||Te==")"?"bracket":Te=="%"?(ut.skipToEnd(),"comment"):"error"}function Mt(ut,Qe){var Xe=ut.peek(),Te;return Xe=="{"||Xe=="["?(Te=ye(Qe),Te.openBracket(Xe),ut.eat(Xe),De(Qe,ct),"bracket"):/[ \t\r]/.test(Xe)?(ut.eat(Xe),null):(De(Qe,ct),Ce(Qe),ct(ut,Qe))}return{startState:function(){var ut=Fe.inMathMode?function(Qe,Xe){return Ne(Qe,Xe)}:ct;return{cmdState:[],f:ut}},copyState:function(ut){return{cmdState:ut.cmdState.slice(),f:ut.f}},token:function(ut,Qe){return Qe.f(ut,Qe)},blankLine:function(ut){ut.f=ct,ut.cmdState.length=0},lineComment:"%"}}),be.defineMIME("text/x-stex","stex"),be.defineMIME("text/x-latex","stex")})},29589:function(mn,Ut,ue){(function(be){be(ue(4631))})(function(be){"use strict";var tt={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},Fe={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};be.defineMode("xml",function(qe,ye){var Ce=qe.indentUnit,Me={},we=ye.htmlMode?tt:Fe;for(var he in we)Me[he]=we[he];for(var he in ye)Me[he]=ye[he];var De,ct;function Ne(Ge,Ot){function kt(cn){return Ot.tokenize=cn,cn(Ge,Ot)}var vn=Ge.next();if(vn=="<")return Ge.eat("!")?Ge.eat("[")?Ge.match("CDATA[")?kt(Qe("atom","]]>")):null:Ge.match("--")?kt(Qe("comment","-->")):Ge.match("DOCTYPE",!0,!0)?(Ge.eatWhile(/[\w\._\-]/),kt(Xe(1))):null:Ge.eat("?")?(Ge.eatWhile(/[\w\._\-]/),Ot.tokenize=Qe("meta","?>"),"meta"):(De=Ge.eat("/")?"closeTag":"openTag",Ot.tokenize=Mt,"tag bracket");if(vn=="&"){var qt;return Ge.eat("#")?Ge.eat("x")?qt=Ge.eatWhile(/[a-fA-F\d]/)&&Ge.eat(";"):qt=Ge.eatWhile(/[\d]/)&&Ge.eat(";"):qt=Ge.eatWhile(/[\w\.\-:]/)&&Ge.eat(";"),qt?"atom":"error"}else return Ge.eatWhile(/[^&<]/),null}Ne.isInText=!0;function Mt(Ge,Ot){var kt=Ge.next();if(kt==">"||kt=="/"&&Ge.eat(">"))return Ot.tokenize=Ne,De=kt==">"?"endTag":"selfcloseTag","tag bracket";if(kt=="=")return De="equals",null;if(kt=="<"){Ot.tokenize=Ne,Ot.state=et,Ot.tagName=Ot.tagStart=null;var vn=Ot.tokenize(Ge,Ot);return vn?vn+" tag error":"tag error"}else return/[\'\"]/.test(kt)?(Ot.tokenize=ut(kt),Ot.stringStartCol=Ge.column(),Ot.tokenize(Ge,Ot)):(Ge.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function ut(Ge){var Ot=function(kt,vn){for(;!kt.eol();)if(kt.next()==Ge){vn.tokenize=Mt;break}return"string"};return Ot.isInAttribute=!0,Ot}function Qe(Ge,Ot){return function(kt,vn){for(;!kt.eol();){if(kt.match(Ot)){vn.tokenize=Ne;break}kt.next()}return Ge}}function Xe(Ge){return function(Ot,kt){for(var vn;(vn=Ot.next())!=null;){if(vn=="<")return kt.tokenize=Xe(Ge+1),kt.tokenize(Ot,kt);if(vn==">")if(Ge==1){kt.tokenize=Ne;break}else return kt.tokenize=Xe(Ge-1),kt.tokenize(Ot,kt)}return"meta"}}function Te(Ge,Ot,kt){this.prev=Ge.context,this.tagName=Ot,this.indent=Ge.indented,this.startOfLine=kt,(Me.doNotIndent.hasOwnProperty(Ot)||Ge.context&&Ge.context.noIndent)&&(this.noIndent=!0)}function Et(Ge){Ge.context&&(Ge.context=Ge.context.prev)}function Lt(Ge,Ot){for(var kt;;){if(!Ge.context||(kt=Ge.context.tagName,!Me.contextGrabbers.hasOwnProperty(kt)||!Me.contextGrabbers[kt].hasOwnProperty(Ot)))return;Et(Ge)}}function et(Ge,Ot,kt){return Ge=="openTag"?(kt.tagStart=Ot.column(),lt):Ge=="closeTag"?Ie:et}function lt(Ge,Ot,kt){return Ge=="word"?(kt.tagName=Ot.current(),ct="tag",Ze):Me.allowMissingTagName&&Ge=="endTag"?(ct="tag bracket",Ze(Ge,Ot,kt)):(ct="error",lt)}function Ie(Ge,Ot,kt){if(Ge=="word"){var vn=Ot.current();return kt.context&&kt.context.tagName!=vn&&Me.implicitlyClosed.hasOwnProperty(kt.context.tagName)&&Et(kt),kt.context&&kt.context.tagName==vn||Me.matchClosing===!1?(ct="tag",_e):(ct="tag error",Ue)}else return Me.allowMissingTagName&&Ge=="endTag"?(ct="tag bracket",_e(Ge,Ot,kt)):(ct="error",Ue)}function _e(Ge,Ot,kt){return Ge!="endTag"?(ct="error",_e):(Et(kt),et)}function Ue(Ge,Ot,kt){return ct="error",_e(Ge,Ot,kt)}function Ze(Ge,Ot,kt){if(Ge=="word")return ct="attribute",At;if(Ge=="endTag"||Ge=="selfcloseTag"){var vn=kt.tagName,qt=kt.tagStart;return kt.tagName=kt.tagStart=null,Ge=="selfcloseTag"||Me.autoSelfClosers.hasOwnProperty(vn)?Lt(kt,vn):(Lt(kt,vn),kt.context=new Te(kt,vn,qt==kt.indented)),et}return ct="error",Ze}function At(Ge,Ot,kt){return Ge=="equals"?bt:(Me.allowMissing||(ct="error"),Ze(Ge,Ot,kt))}function bt(Ge,Ot,kt){return Ge=="string"?xt:Ge=="word"&&Me.allowUnquoted?(ct="string",Ze):(ct="error",Ze(Ge,Ot,kt))}function xt(Ge,Ot,kt){return Ge=="string"?xt:Ze(Ge,Ot,kt)}return{startState:function(Ge){var Ot={tokenize:Ne,state:et,indented:Ge||0,tagName:null,tagStart:null,context:null};return Ge!=null&&(Ot.baseIndent=Ge),Ot},token:function(Ge,Ot){if(!Ot.tagName&&Ge.sol()&&(Ot.indented=Ge.indentation()),Ge.eatSpace())return null;De=null;var kt=Ot.tokenize(Ge,Ot);return(kt||De)&&kt!="comment"&&(ct=null,Ot.state=Ot.state(De||kt,Ge,Ot),ct&&(kt=ct=="error"?kt+" error":ct)),kt},indent:function(Ge,Ot,kt){var vn=Ge.context;if(Ge.tokenize.isInAttribute)return Ge.tagStart==Ge.indented?Ge.stringStartCol+1:Ge.indented+Ce;if(vn&&vn.noIndent)return be.Pass;if(Ge.tokenize!=Mt&&Ge.tokenize!=Ne)return kt?kt.match(/^(\s*)/)[0].length:0;if(Ge.tagName)return Me.multilineTagIndentPastTag!==!1?Ge.tagStart+Ge.tagName.length+2:Ge.tagStart+Ce*(Me.multilineTagIndentFactor||1);if(Me.alignCDATA&&/<!\[CDATA\[/.test(Ot))return 0;var qt=Ot&&/^<(\/)?([\w_:\.-]*)/.exec(Ot);if(qt&&qt[1])for(;vn;)if(vn.tagName==qt[2]){vn=vn.prev;break}else if(Me.implicitlyClosed.hasOwnProperty(vn.tagName))vn=vn.prev;else break;else if(qt)for(;vn;){var cn=Me.contextGrabbers[vn.tagName];if(cn&&cn.hasOwnProperty(qt[2]))vn=vn.prev;else break}for(;vn&&vn.prev&&!vn.startOfLine;)vn=vn.prev;return vn?vn.indent+Ce:Ge.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:Me.htmlMode?"html":"xml",helperType:Me.htmlMode?"html":"xml",skipAttribute:function(Ge){Ge.state==bt&&(Ge.state=Ze)},xmlCurrentTag:function(Ge){return Ge.tagName?{name:Ge.tagName,close:Ge.type=="closeTag"}:null},xmlCurrentContext:function(Ge){for(var Ot=[],kt=Ge.context;kt;kt=kt.prev)kt.tagName&&Ot.push(kt.tagName);return Ot.reverse()}}}),be.defineMIME("text/xml","xml"),be.defineMIME("application/xml","xml"),be.mimeModes.hasOwnProperty("text/html")||be.defineMIME("text/html",{name:"xml",htmlMode:!0})})},15979:function(mn,Ut,ue){"use strict";ue.d(Ut,{hP:function(){return dn}});var be=function(ke,ce){return(be=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(le,ve){le.__proto__=ve}||function(le,ve){for(var pe in ve)Object.prototype.hasOwnProperty.call(ve,pe)&&(le[pe]=ve[pe])})(ke,ce)};function tt(ke,ce){function le(){this.constructor=ke}be(ke,ce),ke.prototype=ce===null?Object.create(ce):(le.prototype=ce.prototype,new le)}function Fe(ke,ce,le,ve){return new(le||(le=Promise))(function(pe,oe){function ze(en){try{Vt(ve.next(en))}catch(un){oe(un)}}function yt(en){try{Vt(ve.throw(en))}catch(un){oe(un)}}function Vt(en){var un;en.done?pe(en.value):(un=en.value,un instanceof le?un:new le(function(yn){yn(un)})).then(ze,yt)}Vt((ve=ve.apply(ke,ce||[])).next())})}function qe(ke,ce){var le,ve,pe,oe,ze={label:0,sent:function(){if(1&pe[0])throw pe[1];return pe[1]},trys:[],ops:[]};return oe={next:yt(0),throw:yt(1),return:yt(2)},typeof Symbol=="function"&&(oe[Symbol.iterator]=function(){return this}),oe;function yt(Vt){return function(en){return function(un){if(le)throw new TypeError("Generator is already executing.");for(;ze;)try{if(le=1,ve&&(pe=2&un[0]?ve.return:un[0]?ve.throw||((pe=ve.return)&&pe.call(ve),0):ve.next)&&!(pe=pe.call(ve,un[1])).done)return pe;switch(ve=0,pe&&(un=[2&un[0],pe.value]),un[0]){case 0:case 1:pe=un;break;case 4:return ze.label++,{value:un[1],done:!1};case 5:ze.label++,ve=un[1],un=[0];continue;case 7:un=ze.ops.pop(),ze.trys.pop();continue;default:if(pe=ze.trys,!((pe=pe.length>0&&pe[pe.length-1])||un[0]!==6&&un[0]!==2)){ze=0;continue}if(un[0]===3&&(!pe||un[1]>pe[0]&&un[1]<pe[3])){ze.label=un[1];break}if(un[0]===6&&ze.label<pe[1]){ze.label=pe[1],pe=un;break}if(pe&&ze.label<pe[2]){ze.label=pe[2],ze.ops.push(un);break}pe[2]&&ze.ops.pop(),ze.trys.pop();continue}un=ce.call(ke,ze)}catch(yn){un=[6,yn],ve=0}finally{le=pe=0}if(5&un[0])throw un[1];return{value:un[0]?un[1]:void 0,done:!0}}([Vt,en])}}}function ye(){for(var ke=0,ce=0,le=arguments.length;ce<le;ce++)ke+=arguments[ce].length;var ve=Array(ke),pe=0;for(ce=0;ce<le;ce++)for(var oe=arguments[ce],ze=0,yt=oe.length;ze<yt;ze++,pe++)ve[pe]=oe[ze];return ve}var Ce=function(){function ke(){}return ke.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ke.setAttributes=function(ce,le){for(var ve=0,pe=le;ve<pe.length;ve++){var oe=pe[ve],ze=oe[0],yt=oe[1];ce.setAttribute(ze,yt)}},ke.createRect=function(ce,le,ve){var pe=document.createElementNS("http://www.w3.org/2000/svg","rect");return pe.setAttribute("width",ce.toString()),pe.setAttribute("height",le.toString()),ve&&ke.setAttributes(pe,ve),pe},ke.createLine=function(ce,le,ve,pe,oe){var ze=document.createElementNS("http://www.w3.org/2000/svg","line");return ze.setAttribute("x1",ce.toString()),ze.setAttribute("y1",le.toString()),ze.setAttribute("x2",ve.toString()),ze.setAttribute("y2",pe.toString()),oe&&ke.setAttributes(ze,oe),ze},ke.createPolygon=function(ce,le){var ve=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ve.setAttribute("points",ce),le&&ke.setAttributes(ve,le),ve},ke.createCircle=function(ce,le){var ve=document.createElementNS("http://www.w3.org/2000/svg","circle");return ve.setAttribute("cx",(ce/2).toString()),ve.setAttribute("cy",(ce/2).toString()),ve.setAttribute("r",ce.toString()),le&&ke.setAttributes(ve,le),ve},ke.createEllipse=function(ce,le,ve){var pe=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return pe.setAttribute("cx",(ce/2).toString()),pe.setAttribute("cy",(le/2).toString()),pe.setAttribute("rx",(ce/2).toString()),pe.setAttribute("ry",(le/2).toString()),ve&&ke.setAttributes(pe,ve),pe},ke.createGroup=function(ce){var le=document.createElementNS("http://www.w3.org/2000/svg","g");return ce&&ke.setAttributes(le,ce),le},ke.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ke.createMarker=function(ce,le,ve,pe,oe,ze,yt){var Vt=document.createElementNS("http://www.w3.org/2000/svg","marker");return ke.setAttributes(Vt,[["id",ce],["orient",le],["markerWidth",ve.toString()],["markerHeight",pe.toString()],["refX",oe.toString()],["refY",ze.toString()]]),Vt.appendChild(yt),Vt},ke.createText=function(ce){var le=document.createElementNS("http://www.w3.org/2000/svg","text");return le.setAttribute("x","0"),le.setAttribute("y","0"),ce&&ke.setAttributes(le,ce),le},ke.createTSpan=function(ce,le){var ve=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ve.textContent=ce,le&&ke.setAttributes(ve,le),ve},ke.createImage=function(ce){var le=document.createElementNS("http://www.w3.org/2000/svg","image");return ce&&ke.setAttributes(le,ce),le},ke.createPoint=function(ce,le){var ve=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ve.x=ce,ve.y=le,ve},ke.createPath=function(ce,le){var ve=document.createElementNS("http://www.w3.org/2000/svg","path");return ve.setAttribute("d",ce),le&&ke.setAttributes(ve,le),ve},ke}(),Me=function(){function ke(){}return ke.addKey=function(ce){ke.key=ce},Object.defineProperty(ke,"isLicensed",{get:function(){return!!ke.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ke.key)},enumerable:!1,configurable:!0}),ke}(),we=function(){function ke(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return ke.prototype.rasterize=function(ce,le,ve){var pe=this;return new Promise(function(oe){var ze=ve!==void 0?ve:document.createElement("canvas");ce===null&&(pe.markersOnly=!0,pe.naturalSize=!1);var yt=document.createElementNS("http://www.w3.org/2000/svg","svg");yt.setAttribute("xmlns","http://www.w3.org/2000/svg"),yt.setAttribute("width",le.width.baseVal.valueAsString),yt.setAttribute("height",le.height.baseVal.valueAsString),yt.setAttribute("viewBox","0 0 "+le.viewBox.baseVal.width.toString()+" "+le.viewBox.baseVal.height.toString()),yt.innerHTML=le.innerHTML,pe.naturalSize===!0?(yt.width.baseVal.value=ce.naturalWidth,yt.height.baseVal.value=ce.naturalHeight):pe.width!==void 0&&pe.height!==void 0&&(yt.width.baseVal.value=pe.width,yt.height.baseVal.value=pe.height),ze.width=yt.width.baseVal.value,ze.height=yt.height.baseVal.value;var Vt=yt.outerHTML,en=ze.getContext("2d");pe.markersOnly!==!0&&en.drawImage(ce,0,0,ze.width,ze.height);var un=window.URL,yn=new Image(ze.width,ze.height);yn.setAttribute("crossOrigin","anonymous");var Jt=new Blob([Vt],{type:"image/svg+xml"}),Cr=un.createObjectURL(Jt);yn.onload=function(){en.drawImage(yn,0,0),un.revokeObjectURL(Cr);var Tr=ze.toDataURL(pe.imageType,pe.imageQuality);oe(Tr)},yn.src=Cr})},ke}(),he=function(){},De=function(){function ke(ce){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+ce+"_"}return Object.defineProperty(ke.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ke.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ke.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(ke.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ke.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),ke.prototype.addClass=function(ce){return this.styleSheet===void 0&&this.addStyleSheet(),ce.name=""+this.classNamePrefix+ce.localName,this.classes.push(ce),this.styleSheet.sheet.insertRule("."+ce.name+" {"+ce.style+"}",this.styleSheet.sheet.cssRules.length),ce},ke.prototype.addRule=function(ce){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(ce),this.styleSheet.sheet.insertRule(ce.selector+" {"+ce.style+"}",this.styleSheet.sheet.cssRules.length)},ke.prototype.addStyleSheet=function(){var ce;this.styleSheet=document.createElement("style"),((ce=this.styleSheetRoot)!==null&&ce!==void 0?ce:document.head).appendChild(this.styleSheet),this.addRule(new ct("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ct("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new ct("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Ne("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Ne("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},ke.prototype.removeStyleSheet=function(){var ce;this.styleSheet&&(((ce=this.styleSheetRoot)!==null&&ce!==void 0?ce:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ke}(),ct=function(ke,ce){this.selector=ke,this.style=ce},Ne=function(ke,ce){this.localName=ke,this.style=ce},Mt=function(){function ke(ce,le,ve,pe,oe){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=ce,this.displayMode=le,this.markerItems=ve,this.uiStyleSettings=pe,this.styles=oe,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return ke.prototype.show=function(ce){var le=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=ce,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var ve=document.createElement("div");ve.className=this.toolbarBlockStyleClass.name,ve.style.whiteSpace="nowrap",this.uiContainer.appendChild(ve),this.addActionButton(ve,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(ve,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(ve,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(ve,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(ve,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(ve,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(ve,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(ve,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(oe){var ze=document.createElement("div");ze.className=""+le.toolbarButtonStyleClass.name,ze.setAttribute("data-type-name",oe.typeName),ze.innerHTML=oe.icon,ze.addEventListener("click",function(){le.markerToolbarButtonClicked(ze,oe)}),le.buttons.push(ze),le.markerButtons.push(ze)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var pe=document.createElement("div");pe.className=this.toolbarBlockStyleClass.name,pe.style.whiteSpace="nowrap",pe.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(pe),this.addActionButton(pe,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(pe,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},ke.prototype.addButtonClickListener=function(ce){this.buttonClickListeners.push(ce)},ke.prototype.removeButtonClickListener=function(ce){this.buttonClickListeners.indexOf(ce)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(ce),1)},ke.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ke.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var ce=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var le=0;le<this.markerButtons.length;le++)le<ce||le===ce&&this.markerButtons.length-1===ce?this.markerButtonBlock.appendChild(this.markerButtons[le]):(le===ce&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[le]))}},ke.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},ke.prototype.resetButtonStyles=function(){var ce=this;this.buttons.forEach(function(le){le.className=le.className.replace(ce.uiStyleSettings.toolbarButtonStyleColorsClassName?ce.uiStyleSettings.toolbarButtonStyleColorsClassName:ce.toolbarButtonStyleColorsClass.name,"").trim(),le.className=le.className.replace(ce.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?ce.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:ce.toolbarActiveButtonStyleColorsClass.name,"").trim(),le.className+=" "+(ce.uiStyleSettings.toolbarButtonStyleColorsClassName?ce.uiStyleSettings.toolbarButtonStyleColorsClassName:ce.toolbarButtonStyleColorsClass.name)})},ke.prototype.addActionButton=function(ce,le,ve){var pe=this,oe=document.createElement("div");switch(oe.className=""+this.toolbarButtonStyleClass.name,oe.innerHTML=le,oe.setAttribute("data-action",ve),oe.addEventListener("click",function(){pe.actionToolbarButtonClicked(oe,ve)}),ve){case"select":oe.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":oe.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":oe.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":oe.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":oe.style.fill=this.uiStyleSettings.closeButtonColor}ce.appendChild(oe),this.buttons.push(oe)},ke.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ne("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Ne("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ne("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Ne("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new Ne("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var ce=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ne("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*ce)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*ce)+`px;
padding: `+ce+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ne("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ne("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new ct("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new ct("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},ke.prototype.markerToolbarButtonClicked=function(ce,le){this.setActiveButton(ce),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ve){return ve("marker",le)}),this.markerButtonOverflowBlock.style.display="none"},ke.prototype.actionToolbarButtonClicked=function(ce,le){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ve){return ve("action",le)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},ke.prototype.setActiveButton=function(ce){this.resetButtonStyles(),ce.className=ce.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),ce.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},ke.prototype.setActiveMarkerButton=function(ce){var le=this.markerButtons.find(function(ve){return ve.getAttribute("data-type-name")===ce});le&&this.setActiveButton(le)},ke.prototype.setCurrentMarker=function(ce){var le=this;this.currentMarker=ce,this.buttons.filter(function(ve){return/delete|notes/.test(ve.getAttribute("data-action"))}).forEach(function(ve){le.currentMarker===void 0?(ve.style.fillOpacity="0.4",ve.style.pointerEvents="none"):(ve.style.fillOpacity="1",ve.style.pointerEvents="all")})},ke}(),ut=function(){function ke(ce,le,ve,pe){this.panels=[],this.panelButtons=[],this.markerjsContainer=ce,this.displayMode=le,this.uiStyleSettings=ve,this.styles=pe,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ke.prototype.addStyles=function(){var ce;this.toolboxStyleClass=this.styles.addClass(new Ne("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new Ne("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var le=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ne("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ne("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ne("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new Ne("toolbox-panel-row_colors",`
background-color: `+((ce=this.uiStyleSettings.toolboxBackgroundColor)!==null&&ce!==void 0?ce:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ne("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*le)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*le)+`px;
padding: `+le+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ne("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ne("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new ct("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new ct("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},ke.prototype.show=function(ce){var le;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=ce,this.uiContainer.className=this.toolboxStyleClass.name+" "+((le=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&le!==void 0?le:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},ke.prototype.setPanelButtons=function(ce){var le,ve,pe=this;this.panels=ce,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((le=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&le!==void 0?le:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((ve=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&ve!==void 0?ve:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(oe){var ze;oe.uiStyleSettings=pe.uiStyleSettings;var yt=document.createElement("div");yt.className=pe.toolboxButtonStyleClass.name+" "+((ze=pe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ze!==void 0?ze:pe.toolboxButtonStyleColorsClass.name),yt.innerHTML=oe.icon,yt.title=oe.title,yt.addEventListener("click",function(){pe.panelButtonClick(oe)}),pe.panelButtons.push(yt),pe.buttonRow.appendChild(yt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ke.prototype.panelButtonClick=function(ce){var le=this,ve=-1;if(ce!==this.activePanel){ve=this.panels.indexOf(ce),this.panelRow.innerHTML="";var pe=ce.getUi();pe.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(pe),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=ce}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){le.displayMode==="inline"?le.panelRow.style.display="none":le.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(oe,ze){var yt,Vt;oe.className=le.toolboxButtonStyleClass.name+" "+(ze===ve?""+((yt=le.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&yt!==void 0?yt:le.toolboxActiveButtonStyleColorsClass.name):""+((Vt=le.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Vt!==void 0?Vt:le.toolboxButtonStyleColorsClass.name))})},ke}(),Qe=function(ke,ce){this.title=ke,this.icon=ce},Xe=function(ke){function ce(le,ve,pe,oe){var ze=ke.call(this,le,oe||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return ze.colors=[],ze.addTransparent=!1,ze.colorBoxes=[],ze.colors=ve,ze.currentColor=pe,ze.setCurrentColor=ze.setCurrentColor.bind(ze),ze.getColorBox=ze.getColorBox.bind(ze),ze}return tt(ce,ke),ce.prototype.getUi=function(){var le=this,ve=document.createElement("div");return ve.style.overflow="hidden",ve.style.whiteSpace="nowrap",this.colors.forEach(function(pe){var oe=le.getColorBox(pe);ve.appendChild(oe),le.colorBoxes.push(oe)}),ve},ce.prototype.getColorBox=function(le){var ve=this,pe=this.uiStyleSettings.toolbarHeight/4,oe=this.uiStyleSettings.toolbarHeight-pe,ze=document.createElement("div");ze.style.display="inline-block",ze.style.boxSizing="content-box",ze.style.width=oe-2+"px",ze.style.height=oe-2+"px",ze.style.padding="1px",ze.style.marginRight="2px",ze.style.marginBottom="2px",ze.style.borderWidth="2px",ze.style.borderStyle="solid",ze.style.borderRadius=(oe+2)/2+"px",ze.style.borderColor=le===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ze.addEventListener("click",function(){ve.setCurrentColor(le,ze)});var yt=document.createElement("div");return yt.style.display="inline-block",yt.style.width=oe-2+"px",yt.style.height=oe-2+"px",yt.style.backgroundColor=le,yt.style.borderRadius=oe/2+"px",le==="transparent"&&(yt.style.fill=this.uiStyleSettings.toolboxAccentColor,yt.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),ze.appendChild(yt),ze},ce.prototype.setCurrentColor=function(le,ve){var pe=this;this.currentColor=le,this.colorBoxes.forEach(function(oe){oe.style.borderColor=oe===ve?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(le)},ce}(Qe),Te=function(){function ke(ce,le,ve){this._state="new",this._isSelected=!1,this._container=ce,this._overlayContainer=le,this.globalSettings=ve,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(ke.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(ke.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(ke.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(ke.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(ke.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),ke.prototype.ownsTarget=function(ce){return!1},Object.defineProperty(ke.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),ke.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},ke.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},ke.prototype.pointerDown=function(ce,le){},ke.prototype.dblClick=function(ce,le){},ke.prototype.manipulate=function(ce){},ke.prototype.pointerUp=function(ce){this.stateChanged()},ke.prototype.dispose=function(){},ke.prototype.addMarkerVisualToContainer=function(ce){this.container.childNodes.length>0?this.container.insertBefore(ce,this.container.childNodes[0]):this.container.appendChild(ce)},ke.prototype.getState=function(){return{typeName:ke.typeName,state:this.state,notes:this.notes}},ke.prototype.restoreState=function(ce){this._state=ce.state,this.notes=ce.notes},ke.prototype.scale=function(ce,le){},ke.prototype.colorChanged=function(ce){this.onColorChanged&&this.onColorChanged(ce),this.stateChanged()},ke.prototype.fillColorChanged=function(ce){this.onFillColorChanged&&this.onFillColorChanged(ce),this.stateChanged()},ke.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var ce=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),ce.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(ce)&&this.onStateChanged(this)}},ke.typeName="MarkerBase",ke}(),Et=function(){function ke(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ke.prototype.findGripByVisual=function(ce){return this.topLeft.ownsTarget(ce)?this.topLeft:this.topCenter.ownsTarget(ce)?this.topCenter:this.topRight.ownsTarget(ce)?this.topRight:this.centerLeft.ownsTarget(ce)?this.centerLeft:this.centerRight.ownsTarget(ce)?this.centerRight:this.bottomLeft.ownsTarget(ce)?this.bottomLeft:this.bottomCenter.ownsTarget(ce)?this.bottomCenter:this.bottomRight.ownsTarget(ce)?this.bottomRight:void 0},ke}(),Lt=function(){function ke(){this.GRIP_SIZE=10,this.visual=Ce.createGroup(),this.visual.appendChild(Ce.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ce.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ke.prototype.ownsTarget=function(ce){return ce===this.visual||ce===this.visual.childNodes[0]||ce===this.visual.childNodes[1]},ke}(),et=function(){function ke(){}return ke.toITransformMatrix=function(ce){return{a:ce.a,b:ce.b,c:ce.c,d:ce.d,e:ce.e,f:ce.f}},ke.toSVGMatrix=function(ce,le){return ce.a=le.a,ce.b=le.b,ce.c=le.c,ce.d=le.d,ce.e=le.e,ce.f=le.f,ce},ke}(),lt=function(ke){function ce(le,ve,pe){var oe=ke.call(this,le,ve,pe)||this;return oe.left=0,oe.top=0,oe.width=0,oe.height=0,oe.defaultSize={x:50,y:20},oe.offsetX=0,oe.offsetY=0,oe.rotationAngle=0,oe.CB_DISTANCE=10,oe._suppressMarkerCreateEvent=!1,oe.container.transform.baseVal.appendItem(Ce.createTransform()),oe.setupControlBox(),oe}return tt(ce,ke),Object.defineProperty(ce.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(ce.prototype,"visual",{get:function(){return this._visual},set:function(le){this._visual=le;var ve=Ce.createTransform();this._visual.transform.baseVal.appendItem(ve)},enumerable:!1,configurable:!0}),ce.prototype.ownsTarget=function(le){return!!ke.prototype.ownsTarget.call(this,le)||!!(this.controlGrips.findGripByVisual(le)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(le))},ce.prototype.pointerDown=function(le,ve){ke.prototype.pointerDown.call(this,le,ve),this.state==="new"&&(this.left=le.x,this.top=le.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var pe=this.unrotatePoint(le);if(this.manipulationStartX=pe.x,this.manipulationStartY=pe.y,this.offsetX=pe.x-this.left,this.offsetY=pe.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(ve),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(ve)){this.activeGrip=this.rotatorGrip;var oe=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=oe.x-this.width/2,this.top=oe.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ze=this.container.transform.baseVal.getItem(0);ze.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ze,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},ce.prototype.pointerUp=function(le){var ve=this.state;ke.prototype.pointerUp.call(this,le),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(le),this._state="select",ve==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},ce.prototype.moveVisual=function(le){this.visual.style.transform="translate("+le.x+"px, "+le.y+"px)"},ce.prototype.manipulate=function(le){var ve=this.unrotatePoint(le);this.state==="creating"?this.resize(le):this.state==="move"?(this.left=this.manipulationStartLeft+(ve.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(ve.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(ve):this.state==="rotate"&&this.rotate(le)},ce.prototype.resize=function(le){var ve=this.manipulationStartLeft,pe=this.manipulationStartWidth,oe=this.manipulationStartTop,ze=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:ve=this.manipulationStartLeft+le.x-this.manipulationStartX,pe=this.manipulationStartWidth+this.manipulationStartLeft-ve;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:pe=this.manipulationStartWidth+le.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:oe=this.manipulationStartTop+le.y-this.manipulationStartY,ze=this.manipulationStartHeight+this.manipulationStartTop-oe;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ze=this.manipulationStartHeight+le.y-this.manipulationStartY}pe>=0?(this.left=ve,this.width=pe):(this.left=ve+pe,this.width=-pe),ze>=0?(this.top=oe,this.height=ze):(this.top=oe+ze,this.height=-ze),this.setSize()},ce.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},ce.prototype.rotate=function(le){if(Math.abs(le.x-this.centerX)>.1){var ve=Math.sign(le.x-this.centerX);this.rotationAngle=180*Math.atan((le.y-this.centerY)/(le.x-this.centerX))/Math.PI+90*ve,this.applyRotation()}},ce.prototype.applyRotation=function(){var le=this.container.transform.baseVal.getItem(0);le.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(le,0)},ce.prototype.rotatePoint=function(le){if(this.rotationAngle===0)return le;var ve=this.container.getCTM(),pe=Ce.createPoint(le.x,le.y);return{x:(pe=pe.matrixTransform(ve)).x,y:pe.y}},ce.prototype.unrotatePoint=function(le){if(this.rotationAngle===0)return le;var ve=this.container.getCTM();ve=ve.inverse();var pe=Ce.createPoint(le.x,le.y);return{x:(pe=pe.matrixTransform(ve)).x,y:pe.y}},ce.prototype.select=function(){ke.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},ce.prototype.deselect=function(){ke.prototype.deselect.call(this),this.controlBox.style.display="none"},ce.prototype.setupControlBox=function(){this.controlBox=Ce.createGroup();var le=Ce.createTransform();le.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(le),this.container.appendChild(this.controlBox),this.controlRect=Ce.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=Ce.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Et,this.addControlGrips(),this.controlBox.style.display="none"},ce.prototype.adjustControlBox=function(){var le=this.controlBox.transform.baseVal.getItem(0);le.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(le,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},ce.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},ce.prototype.createGrip=function(){var le=new Lt;return le.visual.transform.baseVal.appendItem(Ce.createTransform()),this.controlBox.appendChild(le.visual),le},ce.prototype.positionGrips=function(){var le=this.controlGrips.topLeft.GRIP_SIZE,ve=-le/2,pe=ve,oe=(this.width+this.CB_DISTANCE)/2-le/2,ze=(this.height+this.CB_DISTANCE)/2-le/2,yt=this.height+this.CB_DISTANCE-le/2,Vt=this.width+this.CB_DISTANCE-le/2;this.positionGrip(this.controlGrips.topLeft.visual,ve,pe),this.positionGrip(this.controlGrips.topCenter.visual,oe,pe),this.positionGrip(this.controlGrips.topRight.visual,Vt,pe),this.positionGrip(this.controlGrips.centerLeft.visual,ve,ze),this.positionGrip(this.controlGrips.centerRight.visual,Vt,ze),this.positionGrip(this.controlGrips.bottomLeft.visual,ve,yt),this.positionGrip(this.controlGrips.bottomCenter.visual,oe,yt),this.positionGrip(this.controlGrips.bottomRight.visual,Vt,yt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,oe,pe-3*this.CB_DISTANCE)},ce.prototype.positionGrip=function(le,ve,pe){var oe=le.transform.baseVal.getItem(0);oe.setTranslate(ve,pe),le.transform.baseVal.replaceItem(oe,0)},ce.prototype.hideControlBox=function(){this.controlBox.style.display="none"},ce.prototype.showControlBox=function(){this.controlBox.style.display=""},ce.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:et.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:et.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},ke.prototype.getState.call(this))},ce.prototype.restoreState=function(le){ke.prototype.restoreState.call(this,le);var ve=le;this.left=ve.left,this.top=ve.top,this.width=ve.width,this.height=ve.height,this.rotationAngle=ve.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(et.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,ve.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(et.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,ve.containerTransformMatrix))},ce.prototype.scale=function(le,ve){ke.prototype.scale.call(this,le,ve);var pe=this.rotatePoint({x:this.left,y:this.top}),oe=this.unrotatePoint({x:pe.x*le,y:pe.y*ve});this.left=oe.x,this.top=oe.y,this.width=this.width*le,this.height=this.height*ve,this.adjustControlBox()},ce}(Te),Ie=function(ke){function ce(le,ve,pe){var oe=ke.call(this,le,ve,pe)||this;return oe.fillColor="transparent",oe.strokeColor="transparent",oe.strokeWidth=0,oe.strokeDasharray="",oe.opacity=1,oe.setStrokeColor=oe.setStrokeColor.bind(oe),oe.setFillColor=oe.setFillColor.bind(oe),oe.setStrokeWidth=oe.setStrokeWidth.bind(oe),oe.setStrokeDasharray=oe.setStrokeDasharray.bind(oe),oe.createVisual=oe.createVisual.bind(oe),oe}return tt(ce,ke),ce.prototype.ownsTarget=function(le){return!(!ke.prototype.ownsTarget.call(this,le)&&le!==this.visual)},ce.prototype.createVisual=function(){this.visual=Ce.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},ce.prototype.pointerDown=function(le,ve){ke.prototype.pointerDown.call(this,le,ve),this.state==="new"&&(this.createVisual(),this.moveVisual(le),this._state="creating")},ce.prototype.manipulate=function(le){ke.prototype.manipulate.call(this,le)},ce.prototype.resize=function(le){ke.prototype.resize.call(this,le),this.setSize()},ce.prototype.setSize=function(){ke.prototype.setSize.call(this),Ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},ce.prototype.pointerUp=function(le){ke.prototype.pointerUp.call(this,le),this.setSize()},ce.prototype.setStrokeColor=function(le){this.strokeColor=le,this.visual&&Ce.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(le),this.stateChanged()},ce.prototype.setFillColor=function(le){this.fillColor=le,this.visual&&Ce.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},ce.prototype.setStrokeWidth=function(le){this.strokeWidth=le,this.visual&&Ce.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},ce.prototype.setStrokeDasharray=function(le){this.strokeDasharray=le,this.visual&&Ce.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},ce.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ke.prototype.getState.call(this))},ce.prototype.restoreState=function(le){var ve=le;this.fillColor=ve.fillColor,this.strokeColor=ve.strokeColor,this.strokeWidth=ve.strokeWidth,this.strokeDasharray=ve.strokeDasharray,this.opacity=ve.opacity,this.createVisual(),ke.prototype.restoreState.call(this,le),this.setSize()},ce.prototype.scale=function(le,ve){ke.prototype.scale.call(this,le,ve),this.setSize()},ce.title="Rectangle marker",ce}(lt),_e=function(ke){function ce(le,ve,pe,oe){var ze=ke.call(this,le,oe||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ze.widths=[],ze.widthBoxes=[],ze.widths=ve,ze.currentWidth=pe,ze.setCurrentWidth=ze.setCurrentWidth.bind(ze),ze}return tt(ce,ke),ce.prototype.getUi=function(){var le=this,ve=document.createElement("div");return ve.style.display="flex",ve.style.overflow="hidden",ve.style.flexGrow="2",this.widths.forEach(function(pe){var oe=document.createElement("div");oe.style.display="flex",oe.style.flexGrow="2",oe.style.alignItems="center",oe.style.justifyContent="space-between",oe.style.padding="5px",oe.style.borderWidth="2px",oe.style.borderStyle="solid",oe.style.borderColor=pe===le.currentWidth?le.uiStyleSettings.toolboxAccentColor:"transparent",oe.addEventListener("click",function(){le.setCurrentWidth(pe,oe)}),ve.appendChild(oe);var ze=document.createElement("div");ze.innerText=pe.toString(),ze.style.marginRight="5px",oe.appendChild(ze);var yt=document.createElement("div");yt.style.minHeight="20px",yt.style.flexGrow="2",yt.style.display="flex",yt.style.alignItems="center";var Vt=document.createElement("hr");Vt.style.minWidth="20px",Vt.style.border="0px",Vt.style.borderTop=pe+"px solid "+le.uiStyleSettings.toolboxColor,Vt.style.flexGrow="2",yt.appendChild(Vt),oe.appendChild(yt),le.widthBoxes.push(oe)}),ve},ce.prototype.setCurrentWidth=function(le,ve){var pe=this;this.currentWidth=le,this.widthBoxes.forEach(function(oe){oe.style.borderColor=oe===ve?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},ce}(Qe),Ue=function(ke){function ce(le,ve,pe,oe){var ze=ke.call(this,le,oe||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return ze.styles=[],ze.styleBoxes=[],ze.styles=ve,ze.currentStyle=pe,ze.setCurrentStyle=ze.setCurrentStyle.bind(ze),ze}return tt(ce,ke),ce.prototype.getUi=function(){var le=this,ve=document.createElement("div");return ve.style.display="flex",ve.style.overflow="hidden",ve.style.flexGrow="2",this.styles.forEach(function(pe){var oe=document.createElement("div");oe.style.display="flex",oe.style.alignItems="center",oe.style.justifyContent="space-between",oe.style.padding="5px",oe.style.borderWidth="2px",oe.style.borderStyle="solid",oe.style.overflow="hidden",oe.style.maxWidth=100/le.styles.length-5+"%",oe.style.borderColor=pe===le.currentStyle?le.uiStyleSettings.toolboxAccentColor:"transparent",oe.addEventListener("click",function(){le.setCurrentStyle(pe,oe)}),ve.appendChild(oe);var ze=document.createElement("div");ze.style.minHeight="20px",ze.style.flexGrow="2",ze.style.overflow="hidden";var yt=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+le.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(pe!==""?'stroke-dasharray="'+pe+'"':"")+` />
</svg>`;ze.innerHTML=yt,oe.appendChild(ze),le.styleBoxes.push(oe)}),ve},ce.prototype.setCurrentStyle=function(le,ve){var pe=this;this.currentStyle=le,this.styleBoxes.forEach(function(oe){oe.style.borderColor=oe===ve?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},ce}(Qe),Ze=function(ke){function ce(le,ve,pe){var oe=ke.call(this,le,ve,pe)||this;return oe.strokeColor=pe.defaultColor,oe.strokeWidth=pe.defaultStrokeWidth,oe.strokeDasharray=pe.defaultStrokeDasharray,oe.strokePanel=new Xe("Line color",pe.defaultColorSet,pe.defaultColor),oe.strokePanel.onColorChanged=oe.setStrokeColor,oe.strokeWidthPanel=new _e("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),oe.strokeWidthPanel.onWidthChanged=oe.setStrokeWidth,oe.strokeStylePanel=new Ue("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),oe.strokeStylePanel.onStyleChanged=oe.setStrokeDasharray,oe}return tt(ce,ke),Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=ke.prototype.getState.call(this);return le.typeName=ce.typeName,le},ce.typeName="FrameMarker",ce.title="Frame marker",ce.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',ce}(Ie),At=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1,this.defaultCaptionFontSize="1rem",this.defaultCaptionText="Text"},bt=function(ke){function ce(le,ve,pe){var oe=ke.call(this,le,ve,pe)||this;return oe.x1=0,oe.y1=0,oe.x2=0,oe.y2=0,oe.defaultLength=50,oe.manipulationStartX=0,oe.manipulationStartY=0,oe.manipulationStartX1=0,oe.manipulationStartY1=0,oe.manipulationStartX2=0,oe.manipulationStartY2=0,oe.setupControlBox(),oe}return tt(ce,ke),ce.prototype.ownsTarget=function(le){return!!ke.prototype.ownsTarget.call(this,le)||!(!this.grip1.ownsTarget(le)&&!this.grip2.ownsTarget(le))},ce.prototype.pointerDown=function(le,ve){ke.prototype.pointerDown.call(this,le,ve),this.manipulationStartX=le.x,this.manipulationStartY=le.y,this.state==="new"&&(this.x1=le.x,this.y1=le.y,this.x2=le.x,this.y2=le.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(ve)?this.activeGrip=this.grip1:this.grip2.ownsTarget(ve)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},ce.prototype.pointerUp=function(le){var ve=this.state;ke.prototype.pointerUp.call(this,le),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(le),this._state="select",ve==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},ce.prototype.adjustVisual=function(){},ce.prototype.manipulate=function(le){this.state==="creating"?this.resize(le):this.state==="move"?(this.x1=this.manipulationStartX1+le.x-this.manipulationStartX,this.y1=this.manipulationStartY1+le.y-this.manipulationStartY,this.x2=this.manipulationStartX2+le.x-this.manipulationStartX,this.y2=this.manipulationStartY2+le.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(le)},ce.prototype.resize=function(le){switch(this.activeGrip){case this.grip1:this.x1=le.x,this.y1=le.y;break;case this.grip2:case void 0:this.x2=le.x,this.y2=le.y}this.adjustVisual(),this.adjustControlBox()},ce.prototype.select=function(){ke.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},ce.prototype.deselect=function(){ke.prototype.deselect.call(this),this.controlBox.style.display="none"},ce.prototype.setupControlBox=function(){this.controlBox=Ce.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},ce.prototype.adjustControlBox=function(){this.positionGrips()},ce.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},ce.prototype.createGrip=function(){var le=new Lt;return le.visual.transform.baseVal.appendItem(Ce.createTransform()),this.controlBox.appendChild(le.visual),le},ce.prototype.positionGrips=function(){var le=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-le/2,this.y1-le/2),this.positionGrip(this.grip2.visual,this.x2-le/2,this.y2-le/2)},ce.prototype.positionGrip=function(le,ve,pe){var oe=le.transform.baseVal.getItem(0);oe.setTranslate(ve,pe),le.transform.baseVal.replaceItem(oe,0)},ce.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},ke.prototype.getState.call(this))},ce.prototype.restoreState=function(le){ke.prototype.restoreState.call(this,le);var ve=le;this.x1=ve.x1,this.y1=ve.y1,this.x2=ve.x2,this.y2=ve.y2},ce.prototype.scale=function(le,ve){ke.prototype.scale.call(this,le,ve),this.x1=this.x1*le,this.y1=this.y1*ve,this.x2=this.x2*le,this.y2=this.y2*ve,this.adjustVisual(),this.adjustControlBox()},ce}(Te),xt=function(ke){function ce(le,ve,pe){var oe=ke.call(this,le,ve,pe)||this;return oe.strokeColor="transparent",oe.strokeWidth=0,oe.strokeDasharray="",oe.setStrokeColor=oe.setStrokeColor.bind(oe),oe.setStrokeWidth=oe.setStrokeWidth.bind(oe),oe.setStrokeDasharray=oe.setStrokeDasharray.bind(oe),oe.strokeColor=pe.defaultColor,oe.strokeWidth=pe.defaultStrokeWidth,oe.strokeDasharray=pe.defaultStrokeDasharray,oe.strokePanel=new Xe("Line color",pe.defaultColorSet,pe.defaultColor),oe.strokePanel.onColorChanged=oe.setStrokeColor,oe.strokeWidthPanel=new _e("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),oe.strokeWidthPanel.onWidthChanged=oe.setStrokeWidth,oe.strokeStylePanel=new Ue("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),oe.strokeStylePanel.onStyleChanged=oe.setStrokeDasharray,oe}return tt(ce,ke),ce.prototype.ownsTarget=function(le){return!(!ke.prototype.ownsTarget.call(this,le)&&le!==this.visual&&le!==this.selectorLine&&le!==this.visibleLine)},ce.prototype.createVisual=function(){this.visual=Ce.createGroup(),this.selectorLine=Ce.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=Ce.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},ce.prototype.pointerDown=function(le,ve){ke.prototype.pointerDown.call(this,le,ve),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},ce.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),Ce.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),Ce.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),Ce.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},ce.prototype.setStrokeColor=function(le){this.strokeColor=le,this.adjustVisual(),this.colorChanged(le)},ce.prototype.setStrokeWidth=function(le){this.strokeWidth=le,this.adjustVisual()},ce.prototype.setStrokeDasharray=function(le){this.strokeDasharray=le,this.adjustVisual(),this.stateChanged()},Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},ke.prototype.getState.call(this));return le.typeName=ce.typeName,le},ce.prototype.restoreState=function(le){ke.prototype.restoreState.call(this,le);var ve=le;this.strokeColor=ve.strokeColor,this.strokeWidth=ve.strokeWidth,this.strokeDasharray=ve.strokeDasharray,this.createVisual(),this.adjustVisual()},ce.typeName="LineMarker",ce.title="Line marker",ce.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',ce}(bt),Ge=function(ke){function ce(le,ve,pe,oe){var ze=ke.call(this,le,oe||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return ze.fonts=[],ze.fontBoxes=[],ze.fonts=ve,ze.currentFont=pe,ze.setCurrentFont=ze.setCurrentFont.bind(ze),ze}return tt(ce,ke),ce.prototype.getUi=function(){var le=this,ve=document.createElement("div");return ve.style.overflow="hidden",ve.style.flexGrow="2",this.fonts.forEach(function(pe){var oe=document.createElement("div");oe.style.display="inline-block",oe.style.alignItems="center",oe.style.justifyContent="space-between",oe.style.padding="5px",oe.style.borderWidth="2px",oe.style.borderStyle="solid",oe.style.overflow="hidden",oe.style.maxWidth=100/le.fonts.length-5+"%",oe.style.borderColor=pe===le.currentFont?le.uiStyleSettings.toolboxAccentColor:"transparent",oe.addEventListener("click",function(){le.setCurrentFont(pe,oe)}),ve.appendChild(oe);var ze=document.createElement("div");ze.style.display="flex",ze.style.minHeight="20px",ze.style.flexGrow="2",ze.style.fontFamily=pe,ze.style.overflow="hidden";var yt=document.createElement("div");yt.style.whiteSpace="nowrap",yt.style.overflow="hidden",yt.style.textOverflow="ellipsis",yt.innerHTML="The quick brown fox jumps over the lazy dog",ze.appendChild(yt),oe.appendChild(ze),le.fontBoxes.push(oe)}),ve},ce.prototype.setCurrentFont=function(le,ve){var pe=this;this.currentFont=le,this.fontBoxes.forEach(function(oe){oe.style.borderColor=oe===ve?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},ce}(Qe),Ot=function(ke){function ce(le,ve,pe){var oe=ke.call(this,le,ve,pe)||this;return oe.color="transparent",oe.padding=5,oe.DEFAULT_TEXT="\u8BF7\u8F93\u5165\u6587\u672C",oe.text=oe.DEFAULT_TEXT,oe.isMoved=!1,oe.color=pe.defaultColor,oe.fontFamily=pe.defaultFontFamily,oe.defaultSize={x:100,y:30},oe.setColor=oe.setColor.bind(oe),oe.setFont=oe.setFont.bind(oe),oe.renderText=oe.renderText.bind(oe),oe.sizeText=oe.sizeText.bind(oe),oe.textEditDivClicked=oe.textEditDivClicked.bind(oe),oe.showTextEditor=oe.showTextEditor.bind(oe),oe.setSize=oe.setSize.bind(oe),oe.positionTextEditor=oe.positionTextEditor.bind(oe),oe.colorPanel=new Xe("Color",pe.defaultColorSet,pe.defaultColor),oe.colorPanel.onColorChanged=oe.setColor,oe.fontFamilyPanel=new Ge("Font",pe.defaultFontFamilies,pe.defaultFontFamily),oe.fontFamilyPanel.onFontChanged=oe.setFont,oe}return tt(ce,ke),ce.prototype.ownsTarget=function(le){if(ke.prototype.ownsTarget.call(this,le)||le===this.visual||le===this.textElement||le===this.bgRectangle)return!0;var ve=!1;return this.textElement.childNodes.forEach(function(pe){pe===le&&(ve=!0)}),ve},ce.prototype.createVisual=function(){this.visual=Ce.createGroup(),this.bgRectangle=Ce.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=Ce.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(Ce.createTransform()),this.textElement.transform.baseVal.appendItem(Ce.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},ce.prototype.pointerDown=function(le,ve){ke.prototype.pointerDown.call(this,le,ve),this.isMoved=!1,this.pointerDownPoint=le,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(le),this._state="creating")},ce.prototype.renderText=function(){var le=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(ve){le.textElement.appendChild(Ce.createTSpan(ve.trim()===""?" ":ve.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},ce.prototype.getTextScale=function(){var le=this.textElement.getBBox(),ve=1;if(le.width>0&&le.height>0){var pe=(1*this.width-this.width*this.padding*2/100)/le.width,oe=(1*this.height-this.height*this.padding*2/100)/le.height;ve=Math.min(pe,oe)}return ve},ce.prototype.getTextPosition=function(le){var ve=this.textElement.getBBox(),pe=0,oe=0;return ve.width>0&&ve.height>0&&(pe=(this.width-ve.width*le)/2,oe=this.height/2-ve.height*le/2),{x:pe,y:oe}},ce.prototype.sizeText=function(){var le=this.textElement.getBBox(),ve=this.getTextScale(),pe=this.getTextPosition(ve);pe.y-=le.y*ve,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+pe.x+"px, "+pe.y+"px) scale("+ve+", "+ve+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(pe.x,pe.y),this.textElement.transform.baseVal.getItem(1).setScale(ve,ve))},ce.prototype.manipulate=function(le){ke.prototype.manipulate.call(this,le),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(le.x-this.pointerDownPoint.x)>5||Math.abs(le.y-this.pointerDownPoint.y)>5)},ce.prototype.resize=function(le){ke.prototype.resize.call(this,le),this.isMoved=!0,this.setSize(),this.sizeText()},ce.prototype.setSize=function(){ke.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(Ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Ce.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},ce.prototype.pointerUp=function(le){var ve=this.state;ve==="creating"&&(this._suppressMarkerCreateEvent=!0),ke.prototype.pointerUp.call(this,le),this.setSize(),(ve==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},ce.prototype.showTextEditor=function(){var le=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(ve){ve.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var ve=Number.parseFloat(le.textEditor.style.fontSize);le.textEditor.clientWidth>=Number.parseInt(le.textEditor.style.maxWidth)&&ve>.9;)ve-=.1,le.textEditor.style.fontSize=Math.max(ve,.9)+"em"}),this.textEditor.addEventListener("keyup",function(ve){ve.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(ve){if(ve.clipboardData){var pe=ve.clipboardData.getData("text"),oe=window.getSelection();if(!oe.rangeCount)return!1;oe.deleteFromDocument(),oe.getRangeAt(0).insertNode(document.createTextNode(pe)),ve.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){le.textEditDivClicked(le.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},ce.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var le=this.getTextScale(),ve=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),pe=this.textElement.getBBox(),oe={x:pe.width*le,y:pe.height*le};ve.x-=oe.x/2,ve.y-=oe.y/2,this.textEditor.style.top=ve.y+"px",this.textEditor.style.left=ve.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-ve.x+"px",this.textEditor.style.fontSize=Math.max(16*le,12)+"px",this.textElement.style.display="none"}},ce.prototype.textEditDivClicked=function(le){this.text=le.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},ce.prototype.select=function(){ke.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},ce.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ke.prototype.deselect.call(this)},ce.prototype.dblClick=function(le,ve){ke.prototype.dblClick.call(this,le,ve),this.showTextEditor()},ce.prototype.setColor=function(le){this.textElement&&Ce.setAttributes(this.textElement,[["fill",le]]),this.color=le,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(le)},ce.prototype.setFont=function(le){this.textElement&&Ce.setAttributes(this.textElement,[["font-family",le]]),this.fontFamily=le,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},ce.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},ce.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},ke.prototype.getState.call(this));return le.typeName=ce.typeName,le},ce.prototype.restoreState=function(le){var ve=le;this.color=ve.color,this.fontFamily=ve.fontFamily,this.padding=ve.padding,this.text=ve.text,this.createVisual(),ke.prototype.restoreState.call(this,le),this.setSize()},ce.prototype.scale=function(le,ve){ke.prototype.scale.call(this,le,ve),this.setSize(),this.sizeText(),this.positionTextEditor()},ce.typeName="TextMarker",ce.title="Text marker",ce.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',ce}(lt),kt=function(ke){function ce(le,ve,pe){var oe=ke.call(this,le,ve,pe)||this;return oe.color="transparent",oe.lineWidth=3,oe.drawing=!1,oe.pixelRatio=1,oe.color=pe.defaultColor,oe.lineWidth=pe.defaultStrokeWidth,oe.pixelRatio=pe.freehandPixelRatio,oe.setColor=oe.setColor.bind(oe),oe.addCanvas=oe.addCanvas.bind(oe),oe.finishCreation=oe.finishCreation.bind(oe),oe.setLineWidth=oe.setLineWidth.bind(oe),oe.colorPanel=new Xe("Color",pe.defaultColorSet,pe.defaultColor),oe.colorPanel.onColorChanged=oe.setColor,oe.lineWidthPanel=new _e("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),oe.lineWidthPanel.onWidthChanged=oe.setLineWidth,oe}return tt(ce,ke),ce.prototype.ownsTarget=function(le){return!(!ke.prototype.ownsTarget.call(this,le)&&le!==this.visual&&le!==this.drawingImage)},ce.prototype.createVisual=function(){this.visual=Ce.createGroup(),this.drawingImage=Ce.createImage(),this.visual.appendChild(this.drawingImage);var le=Ce.createTransform();this.visual.transform.baseVal.appendItem(le),this.addMarkerVisualToContainer(this.visual)},ce.prototype.pointerDown=function(le,ve){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(le.x,le.y),this.drawing=!0):ke.prototype.pointerDown.call(this,le,ve)},ce.prototype.manipulate=function(le){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(le.x,le.y),this.canvasContext.stroke()):ke.prototype.manipulate.call(this,le)},ce.prototype.resize=function(le){ke.prototype.resize.call(this,le),Ce.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Ce.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},ce.prototype.pointerUp=function(le){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):ke.prototype.pointerUp.call(this,le)},ce.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},ce.prototype.select=function(){this.state==="creating"&&this.finishCreation(),ke.prototype.select.call(this)},ce.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ke.prototype.deselect.call(this)},ce.prototype.finishCreation=function(){for(var le=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),ve=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],pe=ve[0],oe=ve[1],ze=ve[2],yt=ve[3],Vt=!1,en=0;en<this.canvasElement.height;en++)for(var un=0;un<this.canvasElement.width;un++)le.data[en*this.canvasElement.width*4+4*un+3]>0&&(Vt=!0,en<oe&&(oe=en),un<pe&&(pe=un),en>yt&&(yt=en),un>ze&&(ze=un));if(Vt){this.left=pe/this.pixelRatio,this.top=oe/this.pixelRatio,this.width=(ze-pe)/this.pixelRatio,this.height=(yt-oe)/this.pixelRatio;var yn=document.createElement("canvas");yn.width=ze-pe,yn.height=yt-oe,yn.getContext("2d").putImageData(this.canvasContext.getImageData(pe,oe,ze-pe,yt-oe),0,0),this.drawingImgUrl=yn.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},ce.prototype.setDrawingImage=function(){Ce.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),Ce.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},ce.prototype.setColor=function(le){this.color=le,this.colorChanged(le)},ce.prototype.setLineWidth=function(le){this.lineWidth=le},Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=Object.assign({drawingImgUrl:this.drawingImgUrl},ke.prototype.getState.call(this));return le.typeName=ce.typeName,le},ce.prototype.restoreState=function(le){this.createVisual(),ke.prototype.restoreState.call(this,le),this.drawingImgUrl=le.drawingImgUrl,this.setDrawingImage()},ce.prototype.scale=function(le,ve){ke.prototype.scale.call(this,le,ve),this.setDrawingImage()},ce.typeName="FreehandMarker",ce.title="Freehand marker",ce.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',ce}(lt),vn=function(ke){function ce(le,ve,pe){var oe=ke.call(this,le,pe||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return oe.typeBoxes=[],oe.currentType=ve,oe.setCurrentType=oe.setCurrentType.bind(oe),oe}return tt(ce,ke),ce.prototype.getUi=function(){var le=this,ve=document.createElement("div");ve.style.display="flex",ve.style.overflow="hidden",ve.style.flexGrow="2";for(var pe=function(yt){var Vt="both";switch(yt){case 0:Vt="both";break;case 1:Vt="start";break;case 2:Vt="end";break;case 3:Vt="none"}var en=document.createElement("div");if(en.style.display="flex",en.style.flexGrow="2",en.style.alignItems="center",en.style.justifyContent="space-between",en.style.padding="5px",en.style.borderWidth="2px",en.style.borderStyle="solid",en.style.borderColor=Vt===oe.currentType?oe.uiStyleSettings.toolboxAccentColor:"transparent",en.addEventListener("click",function(){le.setCurrentType(Vt,en)}),ve.appendChild(en),Vt==="both"||Vt==="start"){var un=document.createElement("div");un.style.display="flex",un.style.alignItems="center",un.style.minHeight="20px",un.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(oe.uiStyleSettings!==void 0?oe.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,un.style.marginLeft="5px",en.appendChild(un)}var yn=document.createElement("div");yn.style.display="flex",yn.style.alignItems="center",yn.style.minHeight="20px",yn.style.flexGrow="2";var Jt=document.createElement("hr");if(Jt.style.minWidth="20px",Jt.style.border="0px",Jt.style.borderTop="3px solid "+(oe.uiStyleSettings!==void 0?oe.uiStyleSettings.toolboxColor:"#eeeeee"),Jt.style.flexGrow="2",yn.appendChild(Jt),en.appendChild(yn),Vt==="both"||Vt==="end"){var Cr=document.createElement("div");Cr.style.display="flex",Cr.style.alignItems="center",Cr.style.minHeight="20px",Cr.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(oe.uiStyleSettings!==void 0?oe.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Cr.style.marginRight="5px",en.appendChild(Cr)}oe.typeBoxes.push(en)},oe=this,ze=0;ze<4;ze++)pe(ze);return ve},ce.prototype.setCurrentType=function(le,ve){var pe=this;this.currentType=le,this.typeBoxes.forEach(function(oe){oe.style.borderColor=oe===ve?pe.uiStyleSettings!==void 0?pe.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},ce}(Qe),qt=function(ke){function ce(le,ve,pe){var oe=ke.call(this,le,ve,pe)||this;return oe.arrowType="end",oe.arrowBaseHeight=10,oe.arrowBaseWidth=10,oe.getArrowPoints=oe.getArrowPoints.bind(oe),oe.setArrowType=oe.setArrowType.bind(oe),oe.arrowTypePanel=new vn("Arrow type","end"),oe.arrowTypePanel.onArrowTypeChanged=oe.setArrowType,oe}return tt(ce,ke),ce.prototype.ownsTarget=function(le){return!(!ke.prototype.ownsTarget.call(this,le)&&le!==this.arrow1&&le!==this.arrow2)},ce.prototype.getArrowPoints=function(le,ve){var pe=this.arrowBaseWidth+2*this.strokeWidth,oe=this.arrowBaseHeight+2*this.strokeWidth;return le-pe/2+","+(ve+oe/2)+" "+le+","+(ve-oe/2)+" "+(le+pe/2)+","+(ve+oe/2)},ce.prototype.createTips=function(){this.arrow1=Ce.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(Ce.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=Ce.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(Ce.createTransform()),this.visual.appendChild(this.arrow2)},ce.prototype.pointerDown=function(le,ve){ke.prototype.pointerDown.call(this,le,ve),this.state==="creating"&&this.createTips()},ce.prototype.adjustVisual=function(){if(ke.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2){this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",Ce.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),Ce.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var le=0;Math.abs(this.x1-this.x2)>.1&&(le=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var ve=this.arrow1.transform.baseVal.getItem(0);ve.setRotate(le,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(ve,0);var pe=this.arrow2.transform.baseVal.getItem(0);pe.setRotate(le+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(pe,0)}},ce.prototype.setArrowType=function(le){this.arrowType=le,this.adjustVisual(),this.stateChanged()},Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=Object.assign({arrowType:this.arrowType},ke.prototype.getState.call(this));return le.typeName=ce.typeName,le},ce.prototype.restoreState=function(le){ke.prototype.restoreState.call(this,le);var ve=le;this.arrowType=ve.arrowType,this.createTips(),this.adjustVisual()},ce.typeName="ArrowMarker",ce.title="Arrow marker",ce.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',ce}(xt),cn=function(ke){function ce(le,ve,pe){var oe=ke.call(this,le,ve,pe)||this;return oe.fillColor=pe.defaultFillColor,oe.strokeWidth=0,oe.fillPanel=new Xe("Color",pe.defaultColorSet,pe.defaultFillColor),oe.fillPanel.onColorChanged=oe.setFillColor,oe}return tt(ce,ke),Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=ke.prototype.getState.call(this);return le.typeName=ce.typeName,le},ce.typeName="CoverMarker",ce.title="Cover marker",ce.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',ce}(Ie),An=function(ke){function ce(le,ve,pe,oe){var ze=ke.call(this,le,oe||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return ze.opacities=[],ze.opacityBoxes=[],ze.opacities=ve,ze.currentOpacity=pe,ze.setCurrentOpacity=ze.setCurrentOpacity.bind(ze),ze}return tt(ce,ke),ce.prototype.getUi=function(){var le=this,ve=document.createElement("div");return ve.style.display="flex",ve.style.overflow="hidden",ve.style.flexGrow="2",ve.style.justifyContent="space-between",this.opacities.forEach(function(pe){var oe=document.createElement("div");oe.style.display="flex",oe.style.alignItems="center",oe.style.justifyContent="center",oe.style.padding="5px",oe.style.borderWidth="2px",oe.style.borderStyle="solid",oe.style.borderColor=pe===le.currentOpacity?le.uiStyleSettings.toolboxAccentColor:"transparent",oe.addEventListener("click",function(){le.setCurrentOpacity(pe,oe)}),ve.appendChild(oe);var ze=document.createElement("div");ze.innerText=100*pe+"%",oe.appendChild(ze),le.opacityBoxes.push(oe)}),ve},ce.prototype.setCurrentOpacity=function(le,ve){var pe=this;this.currentOpacity=le,this.opacityBoxes.forEach(function(oe){oe.style.borderColor=oe===ve?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},ce}(Qe),Zn=function(ke){function ce(le,ve,pe){var oe=ke.call(this,le,ve,pe)||this;return oe.setOpacity=oe.setOpacity.bind(oe),oe.fillColor=pe.defaultHighlightColor,oe.strokeWidth=0,oe.opacity=pe.defaultHighlightOpacity,oe.fillPanel=new Xe("Color",pe.defaultColorSet,oe.fillColor),oe.fillPanel.onColorChanged=oe.setFillColor,oe.opacityPanel=new An("Opacity",pe.defaultOpacitySteps,oe.opacity),oe.opacityPanel.onOpacityChanged=oe.setOpacity,oe}return tt(ce,ke),ce.prototype.setOpacity=function(le){this.opacity=le,this.visual&&Ce.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=ke.prototype.getState.call(this);return le.typeName=ce.typeName,le},ce.typeName="HighlightMarker",ce.title="Highlight marker",ce.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',ce}(cn),Ye='<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>',Ee='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',Tt=function(ke){function ce(le,ve,pe){var oe=ke.call(this,le,ve,pe)||this;return oe.bgColor="transparent",oe.tipPosition={x:0,y:0},oe.tipBase1Position={x:0,y:0},oe.tipBase2Position={x:0,y:0},oe.tipMoving=!1,oe.color=pe.defaultStrokeColor,oe.bgColor=pe.defaultFillColor,oe.fontFamily=pe.defaultFontFamily,oe.defaultSize={x:100,y:30},oe.setBgColor=oe.setBgColor.bind(oe),oe.getTipPoints=oe.getTipPoints.bind(oe),oe.positionTip=oe.positionTip.bind(oe),oe.setTipPoints=oe.setTipPoints.bind(oe),oe.colorPanel=new Xe("Text color",pe.defaultColorSet,oe.color,Ye),oe.colorPanel.onColorChanged=oe.setColor,oe.bgColorPanel=new Xe("Fill color",pe.defaultColorSet,oe.bgColor,Ee),oe.bgColorPanel.onColorChanged=oe.setBgColor,oe.fontFamilyPanel=new Ge("Font",pe.defaultFontFamilies,pe.defaultFontFamily),oe.fontFamilyPanel.onFontChanged=oe.setFont,oe.tipGrip=new Lt,oe.tipGrip.visual.transform.baseVal.appendItem(Ce.createTransform()),oe.controlBox.appendChild(oe.tipGrip.visual),oe}return tt(ce,ke),ce.prototype.ownsTarget=function(le){return ke.prototype.ownsTarget.call(this,le)||this.tipGrip.ownsTarget(le)||this.tip===le},ce.prototype.createTip=function(){Ce.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=Ce.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},ce.prototype.pointerDown=function(le,ve){this.state==="new"&&ke.prototype.pointerDown.call(this,le,ve),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(ve)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ke.prototype.pointerDown.call(this,le,ve)},ce.prototype.pointerUp=function(le){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ke.prototype.pointerUp.call(this,le);else{var ve=this.state==="creating";ke.prototype.pointerUp.call(this,le),this.setTipPoints(ve),this.positionTip()}},ce.prototype.manipulate=function(le){if(this.tipMoving){var ve=this.unrotatePoint(le);this.tipPosition={x:ve.x-this.manipulationStartLeft,y:ve.y-this.manipulationStartTop},this.positionTip()}else ke.prototype.manipulate.call(this,le)},ce.prototype.setBgColor=function(le){this.bgRectangle&&this.tip&&(Ce.setAttributes(this.bgRectangle,[["fill",le]]),Ce.setAttributes(this.tip,[["fill",le]])),this.bgColor=le,this.fillColorChanged(le)},ce.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},ce.prototype.setTipPoints=function(le){le===void 0&&(le=!1);var ve=Math.min(this.height/2,15),pe=this.height/5;le&&(this.tipPosition={x:ve+pe/2,y:this.height+20});var oe=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?oe<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(pe=this.width/5,ve=Math.min(this.width/2,15),this.tipBase1Position={x:ve,y:0},this.tipBase2Position={x:ve+pe,y:0}):(this.tipBase1Position={x:0,y:ve},this.tipBase2Position={x:0,y:ve+pe}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?oe<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(pe=this.width/5,ve=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ve-pe,y:0},this.tipBase2Position={x:this.width-ve,y:0}):(this.tipBase1Position={x:this.width,y:ve},this.tipBase2Position={x:this.width,y:ve+pe}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?oe<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(pe=this.width/5,ve=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ve-pe,y:this.height},this.tipBase2Position={x:this.width-ve,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-ve-pe},this.tipBase2Position={x:this.width,y:this.height-ve}):oe<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(pe=this.width/5,ve=Math.min(this.width/2,15),this.tipBase1Position={x:ve,y:this.height},this.tipBase2Position={x:ve+pe,y:this.height}):(this.tipBase1Position={x:0,y:this.height-ve},this.tipBase2Position={x:0,y:this.height-ve-pe})},ce.prototype.resize=function(le){ke.prototype.resize.call(this,le),this.positionTip()},ce.prototype.positionTip=function(){Ce.setAttributes(this.tip,[["points",this.getTipPoints()]]);var le=this.tipGrip.visual.transform.baseVal.getItem(0);le.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(le,0)},Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),ce.prototype.select=function(){this.positionTip(),ke.prototype.select.call(this)},ce.prototype.getState=function(){var le=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},ke.prototype.getState.call(this));return le.typeName=ce.typeName,le},ce.prototype.restoreState=function(le){var ve=le;this.bgColor=ve.bgColor,this.tipPosition=ve.tipPosition,ke.prototype.restoreState.call(this,le),this.createTip(),this.setTipPoints()},ce.prototype.scale=function(le,ve){ke.prototype.scale.call(this,le,ve),this.tipPosition={x:this.tipPosition.x*le,y:this.tipPosition.y*ve},this.positionTip()},ce.typeName="CalloutMarker",ce.title="Callout marker",ce.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',ce}(Ot),gn=function(ke){function ce(le,ve,pe){var oe=ke.call(this,le,ve,pe)||this;return oe.fillColor="transparent",oe.strokeColor="transparent",oe.strokeWidth=0,oe.strokeDasharray="",oe.opacity=1,oe.strokeColor=pe.defaultColor,oe.strokeWidth=pe.defaultStrokeWidth,oe.strokeDasharray=pe.defaultStrokeDasharray,oe.fillColor=pe.defaultFillColor,oe.setStrokeColor=oe.setStrokeColor.bind(oe),oe.setFillColor=oe.setFillColor.bind(oe),oe.setStrokeWidth=oe.setStrokeWidth.bind(oe),oe.setStrokeDasharray=oe.setStrokeDasharray.bind(oe),oe.setOpacity=oe.setOpacity.bind(oe),oe.createVisual=oe.createVisual.bind(oe),oe.strokePanel=new Xe("Line color",ye(pe.defaultColorSet,["transparent"]),pe.defaultColor),oe.strokePanel.onColorChanged=oe.setStrokeColor,oe.fillPanel=new Xe("Fill color",ye(pe.defaultColorSet,["transparent"]),oe.fillColor,Ee),oe.fillPanel.onColorChanged=oe.setFillColor,oe.strokeWidthPanel=new _e("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),oe.strokeWidthPanel.onWidthChanged=oe.setStrokeWidth,oe.strokeStylePanel=new Ue("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),oe.strokeStylePanel.onStyleChanged=oe.setStrokeDasharray,oe.opacityPanel=new An("Opacity",pe.defaultOpacitySteps,oe.opacity),oe.opacityPanel.onOpacityChanged=oe.setOpacity,oe}return tt(ce,ke),ce.prototype.ownsTarget=function(le){return!(!ke.prototype.ownsTarget.call(this,le)&&le!==this.visual)},ce.prototype.createVisual=function(){this.visual=Ce.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},ce.prototype.pointerDown=function(le,ve){ke.prototype.pointerDown.call(this,le,ve),this.state==="new"&&(this.createVisual(),this.moveVisual(le),this._state="creating")},ce.prototype.manipulate=function(le){ke.prototype.manipulate.call(this,le)},ce.prototype.resize=function(le){ke.prototype.resize.call(this,le),this.setSize()},ce.prototype.setSize=function(){ke.prototype.setSize.call(this),Ce.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},ce.prototype.pointerUp=function(le){ke.prototype.pointerUp.call(this,le),this.setSize()},ce.prototype.setStrokeColor=function(le){this.strokeColor=le,this.visual&&Ce.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(le),this.stateChanged()},ce.prototype.setFillColor=function(le){this.fillColor=le,this.visual&&Ce.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(le),this.stateChanged()},ce.prototype.setStrokeWidth=function(le){this.strokeWidth=le,this.visual&&Ce.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},ce.prototype.setStrokeDasharray=function(le){this.strokeDasharray=le,this.visual&&Ce.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},ce.prototype.setOpacity=function(le){this.opacity=le,this.visual&&Ce.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ke.prototype.getState.call(this));return le.typeName=ce.typeName,le},ce.prototype.restoreState=function(le){var ve=le;this.fillColor=ve.fillColor,this.strokeColor=ve.strokeColor,this.strokeWidth=ve.strokeWidth,this.strokeDasharray=ve.strokeDasharray,this.opacity=ve.opacity,this.createVisual(),ke.prototype.restoreState.call(this,le),this.setSize()},ce.prototype.scale=function(le,ve){ke.prototype.scale.call(this,le,ve),this.setSize()},ce.typeName="EllipseMarker",ce.title="Ellipse marker",ce.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',ce}(lt),Xt=function(ke){function ce(le,ve,pe){return ke.call(this,le,ve,pe)||this}return tt(ce,ke),Object.defineProperty(ce.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),ce.prototype.ownsTarget=function(le){return!(!ke.prototype.ownsTarget.call(this,le)&&le!==this.tip1&&le!==this.tip2)},ce.prototype.createTips=function(){this.tip1=Ce.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(Ce.createTransform()),this.visual.appendChild(this.tip1),this.tip2=Ce.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(Ce.createTransform()),this.visual.appendChild(this.tip2)},ce.prototype.pointerDown=function(le,ve){ke.prototype.pointerDown.call(this,le,ve),this.state==="creating"&&this.createTips()},ce.prototype.adjustVisual=function(){if(ke.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(Ce.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Ce.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var le=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ve=this.tip1.transform.baseVal.getItem(0);ve.setRotate(le,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(ve,0);var pe=this.tip2.transform.baseVal.getItem(0);pe.setRotate(le+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(pe,0)}},Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=ke.prototype.getState.call(this);return le.typeName=ce.typeName,le},ce.prototype.restoreState=function(le){ke.prototype.restoreState.call(this,le),this.createTips(),this.adjustVisual()},ce.typeName="MeasurementMarker",ce.title="Measurement marker",ce.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',ce}(xt),Je=function(ke){function ce(le,ve,pe){var oe=ke.call(this,le,ve,pe)||this;return oe.strokePanel.colors=pe.defaultColorSet,oe.fillColor="transparent",oe}return tt(ce,ke),Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=ke.prototype.getState.call(this);return le.typeName=ce.typeName,le},ce.typeName="EllipseFrameMarker",ce.title="Ellipse frame marker",ce.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',ce}(gn),rt=function(){function ke(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(ke.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ke.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ke.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(ke.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),ke.prototype.addUndoStep=function(ce){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(ce)||(this.undoStack.push(ce),JSON.stringify(this.lastRedoStep)!==JSON.stringify(ce)&&this.redoStack.splice(0,this.redoStack.length))},ke.prototype.replaceLastUndoStep=function(ce){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=ce)},ke.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},ke.prototype.undo=function(){if(this.undoStack.length>1){var ce=this.undoStack.pop();return ce!==void 0&&this.redoStack.push(ce),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},ke.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},ke}(),Ht=function(ke){function ce(le,ve,pe){var oe=ke.call(this,le,ve,pe)||this;return oe.strokeColor="transparent",oe.strokeWidth=0,oe.strokeDasharray="",oe.curveX=0,oe.curveY=0,oe.manipulationStartCurveX=0,oe.manipulationStartCurveY=0,oe.setStrokeColor=oe.setStrokeColor.bind(oe),oe.setStrokeWidth=oe.setStrokeWidth.bind(oe),oe.setStrokeDasharray=oe.setStrokeDasharray.bind(oe),oe.positionGrips=oe.positionGrips.bind(oe),oe.addControlGrips=oe.addControlGrips.bind(oe),oe.adjustVisual=oe.adjustVisual.bind(oe),oe.setupControlBox=oe.setupControlBox.bind(oe),oe.resize=oe.resize.bind(oe),oe.strokeColor=pe.defaultColor,oe.strokeWidth=pe.defaultStrokeWidth,oe.strokeDasharray=pe.defaultStrokeDasharray,oe.strokePanel=new Xe("Line color",pe.defaultColorSet,pe.defaultColor),oe.strokePanel.onColorChanged=oe.setStrokeColor,oe.strokeWidthPanel=new _e("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),oe.strokeWidthPanel.onWidthChanged=oe.setStrokeWidth,oe.strokeStylePanel=new Ue("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),oe.strokeStylePanel.onStyleChanged=oe.setStrokeDasharray,oe}return tt(ce,ke),ce.prototype.ownsTarget=function(le){return!(!ke.prototype.ownsTarget.call(this,le)&&le!==this.visual&&le!==this.selectorCurve&&le!==this.visibleCurve&&!this.curveGrip.ownsTarget(le))},ce.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},ce.prototype.createVisual=function(){this.visual=Ce.createGroup(),this.selectorCurve=Ce.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=Ce.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},ce.prototype.pointerDown=function(le,ve){ke.prototype.pointerDown.call(this,le,ve),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=le.x,this.curveY=le.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(ve)&&(this.activeGrip=this.curveGrip,this._state="resize")},ce.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),Ce.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),Ce.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),Ce.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},ce.prototype.setupControlBox=function(){ke.prototype.setupControlBox.call(this),this.curveControlLine1=Ce.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=Ce.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},ce.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,ke.prototype.addControlGrips.call(this)},ce.prototype.positionGrips=function(){ke.prototype.positionGrips.call(this);var le=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-le/2,this.curveY-le/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},ce.prototype.manipulate=function(le){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+le.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+le.y-this.manipulationStartY),ke.prototype.manipulate.call(this,le)},ce.prototype.resize=function(le){this.activeGrip===this.curveGrip&&(this.curveX=le.x,this.curveY=le.y),ke.prototype.resize.call(this,le),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},ce.prototype.setStrokeColor=function(le){this.strokeColor=le,this.adjustVisual(),this.colorChanged(le)},ce.prototype.setStrokeWidth=function(le){this.strokeWidth=le,this.adjustVisual()},ce.prototype.setStrokeDasharray=function(le){this.strokeDasharray=le,this.adjustVisual()},ce.prototype.scale=function(le,ve){this.curveX=this.curveX*le,this.curveY=this.curveY*ve,ke.prototype.scale.call(this,le,ve)},Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},ke.prototype.getState.call(this));return le.typeName=ce.typeName,le},ce.prototype.restoreState=function(le){ke.prototype.restoreState.call(this,le);var ve=le;this.strokeColor=ve.strokeColor,this.strokeWidth=ve.strokeWidth,this.strokeDasharray=ve.strokeDasharray,this.curveX=ve.curveX,this.curveY=ve.curveY,this.createVisual(),this.adjustVisual()},ce.typeName="CurveMarker",ce.title="Curve marker",ce.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',ce}(bt),Sn=function(ke){function ce(le,ve,pe){var oe=ke.call(this,le,ve,pe)||this;return oe.fillColor="transparent",oe.strokeColor="transparent",oe.strokeWidth=0,oe.strokeDasharray="",oe.textColor="transparent",oe.fontSize="1rem",oe.isMoved=!1,oe.captionText="Caption",oe.PADDING=5,oe.captionBoxWidth=0,oe.captionBoxHeight=0,oe.strokeColor=pe.defaultColor,oe.strokeWidth=pe.defaultStrokeWidth,oe.strokeDasharray=pe.defaultStrokeDasharray,oe.fillColor=pe.defaultFillColor,oe.textColor=pe.defaultStrokeColor,oe.fontFamily=pe.defaultFontFamily,oe.fontSize=pe.defaultCaptionFontSize,oe.captionText=pe.defaultCaptionText,oe.setStrokeColor=oe.setStrokeColor.bind(oe),oe.setFillColor=oe.setFillColor.bind(oe),oe.setStrokeWidth=oe.setStrokeWidth.bind(oe),oe.setStrokeDasharray=oe.setStrokeDasharray.bind(oe),oe.createVisual=oe.createVisual.bind(oe),oe.sizeCaption=oe.sizeCaption.bind(oe),oe.setCaptionText=oe.setCaptionText.bind(oe),oe.showTextEditor=oe.showTextEditor.bind(oe),oe.positionTextEditor=oe.positionTextEditor.bind(oe),oe.finishTextEditing=oe.finishTextEditing.bind(oe),oe.setFont=oe.setFont.bind(oe),oe.setTextColor=oe.setTextColor.bind(oe),oe.strokePanel=new Xe("Line color",ye(pe.defaultColorSet,["transparent"]),oe.strokeColor),oe.strokePanel.onColorChanged=oe.setStrokeColor,oe.fillPanel=new Xe("Fill color",ye(pe.defaultColorSet,["transparent"]),oe.fillColor,Ee),oe.fillPanel.onColorChanged=oe.setFillColor,oe.strokeWidthPanel=new _e("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),oe.strokeWidthPanel.onWidthChanged=oe.setStrokeWidth,oe.strokeStylePanel=new Ue("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),oe.strokeStylePanel.onStyleChanged=oe.setStrokeDasharray,oe.fontFamilyPanel=new Ge("Font",pe.defaultFontFamilies,pe.defaultFontFamily),oe.fontFamilyPanel.onFontChanged=oe.setFont,oe.textColorPanel=new Xe("Text color",pe.defaultColorSet,oe.textColor,Ye),oe.textColorPanel.onColorChanged=oe.setTextColor,oe}return tt(ce,ke),ce.prototype.ownsTarget=function(le){return!(!ke.prototype.ownsTarget.call(this,le)&&le!==this.visual&&le!==this.frame&&le!==this.captionBg&&le!==this.captionElement)},ce.prototype.createVisual=function(){this.visual=Ce.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=Ce.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=Ce.createText([["fill",this.textColor],["font-family",this.fontFamily]]),this.captionElement.style.fontSize=this.fontSize,this.captionElement.style.textAnchor="start",this.captionElement.style.dominantBaseline="text-before-edge",this.captionElement.textContent=this.captionText,this.visual.appendChild(this.captionElement),this.frame=Ce.createRect(this.width,this.height,[["fill","transparent"],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray]]),this.visual.appendChild(this.frame),this.sizeCaption()},ce.prototype.setCaptionText=function(le){this.captionText=le,this.captionElement.textContent=this.captionText,this.sizeCaption()},ce.prototype.pointerDown=function(le,ve){ke.prototype.pointerDown.call(this,le,ve),this.isMoved=!1,this.pointerDownPoint=le,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(le),this._state="creating")},ce.prototype.manipulate=function(le){ke.prototype.manipulate.call(this,le),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(le.x-this.pointerDownPoint.x)>5||Math.abs(le.y-this.pointerDownPoint.y)>5)},ce.prototype.resize=function(le){ke.prototype.resize.call(this,le),this.setSize()},ce.prototype.sizeCaption=function(){var le=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=le.width+2*this.PADDING,this.captionBoxHeight=le.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),Ce.setAttributes(this.captionBg,[["width",this.captionBoxWidth.toString()],["height",this.captionBoxHeight.toString()],["clip-path","path('M0,0 H"+this.width+" V"+this.height+" H"+-this.width+" Z')"]]),Ce.setAttributes(this.captionElement,[["x",this.PADDING.toString()],["y",this.PADDING.toString()],["clip-path","path('M0,0 H"+(this.width-this.PADDING)+" V"+this.height+" H"+(-this.width-this.PADDING)+" Z')"]])},ce.prototype.showTextEditor=function(){var le=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditBox=document.createElement("input"),this.textEditBox.style.position="absolute",this.textEditBox.style.width=this.width+"px",this.captionBoxHeight>0&&(this.textEditBox.style.height=this.captionBoxHeight+"px"),this.textEditBox.style.fontSize=this.fontSize,this.textEditBox.style.fontFamily=this.fontFamily,this.textEditBox.style.backgroundColor=this.fillColor,this.textEditBox.style.color=this.textColor,this.textEditBox.style.borderWidth="0",this.textEditBox.setAttribute("value",this.captionText),this.textEditBox.select(),this.textEditDiv.appendChild(this.textEditBox),this.overlayContainer.appendChild(this.textEditDiv),this.textEditBox.addEventListener("pointerup",function(ve){ve.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(ve){ve.key==="Enter"&&le.finishTextEditing(le.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(ve){ve.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){le.finishTextEditing(le.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){le.finishTextEditing(le.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},ce.prototype.positionTextEditor=function(){this.state==="edit"&&(this.textEditBox===void 0?this.showTextEditor():(this.textEditBox.style.left=this.left+"px",this.textEditBox.style.top=this.top+"px",this.textEditBox.style.transform="rotate("+this.rotationAngle+"deg)",this.textEditBox.style.transformOrigin=this.width/2+"px "+this.height/2+"px"))},ce.prototype.finishTextEditing=function(le){this.setCaptionText(le.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},ce.prototype.setFont=function(le){this.captionElement&&Ce.setAttributes(this.captionElement,[["font-family",le]]),this.fontFamily=le,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},ce.prototype.setTextColor=function(le){this.captionElement&&Ce.setAttributes(this.captionElement,[["fill",le]]),this.textColor=le,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},ce.prototype.setSize=function(){ke.prototype.setSize.call(this),Ce.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},ce.prototype.pointerUp=function(le){ke.prototype.pointerUp.call(this,le),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},ce.prototype.dblClick=function(le,ve){ke.prototype.dblClick.call(this,le,ve),this.showTextEditor()},ce.prototype.setStrokeColor=function(le){this.strokeColor=le,this.frame&&Ce.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(le),this.stateChanged()},ce.prototype.setFillColor=function(le){this.fillColor=le,this.captionBg&&Ce.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(le),this.stateChanged()},ce.prototype.setStrokeWidth=function(le){this.strokeWidth=le,this.frame&&Ce.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},ce.prototype.setStrokeDasharray=function(le){this.strokeDasharray=le,this.frame&&Ce.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(ce.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),ce.prototype.getState=function(){var le=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:1,textColor:this.textColor,fontFamily:this.fontFamily,fontSize:this.fontSize,captionText:this.captionText},ke.prototype.getState.call(this));return le.typeName=this.typeName,le},ce.prototype.restoreState=function(le){var ve=le;this.fillColor=ve.fillColor,this.strokeColor=ve.strokeColor,this.strokeWidth=ve.strokeWidth,this.strokeDasharray=ve.strokeDasharray,this.textColor=ve.textColor,this.fontFamily=ve.fontFamily,this.captionText=ve.captionText,this.fontSize=ve.fontSize,this.createVisual(),ke.prototype.restoreState.call(this,le),this.setSize()},ce.prototype.scale=function(le,ve){ke.prototype.scale.call(this,le,ve),this.setSize()},ce.typeName="CaptionFrameMarker",ce.title="Caption frame marker",ce.icon='<svg viewBox="0 0 24 24"><path d="M5 3c-1.11 0-2 .89-2 2v14c0 1.11.89 2 2 2h14c1.11 0 2-.89 2-2V5c0-1.11-.89-2-2-2H5m0 2h14v14H5V5m2 2v2h10V7H7z"/></svg>',ce}(lt),sn=function(){function ke(ce,le){le===void 0&&(le=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=ce,this.cancelable=le}return Object.defineProperty(ke.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ke.prototype.preventDefault=function(){this._defaultPrevented=!0},ke}(),$t=function(ke){function ce(le,ve,pe){var oe=ke.call(this,le,!1)||this;return oe.dataUrl=ve,oe.state=pe,oe}return tt(ce,ke),ce}(sn),Bt=function(ke){function ce(le,ve,pe){pe===void 0&&(pe=!1);var oe=ke.call(this,le,pe)||this;return oe.marker=ve,oe}return tt(ce,ke),ce}(sn),bn=function(){function ke(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return ke.prototype.addEventListener=function(ce,le){this[ce].push(le)},ke.prototype.removeEventListener=function(ce,le){var ve=this[ce].indexOf(le);ve>-1&&this[ce].splice(ve,1)},ke}(),dn=function(){function ke(ce){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new At,this._isOpen=!1,this.undoRedoManager=new rt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new bn,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ke.instanceCounter++,this.styles=new De(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=ce,this.targetRoot=document.body,this.width=ce.clientWidth,this.height=ce.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(ke.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ze,kt,qt,Ot,Je,gn,Zn,Tt,Xt,cn,xt,Ht,Sn]},enumerable:!1,configurable:!0}),Object.defineProperty(ke.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ze,kt,qt,Ot,gn,Zn,Tt]},enumerable:!1,configurable:!0}),Object.defineProperty(ke.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ze,kt,qt,Ot,Zn]},enumerable:!1,configurable:!0}),Object.defineProperty(ke.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(ce){var le=this;this._availableMarkerTypes.splice(0),ce.forEach(function(ve){if(typeof ve=="string"){var pe=le.ALL_MARKER_TYPES.find(function(oe){return oe.typeName===ve});pe!==void 0&&le._availableMarkerTypes.push(pe)}else le._availableMarkerTypes.push(ve)})},enumerable:!1,configurable:!0}),Object.defineProperty(ke.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(ke.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ke.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ke.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ke.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(ce){this._zoomLevel=ce,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(ke.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),ke.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Me.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ke.prototype.show=function(){var ce=this;this.styles.styleSheetRoot===void 0&&he.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=he.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(le){return le(new sn(ce))})},ke.prototype.render=function(){return Fe(this,void 0,void 0,function(){var ce;return qe(this,function(le){switch(le.label){case 0:return this.setCurrentMarker(),(ce=new we).naturalSize=this.renderAtNaturalSize,ce.imageType=this.renderImageType,ce.imageQuality=this.renderImageQuality,ce.markersOnly=this.renderMarkersOnly,ce.width=this.renderWidth,ce.height=this.renderHeight,[4,ce.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return le.sent(),[4,ce.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,le.sent()]}})})},ke.prototype.close=function(ce){var le=this;if(ce===void 0&&(ce=!1),this.isOpen){var ve=!1;ce||this.eventListeners.beforeclose.forEach(function(pe){var oe=new sn(le,!0);pe(oe),oe.defaultPrevented&&(ve=!0)}),ve||(this.coverDiv&&this.closeUI(),this.targetObserver&&(this.targetObserver.unobserve(this.target),this.targetObserver.unobserve(this.editorCanvas)),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(pe){return pe(new sn(le))}),this.detachEvents(),this._isOpen=!1)}},ke.prototype.addMarkersToToolbar=function(){for(var ce,le=[],ve=0;ve<arguments.length;ve++)le[ve]=arguments[ve];(ce=this._availableMarkerTypes).push.apply(ce,le)},ke.prototype.addRenderEventListener=function(ce){this.addEventListener("render",function(le){ce(le.dataUrl,le.state)})},ke.prototype.removeRenderEventListener=function(ce){},ke.prototype.addCloseEventListener=function(ce){this.addEventListener("close",function(){ce()})},ke.prototype.removeCloseEventListener=function(ce){},ke.prototype.setupResizeObserver=function(){var ce=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){ce.resize(ce.target.clientWidth,ce.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return ce.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},ke.prototype.onPopupTargetResize=function(){var ce=1*this.target.clientWidth/this.target.clientHeight,le=this.editorCanvas.clientWidth/ce>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*ce:this.editorCanvas.clientWidth,ve=le<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/ce;this.resize(le,ve)},ke.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ke.prototype.resize=function(ce,le){this._isResizing=!0;var ve=ce/this.imageWidth,pe=le/this.imageHeight;this.imageWidth=Math.round(ce),this.imageHeight=Math.round(le),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(ve,pe),this._isResizing=!1},ke.prototype.scaleMarkers=function(ce,le){var ve,pe=this;this._currentMarker&&this._currentMarker instanceof Ot?this._currentMarker.scale(ce,le):(ve=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(oe){oe!==pe._currentMarker&&oe.scale(ce,le)}),ve!==void 0&&this.setCurrentMarker(ve)},ke.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},ke.prototype.setTopLeft=function(){var ce=this.editingTarget.getBoundingClientRect(),le=this.editorCanvas.getBoundingClientRect();this.left=ce.left-le.left,this.top=ce.top-le.top},ke.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},ke.prototype.addDefs=function(){for(var ce,le=[],ve=0;ve<arguments.length;ve++)le[ve]=arguments[ve];this.defs=Ce.createDefs(),this.addDefsToImage(),(ce=this.defs).append.apply(ce,le)},ke.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},ke.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},ke.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},ke.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},ke.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},ke.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},ke.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},ke.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var ce=document.createElement("a");ce.href="https://markerjs.com/",ce.target="_blank",ce.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',ce.title="Powered by marker.js",ce.style.display="grid",ce.style.alignItems="center",ce.style.justifyItems="center",ce.style.padding="3px",ce.style.width="20px",ce.style.height="20px",this.logoUI.appendChild(ce),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},ke.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},ke.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},ke.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ke.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var ce=this.settings.uiOffsetTop!==void 0?this.target.offsetTop+this.settings.uiOffsetTop:this.target.offsetTop>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=ce+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Mt(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.settings.uiOffsetTop===void 0&&this.target.offsetTop<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new ut(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},ke.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ke.prototype.removeMarker=function(ce){this.markerImage.removeChild(ce.container),this.markers.indexOf(ce)>-1&&this.markers.splice(this.markers.indexOf(ce),1),ce.dispose()},ke.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},ke.prototype.toolbarButtonClicked=function(ce,le){if(ce==="marker"&&le!==void 0)this.createNewMarker(le);else if(ce==="action")switch(le){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},ke.prototype.deleteSelectedMarker=function(){var ce=this;if(this._currentMarker!==void 0){var le=!1;if(this.eventListeners.markerbeforedelete.forEach(function(pe){var oe=new Bt(ce,ce._currentMarker,!0);pe(oe),oe.defaultPrevented&&(le=!0)}),!le){var ve=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(pe){return pe(new Bt(ce,ve))})}}},ke.prototype.clear=function(){var ce=this,le=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ze){var yt=new Bt(ce,void 0,!0);ze(yt),yt.defaultPrevented&&(le=!0)}),!le)){this.setCurrentMarker();for(var ve=function(ze){var yt=pe.markers[ze];pe.setCurrentMarker(pe.markers[ze]),pe._currentMarker.dispose(),pe.markerImage.removeChild(pe._currentMarker.container),pe.markers.splice(pe.markers.indexOf(pe._currentMarker),1),pe.eventListeners.markerdelete.forEach(function(Vt){return Vt(new Bt(ce,yt))})},pe=this,oe=this.markers.length-1;oe>=0;oe--)ve(oe);this.addUndoStep()}},Object.defineProperty(ke.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ke.prototype.showNotesEditor=function(){var ce;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(ce=this._currentMarker.notes)!==null&&ce!==void 0?ce:"",this.overlayContainer.appendChild(this.notesArea))},ke.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},ke.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},ke.prototype.addUndoStep=function(){var ce=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var le=this.getState(),ve=this.undoRedoManager.getLastUndoStep();if(!ve||ve.width===le.width&&ve.height===le.height){var pe=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(le),pe<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(oe){return oe(new sn(ce))})}else this.undoRedoManager.replaceLastUndoStep(le),this.eventListeners.statechange.forEach(function(oe){return oe(new sn(ce))})}},ke.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},ke.prototype.undoStep=function(){var ce=this,le=this.undoRedoManager.undo();le!==void 0&&(this.restoreState(le),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ve){return ve(new sn(ce))}))},ke.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},ke.prototype.redoStep=function(){var ce=this,le=this.undoRedoManager.redo();le!==void 0&&(this.restoreState(le),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ve){return ve(new sn(ce))}))},ke.prototype.stepZoom=function(){var ce=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=ce<this.zoomSteps.length-1?this.zoomSteps[ce+1]:this.zoomSteps[0]},ke.prototype.panTo=function(ce){this.contentDiv.scrollBy({left:this.prevPanPoint.x-ce.x,top:this.prevPanPoint.y-ce.y}),this.prevPanPoint=ce},ke.prototype.startRenderAndClose=function(){return Fe(this,void 0,void 0,function(){var ce,le,ve=this;return qe(this,function(pe){switch(pe.label){case 0:return[4,this.render()];case 1:return ce=pe.sent(),le=this.getState(),this.eventListeners.render.forEach(function(oe){return oe(new $t(ve,ce,le))}),this.close(!0),[2]}})})},ke.prototype.getState=function(ce){ce===!0&&this.setCurrentMarker();var le={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(ve){return le.markers.push(ve.getState())}),le},ke.prototype.restoreState=function(ce){var le=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);ce.markers.forEach(function(ve){var pe=le._availableMarkerTypes.find(function(ze){return ze.typeName===ve.typeName});if(pe!==void 0){var oe=le.addNewMarker(pe);oe.restoreState(ve),le.markers.push(oe)}}),ce.width&&ce.height&&(ce.width!==this.imageWidth||ce.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/ce.width,this.imageHeight/ce.height),this.eventListeners.restorestate.forEach(function(ve){return ve(new sn(le))})},ke.prototype.addNewMarker=function(ce){var le=Ce.createGroup();return this.markerImage.appendChild(le),new ce(le,this.overlayContainer,this.settings)},ke.prototype.createNewMarker=function(ce){var le,ve=this;(le=typeof ce=="string"?this._availableMarkerTypes.find(function(pe){return pe.typeName===ce}):ce)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(le),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(le.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(pe){return pe(new Bt(ve,ve._currentMarker))}))},ke.prototype.markerCreated=function(ce){var le=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(ce),this.setCurrentMarker(ce),ce instanceof kt&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(kt):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(ve){return ve(new Bt(le,le._currentMarker))})},ke.prototype.colorChanged=function(ce){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=ce,this.settings.defaultStrokeColor=ce)},ke.prototype.fillColorChanged=function(ce){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=ce)},ke.prototype.markerStateChanged=function(ce){var le=this;this.eventListeners.markerchange.forEach(function(ve){return ve(new Bt(le,ce))})},ke.prototype.setCurrentMarker=function(ce){var le=this;this._currentMarker!==ce&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(ve){return ve(new Bt(le,le._currentMarker))})),this._currentMarker=ce,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(ve){return ve(new Bt(le,le._currentMarker))}))},ke.prototype.onPointerDown=function(ce){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||ce.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var le=this.markers.find(function(ve){return ve.ownsTarget(ce.target)});le!==void 0?(this.setCurrentMarker(le),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(ce.clientX,ce.clientY),ce.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:ce.clientX,y:ce.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(ce.clientX,ce.clientY))},ke.prototype.onDblClick=function(ce){if(this._isFocused||this.focus(),this.mode==="select"){var le=this.markers.find(function(ve){return ve.ownsTarget(ce.target)});le!==void 0&&le!==this._currentMarker&&this.setCurrentMarker(le),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(ce.clientX,ce.clientY),ce.target):this.setCurrentMarker()}},ke.prototype.onPointerMove=function(ce){this.touchPoints!==1&&ce.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||ce.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(ce.clientX,ce.clientY)):this.zoomLevel>1&&this.panTo({x:ce.clientX,y:ce.clientY}))},ke.prototype.onPointerUp=function(ce){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(ce.clientX,ce.clientY)),this.isDragging=!1,this.addUndoStep()},ke.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ke.prototype.onKeyUp=function(ce){this._currentMarker===void 0||this.notesArea!==void 0||ce.key!=="Delete"&&ce.key!=="Backspace"||this.deleteSelectedMarker()},ke.prototype.clientToLocalCoordinates=function(ce,le){var ve=this.markerImage.getBoundingClientRect();return{x:(ce-ve.left)/this.zoomLevel,y:(le-ve.top)/this.zoomLevel}},ke.prototype.onWindowResize=function(){this.positionUI()},ke.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var ce=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=ce+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},ke.prototype.addLicenseKey=function(ce){Me.addKey(ce)},ke.prototype.addEventListener=function(ce,le){this.eventListeners.addEventListener(ce,le)},ke.prototype.removeEventListener=function(ce,le){this.eventListeners.removeEventListener(ce,le)},ke.prototype.renderState=function(ce){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(ce),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(ke.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ke.prototype.focus=function(){var ce=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(le){return le(new sn(ce))}))},ke.prototype.blur=function(){var ce=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(le){return le(new sn(ce))}))},ke.instanceCounter=0,ke}()},95860:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return et}});var be=ue(87462),tt=ue(1413),Fe=ue(4942),qe=ue(97685),ye=ue(45987),Ce=ue(94184),Me=ue.n(Ce),we=ue(67294);function he(lt){var Ie=we.useRef();Ie.current=lt;var _e=we.useCallback(function(){for(var Ue,Ze=arguments.length,At=new Array(Ze),bt=0;bt<Ze;bt++)At[bt]=arguments[bt];return(Ue=Ie.current)===null||Ue===void 0?void 0:Ue.call.apply(Ue,[Ie].concat(At))},[]);return _e}function De(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var ct=De()?we.useLayoutEffect:we.useEffect,Ne=function(Ie,_e){var Ue=we.useRef(!0);ct(function(){return Ie(Ue.current)},_e),ct(function(){return Ue.current=!1,function(){Ue.current=!0}},[])},Mt=function(Ie,_e){Ne(function(Ue){if(!Ue)return Ie()},_e)},ut=null;function Qe(lt){var Ie=we.useRef(!1),_e=we.useState(lt),Ue=(0,qe.Z)(_e,2),Ze=Ue[0],At=Ue[1];we.useEffect(function(){return Ie.current=!1,function(){Ie.current=!0}},[]);function bt(xt,Ge){Ge&&Ie.current||At(xt)}return[Ze,bt]}function Xe(lt){return lt!==void 0}function Te(lt,Ie){var _e=Ie||{},Ue=_e.defaultValue,Ze=_e.value,At=_e.onChange,bt=_e.postState,xt=Qe(function(){return Xe(Ze)?Ze:Xe(Ue)?typeof Ue=="function"?Ue():Ue:typeof lt=="function"?lt():lt}),Ge=(0,qe.Z)(xt,2),Ot=Ge[0],kt=Ge[1],vn=Ze!==void 0?Ze:Ot,qt=bt?bt(vn):vn,cn=he(At),An=Qe([vn]),Zn=(0,qe.Z)(An,2),Ye=Zn[0],Ee=Zn[1];Mt(function(){var gn=Ye[0];Ot!==gn&&cn(Ot,gn)},[Ye]),Mt(function(){Xe(Ze)||kt(Ze)},[Ze]);var Tt=he(function(gn,Xt){kt(gn,Xt),Ee([vn],Xt)});return[qt,Tt]}var Et=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],Lt=(0,we.forwardRef)(function(lt,Ie){var _e,Ue=lt.prefixCls,Ze=Ue===void 0?"rc-checkbox":Ue,At=lt.className,bt=lt.style,xt=lt.checked,Ge=lt.disabled,Ot=lt.defaultChecked,kt=Ot===void 0?!1:Ot,vn=lt.type,qt=vn===void 0?"checkbox":vn,cn=lt.title,An=lt.onChange,Zn=(0,ye.Z)(lt,Et),Ye=(0,we.useRef)(null),Ee=Te(kt,{value:xt}),Tt=(0,qe.Z)(Ee,2),gn=Tt[0],Xt=Tt[1];(0,we.useImperativeHandle)(Ie,function(){return{focus:function(){var Sn;(Sn=Ye.current)===null||Sn===void 0||Sn.focus()},blur:function(){var Sn;(Sn=Ye.current)===null||Sn===void 0||Sn.blur()},input:Ye.current}});var Je=Me()(Ze,At,(_e={},(0,Fe.Z)(_e,"".concat(Ze,"-checked"),gn),(0,Fe.Z)(_e,"".concat(Ze,"-disabled"),Ge),_e)),rt=function(Sn){Ge||("checked"in lt||Xt(Sn.target.checked),An==null||An({target:(0,tt.Z)((0,tt.Z)({},lt),{},{type:qt,checked:Sn.target.checked}),stopPropagation:function(){Sn.stopPropagation()},preventDefault:function(){Sn.preventDefault()},nativeEvent:Sn.nativeEvent}))};return we.createElement("span",{className:Je,title:cn,style:bt},we.createElement("input",(0,be.Z)({},Zn,{className:"".concat(Ze,"-input"),ref:Ye,onChange:rt,disabled:Ge,checked:!!gn,type:qt})),we.createElement("span",{className:"".concat(Ze,"-inner")}))}),et=Lt},26819:function(mn,Ut){"use strict";var ue;var be=typeof Symbol=="function"&&Symbol.for,tt=be?Symbol.for("react.element"):60103,Fe=be?Symbol.for("react.portal"):60106,qe=be?Symbol.for("react.fragment"):60107,ye=be?Symbol.for("react.strict_mode"):60108,Ce=be?Symbol.for("react.profiler"):60114,Me=be?Symbol.for("react.provider"):60109,we=be?Symbol.for("react.context"):60110,he=be?Symbol.for("react.async_mode"):60111,De=be?Symbol.for("react.concurrent_mode"):60111,ct=be?Symbol.for("react.forward_ref"):60112,Ne=be?Symbol.for("react.suspense"):60113,Mt=be?Symbol.for("react.suspense_list"):60120,ut=be?Symbol.for("react.memo"):60115,Qe=be?Symbol.for("react.lazy"):60116,Xe=be?Symbol.for("react.block"):60121,Te=be?Symbol.for("react.fundamental"):60117,Et=be?Symbol.for("react.responder"):60118,Lt=be?Symbol.for("react.scope"):60119;function et(Ie){if(typeof Ie=="object"&&Ie!==null){var _e=Ie.$$typeof;switch(_e){case tt:switch(Ie=Ie.type,Ie){case he:case De:case qe:case Ce:case ye:case Ne:return Ie;default:switch(Ie=Ie&&Ie.$$typeof,Ie){case we:case ct:case Qe:case ut:case Me:return Ie;default:return _e}}case Fe:return _e}}}function lt(Ie){return et(Ie)===De}ue=he,ue=De,ue=we,ue=Me,ue=tt,ue=ct,ue=qe,ue=Qe,ue=ut,ue=Fe,ue=Ce,ue=ye,ue=Ne,ue=function(Ie){return lt(Ie)||et(Ie)===he},ue=lt,ue=function(Ie){return et(Ie)===we},ue=function(Ie){return et(Ie)===Me},ue=function(Ie){return typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===tt},ue=function(Ie){return et(Ie)===ct},ue=function(Ie){return et(Ie)===qe},ue=function(Ie){return et(Ie)===Qe},Ut.isMemo=function(Ie){return et(Ie)===ut},ue=function(Ie){return et(Ie)===Fe},ue=function(Ie){return et(Ie)===Ce},ue=function(Ie){return et(Ie)===ye},ue=function(Ie){return et(Ie)===Ne},ue=function(Ie){return typeof Ie=="string"||typeof Ie=="function"||Ie===qe||Ie===De||Ie===Ce||Ie===ye||Ie===Ne||Ie===Mt||typeof Ie=="object"&&Ie!==null&&(Ie.$$typeof===Qe||Ie.$$typeof===ut||Ie.$$typeof===Me||Ie.$$typeof===we||Ie.$$typeof===ct||Ie.$$typeof===Te||Ie.$$typeof===Et||Ie.$$typeof===Lt||Ie.$$typeof===Xe)},ue=et},18459:function(mn,Ut,ue){"use strict";mn.exports=ue(26819)},16651:function(mn,Ut){"use strict";var ue;var be=Symbol.for("react.element"),tt=Symbol.for("react.portal"),Fe=Symbol.for("react.fragment"),qe=Symbol.for("react.strict_mode"),ye=Symbol.for("react.profiler"),Ce=Symbol.for("react.provider"),Me=Symbol.for("react.context"),we=Symbol.for("react.server_context"),he=Symbol.for("react.forward_ref"),De=Symbol.for("react.suspense"),ct=Symbol.for("react.suspense_list"),Ne=Symbol.for("react.memo"),Mt=Symbol.for("react.lazy"),ut=Symbol.for("react.offscreen"),Qe;Qe=Symbol.for("react.module.reference");function Xe(Te){if(typeof Te=="object"&&Te!==null){var Et=Te.$$typeof;switch(Et){case be:switch(Te=Te.type,Te){case Fe:case ye:case qe:case De:case ct:return Te;default:switch(Te=Te&&Te.$$typeof,Te){case we:case Me:case he:case Mt:case Ne:case Ce:return Te;default:return Et}}case tt:return Et}}}ue=Me,ue=Ce,ue=be,ue=he,ue=Fe,ue=Mt,ue=Ne,ue=tt,ue=ye,ue=qe,ue=De,ue=ct,ue=function(){return!1},ue=function(){return!1},ue=function(Te){return Xe(Te)===Me},ue=function(Te){return Xe(Te)===Ce},ue=function(Te){return typeof Te=="object"&&Te!==null&&Te.$$typeof===be},ue=function(Te){return Xe(Te)===he},ue=function(Te){return Xe(Te)===Fe},ue=function(Te){return Xe(Te)===Mt},ue=function(Te){return Xe(Te)===Ne},ue=function(Te){return Xe(Te)===tt},ue=function(Te){return Xe(Te)===ye},ue=function(Te){return Xe(Te)===qe},ue=function(Te){return Xe(Te)===De},ue=function(Te){return Xe(Te)===ct},ue=function(Te){return typeof Te=="string"||typeof Te=="function"||Te===Fe||Te===ye||Te===qe||Te===De||Te===ct||Te===ut||typeof Te=="object"&&Te!==null&&(Te.$$typeof===Mt||Te.$$typeof===Ne||Te.$$typeof===Ce||Te.$$typeof===Me||Te.$$typeof===he||Te.$$typeof===Qe||Te.getModuleId!==void 0)},ue=Xe},33993:function(mn,Ut,ue){"use strict";ue(16651)},82523:function(mn,Ut){"use strict";var ue;var be=Symbol.for("react.element"),tt=Symbol.for("react.portal"),Fe=Symbol.for("react.fragment"),qe=Symbol.for("react.strict_mode"),ye=Symbol.for("react.profiler"),Ce=Symbol.for("react.provider"),Me=Symbol.for("react.context"),we=Symbol.for("react.server_context"),he=Symbol.for("react.forward_ref"),De=Symbol.for("react.suspense"),ct=Symbol.for("react.suspense_list"),Ne=Symbol.for("react.memo"),Mt=Symbol.for("react.lazy"),ut=Symbol.for("react.offscreen"),Qe;Qe=Symbol.for("react.module.reference");function Xe(Te){if(typeof Te=="object"&&Te!==null){var Et=Te.$$typeof;switch(Et){case be:switch(Te=Te.type,Te){case Fe:case ye:case qe:case De:case ct:return Te;default:switch(Te=Te&&Te.$$typeof,Te){case we:case Me:case he:case Mt:case Ne:case Ce:return Te;default:return Et}}case tt:return Et}}}ue=Me,ue=Ce,ue=be,ue=he,ue=Fe,ue=Mt,ue=Ne,ue=tt,ue=ye,ue=qe,ue=De,ue=ct,ue=function(){return!1},ue=function(){return!1},ue=function(Te){return Xe(Te)===Me},ue=function(Te){return Xe(Te)===Ce},ue=function(Te){return typeof Te=="object"&&Te!==null&&Te.$$typeof===be},ue=function(Te){return Xe(Te)===he},ue=function(Te){return Xe(Te)===Fe},ue=function(Te){return Xe(Te)===Mt},ue=function(Te){return Xe(Te)===Ne},ue=function(Te){return Xe(Te)===tt},ue=function(Te){return Xe(Te)===ye},ue=function(Te){return Xe(Te)===qe},ue=function(Te){return Xe(Te)===De},ue=function(Te){return Xe(Te)===ct},ue=function(Te){return typeof Te=="string"||typeof Te=="function"||Te===Fe||Te===ye||Te===qe||Te===De||Te===ct||Te===ut||typeof Te=="object"&&Te!==null&&(Te.$$typeof===Mt||Te.$$typeof===Ne||Te.$$typeof===Ce||Te.$$typeof===Me||Te.$$typeof===he||Te.$$typeof===Qe||Te.getModuleId!==void 0)},ue=Xe},27183:function(mn,Ut,ue){"use strict";ue(82523)},67656:function(mn,Ut,ue){"use strict";ue.r(Ut),ue.d(Ut,{BaseInput:function(){return De},default:function(){return Lt}});var be=ue(87462),tt=ue(1413),Fe=ue(4942),qe=ue(71002),ye=ue(94184),Ce=ue.n(ye),Me=ue(67294),we=ue(87887),he=function(lt){var Ie,_e,Ue=lt.inputElement,Ze=lt.prefixCls,At=lt.prefix,bt=lt.suffix,xt=lt.addonBefore,Ge=lt.addonAfter,Ot=lt.className,kt=lt.style,vn=lt.disabled,qt=lt.readOnly,cn=lt.focused,An=lt.triggerFocus,Zn=lt.allowClear,Ye=lt.value,Ee=lt.handleReset,Tt=lt.hidden,gn=lt.classes,Xt=lt.classNames,Je=lt.dataAttrs,rt=lt.styles,Ht=lt.components,Sn=(Ht==null?void 0:Ht.affixWrapper)||"span",sn=(Ht==null?void 0:Ht.groupWrapper)||"span",$t=(Ht==null?void 0:Ht.wrapper)||"span",Bt=(Ht==null?void 0:Ht.groupAddon)||"span",bn=(0,Me.useRef)(null),dn=function(yn){var Jt;(Jt=bn.current)!==null&&Jt!==void 0&&Jt.contains(yn.target)&&(An==null||An())},ke=function(){var yn;if(!Zn)return null;var Jt=!vn&&!qt&&Ye,Cr="".concat(Ze,"-clear-icon"),Tr=(0,qe.Z)(Zn)==="object"&&Zn!==null&&Zn!==void 0&&Zn.clearIcon?Zn.clearIcon:"\u2716";return Me.createElement("span",{onClick:Ee,onMouseDown:function(Ln){return Ln.preventDefault()},className:Ce()(Cr,(yn={},(0,Fe.Z)(yn,"".concat(Cr,"-hidden"),!Jt),(0,Fe.Z)(yn,"".concat(Cr,"-has-suffix"),!!bt),yn)),role:"button",tabIndex:-1},Tr)},ce=(0,Me.cloneElement)(Ue,{value:Ye,hidden:Tt,className:Ce()((Ie=Ue.props)===null||Ie===void 0?void 0:Ie.className,!(0,we.X3)(lt)&&!(0,we.He)(lt)&&Ot)||null,style:(0,tt.Z)((0,tt.Z)({},(_e=Ue.props)===null||_e===void 0?void 0:_e.style),!(0,we.X3)(lt)&&!(0,we.He)(lt)?kt:{})});if((0,we.X3)(lt)){var le,ve="".concat(Ze,"-affix-wrapper"),pe=Ce()(ve,(le={},(0,Fe.Z)(le,"".concat(ve,"-disabled"),vn),(0,Fe.Z)(le,"".concat(ve,"-focused"),cn),(0,Fe.Z)(le,"".concat(ve,"-readonly"),qt),(0,Fe.Z)(le,"".concat(ve,"-input-with-clear-btn"),bt&&Zn&&Ye),le),!(0,we.He)(lt)&&Ot,gn==null?void 0:gn.affixWrapper,Xt==null?void 0:Xt.affixWrapper),oe=(bt||Zn)&&Me.createElement("span",{className:Ce()("".concat(Ze,"-suffix"),Xt==null?void 0:Xt.suffix),style:rt==null?void 0:rt.suffix},ke(),bt);ce=Me.createElement(Sn,(0,be.Z)({className:pe,style:(0,tt.Z)((0,tt.Z)({},(0,we.He)(lt)?void 0:kt),rt==null?void 0:rt.affixWrapper),hidden:!(0,we.He)(lt)&&Tt,onClick:dn},Je==null?void 0:Je.affixWrapper,{ref:bn}),At&&Me.createElement("span",{className:Ce()("".concat(Ze,"-prefix"),Xt==null?void 0:Xt.prefix),style:rt==null?void 0:rt.prefix},At),(0,Me.cloneElement)(Ue,{value:Ye,hidden:null}),oe)}if((0,we.He)(lt)){var ze="".concat(Ze,"-group"),yt="".concat(ze,"-addon"),Vt=Ce()("".concat(Ze,"-wrapper"),ze,gn==null?void 0:gn.wrapper),en=Ce()("".concat(Ze,"-group-wrapper"),Ot,gn==null?void 0:gn.group);return Me.createElement(sn,{className:en,style:kt,hidden:Tt},Me.createElement($t,{className:Vt},xt&&Me.createElement(Bt,{className:yt},xt),(0,Me.cloneElement)(ce,{hidden:null}),Ge&&Me.createElement(Bt,{className:yt},Ge)))}return ce},De=he,ct=ue(74902),Ne=ue(97685),Mt=ue(45987),ut=ue(21770),Qe=ue(98423),Xe=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","classes","classNames","styles"],Te=(0,Me.forwardRef)(function(et,lt){var Ie=et.autoComplete,_e=et.onChange,Ue=et.onFocus,Ze=et.onBlur,At=et.onPressEnter,bt=et.onKeyDown,xt=et.prefixCls,Ge=xt===void 0?"rc-input":xt,Ot=et.disabled,kt=et.htmlSize,vn=et.className,qt=et.maxLength,cn=et.suffix,An=et.showCount,Zn=et.type,Ye=Zn===void 0?"text":Zn,Ee=et.classes,Tt=et.classNames,gn=et.styles,Xt=(0,Mt.Z)(et,Xe),Je=(0,ut.Z)(et.defaultValue,{value:et.value}),rt=(0,Ne.Z)(Je,2),Ht=rt[0],Sn=rt[1],sn=(0,Me.useState)(!1),$t=(0,Ne.Z)(sn,2),Bt=$t[0],bn=$t[1],dn=(0,Me.useRef)(null),ke=function(en){dn.current&&(0,we.nH)(dn.current,en)};(0,Me.useImperativeHandle)(lt,function(){return{focus:ke,blur:function(){var en;(en=dn.current)===null||en===void 0||en.blur()},setSelectionRange:function(en,un,yn){var Jt;(Jt=dn.current)===null||Jt===void 0||Jt.setSelectionRange(en,un,yn)},select:function(){var en;(en=dn.current)===null||en===void 0||en.select()},input:dn.current}}),(0,Me.useEffect)(function(){bn(function(Vt){return Vt&&Ot?!1:Vt})},[Ot]);var ce=function(en){et.value===void 0&&Sn(en.target.value),dn.current&&(0,we.rJ)(dn.current,en,_e)},le=function(en){At&&en.key==="Enter"&&At(en),bt==null||bt(en)},ve=function(en){bn(!0),Ue==null||Ue(en)},pe=function(en){bn(!1),Ze==null||Ze(en)},oe=function(en){Sn(""),ke(),dn.current&&(0,we.rJ)(dn.current,en,_e)},ze=function(){var en=(0,Qe.Z)(et,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","classes","htmlSize","styles","classNames"]);return Me.createElement("input",(0,be.Z)({autoComplete:Ie},en,{onChange:ce,onFocus:ve,onBlur:pe,onKeyDown:le,className:Ce()(Ge,(0,Fe.Z)({},"".concat(Ge,"-disabled"),Ot),Tt==null?void 0:Tt.input),style:gn==null?void 0:gn.input,ref:dn,size:kt,type:Ye}))},yt=function(){var en=Number(qt)>0;if(cn||An){var un=(0,we.D7)(Ht),yn=(0,ct.Z)(un).length,Jt=(0,qe.Z)(An)==="object"?An.formatter({value:un,count:yn,maxLength:qt}):"".concat(yn).concat(en?" / ".concat(qt):"");return Me.createElement(Me.Fragment,null,!!An&&Me.createElement("span",{className:Ce()("".concat(Ge,"-show-count-suffix"),(0,Fe.Z)({},"".concat(Ge,"-show-count-has-suffix"),!!cn),Tt==null?void 0:Tt.count),style:(0,tt.Z)({},gn==null?void 0:gn.count)},Jt),cn)}return null};return Me.createElement(De,(0,be.Z)({},Xt,{prefixCls:Ge,className:vn,inputElement:ze(),handleReset:oe,value:(0,we.D7)(Ht),focused:Bt,triggerFocus:ke,suffix:yt(),disabled:Ot,classes:Ee,classNames:Tt,styles:gn}))}),Et=Te,Lt=Et},87887:function(mn,Ut,ue){"use strict";ue.d(Ut,{D7:function(){return ye},He:function(){return be},X3:function(){return tt},nH:function(){return qe},rJ:function(){return Fe}});function be(Ce){return!!(Ce.addonBefore||Ce.addonAfter)}function tt(Ce){return!!(Ce.prefix||Ce.suffix||Ce.allowClear)}function Fe(Ce,Me,we,he){if(we){var De=Me;if(Me.type==="click"){var ct=Ce.cloneNode(!0);De=Object.create(Me,{target:{value:ct},currentTarget:{value:ct}}),ct.value="",we(De);return}if(he!==void 0){De=Object.create(Me,{target:{value:Ce},currentTarget:{value:Ce}}),Ce.value=he,we(De);return}we(De)}}function qe(Ce,Me){if(Ce){Ce.focus(Me);var we=Me||{},he=we.cursor;if(he){var De=Ce.value.length;switch(he){case"start":Ce.setSelectionRange(0,0);break;case"end":Ce.setSelectionRange(De,De);break;default:Ce.setSelectionRange(0,De)}}}}function ye(Ce){return typeof Ce=="undefined"||Ce===null?"":String(Ce)}},78595:function(mn,Ut,ue){"use strict";ue.d(Ut,{iz:function(){return Br},ck:function(){return oi},BW:function(){return Er},sN:function(){return oi},Wd:function(){return It},ZP:function(){return Re},Xl:function(){return Jt}});var be=ue(87462),tt=ue(4942),Fe=ue(1413),qe=ue(74902),ye=ue(97685),Ce=ue(45987),Me=ue(94184),we=ue.n(Me),he=ue(67294),De=ue(48555);function ct(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Ne=ct()?he.useLayoutEffect:he.useEffect,Mt=function(We,nt){var st=he.useRef(!0);Ne(function(){return We(st.current)},nt),Ne(function(){return st.current=!1,function(){st.current=!0}},[])},ut=function(We,nt){Mt(function(st){if(!st)return We()},nt)},Qe=Mt,Xe=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],Te=void 0;function Et(Oe,We){var nt=Oe.prefixCls,st=Oe.invalidate,mt=Oe.item,zt=Oe.renderItem,jt=Oe.responsive,Nn=Oe.responsiveDisabled,Qn=Oe.registerSize,Dn=Oe.itemKey,tn=Oe.className,Yt=Oe.style,fn=Oe.children,xn=Oe.display,Yn=Oe.order,$n=Oe.component,On=$n===void 0?"div":$n,Kn=(0,Ce.Z)(Oe,Xe),zn=jt&&!xn;function tr(Kt){Qn(Dn,Kt)}he.useEffect(function(){return function(){tr(null)}},[]);var $e=zt&&mt!==Te?zt(mt):fn,Ke;st||(Ke={opacity:zn?0:1,height:zn?0:Te,overflowY:zn?"hidden":Te,order:jt?Yn:Te,pointerEvents:zn?"none":Te,position:zn?"absolute":Te});var Ct={};zn&&(Ct["aria-hidden"]=!0);var ft=he.createElement(On,(0,be.Z)({className:we()(!st&&nt,tn),style:(0,Fe.Z)((0,Fe.Z)({},Ke),Yt)},Ct,Kn,{ref:We}),$e);return jt&&(ft=he.createElement(De.Z,{onResize:function(on){var nn=on.offsetWidth;tr(nn)},disabled:Nn},ft)),ft}var Lt=he.forwardRef(Et);Lt.displayName="Item";var et=Lt;function lt(Oe){var We=he.useRef();We.current=Oe;var nt=he.useCallback(function(){for(var st,mt=arguments.length,zt=new Array(mt),jt=0;jt<mt;jt++)zt[jt]=arguments[jt];return(st=We.current)===null||st===void 0?void 0:st.call.apply(st,[We].concat(zt))},[]);return nt}var Ie=ue(73935),_e=function(We){return+setTimeout(We,16)},Ue=function(We){return clearTimeout(We)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(_e=function(We){return window.requestAnimationFrame(We)},Ue=function(We){return window.cancelAnimationFrame(We)});var Ze=0,At=new Map;function bt(Oe){At.delete(Oe)}var xt=function(We){var nt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Ze+=1;var st=Ze;function mt(zt){if(zt===0)bt(st),We();else{var jt=_e(function(){mt(zt-1)});At.set(st,jt)}}return mt(nt),st};xt.cancel=function(Oe){var We=At.get(Oe);return bt(We),Ue(We)};var Ge=xt;function Ot(Oe){if(typeof MessageChannel=="undefined")Ge(Oe);else{var We=new MessageChannel;We.port1.onmessage=function(){return Oe()},We.port2.postMessage(void 0)}}function kt(){var Oe=he.useRef(null),We=function(st){Oe.current||(Oe.current=[],Ot(function(){(0,Ie.unstable_batchedUpdates)(function(){Oe.current.forEach(function(mt){mt()}),Oe.current=null})})),Oe.current.push(st)};return We}function vn(Oe,We){var nt=he.useState(We),st=(0,ye.Z)(nt,2),mt=st[0],zt=st[1],jt=lt(function(Nn){Oe(function(){zt(Nn)})});return[mt,jt]}var qt=he.createContext(null),cn=["component"],An=["className"],Zn=["className"],Ye=function(We,nt){var st=he.useContext(qt);if(!st){var mt=We.component,zt=mt===void 0?"div":mt,jt=(0,Ce.Z)(We,cn);return he.createElement(zt,(0,be.Z)({},jt,{ref:nt}))}var Nn=st.className,Qn=(0,Ce.Z)(st,An),Dn=We.className,tn=(0,Ce.Z)(We,Zn);return he.createElement(qt.Provider,{value:null},he.createElement(et,(0,be.Z)({ref:nt,className:we()(Nn,Dn)},Qn,tn)))},Ee=he.forwardRef(Ye);Ee.displayName="RawItem";var Tt=Ee,gn=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Xt="responsive",Je="invalidate";function rt(Oe){return"+ ".concat(Oe.length," ...")}function Ht(Oe,We){var nt=Oe.prefixCls,st=nt===void 0?"rc-overflow":nt,mt=Oe.data,zt=mt===void 0?[]:mt,jt=Oe.renderItem,Nn=Oe.renderRawItem,Qn=Oe.itemKey,Dn=Oe.itemWidth,tn=Dn===void 0?10:Dn,Yt=Oe.ssr,fn=Oe.style,xn=Oe.className,Yn=Oe.maxCount,$n=Oe.renderRest,On=Oe.renderRawRest,Kn=Oe.suffix,zn=Oe.component,tr=zn===void 0?"div":zn,$e=Oe.itemComponent,Ke=Oe.onVisibleChange,Ct=(0,Ce.Z)(Oe,gn),ft=Yt==="full",Kt=kt(),on=vn(Kt,null),nn=(0,ye.Z)(on,2),En=nn[0],pn=nn[1],Zt=En||0,wn=vn(Kt,new Map),kn=(0,ye.Z)(wn,2),er=kn[0],Mn=kn[1],dr=vn(Kt,0),Lr=(0,ye.Z)(dr,2),pr=Lr[0],wr=Lr[1],ir=vn(Kt,0),yr=(0,ye.Z)(ir,2),Ir=yr[0],$r=yr[1],mr=vn(Kt,0),Wr=(0,ye.Z)(mr,2),li=Wr[0],Ii=Wr[1],Ci=(0,he.useState)(null),di=(0,ye.Z)(Ci,2),ki=di[0],Li=di[1],Gr=(0,he.useState)(null),fi=(0,ye.Z)(Gr,2),Ar=fi[0],Ur=fi[1],ri=he.useMemo(function(){return Ar===null&&ft?Number.MAX_SAFE_INTEGER:Ar||0},[Ar,En]),Mi=(0,he.useState)(!1),Ba=(0,ye.Z)(Mi,2),Oa=Ba[0],Sa=Ba[1],Ui="".concat(st,"-item"),Ai=Math.max(pr,Ir),Jr=Yn===Xt,Ta=zt.length&&Jr,ei=Yn===Je,Pr=Ta||typeof Yn=="number"&&zt.length>Yn,pi=(0,he.useMemo)(function(){var ti=zt;return Ta?En===null&&ft?ti=zt:ti=zt.slice(0,Math.min(zt.length,Zt/tn)):typeof Yn=="number"&&(ti=zt.slice(0,Yn)),ti},[zt,tn,En,Yn,Ta]),Zi=(0,he.useMemo)(function(){return Ta?zt.slice(ri+1):zt.slice(pi.length)},[zt,pi,Ta,ri]),xi=(0,he.useCallback)(function(ti,mi){var ji;return typeof Qn=="function"?Qn(ti):(ji=Qn&&(ti==null?void 0:ti[Qn]))!==null&&ji!==void 0?ji:mi},[Qn]),Ni=(0,he.useCallback)(jt||function(ti){return ti},[jt]);function Zr(ti,mi,ji){Ar===ti&&(mi===void 0||mi===ki)||(Ur(ti),ji||(Sa(ti<zt.length-1),Ke==null||Ke(ti)),mi!==void 0&&Li(mi))}function Ji(ti,mi){pn(mi.clientWidth)}function oa(ti,mi){Mn(function(ji){var la=new Map(ji);return mi===null?la.delete(ti):la.set(ti,mi),la})}function qi(ti,mi){$r(mi),wr(Ir)}function sa(ti,mi){Ii(mi)}function ma(ti){return er.get(xi(pi[ti],ti))}Qe(function(){if(Zt&&typeof Ai=="number"&&pi){var ti=li,mi=pi.length,ji=mi-1;if(!mi){Zr(0,null);return}for(var la=0;la<mi;la+=1){var Fa=ma(la);if(ft&&(Fa=Fa||0),Fa===void 0){Zr(la-1,void 0,!0);break}if(ti+=Fa,ji===0&&ti<=Zt||la===ji-1&&ti+ma(ji)<=Zt){Zr(ji,null);break}else if(ti+Ai>Zt){Zr(la-1,ti-Fa-li+Ir);break}}Kn&&ma(0)+li>Zt&&Li(null)}},[Zt,er,Ir,li,xi,pi]);var Va=Oa&&!!Zi.length,Yi={};ki!==null&&Ta&&(Yi={position:"absolute",left:ki,top:0});var ga={prefixCls:Ui,responsive:Ta,component:$e,invalidate:ei},Ya=Nn?function(ti,mi){var ji=xi(ti,mi);return he.createElement(qt.Provider,{key:ji,value:(0,Fe.Z)((0,Fe.Z)({},ga),{},{order:mi,item:ti,itemKey:ji,registerSize:oa,display:mi<=ri})},Nn(ti,mi))}:function(ti,mi){var ji=xi(ti,mi);return he.createElement(et,(0,be.Z)({},ga,{order:mi,key:ji,item:ti,renderItem:Ni,itemKey:ji,registerSize:oa,display:mi<=ri}))},ja,oo={order:Va?ri:Number.MAX_SAFE_INTEGER,className:"".concat(Ui,"-rest"),registerSize:qi,display:Va};if(On)On&&(ja=he.createElement(qt.Provider,{value:(0,Fe.Z)((0,Fe.Z)({},ga),oo)},On(Zi)));else{var Ra=$n||rt;ja=he.createElement(et,(0,be.Z)({},ga,oo),typeof Ra=="function"?Ra(Zi):Ra)}var da=he.createElement(tr,(0,be.Z)({className:we()(!ei&&st,xn),style:fn,ref:We},Ct),pi.map(Ya),Pr?ja:null,Kn&&he.createElement(et,(0,be.Z)({},ga,{responsive:Jr,responsiveDisabled:!Ta,order:ri,className:"".concat(Ui,"-suffix"),registerSize:sa,display:!0,style:Yi}),Kn));return Jr&&(da=he.createElement(De.Z,{onResize:Ji,disabled:!Ta},da)),da}var Sn=he.forwardRef(Ht);Sn.displayName="Overflow",Sn.Item=Tt,Sn.RESPONSIVE=Xt,Sn.INVALIDATE=Je;var sn=Sn,$t=sn,Bt=ue(21770),bn=ue(80334),dn=ue(91881),ke=he.createContext(null);function ce(Oe,We){return Oe===void 0?null:"".concat(Oe,"-").concat(We)}function le(Oe){var We=he.useContext(ke);return ce(We,Oe)}var ve=ue(56982),pe=["children","locked"],oe=he.createContext(null);function ze(Oe,We){var nt=(0,Fe.Z)({},Oe);return Object.keys(We).forEach(function(st){var mt=We[st];mt!==void 0&&(nt[st]=mt)}),nt}function yt(Oe){var We=Oe.children,nt=Oe.locked,st=(0,Ce.Z)(Oe,pe),mt=he.useContext(oe),zt=(0,ve.Z)(function(){return ze(mt,st)},[mt,st],function(jt,Nn){return!nt&&(jt[0]!==Nn[0]||!(0,dn.Z)(jt[1],Nn[1],!0))});return he.createElement(oe.Provider,{value:zt},We)}var Vt=[],en=he.createContext(null);function un(){return he.useContext(en)}var yn=he.createContext(Vt);function Jt(Oe){var We=he.useContext(yn);return he.useMemo(function(){return Oe!==void 0?[].concat((0,qe.Z)(We),[Oe]):We},[We,Oe])}var Cr=he.createContext(null),Tr=he.createContext({}),Rt=Tr,Ln=ue(15105),Nr=ue(75164),Qr=function(Oe){if(!Oe)return!1;if(Oe instanceof Element){if(Oe.offsetParent)return!0;if(Oe.getBBox){var We=Oe.getBBox(),nt=We.width,st=We.height;if(nt||st)return!0}if(Oe.getBoundingClientRect){var mt=Oe.getBoundingClientRect(),zt=mt.width,jt=mt.height;if(zt||jt)return!0}}return!1};function Gn(Oe){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Qr(Oe)){var nt=Oe.nodeName.toLowerCase(),st=["input","select","textarea","button"].includes(nt)||Oe.isContentEditable||nt==="a"&&!!Oe.getAttribute("href"),mt=Oe.getAttribute("tabindex"),zt=Number(mt),jt=null;return mt&&!Number.isNaN(zt)?jt=zt:st&&jt===null&&(jt=0),st&&Oe.disabled&&(jt=null),jt!==null&&(jt>=0||We&&jt<0)}return!1}function Fr(Oe){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,nt=(0,qe.Z)(Oe.querySelectorAll("*")).filter(function(st){return Gn(st,We)});return Gn(Oe,We)&&nt.unshift(Oe),nt}var Da=null;function Fi(){Da=document.activeElement}function Oi(){Da=null}function Ei(){if(Da)try{Da.focus()}catch(Oe){}}function ua(Oe,We){if(We.keyCode===9){var nt=Fr(Oe),st=nt[We.shiftKey?0:nt.length-1],mt=st===document.activeElement||Oe===document.activeElement;if(mt){var zt=nt[We.shiftKey?nt.length-1:0];zt.focus(),We.preventDefault()}}}var ba=Ln.Z.LEFT,ka=Ln.Z.RIGHT,ca=Ln.Z.UP,Hr=Ln.Z.DOWN,La=Ln.Z.ENTER,fo=Ln.Z.ESC,Za=Ln.Z.HOME,Wa=Ln.Z.END,ha=[ca,Hr,ba,ka];function wt(Oe,We,nt,st){var mt,zt,jt,Nn,Qn="prev",Dn="next",tn="children",Yt="parent";if(Oe==="inline"&&st===La)return{inlineTrigger:!0};var fn=(mt={},(0,tt.Z)(mt,ca,Qn),(0,tt.Z)(mt,Hr,Dn),mt),xn=(zt={},(0,tt.Z)(zt,ba,nt?Dn:Qn),(0,tt.Z)(zt,ka,nt?Qn:Dn),(0,tt.Z)(zt,Hr,tn),(0,tt.Z)(zt,La,tn),zt),Yn=(jt={},(0,tt.Z)(jt,ca,Qn),(0,tt.Z)(jt,Hr,Dn),(0,tt.Z)(jt,La,tn),(0,tt.Z)(jt,fo,Yt),(0,tt.Z)(jt,ba,nt?tn:Yt),(0,tt.Z)(jt,ka,nt?Yt:tn),jt),$n={inline:fn,horizontal:xn,vertical:Yn,inlineSub:fn,horizontalSub:Yn,verticalSub:Yn},On=(Nn=$n["".concat(Oe).concat(We?"":"Sub")])===null||Nn===void 0?void 0:Nn[st];switch(On){case Qn:return{offset:-1,sibling:!0};case Dn:return{offset:1,sibling:!0};case Yt:return{offset:-1,sibling:!1};case tn:return{offset:1,sibling:!1};default:return null}}function _n(Oe){for(var We=Oe;We;){if(We.getAttribute("data-menu-list"))return We;We=We.parentElement}return null}function Tn(Oe,We){for(var nt=Oe||document.activeElement;nt;){if(We.has(nt))return nt;nt=nt.parentElement}return null}function Pn(Oe,We){var nt=Fr(Oe,!0);return nt.filter(function(st){return We.has(st)})}function xr(Oe,We,nt){var st=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!Oe)return null;var mt=Pn(Oe,We),zt=mt.length,jt=mt.findIndex(function(Nn){return nt===Nn});return st<0?jt===-1?jt=zt-1:jt-=1:st>0&&(jt+=1),jt=(jt+zt)%zt,mt[jt]}function nr(Oe,We,nt,st,mt,zt,jt,Nn,Qn,Dn){var tn=he.useRef(),Yt=he.useRef();Yt.current=We;var fn=function(){Nr.Z.cancel(tn.current)};return he.useEffect(function(){return function(){fn()}},[]),function(xn){var Yn=xn.which;if([].concat(ha,[La,fo,Za,Wa]).includes(Yn)){var $n,On,Kn,zn=function(){$n=new Set,On=new Map,Kn=new Map;var kn=zt();return kn.forEach(function(er){var Mn=document.querySelector("[data-menu-id='".concat(ce(st,er),"']"));Mn&&($n.add(Mn),Kn.set(Mn,er),On.set(er,Mn))}),$n};zn();var tr=On.get(We),$e=Tn(tr,$n),Ke=Kn.get($e),Ct=wt(Oe,jt(Ke,!0).length===1,nt,Yn);if(!Ct&&Yn!==Za&&Yn!==Wa)return;(ha.includes(Yn)||[Za,Wa].includes(Yn))&&xn.preventDefault();var ft=function(kn){if(kn){var er=kn,Mn=kn.querySelector("a");Mn!=null&&Mn.getAttribute("href")&&(er=Mn);var dr=Kn.get(kn);Nn(dr),fn(),tn.current=(0,Nr.Z)(function(){Yt.current===dr&&er.focus()})}};if([Za,Wa].includes(Yn)||Ct.sibling||!$e){var Kt;!$e||Oe==="inline"?Kt=mt.current:Kt=_n($e);var on,nn=Pn(Kt,$n);Yn===Za?on=nn[0]:Yn===Wa?on=nn[nn.length-1]:on=xr(Kt,$n,$e,Ct.offset),ft(on)}else if(Ct.inlineTrigger)Qn(Ke);else if(Ct.offset>0)Qn(Ke,!0),fn(),tn.current=(0,Nr.Z)(function(){zn();var wn=$e.getAttribute("aria-controls"),kn=document.getElementById(wn),er=xr(kn,$n);ft(er)},5);else if(Ct.offset<0){var En=jt(Ke,!0),pn=En[En.length-2],Zt=On.get(pn);Qn(pn,!1),ft(Zt)}}Dn==null||Dn(xn)}}function ur(Oe){Promise.resolve().then(Oe)}var Hn="__RC_UTIL_PATH_SPLIT__",je=function(We){return We.join(Hn)},it=function(We){return We.split(Hn)},St="rc-menu-more";function Wt(){var Oe=he.useState({}),We=(0,ye.Z)(Oe,2),nt=We[1],st=(0,he.useRef)(new Map),mt=(0,he.useRef)(new Map),zt=he.useState([]),jt=(0,ye.Z)(zt,2),Nn=jt[0],Qn=jt[1],Dn=(0,he.useRef)(0),tn=(0,he.useRef)(!1),Yt=function(){tn.current||nt({})},fn=(0,he.useCallback)(function(tr,$e){var Ke=je($e);mt.current.set(Ke,tr),st.current.set(tr,Ke),Dn.current+=1;var Ct=Dn.current;ur(function(){Ct===Dn.current&&Yt()})},[]),xn=(0,he.useCallback)(function(tr,$e){var Ke=je($e);mt.current.delete(Ke),st.current.delete(tr)},[]),Yn=(0,he.useCallback)(function(tr){Qn(tr)},[]),$n=(0,he.useCallback)(function(tr,$e){var Ke=st.current.get(tr)||"",Ct=it(Ke);return $e&&Nn.includes(Ct[0])&&Ct.unshift(St),Ct},[Nn]),On=(0,he.useCallback)(function(tr,$e){return tr.some(function(Ke){var Ct=$n(Ke,!0);return Ct.includes($e)})},[$n]),Kn=function(){var $e=(0,qe.Z)(st.current.keys());return Nn.length&&$e.push(St),$e},zn=(0,he.useCallback)(function(tr){var $e="".concat(st.current.get(tr)).concat(Hn),Ke=new Set;return(0,qe.Z)(mt.current.keys()).forEach(function(Ct){Ct.startsWith($e)&&Ke.add(mt.current.get(Ct))}),Ke},[]);return he.useEffect(function(){return function(){tn.current=!0}},[]),{registerPath:fn,unregisterPath:xn,refreshOverflowKeys:Yn,isSubPathKey:On,getKeyPath:$n,getKeys:Kn,getSubPathKeys:zn}}function He(Oe){var We=he.useRef(Oe);We.current=Oe;var nt=he.useCallback(function(){for(var st,mt=arguments.length,zt=new Array(mt),jt=0;jt<mt;jt++)zt[jt]=arguments[jt];return(st=We.current)===null||st===void 0?void 0:st.call.apply(st,[We].concat(zt))},[]);return Oe?nt:void 0}var ht=Math.random().toFixed(5).toString().slice(2),Dt=0;function _t(Oe){var We=(0,Bt.Z)(Oe,{value:Oe}),nt=(0,ye.Z)(We,2),st=nt[0],mt=nt[1];return he.useEffect(function(){Dt+=1;var zt="".concat(ht,"-").concat(Dt);mt("rc-menu-uuid-".concat(zt))},[]),st}var Nt=ue(15671),Pt=ue(43144),Bn=ue(60136),cr=ue(51630),Wn=ue(98423),Un=ue(42550);function qn(Oe,We,nt,st){var mt=he.useContext(oe),zt=mt.activeKey,jt=mt.onActive,Nn=mt.onInactive,Qn={active:zt===Oe};return We||(Qn.onMouseEnter=function(Dn){nt==null||nt({key:Oe,domEvent:Dn}),jt(Oe)},Qn.onMouseLeave=function(Dn){st==null||st({key:Oe,domEvent:Dn}),Nn(Oe)}),Qn}function Jn(Oe){var We=he.useContext(oe),nt=We.mode,st=We.rtl,mt=We.inlineIndent;if(nt!=="inline")return null;var zt=Oe;return st?{paddingRight:zt*mt}:{paddingLeft:zt*mt}}function Mr(Oe){var We=Oe.icon,nt=Oe.props,st=Oe.children,mt;return We===null||We===!1?null:(typeof We=="function"?mt=he.createElement(We,(0,Fe.Z)({},nt)):typeof We!="boolean"&&(mt=We),mt||st||null)}var an=["item"];function Fn(Oe){var We=Oe.item,nt=(0,Ce.Z)(Oe,an);return Object.defineProperty(nt,"item",{get:function(){return(0,bn.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),We}}),nt}var ci=["title","attribute","elementRef"],gi=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],Vr=["active"],Dr=function(Oe){(0,Bn.Z)(nt,Oe);var We=(0,cr.Z)(nt);function nt(){return(0,Nt.Z)(this,nt),We.apply(this,arguments)}return(0,Pt.Z)(nt,[{key:"render",value:function(){var mt=this.props,zt=mt.title,jt=mt.attribute,Nn=mt.elementRef,Qn=(0,Ce.Z)(mt,ci),Dn=(0,Wn.Z)(Qn,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,bn.ZP)(!jt,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),he.createElement($t.Item,(0,be.Z)({},jt,{title:typeof zt=="string"?zt:void 0},Dn,{ref:Nn}))}}]),nt}(he.Component),wi=he.forwardRef(function(Oe,We){var nt,st=Oe.style,mt=Oe.className,zt=Oe.eventKey,jt=Oe.warnKey,Nn=Oe.disabled,Qn=Oe.itemIcon,Dn=Oe.children,tn=Oe.role,Yt=Oe.onMouseEnter,fn=Oe.onMouseLeave,xn=Oe.onClick,Yn=Oe.onKeyDown,$n=Oe.onFocus,On=(0,Ce.Z)(Oe,gi),Kn=le(zt),zn=he.useContext(oe),tr=zn.prefixCls,$e=zn.onItemClick,Ke=zn.disabled,Ct=zn.overflowDisabled,ft=zn.itemIcon,Kt=zn.selectedKeys,on=zn.onActive,nn=he.useContext(Rt),En=nn._internalRenderMenuItem,pn="".concat(tr,"-item"),Zt=he.useRef(),wn=he.useRef(),kn=Ke||Nn,er=(0,Un.x1)(We,wn),Mn=Jt(zt),dr=function(di){return{key:zt,keyPath:(0,qe.Z)(Mn).reverse(),item:Zt.current,domEvent:di}},Lr=Qn||ft,pr=qn(zt,kn,Yt,fn),wr=pr.active,ir=(0,Ce.Z)(pr,Vr),yr=Kt.includes(zt),Ir=Jn(Mn.length),$r=function(di){if(!kn){var ki=dr(di);xn==null||xn(Fn(ki)),$e(ki)}},mr=function(di){if(Yn==null||Yn(di),di.which===Ln.Z.ENTER){var ki=dr(di);xn==null||xn(Fn(ki)),$e(ki)}},Wr=function(di){on(zt),$n==null||$n(di)},li={};Oe.role==="option"&&(li["aria-selected"]=yr);var Ii=he.createElement(Dr,(0,be.Z)({ref:Zt,elementRef:er,role:tn===null?"none":tn||"menuitem",tabIndex:Nn?null:-1,"data-menu-id":Ct&&Kn?null:Kn},On,ir,li,{component:"li","aria-disabled":Nn,style:(0,Fe.Z)((0,Fe.Z)({},Ir),st),className:we()(pn,(nt={},(0,tt.Z)(nt,"".concat(pn,"-active"),wr),(0,tt.Z)(nt,"".concat(pn,"-selected"),yr),(0,tt.Z)(nt,"".concat(pn,"-disabled"),kn),nt),mt),onClick:$r,onKeyDown:mr,onFocus:Wr}),Dn,he.createElement(Mr,{props:(0,Fe.Z)((0,Fe.Z)({},Oe),{},{isSelected:yr}),icon:Lr}));return En&&(Ii=En(Ii,Oe,{selected:yr})),Ii});function or(Oe,We){var nt=Oe.eventKey,st=un(),mt=Jt(nt);return he.useEffect(function(){if(st)return st.registerPath(nt,mt),function(){st.unregisterPath(nt,mt)}},[mt]),st?null:he.createElement(wi,(0,be.Z)({},Oe,{ref:We}))}var oi=he.forwardRef(or),hn=["className","children"],Vi=function(We,nt){var st=We.className,mt=We.children,zt=(0,Ce.Z)(We,hn),jt=he.useContext(oe),Nn=jt.prefixCls,Qn=jt.mode,Dn=jt.rtl;return he.createElement("ul",(0,be.Z)({className:we()(Nn,Dn&&"".concat(Nn,"-rtl"),"".concat(Nn,"-sub"),"".concat(Nn,"-").concat(Qn==="inline"?"inline":"vertical"),st),role:"menu"},zt,{"data-menu-list":!0,ref:nt}),mt)},Si=he.forwardRef(Vi);Si.displayName="SubMenuList";var pa=Si,Wi=ue(50344);function _i(Oe,We){return(0,Wi.Z)(Oe).map(function(nt,st){if(he.isValidElement(nt)){var mt,zt,jt=nt.key,Nn=(mt=(zt=nt.props)===null||zt===void 0?void 0:zt.eventKey)!==null&&mt!==void 0?mt:jt,Qn=Nn==null;Qn&&(Nn="tmp_key-".concat([].concat((0,qe.Z)(We),[st]).join("-")));var Dn={key:Nn,eventKey:Nn};return he.cloneElement(nt,Dn)}return nt})}var ia=ue(62709),Ki={adjustX:1,adjustY:1},yi={topLeft:{points:["bl","tl"],overflow:Ki},topRight:{points:["br","tr"],overflow:Ki},bottomLeft:{points:["tl","bl"],overflow:Ki},bottomRight:{points:["tr","br"],overflow:Ki},leftTop:{points:["tr","tl"],overflow:Ki},leftBottom:{points:["br","bl"],overflow:Ki},rightTop:{points:["tl","tr"],overflow:Ki},rightBottom:{points:["bl","br"],overflow:Ki}},Gi={topLeft:{points:["bl","tl"],overflow:Ki},topRight:{points:["br","tr"],overflow:Ki},bottomLeft:{points:["tl","bl"],overflow:Ki},bottomRight:{points:["tr","br"],overflow:Ki},rightTop:{points:["tr","tl"],overflow:Ki},rightBottom:{points:["br","bl"],overflow:Ki},leftTop:{points:["tl","tr"],overflow:Ki},leftBottom:{points:["bl","br"],overflow:Ki}},xa=null;function Xi(Oe,We,nt){if(We)return We;if(nt)return nt[Oe]||nt.other}var Ti={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function wa(Oe){var We=Oe.prefixCls,nt=Oe.visible,st=Oe.children,mt=Oe.popup,zt=Oe.popupStyle,jt=Oe.popupClassName,Nn=Oe.popupOffset,Qn=Oe.disabled,Dn=Oe.mode,tn=Oe.onVisibleChange,Yt=he.useContext(oe),fn=Yt.getPopupContainer,xn=Yt.rtl,Yn=Yt.subMenuOpenDelay,$n=Yt.subMenuCloseDelay,On=Yt.builtinPlacements,Kn=Yt.triggerSubMenuAction,zn=Yt.forceSubMenuRender,tr=Yt.rootClassName,$e=Yt.motion,Ke=Yt.defaultMotions,Ct=he.useState(!1),ft=(0,ye.Z)(Ct,2),Kt=ft[0],on=ft[1],nn=xn?(0,Fe.Z)((0,Fe.Z)({},Gi),On):(0,Fe.Z)((0,Fe.Z)({},yi),On),En=Ti[Dn],pn=Xi(Dn,$e,Ke),Zt=he.useRef(pn);Dn!=="inline"&&(Zt.current=pn);var wn=(0,Fe.Z)((0,Fe.Z)({},Zt.current),{},{leavedClassName:"".concat(We,"-hidden"),removeOnLeave:!1,motionAppear:!0}),kn=he.useRef();return he.useEffect(function(){return kn.current=(0,Nr.Z)(function(){on(nt)}),function(){Nr.Z.cancel(kn.current)}},[nt]),he.createElement(ia.Z,{prefixCls:We,popupClassName:we()("".concat(We,"-popup"),(0,tt.Z)({},"".concat(We,"-rtl"),xn),jt,tr),stretch:Dn==="horizontal"?"minWidth":null,getPopupContainer:fn,builtinPlacements:nn,popupPlacement:En,popupVisible:Kt,popup:mt,popupStyle:zt,popupAlign:Nn&&{offset:Nn},action:Qn?[]:[Kn],mouseEnterDelay:Yn,mouseLeaveDelay:$n,onPopupVisibleChange:tn,forceRender:zn,popupMotion:wn,fresh:!0},st)}var Aa=ue(62874);function aa(Oe){var We=Oe.id,nt=Oe.open,st=Oe.keyPath,mt=Oe.children,zt="inline",jt=he.useContext(oe),Nn=jt.prefixCls,Qn=jt.forceSubMenuRender,Dn=jt.motion,tn=jt.defaultMotions,Yt=jt.mode,fn=he.useRef(!1);fn.current=Yt===zt;var xn=he.useState(!fn.current),Yn=(0,ye.Z)(xn,2),$n=Yn[0],On=Yn[1],Kn=fn.current?nt:!1;he.useEffect(function(){fn.current&&On(!1)},[Yt]);var zn=(0,Fe.Z)({},Xi(zt,Dn,tn));st.length>1&&(zn.motionAppear=!1);var tr=zn.onVisibleChanged;return zn.onVisibleChanged=function($e){return!fn.current&&!$e&&On(!0),tr==null?void 0:tr($e)},$n?null:he.createElement(yt,{mode:zt,locked:!fn.current},he.createElement(Aa.Z,(0,be.Z)({visible:Kn},zn,{forceRender:Qn,removeOnLeave:!1,leavedClassName:"".concat(Nn,"-hidden")}),function($e){var Ke=$e.className,Ct=$e.style;return he.createElement(pa,{id:We,className:Ke,style:Ct},mt)}))}var ni=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],pt=["active"],dt=function(We){var nt,st=We.style,mt=We.className,zt=We.title,jt=We.eventKey,Nn=We.warnKey,Qn=We.disabled,Dn=We.internalPopupClose,tn=We.children,Yt=We.itemIcon,fn=We.expandIcon,xn=We.popupClassName,Yn=We.popupOffset,$n=We.popupStyle,On=We.onClick,Kn=We.onMouseEnter,zn=We.onMouseLeave,tr=We.onTitleClick,$e=We.onTitleMouseEnter,Ke=We.onTitleMouseLeave,Ct=(0,Ce.Z)(We,ni),ft=le(jt),Kt=he.useContext(oe),on=Kt.prefixCls,nn=Kt.mode,En=Kt.openKeys,pn=Kt.disabled,Zt=Kt.overflowDisabled,wn=Kt.activeKey,kn=Kt.selectedKeys,er=Kt.itemIcon,Mn=Kt.expandIcon,dr=Kt.onItemClick,Lr=Kt.onOpenChange,pr=Kt.onActive,wr=he.useContext(Rt),ir=wr._internalRenderSubMenuItem,yr=he.useContext(Cr),Ir=yr.isSubPathKey,$r=Jt(),mr="".concat(on,"-submenu"),Wr=pn||Qn,li=he.useRef(),Ii=he.useRef(),Ci=Yt!=null?Yt:er,di=fn!=null?fn:Mn,ki=En.includes(jt),Li=!Zt&&ki,Gr=Ir(kn,jt),fi=qn(jt,Wr,$e,Ke),Ar=fi.active,Ur=(0,Ce.Z)(fi,pt),ri=he.useState(!1),Mi=(0,ye.Z)(ri,2),Ba=Mi[0],Oa=Mi[1],Sa=function(sa){Wr||Oa(sa)},Ui=function(sa){Sa(!0),Kn==null||Kn({key:jt,domEvent:sa})},Ai=function(sa){Sa(!1),zn==null||zn({key:jt,domEvent:sa})},Jr=he.useMemo(function(){return Ar||(nn!=="inline"?Ba||Ir([wn],jt):!1)},[nn,Ar,wn,Ba,jt,Ir]),Ta=Jn($r.length),ei=function(sa){Wr||(tr==null||tr({key:jt,domEvent:sa}),nn==="inline"&&Lr(jt,!ki))},Pr=He(function(qi){On==null||On(Fn(qi)),dr(qi)}),pi=function(sa){nn!=="inline"&&Lr(jt,sa)},Zi=function(){pr(jt)},xi=ft&&"".concat(ft,"-popup"),Ni=he.createElement("div",(0,be.Z)({role:"menuitem",style:Ta,className:"".concat(mr,"-title"),tabIndex:Wr?null:-1,ref:li,title:typeof zt=="string"?zt:null,"data-menu-id":Zt&&ft?null:ft,"aria-expanded":Li,"aria-haspopup":!0,"aria-controls":xi,"aria-disabled":Wr,onClick:ei,onFocus:Zi},Ur),zt,he.createElement(Mr,{icon:nn!=="horizontal"?di:void 0,props:(0,Fe.Z)((0,Fe.Z)({},We),{},{isOpen:Li,isSubMenu:!0})},he.createElement("i",{className:"".concat(mr,"-arrow")}))),Zr=he.useRef(nn);if(nn!=="inline"&&$r.length>1?Zr.current="vertical":Zr.current=nn,!Zt){var Ji=Zr.current;Ni=he.createElement(wa,{mode:Ji,prefixCls:mr,visible:!Dn&&Li&&nn!=="inline",popupClassName:xn,popupOffset:Yn,popupStyle:$n,popup:he.createElement(yt,{mode:Ji==="horizontal"?"vertical":Ji},he.createElement(pa,{id:xi,ref:Ii},tn)),disabled:Wr,onVisibleChange:pi},Ni)}var oa=he.createElement($t.Item,(0,be.Z)({role:"none"},Ct,{component:"li",style:st,className:we()(mr,"".concat(mr,"-").concat(nn),mt,(nt={},(0,tt.Z)(nt,"".concat(mr,"-open"),Li),(0,tt.Z)(nt,"".concat(mr,"-active"),Jr),(0,tt.Z)(nt,"".concat(mr,"-selected"),Gr),(0,tt.Z)(nt,"".concat(mr,"-disabled"),Wr),nt)),onMouseEnter:Ui,onMouseLeave:Ai}),Ni,!Zt&&he.createElement(aa,{id:xi,open:Li,keyPath:$r},tn));return ir&&(oa=ir(oa,We,{selected:Gr,active:Jr,open:Li,disabled:Wr})),he.createElement(yt,{onItemClick:Pr,mode:nn==="horizontal"?"vertical":nn,itemIcon:Ci,expandIcon:di},oa)};function It(Oe){var We=Oe.eventKey,nt=Oe.children,st=Jt(We),mt=_i(nt,st),zt=un();he.useEffect(function(){if(zt)return zt.registerPath(We,st),function(){zt.unregisterPath(We,st)}},[st]);var jt;return zt?jt=mt:jt=he.createElement(dt,Oe,mt),he.createElement(yn.Provider,{value:st},jt)}var Qt=ue(71002),Cn=["className","title","eventKey","children"],vr=["children"],gr=function(We){var nt=We.className,st=We.title,mt=We.eventKey,zt=We.children,jt=(0,Ce.Z)(We,Cn),Nn=he.useContext(oe),Qn=Nn.prefixCls,Dn="".concat(Qn,"-item-group");return he.createElement("li",(0,be.Z)({role:"presentation"},jt,{onClick:function(Yt){return Yt.stopPropagation()},className:we()(Dn,nt)}),he.createElement("div",{role:"presentation",className:"".concat(Dn,"-title"),title:typeof st=="string"?st:void 0},st),he.createElement("ul",{role:"group",className:"".concat(Dn,"-list")},zt))};function Er(Oe){var We=Oe.children,nt=(0,Ce.Z)(Oe,vr),st=Jt(nt.eventKey),mt=_i(We,st),zt=un();return zt?mt:he.createElement(gr,(0,Wn.Z)(nt,["warnKey"]),mt)}function Br(Oe){var We=Oe.className,nt=Oe.style,st=he.useContext(oe),mt=st.prefixCls,zt=un();return zt?null:he.createElement("li",{role:"separator",className:we()("".concat(mt,"-item-divider"),We),style:nt})}var kr=["label","children","key","type"];function Yr(Oe){return(Oe||[]).map(function(We,nt){if(We&&(0,Qt.Z)(We)==="object"){var st=We,mt=st.label,zt=st.children,jt=st.key,Nn=st.type,Qn=(0,Ce.Z)(st,kr),Dn=jt!=null?jt:"tmp-".concat(nt);return zt||Nn==="group"?Nn==="group"?he.createElement(Er,(0,be.Z)({key:Dn},Qn,{title:mt}),Yr(zt)):he.createElement(It,(0,be.Z)({key:Dn},Qn,{title:mt}),Yr(zt)):Nn==="divider"?he.createElement(Br,(0,be.Z)({key:Dn},Qn)):he.createElement(oi,(0,be.Z)({key:Dn},Qn),mt)}return null}).filter(function(We){return We})}function si(Oe,We,nt){var st=Oe;return We&&(st=Yr(We)),_i(st,nt)}var bi=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],Hi=[],Ri=he.forwardRef(function(Oe,We){var nt,st,mt=Oe,zt=mt.prefixCls,jt=zt===void 0?"rc-menu":zt,Nn=mt.rootClassName,Qn=mt.style,Dn=mt.className,tn=mt.tabIndex,Yt=tn===void 0?0:tn,fn=mt.items,xn=mt.children,Yn=mt.direction,$n=mt.id,On=mt.mode,Kn=On===void 0?"vertical":On,zn=mt.inlineCollapsed,tr=mt.disabled,$e=mt.disabledOverflow,Ke=mt.subMenuOpenDelay,Ct=Ke===void 0?.1:Ke,ft=mt.subMenuCloseDelay,Kt=ft===void 0?.1:ft,on=mt.forceSubMenuRender,nn=mt.defaultOpenKeys,En=mt.openKeys,pn=mt.activeKey,Zt=mt.defaultActiveFirst,wn=mt.selectable,kn=wn===void 0?!0:wn,er=mt.multiple,Mn=er===void 0?!1:er,dr=mt.defaultSelectedKeys,Lr=mt.selectedKeys,pr=mt.onSelect,wr=mt.onDeselect,ir=mt.inlineIndent,yr=ir===void 0?24:ir,Ir=mt.motion,$r=mt.defaultMotions,mr=mt.triggerSubMenuAction,Wr=mr===void 0?"hover":mr,li=mt.builtinPlacements,Ii=mt.itemIcon,Ci=mt.expandIcon,di=mt.overflowedIndicator,ki=di===void 0?"...":di,Li=mt.overflowedIndicatorPopupClassName,Gr=mt.getPopupContainer,fi=mt.onClick,Ar=mt.onOpenChange,Ur=mt.onKeyDown,ri=mt.openAnimation,Mi=mt.openTransitionName,Ba=mt._internalRenderMenuItem,Oa=mt._internalRenderSubMenuItem,Sa=(0,Ce.Z)(mt,bi),Ui=he.useMemo(function(){return si(xn,fn,Hi)},[xn,fn]),Ai=he.useState(!1),Jr=(0,ye.Z)(Ai,2),Ta=Jr[0],ei=Jr[1],Pr=he.useRef(),pi=_t($n),Zi=Yn==="rtl",xi=(0,Bt.Z)(nn,{value:En,postState:function(Ma){return Ma||Hi}}),Ni=(0,ye.Z)(xi,2),Zr=Ni[0],Ji=Ni[1],oa=function(Ma){var Ga=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function go(){Ji(Ma),Ar==null||Ar(Ma)}Ga?(0,Ie.flushSync)(go):go()},qi=he.useState(Zr),sa=(0,ye.Z)(qi,2),ma=sa[0],Va=sa[1],Yi=he.useRef(!1),ga=he.useMemo(function(){return(Kn==="inline"||Kn==="vertical")&&zn?["vertical",zn]:[Kn,!1]},[Kn,zn]),Ya=(0,ye.Z)(ga,2),ja=Ya[0],oo=Ya[1],Ra=ja==="inline",da=he.useState(ja),ti=(0,ye.Z)(da,2),mi=ti[0],ji=ti[1],la=he.useState(oo),Fa=(0,ye.Z)(la,2),ro=Fa[0],ho=Fa[1];he.useEffect(function(){ji(ja),ho(oo),Yi.current&&(Ra?Ji(ma):oa(Hi))},[ja,oo]);var Bo=he.useState(0),Oo=(0,ye.Z)(Bo,2),so=Oo[0],Ao=Oo[1],Pi=so>=Ui.length-1||mi!=="horizontal"||$e;he.useEffect(function(){Ra&&Va(Zr)},[Zr]),he.useEffect(function(){return Yi.current=!0,function(){Yi.current=!1}},[]);var ui=Wt(),Ca=ui.registerPath,va=ui.unregisterPath,lo=ui.refreshOverflowKeys,io=ui.isSubPathKey,hs=ui.getKeyPath,Qo=ui.getKeys,ps=ui.getSubPathKeys,$i=he.useMemo(function(){return{registerPath:Ca,unregisterPath:va}},[Ca,va]),fr=he.useMemo(function(){return{isSubPathKey:io}},[io]);he.useEffect(function(){lo(Pi?Hi:Ui.slice(so+1).map(function(ao){return ao.key}))},[so,Pi]);var Xr=(0,Bt.Z)(pn||Zt&&((nt=Ui[0])===null||nt===void 0?void 0:nt.key),{value:pn}),qr=(0,ye.Z)(Xr,2),ii=qr[0],$a=qr[1],Ua=He(function(ao){$a(ao)}),$o=He(function(){$a(void 0)});(0,he.useImperativeHandle)(We,function(){return{list:Pr.current,focus:function(Ma){var Ga,go=ii!=null?ii:(Ga=Ui.find(function(xs){return!xs.props.disabled}))===null||Ga===void 0?void 0:Ga.key;if(go){var yo,Ko,wo;(yo=Pr.current)===null||yo===void 0||(Ko=yo.querySelector("li[data-menu-id='".concat(ce(pi,go),"']")))===null||Ko===void 0||(wo=Ko.focus)===null||wo===void 0||wo.call(Ko,Ma)}}}});var Vo=(0,Bt.Z)(dr||[],{value:Lr,postState:function(Ma){return Array.isArray(Ma)?Ma:Ma==null?Hi:[Ma]}}),ls=(0,ye.Z)(Vo,2),ta=ls[0],Ro=ls[1],us=function(Ma){if(kn){var Ga=Ma.key,go=ta.includes(Ga),yo;Mn?go?yo=ta.filter(function(wo){return wo!==Ga}):yo=[].concat((0,qe.Z)(ta),[Ga]):yo=[Ga],Ro(yo);var Ko=(0,Fe.Z)((0,Fe.Z)({},Ma),{},{selectedKeys:yo});go?wr==null||wr(Ko):pr==null||pr(Ko)}!Mn&&Zr.length&&mi!=="inline"&&oa(Hi)},cl=He(function(ao){fi==null||fi(Fn(ao)),us(ao)}),As=He(function(ao,Ma){var Ga=Zr.filter(function(yo){return yo!==ao});if(Ma)Ga.push(ao);else if(mi!=="inline"){var go=ps(ao);Ga=Ga.filter(function(yo){return!go.has(yo)})}(0,dn.Z)(Zr,Ga,!0)||oa(Ga,!0)}),ms=function(Ma,Ga){var go=Ga!=null?Ga:!Zr.includes(Ma);As(Ma,go)},zo=nr(mi,ii,Zi,pi,Pr,Qo,hs,$a,ms,Ur);he.useEffect(function(){ei(!0)},[]);var Ts=he.useMemo(function(){return{_internalRenderMenuItem:Ba,_internalRenderSubMenuItem:Oa}},[Ba,Oa]),Ds=mi!=="horizontal"||$e?Ui:Ui.map(function(ao,Ma){return he.createElement(yt,{key:ao.key,overflowDisabled:Ma>so},ao)}),Ys=he.createElement($t,(0,be.Z)({id:$n,ref:Pr,prefixCls:"".concat(jt,"-overflow"),component:"ul",itemComponent:oi,className:we()(jt,"".concat(jt,"-root"),"".concat(jt,"-").concat(mi),Dn,(st={},(0,tt.Z)(st,"".concat(jt,"-inline-collapsed"),ro),(0,tt.Z)(st,"".concat(jt,"-rtl"),Zi),st),Nn),dir:Yn,style:Qn,role:"menu",tabIndex:Yt,data:Ds,renderRawItem:function(Ma){return Ma},renderRawRest:function(Ma){var Ga=Ma.length,go=Ga?Ui.slice(-Ga):null;return he.createElement(It,{eventKey:St,title:ki,disabled:Pi,internalPopupClose:Ga===0,popupClassName:Li},go)},maxCount:mi!=="horizontal"||$e?$t.INVALIDATE:$t.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Ma){Ao(Ma)},onKeyDown:zo},Sa));return he.createElement(Rt.Provider,{value:Ts},he.createElement(ke.Provider,{value:pi},he.createElement(yt,{prefixCls:jt,rootClassName:Nn,mode:mi,openKeys:Zr,rtl:Zi,disabled:tr,motion:Ta?Ir:null,defaultMotions:Ta?$r:null,activeKey:ii,onActive:Ua,onInactive:$o,selectedKeys:ta,inlineIndent:yr,subMenuOpenDelay:Ct,subMenuCloseDelay:Kt,forceSubMenuRender:on,builtinPlacements:li,triggerSubMenuAction:Wr,getPopupContainer:Gr,itemIcon:Ii,expandIcon:Ci,onItemClick:cl,onOpenChange:As},he.createElement(Cr.Provider,{value:fr},Ys),he.createElement("div",{style:{display:"none"},"aria-hidden":!0},he.createElement(en.Provider,{value:$i},Ui)))))}),Di=Ri,Le=Di;Le.Item=oi,Le.SubMenu=It,Le.ItemGroup=Er,Le.Divider=Br;var Re=Le},66680:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return tt}});var be=ue(67294);function tt(Fe){var qe=be.useRef();qe.current=Fe;var ye=be.useCallback(function(){for(var Ce,Me=arguments.length,we=new Array(Me),he=0;he<Me;he++)we[he]=arguments[he];return(Ce=qe.current)===null||Ce===void 0?void 0:Ce.call.apply(Ce,[qe].concat(we))},[]);return ye}},21770:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return Ce}});var be=ue(97685),tt=ue(66680),Fe=ue(8410),qe=ue(63896);function ye(Me){return Me!==void 0}function Ce(Me,we){var he=we||{},De=he.defaultValue,ct=he.value,Ne=he.onChange,Mt=he.postState,ut=(0,qe.Z)(function(){return ye(ct)?ct:ye(De)?typeof De=="function"?De():De:typeof Me=="function"?Me():Me}),Qe=(0,be.Z)(ut,2),Xe=Qe[0],Te=Qe[1],Et=ct!==void 0?ct:Xe,Lt=Mt?Mt(Et):Et,et=(0,tt.Z)(Ne),lt=(0,qe.Z)([Et]),Ie=(0,be.Z)(lt,2),_e=Ie[0],Ue=Ie[1];(0,Fe.o)(function(){var At=_e[0];Xe!==At&&et(Xe,At)},[_e]),(0,Fe.o)(function(){ye(ct)||Te(ct)},[ct]);var Ze=(0,tt.Z)(function(At,bt){Te(At,bt),Ue([Et],bt)});return[Lt,Ze]}},91881:function(mn,Ut,ue){"use strict";var be=ue(71002),tt=ue(80334);function Fe(qe,ye){var Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Me=new Set;function we(he,De){var ct=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Ne=Me.has(he);if((0,tt.ZP)(!Ne,"Warning: There may be circular references"),Ne)return!1;if(he===De)return!0;if(Ce&&ct>1)return!1;Me.add(he);var Mt=ct+1;if(Array.isArray(he)){if(!Array.isArray(De)||he.length!==De.length)return!1;for(var ut=0;ut<he.length;ut++)if(!we(he[ut],De[ut],Mt))return!1;return!0}if(he&&De&&(0,be.Z)(he)==="object"&&(0,be.Z)(De)==="object"){var Qe=Object.keys(he);return Qe.length!==Object.keys(De).length?!1:Qe.every(function(Xe){return we(he[Xe],De[Xe],Mt)})}return!1}return we(qe,ye)}Ut.Z=Fe},98423:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return tt}});var be=ue(1413);function tt(Fe,qe){var ye=(0,be.Z)({},Fe);return Array.isArray(qe)&&qe.forEach(function(Ce){delete ye[Ce]}),ye}},73299:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return ha}});var be=ue(87462),tt=ue(1413),Fe=ue(71002),qe=ue(97685),ye=ue(4942),Ce=ue(45987),Me=ue(67294),we=ue(73935),he=ue(94184),De=ue.n(he),ct=ue(48555),Ne=Me.forwardRef(function(wt,_n){var Tn=wt.height,Pn=wt.offsetY,xr=wt.offsetX,nr=wt.children,ur=wt.prefixCls,Hn=wt.onInnerResize,je=wt.innerProps,it=wt.rtl,St=wt.extra,Wt={},He={display:"flex",flexDirection:"column"};if(Pn!==void 0){var ht;Wt={height:Tn,position:"relative",overflow:"hidden"},He=(0,tt.Z)((0,tt.Z)({},He),{},(ht={transform:"translateY(".concat(Pn,"px)")},(0,ye.Z)(ht,it?"marginRight":"marginLeft",-xr),(0,ye.Z)(ht,"position","absolute"),(0,ye.Z)(ht,"left",0),(0,ye.Z)(ht,"right",0),(0,ye.Z)(ht,"top",0),ht))}return Me.createElement("div",{style:Wt},Me.createElement(ct.Z,{onResize:function(_t){var Nt=_t.offsetHeight;Nt&&Hn&&Hn()}},Me.createElement("div",(0,be.Z)({style:He,className:De()((0,ye.Z)({},"".concat(ur,"-holder-inner"),ur)),ref:_n},je),nr,St)))});Ne.displayName="Filler";var Mt=Ne,ut=function(_n){return+setTimeout(_n,16)},Qe=function(_n){return clearTimeout(_n)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(ut=function(_n){return window.requestAnimationFrame(_n)},Qe=function(_n){return window.cancelAnimationFrame(_n)});var Xe=0,Te=new Map;function Et(wt){Te.delete(wt)}var Lt=function(_n){var Tn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Xe+=1;var Pn=Xe;function xr(nr){if(nr===0)Et(Pn),_n();else{var ur=ut(function(){xr(nr-1)});Te.set(Pn,ur)}}return xr(Tn),Pn};Lt.cancel=function(wt){var _n=Te.get(wt);return Et(_n),Qe(_n)};var et=Lt;function lt(wt,_n){var Tn="touches"in wt?wt.touches[0]:wt;return Tn[_n?"pageX":"pageY"]}var Ie=Me.forwardRef(function(wt,_n){var Tn,Pn=wt.prefixCls,xr=wt.rtl,nr=wt.scrollOffset,ur=wt.scrollRange,Hn=wt.onStartMove,je=wt.onStopMove,it=wt.onScroll,St=wt.horizontal,Wt=wt.spinSize,He=wt.containerSize,ht=wt.style,Dt=wt.thumbStyle,_t=Me.useState(!1),Nt=(0,qe.Z)(_t,2),Pt=Nt[0],Bn=Nt[1],cr=Me.useState(null),Wn=(0,qe.Z)(cr,2),Un=Wn[0],qn=Wn[1],Jn=Me.useState(null),Mr=(0,qe.Z)(Jn,2),an=Mr[0],Fn=Mr[1],ci=!xr,gi=Me.useRef(),Vr=Me.useRef(),Dr=Me.useState(!1),wi=(0,qe.Z)(Dr,2),or=wi[0],oi=wi[1],hn=Me.useRef(),Vi=function(){clearTimeout(hn.current),oi(!0),hn.current=setTimeout(function(){oi(!1)},3e3)},Si=ur-He||0,pa=He-Wt||0,Wi=Si>0,_i=Me.useMemo(function(){if(nr===0||Si===0)return 0;var Aa=nr/Si;return Aa*pa},[nr,Si,pa]),ia=function(aa){aa.stopPropagation(),aa.preventDefault()},Ki=Me.useRef({top:_i,dragging:Pt,pageY:Un,startTop:an});Ki.current={top:_i,dragging:Pt,pageY:Un,startTop:an};var yi=function(aa){Bn(!0),qn(lt(aa,St)),Fn(Ki.current.top),Hn(),aa.stopPropagation(),aa.preventDefault()};Me.useEffect(function(){var Aa=function(dt){dt.preventDefault()},aa=gi.current,ni=Vr.current;return aa.addEventListener("touchstart",Aa),ni.addEventListener("touchstart",yi),function(){aa.removeEventListener("touchstart",Aa),ni.removeEventListener("touchstart",yi)}},[]);var Gi=Me.useRef();Gi.current=Si;var xa=Me.useRef();xa.current=pa,Me.useEffect(function(){if(Pt){var Aa,aa=function(dt){var It=Ki.current,Qt=It.dragging,Cn=It.pageY,vr=It.startTop;if(et.cancel(Aa),Qt){var gr=lt(dt,St)-Cn,Er=vr;!ci&&St?Er-=gr:Er+=gr;var Br=Gi.current,kr=xa.current,Yr=kr?Er/kr:0,si=Math.ceil(Yr*Br);si=Math.max(si,0),si=Math.min(si,Br),Aa=et(function(){it(si,St)})}},ni=function(){Bn(!1),je()};return window.addEventListener("mousemove",aa),window.addEventListener("touchmove",aa),window.addEventListener("mouseup",ni),window.addEventListener("touchend",ni),function(){window.removeEventListener("mousemove",aa),window.removeEventListener("touchmove",aa),window.removeEventListener("mouseup",ni),window.removeEventListener("touchend",ni),et.cancel(Aa)}}},[Pt]),Me.useEffect(function(){Vi()},[nr]),Me.useImperativeHandle(_n,function(){return{delayHidden:Vi}});var Xi="".concat(Pn,"-scrollbar"),Ti={position:"absolute",visibility:or&&Wi?null:"hidden"},wa={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return St?(Ti.height=8,Ti.left=0,Ti.right=0,Ti.bottom=0,wa.height="100%",wa.width=Wt,ci?wa.left=_i:wa.right=_i):(Ti.width=8,Ti.top=0,Ti.bottom=0,ci?Ti.right=0:Ti.left=0,wa.width="100%",wa.height=Wt,wa.top=_i),Me.createElement("div",{ref:gi,className:De()(Xi,(Tn={},(0,ye.Z)(Tn,"".concat(Xi,"-horizontal"),St),(0,ye.Z)(Tn,"".concat(Xi,"-vertical"),!St),(0,ye.Z)(Tn,"".concat(Xi,"-visible"),or),Tn)),style:(0,tt.Z)((0,tt.Z)({},Ti),ht),onMouseDown:ia,onMouseMove:Vi},Me.createElement("div",{ref:Vr,className:De()("".concat(Xi,"-thumb"),(0,ye.Z)({},"".concat(Xi,"-thumb-moving"),Pt)),style:(0,tt.Z)((0,tt.Z)({},wa),Dt),onMouseDown:yi}))}),_e=Ie;function Ue(wt){var _n=wt.children,Tn=wt.setRef,Pn=Me.useCallback(function(xr){Tn(xr)},[]);return Me.cloneElement(_n,{ref:Pn})}function Ze(wt,_n,Tn,Pn,xr,nr,ur){var Hn=ur.getKey;return wt.slice(_n,Tn+1).map(function(je,it){var St=_n+it,Wt=nr(je,St,{style:{width:Pn}}),He=Hn(je);return Me.createElement(Ue,{key:He,setRef:function(Dt){return xr(je,Dt)}},Wt)})}function At(wt){return wt instanceof HTMLElement||wt instanceof SVGElement}function bt(wt){return At(wt)?wt:wt instanceof Me.Component?we.findDOMNode(wt):null}var xt=ue(15671),Ge=ue(43144),Ot=function(){function wt(){(0,xt.Z)(this,wt),this.maps=void 0,this.id=0,this.maps=Object.create(null)}return(0,Ge.Z)(wt,[{key:"set",value:function(Tn,Pn){this.maps[Tn]=Pn,this.id+=1}},{key:"get",value:function(Tn){return this.maps[Tn]}}]),wt}(),kt=Ot;function vn(wt,_n,Tn){var Pn=Me.useState(0),xr=(0,qe.Z)(Pn,2),nr=xr[0],ur=xr[1],Hn=(0,Me.useRef)(new Map),je=(0,Me.useRef)(new kt),it=(0,Me.useRef)();function St(){et.cancel(it.current)}function Wt(){var ht=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;St();var Dt=function(){Hn.current.forEach(function(Nt,Pt){if(Nt&&Nt.offsetParent){var Bn=bt(Nt),cr=Bn.offsetHeight;je.current.get(Pt)!==cr&&je.current.set(Pt,Bn.offsetHeight)}}),ur(function(Nt){return Nt+1})};ht?Dt():it.current=et(Dt)}function He(ht,Dt){var _t=wt(ht),Nt=Hn.current.get(_t);Dt?(Hn.current.set(_t,Dt),Wt()):Hn.current.delete(_t),!Nt!=!Dt&&(Dt?_n==null||_n(ht):Tn==null||Tn(ht))}return(0,Me.useEffect)(function(){return St},[]),[He,Wt,je.current,nr]}function qt(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var cn=qt()?Me.useLayoutEffect:Me.useEffect,An=function(_n,Tn){var Pn=Me.useRef(!0);cn(function(){return _n(Pn.current)},Tn),cn(function(){return Pn.current=!1,function(){Pn.current=!0}},[])},Zn=function(_n,Tn){An(function(Pn){if(!Pn)return _n()},Tn)},Ye=An;function Ee(wt){var _n=Me.useRef();_n.current=wt;var Tn=Me.useCallback(function(){for(var Pn,xr=arguments.length,nr=new Array(xr),ur=0;ur<xr;ur++)nr[ur]=arguments[ur];return(Pn=_n.current)===null||Pn===void 0?void 0:Pn.call.apply(Pn,[_n].concat(nr))},[]);return Tn}function Tt(wt){var _n=React.useRef(!1),Tn=React.useState(wt),Pn=_slicedToArray(Tn,2),xr=Pn[0],nr=Pn[1];React.useEffect(function(){return _n.current=!1,function(){_n.current=!0}},[]);function ur(Hn,je){je&&_n.current||nr(Hn)}return[xr,ur]}function gn(wt){return wt!==void 0}function Xt(wt,_n){var Tn=_n||{},Pn=Tn.defaultValue,xr=Tn.value,nr=Tn.onChange,ur=Tn.postState,Hn=useState(function(){return gn(xr)?xr:gn(Pn)?typeof Pn=="function"?Pn():Pn:typeof wt=="function"?wt():wt}),je=_slicedToArray(Hn,2),it=je[0],St=je[1],Wt=xr!==void 0?xr:it,He=ur?ur(Wt):Wt,ht=useEvent(nr),Dt=useState([Wt]),_t=_slicedToArray(Dt,2),Nt=_t[0],Pt=_t[1];useLayoutUpdateEffect(function(){var cr=Nt[0];it!==cr&&ht(it,cr)},[Nt]),useLayoutUpdateEffect(function(){gn(xr)||St(xr)},[xr]);var Bn=useEvent(function(cr,Wn){St(cr,Wn),Pt([Wt],Wn)});return[He,Bn]}var Je=ue(31461);function rt(wt,_n,Tn){var Pn=React.useRef({});return(!("value"in Pn.current)||Tn(Pn.current.condition,_n))&&(Pn.current.value=wt(),Pn.current.condition=_n),Pn.current.value}function Ht(wt,_n){typeof wt=="function"?wt(_n):_typeof(wt)==="object"&&wt&&"current"in wt&&(wt.current=_n)}function Sn(){for(var wt=arguments.length,_n=new Array(wt),Tn=0;Tn<wt;Tn++)_n[Tn]=arguments[Tn];var Pn=_n.filter(function(xr){return xr});return Pn.length<=1?Pn[0]:function(xr){_n.forEach(function(nr){Ht(nr,xr)})}}function sn(){for(var wt=arguments.length,_n=new Array(wt),Tn=0;Tn<wt;Tn++)_n[Tn]=arguments[Tn];return useMemo(function(){return Sn.apply(void 0,_n)},_n,function(Pn,xr){return Pn.length!==xr.length||Pn.every(function(nr,ur){return nr!==xr[ur]})})}function $t(wt){var _n,Tn,Pn=isMemo(wt)?wt.type.type:wt.type;return!(typeof Pn=="function"&&!((_n=Pn.prototype)!==null&&_n!==void 0&&_n.render)||typeof wt=="function"&&!((Tn=wt.prototype)!==null&&Tn!==void 0&&Tn.render))}function Bt(wt){return!isValidElement(wt)||isFragment(wt)?!1:$t(wt)}function bn(wt,_n,Tn,Pn){if(!_n.length)return Tn;var xr=_toArray(_n),nr=xr[0],ur=xr.slice(1),Hn;return!wt&&typeof nr=="number"?Hn=[]:Array.isArray(wt)?Hn=_toConsumableArray(wt):Hn=_objectSpread({},wt),Pn&&Tn===void 0&&ur.length===1?delete Hn[nr][ur[0]]:Hn[nr]=bn(Hn[nr],ur,Tn,Pn),Hn}function dn(wt,_n,Tn){var Pn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return _n.length&&Pn&&Tn===void 0&&!get(wt,_n.slice(0,-1))?wt:bn(wt,_n,Tn,Pn)}function ke(wt){return _typeof(wt)==="object"&&wt!==null&&Object.getPrototypeOf(wt)===Object.prototype}function ce(wt){return Array.isArray(wt)?[]:{}}var le=typeof Reflect=="undefined"?Object.keys:Reflect.ownKeys;function ve(){for(var wt=arguments.length,_n=new Array(wt),Tn=0;Tn<wt;Tn++)_n[Tn]=arguments[Tn];var Pn=ce(_n[0]);return _n.forEach(function(xr){function nr(ur,Hn){var je=new Set(Hn),it=get(xr,ur),St=Array.isArray(it);if(St||ke(it)){if(!je.has(it)){je.add(it);var Wt=get(Pn,ur);St?Pn=dn(Pn,ur,[]):(!Wt||_typeof(Wt)!=="object")&&(Pn=dn(Pn,ur,ce(it))),le(it).forEach(function(He){nr([].concat(_toConsumableArray(ur),[He]),je)})}}else Pn=dn(Pn,ur,it)}nr([])}),Pn}var pe={},oe=[],ze=function(_n){oe.push(_n)};function yt(wt,_n){if(0)var Tn}function Vt(wt,_n){if(0)var Tn}function en(){pe={}}function un(wt,_n,Tn){!_n&&!pe[Tn]&&(wt(!1,Tn),pe[Tn]=!0)}function yn(wt,_n){un(yt,wt,_n)}function Jt(wt,_n){un(Vt,wt,_n)}yn.preMessage=ze,yn.resetWarned=en,yn.noteOnce=Jt;var Cr=null,Tr=10;function Rt(wt,_n,Tn,Pn,xr,nr,ur,Hn){var je=Me.useRef(),it=Me.useState(null),St=(0,qe.Z)(it,2),Wt=St[0],He=St[1];return Ye(function(){if(Wt&&Wt.times<Tr){if(!wt.current){He(function(Vi){return(0,tt.Z)({},Vi)});return}nr();var ht=Wt.targetAlign,Dt=Wt.originAlign,_t=Wt.index,Nt=Wt.offset,Pt=wt.current.clientHeight,Bn=!1,cr=ht,Wn=null;if(Pt){for(var Un=ht||Dt,qn=0,Jn=0,Mr=0,an=Math.min(_n.length-1,_t),Fn=0;Fn<=an;Fn+=1){var ci=xr(_n[Fn]);Jn=qn;var gi=Tn.get(ci);Mr=Jn+(gi===void 0?Pn:gi),qn=Mr}for(var Vr=Un==="top"?Nt:Pt-Nt,Dr=an;Dr>=0;Dr-=1){var wi=xr(_n[Dr]),or=Tn.get(wi);if(or===void 0){Bn=!0;break}if(Vr-=or,Vr<=0)break}switch(Un){case"top":Wn=Jn-Nt;break;case"bottom":Wn=Mr-Pt+Nt;break;default:{var oi=wt.current.scrollTop,hn=oi+Pt;Jn<oi?cr="top":Mr>hn&&(cr="bottom")}}Wn!==null&&ur(Wn),Wn!==Wt.lastTop&&(Bn=!0)}Bn&&He(function(Vi){return(0,tt.Z)((0,tt.Z)({},Vi),{},{times:Vi.times+1,targetAlign:cr,lastTop:Wn})})}},[Wt,wt.current]),function(ht){if(ht==null){Hn();return}if(et.cancel(je.current),typeof ht=="number")ur(ht);else if(ht&&(0,Fe.Z)(ht)==="object"){var Dt,_t=ht.align;"index"in ht?Dt=ht.index:Dt=_n.findIndex(function(Bn){return xr(Bn)===ht.key});var Nt=ht.offset,Pt=Nt===void 0?0:Nt;He({times:0,index:Dt,offset:Pt,originAlign:_t})}}}function Ln(wt,_n,Tn,Pn){var xr=Tn-wt,nr=_n-Tn,ur=Math.min(xr,nr)*2;if(Pn<=ur){var Hn=Math.floor(Pn/2);return Pn%2?Tn+Hn+1:Tn-Hn}return xr>nr?Tn-(Pn-nr):Tn+(Pn-xr)}function Nr(wt,_n,Tn){var Pn=wt.length,xr=_n.length,nr,ur;if(Pn===0&&xr===0)return null;Pn<xr?(nr=wt,ur=_n):(nr=_n,ur=wt);var Hn={__EMPTY_ITEM__:!0};function je(Dt){return Dt!==void 0?Tn(Dt):Hn}for(var it=null,St=Math.abs(Pn-xr)!==1,Wt=0;Wt<ur.length;Wt+=1){var He=je(nr[Wt]),ht=je(ur[Wt]);if(He!==ht){it=Wt,St=St||He!==je(ur[Wt+1]);break}}return it===null?null:{index:it,multiple:St}}function Qr(wt,_n,Tn){var Pn=Me.useState(wt),xr=(0,qe.Z)(Pn,2),nr=xr[0],ur=xr[1],Hn=Me.useState(null),je=(0,qe.Z)(Hn,2),it=je[0],St=je[1];return Me.useEffect(function(){var Wt=Nr(nr||[],wt||[],_n);(Wt==null?void 0:Wt.index)!==void 0&&(Tn==null||Tn(Wt.index),St(wt[Wt.index])),ur(wt)},[wt]),[it]}var Gn=(typeof navigator=="undefined"?"undefined":(0,Fe.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),Fr=Gn,Da=function(wt,_n){var Tn=(0,Me.useRef)(!1),Pn=(0,Me.useRef)(null);function xr(){clearTimeout(Pn.current),Tn.current=!0,Pn.current=setTimeout(function(){Tn.current=!1},50)}var nr=(0,Me.useRef)({top:wt,bottom:_n});return nr.current.top=wt,nr.current.bottom=_n,function(ur){var Hn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,je=ur<0&&nr.current.top||ur>0&&nr.current.bottom;return Hn&&je?(clearTimeout(Pn.current),Tn.current=!1):(!je||Tn.current)&&xr(),!Tn.current&&je}};function Fi(wt,_n,Tn,Pn,xr){var nr=(0,Me.useRef)(0),ur=(0,Me.useRef)(null),Hn=(0,Me.useRef)(null),je=(0,Me.useRef)(!1),it=Da(_n,Tn);function St(Nt,Pt){et.cancel(ur.current),nr.current+=Pt,Hn.current=Pt,!it(Pt)&&(Fr||Nt.preventDefault(),ur.current=et(function(){var Bn=je.current?10:1;xr(nr.current*Bn),nr.current=0}))}function Wt(Nt,Pt){xr(Pt,!0),Fr||Nt.preventDefault()}var He=(0,Me.useRef)(null),ht=(0,Me.useRef)(null);function Dt(Nt){if(wt){et.cancel(ht.current),ht.current=et(function(){He.current=null},2);var Pt=Nt.deltaX,Bn=Nt.deltaY,cr=Nt.shiftKey,Wn=Pt,Un=Bn;(He.current==="sx"||!He.current&&cr&&Bn&&!Pt)&&(Wn=Bn,Un=0,He.current="sx");var qn=Math.abs(Wn),Jn=Math.abs(Un);He.current===null&&(He.current=Pn&&qn>Jn?"x":"y"),He.current==="y"?St(Nt,Un):Wt(Nt,Wn)}}function _t(Nt){wt&&(je.current=Nt.detail===Hn.current)}return[Dt,_t]}var Oi=14/15;function Ei(wt,_n,Tn){var Pn=(0,Me.useRef)(!1),xr=(0,Me.useRef)(0),nr=(0,Me.useRef)(null),ur=(0,Me.useRef)(null),Hn,je=function(He){if(Pn.current){var ht=Math.ceil(He.touches[0].pageY),Dt=xr.current-ht;xr.current=ht,Tn(Dt)&&He.preventDefault(),clearInterval(ur.current),ur.current=setInterval(function(){Dt*=Oi,(!Tn(Dt,!0)||Math.abs(Dt)<=.1)&&clearInterval(ur.current)},16)}},it=function(){Pn.current=!1,Hn()},St=function(He){Hn(),He.touches.length===1&&!Pn.current&&(Pn.current=!0,xr.current=Math.ceil(He.touches[0].pageY),nr.current=He.target,nr.current.addEventListener("touchmove",je),nr.current.addEventListener("touchend",it))};Hn=function(){nr.current&&(nr.current.removeEventListener("touchmove",je),nr.current.removeEventListener("touchend",it))},Ye(function(){return wt&&_n.current.addEventListener("touchstart",St),function(){var Wt;(Wt=_n.current)===null||Wt===void 0||Wt.removeEventListener("touchstart",St),Hn(),clearInterval(ur.current)}},[wt])}var ua=20;function ba(){var wt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,_n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Tn=wt/_n*100;return isNaN(Tn)&&(Tn=0),Tn=Math.max(Tn,ua),Tn=Math.min(Tn,wt/2),Math.floor(Tn)}function ka(wt,_n,Tn,Pn){var xr=Me.useMemo(function(){return[new Map,[]]},[wt,Tn.id,Pn]),nr=(0,qe.Z)(xr,2),ur=nr[0],Hn=nr[1],je=function(St){var Wt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:St,He=ur.get(St),ht=ur.get(Wt);if(He===void 0||ht===void 0)for(var Dt=wt.length,_t=Hn.length;_t<Dt;_t+=1){var Nt,Pt=wt[_t],Bn=_n(Pt);ur.set(Bn,_t);var cr=(Nt=Tn.get(Bn))!==null&&Nt!==void 0?Nt:Pn;if(Hn[_t]=(Hn[_t-1]||0)+cr,Bn===St&&(He=_t),Bn===Wt&&(ht=_t),He!==void 0&&ht!==void 0)break}return{top:Hn[He-1]||0,bottom:Hn[ht]}};return je}var ca=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles"],Hr=[],La={overflowY:"auto",overflowAnchor:"none"};function fo(wt,_n){var Tn=wt.prefixCls,Pn=Tn===void 0?"rc-virtual-list":Tn,xr=wt.className,nr=wt.height,ur=wt.itemHeight,Hn=wt.fullHeight,je=Hn===void 0?!0:Hn,it=wt.style,St=wt.data,Wt=wt.children,He=wt.itemKey,ht=wt.virtual,Dt=wt.direction,_t=wt.scrollWidth,Nt=wt.component,Pt=Nt===void 0?"div":Nt,Bn=wt.onScroll,cr=wt.onVirtualScroll,Wn=wt.onVisibleChange,Un=wt.innerProps,qn=wt.extraRender,Jn=wt.styles,Mr=(0,Ce.Z)(wt,ca),an=!!(ht!==!1&&nr&&ur),Fn=an&&St&&(ur*St.length>nr||!!_t),ci=Dt==="rtl",gi=De()(Pn,(0,ye.Z)({},"".concat(Pn,"-rtl"),ci),xr),Vr=St||Hr,Dr=(0,Me.useRef)(),wi=(0,Me.useRef)(),or=(0,Me.useState)(0),oi=(0,qe.Z)(or,2),hn=oi[0],Vi=oi[1],Si=(0,Me.useState)(0),pa=(0,qe.Z)(Si,2),Wi=pa[0],_i=pa[1],ia=(0,Me.useState)(!1),Ki=(0,qe.Z)(ia,2),yi=Ki[0],Gi=Ki[1],xa=function(){Gi(!0)},Xi=function(){Gi(!1)},Ti=Me.useCallback(function(Zt){return typeof He=="function"?He(Zt):Zt==null?void 0:Zt[He]},[He]),wa={getKey:Ti};function Aa(Zt){Vi(function(wn){var kn;typeof Zt=="function"?kn=Zt(wn):kn=Zt;var er=Nn(kn);return Dr.current.scrollTop=er,er})}var aa=(0,Me.useRef)({start:0,end:Vr.length}),ni=(0,Me.useRef)(),pt=Qr(Vr,Ti),dt=(0,qe.Z)(pt,1),It=dt[0];ni.current=It;var Qt=vn(Ti,null,null),Cn=(0,qe.Z)(Qt,4),vr=Cn[0],gr=Cn[1],Er=Cn[2],Br=Cn[3],kr=Me.useMemo(function(){if(!an)return{scrollHeight:void 0,start:0,end:Vr.length-1,offset:void 0};if(!Fn){var Zt;return{scrollHeight:((Zt=wi.current)===null||Zt===void 0?void 0:Zt.offsetHeight)||0,start:0,end:Vr.length-1,offset:void 0}}for(var wn=0,kn,er,Mn,dr=Vr.length,Lr=0;Lr<dr;Lr+=1){var pr=Vr[Lr],wr=Ti(pr),ir=Er.get(wr),yr=wn+(ir===void 0?ur:ir);yr>=hn&&kn===void 0&&(kn=Lr,er=wn),yr>hn+nr&&Mn===void 0&&(Mn=Lr),wn=yr}return kn===void 0&&(kn=0,er=0,Mn=Math.ceil(nr/ur)),Mn===void 0&&(Mn=Vr.length-1),Mn=Math.min(Mn+1,Vr.length-1),{scrollHeight:wn,start:kn,end:Mn,offset:er}},[Fn,an,hn,Vr,Br,nr]),Yr=kr.scrollHeight,si=kr.start,bi=kr.end,Hi=kr.offset;aa.current.start=si,aa.current.end=bi;var Ri=Me.useState({width:0,height:nr}),Di=(0,qe.Z)(Ri,2),Le=Di[0],Re=Di[1],Oe=function(wn){Re({width:wn.width||wn.offsetWidth,height:wn.height||wn.offsetHeight})},We=(0,Me.useRef)(),nt=(0,Me.useRef)(),st=Me.useMemo(function(){return ba(Le.width,_t)},[Le.width,_t]),mt=Me.useMemo(function(){return ba(Le.height,Yr)},[Le.height,Yr]),zt=Yr-nr,jt=(0,Me.useRef)(zt);jt.current=zt;function Nn(Zt){var wn=Zt;return Number.isNaN(jt.current)||(wn=Math.min(wn,jt.current)),wn=Math.max(wn,0),wn}var Qn=hn<=0,Dn=hn>=zt,tn=Da(Qn,Dn),Yt=function(){return{x:ci?-Wi:Wi,y:hn}},fn=(0,Me.useRef)(Yt()),xn=Ee(function(){if(cr){var Zt=Yt();(fn.current.x!==Zt.x||fn.current.y!==Zt.y)&&(cr(Zt),fn.current=Zt)}});function Yn(Zt,wn){var kn=Zt;wn?((0,we.flushSync)(function(){_i(kn)}),xn()):Aa(kn)}function $n(Zt){var wn=Zt.currentTarget.scrollTop;wn!==hn&&Aa(wn),Bn==null||Bn(Zt),xn()}var On=function(wn){var kn=wn,er=_t-Le.width;return kn=Math.max(kn,0),kn=Math.min(kn,er),kn},Kn=Ee(function(Zt,wn){wn?((0,we.flushSync)(function(){_i(function(kn){var er=kn+(ci?-Zt:Zt);return On(er)})}),xn()):Aa(function(kn){var er=kn+Zt;return er})}),zn=Fi(an,Qn,Dn,!!_t,Kn),tr=(0,qe.Z)(zn,2),$e=tr[0],Ke=tr[1];Ei(an,Dr,function(Zt,wn){return tn(Zt,wn)?!1:($e({preventDefault:function(){},deltaY:Zt}),!0)}),Ye(function(){function Zt(kn){an&&kn.preventDefault()}var wn=Dr.current;return wn.addEventListener("wheel",$e),wn.addEventListener("DOMMouseScroll",Ke),wn.addEventListener("MozMousePixelScroll",Zt),function(){wn.removeEventListener("wheel",$e),wn.removeEventListener("DOMMouseScroll",Ke),wn.removeEventListener("MozMousePixelScroll",Zt)}},[an]),Ye(function(){_t&&_i(function(Zt){return On(Zt)})},[Le.width,_t]);var Ct=function(){var wn,kn;(wn=We.current)===null||wn===void 0||wn.delayHidden(),(kn=nt.current)===null||kn===void 0||kn.delayHidden()},ft=Rt(Dr,Vr,Er,ur,Ti,function(){return gr(!0)},Aa,Ct);Me.useImperativeHandle(_n,function(){return{getScrollInfo:Yt,scrollTo:function(wn){function kn(er){return er&&(0,Fe.Z)(er)==="object"&&("left"in er||"top"in er)}kn(wn)?(wn.left!==void 0&&_i(On(wn.left)),ft(wn.top)):ft(wn)}}}),Ye(function(){if(Wn){var Zt=Vr.slice(si,bi+1);Wn(Zt,Vr)}},[si,bi,Vr]);var Kt=ka(Vr,Ti,Er,ur),on=qn==null?void 0:qn({start:si,end:bi,virtual:Fn,offsetX:Wi,offsetY:Hi,rtl:ci,getSize:Kt}),nn=Ze(Vr,si,bi,_t,vr,Wt,wa),En=null;nr&&(En=(0,tt.Z)((0,ye.Z)({},je?"height":"maxHeight",nr),La),an&&(En.overflowY="hidden",_t&&(En.overflowX="hidden"),yi&&(En.pointerEvents="none")));var pn={};return ci&&(pn.dir="rtl"),Me.createElement("div",(0,be.Z)({style:(0,tt.Z)((0,tt.Z)({},it),{},{position:"relative"}),className:gi},pn,Mr),Me.createElement(ct.Z,{onResize:Oe},Me.createElement(Pt,{className:"".concat(Pn,"-holder"),style:En,ref:Dr,onScroll:$n,onMouseEnter:Ct},Me.createElement(Mt,{prefixCls:Pn,height:Yr,offsetX:Wi,offsetY:Hi,scrollWidth:_t,onInnerResize:gr,ref:wi,innerProps:Un,rtl:ci,extra:on},nn))),Fn&&Yr>nr&&Me.createElement(_e,{ref:We,prefixCls:Pn,scrollOffset:hn,scrollRange:Yr,rtl:ci,onScroll:Yn,onStartMove:xa,onStopMove:Xi,spinSize:mt,containerSize:Le.height,style:Jn==null?void 0:Jn.verticalScrollBar,thumbStyle:Jn==null?void 0:Jn.verticalScrollBarThumb}),Fn&&_t&&Me.createElement(_e,{ref:nt,prefixCls:Pn,scrollOffset:Wi,scrollRange:_t,rtl:ci,onScroll:Yn,onStartMove:xa,onStopMove:Xi,spinSize:st,containerSize:Le.width,horizontal:!0,style:Jn==null?void 0:Jn.horizontalScrollBar,thumbStyle:Jn==null?void 0:Jn.horizontalScrollBarThumb}))}var Za=Me.forwardRef(fo);Za.displayName="List";var Wa=Za,ha=Wa},66392:function(mn,Ut){"use strict";var ue;var be=Symbol.for("react.element"),tt=Symbol.for("react.portal"),Fe=Symbol.for("react.fragment"),qe=Symbol.for("react.strict_mode"),ye=Symbol.for("react.profiler"),Ce=Symbol.for("react.provider"),Me=Symbol.for("react.context"),we=Symbol.for("react.server_context"),he=Symbol.for("react.forward_ref"),De=Symbol.for("react.suspense"),ct=Symbol.for("react.suspense_list"),Ne=Symbol.for("react.memo"),Mt=Symbol.for("react.lazy"),ut=Symbol.for("react.offscreen"),Qe;Qe=Symbol.for("react.module.reference");function Xe(Te){if(typeof Te=="object"&&Te!==null){var Et=Te.$$typeof;switch(Et){case be:switch(Te=Te.type,Te){case Fe:case ye:case qe:case De:case ct:return Te;default:switch(Te=Te&&Te.$$typeof,Te){case we:case Me:case he:case Mt:case Ne:case Ce:return Te;default:return Et}}case tt:return Et}}}ue=Me,ue=Ce,ue=be,ue=he,ue=Fe,ue=Mt,ue=Ne,ue=tt,ue=ye,ue=qe,ue=De,ue=ct,ue=function(){return!1},ue=function(){return!1},ue=function(Te){return Xe(Te)===Me},ue=function(Te){return Xe(Te)===Ce},ue=function(Te){return typeof Te=="object"&&Te!==null&&Te.$$typeof===be},ue=function(Te){return Xe(Te)===he},ue=function(Te){return Xe(Te)===Fe},ue=function(Te){return Xe(Te)===Mt},ue=function(Te){return Xe(Te)===Ne},ue=function(Te){return Xe(Te)===tt},ue=function(Te){return Xe(Te)===ye},ue=function(Te){return Xe(Te)===qe},ue=function(Te){return Xe(Te)===De},ue=function(Te){return Xe(Te)===ct},ue=function(Te){return typeof Te=="string"||typeof Te=="function"||Te===Fe||Te===ye||Te===qe||Te===De||Te===ct||Te===ut||typeof Te=="object"&&Te!==null&&(Te.$$typeof===Mt||Te.$$typeof===Ne||Te.$$typeof===Ce||Te.$$typeof===Me||Te.$$typeof===he||Te.$$typeof===Qe||Te.getModuleId!==void 0)},ue=Xe},31461:function(mn,Ut,ue){"use strict";ue(66392)},84279:function(mn,Ut,ue){"use strict";var be=Object.defineProperty,tt=Object.defineProperties,Fe=Object.getOwnPropertyDescriptors,qe=Object.getOwnPropertySymbols,ye=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,Me=(a,y,b)=>y in a?be(a,y,{enumerable:!0,configurable:!0,writable:!0,value:b}):a[y]=b,we=(a,y)=>{for(var b in y||(y={}))ye.call(y,b)&&Me(a,b,y[b]);if(qe)for(var b of qe(y))Ce.call(y,b)&&Me(a,b,y[b]);return a},he=(a,y)=>tt(a,Fe(y)),De=a=>typeof a=="symbol"?a:a+"",ct=(a,y)=>{var b={};for(var E in a)ye.call(a,E)&&y.indexOf(E)<0&&(b[E]=a[E]);if(a!=null&&qe)for(var E of qe(a))y.indexOf(E)<0&&Ce.call(a,E)&&(b[E]=a[E]);return b};function Ne(a){return Array.isArray(a)}var Mt={en:{"keyboard.tooltip.symbols":"\u7B26\u53F7","keyboard.tooltip.greek":"\u5E0C\u814A\u5B57\u6BCD","keyboard.tooltip.numeric":"\u6570\u5B57","keyboard.tooltip.alphabetic":"\u7F57\u9A6C\u5B57\u6BCD","tooltip.cut to clipboard":"\u526A\u5207\u5230\u526A\u8D34\u677F","tooltip.copy to clipboard":"\u590D\u5236\u5230\u526A\u8D34\u677F","tooltip.paste from clipboard":"\u7C98\u8D34","tooltip.redo":"\u91CD\u505A","tooltip.toggle virtual keyboard":"\u5207\u6362\u865A\u62DF\u952E\u76D8","tooltip.undo":"\u64A4\u6D88","menu.insert matrix":"\u63D2\u5165\u77E9\u9635","menu.borders":"\u77E9\u9635\u5206\u9694\u7B26","menu.array.add row above":"\u5728\u540E\u9762\u6DFB\u52A0\u884C","menu.array.add row below":"\u5728\u524D\u9762\u6DFB\u52A0\u884C","menu.array.add column after":"\u5728\u540E\u9762\u6DFB\u52A0\u5217r","menu.array.add column before":"\u5728\u524D\u9762\u6DFB\u52A0\u5217","menu.array.delete row":"\u5220\u9664\u884C","menu.array.delete rows":"\u5220\u9664\u9009\u5B9A\u884C","menu.array.delete column":"\u5220\u9664\u5217","menu.array.delete columns":"\u5220\u9664\u9009\u5B9A\u7684\u5217","menu.mode":"\u6A21\u5F0F","menu.mode-math":"\u6570\u5B66","menu.mode-text":"\u6587\u672C","menu.mode-latex":"LaTeX","tooltip.blackboard":"\u9ED1\u677F","tooltip.bold":"\u7C97\u4F53","tooltip.italic":"\u659C\u4F53","tooltip.fraktur":"Fraktur","tooltip.script":"\u811A\u672C","tooltip.caligraphic":"\u8349\u4E66","tooltip.typewriter":"\u6253\u5B57\u673A","tooltip.roman-upright":"\u7F57\u9A6C\u76F4\u7ACB","tooltip.row-by-col":"%@ \xD7 %@","menu.font-style":"\u5B57\u4F53\u6837\u5F0F","menu.accent":"\u91CD\u97F3","menu.decoration":"\u88C5\u9970","menu.color":"\u989C\u8272","menu.background-color":"\u80CC\u666F","menu.evaluate":"\u8BA1\u7B97","menu.simplify":"\u7B80\u5316","menu.solve":"\u6C42\u89E3","menu.solve-for":"\u6C42\u89E3 %@","menu.cut":"\u526A\u5207","menu.copy":"\u590D\u5236","menu.copy-as-latex":"\u590D\u5236\u4E3A LaTeX","menu.copy-as-ascii-math":"\u590D\u5236\u4E3A ASCII Math","menu.copy-as-mathml":"\u590D\u5236\u4E3A MathML","menu.paste":"\u7C98\u8D34","menu.select-all":"\u5168\u9009","color.red":"\u7EA2\u8272","color.orange":"\u6A59\u8272","color.yellow":"\u9EC4\u8272","color.lime":"\u7EFF\u9EC4\u8272","color.green":"\u7EFF\u8272","color.teal":"\u9752\u8272","color.cyan":"\u84DD\u7EFF\u8272","color.blue":"\u84DD\u8272","color.indigo":"\u975B\u84DD\u8272","color.purple":"\u7D2B\u8272","color.magenta":"\u6D0B\u7EA2\u8272","color.black":"\u9ED1\u8272","color.dark-grey":"\u6DF1\u7070\u8272","color.grey":"\u7070\u8272","color.light-grey":"\u6D45\u7070\u8272","color.white":"\u767D\u8272"}};function ut(){return"window"in globalThis&&"document"in globalThis}function Qe(){return"matchMedia"in window?window.matchMedia("(pointer: coarse)").matches:"ontouchstart"in window||navigator.maxTouchPoints>0}function Xe(){return typeof navigator.vibrate=="function"}function Te(){var a,y;if(!ut())return"other";const b=(y=(a=navigator.userAgentData)==null?void 0:a.platform)!=null?y:navigator.platform;return/^mac/i.test(b)?navigator.maxTouchPoints===5?"ios":"macos":/^win/i.test(b)?"windows":/android/i.test(navigator.userAgent)?"android":/iphone|ipod|ipad/i.test(navigator.userAgent)?"ios":/\bcros\b/i.test(navigator.userAgent)?"chromeos":"other"}function Et(){if(!ut())return!0;if(/firefox/i.test(navigator.userAgent)){const a=navigator.userAgent.match(/firefox\/(\d+)/i);return a?parseInt(a[1])>=78:!1}if(/trident/i.test(navigator.userAgent))return!1;if(/edge/i.test(navigator.userAgent)){const a=navigator.userAgent.match(/edg\/(\d+)/i);return a?parseInt(a[1])>=79:!1}return!0}function Lt(){return HTMLElement.prototype.hasOwnProperty("popover")}var et={strings:Mt,_locale:"",_dirty:!1,_subscribers:[],_numberFormatter:void 0,get locale(){return et._locale||(et._locale=ut()?navigator.language.slice(0,5):"en-US"),et._locale},set locale(a){et._locale=a,et._numberFormatter=void 0,et.dirty=!0},get numberFormatter(){return et._numberFormatter||(et._numberFormatter=new Intl.NumberFormat(et.locale)),et._numberFormatter},merge(a,y){if(typeof a=="string"&&y)et.strings[a]=we(we({},et.strings[a]),y),et.dirty=!0;else for(const b of Object.keys(a))et.merge(b,a[b])},get dirty(){return et._dirty},set dirty(a){et._dirty||et._dirty===a||(et._dirty=!0,setTimeout(()=>{et._dirty=!1,this._subscribers.forEach(y=>y==null?void 0:y())},0))},subscribe(a){return et._subscribers.push(a),et._subscribers.length-1},unsubscribe(a){a<0||a>=et._subscribers.length||(et._subscribers[a]=void 0)},update(a){let y=a.querySelectorAll("[data-l10n-tooltip]");for(const b of y){const E=b.getAttribute("data-l10n-tooltip");if(E){const ee=lt(E);ee&&b.setAttribute("data-tooltip",ee)}}y=a.querySelectorAll("[data-l10n-arial-label]");for(const b of y){const E=b.getAttribute("data-l10n-arial-label");if(E){const ee=lt(E);ee&&b.setAttribute("aria-label",ee)}}}};function lt(a,...y){if(a===void 0)return;let b="";const E=et.locale;et.strings[E]&&(b=et.strings[E][a]);const ee=E.slice(0,2);if(!b&&et.strings[ee]&&(b=et.strings[ee][a]),b||(b=et.strings.en[a]),!b)return;const re=/(%@|%([0-9]+)\$@)/g;let ae=re.exec(b),de=0;for(;ae;){if(y[de++]){const ge=ae[2]?parseInt(ae[2],10)-1:de-1;let xe=y[ge];typeof xe=="number"&&(xe=et.numberFormatter.format(xe)),b=b.replace(ae[1],xe)}ae=re.exec(b)}return b=b.replace(/%%/g,"%"),b}var Ie={m0:"#3F3D99",m1:"#993D71",m2:"#998B3D",m3:"#3D9956",m4:"#3D5A99",m5:"#993D90",m6:"#996D3D",m7:"#43993D",m8:"#3D7999",m9:"#843D99"},_e={blue:"#0072BD",orange:"#D95319",yellow:"#EDB120",purple:"#7E2F8E",green:"#77AC30",cyan:"#4DBEEE",red:"#A2142F"},Ue={red:"#fbbbb6",orange:"#ffe0c2",yellow:"#fff1c2",lime:"#d0e8b9",green:"#bceac4",teal:"#b9f1f1",cyan:"#b8e5c9",blue:"#b6d9fb",indigo:"#d1c2f0",purple:"#e3baf8",magenta:"#f9c8e0",black:"#353535","dark-grey":"#8C8C8C",grey:"#D0D0D0","light-grey":"#F0F0F0",white:"#ffffff"},Ze={red:"#d7170b",orange:"#fe8a2b",yellow:"#ffc02b",lime:"#63b215",green:"#21ba3a",teal:"#17cfcf",cyan:"#13a7ec",blue:"#0d80f2",indigo:"#63c",purple:"#a219e6",magenta:"#eb4799",black:"#000","dark-grey":"#666",grey:"#A6A6A6","light-grey":"#d4d5d2",white:"#ffffff"},At={Red:"red",Orange:"orange",Yellow:"yellow",LimeGreen:"lime",Green:"green",TealBlue:"teal",Blue:"blue",Violet:"indigo",Purple:"purple",Magenta:"magenta",Black:"black",Gray:"grey",White:"white"},bt={Apricot:"#FBB982",Aquamarine:"#00B5BE",Bittersweet:"#C04F17",Black:"#221E1F",Blue:"#2D2F92",BlueGreen:"#00B3B8",BlueViolet:"#473992",BrickRed:"#B6321C",Brown:"#792500",BurntOrange:"#F7921D",CadetBlue:"#74729A",CarnationPink:"#F282B4",Cerulean:"#00A2E3",CornflowerBlue:"#41B0E4",Cyan:"#00AEEF",Dandelion:"#FDBC42",DarkOrchid:"#A4538A",Emerald:"#00A99D",ForestGreen:"#009B55",Fuchsia:"#8C368C",Goldenrod:"#FFDF42",Gray:"#949698",Green:"#00A64F",GreenYellow:"#DFE674",JungleGreen:"#00A99A",Lavender:"#F49EC4",Limegreen:"#8DC73E",Magenta:"#EC008C",Mahogany:"#A9341F",Maroon:"#AF3235",Melon:"#F89E7B",MidnightBlue:"#006795",Mulberry:"#A93C93",NavyBlue:"#006EB8",OliveGreen:"#3C8031",Orange:"#F58137",OrangeRed:"#ED135A",Orchid:"#AF72B0",Peach:"#F7965A",Periwinkle:"#7977B8",PineGreen:"#008B72",Plum:"#92268F",ProcessBlue:"#00B0F0",Purple:"#99479B",RawSienna:"#974006",Red:"#ED1B23",RedOrange:"#F26035",RedViolet:"#A1246B",Rhodamine:"#EF559F",RoyalBlue:"#0071BC",RoyalPurple:"#613F99",RubineRed:"#ED017D",Salmon:"#F69289",SeaGreen:"#3FBC9D",Sepia:"#671800",SkyBlue:"#46C5DD",SpringGreen:"#C6DC67",Tan:"#DA9D76",TealBlue:"#00AEB3",Thistle:"#D883B7",Turquoise:"#00B4CE",Violet:"#58429B",VioletRed:"#EF58A0",White:"#FFFFFF",WildStrawberry:"#EE2967",Yellow:"#FFF200",YellowGreen:"#98CC70",YellowOrange:"#FAA21A"};function xt(a){var y,b,E,ee,re,ae;const de=a.split("!");let fe,ge,xe,Be=255,Ve=255,ot=255,gt=-1;const ln=de.length>0&&de[0].startsWith("-");ln&&(de[0]=de[0].slice(1));for(let ar=0;ar<de.length;ar++){fe=Be,ge=Ve,xe=ot;const rn=(y=de[ar].trim().match(/^([A-Za-z\d-]+)/))==null?void 0:y[1],Vn=rn==null?void 0:rn.toLowerCase(),lr=rn&&(ae=(re=(ee=(E=(b=Ze[Vn])!=null?b:Ze[At[rn]])!=null?E:_e[rn])!=null?ee:bt[rn])!=null?re:Ie[rn])!=null?ae:de[ar].trim();let jn=lr.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(jn!=null&&jn[1]&&jn[2]&&jn[3])Be=Math.max(0,Math.min(255,Number.parseInt(jn[1],16))),Ve=Math.max(0,Math.min(255,Number.parseInt(jn[2],16))),ot=Math.max(0,Math.min(255,Number.parseInt(jn[3],16)));else if(jn=lr.match(/^#([\da-f]{3})$/i),jn!=null&&jn[1]){const Kr=Number.parseInt(jn[1][0],16),ai=Number.parseInt(jn[1][1],16),jr=Number.parseInt(jn[1][2],16);Be=Math.max(0,Math.min(255,Kr*16+Kr)),Ve=Math.max(0,Math.min(255,ai*16+ai)),ot=Math.max(0,Math.min(255,jr*16+jr))}else if(jn=lr.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i),jn!=null&&jn[1]&&jn[2]&&jn[3])Be=Math.max(0,Math.min(255,Number.parseInt(jn[1]))),Ve=Math.max(0,Math.min(255,Number.parseInt(jn[2]))),ot=Math.max(0,Math.min(255,Number.parseInt(jn[3])));else return;gt>=0&&(Be=(1-gt)*Be+gt*fe,Ve=(1-gt)*Ve+gt*ge,ot=(1-gt)*ot+gt*xe,gt=-1),ar+1<de.length&&(gt=Math.max(0,Math.min(100,Number.parseInt(de[++ar])))/100)}return gt>=0&&(Be=gt*Be+(1-gt)*fe,Ve=gt*Ve+(1-gt)*ge,ot=gt*ot+(1-gt)*xe),ln&&(Be=255-Be,Ve=255-Ve,ot=255-ot),"#"+("00"+Math.round(Be).toString(16)).slice(-2)+("00"+Math.round(Ve).toString(16)).slice(-2)+("00"+Math.round(ot).toString(16)).slice(-2)}function Ge(a){var y,b;return a=a.trim(),(b=(y=Ue[a.toLowerCase()])!=null?y:Ue[At[a]])!=null?b:xt(a)}function Ot(a){if(!a||a[0]!=="#")return;a=a.slice(1);let y;return a.length<=4?(y={r:parseInt(a[0]+a[0],16),g:parseInt(a[1]+a[1],16),b:parseInt(a[2]+a[2],16)},a.length===4&&(y.a=parseInt(a[3]+a[3],16)/255)):(y={r:parseInt(a[0]+a[1],16),g:parseInt(a[2]+a[3],16),b:parseInt(a[4]+a[5],16)},a.length===8&&(y.a=parseInt(a[6]+a[7],16)/255)),y&&y.a===void 0&&(y.a=1),y}function kt(a,y,b){return b<0&&(b+=6),b>=6&&(b-=6),b<1?(y-a)*b+a:b<3?y:b<4?(y-a)*(4-b)+a:a}function vn(a){let[y,b,E]=[a.h,a.s,a.l];y=(y+360)%360/60,E=Math.max(0,Math.min(E,1)),b=Math.max(0,Math.min(b,1));const ee=E<=.5?E*(b+1):E+b-E*b,re=E*2-ee;return{r:Math.round(255*kt(re,ee,y+2)),g:Math.round(255*kt(re,ee,y)),b:Math.round(255*kt(re,ee,y-2))}}function qt(a){return a<0?0:a>255?255:Math.round(a)}function cn(a){const{r:y,g:b,b:E}=a;let ee=((1<<24)+(qt(y)<<16)+(qt(b)<<8)+qt(E)).toString(16).slice(1);return ee[0]===ee[1]&&ee[2]===ee[3]&&ee[4]===ee[5]&&ee[6]===ee[7]&&(ee=ee[0]+ee[2]+ee[4]),"#"+ee}function An(a){let{r:y,g:b,b:E}=a;y=y/255,b=b/255,E=E/255;const ee=Math.min(y,b,E),re=Math.max(y,b,E),ae=re-ee;let de,fe;re===ee?de=0:y===re?de=(b-E)/ae:b===re?de=2+(E-y)/ae:E===re&&(de=4+(y-b)/ae),de=Math.min(de*60,360),de<0&&(de+=360);const ge=(ee+re)/2;return re===ee?fe=0:ge<=.5?fe=ae/(re+ee):fe=ae/(2-re-ee),{h:de,s:fe,l:ge}}function Zn(a){let y=Ot(a);if(!y)return a;let{h:b,s:E,l:ee}=An(y);return E+=.1,ee-=.1,cn(vn({h:b,s:E,l:ee}))}var Ye={60:"\\lt",62:"\\gt",111:"o",38:"\\&",123:"\\lbrace",125:"\\rbrace",91:"\\lbrack",93:"\\rbrack",58:"\\colon",160:"~",172:"\\neg",183:"\\cdot",188:"\\frac{1}{4}",189:"\\frac{1}{2}",190:"\\frac{3}{4}",8304:"^{0}",8305:"^{i}",185:"^{1}",178:"^{2}",179:"^{3}",8224:"\\dagger",8225:"\\ddagger",8230:"\\ldots",8308:"^{4}",8309:"^{5}",8310:"^{6}",8311:"^{7}",8312:"^{8}",8313:"^{9}",8314:"^{+}",8315:"^{-}",8316:"^{=}",8319:"^{n}",8320:"_{0}",8321:"_{1}",8322:"_{2}",8323:"_{3}",8324:"_{4}",8325:"_{5}",8326:"_{6}",8327:"_{7}",8328:"_{8}",8329:"_{9}",8330:"_{+}",8331:"_{-}",8332:"_{=}",8336:"_{a}",8337:"_{e}",8338:"_{o}",8339:"_{x}",8242:"\\prime",39:"\\prime",8592:"\\gets",8594:"\\to",9651:"\\triangle",9661:"\\triangledown",8715:"\\owns",8727:"\\ast",8739:"\\vert",8741:"\\Vert",8743:"\\land",8744:"\\lor",8901:"\\cdot",8904:"\\bowtie",8800:"\\ne",8804:"\\le",8805:"\\ge",8869:"\\bot",10231:"\\biconditional",10232:"\\impliedby",10233:"\\implies",10234:"\\iff",8450:"\\mathbb{C}",8469:"\\mathbb{N}",8473:"\\mathbb{P}",8474:"\\mathbb{Q}",8477:"\\mathbb{R}",8484:"\\mathbb{Z}",8461:"\\mathbb{H}",8476:"\\Re",8465:"\\Im",42:"\\ast",11036:"\\square",9633:"\\square",8720:"\\coprod",8716:"\\not\\ni",9671:"\\diamond",8846:"\\uplus",8851:"\\sqcap",8852:"\\sqcup",8768:"\\wr",8750:"\\oint",8226:"\\textbullet",8722:"-",978:"\\Upsilon"},Ee={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},Tt=[{start:119808,len:26,offset:65,style:"bold"},{start:119834,len:26,offset:97,style:"bold"},{start:119860,len:26,offset:65,style:"italic"},{start:119886,len:26,offset:97,style:"italic"},{start:119912,len:26,offset:65,style:"bolditalic"},{start:119938,len:26,offset:97,style:"bolditalic"},{start:119964,len:26,offset:65,variant:"script"},{start:119990,len:26,offset:97,variant:"script"},{start:120016,len:26,offset:65,variant:"script",style:"bold"},{start:120042,len:26,offset:97,variant:"script",style:"bold"},{start:120068,len:26,offset:65,variant:"fraktur"},{start:120094,len:26,offset:97,variant:"fraktur"},{start:120172,len:26,offset:65,variant:"fraktur",style:"bold"},{start:120198,len:26,offset:97,variant:"fraktur",style:"bold"},{start:120120,len:26,offset:65,variant:"double-struck"},{start:120146,len:26,offset:97,variant:"double-struck"},{start:120224,len:26,offset:65,variant:"sans-serif"},{start:120250,len:26,offset:97,variant:"sans-serif"},{start:120276,len:26,offset:65,variant:"sans-serif",style:"bold"},{start:120302,len:26,offset:97,variant:"sans-serif",style:"bold"},{start:120328,len:26,offset:65,variant:"sans-serif",style:"italic"},{start:120354,len:26,offset:97,variant:"sans-serif",style:"italic"},{start:120380,len:26,offset:65,variant:"sans-serif",style:"bolditalic"},{start:120406,len:26,offset:97,variant:"sans-serif",style:"bolditalic"},{start:120432,len:26,offset:65,variant:"monospace"},{start:120458,len:26,offset:97,variant:"monospace"},{start:120488,len:25,offset:913,style:"bold"},{start:120514,len:25,offset:945,style:"bold"},{start:120546,len:25,offset:913,style:"italic"},{start:120572,len:25,offset:945,style:"italic"},{start:120604,len:25,offset:913,style:"bolditalic"},{start:120630,len:25,offset:945,style:"bolditalic"},{start:120662,len:25,offset:913,variant:"sans-serif",style:"bold"},{start:120688,len:25,offset:945,variant:"sans-serif",style:"bold"},{start:120720,len:25,offset:913,variant:"sans-serif",style:"bolditalic"},{start:120746,len:25,offset:945,variant:"sans-serif",style:"bolditalic"},{start:120782,len:10,offset:48,variant:"main",style:"bold"},{start:120792,len:10,offset:48,variant:"double-struck"},{start:120803,len:10,offset:48,variant:"sans-serif"},{start:120812,len:10,offset:48,variant:"sans-serif",style:"bold"},{start:120822,len:10,offset:48,variant:"monospace"}];function gn(a,y,b){if(!/[A-Za-z\d]/.test(a)||(b==="up"&&(b=void 0),!y&&!b))return a;const E=a.codePointAt(0);if(E===void 0)return a;for(const ee of Tt)if((!y||ee.variant===y)&&(!b||ee.style===b)&&E>=ee.offset&&E<ee.offset+ee.len){const re=ee.start+E-ee.offset;return String.fromCodePoint(Ee[re]||re)}return a}function Xt(a){var y;if((a<119808||a>120831)&&(a<8448||a>8527))return{char:String.fromCodePoint(a)};for(const b in Ee)if(Ee[b]===a){a=(y=b.codePointAt(0))!=null?y:0;break}for(const b of Tt)if(a>=b.start&&a<b.start+b.len)return{char:String.fromCodePoint(a-b.start+b.offset),variant:b.variant,style:b.style};return{char:String.fromCodePoint(a)}}function Je(a){var y;let b="";for(const E of a){if("{}<>[]$&#^_%:'\u02DC".includes(E)){b+=E;continue}const ee=(y=E.codePointAt(0))!=null?y:0;let re=Ye[ee];if(re)re.startsWith("\\")?b+=re+" ":b+=re;else{const{char:ae,variant:de,style:fe}=Xt(ee);switch(re=ae,de){case"double-struck":re=`\\mathbb{${re}}`;break;case"fraktur":re=`\\mathfrak{${re}}`;break;case"script":re=`\\mathscr{${re}}`;break;case"sans-serif":re=`\\mathsf{${re}}`;break;case"monospace":re=`\\mathtt{${re}}`;break;case"calligraphic":re=`\\mathcal{${re}}`;break}switch(fe){case"bold":re=`\\mathbf{${re}}`;break;case"italic":re=`\\mathit{${re}}`;break;case"bolditalic":re=`\\mathbfit{${re}}`;break}b+=re}}return b}function rt(a){return a?Array.isArray(a)?a:typeof a=="object"&&"group"in a?a.group:[]:[]}var Ht={},Sn=we({},Ye),sn={},$t={},Bt={darr:"\\downarrow",dArr:"\\Downarrow",Darr:"\\Downarrow",lang:"\\langle",rang:"\\rangle",uarr:"\\uparrow",uArr:"\\Uparrow",Uarr:"\\Uparrow",N:"\\mathbb{N}",R:"\\mathbb{R}",Z:"\\mathbb{Z}",alef:"\\aleph",alefsym:"\\aleph",Alpha:"\\mathrm{A}",Beta:"\\mathrm{B}",bull:"\\bullet",Chi:"\\mathrm{X}",clubs:"\\clubsuit",cnums:"\\mathbb{C}",Complex:"\\mathbb{C}",Dagger:"\\ddagger",diamonds:"\\diamondsuit",empty:"\\emptyset",Epsilon:"\\mathrm{E}",Eta:"\\mathrm{H}",exist:"\\exists",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",Harr:"\\Leftrightarrow",hearts:"\\heartsuit",image:"\\Im",infin:"\\infty",Iota:"\\mathrm{I}",isin:"\\in",Kappa:"\\mathrm{K}",larr:"\\leftarrow",lArr:"\\Leftarrow",Larr:"\\Leftarrow",lrarr:"\\leftrightarrow",lrArr:"\\Leftrightarrow",Lrarr:"\\Leftrightarrow",Mu:"\\mathrm{M}",natnums:"\\mathbb{N}",Nu:"\\mathrm{N}",Omicron:"\\mathrm{O}",plusmn:"\\pm",rarr:"\\rightarrow",rArr:"\\Rightarrow",Rarr:"\\Rightarrow",real:"\\Re",reals:"\\mathbb{R}",Reals:"\\mathbb{R}",Rho:"\\mathrm{P}",sdot:"\\cdot",sect:"\\S",spades:"\\spadesuit",sub:"\\subset",sube:"\\subseteq",supe:"\\supseteq",Tau:"\\mathrm{T}",thetasym:"\\vartheta",weierp:"\\wp",Zeta:"\\mathrm{Z}"},bn={varGamma:"\\mathit{\\Gamma}",varDelta:"\\mathit{\\Delta}",varTheta:"\\mathit{\\Theta}",varLambda:"\\mathit{\\Lambda}",varXi:"\\mathit{\\Xi}",varPi:"\\mathit{\\Pi}",varSigma:"\\mathit{\\Sigma}",varUpsilon:"\\mathit{\\Upsilon}",varPhi:"\\mathit{\\Phi}",varPsi:"\\mathit{\\Psi}",varOmega:"\\mathit{\\Omega}",pmod:{def:"\\quad(\\operatorname{mod}\\ #1)",args:1,expand:!1,captureSelection:!1},mod:{def:"\\quad\\operatorname{mod}\\,\\,#1",args:1,expand:!1},bmod:{def:"\\;\\mathbin{\\operatorname{mod }}",expand:!1}},dn={bra:{def:"\\mathinner{\\langle{#1}|}",args:1,captureSelection:!1},ket:{def:"\\mathinner{|{#1}\\rangle}",args:1,captureSelection:!1},braket:{def:"\\mathinner{\\langle{#1}\\rangle}",args:1,captureSelection:!1},set:{def:"\\mathinner{\\lbrace #1 \\rbrace}",args:1,captureSelection:!1},Bra:{def:"\\left\\langle #1\\right|",args:1,captureSelection:!1},Ket:{def:"\\left|#1\\right\\rangle",args:1,captureSelection:!1},Braket:{def:"\\left\\langle{#1}\\right\\rangle",args:1,captureSelection:!1},Set:{def:"\\left\\lbrace #1 \\right\\rbrace",args:1,captureSelection:!1}},ke={iff:{primitive:!0,captureSelection:!0,def:"\\;\u27FA\\;"},nicefrac:"^{#1}\\!\\!/\\!_{#2}",phase:{def:"\\enclose{phasorangle}{#1}",args:1,captureSelection:!1},rd:"\\mathrm{d}",rD:"\\mathrm{D}",doubleStruckCapitalN:"\\mathbb{N}",doubleStruckCapitalR:"\\mathbb{R}",doubleStruckCapitalQ:"\\mathbb{Q}",doubleStruckCapitalZ:"\\mathbb{Z}",doubleStruckCapitalP:"\\mathbb{P}",scriptCapitalE:"\\mathscr{E}",scriptCapitalH:"\\mathscr{H}",scriptCapitalL:"\\mathscr{L}",gothicCapitalC:"\\mathfrak{C}",gothicCapitalH:"\\mathfrak{H}",gothicCapitalI:"\\mathfrak{I}",gothicCapitalR:"\\mathfrak{R}",imaginaryI:"\\mathrm{i}",imaginaryJ:"\\mathrm{j}",exponentialE:"\\mathrm{e}",differentialD:"\\mathrm{d}",capitalDifferentialD:"\\mathrm{D}",mathstrut:{def:"\\vphantom{(}",primitive:!0},angl:"\\enclose{actuarial}{#1}",angln:"\\enclose{actuarial}{n}",anglr:"\\enclose{actuarial}{r}",anglk:"\\enclose{actuarial}{k}",mathtools:{primitive:!0,package:{ordinarycolon:":",vcentcolon:"\\mathrel{\\mathop\\ordinarycolon}",dblcolon:'{\\mathop{\\char"2237}}',coloneqq:'{\\mathop{\\char"2254}}',Coloneqq:'{\\mathop{\\char"2237\\char"3D}}',coloneq:'{\\mathop{\\char"3A\\char"2212}}',Coloneq:'{\\mathop{\\char"2237\\char"2212}}',eqqcolon:'{\\mathop{\\char"2255}}',Eqqcolon:'{\\mathop{\\char"3D\\char"2237}}',eqcolon:'{\\mathop{\\char"2239}}',Eqcolon:'{\\mathop{\\char"2212\\char"2237}}',colonapprox:'{\\mathop{\\char"003A\\char"2248}}',Colonapprox:'{\\mathop{\\char"2237\\char"2248}}',colonsim:'{\\mathop{\\char"3A\\char"223C}}',Colonsim:'{\\mathop{\\char"2237\\char"223C}}',colondash:"\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",Colondash:"\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}",dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Dashcolon:"\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}"}},ratio:"\\vcentcolon",coloncolon:"\\dblcolon",colonequals:"\\coloneq",coloncolonequals:"\\Coloneq",equalscolon:"\\eqcolon",equalscoloncolon:"\\Eqcolon",colonminus:"\\colondash",coloncolonminus:"\\Colondash",minuscolon:"\\dashcolon",minuscoloncolon:"\\Dashcolon",coloncolonapprox:"\\Colonapprox",coloncolonsim:"\\Colonsim",simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Simcolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",simcoloncolon:"\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Approxcolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",approxcoloncolon:"\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",notni:"\\mathrel{\\char`\u220C}",limsup:"\\operatorname*{lim\\,sup}",liminf:"\\operatorname*{lim\\,inf}",injlim:"\\operatorname*{inj\\,lim}",projlim:"\\operatorname*{proj\\,lim}",varlimsup:"\\operatorname*{\\overline{lim}}",varliminf:"\\operatorname*{\\underline{lim}}",varinjlim:"\\operatorname*{\\underrightarrow{lim}}",varprojlim:"\\operatorname*{\\underleftarrow{lim}}",argmin:"\\operatorname*{arg\\,min}",argmax:"\\operatorname*{arg\\,max}",plim:"\\mathop{\\operatorname{plim}}\\limits",tripledash:{def:"\\vphantom{-}\\raise{4mu}{\\mkern1.5mu\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2.25mu}\\rule{2mu}{1.5mu}\\mkern{2mu}}",expand:!0},"braket.sty":{package:dn},"amsmath.sty":{package:bn,primitive:!0},"texvc.sty":{package:Bt,primitive:!1}},ce={" ":32,"\\!":33,"\\#":35,"\\$":36,"\\%":37,"\\&":38,"-":45,"\\textunderscore":95,"\\euro":8364,"\\maltese":10016,"\\{":123,"\\}":125,"\\textbraceleft":123,"\\textbraceright":125,"\\lbrace":123,"\\rbrace":125,"\\lbrack":91,"\\rbrack":93,"\\nobreakspace":160,"\\ldots":8230,"\\textellipsis":8230,"\\backslash":92,"`":8216,"'":8217,"``":8220,"''":8221,"\\degree":176,"\\textasciicircum":94,"\\textasciitilde":126,"\\textasteriskcentered":42,"\\textbackslash":92,"\\textbullet":8226,"\\textdollar":36,"\\textsterling":163,"\\textdagger":8224,"\\textdaggerdbl":8225,"\u2013":8211,"\u2014":8212,"\u2018":8216,"\u2019":8217,"\u201C":8220,"\u201D":8221,'"':8221,"\\ss":223,"\\ae":230,"\\oe":339,"\\AE":198,"\\OE":338,"\\O":216,"\\i":305,"\\j":567,"\\aa":229,"\\AA":197},le=/[\w!@*()-=+{}\[\]\\';:?/.,~<>`|$%#&^" ]/,ve,pe;Et()?(ve=new RegExp("\\p{Letter}","u"),pe=new RegExp("[0-9\\p{Letter}]","u")):(ve=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/,pe=/[\da-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/);function oe(a,y,b="mord",E){y!==void 0&&(Ht[a]={definitionType:"symbol",type:b,variant:E,codepoint:y},Sn[y]||(Sn[y]=a))}function ze(a,y,b){if(typeof a=="string"){for(let E=0;E<a.length;E++){const ee=a.charAt(E);oe(ee,ee.codePointAt(0))}return}for(const[E,ee,re,ae]of a)oe(E,ee,re!=null?re:y,ae!=null?ae:b)}function yt(a,y){for(let b=a;b<=y;b++)oe(String.fromCodePoint(b),b)}function Vt(a){var y;return(y=$t[a])!=null?y:null}function en(a,y){var b,E;if(y.length===0||y==="\\"||!y.startsWith("\\"))return[];const ee=[];for(const ae in sn)ae.startsWith(y)&&!sn[ae].infix&&ee.push({match:ae,frequency:(b=sn[ae].frequency)!=null?b:0});for(const ae in Ht)ae.startsWith(y)&&ee.push({match:ae,frequency:(E=Ht[ae].frequency)!=null?E:0});const re=y.substring(1);for(const ae of Object.keys(a.options.macros))ae.startsWith(re)&&ee.push({match:"\\"+ae,frequency:0});return ee.sort((ae,de)=>{var fe,ge;return ae.frequency===de.frequency?ae.match.length===de.match.length?ae.match<de.match?-1:1:ae.match.length-de.match.length:((fe=de.frequency)!=null?fe:0)-((ge=ae.frequency)!=null?ge:0)}),ee.map(ae=>ae.match)}function un(a){let y="auto";const b=a.match(/:([^=]+)/);return b&&(y=b[1].trim()),y}function yn(a){if(!a)return[];const y=[];let b=a.split("]");if(b[0].startsWith("[")){y.push({isOptional:!0,type:un(b[0].slice(1))});for(let E=1;E<=b.length;E++)y.push(...yn(b[E]))}else if(b=a.split("}"),b[0].startsWith("{")){y.push({isOptional:!1,type:un(b[0].slice(1))});for(let E=1;E<=b.length;E++)y.push(...yn(b[E]))}return y}function Jt(a){if(!a)return"";let y="",b=!0;for(const E of a)typeof E.value=="string"?y+=E.value:b=!1;return b?y:""}function Cr(a,y){typeof a=="string"&&(a=[a]);const b={tabular:!1,params:[],createAtom:y};for(const E of a)$t[E]=b}function Tr(a,y,b){typeof a=="string"&&(a=[a]);const ee={tabular:!0,params:yn(y),createAtom:b};for(const re of a)$t[re]=ee}function Rt(a,y,b){var E,ee;b||(b={});const re={definitionType:"function",params:yn(y),ifMode:b.ifMode,isFunction:(E=b.isFunction)!=null?E:!1,applyMode:b.applyMode,infix:(ee=b.infix)!=null?ee:!1,parse:b.parse,createAtom:b.createAtom,applyStyle:b.applyStyle,serialize:b.serialize,render:b.render};if(typeof a=="string")sn["\\"+a]=re;else for(const ae of a)sn["\\"+ae]=re}var Ln;function Nr(a){return Ln||(Ln=Gn(ke)),a?Gn(we(we({},Ln),a)):Ln}function Qr(a,y){var b,E,ee,re;if(typeof a=="string"){let ae=0;const de=a;return/(^|[^\\])#1/.test(de)&&(ae=1),/(^|[^\\])#2/.test(de)&&(ae=2),/(^|[^\\])#3/.test(de)&&(ae=3),/(^|[^\\])#4/.test(de)&&(ae=4),/(^|[^\\])#5/.test(de)&&(ae=5),/(^|[^\\])#6/.test(de)&&(ae=6),/(^|[^\\])#7/.test(de)&&(ae=7),/(^|[^\\])#8/.test(de)&&(ae=8),/(^|[^\\])#9/.test(de)&&(ae=9),{expand:(b=y==null?void 0:y.expand)!=null?b:!0,captureSelection:(E=y==null?void 0:y.captureSelection)!=null?E:!0,args:ae,def:de}}return we({expand:(ee=y==null?void 0:y.expand)!=null?ee:!0,captureSelection:(re=y==null?void 0:y.captureSelection)!=null?re:!0,args:0},a)}function Gn(a){if(!a)return{};const y={};for(const b of Object.keys(a)){const E=a[b];if(E==null)delete y[b];else if(typeof E=="object"&&"package"in E)for(const ee of Object.keys(E.package))y[ee]=Qr(E.package[ee],{expand:!E.primitive,captureSelection:E.captureSelection});else y[b]=Qr(E)}return y}function Fr(a,y="math"){if(!a||a.length===0)return null;let b=null;if(a.startsWith("\\")){if(b=sn[a],b)return!b.ifMode||b.ifMode===y?b:null;y==="math"?b=Ht[a]:ce[a]&&(b={definitionType:"symbol",type:"mord",codepoint:ce[a]})}else if(y==="math"){if(b=Ht[a],!b&&a.length===1){const E=Fi("math",a.codePointAt(0));return E.startsWith("\\")?he(we({},Fr(E,"math")),{command:E}):null}}else ce[a]?b={definitionType:"symbol",type:"mord",codepoint:ce[a]}:y==="text"&&(b={definitionType:"symbol",type:"mord",codepoint:a.codePointAt(0)});return b!=null?b:null}function Da(a,y){if(!a.startsWith("\\"))return null;const b=a.slice(1);return y[b]}function Fi(a,y){if(y===void 0)return"";if(a==="math"&&Sn[y])return Sn[y];if(a==="text"){const b=Object.keys(ce).find(E=>ce[E]===y);return b||String.fromCodePoint(y)}return String.fromCodePoint(y)}var Oi=[0,.68889,0,0,.72222],Ei=[0,.68889,0,0,.66667],ua=[0,.68889,0,0,.77778],ba=[0,.68889,0,0,.61111],ka=[.16667,.68889,0,0,.77778],ca=[0,.68889,0,0,.55556],Hr=[0,0,0,0,.25],La=[0,.825,0,0,2.33334],fo=[0,.9,0,0,2.33334],Za=[0,.68889,0,0,.54028],Wa=[-.03598,.46402,0,0,.5],ha=[-.13313,.36687,0,0,1],wt=[.01354,.52239,0,0,1],_n=[.01354,.52239,0,0,1.11111],Tn=[0,.54986,0,0,1],Pn=[0,.69224,0,0,.5],xr=[0,.43056,0,0,1],nr=[.08198,.58198,0,0,.77778],ur=[.19444,.69224,0,0,.41667],Hn=[.1808,.675,0,0,1],je=[.19444,.69224,0,0,.83334],it=[.13667,.63667,0,0,1],St=[-.064,.437,0,0,1.334],Wt=[.08167,.58167,0,0,.77778],He=[0,.69224,0,0,.72222],ht=[0,.69224,0,0,.66667],Dt=[-.13313,.36687,0,0,.77778],_t=[.06062,.54986,0,0,.77778],Nt=[0,.69224,0,0,.77778],Pt=[.25583,.75583,0,0,.77778],Bn=[.25142,.75726,0,0,.77778],cr=[.20576,.70576,0,0,.77778],Wn=[.30274,.79383,0,0,.77778],Un=[.22958,.72958,0,0,.77778],qn=[.1808,.675,0,0,.77778],Jn=[.13667,.63667,0,0,.77778],Mr=[.13597,.63597,0,0,.77778],an=[.03517,.54986,0,0,.77778],Fn=[0,.675,0,0,.77778],ci=[.19444,.69224,0,0,.61111],gi=[0,.54986,0,0,.76042],Vr=[0,.54986,0,0,.66667],Dr=[.0391,.5391,0,0,.77778],wi=[.03517,.54986,0,0,1.33334],or=[.38569,.88569,0,0,.77778],oi=[.23222,.74111,0,0,.77778],hn=[.19444,.69224,0,0,.77778],Vi=[0,.37788,0,0,.5],Si=[0,.54986,0,0,.72222],pa=[0,.69224,0,0,.83334],Wi=[.11111,.69224,0,0,.66667],_i=[.26167,.75726,0,0,.77778],ia=[.48256,.98256,0,0,.77778],Ki=[.28481,.79383,0,0,.77778],yi=[.08167,.58167,0,0,.22222],Gi=[.08167,.58167,0,0,.38889],xa=[0,.43056,.04028,0,.66667],Xi=[.41951,.91951,0,0,.77778],Ti=[.24982,.74947,0,0,.38865],wa=[.08319,.58283,0,0,.75623],Aa=[0,.10803,0,0,.27764],aa=[0,.47534,0,0,.50181],ni=[.18906,.47534,0,0,.50181],pt=[0,.69141,0,0,.50181],dt=[.24982,.74947,0,0,.27764],It=[0,.69141,0,0,.21471],Qt=[.25,.75,0,0,.44722],Cn=[0,.64444,0,0,.575],vr=[.08556,.58556,0,0,.89444],gr=[0,.69444,0,0,.89444],Er=[0,.68611,0,0,.9],Br=[0,.68611,0,0,.86944],kr=[.25,.75,0,0,.575],Yr=[.25,.75,0,0,.31944],si=[0,.69444,0,0,.63889],bi=[0,.69444,0,0,.31944],Hi=[0,.44444,0,0,.63889],Ri=[0,.44444,0,0,.51111],Di=[0,.69444,0,0,.575],Le=[.13333,.63333,0,0,.89444],Re=[0,.44444,0,0,.31944],Oe=[0,.69444,0,0,.86944],We=[0,.68611,0,0,.69166],nt=[0,.68611,0,0,.83055],st=[0,.68611,0,0,.89444],mt=[0,.69444,0,0,.60278],zt=[.19444,.69444,0,0,.51111],jt=[0,.69444,0,0,.83055],Nn=[-.10889,.39111,0,0,1.14999],Qn=[.19444,.69444,0,0,.575],Dn=[.19444,.69444,0,0,1.14999],tn=[.19444,.69444,0,0,.70277],Yt=[.05556,.75,0,0,.575],fn=[0,.68611,0,0,.95833],xn=[.08556,.58556,0,0,.76666],Yn=[-.02639,.47361,0,0,.575],$n=[0,.44444,0,0,.89444],On=[0,.55556,0,0,.76666],Kn=[-.10889,.39111,0,0,.89444],zn=[.00222,.50222,0,0,.89444],tr=[.19667,.69667,0,0,.89444],$e=[.08556,.58556,0,0,1.14999],Ke=[0,.69444,0,0,.70277],Ct=[-.02778,.47222,0,0,.575],ft=[.25,.75,0,0,.51111],Kt=[-.13889,.36111,0,0,1.14999],on=[.19444,.69444,0,0,1.02222],nn=[.12963,.69444,0,0,.89444],En=[.19444,.69444,0,0,.44722],pn=[0,.64444,.13167,0,.59111],Zt=[.19444,.64444,.13167,0,.59111],wn=[0,.68611,.17208,0,.8961],kn=[.19444,.44444,.105,0,.53222],er=[0,.44444,.085,0,.82666],Mn=[0,.69444,.06709,0,.59111],dr=[0,.69444,.12945,0,.35555],Lr=[0,.69444,0,0,.94888],pr=[0,.69444,.11472,0,.59111],wr=[0,.68611,.10778,0,.88555],ir=[0,.69444,.07939,0,.62055],yr=[0,.69444,.12417,0,.30667],Ir=[0,.64444,.13556,0,.51111],$r=[.19444,.64444,.13556,0,.51111],mr=[0,.68333,.16389,0,.74333],Wr=[.19444,.43056,.08847,0,.46],li=[0,.43056,.07514,0,.71555],Ii=[0,.69444,.06646,0,.51111],Ci=[0,.69444,0,0,.83129],di=[0,.69444,.1225,0,.51111],ki=[0,.68333,.09403,0,.76666],Li=[0,.68333,.11111,0,.76666],Gr=[0,.69444,.06961,0,.51444],fi=[0,.69444,0,0,.27778],Ar=[.25,.75,0,0,.38889],Ur=[0,.64444,0,0,.5],ri=[0,.69444,0,0,.77778],Mi=[0,.68333,0,0,.75],Ba=[0,.68333,0,0,.77778],Oa=[0,.68333,0,0,.68056],Sa=[0,.68333,0,0,.72222],Ui=[.25,.75,0,0,.5],Ai=[.25,.75,0,0,.27778],Jr=[0,.69444,0,0,.5],Ta=[0,.69444,0,0,.55556],ei=[0,.43056,0,0,.44445],Pr=[0,.43056,0,0,.5],pi=[.19444,.43056,0,0,.55556],Zi=[0,.43056,0,0,.55556],xi=[.08333,.58333,0,0,.77778],Ni=[0,.43056,0,0,.27778],Zr=[0,.66786,0,0,.27778],Ji=[0,.69444,0,0,.75],oa=[0,.66786,0,0,.5],qi=[0,.68333,0,0,.625],sa=[.19444,.69444,0,0,.44445],ma=[0,.69444,0,0,.72222],Va=[.19444,.69444,0,0,.5],Yi=[.19444,.69444,0,0,1],ga=[.011,.511,0,0,1.126],Ya=[.19444,.69444,0,0,.61111],ja=[.05556,.75,0,0,.5],oo=[0,.68333,0,0,.83334],Ra=[.0391,.5391,0,0,.66667],da=[-.05555,.44445,0,0,.5],ti=[0,.43056,0,0,.77778],mi=[0,.55556,0,0,.66667],ji=[-.03625,.46375,0,0,.77778],la=[-.01688,.48312,0,0,.77778],Fa=[.0391,.5391,0,0,1],ro=[0,.69444,0,0,.61111],ho=[-.03472,.46528,0,0,.5],Bo=[.25,.75,0,0,.44445],Oo=[-.14236,.35764,0,0,1],so=[.244,.744,0,0,.412],Ao=[.19444,.69444,0,0,.88889],Pi=[.12963,.69444,0,0,.77778],ui=[.19444,.69444,0,0,.38889],Ca=[.011,.511,0,0,1.638],va=[.19444,.69444,0,0,0],lo=[0,.44444,0,0,.575],io=[.19444,.44444,0,0,.575],hs=[0,.68611,0,0,.75555],Qo=[0,.69444,0,0,.66759],ps=[0,.68611,0,0,.80555],$i=[0,.68611,.08229,0,.98229],fr=[0,.68611,0,0,.76666],Xr=[0,.44444,0,0,.58472],qr=[.19444,.44444,0,0,.6118],ii=[.19444,.43056,0,0,.5],$a=[0,.68333,.02778,.08334,.76278],Ua=[0,.68333,.08125,.05556,.83125],$o=[0,.43056,0,.05556,.48472],Vo=[.19444,.43056,0,.08334,.51702],ls=[.25,.75,0,0,.42778],ta=[0,.69444,0,0,.55],Ro=[0,.69444,0,0,.73334],us=[0,.69444,0,0,.79445],cl=[0,.69444,0,0,.51945],As=[0,.69444,0,0,.70278],ms=[0,.69444,0,0,.76389],zo=[.25,.75,0,0,.34306],Ts=[0,.69444,0,0,.56111],Ds=[0,.69444,0,0,.25556],Ys=[.19444,.45833,0,0,.56111],ao=[0,.45833,0,0,.56111],Ma=[0,.69444,0,0,.30556],Ga=[0,.69444,0,0,.58056],go=[0,.69444,0,0,.67223],yo=[0,.69444,0,0,.85556],Ko=[0,.69444,0,0,.55834],wo=[0,.65556,.11156,0,.5],xs=[0,.69444,.08094,0,.70834],Xl=[.17014,0,0,0,.44445],ql=[0,.69444,.0799,0,.5],vu=[0,.69444,0,0,.73752],Xu=[0,.69444,.09205,0,.5],Ks=[0,.69444,.09031,0,.77778],Is=[0,.69444,.07816,0,.27778],yu=[0,.69444,.00316,0,.5],Yl=[.19444,.69444,0,0,.83334],Ea=[.05556,.75,0,0,.83334],Qi=[0,.75,0,0,.5],Ho=[.125,.08333,0,0,.27778],es=[0,.08333,0,0,.27778],ea=[0,.65556,0,0,.5],Na=[0,.69444,0,0,.47222],Ia=[0,.69444,0,0,.66667],po=[0,.69444,0,0,.59722],is=[0,.69444,0,0,.54167],Hs=[0,.69444,0,0,.70834],gs=[.25,.75,0,0,.28889],Jl=[0,.69444,0,0,.51667],Ud=[0,.44444,0,0,.44445],Zd=[.19444,.44444,0,0,.51667],qu=[0,.44444,0,0,.38333],Uc=[0,.44444,0,0,.51667],Yu=[0,.69444,0,0,.83334],jd=[.35001,.85,0,0,.45834],Ju=[.35001,.85,0,0,.57778],Qu=[.35001,.85,0,0,.41667],Zc=[.35001,.85,0,0,.58334],bu=[0,.72222,0,0,.55556],ec=[1e-5,.6,0,0,.66667],jc=[1e-5,.6,0,0,.77778],Ql=[.25001,.75,0,0,.94445],Gd=[.306,.805,.19445,0,.47222],xu=[.30612,.805,.19445,0,.47222],Uo=[.25001,.75,0,0,.83334],Pl=[.35001,.85,0,0,.47222],Gc=[.25001,.75,0,0,1.11111],Xc=[.65002,1.15,0,0,.59722],vs=[.65002,1.15,0,0,.81111],Ha=[.65002,1.15,0,0,.47222],Es=[.65002,1.15,0,0,.66667],Ps=[0,.75,0,0,1],Js=[.55001,1.05,0,0,1.27778],qc=[.862,1.36,.44445,0,.55556],tc=[.86225,1.36,.44445,0,.55556],Bl=[.55001,1.05,0,0,1.11111],nc=[.65002,1.15,0,0,.52778],rc=[.65002,1.15,0,0,.61111],Ol=[.55001,1.05,0,0,1.51112],Yc=[.95003,1.45,0,0,.73611],ic=[.95003,1.45,0,0,1.04445],Qs=[.95003,1.45,0,0,.52778],wu=[.95003,1.45,0,0,.75],Su=[0,.75,0,0,1.44445],ac=[.95003,1.45,0,0,.58334],Cu=[1.25003,1.75,0,0,.79167],oc=[1.25003,1.75,0,0,1.27778],Jc=[1.25003,1.75,0,0,.58334],sc=[1.25003,1.75,0,0,.80556],Mu=[0,.825,0,0,1.8889],lc=[1.25003,1.75,0,0,.63889],uc=[.64502,1.155,0,0,.875],Eu=[1e-5,.6,0,0,.875],cc=[-99e-5,.601,0,0,.66667],dc=[.64502,1.155,0,0,.66667],Xd=[1e-5,.9,0,0,.88889],Qc=[.65002,1.15,0,0,.88889],Rl=[.90001,0,0,0,.88889],fc=[-.00499,.605,0,0,1.05556],Nl=[0,.12,0,0,.45],zr=[0,.61111,0,0,.525],ws=[.08333,.69444,0,0,.525],ed=[-.08056,.53055,0,0,.525],qd=[-.05556,.55556,0,0,.525],as=[0,.43056,0,0,.525],To=[.22222,.43056,0,0,.525],_u=[0,0,0,0,.525],Yd={"AMS-Regular":{32:Hr,65:Oi,66:Ei,67:Oi,68:Oi,69:Ei,70:ba,71:ua,72:ua,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:ua,76:Ei,77:[0,.68889,0,0,.94445],78:Oi,79:ka,80:ba,81:ka,82:Oi,83:ca,84:Ei,85:Oi,86:Oi,87:[0,.68889,0,0,1],88:Oi,89:Oi,90:Ei,107:ca,160:Hr,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:ca,295:Za,710:La,732:fo,770:La,771:fo,989:Wt,1008:xa,8245:[0,.54986,0,0,.275],8463:Za,8487:Oi,8498:ca,8502:Ei,8503:[0,.68889,0,0,.44445],8504:Ei,8513:[0,.68889,0,0,.63889],8592:Wa,8594:Wa,8602:ha,8603:ha,8606:wt,8608:wt,8610:_n,8611:_n,8619:Tn,8620:Tn,8621:[-.13313,.37788,0,0,1.38889],8622:ha,8624:Pn,8625:Pn,8630:xr,8631:xr,8634:nr,8635:nr,8638:ur,8639:ur,8642:ur,8643:ur,8644:Hn,8646:Hn,8647:Hn,8648:je,8649:Hn,8650:je,8651:wt,8652:wt,8653:ha,8654:ha,8655:ha,8666:it,8667:it,8669:[-.13313,.37788,0,0,1],8672:St,8674:St,8705:[0,.825,0,0,.5],8708:ca,8709:Wt,8717:[0,.43056,0,0,.42917],8722:Wa,8724:[.08198,.69224,0,0,.77778],8726:Wt,8733:Nt,8736:He,8737:He,8738:[.03517,.52239,0,0,.72222],8739:yi,8740:[.25142,.74111,0,0,.27778],8741:Gi,8742:[.25142,.74111,0,0,.5],8756:ht,8757:ht,8764:Dt,8765:[-.13313,.37788,0,0,.77778],8769:Dt,8770:ji,8774:Wn,8776:la,8778:Wt,8782:_t,8783:_t,8785:nr,8786:nr,8787:nr,8790:Nt,8791:Un,8796:[.08198,.91667,0,0,.77778],8806:Pt,8807:Pt,8808:Bn,8809:Bn,8812:[.25583,.75583,0,0,.5],8814:cr,8815:cr,8816:Wn,8817:Wn,8818:Un,8819:Un,8822:qn,8823:qn,8828:Jn,8829:Jn,8830:Un,8831:Un,8832:cr,8833:cr,8840:Wn,8841:Wn,8842:Mr,8843:Mr,8847:an,8848:an,8858:nr,8859:nr,8861:nr,8862:Fn,8863:Fn,8864:Fn,8865:Fn,8872:[0,.69224,0,0,.61111],8873:He,8874:[0,.69224,0,0,.88889],8876:ba,8877:ba,8878:Oi,8879:Oi,8882:an,8883:an,8884:Jn,8885:Jn,8888:[0,.54986,0,0,1.11111],8890:pi,8891:ci,8892:ci,8901:[0,.54986,0,0,.27778],8903:Wt,8905:Wt,8906:Wt,8907:Nt,8908:Nt,8909:[-.03598,.46402,0,0,.77778],8910:gi,8911:gi,8912:an,8913:an,8914:Vr,8915:Vr,8916:ht,8918:Dr,8919:Dr,8920:wi,8921:wi,8922:or,8923:or,8926:Jn,8927:Jn,8928:Wn,8929:Wn,8934:oi,8935:oi,8936:oi,8937:oi,8938:cr,8939:cr,8940:Wn,8941:Wn,8994:hn,8995:hn,9416:[.15559,.69224,0,0,.90222],9484:Pn,9488:Pn,9492:Vi,9496:Vi,9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:Fn,9633:Fn,9650:Si,9651:Si,9654:an,9660:Si,9661:Si,9664:an,9674:Wi,9733:[.19444,.69224,0,0,.94445],10003:pa,10016:pa,10731:Wi,10846:[.19444,.75583,0,0,.61111],10877:Jn,10878:Jn,10885:Pt,10886:Pt,10887:Mr,10888:Mr,10889:_i,10890:_i,10891:ia,10892:ia,10901:Jn,10902:Jn,10933:Bn,10934:Bn,10935:_i,10936:_i,10937:_i,10938:_i,10949:Pt,10950:Pt,10955:Ki,10956:Ki,57350:yi,57351:Gi,57352:Wt,57353:xa,57356:Bn,57357:Bn,57358:Xi,57359:Wn,57360:Wn,57361:Xi,57366:Bn,57367:Bn,57368:Bn,57369:Bn,57370:Mr,57371:Mr},"Caligraphic-Regular":{32:Hr,65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:Hr},"Fraktur-Regular":{32:Hr,33:[0,.69141,0,0,.29574],34:It,38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:Ti,41:Ti,42:[0,.62119,0,0,.27764],43:wa,44:Aa,45:wa,46:Aa,47:[.24982,.74947,0,0,.50181],48:aa,49:aa,50:aa,51:ni,52:ni,53:ni,54:pt,55:ni,56:pt,57:ni,58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:dt,93:dt,94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:Hr,8216:It,8217:It,58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:Hr,33:[0,.69444,0,0,.35],34:mt,35:[.19444,.69444,0,0,.95833],36:Yt,37:[.05556,.75,0,0,.95833],38:gr,39:bi,40:Qt,41:Qt,42:[0,.75,0,0,.575],43:Le,44:[.19444,.15556,0,0,.31944],45:qu,46:[0,.15556,0,0,.31944],47:kr,48:Cn,49:Cn,50:Cn,51:Cn,52:Cn,53:Cn,54:Cn,55:Cn,56:Cn,57:Cn,58:Re,59:[.19444,.44444,0,0,.31944],60:vr,61:Kn,62:vr,63:[0,.69444,0,0,.54305],64:gr,65:Br,66:[0,.68611,0,0,.81805],67:nt,68:[0,.68611,0,0,.88194],69:hs,70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:Er,73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:We,77:[0,.68611,0,0,1.09166],78:Er,79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:Br,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:Yr,92:kr,93:Yr,94:Di,95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:si,99:Ri,100:si,101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:si,105:bi,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:bi,109:[0,.44444,0,0,.95833],110:Hi,111:lo,112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:Hi,118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:Ri,123:kr,124:Yr,125:kr,126:[.35,.34444,0,0,.575],160:Hr,163:[0,.69444,0,0,.86853],168:Di,172:[0,.44444,0,0,.76666],176:Oe,177:Le,184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:Le,216:[.04861,.73472,0,0,.89444],223:po,230:[0,.44444,0,0,.83055],247:Le,248:[.09722,.54167,0,0,.575],305:Re,338:[0,.68611,0,0,1.16944],339:$n,567:[.19444,.44444,0,0,.35139],710:Di,711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:Di,715:Di,728:Di,729:bi,730:Oe,732:Di,733:Di,915:We,916:fn,920:st,923:ps,926:fr,928:Er,931:nt,933:st,934:nt,936:st,937:nt,8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:bi,8217:bi,8220:mt,8221:mt,8224:zt,8225:zt,8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:Qo,8465:jt,8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:jt,8501:Ke,8592:Nn,8593:Qn,8594:Nn,8595:Qn,8596:Nn,8597:kr,8598:Dn,8599:Dn,8600:Dn,8601:Dn,8636:Nn,8637:Nn,8640:Nn,8641:Nn,8656:Nn,8657:tn,8658:Nn,8659:tn,8660:Nn,8661:[.25,.75,0,0,.70277],8704:si,8706:[0,.69444,.06389,0,.62847],8707:si,8709:Yt,8711:fn,8712:xn,8715:xn,8722:Le,8723:Le,8725:kr,8726:kr,8727:Ct,8728:Yn,8729:Yn,8730:[.18,.82,0,0,.95833],8733:$n,8734:[0,.44444,0,0,1.14999],8736:He,8739:Yr,8741:kr,8743:On,8744:On,8745:On,8746:On,8747:[.19444,.69444,.12778,0,.56875],8764:Kn,8768:[.19444,.69444,0,0,.31944],8771:zn,8776:[.02444,.52444,0,0,.89444],8781:zn,8801:zn,8804:tr,8805:tr,8810:$e,8811:$e,8826:vr,8827:vr,8834:vr,8835:vr,8838:tr,8839:tr,8846:On,8849:tr,8850:tr,8851:On,8852:On,8853:Le,8854:Le,8855:Le,8856:Le,8857:Le,8866:Ke,8867:Ke,8868:gr,8869:gr,8900:Yn,8901:[-.02639,.47361,0,0,.31944],8902:Ct,8968:ft,8969:ft,8970:ft,8971:ft,8994:Kt,8995:Kt,9651:on,9657:Ct,9661:on,9667:Ct,9711:Dn,9824:nn,9825:nn,9826:nn,9827:nn,9837:[0,.75,0,0,.44722],9838:En,9839:En,10216:Qt,10217:Qt,10815:Er,10927:tr,10928:tr,57376:va},"Main-BoldItalic":{32:Hr,33:[0,.69444,.11417,0,.38611],34:ir,35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:dr,40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:pn,49:pn,50:pn,51:pn,52:Zt,53:pn,54:pn,55:Zt,56:pn,57:pn,58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:pr,64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:wn,73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:wn,79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:Mn,95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:kn,104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:kn,114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:Hr,168:[0,.69444,.11473,0,.59111],176:Lr,184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:er,248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:er,567:[.19444,.44444,.04611,0,.385],710:Mn,711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:dr,730:Lr,732:pr,733:pr,915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:wn,931:[0,.68611,.11431,0,.82666],933:wr,934:[0,.68611,.05632,0,.82666],936:wr,937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:dr,8217:dr,8220:[0,.69444,.16772,0,.62055],8221:ir},"Main-Italic":{32:Hr,33:yr,34:Gr,35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:yr,40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:Ir,49:Ir,50:Ir,51:Ir,52:$r,53:Ir,54:Ir,55:$r,56:Ir,57:Ir,58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:di,64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:mr,73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:mr,79:ki,80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:mr,86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:Ii,95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:Wr,104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:Wr,114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:Hr,168:[0,.66786,.10474,0,.51111],176:Ci,184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:li,248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:li,710:Ii,711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:Ci,732:[0,.66786,.11585,0,.51111],733:di,915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:ki,923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:mr,931:[0,.68333,.12028,0,.71555],933:Li,934:[0,.68333,.05986,0,.71555],936:Li,937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:yr,8217:yr,8220:[0,.69444,.1685,0,.51444],8221:Gr,8463:Za},"Main-Regular":{32:Hr,33:fi,34:Jr,35:Yl,36:ja,37:Ea,38:ri,39:fi,40:Ar,41:Ar,42:Qi,43:xi,44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:Ui,48:Ur,49:Ur,50:Ur,51:Ur,52:Ur,53:Ur,54:Ur,55:Ur,56:Ur,57:Ur,58:Ni,59:[.19444,.43056,0,0,.27778],60:Dr,61:Dt,62:Dr,63:Na,64:ri,65:Mi,66:[0,.68333,0,0,.70834],67:Sa,68:[0,.68333,0,0,.76389],69:Oa,70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:Mi,73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:Ba,76:qi,77:[0,.68333,0,0,.91667],78:Mi,79:Ba,80:Oa,81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:Sa,85:Mi,86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:Mi,89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:Ai,92:Ui,93:Ai,94:Jr,95:[.31,.12056,.02778,0,.5],97:Pr,98:Ta,99:ei,100:Ta,101:ei,102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:Ta,105:Zr,106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:fi,109:[0,.43056,0,0,.83334],110:Zi,111:Pr,112:pi,113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:Zi,118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:ei,123:Ui,124:Ai,125:Ui,126:[.35,.31786,0,0,.5],160:Hr,163:[0,.69444,0,0,.76909],167:sa,168:oa,172:[0,.43056,0,0,.66667],176:Ji,177:xi,182:Ya,184:Xl,198:[0,.68333,0,0,.90278],215:xi,216:[.04861,.73194,0,0,.77778],223:Jr,230:[0,.43056,0,0,.72222],247:xi,248:[.09722,.52778,0,0,.5],305:Ni,338:[0,.68333,0,0,1.01389],339:ti,567:[.19444,.43056,0,0,.30556],710:Jr,711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:Jr,715:Jr,728:Jr,729:Zr,730:Ji,732:oa,733:Jr,915:qi,916:oo,920:Ba,923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:Mi,931:Sa,933:Ba,934:Sa,936:Ba,937:Sa,8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:fi,8217:fi,8220:Jr,8221:Jr,8224:sa,8225:sa,8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:Za,8465:ma,8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:ma,8501:ro,8592:ha,8593:Va,8594:ha,8595:Va,8596:ha,8597:Ui,8598:Yi,8599:Yi,8600:Yi,8601:Yi,8614:[.011,.511,0,0,1],8617:ga,8618:ga,8636:ha,8637:ha,8640:ha,8641:ha,8652:[.011,.671,0,0,1],8656:ha,8657:Ya,8658:ha,8659:Ya,8660:ha,8661:[.25,.75,0,0,.61111],8704:Ta,8706:[0,.69444,.05556,.08334,.5309],8707:Ta,8709:ja,8711:oo,8712:Ra,8715:Ra,8722:xi,8723:xi,8725:Ui,8726:Ui,8727:ho,8728:da,8729:da,8730:[.2,.8,0,0,.83334],8733:ti,8734:xr,8736:He,8739:Ai,8741:Ui,8743:mi,8744:mi,8745:mi,8746:mi,8747:[.19444,.69444,.11111,0,.41667],8764:Dt,8768:[.19444,.69444,0,0,.27778],8771:ji,8773:[-.022,.589,0,0,1],8776:la,8781:ji,8784:[-.133,.67,0,0,.778],8801:ji,8804:Mr,8805:Mr,8810:Fa,8811:Fa,8826:Dr,8827:Dr,8834:Dr,8835:Dr,8838:Mr,8839:Mr,8846:mi,8849:Mr,8850:Mr,8851:mi,8852:mi,8853:xi,8854:xi,8855:xi,8856:xi,8857:xi,8866:ro,8867:ro,8868:ri,8869:ri,8872:[.249,.75,0,0,.867],8900:da,8901:[-.05555,.44445,0,0,.27778],8902:ho,8904:[.005,.505,0,0,.9],8942:[.03,.9,0,0,.278],8943:[-.19,.31,0,0,1.172],8945:[-.1,.82,0,0,1.282],8968:Bo,8969:Bo,8970:Bo,8971:Bo,8994:Oo,8995:Oo,9136:so,9137:so,9651:Ao,9657:ho,9661:Ao,9667:ho,9711:Yi,9824:Pi,9825:Pi,9826:Pi,9827:Pi,9837:[0,.75,0,0,.38889],9838:ui,9839:ui,10216:Ar,10217:Ar,10222:so,10223:so,10229:[.011,.511,0,0,1.609],10230:Ca,10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:Ca,10815:Mi,10927:Mr,10928:Mr,57376:va},"Math-BoldItalic":{32:Hr,48:lo,49:lo,50:lo,51:io,52:io,53:io,54:Cn,55:io,56:Cn,57:io,65:Br,66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:$i,73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:hs,77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:Qo,105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:Xr,112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:Hr,915:[0,.68611,.15972,0,.65694],916:fn,920:[0,.68611,.03194,0,.86722],923:ps,926:[0,.68611,.07458,0,.84125],928:$i,931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:fr,936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:Xr,960:[0,.44444,.03704,0,.68241],961:qr,962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:qr,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:Hr,48:Pr,49:Pr,50:Pr,51:ii,52:ii,53:ii,54:Ur,55:ii,56:Ur,57:ii,65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:Ua,73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:$a,80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:$o,112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:Hr,915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:$a,923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:Ua,931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:$o,960:[0,.43056,.03588,0,.57003],961:Vo,962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:Vo,1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:Hr,33:[0,.69444,0,0,.36667],34:Ko,35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:Ma,40:ls,41:ls,42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:ta,49:ta,50:ta,51:ta,52:ta,53:ta,54:ta,55:ta,56:ta,57:ta,58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:cl,64:Ro,65:Ro,66:Ro,67:As,68:us,69:[0,.69444,0,0,.64167],70:ro,71:Ro,72:us,73:[0,.69444,0,0,.33056],74:cl,75:ms,76:Ga,77:[0,.69444,0,0,.97778],78:us,79:us,80:As,81:[.10556,.69444,0,0,.79445],82:As,83:ro,84:Ro,85:ms,86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:Ro,89:[0,.69444,.0275,0,.73334],90:go,91:zo,93:zo,94:ta,95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:Ts,99:[0,.45833,0,0,.48889],100:Ts,101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:Ts,105:Ds,106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:Ds,109:[0,.45833,0,0,.86667],110:ao,111:[0,.45833,0,0,.55],112:Ys,113:Ys,114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:ao,118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:Hr,168:ta,176:Ro,180:ta,184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:ta,711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:ta,729:Ma,730:Ro,732:ta,733:ta,915:Ga,916:[0,.69444,0,0,.91667],920:yo,923:go,926:Ro,928:us,931:us,933:yo,934:us,936:yo,937:us,8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:Ma,8217:Ma,8220:Ko,8221:Ko},"SansSerif-Italic":{32:Hr,33:[0,.69444,.05733,0,.31945],34:yu,35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:Is,40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:Ho,45:[0,.44444,.01946,0,.33333],46:es,47:[.25,.75,.13164,0,.5],48:wo,49:wo,50:wo,51:wo,52:wo,53:wo,54:wo,55:wo,56:wo,57:wo,58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:Ia,66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:xs,73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:is,77:[0,.69444,.08094,0,.875],78:xs,79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:ql,95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:Hr,168:[0,.67937,.06385,0,.5],176:vu,184:Xl,305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:ql,711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:Xu,715:Jr,728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:vu,732:[0,.67659,.08826,0,.5],733:Xu,915:[0,.69444,.13372,0,.54167],916:Yu,920:[0,.69444,.07555,0,.77778],923:ro,926:[0,.69444,.12816,0,.66667],928:xs,931:[0,.69444,.11983,0,.72222],933:Ks,934:[0,.69444,.04603,0,.72222],936:Ks,937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:Is,8217:Is,8220:[0,.69444,.14205,0,.5],8221:yu},"SansSerif-Regular":{32:Hr,33:[0,.69444,0,0,.31945],34:Jr,35:Yl,36:ja,37:Ea,38:[0,.69444,0,0,.75834],39:fi,40:Ar,41:Ar,42:Qi,43:xi,44:Ho,45:[0,.44444,0,0,.33333],46:es,47:Ui,48:ea,49:ea,50:ea,51:ea,52:ea,53:ea,54:ea,55:ea,56:ea,57:ea,58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:Na,64:Ia,65:Ia,66:Ia,67:si,68:[0,.69444,0,0,.72223],69:po,70:[0,.69444,0,0,.56945],71:Ia,72:Hs,73:fi,74:Na,75:[0,.69444,0,0,.69445],76:is,77:[0,.69444,0,0,.875],78:Hs,79:[0,.69444,0,0,.73611],80:si,81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:Ta,84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:Ia,89:[0,.69444,.025,0,.66667],90:ro,91:gs,93:gs,94:Jr,95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:Jl,99:Ud,100:Jl,101:Ud,102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:Jl,105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:Uc,111:[0,.44444,0,0,.5],112:Zd,113:Zd,114:[0,.44444,.01389,0,.34167],115:qu,116:[0,.57143,0,0,.36111],117:Uc,118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:Hr,168:[0,.67937,0,0,.5],176:Ia,184:Xl,305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:Jr,711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:Jr,715:Jr,728:Jr,729:[0,.67937,0,0,.27778],730:Ia,732:[0,.67659,0,0,.5],733:Jr,915:is,916:Yu,920:ri,923:ro,926:Ia,928:Hs,931:ma,933:ri,934:ma,936:ri,937:ma,8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:fi,8217:fi,8220:Jr,8221:Jr},"Script-Regular":{32:Hr,65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:Hr},"Size1-Regular":{32:Hr,40:jd,41:jd,47:Ju,91:Qu,92:Ju,93:Qu,123:Zc,125:Zc,160:Hr,710:bu,732:bu,770:bu,771:bu,8214:[-99e-5,.601,0,0,.77778],8593:ec,8595:ec,8657:jc,8659:jc,8719:Ql,8720:Ql,8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:xu,8748:Gd,8749:Gd,8750:xu,8896:Uo,8897:Uo,8898:Uo,8899:Uo,8968:Pl,8969:Pl,8970:Pl,8971:Pl,9168:cc,10216:Pl,10217:Pl,10752:Gc,10753:Gc,10754:Gc,10756:Uo,10758:Uo},"Size2-Regular":{32:Hr,40:Xc,41:Xc,47:vs,91:Ha,92:vs,93:Ha,123:Es,125:Es,160:Hr,710:Ps,732:Ps,770:Ps,771:Ps,8719:Js,8720:Js,8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:tc,8748:qc,8749:qc,8750:tc,8896:Bl,8897:Bl,8898:Bl,8899:Bl,8968:nc,8969:nc,8970:nc,8971:nc,10216:rc,10217:rc,10752:Ol,10753:Ol,10754:Ol,10756:Bl,10758:Bl},"Size3-Regular":{32:Hr,40:Yc,41:Yc,47:ic,91:Qs,92:ic,93:Qs,123:wu,125:wu,160:Hr,710:Su,732:Su,770:Su,771:Su,8730:[.95003,1.45,0,0,1],8968:ac,8969:ac,8970:ac,8971:ac,10216:wu,10217:wu},"Size4-Regular":{32:Hr,40:Cu,41:Cu,47:oc,91:Jc,92:oc,93:Jc,123:sc,125:sc,160:Hr,710:Mu,732:Mu,770:Mu,771:Mu,8730:[1.25003,1.75,0,0,1],8968:lc,8969:lc,8970:lc,8971:lc,9115:uc,9116:Eu,9117:uc,9118:uc,9119:Eu,9120:uc,9121:dc,9122:cc,9123:dc,9124:dc,9125:cc,9126:dc,9127:Xd,9128:Qc,9129:Rl,9130:[0,.3,0,0,.88889],9131:Xd,9132:Qc,9133:Rl,9143:[.88502,.915,0,0,1.05556],10216:sc,10217:sc,57344:fc,57345:fc,57680:Nl,57681:Nl,57682:Nl,57683:Nl},"Typewriter-Regular":{32:_u,33:zr,34:zr,35:zr,36:ws,37:ws,38:zr,39:zr,40:ws,41:ws,42:[0,.52083,0,0,.525],43:ed,44:[.13889,.125,0,0,.525],45:ed,46:[0,.125,0,0,.525],47:ws,48:zr,49:zr,50:zr,51:zr,52:zr,53:zr,54:zr,55:zr,56:zr,57:zr,58:as,59:[.13889,.43056,0,0,.525],60:qd,61:[-.19549,.41562,0,0,.525],62:qd,63:zr,64:zr,65:zr,66:zr,67:zr,68:zr,69:zr,70:zr,71:zr,72:zr,73:zr,74:zr,75:zr,76:zr,77:zr,78:zr,79:zr,80:zr,81:[.13889,.61111,0,0,.525],82:zr,83:zr,84:zr,85:zr,86:zr,87:zr,88:zr,89:zr,90:zr,91:ws,92:ws,93:ws,94:zr,95:[.09514,0,0,0,.525],96:zr,97:as,98:zr,99:as,100:zr,101:as,102:zr,103:To,104:zr,105:zr,106:[.22222,.61111,0,0,.525],107:zr,108:zr,109:as,110:as,111:as,112:To,113:To,114:as,115:as,116:[0,.55358,0,0,.525],117:as,118:as,119:as,120:as,121:To,122:as,123:ws,124:ws,125:ws,126:zr,127:zr,160:_u,176:zr,184:[.19445,0,0,0,.525],305:as,567:To,711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:zr,715:zr,728:zr,730:zr,770:zr,771:zr,776:zr,915:zr,916:zr,920:zr,923:zr,926:zr,928:zr,931:zr,933:zr,934:zr,936:zr,937:zr,8216:zr,8217:zr,8242:zr,9251:[.11111,.21944,0,0,.525]}},Jd=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,Fl=10,os=.25,hc=1.2,el=.431,td={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[el,el,el],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.5,.732,.925],num2:[.394,.384,.5],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[os,os,os],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04]},pc=[0,.5,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],dl=5,nd={"\xA0":" ","\u200B":" ",\u00C5:"A",\u00C7:"C",\u00D0:"D",\u00DE:"o",\u00E5:"a",\u00E7:"c",\u00F0:"d",\u00FE:"o",\u0410:"A",\u0411:"B",\u0412:"B",\u0413:"F",\u0414:"A",\u0415:"E",\u0416:"K",\u0417:"3",\u0418:"N",\u0419:"N",\u041A:"K",\u041B:"N",\u041C:"M",\u041D:"H",\u041E:"O",\u041F:"N",\u0420:"P",\u0421:"C",\u0422:"T",\u0423:"y",\u0424:"O",\u0425:"X",\u0426:"U",\u0427:"h",\u0428:"W",\u0429:"W",\u042A:"B",\u042B:"X",\u042C:"B",\u042D:"3",\u042E:"X",\u042F:"R",\u0430:"a",\u0431:"b",\u0432:"a",\u0433:"r",\u0434:"y",\u0435:"e",\u0436:"m",\u0437:"e",\u0438:"n",\u0439:"n",\u043A:"n",\u043B:"n",\u043C:"m",\u043D:"n",\u043E:"o",\u043F:"n",\u0440:"p",\u0441:"c",\u0442:"o",\u0443:"y",\u0444:"b",\u0445:"x",\u0446:"n",\u0447:"n",\u0448:"w",\u0449:"w",\u044A:"a",\u044B:"m",\u044C:"a",\u044D:"e",\u044E:"m",\u044F:"r"};function tl(a,y){a===void 0&&(a=77);const b=Yd[y][a];if(b)return{defaultMetrics:!1,depth:b[0],height:b[1],italic:b[2],skew:b[3],width:b[4]};if(a===11034)return{defaultMetrics:!0,depth:.2,height:.8,italic:0,skew:0,width:.8};const E=String.fromCodePoint(a);if(E in nd)a=nd[E].codePointAt(0);else if(Jd.test(E))return a=77,{defaultMetrics:!0,depth:.2,height:.9,italic:0,skew:0,width:1};return{defaultMetrics:!0,depth:.2,height:.7,italic:0,skew:0,width:.8}}var mc={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],longrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],longleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],longleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],longrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],longleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],longleftrightarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],longRightleftharpoons:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716],longLeftrightharpoons:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},$l={widehat1:[1062,239,.24],widehat2:[2364,300,.3],widehat3:[2364,360,.36],widehat4:[2364,420,.42],widecheck1:[1062,239,.24],widecheck2:[2364,300,.3],widecheck3:[2364,360,.36],widecheck4:[2364,420,.42],widetilde1:[600,260,.26],widetilde2:[1033,286,.286],widetilde3:[2339,306,.306],widetilde4:[2340,312,.34],overarc:[1061,159,.3],underarc:[1061,159,.3]},Qd={doubleleftarrow:`M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,overarc:"M529 0c179 0 524 115 524 115 5 1 9 5 9 10 0 1-1 2-1 3l-4 22c-1 5-5 9-11 9h-2s-338-93-512-92c-174 0-513 92-513 92h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13 0 0 342-115 520-115z",underarc:`m 529 160
c -179 0 -524 -115 -524 -115
c -5 -1 -9 -5 -9 -10
c 0 -1 1 -2 1 -3
l 4 -22
c 1 -5 5 -9 11 -9
h 2
s 338 93 512 92
c 174 0 513 -92 513 -92
h 2
c 5 0 9 4 11 9
l 5 22
c 1 6 -2 12 -8 13
c 0 0 -342 115 -520 115
z
`,leftgroup:`M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
435 0h399565z`,leftgroupunder:`M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,widetilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,widetilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,widetilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
-338 0-409-156.573-744-156.573z`,widetilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`};function eu(a){if($l[a]){const[ge,xe,Be]=$l[a],Ve=`<span class="stretchy" style="height:${Be}em"><svg width="100%" height="${Be}em" viewBox="0 0 ${ge} ${xe}" preserveAspectRatio="none" ><path fill="currentcolor" d="${Qd[a]}"></path></svg></span>`;return`<span style="display:inline-block;height:${Math.floor(100*Be/2)/100}em;min-width:0">${Ve}</span>`}const[y,b,E,ee]=mc[a];let re,ae;const de=E/1e3;y.length===3?(re=["slice-1-of-3","slice-2-of-3","slice-3-of-3"],ae=["xMinYMin","xMidYMin","xMaxYMin"]):y.length===2?(re=["slice-1-of-2","slice-2-of-2"],ae=["xMinYMin","xMaxYMin"]):(re=["slice-1-of-1"],ae=[ee]);const fe=y.map((ge,xe)=>`<span class="${re[xe]}" style=height:${de}em><svg width=400em height=${de}em viewBox="0 0 400000 ${E}" preserveAspectRatio="${ae[xe]} slice"><path fill="currentcolor" d="${Qd[ge]}"></path></svg></span>`).join("");return`<span style="display:inline-block;height:${de}em;min-width:${b}em;">${fe}</span>`}function ef(a){return mc[a]?mc[a][2]/1e3:$l[a][2]}function tf(a){const y=[];for(let b=0;b<a.length;b++){let E=a.charCodeAt(b);if(E===13&&a.charCodeAt(b+1)===10&&(E=10,b++),(E===13||E===12)&&(E=10),E===0&&(E=65533),E>=55296&&E<=56319){const ee=a.charCodeAt(b+1);if(ee>=56320&&ee<=57343){const re=E-55296,ae=ee-56320;E=Il(2,16)+re*Il(2,10)+ae,b++}}y.push(E)}return y}var ku=8205,Lu=[[ku,1],[65038,2],[127995,5],[129456,4],[917536,96]],fl,tu=[127462,127487];function nu(a){var y;if(fl===void 0){fl={};for(const b of Lu)for(let E=b[0];E<=b[0]+b[1]-1;E++)fl[E]=!0}return(y=fl[a])!=null?y:!1}function nf(a){return a>=tu[0]&&a<=tu[1]}function rf(a){if(/^[\u0020-\u00FF]*$/.test(a))return a;const y=[],b=tf(a);let E=0;for(;E<b.length;){const ee=b[E++],re=b[E];if(re===ku){const ae=E-1;for(E+=2;b[E]===ku;)E+=2;y.push(String.fromCodePoint(...b.slice(ae,E-ae+1)))}else if(nu(re)){const ae=E-1;for(;nu(b[E]);)E+=b[E]===ku?2:1;y.push(String.fromCodePoint(...b.slice(ae,2*E-ae-1)))}else nf(ee)?(E+=1,y.push(String.fromCodePoint(...b.slice(E-2,2)))):y.push(String.fromCodePoint(ee))}return y}var af=class{constructor(a){this.obeyspaces=!1,this.pos=0,this.s=rf(a)}end(){return this.pos>=this.s.length}get(){return this.pos<this.s.length?this.s[this.pos++]:""}peek(){return this.s[this.pos]}match(a){const y=typeof this.s=="string"?a.exec(this.s.slice(this.pos)):a.exec(this.s.slice(this.pos).join(""));return y!=null&&y[0]?(this.pos+=y[0].length,y[0]):""}next(){if(this.end())return null;if(!this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]+/)||this.obeyspaces&&this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]/))return"<space>";const a=this.get();if(a==="\\"){if(!this.end()){let y=this.match(/^[a-zA-Z\*]+/);return y?this.match(/^[ \f\n\r\t\v\u00A0\u2028\u2029]*/):y=this.get(),"\\"+y}}else{if(a==="{")return"<{>";if(a==="}")return"<}>";if(a==="^"){if(this.peek()==="^"){this.get();const y=this.match(/^(\^(\^(\^(\^[\da-f])?[\da-f])?[\da-f])?[\da-f])?[\da-f]{2}/);if(y)return String.fromCodePoint(Number.parseInt(y.slice(y.lastIndexOf("^")+1),16))}return a}else if(a==="#"){if(!this.end()){let y=!1;if(/[\d?@]/.test(this.peek())&&(y=!0,this.pos+1<this.s.length)){const b=this.s[this.pos+1];y=/[^\dA-Za-z]/.test(b)}return y?"#"+this.get():"#"}}else if(a==="$")return this.peek()==="$"?(this.get(),"<$$>"):"<$>"}return a}};function hl(a,y){var b,E,ee,re;const ae=[];let de=a.next();if(de&&de!=="\\relax"){if(de==="\\noexpand")de=a.next(),de&&ae.push(de);else if(de==="\\obeyspaces")a.obeyspaces=!0;else if(de==="\\bgroup")ae.push("<{>");else if(de==="\\egroup")ae.push("<}>");else if(de==="\\string"){if(de=a.next(),de)if(de.startsWith("\\"))for(const fe of de)ae.push(fe==="\\"?"\\backslash":fe);else de==="<{>"?ae.push("\\{"):de==="<space>"?ae.push("~"):de==="<}>"&&ae.push("\\}")}else if(de==="\\csname"){for(;a.peek()==="<space>";)a.next();let fe="",ge=!1,xe=[];do{if(xe.length===0)if(/^#[\d?@]$/.test(a.peek())){const Be=a.get().slice(1);xe=nl((E=(b=y==null?void 0:y(Be))!=null?b:y==null?void 0:y("?"))!=null?E:"\\placeholder{}",y),de=xe[0]}else de=a.next(),xe=de?[de]:[];ge=xe.length===0,!ge&&de==="\\endcsname"&&(ge=!0,xe.shift()),ge||(ge=de==="<$>"||de==="<$$>"||de==="<{>"||de==="<}>"||typeof de=="string"&&de.length>1&&de.startsWith("\\")),ge||(fe+=xe.shift())}while(!ge);fe&&ae.push("\\"+fe),ae.push(...xe)}else if(de!=="\\endcsname")if(de.length>1&&de.startsWith("#")){const fe=de.slice(1);ae.push(...nl((re=(ee=y==null?void 0:y(fe))!=null?ee:y==null?void 0:y("?"))!=null?re:"\\placeholder{}",y))}else ae.push(de)}return ae}function nl(a,y=null){const b=[];let E="";for(const ae of a.toString().split(/\r?\n/)){E&&b.push(E),E=" ";const de=ae.match(/((?:\\%)|[^%])*/);de!==null&&b.push(de[0])}const ee=new af(Je(b.join(""))),re=[];do re.push(...hl(ee,y));while(!ee.end());return re}function na(a){let y="";const b=[];for(const E of a)E&&(y&&/^[a-zA-Z\*]/.test(E)&&b.push(y),b.push(E),/^\\[a-zA-Z]+\*?[\"\'][^\ ]+$/.test(E)&&b.push(" "),y=/\\[a-zA-Z]+\*?$/.test(E)?" ":"");return b.join("")}function uo(a,...y){return console.assert(a.startsWith("\\")),y.length===0?a:na([a,...y.map(b=>`{${b}}`)])}function pl(a){return na(a.map(y=>{var b;return(b={"<space>":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[y])!=null?b:y}))}var of=class Vd{constructor(y){Vd._registry[y]=this}static createAtom(y,b,E){return Vd._registry[y].createAtom(b,Fr(b,y),E)}static serialize(y,b){var E;if(!y||y.length===0)return"";if((E=b.skipStyles)!=null&&E){const ee=[];for(const re of sf(y)){const ae=Vd._registry[re[0].mode];ee.push(...ae.serialize(re,b))}return na(ee)}return na(th(y,b))}static getFont(y,b,E){return Vd._registry[y].getFont(b,E)}};of._registry={};var Ss=of;function sf(a){const y=[];let b=[],E="NONE";for(const ee of a)ee.type!=="first"&&(ee.mode!==E?(b.length>0&&y.push(b),b=[ee],E=ee.mode):b.push(ee));return b.length>0&&y.push(b),y}function Eo(a,y){const b=[];let E=[],ee;for(const re of a)if(re.type!=="first"&&re.style){let ae;y==="variant"?(ae=re.style.variant,re.style.variantStyle&&re.style.variantStyle!=="up"&&(ae+="-"+re.style.variantStyle)):ae=re.style[y],ae===ee?E.push(re):(E.length>0&&b.push(E),E=[re],ee=ae)}return E.length>0&&b.push(E),b}function rd(a,y){var b;const{parent:E}=a[0],ee=E==null?void 0:E.computedStyle.color,re=[];for(const ae of sf(a)){const de=y.defaultMode;for(const fe of Eo(ae,"color")){const ge=fe[0].computedStyle,xe=Ss._registry[fe[0].mode].serialize(fe,he(we({},y),{defaultMode:de==="text"?"text":"math"}));!y.skipStyles&&ge.color&&ge.color!=="none"&&(!E||ee!==ge.color)?re.push(uo("\\textcolor",(b=ge.verbatimColor)!=null?b:ge.color,na(xe))):re.push(na(xe))}}return re}function eh(a,y){const{parent:b}=a[0],E=b==null?void 0:b.computedStyle.backgroundColor;return Eo(a,"backgroundColor").map(ee=>{var re;if(ee.length>0||ee[0].type!=="box"){const ae=ee[0].computedStyle;if(ae.backgroundColor&&ae.backgroundColor!=="none"&&(!b||E!==ae.backgroundColor))return uo("\\colorbox",(re=ae.verbatimBackgroundColor)!=null?re:ae.backgroundColor,na(rd(ee,he(we({},y),{defaultMode:"text"}))))}return na(rd(ee,y))})}function th(a,y){if(a.length===0)return[];const{parent:b}=a[0],E=b==null?void 0:b.computedStyle.fontSize,ee=[];for(const re of Eo(a,"fontSize")){const ae=re[0].computedStyle.fontSize,de=eh(re,y);de&&(ae&&ae!=="auto"&&(!b||E!==ae)?ee.push(["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][ae],...de):ee.push(...de))}return ee}function id(a){return a?{mord:"ord",mbin:"bin",mop:"op",mrel:"rel",mopen:"open",mclose:"close",mpunct:"punct",minner:"inner",spacing:"ignore",latex:"latex",composition:"inner",error:"inner",placeholder:"ord",supsub:"ignore"}[a]:void 0}function ru(a){if(a.length===0)return"ord";const y=id(a[0].type),b=id(a[a.length-1].type);return y&&y===b?y:"ord"}function iu(a,y){if(typeof a=="string")return a;if(typeof a=="number"){console.assert(Number.isFinite(a));const b=Math.ceil(100*a)/100;return b===0?"0":b.toString()+(y!=null?y:"")}return""}var sr=class Mp{constructor(y,b){var E,ee,re,ae,de;if(typeof y=="number"?this.value=String.fromCodePoint(y):typeof y=="string"?this.value=y:Ne(y)?this.children=y.filter(ge=>ge!==null):y&&y instanceof Mp&&(this.children=[y]),this.children)for(const ge of this.children)ge.parent=this;this.type=(E=b==null?void 0:b.type)!=null?E:"ignore",this.isSelected=(b==null?void 0:b.isSelected)===!0,b!=null&&b.caret&&(this.caret=b.caret),this.classes=(ee=b==null?void 0:b.classes)!=null?ee:"",this.isTight=(re=b==null?void 0:b.isTight)!=null?re:!1,b!=null&&b.attributes&&(this.attributes=b.attributes);let fe=b==null?void 0:b.fontFamily;b!=null&&b.style&&this.value&&(fe=(de=Ss.getFont((ae=b.mode)!=null?ae:"math",this,he(we({variant:"normal"},b.style),{letterShapeStyle:b.letterShapeStyle})))!=null?de:void 0),fe||(fe="Main-Regular"),this._height=0,this._depth=0,this._width=0,this.hasExplicitWidth=!1,this.skew=0,this.italic=0,this.maxFontSize=0,this.scale=1,(b==null?void 0:b.maxFontSize)!==void 0&&(this.maxFontSize=b.maxFontSize),Au(this,fe)}set atomID(y){y===void 0||y.length===0||(this.id=y)}selected(y){if(this.isSelected!==y&&(this.isSelected=y,this.children))for(const b of this.children)b.selected(y)}setStyle(y,b,E){if(b===void 0)return;const ee=iu(b,E);ee.length>0&&(this.cssProperties||(this.cssProperties={}),this.cssProperties[y]=ee)}setTop(y){Number.isFinite(y)&&Math.abs(y)>.01&&(this.cssProperties||(this.cssProperties={}),this.cssProperties.top=iu(y,"em"),this.height-=y,this.depth+=y)}get left(){var y;return(y=this.cssProperties)!=null&&y["margin-left"]?Number.parseFloat(this.cssProperties["margin-left"]):0}set left(y){Number.isFinite(y)&&(y===0?this.cssProperties&&delete this.cssProperties["margin-left"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-left"]=iu(y,"em")))}set right(y){Number.isFinite(y)&&(y===0?this.cssProperties&&delete this.cssProperties["margin-right"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-right"]=iu(y,"em")))}set bottom(y){Number.isFinite(y)&&(y===0?this.cssProperties&&delete this.cssProperties["margin-bottom"]:(this.cssProperties||(this.cssProperties={}),this.cssProperties["margin-bottom"]=iu(y,"em")))}get width(){return this._width*this.scale}set width(y){this._width=y,this.hasExplicitWidth=!0}set softWidth(y){}get height(){return this._height*this.scale}set height(y){this._height=y}get depth(){return this._depth*this.scale}set depth(y){this._depth=y}wrap(y){const b=y.parent;if(!b)return this;y.isPhantom&&this.setStyle("opacity",0);const E=y.color;E&&E!==b.color&&this.setStyle("color",E);let ee=y.backgroundColor;this.isSelected&&(ee=Zn(ee)),ee&&ee!==b.backgroundColor&&(this.setStyle("background-color",ee),this.setStyle("display","inline-block"));const re=y.scalingFactor;return this.scale=re,this.skew*=re,this.italic*=re,this}toMarkup(){var y,b,E,ee;let re=(y=this.value)!=null?y:"";if(this.children)for(const ot of this.children)re+=ot.toMarkup();let ae="";if(this.svgBody)ae=eu(this.svgBody);else if(this.svgOverlay){ae='<span style="',ae+="display: inline-block;",ae+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`,ae+=`vertical-align:${Math.floor(100*this.depth)/100}em;`,ae+='">',ae+=re,ae+="</span>",ae+='<svg style="position:absolute;overflow:visible;',ae+=`height:${Math.floor(100*(this.height+this.depth))/100}em;`;const ot=(b=this.cssProperties)==null?void 0:b.padding;ot?(ae+=`top:${ot};`,ae+=`left:${ot};`,ae+=`width:calc(100% - 2 * ${ot} );`):ae+="top:0;left:0;width:100%;",ae+="z-index:2;",ae+='"',this.svgStyle&&(ae+=this.svgStyle),ae+=` viewBox="0 0 ${Math.floor(100*this.width)/100} ${Math.floor(100*(this.height+this.depth))/100}"`,ae+=`>${this.svgOverlay}</svg>`}let de="";const fe=this.classes.split(" ");fe.push((E={latex:"ML__raw-latex",placeholder:"ML__placeholder",error:"ML__error"}[this.type])!=null?E:""),this.caret==="latex"&&fe.push("ML__latex-caret"),this.isSelected&&fe.push("ML__selected");const ge=fe.length===1?fe[0]:fe.filter((ot,gt,ln)=>ot.length>0&&ln.indexOf(ot)===gt).join(" ");if(ge.length>0&&(de+=` class="${ge}"`),this.id&&(de+=` data-atom-id=${this.id}`),this.cssId&&(de+=` id="${this.cssId.replace(/ /g,"-")}" `),this.attributes&&(de+=" "+Object.keys(this.attributes).map(ot=>`${ot}="${this.attributes[ot]}"`).join(" ")),this.htmlData){const ot=this.htmlData.split(",");for(const gt of ot){const ln=gt.match(/([^=]+)=(.+$)/);if(ln){const ar=ln[1].trim().replace(/ /g,"-");ar&&(de+=` data-${ar}="${ln[2]}" `)}else{const ar=gt.trim().replace(/ /g,"-");ar&&(de+=` data-${ar} `)}}}const xe=(ee=this.cssProperties)!=null?ee:{};this.hasExplicitWidth&&xe.width===void 0&&(xe.width=`${Math.ceil(this._width*100)/100}em`);const Be=Object.keys(xe).map(ot=>`${ot}:${xe[ot]}`);if(this.scale!==void 0&&this.scale!==1&&(re.length>0||ae.length>0)&&Be.push(`font-size: ${Math.ceil(this.scale*1e4)/100}%`),this.htmlStyle){const ot=this.htmlStyle.split(";");let gt="";for(const ln of ot){const ar=ln.match(/([^=]+):(.+$)/);if(ar){const rn=ar[1].trim().replace(/ /g,"-");rn&&(gt+=`${rn}:${ar[2]};`)}}gt&&(de+=` style="${gt}"`)}Be.length>0&&(de+=` style="${Be.join(";")}"`);let Ve="";return de.length>0||ae.length>0?Ve=`<span${de}>${re}${ae}</span>`:Ve=re,this.caret==="text"?Ve+='<span class="ML__text-caret"></span>':this.caret==="math"&&(Ve+='<span class="ML__caret"></span>'),Ve}tryCoalesceWith(y){if(this.svgBody||!this.value||y.svgBody||!y.value)return!1;const b=this.children&&this.children.length>0,E=y.children&&y.children.length>0;if(b||E)return!1;if(y.cssProperties||this.cssProperties){for(const fe of["border","border-left","border-right","border-right-width","left","margin","margin-left","margin-right","padding","position","width"])if(y.cssProperties&&fe in y.cssProperties||this.cssProperties&&fe in this.cssProperties)return!1}const ee=this.cssProperties?Object.keys(this.cssProperties).length:0,re=y.cssProperties?Object.keys(y.cssProperties).length:0;if(ee!==re)return!1;if(ee>0){for(const fe of Object.keys(this.cssProperties))if(this.cssProperties[fe]!==y.cssProperties[fe])return!1}const ae=this.classes.trim().replace(/\s+/g," ").split(" "),de=y.classes.trim().replace(/\s+/g," ").split(" ");if(ae.length!==de.length)return!1;ae.sort(),de.sort();for(const[fe,ge]of ae.entries())if(ge==="vertical-separator"||ge!==de[fe])return!1;return this.value+=y.value,this.height=Math.max(this.height,y.height),this.depth=Math.max(this.depth,y.depth),this._width=this._width+y._width,this.maxFontSize=Math.max(this.maxFontSize,y.maxFontSize),this.italic=y.italic,!0}};function ad(a){if(!a||a.length===0)return[];a[0].children=ad(a[0].children);const y=[a[0]];for(let b=1;b<a.length;b++)y[y.length-1].tryCoalesceWith(a[b])||(a[b].children=ad(a[b].children),y.push(a[b]));return y}function gc(a){return a.children&&(a.children=ad(a.children)),a}function vc(a,y){if(!a)return new sr(null,y);const b=new sr(null,{classes:"ML__strut",type:"ignore"});b.setStyle("height",Math.max(0,a.height),"em");const E=[b];if(a.depth!==0){const ee=new sr(null,{classes:"ML__strut--bottom",type:"ignore"});ee.setStyle("height",a.height+a.depth,"em"),ee.setStyle("vertical-align",-a.depth,"em"),E.push(ee)}return E.push(a),new sr(E,he(we({},y),{type:"lift"}))}function Bs(a){const y=ef(a)/2,b=new sr(null,{maxFontSize:0});return b.height=y+.166,b.depth=y-.166,b.svgBody=a,b}function Au(a,y){var b;if(a.type==="latex"){a.height=.9,a.depth=.2,a._width=1;return}if(a.value){a.height=-1/0,a.depth=-1/0,a._width=0,a.skew=-1/0,a.italic=-1/0;for(let E=0;E<a.value.length;E++){const ee=tl(a.value.codePointAt(E),y);a.height=Math.max(a.height,ee.height),a.depth=Math.max(a.depth,ee.depth),a._width+=ee.width,a.skew=ee.skew,a.italic=ee.italic}return}if(a.children&&a.children.length>0){let E=-1/0,ee=-1/0,re=0;for(const ae of a.children)ae.height>E&&(E=ae.height),ae.depth>ee&&(ee=ae.depth),re=Math.max(re,(b=ae.maxFontSize)!=null?b:0);a.height=E,a.depth=ee,a._width=a.children.reduce((ae,de)=>ae+de.width,0),a.maxFontSize=re}}function yc(a){if("individualShift"in a){const y=a.individualShift;let b=y[0];const E=[b],ee=-b.shift-b.box.depth;let re=ee;for(let ae=1;ae<y.length;ae++){const de=y[ae],fe=-de.shift-re-de.box.depth,ge=fe-(b.box.height+b.box.depth);re=re+fe,E.push(ge),E.push(de),b=de}return[E,ee]}if("top"in a){let y=a.top;for(const b of a.children)y-=typeof b=="number"?b:b.box.height+b.box.depth;return[a.children,y]}else{if("bottom"in a)return[a.children,-a.bottom];if("firstBaseline"in a){const y=a.firstBaseline[0];if(typeof y=="number")throw new Error("First child must be an element.");return[a.firstBaseline,-y.box.depth]}else if("shift"in a){const y=a.children[0];if(typeof y=="number")throw new Error("First child must be an element.");return[a.children,-y.box.depth-a.shift]}}return[null,0]}function Tu(a){var y;const[b,E]=yc(a);if(!b)return[[],0,0];const ee=new sr(null,{classes:"pstrut"});let re=0;for(const gt of b)if(typeof gt!="number"){const ln=gt.box;re=Math.max(re,ln.maxFontSize,ln.height)}re+=2,ee.height=re,ee.setStyle("height",re,"em");const ae=[];let de=E,fe=E,ge=E,xe=0;for(const gt of b){if(typeof gt=="number")ge+=gt;else{const ln=gt.box,ar=(y=gt.classes)!=null?y:[],rn=new sr([ee,ln],{classes:ar.join(" "),style:gt.style});ln.setStyle("height",ln.height+ln.depth,"em"),ln.setStyle("display","inline-block"),rn.setStyle("top",-re-ge-ln.depth,"em"),gt.marginLeft&&rn.setStyle("margin-left",gt.marginLeft,"em"),gt.marginRight&&rn.setStyle("margin-right",gt.marginRight,"em"),ae.push(rn),ge+=ln.height+ln.depth,xe=Math.max(xe,rn.width)}de=Math.min(de,ge),fe=Math.max(fe,ge)}ae.forEach(gt=>{gt.softWidth=xe});const Be=new sr(ae,{classes:"vlist"});if(Be.softWidth=xe,Be.height=fe,Be.setStyle("height",fe,"em"),de>=0)return[[new sr(Be,{classes:"vlist-r"})],fe,-de];const Ve=new sr(new sr(null),{classes:"vlist"});Ve.height=-de,Ve.setStyle("height",-de,"em");const ot=new sr(8203,{classes:"vlist-s",maxFontSize:0});return ot.softWidth=0,ot.height=0,ot.depth=0,[[new sr([Be,ot],{classes:"vlist-r"}),new sr(Ve,{classes:"vlist-r"})],fe,-de]}var Ja=class extends sr{constructor(a,y){var b;const[E,ee,re]=Tu(a);super(E.length===1?E[0]:E,{type:y==null?void 0:y.type,classes:((b=y==null?void 0:y.classes)!=null?b:"")+" vlist-t"+(E.length===2?" vlist-t2":"")}),this.height=ee,this.depth=re,this.softWidth=E.reduce((ae,de)=>Math.max(ae,de.width),0)}};function nh(a,y){var b,E,ee,re,ae;const de=a.metrics,fe=new sr(y.base),ge=(b=y.baseShift)!=null?b:0,xe=(E=y.slant)!=null?E:0;let Be=0,Ve=0;y.above&&(Be=(ee=y.aboveShift)!=null?ee:Math.max(de.bigOpSpacing1,de.bigOpSpacing3-y.above.depth)),y.below&&(Ve=(re=y.belowShift)!=null?re:Math.max(de.bigOpSpacing2,de.bigOpSpacing4-y.below.height));let ot=null;if(y.below&&y.above){const gt=de.bigOpSpacing5+y.below.height+y.below.depth+Ve+fe.depth+ge;ot=new Ja({bottom:gt,children:[de.bigOpSpacing5,{box:y.below,marginLeft:-xe,classes:["ML__center"]},Ve,{box:fe,classes:["ML__center"]},Be,{box:y.above,marginLeft:xe,classes:["ML__center"]},de.bigOpSpacing5]}).wrap(a)}else if(y.below&&!y.above)ot=new Ja({top:fe.height-ge,children:[de.bigOpSpacing5,{box:y.below,marginLeft:-xe,classes:["ML__center"]},Ve,{box:fe,classes:["ML__center"]}]}).wrap(a);else if(!y.below&&y.above){const gt=fe.depth+ge;ot=new Ja({bottom:gt,children:[{box:fe,classes:["ML__center"]},Be,{box:y.above,marginLeft:xe,classes:["ML__center"]},de.bigOpSpacing5]}).wrap(a)}else{const gt=fe.depth+ge;ot=new Ja({bottom:gt,children:[{box:fe},de.bigOpSpacing5]}).wrap(a)}return new sr(ot,{type:(ae=y.type)!=null?ae:"op"})}var od=7,rl=6,Du=5,ml=4,zl=3,ss=2,_s=1,Zo=0,Ws=class{constructor(a,y,b){this.id=a,this.sizeDelta=y,this.cramped=b;const E={"-4":2,"-3":1,0:0}[y];this.metrics=Object.keys(td).reduce((ee,re)=>he(we({},ee),{[re]:td[re][E]}),{})}getFontSize(a){return Math.max(1,a+this.sizeDelta)}get sup(){return Vs[[Zo,_s,Zo,_s,ss,zl,ss,zl][this.id]]}get sub(){return Vs[[Zo,Zo,Zo,Zo,ss,ss,ss,ss][this.id]]}get fracNum(){return Vs[[Zo,_s,Zo,_s,ss,zl,ml,Du][this.id]]}get fracDen(){return Vs[[Zo,Zo,Zo,Zo,ss,ss,ml,ml][this.id]]}get cramp(){return Vs[[Zo,Zo,ss,ss,ml,ml,rl,rl][this.id]]}get isTight(){return this.sizeDelta<0}},Kl={7:new Ws(od,0,!1),6:new Ws(rl,0,!0),5:new Ws(Du,0,!1),4:new Ws(ml,0,!0),3:new Ws(zl,-3,!1),2:new Ws(ss,-3,!0),1:new Ws(_s,-4,!1),0:new Ws(Zo,-4,!0)},Vs=he(we({},Kl),{displaystyle:Kl[od],textstyle:Kl[Du],scriptstyle:Kl[zl],scriptscriptstyle:Kl[_s]});function au(a,y){var b;if(!a)return 0;const E={pt:1,mm:7227/2540,cm:7227/254,ex:35271/8192,px:3/4,em:Fl,bp:803/800,dd:1238/1157,pc:12,in:72.27,mu:10/18}[(b=a.unit)!=null?b:"pt"];if(Number.isFinite(y)){const ee=Il(10,y);return Math.round(a.dimension/Fl*E*ee)/ee}return a.dimension*E}function sd(a,y){if(a===null)return 0;const b=au(a)/Fl;if(Number.isFinite(y)){const E=Il(10,y);return Math.round(b*E)/E}return b}function ld(a){var y;return`${a.dimension}${(y=a.unit)!=null?y:"pt"}`}function lf(a){let y=ld(a.glue);return a.grow&&a.grow.dimension!==0&&(y+=` plus ${ld(a.grow)}`),a.shrink&&a.shrink.dimension!==0&&(y+=` minus ${ld(a.shrink)}`),y}function Do(a){var y,b;if(a==null)return null;let E="";if("dimension"in a&&(E=`${a.dimension}${(y=a.unit)!=null?y:"pt"}`),"glue"in a&&(E=lf(a)),"number"in a)if(!("base"in a)||a.base==="decimal")E=Number(a.number).toString();else if(a.base==="alpha")E=`\`${String.fromCodePoint(a.number)}`;else{const ee=Math.round(a.number)>>>0;a.base==="hexadecimal"?(E=Number(ee).toString(16).toUpperCase(),ee<=255?E=E.padStart(2,"0"):ee<=65535?E=E.padStart(4,"0"):ee<=16777215?E=E.padStart(6,"0"):E=E.padStart(8,"0"),E=`"${E}`):a.base==="octal"&&(E=Number(ee).toString(8),ee<=63?E=E.padStart(2,"0"):ee<=30583?E=E.padStart(4,"0"):E=E.padStart(8,"0"),E=`'${E}`)}return"register"in a&&("factor"in a&&(a.factor===-1?E="-":a.factor!==1&&(E=Number(a.factor).toString())),"global"in a&&a.global&&(E+="\\global"),E+=`\\${a.register}`),"string"in a&&(E=a.string),(b=a.relax)!=null&&b&&(E+="\\relax"),E}function Us(a,y){return a==null?null:"number"in a?he(we({},a),{number:a.number*y}):"register"in a?"factor"in a&&a.factor?he(we({},a),{factor:a.factor*y}):he(we({},a),{factor:y}):"dimension"in a?he(we({},a),{dimension:a.dimension*y}):"glue"in a?a.shrink&&a.grow?{glue:Us(a.glue,y),shrink:Us(a.shrink,y),grow:Us(a.grow,y)}:a.shrink?{glue:Us(a.glue,y),shrink:Us(a.shrink,y)}:a.grow?{glue:Us(a.glue,y),grow:Us(a.grow,y)}:{glue:Us(a.glue,y)}:null}var rh={"p@":{dimension:1},"z@":{dimension:0},maxdimen:{dimension:16383.99999},hfuzz:{dimension:.1},vfuzz:{dimension:.1},overfullrule:{dimension:5},hsize:{dimension:6.5,unit:"in"},vsize:{dimension:8.9,unit:"in"},parindent:{dimension:20},maxdepth:{dimension:4},splitmaxdepth:{register:"maxdimen"},boxmaxdepth:{register:"maxdimen"},delimitershortfall:{dimension:5},nulldelimiterspace:{dimension:1.2,unit:"pt"},scriptspace:{dimension:.5},topskip:{dimension:10},splittopskip:{dimension:10},normalbaselineskip:{dimension:12},normallineskip:{dimension:1},normallineskiplimit:{dimension:0},jot:{dimension:3},doublerulesep:{dimension:2},arrayrulewidth:{dimension:.4},arraycolsep:{dimension:5},fboxsep:{dimension:3},fboxrule:{dimension:.4},"z@skip":{glue:{dimension:0},shrink:{dimension:0},grow:{dimension:0}},hideskip:{glue:{dimension:-1e3},grow:{dimension:1,unit:"fill"}},"@flushglue":{glue:{dimension:0},grow:{dimension:1,unit:"fill"}},parskip:{glue:{dimension:0},grow:{dimension:1}},abovedisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},abovedisplayshortskip:{glue:{dimension:0},grow:{dimension:3}},belowdisplayskip:{glue:{dimension:12},grow:{dimension:3},shrink:{dimension:9}},belowdisplayshortskip:{glue:{dimension:7},grow:{dimension:3},shrink:{dimension:4}},parfillskip:{glue:{dimension:0},grow:{dimension:1,unit:"fil"}},thinmuskip:{glue:{dimension:3,unit:"mu"}},medmuskip:{glue:{dimension:4,unit:"mu"},grow:{dimension:2,unit:"mu"},shrink:{dimension:4,unit:"mu"}},thickmuskip:{glue:{dimension:5,unit:"mu"},grow:{dimension:5,unit:"mu"}},smallskipamount:{glue:{dimension:3},grow:{dimension:1},shrink:{dimension:1}},medskipamount:{glue:{dimension:6},grow:{dimension:2},shrink:{dimension:3}},bigskipamount:{glue:{dimension:12},grow:{dimension:2},shrink:{dimension:4}},pretolerance:100,tolerance:200,hbadness:1e3,vbadness:1e3,linepenalty:10,hyphenpenalty:50,exhyphenpenalty:50,binoppenalty:700,relpenalty:500,clubpenalty:150,widowpenalty:150,displaywidowpenalty:50,brokenpenalty:100,predisplaypenalty:1e4,doublehyphendemerits:1e4,finalhyphendemerits:5e3,adjdemerits:1e4,tracinglostchars:1,uchyph:1,delimiterfactor:901,defaulthyphenchar:"\\-",defaultskewchar:-1,newlinechar:-1,showboxbreadth:5,showboxdepth:3,errorcontextlines:5,interdisplaylinepenalty:100,interfootnotelinepenalty:100,baselineSkip:1.2,arraystretch:1,month:new Date().getMonth()+1,day:new Date().getDate(),year:new Date().getFullYear()};function ou(){return we({},rh)}function bc(){return{registers:ou(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"\u25A2",letterShapeStyle:et.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:xt,backgroundColorMap:Ge,getMacro:a=>Da(a,Nr())}}var ya=class Ep{constructor(y,b){var E,ee,re,ae,de,fe,ge,xe,Be,Ve,ot,gt,ln,ar,rn;let Vn;y!=null&&y.parent?(this.parent=y.parent,Vn=y.parent,this.registers={}):(Vn=we(we({},bc()),(E=y==null?void 0:y.from)!=null?E:{}),this.registers=Vn.registers),Vn.atomIdsSettings&&(this.atomIdsSettings=we({},Vn.atomIdsSettings)),this.renderPlaceholder=Vn.renderPlaceholder,this.isPhantom=(ae=(re=y==null?void 0:y.isPhantom)!=null?re:(ee=this.parent)==null?void 0:ee.isPhantom)!=null?ae:!1,this.letterShapeStyle=Vn.letterShapeStyle,this.minFontScale=Vn.minFontScale,b!=null&&b.color&&b.color!=="none"?this.color=b.color:this.color=(fe=(de=this.parent)==null?void 0:de.color)!=null?fe:"",b!=null&&b.backgroundColor&&b.backgroundColor!=="none"?this.backgroundColor=b.backgroundColor:this.backgroundColor=(xe=(ge=this.parent)==null?void 0:ge.backgroundColor)!=null?xe:"",b!=null&&b.fontSize&&b.fontSize!=="auto"&&b.fontSize!==((Be=this.parent)==null?void 0:Be.size)?this.size=b.fontSize:this.size=(ot=(Ve=this.parent)==null?void 0:Ve.size)!=null?ot:dl;let lr=(ln=(gt=this.parent)==null?void 0:gt.mathstyle)!=null?ln:Vs.displaystyle;if(typeof(y==null?void 0:y.mathstyle)=="string"){if(Vn instanceof Ep)switch(y.mathstyle){case"cramp":lr=lr.cramp;break;case"superscript":lr=lr.sup;break;case"subscript":lr=lr.sub;break;case"numerator":lr=lr.fracNum;break;case"denominator":lr=lr.fracDen;break}switch(y.mathstyle){case"textstyle":lr=Vs.textstyle;break;case"displaystyle":lr=Vs.displaystyle;break;case"scriptstyle":lr=Vs.scriptstyle;break;case"scriptscriptstyle":lr=Vs.scriptscriptstyle;break;case"":case"auto":break}}this.mathstyle=lr,this.smartFence=Vn.smartFence,this.placeholderSymbol=Vn.placeholderSymbol,this.colorMap=(ar=Vn.colorMap)!=null?ar:jn=>jn,this.backgroundColorMap=(rn=Vn.backgroundColorMap)!=null?rn:jn=>jn,this.getMacro=Vn.getMacro,console.assert(this.parent!==void 0||this.registers!==void 0)}makeID(){if(!this.atomIdsSettings)return;if(this.atomIdsSettings.overrideID)return this.atomIdsSettings.overrideID;if(typeof this.atomIdsSettings.seed!="number")return`${Date.now().toString(36).slice(-2)}${Math.floor(Math.random()*1e5).toString(36)}`;const y=this.atomIdsSettings.seed.toString(36);return this.atomIdsSettings.seed+=1,y}scale(y){return y*this.effectiveFontSize}get scalingFactor(){return this.parent?this.effectiveFontSize/this.parent.effectiveFontSize:1}get isDisplayStyle(){return this.mathstyle.id===od||this.mathstyle.id===rl}get isCramped(){return this.mathstyle.cramped}get isTight(){return this.mathstyle.isTight}get metrics(){return this.mathstyle.metrics}get effectiveFontSize(){return Math.max(pc[Math.max(1,this.size+this.mathstyle.sizeDelta)],this.minFontScale)}getRegister(y){var b;if((b=this.registers)!=null&&b[y])return this.registers[y];if(this.parent)return this.parent.getRegister(y)}getRegisterAsNumber(y){const b=this.getRegister(y);if(typeof b=="number")return b;if(typeof b=="string")return Number(b)}getRegisterAsGlue(y){var b;if((b=this.registers)!=null&&b[y]){const E=this.registers[y];return typeof E=="object"&&"glue"in E?E:typeof E=="object"&&"dimension"in E?{glue:{dimension:E.dimension}}:typeof E=="number"?{glue:{dimension:E}}:void 0}if(this.parent)return this.parent.getRegisterAsGlue(y)}getRegisterAsEm(y,b){return sd(this.getRegisterAsDimension(y),b)}getRegisterAsDimension(y){var b;if((b=this.registers)!=null&&b[y]){const E=this.registers[y];return typeof E=="object"&&"glue"in E?E.glue:typeof E=="object"&&"dimension"in E?E:typeof E=="number"?{dimension:E}:void 0}if(this.parent)return this.parent.getRegisterAsDimension(y)}setRegister(y,b){if(b===void 0){delete this.registers[y];return}this.registers[y]=b}evaluate(y){if(!y||!("register"in y))return y;let b=this;if("global"in y&&y.global)for(;b.parent;)b=b.parent;let E=1;"factor"in y&&y.factor!==1&&y.factor!==void 0&&(E=y.factor);const ee=b.getRegister(y.register);if(ee===void 0)return;if(typeof ee=="string")return{string:Number(ee).toString()+ee};if(typeof ee=="number")return{number:E*ee};const re=b.evaluate(ee);if(re!==void 0)return"string"in re?{string:Number(ee).toString()+re.string}:"number"in re?{number:E*re.number}:"dimension"in re?he(we({},re),{dimension:E*re.dimension}):"glue"in re?he(we({},re),{glue:he(we({},re.glue),{dimension:E*re.glue.dimension}),shrink:re.shrink?he(we({},re.shrink),{dimension:E*re.shrink.dimension}):void 0,grow:re.grow?he(we({},re.grow),{dimension:E*re.grow.dimension}):void 0}):y}toDimension(y){const b=this.evaluate(y);return b===void 0?null:"dimension"in b?b:"glue"in b?b.glue:"number"in b?{dimension:b.number}:null}toEm(y,b){if(y===null)return 0;const E=this.toDimension(y);return E===null?0:au(E,b)/Fl}toNumber(y){if(y===null)return null;const b=this.evaluate(y);return b===void 0?null:"number"in b?b.number:"dimension"in b?b.dimension:"glue"in b?b.glue.dimension:"string"in b?Number(b.string):null}toColor(y){var b,E;if(y===null)return null;const ee=this.evaluate(y);return ee===void 0?null:"string"in ee?(E=(b=this.colorMap)==null?void 0:b.call(this,ee.string))!=null?E:ee.string:null}toBackgroundColor(y){var b,E;if(y===null)return null;const ee=this.evaluate(y);return ee===void 0?null:"string"in ee?(E=(b=this.backgroundColorMap)==null?void 0:b.call(this,ee.string))!=null?E:ee.string:null}},su=["body","above","below","superscript","subscript"];function il(a){return typeof a=="string"&&su.includes(a)}function Iu(a){return a!==void 0&&Array.isArray(a)&&a.length===2}var In=class jl{constructor(y){var b,E,ee,re,ae,de;this.type=y.type,typeof y.value=="string"&&(this.value=y.value),this.command=(E=(b=y.command)!=null?b:this.value)!=null?E:"",this.mode=(ee=y.mode)!=null?ee:"math",y.isFunction&&(this.isFunction=!0),y.limits&&(this.subsupPlacement=y.limits),this.style=we({},y.style),this.displayContainsHighlight=(re=y.displayContainsHighlight)!=null?re:!1,this.captureSelection=(ae=y.captureSelection)!=null?ae:!1,this.skipBoundary=(de=y.skipBoundary)!=null?de:!1,y.verbatimLatex!==void 0&&y.verbatimLatex!==null&&(this.verbatimLatex=y.verbatimLatex),y.args&&(this.args=y.args),y.body&&(this.body=y.body),this._changeCounter=0}static createBox(y,b,E){var ee;if(!b)return null;const re=uf(b),ae=[];for(const fe of re){const ge=fe[0].style,xe=cf(y,fe,{style:{color:ge.color,backgroundColor:ge.backgroundColor,fontSize:ge.fontSize}});xe&&ae.push(xe)}if(ae.length===0)return null;const de=((ee=E==null?void 0:E.classes)!=null?ee:"").trim();return ae.length===1&&!de&&!(E!=null&&E.type)?ae[0].wrap(y):new sr(ae,{classes:de,type:E==null?void 0:E.type}).wrap(y)}static serialize(y,b){return Ss.serialize(y,b)}static commonAncestor(y,b){if(y===b||y.parent===b.parent)return y.parent;const E=new WeakSet;let{parent:ee}=y;for(;ee;)E.add(ee),ee=ee.parent;for(ee=b.parent;ee;){if(E.has(ee))return ee;ee=ee.parent}console.assert(!!ee)}static fromJson(y){return typeof y=="string"?new jl({type:"mord",value:y,mode:"math"}):new jl(y)}get latexMode(){return this.mode==="math"?"math":"text"}toJson(){const y={};if(this.type&&(y.type=this.type),this.mode!=="math"&&(y.mode=this.mode),this.command&&this.command!==this.value&&(y.command=this.command),this.value!==void 0&&(y.value=this.value),this.style&&Object.keys(this.style).length>0&&(y.style=we({},this.style)),this.verbatimLatex!==void 0&&(y.verbatimLatex=this.verbatimLatex),this.subsupPlacement&&(y.subsupPlacement=this.subsupPlacement),this.explicitSubsupPlacement&&(y.explicitSubsupPlacement=!0),this.isFunction&&(y.isFunction=!0),this.displayContainsHighlight&&(y.displayContainsHighlight=!0),this.isExtensibleSymbol&&(y.isExtensibleSymbol=!0),this.skipBoundary&&(y.skipBoundary=!0),this.captureSelection&&(y.captureSelection=!0),this.args&&(y.args=cd(this.args)),this._branches)for(const b of Object.keys(this._branches))this._branches[b]&&(y[b]=this._branches[b].filter(E=>E.type!=="first").map(E=>E.toJson()));return y.type==="mord"&&Object.keys(y).length===2&&"value"in y?y.value:y}get changeCounter(){return this.parent?this.parent.changeCounter:this._changeCounter}set isDirty(y){if(y){this.parent||this._changeCounter++,"verbatimLatex"in this&&(this.verbatimLatex=void 0),this._children=void 0;let{parent:b}=this;for(;b;)b.parent||b._changeCounter++,"verbatimLatex"in b&&(b.verbatimLatex=void 0),b._children=void 0,b=b.parent}}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Fr(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):this.body&&this.command?na([uo(this.command,this.bodyToLatex(y)),this.supsubToLatex(y)]):this.body?na([this.bodyToLatex(y),this.supsubToLatex(y)]):!this.value||this.value==="\u200B"?"":this.command}bodyToLatex(y){var b;return Ss.serialize(this.body,he(we({},y),{defaultMode:(b=y.defaultMode)!=null?b:this.latexMode}))}aboveToLatex(y){return Ss.serialize(this.above,y)}belowToLatex(y){return Ss.serialize(this.below,y)}supsubToLatex(y){let b="";if(y=he(we({},y),{defaultMode:"math"}),this.branch("subscript")!==void 0){const E=Ss.serialize(this.subscript,y);E.length===0?b+="_{}":E.length===1?/^[0-9]$/.test(E)?b+=`_${E}`:b+=`_{${E}}`:b+=`_{${E}}`}if(this.branch("superscript")!==void 0){const E=Ss.serialize(this.superscript,y);E.length===0?b+="^{}":E.length===1?E==="\u2032"?b+="^\\prime ":E==="\u2033"?b+="^\\doubleprime ":/^[0-9]$/.test(E)?b+=`^${E}`:b+=`^{${E}}`:b+=`^{${E}}`}return b}get treeDepth(){let y=1,b=this.parent;for(;b;)b=b.parent,y+=1;return y}get inCaptureSelection(){let y=this;for(;y;){if(y.captureSelection)return!0;y=y.parent}return!1}get parentPrompt(){let y=this.parent;for(;y;){if(y.type==="prompt"&&!y.captureSelection)return y;y=y.parent}return null}branch(y){if(il(y)&&this._branches)return this._branches[y]}get branches(){if(!this._branches)return[];const y=[];for(const b of su)this._branches[b]&&y.push(b);return y}createBranch(y){return console.assert(il(y)),il(y)?(this._branches?this._branches[y]||(this._branches[y]=[this.makeFirstAtom(y)]):this._branches={[y]:[this.makeFirstAtom(y)]},this.isDirty=!0,this._branches[y]):[]}get row(){return Iu(this.parentBranch)?this.parentBranch[0]:-1}get col(){return Iu(this.parentBranch)?this.parentBranch[1]:-1}get body(){var y;return(y=this._branches)==null?void 0:y.body}set body(y){this.setChildren(y,"body")}get superscript(){var y;return(y=this._branches)==null?void 0:y.superscript}set superscript(y){this.setChildren(y,"superscript")}get subscript(){var y;return(y=this._branches)==null?void 0:y.subscript}set subscript(y){this.setChildren(y,"subscript")}get above(){var y;return(y=this._branches)==null?void 0:y.above}set above(y){this.setChildren(y,"above")}get below(){var y;return(y=this._branches)==null?void 0:y.below}set below(y){this.setChildren(y,"below")}get computedStyle(){var y,b;const E=typeof this.style.verbatimColor=="string",ee=typeof this.style.verbatimBackgroundColor=="string",re=we(we({},(b=(y=this.parent)==null?void 0:y.computedStyle)!=null?b:{}),this.style);return delete re.variant,delete re.variantStyle,ee||delete re.verbatimBackgroundColor,E||delete re.verbatimColor,re}applyStyle(y){this.isDirty=!0,this.style=we(we({},this.style),y),this.style.fontFamily==="none"&&delete this.style.fontFamily,this.style.fontShape==="auto"&&delete this.style.fontShape,this.style.fontSeries==="auto"&&delete this.style.fontSeries,this.style.color==="none"&&(delete this.style.color,delete this.style.verbatimColor),this.style.backgroundColor==="none"&&(delete this.style.backgroundColor,delete this.style.verbatimBackgroundColor),this.style.fontSize==="auto"&&delete this.style.fontSize;for(const b of this.children)b.applyStyle(y)}getInitialBaseElement(){var y,b,E;return this.hasEmptyBranch("body")?this:(console.assert(((y=this.body)==null?void 0:y[0].type)==="first"),(E=(b=this.body[1])==null?void 0:b.getInitialBaseElement())!=null?E:this)}getFinalBaseElement(){return this.hasEmptyBranch("body")?this:this.body[this.body.length-1].getFinalBaseElement()}isCharacterBox(){return this.type==="leftright"||this.type==="genfrac"||this.type==="subsup"||this.type==="delim"||this.type==="array"||this.type==="surd"?!1:this.getFinalBaseElement().type==="mord"}hasEmptyBranch(y){const b=this.branch(y);return b?(console.assert(b.length>0),console.assert(b[0].type==="first"),b.length===1):!0}setChildren(y,b){var E;if(!y||(console.assert(il(b)),!il(b)))return;console.assert(((E=y[0])==null?void 0:E.type)!=="first");const ee=[this.makeFirstAtom(b),...y];this._branches?this._branches[b]=ee:this._branches={[b]:ee};for(const re of y)re.parent=this,re.parentBranch=b;this.isDirty=!0}makeFirstAtom(y){const b=new jl({type:"first",mode:this.mode});return b.parent=this,b.parentBranch=y,b}addChild(y,b){console.assert(y.type!=="first"),this.createBranch(b).push(y),this.isDirty=!0,y.parent=this,y.parentBranch=b}addChildBefore(y,b){console.assert(b.parentBranch!==void 0);const E=this.createBranch(b.parentBranch);E.splice(E.indexOf(b),0,y),this.isDirty=!0,y.parent=this,y.parentBranch=b.parentBranch}addChildAfter(y,b){console.assert(b.parentBranch!==void 0);const E=this.createBranch(b.parentBranch);E.splice(E.indexOf(b)+1,0,y),this.isDirty=!0,y.parent=this,y.parentBranch=b.parentBranch}addChildren(y,b){const E=this.createBranch(b);for(const ee of y)ee.parent=this,ee.parentBranch=b,E.push(ee);this.isDirty=!0}addChildrenAfter(y,b){console.assert(y.length===0||y[0].type!=="first"),console.assert(b.parentBranch!==void 0);const E=this.createBranch(b.parentBranch);E.splice(E.indexOf(b)+1,0,...y),this.isDirty=!0;for(const ee of y)ee.parent=this,ee.parentBranch=b.parentBranch;return y[y.length-1]}removeBranch(y){const b=this.branch(y);if(il(y)&&(this._branches[y]=void 0),!b)return[];for(const E of b)E.parent=void 0,E.parentBranch=void 0;return console.assert(b[0].type==="first"),b.shift(),this.isDirty=!0,b}removeChild(y){if(console.assert(y.parent===this),y.type==="first")return;const b=this.branch(y.parentBranch),E=b.indexOf(y);console.assert(E>=0),b.splice(E,1),this.isDirty=!0,y.parent=void 0,y.parentBranch=void 0}get siblings(){return this.parent?this.parent.branch(this.parentBranch):[]}get firstSibling(){return this.siblings[0]}get lastSibling(){const{siblings:y}=this;return y[y.length-1]}get isFirstSibling(){return this===this.firstSibling}get isLastSibling(){return this===this.lastSibling}get hasNoSiblings(){return this.siblings.length===1}get leftSibling(){console.assert(this.parent!==void 0);const y=this.parent.branch(this.parentBranch);return y[y.indexOf(this)-1]}get rightSibling(){console.assert(this.parent!==void 0);const y=this.parent.branch(this.parentBranch);return y[y.indexOf(this)+1]}get hasChildren(){return!!(this._branches&&this.children.length>0)}get firstChild(){return console.assert(this.hasChildren),this.children[0]}get lastChild(){console.assert(this.hasChildren);const{children:y}=this;return y[y.length-1]}get children(){if(this._children)return this._children;if(!this._branches)return[];const y=[];for(const b of su)if(this._branches[b])for(const E of this._branches[b])y.push(...E.children),y.push(E);return this._children=y,y}render(y){if(this.type==="first"&&!y.atomIdsSettings)return null;const b=Fr(this.command,this.mode);if(b!=null&&b.render)return b.render(this,y);const E=new ya({parent:y},this.style);let ee=this.createBox(E,{classes:this.parent?"":"ML__base"});return ee?(!this.subsupPlacement&&(this.superscript||this.subscript)&&(ee=this.attachSupsub(E,{base:ee})),ee.wrap(E)):null}attachSupsub(y,b){var E;const ee=b.base,re=this.superscript,ae=this.subscript;if(!re&&!ae)return ee;let de=null,fe=null;const ge=(E=b.isCharacterBox)!=null?E:this.isCharacterBox();let xe=0;if(re){const ln=new ya({parent:y,mathstyle:"superscript"});de=jl.createBox(ln,re),ge||(xe=ee.height-y.metrics.supDrop*ln.scalingFactor)}let Be=0;if(ae){const ln=new ya({parent:y,mathstyle:"subscript"});fe=jl.createBox(ln,ae),ge||(Be=ee.depth+y.metrics.subDrop*ln.scalingFactor)}let Ve;y.isDisplayStyle?Ve=y.metrics.sup1:y.isCramped?Ve=y.metrics.sup3:Ve=y.metrics.sup2;const ot=.5/Fl/y.scalingFactor;let gt=null;if(fe&&de){xe=Math.max(xe,Ve,de.depth+.25*y.metrics.xHeight),Be=Math.max(Be,y.metrics.sub2);const ln=y.metrics.defaultRuleThickness;if(xe-de.depth-(fe.height-Be)<4*ln){Be=4*ln-(xe-de.depth)+fe.height;const rn=.8*y.metrics.xHeight-(xe-de.depth);rn>0&&(xe+=rn,Be-=rn)}const ar=this.isExtensibleSymbol&&ee.italic?-ee.italic:0;gt=new Ja({individualShift:[{box:fe,shift:Be,marginLeft:ar},{box:de,shift:-xe}]}).wrap(y)}else fe&&!de?(Be=Math.max(Be,y.metrics.sub1,fe.height-.8*el),gt=new Ja({shift:Be,children:[{box:fe,marginRight:ot,marginLeft:this.isCharacterBox()?-ee.italic:0}]})):!fe&&de&&(xe=Math.max(xe,Ve,de.depth+.25*el),gt=new Ja({shift:-xe,children:[{box:de,marginRight:ot}]}));return new sr([ee,new sr(gt,{caret:this.caret,isSelected:this.isSelected,classes:"msubsup"})],{type:b.type})}attachLimits(y,b){const E=this.superscript?jl.createBox(new ya({parent:y,mathstyle:"superscript"},this.style),this.superscript):null,ee=this.subscript?jl.createBox(new ya({parent:y,mathstyle:"subscript"},this.style),this.subscript):null;return!E&&!ee?b.base.wrap(y):nh(y,he(we({},b),{above:E,below:ee}))}bind(y,b){if(!b||y.isPhantom||this.value==="\u200B")return b;let E=this.parent;for(;E&&!E.captureSelection;)E=E.parent;return E!=null&&E.captureSelection||(this.id||(this.id=y.makeID()),b.atomID=this.id),b}createBox(y,b){var E,ee,re,ae;const de=(E=this.value)!=null?E:this.body,fe=(ee=b==null?void 0:b.boxType)!=null?ee:id(this.type);let ge=(re=b==null?void 0:b.classes)!=null?re:"";this.mode==="text"&&(ge+=" ML__text");const xe=typeof de=="string"||de===void 0?new sr(de!=null?de:null,{type:fe,isSelected:this.isSelected,mode:this.mode,maxFontSize:y.scalingFactor,style:he(we({variant:"normal"},this.style),{fontSize:Math.max(1,y.size+y.mathstyle.sizeDelta)}),letterShapeStyle:y.letterShapeStyle,classes:ge}):(ae=jl.createBox(y,de,{type:fe,classes:ge}))!=null?ae:new sr(null);return y.isTight&&(xe.isTight=!0),(this.mode!=="math"||this.style.variant==="main")&&(xe.italic=0),xe.right=xe.italic,this.bind(y,xe),this.caret&&!this.superscript&&!this.subscript&&(xe.caret=this.caret),xe}isDigit(){var y;return this.type==="mord"&&this.value?/^[\d,\.]$/.test(this.value):this.type==="group"&&((y=this.body)==null?void 0:y.length)===2?this.body[0].type==="first"&&this.body[1].value===",":!1}asDigit(){var y;return this.type==="mord"&&this.value&&/^[\d,\.]$/.test(this.value)?this.value:this.type==="group"&&((y=this.body)==null?void 0:y.length)===2&&this.body[0].type==="first"&&this.body[1].value===","?".":""}};function uf(a){let y;const b=[];let E=[];for(const ee of a)if(!y&&!ee.style)E.push(ee);else{const re=ee.computedStyle;y&&re.color===y.color&&re.backgroundColor===y.backgroundColor&&re.fontSize===y.fontSize?E.push(ee):(E.length>0&&b.push(E),E=[ee],y=re)}return E.length>0&&b.push(E),b}function cf(a,y,b){var E,ee,re,ae,de;if(!y||y.length===0)return null;const fe=new ya({parent:a},b.style),ge=!((E=fe.atomIdsSettings)!=null&&E.groupNumbers);let xe=[];if(y.length===1){const Ve=y[0],ot=Ve.render(fe);ot&&(ge&&Ve.isSelected&&ot.selected(!0),xe=[ot])}else{let Ve="",ot=!0;for(const gt of y){(ee=fe.atomIdsSettings)!=null&&ee.groupNumbers&&Ve&&(ot&&gt.isDigit()||!ot&&ud(gt))&&(fe.atomIdsSettings.overrideID=Ve);const ln=gt.render(fe);fe.atomIdsSettings&&(fe.atomIdsSettings.overrideID=void 0),ln&&((re=fe.atomIdsSettings)!=null&&re.groupNumbers&&((gt.isDigit()||ud(gt))&&(!Ve||ot!==gt.isDigit())&&(ot=gt.isDigit(),Ve=(ae=gt.id)!=null?ae:""),Ve&&(!(gt.isDigit()||ud(gt))||!gt.hasEmptyBranch("superscript")||!gt.hasEmptyBranch("subscript"))&&(Ve="")),ge&&gt.isSelected&&ln.selected(!0),xe.push(ln))}}if(xe.length===0)return null;const Be=new sr(xe,he(we({isTight:fe.isTight},b),{type:(de=b.type)!=null?de:"lift"}));return Be.isSelected=xe.every(Ve=>Ve.isSelected),Be.wrap(fe)}function ud(a){return a.mode==="text"}function cd(a){return a.map(y=>y===null?"<null>":Array.isArray(y)&&y[0]instanceof In?{atoms:y.map(b=>b.toJson())}:typeof y=="object"&&"group"in y?{group:y.group.map(b=>b.toJson())}:y)}var al=class _p extends In{constructor(y,b,E){super({type:"text",command:y,mode:"text",displayContainsHighlight:!0}),this.value=b,this.verbatimLatex=b,this.applyStyle(E)}static fromJson(y){return new _p(y.command,y.value,y.style)}render(y){const b=this.createBox(y);return this.caret&&(b.caret=this.caret),b}_serialize(y){var b;return(b=this.verbatimLatex)!=null?b:Fi("text",this.value.codePointAt(0))}};function Pu(a,y){if(a.direction===y.direction){const b=a.ranges.length;if(y.ranges.length===b){let E=0;for(;E<b&&ih(a.ranges[E],y.ranges[E])==="equal";)E++;return E===b?"equal":"different"}}return"different"}function ih(a,y){return a[0]===y[0]&&a[1]===y[1]?"equal":"different"}function jo(a){let y=1/0,b=-1/0;for(const E of a.ranges)y=Math.min(y,E[0],E[1]),b=Math.max(b,E[0],E[1]);return[y,b]}function gl(a){return typeof a=="number"&&!Number.isNaN(a)}function xc(a){return Array.isArray(a)&&a.length===2}function wc(a){return a!=null&&typeof a=="object"&&"ranges"in a&&Array.isArray(a.ranges)}function ah(a,y){const b=a.at(y);let E;if(b){E=b.mode;let ee=b.parent;for(;!E&&ee;)ee&&(E=ee.mode),ee=ee.parent}return E}function df(a,y){if(!y)return"";if(typeof y=="string")return y;if(!a||y.after===void 0)return y.value;let b=!1,E=!1,ee=!1,re=!1,ae=!1,de=!1,fe=!1,ge=!1,xe=!1,Be=!1,Ve=!1,ot=!1,gt=!1,ln=!1,ar=!1,rn=a[0],Vn=0;for(;rn!=null&&rn.type&&/^(subsup|placeholder)$/.test(rn.type);)Vn+=1,rn=a[Vn];return b=!rn||rn.type==="first",rn&&(ln=rn.mode==="text",E=!ln&&rn.type==="mord"&&ve.test(rn.value),ee=!ln&&rn.type==="mord"&&/\d+$/.test(rn.value),re=!ln&&rn.isFunction,ae=rn.type==="genfrac",de=rn.type==="surd",fe=rn.type==="mbin",ge=rn.type==="mrel",xe=rn.type==="mop"||rn.type==="operator"||rn.type==="extensible-symbol",Be=rn.type==="mpunct"||rn.type==="minner",Ve=rn.type==="array",ot=rn.type==="mopen",gt=rn.type==="mclose"||rn.type==="leftright",ar=rn.type==="space"),y.after.includes("nothing")&&b||y.after.includes("letter")&&E||y.after.includes("digit")&&ee||y.after.includes("function")&&re||y.after.includes("frac")&&ae||y.after.includes("surd")&&de||y.after.includes("binop")&&fe||y.after.includes("relop")&&ge||y.after.includes("operator")&&xe||y.after.includes("punct")&&Be||y.after.includes("array")&&Ve||y.after.includes("openfence")&&ot||y.after.includes("closefence")&&gt||y.after.includes("text")&&ln||y.after.includes("space")&&ar?y.value:""}function dd(a,y,b){return b?df(a,b[y]):""}var ff={"&":"\\&","%":"\\%",$:"\\$","''":"^{\\doubleprime}","'''":"^{\\prime\\prime\\prime}","''''":"^{\\prime\\prime\\prime\\prime}",alpha:"\\alpha",delta:"\\delta",Delta:"\\Delta",pi:"\\pi",Pi:"\\Pi",theta:"\\theta",Theta:"\\Theta",ii:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryI"},jj:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\imaginaryJ"},ee:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\exponentialE"},nabla:"\\nabla",grad:"\\nabla",del:"\\partial",deg:{after:"digit+space",value:"\\degree"},infty:"\\infty","\u221E":"\\infty",oo:{after:"nothing+digit+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\infty"},"\u2211":"\\sum",sum:"\\sum_{#?}^{#?}",int:"\\int_{#?}^{#?}",prod:"\\prod_{#?}^{#?}",sqrt:"\\sqrt{#?}","\u2206":"\\differentialD","\u2202":"\\differentialD",arcsin:"\\arcsin",arccos:"\\arccos",arctan:"\\arctan",arcsec:"\\arcsec",arccsc:"\\arccsc",arsinh:"\\arsinh",arcosh:"\\arcosh",artanh:"\\artanh",arcsech:"\\arcsech",arccsch:"\\arccsch",arg:"\\arg",ch:"\\ch",cosec:"\\cosec",cosh:"\\cosh",cot:"\\cot",cotg:"\\cotg",coth:"\\coth",csc:"\\csc",ctg:"\\ctg",cth:"\\cth",sec:"\\sec",sinh:"\\sinh",sh:"\\sh",tanh:"\\tanh",tg:"\\tg",th:"\\th",sin:"\\sin",cos:"\\cos",tan:"\\tan",lg:"\\lg",lb:"\\lb",log:"\\log",ln:"\\ln",exp:"\\exp",lim:"\\lim_{#?}",dx:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD x"},dy:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD y"},dt:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\differentialD t"},AA:"\\forall",EE:"\\exists","!EE":"\\nexists","&&":"\\land",xin:{after:"nothing+text+relop+punct+openfence+space",value:"x \\in"},sint:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\sin t"},in:{after:"nothing+letter+closefence",value:"\\in"},"!in":"\\notin",NN:"\\mathbb{N}",ZZ:"\\Z",QQ:"\\Q",RR:"\\R",CC:"\\C",xx:"\\times","+-":"\\pm","\u2260":"\\ne","!=":"\\ne","\u2265":"\\ge",">=":"\\ge","\u2264":"\\le","<=":"\\le","<<":"\\ll",">>":"\\gg","~~":"\\approx","\u2248":"\\approx","?=":"\\questeq","\xF7":"\\div","\xAC":"\\neg",":=":"\\coloneq","::":"\\Colon","(:":"\\langle",":)":"\\rangle",beta:"\\beta",chi:"\\chi",epsilon:"\\epsilon",varepsilon:"\\varepsilon",eta:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\eta"},gamma:"\\gamma",Gamma:"\\Gamma",iota:"\\iota",kappa:"\\kappa",lambda:"\\lambda",Lambda:"\\Lambda",mu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\mu"},nu:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\nu"},\u00B5:"\\mu",phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\phi"},Phi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Phi"},varphi:"\\varphi",psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\psi"},Psi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Psi"},rho:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\rho"},sigma:"\\sigma",Sigma:"\\Sigma",tau:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\tau"},vartheta:"\\vartheta",upsilon:"\\upsilon",xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space",value:"\\xi"},Xi:{after:"nothing+digit+function+frac+surd+binop+relop+punct+array+openfence+closefence+space+text",value:"\\Xi"},zeta:"\\zeta",omega:"\\omega",Omega:"\\Omega",\u03A9:"\\omega",forall:"\\forall",exists:"\\exists","!exists":"\\nexists",":.":"\\therefore",liminf:"\\liminf_{#?}",limsup:"\\limsup_{#?}",argmin:"\\operatorname*{arg~min}_{#?}",argmax:"\\operatorname*{arg~max}_{#?}",det:"\\det",mod:"\\bmod{#?}","(mod":"\\pmod{#?}",max:"\\max",min:"\\min",erf:"\\operatorname{erf}",erfc:"\\operatorname{erfc}",bessel:"\\operatorname{bessel}",mean:"\\operatorname{mean}",median:"\\operatorname{median}",fft:"\\operatorname{fft}",lcm:"\\operatorname{lcm}",gcd:"\\operatorname{gcd}",randomReal:"\\operatorname{randomReal}",randomInteger:"\\operatorname{randomInteger}",Re:"\\operatorname{Re}",Im:"\\operatorname{Im}",mm:{after:"nothing+digit+operator",value:"\\operatorname{mm}"},cm:{after:"nothing+digit+operator",value:"\\operatorname{cm}"},km:{after:"nothing+digit+operator",value:"\\operatorname{km}"},kg:{after:"nothing+digit+operator",value:"\\operatorname{kg}"},"...":"\\ldots","+...":"+\\cdots","-...":"-\\cdots","->...":"\\to\\cdots","-->...":"\\longrightarrow\\cdots","->":"\\to","|->":"\\mapsto","-->":"\\longrightarrow","<--":"\\longleftarrow","=>":"\\Rightarrow","==>":"\\Longrightarrow","<=>":"\\Leftrightarrow","<->":"\\leftrightarrow","(.)":"\\odot","(+)":"\\oplus","(/)":"\\oslash","(*)":"\\otimes","(-)":"\\ominus","||":"\\Vert","*":"\\cdot","**":"\\star","***":"\\ast","//":"\\slash","\\\\":"\\backslash",setminus:"\\backslash","|><":"\\ltimes","><|":"\\rtimes","|><|":"\\bowtie","-:":"\\div",divide:"\\div","@":"\\circ","^^":"\\wedge","^^^":"\\bigwedge",vv:"\\vee",vvv:"\\bigvee",nn:"\\cap",nnn:"\\bigcap",uu:"\\cup",uuu:"\\bigcup","-=":"\\equiv","~=":"\\cong",lt:"<","lt=":"\\leq",gt:">","gt=":"\\geq","-<":"\\prec","-lt":"\\prec","-<=":"\\preceq",">-=":"\\succeq",prop:"\\propto",diamond:"\\diamond",square:"\\square",iff:"\\iff",sub:"\\subset",sup:"\\supset",sube:"\\subseteq",supe:"\\supseteq",uarr:"\\uparrow",darr:"\\downarrow",rarr:"\\rightarrow",rArr:"\\Rightarrow",larr:"\\leftarrow",lArr:"\\Leftarrow",harr:"\\leftrightarrow",hArr:"\\Leftrightarrow",aleph:"\\aleph",and:"\\land",or:"\\lor",not:"\\neg","_|_":"\\bot",TT:"\\top","|--":"\\vdash","|==":"\\models","|__":"\\lfloor","__|":"\\rfloor","|~":"\\lceil","~|":"\\rceil",">->":"\\rightarrowtail","->>":"\\twoheadrightarrow",">->>":"\\twoheadrightarrowtail",frac:"\\frac{#?}{#?}",cbrt:"\\sqrt[3]{#?}",nthroot:"\\sqrt[#?]{#?}"};function Bu(a,y){var b;let E=(b=y==null?void 0:y.format)!=null?b:"auto";return E==="auto"&&([E,a]=pf(a)),E==="ascii-math"?(a=a.replace(/\u2061/gu,""),a=a.replace(/\u3016/gu,"{"),a=a.replace(/\u3017/gu,"}"),a=a.replace(/([^\\])sinx/g,"$1\\sin x"),a=a.replace(/([^\\])cosx/g,"$1\\cos x "),a=a.replace(/\u2013/g,"-"),["ascii-math",ts(a,{inlineShortcuts:y==null?void 0:y.inlineShortcuts})]):["latex",a]}function ts(a,y){var b,E,ee;if(!a)return"";let re=!1,ae;const de=(b=y.inlineShortcuts)!=null?b:ff;if(!re&&(a.startsWith("^")||a.startsWith("_"))&&(ae=vl(a.slice(1),{inlineShortcuts:de,noWrap:!0}),a=a[0]+"{"+ae.match+"}",a+=ts(ae.rest,y),re=!0),re||(ae=a.match(/^(sqrt|\u221A)(.*)/),ae&&(ae=vl(ae[2],{inlineShortcuts:de,noWrap:!0}),a="\\sqrt{"+((E=ae.match)!=null?E:"\\placeholder{}")+"}",a+=ts(ae.rest,y),re=!0)),re||(ae=a.match(/^(\\cbrt|\u221B)(.*)/),ae&&(ae=vl(ae[2],{inlineShortcuts:de,noWrap:!0}),a="\\sqrt[3]{"+((ee=ae.match)!=null?ee:"\\placeholder{}")+"}",a+=ts(ae.rest,y),re=!0)),re||(ae=a.match(/^abs(.*)/),ae&&(ae=vl(ae[1],{inlineShortcuts:de,noWrap:!0}),a="\\left|"+ae.match+"\\right|",a+=ts(ae.rest,y),re=!0)),re||(ae=a.match(/^["”“](.*?)["”“](.*)/),ae&&(a="\\text{"+ae[1]+"}",a+=ts(ae[2],y),re=!0)),re||(ae=a.match(/^([^a-zA-Z\(\{\[\_\^\\\s"]+)(.*)/),ae&&(a=hf(ae[1],de),a+=ts(ae[2],y),re=!0)),!re&&/^([fgh])[^a-zA-Z]/.test(a)&&(ae=vl(a.slice(1),{inlineShortcuts:de,noWrap:!0}),a=a[1]==="("?a[0]+"\\left("+ae.match+"\\right)":a[0]+ae.match,a+=ts(ae.rest,y),re=!0),re||(ae=a.match(/^([a-zA-Z]+)(.*)/),ae&&(a=hf(ae[1],de),a+=ts(ae[2],y),re=!0)),!re)if(ae=vl(a,{inlineShortcuts:de,noWrap:!0}),ae.match&&ae.rest[0]==="/"){const fe=vl(ae.rest.slice(1),{inlineShortcuts:de,noWrap:!0});fe.match&&(a="\\frac{"+ae.match+"}{"+fe.match+"}"+ts(fe.rest,y)),re=!0}else ae.match&&(a=a.startsWith("(")?"\\left("+ae.match+"\\right)"+ts(ae.rest,y):ae.match+ts(ae.rest,y),re=!0);return re||(ae=a.match(/^(\s+)(.*)$/),ae&&(a=" "+ts(ae[2],y),re=!0)),a}function vl(a,y){let b="";a=a.trim();let E=a,ee=a.charAt(0),re={"(":")","{":"}","[":"]"}[ee];if(re){let ae=1,de=1;for(;de<a.length&&ae>0;)a[de]===ee&&ae++,a[de]===re&&ae--,de++;ae===0?(y.noWrap&&ee==="("?b=ts(a.substring(1,de-1),y):(ee==="{"&&re==="}"&&(ee="\\{",re="\\}"),b="\\left"+ee+ts(a.substring(1,de-1),y)+"\\right"+re),E=a.slice(Math.max(0,de))):(b=a.substring(1,de),E="")}else{let ae=a.match(/^([a-zA-Z]+)/);if(ae){let de=dd(null,a,y.inlineShortcuts);if(de)return de=de.replace("_{#?}",""),de=de.replace("^{#?}",""),{match:de,rest:a.slice(de.length)}}if(ae=a.match(/^([a-zA-Z])/),ae)return{match:ae[1],rest:a.slice(1)};if(ae=a.match(/^(-)?\d+(\.\d*)?/),ae)return{match:ae[0],rest:a.slice(ae[0].length)};/^\\(left|right)/.test(a)||(ae=a.match(/^(\\[a-zA-Z]+)/),ae&&(E=a.slice(ae[1].length),b=ae[1]))}return{match:b,rest:E}}function hf(a,y){let b=dd(null,a,y);return b?(b=b.replace("_{#?}",""),b=b.replace("^{#?}",""),b+=" "):b=a,b}var fd=[["\\[","\\]"],["\\(","\\)"],["$$","$$"],["$","$"],["\\begin{math}","\\end{math}"],["\\begin{displaymath}","\\end{displaymath}"],["\\begin{equation}","\\end{equation}"],["\\begin{equation*}","\\end{equation*}"]];function yl(a){const y=a.trim();for(const b of fd)if(y.startsWith(b[0])&&y.endsWith(b[1]))return[!0,y.substring(b[0].length,y.length-b[1].length)];return[!1,a]}function pf(a){if(a=a.trim(),a.length<=1)return["latex",a];let y;return[y,a]=yl(a),y?["latex",a]:a.startsWith("`")&&a.endsWith("`")?(a=a.substring(1,a.length-1),["ascii-math",a]):a.includes("\\")?["latex",a]:/\$.+\$/.test(a)?["latex",`\\text{${a}}`]:[void 0,a]}var Sc="$$",oh="$$",sh=(a,y,b)=>(fd.some(E=>y.startsWith(E[0])&&y.endsWith(E[1]))||(y=`${Sc} ${y} ${oh}`),y),mf=class Qf{constructor(y){Qf._modes[y]=this}static onPaste(y,b,E){var ee;if(!b.contentEditable&&b.userSelect==="none")return b.model.announce("plonk"),!1;if(typeof E=="string"){const ae=new DataTransfer;ae.setData("text/plain",E),E=ae}const re=new ClipboardEvent("paste",{clipboardData:E,cancelable:!0});return(ee=b.host)!=null&&ee.dispatchEvent(re)?Qf._modes[y].onPaste(b,E):!1}static copyToClipboard(y,b){if(!y.contentEditable&&y.userSelect==="none"){y.model.announce("plonk");return}const E=y.model,ee=E.selectionIsCollapsed?[0,E.lastOffset]:jo(E.selection),re=E.getValue(ee,b);navigator.clipboard.writeText(re).then(()=>{},()=>y.model.announce("plonk"))}static onCopy(y,b){var E;if(!b.clipboardData)return;if(!y.contentEditable&&y.userSelect==="none"){y.model.announce("plonk");return}const ee=y.model,re=ee.selectionIsCollapsed?[0,ee.lastOffset]:jo(ee.selection);let ae=ee.getAtoms(re);if(ae.every(de=>de.mode==="text"||!de.mode))b.clipboardData.setData("text/plain",ae.filter(de=>de instanceof al).map(de=>de.value).join(""));else if(ae.every(de=>de.mode==="latex"))b.clipboardData.setData("text/plain",ee.getAtoms(re,{includeChildren:!0}).map(de=>{var fe;return(fe=de.value)!=null?fe:""}).join(""));else{let de;ae.length===1&&ae[0].verbatimLatex!==void 0?de=ae[0].verbatimLatex:de=ee.getValue(re,"latex-expanded"),b.clipboardData.setData("application/x-latex",de);try{b.clipboardData.setData("text/plain",y.options.onExport(y,de,re))}catch(fe){}if(ae.length===1){const fe=ae[0];(fe.type==="root"||fe.type==="group")&&(ae=fe.body.filter(ge=>ge.type!=="first"))}try{b.clipboardData.setData("application/json+mathlive",JSON.stringify(ae.map(fe=>fe.toJson())))}catch(fe){}if((E=window[Symbol.for("io.cortexjs.compute-engine")])!=null&&E.ComputeEngine){const fe=window.MathfieldElement.computeEngine;if(fe)try{const ge=fe.jsonSerializationOptions;fe.jsonSerializationOptions={metadata:["latex"]};const xe=fe.parse(ee.getValue(re,"latex-unstyled"));fe.jsonSerializationOptions=ge;const Be=JSON.stringify(xe.json);Be&&b.clipboardData.setData("application/json",Be)}catch(ge){}}}b.preventDefault()}static insert(y,b,E={}){var ee;const re=E.mode==="auto"?y.mode:(ee=E.mode)!=null?ee:y.mode;return Qf._modes[re].insert(y,b,E)}onPaste(y,b){return!1}insert(y,b,E){return!1}};mf._modes={};var Bi=mf,lh=[{key:"left",command:"moveToPreviousChar"},{key:"right",command:"moveToNextChar"},{key:"up",command:"moveUp"},{key:"down",command:"moveDown"},{key:"shift+[ArrowLeft]",command:"extendSelectionBackward"},{key:"shift+[ArrowRight]",command:"extendSelectionForward"},{key:"shift+[ArrowUp]",command:"extendSelectionUpward"},{key:"shift+[ArrowDown]",command:"extendSelectionDownward"},{key:"[Backspace]",command:"deleteBackward"},{key:"alt+[Delete]",command:"deleteBackward"},{key:"[Delete]",command:"deleteForward"},{key:"alt+[Backspace]",command:"deleteForward"},{key:"alt+[ArrowLeft]",command:"moveToPreviousWord"},{key:"alt+[ArrowRight]",command:"moveToNextWord"},{key:"shift+alt+[ArrowLeft]",command:"extendToPreviousWord"},{key:"shift+alt+[ArrowRight]",command:"extendToNextWord"},{key:"ctrl+[ArrowLeft]",command:"moveToGroupStart"},{key:"ctrl+[ArrowRight]",command:"moveToGroupEnd"},{key:"shift+ctrl+[ArrowLeft]",command:"extendToGroupStart"},{key:"shift+ctrl+[ArrowRight]",command:"extendToGroupEnd"},{key:"[Home]",command:"moveToMathfieldStart"},{key:"cmd+[ArrowLeft]",command:"moveToMathfieldStart"},{key:"shift+[Home]",command:"extendToMathFieldStart"},{key:"shift+cmd+[ArrowLeft]",command:"extendToMathFieldStart"},{key:"[End]",command:"moveToMathfieldEnd"},{key:"cmd+[ArrowRight]",command:"moveToMathfieldEnd"},{key:"shift+[End]",command:"extendToMathFieldEnd"},{key:"shift+cmd+[ArrowRight]",command:"extendToMathFieldEnd"},{key:"[Pageup]",command:"moveToGroupStart"},{key:"[Pagedown]",command:"moveToGroupEnd"},{key:"[Tab]",command:"moveToNextGroup"},{key:"shift+[Tab]",command:"moveToPreviousGroup"},{key:"[Escape]",ifMode:"math",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"text",command:["switchMode","latex"]},{key:"[Escape]",ifMode:"latex",command:["complete","complete",{selectItem:"true"}]},{key:"\\",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[IntlBackslash]",ifMode:"math",command:["switchMode","latex","\\"]},{key:"[Tab]",ifMode:"latex",command:["complete","accept-suggestion"]},{key:"[Return]",ifMode:"latex",command:"complete"},{key:"[Enter]",ifMode:"latex",command:"complete"},{key:"shift+[Escape]",ifMode:"latex",command:["complete","reject"]},{key:"[ArrowDown]",ifMode:"latex",command:"nextSuggestion"},{key:"[ArrowUp]",ifMode:"latex",command:"previousSuggestion"},{key:"ctrl+a",ifPlatform:"!macos",command:"selectAll"},{key:"cmd+a",command:"selectAll"},{key:"[Cut]",command:"cutToClipboard"},{key:"[Copy]",command:"copyToClipboard"},{key:"[Paste]",command:"pasteFromClipboard"},{key:"[Clear]",command:"deleteBackward"},{key:"[Undo]",command:"undo"},{key:"[Redo]",command:"redo"},{key:"[EraseEof]",command:"deleteToGroupEnd"},{key:"ctrl+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"cmd+x",ifPlatform:"ios",command:"cutToClipboard"},{key:"ctrl+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"cmd+c",ifPlatform:"ios",command:"copyToClipboard"},{key:"ctrl+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"cmd+v",ifPlatform:"ios",command:"pasteFromClipboard"},{key:"ctrl+z",ifPlatform:"!macos",command:"undo"},{key:"cmd+z",command:"undo"},{key:"ctrl+y",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+y",command:"redo"},{key:"shift+ctrl+z",ifPlatform:"!macos",command:"redo"},{key:"shift+cmd+z",command:"redo"},{key:"ctrl+b",ifPlatform:"macos",command:"moveToPreviousChar"},{key:"ctrl+f",ifPlatform:"macos",command:"moveToNextChar"},{key:"ctrl+p",ifPlatform:"macos",command:"moveUp"},{key:"ctrl+n",ifPlatform:"macos",command:"moveDown"},{key:"ctrl+a",ifPlatform:"macos",command:"moveToMathfieldStart"},{key:"ctrl+e",ifPlatform:"macos",command:"moveToMathfieldEnd"},{key:"shift+ctrl+b",ifPlatform:"macos",command:"extendSelectionBackward"},{key:"shift+ctrl+f",ifPlatform:"macos",command:"extendSelectionForward"},{key:"shift+ctrl+p",ifPlatform:"macos",command:"extendSelectionUpward"},{key:"shift+ctrl+n",ifPlatform:"macos",command:"extendSelectionDownward"},{key:"shift+ctrl+a",ifPlatform:"macos",command:"extendToMathFieldStart"},{key:"shift+ctrl+e",ifPlatform:"macos",command:"extendToMathFieldEnd"},{key:"alt+ctrl+b",ifPlatform:"macos",command:"moveToPreviousWord"},{key:"alt+ctrl+f",ifPlatform:"macos",command:"moveToNextWord"},{key:"shift+alt+ctrl+b",ifPlatform:"macos",command:"extendToPreviousWord"},{key:"shift+alt+ctrl+f",ifPlatform:"macos",command:"extendToNextWord"},{key:"ctrl+h",ifPlatform:"macos",command:"deleteBackward"},{key:"ctrl+d",ifPlatform:"macos",command:"deleteForward"},{key:"ctrl+l",ifPlatform:"macos",command:"scrollIntoView"},{key:"ctrl+[Digit2]",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"ctrl+[Digit5]",ifMode:"math",command:"moveToOpposite"},{key:"ctrl+[Digit6]",ifMode:"math",command:"moveToSuperscript"},{key:"ctrl+[Return]",ifMode:"math",command:"addRowAfter"},{key:"ctrl+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Return]",ifMode:"math",command:"addRowAfter"},{key:"cmd+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"alt+p",ifMode:"math",command:["insert","\\pi"]},{key:"alt+v",ifMode:"math",command:["insert","\\sqrt{#0}"]},{key:"alt+o",ifMode:"math",command:["insert","\\emptyset"]},{key:"alt+d",ifMode:"math",command:["insert","\\differentialD"]},{key:"shift+alt+o",ifMode:"math",command:["insert","\\varnothing"]},{key:"shift+alt+d",ifMode:"math",command:["insert","\\partial"]},{key:"alt+[Backslash]",ifMode:"math",command:["insert","\\backslash"]},{key:"[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+[NumpadDivide]",ifMode:"math",command:["insert","\\frac{#?}{#@}"]},{key:"shift+alt+k",command:"toggleKeystrokeCaption"},{key:"alt+[Space]",command:"toggleContextMenu"},{key:"alt+shift+[Space]",command:"toggleVirtualKeyboard"},{key:"alt+ctrl+[ArrowUp]",command:["speak","all",{withHighlighting:!1}]},{key:"alt+ctrl+[ArrowDown]",command:["speak","selection",{withHighlighting:!1}]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["switchMode","text","",""]},{key:"shift+alt+[KeyT]",ifMode:"math",command:["switchMode","text","",""]},{key:"shift+[Quote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"text",command:["switchMode","math","",""]},{key:"shift+alt+[KeyT]",ifMode:"text",command:["switchMode","math","",""]},{key:"/",ifMode:"math",command:["insert","\\frac{#@}{#?}"]},{key:"alt+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","/"]},{key:"alt+shift+/",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","/"]},{key:"alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrack #0 \\right\\rbrack"]},{key:"ctrl+[Minus]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"moveToSubscript"},{key:"shift+alt+[BracketLeft]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\left\\lbrace #0 \\right\\rbrace"]},{key:"ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowAfter"},{key:"shift+ctrl+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"shift+cmd+;",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:"addRowBefore"},{key:"ctrl+[Backspace]",ifMode:"math",command:"removeRow"},{key:"cmd+[Backspace]",ifMode:"math",command:"removeRow"},{key:"alt+[Tab]",ifMode:"math",command:"addColumnAfter"},{key:"shift+alt+[Tab]",ifMode:"math",command:"addColumnBefore"},{key:"alt+[Enter]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Enter]",ifMode:"math",command:"addRowBefore"},{key:"alt+[Return]",ifMode:"math",command:"addRowAfter"},{key:"shift+alt+[Return]",ifMode:"math",command:"addRowBefore"},{key:"shift+[Backspace]",ifMode:"math",command:"removeColumn"},{key:"alt+[Digit5]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","$\\infty"]},{key:"alt+[Digit9]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","("]},{key:"alt+[Digit0]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert",")"]},{key:"alt+|",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","|"]},{key:"shift+[Backquote]",ifLayout:["apple.en-intl","windows.en-intl","linux.en"],ifMode:"math",command:["insert","\\~"]},{key:"[Backquote]",ifLayout:["windows.french","linux.french"],ifMode:"math",command:["insert","^2"]},{key:"[Backquote]",ifLayout:["windows.german","linux.german"],ifMode:"math",command:["insert","^"]},{key:"[IntlBackslash]",ifLayout:["apple.german"],ifMode:"math",command:["insert","^"]}],hd={"\\sqrt":["alt+v","ctrl+[Digit2]"],"\\pi":"alt+p","\\infty":"alt+[Digit5]","\\differentialD":"alt+d","\\partial":"shift+alt+d","\\frac":"Slash","\\emptyset":"alt+o","\\varnothing":"shift+alt+o","\\~":"~"};function Os(a){var y;return((y=a.element)==null?void 0:y.mathfield)===a}function Rs(a){var y,b;return(b=(y=a.querySelector(".ML__caret"))!=null?y:a.querySelector(".ML__text-caret"))!=null?b:a.querySelector(".ML__latex-caret")}function bl(a){const y=Rs(a);if(!y)return null;const b=y.getBoundingClientRect();return{x:b.right,y:b.bottom,height:b.height}}function pd(a){var y;if(!a.parent)return"root";let b=(y=a.parent.id)!=null?y:"";return b+=typeof a.parentBranch=="string"?"-"+a.parentBranch:`-${a.parentBranch[0]}/${a.parentBranch[0]}`,b}function md(a,y,b){if(!y)return null;const E=a.field.getBoundingClientRect(),ee=y.right-y.left,re=y.bottom-y.top,ae=Math.ceil(y.left-E.left+a.field.scrollLeft*b),de=Math.ceil(y.top-E.top);return{left:ae,right:ae+ee,top:de,bottom:de+re}}function gd(a){const y=a.getBoundingClientRect(),b=parseInt(getComputedStyle(a).marginRight),E={top:y.top-1,bottom:y.bottom,left:y.left,right:y.right-1+b};if(a.children.length===0||a.tagName.toUpperCase()==="SVG")return E;for(const ee of a.children)if(ee.nodeType===1&&"atomId"in ee.dataset&&!ee.classList.contains("pstrut")){const re=gd(ee);E.left=Math.min(E.left,re.left),E.right=Math.max(E.right,re.right),E.top=Math.min(E.top,re.top),E.bottom=Math.max(E.bottom,re.bottom)}return E}function lu(a,y){var b,E;if(!y.id)return null;let ee=(E=(b=a.atomBoundsCache)==null?void 0:b.get(y.id))!=null?E:null;if(ee!==null)return ee;const re=a.field.querySelector(`[data-atom-id="${y.id}"]`);return ee=re?gd(re):null,a.atomBoundsCache&&(ee?a.atomBoundsCache.set(y.id,ee):a.atomBoundsCache.delete(y.id)),ee!=null?ee:null}function gf(a,y,b){const E=new Map;for(const ee of a.model.getAtoms(y,{includeChildren:!0})){if(b!=null&&b.excludeAtomsWithBackground&&ee.style.backgroundColor)continue;const re=a.field,ae=re.offsetWidth;let fe=Math.floor(re.getBoundingClientRect().width)/ae;fe=isNaN(fe)?1:fe;const ge=md(a,lu(a,ee),fe);if(ge){const xe=pd(ee);if(E.has(xe)){const Be=E.get(xe);E.set(xe,{left:Math.min(Be.left,ge.left),right:Math.max(Be.right,ge.right),top:Math.min(Be.top,ge.top),bottom:Math.max(Be.bottom,ge.bottom)})}else E.set(xe,ge)}}return[...E.values()]}function vd(a,y){return a.model.selection.ranges.reduce((b,E)=>b.concat(...gf(a,E,y)),[])}function yd(a,y){return a==="*"||y==="none"?!0:y==="same-origin"?!window.origin||a===window.origin:typeof y=="function"?y(a):!1}function Cc(a){let y=0,b=0;const E=a.offsetWidth,ee=a.offsetHeight;for(;a instanceof HTMLElement;)y+=a.offsetTop,b+=a.offsetLeft,a=a.offsetParent;return new DOMRect(b,y,E,ee)}var vf=`@keyframes ML__caret-blink {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0;
}
}
.ML__container {
display: inline-flex;
flex-flow: row;
justify-content: space-between;
align-items: flex-end;
min-height: 39px;
/* Need some room for the virtual keyboard toggle */
width: 100%;
/* Encourage browsers to consider allocating a hardware accelerated
layer for this element. */
isolation: isolate;
/* Prevent the browser from trying to interpret touch gestures in the field */
/* "Disabling double-tap to zoom removes the need for browsers to
delay the generation of click events when the user taps the screen." */
touch-action: none;
--_caret-color: var(--caret-color, hsl(var(--_hue), 40%, 49%));
--_selection-color: var(--selection-color, #000);
--_selection-background-color: var(--selection-background-color, hsl(var(--_hue), 70%, 85%));
--_text-highlight-background-color: var(--highlight-text, hsla(var(--_hue), 40%, 50%, 0.1));
--_contains-highlight-background-color: var(--contains-highlight-background-color, hsl(var(--_hue), 40%, 95%));
--_smart-fence-color: var(--smart-fence-color, currentColor);
--_smart-fence-opacity: var(--smart-fence-opacity, 0.5);
--_latex-color: var(--latex-color, hsl(var(--_hue), 80%, 40%));
--_correct-color: var(--correct-color, #10a000);
--_incorrect-color: var(--incorrect-color, #a01b00);
--_composition-background-color: var(--composition-background-color, #fff1c2);
--_composition-text-color: var(--composition-text-color, black);
--_composition-underline-color: var(--composition-underline-color, transparent);
}
/* This is the actual field content (formula) */
.ML__content {
display: flex;
align-items: center;
align-self: center;
position: relative;
overflow: hidden;
padding: 2px 3px 2px 1px;
width: 100%;
}
.ML__virtual-keyboard-toggle,
.ML__menu-toggle {
box-sizing: border-box;
display: flex;
align-self: center;
align-items: center;
flex-shrink: 0;
flex-direction: column;
justify-content: center;
width: 34px;
height: 34px;
padding: 0;
margin-right: 4px;
cursor: pointer;
/* Avoid some weird blinking with :hover */
border-radius: 8px;
border: 1px solid transparent;
transition: background 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
color: hsl(var(--_hue), 40%, 50%);
fill: currentColor;
background: transparent;
}
.ML__virtual-keyboard-toggle:hover,
.ML__menu-toggle:hover {
background: hsla(0, 0%, 70%, 0.3);
color: #333;
fill: currentColor;
}
.ML__virtual-keyboard-toggle > span,
.ML__menu-toggle > span {
display: flex;
align-self: center;
align-items: center;
}
/* The invisible element used to capture keyboard events. We're just trying
really hard to make sure it doesn't show. */
.ML__keyboard-sink {
display: inline-block;
resize: none;
outline: none;
border: none;
/* Need these for Microsoft Edge */
position: fixed;
clip: rect(0 0 0 0);
/* Need this to prevent iOS Safari from auto-zooming */
font-size: 1em;
font-family: KaTeX_Main;
line-height: 0.5;
/* On Chromium, if this is 0, no keyboard events are received */
}
[part="placeholder"] {
color: var(--neutral-400);
}
.ML__composition {
background: var(--_composition-background-color);
color: var(--_composition-text-color);
text-decoration: underline var(--_composition-underline-color);
}
.ML__caret::after {
content: '';
visibility: hidden;
width: 0;
display: inline-block;
height: 0.76em;
--_caret-width: clamp(2px, 0.08em, 10px);
border: none;
border-radius: calc(var(--_caret-width) / 2);
border-right: var(--_caret-width) solid var(--_caret-color);
margin-right: calc(-1 * var(--_caret-width));
position: relative;
left: -0.045em;
bottom: -0.05em;
animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__text-caret::after {
content: '';
visibility: hidden;
width: 0;
display: inline-block;
height: 0.76em;
--_caret-width: clamp(2px, 0.08em, 10px);
border: none;
border-radius: calc(var(--_caret-width) / 2);
border-right: var(--_caret-width) solid var(--_caret-color);
margin-right: calc(-1 * var(--_caret-width));
position: relative;
left: -0.045em;
bottom: -0.05em;
animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__latex-caret::after {
content: '';
visibility: hidden;
--_caret-width: clamp(2px, 0.08em, 10px);
border: none;
border-radius: calc(var(--_caret-width) / 2);
border-right: var(--_caret-width) solid var(--_latex-color);
margin-right: calc(-1 * var(--_caret-width));
position: relative;
left: -0.019em;
animation: ML__caret-blink 1.05s step-end forwards infinite;
}
.ML__focused .ML__latex-caret::after,
.ML__focused .ML__text-caret::after,
.ML__focused .ML__caret::after {
visibility: visible;
}
.ML__focused .ML__text {
background: var(--_text-highlight-background-color);
}
/* When using smartFence, the anticipated closing fence is displayed
with this style */
.ML__smart-fence__close {
opacity: var(--_smart-fence-opacity);
color: var(--_smart-fence-color);
}
.ML__selected,
.ML__focused .ML__selected .ML__contains-caret,
.ML__focused .ML__selected .ML__smart-fence__close,
.ML__focused .ML__selected .ML__placeholder {
color: var(--_selection-color);
opacity: 1;
}
.ML__selection {
box-sizing: border-box;
background: var(--_selection-background-color) !important;
}
.ML__contains-caret.ML__close,
.ML__contains-caret.ML__open,
.ML__contains-caret > .ML__close,
.ML__contains-caret > .ML__open,
.ML__contains-caret .ML__sqrt-sign,
.ML__contains-caret .ML__sqrt-line {
color: var(--_caret-color);
}
.ML__contains-highlight {
box-sizing: border-box;
background: transparent;
}
.ML__focused .ML__contains-highlight {
background: var(--_contains-highlight-background-color);
}
.ML__raw-latex {
font-family: 'Berkeley Mono', 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
font-weight: 400;
font-size: 0.8em;
letter-spacing: -0.05em;
color: var(--_latex-color);
}
.ML__suggestion {
color: var(--neutral-500);
}
.ML__virtual-keyboard-toggle.is-visible.is-pressed:hover {
background: hsl(var(--_hue), 25%, 35%);
color: #fafafa;
fill: currentColor;
}
.ML__virtual-keyboard-toggle:focus {
outline: none;
border-radius: 8px;
border: 2px solid hsl(var(--_hue), 40%, 50%);
}
.ML__virtual-keyboard-toggle.is-pressed,
.ML__virtual-keyboard-toggle.is-active:hover,
.ML__virtual-keyboard-toggle.is-active {
background: hsl(var(--_hue), 25%, 35%);
color: #fafafa;
fill: currentColor;
}
/* Add an attribute 'data-tooltip' to automatically show a
tooltip over a element on hover.
*/
[data-tooltip] {
position: relative;
}
[data-tooltip]::after {
content: attr(data-tooltip);
position: absolute;
display: block;
z-index: 2;
pointer-events: none;
right: auto;
top: calc(-100% - 4px);
width: max-content;
max-width: 200px;
padding: 8px 8px;
border-radius: 4px;
background: #616161;
color: #fff;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
text-align: center;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-style: normal;
font-weight: 400;
font-size: 13px;
/* Phone */
opacity: 0;
transform: scale(0.5);
}
@media only screen and (max-width: 767px) {
[data-tooltip]::after {
padding: 8px 16px;
font-size: 16px;
}
}
menu [data-tooltip]::after {
left: 100%;
top: 0%;
}
menu .ML__base {
cursor: default;
}
/** Don't display if we're tracking, i.e. have the pointer down */
.tracking [data-tooltip]:hover::after {
/* Use visibility, not display. Display will remove the after from the DOM, and the override below will not work */
visibility: hidden;
}
/** But do display if tracking and inside a menu */
.tracking menu li[data-tooltip]:hover::after,
[data-tooltip]:hover::after {
visibility: visible;
opacity: 1;
transform: scale(1);
transition-property: opacity, scale;
transition-duration: 0.15s;
transition-delay: 1s;
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}
.ML__prompt {
border-radius: 2px;
}
.ML__editablePromptBox {
outline: 1px solid #acacac;
border-radius: 2px;
z-index: -1;
}
.ML__focusedPromptBox {
outline: highlight auto 1px;
}
.ML__lockedPromptBox {
background-color: rgba(142, 142, 141, 0.4);
z-index: -1;
}
.ML__correctPromptBox {
outline: 1px solid var(--_correct-color);
box-shadow: 0 0 5px var(--_correct-color);
}
.ML__incorrectPromptBox {
outline: 1px solid var(--_incorrect-color);
box-shadow: 0 0 5px var(--_incorrect-color);
}
.variant-submenu {
display: flex;
flex-direction: column;
padding: 8px;
}
.variant-submenu [part=menu-item] {
font-size: 2rem;
text-align: center;
margin: 0;
}
.insert-matrix-submenu {
display: grid;
padding: 8px;
align-content: center;
justify-content: center;
grid-template-columns: repeat(5, minmax(0, 1fr));
}
.insert-matrix-submenu [part=menu-item] {
font-size: 21px;
border: none;
border-radius: 0;
line-height: 21px;
text-align: center;
padding: 0;
margin: 0;
}
.border-submenu [part=menu-item] {
font-size: 2rem;
line-height: 1.2;
text-align: center;
}
.swatches-submenu {
--_swatch-size: 2rem;
--_columns: 4;
display: flex;
flex-flow: wrap;
padding: 8px;
max-width: calc(var(--_columns) * (var(--_swatch-size) + 18px) + 16px);
box-sizing: border-box;
}
.menu-swatch {
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: fit-content;
height: fit-content;
margin: 2px;
padding: 0;
background: var(--neutral-200);
}
.menu-swatch > .label {
padding: 0;
margin: 0;
line-height: 0;
}
.menu-swatch > .label > span {
display: inline-block;
margin: 6px;
min-width: var(--_swatch-size);
min-height: var(--_swatch-size);
border-radius: 50%;
}
.menu-swatch.active {
background: var(--neutral-100);
scale: 1.4;
}
.menu-swatch.active > .label > span {
border-radius: 2px;
}
.menu-swatch .ui-checkmark,
.menu-swatch .ui-mixedmark {
position: absolute;
margin: 0;
padding: 0;
color: white;
}
.menu-swatch.dark-contrast .ui-checkmark,
.menu-swatch.dark-contrast .ui-mixedmark {
color: #000;
}
`,Xa=`.ML__container {
min-height: auto !important;
--_hue: var(--hue, 212);
--_placeholder-color: var(--placeholder-color, hsl(var(--_hue), 40%, 49%));
--_placeholder-opacity: var(--placeholder-opacity, 0.4);
--_text-font-family: var(--text-font-family, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif);
}
.ML__sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
clip-path: inset(50%);
white-space: nowrap;
border: 0;
}
.ML__is-inline {
display: inline-block;
}
.ML__base {
visibility: inherit;
display: inline-block;
position: relative;
cursor: text;
padding: 0;
margin: 0;
box-sizing: content-box;
border: 0;
outline: 0;
vertical-align: baseline;
font-weight: inherit;
font-family: inherit;
font-style: inherit;
text-decoration: none;
width: min-content;
}
.ML__strut,
.ML__strut--bottom {
display: inline-block;
min-height: 0.5em;
}
.ML__small-delim {
font-family: KaTeX_Main;
}
/* Text mode */
.ML__text {
font-family: var(--_text-font-family);
white-space: pre;
}
/* Use cmr for 'math upright' */
.ML__cmr {
font-family: KaTeX_Main;
font-style: normal;
}
.ML__mathit {
font-family: KaTeX_Math;
/* The KaTeX_Math font is italic by default, so the font-style below is only
useful when a fallback font is used
*/
font-style: italic;
}
.ML__mathbf {
font-family: KaTeX_Main;
font-weight: bold;
}
/* Lowercase greek symbols should stick to math font when \\mathbf is applied
to match TeX idiosyncratic behavior */
.lcGreek.ML__mathbf {
font-family: KaTeX_Math;
font-weight: normal;
}
.ML__mathbfit {
font-family: KaTeX_Math;
font-weight: bold;
font-style: italic;
}
.ML__ams {
font-family: KaTeX_AMS;
}
/* Blackboard */
.ML__bb {
font-family: KaTeX_AMS;
}
.ML__cal {
font-family: KaTeX_Caligraphic;
}
.ML__frak {
font-family: KaTeX_Fraktur;
}
.ML__tt {
font-family: KaTeX_Typewriter;
}
.ML__script {
font-family: KaTeX_Script;
}
.ML__sans {
font-family: KaTeX_SansSerif;
}
.ML__series_ul {
font-weight: 100;
}
.ML__series_el {
font-weight: 100;
}
.ML__series_l {
font-weight: 200;
}
.ML__series_sl {
font-weight: 300;
}
.ML__series_sb {
font-weight: 500;
}
.ML__bold,
.ML__boldsymbol {
font-weight: 700;
}
.ML__series_eb {
font-weight: 800;
}
.ML__series_ub {
font-weight: 900;
}
.ML__series_uc {
font-stretch: ultra-condensed;
}
.ML__series_ec {
font-stretch: extra-condensed;
}
.ML__series_c {
font-stretch: condensed;
}
.ML__series_sc {
font-stretch: semi-condensed;
}
.ML__series_sx {
font-stretch: semi-expanded;
}
.ML__series_x {
font-stretch: expanded;
}
.ML__series_ex {
font-stretch: extra-expanded;
}
.ML__series_ux {
font-stretch: ultra-expanded;
}
.ML__it {
font-style: italic;
}
.ML__shape_ol {
-webkit-text-stroke: 1px black;
text-stroke: 1px black;
color: transparent;
}
.ML__shape_sc {
font-variant: small-caps;
}
.ML__shape_sl {
font-style: oblique;
}
/* First level emphasis */
.ML__emph {
color: #bc2612;
}
/* Second level emphasis */
.ML__emph .ML__emph {
color: #0c7f99;
}
.ML__highlight {
color: #007cb2;
background: #edd1b0;
}
.ML__center {
text-align: center;
}
.ML__label_padding {
padding: 0 0.5em;
}
.ML__frac-line {
width: 100%;
min-height: 1px;
}
.ML__frac-line:after {
content: '';
display: block;
margin-top: max(-1px, -0.04em);
min-height: max(1px, 0.04em);
/* Ensure the line is visible when printing even if "turn off background images" is on*/
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
/* There's a bug since Chrome 62 where
sub-pixel border lines don't draw at some zoom
levels (110%, 90%).
Setting the min-height used to work around it, but that workaround
broke in Chrome 84 or so.
Setting the background (and the min-height) seems to work for now.
*/
background: currentColor;
box-sizing: content-box;
/* Vuetify sets the box-sizing to inherit
causes the fraction line to not draw at all sizes (see #26) */
/* On some versions of Firefox on Windows, the line fails to
draw at some zoom levels, but setting the transform triggers
the hardware accelerated path, which works */
transform: translate(0, 0);
}
.ML__sqrt {
display: inline-block;
}
.ML__sqrt-sign {
display: inline-block;
position: relative;
}
.ML__sqrt-line {
display: inline-block;
height: max(1px, 0.04em);
width: 100%;
}
.ML__sqrt-line:before {
content: '';
display: block;
margin-top: min(-1px, -0.04em);
min-height: max(1px, 0.04em);
/* Ensure the line is visible when printing even if "turn off background images" is on*/
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
background: currentColor;
/* On some versions of Firefox on Windows, the line fails to
draw at some zoom levels, but setting the transform triggers
the hardware accelerated path, which works */
transform: translate(0, 0);
}
.ML__sqrt-line:after {
border-bottom-width: 1px;
content: ' ';
display: block;
margin-top: -0.1em;
}
.ML__sqrt-index {
margin-left: 0.27777778em;
margin-right: -0.55555556em;
}
.ML__delim-size1 {
font-family: KaTeX_Size1;
}
.ML__delim-size2 {
font-family: KaTeX_Size2;
}
.ML__delim-size3 {
font-family: KaTeX_Size3;
}
.ML__delim-size4 {
font-family: KaTeX_Size4;
}
.ML__delim-mult .delim-size1 > span {
font-family: KaTeX_Size1;
}
.ML__delim-mult .delim-size4 > span {
font-family: KaTeX_Size4;
}
.ML__accent-body > span {
font-family: KaTeX_Main;
width: 0;
}
.ML__accent-vec {
position: relative;
left: 0.24em;
}
/** The markup for a LaTeX formula, either in an editable mathfield or
in a static display.
*/
.ML__latex {
display: inline-block;
direction: ltr;
text-align: left;
text-indent: 0;
text-rendering: auto;
font-family: KaTeX_Main, 'Times New Roman', serif;
font-style: normal;
font-size-adjust: none;
font-stretch: normal;
font-variant-caps: normal;
letter-spacing: normal;
line-height: 1.2;
word-wrap: normal;
word-spacing: normal;
white-space: nowrap;
text-shadow: none;
-webkit-user-select: none;
user-select: none;
width: min-content;
}
.ML__latex .style-wrap {
position: relative;
}
.ML__latex .mfrac {
display: inline-block;
}
.ML__latex .left-right {
display: inline-block;
}
.ML__latex .vlist-t {
display: inline-table;
table-layout: fixed;
border-collapse: collapse;
}
.ML__latex .vlist-r {
display: table-row;
}
.ML__latex .vlist {
display: table-cell;
vertical-align: bottom;
position: relative;
}
.ML__latex .vlist > span {
display: block;
height: 0;
position: relative;
}
.ML__latex .vlist > span > span {
display: inline-block;
}
.ML__latex .vlist > span > .pstrut {
overflow: hidden;
width: 0;
}
.ML__latex .vlist-t2 {
margin-right: -2px;
}
.ML__latex .vlist-s {
display: table-cell;
vertical-align: bottom;
font-size: 1px;
width: 2px;
min-width: 2px;
}
.ML__latex .msubsup {
text-align: left;
}
.ML__latex .negativethinspace {
display: inline-block;
margin-left: -0.16667em;
height: 0.71em;
}
.ML__latex .thinspace {
display: inline-block;
width: 0.16667em;
height: 0.71em;
}
.ML__latex .mediumspace {
display: inline-block;
width: 0.22222em;
height: 0.71em;
}
.ML__latex .thickspace {
display: inline-block;
width: 0.27778em;
height: 0.71em;
}
.ML__latex .enspace {
display: inline-block;
width: 0.5em;
height: 0.71em;
}
.ML__latex .quad {
display: inline-block;
width: 1em;
height: 0.71em;
}
.ML__latex .qquad {
display: inline-block;
width: 2em;
height: 0.71em;
}
.ML__latex .llap,
.ML__latex .rlap {
width: 0;
position: relative;
display: inline-block;
}
.ML__latex .llap > .inner,
.ML__latex .rlap > .inner {
position: absolute;
}
.ML__latex .llap > .fix,
.ML__latex .rlap > .fix {
display: inline-block;
}
.ML__latex .llap > .inner {
right: 0;
}
.ML__latex .rlap > .inner {
left: 0;
}
.ML__latex .rule {
display: inline-block;
border: solid 0;
position: relative;
box-sizing: border-box;
}
.ML__latex .overline .overline-line,
.ML__latex .underline .underline-line {
width: 100%;
}
.ML__latex .overline .overline-line:before,
.ML__latex .underline .underline-line:before {
content: '';
border-bottom-style: solid;
border-bottom-width: max(1px, 0.04em);
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
display: block;
}
.ML__latex .overline .overline-line:after,
.ML__latex .underline .underline-line:after {
border-bottom-style: solid;
border-bottom-width: max(1px, 0.04em);
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
content: '';
display: block;
margin-top: -1px;
}
.ML__latex .stretchy {
display: block;
position: absolute;
width: 100%;
left: 0;
overflow: hidden;
}
.ML__latex .stretchy:before,
.ML__latex .stretchy:after {
content: '';
}
.ML__latex .stretchy svg {
display: block;
position: absolute;
width: 100%;
height: inherit;
fill: currentColor;
stroke: currentColor;
fill-rule: nonzero;
fill-opacity: 1;
stroke-width: 1;
stroke-linecap: butt;
stroke-linejoin: miter;
stroke-miterlimit: 4;
stroke-dasharray: none;
stroke-dashoffset: 0;
stroke-opacity: 1;
}
.ML__latex .slice-1-of-2 {
display: inline-flex;
position: absolute;
left: 0;
width: 50.2%;
overflow: hidden;
}
.ML__latex .slice-2-of-2 {
display: inline-flex;
position: absolute;
right: 0;
width: 50.2%;
overflow: hidden;
}
.ML__latex .slice-1-of-3 {
display: inline-flex;
position: absolute;
left: 0;
width: 25.1%;
overflow: hidden;
}
.ML__latex .slice-2-of-3 {
display: inline-flex;
position: absolute;
left: 25%;
width: 50%;
overflow: hidden;
}
.ML__latex .slice-3-of-3 {
display: inline-flex;
position: absolute;
right: 0;
width: 25.1%;
overflow: hidden;
}
.ML__latex .slice-1-of-1 {
display: inline-flex;
position: absolute;
width: 100%;
left: 0;
overflow: hidden;
}
.ML__latex .nulldelimiter {
display: inline-block;
}
.ML__latex .op-group {
display: inline-block;
}
.ML__latex .op-symbol {
position: relative;
}
.ML__latex .op-symbol.small-op {
font-family: KaTeX_Size1;
}
.ML__latex .op-symbol.large-op {
font-family: KaTeX_Size2;
}
.ML__latex .mtable .vertical-separator {
display: inline-block;
min-width: 1px;
box-sizing: border-box;
}
.ML__latex .mtable .arraycolsep {
display: inline-block;
}
.ML__latex .mtable .col-align-m > .vlist-t {
text-align: center;
}
.ML__latex .mtable .col-align-c > .vlist-t {
text-align: center;
}
.ML__latex .mtable .col-align-l > .vlist-t {
text-align: left;
}
.ML__latex .mtable .col-align-r > .vlist-t {
text-align: right;
}
.ML__error {
display: inline-block;
background-image: radial-gradient(ellipse at center, hsl(341, 100%, 40%), rgba(0, 0, 0, 0) 70%);
background-color: hsla(341, 100%, 40%, 0.1);
background-repeat: repeat-x;
background-size: 3px 3px;
padding-bottom: 3px;
background-position: 0 100%;
}
.ML__error > .ML__error {
background: transparent;
padding: 0;
}
.ML__placeholder {
color: var(--_placeholder-color);
opacity: var(--_placeholder-opacity);
padding-left: 0.4ex;
padding-right: 0.4ex;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}
.ML__notation {
position: absolute;
box-sizing: border-box;
line-height: 0;
}
/* This class is used to implement the \`\\mathtip\` and \`\\texttip\` commands
For UI elements, see \`[data-ML__tooltip]\`
*/
.ML__tooltip-container {
position: relative;
transform: scale(0);
}
.ML__tooltip-container .ML__tooltip-content {
position: fixed;
display: inline-table;
visibility: hidden;
z-index: 2;
width: max-content;
max-width: 400px;
padding: 12px 12px;
border-radius: 8px;
background: #616161;
--_selection-color: #fff;
color: #fff;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
opacity: 0;
transition: opacity 0.15s cubic-bezier(0.4, 0, 1, 1);
}
.ML__tooltip-container .ML__tooltip-content .ML__text {
white-space: normal;
}
.ML__tooltip-container .ML__tooltip-content .ML__base {
display: contents;
}
.ML__tooltip-container:hover .ML__tooltip-content {
visibility: visible;
opacity: 1;
font-size: 0.75em;
transform: scale(1) translate(0, 3em);
}
`,yf=`#mathlive-environment-popover.is-visible {
visibility: visible;
}
#mathlive-environment-popover {
--_environment-panel-height: var(--environment-panel-height, 70px);
--_accent-color: var(--accent-color, #aaa);
--_background: var(--environment-panel-background, #fff);
--_button-background: var(--environment-panel-button-background, white);
--_button-background-hover: var(--environment-panel-button-background-hover, #f5f5f7);
--_button-background-active: var(--environment-panel-button-background-active, #f5f5f7);
--_button-text: var(--environment-panel-button-text, #e3e4e8);
position: absolute;
width: calc(var(--_environment-panel-height) * 2);
height: var(--_environment-panel-height);
border-radius: 4px;
border: 1.5px solid var(--_accent-color);
background-color: var(--_background);
box-shadow: 0 0 30px 0 var(--environment-shadow, rgba(0, 0, 0, 0.4));
pointer-events: all;
visibility: hidden;
}
#mathlive-environment-popover .MLEP__array-buttons {
height: calc(var(--_environment-panel-height) * 5/4);
width: calc(var(--_environment-panel-height) * 5/4);
margin-left: calc(0px - var(--_environment-panel-height) * 0.16);
margin-top: calc(0px - var(--_environment-panel-height) * 0.19);
}
#mathlive-environment-popover .MLEP__array-buttons .font {
fill: white;
}
#mathlive-environment-popover .MLEP__array-buttons circle {
fill: #7f7f7f;
transition: fill 300ms;
}
#mathlive-environment-popover .MLEP__array-buttons .MLEP__array-insert-background {
fill-opacity: 1;
fill: var(--_background);
stroke: var(--_accent-color);
stroke-width: 3px;
}
#mathlive-environment-popover .MLEP__array-buttons line {
stroke: var(--_accent-color);
stroke-opacity: 0;
stroke-width: 40;
pointer-events: none;
transition: stroke-opacity 300ms;
stroke-linecap: round;
}
#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover circle {
fill: var(--_accent-color);
}
#mathlive-environment-popover .MLEP__array-buttons g[data-command]:hover line {
stroke-opacity: 1;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls {
height: 100%;
width: 50%;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options {
width: var(--_environment-panel-height);
height: var(--_environment-panel-height);
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: space-around;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg {
pointer-events: all;
margin-top: 2px;
width: calc(var(--_environment-panel-height) / 3 * 28 / 24);
height: calc(var(--_environment-panel-height) / 3 - 2px);
border-radius: calc(var(--_environment-panel-height) / 25);
background-color: var(--_button-background);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg:hover {
background-color: var(--_button-background-hover);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path,
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg line {
stroke: var(--_button-text);
stroke-width: 2;
stroke-linecap: round;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg rect,
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg path {
fill-opacity: 0;
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active {
pointer-events: none;
background-color: var(--_button-background-active);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active path,
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active line {
stroke: var(--_accent-color);
}
#mathlive-environment-popover .MLEP__environment-delimiter-controls .MLEP__array-delimiter-options svg.active circle {
fill: var(--_accent-color);
}
`,uh=`/* The element that display info while in latex mode */
#mathlive-suggestion-popover {
background-color: rgba(97, 97, 97);
color: #fff;
text-align: center;
border-radius: 8px;
position: fixed;
z-index: 1;
display: none;
flex-direction: column;
justify-content: center;
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
}
#mathlive-suggestion-popover.top-tip::after {
content: '';
position: absolute;
top: -15px;
left: calc(50% - 15px);
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-bottom: 15px solid rgba(97, 97, 97);
font-size: 1rem;
}
#mathlive-suggestion-popover.bottom-tip::after {
content: '';
position: absolute;
bottom: -15px;
left: calc(50% - 15px);
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-top: 15px solid rgba(97, 97, 97);
font-size: 1rem;
}
#mathlive-suggestion-popover.is-animated {
transition: all 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
animation: ML__fade-in cubic-bezier(0, 0, 0.2, 1) 0.15s;
}
#mathlive-suggestion-popover.is-visible {
display: flex;
}
@keyframes ML__fade-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* The wrapper class for the entire content of the popover panel */
#mathlive-suggestion-popover ul {
display: flex;
flex-flow: column;
list-style: none;
margin: 0;
padding: 0;
align-items: flex-start;
max-height: 400px;
overflow-y: auto;
}
#mathlive-suggestion-popover li {
display: flex;
flex-direction: row;
justify-content: space-between;
margin: 8px;
padding: 8px;
width: calc(100% - 16px - 16px);
column-gap: 1em;
border-radius: 8px;
cursor: pointer;
/* Since the content can be clicked on, provide feedback on hover */
}
#mathlive-suggestion-popover li a {
color: #5ea6fd;
padding-top: 0.3em;
margin-top: 0.4em;
display: block;
}
#mathlive-suggestion-popover li a:hover {
color: #5ea6fd;
text-decoration: underline;
}
#mathlive-suggestion-popover li:hover,
#mathlive-suggestion-popover li.is-pressed,
#mathlive-suggestion-popover li.is-active {
background: rgba(255, 255, 255, 0.1);
}
/* The command inside a popover (inside a #mathlive-suggestion-popover) */
.ML__popover__command {
font-size: 1.6rem;
font-family: KaTeX_Main;
}
.ML__popover__current {
background: #5ea6fd;
color: #fff;
}
.ML__popover__latex {
font-family: 'IBM Plex Mono', 'Source Code Pro', Consolas, 'Roboto Mono', Menlo, 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
align-self: center;
}
/* The keyboard shortcuts for a symbol as displayed in the popover */
.ML__popover__keybinding {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 0.8em;
opacity: 0.7;
}
/* Style for the character that joins the modifiers of a keyboard shortcut
(usually a "+" sign)*/
.ML__shortcut-join {
opacity: 0.5;
}
`,uu=`/* The element that displays the keys as the user type them */
#mathlive-keystroke-caption-panel {
visibility: hidden;
/*min-width: 160px;*/
/*background-color: rgba(97, 97, 200, .95);*/
background: var(--secondary, hsl(var(--_hue), 19%, 26%));
border-color: var(--secondary-border, hsl(0, 0%, 91%));
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
text-align: center;
border-radius: 6px;
padding: 16px;
position: absolute;
z-index: 1;
display: flex;
flex-direction: row-reverse;
justify-content: center;
--keystroke: white;
--on-keystroke: #555;
--keystroke-border: #f7f7f7;
}
@media (prefers-color-scheme: dark) {
body:not([theme='light']) #mathlive-keystroke-caption-panel {
--keystroke: hsl(var(--_hue), 50%, 30%);
--on-keystroke: hsl(0, 0%, 98%);
--keystroke-border: hsl(var(--_hue), 50%, 25%);
}
}
body[theme='dark'] #mathlive-keystroke-caption-panel {
--keystroke: hsl(var(--_hue), 50%, 30%);
--on-keystroke: hsl(0, 0%, 98%);
--keystroke-border: hsl(var(--_hue), 50%, 25%);
}
#mathlive-keystroke-caption-panel > span {
min-width: 14px;
/*height: 8px;*/
margin: 0 8px 0 0;
padding: 4px;
background-color: var(--keystroke);
color: var(--on-keystroke);
fill: currentColor;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 1em;
border-radius: 6px;
border: 2px solid var(--keystroke-border);
/*box-shadow: 0 7px 14px rgba(0,0,0,0.25), 0 5px 5px rgba(0,0,0,0.22);*/
}
`,ch=`.ML__keyboard {
--_keyboard-height: 0;
--_keyboard-zindex: var(--keyboard-zindex, 105);
--_accent-color: var(--keyboard-accent-color, #0c75d8);
--_background: var(--keyboard-background, #cacfd7);
--_border: var(--keyboard-border, #ddd);
--_padding-horizontal: var(--keyboard-padding-horizontal, 0px);
--_padding-top: var(--keyboard-padding-top, 5px);
--_padding-bottom: var(--keyboard-padding-bottom, 0px);
--_row-padding-left: var(--keyboard-row-padding-left, 0px);
--_row-padding-right: var(--keyboard-row-padding-right, 0px);
--_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f);
--_toolbar-text-active: var(--keyboard-toolbar-text-active, var(--_accent-color));
--_toolbar-background: var(--keyboard-toolbar-background, transparent);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee);
--_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent);
--_toolbar-font-size: var(--keyboard-toolbar-font-size, '135%');
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff);
--_keycap-background: var(--keycap-background, white);
--_keycap-background-hover: var(--keycap-background-hover, #f5f5f7);
--_keycap-background-active: var(--keycap-background-active, var(--_accent-color));
--_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color));
--_keycap-border: var(--keycap-border, #e5e6e9);
--_keycap-border-bottom: var(--keycap-border-bottom, #8d8f92);
--_keycap-text: var(--keycap-text, #000);
--_keycap-text-active: var(--keycap-text-active, #fff);
--_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text));
--_keycap-text-pressed: var(--keycap-text-pressed, #fff);
--_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color));
--_keycap-primary-background: var(--keycap-primary-background, var(--_accent-color));
--_keycap-primary-text: var(--keycap-primary-text, #ddd);
--_keycap-primary-background-hover: var(--keycap-primary-background-hover, #0d80f2);
--_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795);
--_keycap-secondary-text: var(--keycap-secondary-text, #060707);
--_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6);
--_keycap-height: var(--keycap-height, 60px);
/* Keycap width (incl. margin) */
--_keycap-max-width: var(--keycap-max-width, 100px);
--_keycap-gap: var(--keycap-gap, 8px);
--_keycap-font-size: var(--keycap-font-size, clamp(16px, 4cqw, 24px));
--_keycap-small-font-size: var(--keycap-small-font-size, calc(var(--keycap-font-size) * 0.8));
--_keycap-extra-small-font-size: var(--keycap-extra-small-font-size, calc(var(--keycap-font-size) / 1.42));
--_variant-panel-background: var(--variant-panel-background, #fff);
--_variant-keycap-text: var(--variant-keycap-text, var(--_keycap-text));
--_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active));
--_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color));
--_variant-keycap-length: var(--variant-keycap-length, 70px);
--_variant-keycap-font-size: var(--variant-keycap-font-size, 30px);
--_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 12px);
--_keycap-shift-font-size: var(--keycap-shift-font-size, 16px);
--_keycap-shift-color: var(--keycap-shift-color, var(--_accent-color));
--_box-placeholder-color: var(--box-placeholder-color, var(--_accent-color));
--_box-placeholder-pressed-color: var(--box-placeholder-pressed-color, var(--keycap-text-pressed));
}
.is-math-mode .MLK__rows .if-text-mode,
.is-text-mode .MLK__rows .if-math-mode {
display: none;
}
.if-can-undo,
.if-can-redo,
.if-can-copy,
.if-can-cut,
.if-can-paste {
opacity: 0.4;
pointer-events: none;
}
.can-undo .if-can-undo,
.can-redo .if-can-redo,
.can-copy .if-can-copy,
.can-cut .if-can-cut,
.can-paste .if-can-paste {
opacity: 1;
pointer-events: all;
}
body > .ML__keyboard {
position: fixed;
--_padding-bottom: calc(var(--keyboard-padding-bottom, 0px) + env(safe-area-inset-bottom, 0));
}
body > .ML__keyboard.is-visible > .MLK__backdrop {
box-shadow: 0 -5px 6px rgba(0, 0, 0, 0.08);
border-top: 1px solid var(--_border);
}
body > .ML__keyboard.backdrop-is-transparent.is-visible > .MLK__backdrop {
box-shadow: none;
border: none;
}
body > .ML__keyboard.is-visible.animate > .MLK__backdrop {
transition: 0.28s cubic-bezier(0, 0, 0.2, 1);
transition-property: transform, opacity;
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}
.ML__keyboard {
position: relative;
overflow: hidden;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: var(--_keyboard-zindex);
box-sizing: border-box;
outline: none;
border: none;
margin: 0;
padding: 0;
line-height: 1;
overflow-wrap: unset;
text-align: left;
vertical-align: baseline;
cursor: auto;
white-space: pre;
box-shadow: none;
opacity: 1;
transform: none;
pointer-events: none;
}
.ML__keyboard :where(div) {
box-sizing: border-box;
outline: none;
border: none;
margin: 0;
padding: 0;
line-height: 1;
overflow-wrap: unset;
text-align: left;
vertical-align: baseline;
cursor: auto;
white-space: pre;
box-shadow: none;
transform: none;
}
.MLK__backdrop {
position: absolute;
bottom: calc(-1 * var(--_keyboard-height));
width: 100%;
height: var(--_keyboard-height);
box-sizing: border-box;
padding-top: var(--_padding-top);
padding-bottom: var(--_padding-bottom);
padding-left: var(--_padding-horizontal);
padding-right: var(--_padding-horizontal);
opacity: 0;
visibility: hidden;
transform: translate(0, 0);
background: var(--_background);
}
.backdrop-is-transparent .MLK__backdrop {
background: transparent;
}
/* If a custom layout has a custom container/backdrop
(backdrop-is-transparent), make sure to let pointer event go through. */
.backdrop-is-transparent .MLK__plate {
background: transparent;
pointer-events: none;
}
/* If a custom layout has a custom container/backdrop, make sure to
allow pointer events on it. */
.backdrop-is-transparent .MLK__layer > div > div {
pointer-events: all;
}
.ML__keyboard.is-visible > .MLK__backdrop {
transform: translate(0, calc(-1 * var(--_keyboard-height)));
opacity: 1;
visibility: visible;
}
.caps-lock-indicator {
display: none;
width: 8px;
height: 8px;
background: #0cbc0c;
box-shadow: inset 0 0 4px 0 #13ca13, 0 0 4px 0 #a9ef48;
border-radius: 8px;
right: 8px;
top: 8px;
position: absolute;
}
.ML__keyboard.is-caps-lock .caps-lock-indicator {
display: block;
}
.ML__keyboard.is-caps-lock .shift {
background: var(--_keycap-background-active);
color: var(--_keycap-text-active);
}
.MLK__plate {
position: absolute;
top: var(--_padding-top);
left: var(--_padding-horizontal);
width: calc(100% - 2 * var(--_padding-horizontal));
margin: 0;
padding: 0;
box-sizing: border-box;
container-type: inline-size;
touch-action: none;
-webkit-user-select: none;
user-select: none;
pointer-events: all;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 16px;
/* Size of toolbar labels */
font-weight: 400;
text-shadow: none;
}
.ML__box-placeholder {
color: var(--_box-placeholder-color);
}
.MLK__tex {
font-family: KaTeX_Main, KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__tex-math {
font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
font-style: italic;
}
.MLK__layer {
display: none;
outline: none;
}
.MLK__layer.is-visible {
display: flex;
flex-flow: column;
}
/* Keyboard layouts are made or rows of keys... */
.MLK__rows {
--_keycap-width: min(var(--_keycap-max-width), 10cqw);
display: flex;
flex-flow: column;
align-items: center;
border-collapse: separate;
clear: both;
border: 0;
margin: 0;
margin-bottom: var(--_keycap-gap);
gap: var(--_keycap-gap);
/* If the styling include, e.g., some shadows, they will be
cut off by the overflow. In that case, set the padding to
compensate. */
padding-left: var(--_row-padding-left);
padding-right: var(--_row-padding-right);
overflow: visible;
touch-action: none;
}
.MLK__rows > .MLK__row {
display: flex;
flex-flow: row;
justify-content: center;
width: 100%;
gap: var(--_keycap-gap);
margin: 0;
padding: 0;
/* For the alignment of the text on some modifiers (e.g. shift) */
/* Extra spacing between two adjacent keys */
}
.MLK__rows > .MLK__row .tex {
font-family: KaTeX_Math, KaTeX_Main, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__rows > .MLK__row .tex-math {
font-family: KaTeX_Math, 'Cambria Math', 'Asana Math', OpenSymbol, Symbola, STIX, Times, serif !important;
}
.MLK__rows > .MLK__row .big-op {
font-size: calc(1.25 * var(--_keycap-font-size));
}
.MLK__rows > .MLK__row .small {
font-size: var(--_keycap-small-font-size);
}
.MLK__rows > .MLK__row .bottom {
justify-content: flex-end;
}
.MLK__rows > .MLK__row .left {
align-items: flex-start;
padding-left: 12px;
}
.MLK__rows > .MLK__row .right {
align-items: flex-end;
padding-right: 12px;
}
.MLK__rows > .MLK__row .w0 {
width: 0;
}
.MLK__rows > .MLK__row .w5 {
width: calc(0.5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w15 {
width: calc(1.5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w20 {
width: calc(2 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w40 {
width: calc(4 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .w50 {
width: calc(5 * var(--_keycap-width) - var(--_keycap-gap));
}
.MLK__rows > .MLK__row .MLK__keycap.w50 {
font-size: 80%;
padding-top: 10px;
font-weight: 100;
}
.MLK__rows > .MLK__row .separator {
background: transparent;
border: none;
pointer-events: none;
}
.MLK__rows > .MLK__row .horizontal-rule {
height: 6px;
margin-top: 3px;
margin-bottom: 0;
width: 100%;
border-radius: 0;
border-top: var(--_horizontal-rule);
}
.MLK__rows > .MLK__row .ghost {
background: var(--_toolbar-background);
border: none;
color: var(--_toolbar-text);
}
.MLK__rows > .MLK__row .ghost:hover {
background: var(--_toolbar-background-hover);
}
.MLK__rows > .MLK__row .bigfnbutton {
font-size: var(--_keycap-extra-small-font-size);
}
.MLK__rows > .MLK__row .shift,
.MLK__rows > .MLK__row .action {
color: var(--_keycap-secondary-text);
background: var(--_keycap-secondary-background);
border-color: var(--_keycap-secondary-border);
border-bottom-color: var(--_keycap-secondary-border-bottom);
line-height: 0.8;
font-size: min(1rem, var(--_keycap-small-font-size));
font-weight: 600;
padding: 8px 12px 8px 12px;
}
.MLK__rows > .MLK__row .shift:hover,
.MLK__rows > .MLK__row .action:hover {
background: var(--_keycap-secondary-background-hover);
}
.MLK__rows > .MLK__row .action.primary {
background: var(--_keycap-primary-background);
color: var(--_keycap-primary-text);
}
.MLK__rows > .MLK__row .action.primary:hover {
background: var(--_keycap-primary-background-hover);
color: var(--_keycap-primary-text);
}
.MLK__rows > .MLK__row .shift.selected,
.MLK__rows > .MLK__row .action.selected {
color: var(--_toolbar-text-active);
}
.MLK__rows > .MLK__row .shift.selected.is-pressed,
.MLK__rows > .MLK__row .action.selected.is-pressed,
.MLK__rows > .MLK__row .shift.selected.is-active,
.MLK__rows > .MLK__row .action.selected.is-active {
color: white;
}
.MLK__rows > .MLK__row .warning {
background: #cd0030;
color: white;
}
.MLK__rows > .MLK__row .warning svg.svg-glyph {
width: 24px;
height: 24px;
min-height: 24px;
}
/** A regular keycap
* Use the :where() pseudo-class to give it a very low specifity,
* so that it can be overriden by custom style.
*/
:where(.MLK__rows > .MLK__row div) {
display: flex;
flex-flow: column;
align-items: center;
justify-content: space-evenly;
width: calc(var(--_keycap-width) - var(--_keycap-gap));
height: var(--_keycap-height);
box-sizing: border-box;
padding: 0;
vertical-align: top;
text-align: center;
float: left;
color: var(--_keycap-text);
fill: currentColor;
font-size: var(--_keycap-font-size);
background: var(--_keycap-background);
border: 1px solid var(--_keycap-border);
border-bottom-color: var(--_keycap-border-bottom);
border-radius: 6px;
cursor: pointer;
touch-action: none;
/* Keys with a variants panel */
position: relative;
overflow: hidden;
-webkit-user-select: none;
user-select: none;
-webkit-tap-highlight-color: transparent;
}
:where(.MLK__rows > .MLK__row div):hover {
overflow: visible;
background: var(--_keycap-background-hover);
}
:where(.MLK__rows > .MLK__row div) .ML__latex {
pointer-events: none;
touch-action: none;
}
:where(.MLK__rows > .MLK__row div) svg.svg-glyph {
margin: 8px 0;
width: 20px;
height: 20px;
min-height: 20px;
}
:where(.MLK__rows > .MLK__row div) svg.svg-glyph-lg {
margin: 8px 0;
width: 24px;
height: 24px;
min-height: 24px;
}
:where(.MLK__rows > .MLK__row div).MLK__tex-math {
font-size: 25px;
}
:where(.MLK__rows > .MLK__row div).is-pressed {
background: var(--_keycap-background-pressed);
color: var(--_keycap-text-pressed);
--_box-placeholder-color: var(--_box-placeholder-pressed-color);
}
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active,
:where(.MLK__rows > .MLK__row div).action.is-active,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed,
:where(.MLK__rows > .MLK__row div).action.is-pressed {
z-index: calc(var(--_keyboard-zindex) - 5);
}
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active aside,
:where(.MLK__rows > .MLK__row div).action.is-active aside,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed aside,
:where(.MLK__rows > .MLK__row div).action.is-pressed aside {
display: none;
}
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active .MLK__shift,
:where(.MLK__rows > .MLK__row div).action.is-active .MLK__shift,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed .MLK__shift,
:where(.MLK__rows > .MLK__row div).action.is-pressed .MLK__shift {
display: none;
}
:where(.MLK__rows > .MLK__row div).shift.is-pressed,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-pressed,
:where(.MLK__rows > .MLK__row div).action.is-pressed {
background: var(--_keycap-background-pressed);
color: var(--_keycap-text-pressed);
}
:where(.MLK__rows > .MLK__row div).shift.is-active,
:where(.MLK__rows > .MLK__row div).MLK__keycap.is-active,
:where(.MLK__rows > .MLK__row div).action.is-active {
background: var(--_keycap-background-active);
color: var(--_keycap-text-active);
--_box-placeholder-color: var(--_box-placeholder-pressed-color);
}
:where(.MLK__rows > .MLK__row div) small {
color: var(--_keycap-secondary-text);
}
:where(.MLK__rows > .MLK__row div) aside {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 10px;
line-height: 10px;
color: var(--_keycap-secondary-text);
}
/* Add an attribute 'data-tooltip' to display a tooltip on hover.
Note there are a different set of tooltip rules for the keyboard toggle
(it's in a different CSS tree) */
.ML__keyboard [data-tooltip] {
position: relative;
}
.ML__keyboard [data-tooltip]::after {
position: absolute;
display: inline-table;
content: attr(data-tooltip);
top: inherit;
bottom: 100%;
width: max-content;
max-width: 200px;
padding: 8px 8px;
background: #616161;
color: #fff;
text-align: center;
z-index: 2;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
border-radius: 2px;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-weight: 400;
font-size: 12px;
transition: all 0.15s cubic-bezier(0.4, 0, 1, 1) 1s;
opacity: 0;
transform: scale(0.5);
}
.ML__keyboard [data-tooltip]:hover {
position: relative;
}
.ML__keyboard [data-tooltip]:hover::after {
opacity: 1;
transform: scale(1);
}
.MLK__toolbar {
align-self: center;
display: flex;
flex-flow: row;
justify-content: space-between;
width: 100%;
max-width: 996px;
min-height: 32px;
/* Icons for undo/redo, etc. */
}
.MLK__toolbar svg {
height: 20px;
width: 20px;
}
.MLK__toolbar > .left {
position: relative;
display: flex;
justify-content: flex-start;
flex-flow: row;
}
.MLK__toolbar > .right {
display: flex;
justify-content: flex-end;
flex-flow: row;
}
.MLK__toolbar > div > div {
/* "button" in the toolbar */
display: flex;
align-items: center;
justify-content: center;
color: var(--_toolbar-text);
fill: currentColor;
background: var(--_toolbar-background);
font-size: var(--_toolbar-font-size);
padding: 4px 15px;
cursor: pointer;
width: max-content;
min-width: 42px;
min-height: 34px;
border: none;
padding-left: 10px;
padding-right: 10px;
padding-bottom: 8px;
padding-top: 8px;
margin-top: 0;
margin-bottom: 4px;
margin-left: 4px;
margin-right: 4px;
border-radius: 8px;
box-shadow: none;
border-bottom: 2px solid transparent;
}
.MLK__toolbar > div > div:not(.disabled):not(.selected):hover {
background: var(--_toolbar-background-hover);
}
.MLK__toolbar > div > div.disabled svg,
.MLK__toolbar > div > div.disabled:hover svg,
.MLK__toolbar > div > div.disabled.is-pressed svg {
color: var(--_toolbar-text);
opacity: 0.2;
}
.MLK__toolbar > div > div:hover,
.MLK__toolbar > div > div:active,
.MLK__toolbar > div > div.is-pressed,
.MLK__toolbar > div > div.is-active {
color: var(--_toolbar-text-active);
}
.MLK__toolbar > div > div.selected {
color: var(--_toolbar-text-active);
background: var(--_toolbar-background-selected);
border-radius: 0;
border-bottom-color: var(--_toolbar-text-active);
padding-bottom: 4px;
margin-bottom: 8px;
}
/* This is the element that displays variants on press+hold */
.MLK__variant-panel {
visibility: hidden;
position: fixed;
display: flex;
flex-flow: row wrap-reverse;
justify-content: center;
align-content: center;
margin: 0;
padding: 0;
bottom: auto;
top: 0;
box-sizing: content-box;
transform: none;
z-index: calc(var(--_keyboard-zindex) + 1);
touch-action: none;
max-width: 350px;
background: var(--_variant-panel-background);
text-align: center;
border-radius: 6px;
padding: 6px;
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
transition: none;
}
.MLK__variant-panel.is-visible {
visibility: visible;
}
.MLK__variant-panel.compact {
--_variant-keycap-length: var(--variant-keycap-length, 50px);
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
--_variant-keycap-aside-font-size: var(--variant-keycap-aside-font-size, 10px);
}
.MLK__variant-panel .item {
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
font-size: var(--_variant-keycap-font-size);
height: var(--_variant-keycap-length);
width: var(--_variant-keycap-length);
margin: 0;
box-sizing: border-box;
border-radius: 5px;
border: 1px solid transparent;
background: transparent;
pointer-events: all;
cursor: pointer;
color: var(--_variant-keycap-text);
fill: currentColor;
}
@media (max-height: 412px) {
.MLK__variant-panel .item {
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
--_variant-keycap-length: var(--variant-keycap-length, 50px);
}
}
.MLK__variant-panel .item .ML__latex {
pointer-events: none;
}
.MLK__variant-panel .item.is-active {
background: var(--_variant-keycap-background-active);
color: var(--_variant-keycap-text-active);
}
.MLK__variant-panel .item.is-pressed {
background: var(--_variant-keycap-background-pressed);
color: var(--_variant-keycap-text-pressed);
}
.MLK__variant-panel .item.small {
font-size: var(--_keycap-small-font-size);
}
.MLK__variant-panel .item.swatch-button {
box-sizing: border-box;
background: #fbfbfb;
}
.MLK__variant-panel .item.swatch-button > span {
display: inline-block;
margin: 6px;
width: calc(100% - 12px);
height: calc(100% - 12px);
border-radius: 50%;
}
.MLK__variant-panel .item.swatch-button:hover {
background: #f0f0f0;
}
.MLK__variant-panel .item.swatch-button:hover > span {
border-radius: 2px;
}
.MLK__variant-panel .item.box > div,
.MLK__variant-panel .item.box > span {
border: 1px dashed rgba(0, 0, 0, 0.24);
}
.MLK__variant-panel .item .warning {
min-height: 60px;
min-width: 60px;
background: #cd0030;
color: white;
padding: 5px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 5px;
}
.MLK__variant-panel .item .warning.is-pressed,
.MLK__variant-panel .item .warning.is-active {
background: red;
}
.MLK__variant-panel .item .warning svg.svg-glyph {
width: 50px;
height: 50px;
}
.MLK__variant-panel .item aside {
font-size: var(--_variant-keycap-aside-font-size);
line-height: 12px;
opacity: 0.78;
padding-top: 2px;
}
.MLK__keycap {
position: relative;
}
.MLK__shift {
display: block;
position: absolute;
right: 4px;
top: 4px;
font-size: var(--_keycap-shift-font-size);
color: var(--_keycap-shift-color);
}
.hide-shift .MLK__shift {
display: none;
}
@media (max-width: 414px) {
.MLK__variant-panel {
max-width: 350px;
--_variant-keycap-font-size: var(--variant-keycap-font-size, 24px);
--_variant-keycap-length: var(--variant-keycap-length, 50px);
}
}
/* @xs breakpoint: iPhone 5 */
@container (max-width: 414px) {
.MLK__rows {
--_keycap-gap: max(var(--_keycap-gap, 2px), 2px);
--_keycap-height: max(var(--_keycap-height), 42px);
--_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px);
}
.MLK__toolbar > div > div {
font-size: 100%;
margin-left: 2px;
margin-right: 2px;
}
.MLK__rows .shift,
.MLK__rows .action {
font-size: 65%;
}
.MLK__rows .warning svg.svg-glyph {
width: 14px;
height: 14px;
min-height: 14px;
}
}
@container (max-width: 744px) {
.MLK__rows {
--_keycap-gap: max(var(--keycap-gap, 2px), 2px);
--_keycap-height: max(var(--keycap-height, 52px), 52px);
--_keycap-width: min(min(var(--_keycap-max-width), 10cqw), 62px);
}
.MLK__toolbar > div > div {
padding-left: 0;
padding-right: 0;
}
.MLK__tooltip::after {
padding: 8px 16px;
font-size: 16px;
}
.MLK__rows > .MLK__row > div.fnbutton {
font-size: 16px;
}
.MLK__rows > .MLK__row > div.bigfnbutton {
font-size: calc(var(--_keycap-extra-small-font-size) / 1.55);
}
.MLK__rows > .MLK__row > div.small {
font-size: 13px;
}
.MLK__rows > .MLK__row > div > aside {
display: none;
}
.MLK__shift {
display: none;
}
}
/* Medium breakpoint: larger phones */
@container (max-width: 768px) {
.MLK__rows {
--_keycap-height: max(var(--keycap-height, 42px), 42px);
}
.MLK__rows > .MLK__row > div > small {
font-size: 14px;
}
}
@media (max-height: 768px) {
.MLK__rows {
--_keycap-height: max(var(--keycap-height, 42px), 42px);
}
.MLK__rows > .MLK__row > div > small {
font-size: 14px;
}
}
@container (max-width: 1444px) {
.MLK__rows .if-wide {
display: none;
}
}
@media (prefers-color-scheme: dark) {
.ML__keyboard {
--_accent-color: var(--keyboard-accent-color, #0b5c9c);
--_background: var(--keyboard-background, #151515);
--_border: var(--keyboard-border, transparent);
--_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030);
--keyboard-toolbar-background-hover: #303030;
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030);
--_keycap-background: var(--keycap-background, #1f2022);
--_keycap-background-hover: var(--keycap-background-hover, #2f3032);
--_keycap-border: var(--_keycap-border, transparent);
--_keycap-border-bottom: var(--_keycap-border-bottom, transparent);
--_keycap-text: var(--keycap-text, #e3e4e8);
--_keycap-secondary-background: var(--keycap-secondary-background, #3d4144);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154);
--_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee);
--keycap-secondary-border: transparent;
--keycap-secondary-border-bottom: transparent;
--_keycap-secondary-border: var(--keycap-secondary-border, transparent);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent);
--_variant-panel-background: var(--variant-panel-background, #303030);
--_variant-keycap-text-active: var(--variant-keycap-text-active, #fff);
}
}
/* Same as the media query, but with a class */
[theme='dark'] .ML__keyboard {
--_accent-color: var(--keyboard-accent-color, #0b5c9c);
--_background: var(--keyboard-background, #151515);
--_border: var(--keyboard-border, transparent);
--_toolbar-text: var(--keyboard-toolbar-text, #e3e4e8);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #303030);
--keyboard-toolbar-background-hover: #303030;
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #303030);
--_keycap-background: var(--keycap-background, #1f2022);
--_keycap-background-hover: var(--keycap-background-hover, #2f3032);
--_keycap-border: var(--_keycap-border, transparent);
--_keycap-border-bottom: var(--_keycap-border-bottom, transparent);
--_keycap-text: var(--keycap-text, #e3e4e8);
--_keycap-secondary-background: var(--keycap-secondary-background, #3d4144);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #4d5154);
--_keycap-secondary-text: var(--keycap-secondary-text, #e7ebee);
--keycap-secondary-border: transparent;
--keycap-secondary-border-bottom: transparent;
--_keycap-secondary-border: var(--keycap-secondary-border, transparent);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, transparent);
--_variant-panel-background: var(--variant-panel-background, #303030);
--_variant-keycap-text-active: var(--variant-keycap-text-active, #fff);
}
[theme='light'] .ML__keyboard {
--_accent-color: var(--keyboard-accent-color, #0c75d8);
--_background: var(--keyboard-background, #cacfd7);
--_border: var(--keyboard-border, #ddd);
--_toolbar-text: var(--keyboard-toolbar-text, #2c2e2f);
--_toolbar-background: var(--keyboard-toolbar-background, transparent);
--_toolbar-background-hover: var(--keyboard-toolbar-background-hover, #eee);
--_toolbar-background-selected: var(--keyboard-toolbar-background-selected, transparent);
--_horizontal-rule: var(--keyboard-horizontal-rule, 1px solid #fff);
--_keycap-background: var(--keycap-background, white);
--_keycap-background-hover: var(--keycap-background-hover, #f5f5f7);
--_keycap-background-active: var(--keycap-background-active, var(--_accent-color));
--_keycap-background-pressed: var(--keycap-background-pressed, var(--_accent-color));
--_keycap-border: var(--_keycap-border, #e5e6e9);
--_keycap-border-bottom: var(--_keycap-border-bottom, #8d8f92);
--_keycap-text: var(--keycap-text, #000);
--_keycap-text-active: var(--keycap-text-active, #fff);
--_keycap-text-hover: var(--keycap-text-hover, var(--_keycap-text));
--_keycap-text-pressed: var(--keycap-text-pressed, #fff);
--_keycap-shift-text: var(--keycap-shift-text, var(--_accent-color));
--_keycap-secondary-background: var(--keycap-secondary-background, #a0a9b8);
--_keycap-secondary-background-hover: var(--keycap-secondary-background-hover, #7d8795);
--_keycap-secondary-text: var(--keycap-secondary-text, #060707);
--_keycap-secondary-border: var(--keycap-secondary-border, #c5c9d0);
--_keycap-secondary-border-bottom: var(--keycap-secondary-border-bottom, #989da6);
--_variant-panel-background: var(--variant-panel-background, #fff);
--_variant-keycap-text: var(--variant-keycap-textvar, var(--_keycap-text));
--_variant-keycap-text-active: var(--variant-keycap-text-active, var(--_keycap-text-active));
--_variant-keycap-background-active: var(--variant-keycap-background-active, var(--_accent-color));
}
`,Mc=`:host {
--primary-color: #5898ff;
--primary-color-dimmed: #c0c0f0;
--primary-color-dark: var(--blue-500);
--primary-color-light: var(--blue-100);
--primary-color-reverse: #ffffff;
--secondary-color: #ff8a65;
--secondary-color-dimmed: #f0d5c5;
--secondary-color-dark: var(--orange-500);
--secondary-color-light: var(--orange-100);
--secondary-color-reverse: #ffffff;
--link-color: #5898ff;
--link-color-dimmed: #c5c5c5;
--link-color-dark: #121212;
--link-color-light: #e2e2e2;
--link-color-reverse: #ffffff;
--semantic-blue: var(--blue-700);
--semantic-red: var(--red-400);
--semantic-orange: var(--orange-400);
--semantic-green: var(--green-700);
--neutral-100: #f5f5f5;
--neutral-200: #eeeeee;
--neutral-300: #e0e0e0;
--neutral-400: #bdbdbd;
--neutral-500: #9e9e9e;
--neutral-600: #757575;
--neutral-700: #616161;
--neutral-800: #424242;
--neutral-900: #212121;
--red-25: #fff8f7;
--red-50: #fff1ef;
--red-100: #ffeae6;
--red-200: #ffcac1;
--red-300: #ffa495;
--red-400: #ff7865;
--red-500: #f21c0d;
--red-600: #e50018;
--red-700: #d30024;
--red-800: #bd002c;
--red-900: #a1002f;
--orange-25: #fffbf8;
--orange-50: #fff7f1;
--orange-100: #fff3ea;
--orange-200: #ffe1c9;
--orange-300: #ffcca2;
--orange-400: #ffb677;
--orange-500: #fe9310;
--orange-600: #f58700;
--orange-700: #ea7c00;
--orange-800: #dc6d00;
--orange-900: #ca5b00;
--brown-25: #fff8ef;
--brown-50: #fff1df;
--brown-100: #ffe9ce;
--brown-200: #ebcca6;
--brown-300: #cdaf8a;
--brown-400: #af936f;
--brown-500: #856a47;
--brown-600: #7f5e34;
--brown-700: #78511f;
--brown-800: #6e4200;
--brown-900: #593200;
--yellow-25: #fffdf9;
--yellow-50: #fffcf2;
--yellow-100: #fffaec;
--yellow-200: #fff2ce;
--yellow-300: #ffe8ab;
--yellow-400: #ffdf85;
--yellow-500: #ffcf33;
--yellow-600: #f1c000;
--yellow-700: #dfb200;
--yellow-800: #c9a000;
--yellow-900: #ad8a00;
--lime-25: #f4ffee;
--lime-50: #e9ffdd;
--lime-100: #ddffca;
--lime-200: #a8fb6f;
--lime-300: #94e659;
--lime-400: #80d142;
--lime-500: #63b215;
--lime-600: #45a000;
--lime-700: #268e00;
--lime-800: #007417;
--lime-900: #005321;
--green-25: #f5fff5;
--green-50: #ebffea;
--green-100: #e0ffdf;
--green-200: #a7ffa7;
--green-300: #5afa65;
--green-400: #45e953;
--green-500: #17cf36;
--green-600: #00b944;
--green-700: #00a34a;
--green-800: #008749;
--green-900: #00653e;
--teal-25: #f3ffff;
--teal-50: #e6fffe;
--teal-100: #d9fffe;
--teal-200: #8dfffe;
--teal-300: #57f4f4;
--teal-400: #43e5e5;
--teal-500: #17cfcf;
--teal-600: #00c2c0;
--teal-700: #00b5b1;
--teal-800: #00a49e;
--teal-900: #009087;
--cyan-25: #f7fcff;
--cyan-50: #eff8ff;
--cyan-100: #e7f5ff;
--cyan-200: #c2e6ff;
--cyan-300: #95d5ff;
--cyan-400: #61c4ff;
--cyan-500: #13a7ec;
--cyan-600: #069eda;
--cyan-700: #0095c9;
--cyan-800: #0088b2;
--cyan-900: #0a7897;
--blue-25: #f7faff;
--blue-50: #eef5ff;
--blue-100: #e5f1ff;
--blue-200: #bfdbff;
--blue-300: #92c2ff;
--blue-400: #63a8ff;
--blue-500: #0d80f2;
--blue-600: #0077db;
--blue-700: #006dc4;
--blue-800: #0060a7;
--blue-900: #005086;
--indigo-25: #f8f7ff;
--indigo-50: #f1efff;
--indigo-100: #eae7ff;
--indigo-200: #ccc3ff;
--indigo-300: #ac99ff;
--indigo-400: #916aff;
--indigo-500: #63c;
--indigo-600: #5a21b2;
--indigo-700: #4e0b99;
--indigo-800: #3b0071;
--indigo-900: #220040;
--purple-25: #fbf7ff;
--purple-50: #f8f0ff;
--purple-100: #f4e8ff;
--purple-200: #e4c4ff;
--purple-300: #d49aff;
--purple-400: #c36aff;
--purple-500: #a219e6;
--purple-600: #9000c4;
--purple-700: #7c009f;
--purple-800: #600073;
--purple-900: #3d0043;
--magenta-25: #fff8fb;
--magenta-50: #fff2f6;
--magenta-100: #ffebf2;
--magenta-200: #ffcddf;
--magenta-300: #ffa8cb;
--magenta-400: #ff7fb7;
--magenta-500: #eb4799;
--magenta-600: #da3689;
--magenta-700: #c82179;
--magenta-800: #b00065;
--magenta-900: #8a004c;
}
@media (prefers-color-scheme: dark) {
:host {
--semantic-blue: var(--blue-700);
--semantic-red: var(--red-400);
--semantic-orange: var(--orange-400);
--semantic-green: var(--green-700);
--semantic-bg-blue: var(--blue-25);
--semantic-bg-red: var(--red-25);
--semantic-bg-orange: var(--orange-25);
--semantic-bg-green: var(--green-25);
--neutral-100: #121212;
--neutral-200: #424242;
--neutral-300: #616161;
--neutral-400: #757575;
--neutral-500: #9e9e9e;
--neutral-600: #bdbdbd;
--neutral-700: #e0e0e0;
--neutral-800: #eeeeee;
--neutral-900: #f5f5f5;
}
}
:host([theme='dark']) {
--semantic-blue: var(--blue-700);
--semantic-red: var(--red-400);
--semantic-orange: var(--orange-400);
--semantic-green: var(--green-700);
--semantic-bg-blue: var(--blue-25);
--semantic-bg-red: var(--red-25);
--semantic-bg-orange: var(--orange-25);
--semantic-bg-green: var(--green-25);
--neutral-100: #121212;
--neutral-200: #424242;
--neutral-300: #616161;
--neutral-400: #757575;
--neutral-500: #9e9e9e;
--neutral-600: #bdbdbd;
--neutral-700: #e0e0e0;
--neutral-800: #eeeeee;
--neutral-900: #f5f5f5;
}
/* @media (prefers-color-scheme: dark) {
:host {
--label-color: #fff;
--active-label-color: #000;
--menu-bg: #525252;
--active-bg: #5898ff;
--active-bg-dimmed: #5c5c5c;
}
} */
:host {
--ui-font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont,
'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji',
'Segoe UI Emoji', 'Segoe UI Symbol';
--ui-font-size: 14px;
--ui-line-height: 1.5;
--ui-letter-spacing: 0.007em;
--mono-font-family: 'Berkeley Mono', 'JetBrains Mono', 'IBM Plex Mono',
'Source Code Pro', Menlo, Monaco, 'Courier New', monospace;
--ui-layer-1: var(--neutral-100);
--ui-layer-2: var(--neutral-200);
--ui-layer-3: var(--neutral-300);
--ui-layer-4: var(--neutral-400);
--ui-layer-5: var(--neutral-500);
--ui-layer-6: var(--neutral-600);
--ui-border-color: var(--primary-color);
--ui-border-radius: 4px;
--ui-text: var(--neutral-900);
--ui-text-secondary: var(--neutral-700);
--ui-text-placeholder: var(--neutral-500);
--ui-text-muted: var(--neutral-300);
/** A field is a UI element in which a user can type data, for
* example an input or textarea element.
*/
--ui-field-bg: var(--neutral-100);
--ui-field-bg-hover: var(--neutral-100);
--ui-field-bg-disabled: var(--neutral-300);
--ui-field-bg-invalid: var(--red-100);
--ui-field-bg-focus: var(--neutral-100);
--ui-field-border: 0.5px solid var(--border-color);
--ui-field-border-hover: 0.5px solid var(--border-color);
--ui-field-border-disabled: 0.5px solid var(--border-color);
--ui-field-border-invalid: 0.5px solid var(--border-color);
--ui-field-border-focus: 0.5px solid var(--border-color);
--ui-menu-bg: var(--neutral-100);
--ui-menu-text: var(--neutral-900);
--ui-menu-bg-hover: var(--neutral-200);
--ui-menu-text-hover: var(--neutral-900);
/** The \`active\` state is used for the state of menu items
* when they are selected.
*/
--ui-menu-bg-active: var(--primary-color);
--ui-menu-text-active: var(--primary-color-reverse);
/** The \`active-muted\` set is used for the state of
* submenus when they are open.
*/
--ui-menu-bg-active-muted: var(--neutral-300);
--ui-menu-text-active-muted: var(--neutral-900);
/* --ui-menu-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.302),
0 2px 6px 2px rgba(60, 64, 67, 0.149); */
--ui-menu-shadow: 0 0 2px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.2);
--ui-menu-divider: 0.5px solid #c7c7c7;
/* var(--neutral-300); */
--ui-menu-z-index: 10000;
--page-bg: var(--neutral-100);
--content-bg: var(--neutral-200);
}
@media (prefers-color-scheme: dark) {
:host {
--ui-menu-bg: var(--neutral-200);
}
}
:host([theme='dark']) {
--ui-menu-bg: var(--neutral-200);
}
/* PingFang SC is a macOS font. Microsoft Yahei is a Windows font.
Noto is a Linux/Android font.
*/
:lang(zh-cn),
:lang(zh-sg),
:lang(zh-my),
:lang(zh) {
--ui-font-family: -apple-system, system-ui, 'PingFang SC', 'Hiragino Sans GB',
'Noto Sans CJK SC', 'Noto Sans SC', 'Noto Sans', 'Microsoft Yahei UI',
'Microsoft YaHei New', 'Microsoft Yahei', '\u5FAE\u8F6F\u96C5\u9ED1', SimSun, '\u5B8B\u4F53',
STXihei, '\u534E\u6587\u7EC6\u9ED1', sans-serif;
}
:lang(zh-tw),
:lang(zh-hk),
:lang(zh-mo) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans',
'Microsoft JhengHei UI', 'Microsoft JhengHei', '\u5FAE\u8EDF\u6B63\u9ED1\u9AD4', '\u65B0\u7D30\u660E\u9AD4',
'PMingLiU', '\u7D30\u660E\u9AD4', 'MingLiU', sans-serif;
}
:lang(ja),
:lang(ja-jp),
:lang(ja-jp-mac) {
--ui-font-family: -apple-system, system-ui, 'Hiragino Sans',
'Hiragino Kaku Gothic ProN', 'Noto Sans CJK JP', 'Noto Sans JP', 'Noto Sans',
'\u6E38\u30B4\u30B7\u30C3\u30AF', '\u6E38\u30B4\u30B7\u30C3\u30AF\u4F53', YuGothic, 'Yu Gothic', '\u30E1\u30A4\u30EA\u30AA', Meiryo,
'\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF', 'MS PGothic', sans-serif;
}
:lang(ko),
:lang(ko-kr),
:lang(ko-kr-std) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
'Noto Sans', 'Malgun Gothic', '\uB9D1\uC740 \uACE0\uB515', 'Apple SD Gothic Neo',
'\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo', 'Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo', '\uB3CB\uC6C0', Dotum, sans-serif;
}
:lang(ko-kr-apple) {
--ui-font-family: -apple-system, system-ui, 'Noto Sans CJK KR', 'Noto Sans KR',
'Noto Sans', 'Apple SD Gothic Neo', '\uC560\uD50C SD \uC0B0\uB3CC\uACE0\uB515 Neo',
'Apple SD \uC0B0\uB3CC\uACE0\uB515 Neo', '\uB3CB\uC6C0', Dotum, sans-serif;
}
:lang(zh-cn),
:lang(zh-sg),
:lang(zh-my),
:lang(zh),
:lang(zh-tw),
:lang(zh-hk),
:lang(zh-mo),
:lang(ja),
:lang(ja-jp),
:lang(ja-jp-mac),
:lang(ko),
:lang(ko-kr),
:lang(ko-kr-std),
:lang(ko-kr-apple) {
--ui-font-size: 1rem;
--ui-line-height: 1.7;
--ui-letter-spacing: 0;
}
:dir(rtl) {
--ui-line-height: auto;
--ui-letter-spacing: 0;
}
`,dh=`.ui-menu *,
.ui-menu ::before,
.ui-menu ::after {
box-sizing: border-box;
}
.ui-menu {
display: none;
color-scheme: light dark;
-webkit-user-select: none;
/* Important: Safari iOS doesn't respect user-select */
user-select: none;
cursor: default;
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0 0 0 0);
--active-label-color: #fff;
/* ui-menu-text-active */
--label-color: #121212;
/* ui-menu-text */
--menu-bg: #e2e2e2;
/* ui-menu-background */
--active-bg: #5898ff;
/* ui-menu-background-active */
--active-bg-dimmed: #c5c5c5;
/* ui-menu-background-active-muted */
}
/** Use the :where pseudo selector to make the specificity of the
* selector 0, so that it can be overridden by the user.
*/
:where(.ui-menu-container) {
position: absolute;
overflow: visible;
width: auto;
height: auto;
z-index: 10000;
border-radius: 8px;
background: var(--ui-menu-bg);
box-shadow: var(--ui-menu-shadow);
list-style: none;
padding: 6px 0 6px 0;
margin: 0;
user-select: none;
cursor: default;
color: var(--ui-menu-text);
font-weight: normal;
font-style: normal;
text-shadow: none;
text-transform: none;
letter-spacing: 0;
outline: none;
opacity: 1;
/* The [popover] elements have a 1px solid black border. Ugh. */
border: none;
width: fit-content;
height: fit-content;
}
:where(.ui-menu-container > li) {
display: flex;
flex-flow: row;
align-items: center;
padding: 1px 7px 1px 7px;
margin-top: 0;
margin-left: 6px;
margin-right: 6px;
border-radius: 4px;
white-space: nowrap;
position: relative;
outline: none;
fill: currentColor;
user-select: none;
cursor: default;
text-align: left;
color: inherit;
font-family: var(--ui-font-family);
font-size: var(--ui-font-size);
line-height: var(--ui-line-height);
letter-spacing: var(--ui-letter-spacing);
}
:where(.ui-menu-container > li > .label) {
appearance: none;
background: none;
outline: none;
width: 100%;
margin: 0;
padding: 1px 2px 1px 1px;
overflow: visible;
border: 1px solid transparent;
white-space: nowrap;
text-align: start;
}
:where(.ui-menu-container > li:has(.heading)) {
margin-top: 0.5em;
}
:where(.ui-menu-container > li > .label.heading) {
font-weight: bold;
opacity: 0.4;
}
:where(.ui-menu-container > li.indent > .label) {
margin-inline-start: 12px;
}
:where(.ui-menu-container > li > .label.indent) {
margin-inline-start: 12px;
}
:where(.ui-menu-container > li[role='divider']) {
border-bottom: 1px solid var(--ui-menu-divider);
border-radius: 0;
padding: 0;
margin-left: 15px;
margin-right: 15px;
padding-top: 5px;
margin-bottom: 5px;
width: calc(100% - 30px);
/** 100% - (margin-left + margin-right) */
}
:where(.ui-menu-container > li[aria-disabled='true']) {
opacity: 0.5;
}
:where(.ui-menu-container > li.active) {
background: var(--ui-menu-bg-active);
background: -apple-system-control-accent;
color: var(--ui-menu-text-active);
}
:where(.ui-menu-container > li.active.is-submenu-open) {
background: var(--ui-menu-bg-active-muted);
color: inherit;
}
:where(.ui-menu-container > li[aria-haspopup='true'] > .label) {
padding-inline-end: 0;
}
:where(.ui-menu-container > li[aria-haspopup='true'].active::after) {
color: var(--ui-menu-text-active);
}
/** Keyboard shortcut */
:where(.ui-menu-container > li > kbd) {
font-family: var(--ui-font-family);
margin-inline-start: 12px;
opacity: 0.4;
}
:where(.ui-menu-container > li.active > kbd) {
opacity: 0.85;
}
.ui-trailing-chevron {
display: flex;
margin-inline-start: 24px;
width: 10px;
height: 10px;
margin-bottom: 4px;
}
.ui-trailing-chevron:dir(rtl) {
transform: scaleX(-1);
}
.ui-checkmark {
display: flex;
margin-inline-end: -11px;
margin-inline-start: -4px;
margin-top: 2px;
width: 16px;
height: 16px;
}
.ui-mixedmark {
display: flex;
margin-inline-end: -11px;
margin-inline-start: -4px;
margin-top: 2px;
width: 16px;
height: 16px;
}
`,Qa;function Hl(a){let y="";switch(a){case"mathfield-element":y=`
:host { display: inline-block; background-color: field; color: fieldtext; border-width: 1px; border-style: solid; border-color: #acacac; border-radius: 2px; padding:4px;}
:host([hidden]) { display: none; }
:host([disabled]), :host([disabled]:focus), :host([disabled]:focus-within) { outline: none; opacity: .5; }
:host(:focus), :host(:focus-within) {
outline: Highlight auto 1px; /* For Firefox */
outline: -webkit-focus-ring-color auto 1px;
}
:host([readonly]:focus), :host([readonly]:focus-within),
:host([read-only]:focus), :host([read-only]:focus-within) {
outline: none;
}
@media (hover: none) and (pointer: coarse) {
:host(:not(:focus)) :first-child { pointer-events: none !important; }
}`;break;case"core":y=Xa;break;case"mathfield":y=vf;break;case"environment-popover":y=yf;break;case"suggestion-popover":y=uh;break;case"keystroke-caption":y=uu;break;case"virtual-keyboard":y=ch;break;case"ui":y=Mc;break;case"menu":y=dh;break;default:debugger}return y}function cu(a){return Qa||(Qa={}),Qa[a]||(Qa[a]=new CSSStyleSheet,Qa[a].replaceSync(Hl(a))),Qa[a]}var ol;function ks(a){var y;if(!("adoptedStyleSheets"in document)){if(window.document.getElementById(`mathlive-style-${a}`))return;const b=window.document.createElement("style");b.id=`mathlive-style-${a}`,b.append(window.document.createTextNode(Hl(a))),window.document.head.appendChild(b);return}if(ol||(ol={}),((y=ol[a])!=null?y:0)!==0)ol[a]+=1;else{const b=cu(a);document.adoptedStyleSheets=[...document.adoptedStyleSheets,b],ol[a]=1}}function x(a){if("adoptedStyleSheets"in document&&ol!=null&&ol[a]&&(ol[a]-=1,ol[a]<=0)){const y=Qa[a];document.adoptedStyleSheets=document.adoptedStyleSheets.filter(b=>b!==y)}}var z=class kp extends In{constructor(y){var b;super(he(we({},y),{type:"accent",body:(b=y.body)!=null?b:void 0})),y.accentChar?this.accent=y.accentChar:this.svgAccent=y==null?void 0:y.svgAccent,this.skipBoundary=!0,this.captureSelection=!0}static fromJson(y){return new kp(y)}toJson(){return he(we({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(y){var b;const E=new ya({parent:y,mathstyle:"cramp"},this.style),ee=(b=In.createBox(E,this.body))!=null?b:new sr("\u25A2",{style:this.style});let re=0;!this.hasEmptyBranch("body")&&this.body.length===2&&this.body[1].isCharacterBox()&&(re=ee.skew);let ae=Math.min(ee.height,el),de;if(this.svgAccent)de=Bs(this.svgAccent),ae=E.metrics.bigOpSpacing1-ae;else if(this.accent){const ge=new sr(this.accent,{fontFamily:"Main-Regular"});ge.italic=0;const xe=this.accent===8407?" ML__accent-vec":"";de=new sr(new sr(ge),{classes:"ML__accent-body"+xe})}de=new Ja({shift:0,children:[{box:new sr(ee)},-ae,{box:de,marginLeft:ee.left+2*re,classes:["ML__center"]}]});const fe=new sr(de,{type:"lift"});return this.caret&&(fe.caret=this.caret),this.bind(E,fe.wrap(E)),this.attachSupsub(E,{base:fe})}},ne={"(":")","{":"}","[":"]","|":"|","\\lbrace":"\\rbrace","\\lparen":"\\rparen","\\{":"\\}","\\langle":"\\rangle","\\lfloor":"\\rfloor","\\lceil":"\\rceil","\\vert":"\\vert","\\lvert":"\\rvert","\\Vert":"\\Vert","\\lVert":"\\rVert","\\lbrack":"\\rbrack","\\ulcorner":"\\urcorner","\\llcorner":"\\lrcorner","\\lgroup":"\\rgroup","\\lmoustache":"\\rmoustache"},te=Object.fromEntries(Object.entries(ne).map(([a,y])=>[y,a]));function ie(a){var y;return(y={"[":91,"]":93,"(":40,")":41,"\\mid":8739,"|":8739,"\u2223":8739,"\u2225":8741,"\\|":8739,"\\{":123,"\\}":125,"\\lbrace":123,"\\rbrace":125,"\\lparen":40,"\\rparen":41,"\\lbrack":91,"\\rbrack":93,"\\vert":8739,"\\lvert":8739,"\\mvert":8739,"\\rvert":8739,"\\Vert":8741,"\\lVert":8741,"\\mVert":8741,"\\rVert":8741,"\\parallel":8741,"\\shortparallel":8741,"\\langle":10216,"\\rangle":10217,"\\lfloor":8970,"\\rfloor":8971,"\\lceil":8968,"\\rceil":8969,"\\ulcorner":9484,"\\urcorner":9488,"\\llcorner":9492,"\\lrcorner":9496,"\\lgroup":10222,"\\rgroup":10223,"\\lmoustache":9136,"\\rmoustache":9137,"\\surd":8730}[a])!=null?y:a.codePointAt(0)}function se(a,y,b,E){var ee;const ae=new sr(ie(a),{fontFamily:"Main-Regular",isSelected:E.isSelected,classes:"ML__small-delim "+((ee=E.classes)!=null?ee:"")}).wrap(y);return b&&ae.setTop((1-y.scalingFactor)*os),ae}function me(a,y,b,E,ee){var re,ae;const de=new ya({parent:E,mathstyle:"textstyle"},ee==null?void 0:ee.style),fe=new sr(ie(a),{fontFamily:`Size${y}-Regular`,isSelected:ee.isSelected,classes:((re=ee.classes)!=null?re:"")+` ML__delim-size${y}`,type:(ae=ee.type)!=null?ae:"ignore"}).wrap(de);return b&&fe.setTop((1-de.scalingFactor)*os),fe}function Se(a,y,b,E,ee){var re;let ae,de,fe,ge;ae=fe=ge=ie(a),de=null;let xe="Size1-Regular";a==="\\vert"||a==="\\lvert"||a==="\\rvert"||a==="\\mvert"||a==="\\mid"?fe=ae=ge=8739:a==="\\Vert"||a==="\\lVert"||a==="\\rVert"||a==="\\mVert"||a==="\\|"?fe=ae=ge=8741:a==="\\uparrow"?fe=ge=9168:a==="\\Uparrow"?fe=ge=8214:a==="\\downarrow"?ae=fe=9168:a==="\\Downarrow"?ae=fe=8214:a==="\\updownarrow"?(ae=8593,fe=9168,ge=8595):a==="\\Updownarrow"?(ae=8657,fe=8214,ge=8659):a==="["||a==="\\lbrack"?(ae=9121,fe=9122,ge=9123,xe="Size4-Regular"):a==="]"||a==="\\rbrack"?(ae=9124,fe=9125,ge=9126,xe="Size4-Regular"):a==="\\lfloor"||a==="\u230A"?(fe=ae=9122,ge=9123,xe="Size4-Regular"):a==="\\lceil"||a==="\u2308"?(ae=9121,fe=ge=9122,xe="Size4-Regular"):a==="\\rfloor"||a==="\u230B"?(fe=ae=9125,ge=9126,xe="Size4-Regular"):a==="\\rceil"||a==="\u2309"?(ae=9124,fe=ge=9125,xe="Size4-Regular"):a==="("||a==="\\lparen"?(ae=9115,fe=9116,ge=9117,xe="Size4-Regular"):a===")"||a==="\\rparen"?(ae=9118,fe=9119,ge=9120,xe="Size4-Regular"):a==="\\{"||a==="\\lbrace"?(ae=9127,de=9128,ge=9129,fe=9130,xe="Size4-Regular"):a==="\\}"||a==="\\rbrace"?(ae=9131,de=9132,ge=9133,fe=9130,xe="Size4-Regular"):a==="\\lgroup"||a==="\u27EE"?(ae=9127,ge=9129,fe=9130,xe="Size4-Regular"):a==="\\rgroup"||a==="\u27EF"?(ae=9131,ge=9133,fe=9130,xe="Size4-Regular"):a==="\\lmoustache"||a==="\u23B0"?(ae=9127,ge=9133,fe=9130,xe="Size4-Regular"):a==="\\rmoustache"||a==="\u23B1"?(ae=9131,ge=9129,fe=9130,xe="Size4-Regular"):a==="\\surd"?(ae=57345,ge=9143,fe=57344,xe="Size4-Regular"):a==="\\ulcorner"?(ae=9484,fe=ge=32):a==="\\urcorner"?(ae=9488,fe=ge=32):a==="\\llcorner"?(ge=9492,fe=ae=32):a==="\\lrcorner"&&(ae=9496,fe=ae=32);const Be=tl(ae,xe),Ve=Be.height+Be.depth,ot=tl(fe,xe),gt=ot.height+ot.depth,ln=tl(ge,xe),ar=ln.height+ln.depth;let rn=0,Vn=1;if(de!==null){const Yo=tl(de,xe);rn=Yo.height+Yo.depth,Vn=2}const lr=Ve+ar+rn,jn=Math.max(0,Math.ceil((y-lr)/(Vn*gt))),Kr=lr+jn*Vn*gt;let ai=os;b&&(ai=ai*E.scalingFactor);const jr=Kr/2-ai,_a=.008,qa=[];qa.push({box:new sr(ge,{fontFamily:xe})}),qa.push(-_a);const br=new sr(fe,{fontFamily:xe});if(de===null)for(let Yo=0;Yo<jn;Yo++)qa.push({box:br});else{for(let Yo=0;Yo<jn;Yo++)qa.push({box:br});qa.push(-_a),qa.push({box:new sr(de,{fontFamily:xe})}),qa.push(-_a);for(let Yo=0;Yo<jn;Yo++)qa.push({box:br})}qa.push(-_a),qa.push({box:new sr(ae,{fontFamily:xe})});let $s="";xe==="Size1-Regular"?$s=" delim-size1":xe==="Size4-Regular"&&($s=" delim-size4");const kl=new Ja({bottom:jr,children:qa},{classes:$s});return new sr(kl,he(we({},ee!=null?ee:{}),{classes:((re=ee==null?void 0:ee.classes)!=null?re:"")+" ML__delim-mult"}))}var Ae=new Set(["(",")","\\lparen","\\rparen","[","]","\\lbrack","\\rbrack","\\{","\\}","\\lbrace","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd","\u230A","\u230B","\u2308","\u2309"]),Pe=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","\u27EE","\u27EF","\u23B0","\u23B1"]),at=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),vt=[0,1.2,1.8,2.4,3];function Gt(a,y,b,E){return a===void 0||a==="."?Rr(b,E.classes):(a==="<"||a==="\\lt"||a==="\u27E8"?a="\\langle":(a===">"||a==="\\gt"||a==="\u27E9")&&(a="\\rangle"),Ae.has(a)||at.has(a)?me(a,y,!1,b,E):Pe.has(a)?Se(a,vt[y],!1,b,E):(console.assert(!1,"Unknown delimiter '"+a+"'"),null))}var Ft=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Rn=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"stack"}],Xn=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}];function hr(a){return a.type==="small"?"Main-Regular":a.type==="large"?"Size"+a.size+"-Regular":(console.assert(a.type==="stack"),"Size4-Regular")}function _r(a,y,b,E){const ee={"-4":0,"-3":1,0:2}[E.mathstyle.sizeDelta];for(let re=ee;re<b.length&&b[re].type!=="stack";re++){const ae=tl(a,hr(b[re]));if(ae.defaultMetrics)return{type:"small",mathstyle:"scriptstyle"};let de=ae.height+ae.depth;if(b[re].type==="small"&&(b[re].mathstyle==="scriptscriptstyle"?de*=Math.max(pc[Math.max(1,E.size-2)],E.minFontScale):b[re].mathstyle==="scriptstyle"&&(de*=Math.max(pc[Math.max(1,E.size-1)],E.minFontScale))),de>y)return b[re]}return b[b.length-1]}function Or(a,y,b,E,ee,re){if(!y||y.length===0||y===".")return Rr(ee);y==="<"||y==="\\lt"?y="\\langle":(y===">"||y==="\\gt")&&(y="\\rangle");let ae;at.has(y)?ae=Ft:Ae.has(y)?ae=Xn:ae=Rn;const de=_r(ie(y),b,ae,ee),fe=new ya({parent:ee,mathstyle:de.mathstyle},re==null?void 0:re.style);return de.type==="small"?se(y,fe,E,he(we({},re),{type:a})):de.type==="large"?me(y,de.size,E,fe,he(we({},re),{type:a})):(console.assert(de.type==="stack"),Se(y,b,E,fe,he(we({},re),{type:a})))}function Sr(a,y,b,E,ee,re){if(y===".")return Rr(ee,re==null?void 0:re.classes);const ae=os*ee.scalingFactor,de=901,fe=5/Fl,ge=Math.max(b-ae,E+ae),xe=Math.max(ge/500*de,2*ge-fe);return Or(a,y,xe,!0,ee,re)}function Rr(a,y){const b=new sr(null,{classes:" nulldelimiter "+(y!=null?y:""),type:"ignore"});return b.width=a.getRegisterAsEm("nulldelimiterspace"),b.wrap(new ya({parent:a,mathstyle:"textstyle"}))}var hi=class Lp extends In{constructor(y){var b;super({type:"placeholder",command:"\\placeholder",mode:(b=y==null?void 0:y.mode)!=null?b:"math",style:y==null?void 0:y.style}),this.captureSelection=!0}static fromJson(y){return new Lp(y)}toJson(){return super.toJson()}render(y){let b;return this.value=y.placeholderSymbol,typeof y.renderPlaceholder=="function"?b=y.renderPlaceholder(y):b=this.createBox(y),this.caret&&(b.classes+=" ML__placeholder-selected"),b}_serialize(y){return y.skipPlaceholders?"":"\\placeholder{}"}},vi=["matrix","matrix*","pmatrix","pmatrix*","bmatrix","bmatrix*","Bmatrix","Bmatrix*","vmatrix","vmatrix*","Vmatrix","Vmatrix*"],ra=["cases","dcases","rcases"],eo=["align","align*","aligned","gather","gathered","split"],Wo=["array","subequations","eqnarray"];function bo(a){return Wo.concat(eo).concat(ra).concat(vi).includes(a)}function cs(a){return vi.includes(a)}function ds(a){return ra.includes(a)}function Io(a){return eo.includes(a)}function fs(a,y,b){let E=0;for(const ge of b)"align"in ge&&(E+=1);let ee=0;const re=[];for(const ge of y){let xe=0;for(ee=Math.max(ee,Math.min(ge.length,E));xe<ge.length;){const Be=[],Ve=Math.min(ge.length,xe+E);for(;xe<Ve;){const ot=ge[xe];ot.length===0?Be.push([new In({type:"first",mode:a.mode})]):ot[0].type!=="first"?Be.push([new In({type:"first",mode:a.mode}),...ot]):(console.assert(!ot.slice(1).some(gt=>gt.type==="first")),Be.push(ot)),xe+=1}re.push(Be)}}re.length>0&&re[re.length-1].length===1&&re[re.length-1][0].length===1&&re[re.length-1][0][0].type==="first"&&re.pop();const ae=[];for(const ge of re){if(ge.length!==ee)for(let xe=ge.length;xe<ee;xe++)ge.push([new In({type:"first",mode:a.mode}),new hi]);ae.push(ge)}let de=0,fe=0;for(const ge of ae){fe=0;for(const xe of ge){for(const Be of xe)Be.parent=a,Be.parentBranch=[de,fe];fe+=1}de+=1}return a.isDirty=!0,ae}var zi=class Ap extends In{constructor(y,b,E,ee={}){var re;super({type:"array"}),this.environmentName=y,this.rowGaps=E,ee.mathstyleName&&(this.mathstyleName=ee.mathstyleName),ee.columns&&(ee.columns.length===0?this.colFormat=[{align:"l"}]:this.colFormat=ee.columns),this.colFormat||(this.colFormat=[{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"},{align:"l"}]),this.array=fs(this,b,this.colFormat),ee.leftDelim&&(this.leftDelim=ee.leftDelim),ee.rightDelim&&(this.rightDelim=ee.rightDelim),ee.arraycolsep!==void 0&&(this.arraycolsep=ee.arraycolsep),this.colSeparationType=ee.colSeparationType,ee.arraystretch!==void 0&&(this.arraystretch=ee.arraystretch),this.minColumns=(re=ee.minColumns)!=null?re:1}static fromJson(y){return new Ap(y.environmentName,y.array,y.rowGaps,y)}toJson(){const y=he(we({},super.toJson()),{environmentName:this.environmentName,array:this.array.map(b=>b.map(E=>E.map(ee=>ee.toJson()))),rowGaps:this.rowGaps,columns:this.colFormat,colSeparationType:this.colSeparationType});return this.arraystretch!==void 0&&(y.arraystretch=this.arraystretch),this.arraycolsep!==void 0&&(y.arraycolsep=this.arraycolsep),this.leftDelim&&(y.leftDelim=this.leftDelim),this.rightDelim&&(y.rightDelim=this.rightDelim),y}branch(y){var b;if(Iu(y))return(b=this.array[y[0]][y[1]])!=null?b:void 0}createBranch(y){var b;return Iu(y)?(this.isDirty=!0,(b=this.branch(y))!=null?b:[]):[]}get rowCount(){return this.array.length}get colCount(){return this.array[0].length}get maxColumns(){return this.colFormat.filter(y=>!!y.align).length}removeBranch(y){if(il(y))return super.removeBranch(y);const b=this.branch(y);return this.array[y[0]][y[1]]=void 0,b.forEach(E=>{E.parent=void 0,E.parentBranch=void 0}),console.assert(b[0].type==="first"),b.shift(),this.isDirty=!0,b}get hasChildren(){return this.children.length>0}get children(){const y=[];for(const b of this.array)for(const E of b)if(E)for(const ee of E)y.push(...ee.children),y.push(ee);return[...y,...super.children]}render(y){var b,E,ee,re,ae,de;const fe=new ya({parent:y,mathstyle:this.mathstyleName},this.style),ge=fe.getRegisterAsEm("arrayrulewidth"),xe=fe.getRegisterAsEm("arraycolsep"),Be=fe.getRegisterAsEm("doublerulesep"),Ve=(E=(b=this.arraystretch)!=null?b:fe.getRegisterAsNumber("arraystretch"))!=null?E:1;let ot=typeof this.arraycolsep=="number"?this.arraycolsep:xe;this.colSeparationType==="small"&&(ot=.2778*(new ya({parent:y,mathstyle:"scriptstyle"}).scalingFactor/y.scalingFactor));const gt=Ve*hc,ln=.7*gt,ar=.3*gt;let rn=0;const Vn=[];let lr=0;const jn=this.array.length;for(let no=0;no<jn;++no){const Lo=this.array[no];lr=Math.max(lr,Lo.length);const Jo=new ya({parent:fe,mathstyle:this.mathstyleName},this.style);let Ll=ln/Jo.scalingFactor,Al=ar/Jo.scalingFactor;const Tl={cells:[],height:0,depth:0,pos:0};for(const ul of Lo){const e0=(ee=In.createBox(Jo,ul,{type:"ignore"}))!=null?ee:new sr(null,{type:"ignore"});Al=Math.max(Al,e0.depth),Ll=Math.max(Ll,e0.height),Tl.cells.push(e0)}let Dl=(re=sd(this.rowGaps[no]))!=null?re:0;Dl>0&&(Dl+=ar,Al=Math.max(Al,Dl),Dl=0),no<jn-1&&!cs(this.environmentName)&&this.environmentName!=="cases"&&this.environmentName!=="array"&&(Al+=fe.getRegisterAsEm("jot")),Tl.height=Ll,Tl.depth=Al,rn+=Ll,Tl.pos=rn,rn+=Al+Dl,Vn.push(Tl)}const Kr=rn/2+os,ai=[];for(let no=0;no<lr;no++){const Lo=[];for(const Jo of Vn){const Ll=Jo.cells[no];Ll.depth=Jo.depth,Ll.height=Jo.height,Lo.push({box:Ll,shift:Jo.pos-Kr})}Lo.length>0&&ai.push(new Ja({individualShift:Lo}))}const jr=[];let _a=!1,qa=!1,br=0,$s=!this.leftDelim;const{colFormat:kl}=this;for(const no of kl){if("align"in no&&br>=ai.length)break;if("align"in no)_a?jr.push(xo(2*ot)):(qa||$s)&&jr.push(xo(ot)),jr.push(new sr(ai[br],{classes:"col-align-"+no.align})),br++,_a=!0,qa=!1,$s=!1;else if("gap"in no){if(typeof no.gap=="number")jr.push(xo(no.gap));else{const Lo=Co(y,Vn,Kr,no.gap);Lo&&jr.push(Lo)}_a=!1,qa=!1,$s=!1}else if("separator"in no){const Lo=new sr(null,{classes:"vertical-separator"});Lo.height=rn,Lo.setStyle("height",rn,"em"),Lo.setStyle("border-right",`${ge}em ${no.separator} currentColor`),Lo.setStyle("vertical-align",-(rn-Kr),"em");let Jo=0;qa?Jo=Be-ge:_a&&(Jo=ot-ge),Lo.left=Jo,jr.push(Lo),_a=!1,qa=!0,$s=!1}}_a&&!this.rightDelim&&jr.push(xo(ot));const Xs=new sr(jr,{classes:"mtable"});if((!this.leftDelim||this.leftDelim===".")&&(!this.rightDelim||this.rightDelim==="."))return this.caret&&(Xs.caret=this.caret),this.bind(y,Xs);const Yo=Xs.height,zs=Xs.depth,Ms=this.bind(y,new sr([this.bind(y,Sr("open",(ae=this.leftDelim)!=null?ae:".",Yo,zs,fe,{isSelected:this.isSelected})),Xs,this.bind(y,Sr("close",(de=this.rightDelim)!=null?de:".",Yo,zs,fe,{isSelected:this.isSelected}))],{type:"ord"}));return Ms?(Ms.setStyle("display","inline-block"),this.caret&&(Ms.caret=this.caret),this.bind(y,this.attachSupsub(y,{base:Ms}))):null}_serialize(y){var b;const E=[];if(this.environmentName==="lines"?E.push("{\\displaylines"):E.push(`\\begin{${this.environmentName}}`),this.environmentName==="array"){if(E.push("{"),this.colFormat!==void 0)for(const ee of this.colFormat)"align"in ee&&typeof ee.align=="string"?E.push(ee.align):"separator"in ee&&ee.separator==="solid"?E.push("|"):"separator"in ee&&ee.separator==="dashed"&&E.push(":");E.push("}")}for(let ee=0;ee<this.array.length;ee++){for(let re=0;re<this.array[ee].length;re++)re>0&&E.push(" & "),E.push(In.serialize(this.array[ee][re],y));if(ee<this.array.length-1){const re=this.rowGaps[ee];re!=null&&re.dimension?E.push(`\\\\[${re.dimension} ${(b=re.unit)!=null?b:"pt"}] `):E.push("\\\\ ")}}return this.environmentName==="lines"?E.push("}"):E.push(`\\end{${this.environmentName}}`),na(E)}getCell(y,b){return this.array[y][b]}setCell(y,b,E){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.array[y][b]!==void 0);for(const re of this.array[y][b])re.parent=void 0,re.parentBranch=void 0;let ee=E;(E.length===0||E[0].type!=="first")&&(ee=[new In({type:"first",mode:this.mode}),...E]),this.array[y][b]=ee;for(const re of ee)re.parent=this,re.parentBranch=[y,b];this.isDirty=!0}addRowBefore(y){console.assert(this.type==="array"&&Array.isArray(this.array));const b=[];for(let E=0;E<this.colCount;E++)b.push(So(this));this.array.splice(y,0,b);for(let E=y;E<this.rowCount;E++)for(let ee=0;ee<this.colCount;ee++){const re=this.array[E][ee];if(re)for(const ae of re)ae.parentBranch=[E,ee]}this.isDirty=!0}addRowAfter(y){console.assert(this.type==="array"&&Array.isArray(this.array));const b=[];for(let E=0;E<this.colCount;E++)b.push(So(this));this.array.splice(y+1,0,b);for(let E=y+1;E<this.rowCount;E++)for(let ee=0;ee<this.colCount;ee++){const re=this.array[E][ee];if(re)for(const ae of re)ae.parentBranch=[E,ee]}this.isDirty=!0}removeRow(y){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.rowCount>y);const b=this.array.splice(y,1);for(const E of b)for(const ee of E)if(ee)for(const re of ee)re.parent=void 0,re.parentBranch=void 0;for(let E=y;E<this.rowCount;E++)for(let ee=0;ee<this.colCount;ee++){const re=this.array[E][ee];if(re)for(const ae of re)ae.parentBranch=[E,ee]}this.isDirty=!0}addColumnBefore(y){console.assert(this.type==="array"&&Array.isArray(this.array));for(const b of this.array)b.splice(y,0,So(this));for(let b=0;b<this.rowCount;b++)for(let E=y;E<this.colCount;E++){const ee=this.array[b][E];if(ee)for(const re of ee)re.parentBranch=[b,E]}this.isDirty=!0}addColumnAfter(y){console.assert(this.type==="array"&&Array.isArray(this.array));for(const b of this.array)b.splice(y+1,0,So(this));for(let b=0;b<this.rowCount;b++)for(let E=y+1;E<this.colCount;E++){const ee=this.array[b][E];if(ee)for(const re of ee)re.parentBranch=[b,E]}this.isDirty=!0}addColumn(){this.addColumnAfter(this.colCount-1)}removeColumn(y){console.assert(this.type==="array"&&Array.isArray(this.array)&&this.colCount>y);for(const b of this.array){const E=b.splice(y,1);for(const ee of E)if(ee)for(const re of ee)re.parent=void 0,re.parentBranch=void 0}for(let b=0;b<this.rowCount;b++)for(let E=y;E<this.colCount;E++){const ee=this.array[b][E];if(ee)for(const re of ee)re.parentBranch=[b,E]}this.isDirty=!0}get cells(){const y=[];for(const b of this.array)for(const E of b)E&&y.push(E.filter(ee=>ee.type!=="first"));return y}};function So(a){const y=new In({type:"first",mode:a.mode});y.parent=a;const b=new hi;return b.parent=a,[y,b]}function xo(a){const y=new sr(null,{classes:"arraycolsep"});return y.width=a,y}function Co(a,y,b,E){if(!E)return null;const ee=[];for(const re of y){const ae=In.createBox(a,E,{type:"ignore"});ae&&(ae.depth=re.depth,ae.height=re.height,ee.push({box:ae,shift:re.pos-b}))}return new Ja({individualShift:ee}).wrap(a)}var _o=class Tp extends In{constructor(y){super({mode:y.mode,command:y.command,style:y.style,body:y.body,type:"box"}),this.framecolor=y.framecolor,this.backgroundcolor=y.backgroundcolor,this.padding=y.padding,this.offset=y.offset,this.border=y.border}static fromJson(y){return new Tp(y)}toJson(){return he(we({},super.toJson()),{framecolor:this.framecolor,backgroundcolor:this.backgroundcolor,padding:this.padding,offset:this.offset,border:this.border})}render(y){var b,E,ee,re;const ae=In.createBox(y,this.body,{type:"lift"});if(!ae)return null;const de=y.toEm((b=this.offset)!=null?b:{dimension:0});ae.depth+=de,ae.setStyle("display","inline-block"),ae.setStyle("position","relative"),ae.setStyle("height",Math.floor(100*ae.height+ae.depth)/100,"em"),ae.setStyle("vertical-align",-Math.floor(100*ae.height)/100,"em");const fe=new ya({parent:y},this.style),ge=fe.toEm((E=this.padding)!=null?E:{register:"fboxsep"}),xe=new sr(null,{classes:"ML__box"});xe.height=ae.height+ge,xe.depth=ae.depth+ge,xe.setStyle("box-sizing","border-box"),xe.setStyle("position","absolute"),xe.setStyle("top",-ge+.3,"em"),xe.setStyle("left",0),xe.setStyle("height",xe.height+xe.depth,"em"),xe.setStyle("width","100%"),this.backgroundcolor&&xe.setStyle("background-color",(ee=fe.toColor(this.backgroundcolor))!=null?ee:"transparent"),this.framecolor&&xe.setStyle("border",`${fe.getRegisterAsEm("fboxrule",2)}em solid ${(re=fe.toColor(this.framecolor))!=null?re:"black"}`),this.border&&xe.setStyle("border",this.border);const Be=new sr([xe,ae],{type:"lift"});return Be.setStyle("display","inline-block"),Be.setStyle("position","relative"),Be.setStyle("line-height",0),Be.height=ae.height+ge+(de>0?de:0),Be.depth=ae.depth+ge+(de<0?-de:0),Be.setStyle("padding-left",ge,"em"),Be.setStyle("padding-right",ge,"em"),Be.setStyle("height",Math.floor(100*(ae.height+ae.depth+2*ge+Math.abs(de)))/100,"em"),Be.setStyle("margin-top",-ge,"em"),Be.setStyle("top",Math.floor(100*(ae.depth-ae.height+2*ge-de))/100,"em"),Be.setStyle("vertical-align",Math.floor(100*(ae.depth+2*ge))/100,"em"),this.caret&&(Be.caret=this.caret),this.attachSupsub(y,{base:Be})}_serialize(y){return y.skipStyles?na([this.bodyToLatex(y),this.supsubToLatex(y)]):super._serialize(y)}},Wl=class Dp extends In{constructor(y,b){var E;super({type:"composition",mode:(E=b==null?void 0:b.mode)!=null?E:"math",value:y})}static fromJson(y){return new Dp(y.value,y)}toJson(){return super.toJson()}get computedStyle(){return{}}render(y){const b=new sr(this.value,{classes:"ML__composition",type:"composition"});return this.bind(y,b),this.caret&&(b.caret=this.caret),b}_serialize(y){return""}},ys=class Ip extends In{constructor(y){super({type:"error",value:y,command:y,mode:"math"}),this.verbatimLatex=y}static fromJson(y){return new Ip(y.command)}toJson(){return super.toJson()}render(y){const b=this.createBox(y,{classes:"ML__error"});return this.caret&&(b.caret=this.caret),b}},Go=class Pp extends In{constructor(y,b,E){super({type:"group",mode:b,style:E}),this.body=y,this.boxType=y.length>1?"ord":"ignore",this.skipBoundary=!0,this.displayContainsHighlight=!1,y&&y.length===1&&y[0].command===","&&(this.captureSelection=!0)}static fromJson(y){return new Pp(y.body,y.mode,y.style)}render(y){const b=In.createBox(y,this.body,{type:this.boxType});return b?(this.caret&&(b.caret=this.caret),this.bind(y,b)):null}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Fr(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):`{${this.bodyToLatex(y)}}`}},za=class Bp extends In{constructor(y,b,E){super({type:"leftright",style:E.style,displayContainsHighlight:!0}),this.variant=y,this.body=b,this.leftDelim=E.leftDelim,this.rightDelim=E.rightDelim}static fromJson(y){var b;return new Bp((b=y.variant)!=null?b:"",y.body,y)}toJson(){const y=super.toJson();return this.variant&&(y.variant=this.variant),this.leftDelim&&(y.leftDelim=this.leftDelim),this.rightDelim&&(y.rightDelim=this.rightDelim),y}_serialize(y){var b,E;const ee=this.matchingRightDelim();return this.variant==="left...right"?na(["\\left",(b=this.leftDelim)!=null?b:".",this.bodyToLatex(y),"\\right",ee]):this.variant==="mleft...mright"?na(["\\mleft",(E=this.leftDelim)!=null?E:".",this.bodyToLatex(y),"\\mright",ee]):na([!this.leftDelim||this.leftDelim==="."?"":this.leftDelim,this.bodyToLatex(y),ee])}matchingRightDelim(){var y,b;if(this.rightDelim&&this.rightDelim!=="?")return this.rightDelim;const E=(y=this.leftDelim)!=null?y:".";return(b=ne[E])!=null?b:E}render(y){var b,E;const ee=new ya({parent:y},this.style);console.assert(this.body!==void 0);const re=new ya({parent:y,mathstyle:"textstyle"},this.style),ae=(b=In.createBox(ee,this.body,{type:"inner"}))!=null?b:new sr(null,{type:"inner"}),de=ae.height/re.scalingFactor,fe=ae.depth/re.scalingFactor,ge=[];if(this.leftDelim&&ge.push(this.bind(re,Sr("open",this.leftDelim,de,fe,re,{isSelected:this.isSelected,classes:"ML__open"+(this.containsCaret?" ML__contains-caret":""),mode:this.mode,style:this.style}))),ae&&(No(ae.children,this,ee,de,fe),ge.push(ae)),this.rightDelim){let ot=this.containsCaret?" ML__contains-caret":"",gt=this.rightDelim;gt==="?"&&(ee.smartFence?(gt=this.matchingRightDelim(),ot+=" ML__smart-fence__close"):gt="."),ge.push(this.bind(re,Sr("close",gt,de,fe,re,{isSelected:this.isSelected,classes:ot+" ML__close",mode:this.mode,style:this.style})))}let xe=this.variant==="mleft...mright";const Be=this.leftSibling;Be&&(!xe&&Be.isFunction&&(xe=!0),!xe&&Be.type==="subsup"&&((E=Be.leftSibling)!=null&&E.isFunction)&&(xe=!0));const Ve=new sr(ge,{type:xe?"close":"inner",classes:"left-right"});return Ve.setStyle("margin-top",`${-ae.depth}em`),Ve.setStyle("height",`${ae.height+ae.depth}em`),this.caret&&(Ve.caret=this.caret),this.bind(ee,Ve.wrap(ee))}};function No(a,y,b,E,ee){if(a)for(let re=0;re<a.length;re++){const ae=a[re];ae.type==="middle"?(a[re]=y.bind(b,Sr("inner",ae.value,E,ee,b,{isSelected:y.isSelected})),a[re].caret=ae.caret,a[re].isSelected=ae.isSelected,a[re].cssId=ae.cssId,a[re].htmlData=ae.htmlData,a[re].htmlStyle=ae.htmlStyle,a[re].attributes=ae.attributes,a[re].cssProperties=ae.cssProperties):ae.children&&No(ae.children,y,b,E,ee)}}var Ec=class Op extends In{constructor(y,b){var E;super({type:"macro",command:y,style:b.style}),this.body=b.body,b.captureSelection===void 0?b.args?this.captureSelection=!1:this.captureSelection=!0:this.captureSelection=b.captureSelection,this.macroArgs=b.args,this.expand=(E=b.expand)!=null?E:!1}static fromJson(y){return new Op(y.command,y)}toJson(){const y=super.toJson();return this.expand&&(y.expand=!0),this.captureSelection!==void 0&&(y.captureSelection=this.captureSelection),this.macroArgs&&(y.args=this.macroArgs),y}_serialize(y){var b;return y.expandMacro&&this.expand?this.bodyToLatex(y):this.command+((b=this.macroArgs)!=null?b:"")}render(y){const b=In.createBox(y,this.body);return b?(this.caret&&(b.caret=this.caret),this.bind(y,b)):null}},sl=class Rp extends In{constructor(){super({type:"macro-argument"})}static fromJson(y){return new Rp}toJson(){return super.toJson()}_serialize(y){return""}render(y){return null}},xl=class Np extends In{constructor(y,b,E=!1,ee,re){var ae;super({type:"prompt",mode:(ae=re==null?void 0:re.mode)!=null?ae:"math",style:re==null?void 0:re.style,command:"\\placeholder"}),this.body=ee,this.correctness=b,this.placeholderId=y,this.locked=E,this.captureSelection=this.locked}static fromJson(y){return new Np(y.placeholderId,y.correctness,y.locked,y.body,y)}toJson(){const y=super.toJson();return this.placeholderId&&(y.placeholderId=this.placeholderId),this.body||delete y.body,this.body&&(y.body=this.body.filter(b=>b.type!=="first").map(b=>b.toJson())),this.correctness&&(y.correctness=this.correctness),y.locked=this.locked,y}render(y){const b=new ya({parent:y}),E=b.getRegisterAsEm("fboxsep"),ee=E,re=E,ae=In.createBox(y,this.body);if(!ae)return null;ae.height||(ae.height=b.metrics.xHeight),ae.setStyle("vertical-align",-ae.height,"em"),this.correctness==="correct"?ae.setStyle("color","var(--correct-color, var(--ML__correct-color))"):this.correctness==="incorrect"&&ae.setStyle("color","var(--incorrect-color, var(--ML__incorrect-color))");const de=new sr(ae,{type:"ord"});de.setStyle("display","inline-block"),de.setStyle("height",ae.height+ae.depth,"em"),de.setStyle("vertical-align",-re,"em");let fe="ML__prompt ";this.locked?fe+=" ML__lockedPromptBox ":fe+=" ML__editablePromptBox ",this.correctness==="correct"?fe+=" ML__correctPromptBox ":this.correctness==="incorrect"&&(fe+=" ML__incorrectPromptBox "),this.containsCaret&&(fe+=" ML__focusedPromptBox ");const ge=new sr(null,{classes:fe,attributes:{part:"prompt"}});ge.height=de.height+re,ge.depth=de.depth+re,ge.width=de.width+2*ee,ge.setStyle("box-sizing","border-box"),ge.setStyle("position","absolute"),ge.setStyle("height",de.height+de.depth+2*re,"em"),ee===0&&ge.setStyle("width","100%"),ee!==0&&(ge.setStyle("width",`calc(100% + ${2*ee}em)`),ge.setStyle("top",E,"em"),ge.setStyle("left",-ee,"em")),(!this.body||this.body.length===1)&&(ge.width=3*ee,ge.setStyle("width",`calc(100% + ${3*ee}em)`),ge.setStyle("left",-1.5*ee,"em"));let xe="";this.correctness==="incorrect"&&(xe+='<line x1="3%" y1="97%" x2="97%" y2="3%" stroke-width="0.5" stroke="var(--incorrect-color, var(--ML__incorrect-color))" stroke-linecap="round" />'),xe&&(ge.svgOverlay=xe);const Be=new sr([ge,de],{classes:"ML__prompt-atom"});return Be.setStyle("position","relative"),Be.setStyle("display","inline-block"),Be.setStyle("line-height",0),Be.height=de.height+re+.2,Be.depth=de.depth+re,Be.left=ee,Be.right=ee,Be.setStyle("height",de.height+re,"em"),Be.setStyle("top",de.depth-de.height,"em"),Be.setStyle("vertical-align",de.depth+re,"em"),Be.setStyle("margin-left",.5,"em"),Be.setStyle("margin-right",.5,"em"),this.caret&&(Be.caret=this.caret),this.bind(b,this.attachSupsub(y,{base:Be}))}_serialize(y){var b;const E=(b=this.bodyToLatex(y))!=null?b:"";if(y.skipPlaceholders)return E;let ee="\\placeholder";return this.placeholderId&&(ee+=`[${this.placeholderId}]`),this.correctness==="correct"?ee+="[correct]":this.correctness==="incorrect"&&(ee+="[incorrect]"),this.locked&&(ee+="[locked]"),uo(ee,E)}},Zs=class Fp extends In{constructor(y){super({type:"subsup",style:y==null?void 0:y.style}),this.subsupPlacement="auto"}static fromJson(y){const b=new Fp(y);for(const E of su)y[E]&&b.setChildren(y[E],E);return b}render(y){var b;const E=new ya({parent:y,isPhantom:!0}),ee=this.leftSibling,re=(b=ee.render(E))!=null?b:new sr(null),ae=new sr(null);return ae.height=re.height,ae.depth=re.depth,this.attachSupsub(y,{base:ae,isCharacterBox:ee.isCharacterBox(),type:"ignore"})}_serialize(y){return this.supsubToLatex(y)}};function Po(a){return a?!/^(<$$>|<$>|<space>|<{>|<}>|#[0-9\?]|\\.+)$/.test(a):!1}var Vl=class{constructor(a,y,b){this.errors=[],this.index=0,this.endCount=0;var E,ee,re,ae;b!=null||(b={}),this.tokens=a,this.context=y instanceof ya&&!(b!=null&&b.parseMode)&&!b.mathstyle?y:new ya({from:y,mathstyle:b.mathstyle},b.style),this.args=(E=b.args)!=null?E:void 0,this.smartFence=this.context.smartFence,this.parsingContext={parent:void 0,mathlist:[],style:(ee=b.style)!=null?ee:{},parseMode:(re=b.parseMode)!=null?re:"math",mathstyle:(ae=b.mathstyle)!=null?ae:"displaystyle",tabular:!1}}beginContext(a){var y,b,E;const ee=this.parsingContext,re={parent:ee,mathlist:[],style:we({},ee.style),parseMode:(y=a==null?void 0:a.mode)!=null?y:ee.parseMode,mathstyle:(b=a==null?void 0:a.mathstyle)!=null?b:ee.mathstyle,tabular:(E=a==null?void 0:a.tabular)!=null?E:!1};this.parsingContext=re}endContext(){this.parsingContext=this.parsingContext.parent}onError(a){this.errors.push(we({before:pl(this.tokens.slice(this.index,this.index+10)),after:pl(this.tokens.slice(Math.max(0,this.index-10),this.index))},a))}get mathlist(){return this.parsingContext.mathlist}set mathlist(a){this.parsingContext.mathlist=a}get parseMode(){return this.parsingContext.parseMode}set parseMode(a){this.parsingContext.parseMode=a}get tabularMode(){return this.parsingContext.tabular}get style(){let a=this.parsingContext;for(;a;){if(a.style)return we({},a.style);a=a.parent}return{}}set style(a){this.parsingContext.style=a}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}next(){this.index+=1}get(){return this.endCount=0,this.index<this.tokens.length?this.tokens[this.index++]:""}peek(){return this.tokens[this.index]}match(a){return this.tokens[this.index]===a?(this.index++,!0):!1}lastSubsupAtom(){let a;return this.mathlist.length>0&&(a=this.mathlist[this.mathlist.length-1],a.type==="subsup"||a.subsupPlacement!==void 0)||(a=new Zs({style:this.style}),this.mathlist.push(a)),a}hasPattern(a){return a.test(this.tokens[this.index])}hasInfixCommand(){var a;const{index:y}=this;if(y<this.tokens.length&&this.tokens[y].startsWith("\\")){const b=Fr(this.tokens[y],this.parseMode);return!b||b.definitionType==="symbol"||b.ifMode&&!b.ifMode.includes(this.parseMode)?!1:(a=b.infix)!=null?a:!1}return!1}matchColumnSeparator(){return!this.tabularMode||this.peek()!=="&"?!1:(this.index++,!0)}matchRowSeparator(){if(!this.tabularMode)return!1;const a=this.peek();return a!=="\\\\"&&a!=="\\cr"&&a!=="\\tabularnewline"?!1:(this.index++,!0)}placeholder(){var a;const y=(a=this.args)==null?void 0:a.call(this,"?");return y?Xo(y,{parseMode:this.parseMode,mathstyle:"textstyle"}):[new hi({mode:this.parseMode,style:this.style})]}skipWhitespace(){for(;this.match("<space>"););}skipUntilToken(a){let y=this.tokens[this.index];for(;y&&y!==a;)y=this.tokens[++this.index];y===a&&this.index++}skipFiller(){for(;this.match("\\relax")||this.match("<space>"););}matchKeyword(a){const y=this.index;let b=this.end(),E="";for(;!b;){const re=this.get();Po(re)?(E+=re,b=this.end()||E.length>=a.length):b=!0}const ee=a.toUpperCase()===E.toUpperCase();return ee||(this.index=y),ee}scanString(){let a="";for(;!this.end();){const y=this.peek();if(y==="]")return a;if(y==="<space>")a+=" ";else if(y.startsWith("\\"))this.onError({code:"unexpected-command-in-string"}),a+=y.substring(1);else if(Po(y))a+=y;else return a;this.next()}return a}scanBalancedString(){let a="",y=this.end(),b=1;for(;!y;){const E=this.get();E==="<space>"?a+=" ":E==="<{>"?(a+="{",b+=1):E==="<}>"?(b-=1,b>0?a+="}":this.index-=1):E==="<$>"?a+="$":E==="<$$>"?a+="$$":a+=E,y=b===0||this.end()}return a}scanLiteralGroup(){var a;if(!this.match("<{>"))return"";let y="",b=1;for(;b>0&&!this.end();){const E=this.get();E==="<}>"?(b-=1,b>0&&(y+="}")):E==="<{>"?(b+=1,y+="{"):(/\\[a-zA-Z]+$/.test(y)&&/^[a-zA-Z]/.test(E)&&(y+=" "),y+=(a={"<space>":" ","<$$>":"$$","<$>":"$"}[E])!=null?a:E)}return y}scanNumber(a=!0){var y,b;let E=!1,ee=this.peek();for(;ee==="<space>"||ee==="+"||ee==="-";)this.get(),ee==="-"&&(E=!E),ee=this.peek();a=!!a;let re=10,ae=/\d/;if(this.match("'"))re=8,ae=/[0-7]/,a=!0;else if(this.match('"'))re=16,ae=/[\dA-F]/,a=!0;else if(this.match("x"))re=16,ae=/[\dA-Fa-f]/,a=!0;else if(this.match("`"))return ee=this.get(),ee?ee.length===2&&ee.startsWith("\\")?{number:(E?-1:1)*((y=ee.codePointAt(1))!=null?y:0),base:"alpha"}:{number:(E?-1:1)*((b=ee.codePointAt(0))!=null?b:0),base:"alpha"}:null;let de="";for(;this.hasPattern(ae);)de+=this.get();if(!a&&(this.match(".")||this.match(",")))for(de+=".";this.hasPattern(ae);)de+=this.get();const fe=a?Number.parseInt(de,re):Number.parseFloat(de);return Number.isNaN(fe)?null:{number:E?-fe:fe,base:re===16?"hexadecimal":re===8?"octal":"decimal"}}scanRegister(){var a;const y=this.index,b=this.scanNumber(!1);if(this.skipWhitespace(),this.match("\\relax"))return b;let E=!1;if(b===null)for(;;){const re=this.peek();if(re==="-")E=!E;else if(re!=="+")break;this.next(),this.skipWhitespace()}if(this.match("\\global")){this.skipWhitespace();const re=this.get();return re.startsWith("\\")?b?{register:re,global:!0,factor:(E?-1:1)*b.number}:E?{register:re,global:!0,factor:-1}:{register:re,global:!0}:(this.index=y,null)}let ee=this.get();return ee!=null&&ee.startsWith("\\")?(ee=ee.substring(1),this.context.registers[ee]?!E||b!==null?{register:ee,factor:(E?-1:1)*((a=b==null?void 0:b.number)!=null?a:1)}:{register:ee}:(this.index=y,null)):(this.index=y,null)}scanValue(){const a=this.scanRegister();if(a)return a;const y=this.index,b=this.scanGlueOrDimen();if(b&&("unit"in b||"glue"in b&&"unit"in b.glue))return b;this.index=y;const E=this.scanNumber();if(E)return E;if(this.end()||!Po(this.peek()))return null;const ee=this.scanString();return ee.length>0?{string:ee}:null}scanDimen(){const a=this.scanNumber(!1);if(a===null)return null;const y=a.number;this.skipWhitespace(),this.matchKeyword("true"),this.skipWhitespace();let b;return this.matchKeyword("pt")?b="pt":this.matchKeyword("mm")?b="mm":this.matchKeyword("cm")?b="cm":this.matchKeyword("ex")?b="ex":this.matchKeyword("px")?b="px":this.matchKeyword("em")?b="em":this.matchKeyword("bp")?b="bp":this.matchKeyword("dd")?b="dd":this.matchKeyword("pc")?b="pc":this.matchKeyword("in")?b="in":this.matchKeyword("mu")&&(b="mu"),b?{dimension:y,unit:b}:{dimension:y}}scanGlueOrDimen(){const a=this.scanDimen();if(a===null)return null;if(this.skipWhitespace(),this.match("\\relax"))return a;const y={glue:a};if(this.matchKeyword("plus")){const b=this.scanDimen();if(b)y.grow=b;else return y}if(this.skipWhitespace(),this.match("\\relax"))return y;if(this.skipWhitespace(),this.matchKeyword("minus")){const b=this.scanDimen();if(b)y.shrink=b;else return y}return!y.grow&&!y.shrink?a:y}scanColspec(){this.skipWhitespace();const a=[];for(;!this.end()&&!(this.peek()==="<}>"||this.peek()==="]");){const y=this.get();y==="c"||y==="r"||y==="l"?a.push({align:y}):y==="|"?a.push({separator:"solid"}):y===":"?a.push({separator:"dashed"}):y==="@"&&(this.match("<{>")&&(this.beginContext({mode:"math"}),a.push({gap:this.scan(b=>b==="<}>")}),this.endContext()),this.match("<}>")||this.onError({code:"unbalanced-braces"}))}return a}scanModeSet(){let a;if(this.match("\\(")&&(a="textstyle"),!a&&this.match("\\[")&&(a="displaystyle"),!a)return null;this.beginContext({mode:"math",mathstyle:a});const y=this.scan(b=>b===(a==="displaystyle"?"\\]":"\\)"));return this.match(a==="displaystyle"?"\\]":"\\)")||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),y}scanModeShift(){let a="";if(this.match("<$>")&&(a="<$>"),!a&&this.match("<$$>")&&(a="<$$>"),!a)return null;this.beginContext({mode:"math",mathstyle:"textstyle"});const y=this.scan(b=>b===a);return this.match(a)||this.onError({code:"unbalanced-mode-shift"}),this.endContext(),y}scanEnvironment(){if(!this.match("\\begin"))return null;const a=this.scanArgument("string");if(!a)return null;const y=Vt(a);if(!y)return this.onError({code:"unknown-environment",arg:a}),null;const b=[];if(y.params)for(const de of y.params)if(de.isOptional)b.push(this.scanOptionalArgument(de.type));else{const fe=this.scanArgument(de.type);fe||this.onError({code:"missing-argument",arg:a}),b.push(fe)}this.beginContext({tabular:y.tabular});const E=[],ee=[];let re=[],ae=!1;do if(this.end()&&(this.onError({code:"unbalanced-environment",arg:a}),ae=!0),!ae&&this.match("\\end")&&(this.scanArgument("string")!==a&&this.onError({code:"unbalanced-environment",arg:a}),ae=!0),!ae)if(this.matchColumnSeparator())re.push(this.mathlist),this.mathlist=[];else if(this.matchRowSeparator()){re.push(this.mathlist),this.mathlist=[];let de=null;this.skipWhitespace(),this.match("[")&&(de=this.scanDimen(),this.skipWhitespace(),this.match("]")),ee.push(de!=null?de:{dimension:0}),E.push(re),re=[]}else this.mathlist.push(...this.scan(de=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline"].includes(de)));while(!ae);return re.push(this.mathlist),re.length>0&&E.push(re),this.endContext(),y.createAtom(a,E,ee,b)}scanExpression(){const a=this.mathlist;if(this.mathlist=[],this.parseExpression()){const y=this.mathlist;return this.mathlist=a,y}return this.mathlist=a,null}scan(a){this.beginContext(),a||(a=ae=>ae==="<}>");let y="",b=null,E=[],ee=null;for(;!this.end()&&!a(this.peek());)this.hasInfixCommand()&&!y?(y=this.get(),b=Fr(y,"math"),b&&(E=this.scanArguments(b)[1]),ee=this.mathlist,this.mathlist=[]):this.parseExpression();let re;return y?(console.assert(!!b),E.unshift(this.mathlist),ee&&E.unshift(ee),re=[b.createAtom({command:y,args:E,style:this.style,mode:this.parseMode})]):re=this.mathlist,this.endContext(),re}scanGroup(){const a=this.index;if(!this.match("<{>"))return null;const y=this.scan(E=>E==="<}>");this.match("<}>")||this.onError({code:"unbalanced-braces"});const b=new Go(y,this.parseMode,this.style);return b.verbatimLatex=pl(this.tokens.slice(a,this.index)),b}scanSmartFence(){if(this.skipWhitespace(),!this.match("("))return null;this.beginContext();let a=1;for(;!this.end()&&a!==0;)this.match("(")&&(a+=1),this.match(")")&&(a-=1),a!==0&&this.parseExpression();const y=new za("",this.mathlist,{leftDelim:"(",rightDelim:a===0?")":"?"});return this.endContext(),y}scanDelim(){this.skipWhitespace();const a=this.peek();if(!a)return this.onError({code:"unexpected-end-of-string"}),null;if(!Po(a)&&!a.startsWith("\\"))return null;this.next();const y=Fr(a,"math");return y?y.definitionType==="function"&&y.ifMode&&!y.ifMode.includes(this.parseMode)?(this.onError({code:"unexpected-delimiter",arg:a}),null):y.definitionType==="symbol"&&(y.type==="mopen"||y.type==="mclose")||/^(\.|\?|\||<|>|\\vert|\\Vert|\\\||\\surd|\\uparrow|\\downarrow|\\Uparrow|\\Downarrow|\\updownarrow|\\Updownarrow|\\mid|\\mvert|\\mVert)$/.test(a)?a:(this.onError({code:"unexpected-delimiter",arg:a}),null):(this.onError({code:"unknown-command",arg:a}),null)}scanLeftRight(){var a;if(this.match("\\right"))return this.onError({code:"unbalanced-braces"}),new ys("\\right");if(this.match("\\mright"))return this.onError({code:"unbalanced-braces"}),new ys("\\mright");let y="\\right";if(!this.match("\\left")){if(!this.match("\\mleft"))return null;y="\\mright"}const b=this.scanDelim();if(!b)return this.onError({code:"unexpected-delimiter"}),new ys(y==="\\right"?"\\left":"\\mleft");for(this.beginContext();!this.end()&&!this.match(y);)this.parseExpression();const E=this.mathlist;this.endContext();const ee=(a=this.scanDelim())!=null?a:".";return new za(y==="\\right"?"left...right":"mleft...mright",E,{leftDelim:b,rightDelim:ee,style:this.style})}parseSupSub(){if(this.parseMode!=="math")return!1;let a=this.peek();if(a!=="^"&&a!=="_"&&a!=="'")return!1;const y=this.lastSubsupAtom();for(;a==="^"||a==="_"||a==="'";)this.match("'")?this.match("'")?y.addChild(new In({type:"mord",command:"\\doubleprime",mode:"math",value:"\u2032\u2032"}),"superscript"):y.addChild(new In({type:"mord",command:"\\prime",mode:"math",value:"\u2032"}),"superscript"):(this.match("^")||this.match("_"))&&y.addChildren(rt(this.scanArgument("expression")),a==="_"?"subscript":"superscript"),a=this.peek();return!0}parseLimits(){if(this.parseMode!=="math")return!1;const a=this.match("\\limits"),y=!a&&this.match("\\nolimits"),b=!y&&!a&&this.match("\\displaylimits");if(!a&&!y&&!b)return!1;const E=this.mathlist.length>0?this.mathlist[this.mathlist.length-1]:null;return E===null?!1:(E.explicitSubsupPlacement=!0,a&&(E.subsupPlacement="over-under"),y&&(E.subsupPlacement="adjacent"),b&&(E.subsupPlacement="auto"),!0)}scanArguments(a){if(!(a!=null&&a.params))return[void 0,[]];let y;const b=[];let E=a.infix?2:0;for(;E<a.params.length;){const ee=a.params[E];ee.type==="rest"?b.push(this.scan(re=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline","\\right"].includes(re))):ee.isOptional?b.push(this.scanOptionalArgument(ee.type)):ee.type.endsWith("*")?y=ee.type.slice(0,-1):b.push(this.scanArgument(ee.type)),E+=1}return[y,b]}scanSymbolOrLiteral(){const a=this.peek();if(!a)return null;this.next();let y;if(Po(a)){const b=Ss.createAtom(this.parseMode,a,we({},this.style));return b?[b]:null}if(y=this.scanMacro(a),y)return[y];if(a.startsWith("\\")){const b=Fr(a,this.parseMode);if(!b)return this.onError({code:"unknown-command",arg:a}),[new ys(a)];if(b.definitionType==="symbol"){const E=we({},this.style);b.variant&&(E.variant=b.variant),y=new In({type:b.type,command:a,style:E,value:String.fromCodePoint(b.codepoint),mode:this.parseMode,verbatimLatex:a})}else{if(b.applyMode||b.applyStyle||b.infix)return this.onError({code:"invalid-command",arg:a}),[new ys(a)];b.createAtom&&(y=b.createAtom({command:a,args:[],style:this.style,mode:this.parseMode}))}}return y?[y]:null}scanArgument(a){var y;this.skipFiller();const b=this.parseMode;if(a==="auto"&&(a=b),!this.match("<{>")){if(a==="string")return this.scanString();if(a==="value")return this.scanValue();if(a==="delim")return(y=this.scanDelim())!=null?y:".";if(a==="expression")return this.scanExpression();if(a==="math"){a!==b&&this.beginContext({mode:"math"});const ee=this.scanSymbolOrLiteral();return a!==b&&this.endContext(),ee}if(a==="text"){a!==b&&this.beginContext({mode:"text"});const ee=this.scanSymbolOrLiteral();return a!==b&&this.endContext(),ee}return a==="balanced-string"||console.assert(!1),null}if(a==="text"){this.beginContext({mode:"text"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const ee=this.mathlist;return this.endContext(),{group:ee}}if(a==="math"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const ee=this.mathlist;return this.endContext(),{group:ee}}let E=null;if(a==="expression"){this.beginContext({mode:"math"});do this.mathlist.push(...this.scan());while(!this.match("<}>")&&!this.end());const ee=this.mathlist;return this.endContext(),{group:ee}}return a==="string"?E=this.scanString():a==="balanced-string"?E=this.scanBalancedString():a==="colspec"?E=this.scanColspec():a==="value"&&(E=this.scanValue()),this.skipUntilToken("<}>"),E}scanOptionalArgument(a){if(a=a==="auto"?this.parseMode:a,this.skipFiller(),!this.match("["))return null;let y=null;for(;!this.end()&&!this.match("]");)if(a==="string")y=this.scanString();else if(a==="value")y=this.scanValue();else if(a==="colspec")y=this.scanColspec();else if(a==="bbox"){const b={},E=this.scanString().toLowerCase().trim().split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const ee of E){const re=ee.match(/^\s*([\d.]+)\s*([a-z]{2})/);if(re)b.padding={dimension:parseInt(re[1]),unit:re[2]};else{const ae=ee.match(/^\s*border\s*:\s*(.*)/);ae?b.border=ae[1]:b.backgroundcolor={string:ee}}}y=b}else a==="math"&&(this.beginContext({mode:"math"}),y=this.mathlist.concat(this.scan(b=>b==="]")),this.endContext());return y}scanSymbolOrCommand(a){var y,b,E;if(a==="\\placeholder"){const de=this.scanOptionalArgument("string"),fe=this.scanOptionalArgument("math"),ge=In.serialize(fe,{defaultMode:"math"});let xe=[],Be;!Be&&ge==="correct"?Be="correct":!Be&&ge==="incorrect"?Be="incorrect":ge!==""&&(xe=fe);const Ve=this.scanOptionalArgument("string")==="locked",ot=this.scanArgument("auto");let gt;return ot&&Array.isArray(ot)&&ot.length>0?gt=ot:ot&&typeof ot=="object"&&"group"in ot?gt=ot.group:gt=xe,de?[new xl(de,Be,Ve,gt!=null?gt:xe,{mode:this.parseMode,style:this.style})]:[new hi({mode:this.parseMode,style:this.style})]}if(a==="\\renewcommand"||a==="\\newcommand"||a==="\\providecommand"||a==="\\def"){const de=this.index,fe=this.scanLiteralGroup()||this.next();if(!fe)return null;if(this.context.registers[fe.substring(1)]){const ge=this.scanArgument("string");ge!==null&&(this.context.registers[fe.substring(1)]=ge);const xe=na([a,pl(this.tokens.slice(de,this.index))]);return[new In({type:"text",value:"",verbatimLatex:xe})]}}let ee=this.scanMacro(a);if(ee)return[ee];const re=Fr(a,this.parseMode);if(!re)return this.parseMode==="text"?(/[a-zA-Z]/.test((y=this.peek())!=null?y:"")&&(a+=" "),[...a].map(de=>new In({type:"text",value:de,mode:"text",style:this.style}))):(this.onError({code:"unknown-command",arg:a}),[new ys(a)]);const ae=this.index;if(re.definitionType==="symbol"){const de=we({},this.style);re.variant&&(de.variant=re.variant),ee=new In({type:re.type,command:a,style:de,value:String.fromCodePoint(re.codepoint),mode:this.parseMode})}else{if(re.ifMode&&!re.ifMode.includes(this.parseMode))return[];const de=this.parseMode;re.applyMode&&(this.parseMode=re.applyMode);let fe,ge=[];if(re.parse?ge=re.parse(this):[fe,ge]=this.scanArguments(re),this.parseMode=de,re.applyMode&&!re.applyStyle&&!re.createAtom)return rt(ge[0]);if(re.infix)return this.onError({code:"too-many-infix-commands",arg:a}),null;if(typeof re.createAtom=="function")ee=re.createAtom({command:a,args:ge,style:this.style,mode:this.parseMode}),fe&&(ee.body=rt(this.scanArgument(fe)));else if(typeof re.applyStyle=="function"){const xe=we(we({},this.style),re.applyStyle(a,ge,this.context)),Be=this.parseMode;if(re.applyMode&&(this.parseMode=re.applyMode),fe){const Ve=this.style;this.style=xe;const ot=this.scanArgument(fe);return this.style=Ve,this.parseMode=Be,rt(ot)}this.style=xe}else ee=new In({type:"mord",command:(b=re.command)!=null?b:a,style:we({},this.style),value:a,mode:(E=re.applyMode)!=null?E:this.parseMode})}if(!ee)return null;if(ee instanceof In&&ee.verbatimLatex===void 0&&!/^\\(llap|rlap|class|cssId|htmlData)$/.test(a)){const de=na([a,pl(this.tokens.slice(ae,this.index))]);de&&(ee.verbatimLatex=de)}if(ee.verbatimLatex===null&&(ee.verbatimLatex=void 0),ee.isFunction&&this.smartFence){const de=this.scanSmartFence();if(de)return[ee,de]}return[ee]}scanSymbolCommandOrLiteral(){const a=this.get();if(!a)return null;if(Po(a)){const y=Ss.createAtom(this.parseMode,a,we({},this.style));if(!y)return null;if(y.isFunction&&this.smartFence){const b=this.scanSmartFence();if(b)return[y,b]}return[y]}return a.startsWith("\\")?this.scanSymbolOrCommand(a):a==="<space>"?this.parseMode==="text"?[new al(" "," ",this.style)]:null:(a==="<}>"?this.onError({latex:"",code:"unbalanced-braces"}):this.onError({latex:"",code:"unexpected-token",arg:a}),null)}scanMacro(a){var y;const b=this.context.getMacro(a);if(!b)return null;const E=this.index,ee=b.args,re={"?":(y=this.args)==null?void 0:y.call(this,"?")};for(let ae=1;ae<=ee;ae++){let de=this.scanLiteralGroup();if(!de){const fe=this.index;this.scanExpression(),de=pl(this.tokens.slice(fe,this.index))}re[ae]=de}return new Ec(a,{expand:b.expand,captureSelection:b.captureSelection,args:E===this.index?null:pl(this.tokens.slice(E,this.index)),style:this.parsingContext.style,body:Xo(b.def,{context:this.context,parseMode:this.parseMode,args:ae=>re[ae],mathstyle:this.parsingContext.mathstyle,style:this.parsingContext.style})})}parseExpression(){var a,y,b,E;let ee=(E=(b=(y=(a=this.scanEnvironment())!=null?a:this.scanModeShift())!=null?y:this.scanModeSet())!=null?b:this.scanGroup())!=null?E:this.scanLeftRight();if(ee===null){if(this.parseSupSub()||this.parseLimits())return!0;ee=this.scanSymbolCommandOrLiteral()}return ee?(Array.isArray(ee)?this.mathlist.push(...ee):this.mathlist.push(ee),!0):!1}};function Xo(a,y){var b,E,ee,re;const ae=(b=y==null?void 0:y.args)!=null?b:void 0,de=new Vl(nl(a,ae),y==null?void 0:y.context,{args:ae,mathstyle:(E=y==null?void 0:y.mathstyle)!=null?E:"displaystyle",parseMode:(ee=y==null?void 0:y.parseMode)!=null?ee:"math",style:(re=y==null?void 0:y.style)!=null?re:{}}),fe=[];for(;!de.end();)fe.push(...de.scan(()=>!1));return fe}function t0(a,y){var b;const E=new Vl(nl(a,null),y==null?void 0:y.context,{mathstyle:"displaystyle",parseMode:(b=y==null?void 0:y.parseMode)!=null?b:"math"});for(;!E.end();)E.scan();return E.errors}var n0=class $p extends In{constructor(y,b){super({type:"chem"},{command:y,mode:"math"});const E=vo.go(rr.go(b,y==="\\pu"?"pu":"ce"),!1);this.body=Xo(E),this._verbatimLatex=y+"{"+b+"}",this.arg=b,this.captureSelection=!0}static fromJson(y){return new $p(y.command,y.arg)}set verbatimLatex(y){}get verbatimLatex(){return this._verbatimLatex}toJson(){return he(we({},super.toJson()),{arg:this.arg})}render(y){const b=In.createBox(y,this.body,{type:"inner"});return this.caret&&(b.caret=this.caret),this.bind(y,b)}_serialize(y){return console.assert(this.verbatimLatex!==void 0),this.verbatimLatex}};Rt(["ce","pu"],"{chemformula:balanced-string}",{createAtom:a=>{var y;return new n0(a.command,(y=a.args[0])!=null?y:"")}});var rr={go:function(a,y){if(!a)return[];y===void 0&&(y="ce");var b="0",E={};E.parenthesisLevel=0,a=a.replace(/\n/g," "),a=a.replace(/[\u2212\u2013\u2014\u2010]/g,"-"),a=a.replace(/[\u2026]/g,"...");for(var ee,re=10,ae=[];;){ee!==a?(re=10,ee=a):re--;var de=rr.stateMachines[y],fe=de.transitions[b]||de.transitions["*"];e:for(var ge=0;ge<fe.length;ge++){var xe=rr.patterns.match_(fe[ge].pattern,a);if(xe){for(var Be=fe[ge].task,Ve=0;Ve<Be.action_.length;Ve++){var ot;if(de.actions[Be.action_[Ve].type_])ot=de.actions[Be.action_[Ve].type_](E,xe.match_,Be.action_[Ve].option);else if(rr.actions[Be.action_[Ve].type_])ot=rr.actions[Be.action_[Ve].type_](E,xe.match_,Be.action_[Ve].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+Be.action_[Ve].type_+")"];rr.concatArray(ae,ot)}if(b=Be.nextState||b,a.length>0){if(Be.revisit||(a=xe.remainder),!Be.toContinue)break e}else return ae}}if(re<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(a,y){if(y)if(Object.prototype.toString.call(y)==="[object Array]")for(var b=0;b<y.length;b++)a.push(y[b]);else a.push(y)},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(a){var y=a.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 y&&y[0]?{match_:y.slice(1),remainder:a.substr(y[0].length)}:null},"(-)(9)^(-9)":function(a){var y=a.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);return y&&y[0]?{match_:y.slice(1),remainder:a.substr(y[0].length)}:null},"state of aggregation $":function(a){var y=rr.patterns.findObserveGroups(a,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(y&&y.remainder.match(/^($|[\s,;\)\]\}])/))return y;var b=a.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);return b?{match_:b[0],remainder:a.substr(b[0].length)}:null},"_{(state of aggregation)}$":/^_\{(\([a-z]{1,3}\))\}/,"{[(":/^(?:\\\{|\[|\()/,")]}":/^(?:\)|\]|\\\})/,", ":/^[,;]\s*/,",":/^[,;]/,".":/^[.]/,". ":/^([.\u22C5\u00B7\u2022])\s*/,"...":/^\.\.\.(?=$|[^.])/,"* ":/^([*])\s*/,"^{(...)}":function(a){return rr.patterns.findObserveGroups(a,"^{","","","}")},"^($...$)":function(a){return rr.patterns.findObserveGroups(a,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(a){return rr.patterns.findObserveGroups(a,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(a){return rr.patterns.findObserveGroups(a,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(a){return rr.patterns.findObserveGroups(a,"_{","","","}")},"_($...$)":function(a){return rr.patterns.findObserveGroups(a,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(a){return rr.patterns.findObserveGroups(a,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(a){return rr.patterns.findObserveGroups(a,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(a){return rr.patterns.findObserveGroups(a,"","{","}","")},"{(...)}":function(a){return rr.patterns.findObserveGroups(a,"{","","","}")},"$...$":function(a){return rr.patterns.findObserveGroups(a,"","$","$","")},"${(...)}$":function(a){return rr.patterns.findObserveGroups(a,"${","","","}$")},"$(...)$":function(a){return rr.patterns.findObserveGroups(a,"$","","","$")},"=<>":/^[=<>]/,"#":/^[#\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(a){return rr.patterns.findObserveGroups(a,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(a){return rr.patterns.findObserveGroups(a,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(a){return rr.patterns.findObserveGroups(a,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(a){return rr.patterns.findObserveGroups(a,"",/^\\[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(a){return rr.patterns.findObserveGroups(a,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(a){return rr.patterns.findObserveGroups(a,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(a){return rr.patterns.findObserveGroups(a,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(a){return rr.patterns.findObserveGroups(a,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(a){return rr.patterns.findObserveGroups(a,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(a){return rr.patterns.findObserveGroups(a,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(a){return rr.patterns.findObserveGroups(a,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(a){return rr.patterns.findObserveGroups(a,"\\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(a){var y;if(y=a.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))/),y)return{match_:y[0],remainder:a.substr(y[0].length)};var b=rr.patterns.findObserveGroups(a,"","$","$","");return b&&(y=b.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/),y)?{match_:y[0],remainder:a.substr(y[0].length)}:null},amount2:function(a){return this.amount(a)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(a){if(a.match(/^\([a-z]+\)$/))return null;var y=a.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return y?{match_:y[0],remainder:a.substr(y[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(a,y,b,E,ee,re,ae,de,fe,ge){var xe=function(rn,Vn){if(typeof Vn=="string")return rn.indexOf(Vn)!==0?null:Vn;var lr=rn.match(Vn);return lr?lr[0]:null},Be=function(rn,Vn,lr){for(var jn=0;Vn<rn.length;){var Kr=rn.charAt(Vn),ai=xe(rn.substr(Vn),lr);if(ai!==null&&jn===0)return{endMatchBegin:Vn,endMatchEnd:Vn+ai.length};if(Kr==="{")jn++;else if(Kr==="}"){if(jn===0)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];jn--}Vn++}return jn>0,null},Ve=xe(a,y);if(Ve===null||(a=a.substr(Ve.length),Ve=xe(a,b),Ve===null))return null;var ot=Be(a,Ve.length,E||ee);if(ot===null)return null;var gt=a.substring(0,E?ot.endMatchEnd:ot.endMatchBegin);if(re||ae){var ln=this.findObserveGroups(a.substr(ot.endMatchEnd),re,ae,de,fe);if(ln===null)return null;var ar=[gt,ln.match_];return{match_:ge?ar.join(""):ar,remainder:ln.remainder}}else return{match_:gt,remainder:a.substr(ot.endMatchEnd)}},match_:function(a,y){var b=rr.patterns.patterns[a];if(b===void 0)throw["MhchemBugP","mhchem bug P. Please report. ("+a+")"];if(typeof b=="function")return rr.patterns.patterns[a](y);var E=y.match(b);if(E){var ee;return E[2]?ee=[E[1],E[2]]:E[1]?ee=E[1]:ee=E[0],{match_:ee,remainder:y.substr(E[0].length)}}return null}},actions:{"a=":function(a,y){a.a=(a.a||"")+y},"b=":function(a,y){a.b=(a.b||"")+y},"p=":function(a,y){a.p=(a.p||"")+y},"o=":function(a,y){a.o=(a.o||"")+y},"q=":function(a,y){a.q=(a.q||"")+y},"d=":function(a,y){a.d=(a.d||"")+y},"rm=":function(a,y){a.rm=(a.rm||"")+y},"text=":function(a,y){a.text_=(a.text_||"")+y},insert:function(a,y,b){return{type_:b}},"insert+p1":function(a,y,b){return{type_:b,p1:y}},"insert+p1+p2":function(a,y,b){return{type_:b,p1:y[0],p2:y[1]}},copy:function(a,y){return y},rm:function(a,y){return{type_:"rm",p1:y||""}},text:function(a,y){return rr.go(y,"text")},"{text}":function(a,y){var b=["{"];return rr.concatArray(b,rr.go(y,"text")),b.push("}"),b},"tex-math":function(a,y){return rr.go(y,"tex-math")},"tex-math tight":function(a,y){return rr.go(y,"tex-math tight")},bond:function(a,y,b){return{type_:"bond",kind_:b||y}},"color0-output":function(a,y){return{type_:"color0",color:y[0]}},ce:function(a,y){return rr.go(y)},"1/2":function(a,y){var b=[];y.match(/^[+\-]/)&&(b.push(y.substr(0,1)),y=y.substr(1));var E=y.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return E[1]=E[1].replace(/\$/g,""),b.push({type_:"frac",p1:E[1],p2:E[2]}),E[3]&&(E[3]=E[3].replace(/\$/g,""),b.push({type_:"tex-math",p1:E[3]})),b},"9,9":function(a,y){return rr.go(y,"9,9")}},createTransitions:function(a){var y,b,E,ee,re={};for(y in a)for(b in a[y])for(E=b.split("|"),a[y][b].stateArray=E,ee=0;ee<E.length;ee++)re[E[ee]]=[];for(y in a)for(b in a[y])for(E=a[y][b].stateArray||[],ee=0;ee<E.length;ee++){var ae=a[y][b];if(ae.action_){ae.action_=[].concat(ae.action_);for(var de=0;de<ae.action_.length;de++)typeof ae.action_[de]=="string"&&(ae.action_[de]={type_:ae.action_[de]})}else ae.action_=[];for(var fe=y.split("|"),ge=0;ge<fe.length;ge++)if(E[ee]==="*")for(var xe in re)re[xe].push({pattern:fe[ge],task:ae});else re[E[ee]].push({pattern:fe[ge],task:ae})}return re},stateMachines:{}};rr.stateMachines={ce:{transitions:rr.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(a,y){var b;if((a.d||"").match(/^[0-9]+$/)){var E=a.d;a.d=void 0,b=this.output(a),a.b=E}else b=this.output(a);return rr.actions["o="](a,y),b},"d= kv":function(a,y){a.d=y,a.dType="kv"},"charge or bond":function(a,y){if(a.beginsWithBond){var b=[];return rr.concatArray(b,this.output(a)),rr.concatArray(b,rr.actions.bond(a,y,"-")),b}else a.d=y},"- after o/d":function(a,y,b){var E=rr.patterns.match_("orbital",a.o||""),ee=rr.patterns.match_("one lowercase greek letter $",a.o||""),re=rr.patterns.match_("one lowercase latin letter $",a.o||""),ae=rr.patterns.match_("$one lowercase latin letter$ $",a.o||""),de=y==="-"&&(E&&E.remainder===""||ee||re||ae);de&&!a.a&&!a.b&&!a.p&&!a.d&&!a.q&&!E&&re&&(a.o="$"+a.o+"$");var fe=[];return de?(rr.concatArray(fe,this.output(a)),fe.push({type_:"hyphen"})):(E=rr.patterns.match_("digits",a.d||""),b&&E&&E.remainder===""?(rr.concatArray(fe,rr.actions["d="](a,y)),rr.concatArray(fe,this.output(a))):(rr.concatArray(fe,this.output(a)),rr.concatArray(fe,rr.actions.bond(a,y,"-")))),fe},"a to o":function(a){a.o=a.a,a.a=void 0},"sb=true":function(a){a.sb=!0},"sb=false":function(a){a.sb=!1},"beginsWithBond=true":function(a){a.beginsWithBond=!0},"beginsWithBond=false":function(a){a.beginsWithBond=!1},"parenthesisLevel++":function(a){a.parenthesisLevel++},"parenthesisLevel--":function(a){a.parenthesisLevel--},"state of aggregation":function(a,y){return{type_:"state of aggregation",p1:rr.go(y,"o")}},comma:function(a,y){var b=y.replace(/\s*$/,""),E=b!==y;return E&&a.parenthesisLevel===0?{type_:"comma enumeration L",p1:b}:{type_:"comma enumeration M",p1:b}},output:function(a,y,b){var E;if(!a.r)E=[],!a.a&&!a.b&&!a.p&&!a.o&&!a.q&&!a.d&&!b||(a.sb&&E.push({type_:"entitySkip"}),!a.o&&!a.q&&!a.d&&!a.b&&!a.p&&b!==2?(a.o=a.a,a.a=void 0):!a.o&&!a.q&&!a.d&&(a.b||a.p)?(a.o=a.a,a.d=a.b,a.q=a.p,a.a=a.b=a.p=void 0):a.o&&a.dType==="kv"&&rr.patterns.match_("d-oxidation$",a.d||"")?a.dType="oxidation":a.o&&a.dType==="kv"&&!a.q&&(a.dType=void 0),E.push({type_:"chemfive",a:rr.go(a.a,"a"),b:rr.go(a.b,"bd"),p:rr.go(a.p,"pq"),o:rr.go(a.o,"o"),q:rr.go(a.q,"pq"),d:rr.go(a.d,a.dType==="oxidation"?"oxidation":"bd"),dType:a.dType}));else{var ee;a.rdt==="M"?ee=rr.go(a.rd,"tex-math"):a.rdt==="T"?ee=[{type_:"text",p1:a.rd||""}]:ee=rr.go(a.rd);var re;a.rqt==="M"?re=rr.go(a.rq,"tex-math"):a.rqt==="T"?re=[{type_:"text",p1:a.rq||""}]:re=rr.go(a.rq),E={type_:"arrow",r:a.r,rd:ee,rq:re}}for(var ae in a)ae!=="parenthesisLevel"&&ae!=="beginsWithBond"&&delete a[ae];return E},"oxidation-output":function(a,y){var b=["{"];return rr.concatArray(b,rr.go(y,"oxidation")),b.push("}"),b},"frac-output":function(a,y){return{type_:"frac-ce",p1:rr.go(y[0]),p2:rr.go(y[1])}},"overset-output":function(a,y){return{type_:"overset",p1:rr.go(y[0]),p2:rr.go(y[1])}},"underset-output":function(a,y){return{type_:"underset",p1:rr.go(y[0]),p2:rr.go(y[1])}},"underbrace-output":function(a,y){return{type_:"underbrace",p1:rr.go(y[0]),p2:rr.go(y[1])}},"color-output":function(a,y){return{type_:"color",color1:y[0],color2:rr.go(y[1])}},"r=":function(a,y){a.r=y},"rdt=":function(a,y){a.rdt=y},"rd=":function(a,y){a.rd=y},"rqt=":function(a,y){a.rqt=y},"rq=":function(a,y){a.rq=y},operator:function(a,y,b){return{type_:"operator",kind_:b||y}}}},a:{transitions:rr.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:rr.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:rr.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(a){if(a.text_){var y={type_:"text",p1:a.text_};for(var b in a)delete a[b];return y}}}},pq:{transitions:rr.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(a,y){return{type_:"state of aggregation subscript",p1:rr.go(y,"o")}},"color-output":function(a,y){return{type_:"color",color1:y[0],color2:rr.go(y[1],"pq")}}}},bd:{transitions:rr.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(a,y){return{type_:"color",color1:y[0],color2:rr.go(y[1],"bd")}}}},oxidation:{transitions:rr.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(a,y){return{type_:"roman numeral",p1:y||""}}}},"tex-math":{transitions:rr.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(a){if(a.o){var y={type_:"tex-math",p1:a.o};for(var b in a)delete a[b];return y}}}},"tex-math tight":{transitions:rr.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(a,y){a.o=(a.o||"")+"{"+y+"}"},output:function(a){if(a.o){var y={type_:"tex-math",p1:a.o};for(var b in a)delete a[b];return y}}}},"9,9":{transitions:rr.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:rr.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(a,y){var b=[];return y[0]==="+-"||y[0]==="+/-"?b.push("\\pm "):y[0]&&b.push(y[0]),y[1]&&(rr.concatArray(b,rr.go(y[1],"pu-9,9")),y[2]&&(y[2].match(/[,.]/)?rr.concatArray(b,rr.go(y[2],"pu-9,9")):b.push(y[2])),(y[3]||y[4])&&(y[3]==="e"||y[4]==="*"?b.push({type_:"cdot"}):b.push({type_:"times"}))),y[5]&&b.push("10^{"+y[5]+"}"),b},"number^":function(a,y){var b=[];return y[0]==="+-"||y[0]==="+/-"?b.push("\\pm "):y[0]&&b.push(y[0]),rr.concatArray(b,rr.go(y[1],"pu-9,9")),b.push("^{"+y[2]+"}"),b},operator:function(a,y,b){return{type_:"operator",kind_:b||y}},space:function(){return{type_:"pu-space-1"}},output:function(a){var y,b=rr.patterns.match_("{(...)}",a.d||"");b&&b.remainder===""&&(a.d=b.match_);var E=rr.patterns.match_("{(...)}",a.q||"");if(E&&E.remainder===""&&(a.q=E.match_),a.d&&(a.d=a.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),a.d=a.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),a.q){a.q=a.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),a.q=a.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F");var ee={d:rr.go(a.d,"pu"),q:rr.go(a.q,"pu")};a.o==="//"?y={type_:"pu-frac",p1:ee.d,p2:ee.q}:(y=ee.d,ee.d.length>1||ee.q.length>1?y.push({type_:" / "}):y.push({type_:"/"}),rr.concatArray(y,ee.q))}else y=rr.go(a.d,"pu-2");for(var re in a)delete a[re];return y}}},"pu-2":{transitions:rr.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(a,y){a.rm+="^{"+y+"}"},space:function(){return{type_:"pu-space-2"}},output:function(a){var y=[];if(a.rm){var b=rr.patterns.match_("{(...)}",a.rm||"");b&&b.remainder===""?y=rr.go(b.match_,"pu"):y={type_:"rm",p1:a.rm}}for(var E in a)delete a[E];return y}}},"pu-9,9":{transitions:rr.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(a){var y=[];if(a.text_=a.text_||"",a.text_.length>4){var b=a.text_.length%3;b===0&&(b=3);for(var E=a.text_.length-3;E>0;E-=3)y.push(a.text_.substr(E,3)),y.push({type_:"1000 separator"});y.push(a.text_.substr(0,b)),y.reverse()}else y.push(a.text_);for(var ee in a)delete a[ee];return y},"output-o":function(a){var y=[];if(a.text_=a.text_||"",a.text_.length>4){for(var b=a.text_.length-3,E=0;E<b;E+=3)y.push(a.text_.substr(E,3)),y.push({type_:"1000 separator"});y.push(a.text_.substr(E))}else y.push(a.text_);for(var ee in a)delete a[ee];return y}}}};var vo={go:function(a,y){if(!a)return"";for(var b="",E=!1,ee=0;ee<a.length;ee++){var re=a[ee];typeof re=="string"?b+=re:(b+=vo._go2(re),re.type_==="1st-level escape"&&(E=!0))}return!y&&!E&&b&&(b="{"+b+"}"),b},_goInner:function(a){return a&&vo.go(a,!0)},_go2:function(a){var y;switch(a.type_){case"chemfive":y="";var b={a:vo._goInner(a.a),b:vo._goInner(a.b),p:vo._goInner(a.p),o:vo._goInner(a.o),q:vo._goInner(a.q),d:vo._goInner(a.d)};b.a&&(b.a.match(/^[+\-]/)&&(b.a="{"+b.a+"}"),y+=b.a+"\\,"),(b.b||b.p)&&(y+="{\\vphantom{X}}",y+="^{\\hphantom{"+(b.b||"")+"}}_{\\hphantom{"+(b.p||"")+"}}",y+="{\\vphantom{X}}",y+="^{\\smash[t]{\\vphantom{2}}\\llap{"+(b.b||"")+"}}",y+="_{\\vphantom{2}\\llap{\\smash[t]{"+(b.p||"")+"}}}"),b.o&&(b.o.match(/^[+\-]/)&&(b.o="{"+b.o+"}"),y+=b.o),a.dType==="kv"?((b.d||b.q)&&(y+="{\\vphantom{X}}"),b.d&&(y+="^{"+b.d+"}"),b.q&&(y+="_{\\smash[t]{"+b.q+"}}")):a.dType==="oxidation"?(b.d&&(y+="{\\vphantom{X}}",y+="^{"+b.d+"}"),b.q&&(y+="{\\vphantom{X}}",y+="_{\\smash[t]{"+b.q+"}}")):(b.q&&(y+="{\\vphantom{X}}",y+="_{\\smash[t]{"+b.q+"}}"),b.d&&(y+="{\\vphantom{X}}",y+="^{"+b.d+"}"));break;case"rm":y="\\mathrm{"+a.p1+"}";break;case"text":a.p1.match(/[\^_]/)?(a.p1=a.p1.replace(" ","~").replace("-","\\text{-}"),y="\\mathrm{"+a.p1+"}"):y="\\text{"+a.p1+"}";break;case"roman numeral":y="\\mathrm{"+a.p1+"}";break;case"state of aggregation":y="\\mskip2mu "+vo._goInner(a.p1);break;case"state of aggregation subscript":y="\\mskip1mu "+vo._goInner(a.p1);break;case"bond":if(y=vo._getBond(a.kind_),!y)throw["MhchemErrorBond","mhchem Error. Unknown bond type ("+a.kind_+")"];break;case"frac":var E="\\frac{"+a.p1+"}{"+a.p2+"}";y="\\mathchoice{\\textstyle"+E+"}{"+E+"}{"+E+"}{"+E+"}";break;case"pu-frac":var ee="\\frac{"+vo._goInner(a.p1)+"}{"+vo._goInner(a.p2)+"}";y="\\mathchoice{\\textstyle"+ee+"}{"+ee+"}{"+ee+"}{"+ee+"}";break;case"tex-math":y=a.p1+" ";break;case"frac-ce":y="\\frac{"+vo._goInner(a.p1)+"}{"+vo._goInner(a.p2)+"}";break;case"overset":y="\\overset{"+vo._goInner(a.p1)+"}{"+vo._goInner(a.p2)+"}";break;case"underset":y="\\underset{"+vo._goInner(a.p1)+"}{"+vo._goInner(a.p2)+"}";break;case"underbrace":y="\\underbrace{"+vo._goInner(a.p1)+"}_{"+vo._goInner(a.p2)+"}";break;case"color":y="{\\color{"+a.color1+"}{"+vo._goInner(a.color2)+"}}";break;case"color0":y="\\color{"+a.color+"}";break;case"arrow":var re={rd:vo._goInner(a.rd),rq:vo._goInner(a.rq)},ae=vo._getArrow(a.r);re.rd||re.rq?a.r==="<=>"||a.r==="<=>>"||a.r==="<<=>"||a.r==="<-->"?(ae="\\long"+ae,re.rd&&(ae="\\overset{"+re.rd+"}{"+ae+"}"),re.rq&&(a.r==="<-->"?ae="\\underset{\\lower2mu{"+re.rq+"}}{"+ae+"}":ae="\\underset{\\lower6mu{"+re.rq+"}}{"+ae+"}"),ae=" {}\\mathrel{"+ae+"}{} "):(re.rq&&(ae+="[{"+re.rq+"}]"),ae+="{"+re.rd+"}",ae=" {}\\mathrel{\\x"+ae+"}{} "):ae=" {}\\mathrel{\\long"+ae+"}{} ",y=ae;break;case"operator":y=vo._getOperator(a.kind_);break;case"1st-level escape":y=a.p1+" ";break;case"space":y=" ";break;case"entitySkip":y="~";break;case"pu-space-1":y="~";break;case"pu-space-2":y="\\mkern3mu ";break;case"1000 separator":y="\\mkern2mu ";break;case"commaDecimal":y="{,}";break;case"comma enumeration L":y="{"+a.p1+"}\\mkern6mu ";break;case"comma enumeration M":y="{"+a.p1+"}\\mkern3mu ";break;case"comma enumeration S":y="{"+a.p1+"}\\mkern1mu ";break;case"hyphen":y="\\text{-}";break;case"addition compound":y="\\,{\\cdot}\\,";break;case"electron dot":y="\\mkern1mu \\bullet\\mkern1mu ";break;case"KV x":y="{\\times}";break;case"prime":y="\\prime ";break;case"cdot":y="\\cdot ";break;case"tight cdot":y="\\mkern1mu{\\cdot}\\mkern1mu ";break;case"times":y="\\times ";break;case"circa":y="{\\sim}";break;case"^":y="uparrow";break;case"v":y="downarrow";break;case"ellipsis":y="\\ldots ";break;case"/":y="/";break;case" / ":y="\\,/\\,";break;default:throw["MhchemBugT","mhchem bug T. Please report."]}return y},_getArrow:function(a){switch(a){case"->":return"rightarrow";case"\u2192":return"rightarrow";case"\u27F6":return"rightarrow";case"<-":return"leftarrow";case"<->":return"leftrightarrow";case"<-->":return"leftrightarrows";case"<=>":return"rightleftharpoons";case"\u21CC":return"rightleftharpoons";case"<=>>":return"Rightleftharpoons";case"<<=>":return"Leftrightharpoons";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getBond:function(a){switch(a){case"-":return"{-}";case"1":return"{-}";case"=":return"{=}";case"2":return"{=}";case"#":return"{\\equiv}";case"3":return"{\\equiv}";case"~":return"{\\tripledash}";case"~-":return"{\\rlap{\\lower.1em{-}}\\raise.1em{\\tripledash}}";case"~=":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"~--":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}";case"-~-":return"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.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(a){switch(a){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 E1(a){}function _1(a){}var r0=class zp extends In{constructor(y){super(he(we({},y),{type:"delim"})),this.value=y.delim,this.size=y.size}static fromJson(y){return new zp(y)}toJson(){return he(we({},super.toJson()),{delim:this.value,size:this.size})}render(y){return new sr(this.value,{type:"middle"})}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Fr(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):uo(this.command,this.value)}},i0=class Kp extends In{constructor(y){super(he(we({},y),{type:"sizeddelim",value:y.delim})),this.delimType=y.delimType,this.size=y.size}static fromJson(y){return new Kp(y)}toJson(){return he(we({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(y){let b=Gt(this.value,this.size,y,{classes:{open:"mopen",close:"mclose"}[this.delimType],type:this.delimType,isSelected:this.isSelected});return b?(b=this.bind(y,b),this.caret&&(b.caret=this.caret),b):null}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Fr(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):uo(this.command,this.value)}},bd=class Hp extends In{constructor(y,b,E,ee){var re,ae;super({type:"enclose",command:y,style:ee.style}),this.body=b,this.backgroundcolor=ee.backgroundcolor,E.updiagonalarrow&&(E.updiagonalstrike=!1),E.box&&(E.left=!1,E.right=!1,E.bottom=!1,E.top=!1),this.notation=E,this.shadow=(re=ee.shadow)!=null?re:"none",this.strokeWidth=(ae=ee.strokeWidth)!=null?ae:"0.06em",this.strokeWidth||(this.strokeWidth="0.06em"),this.strokeStyle=ee.strokeStyle,this.svgStrokeStyle=ee.svgStrokeStyle,this.strokeColor=ee.strokeColor,this.borderStyle=ee.borderStyle,this.padding=ee.padding,this.captureSelection=!1}static fromJson(y){return new Hp(y.command,y.body,y.notation,y)}toJson(){return he(we({},super.toJson()),{notation:this.notation,shadow:this.shadow,strokeWidth:this.strokeWidth,strokeStyle:this.strokeStyle,svgStrokeStyle:this.svgStrokeStyle,strokeColor:this.strokeColor,borderStyle:this.borderStyle,padding:this.padding})}_serialize(y){var b;if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const E=Fr(this.command,this.mode);if(E!=null&&E.serialize)return E.serialize(this,y);let ee=(b=this.command)!=null?b:"";if(this.command==="\\enclose"){ee+="{"+Object.keys(this.notation).join(" ")+"}";let re="",ae="";this.backgroundcolor&&this.backgroundcolor!=="transparent"&&(re+=ae+'mathbackground="'+this.backgroundcolor+'"',ae=","),this.shadow&&this.shadow!=="auto"&&(re+=ae+'shadow="'+this.shadow+'"',ae=","),this.strokeWidth||this.strokeStyle!=="solid"?(re+=ae+this.borderStyle,ae=","):this.strokeColor&&this.strokeColor!=="currentColor"&&(re+=ae+'mathcolor="'+this.strokeColor+'"',ae=","),re&&(ee+=`[${re}]`)}return uo(ee,this.bodyToLatex(y))}render(y){const b=new ya({parent:y},this.style),E=In.createBox(b,this.body);if(!E)return null;const ee=im(this.borderStyle),re=b.toEm(!this.padding||this.padding==="auto"?{register:"fboxsep"}:{string:this.padding});E.setStyle("position","relative"),E.setStyle("display","inline-block"),E.setStyle("top",re,"em"),E.setStyle("height",E.height+E.depth,"em"),E.setStyle("width",E.width,"em");const ae=new sr(null,{classes:"ML__notation"});let de=E.height+E.depth+2*re;const fe=E.width+2*re;let ge="";if(this.notation.horizontalstrike&&(ge+=this.line(3,50,97,50)),this.notation.verticalstrike&&(ge+=this.line(50,3,50,97)),this.notation.updiagonalstrike&&(ge+=this.line(3,97,97,3)),this.notation.downdiagonalstrike&&(ge+=this.line(3,3,97,97)),this.notation.updiagonalarrow){ge+=this.line(re.toString(),(re+E.depth+E.height).toString(),(re+E.width).toString(),re.toString());const gt=.03*Math.sqrt(fe*fe+de*de)*1,ln=E.width*gt,ar=(E.depth+E.height)*gt,rn=re+E.width;let Vn=re;Vn+ar-.4*ln<0&&(Vn=.4*ln-ar),ge+='<polygon points="',ge+=`${rn},${Vn} ${rn-ln-.4*ar},${Vn+ar-.4*ln} `,ge+=`${rn-.7*ln},${Vn+.7*ar} ${rn-ln+.4*ar},${Vn+ar+.4*ln} `,ge+=`${rn},${Vn}`,ge+=`" stroke='none' fill="${this.strokeColor}"`,ge+="/>"}let xe=0;if(this.notation.phasorangle){const Ve=a0(b),ot=(E.height+E.depth+2*Ve+re).toString(),gt=(E.height+E.depth)/2;ge+=this.line(re.toString(),ot,(re+gt+E.width).toString(),ot),ge+=this.line(re.toString(),ot,(re+gt).toString(),(re-Ve).toString()),de+=Ve,xe=gt,E.left+=de/2-re}if(this.notation.longdiv){const Ve=a0(b);de+=Ve,ge+=this.line(re.toString(),re.toString(),(re+E.width).toString(),re.toString());const ot=.3;xe=ot+Ve,E.left+=ot+Ve,E.setTop(re+Ve),ge+='<path d="',ge+=`M ${re} ${re} a${ot} ${(E.depth+E.height+2*Ve)/2}, 0, 1, 1, 0 ${E.depth+E.height+2*Ve} "`,ge+=` stroke-width="${am(b)}" stroke="${this.strokeColor}" fill="none"`,ge+="/>"}if(ae.width=E.width+2*re+xe,ae.height=E.height+re,ae.depth=E.depth+re,ae.setStyle("box-sizing","border-box"),ae.setStyle("left",`calc(-${ee} / 2 )`),ae.setStyle("height",`${Math.floor(100*de)/100}em`),ae.setStyle("top",`calc(${ee} / 2 )`),this.backgroundcolor&&ae.setStyle("background-color",this.backgroundcolor),this.notation.box&&ae.setStyle("border","1px solid red"),this.notation.actuarial&&(ae.setStyle("border-top",this.borderStyle),ae.setStyle("border-right",this.borderStyle)),this.notation.madruwb&&(ae.setStyle("border-bottom",this.borderStyle),ae.setStyle("border-right",this.borderStyle)),this.notation.roundedbox&&(ae.setStyle("border-radius","8px"),ae.setStyle("border",this.borderStyle)),this.notation.circle&&(ae.setStyle("border-radius","50%"),ae.setStyle("border",this.borderStyle)),this.notation.top&&ae.setStyle("border-top",this.borderStyle),this.notation.left&&ae.setStyle("border-left",this.borderStyle),this.notation.right&&ae.setStyle("border-right",this.borderStyle),this.notation.bottom&&ae.setStyle("border-bottom",this.borderStyle),ge){let Ve="";this.shadow==="auto"&&(Ve+="filter: drop-shadow(0 0 .5px rgba(255, 255, 255, .7)) drop-shadow(1px 1px 2px #333)"),this.shadow!=="none"&&(Ve+=`filter: drop-shadow(${this.shadow})`),Ve+=` stroke-width="${this.strokeWidth}" stroke="${this.strokeColor}"`,Ve+=' stroke-linecap="round"',this.svgStrokeStyle&&(Ve+=` stroke-dasharray="${this.svgStrokeStyle}"`),ae.svgStyle=Ve,ae.svgOverlay=ge}const Be=new sr([ae,E]);return Be.setStyle("position","relative"),Be.setStyle("vertical-align",re,"em"),Be.setStyle("height",`${Math.floor(100*(E.height+E.depth+2*re))/100}em`),Be.setStyle("display","inline-block"),Be.height=ae.height,Be.depth=ae.depth,Be.width=ae.width-2*re,Be.left=re,Be.right=re,this.caret&&(Be.caret=this.caret),Be.wrap(b)}line(y,b,E,ee){return`<line x1="${bf(y)}" y1="${bf(b)}" x2="${bf(E)}" y2="${bf(ee)}" vector-effect="non-scaling-stroke"></line>`}};function bf(a){return typeof a=="number"?`${Math.floor(100*a)/100}%`:a}function im(a){if(!a)return"1px";const y=a.match(/([0-9][a-zA-Z\%]+)/);return y===null?"1px":y[1]}function am(a){return(Math.floor(100*a.metrics.sqrtRuleThickness/a.scalingFactor)/100/10).toString()+"em"}function a0(a){const y=a.isDisplayStyle?el:a.metrics.defaultRuleThickness;return a.metrics.defaultRuleThickness+a.scalingFactor*y/4}var _c=class Wp extends In{constructor(y,b,E){var ee,re;super(he(we({},E),{type:"genfrac",displayContainsHighlight:!0})),this.above=y,this.below=b,this.hasBarLine=(ee=E==null?void 0:E.hasBarLine)!=null?ee:!0,this.continuousFraction=(re=E==null?void 0:E.continuousFraction)!=null?re:!1,this.numerPrefix=E==null?void 0:E.numerPrefix,this.denomPrefix=E==null?void 0:E.denomPrefix,this.mathstyleName=E==null?void 0:E.mathstyleName,this.leftDelim=E==null?void 0:E.leftDelim,this.rightDelim=E==null?void 0:E.rightDelim,this.fractionNavigationOrder=E==null?void 0:E.fractionNavigationOrder}static fromJson(y){return new Wp(y.above,y.below,y)}toJson(){const y={};return this.continuousFraction&&(y.continuousFraction=!0),this.numerPrefix&&(y.numerPrefix=this.numerPrefix),this.denomPrefix&&(y.denomPrefix=this.denomPrefix),this.leftDelim&&(y.leftDelim=this.leftDelim),this.rightDelim&&(y.rightDelim=this.rightDelim),this.hasBarLine||(y.hasBarLine=!1),this.mathstyleName&&(y.mathstyleName=this.mathstyleName),this.fractionNavigationOrder&&(y.fractionNavigationOrder=this.fractionNavigationOrder),we(we({},super.toJson()),y)}get children(){if(this._children)return this._children;const y=[];if(this.fractionNavigationOrder==="denominator-numerator"){for(const b of this.below)y.push(...b.children),y.push(b);for(const b of this.above)y.push(...b.children),y.push(b)}else{for(const b of this.above)y.push(...b.children),y.push(b);for(const b of this.below)y.push(...b.children),y.push(b)}return this._children=y,y}render(y){var b,E;const ee=new ya({parent:y,mathstyle:this.mathstyleName},this.style),re=ee.metrics,ae=new ya({parent:ee,mathstyle:this.continuousFraction?"":"numerator"},this.style),de=this.numerPrefix?new sr([new sr(this.numerPrefix),In.createBox(ae,this.above)],{isTight:ae.isTight,type:"ignore"}):(b=In.createBox(ae,this.above,{type:"ignore"}))!=null?b:new sr(null,{type:"ignore"}),fe=new ya({parent:ee,mathstyle:this.continuousFraction?"":"denominator"},this.style),ge=this.denomPrefix?new sr([new sr(this.denomPrefix),In.createBox(fe,this.below,{type:"ignore"})]):(E=In.createBox(fe,this.below,{type:"ignore"}))!=null?E:new sr(null,{type:"ignore"}),xe=this.hasBarLine?re.defaultRuleThickness:0;let Be,Ve=0,ot;ee.isDisplayStyle?(Be=ae.metrics.num1,Ve=xe>0?3*xe:7*xe,ot=fe.metrics.denom1):(xe>0?(Be=ae.metrics.num2,Ve=xe):(Be=ae.metrics.num3,Ve=3*re.defaultRuleThickness),ot=fe.metrics.denom2);const gt=[];this.isSelected&&gt.push("ML__selected");const ln=de.depth,ar=ge.height;let rn;if(xe<=0){const jr=Be-ln-(ar-ot);jr<Ve&&(Be+=(Ve-jr)/2,ot+=(Ve-jr)/2),rn=new Ja({individualShift:[{box:de,shift:-Be,classes:[...gt,"ML__center"]},{box:ge,shift:ot,classes:[...gt,"ML__center"]}]}).wrap(ee)}else{const jr=new sr(null,{classes:"ML__frac-line",mode:this.mode,style:this.style});jr.softWidth=Math.max(de.width,ge.width),jr.height=xe/2,jr.depth=xe/2;const _a=os+xe/2;Be<Ve+ln+_a&&(Be=Ve+ln+_a);const qa=os-xe/2;ot<Ve+ar-qa&&(ot=Ve+ar-qa),rn=new Ja({individualShift:[{box:ge,shift:ot,classes:[...gt,"ML__center"]},{box:jr,shift:-qa,classes:gt},{box:de,shift:-Be,classes:[...gt,"ML__center"]}]}).wrap(ee)}const Vn=ee.isDisplayStyle?re.delim1:re.delim2,lr=this.leftDelim?this.bind(y,Or("open",this.leftDelim,Vn,!0,y,{style:this.style,mode:this.mode,isSelected:this.isSelected})):Rr(ee,"open");let jn=null;this.continuousFraction?jn=new sr(null,{type:"close"}):this.rightDelim?jn=this.bind(y,Or("close",this.rightDelim,Vn,!0,y,{style:this.style,mode:this.mode,isSelected:this.isSelected})):jn=Rr(ee,"close");const Kr=new sr([lr,rn,jn],{isTight:ee.isTight,type:"inner",classes:"mfrac"}),ai=this.bind(y,Kr);return this.caret&&(ai.caret=this.caret),this.attachSupsub(y,{base:ai})}},ns=class Vp extends In{constructor(y,b){var E;super({type:"latex",value:y,mode:"latex"}),this.isSuggestion=(E=b==null?void 0:b.isSuggestion)!=null?E:!1,this.isError=!1}static fromJson(y){const b=new Vp(y.value);return y.isSuggestion&&(b.isSuggestion=!0),y.isError&&(b.isError=!0),b}toJson(){const y={};return this.isSuggestion&&(y.isSuggestion=!0),this.isError&&(y.isError=!0),we({type:"latex",value:this.value},y)}get computedStyle(){return{}}render(y){const b=new sr(this.value,{classes:this.isSuggestion?"ML__suggestion":this.isError?"ML__error":"",type:"latex",maxFontSize:1});return b?(this.caret&&(b.caret=this.caret),this.bind(y,b)):null}},xd=class Up extends In{constructor(y){super({type:"latexgroup",mode:"latex"}),this.body=[...y].map(b=>new ns(b)),this.skipBoundary=!1}static fromJson(y){return new Up("")}toJson(){return super.toJson()}render(y){const b=In.createBox(y,this.body);return b?(this.caret&&(b.caret=this.caret),this.bind(y,b)):null}_serialize(y){var b,E;return(E=(b=this.body)==null?void 0:b.map(ee=>ee.value).join(""))!=null?E:""}},fh=class Zp extends In{constructor(y,b){super(he(we({},b),{type:"extensible-symbol",isFunction:b==null?void 0:b.isFunction})),this.value=y,this.variant=b==null?void 0:b.variant,this.subsupPlacement=b==null?void 0:b.limits}static fromJson(y){return new Zp(y.symbol,y)}toJson(){const y=super.toJson();return this.variant&&(y.variant=this.variant),this.subsupPlacement&&(y.limits=this.subsupPlacement),this.isExtensibleSymbol&&(y.isExtensibleSymbol=!0),this.value&&(y.symbol=this.value),y}render(y){var b;const E=y.isDisplayStyle&&this.value!=="\\smallint",ee=new sr(this.value,{fontFamily:E?"Size2-Regular":"Size1-Regular",classes:"op-symbol "+(E?"large-op":"small-op"),type:"op",maxFontSize:y.scalingFactor,isSelected:this.isSelected});if(!ee)return null;ee.right=ee.italic;const re=(ee.height-ee.depth)/2-os*y.scalingFactor,ae=ee.italic;ee.setTop(re);let de=ee;if(this.superscript||this.subscript){const fe=(b=this.subsupPlacement)!=null?b:"auto";de=fe==="over-under"||fe==="auto"&&y.isDisplayStyle?this.attachLimits(y,{base:ee,baseShift:re,slant:ae}):this.attachSupsub(y,{base:ee})}return new sr(this.bind(y,de),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(y)}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Fr(this.command,this.mode);if(b!=null&&b.serialize)return b.serialize(this,y);const E=[];return E.push(this.command),this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&E.push("\\limits"),this.subsupPlacement==="adjacent"&&E.push("\\nolimits"),this.subsupPlacement==="auto"&&E.push("\\displaylimits")),E.push(this.supsubToLatex(y)),na(E)}},Ou=class jp extends In{constructor(y){const b=y.body;super(he(we({},y),{type:"overlap",body:typeof b=="string"?[new In({value:b})]:b,style:y==null?void 0:y.style})),this.skipBoundary=!0,this.align=y==null?void 0:y.align,this.boxType=y==null?void 0:y.boxType}static fromJson(y){return new jp(y)}toJson(){const y={};return this.align&&(y.align=this.align),this.boxType&&(y.boxType=this.boxType),we(we({},super.toJson()),y)}render(y){const b=In.createBox(y,this.body,{classes:"inner"});return b?(this.caret&&(b.caret=this.caret),this.bind(y,new sr([b,new sr(null,{classes:"fix"})],{classes:this.align==="right"?"rlap":"llap",type:this.boxType}))):null}},js=class Gp extends In{constructor(y){var b,E,ee,re;super({type:"overunder",command:y.command,style:y.style,mode:y.mode,body:y.body,skipBoundary:(b=y.skipBoundary)!=null?b:!0}),this.subsupPlacement=y.supsubPlacement,this.svgAbove=y.svgAbove,this.svgBelow=y.svgBelow,this.svgBody=y.svgBody,this.above=y.above,this.below=y.below,this.boxType=(E=y.boxType)!=null?E:"ord",this.paddedBody=(ee=y.paddedBody)!=null?ee:!1,this.paddedLabels=(re=y.paddedLabels)!=null?re:!1}static fromJson(y){return new Gp(y)}toJson(){const y=super.toJson();return this.skipBoundary||(y.skipBoundary=!1),this.subsupPlacement&&(y.subsupPlacement=this.subsupPlacement),this.svgAbove&&(y.svgAbove=this.svgAbove),this.svgBelow&&(y.svgBelow=this.svgBelow),this.svgBody&&(y.svgBody=this.svgBody),this.boxType!=="ord"&&(y.boxType=this.boxType),this.paddedBody&&(y.paddedBody=!0),this.paddedLabels&&(y.paddedLabels=!0),y}render(y){let b=this.svgBody?Bs(this.svgBody):In.createBox(y,this.body,{type:"ignore"});const E=new ya({parent:y,mathstyle:"scriptstyle"},this.style);let ee=null;this.svgAbove?ee=Bs(this.svgAbove):this.above&&(ee=In.createBox(E,this.above,{type:"ignore"}));let re=null;this.svgBelow?re=Bs(this.svgBelow):this.below&&(re=In.createBox(E,this.below,{type:"ignore"})),this.paddedBody&&(b=new sr([Rr(y,"open"),b,Rr(y,"close")],{type:"ignore"}));let ae=om(y,{base:b,above:ee,below:re,type:this.boxType==="bin"||this.boxType==="rel"?this.boxType:"ord",paddedAboveBelow:this.paddedLabels});return ae?(this.subsupPlacement==="over-under"?ae=this.attachLimits(y,{base:ae,type:ae.type}):ae=this.attachSupsub(y,{base:ae}),this.caret&&(ae.caret=this.caret),this.bind(y,ae)):null}};function om(a,y){if(!y.base)return null;if(!y.above&&!y.below){const de=new sr(y.base,{type:y.type});return de.setStyle("position","relative"),de}let b=0;y.above&&(b=a.metrics.bigOpSpacing5);let E=null;const ee=y.base,re=0,ae=["ML__center"];if(y.paddedAboveBelow&&ae.push("ML__label_padding"),y.below&&y.above){const de=a.metrics.bigOpSpacing5+y.below.height+y.below.depth+ee.depth+re;E=new Ja({bottom:de,children:[a.metrics.bigOpSpacing5,{box:y.below,classes:ae},{box:ee,classes:["ML__center"]},b,{box:y.above,classes:ae},a.metrics.bigOpSpacing5]})}else y.below?E=new Ja({top:ee.height-re,children:[a.metrics.bigOpSpacing5,{box:y.below,classes:ae},{box:ee,classes:["ML__center"]}]}):y.above&&(E=new Ja({bottom:ee.depth+re,children:[{box:ee,classes:["ML__center"]},b,{box:y.above,classes:ae},a.metrics.bigOpSpacing5]}));return new sr(E,{type:y.type})}var wd=class Xp extends In{constructor(y){var b,E,ee,re;super(he(we({},y),{type:"phantom"})),this.captureSelection=!0,this.isInvisible=(b=y.isInvisible)!=null?b:!1,this.smashDepth=(E=y.smashDepth)!=null?E:!1,this.smashHeight=(ee=y.smashHeight)!=null?ee:!1,this.smashWidth=(re=y.smashWidth)!=null?re:!1}static fromJson(y){return new Xp(y)}toJson(){const y={};return this.isInvisible&&(y.isInvisible=!0),this.smashDepth&&(y.smashDepth=!0),this.smashHeight&&(y.smashHeight=!0),this.smashWidth&&(y.smashWidth=!0),we(we({},super.toJson()),y)}render(y){const b=new ya({parent:y,isPhantom:!0});if(!this.smashDepth&&!this.smashHeight&&!this.smashWidth)return console.assert(this.isInvisible),In.createBox(b,this.body,{classes:"inner"});const E=In.createBox(this.isInvisible?b:y,this.body);if(!E)return null;if(this.smashWidth){const ee=new sr(null,{classes:"fix"});return new sr([E,ee],{classes:"rlap"}).wrap(y)}if(!this.smashHeight&&!this.smashDepth)return E;if(this.smashHeight&&(E.height=0),this.smashDepth&&(E.depth=0),E.children)for(const ee of E.children)this.smashHeight&&(ee.height=0),this.smashDepth&&(ee.depth=0);return new Ja({firstBaseline:[{box:E}]},{type:E.type}).wrap(y)}},Sd=class qp extends In{constructor(y){var b;super(we({type:"spacing"},y)),this.width=y==null?void 0:y.width,this._braced=(b=y==null?void 0:y.braced)!=null?b:!1}static fromJson(y){return new qp(y)}toJson(){const y=super.toJson();return this.width!==void 0&&(y.width=this.width),this._braced&&(y.braced=!0),y}render(y){var b;if(this.command==="space")return new sr(this.mode==="math"?null:" ");let E;if(this.width!==void 0)E=new sr(null,{classes:"mspace"}),E.left=y.toEm(this.width);else{const ee=(b={"\\qquad":"qquad","\\quad":"quad","\\enspace":"enspace","\\;":"thickspace","\\:":"mediumspace","\\>":"mediumspace","\\,":"thinspace","\\!":"negativethinspace"}[this.command])!=null?b:"mediumspace";E=new sr(null,{classes:ee})}return E=this.bind(y,E),this.caret&&(E.caret=this.caret),E}_serialize(y){var b;if(!y.expandMacro&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const E=Fr(this.command,this.mode);if(E!=null&&E.serialize)return E.serialize(this,y);const ee=(b=this.command)!=null?b:"";return this.width===void 0?ee:this._braced&&!("register"in this.width)?`${ee}{${Do(this.width)}}`:`${ee}${Do(this.width)}`}},o0=class Yp extends In{constructor(y){var b;super(he(we({},y),{type:"surd",mode:(b=y.mode)!=null?b:"math",style:y.style,displayContainsHighlight:!0,body:y.body})),this.above=y.index}static fromJson(y){return new Yp(he(we({},y),{index:y.above}))}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Fr(this.command,this.mode);if(b!=null&&b.serialize)return b.serialize(this,y);const E=this.command,ee=this.bodyToLatex(y);return this.above&&!this.hasEmptyBranch("above")?uo(`${E}[${this.aboveToLatex(y)}]`,ee):/^[0-9]$/.test(ee)?`${E}${ee}`:uo(E,ee)}get children(){if(this._children)return this._children;const y=[];if(this.above)for(const b of this.above)y.push(...b.children),y.push(b);if(this.body)for(const b of this.body)y.push(...b.children),y.push(b);return this._children=y,y}render(y){var b;const E=new ya({parent:y,mathstyle:"cramp"},this.style),ee=(b=In.createBox(E,this.body,{type:"inner"}))!=null?b:new sr(null),re=E.scalingFactor,ae=E.metrics.defaultRuleThickness/re,de=y.isDisplayStyle?el:ae,fe=new sr(null,{classes:"ML__sqrt-line",style:this.style});fe.height=ae,fe.softWidth=ee.width;let ge=re*(ae+de/4);const Be=Math.max(re*2*de,ee.height+ee.depth)+ge+ae,Ve=new ya({parent:y},this.style),ot=this.bind(Ve,new sr(Or("inner","\\surd",Be,!1,Ve,{isSelected:this.isSelected}),{isSelected:this.isSelected,classes:"ML__sqrt-sign",style:this.style}));if(!ot)return null;const gt=ot.height+ot.depth-ae;gt>ee.height+ee.depth+ge&&(ge=(ge+gt-(ee.height+ee.depth))/2),ot.setTop(ot.height-ee.height-ge);const ln=this.bind(y,new Ja({firstBaseline:[{box:new sr(ee)},ge-2*ae,{box:fe},ae]})),ar=In.createBox(new ya({parent:y,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!ar){const lr=new sr([ot,ln],{classes:this.containsCaret?"ML__contains-caret":"",type:"inner"});return lr.setStyle("display","inline-block"),lr.setStyle("height",lr.height+lr.depth,"em"),this.caret&&(lr.caret=this.caret),this.bind(y,lr)}const rn=new Ja({shift:-.6*(Math.max(ot.height,ln.height)-Math.max(ot.depth,ln.depth)),children:[{box:ar}]}),Vn=new sr([new sr(rn,{classes:"ML__sqrt-index",type:"ignore"}),ot,ln],{type:"inner",classes:this.containsCaret?"ML__contains-caret":""});return Vn.height=ot.height,Vn.depth=ot.depth,this.caret&&(Vn.caret=this.caret),this.bind(y,Vn)}},sm=class extends sr{constructor(a){super(null,{type:"skip"}),this._width=a}toMarkup(){return`<span style="display:inline-block;width:${Math.ceil(this.width*100)/100}em"></span>`}};function xf(a,y){if(!a.parent)return;const b=a.parent.children,E=b.indexOf(a);let ee=E-1;for(;ee>=0&&b[ee].type==="ignore";)ee-=1;if(ee<0&&a.parent.parent&&a.parent.type==="lift"){xf(a.parent,y);return}E>0&&b[E-1].type==="skip"?b[E-1].width+=y:b.splice(E,0,new sm(y))}var lm={ord:{op:3,bin:4,rel:5,inner:3},op:{ord:3,op:3,rel:5,inner:3},bin:{ord:4,op:4,open:4,inner:4},rel:{ord:5,op:5,open:5,inner:5},close:{op:3,bin:4,rel:5,inner:3},punct:{ord:3,op:3,rel:3,open:3,punct:3,inner:3},inner:{ord:3,op:3,bin:4,rel:5,open:3,punct:3,inner:3}},um={ord:{op:3},op:{ord:3,op:3},close:{op:3},inner:{op:3}};function cm(a){Md(a,(y,b)=>{b.type==="bin"&&(!y||/^(middle|bin|op|rel|open|punct)$/.test(y.type))&&(b.type="ord"),(y==null?void 0:y.type)==="bin"&&/^(rel|close|punct)$/.test(b.type)&&(y.type="ord"),b.type!=="ignore"&&(y=b)})}function Cd(a,y){if(!a.children)return a;const b=a.children;cm(b);const E=y.getRegisterAsEm("thinmuskip"),ee=y.getRegisterAsEm("medmuskip"),re=y.getRegisterAsEm("thickmuskip");return Md(b,(ae,de)=>{var fe,ge,xe;if(!ae)return;const Be=ae.type,Ve=de.isTight?(fe=um[Be])!=null?fe:null:(ge=lm[Be])!=null?ge:null,ot=(xe=Ve==null?void 0:Ve[de.type])!=null?xe:null;ot===3&&xf(de,E),ot===4&&xf(de,ee),ot===5&&xf(de,re)}),a}function Md(a,y,b=void 0){if(!a)return b;a=[...a];for(const E of a)E.type==="lift"?b=Md(E.children,y,b):E.type==="ignore"?Md(E.children,y):(y(b,E),Md(E.children,y),b=E);return b}var hh=class Jp extends In{constructor(y){super({type:"tooltip",command:y.command,mode:y.mode,style:y.style,body:y.body,displayContainsHighlight:!0}),this.tooltip=new In({type:"root",mode:y.content,body:y.tooltip,style:{}}),this.skipBoundary=!0,this.captureSelection=!1}static fromJson(y){return new Jp(he(we({},y),{tooltip:du(y.tooltip)}))}toJson(){var y;const b=(y=this.tooltip.body)==null?void 0:y.filter(E=>E.type!=="first").map(E=>E.toJson());return he(we({},super.toJson()),{tooltip:b})}render(y){const b=In.createBox(new ya,this.body);if(!b)return null;const E=new ya({parent:y,mathstyle:"displaystyle"},{fontSize:dl}),ee=gc(Cd(new sr(this.tooltip.render(E),{classes:"ML__tooltip-content"}),E)),re=new sr([ee,b],{classes:"ML__tooltip-container"});return this.caret&&(re.caret=this.caret),this.bind(y,re)}},Ru=class Qp extends In{constructor(y,b){super(he(we({},b),{type:"operator",isFunction:b==null?void 0:b.isFunction})),this.value=y,this.variant=b==null?void 0:b.variant,this.variantStyle=b==null?void 0:b.variantStyle,this.subsupPlacement=b==null?void 0:b.limits}static fromJson(y){return new Qp(y.symbol,y)}toJson(){const y=super.toJson();return this.variant&&(y.variant=this.variant),this.variantStyle&&(y.variantStyle=this.variantStyle),this.subsupPlacement&&(y.limits=this.subsupPlacement),this.value&&(y.symbol=this.value),y}render(y){var b;const E=new sr(this.value,{type:"op",mode:"math",maxFontSize:y.scalingFactor,style:{variant:this.variant,variantStyle:this.variantStyle},isSelected:this.isSelected,letterShapeStyle:y.letterShapeStyle});let ee=E;if(this.superscript||this.subscript){const re=(b=this.subsupPlacement)!=null?b:"auto";ee=re==="over-under"||re==="auto"&&y.isDisplayStyle?this.attachLimits(y,{base:E}):this.attachSupsub(y,{base:E})}return new sr(this.bind(y,ee),{type:"op",caret:this.caret,isSelected:this.isSelected,classes:"op-group"}).wrap(y)}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Fr(this.command,this.mode);if(b!=null&&b.serialize)return b.serialize(this,y);const E=[this.command];return this.explicitSubsupPlacement&&(this.subsupPlacement==="over-under"&&E.push("\\limits"),this.subsupPlacement==="adjacent"&&E.push("\\nolimits"),this.subsupPlacement==="auto"&&E.push("\\displaylimits")),E.push(this.supsubToLatex(y)),na(E)}};function du(a){if(Ne(a))return a.map(E=>du(E));if(typeof a=="string")return In.fromJson(a);a=we({},a);for(const E of su)a[E]&&(a[E]=du(a[E]));a.args&&(a.args=dm(a.args)),a.array&&(a.array=du(a.array));const y=a.type;let b;y==="accent"&&(b=z.fromJson(a)),y==="array"&&(b=zi.fromJson(a)),y==="box"&&(b=_o.fromJson(a)),y==="chem"&&(b=n0.fromJson(a)),y==="composition"&&(b=Wl.fromJson(a)),y==="delim"&&(b=r0.fromJson(a)),y==="enclose"&&(b=bd.fromJson(a)),y==="error"&&(b=ys.fromJson(a)),y==="extensible-symbol"&&(b=fh.fromJson(a)),y==="genfrac"&&(b=_c.fromJson(a)),y==="group"&&(b=Go.fromJson(a)),y==="latex"&&(b=ns.fromJson(a)),y==="latexgroup"&&(b=xd.fromJson(a)),y==="leftright"&&(b=za.fromJson(a)),y==="macro"&&(b=Ec.fromJson(a)),y==="macro-argument"&&(b=sl.fromJson(a)),y==="operator"&&(b=Ru.fromJson(a)),y==="overlap"&&(b=Ou.fromJson(a)),y==="overunder"&&(b=js.fromJson(a)),y==="placeholder"&&(b=hi.fromJson(a)),y==="prompt"&&(b=xl.fromJson(a)),y==="phantom"&&(b=wd.fromJson(a)),y==="sizeddelim"&&(b=i0.fromJson(a)),y==="spacing"&&(b=Sd.fromJson(a)),y==="subsup"&&(b=Zs.fromJson(a)),y==="surd"&&(b=o0.fromJson(a)),y==="text"&&(b=al.fromJson(a)),y==="tooltip"&&(b=hh.fromJson(a)),b||(console.assert(!y||["first","mbin","mrel","mclose","minner","mop","mopen","mord","mpunct","root","space"].includes(y),`MathLive 0.98.5: an unexpected atom type "${y}" was encountered. Add new atom constructors to \`fromJson()\` in "atom.ts"`),b=In.fromJson(a));for(const E of su)a[E]&&b.setChildren(a[E],E);return a.verbatimLatex!==void 0&&(b.verbatimLatex=a.verbatimLatex),a.subsupPlacement&&(b.subsupPlacement=a.subsupPlacement),a.explicitSubsupPlacement&&(b.explicitSubsupPlacement=!0),a.isFunction&&(b.isFunction=!0),a.isExtensibleSymbol&&(b.isExtensibleSymbol=!0),a.skipBoundary&&(b.skipBoundary=!0),a.captureSelection&&(b.captureSelection=!0),b}function dm(a){if(a&&Array.isArray(a))return a.map(y=>y==="<null>"?null:typeof y=="object"&&"group"in y?{group:y.group.map(b=>du(b))}:typeof y=="object"&&"atoms"in y?y.atoms.map(b=>du(b)):y)}var s0={main:["Main-Regular","ML__cmr"],"main-italic":["Main-Italic","ML__cmr ML__it"],"main-bold":["Main-Bold","ML__cmr ML__bold"],"main-bolditalic":["Main-BoldItalic","ML__cmr ML__bold ML__it"],normal:["Main-Regular","ML__cmr"],"normal-bold":["Main-Bold","ML__mathbf"],"normal-italic":["Math-Italic","ML__mathit"],"normal-bolditalic":["Math-BoldItalic","ML__mathbfit"],ams:["AMS-Regular","ML__ams"],"ams-bold":["AMS-Regular","ML__ams"],"ams-italic":["AMS-Regular","ML__ams"],"ams-bolditalic":["AMS-Regular","ML__ams"],"sans-serif":["SansSerif-Regular","ML__sans"],"sans-serif-bold":["SansSerif-Regular","ML__sans ML__bold"],"sans-serif-italic":["SansSerif-Regular","ML__sans"],"sans-serif-bolditalic":["SansSerif-Regular","ML__sans"],calligraphic:["Caligraphic-Regular","ML__cal"],"calligraphic-bold":["Caligraphic-Regular","ML__cal ML__bold"],"calligraphic-italic":["Caligraphic-Regular","ML__cal ML__it"],"calligraphic-bolditalic":["Caligraphic-Regular","ML__cal ML__bold ML__it"],script:["Script-Regular","ML__script"],"script-bold":["Script-Regular","ML__script ML__bold"],"script-italic":["Script-Regular","ML__script ML__it"],"script-bolditalic":["Script-Regular","ML__script ML__bold ML__it"],fraktur:["Fraktur-Regular","ML__frak"],"fraktur-bold":["Fraktur-Regular","ML__frak"],"fraktur-italic":["Fraktur-Regular","ML__frak"],"fraktur-bolditalic":["Fraktur-Regular","ML__frak"],monospace:["Typewriter-Regular","ML__tt"],"monospace-bold":["Typewriter-Regular","ML__tt ML__bold"],"monospace-italic":["Typewriter-Regular","ML__tt ML__it"],"monospace-bolditalic":["Typewriter-Regular","ML__tt ML__bold ML__it"],"double-struck":["AMS-Regular","ML__bb"],"double-struck-bold":["AMS-Regular","ML__bb"],"double-struck-italic":["AMS-Regular","ML__bb"],"double-struck-bolditalic":["AMS-Regular","ML__bb"]},ph={"double-struck":/^[A-Z ]$/,script:/^[A-Z ]$/,calligraphic:/^[\dA-Z ]$/,fraktur:/^[\dA-Za-z ]$|^[!"#$%&'()*+,\-./:;=?[]^]$/,monospace:/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/,"sans-serif":/^[\dA-Za-z ]$|^[!"&'()*+,\-./:;=?@[\]^_~\u0131\u0237\u0393\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A8\u03A9]$/},l0=/^[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5]$/,fm=/^[\u0393|\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A6\u03A8\u03A9]$/,hm=[/^[a-z]$/,/^[A-Z]$/,l0,fm],pm={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]},mm=class extends Ss{constructor(){super("math")}createAtom(a,y,b){var E,ee,re,ae;if(y===null)return new In({type:"mord",mode:"math",command:a,value:a,style:b});const de=window.MathfieldElement.isFunction((E=y.command)!=null?E:a);if(y.definitionType==="symbol"){const ge=new In({type:(ee=y.type)!=null?ee:"mord",mode:"math",command:(re=y.command)!=null?re:a,value:String.fromCodePoint(y.codepoint),style:b});return de&&(ge.isFunction=!0),a.startsWith("\\")&&(ge.verbatimLatex=a),ge}const fe=new In({type:"mord",mode:"math",command:(ae=y.command)!=null?ae:a,value:a,style:b});return de&&(fe.isFunction=!0),a.startsWith("\\")&&(fe.verbatimLatex=a),fe}serialize(a,y){const b=gm(a,he(we({},y),{defaultMode:"math"}));return b.length===0||y.defaultMode!=="text"?b:["$ ",...b," $"]}getFont(a,y){console.assert(y.variant!==void 0);let{variant:b}=y,{variantStyle:E}=y;b==="normal"&&!E&&/[\u00A3\u0131\u0237]/.test(a.value)&&(b="main",E="italic"),b==="normal"&&!E&&a.value.length===1&&hm.forEach((de,fe)=>{var ge;de.test(a.value)&&pm[(ge=y.letterShapeStyle)!=null?ge:"tex"][fe]==="it"&&(E="italic")}),E==="up"&&(E=void 0);const ee=E?b+"-"+E:b;console.assert(s0[ee]!==void 0);const[re,ae]=s0[ee];return ph[b]&&!ph[b].test(a.value)?(a.value=gn(a.value,b,E),null):(l0.test(a.value)&&(a.classes+=" lcGreek"),ae&&(a.classes+=" "+ae),re)}};function gm(a,y){const{parent:b}=a[0],E=u0(b);return Eo(a,"variant").map(ee=>{const re=u0(ee[0]);let ae="";re&&re!==E&&(ae={calligraphic:"\\mathcal",fraktur:"\\mathfrak","double-struck":"\\mathbb",script:"\\mathscr",monospace:"\\mathtt","sans-serif":"\\mathsf",normal:"\\mathrm","normal-italic":"\\mathnormal","normal-bold":"\\mathbf","normal-bolditalic":"\\mathbfit",ams:"","ams-italic":"\\mathit","ams-bold":"\\mathbf","ams-bolditalic":"\\mathbfit",main:"","main-italic":"\\mathit","main-bold":"\\mathbf","main-bolditalic":"\\mathbfit"}[re],console.assert(ae!==void 0));const de=na(ee.map(fe=>fe._serialize(y)));return ae?uo(ae,de):de})}function u0(a){if(!a)return"";const{style:y}=a;if(y.variant===void 0)return"";let b=y.variant;return!["calligraphic","fraktur","double-struck","script","monospace","sans-serif"].includes(y.variant)&&y.variantStyle&&y.variantStyle!=="up"&&(b+="-"+y.variantStyle),b}new mm;function vm(a,y){return a.map(b=>b._serialize(y))}function ym(a,y){return Eo(a,"fontShape").map(b=>{const E=vm(b,y),{fontShape:ee}=b[0].style;let re="";return ee==="it"&&(re="\\textit"),ee==="sl"&&(re="\\textsl"),ee==="sc"&&(re="\\textsc"),ee==="n"&&(re="\\textup"),!re&&ee?`{${uo("\\fontshape",ee)}${na(E)}}`:re?uo(re,na(E)):na(E)})}function bm(a,y){return Eo(a,"fontSeries").map(b=>{const E=ym(b,y),{fontSeries:ee}=b[0].style;let re="";return ee==="b"&&(re="\\textbf"),ee==="l"&&(re="\\textlf"),ee==="m"&&(re="\\textmd"),ee&&!re?`{${uo("\\fontseries",ee)}${na(E)}}`:re?uo(re,na(E)):na(E)})}function xm(a,y){return Eo(a,"fontSize").map(b=>{var E,ee;const re=bm(b,y),ae=(ee=["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][(E=b[0].style.fontSize)!=null?E:""])!=null?ee:"";return ae?`${ae} ${na(re)}`:na(re)})}function wm(a,y,b){return Eo(a,"fontFamily").map(E=>{var ee,re;const ae=xm(E,y),de=(re={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[(ee=E[0].style.fontFamily)!=null?ee:""])!=null?re:"";return de?`\\${de}{${na(ae)}}`:E[0].style.fontFamily?`{\\fontfamily{${E[0].style.fontFamily}} ${na(ae)}}`:b?`\\text{${na(ae)}}`:na(ae)})}var c0={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"},Sm=class extends Ss{constructor(){super("text")}createAtom(a,y,b){return y&&y.definitionType==="symbol"?new al(a,String.fromCodePoint(y.codepoint),b!=null?b:{}):null}serialize(a,y){return wm(a,he(we({},y),{defaultMode:"text"}),y.defaultMode!=="text")}getFont(a,y){var b,E,ee,re,ae;const{fontFamily:de}=y;if(c0[de]?a.classes+=" "+c0[de]:de&&a.setStyle("font-family",de),y.fontShape&&(a.classes+=" ",a.classes+=(b={it:"ML__it",sl:"ML__shape_sl",sc:"ML__shape_sc",ol:"ML__shape_ol"}[y.fontShape])!=null?b:""),y.fontSeries){const fe=y.fontSeries.match(/(.?[lbm])?(.?[cx])?/);fe&&(a.classes+=" ",a.classes+=(ee={ul:"ML__series_ul",el:"ML__series_el",l:"ML__series_l",sl:"ML__series_sl",m:"",sb:"ML__series_sb",b:"ML__bold",eb:"ML__series_eb",ub:"ML__series_ub"}[(E=fe[1])!=null?E:""])!=null?ee:"",a.classes+=" ",a.classes+=(ae={uc:"ML__series_uc",ec:"ML__series_ec",c:"ML__series_c",sc:"ML__series_sc",n:"",sx:"ML__series_sx",x:"ML__series_x",ex:"ML__series_ex",ux:"ML__series_ux"}[(re=fe[2])!=null?re:""])!=null?ae:"")}return"Main-Regular"}};new Sm;var Cm=class extends Ss{constructor(){super("latex")}createAtom(a){return new ns(a)}serialize(a,y){return a.filter(b=>b instanceof ns&&!b.isSuggestion).map(b=>b.value)}getFont(){return null}};new Cm;var Mm={id:"dvorak",locale:"en",displayName:"Dvorak",virtualLayout:"dvorak",platform:"",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["x","X","\u2248","\u02DB"],KeyC:["j","J","\u2206","\xD4"],KeyD:["e","E","\xB4","\xB4"],KeyE:[".",">","\u2265","\u02D8"],KeyF:["u","U","\xA8","\xA8"],KeyG:["i","I","\u02C6","\u02C6"],KeyH:["d","D","\u2202","\xCE"],KeyI:["c","C","\xE7","\xC7"],KeyJ:["h","H","\u02D9","\xD3"],KeyK:["t","T","\u2020","\u02C7"],KeyL:["n","N","\u02DC","\u02DC"],KeyM:["m","M","\xB5","\xC2"],KeyN:["b","B","\u222B","\u0131"],KeyO:["r","R","\xAE","\u2030"],KeyP:["l","L","\xAC","\xD2"],KeyQ:["'",'"',"\xE6","\xC6"],KeyR:["p","P","\u03C0","\u220F"],KeyS:["o","O","\xF8","\xD8"],KeyT:["y","Y","\xA5","\xC1"],KeyU:["g","G","\xA9","\u02DD"],KeyV:["k","K","\u02DA","\uF8FF"],KeyW:[",","<","\u2264","\xAF"],KeyX:["q","Q","\u0153","\u0152"],KeyY:["f","F","\u0192","\xCF"],KeyZ:[";",":","\u2026","\xDA"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["[","{","\u201C","\u201D"],Equal:["]","}","\u2018","\u2019"],BracketLeft:["/","?","\xF7","\xBF"],BracketRight:["=","+","\u2260","\xB1"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:["s","S","\xDF","\xCD"],Quote:["-","_","\u2013","\u2014"],Backquote:["`","~","`","`"],Comma:["w","W","\u2211","\u201E"],Period:["v","V","\u221A","\u25CA"],Slash:["z","Z","\u03A9","\xB8"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},mh={id:"apple.en-intl",displayName:"English (international)",virtualLayout:"qwerty",platform:"apple",locale:"en",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u0131"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\xCE"],KeyE:["e","E","\xB4","\xB4"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\u02DD"],KeyH:["h","H","\u02D9","\xD3"],KeyI:["i","I","\u02C6","\u02C6"],KeyJ:["j","J","\u2206","\xD4"],KeyK:["k","K","\u02DA","\uF8FF"],KeyL:["l","L","\xAC","\xD2"],KeyM:["m","M","\xB5","\xC2"],KeyN:["n","N","\u02DC","\u02DC"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE","\u2030"],KeyS:["s","S","\xDF","\xCD"],KeyT:["t","T","\u2020","\u02C7"],KeyU:["u","U","\xA8","\xA8"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\u02DB"],KeyY:["y","Y","\xA5","\xC1"],KeyZ:["z","Z","\u03A9","\xB8"],Digit1:["1","!","\xA1","\u2044"],Digit2:["2","@","\u2122","\u20AC"],Digit3:["3","#","\xA3","\u2039"],Digit4:["4","$","\xA2","\u203A"],Digit5:["5","%","\u221E","\uFB01"],Digit6:["6","^","\xA7","\uFB02"],Digit7:["7","&","\xB6","\u2021"],Digit8:["8","*","\u2022","\xB0"],Digit9:["9","(","\xAA","\xB7"],Digit0:["0",")","\xBA","\u201A"],Space:[" "," "," "," "],Minus:["-","_","\u2013","\u2014"],Equal:["=","+","\u2260","\xB1"],BracketLeft:["[","{","\u201C","\u201D"],BracketRight:["]","}","\u2018","\u2019"],Backslash:["\\","|","\xAB","\xBB"],Semicolon:[";",":","\u2026","\xDA"],Quote:["'",'"',"\xE6","\xC6"],Backquote:["`","\u02DC","`","`"],Comma:[",","<","\u2264","\xAF"],Period:[".",">","\u2265","\u02D8"],Slash:["/","?","\xF7","\xBF"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[".",".",".","."],IntlBackslash:["\xA7","\xB1","\xA7","\xB1"],NumpadEqual:["=","=","=","="],AudioVolumeUp:["","=","","="]}},d0={id:"windows.en-intl",displayName:"English (international)",platform:"windows",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","\xE1","\xC1"],KeyB:["b","B","",""],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\xE9","\xC9"],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","\xED","\xCD"],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","\xF8","\xD8"],KeyM:["m","M","\xB5",""],KeyN:["n","N","\xF1","\xD1"],KeyO:["o","O","\xF3","\xD3"],KeyP:["p","P","\xF6","\xD6"],KeyQ:["q","Q","\xE4","\xC4"],KeyR:["r","R","\xAE",""],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\xFE","\xDE"],KeyU:["u","U","\xFA","\xDA"],KeyV:["v","V","",""],KeyW:["w","W","\xE5","\xC5"],KeyX:["x","X","",""],KeyY:["y","Y","\xFC","\xDC"],KeyZ:["z","Z","\xE6","\xC6"],Digit1:["1","!","\xA1","\xB9"],Digit2:["2","@","\xB2",""],Digit3:["3","#","\xB3",""],Digit4:["4","$","\xA4","\xA3"],Digit5:["5","%","\u20AC",""],Digit6:["6","^","\xBC",""],Digit7:["7","&","\xBD",""],Digit8:["8","*","\xBE",""],Digit9:["9","(","\u2018",""],Digit0:["0",")","\u2019",""],Space:[" "," ","",""],Minus:["-","_","\xA5",""],Equal:["=","+","\xD7","\xF7"],BracketLeft:["[","{","\xAB",""],BracketRight:["]","}","\xBB",""],Backslash:["\\","|","\xAC","\xA6"],Semicolon:[";",":","\xB6","\xB0"],Quote:["'",'"',"\xB4","\xA8"],Backquote:["`","~","",""],Comma:[",","<","\xE7","\xC7"],Period:[".",">","",""],Slash:["/","?","\xBF",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["\\","|","",""]}},f0={id:"linux.en",displayName:"English",platform:"linux",virtualLayout:"qwerty",locale:"en",score:0,mapping:{KeyA:["a","A","a","A"],KeyB:["b","B","b","B"],KeyC:["c","C","c","C"],KeyD:["d","D","d","D"],KeyE:["e","E","e","E"],KeyF:["f","F","f","F"],KeyG:["g","G","g","G"],KeyH:["h","H","h","H"],KeyI:["i","I","i","I"],KeyJ:["j","J","j","J"],KeyK:["k","K","k","K"],KeyL:["l","L","l","L"],KeyM:["m","M","m","M"],KeyN:["n","N","n","N"],KeyO:["o","O","o","O"],KeyP:["p","P","p","P"],KeyQ:["q","Q","q","Q"],KeyR:["r","R","r","R"],KeyS:["s","S","s","S"],KeyT:["t","T","t","T"],KeyU:["u","U","u","U"],KeyV:["v","V","v","V"],KeyW:["w","W","w","W"],KeyX:["x","X","x","X"],KeyY:["y","Y","y","Y"],KeyZ:["z","Z","z","Z"],Digit1:["1","!","1","!"],Digit2:["2","@","2","@"],Digit3:["3","#","3","#"],Digit4:["4","$","4","$"],Digit5:["5","%","5","%"],Digit6:["6","^","6","^"],Digit7:["7","&","7","&"],Digit8:["8","*","8","*"],Digit9:["9","(","9","("],Digit0:["0",")","0",")"],Space:[" "," "," "," "],Minus:["-","_","-","_"],Equal:["=","+","=","+"],BracketLeft:["[","{","[","{"],BracketRight:["]","}","]","}"],Backslash:["\\","|","\\","|"],Semicolon:[";",":",";",":"],Quote:["'",'"',"'",'"'],Backquote:["`","~","`","~"],Comma:[",","<",",","<"],Period:[".",">",".",">"],Slash:["/","?","/","?"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}},Em={id:"apple.french",locale:"fr",displayName:"French",platform:"apple",virtualLayout:"azerty",score:0,mapping:{KeyA:["q","Q","\u2021","\u03A9"],KeyB:["b","B","\xDF","\u222B"],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\xEA","\xCA"],KeyF:["f","F","\u0192","\xB7"],KeyG:["g","G","\uFB01","\uFB02"],KeyH:["h","H","\xCC","\xCE"],KeyI:["i","I","\xEE","\xEF"],KeyJ:["j","J","\xCF","\xCD"],KeyK:["k","K","\xC8","\xCB"],KeyL:["l","L","\xAC","|"],KeyM:[",","?","\u221E","\xBF"],KeyN:["n","N","~","\u0131"],KeyO:["o","O","\u0153","\u0152"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xAE","\u201A"],KeyS:["s","S","\xD2","\u2211"],KeyT:["t","T","\u2020","\u2122"],KeyU:["u","U","\xBA","\xAA"],KeyV:["v","V","\u25CA","\u221A"],KeyW:["z","Z","\xC2","\xC5"],KeyX:["x","X","\u2248","\u2044"],KeyY:["y","Y","\xDA","\u0178"],KeyZ:["w","W","\u2039","\u203A"],Digit1:["&","1","\uF8FF","\xB4"],Digit2:["\xE9","2","\xEB","\u201E"],Digit3:['"',"3","\u201C","\u201D"],Digit4:["'","4","\u2018","\u2019"],Digit5:["(","5","{","["],Digit6:["\xA7","6","\xB6","\xE5"],Digit7:["\xE8","7","\xAB","\xBB"],Digit8:["!","8","\xA1","\xDB"],Digit9:["\xE7","9","\xC7","\xC1"],Digit0:["\xE0","0","\xF8","\xD8"],Space:[" "," "," "," "],Minus:[")","\xB0","}","]"],Equal:["-","_","\u2014","\u2013"],BracketLeft:["^","\xA8","\xF4","\xD4"],BracketRight:["$","*","\u20AC","\xA5"],Backslash:["`","\xA3","@","#"],Semicolon:["m","M","\xB5","\xD3"],Quote:["\xF9","%","\xD9","\u2030"],Backquote:["<",">","\u2264","\u2265"],Comma:[";",".","\u2026","\u2022"],Period:[":","/","\xF7","\\"],Slash:["=","+","\u2260","\xB1"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",".",",","."],IntlBackslash:["@","#","\u2022","\u0178"],NumpadEqual:["=","=","=","="]}},_m={id:"windows.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"windows",score:0,mapping:{KeyA:["q","Q","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:[",","?","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["a","A","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["z","Z","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["w","W","",""],Digit1:["&","1","",""],Digit2:["\xE9","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["\xE8","7","`",""],Digit8:["_","8","\\",""],Digit9:["\xE7","9","^",""],Digit0:["\xE0","0","@",""],Space:[" "," ","",""],Minus:[")","\xB0","]",""],Equal:["=","+","}",""],BracketLeft:["^","\xA8","",""],BracketRight:["$","\xA3","\xA4",""],Backslash:["*","\xB5","",""],Semicolon:["m","M","",""],Quote:["\xF9","%","",""],Backquote:["\xB2","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","\xA7","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},km={id:"linux.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"linux",score:0,mapping:{KeyA:["q","Q","@","\u03A9"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:[",","?","\u0301","\u030B"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["z","Z","\xAB","<"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["w","W","\u0142","\u0141"],Digit1:["&","1","\xB9","\xA1"],Digit2:["\xE9","2","~","\u215B"],Digit3:['"',"3","#","\xA3"],Digit4:["'","4","{","$"],Digit5:["(","5","[","\u215C"],Digit6:["-","6","|","\u215D"],Digit7:["\xE8","7","`","\u215E"],Digit8:["_","8","\\","\u2122"],Digit9:["\xE7","9","^","\xB1"],Digit0:["\xE0","0","@","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:[")","\xB0","]","\xBF"],Equal:["=","+","}","\u0328"],BracketLeft:["\u0302","\u0308","\u0308","\u030A"],BracketRight:["$","\xA3","\xA4","\u0304"],Backslash:["*","\xB5","\u0300","\u0306"],Semicolon:["m","M","\xB5","\xBA"],Quote:["\xF9","%","\u0302","\u030C"],Backquote:["\xB2","~","\xAC","\xAC"],Comma:[";",".","\u2500","\xD7"],Period:[":","/","\xB7","\xF7"],Slash:["!","\xA7","\u0323","\u0307"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"]}},Lm={id:"apple.german",locale:"de",displayName:"German",virtualLayout:"qwertz",platform:"apple",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\u222B","\u2039"],KeyC:["c","C","\xE7","\xC7"],KeyD:["d","D","\u2202","\u2122"],KeyE:["e","E","\u20AC","\u2030"],KeyF:["f","F","\u0192","\xCF"],KeyG:["g","G","\xA9","\xCC"],KeyH:["h","H","\xAA","\xD3"],KeyI:["i","I","\u2044","\xDB"],KeyJ:["j","J","\xBA","\u0131"],KeyK:["k","K","\u2206","\u02C6"],KeyL:["l","L","@","\uFB02"],KeyM:["m","M","\xB5","\u02D8"],KeyN:["n","N","~","\u203A"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\xAB","\xBB"],KeyR:["r","R","\xAE","\xB8"],KeyS:["s","S","\u201A","\xCD"],KeyT:["t","T","\u2020","\u02DD"],KeyU:["u","U","\xA8","\xC1"],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\u2211","\u201E"],KeyX:["x","X","\u2248","\xD9"],KeyY:["z","Z","\u03A9","\u02C7"],KeyZ:["y","Y","\xA5","\u2021"],Digit1:["1","!","\xA1","\xAC"],Digit2:["2",'"',"\u201C","\u201D"],Digit3:["3","\xA7","\xB6","#"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","[","\uFB01"],Digit6:["6","&","]","^"],Digit7:["7","/","|","\\"],Digit8:["8","(","{","\u02DC"],Digit9:["9",")","}","\xB7"],Digit0:["0","=","\u2260","\xAF"],Space:[" "," "," "," "],Minus:["\xDF","?","\xBF","\u02D9"],Equal:["\xB4","`","'","\u02DA"],BracketLeft:["\xFC","\xDC","\u2022","\xB0"],BracketRight:["+","*","\xB1","\uF8FF"],Backslash:["#","'","\u2018","\u2019"],Semicolon:["\xF6","\xD6","\u0153","\u0152"],Quote:["\xE4","\xC4","\xE6","\xC6"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u221E","\u02DB"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",",",".","."],IntlBackslash:["^","\xB0","\u201E","\u201C"],NumpadEqual:["=","=","=","="]}},Am={id:"windows.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","\xB5",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","@",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["z","Z","",""],KeyZ:["y","Y","",""],Digit1:["1","!","",""],Digit2:["2",'"',"\xB2",""],Digit3:["3","\xA7","\xB3",""],Digit4:["4","$","",""],Digit5:["5","%","",""],Digit6:["6","&","",""],Digit7:["7","/","{",""],Digit8:["8","(","[",""],Digit9:["9",")","]",""],Digit0:["0","=","}",""],Space:[" "," ","",""],Minus:["\xDF","?","\\","\u1E9E"],Equal:["\xB4","`","",""],BracketLeft:["\xFC","\xDC","",""],BracketRight:["+","*","~",""],Backslash:["#","'","",""],Semicolon:["\xF6","\xD6","",""],Quote:["\xE4","\xC4","",""],Backquote:["^","\xB0","",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","|",""]}},Tm={id:"linux.german",locale:"de",displayName:"German",platform:"windows",virtualLayout:"qwertz",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201C","\u2018"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0323","\u0307"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","\u201D","\u2019"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\u017F","\u1E9E"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201E","\u201A"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xAB","\u2039"],KeyY:["z","Z","\u2190","\xA5"],KeyZ:["y","Y","\xBB","\u203A"],Digit1:["1","!","\xB9","\xA1"],Digit2:["2",'"',"\xB2","\u215B"],Digit3:["3","\xA7","\xB3","\xA3"],Digit4:["4","$","\xBC","\xA4"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["\xDF","?","\\","\xBF"],Equal:["\u0301","\u0300","\u0327","\u0328"],BracketLeft:["\xFC","\xDC","\u0308","\u030A"],BracketRight:["+","*","~","\xAF"],Backslash:["#","'","\u2019","\u0306"],Semicolon:["\xF6","\xD6","\u030B","\u0323"],Quote:["\xE4","\xC4","\u0302","\u030C"],Backquote:["\u0302","\xB0","\u2032","\u2033"],Comma:[",",";","\xB7","\xD7"],Period:[".",":","\u2026","\xF7"],Slash:["-","_","\u2013","\u2014"],PrintScreen:["","","",""],PageUp:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",",","",","],IntlBackslash:["<",">","|","\u0331"],AltRight:["\r","\r","\r","\r"],MetaRight:[".",".",".","."]}},Dm={id:"apple.spanish",locale:"es",displayName:"Spanish ISO",platform:"apple",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE5","\xC5"],KeyB:["b","B","\xDF",""],KeyC:["c","C","\xA9"," "],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\u20AC","\u20AC"],KeyF:["f","F","\u0192","\uFB01"],KeyG:["g","G","\uF8FF","\uFB02"],KeyH:["h","H","\u2122"," "],KeyI:["i","I"," "," "],KeyJ:["j","J","\xB6","\xAF"],KeyK:["k","K","\xA7","\u02C7"],KeyL:["l","L"," ","\u02D8"],KeyM:["m","M","\xB5","\u02DA"],KeyN:["n","N"," ","\u02D9"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["q","Q","\u0153","\u0152"],KeyR:["r","R","\xAE"," "],KeyS:["s","S","\u222B"," "],KeyT:["t","T","\u2020","\u2021"],KeyU:["u","U"," "," "],KeyV:["v","V","\u221A","\u25CA"],KeyW:["w","W","\xE6","\xC6"],KeyX:["x","X","\u2211","\u203A"],KeyY:["y","Y","\xA5"," "],KeyZ:["z","Z","\u03A9","\u2039"],Digit1:["1","!","|","\u0131"],Digit2:["2",'"',"@","\u02DD"],Digit3:["3","\xB7","#","\u2022"],Digit4:["4","$","\xA2","\xA3"],Digit5:["5","%","\u221E","\u2030"],Digit6:["6","&","\xAC"," "],Digit7:["7","/","\xF7","\u2044"],Digit8:["8","(","\u201C","\u2018"],Digit9:["9",")","\u201D","\u2019"],Digit0:["0","=","\u2260","\u2248"],Space:[" "," "," "," "],Minus:["'","?","\xB4","\xB8"],Equal:["\xA1","\xBF","\u201A","\u02DB"],BracketLeft:["`","^","[","\u02C6"],BracketRight:["+","*","]","\xB1"],Backslash:["\xE7","\xC7","}","\xBB"],Semicolon:["\xF1","\xD1","~","\u02DC"],Quote:["\xB4","\xA8","{","\xAB"],Backquote:["<",">","\u2264","\u2265"],Comma:[",",";","\u201E",""],Period:[".",":","\u2026","\u2026"],Slash:["-","_","\u2013","\u2014"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],Numpad1:["1","1","1","1"],Numpad2:["2","2","2","2"],Numpad3:["3","3","3","3"],Numpad4:["4","4","4","4"],Numpad5:["5","5","5","5"],Numpad6:["6","6","6","6"],Numpad7:["7","7","7","7"],Numpad8:["8","8","8","8"],Numpad9:["9","9","9","9"],Numpad0:["0","0","0","0"],NumpadDecimal:[",",",",",",","],IntlBackslash:["\xBA","\xAA","\\","\xB0"]}},Im={id:"windows.spanish",locale:"es",displayName:"Spanish",platform:"windows",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:["m","M","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["q","Q","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["w","W","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["z","Z","",""],Digit1:["1","!","|",""],Digit2:["2",'"',"@",""],Digit3:["3","\xB7","#",""],Digit4:["4","$","~",""],Digit5:["5","%","\u20AC",""],Digit6:["6","&","\xAC",""],Digit7:["7","/","",""],Digit8:["8","(","",""],Digit9:["9",")","",""],Digit0:["0","=","",""],Space:[" "," ","",""],Minus:["'","?","",""],Equal:["\xA1","\xBF","",""],BracketLeft:["`","^","[",""],BracketRight:["+","*","]",""],Backslash:["\xE7","\xC7","}",""],Semicolon:["\xF1","\xD1","",""],Quote:["\xB4","\xA8","{",""],Backquote:["\xBA","\xAA","\\",""],Comma:[",",";","",""],Period:[".",":","",""],Slash:["-","_","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},Pm={id:"linux.spanish",locale:"es",displayName:"Spanish",platform:"linux",virtualLayout:"qwerty",score:0,mapping:{KeyA:["a","A","\xE6","\xC6"],KeyB:["b","B","\u201D","\u2019"],KeyC:["c","C","\xA2","\xA9"],KeyD:["d","D","\xF0","\xD0"],KeyE:["e","E","\u20AC","\xA2"],KeyF:["f","F","\u0111","\xAA"],KeyG:["g","G","\u014B","\u014A"],KeyH:["h","H","\u0127","\u0126"],KeyI:["i","I","\u2192","\u0131"],KeyJ:["j","J","\u0309","\u031B"],KeyK:["k","K","\u0138","&"],KeyL:["l","L","\u0142","\u0141"],KeyM:["m","M","\xB5","\xBA"],KeyN:["n","N","n","N"],KeyO:["o","O","\xF8","\xD8"],KeyP:["p","P","\xFE","\xDE"],KeyQ:["q","Q","@","\u03A9"],KeyR:["r","R","\xB6","\xAE"],KeyS:["s","S","\xDF","\xA7"],KeyT:["t","T","\u0167","\u0166"],KeyU:["u","U","\u2193","\u2191"],KeyV:["v","V","\u201C","\u2018"],KeyW:["w","W","\u0142","\u0141"],KeyX:["x","X","\xBB",">"],KeyY:["y","Y","\u2190","\xA5"],KeyZ:["z","Z","\xAB","<"],Digit1:["1","!","|","\xA1"],Digit2:["2",'"',"@","\u215B"],Digit3:["3","\xB7","#","\xA3"],Digit4:["4","$","~","$"],Digit5:["5","%","\xBD","\u215C"],Digit6:["6","&","\xAC","\u215D"],Digit7:["7","/","{","\u215E"],Digit8:["8","(","[","\u2122"],Digit9:["9",")","]","\xB1"],Digit0:["0","=","}","\xB0"],Enter:["\r","\r","\r","\r"],Escape:["\x1B","\x1B","\x1B","\x1B"],Backspace:["\b","\b","\b","\b"],Tab:[" ",""," ",""],Space:[" "," "," "," "],Minus:["'","?","\\","\xBF"],Equal:["\xA1","\xBF","\u0303","~"],BracketLeft:["\u0300","\u0302","[","\u030A"],BracketRight:["+","*","]","\u0304"],Backslash:["\xE7","\xC7","}","\u0306"],Semicolon:["\xF1","\xD1","~","\u030B"],Quote:["\u0301","\u0308","{","{"],Backquote:["\xBA","\xAA","\\","\\"],Comma:[",",";","\u2500","\xD7"],Period:[".",":","\xB7","\xF7"],Slash:["-","_","\u0323","\u0307"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadEnter:["\r","\r","\r","\r"],Numpad1:["","1","","1"],Numpad2:["","2","","2"],Numpad3:["","3","","3"],Numpad4:["","4","","4"],Numpad5:["","5","","5"],Numpad6:["","6","","6"],Numpad7:["","7","","7"],Numpad8:["","8","","8"],Numpad9:["","9","","9"],Numpad0:["","0","","0"],NumpadDecimal:["",".","","."],IntlBackslash:["<",">","|","\xA6"],NumpadEqual:["=","=","=","="],NumpadComma:[".",".",".","."],NumpadParenLeft:["(","(","(","("],NumpadParenRight:[")",")",")",")"]}};function h0(a){const y=a.split("+"),b={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:y.pop()};return y.includes("shift")&&(b.shift=!0),y.includes("alt")&&(b.alt=!0),y.includes("ctrl")&&(b.ctrl=!0),y.includes("cmd")&&(b.cmd=!0),y.includes("win")&&(b.win=!0),y.includes("meta")&&(b.meta=!0),b}function kc(a){let y="";return a.shift&&(y+="shift+"),a.alt&&(y+="alt+"),a.ctrl&&(y+="ctrl+"),a.cmd&&(y+="cmd+"),a.win&&(y+="win+"),a.meta&&(y+="meta+"),y+a.key}var Bm={enter:"[Enter]",escape:"[Escape]",backspace:"[Backspace]",tab:"[Tab]",space:"[Space]",pausebreak:"[Pause]",insert:"[Insert]",home:"[Home]",pageup:"[PageUp]",delete:"[Delete]",end:"[End]",pagedown:"[PageDown]",right:"[ArrowRight]",left:"[ArrowLeft]",down:"[ArrowDown]",up:"[ArrowUp]",numpad0:"[Numpad0]",numpad1:"[Numpad1]",numpad2:"[Numpad2]",numpad3:"[Numpad3]",numpad4:"[Numpad4]",numpad5:"[Numpad5]",numpad6:"[Numpad6]",numpad7:"[Numpad7]",numpad8:"[Numpad8]",numpad9:"[Numpad9]",numpad_divide:"[NumpadDivide]",numpad_multiply:"[NumpadMultiply]",numpad_subtract:"[NumpadSubtract]",numpad_add:"[NumpadAdd]",numpad_decimal:"[NumpadDecimal]",numpad_separator:"[NumpadComma]",capslock:"[Capslock]",f1:"[F1]",f2:"[F2]",f3:"[F3]",f4:"[F4]",f5:"[F5]",f6:"[F6]",f7:"[F7]",f8:"[F8]",f9:"[F9]",f10:"[F10]",f11:"[F11]",f12:"[F12]",f13:"[F13]",f14:"[F14]",f15:"[F15]",f16:"[F16]",f17:"[F17]",f18:"[F18]",f19:"[F19]"},Ed=[],_d;function gh(){switch(Te()){case"macos":case"ios":return"apple";case"windows":return"windows"}return"linux"}function Ns(a){(!a.platform||a.platform===gh())&&Ed.push(a)}function Om(a,y){var b;const E={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:""};if(!a)return E;for(const[ee,re]of Object.entries(y.mapping)){if(re[0]===a)return E.key=`[${ee}]`,E;if(re[1]===a)return E.shift=!0,E.key=`[${ee}]`,E;if(re[2]===a)return E.alt=!0,E.key=`[${ee}]`,E;if(re[3]===a)return E.shift=!0,E.alt=!0,E.key=`[${ee}]`,E}return E.key=(b=Bm[a])!=null?b:"",E}function Rm(a){if(a.code)return a;const y=Object.entries(kd().mapping);let b=!1,E=!1,ee="";for(let re=0;re<4;re++){for(const[ae,de]of y)if(de[re]===a.key){ee=ae,re===3?(b=!0,E=!0):re===2?b=!0:re===1&&(E=!0);break}if(ee)break}return new KeyboardEvent(a.type,he(we({},a),{altKey:b,shiftKey:E,code:ee}))}function Nm(a){var y,b;if(!a||a.key==="Unidentified"||a.key==="Dead")return;const E=a.shiftKey&&a.altKey?3:a.altKey?2:a.shiftKey?1:0;for(const ee of Ed)((y=ee.mapping[a.code])==null?void 0:y[E])===a.key?ee.score+=1:(b=ee.mapping[a.code])!=null&&b[E]&&(ee.score=0);Ed.sort((ee,re)=>re.score-ee.score)}function Fm(a){_d=Ed.find(y=>a.startsWith(y.locale))}function kd(){return _d!=null?_d:Ed[0]}function $m(){switch(gh()){case"apple":return mh;case"windows":return d0;case"linux":return f0}return mh}switch(gh()){case"apple":Ns(mh),Ns(Em),Ns(Dm),Ns(Lm);break;case"windows":Ns(d0),Ns(_m),Ns(Im),Ns(Am);break;case"linux":Ns(f0),Ns(km),Ns(Pm),Ns(Tm);break}Ns(Mm);function vh(a){var y;const b=/macos|ios/.test(Te()),E=a.split("+");let ee="";for(const re of E)ee&&(ee+=b?"\u2009":'<span class="ML__shortcut-join">+</span>'),re.startsWith("[Key")?ee+=re.slice(4,5):re.startsWith("Key")?ee+=re.slice(3,4):re.startsWith("[Digit")?ee+=re.slice(6,7):re.startsWith("Digit")?ee+=re.slice(5,6):ee+=(y={cmd:"\u2318",meta:b?"\u2318":"Ctrl",shift:b?"\u21E7":"Shift",alt:b?"\u2325":"Alt",ctrl:b?"\u2303":"Ctrl","\n":b?"\u23CE":"Return","[return]":b?"\u23CE":"Return","[enter]":b?"\u2324":"Enter","[tab]":b?"\u21E5":"Tab","[escape]":"Esc","[backspace]":b?"\u232B":"Backspace","[delete]":b?"\u2326":"Del","[pageup]":b?"\u21DE":"Page Up","[pagedown]":b?"\u21DF":"Page Down","[home]":b?"\u2912":"Home","[end]":b?"\u2913":"End","[space]":"Space","[equal]":"=","[minus]":"-","[comma]":",","[slash]":"/","[backslash]":"\\","[bracketleft]":"[","[bracketright]":"]",semicolon:";",period:".",comma:",",minus:"-",equal:"=",quote:"'",backslash:"\\",intlbackslash:"\\",backquote:"`",slash:"/",numpadmultiply:"* &#128290;",numpaddivide:"/ &#128290;",numpadsubtract:"- &#128290;",numpadadd:"+ &#128290;",numpaddecimal:". &#128290;",numpadcomma:", &#128290;",help:"help",left:"\u21E0",up:"\u21E1",right:"\u21E2",down:"\u21E3","[arrowleft]":"\u21E0","[arrowup]":"\u21E1","[arrowright]":"\u21E2","[arrowdown]":"\u21E3"}[re.toLowerCase()])!=null?y:re.toUpperCase();return ee}function wf(a){if(a instanceof MouseEvent||a instanceof PointerEvent)return{x:a.clientX,y:a.clientY};if(a instanceof TouchEvent){const y=[...a.touches].reduce((E,ee)=>({x:E.x+ee.clientX,y:E.y+ee.clientY}),{x:0,y:0}),b=a.touches.length;return{x:y.x/b,y:y.y/b}}}function Nu(a){const y={alt:!1,control:!1,shift:!1,meta:!1};return(a instanceof MouseEvent||a instanceof PointerEvent||a instanceof TouchEvent||a instanceof KeyboardEvent)&&(a.altKey&&(y.alt=!0),a.ctrlKey&&(y.control=!0),a.metaKey&&(y.meta=!0),a.shiftKey&&(y.shift=!0)),y}function zm(a,y){return!a&&y||a&&!y?!1:!a||!y?!0:a.alt===y.alt&&a.control===y.control&&a.shift===y.shift&&a.meta===y.meta}var Km=new Set(["Backquote","Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","Minus","Equal","IntlYen","KeyQ","KeyW","KeyE","KeyR","KeyT","KeyY","KeyU","KeyI","KeyO","KeyP","BracketLeft","BracketRight","Backslash","KeyA","KeyS","KeyD","KeyF","KeyG","KeyH","KeyJ","KeyK","KeyL","Semicolon","Quote","IntlBackslash","KeyZ","KeyX","KeyC","KeyV","KeyB","KeyN","KeyM","Comma","Period","Slash","IntlRo","Space","Numpad0","Numpad1","Numpad2","Numpad3","Numpad4","Numpad5","Numpad6","Numpad7","Numpad8","Numpad9","NumpadAdd","NumpadComma","NumpadDecimal","NumpadDivide","NumpadEqual","NumpadHash","NumpadMultiply","NumpadParenLeft","NumpadParenRight","NumpadStar","NumpadSubstract"]);function Sf(a){return a.ctrlKey||a.metaKey||["Dead","Process"].includes(a.key)?!1:a.code===""?!0:Km.has(a.code)}function Cf(){var a;let y=document.activeElement;for(;(a=y==null?void 0:y.shadowRoot)!=null&&a.activeElement;)y=y.shadowRoot.activeElement;return y}var wl=class Gl{static get scrim(){return Gl._scrim||(Gl._scrim=new Gl),Gl._scrim}static open(y){Gl.scrim.open(y)}static close(){Gl.scrim.close()}static get state(){return Gl.scrim.state}static get element(){return Gl.scrim.element}constructor(y){var b,E;this.lightDismiss=(b=y==null?void 0:y.lightDismiss)!=null?b:!0,this.translucent=(E=y==null?void 0:y.translucent)!=null?E:!1,this.state="closed"}get element(){if(this._element)return this._element;const y=document.createElement("div");return y.setAttribute("role","presentation"),y.style.position="fixed",y.style.contain="content",y.style.top="0",y.style.left="0",y.style.right="0",y.style.bottom="0",y.style.zIndex="var(--scrim-zindex, 10099)",y.style.outline="none",this.translucent?(y.style.background="rgba(255, 255, 255, .2)",y.style.backdropFilter="contrast(40%)"):y.style.background="transparent",this._element=y,y}open(y){var b;if(this.state!=="closed")return;this.state="opening",this.onDismiss=y==null?void 0:y.onDismiss,this.savedActiveElement=Cf();const{element:E}=this;((b=y==null?void 0:y.root)!=null?b:document.body).appendChild(E),E.addEventListener("click",this),document.addEventListener("touchmove",this,!1),document.addEventListener("scroll",this,!1);const ee=window.innerWidth-document.documentElement.clientWidth;this.savedMarginRight=document.body.style.marginRight,this.savedOverflow=document.body.style.overflow,document.body.style.overflow="hidden";const re=Number.parseFloat(getComputedStyle(document.body).marginRight);document.body.style.marginRight=`${re+ee}px`,y!=null&&y.child&&E.append(y.child),this.state="open"}close(){var y,b,E,ee;if(this.state!=="open"){console.assert(this.element.parentElement!==null);return}this.state="closing",typeof this.onDismiss=="function"&&this.onDismiss(),this.onDismiss=void 0;const{element:re}=this;re.removeEventListener("click",this),document.removeEventListener("touchmove",this,!1),document.removeEventListener("scroll",this,!1),re.remove(),document.body.style.overflow=(y=this.savedOverflow)!=null?y:"",document.body.style.marginRight=(b=this.savedMarginRight)!=null?b:"",Cf()!==this.savedActiveElement&&((ee=(E=this.savedActiveElement)==null?void 0:E.focus)==null||ee.call(E)),re.innerHTML="",this.state="closed"}handleEvent(y){this.lightDismiss&&(y.target===this._element&&y.type==="click"?(this.close(),y.preventDefault(),y.stopPropagation()):y.target===document&&(y.type==="touchmove"||y.type==="scroll")&&(this.close(),y.preventDefault(),y.stopPropagation()))}};function Hm(a,y,b){let E=null,ee=null,re=!1,ae=!1,de=!1;const fe=new AbortController,ge=fe.signal;return a.addEventListener("keydown",xe=>{if(re||xe.key==="Process"||xe.code==="CapsLock"||/(Control|Meta|Alt|Shift)(Left|Right)/.test(xe.code)){E=null;return}E=xe,ee=null,b.onKeystroke(xe)?a.textContent="":E=null},{capture:!0,signal:ge}),a.addEventListener("keypress",xe=>{re||(E&&ee&&b.onKeystroke(E),ee=xe)},{capture:!0,signal:ge}),a.addEventListener("compositionstart",xe=>{a.textContent="",re=!0,b.onCompositionStart(xe.data)},{capture:!0,signal:ge}),a.addEventListener("compositionupdate",xe=>{re&&b.onCompositionUpdate(xe.data)},{capture:!0,signal:ge}),a.addEventListener("compositionend",xe=>{a.textContent="",re&&(re=!1,b.onCompositionEnd(xe.data))},{capture:!0,signal:ge}),a.addEventListener("beforeinput",xe=>xe.stopImmediatePropagation(),{signal:ge}),a.addEventListener("input",xe=>{var Be;if(!re&&(a.textContent="",xe.inputType!=="insertCompositionText")){if(xe.inputType==="insertFromPaste"){xe.preventDefault(),xe.stopPropagation();return}b.onInput((Be=xe.data)!=null?Be:""),xe.preventDefault(),xe.stopPropagation()}},{signal:ge}),a.addEventListener("paste",xe=>{a.focus({preventScroll:!0}),a.textContent="",b.onPaste(xe)||xe.preventDefault(),xe.stopImmediatePropagation()},{signal:ge}),a.addEventListener("cut",xe=>b.onCut(xe),{capture:!0,signal:ge}),a.addEventListener("copy",xe=>b.onCopy(xe),{capture:!0,signal:ge}),a.addEventListener("blur",xe=>{var Be,Ve;if(((Ve=(Be=xe.relatedTarget)==null?void 0:Be._mathfield)==null?void 0:Ve.element)===y){a.focus({preventScroll:!0}),xe.preventDefault(),xe.stopPropagation();return}const ot=wl.state;if(ot==="open"||ot==="opening"){xe.preventDefault(),xe.stopPropagation();return}if(xe.relatedTarget===xe.target.getRootNode().host){xe.preventDefault(),xe.stopPropagation();return}de||ae||(de=!0,E=null,ee=null,b.onBlur(),de=!1)},{capture:!0,signal:ge}),a.addEventListener("focus",xe=>{de||ae||(ae=!0,b.onFocus(),ae=!1)},{capture:!0,signal:ge}),{dispose:()=>fe.abort(),cancelComposition:()=>{re&&(a.blur(),requestAnimationFrame(()=>a.focus({preventScroll:!0})))},blur:()=>{typeof a.blur=="function"&&a.blur()},focus:()=>{!ae&&typeof a.focus=="function"&&a.focus({preventScroll:!0})},hasFocus:()=>Cf()===a,setAriaLabel:xe=>a.setAttribute("aria-label",xe),setValue:xe=>{var Be;a.textContent=xe,a.style.left="-1000px",(Be=window.getSelection())==null||Be.selectAllChildren(a)},moveTo:(xe,Be)=>{a.style.top=`${Be}px`,a.style.left=`${xe}px`}}}function Lc(a){var y;if(!a||!Sf(a))return"";let b;return a.key==="Unidentified"&&a.target&&(b=a.target.value),b=(y=b!=null?b:a.key)!=null?y:a.code,/^(Dead|Return|Enter|Tab|Escape|Delete|PageUp|PageDown|Home|End|Help|ArrowLeft|ArrowRight|ArrowUp|ArrowDown)$/.test(b)&&(b=""),b}function p0(a){a=Rm(a);const y=[];return a.ctrlKey&&y.push("ctrl"),a.metaKey&&y.push("meta"),a.altKey&&y.push("alt"),a.shiftKey&&y.push("shift"),y.length===0?`[${a.code}]`:(y.push(`[${a.code}]`),y.join("+"))}function Wm(a){if(ut()){const y=Te(),b=a.startsWith("!"),E=a.endsWith(y);if(b&&!E||!b&&E)return!0}return a==="!other"?!1:a==="other"}function Vm(a,y,b){if(a.length===0)return"";const E=kc(h0(p0(b))),ee=kc({key:b.key,shift:b.shiftKey,alt:b.altKey,ctrl:b.ctrlKey,meta:b.metaKey||b.ctrlKey&&/macos|ios/.test(Te()),cmd:!1,win:!1});for(let re=a.length-1;re>=0;re--)if((a[re].key===E||a[re].key===ee)&&(!a[re].ifMode||a[re].ifMode===y))return a[re].command;return""}function m0(a){let y=a;return Ne(y)&&(y=y.length>0?y[0]+"("+y.slice(1).join("")+")":""),y}function Um(a,y){let b=[];if(typeof y=="string"){const re=hd[y];Ne(re)?b=re.slice():re&&b.push(re)}const E=m0(y),ee=new RegExp("^"+E.replace("\\","\\\\").replace("|","\\|").replace("*","\\*").replace("$","\\$").replace("^","\\^")+"([^*a-zA-Z]|$)");for(const re of a)ee.test(m0(re.command))&&b.push(re.key);return b.map(vh)}function Zm(a,y){if(a.ifPlatform&&!/^!?(macos|windows|android|ios|chromeos|other)$/.test(a.ifPlatform))throw new Error(`Unexpected platform "${a.ifPlatform}" for keybinding ${a.key}`);if(a.ifLayout!==void 0&&(y.score===0||!a.ifLayout.includes(y.id)))return;const b=h0(a.key);let E=a.ifPlatform;if(b.cmd){if(E&&E!=="macos"&&E!=="ios")throw new Error('Unexpected "cmd" modifier with platform "'+E+`"
"cmd" modifier can only be used with macOS or iOS platform.`);E||(E=Te()==="ios"?"ios":"macos"),b.win=!1,b.cmd=!1,b.meta=!0}if(b.win){if(E&&E!=="windows")throw new Error('Unexpected "win" modifier with platform "'+E+`"
"win" modifier can only be used with Windows platform.`);E="windows",b.win=!1,b.cmd=!1,b.meta=!0}if(E&&!Wm(E))return;if(/^\[.+\]$/.test(b.key))return he(we({},a),{key:kc(b)});const ee=Om(b.key,y);if(!ee)return he(we({},a),{key:kc(b)});if(ee.shift&&b.shift||ee.alt&&b.alt)throw new Error(`The keybinding ${a.key} (${yh(a.command)}) is conflicting with the key combination ${kc(ee)} using the ${y.displayName} keyboard layout`);return ee.shift=ee.shift||b.shift,ee.alt=ee.alt||b.alt,ee.meta=b.meta,ee.ctrl=b.ctrl,he(we({},a),{key:kc(ee)})}function yh(a){if(Array.isArray(a)){const y=[...a];return y.shift()+"("+y.map(b=>typeof b=="string"?`"${b}"`:b.toString()).join(", ")+")"}return a}function jm(a,y){const b=[],E=[];for(const ee of a)try{const re=Zm(ee,y);if(!re)continue;const ae=E.find(de=>de.key===re.key&&de.ifMode===re.ifMode);if(ae)throw new Error(`Ambiguous key binding ${ee.key} (${yh(ee.command)}) matches ${ae.key} (${yh(ae.command)}) with the ${y.displayName} keyboard layout`);E.push(re)}catch(re){re instanceof Error&&b.push(re.message)}return[E,b]}var Gm=class extends Bi{constructor(){super("latex")}createAtom(a){return new ns(a)}onPaste(a,y){if(!y)return!1;const b=typeof y=="string"?y:y.getData("application/x-latex")||y.getData("text/plain");return b&&a.model.contentWillChange({inputType:"insertFromPaste",data:b})?(a.stopCoalescingUndo(),a.stopRecording(),this.insert(a.model,b)&&(a.startRecording(),a.snapshot("paste"),a.model.contentDidChange({inputType:"insertFromPaste"}),Mo(a)),a.startRecording(),!0):!1}insert(a,y,b){if(!a.contentWillChange({data:y,inputType:"insertText"}))return!1;b||(b={}),b.insertionMode||(b.insertionMode="replaceSelection"),b.selectionMode||(b.selectionMode="placeholder");const{silenceNotifications:E}=a;b.silenceNotifications&&(a.silenceNotifications=!0);const ee=a.silenceNotifications;a.silenceNotifications=!0,b.insertionMode==="replaceSelection"&&!a.selectionIsCollapsed?a.deleteAtoms(jo(a.selection)):b.insertionMode==="replaceAll"?(a.root.setChildren([],"body"),a.position=0):b.insertionMode==="insertBefore"?a.collapseSelection("backward"):b.insertionMode==="insertAfter"&&a.collapseSelection("forward");const re=[];for(const fe of y)le.test(fe)&&re.push(new ns(fe));let ae=a.at(a.position);if(ae instanceof xd&&(ae=ae.lastChild),!(ae.parent instanceof xd)){const fe=new xd("");ae.parent.addChildAfter(fe,ae),ae=fe.firstChild}const de=ae.parent.addChildrenAfter(re,ae);return a.silenceNotifications=ee,b.selectionMode==="before"||(b.selectionMode==="item"?a.setSelection(a.anchor,a.offsetOf(de)):de&&(a.position=a.offsetOf(de))),a.contentDidChange({data:y,inputType:"insertText"}),a.silenceNotifications=E,!0}};function Xm(a){return a.atoms.find(y=>y.type==="latexgroup")}function Ld(a){var y,b;const E=a.atoms.find(ee=>ee.type==="latexgroup");return E?(b=(y=E.body)==null?void 0:y.filter(ee=>ee.type==="latex"))!=null?b:[]:[]}function g0(a,y){var b;let E=0,ee=!1;const re=Number.isFinite(y==null?void 0:y.before)?(b=y==null?void 0:y.before)!=null?b:0:a.lastOffset;for(;E<=re&&!ee;){const fe=a.at(E);ee=fe instanceof ns&&fe.isSuggestion,ee||E++}if(!ee)return[void 0,void 0];let ae=E,de=!1;for(;ae<=re&&!de;){const fe=a.at(ae);de=!(fe instanceof ns&&fe.isSuggestion),de||ae++}return[E-1,ae-1]}new Gm;function Mf(a){const y=Ld(a.model).filter(b=>b.isSuggestion);if(y.length!==0){a.model.position=a.model.offsetOf(y[0].leftSibling);for(const b of y)b.parent.removeChild(b)}}function Ad(a,y){var b;const{model:E}=a;Mf(a);for(const xe of Ld(E))xe.isError=!1;if(!E.selectionIsCollapsed||a.options.popoverPolicy==="off"){Tc(a);return}const ee=[];let re=E.at(E.position);for(;re&&re instanceof ns&&/^[a-zA-Z\*]$/.test(re.value);)re=re.leftSibling;if(re&&re instanceof ns&&re.value==="\\")for(ee.push(re),re=re.rightSibling;re&&re instanceof ns&&/^[a-zA-Z\*]$/.test(re.value);)ee.push(re),re=re.rightSibling;const ae=ee.map(xe=>xe.value).join(""),de=en(a,ae);if(de.length===0){if(/^\\[a-zA-Z\*]+$/.test(ae))for(const xe of ee)xe.isError=!0;Tc(a);return}const fe=(b=y==null?void 0:y.atIndex)!=null?b:0;a.suggestionIndex=fe<0?de.length-1:fe%de.length;const ge=de[a.suggestionIndex];if(ge!==ae){const xe=ee[ee.length-1];xe.parent.addChildrenAfter([...ge.slice(ae.length-ge.length)].map(Be=>new ns(Be,{isSuggestion:!0})),xe),Fu(a,{interactive:!0})}Ym(a,de)}function v0(a){const[y,b]=g0(a,{before:a.position});if(y===void 0||b===void 0)return!1;let E=!1;return a.getAtoms([y,b]).forEach(ee=>{ee.isSuggestion&&(ee.isSuggestion=!1,E=!0)}),E}function Ac(a,y="accept",b){var E,ee;Tc(a);const re=Xm(a.model);if(!re)return!1;if(y==="accept-suggestion"||y==="accept-all"){const ge=Ld(a.model).filter(xe=>xe.isSuggestion);if(ge.length!==0){for(const xe of ge)xe.isSuggestion=!1;a.model.position=a.model.offsetOf(ge[ge.length-1])}if(y==="accept-suggestion")return ge.length!==0}const de=Ld(a.model).filter(ge=>!ge.isSuggestion).map(ge=>ge.value).join(""),fe=re.leftSibling;return re.parent.removeChild(re),a.model.position=a.model.offsetOf(fe),a.switchMode((E=b==null?void 0:b.mode)!=null?E:"math"),y==="reject"||(Bi.insert(a.model,de,{selectionMode:(ee=b==null?void 0:b.selectItem)!=null&&ee?"item":"placeholder",format:"latex",mode:"math"}),a.snapshot(),a.model.announce("replacement"),a.switchMode("math")),!0}function Ef(a){var y;let b=document.getElementById(a);return b?b.dataset.refcount=Number(Number.parseInt((y=b.dataset.refcount)!=null?y:"0")+1).toString():(b=document.createElement("div"),b.setAttribute("aria-hidden","true"),b.dataset.refcount="1",b.id=a,document.body.append(b)),b}function bh(a){var y;const b=document.getElementById(a);if(!b)return;const E=Number.parseInt((y=b.getAttribute("data-refcount"))!=null?y:"0");E<=1?b.remove():b.dataset.refcount=Number(E-1).toString()}function qm(a,y){const b=new ya({from:a.context}),E=new In({mode:"math",type:"root",body:Xo(y,{context:b})}),ee=gc(Cd(new sr(E.render(b),{classes:"ML__base"}),b));return vc(ee,{classes:"ML__latex"}).toMarkup()}function Ym(a,y){var b;if(y.length===0){Tc(a);return}let E="";for(const[re,ae]of y.entries()){const de=ae,fe=qm(a,ae),ge=Um(a.keybindings,de).join("<br>");E+=`<li role="button" data-command="${de}" ${re===a.suggestionIndex?"class=ML__popover__current":""}><span class="ML__popover__latex">${de}</span><span class="ML__popover__command">${fe}</span>`,ge&&(E+=`<span class="ML__popover__keybinding">${ge}</span>`),E+="</li>"}const ee=Jm(a,`<ul>${E}</ul>`);xh()&&((b=ee.querySelector(".ML__popover__current"))==null||b.scrollIntoView({block:"nearest",inline:"nearest"})),setTimeout(()=>{var re;ee&&!xh()&&(ee.classList.add("is-visible"),_f(a),(re=ee.querySelector(".ML__popover__current"))==null||re.scrollIntoView({block:"nearest",inline:"nearest"}))},32)}function xh(){const a=document.getElementById("mathlive-suggestion-popover");return a?a.classList.contains("is-visible"):!1}function _f(a,y){var b;if(!a.element||a.element.mathfield!==a||!xh())return;if(((b=a.model.at(a.model.position))==null?void 0:b.type)!=="latex"){Tc(a);return}if(y!=null&&y.deferred){setTimeout(()=>_f(a),32);return}const E=bl(a.field);if(!E)return;const ee=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,re=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,ae=window.innerWidth-document.documentElement.clientWidth,de=window.innerHeight-document.documentElement.clientHeight,fe=window.mathVirtualKeyboard.boundingRect.height,ge=document.getElementById("mathlive-suggestion-popover");E.x+ge.offsetWidth/2>re-ae?ge.style.left=`${re-ge.offsetWidth-ae}px`:E.x-ge.offsetWidth/2<0?ge.style.left="0":ge.style.left=`${E.x-ge.offsetWidth/2}px`;const xe=E.y-E.height;ee-de-fe-E.y<xe?(ge.classList.add("ML__popover--reverse-direction"),ge.classList.remove("top-tip"),ge.classList.add("bottom-tip"),ge.style.top=`${E.y-E.height-ge.offsetHeight-15}px`):(ge.classList.remove("ML__popover--reverse-direction"),ge.classList.add("top-tip"),ge.classList.remove("bottom-tip"),ge.style.top=`${E.y+15}px`)}function Tc(a){a.suggestionIndex=0;const y=document.getElementById("mathlive-suggestion-popover");y&&(y.classList.remove("is-visible"),y.innerHTML="")}function Jm(a,y){let b=document.getElementById("mathlive-suggestion-popover");return b||(b=Ef("mathlive-suggestion-popover"),ks("suggestion-popover"),ks("core"),b.addEventListener("pointerdown",E=>E.preventDefault()),b.addEventListener("click",E=>{let ee=E.target;for(;ee&&!ee.dataset.command;)ee=ee.parentElement;ee&&(Ac(a,"reject"),Bi.insert(a.model,ee.dataset.command,{selectionMode:"placeholder",format:"latex",mode:"math"}),a.dirty=!0,a.focus())})),b.innerHTML=window.MathfieldElement.createHTML(y),b}function Qm(){document.getElementById("mathlive-suggestion-popover")&&(bh("mathlive-suggestion-popover"),x("suggestion-popover"),x("core"))}function eg(){const a=String(new Error().stack).replace(/^Error.*\n/,"").split(`
`);if(a.length===0)return console.error(`Can't use relative paths to specify assets location because the sourcefile location could not be determined (unexpected stack trace format "${new Error().stack}").`),"";let y=a[1],b=y.match(/http.*\.ts[\?:]/);return b&&(y=a[2]),b=y.match(/(https?:.*):[0-9]+:[0-9]+/),b||(b=y.match(/at (.*(\.ts))[\?:]/),b||(b=y.match(/at (.*(\.mjs|\.js))[\?:]/))),b?b[1]:(console.error(a),console.error(`Can't use relative paths to specify assets location because the source file location could not be determined (unexpected location "${y}").`),"")}var kf=null,y0,b0,wh=((b0=(y0=globalThis==null?void 0:globalThis.document)==null?void 0:y0.currentScript)==null?void 0:b0.src)||eg();function x0(a){return gu(this,null,function*(){if(/^(?:[a-z+]+:)?\/\//i.test(a))return new URL(a).href;if(kf===null)try{const y=yield fetch(wh,{method:"HEAD"});y.status===200&&(kf=y.url)}catch(y){console.error(`Invalid URL "${a}" (relative to "${wh}")`)}return new URL(a,kf!=null?kf:wh).href})}function tg(a,y,b={}){return new FontFace(a,`url(${y}.woff2) format('woff2')`,b)}var Fs="not-loaded";function ng(){return gu(this,null,function*(){return Fs="not-loaded",Lf()})}function Lf(){return gu(this,null,function*(){var a;if(Fs!=="not-loaded")return;if(Fs="loading",(a=getComputedStyle(document.documentElement).getPropertyValue("--ML__static-fonts"))!=null?a:!1){Fs="ready";return}if(document.body.classList.remove("ML__fonts-did-not-load"),"fonts"in document){const b=["KaTeX_Main","KaTeX_Math","KaTeX_AMS","KaTeX_Caligraphic","KaTeX_Fraktur","KaTeX_SansSerif","KaTeX_Script","KaTeX_Typewriter","KaTeX_Size1","KaTeX_Size2","KaTeX_Size3","KaTeX_Size4"],E=Array.from(document.fonts).map(ae=>ae.family);if(b.every(ae=>E.includes(ae))){Fs="ready";return}if(!window.MathfieldElement.fontsDirectory){Fs="not-loaded";return}const ee=yield x0(window.MathfieldElement.fontsDirectory);if(!ee){document.body.classList.add("ML__fonts-did-not-load"),Fs="error";return}const re=[["KaTeX_Main-Regular"],["KaTeX_Main-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_Main-Bold",{weight:"bold"}],["KaTeX_Main-Italic",{style:"italic"}],["KaTeX_Math-Italic",{style:"italic"}],["KaTeX_Math-BoldItalic",{style:"italic",weight:"bold"}],["KaTeX_AMS-Regular"],["KaTeX_Caligraphic-Regular"],["KaTeX_Caligraphic-Bold",{weight:"bold"}],["KaTeX_Fraktur-Regular"],["KaTeX_Fraktur-Bold",{weight:"bold"}],["KaTeX_SansSerif-Regular"],["KaTeX_SansSerif-Bold",{weight:"bold"}],["KaTeX_SansSerif-Italic",{style:"italic"}],["KaTeX_Script-Regular"],["KaTeX_Typewriter-Regular"],["KaTeX_Size1-Regular"],["KaTeX_Size2-Regular"],["KaTeX_Size3-Regular"],["KaTeX_Size4-Regular"]].map(ae=>tg(ae[0].replace(/-[a-zA-Z]+$/,""),`${ee}/${ae[0]}`,ae[1]));try{(yield Promise.all(re.map(de=>{try{return de.load()}catch(fe){}}))).forEach(de=>document.fonts.add(de)),Fs="ready";return}catch(ae){console.error(`MathLive 0.98.5: The math fonts could not be loaded from "${ee}"`,{cause:ae}),document.body.classList.add("ML__fonts-did-not-load")}Fs="error"}})}function rg(a){let y=0;for(let b=0;b<a.length;b++)y=y*31+a.charCodeAt(b),y=y|0;return Math.abs(y)}function Mo(a,y){a&&(a.dirty||(a.dirty=!0,requestAnimationFrame(()=>{Os(a)&&a.dirty&&(a.atomBoundsCache=new Map,Fu(a,y),a.atomBoundsCache=void 0)})))}function ig(a,y){var b;y=y!=null?y:{};const E=new ya({from:he(we({},a.context),{atomIdsSettings:{seed:y.forHighlighting?rg(In.serialize([a.model.root],{expandMacro:!1,defaultMode:a.options.defaultMode})):"random",groupNumbers:(b=y.forHighlighting)!=null?b:!1},letterShapeStyle:a.options.letterShapeStyle}),mathstyle:a.options.defaultMode==="inline-math"?"textstyle":"displaystyle"}),ee=a.model.root.render(E);return vc(Cd(ee,E),{classes:a.hasEditablePrompts?"ML__latex ML__prompting":"ML__latex",attributes:{translate:"no","aria-hidden":"true"}})}function w0(a,y){const{model:b}=a;b.root.caret=void 0,b.root.isSelected=!1,b.root.containsCaret=!0;for(const ee of b.atoms)ee.caret=void 0,ee.isSelected=!1,ee.containsCaret=!1;if(b.selectionIsCollapsed){const ee=b.at(b.position);ee.caret=a.model.mode;let re=ee.parent;for(;re;)re.containsCaret=!0,re=re.parent}else{const ee=b.getAtoms(b.selection,{includeChildren:!0});for(const re of ee)re.isSelected=!0}return ig(a,y).toMarkup()}function Fu(a,y){if(!Os(a))return;y!=null||(y={});const b=a.element.querySelector("[part=virtual-keyboard-toggle]");b&&(b.style.display=a.hasEditableContent?"":"none");const E=a.field;if(!E)return;const ee=a.isSelectionEditable&&a.hasFocus(),re=E.classList.contains("ML__focused");re&&!ee?E.classList.remove("ML__focused"):!re&&ee&&E.classList.add("ML__focused");let ae=w0(a,y);const de=a.element.querySelector("[part=menu-toggle]");if(de&&(a.model.atoms.length<=1||a.disabled||a.readOnly&&!a.hasEditableContent||a.userSelect==="none"?de.style.display="none":de.style.display=""),a.model.atoms.length<=1){const fe=a.options.contentPlaceholder;fe&&(ae+=`<span part=placeholder class="ML__content-placeholder">${qo(fe)}</span>`)}E.innerHTML=window.MathfieldElement.createHTML(ae),Af(a,y.interactive),a.dirty=!1}function Af(a,y){const b=a.field;if(!b)return;for(const de of b.querySelectorAll(".ML__selection, .ML__contains-highlight"))de.remove();!(y!=null&&y)&&Fs!=="error"&&Fs!=="ready"&&setTimeout(()=>{Fs==="ready"?Af(a):setTimeout(()=>Af(a),128)},32);const E=a.model,ee=b.offsetWidth,re=b.getBoundingClientRect().width;let ae=Math.floor(re)/ee;if(ae=isNaN(ae)?1:ae,E.selectionIsCollapsed){_f(a,{deferred:!0});let de=E.at(E.position);for(;de&&de.type!=="prompt"&&!(de.containsCaret&&de.displayContainsHighlight);)de=de.parent;if(de!=null&&de.containsCaret&&de.displayContainsHighlight){const fe=md(a,lu(a,de),ae);if(fe){fe.left/=ae,fe.right/=ae,fe.top/=ae,fe.bottom/=ae;const ge=document.createElement("div");ge.classList.add("ML__contains-highlight"),ge.style.position="absolute",ge.style.left=`${fe.left+1}px`,ge.style.top=`${Math.ceil(fe.top)}px`,ge.style.width=`${Math.ceil(fe.right-fe.left)}px`,ge.style.height=`${Math.ceil(fe.bottom-fe.top)}px`,b.insertBefore(ge,b.childNodes[0])}}return}for(const de of ag(vd(a,{excludeAtomsWithBackground:!0}))){de.left/=ae,de.right/=ae,de.top/=ae,de.bottom/=ae;const fe=document.createElement("div");fe.classList.add("ML__selection"),fe.style.position="absolute",fe.style.left=`${de.left}px`,fe.style.top=`${de.top}px`,fe.style.width=`${Math.ceil(de.right-de.left)}px`,fe.style.height=`${Math.ceil(de.bottom-de.top-1)}px`,b.insertBefore(fe,b.childNodes[0])}}function ag(a){let y=[];for(const b of a){let E=!1;for(const ee of y)if(b.left===ee.left&&b.right===ee.right&&b.top===ee.top&&b.bottom===ee.bottom){E=!0;break}E||y.push(b)}a=y,y=[];for(const b of a){let E=0;for(const ee of a)if(b.left>=ee.left&&b.right<=ee.right&&b.top>=ee.top&&b.bottom<=ee.bottom&&(E+=1,E>1))break;E===1&&y.push(b)}return y}var S0=3,Sl;function Ls(a,y){y=we({target:"mathfield",canUndo:!1,audioFeedback:void 0,changeContent:!1,changeSelection:!1},y!=null?y:{}),Sl||(Sl={});for(const b of Object.keys(a))console.assert(!Sl[b],"Selector already defined: ",b),Sl[b]=he(we({},y),{fn:a[b]})}function Sh(a){let y;if(Array.isArray(a)){if(a[0]==="performWithFeedback")return Sh(a[1]);y=a[0]}else y=a;return y=y.replace(/-\w/g,b=>b[1].toUpperCase()),Sl[y]}function Dc(a){var y;return(y=Sh(a))==null?void 0:y.target}function og(a,y){var b;if(!y)return!1;let E,ee=[],re=!1,ae=!1;Ne(y)?(E=y[0],ee=y.slice(1)):E=y,E=E.replace(/-\w/g,ge=>ge[1].toUpperCase());const de=Sl[E],fe=de==null?void 0:de.target;if(fe==="model"){if(!a.isSelectionEditable&&(de!=null&&de.changeContent))return a.model.announce("plonk"),!1;/^(delete|add)/.test(E)&&(E!=="deleteBackward"&&a.flushInlineShortcutBuffer(),a.snapshot(E)),/^complete/.test(E)||Mf(a),Sl[E].fn(a.model,...ee),Ad(a),ae=!0,re=!0}else if(fe==="virtual-keyboard")ae=(b=window.mathVirtualKeyboard.executeCommand(y))!=null?b:!1,re=!0;else if(Sl[E]){if(!a.isSelectionEditable&&(de!=null&&de.changeContent))return a.model.announce("plonk"),!1;/^(undo|redo)/.test(E)&&a.flushInlineShortcutBuffer(),ae=Sl[E].fn(a,...ee),re=!0}else throw new Error(`Unknown command "${E}"`);return fe!=="virtual-keyboard"&&(!a.model.selectionIsCollapsed||de!=null&&de.changeSelection&&y!=="deleteBackward")&&(a.flushInlineShortcutBuffer(),de!=null&&de.changeContent||a.stopCoalescingUndo(),a.defaultStyle={}),ae&&Mo(a),re}function sg(a,y){var b;if(!a)return!1;a.focus(),vp.keypressVibration&&Xe()&&navigator.vibrate(S0);const E=Sh(y);window.MathfieldElement.playSound((b=E==null?void 0:E.audioFeedback)!=null?b:"keypress");const ee=a.executeCommand(y);return a.scrollIntoView(),ee}Ls({performWithFeedback:(a,y)=>sg(a,y)});function lg(a){return Ad(a,{atIndex:a.suggestionIndex+1}),!1}function ug(a){return Ad(a,{atIndex:a.suggestionIndex-1}),!1}Ls({complete:Ac},{target:"mathfield",audioFeedback:"return",canUndo:!0,changeContent:!0,changeSelection:!0}),Ls({nextSuggestion:lg,previousSuggestion:ug},{target:"mathfield",audioFeedback:"keypress",changeSelection:!0});var Tf="mathlive#virtual-keyboard-message";function Ch(a){var y;return a.type!=="message"?!1:((y=a.data)==null?void 0:y.type)===Tf}var cg=class em{constructor(){this.targetOrigin=window.origin,this.originValidator="none",this._boundingRect=new DOMRect(0,0,0,0),this._isShifted=!1,window.addEventListener("message",this),this.sendMessage("proxy-created"),this.listeners={}}static get singleton(){return this._singleton||(this._singleton=new em),this._singleton}set alphabeticLayout(y){this.sendMessage("update-setting",{alphabeticLayout:y})}set layouts(y){this.sendMessage("update-setting",{layouts:y})}get normalizedLayouts(){return[]}set editToolbar(y){this.sendMessage("update-setting",{editToolbar:y})}set actionKeycap(y){this.sendMessage("update-setting",{actionKeycap:y})}set shiftKeycap(y){this.sendMessage("update-setting",{shiftKeycap:y})}set backspaceKeycap(y){this.sendMessage("update-setting",{backspaceKeycap:y})}set tabKeycap(y){this.sendMessage("update-setting",{tabKeycap:y})}set container(y){throw new Error("Container inside an iframe cannot be changed")}show(y){this.sendMessage("show",y)}hide(y){this.sendMessage("hide",y)}get isShifted(){return this._isShifted}get visible(){return this._boundingRect.height>0}set visible(y){y?this.show():this.hide()}get boundingRect(){return this._boundingRect}executeCommand(y){return this.sendMessage("execute-command",{command:y}),!0}updateToolbar(y){this.sendMessage("update-toolbar",y)}update(y){this.sendMessage("update-setting",y)}connect(){this.sendMessage("connect")}disconnect(){this.sendMessage("disconnect")}addEventListener(y,b,E){this.listeners[y]||(this.listeners[y]=new Set),this.listeners[y].has(b)||this.listeners[y].add(b)}dispatchEvent(y){return!this.listeners[y.type]||this.listeners[y.type].size===0?!0:(this.listeners[y.type].forEach(b=>{typeof b=="function"?b(y):b==null||b.handleEvent(y)}),!y.defaultPrevented)}removeEventListener(y,b,E){this.listeners[y]&&this.listeners[y].delete(b)}handleEvent(y){if(Ch(y)){if(!yd(y.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${y.origin}) cannot be handled`,"SecurityError");this.handleMessage(y.data)}}handleMessage(y){const{action:b}=y;if(b==="execute-command"){const{command:E}=y;Dc(E)==="virtual-keyboard"&&this.executeCommand(E);return}if(b==="synchronize-proxy"){this._boundingRect=y.boundingRect,this._isShifted=y.isShifted;return}if(b==="geometry-changed"){this._boundingRect=y.boundingRect,this.dispatchEvent(new Event("geometrychange"));return}}sendMessage(y,b={}){if(!window.top)throw new DOMException("A frame does not have access to the top window and can\u2018t communicate with the keyboard. Review virtualKeyboardTargetOrigin and originValidator on mathfields embedded in an iframe","SecurityError");window.top.postMessage(we({type:Tf,action:y},b),this.targetOrigin)}},C0={numeric:{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",rows:[[{latex:"x",shift:"y",variants:["y","z","t","r","x^2","x^n","x^{#?}","x_n","x_i","x_{#?}",{latex:"f(#?)",class:"small"},{latex:"g(#?)",class:"small"}]},{latex:"n",shift:"a",variants:["i","j","p","k","a","u"]},"[separator-5]","[7]","[8]","[9]","[/]","[separator-5]",{latex:"\\exponentialE",shift:"\\ln",variants:["\\exp","\\times 10^{#?}","\\ln","\\log_{10}","\\log"]},{latex:"\\imaginaryI",variants:["\\Re","\\Im","\\imaginaryJ","\\Vert #0 \\Vert"]},{latex:"\\pi",shift:"\\sin",variants:["\\prod",{latex:"\\theta",aside:"theta"},{latex:"\\rho",aside:"rho"},{latex:"\\tau",aside:"tau"},"\\sin","\\cos","\\tan"]}],[{label:"<",latex:"<",class:"hide-shift",shift:{latex:"\\le",label:"\u2264"}},{label:">",latex:">",class:"hide-shift",shift:{latex:"\\ge",label:"\u2265"}},"[separator-5]","[4]","[5]","[6]","[*]","[separator-5]",{class:"hide-shift",latex:"#@^2}",shift:"#@^{\\prime}}"},{latex:"#@^{#0}}",class:"hide-shift",shift:"#@_{#?}"},{class:"hide-shift",latex:"\\sqrt{#0}",shift:{latex:"\\sqrt[#0]{#?}}"}}],["[(]","[)]","[separator-5]","[1]","[2]","[3]","[-]","[separator-5]",{latex:"\\int^{\\infty}_{0}\\!#?\\,\\mathrm{d}x",class:"small hide-shift",shift:"\\int",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{class:"hide-shift",latex:"\\forall",shift:"\\exists"},{label:"[backspace]",width:1}],[{label:"[shift]",width:2},"[separator-5]","[0]","[.]","[=]","[+]","[separator-5]","[left]","[right]",{label:"[action]",width:1}]]},greek:{label:"&alpha;&beta;&gamma;",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.greek",rows:[[{label:"<i>&#x03c6;</i>",class:"MLK__tex hide-shift",insert:"\\varphi",aside:"phi var.",shift:"\\Phi"},{label:"<i>&#x03c2;</i>",class:"MLK__tex hide-shift",insert:"\\varsigma",aside:"sigma var.",shift:"\\Sigma"},{label:"<i>&#x03f5;</i>",class:"MLK__tex hide-shift",insert:"\\epsilon",aside:"espilon",shift:'\\char"0190'},{label:"<i>&rho;</i>",class:"MLK__tex hide-shift",insert:"\\rho",aside:"rho",shift:'\\char"3A1'},{label:"<i>&tau;</i>",class:"MLK__tex hide-shift",insert:"\\tau",aside:"tau",shift:'\\char"3A4'},{label:"<i>&upsilon;</i>",class:"MLK__tex hide-shift",insert:"\\upsilon",aside:"upsilon",shift:"\\Upsilon"},{label:"<i>&theta;</i>",class:"MLK__tex hide-shift",insert:"\\theta",aside:"theta",shift:"\\Theta"},{label:"<i>&iota;</i>",class:"MLK__tex hide-shift",insert:"\\iota",aside:"iota",shift:'\\char"399'},{label:"<i>&omicron;</i>",class:"MLK__tex hide-shift",insert:"\\omicron",aside:"omicron",shift:'\\char"39F'},{label:"<i>&pi;</i>",class:"MLK__tex hide-shift",insert:"\\pi",aside:"pi",shift:"\\Pi"}],["[separator-5]",{label:"<i>&alpha;</i>",class:"MLK__tex hide-shift",insert:"\\alpha",aside:"alpha",shift:'\\char"391'},{label:"<i>&sigma;</i>",class:"MLK__tex hide-shift",insert:"\\sigma",aside:"sigma",shift:"\\Sigma"},{label:"<i>&delta;</i>",class:"MLK__tex hide-shift",insert:"\\delta",aside:"delta",shift:"\\Delta"},{latex:"\\phi",class:"MLK__tex hide-shift",insert:"\\phi",aside:"phi",shift:"\\Phi"},{label:"<i>&gamma;</i>",class:"MLK__tex hide-shift",insert:"\\gamma",aside:"gamma",shift:"\\Gamma"},{label:"<i>&eta;</i>",class:"MLK__tex hide-shift",insert:"\\eta",aside:"eta",shift:'\\char"397'},{label:"<i>&xi;</i>",class:"MLK__tex hide-shift",insert:"\\xi",aside:"xi",shift:"\\Xi"},{label:"<i>&kappa;</i>",class:"MLK__tex hide-shift",insert:"\\kappa",aside:"kappa",shift:"\\Kappa"},{label:"<i>&lambda;</i>",class:"MLK__tex hide-shift",insert:"\\lambda",aside:"lambda",shift:"\\Lambda"},"[separator-5]"],["[shift]",{label:"<i>&zeta;</i>",class:"MLK__tex hide-shift",insert:"\\zeta",aside:"zeta",shift:'\\char"396'},{label:"<i>&chi;</i>",class:"MLK__tex hide-shift",insert:"\\chi",aside:"chi",shift:'\\char"3A7'},{label:"<i>&psi;</i>",class:"MLK__tex hide-shift",insert:"\\psi",aside:"zeta",shift:"\\Psi"},{label:"<i>&omega;</i>",class:"MLK__tex hide-shift",insert:"\\omega",aside:"omega",shift:"\\Omega"},{label:"<i>&beta;</i>",class:"MLK__tex hide-shift",insert:"\\beta",aside:"beta",shift:'\\char"392'},{label:"<i>&nu;</i>",class:"MLK__tex hide-shift",insert:"\\nu",aside:"nu",shift:'\\char"39D'},{label:"<i>&mu;</i>",class:"MLK__tex hide-shift",insert:"\\mu",aside:"mu",shift:'\\char"39C'},"[backspace]"],["[separator]",{label:"<i>&#x03b5;</i>",class:"MLK__tex",insert:"\\varepsilon",aside:"espilon var."},{label:"<i>&#x03d1;</i>",class:"MLK__tex",insert:"\\vartheta",aside:"theta var."},{label:"<i>&#x3f0;</i>",class:"MLK__tex",insert:"\\varkappa",aside:"kappa var."},{label:"<i>&#x03d6;</i>",class:"MLK__tex",insert:"\\varpi",aside:"pi var."},{label:"<i>&#x03f1;</i>",class:"MLK__tex",insert:"\\varrho",aside:"rho var."},"[left]","[right]","[action]"]]},symbols:{label:"&infin;\u2260\u2208",labelClass:"MLK__tex",tooltip:"keyboard.tooltip.symbols",rows:[[{latex:"\\sin",shift:"\\sin^{-1}",variants:[{class:"small",latex:"\\sinh"},{class:"small",latex:"\\sin^{-1}"},{class:"small",latex:"\\arsinh"}]},"\\ln",{latex:"\\mathrm{abs}",insert:"\\mathrm{abs}\\left(#0\\right)"},{latex:"\\rarr",shift:"\\rArr",variants:[{latex:"\\implies",aside:"implies"},{latex:"\\to",aside:"to"},"\\dashv",{latex:"\\roundimplies",aside:"round implies"}]},{latex:"\\exists",variants:["\\nexists"],shift:"\\nexists"},{latex:"\\in",shift:"\\notin",variants:["\\notin","\\owns"]},"\\cup",{latex:"\\overrightarrow{#@}",shift:"\\overleftarrow{#@}",variants:["\\overleftarrow{#@}","\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"]},{class:"small",latex:"\\lim_{#?}",shift:"\\lim_{x\\to\\infty}",variants:[{class:"small",latex:"\\liminf_{#?}"},{class:"small",latex:"\\limsup_{#?}"}]},"\\exponentialE"],[{latex:"\\cos",shift:"\\cos^{-1}",variants:[{class:"small",latex:"\\cosh"},{class:"small",latex:"\\cos^{-1}"},{class:"small",latex:"\\arcosh"}]},{latex:"\\log",shift:"\\log_{10}",variants:["\\log_{#0}","\\log_{10}"]},"\\left\\vert#0\\right\\vert",{latex:"\\larr",shift:"\\lArr",variants:[{latex:"\\impliedby",aside:"implied by"},{latex:"\\gets",aside:"gets"},"\\lArr","\\vdash",{latex:"\\models",aside:"models"}]},{latex:"\\forall",shift:"\\lnot",variants:[{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"}]},{latex:"\\ni",shift:"\\not\\owns"},"\\cap",{latex:"\\overline{#@}",shift:"\\underline{#@}",variants:["\\overbrace{#@}","\\overlinesegment{#@}","\\overleftrightarrow{#@}","\\overrightarrow{#@}","\\overleftarrow{#@}","\\overgroup{#@}","\\underbrace{#@}","\\underlinesegment{#@}","\\underleftrightarrow{#@}","\\underrightarrow{#@}","\\underleftarrow{#@}","\\undergroup{#@}"]},{class:"hide-shift",latex:"\\int",shift:"\\iint",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\smallint",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\intop","\\iiint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"]},{latex:"\\pi",shift:"\\tau",variants:["\\tau"]}],[{latex:"\\tan",shift:"\\tan^{-1}",variants:[{class:"small",latex:"\\tanh"},{class:"small",latex:"\\tan^{-1}"},{class:"small",latex:"\\artanh"},{class:"small",latex:"\\arctan"},{class:"small",latex:"\\arctg"},{class:"small",latex:"\\tg"}]},{latex:"\\exp",insert:"\\exp\\left(#0\\right)",variants:["\\exponentialE^{#0}"]},"\\left\\Vert#0\\right\\Vert",{latex:"\\lrArr",shift:"\\leftrightarrow",variants:[{latex:"\\iff",aside:"if and only if"},"\\leftrightarrow","\\leftrightarrows","\\Leftrightarrow",{latex:"^\\biconditional",aside:"biconditional"}]},{latex:"\\vert",shift:"!"},{latex:"#@^{\\complement}",aside:"complement",variants:[{latex:"\\setminus",aside:"set minus"},{latex:"\\smallsetminus",aside:"small set minus"}]},{latex:"\\subset",shift:"\\subseteq",variants:["\\subset","\\subseteq","\\subsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsubseteq","\\supset","\\supseteq","\\supsetneq","\\supsetneqq","\\nsupset","\\nsupseteq"]},{latex:"#@^{\\prime}",shift:"#@^{\\doubleprime}",variants:["#@^{\\doubleprime}","#@\\degree"]},{latex:"\\mathrm{d}",shift:"\\partial",variants:["\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{latex:"\\infty",variants:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"]}],[{label:"[shift]",width:2},{class:"box",latex:",",shift:";",variants:[";","?"]},{class:"box",latex:"\\colon",shift:"\\Colon",variants:[{latex:"\\Colon",aside:"such that",class:"box"},{latex:":",aside:"ratio",class:"box"},{latex:"\\vdots",aside:"",class:"box"},{latex:"\\ddots",aside:"",class:"box"},{latex:"\\ldotp",aside:"low dot",class:"box"},{latex:"\\cdotp",aside:"center dot",class:"box"},{latex:"\\ldots",aside:"low ellipsis",class:"box"},{latex:"\\cdots",aside:"center ellipsis",class:"box"},{latex:"\\therefore",aside:"therefore",class:"box"},{latex:"\\because",aside:"because",class:"box"}]},{class:"box",latex:"\\cdot",aside:"centered dot",shift:"\\ast",variants:["\\circ","\\bigcirc","\\bullet","\\odot","\\oslash","\\circledcirc","\\ast","\\star","\\times","\\doteq","\\doteqdot"]},"[separator]","[left]","[right]",{label:"[backspace]",width:1,class:"action hide-shift"},{label:"[action]",width:1}]]},compact:{label:"compact",rows:[["[+]","[-]","[*]","[/]","[=]","[.]","[(]","[)]","\\sqrt{#0}","#@^{#?}"],["[1]","[2]","[3]","[4]","[5]","[6]","[7]","[8]","[9]","[0]"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]},minimalist:{label:"minimalist",layers:[{style:`
.minimalist-backdrop {
display: flex;
justify-content: center;
}
.minimalist-container {
--keycap-height: 40px;
--keycap-max-width: 53px;
--keycap-small-font-size: 12px;
background: var(--keyboard-background);
padding: 20px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
border: 1px solid var(--keyboard-border);
box-shadow: 0 0 32px rgb(0 0 0 / 30%);
}
`,backdrop:"minimalist-backdrop",container:"minimalist-container",rows:[["+","-","\\times",{latex:"\\frac{#@}{#0}",class:"small"},"=","[.]","(",")",{latex:"\\sqrt{#0}",class:"small"},{latex:"#@^{#?}",class:"small"}],["1","2","3","4","5","6","7","8","9","0"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]}]},"numeric-only":{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",id:"numeric-only",rows:[["7","8","9","[separator]",{label:"[backspace]",width:2}],["4","5","6","[separator]","[separator]","[separator]"],["1","2","3","[separator]","[separator]","[separator]"],["0",{label:"[.]",variants:[]},"-","[separator]","[left]","[right]"]]}},Df={0:["\\varnothing","\\infty"],1:["\\frac{1}{#@}","#@^{-1}","\\times 10^{#?}","\\phi","\\imaginaryI"],2:["\\frac{1}{2}","#@^2","\\sqrt2","\\exponentialE"],3:["\\frac{1}{3}","#@^3","\\sqrt3","\\pi"],4:["\\frac{1}{4}","#@^4"],5:["\\frac{1}{5}","#@^5","\\sqrt5"],6:["\\frac{1}{6}","#@^6"],7:["\\frac{1}{7}","#@^7"],8:["\\frac{1}{8}","#@^8"],9:["\\frac{1}{9}","#@^9"],".":[".",",",";","\\colon"],",":["{,}",".",";","\\colon"],a:[{latex:"\\aleph",aside:"aleph"},{latex:"\\forall",aside:"for all"},"\xE0","\xE1","\xE2","\xE4","\xE6"],b:[{latex:"\\beth",aside:"beth"}],c:[{latex:"\\C",aside:"set of complex numbers"},"\xE7"],d:[{latex:"\\daleth",aside:"daleth"}],e:[{latex:"\\exponentialE",aside:"exponential e"},{latex:"\\exists",aside:"there is"},{latex:"\\nexists",aside:"there isn\u2019t"},"\xE8","\xE9","\xEA","\xEB"],g:[{latex:"\\gimel",aside:"gimel"}],h:[{latex:"\\hbar",aside:"h bar"},{latex:"\\hslash",aside:"h slash"}],i:[{latex:"\\imaginaryI",aside:"imaginary i"},"\xEC","\xED","\xEE","\xEF"],j:[{latex:"\\imaginaryJ",aside:"imaginary j"}],l:[{latex:"\\ell",aside:"ell"}],n:[{latex:"\\mathbb{N}",aside:"set of natural numbers"},"\xF1"],o:["\xF8","\u0153","\xF2","\xF3","\xF4","\xF6","\u0153"],p:[{latex:"\\mathbb{P}",aside:"set of primes"}],q:[{latex:"\\mathbb{Q}",aside:"set of rational numbers"}],r:[{latex:"\\mathbb{R}",aside:"set of real numbers"}],u:["\xF9","\xFA","\xFB","\xFC"],z:[{latex:"\\mathbb{Z}",aside:"set of integers"}],y:["\xFD","\xFF"],space:[{latex:'\\char"203A\\!\\char"2039',insert:"\\!",aside:"negative thin space<br>\u207B\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\,\\char"2039',insert:"\\,",aside:"thin space<br>\xB3\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\:\\char"2039',insert:"\\:",aside:"medium space<br>\u2074\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\;\\char"2039',insert:"\\;",aside:"thick space<br>\u2075\u29F8\u2081\u2088 em"},{latex:'\\char"203A\\ \\char"2039',insert:"\\ ",aside:"\u2153 em"},{latex:'\\char"203A\\enspace\\char"2039',insert:"\\enspace",aside:"\xBD em"},{latex:'\\char"203A\\quad\\char"2039',insert:"\\quad",aside:"1 em"},{latex:'\\char"203A\\qquad\\char"2039',insert:"\\qquad",aside:"2 em"}]},Td;function M0(a,y){var b,E,ee;const re=fu.singleton;if(!re)return;const ae=Ic(a),de=(E=(b=re.getKeycap(ae==null?void 0:ae.id))==null?void 0:b.variants)!=null?E:"";if(typeof de=="string"&&!E0(de)||Array.isArray(de)&&de.length===0){y==null||y();return}const fe={};let ge="";for(const ln of fg(de)){const ar=k0(ln),rn=Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);fe[rn]=ar;const[Vn,lr]=If(ar);ge+=`<div id=${rn} class="item ${lr}">${Vn}</div>`}const xe=document.createElement("div");xe.setAttribute("aria-hidden","true"),xe.className="MLK__variant-panel",xe.style.height="auto";const Be=Object.keys(fe).length;let Ve=5;Be===1?Ve=1:Be===2||Be===4?Ve=2:Be===3||Be===5||Be===6?Ve=3:Be>=7&&Be<14&&(Ve=4),xe.style.width=`calc(var(--variant-keycap-length) * ${Ve} + 12px)`,xe.innerHTML=vp.createHTML(ge),wl.open({root:(ee=re==null?void 0:re.container)==null?void 0:ee.querySelector(".ML__keyboard"),child:xe}),Td=new AbortController;const{signal:ot}=Td,gt=a==null?void 0:a.getBoundingClientRect();if(gt){gt.top-xe.clientHeight<0&&(xe.style.width="auto",Be<=6?xe.style.height="56px":Be<=12?xe.style.height="108px":Be<=18?xe.style.height="205px":xe.classList.add("compact"));const ln=Math.max(0,Math.min(window.innerWidth-xe.offsetWidth,(gt.left+gt.right-xe.offsetWidth)/2)),ar=gt.top-xe.clientHeight+5;xe.style.transform=`translate(${ln}px, ${ar}px)`,xe.classList.add("is-visible"),requestAnimationFrame(()=>{xe.addEventListener("pointerup",rn=>{const Vn=Ic(rn.target);!(Vn!=null&&Vn.id)||!fe[Vn.id]||(Mh(fe[Vn.id]),Dd(),y==null||y(),rn.preventDefault())},{capture:!0,passive:!1,signal:ot}),xe.addEventListener("pointerenter",rn=>{const Vn=Ic(rn.target);!(Vn!=null&&Vn.id)||!fe[Vn.id]||Vn.classList.add("is-active")},{capture:!0,signal:ot}),xe.addEventListener("pointerleave",rn=>{const Vn=Ic(rn.target);!(Vn!=null&&Vn.id)||!fe[Vn.id]||Vn.classList.remove("is-active")},{capture:!0,signal:ot}),window.addEventListener("pointercancel",()=>{Dd(),y==null||y()},{signal:ot}),window.addEventListener("pointerup",()=>{Dd(),y==null||y()},{signal:ot})})}}function Dd(){Td==null||Td.abort(),Td=null,wl.state==="open"&&wl.close()}function dg(a){if(a==="foreground-color"){const y=[];for(const b of Object.keys(Ze))y.push({class:"swatch-button",label:'<span style="border: 3px solid '+Ze[b]+'"></span>',command:["applyStyle",{color:b}]});return y}if(a==="background-color"){const y=[];for(const b of Object.keys(Ue))y.push({class:"swatch-button",label:'<span style="background:'+Ue[b]+'"></span>',command:["applyStyle",{backgroundColor:b}]});return y}}function E0(a){return Df[a]!==void 0}function fg(a){var y;return typeof a!="string"?a:(Df[a]||(Df[a]=(y=dg(a))!=null?y:[]),Df[a])}function hg(a){return typeof a=="string"?a:Object.entries(a).map(([y,b])=>`${y}:${b} !important`).join(";")}function pg(a){return Object.keys(a).map(y=>`${y} {${hg(a[y])}}`).join("")}function Id(a){if(!a)return"";const y=new ya,b=new In({mode:"math",type:"root",body:Xo(a,{context:y,args:ee=>ee==="@"?"{\\class{ML__box-placeholder}{\\blacksquare}}":"\\placeholder{}"})}),E=gc(Cd(new sr(b.render(y),{classes:"ML__base"}),y));return vc(E,{classes:"ML__latex"}).toMarkup()}function Pd(a){var y;if(Array.isArray(a))return a.map(E=>Pd(E)).flat();const b=typeof a=="string"?{markup:a}:a;return"rows"in b&&Array.isArray(b.rows)&&(b.rows=b.rows.map(E=>E.map(ee=>k0(ee)))),(y=b.id)!=null||(b.id="ML__layer_"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36)),[b]}function mg(){var a,y;let E=window.mathVirtualKeyboard.alphabeticLayout;if(E==="auto"){const de=kd();de&&(E=de.virtualLayout),(!E||E==="auto")&&(E=(a={fr:"azerty",be:"azerty",al:"qwertz",ba:"qwertz",cz:"qwertz",de:"qwertz",hu:"qwertz",sk:"qwertz",ch:"qwertz"}[et.locale.slice(0,2)])!=null?a:"qwerty")}const ee={qwerty:["qwertyuiop"," asdfghjkl ","^zxcvbnm~"],azerty:["azertyuiop","qsdfghjklm","^ wxcvbn ~"],qwertz:["qwertzuiop"," asdfghjkl ","^yxcvbnm~"],dvorak:["^ pyfgcrl ","aoeuidhtns","qjkxbmwvz~"],colemak:[" qwfpgjluy ","arstdhneio","^zxcvbkm~"]},re=(y=ee[E])!=null?y:ee.qwerty,ae=E==="azerty"?[[{label:"1",variants:"1"},{label:"2",shift:{latex:"\xE9"},variants:"2"},{label:"3",shift:{latex:"\xF9"},variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{label:"(",latex:"("},variants:"5"},{label:"6",shift:{label:")",latex:")"},variants:"6"},{label:"7",shift:{latex:"\xE8"},variants:"7"},{label:"8",shift:{latex:"\xEA"},variants:"8"},{label:"9",shift:{latex:"\xE7"},variants:"9"},{label:"0",shift:{latex:"\xE0"},variants:"0"}]]:[[{label:"1",variants:"1"},{label:"2",variants:"2"},{label:"3",variants:"3"},{label:"4",variants:"4"},{label:"5",shift:{latex:"\\frac{#@}{#?}"},variants:"5"},{label:"6",shift:{latex:"#@^#?"},variants:"6"},{label:"7",variants:"7"},{label:"8",shift:{latex:"\\times"},variants:"8"},{label:"9",shift:{label:"(",latex:"("},variants:"9"},{label:"0",shift:{label:")",latex:")"},variants:"0"}]];for(const de of re){const fe=[];for(const ge of de)/[a-z]/.test(ge)?fe.push({label:ge,class:"hide-shift",shift:{label:ge.toUpperCase()},variants:E0(ge)?ge:void 0}):ge==="~"?E!=="dvorak"?fe.push("[backspace]"):fe.push({label:"[backspace]",width:1}):ge==="^"?fe.push("[shift]"):ge===" "&&fe.push("[separator-5]");ae.push(fe)}return ae.push(["[-]","[+]","[=]",{label:" ",width:1.5},{label:",",shift:";",variants:".",class:"hide-shift"},"[.]","[left]","[right]",{label:"[action]",width:1.5}]),{label:"abc",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.alphabetic",layers:Pd({rows:ae})}}function _0(a){if(a==="alphabetic")return mg();if(typeof a=="string")return console.assert(C0[a]!==void 0,`MathLive 0.98.5: unknown keyboard layout "${a}"`),_0(C0[a]);let y;if("rows"in a&&Array.isArray(a.rows)){console.assert(!("layers"in a||"markup"in a),'MathLive 0.98.5: when providing a "rows" property, "layers" and "markup" are ignored');const ee=a,{rows:re}=ee,ae=ct(ee,["rows"]);y=he(we({},ae),{layers:Pd({rows:a.rows})})}else if("markup"in a&&typeof a.markup=="string"){const ee=a,{markup:re}=ee,ae=ct(ee,["markup"]);y=he(we({},ae),{layers:Pd(a.markup)})}else y=we({},a),"layers"in a?y.layers=Pd(a.layers):console.error('MathLive 0.98.5: provide either a "rows", "markup" or "layers" property');let b=!1,E=!1;for(const ee of y.layers)if(ee.rows)for(const re of ee.rows.flat()){Pc(re)&&(b=!0);const ae=re.command;typeof ae=="string"&&["undo","redo","cut","copy","paste"].includes(ae)&&(E=!0)}return(!("displayShiftedKeycaps"in a)||a.displayShiftedKeycaps===void 0)&&(y.displayShiftedKeycaps=b),(!("displayEditToolbar"in a)||a.displayEditToolbar===void 0)&&(y.displayEditToolbar=!E),y}function gg(a,y){var b,E;let ee='<div class="left">';if(a.normalizedLayouts.length>1)for(const[re,ae]of a.normalizedLayouts.entries()){const de=ae,fe=[re===y?"selected":"layer-switch"];de.tooltip&&fe.push("MLK__tooltip"),de.labelClass&&fe.push(...de.labelClass.split(" ")),ee+=`<div class="${fe.join(" ")}"`,de.tooltip&&(ee+=" data-tooltip='"+((b=lt(de.tooltip))!=null?b:de.tooltip)+"' "),re!==y&&(ee+=`data-layer="${de.layers[0].id}"`),ee+=`>${(E=de.label)!=null?E:"untitled"}</div>`}return ee+="</div>",ee}function vg(a,y){let b="";if(a.editToolbar==="none")return"";const ee=[];y.selectionIsCollapsed?ee.push("undo","redo","pasteFromClipboard"):ee.push("cutToClipboard","copyToClipboard","pasteFromClipboard");const re={undo:`<div class='action ${y.canUndo===!1?"disabled":""}'
data-command='"undo"'
data-tooltip='${lt("tooltip.undo")}'>
<svg><use xlink:href='#svg-undo' /></svg>
</div>`,redo:`<div class='action ${y.canRedo===!1?"disabled":""}'
data-command='"redo"'
data-tooltip='${lt("tooltip.redo")}'>
<svg><use xlink:href='#svg-redo' /></svg>
</div>`,cutToClipboard:`
<div class='action'
data-command='"cutToClipboard"'
data-tooltip='${lt("tooltip.cut to clipboard")}'>
<svg><use xlink:href='#svg-cut' /></svg>
</div>
`,copyToClipboard:`
<div class='action'
data-command='"copyToClipboard"'
data-tooltip='${lt("tooltip.copy to clipboard")}'>
<svg><use xlink:href='#svg-copy' /></svg>
</div>
`,pasteFromClipboard:`
<div class='action'
data-command='"pasteFromClipboard"'
data-tooltip='${lt("tooltip.paste from clipboard")}'>
<svg><use xlink:href='#svg-paste' /></svg>
</div>
`};return b+=ee.map(ae=>re[ae]).join(""),b}function yg(a){for(const y of a)bg(y)}function bg(a){const y=fu.singleton;if(!y)return;const b={};if(!a.id){if(a.hasAttribute("data-label")&&(b.label=a.dataset.label),a.hasAttribute("data-latex")&&(b.latex=a.dataset.latex),a.hasAttribute("data-key")&&(b.key=a.dataset.key),a.hasAttribute("data-insert")&&(b.insert=a.dataset.insert),a.hasAttribute("data-variants")&&(b.variants=a.dataset.variants),a.hasAttribute("data-aside")&&(b.aside=a.dataset.aside),a.className&&(b.class=a.className),!b.label&&!b.latex&&!b.key&&!b.insert&&(b.latex=a.innerText,b.label=a.innerHTML),a.hasAttribute("data-command"))try{b.command=JSON.parse(a.dataset.command)}catch(E){}a.id=y.registerKeycap(b)}if(!a.innerHTML){const[E,ee]=If(b);a.innerHTML=window.MathfieldElement.createHTML(E)}}function xg(){ks("virtual-keyboard"),ks("core"),Lf()}function wg(){x("core"),x("virtual-keyboard")}var Sg=`<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="svg-delete-backward" viewBox="0 0 576 512">
<path d="M432.1 208.1L385.9 256L432.1 303C442.3 312.4 442.3 327.6 432.1 336.1C423.6 346.3 408.4 346.3 399 336.1L352 289.9L304.1 336.1C295.6 346.3 280.4 346.3 271 336.1C261.7 327.6 261.7 312.4 271 303L318.1 256L271 208.1C261.7 199.6 261.7 184.4 271 175C280.4 165.7 295.6 165.7 304.1 175L352 222.1L399 175C408.4 165.7 423.6 165.7 432.1 175C442.3 184.4 442.3 199.6 432.1 208.1V208.1zM512 64C547.3 64 576 92.65 576 128V384C576 419.3 547.3 448 512 448H205.3C188.3 448 172 441.3 160 429.3L9.372 278.6C3.371 272.6 0 264.5 0 256C0 247.5 3.372 239.4 9.372 233.4L160 82.75C172 70.74 188.3 64 205.3 64L512 64zM528 128C528 119.2 520.8 112 512 112H205.3C201 112 196.9 113.7 193.9 116.7L54.63 256L193.9 395.3C196.9 398.3 201 400 205.3 400H512C520.8 400 528 392.8 528 384V128z"/>
</symbol>
<symbol id="svg-shift" viewBox="0 0 384 512">
<path d="M2.438 252.3C7.391 264.2 19.06 272 32 272h80v160c0 26.51 21.49 48 48 48h64C250.5 480 272 458.5 272 432v-160H352c12.94 0 24.61-7.797 29.56-19.75c4.953-11.97 2.219-25.72-6.938-34.88l-160-176C208.4 35.13 200.2 32 192 32S175.6 35.13 169.4 41.38l-160 176C.2188 226.5-2.516 240.3 2.438 252.3zM192 86.63L313.4 224H224v208H160V224H70.63L192 86.63z"/>
</symbol>
<symbol id="svg-commit" viewBox="0 0 512 512">
<path d="M135 432.1l-128-128C2.344 300.3 0 294.2 0 288s2.344-12.28 7.031-16.97l128-128c9.375-9.375 24.56-9.375 33.94 0s9.375 24.56 0 33.94L81.94 264H464v-208C464 42.75 474.8 32 488 32S512 42.75 512 56V288c0 13.25-10.75 24-24 24H81.94l87.03 87.03c9.375 9.375 9.375 24.56 0 33.94S144.4 442.3 135 432.1z"/>
</symbol>
<symbol id="circle-plus" viewBox="0 0 512 512"><path d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344c0 13.3 10.7 24 24 24s24-10.7 24-24V280h64c13.3 0 24-10.7 24-24s-10.7-24-24-24H280V168c0-13.3-10.7-24-24-24s-24 10.7-24 24v64H168c-13.3 0-24 10.7-24 24s10.7 24 24 24h64v64z"/></symbol>
<symbol id="svg-command" viewBox="0 0 640 512">
<path d="M34.495 36.465l211.051 211.05c4.686 4.686 4.686 12.284 0 16.971L34.495 475.535c-4.686 4.686-12.284 4.686-16.97 0l-7.071-7.07c-4.686-4.686-4.686-12.284 0-16.971L205.947 256 10.454 60.506c-4.686-4.686-4.686-12.284 0-16.971l7.071-7.07c4.686-4.687 12.284-4.687 16.97 0zM640 468v-10c0-6.627-5.373-12-12-12H300c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h328c6.627 0 12-5.373 12-12z"/>
</symbol>
<symbol id="svg-undo" viewBox="0 0 512 512">
<path d="M20 8h10c6.627 0 12 5.373 12 12v110.625C85.196 57.047 165.239 7.715 256.793 8.001 393.18 8.428 504.213 120.009 504 256.396 503.786 393.181 392.834 504 256 504c-63.926 0-122.202-24.187-166.178-63.908-5.113-4.618-5.354-12.561-.482-17.433l7.069-7.069c4.503-4.503 11.749-4.714 16.482-.454C150.782 449.238 200.935 470 256 470c117.744 0 214-95.331 214-214 0-117.744-95.331-214-214-214-82.862 0-154.737 47.077-190.289 116H180c6.627 0 12 5.373 12 12v10c0 6.627-5.373 12-12 12H20c-6.627 0-12-5.373-12-12V20c0-6.627 5.373-12 12-12z"/>
</symbol>
<symbol id="svg-redo" viewBox="0 0 512 512">
<path d="M492 8h-10c-6.627 0-12 5.373-12 12v110.625C426.804 57.047 346.761 7.715 255.207 8.001 118.82 8.428 7.787 120.009 8 256.396 8.214 393.181 119.166 504 256 504c63.926 0 122.202-24.187 166.178-63.908 5.113-4.618 5.354-12.561.482-17.433l-7.069-7.069c-4.503-4.503-11.749-4.714-16.482-.454C361.218 449.238 311.065 470 256 470c-117.744 0-214-95.331-214-214 0-117.744 95.331-214 214-214 82.862 0 154.737 47.077 190.289 116H332c-6.627 0-12 5.373-12 12v10c0 6.627 5.373 12 12 12h160c6.627 0 12-5.373 12-12V20c0-6.627-5.373-12-12-12z"/>
</symbol>
<symbol id="svg-arrow-left" viewBox="0 0 320 512">
<path d="M206.7 464.6l-183.1-191.1C18.22 267.1 16 261.1 16 256s2.219-11.97 6.688-16.59l183.1-191.1c9.152-9.594 24.34-9.906 33.9-.7187c9.625 9.125 9.938 24.37 .7187 33.91L73.24 256l168 175.4c9.219 9.5 8.906 24.78-.7187 33.91C231 474.5 215.8 474.2 206.7 464.6z"/>
</symbol>
<symbol id="svg-arrow-right" viewBox="0 0 320 512">
<path d="M113.3 47.41l183.1 191.1c4.469 4.625 6.688 10.62 6.688 16.59s-2.219 11.97-6.688 16.59l-183.1 191.1c-9.152 9.594-24.34 9.906-33.9 .7187c-9.625-9.125-9.938-24.38-.7187-33.91l168-175.4L78.71 80.6c-9.219-9.5-8.906-24.78 .7187-33.91C88.99 37.5 104.2 37.82 113.3 47.41z"/>
</symbol>
<symbol id="svg-tab" viewBox="0 0 448 512">
<path d="M32 217.1c0-8.8 7.2-16 16-16h144v-93.9c0-7.1 8.6-10.7 13.6-5.7l143.5 143.1c6.3 6.3 6.3 16.4 0 22.7L205.6 410.4c-5 5-13.6 1.5-13.6-5.7v-93.9H48c-8.8 0-16-7.2-16-16v-77.7m-32 0v77.7c0 26.5 21.5 48 48 48h112v61.9c0 35.5 43 53.5 68.2 28.3l143.6-143c18.8-18.8 18.8-49.2 0-68L228.2 78.9c-25.1-25.1-68.2-7.3-68.2 28.3v61.9H48c-26.5 0-48 21.6-48 48zM436 64h-8c-6.6 0-12 5.4-12 12v360c0 6.6 5.4 12 12 12h8c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12z"/>
</symbol>
<symbol id="svg-paste" viewBox="0 0 512 512"><path d="M160 32c11.6 0 21.3 8.2 23.5 19.2C185 58.6 191.6 64 199.2 64H208c8.8 0 16 7.2 16 16V96H96V80c0-8.8 7.2-16 16-16h8.8c7.6 0 14.2-5.4 15.7-12.8C138.7 40.2 148.4 32 160 32zM64 64h2.7C65 69 64 74.4 64 80V96c0 17.7 14.3 32 32 32H224c17.7 0 32-14.3 32-32V80c0-5.6-1-11-2.7-16H256c17.7 0 32 14.3 32 32h32c0-35.3-28.7-64-64-64H210.6c-9-18.9-28.3-32-50.6-32s-41.6 13.1-50.6 32H64C28.7 32 0 60.7 0 96V384c0 35.3 28.7 64 64 64H192V416H64c-17.7 0-32-14.3-32-32V96c0-17.7 14.3-32 32-32zM288 480c-17.7 0-32-14.3-32-32V192c0-17.7 14.3-32 32-32h96v56c0 22.1 17.9 40 40 40h56V448c0 17.7-14.3 32-32 32H288zM416 165.3L474.7 224H424c-4.4 0-8-3.6-8-8V165.3zM448 512c35.3 0 64-28.7 64-64V235.9c0-12.7-5.1-24.9-14.1-33.9l-59.9-59.9c-9-9-21.2-14.1-33.9-14.1H288c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H448z"/></symbol>
<symbol id="svg-cut" viewBox="0 0 512 512"><path d="M485.6 444.2L333.6 314.9C326.9 309.2 326.1 299.1 331.8 292.4C337.5 285.6 347.6 284.8 354.4 290.5L506.4 419.8C513.1 425.5 513.9 435.6 508.2 442.4C502.5 449.1 492.4 449.9 485.6 444.2zM485.7 67.76C492.5 62.07 502.5 62.94 508.2 69.69C513.9 76.45 513.1 86.55 506.3 92.24L208.5 343.1C218.3 359.7 224 379.2 224 400C224 461.9 173.9 512 112 512C50.14 512 0 461.9 0 400C0 338.1 50.14 288 112 288C141.5 288 168.4 299.4 188.4 318.1L262.2 256L188.4 193.9C168.4 212.6 141.5 224 112 224C50.14 224 0 173.9 0 112C0 50.14 50.14 0 112 0C173.9 0 224 50.14 224 112C224 132.8 218.3 152.3 208.5 168.9L287 235.1L485.7 67.76zM32 112C32 156.2 67.82 192 112 192C156.2 192 192 156.2 192 112C192 67.82 156.2 32 112 32C67.82 32 32 67.82 32 112zM112 480C156.2 480 192 444.2 192 400C192 355.8 156.2 320 112 320C67.82 320 32 355.8 32 400C32 444.2 67.82 480 112 480z"/></symbol>
<symbol id="svg-copy" viewBox="0 0 512 512"><path d="M272 416C263.2 416 256 423.2 256 432V448c0 17.67-14.33 32-32 32H64c-17.67 0-32-14.33-32-32V192c0-17.67 14.33-32 32-32h112C184.8 160 192 152.8 192 144C192 135.2 184.8 128 176 128H63.99c-35.35 0-64 28.65-64 64l.0098 256C0 483.3 28.65 512 64 512h160c35.35 0 64-28.65 64-64v-16C288 423.2 280.8 416 272 416zM502.6 86.63l-77.25-77.25C419.4 3.371 411.2 0 402.7 0H288C252.7 0 224 28.65 224 64v256c0 35.35 28.65 64 64 64h160c35.35 0 64-28.65 64-64V109.3C512 100.8 508.6 92.63 502.6 86.63zM416 45.25L466.7 96H416V45.25zM480 320c0 17.67-14.33 32-32 32h-160c-17.67 0-32-14.33-32-32V64c0-17.67 14.33-32 32-32h96l.0026 64c0 17.67 14.33 32 32 32H480V320z"/>
</symbol>
<symbol id="svg-angle-double-right" viewBox="0 0 512 512"><path d="M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"/>
</symbol>
<symbol id="svg-angle-double-left" viewBox="0 0 512 512"><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z"/>
</symbol>
<symbol id="svg-trash" viewBox="0 0 448 512">
<path d="M336 64l-33.6-44.8C293.3 7.1 279.1 0 264 0h-80c-15.1 0-29.3 7.1-38.4 19.2L112 64H24C10.7 64 0 74.7 0 88v2c0 3.3 2.7 6 6 6h26v368c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V96h26c3.3 0 6-2.7 6-6v-2c0-13.3-10.7-24-24-24h-88zM184 32h80c5 0 9.8 2.4 12.8 6.4L296 64H152l19.2-25.6c3-4 7.8-6.4 12.8-6.4zm200 432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V96h320v368zm-176-44V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm-80 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12zm160 0V156c0-6.6 5.4-12 12-12h8c6.6 0 12 5.4 12 12v264c0 6.6-5.4 12-12 12h-8c-6.6 0-12-5.4-12-12z"/>
</symbol>
<symbol id="svg-keyboard-down" viewBox="0 0 576 512"><path d="M64 48c-8.8 0-16 7.2-16 16V240c0 8.8 7.2 16 16 16H512c8.8 0 16-7.2 16-16V64c0-8.8-7.2-16-16-16H64zM0 64C0 28.7 28.7 0 64 0H512c35.3 0 64 28.7 64 64V240c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zM159 359c9.4-9.4 24.6-9.4 33.9 0l95 95 95-95c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L305 505c-4.5 4.5-10.6 7-17 7s-12.5-2.5-17-7L159 393c-9.4-9.4-9.4-24.6 0-33.9zm1-167c0-8.8 7.2-16 16-16H400c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V192zM120 88h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H120c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H200c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H280c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16zm64 16c0-8.8 7.2-16 16-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H360c-8.8 0-16-7.2-16-16V104zm96-16h16c8.8 0 16 7.2 16 16v16c0 8.8-7.2 16-16 16H440c-8.8 0-16-7.2-16-16V104c0-8.8 7.2-16 16-16z"/></symbol>
</svg>`;function Cg(a){a.resetKeycapRegistry(),xg();const y=document.createElement("div");y.className="ML__keyboard";const b=document.createElement("div");b.className="MLK__plate",b.innerHTML=window.MathfieldElement.createHTML(Sg+a.normalizedLayouts.map((ae,de)=>Mg(a,ae,de)).join(""));const E=document.createElement("div");E.className="MLK__backdrop",E.appendChild(b),y.appendChild(E),y.addEventListener("pointerdown",_g,{passive:!1});const ee=y.querySelectorAll(".ML__edit-toolbar");if(ee)for(const ae of ee)ae.addEventListener("click",de=>{var fe,ge;let xe=de.target,Be="";for(;xe&&!Be;)Be=(fe=xe==null?void 0:xe.getAttribute("data-command"))!=null?fe:"",xe=(ge=xe==null?void 0:xe.parentElement)!=null?ge:null;Be&&a.executeCommand(JSON.parse(Be))});yg(y.querySelectorAll(".MLK__keycap, .action, .fnbutton, .bigfnbutton"));const re=y.querySelectorAll(".MLK__layer");console.assert(re.length>0,"No virtual keyboards available");for(const ae of re)ae.addEventListener("pointerdown",de=>de.preventDefault());return a.currentLayer=a.latentLayer,y}function Mg(a,y,b){const E=[];if(!("layers"in y))return"";for(const ee of y.layers)E.push(`<div tabindex="-1" class="MLK__layer" id="${ee.id}">`),(a.normalizedLayouts.length>1||y.displayEditToolbar)&&(E.push("<div class='MLK__toolbar' role='toolbar'>"),E.push(gg(a,b)),y.displayEditToolbar&&E.push('<div class="ML__edit-toolbar right"></div>'),E.push("</div>")),E.push(Eg(a,ee)),E.push("</div>");return E.join("")}function Eg(a,y){if(typeof y=="string")return y;let b="";if(typeof y.style=="string"?b+=`<style>${y.style}</style>`:typeof y.style=="object"&&(b+=`<style>${pg(y.style)}</style>`),y.backdrop&&(b+=`<div class='${y.backdrop}'>`),y.container&&(b+=`<div class='${y.container}'>`),y.rows){b+="<div class=MLK__rows>";for(const E of y.rows){b+="<div dir='ltr' class=MLK__row>";for(const ee of E)if(ee){const re=a.registerKeycap(ee),[ae,de]=If(ee);/(^|\s)separator/.test(de)?b+=`<div class="${de}"`:b+=`<div tabindex="-1" id="${re}" class="${de}"`,ee.tooltip&&(b+=` data-tooltip="${ee.tooltip}"`),b+=`>${ae}</div>`}b+="</div>"}b+="</div>"}else y.markup&&(b+=y.markup);return y.container&&(b+="</div>"),y.backdrop&&(b+="</div>"),b}function If(a,y={shifted:!1}){var b,E,ee,re,ae,de,fe;let ge="",xe=(b=a.class)!=null?b:"";if(y.shifted&&Pc(a)&&(xe+=" is-active"),y.shifted&&"shift"in a)typeof a.shift=="string"?ge=Id(a.shift):typeof a.shift=="object"&&(ge=a.shift.label?a.shift.label:(E=Id(a.shift.latex||a.shift.insert||"")||a.shift.key)!=null?E:""),typeof a.shift=="object"&&(xe=(re=(ee=a.shift.class)!=null?ee:a.class)!=null?re:"");else{if(ge=a.label?a.label:(ae=Id(a.latex||a.insert||"")||a.key)!=null?ae:"",a.shift){let Be;typeof a.shift=="string"?Be=Id(a.shift):a.shift.label?Be=a.shift.label:Be=(de=Id(a.shift.latex||a.shift.insert||"")||a.shift.key)!=null?de:"",ge+=`<span class="MLK__shift">${Be}</span>`}a.aside&&(ge+=`<aside>${a.aside}</aside>`)}return a.layer&&!/layer-switch/.test(xe)&&(xe+=" layer-switch"),/(^|\s)(separator|action|shift|fnbutton|bigfnbutton)($|\s)/.test(xe)||(xe+=" MLK__keycap"),!/\bw[0-9]+\b/.test(xe)&&a.width&&(xe+=(fe={0:" w0",.5:" w5",1.5:" w15",2:" w20",5:" w50"}[a.width])!=null?fe:""),[ge,xe||"MLK__keycap"]}var $u={"[left]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-left /></svg>",command:["performWithFeedback","moveToPreviousChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-left /></svg>",command:["performWithFeedback","extendSelectionBackward"]}},"[right]":{class:"action hide-shift",label:"<svg class=svg-glyph><use xlink:href=#svg-arrow-right /></svg>",command:["performWithFeedback","moveToNextChar"],shift:{label:"<svg class=svg-glyph><use xlink:href=#svg-angle-double-right /></svg>",command:["performWithFeedback","extendSelectionForward"]}},"[up]":{class:"action hide-shift",label:"\u2191",command:["performWithFeedback","moveUp"],shift:{label:"\u219F",command:["performWithFeedback","extendSelectionUpward"]}},"[down]":{class:"action hide-shift",label:"\u2193",command:["performWithFeedback","moveDown"],shift:{label:"\u21A1",command:["performWithFeedback","extendSelectionDownward"]}},"[return]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[action]":{class:"action hide-shift",command:["performWithFeedback","commit"],shift:{label:"<svg class=svg-glyph><use xlink:href=#circle-plus /></svg>",command:["performWithFeedback","addRowAfter"]},width:1.5,label:"<svg class=svg-glyph><use xlink:href=#svg-commit /></svg>"},"[hr]":{class:"separator horizontal-rule"},"[hide-keyboard]":{class:"action",command:["hideVirtualKeyboard"],width:1.5,label:"<svg class=svg-glyph-lg><use xlink:href=#svg-keyboard-down /></svg>"},"[.]":{variants:".",command:["performWithFeedback","insertDecimalSeparator"],shift:",",class:"big-op hide-shift",label:"."},"[,]":{variants:",",command:["performWithFeedback","insertDecimalSeparator"],shift:".",class:"big-op hide-shift",label:","},"[+]":{variants:[{latex:"\\sum_{#0}^{#0}",class:"small"},"\\oplus"],latex:"+",label:"+",class:"big-op hide-shift",shift:{latex:"\\sum",insert:"\\sum",class:"small"}},"[-]":{variants:["\\pm","\\ominus"],latex:"-",label:"&#x2212;",shift:"\\pm",class:"big-op hide-shift"},"[/]":{class:"big-op hide-shift",shift:{class:"",latex:"\\frac{1}{#@}"},variants:["/","\\div","\\%","\\oslash"],latex:"\\frac{#@}{#?}",label:"&divide;"},"[*]":{variants:[{latex:"\\prod_{#0}^{#0}",class:"small"},"\\otimes","\\cdot"],latex:"\\cdot",label:"&times;",shift:{latex:"\\times"},class:"big-op hide-shift"},"[=]":{variants:["\\neq","\\equiv","\\varpropto","\\thickapprox","\\lt","\\gt","\\le","\\ge"],latex:"=",label:"=",shift:{label:"\u2260",latex:"\\ne"},class:"big-op hide-shift"},"[backspace]":{class:"action bottom right hide-shift",width:1.5,command:["performWithFeedback","deleteBackward"],label:"<svg class=svg-glyph><use xlink:href=#svg-delete-backward /></svg>",shift:{class:"action warning",label:"<svg class=svg-glyph><use xlink:href=#svg-trash /></svg>",command:"deleteAll"}},"[undo]":{class:"ghost if-can-undo",command:"undo",label:"<svg class=svg-glyph><use xlink:href=#svg-undo /></svg>",tooltip:"tooltip.undo"},"[redo]":{class:"ghost if-can-redo",command:"redo",label:"<svg class=svg-glyph><use xlink:href=#svg-redo /></svg>",tooltip:"tooltip.redo"},"[(]":{variants:[{latex:"\\lbrack",key:"["},"\\langle","\\lfloor","\\lceil",{latex:"\\lbrace",key:"{"}],key:"(",label:"(",shift:{label:"[",key:"["},class:"hide-shift"},"[)]":{variants:[{latex:"\\rbrack",key:"]"},"\\rangle","\\rfloor","\\rceil",{latex:"\\rbrace",key:"]"}],key:")",label:")",shift:{label:"]",latex:"\\rbrack"},class:"hide-shift"},"[0]":{variants:"0",latex:"0",label:"0",shift:"\\infty",class:"hide-shift"},"[1]":{variants:"1",latex:"1",label:"1",shift:"#@^{-1}",class:"hide-shift"},"[2]":{variants:"2",latex:"2",label:"2",shift:"#@^2",class:"hide-shift"},"[3]":{variants:"3",latex:"3",label:"3",shift:"#@^3",class:"hide-shift"},"[4]":{variants:"4",latex:"4",label:"4",shift:"#@^4",class:"hide-shift"},"[5]":{variants:"5",latex:"5",label:"5",shift:"#@^5",class:"hide-shift"},"[6]":{variants:"6",latex:"6",label:"6",shift:"#@^6",class:"hide-shift"},"[7]":{variants:"7",latex:"7",label:"7",shift:"#@^7",class:"hide-shift"},"[8]":{variants:"8",latex:"8",label:"8",shift:"#@^8",class:"hide-shift"},"[9]":{variants:"9",latex:"9",label:"9",shift:"#@^9",class:"hide-shift"},"[separator-5]":{class:"separator",width:.5},"[separator]":{class:"separator"},"[separator-10]":{class:"separator"},"[separator-15]":{class:"separator",width:1.5},"[separator-20]":{class:"separator",width:2},"[separator-50]":{class:"separator",width:5},"[shift]":{class:"shift bottom left",width:1.5,label:"<span class=caps-lock-indicator></span><svg class=svg-glyph><use xlink:href=#svg-shift /></svg>"},"[foreground-color]":{variants:"foreground-color",command:["applyStyle",{color:"red"}],label:"<span style='border-radius: 50%;width:22px;height:22px; border: 3px solid #cc2428; box-sizing: border-box'>"},"[background-color]":{variants:"background-color",command:["applyStyle",{backgroundColor:"yellow"}],label:"<span style='border-radius: 50%;width:22px;height:22px; background:#fff590; box-sizing: border-box'></span>"}};function k0(a){var y;if(typeof a=="string"){if(a==="[.]"&&window.MathfieldElement.decimalSeparator===","&&(a="[,]"),!$u[a])return{latex:a};a={label:a}}let b;return"label"in a&&a.label&&$u[a.label]&&(b=he(we(we({},$u[a.label]),a),{label:$u[a.label].label})),"key"in a&&a.key&&$u[a.key]&&(b=he(we(we({},$u[a.key]),a),{key:$u[a.key].key})),b?(b.command==="insertDecimalSeparator"&&(b.label=(y=window.MathfieldElement.decimalSeparator)!=null?y:"."),a.label==="[action]"&&(b=we(we({},b),window.mathVirtualKeyboard.actionKeycap)),a.label==="[shift]"&&(b=we(we({},b),window.mathVirtualKeyboard.shiftKeycap)),a.label==="[backspace]"&&(b=we(we({},b),window.mathVirtualKeyboard.backspaceKeycap)),a.label==="[tab]"&&(b=we(we({},b),window.mathVirtualKeyboard.tabKeycap)),b):a}var Bd;function _g(a){var y;if(a.button!==0)return;const b=fu.singleton;if(!b)return;let E=a.target;for(;E&&!E.getAttribute("data-layer");)E=E.parentElement;if(E){b.currentLayer=(y=E.getAttribute("data-layer"))!=null?y:"",a.preventDefault();return}const ee=Ic(a.target);if(!(ee!=null&&ee.id))return;const re=b.getKeycap(ee.id);if(!re)return;console.assert(a.type==="pointerdown");const ae=new AbortController,de=ae.signal;ee.classList.add("is-pressed"),ee.addEventListener("pointerenter",Pf(ae),{capture:!0,signal:de}),ee.addEventListener("pointerleave",Pf(ae),{capture:!0,signal:de}),ee.addEventListener("pointercancel",Pf(ae),{signal:de}),ee.addEventListener("pointerup",Pf(ae),{signal:de}),Pc(re)&&(ee.classList.add("is-active"),b.shiftPressCount++),re.variants&&(Bd&&clearTimeout(Bd),Bd=setTimeout(()=>{ee.classList.contains("is-pressed")&&(ee.classList.remove("is-pressed"),ee.classList.add("is-active"),a.target&&"releasePointerCapture"in a.target&&a.target.releasePointerCapture(a.pointerId),M0(ee,()=>{ae.abort(),ee==null||ee.classList.remove("is-active")}))},300)),a.preventDefault()}function Pf(a){return y=>{const b=Ic(y.target);if(!(b!=null&&b.id))return;const E=fu.singleton;if(!E)return;const ee=E.getKeycap(b.id);if(ee){if(y.type==="pointerenter"&&y.target===b&&y.isPrimary&&b.classList.add("is-pressed"),y.type==="pointercancel"){b.classList.remove("is-pressed"),Pc(ee)&&(E.shiftPressCount--,b.classList.toggle("is-active",E.isShifted)),a.abort();return}if(y.type==="pointerleave"&&y.target===b){b.classList.remove("is-pressed"),Pc(ee)&&(E.shiftPressCount--,b.classList.toggle("is-active",E.isShifted));return}if(y.type==="pointerup"){Bd&&clearTimeout(Bd),Pc(ee)?b.classList.toggle("is-active",E.isShifted):b.classList.contains("is-pressed")&&(b.classList.remove("is-pressed"),E.isShifted&&ee.shift?typeof ee.shift=="string"?E.executeCommand(["insert",ee.shift,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]):Mh(ee.shift):Mh(ee),E.shiftPressCount===1&&!y.shiftKey&&(E.shiftPressCount=0)),a.abort(),y.preventDefault();return}}}}function Mh(a){var y;let b=a.command;!b&&a.insert&&(b=["insert",a.insert,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),!b&&a.key&&(b=["typedText",a.key,{focus:!0,feedback:!0,simulateKeystroke:!0}]),!b&&a.latex&&(b=["insert",a.latex,{focus:!0,feedback:!0,scrollIntoView:!0,mode:"math",format:"latex"}]),b||(b=["typedText",a.label,{focus:!0,feedback:!0,simulateKeystroke:!0}]),(y=fu.singleton)==null||y.executeCommand(b)}function kg(a){if(a.nodeType!==1)return!1;const y=a.classList;return y.contains("MLK__keycap")||y.contains("shift")||y.contains("action")||y.contains("fnbutton")||y.contains("bigfnbutton")}function Ic(a){if(!a)return;let y=a;for(;y&&!kg(y);)y=y.parentElement;return y!=null?y:void 0}function Pc(a){return!!a.class&&/(^|\s)shift($|\s)/.test(a.class)}var fu=class tm{constructor(){this.originalContainerBottomPadding=null,this.keycapRegistry={},this._shiftPressCount=0;var y,b,E;this.targetOrigin=window.origin,this.originValidator="none",this._alphabeticLayout="auto",this._layouts=Object.freeze(["default"]),this._editToolbar="default",this._container=(b=(y=window.document)==null?void 0:y.body)!=null?b:null,this._visible=!1,this._rebuilding=!1,this.observer=new ResizeObserver(ee=>{this.adjustBoundingRect(),this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect})}),this.listeners={};try{(E=window.top)==null||E.addEventListener("message",this)}catch(ee){window.addEventListener("message",this)}document.body.addEventListener("focusin",ee=>{const re=ee.target;re!=null&&re.isConnected&&setTimeout(()=>{const ae=L0();ae&&!ae.readOnly&&ae.mathVirtualKeyboardPolicy==="auto"&&Qe()&&this.show({animate:!0})},300)}),document.addEventListener("focusout",ee=>{ee.target.mathVirtualKeyboardPolicy!=="manual"&&setTimeout(()=>{L0()||this.hide()},300)})}get currentLayer(){var y,b,E;return(E=(b=(y=this._element)==null?void 0:y.querySelector(".MLK__layer.is-visible"))==null?void 0:b.id)!=null?E:""}set currentLayer(y){var b;if(!this._element){this.latentLayer=y;return}let E=y?this._element.querySelector(`#${y}.MLK__layer`):null;E||(E=this._element.querySelector(".MLK__layer")),E&&((b=this._element.querySelector(".MLK__layer.is-visible"))==null||b.classList.remove("is-visible"),E.classList.add("is-visible")),this.render()}get shiftPressCount(){return this._shiftPressCount}set shiftPressCount(y){var b;this._shiftPressCount=y>2||y<0?0:y,(b=this._element)==null||b.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.render()}get isShifted(){return this._shiftPressCount>0}resetKeycapRegistry(){this.keycapRegistry={}}registerKeycap(y){const b="ML__k"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);return this.keycapRegistry[b]=y,b}getKeycap(y){return y?this.keycapRegistry[y]:void 0}getLayer(y){const b=this.normalizedLayouts;for(const E of b)for(const ee of E.layers)if(ee.id===y)return ee}get alphabeticLayout(){return this._alphabeticLayout}set alphabeticLayout(y){this._alphabeticLayout=y,this.rebuild()}get actionKeycap(){return this._actionKeycap}set actionKeycap(y){this._actionKeycap=typeof y=="string"?{label:y}:y}get shiftKeycap(){return this._shiftKeycap}set shiftKeycap(y){this._shiftKeycap=typeof y=="string"?{label:y}:y}get backspaceKeycap(){return this._backspaceKeycap}set backspaceKeycap(y){this._backspaceKeycap=typeof y=="string"?{label:y}:y}get tabKeycap(){return this._tabKeycap}set tabKeycap(y){this._tabKeycap=typeof y=="string"?{label:y}:y}get layouts(){return this._layouts}set layouts(y){this.updateNormalizedLayouts(y),this.rebuild()}updateNormalizedLayouts(y){const b=Array.isArray(y)?[...y]:[y],E=b.findIndex(ee=>ee==="default");E>=0&&b.splice(E,1,"numeric","symbols","alphabetic","greek"),this._layouts=Object.freeze(b),this._normalizedLayouts=b.map(ee=>_0(ee))}get normalizedLayouts(){return this._normalizedLayouts||this.updateNormalizedLayouts(this._layouts),this._normalizedLayouts}get editToolbar(){return this._editToolbar}set editToolbar(y){this._editToolbar=y,this.rebuild()}get container(){return this._container}set container(y){this._container=y,this.rebuild()}static get singleton(){if(this._singleton===void 0)try{this._singleton=new tm}catch(y){this._singleton=null}return this._singleton}get style(){return this._style}addEventListener(y,b,E){this.listeners[y]||(this.listeners[y]=new Set),this.listeners[y].has(b)||this.listeners[y].add(b)}dispatchEvent(y){return!this.listeners[y.type]||this.listeners[y.type].size===0?!0:(this.listeners[y.type].forEach(b=>{typeof b=="function"?b(y):b==null||b.handleEvent(y)}),!y.defaultPrevented)}removeEventListener(y,b,E){this.listeners[y]&&this.listeners[y].delete(b)}get element(){return this._element}set element(y){var b;this._element!==y&&((b=this._element)==null||b.remove(),this._element=y)}get visible(){return this._visible}set visible(y){y?this.show():this.hide()}get boundingRect(){var y;if(!this._visible)return new DOMRect;const b=(y=this._element)==null?void 0:y.getElementsByClassName("MLK__plate")[0];return b?b.getBoundingClientRect():new DOMRect}adjustBoundingRect(){var y,b;const E=this.boundingRect.height;if(this.container===document.body){(y=this._element)==null||y.style.setProperty("--_keyboard-height",`calc(${E}px + var(--_padding-top) + var(--_padding-bottom) + env(safe-area-inset-bottom, 0))`);const ee=E-1;this.container.style.paddingBottom=this.originalContainerBottomPadding?`calc(${this.originalContainerBottomPadding} + ${ee}px)`:`${ee}px`}else(b=this._element)==null||b.style.setProperty("--_keyboard-height",`${E}px`)}rebuild(){if(this._rebuilding||!this._element)return;this._rebuilding=!0;const y=this.currentLayer;requestAnimationFrame(()=>{this._rebuilding=!1,this._element&&(this._element.remove(),this._element=void 0),this.visible&&(this.buildAndAttachElement(),this.currentLayer=y,this.render(),this.adjustBoundingRect(),this._element.classList.add("is-visible"))})}render(){if(!this._element)return;const y=this.getLayer(this.currentLayer);this._element.classList.toggle("backdrop-is-transparent",!!(y&&(y.backdrop||y.container)));const b=this._element.querySelectorAll(".MLK__layer.is-visible .MLK__keycap, .MLK__layer.is-visible .action, .fnbutton, .MLK__layer.is-visible .bigfnbutton, .MLK__layer.is-visible .shift");if(b)for(const E of b){const ee=this.getKeycap(E.id);if(ee){const[re,ae]=If(ee,{shifted:this.isShifted});E.innerHTML=window.MathfieldElement.createHTML(re),E.className=ae}}}show(y){var b;if(this._visible)return;const E=this.container;if(E&&window.mathVirtualKeyboard&&this.stateWillChange(!0)){if(this._element||(this.buildAndAttachElement(),this.adjustBoundingRect()),!this._visible){const ee=this._element.getElementsByClassName("MLK__plate")[0];if(ee&&this.observer.observe(ee),E===window.document.body){const re=E.style.paddingBottom;this.originalContainerBottomPadding=re;const ae=ee.offsetHeight-1;E.style.paddingBottom=re?`calc(${re} + ${ae}px)`:`${ae}px`}window.addEventListener("mouseup",this),window.addEventListener("blur",this),window.addEventListener("keydown",this,{capture:!0}),window.addEventListener("keyup",this,{capture:!0}),(b=this._element)==null||b.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.currentLayer=this.latentLayer}this._visible=!0,y!=null&&y.animate?requestAnimationFrame(()=>{this._element&&(this._element.classList.add("animate"),this._element.addEventListener("transitionend",()=>{var ee;return(ee=this._element)==null?void 0:ee.classList.remove("animate")},{once:!0}),this._element.classList.add("is-visible"),this.stateChanged())}):(this._element.classList.add("is-visible"),this.stateChanged())}}hide(y){var b;const E=this.container;if(E&&this._visible&&this.stateWillChange(!1)){if(this._visible=!1,this._element){this.latentLayer=this.currentLayer;const ee=this._element.getElementsByClassName("MLK__plate")[0];ee&&this.observer.unobserve(ee),window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("keydown",this,{capture:!0}),window.removeEventListener("keyup",this,{capture:!0}),window.removeEventListener("contextmenu",this,{capture:!0}),Dd(),wg(),(b=this._element)==null||b.remove(),this._element=void 0,this.originalContainerBottomPadding!==null&&(E.style.paddingBottom=this.originalContainerBottomPadding)}this.stateChanged()}}get height(){var y,b;return(b=(y=this.element)==null?void 0:y.offsetHeight)!=null?b:0}buildAndAttachElement(){var y;console.assert(!this.element),this.element=Cg(this),window.addEventListener("contextmenu",this,{capture:!0}),this.element.addEventListener("contextmenu",b=>{b.shiftKey||((b.ctrlKey||b.button===2)&&M0(b.target),b.preventDefault(),b.stopPropagation())},{capture:!0}),(y=this.container)==null||y.appendChild(this.element)}handleEvent(y){if(Ch(y)){if(!yd(y.origin,this.originValidator))throw new DOMException(`Message from unknown origin (${y.origin}) cannot be handled`,"SecurityError");y.data.action==="disconnect"?this.connectedMathfieldWindow=void 0:y.data.action!=="update-setting"&&y.data.action!=="proxy-created"&&y.data.action!=="execute-command"&&(console.assert(y.source!==void 0),this.connectedMathfieldWindow=y.source),this.handleMessage(y.data,y.source)}if(this._element)switch(y.type){case"mouseup":case"blur":document.body.style.userSelect="",this.shiftPressCount=0;break;case"contextmenu":y.button!==2&&y.preventDefault();break;case"keydown":{y.key==="Shift"&&!y.repeat&&(this.shiftPressCount=1);break}case"keyup":{(y.key==="Shift"||!y.getModifierState("Shift")&&this.shiftPressCount!==2)&&(this.shiftPressCount=0);break}}}handleMessage(y,b){const{action:E}=y;if(E==="execute-command"){const{command:ee}=y,re=Dc(ee);if(window.top!==void 0&&re!=="virtual-keyboard")return;this.executeCommand(ee);return}if((E==="connect"||E==="show")&&this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},b),E!=="disconnect"&&window===window.top){if(E==="show"){typeof y.animate!="undefined"?this.show({animate:y.animate}):this.show();return}if(E==="hide"){typeof y.animate!="undefined"?this.hide({animate:y.animate}):this.hide();return}if(E==="update-setting"){y.alphabeticLayout&&(this.alphabeticLayout=y.alphabeticLayout),y.layouts&&(this.layouts=y.layouts),y.editToolbar&&(this.editToolbar=y.editToolbar);return}if(E==="proxy-created"){this.sendMessage("synchronize-proxy",{boundingRect:this.boundingRect,alphabeticLayout:this._alphabeticLayout,layouts:this._layouts,editToolbar:this._editToolbar},b);return}}}sendMessage(y,b,E){if(E||(E=this.connectedMathfieldWindow),this.targetOrigin===null||this.targetOrigin==="null"||E===window){window.dispatchEvent(new MessageEvent("message",{source:window,data:we({type:Tf,action:y},b)}));return}if(E)E.postMessage(we({type:Tf,action:y},b),{targetOrigin:this.targetOrigin});else if(b.command&&this.dispatchEvent(new CustomEvent("math-virtual-keyboard-command",{detail:b.command})),y==="execute-command"&&Array.isArray(b.command)&&b.command[0]==="insert"){const ee=b.command[1].split("");for(const re of ee)this.dispatchEvent(new KeyboardEvent("keydown",{key:re,bubbles:!0})),this.dispatchEvent(new KeyboardEvent("keyup",{key:re,bubbles:!0}))}}stateWillChange(y){return this.dispatchEvent(new CustomEvent("before-virtual-keyboard-toggle",{detail:{visible:y},bubbles:!0,cancelable:!0,composed:!0}))}stateChanged(){this.dispatchEvent(new Event("virtual-keyboard-toggle")),this._visible||(this.dispatchEvent(new Event("geometrychange")),this.sendMessage("geometry-changed",{boundingRect:this.boundingRect}))}focus(){this.sendMessage("focus",{})}blur(){this.sendMessage("blur",{})}updateToolbar(y){const b=this._element;if(!b)return;b.classList.toggle("is-math-mode",y.mode==="math"),b.classList.toggle("is-text-mode",y.mode==="text"),b.classList.toggle("can-undo",y.canUndo),b.classList.toggle("can-redo",y.canRedo),b.classList.toggle("can-copy",!y.selectionIsCollapsed),b.classList.toggle("can-copy",!y.selectionIsCollapsed),b.classList.toggle("can-paste",!0);const E=b.querySelectorAll(".ML__edit-toolbar");if(E)for(const ee of E)ee.innerHTML=vg(this,y)}update(y){this._style=y.style,this.updateToolbar(y)}connect(){this.connectedMathfieldWindow=window}disconnect(){this.connectedMathfieldWindow=void 0}executeCommand(y){let b,E=[],ee=Dc(y);return Ne(y)?(b=y[0],b==="performWithFeedback"&&(y=y.slice(1),ee=Dc(y)),E=y.slice(1)):b=y,b=b.replace(/-\w/g,re=>re[1].toUpperCase()),ee==="virtual-keyboard"?Sl[b].fn(void 0,...E):(this.sendMessage("execute-command",{command:y}),!1)}dispose(){window.removeEventListener("mouseup",this),window.removeEventListener("blur",this),window.removeEventListener("message",this)}};function L0(){var a,y;let b=Cf(),E=null;for(;b;){if("host"in b&&((y=(a=b.host)==null?void 0:a.tagName)==null?void 0:y.toLowerCase())==="math-field"){E=b.host;break}b=b.parentNode}return E}if(ut()&&!("mathVirtualKeyboard"in window))if(window===window.top){const a=fu.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>a})}else Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>cg.singleton,configurable:!0});function Bf(a){const y={};for(const b of Object.keys(a))switch(b){case"scriptDepth":const E=a.scriptDepth;if(Ne(E))y.scriptDepth=[E[0],E[1]];else if(typeof E=="number")y.scriptDepth=[E,E];else if(typeof E=="string"){const[re,ae]=E.split(",").map(de=>parseInt(de.trim()));y.scriptDepth=[re,ae]}else throw new TypeError("Unexpected value for scriptDepth");break;case"mathVirtualKeyboardPolicy":let ee=a.mathVirtualKeyboardPolicy.toLowerCase();if(ee==="sandboxed"){if(window!==window.top){const re=fu.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>re})}ee="manual"}y.mathVirtualKeyboardPolicy=ee;break;case"letterShapeStyle":a.letterShapeStyle==="auto"?et.locale.startsWith("fr")?y.letterShapeStyle="french":y.letterShapeStyle="tex":y.letterShapeStyle=a.letterShapeStyle;break;case"defaultMode":["text","math","inline-math"].includes(a.defaultMode)?y.defaultMode=a.defaultMode:(console.error('MathLive 0.98.5: valid values for defaultMode are "text", "math" or "inline-math"'),y.defaultMode="math");break;case"macros":y.macros=Gn(a.macros);break;default:Ne(a[b])?y[b]=[...a[b]]:typeof a[b]=="object"&&!(a[b]instanceof Element)&&b!=="computeEngine"?y[b]=we({},a[b]):y[b]=a[b]}return y}function zu(a,y){let b;typeof y=="string"?b=[y]:y===void 0?b=Object.keys(a):b=y;const E={};for(const ee of b)a[ee]===null?E[ee]=null:Ne(a[ee])?E[ee]=[...a[ee]]:typeof a[ee]=="object"&&!(a[ee]instanceof Element)&&ee!=="computeEngine"?E[ee]=we({},a[ee]):E[ee]=a[ee];return typeof y=="string"?E[y]:E}function Of(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:xt,backgroundColorMap:Ge,letterShapeStyle:et.locale.startsWith("fr")?"french":"tex",minFontScale:0,smartMode:!1,smartFence:!0,smartSuperscript:!0,scriptDepth:[1/0,1/0],removeExtraneousParentheses:!0,isImplicitFunction:a=>["\\sin","\\cos","\\tan","\\arcsin","\\arccos","\\arctan","\\arcsec","\\arccsc","\\arsinh","\\arcosh","\\artanh","\\arcsech","\\arccsch","\\arg","\\ch","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\sec","\\sinh","\\sh","\\tanh","\\tg","\\th","\\lg","\\lb","\\log","\\ln"].includes(a),mathModeSpace:"",placeholderSymbol:"\u25A2",contentPlaceholder:"",popoverPolicy:"auto",environmentPopoverPolicy:"off",keybindings:lh,inlineShortcuts:ff,inlineShortcutTimeout:0,mathVirtualKeyboardPolicy:"auto",virtualKeyboardTargetOrigin:window==null?void 0:window.origin,originValidator:"none",onInlineShortcut:()=>"",onScrollIntoView:null,onExport:sh,value:""}}function A0(a){return a.defaultMode==="inline-math"?"math":a.defaultMode}function hu(a,y){!a||!y||(Ne(a)?a.forEach(b=>hu(b,y)):typeof a=="object"&&!a.style.color&&!a.style.backgroundColor&&!a.style.fontFamily&&!a.style.fontShape&&!a.style.fontSeries&&!a.style.fontSize&&!a.style.variant&&!a.style.variantStyle&&(a.applyStyle(y),hu(a.body,y),hu(a.above,y),hu(a.below,y),hu(a.subscript,y),hu(a.superscript,y)))}function Eh(a,y,b,E){function ee(ae,de){for(const fe of re)if(fe.style[ae]!==de)return!1;return!0}if(y=a.normalizeRange(y),y[0]===y[1])return!1;const re=a.getAtoms(y,{includeChildren:!0});E.operation==="toggle"&&(b.color&&ee("color",b.color)&&(b.color="none",delete b.verbatimColor),b.backgroundColor&&ee("backgroundColor",b.backgroundColor)&&(b.backgroundColor="none",delete b.verbatimBackgroundColor),b.fontFamily&&ee("fontFamily",b.fontFamily)&&(b.fontFamily="none"),b.fontSeries&&ee("fontSeries",b.fontSeries)&&(b.fontSeries="auto"),b.fontShape&&ee("fontShape",b.fontShape)&&(b.fontShape="auto"),b.fontSize&&ee("fontSize",b.fontSize)&&(b.fontSize=dl),b.variant&&ee("variant",b.variant)&&(b.variant="normal"),b.variantStyle&&ee("variantStyle",b.variantStyle)&&(b.variantStyle=""));for(const ae of re)ae.applyStyle(b);return!0}function Lg(a,y){const b=a.at(a.position);if(b.type==="composition")b.value=y;else{const{caret:E}=b;b.caret=void 0;const ee=new Wl(y,{mode:b.mode});ee.caret=E,b.parent.addChildAfter(ee,b),a.position+=1}}function Ag(a){const y=a.at(a.position);y.type==="composition"&&(y.parent.removeChild(y),a.position-=1)}Cr(["math","displaymath"],Gs),Cr("center",Gs),Rt("displaylines","",{parse:a=>{const y=[];let b=[];a.beginContext({tabular:!0});do{if(a.end()||a.match("<}>"))break;a.matchColumnSeparator()||a.matchRowSeparator()?(y.push([b]),b=[]):b.push(...a.scan(E=>["<}>","&","\\cr","\\\\","\\tabularnewline"].includes(E)))}while(!0);return a.endContext(),y.push([b]),y},createAtom:a=>new zi("lines",a.args,[],{leftDelim:".",rightDelim:".",columns:[{align:"l"}]})}),Tr("array","{columns:colspec}",(a,y,b,E)=>new zi(a,_h(y),b,{columns:E[0],mathstyleName:"textstyle"})),Tr(["equation","equation*","subequations"],"",(a,y,b)=>new zi(a,_h(y),b,{columns:[{align:"c"}]})),Tr(["multline","multline*"],"",Gs),Tr(["align","align*","aligned","eqnarray"],"",Gs),Tr("split","",Gs),Tr(["gather","gathered"],"",Gs),Tr(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",Gs),Tr(["smallmatrix","smallmatrix*"],"[columns:colspec]",Gs),Tr(["cases","dcases","rcases"],"",Gs);function Tg(a){for(const y of a)for(const b of y)if(b.length>0)return!1;return!0}function _h(a,y=1){return Tg(a)?Array(y).fill([[new In({type:"first"}),new hi]]):a.map(b=>b.length===0?[[new In({type:"first"})]]:b.map(E=>E.length===0?[new In({type:"first"})]:(E[0].type!=="first"&&E.unshift(new In({type:"first"})),E)))}function Gs(a,y=[[[]]],b=[],E=[]){switch(y=_h(y,["split","align","align*","aligned","eqnarray"].includes(a)?2:1),a){case"math":return new zi(a,y,b,{mathstyleName:"textstyle"});case"displaymath":return new zi(a,y,b,{mathstyleName:"textstyle"});case"center":return new zi(a,y,b,{columns:[{align:"c"}]});case"multline":case"multline*":return new zi(a,y,b,{columns:[{align:"m"}],leftDelim:".",rightDelim:"."});case"split":return new zi(a,y,b,{columns:[{align:"r"},{align:"l"}],minColumns:2});case"gather":case"gathered":return new zi(a,y,b,{columns:[{gap:.25},{align:"c"},{gap:0}]});case"pmatrix":case"pmatrix*":return new zi(a,y,b,{mathstyleName:"textstyle",leftDelim:"(",rightDelim:")",columns:Ku(E[0])});case"bmatrix":case"bmatrix*":return new zi(a,y,b,{mathstyleName:"textstyle",leftDelim:"[",rightDelim:"]",columns:Ku(E[0])});case"Bmatrix":case"Bmatrix*":return new zi(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\lbrace",rightDelim:"\\rbrace",columns:Ku(E[0])});case"vmatrix":case"vmatrix*":return new zi(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\vert",rightDelim:"\\vert",columns:Ku(E[0])});case"Vmatrix":case"Vmatrix*":return new zi(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\Vert",rightDelim:"\\Vert",columns:Ku(E[0])});case"matrix":case"matrix*":return new zi(a,y,b,{mathstyleName:"textstyle",leftDelim:".",rightDelim:".",columns:Ku(E==null?void 0:E[0])});case"smallmatrix":case"smallmatrix*":return new zi(a,y,b,{mathstyleName:"scriptstyle",columns:Ku(E==null?void 0:E[0]),colSeparationType:"small",arraystretch:.5});case"cases":case"dcases":return new zi(a,y,b,{mathstyleName:a==="dcases"?"displaystyle":"textstyle",arraystretch:1.2,leftDelim:"\\lbrace",rightDelim:".",columns:[{align:"l"},{gap:1},{align:"l"}]});case"rcases":return new zi(a,y,b,{arraystretch:1.2,leftDelim:".",rightDelim:"\\rbrace",columns:[{align:"l"},{gap:1},{align:"l"}]});case"lines":return new zi(a,y,b,{leftDelim:".",rightDelim:".",columns:[{align:"l"}]});case"align":case"align*":case"aligned":case"eqnarray":{let ee=0;for(const de of y)ee=Math.max(ee,de.length);const re=[{gap:0},{align:"r"},{gap:.25},{align:"l"}];let ae=2;for(;ae<ee;)re.push({gap:1},{align:"r"},{gap:.25},{align:"l"}),ae+=2;return re.push({gap:0}),new zi(a,y,b,{arraycolsep:0,columns:re,minColumns:2})}}return new zi(a,y,b,{mathstyleName:"textstyle"})}function Ku(a){return a!=null?a:[{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"},{align:"c"}]}function Dg(a,y){let b=a.at(a.position);for(;b&&!(b.parent instanceof zi);)b=b.parent;if(b&&b.type==="array"&&b.environmentName,!b||!(b.parent instanceof zi)){const E=a.at(a.position);if(b=E,!b.parent.parent){let ee=a.extractAtoms([a.position,a.lastOffset]),re=a.extractAtoms([0,a.position]);re.length===0&&(re=Ff()),ee.length===0&&(ee=Ff());let ae;return y.endsWith("column")?(ae=Gs("split",[[re,ee]]),a.root=ae,Hu(ae,0,0)?Wu(a,ae,0,0):Hu(ae,0,1)?Wu(a,ae,0,1):a.position=a.offsetOf(E)):(ae=Gs("lines",[[re],[ee]]),a.root=ae,Hu(ae,0,0)?Wu(a,ae,0,0):Hu(ae,1,0)?Wu(a,ae,1,0):a.position=a.offsetOf(E)),[void 0,[0,0]]}if(b.parent instanceof za){const ee=b.parent;let re=a.extractAtoms([a.position,a.offsetOf(ee.lastChild)]),ae=a.extractAtoms([a.offsetOf(ee.firstChild),a.position]);ae.length===0&&(ae=Ff()),re.length===0&&(re=Ff());let de="pmatrix";const fe=ee.leftDelim,ge=ee.rightDelim;fe==="("&&(ge===")"||ge==="?")?de="pmatrix":(fe==="["||fe==="\\lbrack")&&(ge==="]"||ge==="\\rbrack"||ge==="?")?de="bmatrix":fe==="\\vert"&&ge==="\\vert"?de="vmatrix":fe==="\\Vert"&&ge==="\\Vert"?de="Vmatrix":(fe==="{"||fe==="\\lbrace")&&(ge==="."||ge==="?")&&(de="cases");const xe=Gs(de,y.endsWith("column")?[[ae,re]]:[[ae],[re]]);return ee.parent.addChildBefore(xe,ee),ee.parent.removeChild(ee),Hu(xe,0,0)?Wu(a,xe,0,0):y.endsWith("column")?Hu(xe,0,1)?Wu(a,xe,0,1):a.position=a.offsetOf(b):Hu(xe,1,0)?Wu(a,xe,1,0):a.position=a.offsetOf(b),[void 0,[0,0]]}}return b&&b.parent instanceof zi?[b.parent,b.parentBranch]:[void 0,[0,0]]}function Hu(a,y,b){const E=a.getCell(y,b);return!E||E.length!==2?!1:E[1].type==="placeholder"}function Ig(a,y,b,E){const ee=y.getCell(b,E);return ee?[a.offsetOf(ee[0]),a.offsetOf(ee[ee.length-1])]:-1}function Wu(a,y,b,E){const ee=Ig(a,y,b,E);typeof ee!="number"&&a.setSelection(ee)}function Rf(a,y,b,E,ee){const re=y.getCell(b,E);re&&a.setPositionHandlingPlaceholder(a.offsetOf(re[ee==="start"?0:re.length-1]))}function Nf(a,y){const[b,[E,ee]]=Dg(a,y);if(b)switch(y){case"after row":b.addRowAfter(E),Rf(a,b,E+1,0,"end");break;case"after column":if(b.maxColumns<=b.colCount){a.announce("plonk");return}b.addColumnAfter(ee),Rf(a,b,E,ee+1,"end");break;case"before row":b.addRowBefore(E),Rf(a,b,E,0,"start");break;case"before column":if(b.maxColumns<=b.colCount){a.announce("plonk");return}b.addColumnBefore(ee),Rf(a,b,E,ee,"start");break}}function T0(a){return a.contentWillChange({inputType:"insertText"})?(Nf(a,"after row"),a.contentDidChange({inputType:"insertText"}),!0):!1}function Pg(a){return a.contentWillChange({inputType:"insertText"})?(Nf(a,"before row"),a.contentDidChange({inputType:"insertText"}),!0):!1}function D0(a){return a.contentWillChange({inputType:"insertText"})?(Nf(a,"after column"),a.contentDidChange({inputType:"insertText"}),!0):!1}function Bg(a){return a.contentWillChange({inputType:"insertText"})?(Nf(a,"before column"),a.contentDidChange({inputType:"insertText"}),!0):!1}function I0(a,y){if(!a.contentWillChange({}))return!1;a.mathfield.snapshot();let b=".",E=".";switch(y){case"pmatrix":case"pmatrix*":b="(",E=")";break;case"bmatrix":case"bmatrix*":b="[",E="]";break;case"Bmatrix":case"Bmatrix*":b="\\lbrace",E="\\rbrace";break;case"vmatrix":case"vmatrix*":b="\\vert",E="\\vert";break;case"Vmatrix":case"Vmatrix*":b="\\Vert",E="\\Vert";break;case"matrix":case"matrix*":b=".",E=".";break;case"cases":case"dcases":b="\\lbrace";break;case"rcases":E="\\rbrace";break}const ee=a.at(a.position),re=ee.type==="array"?ee:a.parentEnvironment;return re.environmentName=y,re.leftDelim=b,re.rightDelim=E,a.contentDidChange({}),!0}function P0(a,y){let b=a.at(a.position);for(;b&&!(Array.isArray(b.parentBranch)&&b.parent instanceof zi);)b=b.parent;if(Array.isArray(b==null?void 0:b.parentBranch)&&(b==null?void 0:b.parent)instanceof zi){const E=b.parent,ee=b.parentBranch;let re;switch(y){case"row":if(E.rowCount>1){E.removeRow(ee[0]);const ae=E.getCell(Math.max(0,ee[0]-1),ee[1]);re=a.offsetOf(ae[ae.length-1])}break;case"column":if(E.colCount>E.minColumns){E.removeColumn(ee[1]);const ae=E.getCell(ee[0],Math.max(0,ee[1]-1));re=a.offsetOf(ae[ae.length-1])}break}re&&a.setPositionHandlingPlaceholder(re)}}function Og(a){return a.contentWillChange({inputType:"deleteContent"})?(P0(a,"row"),a.contentDidChange({inputType:"deleteContent"}),!0):!1}function Rg(a){return a.contentWillChange({inputType:"deleteContent"})?(P0(a,"column"),a.contentDidChange({inputType:"deleteContent"}),!0):!1}Ls({addRowAfter:T0,addColumnAfter:D0,addRowBefore:Pg,addColumnBefore:Bg,removeRow:Og,removeColumn:Rg,setEnvironment:I0},{target:"model",canUndo:!0,changeContent:!0,changeSelection:!0});function Ff(){return[new hi]}var B0=class nm{constructor(y){this.recording=!1,this.model=y,this.reset()}reset(){this.stack=[],this.index=-1,this.lastOp=""}startRecording(){this.recording=!0}stopRecording(){this.recording=!1}canUndo(){return this.index-1>=0}canRedo(){return this.stack.length-1>this.index}stopCoalescing(y){y&&this.index>=0&&(this.stack[this.index].selection=y),this.lastOp=""}undo(){return this.canUndo()?(this.model.setState(this.stack[this.index-1],{silenceNotifications:!1,type:"undo"}),this.index-=1,this.lastOp="",!0):!1}redo(){return this.canRedo()?(this.index+=1,this.model.setState(this.stack[this.index],{silenceNotifications:!1,type:"redo"}),this.lastOp="",!0):!1}pop(){this.canUndo()&&(this.stack.splice(this.index,this.stack.length-this.index),this.index-=1)}snapshot(y){return this.recording?(y&&y===this.lastOp&&this.pop(),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push(this.model.getState()),this.index+=1,this.stack.length>nm.maximumDepth&&(this.stack.shift(),this.index-=1),this.lastOp=y!=null?y:"",!0):!1}};B0.maximumDepth=1e3;var Ng=B0;function kh(a,y,b){if(a.at(y).mode!=="text")return y;const E=b==="backward"?-1:1;let ee;if(pe.test(a.at(y).value)){let re=y,ae;do ae=a.at(re).mode==="text"&&pe.test(a.at(re).value),re+=E;while(a.at(re)&&ae);ee=a.at(re)?re-2*E:re-E}else if(/\s/.test(a.at(y).value)){let re=y;for(;a.at(re)&&a.at(re).mode==="text"&&/\s/.test(a.at(re).value);)re+=E;if(!a.at(re))ee=re-E;else{let ae=!0;do ae=a.at(re).mode==="text"&&!/\s/.test(a.at(re).value),re+=E;while(a.at(re)&&ae);ee=a.at(re)?re-2*E:re-E}}else{let re=y;for(;a.at(re)&&a.at(re).mode==="text"&&!/\s/.test(a.at(re).value);)re+=E;ee=a.at(re)?re:re-E;let ae=!0;for(;a.at(re)&&ae;)ae=a.at(re).mode==="text"&&/\s/.test(a.at(re).value),ae&&(ee=re),re+=E;ee=a.at(re)?re-2*E:re-E}return ee-(E>0?0:1)}function Bc(a,y,b){var E,ee,re,ae,de,fe,ge;const xe=a.position;(E=b==null?void 0:b.extend)!=null&&E||a.collapseSelection(y);let Be=a.at(a.position);if(y==="forward"&&(Be.type==="subsup"?(Be=Be.rightSibling,Be||(Be=a.at(a.position+1))):Be=a.at(a.position+1)),!Be)return a.announce("plonk"),!1;let Ve=a.offsetOf(Be);if(Be instanceof al)Ve=kh(a,Ve,y);else if(Be instanceof ns)if(Be.isSuggestion)for(console.assert(y==="forward");Be&&Be instanceof ns;)Be.isSuggestion=!1,Ve=a.offsetOf(Be),Be=Be.rightSibling;else if(y==="forward"){if(Be=Be.rightSibling,!Be||!(Be instanceof ns))return a.announce("plonk"),!1;for(;Be&&Be instanceof ns&&/[a-zA-Z\*]/.test(Be.value);)Ve=a.offsetOf(Be),Be=Be.rightSibling}else{if(Be=Be.leftSibling,!Be||!(Be instanceof ns))return a.announce("plonk"),!1;for(;Be&&Be instanceof ns&&/[a-zA-Z\*]/.test(Be.value);)Ve=a.offsetOf(Be),Be=Be.leftSibling}else if(y==="forward"&&Be.type==="mopen"){let ot=0;do Be.type==="mopen"?ot+=1:Be.type==="mclose"&&(ot-=1),Be=Be.rightSibling;while(!Be.isLastSibling&&ot!==0);Ve=a.offsetOf(Be.leftSibling)}else if(y==="backward"&&Be.type==="mclose"){let ot=0;do Be.type==="mopen"?ot+=1:Be.type==="mclose"&&(ot-=1),Be=Be.leftSibling;while(!Be.isFirstSibling&&ot!==0);Ve=a.offsetOf(Be)}else if(y==="backward")if(Be.type==="first")for(;Ve>0&&Be.type==="first";)Ve-=1,Be=a.at(Ve);else{const ot=Be.type;Be.type==="subsup"&&(Ve=a.offsetOf(a.at(Ve).leftSibling)),Ve-=1;let gt=(ee=a.at(Ve))==null?void 0:ee.type;for(;Ve>=0&&gt===ot;)((re=a.at(Ve))==null?void 0:re.type)==="subsup"?Ve=a.offsetOf(a.at(Ve).leftSibling):Ve-=1,gt=a.at(Ve).type}else{const{type:ot}=Be;let gt=(ae=a.at(Ve))==null?void 0:ae.type;const{lastOffset:ln}=a;for(;Ve<=ln&&(gt===ot||gt==="subsup");){for(;((de=a.at(Ve).rightSibling)==null?void 0:de.type)==="subsup";)Ve=a.offsetOf(a.at(Ve).rightSibling);Ve+=1,gt=(fe=a.at(Ve))==null?void 0:fe.type}Ve-=1}if((ge=b==null?void 0:b.extend)!=null&&ge){if(!a.setSelection(a.anchor,Ve))return a.announce("plonk"),!1}else{if(Ve===a.position)return a.announce("plonk"),!1;a.position=Ve}return a.announce("move",xe),a.mathfield.stopCoalescingUndo(),!0}function Cl(a,y,b){var E,ee;if(b=b!=null?b:{extend:!1},a.mathfield.adoptStyle=y==="backward"?"right":"left",y!=="forward"){const[de,fe]=g0(a);de!==void 0&&fe!==void 0&&a.deleteAtoms([de,fe])}if(y==="upward")return $g(a,b);if(y==="downward")return zg(a,b);if(b.extend){let de=$f(a,a.position,y);de<0&&(de=0),de>a.lastOffset&&(de=a.lastOffset);const fe=a.setSelection(a.anchor,de);return a.mathfield.stopCoalescingUndo(),fe}if(a.selectionIsPlaceholder){a.collapseSelection(y);const de=Cl(a,y);return a.mathfield.stopCoalescingUndo(),de}let re=a.position;const ae=re;if(a.collapseSelection(y)?(re=a.position,O0(a,re)||(re=$f(a,re,y))):re=$f(a,re,y),re<0||re>a.lastOffset){let de=!0;return a.silenceNotifications||(de=(ee=(E=a.mathfield.host)==null?void 0:E.dispatchEvent(new CustomEvent("move-out",{detail:{direction:y},cancelable:!0,bubbles:!0,composed:!0})))!=null?ee:!0),de&&a.announce("plonk"),de}return a.setPositionHandlingPlaceholder(re),a.mathfield.stopCoalescingUndo(),a.announce("move",ae),!0}function $f(a,y,b){return y=y+(b==="forward"?1:-1),y<0||y>a.lastOffset||O0(a,y)?y:$f(a,y,b)}function O0(a,y){var b;const E=a.at(y);let ee=E.parent;for(;ee&&!ee.inCaptureSelection;)ee=ee.parent;return!(ee!=null&&ee.inCaptureSelection||(b=E.parent)!=null&&b.skipBoundary&&(!E.isFirstSibling&&E.isLastSibling||E.type==="first")||a.mathfield.hasEditablePrompts&&!E.parentPrompt)}function Fg(a,y,b){let E=1/0,ee=0;for(;ee<y.length;ee++){const re=Cc(a.getHTMLElement(y[ee])).right,ae=Math.abs(b-re);if(ae<=E)E=ae;else break}return y[ee-1]}function zf(a,y,b,E,ee){const re=a.mathfield.hasEditablePrompts,ae=re?b.filter(ge=>ge.type==="prompt"&&!ge.captureSelection):b,de=Cc(a.mathfield.getHTMLElement(y)).right,fe=a.offsetOf(Fg(a.mathfield,ae,de))-(re?1:0);if(E){const[ge,xe]=a.selection.ranges[0];let Be;fe<(ee==="up"?ge:xe)?Be={ranges:[[fe,xe]],direction:"backward"}:Be={ranges:[[ge,fe]],direction:"forward"},a.setSelection(Be)}else a.setPositionHandlingPlaceholder(fe);a.announce(`move ${ee}`)}function $g(a,y){var b,E;const ee=(b=y==null?void 0:y.extend)!=null?b:!1;ee||a.collapseSelection("backward");const re=()=>{var fe,ge;let xe=!0;return a.silenceNotifications||(xe=(ge=(fe=a.mathfield.host)==null?void 0:fe.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"upward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?ge:!0),a.announce(xe?"plonk":"line"),xe},ae=a.at(a.position);let de=ae;for(;de&&de.parentBranch!=="below"&&!(Array.isArray(de.parentBranch)&&de.parent instanceof zi);)de=de.parent;if(Array.isArray(de==null?void 0:de.parentBranch)&&de.parent instanceof zi){const fe=de.parent;if(de.parentBranch[0]<1)return re();const ge=de.parentBranch[0]-1,xe=fe.array[ge][de.parentBranch[1]];if(!xe.some(Ve=>Ve.type==="prompt"&&!Ve.captureSelection)&&a.mathfield.hasEditablePrompts)return re();zf(a,ae,xe,ee,"up")}else if(de){const fe=(E=de.parent.branch("above"))!=null?E:de.parent.createBranch("above");if(!fe.some(xe=>xe.type==="prompt"&&xe.placeholderId)&&a.mathfield.hasEditablePrompts)return re();zf(a,ae,fe,ee,"up")}else return re();return a.mathfield.stopCoalescingUndo(),!0}function zg(a,y){var b,E;const ee=(b=y==null?void 0:y.extend)!=null?b:!1;ee||a.collapseSelection("forward");const re=()=>{var fe,ge;let xe=!0;return a.silenceNotifications||(xe=(ge=(fe=a.mathfield.host)==null?void 0:fe.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"downward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?ge:!0),a.announce(xe?"plonk":"line"),xe},ae=a.at(a.position);let de=ae;for(;de&&de.parentBranch!=="above"&&!(Array.isArray(de.parentBranch)&&de.parent instanceof zi);)de=de.parent;if(Array.isArray(de==null?void 0:de.parentBranch)&&de.parent instanceof zi){const fe=de.parent;if(de.parentBranch[0]+1>fe.array.length-1)return re();const ge=de.parentBranch[0]+1,xe=fe.array[ge][de.parentBranch[1]];if(!xe.some(Ve=>Ve.type==="prompt"&&!Ve.captureSelection)&&a.mathfield.hasEditablePrompts)return re();zf(a,ae,xe,ee,"down")}else if(de){const fe=(E=de.parent.branch("below"))!=null?E:de.parent.createBranch("below");if(!fe.some(xe=>xe.type==="prompt")&&a.mathfield.hasEditablePrompts)return re();zf(a,ae,fe,ee,"down")}else return re();return!0}function R0(a){const y=a.position,b=a.at(y).parent;return b!=null&&b.parent?(a.position=a.offsetOf(b),a.mathfield.stopCoalescingUndo(),a.announce("move",y),!0):(a.announce("plonk"),!1)}function Kg(a){let y=0,b=a.at(a.position),E=!1;for(;b;)(!b.hasEmptyBranch("superscript")||!b.hasEmptyBranch("subscript"))&&(y+=1),b.hasEmptyBranch("superscript")?b.hasEmptyBranch("subscript")||(E=!1):E=!0,b=b.parent;return E?y:0}function Hg(a){let y=0,b=a.at(a.position),E=!1;for(;b;)(!b.hasEmptyBranch("superscript")||!b.hasEmptyBranch("subscript"))&&(y+=1),b.hasEmptyBranch("superscript")?b.hasEmptyBranch("subscript")||(E=!0):E=!1,b=b.parent;return E?y:0}function N0(a){var y;if(a.collapseSelection(),Kg(a)>=a.mathfield.options.scriptDepth[1])return a.announce("plonk"),!1;let b=a.at(a.position);return b.subsupPlacement===void 0&&(((y=b.rightSibling)==null?void 0:y.type)!=="subsup"&&b.parent.addChildAfter(new Zs({style:b.computedStyle}),b),b=b.rightSibling),b.createBranch("superscript"),a.setSelection(a.getSiblingsRange(a.offsetOf(b.superscript[0]))),!0}function F0(a){var y;if(a.collapseSelection(),Hg(a)>=a.mathfield.options.scriptDepth[0])return a.announce("plonk"),!1;let b=a.at(a.position);return b.subsupPlacement===void 0&&(((y=a.at(a.position+1))==null?void 0:y.type)!=="subsup"&&b.parent.addChildAfter(new Zs({style:a.at(a.position).computedStyle}),b),b=a.at(a.position+1)),b.createBranch("subscript"),a.setSelection(a.getSiblingsRange(a.offsetOf(b.subscript[0]))),!0}function Wg(){function a(fe){const ge=[],xe=[];return[...fe.querySelectorAll(`input, select, textarea, a[href], button,
[tabindex], audio[controls], video[controls],
[contenteditable]:not([contenteditable="false"]), details>summary`)].filter(y).forEach((Ve,ot)=>{const gt=E(Ve);gt===0?ge.push(Ve):xe.push({documentOrder:ot,tabIndex:gt,node:Ve})}),xe.sort((Ve,ot)=>Ve.tabIndex===ot.tabIndex?Ve.documentOrder-ot.documentOrder:Ve.tabIndex-ot.tabIndex).map(Ve=>Ve.node).concat(ge)}function y(fe){return!(!b(fe)||ee(fe)||E(fe)<0)}function b(fe){return!(fe.disabled||fe.type==="hidden"&&fe.tagName.toUpperCase()==="INPUT"||de(fe))}function E(fe){var ge;const xe=Number.parseInt((ge=fe.getAttribute("tabindex"))!=null?ge:"NaN",10);return Number.isNaN(xe)?fe.contentEditable==="true"||(fe.nodeName==="AUDIO"||fe.nodeName==="VIDEO")&&fe.getAttribute("tabindex")===null?0:fe.tabIndex:xe}function ee(fe){return fe.tagName.toUpperCase()==="INPUT"&&fe.type==="radio"&&!ae(fe)}function re(fe,ge){for(const xe of fe)if(xe.checked&&xe.form===ge)return xe;return null}function ae(fe){var ge;if(!fe.name)return!0;const Be=((ge=fe.form)!=null?ge:fe.ownerDocument).querySelectorAll('input[type="radio"][name="'+fe.name+'"]'),Ve=re(Be,fe.form);return!Ve||Ve===fe}function de(fe){if(!ut()||fe===document.activeElement||fe.contains(document.activeElement))return!1;if(getComputedStyle(fe).visibility==="hidden")return!0;const ge=fe.getBoundingClientRect();if(ge.width===0||ge.height===0)return!0;for(;fe;){if(getComputedStyle(fe).display==="none")return!0;fe=fe.parentElement}return!1}return ut()?a(document.body):[]}function bs(a,y,b="forward"){const E=a.position;if(Array.isArray(y)){const ee=a.offsetOf(y[0]),re=a.offsetOf(y[y.length-1]);return b==="forward"?a.setSelection(ee,re):a.setSelection(re,ee),a.announce("move",E),a.mathfield.stopCoalescingUndo(),!0}return b==="forward"?bs(a,[y.leftSibling,y]):bs(a,[y,y.leftSibling])}function ll(a,y){const b=a.position;if(typeof y=="number"&&(y=a.at(y)),y.type==="prompt")a.setSelection(a.offsetOf(y.firstChild),a.offsetOf(y.lastChild));else{const E=a.offsetOf(y);y.type==="placeholder"?a.setSelection(E-1,E):a.position=E}return a.announce("move",b),a.mathfield.stopCoalescingUndo(),!0}function Kf(a,y,b=!0){var E,ee;const re=y==="forward"?1:-1;a.at(a.anchor).type==="placeholder"&&Cl(a,y);let ae;const de=a.at(a.anchor).parentPrompt;de?y==="forward"?ae=a.offsetOf(de)+1:ae=a.offsetOf(de.leftSibling):ae=Math.max(a.position+re,0);const fe=Lh(a,ae,y);if(!fe||y==="forward"&&a.offsetOf(fe)<ae||y==="backward"&&a.offsetOf(fe)>ae){if(!b||!((ee=(E=a.mathfield.host)==null?void 0:E.dispatchEvent(new CustomEvent("move-out",{detail:{direction:y},cancelable:!0,bubbles:!0,composed:!0})))==null||ee))return a.announce("plonk"),!1;const xe=Wg();if(!document.activeElement||xe.length<=1)return a.announce("plonk"),!1;let Be=xe.indexOf(document.activeElement)+re;return Be<0&&(Be=xe.length-1),Be>=xe.length&&(Be=0),xe[Be].focus(),a.mathfield.stopCoalescingUndo(),!0}return ll(a,fe),!0}function Lh(a,y=0,b="forward"){return a.findAtom(E=>E.type==="placeholder"||E.type==="prompt"||!a.mathfield.readOnly&&E.treeDepth>2&&E.isFirstSibling&&E.isLastSibling,y,b)}Ls({moveToOpposite:a=>{const y={superscript:"subscript",subscript:"superscript",above:"below",below:"above"},b=a.at(a.position),{parent:E}=b;if(!E)return a.announce("plonk"),!1;const ee=b.parentBranch;let re;if(typeof ee=="string"&&(re=y[ee]),!re){const de=b.subsupPlacement?F0(a):N0(a);return a.mathfield.stopCoalescingUndo(),de}E.branch(re)||E.createBranch(re);const ae=a.setSelection(a.getBranchRange(a.offsetOf(E),re));return a.mathfield.stopCoalescingUndo(),ae},moveBeforeParent:a=>{const{parent:y}=a.at(a.position);return y?(a.position=a.offsetOf(y),a.mathfield.stopCoalescingUndo(),!0):(a.announce("plonk"),!1)},moveAfterParent:a=>R0(a),moveToNextChar:a=>Cl(a,"forward"),moveToPreviousChar:a=>Cl(a,"backward"),moveUp:a=>Cl(a,"upward"),moveDown:a=>Cl(a,"downward"),moveToNextWord:a=>Bc(a,"forward"),moveToPreviousWord:a=>Bc(a,"backward"),moveToGroupStart:a=>{const y=a.offsetOf(a.at(a.position).firstSibling);return y===a.position?(a.announce("plonk"),!1):(a.position=y,a.mathfield.stopCoalescingUndo(),!0)},moveToGroupEnd:a=>{const y=a.offsetOf(a.at(a.position).lastSibling);return y===a.position?(a.announce("plonk"),!1):(a.position=y,a.mathfield.stopCoalescingUndo(),!0)},moveToNextGroup:a=>{var y,b,E,ee;if(a.position===a.lastOffset&&a.anchor===a.lastOffset)return Kf(a,"forward");const re=a.at(a.position);if(re.mode==="text"){if(a.selectionIsCollapsed){let Ve=re;for(;Ve&&Ve.mode==="text";)Ve=Ve.leftSibling;let ot=re;for(;((y=ot.rightSibling)==null?void 0:y.mode)==="text";)ot=ot.rightSibling;if(Ve&&ot)return bs(a,[Ve,ot])}if(re.rightSibling.mode==="text"){let Ve=re;for(;Ve&&Ve.mode==="text";)Ve=Ve.rightSibling;return Ve?(ll(a,(b=Ve.leftSibling)!=null?b:Ve),a.mathfield.switchMode("math"),!0):ll(a,a.lastOffset)}}const de=a.at(a.anchor).parentPrompt,fe=de?a.offsetOf(de)+1:Math.max(a.position+1,0),ge=Lh(a,fe,"forward");if(ge)return ll(a,ge);const xe=$0(a,re,Ve=>Ve.type==="leftright"||Ve.type==="text","forward");if(xe){if(xe.mode==="text"){let Ve=xe;for(;Ve&&Ve.mode==="text";)Ve=Ve.rightSibling;return bs(a,[(E=xe.leftSibling)!=null?E:xe,(ee=Ve.leftSibling)!=null?ee:Ve])}return bs(a,xe)}const Be=re.parent;if(Be){if(Be.type==="leftright"||Be.type==="surd")return bs(a,Be);if(re.parentBranch==="superscript"&&Be.subscript)return bs(a,Be.subscript);if(re.parentBranch==="above"&&Be.below)return bs(a,Be.below);if(re.parentBranch==="superscript"||re.parentBranch==="subscript")return ll(a,Be);if(re.parentBranch==="above"||re.parentBranch==="below")return bs(a,Be)}return ll(a,a.lastOffset)},moveToPreviousGroup:a=>{var y;if(a.position===0&&a.anchor===0)return Kf(a,"backward");let b=a.at(a.position);const E=b.mode;if(E==="text"){if(a.selectionIsCollapsed){let de=b;for(;de&&de.mode==="text";)de=de.leftSibling;let fe=b;for(;((y=fe.rightSibling)==null?void 0:y.mode)==="text";)fe=fe.rightSibling;if(de&&fe)return bs(a,[de,fe])}for(;b&&b.mode==="text";)b=b.leftSibling;return b?ll(a,b):ll(a,0)}const ee=a.at(a.anchor).parentPrompt,re=ee?a.offsetOf(ee.leftSibling):Math.max(a.position-1,0),ae=Lh(a,re,"backward");if(ae)return ll(a,ae);if(E==="math"){const de=$0(a,b,ge=>ge.type==="leftright"||ge.type==="text","backward");if(de){if(de.mode==="text"){let ge=de;for(;ge&&ge.mode==="text";)ge=ge.leftSibling;return bs(a,[de,ge])}return bs(a,de)}const fe=b.parent;if(fe){if(fe.type==="leftright"||fe.type==="surd")return bs(a,fe);if(b.parentBranch==="subscript"&&fe.superscript)return bs(a,fe.superscript);if(b.parentBranch==="below"&&fe.above)return bs(a,fe.above);if(b.parentBranch==="superscript"||b.parentBranch==="subscript")return ll(a,fe);if(b.parentBranch==="above"||b.parentBranch==="below")return bs(a,fe)}return ll(a,0)}return!1},moveToMathfieldStart:a=>a.selectionIsCollapsed&&a.position===0?(a.announce("plonk"),!1):(a.position=0,a.mathfield.stopCoalescingUndo(),!0),moveToMathfieldEnd:a=>a.selectionIsCollapsed&&a.position===a.lastOffset?(a.announce("plonk"),!1):(a.position=a.lastOffset,a.mathfield.stopCoalescingUndo(),!0),moveToSuperscript:N0,moveToSubscript:F0},{target:"model",changeSelection:!0}),Ls({moveToNextPlaceholder:a=>Kf(a,"forward"),moveToPreviousPlaceholder:a=>Kf(a,"backward")},{target:"model",changeSelection:!0,audioFeedback:"return"});function $0(a,y,b,E){if(E==="forward"){let re=y.rightSibling;for(;re&&!b(re);)re=re.rightSibling;return re}let ee=y.leftSibling;for(;ee&&!b(ee);)ee=ee.leftSibling;return ee}function Hf(a,y,b){typeof y=="function"&&(b=y,y=1/0),y===void 0&&(y=1/0);let E=a.position,ee=!1,re="";for(;!ee;){const ae=a.at(E);ee=y===0||ae===void 0||ae.type==="first"||ae.mode!=="math"||!(ae.type&&/mord|mpunct|operator/.test(ae.type)||ae.type==="mop"&&/[a-zA-Z ]+/.test(ae.value))||!ae.hasEmptyBranch("superscript")||!ae.hasEmptyBranch("subscript")||typeof b=="function"&&!b(ae),ee||(ae.mode="text",ae.command=ae.value,ae.verbatimLatex=void 0,re+=ae.value),E-=1,y-=1}a.contentDidChange({data:re,inputType:"insertText"})}function Vu(a,y,b){typeof y=="function"&&(b=y,y=1/0),y===void 0&&(y=1/0);let E=a.position,ee=!1;const re=[];for(;!ee;){const ae=a.at(E);ee=y===0||!ae||ae.type==="first"||ae.isFirstSibling||ae.mode!=="text"||ae.value===" "||typeof b=="function"&&!b(ae),ee||(re.push(In.serialize([ae],{defaultMode:"math"})),ae.mode="math"),E-=1,y-=1}Ah(a),a.contentDidChange({data:na(re),inputType:"insertText"})}function Ah(a){var y;let b=a.position-1;for(;b>=0&&((y=a.at(b))==null?void 0:y.mode)==="math";)b-=1;if(!(b<0)&&a.at(b).mode==="text"&&a.at(b).value===" "&&a.at(b-1).mode==="math"){a.at(b-1).parent.removeChild(a.at(b-1));const E=a.silenceNotifications;a.silenceNotifications=!0,a.position-=1,a.silenceNotifications=E,a.contentDidChange({inputType:"deleteContent"})}}function Vg(a){let y="",b=a.position,E=!1;for(;!E;){const ee=a.at(b);E=!(ee&&(ee.mode==="text"||ee.mode==="math"&&ee.type&&/mord|mpunct/.test(ee.type))),E||(y=ee.value+y),b-=1}return y}function Ug(a,y,b){const{model:E}=a;if(E.mode==="latex"||!E.at(E.position).isLastSibling||!b||!Sf(b))return!1;const ee=Lc(b);if(!E.selectionIsCollapsed)return!!(a.model.mode==="text"&&/[/_^]/.test(ee));const re=Vg(E)+ee;if(a.model.mode==="text"){if(y==="Esc"||/[/\\]/.test(ee))return!0;if(/[\^_]/.test(ee))return/(^|\s)[a-zA-Z][^_]$/.test(re)&&Vu(E,1),!0;const ae={")":"(","}":"{","]":"["}[ee],{parent:de}=E.at(E.position);if(ae&&de instanceof za&&de.leftDelim===ae)return!0;if(/(^|[^a-zA-Z])(a|I) $/.test(re))return!1;if(/[$€£₤₺¥¤฿¢₡₧₨₹₩₱]/u.test(ee))return!0;if(/(^|[^a-zA-Z'])[a-zA-Z] $/.test(re))return Vu(E,1),!1;if(/\D\.[^\d\s]$/.test(re)){Vu(E,1);const fe=E.at(E.position);return fe.value="\u22C5",fe.style.variant="normal",fe.command="\\cdot",fe.verbatimLatex=void 0,E.contentDidChange({data:"\\cdot",inputType:"insertText"}),!0}if(/(^|\s)[a-zA-Z][^a-zA-Z]$/.test(re)||/\.\d$/.test(re)||/\([\d+\-.]$/.test(re))return Vu(E,1),!0;if(/\([a-z][,;]$/.test(re))return Vu(E,2),!0;if(/[\d+\-=><*|]$/.test(ee))return Ah(E),!0}else{if(y==="[Space]")return Hf(E,void 0,ae=>/[a-z][:,;.]$/.test(ae.value)),!0;if(/[a-zA-Z]{3,}$/.test(re)&&!/(dxd|abc|xyz|uvw)$/.test(re))return Hf(E,void 0,ae=>/[a-zA-Z]/.test(ae.value)),!0;if(/(^|\W)(if)$/i.test(re))return Hf(E,1),!0;if(/(\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5){3,}$/u.test(re)&&!/(αβγ)$/.test(re))return Hf(E,void 0,ae=>/(:|,|;|.|\u0393|\u0394|\u0398|\u039B|\u039E|\u03A0|\u03A3|\u03A5|\u03A6|\u03A8|\u03A9|[\u03B1-\u03C9]|\u03D1|\u03D5|\u03D6|\u03F1|\u03F5)/u.test(ae.value)),!0;if(ee==="?"||ee==="."&&!/[\d-+]\.$/.test(re))return!0}return!1}function Zg(a,y){if(!a.isSelectionEditable||!a.keystrokeCaptionVisible)return;const b=z0(),E=a.element.getBoundingClientRect();b.style.left=`${E.left}px`,b.style.top=`${E.top-64}px`,b.innerHTML=window.MathfieldElement.createHTML("<span>"+(vh(y)||y)+"</span>"+b.innerHTML),b.style.visibility="visible",setTimeout(()=>{b.childNodes.length>0&&b.childNodes[b.childNodes.length-1].remove(),b.childNodes.length===0&&(b.style.visibility="hidden")},3e3)}function jg(a){if(a.keystrokeCaptionVisible=!a.keystrokeCaptionVisible,a.keystrokeCaptionVisible){const y=z0();y.innerHTML=""}else{const y=Ef("mathlive-keystroke-caption-panel");y.style.visibility="hidden"}return!1}function z0(){const a=document.getElementById("mathlive-keystroke-caption-panel");return a||(ks("keystroke-caption"),ks("core"),Ef("mathlive-keystroke-caption-panel"))}function Gg(){document.getElementById("mathlive-keystroke-caption-panel")&&(bh("mathlive-keystroke-caption-panel"),x("core"),x("keystroke-caption"))}function K0(a,y){var b,E,ee;const{model:re}=a,ae=p0(y);if(y.isTrusted){Nm(y);const ot=kd();a.keyboardLayout!==ot.id&&(a.keyboardLayout=ot.id,a._keybindings=void 0)}if(clearTimeout(a.inlineShortcutBufferFlushTimer),a.inlineShortcutBufferFlushTimer=0,Zg(a,ae),y.isTrusted&&y.defaultPrevented)return a.flushInlineShortcutBuffer(),!1;let de,fe="",ge;const xe=a.inlineShortcutBuffer;if(a.isSelectionEditable){if(re.mode==="math")if(ae==="[Backspace]")xe.pop();else if(!Sf(y))a.flushInlineShortcutBuffer();else{const ot=Lc(y),gt=[...(E=(b=xe[xe.length-1])==null?void 0:b.keystrokes)!=null?E:[],ot];xe.push({state:re.getState(),keystrokes:gt,leftSiblings:Xg(a)});let ln=0,ar="";for(;!de&&ln<gt.length;)ge=xe.length-(gt.length-ln),ar=gt.slice(ln).join(""),de=dd(xe[ge].leftSiblings,ar,a.options.inlineShortcuts),!de&&/^[a-zA-Z][a-zA-Z0-9]+?([_\^][a-zA-Z0-9\*\+\-]+?)?$/.test(ar)&&(de=a.options.onInlineShortcut(a,ar)),ln+=1;a.flushInlineShortcutBuffer({defer:!0})}a.options.smartMode&&(de?a.switchMode("math"):Ug(a,ae,y)&&(a.switchMode({math:"text",text:"math"}[re.mode]),fe=""))}if(!de){if(fe||(fe=Vm(a.keybindings,re.mode,y)),!fe&&(ae==="[Enter]"||ae==="[Return]")){let ot=!1;return re.contentWillChange({inputType:"insertLineBreak"})&&(a.host&&(ot=!a.host.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),ot||y.preventDefault&&(y.preventDefault(),y.stopPropagation()),re.contentDidChange({inputType:"insertLineBreak"})),ot}if((!fe||ae==="[Space]")&&re.mode==="math"){if(ae==="[Space]"){if(a.adoptStyle="none",a.flushInlineShortcutBuffer(),a.options.mathModeSpace)return Bi.insert(re,a.options.mathModeSpace,{format:"latex",mode:"math"}),a.snapshot("insert-space"),fe="",a.dirty=!0,a.scrollIntoView(),y.preventDefault&&(y.preventDefault(),y.stopPropagation()),!1;const ot=re.at(re.position+1),gt=re.at(re.position-1);if((ot==null?void 0:ot.mode)==="text"||(gt==null?void 0:gt.mode)==="text")return Bi.insert(re," ",{mode:"text"}),a.snapshot("insert-space"),a.dirty=!0,a.scrollIntoView(),!1}(ee=re.at(re.position))!=null&&ee.isDigit()&&window.MathfieldElement.decimalSeparator===","&&Lc(y)===","&&(fe="insertDecimalSeparator")}}if(!de&&!fe){if(re.mathfield.smartFence){if(Dh(re,Lc(y),a.effectiveStyle))return a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}else{const{parent:ot}=re.at(re.position);if(ot instanceof za&&ot.rightDelim==="?"&&re.at(re.position).isLastSibling&&/^[)}\]|]$/.test(ae))return a.snapshot(),ot.isDirty=!0,ot.rightDelim=ae,re.position+=1,re.selectionDidChange(),re.contentDidChange({data:Lc(y),inputType:"insertText"}),a.snapshot("insert-fence"),a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1;if(!re.selectionIsCollapsed){const gt=Lc(y);if(gt==="("||gt==="{"||gt==="["){const ln={"(":"(","{":"\\lbrace","[":"\\lbrack"}[gt],ar={"(":")","{":"\\rbrace","[":"\\rbrack"}[gt],[rn,Vn]=jo(re.selection);return a.snapshot(),re.position=Vn,Bi.insert(re,ar,{format:"latex"}),re.position=rn,Bi.insert(re,ln,{format:"latex"}),re.setSelection(rn+1,Vn+1),re.contentDidChange({data:gt,inputType:"insertText"}),a.snapshot("insert-fence"),a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}}}return!0}const Be=re.at(Math.max(re.position,re.anchor)),{parent:Ve}=Be;if(fe==="moveAfterParent"&&(Ve==null?void 0:Ve.type)==="leftright"&&Be.isLastSibling&&a.options.smartFence&&Dh(re,".",a.defaultStyle)&&(fe="",Mo(a)),a.keyboardDelegate.cancelComposition(),fe)a.executeCommand(fe);else if(de){const ot=a.effectiveStyle;re.setState(xe[ge].state);const gt=xe[xe.length-1].keystrokes;for(const ln of gt)Bi.insert(re,ln,{silenceNotifications:!0,style:ot});a.snapshot("insert-shortcut"),re.setState(xe[ge].state),re.deferNotifications({content:!0,selection:!0,data:de,type:"insertText"},()=>(Bi.insert(re,de,{format:"latex",style:ot}),Ah(a.model),de.endsWith(" ")&&(a.switchMode("text"),Bi.insert(re," ",{style:ot,mode:"text"})),a.snapshot(),re.selectionIsCollapsed||a.flushInlineShortcutBuffer(),!0)),a.dirty=!0,re.announce("replacement")}return a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}function Th(a,y,b){const{model:E}=a;if(!a.isSelectionEditable){E.announce("plonk");return}b!=null||(b={}),b.focus&&a.focus(),b.feedback&&window.MathfieldElement.playSound("keypress"),typeof b.mode=="string"&&(a.switchMode(b.mode),a.snapshot());let ee=rf(y);const re=window.mathVirtualKeyboard;if(re!=null&&re.isShifted&&(ee=typeof ee=="string"?ee.toUpperCase():ee.map(fe=>fe.toUpperCase())),b.simulateKeystroke){let fe=!0;for(const ge of ee)K0(a,new KeyboardEvent("keypress",{key:ge}))&&(fe=!1);if(fe)return}const ae=E.at(E.position),de=we(we({},ae.computedStyle),a.defaultStyle);if(E.selectionIsCollapsed||(E.deleteAtoms(jo(E.selection)),a.snapshot("delete")),E.mode==="latex")E.deferNotifications({content:!0,selection:!0,data:y,type:"insertText"},()=>{Mf(a);for(const fe of ee)Bi.insert(E,fe);a.snapshot("insert-latex"),Ad(a)});else if(E.mode==="text"){for(const fe of ee)Bi.insert(E,fe,{style:de});a.snapshot("insert-text")}else if(E.mode==="math")for(const fe of ee)qg(a,fe,de,ae);a.dirty=!0,a.scrollIntoView()}function Xg(a){const y=a.model,b=[];let E=y.at(Math.min(y.position,y.anchor));for(;E.type!=="first";)b.push(E),E=E.leftSibling;return b}function qg(a,y,b,E){const ee=a.model;let re={"^":"moveToSuperscript",_:"moveToSubscript"," ":"moveAfterParent"}[y];if(y===" "&&a.options.mathModeSpace&&(re=["insert",a.options.mathModeSpace]),re){a.executeCommand(re);return}if(/\d/.test(y)&&a.options.smartSuperscript&&E.parentBranch==="superscript"&&E.parent.type!=="mop"&&E.parent.type!=="operator"&&E.parent.type!=="extensible-symbol"&&E.hasNoSiblings){Yg(ee),Bi.insert(ee,y,{style:b}),a.snapshot(),R0(ee),a.snapshot();return}if(/[a-zA-Z0-9]/.test(y)&&a.adoptStyle!=="none"){const ae=a.adoptStyle==="left"?E:E.parent?E.rightSibling:null;(ae==null?void 0:ae.type)==="mord"&&/[a-zA-Z0-9]/.test(ae.value)&&(b=we({},b),ae.style.variant&&(b.variant=ae.style.variant),ae.style.variantStyle&&(b.variantStyle=ae.style.variantStyle))}Bi.insert(ee,y,{style:b}),a.snapshot(`insert-${ee.at(ee.position).type}`)}function Yg(a){a.selectionIsCollapsed||(a.deleteAtoms(jo(a.selection)),a.mathfield.snapshot("delete"))}function Dh(a,y,b){if(!y||a.mode!=="math")return!1;const E=a.at(a.position),{parent:ee}=E,re={"(":"(",")":")","{":"\\lbrace","}":"\\rbrace","[":"\\lbrack","]":"\\rbrack","|":"|"}[y];if(!re)return!1;const ae=te[re],de=ne[re];if(!a.selectionIsCollapsed){a.mathfield.snapshot();const[fe,ge]=jo(a.selection),xe=a.extractAtoms([fe,ge]),Be=ee.addChildrenAfter([new za("left...right",xe,{leftDelim:re,rightDelim:de})],a.at(fe));return a.setSelection(a.offsetOf(Be.firstChild),a.offsetOf(Be.lastChild)),a.mathfield.snapshot("insert-fence"),a.contentDidChange({data:re,inputType:"insertText"}),!0}if(re==="|"){const fe=ee instanceof za?ee.leftDelim+ee.rightDelim:"";if(fe==="\\lbrace\\rbrace"||fe==="\\{\\}"||fe==="\\lbrace?")return a.mathfield.snapshot(),Bi.insert(a,"\\,\\middle\\vert\\,",{format:"latex",style:b}),a.mathfield.snapshot("insert-fence"),a.contentDidChange({data:re,inputType:"insertText"}),!0}if(de){if(ee instanceof za&&ee.firstChild===E&&(ee.leftDelim==="?"||ee.leftDelim==="."))return ee.leftDelim=re,ee.isDirty=!0,a.mathfield.snapshot(),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0;if(!(ee instanceof za)){let Be=E;for(;Be&&!(Be.type==="mclose"&&Be.value===de);)Be=Be.rightSibling;if(Be){a.mathfield.snapshot();const Ve=a.extractAtoms([a.offsetOf(E),a.offsetOf(Be)]);return Ve.pop(),ee.addChildrenAfter([new za("left...right",Ve,{leftDelim:re,rightDelim:de})],E),a.position=a.offsetOf(ee.firstChild)+1,a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}}const fe=a.offsetOf(E.lastSibling);let ge;for(ge=a.position;ge<=fe;ge++){const Be=a.at(ge);if(Be instanceof za&&(Be.leftDelim==="?"||Be.leftDelim===".")&&H0(re,Be.rightDelim))break}const xe=a.at(ge);if(ge<=fe&&xe instanceof za){xe.leftDelim=re,a.mathfield.snapshot();let Be=a.extractAtoms([a.position,ge-1]);return Be=Be.filter(Ve=>Ve.type!=="first"),xe.addChildren(Be,xe.parentBranch),a.position+=1,a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}if(ee instanceof za&&(ee.leftDelim==="?"||ee.leftDelim===".")&&H0(re,ee.rightDelim)){ee.isDirty=!0,ee.leftDelim=re,a.mathfield.snapshot();const Be=a.extractAtoms([a.offsetOf(E.firstSibling),a.position]);for(const Ve of Be)ee.parent.addChildBefore(Ve,ee);return a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}if(!(ee instanceof za&&ee.leftDelim==="|")){if(a.mathfield.snapshot(),Bi.insert(a,`\\left${re}\\right?`,{format:"latex",style:b}),E.lastSibling.type!=="first"){const Be=a.offsetOf(E.lastSibling),Ve=a.extractAtoms([a.position,Be]);a.at(a.position).body=Ve,a.position-=1}return a.mathfield.snapshot("insert-fence"),!0}}if(ae){let fe=E;for(;fe;){if(fe.type==="mopen"&&fe.value===ae){a.mathfield.snapshot();const ot=fe.leftSibling,gt=a.extractAtoms([a.offsetOf(fe.leftSibling),a.offsetOf(E)]);gt.shift();const ln=new za("left...right",gt,{leftDelim:ae,rightDelim:re});return ee.addChildrenAfter([ln],ot),a.position=a.offsetOf(ln),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}fe=fe.leftSibling}if(ee instanceof za&&E.isLastSibling&&Ih(ee.leftDelim,re))return a.mathfield.snapshot(),ee.isDirty=!0,ee.rightDelim=re,a.position+=1,a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0;const ge=a.offsetOf(E.firstSibling);let xe;for(xe=a.position;xe>=ge;xe--){const ot=a.at(xe);if(ot instanceof za&&(ot.rightDelim==="?"||ot.rightDelim===".")&&Ih(ot.leftDelim,re))break}const Be=a.at(xe);if(xe>=ge&&Be instanceof za)return a.mathfield.snapshot(),Be.rightDelim=re,Be.addChildren(a.extractAtoms([xe,a.position]),Be.parentBranch),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0;if(ee instanceof za&&(ee.rightDelim==="?"||ee.rightDelim===".")&&Ih(ee.leftDelim,re))return a.mathfield.snapshot(),ee.isDirty=!0,ee.rightDelim=re,ee.parent.addChildren(a.extractAtoms([a.position,a.offsetOf(E.lastSibling)]),ee.parentBranch),a.position=a.offsetOf(ee),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0;const Ve=ee.parent;return Ve instanceof za&&(Ve.rightDelim==="?"||Ve.rightDelim===".")&&a.at(a.position).isLastSibling?(a.position=a.offsetOf(Ve),Dh(a,re,b)):!1}return!1}function Ih(a,y){return a?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(a)?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(y):ne[a]===y:!0}function H0(a,y){return y?[")","\\rparen","}","\\}","\\rbrace","]","\\rbrack"].includes(y)?["(","\\lparen","{","\\{","\\lbrace","[","\\lbrack"].includes(a):te[y]===a:!0}Ls({undo:a=>(a.undo(),!0),redo:a=>(a.redo(),!0),scrollIntoView:a=>(a.scrollIntoView(),!0),scrollToStart:a=>(a.field.scroll(0,0),!0),scrollToEnd:a=>{const y=a.field.getBoundingClientRect();return a.field.scroll(y.left-window.scrollX,0),!0},toggleKeystrokeCaption:jg,toggleContextMenu:a=>{const y=a.toggleContextMenu();return y||a.model.announce("plonk"),y},plonk:a=>(a.model.announce("plonk"),!0),switchMode:(a,y,b,E)=>(a.switchMode(y,b,E),!0),insert:(a,y,b)=>a.insert(y,b),typedText:(a,y,b)=>(Th(a,y,b),!0),insertDecimalSeparator:a=>{const y=a.model;return y.mode==="math"&&window.MathfieldElement.decimalSeparator===","&&y.at(Math.max(y.position,y.anchor)).isDigit()?(a.insert("{,}",{format:"latex"}),a.snapshot("insert-mord"),!0):(a.insert("."),!0)},commit:a=>{var y;return a.model.contentWillChange({inputType:"insertLineBreak"})&&((y=a.host)==null||y.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),a.model.contentDidChange({inputType:"insertLineBreak"})),!0},insertPrompt:(a,y,b)=>{const E=a.getPrompts();let ee="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),re=0;for(;E.includes(ee)&&re<100;){if(re===99)return console.error("could not find a unique ID after 100 tries"),!1;ee="prompt-"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36),re++}return a.insert(`\\placeholder[${y!=null?y:ee}]{}`,b),!0}}),Ls({copyToClipboard:a=>(a.focus(),a.model.selectionIsCollapsed&&a.select(),"queryCommandSupported"in document&&document.queryCommandSupported("copy")?document.execCommand("copy"):a.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("copy",{bubbles:!0,composed:!0})),!1)},{target:"mathfield"}),Ls({cutToClipboard:a=>(a.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("cut")?document.execCommand("cut"):a.element.querySelector(".ML__keyboard-sink").dispatchEvent(new ClipboardEvent("cut",{bubbles:!0,composed:!0})),!0),pasteFromClipboard:a=>(a.focus(),"queryCommandSupported"in document&&document.queryCommandSupported("paste")?(document.execCommand("paste"),!0):(navigator.clipboard.readText().then(y=>{y&&a.model.contentWillChange({inputType:"insertFromPaste",data:y})?(a.stopCoalescingUndo(),a.stopRecording(),a.insert(y,{mode:a.model.mode})&&(Ad(a),a.startRecording(),a.snapshot("paste"),a.model.contentDidChange({inputType:"insertFromPaste"}),Mo(a))):a.model.announce("plonk"),a.startRecording()}),!0))},{target:"mathfield",canUndo:!0,changeContent:!0,changeSelection:!0});function Jg(a,y){a.flushInlineShortcutBuffer(),a.stopCoalescingUndo();const b=Ph(a,y),{model:E}=a;return E.selectionIsCollapsed?(a.defaultStyle.fontSeries&&b.fontSeries===a.defaultStyle.fontSeries&&(b.fontSeries="auto"),b.fontShape&&b.fontShape===a.defaultStyle.fontShape&&(b.fontShape="auto"),b.color&&b.color===a.defaultStyle.color&&(b.color="none"),b.backgroundColor&&b.backgroundColor===a.defaultStyle.backgroundColor&&(b.backgroundColor="none"),b.fontSize&&b.fontSize===a.defaultStyle.fontSize&&(b.fontSize="auto"),a.defaultStyle=we(we({},a.defaultStyle),b)):a.model.deferNotifications({content:!0,type:"insertText"},()=>{E.selection.ranges.forEach(ee=>Eh(E,ee,b,{operation:"toggle"})),a.snapshot("style-change")}),!0}Ls({applyStyle:Jg},{target:"mathfield",canUndo:!0,changeContent:!0});function Ph(a,y){var b,E,ee,re,ae,de,fe,ge,xe,Be;const Ve={};if(typeof y.color=="string"){const gt=(E=a.colorMap((b=y.color)!=null?b:y.verbatimColor))!=null?E:"none";gt!==y.color&&(Ve.verbatimColor=(ee=y.verbatimColor)!=null?ee:y.color),Ve.color=gt}if(typeof y.backgroundColor=="string"){const gt=(ae=a.backgroundColorMap((re=y.backgroundColor)!=null?re:y.verbatimBackgroundColor))!=null?ae:"none";gt!==y.backgroundColor&&(Ve.verbatimBackgroundColor=(de=y.verbatimBackgroundColor)!=null?de:y.backgroundColor),Ve.backgroundColor=gt}typeof y.fontFamily=="string"&&(Ve.fontFamily=y.fontFamily),typeof y.series=="string"&&(Ve.fontSeries=y.series),typeof y.fontSeries=="string"&&(Ve.fontSeries=y.fontSeries.toLowerCase()),Ve.fontSeries&&(Ve.fontSeries=(fe={bold:"b",medium:"m",normal:"m"}[Ve.fontSeries])!=null?fe:Ve.fontSeries),typeof y.shape=="string"&&(Ve.fontShape=y.shape),typeof y.fontShape=="string"&&(Ve.fontShape=y.fontShape.toLowerCase()),Ve.fontShape&&(Ve.fontShape=(ge={italic:"it",up:"n",upright:"n",normal:"n"}[Ve.fontShape])!=null?ge:Ve.fontShape),y.variant&&(Ve.variant=y.variant.toLowerCase()),y.variantStyle&&(Ve.variantStyle=y.variantStyle.toLowerCase());const ot=(xe=y.size)!=null?xe:y.fontSize;return typeof ot=="number"?Ve.fontSize=Math.max(1,Math.min(10,ot)):typeof ot=="string"&&(Ve.fontSize=(Be={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[ot.toLowerCase()])!=null?Be:{tiny:1,scriptsize:2,footnotesize:3,small:4,normal:5,normalsize:5,large:6,Large:7,LARGE:8,huge:9,Huge:10}[ot]),Ve}function Bh(a){let[y,b]=jo(a.selection);if(y=W0(a,y,"backward"),b=W0(a,b,"forward"),y===b){const E=a.at(y);if(E.type==="leftright")return a.setSelection(a.offsetOf(E.firstChild)-1,b);if(E.type==="first"&&(E.parent.type==="leftright"||E.parent.type==="surd"))return a.setSelection(y-1,a.offsetOf(E.parent.lastChild)+1);a.setSelection(y-1,b)}else a.setSelection(y,b);return!0}function W0(a,y,b){var E,ee,re;let ae=a.at(y);if(!ae)return y;const de=b==="forward"?1:-1;if(ae.mode==="text"){for(;ae&&!(ae.mode!=="text"||!pe.test(ae.value));)y+=de,ae=a.at(y);return b==="backward"?y-1:y}if(ae.mode==="latex"){if(/[a-zA-Z\*]/.test(ae.value))if(b==="backward")for(;ae&&ae.mode==="latex"&&ae.value!=="\\"&&/[a-zA-Z]/.test(ae.value);)y+=de,ae=a.at(y);else for(;ae&&ae.mode==="latex"&&/[a-zA-Z\*]/.test(ae.value);)y+=de,ae=a.at(y);else if(ae.value==="{"){if(b==="forward"){for(;ae&&ae.mode==="latex"&&ae.value!=="}";)y+=de,ae=a.at(y);return y}return y-1}else if(ae.value==="}"){if(b==="backward"){for(;ae&&ae.mode==="latex"&&ae.value!=="{";)y+=de,ae=a.at(y);return y-1}return y}return y-1}if(ae.mode==="math"){if(ae.isDigit()){for(;(E=a.at(y+de))!=null&&E.isDigit();)y+=de;return b==="backward"?y-1:y}if(ae.style.variant||ae.style.variantStyle){let fe=(ee=a.at(y))==null?void 0:ee.style;for(;fe&&fe.variant===ae.style.variant&&fe.variantStyle===ae.style.variantStyle;)fe=(re=a.at(y+de))==null?void 0:re.style,y+=de;return b==="backward"?y-1:y}return y}return y}Ls({selectGroup:a=>{const y=Bh(a);return y||a.announce("plonk"),y},selectAll:a=>a.setSelection(0,a.lastOffset),extendSelectionForward:a=>Cl(a,"forward",{extend:!0}),extendSelectionBackward:a=>Cl(a,"backward",{extend:!0}),extendToNextWord:a=>Bc(a,"forward",{extend:!0}),extendToPreviousWord:a=>Bc(a,"backward",{extend:!0}),extendSelectionUpward:a=>Cl(a,"upward",{extend:!0}),extendSelectionDownward:a=>Cl(a,"downward",{extend:!0}),extendToNextBoundary:a=>Bc(a,"forward",{extend:!0}),extendToPreviousBoundary:a=>Bc(a,"backward",{extend:!0}),extendToGroupStart:a=>{const y=a.setSelection(a.anchor,a.offsetOf(a.at(a.position).firstSibling));return y||a.announce("plonk"),y},extendToGroupEnd:a=>{const y=a.setSelection(a.anchor,a.offsetOf(a.at(a.position).lastSibling));return y||a.announce("plonk"),y},extendToMathFieldStart:a=>{const y=a.setSelection(a.anchor,0);return y||a.announce("plonk"),y},extendToMathFieldEnd:a=>{const y=a.setSelection(a.anchor,a.lastOffset);return y||a.announce("plonk"),y}},{target:"model",changeSelection:!0});var Uu=null,Od=0,Wf=class qs{static start(y,b,E,ee){var re;qs.element=y,(re=qs.controller)==null||re.abort(),qs.controller=new AbortController;const ae={signal:qs.controller.signal};"PointerEvent"in window?(y.addEventListener("pointermove",E,ae),y.addEventListener("pointerup",ee,ae),y.addEventListener("pointercancel",ee,ae),Oh(b)&&(qs.pointerId=b.pointerId,y.setPointerCapture(b.pointerId))):(window.addEventListener("mousemove",E,ae),window.addEventListener("blur",ee,ae),window.addEventListener("mouseup",ee,ae))}static stop(){var y;(y=qs.controller)==null||y.abort(),qs.controller=void 0,typeof qs.pointerId=="number"&&(qs.element.releasePointerCapture(qs.pointerId),qs.pointerId=void 0)}};function Oh(a){return a!==null&&globalThis.PointerEvent!==void 0&&a instanceof PointerEvent}function V0(a,y){var b;if(y.buttons>1)return;a.atomBoundsCache=new Map;const E=a;let ee,re=!1,ae=!1,de="none",fe=!1,ge=!1;const xe=y.clientX,Be=y.clientY,Ve=Date.now(),ot=E.field,gt=setInterval(()=>{fe?ot.scroll({top:0,left:ot.scrollLeft-16}):ge&&ot.scroll({top:0,left:ot.scrollLeft+16})},32);function ln(){Wf.stop(),re=!1,clearInterval(gt),a.element.classList.remove("tracking"),y&&y.preventDefault()}function ar(Vn){if(!E.hasFocus()){ln();return}const lr=Vn.clientX,jn=Vn.clientY,Kr=Oh(Vn)&&Vn.pointerType==="touch"?20:5;if(Date.now()<Ve+500&&Math.abs(xe-lr)<Kr&&Math.abs(Be-jn)<Kr){Vn.preventDefault(),Vn.stopPropagation();return}const ai=ot.getBoundingClientRect();ge=lr>ai.right,fe=lr<ai.left;let jr=ee;Oh(Vn)&&(Vn.isPrimary||(jr=Rd(E,Vn.clientX,Vn.clientY,{bias:0})));const _a=Rd(E,lr,jn,{bias:lr<=xe?lr===xe?0:-1:1});jr>=0&&_a>=0&&(E.model.extendSelectionTo(jr,_a),Mo(a)),ae&&Bh(E.model)}Uu&&Math.abs(Uu.x-xe)<5&&Math.abs(Uu.y-Be)<5&&Date.now()<Uu.time+500?(Od+=1,Uu.time=Ve):(Uu={x:xe,y:Be,time:Ve},Od=1);const rn=ot.getBoundingClientRect();if(xe>=rn.left&&xe<=rn.right&&Be>=rn.top&&Be<=rn.bottom){if(a.flushInlineShortcutBuffer(),a.adoptStyle="left",ee=Rd(a,xe,Be,{bias:0}),ee>=0){if(a.element.classList.add("tracking"),y.shiftKey){const Vn=a.model.selectionIsCollapsed;a.model.extendSelectionTo(a.model.anchor,ee),v0(a.model)||Vn?de="all":de="selection"}else a.model.at(ee).type==="placeholder"?(a.model.setSelection(ee-1,ee),de="selection"):((b=a.model.at(ee).rightSibling)==null?void 0:b.type)==="placeholder"?(a.model.setSelection(ee,ee+1),de="selection"):(a.model.position=ee,v0(a.model)?de="all":de="selection");a.defaultStyle={},y.detail===3||Od>2?(ln(),(y.detail===3||Od===3)&&(a.model.selection={ranges:[[0,a.model.lastOffset]]},de="all")):re||(re=!0,Wf.start(ot,y,ar,ln),(y.detail===2||Od===2)&&(ae=!0,Bh(a.model),de="all"))}a.hasFocus()||(de="none",a.focus({preventScroll:!0}))}else Uu=null;a.stopCoalescingUndo(),de!=="none"&&(a.model.selectionIsCollapsed&&(de="all"),Mo(a)),y.preventDefault()}function Qg(a,y,b){if(a>=b.left&&a<=b.right&&y>=b.top&&y<=b.bottom)return 0;const E=a-(b.left+b.right)/2,ee=y-(b.top+b.bottom)/2;return E*E+ee*ee}function U0(a,y,b,E,ee){if(!b.id)return[1/0,null];if(y.has(b.id))return y.get(b.id);const re=lu(a,b);if(!re)return[1/0,null];let ae=[1/0,null];if(b.hasChildren&&!b.captureSelection&&E>=re.left&&E<=re.right)for(const de of b.children){const fe=U0(a,y,de,E,ee);fe[0]<=ae[0]&&(ae=fe)}return ae[1]||(ae=[Qg(E,ee,re),b]),y.set(b.id,ae),ae}function ev(a,y,b){const[,E]=U0(a,new Map,a.model.root,y,b);return E}function Rd(a,y,b,E){var ee;const re=a.field.querySelector(".ML__latex").getBoundingClientRect();if(!re)return 0;if(y>re.right||b>re.bottom+8)return a.model.lastOffset;if(y<re.left||b<re.top-8)return 0;E=E!=null?E:{},E.bias=(ee=E.bias)!=null?ee:0;let ae=ev(a,y,b);const de=[];let fe=ae;for(;fe;)de.unshift(fe),fe=fe.parent;for(const xe of de)if(xe.captureSelection){ae=xe;break}let ge=a.model.offsetOf(ae);if(ge<0)return-1;if(ae.leftSibling)if(E.bias===0&&ae.type!=="placeholder"){const xe=lu(a,ae);xe&&y<(xe.left+xe.right)/2&&(ge=a.model.offsetOf(ae.leftSibling))}else E.bias<0&&(ge=a.model.offsetOf(ae.leftSibling));return ge}var tv=class extends Bi{constructor(){super("math")}onPaste(a,y){if(!y||!a.model.contentWillChange({data:typeof y=="string"?y:null,dataTransfer:typeof y=="string"?null:y,inputType:"insertFromPaste"}))return!1;let b="",E="auto",ee=typeof y!="string"?y.getData("application/json+mathlive"):"";if(ee)try{const re=JSON.parse(ee);if(re&&Array.isArray(re)){a.snapshot();const ae=du(re),{model:de}=a;de.selectionIsCollapsed||de.deleteAtoms(jo(de.selection));const fe=de.at(de.position);if(fe.parent instanceof zi){console.assert(fe.parentBranch!==void 0);const ge=[];let xe=[];ae[0].type==="first"&&ae.shift(),ae[ae.length-1].type==="first"&&ae.pop();for(const gt of ae)gt.type==="first"&&xe.length>0?(ge.push(xe),xe=[gt]):xe.push(gt);xe.length>0&&ge.push(xe);let Be=Number(fe.parentBranch[0]),Ve=Number(fe.parentBranch[1]);const ot=fe.parent.maxColumns;for(;fe.parent.colCount-Ve<ge.length&&fe.parent.colCount<ot;)fe.parent.addColumn();fe.parent.addChildrenAfter(ge[0],fe);for(let gt=1;gt<ge.length;gt++)Ve++,Ve>=ot&&(Ve=0,fe.parent.addRowAfter(Be),Be++),fe.parent.setCell(Be,Ve,ge[gt])}else fe.parent.addChildrenAfter(ae.filter(ge=>ge.type!=="first"),fe);return de.position=de.offsetOf(ae[ae.length-1]),de.contentDidChange({inputType:"insertFromPaste"}),Mo(a),!0}}catch(re){}if(ee=typeof y!="string"?y.getData("application/json"):"",ee&&window.MathfieldElement.computeEngine)try{const re=JSON.parse(ee);if(typeof re=="object"&&"latex"in re&&re.latex&&(b=re.latex),!b){const ae=window.MathfieldElement.computeEngine.box(re);ae&&!ae.has("Error")&&(b=ae.latex)}b||(E="latex")}catch(re){}if(!b&&typeof y!="string"&&(b=y.getData("application/x-latex"),b&&(E="latex")),b||(b=typeof y=="string"?y:y.getData("text/plain")),b){let re;return[re,b]=yl(b),E==="auto"&&re&&(E="latex"),a.stopCoalescingUndo(),a.stopRecording(),this.insert(a.model,b,{format:E})&&(a.startRecording(),a.snapshot("paste"),Mo(a)),a.startRecording(),!0}return!1}insert(a,y,b){var E,ee;const re=typeof y=="string"?y:(ee=(E=window.MathfieldElement.computeEngine)==null?void 0:E.box(y).latex)!=null?ee:"";if(!b.silenceNotifications&&!a.contentWillChange({data:re,inputType:"insertText"}))return!1;b.insertionMode||(b.insertionMode="replaceSelection"),b.selectionMode||(b.selectionMode="placeholder"),b.format||(b.format="auto");const{silenceNotifications:ae}=a;b.silenceNotifications&&(a.silenceNotifications=!0);const de=a.silenceNotifications;a.silenceNotifications=!0;const fe={"?":"\\placeholder{}","@":"\\placeholder{}"};fe[0]=b.insertionMode==="replaceAll"?"":a.getValue(a.selection,"latex-unstyled"),b.insertionMode==="replaceSelection"&&!a.selectionIsCollapsed?a.deleteAtoms(jo(a.selection)):b.insertionMode==="replaceAll"?(a.root.setChildren([],"body"),a.position=0):b.insertionMode==="insertBefore"?a.collapseSelection("backward"):b.insertionMode==="insertAfter"&&a.collapseSelection("forward"),!a.at(a.position).isLastSibling&&a.at(a.position+1).type==="placeholder"?a.deleteAtoms([a.position,a.position+1]):a.at(a.position).type==="placeholder"&&a.deleteAtoms([a.position-1,a.position]);let ge=-1;fe[0]?fe["@"]=fe[0]:typeof y=="string"&&/(^|[^\\])#@/.test(y)&&(ge=rv(a),ge>=0&&(fe["@"]=a.getValue(ge,a.position,"latex"))),fe[0]||(fe[0]=fe["?"]);let xe=!1;const Be=lr=>(xe=!0,fe[lr]);let[Ve,ot]=Z0(a,y,Be,b);if(!ot)return!1;const gt=ot.length===1&&ot[0].type==="genfrac";gt&&ge>=0&&typeof a.mathfield.options.isImplicitFunction=="function"&&a.mathfield.options.isImplicitFunction(a.at(a.position).command)?(fe["@"]=fe["?"],xe=!1,[Ve,ot]=Z0(a,y,Be,b)):ge>=0&&a.deleteAtoms([ge,a.position]);const{parent:ln}=a.at(a.position),ar=ln.hasEmptyBranch("body");if(gt&&Ve!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&ln instanceof za&&ln.leftDelim==="("&&ar){const lr=ln.parent,jn=ln.parentBranch;lr.removeChild(ln),lr.setChildren(ot,jn)}const rn=a.at(a.position);rn.parent.addChildrenAfter(ot,rn),Ve==="latex"&&typeof y=="string"&&(ln==null?void 0:ln.type)==="root"&&ar&&!xe&&(ln.verbatimLatex=y),a.silenceNotifications=de;const Vn=ot[ot.length-1];if(b.selectionMode==="placeholder"){const lr=ot.flatMap(jn=>[jn,...jn.children]).find(jn=>jn.type==="placeholder");if(lr){const jn=a.offsetOf(lr);a.setSelection(jn-1,jn),a.announce("move")}else Vn&&(a.position=a.offsetOf(Vn))}else b.selectionMode==="before"||(b.selectionMode==="after"?Vn&&(a.position=a.offsetOf(Vn)):b.selectionMode==="item"&&a.setSelection(a.anchor,a.offsetOf(Vn)));return a.contentDidChange({data:re,inputType:"insertText"}),a.silenceNotifications=ae,!0}};function Z0(a,y,b,E){var ee;let re,ae=[];if(typeof y!="string"||E.format==="math-json"){const de=window.MathfieldElement.computeEngine;if(!de)return["math-json",[]];[re,y]=["latex",de.box(y).latex],ae=Xo(y,{context:a.mathfield.context})}else typeof y=="string"&&E.format==="ascii-math"?([re,y]=Bu(y,{format:"ascii-math",inlineShortcuts:a.mathfield.options.inlineShortcuts}),ae=Xo(y,{context:a.mathfield.context}),re!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&Vf(ae)):(E.format==="auto"||(ee=E.format)!=null&&ee.startsWith("latex"))&&(E.format==="auto"&&([re,y]=Bu(y,{format:"auto",inlineShortcuts:a.mathfield.options.inlineShortcuts})),E.format==="latex"&&([,y]=yl(y)),ae=Xo(y,{context:a.mathfield.context,args:b}),E.format!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&Vf(ae));return hu(ae,E.style),[re!=null?re:"latex",ae]}function nv(a){if(!a||(console.assert(a[0].type==="first"),a.length>1))return null;const y=a[0];return y instanceof za&&y.leftDelim==="("&&y.rightDelim===")"?y.removeBranch("body"):null}function Vf(a){if(a){for(let y=0;a[y];y++){const b=a[y];if(b instanceof za&&b.leftDelim==="("){let E=0,ee=0,re=0;for(let ae=0;b.body[ae];ae++)b.body[ae].type==="genfrac"&&(E++,ee=ae),re++;re===0&&E===1&&(a[y]=b.body[ee])}}for(const y of a){for(const b of y.branches)if(!y.hasEmptyBranch(b)){Vf(y.branch(b));const E=nv(y.branch(b));E&&y.setChildren(E,b)}if(y instanceof zi)for(const b of y.cells)Vf(b)}}}function rv(a){let y=a.at(a.position);if(y.mode==="text"){for(;!y.isFirstSibling&&y.mode==="text";)y=y.leftSibling;return a.offsetOf(y)}const b=y;let E=!1;if(y.type==="mclose"){const ee=te[y.value];for(;!y.isFirstSibling&&!(y.type==="mopen"&&y.value===ee);)y=y.leftSibling;y.isFirstSibling||(y=y.leftSibling),E=!0}else y.type==="leftright"&&(y=y.leftSibling,E=!0);if(E)for(;!y.isFirstSibling&&(y.isFunction||j0(y));)y=y.leftSibling;else{const ee=[];for(;!y.isFirstSibling&&(j0(y)||ee.length>0);)y.type==="mclose"&&ee.unshift(y.value),y.type==="mopen"&&ee.length>0&&y.value===te[ee[0]]&&ee.shift(),y=y.leftSibling}return b===y?-1:a.offsetOf(y)}function j0(a){return a.isDigit()?!0:a.type&&/^(mord|surd|subsup|leftright|mop|mclose)$/.test(a.type)?!a.isExtensibleSymbol:!1}new tv;var iv=class extends Bi{constructor(){super("text")}onPaste(a,y){if(!y)return!1;const b=typeof y=="string"?y:y.getData("text/plain");return b&&a.model.contentWillChange({inputType:"insertFromPaste",data:b})?(a.stopCoalescingUndo(),a.stopRecording(),this.insert(a.model,b)&&(a.model.contentDidChange({inputType:"insertFromPaste"}),a.startRecording(),a.snapshot("paste"),Mo(a)),a.startRecording(),!0):!1}insert(a,y,b={}){if(!a.contentWillChange({data:y,inputType:"insertText"}))return!1;b.insertionMode||(b.insertionMode="replaceSelection"),b.selectionMode||(b.selectionMode="placeholder"),b.format||(b.format="auto");const{silenceNotifications:E}=a;b.silenceNotifications&&(a.silenceNotifications=!0);const ee=a.silenceNotifications;a.silenceNotifications=!0,b.insertionMode==="replaceSelection"&&!a.selectionIsCollapsed?a.deleteAtoms(jo(a.selection)):b.insertionMode==="replaceAll"?(a.root.setChildren([],"body"),a.position=0):b.insertionMode==="insertBefore"?a.collapseSelection("backward"):b.insertionMode==="insertAfter"&&a.collapseSelection("forward");const re=av(y,a.mathfield.context);if(hu(re,b.style),!re)return!1;const ae=a.at(a.position),de=ae.parent.addChildrenAfter(re,ae);return a.silenceNotifications=ee,b.selectionMode==="before"||(b.selectionMode==="item"?a.setSelection(a.anchor,a.offsetOf(de)):de&&(a.position=a.offsetOf(de))),a.contentDidChange({data:y,inputType:"insertText"}),a.silenceNotifications=E,!0}};function av(a,y){return a=a.replace(/\\/g,"\\textbackslash "),a=a.replace(/#/g,"\\#"),a=a.replace(/\$/g,"\\$"),a=a.replace(/%/g,"\\%"),a=a.replace(/&/g,"\\&"),a=a.replace(/_/g,"\\_"),a=a.replace(/{/g,"\\textbraceleft "),a=a.replace(/}/g,"\\textbraceright "),a=a.replace(/lbrace/g,"\\textbraceleft "),a=a.replace(/rbrace/g,"\\textbraceright "),a=a.replace(/\^/g,"\\textasciicircum "),a=a.replace(/~/g,"\\textasciitilde "),a=a.replace(/£/g,"\\textsterling "),Xo(a,{context:y,parseMode:"text"})}new iv;function Ml(a){return{value:a.model.getValue(),selectionIsCollapsed:a.model.selectionIsCollapsed,canUndo:a.canUndo(),canRedo:a.canRedo(),style:a.selectionStyle,mode:a.model.mode}}var co=4,Cs=20,Fo=2*(Cs+co),Uf=(a,y)=>`
<line x1="${a+Cs}" y1="${y+Cs}"
x2="${a>y?a+Cs:7*Cs+10*co}"
y2="${a<y?y+Cs:7*Cs+10*co}"/>
<svg id="plus" viewBox="0 0 40 40" x="${a}" y="${y}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<path class="font" d="m33.33,20c0,1.84-1.49,3.34-3.33,3.34h-6.67v6.66c0,1.84-1.49,3.34-3.33,3.34s-3.34-1.5-3.34-3.34v-6.66h-6.66c-1.84,0-3.34-1.5-3.34-3.34s1.5-3.33,3.34-3.33h6.66v-6.67c0-1.84,1.5-3.33,3.34-3.33s3.33,1.49,3.33,3.33v6.67h6.67c1.84,0,3.33,1.49,3.33,3.33Z"/>
</svg>`,G0=(a,y)=>`
<line x1="${a+Cs}" y1="${y+Cs}"
x2="${a>y?a+Cs:7*Cs+10*co}"
y2="${a<y?y+Cs:7*Cs+10*co}"/>
<svg id="minus" viewBox="0 0 40 40" x="${a}" y="${y}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<path class="font" d="m33.33,20c0,1.84-1.49,3.33-3.33,3.33H10c-1.84,0-3.34-1.49-3.34-3.33s1.5-3.34,3.34-3.34h20c1.84,0,3.33,1.5,3.33,3.34Z"/>
</svg>`,Zf=(a,y,b)=>`
<svg id="arrow" viewBox="0 0 40 40" x="${a}" y="${y}" width="40" height="40">
<circle class="cls-2" cx="20" cy="20" r="20"/>
<g transform="rotate(${b})" transform-origin="20 20">
<path class="font" d="m17.7,7.23h4.6c.52,0,.94.42.94.94v13.82c0,.52.42.94.94.94h3.39c.83,0,1.25,1.01.66,1.6l-7.56,7.56c-.37.37-.96.37-1.32,0l-7.56-7.56c-.59-.59-.17-1.6.66-1.6h3.39c.52,0,.94-.42.94-.94v-13.82c0-.52.42-.94.94-.94Z"/>
</g>
</svg>`,ov=`
<svg class="MLEP__array-buttons" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox=
"-2 -2 ${8*Cs+10*co+5} ${8*Cs+10*co+5}">
<rect
class="MLEP__array-insert-background rows"
x="0"
y="${Fo+co}"
height="${3*Fo}"
width="${Fo}"
rx="${Fo/2}"/>
<rect
class="MLEP__array-insert-background columns"
x="${Fo+co}"
y="0"
height="${Fo}"
width="${3*Fo}"
rx="${Fo/2}"/>
<g data-command='"moveDown"'>
${Zf(2*(co+Fo),2*co+3*Fo,0)}
</g>
<g data-command='"moveUp"'>
${Zf(2*(co+Fo),2*co+Fo,180)}
</g>
<g data-command='"moveToNextWord"'>
${Zf(2*co+3*Fo,2*(co+Fo),-90)}
</g>
<g data-command='"moveToPreviousWord"'>
${Zf(2*co+Fo,2*(co+Fo),90)}
</g>
<g>
<g data-command='"addColumnBefore"'>
${Uf(2*co+Fo,co)}
</g>
<g data-command='"removeColumn"'>
${G0(2*co+2*Fo,co)}
</g>
<g data-command='"addColumnAfter"'>
${Uf(2*co+3*Fo,co)}
</g>
<g data-command='"addRowBefore"'>
${Uf(co,2*co+Fo)}
</g>
<g data-command='"removeRow"'>
${G0(co,2*co+2*Fo)}
</g>
<g data-command='"addRowAfter"'>
${Uf(co,2*co+3*Fo)}
</g>
</svg>`,sv=a=>`
<svg id="matrix" class="${a}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","matrix"]'>
<rect class="cls-1" width="28" height="24"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/></svg>`,lv=a=>`
<svg id="pmatrix" class="${a}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","pmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m6,4c-3.96,4.6-3.96,11.4,0,16"/>
<path class="cls-2" d="m22,4c3.96,4.6,3.96,11.4,0,16"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/></svg>`,X0=a=>`
<svg id="Bmatrix" class="${a}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","Bmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m6,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
<path class="cls-2" d="m22,4c1.1,0,2,.9,2,2v3c0,1.66.9,3,2,3-1.1,0-2,1.34-2,3v3c0,1.1-.9,2-2,2"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
</svg>`,uv=a=>`
<svg id="bmatrix" class="${a}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","bmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m6,4h-3v16h3"/>
<path class="cls-2" d="m22,4h3v16h-3"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
</svg>`,cv=a=>`
<svg id="vmatrix" class="${a}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","vmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
<line class="cls-2" x1="4" y1="4" x2="4" y2="20"/>
<line class="cls-2" x1="24" y1="4" x2="24" y2="20"/>
</svg>`,dv=a=>`
<svg id="Vmatrix" class="${a}" xmlns="http://www.w3.org/2000/svg" viewBox="-3.5 -3 35 30"
data-command='["setEnvironment","Vmatrix"]'>
<rect class="cls-1" width="28" height="24"/>
<circle cx="10" cy="8" r="1"/>
<circle cx="14" cy="12" r="1"/>
<circle cx="18" cy="16" r="1"/>
<line class="cls-2" x1="6" y1="4" x2="6" y2="20"/>
<line class="cls-2" x1="22" y1="4" x2="22" y2="20"/>
<line class="cls-2" x1="2" y1="4" x2="2" y2="20"/>
<line class="cls-2" x1="26" y1="4" x2="26" y2="20"/>
</svg>`,fv=a=>`
<svg id="cases" class="${a}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","cases"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m10,4c-1.1,0-2,.9-2,2v3c0,1.66-.9,3-2,3,1.1,0,2,1.34,2,3v3c0,1.1.9,2,2,2"/>
<circle cx="13" cy="8" r="1"/>
<circle cx="13" cy="16" r="1"/>
<circle cx="21" cy="8" r="1"/>
<circle cx="21" cy="16" r="1"/>
</svg>`,hv=a=>`
<svg id="rcases" class="${a}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 24"
data-command='["setEnvironment","rcases"]'>
<rect class="cls-1" width="28" height="24"/>
<path class="cls-2" d="m18,20c1.1,0,2-.9,2-2v-3c0-1.66.9-3,2-3-1.1,0-2-1.34-2-3v-3c0-1.1-.9-2-2-2"/>
<circle cx="15" cy="8" r="1"/>
<circle cx="15" cy="16" r="1"/>
<circle cx="7" cy="8" r="1"/>
<circle cx="7" cy="16" r="1"/>
</svg>`,Rh={matrix:sv,pmatrix:lv,bmatrix:uv,Bmatrix:X0,vmatrix:cv,Vmatrix:dv},Nh={cases:fv,rcases:hv,Bmatrix:X0};function pv(a){var y,b;const E=(y=a.model.parentEnvironment)==null?void 0:y.array;if(!E)return;let ee=0;E.forEach(gt=>{(!ee||gt.length>ee)&&(ee=gt.length)});let re=document.getElementById("mathlive-environment-popover");re||(re=Ef("mathlive-environment-popover"),ks("environment-popover"),ks("core"),re.setAttribute("aria-hidden","true"));let ae;const de=re.querySelector(".MLEP__environment-controls");de?ae=de:(ae=document.createElement("div"),re.innerHTML="",re.appendChild(ae)),ae.className="MLEP__environment-controls",ae.style.display="flex",ae.style.width="100%",ae.style.height="100%",ae.style.boxSizing="border-box",ae.innerHTML=ov;let fe=[],ge="";const xe=a.model.parentEnvironment.environmentName;if(cs(xe)){const gt=gv(xe);ge=Rh[gt]("active");const ln=Rh,{[gt]:ar}=ln,rn=ct(ln,[De(gt)]);fe=Object.values(rn).map(Vn=>Vn("inactive"))}else if(ds(xe)){const gt=vv(xe);ge=Nh[gt]("active");const ln=Nh,{[gt]:ar}=ln,rn=ct(ln,[De(gt)]);fe=Object.values(rn).map(Vn=>Vn("inactive"))}else Io(xe)&&(ge=Rh.matrix("active"),fe=Object.values(Nh).map(gt=>gt("inactive")));const Be=document.createElement("div");Be.className="MLEP__environment-delimiter-controls",Be.style.display="flex",Be.style.flexDirection="column",Be.innerHTML=`
<div class='MLEP__array-delimiter-options'>
${ge}
${fe.join("")}
</div>`,ge&&ae.appendChild(Be),ae.querySelectorAll("[data-command]").forEach(gt=>{const ln=gt.dataset.command;let ar=ln;try{ar=JSON.parse(ln)}catch(rn){}gt.addEventListener("mousedown",rn=>rn.preventDefault()),ar&&gt.addEventListener("click",()=>a.executeCommand(ar))});const ot=(b=a.field)==null?void 0:b.getBoundingClientRect();ot&&(re.style.top=`${window.scrollY+(ot.top-re.clientHeight-15)}px`,re.style.left=`${ot.left+20}px`,re.classList.add("is-visible"))}function Fh(){const a=document.getElementById("mathlive-environment-popover");a==null||a.classList.remove("is-visible")}function mv(){document.getElementById("mathlive-environment-popover")&&(bh("mathlive-environment-popover"),x("environment-popover"),x("core"))}function jf(a){if(!a.hasFocus())return;let y=!1;if(a.model.mode==="math"){const b=a.model.parentEnvironment;if(b!=null&&b.array&&bo(b.environmentName)){const E=a.options.environmentPopoverPolicy;y=E==="auto"||E==="on"}}y?pv(a):Fh()}function gv(a){return a.replace("*","")}function vv(a){return a==="dcases"?"cases":a}function q0(a){const y=getComputedStyle(a).direction;return y==="ltr"||y==="rtl"?y:"ltr"}function Y0(a,y,b){return y==="left"||y==="leading"&&b==="ltr"||y==="trailing"&&b==="rtl"?a.left:a.right}function $h(a,y,b,E){return b==="middle"?a-y/2:b==="start"&&E==="rtl"||b==="end"&&E==="ltr"||b==="top"||b==="right"?Math.max(0,a-y):a}function yv(a,y,b,E){return b==="middle"?a-y/2:b==="start"&&E==="ltr"||b==="end"&&E==="rtl"||b==="top"||b==="right"?a:a-y}function bv(a,y){var b,E,ee;const re=(b=q0(a))!=null?b:"ltr";a.style.position="fixed",a.style.left="",a.style.top="",a.style.right="",a.style.bottom="",a.style.height="",a.style.width="";const ae=a.getBoundingClientRect(),de=Number.isFinite(y.maxHeight)?Math.min(y.maxHeight,window.innerHeight):window.innerHeight;let fe=Math.min(de,(E=y.height)!=null?E:ae.height),ge=$h(y.location.y,fe,y.verticalPos,re);ge+fe>window.innerHeight-8&&(y.alternateLocation?(ge=$h(y.alternateLocation.y,fe,y.verticalPos,re),ge+fe>window.innerHeight-8&&(ge=void 0)):ge=void 0),Number.isFinite(ge)||(ge=Math.max(8,window.innerHeight-8-fe),8+fe>window.innerHeight-8&&(a.style.bottom="8px")),fe=Math.min(ge+fe,window.innerHeight-8)-ge;const xe=Number.isFinite(y.maxWidth)?Math.min(y.maxWidth,window.innerWidth):window.innerWidth;let Be=Math.min(xe,(ee=y.width)!=null?ee:ae.width),Ve=$h(y.location.x,Be,y.horizontalPos,re);Ve+Be>window.innerWidth-8&&(y.alternateLocation?(Ve=yv(y.alternateLocation.x,Be,y.verticalPos,re),Ve+Be>window.innerWidth-8&&(Ve=void 0)):Ve=void 0),Number.isFinite(Ve)||(Ve=Math.max(8,window.innerWidth-8-Be),8+Be>window.innerWidth-8&&(a.style.right="8px")),Be=Math.min(Ve+Be,window.innerWidth-8)-Ve,re==="rtl"?a.style.right=`${Math.ceil(window.innerWidth-Ve-Be).toString()}px`:a.style.left=`${Math.ceil(Ve).toString()}px`,a.style.top=`${Math.ceil(ge).toString()}px`,fe!==ae.height&&(a.style.height=`${Math.ceil(fe).toString()}px`),Be!==ae.width&&(a.style.width=`${Math.ceil(Be).toString()}px`)}function xv(a,y){return Math.hypot(y.x-a.x,y.y-a.y)}function Oc(a){return"submenu"in a}function El(a){return"type"in a&&a.type==="command"||"onMenuSelect"in a||"id"in a}function zh(a){return"type"in a&&a.type==="divider"}function Kh(a){return"type"in a&&a.type==="heading"}var J0={};function Hh(a){let y=J0[a];if(!y){let b;switch(a){case"checkmark":b=`<span aria-hidden="true" class="ui-checkmark"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z"></path></svg>
</span>`;break;case"trailing-chevron":b='<span aria-hidden="true" class="ui-trailing-chevron"><svg focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"></path></svg></span>';break;case"mixedmark":b='<span aria-hidden="true" class="ui-mixedmark"><svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 512 512"><path fill="currentColor" d="M0 256c0-13.3 10.7-24 24-24H488c13.3 0 24 10.7 24 24s-10.7 24-24 24H24c-13.3 0-24-10.7-24-24z"/></svg></span>'}if(b){const E=document.createElement("template");E.innerHTML=b,J0[a]=E,y=E}}if(y){if("content"in y)return y.content.cloneNode(!0);const b=document.createElement("svg");return b.innerHTML=y.innerHTML,b}}var Q0=80,ep=class{constructor(a,y){this._element=null;var b;this.parentMenu=y,this._declaration=a,Oc(a)?(this.type="submenu",this.submenu=new tp(a.submenu,{parentMenu:y,submenuClass:a.submenuClass,columnCount:a.columnCount})):this.type=(b=a.type)!=null?b:"command",this.hasCheck=El(a)&&a.checked!==void 0}get rootMenu(){return this.parentMenu.rootMenu}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}dispose(){var a,y;(a=this._abortController)==null||a.abort(),this._abortController=void 0,(y=this._element)==null||y.remove(),this._element=null,this.submenu&&this.submenu.dispose(),this.submenu=void 0}get menuItem(){return this._declaration}get label(){var a;return(a=this._label)!=null?a:""}set label(a){a===void 0&&(a=""),a!==this._label&&(this._label=a,this.dirty=!0)}get visible(){return this._visible}set visible(a){a!==this._visible&&(this._visible=a,this.dirty=!0)}get enabled(){return this._enabled}set enabled(a){this._enabled=a,this.element&&(a?this.element.removeAttribute("aria-disabled"):this.element.setAttribute("aria-disabled","true")),this.dirty=!0}get checked(){return this._checked}set checked(a){this._checked=a,this.dirty=!0}get tooltip(){return this._tooltip}set tooltip(a){a!==this._tooltip&&(this._tooltip=a,this.dirty=!0)}get ariaLabel(){return this._ariaLabel}set ariaLabel(a){a!==this._ariaLabel&&(this._ariaLabel=a,this.dirty=!0)}get active(){var a,y;return(y=(a=this.element)==null?void 0:a.classList.contains("active"))!=null?y:!1}set active(a){this.element&&this.element.classList.toggle("active",a)}updateState(a){var y,b,E;const ee=this._declaration;if(zh(ee)){this.enabled=!1,this.checked=!1;return}Kh(ee)&&(this.enabled=!1,this.checked=!1,this.visible=!0),El(ee)&&(this.checked=El(ee)&&((y=Rc(ee.checked,a))!=null?y:!1)),(El(ee)||Oc(ee))&&(this.enabled=(b=Rc(ee.enabled,a))!=null?b:!0,this.visible=(E=Rc(ee.visible,a))!=null?E:!0,this.visible&&this.enabled&&this.submenu&&(this.submenu.updateState(a),this.submenu.visible||(this.visible=!1))),(El(ee)||Kh(ee)||Oc(ee))&&(this.label=Rc(ee.label,a),this.tooltip=Rc(ee.tooltip,a),this.ariaLabel=Rc(ee.ariaLabel,a)),this._element&&this.updateElement()}set dirty(a){console.assert(a===!0),a&&this.parentMenu&&(this.parentMenu.dirty=!0)}updateElement(){if(!this.visible||!this.element)return;const a=this.element;a.textContent="",this.enabled?a.removeAttribute("aria-disabled"):a.setAttribute("aria-disabled","true"),this.checked===!0?(a.setAttribute("aria-checked","true"),a.append(Hh("checkmark"))):this.checked==="mixed"?(a.setAttribute("aria-checked","mixed"),a.append(Hh("mixedmark"))):a.removeAttribute("aria-checked"),this.ariaLabel&&a.setAttribute("aria-label",this.ariaLabel);const y=document.createElement("span");if(y.className=this.parentMenu.hasCheck?"label indent":"label",this.type==="heading"&&y.classList.add("heading"),y.innerHTML=this.label,a.append(y),this._tooltip&&a.setAttribute("data-tooltip",this._tooltip),El(this._declaration)&&this._declaration.keyboardShortcut){const b=document.createElement("kbd");b.innerHTML=vh(this._declaration.keyboardShortcut),a.append(b)}this.type==="submenu"&&a.append(Hh("trailing-chevron"))}get element(){if(this._element)return this._element;if(zh(this._declaration)){const b=document.createElement("li");return b.setAttribute("part","menu-divider"),b.setAttribute("role","divider"),this._element=b,b}const a=document.createElement("li");this._element=a,(El(this._declaration)||Kh(this._declaration)||Oc(this._declaration))&&this._declaration.class&&(a.className=this._declaration.class),a.setAttribute("part","menu-item"),a.setAttribute("tabindex","-1"),this.hasCheck?a.setAttribute("role","menuitemcheckbox"):a.setAttribute("role","menuitem"),this.type==="submenu"&&(a.setAttribute("aria-haspopup","true"),a.setAttribute("aria-expanded","false"));const y=this.abortController.signal;return a.addEventListener("pointerenter",this,{signal:y}),a.addEventListener("pointerleave",this,{signal:y}),a.addEventListener("pointerup",this,{signal:y}),a.addEventListener("click",this,{signal:y}),this._element}dispatchSelect(){if(!El(this._declaration))return;const a=new CustomEvent("menu-select",{cancelable:!0,bubbles:!0,detail:{modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data}});this.parentMenu.dispatchEvent(a)&&typeof this._declaration.onMenuSelect=="function"&&this._declaration.onMenuSelect({modifiers:this.rootMenu.modifiers,id:this._declaration.id,data:this._declaration.data})}handleEvent(a){var y;if(!(!this.visible||!this.enabled)){if(a.type==="click"){this.rootMenu.state==="modal"&&this.select(),a.stopPropagation(),a.preventDefault();return}if(a.type==="pointerenter"){const b=a;this.rootMenu.cancelDelayedOperation(),this.parentMenu.isSubmenuOpen&&((y=this.parentMenu.activeMenuItem)!=null&&y.movingTowardSubmenu(b))?this.rootMenu.scheduleOperation(()=>{this.parentMenu.activeMenuItem=this,this.openSubmenu()}):(this.parentMenu.activeMenuItem=this,this.openSubmenu({withDelay:!0}));return}if(a.type==="pointerleave"){this.rootMenu.activeSubmenu===this.parentMenu&&(this.parentMenu.activeMenuItem=null);return}if(a.type==="pointerup"){this.rootMenu.state!=="modal"&&this.select(),a.stopPropagation(),a.preventDefault();return}}}select(){if(this.rootMenu.cancelDelayedOperation(),this.type==="submenu"){this.openSubmenu();return}this.active=!1,setTimeout(()=>{this.active=!0,setTimeout(()=>{this.rootMenu.hide(),this.dispatchSelect()},Q0)},Q0)}openSubmenu(a){var y;if(this.type!=="submenu"||!this.element)return;if((y=a==null?void 0:a.withDelay)!=null&&y){this.rootMenu.scheduleOperation(()=>this.openSubmenu());return}const b=this.element.getBoundingClientRect(),E=q0(this.element);this.submenu.show({container:this.rootMenu.element.parentNode,location:{x:Y0(b,"trailing",E),y:b.top-4},alternateLocation:{x:Y0(b,"leading",E),y:b.top-4}})}movingTowardSubmenu(a){if(!this.element||this.type!=="submenu")return!1;const y=this.rootMenu.lastMoveEvent;if(!y)return!1;const b=a.timeStamp-y.timeStamp;if(b>500)return!1;const E=a.clientX-y.clientX;if(wv(E,y.clientY-a.clientY,b)<=.2)return!1;let re="right";if(this.submenu.element){const ae=this.submenu.element.getBoundingClientRect(),de=this.element.getBoundingClientRect();ae.left<de.left+de.width/2&&(re="left")}return re==="right"?E>0:E<0}};function wv(a,y,b){return Math.hypot(a,y)/b}function Rc(a,y){return a===void 0||typeof a!="function"?a:(y!=null||(y={alt:!1,control:!1,shift:!1,meta:!1}),a(y))}var tp=class Vc{constructor(y,b){this._element=null,this._activeMenuItem=null,this._dirty=!0;var E,ee;this.parentMenu=(E=b==null?void 0:b.parentMenu)!=null?E:null,this._submenuClass=b==null?void 0:b.submenuClass,this.columnCount=(ee=b==null?void 0:b.columnCount)!=null?ee:1,this.isSubmenuOpen=!1,this.menuItems=y}get children(){return this._menuItems}set menuItems(y){const b=this.parentMenu;this.dispose(),this.parentMenu=b,y=[...y],this._menuItems=y.map(E=>E.onCreate?E.onCreate(E,this):new ep(E,this)),this.hasCheck=void 0,this.dirty=!0}dispose(){var y;this.hide(),this._element&&this._element.remove(),this._abortController&&this._abortController.abort(),(y=this._menuItems)==null||y.forEach(b=>b.dispose()),this._menuItems=[],this._activeMenuItem=null,this.parentMenu=null}handleEvent(y){if(y.type==="wheel"&&this._element){const b=y;this._element.scrollBy(0,b.deltaY),y.stopPropagation()}}dispatchEvent(y){return this.rootMenu.dispatchEvent(y)}get rootMenu(){return this.parentMenu.rootMenu}updateState(y){var b,E,ee;this._menuItems.forEach(ge=>ge.updateState(y));const re=this.hasCheck;this.hasCheck=this._menuItems.some(ge=>ge.visible&&ge.hasCheck),this.hasCheck!==re&&this._menuItems.forEach(ge=>ge.updateState(y));let ae,de=0;for(const ge of this._menuItems)ge.type==="heading"?(ae&&de===0&&(ae.visible=!1),ae=ge,de=0):ge.type==="divider"&&ae?(ae.visible=de>0,ae=void 0,de=0):ae&&ge.visible&&(de+=1);ae&&(ae.visible=de>0);let fe=!0;for(const ge of this._menuItems)ge.type==="divider"?(ge.visible=!fe,fe=!0):ge.visible&&(fe=!1);(b=this.activeMenuItem)!=null&&b.visible||(this.activeMenuItem=null),!((E=this.activeMenuItem)!=null&&E.enabled)&&((ee=this.activeMenuItem)==null?void 0:ee.type)==="submenu"&&this._activeMenuItem.submenu.hide(),this._dirty=!1}get enabled(){return this.updateIfDirty(),this._menuItems.some(y=>y.type!=="divider"&&y.visible&&y.enabled)}get visible(){return this.updateIfDirty(),this._menuItems.some(y=>y.type!=="divider"&&y.visible)}set dirty(y){console.assert(y===!0),this._dirty!==y&&y&&this.parentMenu&&(this._dirty=!0,this.parentMenu.dirty=!0)}updateIfDirty(){this._dirty&&this.updateState(this.rootMenu.modifiers)}updateElement(){var y;if(this._element){this._element.textContent="";for(const{element:b,visible:E}of this._menuItems)b&&E&&this._element.append(b);(y=this._element.querySelector("li:first-of-type"))==null||y.setAttribute("tabindex","0")}}get element(){if(this._element)return this._element;const y=document.createElement("menu");y.setAttribute("role","menu"),y.setAttribute("tabindex","-1"),y.setAttribute("aria-orientation","vertical"),y.setAttribute("part","ui-menu-container"),this._submenuClass&&y.classList.add(this._submenuClass),y.classList.add("ui-menu-container"),this._abortController||(this._abortController=new AbortController);const b=this._abortController.signal;return y.addEventListener("focus",this,{signal:b}),y.addEventListener("wheel",this,{passive:!0,signal:b}),this._element=y,this.updateElement(),y}get activeMenuItem(){return this._activeMenuItem}set activeMenuItem(y){var b,E,ee,re;if(this.rootMenu.cancelDelayedOperation(),y!==this._activeMenuItem){if(this.activeMenuItem){const ae=this.activeMenuItem;ae.active=!1,(b=ae.submenu)==null||b.hide()}if(!((E=y==null?void 0:y.visible)==null||E)){this._activeMenuItem=null;return}this._activeMenuItem=y,y&&(y.active=!0)}y?(ee=y.element)==null||ee.focus({preventScroll:!0}):(re=this._element)==null||re.focus({preventScroll:!0})}get firstMenuItem(){this.updateIfDirty();let y=0,b=!1;const E=this._menuItems;for(;!b&&y<=E.length-1;){const ee=E[y];b=ee.type!=="divider"&&ee.visible&&ee.enabled,y+=1}return b?E[y-1]:null}get lastMenuItem(){this.updateIfDirty();const y=this._menuItems;let b=y.length-1,E=!1;for(;!E&&b>=0;){const ee=y[b];E=ee.type!=="divider"&&ee.visible&&ee.enabled,b-=1}return E?y[b+1]:null}nextMenuItem(y){if(y===0)return this._activeMenuItem;if(!this._activeMenuItem)return y>0?this.firstMenuItem:this.lastMenuItem;if(!this.firstMenuItem||!this.lastMenuItem||!this._activeMenuItem)return null;this.updateIfDirty();const b=this._menuItems.indexOf(this.firstMenuItem),E=this._menuItems.indexOf(this.lastMenuItem);let ee=this._menuItems.indexOf(this._activeMenuItem),re=1;for(;ee>=b&&ee<=E;){ee+=y>0?1:-1;const ae=this._menuItems[ee];if(!ae)break;if(ae.visible&&ae.enabled){if(re===Math.abs(y))return this._menuItems[ee];re+=1}}return y>0?this.lastMenuItem:this.firstMenuItem}getMenuItemColumn(y){this.updateIfDirty();const E=this._menuItems.filter(ee=>ee.visible&&ee.enabled).indexOf(y);return E<0?-1:E%this.columnCount}static get collator(){return Vc._collator||(Vc._collator=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),Vc._collator}findMenuItem(y){var b;this.updateIfDirty();const E=this._menuItems.filter(de=>de.type!=="divider"&&de.visible&&de.enabled);if(E.length===0)return null;const ee=Math.max(...E.map(de=>de.label.length))-y.length;if(ee<0)return null;let re=null,ae=0;for(;ae<ee&&!re;)re=(b=E.find(de=>Vc.collator.compare(y,de.label.substring(ae,y.length))===0))!=null?b:null,ae++;return re}show(y){return!this.visible||!y.container?!1:(this.updateElement(),y.container.appendChild(this.element),Lt()&&(this.element.popover="manual",this.element.showPopover()),y.location&&bv(this.element,{location:y.location,alternateLocation:y.alternateLocation,verticalPos:"bottom",horizontalPos:"start"}),this.element.focus({preventScroll:!0}),this.parentMenu&&(this.parentMenu.openSubmenu=this),!0)}hide(){var y,b,E,ee,re;this.openSubmenu=null,this.activeMenuItem=null,this.parentMenu&&(this.parentMenu.openSubmenu=null),Lt()&&((y=this._element)!=null&&y.popover)&&this.element.hidePopover(),(E=(b=this.parentMenu)==null?void 0:b.element)==null||E.focus(),(re=(ee=this._element)==null?void 0:ee.parentNode)==null||re.removeChild(this._element)}set openSubmenu(y){var b,E,ee,re;const ae=y!==null;((b=this.activeMenuItem)==null?void 0:b.type)==="submenu"&&((E=this.activeMenuItem.element)==null||E.setAttribute("aria-expanded",ae.toString())),(re=(ee=this.activeMenuItem)==null?void 0:ee.element)==null||re.classList.toggle("is-submenu-open",ae),this.isSubmenuOpen=ae}},np=class rm extends tp{constructor(y,b){var E;super(y),this.state="closed",this.typingBufferResetTimer=0,this.hysteresisTimer=0,this._updating=!1,this._host=(E=b==null?void 0:b.host)!=null?E:null,this.isDynamic=y.some(rp),this._modifiers={shift:!1,control:!1,alt:!1,meta:!1},this.typingBuffer="",this.state="closed"}get modifiers(){return this._modifiers}set modifiers(y){zm(this._modifiers,y)||(this._modifiers=y,this.dirty=!0)}get activeSubmenu(){let y=this;for(;y.isSubmenuOpen;)y=y.activeMenuItem.submenu;return y}set dirty(y){this._updating||(console.assert(y===!0),this._dirty!==y&&(this._dirty=!0,y&&setTimeout(()=>{this.updateState(this.modifiers),this.updateElement()})))}updateState(y){this._updating=!0,this.modifiers=y!=null?y:this.modifiers,super.updateState(this.modifiers),this._updating=!1}handleKeyupEvent(y){this.isDynamic&&(this.modifiers=Nu(y)),y.stopImmediatePropagation()}handleKeydownEvent(y){var b,E,ee;if(y.key==="Tab"||y.key==="Escape"){this.hide();return}this.isDynamic&&(this.modifiers=Nu(y));let re=!0;const ae=this.activeSubmenu,de=ae.activeMenuItem;switch(y.key){case" ":case"Space":case"Return":case"Enter":de==null||de.select(Nu(y));break;case"ArrowRight":if((de==null?void 0:de.type)==="submenu")de.select(Nu(y)),this.activeSubmenu.activeMenuItem=this.activeSubmenu.firstMenuItem;else if(!de)ae.activeMenuItem=ae.firstMenuItem;else{const fe=(b=ae.getMenuItemColumn(de))!=null?b:-1;if(fe>=0&&fe<((E=ae.columnCount)!=null?E:1)-1){const ge=ae.nextMenuItem(1);ge&&(ae.activeMenuItem=ge)}}break;case"ArrowLeft":if(ae===this.rootMenu)de||(ae.activeMenuItem=ae.firstMenuItem);else if((de&&(ee=ae.getMenuItemColumn(de))!=null?ee:-1)<=0||!de){ae.hide();const ge=ae.parentMenu.activeMenuItem;if(ge){const{element:xe}=ge;xe==null||xe.focus(),xe==null||xe.classList.remove("is-submenu-open")}}else{const ge=ae.nextMenuItem(-1);ge&&(ae.activeMenuItem=ge)}break;case"ArrowDown":ae.activeMenuItem=ae.nextMenuItem(ae.columnCount);break;case"ArrowUp":ae.activeMenuItem=ae.nextMenuItem(-ae.columnCount);break;case"Home":case"PageUp":ae.activeMenuItem=ae.firstMenuItem;break;case"End":case"PageDown":ae.activeMenuItem=ae.lastMenuItem;break;case"Backspace":if(this.typingBuffer&&(this.typingBuffer=this.typingBuffer.slice(0,-1),this.typingBuffer)){clearTimeout(this.typingBufferResetTimer);const fe=ae.findMenuItem(this.typingBuffer);fe&&(ae.activeMenuItem=fe),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}break;default:if(Sf(y)){isFinite(this.typingBufferResetTimer)&&clearTimeout(this.typingBufferResetTimer),this.typingBuffer+=y.key;const fe=ae.findMenuItem(this.typingBuffer);fe&&(ae.activeMenuItem=fe),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}else re=!1}re&&(y.preventDefault(),y.stopPropagation())}handleEvent(y){if(y.type==="keydown")this.handleKeydownEvent(y);else if(y.type==="keyup")this.handleKeyupEvent(y);else if(y.type==="pointermove")this.lastMoveEvent=y;else if(y.type==="pointerup"&&y.target===this.scrim)Number.isFinite(this.rootMenu._openTimestamp)&&Date.now()-this.rootMenu._openTimestamp<120?this.state="modal":this.state==="modal"&&this.hide();else if(y.type==="contextmenu"){y.preventDefault(),y.stopPropagation();return}super.handleEvent(y)}dispatchEvent(y){return this._host?this._host.dispatchEvent(y):!0}get scrim(){return wl.element}connectScrim(y){const b=this.scrim;b.addEventListener("pointerup",this),b.addEventListener("contextmenu",this),b.addEventListener("keydown",this),b.addEventListener("keyup",this),b.addEventListener("pointermove",this),wl.open({root:y,onDismiss:()=>this.hide()})}disconnectScrim(){const y=this.scrim;y.removeEventListener("pointerup",this),y.removeEventListener("contextmenu",this),y.removeEventListener("keydown",this),y.removeEventListener("keyup",this),y.removeEventListener("pointermove",this),wl.state==="open"&&wl.scrim.close()}get rootMenu(){return this}show(y){return this._onDismiss=y==null?void 0:y.onDismiss,y!=null&&y.modifiers&&(this.modifiers=y.modifiers),this.updateState(),this.connectScrim(y==null?void 0:y.target),super.show(he(we({},y),{container:this.scrim}))?(this._openTimestamp=Date.now(),this.state="open",!0):(this.disconnectScrim(),!1)}hide(){this.cancelDelayedOperation(),this.state!==void 0&&(this.state!=="closed"&&(this.activeMenuItem=null,wl.element.parentElement.focus(),super.hide(),this.state="closed",this.disconnectScrim()),this._onDismiss&&(this._onDismiss(),this._onDismiss=void 0))}scheduleOperation(y){this.cancelDelayedOperation();const b=rm.SUBMENU_DELAY;if(b<=0){y();return}this.hysteresisTimer=setTimeout(()=>{this.hysteresisTimer=0,y()},b)}cancelDelayedOperation(){this.hysteresisTimer&&(clearTimeout(this.hysteresisTimer),this.hysteresisTimer=0)}};np.SUBMENU_DELAY=120;var Sv=np;function rp(a){return zh(a)?!1:typeof a.label=="function"||typeof a.ariaLabel=="function"||typeof a.tooltip=="function"||(El(a)||Oc(a))&&(typeof a.enabled=="function"||typeof a.visible=="function")||El(a)&&typeof a.checked=="function"?!0:Oc(a)?a.submenu.some(rp):!1}var Gf=class{};Gf.DELAY=300,Gf.MAX_DISTANCE=10;function Cv(a){return new Promise((y,b)=>{const E=wf(a);E||y(!1);let ee=E;const re=setTimeout(()=>{ae.abort(),y(xv(ee,E)<Gf.MAX_DISTANCE)},Gf.DELAY),ae=new AbortController,de=ae.signal;for(const fe of["pointermove","pointerup","pointercancel"])window.addEventListener(fe,ge=>{if(ge.type==="pointerup"||ge.type==="pointercancel")clearTimeout(re),ae.abort(),y(!1);else if(ge.type==="pointermove"){const xe=wf(ge);xe&&(ee=xe)}},{passive:!0,signal:de})})}function ip(a,y,b){return gu(this,null,function*(){if(a.type==="contextmenu"){const E=a;if(b.show({target:y,location:wf(E),modifiers:Nu(E)}))return a.preventDefault(),a.stopPropagation(),!0}if(a.type==="keydown"){const E=a;if(E.code==="ContextMenu"||E.code==="F10"&&E.shiftKey){const ee=y==null?void 0:y.getBoundingClientRect();if(ee&&b.show({target:y,location:{x:Math.ceil(ee.left+ee.width/2),y:Math.ceil(ee.top+ee.height/2)},modifiers:Nu(E)}))return a.preventDefault(),a.stopPropagation(),!0}}if(a.type==="pointerdown"&&a.pointerType!=="mouse"&&a.button===0){let E=a.target;for(;E&&y!==E;)E=E.parentNode;if(!E||!b.visible)return!1;const ee=wf(a);if(yield Cv(a))return b.state!=="closed"?!1:(b.show({target:y,location:ee}),!0)}return!1})}var ap={acute:714,grave:715,dot:729,ddot:168,mathring:730,tilde:126,bar:713,breve:728,check:711,hat:94,vec:8407};Rt(Object.keys(ap),"{body:auto}",{createAtom:a=>new z(he(we({},a),{body:rt(a.args[0]),accentChar:ap[a.command.slice(1)]}))}),Rt(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:a=>{const y=Jt(rt(a.args[0]));return new z(he(we({},a),{body:rt(a.args[0]),svgAccent:a.command.slice(1)+(y.length>5?"4":["1","1","2","2","3","3"][y.length])}))}}),Rt(["overarc","overparen","wideparen"],"{body:auto}",{createAtom:a=>new z(he(we({},a),{body:rt(a.args[0]),svgAccent:"overarc"}))}),Rt(["underarc","underparen"],"{body:auto}",{createAtom:a=>new js(he(we({},a),{body:rt(a.args[0]),svgBelow:"underarc"}))}),Rt("utilde","{body:auto}",{createAtom:a=>{const y=rt(a.args[0]),b=Jt(y),E="widetilde"+(b.length>5?"4":["1","1","2","2","3","3"][b.length]);return new js(he(we({},a),{body:y,svgBelow:E,boxType:ru(y)}))}}),Rt("^","{:string}",{createAtom:a=>{var y;return new In(he(we({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={a:"\xE2",e:"\xEA",i:"\xEE",o:"\xF4",u:"\xFB",A:"\xC2",E:"\xCA",I:"\xCE",O:"\xD4",U:"\xDB"}[a.args[0]])!=null?y:"^"}))}}),Rt("`","{:string}",{createAtom:a=>{var y;return new In(he(we({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={a:"\xE0",e:"\xE8",i:"\xEC",o:"\xF2",u:"\xF9",A:"\xC0",E:"\xC8",I:"\xCC",O:"\xD2",U:"\xD9"}[a.args[0]])!=null?y:"`"}))}}),Rt("'","{:string}",{createAtom:a=>{var y;return new In(he(we({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={a:"\xE1",e:"\xE9",i:"\xED",o:"\xF3",u:"\xFA",A:"\xC1",E:"\xC9",I:"\xCD",O:"\xD3",U:"\xDA"}[a.args[0]])!=null?y:"'"}))}}),Rt('"',"{:string}",{createAtom:a=>{var y,b;return new In(he(we({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:(y=a.args)!=null&&y[0]?(b={a:"\xE4",e:"\xEB",i:"\xEF",o:"\xF6",u:"\xFC",A:"\xC4",E:"\xCB",I:"\xCB",O:"\xD6",U:"\xDC"}[a.args[0]])!=null?b:'"'+a.args[0]:'"'}))}}),Rt(".","{:string}",{createAtom:a=>{var y,b;return new In(he(we({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:(y=a.args)!=null&&y[0]?(b={a:"\u0227",e:"\u0117",i:"\u0307i",o:"\u022F",u:"\u0307u",A:"\u0226",E:"\u0116",I:"\u0130",O:"\u022E",U:"\u0307U"}[a.args[0]])!=null?b:"."+a.args[0]:"."}))}}),Rt("=","{:string}",{createAtom:a=>{var y,b;return new In(he(we({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:(y=a.args)!=null&&y[0]?(b={a:"\u0101",e:"\u0113",i:"\u012B",o:"\u014D",u:"\u016B",A:"\u0100",E:"\u0112",I:"\u012A",O:"\u014C",U:"\u016A"}[a.args[0]])!=null?b:"="+a.args[0]:"="}))}}),Rt("~","{:string}",{createAtom:a=>{var y;return new In(he(we({type:"mord"},a),{isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={n:"\xF1",N:"\xD1",a:"\xE3",o:"\xF5",A:"\xC3",O:"\xD5"}[a.args[0]])!=null?y:"\xB4"}))}}),Rt("c","{:string}",{createAtom:a=>{var y;return new In(he(we({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={c:"\xE7",C:"\xC7"}[a.args[0]])!=null?y:""}))}}),Rt("enclose","{notation:string}[style:string]{body:auto}",{createAtom:a=>{var y,b;const E=a.args,ee={strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",backgroundcolor:"transparent",padding:"auto",shadow:"none",svgStrokeStyle:void 0,borderStyle:void 0,style:(y=a.style)!=null?y:{}};if(E[1]){const ae=E[1].split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);for(const de of ae){const fe=de.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(fe)ee.strokeWidth=fe[1],ee.strokeStyle=fe[2],ee.strokeColor=fe[3];else{const ge=de.match(/\s*([a-z]*)\s*=\s*"(.*)"/);ge&&(ge[1]==="mathbackground"?ee.backgroundcolor=ge[2]:ge[1]==="mathcolor"?ee.strokeColor=ge[2]:ge[1]==="padding"?ee.padding=ge[2]:ge[1]==="shadow"&&(ee.shadow=ge[2]))}}ee.strokeStyle==="dashed"?ee.svgStrokeStyle="5,5":ee.strokeStyle==="dotted"&&(ee.svgStrokeStyle="1,5")}ee.borderStyle=`${ee.strokeWidth} ${ee.strokeStyle} ${ee.strokeColor}`;const re={};return((b=E[0])!=null?b:"").split(/[, ]/).filter(ae=>ae.length>0).forEach(ae=>{re[ae.toLowerCase()]=!0}),new bd(a.command,rt(E[2]),re,ee)}}),Rt("cancel","{body:auto}",{createAtom:a=>{var y;return new bd(a.command,rt(a.args[0]),{updiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(y=a.style)!=null?y:{}})}}),Rt("bcancel","{body:auto}",{createAtom:a=>{var y;return new bd(a.command,rt(a.args[0]),{downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(y=a.style)!=null?y:{}})}}),Rt("xcancel","{body:auto}",{createAtom:a=>{var y;return new bd(a.command,rt(a.args[0]),{updiagonalstrike:!0,downdiagonalstrike:!0},{strokeColor:"currentColor",strokeWidth:"",strokeStyle:"solid",borderStyle:"1px solid currentColor",backgroundcolor:"transparent",padding:"auto",shadow:"none",style:(y=a.style)!=null?y:{}})}}),Rt(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overlinesegment","overgroup"],"{:auto}",{createAtom:a=>{var y;return new js(he(we({},a),{body:rt((y=a.args)==null?void 0:y[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgAbove:a.command.slice(1)}))}}),Rt("overbrace","{:auto}",{createAtom:a=>new js(he(we({},a),{body:rt(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgAbove:a.command.slice(1)}))}),Rt(["underrightarrow","underleftarrow","underleftrightarrow","underlinesegment","undergroup"],"{:auto}",{createAtom:a=>new js(he(we({},a),{body:rt(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgBelow:a.command.slice(1)}))}),Rt(["underbrace"],"{:auto}",{createAtom:a=>new js(he(we({},a),{body:rt(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgBelow:a.command.slice(1)}))}),Rt(["xrightarrow","longrightarrow","xleftarrow","longleftarrow","xRightarrow","xLeftarrow","xleftharpoonup","xleftharpoondown","xrightharpoonup","xrightharpoondown","xlongequal","xtwoheadleftarrow","xtwoheadrightarrow","xleftrightarrow","longleftrightarrow","xLeftrightarrow","xrightleftharpoons","longrightleftharpoons","xleftrightharpoons","xhookleftarrow","xhookrightarrow","xmapsto","xtofrom","xleftrightarrows","longleftrightarrows","xRightleftharpoons","longRightleftharpoons","xLeftrightharpoons","longLeftrightharpoons"],"[:auto]{:auto}",{createAtom:a=>{var y,b,E,ee,re;return new js(he(we({},a),{svgBody:a.command.slice(1),above:((b=rt((y=a.args)==null?void 0:y[1]))==null?void 0:b.length)===0?void 0:rt((E=a.args)==null?void 0:E[1]),below:(re=rt((ee=a.args)==null?void 0:ee[0]))!=null?re:null,skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,paddedLabels:!0,boxType:"rel"}))},serialize:(a,y)=>a.command+(a.hasEmptyBranch("below")?"":`[${a.belowToLatex(y)}]`)+`{${a.aboveToLatex(y)}}${a.supsubToLatex(y)}`}),Rt(["arccos","arcsin","arctan","arctg","arcctg","arg","ch","cos","cosh","cot","cotg","coth","ctg","cth","csc","cosec","deg","dim","exp","gcd","hom","inf","ker","lb","lg","ln","log","Pr","sec","sh","sin","sinh","sup","tan","tanh","tg","th","arcsec","arccsc","arsinh","arcosh","artanh","arcsech","arccsch"],"",{isFunction:!0,ifMode:"math",createAtom:a=>new Ru(a.command.slice(1),he(we({},a),{limits:"adjacent",isFunction:!0,variant:"main",variantStyle:"up"}))}),Rt(["liminf","limsup"],"",{ifMode:"math",createAtom:a=>new Ru({"\\liminf":"lim inf","\\limsup":"lim sup"}[a.command],he(we({},a),{limits:"over-under",variant:"main"}))}),Rt(["lim","mod"],"",{ifMode:"math",createAtom:a=>new Ru(a.command.slice(1),he(we({},a),{limits:"over-under",variant:"main"}))}),Rt(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:a=>new Ru(a.command.slice(1),he(we({},a),{limits:"over-under",isFunction:!0,variant:"main"}))}),Rt(["ang"],"{:math}",{ifMode:"math",createAtom:a=>new In(he(we({},a),{body:rt(a.args[0])})),serialize:(a,y)=>`\\ang{${a.bodyToLatex(y)}}`,render:(a,y)=>{const b=a.createBox(y),E=b.caret;b.caret=void 0;const ee=new sr("\xB0",{style:he(we({},a.style),{variant:"normal",variantStyle:"up"})});return new sr([b,ee],{type:"inner",isSelected:a.isSelected,caret:E})}}),Rt("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:a=>new o0(he(we({},a),{body:rt(a.args[1]),index:a.args[0]?rt(a.args[0]):void 0}))}),Rt(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{:expression}{:expression}",{ifMode:"math",createAtom:a=>{const y=we({},a),b=a.command,E=a.args;switch(b){case"\\dfrac":case"\\frac":case"\\tfrac":y.hasBarLine=!0;break;case"\\atopfrac":y.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":y.hasBarLine=!1,y.leftDelim="(",y.rightDelim=")";break;case"\\cfrac":y.hasBarLine=!0,y.continuousFraction=!0;break;default:}switch(b){case"\\dfrac":case"\\dbinom":y.mathstyleName="displaystyle";break;case"\\tfrac":case"\\tbinom":y.mathstyleName="textstyle";break;default:}return new _c(E[0]?rt(E[0]):[new hi],E[1]?rt(E[1]):[new hi],y)},serialize:(a,y)=>{const b=a.aboveToLatex(y),E=a.belowToLatex(y);return/^[0-9]$/.test(b)&&/^[0-9]$/.test(E)?`${a.command}${b}${E}`:uo(a.command,b,E)}}),Rt(["brace","brack"],"",{infix:!0,createAtom:a=>new _c(rt(a.args[0]),rt(a.args[1]),he(we({},a),{hasBarLine:!1,leftDelim:a.command==="\\brace"?"\\lbrace":"\\lbrack",rightDelim:a.command==="\\brace"?"\\rbrace":"\\rbrack"})),serialize:(a,y)=>na([a.aboveToLatex(y),a.command,a.belowToLatex(y)])}),Rt(["over","atop","choose"],"",{infix:!0,createAtom:a=>{let y,b;const E=a.args;return a.command==="\\choose"&&(y="(",b=")"),new _c(rt(E[0]),rt(E[1]),he(we({},a),{hasBarLine:a.command==="\\over",leftDelim:y,rightDelim:b}))},serialize:(a,y)=>na([a.aboveToLatex(y),a.command,a.belowToLatex(y)])}),Rt(["overwithdelims","atopwithdelims"],"{numer:auto}{denom:auto}{left-delim:delim}{right-delim:delim}",{infix:!0,createAtom:a=>{var y,b;const E=a.args;return new _c(rt(E[0]),rt(E[1]),he(we({},a),{leftDelim:(y=E[2])!=null?y:".",rightDelim:(b=E[3])!=null?b:".",hasBarLine:!1}))},serialize:(a,y)=>`${a.aboveToLatex(y)} ${a.command}${a.leftDelim}${a.rightDelim}${a.belowToLatex(y)}`}),Rt("pdiff","{numerator}{denominator}",{ifMode:"math",createAtom:a=>new _c(rt(a.args[0]),rt(a.args[1]),he(we({},a),{hasBarLine:!0,numerPrefix:"\u2202",denomPrefix:"\u2202"}))}),Rt(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","intop"],"",{ifMode:"math",createAtom:a=>new fh({coprod:"\u2210",bigvee:"\u22C1",bigwedge:"\u22C0",biguplus:"\u2A04",bigcap:"\u22C2",bigcup:"\u22C3",intop:"\u222B",prod:"\u220F",sum:"\u2211",bigotimes:"\u2A02",bigoplus:"\u2A01",bigodot:"\u2A00",bigsqcup:"\u2A06",smallint:"\u222B"}[a.command.slice(1)],he(we({},a),{limits:"auto",variant:"main"}))}),Rt("smallint","",{ifMode:"math",createAtom:a=>new Ru("\u222B",he(we({},a),{limits:"adjacent",variant:"main"}))});var op={int:"\u222B",iint:"\u222C",iiint:"\u222D",oint:"\u222E",oiint:"\u222F",oiiint:"\u2230",intclockwise:"\u2231",varointclockwise:"\u2232",ointctrclockwise:"\u2233",intctrclockwise:"\u2A11",sqcup:"\u2294",sqcap:"\u2293",uplus:"\u228E",wr:"\u2240",amalg:"\u2A3F",Cap:"\u22D2",Cup:"\u22D3",doublecap:"\u22D2",doublecup:"\u22D3"};Rt(Object.keys(op),"",{ifMode:"math",createAtom:a=>{const y=a.command,b=op[y.slice(1)];return new fh(b,he(we({},a),{limits:"adjacent",variant:{"\u22D2":"ams","\u22D3":"ams"}[b]}))}}),Rt(["Re","Im"],"",{ifMode:"math",createAtom:a=>new Ru({"\\Re":"\u211C","\\Im":"\u2111"}[a.command],he(we({},a),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))}),Rt("middle","{:delim}",{ifMode:"math",createAtom:a=>{var y;return new r0(he(we({},a),{delim:(y=a.args[0])!=null?y:"|",size:1}))}}),Rt("the","{:value}",{createAtom:a=>new In(he(we({},a),{captureSelection:!0,verbatimLatex:null})),render:(a,y)=>{var b;const E=new ya({parent:y},a.style);let ee="";a.isSelected&&(ee+=" ML__selected");const re=E.evaluate(a.args[0]);return new sr(((b=Do(re))!=null?b:"").split("").map(ae=>new sr(ae,{type:"ord",classes:ee,mode:a.mode,isSelected:a.isSelected,style:we({variant:"main"},a.style)})),{type:"lift",style:a.style,caret:a.caret,isSelected:a.isSelected,classes:ee}).wrap(E)},serialize:a=>{var y;return`\\the${(y=Do(a.args[0]))!=null?y:"\\relax"}`}}),Rt("mathtip","{:auto}{:math}",{createAtom:a=>new hh(he(we({},a),{body:rt(a.args[0]),tooltip:rt(a.args[1]),content:"math"})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`\\texttip{${a.bodyToLatex(y)}}{${In.serialize([a.tooltip],he(we({},y),{defaultMode:"math"}))}}`}),Rt("texttip","{:auto}{:text}",{createAtom:a=>new hh(he(we({},a),{body:rt(a.args[0]),tooltip:rt(a.args[1]),content:"text"})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`\\texttip{${a.bodyToLatex(y)}}{${In.serialize([a.tooltip],he(we({},y),{defaultMode:"text"}))}}`}),Rt("error","{:math}",{createAtom:a=>new In(he(we({},a),{body:rt(a.args[0])})),serialize:(a,y)=>`\\error{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__error"})}),Rt("ensuremath","{:math}",{createAtom:a=>new In(he(we({},a),{body:rt(a.args[0])})),serialize:(a,y)=>`${a.command}{${a.bodyToLatex(he(we({},y),{defaultMode:"math"}))}}`}),Rt("color","{:value}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimColor:(E=Do(y[0]))!=null?E:void 0,color:b.toColor((ee=y[0])!=null?ee:{string:"red"})}}}),Rt("textcolor","{:value}{content:auto*}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimColor:(E=Do(y[0]))!=null?E:void 0,color:b.toColor((ee=y[0])!=null?ee:{string:"red"})}}}),Rt("boxed","{content:math}",{createAtom:a=>new _o(he(we({},a),{body:rt(a.args[0]),framecolor:{string:"black"}}))}),Rt("colorbox","{:value}{:text*}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimBackgroundColor:(E=Do(y[0]))!=null?E:void 0,backgroundColor:b.toBackgroundColor((ee=y[0])!=null?ee:{string:"yellow"})}}}),Rt("fcolorbox","{frame-color:value}{background-color:value}{content:text}",{applyMode:"text",createAtom:a=>{var y,b;return new _o(he(we({},a),{body:rt(a.args[2]),framecolor:(y=a.args[0])!=null?y:{string:"blue"},backgroundcolor:(b=a.args[1])!=null?b:{string:"yellow"}}))},serialize:(a,y)=>{var b,E;return y.skipStyles?a.bodyToLatex(he(we({},y),{defaultMode:"text"})):uo(a.command,(b=Do(a.framecolor))!=null?b:"",(E=Do(a.backgroundcolor))!=null?E:"",a.bodyToLatex(he(we({},y),{defaultMode:"text"})))}}),Rt("bbox","[:bbox]{body:auto}",{createAtom:a=>{var y;const b=a.args[0],E=rt(a.args[1]);return b?new _o(he(we({},a),{body:E,padding:b.padding,border:b.border,backgroundcolor:(y=b.backgroundcolor)!=null?y:void 0})):new _o(he(we({},a),{body:E}))},serialize:(a,y)=>{var b,E;if(y.skipStyles)return a.bodyToLatex(y);let ee=a.command;if(Number.isFinite(a.padding)||a.border!==void 0||a.backgroundcolor!==void 0){const re=[];a.padding&&re.push((b=Do(a.padding))!=null?b:""),a.border&&re.push(`border: ${a.border}`),a.backgroundcolor&&re.push((E=Do(a.backgroundcolor))!=null?E:""),ee+=`[${re.join(",")}]`}return uo(ee,a.bodyToLatex(y))}}),Rt(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:a=>new In(he(we({},a),{body:rt(a.args[0])})),render:(a,y)=>{const b=new ya({parent:y,mathstyle:a.command.slice(1)},a.style),E=In.createBox(b,a.body,{type:"lift"});return a.caret&&(E.caret=a.caret),a.bind(y,E)},serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`{${na([a.command,a.bodyToLatex(y)])}}`}),Rt(["tiny","scriptsize","footnotesize","small","normalsize","large","Large","LARGE","huge","Huge"],"",{applyStyle:a=>({fontSize:{"\\tiny":1,"\\scriptsize":2,"\\footnotesize":3,"\\small":4,"\\normalsize":5,"\\large":6,"\\Large":7,"\\LARGE":8,"\\huge":9,"\\Huge":10}[a]})}),Rt("fontseries","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontSeries:(b=y[0])!=null?b:"auto"}}}),Rt("fontshape","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontShape:(b=y[0])!=null?b:"auto"}}}),Rt("fontfamily","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontFamily:(b=y[0])!=null?b:"roman"}}}),Rt("selectfont","",{ifMode:"text",applyStyle:()=>({})}),Rt("bf","{:rest}",{applyStyle:()=>({fontSeries:"b",fontShape:"n",fontFamily:"roman"})}),Rt(["boldsymbol","bm"],"{:math}",{applyMode:"math",createAtom:a=>new In(he(we({},a),{body:rt(a.args[0])})),serialize:(a,y)=>`${a.command}{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__boldsymbol"})}),Rt("bold","{:math*}",{applyMode:"math",applyStyle:()=>({variantStyle:"bold"})}),Rt("bfseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),Rt("mdseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),Rt("upshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),Rt("slshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),Rt("scshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),Rt("textbf","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),Rt("textmd","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),Rt("textup","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),Rt("textnormal","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n",fontSeries:"m"})}),Rt("textsl","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),Rt("textit","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"it"})}),Rt("textsc","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),Rt("textrm","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"roman"})}),Rt("textsf","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"sans-serif"})}),Rt("texttt","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"monospace"})}),Rt("mathbf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"bold"})}),Rt("mathit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"italic"})}),Rt("mathnormal","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"italic"})}),Rt("mathbfit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"bolditalic"})}),Rt("mathrm","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"up"})}),Rt("mathsf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"sans-serif",variantStyle:"up"})}),Rt("mathtt","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"monospace",variantStyle:"up"})}),Rt("it","{:rest}",{applyStyle:()=>({fontSeries:"m",fontShape:"it",fontFamily:"roman",variantStyle:"italic"})}),Rt("rmfamily","",{applyStyle:()=>({fontFamily:"roman"})}),Rt("sffamily","",{applyStyle:()=>({fontFamily:"sans-serif"})}),Rt("ttfamily","",{applyStyle:()=>({fontFamily:"monospace"})}),Rt(["Bbb","mathbb"],"{:math*}",{applyStyle:()=>({variant:"double-struck",variantStyle:"up"})}),Rt(["frak","mathfrak"],"{:math*}",{applyStyle:()=>({variant:"fraktur",variantStyle:"up"})}),Rt("mathcal","{:math*}",{applyStyle:()=>({variant:"calligraphic",variantStyle:"up"})}),Rt("mathscr","{:math*}",{applyStyle:()=>({variant:"script",variantStyle:"up"})}),Rt("mbox","{:text}",{ifMode:"math",createAtom:a=>new In(he(we({},a),{type:"mord",body:rt(a.args[0]),mode:"math"})),serialize:(a,y)=>uo("\\mbox",a.bodyToLatex(he(we({},y),{defaultMode:"text"})))}),Rt("text","{:text}",{ifMode:"math",applyMode:"text"}),Rt(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:a=>new In(he(we({},a),{body:rt(a.args[1])})),serialize:(a,y)=>!a.args[0]||y.skipStyles?a.bodyToLatex(y):`${a.command}{${a.args[0]}}{${a.bodyToLatex(y)}}`,render:(a,y)=>{var b;return a.createBox(y,{classes:(b=a.args[0])!=null?b:""})}}),Rt(["cssId","htmlId"],"{id:string}{content:auto}",{createAtom:a=>new In(he(we({},a),{body:rt(a.args[1])})),serialize:(a,y)=>{var b;return!((b=a.args)!=null&&b[0])||y.skipStyles?a.bodyToLatex(y):`${a.command}{${a.args[0]}}{${a.bodyToLatex(y)}}`},render:(a,y)=>{var b;const E=a.createBox(y);return E.cssId=(b=a.args[0])!=null?b:"",E}}),Rt("htmlData","{data:string}{content:auto}",{createAtom:a=>new In(he(we({},a),{body:rt(a.args[1])})),serialize:(a,y)=>{var b;return!((b=a.args)!=null&&b[0])||y.skipStyles?a.bodyToLatex(y):`\\htmlData{${a.args[0]}}{${a.bodyToLatex(y)}}`},render:(a,y)=>{var b;const E=a.createBox(y);return E.htmlData=(b=a.args[0])!=null?b:"",E}}),Rt(["style","htmlStyle"],"{data:string}{content:auto}",{createAtom:a=>new In(he(we({},a),{body:rt(a.args[1])})),serialize:(a,y)=>{var b;return!((b=a.args)!=null&&b[0])||y.skipStyles?a.bodyToLatex(y):`${a.command}{${a.args[0]}}{${a.bodyToLatex(y)}}`},render:(a,y)=>{var b;const E=a.createBox(y);return E.htmlStyle=(b=a.args[0])!=null?b:"",E}}),Rt("em","{:rest}",{createAtom:a=>new In(he(we({},a),{body:rt(a.args[0])})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`{\\em ${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__emph",boxType:"lift"})}),Rt("emph","{:auto}",{createAtom:a=>new In(he(we({},a),{body:rt(a.args[1])})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`\\emph{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__emph",boxType:"lift"})});var sp={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}};Rt(["bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr","bigm","Bigm","biggm","Biggm","big","Big","bigg","Bigg"],"{:delim}",{createAtom:a=>{var y;return new i0(he(we({},a),{delim:(y=a.args[0])!=null?y:".",size:sp[a.command].size,delimType:sp[a.command].mclass}))}}),Rt(["hspace","hspace*"],"{width:value}",{createAtom:a=>{var y;return new Sd(he(we({},a),{width:(y=a.args[0])!=null?y:{dimension:0}}))}}),Rt(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:a=>{var y;return new Sd(he(we({},a),{width:(y=a.args[0])!=null?y:{dimension:0}}))}}),Rt("mathchoice","{:math}{:math}{:math}{:math}",{createAtom:a=>new In(a),render:(a,y)=>{let b=0;const E=y.mathstyle.id;(E===Du||E===ml)&&(b=1),(E===zl||E===ss)&&(b=2),(E===_s||E===Zo)&&(b=3);const ee=rt(a.args[b]);return In.createBox(y,ee)},serialize:(a,y)=>`\\mathchoice{${In.serialize(a.args[0],y)}}{${In.serialize(a.args[1],y)}}{${In.serialize(a.args[2],y)}}{${In.serialize(a.args[3],y)}}`}),Rt("mathop","{:auto}",{createAtom:a=>new In(he(we({},a),{type:"mop",body:rt(a.args[0]),limits:"over-under",isFunction:!0,captureSelection:!0})),render:(a,y)=>{var b;let E=In.createBox(y,a.body);if(a.superscript||a.subscript){const ee=(b=a.subsupPlacement)!=null?b:"auto";E=ee==="over-under"||ee==="auto"&&y.isDisplayStyle?a.attachLimits(y,{base:E}):a.attachSupsub(y,{base:E})}return new sr(a.bind(y,E),{type:"op",isSelected:a.isSelected,classes:"op-group"})},serialize:(a,y)=>{const b=[uo(a.command,a.bodyToLatex(y))];return a.explicitSubsupPlacement&&(a.subsupPlacement==="over-under"&&b.push("\\limits"),a.subsupPlacement==="adjacent"&&b.push("\\nolimits"),a.subsupPlacement==="auto"&&b.push("\\displaylimits")),b.push(a.supsubToLatex(y)),na(b)}}),Rt(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:a=>new In(he(we({},a),{type:{"\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[a.command],body:rt(a.args[0])}))}),Rt(["operatorname","operatorname*"],"{operator:math}",{createAtom:a=>{const y=rt(a.args[0]).map(b=>{var E;return b.type!=="first"&&(b.type="mord",b.value=(E={"\u2217":"*","\u2212":"-"}[b.value])!=null?E:b.value,b.isFunction=!1,!b.style.variant&&!b.style.variantStyle&&(b.style.variant="main",b.style.variantStyle="up")),b});return new In(he(we({},a),{type:"mop",body:y,isFunction:!0,limits:a.command==="\\operatorname"?"adjacent":"over-under"}))},render:(a,y)=>{var b;let E=In.createBox(y,a.body);if(a.superscript||a.subscript){const ee=(b=a.subsupPlacement)!=null?b:"auto";E=ee==="over-under"||ee==="auto"&&y.isDisplayStyle?a.attachLimits(y,{base:E}):a.attachSupsub(y,{base:E})}return a.caret&&(E.caret=a.caret),new sr(a.bind(y,E),{type:"op",isSelected:a.isSelected,classes:"op-group"})},serialize:(a,y)=>{const b=[uo(a.command,a.bodyToLatex(y))];return a.explicitSubsupPlacement&&(a.subsupPlacement==="over-under"&&b.push("\\limits"),a.subsupPlacement==="adjacent"&&b.push("\\nolimits"),a.subsupPlacement==="auto"&&b.push("\\displaylimits")),b.push(a.supsubToLatex(y)),na(b)}}),Rt(["char","unicode"],"{charcode:value}",{createAtom:a=>new In(he(we({},a),{type:a.mode==="text"?"text":"mord"})),serialize:a=>{var y;return`${a.command}${Do((y=a.args[0])!=null?y:{number:10067,base:"hexadecimal"})}`},render:(a,y)=>{let b=y.evaluate(a.args[0]);return(!b||!("number"in b))&&(b={number:10067,base:"hexadecimal"}),a.value=String.fromCodePoint(b.number),a.createBox(y)}}),Rt("rule","[raise:value]{width:value}{thickness:value}",{createAtom:a=>new In(a),render:(a,y)=>{var b,E,ee;const re=new ya({parent:y,mathstyle:"textstyle"},a.style),ae=re.toEm((b=a.args[0])!=null?b:{dimension:0}),de=re.toEm((E=a.args[1])!=null?E:{dimension:10}),fe=re.toEm((ee=a.args[2])!=null?ee:{dimension:10}),ge=new sr(null,{classes:"rule",type:"ord"});return ge.width=de,ge.height=fe+ae,ge.depth=-ae,ge.setStyle("border-right-width",de,"em"),ge.setStyle("border-top-width",fe,"em"),ge.setStyle("border-color",a.style.color),ge.setStyle("vertical-align",ae,"em"),a.isSelected&&ge.setStyle("opacity","50%"),a.bind(re,ge),a.caret&&(ge.caret=a.caret),ge.wrap(y)},serialize:a=>`\\rule${a.args[0]?`[${Do(a.args[0])}]`:""}{${Do(a.args[1])}}{${Do(a.args[2])}}`}),Rt(["overline","underline"],"{:auto}",{createAtom:a=>new In(he(we({},a),{body:rt(a.args[0])})),render:(a,y)=>{const b=a.command.substring(1),E=new ya({parent:y,mathstyle:"cramp"},a.style),ee=In.createBox(E,a.body);if(!ee)return null;const re=E.metrics.defaultRuleThickness/E.scalingFactor,ae=new sr(null,{classes:b+"-line"});ae.height=re,ae.maxFontSize=re*1.125*E.scalingFactor;let de;return b==="overline"?de=new Ja({shift:0,children:[{box:ee},3*re,{box:ae},re]}):de=new Ja({top:ee.height,children:[re,{box:ae},3*re,{box:ee}]}),a.caret&&(de.caret=a.caret),new sr(de,{classes:b,type:"ignore"})}}),Rt("overset","{:auto}{base:auto}",{createAtom:a=>{const y=rt(a.args[1]);return new js(he(we({},a),{above:rt(a.args[0]),body:y,skipBoundary:!1,boxType:ru(y)}))},serialize:(a,y)=>uo(a.command,a.aboveToLatex(y),a.bodyToLatex(y))}),Rt("underset","{:auto}{base:auto}",{createAtom:a=>{const y=rt(a.args[1]);return new js(he(we({},a),{below:rt(a.args[0]),body:y,skipBoundary:!1,boxType:ru(y)}))},serialize:(a,y)=>uo(a.command,a.belowToLatex(y),a.bodyToLatex(y))}),Rt("overunderset","{above:auto}{below:auto}{base:auto}",{createAtom:a=>{const y=rt(a.args[2]);return new js(he(we({},a),{above:rt(a.args[0]),below:rt(a.args[1]),body:y,skipBoundary:!1,boxType:ru(y)}))},serialize:(a,y)=>uo(a.command,a.belowToLatex(y),a.bodyToLatex(y))}),Rt(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:a=>new js(he(we({},a),{body:rt(a.args[2]),above:rt(a.args[1]),below:rt(a.args[0]),skipBoundary:!1,boxType:a.command==="\\stackrel"?"rel":"bin"})),serialize:(a,y)=>uo(a.command,a.aboveToLatex(y),a.bodyToLatex(y))}),Rt("smash","[:string]{:auto}",{createAtom:a=>{var y,b,E,ee;return new wd(he(we({},a),{body:rt(a.args[1]),smashHeight:(b=(y=a.args[0])==null?void 0:y.includes("t"))!=null?b:!0,smashDepth:(ee=(E=a.args[0])==null?void 0:E.includes("b"))!=null?ee:!0}))}}),Rt(["vphantom"],"{:auto}",{createAtom:a=>new wd(he(we({},a),{body:rt(a.args[0]),isInvisible:!0,smashWidth:!0}))}),Rt(["hphantom"],"{:auto}",{createAtom:a=>new wd(he(we({},a),{body:rt(a.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))}),Rt(["phantom"],"{:auto}",{createAtom:a=>new wd(he(we({},a),{body:rt(a.args[0]),isInvisible:!0}))}),Rt("not","{:math}",{createAtom:a=>{const y=rt(a.args[0]);return y.length===0?new In(he(we({},a),{type:"mrel",value:"\uE020"})):new In(he(we({},a),{body:[new Ou(he(we({},a),{body:"\uE020",align:"right"})),...y],captureSelection:!0}))},serialize:(a,y)=>{const b=a.args[0],E=b&&typeof b=="object"&&"group"in b;return a.value!=="\uE020"?E?`\\not{${In.serialize(b.group,y)}}`:`\\not${In.serialize(b,y)}`:E?"\\not{}":"\\not"},render:(a,y)=>{if(a.value)return a.createBox(y);const E=a.args[0]&&typeof a.args[0]=="object"&&"group"in a.args[0]?"ord":ru(rt(a.args[0])),ee=In.createBox(y,a.body,{type:E});return a.caret&&(ee.caret=a.caret),a.bind(y,ee)}}),Rt(["ne","neq"],"",{createAtom:a=>new In(he(we({},a),{type:"mrel",body:[new Ou(he(we({},a),{body:"\uE020",align:"right",boxType:"rel"})),new In(he(we({},a),{value:"="}))],captureSelection:!0})),serialize:a=>a.command}),Rt("rlap","{:auto}",{createAtom:a=>new Ou(he(we({},a),{body:rt(a.args[0]),align:"right"}))}),Rt("llap","{:auto}",{createAtom:a=>new Ou(he(we({},a),{body:rt(a.args[0]),align:"left"}))}),Rt("mathrlap","{:math}",{createAtom:a=>new Ou(he(we({},a),{body:rt(a.args[0]),align:"left"}))}),Rt("mathllap","{:math}",{createAtom:a=>new Ou(he(we({},a),{body:rt(a.args[0]),align:"left"}))}),Rt("raisebox","{:value}{:text}",{createAtom:a=>{var y;return new _o(he(we({},a),{body:rt(a.args[1]),padding:{dimension:0},offset:(y=a.args[0])!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b;return uo("\\raisebox",(b=Do(a.offset))!=null?b:"0pt",a.bodyToLatex(y))}}),Rt("raise","{:value}{:auto}",{createAtom:a=>{var y;return new _o(he(we({},a),{body:rt(a.args[1]),padding:{dimension:0},offset:(y=a.args[0])!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b;return uo("\\raise",(b=Do(a.offset))!=null?b:"0pt",a.bodyToLatex(y))}}),Rt("lower","{:value}{:auto}",{createAtom:a=>{var y;return new _o(he(we({},a),{body:rt(a.args[1]),padding:{dimension:0},offset:(y=Us(a.args[0],-1))!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b,E;return uo("\\lower",(E=Do(Us((b=a.offset)!=null?b:{dimension:0},-1)))!=null?E:"0pt",a.bodyToLatex(y))}}),ze("0123456789/@.?!"),yt(65,90),yt(97,122),ze([["\\forall",8704],["\\exists",8707],["\\nexists",8708,"mord","ams"],["\\mid",8739,"mrel"],["\\top",8868],["\\bot",8869]]),ze([["\\#",35],["\\&",38],["\\parallelogram",9649],["\\spadesuit",9824],["\\heartsuit",9825],["\\diamondsuit",9826],["\\clubsuit",9827],["\\flat",9837],["\\natural",9838],["\\sharp",9839]]),ze([["\\backslash",92],["\\nabla",8711],["\\partial",8706],["\\ell",8467],["\\hbar",8463],["\\Q",81,"mord","double-struck"],["\\C",67,"mord","double-struck"],["\\P",80,"mord","double-struck"],["\\pounds",163],["\\euro",8364]]),ze([["\\rightarrow",8594],["\\to",8594],["\\leftarrow",8592],["\\gets",8592],["\\Rightarrow",8658],["\\Leftarrow",8656],["\\longrightarrow",10230],["\\longleftarrow",10229],["\\Longrightarrow",10233],["\\implies",10233],["\\Longleftarrow",10232],["\\impliedby",10232],["\\longleftrightarrow",10231],["\\biconditional",10231],["\\Longleftrightarrow",10234],["\\mapsto",8614],["\\longmapsto",10236],["\\uparrow",8593],["\\downarrow",8595],["\\Uparrow",8657],["\\Downarrow",8659],["\\updownarrow",8597],["\\Updownarrow",8661],["\\hookrightarrow",8618],["\\hookleftarrow",8617],["\\rightharpoonup",8640],["\\leftharpoonup",8636],["\\rightharpoondown",8641],["\\leftharpoondown",8637],["\\searrow",8600],["\\nearrow",8599],["\\swarrow",8601],["\\nwarrow",8598],["\\originalof",8886],["\\laplace",8886],["\\imageof",8887],["\\Laplace",8887]],"mrel"),ze([["\\mapsfrom",8612,"mrel"],["\\Mapsfrom",10502,"mrel"],["\\MapsTo",10503,"mrel"],["\\Yup",8516,"mord"],["\\lightning",8623,"mrel"],["\\leftarrowtriangle",8701,"mrel"],["\\rightarrowtriangle",8702,"mrel"],["\\leftrightarrowtriangle",8703,"mrel"],["\\boxdot",8865,"mbin"],["\\bigtriangleup",9651,"mbin"],["\\bigtriangledown",9661,"mbin"],["\\boxbar",9707,"mbin"],["\\Lbag",10181,"mopen"],["\\Rbag",10182,"mclose"],["\\llbracket",10214,"mopen"],["\\rrbracket",10215,"mclose"],["\\longmapsfrom",10235,"mrel"],["\\Longmapsfrom",10237,"mrel"],["\\Longmapsto",10238,"mrel"],["\\boxslash",10692,"mbin"],["\\boxbslash",10693,"mbin"],["\\boxast",10694,"mbin"],["\\boxcircle",10695,"mbin"],["\\boxbox",10696,"mbin"],["\\fatsemi",10783,"mop"],["\\leftslice",10918,"mrel"],["\\rightslice",10919,"mrel"],["\\interleave",10996,"mbin"],["\\biginterleave",11004,"mop"],["\\sslash",11005,"mbin"],["\\talloblong",11006,"mbin"]]),ze([["\\lbrace",123,"mopen"],["\\rbrace",125,"mclose"],["\\lparen",40,"mopen"],["\\rparen",41,"mclose"],["\\langle",10216,"mopen"],["\\rangle",10217,"mclose"],["\\lfloor",8970,"mopen"],["\\rfloor",8971,"mclose"],["\\lceil",8968,"mopen"],["\\rceil",8969,"mclose"],["\\vert",8739],["\\lvert",8739,"mopen"],["\\rvert",8739,"mclose"],["\\|",8741],["\\Vert",8741],["\\mVert",8741],["\\lVert",8741,"mopen"],["\\rVert",8741,"mclose"],["\\lbrack",91,"mopen"],["\\rbrack",93,"mclose"],["\\{",123,"mopen"],["\\}",125,"mclose"],["(",40,"mopen"],[")",41,"mclose"],["[",91,"mopen"],["]",93,"mclose"],["\\ulcorner",9484,"mopen","ams"],["\\urcorner",9488,"mclose","ams"],["\\llcorner",9492,"mopen","ams"],["\\lrcorner",9496,"mclose","ams"],["\\lgroup",10222,"mopen"],["\\rgroup",10223,"mclose"],["\\lmoustache",9136,"mopen"],["\\rmoustache",9137,"mclose"]]),ze([["\\dashrightarrow",8674],["\\dashleftarrow",8672],["\\Rrightarrow",8667],["\\Lleftarrow",8666],["\\leftrightarrows",8646],["\\rightleftarrows",8644],["\\curvearrowright",8631],["\\curvearrowleft",8630],["\\rightrightarrows",8649],["\\leftleftarrows",8647],["\\upuparrows",8648],["\\downdownarrows",8650],["\\vartriangle",9651],["\\triangleq",8796],["\\vartriangleleft",8882],["\\trianglelefteq",8884],["\\ntriangleleft",8938],["\\ntrianglelefteq",8940],["\\vartriangleright",8883],["\\trianglerighteq",8885],["\\ntriangleright",8939],["\\ntrianglerighteq",8941],["\\blacktriangleleft",9664],["\\blacktriangleright",9654],["\\leftarrowtail",8610],["\\rightarrowtail",8611],["\\looparrowright",8620],["\\looparrowleft",8619],["\\twoheadleftarrow",8606],["\\twoheadrightarrow",8608],["\\twoheadrightarrowtail",10518],["\\rightleftharpoons",8652],["\\leftrightharpoons",8651],["\\Rsh",8625],["\\Lsh",8624],["\\circlearrowright",8635],["\\circlearrowleft",8634],["\\restriction",8638],["\\upharpoonright",8638],["\\upharpoonleft",8639],["\\downharpoonright",8642],["\\downharpoonleft",8643],["\\rightsquigarrow",8669],["\\leadsto",8669],["\\leftrightsquigarrow",8621],["\\multimap",8888],["\\nleftarrow",8602],["\\nrightarrow",8603],["\\nRightarrow",8655],["\\nLeftarrow",8653],["\\nleftrightarrow",8622],["\\nLeftrightarrow",8654],["\\nvrightarrow",8696],["\\nvtwoheadrightarrow",10496],["\\nvrightarrowtail",10516],["\\nvtwoheadrightarrowtail",10519],["\\shortparallel",8741],["\\nless",8814],["\\nleqslant",57360],["\\lneq",10887],["\\lneqq",8808],["\\nleqq",57361],["\\lvertneqq",57356],["\\lnsim",8934],["\\lnapprox",10889],["\\nprec",8832],["\\npreceq",8928],["\\precnsim",8936],["\\precnapprox",10937],["\\nsim",8769],["\\nshortmid",57350],["\\nmid",8740],["\\nvdash",8876],["\\nvDash",8877],["\\ngtr",8815],["\\ngeqslant",57359],["\\ngeqq",57358],["\\gneq",10888],["\\gneqq",8809],["\\gvertneqq",57357],["\\gnsim",8935],["\\gnapprox",10890],["\\nsucc",8833],["\\nsucceq",8929],["\\succnsim",8937],["\\succnapprox",10938],["\\ncong",8774],["\\nshortparallel",57351],["\\nparallel",8742],["\\nVDash",8879],["\\nsupseteqq",57368],["\\supsetneq",8843],["\\varsupsetneq",57371],["\\supsetneqq",10956],["\\varsupsetneqq",57369],["\\nVdash",8878],["\\precneqq",10933],["\\succneqq",10934],["\\nsubseteqq",57366],["\\leqslant",10877],["\\geqslant",10878],["\\gtrsim",8819],["\\approxeq",8778],["\\thickapprox",8776],["\\lessapprox",10885],["\\gtrapprox",10886],["\\precapprox",10935],["\\succapprox",10936],["\\thicksim",8764],["\\succsim",8831],["\\precsim",8830],["\\backsim",8765],["\\eqsim",8770],["\\backsimeq",8909],["\\lesssim",8818],["\\nleq",8816],["\\ngeq",8817],["\\smallsmile",8995],["\\smallfrown",8994],["\\leqq",8806],["\\eqslantless",10901],["\\lll",8920],["\\lessgtr",8822],["\\lesseqgtr",8922],["\\lesseqqgtr",10891],["\\risingdotseq",8787],["\\fallingdotseq",8786],["\\subseteqq",10949],["\\Subset",8912],["\\sqsubset",8847],["\\preccurlyeq",8828],["\\curlyeqprec",8926],["\\vDash",8872],["\\Vvdash",8874],["\\bumpeq",8783],["\\Bumpeq",8782],["\\geqq",8807],["\\eqslantgtr",10902],["\\ggg",8921],["\\gtrless",8823],["\\gtreqless",8923],["\\gtreqqless",10892],["\\supseteqq",10950],["\\Supset",8913],["\\sqsupset",8848],["\\succcurlyeq",8829],["\\curlyeqsucc",8927],["\\Vdash",8873],["\\shortmid",8739],["\\between",8812],["\\pitchfork",8916],["\\varpropto",8733],["\\backepsilon",8717],["\\llless",8920],["\\gggtr",8921],["\\doteqdot",8785],["\\Doteq",8785],["\\eqcirc",8790],["\\circeq",8791],["\\therefore",8756],["\\because",8757]],"mrel","ams"),ze([["+",43],["-",8722],["\u2212",8722],["\\pm",177],["\\mp",8723],["*",8727],["\\times",215],["\\div",247],["\\divides",8739],["\\cdot",8901],["\\cap",8745],["\\cup",8746],["\\setminus",8726],["\\land",8743],["\\wedge",8743],["\\lor",8744],["\\vee",8744],["\\circ",8728],["\\bigcirc",9711],["\\bullet",8729],["\\oplus",8853],["\\ominus",8854],["\\otimes",8855],["\\odot",8857],["\\oslash",8856],["\\bigtriangleup",9651],["\\bigtriangledown",9661],["\\triangleleft",9667],["\\triangleright",9657],["\\And",38],["\\dagger",8224],["\\dag",8224],["\\ddag",8225],["\\ddagger",8225],["\\ast",8727],["\\star",8902],["\\bigstar",9733],["\\diamond",8900]],"mbin"),ze([["\\lhd",8882],["\\rhd",8883],["\\lessdot",8918],["\\gtrdot",8919],["\\ltimes",8905],["\\rtimes",8906],["\\leftthreetimes",8907],["\\rightthreetimes",8908],["\\intercal",8890],["\\dotplus",8724],["\\doublebarwedge",10846],["\\divideontimes",8903],["\\centerdot",8901],["\\smallsetminus",8726],["\\barwedge",8892],["\\veebar",8891],["\\nor",8891],["\\curlywedge",8911],["\\curlyvee",8910],["\\boxminus",8863],["\\boxplus",8862],["\\boxtimes",8864],["\\boxdot",8865],["\\circleddash",8861],["\\circledast",8859],["\\circledcirc",8858],["\\unlhd",8884],["\\unrhd",8885]],"mbin","ams"),ze([["\\surd",8730],["\\infty",8734],["\\prime",8242],["\\doubleprime",8243],["\\angle",8736],["`",8216],["\\$",36],["\\%",37],["\\_",95],["\\alpha",945],["\\beta",946],["\\gamma",947],["\\delta",948],["\\epsilon",1013],["\\varepsilon",949],["\\zeta",950],["\\eta",951],["\\theta",952],["\\vartheta",977],["\\iota",953],["\\kappa",954],["\\varkappa",1008,"mord","ams"],["\\lambda",955],["\\mu",956],["\\nu",957],["\\xi",958],["\\omicron",111],["\\pi",960],["\\varpi",982],["\\rho",961],["\\varrho",1009],["\\sigma",963],["\\varsigma",962],["\\tau",964],["\\phi",981],["\\varphi",966],["\\upsilon",965],["\\chi",967],["\\psi",968],["\\omega",969],["\\Gamma",915],["\\Delta",916],["\\Theta",920],["\\Lambda",923],["\\Xi",926],["\\Pi",928],["\\Sigma",931],["\\Upsilon",933],["\\Phi",934],["\\Psi",936],["\\Omega",937],["\\digamma",989,"mord","ams"],["\\emptyset",8709]]),ze([["=",61],["<",60],["\\lt",60],[">",62],["\\gt",62],["\\le",8804],["\\leq",8804],["\\ge",8805],["\\geq",8805],["\\ll",8810],["\\gg",8811],["\\coloneq",8788],["\\coloneqq",8788],["\\colonequals",8788],["\\measeq",8797],["\\eqdef",8798],["\\questeq",8799],[":",58],["\\cong",8773],["\\equiv",8801],["\\prec",8826],["\\preceq",10927],["\\succ",8827],["\\succeq",10928],["\\perp",8869],["\\propto",8733],["\\Colon",8759],["\\smile",8995],["\\frown",8994],["\\sim",8764],["\\doteq",8784],["\\bowtie",8904],["\\Join",8904],["\\asymp",8781],["\\sqsubseteq",8849],["\\sqsupseteq",8850],["\\approx",8776],["\\~",126],["\\leftrightarrow",8596],["\\Leftrightarrow",8660],["\\models",8872],["\\vdash",8866],["\\dashv",8867],["\\roundimplies",10608],["\\in",8712],["\\notin",8713],["\\ni",8715],["\\owns",8715],["\\subset",8834],["\\supset",8835],["\\subseteq",8838],["\\supseteq",8839],["\\differencedelta",8710],["\\mvert",8739],["\\parallel",8741],["\\simeq",8771]],"mrel"),ze([["\\lnot",172],["\\neg",172],["\\triangle",9651],["\\subsetneq",8842],["\\varsubsetneq",57370],["\\subsetneqq",10955],["\\varsubsetneqq",57367],["\\nsubset",8836],["\\nsupset",8837],["\\nsubseteq",8840],["\\nsupseteq",8841]],"mrel","ams"),ze([["\\wp",8472],["\\aleph",8501]]),ze([["\\blacktriangle",9650],["\\hslash",8463],["\\Finv",8498],["\\Game",8513],["\\eth",240],["\\mho",8487],["\\Bbbk",107],["\\yen",165],["\\square",9633],["\\Box",9633],["\\blacksquare",9632],["\\circledS",9416],["\\circledR",174],["\\triangledown",9661],["\\blacktriangledown",9660],["\\checkmark",10003],["\\diagup",9585],["\\measuredangle",8737],["\\sphericalangle",8738],["\\backprime",8245],["\\backdoubleprime",8246],["\\Diamond",9674],["\\lozenge",9674],["\\blacklozenge",10731],["\\varnothing",8709],["\\complement",8705],["\\maltese",10016],["\\beth",8502],["\\daleth",8504],["\\gimel",8503]],"mord","ams"),ze([["\\ ",160],["~",160]],"space"),Rt(["!",",",":",";",">","enskip","enspace","quad","qquad"],"",{createAtom:a=>new Sd(a)}),Rt("space","",{createAtom:a=>new Sd(a)}),ze([["\\colon",58],["\\cdotp",8901],["\\vdots",8942,"mord"],["\\ldotp",46],[",",44],[";",59]],"mpunct"),ze([["\\cdots",8943],["\\ddots",8945],["\\ldots",8230],["\\mathellipsis",8230]],"minner"),ze([["\\/",47],["|",8739,"mord"],["\\imath",305],["\\jmath",567],["\\degree",176],["'",8242],['"',8221]]);var lp="<mo>&#x2061;</mo>",Xf="<mo>&#8290;</mo>";function qf(a){return a.replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function to(a,y){return!a||!y.generateID?"":` extid="${a}"`}function Mv(a,y,b){var E,ee,re,ae,de,fe,ge,xe,Be,Ve,ot;let gt=!1;y=y!=null?y:a.atoms.length;let ln="",ar="",rn=a.atoms[a.index];const Vn=(ee=(E=rn.style)==null?void 0:E.variant)!=null?ee:"",lr=(ae=(re=rn.style)==null?void 0:re.variantStyle)!=null?ae:"";let jn="";if(Vn||lr){const ai=gn(rn.value,(de=rn.style)==null?void 0:de.variant,(fe=rn.style)==null?void 0:fe.variantStyle);if(ai!==rn.value)return a.index+=1,ln=`<mi${to(rn.id,b)}>${ai}</mi>`,Ul(ln,a,b)||(a.mathML+=ln,a.lastType="mi"),!0;jn=(ge={upnormal:"normal",boldnormal:"bold",italicmain:"italic",bolditalicmain:"bold-italic","updouble-struck":"double-struck","double-struck":"double-struck",boldfraktur:"bold-fraktur",calligraphic:"script",upcalligraphic:"script",script:"script",boldscript:"bold-script",boldcalligraphic:"bold-script",fraktur:"fraktur","upsans-serif":"sans-serif","boldsans-serif":"bold-sans-serif","italicsans-serif":"sans-serif-italic","bolditalicsans-serif":"sans-serif-bold-italic",monospace:"monospace"}[lr+Vn])!=null?ge:"",jn=` mathvariant="${jn}"`}const Kr={"\\exponentialE":"&#x02147;","\\imaginaryI":"&#x2148;","\\differentialD":"&#x2146;","\\capitalDifferentialD":"&#x2145;","\\alpha":"&#x03b1;","\\pi":"&#x03c0;","\\infty":"&#x221e;","\\forall":"&#x2200;","\\nexists":"&#x2204;","\\exists":"&#x2203;","\\hbar":"\u210F","\\cdotp":"\u22C5","\\ldots":"\u2026","\\cdots":"\u22EF","\\ddots":"\u22F1","\\vdots":"\u22EE","\\ldotp":"."};if(rn.command==="!")return a.index+=1,ln="<mo>!</mo>",Ul(ln,a,b)||(a.mathML+=ln,a.lastType="mo"),!0;if(Kr[rn.command]){a.index+=1;let ai=`<mi${to(rn.id,b)}${jn}>${Kr[rn.command]}</mi>`;return(a.lastType==="mi"||a.lastType==="mn"||a.lastType==="mtext"||a.lastType==="fence")&&(ai=Xf+ai),Ul(ai,a,b)||(a.mathML+=ai,a.lastType="mi"),!0}if(rn.command==="\\operatorname")ar=Nc(rn.body),a.index+=1;else if(Vn||lr)for(;a.index<y&&(rn.type==="mord"||rn.type==="macro")&&!rn.isDigit()&&Vn===((Be=(xe=rn.style)==null?void 0:xe.variant)!=null?Be:"")&&lr===((ot=(Ve=rn.style)==null?void 0:Ve.variantStyle)!=null?ot:"");)ar+=Nc([rn]),a.index+=1,rn=a.atoms[a.index];else(rn.type==="mord"||rn.type==="macro")&&!rn.isDigit()&&(ar+=Nc([rn]),a.index+=1);if(ar.length>0){gt=!0,ln=`<mi${jn}>${ar}</mi>`;const ai=a.lastType;ln.endsWith(">f</mi>")||ln.endsWith(">g</mi>")?(ln+=lp,a.lastType="applyfunction"):a.lastType=/^<mo>(.*)<\/mo>$/.test(ln)?"mo":"mi",Ul(ln,a,b)||((ai==="mi"||ai==="mn"||ai==="mtext"||ai==="fence")&&(ln=Xf+ln),a.mathML+=ln)}return gt}function Ev(a){return a.index<a.atoms.length&&a.atoms[a.index].superscript&&a.atoms[a.index].type==="subsup"}function _v(a){let y=-1,b=a.index,E=!1,ee=!1;for(;b<a.atoms.length&&!E&&!ee;){const re=a.atoms[b];E=!re.isDigit(),ee=!E&&re.superscript!==void 0,b++}return ee&&(y=b-1),y}function Ul(a,y,b){var E;let ee=y.atoms[y.index-1];if(!ee)return!1;if(!ee.superscript&&!ee.subscript)if(((E=y.atoms[y.index])==null?void 0:E.type)==="subsup")ee=y.atoms[y.index],y.index+=1;else return!1;const re=y.lastType;y.lastType="";const ae=Ka(ee.superscript,b);y.lastType="";const de=Ka(ee.subscript,b);if(y.lastType=re,!ae&&!de)return!1;let fe="";return ae&&de?fe=`<msubsup>${a}${de}${ae}</msubsup>`:ae?fe=`<msup>${a}${ae}</msup>`:de&&(fe=`<msub>${a}${de}</msub>`),y.mathML+=fe,y.lastType="",!0}function kv(a,y,b){y=y!=null?y:a.atoms.length;const E=a.index;let ee="";for(;a.index<y&&a.atoms[a.index].mode==="text";)ee+=a.atoms[a.index].value?a.atoms[a.index].value:" ",a.index+=1;return ee.length>0?(a.mathML+=`<mtext ${to(a.atoms[E].id,b)}>${ee}</mtext>`,a.lastType="mtext",!0):!1}function Lv(a,y,b){y=y!=null?y:a.atoms.length;const E=a.index;let ee="",re=_v(a);for(re>=0&&re<y&&(y=re);a.index<y&&a.atoms[a.index].isDigit();)ee+=a.atoms[a.index].asDigit(),a.index+=1;return ee.length<=0?!1:(ee="<mn"+to(a.atoms[E].id,b)+">"+ee+"</mn>",re<0&&Ev(a)&&(re=a.index,a.index+=1),Ul(ee,a,b)||(a.mathML+=ee,a.lastType="mn"),!0)}function Av(a,y,b){let E=!1;y=y!=null?y:a.atoms.length;let ee="",re="";if(a.index<y&&a.atoms[a.index].type==="mopen"){let ae=!1,de=0;const fe=a.index;let ge=-1,xe=fe+1;for(;xe<y&&!ae;)a.atoms[xe].type==="mopen"?de+=1:a.atoms[xe].type==="mclose"&&(de-=1),de===-1&&(ae=!0,ge=xe),xe+=1;ae&&(ee="<mrow>",ee+=Zu(a.atoms[fe],b),ee+=Ka(a.atoms,b,fe+1,ge),ee+=Zu(a.atoms[ge],b),ee+="</mrow>",a.index=ge+1,(a.lastType==="mi"||a.lastType==="mn"||a.lastType==="mfrac"||a.lastType==="fence")&&(a.mathML+=Xf),Ul(ee,a,b)&&(E=!0,a.lastType="",ee=""),re="fence")}return ee.length>0&&(E=!0,a.mathML+=ee,a.lastType=re),E}function Tv(a,y,b){let E=!1;y=y!=null?y:a.atoms.length;let ee="",re="";const ae=a.atoms[a.index];if(!ae)return!1;const de={"\\ne":"&ne;","\\neq":"&neq;","\\pm":"&#177;","\\times":"&#215;","\\colon":":","\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lbrack":"[","\\rbrack":"]","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"};if(de[ae.command]){a.index+=1;const fe=`<mo${to(ae.id,b)}>${de[ae.command]}</mo>`;return Ul(fe,a,b)||(a.mathML+=fe,a.lastType="mo"),!0}if(a.index<y&&(ae.type==="mbin"||ae.type==="mrel"))ee+=Wh(a.atoms[a.index],b),a.index+=1,re="mo";else if(a.index<y&&(ae.type==="mop"||ae.type==="operator"||ae.type==="extensible-symbol")){if(ae.subsupPlacement==="over-under"&&(ae.superscript||ae.subscript)){const fe=Zu(ae,b);return ae.superscript&&ae.subscript?(ee+="<munderover>"+fe,ee+=Ka(ae.subscript,b),ee+=Ka(ae.superscript,b),ee+="</munderover>"):ae.superscript?(ee+="<mover>"+fe,ee+=Ka(ae.superscript,b),ee+="</mover>"):ae.subscript&&(ee+="<munder>"+fe,ee+=Ka(ae.subscript,b),ee+="</munder>"),a.mathML+=ee,a.lastType="mo",a.index+=1,!0}{const fe=a.atoms[a.index],ge=fe.value==="\\operatorname",xe=ge?'<mi class="MathML-Unit"'+to(fe.id,b)+">"+Nc(fe.value)+"</mi>":Zu(fe,b);ee+=xe,!ge&&!/^<mo>(.*)<\/mo>$/.test(xe)?(ee+=lp,re="applyfunction"):re=ge?"mi":"mo"}(a.lastType==="mi"||a.lastType==="mn")&&!/^<mo>(.*)<\/mo>$/.test(ee)&&(ee=Xf+ee),a.index+=1}return ee.length>0&&(E=!0,Ul(ee,a,b)||(a.mathML+=ee,a.lastType=re)),E}function Ka(a,y,b,E){y!=null||(y={});const ee={atoms:[],index:b!=null?b:0,mathML:"",lastType:""};if(typeof a=="number"||typeof a=="boolean")ee.mathML=a.toString();else if(typeof a=="string")ee.mathML=a;else if(a instanceof In)ee.mathML=Wh(a,y);else if(Array.isArray(a)){ee.atoms=a;let re=0;for(E=E||(a?a.length:0);ee.index<E;)if(kv(ee,E,y)||Lv(ee,E,y)||Mv(ee,E,y)||Tv(ee,E,y)||Av(ee,E,y))re+=1;else if(ee.index<E){let ae=Wh(ee.atoms[ee.index],y);ee.lastType==="mn"&&ae.length>0&&ee.atoms[ee.index].type==="genfrac"&&(ae="<mo>&#x2064;</mo>"+ae),ee.atoms[ee.index].type==="genfrac"?ee.lastType="mfrac":ee.lastType="",ee.index+=1,Ul(ae,ee,y)?re+=1:ae.length>0&&(ee.mathML+=ae,re+=1)}re>1&&(ee.mathML="<mrow>"+ee.mathML+"</mrow>")}return ee.mathML}function Zu(a,y){let b="";const E=Nc(a.value);return E&&(b="<mo"+to(a.id,y)+">"+E+"</mo>"),b}function Nc(a){if(!a)return"";if(typeof a=="string")return qf(a);if(!Array.isArray(a)&&typeof a.body=="string")return qf(a.body);let y="";for(const b of a)typeof b.value=="string"&&(y+=b.value);return qf(y)}function Wh(a,y){var b,E,ee,re,ae,de,fe,ge,xe,Be,Ve,ot,gt,ln,ar,rn,Vn,lr,jn,Kr,ai,jr;if(a.mode==="text")return`<mi${to(a.id,y)}>${a.value}</mi>`;const _a={widehat:"^",widecheck:"\u02C7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",longleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",longrightarrow:"\u2192",underbrace:"\u23DF",overbrace:"\u23DE",overgroup:"\u23E0",undergroup:"\u23E1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21D2",xRightarrow:"\u21D2",overleftharpoon:"\u21BC",xleftharpoonup:"\u21BC",overrightharpoon:"\u21C0",xrightharpoonup:"\u21C0",xLeftarrow:"\u21D0",xLeftrightarrow:"\u21D4",xhookleftarrow:"\u21A9",xhookrightarrow:"\u21AA",xmapsto:"\u21A6",xrightharpoondown:"\u21C1",xleftharpoondown:"\u21BD",xrightleftharpoons:"\u21CC",longrightleftharpoons:"\u21CC",xleftrightharpoons:"\u21CB",xtwoheadleftarrow:"\u219E",xtwoheadrightarrow:"\u21A0",xlongequal:"=",xtofrom:"\u21C4",xleftrightarrows:"\u21C4",xRightleftharpoons:"\u21CC",longRightleftharpoons:"\u21CC",xLeftrightharpoons:"\u21CB",longLeftrightharpoons:"\u21CB"},qa={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\>":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let br="",$s="",kl,Xs,Yo,zs,Ms,no;const{command:Lo}=a;if(a.command==="\\error")return`<merror${to(a.id,y)}>${Ka(a.body,y)}</merror>`;const Jo={"\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\lbrack":"[","\\rbrack":"]","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"},Ll={"\\vec":"&#x20d7;","\\acute":"&#x00b4;","\\grave":"&#x0060;","\\dot":"&#x02d9;","\\ddot":"&#x00a8;","\\tilde":"&#x007e;","\\bar":"&#x00af;","\\breve":"&#x02d8;","\\check":"&#x02c7;","\\hat":"&#x005e;"};switch(a.type){case"first":break;case"group":case"root":br=Ka(a.body,y);break;case"array":if((a.leftDelim&&a.leftDelim!=="."||a.rightDelim&&a.rightDelim!==".")&&(br+="<mrow>",a.leftDelim&&a.leftDelim!=="."&&(br+="<mo>"+(Jo[a.leftDelim]||a.leftDelim)+"</mo>")),br+="<mtable",a.colFormat){for(br+=' columnalign="',Yo=0;Yo<a.colFormat.length;Yo++)a.colFormat[Yo].align&&(br+={l:"left",c:"center",r:"right"}[a.colFormat[Yo].align]+" ");br+='"'}for(br+=">",Xs=0;Xs<a.array.length;Xs++){for(br+="<mtr>",kl=0;kl<a.array[Xs].length;kl++)br+="<mtd>"+Ka(a.array[Xs][kl],y)+"</mtd>";br+="</mtr>"}br+="</mtable>",(a.leftDelim&&a.leftDelim!=="."||a.rightDelim&&a.rightDelim!==".")&&(a.rightDelim&&a.rightDelim!=="."&&(br+="<mo>"+(Jo[a.leftDelim]||a.rightDelim)+"</mo>"),br+="</mrow>");break;case"genfrac":(a.leftDelim||a.rightDelim)&&(br+="<mrow>"),a.leftDelim&&a.leftDelim!=="."&&(br+="<mo"+to(a.id,y)+">"+(Jo[a.leftDelim]||a.leftDelim)+"</mo>"),a.hasBarLine?(br+="<mfrac>",br+=Ka(a.above,y)||"<mi>&nbsp;</mi>",br+=Ka(a.below,y)||"<mi>&nbsp;</mi>",br+="</mfrac>"):(br+="<mtable"+to(a.id,y)+">",br+="<mtr>"+Ka(a.above,y)+"</mtr>",br+="<mtr>"+Ka(a.below,y)+"</mtr>",br+="</mtable>"),a.rightDelim&&a.rightDelim!=="."&&(br+="<mo"+to(a.id,y)+">"+(Jo[a.rightDelim]||a.rightDelim)+"</mo>"),(a.leftDelim||a.rightDelim)&&(br+="</mrow>");break;case"surd":a.hasEmptyBranch("above")?(br+="<msqrt"+to(a.id,y)+">",br+=Ka(a.body,y),br+="</msqrt>"):(br+="<mroot"+to(a.id,y)+">",br+=Ka(a.body,y),br+=Ka(a.above,y),br+="</mroot>");break;case"leftright":const Al=a,Tl=Al.leftDelim;br="<mrow>",Tl&&Tl!=="."&&(br+=`<mo${to(a.id,y)}>${(b=Jo[Tl])!=null?b:Tl}</mo>`),a.body&&(br+=Ka(a.body,y));const Dl=Al.matchingRightDelim();Dl&&Dl!=="."&&(br+=`<mo${to(a.id,y)}>${(E=Jo[Dl])!=null?E:Dl}</mo>`),br+="</mrow>";break;case"sizeddelim":case"delim":br+=`<mo${to(a.id,y)}>${Jo[a.value]||a.value}</mo>`;break;case"accent":br+='<mover accent="true"'+to(a.id,y)+">",br+=Ka(a.body,y),br+="<mo>"+(Ll[Lo]||a.accent)+"</mo>",br+="</mover>";break;case"line":case"overlap":break;case"overunder":Ms=a.above,zs=a.below,(a.svgAbove||Ms)&&(a.svgBelow||zs)?no=a.body:Ms&&Ms.length>0?(no=a.body,(re=(ee=a.body)==null?void 0:ee[0])!=null&&re.below?(zs=a.body[0].below,no=a.body[0].body):((de=(ae=a.body)==null?void 0:ae[0])==null?void 0:de.type)==="first"&&((ge=(fe=a.body)==null?void 0:fe[1])!=null&&ge.below)&&(zs=a.body[1].below,no=a.body[1].body)):zs&&zs.length>0&&(no=a.body,(Be=(xe=a.body)==null?void 0:xe[0])!=null&&Be.above?(Ms=a.body[0].above,no=a.body[0].body):((ot=(Ve=a.body)==null?void 0:Ve[0])==null?void 0:ot.type)==="first"&&((ln=(gt=a.body)==null?void 0:gt[1])!=null&&ln.above)&&(Ms=a.body[1].overscript,no=a.body[1].body)),(a.svgAbove||Ms)&&(a.svgBelow||zs)?(br+=`<munderover ${to(a.id,y)}>`,br+=(ar=_a[a.svgBody])!=null?ar:Ka(no,y),br+=(rn=_a[a.svgBelow])!=null?rn:Ka(zs,y),br+=(Vn=_a[a.svgAbove])!=null?Vn:Ka(Ms,y),br+="</munderover>"):a.svgAbove||Ms?(br+=`<mover ${to(a.id,y)}>`+((lr=_a[a.svgBody])!=null?lr:Ka(no,y)),br+=(jn=_a[a.svgAbove])!=null?jn:Ka(Ms,y),br+="</mover>"):(a.svgBelow||zs)&&(br+=`<munder ${to(a.id,y)}>`+((Kr=_a[a.svgBody])!=null?Kr:Ka(no,y)),br+=(ai=_a[a.svgBelow])!=null?ai:Ka(zs,y),br+="</munder>");break;case"placeholder":br+="?";break;case"mord":{br=typeof a.value=="string"?a.value:Lo,Lo==="\\char"?br="&#x"+("000000"+a.args[0].number.toString(16)).slice(-4)+";":br.length>0&&br.startsWith("\\")&&(typeof a.value=="string"&&a.value.charCodeAt(0)>255?br="&#x"+("000000"+a.value.charCodeAt(0).toString(16)).slice(-4)+";":typeof a.value=="string"?br=a.value.charAt(0):(console.error("Did not expect this"),br=""));const ul=/\d/.test(br)?"mn":"mi";br=`<${ul}${to(a.id,y)}>${qf(br)}</${ul}>`;break}case"mbin":case"mrel":case"minner":br=Zu(a,y);break;case"mpunct":br='<mo separator="true"'+to(a.id,y)+">"+Lo+"</mo>";break;case"mop":case"operator":case"extensible-symbol":a.body!=="\u200B"&&(br="<mo"+to(a.id,y)+">",br+=Lo==="\\operatorname"?a.body:Lo||a.body,br+="</mo>");break;case"box":br='<menclose notation="box"',a.backgroundcolor&&(br+=' mathbackground="'+a.backgroundcolor+'"'),br+=to(a.id,y)+">"+Ka(a.body,y)+"</menclose>";break;case"spacing":br+='<mspace width="'+((jr=qa[Lo])!=null?jr:0)+'em"/>';break;case"enclose":br='<menclose notation="';for(const ul in a.notation)Object.prototype.hasOwnProperty.call(a.notation,ul)&&a.notation[ul]&&(br+=$s+ul,$s=" ");br+=to(a.id,y)+'">'+Ka(a.body,y)+"</menclose>";break;case"prompt":br='<menclose notation="roundexbox""">'+Ka(a.body,y)+"</menclose>";break;case"space":br+="&nbsp;";break;case"subsup":break;case"phantom":break;case"composition":break;case"rule":break;case"chem":break;case"mopen":br+=Zu(a,y);break;case"mclose":br+=Zu(a,y);break;case"macro":{const ul=a.command+Nc(a.macroArgs);ul&&(br+=`<mo ${to(a.id,y)}>${ul}</mo>`)}break;case"latexgroup":br+=Ka(a.body,y);break;case"latex":br+="<mtext"+to(a.id,y)+">"+a.value+"</mtext>";break;case"tooltip":br+=Ka(a.body,y);break;case"text":br+=`<mtext ${to(a.id,y)}x>${a.value}</mtext>`;break;default:if(a.command==="\\displaystyle")return`<mrow ${to(a.id,y)} displaystyle="true">${Ka(a.body,y)}</mrow>`;if(a.command==="\\textstyle")return`<mrow ${to(a.id,y)} displaystyle="false">${Ka(a.body,y)}</mrow>`;console.info("Unexpected element in conversion to MathML:",a)}return br}var Fc={"\\alpha":"alpha ","\\mu":"mew ","\\sigma":"sigma ","\\pi":"pie ","\\imaginaryI":"imaginary eye ","\\imaginaryJ":"imaginary jay ","\\sum":"Summation ","\\prod":"Product ","+":"plus ","-":"minus ",";":'<break time="150ms"/> semi-colon <break time="150ms"/>',",":'<break time="150ms"/> comma <break time="150ms"/>',"|":'<break time="150ms"/>Vertical bar<break time="150ms"/>',"(":'<break time="150ms"/>Open paren. <break time="150ms"/>',")":'<break time="150ms"/> Close paren. <break time="150ms"/>',"=":"equals ","<":"is less than ","\\lt":"is less than ","<=":"is less than or equal to ","\\le":"is less than or equal to ","\\gt":"is greater than ",">":"is greater than ","\\pm":"plus or minus","\\mp":"minus or plus","\\ge":"is greater than or equal to ","\\geq":"is greater than or equal to ","\\leq":"is less than or equal to ","\\ne":"is not equal to ","\\neq":"is not equal to ","!":"factorial ","\\sin":"sine ","\\cos":"cosine ","\u200B":"","\u2212":"minus ",":":'<break time="150ms"/> such that <break time="200ms"/> ',"\\colon":'<break time="150ms"/> such that <break time="200ms"/> ',"\\hbar":"etch bar ","\\iff":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\Longleftrightarrow":'<break time="200ms"/>if, and only if, <break time="200ms"/>',"\\land":"and ","\\lor":"or ","\\neg":"not ","\\div":"divided by ","\\forall":"for all ","\\exists":"there exists ","\\nexists":"there does not exists ","\\in":"element of ","\\N":'the set <break time="150ms"/><say-as interpret-as="character">n</say-as>',"\\C":'the set <break time="150ms"/><say-as interpret-as="character">c</say-as>',"\\Z":'the set <break time="150ms"/><say-as interpret-as="character">z</say-as>',"\\Q":'the set <break time="150ms"/><say-as interpret-as="character">q</say-as>',"\\infty":"infinity ","\\nabla":"nabla ","\\partial":"partial derivative of ","\\cdot":"times ","\\cdots":"dot dot dot ","\\Rightarrow":"implies ","\\lparen":'<break time="150ms"/>open paren<break time="150ms"/>',"\\rparen":'<break time="150ms"/>close paren<break time="150ms"/>',"\\lbrace":'<break time="150ms"/>open brace<break time="150ms"/>',"\\{":'<break time="150ms"/>open brace<break time="150ms"/>',"\\rbrace":'<break time="150ms"/>close brace<break time="150ms"/>',"\\}":'<break time="150ms"/>close brace<break time="150ms"/>',"\\langle":'<break time="150ms"/>left angle bracket<break time="150ms"/>',"\\rangle":'<break time="150ms"/>right angle bracket<break time="150ms"/>',"\\lfloor":'<break time="150ms"/>open floor<break time="150ms"/>',"\\rfloor":'<break time="150ms"/>close floor<break time="150ms"/>',"\\lceil":'<break time="150ms"/>open ceiling<break time="150ms"/>',"\\rceil":'<break time="150ms"/>close ceiling<break time="150ms"/>',"\\vert":'<break time="150ms"/>vertical bar<break time="150ms"/>',"\\mvert":'<break time="150ms"/>divides<break time="150ms"/>',"\\lvert":'<break time="150ms"/>left vertical bar<break time="150ms"/>',"\\rvert":'<break time="150ms"/>right vertical bar<break time="150ms"/>',"\\lbrack":'<break time="150ms"/> open square bracket <break time="150ms"/>',"\\rbrack":'<break time="150ms"/> close square bracket <break time="150ms"/>',mm:"millimeters",cm:"centimeters",km:"kilometers",kg:"kilograms"},Vh={array:"array",matrix:"matrix",pmatrix:"parenthesis matrix",bmatrix:"square brackets matrix",Bmatrix:"braces matrix",vmatrix:"bars matrix",Vmatrix:"double bars matrix","matrix*":"matrix",smallmatrix:"small matrix"};function Dv(a){let y="";return a.startsWith("\\")&&(y=" "+a.replace("\\","")+" "),y}function Nd(a){let y=0;if(Ne(a))for(const b of a)b.type!=="first"&&(y+=1);return y===1}function Iv(a){if(Ne(a)){for(const y of a)if(y.type!=="first"&&y.id)return y.id.toString()}return""}function up(a){let y="";if(Ne(a))for(const b of a)b.type!=="first"&&typeof b.value=="string"&&(y+=b.value);return y}function Pv(a){return a?a.map(y=>y.value).join(""):""}function fa(a,y){var b,E,ee,re,ae;function de(xe){return window.MathfieldElement.textToSpeechMarkup?/[a-z]/.test(xe)?` <say-as interpret-as="character">${xe}</say-as>`:/[A-Z]/.test(xe)?`capital <say-as interpret-as="character">${xe.toLowerCase()}</say-as>`:xe:/[a-z]/.test(xe)?" '"+xe.toUpperCase()+"'":/[A-Z]/.test(xe)?" 'capital "+xe.toUpperCase()+"'":xe}function fe(xe){return"<emphasis>"+xe+"</emphasis>"}if(!y)return"";let ge="";if(Ne(y)){let xe=!1,Be=!1;for(let Ve=0;Ve<y.length;Ve++)y[Ve].type!=="first"&&(y[Ve].mode!=="text"&&(Be=!1),Ve<y.length-2&&y[Ve].type==="mopen"&&y[Ve+2].type==="mclose"&&y[Ve+1].type==="mord"?(ge+=" of ",ge+=fe(fa(a,y[Ve+1])),Ve+=2):y[Ve].mode==="text"?Be?ge+=(b=y[Ve].value)!=null?b:" ":(Be=!0,ge+=fa("text",y[Ve])):y[Ve].isDigit()?xe?ge+=y[Ve].asDigit():(xe=!0,ge+=fa(a,y[Ve])):(xe=!1,ge+=fa(a,y[Ve])))}else if(y.mode==="text")y.id&&a==="math"&&(ge+='<mark name="'+y.id.toString()+'"/>'),ge+=y.value;else{y.id&&a==="math"&&(ge+='<mark name="'+y.id.toString()+'"/>');let xe="",Be="",Ve="",ot=!1;const{command:gt}=y;switch(gt){case"\\vec":return"vector "+fa(a,y.body);case"\\acute":return fa(a,y.body)+" acute";case"\\grave":return fa(a,y.body)+" grave";case"\\dot":return"dot over"+fa(a,y.body);case"\\ddot":return"double dot over"+fa(a,y.body);case"\\mathring":return"ring over"+fa(a,y.body);case"\\tilde":case"\\widetilde":return"tilde over"+fa(a,y.body);case"\\bar":return fa(a,y.body)+" bar";case"\\breve":return fa(a,y.body)+" breve";case"\\check":case"\\widecheck":return"check over "+fa(a,y.body);case"\\hat":case"\\widehat":return"hat over"+fa(a,y.body);case"\\overarc":case"\\overparen":case"\\wideparen":return"arc over "+fa(a,y.body);case"\\underarc":case"\\underparen":return"arc under "+fa(a,y.body)}switch(y.type){case"prompt":const ln=y.body.length>1?'start input . <break time="500ms"/> '+fa(a,y.body)+'. <break time="500ms"/> end input':"blank";ge+=' <break time="300ms"/> '+ln+'. <break time="700ms"/>'+((E=y.correctness)!=null?E:"")+' . <break time="700ms"/> ';break;case"array":const ar=y.array,rn=y.environmentName;if(Object.keys(Vh).includes(rn)){ge+=` begin ${Vh[rn]} `;for(let jn=0;jn<ar.length;jn++){jn>0&&(ge+=","),ge+=` row ${jn+1} `;for(let Kr=0;Kr<ar[jn].length;Kr++)Kr>0&&(ge+=","),ge+=` column ${Kr+1}: `,ge+=fa("math",ar[jn][Kr])}ge+=` end ${Vh[rn]} `}break;case"group":gt==="\\ne"?ge+=" not equal ":(gt==="\\not"&&(ge+=" not "),ge+=fa("math",y.body));break;case"root":ge+=fa("math",y.body);break;case"genfrac":if(xe=fa("math",y.above),Be=fa("math",y.below),Nd(y.above)&&Nd(y.below)){const Kr={"1/2":" half ","1/3":" one third ","2/3":" two third","1/4":" one quarter ","3/4":" three quarter ","1/5":" one fifth ","2/5":" two fifths ","3/5":" three fifths ","4/5":" four fifths ","1/6":" one sixth ","5/6":" five sixths ","1/8":" one eight ","3/8":" three eights ","5/8":" five eights ","7/8":" seven eights ","1/9":" one ninth ","2/9":" two ninths ","4/9":" four ninths ","5/9":" five ninths ","7/9":" seven ninths ","8/9":" eight ninths "}[up(y.above)+"/"+up(y.below)];Kr?ge=Kr:ge+=xe+" over "+Be}else ge+=' the fraction <break time="150ms"/>'+xe+' over <break time="150ms"/>'+Be+'.<break time="150ms"/> End fraction.<break time="150ms"/>';break;case"surd":if(Ve=fa("math",y.body),y.hasEmptyBranch("above"))ge+=Nd(y.body)?" the square root of "+Ve+" , ":' the square root of <break time="200ms"/>'+Ve+'. <break time="200ms"/> End square root';else{let jn=fa("math",y.above);jn=jn.trim();const Kr=jn.replace(/<mark([^/]*)\/>/g,"");Kr==="3"?ge+=' the cube root of <break time="200ms"/>'+Ve+'. <break time="200ms"/> End cube root':Kr==="n"?ge+=' the nth root of <break time="200ms"/>'+Ve+'. <break time="200ms"/> End root':ge+=' the root with index: <break time="200ms"/>'+jn+', of <break time="200ms"/>'+Ve+'. <break time="200ms"/> End root'}break;case"leftright":{const jn=y;ge+=(ee=jn.leftDelim?Fc[jn.leftDelim]:void 0)!=null?ee:jn.leftDelim,ge+=fa("math",y.body),ge+=(re=jn.rightDelim?Fc[jn.rightDelim]:void 0)!=null?re:jn.rightDelim}break;case"rule":break;case"overunder":break;case"overlap":break;case"macro":const Vn=gt.replace(/^\\/g,""),lr=Nr()[Vn];lr&&(lr!=null&&lr.expand?ge+=fa("math",y.body):ge+=`${Vn} `);break;case"placeholder":ge+="placeholder ";break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":{if(gt==="\\mathbin"||gt==="\\mathrel"||gt==="\\mathopen"||gt==="\\mathclose"||gt==="\\mathpunct"||gt==="\\mathord"||gt==="\\mathinner"){ge=fa(a,y.body);break}let jn=y.isDigit()?y.asDigit():y.value,Kr=y.command;if((y.type==="delim"||y.type==="sizeddelim")&&(Kr=y.value,jn=Kr),a==="text")ge+=jn;else{if(y.type==="mbin"&&(ge+='<break time="150ms"/>'),jn){const ai=Fc[jn]||(Kr?Fc[Kr.trim()]:"");if(ai)ge+=" "+ai;else{const jr=Kr?Dv(Kr.trim()):"";ge+=jr||de(jn)}}else ge+=fa("math",y.body);y.type==="mbin"&&(ge+='<break time="150ms"/>')}break}case"mop":case"operator":case"extensible-symbol":if(y.value!=="\u200B"){const jn=y.command;if(jn==="\\sum")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let Kr=fa("math",y.superscript);Kr=Kr.trim();let ai=fa("math",y.subscript);ai=ai.trim(),ge+=' the summation from <break time="200ms"/>'+ai+'<break time="200ms"/> to <break time="200ms"/>'+Kr+'<break time="200ms"/> of <break time="150ms"/>',ot=!0}else if(y.hasEmptyBranch("subscript"))ge+=" the summation of";else{let Kr=fa("math",y.subscript);Kr=Kr.trim(),ge+=' the summation from <break time="200ms"/>'+Kr+'<break time="200ms"/> of <break time="150ms"/>',ot=!0}else if(jn==="\\prod")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let Kr=fa("math",y.superscript);Kr=Kr.trim();let ai=fa("math",y.subscript);ai=ai.trim(),ge+=' the product from <break time="200ms"/>'+ai+'<break time="200ms"/> to <break time="200ms"/>'+Kr+'<break time="200ms"/> of <break time="150ms"/>',ot=!0}else if(y.hasEmptyBranch("subscript"))ge+=" the product of ";else{let Kr=fa("math",y.subscript);Kr=Kr.trim(),ge+=' the product from <break time="200ms"/>'+Kr+'<break time="200ms"/> of <break time="150ms"/>',ot=!0}else if(jn==="\\int")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let Kr=fa("math",y.superscript);Kr=Kr.trim();let ai=fa("math",y.subscript);ai=ai.trim(),ge+=' the integral from <break time="200ms"/>'+fe(ai)+'<break time="200ms"/> to <break time="200ms"/>'+fe(Kr)+' <break time="200ms"/> of ',ot=!0}else ge+=' the integral of <break time="200ms"/> ';else if(typeof y.value=="string"){const Kr=(ae=Fc[y.value])!=null?ae:y.command?Fc[y.command]:void 0;ge+=Kr||" "+y.value}else y.command&&(y.command==="\\mathop"?ge+=fa("math",y.body):y.command==="\\operatorname"?ge+=Pv(y.body):ge+=y.command.startsWith("\\")?" "+y.command.slice(1):" "+y.command)}break;case"enclose":Ve=fa("math",y.body),ge+=" crossed out "+Ve+". End crossed out.";break;case"space":case"spacing":break}if(!ot&&!y.hasEmptyBranch("superscript")){let ln=fa(a,y.superscript);ln=ln.trim();const ar=ln.replace(/<[^>]*>/g,"");if(Nd(y.superscript)){if(a==="math"){const rn=Iv(y.superscript);rn&&(ge+='<mark name="'+rn+'"/>')}ar==="\u2032"?ge+=" prime ":ar==="2"?ge+=" squared ":ar==="3"?ge+=" cubed ":Number.isNaN(Number.parseInt(ar))?ge+=" to the "+ln+"; ":ge+=' to the <say-as interpret-as="ordinal">'+ar+"</say-as> power; "}else Number.isNaN(Number.parseInt(ar))?ge+=" raised to the "+ln+"; ":ge+=' raised to the <say-as interpret-as="ordinal">'+ar+"</say-as> power; "}if(!ot&&!y.hasEmptyBranch("subscript")){let ln=fa("math",y.subscript);ln=ln.trim(),ge+=Nd(y.subscript)?" sub "+ln:" subscript "+ln+". End subscript. "}}return ge}function $c(a){var y,b;if(window.MathfieldElement.textToSpeechRules==="sre"&&("sre"in window||"SRE"in window)){const ee=Ka(a);if(ee){window.MathfieldElement.textToSpeechMarkup&&(window.MathfieldElement.textToSpeechRulesOptions=(y=window.MathfieldElement.textToSpeechRulesOptions)!=null?y:{},window.MathfieldElement.textToSpeechRulesOptions=he(we({},window.MathfieldElement.textToSpeechRulesOptions),{markup:window.MathfieldElement.textToSpeechMarkup}),window.MathfieldElement.textToSpeechRulesOptions.markup==="ssml"&&(window.MathfieldElement.textToSpeechRulesOptions=he(we({},window.MathfieldElement.textToSpeechRulesOptions),{markup:"ssml_step"})),window.MathfieldElement.textToSpeechRulesOptions=he(we({},window.MathfieldElement.textToSpeechRulesOptions),{rate:window.MathfieldElement.speechEngineRate}));const re=(b=window.SRE)!=null?b:window.sre.System.getInstance();window.MathfieldElement.textToSpeechRulesOptions&&re.setupEngine(window.MathfieldElement.textToSpeechRulesOptions);let ae="";try{ae=re.toSpeech(ee)}catch(de){console.error("MathLive 0.98.5: `SRE.toSpeech()` runtime error",de)}return ae}return""}let E=fa("math",a);if(window.MathfieldElement.textToSpeechMarkup==="ssml"){let ee="";window.MathfieldElement.speechEngineRate&&(ee='<prosody rate="'+window.MathfieldElement.speechEngineRate+'">'),E='<?xml version="1.0"?><speak version="1.1" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US"><amazon:auto-breaths>'+ee+"<p><s>"+E+"</s></p>"+(ee?"</prosody>":"")+"</amazon:auto-breaths></speak>"}else window.MathfieldElement.textToSpeechMarkup==="mac"&&Te()==="macos"?E=E.replace(/<mark([^/]*)\/>/g,"").replace(/<emphasis>/g,"[[emph+]]").replace(/<\/emphasis>/g,"").replace(/<break time="(\d*)ms"\/>/g,"[[slc $1]]").replace(/<say-as[^>]*>/g,"").replace(/<\/say-as>/g,""):E=E.replace(/<[^>]*>/g,"").replace(/\s{2,}/g," ");return E}var Fd={"\\ne":"\u2260","\\neq":"\u2260","\u2212":"-","-":"-","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\delta":"delta","\\epsilon":"epsilon","\\varepsilon":"varepsilon","\\zeta":"zeta","\\eta":"eta","\\theta":"theta","\\vartheta":"vartheta","\\iota":"iota","\\kappa":"kappa","\\lambda":"lambda","\\mu":"mu","\\nu":"nu","\\xi":"xi","\\pi":"pi","\\rho":"rho","\\sigma":"sigma","\\tau":"tau","\\upsilon":"upsilon","\\phi":"phi","\\varphi":"varphi","\\chi":"chi","\\psi":"psi","\\omega":"omega","\\Gamma":"Gamma","\\Delta":"Delta","\\Theta":"Theta","\\Lambda":"Lambda","\\Xi":"Xi","\\Pi":"Pi","\\Sigma":"Sigma","\\Phi":"Phi","\\Psi":"Psi","\\Omega":"Omega","\\exponentialE":"e","\\imaginaryI":"i","\\imaginaryJ":"j","\\!":" ","\\,":" ","\\:":" ","\\>":" ","\\;":" ","\\enskip":" ","\\enspace":" ","\\qquad":" ","\\quad":" ","\\infty":"oo"},$d={"\\pm":"+-","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrack":"[","\\rbrack":"]","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"(:","\\rangle":":)","\\sum":" sum ","\\prod":" prod ","\\bigcap":" nnn ","\\bigcup":" uuu ","\\int":" int ","\\oint":" oint ","\\ge":">=","\\le":"<=","\\ne":"!=","\\neq":"!=","\\lt":"<","\\gt":">","\\gets":"<-","\\to":"->","\\land":" and ","\\lor":" or ","\\lnot":" not ","\\forall":" AA ","\\exists":" EE ","\\in":" in ","\\notin":" !in ","\\mapsto":"|->","\\implies":"=>","\\iff":"<=>","\\cdot":"*","\\ast":"**","\\star":"***","\\times":"xx","\\div":"-:","\\ltimes":"|><","\\rtimes":"><|","\\bowtie":"|><|","\\circ":"@"};function Bv(a){let y="";for(const b of a){const E=y[y.length-1];E!==void 0&&/\d/.test(E)&&/^\d/.test(b)&&(y+=" "),y+=b}return y}function ko(a){var y,b,E,ee,re,ae,de,fe,ge,xe,Be,Ve,ot;if(!a)return"";if(Ne(a)){if(a.length===0)return"";if(a[0].mode==="latex")return a.map(ko).join("");if(a[0].mode==="text"){let lr=0,jn="";for(;((y=a[lr])==null?void 0:y.mode)==="text";)jn+=a[lr].body?ko(a[lr].body):a[lr].value,lr++;return`"${jn}" ${ko(a.slice(lr))}`}let rn=0;const Vn=[];for(;a[rn]&&a[rn].mode==="math";){let lr="";for(;a[rn]&&a[rn].type==="mord"&&/\d/.test(a[rn].value);)lr+=a[rn++].value;lr?Vn.push(lr):Vn.push(ko(a[rn++]))}return Vn.push(ko(a.slice(rn))),Bv(Vn)}if(a.mode==="text")return`"${a.value}"`;let gt="";const{command:ln}=a;let ar;if(ln==="\\placeholder")return`(${ko(a.body)})`;switch(a.type){case"accent":const rn={"\\vec":"vec","\\dot":"dot","\\ddot":"ddot","\\bar":"bar","\\hat":"hat","\\acute":"acute;","\\grave":"grave","\\tilde":"tilde","\\breve":"breave","\\check":"check"}[ln];gt=`${rn!=null?rn:""} ${ko(a.body)} `;break;case"first":return"";case"latexgroup":return a.body.map(jr=>jr.value).join("");case"group":case"root":gt=(b=Fd[ln])!=null?b:ko(a.body);break;case"genfrac":{const jr=a;(jr.leftDelim||jr.rightDelim)&&(gt=jr.leftDelim==="."||!jr.leftDelim?"{:":jr.leftDelim),jr.hasBarLine?(gt+="(",gt+=ko(jr.above),gt+=")/(",gt+=ko(jr.below),gt+=")"):(gt+="("+ko(jr.above)+"),",gt+="("+ko(jr.below)+")"),(jr.leftDelim||jr.rightDelim)&&(gt+=jr.rightDelim==="."||!jr.rightDelim?"{:":jr.rightDelim)}break;case"surd":gt+=a.hasEmptyBranch("above")?"sqrt("+ko(a.body)+")":"root("+ko(a.above)+")("+ko(a.body)+")";break;case"latex":gt=a.value;break;case"leftright":{const jr=a,_a=jr.leftDelim;gt+=_a==="."||!_a?"{:":_a,gt+=ko(jr.body);const qa=jr.matchingRightDelim();gt+=qa==="."||!qa?":}":qa}break;case"sizeddelim":case"delim":gt=a.value;break;case"overlap":break;case"overunder":break;case"mord":gt=(ee=(E=Fd[ln])!=null?E:ln)!=null?ee:typeof a.value=="string"?a.value:"",gt.startsWith("\\")&&(gt+=" "),ar=ln?ln.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,ar?gt=String.fromCodePoint(Number.parseInt("0x"+ar[1])):gt.length>0&&gt.startsWith("\\")&&(gt=typeof a.value=="string"?a.value.charAt(0):a.command),gt=Ov(gt,a.style);break;case"mbin":case"mrel":case"minner":gt=(ae=(re=Fd[ln])!=null?re:$d[ln])!=null?ae:a.value;break;case"mopen":case"mclose":gt=a.value;break;case"mpunct":gt=(de=$d[ln])!=null?de:ln;break;case"mop":case"operator":case"extensible-symbol":a.value!=="\u200B"&&($d[ln]?gt=$d[ln]:gt=ln==="\\operatorname"?ko(a.body):(fe=a.value)!=null?fe:ln,gt+=" ");break;case"array":const Vn=a.array,lr=a.environmentName,jn=(ge={bmatrix:["[","]"],"bmatrix*":["[","]"]}[lr])!=null?ge:["(",")"],Kr=[];for(const jr of Vn){const _a=[];for(const qa of jr)_a.push(jn[0]+ko(qa)+jn[1]);Kr.push(_a.join(","))}const ai=(xe={bmatrix:["[","]"],"bmatrix*":["[","]"],cases:["{",":}"]}[lr])!=null?xe:["(",")"];gt=ai[0]+Kr.join(",")+ai[1];break;case"box":break;case"spacing":gt=(Be=Fd[ln])!=null?Be:" ";break;case"enclose":gt="("+ko(a.body)+")";break;case"space":gt=" ";break;case"subsup":gt="";break;case"macro":gt=(ot=(Ve=Fd[ln])!=null?Ve:$d[ln])!=null?ot:ko(a.body);break}if(!a.hasEmptyBranch("subscript")){gt+="_";const rn=ko(a.subscript);gt+=rn.length!==1?`(${rn})`:rn}if(!a.hasEmptyBranch("superscript")){gt+="^";const rn=ko(a.superscript);gt+=rn.length!==1?`(${rn})`:rn}return gt}function Ov(a,y){if(!y)return a;let b=a;return y.variant==="double-struck"&&(b=`bbb "${b}"`),y.variant==="script"&&(b=`cc "${b}"`),y.variant==="fraktur"&&(b=`fr "${b}"`),y.variant==="sans-serif"&&(b=`sf "${b}"`),y.variant==="monospace"&&(b=`tt "${b}"`),y.variantStyle==="bold"&&(b=`bb "${b}"`),y.color?`color({${y.color}})(${b})`:b}function qo(a,y){var b,E;y!=null||(y={}),y.mathstyle=(b=y.mathstyle)!=null?b:"displaystyle";const ee=new ya({from:he(we({},bc()),{renderPlaceholder:()=>new sr(160,{maxFontSize:1}),letterShapeStyle:(E=y==null?void 0:y.letterShapeStyle)!=null?E:"tex"}),mathstyle:y.mathstyle}),ae=new In({mode:"math",type:"root",body:Xo(a,{context:ee,parseMode:"math",mathstyle:y.mathstyle})}).render(ee);return ae?(gc(Cd(ae,ee)),vc(ae,{classes:"ML__latex"}).toMarkup()):""}function k1(a){return t0(a,{context:bc()})}function Rv(a,y={}){return Ka(Xo(a,{parseMode:"math",args:()=>"",mathstyle:"displaystyle"}),y)}function Nv(a){const y=Xo(a,{parseMode:"math",mathstyle:"displaystyle"});return $c(y)}var Yf;function Fv(a){var y,b;if(!Yf){const E=(y=globalThis[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:y.ComputeEngine;E?Yf=new E:console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`)}return(b=Yf==null?void 0:Yf.box(a).latex)!=null?b:""}function L1(a,y="math"){return ko(new In({type:"root",body:Xo(a,{parseMode:y})}))}function A1(a){return Bu(a,{format:"ascii-math"})[1]}function Uh(a){if(typeof a=="string"){const y=$v(a);if(!y)throw new Error(`Invalid color: ${a}`);return y}return"C"in a?Kv(a):"a"in a?cp(a):a}function zc(a){return a<0?0:a>255?255:Math.round(a)}function $v(a){if(!a||a[0]!=="#")return;a=a.slice(1);let y;return a.length<=4?(y={r:parseInt(a[0]+a[0],16),g:parseInt(a[1]+a[1],16),b:parseInt(a[2]+a[2],16)},a.length===4&&(y.a=parseInt(a[3]+a[3],16)/255)):(y={r:parseInt(a[0]+a[1],16),g:parseInt(a[2]+a[3],16),b:parseInt(a[4]+a[5],16)},a.length===8&&(y.a=parseInt(a[6]+a[7],16)/255)),y&&typeof y.a=="undefined"&&(y.a=1),y}function Zh(a){const[y,b,E]=[a.L,a.C,a.H],ee=E*Math.PI/180,re={L:y,a:b*Math.cos(ee),b:b*Math.sin(ee)};return a.alpha!==void 0&&(re.alpha=a.alpha),re}function zv(a){const[y,b,E]=[a.L,a.a,a.b],ee=Math.sqrt(b*b+E*E),ae=Math.atan2(E,b)*180/Math.PI,de={L:y,C:ee,H:ae};return a.alpha!==void 0&&(de.alpha=a.alpha),de}function jh(a){const[y,b,E]=[a.L,a.a,a.b],ee=Math.pow(.9999999984505198*y+.39633779217376786*b+.2158037580607588*E,3),re=Math.pow(1.00000000888176*y-.10556134232365635*b-.0638541747717059*E,3),ae=Math.pow(y*1.000000054672411-.0894841820949657*b-1.2914855378640917*E,3),de=4.076741661347994*ee-3.307711590408193*re+.230969928729428*ae,fe=-1.2684380040921763*ee+2.6097574006633715*re-.3413193963102197*ae,ge=-.004196086541837188*ee-.7034186144594493*re+1.7076147009309444*ae,xe=Be=>{const Ve=Math.abs(Be);return Ve<=.0031308?Be*12.92:(Math.sign(Be)||1)*(1.055*Math.pow(Ve,1/2.4)-.055)};return[xe(de),xe(fe),xe(ge)]}function Gh(a){const[y,b,E]=a;return y>=0&&y<=1&&b>=0&&b<=1&&E>=0&&E<=1}function Xh(a,y){let[b,E,ee]=a;return b=zc(b*255),E=zc(E*255),ee=zc(ee*255),y!==void 0?{r:b,g:E,b:ee,alpha:y}:{r:b,g:E,b:ee}}function cp(a){let[y,b,E]=jh(a);if(Gh([y,b,E]))return Xh([y,b,E],a.alpha);const ee=zv(a);if(ee.C=0,[y,b,E]=jh(Zh(ee)),!Gh([y,b,E]))return Xh([y,b,E],a.alpha);let re=0,ae=a.L,de=(re+ae)/2;ee.C=de;const fe=.36/Math.pow(2,12);for(;ae-re>fe;)de=(re+ae)/2,ee.C=de,[y,b,E]=jh(Zh(ee)),Gh([y,b,E])?re=de:ae=de;return Xh([y,b,E],a.alpha)}function Kv(a){return cp(Zh(a))}function dp(a,y){const b=Uh(a),E=Uh(y),ee=.56,re=.57,ae=.62,de=.65,fe=.022,ge=1.414,xe=.1,Be=5e-4,Ve=1.14,ot=.027,gt=1.14,ln=.027;function ar(jr){return jr>=fe?jr:jr+Il(fe-jr,ge)}function rn(jr){return(jr<0?-1:1)*Math.pow(Math.abs(jr),2.4)}const Vn=ar(rn(E.r/255)*.2126729+rn(E.g/255)*.7151522+rn(E.b/255)*.072175),lr=ar(rn(b.r/255)*.2126729+rn(b.g/255)*.7151522+rn(b.b/255)*.072175);let jn,Kr,ai;return Math.abs(lr-Vn)<Be?Kr=0:lr>Vn?(jn=Il(lr,ee)-Il(Vn,re),Kr=jn*Ve):(jn=Il(lr,de)-Il(Vn,ae),Kr=jn*gt),Math.abs(Kr)<xe?ai=0:Kr>0?ai=Kr-ln:ai=Kr+ot,ai*100}function fp(a,y,b){b!=null||(b="#fff"),y!=null||(y="#000");const E=dp(a,b),ee=dp(a,y);return Math.abs(E)>Math.abs(ee)?b:y}function Hv(a){const y=Uh(a);let b=((1<<24)+(zc(y.r)<<16)+(zc(y.g)<<8)+zc(y.b)).toString(16).slice(1);return y.alpha!==void 0&&y.alpha<1&&(b+=("00"+Math.round(y.alpha*255).toString(16)).slice(-2)),b[0]===b[1]&&b[2]===b[3]&&b[4]===b[5]&&b[6]===b[7]&&(b=b[0]+b[2]+b[4]+(y.alpha!==void 0&&y.alpha<1?b[6]:"")),"#"+b}function mo(a){const y=hp(a);let b="";for(const E of y){if(typeof E.value!="string")return"";b+=E.value}return b}function hp(a){const b=a.model.selection.ranges;return b.length!==1?[]:a.model.getAtoms(b[0])}function Wv(a,y){const b=hp(a);if(b.length!==1)return!1;const E=ph[y];return E?!!E.test(b[0].value):!1}function Vv(a,y){return mo(a).length>0}function Uv(a){return[qh(a,"double-struck","mathbb","tooltip.blackboard"),qh(a,"fraktur","mathfrak","tooltip.fraktur"),qh(a,"calligraphic","mathcal","tooltip.caligraphic"),Yh(a,"up","mathrm","tooltip.roman-upright"),Yh(a,"bold","mathbf","tooltip.bold"),Yh(a,"italic","mathit","tooltip.italic")]}function Zv(a){return[{label:()=>qo(`\\vec{${mo(a)}}`),visible:()=>mo(a).length===1,onMenuSelect:()=>a.insert("\\vec{#@}",{selectionMode:"item"})},{label:()=>qo(`\\overrightarrow{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\overrightarrow{#@}",{selectionMode:"item"})},{label:()=>qo(`\\overleftarrow{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\overleftarrow{#@}",{selectionMode:"item"})},{label:()=>qo(`\\dot{${mo(a)}}`),visible:()=>mo(a).length===1,onMenuSelect:()=>a.insert("\\dot{#@}",{selectionMode:"item"})},{label:()=>qo(`\\ddot{${mo(a)}}`),visible:()=>mo(a).length===1,onMenuSelect:()=>a.insert("\\ddot{#@}",{selectionMode:"item"})},{label:()=>qo(`\\bar{${mo(a)}}`),visible:()=>mo(a).length===1,onMenuSelect:()=>a.insert("\\bar{#@}",{selectionMode:"item"})},{label:()=>qo(`\\overline{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\overline{#@}",{selectionMode:"item"})},{label:()=>qo(`\\overgroup{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\overgroup{#@}",{selectionMode:"item"})},{label:()=>qo(`\\overbrace{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\overbrace{#@}",{selectionMode:"item"})},{label:()=>qo(`\\underline{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\underline{#@}",{selectionMode:"item"})},{label:()=>qo(`\\undergroup{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\undergroup{#@}",{selectionMode:"item"})},{label:()=>qo(`\\underbrace{${mo(a)}}`),visible:()=>mo(a).length>0,onMenuSelect:()=>a.insert("\\underbrace{#@}",{selectionMode:"item"})}]}function jv(a){return[{label:()=>qo(`\\boxed{${a.getValue(a.model.selection)}}}`),onMenuSelect:()=>a.insert("\\boxed{#@}",{selectionMode:"item"})},{label:()=>qo(`\\bbox[5px, border: 2px solid red]{${a.getValue(a.model.selection)}}`),onMenuSelect:()=>a.insert("\\bbox[5px, border: 2px solid red]{#@}",{selectionMode:"item"})},{label:()=>qo(`\\bbox[5px, border: 2px dashed black]{${a.getValue(a.model.selection)}}`),onMenuSelect:()=>a.insert("\\bbox[5px, border: 2px dashed black]{#@}",{selectionMode:"item"})}]}function Gv(a){const y=[];for(const b of Object.keys(Ue))y.push({class:(Hv(fp(Ue[b]))==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${Ue[b]} "></span>`,ariaLabel:()=>{var E;return(E=lt(b))!=null?E:b},checked:()=>{var E;return{some:"mixed",all:!0}[(E=a.queryStyle({backgroundColor:b}))!=null?E:!1]},onMenuSelect:()=>{a.applyStyle({backgroundColor:b},{operation:"toggle"}),a.adoptStyle="none"}});return y}function Xv(a){const y=[];for(const b of Object.keys(Ze))y.push({class:(fp(Ze[b])==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${Ze[b]} "></span>`,ariaLabel:()=>{var E;return(E=lt(b))!=null?E:b},checked:()=>{var E;return{some:"mixed",all:!0}[(E=a.queryStyle({color:b}))!=null?E:!1]},onMenuSelect:()=>{a.applyStyle({color:b},{operation:"toggle"}),a.adoptStyle="none"}});return y}var qv=class extends ep{constructor(a,y,b,E){super(a,y),this.row=b,this.col=E}set active(a){const y=this.parentMenu.children;if(a)for(const b of y)b.element.classList.toggle("active",b.row<=this.row&&b.col<=this.col);else for(const b of y)b.element.classList.remove("active")}};function Yv(a){const y=[];for(let b=1;b<=5;b++)for(let E=1;E<=5;E++)y.push({onCreate:(ee,re)=>new qv(ee,re,b,E),label:"\u2610",tooltip:()=>lt("tooltip.row-by-col",b,E),data:{row:b,col:E},onMenuSelect:()=>{a.insert(`\\begin{pmatrix}${Array(b).fill(Array(E).fill("#?").join(" & ")).join("\\\\")}\\end{pmatrix}`,{selectionMode:"item"})}});return y}function Jv(a){return[{label:()=>lt("menu.array.add row above"),id:"add-row-above",onMenuSelect:()=>a.executeCommand("addRowBefore"),visible:()=>ju(a)},{label:()=>lt("menu.array.add row below"),id:"add-row-below",onMenuSelect:()=>a.executeCommand("addRowAfter"),visible:()=>ju(a)},{label:()=>lt("menu.array.add column before"),id:"add-column-before",onMenuSelect:()=>a.executeCommand("addColumnBefore"),visible:()=>ju(a),enabled:()=>{const y=a.model.parentEnvironment;if(!y)return!1;const[b,E]=e1(a);return b<y.maxColumns}},{label:()=>lt("menu.array.add column after"),id:"add-column-after",onMenuSelect:()=>a.executeCommand("addColumnAfter"),visible:()=>ju(a)},{type:"divider"},{label:()=>lt("menu.array.delete row"),id:"delete-row",onMenuSelect:()=>a.executeCommand("removeRow"),visible:()=>ju(a)},{label:()=>lt("menu.array.delete column"),id:"delete-column",onMenuSelect:()=>a.executeCommand("removeColumn"),visible:()=>ju(a)},{type:"divider"},{label:()=>lt("menu.borders"),visible:()=>(Qv(a)||ju(a))&&a.isSelectionEditable,submenu:[{label:" \u22F1 ",id:"environment-no-border",onMenuSelect:()=>zd(a,"matrix")},{label:"(\u22F1)",id:"environment-parentheses",onMenuSelect:()=>zd(a,"pmatrix")},{label:"[\u22F1]",id:"environment-brackets",onMenuSelect:()=>zd(a,"bmatrix")},{label:"|\u22F1|",id:"environment-bar",onMenuSelect:()=>zd(a,"vmatrix")},{label:"{\u22F1}",id:"environment-braces",onMenuSelect:()=>zd(a,"Bmatrix")}],submenuClass:"border-submenu"},{type:"divider"},{label:()=>lt("menu.insert matrix"),id:"insert-matrix",visible:()=>a.isSelectionEditable,submenu:Yv(a),submenuClass:"insert-matrix-submenu",columnCount:5},{label:()=>lt("menu.mode"),id:"mode",visible:()=>a.isSelectionEditable&&a.model.selectionIsCollapsed,submenu:[{label:()=>lt("menu.mode-math"),id:"mode-math",onMenuSelect:()=>{Ac(a,"accept-all"),a.executeCommand(["switchMode","math"])},checked:()=>a.model.mode==="math"},{label:()=>lt("menu.mode-text"),id:"mode-text",onMenuSelect:()=>{Ac(a,"accept-all"),a.executeCommand(["switchMode","text"])},checked:()=>a.model.mode==="text"},{label:()=>lt("menu.mode-latex"),id:"mode-latex",onMenuSelect:()=>a.executeCommand(["switchMode","latex"]),checked:()=>a.model.mode==="latex"}]},{type:"divider"},{label:()=>lt("menu.font-style"),id:"variant",visible:()=>a.isSelectionEditable,submenu:Uv(a),submenuClass:"variant-submenu"},{label:()=>lt("menu.color"),id:"color",visible:()=>a.isSelectionEditable,submenu:Xv(a),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>lt("menu.background-color"),id:"background-color",visible:()=>a.isSelectionEditable,submenu:Gv(a),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>lt("menu.accent"),id:"accent",visible:()=>a.isSelectionEditable,submenu:Zv(a),submenuClass:"variant-submenu"},{label:()=>lt("menu.decoration"),id:"decoration",visible:()=>a.isSelectionEditable&&mo(a).length>0,submenu:jv(a),submenuClass:"variant-submenu"},{type:"divider"},{label:()=>lt("menu.evaluate"),id:"ce-evaluate",visible:()=>a.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{const y=t1(a);if(!y){a.model.announce("plonk");return}a.model.selectionIsCollapsed?(a.model.position=a.model.lastOffset,a.insert(`=${y}`,{insertionMode:"insertAfter",selectionMode:"item"})):a.insert(y,{insertionMode:"replaceSelection",selectionMode:"item"})}},{label:()=>lt("menu.simplify"),id:"ce-simplify",visible:()=>a.isSelectionEditable&&window.MathfieldElement.computeEngine!==null,onMenuSelect:()=>{var y,b;if(a.model.selectionIsCollapsed){const E=(y=a.expression)==null?void 0:y.simplify();if(a.model.position=a.model.lastOffset,!E){a.model.announce("plonk");return}a.insert(`=${E.latex}`,{insertionMode:"insertAfter",selectionMode:"item"})}else{const E=(b=window.MathfieldElement.computeEngine)==null?void 0:b.parse(a.getValue(a.model.selection)).simplify();if(!E){a.model.announce("plonk");return}a.insert(E.latex,{insertionMode:"replaceSelection",selectionMode:"item"})}}},{label:()=>{var y;if(window.MathfieldElement.computeEngine===null)return"";const b=(y=a.expression)==null?void 0:y.unknowns[0];return b?lt("menu.solve-for",qo(b)):lt("menu.solve")},id:"ce-solve",visible:()=>{var y;return a.isSelectionEditable&&window.MathfieldElement.computeEngine!==null&&((y=a.expression)==null?void 0:y.unknowns.length)===1&&a.expression.unknowns[0]!=="Nothing"},onMenuSelect:()=>{var y;const b=a.expression,E=b==null?void 0:b.unknowns[0],ee=(y=b.solve(E))==null?void 0:y.map(re=>{var ae;return(ae=re.simplify().latex)!=null?ae:""});if(!ee){a.model.announce("plonk");return}a.insert(`${E}=${ee.length===1?ee[0]:"\\left\\lbrace"+(ee==null?void 0:ee.join(", "))+"\\right\\rbrace"}`,{insertionMode:"replaceAll",selectionMode:"item"})}},{type:"divider"},{label:()=>lt("menu.cut"),onMenuSelect:()=>a.executeCommand("cutToClipboard"),visible:()=>!a.options.readOnly&&a.isSelectionEditable,keyboardShortcut:"meta+X"},{label:()=>lt("menu.copy"),id:"copy",submenu:[{label:()=>lt("menu.copy-as-latex"),id:"copy-latex",onMenuSelect:()=>Bi.copyToClipboard(a,"latex"),keyboardShortcut:"meta+C"},{label:()=>lt("menu.copy-as-ascii-math"),id:"copy-ascii-math",onMenuSelect:()=>Bi.copyToClipboard(a,"ascii-math")},{label:()=>lt("menu.copy-as-mathml"),id:"copy-math-ml",onMenuSelect:()=>Bi.copyToClipboard(a,"math-ml")}]},{label:()=>lt("menu.paste"),id:"paste",onMenuSelect:()=>a.executeCommand("pasteFromClipboard"),visible:()=>a.hasEditableContent,keyboardShortcut:"meta+V"},{label:()=>lt("menu.select-all"),id:"select-all",keyboardShortcut:"meta+A",onMenuSelect:()=>a.executeCommand("selectAll")}]}function ju(a){var y;return!!((y=a.model.parentEnvironment)!=null&&y.array)}function Qv(a){return a.model.at(a.model.position).type==="array"}function e1(a){var y;const b=(y=a.model.parentEnvironment)==null?void 0:y.array;return b?[b.length,b.reduce((E,ee)=>Math.max(E,ee.length),0)]:[0,0]}function zd(a,y){Mf(a),a.flushInlineShortcutBuffer(),I0(a.model,y),Mo(a)}function t1(a){var y,b;let E;if(a.model.selectionIsCollapsed?E=(y=window.MathfieldElement.computeEngine)==null?void 0:y.parse(a.getValue(),{canonical:!1}):E=(b=window.MathfieldElement.computeEngine)==null?void 0:b.parse(a.getValue(a.model.selection),{canonical:!1}),!E)return"";let ee=E.evaluate();return ee.isSame(E)&&(ee=E.N()),ee.latex}function qh(a,y,b,E){return{label:()=>qo(`\\${b}{${mo(a)}}`),tooltip:()=>{var ee;return(ee=lt(E))!=null?ee:E},visible:()=>Wv(a,y),checked:()=>{var ee;return{some:"mixed",all:!0}[(ee=a.queryStyle({variant:y}))!=null?ee:!1]},onMenuSelect:()=>{a.applyStyle({variant:y},{operation:"toggle"}),a.adoptStyle="none"}}}function Yh(a,y,b,E){return{label:()=>qo(`\\${b}{${mo(a)}}`),tooltip:()=>{var ee;return(ee=lt(E))!=null?ee:E},visible:()=>Vv(a,y),checked:()=>{var ee;return{some:"mixed",all:!0}[(ee=a.queryStyle({variantStyle:y}))!=null?ee:!1]},onMenuSelect:()=>{a.applyStyle({variantStyle:y},{operation:"toggle"}),a.adoptStyle="none"}}}function Kc(a,y){return a+$c(y)}Ls({speak:(a,y,b)=>n1(a,y,b)},{target:"mathfield"});function n1(a,y,b){var E,ee;b=b!=null?b:{withHighlighting:!1};const{model:re}=a;function ae(xe){let Be=null;switch(xe){case"all":Be=re.root;break;case"selection":Be=re.getAtoms(re.selection);break;case"left":{Be=re.getAtoms(re.offsetOf(re.at(re.position).leftSibling),re.position);break}case"right":{Be=re.getAtoms(re.position,re.offsetOf(re.at(re.position).rightSibling));break}case"group":Be=re.getAtoms(re.getSiblingsRange(re.position));break;case"parent":{const{parent:Ve}=re.at(re.position);Ve!=null&&Ve.parent?Be=Ve:Be=re.root;break}default:Be=re.root}return Be}function de(xe){let Be="";switch(xe){case"all":console.log("Internal failure: speak all failed");break;case"selection":Be="no selection";break;case"left":Be="at start";break;case"right":Be="at end";break;case"group":console.log("Internal failure: speak group failed");break;case"parent":Be="no parent";break;default:console.log('unknown speak_ param value: "'+xe+'"');break}return Be}const fe=ae(y);if(fe===null)return(ee=(E=window.MathfieldElement).speakHook)==null||ee.call(E,de(y)),!1;(b.withHighlighting||window.MathfieldElement.speechEngine==="amazon")&&(window.MathfieldElement.textToSpeechMarkup=window.sre&&window.MathfieldElement.textToSpeechRules==="sre"?"ssml_step":"ssml");const ge=$c(fe);return ut()&&b.withHighlighting?(mu().readAloudMathfield=a,Fu(a,{forHighlighting:!0}),window.MathfieldElement.readAloudHook&&window.MathfieldElement.readAloudHook(a.field,ge)):window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(ge),!1}function r1(a){var y,b;if(!ut()){console.log("Speak:",a);return}if(!window.MathfieldElement.speechEngine||window.MathfieldElement.speechEngine==="local"){const E=new SpeechSynthesisUtterance(a);window.speechSynthesis.speak(E)}else if(window.MathfieldElement.speechEngine==="amazon")if(!("AWS"in window))console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");else{const E=new window.AWS.Polly({apiVersion:"2016-06-10"}),ee={OutputFormat:"mp3",VoiceId:(y=window.MathfieldElement.speechEngineVoice)!=null?y:"Joanna",Engine:["Amy","Emma","Brian","Ivy","Joanna","Kendra","Kimberly","Salli","Joey","Justin","Matthew"].includes((b=window.MathfieldElement.speechEngineVoice)!=null?b:"Joanna")?"neural":"standard",Text:a,TextType:"ssml"};E.synthesizeSpeech(ee,(re,ae)=>{if(re)console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${re}`);else if(ae!=null&&ae.AudioStream){const de=new Uint8Array(ae.AudioStream),fe=new Blob([de.buffer],{type:"audio/mpeg"}),ge=URL.createObjectURL(fe);new Audio(ge).play().catch(Be=>console.log(Be))}else console.log("polly.synthesizeSpeech():",ae)})}else window.MathfieldElement.speechEngine==="google"&&console.error("MathLive 0.98.5: The Google speech engine is not supported yet. Please come again.")}function pp(a){var y;let b;if(a.parent.type==="prompt")a.parentBranch==="body"&&(b="prompt");else if(a.parentBranch==="body")b=a.type&&(y={enclose:"cross out",leftright:"delimiter",surd:"square root",root:"math field",mop:"operator",first:"first"}[a.type])!=null?y:"parent";else if(a.parent.type==="genfrac"){if(a.parentBranch==="above")return"numerator";if(a.parentBranch==="below")return"denominator"}else a.parent.type==="surd"?a.parentBranch==="above"&&(b="index"):a.parentBranch==="superscript"?b="superscript":a.parentBranch==="subscript"&&(b="subscript");return b||console.log("unknown relationship"),b!=null?b:"parent"}function i1(a,y,b,E){let ee="";if(y==="plonk")window.MathfieldElement.playSound("plonk"),a.flushInlineShortcutBuffer();else if(y==="delete")ee=Kc("deleted: ",E);else if(y==="focus"||y.includes("move"))ee=a1(a.model,b)+(a.model.selectionIsCollapsed?"":"selected: ")+o1(a.model);else if(y==="replacement")ee=Kc("",a.model.at(a.model.position));else if(y==="line"){const re=Kc("",a.model.root);a.keyboardDelegate.setAriaLabel(re)}else ee=E?Kc(y+" ",E):y;if(ee){const re=a.ariaLiveText.textContent.includes("\xA0")?" \u202F ":" \xA0 ";a.ariaLiveText.textContent=ee+re}}function a1(a,y){if(Number.isNaN(y))return"";const b=a.at(y);if(!b||b.treeDepth<=a.at(a.position).treeDepth)return"";let E="",ee=b.parent;const re=a.at(a.position).parent;for(;ee!==a.root&&ee!==re;)E+=`out of ${pp(ee)};`,ee=ee.parent;return E}function o1(a){if(!a.selectionIsCollapsed)return Kc("",a.getAtoms(a.selection));let y="";const b=a.at(a.position),E=pp(b);return b.isFirstSibling&&(y=(E?"start of "+E:"unknown")+": "),b.isLastSibling?b.isFirstSibling||(y+=E?"end of "+E:"unknown"):y+=Kc("",b),y}var s1=class{constructor(a,y,b){this.mathfield=a,this.mode=y,this.silenceNotifications=!1,this._selection={ranges:[[0,0]],direction:"none"},this._anchor=0,this._position=0,this.root=b}dispose(){this.mathfield=void 0}getState(){const a={ranges:[...this._selection.ranges]};return this.selection.direction&&this.selection.direction!=="none"&&(a.direction=this.selection.direction),{content:this.root.toJson(),selection:a,mode:this.mode}}setState(a,y){var b;const E=this.silenceNotifications;this.silenceNotifications=(b=y==null?void 0:y.silenceNotifications)!=null?b:!0;let ee={};if((y==null?void 0:y.type)==="undo"&&(ee={inputType:"historyUndo"}),(y==null?void 0:y.type)==="redo"&&(ee={inputType:"historyRedo"}),this.contentWillChange(ee)){const re=this.silenceNotifications;this.silenceNotifications=!0,this.mode=a.mode,this.root=du(a.content),this.selection=a.selection,this.silenceNotifications=re,this.contentDidChange(ee)}this.silenceNotifications=E}get atoms(){return this.root.children}get selection(){return this._selection}set selection(a){this.setSelection(a)}setSelection(a,y){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{var b,E,ee;const re=this.normalizeSelection(a,y);if(re===void 0)throw new TypeError("Invalid selection");if(re.ranges.length===1&&re.ranges[0][0]===re.ranges[0][1]){const xe=re.ranges[0][0];if(!this.mathfield.dirty&&!((b=this.at(xe))!=null&&b.parentPrompt)&&this.mathfield.hasEditablePrompts){if((E=this.at(xe-1))!=null&&E.parentPrompt){this._anchor=this.normalizeOffset(xe-1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}if((ee=this.at(xe+1))!=null&&ee.parentPrompt){this._anchor=this.normalizeOffset(xe+1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}this._anchor=0,this._position=0,this._selection={ranges:[[0,0]]};return}this._anchor=xe,this._position=xe,this._selection=re;return}const ae=jo(re);re.direction==="backward"?[this._position,this._anchor]=ae:[this._anchor,this._position]=ae;const de=this.at(ae[0]+1),fe=this.at(ae[1]),ge=In.commonAncestor(de,fe);(ge==null?void 0:ge.type)==="array"&&de.parent===ge&&fe.parent===ge?this._selection={ranges:[ae],direction:re.direction}:this._selection={ranges:[ae],direction:re.direction},console.assert(this._position>=0&&this._position<=this.lastOffset)})}setPositionHandlingPlaceholder(a){var y;const b=this.at(a);(b==null?void 0:b.type)==="placeholder"?this.setSelection(a-1,a):((y=b==null?void 0:b.rightSibling)==null?void 0:y.type)==="placeholder"?this.setSelection(a,a+1):this.position=a,b instanceof ns&&b.isSuggestion&&(b.isSuggestion=!1),this.mathfield.stopCoalescingUndo()}get position(){return this._position}set position(a){this.setSelection(a,a)}get anchor(){return this._anchor}get selectionIsCollapsed(){return this._anchor===this._position}get selectionIsPlaceholder(){return Math.abs(this._anchor-this._position)===1?this.at(Math.max(this._anchor,this._position)).type==="placeholder":!1}collapseSelection(a="forward"){return this._anchor===this._position?!1:(a==="backward"?this.position=Math.min(this._anchor,this._position):this.position=Math.max(this._anchor,this._position),!0)}get lastOffset(){return this.atoms.length-1}at(a){return this.atoms[a]}offsetOf(a){return this.atoms.indexOf(a)}getSiblingsRange(a){const y=this.at(a),{parent:b}=y;if(!b)return[0,this.lastOffset];const E=y.parent.branch(y.parentBranch);return[this.offsetOf(E[0]),this.offsetOf(E[E.length-1])]}getBranchRange(a,y){const b=this.at(a).branch(y);return[this.offsetOf(b[0]),this.offsetOf(b[b.length-1])]}getAtoms(a,y,b){let E=b!=null?b:{};if(wc(a)){if(E=y!=null?y:{},a.ranges.length>1)return a.ranges.reduce((ge,xe)=>[...ge,...this.getAtoms(xe,E)],[]);a=a.ranges[0]}let ee,re;if(gl(a)){if(ee=a,!gl(y))return[];re=y}else[ee,re]=a,E=y!=null?y:{};if(!Number.isFinite(ee))return[];E.includeChildren===void 0&&(E.includeChildren=!1),ee<0&&(ee=this.lastOffset-ee+1),re<0&&(re=this.lastOffset-re+1);const ae=Math.min(ee,re)+1,de=Math.max(ee,re);if(!E.includeChildren&&ae===1&&de===this.lastOffset)return[this.root];let fe=[];for(let ge=ae;ge<=de;ge++){const xe=this.atoms[ge];mp(this,xe,ae,de)&&fe.push(xe)}return E.includeChildren||(fe=fe.filter(ge=>{let xe=!1,{parent:Be}=ge;for(;Be&&!xe;)xe=mp(this,Be,ae,de),Be=Be.parent;return!xe})),fe}getAllAtoms(a=0){const y=[],b=this.lastOffset;for(let E=a;E<=b;E++)y.push(this.atoms[E]);for(let E=0;E<a;E++)y.push(this.atoms[E]);return y}findAtom(a,y=0,b="forward"){let E;const ee=this.lastOffset;if(b==="forward"){for(let re=y;re<=ee;re++)if(E=this.atoms[re],a(E))return E;for(let re=0;re<y;re++)if(E=this.atoms[re],a(E))return E;return}for(let re=y;re>=0;re--)if(E=this.atoms[re],a(E))return E;for(let re=ee;re>y;re--)if(E=this.atoms[re],a(E))return E}extractAtoms(a){let y=this.getAtoms(a);if(y.length===1&&!y[0].parent)if(y[0].type==="root")y=[...y[0].body],y.shift();else return y=this.root.cells.flat(),this.root=new In({type:"root",body:[]}),y;for(const b of y)b.parent.removeChild(b);return y}deleteAtoms(a){this.extractAtoms(a),this.position=a[0]}atomToString(a,y){const b=y!=null?y:"latex";if(b.startsWith("latex"))return In.serialize([a],{expandMacro:b==="latex-expanded",skipStyles:b==="latex-unstyled",skipPlaceholders:b==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode});if(b==="math-ml")return Ka(a);if(b==="spoken")return $c(a);if(b==="spoken-text"){const E=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="";const ee=$c(a);return window.MathfieldElement.textToSpeechMarkup=E,ee}if(b==="spoken-ssml"||b==="spoken-ssml-with-highlighting"){const E=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="ssml";const ee=$c(a);return window.MathfieldElement.textToSpeechMarkup=E,ee}return b==="ascii-math"?ko(a):(console.error(`MathLive 0.98.5: Unexpected format "${b}`),"")}getValue(a,y,b){if(a===void 0)return this.atomToString(this.root,"latex");if(typeof a=="string"&&a!=="math-json")return this.atomToString(this.root,a);let E,ee;if(gl(a)&&gl(y)?(E=[this.normalizeRange([a,y])],ee=b):xc(a)?(E=[this.normalizeRange(a)],ee=y):wc(a)?(E=a.ranges,ee=y):(E=[this.normalizeRange([0,-1])],ee=a),ee!=null||(ee="latex"),ee==="math-json"){if(!window.MathfieldElement.computeEngine)return window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`),'["Error", "compute-engine-not-available"]';const re=this.getValue({ranges:E},"latex-unstyled");try{const ae=window.MathfieldElement.computeEngine.parse(re);return JSON.stringify(ae.json)}catch(ae){return JSON.stringify(["Error",`'${ae.toString()}'`])}}if(ee.startsWith("latex")){const re={expandMacro:ee==="latex-expanded",skipStyles:ee==="latex-unstyled",skipPlaceholders:ee==="latex-without-placeholders",defaultMode:this.mathfield.options.defaultMode};return na(E.map(ae=>In.serialize(this.getAtoms(ae),re)))}return E.map(re=>this.getAtoms(re).map(ae=>this.atomToString(ae,ee)).join("")).join("")}extendSelectionTo(a,y){return!this.mathfield.contentEditable&&this.mathfield.userSelect==="none"?!1:this.deferNotifications({selection:!0},()=>{const b=this.normalizeRange([a,y]);let[E,ee]=b,{parent:re}=this.at(ee);if(re&&(re.type==="genfrac"||re.type==="subsup"))for(;re!==this.root&&Jh(this,re,[E,ee]);)ee=this.offsetOf(re),re=re.parent;for(re=this.at(E).parent;re!==this.root&&Jh(this,re,[E,ee]);)E=this.offsetOf(re.leftSibling),re=re.parent;if(re=this.at(ee).parent,(re==null?void 0:re.type)==="genfrac")for(;re!==this.root&&Jh(this,re,[E,ee]);)ee=this.offsetOf(re),console.assert(ee>=0),re=re.parent;this._position=this.normalizeOffset(y),this._selection={ranges:[[E,ee]],direction:"none"}})}announce(a,y,b=[]){var E,ee;((ee=(E=this.mathfield.host)==null?void 0:E.dispatchEvent(new CustomEvent("announce",{detail:{command:a,previousPosition:y,atoms:b},cancelable:!0,bubbles:!0,composed:!0})))!=null?ee:!0)&&i1(this.mathfield,a,y,b)}deferNotifications(a,y){const b=this._selection,E=this._anchor,ee=this._position,re=this.silenceNotifications;this.silenceNotifications=!0;const ae=this.root.changeCounter;y();const de=this.root.changeCounter!==ae,fe=E!==this._anchor||ee!==this._position||Pu(this._selection,b)==="different";return this.silenceNotifications=re,a.content&&de&&this.contentDidChange({inputType:a.type}),a.selection&&fe&&this.selectionDidChange(),de||fe}normalizeOffset(a){return a>0?a=Math.min(a,this.lastOffset):a<0&&(a=this.lastOffset+a+1),a}normalizeRange(a){let[y,b]=a;return y=this.normalizeOffset(y),b=this.normalizeOffset(b),y<b?[y,b]:[b,y]}normalizeSelection(a,y){var b;let E;if(gl(a)){const ee=this.normalizeOffset(a);if(gl(y)){const re=this.normalizeOffset(y);E=ee<=re?{ranges:[[ee,re]],direction:"none"}:{ranges:[[re,ee]],direction:"backward"}}else E={ranges:[[ee,ee]],direction:"none"}}else if(xc(a)){const ee=this.normalizeOffset(a[0]),re=this.normalizeOffset(a[1]);E=ee<=re?{ranges:[[ee,re]],direction:"none"}:{ranges:[[re,ee]],direction:"backward"}}else wc(a)&&(E={ranges:a.ranges.map(ee=>this.normalizeRange(ee)),direction:(b=a.direction)!=null?b:"none"});return console.assert(E!==void 0),E}get parentEnvironment(){let a=this.at(this.position).parent;if(a){for(;a.parent&&a.type!=="array";)a=a.parent;if(a.type==="array")return a}}get cell(){var a;let y=this.at(this.position);if(y){for(;y&&((a=y.parent)==null?void 0:a.type)!=="array";)y=y.parent;if(!(!(y!=null&&y.parent)||y.parent.type!=="array"))return y.parentBranch}}contentWillChange(a={}){if(this.silenceNotifications||!this.mathfield)return!0;const y=this.silenceNotifications;this.silenceNotifications=!0;const b=this.mathfield.onContentWillChange(a);return this.silenceNotifications=y,b}contentDidChange(a){var y;if(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Ml(this.mathfield)),this.silenceNotifications||!this.mathfield.host||!this.mathfield)return;const b=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.host.dispatchEvent(new InputEvent("input",he(we({},a),{data:a.data?a.data:(y=a.inputType)!=null?y:"",bubbles:!0,composed:!0}))),this.silenceNotifications=b}selectionDidChange(){if(!this.mathfield||(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Ml(this.mathfield)),this.silenceNotifications))return;const a=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.onSelectionDidChange(),this.silenceNotifications=a}};function mp(a,y,b,E){const ee=a.offsetOf(y);if(ee<b||ee>E)return!1;if(!y.hasChildren)return!0;const re=a.offsetOf(y.firstChild);if(re>=b&&re<=E){const ae=a.offsetOf(y.lastChild);if(ae>=b&&ae<=E)return!0}return!1}function Jh(a,y,b){if(!(y!=null&&y.hasChildren))return!1;const[E,ee]=b,re=a.offsetOf(y.firstChild),ae=a.offsetOf(y.lastChild);return re>=E&&re<=ee&&ae>=re&&ae<=ee}function Kd(a,y,b,E){var ee,re,ae,de,fe,ge;const xe=b.parent;if(xe&&b instanceof za){const Be=!E&&y==="forward"||E==="body"&&y==="backward";let Ve=Be?a.offsetOf(b.firstChild):a.offsetOf(b.lastChild);return Be?b.rightDelim!=="?"&&b.rightDelim!=="."?(b.leftDelim=".",b.isDirty=!0):(xe.addChildrenAfter(b.removeBranch("body"),b),xe.removeChild(b),Ve--):b.leftDelim!=="?"&&b.leftDelim!=="."?(b.rightDelim=".",b.isDirty=!0):(xe.addChildrenAfter(b.removeBranch("body"),b),xe.removeChild(b),Ve--),a.position=Ve,!0}if(xe&&b.type==="surd"){if(y==="forward"&&!E||y==="backward"&&E==="body"){const Be=b.leftSibling;b.hasChildren&&xe.addChildrenAfter(b.removeBranch("body"),b),xe.removeChild(b),a.position=a.offsetOf(Be)}else y==="forward"&&E==="body"?a.position=a.offsetOf(b):!E&&y==="backward"?b.hasChildren?a.position=a.offsetOf(b.lastChild):(a.position=Math.max(0,a.offsetOf(b)-1),xe.removeChild(b)):E==="above"&&(b.hasEmptyBranch("above")&&b.removeBranch("above"),y==="backward"?a.position=a.offsetOf(b.leftSibling):a.position=a.offsetOf(b.body[0]));return!0}if(xe&&(b.type==="box"||b.type==="enclose")){const Be=E&&y==="backward"||!E&&y==="forward"?b.leftSibling:b.lastChild;return xe.addChildrenAfter(b.removeBranch("body"),b),xe.removeChild(b),a.position=a.offsetOf(Be),!0}if(b.type==="genfrac"||b.type==="overunder"){if(!E)return b.type==="overunder"&&b.hasEmptyBranch("body")||b.type==="genfrac"&&b.hasEmptyBranch("below")&&b.hasEmptyBranch("above")?!1:(a.position=a.offsetOf(y==="forward"?b.firstChild:b.lastChild),!0);const Be=Hd.fractionNavigationOrder==="numerator-denominator"?"above":"below",Ve=Be==="above"?"below":"above";if(xe&&(y==="forward"&&E===Be||y==="backward"&&E===Ve)){const ot=b.removeBranch(Be),gt=b.removeBranch(Ve);return xe.addChildrenAfter([...ot,...gt],b),xe.removeChild(b),a.position=a.offsetOf(ot.length>0?ot[ot.length-1]:gt[0]),!0}return y==="backward"?a.position=a.offsetOf(b.leftSibling):a.position=a.offsetOf(b),!0}if(b.isExtensibleSymbol||b.type==="subsup"){if(!E&&y==="forward")return!1;if(!E){if(b.subscript||b.superscript){const Be=y==="forward"?(ae=(ee=b.superscript)==null?void 0:ee[0])!=null?ae:(re=b.subscript)==null?void 0:re[0]:(ge=(de=b.subscript)==null?void 0:de[0].lastSibling)!=null?ge:(fe=b.superscript)==null?void 0:fe[0].lastSibling;return Be&&(a.position=a.offsetOf(Be)),!0}return!1}if(!b.hasChildren&&b.type==="subsup"){const Be=y==="forward"?a.offsetOf(b):Math.max(0,a.offsetOf(b)-1);return b.parent.removeChild(b),a.position=Be,!0}if(E==="superscript")if(y==="backward"){const Be=a.offsetOf(b.firstChild)-1;console.assert(Be>=0),a.position=Be}else b.subscript?a.position=a.offsetOf(b.subscript[0]):a.position=a.offsetOf(b);else E==="subscript"&&(y==="backward"&&b.superscript?a.position=a.offsetOf(b.superscript[0].lastSibling):y==="backward"?a.position=a.offsetOf(b.firstChild)-1:a.position=a.offsetOf(b));if(E&&b.hasEmptyBranch(E)&&(b.removeBranch(E),b.type==="subsup"&&!b.subscript&&!b.superscript)){const Be=y==="forward"?a.offsetOf(b):Math.max(0,a.offsetOf(b)-1);b.parent.removeChild(b),a.position=Be}return!0}if((xe==null?void 0:xe.type)==="genfrac"&&!E&&b.type!=="first"){let Be=a.offsetOf(b.leftSibling);return xe.removeChild(b),xe.hasEmptyBranch("above")&&xe.hasEmptyBranch("below")?(Be=a.offsetOf(xe.leftSibling),xe.parent.removeChild(xe),a.announce("delete",void 0,[xe]),a.position=Be,!0):(a.announce("delete",void 0,[b]),a.position=Be,!0)}if(y==="backward"&&((xe==null?void 0:xe.command)==="\\ln"||(xe==null?void 0:xe.command)==="\\log")&&b.parentBranch!=="body"){const Be=a.offsetOf(xe.leftSibling);return xe.parent.removeChild(xe),a.announce("delete",void 0,[xe]),a.position=Be,!0}return!1}function l1(a){return!a.mathfield.isSelectionEditable||!a.contentWillChange({inputType:"deleteContentBackward"})?!1:a.selectionIsCollapsed?a.deferNotifications({content:!0,selection:!0,type:"deleteContentBackward"},()=>{let y=a.at(a.position);if(!(y&&Kd(a,"backward",y))){if(y!=null&&y.isFirstSibling){if(Kd(a,"backward",y.parent,y.parentBranch))return;y=null}if(!y){a.announce("plonk");return}a.position=a.offsetOf(y.leftSibling),y.parent.removeChild(y),a.announce("delete",void 0,[y])}}):_l(a,jo(a.selection),"deleteContentBackward")}function u1(a){return!a.mathfield.isSelectionEditable||!a.contentWillChange({inputType:"deleteContentForward"})?!1:a.selectionIsCollapsed?a.deferNotifications({content:!0,selection:!0,type:"deleteContentForward"},()=>{var y,b;let E=a.at(a.position).rightSibling;if(E&&Kd(a,"forward",E))return;if(E){if(a.at(a.position).isLastSibling&&Kd(a,"forward",E.parent,E.parentBranch))return}else{if(E=a.at(a.position),E.isLastSibling&&Kd(a,"forward",E.parent,E.parentBranch))return;E=void 0}if(a.position===a.lastOffset||!E){a.announce("plonk");return}E.parent.removeChild(E);let ee=(y=a.at(a.position))==null?void 0:y.rightSibling;for(;(ee==null?void 0:ee.type)==="subsup";)ee.parent.removeChild(ee),ee=(b=a.at(a.position))==null?void 0:b.rightSibling;a.announce("delete",void 0,[E])}):_l(a,jo(a.selection),"deleteContentForward")}function _l(a,y,b){const E=a.getAtoms(y);if(E.length>0&&E[0].parent){let ee=E[0].parent.firstChild;ee.type==="first"&&(ee=ee.rightSibling);const re=E[E.length-1].parent.lastChild;let ae=E[0];ae.type==="first"&&(ae=ae.rightSibling);const de=E[E.length-1];if(ae===ee&&de===re){const fe=E[0].parent;fe.parent&&fe.type!=="prompt"&&(y=[a.offsetOf(fe.leftSibling),a.offsetOf(fe)])}if(E.length===1&&E[0].type==="placeholder"&&E[0].parent.type==="genfrac"){const fe=E[0].parent,ge=E[0].parentBranch==="below"?"above":"below",xe=a.offsetOf(fe.leftSibling);return a.deferNotifications({content:!0,selection:!0,type:b},()=>{var Be,Ve;const ot=fe.removeBranch(ge);if(ot.length===1&&ot[0].type==="placeholder")(Ve=fe.parent)==null||Ve.removeChild(fe),a.position=Math.max(0,xe);else{const gt=fe.parent.addChildrenAfter(ot,fe);(Be=fe.parent)==null||Be.removeChild(fe),a.position=a.offsetOf(gt)}})}}return a.deferNotifications({content:!0,selection:!0,type:b},()=>a.deleteAtoms(y))}Ls({deleteAll:a=>a.contentWillChange({inputType:"deleteContent"})&&_l(a,[0,-1],"deleteContent"),deleteForward:a=>u1(a),deleteBackward:a=>l1(a),deleteNextWord:a=>a.contentWillChange({inputType:"deleteWordForward"})&&_l(a,[a.anchor,kh(a,a.position,"forward")],"deleteWordForward"),deletePreviousWord:a=>a.contentWillChange({inputType:"deleteWordBackward"})&&_l(a,[a.anchor,kh(a,a.position,"backward")],"deleteWordBackward"),deleteToGroupStart:a=>a.contentWillChange({inputType:"deleteSoftLineBackward"})&&_l(a,[a.anchor,a.offsetOf(a.at(a.position).firstSibling)],"deleteSoftLineBackward"),deleteToGroupEnd:a=>a.contentWillChange({inputType:"deleteSoftLineForward"})&&_l(a,[a.anchor,a.offsetOf(a.at(a.position).lastSibling)],"deleteSoftLineForward"),deleteToMathFieldStart:a=>a.contentWillChange({inputType:"deleteHardLineBackward"})&&_l(a,[a.anchor,0],"deleteHardLineBackward"),deleteToMathFieldEnd:a=>a.contentWillChange({inputType:"deleteHardLineForward"})&&_l(a,[a.anchor,-1],"deleteHardLineForward")},{target:"model",audioFeedback:"delete",canUndo:!0,changeContent:!0,changeSelection:!0});var c1=`<svg xmlns="http://www.w3.org/2000/svg" style="width: 21px;" viewBox="0 0 576 512" role="img" aria-label="${lt("tooltip.toggle virtual keyboard")}"><path d="M528 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h480c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm16 336c0 8.823-7.177 16-16 16H48c-8.823 0-16-7.177-16-16V112c0-8.823 7.177-16 16-16h480c8.823 0 16 7.177 16 16v288zM168 268v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-336 80v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm384 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zM120 188v-24c0-6.627-5.373-12-12-12H84c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm96 0v-24c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v24c0 6.627 5.373 12 12 12h24c6.627 0 12-5.373 12-12zm-96 152v-8c0-6.627-5.373-12-12-12H180c-6.627 0-12 5.373-12 12v8c0 6.627 5.373 12 12 12h216c6.627 0 12-5.373 12-12z"/></svg>`,d1=`<svg xmlns="http://www.w3.org/2000/svg" style="height: 18px;" viewBox="0 0 448 512" role="img" aria-label="${lt("tooltip.menu")}"><path d="M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"/></svg>`,f1=class{constructor(a,y){this.focusBlurInProgress=!1;var b,E,ee;this.options=we(he(we({},Of()),{macros:Nr(),registers:ou()}),Bf(y)),this.eventController=new AbortController;const re=this.eventController.signal;y.eventSink&&(this.host=y.eventSink),this.element=a,a.mathfield=this,this.blurred=!0,this.keystrokeCaptionVisible=!1,this.suggestionIndex=0,this.inlineShortcutBuffer=[],this.inlineShortcutBufferFlushTimer=0,this.defaultStyle={},this.adoptStyle="left",this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline"),this.dirty=!1;let ae=(E=(b=y.value)!=null?b:this.element.textContent)!=null?E:"";ae=ae.trim();const de=A0(this.options),fe=new In({type:"root",mode:de,body:Xo(ae,{context:this.context})});this.model=new s1(this,de,fe),this.undoManager=new Ng(this.model);const ge=[];if(ge.push("<span contenteditable=true aria-multiline=false part=keyboard-sink class=ML__keyboard-sink autocapitalize=off autocomplete=off autocorrect=off spellcheck=false inputmode=none tabindex=0></span>"),ge.push('<span part=container class=ML__container aria-hidden=true style="visibility:hidden">'),ge.push("<span part=content class=ML__content>"),ge.push(w0(this)),ge.push("</span>"),window.mathVirtualKeyboard&&(ge.push(`<div part=virtual-keyboard-toggle class=ML__virtual-keyboard-toggle role=button ${this.hasEditableContent?"":'style="display:none;"'} data-l10n-tooltip="tooltip.toggle virtual keyboard">`),ge.push(c1),ge.push("</div>")),ge.push('<div part=menu-toggle class=ML__menu-toggle role=button data-l10n-tooltip="tooltip.menu">'),ge.push(d1),ge.push("</div>"),ge.push("</span>"),ge.push("<span class=ML__sr-only>"),ge.push("<span role=status aria-live=assertive aria-atomic=true></span>"),ge.push("</span>"),this.element.innerHTML=window.MathfieldElement.createHTML(ge.join("")),!this.element.children){console.error("%cMathLive 0.98.5: Something went wrong and the mathfield could not be created.%c\nIf you are using Vue, this may be because you are using the runtime-only build of Vue. Make sure to include `runtimeCompiler: true` in your Vue configuration. There may a warning from Vue in the log above.","color:red;font-family:system-ui;font-size:1.2rem;font-weight:bold","color:inherit;font-family:system-ui;font-size:inherit;font-weight:inherit");return}this._l10Subscription=et.subscribe(()=>et.update(this.element)),et.update(this.element),this.field=this.element.querySelector("[part=content]"),this.field.addEventListener("click",Be=>Be.stopImmediatePropagation(),{capture:!1,signal:re}),this.field.addEventListener("wheel",this,{passive:!1,signal:re}),"PointerEvent"in window?this.field.addEventListener("pointerdown",this,{signal:re}):this.field.addEventListener("mousedown",this,{signal:re}),(ee=this.element.querySelector("[part=virtual-keyboard-toggle]"))==null||ee.addEventListener("click",()=>{window.mathVirtualKeyboard.visible?window.mathVirtualKeyboard.hide():(window.mathVirtualKeyboard.show({animate:!0}),window.mathVirtualKeyboard.update(Ml(this)))},{signal:re}),this._menu=new Sv(Jv(this),{host:this.host}),this.field.addEventListener("contextmenu",this,{signal:re});const xe=this.element.querySelector("[part=menu-toggle]");xe==null||xe.addEventListener("pointerdown",Be=>{if(Be.currentTarget!==xe||this._menu.state!=="closed")return;this.element.classList.add("tracking");const Ve=xe.getBoundingClientRect();this._menu.modifiers=Nu(Be),this._menu.show({target:xe,location:{x:Ve.left,y:Ve.bottom},onDismiss:()=>this.element.classList.remove("tracking")}),Be.preventDefault(),Be.stopPropagation()},{signal:re}),(this.model.atoms.length<=1||this.disabled||this.readOnly&&!this.hasEditableContent||this.userSelect==="none")&&(xe.style.display="none"),this.ariaLiveText=this.element.querySelector("[role=status]"),this.keyboardDelegate=Hm(this.element.querySelector(".ML__keyboard-sink"),this.element,this),window.addEventListener("resize",this,{signal:re}),document.addEventListener("scroll",this,{signal:re}),this.resizeObserver=new ResizeObserver(()=>Mo(this)),this.resizeObserver.observe(this.field),window.mathVirtualKeyboard.addEventListener("virtual-keyboard-toggle",this,{signal:re}),_d&&!et.locale.startsWith(_d.locale)&&Fm(et.locale),Fs!=="ready"&&document.fonts.ready.then(()=>Af(this)),a.querySelector("[part=container]").style.removeProperty("visibility"),this.undoManager.startRecording(),this.undoManager.snapshot("set-value")}get defaultStyle(){return this._defaultStyle}set defaultStyle(a){this._defaultStyle=a}get effectiveStyle(){if(this.adoptStyle==="none")return this.defaultStyle;const a=this.model.at(this.model.position),y=this.adoptStyle==="right"?a.rightSibling:a;if(!y)return this.defaultStyle;if(y.type==="group"){const b=y.branch("body");return!b||b.length<2?{}:this.adoptStyle==="right"?b[1].computedStyle:b[b.length-1].computedStyle}return y.computedStyle}connectToVirtualKeyboard(){this.connectedToVirtualKeyboard||(this.connectedToVirtualKeyboard=!0,window.addEventListener("message",this,{signal:this.eventController.signal}),window.mathVirtualKeyboard.connect(),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Ml(this)),jf(this))}disconnectFromVirtualKeyboard(){this.connectedToVirtualKeyboard&&(window.removeEventListener("message",this),window.mathVirtualKeyboard.disconnect(),this.connectedToVirtualKeyboard=!1,Fh())}showMenu(a){var y,b;const E=(b=(y=a==null?void 0:a.location)!=null?y:bl(this.field))!=null?b:void 0,ee=a==null?void 0:a.modifiers,re=this.element.querySelector("[part=container]");return this._menu.show({target:re,location:E,modifiers:ee})}get colorMap(){return a=>{var y,b,E;return(E=(b=(y=this.options).colorMap)==null?void 0:b.call(y,a))!=null?E:xt(a)}}get backgroundColorMap(){return a=>{var y,b,E,ee,re,ae;return(ae=(re=(b=(y=this.options).backgroundColorMap)==null?void 0:b.call(y,a))!=null?re:(ee=(E=this.options).colorMap)==null?void 0:ee.call(E,a))!=null?ae:Ge(a)}}get smartFence(){var a;return(a=this.options.smartFence)!=null?a:!1}get readOnly(){var a;return(a=this.options.readOnly)!=null?a:!1}get disabled(){var a,y;return(y=(a=this.host)==null?void 0:a.disabled)!=null?y:!1}get contentEditable(){return this.host?this.host.getAttribute("contenteditable")!=="false":!1}get userSelect(){if(!this.host)return"";const a=getComputedStyle(this.host);return a.getPropertyValue("user-select")||a.getPropertyValue("-webkit-user-select")}get hasEditableContent(){return this.disabled||!this.contentEditable?!1:!this.readOnly||this.hasEditablePrompts}get hasEditablePrompts(){return this.readOnly&&!this.disabled&&this.contentEditable&&this.model.findAtom(a=>a.type==="prompt"&&!a.locked)!==void 0}get isSelectionEditable(){if(this.disabled||!this.contentEditable)return!1;if(!this.readOnly)return!0;const a=this.model.at(this.model.anchor),y=this.model.at(this.model.position),b=In.commonAncestor(a,y);return!!((b==null?void 0:b.type)==="prompt"||b!=null&&b.parentPrompt)}get letterShapeStyle(){var a;return(a=this.options.letterShapeStyle)!=null?a:"tex"}get minFontScale(){return this.options.minFontScale}get selectionStyle(){if(this.model.selectionIsCollapsed)return this.effectiveStyle;const a=this.model.getAtoms(this.model.selection);if(a.length===0)return{};const y=we({},a[0].style);for(const b of a)for(const[E,ee]of Object.entries(b.style))y[E]!==ee&&delete y[E];return y}queryStyle(a){const y=Ph(this,a);"verbatimColor"in y&&delete y.verbatimColor,"verbatimBackgroundColor"in y&&delete y.verbatimBackgroundColor;const b=Object.keys(y).length;if(b===0)return"all";if(b>1){for(const fe of Object.keys(y)){const ge=this.queryStyle({[fe]:y[fe]});if(ge==="none")return"none";if(ge==="some")return"some"}return"all"}const E=Object.keys(y)[0],ee=y[E];if(this.model.selectionIsCollapsed)return this.effectiveStyle[E]===ee?"all":"none";const re=this.model.getAtoms(this.model.selection,{includeChildren:!0});let ae=re.length;if(ae===0)return"none";let de=0;for(const fe of re){if(fe.type==="first"){ae-=1;continue}fe.style[E]===ee&&(de+=1)}return de===0?"none":de===ae?"all":"some"}get keybindings(){var a,y;if(this._keybindings)return this._keybindings;const[b,E]=jm(this.options.keybindings,(a=kd())!=null?a:$m());return((y=kd())==null?void 0:y.score)>0&&(this._keybindings=b,E.length>0&&console.error("MathLive 0.98.5: Invalid keybindings for current keyboard layout",E)),b}get menu(){return this._menu}setOptions(a){var y;this.options=we(we({},this.options),Bf(a)),this._keybindings=void 0,this.options.defaultMode==="inline-math"?this.element.classList.add("ML__is-inline"):this.element.classList.remove("ML__is-inline");let b=this.options.defaultMode;b==="inline-math"&&(b="math"),((y=this.model.root.firstChild)==null?void 0:y.mode)!==b&&(this.model.root.firstChild.mode=b),this.options.readOnly&&this.hasFocus()&&window.mathVirtualKeyboard.visible&&this.executeCommand("hideVirtualKeyboard");const E=In.serialize([this.model.root],{expandMacro:!1,defaultMode:this.options.defaultMode});("macros"in a||this.model.getValue()!==E)&&Bi.insert(this.model,E,{insertionMode:"replaceAll",selectionMode:"after",format:"latex",silenceNotifications:!0,mode:"math"}),("value"in a||"macros"in a||"registers"in a||"colorMap"in a||"backgroundColorMap"in a||"letterShapeStyle"in a||"minFontScale"in a||"readOnly"in a||"placeholderSymbol"in a)&&Mo(this)}getOptions(a){return zu(this.options,a)}getOption(a){return zu(this.options,a)}handleEvent(a){return gu(this,null,function*(){var y;if(Os(this)){if(Ch(a)){if(!yd(a.origin,(y=this.options.originValidator)!=null?y:"none"))throw new DOMException(`Message from unknown origin (${a.origin}) cannot be handled`,"SecurityError");const{action:b}=a.data;if(b==="execute-command"){const E=a.data.command;if(Dc(E)==="virtual-keyboard")return;this.executeCommand(E)}else b==="update-state"||(b==="focus"?this.focus({preventScroll:!0}):b==="blur"&&this.blur());return}switch(a.type){case"focus":this.onFocus();break;case"blur":this.onBlur();break;case"mousedown":this.userSelect!=="none"&&V0(this,a);break;case"pointerdown":this.userSelect!=="none"&&(V0(this,a),a.shiftKey===!1&&(yield ip(a,this.element.querySelector("[part=container]"),this._menu))&&Wf.stop());break;case"contextmenu":this.userSelect!=="none"&&a.shiftKey===!1&&(yield ip(a,this.element.querySelector("[part=container]"),this._menu))&&Wf.stop();break;case"virtual-keyboard-toggle":this.hasFocus()&&jf(this);break;case"resize":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Os(this)&&this.onGeometryChange());break;case"scroll":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Os(this)&&this.onGeometryChange());break;case"wheel":this.onWheel(a);break;default:console.warn("Unexpected event type",a.type)}}})}dispose(){if(!Os(this))return;et.unsubscribe(this._l10Subscription),this.keyboardDelegate.dispose(),this.keyboardDelegate=void 0,this.eventController.abort(),this.eventController=void 0,this.resizeObserver.disconnect(),window.mathVirtualKeyboard.removeEventListener("virtual-keyboard-toggle",this),this.disconnectFromVirtualKeyboard(),this.model.dispose();const a=this.element;delete a.mathfield,this.element=void 0,this.host=void 0,this.field=void 0,this.ariaLiveText=void 0,Gg(),Qm(),mv()}flushInlineShortcutBuffer(a){if(a!=null||(a={defer:!1}),!a.defer){this.inlineShortcutBuffer=[],clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=0;return}this.options.inlineShortcutTimeout>0&&(clearTimeout(this.inlineShortcutBufferFlushTimer),this.inlineShortcutBufferFlushTimer=setTimeout(()=>this.flushInlineShortcutBuffer(),this.options.inlineShortcutTimeout))}executeCommand(a){return Dc(a)==="virtual-keyboard"?(this.focus({preventScroll:!0}),window.mathVirtualKeyboard.executeCommand(a),requestAnimationFrame(()=>window.mathVirtualKeyboard.update(Ml(this))),!1):og(this,a)}get errors(){return t0(this.model.getValue(),{context:this.context})}getValue(a,y,b){return this.model.getValue(a,y,b)}setValue(a,y){var b;y=y!=null?y:{mode:"math"},y.insertionMode===void 0&&(y.insertionMode="replaceAll"),(y.format===void 0||y.format==="auto")&&(y.format="latex"),(y.mode===void 0||y.mode==="auto")&&(y.mode=(b=ah(this.model,this.model.position))!=null?b:"math");const E=this.undoManager.canUndo();Bi.insert(this.model,a,y)&&(Mo(this),E||this.undoManager.reset(),this.undoManager.snapshot("set-value"))}get expression(){const a=window.MathfieldElement.computeEngine;return a?a.box(a.parse(this.model.getValue("latex-unstyled"))):(console.error("MathLive 0.98.5: no compute engine available. Make sure the Compute Engine library is loaded."),null)}scrollIntoView(){var a;if(!this.element)return;if(this.host){if(this.options.onScrollIntoView)this.options.onScrollIntoView(this);else if(this.host.scrollIntoView({block:"nearest",inline:"nearest"}),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.container===window.document.body){const E=window.mathVirtualKeyboard.boundingRect,ee=this.host.getBoundingClientRect();ee.bottom>E.top&&((a=window.document.scrollingElement)==null||a.scrollBy(0,ee.bottom-E.top+8))}}this.dirty&&Fu(this,{interactive:!0});const y=this.field.getBoundingClientRect();let b=null;if(this.model.selectionIsCollapsed)b=bl(this.field);else{const E=vd(this);if(E.length>0){let ee=-1/0,re=-1/0;for(const ae of E)ae.right>ee&&(ee=ae.right),ae.top<re&&(re=ae.top);b={x:ee+y.left-this.field.scrollLeft,y:re+y.top-this.field.scrollTop,height:0}}}if(this.host&&b){const E=this.host.getBoundingClientRect(),ee=b.y;let re=this.host.scrollTop;ee<E.top?re=ee-E.top+this.host.scrollTop:ee>E.bottom&&(re=ee-E.bottom+this.host.scrollTop+b.height),this.host.scroll({top:re,left:0})}if(b){const E=b.x-window.scrollX;let ee=this.field.scrollLeft;E<y.left?ee=E-y.left+this.field.scrollLeft-20:E>y.right&&(ee=E-y.right+this.field.scrollLeft+20),this.field.scroll({top:this.field.scrollTop,left:ee})}}insert(a,y){return typeof a!="string"||a.length===0&&((y==null?void 0:y.insertionMode)==="insertBefore"||(y==null?void 0:y.insertionMode)==="insertAfter")||a.length===0&&this.model.selectionIsCollapsed?!1:(this.flushInlineShortcutBuffer(),y=y!=null?y:{mode:"math"},y.focus&&this.focus(),y.feedback&&(window.MathfieldElement.keypressVibration&&Xe()&&navigator.vibrate(S0),window.MathfieldElement.playSound("keypress")),a==="\\\\"?T0(this.model):a==="&"?D0(this.model):this.model.selectionIsCollapsed?Bi.insert(this.model,a,we({style:this.model.at(this.model.position).computedStyle},y)):Bi.insert(this.model,a,y),this.snapshot(`insert-${this.model.at(this.model.position).type}`),Mo(this),y.scrollIntoView&&this.scrollIntoView(),!0)}switchMode(a,y="",b=""){var E;if(this.model.mode===a||!this.hasEditableContent||!this.contentEditable||this.disabled)return;const ee=this.model.mode;if(this.model.mode=a,!((E=this.host)!=null&&E.dispatchEvent(new Event("mode-change",{bubbles:!0,composed:!0,cancelable:!0})))){this.model.mode=ee;return}const re=this.model.mode,{model:ae}=this;ae.deferNotifications({content:!!b||!!y,selection:!0,type:"insertText"},()=>{let de=!1;if(this.flushInlineShortcutBuffer(),this.stopCoalescingUndo(),y&&a!=="latex"){const fe=Xo(y,{context:this.context,parseMode:a});ae.collapseSelection("forward");const ge=ae.at(ae.position);ae.position=ae.offsetOf(ge.parent.addChildrenAfter(fe,ge)),de=!0}if(this.model.mode=a,a==="latex"){let fe=ae.selectionIsCollapsed;Ac(this,"accept");let ge,xe=ae.at(ae.position);if(fe)ge="\\";else{const Ve=jo(ae.selection);ge=this.model.getValue(Ve,"latex");const ot=this.model.extractAtoms(Ve);ot.length===1&&ot[0].type==="placeholder"&&(ge=y,fe=!0),xe=ae.at(Ve[0])}const Be=new xd(ge);xe.parent.addChildAfter(Be,xe),fe?ae.position=ae.offsetOf(Be.lastChild):ae.setSelection(ae.offsetOf(Be.firstChild),ae.offsetOf(Be.lastChild))}else Ld(ae).forEach(fe=>{fe.isError=!1});if(b){const fe=Xo(b,{context:this.context,parseMode:re});ae.collapseSelection("forward");const ge=ae.at(ae.position);ae.position=ae.offsetOf(ge.parent.addChildrenAfter(fe,ge)),de=!0}return Mo(this),this.undoManager.snapshot(a==="latex"?"insert-latex":"insert"),de}),this.model.mode=a,window.mathVirtualKeyboard.update(Ml(this))}hasFocus(){return!this.blurred}focus(a){var y;this.hasFocus()||(this.keyboardDelegate.focus(),this.connectToVirtualKeyboard(),this.onFocus(),this.model.announce("line")),(y=a==null?void 0:a.preventScroll)!=null&&y||this.scrollIntoView()}blur(){this.disconnectFromVirtualKeyboard(),this.hasFocus()&&this.keyboardDelegate.blur()}select(){this.model.selection={ranges:[[0,this.model.lastOffset]]},this.focus()}applyStyle(a,y={}){var b,E;const ee={operation:"set",silenceNotifications:!1};xc(y)?ee.range=y:(y.operation==="toggle"&&(ee.operation="toggle"),ee.range=y.range,ee.silenceNotifications=(b=y.silenceNotifications)!=null?b:!1);const re=Ph(this,a),ae=(E=ee.operation)!=null?E:"set";if(ee.range===void 0&&this.model.selectionIsCollapsed){if(ae==="set"){this.defaultStyle=we(we({},this.defaultStyle),re);return}const de=we({},this.defaultStyle);for(const fe of Object.keys(re))de[fe]===re[fe]?(fe==="color"&&delete de.verbatimColor,fe==="backgroundColor"&&delete de.verbatimBackgroundColor,delete de[fe]):de[fe]=re[fe];this.defaultStyle=de;return}this.model.deferNotifications({content:!ee.silenceNotifications,type:"insertText"},()=>{if(ee.range===void 0)for(const de of this.model.selection.ranges)Eh(this.model,de,re,{operation:ae});else Eh(this.model,ee.range,re,{operation:ae})}),Mo(this)}toggleContextMenu(){var a;return this._menu.visible?this._menu.state==="open"?(this._menu.hide(),!0):(this._menu.show({target:this.element.querySelector("[part=container]"),location:(a=this.getCaretPoint())!=null?a:void 0,onDismiss:()=>{var y;return(y=this.element)==null?void 0:y.focus()}}),!0):!1}getCaretPoint(){const a=bl(this.field);return a?{x:a.x,y:a.y}:null}setCaretPoint(a,y){const b=Rd(this,a,y,{bias:0});if(b<0)return!1;const E=this.model.position;return this.model.position=b,this.model.announce("move",E),Mo(this),!0}getPrompt(a){const y=this.model.findAtom(b=>b.type==="prompt"&&b.placeholderId===a);return console.assert(y!==void 0,"MathLive 0.98.5: no prompts with matching ID found"),y}getPromptValue(a,y){const b=this.getPrompt(a);if(!b)return"";const E=this.model.offsetOf(b.firstChild),ee=this.model.offsetOf(b.lastChild);return this.model.getValue(E,ee,y)}getPrompts(a){return this.model.getAllAtoms().filter(y=>y.type!=="prompt"?!1:a?!(a.id&&y.placeholderId!==a.id||a.locked&&y.locked!==a.locked||a.correctness==="undefined"&&y.correctness||a.correctness&&y.correctness!==a.correctness):!0).map(y=>y.placeholderId)}setPromptValue(a,y,b){if(y!==void 0){const E=this.getPrompt(a);if(!E){console.error(`MathLive 0.98.5: unknown prompt ${a}`);return}const ee=this.model.getBranchRange(this.model.offsetOf(E),"body");this.model.setSelection(ee),this.insert(y,he(we({},b),{insertionMode:"replaceSelection"}))}b!=null&&b.silenceNotifications&&(this.valueOnFocus=this.getValue()),Mo(this)}setPromptState(a,y,b){const E=this.getPrompt(a);if(!E){console.error(`MathLive 0.98.5: unknown prompt ${a}`);return}y==="undefined"?E.correctness=void 0:typeof y=="string"&&(E.correctness=y),typeof b=="boolean"&&(E.locked=b,E.captureSelection=b),Mo(this)}getPromptState(a){const y=this.getPrompt(a);return y?[y.correctness,y.locked]:(console.error(`MathLive 0.98.5: unknown prompt ${a}`),[void 0,!0])}getPromptRange(a){const y=this.getPrompt(a);return y?this.model.getBranchRange(this.model.offsetOf(y),"body"):(console.error(`MathLive 0.98.5: unknown prompt ${a}`),[0,0])}canUndo(){return this.undoManager.canUndo()}canRedo(){return this.undoManager.canRedo()}popUndoStack(){this.undoManager.pop()}snapshot(a){var y;this.undoManager.snapshot(a)&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Ml(this)),(y=this.host)==null||y.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"snapshot"}})))}stopCoalescingUndo(){this.undoManager.stopCoalescing(this.model.selection)}stopRecording(){this.undoManager.stopRecording()}startRecording(){this.undoManager.startRecording()}undo(){var a;this.undoManager.undo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Ml(this)),(a=this.host)==null||a.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}redo(){var a;this.undoManager.redo()&&(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Ml(this)),(a=this.host)==null||a.dispatchEvent(new CustomEvent("undo-state-change",{bubbles:!0,composed:!0,detail:{type:"undo"}})))}resetUndo(){var a;(a=this.undoManager)==null||a.reset()}onSelectionDidChange(){var a,y;const b=this.model;this.keyboardDelegate.setValue(b.getValue(this.model.selection,"latex-expanded"));{const E=b.at(b.position),ee=(a=E.mode)!=null?a:A0(this.options);this.model.mode!==ee&&(this.model.mode==="latex"?(Ac(this,"accept",{mode:ee}),b.position=b.offsetOf(E)):this.switchMode(ee))}(y=this.host)==null||y.dispatchEvent(new Event("selection-change",{bubbles:!0,composed:!0})),window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(Ml(this)),jf(this)}onContentWillChange(a){var y,b,E;return(E=(b=this.host)==null?void 0:b.dispatchEvent(new InputEvent("beforeinput",he(we({},a),{data:a.data?a.data:(y=a.inputType)!=null?y:"",cancelable:!0,bubbles:!0,composed:!0}))))!=null?E:!0}onFocus(){this.focusBlurInProgress||!this.blurred||(this.focusBlurInProgress=!0,this.blurred=!1,this.keyboardDelegate.focus(),this.stopCoalescingUndo(),Fu(this,{interactive:!0}),this.valueOnFocus=this.model.getValue(),this.hasEditablePrompts&&!this.model.at(this.model.anchor).parentPrompt&&this.executeCommand("moveToNextPlaceholder"),this.focusBlurInProgress=!1)}onBlur(){var a,y,b;if(this.focusBlurInProgress||this.blurred)return;this.focusBlurInProgress=!0,this.stopCoalescingUndo(),this.blurred=!0,this.ariaLiveText.textContent="",Tc(this),this.model.getValue()!==this.valueOnFocus&&((a=this.host)==null||a.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),this.disconnectFromVirtualKeyboard(),(y=this.host)==null||y.dispatchEvent(new Event("blur",{bubbles:!1,composed:!0})),(b=this.host)==null||b.dispatchEvent(new UIEvent("focusout",{bubbles:!0,composed:!0})),Mo(this),this.focusBlurInProgress=!1,Fh();const E=new AbortController,ee=E.signal;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&document.addEventListener("visibilitychange",()=>{Os(this)&&document.visibilityState==="visible"&&this.focus({preventScroll:!0})},{once:!0,signal:ee})},{once:!0,signal:ee}),setTimeout(()=>E.abort(),100)}onInput(a){Th(this,a)}onKeystroke(a){return K0(this,a)}onCompositionStart(a){this.model.deleteAtoms(jo(this.model.selection));const y=bl(this.field);y&&requestAnimationFrame(()=>{Fu(this),this.keyboardDelegate.moveTo(y.x,y.y-y.height)})}onCompositionUpdate(a){Lg(this.model,a),Mo(this)}onCompositionEnd(a){Ag(this.model),Th(this,a,{simulateKeystroke:!0})}onCut(a){if(!this.isSelectionEditable){this.model.announce("plonk");return}this.model.contentWillChange({inputType:"deleteByCut"})&&(this.stopCoalescingUndo(),Bi.onCopy(this,a),_l(this.model,jo(this.model.selection),"deleteByCut"),this.snapshot("cut"),Mo(this))}onCopy(a){Bi.onCopy(this,a)}onPaste(a){let y=this.isSelectionEditable;return y&&(y=Bi.onPaste(this.model.at(this.model.position).mode,this,a.clipboardData)),y||this.model.announce("plonk"),a.preventDefault(),a.stopPropagation(),y}onGeometryChange(){this._menu.hide(),_f(this),jf(this)}onWheel(a){const y=5*a.deltaX;if(!Number.isFinite(y)||y===0)return;const b=this.field;y<0&&b.scrollLeft===0||y>0&&b.offsetWidth+b.scrollLeft>=b.scrollWidth||(b.scrollBy({top:0,left:y}),a.preventDefault(),a.stopPropagation())}getHTMLElement(a){let y=a;for(;!y.id&&y.hasChildren;)y=a.children[0];return this.field.querySelector(`[data-atom-id="${y.id}"]`)}get context(){var a,y;return{registers:(a=this.options.registers)!=null?a:{},smartFence:this.smartFence,letterShapeStyle:this.letterShapeStyle,minFontScale:this.minFontScale,placeholderSymbol:(y=this.options.placeholderSymbol)!=null?y:"\u25A2",colorMap:b=>this.colorMap(b),backgroundColorMap:b=>this.backgroundColorMap(b),getMacro:b=>Da(b,this.options.macros),atomIdsSettings:{seed:"random",groupNumbers:!1}}}};function gp(a){if(a&&(a.classList.remove("ML__highlight"),a.children))for(const y of a.children)gp(y)}function Qh(a,y){var b;a&&(!y||((b=a.dataset)==null?void 0:b.atomId)===y?(a.classList.add("ML__highlight"),a.children&&a.children.length>0&&[...a.children].forEach(E=>{E instanceof HTMLElement&&Qh(E)})):(a.classList.remove("ML__highlight"),a.children&&a.children.length>0&&[...a.children].forEach(E=>{E instanceof HTMLElement&&Qh(E,y)})))}function h1(a,y){var b;if(!ut())return;if(window.MathfieldElement.speechEngine!=="amazon"){console.error("MathLive 0.98.5: Use Amazon TTS Engine for synchronized highlighting"),typeof window.MathfieldElement.speakHook=="function"&&window.MathfieldElement.speakHook(y);return}if(!window.AWS){console.error("MathLive 0.98.5: AWS SDK not loaded. See https://www.npmjs.com/package/aws-sdk");return}const E=new window.AWS.Polly({apiVersion:"2016-06-10"}),ee={OutputFormat:"json",VoiceId:(b=window.MathfieldElement.speechEngineVoice)!=null?b:"Joanna",Engine:"standard",Text:y,TextType:"ssml",SpeechMarkTypes:["ssml"]};mu().readAloudElement=a,E.synthesizeSpeech(ee,(re,ae)=>{if(re){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech()\` error: ${re}`);return}if(!(ae!=null&&ae.AudioStream)){console.log("polly.synthesizeSpeech():",ae);return}const de=new TextDecoder("utf-8").decode(new Uint8Array(ae.AudioStream));mu().readAloudMarks=de.split(`
`).map(fe=>fe?JSON.parse(fe):{}),mu().readAloudTokens=[];for(const fe of mu().readAloudMarks)fe.value&&mu().readAloudTokens.push(fe.value);mu().readAloudCurrentMark="",ee.OutputFormat="mp3",ee.SpeechMarkTypes=[],E.synthesizeSpeech(ee,(fe,ge)=>{if(fe){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech("${y}") error:${fe}`);return}if(!(ge!=null&&ge.AudioStream))return;const xe=new Uint8Array(ge.AudioStream),Be=new Blob([xe.buffer],{type:"audio/mpeg"}),Ve=URL.createObjectURL(Be),ot=mu();ot.readAloudAudio?ot.readAloudAudio.pause():(ot.readAloudAudio=new Audio,ot.readAloudAudio.addEventListener("ended",()=>{const gt=ot.readAloudMathfield;ot.readAloudStatus="ended",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),gt?(Fu(gt),ot.readAloudElement=null,ot.readAloudMathfield=null,ot.readAloudTokens=[],ot.readAloudMarks=[],ot.readAloudCurrentMark=""):gp(ot.readAloudElement)}),ot.readAloudAudio.addEventListener("timeupdate",()=>{let gt="";const ln=ot.readAloudAudio.currentTime*1e3+100;for(const ar of ot.readAloudMarks)ar.time<ln&&(gt=ar.value);ot.readAloudCurrentMark!==gt&&(ot.readAloudCurrentToken=gt,gt&&gt===ot.readAloudFinalToken?ot.readAloudAudio.pause():(ot.readAloudCurrentMark=gt,Qh(ot.readAloudElement,ot.readAloudCurrentMark)))})),ot.readAloudAudio.src=Ve,ot.readAloudStatus="playing",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),ot.readAloudAudio.play()})})}ut()||console.error('MathLive 0.98.5: this version of the MathLive library is for use in the browser. A subset of the API is available on the server side in the "mathlive-ssr" library. If using server side rendering (with React for example) you may want to do a dynamic import of the MathLive library inside a `useEffect()` call.');var Pa=new WeakMap,p1=.5,pu={letterShapeStyle:"mf.letterShapeStyle = ...",horizontalSpacingScale:'Removed. Use `"thinmuskip"`, `"medmuskip"`, and `"thickmuskip"` registers ',macros:"mf.macros = ...",registers:"mf.registers = ...",backgroundColorMap:"mf.backgroundColorMap = ...",colorMap:"mf.colorMap = ...",enablePopover:"mf.popoverPolicy = ...",mathModeSpace:"mf.mathModeSpace = ...",placeholderSymbol:"mf.placeholderSymbol = ...",readOnly:"mf.readOnly = ...",removeExtraneousParentheses:"mf.removeExtraneousParentheses = ...",scriptDepth:"mf.scriptDepth = ...",smartFence:"mf.smartFence = ...",smartMode:"mf.smartMode = ...",smartSuperscript:"mf.smartSuperscript = ...",inlineShortcutTimeout:"mf.inlineShortcutTimeout = ...",inlineShortcuts:"mf.inlineShortcuts = ...",keybindings:"mf.keybindings = ...",virtualKeyboardMode:"mf.mathVirtualKeyboardPolicy = ...",customVirtualKeyboardLayers:"mathVirtualKeyboard.layers = ...",customVirtualKeyboards:"mathVirtualKeyboard.layouts = ...",keypressSound:"mathVirtualKeyboard.keypressSound = ...",keypressVibration:"mathVirtualKeyboard.keypressVibration = ...",plonkSound:"mathVirtualKeyboard.plonkSound = ...",virtualKeyboardContainer:"mathVirtualKeyboard.container = ...",virtualKeyboardLayout:"mathVirtualKeyboard.alphabeticLayout = ...",virtualKeyboardTheme:"No longer supported",virtualKeyboardToggleGlyph:"No longer supported",virtualKeyboardToolbar:"mathVirtualKeyboard.editToolbar = ...",virtualKeyboards:"Use `mathVirtualKeyboard.layouts`",speechEngine:"`MathfieldElement.speechEngine`",speechEngineRate:"`MathfieldElement.speechEngineRate`",speechEngineVoice:"`MathfieldElement.speechEngineVoice`",textToSpeechMarkup:"`MathfieldElement.textToSpeechMarkup`",textToSpeechRules:"`MathfieldElement.textToSpeechRules`",textToSpeechRulesOptions:"`MathfieldElement.textToSpeechRulesOptions`",readAloudHook:"`MathfieldElement.readAloudHook`",speakHook:"`MathfieldElement.speakHook`",computeEngine:"`MathfieldElement.computeEngine`",fontsDirectory:"`MathfieldElement.fontsDirectory`",soundsDirectory:"`MathfieldElement.soundsDirectory`",createHTML:"`MathfieldElement.createHTML`",onExport:"`MathfieldElement.onExport`",onInlineShortcut:"`MathfieldElement.onInlineShortcut`",onScrollIntoView:"`MathfieldElement.onScrollIntoView`",locale:"MathfieldElement.locale = ...",strings:"MathfieldElement.strings = ...",decimalSeparator:"MathfieldElement.decimalSeparator = ...",fractionNavigationOrder:"MathfieldElement.fractionNavigationOrder = ..."},rs=class Gu extends HTMLElement{static get formAssociated(){return Hc()}static get optionsAttributes(){return{"default-mode":"string","letter-shape-style":"string","min-font-scale":"number","popover-policy":"string","math-mode-space":"string","read-only":"boolean","remove-extraneous-parentheses":"on/off","smart-fence":"on/off","smart-mode":"on/off","smart-superscript":"on/off","inline-shortcut-timeout":"string","script-depth":"string",placeholder:"string","virtual-keyboard-target-origin":"string","math-virtual-keyboard-policy":"string"}}static get observedAttributes(){return[...Object.keys(this.optionsAttributes),"contenteditable","disabled","readonly","read-only"]}static get fontsDirectory(){return this._fontsDirectory}static set fontsDirectory(y){y!==this._fontsDirectory&&(this._fontsDirectory=y,ng())}get fontsDirectory(){throw new Error("Use MathfieldElement.fontsDirectory instead")}set fontsDirectory(y){throw new Error("Use MathfieldElement.fontsDirectory instead")}static get soundsDirectory(){return this._soundsDirectory}static set soundsDirectory(y){this._soundsDirectory=y,this.audioBuffers={}}get soundsDirectory(){throw new Error("Use MathfieldElement.soundsDirectory instead")}set soundsDirectory(y){throw new Error("Use MathfieldElement.soundsDirectory instead")}static get keypressSound(){return this._keypressSound}static set keypressSound(y){var b,E,ee;this.audioBuffers={},y===null?this._keypressSound={spacebar:null,return:null,delete:null,default:null}:typeof y=="string"?this._keypressSound={spacebar:y,return:y,delete:y,default:y}:typeof y=="object"&&"default"in y&&(this._keypressSound={spacebar:(b=y.spacebar)!=null?b:y.default,return:(E=y.return)!=null?E:y.default,delete:(ee=y.delete)!=null?ee:y.default,default:y.default})}static get plonkSound(){return this._plonkSound}static set plonkSound(y){this.audioBuffers={},this._plonkSound=y}static get audioContext(){return this._audioContext||(this._audioContext=new AudioContext),this._audioContext}static get speechEngine(){return this._speechEngine}static set speechEngine(y){this._speechEngine=y}static get speechEngineRate(){return this._speechEngineRate}static set speechEngineRate(y){this._speechEngineRate=y}static get speechEngineVoice(){return this._speechEngineVoice}static set speechEngineVoice(y){this._speechEngineVoice=y}static get textToSpeechMarkup(){return this._textToSpeechMarkup}static set textToSpeechMarkup(y){this._textToSpeechMarkup=y}static get textToSpeechRules(){return this._textToSpeechRules}static set textToSpeechRules(y){this._textToSpeechRules=y}static get textToSpeechRulesOptions(){return this._textToSpeechRulesOptions}static set textToSpeechRulesOptions(y){this._textToSpeechRulesOptions=y}static get locale(){return et.locale}static set locale(y){y==="auto"&&(y=navigator.language.slice(0,5)),et.locale=y}get locale(){throw new Error("Use MathfieldElement.locale instead")}set locale(y){throw new Error("Use MathfieldElement.locale instead")}static get strings(){return et.strings}static set strings(y){et.merge(y)}get strings(){throw new Error("Use MathfieldElement.strings instead")}set strings(y){throw new Error("Use MathfieldElement.strings instead")}static get decimalSeparator(){return this._decimalSeparator}static set decimalSeparator(y){this._decimalSeparator=y,this._computeEngine&&(this._computeEngine.latexOptions.decimalMarker=this.decimalSeparator===","?"{,}":".")}get decimalSeparator(){throw new Error("Use MathfieldElement.decimalSeparator instead")}set decimalSeparator(y){throw new Error("Use MathfieldElement.decimalSeparator instead")}static get computeEngine(){var y,b;if(this._computeEngine===void 0){const E=(y=window[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:y.ComputeEngine;if(!E)return null;this._computeEngine=new E,this._computeEngine&&this.decimalSeparator===","&&(this._computeEngine.latexOptions.decimalMarker="{,}")}return(b=this._computeEngine)!=null?b:null}static set computeEngine(y){this._computeEngine=y}get computeEngine(){throw new Error("Use MathfieldElement.computeEngine instead")}set computeEngine(y){throw new Error("Use MathfieldElement.computeEngine instead")}static get isFunction(){return typeof this._isFunction!="function"?()=>!1:this._isFunction}static set isFunction(y){this._isFunction=y}static loadSound(y){return gu(this,null,function*(){delete this.audioBuffers[y];let b="";switch(y){case"keypress":b=this._keypressSound.default;break;case"return":b=this._keypressSound.return;break;case"spacebar":b=this._keypressSound.spacebar;break;case"delete":b=this._keypressSound.delete;break;case"plonk":b=this.plonkSound;break}if(typeof b!="string")return;b=b.trim();const E=this.soundsDirectory;if(!(E==null||E==="null"||b==="none"||b==="null"))try{const re=yield(yield fetch(yield x0(`${E}/${b}`))).arrayBuffer(),ae=yield this.audioContext.decodeAudioData(re);this.audioBuffers[y]=ae}catch(ee){}})}static playSound(y){return gu(this,null,function*(){if((this.audioContext.state==="suspended"||this.audioContext.state==="interrupted")&&(yield this.audioContext.resume()),this.audioBuffers[y]||(yield this.loadSound(y)),!this.audioBuffers[y])return;const b=this.audioContext.createBufferSource();b.buffer=this.audioBuffers[y];const E=this.audioContext.createGain();E.gain.value=p1,b.connect(E).connect(this.audioContext.destination),b.start()})}constructor(y){if(super(),y){const b=[];for(const E of Object.keys(y))if(pu[E])if(pu[E].startsWith("mf."))if(pu[E].startsWith(`mf.${E}`))b.push(`Option \`${E}\` cannot be used as a constructor option. Use ${pu[E]}`);else{const ee=pu[E].match(/([a-zA-Z]+) =/);b.push(`Option \`${E}\` has been renamed \`${ee[1]}\``)}else b.push(`Option \`${E}\` cannot be used as a constructor option. Use ${pu[E]}`);if(b.length>0){console.group("%cMathLive 0.98.5: %cInvalid Options","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn("Some of the options passed to `new MathfieldElement(...)` are invalid. \n See https://cortexjs.io/mathlive/changelog/ for details.");for(const E of b)console.warn(E);console.groupEnd()}}if(Hc()&&(this._internals=this.attachInternals(),this._internals.role="math",this._internals.ariaLabel="math input field",this._internals.ariaMultiLine="false"),this.attachShadow({mode:"open",delegatesFocus:!0}),this.shadowRoot&&"adoptedStyleSheets"in this.shadowRoot){this.shadowRoot.adoptedStyleSheets=[cu("core"),cu("mathfield"),cu("mathfield-element"),cu("ui"),cu("menu")],this.shadowRoot.appendChild(document.createElement("span"));const b=document.createElement("slot");b.style.display="none",this.shadowRoot.appendChild(b)}else this.shadowRoot.innerHTML="<style>"+Hl("core")+Hl("mathfield")+Hl("mathfield-element")+Hl("ui")+Hl("menu")+'</style><span></span><slot style="display:none"></slot>';y&&this._setOptions(y),this.shadowRoot.addEventListener("slotchange",()=>{var b;const E=this.shadowRoot.querySelector("slot:not([name])");this.value=(b=E==null?void 0:E.assignedNodes().map(ee=>ee.nodeType===3?ee.textContent:"").join("").trim())!=null?b:""})}showMenu(y){var b,E;return(E=(b=this._mathfield)==null?void 0:b.showMenu(y))!=null?E:!1}get mathVirtualKeyboard(){throw new Error("The `mathVirtualKeyboard` property is not available on the MathfieldElement. Use `window.mathVirtualKeyboard` instead.")}onPointerDown(){window.addEventListener("pointerup",y=>{var b;y.target===this&&!((b=this._mathfield)!=null&&b.disabled)&&this.dispatchEvent(new MouseEvent("click",{altKey:y.altKey,button:y.button,buttons:y.buttons,clientX:y.clientX,clientY:y.clientY,ctrlKey:y.ctrlKey,metaKey:y.metaKey,movementX:y.movementX,movementY:y.movementY,relatedTarget:y.relatedTarget,screenX:y.screenX,screenY:y.screenY,shiftKey:y.shiftKey}))},{once:!0})}getPromptValue(y,b){var E,ee;return(ee=(E=this._mathfield)==null?void 0:E.getPromptValue(y,b))!=null?ee:""}setPromptValue(y,b,E){var ee;(ee=this._mathfield)==null||ee.setPromptValue(y,b,E)}getPromptRange(y){var b,E;return(E=(b=this._mathfield)==null?void 0:b.getPromptRange(y))!=null?E:null}getPrompts(y){var b,E;return(E=(b=this._mathfield)==null?void 0:b.getPrompts(y))!=null?E:[]}get form(){var y;return(y=this._internals)==null?void 0:y.form}get name(){var y;return(y=this.getAttribute("name"))!=null?y:""}get type(){return this.localName}get mode(){var y,b;return(b=(y=this._mathfield)==null?void 0:y.model.mode)!=null?b:this.defaultMode==="text"?"text":"math"}set mode(y){var b;(b=this._mathfield)==null||b.switchMode(y)}get expression(){if(this._mathfield)return window[Symbol.for("io.cortexjs.compute-engine")]?this._mathfield.expression:(console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`),null)}set expression(y){var b,E;if(!this._mathfield)return;const ee=(E=(b=Gu.computeEngine)==null?void 0:b.box(y).latex)!=null?E:null;ee!==null&&this._mathfield.setValue(ee),window[Symbol.for("io.cortexjs.compute-engine")]||console.error(`MathLive 0.98.5: The CortexJS Compute Engine library is not available.
Load the library, for example with:
import "https://unpkg.com/@cortex-js/compute-engine?module"`)}get errors(){var y,b;return(b=(y=this._mathfield)==null?void 0:y.errors)!=null?b:[]}_getOptions(y){return this._mathfield?zu(this._mathfield.options,y):Pa.has(this)?we({},zu(we(we({},Of()),Bf(Pa.get(this).options)),y)):null}getOptions(y){return console.warn("%cMathLive 0.98.5: %cDeprecated Usage%c\n `mf.getOptions()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._mathfield?zu(this._mathfield.options,y):Pa.has(this)?zu(we(we({},Of()),Bf(Pa.get(this).options)),y):null}reflectAttributes(){const y=Of(),b=this._getOptions();Object.keys(Gu.optionsAttributes).forEach(E=>{const ee=Zl(E);Gu.optionsAttributes[E]==="on/off"?y[ee]!==b[ee]?this.setAttribute(E,b[ee]?"on":"off"):this.removeAttribute(E):y[ee]!==b[ee]&&(Gu.optionsAttributes[E]==="boolean"?b[ee]?this.setAttribute(E,""):this.removeAttribute(E):(typeof b[ee]=="string"||typeof b[ee]=="number")&&this.setAttribute(E,b[ee].toString()))})}getOption(y){return console.warn("%cMathLive 0.98.5: %cDeprecated Usage%c\n `mf.getOption()` is deprecated. Read the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem","color: inherit, font-size: 1rem"),this._getOptions([y])[y]}_getOption(y){return this._getOptions([y])[y]}_setOptions(y){if(this._mathfield)this._mathfield.setOptions(y);else if(Pa.has(this)){const b=we(we({},Pa.get(this).options),y);Pa.set(this,he(we({},Pa.get(this)),{selection:{ranges:b.readOnly?[[0,0]]:[[0,-1]]},options:b}))}else Pa.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:y,menuItems:void 0});this.reflectAttributes()}setOptions(y){console.group("%cMathLive 0.98.5: %cDeprecated Usage","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),console.warn(" `mf.setOptions()` is deprecated. Set the property directly on the mathfield instead.\n See https://cortexjs.io/mathlive/changelog/ for details.");for(const b of Object.keys(y))pu[b]&&console.warn(`\`mf.setOptions({${b}:...})\` -> ${pu[b]}`);console.groupEnd(),this._setOptions(y)}executeCommand(y){var b,E;return(E=(b=this._mathfield)==null?void 0:b.executeCommand(y))!=null?E:!1}getValue(y,b,E){var ee,re;if(this._mathfield)return this._mathfield.model.getValue(y,b,E);if(Pa.has(this)){let ae,de,fe;if(wc(y)?([ae,de]=y.ranges[0],fe=b):xc(y)?([ae,de]=y,fe=b):gl(y)&&gl(b)?(ae=y,de=b,fe=E):(ae=0,de=-1,fe=y),(fe===void 0||fe==="latex")&&ae===0&&de===-1)return(re=(ee=Pa.get(this).value)!=null?ee:this.textContent)!=null?re:""}return""}setValue(y,b){if(this._mathfield&&y!==void 0){b!=null||(b={silenceNotifications:!0,mode:"math"}),this._mathfield.setValue(y,b);return}if(Pa.has(this)){const ee=Pa.get(this).options;Pa.set(this,{value:y,selection:{ranges:[[-1,-1]],direction:"forward"},options:ee,menuItems:void 0});return}const E=Wd(this);Pa.set(this,{value:y,selection:{ranges:[[-1,-1]],direction:"forward"},options:E,menuItems:void 0})}hasFocus(){var y,b;return(b=(y=this._mathfield)==null?void 0:y.hasFocus())!=null?b:!1}focus(){var y;(y=this._mathfield)==null||y.focus()}blur(){var y;(y=this._mathfield)==null||y.blur()}select(){var y;(y=this._mathfield)==null||y.select()}insert(y,b){var E,ee;return(ee=(E=this._mathfield)==null?void 0:E.insert(y,b))!=null?ee:!1}applyStyle(y,b){var E;return(E=this._mathfield)==null?void 0:E.applyStyle(y,b)}queryStyle(y){var b,E;return(E=(b=this._mathfield)==null?void 0:b.queryStyle(y))!=null?E:"none"}get caretPoint(){var y,b;return(b=(y=this._mathfield)==null?void 0:y.getCaretPoint())!=null?b:null}set caretPoint(y){var b;y&&((b=this._mathfield)==null||b.setCaretPoint(y.x,y.y))}setCaretPoint(y,b){var E,ee;return(ee=(E=this._mathfield)==null?void 0:E.setCaretPoint(y,b))!=null?ee:!1}offsetFromPoint(y,b,E){return this._mathfield?Rd(this._mathfield,y,b,E):-1}hitboxFromOffset(y){if(!this._mathfield)return null;const b=this._mathfield.model.at(y);if(!b)return null;const E=lu(this._mathfield,b);return E?new DOMRect(E.left,E.top,E.right-E.left,E.bottom-E.top):null}resetUndo(){var y;(y=this._mathfield)==null||y.resetUndo()}canUndo(){return this._mathfield?this._mathfield.canUndo():!1}canRedo(){return this._mathfield?this._mathfield.canRedo():!1}handleEvent(y){var b,E,ee,re;wl.state==="closed"&&((E=(b=this._mathfield)==null?void 0:b.menu)==null?void 0:E.state)==="closed"&&(y.type==="pointerdown"&&this.onPointerDown(),y.type==="focus"&&((ee=this._mathfield)==null||ee.focus()),y.type==="blur"&&((re=this._mathfield)==null||re.blur()))}connectedCallback(){var y,b,E,ee;const re=window.getComputedStyle(this),ae=this.shadowRoot,de=re.userSelect!=="none";if(de)ae.host.addEventListener("pointerdown",this,!0);else{const xe=ae.querySelector("span");xe.style.pointerEvents="none"}ae.host.addEventListener("focus",this,!0),ae.host.addEventListener("blur",this,!0),Hc()||(this.hasAttribute("role")||this.setAttribute("role","math"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","math input field"),this.setAttribute("aria-multiline","false")),de&&!this.hasAttribute("contenteditable")&&this.setAttribute("contenteditable","true"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const fe=ae.querySelector("slot:not([name])");if(fe)try{this._style=fe.assignedElements().filter(xe=>xe.tagName.toLowerCase()==="style").map(xe=>xe.textContent).join("")}catch(xe){console.error(xe)}if(this._style){const xe=document.createElement("style");xe.textContent=this._style,ae.appendChild(xe)}let ge="";if(this.hasAttribute("value")?ge=this.getAttribute("value"):ge=(y=fe==null?void 0:fe.assignedNodes().map(xe=>xe.nodeType===3?xe.textContent:"").join("").trim())!=null?y:"",this._mathfield=new f1(ae.querySelector(":host > span"),he(we({},(E=(b=Pa.get(this))==null?void 0:b.options)!=null?E:Wd(this)),{eventSink:this,value:ge})),!Pa.has(this)){this.upgradeProperty("disabled"),this.upgradeProperty("readonly");for(const xe of Object.keys(Gu.optionsAttributes))this.upgradeProperty(Zl(xe))}if(!((ee=this._mathfield)!=null&&ee.model)){this._mathfield=null;return}if(Pa.has(this)){const xe=this._mathfield,Be=Pa.get(this),Ve=Be.menuItems;xe.model.deferNotifications({content:!1,selection:!1},()=>{const ot=Be.value;ot!==void 0&&xe.setValue(ot),xe.model.selection=Be.selection,Pa.delete(this)}),Ve&&(this.menuItems=Ve)}window.queueMicrotask(()=>{this.isConnected&&this.dispatchEvent(new Event("mount",{cancelable:!1,bubbles:!0,composed:!0}))}),Lf()}disconnectedCallback(){var y,b;if(this.shadowRoot.host.removeEventListener("pointerdown",this,!0),!this._mathfield)return;window.queueMicrotask(()=>this.dispatchEvent(new Event("unmount",{cancelable:!1,bubbles:!0,composed:!0})));const E=zu(this._mathfield.options,Object.keys(Gu.optionsAttributes).map(ee=>Zl(ee)));Pa.set(this,{value:this._mathfield.getValue(),selection:this._mathfield.model.selection,menuItems:(b=(y=this._mathfield.menu)==null?void 0:y.menuItems)!=null?b:void 0,options:E}),this._mathfield.dispose(),this._mathfield=null}upgradeProperty(y){if(this.hasOwnProperty(y)){const b=this[y];delete this[y],(y==="readonly"||y==="read-only")&&(y="readOnly"),this[y]=b}}attributeChangedCallback(y,b,E){if(b===E)return;const ee=E!==null;switch(y){case"contenteditable":Mo(this._mathfield);break;case"disabled":this.disabled=ee;break;case"read-only":case"readonly":this.readOnly=ee;break;default:}}get readonly(){return this.hasAttribute("readonly")||this.hasAttribute("read-only")}set readonly(y){const b=!!y;b?(this.setAttribute("readonly",""),Hc()?this._internals.ariaReadOnly="true":this.setAttribute("aria-readonly","true"),this.setAttribute("aria-readonly","true")):(Hc()?this._internals.ariaReadOnly="false":this.removeAttribute("aria-readonly"),this.removeAttribute("readonly"),this.removeAttribute("read-only")),this._setOptions({readOnly:b})}get disabled(){return this.hasAttribute("disabled")}set disabled(y){var b;const E=!!y;E?this.setAttribute("disabled",""):this.removeAttribute("disabled"),Hc()?this._internals.ariaDisabled=E?"true":"false":this.setAttribute("aria-disabled",E?"true":"false"),E&&((b=this._mathfield)!=null&&b.hasFocus)&&window.mathVirtualKeyboard.visible&&this._mathfield.executeCommand("hideVirtualKeyboard")}get value(){return this.getValue()}set value(y){this.setValue(y)}get defaultMode(){return this._getOption("defaultMode")}set defaultMode(y){this._setOptions({defaultMode:y})}get macros(){return this._getOption("macros")}set macros(y){this._setOptions({macros:y})}get registers(){const y=this;return new Proxy({},{get:(b,E)=>{if(typeof E=="string")return y._getOption("registers")[E]},set(b,E,ee){return typeof E!="string"?!1:(y._setOptions({registers:he(we({},y._getOption("registers")),{[E]:ee})}),!0)}})}set registers(y){this._setOptions({registers:y})}get colorMap(){return this._getOption("colorMap")}set colorMap(y){this._setOptions({colorMap:y})}get backgroundColorMap(){return this._getOption("backgroundColorMap")}set backgroundColorMap(y){this._setOptions({backgroundColorMap:y})}get letterShapeStyle(){return this._getOption("letterShapeStyle")}set letterShapeStyle(y){this._setOptions({letterShapeStyle:y})}get minFontScale(){return this._getOption("minFontScale")}set minFontScale(y){this._setOptions({minFontScale:y})}get smartMode(){return this._getOption("smartMode")}set smartMode(y){this._setOptions({smartMode:y})}get smartFence(){return this._getOption("smartFence")}set smartFence(y){this._setOptions({smartFence:y})}get smartSuperscript(){return this._getOption("smartSuperscript")}set smartSuperscript(y){this._setOptions({smartSuperscript:y})}get scriptDepth(){return this._getOption("scriptDepth")}set scriptDepth(y){this._setOptions({scriptDepth:y})}get removeExtraneousParentheses(){return this._getOption("removeExtraneousParentheses")}set removeExtraneousParentheses(y){this._setOptions({removeExtraneousParentheses:y})}get mathModeSpace(){return this._getOption("mathModeSpace")}set mathModeSpace(y){this._setOptions({mathModeSpace:y})}get placeholderSymbol(){return this._getOption("placeholderSymbol")}set placeholderSymbol(y){this._setOptions({placeholderSymbol:y})}get popoverPolicy(){return this._getOption("popoverPolicy")}set popoverPolicy(y){this._setOptions({popoverPolicy:y})}get environmentPopoverPolicy(){return this._getOption("environmentPopoverPolicy")}set environmentPopoverPolicy(y){this._setOptions({environmentPopoverPolicy:y})}get menuItems(){var y,b,E;return this._mathfield?(y=this._mathfield.menu._menuItems.map(ee=>ee.menuItem))!=null?y:[]:(E=(b=Pa.get(this))==null?void 0:b.menuItems)!=null?E:[]}set menuItems(y){var b;if(this._mathfield){const E=(b=this._mathfield.element)==null?void 0:b.querySelector("[part=menu-toggle]");E&&(E.style.display=y.length===0?"none":""),this._mathfield.menu.menuItems=y}Pa.has(this)?Pa.set(this,he(we({},Pa.get(this)),{menuItems:y})):Pa.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:Wd(this),menuItems:y})}get mathVirtualKeyboardPolicy(){return this._getOption("mathVirtualKeyboardPolicy")}set mathVirtualKeyboardPolicy(y){this._setOptions({mathVirtualKeyboardPolicy:y})}get inlineShortcuts(){return this._getOption("inlineShortcuts")}set inlineShortcuts(y){this._setOptions({inlineShortcuts:y})}get inlineShortcutTimeout(){return this._getOption("inlineShortcutTimeout")}set inlineShortcutTimeout(y){this._setOptions({inlineShortcutTimeout:y})}get keybindings(){return this._getOption("keybindings")}set keybindings(y){this._setOptions({keybindings:y})}get onInlineShortcut(){return this._getOption("onInlineShortcut")}set onInlineShortcut(y){this._setOptions({onInlineShortcut:y})}get onScrollIntoView(){return this._getOption("onScrollIntoView")}set onScrollIntoView(y){this._setOptions({onScrollIntoView:y})}get onExport(){return this._getOption("onExport")}set onExport(y){this._setOptions({onExport:y})}get readOnly(){return this._getOption("readOnly")}set readOnly(y){this._setOptions({readOnly:y})}get isSelectionEditable(){var y,b;return(b=(y=this._mathfield)==null?void 0:y.isSelectionEditable)!=null?b:!1}setPromptState(y,b,E){var ee;(ee=this._mathfield)==null||ee.setPromptState(y,b,E)}getPromptState(y){var b,E;return(E=(b=this._mathfield)==null?void 0:b.getPromptState(y))!=null?E:[void 0,!0]}get virtualKeyboardTargetOrigin(){return this._getOption("virtualKeyboardTargetOrigin")}set virtualKeyboardTargetOrigin(y){this._setOptions({virtualKeyboardTargetOrigin:y})}get selection(){return this._mathfield?this._mathfield.model.selection:Pa.has(this)?Pa.get(this).selection:{ranges:[[0,0]],direction:"forward"}}set selection(y){if(typeof y=="number"&&(y={ranges:[[y,y]]}),this._mathfield){this._mathfield.model.selection=y,Mo(this._mathfield);return}if(Pa.has(this)){Pa.set(this,he(we({},Pa.get(this)),{selection:y}));return}Pa.set(this,{value:void 0,selection:y,options:Wd(this),menuItems:void 0})}get selectionIsCollapsed(){const y=this.selection;return y.ranges.length===1&&y.ranges[0][0]===y.ranges[0][1]}get position(){return this._mathfield?this._mathfield.model.position:Pa.has(this)?Pa.get(this).selection.ranges[0][0]:0}set position(y){if(this._mathfield&&(this._mathfield.model.position=y,Mo(this._mathfield)),Pa.has(this)){Pa.set(this,he(we({},Pa.get(this)),{selection:{ranges:[[y,y]]}}));return}Pa.set(this,{value:void 0,selection:{ranges:[[y,y]]},options:Wd(this),menuItems:void 0})}getOffsetDepth(y){var b,E;return this._mathfield?((E=(b=this._mathfield.model.at(y))==null?void 0:b.treeDepth)!=null?E:2)-2:0}get lastOffset(){var y,b;return(b=(y=this._mathfield)==null?void 0:y.model.lastOffset)!=null?b:-1}};rs.version="0.98.5",rs._fontsDirectory="./fonts",rs._soundsDirectory="./sounds",rs.keypressVibration=!0,rs._keypressSound={spacebar:"keypress-spacebar.wav",return:"keypress-return.wav",delete:"keypress-delete.wav",default:"keypress-standard.wav"},rs._plonkSound="plonk.wav",rs.audioBuffers={},rs.createHTML=a=>a,rs._speechEngineRate="100%",rs._speechEngineVoice="Joanna",rs._textToSpeechMarkup="",rs._textToSpeechRules="mathlive",rs._textToSpeechRulesOptions={},rs.speakHook=r1,rs.readAloudHook=h1,rs._decimalSeparator=".",rs.fractionNavigationOrder="numerator-denominator",rs._isFunction=a=>{var y,b;const E=window.MathfieldElement.computeEngine;return(b=(y=E==null?void 0:E.parse(a).domain)==null?void 0:y.isFunction)!=null?b:!1};var Hd=rs;function Zl(a){return a.replace(/[^a-zA-Z\d]+(.)/g,(y,b)=>b.toUpperCase())}function Wd(a){const y={readOnly:!1},b=Hd.optionsAttributes;return Object.keys(b).forEach(E=>{if(a.hasAttribute(E)){const ee=a.getAttribute(E);E==="placeholder"?y.contentPlaceholder=ee!=null?ee:"":b[E]==="boolean"?y[Zl(E)]=!0:b[E]==="on/off"?ee==="on"?y[Zl(E)]=!0:ee==="off"?y[Zl(E)]=!1:y[Zl(E)]=void 0:b[E]==="number"?y[Zl(E)]=Number.parseFloat(ee!=null?ee:"0"):y[Zl(E)]=ee}}),y}function Hc(){return!(!("ElementInternals"in window)||!HTMLElement.prototype.attachInternals||!("role"in window.ElementInternals.prototype))}var vp=Hd,yp,bp,xp,wp;if(ut()&&!((yp=window.customElements)!=null&&yp.get("math-field"))){(xp=window[bp=Symbol.for("io.cortexjs.mathlive")])!=null||(window[bp]={});const a=window[Symbol.for("io.cortexjs.mathlive")];a.version="0.98.5",window.MathfieldElement=Hd,(wp=window.customElements)==null||wp.define("math-field",Hd)}function m1(a,y,b){let E=b,ee=0;const re=a.length;for(;E<y.length;){const ae=y[E];if(ee<=0&&y.slice(E,E+re)===a)return E;ae==="\\"?E++:ae==="{"?ee++:ae==="}"&&ee--,E++}return-1}function Jf(a,y,b,E,ee="latex"){const re=[];for(const ae of a)if(ae.type==="text"){const de=ae.data;let fe=!0,ge=0,xe;xe=de.indexOf(y),xe!==-1&&(ge=xe,ge>0&&re.push({type:"text",data:de.slice(0,ge)}),fe=!1);let Be=!1;for(;!Be;){if(fe){if(xe=de.indexOf(y,ge),xe===-1){Be=!0;break}ge!==xe&&re.push({type:"text",data:de.slice(ge,xe)}),ge=xe}else{if(xe=m1(b,de,ge+y.length),xe===-1){Be=!0;break}let Ve=de.slice(ge+y.length,xe);ee==="ascii-math"&&([,Ve]=Bu(Ve,{format:"ascii-math"})),re.push({type:"math",data:Ve,rawData:de.slice(ge,xe+b.length),mathstyle:E}),ge=xe+b.length}fe=!fe}ge<de.length&&re.push({type:"text",data:de.slice(ge)})}else re.push(ae);return re}function Sp(a,y,b){let E=[{type:"text",data:a}];return y!=null&&y.inline&&y.inline.forEach(([ee,re])=>{E=Jf(E,ee,re,"textstyle")}),y!=null&&y.display&&y.display.forEach(([ee,re])=>{E=Jf(E,ee,re,"displaystyle")}),b!=null&&b.inline&&b.inline.forEach(([ee,re])=>{E=Jf(E,ee,re,"textstyle","ascii-math")}),b!=null&&b.display&&b.display.forEach(([ee,re])=>{E=Jf(E,ee,re,"displaystyle","ascii-math")}),E}function g1(a,y){const b=document.createElement("span");b.setAttribute("translate","no");try{const E="<math xmlns='http://www.w3.org/1998/Math/MathML'>"+y.renderToMathML(a)+"</math>";b.innerHTML=window.MathfieldElement.createHTML(E)}catch(E){console.error(`MathLive 0.98.5: Could not convert "${a}"' to MathML with ${E}`),b.textContent=a}return b.className="ML__sr-only",b}function v1(a,y,b,E){try{const ee=y.renderToMarkup(a,{mathstyle:b,format:"html"}),re=document.createElement("span");return re.dataset.latex=a,re.style.display=b==="displaystyle"?"flex":"inline-flex",re.setAttribute("aria-hidden","true"),re.setAttribute("translate","no"),re.innerHTML=window.MathfieldElement.createHTML(ee),re}catch(ee){if(console.error("Could not parse'"+a+"' with ",ee),E)return document.createTextNode(a)}return null}function Wc(a,y,b,E){var ee;const re=v1(a,b,y||"textstyle",E),ae=(ee=b.renderAccessibleContent)!=null?ee:"";if(re&&/\b(mathml|speakable-text)\b/i.test(ae)){const de=document.createElement("span");if(/\bmathml\b/i.test(ae)&&b.renderToMathML&&de.append(g1(a,b)),/\bspeakable-text\b/i.test(ae)&&b.renderToSpeakableText){const fe=document.createElement("span");fe.setAttribute("translate","no");const ge=b.renderToSpeakableText(a);fe.innerHTML=window.MathfieldElement.createHTML(ge),fe.className="ML__sr-only",de.append(fe)}return de.append(re),de}return re}function y1(a,y){var b,E,ee;let re=null;if((b=y.TeX)!=null&&b.processEnvironments&&/^\s*\\begin/.test(a)){re=document.createDocumentFragment();const ae=Wc(a,"",y,!0);ae&&re.appendChild(ae)}else{if(!a.trim())return null;const ae=Sp(a,(E=y.TeX)==null?void 0:E.delimiters,(ee=y.asciiMath)==null?void 0:ee.delimiters);if(ae.length===1&&ae[0].type==="text")return null;re=document.createDocumentFragment();for(const de of ae)if(de.type==="text")re.appendChild(document.createTextNode(de.data));else{const fe=Wc(de.data,de.mathstyle==="textstyle"?"textstyle":"displaystyle",y,!0);fe&&re.appendChild(fe)}}return re}function Cp(a,y){var b,E,ee,re,ae,de,fe,ge,xe,Be,Ve,ot,gt,ln,ar,rn;if(a.childNodes.length===1&&a.childNodes[0].nodeType===3){const Vn=(b=a.childNodes[0].textContent)!=null?b:"";if((E=y.TeX)!=null&&E.processEnvironments&&/^\s*\\begin/.test(Vn)){a.textContent="";const jn=Wc(Vn,"",y,!0);jn&&a.append(jn);return}const lr=Sp(Vn,(ee=y.TeX)==null?void 0:ee.delimiters,(re=y.asciiMath)==null?void 0:re.delimiters);if(lr.length===1&&lr[0].type==="math"){a.textContent="";const jn=Wc(lr[0].data,lr[0].mathstyle==="textstyle"?"textstyle":"displaystyle",y,!0);jn&&a.append(jn);return}if(lr.length===1&&lr[0].type==="text")return}for(let Vn=a.childNodes.length-1;Vn>=0;Vn--){const lr=a.childNodes[Vn];if(lr.nodeType===3){const jn=y1((ae=lr.textContent)!=null?ae:"",y);jn&&(Vn+=jn.childNodes.length-1,lr.replaceWith(jn))}else if(lr.nodeType===1){const jn=lr,Kr=lr.nodeName.toLowerCase();if(Kr==="script"){const ai=lr;let jr;if((de=y.processScriptTypePattern)!=null&&de.test(ai.type))jr=(fe=ai.textContent)!=null?fe:"";else if((ge=y.processMathJSONScriptTypePattern)!=null&&ge.test(ai.type))try{jr=(Be=y.serializeToLatex)==null?void 0:Be.call(y,JSON.parse((xe=ai.textContent)!=null?xe:""))}catch(_a){console.error(_a)}if(jr){let _a="textstyle";for(const br of ai.type.split(";")){const[$s,kl]=br.toLowerCase().split("=");$s.trim()==="mode"&&(_a=kl.trim()==="display"?"displaystyle":"textstyle")}const qa=Wc(jr,_a,y,!0);qa&&ai.parentNode.replaceChild(qa,ai)}}else if(((ot=(Ve=y.processClassPattern)==null?void 0:Ve.test(jn.className))!=null?ot:!1)||!((ln=(gt=y.skipTags)==null?void 0:gt.includes(Kr))!=null&&ln||(rn=(ar=y.ignoreClassPattern)==null?void 0:ar.test(jn.className))!=null&&rn))if(a.childNodes.length===1&&a.childNodes[0].nodeType===3){const jr=a.textContent;a.textContent="";const _a=Wc(jr!=null?jr:"","displaystyle",y,!0);_a&&a.append(_a)}else Cp(jn,y)}}}var b1={skipTags:["math-field","noscript","style","textarea","pre","code","annotation","annotation-xml"],processScriptType:"math/tex",processMathJSONScriptType:"math/json",ignoreClass:"tex2jax_ignore",processClass:"tex2jax_process",renderAccessibleContent:"mathml",asciiMath:{delimiters:{inline:[["`","`"]]}},TeX:{processEnvironments:!0,delimiters:{inline:[["\\(","\\)"]],display:[["$$","$$"],["\\[","\\]"]]}}};function x1(a,y){var b,E,ee,re;try{const ae=we(we({},b1),y);ae.ignoreClassPattern=new RegExp((b=ae.ignoreClass)!=null?b:""),ae.processClassPattern=new RegExp((E=ae.processClass)!=null?E:""),ae.processScriptTypePattern=new RegExp((ee=ae.processScriptType)!=null?ee:""),ae.processMathJSONScriptTypePattern=new RegExp((re=ae.processMathJSONScriptType)!=null?re:""),Lf(),ks("core"),Cp(a,ae)}catch(ae){ae instanceof Error?console.error("renderMathInElement(): "+ae.message):console.error("renderMathInElement(): Could not render math for element",a)}}function w1(a,y){const b=fu.singleton;return b?(b.show(),Dd(),b.currentLayer=y,b.render(),b.focus(),!0):!1}function S1(){const a=window.mathVirtualKeyboard;return a.visible?a.hide({animate:!0}):a.show({animate:!0}),!1}Ls({switchKeyboardLayer:w1,toggleVirtualKeyboard:S1,hideVirtualKeyboard:()=>(window.mathVirtualKeyboard.hide({animate:!0}),!1),showVirtualKeyboard:()=>(window.mathVirtualKeyboard.show({animate:!0}),!1)},{target:"virtual-keyboard"});function mu(){var a,y;return(y=globalThis[a=Symbol.for("io.cortexjs.mathlive")])!=null||(globalThis[a]={}),globalThis[Symbol.for("io.cortexjs.mathlive")]}function T1(){return console.warn("%cMathLive 0.98.5: %cmakeSharedVirtualKeyboard() is deprecated. \n Use `window.mathVirtualKeyboard` to access the virtual keyboard instance.\n See https://cortexjs.io/mathlive/changelog/ for details.","color:#12b; font-size: 1.1rem","color:#db1111; font-size: 1.1rem"),window.mathVirtualKeyboard}function D1(a){M1(document.body,a)}function C1(a){if(typeof a=="string"){const y=document.getElementById(a);if(y===null)throw new Error(`The element with ID "${a}" could not be found.`);return y}return typeof a=="string"?null:a}function M1(a,y){var b,E,ee,re;const ae=C1(a);if(!ae)return;const de=y!=null?y:{};(b=de.renderToMarkup)!=null||(de.renderToMarkup=qo),(E=de.renderToMathML)!=null||(de.renderToMathML=Rv),(ee=de.renderToSpeakableText)!=null||(de.renderToSpeakableText=Nv),(re=de.serializeToLatex)!=null||(de.serializeToLatex=Fv),x1(ae,de)}var I1={mathlive:"0.98.5"}},17423:function(mn,Ut,ue){"use strict";ue.d(Ut,{Z:function(){return we}});const be=he=>typeof he=="object"&&he!=null&&he.nodeType===1,tt=(he,De)=>(!De||he!=="hidden")&&he!=="visible"&&he!=="clip",Fe=(he,De)=>{if(he.clientHeight<he.scrollHeight||he.clientWidth<he.scrollWidth){const ct=getComputedStyle(he,null);return tt(ct.overflowY,De)||tt(ct.overflowX,De)||(Ne=>{const Mt=(ut=>{if(!ut.ownerDocument||!ut.ownerDocument.defaultView)return null;try{return ut.ownerDocument.defaultView.frameElement}catch(Qe){return null}})(Ne);return!!Mt&&(Mt.clientHeight<Ne.scrollHeight||Mt.clientWidth<Ne.scrollWidth)})(he)}return!1},qe=(he,De,ct,Ne,Mt,ut,Qe,Xe)=>ut<he&&Qe>De||ut>he&&Qe<De?0:ut<=he&&Xe<=ct||Qe>=De&&Xe>=ct?ut-he-Ne:Qe>De&&Xe<ct||ut<he&&Xe>ct?Qe-De+Mt:0,ye=he=>{const De=he.parentElement;return De==null?he.getRootNode().host||null:De},Ce=(he,De)=>{var ct,Ne,Mt,ut;if(typeof document=="undefined")return[];const{scrollMode:Qe,block:Xe,inline:Te,boundary:Et,skipOverflowHiddenElements:Lt}=De,et=typeof Et=="function"?Et:Xt=>Xt!==Et;if(!be(he))throw new TypeError("Invalid target");const lt=document.scrollingElement||document.documentElement,Ie=[];let _e=he;for(;be(_e)&&et(_e);){if(_e=ye(_e),_e===lt){Ie.push(_e);break}_e!=null&&_e===document.body&&Fe(_e)&&!Fe(document.documentElement)||_e!=null&&Fe(_e,Lt)&&Ie.push(_e)}const Ue=(Ne=(ct=window.visualViewport)==null?void 0:ct.width)!=null?Ne:innerWidth,Ze=(ut=(Mt=window.visualViewport)==null?void 0:Mt.height)!=null?ut:innerHeight,{scrollX:At,scrollY:bt}=window,{height:xt,width:Ge,top:Ot,right:kt,bottom:vn,left:qt}=he.getBoundingClientRect(),{top:cn,right:An,bottom:Zn,left:Ye}=(Xt=>{const Je=window.getComputedStyle(Xt);return{top:parseFloat(Je.scrollMarginTop)||0,right:parseFloat(Je.scrollMarginRight)||0,bottom:parseFloat(Je.scrollMarginBottom)||0,left:parseFloat(Je.scrollMarginLeft)||0}})(he);let Ee=Xe==="start"||Xe==="nearest"?Ot-cn:Xe==="end"?vn+Zn:Ot+xt/2-cn+Zn,Tt=Te==="center"?qt+Ge/2-Ye+An:Te==="end"?kt+An:qt-Ye;const gn=[];for(let Xt=0;Xt<Ie.length;Xt++){const Je=Ie[Xt],{height:rt,width:Ht,top:Sn,right:sn,bottom:$t,left:Bt}=Je.getBoundingClientRect();if(Qe==="if-needed"&&Ot>=0&&qt>=0&&vn<=Ze&&kt<=Ue&&Ot>=Sn&&vn<=$t&&qt>=Bt&&kt<=sn)return gn;const bn=getComputedStyle(Je),dn=parseInt(bn.borderLeftWidth,10),ke=parseInt(bn.borderTopWidth,10),ce=parseInt(bn.borderRightWidth,10),le=parseInt(bn.borderBottomWidth,10);let ve=0,pe=0;const oe="offsetWidth"in Je?Je.offsetWidth-Je.clientWidth-dn-ce:0,ze="offsetHeight"in Je?Je.offsetHeight-Je.clientHeight-ke-le:0,yt="offsetWidth"in Je?Je.offsetWidth===0?0:Ht/Je.offsetWidth:0,Vt="offsetHeight"in Je?Je.offsetHeight===0?0:rt/Je.offsetHeight:0;if(lt===Je)ve=Xe==="start"?Ee:Xe==="end"?Ee-Ze:Xe==="nearest"?qe(bt,bt+Ze,Ze,ke,le,bt+Ee,bt+Ee+xt,xt):Ee-Ze/2,pe=Te==="start"?Tt:Te==="center"?Tt-Ue/2:Te==="end"?Tt-Ue:qe(At,At+Ue,Ue,dn,ce,At+Tt,At+Tt+Ge,Ge),ve=Math.max(0,ve+bt),pe=Math.max(0,pe+At);else{ve=Xe==="start"?Ee-Sn-ke:Xe==="end"?Ee-$t+le+ze:Xe==="nearest"?qe(Sn,$t,rt,ke,le+ze,Ee,Ee+xt,xt):Ee-(Sn+rt/2)+ze/2,pe=Te==="start"?Tt-Bt-dn:Te==="center"?Tt-(Bt+Ht/2)+oe/2:Te==="end"?Tt-sn+ce+oe:qe(Bt,sn,Ht,dn,ce+oe,Tt,Tt+Ge,Ge);const{scrollLeft:en,scrollTop:un}=Je;ve=Vt===0?0:Math.max(0,Math.min(un+ve/Vt,Je.scrollHeight-rt/Vt+ze)),pe=yt===0?0:Math.max(0,Math.min(en+pe/yt,Je.scrollWidth-Ht/yt+oe)),Ee+=un-ve,Tt+=en-pe}gn.push({el:Je,top:ve,left:pe})}return gn},Me=he=>he===!1?{block:"end",inline:"nearest"}:(De=>De===Object(De)&&Object.keys(De).length!==0)(he)?he:{block:"start",inline:"nearest"};function we(he,De){if(!he.isConnected||!(Mt=>{let ut=Mt;for(;ut&&ut.parentNode;){if(ut.parentNode===document)return!0;ut=ut.parentNode instanceof ShadowRoot?ut.parentNode.host:ut.parentNode}return!1})(he))return;const ct=(Mt=>{const ut=window.getComputedStyle(Mt);return{top:parseFloat(ut.scrollMarginTop)||0,right:parseFloat(ut.scrollMarginRight)||0,bottom:parseFloat(ut.scrollMarginBottom)||0,left:parseFloat(ut.scrollMarginLeft)||0}})(he);if((Mt=>typeof Mt=="object"&&typeof Mt.behavior=="function")(De))return De.behavior(Ce(he,De));const Ne=typeof De=="boolean"||De==null?void 0:De.behavior;for(const{el:Mt,top:ut,left:Qe}of Ce(he,Me(De))){const Xe=ut-ct.top+ct.bottom,Te=Qe-ct.left+ct.right;Mt.scroll({top:Xe,left:Te,behavior:Ne})}}}}]);
}());