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__HttpStatus__HpcCourse.b3...

3444 lines
1.6 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 gc=(Ln,qt,ce)=>new Promise((fe,tt)=>{var Fe=_e=>{try{be(ce.next(_e))}catch(Le){tt(Le)}},Ye=_e=>{try{be(ce.throw(_e))}catch(Le){tt(Le)}},be=_e=>_e.done?fe(_e.value):Promise.resolve(_e.value).then(Fe,Ye);be((ce=ce.apply(Ln,qt)).next())});(self.webpackChunk=self.webpackChunk||[]).push([[4496],{18299:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return Le}});var fe=ce(87462),tt=ce(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"},Ye=Fe,be=ce(74643),_e=function(pe,Te){return tt.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ye}))},Le=tt.forwardRef(_e)},84249:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return Le}});var fe=ce(87462),tt=ce(67294),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},Ye=Fe,be=ce(74643),_e=function(pe,Te){return tt.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ye}))},Le=tt.forwardRef(_e)},42922:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return Le}});var fe=ce(87462),tt=ce(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"},Ye=Fe,be=ce(74643),_e=function(pe,Te){return tt.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ye}))},Le=tt.forwardRef(_e)},90674:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return Le}});var fe=ce(87462),tt=ce(67294),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},Ye=Fe,be=ce(74643),_e=function(pe,Te){return tt.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ye}))},Le=tt.forwardRef(_e)},25877:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return Le}});var fe=ce(87462),tt=ce(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"},Ye=Fe,be=ce(74643),_e=function(pe,Te){return tt.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ye}))},Le=tt.forwardRef(_e)},63237:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return Le}});var fe=ce(87462),tt=ce(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"},Ye=Fe,be=ce(74643),_e=function(pe,Te){return tt.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ye}))},Le=tt.forwardRef(_e)},99569:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return Le}});var fe=ce(87462),tt=ce(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"},Ye=Fe,be=ce(74643),_e=function(pe,Te){return tt.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ye}))},Le=tt.forwardRef(_e)},38308:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return Le}});var fe=ce(87462),tt=ce(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"},Ye=Fe,be=ce(74643),_e=function(pe,Te){return tt.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ye}))},Le=tt.forwardRef(_e)},17663:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return Le}});var fe=ce(87462),tt=ce(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"},Ye=Fe,be=ce(74643),_e=function(pe,Te){return tt.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ye}))},Le=tt.forwardRef(_e)},72395:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return Le}});var fe=ce(87462),tt=ce(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"},Ye=Fe,be=ce(74643),_e=function(pe,Te){return tt.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ye}))},Le=tt.forwardRef(_e)},53978:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return Le}});var fe=ce(87462),tt=ce(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"},Ye=Fe,be=ce(74643),_e=function(pe,Te){return tt.createElement(be.Z,(0,fe.Z)({},pe,{ref:Te,icon:Ye}))},Le=tt.forwardRef(_e)},71749:function(){"use strict"},30483:function(){"use strict"},71736:function(Ln,qt){"use strict";qt.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 Ln={},qt="5.0",ce={},fe=null,tt=!1,Fe=!1,Ye=null,be=!1,_e=null,Le=null,Se=0;Se<arguments.length;Se++){var pe=arguments[Se];if(pe!==null)switch(typeof pe){case"number":qt=pe.toFixed(1);break;case"string":pe.match(new RegExp("^[0-9]\\.[0-9]+$"))?qt=pe:Ye=pe;break;case"object":typeof pe.is3D!="undefined"?fe=pe:ce=pe;break;case"boolean":tt=pe,Fe=!0;break}}fe===null&&(fe={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},ce.material_id!==void 0&&!Fe&&(tt=!0)),Ye!==null&&ce.id===void 0&&(ce.id=Ye);var Te="",gt="",ze=!1,Pt=null,kt=null,pt=null,Je=!1,De=null,Dt=null,Yt=null,nt=null,ct=null;ce.height!==void 0&&(ce.height=Math.round(ce.height)),ce.width!==void 0&&(ce.width=Math.round(ce.width));var Ie=function(at){return parseFloat(at)>4?parseFloat(at):5};Ln.setHTML5Codebase=function(at,ft){Le=at,$t(at,ft)},Ln.setJavaCodebase=Ln.setJavaCodebaseVersion=Ln.isCompiledInstalled=Ln.setPreCompiledScriptPath=Ln.setPreCompiledResourcePath=function(){},Ln.setHTML5CodebaseVersion=function(at,ft){var Gt=parseFloat(at);if(Gt!==NaN&&Gt<5){console.log("The GeoGebra HTML5 codebase version "+Gt+" is deprecated. Using version latest instead.");return}_e=at,Ae(at,ft)},Ln.getHTML5CodebaseVersion=function(){return kt},Ln.getParameters=function(){return ce},Ln.setFontsCSSURL=function(at){nt=at},Ln.setGiacJSURL=function(at){},Ln.setJNLPFile=function(at){Te=at},Ln.setJNLPBaseDir=function(at){},Ln.inject=function(){function at(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var ft="auto",Gt=ce.id,zn,mn=!1,nn=0;nn<arguments.length;nn++){var Ft=arguments[nn];typeof Ft=="string"?(Ft=Ft.toLowerCase(),Ft.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?ft=Ft:Gt=arguments[nn]):typeof Ft=="boolean"?mn=Ft:Ft instanceof HTMLElement&&(zn=Ft)}Pn();function Pn(){if(!be){setTimeout(Pn,200);return}ft=Sr(ft);var _n=zn||document.getElementById(Gt);if(!_n){console.log("possibly bug on ajax loading? ");return}if(Ln.removeExistingApplet(_n,!1),ce.width===void 0&&_n.clientWidth&&(ce.width=_n.clientWidth),ce.height===void 0&&_n.clientHeight&&(ce.height=_n.clientHeight),!(ce.width&&ce.height)&&ft==="html5"&&(delete ce.width,delete ce.height),Pt=ft,ft==="screenshot")At(_n,ce);else{var Ee=!1;ce.hasOwnProperty("playButton")&&ce.playButton||ce.hasOwnProperty("clickToLoad")&&ce.clickToLoad?Ee=!0:ce.hasOwnProperty("playButtonAutoDecide")&&ce.playButtonAutoDecide&&(Ee=(!Me()||at())&&Ve()),Ee?(Pt="screenshot",jt(_n,ce,mn,ft)):Rt(_n,ce,mn)}}};function Me(){try{return window.self!==window.top}catch(at){return!0}}function Ve(){return ce.hasOwnProperty("screenshotGenerator")&&ce.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}Ln.getViews=function(){return fe},Ln.isJavaInstalled=function(){return!1};var Xe=function(at){var ft=function(nn){var Ft=JSON.parse(nn),Pn=function(ue){return ue.type=="G"||ue.type=="E"},_n=Ft.elements?Ft.elements.filter(Pn)[0]:Ft;if(!_n||!_n.url){Gt();return}ce.fileName=_n.url,Ct(_n.settings||{}),fe.is3D=!0;var Ee="https://www.geogebra.org/images/";Ln.setPreviewImage(De||_n.previewUrl,Ee+"GeoGebra_loading.png",Ee+"applet_play.png"),at()},Gt=function(){ce.onError&&ce.onError(),Hn("Error: Fetching material (id "+ce.material_id+") failed.",ce)},zn=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",mn="/materials/"+ce.material_id+"?scope=basic";wt("https://"+zn+"/api/proxy.php?path="+encodeURIComponent(mn),ft,Gt)};function Ct(at){var ft=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(Gt){at[Gt]=!!at[Gt]}),ft.forEach(function(Gt){ce[Gt]===void 0&&at[Gt]!==void 0&&(ce[Gt]=at[Gt])}),ce.showToolBarHelp===void 0&&(ce.showToolBarHelp=ce.showToolBar)}function wt(at,ft,Gt){var zn=new XMLHttpRequest;zn.open("GET",at),zn.onload=function(){ft(zn.responseText)},zn.onerror=Gt,zn.send()}Ln.isHTML5Installed=function(){return!0},Ln.getLoadedAppletType=function(){return Pt},Ln.setPreviewImage=function(at,ft,Gt){De=at,Dt=ft,Yt=Gt},Ln.removeExistingApplet=function(at,ft){var Gt;typeof at=="string"&&(at=document.getElementById(at)),Pt=null;var zn=null;for(Gt=0;Gt<at.childNodes.length;Gt++){var mn=at.childNodes[Gt],nn=mn.className;nn==="applet_screenshot"?ft?(mn.style.display="block",Pt="screenshot"):mn.style.display="none":nn!=="applet_scaler prerender"&&(at.removeChild(mn),zn=nn&&nn.indexOf("appletParameters")!=-1?mn.id:null,Gt--)}var Ft=ce.id!==void 0?ce.id:zn,Pn=window[Ft];Pn&&typeof Pn.getBase64=="function"&&(Pn.remove(),window[Ft]=null)},Ln.refreshHitPoints=function(){if(Ie(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var at=Ln.getAppletObject();return at&&typeof at.recalculateEnvironments=="function"?(at.recalculateEnvironments(),!0):!1},Ln.startAnimation=function(){var at=Ln.getAppletObject();return at&&typeof at.startAnimation=="function"?(at.startAnimation(),!0):!1},Ln.stopAnimation=function(){var at=Ln.getAppletObject();return at&&typeof at.stopAnimation=="function"?(at.stopAnimation(),!0):!1},Ln.getAppletObject=function(){var at=ce.id!==void 0?ce.id:"ggbApplet";return window[at]},Ln.resize=function(){};var Mt=function(at,ft,Gt){var zn=document.createElement("param");zn.setAttribute("name",ft),zn.setAttribute("value",Gt),at.appendChild(zn)},je=function(at){return at&&at!=="false"},Rt=function(at,ft,Gt){Ie(kt)<=4.2&&(Gt=!0);var zn=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==kt||ggbHTML5LoadedCodebaseIsWebSimple&&!Je)&&(zn=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var mn=document.createElement("div");mn.classList.add("appletParameters","notranslate");var nn=ft.width,Ft=ft.height;if(ft.disableAutoScale=ft.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():ft.disableAutoScale,ft.width!==void 0)if(Ie(kt)<=4.4)je(ft.showToolBar)&&(ft.height-=7),je(ft.showAlgebraInput)&&(ft.height-=37),ft.width<605&&je(ft.showToolBar)&&(ft.width=605,nn=605);else{var Pn=100;(je(ft.showToolBar)||je(ft.showMenuBar))&&(ft.hasOwnProperty("customToolBar")&&(ft.customToolbar=ft.customToolBar),Pn=je(ft.showMenuBar)?245:155),nn<Pn&&(ft.width=Pn,nn=Pn)}mn.style.border="none",mn.style.display="inline-block";for(var _n in ft)ft.hasOwnProperty(_n)&&_n!=="appletOnLoad"&&mn.setAttribute("data-param-"+_n,ft[_n]);nt&&mn.setAttribute("data-param-fontscssurl",nt),Ln.resize=function(){GGBAppletUtils.responsiveResize(at,ft)},window.addEventListener("resize",function(ln){Ln.resize()});var Ee=typeof ft.appletOnLoad=="function"?ft.appletOnLoad:function(){};if(!Gt&&ft.width!==void 0){ft.hasOwnProperty("showSplash")||mn.setAttribute("data-param-showSplash","false");var ue=at.querySelector(".applet_scaler.prerender"),se=ue!==null;if(se)var ye=ue.querySelector(".ggb_preview");else{var ye=er(nn,Ft,ft.borderColor,!1);ue=document.createElement("div"),ue.className="applet_scaler",ue.style.position="relative",ue.style.display="block",ue.style.width=nn+"px",ue.style.height=Ft+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(ue,"66%"),Ie(kt)>=5?(ft.appletOnLoad=function(ln){var yr=at.querySelector(".ggb_preview");yr&&yr.parentNode.removeChild(yr),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(ue),window.GGBT_wsf_view&&$(window).trigger("resize"),Ee(ln)},se||ue.appendChild(ye)):mn.appendChild(ye),ue.appendChild(mn),se||at.appendChild(ue),setTimeout(function(){Ln.resize()},1)}else{var ve=document.createElement("div");ve.className="applet_scaler",ve.style.position="relative",ve.style.display="block",ve.appendChild(mn),at.appendChild(ve),ft.appletOnLoad=function(ln){Ln.resize(),Ee(ln)}}function le(ln,yr){yr&&typeof yr.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(ln,yr.appletOnLoad):renderGGBElement(ln),Hn("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",yr)}function We(ln,yr){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:ln,params:yr}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(Fr){le(Fr.article,Fr.params)}),html5AppletsToProcess=null)},Ie(kt)<5&&(ln.className+=" geogebraweb")):le(ln,yr)}if(zn){scriptLoadStarted=!0;for(var Lt=0;Lt<mn.childNodes.length;Lt++){var tn=mn.childNodes[Lt].tagName;tn==="TABLE"&&(mn.removeChild(mn.childNodes[Lt]),Lt--)}if(ggbHTML5LoadedScript!==null){var hn=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');hn!=null&&hn.parentNode.removeChild(hn)}var sn=document.createElement("script"),yn=function(){We(mn,ft)};sn.src=gt+pt,ggbHTML5LoadedCodebaseIsWebSimple=Je,ggbHTML5LoadedCodebaseVersion=kt,ggbHTML5LoadedScript=sn.src,Hn("GeoGebra HTML5 codebase loaded: '"+gt+"'.",ft),!Le&&(!_e||_e=="5.0")?(Je?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),yn()):gt.requirejs?__webpack_require__.e(12).then(function(){var ln=[__webpack_require__(12)];yn.apply(null,ln)}.bind(this)).catch(__webpack_require__.oe):(sn.onload=yn,at.appendChild(sn))}else We(mn,ft);ft.height=Ft,ft.width=nn},At=function(at,ft,Gt){var zn=er(ft.width,ft.height,ft.borderColor,Gt),mn=document.createElement("div");mn.style.position="relative",mn.style.display="block",mn.style.width=ft.width+"px",mn.style.height=ft.height+"px",mn.className="applet_screenshot applet_scaler"+(Gt?" applet_screenshot_play":""),mn.appendChild(zn);var nn=GGBAppletUtils.getScale(ft,at,Gt);Gt?(at.appendChild(vn()),window.GGBT_wsf_view||(at.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(mn,"66%"),at.appendChild(mn),nn!==1&&!isNaN(nn)&&(GGBAppletUtils.scaleElement(mn,nn),mn.style.width=ft.width+"px",mn.style.height=ft.height+"px",mn.parentNode.style.width=ft.width*nn+"px",mn.parentNode.style.height=ft.height*nn+"px"),Ln.resize=function(){xn(at,zn,mn,Gt)},window.addEventListener("resize",function(Ft){Ln.resize()}),Ln.resize()};function xn(at,ft,Gt,zn){if(at.contains(ft)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(at.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(at)}var mn=GGBAppletUtils.getScale(ce,at,zn);Gt.parentNode!==null&&(!isNaN(mn)&&mn!==1?(GGBAppletUtils.scaleElement(Gt,mn),Gt.parentNode.style.width=ce.width*mn+"px",Gt.parentNode.style.height=ce.height*mn+"px"):(GGBAppletUtils.scaleElement(Gt,1),Gt.parentNode.style.width=ce.width+"px",Gt.parentNode.style.height=ce.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(at),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}Ln.onExitFullscreen=function(at,ft){ft.appendChild(at)};var jt=function(at,ft,Gt,zn){At(at,ft,!0);for(var mn=function(){var Pn=[];for(Ft=0;Ft<at.childNodes.length;Ft++)Pn.push(at.childNodes[Ft]);if(window.GGBT_wsf_view){var _n=window.GGBT_wsf_view.renderFullScreen(at,ft.id),Ee=document.getElementById("fullscreencontainer"),ue=jQuery(at).find(".fullscreencontent");ue.length>0?(_n.remove(),ue.attr("id","fullscreencontent").show(),jQuery(Ee).append(ue),window.dispatchEvent(new Event("resize"))):Rt(_n,ft,!1),window.GGBT_wsf_view.launchFullScreen(Ee)}else Pt=zn,Rt(at,ft,!1);if(!window.GGBT_wsf_view)for(Ft=0;Ft<Pn.length;Ft++)at.removeChild(Pn[Ft])},nn=at.getElementsByClassName("ggb_preview_play"),Ft=0;Ft<nn.length;Ft++)nn[Ft].addEventListener("click",mn,!1),nn[Ft].addEventListener("ontouchstart",mn,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(at),Ve()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},vn=function(){var at=document.createElement("div");if(at.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var ft='.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");}',Gt=document.createElement("style");Gt.styleSheet?Gt.styleSheet.cssText=ft:Gt.appendChild(document.createTextNode(ft)),document.getElementsByTagName("head")[0].appendChild(Gt)}return at},er=function(at,ft,Gt,zn){var mn=document.createElement("div");mn.className="ggb_preview",mn.style.position="absolute",mn.style.zIndex="90",mn.style.width=at-2+"px",mn.style.height=ft-2+"px",mn.style.top="0px",mn.style.left="0px",mn.style.overflow="hidden",mn.style.backgroundColor="white";var nn="lightgrey";Gt!==void 0&&(Gt==="none"?nn="transparent":nn=Gt),mn.style.border="1px solid "+nn;var Ft=document.createElement("img");if(Ft.style.position="relative",Ft.style.zIndex="1000",Ft.style.top="-1px",Ft.style.left="-1px",De!==null&&Ft.setAttribute("src",De),Ft.style.opacity=.7,Dt!==null){var Pn,_n,Ee;if(!zn){Pn=document.createElement("img"),Pn.style.position="absolute",Pn.style.zIndex="1001",Pn.style.opacity=1,Ft.style.opacity=.3,_n=360,_n>at/4*3&&(_n=at/4*3),Ee=_n/5.8,Pn.setAttribute("src",Dt),Pn.setAttribute("width",_n),Pn.setAttribute("height",Ee);var ue=(at-_n)/2,se=(ft-Ee)/2;Pn.style.left=ue+"px",Pn.style.top=se+"px",mn.appendChild(Pn)}}return mn.appendChild(Ft),mn},Sr=function(at){return at=at.toLowerCase(),at==="html5"||at==="screenshot"?at:"html5"},qe=["web","webSimple","web3d","tablet","tablet3d","phone"],Ae=function(at,ft){if(kt=at,ft){$t(kt,!0);return}var Gt=!tt;if(Gt){var zn=Ie(kt);!isNaN(zn)&&zn<4.4&&(Gt=!1)}var mn,nn;window.location.protocol.substr(0,4)==="http"?mn=window.location.protocol:mn="http:";var Ft=kt.indexOf("//");Ft>0?nn=kt:Ft===0?nn=mn+kt:nn="https://www.geogebra.org/apps/5.2.814.0/";for(var Pn in qe)if(kt.slice(qe[Pn].length*-1)===qe[Pn]||kt.slice((qe[Pn].length+1)*-1)===qe[Pn]+"/"){$t(nn,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&Gt&&!fe.is3D&&!fe.AV&&!fe.SV&&!fe.CV&&!fe.EV2&&!fe.CP&&!fe.PC&&!fe.DA&&!fe.FI&&!fe.PV&&!je(ce.showToolBar)&&!je(ce.showMenuBar)&&!je(ce.showAlgebraInput)&&!je(ce.enableRightClick)&&(!ce.appName||ce.appName=="classic")?nn+="webSimple/":nn+="web3d/",$t(nn,!1)},$t=function(at,ft){if(at.requirejs){gt=at;return}at.slice(-1)!=="/"&&(at+="/"),gt=at,ft===null&&(ft=at.indexOf("http")===-1),ze=ft,pt="web.nocache.js",Je=!1;var Gt=gt.split("/");Gt.length>1&&(!ft&&Gt[Gt.length-2]==="webSimple"?(pt="webSimple.nocache.js",Je=!0):qe.indexOf(Gt[Gt.length-2])>=0&&(pt=Gt[Gt.length-2]+".nocache.js")),Gt=at.split("/"),kt=Gt[Gt.length-3],kt.substr(0,4)==="test"?kt=kt.substr(4,1)+"."+kt.substr(5,1):(kt.substr(0,3)==="war"||kt.substr(0,4)==="beta")&&(kt="5.0");var zn=parseFloat(kt);zn!==NaN&&zn<5&&at.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+zn+" is deprecated. Using version latest instead."),Ae("5.0",ft))},Hn=function(at,ft){window.console&&window.console.log&&(!ft||typeof ft.showLogging=="undefined"||ft.showLogging&&ft.showLogging!=="false")&&console.log(at)};ce.material_id!==void 0?Xe(bn):bn();function bn(){var at=qt;_e!==null?at=_e:parseFloat(at)<5&&(at="5.0"),Ae(at,!1),Le!==null&&$t(Le,ze),be=!0}return Ln},GGBAppletUtils=function(){"use strict";function Ln(){return window.GGBT_wsf_edit!==void 0}function qt(be,_e){_e!=1?(be.style.transformOrigin="0% 0% 0px",be.style.webkitTransformOrigin="0% 0% 0px",be.style.transform="scale("+_e+","+_e+")",be.style.webkitTransform="scale("+_e+","+_e+")",be.style.maxWidth="initial",be.querySelector(".ggb_preview")!==null&&(be.querySelector(".ggb_preview").style.maxWidth="initial"),be.querySelectorAll(".ggb_preview img")[0]!==void 0&&(be.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),be.querySelectorAll(".ggb_preview img")[1]!==void 0&&(be.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(be.style.transform="none",be.style.webkitTransform="none")}function ce(be,_e,Le,Se,pe,Te){var gt=null;if(Te!=null&&Te!="")for(var ze=be.parentNode;ze!=null;)if((" "+ze.className+" ").indexOf(" "+Te+" ")>-1){gt=ze;break}else ze=ze.parentNode;var Pt=0,kt=0,pt=0,Je=0,De=0,Dt=0,Yt=0;if(gt)Pt=gt.offsetWidth,kt=Math.max(Se?gt.offsetWidth:0,gt.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(Pt=Math.min(window.innerWidth,document.documentElement.clientWidth),kt=Math.min(window.innerHeight,document.documentElement.clientHeight),pt=Pt):(Pt=window.innerWidth,kt=window.innerHeight,pt=window.innerWidth),be){var nt=be.getBoundingClientRect();nt.left>0&&nt.left<=Pt&&(pe===void 0||!pe)&&(document.dir==="rtl"?(De=Pt-nt.width-nt.left,Dt=pt<=480?10:30):(Dt=nt.left,De=pt<=480?10:30),Je=Dt+De)}if(be&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var ct=be.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(Je=40,Yt=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(Je=0,Yt=40)}}return be&&((Le===void 0||!Le)&&_e>0&&_e+Je<Pt?Pt=_e:Pt-=Je,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Le===void 0||!Le)&&(kt-=Yt)),{width:Pt,height:kt}}function fe(be,_e,Le,Se,pe){if(be.isScreenshoGenerator)return 1;var Te=Se!==void 0&&Se,gt=be.noScaleMargin!=null&&be.noScaleMargin,ze=function(ct){return ct&&ct!=="false"},Pt=ze(be.autoHeight),kt=ce(_e,be.width,Le,Pt,Te&&window.GGBT_wsf_view||gt,pe),pt=parseInt(kt.width),Je=be.width,De=be.height;if(Je===void 0){var Dt=_e.querySelector(".appletParameters");Dt&&(Je=Dt.offsetWidth,De=Dt.offsetHeight)}var Yt=pt/Je,nt=Te?1:kt.height/De;return Le!==void 0&&!Le&&(Yt=Math.min(1,Yt),nt=Math.min(1,nt)),Math.min(Yt,nt)}function tt(be,_e,Le){var Se=1,pe,Te=!1;if(be.hasOwnProperty("allowUpscale")&&(Te=be.allowUpscale),be.hasOwnProperty("scale")&&(Se=parseFloat(be.scale),(isNaN(Se)||Se===null||Se===0)&&(Se=1),Se>1&&(Te=!0)),_e&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Te=!0),!(be.hasOwnProperty("disableAutoScale")&&be.disableAutoScale))pe=fe(be,_e,Te,Le,be.scaleContainerClass);else return Se;return Te&&(!be.hasOwnProperty("scale")||Se===1)?pe:Math.min(Se,pe)}function Fe(be){var _e=Math.min(window.innerWidth,document.documentElement.clientWidth),Le=Math.min(window.innerHeight,document.documentElement.clientHeight),Se=be.getBoundingClientRect(),pe=(_e-Se.width)/2,Te=(Le-Se.height)/2;Te<0&&(Te=0),be.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(pe<40?be.style.left="40px":be.style.left=pe+"px",be.style.top=Te+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(Te<40?be.style.top="40px":be.style.top=Te+"px",be.style.left=pe+"px")}function Ye(be,_e){var Le=be.querySelector(".appletParameters");if(Le){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(_e.id!==Le.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(be)}if(Le.parentElement&&/fullscreen/.test(Le.parentElement.className))return;var Se=tt(_e,be);Ln()&&Le.setAttribute("data-param-scale",Se);for(var pe=null,Te=0;Te<be.childNodes.length;Te++)if(be.childNodes[Te].className!==void 0&&be.childNodes[Te].className.match(/^applet_scaler/)){pe=be.childNodes[Te];break}if(pe!==null&&pe.querySelector(".noscale")!==null)return;var gt=_e.id!==void 0?_e.id:"ggbApplet",ze=window[gt];(ze==null||!ze.recalculateEnvironments)&&pe!==null&&!pe.className.match(/fullscreen/)&&(pe.parentNode.style.transform="",!isNaN(Se)&&Se!==1?(pe.parentNode.style.width=_e.width*Se+"px",pe.parentNode.style.height=_e.height*Se+"px",qt(pe,Se)):(qt(pe,1),pe.parentNode.style.width=_e.width+"px",pe.parentNode.style.height=_e.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&Fe(be),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(Le).parents(".content-added-content"))}}return{responsiveResize:Ye,isFlexibleWorksheetEditor:Ln,positionCenter:Fe,getScale:tt,scaleElement:qt}}();__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 Ln=n.location.search;return Ln.indexOf(J)!=-1||Ln.indexOf(K)!=-1}function q(Ln,qt){}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(Ln){var qt=s[L].bindings;s[L].bindings=function(){for(var ce=qt?qt():{},fe=Ln[webModule.__softPermutationId],tt=O;tt<fe.length;tt++){var Fe=fe[tt];ce[Fe[O]]=Fe[P]}return ce}};var t;function u(){return v(),t}function v(){if(!t){var Ln=o.createElement(Q);if(Ln.id=L,Ln.style.cssText=R+S,Ln.tabIndex=-1,o.body.appendChild(Ln),t=Ln.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var qt=document.compatMode==U?V:W;t.write(qt+X),t.close()}}}function w(Ln){function qt(fe){function tt(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var Fe=tt();if(Fe){fe();return}function Ye(){if(!Fe){if(!tt())return;Fe=!0,fe(),o.removeEventListener&&o.removeEventListener(Z,Ye,!1),be&&clearInterval(be)}}o.addEventListener&&o.addEventListener(Z,Ye,!1);var be=setInterval(function(){Ye()},$)}function ce(fe){var tt=u(),Fe=tt.body,Ye=tt.createElement(_);Ye.language=ab,Ye.crossOrigin=W,Ye.src=fe,webModule.__errFn&&(Ye.onerror=function(){webModule.__errFn(L,new Error(bb+fe))}),Fe.appendChild(Ye)}qt(function(){ce(Ln)})}webModule.__startLoadingFragment=function(Ln){return C(Ln)},webModule.__installRunAsyncCode=function(Ln){var qt=u(),ce=qt.body,fe=qt.createElement(_);fe.language=ab,fe.text=Ln,ce.appendChild(fe),ce.removeChild(fe)};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(Ln){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(Ln){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(Ln){var qt=c[Ln];return qt==null?null:qt},r=d,webModule.__errFn=e}function B(){function Ln(be){var _e=be.lastIndexOf(rb);_e==-1&&(_e=be.length);var Le=be.indexOf(sb);Le==-1&&(Le=be.length);var Se=be.lastIndexOf(tb,Math.min(Le,_e));return Se>=O?be.substring(O,Se+P):W}function qt(be){if(!be.match(/^\w+:\/\//)){var _e=o.createElement(ub);_e.src=be+vb,be=Ln(_e.src)}return be}function ce(){var be=__gwt_getMetaProperty(wb);return be!=null?be:W}function fe(){for(var be=o.getElementsByTagName(_),_e=O;_e<be.length;++_e)if(be[_e].src.indexOf(xb)!=-1)return Ln(be[_e].src);return W}function tt(){var be=o.getElementsByTagName(yb);return be.length>O?be[be.length-P].href:W}function Fe(){var be=o.location;return be.href==be.protocol+zb+be.host+be.pathname+be.search+be.hash}var Ye=ce();return Ye==W&&(Ye=fe()),Ye==W&&(Ye=tt()),Ye==W&&Fe()&&(Ye=Ln(o.location.href)),Ye=qt(Ye),Ye}function C(Ln){return Ln.match(/^\//)||Ln.match(/^[a-zA-Z]+:\/\//)?Ln:webModule.__moduleBase+Ln}function D(){var Ln=[],qt=O,ce=[],fe=[];function tt(be){var _e=fe[be](),Le=ce[be];if(_e in Le)return _e;var Se=[];for(var pe in Le)Se[Le[pe]]=pe;throw r&&r(be,Se,_e),null}if(__gwt_isKnownPropertyValue=function(be,_e){return _e in ce[be]},webModule.__getPropMap=function(){var be={};for(var _e in ce)ce.hasOwnProperty(_e)&&(be[_e]=tt(_e));return be},webModule.__computePropValue=tt,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var Fe;try{Fe=Cb;var Ye=Fe.indexOf(Db);Ye!=-1&&(qt=parseInt(Fe.substring(Ye+P),$),Fe=Fe.substring(O,Ye))}catch(be){}return webModule.__softPermutationId=qt,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(Ln,qt,ce){"use strict";ce.d(qt,{Ax:function(){return Ye},Ds:function(){return be},KI:function(){return Le},SI:function(){return Fe},f1:function(){return tt}});var fe=ce(11320);function tt(Se){let pe=!0;if(Se.length>0){for(let Te=0;Te<Se.length;Te++)if(Se[Te].compile_success==0||!Se[Te].compile_success){pe=!1;break}}else pe=!1;return pe}function Fe(Se,pe=""){let Te=[];for(let gt=0;gt<Se.length;gt++){let ze=Se[gt],Pt=pe?`${pe}/${ze.name}`:`${ze.name}`;Te.push({title:ze.name,type:ze.type,isLeaf:ze.type!=="tree",key:Pt})}return Te}function Ye(Se,pe,Te){for(let gt=0;gt<Se.length;gt++){let ze=Se[gt];if(ze.key===pe){ze.children=Te;break}ze.children&&Ye(ze.children,pe,Te)}return Se}function be(Se,pe,Te){let gt;return function(){let ze=this,Pt=arguments,kt=function(){gt=null,Te||Se.apply(ze,Pt)},pt=Te&&!gt;clearTimeout(gt),gt=setTimeout(kt,pe),pt&&Se.apply(ze,Pt)}}const _e=!0,Le=fe.Z.API_SERVER},63205:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return gt}});var fe=ce(67294),tt={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},Fe=ce(94184),Ye=ce.n(Fe),be=ce(57953),_e=ce(15979),Le=ce(33170),Se=ce(28706),pe=(ze,Pt,kt)=>new Promise((pt,Je)=>{var De=nt=>{try{Yt(kt.next(nt))}catch(ct){Je(ct)}},Dt=nt=>{try{Yt(kt.throw(nt))}catch(ct){Je(ct)}},Yt=nt=>nt.done?pt(nt.value):Promise.resolve(nt.value).then(De,Dt);Yt((kt=kt.apply(ze,Pt)).next())}),gt=({data:ze,className:Pt,fullWidth:kt,style:pt={},onClose:Je,onOk:De,showFullTools:Dt,noAssociationId:Yt})=>{const nt=(0,fe.useRef)(null),ct=(0,fe.useRef)(null),Ie=(0,fe.useRef)(null),Me=(0,fe.useRef)(null),[Ve,Xe]=(0,fe.useState)(!1),[Ct,wt]=(0,fe.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,fe.useEffect)(()=>{Ie.current||(Ie.current=document.createElement("style"),document.head.appendChild(Ie.current)),ze!=null&&ze.visible?(document.body.setAttribute("data-custom","y-hidden"),Ie.current.innerHTML=" html { overflow-y: hidden; }",ze!=null&&ze.src&&Mt()):(document.body.removeAttribute("data-custom"),Ie.current&&(document.head.removeChild(Ie.current),Ie.current=null))},[ze==null?void 0:ze.visible]);const Mt=()=>pe(void 0,null,function*(){Xe(!0),wt("\u6B63\u5728\u52A0\u8F7D\u4E2D");const jt=yield(0,Se.ZJ)(ze==null?void 0:ze.src);nt.current.src="",nt.current.src=jt,nt.current.onload=function(){xn()},Xe(!1),wt("")}),je=()=>{document.body.removeAttribute("data-custom"),Ie.current.innerHTML=" ",Je()},Rt=jt=>pe(void 0,null,function*(){Xe(!0),wt("\u6B63\u5728\u4FDD\u5B58\u4E2D");const vn=yield(0,Le.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:ze.title,file:jt.dataUrl}});vn!=null&&vn.id&&!Yt?(yield(0,Le.ZP)(`/api/attachments/${ze.id}/add_subitem.json`,{method:"post",body:{subitem_id:vn==null?void 0:vn.id,settings:JSON.stringify(jt.state)}})).status===0&&De():vn!=null&&vn.id&&De(vn),document.body.removeAttribute("data-custom"),Ie.current.innerHTML=" ",Xe(!1),wt("")}),At=()=>{const jt=document.querySelector('a[href="https://markerjs.com/"]');jt&&jt.parentNode&&(jt.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(er=>{const Sr=document.querySelector(er.name);Sr&&Sr.setAttribute("title",er.title)})},xn=()=>{ct.current=new _e.hP(nt.current),ct.current.targetRoot=Me.current,ct.current.addEventListener("render",Rt),ct.current.addEventListener("beforeclose",je),Dt&&(ct.current.availableMarkerTypes=ct.current.ALL_MARKER_TYPES,ct.current.uiStyleSettings.redoButtonVisible=!0,ct.current.uiStyleSettings.notesButtonVisible=!0,ct.current.uiStyleSettings.zoomButtonVisible=!0,ct.current.uiStyleSettings.zoomOutButtonVisible=!0,ct.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=ct.current.uiStyleSettings,ct.current.show(),ze!=null&&ze.snapshotData&&ct.current.restoreState(ze.snapshotData),setTimeout(()=>{window.scrollTo(0,0),At()},300)};return fe.createElement(fe.Fragment,null,(ze==null?void 0:ze.visible)&&fe.createElement(be.Z,{spinning:Ve,tip:Ct,style:{position:"absolute"}},fe.createElement("div",{ref:Me,className:Ye()(tt.imageDimensions,Pt,kt?tt.fullWidth:""),style:pt},fe.createElement("img",{className:tt.img,ref:nt}))))}},36527:function(Ln,qt,ce){"use strict";var fe=ce(67294),tt=ce(71230),Fe=ce(15746),Ye=ce(66368),be=ce(71577),_e=ce(35598),Le=ce(71736),Se=ce(84279),pe=ce(67294);const Te=(0,fe.forwardRef)(({callback:gt,showSaveButton:ze,value:Pt=""},kt)=>{const pt=(0,fe.useRef)(),Je=[{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 "}]}]}],De=[{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}`}]}]}],Dt=ct=>{pt.current.setValue(pt.current.getValue()+" "+ct.value+" ")},Yt=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:pe.createElement(tt.Z,{className:Le.Z.lists,gutter:[10,10]},Je.map((ct,Ie)=>pe.createElement(Fe.Z,{flex:"110px",className:Le.Z.item},pe.createElement("div",null,pe.createElement(_e.Z,{value:`$$${ct.value}$$`}),ct.name),pe.createElement("div",{className:Le.Z.children},ct.children.map((Me,Ve)=>pe.createElement("div",{key:Ve},pe.createElement("h1",null,Me.name),pe.createElement(tt.Z,{gutter:[10,10]},Me.data.map((Xe,Ct)=>pe.createElement(Fe.Z,{key:Ct,onClick:()=>Dt(Xe),className:Le.Z.diamond},pe.createElement(_e.Z,{value:"`$$"+Xe.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:pe.createElement(tt.Z,{className:Le.Z.lists,gutter:[10,10]},De.map((ct,Ie)=>pe.createElement(Fe.Z,{flex:"110px",className:Le.Z.item},pe.createElement("div",null,pe.createElement(_e.Z,{value:"`$$"+ct.value+"$$`"}),ct.name),pe.createElement("div",{className:Le.Z.children},ct.children.map((Me,Ve)=>pe.createElement("div",{key:Ve},Me.name&&pe.createElement("h1",null,Me.name),pe.createElement(tt.Z,{gutter:[10,10]},Me.data.map((Xe,Ct)=>pe.createElement(Fe.Z,{key:Ct,onClick:()=>Dt(Xe),className:Le.Z.diamond},pe.createElement(_e.Z,{value:"`$$"+Xe.value+"$$`"}))))))))))}],nt=()=>{var ct=document.createElement("div");ct.innerHTML=pt.current.getValue();var Ie=ct.innerText;return gt&&gt(Ie),Ie};return(0,fe.useImperativeHandle)(kt,()=>({getData:nt})),pe.createElement("div",{className:Le.Z.mathWrap},pe.createElement(Ye.default,{defaultActiveKey:"1",items:Yt}),pe.createElement("math-field",{locale:"zh_cn",className:Le.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:pt,style:{width:800,marginTop:30,fontSize:18}},Pt||""),ze&&pe.createElement("div",{className:Le.Z.button},pe.createElement(be.ZP,{size:"large",onClick:nt,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});qt.Z=Te},57444:function(Ln,qt,ce){"use strict";ce.d(qt,{h:function(){return ct}});var fe=ce(67294),tt=ce(11713),Fe=ce(22150),Ye=ce(71577),be=ce(4631),_e=ce.n(be),Le=ce(71749),Se=ce(30483),pe=Object.defineProperty,Te=Object.defineProperties,gt=Object.getOwnPropertyDescriptors,ze=Object.getOwnPropertySymbols,Pt=Object.prototype.hasOwnProperty,kt=Object.prototype.propertyIsEnumerable,pt=(Ie,Me,Ve)=>Me in Ie?pe(Ie,Me,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):Ie[Me]=Ve,Je=(Ie,Me)=>{for(var Ve in Me||(Me={}))Pt.call(Me,Ve)&&pt(Ie,Ve,Me[Ve]);if(ze)for(var Ve of ze(Me))kt.call(Me,Ve)&&pt(Ie,Ve,Me[Ve]);return Ie},De=(Ie,Me)=>Te(Ie,gt(Me));const Dt=tt.default.Option,Yt={labelCol:{span:4},wrapperCol:{span:20}},nt={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"]};qt.Z=({callback:Ie,onCancel:Me})=>{const[Ve,Xe]=(0,fe.useState)("python");function Ct(Mt){Xe(nt[Mt][1])}function wt(Mt){Ie(Mt)}return fe.createElement(Fe.default,De(Je({},Yt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:wt,style:{width:500}}),fe.createElement(Fe.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},fe.createElement(tt.default,{getPopupContainer:Mt=>Mt.parentNode,onChange:Ct},Object.keys(nt).map(Mt=>fe.createElement(Dt,{key:Mt,value:Mt},nt[Mt][0])))),fe.createElement(Fe.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},fe.createElement(ct,{mode:Ve})),fe.createElement("div",{className:"flex-container flex-end"},fe.createElement(Ye.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),fe.createElement(Ye.ZP,{type:"ghost",onClick:Me},"\u53D6\u6D88")))};function ct({value:Ie,onChange:Me,mode:Ve,options:Xe={}}){const Ct=(0,fe.useRef)(),[wt,Mt]=(0,fe.useState)();return(0,fe.useEffect)(()=>{if(wt){let je=function(Rt){const At=Rt.getValue();Me&&Me(At)};return wt.on("change",je),()=>{wt.off("change",je)}}},[wt,Me]),(0,fe.useEffect)(()=>{wt&&wt.setOption("mode",Ve)},[wt,Ve]),(0,fe.useEffect)(()=>{wt&&(Ie!==wt.getValue()||Ie==="")&&setTimeout(()=>{wt.setValue(Ie||"")},300)},[wt,Ie]),(0,fe.useEffect)(()=>{if(Ct.current&&!wt){const je=_e().fromTextArea(Ct.current,Je({mode:Ve,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Xe));Mt(je)}},[Ct.current,wt]),fe.createElement("div",{className:"my-codemirror-container"},fe.createElement("textarea",{ref:Ct}))}},91304:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return pr}});var fe=ce(67294),tt=ce(4631),Fe=ce.n(tt),Ye=ce(91033),be=ce(71749),_e=ce(57341),Le=ce(82801),Se=ce(88386),pe=ce(49047),Te=ce(80785),gt=ce(35598),ze=({value:Kn="",className:Ue,showTextOnly:it,showLines:_t,style:Ut={}})=>{const Ke=(0,fe.useMemo)(()=>"",[Kn]);return fe.createElement(fe.Fragment,null,fe.createElement("div",{dangerouslySetInnerHTML:{__html:Ke}}))},Pt=ce(67294),kt=Object.defineProperty,pt=Object.defineProperties,Je=Object.getOwnPropertyDescriptors,De=Object.getOwnPropertySymbols,Dt=Object.prototype.hasOwnProperty,Yt=Object.prototype.propertyIsEnumerable,nt=(Kn,Ue,it)=>Ue in Kn?kt(Kn,Ue,{enumerable:!0,configurable:!0,writable:!0,value:it}):Kn[Ue]=it,ct=(Kn,Ue)=>{for(var it in Ue||(Ue={}))Dt.call(Ue,it)&&nt(Kn,it,Ue[it]);if(De)for(var it of De(Ue))Yt.call(Ue,it)&&nt(Kn,it,Ue[it]);return Kn},Ie=(Kn,Ue)=>pt(Kn,Je(Ue));let Me=[{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 Ve({onActionCallback:Kn,title:Ue,icon:it,actionName:_t,className:Ut="",children:Ke}){function ut(){Kn(_t)}return Pt.createElement("a",{title:Ue,className:Ut,onClick:ut},Pt.createElement("i",{className:`${it}`}),Ke)}var Xe=({watch:Kn,showNullButton:Ue,showNullProgramButton:it,onActionCallback:_t,fullScreen:Ut,insertTemp:Ke,hidetoolBar:ut,extraUse:Ot})=>{const Tt=[...Me,{title:`${Kn?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${Kn?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return Pt.createElement("ul",{className:"markdown-toolbar-container"},!ut&&Tt.map((zt,Ht)=>Pt.createElement("li",{key:Ht},zt.actionName?Pt.createElement(Ve,Ie(ct({},zt),{onActionCallback:_t})):Pt.createElement("span",{className:"v-line"}))),Ue?Pt.createElement("li",null,Pt.createElement(Ve,{icon:"iconfont icon-tianjia5 insert-blank",className:"btn-null ml5",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:_t},Pt.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u65B0\u589E\u586B\u7A7A\u9879"))):null,it?Pt.createElement(Pt.Fragment,null,Pt.createElement("li",null,Pt.createElement(Ve,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:_t},Pt.createElement("span",{className:"fill-tip"},"+\u5355\u884C\u586B\u7A7A\u9879"))),Pt.createElement("li",null,Pt.createElement(Ve,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:_t},Pt.createElement("span",{className:"fill-tip"},"+\u591A\u884C\u586B\u7A7A\u9879")))):null,Ke&&Pt.createElement("li",null,Pt.createElement(Ve,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${Ke}`,onActionCallback:_t},Pt.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),Ot&&Pt.createElement("li",null,Ot),Pt.createElement("li",{className:"btn-full-screen"},Pt.createElement(Ve,{icon:`${Ut?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:Ut?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:_t})))},Ct=ce(76621),wt=ce(22150),Mt=ce(69677),je=ce(71577),Rt=Object.defineProperty,At=Object.defineProperties,xn=Object.getOwnPropertyDescriptors,jt=Object.getOwnPropertySymbols,vn=Object.prototype.hasOwnProperty,er=Object.prototype.propertyIsEnumerable,Sr=(Kn,Ue,it)=>Ue in Kn?Rt(Kn,Ue,{enumerable:!0,configurable:!0,writable:!0,value:it}):Kn[Ue]=it,qe=(Kn,Ue)=>{for(var it in Ue||(Ue={}))vn.call(Ue,it)&&Sr(Kn,it,Ue[it]);if(jt)for(var it of jt(Ue))er.call(Ue,it)&&Sr(Kn,it,Ue[it]);return Kn},Ae=(Kn,Ue)=>At(Kn,xn(Ue));const $t={labelCol:{span:4},wrapperCol:{span:20}};var Hn=({callback:Kn,onCancel:Ue})=>{function it(_t){Kn(_t)}return fe.createElement(wt.default,Ae(qe({},$t),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:it,style:{width:500}}),fe.createElement(wt.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},fe.createElement(Mt.default,null)),fe.createElement(wt.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},fe.createElement(Mt.default,null)),fe.createElement("div",{className:"flex-container flex-end"},fe.createElement(je.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),fe.createElement(je.ZP,{type:"ghost",onClick:Ue},"\u53D6\u6D88")))},bn=ce(57444),at=ce(70859),ft=ce(14446),Gt=ce(71230),zn=ce(63205),mn=ce(67294),nn=({callback:Kn,onCancel:Ue})=>{const it=document.createElement("canvas"),_t=it.getContext("2d");it.width=1e3,it.height=800,_t.fillStyle="#ffffff",_t.fillRect(0,0,it.width,it.height);const Ut=it.toDataURL("image/png");return mn.createElement(ft.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},mn.createElement(Gt.Z,{style:{height:"100vh"}},mn.createElement(zn.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:Ut,visible:!0,title:String(Date.now())},onOk:Ke=>{Kn({src:Ke.url})},onClose:Ue})))},Ft=ce(72565),Pn=ce(15746),_n=ce(2453),Ee={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},ue=ce(67294),ye=(0,fe.forwardRef)(({onCancel:Kn,editImgId:Ue,callback:it},_t)=>{let Ut=(0,fe.useRef)(),Ke=(0,fe.useRef)(),ut=(0,fe.useRef)(),Ot=(0,fe.useRef)(!1);const Tt=(0,fe.useRef)(!1);console.log("ref:",_t);const[zt,Ht]=(0,fe.useState)(0),[$n,Cr]=(0,fe.useState)("100vh");return(0,fe.useEffect)(()=>{Ht(1);try{indexedDB.databases().then(Yn=>{Yn.forEach(qn=>indexedDB.deleteDatabase(qn.name))})}catch(Yn){}},[]),(0,fe.useImperativeHandle)(_t,()=>({setHeight:Cr})),ue.createElement("div",{ref:Tt,className:"body-overflow-initial"},ue.createElement(Ft.Z,{width:"100vw",height:$n,footer:null,closable:!0,placement:"bottom",open:!!zt,destroyOnClose:!0,maskClosable:!1,mask:!1,rootClassName:`zIndex-9999 ${Ee.drawerWrap}`,onClose:()=>{window.saveDrawData(Yn=>{it({src:`/api/attachments/${Yn}`,id:Yn})})},title:ue.createElement(Gt.Z,{align:"middle"},ue.createElement(Pn.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),ue.createElement(Pn.Z,{onClick:()=>{Cr($n==="60px"?"100vh":"60px")}},ue.createElement("span",{className:"current c-blue",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77")),ue.createElement(Pn.Z,{onClick:()=>{window.saveDrawData(Yn=>{if(Yn===null){_n.ZP.warning({content:"\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u8BF7\u5148\u7ED8\u5236\u6D41\u7A0B\u56FE",key:"saveFlowChart"});return}_n.ZP.success({content:"\u4FDD\u5B58\u6210\u529F",key:"saveFlowChart",style:{zIndex:999999999}}),it({src:`/api/attachments/${Yn}`,id:Yn,disabledClose:!0})})}},ue.createElement(je.ZP,{type:"primary",className:"ml20"},"\u4FDD\u5B58")))},ue.createElement("iframe",{src:`${window.ENV==="build"?"/react/build":""}/drawio/src/main/webapp/?id=${Ue||""}&gapi=0&od=0&db=0&gh=0&gl=0&local=0`,width:"100%",height:"100%",frameBorder:"0",ref:Ke})))}),ve=ce(11320),le=ce(78045),We=ce(31795);const Lt=le.ZP.Group,tn={margin:"0 8px"};var hn=({callback:Kn,onCancel:Ue})=>{function it(_t){Kn(_t)}return fe.createElement(wt.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:it},fe.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},fe.createElement("span",{style:tn},"\u5355\u5143\u683C\u6570\uFF1A"),fe.createElement("span",{style:tn},"\u884C\u6570"),fe.createElement(wt.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},fe.createElement(We.Z,null)),fe.createElement("span",{style:tn},"\u5217\u6570"),fe.createElement(wt.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},fe.createElement(We.Z,null))),fe.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},fe.createElement("span",{style:tn},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),fe.createElement(wt.default.Item,{name:"align"},fe.createElement(Lt,null,fe.createElement(le.ZP,{value:"default"},fe.createElement("i",{className:"fa fa-align-justify"})),fe.createElement(le.ZP,{value:"left"},fe.createElement("i",{className:"fa fa-align-left"})),fe.createElement(le.ZP,{value:"center"},fe.createElement("i",{className:"fa fa-align-center"})),fe.createElement(le.ZP,{value:"right"},fe.createElement("i",{className:"fa fa-align-right"}))))),fe.createElement("div",{className:"flex-container flex-end"},fe.createElement(je.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),fe.createElement(je.ZP,{type:"ghost",onClick:Ue},"\u53D6\u6D88")))},sn=ce(47897),yn=ce(61016),ln=ce.n(yn),Fr=(0,fe.forwardRef)(({use3d:Kn,width:Ue,height:it,callback:_t,showSaveButton:Ut},Ke)=>{const ut=(0,fe.useRef)(),Ot=(0,fe.useRef)(),[Tt,zt]=(0,fe.useState)(!1),Ht=(0,fe.useRef)({id:ut,appName:"graphing",width:Ue||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,fe.useEffect)(()=>{Ot.current=new(ln())(Ht.current,!0),window.onload=function(){Ot.current.inject("applet_container")}},[]);const $n=()=>{var Cr=window.ggbApplet.getPNGBase64(1,!0,72);return _t&&_t(Cr),Cr};return(0,fe.useEffect)(()=>{Ht.current.appName=Tt?"3D":"graphing",Ot.current.inject("applet_container")},[Tt]),(0,fe.useEffect)(()=>{zt(Kn)},[Kn]),(0,fe.useImperativeHandle)(Ke,()=>({getImgData:$n})),fe.createElement(fe.Fragment,null,fe.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:ut}),fe.createElement(Gt.Z,{align:"middle"},fe.createElement(Pn.Z,{flex:1},fe.createElement(sn.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:Tt,onChange:Cr=>zt(Cr)})),fe.createElement(Pn.Z,null,fe.createElement(je.ZP,{size:"large",onClick:$n,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),Nt=ce(36527),Rn=ce(25934);const Gr="link",li="upload-image",st="add-flowchart",Wt="draw-image",Vn="add-flowchart",ir="code-block",gr="add-table",Pr="------------",Ur={default:Pr,left:`:${Pr}`,center:`:${Pr}:`,right:`${Pr}:`};var Xr=ce(99914),qr=(Kn,Ue,it)=>new Promise((_t,Ut)=>{var Ke=Tt=>{try{Ot(it.next(Tt))}catch(zt){Ut(zt)}},ut=Tt=>{try{Ot(it.throw(Tt))}catch(zt){Ut(zt)}},Ot=Tt=>Tt.done?_t(Tt.value):Promise.resolve(Tt.value).then(Ke,ut);Ot((it=it.apply(Kn,Ue)).next())});function ui(){}let br=0;const Ei=1e4,sa="\u2581",Ji="@\u2581\u2581@",Qi="@\u2581@",Ci=`
**\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`,mt=["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 Mn(Kn){return/^\d+$/.test(Kn)?`${Kn}px`:Kn}const An=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",sr={[An+"-B"]:"bold",[An+"-I"]:"italic"},nr={[Gr]:"\u6DFB\u52A0\u94FE\u63A5",[ir]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[li]:"\u6DFB\u52A0\u56FE\u7247",[Wt]:"\u6DFB\u52A0\u753B\u56FE",[st]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[gr]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var pr=({defaultValue:Kn="",onChange:Ue,width:it="100%",height:_t=400,miniToolbar:Ut=!1,isFocus:Ke=!1,watch:ut,insertTemp:Ot,mode:Tt="markdown",id:zt="markdown-editor-id",showResizeBar:Ht=!1,noStorage:$n=!1,showNullButton:Cr=!1,showNullProgramButton:Yn=!1,hidetoolBar:qn=!1,fullScreen:rr=!1,onBlur:ar,onCMBeforeChange:ot,onFullScreen:Qe,className:vt="",disablePaste:Qt=!1,disabled:Tn=!1,disabledFill:en=!1,placeholder:cn="",values:un="",extraUse:Dn,onAddBlank:or})=>{const[Kt,Yr]=(0,fe.useState)(null),[$r,Ri]=(0,fe.useState)(Kn),[Li,pi]=(0,fe.useState)(ut),[Gi,yi]=(0,fe.useState)(rr),[ii,Ni]=(0,fe.useState)(""),[Zi,Vr]=(0,fe.useState)(0),[mi,Wi]=(0,fe.useState)(_t),[la,ea]=(0,fe.useState)(!1),ti=(0,fe.useRef)((0,Rn.Z)()),yt=(0,fe.useRef)(!1),ht=(0,fe.useRef)(),[Bt,an]=(0,fe.useState)(0),[kn,ur]=(0,fe.useState)(0),Er=(0,fe.useRef)(),Br=(0,fe.useRef)(),Hr=(0,fe.useRef)(),Nr=(0,fe.useRef)(),ei=(0,fe.useRef)(),gi=(0,fe.useRef)(),Mr=()=>qr(void 0,null,function*(){var pn;const dn=yield Fetch("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:ti.current}});(pn=dn==null?void 0:dn.attachments)!=null&&pn.length&&(console.log("cm:",Kt,Er),dn.attachments.map(Cn=>{Cn.content_type.indexOf("image")>-1?Kt.replaceSelection(`![,](/api/attachments/${Cn.id}?type=${Cn.content_type})`):Cn.content_type.indexOf("video")>-1?Kt.replaceSelection(`<video width="100%" controls src="${ve.Z.API_SERVER}/api/attachments/${data.id}"></video>`):Cn.content_type.indexOf("pdf")>-1?Kt.replaceSelection(`<a href="${ve.Z.API_SERVER}/api/attachments/${Cn.id}?type=${Cn.content_type}&disposition=inline" target="_blank">${Cn.name}</a>`):Kt.replaceSelection(`[${Cn.name}](${ve.Z.API_SERVER}/api/attachments/${Cn.id}?type=${Cn.content_type})`)}))});(0,fe.useEffect)(()=>{const pn=window.scrollY||window.pageYOffset;Ri(un),Kt==null||Kt.setValue(un),window.scrollTo(0,pn)},[un]),(0,fe.useEffect)(()=>{Qe==null||Qe(Gi)},[Gi]),(0,fe.useEffect)(()=>{if(Er.current){let pn=function(Cn,In){var cr;if(Qt){In.preventDefault();return}const jn=In.clipboardData;if(jn){const Zn=jn.types.toString(),Jn=jn.items;if(Zn==="Files"||jn.types.indexOf("Files")>-1){if(In.preventDefault(),Tt=="stex")return;try{let Qn=Jn[1];((cr=Jn[0])==null?void 0:cr.kind)==="file"&&(Qn=Jn[0]);const hr=Qn.getAsFile(),Pe=hr.name.split(".").pop();(0,at.I)(hr,$e=>{var xt,rt,It;$e.id?((xt=hr==null?void 0:hr.type)==null?void 0:xt.indexOf("image"))>-1?dn.replaceSelection(`<img width="100%" src="/api/attachments/${$e.id}?type=${$e.content_type})" alt="" />`):((rt=hr==null?void 0:hr.type)==null?void 0:rt.indexOf("video"))>-1?dn.replaceSelection(`<video width="100%" controls src="/api/attachments/${$e.id}"></video>`):((It=hr==null?void 0:hr.type)==null?void 0:It.indexOf("pdf"))>-1?dn.replaceSelection(`<a href="/api/attachments/${$e.id}?type=${hr.type}&disposition=inline" target="_blank">${hr.name}</a>`):mt.includes(Pe)?dn.replaceSelection(`<a href="/api/attachments/${$e.id}?type=office&disposition=inline" target="_blank">${hr.name}</a>`):dn.replaceSelection(`[${hr.name}](/api/attachments/${$e.id}?type=${$e.content_type})`):($e==null?void 0:$e.status)===401&&(_n.ZP.warning(($e==null?void 0:$e.message)||"\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C"),document.location.href="/user/login")})}catch(Qn){_n.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const dn=Fe().fromTextArea(Er.current,{mode:Tt,lineNumbers:!Ut,lineWrapping:!0,value:Kn,autoCloseTags:!Yn,autoCloseBrackets:!0});return dn.on("keyup",function(Cn,In){In.keyCode===8&&(Cn.getValue()==""?dn.setOption("placeholder",cn):dn.setOption("placeholder",null))}),dn.on("keydown",function(Cn,In){if(In.keyCode===8){var cr=Ai(Cn);cr&&In.preventDefault()}}),Ke&&dn.focus(),dn.on("paste",pn),dn.on("dragleave",function(Cn,In){Br.current.classList.remove("mouse-hover-md")}),Tn&&dn.on("beforeChange",function(Cn,In){(In.origin==="paste"||In.origin==="+input")&&In.cancel()}),Yr(dn),()=>{dn.off("paste",pn)}}},[]);const fi=(0,fe.useCallback)(()=>{if(Br.current)try{}catch(pn){console.log(pn,"---- to set md editor body height")}},[mi,Br,Gi]);(0,fe.useEffect)(()=>{function pn(){let dn=new Ye.Z(Cn=>{for(let In of Cn)(In.target.offsetHeight>0||In.target.offsetWidth>0)&&(fi(),Kt.setSize("100%","100%"),Kt.refresh())});return dn.observe(Er.current.parentElement),dn}if(Kt){const dn=pn();return()=>{var Cn,In;(Cn=Er.current)!=null&&Cn.parentElement&&dn.unobserve((In=Er.current)==null?void 0:In.parentElement)}}},[Kt,fi]),(0,fe.useEffect)(()=>{if(Kt){let pn=[];for(const[dn,Cn]of Object.entries(sr)){let In={[dn]:()=>{Si(Cn)}};pn.push(In),Kt.addKeyMap(In)}return ht.current=setInterval(()=>{yt.current&&Mr()},4e3),()=>{clearInterval(ht.current);for(let dn of pn)Kt.removeKeyMap(dn)}}},[Kt]),(0,fe.useEffect)(()=>{rr!==Gi&&yi(rr)},[rr]),(0,Xr.Z)(()=>{if(!$n&&Zi>0){let pn=new Date().getTime(),dn=window.sessionStorage.getItem(zt);pn>=Zi+Ei&&(!dn||dn!==$r)&&(window.sessionStorage.setItem(zt,$r),ea(!0))}},Ei),(0,fe.useEffect)(()=>{pi(ut)},[Kt,ut]),(0,fe.useEffect)(()=>{Kt&&Ke&&Kt.focus()},[Kt,Ke]),(0,fe.useEffect)(()=>{if(Li&&Kt){let pn=function(Cn){let In=Cn.target;if(Nr.current){let cr=In.scrollTop/In.scrollHeight;Nr.current.scrollTop=Nr.current.scrollHeight*cr}};const dn=Kt.getScrollerElement();return dn.addEventListener("scroll",pn),()=>{dn.removeEventListener("scroll",pn)}}},[Kt,Li]),(0,fe.useEffect)(()=>{if(Kt&&ot){let pn=function(dn,Cn){ot(dn,Cn)};return Kt.on("beforeChange",pn),()=>{Kt.off("beforeChange",pn)}}},[Kt,ot]),(0,fe.useEffect)(()=>{if(Kt&&ar){let pn=function(){ar(Kt.getValue())};return Kt.on("blur",pn),()=>{Kt.off("blur",pn)}}},[Kt,ar]);function Ai(pn,dn){var Cn=pn.getDoc(),In=Cn.getCursor(),cr=Cn.getLine(In.line),jn=cr.charAt(In.ch-1),Zn=cr.lastIndexOf("@\u2581@",In.ch),Jn=cr.lastIndexOf("@\u2581\u2581@",In.ch),Qn=Zn>Jn?Zn:Jn,hr=Zn>Jn?3:4;if(Ji.indexOf(jn)===-1)return null;if(console.log("change1:",dn,pn,cr,In,Qn,Zn,Jn,jn),Qn>=0&&In.ch-Qn<5){var Pe=Qn+hr;return Cn.replaceRange("",{line:In.line,ch:Qn},{line:In.line,ch:Pe}),{line:In.line,ch:Pe}}return null}(0,fe.useEffect)(()=>{if(Kt){let pn=function(dn,Cn){const In=dn.getValue();Ri(In),Vr(new Date().getTime()),dn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ue&&(Yn?Ue(In,Zt(In)):Ue(In))};return Kt.on("change",pn),()=>{Kt.off("change",pn)}}},[Kt,Ue]),(0,fe.useEffect)(()=>{if(Kt)if(Kn==null)Kt.setValue(""),Ri("");else{const pn=window.scrollY||window.pageYOffset;Kn!==Kt.getValue()&&(Kt.setValue(Kn),Ri(Kn),Kt.setCursor(Tn?1:Kt.lineCount(),0),window.scrollTo(0,pn))}},[Kt,Kn]);const Si=(0,fe.useCallback)(pn=>{const dn=Kt.getCursor(),Cn=Kt.getSelection();let In=Cn.split(`
`);switch(pn){case"bold":return Kt.replaceSelection("**"+Cn+"**"),Cn===""&&Kt.setCursor(dn.line,dn.ch+2),Kt.focus();case"italic":return Kt.replaceSelection("*"+Cn+"*"),Cn===""&&Kt.setCursor(dn.line,dn.ch+1),Kt.focus();case"code":return Kt.replaceSelection("`"+Cn+"`"),Cn===""&&Kt.setCursor(dn.line,dn.ch+1),Kt.focus();case"inline-latex":return Ni("inline-latex"),Kt.focus();case"latex":return Kt.replaceSelection("```latex\n"+Cn+"\n```"),Kt.setCursor(dn.line+1,Cn.length+1),Kt.focus();case"line-break":return Kt.replaceSelection(`<br/>
`),Kt.focus();case"list-ul":return Cn===""?Kt.replaceSelection("- "+Cn):Kt.replaceSelection(In.map(cr=>cr===""?"":`- ${cr}`).join(`
`)),Kt.focus();case"list-ol":return Cn===""?Kt.replaceSelection("1. "+Cn):Kt.replaceSelection(In.map((cr,jn)=>cr===""?"":`${jn+1}. ${cr}`).join(`
`)),Kt.focus();case"add-null-ch":or==null||or();return;case"add-signal":return Cn===""&&Kt.setCursor(dn.line,dn.ch),Kt.replaceSelection(Qi),Kt.focus();case"add-multiple":return Cn===""&&Kt.setCursor(dn.line,dn.ch),Kt.replaceSelection(Ji),Kt.focus();case"inster-template-1":return Cn===""&&Kt.setCursor(dn.line,dn.ch),Kt.replaceSelection(Ci),Kt.focus();case"eraser":return Kt.setValue(""),Kt.focus();case"trigger-watch":return pi(!Li),Kt.focus();case"trigger-full-screen":return yi(!Gi),Kt.focus();case Gr:Ni(Gr);return;case ir:Ni(ir);return;case li:Ni(li);return;case Wt:Ni(Wt);return;case"maths-latex":Ni("maths-latex");return;case st:ei.current="",sessionStorage.removeItem("file_id"),Ni(st);return;case gr:Ni(gr);return;default:throw new Error}},[Kt,Li,Gi]),Ce=(0,fe.useCallback)((pn,dn)=>{var Cn,In,cr,jn,Zn,Jn;Ni("");const{src:Qn,alt:hr,id:Pe}=pn||{};switch(ii){case Gr:const{title:rn,link:fn}=pn;return Kt.replaceSelection(`[${rn}](${fn})`),Kt.focus();case ir:const{language:On,content:wn}=pn;return Kt.replaceSelection(["```"+On,wn,"```"].join(`
`)),Kt.focus();case"maths-latex":for(var $e=atob(pn),xt=new Uint8Array($e.length),rt=0;rt<$e.length;rt++)xt[rt]=$e.charCodeAt(rt);var It=new Blob([xt],{type:"image/png"});(0,at.I)(It,Zr=>{Zr.id?Kt.replaceSelection(`![,](/api/attachments/${Zr.id}?type=${Zr.content_type})`):(Zr==null?void 0:Zr.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":Kt.replaceSelection("`$$"+pn+"$$`");break;case Vn:if(!Pe)return;Kt.focus(),Kt.getValue().indexOf(Qn)===-1?Kt.replaceSelection(`<center><img id="${Pe}" width="80%" src="${Qn}" class="draw-flowchart" alt="${hr||""}" /></center>`):document.getElementById(Pe).src=ve.Z.API_SERVER+Qn+"?t="+Date.now();try{setTimeout(()=>{ar(Kt.getValue())},100)}catch(Zr){}break;case li:case Wt:const Xt=dn,Nn=(cr=(In=(Cn=Xt==null?void 0:Xt.name)==null?void 0:Cn.split("."))==null?void 0:In.pop)==null?void 0:cr.call(In);return((jn=Xt==null?void 0:Xt.type)==null?void 0:jn.indexOf("image"))>-1||!(Xt!=null&&Xt.type)?Xt!=null&&Xt.align||Xt!=null&&Xt.width?Kt.replaceSelection(`<p style="text-align:${Xt.align||"initial"}"><img width="${Xt.width?Xt.width+"%":"initial"}" src="${Qn}" alt="${hr||""}" /></p>`):Kt.replaceSelection(`<img width="100%" src="${Qn}" alt="${hr||""}" />`):((Zn=Xt==null?void 0:Xt.type)==null?void 0:Zn.indexOf("video"))>-1?Kt.replaceSelection(`<video width="100%" controls src="${Qn}"></video>`):((Jn=Xt==null?void 0:Xt.type)==null?void 0:Jn.indexOf("pdf"))>-1?Kt.replaceSelection(`<a href="${Qn}?type=${Xt.type}&disposition=inline" target="_blank">${Xt.name}</a>`):mt.includes(Nn)?Kt.replaceSelection(`<a href="${Qn}?type=office&disposition=inline" target="_blank">${Xt.name}</a>`):Kt.replaceSelection(`[${Xt.name}](${Qn})`),Kt.focus();case gr:const{row:Fn,col:mr,align:Bn}=pn;let Lr=`
`;for(let Zr=0;Zr<Fn;Zr++){let Dr=[],zr=[];for(let xr=0;xr<mr;xr++)Zr===1&&zr.push(Ur[Bn]),Dr.push(" ");Zr===1&&(Lr+=`| ${zr.join(" | ")} |
`),Lr+=`| ${Dr.join(mr===1?"":" | ")} |
`}return Kt.replaceSelection(Lr+`
`),Kt.focus();default:throw new Error}},[Kt,ii]),Ne=(0,fe.useMemo)(()=>{switch(ii){case Gr:return fe.createElement(Hn,{callback:Ce,onCancel:Be});case ir:return fe.createElement(bn.Z,{callback:Ce,onCancel:Be});case li:return fe.createElement(at.Z,{callback:Ce,onCancel:Be});case st:return fe.createElement(ye,{editImgId:ei.current,callback:Ce,onCancel:Be});case gr:return fe.createElement(hn,{callback:Ce,onCancel:Be});case"maths-latex":return fe.createElement(Fr,{showSaveButton:!0,callback:Ce});case"inline-latex":return fe.createElement(Nt.Z,{showSaveButton:!0,callback:Ce});default:return null}},[ii]);function Be(){Ni("")}(0,fe.useEffect)(()=>{if(Hr.current){let pn=function(Zn){cr=!0,jn=Zn.pageY},dn=function(){cr=!1},Cn=function(Zn){if(cr){let Jn=Zn.pageY-jn;Jn<0&&(Jn=0),Jn>300&&(Jn=300);let Qn=_t+Jn+"px";Wi(Qn)}},In=Hr.current,cr=!1,jn=0;return In.addEventListener("mousedown",pn),document.addEventListener("mousemove",Cn),document.addEventListener("mouseup",dn),()=>{In.removeEventListener("mousedown",pn),document.removeEventListener("mousemove",Cn),document.removeEventListener("mouseup",dn)}}},[Kt,Hr]),(0,fe.useEffect)(()=>{Wi(_t)},[_t]);const He=Mn(it),Ge=Mn(mi),et={width:He,height:Ge},bt=(0,fe.useMemo)(()=>{if(Zi){let pn=new Date(Zi),dn=pn.getHours(),Cn=pn.getMinutes(),In=pn.getSeconds();return dn=dn<10?"0"+dn:dn,Cn=Cn<10?"0"+Cn:Cn,In=In<10?"0"+In:In,`${dn}:${Cn}:${In}`}return 0},[Zi]),Zt=pn=>{const dn=[];if(Yn){let Cn=-1;pn=pn.replace(/(@▁▁@|@▁@)/g,function(In,cr,jn){dn.push({multiLine:In!==Qi})})}return dn};function Jt(){window.sessionStorage.removeItem(zt),ea(!1),Vr(0)}function Gn(){ea(!1),Vr(0),Kt.setValue(window.sessionStorage.getItem(zt))}(0,fe.useEffect)(()=>{nr[ii]&&ii!==Wt&&ii!==st&&setTimeout(()=>{const pn=document.getElementsByClassName("markdown-popup-form")[0],dn=window.innerWidth/2-pn.offsetWidth/2,Cn=window.innerHeight/2-pn.offsetHeight/2;an(dn),ur(Cn)},0)},[ii]);const fr=pn=>{pn.preventDefault();const dn=pn.clientX-Bt,Cn=pn.clientY-kn;document.body.onmousemove=In=>{let cr=In.clientX-dn,jn=In.clientY-Cn;const Zn=document.getElementsByClassName("markdown-popup-form")[0],Jn=window.innerWidth-Zn.offsetWidth,Qn=window.innerHeight-Zn.offsetHeight;cr=Math.max(0,Math.min(cr,Jn)),jn=Math.max(0,Math.min(jn,Qn)),Wn(In.clientX,In.clientY,dn,Cn)&&(an(cr),ur(jn))},document.body.onmouseup=function(){document.body.onmousemove=null}},Wn=(pn,dn,Cn,In)=>{const cr=document.body.clientHeight,jn=document.body.clientWidth;return pn<20&&Cn>pn||pn>jn-20&&Cn<pn||dn<20&&In>dn||dn>cr-20&&In<dn?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return fe.createElement(fe.Fragment,null,fe.createElement("div",{className:"markdown-editor-wrapper",ref:Br},fe.createElement("div",{className:`markdown-editor-container ${vt} ${Li?"on-preview":""} ${Ut?"mini":""} ${Gi?"full-screen":""}`,style:et},fe.createElement(Xe,{insertTemp:Ot,watch:Li,fullScreen:Gi,showNullButton:Cr,showNullProgramButton:Yn,onActionCallback:Si,hidetoolBar:qn,extraUse:Dn}),fe.createElement("div",{className:"markdown-editor-body"},fe.createElement("div",{className:"codemirror-container"},fe.createElement("textarea",{ref:Er,placeholder:cn})),Li?fe.createElement("div",{ref:Nr,className:"preview-container"},Tt==="stex"&&fe.createElement(ze,{value:$r}),Tt!=="stex"&&fe.createElement(gt.Z,{edit:!0,disabledFill:en,showProgramFill:Yn,value:$r,openEditor:pn=>{var dn;ei.current=pn,(dn=gi.current)==null||dn.setHeight("100vh"),setTimeout(()=>{Ni("add-flowchart")},150)}})):null))),Ht?fe.createElement("a",{ref:Hr,className:"editor-resize"}):null,ii===Wt&&fe.createElement(nn,{callback:Ce,onCancel:Be}),ii===st&&fe.createElement(ye,{ref:gi,editImgId:ei.current,callback:Ce,onCancel:Be}),fe.createElement(Ct.Z,null,nr[ii]&&ii!==Wt&&ii!==st?fe.createElement(ft.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:Bt,top:kn},title:fe.createElement("div",{style:{cursor:"move"},onMouseDown:fr},nr[ii]),open:!0,onCancel:Be,footer:null,destroyOnClose:!0,width:ii===st?"1200px":null,height:ii===st?"80vh":null,className:"markdown-popup-form"},Ne):null))}},70859:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return Ve},I:function(){return Ct}});var fe=ce(22150),tt=ce(2453),Fe=ce(69677),Ye=ce(93421),be=ce(31795),_e=ce(78045),Le=ce(71577),Se=ce(15476),pe=ce(67294),Te=ce(52262),gt=ce(67294),ze=Object.defineProperty,Pt=Object.defineProperties,kt=Object.getOwnPropertyDescriptors,pt=Object.getOwnPropertySymbols,Je=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable,Dt=(wt,Mt,je)=>Mt in wt?ze(wt,Mt,{enumerable:!0,configurable:!0,writable:!0,value:je}):wt[Mt]=je,Yt=(wt,Mt)=>{for(var je in Mt||(Mt={}))Je.call(Mt,je)&&Dt(wt,je,Mt[je]);if(pt)for(var je of pt(Mt))De.call(Mt,je)&&Dt(wt,je,Mt[je]);return wt},nt=(wt,Mt)=>Pt(wt,kt(Mt));const{useForm:ct}=fe.default,Ie={width:280,marginRight:10},Me={labelCol:{span:5},wrapperCol:{span:19}};var Ve=({callback:wt,onCancel:Mt})=>{const[je]=ct();let Rt=(0,pe.useRef)();function At(vn){Rt.current.width=je.getFieldValue("width"),Rt.current.align=je.getFieldValue("align"),wt(vn,Rt.current)}function xn(vn,er){if(vn.status===-1){tt.ZP.error(vn.message);return}je.setFieldsValue({src:`/api/attachments/${vn.id}`,type:er.type})}function jt(vn){let er=vn.target.files[0];Rt.current=er,Ct(er,xn)}return gt.createElement(fe.default,nt(Yt({form:je},Me),{className:"upload-image-panel",onFinish:At,style:{width:470,overflow:"hidden"}}),gt.createElement(fe.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},gt.createElement("div",{className:"flex-container"},gt.createElement(fe.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},gt.createElement(Fe.default,{style:Ie})),gt.createElement(Xe,{onFileChange:jt}))),gt.createElement(fe.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},gt.createElement(Fe.default,{style:{width:264}})),gt.createElement(fe.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},gt.createElement(Ye.Z,null,gt.createElement(fe.default.Item,{name:"width",style:{margin:0}},gt.createElement(be.Z,{style:{width:264}})),gt.createElement("span",{className:"ml8"},"%"))),gt.createElement(fe.default.Item,{label:"\u5BF9\u9F50\u65B9\u5F0F",name:"align"},gt.createElement(_e.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"}]})),gt.createElement("aside",null,gt.createElement(fe.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},gt.createElement(Le.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),gt.createElement(Le.ZP,{type:"default",onClick:Mt},"\u53D6\u6D88"))))};function Xe({onFileChange:wt}){return gt.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",gt.createElement("input",{type:"file",onChange:wt}))}function Ct(wt,Mt){if(!wt)throw new String("\u6CA1\u6709\u6587\u4EF6");if(!(0,Te.bg)())throw tt.ZP.warning("\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C"),new String("\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C");let je=new FormData;je.append("editormd-image-file",wt),je.append("file_param_name","editormd-image-file"),je.append("byxhr","true");var Rt=new window.XMLHttpRequest;Rt.withCredentials=!0,Rt.addEventListener("load",function(At){Mt(JSON.parse(At.target.responseText),wt)},!1),Rt.addEventListener("error",function(At){console.error(At)},!1),Rt.open("POST",`${Se.KI}/api/attachments.json`),Rt.send(je)}},76621:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return Fe}});var fe=ce(67294),tt=ce(73935);class Fe extends fe.Component{constructor(be){super(be);const _e=window.document;this.node=_e.createElement("div"),_e.body.appendChild(this.node)}render(){const{children:be}=this.props;return(0,tt.createPortal)(be,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},99914:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return tt}});var fe=ce(67294);function tt(Fe,Ye){const be=(0,fe.useRef)();(0,fe.useEffect)(()=>{be.current=Fe}),(0,fe.useEffect)(()=>{function _e(){be.current()}if(Ye!==null){let Le=setInterval(_e,Ye);return()=>clearInterval(Le)}},[Ye])}},87494:function(Ln,qt,ce){"use strict";ce.r(qt),ce.d(qt,{default:function(){return Xe}});var fe=ce(67294),tt=ce(91304),Fe=ce(2453),Ye=ce(69677),be=ce(71577),_e=ce(33170),Le=(Ct,wt,Mt)=>new Promise((je,Rt)=>{var At=vn=>{try{jt(Mt.next(vn))}catch(er){Rt(er)}},xn=vn=>{try{jt(Mt.throw(vn))}catch(er){Rt(er)}},jt=vn=>vn.done?je(vn.value):Promise.resolve(vn.value).then(At,xn);jt((Mt=Mt.apply(Ct,wt)).next())});function Se({setIscreate:Ct,init:wt,UpdateItem:Mt}){const[je,Rt]=(0,fe.useState)(""),[At,xn]=(0,fe.useState)("");(0,fe.useEffect)(()=>{Mt&&(Rt(Mt&&Mt.name),xn(Mt&&Mt.description))},[Mt]);function jt(){return Le(this,null,function*(){if(!je){Fe.ZP.info("\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A");return}if(!At){Fe.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A");return}if(Mt){vn();return}(yield(0,_e.ZP)("/api/hpc_courses.json",{method:"post",body:{name:je,description:At,container_type:window.location.pathname.split("/")[1]}}))&&(Fe.ZP.info("\u521B\u5EFA\u6210\u529F"),Ct(!1),wt("add"))})}function vn(){return Le(this,null,function*(){(yield(0,_e.ZP)(`/api/hpc_courses/${Mt.id}.json`,{method:"put",body:{name:je,description:At,container_type:window.location.pathname.split("/")[1]}}))&&(Fe.ZP.info("\u7F16\u8F91\u6210\u529F"),Ct(!1),wt(""))})}return fe.createElement("div",null,fe.createElement(Ye.default,{style:{marginBottom:"20px"},placeholder:"\u8BF7\u8F93\u5165\u6807\u9898",value:je,maxLength:60,addonAfter:String(je.length)+"/60",onChange:er=>Rt(er.target.value)}),fe.createElement(tt.Z,{id:"courseContentMD",defaultValue:At,onChange:er=>xn(er)}),fe.createElement("div",{className:"clearfix mt30 mb30"},fe.createElement(be.ZP,{type:"primary",onClick:()=>jt(),className:"defalutSubmitbtn fl mr20"},"\u63D0\u4EA4"),fe.createElement("a",{className:"defalutCancelbtn fl",onClick:()=>Ct(!1)},"\u53D6\u6D88")))}var pe=Se,Te=ce(35598),gt=(Ct,wt,Mt)=>new Promise((je,Rt)=>{var At=vn=>{try{jt(Mt.next(vn))}catch(er){Rt(er)}},xn=vn=>{try{jt(Mt.throw(vn))}catch(er){Rt(er)}},jt=vn=>vn.done?je(vn.value):Promise.resolve(vn.value).then(At,xn);jt((Mt=Mt.apply(Ct,wt)).next())});function ze({CourseItem:Ct,userId:wt,init:Mt,ItemUpdate:je,setSee:Rt,UserInfo:At}){function xn(){return gt(this,null,function*(){(yield(0,_e.ZP)(`/api/hpc_courses/${Ct.id}.json`,{method:"delete"}))&&(Fe.ZP.info("\u5220\u9664\u6210\u529F"),Mt("delete"),Rt(!1))})}function jt(){je(Ct)}return fe.createElement("div",null,wt===299635||wt===301458||At!=null&&At.admin||At!=null&&At.business?fe.createElement("div",{style:{textAlign:"right"}},fe.createElement(be.ZP,{onClick:()=>jt()},"\u7F16\u8F91"),fe.createElement(be.ZP,{onClick:()=>xn(),style:{marginLeft:"30px"}},"\u5220\u9664")):null,fe.createElement("h1",null,Ct==null?void 0:Ct.name),fe.createElement(Te.Z,{value:Ct==null?void 0:Ct.description}))}var Pt=ze,kt=ce(59810),pt=ce(11320),Je=ce(35973),De=Object.defineProperty,Dt=Object.getOwnPropertySymbols,Yt=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,ct=(Ct,wt,Mt)=>wt in Ct?De(Ct,wt,{enumerable:!0,configurable:!0,writable:!0,value:Mt}):Ct[wt]=Mt,Ie=(Ct,wt)=>{for(var Mt in wt||(wt={}))Yt.call(wt,Mt)&&ct(Ct,Mt,wt[Mt]);if(Dt)for(var Mt of Dt(wt))nt.call(wt,Mt)&&ct(Ct,Mt,wt[Mt]);return Ct},Me=(Ct,wt,Mt)=>new Promise((je,Rt)=>{var At=vn=>{try{jt(Mt.next(vn))}catch(er){Rt(er)}},xn=vn=>{try{jt(Mt.throw(vn))}catch(er){Rt(er)}},jt=vn=>vn.done?je(vn.value):Promise.resolve(vn.value).then(At,xn);jt((Mt=Mt.apply(Ct,wt)).next())});function Ve({user:Ct,dispatch:wt}){var Mt,je,Rt,At,xn,jt,vn,er,Sr;const[qe,Ae]=(0,fe.useState)(1),[$t,Hn]=(0,fe.useState)(100),[bn,at]=(0,fe.useState)([]),[ft,Gt]=(0,fe.useState)(!1),[zn,mn]=(0,fe.useState)(!1),[nn,Ft]=(0,fe.useState)(""),[Pn,_n]=(0,fe.useState)(""),[Ee,ue]=(0,fe.useState)("");let{itemname:se}=(0,Je.useParams)();const[ye,ve]=(0,fe.useState)("");(0,fe.useEffect)(()=>{wt({type:"globalSetting/headerToggle",payload:!1}),qe&&le("")},[qe]);function le(sn){return Me(this,null,function*(){var yn,ln;const yr=yield(0,_e.ZP)("/api/hpc_courses.json",{method:"get",params:{page:qe,per_page:$t,container_type:window.location.pathname.split("/")[1]}});if(yr){let Fr=yr.data.hpc_courses.length;if(at(yr.data.hpc_courses),ue(yr.data.file_url),_n(""),!Fr)return;if(ye)if(sn==="delete"){if(Fr===0){mn(!1);return}Ft(yr.data.hpc_courses[0]),mn(!0),ve(yr.data.hpc_courses[0].id)}else sn==="add"?(Ft(yr.data.hpc_courses[Fr-1]),mn(!0),ve(yr.data.hpc_courses[Fr-1].id)):(Ft(yr.data.hpc_courses.filter(Nt=>Nt.id===ye)[0]),mn(!0),ve(ye));else if(se){let Nt=0;(ln=(yn=yr==null?void 0:yr.data)==null?void 0:yn.hpc_courses)==null||ln.map((Rn,Gr)=>{var li;(se==null?void 0:se.toLocaleLowerCase())===((li=Rn==null?void 0:Rn.name)==null?void 0:li.toLocaleLowerCase())&&(Nt=Gr)}),Ft(yr.data.hpc_courses[Nt]),mn(!0),ve(yr.data.hpc_courses[Nt].id),(se==null?void 0:se.toLocaleLowerCase())==="resources"&&(Ft(yr.data.hpc_courses.filter(Rn=>Rn.id===15)[0]),mn(!0),ve(15))}else Ft(yr.data.hpc_courses[0]),mn(!0),ve(yr.data.hpc_courses[0].id)}})}function We(sn){Gt(!1),mn(!0),Ft(sn),ve(sn.id)}function Lt(sn){_n(sn),Gt(!0),mn(!1)}function tn(){_n(""),Gt(!0),mn(!1)}const hn={name:"file",multiple:!0,action:"https://www.educoder.net/api/hpc_courses/upload_file.json",data:{container_type:window.location.pathname.split("/")[1]},onChange(sn){const{status:yn}=sn.file;yn==="done"?(Fe.ZP.success(`${sn.file.name} \u6587\u4EF6\u4E0A\u4F20\u6210\u529F`),le("")):yn==="error"&&Fe.ZP.error(`${sn.file.name} \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25`)},beforeUpload:sn=>{const yn=sn.size/1024/1024<150;return yn||Fe.ZP.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E150MB"),yn}};return fe.createElement("div",{style:{marginBottom:"40px"}},fe.createElement("div",{className:"bannterdiv",style:{background:`url(${pt.Z.IMG_SERVER+`/${Ee}`})`}}),fe.createElement("img",{style:{width:"100%"},src:pt.Z.IMG_SERVER+`/${Ee}`}),fe.createElement("div",{className:"edu-container minH500",style:{display:"flex",width:"1200px"}},fe.createElement("div",{style:{flex:"1",marginTop:"17px"}},bn&&bn.map((sn,yn)=>fe.createElement("p",{key:yn,onClick:()=>We(sn),className:ye===sn.id?"menuitemselect":"menuitem task-hide"},sn.name)),((Mt=Ct==null?void 0:Ct.userInfo)==null?void 0:Mt.user_id)===299635||((je=Ct==null?void 0:Ct.userInfo)==null?void 0:je.user_id)===301458||(Rt=Ct==null?void 0:Ct.userInfo)!=null&&Rt.admin||(At=Ct==null?void 0:Ct.userInfo)!=null&&At.business?fe.createElement("p",{onClick:()=>tn(),className:"menuadd",style:{fontSize:"24px",paddingLeft:"10px"}},fe.createElement("span",{style:{fontSize:"16px",marginLeft:"5px"}},"Last updated")):null),fe.createElement("div",{className:"rightcount",style:{flex:"6",background:"#ffffff",padding:"20px",marginLeft:"30px",marginTop:"24px"}},ft?fe.createElement(pe,{UpdateItem:Pn,setIscreate:Gt,init:le}):null,zn?fe.createElement(Pt,{UserInfo:Ct==null?void 0:Ct.userInfo,setSee:mn,userId:(xn=Ct==null?void 0:Ct.userInfo)==null?void 0:xn.user_id,ItemUpdate:Lt,CourseItem:nn,init:le}):null)),((jt=Ct==null?void 0:Ct.userInfo)==null?void 0:jt.user_id)===299635||((vn=Ct==null?void 0:Ct.userInfo)==null?void 0:vn.user_id)===301458||(er=Ct==null?void 0:Ct.userInfo)!=null&&er.admin||(Sr=Ct==null?void 0:Ct.userInfo)!=null&&Sr.business?fe.createElement(kt.default,Ie({},hn),fe.createElement(be.ZP,{className:"menuadd",style:{paddingLeft:"10px",marginLeft:"20px"}},"\u4E0A\u4F20\u9996\u9875\u56FE\u7247")):null)}var Xe=(0,Je.connect)(({user:Ct})=>({user:Ct}))(Ve)},57838:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return tt}});var fe=ce(67294);function tt(){const[,Fe]=fe.useReducer(Ye=>Ye+1,0);return Fe}},9708:function(Ln,qt,ce){"use strict";ce.d(qt,{F:function(){return be},Z:function(){return Ye}});var fe=ce(94184),tt=ce.n(fe);const Fe=null;function Ye(_e,Le,Se){return tt()({[`${_e}-status-success`]:Le==="success",[`${_e}-status-warning`]:Le==="warning",[`${_e}-status-error`]:Le==="error",[`${_e}-status-validating`]:Le==="validating",[`${_e}-has-feedback`]:Se})}const be=(_e,Le)=>Le||_e},88258:function(Ln,qt,ce){"use strict";var fe=ce(67294),tt=ce(53124),Fe=ce(32983);const Ye=be=>{const{componentName:_e}=be,{getPrefixCls:Le}=(0,fe.useContext)(tt.E_),Se=Le("empty");switch(_e){case"Table":case"List":return fe.createElement(Fe.Z,{image:Fe.Z.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return fe.createElement(Fe.Z,{image:Fe.Z.PRESENTED_IMAGE_SIMPLE,className:`${Se}-small`});default:return fe.createElement(Fe.Z,null)}};qt.Z=Ye},72565:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return ti}});var fe=ce(94184),tt=ce.n(fe),Fe=ce(1413),Ye=ce(97685),be=ce(67294),_e=ce(73935);function Le(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Se={};function pe(yt,ht){}function Te(yt,ht){}function gt(){Se={}}function ze(yt,ht,Bt){!ht&&!Se[Bt]&&(yt(!1,Bt),Se[Bt]=!0)}function Pt(yt,ht){ze(pe,yt,ht)}function kt(yt,ht){ze(Te,yt,ht)}var pt=null,Je=ce(71002),De=ce(18459);function Dt(yt,ht,Bt){var an=be.useRef({});return(!("value"in an.current)||Bt(an.current.condition,ht))&&(an.current.value=yt(),an.current.condition=ht),an.current.value}function Yt(yt,ht){typeof yt=="function"?yt(ht):(0,Je.Z)(yt)==="object"&&yt&&"current"in yt&&(yt.current=ht)}function nt(){for(var yt=arguments.length,ht=new Array(yt),Bt=0;Bt<yt;Bt++)ht[Bt]=arguments[Bt];var an=ht.filter(function(kn){return kn});return an.length<=1?an[0]:function(kn){ht.forEach(function(ur){Yt(ur,kn)})}}function ct(){for(var yt=arguments.length,ht=new Array(yt),Bt=0;Bt<yt;Bt++)ht[Bt]=arguments[Bt];return Dt(function(){return nt.apply(void 0,ht)},ht,function(an,kn){return an.length===kn.length&&an.every(function(ur,Er){return ur===kn[Er]})})}function Ie(yt){var ht,Bt,an=(0,De.isMemo)(yt)?yt.type.type:yt.type;return!(typeof an=="function"&&!((ht=an.prototype)!==null&&ht!==void 0&&ht.render)||typeof yt=="function"&&!((Bt=yt.prototype)!==null&&Bt!==void 0&&Bt.render))}var Me=be.createContext(null),Ve=Me,Xe=ce(74902),Ct=Le()?be.useLayoutEffect:be.useEffect,wt=Ct,Mt=function(ht,Bt){var an=React.useRef(!0);Ct(function(){if(!an.current)return ht()},Bt),Ct(function(){return an.current=!1,function(){an.current=!0}},[])},je=[];function Rt(yt,ht){var Bt=be.useState(function(){if(!Le())return null;var Ai=document.createElement("div");return Ai}),an=(0,Ye.Z)(Bt,1),kn=an[0],ur=be.useRef(!1),Er=be.useContext(Ve),Br=be.useState(je),Hr=(0,Ye.Z)(Br,2),Nr=Hr[0],ei=Hr[1],gi=Er||(ur.current?void 0:function(Ai){ei(function(Si){var Ce=[Ai].concat((0,Xe.Z)(Si));return Ce})});function Mr(){kn.parentElement||document.body.appendChild(kn),ur.current=!0}function fi(){var Ai;(Ai=kn.parentElement)===null||Ai===void 0||Ai.removeChild(kn),ur.current=!1}return wt(function(){return yt?Er?Er(Mr):Mr():fi(),fi},[yt]),wt(function(){Nr.length&&(Nr.forEach(function(Ai){return Ai()}),ei(je))},[Nr]),[kn,gi]}function At(yt,ht){if(!yt)return!1;if(yt.contains)return yt.contains(ht);for(var Bt=ht;Bt;){if(Bt===yt)return!0;Bt=Bt.parentNode}return!1}var xn="data-rc-order",jt="rc-util-key",vn=new Map;function er(){var yt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ht=yt.mark;return ht?ht.startsWith("data-")?ht:"data-".concat(ht):jt}function Sr(yt){if(yt.attachTo)return yt.attachTo;var ht=document.querySelector("head");return ht||document.body}function qe(yt){return yt==="queue"?"prependQueue":yt?"prepend":"append"}function Ae(yt){return Array.from((vn.get(yt)||yt).children).filter(function(ht){return ht.tagName==="STYLE"})}function $t(yt){var ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Le())return null;var Bt=ht.csp,an=ht.prepend,kn=document.createElement("style");kn.setAttribute(xn,qe(an)),Bt!=null&&Bt.nonce&&(kn.nonce=Bt==null?void 0:Bt.nonce),kn.innerHTML=yt;var ur=Sr(ht),Er=ur.firstChild;if(an){if(an==="queue"){var Br=Ae(ur).filter(function(Hr){return["prepend","prependQueue"].includes(Hr.getAttribute(xn))});if(Br.length)return ur.insertBefore(kn,Br[Br.length-1].nextSibling),kn}ur.insertBefore(kn,Er)}else ur.appendChild(kn);return kn}function Hn(yt){var ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Bt=Sr(ht);return Ae(Bt).find(function(an){return an.getAttribute(er(ht))===yt})}function bn(yt){var ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Bt=Hn(yt,ht);if(Bt){var an=Sr(ht);an.removeChild(Bt)}}function at(yt,ht){var Bt=vn.get(yt);if(!Bt||!At(document,Bt)){var an=$t("",ht),kn=an.parentNode;vn.set(yt,kn),yt.removeChild(an)}}function ft(){vn.clear()}function Gt(yt,ht){var Bt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},an=Sr(Bt);at(an,Bt);var kn=Hn(ht,Bt);if(kn){var ur,Er;if((ur=Bt.csp)!==null&&ur!==void 0&&ur.nonce&&kn.nonce!==((Er=Bt.csp)===null||Er===void 0?void 0:Er.nonce)){var Br;kn.nonce=(Br=Bt.csp)===null||Br===void 0?void 0:Br.nonce}return kn.innerHTML!==yt&&(kn.innerHTML=yt),kn}var Hr=$t(yt,Bt);return Hr.setAttribute(er(Bt),ht),Hr}var zn;function mn(yt){if(typeof document=="undefined")return 0;if(yt||zn===void 0){var ht=document.createElement("div");ht.style.width="100%",ht.style.height="200px";var Bt=document.createElement("div"),an=Bt.style;an.position="absolute",an.top="0",an.left="0",an.pointerEvents="none",an.visibility="hidden",an.width="200px",an.height="150px",an.overflow="hidden",Bt.appendChild(ht),document.body.appendChild(Bt);var kn=ht.offsetWidth;Bt.style.overflow="scroll";var ur=ht.offsetWidth;kn===ur&&(ur=Bt.clientWidth),document.body.removeChild(Bt),zn=kn-ur}return zn}function nn(yt){var ht=yt.match(/^(.*)px$/),Bt=Number(ht==null?void 0:ht[1]);return Number.isNaN(Bt)?mn():Bt}function Ft(yt){if(typeof document=="undefined"||!yt||!(yt instanceof Element))return{width:0,height:0};var ht=getComputedStyle(yt,"::-webkit-scrollbar"),Bt=ht.width,an=ht.height;return{width:nn(Bt),height:nn(an)}}function Pn(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var _n="rc-util-locker-".concat(Date.now()),Ee=0;function ue(yt){var ht=!!yt,Bt=be.useState(function(){return Ee+=1,"".concat(_n,"_").concat(Ee)}),an=(0,Ye.Z)(Bt,1),kn=an[0];wt(function(){if(ht){var ur=Ft(document.body).width,Er=Pn();Gt(`
html body {
overflow-y: hidden;
`.concat(Er?"width: calc(100% - ".concat(ur,"px);"):"",`
}`),kn)}else bn(kn);return function(){bn(kn)}},[ht,kn])}var se=!1;function ye(yt){return typeof yt=="boolean"&&(se=yt),se}var ve=function(ht){return ht===!1?!1:!Le()||!ht?null:typeof ht=="string"?document.querySelector(ht):typeof ht=="function"?ht():ht},le=be.forwardRef(function(yt,ht){var Bt=yt.open,an=yt.autoLock,kn=yt.getContainer,ur=yt.debug,Er=yt.autoDestroy,Br=Er===void 0?!0:Er,Hr=yt.children,Nr=be.useState(Bt),ei=(0,Ye.Z)(Nr,2),gi=ei[0],Mr=ei[1],fi=gi||Bt;be.useEffect(function(){(Br||Bt)&&Mr(Bt)},[Bt,Br]);var Ai=be.useState(function(){return ve(kn)}),Si=(0,Ye.Z)(Ai,2),Ce=Si[0],Ne=Si[1];be.useEffect(function(){var pn=ve(kn);Ne(pn!=null?pn:null)});var Be=Rt(fi&&!Ce,ur),He=(0,Ye.Z)(Be,2),Ge=He[0],et=He[1],bt=Ce!=null?Ce:Ge;ue(an&&Bt&&Le()&&(bt===Ge||bt===document.body));var Zt=null;if(Hr&&Ie(Hr)&&ht){var Jt=Hr;Zt=Jt.ref}var Gn=ct(Zt,ht);if(!fi||!Le()||Ce===void 0)return null;var fr=bt===!1||ye(),Wn=Hr;return ht&&(Wn=be.cloneElement(Hr,{ref:Gn})),be.createElement(Ve.Provider,{value:et},fr?Wn:(0,_e.createPortal)(Wn,bt))}),We=le,Lt=We;function tn(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var hn=tn()?be.useLayoutEffect:be.useEffect,sn=function(ht,Bt){var an=be.useRef(!0);hn(function(){return ht(an.current)},Bt),hn(function(){return an.current=!1,function(){an.current=!0}},[])},yn=function(ht,Bt){sn(function(an){if(!an)return ht()},Bt)},ln=sn,yr=be.createContext(null),Fr=be.createContext({}),Nt=yr,Rn=ce(4942),Gr=ce(87462),li=ce(62874),st={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(ht){var Bt=ht.keyCode;if(ht.altKey&&!ht.ctrlKey||ht.metaKey||Bt>=st.F1&&Bt<=st.F12)return!1;switch(Bt){case st.ALT:case st.CAPS_LOCK:case st.CONTEXT_MENU:case st.CTRL:case st.DOWN:case st.END:case st.ESC:case st.HOME:case st.INSERT:case st.LEFT:case st.MAC_FF_META:case st.META:case st.NUMLOCK:case st.NUM_CENTER:case st.PAGE_DOWN:case st.PAGE_UP:case st.PAUSE:case st.PRINT_SCREEN:case st.RIGHT:case st.SHIFT:case st.UP:case st.WIN_KEY:case st.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(ht){if(ht>=st.ZERO&&ht<=st.NINE||ht>=st.NUM_ZERO&&ht<=st.NUM_MULTIPLY||ht>=st.A&&ht<=st.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&ht===0)return!0;switch(ht){case st.SPACE:case st.QUESTION_MARK:case st.NUM_PLUS:case st.NUM_MINUS:case st.NUM_PERIOD:case st.NUM_DIVISION:case st.SEMICOLON:case st.DASH:case st.EQUALS:case st.COMMA:case st.PERIOD:case st.SLASH:case st.APOSTROPHE:case st.SINGLE_QUOTE:case st.OPEN_SQUARE_BRACKET:case st.BACKSLASH:case st.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Wt=st,Vn=`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`,ir=`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`,gr="".concat(Vn," ").concat(ir).split(/[\s\n]+/),Pr="aria-",Ur="data-";function Xr(yt,ht){return yt.indexOf(ht)===0}function qr(yt){var ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Bt;ht===!1?Bt={aria:!0,data:!0,attr:!0}:ht===!0?Bt={aria:!0}:Bt=(0,Fe.Z)({},ht);var an={};return Object.keys(yt).forEach(function(kn){(Bt.aria&&(kn==="role"||Xr(kn,Pr))||Bt.data&&Xr(kn,Ur)||Bt.attr&&gr.includes(kn))&&(an[kn]=yt[kn])}),an}function ui(yt){var ht=React.useRef();ht.current=yt;var Bt=React.useCallback(function(){for(var an,kn=arguments.length,ur=new Array(kn),Er=0;Er<kn;Er++)ur[Er]=arguments[Er];return(an=ht.current)===null||an===void 0?void 0:an.call.apply(an,[ht].concat(ur))},[]);return Bt}function br(yt){var ht=React.useRef(!1),Bt=React.useState(yt),an=_slicedToArray(Bt,2),kn=an[0],ur=an[1];React.useEffect(function(){return ht.current=!1,function(){ht.current=!0}},[]);function Er(Br,Hr){Hr&&ht.current||ur(Br)}return[kn,Er]}function Ei(yt){return yt!==void 0}function sa(yt,ht){var Bt=ht||{},an=Bt.defaultValue,kn=Bt.value,ur=Bt.onChange,Er=Bt.postState,Br=useState(function(){return Ei(kn)?kn:Ei(an)?typeof an=="function"?an():an:typeof yt=="function"?yt():yt}),Hr=_slicedToArray(Br,2),Nr=Hr[0],ei=Hr[1],gi=kn!==void 0?kn:Nr,Mr=Er?Er(gi):gi,fi=useEvent(ur),Ai=useState([gi]),Si=_slicedToArray(Ai,2),Ce=Si[0],Ne=Si[1];useLayoutUpdateEffect(function(){var He=Ce[0];Nr!==He&&fi(Nr,He)},[Ce]),useLayoutUpdateEffect(function(){Ei(kn)||ei(kn)},[kn]);var Be=useEvent(function(He,Ge){ei(He,Ge),Ne([gi],Ge)});return[Mr,Be]}var Ji=ce(33993);function Qi(yt,ht,Bt){var an=be.useRef({});return(!("value"in an.current)||Bt(an.current.condition,ht))&&(an.current.value=yt(),an.current.condition=ht),an.current.value}function Ci(yt,ht){typeof yt=="function"?yt(ht):(0,Je.Z)(yt)==="object"&&yt&&"current"in yt&&(yt.current=ht)}function mt(){for(var yt=arguments.length,ht=new Array(yt),Bt=0;Bt<yt;Bt++)ht[Bt]=arguments[Bt];var an=ht.filter(function(kn){return kn});return an.length<=1?an[0]:function(kn){ht.forEach(function(ur){Ci(ur,kn)})}}function Mn(){for(var yt=arguments.length,ht=new Array(yt),Bt=0;Bt<yt;Bt++)ht[Bt]=arguments[Bt];return Qi(function(){return mt.apply(void 0,ht)},ht,function(an,kn){return an.length!==kn.length||an.every(function(ur,Er){return ur!==kn[Er]})})}function En(yt){var ht,Bt,an=isMemo(yt)?yt.type.type:yt.type;return!(typeof an=="function"&&!((ht=an.prototype)!==null&&ht!==void 0&&ht.render)||typeof yt=="function"&&!((Bt=yt.prototype)!==null&&Bt!==void 0&&Bt.render))}function An(yt){return!isValidElement(yt)||isFragment(yt)?!1:En(yt)}function sr(yt,ht,Bt,an){if(!ht.length)return Bt;var kn=_toArray(ht),ur=kn[0],Er=kn.slice(1),Br;return!yt&&typeof ur=="number"?Br=[]:Array.isArray(yt)?Br=_toConsumableArray(yt):Br=_objectSpread({},yt),an&&Bt===void 0&&Er.length===1?delete Br[ur][Er[0]]:Br[ur]=sr(Br[ur],Er,Bt,an),Br}function nr(yt,ht,Bt){var an=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return ht.length&&an&&Bt===void 0&&!get(yt,ht.slice(0,-1))?yt:sr(yt,ht,Bt,an)}function pr(yt){return _typeof(yt)==="object"&&yt!==null&&Object.getPrototypeOf(yt)===Object.prototype}function Kn(yt){return Array.isArray(yt)?[]:{}}var Ue=typeof Reflect=="undefined"?Object.keys:Reflect.ownKeys;function it(){for(var yt=arguments.length,ht=new Array(yt),Bt=0;Bt<yt;Bt++)ht[Bt]=arguments[Bt];var an=Kn(ht[0]);return ht.forEach(function(kn){function ur(Er,Br){var Hr=new Set(Br),Nr=get(kn,Er),ei=Array.isArray(Nr);if(ei||pr(Nr)){if(!Hr.has(Nr)){Hr.add(Nr);var gi=get(an,Er);ei?an=nr(an,Er,[]):(!gi||_typeof(gi)!=="object")&&(an=nr(an,Er,Kn(Nr))),Ue(Nr).forEach(function(Mr){ur([].concat(_toConsumableArray(Er),[Mr]),Hr)})}}else an=nr(an,Er,Nr)}ur([])}),an}var _t={},Ut=[],Ke=function(ht){Ut.push(ht)};function ut(yt,ht){if(0)var Bt}function Ot(yt,ht){if(0)var Bt}function Tt(){_t={}}function zt(yt,ht,Bt){!ht&&!_t[Bt]&&(yt(!1,Bt),_t[Bt]=!0)}function Ht(yt,ht){zt(ut,yt,ht)}function $n(yt,ht){zt(Ot,yt,ht)}Ht.preMessage=Ke,Ht.resetWarned=Tt,Ht.noteOnce=$n;var Cr=Ht,Yn=function(ht){var Bt=ht.prefixCls,an=ht.className,kn=ht.style,ur=ht.children,Er=ht.containerRef,Br=ht.id,Hr=ht.onMouseEnter,Nr=ht.onMouseOver,ei=ht.onMouseLeave,gi=ht.onClick,Mr=ht.onKeyDown,fi=ht.onKeyUp,Ai={onMouseEnter:Hr,onMouseOver:Nr,onMouseLeave:ei,onClick:gi,onKeyDown:Mr,onKeyUp:fi},Si=be.useContext(Fr),Ce=Si.panel,Ne=Mn(Ce,Er);return be.createElement(be.Fragment,null,be.createElement("div",(0,Gr.Z)({id:Br,className:tt()("".concat(Bt,"-content"),an),style:(0,Fe.Z)({},kn),"aria-modal":"true",role:"dialog",ref:Ne},Ai),ur))},qn=Yn;function rr(yt){return typeof yt=="string"&&String(Number(yt))===yt?(Cr(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(yt)):yt}function ar(yt){warning(!("wrapperClassName"in yt),"'wrapperClassName' is removed. Please use 'rootClassName' instead."),warning(canUseDom()||!yt.open,"Drawer with 'open' in SSR is not work since no place to createPortal. Please move to 'useEffect' instead.")}var ot={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function Qe(yt,ht){var Bt,an,kn,ur,Er=yt.prefixCls,Br=yt.open,Hr=yt.placement,Nr=yt.inline,ei=yt.push,gi=yt.forceRender,Mr=yt.autoFocus,fi=yt.keyboard,Ai=yt.rootClassName,Si=yt.rootStyle,Ce=yt.zIndex,Ne=yt.className,Be=yt.id,He=yt.style,Ge=yt.motion,et=yt.width,bt=yt.height,Zt=yt.children,Jt=yt.contentWrapperStyle,Gn=yt.mask,fr=yt.maskClosable,Wn=yt.maskMotion,pn=yt.maskClassName,dn=yt.maskStyle,Cn=yt.afterOpenChange,In=yt.onClose,cr=yt.onMouseEnter,jn=yt.onMouseOver,Zn=yt.onMouseLeave,Jn=yt.onClick,Qn=yt.onKeyDown,hr=yt.onKeyUp,Pe=be.useRef(),$e=be.useRef(),xt=be.useRef();be.useImperativeHandle(ht,function(){return Pe.current});var rt=function(Or){var Jr=Or.keyCode,ai=Or.shiftKey;switch(Jr){case Wt.TAB:{if(Jr===Wt.TAB){if(!ai&&document.activeElement===xt.current){var Ir;(Ir=$e.current)===null||Ir===void 0||Ir.focus({preventScroll:!0})}else if(ai&&document.activeElement===$e.current){var ci;(ci=xt.current)===null||ci===void 0||ci.focus({preventScroll:!0})}}break}case Wt.ESC:{In&&fi&&(Or.stopPropagation(),In(Or));break}}};be.useEffect(function(){if(Br&&Mr){var xr;(xr=Pe.current)===null||xr===void 0||xr.focus({preventScroll:!0})}},[Br]);var It=be.useState(!1),rn=(0,Ye.Z)(It,2),fn=rn[0],On=rn[1],wn=be.useContext(Nt),Xt;ei===!1?Xt={distance:0}:ei===!0?Xt={}:Xt=ei||{};var Nn=(Bt=(an=(kn=Xt)===null||kn===void 0?void 0:kn.distance)!==null&&an!==void 0?an:wn==null?void 0:wn.pushDistance)!==null&&Bt!==void 0?Bt:180,Fn=be.useMemo(function(){return{pushDistance:Nn,push:function(){On(!0)},pull:function(){On(!1)}}},[Nn]);be.useEffect(function(){if(Br){var xr;wn==null||(xr=wn.push)===null||xr===void 0||xr.call(wn)}else{var Or;wn==null||(Or=wn.pull)===null||Or===void 0||Or.call(wn)}},[Br]),be.useEffect(function(){return function(){var xr;wn==null||(xr=wn.pull)===null||xr===void 0||xr.call(wn)}},[]);var mr=Gn&&be.createElement(li.Z,(0,Gr.Z)({key:"mask"},Wn,{visible:Br}),function(xr,Or){var Jr=xr.className,ai=xr.style;return be.createElement("div",{className:tt()("".concat(Er,"-mask"),Jr,pn),style:(0,Fe.Z)((0,Fe.Z)({},ai),dn),onClick:fr&&Br?In:void 0,ref:Or})}),Bn=typeof Ge=="function"?Ge(Hr):Ge,Lr={};if(fn&&Nn)switch(Hr){case"top":Lr.transform="translateY(".concat(Nn,"px)");break;case"bottom":Lr.transform="translateY(".concat(-Nn,"px)");break;case"left":Lr.transform="translateX(".concat(Nn,"px)");break;default:Lr.transform="translateX(".concat(-Nn,"px)");break}Hr==="left"||Hr==="right"?Lr.width=rr(et):Lr.height=rr(bt);var Zr={onMouseEnter:cr,onMouseOver:jn,onMouseLeave:Zn,onClick:Jn,onKeyDown:Qn,onKeyUp:hr},Dr=be.createElement(li.Z,(0,Gr.Z)({key:"panel"},Bn,{visible:Br,forceRender:gi,onVisibleChanged:function(Or){Cn==null||Cn(Or)},removeOnLeave:!1,leavedClassName:"".concat(Er,"-content-wrapper-hidden")}),function(xr,Or){var Jr=xr.className,ai=xr.style;return be.createElement("div",(0,Gr.Z)({className:tt()("".concat(Er,"-content-wrapper"),Jr),style:(0,Fe.Z)((0,Fe.Z)((0,Fe.Z)({},Lr),ai),Jt)},qr(yt,{data:!0})),be.createElement(qn,(0,Gr.Z)({id:Be,containerRef:Or,prefixCls:Er,className:Ne,style:He},Zr),Zt))}),zr=(0,Fe.Z)({},Si);return Ce&&(zr.zIndex=Ce),be.createElement(Nt.Provider,{value:Fn},be.createElement("div",{className:tt()(Er,"".concat(Er,"-").concat(Hr),Ai,(ur={},(0,Rn.Z)(ur,"".concat(Er,"-open"),Br),(0,Rn.Z)(ur,"".concat(Er,"-inline"),Nr),ur)),style:zr,tabIndex:-1,ref:Pe,onKeyDown:rt},mr,be.createElement("div",{tabIndex:0,ref:$e,style:ot,"aria-hidden":"true","data-sentinel":"start"}),Dr,be.createElement("div",{tabIndex:0,ref:xt,style:ot,"aria-hidden":"true","data-sentinel":"end"})))}var vt=be.forwardRef(Qe),Qt=vt,Tn=function(ht){var Bt=ht.open,an=Bt===void 0?!1:Bt,kn=ht.prefixCls,ur=kn===void 0?"rc-drawer":kn,Er=ht.placement,Br=Er===void 0?"right":Er,Hr=ht.autoFocus,Nr=Hr===void 0?!0:Hr,ei=ht.keyboard,gi=ei===void 0?!0:ei,Mr=ht.width,fi=Mr===void 0?378:Mr,Ai=ht.mask,Si=Ai===void 0?!0:Ai,Ce=ht.maskClosable,Ne=Ce===void 0?!0:Ce,Be=ht.getContainer,He=ht.forceRender,Ge=ht.afterOpenChange,et=ht.destroyOnClose,bt=ht.onMouseEnter,Zt=ht.onMouseOver,Jt=ht.onMouseLeave,Gn=ht.onClick,fr=ht.onKeyDown,Wn=ht.onKeyUp,pn=ht.panelRef,dn=be.useState(!1),Cn=(0,Ye.Z)(dn,2),In=Cn[0],cr=Cn[1],jn=be.useState(!1),Zn=(0,Ye.Z)(jn,2),Jn=Zn[0],Qn=Zn[1];ln(function(){Qn(!0)},[]);var hr=Jn?an:!1,Pe=be.useRef(),$e=be.useRef();ln(function(){hr&&($e.current=document.activeElement)},[hr]);var xt=function(On){var wn;if(cr(On),Ge==null||Ge(On),!On&&$e.current&&!((wn=Pe.current)!==null&&wn!==void 0&&wn.contains($e.current))){var Xt;(Xt=$e.current)===null||Xt===void 0||Xt.focus({preventScroll:!0})}},rt=be.useMemo(function(){return{panel:pn}},[pn]);if(!He&&!In&&!hr&&et)return null;var It={onMouseEnter:bt,onMouseOver:Zt,onMouseLeave:Jt,onClick:Gn,onKeyDown:fr,onKeyUp:Wn},rn=(0,Fe.Z)((0,Fe.Z)({},ht),{},{open:hr,prefixCls:ur,placement:Br,autoFocus:Nr,keyboard:gi,width:fi,mask:Si,maskClosable:Ne,inline:Be===!1,afterOpenChange:xt,ref:Pe},It);return be.createElement(Fr.Provider,{value:rt},be.createElement(Lt,{open:hr||He||In,autoDestroy:!1,getContainer:Be,autoLock:Si&&(hr||In)},be.createElement(Qt,rn)))},en=Tn,cn=en,un=ce(33603),Dn=ce(53124),or=ce(65223),Kt=ce(69760),$r=yt=>{const{prefixCls:ht,title:Bt,footer:an,extra:kn,closeIcon:ur,closable:Er,onClose:Br,headerStyle:Hr,drawerStyle:Nr,bodyStyle:ei,footerStyle:gi,children:Mr}=yt,fi=be.useCallback(Be=>be.createElement("button",{type:"button",onClick:Br,"aria-label":"Close",className:`${ht}-close`},Be),[Br]),[Ai,Si]=(0,Kt.Z)(Er,ur,fi,void 0,!0),Ce=be.useMemo(()=>!Bt&&!Ai?null:be.createElement("div",{style:Hr,className:tt()(`${ht}-header`,{[`${ht}-header-close-only`]:Ai&&!Bt&&!kn})},be.createElement("div",{className:`${ht}-header-title`},Si,Bt&&be.createElement("div",{className:`${ht}-title`},Bt)),kn&&be.createElement("div",{className:`${ht}-extra`},kn)),[Ai,Si,kn,Hr,ht,Bt]),Ne=be.useMemo(()=>{if(!an)return null;const Be=`${ht}-footer`;return be.createElement("div",{className:Be,style:gi},an)},[an,gi,ht]);return be.createElement("div",{className:`${ht}-wrapper-body`,style:Nr},Ce,be.createElement("div",{className:`${ht}-body`,style:ei},Mr),Ne)},Ri=ce(4173),Li=ce(67968),pi=ce(45503),yi=yt=>{const{componentCls:ht,motionDurationSlow:Bt}=yt,an={"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${Bt}`}}};return{[ht]:{[`${ht}-mask-motion`]:{"&-enter, &-appear, &-leave":{"&-active":{transition:`all ${Bt}`}},"&-enter, &-appear":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}}},[`${ht}-panel-motion`]:{"&-left":[an,{"&-enter, &-appear":{"&-start":{transform:"translateX(-100%) !important"},"&-active":{transform:"translateX(0)"}},"&-leave":{transform:"translateX(0)","&-active":{transform:"translateX(-100%)"}}}],"&-right":[an,{"&-enter, &-appear":{"&-start":{transform:"translateX(100%) !important"},"&-active":{transform:"translateX(0)"}},"&-leave":{transform:"translateX(0)","&-active":{transform:"translateX(100%)"}}}],"&-top":[an,{"&-enter, &-appear":{"&-start":{transform:"translateY(-100%) !important"},"&-active":{transform:"translateY(0)"}},"&-leave":{transform:"translateY(0)","&-active":{transform:"translateY(-100%)"}}}],"&-bottom":[an,{"&-enter, &-appear":{"&-start":{transform:"translateY(100%) !important"},"&-active":{transform:"translateY(0)"}},"&-leave":{transform:"translateY(0)","&-active":{transform:"translateY(100%)"}}}]}}}};const ii=yt=>{const{componentCls:ht,zIndexPopup:Bt,colorBgMask:an,colorBgElevated:kn,motionDurationSlow:ur,motionDurationMid:Er,padding:Br,paddingLG:Hr,fontSizeLG:Nr,lineHeightLG:ei,lineWidth:gi,lineType:Mr,colorSplit:fi,marginSM:Ai,colorIcon:Si,colorIconHover:Ce,colorText:Ne,fontWeightStrong:Be,footerPaddingBlock:He,footerPaddingInline:Ge}=yt,et=`${ht}-content-wrapper`;return{[ht]:{position:"fixed",inset:0,zIndex:Bt,pointerEvents:"none","&-pure":{position:"relative",background:kn,[`&${ht}-left`]:{boxShadow:yt.boxShadowDrawerLeft},[`&${ht}-right`]:{boxShadow:yt.boxShadowDrawerRight},[`&${ht}-top`]:{boxShadow:yt.boxShadowDrawerUp},[`&${ht}-bottom`]:{boxShadow:yt.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${ht}-mask`]:{position:"absolute",inset:0,zIndex:Bt,background:an,pointerEvents:"auto"},[et]:{position:"absolute",zIndex:Bt,maxWidth:"100vw",transition:`all ${ur}`,"&-hidden":{display:"none"}},[`&-left > ${et}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:yt.boxShadowDrawerLeft},[`&-right > ${et}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:yt.boxShadowDrawerRight},[`&-top > ${et}`]:{top:0,insetInline:0,boxShadow:yt.boxShadowDrawerUp},[`&-bottom > ${et}`]:{bottom:0,insetInline:0,boxShadow:yt.boxShadowDrawerDown},[`${ht}-content`]:{width:"100%",height:"100%",overflow:"auto",background:kn,pointerEvents:"auto"},[`${ht}-wrapper-body`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%"},[`${ht}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${Br}px ${Hr}px`,fontSize:Nr,lineHeight:ei,borderBottom:`${gi}px ${Mr} ${fi}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${ht}-extra`]:{flex:"none"},[`${ht}-close`]:{display:"inline-block",marginInlineEnd:Ai,color:Si,fontWeight:Be,fontSize:Nr,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,outline:0,cursor:"pointer",transition:`color ${Er}`,textRendering:"auto","&:focus, &:hover":{color:Ce,textDecoration:"none"}},[`${ht}-title`]:{flex:1,margin:0,color:Ne,fontWeight:yt.fontWeightStrong,fontSize:Nr,lineHeight:ei},[`${ht}-body`]:{flex:1,minWidth:0,minHeight:0,padding:Hr,overflow:"auto"},[`${ht}-footer`]:{flexShrink:0,padding:`${He}px ${Ge}px`,borderTop:`${gi}px ${Mr} ${fi}`},"&-rtl":{direction:"rtl"}}}};var Ni=(0,Li.Z)("Drawer",yt=>{const ht=(0,pi.TS)(yt,{});return[ii(ht),yi(ht)]},yt=>({zIndexPopup:yt.zIndexPopupBase,footerPaddingBlock:yt.paddingXS,footerPaddingInline:yt.padding})),Zi=ce(16569),Vr=function(yt,ht){var Bt={};for(var an in yt)Object.prototype.hasOwnProperty.call(yt,an)&&ht.indexOf(an)<0&&(Bt[an]=yt[an]);if(yt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var kn=0,an=Object.getOwnPropertySymbols(yt);kn<an.length;kn++)ht.indexOf(an[kn])<0&&Object.prototype.propertyIsEnumerable.call(yt,an[kn])&&(Bt[an[kn]]=yt[an[kn]]);return Bt};const mi=null,Wi={distance:180},la=yt=>{var ht;const{rootClassName:Bt,width:an,height:kn,size:ur="default",mask:Er=!0,push:Br=Wi,open:Hr,afterOpenChange:Nr,onClose:ei,prefixCls:gi,getContainer:Mr,style:fi,className:Ai,visible:Si,afterVisibleChange:Ce}=yt,Ne=Vr(yt,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","style","className","visible","afterVisibleChange"]),{getPopupContainer:Be,getPrefixCls:He,direction:Ge,drawer:et}=be.useContext(Dn.E_),bt=He("drawer",gi),[Zt,Jt]=Ni(bt),Gn=Mr===void 0&&Be?()=>Be(document.body):Mr,fr=tt()({"no-mask":!Er,[`${bt}-rtl`]:Ge==="rtl"},Bt,Jt),Wn=be.useMemo(()=>an!=null?an:ur==="large"?736:378,[an,ur]),pn=be.useMemo(()=>kn!=null?kn:ur==="large"?736:378,[kn,ur]),dn={motionName:(0,un.m)(bt,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},Cn=cr=>({motionName:(0,un.m)(bt,`panel-motion-${cr}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),In=(0,Zi.H)();return Zt(be.createElement(Ri.BR,null,be.createElement(or.Ux,{status:!0,override:!0},be.createElement(cn,Object.assign({prefixCls:bt,onClose:ei,maskMotion:dn,motion:Cn},Ne,{open:Hr!=null?Hr:Si,mask:Er,push:Br,width:Wn,height:pn,style:Object.assign(Object.assign({},et==null?void 0:et.style),fi),className:tt()(et==null?void 0:et.className,Ai),rootClassName:fr,getContainer:Gn,afterOpenChange:Nr!=null?Nr:Ce,panelRef:In}),be.createElement($r,Object.assign({prefixCls:bt},Ne,{onClose:ei}))))))},ea=yt=>{const{prefixCls:ht,style:Bt,className:an,placement:kn="right"}=yt,ur=Vr(yt,["prefixCls","style","className","placement"]),{getPrefixCls:Er}=be.useContext(Dn.E_),Br=Er("drawer",ht),[Hr,Nr]=Ni(Br),ei=tt()(Br,`${Br}-pure`,`${Br}-${kn}`,Nr,an);return Hr(be.createElement("div",{className:ei,style:Bt},be.createElement($r,Object.assign({prefixCls:Br},ur))))};la._InternalPanelDoNotUseOrYouWillBeFired=ea;var ti=la},32983:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return nt}});var fe=ce(94184),tt=ce.n(fe),Fe=ce(67294),Ye=ce(53124),be=ce(10110),_e=ce(84780),Le=ce(46605),pe=()=>{const[,ct]=(0,Le.Z)(),Me=new _e.C(ct.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return Fe.createElement("svg",{style:Me,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"}))))},gt=()=>{const[,ct]=(0,Le.Z)(),{colorFill:Ie,colorFillTertiary:Me,colorFillQuaternary:Ve,colorBgContainer:Xe}=ct,{borderColor:Ct,shadowColor:wt,contentColor:Mt}=(0,Fe.useMemo)(()=>({borderColor:new _e.C(Ie).onBackground(Xe).toHexShortString(),shadowColor:new _e.C(Me).onBackground(Xe).toHexShortString(),contentColor:new _e.C(Ve).onBackground(Xe).toHexShortString()}),[Ie,Me,Ve,Xe]);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:wt,cx:"32",cy:"33",rx:"32",ry:"7"}),Fe.createElement("g",{fillRule:"nonzero",stroke:Ct},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:Mt}))))},ze=ce(67968),Pt=ce(45503);const kt=ct=>{const{componentCls:Ie,margin:Me,marginXS:Ve,marginXL:Xe,fontSize:Ct,lineHeight:wt}=ct;return{[Ie]:{marginInline:Ve,fontSize:Ct,lineHeight:wt,textAlign:"center",[`${Ie}-image`]:{height:ct.emptyImgHeight,marginBottom:Ve,opacity:ct.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${Ie}-description`]:{color:ct.colorText},[`${Ie}-footer`]:{marginTop:Me},"&-normal":{marginBlock:Xe,color:ct.colorTextDisabled,[`${Ie}-description`]:{color:ct.colorTextDisabled},[`${Ie}-image`]:{height:ct.emptyImgHeightMD}},"&-small":{marginBlock:Ve,color:ct.colorTextDisabled,[`${Ie}-image`]:{height:ct.emptyImgHeightSM}}}}};var pt=(0,ze.Z)("Empty",ct=>{const{componentCls:Ie,controlHeightLG:Me}=ct,Ve=(0,Pt.TS)(ct,{emptyImgCls:`${Ie}-img`,emptyImgHeight:Me*2.5,emptyImgHeightMD:Me,emptyImgHeightSM:Me*.875});return[kt(Ve)]}),Je=function(ct,Ie){var Me={};for(var Ve in ct)Object.prototype.hasOwnProperty.call(ct,Ve)&&Ie.indexOf(Ve)<0&&(Me[Ve]=ct[Ve]);if(ct!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Xe=0,Ve=Object.getOwnPropertySymbols(ct);Xe<Ve.length;Xe++)Ie.indexOf(Ve[Xe])<0&&Object.prototype.propertyIsEnumerable.call(ct,Ve[Xe])&&(Me[Ve[Xe]]=ct[Ve[Xe]]);return Me};const De=Fe.createElement(pe,null),Dt=Fe.createElement(gt,null),Yt=ct=>{var{className:Ie,rootClassName:Me,prefixCls:Ve,image:Xe=De,description:Ct,children:wt,imageStyle:Mt,style:je}=ct,Rt=Je(ct,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:At,direction:xn,empty:jt}=Fe.useContext(Ye.E_),vn=At("empty",Ve),[er,Sr]=pt(vn),[qe]=(0,be.Z)("Empty"),Ae=typeof Ct!="undefined"?Ct:qe==null?void 0:qe.description,$t=typeof Ae=="string"?Ae:"empty";let Hn=null;return typeof Xe=="string"?Hn=Fe.createElement("img",{alt:$t,src:Xe}):Hn=Xe,er(Fe.createElement("div",Object.assign({className:tt()(Sr,vn,jt==null?void 0:jt.className,{[`${vn}-normal`]:Xe===Dt,[`${vn}-rtl`]:xn==="rtl"},Ie,Me),style:Object.assign(Object.assign({},jt==null?void 0:jt.style),je)},Rt),Fe.createElement("div",{className:`${vn}-image`,style:Mt},Hn),Ae&&Fe.createElement("div",{className:`${vn}-description`},Ae),wt&&Fe.createElement("div",{className:`${vn}-footer`},wt)))};Yt.PRESENTED_IMAGE_DEFAULT=De,Yt.PRESENTED_IMAGE_SIMPLE=Dt;var nt=Yt},22150:function(Ln,qt,ce){"use strict";ce.d(qt,{default:function(){return Ut}});var fe=ce(74902),tt=ce(94184),Fe=ce.n(tt),Ye=ce(38379),be=ce(67294),_e=ce(33603),Le=ce(65223);function Se(Ke){const[ut,Ot]=be.useState(Ke);return be.useEffect(()=>{const Tt=setTimeout(()=>{Ot(Ke)},Ke.length?0:10);return()=>{clearTimeout(Tt)}},[Ke]),ut}var pe=ce(14747),Te=ce(50438),gt=ce(33507),ze=ce(45503),Pt=ce(67968),pt=Ke=>{const{componentCls:ut}=Ke,Ot=`${ut}-show-help`,Tt=`${ut}-show-help-item`;return{[Ot]:{transition:`opacity ${Ke.motionDurationSlow} ${Ke.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[Tt]:{overflow:"hidden",transition:`height ${Ke.motionDurationSlow} ${Ke.motionEaseInOut},
opacity ${Ke.motionDurationSlow} ${Ke.motionEaseInOut},
transform ${Ke.motionDurationSlow} ${Ke.motionEaseInOut} !important`,[`&${Tt}-appear, &${Tt}-enter`]:{transform:"translateY(-5px)",opacity:0,"&-active":{transform:"translateY(0)",opacity:1}},[`&${Tt}-leave-active`]:{transform:"translateY(-5px)"}}}}};const Je=Ke=>({legend:{display:"block",width:"100%",marginBottom:Ke.marginLG,padding:0,color:Ke.colorTextDescription,fontSize:Ke.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:`${Ke.lineWidth}px ${Ke.lineType} ${Ke.colorBorder}`},label:{fontSize:Ke.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 ${Ke.controlOutlineWidth}px ${Ke.controlOutline}`},output:{display:"block",paddingTop:15,color:Ke.colorText,fontSize:Ke.fontSize,lineHeight:Ke.lineHeight}}),De=(Ke,ut)=>{const{formItemCls:Ot}=Ke;return{[Ot]:{[`${Ot}-label > label`]:{height:ut},[`${Ot}-control-input`]:{minHeight:ut}}}},Dt=Ke=>{const{componentCls:ut}=Ke;return{[Ke.componentCls]:Object.assign(Object.assign(Object.assign({},(0,pe.Wf)(Ke)),Je(Ke)),{[`${ut}-text`]:{display:"inline-block",paddingInlineEnd:Ke.paddingSM},"&-small":Object.assign({},De(Ke,Ke.controlHeightSM)),"&-large":Object.assign({},De(Ke,Ke.controlHeightLG))})}},Yt=Ke=>{const{formItemCls:ut,iconCls:Ot,componentCls:Tt,rootPrefixCls:zt,labelRequiredMarkColor:Ht,labelColor:$n,labelFontSize:Cr,labelHeight:Yn,labelColonMarginInlineStart:qn,labelColonMarginInlineEnd:rr,itemMarginBottom:ar}=Ke;return{[ut]:Object.assign(Object.assign({},(0,pe.Wf)(Ke)),{marginBottom:ar,verticalAlign:"top","&-with-help":{transition:"none"},[`&-hidden,
&-hidden.${zt}-row`]:{display:"none"},"&-has-warning":{[`${ut}-split`]:{color:Ke.colorError}},"&-has-error":{[`${ut}-split`]:{color:Ke.colorWarning}},[`${ut}-label`]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:`${Ke.lineHeight} - 0.25em`,whiteSpace:"unset"},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:Yn,color:$n,fontSize:Cr,[`> ${Ot}`]:{fontSize:Ke.fontSize,verticalAlign:"top"},[`&${ut}-required:not(${ut}-required-mark-optional)::before`]:{display:"inline-block",marginInlineEnd:Ke.marginXXS,color:Ht,fontSize:Ke.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"',[`${Tt}-hide-required-mark &`]:{display:"none"}},[`${ut}-optional`]:{display:"inline-block",marginInlineStart:Ke.marginXXS,color:Ke.colorTextDescription,[`${Tt}-hide-required-mark &`]:{display:"none"}},[`${ut}-tooltip`]:{color:Ke.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:Ke.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:qn,marginInlineEnd:rr},[`&${ut}-no-colon::after`]:{content:'"\\a0"'}}},[`${ut}-control`]:{"--ant-display":"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${zt}-col-'"]):not([class*="' ${zt}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:Ke.controlHeight,"&-content":{flex:"auto",maxWidth:"100%"}}},[ut]:{"&-explain, &-extra":{clear:"both",color:Ke.colorTextDescription,fontSize:Ke.fontSize,lineHeight:Ke.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:Ke.controlHeightSM,transition:`color ${Ke.motionDurationMid} ${Ke.motionEaseOut}`},"&-explain":{"&-error":{color:Ke.colorError},"&-warning":{color:Ke.colorWarning}}},[`&-with-help ${ut}-explain`]:{height:"auto",opacity:1},[`${ut}-feedback-icon`]:{fontSize:Ke.fontSize,textAlign:"center",visibility:"visible",animationName:Te.kr,animationDuration:Ke.motionDurationMid,animationTimingFunction:Ke.motionEaseOutBack,pointerEvents:"none","&-success":{color:Ke.colorSuccess},"&-error":{color:Ke.colorError},"&-warning":{color:Ke.colorWarning},"&-validating":{color:Ke.colorPrimary}}})}},nt=Ke=>{const{componentCls:ut,formItemCls:Ot}=Ke;return{[`${ut}-horizontal`]:{[`${Ot}-label`]:{flexGrow:0},[`${Ot}-control`]:{flex:"1 1 0",minWidth:0},[`${Ot}-label[class$='-24'], ${Ot}-label[class*='-24 ']`]:{[`& + ${Ot}-control`]:{minWidth:"unset"}}}}},ct=Ke=>{const{componentCls:ut,formItemCls:Ot}=Ke;return{[`${ut}-inline`]:{display:"flex",flexWrap:"wrap",[Ot]:{flex:"none",marginInlineEnd:Ke.margin,marginBottom:0,"&-row":{flexWrap:"nowrap"},[`> ${Ot}-label,
> ${Ot}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${Ot}-label`]:{flex:"none"},[`${ut}-text`]:{display:"inline-block"},[`${Ot}-has-feedback`]:{display:"inline-block"}}}}},Ie=Ke=>({padding:Ke.verticalLabelPadding,margin:Ke.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),Me=Ke=>{const{componentCls:ut,formItemCls:Ot,rootPrefixCls:Tt}=Ke;return{[`${Ot} ${Ot}-label`]:Ie(Ke),[ut]:{[Ot]:{flexWrap:"wrap",[`${Ot}-label, ${Ot}-control`]:{[`&:not([class*=" ${Tt}-col-xs"])`]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},Ve=Ke=>{const{componentCls:ut,formItemCls:Ot,rootPrefixCls:Tt}=Ke;return{[`${ut}-vertical`]:{[Ot]:{"&-row":{flexDirection:"column"},"&-label > label":{height:"auto"},[`${ut}-item-control`]:{width:"100%"}}},[`${ut}-vertical ${Ot}-label,
.${Tt}-col-24${Ot}-label,
.${Tt}-col-xl-24${Ot}-label`]:Ie(Ke),[`@media (max-width: ${Ke.screenXSMax}px)`]:[Me(Ke),{[ut]:{[`.${Tt}-col-xs-24${Ot}-label`]:Ie(Ke)}}],[`@media (max-width: ${Ke.screenSMMax}px)`]:{[ut]:{[`.${Tt}-col-sm-24${Ot}-label`]:Ie(Ke)}},[`@media (max-width: ${Ke.screenMDMax}px)`]:{[ut]:{[`.${Tt}-col-md-24${Ot}-label`]:Ie(Ke)}},[`@media (max-width: ${Ke.screenLGMax}px)`]:{[ut]:{[`.${Tt}-col-lg-24${Ot}-label`]:Ie(Ke)}}}},Xe=(Ke,ut)=>(0,ze.TS)(Ke,{formItemCls:`${Ke.componentCls}-item`,rootPrefixCls:ut});var Ct=(0,Pt.Z)("Form",(Ke,ut)=>{let{rootPrefixCls:Ot}=ut;const Tt=Xe(Ke,Ot);return[Dt(Tt),Yt(Tt),pt(Tt),nt(Tt),ct(Tt),Ve(Tt),(0,gt.Z)(Tt),Te.kr]},Ke=>({labelRequiredMarkColor:Ke.colorError,labelColor:Ke.colorTextHeading,labelFontSize:Ke.fontSize,labelHeight:Ke.controlHeight,labelColonMarginInlineStart:Ke.marginXXS/2,labelColonMarginInlineEnd:Ke.marginXS,itemMarginBottom:Ke.marginLG,verticalLabelPadding:`0 0 ${Ke.paddingXS}px`,verticalLabelMargin:0}),{order:-1e3});const wt=[];function Mt(Ke,ut,Ot){let Tt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof Ke=="string"?Ke:`${ut}-${Tt}`,error:Ke,errorStatus:Ot}}var Rt=Ke=>{let{help:ut,helpStatus:Ot,errors:Tt=wt,warnings:zt=wt,className:Ht,fieldId:$n,onVisibleChanged:Cr}=Ke;const{prefixCls:Yn}=be.useContext(Le.Rk),qn=`${Yn}-item-explain`,[,rr]=Ct(Yn),ar=(0,be.useMemo)(()=>(0,_e.Z)(Yn),[Yn]),ot=Se(Tt),Qe=Se(zt),vt=be.useMemo(()=>ut!=null?[Mt(ut,"help",Ot)]:[].concat((0,fe.Z)(ot.map((Tn,en)=>Mt(Tn,"error","error",en))),(0,fe.Z)(Qe.map((Tn,en)=>Mt(Tn,"warning","warning",en)))),[ut,Ot,ot,Qe]),Qt={};return $n&&(Qt.id=`${$n}_help`),be.createElement(Ye.default,{motionDeadline:ar.motionDeadline,motionName:`${Yn}-show-help`,visible:!!vt.length,onVisibleChanged:Cr},Tn=>{const{className:en,style:cn}=Tn;return be.createElement("div",Object.assign({},Qt,{className:Fe()(qn,en,Ht,rr),style:cn,role:"alert"}),be.createElement(Ye.CSSMotionList,Object.assign({keys:vt},(0,_e.Z)(Yn),{motionName:`${Yn}-show-help-item`,component:!1}),un=>{const{key:Dn,error:or,errorStatus:Kt,className:Yr,style:$r}=un;return be.createElement("div",{key:Dn,className:Fe()(Yr,{[`${qn}-${Kt}`]:Kt}),style:$r},or)}))})},At=ce(58083),xn=ce(53124),jt=ce(98866),vn=ce(97647),er=ce(98675),Sr=ce(17423);const qe=["parentNode"],Ae="form_item";function $t(Ke){return Ke===void 0||Ke===!1?[]:Array.isArray(Ke)?Ke:[Ke]}function Hn(Ke,ut){if(!Ke.length)return;const Ot=Ke.join("_");return ut?`${ut}_${Ot}`:qe.includes(Ot)?`${Ae}_${Ot}`:Ot}function bn(Ke,ut,Ot,Tt,zt,Ht){let $n=Tt;return Ht!==void 0?$n=Ht:Ot.validating?$n="validating":Ke.length?$n="error":ut.length?$n="warning":(Ot.touched||zt&&Ot.validated)&&($n="success"),$n}function at(Ke){return $t(Ke).join("_")}function ft(Ke){const[ut]=(0,At.useForm)(),Ot=be.useRef({}),Tt=be.useMemo(()=>Ke!=null?Ke:Object.assign(Object.assign({},ut),{__INTERNAL__:{itemRef:zt=>Ht=>{const $n=at(zt);Ht?Ot.current[$n]=Ht:delete Ot.current[$n]}},scrollToField:function(zt){let Ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const $n=$t(zt),Cr=Hn($n,Tt.__INTERNAL__.name),Yn=Cr?document.getElementById(Cr):null;Yn&&(0,Sr.Z)(Yn,Object.assign({scrollMode:"if-needed",block:"nearest"},Ht))},getFieldInstance:zt=>{const Ht=at(zt);return Ot.current[Ht]}}),[Ke,ut]);return[Tt]}var Gt=ce(37920),zn=function(Ke,ut){var Ot={};for(var Tt in Ke)Object.prototype.hasOwnProperty.call(Ke,Tt)&&ut.indexOf(Tt)<0&&(Ot[Tt]=Ke[Tt]);if(Ke!=null&&typeof Object.getOwnPropertySymbols=="function")for(var zt=0,Tt=Object.getOwnPropertySymbols(Ke);zt<Tt.length;zt++)ut.indexOf(Tt[zt])<0&&Object.prototype.propertyIsEnumerable.call(Ke,Tt[zt])&&(Ot[Tt[zt]]=Ke[Tt[zt]]);return Ot};const mn=(Ke,ut)=>{const Ot=be.useContext(jt.Z),{getPrefixCls:Tt,direction:zt,form:Ht}=be.useContext(xn.E_),{prefixCls:$n,className:Cr,rootClassName:Yn,size:qn,disabled:rr=Ot,form:ar,colon:ot,labelAlign:Qe,labelWrap:vt,labelCol:Qt,wrapperCol:Tn,hideRequiredMark:en,layout:cn="horizontal",scrollToFirstError:un,requiredMark:Dn,onFinishFailed:or,name:Kt,style:Yr,feedbackIcons:$r}=Ke,Ri=zn(Ke,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons"]),Li=(0,er.Z)(qn),pi=be.useContext(Gt.Z),Gi=(0,be.useMemo)(()=>Dn!==void 0?Dn:Ht&&Ht.requiredMark!==void 0?Ht.requiredMark:!en,[en,Dn,Ht]),yi=ot!=null?ot:Ht==null?void 0:Ht.colon,ii=Tt("form",$n),[Ni,Zi]=Ct(ii),Vr=Fe()(ii,`${ii}-${cn}`,{[`${ii}-hide-required-mark`]:Gi===!1,[`${ii}-rtl`]:zt==="rtl",[`${ii}-${Li}`]:Li},Zi,Ht==null?void 0:Ht.className,Cr,Yn),[mi]=ft(ar),{__INTERNAL__:Wi}=mi;Wi.name=Kt;const la=(0,be.useMemo)(()=>({name:Kt,labelAlign:Qe,labelCol:Qt,labelWrap:vt,wrapperCol:Tn,vertical:cn==="vertical",colon:yi,requiredMark:Gi,itemRef:Wi.itemRef,form:mi,feedbackIcons:$r}),[Kt,Qe,Qt,Tn,cn,yi,Gi,mi,$r]);be.useImperativeHandle(ut,()=>mi);const ea=(yt,ht)=>{if(yt){let Bt={block:"nearest"};typeof yt=="object"&&(Bt=yt),mi.scrollToField(ht,Bt)}},ti=yt=>{if(or==null||or(yt),yt.errorFields.length){const ht=yt.errorFields[0].name;if(un!==void 0){ea(un,ht);return}Ht&&Ht.scrollToFirstError!==void 0&&ea(Ht.scrollToFirstError,ht)}};return Ni(be.createElement(jt.n,{disabled:rr},be.createElement(vn.q,{size:Li},be.createElement(Le.RV,Object.assign({},{validateMessages:pi}),be.createElement(Le.q3.Provider,{value:la},be.createElement(At.default,Object.assign({id:Kt},Ri,{name:Kt,onFinishFailed:ti,form:mi,style:Object.assign(Object.assign({},Ht==null?void 0:Ht.style),Yr),className:Vr})))))))};var Ft=be.forwardRef(mn),Pn=ce(9475),_n=ce(17799),Ee=ce(96159),ue=ce(37419);function se(Ke){if(typeof Ke=="function")return Ke;const ut=(0,ue.Z)(Ke);return ut.length<=1?ut[0]:ut}const ye=()=>{const{status:Ke,errors:ut=[],warnings:Ot=[]}=(0,be.useContext)(Le.aM);return{status:Ke,errors:ut,warnings:Ot}};ye.Context=Le.aM;var ve=ye,le=ce(96523);function We(Ke){const[ut,Ot]=be.useState(Ke),Tt=(0,be.useRef)(null),zt=(0,be.useRef)([]),Ht=(0,be.useRef)(!1);be.useEffect(()=>(Ht.current=!1,()=>{Ht.current=!0,le.Z.cancel(Tt.current),Tt.current=null}),[]);function $n(Cr){Ht.current||(Tt.current===null&&(zt.current=[],Tt.current=(0,le.Z)(()=>{Tt.current=null,Ot(Yn=>{let qn=Yn;return zt.current.forEach(rr=>{qn=rr(qn)}),qn})})),zt.current.push(Cr))}return[ut,$n]}function Lt(){const{itemRef:Ke}=be.useContext(Le.q3),ut=be.useRef({});function Ot(Tt,zt){const Ht=zt&&typeof zt=="object"&&zt.ref,$n=Tt.join("_");return(ut.current.name!==$n||ut.current.originRef!==Ht)&&(ut.current.name=$n,ut.current.originRef=Ht,ut.current.ref=(0,_n.sQ)(Ke(Tt),Ht)),ut.current.ref}return Ot}var tn=ce(48130),hn=ce(14075),sn=ce(10366),yn=ce(92820),ln=ce(21584);const yr=Ke=>{const{formItemCls:ut}=Ke;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${ut}-control`]:{display:"flex"}}}};var Fr=(0,Pt.b)(["Form","item-item"],(Ke,ut)=>{let{rootPrefixCls:Ot}=ut;const Tt=Xe(Ke,Ot);return[yr(Tt)]}),Rn=Ke=>{const{prefixCls:ut,status:Ot,wrapperCol:Tt,children:zt,errors:Ht,warnings:$n,_internalItemRender:Cr,extra:Yn,help:qn,fieldId:rr,marginBottom:ar,onErrorVisibleChanged:ot}=Ke,Qe=`${ut}-item`,vt=be.useContext(Le.q3),Qt=Tt||vt.wrapperCol||{},Tn=Fe()(`${Qe}-control`,Qt.className),en=be.useMemo(()=>Object.assign({},vt),[vt]);delete en.labelCol,delete en.wrapperCol;const cn=be.createElement("div",{className:`${Qe}-control-input`},be.createElement("div",{className:`${Qe}-control-input-content`},zt)),un=be.useMemo(()=>({prefixCls:ut,status:Ot}),[ut,Ot]),Dn=ar!==null||Ht.length||$n.length?be.createElement("div",{style:{display:"flex",flexWrap:"nowrap"}},be.createElement(Le.Rk.Provider,{value:un},be.createElement(Rt,{fieldId:rr,errors:Ht,warnings:$n,help:qn,helpStatus:Ot,className:`${Qe}-explain-connected`,onVisibleChanged:ot})),!!ar&&be.createElement("div",{style:{width:0,height:ar}})):null,or={};rr&&(or.id=`${rr}_extra`);const Kt=Yn?be.createElement("div",Object.assign({},or,{className:`${Qe}-extra`}),Yn):null,Yr=Cr&&Cr.mark==="pro_table_render"&&Cr.render?Cr.render(Ke,{input:cn,errorList:Dn,extra:Kt}):be.createElement(be.Fragment,null,cn,Dn,Kt);return be.createElement(Le.q3.Provider,{value:en},be.createElement(ln.Z,Object.assign({},Qt,{className:Tn}),Yr),be.createElement(Fr,{prefixCls:ut}))},Gr=ce(17663),li=ce(24457),st=ce(10110),Wt=ce(83062),Vn=function(Ke,ut){var Ot={};for(var Tt in Ke)Object.prototype.hasOwnProperty.call(Ke,Tt)&&ut.indexOf(Tt)<0&&(Ot[Tt]=Ke[Tt]);if(Ke!=null&&typeof Object.getOwnPropertySymbols=="function")for(var zt=0,Tt=Object.getOwnPropertySymbols(Ke);zt<Tt.length;zt++)ut.indexOf(Tt[zt])<0&&Object.prototype.propertyIsEnumerable.call(Ke,Tt[zt])&&(Ot[Tt[zt]]=Ke[Tt[zt]]);return Ot};function ir(Ke){return Ke?typeof Ke=="object"&&!be.isValidElement(Ke)?Ke:{title:Ke}:null}var Pr=Ke=>{let{prefixCls:ut,label:Ot,htmlFor:Tt,labelCol:zt,labelAlign:Ht,colon:$n,required:Cr,requiredMark:Yn,tooltip:qn}=Ke;var rr;const[ar]=(0,st.Z)("Form"),{vertical:ot,labelAlign:Qe,labelCol:vt,labelWrap:Qt,colon:Tn}=be.useContext(Le.q3);if(!Ot)return null;const en=zt||vt||{},cn=Ht||Qe,un=`${ut}-item-label`,Dn=Fe()(un,cn==="left"&&`${un}-left`,en.className,{[`${un}-wrap`]:!!Qt});let or=Ot;const Kt=$n===!0||Tn!==!1&&$n!==!1;Kt&&!ot&&typeof Ot=="string"&&Ot.trim()!==""&&(or=Ot.replace(/[:|]\s*$/,""));const $r=ir(qn);if($r){const{icon:Gi=be.createElement(Gr.Z,null)}=$r,yi=Vn($r,["icon"]),ii=be.createElement(Wt.Z,Object.assign({},yi),be.cloneElement(Gi,{className:`${ut}-item-tooltip`,title:""}));or=be.createElement(be.Fragment,null,or,ii)}const Ri=Yn==="optional",Li=typeof Yn=="function";Li?or=Yn(or,{required:!!Cr}):Ri&&!Cr&&(or=be.createElement(be.Fragment,null,or,be.createElement("span",{className:`${ut}-item-optional`,title:""},(ar==null?void 0:ar.optional)||((rr=li.Z.Form)===null||rr===void 0?void 0:rr.optional))));const pi=Fe()({[`${ut}-item-required`]:Cr,[`${ut}-item-required-mark-optional`]:Ri||Li,[`${ut}-item-no-colon`]:!Kt});return be.createElement(ln.Z,Object.assign({},en,{className:Dn}),be.createElement("label",{htmlFor:Tt,className:pi,title:typeof Ot=="string"?Ot:""},or))},Ur=ce(87725),Xr=ce(16646),qr=ce(87995),ui=ce(3407);const br={success:Ur.Z,warning:qr.Z,error:Xr.Z,validating:ui.Z};function Ei(Ke){let{children:ut,errors:Ot,warnings:Tt,hasFeedback:zt,validateStatus:Ht,prefixCls:$n,meta:Cr,noStyle:Yn}=Ke;const qn=`${$n}-item`,{feedbackIcons:rr}=be.useContext(Le.q3),ar=bn(Ot,Tt,Cr,null,!!zt,Ht),{isFormItemInput:ot,status:Qe}=be.useContext(Le.aM),vt=be.useMemo(()=>{var Qt;let Tn;if(zt){const un=zt!==!0&&zt.icons||rr,Dn=ar&&((Qt=un==null?void 0:un({status:ar,errors:Ot,warnings:Tt}))===null||Qt===void 0?void 0:Qt[ar]),or=ar&&br[ar];Tn=Dn!==!1&&or?be.createElement("span",{className:Fe()(`${qn}-feedback-icon`,`${qn}-feedback-icon-${ar}`)},Dn||be.createElement(or,null)):null}let en=!0,cn=ar||"";return Yn&&(en=ot,cn=(ar!=null?ar:Qe)||""),{status:cn,errors:Ot,warnings:Tt,hasFeedback:!!zt,feedbackIcon:Tn,isFormItemInput:en}},[ar,zt,Yn,ot,Qe]);return be.createElement(Le.aM.Provider,{value:vt},ut)}var sa=function(Ke,ut){var Ot={};for(var Tt in Ke)Object.prototype.hasOwnProperty.call(Ke,Tt)&&ut.indexOf(Tt)<0&&(Ot[Tt]=Ke[Tt]);if(Ke!=null&&typeof Object.getOwnPropertySymbols=="function")for(var zt=0,Tt=Object.getOwnPropertySymbols(Ke);zt<Tt.length;zt++)ut.indexOf(Tt[zt])<0&&Object.prototype.propertyIsEnumerable.call(Ke,Tt[zt])&&(Ot[Tt[zt]]=Ke[Tt[zt]]);return Ot};function Ji(Ke){const{prefixCls:ut,className:Ot,rootClassName:Tt,style:zt,help:Ht,errors:$n,warnings:Cr,validateStatus:Yn,meta:qn,hasFeedback:rr,hidden:ar,children:ot,fieldId:Qe,required:vt,isRequired:Qt,onSubItemMetaChange:Tn}=Ke,en=sa(Ke,["prefixCls","className","rootClassName","style","help","errors","warnings","validateStatus","meta","hasFeedback","hidden","children","fieldId","required","isRequired","onSubItemMetaChange"]),cn=`${ut}-item`,{requiredMark:un}=be.useContext(Le.q3),Dn=be.useRef(null),or=Se($n),Kt=Se(Cr),Yr=Ht!=null,$r=!!(Yr||$n.length||Cr.length),Ri=!!Dn.current&&(0,tn.Z)(Dn.current),[Li,pi]=be.useState(null);(0,hn.Z)(()=>{if($r&&Dn.current){const Zi=getComputedStyle(Dn.current);pi(parseInt(Zi.marginBottom,10))}},[$r,Ri]);const Gi=Zi=>{Zi||pi(null)},ii=function(){let Zi=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const Vr=Zi?or:qn.errors,mi=Zi?Kt:qn.warnings;return bn(Vr,mi,qn,"",!!rr,Yn)}(),Ni=Fe()(cn,Ot,Tt,{[`${cn}-with-help`]:Yr||or.length||Kt.length,[`${cn}-has-feedback`]:ii&&rr,[`${cn}-has-success`]:ii==="success",[`${cn}-has-warning`]:ii==="warning",[`${cn}-has-error`]:ii==="error",[`${cn}-is-validating`]:ii==="validating",[`${cn}-hidden`]:ar});return be.createElement("div",{className:Ni,style:zt,ref:Dn},be.createElement(yn.Z,Object.assign({className:`${cn}-row`},(0,sn.Z)(en,["_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"])),be.createElement(Pr,Object.assign({htmlFor:Qe},Ke,{requiredMark:un,required:vt!=null?vt:Qt,prefixCls:ut})),be.createElement(Rn,Object.assign({},Ke,qn,{errors:or,warnings:Kt,prefixCls:ut,status:ii,help:Ht,marginBottom:Li,onErrorVisibleChanged:Gi}),be.createElement(Le.qI.Provider,{value:Tn},be.createElement(Ei,{prefixCls:ut,meta:qn,errors:qn.errors,warnings:qn.warnings,hasFeedback:rr,validateStatus:ii},ot)))),!!Li&&be.createElement("div",{className:`${cn}-margin-offset`,style:{marginBottom:-Li}}))}const Qi="__SPLIT__",Ci=null,mt=be.memo(Ke=>{let{children:ut}=Ke;return ut},(Ke,ut)=>Ke.value===ut.value&&Ke.update===ut.update&&Ke.childProps.length===ut.childProps.length&&Ke.childProps.every((Ot,Tt)=>Ot===ut.childProps[Tt]));function Mn(Ke){return Ke!=null}function En(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function An(Ke){const{name:ut,noStyle:Ot,className:Tt,dependencies:zt,prefixCls:Ht,shouldUpdate:$n,rules:Cr,children:Yn,required:qn,label:rr,messageVariables:ar,trigger:ot="onChange",validateTrigger:Qe,hidden:vt,help:Qt}=Ke,{getPrefixCls:Tn}=be.useContext(xn.E_),{name:en}=be.useContext(Le.q3),cn=se(Yn),un=typeof cn=="function",Dn=be.useContext(Le.qI),{validateTrigger:or}=be.useContext(At.FieldContext),Kt=Qe!==void 0?Qe:or,Yr=Mn(ut),$r=Tn("form",Ht),[Ri,Li]=Ct($r),pi=be.useContext(At.ListContext),Gi=be.useRef(),[yi,ii]=We({}),[Ni,Zi]=(0,Pn.Z)(()=>En()),Vr=ht=>{const Bt=pi==null?void 0:pi.getKey(ht.name);if(Zi(ht.destroy?En():ht,!0),Ot&&Qt!==!1&&Dn){let an=ht.name;if(ht.destroy)an=Gi.current||an;else if(Bt!==void 0){const[kn,ur]=Bt;an=[kn].concat((0,fe.Z)(ur)),Gi.current=an}Dn(ht,an)}},mi=(ht,Bt)=>{ii(an=>{const kn=Object.assign({},an),Er=[].concat((0,fe.Z)(ht.name.slice(0,-1)),(0,fe.Z)(Bt)).join(Qi);return ht.destroy?delete kn[Er]:kn[Er]=ht,kn})},[Wi,la]=be.useMemo(()=>{const ht=(0,fe.Z)(Ni.errors),Bt=(0,fe.Z)(Ni.warnings);return Object.values(yi).forEach(an=>{ht.push.apply(ht,(0,fe.Z)(an.errors||[])),Bt.push.apply(Bt,(0,fe.Z)(an.warnings||[]))}),[ht,Bt]},[yi,Ni.errors,Ni.warnings]),ea=Lt();function ti(ht,Bt,an){return Ot&&!vt?be.createElement(Ei,{prefixCls:$r,hasFeedback:Ke.hasFeedback,validateStatus:Ke.validateStatus,meta:Ni,errors:Wi,warnings:la,noStyle:!0},ht):be.createElement(Ji,Object.assign({key:"row"},Ke,{className:Fe()(Tt,Li),prefixCls:$r,fieldId:Bt,isRequired:an,errors:Wi,warnings:la,meta:Ni,onSubItemMetaChange:mi}),ht)}if(!Yr&&!un&&!zt)return Ri(ti(cn));let yt={};return typeof rr=="string"?yt.label=rr:ut&&(yt.label=String(ut)),ar&&(yt=Object.assign(Object.assign({},yt),ar)),Ri(be.createElement(At.Field,Object.assign({},Ke,{messageVariables:yt,trigger:ot,validateTrigger:Kt,onMetaChange:Vr}),(ht,Bt,an)=>{const kn=$t(ut).length&&Bt?Bt.name:[],ur=Hn(kn,en),Er=qn!==void 0?qn:!!(Cr&&Cr.some(Nr=>{if(Nr&&typeof Nr=="object"&&Nr.required&&!Nr.warningOnly)return!0;if(typeof Nr=="function"){const ei=Nr(an);return ei&&ei.required&&!ei.warningOnly}return!1})),Br=Object.assign({},ht);let Hr=null;if(Array.isArray(cn)&&Yr)Hr=cn;else if(!(un&&(!($n||zt)||Yr))){if(!(zt&&!un&&!Yr))if((0,Ee.l$)(cn)){const Nr=Object.assign(Object.assign({},cn.props),Br);if(Nr.id||(Nr.id=ur),Qt||Wi.length>0||la.length>0||Ke.extra){const Mr=[];(Qt||Wi.length>0)&&Mr.push(`${ur}_help`),Ke.extra&&Mr.push(`${ur}_extra`),Nr["aria-describedby"]=Mr.join(" ")}Wi.length>0&&(Nr["aria-invalid"]="true"),Er&&(Nr["aria-required"]="true"),(0,_n.Yr)(cn)&&(Nr.ref=ea(kn,cn)),new Set([].concat((0,fe.Z)($t(ot)),(0,fe.Z)($t(Kt)))).forEach(Mr=>{Nr[Mr]=function(){for(var fi,Ai,Si,Ce,Ne,Be=arguments.length,He=new Array(Be),Ge=0;Ge<Be;Ge++)He[Ge]=arguments[Ge];(Si=Br[Mr])===null||Si===void 0||(fi=Si).call.apply(fi,[Br].concat(He)),(Ne=(Ce=cn.props)[Mr])===null||Ne===void 0||(Ai=Ne).call.apply(Ai,[Ce].concat(He))}});const gi=[Nr["aria-required"],Nr["aria-invalid"],Nr["aria-describedby"]];Hr=be.createElement(mt,{value:Br[Ke.valuePropName||"value"],update:cn,childProps:gi},(0,Ee.Tm)(cn,Nr))}else un&&($n||zt)&&!Yr?Hr=cn(an):Hr=cn}return ti(Hr,ur,Er)}))}const sr=An;sr.useStatus=ve;var nr=sr,pr=function(Ke,ut){var Ot={};for(var Tt in Ke)Object.prototype.hasOwnProperty.call(Ke,Tt)&&ut.indexOf(Tt)<0&&(Ot[Tt]=Ke[Tt]);if(Ke!=null&&typeof Object.getOwnPropertySymbols=="function")for(var zt=0,Tt=Object.getOwnPropertySymbols(Ke);zt<Tt.length;zt++)ut.indexOf(Tt[zt])<0&&Object.prototype.propertyIsEnumerable.call(Ke,Tt[zt])&&(Ot[Tt[zt]]=Ke[Tt[zt]]);return Ot},Ue=Ke=>{var{prefixCls:ut,children:Ot}=Ke,Tt=pr(Ke,["prefixCls","children"]);const{getPrefixCls:zt}=be.useContext(xn.E_),Ht=zt("form",ut),$n=be.useMemo(()=>({prefixCls:Ht,status:"error"}),[Ht]);return be.createElement(At.List,Object.assign({},Tt),(Cr,Yn,qn)=>be.createElement(Le.Rk.Provider,{value:$n},Ot(Cr.map(rr=>Object.assign(Object.assign({},rr),{fieldKey:rr.key})),Yn,{errors:qn.errors,warnings:qn.warnings})))};function it(){const{form:Ke}=(0,be.useContext)(Le.q3);return Ke}const _t=Ft;_t.Item=nr,_t.List=Ue,_t.ErrorList=Rt,_t.useForm=ft,_t.useFormInstance=it,_t.useWatch=At.useWatch,_t.Provider=Le.RV,_t.create=()=>{};var Ut=_t},31795:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return Kn}});var fe=ce(42922),tt=ce(53978),Fe=ce(94184),Ye=ce.n(Fe),be=ce(87462),_e=ce(4942),Le=ce(71002),Se=ce(97685),pe=ce(45987),Te=ce(15671),gt=ce(43144);function ze(){return typeof BigInt=="function"}function Pt(Ue){return!Ue&&Ue!==0&&!Number.isNaN(Ue)||!String(Ue).trim()}function kt(Ue){var it=Ue.trim(),_t=it.startsWith("-");_t&&(it=it.slice(1)),it=it.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),it.startsWith(".")&&(it="0".concat(it));var Ut=it||"0",Ke=Ut.split("."),ut=Ke[0]||"0",Ot=Ke[1]||"0";ut==="0"&&Ot==="0"&&(_t=!1);var Tt=_t?"-":"";return{negative:_t,negativeStr:Tt,trimStr:Ut,integerStr:ut,decimalStr:Ot,fullStr:"".concat(Tt).concat(Ut)}}function pt(Ue){var it=String(Ue);return!Number.isNaN(Number(it))&&it.includes("e")}function Je(Ue){var it=String(Ue);if(pt(Ue)){var _t=Number(it.slice(it.indexOf("e-")+2)),Ut=it.match(/\.(\d+)/);return Ut!=null&&Ut[1]&&(_t+=Ut[1].length),_t}return it.includes(".")&&Dt(it)?it.length-it.indexOf(".")-1:0}function De(Ue){var it=String(Ue);if(pt(Ue)){if(Ue>Number.MAX_SAFE_INTEGER)return String(ze()?BigInt(Ue).toString():Number.MAX_SAFE_INTEGER);if(Ue<Number.MIN_SAFE_INTEGER)return String(ze()?BigInt(Ue).toString():Number.MIN_SAFE_INTEGER);it=Ue.toFixed(Je(it))}return kt(it).fullStr}function Dt(Ue){return typeof Ue=="number"?!Number.isNaN(Ue):Ue?/^\s*-?\d+(\.\d+)?\s*$/.test(Ue)||/^\s*-?\d+\.\s*$/.test(Ue)||/^\s*-?\.\d+\s*$/.test(Ue):!1}var Yt=function(){function Ue(it){if((0,Te.Z)(this,Ue),(0,_e.Z)(this,"origin",""),(0,_e.Z)(this,"negative",void 0),(0,_e.Z)(this,"integer",void 0),(0,_e.Z)(this,"decimal",void 0),(0,_e.Z)(this,"decimalLen",void 0),(0,_e.Z)(this,"empty",void 0),(0,_e.Z)(this,"nan",void 0),Pt(it)){this.empty=!0;return}if(this.origin=String(it),it==="-"||Number.isNaN(it)){this.nan=!0;return}var _t=it;if(pt(_t)&&(_t=Number(_t)),_t=typeof _t=="string"?_t:De(_t),Dt(_t)){var Ut=kt(_t);this.negative=Ut.negative;var Ke=Ut.trimStr.split(".");this.integer=BigInt(Ke[0]);var ut=Ke[1]||"0";this.decimal=BigInt(ut),this.decimalLen=ut.length}else this.nan=!0}return(0,gt.Z)(Ue,[{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(_t){var Ut="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(_t,"0"));return BigInt(Ut)}},{key:"negate",value:function(){var _t=new Ue(this.toString());return _t.negative=!_t.negative,_t}},{key:"cal",value:function(_t,Ut,Ke){var ut=Math.max(this.getDecimalStr().length,_t.getDecimalStr().length),Ot=this.alignDecimal(ut),Tt=_t.alignDecimal(ut),zt=Ut(Ot,Tt).toString(),Ht=Ke(ut),$n=kt(zt),Cr=$n.negativeStr,Yn=$n.trimStr,qn="".concat(Cr).concat(Yn.padStart(Ht+1,"0"));return new Ue("".concat(qn.slice(0,-Ht),".").concat(qn.slice(-Ht)))}},{key:"add",value:function(_t){if(this.isInvalidate())return new Ue(_t);var Ut=new Ue(_t);return Ut.isInvalidate()?this:this.cal(Ut,function(Ke,ut){return Ke+ut},function(Ke){return Ke})}},{key:"multi",value:function(_t){var Ut=new Ue(_t);return this.isInvalidate()||Ut.isInvalidate()?new Ue(NaN):this.cal(Ut,function(Ke,ut){return Ke*ut},function(Ke){return Ke*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(_t){return this.toString()===(_t==null?void 0:_t.toString())}},{key:"lessEquals",value:function(_t){return this.add(_t.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var _t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return _t?this.isInvalidate()?"":kt("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),Ue}(),nt=function(){function Ue(it){if((0,Te.Z)(this,Ue),(0,_e.Z)(this,"origin",""),(0,_e.Z)(this,"number",void 0),(0,_e.Z)(this,"empty",void 0),Pt(it)){this.empty=!0;return}this.origin=String(it),this.number=Number(it)}return(0,gt.Z)(Ue,[{key:"negate",value:function(){return new Ue(-this.toNumber())}},{key:"add",value:function(_t){if(this.isInvalidate())return new Ue(_t);var Ut=Number(_t);if(Number.isNaN(Ut))return this;var Ke=this.number+Ut;if(Ke>Number.MAX_SAFE_INTEGER)return new Ue(Number.MAX_SAFE_INTEGER);if(Ke<Number.MIN_SAFE_INTEGER)return new Ue(Number.MIN_SAFE_INTEGER);var ut=Math.max(Je(this.number),Je(Ut));return new Ue(Ke.toFixed(ut))}},{key:"multi",value:function(_t){var Ut=Number(_t);if(this.isInvalidate()||Number.isNaN(Ut))return new Ue(NaN);var Ke=this.number*Ut;if(Ke>Number.MAX_SAFE_INTEGER)return new Ue(Number.MAX_SAFE_INTEGER);if(Ke<Number.MIN_SAFE_INTEGER)return new Ue(Number.MIN_SAFE_INTEGER);var ut=Math.max(Je(this.number),Je(Ut));return new Ue(Ke.toFixed(ut))}},{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(_t){return this.toNumber()===(_t==null?void 0:_t.toNumber())}},{key:"lessEquals",value:function(_t){return this.add(_t.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var _t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return _t?this.isInvalidate()?"":De(this.number):this.origin}}]),Ue}();function ct(Ue){return ze()?new Yt(Ue):new nt(Ue)}function Ie(Ue,it,_t){var Ut=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(Ue==="")return"";var Ke=kt(Ue),ut=Ke.negativeStr,Ot=Ke.integerStr,Tt=Ke.decimalStr,zt="".concat(it).concat(Tt),Ht="".concat(ut).concat(Ot);if(_t>=0){var $n=Number(Tt[_t]);if($n>=5&&!Ut){var Cr=ct(Ue).add("".concat(ut,"0.").concat("0".repeat(_t)).concat(10-$n));return Ie(Cr.toString(),it,_t,Ut)}return _t===0?Ht:"".concat(Ht).concat(it).concat(Tt.padEnd(_t,"0").slice(0,_t))}return zt===".0"?Ht:"".concat(Ht).concat(zt)}var Me=ct,Ve=ce(67656),Xe=ce(67294);function Ct(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var wt=Ct()?Xe.useLayoutEffect:Xe.useEffect,Mt=function(it,_t){var Ut=Xe.useRef(!0);wt(function(){return it(Ut.current)},_t),wt(function(){return Ut.current=!1,function(){Ut.current=!0}},[])},je=function(it,_t){Mt(function(Ut){if(!Ut)return it()},_t)},Rt=Mt,At=ce(27183);function xn(Ue,it,_t){var Ut=React.useRef({});return(!("value"in Ut.current)||_t(Ut.current.condition,it))&&(Ut.current.value=Ue(),Ut.current.condition=it),Ut.current.value}function jt(Ue,it){typeof Ue=="function"?Ue(it):(0,Le.Z)(Ue)==="object"&&Ue&&"current"in Ue&&(Ue.current=it)}function vn(){for(var Ue=arguments.length,it=new Array(Ue),_t=0;_t<Ue;_t++)it[_t]=arguments[_t];var Ut=it.filter(function(Ke){return Ke});return Ut.length<=1?Ut[0]:function(Ke){it.forEach(function(ut){jt(ut,Ke)})}}function er(){for(var Ue=arguments.length,it=new Array(Ue),_t=0;_t<Ue;_t++)it[_t]=arguments[_t];return useMemo(function(){return vn.apply(void 0,it)},it,function(Ut,Ke){return Ut.length!==Ke.length||Ut.every(function(ut,Ot){return ut!==Ke[Ot]})})}function Sr(Ue){var it,_t,Ut=isMemo(Ue)?Ue.type.type:Ue.type;return!(typeof Ut=="function"&&!((it=Ut.prototype)!==null&&it!==void 0&&it.render)||typeof Ue=="function"&&!((_t=Ue.prototype)!==null&&_t!==void 0&&_t.render))}function qe(Ue){return!isValidElement(Ue)||isFragment(Ue)?!1:Sr(Ue)}var Ae={},$t=[],Hn=function(it){$t.push(it)};function bn(Ue,it){if(0)var _t}function at(Ue,it){if(0)var _t}function ft(){Ae={}}function Gt(Ue,it,_t){!it&&!Ae[_t]&&(Ue(!1,_t),Ae[_t]=!0)}function zn(Ue,it){Gt(bn,Ue,it)}function mn(Ue,it){Gt(at,Ue,it)}zn.preMessage=Hn,zn.resetWarned=ft,zn.noteOnce=mn;var nn=zn;function Ft(Ue,it){var _t=(0,Xe.useRef)(null);function Ut(){try{var ut=Ue.selectionStart,Ot=Ue.selectionEnd,Tt=Ue.value,zt=Tt.substring(0,ut),Ht=Tt.substring(Ot);_t.current={start:ut,end:Ot,value:Tt,beforeTxt:zt,afterTxt:Ht}}catch($n){}}function Ke(){if(Ue&&_t.current&&it)try{var ut=Ue.value,Ot=_t.current,Tt=Ot.beforeTxt,zt=Ot.afterTxt,Ht=Ot.start,$n=ut.length;if(ut.endsWith(zt))$n=ut.length-_t.current.afterTxt.length;else if(ut.startsWith(Tt))$n=Tt.length;else{var Cr=Tt[Ht-1],Yn=ut.indexOf(Cr,Ht-1);Yn!==-1&&($n=Yn+1)}Ue.setSelectionRange($n,$n)}catch(qn){nn(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(qn.message))}}return[Ut,Ke]}var Pn=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Ue=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(Ue)||/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(Ue==null?void 0:Ue.substr(0,4))},_n=function(){var it=(0,Xe.useState)(!1),_t=(0,Se.Z)(it,2),Ut=_t[0],Ke=_t[1];return Rt(function(){Ke(Pn())},[]),Ut},Ee=_n,ue=function(it){return+setTimeout(it,16)},se=function(it){return clearTimeout(it)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(ue=function(it){return window.requestAnimationFrame(it)},se=function(it){return window.cancelAnimationFrame(it)});var ye=0,ve=new Map;function le(Ue){ve.delete(Ue)}var We=function(it){var _t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;ye+=1;var Ut=ye;function Ke(ut){if(ut===0)le(Ut),it();else{var Ot=ue(function(){Ke(ut-1)});ve.set(Ut,Ot)}}return Ke(_t),Ut};We.cancel=function(Ue){var it=ve.get(Ue);return le(it),se(it)};var Lt=We,tn=200,hn=600;function sn(Ue){var it=Ue.prefixCls,_t=Ue.upNode,Ut=Ue.downNode,Ke=Ue.upDisabled,ut=Ue.downDisabled,Ot=Ue.onStep,Tt=Xe.useRef(),zt=Xe.useRef([]),Ht=Xe.useRef();Ht.current=Ot;var $n=function(){clearTimeout(Tt.current)},Cr=function(Qt,Tn){Qt.preventDefault(),$n(),Ht.current(Tn);function en(){Ht.current(Tn),Tt.current=setTimeout(en,tn)}Tt.current=setTimeout(en,hn)};Xe.useEffect(function(){return function(){$n(),zt.current.forEach(function(vt){return Lt.cancel(vt)})}},[]);var Yn=Ee();if(Yn)return null;var qn="".concat(it,"-handler"),rr=Ye()(qn,"".concat(qn,"-up"),(0,_e.Z)({},"".concat(qn,"-up-disabled"),Ke)),ar=Ye()(qn,"".concat(qn,"-down"),(0,_e.Z)({},"".concat(qn,"-down-disabled"),ut)),ot=function(){return zt.current.push(Lt($n))},Qe={unselectable:"on",role:"button",onMouseUp:ot,onMouseLeave:ot};return Xe.createElement("div",{className:"".concat(qn,"-wrap")},Xe.createElement("span",(0,be.Z)({},Qe,{onMouseDown:function(Qt){Cr(Qt,!0)},"aria-label":"Increase Value","aria-disabled":Ke,className:rr}),_t||Xe.createElement("span",{unselectable:"on",className:"".concat(it,"-handler-up-inner")})),Xe.createElement("span",(0,be.Z)({},Qe,{onMouseDown:function(Qt){Cr(Qt,!1)},"aria-label":"Decrease Value","aria-disabled":ut,className:ar}),Ut||Xe.createElement("span",{unselectable:"on",className:"".concat(it,"-handler-down-inner")})))}function yn(Ue){var it=typeof Ue=="number"?De(Ue):kt(Ue).fullStr,_t=it.includes(".");return _t?kt(it.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:Ue+"0"}var ln=ce(87887),yr=function(){var Ue=(0,Xe.useRef)(0),it=function(){Lt.cancel(Ue.current)};return(0,Xe.useEffect)(function(){return it},[]),function(_t){it(),Ue.current=Lt(function(){_t()})}},Fr=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],Nt=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","classes","className","classNames"],Rn=function(it,_t){return it||_t.isEmpty()?_t.toString():_t.toNumber()},Gr=function(it){var _t=Me(it);return _t.isInvalidate()?null:_t},li=Xe.forwardRef(function(Ue,it){var _t,Ut=Ue.prefixCls,Ke=Ut===void 0?"rc-input-number":Ut,ut=Ue.className,Ot=Ue.style,Tt=Ue.min,zt=Ue.max,Ht=Ue.step,$n=Ht===void 0?1:Ht,Cr=Ue.defaultValue,Yn=Ue.value,qn=Ue.disabled,rr=Ue.readOnly,ar=Ue.upHandler,ot=Ue.downHandler,Qe=Ue.keyboard,vt=Ue.controls,Qt=vt===void 0?!0:vt,Tn=Ue.classNames,en=Ue.stringMode,cn=Ue.parser,un=Ue.formatter,Dn=Ue.precision,or=Ue.decimalSeparator,Kt=Ue.onChange,Yr=Ue.onInput,$r=Ue.onPressEnter,Ri=Ue.onStep,Li=(0,pe.Z)(Ue,Fr),pi="".concat(Ke,"-input"),Gi=Xe.useRef(null),yi=Xe.useState(!1),ii=(0,Se.Z)(yi,2),Ni=ii[0],Zi=ii[1],Vr=Xe.useRef(!1),mi=Xe.useRef(!1),Wi=Xe.useRef(!1),la=Xe.useState(function(){return Me(Yn!=null?Yn:Cr)}),ea=(0,Se.Z)(la,2),ti=ea[0],yt=ea[1];function ht(jn){Yn===void 0&&yt(jn)}var Bt=Xe.useCallback(function(jn,Zn){if(!Zn)return Dn>=0?Dn:Math.max(Je(jn),Je($n))},[Dn,$n]),an=Xe.useCallback(function(jn){var Zn=String(jn);if(cn)return cn(Zn);var Jn=Zn;return or&&(Jn=Jn.replace(or,".")),Jn.replace(/[^\w.-]+/g,"")},[cn,or]),kn=Xe.useRef(""),ur=Xe.useCallback(function(jn,Zn){if(un)return un(jn,{userTyping:Zn,input:String(kn.current)});var Jn=typeof jn=="number"?De(jn):jn;if(!Zn){var Qn=Bt(Jn,Zn);if(Dt(Jn)&&(or||Qn>=0)){var hr=or||".";Jn=Ie(Jn,hr,Qn)}}return Jn},[un,Bt,or]),Er=Xe.useState(function(){var jn=Cr!=null?Cr:Yn;return ti.isInvalidate()&&["string","number"].includes((0,Le.Z)(jn))?Number.isNaN(jn)?"":jn:ur(ti.toString(),!1)}),Br=(0,Se.Z)(Er,2),Hr=Br[0],Nr=Br[1];kn.current=Hr;function ei(jn,Zn){Nr(ur(jn.isInvalidate()?jn.toString(!1):jn.toString(!Zn),Zn))}var gi=Xe.useMemo(function(){return Gr(zt)},[zt,Dn]),Mr=Xe.useMemo(function(){return Gr(Tt)},[Tt,Dn]),fi=Xe.useMemo(function(){return!gi||!ti||ti.isInvalidate()?!1:gi.lessEquals(ti)},[gi,ti]),Ai=Xe.useMemo(function(){return!Mr||!ti||ti.isInvalidate()?!1:ti.lessEquals(Mr)},[Mr,ti]),Si=Ft(Gi.current,Ni),Ce=(0,Se.Z)(Si,2),Ne=Ce[0],Be=Ce[1],He=function(Zn){return gi&&!Zn.lessEquals(gi)?gi:Mr&&!Mr.lessEquals(Zn)?Mr:null},Ge=function(Zn){return!He(Zn)},et=function(Zn,Jn){var Qn=Zn,hr=Ge(Qn)||Qn.isEmpty();if(!Qn.isEmpty()&&!Jn&&(Qn=He(Qn)||Qn,hr=!0),!rr&&!qn&&hr){var Pe=Qn.toString(),$e=Bt(Pe,Jn);return $e>=0&&(Qn=Me(Ie(Pe,".",$e)),Ge(Qn)||(Qn=Me(Ie(Pe,".",$e,!0)))),Qn.equals(ti)||(ht(Qn),Kt==null||Kt(Qn.isEmpty()?null:Rn(en,Qn)),Yn===void 0&&ei(Qn,Jn)),Qn}return ti},bt=yr(),Zt=function jn(Zn){if(Ne(),kn.current=Zn,Nr(Zn),!mi.current){var Jn=an(Zn),Qn=Me(Jn);Qn.isNaN()||et(Qn,!0)}Yr==null||Yr(Zn),bt(function(){var hr=Zn;cn||(hr=Zn.replace(/。/g,".")),hr!==Zn&&jn(hr)})},Jt=function(){mi.current=!0},Gn=function(){mi.current=!1,Zt(Gi.current.value)},fr=function(Zn){Zt(Zn.target.value)},Wn=function(Zn){var Jn;if(!(Zn&&fi||!Zn&&Ai)){Vr.current=!1;var Qn=Me(Wi.current?yn($n):$n);Zn||(Qn=Qn.negate());var hr=(ti||Me(0)).add(Qn.toString()),Pe=et(hr,!1);Ri==null||Ri(Rn(en,Pe),{offset:Wi.current?yn($n):$n,type:Zn?"up":"down"}),(Jn=Gi.current)===null||Jn===void 0||Jn.focus()}},pn=function(Zn){var Jn=Me(an(Hr)),Qn=Jn;Jn.isNaN()?Qn=et(ti,Zn):Qn=et(Jn,Zn),Yn!==void 0?ei(ti,!1):Qn.isNaN()||ei(Qn,!1)},dn=function(){Vr.current=!0},Cn=function(Zn){var Jn=Zn.key,Qn=Zn.shiftKey;Vr.current=!0,Wi.current=Qn,Jn==="Enter"&&(mi.current||(Vr.current=!1),pn(!1),$r==null||$r(Zn)),Qe!==!1&&!mi.current&&["Up","ArrowUp","Down","ArrowDown"].includes(Jn)&&(Wn(Jn==="Up"||Jn==="ArrowUp"),Zn.preventDefault())},In=function(){Vr.current=!1,Wi.current=!1},cr=function(){pn(!1),Zi(!1),Vr.current=!1};return je(function(){ti.isInvalidate()||ei(ti,!1)},[Dn]),je(function(){var jn=Me(Yn);yt(jn);var Zn=Me(an(Hr));(!jn.equals(Zn)||!Vr.current||un)&&ei(jn,Vr.current)},[Yn]),je(function(){un&&Be()},[Hr]),Xe.createElement("div",{className:Ye()(Ke,Tn==null?void 0:Tn.input,ut,(_t={},(0,_e.Z)(_t,"".concat(Ke,"-focused"),Ni),(0,_e.Z)(_t,"".concat(Ke,"-disabled"),qn),(0,_e.Z)(_t,"".concat(Ke,"-readonly"),rr),(0,_e.Z)(_t,"".concat(Ke,"-not-a-number"),ti.isNaN()),(0,_e.Z)(_t,"".concat(Ke,"-out-of-range"),!ti.isInvalidate()&&!Ge(ti)),_t)),style:Ot,onFocus:function(){Zi(!0)},onBlur:cr,onKeyDown:Cn,onKeyUp:In,onCompositionStart:Jt,onCompositionEnd:Gn,onBeforeInput:dn},Qt&&Xe.createElement(sn,{prefixCls:Ke,upNode:ar,downNode:ot,upDisabled:fi,downDisabled:Ai,onStep:Wn}),Xe.createElement("div",{className:"".concat(pi,"-wrap")},Xe.createElement("input",(0,be.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":Tt,"aria-valuemax":zt,"aria-valuenow":ti.isInvalidate()?null:ti.toString(),step:$n},Li,{ref:vn(Gi,it),className:pi,value:Hr,onChange:fr,disabled:qn,readOnly:rr}))))}),st=Xe.forwardRef(function(Ue,it){var _t=Ue.disabled,Ut=Ue.style,Ke=Ue.prefixCls,ut=Ue.value,Ot=Ue.prefix,Tt=Ue.suffix,zt=Ue.addonBefore,Ht=Ue.addonAfter,$n=Ue.classes,Cr=Ue.className,Yn=Ue.classNames,qn=(0,pe.Z)(Ue,Nt),rr=Xe.useRef(null),ar=function(Qe){rr.current&&(0,ln.nH)(rr.current,Qe)};return Xe.createElement(Ve.BaseInput,{inputElement:Xe.createElement(li,(0,be.Z)({prefixCls:Ke,disabled:_t,classNames:Yn,ref:vn(rr,it)},qn)),className:Cr,triggerFocus:ar,prefixCls:Ke,value:ut,disabled:_t,style:Ut,prefix:Ot,suffix:Tt,addonAfter:Ht,addonBefore:zt,classes:$n,classNames:Yn,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}})});st.displayName="InputNumber";var Wt=st,Vn=Wt,ir=ce(9708),gr=ce(53124),Pr=ce(46735),Ur=ce(98866),Xr=ce(98675),qr=ce(65223),ui=ce(4173),br=ce(47673),Ei=ce(14747),sa=ce(80110),Ji=ce(67968),Qi=ce(45503);const Ci=(Ue,it)=>{let{componentCls:_t,borderRadiusSM:Ut,borderRadiusLG:Ke}=Ue;const ut=it==="lg"?Ke:Ut;return{[`&-${it}`]:{[`${_t}-handler-wrap`]:{borderStartEndRadius:ut,borderEndEndRadius:ut},[`${_t}-handler-up`]:{borderStartEndRadius:ut},[`${_t}-handler-down`]:{borderEndEndRadius:ut}}}},mt=Ue=>{const{componentCls:it,lineWidth:_t,lineType:Ut,colorBorder:Ke,borderRadius:ut,fontSizeLG:Ot,controlHeightLG:Tt,controlHeightSM:zt,colorError:Ht,paddingInlineSM:$n,colorTextDescription:Cr,motionDurationMid:Yn,handleHoverColor:qn,paddingInline:rr,paddingBlock:ar,handleBg:ot,handleActiveBg:Qe,colorTextDisabled:vt,borderRadiusSM:Qt,borderRadiusLG:Tn,controlWidth:en,handleVisible:cn,handleBorderColor:un}=Ue;return[{[it]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,Ei.Wf)(Ue)),(0,br.ik)(Ue)),(0,br.bi)(Ue,it)),{display:"inline-block",width:en,margin:0,padding:0,border:`${_t}px ${Ut} ${Ke}`,borderRadius:ut,"&-rtl":{direction:"rtl",[`${it}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:Ot,borderRadius:Tn,[`input${it}-input`]:{height:Tt-2*_t}},"&-sm":{padding:0,borderRadius:Qt,[`input${it}-input`]:{height:zt-2*_t,padding:`0 ${$n}px`}},"&:hover":Object.assign({},(0,br.pU)(Ue)),"&-focused":Object.assign({},(0,br.M1)(Ue)),"&-out-of-range":{[`${it}-input-wrap`]:{input:{color:Ht}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,Ei.Wf)(Ue)),(0,br.s7)(Ue)),{"&-wrapper":{display:"inline-block",textAlign:"start",verticalAlign:"top",[`${it}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${it}-group-addon`]:{borderRadius:Tn,fontSize:Ue.fontSizeLG}},"&-sm":{[`${it}-group-addon`]:{borderRadius:Qt}},[`${it}-wrapper-disabled > ${it}-group-addon`]:Object.assign({},(0,br.Xy)(Ue))}}),[`&-disabled ${it}-input`]:{cursor:"not-allowed"},[it]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,Ei.Wf)(Ue)),{width:"100%",padding:`${ar}px ${rr}px`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:ut,outline:0,transition:`all ${Yn} linear`,appearance:"textfield",fontSize:"inherit"}),(0,br.nz)(Ue.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:Ue.handleWidth,height:"100%",background:ot,borderStartStartRadius:0,borderStartEndRadius:ut,borderEndEndRadius:ut,borderEndStartRadius:0,opacity:cn===!0?1:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${Yn} linear ${Yn}`,[`${it}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[`
${it}-handler-up-inner,
${it}-handler-down-inner
`]:{marginInlineEnd:0,fontSize:Ue.handleFontSize}}},[`${it}-handler`]:{height:"50%",overflow:"hidden",color:Cr,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:`${_t}px ${Ut} ${un}`,transition:`all ${Yn} linear`,"&:active":{background:Qe},"&:hover":{height:"60%",[`
${it}-handler-up-inner,
${it}-handler-down-inner
`]:{color:qn}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,Ei.Ro)()),{color:Cr,transition:`all ${Yn} linear`,userSelect:"none"})},[`${it}-handler-up`]:{borderStartEndRadius:ut},[`${it}-handler-down`]:{borderBlockStart:`${_t}px ${Ut} ${un}`,borderEndEndRadius:ut}},Ci(Ue,"lg")),Ci(Ue,"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:vt}})},{[`${it}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${it}-handler-down`]:{borderBlockStartWidth:0}}}]},Mn=Ue=>{const{componentCls:it,paddingBlock:_t,paddingInline:Ut,inputAffixPadding:Ke,controlWidth:ut,borderRadiusLG:Ot,borderRadiusSM:Tt}=Ue;return{[`${it}-affix-wrapper`]:Object.assign(Object.assign(Object.assign({},(0,br.ik)(Ue)),(0,br.bi)(Ue,`${it}-affix-wrapper`)),{position:"relative",display:"inline-flex",width:ut,padding:0,paddingInlineStart:Ut,"&-lg":{borderRadius:Ot},"&-sm":{borderRadius:Tt},[`&:not(${it}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},(0,br.pU)(Ue)),{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:`${_t}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:Ke},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:Ut,marginInlineStart:Ke}}})}};var En=(0,Ji.Z)("InputNumber",Ue=>{const it=(0,Qi.TS)(Ue,(0,br.e5)(Ue));return[mt(it),Mn(it),(0,sa.c)(it)]},Ue=>Object.assign(Object.assign({},(0,br.TM)(Ue)),{controlWidth:90,handleWidth:Ue.controlHeightSM-Ue.lineWidth*2,handleFontSize:Ue.fontSize/2,handleVisible:"auto",handleActiveBg:Ue.colorFillAlter,handleBg:Ue.colorBgContainer,handleHoverColor:Ue.colorPrimary,handleBorderColor:Ue.colorBorder})),An=function(Ue,it){var _t={};for(var Ut in Ue)Object.prototype.hasOwnProperty.call(Ue,Ut)&&it.indexOf(Ut)<0&&(_t[Ut]=Ue[Ut]);if(Ue!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ke=0,Ut=Object.getOwnPropertySymbols(Ue);Ke<Ut.length;Ke++)it.indexOf(Ut[Ke])<0&&Object.prototype.propertyIsEnumerable.call(Ue,Ut[Ke])&&(_t[Ut[Ke]]=Ue[Ut[Ke]]);return _t};const sr=Xe.forwardRef((Ue,it)=>{const{getPrefixCls:_t,direction:Ut}=Xe.useContext(gr.E_),Ke=Xe.useRef(null);Xe.useImperativeHandle(it,()=>Ke.current);const{className:ut,rootClassName:Ot,size:Tt,disabled:zt,prefixCls:Ht,addonBefore:$n,addonAfter:Cr,prefix:Yn,bordered:qn=!0,readOnly:rr,status:ar,controls:ot}=Ue,Qe=An(Ue,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls"]),vt=_t("input-number",Ht),[Qt,Tn]=En(vt),{compactSize:en,compactItemClassnames:cn}=(0,ui.ri)(vt,Ut);let un=Xe.createElement(tt.Z,{className:`${vt}-handler-up-inner`}),Dn=Xe.createElement(fe.Z,{className:`${vt}-handler-down-inner`});const or=typeof ot=="boolean"?ot:void 0;typeof ot=="object"&&(un=typeof ot.upIcon=="undefined"?un:Xe.createElement("span",{className:`${vt}-handler-up-inner`},ot.upIcon),Dn=typeof ot.downIcon=="undefined"?Dn:Xe.createElement("span",{className:`${vt}-handler-down-inner`},ot.downIcon));const{hasFeedback:Kt,status:Yr,isFormItemInput:$r,feedbackIcon:Ri}=Xe.useContext(qr.aM),Li=(0,ir.F)(Yr,ar),pi=(0,Xr.Z)(Vr=>{var mi;return(mi=Tt!=null?Tt:en)!==null&&mi!==void 0?mi:Vr}),Gi=Xe.useContext(Ur.Z),yi=zt!=null?zt:Gi,ii=Ye()({[`${vt}-lg`]:pi==="large",[`${vt}-sm`]:pi==="small",[`${vt}-rtl`]:Ut==="rtl",[`${vt}-borderless`]:!qn,[`${vt}-in-form-item`]:$r},(0,ir.Z)(vt,Li),cn,Tn),Ni=`${vt}-group`,Zi=Xe.createElement(Vn,Object.assign({ref:Ke,disabled:yi,className:Ye()(ut,Ot),upHandler:un,downHandler:Dn,prefixCls:vt,readOnly:rr,controls:or,prefix:Yn,suffix:Kt&&Ri,addonAfter:Cr&&Xe.createElement(ui.BR,null,Xe.createElement(qr.Ux,{override:!0,status:!0},Cr)),addonBefore:$n&&Xe.createElement(ui.BR,null,Xe.createElement(qr.Ux,{override:!0,status:!0},$n)),classNames:{input:ii},classes:{affixWrapper:Ye()((0,ir.Z)(`${vt}-affix-wrapper`,Li,Kt),{[`${vt}-affix-wrapper-sm`]:pi==="small",[`${vt}-affix-wrapper-lg`]:pi==="large",[`${vt}-affix-wrapper-rtl`]:Ut==="rtl",[`${vt}-affix-wrapper-borderless`]:!qn},Tn),wrapper:Ye()({[`${Ni}-rtl`]:Ut==="rtl",[`${vt}-wrapper-disabled`]:yi},Tn),group:Ye()({[`${vt}-group-wrapper-sm`]:pi==="small",[`${vt}-group-wrapper-lg`]:pi==="large",[`${vt}-group-wrapper-rtl`]:Ut==="rtl"},(0,ir.Z)(`${vt}-group-wrapper`,Li,Kt),Tn)}},Qe));return Qt(Zi)}),nr=sr,pr=Ue=>Xe.createElement(Pr.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},Xe.createElement(sr,Object.assign({},Ue)));nr._InternalPanelDoNotUseOrYouWillBeFired=pr;var Kn=nr},82586:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return Yt},n:function(){return De}});var fe=ce(16646),tt=ce(94184),Fe=ce.n(tt),Ye=ce(67656),be=ce(17799),_e=ce(67294),Le=ce(9708),Se=ce(53124),pe=ce(98866),Te=ce(98675),gt=ce(65223),ze=ce(4173),Pt=ce(72922),kt=ce(47673);function pt(nt){return!!(nt.prefix||nt.suffix||nt.allowClear)}var Je=function(nt,ct){var Ie={};for(var Me in nt)Object.prototype.hasOwnProperty.call(nt,Me)&&ct.indexOf(Me)<0&&(Ie[Me]=nt[Me]);if(nt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ve=0,Me=Object.getOwnPropertySymbols(nt);Ve<Me.length;Ve++)ct.indexOf(Me[Ve])<0&&Object.prototype.propertyIsEnumerable.call(nt,Me[Ve])&&(Ie[Me[Ve]]=nt[Me[Ve]]);return Ie};function De(nt,ct){if(!nt)return;nt.focus(ct);const{cursor:Ie}=ct||{};if(Ie){const Me=nt.value.length;switch(Ie){case"start":nt.setSelectionRange(0,0);break;case"end":nt.setSelectionRange(Me,Me);break;default:nt.setSelectionRange(0,Me);break}}}var Yt=(0,_e.forwardRef)((nt,ct)=>{var Ie;const{prefixCls:Me,bordered:Ve=!0,status:Xe,size:Ct,disabled:wt,onBlur:Mt,onFocus:je,suffix:Rt,allowClear:At,addonAfter:xn,addonBefore:jt,className:vn,style:er,styles:Sr,rootClassName:qe,onChange:Ae,classNames:$t}=nt,Hn=Je(nt,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames"]),{getPrefixCls:bn,direction:at,input:ft}=_e.useContext(Se.E_),Gt=bn("input",Me),zn=(0,_e.useRef)(null),[mn,nn]=(0,kt.ZP)(Gt),{compactSize:Ft,compactItemClassnames:Pn}=(0,ze.ri)(Gt,at),_n=(0,Te.Z)(Fr=>{var Nt;return(Nt=Ct!=null?Ct:Ft)!==null&&Nt!==void 0?Nt:Fr}),Ee=_e.useContext(pe.Z),ue=wt!=null?wt:Ee,{status:se,hasFeedback:ye,feedbackIcon:ve}=(0,_e.useContext)(gt.aM),le=(0,Le.F)(se,Xe),We=pt(nt)||!!ye,Lt=(0,_e.useRef)(We);(0,_e.useEffect)(()=>{var Fr;We&&Lt.current,Lt.current=We},[We]);const tn=(0,Pt.Z)(zn,!0),hn=Fr=>{tn(),Mt==null||Mt(Fr)},sn=Fr=>{tn(),je==null||je(Fr)},yn=Fr=>{tn(),Ae==null||Ae(Fr)},ln=(ye||Rt)&&_e.createElement(_e.Fragment,null,Rt,ye&&ve);let yr;return typeof At=="object"&&(At!=null&&At.clearIcon)?yr=At:At&&(yr={clearIcon:_e.createElement(fe.Z,null)}),mn(_e.createElement(Ye.default,Object.assign({ref:(0,be.sQ)(ct,zn),prefixCls:Gt,autoComplete:ft==null?void 0:ft.autoComplete},Hn,{disabled:ue,onBlur:hn,onFocus:sn,style:Object.assign(Object.assign({},ft==null?void 0:ft.style),er),styles:Object.assign(Object.assign({},ft==null?void 0:ft.styles),Sr),suffix:ln,allowClear:yr,className:Fe()(vn,qe,Pn,ft==null?void 0:ft.className),onChange:yn,addonAfter:xn&&_e.createElement(ze.BR,null,_e.createElement(gt.Ux,{override:!0,status:!0},xn)),addonBefore:jt&&_e.createElement(ze.BR,null,_e.createElement(gt.Ux,{override:!0,status:!0},jt)),classNames:Object.assign(Object.assign(Object.assign({},$t),ft==null?void 0:ft.classNames),{input:Fe()({[`${Gt}-sm`]:_n==="small",[`${Gt}-lg`]:_n==="large",[`${Gt}-rtl`]:at==="rtl",[`${Gt}-borderless`]:!Ve},!We&&(0,Le.Z)(Gt,le),$t==null?void 0:$t.input,(Ie=ft==null?void 0:ft.classNames)===null||Ie===void 0?void 0:Ie.input,nn)}),classes:{affixWrapper:Fe()({[`${Gt}-affix-wrapper-sm`]:_n==="small",[`${Gt}-affix-wrapper-lg`]:_n==="large",[`${Gt}-affix-wrapper-rtl`]:at==="rtl",[`${Gt}-affix-wrapper-borderless`]:!Ve},(0,Le.Z)(`${Gt}-affix-wrapper`,le,ye),nn),wrapper:Fe()({[`${Gt}-group-rtl`]:at==="rtl"},nn),group:Fe()({[`${Gt}-group-wrapper-sm`]:_n==="small",[`${Gt}-group-wrapper-lg`]:_n==="large",[`${Gt}-group-wrapper-rtl`]:at==="rtl",[`${Gt}-group-wrapper-disabled`]:ue},(0,Le.Z)(`${Gt}-group-wrapper`,le,ye),nn)}})))})},96330:function(Ln,qt,ce){"use strict";var fe=ce(16646),tt=ce(94184),Fe=ce.n(tt),Ye=ce(64701),be=ce(67294),_e=ce(9708),Le=ce(53124),Se=ce(98866),pe=ce(98675),Te=ce(65223),gt=ce(82586),ze=ce(47673),Pt=function(pt,Je){var De={};for(var Dt in pt)Object.prototype.hasOwnProperty.call(pt,Dt)&&Je.indexOf(Dt)<0&&(De[Dt]=pt[Dt]);if(pt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Yt=0,Dt=Object.getOwnPropertySymbols(pt);Yt<Dt.length;Yt++)Je.indexOf(Dt[Yt])<0&&Object.prototype.propertyIsEnumerable.call(pt,Dt[Yt])&&(De[Dt[Yt]]=pt[Dt[Yt]]);return De};const kt=(0,be.forwardRef)((pt,Je)=>{const{prefixCls:De,bordered:Dt=!0,size:Yt,disabled:nt,status:ct,allowClear:Ie,showCount:Me,classNames:Ve,rootClassName:Xe,className:Ct}=pt,wt=Pt(pt,["prefixCls","bordered","size","disabled","status","allowClear","showCount","classNames","rootClassName","className"]),{getPrefixCls:Mt,direction:je}=be.useContext(Le.E_),Rt=(0,pe.Z)(Yt),At=be.useContext(Se.Z),xn=nt!=null?nt:At,{status:jt,hasFeedback:vn,feedbackIcon:er}=be.useContext(Te.aM),Sr=(0,_e.F)(jt,ct),qe=be.useRef(null);be.useImperativeHandle(Je,()=>{var at;return{resizableTextArea:(at=qe.current)===null||at===void 0?void 0:at.resizableTextArea,focus:ft=>{var Gt,zn;(0,gt.n)((zn=(Gt=qe.current)===null||Gt===void 0?void 0:Gt.resizableTextArea)===null||zn===void 0?void 0:zn.textArea,ft)},blur:()=>{var ft;return(ft=qe.current)===null||ft===void 0?void 0:ft.blur()}}});const Ae=Mt("input",De);let $t;typeof Ie=="object"&&(Ie!=null&&Ie.clearIcon)?$t=Ie:Ie&&($t={clearIcon:be.createElement(fe.Z,null)});const[Hn,bn]=(0,ze.ZP)(Ae);return Hn(be.createElement(Ye.default,Object.assign({},wt,{disabled:xn,allowClear:$t,className:Fe()(Ct,Xe),classes:{affixWrapper:Fe()(`${Ae}-textarea-affix-wrapper`,{[`${Ae}-affix-wrapper-rtl`]:je==="rtl",[`${Ae}-affix-wrapper-borderless`]:!Dt,[`${Ae}-affix-wrapper-sm`]:Rt==="small",[`${Ae}-affix-wrapper-lg`]:Rt==="large",[`${Ae}-textarea-show-count`]:Me},(0,_e.Z)(`${Ae}-affix-wrapper`,Sr),bn)},classNames:Object.assign(Object.assign({},Ve),{textarea:Fe()({[`${Ae}-borderless`]:!Dt,[`${Ae}-sm`]:Rt==="small",[`${Ae}-lg`]:Rt==="large"},(0,_e.Z)(Ae,Sr),bn,Ve==null?void 0:Ve.textarea)}),prefixCls:Ae,suffix:vn&&be.createElement("span",{className:`${Ae}-textarea-suffix`},er),showCount:Me,ref:qe})))});qt.Z=kt},72922:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return tt}});var fe=ce(67294);function tt(Fe,Ye){const be=(0,fe.useRef)([]),_e=()=>{be.current.push(setTimeout(()=>{var Le,Se,pe,Te;!((Le=Fe.current)===null||Le===void 0)&&Le.input&&((Se=Fe.current)===null||Se===void 0?void 0:Se.input.getAttribute("type"))==="password"&&(!((pe=Fe.current)===null||pe===void 0)&&pe.input.hasAttribute("value"))&&((Te=Fe.current)===null||Te===void 0||Te.input.removeAttribute("value"))}))};return(0,fe.useEffect)(()=>(Ye&&_e(),()=>be.current.forEach(Le=>{Le&&clearTimeout(Le)})),[]),_e}},69677:function(Ln,qt,ce){"use strict";ce.d(qt,{default:function(){return Rt}});var fe=ce(94184),tt=ce.n(fe),Fe=ce(67294),Ye=ce(53124),be=ce(65223),_e=ce(47673),Se=At=>{const{getPrefixCls:xn,direction:jt}=(0,Fe.useContext)(Ye.E_),{prefixCls:vn,className:er}=At,Sr=xn("input-group",vn),qe=xn("input"),[Ae,$t]=(0,_e.ZP)(qe),Hn=tt()(Sr,{[`${Sr}-lg`]:At.size==="large",[`${Sr}-sm`]:At.size==="small",[`${Sr}-compact`]:At.compact,[`${Sr}-rtl`]:jt==="rtl"},$t,er),bn=(0,Fe.useContext)(be.aM),at=(0,Fe.useMemo)(()=>Object.assign(Object.assign({},bn),{isFormItemInput:!1}),[bn]);return Ae(Fe.createElement("span",{className:Hn,style:At.style,onMouseEnter:At.onMouseEnter,onMouseLeave:At.onMouseLeave,onFocus:At.onFocus,onBlur:At.onBlur},Fe.createElement(be.aM.Provider,{value:at},At.children)))},pe=ce(82586),Te=ce(63237),gt=ce(99569),ze=ce(10366),Pt=ce(17799),kt=ce(72922),pt=function(At,xn){var jt={};for(var vn in At)Object.prototype.hasOwnProperty.call(At,vn)&&xn.indexOf(vn)<0&&(jt[vn]=At[vn]);if(At!=null&&typeof Object.getOwnPropertySymbols=="function")for(var er=0,vn=Object.getOwnPropertySymbols(At);er<vn.length;er++)xn.indexOf(vn[er])<0&&Object.prototype.propertyIsEnumerable.call(At,vn[er])&&(jt[vn[er]]=At[vn[er]]);return jt};const Je=At=>At?Fe.createElement(gt.Z,null):Fe.createElement(Te.Z,null),De={click:"onClick",hover:"onMouseOver"};var Yt=Fe.forwardRef((At,xn)=>{const{visibilityToggle:jt=!0}=At,vn=typeof jt=="object"&&jt.visible!==void 0,[er,Sr]=(0,Fe.useState)(()=>vn?jt.visible:!1),qe=(0,Fe.useRef)(null);Fe.useEffect(()=>{vn&&Sr(jt.visible)},[vn,jt]);const Ae=(0,kt.Z)(qe),$t=()=>{const{disabled:ue}=At;ue||(er&&Ae(),Sr(se=>{var ye;const ve=!se;return typeof jt=="object"&&((ye=jt.onVisibleChange)===null||ye===void 0||ye.call(jt,ve)),ve}))},Hn=ue=>{const{action:se="click",iconRender:ye=Je}=At,ve=De[se]||"",le=ye(er),We={[ve]:$t,className:`${ue}-icon`,key:"passwordIcon",onMouseDown:Lt=>{Lt.preventDefault()},onMouseUp:Lt=>{Lt.preventDefault()}};return Fe.cloneElement(Fe.isValidElement(le)?le:Fe.createElement("span",null,le),We)},{className:bn,prefixCls:at,inputPrefixCls:ft,size:Gt}=At,zn=pt(At,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:mn}=Fe.useContext(Ye.E_),nn=mn("input",ft),Ft=mn("input-password",at),Pn=jt&&Hn(Ft),_n=tt()(Ft,bn,{[`${Ft}-${Gt}`]:!!Gt}),Ee=Object.assign(Object.assign({},(0,ze.Z)(zn,["suffix","iconRender","visibilityToggle"])),{type:er?"text":"password",className:_n,prefixCls:nn,suffix:Pn});return Gt&&(Ee.size=Gt),Fe.createElement(pe.Z,Object.assign({ref:(0,Pt.sQ)(xn,qe)},Ee))}),nt=ce(72395),ct=ce(96159),Ie=ce(71577),Me=ce(98675),Ve=ce(4173),Xe=function(At,xn){var jt={};for(var vn in At)Object.prototype.hasOwnProperty.call(At,vn)&&xn.indexOf(vn)<0&&(jt[vn]=At[vn]);if(At!=null&&typeof Object.getOwnPropertySymbols=="function")for(var er=0,vn=Object.getOwnPropertySymbols(At);er<vn.length;er++)xn.indexOf(vn[er])<0&&Object.prototype.propertyIsEnumerable.call(At,vn[er])&&(jt[vn[er]]=At[vn[er]]);return jt},wt=Fe.forwardRef((At,xn)=>{const{prefixCls:jt,inputPrefixCls:vn,className:er,size:Sr,suffix:qe,enterButton:Ae=!1,addonAfter:$t,loading:Hn,disabled:bn,onSearch:at,onChange:ft,onCompositionStart:Gt,onCompositionEnd:zn}=At,mn=Xe(At,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:nn,direction:Ft}=Fe.useContext(Ye.E_),Pn=Fe.useRef(!1),_n=nn("input-search",jt),Ee=nn("input",vn),{compactSize:ue}=(0,Ve.ri)(_n,Ft),se=(0,Me.Z)(Rn=>{var Gr;return(Gr=Sr!=null?Sr:ue)!==null&&Gr!==void 0?Gr:Rn}),ye=Fe.useRef(null),ve=Rn=>{Rn&&Rn.target&&Rn.type==="click"&&at&&at(Rn.target.value,Rn,{source:"clear"}),ft&&ft(Rn)},le=Rn=>{var Gr;document.activeElement===((Gr=ye.current)===null||Gr===void 0?void 0:Gr.input)&&Rn.preventDefault()},We=Rn=>{var Gr,li;at&&at((li=(Gr=ye.current)===null||Gr===void 0?void 0:Gr.input)===null||li===void 0?void 0:li.value,Rn,{source:"input"})},Lt=Rn=>{Pn.current||Hn||We(Rn)},tn=typeof Ae=="boolean"?Fe.createElement(nt.Z,null):null,hn=`${_n}-button`;let sn;const yn=Ae||{},ln=yn.type&&yn.type.__ANT_BUTTON===!0;ln||yn.type==="button"?sn=(0,ct.Tm)(yn,Object.assign({onMouseDown:le,onClick:Rn=>{var Gr,li;(li=(Gr=yn==null?void 0:yn.props)===null||Gr===void 0?void 0:Gr.onClick)===null||li===void 0||li.call(Gr,Rn),We(Rn)},key:"enterButton"},ln?{className:hn,size:se}:{})):sn=Fe.createElement(Ie.ZP,{className:hn,type:Ae?"primary":void 0,size:se,disabled:bn,key:"enterButton",onMouseDown:le,onClick:We,loading:Hn,icon:tn},Ae),$t&&(sn=[sn,(0,ct.Tm)($t,{key:"addonAfter"})]);const yr=tt()(_n,{[`${_n}-rtl`]:Ft==="rtl",[`${_n}-${se}`]:!!se,[`${_n}-with-button`]:!!Ae},er),Fr=Rn=>{Pn.current=!0,Gt==null||Gt(Rn)},Nt=Rn=>{Pn.current=!1,zn==null||zn(Rn)};return Fe.createElement(pe.Z,Object.assign({ref:(0,Pt.sQ)(ye,xn),onPressEnter:Lt},mn,{size:se,onCompositionStart:Fr,onCompositionEnd:Nt,prefixCls:Ee,addonAfter:sn,suffix:qe,onChange:ve,className:yr,disabled:bn}))}),Mt=ce(96330);const je=pe.Z;je.Group=Se,je.Search=wt,je.TextArea=Mt.Z,je.Password=Yt;var Rt=je},47673:function(Ln,qt,ce){"use strict";ce.d(qt,{M1:function(){return Le},TM:function(){return ct},Xy:function(){return Se},bi:function(){return gt},e5:function(){return nt},ik:function(){return ze},nz:function(){return be},pU:function(){return _e},s7:function(){return Pt},x0:function(){return Te}});var fe=ce(14747),tt=ce(80110),Fe=ce(45503),Ye=ce(67968);const be=Ie=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:Ie,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),_e=Ie=>({borderColor:Ie.hoverBorderColor}),Le=Ie=>({borderColor:Ie.activeBorderColor,boxShadow:Ie.activeShadow,outline:0}),Se=Ie=>({color:Ie.colorTextDisabled,backgroundColor:Ie.colorBgContainerDisabled,borderColor:Ie.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},_e((0,Fe.TS)(Ie,{hoverBorderColor:Ie.colorBorder})))}),pe=Ie=>{const{paddingBlockLG:Me,fontSizeLG:Ve,lineHeightLG:Xe,borderRadiusLG:Ct,paddingInlineLG:wt}=Ie;return{padding:`${Me}px ${wt}px`,fontSize:Ve,lineHeight:Xe,borderRadius:Ct}},Te=Ie=>({padding:`${Ie.paddingBlockSM}px ${Ie.paddingInlineSM}px`,borderRadius:Ie.borderRadiusSM}),gt=(Ie,Me)=>{const{componentCls:Ve,colorError:Xe,colorWarning:Ct,errorActiveShadow:wt,warningActiveShadow:Mt,colorErrorBorderHover:je,colorWarningBorderHover:Rt}=Ie;return{[`&-status-error:not(${Me}-disabled):not(${Me}-borderless)${Me}`]:{borderColor:Xe,"&:hover":{borderColor:je},"&:focus, &-focused":Object.assign({},Le((0,Fe.TS)(Ie,{activeBorderColor:Xe,activeShadow:wt}))),[`${Ve}-prefix, ${Ve}-suffix`]:{color:Xe}},[`&-status-warning:not(${Me}-disabled):not(${Me}-borderless)${Me}`]:{borderColor:Ct,"&:hover":{borderColor:Rt},"&:focus, &-focused":Object.assign({},Le((0,Fe.TS)(Ie,{activeBorderColor:Ct,activeShadow:Mt}))),[`${Ve}-prefix, ${Ve}-suffix`]:{color:Ct}}}},ze=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}`},be(Ie.colorTextPlaceholder)),{"&:hover":Object.assign({},_e(Ie)),"&:focus, &-focused":Object.assign({},Le(Ie)),"&-disabled, &[disabled]":Object.assign({},Se(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({},pe(Ie)),"&-sm":Object.assign({},Te(Ie)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),Pt=Ie=>{const{componentCls:Me,antCls:Ve}=Ie;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:Ie.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${Me}, &-lg > ${Me}-group-addon`]:Object.assign({},pe(Ie)),[`&-sm ${Me}, &-sm > ${Me}-group-addon`]:Object.assign({},Te(Ie)),[`&-lg ${Ve}-select-single ${Ve}-select-selector`]:{height:Ie.controlHeightLG},[`&-sm ${Ve}-select-single ${Ve}-select-selector`]:{height:Ie.controlHeightSM},[`> ${Me}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${Me}-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,[`${Ve}-select`]:{margin:`-${Ie.paddingBlock+1}px -${Ie.paddingInline}px`,[`&${Ve}-select-single:not(${Ve}-select-customize-input)`]:{[`${Ve}-select-selector`]:{backgroundColor:"inherit",border:`${Ie.lineWidth}px ${Ie.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${Ve}-select-selector`]:{color:Ie.colorPrimary}}},[`${Ve}-cascader-picker`]:{margin:`-9px -${Ie.paddingInline}px`,backgroundColor:"transparent",[`${Ve}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${Me}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${Me}-search-with-button &`]:{zIndex:0}}},[`> ${Me}:first-child, ${Me}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${Ve}-select ${Ve}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${Me}-affix-wrapper`]:{[`&:not(:first-child) ${Me}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${Me}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${Me}:last-child, ${Me}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${Ve}-select ${Ve}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${Me}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${Me}-search &`]:{borderStartStartRadius:Ie.borderRadius,borderEndStartRadius:Ie.borderRadius}},[`&:not(:first-child), ${Me}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${Me}-group-compact`]:Object.assign(Object.assign({display:"block"},(0,fe.dF)()),{[`${Me}-group-addon, ${Me}-group-wrap, > ${Me}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:Ie.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`
& > ${Me}-affix-wrapper,
& > ${Me}-number-affix-wrapper,
& > ${Ve}-picker-range
`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-Ie.lineWidth,borderInlineEndWidth:Ie.lineWidth},[`${Me}`]:{float:"none"},[`& > ${Ve}-select > ${Ve}-select-selector,
& > ${Ve}-select-auto-complete ${Me},
& > ${Ve}-cascader-picker ${Me},
& > ${Me}-group-wrapper ${Me}`]:{borderInlineEndWidth:Ie.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${Ve}-select-focused`]:{zIndex:1},[`& > ${Ve}-select > ${Ve}-select-arrow`]:{zIndex:1},[`& > *:first-child,
& > ${Ve}-select:first-child > ${Ve}-select-selector,
& > ${Ve}-select-auto-complete:first-child ${Me},
& > ${Ve}-cascader-picker:first-child ${Me}`]:{borderStartStartRadius:Ie.borderRadius,borderEndStartRadius:Ie.borderRadius},[`& > *:last-child,
& > ${Ve}-select:last-child > ${Ve}-select-selector,
& > ${Ve}-cascader-picker:last-child ${Me},
& > ${Ve}-cascader-picker-focused:last-child ${Me}`]:{borderInlineEndWidth:Ie.lineWidth,borderStartEndRadius:Ie.borderRadius,borderEndEndRadius:Ie.borderRadius},[`& > ${Ve}-select-auto-complete ${Me}`]:{verticalAlign:"top"},[`${Me}-group-wrapper + ${Me}-group-wrapper`]:{marginInlineStart:-Ie.lineWidth,[`${Me}-affix-wrapper`]:{borderRadius:0}},[`${Me}-group-wrapper:not(:last-child)`]:{[`&${Me}-search > ${Me}-group`]:{[`& > ${Me}-group-addon > ${Me}-search-button`]:{borderRadius:0},[`& > ${Me}`]:{borderStartStartRadius:Ie.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:Ie.borderRadius}}}})}},kt=Ie=>{const{componentCls:Me,controlHeightSM:Ve,lineWidth:Xe}=Ie,wt=(Ve-Xe*2-16)/2;return{[Me]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,fe.Wf)(Ie)),ze(Ie)),gt(Ie,Me)),{'&[type="color"]':{height:Ie.controlHeight,[`&${Me}-lg`]:{height:Ie.controlHeightLG},[`&${Me}-sm`]:{height:Ve,paddingTop:wt,paddingBottom:wt}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},pt=Ie=>{const{componentCls:Me}=Ie;return{[`${Me}-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`}}}},Je=Ie=>{const{componentCls:Me,inputAffixPadding:Ve,colorTextDescription:Xe,motionDurationSlow:Ct,colorIcon:wt,colorIconHover:Mt,iconCls:je}=Ie;return{[`${Me}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},ze(Ie)),{display:"inline-flex",[`&:not(${Me}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},_e(Ie)),{zIndex:1,[`${Me}-search-with-button &`]:{zIndex:0}}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${Me}[disabled]`]:{background:"transparent"}},[`> input${Me}`]:{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"'},[`${Me}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:Ie.paddingXS}},"&-show-count-suffix":{color:Xe},"&-show-count-has-suffix":{marginInlineEnd:Ie.paddingXXS},"&-prefix":{marginInlineEnd:Ve},"&-suffix":{marginInlineStart:Ve}}}),pt(Ie)),{[`${je}${Me}-password-icon`]:{color:wt,cursor:"pointer",transition:`all ${Ct}`,"&:hover":{color:Mt}}}),gt(Ie,`${Me}-affix-wrapper`))}},De=Ie=>{const{componentCls:Me,colorError:Ve,colorWarning:Xe,borderRadiusLG:Ct,borderRadiusSM:wt}=Ie;return{[`${Me}-group`]:Object.assign(Object.assign(Object.assign({},(0,fe.Wf)(Ie)),Pt(Ie)),{"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${Me}-group-addon`]:{borderRadius:Ct,fontSize:Ie.fontSizeLG}},"&-sm":{[`${Me}-group-addon`]:{borderRadius:wt}},"&-status-error":{[`${Me}-group-addon`]:{color:Ve,borderColor:Ve}},"&-status-warning":{[`${Me}-group-addon`]:{color:Xe,borderColor:Xe}},"&-disabled":{[`${Me}-group-addon`]:Object.assign({},Se(Ie))},[`&:not(${Me}-compact-first-item):not(${Me}-compact-last-item)${Me}-compact-item`]:{[`${Me}, ${Me}-group-addon`]:{borderRadius:0}},[`&:not(${Me}-compact-last-item)${Me}-compact-first-item`]:{[`${Me}, ${Me}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${Me}-compact-first-item)${Me}-compact-last-item`]:{[`${Me}, ${Me}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}})}},Dt=Ie=>{const{componentCls:Me,antCls:Ve}=Ie,Xe=`${Me}-search`;return{[Xe]:{[`${Me}`]:{"&:hover, &:focus":{borderColor:Ie.colorPrimaryHover,[`+ ${Me}-group-addon ${Xe}-button:not(${Ve}-btn-primary)`]:{borderInlineStartColor:Ie.colorPrimaryHover}}},[`${Me}-affix-wrapper`]:{borderRadius:0},[`${Me}-lg`]:{lineHeight:Ie.lineHeightLG-2e-4},[`> ${Me}-group`]:{[`> ${Me}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${Xe}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:Ie.borderRadius,borderEndEndRadius:Ie.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${Xe}-button:not(${Ve}-btn-primary)`]:{color:Ie.colorTextDescription,"&:hover":{color:Ie.colorPrimaryHover},"&:active":{color:Ie.colorPrimaryActive},[`&${Ve}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${Xe}-button`]:{height:Ie.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${Xe}-button`]:{height:Ie.controlHeightLG},[`&-small ${Xe}-button`]:{height:Ie.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${Me}-compact-item`]:{[`&:not(${Me}-compact-last-item)`]:{[`${Me}-group-addon`]:{[`${Me}-search-button`]:{marginInlineEnd:-Ie.lineWidth,borderRadius:0}}},[`&:not(${Me}-compact-first-item)`]:{[`${Me},${Me}-affix-wrapper`]:{borderRadius:0}},[`> ${Me}-group-addon ${Me}-search-button,
> ${Me},
${Me}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${Me}-affix-wrapper-focused`]:{zIndex:2}}}}},Yt=Ie=>{const{componentCls:Me,paddingLG:Ve}=Ie,Xe=`${Me}-textarea`;return{[Xe]:{position:"relative","&-show-count":{[`> ${Me}`]:{height:"100%"},[`${Me}-data-count`]:{position:"absolute",bottom:-Ie.fontSize*Ie.lineHeight,insetInlineEnd:0,color:Ie.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${Me}`]:{paddingInlineEnd:Ve}},[`&-affix-wrapper${Xe}-has-feedback`]:{[`${Me}`]:{paddingInlineEnd:Ve}},[`&-affix-wrapper${Me}-affix-wrapper`]:{padding:0,[`> textarea${Me}`]:{fontSize:"inherit",border:"none",outline:"none","&:focus":{boxShadow:"none !important"}},[`${Me}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${Me}-clear-icon`]:{position:"absolute",insetInlineEnd:Ie.paddingXS,insetBlockStart:Ie.paddingXS},[`${Xe}-suffix`]:{position:"absolute",top:0,insetInlineEnd:Ie.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}};function nt(Ie){return(0,Fe.TS)(Ie,{inputAffixPadding:Ie.paddingXXS})}const ct=Ie=>{const{controlHeight:Me,fontSize:Ve,lineHeight:Xe,lineWidth:Ct,controlHeightSM:wt,controlHeightLG:Mt,fontSizeLG:je,lineHeightLG:Rt,paddingSM:At,controlPaddingHorizontalSM:xn,controlPaddingHorizontal:jt,colorFillAlter:vn,colorPrimaryHover:er,controlOutlineWidth:Sr,controlOutline:qe,colorErrorOutline:Ae,colorWarningOutline:$t}=Ie;return{paddingBlock:Math.max(Math.round((Me-Ve*Xe)/2*10)/10-Ct,3),paddingBlockSM:Math.max(Math.round((wt-Ve*Xe)/2*10)/10-Ct,0),paddingBlockLG:Math.ceil((Mt-je*Rt)/2*10)/10-Ct,paddingInline:At-Ct,paddingInlineSM:xn-Ct,paddingInlineLG:jt-Ct,addonBg:vn,activeBorderColor:er,hoverBorderColor:er,activeShadow:`0 0 0 ${Sr}px ${qe}`,errorActiveShadow:`0 0 0 ${Sr}px ${Ae}`,warningActiveShadow:`0 0 0 ${Sr}px ${$t}`}};qt.ZP=(0,Ye.Z)("Input",Ie=>{const Me=(0,Fe.TS)(Ie,nt(Ie));return[kt(Me),Yt(Me),Je(Me),De(Me),Dt(Me),(0,tt.c)(Me)]},ct)},38703:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return li}});var fe=ce(67294),tt=ce(87725),Fe=ce(18299),Ye=ce(16646),be=ce(73475),_e=ce(94184),Le=ce.n(_e),Se=ce(10366),pe=ce(53124),Te=ce(87462),gt=ce(1413),ze=ce(45987),Pt={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},kt=function(){var Wt=(0,fe.useRef)([]),Vn=(0,fe.useRef)(null);return(0,fe.useEffect)(function(){var ir=Date.now(),gr=!1;Wt.current.forEach(function(Pr){if(Pr){gr=!0;var Ur=Pr.style;Ur.transitionDuration=".3s, .3s, .3s, .06s",Vn.current&&ir-Vn.current<100&&(Ur.transitionDuration="0s, 0s")}}),gr&&(Vn.current=Date.now())}),Wt.current},pt=["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"],Je=function(Wt){var Vn=(0,gt.Z)((0,gt.Z)({},Pt),Wt),ir=Vn.className,gr=Vn.percent,Pr=Vn.prefixCls,Ur=Vn.strokeColor,Xr=Vn.strokeLinecap,qr=Vn.strokeWidth,ui=Vn.style,br=Vn.trailColor,Ei=Vn.trailWidth,sa=Vn.transition,Ji=(0,ze.Z)(Vn,pt);delete Ji.gapPosition;var Qi=Array.isArray(gr)?gr:[gr],Ci=Array.isArray(Ur)?Ur:[Ur],mt=kt(),Mn=qr/2,En=100-qr/2,An="M ".concat(Xr==="round"?Mn:0,",").concat(Mn,`
L `).concat(Xr==="round"?En:100,",").concat(Mn),sr="0 0 100 ".concat(qr),nr=0;return fe.createElement("svg",(0,Te.Z)({className:Le()("".concat(Pr,"-line"),ir),viewBox:sr,preserveAspectRatio:"none",style:ui},Ji),fe.createElement("path",{className:"".concat(Pr,"-line-trail"),d:An,strokeLinecap:Xr,stroke:br,strokeWidth:Ei||qr,fillOpacity:"0"}),Qi.map(function(pr,Kn){var Ue=1;switch(Xr){case"round":Ue=1-qr/100;break;case"square":Ue=1-qr/2/100;break;default:Ue=1;break}var it={strokeDasharray:"".concat(pr*Ue,"px, 100px"),strokeDashoffset:"-".concat(nr,"px"),transition:sa||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},_t=Ci[Kn]||Ci[Ci.length-1];return nr+=pr,fe.createElement("path",{key:Kn,className:"".concat(Pr,"-line-path"),d:An,strokeLinecap:Xr,stroke:_t,strokeWidth:qr,fillOpacity:"0",ref:function(Ke){mt[Kn]=Ke},style:it})}))},De=Je,Dt=ce(71002),Yt=ce(97685),nt=ce(98924),ct=0,Ie=(0,nt.Z)();function Me(){var st;return Ie?(st=ct,ct+=1):st="TEST_OR_SSR",st}var Ve=function(st){var Wt=fe.useState(),Vn=(0,Yt.Z)(Wt,2),ir=Vn[0],gr=Vn[1];return fe.useEffect(function(){gr("rc_progress_".concat(Me()))},[]),st||ir},Xe=function(Wt){var Vn=Wt.bg,ir=Wt.children;return fe.createElement("div",{style:{width:"100%",height:"100%",background:Vn}},ir)};function Ct(st,Wt){return Object.keys(st).map(function(Vn){var ir=parseFloat(Vn),gr="".concat(Math.floor(ir*Wt),"%");return"".concat(st[Vn]," ").concat(gr)})}var wt=fe.forwardRef(function(st,Wt){var Vn=st.prefixCls,ir=st.color,gr=st.gradientId,Pr=st.radius,Ur=st.style,Xr=st.ptg,qr=st.strokeLinecap,ui=st.strokeWidth,br=st.size,Ei=st.gapDegree,sa=ir&&(0,Dt.Z)(ir)==="object",Ji=sa?"#FFF":void 0,Qi=br/2,Ci=fe.createElement("circle",{className:"".concat(Vn,"-circle-path"),r:Pr,cx:Qi,cy:Qi,stroke:Ji,strokeLinecap:qr,strokeWidth:ui,opacity:Xr===0?0:1,style:Ur,ref:Wt});if(!sa)return Ci;var mt="".concat(gr,"-conic"),Mn=Ei?"".concat(180+Ei/2,"deg"):"0deg",En=Ct(ir,(360-Ei)/360),An=Ct(ir,1),sr="conic-gradient(from ".concat(Mn,", ").concat(En.join(", "),")"),nr="linear-gradient(to ".concat(Ei?"bottom":"top",", ").concat(An.join(", "),")");return fe.createElement(fe.Fragment,null,fe.createElement("mask",{id:mt},Ci),fe.createElement("foreignObject",{x:0,y:0,width:br,height:br,mask:"url(#".concat(mt,")")},fe.createElement(Xe,{bg:nr},fe.createElement(Xe,{bg:sr}))))}),Mt=wt,je=100,Rt=function(Wt,Vn,ir,gr,Pr,Ur,Xr,qr,ui,br){var Ei=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,sa=ir/100*360*((360-Ur)/360),Ji=Ur===0?0:{bottom:0,top:180,left:90,right:-90}[Xr],Qi=(100-gr)/100*Vn;ui==="round"&&gr!==100&&(Qi+=br/2,Qi>=Vn&&(Qi=Vn-.01));var Ci=je/2;return{stroke:typeof qr=="string"?qr:void 0,strokeDasharray:"".concat(Vn,"px ").concat(Wt),strokeDashoffset:Qi+Ei,transform:"rotate(".concat(Pr+sa+Ji,"deg)"),transformOrigin:"".concat(Ci,"px ").concat(Ci,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},At=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function xn(st){var Wt=st!=null?st:[];return Array.isArray(Wt)?Wt:[Wt]}var jt=function(Wt){var Vn=(0,gt.Z)((0,gt.Z)({},Pt),Wt),ir=Vn.id,gr=Vn.prefixCls,Pr=Vn.steps,Ur=Vn.strokeWidth,Xr=Vn.trailWidth,qr=Vn.gapDegree,ui=qr===void 0?0:qr,br=Vn.gapPosition,Ei=Vn.trailColor,sa=Vn.strokeLinecap,Ji=Vn.style,Qi=Vn.className,Ci=Vn.strokeColor,mt=Vn.percent,Mn=(0,ze.Z)(Vn,At),En=je/2,An=Ve(ir),sr="".concat(An,"-gradient"),nr=En-Ur/2,pr=Math.PI*2*nr,Kn=ui>0?90+ui/2:-90,Ue=pr*((360-ui)/360),it=(0,Dt.Z)(Pr)==="object"?Pr:{count:Pr,space:2},_t=it.count,Ut=it.space,Ke=xn(mt),ut=xn(Ci),Ot=ut.find(function(qn){return qn&&(0,Dt.Z)(qn)==="object"}),Tt=Ot&&(0,Dt.Z)(Ot)==="object",zt=Tt?"butt":sa,Ht=Rt(pr,Ue,0,100,Kn,ui,br,Ei,zt,Ur),$n=kt(),Cr=function(){var rr=0;return Ke.map(function(ar,ot){var Qe=ut[ot]||ut[ut.length-1],vt=Rt(pr,Ue,rr,ar,Kn,ui,br,Qe,zt,Ur);return rr+=ar,fe.createElement(Mt,{key:ot,color:Qe,ptg:ar,radius:nr,prefixCls:gr,gradientId:sr,style:vt,strokeLinecap:zt,strokeWidth:Ur,gapDegree:ui,ref:function(Tn){$n[ot]=Tn},size:je})}).reverse()},Yn=function(){var rr=Math.round(_t*(Ke[0]/100)),ar=100/_t,ot=0;return new Array(_t).fill(null).map(function(Qe,vt){var Qt=vt<=rr-1?ut[0]:Ei,Tn=Qt&&(0,Dt.Z)(Qt)==="object"?"url(#".concat(sr,")"):void 0,en=Rt(pr,Ue,ot,ar,Kn,ui,br,Qt,"butt",Ur,Ut);return ot+=(Ue-en.strokeDashoffset+Ut)*100/Ue,fe.createElement("circle",{key:vt,className:"".concat(gr,"-circle-path"),r:nr,cx:En,cy:En,stroke:Tn,strokeWidth:Ur,opacity:1,style:en,ref:function(un){$n[vt]=un}})})};return fe.createElement("svg",(0,Te.Z)({className:Le()("".concat(gr,"-circle"),Qi),viewBox:"0 0 ".concat(je," ").concat(je),style:Ji,id:ir,role:"presentation"},Mn),!_t&&fe.createElement("circle",{className:"".concat(gr,"-circle-trail"),r:nr,cx:En,cy:En,stroke:Ei,strokeLinecap:zt,strokeWidth:Xr||Ur,style:Ht}),_t?Yn():Cr())},vn=jt,er={Line:De,Circle:vn},Sr=ce(83062),qe=ce(47448);function Ae(st){return!st||st<0?0:st>100?100:st}function $t(st){let{success:Wt,successPercent:Vn}=st,ir=Vn;return Wt&&"progress"in Wt&&(ir=Wt.progress),Wt&&"percent"in Wt&&(ir=Wt.percent),ir}const Hn=st=>{let{percent:Wt,success:Vn,successPercent:ir}=st;const gr=Ae($t({success:Vn,successPercent:ir}));return[gr,Ae(Ae(Wt)-gr)]},bn=st=>{let{success:Wt={},strokeColor:Vn}=st;const{strokeColor:ir}=Wt;return[ir||qe.presetPrimaryColors.green,Vn||null]},at=(st,Wt,Vn)=>{var ir,gr,Pr,Ur;let Xr=-1,qr=-1;if(Wt==="step"){const ui=Vn.steps,br=Vn.strokeWidth;typeof st=="string"||typeof st=="undefined"?(Xr=st==="small"?2:14,qr=br!=null?br:8):typeof st=="number"?[Xr,qr]=[st,st]:[Xr=14,qr=8]=st,Xr*=ui}else if(Wt==="line"){const ui=Vn==null?void 0:Vn.strokeWidth;typeof st=="string"||typeof st=="undefined"?qr=ui||(st==="small"?6:8):typeof st=="number"?[Xr,qr]=[st,st]:[Xr=-1,qr=8]=st}else(Wt==="circle"||Wt==="dashboard")&&(typeof st=="string"||typeof st=="undefined"?[Xr,qr]=st==="small"?[60,60]:[120,120]:typeof st=="number"?[Xr,qr]=[st,st]:(Xr=(gr=(ir=st[0])!==null&&ir!==void 0?ir:st[1])!==null&&gr!==void 0?gr:120,qr=(Ur=(Pr=st[0])!==null&&Pr!==void 0?Pr:st[1])!==null&&Ur!==void 0?Ur:120));return[Xr,qr]},ft=3,Gt=st=>ft/st*100;var mn=st=>{const{prefixCls:Wt,trailColor:Vn=null,strokeLinecap:ir="round",gapPosition:gr,gapDegree:Pr,width:Ur=120,type:Xr,children:qr,success:ui,size:br=Ur}=st,[Ei,sa]=at(br,"circle");let{strokeWidth:Ji}=st;Ji===void 0&&(Ji=Math.max(Gt(Ei),6));const Qi={width:Ei,height:sa,fontSize:Ei*.15+6},Ci=fe.useMemo(()=>{if(Pr||Pr===0)return Pr;if(Xr==="dashboard")return 75},[Pr,Xr]),mt=gr||Xr==="dashboard"&&"bottom"||void 0,Mn=Object.prototype.toString.call(st.strokeColor)==="[object Object]",En=bn({success:ui,strokeColor:st.strokeColor}),An=Le()(`${Wt}-inner`,{[`${Wt}-circle-gradient`]:Mn}),sr=fe.createElement(vn,{percent:Hn(st),strokeWidth:Ji,trailWidth:Ji,strokeColor:En,strokeLinecap:ir,trailColor:Vn,prefixCls:Wt,gapDegree:Ci,gapPosition:mt});return fe.createElement("div",{className:An,style:Qi},Ei<=20?fe.createElement(Sr.Z,{title:qr},fe.createElement("span",null,sr)):fe.createElement(fe.Fragment,null,sr,qr))},nn=function(st,Wt){var Vn={};for(var ir in st)Object.prototype.hasOwnProperty.call(st,ir)&&Wt.indexOf(ir)<0&&(Vn[ir]=st[ir]);if(st!=null&&typeof Object.getOwnPropertySymbols=="function")for(var gr=0,ir=Object.getOwnPropertySymbols(st);gr<ir.length;gr++)Wt.indexOf(ir[gr])<0&&Object.prototype.propertyIsEnumerable.call(st,ir[gr])&&(Vn[ir[gr]]=st[ir[gr]]);return Vn};const Ft=st=>{let Wt=[];return Object.keys(st).forEach(Vn=>{const ir=parseFloat(Vn.replace(/%/g,""));isNaN(ir)||Wt.push({key:ir,value:st[Vn]})}),Wt=Wt.sort((Vn,ir)=>Vn.key-ir.key),Wt.map(Vn=>{let{key:ir,value:gr}=Vn;return`${gr} ${ir}%`}).join(", ")},Pn=(st,Wt)=>{const{from:Vn=qe.presetPrimaryColors.blue,to:ir=qe.presetPrimaryColors.blue,direction:gr=Wt==="rtl"?"to left":"to right"}=st,Pr=nn(st,["from","to","direction"]);if(Object.keys(Pr).length!==0){const Ur=Ft(Pr);return{backgroundImage:`linear-gradient(${gr}, ${Ur})`}}return{backgroundImage:`linear-gradient(${gr}, ${Vn}, ${ir})`}};var Ee=st=>{const{prefixCls:Wt,direction:Vn,percent:ir,size:gr,strokeWidth:Pr,strokeColor:Ur,strokeLinecap:Xr="round",children:qr,trailColor:ui=null,success:br}=st,Ei=Ur&&typeof Ur!="string"?Pn(Ur,Vn):{backgroundColor:Ur},sa=Xr==="square"||Xr==="butt"?0:void 0,Ji={backgroundColor:ui||void 0,borderRadius:sa},Qi=gr!=null?gr:[-1,Pr||(gr==="small"?6:8)],[Ci,mt]=at(Qi,"line",{strokeWidth:Pr}),Mn=Object.assign({width:`${Ae(ir)}%`,height:mt,borderRadius:sa},Ei),En=$t(st),An={width:`${Ae(En)}%`,height:mt,borderRadius:sa,backgroundColor:br==null?void 0:br.strokeColor},sr={width:Ci<0?"100%":Ci,height:mt};return fe.createElement(fe.Fragment,null,fe.createElement("div",{className:`${Wt}-outer`,style:sr},fe.createElement("div",{className:`${Wt}-inner`,style:Ji},fe.createElement("div",{className:`${Wt}-bg`,style:Mn}),En!==void 0?fe.createElement("div",{className:`${Wt}-success-bg`,style:An}):null)),qr)},se=st=>{const{size:Wt,steps:Vn,percent:ir=0,strokeWidth:gr=8,strokeColor:Pr,trailColor:Ur=null,prefixCls:Xr,children:qr}=st,ui=Math.round(Vn*(ir/100)),br=Wt==="small"?2:14,Ei=Wt!=null?Wt:[br,gr],[sa,Ji]=at(Ei,"step",{steps:Vn,strokeWidth:gr}),Qi=sa/Vn,Ci=new Array(Vn);for(let mt=0;mt<Vn;mt++){const Mn=Array.isArray(Pr)?Pr[mt]:Pr;Ci[mt]=fe.createElement("div",{key:mt,className:Le()(`${Xr}-steps-item`,{[`${Xr}-steps-item-active`]:mt<=ui-1}),style:{backgroundColor:mt<=ui-1?Mn:Ur,width:Qi,height:Ji}})}return fe.createElement("div",{className:`${Xr}-steps-outer`},Ci,qr)},ye=ce(45930),ve=ce(14747),le=ce(67968),We=ce(45503);const Lt=st=>{const Wt=st?"100%":"-100%";return new ye.Keyframes(`antProgress${st?"RTL":"LTR"}Active`,{"0%":{transform:`translateX(${Wt}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${Wt}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},tn=st=>{const{componentCls:Wt,iconCls:Vn}=st;return{[Wt]:Object.assign(Object.assign({},(0,ve.Wf)(st)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:st.fontSize,marginInlineEnd:st.marginXS,marginBottom:st.marginXS},[`${Wt}-outer`]:{display:"inline-block",width:"100%"},[`&${Wt}-show-info`]:{[`${Wt}-outer`]:{marginInlineEnd:`calc(-2em - ${st.marginXS}px)`,paddingInlineEnd:`calc(2em + ${st.paddingXS}px)`}},[`${Wt}-inner`]:{position:"relative",display:"inline-block",width:"100%",overflow:"hidden",verticalAlign:"middle",backgroundColor:st.remainingColor,borderRadius:st.lineBorderRadius},[`${Wt}-inner:not(${Wt}-circle-gradient)`]:{[`${Wt}-circle-path`]:{stroke:st.defaultColor}},[`${Wt}-success-bg, ${Wt}-bg`]:{position:"relative",backgroundColor:st.defaultColor,borderRadius:st.lineBorderRadius,transition:`all ${st.motionDurationSlow} ${st.motionEaseInOutCirc}`},[`${Wt}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:st.colorSuccess},[`${Wt}-text`]:{display:"inline-block",width:"2em",marginInlineStart:st.marginXS,color:st.colorText,lineHeight:1,whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[Vn]:{fontSize:st.fontSize}},[`&${Wt}-status-active`]:{[`${Wt}-bg::before`]:{position:"absolute",inset:0,backgroundColor:st.colorBgContainer,borderRadius:st.lineBorderRadius,opacity:0,animationName:Lt(),animationDuration:st.progressActiveMotionDuration,animationTimingFunction:st.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${Wt}-rtl${Wt}-status-active`]:{[`${Wt}-bg::before`]:{animationName:Lt(!0)}},[`&${Wt}-status-exception`]:{[`${Wt}-bg`]:{backgroundColor:st.colorError},[`${Wt}-text`]:{color:st.colorError}},[`&${Wt}-status-exception ${Wt}-inner:not(${Wt}-circle-gradient)`]:{[`${Wt}-circle-path`]:{stroke:st.colorError}},[`&${Wt}-status-success`]:{[`${Wt}-bg`]:{backgroundColor:st.colorSuccess},[`${Wt}-text`]:{color:st.colorSuccess}},[`&${Wt}-status-success ${Wt}-inner:not(${Wt}-circle-gradient)`]:{[`${Wt}-circle-path`]:{stroke:st.colorSuccess}}})}},hn=st=>{const{componentCls:Wt,iconCls:Vn}=st;return{[Wt]:{[`${Wt}-circle-trail`]:{stroke:st.remainingColor},[`&${Wt}-circle ${Wt}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${Wt}-circle ${Wt}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:st.circleTextColor,fontSize:st.circleTextFontSize,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[Vn]:{fontSize:`${st.fontSize/st.fontSizeSM}em`}},[`${Wt}-circle&-status-exception`]:{[`${Wt}-text`]:{color:st.colorError}},[`${Wt}-circle&-status-success`]:{[`${Wt}-text`]:{color:st.colorSuccess}}},[`${Wt}-inline-circle`]:{lineHeight:1,[`${Wt}-inner`]:{verticalAlign:"bottom"}}}},sn=st=>{const{componentCls:Wt}=st;return{[Wt]:{[`${Wt}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:st.progressStepMinWidth,marginInlineEnd:st.progressStepMarginInlineEnd,backgroundColor:st.remainingColor,transition:`all ${st.motionDurationSlow}`,"&-active":{backgroundColor:st.defaultColor}}}}}},yn=st=>{const{componentCls:Wt,iconCls:Vn}=st;return{[Wt]:{[`${Wt}-small&-line, ${Wt}-small&-line ${Wt}-text ${Vn}`]:{fontSize:st.fontSizeSM}}}};var ln=(0,le.Z)("Progress",st=>{const Wt=st.marginXXS/2,Vn=(0,We.TS)(st,{progressStepMarginInlineEnd:Wt,progressStepMinWidth:Wt,progressActiveMotionDuration:"2.4s"});return[tn(Vn),hn(Vn),sn(Vn),yn(Vn)]},st=>({circleTextColor:st.colorText,defaultColor:st.colorInfo,remainingColor:st.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em"})),yr=function(st,Wt){var Vn={};for(var ir in st)Object.prototype.hasOwnProperty.call(st,ir)&&Wt.indexOf(ir)<0&&(Vn[ir]=st[ir]);if(st!=null&&typeof Object.getOwnPropertySymbols=="function")for(var gr=0,ir=Object.getOwnPropertySymbols(st);gr<ir.length;gr++)Wt.indexOf(ir[gr])<0&&Object.prototype.propertyIsEnumerable.call(st,ir[gr])&&(Vn[ir[gr]]=st[ir[gr]]);return Vn};const Fr=null,Nt=["normal","exception","active","success"];var Gr=fe.forwardRef((st,Wt)=>{const{prefixCls:Vn,className:ir,rootClassName:gr,steps:Pr,strokeColor:Ur,percent:Xr=0,size:qr="default",showInfo:ui=!0,type:br="line",status:Ei,format:sa,style:Ji}=st,Qi=yr(st,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style"]),Ci=fe.useMemo(()=>{var Ke,ut;const Ot=$t(st);return parseInt(Ot!==void 0?(Ke=Ot!=null?Ot:0)===null||Ke===void 0?void 0:Ke.toString():(ut=Xr!=null?Xr:0)===null||ut===void 0?void 0:ut.toString(),10)},[Xr,st.success,st.successPercent]),mt=fe.useMemo(()=>!Nt.includes(Ei)&&Ci>=100?"success":Ei||"normal",[Ei,Ci]),{getPrefixCls:Mn,direction:En,progress:An}=fe.useContext(pe.E_),sr=Mn("progress",Vn),[nr,pr]=ln(sr),Kn=fe.useMemo(()=>{if(!ui)return null;const Ke=$t(st);let ut;const Ot=sa||(zt=>`${zt}%`),Tt=br==="line";return sa||mt!=="exception"&&mt!=="success"?ut=Ot(Ae(Xr),Ae(Ke)):mt==="exception"?ut=Tt?fe.createElement(Ye.Z,null):fe.createElement(be.Z,null):mt==="success"&&(ut=Tt?fe.createElement(tt.Z,null):fe.createElement(Fe.Z,null)),fe.createElement("span",{className:`${sr}-text`,title:typeof ut=="string"?ut:void 0},ut)},[ui,Xr,Ci,mt,br,sr,sa]),Ue=Array.isArray(Ur)?Ur[0]:Ur,it=typeof Ur=="string"||Array.isArray(Ur)?Ur:void 0;let _t;br==="line"?_t=Pr?fe.createElement(se,Object.assign({},st,{strokeColor:it,prefixCls:sr,steps:Pr}),Kn):fe.createElement(Ee,Object.assign({},st,{strokeColor:Ue,prefixCls:sr,direction:En}),Kn):(br==="circle"||br==="dashboard")&&(_t=fe.createElement(mn,Object.assign({},st,{strokeColor:Ue,prefixCls:sr,progressStatus:mt}),Kn));const Ut=Le()(sr,`${sr}-status-${mt}`,`${sr}-${br==="dashboard"&&"circle"||Pr&&"steps"||br}`,{[`${sr}-inline-circle`]:br==="circle"&&at(qr,"circle")[0]<=20,[`${sr}-show-info`]:ui,[`${sr}-${qr}`]:typeof qr=="string",[`${sr}-rtl`]:En==="rtl"},An==null?void 0:An.className,ir,gr,pr);return nr(fe.createElement("div",Object.assign({ref:Wt,style:Object.assign(Object.assign({},An==null?void 0:An.style),Ji),className:Ut,role:"progressbar","aria-valuenow":Ci},(0,Se.Z)(Qi,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),_t))}),li=Gr},78045:function(Ln,qt,ce){"use strict";ce.d(qt,{ZP:function(){return qe}});var fe=ce(94184),tt=ce.n(fe),Fe=ce(5663),Ye=ce(1337),be=ce(67294),_e=ce(53124),Le=ce(98675);const Se=be.createContext(null),pe=Se.Provider;var Te=Se;const gt=be.createContext(null),ze=gt.Provider;var Pt=ce(95860),kt=ce(17799),pt=ce(98866),Je=ce(65223),De=ce(14747),Dt=ce(67968),Yt=ce(45503);const nt=Ae=>{const{componentCls:$t,antCls:Hn}=Ae,bn=`${$t}-group`;return{[bn]:Object.assign(Object.assign({},(0,De.Wf)(Ae)),{display:"inline-block",fontSize:0,[`&${bn}-rtl`]:{direction:"rtl"},[`${Hn}-badge ${Hn}-badge-count`]:{zIndex:1},[`> ${Hn}-badge:not(:first-child) > ${Hn}-button-wrapper`]:{borderInlineStart:"none"}})}},ct=Ae=>{const{componentCls:$t,wrapperMarginInlineEnd:Hn,colorPrimary:bn,radioSize:at,motionDurationSlow:ft,motionDurationMid:Gt,motionEaseInOutCirc:zn,colorBgContainer:mn,colorBorder:nn,lineWidth:Ft,dotSize:Pn,colorBgContainerDisabled:_n,colorTextDisabled:Ee,paddingXS:ue,dotColorDisabled:se,lineType:ye,radioDotDisabledSize:ve,wireframe:le,colorWhite:We}=Ae,Lt=`${$t}-inner`;return{[`${$t}-wrapper`]:Object.assign(Object.assign({},(0,De.Wf)(Ae)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:Hn,cursor:"pointer",[`&${$t}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:Ae.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${$t}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${Ft}px ${ye} ${bn}`,borderRadius:"50%",visibility:"hidden",content:'""'},[$t]:Object.assign(Object.assign({},(0,De.Wf)(Ae)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${$t}-wrapper:hover &,
&:hover ${Lt}`]:{borderColor:bn},[`${$t}-input:focus-visible + ${Lt}`]:Object.assign({},(0,De.oN)(Ae)),[`${$t}:hover::after, ${$t}-wrapper:hover &::after`]:{visibility:"visible"},[`${$t}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:at,height:at,marginBlockStart:at/-2,marginInlineStart:at/-2,backgroundColor:le?bn:We,borderBlockStart:0,borderInlineStart:0,borderRadius:at,transform:"scale(0)",opacity:0,transition:`all ${ft} ${zn}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:at,height:at,backgroundColor:mn,borderColor:nn,borderStyle:"solid",borderWidth:Ft,borderRadius:"50%",transition:`all ${Gt}`},[`${$t}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${$t}-checked`]:{[Lt]:{borderColor:bn,backgroundColor:le?mn:bn,"&::after":{transform:`scale(${Pn/at})`,opacity:1,transition:`all ${ft} ${zn}`}}},[`${$t}-disabled`]:{cursor:"not-allowed",[Lt]:{backgroundColor:_n,borderColor:nn,cursor:"not-allowed","&::after":{backgroundColor:se}},[`${$t}-input`]:{cursor:"not-allowed"},[`${$t}-disabled + span`]:{color:Ee,cursor:"not-allowed"},[`&${$t}-checked`]:{[Lt]:{"&::after":{transform:`scale(${ve/at})`}}}},[`span${$t} + *`]:{paddingInlineStart:ue,paddingInlineEnd:ue}})}},Ie=Ae=>{const{buttonColor:$t,controlHeight:Hn,componentCls:bn,lineWidth:at,lineType:ft,colorBorder:Gt,motionDurationSlow:zn,motionDurationMid:mn,buttonPaddingInline:nn,fontSize:Ft,buttonBg:Pn,fontSizeLG:_n,controlHeightLG:Ee,controlHeightSM:ue,paddingXS:se,borderRadius:ye,borderRadiusSM:ve,borderRadiusLG:le,buttonCheckedBg:We,buttonSolidCheckedColor:Lt,colorTextDisabled:tn,colorBgContainerDisabled:hn,buttonCheckedBgDisabled:sn,buttonCheckedColorDisabled:yn,colorPrimary:ln,colorPrimaryHover:yr,colorPrimaryActive:Fr,buttonSolidCheckedBg:Nt,buttonSolidCheckedHoverBg:Rn,buttonSolidCheckedActiveBg:Gr}=Ae;return{[`${bn}-button-wrapper`]:{position:"relative",display:"inline-block",height:Hn,margin:0,paddingInline:nn,paddingBlock:0,color:$t,fontSize:Ft,lineHeight:`${Hn-at*2}px`,background:Pn,border:`${at}px ${ft} ${Gt}`,borderBlockStartWidth:at+.02,borderInlineStartWidth:0,borderInlineEndWidth:at,cursor:"pointer",transition:[`color ${mn}`,`background ${mn}`,`box-shadow ${mn}`].join(","),a:{color:$t},[`> ${bn}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:-at,insetInlineStart:-at,display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:at,paddingInline:0,backgroundColor:Gt,transition:`background-color ${zn}`,content:'""'}},"&:first-child":{borderInlineStart:`${at}px ${ft} ${Gt}`,borderStartStartRadius:ye,borderEndStartRadius:ye},"&:last-child":{borderStartEndRadius:ye,borderEndEndRadius:ye},"&:first-child:last-child":{borderRadius:ye},[`${bn}-group-large &`]:{height:Ee,fontSize:_n,lineHeight:`${Ee-at*2}px`,"&:first-child":{borderStartStartRadius:le,borderEndStartRadius:le},"&:last-child":{borderStartEndRadius:le,borderEndEndRadius:le}},[`${bn}-group-small &`]:{height:ue,paddingInline:se-at,paddingBlock:0,lineHeight:`${ue-at*2}px`,"&:first-child":{borderStartStartRadius:ve,borderEndStartRadius:ve},"&:last-child":{borderStartEndRadius:ve,borderEndEndRadius:ve}},"&:hover":{position:"relative",color:ln},"&:has(:focus-visible)":Object.assign({},(0,De.oN)(Ae)),[`${bn}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${bn}-button-wrapper-disabled)`]:{zIndex:1,color:ln,background:We,borderColor:ln,"&::before":{backgroundColor:ln},"&:first-child":{borderColor:ln},"&:hover":{color:yr,borderColor:yr,"&::before":{backgroundColor:yr}},"&:active":{color:Fr,borderColor:Fr,"&::before":{backgroundColor:Fr}}},[`${bn}-group-solid &-checked:not(${bn}-button-wrapper-disabled)`]:{color:Lt,background:Nt,borderColor:Nt,"&:hover":{color:Lt,background:Rn,borderColor:Rn},"&:active":{color:Lt,background:Gr,borderColor:Gr}},"&-disabled":{color:tn,backgroundColor:hn,borderColor:Gt,cursor:"not-allowed","&:first-child, &:hover":{color:tn,backgroundColor:hn,borderColor:Gt}},[`&-disabled${bn}-button-wrapper-checked`]:{color:yn,backgroundColor:sn,borderColor:Gt,boxShadow:"none"}}}},Me=Ae=>Ae-4*2;var Ve=(0,Dt.Z)("Radio",Ae=>{const{controlOutline:$t,controlOutlineWidth:Hn,radioSize:bn}=Ae,at=`0 0 0 ${Hn}px ${$t}`,ft=at,Gt=Me(bn),zn=(0,Yt.TS)(Ae,{radioDotDisabledSize:Gt,radioFocusShadow:at,radioButtonFocusShadow:ft});return[nt(zn),ct(zn),Ie(zn)]},Ae=>{const{wireframe:$t,padding:Hn,marginXS:bn,lineWidth:at,fontSizeLG:ft,colorText:Gt,colorBgContainer:zn,colorTextDisabled:mn,controlItemBgActiveDisabled:nn,colorTextLightSolid:Ft,colorPrimary:Pn,colorPrimaryHover:_n,colorPrimaryActive:Ee}=Ae,ue=4,se=ft,ye=$t?Me(se):se-(ue+at)*2;return{radioSize:se,dotSize:ye,dotColorDisabled:mn,buttonSolidCheckedColor:Ft,buttonSolidCheckedBg:Pn,buttonSolidCheckedHoverBg:_n,buttonSolidCheckedActiveBg:Ee,buttonBg:zn,buttonCheckedBg:zn,buttonColor:Gt,buttonCheckedBgDisabled:nn,buttonCheckedColorDisabled:mn,buttonPaddingInline:Hn-at,wrapperMarginInlineEnd:bn}}),Xe=ce(45353),Ct=ce(92429),wt=function(Ae,$t){var Hn={};for(var bn in Ae)Object.prototype.hasOwnProperty.call(Ae,bn)&&$t.indexOf(bn)<0&&(Hn[bn]=Ae[bn]);if(Ae!=null&&typeof Object.getOwnPropertySymbols=="function")for(var at=0,bn=Object.getOwnPropertySymbols(Ae);at<bn.length;at++)$t.indexOf(bn[at])<0&&Object.prototype.propertyIsEnumerable.call(Ae,bn[at])&&(Hn[bn[at]]=Ae[bn[at]]);return Hn};const Mt=(Ae,$t)=>{var Hn,bn;const at=be.useContext(Te),ft=be.useContext(gt),{getPrefixCls:Gt,direction:zn,radio:mn}=be.useContext(_e.E_),nn=be.useRef(null),Ft=(0,kt.sQ)($t,nn),{isFormItemInput:Pn}=be.useContext(Je.aM),_n=Fr=>{var Nt,Rn;(Nt=Ae.onChange)===null||Nt===void 0||Nt.call(Ae,Fr),(Rn=at==null?void 0:at.onChange)===null||Rn===void 0||Rn.call(at,Fr)},{prefixCls:Ee,className:ue,rootClassName:se,children:ye,style:ve}=Ae,le=wt(Ae,["prefixCls","className","rootClassName","children","style"]),We=Gt("radio",Ee),Lt=((at==null?void 0:at.optionType)||ft)==="button",tn=Lt?`${We}-button`:We,[hn,sn]=Ve(We),yn=Object.assign({},le),ln=be.useContext(pt.Z);at&&(yn.name=at.name,yn.onChange=_n,yn.checked=Ae.value===at.value,yn.disabled=(Hn=yn.disabled)!==null&&Hn!==void 0?Hn:at.disabled),yn.disabled=(bn=yn.disabled)!==null&&bn!==void 0?bn:ln;const yr=tt()(`${tn}-wrapper`,{[`${tn}-wrapper-checked`]:yn.checked,[`${tn}-wrapper-disabled`]:yn.disabled,[`${tn}-wrapper-rtl`]:zn==="rtl",[`${tn}-wrapper-in-form-item`]:Pn},mn==null?void 0:mn.className,ue,se,sn);return hn(be.createElement(Xe.Z,{component:"Radio",disabled:yn.disabled},be.createElement("label",{className:yr,style:Object.assign(Object.assign({},mn==null?void 0:mn.style),ve),onMouseEnter:Ae.onMouseEnter,onMouseLeave:Ae.onMouseLeave},be.createElement(Pt.Z,Object.assign({},yn,{className:tt()(yn.className,!Lt&&Ct.A),type:"radio",prefixCls:tn,ref:Ft})),ye!==void 0?be.createElement("span",null,ye):null)))};var Rt=be.forwardRef(Mt);const At=be.forwardRef((Ae,$t)=>{const{getPrefixCls:Hn,direction:bn}=be.useContext(_e.E_),[at,ft]=(0,Fe.Z)(Ae.defaultValue,{value:Ae.value}),Gt=Nt=>{const Rn=at,Gr=Nt.target.value;"value"in Ae||ft(Gr);const{onChange:li}=Ae;li&&Gr!==Rn&&li(Nt)},{prefixCls:zn,className:mn,rootClassName:nn,options:Ft,buttonStyle:Pn="outline",disabled:_n,children:Ee,size:ue,style:se,id:ye,onMouseEnter:ve,onMouseLeave:le,onFocus:We,onBlur:Lt}=Ae,tn=Hn("radio",zn),hn=`${tn}-group`,[sn,yn]=Ve(tn);let ln=Ee;Ft&&Ft.length>0&&(ln=Ft.map(Nt=>typeof Nt=="string"||typeof Nt=="number"?be.createElement(Rt,{key:Nt.toString(),prefixCls:tn,disabled:_n,value:Nt,checked:at===Nt},Nt):be.createElement(Rt,{key:`radio-group-value-options-${Nt.value}`,prefixCls:tn,disabled:Nt.disabled||_n,value:Nt.value,checked:at===Nt.value,title:Nt.title,style:Nt.style},Nt.label)));const yr=(0,Le.Z)(ue),Fr=tt()(hn,`${hn}-${Pn}`,{[`${hn}-${yr}`]:yr,[`${hn}-rtl`]:bn==="rtl"},mn,nn,yn);return sn(be.createElement("div",Object.assign({},(0,Ye.Z)(Ae,{aria:!0,data:!0}),{className:Fr,style:se,onMouseEnter:ve,onMouseLeave:le,onFocus:We,onBlur:Lt,id:ye,ref:$t}),be.createElement(pe,{value:{onChange:Gt,value:at,disabled:Ae.disabled,name:Ae.name,optionType:Ae.optionType}},ln)))});var xn=be.memo(At),jt=function(Ae,$t){var Hn={};for(var bn in Ae)Object.prototype.hasOwnProperty.call(Ae,bn)&&$t.indexOf(bn)<0&&(Hn[bn]=Ae[bn]);if(Ae!=null&&typeof Object.getOwnPropertySymbols=="function")for(var at=0,bn=Object.getOwnPropertySymbols(Ae);at<bn.length;at++)$t.indexOf(bn[at])<0&&Object.prototype.propertyIsEnumerable.call(Ae,bn[at])&&(Hn[bn[at]]=Ae[bn[at]]);return Hn};const vn=(Ae,$t)=>{const{getPrefixCls:Hn}=be.useContext(_e.E_),{prefixCls:bn}=Ae,at=jt(Ae,["prefixCls"]),ft=Hn("radio",bn);return be.createElement(ze,{value:"button"},be.createElement(Rt,Object.assign({prefixCls:ft},at,{type:"radio",ref:$t})))};var er=be.forwardRef(vn);const Sr=Rt;Sr.Button=er,Sr.Group=xn,Sr.__ANT_RADIO=!0;var qe=Sr},11713:function(Ln,qt,ce){"use strict";ce.d(qt,{default:function(){return hr}});var fe=ce(94184),tt=ce.n(fe),Fe=ce(87462),Ye=ce(74902),be=ce(4942),_e=ce(1413),Le=ce(97685),Se=ce(45987),pe=ce(71002),Te=ce(67294);function gt(Pe){var $e=Te.useRef();$e.current=Pe;var xt=Te.useCallback(function(){for(var rt,It=arguments.length,rn=new Array(It),fn=0;fn<It;fn++)rn[fn]=arguments[fn];return(rt=$e.current)===null||rt===void 0?void 0:rt.call.apply(rt,[$e].concat(rn))},[]);return xt}function ze(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Pt=ze()?Te.useLayoutEffect:Te.useEffect,kt=Pt,pt=function($e,xt){var rt=Te.useRef(!0);Pt(function(){if(!rt.current)return $e()},xt),Pt(function(){return rt.current=!1,function(){rt.current=!0}},[])};function Je(Pe){var $e=Te.useRef(!1),xt=Te.useState(Pe),rt=(0,Le.Z)(xt,2),It=rt[0],rn=rt[1];Te.useEffect(function(){return $e.current=!1,function(){$e.current=!0}},[]);function fn(On,wn){wn&&$e.current||rn(On)}return[It,fn]}function De(Pe){return Pe!==void 0}function Dt(Pe,$e){var xt=$e||{},rt=xt.defaultValue,It=xt.value,rn=xt.onChange,fn=xt.postState,On=Je(function(){return De(It)?It:De(rt)?typeof rt=="function"?rt():rt:typeof Pe=="function"?Pe():Pe}),wn=(0,Le.Z)(On,2),Xt=wn[0],Nn=wn[1],Fn=It!==void 0?It:Xt,mr=fn?fn(Fn):Fn,Bn=gt(rn),Lr=Je([Fn]),Zr=(0,Le.Z)(Lr,2),Dr=Zr[0],zr=Zr[1];pt(function(){var Or=Dr[0];Xt!==Or&&Bn(Xt,Or)},[Dr]),pt(function(){De(It)||Nn(It)},[It]);var xr=gt(function(Or,Jr){Nn(Or,Jr),zr([Fn],Jr)});return[mr,xr]}var Yt={};function nt(Pe,$e){}function ct(Pe,$e){}function Ie(){Yt={}}function Me(Pe,$e,xt){!$e&&!Yt[xt]&&(Pe(!1,xt),Yt[xt]=!0)}function Ve(Pe,$e){Me(nt,Pe,$e)}function Xe(Pe,$e){Me(ct,Pe,$e)}var Ct=Ve,wt=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Pe=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(Pe)||/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(Pe==null?void 0:Pe.substr(0,4))},Mt={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($e){var xt=$e.keyCode;if($e.altKey&&!$e.ctrlKey||$e.metaKey||xt>=Mt.F1&&xt<=Mt.F12)return!1;switch(xt){case Mt.ALT:case Mt.CAPS_LOCK:case Mt.CONTEXT_MENU:case Mt.CTRL:case Mt.DOWN:case Mt.END:case Mt.ESC:case Mt.HOME:case Mt.INSERT:case Mt.LEFT:case Mt.MAC_FF_META:case Mt.META:case Mt.NUMLOCK:case Mt.NUM_CENTER:case Mt.PAGE_DOWN:case Mt.PAGE_UP:case Mt.PAUSE:case Mt.PRINT_SCREEN:case Mt.RIGHT:case Mt.SHIFT:case Mt.UP:case Mt.WIN_KEY:case Mt.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function($e){if($e>=Mt.ZERO&&$e<=Mt.NINE||$e>=Mt.NUM_ZERO&&$e<=Mt.NUM_MULTIPLY||$e>=Mt.A&&$e<=Mt.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&$e===0)return!0;switch($e){case Mt.SPACE:case Mt.QUESTION_MARK:case Mt.NUM_PLUS:case Mt.NUM_MINUS:case Mt.NUM_PERIOD:case Mt.NUM_DIVISION:case Mt.SEMICOLON:case Mt.DASH:case Mt.EQUALS:case Mt.COMMA:case Mt.PERIOD:case Mt.SLASH:case Mt.APOSTROPHE:case Mt.SINGLE_QUOTE:case Mt.OPEN_SQUARE_BRACKET:case Mt.BACKSLASH:case Mt.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},je=Mt,Rt=ce(47655);function At(Pe,$e,xt){var rt=Te.useRef({});return(!("value"in rt.current)||xt(rt.current.condition,$e))&&(rt.current.value=Pe(),rt.current.condition=$e),rt.current.value}function xn(Pe,$e){typeof Pe=="function"?Pe($e):(0,pe.Z)(Pe)==="object"&&Pe&&"current"in Pe&&(Pe.current=$e)}function jt(){for(var Pe=arguments.length,$e=new Array(Pe),xt=0;xt<Pe;xt++)$e[xt]=arguments[xt];var rt=$e.filter(function(It){return It});return rt.length<=1?rt[0]:function(It){$e.forEach(function(rn){xn(rn,It)})}}function vn(){for(var Pe=arguments.length,$e=new Array(Pe),xt=0;xt<Pe;xt++)$e[xt]=arguments[xt];return At(function(){return jt.apply(void 0,$e)},$e,function(rt,It){return rt.length===It.length&&rt.every(function(rn,fn){return rn===It[fn]})})}function er(Pe){var $e,xt,rt=isMemo(Pe)?Pe.type.type:Pe.type;return!(typeof rt=="function"&&!(($e=rt.prototype)!==null&&$e!==void 0&&$e.render)||typeof Pe=="function"&&!((xt=Pe.prototype)!==null&&xt!==void 0&&xt.render))}var Sr=function($e){var xt=$e.className,rt=$e.customizeIcon,It=$e.customizeIconProps,rn=$e.onMouseDown,fn=$e.onClick,On=$e.children,wn;return typeof rt=="function"?wn=rt(It):wn=rt,Te.createElement("span",{className:xt,onMouseDown:function(Nn){Nn.preventDefault(),rn&&rn(Nn)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:fn,"aria-hidden":!0},wn!==void 0?wn:Te.createElement("span",{className:tt()(xt.split(/\s+/).map(function(Xt){return"".concat(Xt,"-icon")}))},On))},qe=Sr;function Ae(Pe,$e,xt,rt,It){var rn=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,fn=arguments.length>6?arguments[6]:void 0,On=arguments.length>7?arguments[7]:void 0,wn=Te.useMemo(function(){if((0,pe.Z)(rt)==="object")return rt.clearIcon;if(It)return It},[rt,It]),Xt=Te.useMemo(function(){return!!(!rn&&rt&&(xt.length||fn)&&!(On==="combobox"&&fn===""))},[rt,rn,xt.length,fn,On]);return{allowClear:Xt,clearIcon:Te.createElement(qe,{className:"".concat(Pe,"-clear"),onMouseDown:$e,customizeIcon:wn},"\xD7")}}var $t=Te.createContext(null);function Hn(){return Te.useContext($t)}function bn(){var Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,$e=Te.useState(!1),xt=(0,Le.Z)($e,2),rt=xt[0],It=xt[1],rn=Te.useRef(null),fn=function(){window.clearTimeout(rn.current)};Te.useEffect(function(){return fn},[]);var On=function(Xt,Nn){fn(),rn.current=window.setTimeout(function(){It(Xt),Nn&&Nn()},Pe)};return[rt,On,fn]}function at(){var Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,$e=Te.useRef(null),xt=Te.useRef(null);Te.useEffect(function(){return function(){window.clearTimeout(xt.current)}},[]);function rt(It){(It||$e.current===null)&&($e.current=It),window.clearTimeout(xt.current),xt.current=window.setTimeout(function(){$e.current=null},Pe)}return[function(){return $e.current},rt]}function ft(Pe,$e,xt,rt){var It=Te.useRef(null);It.current={open:$e,triggerOpen:xt,customizedTrigger:rt},Te.useEffect(function(){function rn(fn){var On;if(!((On=It.current)!==null&&On!==void 0&&On.customizedTrigger)){var wn=fn.target;wn.shadowRoot&&fn.composed&&(wn=fn.composedPath()[0]||wn),It.current.open&&Pe().filter(function(Xt){return Xt}).every(function(Xt){return!Xt.contains(wn)&&Xt!==wn})&&It.current.triggerOpen(!1)}}return window.addEventListener("mousedown",rn),function(){return window.removeEventListener("mousedown",rn)}},[])}var Gt=`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`,zn=`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`,mn="".concat(Gt," ").concat(zn).split(/[\s\n]+/),nn="aria-",Ft="data-";function Pn(Pe,$e){return Pe.indexOf($e)===0}function _n(Pe){var $e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,xt;$e===!1?xt={aria:!0,data:!0,attr:!0}:$e===!0?xt={aria:!0}:xt=(0,_e.Z)({},$e);var rt={};return Object.keys(Pe).forEach(function(It){(xt.aria&&(It==="role"||Pn(It,nn))||xt.data&&Pn(It,Ft)||xt.attr&&mn.includes(It))&&(rt[It]=Pe[It])}),rt}var Ee=ce(48555),ue=ce(14075),se=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],ye=void 0;function ve(Pe,$e){var xt=Pe.prefixCls,rt=Pe.invalidate,It=Pe.item,rn=Pe.renderItem,fn=Pe.responsive,On=Pe.responsiveDisabled,wn=Pe.registerSize,Xt=Pe.itemKey,Nn=Pe.className,Fn=Pe.style,mr=Pe.children,Bn=Pe.display,Lr=Pe.order,Zr=Pe.component,Dr=Zr===void 0?"div":Zr,zr=(0,Se.Z)(Pe,se),xr=fn&&!Bn;function Or(Pi){wn(Xt,Pi)}Te.useEffect(function(){return function(){Or(null)}},[]);var Jr=rn&&It!==ye?rn(It):mr,ai;rt||(ai={opacity:xr?0:1,height:xr?0:ye,overflowY:xr?"hidden":ye,order:fn?Lr:ye,pointerEvents:xr?"none":ye,position:xr?"absolute":ye});var Ir={};xr&&(Ir["aria-hidden"]=!0);var ci=Te.createElement(Dr,(0,Fe.Z)({className:tt()(!rt&&xt,Nn),style:(0,_e.Z)((0,_e.Z)({},ai),Fn)},Ir,zr,{ref:$e}),Jr);return fn&&(ci=Te.createElement(Ee.Z,{onResize:function(ta){var Vi=ta.offsetWidth;Or(Vi)},disabled:On},ci)),ci}var le=Te.forwardRef(ve);le.displayName="Item";var We=le,Lt=ce(77527),tn=ce(73935),hn=ce(96523);function sn(Pe){if(typeof MessageChannel=="undefined")(0,hn.Z)(Pe);else{var $e=new MessageChannel;$e.port1.onmessage=function(){return Pe()},$e.port2.postMessage(void 0)}}function yn(){var Pe=Te.useRef(null),$e=function(rt){Pe.current||(Pe.current=[],sn(function(){(0,tn.unstable_batchedUpdates)(function(){Pe.current.forEach(function(It){It()}),Pe.current=null})})),Pe.current.push(rt)};return $e}function ln(Pe,$e){var xt=Te.useState($e),rt=(0,Le.Z)(xt,2),It=rt[0],rn=rt[1],fn=(0,Lt.Z)(function(On){Pe(function(){rn(On)})});return[It,fn]}var yr=Te.createContext(null),Fr=["component"],Nt=["className"],Rn=["className"],Gr=function($e,xt){var rt=Te.useContext(yr);if(!rt){var It=$e.component,rn=It===void 0?"div":It,fn=(0,Se.Z)($e,Fr);return Te.createElement(rn,(0,Fe.Z)({},fn,{ref:xt}))}var On=rt.className,wn=(0,Se.Z)(rt,Nt),Xt=$e.className,Nn=(0,Se.Z)($e,Rn);return Te.createElement(yr.Provider,{value:null},Te.createElement(We,(0,Fe.Z)({ref:xt,className:tt()(On,Xt)},wn,Nn)))},li=Te.forwardRef(Gr);li.displayName="RawItem";var st=li,Wt=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Vn="responsive",ir="invalidate";function gr(Pe){return"+ ".concat(Pe.length," ...")}function Pr(Pe,$e){var xt=Pe.prefixCls,rt=xt===void 0?"rc-overflow":xt,It=Pe.data,rn=It===void 0?[]:It,fn=Pe.renderItem,On=Pe.renderRawItem,wn=Pe.itemKey,Xt=Pe.itemWidth,Nn=Xt===void 0?10:Xt,Fn=Pe.ssr,mr=Pe.style,Bn=Pe.className,Lr=Pe.maxCount,Zr=Pe.renderRest,Dr=Pe.renderRawRest,zr=Pe.suffix,xr=Pe.component,Or=xr===void 0?"div":xr,Jr=Pe.itemComponent,ai=Pe.onVisibleChange,Ir=(0,Se.Z)(Pe,Wt),ci=Fn==="full",Pi=yn(),ta=ln(Pi,null),Vi=(0,Le.Z)(ta,2),Bi=Vi[0],Xi=Vi[1],qi=Bi||0,bi=ln(Pi,new Map),$i=(0,Le.Z)(bi,2),jr=$i[0],di=$i[1],Ti=ln(Pi,0),ji=(0,Le.Z)(Ti,2),Ba=ji[0],$a=ji[1],Aa=ln(Pi,0),ca=(0,Le.Z)(Aa,2),Yi=ca[0],Mi=ca[1],Oa=ln(Pi,0),ki=(0,Le.Z)(Oa,2),Qr=ki[0],zi=ki[1],ua=(0,Te.useState)(null),Ui=(0,Le.Z)(ua,2),ia=Ui[0],hi=Ui[1],pa=(0,Te.useState)(null),xa=(0,Le.Z)(pa,2),fa=xa[0],wa=xa[1],Ea=Te.useMemo(function(){return fa===null&&ci?Number.MAX_SAFE_INTEGER:fa||0},[fa,Bi]),Va=(0,Te.useState)(!1),ha=(0,Le.Z)(Va,2),ka=ha[0],Ja=ha[1],Ga="".concat(rt,"-item"),so=Math.max(Ba,Yi),Fa=Lr===Vn,Ca=rn.length&&Fa,_i=Lr===ir,Ki=Ca||typeof Lr=="number"&&rn.length>Lr,da=(0,Te.useMemo)(function(){var aa=rn;return Ca?Bi===null&&ci?aa=rn:aa=rn.slice(0,Math.min(rn.length,qi/Nn)):typeof Lr=="number"&&(aa=rn.slice(0,Lr)),aa},[rn,Nn,Bi,Lr,Ca]),Sa=(0,Te.useMemo)(function(){return Ca?rn.slice(Ea+1):rn.slice(da.length)},[rn,da,Ca,Ea]),Ka=(0,Te.useCallback)(function(aa,Ar){var xi;return typeof wn=="function"?wn(aa):(xi=wn&&(aa==null?void 0:aa[wn]))!==null&&xi!==void 0?xi:Ar},[wn]),io=(0,Te.useCallback)(fn||function(aa){return aa},[fn]);function ho(aa,Ar,xi){fa===aa&&(Ar===void 0||Ar===ia)||(wa(aa),xi||(Ja(aa<rn.length-1),ai==null||ai(aa)),Ar!==void 0&&hi(Ar))}function Oo(aa,Ar){Xi(Ar.clientWidth)}function Ro(aa,Ar){di(function(xi){var wi=new Map(xi);return Ar===null?wi.delete(aa):wi.set(aa,Ar),wi})}function lo(aa,Ar){Mi(Ar),$a(Yi)}function Ao(aa,Ar){zi(Ar)}function na(aa){return jr.get(Ka(da[aa],aa))}(0,ue.Z)(function(){if(qi&&typeof so=="number"&&da){var aa=Qr,Ar=da.length,xi=Ar-1;if(!Ar){ho(0,null);return}for(var wi=0;wi<Ar;wi+=1){var Di=na(wi);if(ci&&(Di=Di||0),Di===void 0){ho(wi-1,void 0,!0);break}if(aa+=Di,xi===0&&aa<=qi||wi===xi-1&&aa+na(xi)<=qi){ho(xi,null);break}else if(aa+so>qi){ho(wi-1,aa-Di-Qr+Yi);break}}zr&&na(0)+Qr>qi&&hi(null)}},[qi,jr,Yi,Qr,Ka,da]);var Oi=ka&&!!Sa.length,Ta={};ia!==null&&Ca&&(Ta={position:"absolute",left:ia,top:0});var _a={prefixCls:Ga,responsive:Ca,component:Jr,invalidate:_i},co=On?function(aa,Ar){var xi=Ka(aa,Ar);return Te.createElement(yr.Provider,{key:xi,value:(0,_e.Z)((0,_e.Z)({},_a),{},{order:Ar,item:aa,itemKey:xi,registerSize:Ro,display:Ar<=Ea})},On(aa,Ar))}:function(aa,Ar){var xi=Ka(aa,Ar);return Te.createElement(We,(0,Fe.Z)({},_a,{order:Ar,key:xi,item:aa,renderItem:io,itemKey:xi,registerSize:Ro,display:Ar<=Ea}))},ao,hs={order:Oi?Ea:Number.MAX_SAFE_INTEGER,className:"".concat(Ga,"-rest"),registerSize:lo,display:Oi};if(Dr)Dr&&(ao=Te.createElement(yr.Provider,{value:(0,_e.Z)((0,_e.Z)({},_a),hs)},Dr(Sa)));else{var Qo=Zr||gr;ao=Te.createElement(We,(0,Fe.Z)({},_a,hs),typeof Qo=="function"?Qo(Sa):Qo)}var ps=Te.createElement(Or,(0,Fe.Z)({className:tt()(!_i&&rt,Bn),style:mr,ref:$e},Ir),da.map(co),Ki?ao:null,zr&&Te.createElement(We,(0,Fe.Z)({},_a,{responsive:Fa,responsiveDisabled:!Ca,order:Ea,className:"".concat(Ga,"-suffix"),registerSize:Ao,display:!0,style:Ta}),zr));return Fa&&(ps=Te.createElement(Ee.Z,{onResize:Oo,disabled:!Ca},ps)),ps}var Ur=Te.forwardRef(Pr);Ur.displayName="Overflow",Ur.Item=st,Ur.RESPONSIVE=Vn,Ur.INVALIDATE=ir;var Xr=Ur,qr=Xr,ui=function($e,xt){var rt,It,rn=$e.prefixCls,fn=$e.id,On=$e.inputElement,wn=$e.disabled,Xt=$e.tabIndex,Nn=$e.autoFocus,Fn=$e.autoComplete,mr=$e.editable,Bn=$e.activeDescendantId,Lr=$e.value,Zr=$e.maxLength,Dr=$e.onKeyDown,zr=$e.onMouseDown,xr=$e.onChange,Or=$e.onPaste,Jr=$e.onCompositionStart,ai=$e.onCompositionEnd,Ir=$e.open,ci=$e.attrs,Pi=On||Te.createElement("input",null),ta=Pi,Vi=ta.ref,Bi=ta.props,Xi=Bi.onKeyDown,qi=Bi.onChange,bi=Bi.onMouseDown,$i=Bi.onCompositionStart,jr=Bi.onCompositionEnd,di=Bi.style;return"maxLength"in Pi.props,Pi=Te.cloneElement(Pi,(0,_e.Z)((0,_e.Z)((0,_e.Z)({type:"search"},Bi),{},{id:fn,ref:jt(xt,Vi),disabled:wn,tabIndex:Xt,autoComplete:Fn||"off",autoFocus:Nn,className:tt()("".concat(rn,"-selection-search-input"),(rt=Pi)===null||rt===void 0||(It=rt.props)===null||It===void 0?void 0:It.className),role:"combobox","aria-label":"Search","aria-expanded":Ir||!1,"aria-haspopup":"listbox","aria-owns":"".concat(fn,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(fn,"_list"),"aria-activedescendant":Ir?Bn:void 0},ci),{},{value:mr?Lr:"",maxLength:Zr,readOnly:!mr,unselectable:mr?null:"on",style:(0,_e.Z)((0,_e.Z)({},di),{},{opacity:mr?null:0}),onKeyDown:function(ji){Dr(ji),Xi&&Xi(ji)},onMouseDown:function(ji){zr(ji),bi&&bi(ji)},onChange:function(ji){xr(ji),qi&&qi(ji)},onCompositionStart:function(ji){Jr(ji),$i&&$i(ji)},onCompositionEnd:function(ji){ai(ji),jr&&jr(ji)},onPaste:Or})),Pi},br=Te.forwardRef(ui);br.displayName="Input";var Ei=br;function sa(Pe){return Array.isArray(Pe)?Pe:Pe!==void 0?[Pe]:[]}var Ji=typeof window!="undefined"&&window.document&&window.document.documentElement,Qi=Ji;function Ci(Pe){return Pe!=null}function mt(Pe){return!Pe&&Pe!==0}function Mn(Pe){return["string","number"].includes((0,pe.Z)(Pe))}function En(Pe){var $e=void 0;return Pe&&(Mn(Pe.title)?$e=Pe.title.toString():Mn(Pe.label)&&($e=Pe.label.toString())),$e}function An(Pe,$e){Qi?Te.useLayoutEffect(Pe,$e):Te.useEffect(Pe,$e)}function sr(Pe){var $e;return($e=Pe.key)!==null&&$e!==void 0?$e:Pe.value}var nr=function($e){$e.preventDefault(),$e.stopPropagation()},pr=function($e){var xt=$e.id,rt=$e.prefixCls,It=$e.values,rn=$e.open,fn=$e.searchValue,On=$e.autoClearSearchValue,wn=$e.inputRef,Xt=$e.placeholder,Nn=$e.disabled,Fn=$e.mode,mr=$e.showSearch,Bn=$e.autoFocus,Lr=$e.autoComplete,Zr=$e.activeDescendantId,Dr=$e.tabIndex,zr=$e.removeIcon,xr=$e.maxTagCount,Or=$e.maxTagTextLength,Jr=$e.maxTagPlaceholder,ai=Jr===void 0?function(hi){return"+ ".concat(hi.length," ...")}:Jr,Ir=$e.tagRender,ci=$e.onToggleOpen,Pi=$e.onRemove,ta=$e.onInputChange,Vi=$e.onInputPaste,Bi=$e.onInputKeyDown,Xi=$e.onInputMouseDown,qi=$e.onInputCompositionStart,bi=$e.onInputCompositionEnd,$i=Te.useRef(null),jr=(0,Te.useState)(0),di=(0,Le.Z)(jr,2),Ti=di[0],ji=di[1],Ba=(0,Te.useState)(!1),$a=(0,Le.Z)(Ba,2),Aa=$a[0],ca=$a[1],Yi="".concat(rt,"-selection"),Mi=rn||Fn==="multiple"&&On===!1||Fn==="tags"?fn:"",Oa=Fn==="tags"||Fn==="multiple"&&On===!1||mr&&(rn||Aa);An(function(){ji($i.current.scrollWidth)},[Mi]);function ki(hi,pa,xa,fa,wa){return Te.createElement("span",{className:tt()("".concat(Yi,"-item"),(0,be.Z)({},"".concat(Yi,"-item-disabled"),xa)),title:En(hi)},Te.createElement("span",{className:"".concat(Yi,"-item-content")},pa),fa&&Te.createElement(qe,{className:"".concat(Yi,"-item-remove"),onMouseDown:nr,onClick:wa,customizeIcon:zr},"\xD7"))}function Qr(hi,pa,xa,fa,wa){var Ea=function(ha){nr(ha),ci(!rn)};return Te.createElement("span",{onMouseDown:Ea},Ir({label:pa,value:hi,disabled:xa,closable:fa,onClose:wa}))}function zi(hi){var pa=hi.disabled,xa=hi.label,fa=hi.value,wa=!Nn&&!pa,Ea=xa;if(typeof Or=="number"&&(typeof xa=="string"||typeof xa=="number")){var Va=String(Ea);Va.length>Or&&(Ea="".concat(Va.slice(0,Or),"..."))}var ha=function(Ja){Ja&&Ja.stopPropagation(),Pi(hi)};return typeof Ir=="function"?Qr(fa,Ea,pa,wa,ha):ki(hi,Ea,pa,wa,ha)}function ua(hi){var pa=typeof ai=="function"?ai(hi):ai;return ki({title:pa},pa,!1)}var Ui=Te.createElement("div",{className:"".concat(Yi,"-search"),style:{width:Ti},onFocus:function(){ca(!0)},onBlur:function(){ca(!1)}},Te.createElement(Ei,{ref:wn,open:rn,prefixCls:rt,id:xt,inputElement:null,disabled:Nn,autoFocus:Bn,autoComplete:Lr,editable:Oa,activeDescendantId:Zr,value:Mi,onKeyDown:Bi,onMouseDown:Xi,onChange:ta,onPaste:Vi,onCompositionStart:qi,onCompositionEnd:bi,tabIndex:Dr,attrs:_n($e,!0)}),Te.createElement("span",{ref:$i,className:"".concat(Yi,"-search-mirror"),"aria-hidden":!0},Mi,"\xA0")),ia=Te.createElement(qr,{prefixCls:"".concat(Yi,"-overflow"),data:It,renderItem:zi,renderRest:ua,suffix:Ui,itemKey:sr,maxCount:xr});return Te.createElement(Te.Fragment,null,ia,!It.length&&!Mi&&Te.createElement("span",{className:"".concat(Yi,"-placeholder")},Xt))},Kn=pr,Ue=function($e){var xt=$e.inputElement,rt=$e.prefixCls,It=$e.id,rn=$e.inputRef,fn=$e.disabled,On=$e.autoFocus,wn=$e.autoComplete,Xt=$e.activeDescendantId,Nn=$e.mode,Fn=$e.open,mr=$e.values,Bn=$e.placeholder,Lr=$e.tabIndex,Zr=$e.showSearch,Dr=$e.searchValue,zr=$e.activeValue,xr=$e.maxLength,Or=$e.onInputKeyDown,Jr=$e.onInputMouseDown,ai=$e.onInputChange,Ir=$e.onInputPaste,ci=$e.onInputCompositionStart,Pi=$e.onInputCompositionEnd,ta=$e.title,Vi=Te.useState(!1),Bi=(0,Le.Z)(Vi,2),Xi=Bi[0],qi=Bi[1],bi=Nn==="combobox",$i=bi||Zr,jr=mr[0],di=Dr||"";bi&&zr&&!Xi&&(di=zr),Te.useEffect(function(){bi&&qi(!1)},[bi,zr]);var Ti=Nn!=="combobox"&&!Fn&&!Zr?!1:!!di,ji=ta===void 0?En(jr):ta,Ba=function(){if(jr)return null;var Aa=Ti?{visibility:"hidden"}:void 0;return Te.createElement("span",{className:"".concat(rt,"-selection-placeholder"),style:Aa},Bn)};return Te.createElement(Te.Fragment,null,Te.createElement("span",{className:"".concat(rt,"-selection-search")},Te.createElement(Ei,{ref:rn,prefixCls:rt,id:It,open:Fn,inputElement:xt,disabled:fn,autoFocus:On,autoComplete:wn,editable:$i,activeDescendantId:Xt,value:di,onKeyDown:Or,onMouseDown:Jr,onChange:function(Aa){qi(!0),ai(Aa)},onPaste:Ir,onCompositionStart:ci,onCompositionEnd:Pi,tabIndex:Lr,attrs:_n($e,!0),maxLength:bi?xr:void 0})),!bi&&jr?Te.createElement("span",{className:"".concat(rt,"-selection-item"),title:ji,style:Ti?{visibility:"hidden"}:void 0},jr.label):null,Ba())},it=Ue;function _t(Pe){return![je.ESC,je.SHIFT,je.BACKSPACE,je.TAB,je.WIN_KEY,je.ALT,je.META,je.WIN_KEY_RIGHT,je.CTRL,je.SEMICOLON,je.EQUALS,je.CAPS_LOCK,je.CONTEXT_MENU,je.F1,je.F2,je.F3,je.F4,je.F5,je.F6,je.F7,je.F8,je.F9,je.F10,je.F11,je.F12].includes(Pe)}var Ut=function($e,xt){var rt=(0,Te.useRef)(null),It=(0,Te.useRef)(!1),rn=$e.prefixCls,fn=$e.open,On=$e.mode,wn=$e.showSearch,Xt=$e.tokenWithEnter,Nn=$e.autoClearSearchValue,Fn=$e.onSearch,mr=$e.onSearchSubmit,Bn=$e.onToggleOpen,Lr=$e.onInputKeyDown,Zr=$e.domRef;Te.useImperativeHandle(xt,function(){return{focus:function(){rt.current.focus()},blur:function(){rt.current.blur()}}});var Dr=at(0),zr=(0,Le.Z)(Dr,2),xr=zr[0],Or=zr[1],Jr=function(di){var Ti=di.which;(Ti===je.UP||Ti===je.DOWN)&&di.preventDefault(),Lr&&Lr(di),Ti===je.ENTER&&On==="tags"&&!It.current&&!fn&&(mr==null||mr(di.target.value)),_t(Ti)&&Bn(!0)},ai=function(){Or(!0)},Ir=(0,Te.useRef)(null),ci=function(di){Fn(di,!0,It.current)!==!1&&Bn(!0)},Pi=function(){It.current=!0},ta=function(di){It.current=!1,On!=="combobox"&&ci(di.target.value)},Vi=function(di){var Ti=di.target.value;if(Xt&&Ir.current&&/[\r\n]/.test(Ir.current)){var ji=Ir.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");Ti=Ti.replace(ji,Ir.current)}Ir.current=null,ci(Ti)},Bi=function(di){var Ti=di.clipboardData,ji=Ti.getData("text");Ir.current=ji},Xi=function(di){var Ti=di.target;if(Ti!==rt.current){var ji=document.body.style.msTouchAction!==void 0;ji?setTimeout(function(){rt.current.focus()}):rt.current.focus()}},qi=function(di){var Ti=xr();di.target!==rt.current&&!Ti&&On!=="combobox"&&di.preventDefault(),(On!=="combobox"&&(!wn||!Ti)||!fn)&&(fn&&Nn!==!1&&Fn("",!0,!1),Bn())},bi={inputRef:rt,onInputKeyDown:Jr,onInputMouseDown:ai,onInputChange:Vi,onInputPaste:Bi,onInputCompositionStart:Pi,onInputCompositionEnd:ta},$i=On==="multiple"||On==="tags"?Te.createElement(Kn,(0,Fe.Z)({},$e,bi)):Te.createElement(it,(0,Fe.Z)({},$e,bi));return Te.createElement("div",{ref:Zr,className:"".concat(rn,"-selector"),onClick:Xi,onMouseDown:qi},$i)},Ke=Te.forwardRef(Ut);Ke.displayName="Selector";var ut=Ke,Ot=ce(62709),Tt=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],zt=function($e){var xt=$e===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:xt,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:xt,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:xt,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:xt,adjustY:1},htmlRegion:"scroll"}}},Ht=function($e,xt){var rt=$e.prefixCls,It=$e.disabled,rn=$e.visible,fn=$e.children,On=$e.popupElement,wn=$e.animation,Xt=$e.transitionName,Nn=$e.dropdownStyle,Fn=$e.dropdownClassName,mr=$e.direction,Bn=mr===void 0?"ltr":mr,Lr=$e.placement,Zr=$e.builtinPlacements,Dr=$e.dropdownMatchSelectWidth,zr=$e.dropdownRender,xr=$e.dropdownAlign,Or=$e.getPopupContainer,Jr=$e.empty,ai=$e.getTriggerDOMNode,Ir=$e.onPopupVisibleChange,ci=$e.onPopupMouseEnter,Pi=(0,Se.Z)($e,Tt),ta="".concat(rt,"-dropdown"),Vi=On;zr&&(Vi=zr(On));var Bi=Te.useMemo(function(){return Zr||zt(Dr)},[Zr,Dr]),Xi=wn?"".concat(ta,"-").concat(wn):Xt,qi=typeof Dr=="number",bi=Te.useMemo(function(){return qi?null:Dr===!1?"minWidth":"width"},[Dr,qi]),$i=Nn;qi&&($i=(0,_e.Z)((0,_e.Z)({},$i),{},{width:Dr}));var jr=Te.useRef(null);return Te.useImperativeHandle(xt,function(){return{getPopupElement:function(){return jr.current}}}),Te.createElement(Ot.Z,(0,Fe.Z)({},Pi,{showAction:Ir?["click"]:[],hideAction:Ir?["click"]:[],popupPlacement:Lr||(Bn==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:Bi,prefixCls:ta,popupTransitionName:Xi,popup:Te.createElement("div",{ref:jr,onMouseEnter:ci},Vi),stretch:bi,popupAlign:xr,popupVisible:rn,getPopupContainer:Or,popupClassName:tt()(Fn,(0,be.Z)({},"".concat(ta,"-empty"),Jr)),popupStyle:$i,getTriggerDOMNode:ai,onPopupVisibleChange:Ir}),fn)},$n=Te.forwardRef(Ht);$n.displayName="SelectTrigger";var Cr=$n,Yn=ce(84506);function qn(Pe,$e){var xt=Pe.key,rt;return"value"in Pe&&(rt=Pe.value),xt!=null?xt:rt!==void 0?rt:"rc-index-key-".concat($e)}function rr(Pe,$e){var xt=Pe||{},rt=xt.label,It=xt.value,rn=xt.options,fn=xt.groupLabel,On=rt||($e?"children":"label");return{label:On,value:It||"value",options:rn||"options",groupLabel:fn||On}}function ar(Pe){var $e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},xt=$e.fieldNames,rt=$e.childrenAsData,It=[],rn=rr(xt,!1),fn=rn.label,On=rn.value,wn=rn.options,Xt=rn.groupLabel;function Nn(Fn,mr){Fn.forEach(function(Bn){if(mr||!(wn in Bn)){var Lr=Bn[On];It.push({key:qn(Bn,It.length),groupOption:mr,data:Bn,label:Bn[fn],value:Lr})}else{var Zr=Bn[Xt];Zr===void 0&&rt&&(Zr=Bn.label),It.push({key:qn(Bn,It.length),group:!0,data:Bn,label:Zr}),Nn(Bn[wn],!0)}})}return Nn(Pe,!1),It}function ot(Pe){var $e=(0,_e.Z)({},Pe);return"props"in $e||Object.defineProperty($e,"props",{get:function(){return Ct(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),$e}}),$e}function Qe(Pe,$e){if(!$e||!$e.length)return null;var xt=!1;function rt(rn,fn){var On=(0,Yn.Z)(fn),wn=On[0],Xt=On.slice(1);if(!wn)return[rn];var Nn=rn.split(wn);return xt=xt||Nn.length>1,Nn.reduce(function(Fn,mr){return[].concat((0,Ye.Z)(Fn),(0,Ye.Z)(rt(mr,Xt)))},[]).filter(function(Fn){return Fn})}var It=rt(Pe,$e);return xt?It:null}var vt=["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"],Qt=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function Tn(Pe){return Pe==="tags"||Pe==="multiple"}var en=Te.forwardRef(function(Pe,$e){var xt,rt,It=Pe.id,rn=Pe.prefixCls,fn=Pe.className,On=Pe.showSearch,wn=Pe.tagRender,Xt=Pe.direction,Nn=Pe.omitDomProps,Fn=Pe.displayValues,mr=Pe.onDisplayValuesChange,Bn=Pe.emptyOptions,Lr=Pe.notFoundContent,Zr=Lr===void 0?"Not Found":Lr,Dr=Pe.onClear,zr=Pe.mode,xr=Pe.disabled,Or=Pe.loading,Jr=Pe.getInputElement,ai=Pe.getRawInputElement,Ir=Pe.open,ci=Pe.defaultOpen,Pi=Pe.onDropdownVisibleChange,ta=Pe.activeValue,Vi=Pe.onActiveValueChange,Bi=Pe.activeDescendantId,Xi=Pe.searchValue,qi=Pe.autoClearSearchValue,bi=Pe.onSearch,$i=Pe.onSearchSplit,jr=Pe.tokenSeparators,di=Pe.allowClear,Ti=Pe.suffixIcon,ji=Pe.clearIcon,Ba=Pe.OptionList,$a=Pe.animation,Aa=Pe.transitionName,ca=Pe.dropdownStyle,Yi=Pe.dropdownClassName,Mi=Pe.dropdownMatchSelectWidth,Oa=Pe.dropdownRender,ki=Pe.dropdownAlign,Qr=Pe.placement,zi=Pe.builtinPlacements,ua=Pe.getPopupContainer,Ui=Pe.showAction,ia=Ui===void 0?[]:Ui,hi=Pe.onFocus,pa=Pe.onBlur,xa=Pe.onKeyUp,fa=Pe.onKeyDown,wa=Pe.onMouseDown,Ea=(0,Se.Z)(Pe,vt),Va=Tn(zr),ha=(On!==void 0?On:Va)||zr==="combobox",ka=(0,_e.Z)({},Ea);Qt.forEach(function(Ia){delete ka[Ia]}),Nn==null||Nn.forEach(function(Ia){delete ka[Ia]});var Ja=Te.useState(!1),Ga=(0,Le.Z)(Ja,2),so=Ga[0],Fa=Ga[1];Te.useEffect(function(){Fa(wt())},[]);var Ca=Te.useRef(null),_i=Te.useRef(null),Ki=Te.useRef(null),da=Te.useRef(null),Sa=Te.useRef(null),Ka=bn(),io=(0,Le.Z)(Ka,3),ho=io[0],Oo=io[1],Ro=io[2];Te.useImperativeHandle($e,function(){var Ia,ma;return{focus:(Ia=da.current)===null||Ia===void 0?void 0:Ia.focus,blur:(ma=da.current)===null||ma===void 0?void 0:ma.blur,scrollTo:function(es){var ga;return(ga=Sa.current)===null||ga===void 0?void 0:ga.scrollTo(es)}}});var lo=Te.useMemo(function(){var Ia;if(zr!=="combobox")return Xi;var ma=(Ia=Fn[0])===null||Ia===void 0?void 0:Ia.value;return typeof ma=="string"||typeof ma=="number"?String(ma):""},[Xi,zr,Fn]),Ao=zr==="combobox"&&typeof Jr=="function"&&Jr()||null,na=typeof ai=="function"&&ai(),Oi=vn(_i,na==null||(xt=na.props)===null||xt===void 0?void 0:xt.ref),Ta=Te.useState(!1),_a=(0,Le.Z)(Ta,2),co=_a[0],ao=_a[1];kt(function(){ao(!0)},[]);var hs=Dt(!1,{defaultValue:ci,value:Ir}),Qo=(0,Le.Z)(hs,2),ps=Qo[0],aa=Qo[1],Ar=co?ps:!1,xi=!Zr&&Bn;(xr||xi&&Ar&&zr==="combobox")&&(Ar=!1);var wi=xi?!1:Ar,Di=Te.useCallback(function(Ia){var ma=Ia!==void 0?Ia:!Ar;xr||(aa(ma),Ar!==ma&&(Pi==null||Pi(ma)))},[xr,Ar,aa,Pi]),Ha=Te.useMemo(function(){return(jr||[]).some(function(Ia){return[`
`,`\r
`].includes(Ia)})},[jr]),ja=function(ma,Ho,es){var ga=!0,za=ma;Vi==null||Vi(null);var Ra=es?null:Qe(ma,jr);return zr!=="combobox"&&Ra&&(za="",$i==null||$i(Ra),Di(!1),ga=!1),bi&&lo!==za&&bi(za,{source:Ho?"typing":"effect"}),ga},Fo=function(ma){!ma||!ma.trim()||bi(ma,{source:"submit"})};Te.useEffect(function(){!Ar&&!Va&&zr!=="combobox"&&ja("",!1,!1)},[Ar]),Te.useEffect(function(){ps&&xr&&aa(!1),xr&&Oo(!1)},[xr]);var Uo=at(),ls=(0,Le.Z)(Uo,2),va=ls[0],No=ls[1],cs=function(ma){var Ho=va(),es=ma.which;if(es===je.ENTER&&(zr!=="combobox"&&ma.preventDefault(),Ar||Di(!0)),No(!!lo),es===je.BACKSPACE&&!Ho&&Va&&!lo&&Fn.length){for(var ga=(0,Ye.Z)(Fn),za=null,Ra=ga.length-1;Ra>=0;Ra-=1){var po=ga[Ra];if(!po.disabled){ga.splice(Ra,1),za=po;break}}za&&mr(ga,{type:"remove",values:[za]})}for(var is=arguments.length,Hs=new Array(is>1?is-1:0),gs=1;gs<is;gs++)Hs[gs-1]=arguments[gs];if(Ar&&Sa.current){var Jl;(Jl=Sa.current).onKeyDown.apply(Jl,[ma].concat(Hs))}fa==null||fa.apply(void 0,[ma].concat(Hs))},ul=function(ma){for(var Ho=arguments.length,es=new Array(Ho>1?Ho-1:0),ga=1;ga<Ho;ga++)es[ga-1]=arguments[ga];if(Ar&&Sa.current){var za;(za=Sa.current).onKeyUp.apply(za,[ma].concat(es))}xa==null||xa.apply(void 0,[ma].concat(es))},As=function(ma){var Ho=Fn.filter(function(es){return es!==ma});mr(Ho,{type:"remove",values:[ma]})},ms=Te.useRef(!1),zo=function(){Oo(!0),xr||(hi&&!ms.current&&hi.apply(void 0,arguments),ia.includes("focus")&&Di(!0)),ms.current=!0},Ts=function(){Oo(!1,function(){ms.current=!1,Di(!1)}),!xr&&(lo&&(zr==="tags"?bi(lo,{source:"submit"}):zr==="multiple"&&bi("",{source:"blur"})),pa&&pa.apply(void 0,arguments))},Ds=[];Te.useEffect(function(){return function(){Ds.forEach(function(Ia){return clearTimeout(Ia)}),Ds.splice(0,Ds.length)}},[]);var Ys=function(ma){var Ho,es=ma.target,ga=(Ho=Ki.current)===null||Ho===void 0?void 0:Ho.getPopupElement();if(ga&&ga.contains(es)){var za=setTimeout(function(){var Hs=Ds.indexOf(za);if(Hs!==-1&&Ds.splice(Hs,1),Ro(),!so&&!ga.contains(document.activeElement)){var gs;(gs=da.current)===null||gs===void 0||gs.focus()}});Ds.push(za)}for(var Ra=arguments.length,po=new Array(Ra>1?Ra-1:0),is=1;is<Ra;is++)po[is-1]=arguments[is];wa==null||wa.apply(void 0,[ma].concat(po))},oo=Te.useState({}),Da=(0,Le.Z)(oo,2),Xa=Da[1];function go(){Xa({})}var yo;na&&(yo=function(ma){Di(ma)}),ft(function(){var Ia;return[Ca.current,(Ia=Ki.current)===null||Ia===void 0?void 0:Ia.getPopupElement()]},wi,Di,!!na);var Ko=Te.useMemo(function(){return(0,_e.Z)((0,_e.Z)({},Pe),{},{notFoundContent:Zr,open:Ar,triggerOpen:wi,id:It,showSearch:ha,multiple:Va,toggleOpen:Di})},[Pe,Zr,wi,Ar,It,ha,Va,Di]),wo=!!Ti||Or,xs;wo&&(xs=Te.createElement(qe,{className:tt()("".concat(rn,"-arrow"),(0,be.Z)({},"".concat(rn,"-arrow-loading"),Or)),customizeIcon:Ti,customizeIconProps:{loading:Or,searchValue:lo,open:Ar,focused:ho,showSearch:ha}}));var Xl=function(){var ma;Dr==null||Dr(),(ma=da.current)===null||ma===void 0||ma.focus(),mr([],{type:"clear",values:Fn}),ja("",!1,!1)},ql=Ae(rn,Xl,Fn,di,ji,xr,lo,zr),vc=ql.allowClear,Xc=ql.clearIcon,Ks=Te.createElement(Ba,{ref:Sa}),Is=tt()(rn,fn,(rt={},(0,be.Z)(rt,"".concat(rn,"-focused"),ho),(0,be.Z)(rt,"".concat(rn,"-multiple"),Va),(0,be.Z)(rt,"".concat(rn,"-single"),!Va),(0,be.Z)(rt,"".concat(rn,"-allow-clear"),di),(0,be.Z)(rt,"".concat(rn,"-show-arrow"),wo),(0,be.Z)(rt,"".concat(rn,"-disabled"),xr),(0,be.Z)(rt,"".concat(rn,"-loading"),Or),(0,be.Z)(rt,"".concat(rn,"-open"),Ar),(0,be.Z)(rt,"".concat(rn,"-customize-input"),Ao),(0,be.Z)(rt,"".concat(rn,"-show-search"),ha),rt)),yc=Te.createElement(Cr,{ref:Ki,disabled:xr,prefixCls:rn,visible:wi,popupElement:Ks,animation:$a,transitionName:Aa,dropdownStyle:ca,dropdownClassName:Yi,direction:Xt,dropdownMatchSelectWidth:Mi,dropdownRender:Oa,dropdownAlign:ki,placement:Qr,builtinPlacements:zi,getPopupContainer:ua,empty:Bn,getTriggerDOMNode:function(){return _i.current},onPopupVisibleChange:yo,onPopupMouseEnter:go},na?Te.cloneElement(na,{ref:Oi}):Te.createElement(ut,(0,Fe.Z)({},Pe,{domRef:_i,prefixCls:rn,inputElement:Ao,ref:da,id:It,showSearch:ha,autoClearSearchValue:qi,mode:zr,activeDescendantId:Bi,tagRender:wn,values:Fn,open:Ar,onToggleOpen:Di,activeValue:ta,searchValue:lo,onSearch:ja,onSearchSubmit:Fo,onRemove:As,tokenWithEnter:Ha}))),Yl;return na?Yl=yc:Yl=Te.createElement("div",(0,Fe.Z)({className:Is},ka,{ref:Ca,onMouseDown:Ys,onKeyDown:cs,onKeyUp:ul,onFocus:zo,onBlur:Ts}),ho&&!Ar&&Te.createElement("span",{style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0},"aria-live":"polite"},"".concat(Fn.map(function(Ia){var ma=Ia.label,Ho=Ia.value;return["number","string"].includes((0,pe.Z)(ma))?ma:Ho}).join(", "))),yc,xs,vc&&Xc),Te.createElement($t.Provider,{value:Ko},Yl)}),cn=en,un=function(Pe,$e){var xt=Te.useRef({values:new Map,options:new Map}),rt=Te.useMemo(function(){var rn=xt.current,fn=rn.values,On=rn.options,wn=Pe.map(function(Fn){if(Fn.label===void 0){var mr;return(0,_e.Z)((0,_e.Z)({},Fn),{},{label:(mr=fn.get(Fn.value))===null||mr===void 0?void 0:mr.label})}return Fn}),Xt=new Map,Nn=new Map;return wn.forEach(function(Fn){Xt.set(Fn.value,Fn),Nn.set(Fn.value,$e.get(Fn.value)||On.get(Fn.value))}),xt.current.values=Xt,xt.current.options=Nn,wn},[Pe,$e]),It=Te.useCallback(function(rn){return $e.get(rn)||xt.current.options.get(rn)},[$e]);return[rt,It]};function Dn(Pe,$e){return sa(Pe).join("").toUpperCase().includes($e)}var or=function(Pe,$e,xt,rt,It){return Te.useMemo(function(){if(!xt||rt===!1)return Pe;var rn=$e.options,fn=$e.label,On=$e.value,wn=[],Xt=typeof rt=="function",Nn=xt.toUpperCase(),Fn=Xt?rt:function(Bn,Lr){return It?Dn(Lr[It],Nn):Lr[rn]?Dn(Lr[fn!=="children"?fn:"label"],Nn):Dn(Lr[On],Nn)},mr=Xt?function(Bn){return ot(Bn)}:function(Bn){return Bn};return Pe.forEach(function(Bn){if(Bn[rn]){var Lr=Fn(xt,mr(Bn));if(Lr)wn.push(Bn);else{var Zr=Bn[rn].filter(function(Dr){return Fn(xt,mr(Dr))});Zr.length&&wn.push((0,_e.Z)((0,_e.Z)({},Bn),{},(0,be.Z)({},rn,Zr)))}return}Fn(xt,mr(Bn))&&wn.push(Bn)}),wn},[Pe,rt,It,xt,$e])},Kt=0,Yr=ze();function $r(){var Pe;return Yr?(Pe=Kt,Kt+=1):Pe="TEST_OR_SSR",Pe}function Ri(Pe){var $e=Te.useState(),xt=(0,Le.Z)($e,2),rt=xt[0],It=xt[1];return Te.useEffect(function(){It("rc_select_".concat($r()))},[]),Pe||rt}function Li(Pe){var $e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},xt=[];return Te.Children.forEach(Pe,function(rt){rt==null&&!$e.keepEmpty||(Array.isArray(rt)?xt=xt.concat(Li(rt)):(0,Rt.isFragment)(rt)&&rt.props?xt=xt.concat(Li(rt.props.children,$e)):xt.push(rt))}),xt}var pi=["children","value"],Gi=["children"];function yi(Pe){var $e=Pe,xt=$e.key,rt=$e.props,It=rt.children,rn=rt.value,fn=(0,Se.Z)(rt,pi);return(0,_e.Z)({key:xt,value:rn!==void 0?rn:xt,children:It},fn)}function ii(Pe){var $e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Li(Pe).map(function(xt,rt){if(!Te.isValidElement(xt)||!xt.type)return null;var It=xt,rn=It.type.isSelectOptGroup,fn=It.key,On=It.props,wn=On.children,Xt=(0,Se.Z)(On,Gi);return $e||!rn?yi(xt):(0,_e.Z)((0,_e.Z)({key:"__RC_SELECT_GRP__".concat(fn===null?rt:fn,"__"),label:fn},Xt),{},{options:ii(wn)})}).filter(function(xt){return xt})}function Ni(Pe,$e,xt,rt,It){return Te.useMemo(function(){var rn=Pe,fn=!Pe;fn&&(rn=ii($e));var On=new Map,wn=new Map,Xt=function(mr,Bn,Lr){Lr&&typeof Lr=="string"&&mr.set(Bn[Lr],Bn)};function Nn(Fn){for(var mr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Bn=0;Bn<Fn.length;Bn+=1){var Lr=Fn[Bn];!Lr[xt.options]||mr?(On.set(Lr[xt.value],Lr),Xt(wn,Lr,xt.label),Xt(wn,Lr,rt),Xt(wn,Lr,It)):Nn(Lr[xt.options],!0)}}return Nn(rn),{options:rn,valueOptions:On,labelOptions:wn}},[Pe,$e,xt,rt,It])}function Zi(Pe){var $e=Te.useRef();$e.current=Pe;var xt=Te.useCallback(function(){return $e.current.apply($e,arguments)},[]);return xt}var Vr=function(){return null};Vr.isSelectOptGroup=!0;var mi=Vr,Wi=function(){return null};Wi.isSelectOption=!0;var la=Wi;function ea(Pe,$e){var xt=(0,_e.Z)({},Pe);return Array.isArray($e)&&$e.forEach(function(rt){delete xt[rt]}),xt}var ti=ce(73299),yt=Te.createContext(null),ht=yt;function Bt(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var an=["disabled","title","children","style","className"];function kn(Pe){return typeof Pe=="string"||typeof Pe=="number"}var ur=function($e,xt){var rt=Hn(),It=rt.prefixCls,rn=rt.id,fn=rt.open,On=rt.multiple,wn=rt.mode,Xt=rt.searchValue,Nn=rt.toggleOpen,Fn=rt.notFoundContent,mr=rt.onPopupScroll,Bn=Te.useContext(ht),Lr=Bn.flattenOptions,Zr=Bn.onActiveValue,Dr=Bn.defaultActiveFirstOption,zr=Bn.onSelect,xr=Bn.menuItemSelectedIcon,Or=Bn.rawValues,Jr=Bn.fieldNames,ai=Bn.virtual,Ir=Bn.direction,ci=Bn.listHeight,Pi=Bn.listItemHeight,ta="".concat(It,"-item"),Vi=At(function(){return Lr},[fn,Lr],function(ki,Qr){return Qr[0]&&ki[1]!==Qr[1]}),Bi=Te.useRef(null),Xi=function(Qr){Qr.preventDefault()},qi=function(Qr){Bi.current&&Bi.current.scrollTo(typeof Qr=="number"?{index:Qr}:Qr)},bi=function(Qr){for(var zi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ua=Vi.length,Ui=0;Ui<ua;Ui+=1){var ia=(Qr+Ui*zi+ua)%ua,hi=Vi[ia],pa=hi.group,xa=hi.data;if(!pa&&!xa.disabled)return ia}return-1},$i=Te.useState(function(){return bi(0)}),jr=(0,Le.Z)($i,2),di=jr[0],Ti=jr[1],ji=function(Qr){var zi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Ti(Qr);var ua={source:zi?"keyboard":"mouse"},Ui=Vi[Qr];if(!Ui){Zr(null,-1,ua);return}Zr(Ui.value,Qr,ua)};(0,Te.useEffect)(function(){ji(Dr!==!1?bi(0):-1)},[Vi.length,Xt]);var Ba=Te.useCallback(function(ki){return Or.has(ki)&&wn!=="combobox"},[wn,(0,Ye.Z)(Or).toString(),Or.size]);(0,Te.useEffect)(function(){var ki=setTimeout(function(){if(!On&&fn&&Or.size===1){var zi=Array.from(Or)[0],ua=Vi.findIndex(function(Ui){var ia=Ui.data;return ia.value===zi});ua!==-1&&(ji(ua),qi(ua))}});if(fn){var Qr;(Qr=Bi.current)===null||Qr===void 0||Qr.scrollTo(void 0)}return function(){return clearTimeout(ki)}},[fn,Xt,Lr.length]);var $a=function(Qr){Qr!==void 0&&zr(Qr,{selected:!Or.has(Qr)}),On||Nn(!1)};if(Te.useImperativeHandle(xt,function(){return{onKeyDown:function(Qr){var zi=Qr.which,ua=Qr.ctrlKey;switch(zi){case je.N:case je.P:case je.UP:case je.DOWN:{var Ui=0;if(zi===je.UP?Ui=-1:zi===je.DOWN?Ui=1:Bt()&&ua&&(zi===je.N?Ui=1:zi===je.P&&(Ui=-1)),Ui!==0){var ia=bi(di+Ui,Ui);qi(ia),ji(ia,!0)}break}case je.ENTER:{var hi=Vi[di];hi&&!hi.data.disabled?$a(hi.value):$a(void 0),fn&&Qr.preventDefault();break}case je.ESC:Nn(!1),fn&&Qr.stopPropagation()}},onKeyUp:function(){},scrollTo:function(Qr){qi(Qr)}}}),Vi.length===0)return Te.createElement("div",{role:"listbox",id:"".concat(rn,"_list"),className:"".concat(ta,"-empty"),onMouseDown:Xi},Fn);var Aa=Object.keys(Jr).map(function(ki){return Jr[ki]}),ca=function(Qr){return Qr.label};function Yi(ki,Qr){var zi=ki.group;return{role:zi?"presentation":"option",id:"".concat(rn,"_list_").concat(Qr)}}var Mi=function(Qr){var zi=Vi[Qr];if(!zi)return null;var ua=zi.data||{},Ui=ua.value,ia=zi.group,hi=_n(ua,!0),pa=ca(zi);return zi?Te.createElement("div",(0,Fe.Z)({"aria-label":typeof pa=="string"&&!ia?pa:null},hi,{key:Qr},Yi(zi,Qr),{"aria-selected":Ba(Ui)}),Ui):null},Oa={role:"listbox",id:"".concat(rn,"_list")};return Te.createElement(Te.Fragment,null,ai&&Te.createElement("div",(0,Fe.Z)({},Oa,{style:{height:0,width:0,overflow:"hidden"}}),Mi(di-1),Mi(di),Mi(di+1)),Te.createElement(ti.Z,{itemKey:"key",ref:Bi,data:Vi,height:ci,itemHeight:Pi,fullHeight:!1,onMouseDown:Xi,onScroll:mr,virtual:ai,direction:Ir,innerProps:ai?null:Oa},function(ki,Qr){var zi,ua=ki.group,Ui=ki.groupOption,ia=ki.data,hi=ki.label,pa=ki.value,xa=ia.key;if(ua){var fa,wa=(fa=ia.title)!==null&&fa!==void 0?fa:kn(hi)?hi.toString():void 0;return Te.createElement("div",{className:tt()(ta,"".concat(ta,"-group")),title:wa},hi!==void 0?hi:xa)}var Ea=ia.disabled,Va=ia.title,ha=ia.children,ka=ia.style,Ja=ia.className,Ga=(0,Se.Z)(ia,an),so=ea(Ga,Aa),Fa=Ba(pa),Ca="".concat(ta,"-option"),_i=tt()(ta,Ca,Ja,(zi={},(0,be.Z)(zi,"".concat(Ca,"-grouped"),Ui),(0,be.Z)(zi,"".concat(Ca,"-active"),di===Qr&&!Ea),(0,be.Z)(zi,"".concat(Ca,"-disabled"),Ea),(0,be.Z)(zi,"".concat(Ca,"-selected"),Fa),zi)),Ki=ca(ki),da=!xr||typeof xr=="function"||Fa,Sa=typeof Ki=="number"?Ki:Ki||pa,Ka=kn(Sa)?Sa.toString():void 0;return Va!==void 0&&(Ka=Va),Te.createElement("div",(0,Fe.Z)({},_n(so),ai?{}:Yi(ki,Qr),{"aria-selected":Fa,className:_i,title:Ka,onMouseMove:function(){di===Qr||Ea||ji(Qr)},onClick:function(){Ea||$a(pa)},style:ka}),Te.createElement("div",{className:"".concat(Ca,"-content")},Sa),Te.isValidElement(xr)||Fa,da&&Te.createElement(qe,{className:"".concat(ta,"-option-state"),customizeIcon:xr,customizeIconProps:{isSelected:Fa}},Fa?"\u2713":null))}))},Er=Te.forwardRef(ur);Er.displayName="OptionList";var Br=Er;function Hr(Pe){var $e=Pe.mode,xt=Pe.options,rt=Pe.children,It=Pe.backfill,rn=Pe.allowClear,fn=Pe.placeholder,On=Pe.getInputElement,wn=Pe.showSearch,Xt=Pe.onSearch,Nn=Pe.defaultOpen,Fn=Pe.autoFocus,mr=Pe.labelInValue,Bn=Pe.value,Lr=Pe.inputValue,Zr=Pe.optionLabelProp,Dr=isMultiple($e),zr=wn!==void 0?wn:Dr||$e==="combobox",xr=xt||convertChildrenToData(rt);if(warning($e!=="tags"||xr.every(function(Ir){return!Ir.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),$e==="tags"||$e==="combobox"){var Or=xr.some(function(Ir){return Ir.options?Ir.options.some(function(ci){return typeof("value"in ci?ci.value:ci.key)=="number"}):typeof("value"in Ir?Ir.value:Ir.key)=="number"});warning(!Or,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning($e!=="combobox"||!Zr,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning($e==="combobox"||!It,"`backfill` only works with `combobox` mode."),warning($e==="combobox"||!On,"`getInputElement` only work with `combobox` mode."),noteOnce($e!=="combobox"||!On||!rn||!fn,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Xt&&!zr&&$e!=="combobox"&&$e!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!Nn||Fn,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Bn!=null){var Jr=toArray(Bn);warning(!mr||Jr.every(function(Ir){return _typeof(Ir)==="object"&&("key"in Ir||"value"in Ir)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!Dr||Array.isArray(Bn),"`value` should be array when `mode` is `multiple` or `tags`")}if(rt){var ai=null;toNodeArray(rt).some(function(Ir){if(!React.isValidElement(Ir)||!Ir.type)return!1;var ci=Ir,Pi=ci.type;if(Pi.isSelectOption)return!1;if(Pi.isSelectOptGroup){var ta=toNodeArray(Ir.props.children).every(function(Vi){return!React.isValidElement(Vi)||!Ir.type||Vi.type.isSelectOption?!0:(ai=Vi.type,!1)});return!ta}return ai=Pi,!0}),ai&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ai.displayName||ai.name||ai,"`.")),warning(Lr===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function Nr(Pe,$e){if(Pe){var xt=function rt(It){for(var rn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,fn=0;fn<It.length;fn++){var On=It[fn];if(On[$e==null?void 0:$e.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!rn&&Array.isArray(On[$e==null?void 0:$e.options])&&rt(On[$e==null?void 0:$e.options],!0))break}};xt(Pe)}}var ei=null,gi=["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"],Mr=["inputValue"];function fi(Pe){return!Pe||(0,pe.Z)(Pe)!=="object"}var Ai=Te.forwardRef(function(Pe,$e){var xt=Pe.id,rt=Pe.mode,It=Pe.prefixCls,rn=It===void 0?"rc-select":It,fn=Pe.backfill,On=Pe.fieldNames,wn=Pe.inputValue,Xt=Pe.searchValue,Nn=Pe.onSearch,Fn=Pe.autoClearSearchValue,mr=Fn===void 0?!0:Fn,Bn=Pe.onSelect,Lr=Pe.onDeselect,Zr=Pe.dropdownMatchSelectWidth,Dr=Zr===void 0?!0:Zr,zr=Pe.filterOption,xr=Pe.filterSort,Or=Pe.optionFilterProp,Jr=Pe.optionLabelProp,ai=Pe.options,Ir=Pe.children,ci=Pe.defaultActiveFirstOption,Pi=Pe.menuItemSelectedIcon,ta=Pe.virtual,Vi=Pe.direction,Bi=Pe.listHeight,Xi=Bi===void 0?200:Bi,qi=Pe.listItemHeight,bi=qi===void 0?20:qi,$i=Pe.value,jr=Pe.defaultValue,di=Pe.labelInValue,Ti=Pe.onChange,ji=(0,Se.Z)(Pe,gi),Ba=Ri(xt),$a=Tn(rt),Aa=!!(!ai&&Ir),ca=Te.useMemo(function(){return zr===void 0&&rt==="combobox"?!1:zr},[zr,rt]),Yi=Te.useMemo(function(){return rr(On,Aa)},[JSON.stringify(On),Aa]),Mi=Dt("",{value:Xt!==void 0?Xt:wn,postState:function(xi){return xi||""}}),Oa=(0,Le.Z)(Mi,2),ki=Oa[0],Qr=Oa[1],zi=Ni(ai,Ir,Yi,Or,Jr),ua=zi.valueOptions,Ui=zi.labelOptions,ia=zi.options,hi=Te.useCallback(function(Ar){var xi=sa(Ar);return xi.map(function(wi){var Di,Ha,ja,Fo,Uo;if(fi(wi))Di=wi;else{var ls;ja=wi.key,Ha=wi.label,Di=(ls=wi.value)!==null&&ls!==void 0?ls:ja}var va=ua.get(Di);if(va){var No;if(Ha===void 0&&(Ha=va==null?void 0:va[Jr||Yi.label]),ja===void 0&&(ja=(No=va==null?void 0:va.key)!==null&&No!==void 0?No:Di),Fo=va==null?void 0:va.disabled,Uo=va==null?void 0:va.title,0)var cs}return{label:Ha,value:Di,key:ja,disabled:Fo,title:Uo}})},[Yi,Jr,ua]),pa=Dt(jr,{value:$i}),xa=(0,Le.Z)(pa,2),fa=xa[0],wa=xa[1],Ea=Te.useMemo(function(){var Ar,xi=hi(fa);return rt==="combobox"&&mt((Ar=xi[0])===null||Ar===void 0?void 0:Ar.value)?[]:xi},[fa,hi,rt]),Va=un(Ea,ua),ha=(0,Le.Z)(Va,2),ka=ha[0],Ja=ha[1],Ga=Te.useMemo(function(){if(!rt&&ka.length===1){var Ar=ka[0];if(Ar.value===null&&(Ar.label===null||Ar.label===void 0))return[]}return ka.map(function(xi){var wi;return(0,_e.Z)((0,_e.Z)({},xi),{},{label:(wi=xi.label)!==null&&wi!==void 0?wi:xi.value})})},[rt,ka]),so=Te.useMemo(function(){return new Set(ka.map(function(Ar){return Ar.value}))},[ka]);Te.useEffect(function(){if(rt==="combobox"){var Ar,xi=(Ar=ka[0])===null||Ar===void 0?void 0:Ar.value;Qr(Ci(xi)?String(xi):"")}},[ka]);var Fa=Zi(function(Ar,xi){var wi,Di=xi!=null?xi:Ar;return wi={},(0,be.Z)(wi,Yi.value,Ar),(0,be.Z)(wi,Yi.label,Di),wi}),Ca=Te.useMemo(function(){if(rt!=="tags")return ia;var Ar=(0,Ye.Z)(ia),xi=function(Di){return ua.has(Di)};return(0,Ye.Z)(ka).sort(function(wi,Di){return wi.value<Di.value?-1:1}).forEach(function(wi){var Di=wi.value;xi(Di)||Ar.push(Fa(Di,wi.label))}),Ar},[Fa,ia,ua,ka,rt]),_i=or(Ca,Yi,ki,ca,Or),Ki=Te.useMemo(function(){return rt!=="tags"||!ki||_i.some(function(Ar){return Ar[Or||"value"]===ki})||_i.some(function(Ar){return Ar[Yi.value]===ki})?_i:[Fa(ki)].concat((0,Ye.Z)(_i))},[Fa,Or,rt,_i,ki,Yi]),da=Te.useMemo(function(){return xr?(0,Ye.Z)(Ki).sort(function(Ar,xi){return xr(Ar,xi)}):Ki},[Ki,xr]),Sa=Te.useMemo(function(){return ar(da,{fieldNames:Yi,childrenAsData:Aa})},[da,Yi,Aa]),Ka=function(xi){var wi=hi(xi);if(wa(wi),Ti&&(wi.length!==ka.length||wi.some(function(ja,Fo){var Uo;return((Uo=ka[Fo])===null||Uo===void 0?void 0:Uo.value)!==(ja==null?void 0:ja.value)}))){var Di=di?wi:wi.map(function(ja){return ja.value}),Ha=wi.map(function(ja){return ot(Ja(ja.value))});Ti($a?Di:Di[0],$a?Ha:Ha[0])}},io=Te.useState(null),ho=(0,Le.Z)(io,2),Oo=ho[0],Ro=ho[1],lo=Te.useState(0),Ao=(0,Le.Z)(lo,2),na=Ao[0],Oi=Ao[1],Ta=ci!==void 0?ci:rt!=="combobox",_a=Te.useCallback(function(Ar,xi){var wi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Di=wi.source,Ha=Di===void 0?"keyboard":Di;Oi(xi),fn&&rt==="combobox"&&Ar!==null&&Ha==="keyboard"&&Ro(String(Ar))},[fn,rt]),co=function(xi,wi,Di){var Ha=function(){var ms,zo=Ja(xi);return[di?{label:zo==null?void 0:zo[Yi.label],value:xi,key:(ms=zo==null?void 0:zo.key)!==null&&ms!==void 0?ms:xi}:xi,ot(zo)]};if(wi&&Bn){var ja=Ha(),Fo=(0,Le.Z)(ja,2),Uo=Fo[0],ls=Fo[1];Bn(Uo,ls)}else if(!wi&&Lr&&Di!=="clear"){var va=Ha(),No=(0,Le.Z)(va,2),cs=No[0],ul=No[1];Lr(cs,ul)}},ao=Zi(function(Ar,xi){var wi,Di=$a?xi.selected:!0;Di?wi=$a?[].concat((0,Ye.Z)(ka),[Ar]):[Ar]:wi=ka.filter(function(Ha){return Ha.value!==Ar}),Ka(wi),co(Ar,Di),rt==="combobox"?Ro(""):(!Tn||mr)&&(Qr(""),Ro(""))}),hs=function(xi,wi){Ka(xi);var Di=wi.type,Ha=wi.values;(Di==="remove"||Di==="clear")&&Ha.forEach(function(ja){co(ja.value,!1,Di)})},Qo=function(xi,wi){if(Qr(xi),Ro(null),wi.source==="submit"){var Di=(xi||"").trim();if(Di){var Ha=Array.from(new Set([].concat((0,Ye.Z)(so),[Di])));Ka(Ha),co(Di,!0),Qr("")}return}wi.source!=="blur"&&(rt==="combobox"&&Ka(xi),Nn==null||Nn(xi))},ps=function(xi){var wi=xi;rt!=="tags"&&(wi=xi.map(function(Ha){var ja=Ui.get(Ha);return ja==null?void 0:ja.value}).filter(function(Ha){return Ha!==void 0}));var Di=Array.from(new Set([].concat((0,Ye.Z)(so),(0,Ye.Z)(wi))));Ka(Di),Di.forEach(function(Ha){co(Ha,!0)})},aa=Te.useMemo(function(){var Ar=ta!==!1&&Dr!==!1;return(0,_e.Z)((0,_e.Z)({},zi),{},{flattenOptions:Sa,onActiveValue:_a,defaultActiveFirstOption:Ta,onSelect:ao,menuItemSelectedIcon:Pi,rawValues:so,fieldNames:Yi,virtual:Ar,direction:Vi,listHeight:Xi,listItemHeight:bi,childrenAsData:Aa})},[zi,Sa,_a,Ta,ao,Pi,so,Yi,ta,Dr,Xi,bi,Aa]);return Te.createElement(ht.Provider,{value:aa},Te.createElement(cn,(0,Fe.Z)({},ji,{id:Ba,prefixCls:rn,ref:$e,omitDomProps:Mr,mode:rt,displayValues:Ga,onDisplayValuesChange:hs,direction:Vi,searchValue:ki,onSearch:Qo,autoClearSearchValue:mr,onSearchSplit:ps,dropdownMatchSelectWidth:Dr,OptionList:Br,emptyOptions:!Sa.length,activeValue:Oo,activeDescendantId:"".concat(Ba,"_list_").concat(na)})))}),Si=Ai;Si.Option=la,Si.OptGroup=mi;var Ce=Si,Ne=Ce,Be=ce(10366),He=ce(8745),Ge=ce(33603),et=ce(9708),bt=ce(53124),Zt=ce(98866),Jt=ce(88258),Gn=ce(98675),fr=ce(65223),Wn=ce(4173),pn=ce(87244),dn=ce(13458),Cn=ce(78642),In=ce(46163),cr=function(Pe,$e){var xt={};for(var rt in Pe)Object.prototype.hasOwnProperty.call(Pe,rt)&&$e.indexOf(rt)<0&&(xt[rt]=Pe[rt]);if(Pe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var It=0,rt=Object.getOwnPropertySymbols(Pe);It<rt.length;It++)$e.indexOf(rt[It])<0&&Object.prototype.propertyIsEnumerable.call(Pe,rt[It])&&(xt[rt[It]]=Pe[rt[It]]);return xt};const jn="SECRET_COMBOBOX_MODE_DO_NOT_USE",Zn=(Pe,$e)=>{var xt,{prefixCls:rt,bordered:It=!0,className:rn,rootClassName:fn,getPopupContainer:On,popupClassName:wn,dropdownClassName:Xt,listHeight:Nn=256,placement:Fn,listItemHeight:mr=24,size:Bn,disabled:Lr,notFoundContent:Zr,status:Dr,builtinPlacements:zr,dropdownMatchSelectWidth:xr,popupMatchSelectWidth:Or,direction:Jr,style:ai,allowClear:Ir}=Pe,ci=cr(Pe,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:Pi,getPrefixCls:ta,renderEmpty:Vi,direction:Bi,virtual:Xi,popupMatchSelectWidth:qi,popupOverflow:bi,select:$i}=Te.useContext(bt.E_),jr=ta("select",rt),di=ta(),Ti=Jr!=null?Jr:Bi,{compactSize:ji,compactItemClassnames:Ba}=(0,Wn.ri)(jr,Ti),[$a,Aa]=(0,pn.Z)(jr),ca=Te.useMemo(()=>{const{mode:Ca}=ci;if(Ca!=="combobox")return Ca===jn?"combobox":Ca},[ci.mode]),Yi=ca==="multiple"||ca==="tags",Mi=(0,Cn.Z)(ci.suffixIcon,ci.showArrow),Oa=(xt=Or!=null?Or:xr)!==null&&xt!==void 0?xt:qi,{status:ki,hasFeedback:Qr,isFormItemInput:zi,feedbackIcon:ua}=Te.useContext(fr.aM),Ui=(0,et.F)(ki,Dr);let ia;Zr!==void 0?ia=Zr:ca==="combobox"?ia=null:ia=(Vi==null?void 0:Vi("Select"))||Te.createElement(Jt.Z,{componentName:"Select"});const{suffixIcon:hi,itemIcon:pa,removeIcon:xa,clearIcon:fa}=(0,In.Z)(Object.assign(Object.assign({},ci),{multiple:Yi,hasFeedback:Qr,feedbackIcon:ua,showSuffixIcon:Mi,prefixCls:jr,showArrow:ci.showArrow,componentName:"Select"})),wa=Ir===!0?{clearIcon:fa}:Ir,Ea=(0,Be.Z)(ci,["suffixIcon","itemIcon"]),Va=tt()(wn||Xt,{[`${jr}-dropdown-${Ti}`]:Ti==="rtl"},fn,Aa),ha=(0,Gn.Z)(Ca=>{var _i;return(_i=Bn!=null?Bn:ji)!==null&&_i!==void 0?_i:Ca}),ka=Te.useContext(Zt.Z),Ja=Lr!=null?Lr:ka,Ga=tt()({[`${jr}-lg`]:ha==="large",[`${jr}-sm`]:ha==="small",[`${jr}-rtl`]:Ti==="rtl",[`${jr}-borderless`]:!It,[`${jr}-in-form-item`]:zi},(0,et.Z)(jr,Ui,Qr),Ba,$i==null?void 0:$i.className,rn,fn,Aa),so=Te.useMemo(()=>Fn!==void 0?Fn:Ti==="rtl"?"bottomRight":"bottomLeft",[Fn,Ti]),Fa=(0,dn.Z)(zr,bi);return $a(Te.createElement(Ne,Object.assign({ref:$e,virtual:Xi,showSearch:$i==null?void 0:$i.showSearch},Ea,{style:Object.assign(Object.assign({},$i==null?void 0:$i.style),ai),dropdownMatchSelectWidth:Oa,builtinPlacements:Fa,transitionName:(0,Ge.m)(di,"slide-up",ci.transitionName),listHeight:Nn,listItemHeight:mr,mode:ca,prefixCls:jr,placement:so,direction:Ti,suffixIcon:hi,menuItemSelectedIcon:pa,removeIcon:xa,allowClear:wa,notFoundContent:ia,className:Ga,getPopupContainer:On||Pi,dropdownClassName:Va,disabled:Ja})))},Jn=Te.forwardRef(Zn),Qn=(0,He.Z)(Jn);Jn.SECRET_COMBOBOX_MODE_DO_NOT_USE=jn,Jn.Option=la,Jn.OptGroup=mi,Jn._InternalPanelDoNotUseOrYouWillBeFired=Qn;var hr=Jn},87244:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return Ie}});var fe=ce(14747),tt=ce(80110),Fe=ce(45503),Ye=ce(67968),be=ce(67771),_e=ce(33297);const Le=Me=>{const{optionHeight:Ve,optionFontSize:Xe,optionLineHeight:Ct,optionPadding:wt}=Me;return{position:"relative",display:"block",minHeight:Ve,padding:wt,color:Me.colorText,fontWeight:"normal",fontSize:Xe,lineHeight:Ct,boxSizing:"border-box"}};var pe=Me=>{const{antCls:Ve,componentCls:Xe}=Me,Ct=`${Xe}-item`,wt=`&${Ve}-slide-up-enter${Ve}-slide-up-enter-active`,Mt=`&${Ve}-slide-up-appear${Ve}-slide-up-appear-active`,je=`&${Ve}-slide-up-leave${Ve}-slide-up-leave-active`,Rt=`${Xe}-dropdown-placement-`;return[{[`${Xe}-dropdown`]:Object.assign(Object.assign({},(0,fe.Wf)(Me)),{position:"absolute",top:-9999,zIndex:Me.zIndexPopup,boxSizing:"border-box",padding:Me.paddingXXS,overflow:"hidden",fontSize:Me.fontSize,fontVariant:"initial",backgroundColor:Me.colorBgElevated,borderRadius:Me.borderRadiusLG,outline:"none",boxShadow:Me.boxShadowSecondary,[`
${wt}${Rt}bottomLeft,
${Mt}${Rt}bottomLeft
`]:{animationName:be.fJ},[`
${wt}${Rt}topLeft,
${Mt}${Rt}topLeft,
${wt}${Rt}topRight,
${Mt}${Rt}topRight
`]:{animationName:be.Qt},[`${je}${Rt}bottomLeft`]:{animationName:be.Uw},[`
${je}${Rt}topLeft,
${je}${Rt}topRight
`]:{animationName:be.ly},"&-hidden":{display:"none"},[`${Ct}`]:Object.assign(Object.assign({},Le(Me)),{cursor:"pointer",transition:`background ${Me.motionDurationSlow} ease`,borderRadius:Me.borderRadiusSM,"&-group":{color:Me.colorTextDescription,fontSize:Me.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},fe.vS),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${Ct}-option-disabled)`]:{backgroundColor:Me.optionActiveBg},[`&-selected:not(${Ct}-option-disabled)`]:{color:Me.optionSelectedColor,fontWeight:Me.optionSelectedFontWeight,backgroundColor:Me.optionSelectedBg,[`${Ct}-option-state`]:{color:Me.colorPrimary}},"&-disabled":{[`&${Ct}-option-selected`]:{backgroundColor:Me.colorBgContainerDisabled},color:Me.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:Me.controlPaddingHorizontal*2}}}),"&-rtl":{direction:"rtl"}})},(0,be.oN)(Me,"slide-up"),(0,be.oN)(Me,"slide-down"),(0,_e.Fm)(Me,"move-up"),(0,_e.Fm)(Me,"move-down")]};const Te=2,gt=Me=>{let{controlHeightSM:Ve,controlHeight:Xe,lineWidth:Ct}=Me;const wt=(Xe-Ve)/2-Ct,Mt=Math.ceil(wt/2);return[wt,Mt]};function ze(Me,Ve){const{componentCls:Xe,iconCls:Ct}=Me,wt=`${Xe}-selection-overflow`,Mt=Me.multipleSelectItemHeight,[je]=gt(Me),Rt=Ve?`${Xe}-${Ve}`:"";return{[`${Xe}-multiple${Rt}`]:{fontSize:Me.fontSize,[wt]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${Xe}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",padding:`${je-Te}px ${Te*2}px`,borderRadius:Me.borderRadius,[`${Xe}-show-search&`]:{cursor:"text"},[`${Xe}-disabled&`]:{background:Me.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${Te}px 0`,lineHeight:`${Mt}px`,visibility:"hidden",content:'"\\a0"'}},[`
&${Xe}-show-arrow ${Xe}-selector,
&${Xe}-allow-clear ${Xe}-selector
`]:{paddingInlineEnd:Me.fontSizeIcon+Me.controlPaddingHorizontal},[`${Xe}-selection-item`]:{position:"relative",display:"flex",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:Mt,marginTop:Te,marginBottom:Te,lineHeight:`${Mt-Me.lineWidth*2}px`,background:Me.multipleItemBg,border:`${Me.lineWidth}px ${Me.lineType} ${Me.multipleItemBorderColor}`,borderRadius:Me.borderRadiusSM,cursor:"default",transition:`font-size ${Me.motionDurationSlow}, line-height ${Me.motionDurationSlow}, height ${Me.motionDurationSlow}`,userSelect:"none",marginInlineEnd:Te*2,paddingInlineStart:Me.paddingXS,paddingInlineEnd:Me.paddingXS/2,[`${Xe}-disabled&`]:{color:Me.multipleItemColorDisabled,borderColor:Me.multipleItemBorderColorDisabled,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:Me.paddingXS/2,overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},(0,fe.Ro)()),{display:"inline-flex",alignItems:"center",color:Me.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${Ct}`]:{verticalAlign:"-0.2em"},"&:hover":{color:Me.colorIconHover}})},[`${wt}-item + ${wt}-item`]:{[`${Xe}-selection-search`]:{marginInlineStart:0}},[`${Xe}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:Me.inputPaddingHorizontalBase-je,"\n &-input,\n &-mirror\n ":{height:Mt,fontFamily:Me.fontFamily,lineHeight:`${Mt}px`,transition:`all ${Me.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${Xe}-selection-placeholder `]:{position:"absolute",top:"50%",insetInlineStart:Me.inputPaddingHorizontalBase,insetInlineEnd:Me.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${Me.motionDurationSlow}`}}}}var kt=Me=>{const{componentCls:Ve}=Me,Xe=(0,Fe.TS)(Me,{controlHeight:Me.controlHeightSM,multipleSelectItemHeight:Me.controlHeightXS,borderRadius:Me.borderRadiusSM,borderRadiusSM:Me.borderRadiusXS}),Ct=(0,Fe.TS)(Me,{fontSize:Me.fontSizeLG,controlHeight:Me.controlHeightLG,multipleSelectItemHeight:Me.multipleItemHeightLG,borderRadius:Me.borderRadiusLG,borderRadiusSM:Me.borderRadius}),[,wt]=gt(Me);return[ze(Me),ze(Xe,"sm"),{[`${Ve}-multiple${Ve}-sm`]:{[`${Ve}-selection-placeholder`]:{insetInline:Me.controlPaddingHorizontalSM-Me.lineWidth},[`${Ve}-selection-search`]:{marginInlineStart:wt}}},ze(Ct,"lg")]};function pt(Me,Ve){const{componentCls:Xe,inputPaddingHorizontalBase:Ct,borderRadius:wt}=Me,Mt=Me.controlHeight-Me.lineWidth*2,je=Math.ceil(Me.fontSize*1.25),Rt=Ve?`${Xe}-${Ve}`:"";return{[`${Xe}-single${Rt}`]:{fontSize:Me.fontSize,[`${Xe}-selector`]:Object.assign(Object.assign({},(0,fe.Wf)(Me)),{display:"flex",borderRadius:wt,[`${Xe}-selection-search`]:{position:"absolute",top:0,insetInlineStart:Ct,insetInlineEnd:Ct,bottom:0,"&-input":{width:"100%"}},[`
${Xe}-selection-item,
${Xe}-selection-placeholder
`]:{padding:0,lineHeight:`${Mt}px`,transition:`all ${Me.motionDurationSlow}, visibility 0s`,"@supports (-moz-appearance: meterbar)":{lineHeight:`${Mt}px`}},[`${Xe}-selection-item`]:{position:"relative",userSelect:"none"},[`${Xe}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${Xe}-selection-item:after`,`${Xe}-selection-placeholder:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[`
&${Xe}-show-arrow ${Xe}-selection-item,
&${Xe}-show-arrow ${Xe}-selection-placeholder
`]:{paddingInlineEnd:je},[`&${Xe}-open ${Xe}-selection-item`]:{color:Me.colorTextPlaceholder},[`&:not(${Xe}-customize-input)`]:{[`${Xe}-selector`]:{width:"100%",height:Me.controlHeight,padding:`0 ${Ct}px`,[`${Xe}-selection-search-input`]:{height:Mt},"&:after":{lineHeight:`${Mt}px`}}},[`&${Xe}-customize-input`]:{[`${Xe}-selector`]:{"&:after":{display:"none"},[`${Xe}-selection-search`]:{position:"static",width:"100%"},[`${Xe}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${Ct}px`,"&:after":{display:"none"}}}}}}}function Je(Me){const{componentCls:Ve}=Me,Xe=Me.controlPaddingHorizontalSM-Me.lineWidth;return[pt(Me),pt((0,Fe.TS)(Me,{controlHeight:Me.controlHeightSM,borderRadius:Me.borderRadiusSM}),"sm"),{[`${Ve}-single${Ve}-sm`]:{[`&:not(${Ve}-customize-input)`]:{[`${Ve}-selection-search`]:{insetInlineStart:Xe,insetInlineEnd:Xe},[`${Ve}-selector`]:{padding:`0 ${Xe}px`},[`&${Ve}-show-arrow ${Ve}-selection-search`]:{insetInlineEnd:Xe+Me.fontSize*1.5},[`
&${Ve}-show-arrow ${Ve}-selection-item,
&${Ve}-show-arrow ${Ve}-selection-placeholder
`]:{paddingInlineEnd:Me.fontSize*1.5}}}},pt((0,Fe.TS)(Me,{controlHeight:Me.singleItemHeightLG,fontSize:Me.fontSizeLG,borderRadius:Me.borderRadiusLG}),"lg")]}const De=Me=>{const{componentCls:Ve,selectorBg:Xe}=Me;return{position:"relative",backgroundColor:Xe,border:`${Me.lineWidth}px ${Me.lineType} ${Me.colorBorder}`,transition:`all ${Me.motionDurationMid} ${Me.motionEaseInOut}`,input:{cursor:"pointer"},[`${Ve}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit"}},[`${Ve}-disabled&`]:{color:Me.colorTextDisabled,background:Me.colorBgContainerDisabled,cursor:"not-allowed",[`${Ve}-multiple&`]:{background:Me.multipleSelectorBgDisabled},input:{cursor:"not-allowed"}}}},Dt=function(Me,Ve){let Xe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const{componentCls:Ct,borderHoverColor:wt,outlineColor:Mt,antCls:je}=Ve,Rt=Xe?{[`${Ct}-selector`]:{borderColor:wt}}:{};return{[Me]:{[`&:not(${Ct}-disabled):not(${Ct}-customize-input):not(${je}-pagination-size-changer)`]:Object.assign(Object.assign({},Rt),{[`${Ct}-focused& ${Ct}-selector`]:{borderColor:wt,boxShadow:`0 0 0 ${Ve.controlOutlineWidth}px ${Mt}`,outline:0},[`&:hover ${Ct}-selector`]:{borderColor:wt}})}}},Yt=Me=>{const{componentCls:Ve}=Me;return{[`${Ve}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},nt=Me=>{const{componentCls:Ve,inputPaddingHorizontalBase:Xe,iconCls:Ct}=Me;return{[Ve]:Object.assign(Object.assign({},(0,fe.Wf)(Me)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${Ve}-customize-input) ${Ve}-selector`]:Object.assign(Object.assign({},De(Me)),Yt(Me)),[`${Ve}-selection-item`]:Object.assign({flex:1,fontWeight:"normal"},fe.vS),[`${Ve}-selection-placeholder`]:Object.assign(Object.assign({},fe.vS),{flex:1,color:Me.colorTextPlaceholder,pointerEvents:"none"}),[`${Ve}-arrow`]:Object.assign(Object.assign({},(0,fe.Ro)()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:Xe,height:Me.fontSizeIcon,marginTop:-Me.fontSizeIcon/2,color:Me.colorTextQuaternary,fontSize:Me.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",[Ct]:{verticalAlign:"top",transition:`transform ${Me.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${Ve}-suffix)`]:{pointerEvents:"auto"}},[`${Ve}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${Ve}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:Xe,zIndex:1,display:"inline-block",width:Me.fontSizeIcon,height:Me.fontSizeIcon,marginTop:-Me.fontSizeIcon/2,color:Me.colorTextQuaternary,fontSize:Me.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",background:Me.clearBg,cursor:"pointer",opacity:0,transition:`color ${Me.motionDurationMid} ease, opacity ${Me.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:Me.colorTextTertiary}},"&:hover":{[`${Ve}-clear`]:{opacity:1}}}),[`${Ve}-has-feedback`]:{[`${Ve}-clear`]:{insetInlineEnd:Xe+Me.fontSize+Me.paddingXS}}}},ct=Me=>{const{componentCls:Ve}=Me;return[{[Ve]:{[`&-borderless ${Ve}-selector`]:{backgroundColor:"transparent !important",borderColor:"transparent !important",boxShadow:"none !important"},[`&${Ve}-in-form-item`]:{width:"100%"}}},nt(Me),Je(Me),kt(Me),pe(Me),{[`${Ve}-rtl`]:{direction:"rtl"}},Dt(Ve,(0,Fe.TS)(Me,{borderHoverColor:Me.colorPrimaryHover,outlineColor:Me.controlOutline})),Dt(`${Ve}-status-error`,(0,Fe.TS)(Me,{borderHoverColor:Me.colorErrorHover,outlineColor:Me.colorErrorOutline}),!0),Dt(`${Ve}-status-warning`,(0,Fe.TS)(Me,{borderHoverColor:Me.colorWarningHover,outlineColor:Me.colorWarningOutline}),!0),(0,tt.c)(Me,{borderElCls:`${Ve}-selector`,focusElCls:`${Ve}-focused`})]};var Ie=(0,Ye.Z)("Select",(Me,Ve)=>{let{rootPrefixCls:Xe}=Ve;const Ct=(0,Fe.TS)(Me,{rootPrefixCls:Xe,inputPaddingHorizontalBase:Me.paddingSM-1,multipleSelectItemHeight:Me.multipleItemHeight});return[ct(Ct)]},Me=>{const{fontSize:Ve,lineHeight:Xe,controlHeight:Ct,controlPaddingHorizontal:wt,zIndexPopupBase:Mt,colorText:je,fontWeightStrong:Rt,controlItemBgActive:At,controlItemBgHover:xn,colorBgContainer:jt,colorFillSecondary:vn,controlHeightLG:er,controlHeightSM:Sr,colorBgContainerDisabled:qe,colorTextDisabled:Ae}=Me;return{zIndexPopup:Mt+50,optionSelectedColor:je,optionSelectedFontWeight:Rt,optionSelectedBg:At,optionActiveBg:xn,optionPadding:`${(Ct-Ve*Xe)/2}px ${wt}px`,optionFontSize:Ve,optionLineHeight:Xe,optionHeight:Ct,selectorBg:jt,clearBg:jt,singleItemHeightLG:er,multipleItemBg:vn,multipleItemBorderColor:"transparent",multipleItemHeight:Sr,multipleItemHeightLG:Ct,multipleSelectorBgDisabled:qe,multipleItemColorDisabled:Ae,multipleItemBorderColorDisabled:"transparent"}})},13458:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return tt}});const fe=Fe=>{const be={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:Fe==="scroll"?"scroll":"visible",_experimental:{dynamicInset:!0}};return{bottomLeft:Object.assign(Object.assign({},be),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},be),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},be),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},be),{points:["br","tr"],offset:[0,-4]})}};function tt(Fe,Ye){return Fe||fe(Ye)}},78642:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return fe}});function fe(tt,Fe){return Fe!==void 0?Fe:tt!==null}},46163:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return Se}});var fe=ce(18299),tt=ce(16646),Fe=ce(73475),Ye=ce(42922),be=ce(3407),_e=ce(72395),Le=ce(67294);function Se(pe){let{suffixIcon:Te,clearIcon:gt,menuItemSelectedIcon:ze,removeIcon:Pt,loading:kt,multiple:pt,hasFeedback:Je,prefixCls:De,showSuffixIcon:Dt,feedbackIcon:Yt,showArrow:nt,componentName:ct}=pe;const Ie=gt!=null?gt:Le.createElement(tt.Z,null),Me=wt=>Te===null&&!Je&&!nt?null:Le.createElement(Le.Fragment,null,Dt!==!1&&wt,Je&&Yt);let Ve=null;if(Te!==void 0)Ve=Me(Te);else if(kt)Ve=Me(Le.createElement(be.Z,{spin:!0}));else{const wt=`${De}-suffix`;Ve=Mt=>{let{open:je,showSearch:Rt}=Mt;return Me(je&&Rt?Le.createElement(_e.Z,{className:wt}):Le.createElement(Ye.Z,{className:wt}))}}let Xe=null;ze!==void 0?Xe=ze:pt?Xe=Le.createElement(fe.Z,null):Xe=null;let Ct=null;return Pt!==void 0?Ct=Pt:Ct=Le.createElement(Fe.Z,null),{clearIcon:Ie,suffixIcon:Ve,itemIcon:Xe,removeIcon:Ct}}},33507:function(Ln,qt){"use strict";const ce=fe=>({[fe.componentCls]:{[`${fe.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${fe.motionDurationMid} ${fe.motionEaseInOut},
opacity ${fe.motionDurationMid} ${fe.motionEaseInOut} !important`}},[`${fe.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${fe.motionDurationMid} ${fe.motionEaseInOut},
opacity ${fe.motionDurationMid} ${fe.motionEaseInOut} !important`}}});qt.Z=ce},33297:function(Ln,qt,ce){"use strict";ce.d(qt,{Fm:function(){return ze}});var fe=ce(45930),tt=ce(93590);const Fe=new fe.Keyframes("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Ye=new fe.Keyframes("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),be=new fe.Keyframes("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),_e=new fe.Keyframes("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),Le=new fe.Keyframes("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Se=new fe.Keyframes("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),pe=new fe.Keyframes("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Te=new fe.Keyframes("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),gt={"move-up":{inKeyframes:pe,outKeyframes:Te},"move-down":{inKeyframes:Fe,outKeyframes:Ye},"move-left":{inKeyframes:be,outKeyframes:_e},"move-right":{inKeyframes:Le,outKeyframes:Se}},ze=(Pt,kt)=>{const{antCls:pt}=Pt,Je=`${pt}-${kt}`,{inKeyframes:De,outKeyframes:Dt}=gt[kt];return[(0,tt.R)(Je,De,Dt,Pt.motionDurationMid),{[`
${Je}-enter,
${Je}-appear
`]:{opacity:0,animationTimingFunction:Pt.motionEaseOutCirc},[`${Je}-leave`]:{animationTimingFunction:Pt.motionEaseInOutCirc}}]}},67771:function(Ln,qt,ce){"use strict";ce.d(qt,{Qt:function(){return be},Uw:function(){return Ye},fJ:function(){return Fe},ly:function(){return _e},oN:function(){return ze}});var fe=ce(45930),tt=ce(93590);const Fe=new fe.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),Ye=new fe.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),be=new fe.Keyframes("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),_e=new fe.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),Le=new fe.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),Se=new fe.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),pe=new fe.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),Te=new fe.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),gt={"slide-up":{inKeyframes:Fe,outKeyframes:Ye},"slide-down":{inKeyframes:be,outKeyframes:_e},"slide-left":{inKeyframes:Le,outKeyframes:Se},"slide-right":{inKeyframes:pe,outKeyframes:Te}},ze=(Pt,kt)=>{const{antCls:pt}=Pt,Je=`${pt}-${kt}`,{inKeyframes:De,outKeyframes:Dt}=gt[kt];return[(0,tt.R)(Je,De,Dt,Pt.motionDurationMid),{[`
${Je}-enter,
${Je}-appear
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:Pt.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${Je}-leave`]:{animationTimingFunction:Pt.motionEaseInQuint}}]}},47897:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return ye}});var fe=ce(3407),tt=ce(94184),Fe=ce.n(tt);function Ye(){return Ye=Object.assign?Object.assign.bind():function(ve){for(var le=1;le<arguments.length;le++){var We=arguments[le];for(var Lt in We)Object.prototype.hasOwnProperty.call(We,Lt)&&(ve[Lt]=We[Lt])}return ve},Ye.apply(this,arguments)}function be(ve){"@babel/helpers - typeof";return be=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(le){return typeof le}:function(le){return le&&typeof Symbol=="function"&&le.constructor===Symbol&&le!==Symbol.prototype?"symbol":typeof le},be(ve)}function _e(ve,le){if(be(ve)!=="object"||ve===null)return ve;var We=ve[Symbol.toPrimitive];if(We!==void 0){var Lt=We.call(ve,le||"default");if(be(Lt)!=="object")return Lt;throw new TypeError("@@toPrimitive must return a primitive value.")}return(le==="string"?String:Number)(ve)}function Le(ve){var le=_e(ve,"string");return be(le)==="symbol"?le:String(le)}function Se(ve,le,We){return le=Le(le),le in ve?Object.defineProperty(ve,le,{value:We,enumerable:!0,configurable:!0,writable:!0}):ve[le]=We,ve}function pe(ve){if(Array.isArray(ve))return ve}function Te(ve,le){var We=ve==null?null:typeof Symbol!="undefined"&&ve[Symbol.iterator]||ve["@@iterator"];if(We!=null){var Lt,tn,hn,sn,yn=[],ln=!0,yr=!1;try{if(hn=(We=We.call(ve)).next,le===0){if(Object(We)!==We)return;ln=!1}else for(;!(ln=(Lt=hn.call(We)).done)&&(yn.push(Lt.value),yn.length!==le);ln=!0);}catch(Fr){yr=!0,tn=Fr}finally{try{if(!ln&&We.return!=null&&(sn=We.return(),Object(sn)!==sn))return}finally{if(yr)throw tn}}return yn}}function gt(ve,le){(le==null||le>ve.length)&&(le=ve.length);for(var We=0,Lt=new Array(le);We<le;We++)Lt[We]=ve[We];return Lt}function ze(ve,le){if(ve){if(typeof ve=="string")return gt(ve,le);var We=Object.prototype.toString.call(ve).slice(8,-1);if(We==="Object"&&ve.constructor&&(We=ve.constructor.name),We==="Map"||We==="Set")return Array.from(ve);if(We==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(We))return gt(ve,le)}}function Pt(){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 kt(ve,le){return pe(ve)||Te(ve,le)||ze(ve,le)||Pt()}function pt(ve,le){if(ve==null)return{};var We={},Lt=Object.keys(ve),tn,hn;for(hn=0;hn<Lt.length;hn++)tn=Lt[hn],!(le.indexOf(tn)>=0)&&(We[tn]=ve[tn]);return We}function Je(ve,le){if(ve==null)return{};var We=pt(ve,le),Lt,tn;if(Object.getOwnPropertySymbols){var hn=Object.getOwnPropertySymbols(ve);for(tn=0;tn<hn.length;tn++)Lt=hn[tn],!(le.indexOf(Lt)>=0)&&Object.prototype.propertyIsEnumerable.call(ve,Lt)&&(We[Lt]=ve[Lt])}return We}var De=ce(67294);function Dt(ve){if(Array.isArray(ve))return ve}function Yt(ve,le){var We=ve==null?null:typeof Symbol!="undefined"&&ve[Symbol.iterator]||ve["@@iterator"];if(We!=null){var Lt,tn,hn,sn,yn=[],ln=!0,yr=!1;try{if(hn=(We=We.call(ve)).next,le===0){if(Object(We)!==We)return;ln=!1}else for(;!(ln=(Lt=hn.call(We)).done)&&(yn.push(Lt.value),yn.length!==le);ln=!0);}catch(Fr){yr=!0,tn=Fr}finally{try{if(!ln&&We.return!=null&&(sn=We.return(),Object(sn)!==sn))return}finally{if(yr)throw tn}}return yn}}function nt(ve,le){(le==null||le>ve.length)&&(le=ve.length);for(var We=0,Lt=new Array(le);We<le;We++)Lt[We]=ve[We];return Lt}function ct(ve,le){if(ve){if(typeof ve=="string")return nt(ve,le);var We=Object.prototype.toString.call(ve).slice(8,-1);if(We==="Object"&&ve.constructor&&(We=ve.constructor.name),We==="Map"||We==="Set")return Array.from(ve);if(We==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(We))return nt(ve,le)}}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 Me(ve,le){return Dt(ve)||Yt(ve,le)||ct(ve,le)||Ie()}function Ve(ve){var le=De.useRef();le.current=ve;var We=De.useCallback(function(){for(var Lt,tn=arguments.length,hn=new Array(tn),sn=0;sn<tn;sn++)hn[sn]=arguments[sn];return(Lt=le.current)===null||Lt===void 0?void 0:Lt.call.apply(Lt,[le].concat(hn))},[]);return We}function Xe(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Ct=Xe()?De.useLayoutEffect:De.useEffect,wt=function(le,We){var Lt=De.useRef(!0);Ct(function(){return le(Lt.current)},We),Ct(function(){return Lt.current=!1,function(){Lt.current=!0}},[])},Mt=function(le,We){wt(function(Lt){if(!Lt)return le()},We)},je=null;function Rt(ve){var le=De.useRef(!1),We=De.useState(ve),Lt=Me(We,2),tn=Lt[0],hn=Lt[1];De.useEffect(function(){return le.current=!1,function(){le.current=!0}},[]);function sn(yn,ln){ln&&le.current||hn(yn)}return[tn,sn]}function At(ve){return ve!==void 0}function xn(ve,le){var We=le||{},Lt=We.defaultValue,tn=We.value,hn=We.onChange,sn=We.postState,yn=Rt(function(){return At(tn)?tn:At(Lt)?typeof Lt=="function"?Lt():Lt:typeof ve=="function"?ve():ve}),ln=Me(yn,2),yr=ln[0],Fr=ln[1],Nt=tn!==void 0?tn:yr,Rn=sn?sn(Nt):Nt,Gr=Ve(hn),li=Rt([Nt]),st=Me(li,2),Wt=st[0],Vn=st[1];Mt(function(){var gr=Wt[0];yr!==gr&&Gr(yr,gr)},[Wt]),Mt(function(){At(tn)||Fr(tn)},[tn]);var ir=Ve(function(gr,Pr){Fr(gr,Pr),Vn([Nt],Pr)});return[Rn,ir]}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(le){var We=le.keyCode;if(le.altKey&&!le.ctrlKey||le.metaKey||We>=jt.F1&&We<=jt.F12)return!1;switch(We){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(le){if(le>=jt.ZERO&&le<=jt.NINE||le>=jt.NUM_ZERO&&le<=jt.NUM_MULTIPLY||le>=jt.A&&le<=jt.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&le===0)return!0;switch(le){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}}},vn=jt,er=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],Sr=De.forwardRef(function(ve,le){var We,Lt=ve.prefixCls,tn=Lt===void 0?"rc-switch":Lt,hn=ve.className,sn=ve.checked,yn=ve.defaultChecked,ln=ve.disabled,yr=ve.loadingIcon,Fr=ve.checkedChildren,Nt=ve.unCheckedChildren,Rn=ve.onClick,Gr=ve.onChange,li=ve.onKeyDown,st=Je(ve,er),Wt=xn(!1,{value:sn,defaultValue:yn}),Vn=kt(Wt,2),ir=Vn[0],gr=Vn[1];function Pr(ui,br){var Ei=ir;return ln||(Ei=ui,gr(Ei),Gr==null||Gr(Ei,br)),Ei}function Ur(ui){ui.which===vn.LEFT?Pr(!1,ui):ui.which===vn.RIGHT&&Pr(!0,ui),li==null||li(ui)}function Xr(ui){var br=Pr(!ir,ui);Rn==null||Rn(br,ui)}var qr=Fe()(tn,hn,(We={},Se(We,"".concat(tn,"-checked"),ir),Se(We,"".concat(tn,"-disabled"),ln),We));return De.createElement("button",Ye({},st,{type:"button",role:"switch","aria-checked":ir,disabled:ln,className:qr,ref:le,onKeyDown:Ur,onClick:Xr}),yr,De.createElement("span",{className:"".concat(tn,"-inner")},De.createElement("span",{className:"".concat(tn,"-inner-checked")},Fr),De.createElement("span",{className:"".concat(tn,"-inner-unchecked")},Nt)))});Sr.displayName="Switch";var qe=Sr,Ae=ce(45353),$t=ce(53124),Hn=ce(98866),bn=ce(98675),at=ce(84780),ft=ce(14747),Gt=ce(67968),zn=ce(45503);const mn=ve=>{const{componentCls:le,trackHeightSM:We,trackPadding:Lt,trackMinWidthSM:tn,innerMinMarginSM:hn,innerMaxMarginSM:sn,handleSizeSM:yn}=ve,ln=`${le}-inner`;return{[le]:{[`&${le}-small`]:{minWidth:tn,height:We,lineHeight:`${We}px`,[`${le}-inner`]:{paddingInlineStart:sn,paddingInlineEnd:hn,[`${ln}-checked`]:{marginInlineStart:`calc(-100% + ${yn+Lt*2}px - ${sn*2}px)`,marginInlineEnd:`calc(100% - ${yn+Lt*2}px + ${sn*2}px)`},[`${ln}-unchecked`]:{marginTop:-We,marginInlineStart:0,marginInlineEnd:0}},[`${le}-handle`]:{width:yn,height:yn},[`${le}-loading-icon`]:{top:(yn-ve.switchLoadingIconSize)/2,fontSize:ve.switchLoadingIconSize},[`&${le}-checked`]:{[`${le}-inner`]:{paddingInlineStart:hn,paddingInlineEnd:sn,[`${ln}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${ln}-unchecked`]:{marginInlineStart:`calc(100% - ${yn+Lt*2}px + ${sn*2}px)`,marginInlineEnd:`calc(-100% + ${yn+Lt*2}px - ${sn*2}px)`}},[`${le}-handle`]:{insetInlineStart:`calc(100% - ${yn+Lt}px)`}},[`&:not(${le}-disabled):active`]:{[`&:not(${le}-checked) ${ln}`]:{[`${ln}-unchecked`]:{marginInlineStart:ve.marginXXS/2,marginInlineEnd:-ve.marginXXS/2}},[`&${le}-checked ${ln}`]:{[`${ln}-checked`]:{marginInlineStart:-ve.marginXXS/2,marginInlineEnd:ve.marginXXS/2}}}}}}},nn=ve=>{const{componentCls:le,handleSize:We}=ve;return{[le]:{[`${le}-loading-icon${ve.iconCls}`]:{position:"relative",top:(We-ve.fontSize)/2,color:ve.switchLoadingIconColor,verticalAlign:"top"},[`&${le}-checked ${le}-loading-icon`]:{color:ve.switchColor}}}},Ft=ve=>{const{componentCls:le,motion:We,trackPadding:Lt,handleBg:tn,handleShadow:hn,handleSize:sn}=ve,yn=`${le}-handle`;return{[le]:{[yn]:{position:"absolute",top:Lt,insetInlineStart:Lt,width:sn,height:sn,transition:`all ${ve.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:tn,borderRadius:sn/2,boxShadow:hn,transition:`all ${ve.switchDuration} ease-in-out`,content:'""'}},[`&${le}-checked ${yn}`]:{insetInlineStart:`calc(100% - ${sn+Lt}px)`},[`&:not(${le}-disabled):active`]:We?{[`${yn}::before`]:{insetInlineEnd:ve.switchHandleActiveInset,insetInlineStart:0},[`&${le}-checked ${yn}::before`]:{insetInlineEnd:0,insetInlineStart:ve.switchHandleActiveInset}}:{}}}},Pn=ve=>{const{componentCls:le,trackHeight:We,trackPadding:Lt,innerMinMargin:tn,innerMaxMargin:hn,handleSize:sn}=ve,yn=`${le}-inner`;return{[le]:{[yn]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:hn,paddingInlineEnd:tn,transition:`padding-inline-start ${ve.switchDuration} ease-in-out, padding-inline-end ${ve.switchDuration} ease-in-out`,[`${yn}-checked, ${yn}-unchecked`]:{display:"block",color:ve.colorTextLightSolid,fontSize:ve.fontSizeSM,transition:`margin-inline-start ${ve.switchDuration} ease-in-out, margin-inline-end ${ve.switchDuration} ease-in-out`,pointerEvents:"none"},[`${yn}-checked`]:{marginInlineStart:`calc(-100% + ${sn+Lt*2}px - ${hn*2}px)`,marginInlineEnd:`calc(100% - ${sn+Lt*2}px + ${hn*2}px)`},[`${yn}-unchecked`]:{marginTop:-We,marginInlineStart:0,marginInlineEnd:0}},[`&${le}-checked ${yn}`]:{paddingInlineStart:tn,paddingInlineEnd:hn,[`${yn}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${yn}-unchecked`]:{marginInlineStart:`calc(100% - ${sn+Lt*2}px + ${hn*2}px)`,marginInlineEnd:`calc(-100% + ${sn+Lt*2}px - ${hn*2}px)`}},[`&:not(${le}-disabled):active`]:{[`&:not(${le}-checked) ${yn}`]:{[`${yn}-unchecked`]:{marginInlineStart:Lt*2,marginInlineEnd:-Lt*2}},[`&${le}-checked ${yn}`]:{[`${yn}-checked`]:{marginInlineStart:-Lt*2,marginInlineEnd:Lt*2}}}}}},_n=ve=>{const{componentCls:le,trackHeight:We,trackMinWidth:Lt}=ve;return{[le]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,ft.Wf)(ve)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:Lt,height:We,lineHeight:`${We}px`,verticalAlign:"middle",background:ve.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${ve.motionDurationMid}`,userSelect:"none",[`&:hover:not(${le}-disabled)`]:{background:ve.colorTextTertiary}}),(0,ft.Qy)(ve)),{[`&${le}-checked`]:{background:ve.switchColor,[`&:hover:not(${le}-disabled)`]:{background:ve.colorPrimaryHover}},[`&${le}-loading, &${le}-disabled`]:{cursor:"not-allowed",opacity:ve.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${le}-rtl`]:{direction:"rtl"}})}};var Ee=(0,Gt.Z)("Switch",ve=>{const le=(0,zn.TS)(ve,{switchDuration:ve.motionDurationMid,switchColor:ve.colorPrimary,switchDisabledOpacity:ve.opacityLoading,switchLoadingIconSize:ve.fontSizeIcon*.75,switchLoadingIconColor:`rgba(0, 0, 0, ${ve.opacityLoading})`,switchHandleActiveInset:"-30%"});return[_n(le),Pn(le),Ft(le),nn(le),mn(le)]},ve=>{const{fontSize:le,lineHeight:We,controlHeight:Lt,colorWhite:tn}=ve,hn=le*We,sn=Lt/2,yn=2,ln=hn-yn*2,yr=sn-yn*2;return{trackHeight:hn,trackHeightSM:sn,trackMinWidth:ln*2+yn*4,trackMinWidthSM:yr*2+yn*2,trackPadding:yn,handleBg:tn,handleSize:ln,handleSizeSM:yr,handleShadow:`0 2px 4px 0 ${new at.C("#00230b").setAlpha(.2).toRgbString()}`,innerMinMargin:ln/2,innerMaxMargin:ln+yn+yn*2,innerMinMarginSM:yr/2,innerMaxMarginSM:yr+yn+yn*2}}),ue=function(ve,le){var We={};for(var Lt in ve)Object.prototype.hasOwnProperty.call(ve,Lt)&&le.indexOf(Lt)<0&&(We[Lt]=ve[Lt]);if(ve!=null&&typeof Object.getOwnPropertySymbols=="function")for(var tn=0,Lt=Object.getOwnPropertySymbols(ve);tn<Lt.length;tn++)le.indexOf(Lt[tn])<0&&Object.prototype.propertyIsEnumerable.call(ve,Lt[tn])&&(We[Lt[tn]]=ve[Lt[tn]]);return We};const se=De.forwardRef((ve,le)=>{const{prefixCls:We,size:Lt,disabled:tn,loading:hn,className:sn,rootClassName:yn,style:ln}=ve,yr=ue(ve,["prefixCls","size","disabled","loading","className","rootClassName","style"]),{getPrefixCls:Fr,direction:Nt,switch:Rn}=De.useContext($t.E_),Gr=De.useContext(Hn.Z),li=(tn!=null?tn:Gr)||hn,st=Fr("switch",We),Wt=De.createElement("div",{className:`${st}-handle`},hn&&De.createElement(fe.Z,{className:`${st}-loading-icon`})),[Vn,ir]=Ee(st),gr=(0,bn.Z)(Lt),Pr=Fe()(Rn==null?void 0:Rn.className,{[`${st}-small`]:gr==="small",[`${st}-loading`]:hn,[`${st}-rtl`]:Nt==="rtl"},sn,yn,ir),Ur=Object.assign(Object.assign({},Rn==null?void 0:Rn.style),ln);return Vn(De.createElement(Ae.Z,{component:"Switch"},De.createElement(qe,Object.assign({},yr,{prefixCls:st,className:Pr,style:Ur,disabled:li,ref:le,loadingIcon:Wt}))))});se.__ANT_SWITCH=!0;var ye=se},66368:function(Ln,qt,ce){"use strict";ce.d(qt,{default:function(){return Si}});var fe=ce(73475),tt=ce(25877),Fe=ce(38308),Ye=ce(94184),be=ce.n(Ye),_e=ce(87462),Le=ce(4942),Se=ce(1413),pe=ce(97685),Te=ce(71002),gt=ce(45987),ze=ce(67294),Pt=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var Ce=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(Ce)||/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(Ce==null?void 0:Ce.substr(0,4))};function kt(Ce){var Ne=ze.useRef();Ne.current=Ce;var Be=ze.useCallback(function(){for(var He,Ge=arguments.length,et=new Array(Ge),bt=0;bt<Ge;bt++)et[bt]=arguments[bt];return(He=Ne.current)===null||He===void 0?void 0:He.call.apply(He,[Ne].concat(et))},[]);return Be}function pt(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Je=pt()?ze.useLayoutEffect:ze.useEffect,De=function(Ne,Be){var He=ze.useRef(!0);Je(function(){return Ne(He.current)},Be),Je(function(){return He.current=!1,function(){He.current=!0}},[])},Dt=function(Ne,Be){De(function(He){if(!He)return Ne()},Be)},Yt=null;function nt(Ce){var Ne=ze.useRef(!1),Be=ze.useState(Ce),He=(0,pe.Z)(Be,2),Ge=He[0],et=He[1];ze.useEffect(function(){return Ne.current=!1,function(){Ne.current=!0}},[]);function bt(Zt,Jt){Jt&&Ne.current||et(Zt)}return[Ge,bt]}function ct(Ce){return Ce!==void 0}function Ie(Ce,Ne){var Be=Ne||{},He=Be.defaultValue,Ge=Be.value,et=Be.onChange,bt=Be.postState,Zt=nt(function(){return ct(Ge)?Ge:ct(He)?typeof He=="function"?He():He:typeof Ce=="function"?Ce():Ce}),Jt=(0,pe.Z)(Zt,2),Gn=Jt[0],fr=Jt[1],Wn=Ge!==void 0?Ge:Gn,pn=bt?bt(Wn):Wn,dn=kt(et),Cn=nt([Wn]),In=(0,pe.Z)(Cn,2),cr=In[0],jn=In[1];Dt(function(){var Jn=cr[0];Gn!==Jn&&dn(Gn,Jn)},[cr]),Dt(function(){ct(Ge)||fr(Ge)},[Ge]);var Zn=kt(function(Jn,Qn){fr(Jn,Qn),jn([Wn],Qn)});return[pn,Zn]}var Me=ce(62874),Ve=(0,ze.createContext)(null),Xe=ze.forwardRef(function(Ce,Ne){var Be=Ce.prefixCls,He=Ce.className,Ge=Ce.style,et=Ce.id,bt=Ce.active,Zt=Ce.tabKey,Jt=Ce.children;return ze.createElement("div",{id:et&&"".concat(et,"-panel-").concat(Zt),role:"tabpanel",tabIndex:bt?0:-1,"aria-labelledby":et&&"".concat(et,"-tab-").concat(Zt),"aria-hidden":!bt,style:Ge,className:be()(Be,bt&&"".concat(Be,"-active"),He),ref:Ne},Jt)}),Ct=Xe,wt=["key","forceRender","style","className"];function Mt(Ce){var Ne=Ce.id,Be=Ce.activeKey,He=Ce.animated,Ge=Ce.tabPosition,et=Ce.destroyInactiveTabPane,bt=ze.useContext(Ve),Zt=bt.prefixCls,Jt=bt.tabs,Gn=He.tabPane,fr="".concat(Zt,"-tabpane");return ze.createElement("div",{className:be()("".concat(Zt,"-content-holder"))},ze.createElement("div",{className:be()("".concat(Zt,"-content"),"".concat(Zt,"-content-").concat(Ge),(0,Le.Z)({},"".concat(Zt,"-content-animated"),Gn))},Jt.map(function(Wn){var pn=Wn.key,dn=Wn.forceRender,Cn=Wn.style,In=Wn.className,cr=(0,gt.Z)(Wn,wt),jn=pn===Be;return ze.createElement(Me.Z,(0,_e.Z)({key:pn,visible:jn,forceRender:dn,removeOnLeave:!!et,leavedClassName:"".concat(fr,"-hidden")},He.tabPaneMotion),function(Zn,Jn){var Qn=Zn.style,hr=Zn.className;return ze.createElement(Ct,(0,_e.Z)({},cr,{prefixCls:fr,id:Ne,tabKey:pn,animated:Gn,active:jn,style:(0,Se.Z)((0,Se.Z)({},Cn),Qn),className:be()(In,hr),ref:Jn}))})})))}var je=ce(74902),Rt=ce(48555),At=ce(59864);function xn(Ce,Ne,Be){var He=ze.useRef({});return(!("value"in He.current)||Be(He.current.condition,Ne))&&(He.current.value=Ce(),He.current.condition=Ne),He.current.value}function jt(Ce,Ne){typeof Ce=="function"?Ce(Ne):(0,Te.Z)(Ce)==="object"&&Ce&&"current"in Ce&&(Ce.current=Ne)}function vn(){for(var Ce=arguments.length,Ne=new Array(Ce),Be=0;Be<Ce;Be++)Ne[Be]=arguments[Be];var He=Ne.filter(function(Ge){return Ge});return He.length<=1?He[0]:function(Ge){Ne.forEach(function(et){jt(et,Ge)})}}function er(){for(var Ce=arguments.length,Ne=new Array(Ce),Be=0;Be<Ce;Be++)Ne[Be]=arguments[Be];return xn(function(){return vn.apply(void 0,Ne)},Ne,function(He,Ge){return He.length===Ge.length&&He.every(function(et,bt){return et===Ge[bt]})})}function Sr(Ce){var Ne,Be,He=isMemo(Ce)?Ce.type.type:Ce.type;return!(typeof He=="function"&&!((Ne=He.prototype)!==null&&Ne!==void 0&&Ne.render)||typeof Ce=="function"&&!((Be=Ce.prototype)!==null&&Be!==void 0&&Be.render))}var qe={width:0,height:0,left:0,top:0};function Ae(Ce,Ne,Be){return(0,ze.useMemo)(function(){for(var He,Ge=new Map,et=Ne.get((He=Ce[0])===null||He===void 0?void 0:He.key)||qe,bt=et.left+et.width,Zt=0;Zt<Ce.length;Zt+=1){var Jt=Ce[Zt].key,Gn=Ne.get(Jt);if(!Gn){var fr;Gn=Ne.get((fr=Ce[Zt-1])===null||fr===void 0?void 0:fr.key)||qe}var Wn=Ge.get(Jt)||(0,Se.Z)({},Gn);Wn.right=bt-Wn.left-Wn.width,Ge.set(Jt,Wn)}return Ge},[Ce.map(function(He){return He.key}).join("_"),Ne,Be])}function $t(Ce,Ne){var Be=ze.useRef(Ce),He=ze.useState({}),Ge=(0,pe.Z)(He,2),et=Ge[1];function bt(Zt){var Jt=typeof Zt=="function"?Zt(Be.current):Zt;Jt!==Be.current&&Ne(Jt,Be.current),Be.current=Jt,et({})}return[Be.current,bt]}var Hn=.1,bn=.01,at=20,ft=Math.pow(.995,at);function Gt(Ce,Ne){var Be=(0,ze.useState)(),He=(0,pe.Z)(Be,2),Ge=He[0],et=He[1],bt=(0,ze.useState)(0),Zt=(0,pe.Z)(bt,2),Jt=Zt[0],Gn=Zt[1],fr=(0,ze.useState)(0),Wn=(0,pe.Z)(fr,2),pn=Wn[0],dn=Wn[1],Cn=(0,ze.useState)(),In=(0,pe.Z)(Cn,2),cr=In[0],jn=In[1],Zn=(0,ze.useRef)();function Jn(rt){var It=rt.touches[0],rn=It.screenX,fn=It.screenY;et({x:rn,y:fn}),window.clearInterval(Zn.current)}function Qn(rt){if(Ge){rt.preventDefault();var It=rt.touches[0],rn=It.screenX,fn=It.screenY;et({x:rn,y:fn});var On=rn-Ge.x,wn=fn-Ge.y;Ne(On,wn);var Xt=Date.now();Gn(Xt),dn(Xt-Jt),jn({x:On,y:wn})}}function hr(){if(Ge&&(et(null),jn(null),cr)){var rt=cr.x/pn,It=cr.y/pn,rn=Math.abs(rt),fn=Math.abs(It);if(Math.max(rn,fn)<Hn)return;var On=rt,wn=It;Zn.current=window.setInterval(function(){if(Math.abs(On)<bn&&Math.abs(wn)<bn){window.clearInterval(Zn.current);return}On*=ft,wn*=ft,Ne(On*at,wn*at)},at)}}var Pe=(0,ze.useRef)();function $e(rt){var It=rt.deltaX,rn=rt.deltaY,fn=0,On=Math.abs(It),wn=Math.abs(rn);On===wn?fn=Pe.current==="x"?It:rn:On>wn?(fn=It,Pe.current="x"):(fn=rn,Pe.current="y"),Ne(-fn,-fn)&&rt.preventDefault()}var xt=(0,ze.useRef)(null);xt.current={onTouchStart:Jn,onTouchMove:Qn,onTouchEnd:hr,onWheel:$e},ze.useEffect(function(){function rt(On){xt.current.onTouchStart(On)}function It(On){xt.current.onTouchMove(On)}function rn(On){xt.current.onTouchEnd(On)}function fn(On){xt.current.onWheel(On)}return document.addEventListener("touchmove",It,{passive:!1}),document.addEventListener("touchend",rn,{passive:!1}),Ce.current.addEventListener("touchstart",rt,{passive:!1}),Ce.current.addEventListener("wheel",fn),function(){document.removeEventListener("touchmove",It),document.removeEventListener("touchend",rn)}},[])}function zn(Ce){var Ne=(0,ze.useState)(0),Be=(0,pe.Z)(Ne,2),He=Be[0],Ge=Be[1],et=(0,ze.useRef)(0),bt=(0,ze.useRef)();return bt.current=Ce,Dt(function(){var Zt;(Zt=bt.current)===null||Zt===void 0||Zt.call(bt)},[He]),function(){et.current===He&&(et.current+=1,Ge(et.current))}}function mn(Ce){var Ne=(0,ze.useRef)([]),Be=(0,ze.useState)({}),He=(0,pe.Z)(Be,2),Ge=He[1],et=(0,ze.useRef)(typeof Ce=="function"?Ce():Ce),bt=zn(function(){var Jt=et.current;Ne.current.forEach(function(Gn){Jt=Gn(Jt)}),Ne.current=[],et.current=Jt,Ge({})});function Zt(Jt){Ne.current.push(Jt),bt()}return[et.current,Zt]}var nn={width:0,height:0,left:0,top:0,right:0};function Ft(Ce,Ne,Be,He,Ge,et,bt){var Zt=bt.tabs,Jt=bt.tabPosition,Gn=bt.rtl,fr,Wn,pn;return["top","bottom"].includes(Jt)?(fr="width",Wn=Gn?"right":"left",pn=Math.abs(Be)):(fr="height",Wn="top",pn=-Be),(0,ze.useMemo)(function(){if(!Zt.length)return[0,0];for(var dn=Zt.length,Cn=dn,In=0;In<dn;In+=1){var cr=Ce.get(Zt[In].key)||nn;if(cr[Wn]+cr[fr]>pn+Ne){Cn=In-1;break}}for(var jn=0,Zn=dn-1;Zn>=0;Zn-=1){var Jn=Ce.get(Zt[Zn].key)||nn;if(Jn[Wn]<pn){jn=Zn+1;break}}return jn>=Cn?[0,0]:[jn,Cn]},[Ce,Ne,He,Ge,et,pn,Jt,Zt.map(function(dn){return dn.key}).join("_"),Gn])}function Pn(Ce){var Ne;return Ce instanceof Map?(Ne={},Ce.forEach(function(Be,He){Ne[He]=Be})):Ne=Ce,JSON.stringify(Ne)}var _n="TABS_DQ";function Ee(Ce){return String(Ce).replace(/"/g,_n)}function ue(Ce,Ne,Be,He){return!(!Be||He||Ce===!1||Ce===void 0&&(Ne===!1||Ne===null))}function se(Ce,Ne){var Be=Ce.prefixCls,He=Ce.editable,Ge=Ce.locale,et=Ce.style;return!He||He.showAdd===!1?null:ze.createElement("button",{ref:Ne,type:"button",className:"".concat(Be,"-nav-add"),style:et,"aria-label":(Ge==null?void 0:Ge.addAriaLabel)||"Add tab",onClick:function(Zt){He.onEdit("add",{event:Zt})}},He.addIcon||"+")}var ye=ze.forwardRef(se),ve=ze.forwardRef(function(Ce,Ne){var Be=Ce.position,He=Ce.prefixCls,Ge=Ce.extra;if(!Ge)return null;var et,bt={};return(0,Te.Z)(Ge)==="object"&&!ze.isValidElement(Ge)?bt=Ge:bt.right=Ge,Be==="right"&&(et=bt.right),Be==="left"&&(et=bt.left),et?ze.createElement("div",{className:"".concat(He,"-extra-content"),ref:Ne},et):null}),le=ve,We=ce(62709);function Lt(Ce,Ne,Be){var He=React.useRef({});return(!("value"in He.current)||Be(He.current.condition,Ne))&&(He.current.value=Ce(),He.current.condition=Ne),He.current.value}function tn(Ce,Ne){typeof Ce=="function"?Ce(Ne):(0,Te.Z)(Ce)==="object"&&Ce&&"current"in Ce&&(Ce.current=Ne)}function hn(){for(var Ce=arguments.length,Ne=new Array(Ce),Be=0;Be<Ce;Be++)Ne[Be]=arguments[Be];var He=Ne.filter(function(Ge){return Ge});return He.length<=1?He[0]:function(Ge){Ne.forEach(function(et){tn(et,Ge)})}}function sn(){for(var Ce=arguments.length,Ne=new Array(Ce),Be=0;Be<Ce;Be++)Ne[Be]=arguments[Be];return useMemo(function(){return hn.apply(void 0,Ne)},Ne,function(He,Ge){return He.length===Ge.length&&He.every(function(et,bt){return et===Ge[bt]})})}function yn(Ce){var Ne,Be,He=(0,At.isMemo)(Ce)?Ce.type.type:Ce.type;return!(typeof He=="function"&&!((Ne=He.prototype)!==null&&Ne!==void 0&&Ne.render)||typeof Ce=="function"&&!((Be=Ce.prototype)!==null&&Be!==void 0&&Be.render))}var ln={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(Ne){var Be=Ne.keyCode;if(Ne.altKey&&!Ne.ctrlKey||Ne.metaKey||Be>=ln.F1&&Be<=ln.F12)return!1;switch(Be){case ln.ALT:case ln.CAPS_LOCK:case ln.CONTEXT_MENU:case ln.CTRL:case ln.DOWN:case ln.END:case ln.ESC:case ln.HOME:case ln.INSERT:case ln.LEFT:case ln.MAC_FF_META:case ln.META:case ln.NUMLOCK:case ln.NUM_CENTER:case ln.PAGE_DOWN:case ln.PAGE_UP:case ln.PAUSE:case ln.PRINT_SCREEN:case ln.RIGHT:case ln.SHIFT:case ln.UP:case ln.WIN_KEY:case ln.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(Ne){if(Ne>=ln.ZERO&&Ne<=ln.NINE||Ne>=ln.NUM_ZERO&&Ne<=ln.NUM_MULTIPLY||Ne>=ln.A&&Ne<=ln.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&Ne===0)return!0;switch(Ne){case ln.SPACE:case ln.QUESTION_MARK:case ln.NUM_PLUS:case ln.NUM_MINUS:case ln.NUM_PERIOD:case ln.NUM_DIVISION:case ln.SEMICOLON:case ln.DASH:case ln.EQUALS:case ln.COMMA:case ln.PERIOD:case ln.SLASH:case ln.APOSTROPHE:case ln.SINGLE_QUOTE:case ln.OPEN_SQUARE_BRACKET:case ln.BACKSLASH:case ln.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},yr=ln,Fr=function(Ne){return+setTimeout(Ne,16)},Nt=function(Ne){return clearTimeout(Ne)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(Fr=function(Ne){return window.requestAnimationFrame(Ne)},Nt=function(Ne){return window.cancelAnimationFrame(Ne)});var Rn=0,Gr=new Map;function li(Ce){Gr.delete(Ce)}var st=function(Ne){var Be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Rn+=1;var He=Rn;function Ge(et){if(et===0)li(He),Ne();else{var bt=Fr(function(){Ge(et-1)});Gr.set(He,bt)}}return Ge(Be),He};st.cancel=function(Ce){var Ne=Gr.get(Ce);return li(Ne),Nt(Ne)};var Wt=st,Vn=yr.ESC,ir=yr.TAB;function gr(Ce){var Ne=Ce.visible,Be=Ce.triggerRef,He=Ce.onVisibleChange,Ge=Ce.autoFocus,et=Ce.overlayRef,bt=ze.useRef(!1),Zt=function(){if(Ne){var Wn,pn;(Wn=Be.current)===null||Wn===void 0||(pn=Wn.focus)===null||pn===void 0||pn.call(Wn),He==null||He(!1)}},Jt=function(){var Wn;return(Wn=et.current)!==null&&Wn!==void 0&&Wn.focus?(et.current.focus(),bt.current=!0,!0):!1},Gn=function(Wn){switch(Wn.keyCode){case Vn:Zt();break;case ir:{var pn=!1;bt.current||(pn=Jt()),pn?Wn.preventDefault():Zt();break}}};ze.useEffect(function(){return Ne?(window.addEventListener("keydown",Gn),Ge&&Wt(Jt,3),function(){window.removeEventListener("keydown",Gn),bt.current=!1}):function(){bt.current=!1}},[Ne])}var Pr=(0,ze.forwardRef)(function(Ce,Ne){var Be=Ce.overlay,He=Ce.arrow,Ge=Ce.prefixCls,et=(0,ze.useMemo)(function(){var Zt;return typeof Be=="function"?Zt=Be():Zt=Be,Zt},[Be]),bt=hn(Ne,et==null?void 0:et.ref);return ze.createElement(ze.Fragment,null,He&&ze.createElement("div",{className:"".concat(Ge,"-arrow")}),ze.cloneElement(et,{ref:yn(et)?bt:void 0}))}),Ur=Pr,Xr={adjustX:1,adjustY:1},qr=[0,0],ui={topLeft:{points:["bl","tl"],overflow:Xr,offset:[0,-4],targetOffset:qr},top:{points:["bc","tc"],overflow:Xr,offset:[0,-4],targetOffset:qr},topRight:{points:["br","tr"],overflow:Xr,offset:[0,-4],targetOffset:qr},bottomLeft:{points:["tl","bl"],overflow:Xr,offset:[0,4],targetOffset:qr},bottom:{points:["tc","bc"],overflow:Xr,offset:[0,4],targetOffset:qr},bottomRight:{points:["tr","br"],overflow:Xr,offset:[0,4],targetOffset:qr}},br=ui,Ei=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function sa(Ce,Ne){var Be,He=Ce.arrow,Ge=He===void 0?!1:He,et=Ce.prefixCls,bt=et===void 0?"rc-dropdown":et,Zt=Ce.transitionName,Jt=Ce.animation,Gn=Ce.align,fr=Ce.placement,Wn=fr===void 0?"bottomLeft":fr,pn=Ce.placements,dn=pn===void 0?br:pn,Cn=Ce.getPopupContainer,In=Ce.showAction,cr=Ce.hideAction,jn=Ce.overlayClassName,Zn=Ce.overlayStyle,Jn=Ce.visible,Qn=Ce.trigger,hr=Qn===void 0?["hover"]:Qn,Pe=Ce.autoFocus,$e=Ce.overlay,xt=Ce.children,rt=Ce.onVisibleChange,It=(0,gt.Z)(Ce,Ei),rn=ze.useState(),fn=(0,pe.Z)(rn,2),On=fn[0],wn=fn[1],Xt="visible"in Ce?Jn:On,Nn=ze.useRef(null),Fn=ze.useRef(null),mr=ze.useRef(null);ze.useImperativeHandle(Ne,function(){return Nn.current});var Bn=function(Ir){wn(Ir),rt==null||rt(Ir)};gr({visible:Xt,triggerRef:mr,onVisibleChange:Bn,autoFocus:Pe,overlayRef:Fn});var Lr=function(Ir){var ci=Ce.onOverlayClick;wn(!1),ci&&ci(Ir)},Zr=function(){return ze.createElement(Ur,{ref:Fn,overlay:$e,prefixCls:bt,arrow:Ge})},Dr=function(){return typeof $e=="function"?Zr:Zr()},zr=function(){var Ir=Ce.minOverlayWidthMatchTrigger,ci=Ce.alignPoint;return"minOverlayWidthMatchTrigger"in Ce?Ir:!ci},xr=function(){var Ir=Ce.openClassName;return Ir!==void 0?Ir:"".concat(bt,"-open")},Or=ze.cloneElement(xt,{className:be()((Be=xt.props)===null||Be===void 0?void 0:Be.className,Xt&&xr()),ref:yn(xt)?hn(mr,xt.ref):void 0}),Jr=cr;return!Jr&&hr.indexOf("contextMenu")!==-1&&(Jr=["click"]),ze.createElement(We.Z,(0,_e.Z)({builtinPlacements:dn},It,{prefixCls:bt,ref:Nn,popupClassName:be()(jn,(0,Le.Z)({},"".concat(bt,"-show-arrow"),Ge)),popupStyle:Zn,action:hr,showAction:In,hideAction:Jr,popupPlacement:Wn,popupAlign:Gn,popupTransitionName:Zt,popupAnimation:Jt,popupVisible:Xt,stretch:zr()?"minWidth":"",popup:Dr(),onPopupVisibleChange:Bn,onPopupClick:Lr,getPopupContainer:Cn}),Or)}var Ji=ze.forwardRef(sa),Qi=Ji,Ci=ce(78595),mt={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(Ne){var Be=Ne.keyCode;if(Ne.altKey&&!Ne.ctrlKey||Ne.metaKey||Be>=mt.F1&&Be<=mt.F12)return!1;switch(Be){case mt.ALT:case mt.CAPS_LOCK:case mt.CONTEXT_MENU:case mt.CTRL:case mt.DOWN:case mt.END:case mt.ESC:case mt.HOME:case mt.INSERT:case mt.LEFT:case mt.MAC_FF_META:case mt.META:case mt.NUMLOCK:case mt.NUM_CENTER:case mt.PAGE_DOWN:case mt.PAGE_UP:case mt.PAUSE:case mt.PRINT_SCREEN:case mt.RIGHT:case mt.SHIFT:case mt.UP:case mt.WIN_KEY:case mt.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(Ne){if(Ne>=mt.ZERO&&Ne<=mt.NINE||Ne>=mt.NUM_ZERO&&Ne<=mt.NUM_MULTIPLY||Ne>=mt.A&&Ne<=mt.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&Ne===0)return!0;switch(Ne){case mt.SPACE:case mt.QUESTION_MARK:case mt.NUM_PLUS:case mt.NUM_MINUS:case mt.NUM_PERIOD:case mt.NUM_DIVISION:case mt.SEMICOLON:case mt.DASH:case mt.EQUALS:case mt.COMMA:case mt.PERIOD:case mt.SLASH:case mt.APOSTROPHE:case mt.SINGLE_QUOTE:case mt.OPEN_SQUARE_BRACKET:case mt.BACKSLASH:case mt.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Mn=mt;function En(Ce,Ne){var Be=Ce.prefixCls,He=Ce.id,Ge=Ce.tabs,et=Ce.locale,bt=Ce.mobile,Zt=Ce.moreIcon,Jt=Zt===void 0?"More":Zt,Gn=Ce.moreTransitionName,fr=Ce.style,Wn=Ce.className,pn=Ce.editable,dn=Ce.tabBarGutter,Cn=Ce.rtl,In=Ce.removeAriaLabel,cr=Ce.onTabClick,jn=Ce.getPopupContainer,Zn=Ce.popupClassName,Jn=(0,ze.useState)(!1),Qn=(0,pe.Z)(Jn,2),hr=Qn[0],Pe=Qn[1],$e=(0,ze.useState)(null),xt=(0,pe.Z)($e,2),rt=xt[0],It=xt[1],rn="".concat(He,"-more-popup"),fn="".concat(Be,"-dropdown"),On=rt!==null?"".concat(rn,"-").concat(rt):null,wn=et==null?void 0:et.dropdownAriaLabel;function Xt(Dr,zr){Dr.preventDefault(),Dr.stopPropagation(),pn.onEdit("remove",{key:zr,event:Dr})}var Nn=ze.createElement(Ci.ZP,{onClick:function(zr){var xr=zr.key,Or=zr.domEvent;cr(xr,Or),Pe(!1)},prefixCls:"".concat(fn,"-menu"),id:rn,tabIndex:-1,role:"listbox","aria-activedescendant":On,selectedKeys:[rt],"aria-label":wn!==void 0?wn:"expanded dropdown"},Ge.map(function(Dr){var zr=Dr.closable,xr=Dr.disabled,Or=Dr.closeIcon,Jr=Dr.key,ai=Dr.label,Ir=ue(zr,Or,pn,xr);return ze.createElement(Ci.sN,{key:Jr,id:"".concat(rn,"-").concat(Jr),role:"option","aria-controls":He&&"".concat(He,"-panel-").concat(Jr),disabled:xr},ze.createElement("span",null,ai),Ir&&ze.createElement("button",{type:"button","aria-label":In||"remove",tabIndex:0,className:"".concat(fn,"-menu-item-remove"),onClick:function(Pi){Pi.stopPropagation(),Xt(Pi,Jr)}},Or||pn.removeIcon||"\xD7"))}));function Fn(Dr){for(var zr=Ge.filter(function(Ir){return!Ir.disabled}),xr=zr.findIndex(function(Ir){return Ir.key===rt})||0,Or=zr.length,Jr=0;Jr<Or;Jr+=1){xr=(xr+Dr+Or)%Or;var ai=zr[xr];if(!ai.disabled){It(ai.key);return}}}function mr(Dr){var zr=Dr.which;if(!hr){[Mn.DOWN,Mn.SPACE,Mn.ENTER].includes(zr)&&(Pe(!0),Dr.preventDefault());return}switch(zr){case Mn.UP:Fn(-1),Dr.preventDefault();break;case Mn.DOWN:Fn(1),Dr.preventDefault();break;case Mn.ESC:Pe(!1);break;case Mn.SPACE:case Mn.ENTER:rt!==null&&cr(rt,Dr);break}}(0,ze.useEffect)(function(){var Dr=document.getElementById(On);Dr&&Dr.scrollIntoView&&Dr.scrollIntoView(!1)},[rt]),(0,ze.useEffect)(function(){hr||It(null)},[hr]);var Bn=(0,Le.Z)({},Cn?"marginRight":"marginLeft",dn);Ge.length||(Bn.visibility="hidden",Bn.order=1);var Lr=be()((0,Le.Z)({},"".concat(fn,"-rtl"),Cn)),Zr=bt?null:ze.createElement(Qi,{prefixCls:fn,overlay:Nn,trigger:["hover"],visible:Ge.length?hr:!1,transitionName:Gn,onVisibleChange:Pe,overlayClassName:be()(Lr,Zn),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:jn},ze.createElement("button",{type:"button",className:"".concat(Be,"-nav-more"),style:Bn,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":rn,id:"".concat(He,"-more"),"aria-expanded":hr,onKeyDown:mr},Jt));return ze.createElement("div",{className:be()("".concat(Be,"-nav-operations"),Wn),style:fr,ref:Ne},Zr,ze.createElement(ye,{prefixCls:Be,locale:et,editable:pn}))}var An=ze.memo(ze.forwardRef(En),function(Ce,Ne){return Ne.tabMoving});function sr(Ce){var Ne,Be=Ce.prefixCls,He=Ce.id,Ge=Ce.active,et=Ce.tab,bt=et.key,Zt=et.label,Jt=et.disabled,Gn=et.closeIcon,fr=Ce.closable,Wn=Ce.renderWrapper,pn=Ce.removeAriaLabel,dn=Ce.editable,Cn=Ce.onClick,In=Ce.onFocus,cr=Ce.style,jn="".concat(Be,"-tab"),Zn=ue(fr,Gn,dn,Jt);function Jn(Pe){Jt||Cn(Pe)}function Qn(Pe){Pe.preventDefault(),Pe.stopPropagation(),dn.onEdit("remove",{key:bt,event:Pe})}var hr=ze.createElement("div",{key:bt,"data-node-key":Ee(bt),className:be()(jn,(Ne={},(0,Le.Z)(Ne,"".concat(jn,"-with-remove"),Zn),(0,Le.Z)(Ne,"".concat(jn,"-active"),Ge),(0,Le.Z)(Ne,"".concat(jn,"-disabled"),Jt),Ne)),style:cr,onClick:Jn},ze.createElement("div",{role:"tab","aria-selected":Ge,id:He&&"".concat(He,"-tab-").concat(bt),className:"".concat(jn,"-btn"),"aria-controls":He&&"".concat(He,"-panel-").concat(bt),"aria-disabled":Jt,tabIndex:Jt?null:0,onClick:function($e){$e.stopPropagation(),Jn($e)},onKeyDown:function($e){[Mn.SPACE,Mn.ENTER].includes($e.which)&&($e.preventDefault(),Jn($e))},onFocus:In},Zt),Zn&&ze.createElement("button",{type:"button","aria-label":pn||"remove",tabIndex:0,className:"".concat(jn,"-remove"),onClick:function($e){$e.stopPropagation(),Qn($e)}},Gn||dn.removeIcon||"\xD7"));return Wn?Wn(hr):hr}var nr=sr,pr=function(Ne){return+setTimeout(Ne,16)},Kn=function(Ne){return clearTimeout(Ne)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(pr=function(Ne){return window.requestAnimationFrame(Ne)},Kn=function(Ne){return window.cancelAnimationFrame(Ne)});var Ue=0,it=new Map;function _t(Ce){it.delete(Ce)}var Ut=function(Ne){var Be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Ue+=1;var He=Ue;function Ge(et){if(et===0)_t(He),Ne();else{var bt=pr(function(){Ge(et-1)});it.set(He,bt)}}return Ge(Be),He};Ut.cancel=function(Ce){var Ne=it.get(Ce);return _t(Ne),Kn(Ne)};var Ke=Ut,ut=function(Ne){var Be=Ne.activeTabOffset,He=Ne.horizontal,Ge=Ne.rtl,et=Ne.indicatorSize,bt=(0,ze.useState)(),Zt=(0,pe.Z)(bt,2),Jt=Zt[0],Gn=Zt[1],fr=(0,ze.useRef)(),Wn=function(Cn){return typeof et=="function"?et(Cn):typeof et=="number"?et:Cn};function pn(){Ke.cancel(fr.current)}return(0,ze.useEffect)(function(){var dn={};return Be&&(He?(Ge?(dn.right=Be.right+Be.width/2,dn.transform="translateX(50%)"):(dn.left=Be.left+Be.width/2,dn.transform="translateX(-50%)"),dn.width=Wn(Be.width)):(dn.top=Be.top+Be.height/2,dn.transform="translateY(-50%)",dn.height=Wn(Be.height))),pn(),fr.current=Ke(function(){Gn(dn)}),pn},[Be,He,Ge,et]),{style:Jt}},Ot=ut,Tt=function(Ne){var Be=Ne.current||{},He=Be.offsetWidth,Ge=He===void 0?0:He,et=Be.offsetHeight,bt=et===void 0?0:et;return[Ge,bt]},zt=function(Ne,Be){return Ne[Be?0:1]};function Ht(Ce,Ne){var Be,He=ze.useContext(Ve),Ge=He.prefixCls,et=He.tabs,bt=Ce.className,Zt=Ce.style,Jt=Ce.id,Gn=Ce.animated,fr=Ce.activeKey,Wn=Ce.rtl,pn=Ce.extra,dn=Ce.editable,Cn=Ce.locale,In=Ce.tabPosition,cr=Ce.tabBarGutter,jn=Ce.children,Zn=Ce.onTabClick,Jn=Ce.onTabScroll,Qn=Ce.indicatorSize,hr=(0,ze.useRef)(),Pe=(0,ze.useRef)(),$e=(0,ze.useRef)(),xt=(0,ze.useRef)(),rt=(0,ze.useRef)(),It=(0,ze.useRef)(),rn=(0,ze.useRef)(),fn=In==="top"||In==="bottom",On=$t(0,function(na,Oi){fn&&Jn&&Jn({direction:na>Oi?"left":"right"})}),wn=(0,pe.Z)(On,2),Xt=wn[0],Nn=wn[1],Fn=$t(0,function(na,Oi){!fn&&Jn&&Jn({direction:na>Oi?"top":"bottom"})}),mr=(0,pe.Z)(Fn,2),Bn=mr[0],Lr=mr[1],Zr=(0,ze.useState)([0,0]),Dr=(0,pe.Z)(Zr,2),zr=Dr[0],xr=Dr[1],Or=(0,ze.useState)([0,0]),Jr=(0,pe.Z)(Or,2),ai=Jr[0],Ir=Jr[1],ci=(0,ze.useState)([0,0]),Pi=(0,pe.Z)(ci,2),ta=Pi[0],Vi=Pi[1],Bi=(0,ze.useState)([0,0]),Xi=(0,pe.Z)(Bi,2),qi=Xi[0],bi=Xi[1],$i=mn(new Map),jr=(0,pe.Z)($i,2),di=jr[0],Ti=jr[1],ji=Ae(et,di,ai[0]),Ba=zt(zr,fn),$a=zt(ai,fn),Aa=zt(ta,fn),ca=zt(qi,fn),Yi=Ba<$a+Aa,Mi=Yi?Ba-ca:Ba-Aa,Oa="".concat(Ge,"-nav-operations-hidden"),ki=0,Qr=0;fn&&Wn?(ki=0,Qr=Math.max(0,$a-Mi)):(ki=Math.min(0,Mi-$a),Qr=0);function zi(na){return na<ki?ki:na>Qr?Qr:na}var ua=(0,ze.useRef)(),Ui=(0,ze.useState)(),ia=(0,pe.Z)(Ui,2),hi=ia[0],pa=ia[1];function xa(){pa(Date.now())}function fa(){window.clearTimeout(ua.current)}Gt(xt,function(na,Oi){function Ta(_a,co){_a(function(ao){var hs=zi(ao+co);return hs})}return Yi?(fn?Ta(Nn,na):Ta(Lr,Oi),fa(),xa(),!0):!1}),(0,ze.useEffect)(function(){return fa(),hi&&(ua.current=window.setTimeout(function(){pa(0)},100)),fa},[hi]);var wa=Ft(ji,Mi,fn?Xt:Bn,$a,Aa,ca,(0,Se.Z)((0,Se.Z)({},Ce),{},{tabs:et})),Ea=(0,pe.Z)(wa,2),Va=Ea[0],ha=Ea[1],ka=kt(function(){var na=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fr,Oi=ji.get(na)||{width:0,height:0,left:0,right:0,top:0};if(fn){var Ta=Xt;Wn?Oi.right<Xt?Ta=Oi.right:Oi.right+Oi.width>Xt+Mi&&(Ta=Oi.right+Oi.width-Mi):Oi.left<-Xt?Ta=-Oi.left:Oi.left+Oi.width>-Xt+Mi&&(Ta=-(Oi.left+Oi.width-Mi)),Lr(0),Nn(zi(Ta))}else{var _a=Bn;Oi.top<-Bn?_a=-Oi.top:Oi.top+Oi.height>-Bn+Mi&&(_a=-(Oi.top+Oi.height-Mi)),Nn(0),Lr(zi(_a))}}),Ja={};In==="top"||In==="bottom"?Ja[Wn?"marginRight":"marginLeft"]=cr:Ja.marginTop=cr;var Ga=et.map(function(na,Oi){var Ta=na.key;return ze.createElement(nr,{id:Jt,prefixCls:Ge,key:Ta,tab:na,style:Oi===0?void 0:Ja,closable:na.closable,editable:dn,active:Ta===fr,renderWrapper:jn,removeAriaLabel:Cn==null?void 0:Cn.removeAriaLabel,onClick:function(co){Zn(Ta,co)},onFocus:function(){ka(Ta),xa(),xt.current&&(Wn||(xt.current.scrollLeft=0),xt.current.scrollTop=0)}})}),so=function(){return Ti(function(){var Oi=new Map;return et.forEach(function(Ta){var _a,co=Ta.key,ao=(_a=rt.current)===null||_a===void 0?void 0:_a.querySelector('[data-node-key="'.concat(Ee(co),'"]'));ao&&Oi.set(co,{width:ao.offsetWidth,height:ao.offsetHeight,left:ao.offsetLeft,top:ao.offsetTop})}),Oi})};(0,ze.useEffect)(function(){so()},[et.map(function(na){return na.key}).join("_")]);var Fa=zn(function(){var na=Tt(hr),Oi=Tt(Pe),Ta=Tt($e);xr([na[0]-Oi[0]-Ta[0],na[1]-Oi[1]-Ta[1]]);var _a=Tt(rn);Vi(_a);var co=Tt(It);bi(co);var ao=Tt(rt);Ir([ao[0]-_a[0],ao[1]-_a[1]]),so()}),Ca=et.slice(0,Va),_i=et.slice(ha+1),Ki=[].concat((0,je.Z)(Ca),(0,je.Z)(_i)),da=ji.get(fr),Sa=Ot({activeTabOffset:da,horizontal:fn,rtl:Wn,indicatorSize:Qn}),Ka=Sa.style;(0,ze.useEffect)(function(){ka()},[fr,ki,Qr,Pn(da),Pn(ji),fn]),(0,ze.useEffect)(function(){Fa()},[Wn]);var io=!!Ki.length,ho="".concat(Ge,"-nav-wrap"),Oo,Ro,lo,Ao;return fn?Wn?(Ro=Xt>0,Oo=Xt!==Qr):(Oo=Xt<0,Ro=Xt!==ki):(lo=Bn<0,Ao=Bn!==ki),ze.createElement(Rt.Z,{onResize:Fa},ze.createElement("div",{ref:er(Ne,hr),role:"tablist",className:be()("".concat(Ge,"-nav"),bt),style:Zt,onKeyDown:function(){xa()}},ze.createElement(le,{ref:Pe,position:"left",extra:pn,prefixCls:Ge}),ze.createElement(Rt.Z,{onResize:Fa},ze.createElement("div",{className:be()(ho,(Be={},(0,Le.Z)(Be,"".concat(ho,"-ping-left"),Oo),(0,Le.Z)(Be,"".concat(ho,"-ping-right"),Ro),(0,Le.Z)(Be,"".concat(ho,"-ping-top"),lo),(0,Le.Z)(Be,"".concat(ho,"-ping-bottom"),Ao),Be)),ref:xt},ze.createElement(Rt.Z,{onResize:Fa},ze.createElement("div",{ref:rt,className:"".concat(Ge,"-nav-list"),style:{transform:"translate(".concat(Xt,"px, ").concat(Bn,"px)"),transition:hi?"none":void 0}},Ga,ze.createElement(ye,{ref:rn,prefixCls:Ge,locale:Cn,editable:dn,style:(0,Se.Z)((0,Se.Z)({},Ga.length===0?void 0:Ja),{},{visibility:io?"hidden":null})}),ze.createElement("div",{className:be()("".concat(Ge,"-ink-bar"),(0,Le.Z)({},"".concat(Ge,"-ink-bar-animated"),Gn.inkBar)),style:Ka}))))),ze.createElement(An,(0,_e.Z)({},Ce,{removeAriaLabel:Cn==null?void 0:Cn.removeAriaLabel,ref:It,prefixCls:Ge,tabs:Ki,className:!io&&Oa,tabMoving:!!hi})),ze.createElement(le,{ref:$e,position:"right",extra:pn,prefixCls:Ge})))}var $n=ze.forwardRef(Ht),Cr=["renderTabBar"],Yn=["label","key"];function qn(Ce){var Ne=Ce.renderTabBar,Be=(0,gt.Z)(Ce,Cr),He=ze.useContext(Ve),Ge=He.tabs;if(Ne){var et=(0,Se.Z)((0,Se.Z)({},Be),{},{panes:Ge.map(function(bt){var Zt=bt.label,Jt=bt.key,Gn=(0,gt.Z)(bt,Yn);return ze.createElement(Ct,(0,_e.Z)({tab:Zt,key:Jt,tabKey:Jt},Gn))})});return Ne(et,$n)}return ze.createElement($n,Be)}var rr={},ar=[],ot=function(Ne){ar.push(Ne)};function Qe(Ce,Ne){if(0)var Be}function vt(Ce,Ne){if(0)var Be}function Qt(){rr={}}function Tn(Ce,Ne,Be){!Ne&&!rr[Be]&&(Ce(!1,Be),rr[Be]=!0)}function en(Ce,Ne){Tn(Qe,Ce,Ne)}function cn(Ce,Ne){Tn(vt,Ce,Ne)}en.preMessage=ot,en.resetWarned=Qt,en.noteOnce=cn;var un=null;function Dn(){var Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},Ne;return Ce===!1?Ne={inkBar:!1,tabPane:!1}:Ce===!0?Ne={inkBar:!0,tabPane:!1}:Ne=(0,Se.Z)({inkBar:!0},(0,Te.Z)(Ce)==="object"?Ce:{}),Ne.tabPaneMotion&&Ne.tabPane===void 0&&(Ne.tabPane=!0),!Ne.tabPaneMotion&&Ne.tabPane&&(Ne.tabPane=!1),Ne}var or=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicatorSize"],Kt=0;function Yr(Ce,Ne){var Be,He=Ce.id,Ge=Ce.prefixCls,et=Ge===void 0?"rc-tabs":Ge,bt=Ce.className,Zt=Ce.items,Jt=Ce.direction,Gn=Ce.activeKey,fr=Ce.defaultActiveKey,Wn=Ce.editable,pn=Ce.animated,dn=Ce.tabPosition,Cn=dn===void 0?"top":dn,In=Ce.tabBarGutter,cr=Ce.tabBarStyle,jn=Ce.tabBarExtraContent,Zn=Ce.locale,Jn=Ce.moreIcon,Qn=Ce.moreTransitionName,hr=Ce.destroyInactiveTabPane,Pe=Ce.renderTabBar,$e=Ce.onChange,xt=Ce.onTabClick,rt=Ce.onTabScroll,It=Ce.getPopupContainer,rn=Ce.popupClassName,fn=Ce.indicatorSize,On=(0,gt.Z)(Ce,or),wn=ze.useMemo(function(){return(Zt||[]).filter(function(bi){return bi&&(0,Te.Z)(bi)==="object"&&"key"in bi})},[Zt]),Xt=Jt==="rtl",Nn=Dn(pn),Fn=(0,ze.useState)(!1),mr=(0,pe.Z)(Fn,2),Bn=mr[0],Lr=mr[1];(0,ze.useEffect)(function(){Lr(Pt())},[]);var Zr=Ie(function(){var bi;return(bi=wn[0])===null||bi===void 0?void 0:bi.key},{value:Gn,defaultValue:fr}),Dr=(0,pe.Z)(Zr,2),zr=Dr[0],xr=Dr[1],Or=(0,ze.useState)(function(){return wn.findIndex(function(bi){return bi.key===zr})}),Jr=(0,pe.Z)(Or,2),ai=Jr[0],Ir=Jr[1];(0,ze.useEffect)(function(){var bi=wn.findIndex(function(jr){return jr.key===zr});if(bi===-1){var $i;bi=Math.max(0,Math.min(ai,wn.length-1)),xr(($i=wn[bi])===null||$i===void 0?void 0:$i.key)}Ir(bi)},[wn.map(function(bi){return bi.key}).join("_"),zr,ai]);var ci=Ie(null,{value:He}),Pi=(0,pe.Z)(ci,2),ta=Pi[0],Vi=Pi[1];(0,ze.useEffect)(function(){He||(Vi("rc-tabs-".concat(Kt)),Kt+=1)},[]);function Bi(bi,$i){xt==null||xt(bi,$i);var jr=bi!==zr;xr(bi),jr&&($e==null||$e(bi))}var Xi={id:ta,activeKey:zr,animated:Nn,tabPosition:Cn,rtl:Xt,mobile:Bn},qi=(0,Se.Z)((0,Se.Z)({},Xi),{},{editable:Wn,locale:Zn,moreIcon:Jn,moreTransitionName:Qn,tabBarGutter:In,onTabClick:Bi,onTabScroll:rt,extra:jn,style:cr,panes:null,getPopupContainer:It,popupClassName:rn,indicatorSize:fn});return ze.createElement(Ve.Provider,{value:{tabs:wn,prefixCls:et}},ze.createElement("div",(0,_e.Z)({ref:Ne,id:He,className:be()(et,"".concat(et,"-").concat(Cn),(Be={},(0,Le.Z)(Be,"".concat(et,"-mobile"),Bn),(0,Le.Z)(Be,"".concat(et,"-editable"),Wn),(0,Le.Z)(Be,"".concat(et,"-rtl"),Xt),Be),bt)},On),ze.createElement(qn,(0,_e.Z)({},qi,{renderTabBar:Pe})),ze.createElement(Mt,(0,_e.Z)({destroyInactiveTabPane:hr},Xi,{animated:Nn}))))}var $r=ze.forwardRef(Yr),Ri=$r,Li=Ri,pi=ce(53124),Gi=ce(98675),ii=()=>null,Ni=ce(33603);const Zi={motionAppear:!1,motionEnter:!0,motionLeave:!0};function Vr(Ce){let Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},Be;return Ne===!1?Be={inkBar:!1,tabPane:!1}:Ne===!0?Be={inkBar:!0,tabPane:!0}:Be=Object.assign({inkBar:!0},typeof Ne=="object"?Ne:{}),Be.tabPane&&(Be.tabPaneMotion=Object.assign(Object.assign({},Zi),{motionName:(0,Ni.m)(Ce,"switch")})),Be}var mi=ce(37419),Wi=function(Ce,Ne){var Be={};for(var He in Ce)Object.prototype.hasOwnProperty.call(Ce,He)&&Ne.indexOf(He)<0&&(Be[He]=Ce[He]);if(Ce!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ge=0,He=Object.getOwnPropertySymbols(Ce);Ge<He.length;Ge++)Ne.indexOf(He[Ge])<0&&Object.prototype.propertyIsEnumerable.call(Ce,He[Ge])&&(Be[He[Ge]]=Ce[He[Ge]]);return Be};function la(Ce){return Ce.filter(Ne=>Ne)}function ea(Ce,Ne){if(Ce)return Ce;const Be=(0,mi.Z)(Ne).map(He=>{if(ze.isValidElement(He)){const{key:Ge,props:et}=He,bt=et||{},{tab:Zt}=bt,Jt=Wi(bt,["tab"]);return Object.assign(Object.assign({key:String(Ge)},Jt),{label:Zt})}return null});return la(Be)}var ti=ce(14747),yt=ce(67968),ht=ce(45503),Bt=ce(67771),kn=Ce=>{const{componentCls:Ne,motionDurationSlow:Be}=Ce;return[{[Ne]:{[`${Ne}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${Be}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${Be}`}}}}},[(0,Bt.oN)(Ce,"slide-up"),(0,Bt.oN)(Ce,"slide-down")]]};const ur=Ce=>{const{componentCls:Ne,tabsCardPadding:Be,cardBg:He,cardGutter:Ge,colorBorderSecondary:et,itemSelectedColor:bt}=Ce;return{[`${Ne}-card`]:{[`> ${Ne}-nav, > div > ${Ne}-nav`]:{[`${Ne}-tab`]:{margin:0,padding:Be,background:He,border:`${Ce.lineWidth}px ${Ce.lineType} ${et}`,transition:`all ${Ce.motionDurationSlow} ${Ce.motionEaseInOut}`},[`${Ne}-tab-active`]:{color:bt,background:Ce.colorBgContainer},[`${Ne}-ink-bar`]:{visibility:"hidden"}},[`&${Ne}-top, &${Ne}-bottom`]:{[`> ${Ne}-nav, > div > ${Ne}-nav`]:{[`${Ne}-tab + ${Ne}-tab`]:{marginLeft:{_skip_check_:!0,value:`${Ge}px`}}}},[`&${Ne}-top`]:{[`> ${Ne}-nav, > div > ${Ne}-nav`]:{[`${Ne}-tab`]:{borderRadius:`${Ce.borderRadiusLG}px ${Ce.borderRadiusLG}px 0 0`},[`${Ne}-tab-active`]:{borderBottomColor:Ce.colorBgContainer}}},[`&${Ne}-bottom`]:{[`> ${Ne}-nav, > div > ${Ne}-nav`]:{[`${Ne}-tab`]:{borderRadius:`0 0 ${Ce.borderRadiusLG}px ${Ce.borderRadiusLG}px`},[`${Ne}-tab-active`]:{borderTopColor:Ce.colorBgContainer}}},[`&${Ne}-left, &${Ne}-right`]:{[`> ${Ne}-nav, > div > ${Ne}-nav`]:{[`${Ne}-tab + ${Ne}-tab`]:{marginTop:`${Ge}px`}}},[`&${Ne}-left`]:{[`> ${Ne}-nav, > div > ${Ne}-nav`]:{[`${Ne}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Ce.borderRadiusLG}px 0 0 ${Ce.borderRadiusLG}px`}},[`${Ne}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:Ce.colorBgContainer}}}},[`&${Ne}-right`]:{[`> ${Ne}-nav, > div > ${Ne}-nav`]:{[`${Ne}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Ce.borderRadiusLG}px ${Ce.borderRadiusLG}px 0`}},[`${Ne}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:Ce.colorBgContainer}}}}}}},Er=Ce=>{const{componentCls:Ne,itemHoverColor:Be,dropdownEdgeChildVerticalPadding:He}=Ce;return{[`${Ne}-dropdown`]:Object.assign(Object.assign({},(0,ti.Wf)(Ce)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:Ce.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${Ne}-dropdown-menu`]:{maxHeight:Ce.tabsDropdownHeight,margin:0,padding:`${He}px 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:Ce.colorBgContainer,backgroundClip:"padding-box",borderRadius:Ce.borderRadiusLG,outline:"none",boxShadow:Ce.boxShadowSecondary,"&-item":Object.assign(Object.assign({},ti.vS),{display:"flex",alignItems:"center",minWidth:Ce.tabsDropdownWidth,margin:0,padding:`${Ce.paddingXXS}px ${Ce.paddingSM}px`,color:Ce.colorText,fontWeight:"normal",fontSize:Ce.fontSize,lineHeight:Ce.lineHeight,cursor:"pointer",transition:`all ${Ce.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:Ce.marginSM},color:Ce.colorTextDescription,fontSize:Ce.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:Be}},"&:hover":{background:Ce.controlItemBgHover},"&-disabled":{"&, &:hover":{color:Ce.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},Br=Ce=>{const{componentCls:Ne,margin:Be,colorBorderSecondary:He,horizontalMargin:Ge,verticalItemPadding:et,verticalItemMargin:bt}=Ce;return{[`${Ne}-top, ${Ne}-bottom`]:{flexDirection:"column",[`> ${Ne}-nav, > div > ${Ne}-nav`]:{margin:Ge,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${Ce.lineWidth}px ${Ce.lineType} ${He}`,content:"''"},[`${Ne}-ink-bar`]:{height:Ce.lineWidthBold,"&-animated":{transition:`width ${Ce.motionDurationSlow}, left ${Ce.motionDurationSlow},
right ${Ce.motionDurationSlow}`}},[`${Ne}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:Ce.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:Ce.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:Ce.boxShadowTabsOverflowRight},[`&${Ne}-nav-wrap-ping-left::before`]:{opacity:1},[`&${Ne}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${Ne}-top`]:{[`> ${Ne}-nav,
> div > ${Ne}-nav`]:{"&::before":{bottom:0},[`${Ne}-ink-bar`]:{bottom:0}}},[`${Ne}-bottom`]:{[`> ${Ne}-nav, > div > ${Ne}-nav`]:{order:1,marginTop:`${Be}px`,marginBottom:0,"&::before":{top:0},[`${Ne}-ink-bar`]:{top:0}},[`> ${Ne}-content-holder, > div > ${Ne}-content-holder`]:{order:0}},[`${Ne}-left, ${Ne}-right`]:{[`> ${Ne}-nav, > div > ${Ne}-nav`]:{flexDirection:"column",minWidth:Ce.controlHeight*1.25,[`${Ne}-tab`]:{padding:et,textAlign:"center"},[`${Ne}-tab + ${Ne}-tab`]:{margin:bt},[`${Ne}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:Ce.controlHeight},"&::before":{top:0,boxShadow:Ce.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:Ce.boxShadowTabsOverflowBottom},[`&${Ne}-nav-wrap-ping-top::before`]:{opacity:1},[`&${Ne}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${Ne}-ink-bar`]:{width:Ce.lineWidthBold,"&-animated":{transition:`height ${Ce.motionDurationSlow}, top ${Ce.motionDurationSlow}`}},[`${Ne}-nav-list, ${Ne}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${Ne}-left`]:{[`> ${Ne}-nav, > div > ${Ne}-nav`]:{[`${Ne}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${Ne}-content-holder, > div > ${Ne}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${Ce.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${Ce.lineWidth}px ${Ce.lineType} ${Ce.colorBorder}`},[`> ${Ne}-content > ${Ne}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:Ce.paddingLG}}}},[`${Ne}-right`]:{[`> ${Ne}-nav, > div > ${Ne}-nav`]:{order:1,[`${Ne}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${Ne}-content-holder, > div > ${Ne}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-Ce.lineWidth},borderRight:{_skip_check_:!0,value:`${Ce.lineWidth}px ${Ce.lineType} ${Ce.colorBorder}`},[`> ${Ne}-content > ${Ne}-tabpane`]:{paddingRight:{_skip_check_:!0,value:Ce.paddingLG}}}}}},Hr=Ce=>{const{componentCls:Ne,cardPaddingSM:Be,cardPaddingLG:He,horizontalItemPaddingSM:Ge,horizontalItemPaddingLG:et}=Ce;return{[Ne]:{"&-small":{[`> ${Ne}-nav`]:{[`${Ne}-tab`]:{padding:Ge,fontSize:Ce.titleFontSizeSM}}},"&-large":{[`> ${Ne}-nav`]:{[`${Ne}-tab`]:{padding:et,fontSize:Ce.titleFontSizeLG}}}},[`${Ne}-card`]:{[`&${Ne}-small`]:{[`> ${Ne}-nav`]:{[`${Ne}-tab`]:{padding:Be}},[`&${Ne}-bottom`]:{[`> ${Ne}-nav ${Ne}-tab`]:{borderRadius:`0 0 ${Ce.borderRadius}px ${Ce.borderRadius}px`}},[`&${Ne}-top`]:{[`> ${Ne}-nav ${Ne}-tab`]:{borderRadius:`${Ce.borderRadius}px ${Ce.borderRadius}px 0 0`}},[`&${Ne}-right`]:{[`> ${Ne}-nav ${Ne}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Ce.borderRadius}px ${Ce.borderRadius}px 0`}}},[`&${Ne}-left`]:{[`> ${Ne}-nav ${Ne}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Ce.borderRadius}px 0 0 ${Ce.borderRadius}px`}}}},[`&${Ne}-large`]:{[`> ${Ne}-nav`]:{[`${Ne}-tab`]:{padding:He}}}}}},Nr=Ce=>{const{componentCls:Ne,itemActiveColor:Be,itemHoverColor:He,iconCls:Ge,tabsHorizontalItemMargin:et,horizontalItemPadding:bt,itemSelectedColor:Zt,itemColor:Jt}=Ce,Gn=`${Ne}-tab`;return{[Gn]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:bt,fontSize:Ce.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:Jt,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:Be}},(0,ti.Qy)(Ce)),"&-btn":{outline:"none",transition:"all 0.3s"},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:-Ce.marginXXS},marginLeft:{_skip_check_:!0,value:Ce.marginXS},color:Ce.colorTextDescription,fontSize:Ce.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${Ce.motionDurationSlow}`,"&:hover":{color:Ce.colorTextHeading}},"&:hover":{color:He},[`&${Gn}-active ${Gn}-btn`]:{color:Zt,textShadow:Ce.tabsActiveTextShadow},[`&${Gn}-disabled`]:{color:Ce.colorTextDisabled,cursor:"not-allowed"},[`&${Gn}-disabled ${Gn}-btn, &${Gn}-disabled ${Ne}-remove`]:{"&:focus, &:active":{color:Ce.colorTextDisabled}},[`& ${Gn}-remove ${Ge}`]:{margin:0},[Ge]:{marginRight:{_skip_check_:!0,value:Ce.marginSM}}},[`${Gn} + ${Gn}`]:{margin:{_skip_check_:!0,value:et}}}},ei=Ce=>{const{componentCls:Ne,tabsHorizontalItemMarginRTL:Be,iconCls:He,cardGutter:Ge}=Ce;return{[`${Ne}-rtl`]:{direction:"rtl",[`${Ne}-nav`]:{[`${Ne}-tab`]:{margin:{_skip_check_:!0,value:Be},[`${Ne}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[He]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${Ce.marginSM}px`}},[`${Ne}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${Ce.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${Ce.marginXXS}px`},[He]:{margin:0}}}},[`&${Ne}-left`]:{[`> ${Ne}-nav`]:{order:1},[`> ${Ne}-content-holder`]:{order:0}},[`&${Ne}-right`]:{[`> ${Ne}-nav`]:{order:0},[`> ${Ne}-content-holder`]:{order:1}},[`&${Ne}-card${Ne}-top, &${Ne}-card${Ne}-bottom`]:{[`> ${Ne}-nav, > div > ${Ne}-nav`]:{[`${Ne}-tab + ${Ne}-tab`]:{marginRight:{_skip_check_:!0,value:Ge},marginLeft:{_skip_check_:!0,value:0}}}}},[`${Ne}-dropdown-rtl`]:{direction:"rtl"},[`${Ne}-menu-item`]:{[`${Ne}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},gi=Ce=>{const{componentCls:Ne,tabsCardPadding:Be,cardHeight:He,cardGutter:Ge,itemHoverColor:et,itemActiveColor:bt,colorBorderSecondary:Zt}=Ce;return{[Ne]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,ti.Wf)(Ce)),{display:"flex",[`> ${Ne}-nav, > div > ${Ne}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${Ne}-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 ${Ce.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${Ne}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${Ce.motionDurationSlow}`},[`${Ne}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${Ne}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${Ne}-nav-more`]:{position:"relative",padding:Be,background:"transparent",border:0,color:Ce.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:Ce.controlHeightLG/8,transform:"translateY(100%)",content:"''"}},[`${Ne}-nav-add`]:Object.assign({minWidth:He,marginLeft:{_skip_check_:!0,value:Ge},padding:`0 ${Ce.paddingXS}px`,background:"transparent",border:`${Ce.lineWidth}px ${Ce.lineType} ${Zt}`,borderRadius:`${Ce.borderRadiusLG}px ${Ce.borderRadiusLG}px 0 0`,outline:"none",cursor:"pointer",color:Ce.colorText,transition:`all ${Ce.motionDurationSlow} ${Ce.motionEaseInOut}`,"&:hover":{color:et},"&:active, &:focus:not(:focus-visible)":{color:bt}},(0,ti.Qy)(Ce))},[`${Ne}-extra-content`]:{flex:"none"},[`${Ne}-ink-bar`]:{position:"absolute",background:Ce.inkBarColor,pointerEvents:"none"}}),Nr(Ce)),{[`${Ne}-content`]:{position:"relative",width:"100%"},[`${Ne}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${Ne}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${Ne}-centered`]:{[`> ${Ne}-nav, > div > ${Ne}-nav`]:{[`${Ne}-nav-wrap`]:{[`&:not([class*='${Ne}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}};var Mr=(0,yt.Z)("Tabs",Ce=>{const Ne=(0,ht.TS)(Ce,{tabsCardPadding:Ce.cardPadding||`${(Ce.cardHeight-Math.round(Ce.fontSize*Ce.lineHeight))/2-Ce.lineWidth}px ${Ce.padding}px`,dropdownEdgeChildVerticalPadding:Ce.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${Ce.horizontalItemGutter}px`,tabsHorizontalItemMarginRTL:`0 0 0 ${Ce.horizontalItemGutter}px`});return[Hr(Ne),ei(Ne),Br(Ne),Er(Ne),ur(Ne),gi(Ne),kn(Ne)]},Ce=>{const Ne=Ce.controlHeightLG;return{zIndexPopup:Ce.zIndexPopupBase+50,cardBg:Ce.colorFillAlter,cardHeight:Ne,cardPadding:"",cardPaddingSM:`${Ce.paddingXXS*1.5}px ${Ce.padding}px`,cardPaddingLG:`${Ce.paddingXS}px ${Ce.padding}px ${Ce.paddingXXS*1.5}px`,titleFontSize:Ce.fontSize,titleFontSizeLG:Ce.fontSizeLG,titleFontSizeSM:Ce.fontSize,inkBarColor:Ce.colorPrimary,horizontalMargin:`0 0 ${Ce.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${Ce.paddingSM}px 0`,horizontalItemPaddingSM:`${Ce.paddingXS}px 0`,horizontalItemPaddingLG:`${Ce.padding}px 0`,verticalItemPadding:`${Ce.paddingXS}px ${Ce.paddingLG}px`,verticalItemMargin:`${Ce.margin}px 0 0 0`,itemColor:Ce.colorText,itemSelectedColor:Ce.colorPrimary,itemHoverColor:Ce.colorPrimaryHover,itemActiveColor:Ce.colorPrimaryActive,cardGutter:Ce.marginXXS/2}}),fi=function(Ce,Ne){var Be={};for(var He in Ce)Object.prototype.hasOwnProperty.call(Ce,He)&&Ne.indexOf(He)<0&&(Be[He]=Ce[He]);if(Ce!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ge=0,He=Object.getOwnPropertySymbols(Ce);Ge<He.length;Ge++)Ne.indexOf(He[Ge])<0&&Object.prototype.propertyIsEnumerable.call(Ce,He[Ge])&&(Be[He[Ge]]=Ce[He[Ge]]);return Be};const Ai=Ce=>{const{type:Ne,className:Be,rootClassName:He,size:Ge,onEdit:et,hideAdd:bt,centered:Zt,addIcon:Jt,popupClassName:Gn,children:fr,items:Wn,animated:pn,style:dn,indicatorSize:Cn}=Ce,In=fi(Ce,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize"]),{prefixCls:cr,moreIcon:jn=ze.createElement(tt.Z,null)}=In,{direction:Zn,tabs:Jn,getPrefixCls:Qn,getPopupContainer:hr}=ze.useContext(pi.E_),Pe=Qn("tabs",cr),[$e,xt]=Mr(Pe);let rt;Ne==="editable-card"&&(rt={onEdit:(Xt,Nn)=>{let{key:Fn,event:mr}=Nn;et==null||et(Xt==="add"?mr:Fn,Xt)},removeIcon:ze.createElement(fe.Z,null),addIcon:Jt||ze.createElement(Fe.Z,null),showAdd:bt!==!0});const It=Qn(),rn=ea(Wn,fr),fn=Vr(Pe,pn),On=(0,Gi.Z)(Ge),wn=Object.assign(Object.assign({},Jn==null?void 0:Jn.style),dn);return $e(ze.createElement(Li,Object.assign({direction:Zn,getPopupContainer:hr,moreTransitionName:`${It}-slide-up`},In,{items:rn,className:be()({[`${Pe}-${On}`]:On,[`${Pe}-card`]:["card","editable-card"].includes(Ne),[`${Pe}-editable-card`]:Ne==="editable-card",[`${Pe}-centered`]:Zt},Jn==null?void 0:Jn.className,Be,He,xt),popupClassName:be()(Gn,xt),style:wn,editable:rt,moreIcon:jn,prefixCls:Pe,animated:fn,indicatorSize:Cn!=null?Cn:Jn==null?void 0:Jn.indicatorSize})))};Ai.TabPane=ii;var Si=Ai},59810:function(Ln,qt,ce){"use strict";ce.d(qt,{default:function(){return ar}});var fe=ce(67294),tt=ce(74902),Fe=ce(94184),Ye=ce.n(Fe),be=ce(87462),_e=ce(15671),Le=ce(43144),Se=ce(60136),pe=ce(51630),Te=ce(4942),gt=ce(45987),ze=ce(74165),Pt=ce(71002),kt=ce(15861),pt=ce(64217);function Je(ot,Qe){var vt="cannot ".concat(ot.method," ").concat(ot.action," ").concat(Qe.status,"'"),Qt=new Error(vt);return Qt.status=Qe.status,Qt.method=ot.method,Qt.url=ot.action,Qt}function De(ot){var Qe=ot.responseText||ot.response;if(!Qe)return Qe;try{return JSON.parse(Qe)}catch(vt){return Qe}}function Dt(ot){var Qe=new XMLHttpRequest;ot.onProgress&&Qe.upload&&(Qe.upload.onprogress=function(en){en.total>0&&(en.percent=en.loaded/en.total*100),ot.onProgress(en)});var vt=new FormData;ot.data&&Object.keys(ot.data).forEach(function(Tn){var en=ot.data[Tn];if(Array.isArray(en)){en.forEach(function(cn){vt.append("".concat(Tn,"[]"),cn)});return}vt.append(Tn,en)}),ot.file instanceof Blob?vt.append(ot.filename,ot.file,ot.file.name):vt.append(ot.filename,ot.file),Qe.onerror=function(en){ot.onError(en)},Qe.onload=function(){return Qe.status<200||Qe.status>=300?ot.onError(Je(ot,Qe),De(Qe)):ot.onSuccess(De(Qe),Qe)},Qe.open(ot.method,ot.action,!0),ot.withCredentials&&"withCredentials"in Qe&&(Qe.withCredentials=!0);var Qt=ot.headers||{};return Qt["X-Requested-With"]!==null&&Qe.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(Qt).forEach(function(Tn){Qt[Tn]!==null&&Qe.setRequestHeader(Tn,Qt[Tn])}),Qe.send(vt),{abort:function(){Qe.abort()}}}var Yt=+new Date,nt=0;function ct(){return"rc-upload-".concat(Yt,"-").concat(++nt)}var Ie=ce(80334),Me=function(ot,Qe){if(ot&&Qe){var vt=Array.isArray(Qe)?Qe:Qe.split(","),Qt=ot.name||"",Tn=ot.type||"",en=Tn.replace(/\/.*$/,"");return vt.some(function(cn){var un=cn.trim();if(/^\*(\/\*)?$/.test(cn))return!0;if(un.charAt(0)==="."){var Dn=Qt.toLowerCase(),or=un.toLowerCase(),Kt=[or];return(or===".jpg"||or===".jpeg")&&(Kt=[".jpg",".jpeg"]),Kt.some(function(Yr){return Dn.endsWith(Yr)})}return/\/\*$/.test(un)?en===un.replace(/\/.*$/,""):Tn===un?!0:/^\w+$/.test(un)?((0,Ie.ZP)(!1,"Upload takes an invalidate 'accept' type '".concat(un,"'.Skip for check.")),!0):!1})}return!0};function Ve(ot,Qe){var vt=ot.createReader(),Qt=[];function Tn(){vt.readEntries(function(en){var cn=Array.prototype.slice.apply(en);Qt=Qt.concat(cn);var un=!cn.length;un?Qe(Qt):Tn()})}Tn()}var Xe=function(Qe,vt,Qt){var Tn=function en(cn,un){cn&&(cn.path=un||"",cn.isFile?cn.file(function(Dn){Qt(Dn)&&(cn.fullPath&&!Dn.webkitRelativePath&&(Object.defineProperties(Dn,{webkitRelativePath:{writable:!0}}),Dn.webkitRelativePath=cn.fullPath.replace(/^\//,""),Object.defineProperties(Dn,{webkitRelativePath:{writable:!1}})),vt([Dn]))}):cn.isDirectory&&Ve(cn,function(Dn){Dn.forEach(function(or){en(or,"".concat(un).concat(cn.name,"/"))})}))};Qe.forEach(function(en){Tn(en.webkitGetAsEntry())})},Ct=Xe,wt=["component","prefixCls","className","disabled","id","style","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"],Mt=function(ot){(0,Se.Z)(vt,ot);var Qe=(0,pe.Z)(vt);function vt(){var Qt;(0,_e.Z)(this,vt);for(var Tn=arguments.length,en=new Array(Tn),cn=0;cn<Tn;cn++)en[cn]=arguments[cn];return Qt=Qe.call.apply(Qe,[this].concat(en)),Qt.state={uid:ct()},Qt.reqs={},Qt.fileInput=void 0,Qt._isMounted=void 0,Qt.onChange=function(un){var Dn=Qt.props,or=Dn.accept,Kt=Dn.directory,Yr=un.target.files,$r=(0,tt.Z)(Yr).filter(function(Ri){return!Kt||Me(Ri,or)});Qt.uploadFiles($r),Qt.reset()},Qt.onClick=function(un){var Dn=Qt.fileInput;if(Dn){var or=Qt.props,Kt=or.children,Yr=or.onClick;if(Kt&&Kt.type==="button"){var $r=Dn.parentNode;$r.focus(),$r.querySelector("button").blur()}Dn.click(),Yr&&Yr(un)}},Qt.onKeyDown=function(un){un.key==="Enter"&&Qt.onClick(un)},Qt.onFileDrop=function(un){var Dn=Qt.props.multiple;if(un.preventDefault(),un.type!=="dragover")if(Qt.props.directory)Ct(Array.prototype.slice.call(un.dataTransfer.items),Qt.uploadFiles,function(Kt){return Me(Kt,Qt.props.accept)});else{var or=(0,tt.Z)(un.dataTransfer.files).filter(function(Kt){return Me(Kt,Qt.props.accept)});Dn===!1&&(or=or.slice(0,1)),Qt.uploadFiles(or)}},Qt.uploadFiles=function(un){var Dn=(0,tt.Z)(un),or=Dn.map(function(Kt){return Kt.uid=ct(),Qt.processFile(Kt,Dn)});Promise.all(or).then(function(Kt){var Yr=Qt.props.onBatchStart;Yr==null||Yr(Kt.map(function($r){var Ri=$r.origin,Li=$r.parsedFile;return{file:Ri,parsedFile:Li}})),Kt.filter(function($r){return $r.parsedFile!==null}).forEach(function($r){Qt.post($r)})})},Qt.processFile=function(){var un=(0,kt.Z)((0,ze.Z)().mark(function Dn(or,Kt){var Yr,$r,Ri,Li,pi,Gi,yi,ii,Ni;return(0,ze.Z)().wrap(function(Vr){for(;;)switch(Vr.prev=Vr.next){case 0:if(Yr=Qt.props.beforeUpload,$r=or,!Yr){Vr.next=14;break}return Vr.prev=3,Vr.next=6,Yr(or,Kt);case 6:$r=Vr.sent,Vr.next=12;break;case 9:Vr.prev=9,Vr.t0=Vr.catch(3),$r=!1;case 12:if($r!==!1){Vr.next=14;break}return Vr.abrupt("return",{origin:or,parsedFile:null,action:null,data:null});case 14:if(Ri=Qt.props.action,typeof Ri!="function"){Vr.next=21;break}return Vr.next=18,Ri(or);case 18:Li=Vr.sent,Vr.next=22;break;case 21:Li=Ri;case 22:if(pi=Qt.props.data,typeof pi!="function"){Vr.next=29;break}return Vr.next=26,pi(or);case 26:Gi=Vr.sent,Vr.next=30;break;case 29:Gi=pi;case 30:return yi=((0,Pt.Z)($r)==="object"||typeof $r=="string")&&$r?$r:or,yi instanceof File?ii=yi:ii=new File([yi],or.name,{type:or.type}),Ni=ii,Ni.uid=or.uid,Vr.abrupt("return",{origin:or,data:Gi,parsedFile:Ni,action:Li});case 35:case"end":return Vr.stop()}},Dn,null,[[3,9]])}));return function(Dn,or){return un.apply(this,arguments)}}(),Qt.saveFileInput=function(un){Qt.fileInput=un},Qt}return(0,Le.Z)(vt,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"post",value:function(Tn){var en=this,cn=Tn.data,un=Tn.origin,Dn=Tn.action,or=Tn.parsedFile;if(this._isMounted){var Kt=this.props,Yr=Kt.onStart,$r=Kt.customRequest,Ri=Kt.name,Li=Kt.headers,pi=Kt.withCredentials,Gi=Kt.method,yi=un.uid,ii=$r||Dt,Ni={action:Dn,filename:Ri,data:cn,file:or,headers:Li,withCredentials:pi,method:Gi||"post",onProgress:function(Vr){var mi=en.props.onProgress;mi==null||mi(Vr,or)},onSuccess:function(Vr,mi){var Wi=en.props.onSuccess;Wi==null||Wi(Vr,or,mi),delete en.reqs[yi]},onError:function(Vr,mi){var Wi=en.props.onError;Wi==null||Wi(Vr,mi,or),delete en.reqs[yi]}};Yr(un),this.reqs[yi]=ii(Ni)}}},{key:"reset",value:function(){this.setState({uid:ct()})}},{key:"abort",value:function(Tn){var en=this.reqs;if(Tn){var cn=Tn.uid?Tn.uid:Tn;en[cn]&&en[cn].abort&&en[cn].abort(),delete en[cn]}else Object.keys(en).forEach(function(un){en[un]&&en[un].abort&&en[un].abort(),delete en[un]})}},{key:"render",value:function(){var Tn,en=this.props,cn=en.component,un=en.prefixCls,Dn=en.className,or=en.disabled,Kt=en.id,Yr=en.style,$r=en.multiple,Ri=en.accept,Li=en.capture,pi=en.children,Gi=en.directory,yi=en.openFileDialogOnClick,ii=en.onMouseEnter,Ni=en.onMouseLeave,Zi=(0,gt.Z)(en,wt),Vr=Ye()((Tn={},(0,Te.Z)(Tn,un,!0),(0,Te.Z)(Tn,"".concat(un,"-disabled"),or),(0,Te.Z)(Tn,Dn,Dn),Tn)),mi=Gi?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},Wi=or?{}:{onClick:yi?this.onClick:function(){},onKeyDown:yi?this.onKeyDown:function(){},onMouseEnter:ii,onMouseLeave:Ni,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return fe.createElement(cn,(0,be.Z)({},Wi,{className:Vr,role:"button",style:Yr}),fe.createElement("input",(0,be.Z)({},(0,pt.Z)(Zi,{aria:!0,data:!0}),{id:Kt,disabled:or,type:"file",ref:this.saveFileInput,onClick:function(ea){return ea.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:Ri},mi,{multiple:$r,onChange:this.onChange},Li!=null?{capture:Li}:{})),pi)}}]),vt}(fe.Component),je=Mt;function Rt(){}var At=function(ot){(0,Se.Z)(vt,ot);var Qe=(0,pe.Z)(vt);function vt(){var Qt;(0,_e.Z)(this,vt);for(var Tn=arguments.length,en=new Array(Tn),cn=0;cn<Tn;cn++)en[cn]=arguments[cn];return Qt=Qe.call.apply(Qe,[this].concat(en)),Qt.uploader=void 0,Qt.saveUploader=function(un){Qt.uploader=un},Qt}return(0,Le.Z)(vt,[{key:"abort",value:function(Tn){this.uploader.abort(Tn)}},{key:"render",value:function(){return fe.createElement(je,(0,be.Z)({},this.props,{ref:this.saveUploader}))}}]),vt}(fe.Component);At.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:Rt,onError:Rt,onSuccess:Rt,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var xn=At,jt=xn,vn=ce(5663),er=ce(73935),Sr=ce(53124),qe=ce(98866),Ae=ce(10110),$t=ce(24457),Hn={icon:function(Qe,vt){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:vt}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:Qe}}]}},name:"file",theme:"twotone"},bn=Hn,at=ce(74643),ft=function(Qe,vt){return fe.createElement(at.Z,(0,be.Z)({},Qe,{ref:vt,icon:bn}))},Gt=fe.forwardRef(ft),zn=ce(3407),mn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},nn=mn,Ft=function(Qe,vt){return fe.createElement(at.Z,(0,be.Z)({},Qe,{ref:vt,icon:nn}))},Pn=fe.forwardRef(Ft),_n={icon:function(Qe,vt){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:Qe}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:vt}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:vt}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:vt}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:Qe}}]}},name:"picture",theme:"twotone"},Ee=_n,ue=function(Qe,vt){return fe.createElement(at.Z,(0,be.Z)({},Qe,{ref:vt,icon:Ee}))},se=fe.forwardRef(ue),ye=ce(38379),ve=ce(57838),le=ce(33603),We=ce(96159),Lt=ce(71577);function tn(ot){return Object.assign(Object.assign({},ot),{lastModified:ot.lastModified,lastModifiedDate:ot.lastModifiedDate,name:ot.name,size:ot.size,type:ot.type,uid:ot.uid,percent:0,originFileObj:ot})}function hn(ot,Qe){const vt=(0,tt.Z)(Qe),Qt=vt.findIndex(Tn=>{let{uid:en}=Tn;return en===ot.uid});return Qt===-1?vt.push(ot):vt[Qt]=ot,vt}function sn(ot,Qe){const vt=ot.uid!==void 0?"uid":"name";return Qe.filter(Qt=>Qt[vt]===ot[vt])[0]}function yn(ot,Qe){const vt=ot.uid!==void 0?"uid":"name",Qt=Qe.filter(Tn=>Tn[vt]!==ot[vt]);return Qt.length===Qe.length?null:Qt}const ln=function(){const Qe=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"").split("/"),Qt=Qe[Qe.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(Qt)||[""])[0]},yr=ot=>ot.indexOf("image/")===0,Fr=ot=>{if(ot.type&&!ot.thumbUrl)return yr(ot.type);const Qe=ot.thumbUrl||ot.url||"",vt=ln(Qe);return/^data:image\//.test(Qe)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(vt)?!0:!(/^data:/.test(Qe)||vt)},Nt=200;function Rn(ot){return new Promise(Qe=>{if(!ot.type||!yr(ot.type)){Qe("");return}const vt=document.createElement("canvas");vt.width=Nt,vt.height=Nt,vt.style.cssText=`position: fixed; left: 0; top: 0; width: ${Nt}px; height: ${Nt}px; z-index: 9999; display: none;`,document.body.appendChild(vt);const Qt=vt.getContext("2d"),Tn=new Image;if(Tn.onload=()=>{const{width:en,height:cn}=Tn;let un=Nt,Dn=Nt,or=0,Kt=0;en>cn?(Dn=cn*(Nt/en),Kt=-(Dn-un)/2):(un=en*(Nt/cn),or=-(un-Dn)/2),Qt.drawImage(Tn,or,Kt,un,Dn);const Yr=vt.toDataURL();document.body.removeChild(vt),window.URL.revokeObjectURL(Tn.src),Qe(Yr)},Tn.crossOrigin="anonymous",ot.type.startsWith("image/svg+xml")){const en=new FileReader;en.onload=()=>{en.result&&(Tn.src=en.result)},en.readAsDataURL(ot)}else if(ot.type.startsWith("image/gif")){const en=new FileReader;en.onload=()=>{en.result&&Qe(en.result)},en.readAsDataURL(ot)}else Tn.src=window.URL.createObjectURL(ot)})}var Gr=ce(84249),li=ce(90674),st=ce(99569),Wt=ce(38703),Vn=ce(83062),gr=fe.forwardRef((ot,Qe)=>{let{prefixCls:vt,className:Qt,style:Tn,locale:en,listType:cn,file:un,items:Dn,progress:or,iconRender:Kt,actionIconRender:Yr,itemRender:$r,isImgUrl:Ri,showPreviewIcon:Li,showRemoveIcon:pi,showDownloadIcon:Gi,previewIcon:yi,removeIcon:ii,downloadIcon:Ni,onPreview:Zi,onDownload:Vr,onClose:mi}=ot;var Wi,la;const{status:ea}=un,[ti,yt]=fe.useState(ea);fe.useEffect(()=>{ea!=="removed"&&yt(ea)},[ea]);const[ht,Bt]=fe.useState(!1);fe.useEffect(()=>{const Ge=setTimeout(()=>{Bt(!0)},300);return()=>{clearTimeout(Ge)}},[]);const an=Kt(un);let kn=fe.createElement("div",{className:`${vt}-icon`},an);if(cn==="picture"||cn==="picture-card"||cn==="picture-circle")if(ti==="uploading"||!un.thumbUrl&&!un.url){const Ge=Ye()(`${vt}-list-item-thumbnail`,{[`${vt}-list-item-file`]:ti!=="uploading"});kn=fe.createElement("div",{className:Ge},an)}else{const Ge=Ri!=null&&Ri(un)?fe.createElement("img",{src:un.thumbUrl||un.url,alt:un.name,className:`${vt}-list-item-image`,crossOrigin:un.crossOrigin}):an,et=Ye()(`${vt}-list-item-thumbnail`,{[`${vt}-list-item-file`]:Ri&&!Ri(un)});kn=fe.createElement("a",{className:et,onClick:bt=>Zi(un,bt),href:un.url||un.thumbUrl,target:"_blank",rel:"noopener noreferrer"},Ge)}const ur=Ye()(`${vt}-list-item`,`${vt}-list-item-${ti}`),Er=typeof un.linkProps=="string"?JSON.parse(un.linkProps):un.linkProps,Br=pi?Yr((typeof ii=="function"?ii(un):ii)||fe.createElement(Gr.Z,null),()=>mi(un),vt,en.removeFile):null,Hr=Gi&&ti==="done"?Yr((typeof Ni=="function"?Ni(un):Ni)||fe.createElement(li.Z,null),()=>Vr(un),vt,en.downloadFile):null,Nr=cn!=="picture-card"&&cn!=="picture-circle"&&fe.createElement("span",{key:"download-delete",className:Ye()(`${vt}-list-item-actions`,{picture:cn==="picture"})},Hr,Br),ei=Ye()(`${vt}-list-item-name`),gi=un.url?[fe.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:ei,title:un.name},Er,{href:un.url,onClick:Ge=>Zi(un,Ge)}),un.name),Nr]:[fe.createElement("span",{key:"view",className:ei,onClick:Ge=>Zi(un,Ge),title:un.name},un.name),Nr],Mr={pointerEvents:"none",opacity:.5},fi=Li?fe.createElement("a",{href:un.url||un.thumbUrl,target:"_blank",rel:"noopener noreferrer",style:un.url||un.thumbUrl?void 0:Mr,onClick:Ge=>Zi(un,Ge),title:en.previewFile},typeof yi=="function"?yi(un):yi||fe.createElement(st.Z,null)):null,Ai=(cn==="picture-card"||cn==="picture-circle")&&ti!=="uploading"&&fe.createElement("span",{className:`${vt}-list-item-actions`},fi,ti==="done"&&Hr,Br),{getPrefixCls:Si}=fe.useContext(Sr.E_),Ce=Si(),Ne=fe.createElement("div",{className:ur},kn,gi,Ai,ht&&fe.createElement(ye.default,{motionName:`${Ce}-fade`,visible:ti==="uploading",motionDeadline:2e3},Ge=>{let{className:et}=Ge;const bt="percent"in un?fe.createElement(Wt.Z,Object.assign({},or,{type:"line",percent:un.percent,"aria-label":un["aria-label"],"aria-labelledby":un["aria-labelledby"]})):null;return fe.createElement("div",{className:Ye()(`${vt}-list-item-progress`,et)},bt)})),Be=un.response&&typeof un.response=="string"?un.response:((Wi=un.error)===null||Wi===void 0?void 0:Wi.statusText)||((la=un.error)===null||la===void 0?void 0:la.message)||en.uploadError,He=ti==="error"?fe.createElement(Vn.Z,{title:Be,getPopupContainer:Ge=>Ge.parentNode},Ne):Ne;return fe.createElement("div",{className:Ye()(`${vt}-list-item-container`,Qt),style:Tn,ref:Qe},$r?$r(He,un,Dn,{download:Vr.bind(null,un),preview:Zi.bind(null,un),remove:mi.bind(null,un)}):He)});const Pr=(ot,Qe)=>{const{listType:vt="text",previewFile:Qt=Rn,onPreview:Tn,onDownload:en,onRemove:cn,locale:un,iconRender:Dn,isImageUrl:or=Fr,prefixCls:Kt,items:Yr=[],showPreviewIcon:$r=!0,showRemoveIcon:Ri=!0,showDownloadIcon:Li=!1,removeIcon:pi,previewIcon:Gi,downloadIcon:yi,progress:ii={size:[-1,2],showInfo:!1},appendAction:Ni,appendActionVisible:Zi=!0,itemRender:Vr,disabled:mi}=ot,Wi=(0,ve.Z)(),[la,ea]=fe.useState(!1);fe.useEffect(()=>{vt!=="picture"&&vt!=="picture-card"&&vt!=="picture-circle"||(Yr||[]).forEach(Mr=>{typeof document=="undefined"||typeof window=="undefined"||!window.FileReader||!window.File||!(Mr.originFileObj instanceof File||Mr.originFileObj instanceof Blob)||Mr.thumbUrl!==void 0||(Mr.thumbUrl="",Qt&&Qt(Mr.originFileObj).then(fi=>{Mr.thumbUrl=fi||"",Wi()}))})},[vt,Yr,Qt]),fe.useEffect(()=>{ea(!0)},[]);const ti=(Mr,fi)=>{if(Tn)return fi==null||fi.preventDefault(),Tn(Mr)},yt=Mr=>{typeof en=="function"?en(Mr):Mr.url&&window.open(Mr.url)},ht=Mr=>{cn==null||cn(Mr)},Bt=Mr=>{if(Dn)return Dn(Mr,vt);const fi=Mr.status==="uploading",Ai=or&&or(Mr)?fe.createElement(se,null):fe.createElement(Gt,null);let Si=fi?fe.createElement(zn.Z,null):fe.createElement(Pn,null);return vt==="picture"?Si=fi?fe.createElement(zn.Z,null):Ai:(vt==="picture-card"||vt==="picture-circle")&&(Si=fi?un.uploading:Ai),Si},an=(Mr,fi,Ai,Si)=>{const Ce={type:"text",size:"small",title:Si,onClick:Ne=>{fi(),(0,We.l$)(Mr)&&Mr.props.onClick&&Mr.props.onClick(Ne)},className:`${Ai}-list-item-action`,disabled:mi};if((0,We.l$)(Mr)){const Ne=(0,We.Tm)(Mr,Object.assign(Object.assign({},Mr.props),{onClick:()=>{}}));return fe.createElement(Lt.ZP,Object.assign({},Ce,{icon:Ne}))}return fe.createElement(Lt.ZP,Object.assign({},Ce),fe.createElement("span",null,Mr))};fe.useImperativeHandle(Qe,()=>({handlePreview:ti,handleDownload:yt}));const{getPrefixCls:kn}=fe.useContext(Sr.E_),ur=kn("upload",Kt),Er=kn(),Br=Ye()(`${ur}-list`,`${ur}-list-${vt}`),Hr=(0,tt.Z)(Yr.map(Mr=>({key:Mr.uid,file:Mr})));let ei={motionDeadline:2e3,motionName:`${ur}-${vt==="picture-card"||vt==="picture-circle"?"animate-inline":"animate"}`,keys:Hr,motionAppear:la};const gi=fe.useMemo(()=>{const Mr=Object.assign({},(0,le.Z)(Er));return delete Mr.onAppearEnd,delete Mr.onEnterEnd,delete Mr.onLeaveEnd,Mr},[Er]);return vt!=="picture-card"&&vt!=="picture-circle"&&(ei=Object.assign(Object.assign({},gi),ei)),fe.createElement("div",{className:Br},fe.createElement(ye.CSSMotionList,Object.assign({},ei,{component:!1}),Mr=>{let{key:fi,file:Ai,className:Si,style:Ce}=Mr;return fe.createElement(gr,{key:fi,locale:un,prefixCls:ur,className:Si,style:Ce,file:Ai,items:Yr,progress:ii,listType:vt,isImgUrl:or,showPreviewIcon:$r,showRemoveIcon:Ri,showDownloadIcon:Li,removeIcon:pi,previewIcon:Gi,downloadIcon:yi,iconRender:Bt,actionIconRender:an,itemRender:Vr,onPreview:ti,onDownload:yt,onClose:ht})}),Ni&&fe.createElement(ye.default,Object.assign({},ei,{visible:Zi,forceRender:!0}),Mr=>{let{className:fi,style:Ai}=Mr;return(0,We.Tm)(Ni,Si=>({className:Ye()(Si.className,fi),style:Object.assign(Object.assign(Object.assign({},Ai),{pointerEvents:fi?"none":void 0}),Si.style)}))}))};var Xr=fe.forwardRef(Pr),qr=ce(14747),ui=ce(33507),br=ce(67968),Ei=ce(45503),Ji=ot=>{const{componentCls:Qe,iconCls:vt}=ot;return{[`${Qe}-wrapper`]:{[`${Qe}-drag`]:{position:"relative",width:"100%",height:"100%",textAlign:"center",background:ot.colorFillAlter,border:`${ot.lineWidth}px dashed ${ot.colorBorder}`,borderRadius:ot.borderRadiusLG,cursor:"pointer",transition:`border-color ${ot.motionDurationSlow}`,[Qe]:{padding:`${ot.padding}px 0`},[`${Qe}-btn`]:{display:"table",width:"100%",height:"100%",outline:"none"},[`${Qe}-drag-container`]:{display:"table-cell",verticalAlign:"middle"},[`&:not(${Qe}-disabled):hover`]:{borderColor:ot.colorPrimaryHover},[`p${Qe}-drag-icon`]:{marginBottom:ot.margin,[vt]:{color:ot.colorPrimary,fontSize:ot.uploadThumbnailSize}},[`p${Qe}-text`]:{margin:`0 0 ${ot.marginXXS}px`,color:ot.colorTextHeading,fontSize:ot.fontSizeLG},[`p${Qe}-hint`]:{color:ot.colorTextDescription,fontSize:ot.fontSize},[`&${Qe}-disabled`]:{cursor:"not-allowed",[`p${Qe}-drag-icon ${vt},
p${Qe}-text,
p${Qe}-hint
`]:{color:ot.colorTextDisabled}}}}}},Ci=ot=>{const{componentCls:Qe,antCls:vt,iconCls:Qt,fontSize:Tn,lineHeight:en}=ot,cn=`${Qe}-list-item`,un=`${cn}-actions`,Dn=`${cn}-action`,or=Math.round(Tn*en);return{[`${Qe}-wrapper`]:{[`${Qe}-list`]:Object.assign(Object.assign({},(0,qr.dF)()),{lineHeight:ot.lineHeight,[cn]:{position:"relative",height:ot.lineHeight*Tn,marginTop:ot.marginXS,fontSize:Tn,display:"flex",alignItems:"center",transition:`background-color ${ot.motionDurationSlow}`,"&:hover":{backgroundColor:ot.controlItemBgHover},[`${cn}-name`]:Object.assign(Object.assign({},qr.vS),{padding:`0 ${ot.paddingXS}px`,lineHeight:en,flex:"auto",transition:`all ${ot.motionDurationSlow}`}),[un]:{[Dn]:{opacity:0},[`${Dn}${vt}-btn-sm`]:{height:or,border:0,lineHeight:1,"> span":{transform:"scale(1)"}},[`
${Dn}:focus-visible,
&.picture ${Dn}
`]:{opacity:1},[Qt]:{color:ot.actionsColor,transition:`all ${ot.motionDurationSlow}`},[`&:hover ${Qt}`]:{color:ot.colorText}},[`${Qe}-icon ${Qt}`]:{color:ot.colorTextDescription,fontSize:Tn},[`${cn}-progress`]:{position:"absolute",bottom:-ot.uploadProgressOffset,width:"100%",paddingInlineStart:Tn+ot.paddingXS,fontSize:Tn,lineHeight:0,pointerEvents:"none","> div":{margin:0}}},[`${cn}:hover ${Dn}`]:{opacity:1,color:ot.colorText},[`${cn}-error`]:{color:ot.colorError,[`${cn}-name, ${Qe}-icon ${Qt}`]:{color:ot.colorError},[un]:{[`${Qt}, ${Qt}:hover`]:{color:ot.colorError},[Dn]:{opacity:1}}},[`${Qe}-list-item-container`]:{transition:`opacity ${ot.motionDurationSlow}, height ${ot.motionDurationSlow}`,"&::before":{display:"table",width:0,height:0,content:'""'}}})}}},mt=ce(45930),Mn=ce(16932);const En=new mt.Keyframes("uploadAnimateInlineIn",{from:{width:0,height:0,margin:0,padding:0,opacity:0}}),An=new mt.Keyframes("uploadAnimateInlineOut",{to:{width:0,height:0,margin:0,padding:0,opacity:0}});var nr=ot=>{const{componentCls:Qe}=ot,vt=`${Qe}-animate-inline`;return[{[`${Qe}-wrapper`]:{[`${vt}-appear, ${vt}-enter, ${vt}-leave`]:{animationDuration:ot.motionDurationSlow,animationTimingFunction:ot.motionEaseInOutCirc,animationFillMode:"forwards"},[`${vt}-appear, ${vt}-enter`]:{animationName:En},[`${vt}-leave`]:{animationName:An}}},{[`${Qe}-wrapper`]:(0,Mn.J$)(ot)},En,An]},pr=ce(47448),Kn=ce(84780);const Ue=ot=>{const{componentCls:Qe,iconCls:vt,uploadThumbnailSize:Qt,uploadProgressOffset:Tn}=ot,en=`${Qe}-list`,cn=`${en}-item`;return{[`${Qe}-wrapper`]:{[`
${en}${en}-picture,
${en}${en}-picture-card,
${en}${en}-picture-circle
`]:{[cn]:{position:"relative",height:Qt+ot.lineWidth*2+ot.paddingXS*2,padding:ot.paddingXS,border:`${ot.lineWidth}px ${ot.lineType} ${ot.colorBorder}`,borderRadius:ot.borderRadiusLG,"&:hover":{background:"transparent"},[`${cn}-thumbnail`]:Object.assign(Object.assign({},qr.vS),{width:Qt,height:Qt,lineHeight:`${Qt+ot.paddingSM}px`,textAlign:"center",flex:"none",[vt]:{fontSize:ot.fontSizeHeading2,color:ot.colorPrimary},img:{display:"block",width:"100%",height:"100%",overflow:"hidden"}}),[`${cn}-progress`]:{bottom:Tn,width:`calc(100% - ${ot.paddingSM*2}px)`,marginTop:0,paddingInlineStart:Qt+ot.paddingXS}},[`${cn}-error`]:{borderColor:ot.colorError,[`${cn}-thumbnail ${vt}`]:{[`svg path[fill='${pr.blue[0]}']`]:{fill:ot.colorErrorBg},[`svg path[fill='${pr.blue.primary}']`]:{fill:ot.colorError}}},[`${cn}-uploading`]:{borderStyle:"dashed",[`${cn}-name`]:{marginBottom:Tn}}},[`${en}${en}-picture-circle ${cn}`]:{[`&, &::before, ${cn}-thumbnail`]:{borderRadius:"50%"}}}}},it=ot=>{const{componentCls:Qe,iconCls:vt,fontSizeLG:Qt,colorTextLightSolid:Tn}=ot,en=`${Qe}-list`,cn=`${en}-item`,un=ot.uploadPicCardSize;return{[`
${Qe}-wrapper${Qe}-picture-card-wrapper,
${Qe}-wrapper${Qe}-picture-circle-wrapper
`]:Object.assign(Object.assign({},(0,qr.dF)()),{display:"inline-block",width:"100%",[`${Qe}${Qe}-select`]:{width:un,height:un,marginInlineEnd:ot.marginXS,marginBottom:ot.marginXS,textAlign:"center",verticalAlign:"top",backgroundColor:ot.colorFillAlter,border:`${ot.lineWidth}px dashed ${ot.colorBorder}`,borderRadius:ot.borderRadiusLG,cursor:"pointer",transition:`border-color ${ot.motionDurationSlow}`,[`> ${Qe}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",textAlign:"center"},[`&:not(${Qe}-disabled):hover`]:{borderColor:ot.colorPrimary}},[`${en}${en}-picture-card, ${en}${en}-picture-circle`]:{[`${en}-item-container`]:{display:"inline-block",width:un,height:un,marginBlock:`0 ${ot.marginXS}px`,marginInline:`0 ${ot.marginXS}px`,verticalAlign:"top"},"&::after":{display:"none"},[cn]:{height:"100%",margin:0,"&::before":{position:"absolute",zIndex:1,width:`calc(100% - ${ot.paddingXS*2}px)`,height:`calc(100% - ${ot.paddingXS*2}px)`,backgroundColor:ot.colorBgMask,opacity:0,transition:`all ${ot.motionDurationSlow}`,content:'" "'}},[`${cn}:hover`]:{[`&::before, ${cn}-actions`]:{opacity:1}},[`${cn}-actions`]:{position:"absolute",insetInlineStart:0,zIndex:10,width:"100%",whiteSpace:"nowrap",textAlign:"center",opacity:0,transition:`all ${ot.motionDurationSlow}`,[`${vt}-eye, ${vt}-download, ${vt}-delete`]:{zIndex:10,width:Qt,margin:`0 ${ot.marginXXS}px`,fontSize:Qt,cursor:"pointer",transition:`all ${ot.motionDurationSlow}`,svg:{verticalAlign:"baseline"}}},[`${cn}-actions, ${cn}-actions:hover`]:{[`${vt}-eye, ${vt}-download, ${vt}-delete`]:{color:new Kn.C(Tn).setAlpha(.65).toRgbString(),"&:hover":{color:Tn}}},[`${cn}-thumbnail, ${cn}-thumbnail img`]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},[`${cn}-name`]:{display:"none",textAlign:"center"},[`${cn}-file + ${cn}-name`]:{position:"absolute",bottom:ot.margin,display:"block",width:`calc(100% - ${ot.paddingXS*2}px)`},[`${cn}-uploading`]:{[`&${cn}`]:{backgroundColor:ot.colorFillAlter},[`&::before, ${vt}-eye, ${vt}-download, ${vt}-delete`]:{display:"none"}},[`${cn}-progress`]:{bottom:ot.marginXL,width:`calc(100% - ${ot.paddingXS*2}px)`,paddingInlineStart:0}}}),[`${Qe}-wrapper${Qe}-picture-circle-wrapper`]:{[`${Qe}${Qe}-select`]:{borderRadius:"50%"}}}};var Ut=ot=>{const{componentCls:Qe}=ot;return{[`${Qe}-rtl`]:{direction:"rtl"}}};const Ke=ot=>{const{componentCls:Qe,colorTextDisabled:vt}=ot;return{[`${Qe}-wrapper`]:Object.assign(Object.assign({},(0,qr.Wf)(ot)),{[Qe]:{outline:0,"input[type='file']":{cursor:"pointer"}},[`${Qe}-select`]:{display:"inline-block"},[`${Qe}-disabled`]:{color:vt,cursor:"not-allowed"}})}};var ut=(0,br.Z)("Upload",ot=>{const{fontSizeHeading3:Qe,fontSize:vt,lineHeight:Qt,lineWidth:Tn,controlHeightLG:en}=ot,cn=Math.round(vt*Qt),un=(0,Ei.TS)(ot,{uploadThumbnailSize:Qe*2,uploadProgressOffset:cn/2+Tn,uploadPicCardSize:en*2.55});return[Ke(un),Ji(un),Ue(un),it(un),Ci(un),nr(un),Ut(un),(0,ui.Z)(un)]},ot=>({actionsColor:ot.colorTextDescription})),Ot=function(ot,Qe,vt,Qt){function Tn(en){return en instanceof vt?en:new vt(function(cn){cn(en)})}return new(vt||(vt=Promise))(function(en,cn){function un(Kt){try{or(Qt.next(Kt))}catch(Yr){cn(Yr)}}function Dn(Kt){try{or(Qt.throw(Kt))}catch(Yr){cn(Yr)}}function or(Kt){Kt.done?en(Kt.value):Tn(Kt.value).then(un,Dn)}or((Qt=Qt.apply(ot,Qe||[])).next())})};const Tt=`__LIST_IGNORE_${Date.now()}__`,zt=(ot,Qe)=>{const{fileList:vt,defaultFileList:Qt,onRemove:Tn,showUploadList:en=!0,listType:cn="text",onPreview:un,onDownload:Dn,onChange:or,onDrop:Kt,previewFile:Yr,disabled:$r,locale:Ri,iconRender:Li,isImageUrl:pi,progress:Gi,prefixCls:yi,className:ii,type:Ni="select",children:Zi,style:Vr,itemRender:mi,maxCount:Wi,data:la={},multiple:ea=!1,action:ti="",accept:yt="",supportServerRender:ht=!0,rootClassName:Bt}=ot,an=fe.useContext(qe.Z),kn=$r!=null?$r:an,[ur,Er]=(0,vn.Z)(Qt||[],{value:vt,postState:Pe=>Pe!=null?Pe:[]}),[Br,Hr]=fe.useState("drop"),Nr=fe.useRef(null);fe.useMemo(()=>{const Pe=Date.now();(vt||[]).forEach(($e,xt)=>{!$e.uid&&!Object.isFrozen($e)&&($e.uid=`__AUTO__${Pe}_${xt}__`)})},[vt]);const ei=(Pe,$e,xt)=>{let rt=(0,tt.Z)($e),It=!1;Wi===1?rt=rt.slice(-1):Wi&&(It=rt.length>Wi,rt=rt.slice(0,Wi)),(0,er.flushSync)(()=>{Er(rt)});const rn={file:Pe,fileList:rt};xt&&(rn.event=xt),(!It||rt.some(fn=>fn.uid===Pe.uid))&&(0,er.flushSync)(()=>{or==null||or(rn)})},gi=(Pe,$e)=>Ot(void 0,void 0,void 0,function*(){const{beforeUpload:xt,transformFile:rt}=ot;let It=Pe;if(xt){const rn=yield xt(Pe,$e);if(rn===!1)return!1;if(delete Pe[Tt],rn===Tt)return Object.defineProperty(Pe,Tt,{value:!0,configurable:!0}),!1;typeof rn=="object"&&rn&&(It=rn)}return rt&&(It=yield rt(It)),It}),Mr=Pe=>{const $e=Pe.filter(It=>!It.file[Tt]);if(!$e.length)return;const xt=$e.map(It=>tn(It.file));let rt=(0,tt.Z)(ur);xt.forEach(It=>{rt=hn(It,rt)}),xt.forEach((It,rn)=>{let fn=It;if($e[rn].parsedFile)It.status="uploading";else{const{originFileObj:On}=It;let wn;try{wn=new File([On],On.name,{type:On.type})}catch(Xt){wn=new Blob([On],{type:On.type}),wn.name=On.name,wn.lastModifiedDate=new Date,wn.lastModified=new Date().getTime()}wn.uid=It.uid,fn=wn}ei(fn,rt)})},fi=(Pe,$e,xt)=>{try{typeof Pe=="string"&&(Pe=JSON.parse(Pe))}catch(rn){}if(!sn($e,ur))return;const rt=tn($e);rt.status="done",rt.percent=100,rt.response=Pe,rt.xhr=xt;const It=hn(rt,ur);ei(rt,It)},Ai=(Pe,$e)=>{if(!sn($e,ur))return;const xt=tn($e);xt.status="uploading",xt.percent=Pe.percent;const rt=hn(xt,ur);ei(xt,rt,Pe)},Si=(Pe,$e,xt)=>{if(!sn(xt,ur))return;const rt=tn(xt);rt.error=Pe,rt.response=$e,rt.status="error";const It=hn(rt,ur);ei(rt,It)},Ce=Pe=>{let $e;Promise.resolve(typeof Tn=="function"?Tn(Pe):Tn).then(xt=>{var rt;if(xt===!1)return;const It=yn(Pe,ur);It&&($e=Object.assign(Object.assign({},Pe),{status:"removed"}),ur==null||ur.forEach(rn=>{const fn=$e.uid!==void 0?"uid":"name";rn[fn]===$e[fn]&&!Object.isFrozen(rn)&&(rn.status="removed")}),(rt=Nr.current)===null||rt===void 0||rt.abort($e),ei($e,It))})},Ne=Pe=>{Hr(Pe.type),Pe.type==="drop"&&(Kt==null||Kt(Pe))};fe.useImperativeHandle(Qe,()=>({onBatchStart:Mr,onSuccess:fi,onProgress:Ai,onError:Si,fileList:ur,upload:Nr.current}));const{getPrefixCls:Be,direction:He,upload:Ge}=fe.useContext(Sr.E_),et=Be("upload",yi),bt=Object.assign(Object.assign({onBatchStart:Mr,onError:Si,onProgress:Ai,onSuccess:fi},ot),{data:la,multiple:ea,action:ti,accept:yt,supportServerRender:ht,prefixCls:et,disabled:kn,beforeUpload:gi,onChange:void 0});delete bt.className,delete bt.style,(!Zi||kn)&&delete bt.id;const[Zt,Jt]=ut(et),[Gn]=(0,Ae.Z)("Upload",$t.Z.Upload),{showRemoveIcon:fr,showPreviewIcon:Wn,showDownloadIcon:pn,removeIcon:dn,previewIcon:Cn,downloadIcon:In}=typeof en=="boolean"?{}:en,cr=(Pe,$e)=>en?fe.createElement(Xr,{prefixCls:et,listType:cn,items:ur,previewFile:Yr,onPreview:un,onDownload:Dn,onRemove:Ce,showRemoveIcon:!kn&&fr,showPreviewIcon:Wn,showDownloadIcon:pn,removeIcon:dn,previewIcon:Cn,downloadIcon:In,iconRender:Li,locale:Object.assign(Object.assign({},Gn),Ri),isImageUrl:pi,progress:Gi,appendAction:Pe,appendActionVisible:$e,itemRender:mi,disabled:kn}):Pe,jn=Ye()(`${et}-wrapper`,ii,Bt,Jt,Ge==null?void 0:Ge.className,{[`${et}-rtl`]:He==="rtl",[`${et}-picture-card-wrapper`]:cn==="picture-card",[`${et}-picture-circle-wrapper`]:cn==="picture-circle"}),Zn=Object.assign(Object.assign({},Ge==null?void 0:Ge.style),Vr);if(Ni==="drag"){const Pe=Ye()(Jt,et,`${et}-drag`,{[`${et}-drag-uploading`]:ur.some($e=>$e.status==="uploading"),[`${et}-drag-hover`]:Br==="dragover",[`${et}-disabled`]:kn,[`${et}-rtl`]:He==="rtl"});return Zt(fe.createElement("span",{className:jn},fe.createElement("div",{className:Pe,style:Zn,onDrop:Ne,onDragOver:Ne,onDragLeave:Ne},fe.createElement(jt,Object.assign({},bt,{ref:Nr,className:`${et}-btn`}),fe.createElement("div",{className:`${et}-drag-container`},Zi))),cr()))}const Jn=Ye()(et,`${et}-select`,{[`${et}-disabled`]:kn}),hr=(Pe=>fe.createElement("div",{className:Jn,style:Pe},fe.createElement(jt,Object.assign({},bt,{ref:Nr}))))(Zi?void 0:{display:"none"});return Zt(cn==="picture-card"||cn==="picture-circle"?fe.createElement("span",{className:jn},cr(hr,!!Zi)):fe.createElement("span",{className:jn},hr,cr()))};var $n=fe.forwardRef(zt),Cr=function(ot,Qe){var vt={};for(var Qt in ot)Object.prototype.hasOwnProperty.call(ot,Qt)&&Qe.indexOf(Qt)<0&&(vt[Qt]=ot[Qt]);if(ot!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Tn=0,Qt=Object.getOwnPropertySymbols(ot);Tn<Qt.length;Tn++)Qe.indexOf(Qt[Tn])<0&&Object.prototype.propertyIsEnumerable.call(ot,Qt[Tn])&&(vt[Qt[Tn]]=ot[Qt[Tn]]);return vt},qn=fe.forwardRef((ot,Qe)=>{var{style:vt,height:Qt}=ot,Tn=Cr(ot,["style","height"]);return fe.createElement($n,Object.assign({ref:Qe},Tn,{type:"drag",style:Object.assign(Object.assign({},vt),{height:Qt})}))});const rr=$n;rr.Dragger=qn,rr.LIST_IGNORE=Tt;var ar=rr},41771:function(Ln,qt){"use strict";var ce;var fe=typeof Symbol=="function"&&Symbol.for,tt=fe?Symbol.for("react.element"):60103,Fe=fe?Symbol.for("react.portal"):60106,Ye=fe?Symbol.for("react.fragment"):60107,be=fe?Symbol.for("react.strict_mode"):60108,_e=fe?Symbol.for("react.profiler"):60114,Le=fe?Symbol.for("react.provider"):60109,Se=fe?Symbol.for("react.context"):60110,pe=fe?Symbol.for("react.async_mode"):60111,Te=fe?Symbol.for("react.concurrent_mode"):60111,gt=fe?Symbol.for("react.forward_ref"):60112,ze=fe?Symbol.for("react.suspense"):60113,Pt=fe?Symbol.for("react.suspense_list"):60120,kt=fe?Symbol.for("react.memo"):60115,pt=fe?Symbol.for("react.lazy"):60116,Je=fe?Symbol.for("react.block"):60121,De=fe?Symbol.for("react.fundamental"):60117,Dt=fe?Symbol.for("react.responder"):60118,Yt=fe?Symbol.for("react.scope"):60119;function nt(Ie){if(typeof Ie=="object"&&Ie!==null){var Me=Ie.$$typeof;switch(Me){case tt:switch(Ie=Ie.type,Ie){case pe:case Te:case Ye:case _e:case be:case ze:return Ie;default:switch(Ie=Ie&&Ie.$$typeof,Ie){case Se:case gt:case pt:case kt:case Le:return Ie;default:return Me}}case Fe:return Me}}}function ct(Ie){return nt(Ie)===Te}ce=pe,ce=Te,ce=Se,ce=Le,ce=tt,ce=gt,ce=Ye,ce=pt,ce=kt,ce=Fe,ce=_e,ce=be,ce=ze,ce=function(Ie){return ct(Ie)||nt(Ie)===pe},ce=ct,ce=function(Ie){return nt(Ie)===Se},ce=function(Ie){return nt(Ie)===Le},ce=function(Ie){return typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===tt},ce=function(Ie){return nt(Ie)===gt},qt.isFragment=function(Ie){return nt(Ie)===Ye},ce=function(Ie){return nt(Ie)===pt},ce=function(Ie){return nt(Ie)===kt},ce=function(Ie){return nt(Ie)===Fe},ce=function(Ie){return nt(Ie)===_e},ce=function(Ie){return nt(Ie)===be},ce=function(Ie){return nt(Ie)===ze},ce=function(Ie){return typeof Ie=="string"||typeof Ie=="function"||Ie===Ye||Ie===Te||Ie===_e||Ie===be||Ie===ze||Ie===Pt||typeof Ie=="object"&&Ie!==null&&(Ie.$$typeof===pt||Ie.$$typeof===kt||Ie.$$typeof===Le||Ie.$$typeof===Se||Ie.$$typeof===gt||Ie.$$typeof===De||Ie.$$typeof===Dt||Ie.$$typeof===Yt||Ie.$$typeof===Je)},ce=nt},47655:function(Ln,qt,ce){"use strict";Ln.exports=ce(41771)},64701:function(Ln,qt,ce){"use strict";ce.r(qt),ce.d(qt,{ResizableTextArea:function(){return Hn},default:function(){return mn}});var fe=ce(87462),tt=ce(1413),Fe=ce(4942),Ye=ce(71002),be=ce(97685),_e=ce(45987),Le=ce(74902),Se=ce(94184),pe=ce.n(Se),Te=ce(67656),gt=ce(87887),ze=ce(67294);function Pt(nn){var Ft=ze.useRef();Ft.current=nn;var Pn=ze.useCallback(function(){for(var _n,Ee=arguments.length,ue=new Array(Ee),se=0;se<Ee;se++)ue[se]=arguments[se];return(_n=Ft.current)===null||_n===void 0?void 0:_n.call.apply(_n,[Ft].concat(ue))},[]);return Pn}function kt(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var pt=kt()?ze.useLayoutEffect:ze.useEffect,Je=pt,De=function(Ft,Pn){var _n=ze.useRef(!0);pt(function(){if(!_n.current)return Ft()},Pn),pt(function(){return _n.current=!1,function(){_n.current=!0}},[])};function Dt(nn){var Ft=ze.useRef(!1),Pn=ze.useState(nn),_n=(0,be.Z)(Pn,2),Ee=_n[0],ue=_n[1];ze.useEffect(function(){return Ft.current=!1,function(){Ft.current=!0}},[]);function se(ye,ve){ve&&Ft.current||ue(ye)}return[Ee,se]}function Yt(nn){return nn!==void 0}function nt(nn,Ft){var Pn=Ft||{},_n=Pn.defaultValue,Ee=Pn.value,ue=Pn.onChange,se=Pn.postState,ye=Dt(function(){return Yt(Ee)?Ee:Yt(_n)?typeof _n=="function"?_n():_n:typeof nn=="function"?nn():nn}),ve=(0,be.Z)(ye,2),le=ve[0],We=ve[1],Lt=Ee!==void 0?Ee:le,tn=se?se(Lt):Lt,hn=Pt(ue),sn=Dt([Lt]),yn=(0,be.Z)(sn,2),ln=yn[0],yr=yn[1];De(function(){var Nt=ln[0];le!==Nt&&hn(le,Nt)},[ln]),De(function(){Yt(Ee)||We(Ee)},[Ee]);var Fr=Pt(function(Nt,Rn){We(Nt,Rn),yr([Lt],Rn)});return[tn,Fr]}var ct=ce(48555),Ie=function(Ft){return+setTimeout(Ft,16)},Me=function(Ft){return clearTimeout(Ft)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(Ie=function(Ft){return window.requestAnimationFrame(Ft)},Me=function(Ft){return window.cancelAnimationFrame(Ft)});var Ve=0,Xe=new Map;function Ct(nn){Xe.delete(nn)}var wt=function(Ft){var Pn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Ve+=1;var _n=Ve;function Ee(ue){if(ue===0)Ct(_n),Ft();else{var se=Ie(function(){Ee(ue-1)});Xe.set(_n,se)}}return Ee(Pn),_n};wt.cancel=function(nn){var Ft=Xe.get(nn);return Ct(Ft),Me(Ft)};var Mt=wt,je=`
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;
`,Rt=["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"],At={},xn;function jt(nn){var Ft=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Pn=nn.getAttribute("id")||nn.getAttribute("data-reactid")||nn.getAttribute("name");if(Ft&&At[Pn])return At[Pn];var _n=window.getComputedStyle(nn),Ee=_n.getPropertyValue("box-sizing")||_n.getPropertyValue("-moz-box-sizing")||_n.getPropertyValue("-webkit-box-sizing"),ue=parseFloat(_n.getPropertyValue("padding-bottom"))+parseFloat(_n.getPropertyValue("padding-top")),se=parseFloat(_n.getPropertyValue("border-bottom-width"))+parseFloat(_n.getPropertyValue("border-top-width")),ye=Rt.map(function(le){return"".concat(le,":").concat(_n.getPropertyValue(le))}).join(";"),ve={sizingStyle:ye,paddingSize:ue,borderSize:se,boxSizing:Ee};return Ft&&Pn&&(At[Pn]=ve),ve}function vn(nn){var Ft=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Pn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;xn||(xn=document.createElement("textarea"),xn.setAttribute("tab-index","-1"),xn.setAttribute("aria-hidden","true"),document.body.appendChild(xn)),nn.getAttribute("wrap")?xn.setAttribute("wrap",nn.getAttribute("wrap")):xn.removeAttribute("wrap");var Ee=jt(nn,Ft),ue=Ee.paddingSize,se=Ee.borderSize,ye=Ee.boxSizing,ve=Ee.sizingStyle;xn.setAttribute("style","".concat(ve,";").concat(je)),xn.value=nn.value||nn.placeholder||"";var le=void 0,We=void 0,Lt,tn=xn.scrollHeight;if(ye==="border-box"?tn+=se:ye==="content-box"&&(tn-=ue),Pn!==null||_n!==null){xn.value=" ";var hn=xn.scrollHeight-ue;Pn!==null&&(le=hn*Pn,ye==="border-box"&&(le=le+ue+se),tn=Math.max(le,tn)),_n!==null&&(We=hn*_n,ye==="border-box"&&(We=We+ue+se),Lt=tn>We?"":"hidden",tn=Math.min(We,tn))}var sn={height:tn,overflowY:Lt,resize:"none"};return le&&(sn.minHeight=le),We&&(sn.maxHeight=We),sn}var er=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],Sr=0,qe=1,Ae=2,$t=ze.forwardRef(function(nn,Ft){var Pn=nn,_n=Pn.prefixCls,Ee=Pn.onPressEnter,ue=Pn.defaultValue,se=Pn.value,ye=Pn.autoSize,ve=Pn.onResize,le=Pn.className,We=Pn.style,Lt=Pn.disabled,tn=Pn.onChange,hn=Pn.onInternalAutoSize,sn=(0,_e.Z)(Pn,er),yn=nt(ue,{value:se,postState:function(An){return An!=null?An:""}}),ln=(0,be.Z)(yn,2),yr=ln[0],Fr=ln[1],Nt=function(An){Fr(An.target.value),tn==null||tn(An)},Rn=ze.useRef();ze.useImperativeHandle(Ft,function(){return{textArea:Rn.current}});var Gr=ze.useMemo(function(){return ye&&(0,Ye.Z)(ye)==="object"?[ye.minRows,ye.maxRows]:[]},[ye]),li=(0,be.Z)(Gr,2),st=li[0],Wt=li[1],Vn=!!ye,ir=function(){try{if(document.activeElement===Rn.current){var An=Rn.current,sr=An.selectionStart,nr=An.selectionEnd,pr=An.scrollTop;Rn.current.setSelectionRange(sr,nr),Rn.current.scrollTop=pr}}catch(Kn){}},gr=ze.useState(Ae),Pr=(0,be.Z)(gr,2),Ur=Pr[0],Xr=Pr[1],qr=ze.useState(),ui=(0,be.Z)(qr,2),br=ui[0],Ei=ui[1],sa=function(){Xr(Sr)};Je(function(){Vn&&sa()},[se,st,Wt,Vn]),Je(function(){if(Ur===Sr)Xr(qe);else if(Ur===qe){var En=vn(Rn.current,!1,st,Wt);Xr(Ae),Ei(En)}else ir()},[Ur]);var Ji=ze.useRef(),Qi=function(){Mt.cancel(Ji.current)},Ci=function(An){Ur===Ae&&(ve==null||ve(An),ye&&(Qi(),Ji.current=Mt(function(){sa()})))};ze.useEffect(function(){return Qi},[]);var mt=Vn?br:null,Mn=(0,tt.Z)((0,tt.Z)({},We),mt);return(Ur===Sr||Ur===qe)&&(Mn.overflowY="hidden",Mn.overflowX="hidden"),ze.createElement(ct.Z,{onResize:Ci,disabled:!(ye||ve)},ze.createElement("textarea",(0,fe.Z)({},sn,{ref:Rn,style:Mn,className:pe()(_n,le,(0,Fe.Z)({},"".concat(_n,"-disabled"),Lt)),disabled:Lt,value:yr,onChange:Nt})))}),Hn=$t,bn=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","classes","showCount","className","style","disabled","hidden","classNames","styles","onResize"];function at(nn,Ft){return(0,Le.Z)(nn||"").slice(0,Ft).join("")}function ft(nn,Ft,Pn,_n){var Ee=Pn;return nn?Ee=at(Pn,_n):(0,Le.Z)(Ft||"").length<Pn.length&&(0,Le.Z)(Pn||"").length>_n&&(Ee=Ft),Ee}var Gt=ze.forwardRef(function(nn,Ft){var Pn,_n=nn.defaultValue,Ee=nn.value,ue=nn.onFocus,se=nn.onBlur,ye=nn.onChange,ve=nn.allowClear,le=nn.maxLength,We=nn.onCompositionStart,Lt=nn.onCompositionEnd,tn=nn.suffix,hn=nn.prefixCls,sn=hn===void 0?"rc-textarea":hn,yn=nn.classes,ln=nn.showCount,yr=nn.className,Fr=nn.style,Nt=nn.disabled,Rn=nn.hidden,Gr=nn.classNames,li=nn.styles,st=nn.onResize,Wt=(0,_e.Z)(nn,bn),Vn=nt(_n,{value:Ee,defaultValue:_n}),ir=(0,be.Z)(Vn,2),gr=ir[0],Pr=ir[1],Ur=(0,ze.useRef)(null),Xr=ze.useState(!1),qr=(0,be.Z)(Xr,2),ui=qr[0],br=qr[1],Ei=ze.useState(!1),sa=(0,be.Z)(Ei,2),Ji=sa[0],Qi=sa[1],Ci=ze.useRef(),mt=ze.useRef(0),Mn=ze.useState(null),En=(0,be.Z)(Mn,2),An=En[0],sr=En[1],nr=function(){var rr;(rr=Ur.current)===null||rr===void 0||rr.textArea.focus()};(0,ze.useImperativeHandle)(Ft,function(){return{resizableTextArea:Ur.current,focus:nr,blur:function(){var rr;(rr=Ur.current)===null||rr===void 0||rr.textArea.blur()}}}),(0,ze.useEffect)(function(){br(function(qn){return!Nt&&qn})},[Nt]);var pr=Number(le)>0,Kn=function(rr){Qi(!0),Ci.current=gr,mt.current=rr.currentTarget.selectionStart,We==null||We(rr)},Ue=function(rr){Qi(!1);var ar=rr.currentTarget.value;if(pr){var ot,Qe=mt.current>=le+1||mt.current===((ot=Ci.current)===null||ot===void 0?void 0:ot.length);ar=ft(Qe,Ci.current,ar,le)}ar!==gr&&(Pr(ar),(0,gt.rJ)(rr.currentTarget,rr,ye,ar)),Lt==null||Lt(rr)},it=function(rr){var ar=rr.target.value;if(!Ji&&pr){var ot=rr.target.selectionStart>=le+1||rr.target.selectionStart===ar.length||!rr.target.selectionStart;ar=ft(ot,gr,ar,le)}Pr(ar),(0,gt.rJ)(rr.currentTarget,rr,ye,ar)},_t=function(rr){var ar=Wt.onPressEnter,ot=Wt.onKeyDown;rr.key==="Enter"&&ar&&ar(rr),ot==null||ot(rr)},Ut=function(rr){br(!0),ue==null||ue(rr)},Ke=function(rr){br(!1),se==null||se(rr)},ut=function(rr){var ar;Pr(""),nr(),(0,gt.rJ)((ar=Ur.current)===null||ar===void 0?void 0:ar.textArea,rr,ye)},Ot=(0,gt.D7)(gr);!Ji&&pr&&Ee==null&&(Ot=at(Ot,le));var Tt=tn,zt;if(ln){var Ht=(0,Le.Z)(Ot).length;(0,Ye.Z)(ln)==="object"?zt=ln.formatter({value:Ot,count:Ht,maxLength:le}):zt="".concat(Ht).concat(pr?" / ".concat(le):""),Tt=ze.createElement(ze.Fragment,null,Tt,ze.createElement("span",{className:pe()("".concat(sn,"-data-count"),Gr==null?void 0:Gr.count),style:li==null?void 0:li.count},zt))}var $n=function(rr){var ar;st==null||st(rr),(ar=Ur.current)!==null&&ar!==void 0&&ar.textArea.style.height&&sr(!0)},Cr=!Wt.autoSize&&!ln&&!ve,Yn=ze.createElement(Te.BaseInput,{value:Ot,allowClear:ve,handleReset:ut,suffix:Tt,prefixCls:sn,classes:{affixWrapper:pe()(yn==null?void 0:yn.affixWrapper,(Pn={},(0,Fe.Z)(Pn,"".concat(sn,"-show-count"),ln),(0,Fe.Z)(Pn,"".concat(sn,"-textarea-allow-clear"),ve),Pn))},disabled:Nt,focused:ui,className:yr,style:(0,tt.Z)((0,tt.Z)({},Fr),An&&!Cr?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof zt=="string"?zt:void 0}},hidden:Rn,inputElement:ze.createElement(Hn,(0,fe.Z)({},Wt,{onKeyDown:_t,onChange:it,onFocus:Ut,onBlur:Ke,onCompositionStart:Kn,onCompositionEnd:Ue,className:Gr==null?void 0:Gr.textarea,style:(0,tt.Z)((0,tt.Z)({},li==null?void 0:li.textarea),{},{resize:Fr==null?void 0:Fr.resize}),disabled:Nt,prefixCls:sn,onResize:$n,ref:Ur}))});return Yn}),zn=Gt,mn=zn},1337:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return Se}});var fe=ce(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`,Ye="".concat(tt," ").concat(Fe).split(/[\s\n]+/),be="aria-",_e="data-";function Le(pe,Te){return pe.indexOf(Te)===0}function Se(pe){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,gt;Te===!1?gt={aria:!0,data:!0,attr:!0}:Te===!0?gt={aria:!0}:gt=(0,fe.Z)({},Te);var ze={};return Object.keys(pe).forEach(function(Pt){(gt.aria&&(Pt==="role"||Le(Pt,be))||gt.data&&Le(Pt,_e)||gt.attr&&Ye.includes(Pt))&&(ze[Pt]=pe[Pt])}),ze}},88386:function(Ln,qt,ce){(function(fe){fe(ce(4631))})(function(fe){fe.defineOption("placeholder","",function(Se,pe,Te){var gt=Te&&Te!=fe.Init;if(pe&&!gt)Se.on("blur",be),Se.on("change",_e),Se.on("swapDoc",_e),fe.on(Se.getInputField(),"compositionupdate",Se.state.placeholderCompose=function(){Ye(Se)}),_e(Se);else if(!pe&&gt){Se.off("blur",be),Se.off("change",_e),Se.off("swapDoc",_e),fe.off(Se.getInputField(),"compositionupdate",Se.state.placeholderCompose),tt(Se);var ze=Se.getWrapperElement();ze.className=ze.className.replace(" CodeMirror-empty","")}pe&&!Se.hasFocus()&&be(Se)});function tt(Se){Se.state.placeholder&&(Se.state.placeholder.parentNode.removeChild(Se.state.placeholder),Se.state.placeholder=null)}function Fe(Se){tt(Se);var pe=Se.state.placeholder=document.createElement("pre");pe.style.cssText="height: 0; overflow: visible",pe.style.direction=Se.getOption("direction"),pe.className="CodeMirror-placeholder CodeMirror-line-like";var Te=Se.getOption("placeholder");typeof Te=="string"&&(Te=document.createTextNode(Te)),pe.appendChild(Te),Se.display.lineSpace.insertBefore(pe,Se.display.lineSpace.firstChild)}function Ye(Se){setTimeout(function(){var pe=!1,Te=Se.getInputField();Te.nodeName=="TEXTAREA"?pe=!Te.value:Se.lineCount()==1&&(pe=!/[^\u200b]/.test(Te.querySelector(".CodeMirror-line").textContent)),pe?Fe(Se):tt(Se)},20)}function be(Se){Le(Se)&&Fe(Se)}function _e(Se){var pe=Se.getWrapperElement(),Te=Le(Se);pe.className=pe.className.replace(" CodeMirror-empty","")+(Te?" CodeMirror-empty":""),Te?Fe(Se):tt(Se)}function Le(Se){return Se.lineCount()===1&&Se.getLine(0)===""}})},82801:function(Ln,qt,ce){(function(fe){fe(ce(4631))})(function(fe){var tt={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},Fe=fe.Pos;fe.defineOption("autoCloseBrackets",!1,function(pt,Je,De){De&&De!=fe.Init&&(pt.removeKeyMap(be),pt.state.closeBrackets=null),Je&&(_e(Ye(Je,"pairs")),pt.state.closeBrackets=Je,pt.addKeyMap(be))});function Ye(pt,Je){return Je=="pairs"&&typeof pt=="string"?pt:typeof pt=="object"&&pt[Je]!=null?pt[Je]:tt[Je]}var be={Backspace:pe,Enter:Te};function _e(pt){for(var Je=0;Je<pt.length;Je++){var De=pt.charAt(Je),Dt="'"+De+"'";be[Dt]||(be[Dt]=Le(De))}}_e(tt.pairs+"`");function Le(pt){return function(Je){return ze(Je,pt)}}function Se(pt){var Je=pt.state.closeBrackets;if(!Je||Je.override)return Je;var De=pt.getModeAt(pt.getCursor());return De.closeBrackets||Je}function pe(pt){var Je=Se(pt);if(!Je||pt.getOption("disableInput"))return fe.Pass;for(var De=Ye(Je,"pairs"),Dt=pt.listSelections(),Yt=0;Yt<Dt.length;Yt++){if(!Dt[Yt].empty())return fe.Pass;var nt=Pt(pt,Dt[Yt].head);if(!nt||De.indexOf(nt)%2!=0)return fe.Pass}for(var Yt=Dt.length-1;Yt>=0;Yt--){var ct=Dt[Yt].head;pt.replaceRange("",Fe(ct.line,ct.ch-1),Fe(ct.line,ct.ch+1),"+delete")}}function Te(pt){var Je=Se(pt),De=Je&&Ye(Je,"explode");if(!De||pt.getOption("disableInput"))return fe.Pass;for(var Dt=pt.listSelections(),Yt=0;Yt<Dt.length;Yt++){if(!Dt[Yt].empty())return fe.Pass;var nt=Pt(pt,Dt[Yt].head);if(!nt||De.indexOf(nt)%2!=0)return fe.Pass}pt.operation(function(){var ct=pt.lineSeparator()||`
`;pt.replaceSelection(ct+ct,null),pt.execCommand("goCharLeft"),Dt=pt.listSelections();for(var Ie=0;Ie<Dt.length;Ie++){var Me=Dt[Ie].head.line;pt.indentLine(Me,null,!0),pt.indentLine(Me+1,null,!0)}})}function gt(pt){var Je=fe.cmpPos(pt.anchor,pt.head)>0;return{anchor:new Fe(pt.anchor.line,pt.anchor.ch+(Je?-1:1)),head:new Fe(pt.head.line,pt.head.ch+(Je?1:-1))}}function ze(pt,Je){var De=Se(pt);if(!De||pt.getOption("disableInput"))return fe.Pass;var Dt=Ye(De,"pairs"),Yt=Dt.indexOf(Je);if(Yt==-1)return fe.Pass;for(var nt=Ye(De,"closeBefore"),ct=Ye(De,"triples"),Ie=Dt.charAt(Yt+1)==Je,Me=pt.listSelections(),Ve=Yt%2==0,Xe,Ct=0;Ct<Me.length;Ct++){var wt=Me[Ct],Mt=wt.head,je,Rt=pt.getRange(Mt,Fe(Mt.line,Mt.ch+1));if(Ve&&!wt.empty())je="surround";else if((Ie||!Ve)&&Rt==Je)Ie&&kt(pt,Mt)?je="both":ct.indexOf(Je)>=0&&pt.getRange(Mt,Fe(Mt.line,Mt.ch+3))==Je+Je+Je?je="skipThree":je="skip";else if(Ie&&Mt.ch>1&&ct.indexOf(Je)>=0&&pt.getRange(Fe(Mt.line,Mt.ch-2),Mt)==Je+Je){if(Mt.ch>2&&/\bstring/.test(pt.getTokenTypeAt(Fe(Mt.line,Mt.ch-2))))return fe.Pass;je="addFour"}else if(Ie){var At=Mt.ch==0?" ":pt.getRange(Fe(Mt.line,Mt.ch-1),Mt);if(!fe.isWordChar(Rt)&&At!=Je&&!fe.isWordChar(At))je="both";else return fe.Pass}else if(Ve&&(Rt.length===0||/\s/.test(Rt)||nt.indexOf(Rt)>-1))je="both";else return fe.Pass;if(!Xe)Xe=je;else if(Xe!=je)return fe.Pass}var xn=Yt%2?Dt.charAt(Yt-1):Je,jt=Yt%2?Je:Dt.charAt(Yt+1);pt.operation(function(){if(Xe=="skip")pt.execCommand("goCharRight");else if(Xe=="skipThree")for(var vn=0;vn<3;vn++)pt.execCommand("goCharRight");else if(Xe=="surround"){for(var er=pt.getSelections(),vn=0;vn<er.length;vn++)er[vn]=xn+er[vn]+jt;pt.replaceSelections(er,"around"),er=pt.listSelections().slice();for(var vn=0;vn<er.length;vn++)er[vn]=gt(er[vn]);pt.setSelections(er)}else Xe=="both"?(pt.replaceSelection(xn+jt,null),pt.triggerElectric(xn+jt),pt.execCommand("goCharLeft")):Xe=="addFour"&&(pt.replaceSelection(xn+xn+xn+xn,"before"),pt.execCommand("goCharRight"))})}function Pt(pt,Je){var De=pt.getRange(Fe(Je.line,Je.ch-1),Fe(Je.line,Je.ch+1));return De.length==2?De:null}function kt(pt,Je){var De=pt.getTokenAt(Fe(Je.line,Je.ch+1));return/\bstring/.test(De.type)&&De.start==Je.ch&&(Je.ch==0||!/\bstring/.test(pt.getTokenTypeAt(Je)))}})},57341:function(Ln,qt,ce){(function(fe){fe(ce(4631),ce(4786))})(function(fe){fe.defineOption("autoCloseTags",!1,function(pe,Te,gt){if(gt!=fe.Init&&gt&&pe.removeKeyMap("autoCloseTags"),!!Te){var ze={name:"autoCloseTags"};(typeof Te!="object"||Te.whenClosing!==!1)&&(ze["'/'"]=function(Pt){return _e(Pt)}),(typeof Te!="object"||Te.whenOpening!==!1)&&(ze["'>'"]=function(Pt){return Ye(Pt)}),pe.addKeyMap(ze)}});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 Ye(pe){if(pe.getOption("disableInput"))return fe.Pass;for(var Te=pe.listSelections(),gt=[],ze=pe.getOption("autoCloseTags"),Pt=0;Pt<Te.length;Pt++){if(!Te[Pt].empty())return fe.Pass;var kt=Te[Pt].head,pt=pe.getTokenAt(kt),Je=fe.innerMode(pe.getMode(),pt.state),De=Je.state,Dt=Je.mode.xmlCurrentTag&&Je.mode.xmlCurrentTag(De),Yt=Dt&&Dt.name;if(!Yt)return fe.Pass;var nt=Je.mode.configuration=="html",ct=typeof ze=="object"&&ze.dontCloseTags||nt&&tt,Ie=typeof ze=="object"&&ze.indentTags||nt&&Fe;pt.end>kt.ch&&(Yt=Yt.slice(0,Yt.length-pt.end+kt.ch));var Me=Yt.toLowerCase();if(!Yt||pt.type=="string"&&(pt.end!=kt.ch||!/[\"\']/.test(pt.string.charAt(pt.string.length-1))||pt.string.length==1)||pt.type=="tag"&&Dt.close||pt.string.indexOf("/")==kt.ch-pt.start-1||ct&&Le(ct,Me)>-1||Se(pe,Je.mode.xmlCurrentContext&&Je.mode.xmlCurrentContext(De)||[],Yt,kt,!0))return fe.Pass;var Ve=typeof ze=="object"&&ze.emptyTags;if(Ve&&Le(Ve,Yt)>-1){gt[Pt]={text:"/>",newPos:fe.Pos(kt.line,kt.ch+2)};continue}var Xe=Ie&&Le(Ie,Me)>-1;gt[Pt]={indent:Xe,text:">"+(Xe?`
`:"")+"</"+Yt+">",newPos:Xe?fe.Pos(kt.line+1,0):fe.Pos(kt.line,kt.ch+1)}}for(var Ct=typeof ze=="object"&&ze.dontIndentOnAutoClose,Pt=Te.length-1;Pt>=0;Pt--){var wt=gt[Pt];pe.replaceRange(wt.text,Te[Pt].head,Te[Pt].anchor,"+insert");var Mt=pe.listSelections().slice(0);Mt[Pt]={head:wt.newPos,anchor:wt.newPos},pe.setSelections(Mt),!Ct&&wt.indent&&(pe.indentLine(wt.newPos.line,null,!0),pe.indentLine(wt.newPos.line+1,null,!0))}}function be(pe,Te){for(var gt=pe.listSelections(),ze=[],Pt=Te?"/":"</",kt=pe.getOption("autoCloseTags"),pt=typeof kt=="object"&&kt.dontIndentOnSlash,Je=0;Je<gt.length;Je++){if(!gt[Je].empty())return fe.Pass;var De=gt[Je].head,Dt=pe.getTokenAt(De),Yt=fe.innerMode(pe.getMode(),Dt.state),nt=Yt.state;if(Te&&(Dt.type=="string"||Dt.string.charAt(0)!="<"||Dt.start!=De.ch-1))return fe.Pass;var ct,Ie=Yt.mode.name!="xml"&&pe.getMode().name=="htmlmixed";if(Ie&&Yt.mode.name=="javascript")ct=Pt+"script";else if(Ie&&Yt.mode.name=="css")ct=Pt+"style";else{var Me=Yt.mode.xmlCurrentContext&&Yt.mode.xmlCurrentContext(nt);if(!Me||Me.length&&Se(pe,Me,Me[Me.length-1],De))return fe.Pass;ct=Pt+Me[Me.length-1]}pe.getLine(De.line).charAt(Dt.end)!=">"&&(ct+=">"),ze[Je]=ct}if(pe.replaceSelections(ze),gt=pe.listSelections(),!pt)for(var Je=0;Je<gt.length;Je++)(Je==gt.length-1||gt[Je].head.line<gt[Je+1].head.line)&&pe.indentLine(gt[Je].head.line)}function _e(pe){return pe.getOption("disableInput")?fe.Pass:be(pe,!0)}fe.commands.closeTag=function(pe){return be(pe)};function Le(pe,Te){if(pe.indexOf)return pe.indexOf(Te);for(var gt=0,ze=pe.length;gt<ze;++gt)if(pe[gt]==Te)return gt;return-1}function Se(pe,Te,gt,ze,Pt){if(!fe.scanForClosingTag)return!1;var kt=Math.min(pe.lastLine()+1,ze.line+500),pt=fe.scanForClosingTag(pe,ze,null,kt);if(!pt||pt.tag!=gt)return!1;for(var Je=Pt?1:0,De=Te.length-1;De>=0&&Te[De]==gt;De--)++Je;ze=pt.to;for(var De=1;De<Je;De++){var Dt=fe.scanForClosingTag(pe,ze,null,kt);if(!Dt||Dt.tag!=gt)return!1;ze=Dt.to}return!0}})},4786:function(Ln,qt,ce){(function(fe){fe(ce(4631))})(function(fe){"use strict";var tt=fe.Pos;function Fe(De,Dt){return De.line-Dt.line||De.ch-Dt.ch}var Ye="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",be=Ye+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",_e=new RegExp("<(/?)(["+Ye+"]["+be+"]*)","g");function Le(De,Dt,Yt,nt){this.line=Dt,this.ch=Yt,this.cm=De,this.text=De.getLine(Dt),this.min=nt?Math.max(nt.from,De.firstLine()):De.firstLine(),this.max=nt?Math.min(nt.to-1,De.lastLine()):De.lastLine()}function Se(De,Dt){var Yt=De.cm.getTokenTypeAt(tt(De.line,Dt));return Yt&&/\btag\b/.test(Yt)}function pe(De){if(!(De.line>=De.max))return De.ch=0,De.text=De.cm.getLine(++De.line),!0}function Te(De){if(!(De.line<=De.min))return De.text=De.cm.getLine(--De.line),De.ch=De.text.length,!0}function gt(De){for(;;){var Dt=De.text.indexOf(">",De.ch);if(Dt==-1){if(pe(De))continue;return}if(!Se(De,Dt+1)){De.ch=Dt+1;continue}var Yt=De.text.lastIndexOf("/",Dt),nt=Yt>-1&&!/\S/.test(De.text.slice(Yt+1,Dt));return De.ch=Dt+1,nt?"selfClose":"regular"}}function ze(De){for(;;){var Dt=De.ch?De.text.lastIndexOf("<",De.ch-1):-1;if(Dt==-1){if(Te(De))continue;return}if(!Se(De,Dt+1)){De.ch=Dt;continue}_e.lastIndex=Dt,De.ch=Dt;var Yt=_e.exec(De.text);if(Yt&&Yt.index==Dt)return Yt}}function Pt(De){for(;;){_e.lastIndex=De.ch;var Dt=_e.exec(De.text);if(!Dt){if(pe(De))continue;return}if(!Se(De,Dt.index+1)){De.ch=Dt.index+1;continue}return De.ch=Dt.index+Dt[0].length,Dt}}function kt(De){for(;;){var Dt=De.ch?De.text.lastIndexOf(">",De.ch-1):-1;if(Dt==-1){if(Te(De))continue;return}if(!Se(De,Dt+1)){De.ch=Dt;continue}var Yt=De.text.lastIndexOf("/",Dt),nt=Yt>-1&&!/\S/.test(De.text.slice(Yt+1,Dt));return De.ch=Dt+1,nt?"selfClose":"regular"}}function pt(De,Dt){for(var Yt=[];;){var nt=Pt(De),ct,Ie=De.line,Me=De.ch-(nt?nt[0].length:0);if(!nt||!(ct=gt(De)))return;if(ct!="selfClose")if(nt[1]){for(var Ve=Yt.length-1;Ve>=0;--Ve)if(Yt[Ve]==nt[2]){Yt.length=Ve;break}if(Ve<0&&(!Dt||Dt==nt[2]))return{tag:nt[2],from:tt(Ie,Me),to:tt(De.line,De.ch)}}else Yt.push(nt[2])}}function Je(De,Dt){for(var Yt=[];;){var nt=kt(De);if(!nt)return;if(nt=="selfClose"){ze(De);continue}var ct=De.line,Ie=De.ch,Me=ze(De);if(!Me)return;if(Me[1])Yt.push(Me[2]);else{for(var Ve=Yt.length-1;Ve>=0;--Ve)if(Yt[Ve]==Me[2]){Yt.length=Ve;break}if(Ve<0&&(!Dt||Dt==Me[2]))return{tag:Me[2],from:tt(De.line,De.ch),to:tt(ct,Ie)}}}}fe.registerHelper("fold","xml",function(De,Dt){for(var Yt=new Le(De,Dt.line,0);;){var nt=Pt(Yt);if(!nt||Yt.line!=Dt.line)return;var ct=gt(Yt);if(!ct)return;if(!nt[1]&&ct!="selfClose"){var Ie=tt(Yt.line,Yt.ch),Me=pt(Yt,nt[2]);return Me&&Fe(Me.from,Ie)>0?{from:Ie,to:Me.from}:null}}}),fe.findMatchingTag=function(De,Dt,Yt){var nt=new Le(De,Dt.line,Dt.ch,Yt);if(!(nt.text.indexOf(">")==-1&&nt.text.indexOf("<")==-1)){var ct=gt(nt),Ie=ct&&tt(nt.line,nt.ch),Me=ct&&ze(nt);if(!(!ct||!Me||Fe(nt,Dt)>0)){var Ve={from:tt(nt.line,nt.ch),to:Ie,tag:Me[2]};return ct=="selfClose"?{open:Ve,close:null,at:"open"}:Me[1]?{open:Je(nt,Me[2]),close:Ve,at:"close"}:(nt=new Le(De,Ie.line,Ie.ch,Yt),{open:Ve,close:pt(nt,Me[2]),at:"open"})}}},fe.findEnclosingTag=function(De,Dt,Yt,nt){for(var ct=new Le(De,Dt.line,Dt.ch,Yt);;){var Ie=Je(ct,nt);if(!Ie)break;var Me=new Le(De,Dt.line,Dt.ch,Yt),Ve=pt(Me,Ie.tag);if(Ve)return{open:Ie,close:Ve}}},fe.scanForClosingTag=function(De,Dt,Yt,nt){var ct=new Le(De,Dt.line,Dt.ch,nt?{from:0,to:nt}:null);return pt(ct,Yt)}})},4631:function(Ln){(function(qt,ce){Ln.exports=ce()})(this,function(){"use strict";var qt=navigator.userAgent,ce=navigator.platform,fe=/gecko\/\d/i.test(qt),tt=/MSIE \d/.test(qt),Fe=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(qt),Ye=/Edge\/(\d+)/.exec(qt),be=tt||Fe||Ye,_e=be&&(tt?document.documentMode||6:+(Ye||Fe)[1]),Le=!Ye&&/WebKit\//.test(qt),Se=Le&&/Qt\/\d+\.\d+/.test(qt),pe=!Ye&&/Chrome\//.test(qt),Te=/Opera\//.test(qt),gt=/Apple Computer/.test(navigator.vendor),ze=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(qt),Pt=/PhantomJS/.test(qt),kt=!Ye&&/AppleWebKit/.test(qt)&&/Mobile\/\w+/.test(qt),pt=/Android/.test(qt),Je=kt||pt||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(qt),De=kt||/Mac/.test(ce),Dt=/\bCrOS\b/.test(qt),Yt=/win/i.test(ce),nt=Te&&qt.match(/Version\/(\d*\.\d*)/);nt&&(nt=Number(nt[1])),nt&&nt>=15&&(Te=!1,Le=!0);var ct=De&&(Se||Te&&(nt==null||nt<12.11)),Ie=fe||be&&_e>=9;function Me(x){return new RegExp("(^|\\s)"+x+"(?:$|\\s)\\s*")}var Ve=function(x,z){var ne=x.className,te=Me(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 Xe(x){for(var z=x.childNodes.length;z>0;--z)x.removeChild(x.firstChild);return x}function Ct(x,z){return Xe(x).appendChild(z)}function wt(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 oe=0;oe<z.length;++oe)ie.appendChild(z[oe]);return ie}function Mt(x,z,ne,te){var ie=wt(x,z,ne,te);return ie.setAttribute("role","presentation"),ie}var je;document.createRange?je=function(x,z,ne,te){var ie=document.createRange();return ie.setEnd(te||x,ne),ie.setStart(x,z),ie}:je=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 Rt(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 At(){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 xn(x,z){var ne=x.className;Me(z).test(ne)||(x.className+=(ne?" ":"")+z)}function jt(x,z){for(var ne=x.split(" "),te=0;te<ne.length;te++)ne[te]&&!Me(ne[te]).test(z)&&(z+=" "+ne[te]);return z}var vn=function(x){x.select()};kt?vn=function(x){x.selectionStart=0,x.selectionEnd=x.value.length}:be&&(vn=function(x){try{x.select()}catch(z){}});function er(x){var z=Array.prototype.slice.call(arguments,1);return function(){return x.apply(null,z)}}function Sr(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 qe(x,z,ne,te,ie){z==null&&(z=x.search(/[^\s\u00a0]/),z==-1&&(z=x.length));for(var oe=te||0,me=ie||0;;){var we=x.indexOf(" ",oe);if(we<0||we>=z)return me+(z-oe);me+=we-oe,me+=ne-me%ne,oe=we+1}}var Ae=function(){this.id=null,this.f=null,this.time=0,this.handler=er(this.onTimeout,this)};Ae.prototype.onTimeout=function(x){x.id=0,x.time<=+new Date?x.f():setTimeout(x.handler,x.time-+new Date)},Ae.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 $t(x,z){for(var ne=0;ne<x.length;++ne)if(x[ne]==z)return ne;return-1}var Hn=50,bn={toString:function(){return"CodeMirror.Pass"}},at={scroll:!1},ft={origin:"*mouse"},Gt={origin:"+move"};function zn(x,z,ne){for(var te=0,ie=0;;){var oe=x.indexOf(" ",te);oe==-1&&(oe=x.length);var me=oe-te;if(oe==x.length||ie+me>=z)return te+Math.min(me,z-ie);if(ie+=oe-te,ie+=ne-ie%ne,te=oe+1,ie>=z)return te}}var mn=[""];function nn(x){for(;mn.length<=x;)mn.push(Ft(mn)+" ");return mn[x]}function Ft(x){return x[x.length-1]}function Pn(x,z){for(var ne=[],te=0;te<x.length;te++)ne[te]=z(x[te],te);return ne}function _n(x,z,ne){for(var te=0,ie=ne(z);te<x.length&&ne(x[te])<=ie;)te++;x.splice(te,0,z)}function Ee(){}function ue(x,z){var ne;return Object.create?ne=Object.create(x):(Ee.prototype=x,ne=new Ee),z&&Sr(z,ne),ne}var se=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ye(x){return/\w/.test(x)||x>"\x80"&&(x.toUpperCase()!=x.toLowerCase()||se.test(x))}function ve(x,z){return z?z.source.indexOf("\\w")>-1&&ye(x)?!0:z.test(x):ye(x)}function le(x){for(var z in x)if(x.hasOwnProperty(z)&&x[z])return!1;return!0}var We=/[\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 Lt(x){return x.charCodeAt(0)>=768&&We.test(x)}function tn(x,z,ne){for(;(ne<0?z>0:z<x.length)&&Lt(x.charAt(z));)z+=ne;return z}function hn(x,z,ne){for(var te=z>ne?-1:1;;){if(z==ne)return z;var ie=(z+ne)/2,oe=te<0?Math.ceil(ie):Math.floor(ie);if(oe==z)return x(oe)?z:ne;x(oe)?ne=oe:z=oe+te}}function sn(x,z,ne,te){if(!x)return te(z,ne,"ltr",0);for(var ie=!1,oe=0;oe<x.length;++oe){var me=x[oe];(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",oe),ie=!0)}ie||te(z,ne,"ltr")}var yn=null;function ln(x,z,ne){var te;yn=null;for(var ie=0;ie<x.length;++ie){var oe=x[ie];if(oe.from<z&&oe.to>z)return ie;oe.to==z&&(oe.from!=oe.to&&ne=="before"?te=ie:yn=ie),oe.from==z&&(oe.from!=oe.to&&ne!="before"?te=ie:yn=ie)}return te!=null?te:yn}var yr=function(){var x="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",z="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function ne(Oe){return Oe<=247?x.charAt(Oe):1424<=Oe&&Oe<=1524?"R":1536<=Oe&&Oe<=1785?z.charAt(Oe-1536):1774<=Oe&&Oe<=2220?"r":8192<=Oe&&Oe<=8203?"w":Oe==8204?"b":"L"}var te=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,ie=/[stwN]/,oe=/[LRr]/,me=/[Lb1n]/,we=/[1n]/;function ke(Oe,lt,Et){this.level=Oe,this.from=lt,this.to=Et}return function(Oe,lt){var Et=lt=="ltr"?"L":"R";if(Oe.length==0||lt=="ltr"&&!te.test(Oe))return!1;for(var on=Oe.length,Vt=[],Xn=0;Xn<on;++Xn)Vt.push(ne(Oe.charCodeAt(Xn)));for(var dr=0,Tr=Et;dr<on;++dr){var Wr=Vt[dr];Wr=="m"?Vt[dr]=Tr:Tr=Wr}for(var ni=0,Kr=Et;ni<on;++ni){var ri=Vt[ni];ri=="1"&&Kr=="r"?Vt[ni]="n":oe.test(ri)&&(Kr=ri,ri=="r"&&(Vt[ni]="R"))}for(var Fi=1,Hi=Vt[0];Fi<on-1;++Fi){var ba=Vt[Fi];ba=="+"&&Hi=="1"&&Vt[Fi+1]=="1"?Vt[Fi]="1":ba==","&&Hi==Vt[Fi+1]&&(Hi=="1"||Hi=="n")&&(Vt[Fi]=Hi),Hi=ba}for(var to=0;to<on;++to){var Wo=Vt[to];if(Wo==",")Vt[to]="N";else if(Wo=="%"){var bo=void 0;for(bo=to+1;bo<on&&Vt[bo]=="%";++bo);for(var us=to&&Vt[to-1]=="!"||bo<on&&Vt[bo]=="1"?"1":"N",ds=to;ds<bo;++ds)Vt[ds]=us;to=bo-1}}for(var Io=0,fs=Et;Io<on;++Io){var oa=Vt[Io];fs=="L"&&oa=="1"?Vt[Io]="L":oe.test(oa)&&(fs=oa)}for(var So=0;So<on;++So)if(ie.test(Vt[So])){var xo=void 0;for(xo=So+1;xo<on&&ie.test(Vt[xo]);++xo);for(var Co=(So?Vt[So-1]:Et)=="L",ko=(xo<on?Vt[xo]:Et)=="L",Wl=Co==ko?Co?"L":"R":Et,ys=So;ys<xo;++ys)Vt[ys]=Wl;So=xo-1}for(var Go=[],Wa,Bo=0;Bo<on;)if(me.test(Vt[Bo])){var Eu=Bo;for(++Bo;Bo<on&&me.test(Vt[Bo]);++Bo);Go.push(new ke(0,Eu,Bo))}else{var sl=Bo,xl=Go.length,Vs=lt=="rtl"?1:0;for(++Bo;Bo<on&&Vt[Bo]!="L";++Bo);for(var Po=sl;Po<Bo;)if(we.test(Vt[Po])){sl<Po&&(Go.splice(xl,0,new ke(1,sl,Po)),xl+=Vs);var Ul=Po;for(++Po;Po<Bo&&we.test(Vt[Po]);++Po);Go.splice(xl,0,new ke(2,Ul,Po)),xl+=Vs,sl=Po}else++Po;sl<Bo&&Go.splice(xl,0,new ke(1,sl,Bo))}return lt=="ltr"&&(Go[0].level==1&&(Wa=Oe.match(/^\s+/))&&(Go[0].from=Wa[0].length,Go.unshift(new ke(0,0,Wa[0].length))),Ft(Go).level==1&&(Wa=Oe.match(/\s+$/))&&(Ft(Go).to-=Wa[0].length,Go.push(new ke(0,on-Wa[0].length,on)))),lt=="rtl"?Go.reverse():Go}}();function Fr(x,z){var ne=x.order;return ne==null&&(ne=x.order=yr(x.text,z)),ne}var Nt=[],Rn=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]||Nt).concat(ne)}};function Gr(x,z){return x._handlers&&x._handlers[z]||Nt}function li(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 oe=$t(ie,ne);oe>-1&&(te[z]=ie.slice(0,oe).concat(ie.slice(oe+1)))}}}function st(x,z){var ne=Gr(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 Wt(x,z,ne){return typeof z=="string"&&(z={type:z,preventDefault:function(){this.defaultPrevented=!0}}),st(x,ne||z.type,x,z),Xr(z)||z.codemirrorIgnore}function Vn(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)$t(ne,z[te])==-1&&ne.push(z[te])}function ir(x,z){return Gr(x,z).length>0}function gr(x){x.prototype.on=function(z,ne){Rn(this,z,ne)},x.prototype.off=function(z,ne){li(this,z,ne)}}function Pr(x){x.preventDefault?x.preventDefault():x.returnValue=!1}function Ur(x){x.stopPropagation?x.stopPropagation():x.cancelBubble=!0}function Xr(x){return x.defaultPrevented!=null?x.defaultPrevented:x.returnValue==!1}function qr(x){Pr(x),Ur(x)}function ui(x){return x.target||x.srcElement}function br(x){var z=x.which;return z==null&&(x.button&1?z=1:x.button&2?z=3:x.button&4&&(z=2)),De&&x.ctrlKey&&z==1&&(z=3),z}var Ei=function(){if(be&&_e<9)return!1;var x=wt("div");return"draggable"in x||"dragDrop"in x}(),sa;function Ji(x){if(sa==null){var z=wt("span","\u200B");Ct(x,wt("span",[z,document.createTextNode("x")])),x.firstChild.offsetHeight!=0&&(sa=z.offsetWidth<=1&&z.offsetHeight>2&&!(be&&_e<8))}var ne=sa?wt("span","\u200B"):wt("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return ne.setAttribute("cm-text",""),ne}var Qi;function Ci(x){if(Qi!=null)return Qi;var z=Ct(x,document.createTextNode("A\u062EA")),ne=je(z,0,1).getBoundingClientRect(),te=je(z,1,2).getBoundingClientRect();return Xe(x),!ne||ne.left==ne.right?!1:Qi=te.right-ne.right<3}var mt=`
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 oe=x.slice(z,x.charAt(ie-1)=="\r"?ie-1:ie),me=oe.indexOf("\r");me!=-1?(ne.push(oe.slice(0,me)),z+=me+1):(ne.push(oe),z=ie+1)}return ne}:function(x){return x.split(/\r\n?|\n/)},Mn=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},En=function(){var x=wt("div");return"oncopy"in x?!0:(x.setAttribute("oncopy","return;"),typeof x.oncopy=="function")}(),An=null;function sr(x){if(An!=null)return An;var z=Ct(x,wt("span","x")),ne=z.getBoundingClientRect(),te=je(z,0,1).getBoundingClientRect();return An=Math.abs(ne.left-te.left)>1}var nr={},pr={};function Kn(x,z){arguments.length>2&&(z.dependencies=Array.prototype.slice.call(arguments,2)),nr[x]=z}function Ue(x,z){pr[x]=z}function it(x){if(typeof x=="string"&&pr.hasOwnProperty(x))x=pr[x];else if(x&&typeof x.name=="string"&&pr.hasOwnProperty(x.name)){var z=pr[x.name];typeof z=="string"&&(z={name:z}),x=ue(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 _t(x,z){z=it(z);var ne=nr[z.name];if(!ne)return _t(x,"text/plain");var te=ne(x,z);if(Ut.hasOwnProperty(z.name)){var ie=Ut[z.name];for(var oe in ie)ie.hasOwnProperty(oe)&&(te.hasOwnProperty(oe)&&(te["_"+oe]=te[oe]),te[oe]=ie[oe])}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 Ut={};function Ke(x,z){var ne=Ut.hasOwnProperty(x)?Ut[x]:Ut[x]={};Sr(z,ne)}function ut(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 Ot(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 Tt(x,z,ne){return x.startState?x.startState(z,ne):!0}var zt=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};zt.prototype.eol=function(){return this.pos>=this.string.length},zt.prototype.sol=function(){return this.pos==this.lineStart},zt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},zt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},zt.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},zt.prototype.eatWhile=function(x){for(var z=this.pos;this.eat(x););return this.pos>z},zt.prototype.eatSpace=function(){for(var x=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>x},zt.prototype.skipToEnd=function(){this.pos=this.string.length},zt.prototype.skipTo=function(x){var z=this.string.indexOf(x,this.pos);if(z>-1)return this.pos=z,!0},zt.prototype.backUp=function(x){this.pos-=x},zt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=qe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?qe(this.string,this.lineStart,this.tabSize):0)},zt.prototype.indentation=function(){return qe(this.string,null,this.tabSize)-(this.lineStart?qe(this.string,this.lineStart,this.tabSize):0)},zt.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 oe=this.string.slice(this.pos).match(x);return oe&&oe.index>0?null:(oe&&z!==!1&&(this.pos+=oe[0].length),oe)}},zt.prototype.current=function(){return this.string.slice(this.start,this.pos)},zt.prototype.hideFirstChars=function(x,z){this.lineStart+=x;try{return z()}finally{this.lineStart-=x}},zt.prototype.lookAhead=function(x){var z=this.lineOracle;return z&&z.lookAhead(x)},zt.prototype.baseToken=function(){var x=this.lineOracle;return x&&x.baseToken(this.pos)};function Ht(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],oe=ie.chunkSize();if(z<oe){ne=ie;break}z-=oe}return ne.lines[z]}function $n(x,z,ne){var te=[],ie=z.line;return x.iter(z.line,ne.line+1,function(oe){var me=oe.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 Yn(x,z){var ne=z-x.height;if(ne)for(var te=x;te;te=te.parent)te.height+=ne}function qn(x){if(x.parent==null)return null;for(var z=x.parent,ne=$t(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 rr(x,z){var ne=x.first;e:do{for(var te=0;te<x.children.length;++te){var ie=x.children[te],oe=ie.height;if(z<oe){x=ie;continue e}z-=oe,ne+=ie.chunkSize()}return ne}while(!x.lines);for(var me=0;me<x.lines.length;++me){var we=x.lines[me],ke=we.height;if(z<ke)break;z-=ke}return ne+me}function ar(x,z){return z>=x.first&&z<x.first+x.size}function ot(x,z){return String(x.lineNumberFormatter(z+x.firstLineNumber))}function Qe(x,z,ne){if(ne===void 0&&(ne=null),!(this instanceof Qe))return new Qe(x,z,ne);this.line=x,this.ch=z,this.sticky=ne}function vt(x,z){return x.line-z.line||x.ch-z.ch}function Qt(x,z){return x.sticky==z.sticky&&vt(x,z)==0}function Tn(x){return Qe(x.line,x.ch)}function en(x,z){return vt(x,z)<0?z:x}function cn(x,z){return vt(x,z)<0?x:z}function un(x,z){return Math.max(x.first,Math.min(z,x.first+x.size-1))}function Dn(x,z){if(z.line<x.first)return Qe(x.first,0);var ne=x.first+x.size-1;return z.line>ne?Qe(ne,Ht(x,ne).text.length):or(z,Ht(x,z.line).text.length)}function or(x,z){var ne=x.ch;return ne==null||ne>z?Qe(x.line,z):ne<0?Qe(x.line,0):x}function Kt(x,z){for(var ne=[],te=0;te<z.length;te++)ne[te]=Dn(x,z[te]);return ne}var Yr=function(x,z){this.state=x,this.lookAhead=z},$r=function(x,z,ne,te){this.state=z,this.doc=x,this.line=ne,this.maxLookAhead=te||0,this.baseTokens=null,this.baseTokenPos=1};$r.prototype.lookAhead=function(x){var z=this.doc.getLine(this.line+x);return z!=null&&x>this.maxLookAhead&&(this.maxLookAhead=x),z},$r.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}},$r.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},$r.fromSaved=function(x,z,ne){return z instanceof Yr?new $r(x,ut(x.mode,z.state),ne,z.lookAhead):new $r(x,ut(x.mode,z),ne)},$r.prototype.save=function(x){var z=x!==!1?ut(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Yr(z,this.maxLookAhead):z};function Ri(x,z,ne,te){var ie=[x.state.modeGen],oe={};mi(x,z.text,x.doc.mode,ne,function(Oe,lt){return ie.push(Oe,lt)},oe,te);for(var me=ne.state,we=function(Oe){ne.baseTokens=ie;var lt=x.state.overlays[Oe],Et=1,on=0;ne.state=!0,mi(x,z.text,lt.mode,ne,function(Vt,Xn){for(var dr=Et;on<Vt;){var Tr=ie[Et];Tr>Vt&&ie.splice(Et,1,Vt,ie[Et+1],Tr),Et+=2,on=Math.min(Vt,Tr)}if(Xn)if(lt.opaque)ie.splice(dr,Et-dr,Vt,"overlay "+Xn),Et=dr+2;else for(;dr<Et;dr+=2){var Wr=ie[dr+1];ie[dr+1]=(Wr?Wr+" ":"")+"overlay "+Xn}},oe),ne.state=me,ne.baseTokens=null,ne.baseTokenPos=1},ke=0;ke<x.state.overlays.length;++ke)we(ke);return{styles:ie,classes:oe.bgClass||oe.textClass?oe:null}}function Li(x,z,ne){if(!z.styles||z.styles[0]!=x.state.modeGen){var te=pi(x,qn(z)),ie=z.text.length>x.options.maxHighlightLength&&ut(x.doc.mode,te.state),oe=Ri(x,z,te);ie&&(te.state=ie),z.stateAfter=te.save(!ie),z.styles=oe.styles,oe.classes?z.styleClasses=oe.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 pi(x,z,ne){var te=x.doc,ie=x.display;if(!te.mode.startState)return new $r(te,!0,z);var oe=Wi(x,z,ne),me=oe>te.first&&Ht(te,oe-1).stateAfter,we=me?$r.fromSaved(te,me,oe):new $r(te,Tt(te.mode),oe);return te.iter(oe,z,function(ke){Gi(x,ke.text,we);var Oe=we.line;ke.stateAfter=Oe==z-1||Oe%5==0||Oe>=ie.viewFrom&&Oe<ie.viewTo?we.save():null,we.nextLine()}),ne&&(te.modeFrontier=we.line),we}function Gi(x,z,ne,te){var ie=x.doc.mode,oe=new zt(z,x.options.tabSize,ne);for(oe.start=oe.pos=te||0,z==""&&yi(ie,ne.state);!oe.eol();)ii(ie,oe,ne.state),oe.start=oe.pos}function yi(x,z){if(x.blankLine)return x.blankLine(z);if(x.innerMode){var ne=Ot(x,z);if(ne.mode.blankLine)return ne.mode.blankLine(ne.state)}}function ii(x,z,ne,te){for(var ie=0;ie<10;ie++){te&&(te[0]=Ot(x,ne).mode);var oe=x.token(z,ne);if(z.pos>z.start)return oe}throw new Error("Mode "+x.name+" failed to advance stream.")}var Ni=function(x,z,ne){this.start=x.start,this.end=x.pos,this.string=x.current(),this.type=z||null,this.state=ne};function Zi(x,z,ne,te){var ie=x.doc,oe=ie.mode,me;z=Dn(ie,z);var we=Ht(ie,z.line),ke=pi(x,z.line,ne),Oe=new zt(we.text,x.options.tabSize,ke),lt;for(te&&(lt=[]);(te||Oe.pos<z.ch)&&!Oe.eol();)Oe.start=Oe.pos,me=ii(oe,Oe,ke.state),te&&lt.push(new Ni(Oe,me,ut(ie.mode,ke.state)));return te?lt:new Ni(Oe,me,ke.state)}function Vr(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 mi(x,z,ne,te,ie,oe,me){var we=ne.flattenSpans;we==null&&(we=x.options.flattenSpans);var ke=0,Oe=null,lt=new zt(z,x.options.tabSize,te),Et,on=x.options.addModeClass&&[null];for(z==""&&Vr(yi(ne,te.state),oe);!lt.eol();){if(lt.pos>x.options.maxHighlightLength?(we=!1,me&&Gi(x,z,te,lt.pos),lt.pos=z.length,Et=null):Et=Vr(ii(ne,lt,te.state,on),oe),on){var Vt=on[0].name;Vt&&(Et="m-"+(Et?Vt+" "+Et:Vt))}if(!we||Oe!=Et){for(;ke<lt.start;)ke=Math.min(lt.start,ke+5e3),ie(ke,Oe);Oe=Et}lt.start=lt.pos}for(;ke<lt.pos;){var Xn=Math.min(lt.pos,ke+5e3);ie(Xn,Oe),ke=Xn}}function Wi(x,z,ne){for(var te,ie,oe=x.doc,me=ne?-1:z-(x.doc.mode.innerMode?1e3:100),we=z;we>me;--we){if(we<=oe.first)return oe.first;var ke=Ht(oe,we-1),Oe=ke.stateAfter;if(Oe&&(!ne||we+(Oe instanceof Yr?Oe.lookAhead:0)<=oe.modeFrontier))return we;var lt=qe(ke.text,null,x.options.tabSize);(ie==null||te>lt)&&(ie=we-1,te=lt)}return ie}function la(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=Ht(x,te).stateAfter;if(ie&&(!(ie instanceof Yr)||te+ie.lookAhead<z)){ne=te+1;break}}x.highlightFrontier=Math.min(x.highlightFrontier,ne)}}var ea=!1,ti=!1;function yt(){ea=!0}function ht(){ti=!0}function Bt(x,z,ne){this.marker=x,this.from=z,this.to=ne}function an(x,z){if(x)for(var ne=0;ne<x.length;++ne){var te=x[ne];if(te.marker==z)return te}}function kn(x,z){for(var ne,te=0;te<x.length;++te)x[te]!=z&&(ne||(ne=[])).push(x[te]);return ne}function ur(x,z){x.markedSpans=x.markedSpans?x.markedSpans.concat([z]):[z],z.marker.attachLine(x)}function Er(x,z,ne){var te;if(x)for(var ie=0;ie<x.length;++ie){var oe=x[ie],me=oe.marker,we=oe.from==null||(me.inclusiveLeft?oe.from<=z:oe.from<z);if(we||oe.from==z&&me.type=="bookmark"&&(!ne||!oe.marker.insertLeft)){var ke=oe.to==null||(me.inclusiveRight?oe.to>=z:oe.to>z);(te||(te=[])).push(new Bt(me,oe.from,ke?null:oe.to))}}return te}function Br(x,z,ne){var te;if(x)for(var ie=0;ie<x.length;++ie){var oe=x[ie],me=oe.marker,we=oe.to==null||(me.inclusiveRight?oe.to>=z:oe.to>z);if(we||oe.from==z&&me.type=="bookmark"&&(!ne||oe.marker.insertLeft)){var ke=oe.from==null||(me.inclusiveLeft?oe.from<=z:oe.from<z);(te||(te=[])).push(new Bt(me,ke?null:oe.from-z,oe.to==null?null:oe.to-z))}}return te}function Hr(x,z){if(z.full)return null;var ne=ar(x,z.from.line)&&Ht(x,z.from.line).markedSpans,te=ar(x,z.to.line)&&Ht(x,z.to.line).markedSpans;if(!ne&&!te)return null;var ie=z.from.ch,oe=z.to.ch,me=vt(z.from,z.to)==0,we=Er(ne,ie,me),ke=Br(te,oe,me),Oe=z.text.length==1,lt=Ft(z.text).length+(Oe?ie:0);if(we)for(var Et=0;Et<we.length;++Et){var on=we[Et];if(on.to==null){var Vt=an(ke,on.marker);Vt?Oe&&(on.to=Vt.to==null?null:Vt.to+lt):on.to=ie}}if(ke)for(var Xn=0;Xn<ke.length;++Xn){var dr=ke[Xn];if(dr.to!=null&&(dr.to+=lt),dr.from==null){var Tr=an(we,dr.marker);Tr||(dr.from=lt,Oe&&(we||(we=[])).push(dr))}else dr.from+=lt,Oe&&(we||(we=[])).push(dr)}we&&(we=Nr(we)),ke&&ke!=we&&(ke=Nr(ke));var Wr=[we];if(!Oe){var ni=z.text.length-2,Kr;if(ni>0&&we)for(var ri=0;ri<we.length;++ri)we[ri].to==null&&(Kr||(Kr=[])).push(new Bt(we[ri].marker,null,null));for(var Fi=0;Fi<ni;++Fi)Wr.push(Kr);Wr.push(ke)}return Wr}function Nr(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 ei(x,z,ne){var te=null;if(x.iter(z.line,ne.line+1,function(Vt){if(Vt.markedSpans)for(var Xn=0;Xn<Vt.markedSpans.length;++Xn){var dr=Vt.markedSpans[Xn].marker;dr.readOnly&&(!te||$t(te,dr)==-1)&&(te||(te=[])).push(dr)}}),!te)return null;for(var ie=[{from:z,to:ne}],oe=0;oe<te.length;++oe)for(var me=te[oe],we=me.find(0),ke=0;ke<ie.length;++ke){var Oe=ie[ke];if(!(vt(Oe.to,we.from)<0||vt(Oe.from,we.to)>0)){var lt=[ke,1],Et=vt(Oe.from,we.from),on=vt(Oe.to,we.to);(Et<0||!me.inclusiveLeft&&!Et)&&lt.push({from:Oe.from,to:we.from}),(on>0||!me.inclusiveRight&&!on)&&lt.push({from:we.to,to:Oe.to}),ie.splice.apply(ie,lt),ke+=lt.length-3}}return ie}function gi(x){var z=x.markedSpans;if(z){for(var ne=0;ne<z.length;++ne)z[ne].marker.detachLine(x);x.markedSpans=null}}function Mr(x,z){if(z){for(var ne=0;ne<z.length;++ne)z[ne].marker.attachLine(x);x.markedSpans=z}}function fi(x){return x.inclusiveLeft?-1:0}function Ai(x){return x.inclusiveRight?1:0}function Si(x,z){var ne=x.lines.length-z.lines.length;if(ne!=0)return ne;var te=x.find(),ie=z.find(),oe=vt(te.from,ie.from)||fi(x)-fi(z);if(oe)return-oe;var me=vt(te.to,ie.to)||Ai(x)-Ai(z);return me||z.id-x.id}function Ce(x,z){var ne=ti&&x.markedSpans,te;if(ne)for(var ie=void 0,oe=0;oe<ne.length;++oe)ie=ne[oe],ie.marker.collapsed&&(z?ie.from:ie.to)==null&&(!te||Si(te,ie.marker)<0)&&(te=ie.marker);return te}function Ne(x){return Ce(x,!0)}function Be(x){return Ce(x,!1)}function He(x,z){var ne=ti&&x.markedSpans,te;if(ne)for(var ie=0;ie<ne.length;++ie){var oe=ne[ie];oe.marker.collapsed&&(oe.from==null||oe.from<z)&&(oe.to==null||oe.to>z)&&(!te||Si(te,oe.marker)<0)&&(te=oe.marker)}return te}function Ge(x,z,ne,te,ie){var oe=Ht(x,z),me=ti&&oe.markedSpans;if(me)for(var we=0;we<me.length;++we){var ke=me[we];if(ke.marker.collapsed){var Oe=ke.marker.find(0),lt=vt(Oe.from,ne)||fi(ke.marker)-fi(ie),Et=vt(Oe.to,te)||Ai(ke.marker)-Ai(ie);if(!(lt>=0&&Et<=0||lt<=0&&Et>=0)&&(lt<=0&&(ke.marker.inclusiveRight&&ie.inclusiveLeft?vt(Oe.to,ne)>=0:vt(Oe.to,ne)>0)||lt>=0&&(ke.marker.inclusiveRight&&ie.inclusiveLeft?vt(Oe.from,te)<=0:vt(Oe.from,te)<0)))return!0}}}function et(x){for(var z;z=Ne(x);)x=z.find(-1,!0).line;return x}function bt(x){for(var z;z=Be(x);)x=z.find(1,!0).line;return x}function Zt(x){for(var z,ne;z=Be(x);)x=z.find(1,!0).line,(ne||(ne=[])).push(x);return ne}function Jt(x,z){var ne=Ht(x,z),te=et(ne);return ne==te?z:qn(te)}function Gn(x,z){if(z>x.lastLine())return z;var ne=Ht(x,z),te;if(!fr(x,ne))return z;for(;te=Be(ne);)ne=te.find(1,!0).line;return qn(ne)+1}function fr(x,z){var ne=ti&&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&&Wn(x,z,te))return!0}}}function Wn(x,z,ne){if(ne.to==null){var te=ne.marker.find(1,!0);return Wn(x,te.line,an(te.line.markedSpans,ne.marker))}if(ne.marker.inclusiveRight&&ne.to==z.text.length)return!0;for(var ie=void 0,oe=0;oe<z.markedSpans.length;++oe)if(ie=z.markedSpans[oe],ie.marker.collapsed&&!ie.marker.widgetNode&&ie.from==ne.to&&(ie.to==null||ie.to!=ne.from)&&(ie.marker.inclusiveLeft||ne.marker.inclusiveRight)&&Wn(x,z,ie))return!0}function pn(x){x=et(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 oe=ne.parent;oe;ne=oe,oe=ne.parent)for(var me=0;me<oe.children.length;++me){var we=oe.children[me];if(we==ne)break;z+=we.height}return z}function dn(x){if(x.height==0)return 0;for(var z=x.text.length,ne,te=x;ne=Ne(te);){var ie=ne.find(0,!0);te=ie.from.line,z+=ie.from.ch-ie.to.ch}for(te=x;ne=Be(te);){var oe=ne.find(0,!0);z-=te.text.length-oe.from.ch,te=oe.to.line,z+=te.text.length-oe.to.ch}return z}function Cn(x){var z=x.display,ne=x.doc;z.maxLine=Ht(ne,ne.first),z.maxLineLength=dn(z.maxLine),z.maxLineChanged=!0,ne.iter(function(te){var ie=dn(te);ie>z.maxLineLength&&(z.maxLineLength=ie,z.maxLine=te)})}var In=function(x,z,ne){this.text=x,Mr(this,z),this.height=ne?ne(this):1};In.prototype.lineNo=function(){return qn(this)},gr(In);function cr(x,z,ne,te){x.text=z,x.stateAfter&&(x.stateAfter=null),x.styles&&(x.styles=null),x.order!=null&&(x.order=null),gi(x),Mr(x,ne);var ie=te?te(x):1;ie!=x.height&&Yn(x,ie)}function jn(x){x.parent=null,gi(x)}var Zn={},Jn={};function Qn(x,z){if(!x||/^\s*$/.test(x))return null;var ne=z.addModeClass?Jn:Zn;return ne[x]||(ne[x]=x.replace(/\S+/g,"cm-$&"))}function hr(x,z){var ne=Mt("span",null,null,Le?"padding-right: .1px":null),te={pre:Mt("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 oe=ie?z.rest[ie-1]:z.line,me=void 0;te.pos=0,te.addToken=$e,Ci(x.display.measure)&&(me=Fr(oe,x.doc.direction))&&(te.addToken=rt(te.addToken,me)),te.map=[];var we=z!=x.display.externalMeasured&&qn(oe);rn(oe,te,Li(x,oe,we)),oe.styleClasses&&(oe.styleClasses.bgClass&&(te.bgClass=jt(oe.styleClasses.bgClass,te.bgClass||"")),oe.styleClasses.textClass&&(te.textClass=jt(oe.styleClasses.textClass,te.textClass||""))),te.map.length==0&&te.map.push(0,0,te.content.appendChild(Ji(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(Le){var ke=te.content.lastChild;(/\bcm-tab\b/.test(ke.className)||ke.querySelector&&ke.querySelector(".cm-tab"))&&(te.content.className="cm-tab-wrap-hack")}return st(x,"renderLine",x,z.line,te.pre),te.pre.className&&(te.textClass=jt(te.pre.className,te.textClass||"")),te}function Pe(x){var z=wt("span","\u2022","cm-invalidchar");return z.title="\\u"+x.charCodeAt(0).toString(16),z.setAttribute("aria-label",z.title),z}function $e(x,z,ne,te,ie,oe,me){if(z){var we=x.splitSpaces?xt(z,x.trailingSpace):z,ke=x.cm.state.specialChars,Oe=!1,lt;if(!ke.test(z))x.col+=z.length,lt=document.createTextNode(we),x.map.push(x.pos,x.pos+z.length,lt),be&&_e<9&&(Oe=!0),x.pos+=z.length;else{lt=document.createDocumentFragment();for(var Et=0;;){ke.lastIndex=Et;var on=ke.exec(z),Vt=on?on.index-Et:z.length-Et;if(Vt){var Xn=document.createTextNode(we.slice(Et,Et+Vt));be&&_e<9?lt.appendChild(wt("span",[Xn])):lt.appendChild(Xn),x.map.push(x.pos,x.pos+Vt,Xn),x.col+=Vt,x.pos+=Vt}if(!on)break;Et+=Vt+1;var dr=void 0;if(on[0]==" "){var Tr=x.cm.options.tabSize,Wr=Tr-x.col%Tr;dr=lt.appendChild(wt("span",nn(Wr),"cm-tab")),dr.setAttribute("role","presentation"),dr.setAttribute("cm-text"," "),x.col+=Wr}else on[0]=="\r"||on[0]==`
`?(dr=lt.appendChild(wt("span",on[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),dr.setAttribute("cm-text",on[0]),x.col+=1):(dr=x.cm.options.specialCharPlaceholder(on[0]),dr.setAttribute("cm-text",on[0]),be&&_e<9?lt.appendChild(wt("span",[dr])):lt.appendChild(dr),x.col+=1);x.map.push(x.pos,x.pos+1,dr),x.pos++}}if(x.trailingSpace=we.charCodeAt(z.length-1)==32,ne||te||ie||Oe||oe||me){var ni=ne||"";te&&(ni+=te),ie&&(ni+=ie);var Kr=wt("span",[lt],ni,oe);if(me)for(var ri in me)me.hasOwnProperty(ri)&&ri!="style"&&ri!="class"&&Kr.setAttribute(ri,me[ri]);return x.content.appendChild(Kr)}x.content.appendChild(lt)}}function xt(x,z){if(x.length>1&&!/ /.test(x))return x;for(var ne=z,te="",ie=0;ie<x.length;ie++){var oe=x.charAt(ie);oe==" "&&ne&&(ie==x.length-1||x.charCodeAt(ie+1)==32)&&(oe="\xA0"),te+=oe,ne=oe==" "}return te}function rt(x,z){return function(ne,te,ie,oe,me,we,ke){ie=ie?ie+" cm-force-border":"cm-force-border";for(var Oe=ne.pos,lt=Oe+te.length;;){for(var Et=void 0,on=0;on<z.length&&(Et=z[on],!(Et.to>Oe&&Et.from<=Oe));on++);if(Et.to>=lt)return x(ne,te,ie,oe,me,we,ke);x(ne,te.slice(0,Et.to-Oe),ie,oe,null,we,ke),oe=null,te=te.slice(Et.to-Oe),Oe=Et.to}}}function It(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 rn(x,z,ne){var te=x.markedSpans,ie=x.text,oe=0;if(!te){for(var me=1;me<ne.length;me+=2)z.addToken(z,ie.slice(oe,oe=ne[me]),Qn(ne[me+1],z.cm.options));return}for(var we=ie.length,ke=0,Oe=1,lt="",Et,on,Vt=0,Xn,dr,Tr,Wr,ni;;){if(Vt==ke){Xn=dr=Tr=on="",ni=null,Wr=null,Vt=1/0;for(var Kr=[],ri=void 0,Fi=0;Fi<te.length;++Fi){var Hi=te[Fi],ba=Hi.marker;if(ba.type=="bookmark"&&Hi.from==ke&&ba.widgetNode)Kr.push(ba);else if(Hi.from<=ke&&(Hi.to==null||Hi.to>ke||ba.collapsed&&Hi.to==ke&&Hi.from==ke)){if(Hi.to!=null&&Hi.to!=ke&&Vt>Hi.to&&(Vt=Hi.to,dr=""),ba.className&&(Xn+=" "+ba.className),ba.css&&(on=(on?on+";":"")+ba.css),ba.startStyle&&Hi.from==ke&&(Tr+=" "+ba.startStyle),ba.endStyle&&Hi.to==Vt&&(ri||(ri=[])).push(ba.endStyle,Hi.to),ba.title&&((ni||(ni={})).title=ba.title),ba.attributes)for(var to in ba.attributes)(ni||(ni={}))[to]=ba.attributes[to];ba.collapsed&&(!Wr||Si(Wr.marker,ba)<0)&&(Wr=Hi)}else Hi.from>ke&&Vt>Hi.from&&(Vt=Hi.from)}if(ri)for(var Wo=0;Wo<ri.length;Wo+=2)ri[Wo+1]==Vt&&(dr+=" "+ri[Wo]);if(!Wr||Wr.from==ke)for(var bo=0;bo<Kr.length;++bo)It(z,0,Kr[bo]);if(Wr&&(Wr.from||0)==ke){if(It(z,(Wr.to==null?we+1:Wr.to)-ke,Wr.marker,Wr.from==null),Wr.to==null)return;Wr.to==ke&&(Wr=!1)}}if(ke>=we)break;for(var us=Math.min(we,Vt);;){if(lt){var ds=ke+lt.length;if(!Wr){var Io=ds>us?lt.slice(0,us-ke):lt;z.addToken(z,Io,Et?Et+Xn:Xn,Tr,ke+Io.length==Vt?dr:"",on,ni)}if(ds>=us){lt=lt.slice(us-ke),ke=us;break}ke=ds,Tr=""}lt=ie.slice(oe,oe=ne[Oe++]),Et=Qn(ne[Oe++],z.cm.options)}}}function fn(x,z,ne){this.line=z,this.rest=Zt(z),this.size=this.rest?qn(Ft(this.rest))-ne+1:1,this.node=this.text=null,this.hidden=fr(x,z)}function On(x,z,ne){for(var te=[],ie,oe=z;oe<ne;oe=ie){var me=new fn(x.doc,Ht(x.doc,oe),oe);ie=oe+me.size,te.push(me)}return te}var wn=null;function Xt(x){wn?wn.ops.push(x):x.ownsGroup=wn={ops:[x],delayedCallbacks:[]}}function Nn(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 Fn(x,z){var ne=x.ownsGroup;if(ne)try{Nn(ne)}finally{wn=null,z(ne)}}var mr=null;function Bn(x,z){var ne=Gr(x,z);if(ne.length){var te=Array.prototype.slice.call(arguments,2),ie;wn?ie=wn.delayedCallbacks:mr?ie=mr:(ie=mr=[],setTimeout(Lr,0));for(var oe=function(we){ie.push(function(){return ne[we].apply(null,te)})},me=0;me<ne.length;++me)oe(me)}}function Lr(){var x=mr;mr=null;for(var z=0;z<x.length;++z)x[z]()}function Zr(x,z,ne,te){for(var ie=0;ie<z.changes.length;ie++){var oe=z.changes[ie];oe=="text"?Or(x,z):oe=="gutter"?ai(x,z,ne,te):oe=="class"?Jr(x,z):oe=="widget"&&Ir(x,z,te)}z.changes=null}function Dr(x){return x.node==x.text&&(x.node=wt("div",null,null,"position: relative"),x.text.parentNode&&x.text.parentNode.replaceChild(x.node,x.text),x.node.appendChild(x.text),be&&_e<8&&(x.node.style.zIndex=2)),x.node}function zr(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=Dr(z);z.background=te.insertBefore(wt("div",null,ne),te.firstChild),x.display.input.setUneditable(z.background)}}function xr(x,z){var ne=x.display.externalMeasured;return ne&&ne.line==z.line?(x.display.externalMeasured=null,z.measure=ne.measure,ne.built):hr(x,z)}function Or(x,z){var ne=z.text.className,te=xr(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,Jr(x,z)):ne&&(z.text.className=ne)}function Jr(x,z){zr(x,z),z.line.wrapClass?Dr(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 ai(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=Dr(z);z.gutterBackground=wt("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 oe=z.line.gutterMarkers;if(x.options.lineNumbers||oe){var me=Dr(z),we=z.gutter=wt("div",null,"CodeMirror-gutter-wrapper","left: "+(x.options.fixedGutter?te.fixedPos:-te.gutterTotalWidth)+"px");if(x.display.input.setUneditable(we),me.insertBefore(we,z.text),z.line.gutterClass&&(we.className+=" "+z.line.gutterClass),x.options.lineNumbers&&(!oe||!oe["CodeMirror-linenumbers"])&&(z.lineNumber=we.appendChild(wt("div",ot(x.options,ne),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+te.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+x.display.lineNumInnerWidth+"px"))),oe)for(var ke=0;ke<x.display.gutterSpecs.length;++ke){var Oe=x.display.gutterSpecs[ke].className,lt=oe.hasOwnProperty(Oe)&&oe[Oe];lt&&we.appendChild(wt("div",[lt],"CodeMirror-gutter-elt","left: "+te.gutterLeft[Oe]+"px; width: "+te.gutterWidth[Oe]+"px"))}}}function Ir(x,z,ne){z.alignable&&(z.alignable=null);for(var te=Me("CodeMirror-linewidget"),ie=z.node.firstChild,oe=void 0;ie;ie=oe)oe=ie.nextSibling,te.test(ie.className)&&z.node.removeChild(ie);Pi(x,z,ne)}function ci(x,z,ne,te){var ie=xr(x,z);return z.text=z.node=ie.pre,ie.bgClass&&(z.bgClass=ie.bgClass),ie.textClass&&(z.textClass=ie.textClass),Jr(x,z),ai(x,z,ne,te),Pi(x,z,te),z.node}function Pi(x,z,ne){if(ta(x,z.line,z,ne,!0),z.rest)for(var te=0;te<z.rest.length;te++)ta(x,z.rest[te],z,ne,!1)}function ta(x,z,ne,te,ie){if(z.widgets)for(var oe=Dr(ne),me=0,we=z.widgets;me<we.length;++me){var ke=we[me],Oe=wt("div",[ke.node],"CodeMirror-linewidget"+(ke.className?" "+ke.className:""));ke.handleMouseEvents||Oe.setAttribute("cm-ignore-events","true"),Vi(ke,Oe,ne,te),x.display.input.setUneditable(Oe),ie&&ke.above?oe.insertBefore(Oe,ne.gutter||ne.text):oe.appendChild(Oe),Bn(ke,"redraw")}}function Vi(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 Bi(x){if(x.height!=null)return x.height;var z=x.doc.cm;if(!z)return 0;if(!Rt(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;"),Ct(z.display.measure,wt("div",[x.node],null,ne))}return x.height=x.node.parentNode.offsetHeight}function Xi(x,z){for(var ne=ui(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 qi(x){return x.lineSpace.offsetTop}function bi(x){return x.mover.offsetHeight-x.lineSpace.offsetHeight}function $i(x){if(x.cachedPaddingH)return x.cachedPaddingH;var z=Ct(x.measure,wt("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 jr(x){return Hn-x.display.nativeBarWidth}function di(x){return x.display.scroller.clientWidth-jr(x)-x.display.barWidth}function Ti(x){return x.display.scroller.clientHeight-jr(x)-x.display.barHeight}function ji(x,z,ne){var te=x.options.lineWrapping,ie=te&&di(x);if(!z.measure.heights||te&&z.measure.width!=ie){var oe=z.measure.heights=[];if(te){z.measure.width=ie;for(var me=z.text.firstChild.getClientRects(),we=0;we<me.length-1;we++){var ke=me[we],Oe=me[we+1];Math.abs(ke.bottom-Oe.bottom)>2&&oe.push((ke.bottom+Oe.top)/2-ne.top)}}oe.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(qn(x.rest[ie])>ne)return{map:x.measure.maps[ie],cache:x.measure.caches[ie],before:!0}}function $a(x,z){z=et(z);var ne=qn(z),te=x.display.externalMeasured=new fn(x.doc,z,ne);te.lineN=ne;var ie=te.built=hr(x,te);return te.text=ie.pre,Ct(x.display.lineMeasure,ie.pre),te}function Aa(x,z,ne,te){return Mi(x,Yi(x,z),ne,te)}function ca(x,z){if(z>=x.display.viewFrom&&z<x.display.viewTo)return x.display.view[na(x,z)];var ne=x.display.externalMeasured;if(ne&&z>=ne.lineN&&z<ne.lineN+ne.size)return ne}function Yi(x,z){var ne=qn(z),te=ca(x,ne);te&&!te.text?te=null:te&&te.changes&&(Zr(x,te,ne,ho(x)),x.curOp.forceUpdate=!0),te||(te=$a(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 Mi(x,z,ne,te,ie){z.before&&(ne=-1);var oe=ne+(te||""),me;return z.cache.hasOwnProperty(oe)?me=z.cache[oe]:(z.rect||(z.rect=z.view.text.getBoundingClientRect()),z.hasHeights||(ji(x,z.view,z.rect),z.hasHeights=!0),me=zi(x,z,ne,te),me.bogus||(z.cache[oe]=me)),{left:me.left,right:me.right,top:ie?me.rtop:me.top,bottom:ie?me.rbottom:me.bottom}}var Oa={left:0,right:0,top:0,bottom:0};function ki(x,z,ne){for(var te,ie,oe,me,we,ke,Oe=0;Oe<x.length;Oe+=3)if(we=x[Oe],ke=x[Oe+1],z<we?(ie=0,oe=1,me="left"):z<ke?(ie=z-we,oe=ie+1):(Oe==x.length-3||z==ke&&x[Oe+3]>z)&&(oe=ke-we,ie=oe-1,z>=ke&&(me="right")),ie!=null){if(te=x[Oe+2],we==ke&&ne==(te.insertLeft?"left":"right")&&(me=ne),ne=="left"&&ie==0)for(;Oe&&x[Oe-2]==x[Oe-3]&&x[Oe-1].insertLeft;)te=x[(Oe-=3)+2],me="left";if(ne=="right"&&ie==ke-we)for(;Oe<x.length-3&&x[Oe+3]==x[Oe+4]&&!x[Oe+5].insertLeft;)te=x[(Oe+=3)+2],me="right";break}return{node:te,start:ie,end:oe,collapse:me,coverStart:we,coverEnd:ke}}function Qr(x,z){var ne=Oa;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 zi(x,z,ne,te){var ie=ki(z.map,ne,te),oe=ie.node,me=ie.start,we=ie.end,ke=ie.collapse,Oe;if(oe.nodeType==3){for(var lt=0;lt<4;lt++){for(;me&&Lt(z.line.text.charAt(ie.coverStart+me));)--me;for(;ie.coverStart+we<ie.coverEnd&&Lt(z.line.text.charAt(ie.coverStart+we));)++we;if(be&&_e<9&&me==0&&we==ie.coverEnd-ie.coverStart?Oe=oe.parentNode.getBoundingClientRect():Oe=Qr(je(oe,me,we).getClientRects(),te),Oe.left||Oe.right||me==0)break;we=me,me=me-1,ke="right"}be&&_e<11&&(Oe=ua(x.display.measure,Oe))}else{me>0&&(ke=te="right");var Et;x.options.lineWrapping&&(Et=oe.getClientRects()).length>1?Oe=Et[te=="right"?Et.length-1:0]:Oe=oe.getBoundingClientRect()}if(be&&_e<9&&!me&&(!Oe||!Oe.left&&!Oe.right)){var on=oe.parentNode.getClientRects()[0];on?Oe={left:on.left,right:on.left+io(x.display),top:on.top,bottom:on.bottom}:Oe=Oa}for(var Vt=Oe.top-z.rect.top,Xn=Oe.bottom-z.rect.top,dr=(Vt+Xn)/2,Tr=z.view.measure.heights,Wr=0;Wr<Tr.length-1&&!(dr<Tr[Wr]);Wr++);var ni=Wr?Tr[Wr-1]:0,Kr=Tr[Wr],ri={left:(ke=="right"?Oe.right:Oe.left)-z.rect.left,right:(ke=="left"?Oe.left:Oe.right)-z.rect.left,top:ni,bottom:Kr};return!Oe.left&&!Oe.right&&(ri.bogus=!0),x.options.singleCursorHeightPerLine||(ri.rtop=Vt,ri.rbottom=Xn),ri}function ua(x,z){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!sr(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 Ui(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 ia(x){x.display.externalMeasure=null,Xe(x.display.lineMeasure);for(var z=0;z<x.display.view.length;z++)Ui(x.display.view[z])}function hi(x){ia(x),x.display.cachedCharWidth=x.display.cachedTextHeight=x.display.cachedPaddingH=null,x.options.lineWrapping||(x.display.maxLineChanged=!0),x.display.lineNumChars=null}function pa(){return pe&&pt?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function xa(){return pe&&pt?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function fa(x){var z=0;if(x.widgets)for(var ne=0;ne<x.widgets.length;++ne)x.widgets[ne].above&&(z+=Bi(x.widgets[ne]));return z}function wa(x,z,ne,te,ie){if(!ie){var oe=fa(z);ne.top+=oe,ne.bottom+=oe}if(te=="line")return ne;te||(te="local");var me=pn(z);if(te=="local"?me+=qi(x.display):me-=x.display.viewOffset,te=="page"||te=="window"){var we=x.display.lineSpace.getBoundingClientRect();me+=we.top+(te=="window"?0:xa());var ke=we.left+(te=="window"?0:pa());ne.left+=ke,ne.right+=ke}return ne.top+=me,ne.bottom+=me,ne}function Ea(x,z,ne){if(ne=="div")return z;var te=z.left,ie=z.top;if(ne=="page")te-=pa(),ie-=xa();else if(ne=="local"||!ne){var oe=x.display.sizer.getBoundingClientRect();te+=oe.left,ie+=oe.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=Ht(x.doc,z.line)),wa(x,te,Aa(x,te,z.ch,ie),ne)}function ha(x,z,ne,te,ie,oe){te=te||Ht(x.doc,z.line),ie||(ie=Yi(x,te));function me(Xn,dr){var Tr=Mi(x,ie,Xn,dr?"right":"left",oe);return dr?Tr.left=Tr.right:Tr.right=Tr.left,wa(x,te,Tr,ne)}var we=Fr(te,x.doc.direction),ke=z.ch,Oe=z.sticky;if(ke>=te.text.length?(ke=te.text.length,Oe="before"):ke<=0&&(ke=0,Oe="after"),!we)return me(Oe=="before"?ke-1:ke,Oe=="before");function lt(Xn,dr,Tr){var Wr=we[dr],ni=Wr.level==1;return me(Tr?Xn-1:Xn,ni!=Tr)}var Et=ln(we,ke,Oe),on=yn,Vt=lt(ke,Et,Oe=="before");return on!=null&&(Vt.other=lt(ke,on,Oe!="before")),Vt}function ka(x,z){var ne=0;z=Dn(x.doc,z),x.options.lineWrapping||(ne=io(x.display)*z.ch);var te=Ht(x.doc,z.line),ie=pn(te)+qi(x.display);return{left:ne,right:ne,top:ie,bottom:ie+te.height}}function Ja(x,z,ne,te,ie){var oe=Qe(x,z,ne);return oe.xRel=ie,te&&(oe.outside=te),oe}function Ga(x,z,ne){var te=x.doc;if(ne+=x.display.viewOffset,ne<0)return Ja(te.first,0,null,-1,-1);var ie=rr(te,ne),oe=te.first+te.size-1;if(ie>oe)return Ja(te.first+te.size-1,Ht(te,oe).text.length,null,1,1);z<0&&(z=0);for(var me=Ht(te,ie);;){var we=_i(x,me,ie,z,ne),ke=He(me,we.ch+(we.xRel>0||we.outside>0?1:0));if(!ke)return we;var Oe=ke.find(1);if(Oe.line==ie)return Oe;me=Ht(te,ie=Oe.line)}}function so(x,z,ne,te){te-=fa(z);var ie=z.text.length,oe=hn(function(me){return Mi(x,ne,me-1).bottom<=te},ie,0);return ie=hn(function(me){return Mi(x,ne,me).top>te},oe,ie),{begin:oe,end:ie}}function Fa(x,z,ne,te){ne||(ne=Yi(x,z));var ie=wa(x,z,Mi(x,ne,te),"line").top;return so(x,z,ne,ie)}function Ca(x,z,ne,te){return x.bottom<=ne?!1:x.top>ne?!0:(te?x.left:x.right)>z}function _i(x,z,ne,te,ie){ie-=pn(z);var oe=Yi(x,z),me=fa(z),we=0,ke=z.text.length,Oe=!0,lt=Fr(z,x.doc.direction);if(lt){var Et=(x.options.lineWrapping?da:Ki)(x,z,ne,oe,lt,te,ie);Oe=Et.level!=1,we=Oe?Et.from:Et.to-1,ke=Oe?Et.to:Et.from-1}var on=null,Vt=null,Xn=hn(function(Fi){var Hi=Mi(x,oe,Fi);return Hi.top+=me,Hi.bottom+=me,Ca(Hi,te,ie,!1)?(Hi.top<=ie&&Hi.left<=te&&(on=Fi,Vt=Hi),!0):!1},we,ke),dr,Tr,Wr=!1;if(Vt){var ni=te-Vt.left<Vt.right-te,Kr=ni==Oe;Xn=on+(Kr?0:1),Tr=Kr?"after":"before",dr=ni?Vt.left:Vt.right}else{!Oe&&(Xn==ke||Xn==we)&&Xn++,Tr=Xn==0?"after":Xn==z.text.length?"before":Mi(x,oe,Xn-(Oe?1:0)).bottom+me<=ie==Oe?"after":"before";var ri=ha(x,Qe(ne,Xn,Tr),"line",z,oe);dr=ri.left,Wr=ie<ri.top?-1:ie>=ri.bottom?1:0}return Xn=tn(z.text,Xn,1),Ja(ne,Xn,Tr,Wr,te-dr)}function Ki(x,z,ne,te,ie,oe,me){var we=hn(function(Et){var on=ie[Et],Vt=on.level!=1;return Ca(ha(x,Qe(ne,Vt?on.to:on.from,Vt?"before":"after"),"line",z,te),oe,me,!0)},0,ie.length-1),ke=ie[we];if(we>0){var Oe=ke.level!=1,lt=ha(x,Qe(ne,Oe?ke.from:ke.to,Oe?"after":"before"),"line",z,te);Ca(lt,oe,me,!0)&&lt.top>me&&(ke=ie[we-1])}return ke}function da(x,z,ne,te,ie,oe,me){var we=so(x,z,te,me),ke=we.begin,Oe=we.end;/\s/.test(z.text.charAt(Oe-1))&&Oe--;for(var lt=null,Et=null,on=0;on<ie.length;on++){var Vt=ie[on];if(!(Vt.from>=Oe||Vt.to<=ke)){var Xn=Vt.level!=1,dr=Mi(x,te,Xn?Math.min(Oe,Vt.to)-1:Math.max(ke,Vt.from)).right,Tr=dr<oe?oe-dr+1e9:dr-oe;(!lt||Et>Tr)&&(lt=Vt,Et=Tr)}}return lt||(lt=ie[ie.length-1]),lt.from<ke&&(lt={from:ke,to:lt.to,level:lt.level}),lt.to>Oe&&(lt={from:lt.from,to:Oe,level:lt.level}),lt}var Sa;function Ka(x){if(x.cachedTextHeight!=null)return x.cachedTextHeight;if(Sa==null){Sa=wt("pre",null,"CodeMirror-line-like");for(var z=0;z<49;++z)Sa.appendChild(document.createTextNode("x")),Sa.appendChild(wt("br"));Sa.appendChild(document.createTextNode("x"))}Ct(x.measure,Sa);var ne=Sa.offsetHeight/50;return ne>3&&(x.cachedTextHeight=ne),Xe(x.measure),ne||1}function io(x){if(x.cachedCharWidth!=null)return x.cachedCharWidth;var z=wt("span","xxxxxxxxxx"),ne=wt("pre",[z],"CodeMirror-line-like");Ct(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,oe=z.gutters.firstChild,me=0;oe;oe=oe.nextSibling,++me){var we=x.display.gutterSpecs[me].className;ne[we]=oe.offsetLeft+oe.clientLeft+ie,te[we]=oe.clientWidth}return{fixedPos:Oo(z),gutterTotalWidth:z.gutters.offsetWidth,gutterLeft:ne,gutterWidth:te,wrapperWidth:z.wrapper.clientWidth}}function Oo(x){return x.scroller.getBoundingClientRect().left-x.sizer.getBoundingClientRect().left}function Ro(x){var z=Ka(x.display),ne=x.options.lineWrapping,te=ne&&Math.max(5,x.display.scroller.clientWidth/io(x.display)-3);return function(ie){if(fr(x.doc,ie))return 0;var oe=0;if(ie.widgets)for(var me=0;me<ie.widgets.length;me++)ie.widgets[me].height&&(oe+=ie.widgets[me].height);return ne?oe+(Math.ceil(ie.text.length/te)||1)*z:oe+z}}function lo(x){var z=x.doc,ne=Ro(x);z.iter(function(te){var ie=ne(te);ie!=te.height&&Yn(te,ie)})}function Ao(x,z,ne,te){var ie=x.display;if(!ne&&ui(z).getAttribute("cm-not-content")=="true")return null;var oe,me,we=ie.lineSpace.getBoundingClientRect();try{oe=z.clientX-we.left,me=z.clientY-we.top}catch(Et){return null}var ke=Ga(x,oe,me),Oe;if(te&&ke.xRel>0&&(Oe=Ht(x.doc,ke.line).text).length==ke.ch){var lt=qe(Oe,Oe.length,x.options.tabSize)-Oe.length;ke=Qe(ke.line,Math.max(0,Math.round((oe-$i(x.display).left)/io(x.display))-lt))}return ke}function na(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 Oi(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)ti&&Jt(x.doc,z)<ie.viewTo&&_a(x);else if(ne<=ie.viewFrom)ti&&Gn(x.doc,ne+te)>ie.viewFrom?_a(x):(ie.viewFrom+=te,ie.viewTo+=te);else if(z<=ie.viewFrom&&ne>=ie.viewTo)_a(x);else if(z<=ie.viewFrom){var oe=co(x,ne,ne+te,1);oe?(ie.view=ie.view.slice(oe.index),ie.viewFrom=oe.lineN,ie.viewTo+=te):_a(x)}else if(ne>=ie.viewTo){var me=co(x,z,z,-1);me?(ie.view=ie.view.slice(0,me.index),ie.viewTo=me.lineN):_a(x)}else{var we=co(x,z,z,-1),ke=co(x,ne,ne+te,1);we&&ke?(ie.view=ie.view.slice(0,we.index).concat(On(x,we.lineN,ke.lineN)).concat(ie.view.slice(ke.index)),ie.viewTo+=te):_a(x)}var Oe=ie.externalMeasured;Oe&&(ne<Oe.lineN?Oe.lineN+=te:z<Oe.lineN+Oe.size&&(ie.externalMeasured=null))}function Ta(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 oe=te.view[na(x,z)];if(oe.node!=null){var me=oe.changes||(oe.changes=[]);$t(me,ne)==-1&&me.push(ne)}}}function _a(x){x.display.viewFrom=x.display.viewTo=x.doc.first,x.display.view=[],x.display.viewOffset=0}function co(x,z,ne,te){var ie=na(x,z),oe,me=x.display.view;if(!ti||ne==x.doc.first+x.doc.size)return{index:ie,lineN:ne};for(var we=x.display.viewFrom,ke=0;ke<ie;ke++)we+=me[ke].size;if(we!=z){if(te>0){if(ie==me.length-1)return null;oe=we+me[ie].size-z,ie++}else oe=we-z;z+=oe,ne+=oe}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 ao(x,z,ne){var te=x.display,ie=te.view;ie.length==0||z>=te.viewTo||ne<=te.viewFrom?(te.view=On(x,z,ne),te.viewFrom=z):(te.viewFrom>z?te.view=On(x,z,te.viewFrom).concat(te.view):te.viewFrom<z&&(te.view=te.view.slice(na(x,z))),te.viewFrom=z,te.viewTo<ne?te.view=te.view.concat(On(x,te.viewTo,ne)):te.viewTo>ne&&(te.view=te.view.slice(0,na(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(),oe=te.selection=document.createDocumentFragment(),me=0;me<ne.sel.ranges.length;me++)if(!(!z&&me==ne.sel.primIndex)){var we=ne.sel.ranges[me];if(!(we.from().line>=x.display.viewTo||we.to().line<x.display.viewFrom)){var ke=we.empty();(ke||x.options.showCursorWhenSelecting)&&aa(x,we.head,ie),ke||xi(x,we,oe)}}return te}function aa(x,z,ne){var te=ha(x,z,"div",null,null,!x.options.singleCursorHeightPerLine),ie=ne.appendChild(wt("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 oe=ne.appendChild(wt("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));oe.style.display="",oe.style.left=te.other.left+"px",oe.style.top=te.other.top+"px",oe.style.height=(te.other.bottom-te.other.top)*.85+"px"}}function Ar(x,z){return x.top-z.top||x.left-z.left}function xi(x,z,ne){var te=x.display,ie=x.doc,oe=document.createDocumentFragment(),me=$i(x.display),we=me.left,ke=Math.max(te.sizerWidth,di(x)-te.sizer.offsetLeft)-me.right,Oe=ie.direction=="ltr";function lt(Kr,ri,Fi,Hi){ri<0&&(ri=0),ri=Math.round(ri),Hi=Math.round(Hi),oe.appendChild(wt("div",null,"CodeMirror-selected","position: absolute; left: "+Kr+`px;
top: `+ri+"px; width: "+(Fi==null?ke-Kr:Fi)+`px;
height: `+(Hi-ri)+"px"))}function Et(Kr,ri,Fi){var Hi=Ht(ie,Kr),ba=Hi.text.length,to,Wo;function bo(Io,fs){return Va(x,Qe(Kr,Io),"div",Hi,fs)}function us(Io,fs,oa){var So=Fa(x,Hi,null,Io),xo=fs=="ltr"==(oa=="after")?"left":"right",Co=oa=="after"?So.begin:So.end-(/\s/.test(Hi.text.charAt(So.end-1))?2:1);return bo(Co,xo)[xo]}var ds=Fr(Hi,ie.direction);return sn(ds,ri||0,Fi==null?ba:Fi,function(Io,fs,oa,So){var xo=oa=="ltr",Co=bo(Io,xo?"left":"right"),ko=bo(fs-1,xo?"right":"left"),Wl=ri==null&&Io==0,ys=Fi==null&&fs==ba,Go=So==0,Wa=!ds||So==ds.length-1;if(ko.top-Co.top<=3){var Bo=(Oe?Wl:ys)&&Go,Eu=(Oe?ys:Wl)&&Wa,sl=Bo?we:(xo?Co:ko).left,xl=Eu?ke:(xo?ko:Co).right;lt(sl,Co.top,xl-sl,Co.bottom)}else{var Vs,Po,Ul,Xo;xo?(Vs=Oe&&Wl&&Go?we:Co.left,Po=Oe?ke:us(Io,oa,"before"),Ul=Oe?we:us(fs,oa,"after"),Xo=Oe&&ys&&Wa?ke:ko.right):(Vs=Oe?us(Io,oa,"before"):we,Po=!Oe&&Wl&&Go?ke:Co.right,Ul=!Oe&&ys&&Wa?we:ko.left,Xo=Oe?us(fs,oa,"after"):ke),lt(Vs,Co.top,Po-Vs,Co.bottom),Co.bottom<ko.top&&lt(we,Co.bottom,null,ko.top),lt(Ul,ko.top,Xo-Ul,ko.bottom)}(!to||Ar(Co,to)<0)&&(to=Co),Ar(ko,to)<0&&(to=ko),(!Wo||Ar(Co,Wo)<0)&&(Wo=Co),Ar(ko,Wo)<0&&(Wo=ko)}),{start:to,end:Wo}}var on=z.from(),Vt=z.to();if(on.line==Vt.line)Et(on.line,on.ch,Vt.ch);else{var Xn=Ht(ie,on.line),dr=Ht(ie,Vt.line),Tr=et(Xn)==et(dr),Wr=Et(on.line,on.ch,Tr?Xn.text.length+1:null).end,ni=Et(Vt.line,Tr?0:null,Vt.ch).start;Tr&&(Wr.top<ni.top-2?(lt(Wr.right,Wr.top,null,Wr.bottom),lt(we,ni.top,ni.left,ni.bottom)):lt(Wr.right,Wr.top,ni.left-Wr.right,Wr.bottom)),Wr.bottom<ni.top&&lt(we,Wr.bottom,null,ni.top)}ne.appendChild(oe)}function wi(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()||Fo(x),z.cursorDiv.style.visibility=(ne=!ne)?"":"hidden"},x.options.cursorBlinkRate):x.options.cursorBlinkRate<0&&(z.cursorDiv.style.visibility="hidden")}}function Di(x){x.state.focused||(x.display.input.focus(),ja(x))}function Ha(x){x.state.delayingBlurEvent=!0,setTimeout(function(){x.state.delayingBlurEvent&&(x.state.delayingBlurEvent=!1,Fo(x))},100)}function ja(x,z){x.state.delayingBlurEvent&&(x.state.delayingBlurEvent=!1),x.options.readOnly!="nocursor"&&(x.state.focused||(st(x,"focus",x,z),x.state.focused=!0,xn(x.display.wrapper,"CodeMirror-focused"),!x.curOp&&x.display.selForContextMenu!=x.doc.sel&&(x.display.input.reset(),Le&&setTimeout(function(){return x.display.input.reset(!0)},20)),x.display.input.receivedFocus()),wi(x))}function Fo(x,z){x.state.delayingBlurEvent||(x.state.focused&&(st(x,"blur",x,z),x.state.focused=!1,Ve(x.display.wrapper,"CodeMirror-focused")),clearInterval(x.display.blinker),setTimeout(function(){x.state.focused||(x.display.shift=!1)},150))}function Uo(x){for(var z=x.display,ne=z.lineDiv.offsetTop,te=0;te<z.view.length;te++){var ie=z.view[te],oe=x.options.lineWrapping,me=void 0,we=0;if(!ie.hidden){if(be&&_e<8){var ke=ie.node.offsetTop+ie.node.offsetHeight;me=ke-ne,ne=ke}else{var Oe=ie.node.getBoundingClientRect();me=Oe.bottom-Oe.top,!oe&&ie.text.firstChild&&(we=ie.text.firstChild.getBoundingClientRect().right-Oe.left-1)}var lt=ie.line.height-me;if((lt>.005||lt<-.005)&&(Yn(ie.line,me),ls(ie.line),ie.rest))for(var Et=0;Et<ie.rest.length;Et++)ls(ie.rest[Et]);if(we>x.display.sizerWidth){var on=Math.ceil(we/io(x.display));on>x.display.maxLineLength&&(x.display.maxLineLength=on,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 va(x,z,ne){var te=ne&&ne.top!=null?Math.max(0,ne.top):x.scroller.scrollTop;te=Math.floor(te-qi(x));var ie=ne&&ne.bottom!=null?ne.bottom:te+x.wrapper.clientHeight,oe=rr(z,te),me=rr(z,ie);if(ne&&ne.ensure){var we=ne.ensure.from.line,ke=ne.ensure.to.line;we<oe?(oe=we,me=rr(z,pn(Ht(z,we))+x.wrapper.clientHeight)):Math.min(ke,z.lastLine())>=me&&(oe=rr(z,pn(Ht(z,ke))-x.wrapper.clientHeight),me=ke)}return{from:oe,to:Math.max(me,oe+1)}}function No(x,z){if(!Wt(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&&!Pt){var oe=wt("div","\u200B",null,`position: absolute;
top: `+(z.top-ne.viewOffset-qi(x.display))+`px;
height: `+(z.bottom-z.top+jr(x)+ne.barHeight)+`px;
left: `+z.left+"px; width: "+Math.max(2,z.right-z.left)+"px;");x.display.lineSpace.appendChild(oe),oe.scrollIntoView(ie),x.display.lineSpace.removeChild(oe)}}}function cs(x,z,ne,te){te==null&&(te=0);var ie;!x.options.lineWrapping&&z==ne&&(z=z.ch?Qe(z.line,z.sticky=="before"?z.ch-1:z.ch,"after"):z,ne=z.sticky=="before"?Qe(z.line,z.ch+1,"before"):z);for(var oe=0;oe<5;oe++){var me=!1,we=ha(x,z),ke=!ne||ne==z?we:ha(x,ne);ie={left:Math.min(we.left,ke.left),top:Math.min(we.top,ke.top)-te,right:Math.max(we.left,ke.left),bottom:Math.max(we.bottom,ke.bottom)+te};var Oe=As(x,ie),lt=x.doc.scrollTop,Et=x.doc.scrollLeft;if(Oe.scrollTop!=null&&(Da(x,Oe.scrollTop),Math.abs(x.doc.scrollTop-lt)>1&&(me=!0)),Oe.scrollLeft!=null&&(go(x,Oe.scrollLeft),Math.abs(x.doc.scrollLeft-Et)>1&&(me=!0)),!me)break}return ie}function ul(x,z){var ne=As(x,z);ne.scrollTop!=null&&Da(x,ne.scrollTop),ne.scrollLeft!=null&&go(x,ne.scrollLeft)}function As(x,z){var ne=x.display,te=Ka(x.display);z.top<0&&(z.top=0);var ie=x.curOp&&x.curOp.scrollTop!=null?x.curOp.scrollTop:ne.scroller.scrollTop,oe=Ti(x),me={};z.bottom-z.top>oe&&(z.bottom=z.top+oe);var we=x.doc.height+bi(ne),ke=z.top<te,Oe=z.bottom>we-te;if(z.top<ie)me.scrollTop=ke?0:z.top;else if(z.bottom>ie+oe){var lt=Math.min(z.top,(Oe?we:z.bottom)-oe);lt!=ie&&(me.scrollTop=lt)}var Et=x.options.fixedGutter?0:ne.gutters.offsetWidth,on=x.curOp&&x.curOp.scrollLeft!=null?x.curOp.scrollLeft:ne.scroller.scrollLeft-Et,Vt=di(x)-ne.gutters.offsetWidth,Xn=z.right-z.left>Vt;return Xn&&(z.right=z.left+Vt),z.left<10?me.scrollLeft=0:z.left<on?me.scrollLeft=Math.max(0,z.left+Et-(Xn?0:10)):z.right>Vt+on-3&&(me.scrollLeft=z.right+(Xn?0:10)-Vt),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=ka(x,z.from),te=ka(x,z.to);oo(x,ne,te,z.margin)}}function oo(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 Da(x,z){Math.abs(x.doc.scrollTop-z)<2||(fe||Yc(x,{top:z}),Xa(x,z,!0),fe&&Yc(x),is(x,100))}function Xa(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,Vu(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+bi(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+jr(x)+z.barHeight,nativeBarWidth:z.nativeBarWidth,gutterWidth:ne}}var Ko=function(x,z,ne){this.cm=ne;var te=this.vert=wt("div",[wt("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),ie=this.horiz=wt("div",[wt("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");te.tabIndex=ie.tabIndex=-1,x(te),x(ie),Rn(te,"scroll",function(){te.clientHeight&&z(te.scrollTop,"vertical")}),Rn(ie,"scroll",function(){ie.clientWidth&&z(ie.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,be&&_e<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 oe=x.viewWidth-x.barLeft-(ne?te:0);this.horiz.firstChild.style.width=Math.max(0,x.scrollWidth-x.clientWidth+oe)+"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=De&&!ze?"12px":"18px";this.horiz.style.height=this.vert.style.width=x,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ae,this.disableVert=new Ae},Ko.prototype.enableZeroWidthBar=function(x,z,ne){x.style.pointerEvents="auto";function te(){var ie=x.getBoundingClientRect(),oe=ne=="vert"?document.elementFromPoint(ie.right-1,(ie.top+ie.bottom)/2):document.elementFromPoint((ie.right+ie.left)/2,ie.bottom-1);oe!=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&&Uo(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 vc(x){x.display.scrollbars&&(x.display.scrollbars.clear(),x.display.scrollbars.addClass&&Ve(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),Rn(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):Da(x,z)},x),x.display.scrollbars.addClass&&xn(x.display.wrapper,x.display.scrollbars.addClass)}var Xc=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:++Xc},Xt(x.curOp)}function Is(x){var z=x.curOp;z&&Fn(z,function(ne){for(var te=0;te<ne.ops.length;te++)ne.ops[te].cm.curOp=null;yc(ne)})}function yc(x){for(var z=x.ops,ne=0;ne<z.length;ne++)Yl(z[ne]);for(var te=0;te<z.length;te++)Ia(z[te]);for(var ie=0;ie<z.length;ie++)ma(z[ie]);for(var oe=0;oe<z.length;oe++)Ho(z[oe]);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&&Cn(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 Ia(x){x.updatedDisplay=x.mustUpdate&&qc(x.cm,x.update)}function ma(x){var z=x.cm,ne=z.display;x.updatedDisplay&&Uo(z),x.barMeasure=yo(z),ne.maxLineChanged&&!z.options.lineWrapping&&(x.adjustWidthTo=Aa(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+jr(z)+z.display.barWidth),x.maxScrollLeft=Math.max(0,ne.sizer.offsetLeft+x.adjustWidthTo-di(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==At();x.preparedSelection&&z.display.input.showSelection(x.preparedSelection,ne),(x.updatedDisplay||x.startHeight!=z.doc.height)&&xs(z,x.barMeasure),x.updatedDisplay&&Qc(z,x.barMeasure),x.selectionChanged&&wi(z),z.state.focused&&x.updateInput&&z.display.input.reset(x.typing),ne&&Di(x.cm)}function es(x){var z=x.cm,ne=z.display,te=z.doc;if(x.updatedDisplay&&Zu(z,x.update),ne.wheelStartX!=null&&(x.scrollTop!=null||x.scrollLeft!=null||x.scrollToPos)&&(ne.wheelStartX=ne.wheelStartY=null),x.scrollTop!=null&&Xa(z,x.scrollTop,x.forceScroll),x.scrollLeft!=null&&go(z,x.scrollLeft,!0,!0),x.scrollToPos){var ie=cs(z,Dn(te,x.scrollToPos.from),Dn(te,x.scrollToPos.to),x.scrollToPos.margin);No(z,ie)}var oe=x.maybeHiddenMarkers,me=x.maybeUnhiddenMarkers;if(oe)for(var we=0;we<oe.length;++we)oe[we].lines.length||st(oe[we],"hide");if(me)for(var ke=0;ke<me.length;++ke)me[ke].lines.length&&st(me[ke],"unhide");ne.wrapper.offsetHeight&&(te.scrollTop=z.display.scroller.scrollTop),x.changeObjs&&st(z,"changes",z,x.changeObjs),x.update&&x.update.finish()}function ga(x,z){if(x.curOp)return z();Ks(x);try{return z()}finally{Is(x)}}function za(x,z){return function(){if(x.curOp)return z.apply(x,arguments);Ks(x);try{return z.apply(x,arguments)}finally{Is(x)}}}function Ra(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,er(Hs,x))}function Hs(x){var z=x.doc;if(!(z.highlightFrontier>=x.display.viewTo)){var ne=+new Date+x.options.workTime,te=pi(x,z.highlightFrontier),ie=[];z.iter(te.line,Math.min(z.first+z.size,x.display.viewTo+500),function(oe){if(te.line>=x.display.viewFrom){var me=oe.styles,we=oe.text.length>x.options.maxHighlightLength?ut(z.mode,te.state):null,ke=Ri(x,oe,te,!0);we&&(te.state=we),oe.styles=ke.styles;var Oe=oe.styleClasses,lt=ke.classes;lt?oe.styleClasses=lt:Oe&&(oe.styleClasses=null);for(var Et=!me||me.length!=oe.styles.length||Oe!=lt&&(!Oe||!lt||Oe.bgClass!=lt.bgClass||Oe.textClass!=lt.textClass),on=0;!Et&&on<me.length;++on)Et=me[on]!=oe.styles[on];Et&&ie.push(te.line),oe.stateAfter=te.save(),te.nextLine()}else oe.text.length<=x.options.maxHighlightLength&&Gi(x,oe.text,te),oe.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&&ga(x,function(){for(var oe=0;oe<ie.length;oe++)Ta(x,ie[oe],"text")})}}var gs=function(x,z,ne){var te=x.display;this.viewport=z,this.visible=va(te,x.doc,z),this.editorIsHidden=!te.wrapper.offsetWidth,this.wrapperHeight=te.wrapper.clientHeight,this.wrapperWidth=te.wrapper.clientWidth,this.oldDisplayWidth=di(x),this.force=ne,this.dims=ho(x),this.events=[]};gs.prototype.signal=function(x,z){ir(x,z)&&this.events.push(arguments)},gs.prototype.finish=function(){for(var x=0;x<this.events.length;x++)st.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=jr(x)+"px",z.sizer.style.marginBottom=-z.nativeBarWidth+"px",z.sizer.style.borderRightWidth=jr(x)+"px",z.scrollbarsClipped=!0)}function Zd(x){if(x.hasFocus())return null;var z=At();if(!z||!Rt(x.display.lineDiv,z))return null;var ne={activeElt:z};if(window.getSelection){var te=window.getSelection();te.anchorNode&&te.extend&&Rt(x.display.lineDiv,te.anchorNode)&&(ne.anchorNode=te.anchorNode,ne.anchorOffset=te.anchorOffset,ne.focusNode=te.focusNode,ne.focusOffset=te.focusOffset)}return ne}function Vd(x){if(!(!x||!x.activeElt||x.activeElt==At())&&(x.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(x.activeElt.nodeName)&&x.anchorNode&&Rt(document.body,x.anchorNode)&&Rt(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 qc(x,z){var ne=x.display,te=x.doc;if(z.editorIsHidden)return _a(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;bc(x)&&(_a(x),z.dims=ho(x));var ie=te.first+te.size,oe=Math.max(z.visible.from-x.options.viewportMargin,te.first),me=Math.min(ie,z.visible.to+x.options.viewportMargin);ne.viewFrom<oe&&oe-ne.viewFrom<20&&(oe=Math.max(te.first,ne.viewFrom)),ne.viewTo>me&&ne.viewTo-me<20&&(me=Math.min(ie,ne.viewTo)),ti&&(oe=Jt(x.doc,oe),me=Gn(x.doc,me));var we=oe!=ne.viewFrom||me!=ne.viewTo||ne.lastWrapHeight!=z.wrapperHeight||ne.lastWrapWidth!=z.wrapperWidth;ao(x,oe,me),ne.viewOffset=pn(Ht(x.doc,ne.viewFrom)),x.display.mover.style.top=ne.viewOffset+"px";var ke=hs(x);if(!we&&ke==0&&!z.force&&ne.renderedView==ne.view&&(ne.updateLineNumbers==null||ne.updateLineNumbers>=ne.viewTo))return!1;var Oe=Zd(x);return ke>4&&(ne.lineDiv.style.display="none"),jd(x,ne.updateLineNumbers,z.dims),ke>4&&(ne.lineDiv.style.display=""),ne.renderedView=ne.view,Vd(Oe),Xe(ne.cursorDiv),Xe(ne.selectionDiv),ne.gutters.style.height=ne.sizer.style.minHeight=0,we&&(ne.lastWrapHeight=z.wrapperHeight,ne.lastWrapWidth=z.wrapperWidth,is(x,400)),ne.updateLineNumbers=null,!0}function Zu(x,z){for(var ne=z.viewport,te=!0;;te=!1){if(!te||!x.options.lineWrapping||z.oldDisplayWidth==di(x)){if(ne&&ne.top!=null&&(ne={top:Math.min(x.doc.height+bi(x.display)-Ti(x),ne.top)}),z.visible=va(x.display,x.doc,ne),z.visible.from>=x.display.viewFrom&&z.visible.to<=x.display.viewTo)break}else te&&(z.visible=va(x.display,x.doc,ne));if(!qc(x,z))break;Uo(x);var ie=yo(x);Qo(x),xs(x,ie),Qc(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 Yc(x,z){var ne=new gs(x,z);if(qc(x,ne)){Uo(x),Zu(x,ne);var te=yo(x);Qo(x),xs(x,te),Qc(x,te),ne.finish()}}function jd(x,z,ne){var te=x.display,ie=x.options.lineNumbers,oe=te.lineDiv,me=oe.firstChild;function we(Xn){var dr=Xn.nextSibling;return Le&&De&&x.display.currentWheelTarget==Xn?Xn.style.display="none":Xn.parentNode.removeChild(Xn),dr}for(var ke=te.view,Oe=te.viewFrom,lt=0;lt<ke.length;lt++){var Et=ke[lt];if(!Et.hidden)if(!Et.node||Et.node.parentNode!=oe){var on=ci(x,Et,Oe,ne);oe.insertBefore(on,me)}else{for(;me!=Et.node;)me=we(me);var Vt=ie&&z!=null&&z<=Oe&&Et.lineNumber;Et.changes&&($t(Et.changes,"gutter")>-1&&(Vt=!1),Zr(x,Et,Oe,ne)),Vt&&(Xe(Et.lineNumber),Et.lineNumber.appendChild(document.createTextNode(ot(x.options,Oe)))),me=Et.node.nextSibling}Oe+=Et.size}for(;me;)me=we(me)}function Jc(x){var z=x.gutters.offsetWidth;x.sizer.style.marginLeft=z+"px"}function Qc(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+jr(x)+"px"}function Vu(x){var z=x.display,ne=z.view;if(!(!z.alignWidgets&&(!z.gutters.firstChild||!x.options.fixedGutter))){for(var te=Oo(z)-z.scroller.scrollLeft+x.doc.scrollLeft,ie=z.gutters.offsetWidth,oe=te+"px",me=0;me<ne.length;me++)if(!ne[me].hidden){x.options.fixedGutter&&(ne[me].gutter&&(ne[me].gutter.style.left=oe),ne[me].gutterBackground&&(ne[me].gutterBackground.style.left=oe));var we=ne[me].alignable;if(we)for(var ke=0;ke<we.length;ke++)we[ke].style.left=oe}x.options.fixedGutter&&(z.gutters.style.left=te+ie+"px")}}function bc(x){if(!x.options.lineNumbers)return!1;var z=x.doc,ne=ot(x.options,z.first+z.size-1),te=x.display;if(ne.length!=te.lineNumChars){var ie=te.measure.appendChild(wt("div",[wt("div",ne)],"CodeMirror-linenumber CodeMirror-gutter-elt")),oe=ie.firstChild.offsetWidth,me=ie.offsetWidth-oe;return te.lineGutter.style.width="",te.lineNumInnerWidth=Math.max(oe,te.lineGutter.offsetWidth-me)+1,te.lineNumWidth=te.lineNumInnerWidth+me,te.lineNumChars=te.lineNumInnerWidth?ne.length:-1,te.lineGutter.style.width=te.lineNumWidth+"px",Jc(x.display),!0}return!1}function eu(x,z){for(var ne=[],te=!1,ie=0;ie<x.length;ie++){var oe=x[ie],me=null;if(typeof oe!="string"&&(me=oe.style,oe=oe.className),oe=="CodeMirror-linenumbers")if(z)te=!0;else continue;ne.push({className:oe,style:me})}return z&&!te&&ne.push({className:"CodeMirror-linenumbers",style:null}),ne}function ju(x){var z=x.gutters,ne=x.gutterSpecs;Xe(z),x.lineGutter=null;for(var te=0;te<ne.length;++te){var ie=ne[te],oe=ie.className,me=ie.style,we=z.appendChild(wt("div",null,"CodeMirror-gutter "+oe));me&&(we.style.cssText=me),oe=="CodeMirror-linenumbers"&&(x.lineGutter=we,we.style.width=(x.lineNumWidth||1)+"px")}z.style.display=ne.length?"":"none",Jc(x)}function Ql(x){ju(x.display),Oi(x),Vu(x)}function Gd(x,z,ne,te){var ie=this;this.input=ne,ie.scrollbarFiller=wt("div",null,"CodeMirror-scrollbar-filler"),ie.scrollbarFiller.setAttribute("cm-not-content","true"),ie.gutterFiller=wt("div",null,"CodeMirror-gutter-filler"),ie.gutterFiller.setAttribute("cm-not-content","true"),ie.lineDiv=Mt("div",null,"CodeMirror-code"),ie.selectionDiv=wt("div",null,null,"position: relative; z-index: 1"),ie.cursorDiv=wt("div",null,"CodeMirror-cursors"),ie.measure=wt("div",null,"CodeMirror-measure"),ie.lineMeasure=wt("div",null,"CodeMirror-measure"),ie.lineSpace=Mt("div",[ie.measure,ie.lineMeasure,ie.selectionDiv,ie.cursorDiv,ie.lineDiv],null,"position: relative; outline: none");var oe=Mt("div",[ie.lineSpace],"CodeMirror-lines");ie.mover=wt("div",[oe],null,"position: relative"),ie.sizer=wt("div",[ie.mover],"CodeMirror-sizer"),ie.sizerWidth=null,ie.heightForcer=wt("div",null,null,"position: absolute; height: "+Hn+"px; width: 1px;"),ie.gutters=wt("div",null,"CodeMirror-gutters"),ie.lineGutter=null,ie.scroller=wt("div",[ie.sizer,ie.heightForcer,ie.gutters],"CodeMirror-scroll"),ie.scroller.setAttribute("tabIndex","-1"),ie.wrapper=wt("div",[ie.scrollbarFiller,ie.gutterFiller,ie.scroller],"CodeMirror"),be&&_e<8&&(ie.gutters.style.zIndex=-1,ie.scroller.style.paddingRight=0),!Le&&!(fe&&Je)&&(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=eu(te.gutters,te.lineNumbers),ju(ie),ne.init(ie)}var xc=0,Zo=null;be?Zo=-.53:fe?Zo=15:pe?Zo=-.7:gt&&(Zo=-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 Gu(x){var z=Pl(x);return z.x*=Zo,z.y*=Zo,z}function Xu(x,z){var ne=Pl(z),te=ne.x,ie=ne.y,oe=x.display,me=oe.scroller,we=me.scrollWidth>me.clientWidth,ke=me.scrollHeight>me.clientHeight;if(te&&we||ie&&ke){if(ie&&De&&Le){e:for(var Oe=z.target,lt=oe.view;Oe!=me;Oe=Oe.parentNode)for(var Et=0;Et<lt.length;Et++)if(lt[Et].node==Oe){x.display.currentWheelTarget=Oe;break e}}if(te&&!fe&&!Te&&Zo!=null){ie&&ke&&Da(x,Math.max(0,me.scrollTop+ie*Zo)),go(x,Math.max(0,me.scrollLeft+te*Zo)),(!ie||ie&&ke)&&Pr(z),oe.wheelStartX=null;return}if(ie&&Zo!=null){var on=ie*Zo,Vt=x.doc.scrollTop,Xn=Vt+oe.wrapper.clientHeight;on<0?Vt=Math.max(0,Vt+on-50):Xn=Math.min(x.doc.height,Xn+on+50),Yc(x,{top:Vt,bottom:Xn})}xc<20&&(oe.wheelStartX==null?(oe.wheelStartX=me.scrollLeft,oe.wheelStartY=me.scrollTop,oe.wheelDX=te,oe.wheelDY=ie,setTimeout(function(){if(oe.wheelStartX!=null){var dr=me.scrollLeft-oe.wheelStartX,Tr=me.scrollTop-oe.wheelStartY,Wr=Tr&&oe.wheelDY&&Tr/oe.wheelDY||dr&&oe.wheelDX&&dr/oe.wheelDX;oe.wheelStartX=oe.wheelStartY=null,Wr&&(Zo=(Zo*xc+Wr)/(xc+1),++xc)}},200)):(oe.wheelDX+=te,oe.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(!Qt(ne.anchor,te.anchor)||!Qt(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 Za(Tn(this.ranges[z].anchor),Tn(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(vt(z,te.from())>=0&&vt(x,te.to())<=0)return ne}return-1};var Za=function(x,z){this.anchor=x,this.head=z};Za.prototype.from=function(){return cn(this.anchor,this.head)},Za.prototype.to=function(){return en(this.anchor,this.head)},Za.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(on,Vt){return vt(on.from(),Vt.from())}),ne=$t(z,ie);for(var oe=1;oe<z.length;oe++){var me=z[oe],we=z[oe-1],ke=vt(we.to(),me.from());if(te&&!me.empty()?ke>0:ke>=0){var Oe=cn(we.from(),me.from()),lt=en(we.to(),me.to()),Et=we.empty()?me.from()==me.head:we.from()==we.head;oe<=ne&&--ne,z.splice(--oe,2,new Za(Et?lt:Oe,Et?Oe:lt))}}return new vs(z,ne)}function Ps(x,z){return new vs([new Za(x,z||x)],0)}function Js(x){return x.text?Qe(x.from.line+x.text.length-1,Ft(x.text).length+(x.text.length==1?x.from.ch:0)):x.to}function qu(x,z){if(vt(x,z.from)<0)return x;if(vt(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),Qe(ne,te)}function tu(x,z){for(var ne=[],te=0;te<x.sel.ranges.length;te++){var ie=x.sel.ranges[te];ne.push(new Za(qu(ie.anchor,z),qu(ie.head,z)))}return Es(x.cm,ne,x.sel.primIndex)}function Ol(x,z,ne){return x.line==z.line?Qe(ne.line,x.ch-z.ch+ne.ch):Qe(ne.line+(x.line-z.line),x.ch)}function nu(x,z,ne){for(var te=[],ie=Qe(x.first,0),oe=ie,me=0;me<z.length;me++){var we=z[me],ke=Ol(we.from,ie,oe),Oe=Ol(Js(we),ie,oe);if(ie=we.to,oe=Oe,ne=="around"){var lt=x.sel.ranges[me],Et=vt(lt.head,lt.anchor)<0;te[me]=new Za(Et?Oe:ke,Et?ke:Oe)}else te[me]=new Za(ke,ke)}return new vs(te,x.sel.primIndex)}function ru(x){x.doc.mode=_t(x.options,x.doc.modeOption),Rl(x)}function Rl(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&&Oi(x)}function Yu(x,z){return z.from.ch==0&&z.to.ch==0&&Ft(z.text)==""&&(!x.cm||x.cm.options.wholeLineUpdateBefore)}function iu(x,z,ne,te){function ie(ni){return ne?ne[ni]:null}function oe(ni,Kr,ri){cr(ni,Kr,ri,te),Bn(ni,"change",ni,z)}function me(ni,Kr){for(var ri=[],Fi=ni;Fi<Kr;++Fi)ri.push(new In(Oe[Fi],ie(Fi),te));return ri}var we=z.from,ke=z.to,Oe=z.text,lt=Ht(x,we.line),Et=Ht(x,ke.line),on=Ft(Oe),Vt=ie(Oe.length-1),Xn=ke.line-we.line;if(z.full)x.insert(0,me(0,Oe.length)),x.remove(Oe.length,x.size-Oe.length);else if(Yu(x,z)){var dr=me(0,Oe.length-1);oe(Et,Et.text,Vt),Xn&&x.remove(we.line,Xn),dr.length&&x.insert(we.line,dr)}else if(lt==Et)if(Oe.length==1)oe(lt,lt.text.slice(0,we.ch)+on+lt.text.slice(ke.ch),Vt);else{var Tr=me(1,Oe.length-1);Tr.push(new In(on+lt.text.slice(ke.ch),Vt,te)),oe(lt,lt.text.slice(0,we.ch)+Oe[0],ie(0)),x.insert(we.line+1,Tr)}else if(Oe.length==1)oe(lt,lt.text.slice(0,we.ch)+Oe[0]+Et.text.slice(ke.ch),ie(0)),x.remove(we.line+1,Xn);else{oe(lt,lt.text.slice(0,we.ch)+Oe[0],ie(0)),oe(Et,on+Et.text.slice(ke.ch),Vt);var Wr=me(1,Oe.length-1);Xn>1&&x.remove(we.line+1,Xn-1),x.insert(we.line+1,Wr)}Bn(x,"change",x,z)}function Qs(x,z,ne){function te(ie,oe,me){if(ie.linked)for(var we=0;we<ie.linked.length;++we){var ke=ie.linked[we];if(ke.doc!=oe){var Oe=me&&ke.sharedHist;ne&&!Oe||(z(ke.doc,Oe),te(ke.doc,ie,Oe))}}}te(x,null,!0)}function wc(x,z){if(z.cm)throw new Error("This document is already in use.");x.doc=z,z.cm=x,lo(x),ru(x),Sc(x),x.options.lineWrapping||Cn(x),x.options.mode=z.modeOption,Oi(x)}function Sc(x){(x.doc.direction=="rtl"?xn:Ve)(x.display.lineDiv,"CodeMirror-rtl")}function au(x){ga(x,function(){Sc(x),Oi(x)})}function Cc(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 ou(x,z){var ne={from:Tn(z.from),to:Js(z),text:$n(x,z.from,z.to)};return uu(x,ne,z.from.line,z.to.line+1),Qs(x,function(te){return uu(te,ne,z.from.line,z.to.line+1)},!0),ne}function Ju(x){for(;x.length;){var z=Ft(x);if(z.ranges)x.pop();else break}}function su(x,z){if(z)return Ju(x.done),Ft(x.done);if(x.done.length&&!Ft(x.done).ranges)return Ft(x.done);if(x.done.length>1&&!x.done[x.done.length-2].ranges)return x.done.pop(),Ft(x.done)}function Mc(x,z,ne,te){var ie=x.history;ie.undone.length=0;var oe=+new Date,me,we;if((ie.lastOp==te||ie.lastOrigin==z.origin&&z.origin&&(z.origin.charAt(0)=="+"&&ie.lastModTime>oe-(x.cm?x.cm.options.historyEventDelay:500)||z.origin.charAt(0)=="*"))&&(me=su(ie,ie.lastOp==te)))we=Ft(me.changes),vt(z.from,z.to)==0&&vt(z.from,we.to)==0?we.to=Js(z):me.changes.push(ou(x,z));else{var ke=Ft(ie.done);for((!ke||!ke.ranges)&&Ec(x.sel,ie.done),me={changes:[ou(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=oe,ie.lastOp=ie.lastSelOp=te,ie.lastOrigin=ie.lastSelOrigin=z.origin,we||st(x,"historyAdded")}function lu(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 cu(x,z,ne,te){var ie=x.history,oe=te&&te.origin;ne==ie.lastSelOp||oe&&ie.lastSelOrigin==oe&&(ie.lastModTime==ie.lastSelTime&&ie.lastOrigin==oe||lu(x,oe,Ft(ie.done),z))?ie.done[ie.done.length-1]=z:Ec(z,ie.done),ie.lastSelTime=+new Date,ie.lastSelOrigin=oe,ie.lastSelOp=ne,te&&te.clearRedo!==!1&&Ju(ie.undone)}function Ec(x,z){var ne=Ft(z);ne&&ne.ranges&&ne.equals(x)||z.push(x)}function uu(x,z,ne,te){var ie=z["spans_"+x.id],oe=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]={}))[oe]=me.markedSpans),++oe})}function du(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(du(ne[ie]));return te}function Qu(x,z){var ne=Xd(x,z),te=Hr(x,z);if(!ne)return te;if(!te)return ne;for(var ie=0;ie<ne.length;++ie){var oe=ne[ie],me=te[ie];if(oe&&me)e:for(var we=0;we<me.length;++we){for(var ke=me[we],Oe=0;Oe<oe.length;++Oe)if(oe[Oe].marker==ke.marker)continue e;oe.push(ke)}else me&&(ne[ie]=me)}return ne}function Nl(x,z,ne){for(var te=[],ie=0;ie<x.length;++ie){var oe=x[ie];if(oe.ranges){te.push(ne?vs.prototype.deepCopy.call(oe):oe);continue}var me=oe.changes,we=[];te.push({changes:we});for(var ke=0;ke<me.length;++ke){var Oe=me[ke],lt=void 0;if(we.push({from:Oe.from,to:Oe.to,text:Oe.text}),z)for(var Et in Oe)(lt=Et.match(/^spans_(\d+)$/))&&$t(z,Number(lt[1]))>-1&&(Ft(we)[Et]=Oe[Et],delete Oe[Et])}}return te}function fu(x,z,ne,te){if(te){var ie=x.anchor;if(ne){var oe=vt(z,ie)<0;oe!=vt(ne,ie)<0?(ie=z,z=ne):oe!=vt(z,ne)<0&&(z=ne)}return new Za(ie,z)}else return new Za(ne||z,z)}function Bl(x,z,ne,te,ie){ie==null&&(ie=x.cm&&(x.cm.display.shift||x.extend)),To(x,new vs([fu(x.sel.primary(),z,ne,ie)],0),te)}function oi(x,z,ne){for(var te=[],ie=x.cm&&(x.cm.display.shift||x.extend),oe=0;oe<x.sel.ranges.length;oe++)te[oe]=fu(x.sel.ranges[oe],z[oe],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 oe=0;oe<ie.length;oe++)this.ranges[oe]=new Za(Dn(x,ie[oe].anchor),Dn(x,ie[oe].head))},origin:ne&&ne.origin};return st(x,"beforeSelectionChange",x,te),x.cm&&st(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=Ft(te);ie&&ie.ranges?(te[te.length-1]=z,kc(x,z,ne)):To(x,z,ne)}function To(x,z,ne){kc(x,z,ne),cu(x,x.sel,x.cm?x.cm.curOp.id:NaN,ne)}function kc(x,z,ne){(ir(x,"beforeSelectionChange")||x.cm&&ir(x.cm,"beforeSelectionChange"))&&(z=qd(x,z,ne));var te=ne&&ne.bias||(vt(z.primary().head,x.sel.primary().head)<0?-1:1);Yd(x,$l(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,Vn(x.cm)),Bn(x,"cursorActivity",x))}function Jd(x){Yd(x,$l(x,x.sel,null,!1))}function $l(x,z,ne,te){for(var ie,oe=0;oe<z.ranges.length;oe++){var me=z.ranges[oe],we=z.ranges.length==x.sel.ranges.length&&x.sel.ranges[oe],ke=hu(x,me.anchor,we&&we.anchor,ne,te),Oe=hu(x,me.head,we&&we.head,ne,te);(ie||ke!=me.anchor||Oe!=me.head)&&(ie||(ie=z.ranges.slice(0,oe)),ie[oe]=new Za(ke,Oe))}return ie?Es(x.cm,ie,z.primIndex):z}function os(x,z,ne,te,ie){var oe=Ht(x,z.line);if(oe.markedSpans)for(var me=0;me<oe.markedSpans.length;++me){var we=oe.markedSpans[me],ke=we.marker,Oe="selectLeft"in ke?!ke.selectLeft:ke.inclusiveLeft,lt="selectRight"in ke?!ke.selectRight:ke.inclusiveRight;if((we.from==null||(Oe?we.from<=z.ch:we.from<z.ch))&&(we.to==null||(lt?we.to>=z.ch:we.to>z.ch))){if(ie&&(st(ke,"beforeCursorEnter"),ke.explicitlyCleared))if(oe.markedSpans){--me;continue}else break;if(!ke.atomic)continue;if(ne){var Et=ke.find(te<0?1:-1),on=void 0;if((te<0?lt:Oe)&&(Et=el(x,Et,-te,Et&&Et.line==z.line?oe:null)),Et&&Et.line==z.line&&(on=vt(Et,ne))&&(te<0?on<0:on>0))return os(x,Et,z,te,ie)}var Vt=ke.find(te<0?-1:1);return(te<0?Oe:lt)&&(Vt=el(x,Vt,te,Vt.line==z.line?oe:null)),Vt?os(x,Vt,z,te,ie):null}}return z}function hu(x,z,ne,te,ie){var oe=te||1,me=os(x,z,ne,oe,ie)||!ie&&os(x,z,ne,oe,!0)||os(x,z,ne,-oe,ie)||!ie&&os(x,z,ne,-oe,!0);return me||(x.cantEdit=!0,Qe(x.first,0))}function el(x,z,ne,te){return ne<0&&z.ch==0?z.line>x.first?Dn(x,Qe(z.line-1)):null:ne>0&&z.ch==(te||Ht(x,z.line)).text.length?z.line<x.first+x.size-1?Qe(z.line+1,0):null:new Qe(z.line,z.ch+ne)}function td(x){x.setSelection(Qe(x.firstLine(),0),Qe(x.lastLine()),at)}function pu(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,oe,me,we){ie&&(te.from=Dn(x,ie)),oe&&(te.to=Dn(x,oe)),me&&(te.text=me),we!==void 0&&(te.origin=we)}),st(x,"beforeChange",x,te),x.cm&&st(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 za(x.cm,dl)(x,z,ne);if(x.cm.state.suppressEdits)return}if(!((ir(x,"beforeChange")||x.cm&&ir(x.cm,"beforeChange"))&&(z=pu(x,z,!0),!z))){var te=ea&&!ne&&ei(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]==""&&vt(z.from,z.to)==0)){var ne=tu(x,z);Mc(x,z,ne,x.cm?x.cm.curOp.id:NaN),Fl(x,z,ne,Hr(x,z));var te=[];Qs(x,function(ie,oe){!oe&&$t(te,ie.history)==-1&&(_c(ie.history,z),te.push(ie.history)),Fl(ie,z,null,Hr(ie,z))})}}function tl(x,z,ne){var te=x.cm&&x.cm.state.suppressEdits;if(!(te&&!ne)){for(var ie=x.history,oe,me=x.sel,we=z=="undo"?ie.done:ie.undone,ke=z=="undo"?ie.undone:ie.done,Oe=0;Oe<we.length&&(oe=we[Oe],!(ne?oe.ranges&&!oe.equals(x.sel):!oe.ranges));Oe++);if(Oe!=we.length){for(ie.lastOrigin=ie.lastSelOrigin=null;;)if(oe=we.pop(),oe.ranges){if(Ec(oe,ke),ne&&!oe.equals(x.sel)){To(x,oe,{clearRedo:!1});return}me=oe}else if(te){we.push(oe);return}else break;var lt=[];Ec(me,ke),ke.push({changes:lt,generation:ie.generation}),ie.generation=oe.generation||++ie.maxGeneration;for(var Et=ir(x,"beforeChange")||x.cm&&ir(x.cm,"beforeChange"),on=function(dr){var Tr=oe.changes[dr];if(Tr.origin=z,Et&&!pu(x,Tr,!1))return we.length=0,{};lt.push(ou(x,Tr));var Wr=dr?tu(x,Tr):Ft(we);Fl(x,Tr,Wr,Qu(x,Tr)),!dr&&x.cm&&x.cm.scrollIntoView({from:Tr.from,to:Js(Tr)});var ni=[];Qs(x,function(Kr,ri){!ri&&$t(ni,Kr.history)==-1&&(_c(Kr.history,Tr),ni.push(Kr.history)),Fl(Kr,Tr,null,Qu(Kr,Tr))})},Vt=oe.changes.length-1;Vt>=0;--Vt){var Xn=on(Vt);if(Xn)return Xn.v}}}}function mu(x,z){if(z!=0&&(x.first+=z,x.sel=new vs(Pn(x.sel.ranges,function(ie){return new Za(Qe(ie.anchor.line+z,ie.anchor.ch),Qe(ie.head.line+z,ie.head.ch))}),x.sel.primIndex),x.cm)){Oi(x.cm,x.first,x.first-z,z);for(var ne=x.cm.display,te=ne.viewFrom;te<ne.viewTo;te++)Ta(x.cm,te,"gutter")}}function Fl(x,z,ne,te){if(x.cm&&!x.cm.curOp)return za(x.cm,Fl)(x,z,ne,te);if(z.to.line<x.first){mu(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);mu(x,ie),z={from:Qe(x.first,0),to:Qe(z.to.line+ie,z.to.ch),text:[Ft(z.text)],origin:z.origin}}var oe=x.lastLine();z.to.line>oe&&(z={from:z.from,to:Qe(oe,Ht(x,oe).text.length),text:[z.text[0]],origin:z.origin}),z.removed=$n(x,z.from,z.to),ne||(ne=tu(x,z)),x.cm?Qd(x.cm,z,te):iu(x,z,te),kc(x,ne,at),x.cantEdit&&hu(x,Qe(x.firstLine(),0))&&(x.cantEdit=!1)}}function Qd(x,z,ne){var te=x.doc,ie=x.display,oe=z.from,me=z.to,we=!1,ke=oe.line;x.options.lineWrapping||(ke=qn(et(Ht(te,oe.line))),te.iter(ke,me.line+1,function(Vt){if(Vt==ie.maxLine)return we=!0,!0})),te.sel.contains(z.from,z.to)>-1&&Vn(x),iu(te,z,ne,Ro(x)),x.options.lineWrapping||(te.iter(ke,oe.line+z.text.length,function(Vt){var Xn=dn(Vt);Xn>ie.maxLineLength&&(ie.maxLine=Vt,ie.maxLineLength=Xn,ie.maxLineChanged=!0,we=!1)}),we&&(x.curOp.updateMaxLine=!0)),la(te,oe.line),is(x,400);var Oe=z.text.length-(me.line-oe.line)-1;z.full?Oi(x):oe.line==me.line&&z.text.length==1&&!Yu(x.doc,z)?Ta(x,oe.line,"text"):Oi(x,oe.line,me.line+1,Oe);var lt=ir(x,"changes"),Et=ir(x,"change");if(Et||lt){var on={from:oe,to:me,text:z.text,removed:z.removed,origin:z.origin};Et&&Bn(x,"change",x,on),lt&&(x.curOp.changeObjs||(x.curOp.changeObjs=[])).push(on)}x.display.selForContextMenu=null}function ec(x,z,ne,te,ie){var oe;te||(te=ne),vt(te,ne)<0&&(oe=[te,ne],ne=oe[0],te=oe[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 oe=x[ie],me=!0;if(oe.ranges){oe.copied||(oe=x[ie]=oe.deepCopy(),oe.copied=!0);for(var we=0;we<oe.ranges.length;we++)ef(oe.ranges[we].anchor,z,ne,te),ef(oe.ranges[we].head,z,ne,te);continue}for(var ke=0;ke<oe.changes.length;++ke){var Oe=oe.changes[ke];if(ne<Oe.from.line)Oe.from=Qe(Oe.from.line+te,Oe.from.ch),Oe.to=Qe(Oe.to.line+te,Oe.to.ch);else if(z<=Oe.to.line){me=!1;break}}me||(x.splice(0,ie+1),ie=0)}}function _c(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 Lc(x,z,ne,te){var ie=z,oe=z;return typeof z=="number"?oe=Ht(x,un(x,z)):ie=qn(z),ie==null?null:(te(oe,ie)&&x.cm&&Ta(x.cm,ie,ne),oe)}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,jn(ie),Bn(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 tc(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}tc.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 oe=Math.min(z,ie-x),me=te.height;if(te.removeInner(x,oe),this.height-=me-te.height,ie==oe&&(this.children.splice(ne--,1),te.parent=null),(z-=oe)==0)break;x=0}else x-=ie}if(this.size-z<25&&(this.children.length>1||!(this.children[0]instanceof fl))){var we=[];this.collapse(we),this.children=[new fl(we)],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],oe=ie.chunkSize();if(x<=oe){if(ie.insertInner(x,z,ne),ie.lines&&ie.lines.length>50){for(var me=ie.lines.length%25+25,we=me;we<ie.lines.length;){var ke=new fl(ie.lines.slice(we,we+=25));ie.height-=ke.height,this.children.splice(++te,0,ke),ke.parent=this}ie.lines=ie.lines.slice(0,me),this.maybeSpill()}break}x-=oe}},maybeSpill:function(){if(!(this.children.length<=10)){var x=this;do{var z=x.children.splice(x.children.length-5,5),ne=new tc(z);if(x.parent){x.size-=ne.size,x.height-=ne.height;var ie=$t(x.parent.children,x);x.parent.children.splice(ie+1,0,ne)}else{var te=new tc(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],oe=ie.chunkSize();if(x<oe){var me=Math.min(z,oe-x);if(ie.iterN(x,me,ne))return!0;if((z-=me)==0)break;x=0}else x-=oe}}};var nc=function(x,z,ne){if(ne)for(var te in ne)ne.hasOwnProperty(te)&&(this[te]=ne[te]);this.doc=x,this.node=z};nc.prototype.clear=function(){var x=this.doc.cm,z=this.line.widgets,ne=this.line,te=qn(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 oe=Bi(this);Yn(ne,Math.max(0,ne.height-oe)),x&&(ga(x,function(){nf(x,ne,-oe),Ta(x,te,"widget")}),Bn(x,"lineWidgetCleared",x,this,te))}},nc.prototype.changed=function(){var x=this,z=this.height,ne=this.doc.cm,te=this.line;this.height=null;var ie=Bi(this)-z;ie&&(fr(this.doc,te)||Yn(te,te.height+ie),ne&&ga(ne,function(){ne.curOp.forceUpdate=!0,nf(ne,te,ie),Bn(ne,"lineWidgetChanged",ne,x,qn(te))}))},gr(nc);function nf(x,z,ne){pn(z)<(x.curOp&&x.curOp.scrollTop||x.doc.scrollTop)&&ms(x,ne)}function rf(x,z,ne,te){var ie=new nc(x,ne,te),oe=x.cm;return oe&&ie.noHScroll&&(oe.display.alignWidgets=!0),Lc(x,z,"widget",function(me){var we=me.widgets||(me.widgets=[]);if(ie.insertAt==null?we.push(ie):we.splice(Math.min(we.length-1,Math.max(0,ie.insertAt)),0,ie),ie.line=me,oe&&!fr(x,me)){var ke=pn(me)<x.scrollTop;Yn(me,me.height+Bi(ie)),ke&&ms(oe,ie.height),oe.curOp.forceUpdate=!0}return!0}),oe&&Bn(oe,"lineWidgetAdded",oe,ie,typeof z=="number"?z:qn(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),ir(this,"clear")){var ne=this.find();ne&&Bn(this,"clear",ne.from,ne.to)}for(var te=null,ie=null,oe=0;oe<this.lines.length;++oe){var me=this.lines[oe],we=an(me.markedSpans,this);x&&!this.collapsed?Ta(x,qn(me),"text"):x&&(we.to!=null&&(ie=qn(me)),we.from!=null&&(te=qn(me))),me.markedSpans=kn(me.markedSpans,we),we.from==null&&this.collapsed&&!fr(this.doc,me)&&x&&Yn(me,Ka(x.display))}if(x&&this.collapsed&&!x.options.lineWrapping)for(var ke=0;ke<this.lines.length;++ke){var Oe=et(this.lines[ke]),lt=dn(Oe);lt>x.display.maxLineLength&&(x.display.maxLine=Oe,x.display.maxLineLength=lt,x.display.maxLineChanged=!0)}te!=null&&x&&this.collapsed&&Oi(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&&Bn(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 oe=this.lines[ie],me=an(oe.markedSpans,this);if(me.from!=null&&(ne=Qe(z?oe:qn(oe),me.from),x==-1))return ne;if(me.to!=null&&(te=Qe(z?oe:qn(oe),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||ga(te,function(){var ie=z.line,oe=qn(z.line),me=ca(te,oe);if(me&&(Ui(me),te.curOp.selectionChanged=te.curOp.forceUpdate=!0),te.curOp.updateMaxLine=!0,!fr(ne.doc,ie)&&ne.height!=null){var we=ne.height;ne.height=null;var ke=Bi(ne)-we;ke&&Yn(ie,ie.height+ke)}Bn(te,"markerChanged",te,x)})},hl.prototype.attachLine=function(x){if(!this.lines.length&&this.doc.cm){var z=this.doc.cm.curOp;(!z.maybeHiddenMarkers||$t(z.maybeHiddenMarkers,this)==-1)&&(z.maybeUnhiddenMarkers||(z.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(x)},hl.prototype.detachLine=function(x){if(this.lines.splice($t(this.lines,x),1),!this.lines.length&&this.doc.cm){var z=this.doc.cm.curOp;(z.maybeHiddenMarkers||(z.maybeHiddenMarkers=[])).push(this)}},gr(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 za(x.cm,nl)(x,z,ne,te,ie);var oe=new hl(x,ie),me=vt(z,ne);if(te&&Sr(te,oe,!1),me>0||me==0&&oe.clearWhenEmpty!==!1)return oe;if(oe.replacedWith&&(oe.collapsed=!0,oe.widgetNode=Mt("span",[oe.replacedWith],"CodeMirror-widget"),te.handleMouseEvents||oe.widgetNode.setAttribute("cm-ignore-events","true"),te.insertLeft&&(oe.widgetNode.insertLeft=!0)),oe.collapsed){if(Ge(x,z.line,z,ne,oe)||z.line!=ne.line&&Ge(x,ne.line,z,ne,oe))throw new Error("Inserting collapsed marker partially overlapping an existing one");ht()}oe.addToHistory&&Mc(x,{from:z,to:ne,origin:"markText"},x.sel,NaN);var we=z.line,ke=x.cm,Oe;if(x.iter(we,ne.line+1,function(Et){ke&&oe.collapsed&&!ke.options.lineWrapping&&et(Et)==ke.display.maxLine&&(Oe=!0),oe.collapsed&&we!=z.line&&Yn(Et,0),ur(Et,new Bt(oe,we==z.line?z.ch:null,we==ne.line?ne.ch:null)),++we}),oe.collapsed&&x.iter(z.line,ne.line+1,function(Et){fr(x,Et)&&Yn(Et,0)}),oe.clearOnEnter&&Rn(oe,"beforeCursorEnter",function(){return oe.clear()}),oe.readOnly&&(yt(),(x.history.done.length||x.history.undone.length)&&x.clearHistory()),oe.collapsed&&(oe.id=++af,oe.atomic=!0),ke){if(Oe&&(ke.curOp.updateMaxLine=!0),oe.collapsed)Oi(ke,z.line,ne.line+1);else if(oe.className||oe.startStyle||oe.endStyle||oe.css||oe.attributes||oe.title)for(var lt=z.line;lt<=ne.line;lt++)Ta(ke,lt,"text");oe.atomic&&Jd(ke.doc),Bn(ke,"markerAdded",ke,oe)}return oe}var ya=function(x,z){this.markers=x,this.primary=z;for(var ne=0;ne<x.length;++ne)x[ne].parent=this};ya.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var x=0;x<this.markers.length;++x)this.markers[x].clear();Bn(this,"clear")}},ya.prototype.find=function(x,z){return this.primary.find(x,z)},gr(ya);function uo(x,z,ne,te,ie){te=Sr(te),te.shared=!1;var oe=[nl(x,z,ne,te,ie)],me=oe[0],we=te.widgetNode;return Qs(x,function(ke){we&&(te.widgetNode=we.cloneNode(!0)),oe.push(nl(ke,Dn(ke,z),Dn(ke,ne),te,ie));for(var Oe=0;Oe<ke.linked.length;++Oe)if(ke.linked[Oe].isParent)return;me=Ft(oe)}),new ya(oe,me)}function pl(x){return x.findMarks(Qe(x.first,0),x.clipPos(Qe(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(),oe=x.clipPos(ie.from),me=x.clipPos(ie.to);if(vt(oe,me)){var we=nl(x,oe,me,te.primary,te.primary.type);te.markers.push(we),we.parent=te}}}function Ss(x){for(var z=function(te){var ie=x[te],oe=[ie.primary.doc];Qs(ie.primary.doc,function(ke){return oe.push(ke)});for(var me=0;me<ie.markers.length;me++){var we=ie.markers[me];$t(oe,we.doc)==-1&&(we.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),tc.call(this,[new fl([new In("",null)])]),this.first=ne,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=ne;var oe=Qe(ne,0);this.sel=Ps(oe),this.history=new Cc(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)),iu(this,{from:oe,to:oe,text:x}),To(this,Ps(oe),at)};Eo.prototype=ue(tc.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=Qe(this.first,0),ne=this.first+this.size-1;dl(this,{from:z,to:Qe(ne,Ht(this,ne).text.length),text:this.splitLines(x),origin:"setValue",full:!0},!0),this.cm&&Ts(this.cm,0,0),To(this,Ps(z),at)}),replaceRange:function(x,z,ne,te){z=Dn(this,z),ne=ne?Dn(this,ne):z,ec(this,x,z,ne,te)},getRange:function(x,z,ne){var te=$n(this,Dn(this,x),Dn(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(ar(this,x))return Ht(this,x)},getLineNumber:function(x){return qn(x)},getLineHandleVisualStart:function(x){return typeof x=="number"&&(x=Ht(this,x)),et(x)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(x){return Dn(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,Dn(this,typeof x=="number"?Qe(x,z||0):x),null,ne)}),setSelection:po(function(x,z,ne){ed(this,Dn(this,x),Dn(this,z||x),ne)}),extendSelection:po(function(x,z,ne){Bl(this,Dn(this,x),z&&Dn(this,z),ne)}),extendSelections:po(function(x,z){oi(this,Kt(this,x),z)}),extendSelectionsBy:po(function(x,z){var ne=Pn(this.sel.ranges,x);oi(this,Kt(this,ne),z)}),setSelections:po(function(x,z,ne){if(x.length){for(var te=[],ie=0;ie<x.length;ie++)te[ie]=new Za(Dn(this,x[ie].anchor),Dn(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 Za(Dn(this,x),Dn(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=$n(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=$n(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,oe=0;oe<ie.ranges.length;oe++){var me=ie.ranges[oe];te[oe]={from:me.from(),to:me.to(),text:this.splitLines(x[oe]),origin:ne}}for(var we=z&&z!="end"&&nu(this,te,z),ke=te.length-1;ke>=0;ke--)dl(this,te[ke]);we?as(this,we):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 Cc(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:Nl(this.history.done),undone:Nl(this.history.undone)}},setHistory:function(x){var z=this.history=new Cc(this.history.maxGeneration);z.done=Nl(x.done.slice(0),null,!0),z.undone=Nl(x.undone.slice(0),null,!0)},setGutterMarker:po(function(x,z,ne){return Lc(this,x,"gutter",function(te){var ie=te.gutterMarkers||(te.gutterMarkers={});return ie[z]=ne,!ne&&le(ie)&&(te.gutterMarkers=null),!0})}),clearGutter:po(function(x){var z=this;this.iter(function(ne){ne.gutterMarkers&&ne.gutterMarkers[x]&&Lc(z,ne,"gutter",function(){return ne.gutterMarkers[x]=null,le(ne.gutterMarkers)&&(ne.gutterMarkers=null),!0})})}),lineInfo:function(x){var z;if(typeof x=="number"){if(!ar(this,x)||(z=x,x=Ht(this,x),!x))return null}else if(z=qn(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 Lc(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(Me(ne).test(te[ie]))return!1;te[ie]+=" "+ne}return!0})}),removeLineClass:po(function(x,z,ne){return Lc(this,x,z=="gutter"?"gutter":"class",function(te){var ie=z=="text"?"textClass":z=="background"?"bgClass":z=="gutter"?"gutterClass":"wrapClass",oe=te[ie];if(oe)if(ne==null)te[ie]=null;else{var me=oe.match(Me(ne));if(!me)return!1;var we=me.index+me[0].length;te[ie]=oe.slice(0,me.index)+(!me.index||we==oe.length?"":" ")+oe.slice(we)||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,Dn(this,x),Dn(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=Dn(this,x),nl(this,x,x,ne,"bookmark")},findMarksAt:function(x){x=Dn(this,x);var z=[],ne=Ht(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=Dn(this,x),z=Dn(this,z);var te=[],ie=x.line;return this.iter(x.line,z.line+1,function(oe){var me=oe.markedSpans;if(me)for(var we=0;we<me.length;we++){var ke=me[we];!(ke.to!=null&&ie==x.line&&x.ch>=ke.to||ke.from==null&&ie!=x.line||ke.from!=null&&ie==z.line&&ke.from>=z.ch)&&(!ne||ne(ke.marker))&&te.push(ke.marker.parent||ke.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 oe=ie.text.length+te;if(oe>x)return z=x,!0;x-=oe,++ne}),Dn(this,Qe(ne,z))},indexFromPos:function(x){x=Dn(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 ra&&(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 Cc(null),x.history.done=Nl(this.history.done,te),x.history.undone=Nl(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):mt(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&&au(this.cm))})}),Eo.prototype.eachLine=Eo.prototype.iter;var rd=0;function eh(x){var z=this;if(rc(z),!(Wt(z,x)||Xi(z.display,x))){Pr(x),be&&(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,oe=Array(ie),me=0,we=function(){++me==ie&&za(z,function(){ne=Dn(z.doc,ne);var Vt={from:ne,to:ne,text:z.doc.splitLines(oe.filter(function(Xn){return Xn!=null}).join(z.doc.lineSeparator())),origin:"paste"};dl(z.doc,Vt),as(z.doc,Ps(Dn(z.doc,ne),Dn(z.doc,Js(Vt))))})()},ke=function(Vt,Xn){if(z.options.allowDropFileTypes&&$t(z.options.allowDropFileTypes,Vt.type)==-1){we();return}var dr=new FileReader;dr.onerror=function(){return we()},dr.onload=function(){var Tr=dr.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Tr)){we();return}oe[Xn]=Tr,we()},dr.readAsText(Vt)},Oe=0;Oe<te.length;Oe++)ke(te[Oe],Oe);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 lt=x.dataTransfer.getData("Text");if(lt){var Et;if(z.state.draggingText&&!z.state.draggingText.copy&&(Et=z.listSelections()),kc(z.doc,Ps(ne,ne)),Et)for(var on=0;on<Et.length;++on)ec(z.doc,"",Et[on].anchor,Et[on].head,"drag");z.replaceSelection(lt,"around","paste"),z.display.input.focus()}}catch(Vt){}}}}function th(x,z){if(be&&(!x.state.draggingText||+new Date-rd<100)){qr(z);return}if(!(Wt(x,z)||Xi(x.display,z))&&(z.dataTransfer.setData("Text",x.getSelection()),z.dataTransfer.effectAllowed="copyMove",z.dataTransfer.setDragImage&&!gt)){var ne=wt("img",null,null,"position: fixed; left: 0; top: 0;");ne.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Te&&(ne.width=ne.height=1,x.display.wrapper.appendChild(ne),ne._top=ne.offsetTop),z.dataTransfer.setDragImage(ne,0,0),Te&&ne.parentNode.removeChild(ne)}}function id(x,z){var ne=Ao(x,z);if(ne){var te=document.createDocumentFragment();aa(x,ne,te),x.display.dragCursor||(x.display.dragCursor=wt("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),x.display.lineSpace.insertBefore(x.display.dragCursor,x.display.cursorDiv)),Ct(x.display.dragCursor,te)}}function rc(x){x.display.dragCursor&&(x.display.lineSpace.removeChild(x.display.dragCursor),x.display.dragCursor=null)}function ic(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 oe=0;oe<ne.length;oe++)x(ne[oe])})}}var kr=!1;function ad(){kr||(gu(),kr=!0)}function gu(){var x;Rn(window,"resize",function(){x==null&&(x=setTimeout(function(){x=null,ic(vu)},100))}),Rn(window,"blur",function(){return ic(Fo)})}function vu(x){var z=x.display;z.cachedCharWidth=z.cachedTextHeight=z.cachedPaddingH=null,z.scrollbarsClipped=!1,x.setSize()}for(var Os={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"},Ac=0;Ac<10;Ac++)Os[Ac+48]=Os[Ac+96]=String(Ac);for(var yu=65;yu<=90;yu++)Os[yu]=String.fromCharCode(yu);for(var Tc=1;Tc<=12;Tc++)Os[Tc+111]=Os[Tc+63235]="F"+Tc;var Qa={};Qa.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"},Qa.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"},Qa.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"},Qa.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"]},Qa.default=De?Qa.macDefault:Qa.pcDefault;function nh(x){var z=x.split(/-(?!$)/);x=z[z.length-1];for(var ne,te,ie,oe,me=0;me<z.length-1;me++){var we=z[me];if(/^(cmd|meta|m)$/i.test(we))oe=!0;else if(/^a(lt)?$/i.test(we))ne=!0;else if(/^(c|ctrl|control)$/i.test(we))te=!0;else if(/^s(hift)?$/i.test(we))ie=!0;else throw new Error("Unrecognized modifier name: "+we)}return ne&&(x="Alt-"+x),te&&(x="Ctrl-"+x),oe&&(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=Pn(ne.split(" "),nh),oe=0;oe<ie.length;oe++){var me=void 0,we=void 0;oe==ie.length-1?(we=ie.join(" "),me=te):(we=ie.slice(0,oe+1).join(" "),me="...");var ke=z[we];if(!ke)z[we]=me;else if(ke!=me)throw new Error("Inconsistent bindings for "+we)}delete x[ne]}for(var Oe in z)x[Oe]=z[Oe];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 oe=0;oe<z.fallthrough.length;oe++){var me=rl(x,z.fallthrough[oe],ne,te);if(me)return me}}}function Dc(x){var z=typeof x=="string"?x:Os[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),(ct?z.metaKey:z.ctrlKey)&&te!="Ctrl"&&(x="Ctrl-"+x),(ct?z.ctrlKey:z.metaKey)&&te!="Mod"&&(x="Cmd-"+x),!ne&&z.shiftKey&&te!="Shift"&&(x="Shift-"+x),x}function zl(x,z){if(Te&&x.keyCode==34&&x.char)return!1;var ne=Os[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"?Qa[x]:x}function ks(x,z){for(var ne=x.doc.sel.ranges,te=[],ie=0;ie<ne.length;ie++){for(var oe=z(ne[ie]);te.length&&vt(oe.from,Ft(te).to)<=0;){var me=te.pop();if(vt(me.from,oe.from)<0){oe.from=me.from;break}}te.push(oe)}ga(x,function(){for(var we=te.length-1;we>=0;we--)ec(x.doc,"",te[we].from,te[we].to,"+delete");zo(x)})}function Vo(x,z,ne){var te=tn(x.text,z+ne,ne);return te<0||te>x.text.length?null:te}function Ws(x,z,ne){var te=Vo(x,z.ch,ne);return te==null?null:new Qe(z.line,te,ne<0?"after":"before")}function Kl(x,z,ne,te,ie){if(x){z.doc.direction=="rtl"&&(ie=-ie);var oe=Fr(ne,z.doc.direction);if(oe){var me=ie<0?Ft(oe):oe[0],we=ie<0==(me.level==1),ke=we?"after":"before",Oe;if(me.level>0||z.doc.direction=="rtl"){var lt=Yi(z,ne);Oe=ie<0?ne.text.length-1:0;var Et=Mi(z,lt,Oe).top;Oe=hn(function(on){return Mi(z,lt,on).top==Et},ie<0==(me.level==1)?me.from:me.to-1,Oe),ke=="before"&&(Oe=Vo(ne,Oe,1))}else Oe=ie<0?me.to:me.from;return new Qe(te,Oe,ke)}}return new Qe(te,ie<0?ne.text.length:0,ie<0?"before":"after")}function Us(x,z,ne,te){var ie=Fr(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 oe=ln(ie,ne.ch,ne.sticky),me=ie[oe];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 we=function(Wr,ni){return Vo(z,Wr instanceof Qe?Wr.ch:Wr,ni)},ke,Oe=function(Wr){return x.options.lineWrapping?(ke=ke||Yi(x,z),Fa(x,z,ke,Wr)):{begin:0,end:z.text.length}},lt=Oe(ne.sticky=="before"?we(ne,-1):ne.ch);if(x.doc.direction=="rtl"||me.level==1){var Et=me.level==1==te<0,on=we(ne,Et?1:-1);if(on!=null&&(Et?on<=me.to&&on<=lt.end:on>=me.from&&on>=lt.begin)){var Vt=Et?"before":"after";return new Qe(ne.line,on,Vt)}}var Xn=function(Wr,ni,Kr){for(var ri=function(to,Wo){return Wo?new Qe(ne.line,we(to,1),"before"):new Qe(ne.line,to,"after")};Wr>=0&&Wr<ie.length;Wr+=ni){var Fi=ie[Wr],Hi=ni>0==(Fi.level!=1),ba=Hi?Kr.begin:we(Kr.end,-1);if(Fi.from<=ba&&ba<Fi.to||(ba=Hi?Fi.from:we(Fi.to,-1),Kr.begin<=ba&&ba<Kr.end))return ri(ba,Hi)}},dr=Xn(oe+te,te,lt);if(dr)return dr;var Tr=te>0?lt.end:we(lt.begin,-1);return Tr!=null&&!(te>0&&Tr==z.text.length)&&(dr=Xn(te>0?0:ie.length-1,te,Oe(Tr)),dr)?dr:null}var ac={selectAll:td,singleSelection:function(x){return x.setSelection(x.getCursor("anchor"),x.getCursor("head"),at)},killLine:function(x){return ks(x,function(z){if(z.empty()){var ne=Ht(x.doc,z.head.line).text.length;return z.head.ch==ne&&z.head.line<x.lastLine()?{from:z.head,to:Qe(z.head.line+1,0)}:{from:z.head,to:Qe(z.head.line,ne)}}else return{from:z.from(),to:z.to()}})},deleteLine:function(x){return ks(x,function(z){return{from:Qe(z.from().line,0),to:Dn(x.doc,Qe(z.to().line+1,0))}})},delLineLeft:function(x){return ks(x,function(z){return{from:Qe(z.from().line,0),to:z.from()}})},delWrappedLineLeft:function(x){return ks(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 ks(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(Qe(x.firstLine(),0))},goDocEnd:function(x){return x.extendSelection(Qe(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")},Gt)},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")},Gt)},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},Gt)},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 oe=ne[ie].from(),me=qe(x.getLine(oe.line),oe.ch,te);z.push(nn(te-me%te))}x.replaceSelections(z)},defaultTab:function(x){x.somethingSelected()?x.indentSelection("add"):x.execCommand("insertTab")},transposeChars:function(x){return ga(x,function(){for(var z=x.listSelections(),ne=[],te=0;te<z.length;te++)if(z[te].empty()){var ie=z[te].head,oe=Ht(x.doc,ie.line).text;if(oe){if(ie.ch==oe.length&&(ie=new Qe(ie.line,ie.ch-1)),ie.ch>0)ie=new Qe(ie.line,ie.ch+1),x.replaceRange(oe.charAt(ie.ch-1)+oe.charAt(ie.ch-2),Qe(ie.line,ie.ch-2),ie,"+transpose");else if(ie.line>x.doc.first){var me=Ht(x.doc,ie.line-1).text;me&&(ie=new Qe(ie.line,1),x.replaceRange(oe.charAt(0)+x.doc.lineSeparator()+me.charAt(me.length-1),Qe(ie.line-1,me.length-1),ie,"+transpose"))}}ne.push(new Za(ie,ie))}x.setSelections(ne)})},newlineAndIndent:function(x){return ga(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=Ht(x.doc,z),te=et(ne);return te!=ne&&(z=qn(te)),Kl(!0,x,te,z,1)}function ld(x,z){var ne=Ht(x.doc,z),te=bt(ne);return te!=ne&&(z=qn(te)),Kl(!0,x,ne,z,-1)}function lf(x,z){var ne=sd(x,z.line),te=Ht(x.doc,ne.line),ie=Fr(te,x.doc.direction);if(!ie||ie[0].level==0){var oe=Math.max(ne.ch,te.text.search(/\S/)),me=z.line==ne.line&&z.ch<=oe&&z.ch;return Qe(ne.line,me?0:oe,ne.sticky)}return ne}function Do(x,z,ne){if(typeof z=="string"&&(z=ac[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)!=bn}finally{x.display.shift=te,x.state.suppressEdits=!1}return ie}function Zs(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 Ae;function oc(x,z,ne,te){var ie=x.state.keySeq;if(ie){if(Dc(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())}),bu(x,ie+" "+z,ne,te))return!0}return bu(x,z,ne,te)}function bu(x,z,ne,te){var ie=Zs(x,z,te);return ie=="multi"&&(x.state.keySeq=z),ie=="handled"&&Bn(x,"keyHandled",x,z,ne),(ie=="handled"||ie=="multi")&&(Pr(ne),wi(x)),!!ie}function La(x,z){var ne=zl(z,!0);return ne?z.shiftKey&&!x.state.keySeq?oc(x,"Shift-"+ne,z,function(te){return Do(x,te,!0)})||oc(x,ne,z,function(te){if(typeof te=="string"?/^go[A-Z]/.test(te):te.motion)return Do(x,te)}):oc(x,ne,z,function(te){return Do(x,te)}):!1}function sc(x,z,ne){return oc(x,"'"+ne+"'",z,function(te){return Do(x,te,!0)})}var il=null;function Ic(x){var z=this;if(!(x.target&&x.target!=z.display.input.getField())&&(z.curOp.focus=At(),!Wt(z,x))){be&&_e<11&&x.keyCode==27&&(x.returnValue=!1);var ne=x.keyCode;z.display.shift=ne==16||x.shiftKey;var te=La(z,x);Te&&(il=te?ne:null,!te&&ne==88&&!En&&(De?x.metaKey:x.ctrlKey)&&z.replaceSelection("",null,"cut")),fe&&!De&&!te&&ne==46&&x.shiftKey&&!x.ctrlKey&&document.execCommand&&document.execCommand("cut"),ne==18&&!/\bCodeMirror-crosshair\b/.test(z.display.lineDiv.className)&&Un(z)}}function Un(x){var z=x.display.lineDiv;xn(z,"CodeMirror-crosshair");function ne(te){(te.keyCode==18||!te.altKey)&&(Ve(z,"CodeMirror-crosshair"),li(document,"keyup",ne),li(document,"mouseover",ne))}Rn(document,"keyup",ne),Rn(document,"mouseover",ne)}function cf(x){x.keyCode==16&&(this.doc.sel.shift=!1),Wt(this,x)}function uf(x){var z=this;if(!(x.target&&x.target!=z.display.input.getField())&&!(Xi(z.display,x)||Wt(z,x)||x.ctrlKey&&!x.altKey||De&&x.metaKey)){var ne=x.keyCode,te=x.charCode;if(Te&&ne==il){il=null,Pr(x);return}if(!(Te&&(!x.which||x.which<10)&&La(z,x))){var ie=String.fromCharCode(te==null?ne:te);ie!="\b"&&(sc(z,x,ie)||z.display.input.onKeyPress(x))}}}var cd=400,ud=function(x,z,ne){this.time=x,this.pos=z,this.button=ne};ud.prototype.compare=function(x,z,ne){return this.time+cd>x&&vt(z,this.pos)==0&&ne==this.button};var al,Pc;function ih(x,z){var ne=+new Date;return Pc&&Pc.compare(ne,x,z)?(al=Pc=null,"triple"):al&&al.compare(ne,x,z)?(Pc=new ud(ne,x,z),al=null,"double"):(al=new ud(ne,x,z),Pc=null,"single")}function jo(x){var z=this,ne=z.display;if(!(Wt(z,x)||ne.activeTouch&&ne.input.supportsTouch())){if(ne.input.ensurePolled(),ne.shift=x.shiftKey,Xi(ne,x)){Le||(ne.scroller.draggable=!1,setTimeout(function(){return ne.scroller.draggable=!0},100));return}if(!ts(z,x)){var te=Ao(z,x),ie=br(x),oe=te?ih(te,ie):"single";window.focus(),ie==1&&z.state.selectingText&&z.state.selectingText(x),!(te&&gl(z,ie,te,oe,x))&&(ie==1?te?wu(z,te,oe,x):ui(x)==ne.scroller&&Pr(x):ie==2?(te&&Bl(z.doc,te),setTimeout(function(){return ne.input.focus()},20)):ie==3&&(Ie?z.display.input.onContextMenu(x):Ha(z)))}}}function gl(x,z,ne,te,ie){var oe="Click";return te=="double"?oe="Double"+oe:te=="triple"&&(oe="Triple"+oe),oe=(z==1?"Left":z==2?"Middle":"Right")+oe,oc(x,ml(oe,ie),ie,function(me){if(typeof me=="string"&&(me=ac[me]),!me)return!1;var we=!1;try{x.isReadOnly()&&(x.state.suppressEdits=!0),we=me(x,ne)!=bn}finally{x.state.suppressEdits=!1}return we})}function xu(x,z,ne){var te=x.getOption("configureMouse"),ie=te?te(x,z,ne):{};if(ie.unit==null){var oe=Dt?ne.shiftKey&&ne.metaKey:ne.altKey;ie.unit=oe?"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=De?ne.metaKey:ne.ctrlKey),ie.moveOnDrag==null&&(ie.moveOnDrag=!(De?ne.altKey:ne.ctrlKey)),ie}function wu(x,z,ne,te){be?setTimeout(er(Di,x),0):x.curOp.focus=At();var ie=xu(x,ne,te),oe=x.doc.sel,me;x.options.dragDrop&&Ei&&!x.isReadOnly()&&ne=="single"&&(me=oe.contains(z))>-1&&(vt((me=oe.ranges[me]).from(),z)<0||z.xRel>0)&&(vt(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,oe=!1,me=za(x,function(Oe){Le&&(ie.scroller.draggable=!1),x.state.draggingText=!1,li(ie.wrapper.ownerDocument,"mouseup",me),li(ie.wrapper.ownerDocument,"mousemove",we),li(ie.scroller,"dragstart",ke),li(ie.scroller,"drop",me),oe||(Pr(Oe),te.addNew||Bl(x.doc,ne,null,null,te.extend),Le&&!gt||be&&_e==9?setTimeout(function(){ie.wrapper.ownerDocument.body.focus({preventScroll:!0}),ie.input.focus()},20):ie.input.focus())}),we=function(Oe){oe=oe||Math.abs(z.clientX-Oe.clientX)+Math.abs(z.clientY-Oe.clientY)>=10},ke=function(){return oe=!0};Le&&(ie.scroller.draggable=!0),x.state.draggingText=me,me.copy=!te.moveOnDrag,ie.scroller.dragDrop&&ie.scroller.dragDrop(),Rn(ie.wrapper.ownerDocument,"mouseup",me),Rn(ie.wrapper.ownerDocument,"mousemove",we),Rn(ie.scroller,"dragstart",ke),Rn(ie.scroller,"drop",me),Ha(x),setTimeout(function(){return ie.input.focus()},20)}function df(x,z,ne){if(ne=="char")return new Za(z,z);if(ne=="word")return x.findWordAt(z);if(ne=="line")return new Za(Qe(z.line,0),Dn(x.doc,Qe(z.line+1,0)));var te=ne(x,z);return new Za(te.from,te.to)}function dd(x,z,ne,te){var ie=x.display,oe=x.doc;Pr(z);var me,we,ke=oe.sel,Oe=ke.ranges;if(te.addNew&&!te.extend?(we=oe.sel.contains(ne),we>-1?me=Oe[we]:me=new Za(ne,ne)):(me=oe.sel.primary(),we=oe.sel.primIndex),te.unit=="rectangle")te.addNew||(me=new Za(ne,ne)),ne=Ao(x,z,!0,!0),we=-1;else{var lt=df(x,ne,te.unit);te.extend?me=fu(me,lt.anchor,lt.head,te.extend):me=lt}te.addNew?we==-1?(we=Oe.length,To(oe,Es(x,Oe.concat([me]),we),{scroll:!1,origin:"*mouse"})):Oe.length>1&&Oe[we].empty()&&te.unit=="char"&&!te.extend?(To(oe,Es(x,Oe.slice(0,we).concat(Oe.slice(we+1)),0),{scroll:!1,origin:"*mouse"}),ke=oe.sel):ws(oe,we,me,ft):(we=0,To(oe,new vs([me],0),ft),ke=oe.sel);var Et=ne;function on(Kr){if(vt(Et,Kr)!=0)if(Et=Kr,te.unit=="rectangle"){for(var ri=[],Fi=x.options.tabSize,Hi=qe(Ht(oe,ne.line).text,ne.ch,Fi),ba=qe(Ht(oe,Kr.line).text,Kr.ch,Fi),to=Math.min(Hi,ba),Wo=Math.max(Hi,ba),bo=Math.min(ne.line,Kr.line),us=Math.min(x.lastLine(),Math.max(ne.line,Kr.line));bo<=us;bo++){var ds=Ht(oe,bo).text,Io=zn(ds,to,Fi);to==Wo?ri.push(new Za(Qe(bo,Io),Qe(bo,Io))):ds.length>Io&&ri.push(new Za(Qe(bo,Io),Qe(bo,zn(ds,Wo,Fi))))}ri.length||ri.push(new Za(ne,ne)),To(oe,Es(x,ke.ranges.slice(0,we).concat(ri),we),{origin:"*mouse",scroll:!1}),x.scrollIntoView(Kr)}else{var fs=me,oa=df(x,Kr,te.unit),So=fs.anchor,xo;vt(oa.anchor,So)>0?(xo=oa.head,So=cn(fs.from(),oa.anchor)):(xo=oa.anchor,So=en(fs.to(),oa.head));var Co=ke.ranges.slice(0);Co[we]=ff(x,new Za(Dn(oe,So),xo)),To(oe,Es(x,Co,we),ft)}}var Vt=ie.wrapper.getBoundingClientRect(),Xn=0;function dr(Kr){var ri=++Xn,Fi=Ao(x,Kr,!0,te.unit=="rectangle");if(Fi)if(vt(Fi,Et)!=0){x.curOp.focus=At(),on(Fi);var Hi=va(ie,oe);(Fi.line>=Hi.to||Fi.line<Hi.from)&&setTimeout(za(x,function(){Xn==ri&&dr(Kr)}),150)}else{var ba=Kr.clientY<Vt.top?-20:Kr.clientY>Vt.bottom?20:0;ba&&setTimeout(za(x,function(){Xn==ri&&(ie.scroller.scrollTop+=ba,dr(Kr))}),50)}}function Tr(Kr){x.state.selectingText=!1,Xn=1/0,Kr&&(Pr(Kr),ie.input.focus()),li(ie.wrapper.ownerDocument,"mousemove",Wr),li(ie.wrapper.ownerDocument,"mouseup",ni),oe.history.lastSelOrigin=null}var Wr=za(x,function(Kr){Kr.buttons===0||!br(Kr)?Tr(Kr):dr(Kr)}),ni=za(x,Tr);x.state.selectingText=ni,Rn(ie.wrapper.ownerDocument,"mousemove",Wr),Rn(ie.wrapper.ownerDocument,"mouseup",ni)}function ff(x,z){var ne=z.anchor,te=z.head,ie=Ht(x.doc,ne.line);if(vt(ne,te)==0&&ne.sticky==te.sticky)return z;var oe=Fr(ie);if(!oe)return z;var me=ln(oe,ne.ch,ne.sticky),we=oe[me];if(we.from!=ne.ch&&we.to!=ne.ch)return z;var ke=me+(we.from==ne.ch==(we.level!=1)?0:1);if(ke==0||ke==oe.length)return z;var Oe;if(te.line!=ne.line)Oe=(te.line-ne.line)*(x.doc.direction=="ltr"?1:-1)>0;else{var lt=ln(oe,te.ch,te.sticky),Et=lt-me||(te.ch-ne.ch)*(we.level==1?-1:1);lt==ke-1||lt==ke?Oe=Et<0:Oe=Et>0}var on=oe[ke+(Oe?-1:0)],Vt=Oe==(on.level==1),Xn=Vt?on.from:on.to,dr=Vt?"after":"before";return ne.ch==Xn&&ne.sticky==dr?z:new Za(new Qe(ne.line,Xn,dr),te)}function Oc(x,z,ne,te){var ie,oe;if(z.touches)ie=z.touches[0].clientX,oe=z.touches[0].clientY;else try{ie=z.clientX,oe=z.clientY}catch(on){return!1}if(ie>=Math.floor(x.display.gutters.getBoundingClientRect().right))return!1;te&&Pr(z);var me=x.display,we=me.lineDiv.getBoundingClientRect();if(oe>we.bottom||!ir(x,ne))return Xr(z);oe-=we.top-me.viewOffset;for(var ke=0;ke<x.display.gutterSpecs.length;++ke){var Oe=me.gutters.childNodes[ke];if(Oe&&Oe.getBoundingClientRect().right>=ie){var lt=rr(x.doc,oe),Et=x.display.gutterSpecs[ke];return st(x,ne,x,lt,Et.className,z),Xr(z)}}}function ts(x,z){return Oc(x,z,"gutterClick",!0)}function vl(x,z){Xi(x.display,z)||hf(x,z)||Wt(x,z,"contextmenu")||Ie||x.display.input.onContextMenu(z)}function hf(x,z){return ir(x,"gutterContextMenu")?Oc(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-"),hi(x)}var yl={toString:function(){return"CodeMirror.Init"}},pf={},Su={};function oh(x){var z=x.optionHandlers;function ne(te,ie,oe,me){x.defaults[te]=ie,oe&&(z[te]=me?function(we,ke,Oe){Oe!=yl&&oe(we,ke,Oe)}:oe)}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,ru(te)},!0),ne("indentUnit",2,ru,!0),ne("indentWithTabs",!1),ne("smartIndent",!0),ne("tabSize",4,function(te){Rl(te),hi(te),Oi(te)},!0),ne("lineSeparator",null,function(te,ie){if(te.doc.lineSep=ie,!!ie){var oe=[],me=te.doc.first;te.doc.iter(function(ke){for(var Oe=0;;){var lt=ke.text.indexOf(ie,Oe);if(lt==-1)break;Oe=lt+ie.length,oe.push(Qe(me,lt))}me++});for(var we=oe.length-1;we>=0;we--)ec(te.doc,ie,oe[we],Qe(oe[we].line,oe[we].ch+ie.length))}}),ne("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(te,ie,oe){te.state.specialChars=new RegExp(ie.source+(ie.test(" ")?"":"| "),"g"),oe!=yl&&te.refresh()}),ne("specialCharPlaceholder",Pe,function(te){return te.refresh()},!0),ne("electricChars",!0),ne("inputStyle",Je?"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",!Yt),ne("wholeLineUpdateBefore",!0),ne("theme","default",function(te){fd(te),Ql(te)},!0),ne("keyMap","default",function(te,ie,oe){var me=ss(ie),we=oe!=yl&&ss(oe);we&&we.detach&&we.detach(te,me),me.attach&&me.attach(te,we||null)}),ne("extraKeys",null),ne("configureMouse",null),ne("lineWrapping",!1,mf,!0),ne("gutters",[],function(te,ie){te.display.gutterSpecs=eu(ie,te.options.lineNumbers),Ql(te)},!0),ne("fixedGutter",!0,function(te,ie){te.display.gutters.style.left=ie?Oo(te.display)+"px":"0",te.refresh()},!0),ne("coverGutterNextToScrollbar",!1,function(te){return xs(te)},!0),ne("scrollbarStyle","native",function(te){vc(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=eu(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"&&(Fo(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,Rl,!0),ne("addModeClass",!1,Rl,!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,Rl,!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,oe=z?Rn:li;oe(x.display.scroller,"dragstart",ie.start),oe(x.display.scroller,"dragenter",ie.enter),oe(x.display.scroller,"dragover",ie.over),oe(x.display.scroller,"dragleave",ie.leave),oe(x.display.scroller,"drop",ie.drop)}}function mf(x){x.options.lineWrapping?(xn(x.display.wrapper,"CodeMirror-wrap"),x.display.sizer.style.minWidth="",x.display.sizerWidth=null):(Ve(x.display.wrapper,"CodeMirror-wrap"),Cn(x)),lo(x),Oi(x),hi(x),setTimeout(function(){return xs(x)},100)}function ra(x,z){var ne=this;if(!(this instanceof ra))return new ra(x,z);this.options=z=z?Sr(z):{},Sr(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 ra.inputStyles[z.inputStyle](this),oe=this.display=new Gd(x,te,ie,z);oe.wrapper.CodeMirror=this,fd(this),z.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),vc(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 Ae,keySeq:null,specialChars:null},z.autofocus&&!Je&&oe.input.focus(),be&&_e<11&&setTimeout(function(){return ne.display.input.reset(!0)},20),lh(this),ad(),Ks(this),this.curOp.forceUpdate=!0,wc(this,te),z.autofocus&&!Je||this.hasFocus()?setTimeout(function(){ne.hasFocus()&&!ne.state.focused&&ja(ne)},20):Fo(this);for(var me in Su)Su.hasOwnProperty(me)&&Su[me](this,z[me],yl);bc(this),z.finishInit&&z.finishInit(this);for(var we=0;we<hd.length;++we)hd[we](this);Is(this),Le&&z.lineWrapping&&getComputedStyle(oe.lineDiv).textRendering=="optimizelegibility"&&(oe.lineDiv.style.textRendering="auto")}ra.defaults=pf,ra.optionHandlers=Su;function lh(x){var z=x.display;Rn(z.scroller,"mousedown",za(x,jo)),be&&_e<11?Rn(z.scroller,"dblclick",za(x,function(ke){if(!Wt(x,ke)){var Oe=Ao(x,ke);if(!(!Oe||ts(x,ke)||Xi(x.display,ke))){Pr(ke);var lt=x.findWordAt(Oe);Bl(x.doc,lt.anchor,lt.head)}}})):Rn(z.scroller,"dblclick",function(ke){return Wt(x,ke)||Pr(ke)}),Rn(z.scroller,"contextmenu",function(ke){return vl(x,ke)}),Rn(z.input.getField(),"contextmenu",function(ke){z.scroller.contains(ke.target)||vl(x,ke)});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 oe(ke){if(ke.touches.length!=1)return!1;var Oe=ke.touches[0];return Oe.radiusX<=1&&Oe.radiusY<=1}function me(ke,Oe){if(Oe.left==null)return!0;var lt=Oe.left-ke.left,Et=Oe.top-ke.top;return lt*lt+Et*Et>20*20}Rn(z.scroller,"touchstart",function(ke){if(!Wt(x,ke)&&!oe(ke)&&!ts(x,ke)){z.input.ensurePolled(),clearTimeout(ne);var Oe=+new Date;z.activeTouch={start:Oe,moved:!1,prev:Oe-te.end<=300?te:null},ke.touches.length==1&&(z.activeTouch.left=ke.touches[0].pageX,z.activeTouch.top=ke.touches[0].pageY)}}),Rn(z.scroller,"touchmove",function(){z.activeTouch&&(z.activeTouch.moved=!0)}),Rn(z.scroller,"touchend",function(ke){var Oe=z.activeTouch;if(Oe&&!Xi(z,ke)&&Oe.left!=null&&!Oe.moved&&new Date-Oe.start<300){var lt=x.coordsChar(z.activeTouch,"page"),Et;!Oe.prev||me(Oe,Oe.prev)?Et=new Za(lt,lt):!Oe.prev.prev||me(Oe,Oe.prev.prev)?Et=x.findWordAt(lt):Et=new Za(Qe(lt.line,0),Dn(x.doc,Qe(lt.line+1,0))),x.setSelection(Et.anchor,Et.head),x.focus(),Pr(ke)}ie()}),Rn(z.scroller,"touchcancel",ie),Rn(z.scroller,"scroll",function(){z.scroller.clientHeight&&(Da(x,z.scroller.scrollTop),go(x,z.scroller.scrollLeft,!0),st(x,"scroll",x))}),Rn(z.scroller,"mousewheel",function(ke){return Xu(x,ke)}),Rn(z.scroller,"DOMMouseScroll",function(ke){return Xu(x,ke)}),Rn(z.wrapper,"scroll",function(){return z.wrapper.scrollTop=z.wrapper.scrollLeft=0}),z.dragFunctions={enter:function(ke){Wt(x,ke)||qr(ke)},over:function(ke){Wt(x,ke)||(id(x,ke),qr(ke))},start:function(ke){return th(x,ke)},drop:za(x,eh),leave:function(ke){Wt(x,ke)||rc(x)}};var we=z.input.getField();Rn(we,"keyup",function(ke){return cf.call(x,ke)}),Rn(we,"keydown",za(x,Ic)),Rn(we,"keypress",za(x,uf)),Rn(we,"focus",function(ke){return ja(x,ke)}),Rn(we,"blur",function(ke){return Fo(x,ke)})}var hd=[];ra.defineInitHook=function(x){return hd.push(x)};function Rs(x,z,ne,te){var ie=x.doc,oe;ne==null&&(ne="add"),ne=="smart"&&(ie.mode.indent?oe=pi(x,z).state:ne="prev");var me=x.options.tabSize,we=Ht(ie,z),ke=qe(we.text,null,me);we.stateAfter&&(we.stateAfter=null);var Oe=we.text.match(/^\s*/)[0],lt;if(!te&&!/\S/.test(we.text))lt=0,ne="not";else if(ne=="smart"&&(lt=ie.mode.indent(oe,we.text.slice(Oe.length),we.text),lt==bn||lt>150)){if(!te)return;ne="prev"}ne=="prev"?z>ie.first?lt=qe(Ht(ie,z-1).text,null,me):lt=0:ne=="add"?lt=ke+x.options.indentUnit:ne=="subtract"?lt=ke-x.options.indentUnit:typeof ne=="number"&&(lt=ke+ne),lt=Math.max(0,lt);var Et="",on=0;if(x.options.indentWithTabs)for(var Vt=Math.floor(lt/me);Vt;--Vt)on+=me,Et+=" ";if(on<lt&&(Et+=nn(lt-on)),Et!=Oe)return ec(ie,Et,Qe(z,0),Qe(z,Oe.length),"+input"),we.stateAfter=null,!0;for(var Xn=0;Xn<ie.sel.ranges.length;Xn++){var dr=ie.sel.ranges[Xn];if(dr.head.line==z&&dr.head.ch<Oe.length){var Tr=Qe(z,Oe.length);ws(ie,Xn,new Za(Tr,Tr));break}}}var Ns=null;function bl(x){Ns=x}function pd(x,z,ne,te,ie){var oe=x.doc;x.display.shift=!1,te||(te=oe.sel);var me=+new Date-200,we=ie=="paste"||x.state.pasteIncoming>me,ke=mt(z),Oe=null;if(we&&te.ranges.length>1)if(Ns&&Ns.text.join(`
`)==z){if(te.ranges.length%Ns.text.length==0){Oe=[];for(var lt=0;lt<Ns.text.length;lt++)Oe.push(oe.splitLines(Ns.text[lt]))}}else ke.length==te.ranges.length&&x.options.pasteLinesPerSelection&&(Oe=Pn(ke,function(Wr){return[Wr]}));for(var Et=x.curOp.updateInput,on=te.ranges.length-1;on>=0;on--){var Vt=te.ranges[on],Xn=Vt.from(),dr=Vt.to();Vt.empty()&&(ne&&ne>0?Xn=Qe(Xn.line,Xn.ch-ne):x.state.overwrite&&!we?dr=Qe(dr.line,Math.min(Ht(oe,dr.line).text.length,dr.ch+Ft(ke).length)):we&&Ns&&Ns.lineWise&&Ns.text.join(`
`)==ke.join(`
`)&&(Xn=dr=Qe(Xn.line,0)));var Tr={from:Xn,to:dr,text:Oe?Oe[on%Oe.length]:ke,origin:ie||(we?"paste":x.state.cutIncoming>me?"cut":"+input")};dl(x.doc,Tr),Bn(x,"inputRead",x,Tr)}z&&!we&&gd(x,z),zo(x),x.curOp.updateInput<2&&(x.curOp.updateInput=Et),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&&ga(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 oe=x.getModeAt(ie.head),me=!1;if(oe.electricChars){for(var we=0;we<oe.electricChars.length;we++)if(z.indexOf(oe.electricChars.charAt(we))>-1){me=Rs(x,ie.head.line,"smart");break}}else oe.electricInput&&oe.electricInput.test(Ht(x.doc,ie.head.line).text.slice(0,ie.head.ch))&&(me=Rs(x,ie.head.line,"smart"));me&&Bn(x,"electricInput",x,ie.head.line)}}}function lc(x){for(var z=[],ne=[],te=0;te<x.doc.sel.ranges.length;te++){var ie=x.doc.sel.ranges[te].head.line,oe={anchor:Qe(ie,0),head:Qe(ie+1,0)};ne.push(oe),z.push(x.getRange(oe.anchor,oe.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=wt("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),z=wt("div",[x],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return Le?x.style.width="1000px":x.setAttribute("wrap","off"),kt&&(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 oe=this.options,me=oe[te];oe[te]==ie&&te!="mode"||(oe[te]=ie,z.hasOwnProperty(te)&&za(this,z[te])(this,ie,me),st(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,oe=0;oe<ie.length;++oe)if(ie[oe]==te||ie[oe].name==te)return ie.splice(oe,1),!0},addOverlay:Ra(function(te,ie){var oe=te.token?te:x.getMode(this.options,te);if(oe.startState)throw new Error("Overlays may not be stateful.");_n(this.state.overlays,{mode:oe,modeSpec:te,opaque:ie&&ie.opaque,priority:ie&&ie.priority||0},function(me){return me.priority}),this.state.modeGen++,Oi(this)}),removeOverlay:Ra(function(te){for(var ie=this.state.overlays,oe=0;oe<ie.length;++oe){var me=ie[oe].modeSpec;if(me==te||typeof te=="string"&&me.name==te){ie.splice(oe,1),this.state.modeGen++,Oi(this);return}}}),indentLine:Ra(function(te,ie,oe){typeof ie!="string"&&typeof ie!="number"&&(ie==null?ie=this.options.smartIndent?"smart":"prev":ie=ie?"add":"subtract"),ar(this.doc,te)&&Rs(this,te,ie,oe)}),indentSelection:Ra(function(te){for(var ie=this.doc.sel.ranges,oe=-1,me=0;me<ie.length;me++){var we=ie[me];if(we.empty())we.head.line>oe&&(Rs(this,we.head.line,te,!0),oe=we.head.line,me==this.doc.sel.primIndex&&zo(this));else{var ke=we.from(),Oe=we.to(),lt=Math.max(oe,ke.line);oe=Math.min(this.lastLine(),Oe.line-(Oe.ch?0:1))+1;for(var Et=lt;Et<oe;++Et)Rs(this,Et,te);var on=this.doc.sel.ranges;ke.ch==0&&ie.length==on.length&&on[me].from().ch>0&&ws(this.doc,me,new Za(ke,on[me].to()),at)}}}),getTokenAt:function(te,ie){return Zi(this,te,ie)},getLineTokens:function(te,ie){return Zi(this,Qe(te),ie,!0)},getTokenTypeAt:function(te){te=Dn(this.doc,te);var ie=Li(this,Ht(this.doc,te.line)),oe=0,me=(ie.length-1)/2,we=te.ch,ke;if(we==0)ke=ie[2];else for(;;){var Oe=oe+me>>1;if((Oe?ie[Oe*2-1]:0)>=we)me=Oe;else if(ie[Oe*2+1]<we)oe=Oe+1;else{ke=ie[Oe*2+2];break}}var lt=ke?ke.indexOf("overlay "):-1;return lt<0?ke:lt==0?null:ke.slice(0,lt-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 oe=[];if(!ne.hasOwnProperty(ie))return oe;var me=ne[ie],we=this.getModeAt(te);if(typeof we[ie]=="string")me[we[ie]]&&oe.push(me[we[ie]]);else if(we[ie])for(var ke=0;ke<we[ie].length;ke++){var Oe=me[we[ie][ke]];Oe&&oe.push(Oe)}else we.helperType&&me[we.helperType]?oe.push(me[we.helperType]):me[we.name]&&oe.push(me[we.name]);for(var lt=0;lt<me._global.length;lt++){var Et=me._global[lt];Et.pred(we,this)&&$t(oe,Et.val)==-1&&oe.push(Et.val)}return oe},getStateAfter:function(te,ie){var oe=this.doc;return te=un(oe,te==null?oe.first+oe.size-1:te),pi(this,te+1,ie).state},cursorCoords:function(te,ie){var oe,me=this.doc.sel.primary();return te==null?oe=me.head:typeof te=="object"?oe=Dn(this.doc,te):oe=te?me.from():me.to(),ha(this,oe,ie||"page")},charCoords:function(te,ie){return Va(this,Dn(this.doc,te),ie||"page")},coordsChar:function(te,ie){return te=Ea(this,te,ie||"page"),Ga(this,te.left,te.top)},lineAtHeight:function(te,ie){return te=Ea(this,{top:te,left:0},ie||"page").top,rr(this.doc,te+this.display.viewOffset)},heightAtLine:function(te,ie,oe){var me=!1,we;if(typeof te=="number"){var ke=this.doc.first+this.doc.size-1;te<this.doc.first?te=this.doc.first:te>ke&&(te=ke,me=!0),we=Ht(this.doc,te)}else we=te;return wa(this,we,{top:0,left:0},ie||"page",oe||me).top+(me?this.doc.height-pn(we):0)},defaultTextHeight:function(){return Ka(this.display)},defaultCharWidth:function(){return io(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(te,ie,oe,me,we){var ke=this.display;te=ha(this,Dn(this.doc,te));var Oe=te.bottom,lt=te.left;if(ie.style.position="absolute",ie.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(ie),ke.sizer.appendChild(ie),me=="over")Oe=te.top;else if(me=="above"||me=="near"){var Et=Math.max(ke.wrapper.clientHeight,this.doc.height),on=Math.max(ke.sizer.clientWidth,ke.lineSpace.clientWidth);(me=="above"||te.bottom+ie.offsetHeight>Et)&&te.top>ie.offsetHeight?Oe=te.top-ie.offsetHeight:te.bottom+ie.offsetHeight<=Et&&(Oe=te.bottom),lt+ie.offsetWidth>on&&(lt=on-ie.offsetWidth)}ie.style.top=Oe+"px",ie.style.left=ie.style.right="",we=="right"?(lt=ke.sizer.clientWidth-ie.offsetWidth,ie.style.right="0px"):(we=="left"?lt=0:we=="middle"&&(lt=(ke.sizer.clientWidth-ie.offsetWidth)/2),ie.style.left=lt+"px"),oe&&ul(this,{left:lt,top:Oe,right:lt+ie.offsetWidth,bottom:Oe+ie.offsetHeight})},triggerOnKeyDown:Ra(Ic),triggerOnKeyPress:Ra(uf),triggerOnKeyUp:cf,triggerOnMouseDown:Ra(jo),execCommand:function(te){if(ac.hasOwnProperty(te))return ac[te].call(null,this)},triggerElectric:Ra(function(te){gd(this,te)}),findPosH:function(te,ie,oe,me){var we=1;ie<0&&(we=-1,ie=-ie);for(var ke=Dn(this.doc,te),Oe=0;Oe<ie&&(ke=Cu(this.doc,ke,we,oe,me),!ke.hitSide);++Oe);return ke},moveH:Ra(function(te,ie){var oe=this;this.extendSelectionsBy(function(me){return oe.display.shift||oe.doc.extend||me.empty()?Cu(oe.doc,me.head,te,ie,oe.options.rtlMoveVisually):te<0?me.from():me.to()},Gt)}),deleteH:Ra(function(te,ie){var oe=this.doc.sel,me=this.doc;oe.somethingSelected()?me.replaceSelection("",null,"+delete"):ks(this,function(we){var ke=Cu(me,we.head,te,ie,!1);return te<0?{from:ke,to:we.head}:{from:we.head,to:ke}})}),findPosV:function(te,ie,oe,me){var we=1,ke=me;ie<0&&(we=-1,ie=-ie);for(var Oe=Dn(this.doc,te),lt=0;lt<ie;++lt){var Et=ha(this,Oe,"div");if(ke==null?ke=Et.left:Et.left=ke,Oe=vf(this,Et,we,oe),Oe.hitSide)break}return Oe},moveV:Ra(function(te,ie){var oe=this,me=this.doc,we=[],ke=!this.display.shift&&!me.extend&&me.sel.somethingSelected();if(me.extendSelectionsBy(function(lt){if(ke)return te<0?lt.from():lt.to();var Et=ha(oe,lt.head,"div");lt.goalColumn!=null&&(Et.left=lt.goalColumn),we.push(Et.left);var on=vf(oe,Et,te,ie);return ie=="page"&&lt==me.sel.primary()&&ms(oe,Va(oe,on,"div").top-Et.top),on},Gt),we.length)for(var Oe=0;Oe<me.sel.ranges.length;Oe++)me.sel.ranges[Oe].goalColumn=we[Oe]}),findWordAt:function(te){var ie=this.doc,oe=Ht(ie,te.line).text,me=te.ch,we=te.ch;if(oe){var ke=this.getHelper(te,"wordChars");(te.sticky=="before"||we==oe.length)&&me?--me:++we;for(var Oe=oe.charAt(me),lt=ve(Oe,ke)?function(Et){return ve(Et,ke)}:/\s/.test(Oe)?function(Et){return/\s/.test(Et)}:function(Et){return!/\s/.test(Et)&&!ve(Et)};me>0&&lt(oe.charAt(me-1));)--me;for(;we<oe.length&&lt(oe.charAt(we));)++we}return new Za(Qe(te.line,me),Qe(te.line,we))},toggleOverwrite:function(te){te!=null&&te==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?xn(this.display.cursorDiv,"CodeMirror-overwrite"):Ve(this.display.cursorDiv,"CodeMirror-overwrite"),st(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==At()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ra(function(te,ie){Ts(this,te,ie)}),getScrollInfo:function(){var te=this.display.scroller;return{left:te.scrollLeft,top:te.scrollTop,height:te.scrollHeight-jr(this)-this.display.barHeight,width:te.scrollWidth-jr(this)-this.display.barWidth,clientHeight:Ti(this),clientWidth:di(this)}},scrollIntoView:Ra(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:Qe(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):oo(this,te.from,te.to,te.margin)}),setSize:Ra(function(te,ie){var oe=this,me=function(ke){return typeof ke=="number"||/^\d+$/.test(String(ke))?ke+"px":ke};te!=null&&(this.display.wrapper.style.width=me(te)),ie!=null&&(this.display.wrapper.style.height=me(ie)),this.options.lineWrapping&&ia(this);var we=this.display.viewFrom;this.doc.iter(we,this.display.viewTo,function(ke){if(ke.widgets){for(var Oe=0;Oe<ke.widgets.length;Oe++)if(ke.widgets[Oe].noHScroll){Ta(oe,we,"widget");break}}++we}),this.curOp.forceUpdate=!0,st(this,"refresh",this)}),operation:function(te){return ga(this,te)},startOperation:function(){return Ks(this)},endOperation:function(){return Is(this)},refresh:Ra(function(){var te=this.display.cachedTextHeight;Oi(this),this.curOp.forceUpdate=!0,hi(this),Ts(this,this.doc.scrollLeft,this.doc.scrollTop),Jc(this.display),(te==null||Math.abs(te-Ka(this.display))>.5||this.options.lineWrapping)&&lo(this),st(this,"refresh",this)}),swapDoc:Ra(function(te){var ie=this.doc;return ie.cm=null,this.state.selectingText&&this.state.selectingText(),wc(this,te),hi(this),this.display.input.reset(),Ts(this,te.scrollLeft,te.scrollTop),this.curOp.forceScroll=!0,Bn(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}},gr(x),x.registerHelper=function(te,ie,oe){ne.hasOwnProperty(te)||(ne[te]=x[te]={_global:[]}),ne[te][ie]=oe},x.registerGlobalHelper=function(te,ie,oe,me){x.registerHelper(te,ie,me),ne[te]._global.push({pred:oe,val:me})}}function Cu(x,z,ne,te,ie){var oe=z,me=ne,we=Ht(x,z.line),ke=ie&&x.direction=="rtl"?-ne:ne;function Oe(){var ni=z.line+ke;return ni<x.first||ni>=x.first+x.size?!1:(z=new Qe(ni,z.ch,z.sticky),we=Ht(x,ni))}function lt(ni){var Kr;if(te=="codepoint"){var ri=we.text.charCodeAt(z.ch+(te>0?0:-1));isNaN(ri)?Kr=null:Kr=new Qe(z.line,Math.max(0,Math.min(we.text.length,z.ch+ne*(ri>=55296&&ri<56320?2:1))),-ne)}else ie?Kr=Us(x.cm,we,z,ne):Kr=Ws(we,z,ne);if(Kr==null)if(!ni&&Oe())z=Kl(ie,x.cm,we,z.line,ke);else return!1;else z=Kr;return!0}if(te=="char"||te=="codepoint")lt();else if(te=="column")lt(!0);else if(te=="word"||te=="group")for(var Et=null,on=te=="group",Vt=x.cm&&x.cm.getHelper(z,"wordChars"),Xn=!0;!(ne<0&&!lt(!Xn));Xn=!1){var dr=we.text.charAt(z.ch)||`
`,Tr=ve(dr,Vt)?"w":on&&dr==`
`?"n":!on||/\s/.test(dr)?null:"p";if(on&&!Xn&&!Tr&&(Tr="s"),Et&&Et!=Tr){ne<0&&(ne=1,lt(),z.sticky="after");break}if(Tr&&(Et=Tr),ne>0&&!lt(!Xn))break}var Wr=hu(x,z,oe,me,!0);return Qt(oe,Wr)&&(Wr.hitSide=!0),Wr}function vf(x,z,ne,te){var ie=x.doc,oe=z.left,me;if(te=="page"){var we=Math.min(x.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),ke=Math.max(we-.5*Ka(x.display),3);me=(ne>0?z.bottom:z.top)+ne*ke}else te=="line"&&(me=ne>0?z.bottom+3:z.top-3);for(var Oe;Oe=Ga(x,oe,me),!!Oe.outside;){if(ne<0?me<=0:me>=ie.height){Oe.hitSide=!0;break}me+=ne*5}return Oe}var qa=function(x){this.cm=x,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ae,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};qa.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 oe(we){for(var ke=we.target;ke;ke=ke.parentNode){if(ke==ie)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(ke.className))break}return!1}Rn(ie,"paste",function(we){!oe(we)||Wt(te,we)||md(we,te)||_e<=11&&setTimeout(za(te,function(){return z.updateFromDOM()}),20)}),Rn(ie,"compositionstart",function(we){z.composing={data:we.data,done:!1}}),Rn(ie,"compositionupdate",function(we){z.composing||(z.composing={data:we.data,done:!1})}),Rn(ie,"compositionend",function(we){z.composing&&(we.data!=z.composing.data&&z.readFromDOMSoon(),z.composing.done=!0)}),Rn(ie,"touchstart",function(){return ne.forceCompositionEnd()}),Rn(ie,"input",function(){z.composing||z.readFromDOMSoon()});function me(we){if(!(!oe(we)||Wt(te,we))){if(te.somethingSelected())bl({lineWise:!1,text:te.getSelections()}),we.type=="cut"&&te.replaceSelection("",null,"cut");else if(te.options.lineWiseCopyCut){var ke=lc(te);bl({lineWise:!0,text:ke.text}),we.type=="cut"&&te.operation(function(){te.setSelections(ke.ranges,0,at),te.replaceSelection("",null,"cut")})}else return;if(we.clipboardData){we.clipboardData.clearData();var Oe=Ns.text.join(`
`);if(we.clipboardData.setData("Text",Oe),we.clipboardData.getData("Text")==Oe){we.preventDefault();return}}var lt=vd(),Et=lt.firstChild;te.display.lineSpace.insertBefore(lt,te.display.lineSpace.firstChild),Et.value=Ns.text.join(`
`);var on=document.activeElement;vn(Et),setTimeout(function(){te.display.lineSpace.removeChild(lt),on.focus(),on==ie&&ne.showPrimarySelection()},50)}}Rn(ie,"copy",me),Rn(ie,"cut",me)},qa.prototype.screenReaderLabelChanged=function(x){x?this.div.setAttribute("aria-label",x):this.div.removeAttribute("aria-label")},qa.prototype.prepareSelection=function(){var x=ps(this.cm,!1);return x.focus=document.activeElement==this.div,x},qa.prototype.showSelection=function(x,z){!x||!this.cm.display.view.length||((x.focus||z)&&this.showPrimarySelection(),this.showMultipleSelections(x))},qa.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},qa.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 oe=Mu(z,x.anchorNode,x.anchorOffset),me=Mu(z,x.focusNode,x.focusOffset);if(!(oe&&!oe.bad&&me&&!me.bad&&vt(cn(oe,me),te)==0&&vt(en(oe,me),ie)==0)){var we=z.display.view,ke=te.line>=z.display.viewFrom&&yf(z,te)||{node:we[0].measure.map[2],offset:0},Oe=ie.line<z.display.viewTo&&yf(z,ie);if(!Oe){var lt=we[we.length-1].measure,Et=lt.maps?lt.maps[lt.maps.length-1]:lt.map;Oe={node:Et[Et.length-1],offset:Et[Et.length-2]-Et[Et.length-3]}}if(!ke||!Oe){x.removeAllRanges();return}var on=x.rangeCount&&x.getRangeAt(0),Vt;try{Vt=je(ke.node,ke.offset,Oe.offset,Oe.node)}catch(Xn){}Vt&&(!fe&&z.state.focused?(x.collapse(ke.node,ke.offset),Vt.collapsed||(x.removeAllRanges(),x.addRange(Vt))):(x.removeAllRanges(),x.addRange(Vt)),on&&x.anchorNode==null?x.addRange(on):fe&&this.startGracePeriod()),this.rememberSelection()}},qa.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)},qa.prototype.showMultipleSelections=function(x){Ct(this.cm.display.cursorDiv,x.cursors),Ct(this.cm.display.selectionDiv,x.selection)},qa.prototype.rememberSelection=function(){var x=this.getSelection();this.lastAnchorNode=x.anchorNode,this.lastAnchorOffset=x.anchorOffset,this.lastFocusNode=x.focusNode,this.lastFocusOffset=x.focusOffset},qa.prototype.selectionInEditor=function(){var x=this.getSelection();if(!x.rangeCount)return!1;var z=x.getRangeAt(0).commonAncestorContainer;return Rt(this.div,z)},qa.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},qa.prototype.blur=function(){this.div.blur()},qa.prototype.getField=function(){return this.div},qa.prototype.supportsTouch=function(){return!0},qa.prototype.receivedFocus=function(){var x=this;this.selectionInEditor()?this.pollSelection():ga(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)},qa.prototype.selectionChanged=function(){var x=this.getSelection();return x.anchorNode!=this.lastAnchorNode||x.anchorOffset!=this.lastAnchorOffset||x.focusNode!=this.lastFocusNode||x.focusOffset!=this.lastFocusOffset},qa.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var x=this.getSelection(),z=this.cm;if(pt&&pe&&this.cm.display.gutterSpecs.length&&ch(x.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var ne=Mu(z,x.anchorNode,x.anchorOffset),te=Mu(z,x.focusNode,x.focusOffset);ne&&te&&ga(z,function(){To(z.doc,Ps(ne,te),at),(ne.bad||te.bad)&&(z.curOp.selectionChanged=!0)})}}},qa.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=Qe(te.line-1,Ht(x.doc,te.line-1).length)),ie.ch==Ht(x.doc,ie.line).text.length&&ie.line<x.lastLine()&&(ie=Qe(ie.line+1,0)),te.line<z.viewFrom||ie.line>z.viewTo-1)return!1;var oe,me,we;te.line==z.viewFrom||(oe=na(x,te.line))==0?(me=qn(z.view[0].line),we=z.view[0].node):(me=qn(z.view[oe].line),we=z.view[oe-1].node.nextSibling);var ke=na(x,ie.line),Oe,lt;if(ke==z.view.length-1?(Oe=z.viewTo-1,lt=z.lineDiv.lastChild):(Oe=qn(z.view[ke+1].line)-1,lt=z.view[ke+1].node.previousSibling),!we)return!1;for(var Et=x.doc.splitLines(uh(x,we,lt,me,Oe)),on=$n(x.doc,Qe(me,0),Qe(Oe,Ht(x.doc,Oe).text.length));Et.length>1&&on.length>1;)if(Ft(Et)==Ft(on))Et.pop(),on.pop(),Oe--;else if(Et[0]==on[0])Et.shift(),on.shift(),me++;else break;for(var Vt=0,Xn=0,dr=Et[0],Tr=on[0],Wr=Math.min(dr.length,Tr.length);Vt<Wr&&dr.charCodeAt(Vt)==Tr.charCodeAt(Vt);)++Vt;for(var ni=Ft(Et),Kr=Ft(on),ri=Math.min(ni.length-(Et.length==1?Vt:0),Kr.length-(on.length==1?Vt:0));Xn<ri&&ni.charCodeAt(ni.length-Xn-1)==Kr.charCodeAt(Kr.length-Xn-1);)++Xn;if(Et.length==1&&on.length==1&&me==te.line)for(;Vt&&Vt>te.ch&&ni.charCodeAt(ni.length-Xn-1)==Kr.charCodeAt(Kr.length-Xn-1);)Vt--,Xn++;Et[Et.length-1]=ni.slice(0,ni.length-Xn).replace(/^\u200b+/,""),Et[0]=Et[0].slice(Vt).replace(/\u200b+$/,"");var Fi=Qe(me,Vt),Hi=Qe(Oe,on.length?Ft(on).length-Xn:0);if(Et.length>1||Et[0]||vt(Fi,Hi))return ec(x.doc,Et,Fi,Hi,"+input"),!0},qa.prototype.ensurePolled=function(){this.forceCompositionEnd()},qa.prototype.reset=function(){this.forceCompositionEnd()},qa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},qa.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))},qa.prototype.updateFromDOM=function(){var x=this;(this.cm.isReadOnly()||!this.pollContent())&&ga(this.cm,function(){return Oi(x.cm)})},qa.prototype.setUneditable=function(x){x.contentEditable="false"},qa.prototype.onKeyPress=function(x){x.charCode==0||this.composing||(x.preventDefault(),this.cm.isReadOnly()||za(this.cm,pd)(this.cm,String.fromCharCode(x.charCode==null?x.keyCode:x.charCode),0))},qa.prototype.readOnlyChanged=function(x){this.div.contentEditable=String(x!="nocursor")},qa.prototype.onContextMenu=function(){},qa.prototype.resetPosition=function(){},qa.prototype.needsContentAttribute=!0;function yf(x,z){var ne=ca(x,z.line);if(!ne||ne.hidden)return null;var te=Ht(x.doc,z.line),ie=Ba(ne,te,z.line),oe=Fr(te,x.doc.direction),me="left";if(oe){var we=ln(oe,z.ch);me=we%2?"right":"left"}var ke=ki(ie.map,z.ch,me);return ke.offset=ke.collapse=="right"?ke.end:ke.start,ke}function ch(x){for(var z=x;z;z=z.parentNode)if(/CodeMirror-gutter-wrapper/.test(z.className))return!0;return!1}function cc(x,z){return z&&(x.bad=!0),x}function uh(x,z,ne,te,ie){var oe="",me=!1,we=x.doc.lineSeparator(),ke=!1;function Oe(Vt){return function(Xn){return Xn.id==Vt}}function lt(){me&&(oe+=we,ke&&(oe+=we),me=ke=!1)}function Et(Vt){Vt&&(lt(),oe+=Vt)}function on(Vt){if(Vt.nodeType==1){var Xn=Vt.getAttribute("cm-text");if(Xn){Et(Xn);return}var dr=Vt.getAttribute("cm-marker"),Tr;if(dr){var Wr=x.findMarks(Qe(te,0),Qe(ie+1,0),Oe(+dr));Wr.length&&(Tr=Wr[0].find(0))&&Et($n(x.doc,Tr.from,Tr.to).join(we));return}if(Vt.getAttribute("contenteditable")=="false")return;var ni=/^(pre|div|p|li|table|br)$/i.test(Vt.nodeName);if(!/^br$/i.test(Vt.nodeName)&&Vt.textContent.length==0)return;ni&&lt();for(var Kr=0;Kr<Vt.childNodes.length;Kr++)on(Vt.childNodes[Kr]);/^(pre|p)$/i.test(Vt.nodeName)&&(ke=!0),ni&&(me=!0)}else Vt.nodeType==3&&Et(Vt.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;on(z),z!=ne;)z=z.nextSibling,ke=!1;return oe}function Mu(x,z,ne){var te;if(z==x.display.lineDiv){if(te=x.display.lineDiv.childNodes[ne],!te)return cc(x.clipPos(Qe(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 oe=x.display.view[ie];if(oe.node==te)return dh(oe,z,ne)}}function dh(x,z,ne){var te=x.text.firstChild,ie=!1;if(!z||!Rt(te,z))return cc(Qe(qn(x.line),0),!0);if(z==te&&(ie=!0,z=te.childNodes[ne],ne=0,!z)){var oe=x.rest?Ft(x.rest):x.line;return cc(Qe(qn(oe),oe.text.length),ie)}var me=z.nodeType==3?z:null,we=z;for(!me&&z.childNodes.length==1&&z.firstChild.nodeType==3&&(me=z.firstChild,ne&&(ne=me.nodeValue.length));we.parentNode!=te;)we=we.parentNode;var ke=x.measure,Oe=ke.maps;function lt(Tr,Wr,ni){for(var Kr=-1;Kr<(Oe?Oe.length:0);Kr++)for(var ri=Kr<0?ke.map:Oe[Kr],Fi=0;Fi<ri.length;Fi+=3){var Hi=ri[Fi+2];if(Hi==Tr||Hi==Wr){var ba=qn(Kr<0?x.line:x.rest[Kr]),to=ri[Fi]+ni;return(ni<0||Hi!=Tr)&&(to=ri[Fi+(ni?1:0)]),Qe(ba,to)}}}var Et=lt(me,we,ne);if(Et)return cc(Et,ie);for(var on=we.nextSibling,Vt=me?me.nodeValue.length-ne:0;on;on=on.nextSibling){if(Et=lt(on,on.firstChild,0),Et)return cc(Qe(Et.line,Et.ch-Vt),ie);Vt+=on.textContent.length}for(var Xn=we.previousSibling,dr=ne;Xn;Xn=Xn.previousSibling){if(Et=lt(Xn,Xn.firstChild,-1),Et)return cc(Qe(Et.line,Et.ch+dr),ie);dr+=Xn.textContent.length}}var eo=function(x){this.cm=x,this.prevInput="",this.pollingFast=!1,this.polling=new Ae,this.hasSelection=!1,this.composing=null};eo.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),kt&&(ie.style.width="0px"),Rn(ie,"input",function(){be&&_e>=9&&z.hasSelection&&(z.hasSelection=null),ne.poll()}),Rn(ie,"paste",function(me){Wt(te,me)||md(me,te)||(te.state.pasteIncoming=+new Date,ne.fastPoll())});function oe(me){if(!Wt(te,me)){if(te.somethingSelected())bl({lineWise:!1,text:te.getSelections()});else if(te.options.lineWiseCopyCut){var we=lc(te);bl({lineWise:!0,text:we.text}),me.type=="cut"?te.setSelections(we.ranges,null,at):(ne.prevInput="",ie.value=we.text.join(`
`),vn(ie))}else return;me.type=="cut"&&(te.state.cutIncoming=+new Date)}}Rn(ie,"cut",oe),Rn(ie,"copy",oe),Rn(x.scroller,"paste",function(me){if(!(Xi(x,me)||Wt(te,me))){if(!ie.dispatchEvent){te.state.pasteIncoming=+new Date,ne.focus();return}var we=new Event("paste");we.clipboardData=me.clipboardData,ie.dispatchEvent(we)}}),Rn(x.lineSpace,"selectstart",function(me){Xi(x,me)||Pr(me)}),Rn(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"})}}),Rn(ie,"compositionend",function(){ne.composing&&(ne.poll(),ne.composing.range.clear(),ne.composing=null)})},eo.prototype.createField=function(x){this.wrapper=vd(),this.textarea=this.wrapper.firstChild},eo.prototype.screenReaderLabelChanged=function(x){x?this.textarea.setAttribute("aria-label",x):this.textarea.removeAttribute("aria-label")},eo.prototype.prepareSelection=function(){var x=this.cm,z=x.display,ne=x.doc,te=ps(x);if(x.options.moveInputWithCursor){var ie=ha(x,ne.sel.primary().head,"div"),oe=z.wrapper.getBoundingClientRect(),me=z.lineDiv.getBoundingClientRect();te.teTop=Math.max(0,Math.min(z.wrapper.clientHeight-10,ie.top+me.top-oe.top)),te.teLeft=Math.max(0,Math.min(z.wrapper.clientWidth-10,ie.left+me.left-oe.left))}return te},eo.prototype.showSelection=function(x){var z=this.cm,ne=z.display;Ct(ne.cursorDiv,x.cursors),Ct(ne.selectionDiv,x.selection),x.teTop!=null&&(this.wrapper.style.top=x.teTop+"px",this.wrapper.style.left=x.teLeft+"px")},eo.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&&vn(this.textarea),be&&_e>=9&&(this.hasSelection=ne)}else x||(this.prevInput=this.textarea.value="",be&&_e>=9&&(this.hasSelection=null))}},eo.prototype.getField=function(){return this.textarea},eo.prototype.supportsTouch=function(){return!1},eo.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!Je||At()!=this.textarea))try{this.textarea.focus()}catch(x){}},eo.prototype.blur=function(){this.textarea.blur()},eo.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},eo.prototype.receivedFocus=function(){this.slowPoll()},eo.prototype.slowPoll=function(){var x=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){x.poll(),x.cm.state.focused&&x.slowPoll()})},eo.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)},eo.prototype.poll=function(){var x=this,z=this.cm,ne=this.textarea,te=this.prevInput;if(this.contextMenuPending||!z.state.focused||Mn(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(be&&_e>=9&&this.hasSelection===ie||De&&/[\uf700-\uf7ff]/.test(ie))return z.display.input.reset(),!1;if(z.doc.sel==z.display.selForContextMenu){var oe=ie.charCodeAt(0);if(oe==8203&&!te&&(te="\u200B"),oe==8666)return this.reset(),this.cm.execCommand("undo")}for(var me=0,we=Math.min(te.length,ie.length);me<we&&te.charCodeAt(me)==ie.charCodeAt(me);)++me;return ga(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},eo.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},eo.prototype.onKeyPress=function(){be&&_e>=9&&(this.hasSelection=null),this.fastPoll()},eo.prototype.onContextMenu=function(x){var z=this,ne=z.cm,te=ne.display,ie=z.textarea;z.contextMenuPending&&z.contextMenuPending();var oe=Ao(ne,x),me=te.scroller.scrollTop;if(!oe||Te)return;var we=ne.options.resetSelectionOnContextMenu;we&&ne.doc.sel.contains(oe)==-1&&za(ne,To)(ne.doc,Ps(oe),at);var ke=ie.style.cssText,Oe=z.wrapper.style.cssText,lt=z.wrapper.offsetParent.getBoundingClientRect();z.wrapper.style.cssText="position: static",ie.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(x.clientY-lt.top-5)+"px; left: "+(x.clientX-lt.left-5)+`px;
z-index: 1000; background: `+(be?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Et;Le&&(Et=window.scrollY),te.input.focus(),Le&&window.scrollTo(null,Et),te.input.reset(),ne.somethingSelected()||(ie.value=z.prevInput=" "),z.contextMenuPending=Vt,te.selForContextMenu=ne.doc.sel,clearTimeout(te.detectingSelectAll);function on(){if(ie.selectionStart!=null){var dr=ne.somethingSelected(),Tr="\u200B"+(dr?ie.value:"");ie.value="\u21DA",ie.value=Tr,z.prevInput=dr?"":"\u200B",ie.selectionStart=1,ie.selectionEnd=Tr.length,te.selForContextMenu=ne.doc.sel}}function Vt(){if(z.contextMenuPending==Vt&&(z.contextMenuPending=!1,z.wrapper.style.cssText=Oe,ie.style.cssText=ke,be&&_e<9&&te.scrollbars.setScrollTop(te.scroller.scrollTop=me),ie.selectionStart!=null)){(!be||be&&_e<9)&&on();var dr=0,Tr=function(){te.selForContextMenu==ne.doc.sel&&ie.selectionStart==0&&ie.selectionEnd>0&&z.prevInput=="\u200B"?za(ne,td)(ne):dr++<10?te.detectingSelectAll=setTimeout(Tr,500):(te.selForContextMenu=null,te.input.reset())};te.detectingSelectAll=setTimeout(Tr,200)}}if(be&&_e>=9&&on(),Ie){qr(x);var Xn=function(){li(window,"mouseup",Xn),setTimeout(Vt,20)};Rn(window,"mouseup",Xn)}else setTimeout(Vt,50)},eo.prototype.readOnlyChanged=function(x){x||this.reset(),this.textarea.disabled=x=="nocursor",this.textarea.readOnly=!!x},eo.prototype.setUneditable=function(){},eo.prototype.needsContentAttribute=!1;function Hl(x,z){if(z=z?Sr(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=At();z.autofocus=ne==x||x.getAttribute("autofocus")!=null&&ne==document.body}function te(){x.value=we.getValue()}var ie;if(x.form&&(Rn(x.form,"submit",te),!z.leaveSubmitMethodAlone)){var oe=x.form;ie=oe.submit;try{var me=oe.submit=function(){te(),oe.submit=ie,oe.submit(),oe.submit=me}}catch(ke){}}z.finishInit=function(ke){ke.save=te,ke.getTextArea=function(){return x},ke.toTextArea=function(){ke.toTextArea=isNaN,te(),x.parentNode.removeChild(ke.getWrapperElement()),x.style.display="",x.form&&(li(x.form,"submit",te),!z.leaveSubmitMethodAlone&&typeof x.form.submit=="function"&&(x.form.submit=ie))}},x.style.display="none";var we=ra(function(ke){return x.parentNode.insertBefore(ke,x.nextSibling)},z);return we}function uc(x){x.off=li,x.on=Rn,x.wheelEventPixels=Gu,x.Doc=Eo,x.splitLines=mt,x.countColumn=qe,x.findColumn=zn,x.isWordChar=ye,x.Pass=bn,x.signal=st,x.Line=In,x.changeEnd=Js,x.scrollbarModel=ql,x.Pos=Qe,x.cmpPos=vt,x.modes=nr,x.mimeModes=pr,x.resolveMode=it,x.getMode=_t,x.modeExtensions=Ut,x.extendMode=Ke,x.copyState=ut,x.startState=Tt,x.innerMode=Ot,x.commands=ac,x.keyMap=Qa,x.keyName=zl,x.isModifierKey=Dc,x.lookupKey=rl,x.normalizeKeyMap=od,x.StringStream=zt,x.SharedTextMarker=ya,x.TextMarker=hl,x.LineWidget=nc,x.e_preventDefault=Pr,x.e_stopPropagation=Ur,x.e_stop=qr,x.addClass=xn,x.contains=Rt,x.rmClass=Ve,x.keyNames=Os}oh(ra),yd(ra);var ol="iter insert remove copy getEditor constructor".split(" ");for(var _s in Eo.prototype)Eo.prototype.hasOwnProperty(_s)&&$t(ol,_s)<0&&(ra.prototype[_s]=function(x){return function(){return x.apply(this.doc,arguments)}}(Eo.prototype[_s]));return gr(Eo),ra.inputStyles={textarea:eo,contenteditable:qa},ra.defineMode=function(x){!ra.defaults.mode&&x!="null"&&(ra.defaults.mode=x),Kn.apply(this,arguments)},ra.defineMIME=Ue,ra.defineMode("null",function(){return{token:function(x){return x.skipToEnd()}}}),ra.defineMIME("text/plain","null"),ra.defineExtension=function(x,z){ra.prototype[x]=z},ra.defineDocExtension=function(x,z){Eo.prototype[x]=z},ra.fromTextArea=Hl,uc(ra),ra.version="5.58.2",ra})},49047:function(Ln,qt,ce){(function(fe){fe(ce(4631),ce(29589),ce(52539))})(function(fe){"use strict";fe.defineMode("markdown",function(tt,Fe){var Ye=fe.getMode(tt,"text/html"),be=Ye.name=="null";function _e(qe){if(fe.findModeByName){var Ae=fe.findModeByName(qe);Ae&&(qe=Ae.mime||Ae.mimes[0])}var $t=fe.getMode(tt,qe);return $t.name=="null"?null:$t}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 Le={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 Se in Le)Le.hasOwnProperty(Se)&&Fe.tokenTypeOverrides[Se]&&(Le[Se]=Fe.tokenTypeOverrides[Se]);var pe=/^([*\-_])(?:\s*\1){2,}\s*$/,Te=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,gt=/^\[(x| )\](?=\s)/i,ze=Fe.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,Pt=/^ {0,3}(?:\={1,}|-{2,})\s*$/,kt=/^[^#!\[\]*_\\<>` "'(~:]+/,pt=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,Je=/^\s*\[[^\]]+?\]:.*$/,De=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,Dt=" ";function Yt(qe,Ae,$t){return Ae.f=Ae.inline=$t,$t(qe,Ae)}function nt(qe,Ae,$t){return Ae.f=Ae.block=$t,$t(qe,Ae)}function ct(qe){return!qe||!/\S/.test(qe.string)}function Ie(qe){if(qe.linkTitle=!1,qe.linkHref=!1,qe.linkText=!1,qe.em=!1,qe.strong=!1,qe.strikethrough=!1,qe.quote=0,qe.indentedCode=!1,qe.f==Ve){var Ae=be;if(!Ae){var $t=fe.innerMode(Ye,qe.htmlState);Ae=$t.mode.name=="xml"&&$t.state.tagStart===null&&!$t.state.context&&$t.state.tokenize.isInText}Ae&&(qe.f=Mt,qe.block=Me,qe.htmlState=null)}return qe.trailingSpace=0,qe.trailingSpaceNewLine=!1,qe.prevLine=qe.thisLine,qe.thisLine={stream:null},null}function Me(qe,Ae){var $t=qe.column()===Ae.indentation,Hn=ct(Ae.prevLine.stream),bn=Ae.indentedCode,at=Ae.prevLine.hr,ft=Ae.list!==!1,Gt=(Ae.listStack[Ae.listStack.length-1]||0)+3;Ae.indentedCode=!1;var zn=Ae.indentation;if(Ae.indentationDiff===null&&(Ae.indentationDiff=Ae.indentation,ft)){for(Ae.list=null;zn<Ae.listStack[Ae.listStack.length-1];)Ae.listStack.pop(),Ae.listStack.length?Ae.indentation=Ae.listStack[Ae.listStack.length-1]:Ae.list=!1;Ae.list!==!1&&(Ae.indentationDiff=zn-Ae.listStack[Ae.listStack.length-1])}var mn=!Hn&&!at&&!Ae.prevLine.header&&(!ft||!bn)&&!Ae.prevLine.fencedCodeEnd,nn=(Ae.list===!1||at||Hn)&&Ae.indentation<=Gt&&qe.match(pe),Ft=null;if(Ae.indentationDiff>=4&&(bn||Ae.prevLine.fencedCodeEnd||Ae.prevLine.header||Hn))return qe.skipToEnd(),Ae.indentedCode=!0,Le.code;if(qe.eatSpace())return null;if($t&&Ae.indentation<=Gt&&(Ft=qe.match(ze))&&Ft[1].length<=6)return Ae.quote=0,Ae.header=Ft[1].length,Ae.thisLine.header=!0,Fe.highlightFormatting&&(Ae.formatting="header"),Ae.f=Ae.inline,Ct(Ae);if(Ae.indentation<=Gt&&qe.eat(">"))return Ae.quote=$t?1:Ae.quote+1,Fe.highlightFormatting&&(Ae.formatting="quote"),qe.eatSpace(),Ct(Ae);if(!nn&&!Ae.setext&&$t&&Ae.indentation<=Gt&&(Ft=qe.match(Te))){var Pn=Ft[1]?"ol":"ul";return Ae.indentation=zn+qe.current().length,Ae.list=!0,Ae.quote=0,Ae.listStack.push(Ae.indentation),Ae.em=!1,Ae.strong=!1,Ae.code=!1,Ae.strikethrough=!1,Fe.taskLists&&qe.match(gt,!1)&&(Ae.taskList=!0),Ae.f=Ae.inline,Fe.highlightFormatting&&(Ae.formatting=["list","list-"+Pn]),Ct(Ae)}else{if($t&&Ae.indentation<=Gt&&(Ft=qe.match(pt,!0)))return Ae.quote=0,Ae.fencedEndRE=new RegExp(Ft[1]+"+ *$"),Ae.localMode=Fe.fencedCodeBlockHighlighting&&_e(Ft[2]||Fe.fencedCodeBlockDefaultMode),Ae.localMode&&(Ae.localState=fe.startState(Ae.localMode)),Ae.f=Ae.block=Xe,Fe.highlightFormatting&&(Ae.formatting="code-block"),Ae.code=-1,Ct(Ae);if(Ae.setext||(!mn||!ft)&&!Ae.quote&&Ae.list===!1&&!Ae.code&&!nn&&!Je.test(qe.string)&&(Ft=qe.lookAhead(1))&&(Ft=Ft.match(Pt)))return Ae.setext?(Ae.header=Ae.setext,Ae.setext=0,qe.skipToEnd(),Fe.highlightFormatting&&(Ae.formatting="header")):(Ae.header=Ft[0].charAt(0)=="="?1:2,Ae.setext=Ae.header),Ae.thisLine.header=!0,Ae.f=Ae.inline,Ct(Ae);if(nn)return qe.skipToEnd(),Ae.hr=!0,Ae.thisLine.hr=!0,Le.hr;if(qe.peek()==="[")return Yt(qe,Ae,jt)}return Yt(qe,Ae,Ae.inline)}function Ve(qe,Ae){var $t=Ye.token(qe,Ae.htmlState);if(!be){var Hn=fe.innerMode(Ye,Ae.htmlState);(Hn.mode.name=="xml"&&Hn.state.tagStart===null&&!Hn.state.context&&Hn.state.tokenize.isInText||Ae.md_inside&&qe.current().indexOf(">")>-1)&&(Ae.f=Mt,Ae.block=Me,Ae.htmlState=null)}return $t}function Xe(qe,Ae){var $t=Ae.listStack[Ae.listStack.length-1]||0,Hn=Ae.indentation<$t,bn=$t+3;if(Ae.fencedEndRE&&Ae.indentation<=bn&&(Hn||qe.match(Ae.fencedEndRE))){Fe.highlightFormatting&&(Ae.formatting="code-block");var at;return Hn||(at=Ct(Ae)),Ae.localMode=Ae.localState=null,Ae.block=Me,Ae.f=Mt,Ae.fencedEndRE=null,Ae.code=0,Ae.thisLine.fencedCodeEnd=!0,Hn?nt(qe,Ae,Ae.block):at}else return Ae.localMode?Ae.localMode.token(qe,Ae.localState):(qe.skipToEnd(),Le.code)}function Ct(qe){var Ae=[];if(qe.formatting){Ae.push(Le.formatting),typeof qe.formatting=="string"&&(qe.formatting=[qe.formatting]);for(var $t=0;$t<qe.formatting.length;$t++)Ae.push(Le.formatting+"-"+qe.formatting[$t]),qe.formatting[$t]==="header"&&Ae.push(Le.formatting+"-"+qe.formatting[$t]+"-"+qe.header),qe.formatting[$t]==="quote"&&(!Fe.maxBlockquoteDepth||Fe.maxBlockquoteDepth>=qe.quote?Ae.push(Le.formatting+"-"+qe.formatting[$t]+"-"+qe.quote):Ae.push("error"))}if(qe.taskOpen)return Ae.push("meta"),Ae.length?Ae.join(" "):null;if(qe.taskClosed)return Ae.push("property"),Ae.length?Ae.join(" "):null;if(qe.linkHref?Ae.push(Le.linkHref,"url"):(qe.strong&&Ae.push(Le.strong),qe.em&&Ae.push(Le.em),qe.strikethrough&&Ae.push(Le.strikethrough),qe.emoji&&Ae.push(Le.emoji),qe.linkText&&Ae.push(Le.linkText),qe.code&&Ae.push(Le.code),qe.image&&Ae.push(Le.image),qe.imageAltText&&Ae.push(Le.imageAltText,"link"),qe.imageMarker&&Ae.push(Le.imageMarker)),qe.header&&Ae.push(Le.header,Le.header+"-"+qe.header),qe.quote&&(Ae.push(Le.quote),!Fe.maxBlockquoteDepth||Fe.maxBlockquoteDepth>=qe.quote?Ae.push(Le.quote+"-"+qe.quote):Ae.push(Le.quote+"-"+Fe.maxBlockquoteDepth)),qe.list!==!1){var Hn=(qe.listStack.length-1)%3;Hn?Hn===1?Ae.push(Le.list2):Ae.push(Le.list3):Ae.push(Le.list1)}return qe.trailingSpaceNewLine?Ae.push("trailing-space-new-line"):qe.trailingSpace&&Ae.push("trailing-space-"+(qe.trailingSpace%2?"a":"b")),Ae.length?Ae.join(" "):null}function wt(qe,Ae){if(qe.match(kt,!0))return Ct(Ae)}function Mt(qe,Ae){var $t=Ae.text(qe,Ae);if(typeof $t!="undefined")return $t;if(Ae.list)return Ae.list=null,Ct(Ae);if(Ae.taskList){var Hn=qe.match(gt,!0)[1]===" ";return Hn?Ae.taskOpen=!0:Ae.taskClosed=!0,Fe.highlightFormatting&&(Ae.formatting="task"),Ae.taskList=!1,Ct(Ae)}if(Ae.taskOpen=!1,Ae.taskClosed=!1,Ae.header&&qe.match(/^#+$/,!0))return Fe.highlightFormatting&&(Ae.formatting="header"),Ct(Ae);var bn=qe.next();if(Ae.linkTitle){Ae.linkTitle=!1;var at=bn;bn==="("&&(at=")"),at=(at+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ft="^\\s*(?:[^"+at+"\\\\]+|\\\\\\\\|\\\\.)"+at;if(qe.match(new RegExp(ft),!0))return Le.linkHref}if(bn==="`"){var Gt=Ae.formatting;Fe.highlightFormatting&&(Ae.formatting="code"),qe.eatWhile("`");var zn=qe.current().length;if(Ae.code==0&&(!Ae.quote||zn==1))return Ae.code=zn,Ct(Ae);if(zn==Ae.code){var mn=Ct(Ae);return Ae.code=0,mn}else return Ae.formatting=Gt,Ct(Ae)}else if(Ae.code)return Ct(Ae);if(bn==="\\"&&(qe.next(),Fe.highlightFormatting)){var nn=Ct(Ae),Ft=Le.formatting+"-escape";return nn?nn+" "+Ft:Ft}if(bn==="!"&&qe.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return Ae.imageMarker=!0,Ae.image=!0,Fe.highlightFormatting&&(Ae.formatting="image"),Ct(Ae);if(bn==="["&&Ae.imageMarker&&qe.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return Ae.imageMarker=!1,Ae.imageAltText=!0,Fe.highlightFormatting&&(Ae.formatting="image"),Ct(Ae);if(bn==="]"&&Ae.imageAltText){Fe.highlightFormatting&&(Ae.formatting="image");var nn=Ct(Ae);return Ae.imageAltText=!1,Ae.image=!1,Ae.inline=Ae.f=Rt,nn}if(bn==="["&&!Ae.image)return Ae.linkText&&qe.match(/^.*?\]/)||(Ae.linkText=!0,Fe.highlightFormatting&&(Ae.formatting="link")),Ct(Ae);if(bn==="]"&&Ae.linkText){Fe.highlightFormatting&&(Ae.formatting="link");var nn=Ct(Ae);return Ae.linkText=!1,Ae.inline=Ae.f=qe.match(/\(.*?\)| ?\[.*?\]/,!1)?Rt:Mt,nn}if(bn==="<"&&qe.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){Ae.f=Ae.inline=je,Fe.highlightFormatting&&(Ae.formatting="link");var nn=Ct(Ae);return nn?nn+=" ":nn="",nn+Le.linkInline}if(bn==="<"&&qe.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){Ae.f=Ae.inline=je,Fe.highlightFormatting&&(Ae.formatting="link");var nn=Ct(Ae);return nn?nn+=" ":nn="",nn+Le.linkEmail}if(Fe.xml&&bn==="<"&&qe.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Pn=qe.string.indexOf(">",qe.pos);if(Pn!=-1){var _n=qe.string.substring(qe.start,Pn);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(_n)&&(Ae.md_inside=!0)}return qe.backUp(1),Ae.htmlState=fe.startState(Ye),nt(qe,Ae,Ve)}if(Fe.xml&&bn==="<"&&qe.match(/^\/\w*?>/))return Ae.md_inside=!1,"tag";if(bn==="*"||bn==="_"){for(var Ee=1,ue=qe.pos==1?" ":qe.string.charAt(qe.pos-2);Ee<3&&qe.eat(bn);)Ee++;var se=qe.peek()||" ",ye=!/\s/.test(se)&&(!De.test(se)||/\s/.test(ue)||De.test(ue)),ve=!/\s/.test(ue)&&(!De.test(ue)||/\s/.test(se)||De.test(se)),le=null,We=null;if(Ee%2&&(!Ae.em&&ye&&(bn==="*"||!ve||De.test(ue))?le=!0:Ae.em==bn&&ve&&(bn==="*"||!ye||De.test(se))&&(le=!1)),Ee>1&&(!Ae.strong&&ye&&(bn==="*"||!ve||De.test(ue))?We=!0:Ae.strong==bn&&ve&&(bn==="*"||!ye||De.test(se))&&(We=!1)),We!=null||le!=null){Fe.highlightFormatting&&(Ae.formatting=le==null?"strong":We==null?"em":"strong em"),le===!0&&(Ae.em=bn),We===!0&&(Ae.strong=bn);var mn=Ct(Ae);return le===!1&&(Ae.em=!1),We===!1&&(Ae.strong=!1),mn}}else if(bn===" "&&(qe.eat("*")||qe.eat("_"))){if(qe.peek()===" ")return Ct(Ae);qe.backUp(1)}if(Fe.strikethrough){if(bn==="~"&&qe.eatWhile(bn)){if(Ae.strikethrough){Fe.highlightFormatting&&(Ae.formatting="strikethrough");var mn=Ct(Ae);return Ae.strikethrough=!1,mn}else if(qe.match(/^[^\s]/,!1))return Ae.strikethrough=!0,Fe.highlightFormatting&&(Ae.formatting="strikethrough"),Ct(Ae)}else if(bn===" "&&qe.match(/^~~/,!0)){if(qe.peek()===" ")return Ct(Ae);qe.backUp(2)}}if(Fe.emoji&&bn===":"&&qe.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){Ae.emoji=!0,Fe.highlightFormatting&&(Ae.formatting="emoji");var Lt=Ct(Ae);return Ae.emoji=!1,Lt}return bn===" "&&(qe.match(/^ +$/,!1)?Ae.trailingSpace++:Ae.trailingSpace&&(Ae.trailingSpaceNewLine=!0)),Ct(Ae)}function je(qe,Ae){var $t=qe.next();if($t===">"){Ae.f=Ae.inline=Mt,Fe.highlightFormatting&&(Ae.formatting="link");var Hn=Ct(Ae);return Hn?Hn+=" ":Hn="",Hn+Le.linkInline}return qe.match(/^[^>]+/,!0),Le.linkInline}function Rt(qe,Ae){if(qe.eatSpace())return null;var $t=qe.next();return $t==="("||$t==="["?(Ae.f=Ae.inline=xn($t==="("?")":"]"),Fe.highlightFormatting&&(Ae.formatting="link-string"),Ae.linkHref=!0,Ct(Ae)):"error"}var At={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function xn(qe){return function(Ae,$t){var Hn=Ae.next();if(Hn===qe){$t.f=$t.inline=Mt,Fe.highlightFormatting&&($t.formatting="link-string");var bn=Ct($t);return $t.linkHref=!1,bn}return Ae.match(At[qe]),$t.linkHref=!0,Ct($t)}}function jt(qe,Ae){return qe.match(/^([^\]\\]|\\.)*\]:/,!1)?(Ae.f=vn,qe.next(),Fe.highlightFormatting&&(Ae.formatting="link"),Ae.linkText=!0,Ct(Ae)):Yt(qe,Ae,Mt)}function vn(qe,Ae){if(qe.match(/^\]:/,!0)){Ae.f=Ae.inline=er,Fe.highlightFormatting&&(Ae.formatting="link");var $t=Ct(Ae);return Ae.linkText=!1,$t}return qe.match(/^([^\]\\]|\\.)+/,!0),Le.linkText}function er(qe,Ae){return qe.eatSpace()?null:(qe.match(/^[^\s]+/,!0),qe.peek()===void 0?Ae.linkTitle=!0:qe.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),Ae.f=Ae.inline=Mt,Le.linkHref+" url")}var Sr={startState:function(){return{f:Me,prevLine:{stream:null},thisLine:{stream:null},block:Me,htmlState:null,indentation:0,inline:Mt,text:wt,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(qe){return{f:qe.f,prevLine:qe.prevLine,thisLine:qe.thisLine,block:qe.block,htmlState:qe.htmlState&&fe.copyState(Ye,qe.htmlState),indentation:qe.indentation,localMode:qe.localMode,localState:qe.localMode?fe.copyState(qe.localMode,qe.localState):null,inline:qe.inline,text:qe.text,formatting:!1,linkText:qe.linkText,linkTitle:qe.linkTitle,linkHref:qe.linkHref,code:qe.code,em:qe.em,strong:qe.strong,strikethrough:qe.strikethrough,emoji:qe.emoji,header:qe.header,setext:qe.setext,hr:qe.hr,taskList:qe.taskList,list:qe.list,listStack:qe.listStack.slice(0),quote:qe.quote,indentedCode:qe.indentedCode,trailingSpace:qe.trailingSpace,trailingSpaceNewLine:qe.trailingSpaceNewLine,md_inside:qe.md_inside,fencedEndRE:qe.fencedEndRE}},token:function(qe,Ae){if(Ae.formatting=!1,qe!=Ae.thisLine.stream){if(Ae.header=0,Ae.hr=!1,qe.match(/^\s*$/,!0))return Ie(Ae),null;if(Ae.prevLine=Ae.thisLine,Ae.thisLine={stream:qe},Ae.taskList=!1,Ae.trailingSpace=0,Ae.trailingSpaceNewLine=!1,!Ae.localState&&(Ae.f=Ae.block,Ae.f!=Ve)){var $t=qe.match(/^\s*/,!0)[0].replace(/\t/g,Dt).length;if(Ae.indentation=$t,Ae.indentationDiff=null,$t>0)return null}}return Ae.f(qe,Ae)},innerMode:function(qe){return qe.block==Ve?{state:qe.htmlState,mode:Ye}:qe.localState?{state:qe.localState,mode:qe.localMode}:{state:qe,mode:Sr}},indent:function(qe,Ae,$t){return qe.block==Ve&&Ye.indent?Ye.indent(qe.htmlState,Ae,$t):qe.localState&&qe.localMode.indent?qe.localMode.indent(qe.localState,Ae,$t):fe.Pass},blankLine:Ie,getType:Ct,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Sr},"xml"),fe.defineMIME("text/markdown","markdown"),fe.defineMIME("text/x-markdown","markdown")})},52539:function(Ln,qt,ce){(function(fe){fe(ce(4631))})(function(fe){"use strict";fe.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<fe.modeInfo.length;tt++){var Fe=fe.modeInfo[tt];Fe.mimes&&(Fe.mime=Fe.mimes[0])}fe.findModeByMIME=function(Ye){Ye=Ye.toLowerCase();for(var be=0;be<fe.modeInfo.length;be++){var _e=fe.modeInfo[be];if(_e.mime==Ye)return _e;if(_e.mimes){for(var Le=0;Le<_e.mimes.length;Le++)if(_e.mimes[Le]==Ye)return _e}}if(/\+xml$/.test(Ye))return fe.findModeByMIME("application/xml");if(/\+json$/.test(Ye))return fe.findModeByMIME("application/json")},fe.findModeByExtension=function(Ye){Ye=Ye.toLowerCase();for(var be=0;be<fe.modeInfo.length;be++){var _e=fe.modeInfo[be];if(_e.ext){for(var Le=0;Le<_e.ext.length;Le++)if(_e.ext[Le]==Ye)return _e}}},fe.findModeByFileName=function(Ye){for(var be=0;be<fe.modeInfo.length;be++){var _e=fe.modeInfo[be];if(_e.file&&_e.file.test(Ye))return _e}var Le=Ye.lastIndexOf("."),Se=Le>-1&&Ye.substring(Le+1,Ye.length);if(Se)return fe.findModeByExtension(Se)},fe.findModeByName=function(Ye){Ye=Ye.toLowerCase();for(var be=0;be<fe.modeInfo.length;be++){var _e=fe.modeInfo[be];if(_e.name.toLowerCase()==Ye)return _e;if(_e.alias){for(var Le=0;Le<_e.alias.length;Le++)if(_e.alias[Le].toLowerCase()==Ye)return _e}}}})},80785:function(Ln,qt,ce){(function(fe){fe(ce(4631))})(function(fe){"use strict";fe.defineMode("stex",function(tt,Fe){"use strict";function Ye(kt,pt){kt.cmdState.push(pt)}function be(kt){return kt.cmdState.length>0?kt.cmdState[kt.cmdState.length-1]:null}function _e(kt){var pt=kt.cmdState.pop();pt&&pt.closeBracket()}function Le(kt){for(var pt=kt.cmdState,Je=pt.length-1;Je>=0;Je--){var De=pt[Je];if(De.name!="DEFAULT")return De}return{styleIdentifier:function(){return null}}}function Se(kt,pt,Je){return function(){this.name=kt,this.bracketNo=0,this.style=pt,this.styles=Je,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var pe={};pe.importmodule=Se("importmodule","tag",["string","builtin"]),pe.documentclass=Se("documentclass","tag",["","atom"]),pe.usepackage=Se("usepackage","tag",["atom"]),pe.begin=Se("begin","tag",["atom"]),pe.end=Se("end","tag",["atom"]),pe.label=Se("label","tag",["atom"]),pe.ref=Se("ref","tag",["atom"]),pe.eqref=Se("eqref","tag",["atom"]),pe.cite=Se("cite","tag",["atom"]),pe.bibitem=Se("bibitem","tag",["atom"]),pe.Bibitem=Se("Bibitem","tag",["atom"]),pe.RBibitem=Se("RBibitem","tag",["atom"]),pe.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function Te(kt,pt){kt.f=pt}function gt(kt,pt){var Je;if(kt.match(/^\\[a-zA-Z@]+/)){var De=kt.current().slice(1);return Je=pe.hasOwnProperty(De)?pe[De]:pe.DEFAULT,Je=new Je,Ye(pt,Je),Te(pt,Pt),Je.style}if(kt.match(/^\\[$&%#{}_]/)||kt.match(/^\\[,;!\/\\]/))return"tag";if(kt.match("\\["))return Te(pt,function(Yt,nt){return ze(Yt,nt,"\\]")}),"keyword";if(kt.match("\\("))return Te(pt,function(Yt,nt){return ze(Yt,nt,"\\)")}),"keyword";if(kt.match("$$"))return Te(pt,function(Yt,nt){return ze(Yt,nt,"$$")}),"keyword";if(kt.match("$"))return Te(pt,function(Yt,nt){return ze(Yt,nt,"$")}),"keyword";var Dt=kt.next();if(Dt=="%")return kt.skipToEnd(),"comment";if(Dt=="}"||Dt=="]"){if(Je=be(pt),Je)Je.closeBracket(Dt),Te(pt,Pt);else return"error";return"bracket"}else return Dt=="{"||Dt=="["?(Je=pe.DEFAULT,Je=new Je,Ye(pt,Je),"bracket"):/\d/.test(Dt)?(kt.eatWhile(/[\w.%]/),"atom"):(kt.eatWhile(/[\w\-_]/),Je=Le(pt),Je.name=="begin"&&(Je.argument=kt.current()),Je.styleIdentifier())}function ze(kt,pt,Je){if(kt.eatSpace())return null;if(Je&&kt.match(Je))return Te(pt,gt),"keyword";if(kt.match(/^\\[a-zA-Z@]+/))return"tag";if(kt.match(/^[a-zA-Z]+/))return"variable-2";if(kt.match(/^\\[$&%#{}_]/)||kt.match(/^\\[,;!\/]/)||kt.match(/^[\^_&]/))return"tag";if(kt.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(kt.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var De=kt.next();return De=="{"||De=="}"||De=="["||De=="]"||De=="("||De==")"?"bracket":De=="%"?(kt.skipToEnd(),"comment"):"error"}function Pt(kt,pt){var Je=kt.peek(),De;return Je=="{"||Je=="["?(De=be(pt),De.openBracket(Je),kt.eat(Je),Te(pt,gt),"bracket"):/[ \t\r]/.test(Je)?(kt.eat(Je),null):(Te(pt,gt),_e(pt),gt(kt,pt))}return{startState:function(){var kt=Fe.inMathMode?function(pt,Je){return ze(pt,Je)}:gt;return{cmdState:[],f:kt}},copyState:function(kt){return{cmdState:kt.cmdState.slice(),f:kt.f}},token:function(kt,pt){return pt.f(kt,pt)},blankLine:function(kt){kt.f=gt,kt.cmdState.length=0},lineComment:"%"}}),fe.defineMIME("text/x-stex","stex"),fe.defineMIME("text/x-latex","stex")})},29589:function(Ln,qt,ce){(function(fe){fe(ce(4631))})(function(fe){"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};fe.defineMode("xml",function(Ye,be){var _e=Ye.indentUnit,Le={},Se=be.htmlMode?tt:Fe;for(var pe in Se)Le[pe]=Se[pe];for(var pe in be)Le[pe]=be[pe];var Te,gt;function ze(je,Rt){function At(vn){return Rt.tokenize=vn,vn(je,Rt)}var xn=je.next();if(xn=="<")return je.eat("!")?je.eat("[")?je.match("CDATA[")?At(pt("atom","]]>")):null:je.match("--")?At(pt("comment","-->")):je.match("DOCTYPE",!0,!0)?(je.eatWhile(/[\w\._\-]/),At(Je(1))):null:je.eat("?")?(je.eatWhile(/[\w\._\-]/),Rt.tokenize=pt("meta","?>"),"meta"):(Te=je.eat("/")?"closeTag":"openTag",Rt.tokenize=Pt,"tag bracket");if(xn=="&"){var jt;return je.eat("#")?je.eat("x")?jt=je.eatWhile(/[a-fA-F\d]/)&&je.eat(";"):jt=je.eatWhile(/[\d]/)&&je.eat(";"):jt=je.eatWhile(/[\w\.\-:]/)&&je.eat(";"),jt?"atom":"error"}else return je.eatWhile(/[^&<]/),null}ze.isInText=!0;function Pt(je,Rt){var At=je.next();if(At==">"||At=="/"&&je.eat(">"))return Rt.tokenize=ze,Te=At==">"?"endTag":"selfcloseTag","tag bracket";if(At=="=")return Te="equals",null;if(At=="<"){Rt.tokenize=ze,Rt.state=nt,Rt.tagName=Rt.tagStart=null;var xn=Rt.tokenize(je,Rt);return xn?xn+" tag error":"tag error"}else return/[\'\"]/.test(At)?(Rt.tokenize=kt(At),Rt.stringStartCol=je.column(),Rt.tokenize(je,Rt)):(je.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function kt(je){var Rt=function(At,xn){for(;!At.eol();)if(At.next()==je){xn.tokenize=Pt;break}return"string"};return Rt.isInAttribute=!0,Rt}function pt(je,Rt){return function(At,xn){for(;!At.eol();){if(At.match(Rt)){xn.tokenize=ze;break}At.next()}return je}}function Je(je){return function(Rt,At){for(var xn;(xn=Rt.next())!=null;){if(xn=="<")return At.tokenize=Je(je+1),At.tokenize(Rt,At);if(xn==">")if(je==1){At.tokenize=ze;break}else return At.tokenize=Je(je-1),At.tokenize(Rt,At)}return"meta"}}function De(je,Rt,At){this.prev=je.context,this.tagName=Rt,this.indent=je.indented,this.startOfLine=At,(Le.doNotIndent.hasOwnProperty(Rt)||je.context&&je.context.noIndent)&&(this.noIndent=!0)}function Dt(je){je.context&&(je.context=je.context.prev)}function Yt(je,Rt){for(var At;;){if(!je.context||(At=je.context.tagName,!Le.contextGrabbers.hasOwnProperty(At)||!Le.contextGrabbers[At].hasOwnProperty(Rt)))return;Dt(je)}}function nt(je,Rt,At){return je=="openTag"?(At.tagStart=Rt.column(),ct):je=="closeTag"?Ie:nt}function ct(je,Rt,At){return je=="word"?(At.tagName=Rt.current(),gt="tag",Xe):Le.allowMissingTagName&&je=="endTag"?(gt="tag bracket",Xe(je,Rt,At)):(gt="error",ct)}function Ie(je,Rt,At){if(je=="word"){var xn=Rt.current();return At.context&&At.context.tagName!=xn&&Le.implicitlyClosed.hasOwnProperty(At.context.tagName)&&Dt(At),At.context&&At.context.tagName==xn||Le.matchClosing===!1?(gt="tag",Me):(gt="tag error",Ve)}else return Le.allowMissingTagName&&je=="endTag"?(gt="tag bracket",Me(je,Rt,At)):(gt="error",Ve)}function Me(je,Rt,At){return je!="endTag"?(gt="error",Me):(Dt(At),nt)}function Ve(je,Rt,At){return gt="error",Me(je,Rt,At)}function Xe(je,Rt,At){if(je=="word")return gt="attribute",Ct;if(je=="endTag"||je=="selfcloseTag"){var xn=At.tagName,jt=At.tagStart;return At.tagName=At.tagStart=null,je=="selfcloseTag"||Le.autoSelfClosers.hasOwnProperty(xn)?Yt(At,xn):(Yt(At,xn),At.context=new De(At,xn,jt==At.indented)),nt}return gt="error",Xe}function Ct(je,Rt,At){return je=="equals"?wt:(Le.allowMissing||(gt="error"),Xe(je,Rt,At))}function wt(je,Rt,At){return je=="string"?Mt:je=="word"&&Le.allowUnquoted?(gt="string",Xe):(gt="error",Xe(je,Rt,At))}function Mt(je,Rt,At){return je=="string"?Mt:Xe(je,Rt,At)}return{startState:function(je){var Rt={tokenize:ze,state:nt,indented:je||0,tagName:null,tagStart:null,context:null};return je!=null&&(Rt.baseIndent=je),Rt},token:function(je,Rt){if(!Rt.tagName&&je.sol()&&(Rt.indented=je.indentation()),je.eatSpace())return null;Te=null;var At=Rt.tokenize(je,Rt);return(At||Te)&&At!="comment"&&(gt=null,Rt.state=Rt.state(Te||At,je,Rt),gt&&(At=gt=="error"?At+" error":gt)),At},indent:function(je,Rt,At){var xn=je.context;if(je.tokenize.isInAttribute)return je.tagStart==je.indented?je.stringStartCol+1:je.indented+_e;if(xn&&xn.noIndent)return fe.Pass;if(je.tokenize!=Pt&&je.tokenize!=ze)return At?At.match(/^(\s*)/)[0].length:0;if(je.tagName)return Le.multilineTagIndentPastTag!==!1?je.tagStart+je.tagName.length+2:je.tagStart+_e*(Le.multilineTagIndentFactor||1);if(Le.alignCDATA&&/<!\[CDATA\[/.test(Rt))return 0;var jt=Rt&&/^<(\/)?([\w_:\.-]*)/.exec(Rt);if(jt&&jt[1])for(;xn;)if(xn.tagName==jt[2]){xn=xn.prev;break}else if(Le.implicitlyClosed.hasOwnProperty(xn.tagName))xn=xn.prev;else break;else if(jt)for(;xn;){var vn=Le.contextGrabbers[xn.tagName];if(vn&&vn.hasOwnProperty(jt[2]))xn=xn.prev;else break}for(;xn&&xn.prev&&!xn.startOfLine;)xn=xn.prev;return xn?xn.indent+_e:je.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:Le.htmlMode?"html":"xml",helperType:Le.htmlMode?"html":"xml",skipAttribute:function(je){je.state==wt&&(je.state=Xe)},xmlCurrentTag:function(je){return je.tagName?{name:je.tagName,close:je.type=="closeTag"}:null},xmlCurrentContext:function(je){for(var Rt=[],At=je.context;At;At=At.prev)At.tagName&&Rt.push(At.tagName);return Rt.reverse()}}}),fe.defineMIME("text/xml","xml"),fe.defineMIME("application/xml","xml"),fe.mimeModes.hasOwnProperty("text/html")||fe.defineMIME("text/html",{name:"xml",htmlMode:!0})})},15979:function(Ln,qt,ce){"use strict";ce.d(qt,{hP:function(){return _n}});var fe=function(Ee,ue){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(se,ye){se.__proto__=ye}||function(se,ye){for(var ve in ye)Object.prototype.hasOwnProperty.call(ye,ve)&&(se[ve]=ye[ve])})(Ee,ue)};function tt(Ee,ue){function se(){this.constructor=Ee}fe(Ee,ue),Ee.prototype=ue===null?Object.create(ue):(se.prototype=ue.prototype,new se)}function Fe(Ee,ue,se,ye){return new(se||(se=Promise))(function(ve,le){function We(hn){try{tn(ye.next(hn))}catch(sn){le(sn)}}function Lt(hn){try{tn(ye.throw(hn))}catch(sn){le(sn)}}function tn(hn){var sn;hn.done?ve(hn.value):(sn=hn.value,sn instanceof se?sn:new se(function(yn){yn(sn)})).then(We,Lt)}tn((ye=ye.apply(Ee,ue||[])).next())})}function Ye(Ee,ue){var se,ye,ve,le,We={label:0,sent:function(){if(1&ve[0])throw ve[1];return ve[1]},trys:[],ops:[]};return le={next:Lt(0),throw:Lt(1),return:Lt(2)},typeof Symbol=="function"&&(le[Symbol.iterator]=function(){return this}),le;function Lt(tn){return function(hn){return function(sn){if(se)throw new TypeError("Generator is already executing.");for(;We;)try{if(se=1,ye&&(ve=2&sn[0]?ye.return:sn[0]?ye.throw||((ve=ye.return)&&ve.call(ye),0):ye.next)&&!(ve=ve.call(ye,sn[1])).done)return ve;switch(ye=0,ve&&(sn=[2&sn[0],ve.value]),sn[0]){case 0:case 1:ve=sn;break;case 4:return We.label++,{value:sn[1],done:!1};case 5:We.label++,ye=sn[1],sn=[0];continue;case 7:sn=We.ops.pop(),We.trys.pop();continue;default:if(ve=We.trys,!((ve=ve.length>0&&ve[ve.length-1])||sn[0]!==6&&sn[0]!==2)){We=0;continue}if(sn[0]===3&&(!ve||sn[1]>ve[0]&&sn[1]<ve[3])){We.label=sn[1];break}if(sn[0]===6&&We.label<ve[1]){We.label=ve[1],ve=sn;break}if(ve&&We.label<ve[2]){We.label=ve[2],We.ops.push(sn);break}ve[2]&&We.ops.pop(),We.trys.pop();continue}sn=ue.call(Ee,We)}catch(yn){sn=[6,yn],ye=0}finally{se=ve=0}if(5&sn[0])throw sn[1];return{value:sn[0]?sn[1]:void 0,done:!0}}([tn,hn])}}}function be(){for(var Ee=0,ue=0,se=arguments.length;ue<se;ue++)Ee+=arguments[ue].length;var ye=Array(Ee),ve=0;for(ue=0;ue<se;ue++)for(var le=arguments[ue],We=0,Lt=le.length;We<Lt;We++,ve++)ye[ve]=le[We];return ye}var _e=function(){function Ee(){}return Ee.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Ee.setAttributes=function(ue,se){for(var ye=0,ve=se;ye<ve.length;ye++){var le=ve[ye],We=le[0],Lt=le[1];ue.setAttribute(We,Lt)}},Ee.createRect=function(ue,se,ye){var ve=document.createElementNS("http://www.w3.org/2000/svg","rect");return ve.setAttribute("width",ue.toString()),ve.setAttribute("height",se.toString()),ye&&Ee.setAttributes(ve,ye),ve},Ee.createLine=function(ue,se,ye,ve,le){var We=document.createElementNS("http://www.w3.org/2000/svg","line");return We.setAttribute("x1",ue.toString()),We.setAttribute("y1",se.toString()),We.setAttribute("x2",ye.toString()),We.setAttribute("y2",ve.toString()),le&&Ee.setAttributes(We,le),We},Ee.createPolygon=function(ue,se){var ye=document.createElementNS("http://www.w3.org/2000/svg","polygon");return ye.setAttribute("points",ue),se&&Ee.setAttributes(ye,se),ye},Ee.createCircle=function(ue,se){var ye=document.createElementNS("http://www.w3.org/2000/svg","circle");return ye.setAttribute("cx",(ue/2).toString()),ye.setAttribute("cy",(ue/2).toString()),ye.setAttribute("r",ue.toString()),se&&Ee.setAttributes(ye,se),ye},Ee.createEllipse=function(ue,se,ye){var ve=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ve.setAttribute("cx",(ue/2).toString()),ve.setAttribute("cy",(se/2).toString()),ve.setAttribute("rx",(ue/2).toString()),ve.setAttribute("ry",(se/2).toString()),ye&&Ee.setAttributes(ve,ye),ve},Ee.createGroup=function(ue){var se=document.createElementNS("http://www.w3.org/2000/svg","g");return ue&&Ee.setAttributes(se,ue),se},Ee.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Ee.createMarker=function(ue,se,ye,ve,le,We,Lt){var tn=document.createElementNS("http://www.w3.org/2000/svg","marker");return Ee.setAttributes(tn,[["id",ue],["orient",se],["markerWidth",ye.toString()],["markerHeight",ve.toString()],["refX",le.toString()],["refY",We.toString()]]),tn.appendChild(Lt),tn},Ee.createText=function(ue){var se=document.createElementNS("http://www.w3.org/2000/svg","text");return se.setAttribute("x","0"),se.setAttribute("y","0"),ue&&Ee.setAttributes(se,ue),se},Ee.createTSpan=function(ue,se){var ye=document.createElementNS("http://www.w3.org/2000/svg","tspan");return ye.textContent=ue,se&&Ee.setAttributes(ye,se),ye},Ee.createImage=function(ue){var se=document.createElementNS("http://www.w3.org/2000/svg","image");return ue&&Ee.setAttributes(se,ue),se},Ee.createPoint=function(ue,se){var ye=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return ye.x=ue,ye.y=se,ye},Ee.createPath=function(ue,se){var ye=document.createElementNS("http://www.w3.org/2000/svg","path");return ye.setAttribute("d",ue),se&&Ee.setAttributes(ye,se),ye},Ee}(),Le=function(){function Ee(){}return Ee.addKey=function(ue){Ee.key=ue},Object.defineProperty(Ee,"isLicensed",{get:function(){return!!Ee.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Ee.key)},enumerable:!1,configurable:!0}),Ee}(),Se=function(){function Ee(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Ee.prototype.rasterize=function(ue,se,ye){var ve=this;return new Promise(function(le){var We=ye!==void 0?ye:document.createElement("canvas");ue===null&&(ve.markersOnly=!0,ve.naturalSize=!1);var Lt=document.createElementNS("http://www.w3.org/2000/svg","svg");Lt.setAttribute("xmlns","http://www.w3.org/2000/svg"),Lt.setAttribute("width",se.width.baseVal.valueAsString),Lt.setAttribute("height",se.height.baseVal.valueAsString),Lt.setAttribute("viewBox","0 0 "+se.viewBox.baseVal.width.toString()+" "+se.viewBox.baseVal.height.toString()),Lt.innerHTML=se.innerHTML,ve.naturalSize===!0?(Lt.width.baseVal.value=ue.naturalWidth,Lt.height.baseVal.value=ue.naturalHeight):ve.width!==void 0&&ve.height!==void 0&&(Lt.width.baseVal.value=ve.width,Lt.height.baseVal.value=ve.height),We.width=Lt.width.baseVal.value,We.height=Lt.height.baseVal.value;var tn=Lt.outerHTML,hn=We.getContext("2d");ve.markersOnly!==!0&&hn.drawImage(ue,0,0,We.width,We.height);var sn=window.URL,yn=new Image(We.width,We.height);yn.setAttribute("crossOrigin","anonymous");var ln=new Blob([tn],{type:"image/svg+xml"}),yr=sn.createObjectURL(ln);yn.onload=function(){hn.drawImage(yn,0,0),sn.revokeObjectURL(yr);var Fr=We.toDataURL(ve.imageType,ve.imageQuality);le(Fr)},yn.src=yr})},Ee}(),pe=function(){},Te=function(){function Ee(ue){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+ue+"_"}return Object.defineProperty(Ee.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.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(Ee.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Ee.prototype.addClass=function(ue){return this.styleSheet===void 0&&this.addStyleSheet(),ue.name=""+this.classNamePrefix+ue.localName,this.classes.push(ue),this.styleSheet.sheet.insertRule("."+ue.name+" {"+ue.style+"}",this.styleSheet.sheet.cssRules.length),ue},Ee.prototype.addRule=function(ue){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(ue),this.styleSheet.sheet.insertRule(ue.selector+" {"+ue.style+"}",this.styleSheet.sheet.cssRules.length)},Ee.prototype.addStyleSheet=function(){var ue;this.styleSheet=document.createElement("style"),((ue=this.styleSheetRoot)!==null&&ue!==void 0?ue:document.head).appendChild(this.styleSheet),this.addRule(new gt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new gt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new gt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new ze("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new ze("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},Ee.prototype.removeStyleSheet=function(){var ue;this.styleSheet&&(((ue=this.styleSheetRoot)!==null&&ue!==void 0?ue:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Ee}(),gt=function(Ee,ue){this.selector=Ee,this.style=ue},ze=function(Ee,ue){this.localName=Ee,this.style=ue},Pt=function(){function Ee(ue,se,ye,ve,le){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=ue,this.displayMode=se,this.markerItems=ye,this.uiStyleSettings=ve,this.styles=le,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Ee.prototype.show=function(ue){var se=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=ue,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var ye=document.createElement("div");ye.className=this.toolbarBlockStyleClass.name,ye.style.whiteSpace="nowrap",this.uiContainer.appendChild(ye),this.addActionButton(ye,'<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(ye,'<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(ye,'<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(ye,'<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(ye,'<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(ye,'<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(ye,'<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(ye,'<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(le){var We=document.createElement("div");We.className=""+se.toolbarButtonStyleClass.name,We.setAttribute("data-type-name",le.typeName),We.innerHTML=le.icon,We.addEventListener("click",function(){se.markerToolbarButtonClicked(We,le)}),se.buttons.push(We),se.markerButtons.push(We)}),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 ve=document.createElement("div");ve.className=this.toolbarBlockStyleClass.name,ve.style.whiteSpace="nowrap",ve.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ve),this.addActionButton(ve,'<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(ve,'<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()},Ee.prototype.addButtonClickListener=function(ue){this.buttonClickListeners.push(ue)},Ee.prototype.removeButtonClickListener=function(ue){this.buttonClickListeners.indexOf(ue)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(ue),1)},Ee.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Ee.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var ue=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var se=0;se<this.markerButtons.length;se++)se<ue||se===ue&&this.markerButtons.length-1===ue?this.markerButtonBlock.appendChild(this.markerButtons[se]):(se===ue&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[se]))}},Ee.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")},Ee.prototype.resetButtonStyles=function(){var ue=this;this.buttons.forEach(function(se){se.className=se.className.replace(ue.uiStyleSettings.toolbarButtonStyleColorsClassName?ue.uiStyleSettings.toolbarButtonStyleColorsClassName:ue.toolbarButtonStyleColorsClass.name,"").trim(),se.className=se.className.replace(ue.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?ue.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:ue.toolbarActiveButtonStyleColorsClass.name,"").trim(),se.className+=" "+(ue.uiStyleSettings.toolbarButtonStyleColorsClassName?ue.uiStyleSettings.toolbarButtonStyleColorsClassName:ue.toolbarButtonStyleColorsClass.name)})},Ee.prototype.addActionButton=function(ue,se,ye){var ve=this,le=document.createElement("div");switch(le.className=""+this.toolbarButtonStyleClass.name,le.innerHTML=se,le.setAttribute("data-action",ye),le.addEventListener("click",function(){ve.actionToolbarButtonClicked(le,ye)}),ye){case"select":le.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":le.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":le.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":le.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":le.style.fill=this.uiStyleSettings.closeButtonColor}ue.appendChild(le),this.buttons.push(le)},Ee.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ze("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 ze("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ze("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ze("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 ze("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var ue=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ze("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*ue)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*ue)+`px;
padding: `+ue+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ze("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ze("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new gt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new gt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},Ee.prototype.markerToolbarButtonClicked=function(ue,se){this.setActiveButton(ue),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ye){return ye("marker",se)}),this.markerButtonOverflowBlock.style.display="none"},Ee.prototype.actionToolbarButtonClicked=function(ue,se){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ye){return ye("action",se)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Ee.prototype.setActiveButton=function(ue){this.resetButtonStyles(),ue.className=ue.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),ue.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Ee.prototype.setActiveMarkerButton=function(ue){var se=this.markerButtons.find(function(ye){return ye.getAttribute("data-type-name")===ue});se&&this.setActiveButton(se)},Ee.prototype.setCurrentMarker=function(ue){var se=this;this.currentMarker=ue,this.buttons.filter(function(ye){return/delete|notes/.test(ye.getAttribute("data-action"))}).forEach(function(ye){se.currentMarker===void 0?(ye.style.fillOpacity="0.4",ye.style.pointerEvents="none"):(ye.style.fillOpacity="1",ye.style.pointerEvents="all")})},Ee}(),kt=function(){function Ee(ue,se,ye,ve){this.panels=[],this.panelButtons=[],this.markerjsContainer=ue,this.displayMode=se,this.uiStyleSettings=ye,this.styles=ve,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Ee.prototype.addStyles=function(){var ue;this.toolboxStyleClass=this.styles.addClass(new ze("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 ze("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var se=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ze("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ze("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ze("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 ze("toolbox-panel-row_colors",`
background-color: `+((ue=this.uiStyleSettings.toolboxBackgroundColor)!==null&&ue!==void 0?ue:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ze("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*se)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*se)+`px;
padding: `+se+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ze("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ze("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new gt("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new gt("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},Ee.prototype.show=function(ue){var se;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=ue,this.uiContainer.className=this.toolboxStyleClass.name+" "+((se=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&se!==void 0?se:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Ee.prototype.setPanelButtons=function(ue){var se,ye,ve=this;this.panels=ue,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((se=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&se!==void 0?se:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((ye=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&ye!==void 0?ye:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(le){var We;le.uiStyleSettings=ve.uiStyleSettings;var Lt=document.createElement("div");Lt.className=ve.toolboxButtonStyleClass.name+" "+((We=ve.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&We!==void 0?We:ve.toolboxButtonStyleColorsClass.name),Lt.innerHTML=le.icon,Lt.title=le.title,Lt.addEventListener("click",function(){ve.panelButtonClick(le)}),ve.panelButtons.push(Lt),ve.buttonRow.appendChild(Lt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Ee.prototype.panelButtonClick=function(ue){var se=this,ye=-1;if(ue!==this.activePanel){ye=this.panels.indexOf(ue),this.panelRow.innerHTML="";var ve=ue.getUi();ve.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ve),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=ue}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){se.displayMode==="inline"?se.panelRow.style.display="none":se.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(le,We){var Lt,tn;le.className=se.toolboxButtonStyleClass.name+" "+(We===ye?""+((Lt=se.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Lt!==void 0?Lt:se.toolboxActiveButtonStyleColorsClass.name):""+((tn=se.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&tn!==void 0?tn:se.toolboxButtonStyleColorsClass.name))})},Ee}(),pt=function(Ee,ue){this.title=Ee,this.icon=ue},Je=function(Ee){function ue(se,ye,ve,le){var We=Ee.call(this,se,le||'<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 We.colors=[],We.addTransparent=!1,We.colorBoxes=[],We.colors=ye,We.currentColor=ve,We.setCurrentColor=We.setCurrentColor.bind(We),We.getColorBox=We.getColorBox.bind(We),We}return tt(ue,Ee),ue.prototype.getUi=function(){var se=this,ye=document.createElement("div");return ye.style.overflow="hidden",ye.style.whiteSpace="nowrap",this.colors.forEach(function(ve){var le=se.getColorBox(ve);ye.appendChild(le),se.colorBoxes.push(le)}),ye},ue.prototype.getColorBox=function(se){var ye=this,ve=this.uiStyleSettings.toolbarHeight/4,le=this.uiStyleSettings.toolbarHeight-ve,We=document.createElement("div");We.style.display="inline-block",We.style.boxSizing="content-box",We.style.width=le-2+"px",We.style.height=le-2+"px",We.style.padding="1px",We.style.marginRight="2px",We.style.marginBottom="2px",We.style.borderWidth="2px",We.style.borderStyle="solid",We.style.borderRadius=(le+2)/2+"px",We.style.borderColor=se===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",We.addEventListener("click",function(){ye.setCurrentColor(se,We)});var Lt=document.createElement("div");return Lt.style.display="inline-block",Lt.style.width=le-2+"px",Lt.style.height=le-2+"px",Lt.style.backgroundColor=se,Lt.style.borderRadius=le/2+"px",se==="transparent"&&(Lt.style.fill=this.uiStyleSettings.toolboxAccentColor,Lt.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>`),We.appendChild(Lt),We},ue.prototype.setCurrentColor=function(se,ye){var ve=this;this.currentColor=se,this.colorBoxes.forEach(function(le){le.style.borderColor=le===ye?ve.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(se)},ue}(pt),De=function(){function Ee(ue,se,ye){this._state="new",this._isSelected=!1,this._container=ue,this._overlayContainer=se,this.globalSettings=ye,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Ee.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Ee.prototype.ownsTarget=function(ue){return!1},Object.defineProperty(Ee.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Ee.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Ee.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Ee.prototype.pointerDown=function(ue,se){},Ee.prototype.dblClick=function(ue,se){},Ee.prototype.manipulate=function(ue){},Ee.prototype.pointerUp=function(ue){this.stateChanged()},Ee.prototype.dispose=function(){},Ee.prototype.addMarkerVisualToContainer=function(ue){this.container.childNodes.length>0?this.container.insertBefore(ue,this.container.childNodes[0]):this.container.appendChild(ue)},Ee.prototype.getState=function(){return{typeName:Ee.typeName,state:this.state,notes:this.notes}},Ee.prototype.restoreState=function(ue){this._state=ue.state,this.notes=ue.notes},Ee.prototype.scale=function(ue,se){},Ee.prototype.colorChanged=function(ue){this.onColorChanged&&this.onColorChanged(ue),this.stateChanged()},Ee.prototype.fillColorChanged=function(ue){this.onFillColorChanged&&this.onFillColorChanged(ue),this.stateChanged()},Ee.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var ue=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),ue.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(ue)&&this.onStateChanged(this)}},Ee.typeName="MarkerBase",Ee}(),Dt=function(){function Ee(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Ee.prototype.findGripByVisual=function(ue){return this.topLeft.ownsTarget(ue)?this.topLeft:this.topCenter.ownsTarget(ue)?this.topCenter:this.topRight.ownsTarget(ue)?this.topRight:this.centerLeft.ownsTarget(ue)?this.centerLeft:this.centerRight.ownsTarget(ue)?this.centerRight:this.bottomLeft.ownsTarget(ue)?this.bottomLeft:this.bottomCenter.ownsTarget(ue)?this.bottomCenter:this.bottomRight.ownsTarget(ue)?this.bottomRight:void 0},Ee}(),Yt=function(){function Ee(){this.GRIP_SIZE=10,this.visual=_e.createGroup(),this.visual.appendChild(_e.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(_e.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Ee.prototype.ownsTarget=function(ue){return ue===this.visual||ue===this.visual.childNodes[0]||ue===this.visual.childNodes[1]},Ee}(),nt=function(){function Ee(){}return Ee.toITransformMatrix=function(ue){return{a:ue.a,b:ue.b,c:ue.c,d:ue.d,e:ue.e,f:ue.f}},Ee.toSVGMatrix=function(ue,se){return ue.a=se.a,ue.b=se.b,ue.c=se.c,ue.d=se.d,ue.e=se.e,ue.f=se.f,ue},Ee}(),ct=function(Ee){function ue(se,ye,ve){var le=Ee.call(this,se,ye,ve)||this;return le.left=0,le.top=0,le.width=0,le.height=0,le.defaultSize={x:50,y:20},le.offsetX=0,le.offsetY=0,le.rotationAngle=0,le.CB_DISTANCE=10,le._suppressMarkerCreateEvent=!1,le.container.transform.baseVal.appendItem(_e.createTransform()),le.setupControlBox(),le}return tt(ue,Ee),Object.defineProperty(ue.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(ue.prototype,"visual",{get:function(){return this._visual},set:function(se){this._visual=se;var ye=_e.createTransform();this._visual.transform.baseVal.appendItem(ye)},enumerable:!1,configurable:!0}),ue.prototype.ownsTarget=function(se){return!!Ee.prototype.ownsTarget.call(this,se)||!!(this.controlGrips.findGripByVisual(se)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(se))},ue.prototype.pointerDown=function(se,ye){Ee.prototype.pointerDown.call(this,se,ye),this.state==="new"&&(this.left=se.x,this.top=se.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ve=this.unrotatePoint(se);if(this.manipulationStartX=ve.x,this.manipulationStartY=ve.y,this.offsetX=ve.x-this.left,this.offsetY=ve.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(ye),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(ye)){this.activeGrip=this.rotatorGrip;var le=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=le.x-this.width/2,this.top=le.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var We=this.container.transform.baseVal.getItem(0);We.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(We,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},ue.prototype.pointerUp=function(se){var ye=this.state;Ee.prototype.pointerUp.call(this,se),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(se),this._state="select",ye==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},ue.prototype.moveVisual=function(se){this.visual.style.transform="translate("+se.x+"px, "+se.y+"px)"},ue.prototype.manipulate=function(se){var ye=this.unrotatePoint(se);this.state==="creating"?this.resize(se):this.state==="move"?(this.left=this.manipulationStartLeft+(ye.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(ye.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(ye):this.state==="rotate"&&this.rotate(se)},ue.prototype.resize=function(se){var ye=this.manipulationStartLeft,ve=this.manipulationStartWidth,le=this.manipulationStartTop,We=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:ye=this.manipulationStartLeft+se.x-this.manipulationStartX,ve=this.manipulationStartWidth+this.manipulationStartLeft-ye;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ve=this.manipulationStartWidth+se.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:le=this.manipulationStartTop+se.y-this.manipulationStartY,We=this.manipulationStartHeight+this.manipulationStartTop-le;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:We=this.manipulationStartHeight+se.y-this.manipulationStartY}ve>=0?(this.left=ye,this.width=ve):(this.left=ye+ve,this.width=-ve),We>=0?(this.top=le,this.height=We):(this.top=le+We,this.height=-We),this.setSize()},ue.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},ue.prototype.rotate=function(se){if(Math.abs(se.x-this.centerX)>.1){var ye=Math.sign(se.x-this.centerX);this.rotationAngle=180*Math.atan((se.y-this.centerY)/(se.x-this.centerX))/Math.PI+90*ye,this.applyRotation()}},ue.prototype.applyRotation=function(){var se=this.container.transform.baseVal.getItem(0);se.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(se,0)},ue.prototype.rotatePoint=function(se){if(this.rotationAngle===0)return se;var ye=this.container.getCTM(),ve=_e.createPoint(se.x,se.y);return{x:(ve=ve.matrixTransform(ye)).x,y:ve.y}},ue.prototype.unrotatePoint=function(se){if(this.rotationAngle===0)return se;var ye=this.container.getCTM();ye=ye.inverse();var ve=_e.createPoint(se.x,se.y);return{x:(ve=ve.matrixTransform(ye)).x,y:ve.y}},ue.prototype.select=function(){Ee.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},ue.prototype.deselect=function(){Ee.prototype.deselect.call(this),this.controlBox.style.display="none"},ue.prototype.setupControlBox=function(){this.controlBox=_e.createGroup();var se=_e.createTransform();se.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(se),this.container.appendChild(this.controlBox),this.controlRect=_e.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=_e.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 Dt,this.addControlGrips(),this.controlBox.style.display="none"},ue.prototype.adjustControlBox=function(){var se=this.controlBox.transform.baseVal.getItem(0);se.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(se,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()},ue.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()},ue.prototype.createGrip=function(){var se=new Yt;return se.visual.transform.baseVal.appendItem(_e.createTransform()),this.controlBox.appendChild(se.visual),se},ue.prototype.positionGrips=function(){var se=this.controlGrips.topLeft.GRIP_SIZE,ye=-se/2,ve=ye,le=(this.width+this.CB_DISTANCE)/2-se/2,We=(this.height+this.CB_DISTANCE)/2-se/2,Lt=this.height+this.CB_DISTANCE-se/2,tn=this.width+this.CB_DISTANCE-se/2;this.positionGrip(this.controlGrips.topLeft.visual,ye,ve),this.positionGrip(this.controlGrips.topCenter.visual,le,ve),this.positionGrip(this.controlGrips.topRight.visual,tn,ve),this.positionGrip(this.controlGrips.centerLeft.visual,ye,We),this.positionGrip(this.controlGrips.centerRight.visual,tn,We),this.positionGrip(this.controlGrips.bottomLeft.visual,ye,Lt),this.positionGrip(this.controlGrips.bottomCenter.visual,le,Lt),this.positionGrip(this.controlGrips.bottomRight.visual,tn,Lt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,le,ve-3*this.CB_DISTANCE)},ue.prototype.positionGrip=function(se,ye,ve){var le=se.transform.baseVal.getItem(0);le.setTranslate(ye,ve),se.transform.baseVal.replaceItem(le,0)},ue.prototype.hideControlBox=function(){this.controlBox.style.display="none"},ue.prototype.showControlBox=function(){this.controlBox.style.display=""},ue.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:nt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:nt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Ee.prototype.getState.call(this))},ue.prototype.restoreState=function(se){Ee.prototype.restoreState.call(this,se);var ye=se;this.left=ye.left,this.top=ye.top,this.width=ye.width,this.height=ye.height,this.rotationAngle=ye.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(nt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,ye.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(nt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,ye.containerTransformMatrix))},ue.prototype.scale=function(se,ye){Ee.prototype.scale.call(this,se,ye);var ve=this.rotatePoint({x:this.left,y:this.top}),le=this.unrotatePoint({x:ve.x*se,y:ve.y*ye});this.left=le.x,this.top=le.y,this.width=this.width*se,this.height=this.height*ye,this.adjustControlBox()},ue}(De),Ie=function(Ee){function ue(se,ye,ve){var le=Ee.call(this,se,ye,ve)||this;return le.fillColor="transparent",le.strokeColor="transparent",le.strokeWidth=0,le.strokeDasharray="",le.opacity=1,le.setStrokeColor=le.setStrokeColor.bind(le),le.setFillColor=le.setFillColor.bind(le),le.setStrokeWidth=le.setStrokeWidth.bind(le),le.setStrokeDasharray=le.setStrokeDasharray.bind(le),le.createVisual=le.createVisual.bind(le),le}return tt(ue,Ee),ue.prototype.ownsTarget=function(se){return!(!Ee.prototype.ownsTarget.call(this,se)&&se!==this.visual)},ue.prototype.createVisual=function(){this.visual=_e.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)},ue.prototype.pointerDown=function(se,ye){Ee.prototype.pointerDown.call(this,se,ye),this.state==="new"&&(this.createVisual(),this.moveVisual(se),this._state="creating")},ue.prototype.manipulate=function(se){Ee.prototype.manipulate.call(this,se)},ue.prototype.resize=function(se){Ee.prototype.resize.call(this,se),this.setSize()},ue.prototype.setSize=function(){Ee.prototype.setSize.call(this),_e.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},ue.prototype.pointerUp=function(se){Ee.prototype.pointerUp.call(this,se),this.setSize()},ue.prototype.setStrokeColor=function(se){this.strokeColor=se,this.visual&&_e.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(se),this.stateChanged()},ue.prototype.setFillColor=function(se){this.fillColor=se,this.visual&&_e.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},ue.prototype.setStrokeWidth=function(se){this.strokeWidth=se,this.visual&&_e.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},ue.prototype.setStrokeDasharray=function(se){this.strokeDasharray=se,this.visual&&_e.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},ue.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Ee.prototype.getState.call(this))},ue.prototype.restoreState=function(se){var ye=se;this.fillColor=ye.fillColor,this.strokeColor=ye.strokeColor,this.strokeWidth=ye.strokeWidth,this.strokeDasharray=ye.strokeDasharray,this.opacity=ye.opacity,this.createVisual(),Ee.prototype.restoreState.call(this,se),this.setSize()},ue.prototype.scale=function(se,ye){Ee.prototype.scale.call(this,se,ye),this.setSize()},ue.title="Rectangle marker",ue}(ct),Me=function(Ee){function ue(se,ye,ve,le){var We=Ee.call(this,se,le||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return We.widths=[],We.widthBoxes=[],We.widths=ye,We.currentWidth=ve,We.setCurrentWidth=We.setCurrentWidth.bind(We),We}return tt(ue,Ee),ue.prototype.getUi=function(){var se=this,ye=document.createElement("div");return ye.style.display="flex",ye.style.overflow="hidden",ye.style.flexGrow="2",this.widths.forEach(function(ve){var le=document.createElement("div");le.style.display="flex",le.style.flexGrow="2",le.style.alignItems="center",le.style.justifyContent="space-between",le.style.padding="5px",le.style.borderWidth="2px",le.style.borderStyle="solid",le.style.borderColor=ve===se.currentWidth?se.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){se.setCurrentWidth(ve,le)}),ye.appendChild(le);var We=document.createElement("div");We.innerText=ve.toString(),We.style.marginRight="5px",le.appendChild(We);var Lt=document.createElement("div");Lt.style.minHeight="20px",Lt.style.flexGrow="2",Lt.style.display="flex",Lt.style.alignItems="center";var tn=document.createElement("hr");tn.style.minWidth="20px",tn.style.border="0px",tn.style.borderTop=ve+"px solid "+se.uiStyleSettings.toolboxColor,tn.style.flexGrow="2",Lt.appendChild(tn),le.appendChild(Lt),se.widthBoxes.push(le)}),ye},ue.prototype.setCurrentWidth=function(se,ye){var ve=this;this.currentWidth=se,this.widthBoxes.forEach(function(le){le.style.borderColor=le===ye?ve.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},ue}(pt),Ve=function(Ee){function ue(se,ye,ve,le){var We=Ee.call(this,se,le||'<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 We.styles=[],We.styleBoxes=[],We.styles=ye,We.currentStyle=ve,We.setCurrentStyle=We.setCurrentStyle.bind(We),We}return tt(ue,Ee),ue.prototype.getUi=function(){var se=this,ye=document.createElement("div");return ye.style.display="flex",ye.style.overflow="hidden",ye.style.flexGrow="2",this.styles.forEach(function(ve){var le=document.createElement("div");le.style.display="flex",le.style.alignItems="center",le.style.justifyContent="space-between",le.style.padding="5px",le.style.borderWidth="2px",le.style.borderStyle="solid",le.style.overflow="hidden",le.style.maxWidth=100/se.styles.length-5+"%",le.style.borderColor=ve===se.currentStyle?se.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){se.setCurrentStyle(ve,le)}),ye.appendChild(le);var We=document.createElement("div");We.style.minHeight="20px",We.style.flexGrow="2",We.style.overflow="hidden";var Lt=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+se.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ve!==""?'stroke-dasharray="'+ve+'"':"")+` />
</svg>`;We.innerHTML=Lt,le.appendChild(We),se.styleBoxes.push(le)}),ye},ue.prototype.setCurrentStyle=function(se,ye){var ve=this;this.currentStyle=se,this.styleBoxes.forEach(function(le){le.style.borderColor=le===ye?ve.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},ue}(pt),Xe=function(Ee){function ue(se,ye,ve){var le=Ee.call(this,se,ye,ve)||this;return le.strokeColor=ve.defaultColor,le.strokeWidth=ve.defaultStrokeWidth,le.strokeDasharray=ve.defaultStrokeDasharray,le.strokePanel=new Je("Line color",ve.defaultColorSet,ve.defaultColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.strokeWidthPanel=new Me("Line width",ve.defaultStrokeWidths,ve.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new Ve("Line style",ve.defaultStrokeDasharrays,ve.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le}return tt(ue,Ee),Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var se=Ee.prototype.getState.call(this);return se.typeName=ue.typeName,se},ue.typeName="FrameMarker",ue.title="Frame marker",ue.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',ue}(Ie),Ct=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"},wt=function(Ee){function ue(se,ye,ve){var le=Ee.call(this,se,ye,ve)||this;return le.x1=0,le.y1=0,le.x2=0,le.y2=0,le.defaultLength=50,le.manipulationStartX=0,le.manipulationStartY=0,le.manipulationStartX1=0,le.manipulationStartY1=0,le.manipulationStartX2=0,le.manipulationStartY2=0,le.setupControlBox(),le}return tt(ue,Ee),ue.prototype.ownsTarget=function(se){return!!Ee.prototype.ownsTarget.call(this,se)||!(!this.grip1.ownsTarget(se)&&!this.grip2.ownsTarget(se))},ue.prototype.pointerDown=function(se,ye){Ee.prototype.pointerDown.call(this,se,ye),this.manipulationStartX=se.x,this.manipulationStartY=se.y,this.state==="new"&&(this.x1=se.x,this.y1=se.y,this.x2=se.x,this.y2=se.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(ye)?this.activeGrip=this.grip1:this.grip2.ownsTarget(ye)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},ue.prototype.pointerUp=function(se){var ye=this.state;Ee.prototype.pointerUp.call(this,se),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(se),this._state="select",ye==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},ue.prototype.adjustVisual=function(){},ue.prototype.manipulate=function(se){this.state==="creating"?this.resize(se):this.state==="move"?(this.x1=this.manipulationStartX1+se.x-this.manipulationStartX,this.y1=this.manipulationStartY1+se.y-this.manipulationStartY,this.x2=this.manipulationStartX2+se.x-this.manipulationStartX,this.y2=this.manipulationStartY2+se.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(se)},ue.prototype.resize=function(se){switch(this.activeGrip){case this.grip1:this.x1=se.x,this.y1=se.y;break;case this.grip2:case void 0:this.x2=se.x,this.y2=se.y}this.adjustVisual(),this.adjustControlBox()},ue.prototype.select=function(){Ee.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},ue.prototype.deselect=function(){Ee.prototype.deselect.call(this),this.controlBox.style.display="none"},ue.prototype.setupControlBox=function(){this.controlBox=_e.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},ue.prototype.adjustControlBox=function(){this.positionGrips()},ue.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},ue.prototype.createGrip=function(){var se=new Yt;return se.visual.transform.baseVal.appendItem(_e.createTransform()),this.controlBox.appendChild(se.visual),se},ue.prototype.positionGrips=function(){var se=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-se/2,this.y1-se/2),this.positionGrip(this.grip2.visual,this.x2-se/2,this.y2-se/2)},ue.prototype.positionGrip=function(se,ye,ve){var le=se.transform.baseVal.getItem(0);le.setTranslate(ye,ve),se.transform.baseVal.replaceItem(le,0)},ue.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Ee.prototype.getState.call(this))},ue.prototype.restoreState=function(se){Ee.prototype.restoreState.call(this,se);var ye=se;this.x1=ye.x1,this.y1=ye.y1,this.x2=ye.x2,this.y2=ye.y2},ue.prototype.scale=function(se,ye){Ee.prototype.scale.call(this,se,ye),this.x1=this.x1*se,this.y1=this.y1*ye,this.x2=this.x2*se,this.y2=this.y2*ye,this.adjustVisual(),this.adjustControlBox()},ue}(De),Mt=function(Ee){function ue(se,ye,ve){var le=Ee.call(this,se,ye,ve)||this;return le.strokeColor="transparent",le.strokeWidth=0,le.strokeDasharray="",le.setStrokeColor=le.setStrokeColor.bind(le),le.setStrokeWidth=le.setStrokeWidth.bind(le),le.setStrokeDasharray=le.setStrokeDasharray.bind(le),le.strokeColor=ve.defaultColor,le.strokeWidth=ve.defaultStrokeWidth,le.strokeDasharray=ve.defaultStrokeDasharray,le.strokePanel=new Je("Line color",ve.defaultColorSet,ve.defaultColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.strokeWidthPanel=new Me("Line width",ve.defaultStrokeWidths,ve.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new Ve("Line style",ve.defaultStrokeDasharrays,ve.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le}return tt(ue,Ee),ue.prototype.ownsTarget=function(se){return!(!Ee.prototype.ownsTarget.call(this,se)&&se!==this.visual&&se!==this.selectorLine&&se!==this.visibleLine)},ue.prototype.createVisual=function(){this.visual=_e.createGroup(),this.selectorLine=_e.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=_e.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)},ue.prototype.pointerDown=function(se,ye){Ee.prototype.pointerDown.call(this,se,ye),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},ue.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()),_e.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),_e.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),_e.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},ue.prototype.setStrokeColor=function(se){this.strokeColor=se,this.adjustVisual(),this.colorChanged(se)},ue.prototype.setStrokeWidth=function(se){this.strokeWidth=se,this.adjustVisual()},ue.prototype.setStrokeDasharray=function(se){this.strokeDasharray=se,this.adjustVisual(),this.stateChanged()},Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var se=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Ee.prototype.getState.call(this));return se.typeName=ue.typeName,se},ue.prototype.restoreState=function(se){Ee.prototype.restoreState.call(this,se);var ye=se;this.strokeColor=ye.strokeColor,this.strokeWidth=ye.strokeWidth,this.strokeDasharray=ye.strokeDasharray,this.createVisual(),this.adjustVisual()},ue.typeName="LineMarker",ue.title="Line marker",ue.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',ue}(wt),je=function(Ee){function ue(se,ye,ve,le){var We=Ee.call(this,se,le||'<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 We.fonts=[],We.fontBoxes=[],We.fonts=ye,We.currentFont=ve,We.setCurrentFont=We.setCurrentFont.bind(We),We}return tt(ue,Ee),ue.prototype.getUi=function(){var se=this,ye=document.createElement("div");return ye.style.overflow="hidden",ye.style.flexGrow="2",this.fonts.forEach(function(ve){var le=document.createElement("div");le.style.display="inline-block",le.style.alignItems="center",le.style.justifyContent="space-between",le.style.padding="5px",le.style.borderWidth="2px",le.style.borderStyle="solid",le.style.overflow="hidden",le.style.maxWidth=100/se.fonts.length-5+"%",le.style.borderColor=ve===se.currentFont?se.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){se.setCurrentFont(ve,le)}),ye.appendChild(le);var We=document.createElement("div");We.style.display="flex",We.style.minHeight="20px",We.style.flexGrow="2",We.style.fontFamily=ve,We.style.overflow="hidden";var Lt=document.createElement("div");Lt.style.whiteSpace="nowrap",Lt.style.overflow="hidden",Lt.style.textOverflow="ellipsis",Lt.innerHTML="The quick brown fox jumps over the lazy dog",We.appendChild(Lt),le.appendChild(We),se.fontBoxes.push(le)}),ye},ue.prototype.setCurrentFont=function(se,ye){var ve=this;this.currentFont=se,this.fontBoxes.forEach(function(le){le.style.borderColor=le===ye?ve.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},ue}(pt),Rt=function(Ee){function ue(se,ye,ve){var le=Ee.call(this,se,ye,ve)||this;return le.color="transparent",le.padding=5,le.DEFAULT_TEXT="\u8BF7\u8F93\u5165\u6587\u672C",le.text=le.DEFAULT_TEXT,le.isMoved=!1,le.color=ve.defaultColor,le.fontFamily=ve.defaultFontFamily,le.defaultSize={x:100,y:30},le.setColor=le.setColor.bind(le),le.setFont=le.setFont.bind(le),le.renderText=le.renderText.bind(le),le.sizeText=le.sizeText.bind(le),le.textEditDivClicked=le.textEditDivClicked.bind(le),le.showTextEditor=le.showTextEditor.bind(le),le.setSize=le.setSize.bind(le),le.positionTextEditor=le.positionTextEditor.bind(le),le.colorPanel=new Je("Color",ve.defaultColorSet,ve.defaultColor),le.colorPanel.onColorChanged=le.setColor,le.fontFamilyPanel=new je("Font",ve.defaultFontFamilies,ve.defaultFontFamily),le.fontFamilyPanel.onFontChanged=le.setFont,le}return tt(ue,Ee),ue.prototype.ownsTarget=function(se){if(Ee.prototype.ownsTarget.call(this,se)||se===this.visual||se===this.textElement||se===this.bgRectangle)return!0;var ye=!1;return this.textElement.childNodes.forEach(function(ve){ve===se&&(ye=!0)}),ye},ue.prototype.createVisual=function(){this.visual=_e.createGroup(),this.bgRectangle=_e.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=_e.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(_e.createTransform()),this.textElement.transform.baseVal.appendItem(_e.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},ue.prototype.pointerDown=function(se,ye){Ee.prototype.pointerDown.call(this,se,ye),this.isMoved=!1,this.pointerDownPoint=se,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(se),this._state="creating")},ue.prototype.renderText=function(){var se=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(ye){se.textElement.appendChild(_e.createTSpan(ye.trim()===""?" ":ye.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},ue.prototype.getTextScale=function(){var se=this.textElement.getBBox(),ye=1;if(se.width>0&&se.height>0){var ve=(1*this.width-this.width*this.padding*2/100)/se.width,le=(1*this.height-this.height*this.padding*2/100)/se.height;ye=Math.min(ve,le)}return ye},ue.prototype.getTextPosition=function(se){var ye=this.textElement.getBBox(),ve=0,le=0;return ye.width>0&&ye.height>0&&(ve=(this.width-ye.width*se)/2,le=this.height/2-ye.height*se/2),{x:ve,y:le}},ue.prototype.sizeText=function(){var se=this.textElement.getBBox(),ye=this.getTextScale(),ve=this.getTextPosition(ye);ve.y-=se.y*ye,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ve.x+"px, "+ve.y+"px) scale("+ye+", "+ye+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ve.x,ve.y),this.textElement.transform.baseVal.getItem(1).setScale(ye,ye))},ue.prototype.manipulate=function(se){Ee.prototype.manipulate.call(this,se),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(se.x-this.pointerDownPoint.x)>5||Math.abs(se.y-this.pointerDownPoint.y)>5)},ue.prototype.resize=function(se){Ee.prototype.resize.call(this,se),this.isMoved=!0,this.setSize(),this.sizeText()},ue.prototype.setSize=function(){Ee.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(_e.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),_e.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},ue.prototype.pointerUp=function(se){var ye=this.state;ye==="creating"&&(this._suppressMarkerCreateEvent=!0),Ee.prototype.pointerUp.call(this,se),this.setSize(),(ye==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},ue.prototype.showTextEditor=function(){var se=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(ye){ye.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var ye=Number.parseFloat(se.textEditor.style.fontSize);se.textEditor.clientWidth>=Number.parseInt(se.textEditor.style.maxWidth)&&ye>.9;)ye-=.1,se.textEditor.style.fontSize=Math.max(ye,.9)+"em"}),this.textEditor.addEventListener("keyup",function(ye){ye.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(ye){if(ye.clipboardData){var ve=ye.clipboardData.getData("text"),le=window.getSelection();if(!le.rangeCount)return!1;le.deleteFromDocument(),le.getRangeAt(0).insertNode(document.createTextNode(ve)),ye.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){se.textEditDivClicked(se.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},ue.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var se=this.getTextScale(),ye=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ve=this.textElement.getBBox(),le={x:ve.width*se,y:ve.height*se};ye.x-=le.x/2,ye.y-=le.y/2,this.textEditor.style.top=ye.y+"px",this.textEditor.style.left=ye.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-ye.x+"px",this.textEditor.style.fontSize=Math.max(16*se,12)+"px",this.textElement.style.display="none"}},ue.prototype.textEditDivClicked=function(se){this.text=se.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},ue.prototype.select=function(){Ee.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},ue.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Ee.prototype.deselect.call(this)},ue.prototype.dblClick=function(se,ye){Ee.prototype.dblClick.call(this,se,ye),this.showTextEditor()},ue.prototype.setColor=function(se){this.textElement&&_e.setAttributes(this.textElement,[["fill",se]]),this.color=se,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(se)},ue.prototype.setFont=function(se){this.textElement&&_e.setAttributes(this.textElement,[["font-family",se]]),this.fontFamily=se,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},ue.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},ue.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var se=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Ee.prototype.getState.call(this));return se.typeName=ue.typeName,se},ue.prototype.restoreState=function(se){var ye=se;this.color=ye.color,this.fontFamily=ye.fontFamily,this.padding=ye.padding,this.text=ye.text,this.createVisual(),Ee.prototype.restoreState.call(this,se),this.setSize()},ue.prototype.scale=function(se,ye){Ee.prototype.scale.call(this,se,ye),this.setSize(),this.sizeText(),this.positionTextEditor()},ue.typeName="TextMarker",ue.title="Text marker",ue.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>',ue}(ct),At=function(Ee){function ue(se,ye,ve){var le=Ee.call(this,se,ye,ve)||this;return le.color="transparent",le.lineWidth=3,le.drawing=!1,le.pixelRatio=1,le.color=ve.defaultColor,le.lineWidth=ve.defaultStrokeWidth,le.pixelRatio=ve.freehandPixelRatio,le.setColor=le.setColor.bind(le),le.addCanvas=le.addCanvas.bind(le),le.finishCreation=le.finishCreation.bind(le),le.setLineWidth=le.setLineWidth.bind(le),le.colorPanel=new Je("Color",ve.defaultColorSet,ve.defaultColor),le.colorPanel.onColorChanged=le.setColor,le.lineWidthPanel=new Me("Line width",ve.defaultStrokeWidths,ve.defaultStrokeWidth),le.lineWidthPanel.onWidthChanged=le.setLineWidth,le}return tt(ue,Ee),ue.prototype.ownsTarget=function(se){return!(!Ee.prototype.ownsTarget.call(this,se)&&se!==this.visual&&se!==this.drawingImage)},ue.prototype.createVisual=function(){this.visual=_e.createGroup(),this.drawingImage=_e.createImage(),this.visual.appendChild(this.drawingImage);var se=_e.createTransform();this.visual.transform.baseVal.appendItem(se),this.addMarkerVisualToContainer(this.visual)},ue.prototype.pointerDown=function(se,ye){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(se.x,se.y),this.drawing=!0):Ee.prototype.pointerDown.call(this,se,ye)},ue.prototype.manipulate=function(se){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(se.x,se.y),this.canvasContext.stroke()):Ee.prototype.manipulate.call(this,se)},ue.prototype.resize=function(se){Ee.prototype.resize.call(this,se),_e.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),_e.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},ue.prototype.pointerUp=function(se){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Ee.prototype.pointerUp.call(this,se)},ue.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)},ue.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Ee.prototype.select.call(this)},ue.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Ee.prototype.deselect.call(this)},ue.prototype.finishCreation=function(){for(var se=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),ye=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ve=ye[0],le=ye[1],We=ye[2],Lt=ye[3],tn=!1,hn=0;hn<this.canvasElement.height;hn++)for(var sn=0;sn<this.canvasElement.width;sn++)se.data[hn*this.canvasElement.width*4+4*sn+3]>0&&(tn=!0,hn<le&&(le=hn),sn<ve&&(ve=sn),hn>Lt&&(Lt=hn),sn>We&&(We=sn));if(tn){this.left=ve/this.pixelRatio,this.top=le/this.pixelRatio,this.width=(We-ve)/this.pixelRatio,this.height=(Lt-le)/this.pixelRatio;var yn=document.createElement("canvas");yn.width=We-ve,yn.height=Lt-le,yn.getContext("2d").putImageData(this.canvasContext.getImageData(ve,le,We-ve,Lt-le),0,0),this.drawingImgUrl=yn.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},ue.prototype.setDrawingImage=function(){_e.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),_e.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},ue.prototype.setColor=function(se){this.color=se,this.colorChanged(se)},ue.prototype.setLineWidth=function(se){this.lineWidth=se},Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var se=Object.assign({drawingImgUrl:this.drawingImgUrl},Ee.prototype.getState.call(this));return se.typeName=ue.typeName,se},ue.prototype.restoreState=function(se){this.createVisual(),Ee.prototype.restoreState.call(this,se),this.drawingImgUrl=se.drawingImgUrl,this.setDrawingImage()},ue.prototype.scale=function(se,ye){Ee.prototype.scale.call(this,se,ye),this.setDrawingImage()},ue.typeName="FreehandMarker",ue.title="Freehand marker",ue.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>',ue}(ct),xn=function(Ee){function ue(se,ye,ve){var le=Ee.call(this,se,ve||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return le.typeBoxes=[],le.currentType=ye,le.setCurrentType=le.setCurrentType.bind(le),le}return tt(ue,Ee),ue.prototype.getUi=function(){var se=this,ye=document.createElement("div");ye.style.display="flex",ye.style.overflow="hidden",ye.style.flexGrow="2";for(var ve=function(Lt){var tn="both";switch(Lt){case 0:tn="both";break;case 1:tn="start";break;case 2:tn="end";break;case 3:tn="none"}var hn=document.createElement("div");if(hn.style.display="flex",hn.style.flexGrow="2",hn.style.alignItems="center",hn.style.justifyContent="space-between",hn.style.padding="5px",hn.style.borderWidth="2px",hn.style.borderStyle="solid",hn.style.borderColor=tn===le.currentType?le.uiStyleSettings.toolboxAccentColor:"transparent",hn.addEventListener("click",function(){se.setCurrentType(tn,hn)}),ye.appendChild(hn),tn==="both"||tn==="start"){var sn=document.createElement("div");sn.style.display="flex",sn.style.alignItems="center",sn.style.minHeight="20px",sn.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="`+(le.uiStyleSettings!==void 0?le.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,sn.style.marginLeft="5px",hn.appendChild(sn)}var yn=document.createElement("div");yn.style.display="flex",yn.style.alignItems="center",yn.style.minHeight="20px",yn.style.flexGrow="2";var ln=document.createElement("hr");if(ln.style.minWidth="20px",ln.style.border="0px",ln.style.borderTop="3px solid "+(le.uiStyleSettings!==void 0?le.uiStyleSettings.toolboxColor:"#eeeeee"),ln.style.flexGrow="2",yn.appendChild(ln),hn.appendChild(yn),tn==="both"||tn==="end"){var yr=document.createElement("div");yr.style.display="flex",yr.style.alignItems="center",yr.style.minHeight="20px",yr.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="`+(le.uiStyleSettings!==void 0?le.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,yr.style.marginRight="5px",hn.appendChild(yr)}le.typeBoxes.push(hn)},le=this,We=0;We<4;We++)ve(We);return ye},ue.prototype.setCurrentType=function(se,ye){var ve=this;this.currentType=se,this.typeBoxes.forEach(function(le){le.style.borderColor=le===ye?ve.uiStyleSettings!==void 0?ve.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},ue}(pt),jt=function(Ee){function ue(se,ye,ve){var le=Ee.call(this,se,ye,ve)||this;return le.arrowType="end",le.arrowBaseHeight=10,le.arrowBaseWidth=10,le.getArrowPoints=le.getArrowPoints.bind(le),le.setArrowType=le.setArrowType.bind(le),le.arrowTypePanel=new xn("Arrow type","end"),le.arrowTypePanel.onArrowTypeChanged=le.setArrowType,le}return tt(ue,Ee),ue.prototype.ownsTarget=function(se){return!(!Ee.prototype.ownsTarget.call(this,se)&&se!==this.arrow1&&se!==this.arrow2)},ue.prototype.getArrowPoints=function(se,ye){var ve=this.arrowBaseWidth+2*this.strokeWidth,le=this.arrowBaseHeight+2*this.strokeWidth;return se-ve/2+","+(ye+le/2)+" "+se+","+(ye-le/2)+" "+(se+ve/2)+","+(ye+le/2)},ue.prototype.createTips=function(){this.arrow1=_e.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(_e.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=_e.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(_e.createTransform()),this.visual.appendChild(this.arrow2)},ue.prototype.pointerDown=function(se,ye){Ee.prototype.pointerDown.call(this,se,ye),this.state==="creating"&&this.createTips()},ue.prototype.adjustVisual=function(){if(Ee.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",_e.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),_e.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var se=0;Math.abs(this.x1-this.x2)>.1&&(se=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var ye=this.arrow1.transform.baseVal.getItem(0);ye.setRotate(se,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(ye,0);var ve=this.arrow2.transform.baseVal.getItem(0);ve.setRotate(se+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ve,0)}},ue.prototype.setArrowType=function(se){this.arrowType=se,this.adjustVisual(),this.stateChanged()},Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var se=Object.assign({arrowType:this.arrowType},Ee.prototype.getState.call(this));return se.typeName=ue.typeName,se},ue.prototype.restoreState=function(se){Ee.prototype.restoreState.call(this,se);var ye=se;this.arrowType=ye.arrowType,this.createTips(),this.adjustVisual()},ue.typeName="ArrowMarker",ue.title="Arrow marker",ue.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',ue}(Mt),vn=function(Ee){function ue(se,ye,ve){var le=Ee.call(this,se,ye,ve)||this;return le.fillColor=ve.defaultFillColor,le.strokeWidth=0,le.fillPanel=new Je("Color",ve.defaultColorSet,ve.defaultFillColor),le.fillPanel.onColorChanged=le.setFillColor,le}return tt(ue,Ee),Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var se=Ee.prototype.getState.call(this);return se.typeName=ue.typeName,se},ue.typeName="CoverMarker",ue.title="Cover marker",ue.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',ue}(Ie),er=function(Ee){function ue(se,ye,ve,le){var We=Ee.call(this,se,le||'<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 We.opacities=[],We.opacityBoxes=[],We.opacities=ye,We.currentOpacity=ve,We.setCurrentOpacity=We.setCurrentOpacity.bind(We),We}return tt(ue,Ee),ue.prototype.getUi=function(){var se=this,ye=document.createElement("div");return ye.style.display="flex",ye.style.overflow="hidden",ye.style.flexGrow="2",ye.style.justifyContent="space-between",this.opacities.forEach(function(ve){var le=document.createElement("div");le.style.display="flex",le.style.alignItems="center",le.style.justifyContent="center",le.style.padding="5px",le.style.borderWidth="2px",le.style.borderStyle="solid",le.style.borderColor=ve===se.currentOpacity?se.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){se.setCurrentOpacity(ve,le)}),ye.appendChild(le);var We=document.createElement("div");We.innerText=100*ve+"%",le.appendChild(We),se.opacityBoxes.push(le)}),ye},ue.prototype.setCurrentOpacity=function(se,ye){var ve=this;this.currentOpacity=se,this.opacityBoxes.forEach(function(le){le.style.borderColor=le===ye?ve.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},ue}(pt),Sr=function(Ee){function ue(se,ye,ve){var le=Ee.call(this,se,ye,ve)||this;return le.setOpacity=le.setOpacity.bind(le),le.fillColor=ve.defaultHighlightColor,le.strokeWidth=0,le.opacity=ve.defaultHighlightOpacity,le.fillPanel=new Je("Color",ve.defaultColorSet,le.fillColor),le.fillPanel.onColorChanged=le.setFillColor,le.opacityPanel=new er("Opacity",ve.defaultOpacitySteps,le.opacity),le.opacityPanel.onOpacityChanged=le.setOpacity,le}return tt(ue,Ee),ue.prototype.setOpacity=function(se){this.opacity=se,this.visual&&_e.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var se=Ee.prototype.getState.call(this);return se.typeName=ue.typeName,se},ue.typeName="HighlightMarker",ue.title="Highlight marker",ue.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>',ue}(vn),qe='<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>',Ae='<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>',$t=function(Ee){function ue(se,ye,ve){var le=Ee.call(this,se,ye,ve)||this;return le.bgColor="transparent",le.tipPosition={x:0,y:0},le.tipBase1Position={x:0,y:0},le.tipBase2Position={x:0,y:0},le.tipMoving=!1,le.color=ve.defaultStrokeColor,le.bgColor=ve.defaultFillColor,le.fontFamily=ve.defaultFontFamily,le.defaultSize={x:100,y:30},le.setBgColor=le.setBgColor.bind(le),le.getTipPoints=le.getTipPoints.bind(le),le.positionTip=le.positionTip.bind(le),le.setTipPoints=le.setTipPoints.bind(le),le.colorPanel=new Je("Text color",ve.defaultColorSet,le.color,qe),le.colorPanel.onColorChanged=le.setColor,le.bgColorPanel=new Je("Fill color",ve.defaultColorSet,le.bgColor,Ae),le.bgColorPanel.onColorChanged=le.setBgColor,le.fontFamilyPanel=new je("Font",ve.defaultFontFamilies,ve.defaultFontFamily),le.fontFamilyPanel.onFontChanged=le.setFont,le.tipGrip=new Yt,le.tipGrip.visual.transform.baseVal.appendItem(_e.createTransform()),le.controlBox.appendChild(le.tipGrip.visual),le}return tt(ue,Ee),ue.prototype.ownsTarget=function(se){return Ee.prototype.ownsTarget.call(this,se)||this.tipGrip.ownsTarget(se)||this.tip===se},ue.prototype.createTip=function(){_e.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=_e.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},ue.prototype.pointerDown=function(se,ye){this.state==="new"&&Ee.prototype.pointerDown.call(this,se,ye),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(ye)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Ee.prototype.pointerDown.call(this,se,ye)},ue.prototype.pointerUp=function(se){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Ee.prototype.pointerUp.call(this,se);else{var ye=this.state==="creating";Ee.prototype.pointerUp.call(this,se),this.setTipPoints(ye),this.positionTip()}},ue.prototype.manipulate=function(se){if(this.tipMoving){var ye=this.unrotatePoint(se);this.tipPosition={x:ye.x-this.manipulationStartLeft,y:ye.y-this.manipulationStartTop},this.positionTip()}else Ee.prototype.manipulate.call(this,se)},ue.prototype.setBgColor=function(se){this.bgRectangle&&this.tip&&(_e.setAttributes(this.bgRectangle,[["fill",se]]),_e.setAttributes(this.tip,[["fill",se]])),this.bgColor=se,this.fillColorChanged(se)},ue.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},ue.prototype.setTipPoints=function(se){se===void 0&&(se=!1);var ye=Math.min(this.height/2,15),ve=this.height/5;se&&(this.tipPosition={x:ye+ve/2,y:this.height+20});var le=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?le<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ve=this.width/5,ye=Math.min(this.width/2,15),this.tipBase1Position={x:ye,y:0},this.tipBase2Position={x:ye+ve,y:0}):(this.tipBase1Position={x:0,y:ye},this.tipBase2Position={x:0,y:ye+ve}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?le<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ve=this.width/5,ye=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ye-ve,y:0},this.tipBase2Position={x:this.width-ye,y:0}):(this.tipBase1Position={x:this.width,y:ye},this.tipBase2Position={x:this.width,y:ye+ve}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?le<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ve=this.width/5,ye=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-ye-ve,y:this.height},this.tipBase2Position={x:this.width-ye,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-ye-ve},this.tipBase2Position={x:this.width,y:this.height-ye}):le<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ve=this.width/5,ye=Math.min(this.width/2,15),this.tipBase1Position={x:ye,y:this.height},this.tipBase2Position={x:ye+ve,y:this.height}):(this.tipBase1Position={x:0,y:this.height-ye},this.tipBase2Position={x:0,y:this.height-ye-ve})},ue.prototype.resize=function(se){Ee.prototype.resize.call(this,se),this.positionTip()},ue.prototype.positionTip=function(){_e.setAttributes(this.tip,[["points",this.getTipPoints()]]);var se=this.tipGrip.visual.transform.baseVal.getItem(0);se.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(se,0)},Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),ue.prototype.select=function(){this.positionTip(),Ee.prototype.select.call(this)},ue.prototype.getState=function(){var se=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Ee.prototype.getState.call(this));return se.typeName=ue.typeName,se},ue.prototype.restoreState=function(se){var ye=se;this.bgColor=ye.bgColor,this.tipPosition=ye.tipPosition,Ee.prototype.restoreState.call(this,se),this.createTip(),this.setTipPoints()},ue.prototype.scale=function(se,ye){Ee.prototype.scale.call(this,se,ye),this.tipPosition={x:this.tipPosition.x*se,y:this.tipPosition.y*ye},this.positionTip()},ue.typeName="CalloutMarker",ue.title="Callout marker",ue.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>',ue}(Rt),Hn=function(Ee){function ue(se,ye,ve){var le=Ee.call(this,se,ye,ve)||this;return le.fillColor="transparent",le.strokeColor="transparent",le.strokeWidth=0,le.strokeDasharray="",le.opacity=1,le.strokeColor=ve.defaultColor,le.strokeWidth=ve.defaultStrokeWidth,le.strokeDasharray=ve.defaultStrokeDasharray,le.fillColor=ve.defaultFillColor,le.setStrokeColor=le.setStrokeColor.bind(le),le.setFillColor=le.setFillColor.bind(le),le.setStrokeWidth=le.setStrokeWidth.bind(le),le.setStrokeDasharray=le.setStrokeDasharray.bind(le),le.setOpacity=le.setOpacity.bind(le),le.createVisual=le.createVisual.bind(le),le.strokePanel=new Je("Line color",be(ve.defaultColorSet,["transparent"]),ve.defaultColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.fillPanel=new Je("Fill color",be(ve.defaultColorSet,["transparent"]),le.fillColor,Ae),le.fillPanel.onColorChanged=le.setFillColor,le.strokeWidthPanel=new Me("Line width",ve.defaultStrokeWidths,ve.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new Ve("Line style",ve.defaultStrokeDasharrays,ve.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le.opacityPanel=new er("Opacity",ve.defaultOpacitySteps,le.opacity),le.opacityPanel.onOpacityChanged=le.setOpacity,le}return tt(ue,Ee),ue.prototype.ownsTarget=function(se){return!(!Ee.prototype.ownsTarget.call(this,se)&&se!==this.visual)},ue.prototype.createVisual=function(){this.visual=_e.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)},ue.prototype.pointerDown=function(se,ye){Ee.prototype.pointerDown.call(this,se,ye),this.state==="new"&&(this.createVisual(),this.moveVisual(se),this._state="creating")},ue.prototype.manipulate=function(se){Ee.prototype.manipulate.call(this,se)},ue.prototype.resize=function(se){Ee.prototype.resize.call(this,se),this.setSize()},ue.prototype.setSize=function(){Ee.prototype.setSize.call(this),_e.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},ue.prototype.pointerUp=function(se){Ee.prototype.pointerUp.call(this,se),this.setSize()},ue.prototype.setStrokeColor=function(se){this.strokeColor=se,this.visual&&_e.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(se),this.stateChanged()},ue.prototype.setFillColor=function(se){this.fillColor=se,this.visual&&_e.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(se),this.stateChanged()},ue.prototype.setStrokeWidth=function(se){this.strokeWidth=se,this.visual&&_e.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},ue.prototype.setStrokeDasharray=function(se){this.strokeDasharray=se,this.visual&&_e.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},ue.prototype.setOpacity=function(se){this.opacity=se,this.visual&&_e.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var se=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Ee.prototype.getState.call(this));return se.typeName=ue.typeName,se},ue.prototype.restoreState=function(se){var ye=se;this.fillColor=ye.fillColor,this.strokeColor=ye.strokeColor,this.strokeWidth=ye.strokeWidth,this.strokeDasharray=ye.strokeDasharray,this.opacity=ye.opacity,this.createVisual(),Ee.prototype.restoreState.call(this,se),this.setSize()},ue.prototype.scale=function(se,ye){Ee.prototype.scale.call(this,se,ye),this.setSize()},ue.typeName="EllipseMarker",ue.title="Ellipse marker",ue.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>',ue}(ct),bn=function(Ee){function ue(se,ye,ve){return Ee.call(this,se,ye,ve)||this}return tt(ue,Ee),Object.defineProperty(ue.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),ue.prototype.ownsTarget=function(se){return!(!Ee.prototype.ownsTarget.call(this,se)&&se!==this.tip1&&se!==this.tip2)},ue.prototype.createTips=function(){this.tip1=_e.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(_e.createTransform()),this.visual.appendChild(this.tip1),this.tip2=_e.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(_e.createTransform()),this.visual.appendChild(this.tip2)},ue.prototype.pointerDown=function(se,ye){Ee.prototype.pointerDown.call(this,se,ye),this.state==="creating"&&this.createTips()},ue.prototype.adjustVisual=function(){if(Ee.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(_e.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()]]),_e.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 se=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ye=this.tip1.transform.baseVal.getItem(0);ye.setRotate(se,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(ye,0);var ve=this.tip2.transform.baseVal.getItem(0);ve.setRotate(se+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ve,0)}},Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var se=Ee.prototype.getState.call(this);return se.typeName=ue.typeName,se},ue.prototype.restoreState=function(se){Ee.prototype.restoreState.call(this,se),this.createTips(),this.adjustVisual()},ue.typeName="MeasurementMarker",ue.title="Measurement marker",ue.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>',ue}(Mt),at=function(Ee){function ue(se,ye,ve){var le=Ee.call(this,se,ye,ve)||this;return le.strokePanel.colors=ve.defaultColorSet,le.fillColor="transparent",le}return tt(ue,Ee),Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var se=Ee.prototype.getState.call(this);return se.typeName=ue.typeName,se},ue.typeName="EllipseFrameMarker",ue.title="Ellipse frame marker",ue.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>',ue}(Hn),ft=function(){function Ee(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Ee.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Ee.prototype.addUndoStep=function(ue){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(ue)||(this.undoStack.push(ue),JSON.stringify(this.lastRedoStep)!==JSON.stringify(ue)&&this.redoStack.splice(0,this.redoStack.length))},Ee.prototype.replaceLastUndoStep=function(ue){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=ue)},Ee.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Ee.prototype.undo=function(){if(this.undoStack.length>1){var ue=this.undoStack.pop();return ue!==void 0&&this.redoStack.push(ue),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Ee.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Ee}(),Gt=function(Ee){function ue(se,ye,ve){var le=Ee.call(this,se,ye,ve)||this;return le.strokeColor="transparent",le.strokeWidth=0,le.strokeDasharray="",le.curveX=0,le.curveY=0,le.manipulationStartCurveX=0,le.manipulationStartCurveY=0,le.setStrokeColor=le.setStrokeColor.bind(le),le.setStrokeWidth=le.setStrokeWidth.bind(le),le.setStrokeDasharray=le.setStrokeDasharray.bind(le),le.positionGrips=le.positionGrips.bind(le),le.addControlGrips=le.addControlGrips.bind(le),le.adjustVisual=le.adjustVisual.bind(le),le.setupControlBox=le.setupControlBox.bind(le),le.resize=le.resize.bind(le),le.strokeColor=ve.defaultColor,le.strokeWidth=ve.defaultStrokeWidth,le.strokeDasharray=ve.defaultStrokeDasharray,le.strokePanel=new Je("Line color",ve.defaultColorSet,ve.defaultColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.strokeWidthPanel=new Me("Line width",ve.defaultStrokeWidths,ve.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new Ve("Line style",ve.defaultStrokeDasharrays,ve.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le}return tt(ue,Ee),ue.prototype.ownsTarget=function(se){return!(!Ee.prototype.ownsTarget.call(this,se)&&se!==this.visual&&se!==this.selectorCurve&&se!==this.visibleCurve&&!this.curveGrip.ownsTarget(se))},ue.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},ue.prototype.createVisual=function(){this.visual=_e.createGroup(),this.selectorCurve=_e.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=_e.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)},ue.prototype.pointerDown=function(se,ye){Ee.prototype.pointerDown.call(this,se,ye),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=se.x,this.curveY=se.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(ye)&&(this.activeGrip=this.curveGrip,this._state="resize")},ue.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),_e.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),_e.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),_e.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},ue.prototype.setupControlBox=function(){Ee.prototype.setupControlBox.call(this),this.curveControlLine1=_e.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=_e.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)},ue.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Ee.prototype.addControlGrips.call(this)},ue.prototype.positionGrips=function(){Ee.prototype.positionGrips.call(this);var se=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-se/2,this.curveY-se/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()))},ue.prototype.manipulate=function(se){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+se.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+se.y-this.manipulationStartY),Ee.prototype.manipulate.call(this,se)},ue.prototype.resize=function(se){this.activeGrip===this.curveGrip&&(this.curveX=se.x,this.curveY=se.y),Ee.prototype.resize.call(this,se),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},ue.prototype.setStrokeColor=function(se){this.strokeColor=se,this.adjustVisual(),this.colorChanged(se)},ue.prototype.setStrokeWidth=function(se){this.strokeWidth=se,this.adjustVisual()},ue.prototype.setStrokeDasharray=function(se){this.strokeDasharray=se,this.adjustVisual()},ue.prototype.scale=function(se,ye){this.curveX=this.curveX*se,this.curveY=this.curveY*ye,Ee.prototype.scale.call(this,se,ye)},Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var se=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Ee.prototype.getState.call(this));return se.typeName=ue.typeName,se},ue.prototype.restoreState=function(se){Ee.prototype.restoreState.call(this,se);var ye=se;this.strokeColor=ye.strokeColor,this.strokeWidth=ye.strokeWidth,this.strokeDasharray=ye.strokeDasharray,this.curveX=ye.curveX,this.curveY=ye.curveY,this.createVisual(),this.adjustVisual()},ue.typeName="CurveMarker",ue.title="Curve marker",ue.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>',ue}(wt),zn=function(Ee){function ue(se,ye,ve){var le=Ee.call(this,se,ye,ve)||this;return le.fillColor="transparent",le.strokeColor="transparent",le.strokeWidth=0,le.strokeDasharray="",le.textColor="transparent",le.fontSize="1rem",le.isMoved=!1,le.captionText="Caption",le.PADDING=5,le.captionBoxWidth=0,le.captionBoxHeight=0,le.strokeColor=ve.defaultColor,le.strokeWidth=ve.defaultStrokeWidth,le.strokeDasharray=ve.defaultStrokeDasharray,le.fillColor=ve.defaultFillColor,le.textColor=ve.defaultStrokeColor,le.fontFamily=ve.defaultFontFamily,le.fontSize=ve.defaultCaptionFontSize,le.captionText=ve.defaultCaptionText,le.setStrokeColor=le.setStrokeColor.bind(le),le.setFillColor=le.setFillColor.bind(le),le.setStrokeWidth=le.setStrokeWidth.bind(le),le.setStrokeDasharray=le.setStrokeDasharray.bind(le),le.createVisual=le.createVisual.bind(le),le.sizeCaption=le.sizeCaption.bind(le),le.setCaptionText=le.setCaptionText.bind(le),le.showTextEditor=le.showTextEditor.bind(le),le.positionTextEditor=le.positionTextEditor.bind(le),le.finishTextEditing=le.finishTextEditing.bind(le),le.setFont=le.setFont.bind(le),le.setTextColor=le.setTextColor.bind(le),le.strokePanel=new Je("Line color",be(ve.defaultColorSet,["transparent"]),le.strokeColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.fillPanel=new Je("Fill color",be(ve.defaultColorSet,["transparent"]),le.fillColor,Ae),le.fillPanel.onColorChanged=le.setFillColor,le.strokeWidthPanel=new Me("Line width",ve.defaultStrokeWidths,ve.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new Ve("Line style",ve.defaultStrokeDasharrays,ve.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le.fontFamilyPanel=new je("Font",ve.defaultFontFamilies,ve.defaultFontFamily),le.fontFamilyPanel.onFontChanged=le.setFont,le.textColorPanel=new Je("Text color",ve.defaultColorSet,le.textColor,qe),le.textColorPanel.onColorChanged=le.setTextColor,le}return tt(ue,Ee),ue.prototype.ownsTarget=function(se){return!(!Ee.prototype.ownsTarget.call(this,se)&&se!==this.visual&&se!==this.frame&&se!==this.captionBg&&se!==this.captionElement)},ue.prototype.createVisual=function(){this.visual=_e.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=_e.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=_e.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=_e.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()},ue.prototype.setCaptionText=function(se){this.captionText=se,this.captionElement.textContent=this.captionText,this.sizeCaption()},ue.prototype.pointerDown=function(se,ye){Ee.prototype.pointerDown.call(this,se,ye),this.isMoved=!1,this.pointerDownPoint=se,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(se),this._state="creating")},ue.prototype.manipulate=function(se){Ee.prototype.manipulate.call(this,se),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(se.x-this.pointerDownPoint.x)>5||Math.abs(se.y-this.pointerDownPoint.y)>5)},ue.prototype.resize=function(se){Ee.prototype.resize.call(this,se),this.setSize()},ue.prototype.sizeCaption=function(){var se=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=se.width+2*this.PADDING,this.captionBoxHeight=se.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),_e.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')"]]),_e.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')"]])},ue.prototype.showTextEditor=function(){var se=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(ye){ye.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(ye){ye.key==="Enter"&&se.finishTextEditing(se.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(ye){ye.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){se.finishTextEditing(se.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){se.finishTextEditing(se.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},ue.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"))},ue.prototype.finishTextEditing=function(se){this.setCaptionText(se.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},ue.prototype.setFont=function(se){this.captionElement&&_e.setAttributes(this.captionElement,[["font-family",se]]),this.fontFamily=se,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},ue.prototype.setTextColor=function(se){this.captionElement&&_e.setAttributes(this.captionElement,[["fill",se]]),this.textColor=se,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},ue.prototype.setSize=function(){Ee.prototype.setSize.call(this),_e.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},ue.prototype.pointerUp=function(se){Ee.prototype.pointerUp.call(this,se),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},ue.prototype.dblClick=function(se,ye){Ee.prototype.dblClick.call(this,se,ye),this.showTextEditor()},ue.prototype.setStrokeColor=function(se){this.strokeColor=se,this.frame&&_e.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(se),this.stateChanged()},ue.prototype.setFillColor=function(se){this.fillColor=se,this.captionBg&&_e.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(se),this.stateChanged()},ue.prototype.setStrokeWidth=function(se){this.strokeWidth=se,this.frame&&_e.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},ue.prototype.setStrokeDasharray=function(se){this.strokeDasharray=se,this.frame&&_e.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(ue.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),ue.prototype.getState=function(){var se=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},Ee.prototype.getState.call(this));return se.typeName=this.typeName,se},ue.prototype.restoreState=function(se){var ye=se;this.fillColor=ye.fillColor,this.strokeColor=ye.strokeColor,this.strokeWidth=ye.strokeWidth,this.strokeDasharray=ye.strokeDasharray,this.textColor=ye.textColor,this.fontFamily=ye.fontFamily,this.captionText=ye.captionText,this.fontSize=ye.fontSize,this.createVisual(),Ee.prototype.restoreState.call(this,se),this.setSize()},ue.prototype.scale=function(se,ye){Ee.prototype.scale.call(this,se,ye),this.setSize()},ue.typeName="CaptionFrameMarker",ue.title="Caption frame marker",ue.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>',ue}(ct),mn=function(){function Ee(ue,se){se===void 0&&(se=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=ue,this.cancelable=se}return Object.defineProperty(Ee.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Ee.prototype.preventDefault=function(){this._defaultPrevented=!0},Ee}(),nn=function(Ee){function ue(se,ye,ve){var le=Ee.call(this,se,!1)||this;return le.dataUrl=ye,le.state=ve,le}return tt(ue,Ee),ue}(mn),Ft=function(Ee){function ue(se,ye,ve){ve===void 0&&(ve=!1);var le=Ee.call(this,se,ve)||this;return le.marker=ye,le}return tt(ue,Ee),ue}(mn),Pn=function(){function Ee(){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 Ee.prototype.addEventListener=function(ue,se){this[ue].push(se)},Ee.prototype.removeEventListener=function(ue,se){var ye=this[ue].indexOf(se);ye>-1&&this[ue].splice(ye,1)},Ee}(),_n=function(){function Ee(ue){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ct,this._isOpen=!1,this.undoRedoManager=new ft,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 Pn,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Ee.instanceCounter++,this.styles=new Te(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=ue,this.targetRoot=document.body,this.width=ue.clientWidth,this.height=ue.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(Ee.prototype,"ALL_MARKER_TYPES",{get:function(){return[Xe,At,jt,Rt,at,Hn,Sr,$t,bn,vn,Mt,Gt,zn]},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Xe,At,jt,Rt,Hn,Sr,$t]},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Xe,At,jt,Rt,Sr]},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(ue){var se=this;this._availableMarkerTypes.splice(0),ue.forEach(function(ye){if(typeof ye=="string"){var ve=se.ALL_MARKER_TYPES.find(function(le){return le.typeName===ye});ve!==void 0&&se._availableMarkerTypes.push(ve)}else se._availableMarkerTypes.push(ye)})},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Ee.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(ue){this._zoomLevel=ue,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(Ee.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Ee.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Le.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Ee.prototype.show=function(){var ue=this;this.styles.styleSheetRoot===void 0&&pe.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=pe.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(se){return se(new mn(ue))})},Ee.prototype.render=function(){return Fe(this,void 0,void 0,function(){var ue;return Ye(this,function(se){switch(se.label){case 0:return this.setCurrentMarker(),(ue=new Se).naturalSize=this.renderAtNaturalSize,ue.imageType=this.renderImageType,ue.imageQuality=this.renderImageQuality,ue.markersOnly=this.renderMarkersOnly,ue.width=this.renderWidth,ue.height=this.renderHeight,[4,ue.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return se.sent(),[4,ue.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,se.sent()]}})})},Ee.prototype.close=function(ue){var se=this;if(ue===void 0&&(ue=!1),this.isOpen){var ye=!1;ue||this.eventListeners.beforeclose.forEach(function(ve){var le=new mn(se,!0);ve(le),le.defaultPrevented&&(ye=!0)}),ye||(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(ve){return ve(new mn(se))}),this.detachEvents(),this._isOpen=!1)}},Ee.prototype.addMarkersToToolbar=function(){for(var ue,se=[],ye=0;ye<arguments.length;ye++)se[ye]=arguments[ye];(ue=this._availableMarkerTypes).push.apply(ue,se)},Ee.prototype.addRenderEventListener=function(ue){this.addEventListener("render",function(se){ue(se.dataUrl,se.state)})},Ee.prototype.removeRenderEventListener=function(ue){},Ee.prototype.addCloseEventListener=function(ue){this.addEventListener("close",function(){ue()})},Ee.prototype.removeCloseEventListener=function(ue){},Ee.prototype.setupResizeObserver=function(){var ue=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){ue.resize(ue.target.clientWidth,ue.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return ue.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Ee.prototype.onPopupTargetResize=function(){var ue=1*this.target.clientWidth/this.target.clientHeight,se=this.editorCanvas.clientWidth/ue>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*ue:this.editorCanvas.clientWidth,ye=se<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/ue;this.resize(se,ye)},Ee.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Ee.prototype.resize=function(ue,se){this._isResizing=!0;var ye=ue/this.imageWidth,ve=se/this.imageHeight;this.imageWidth=Math.round(ue),this.imageHeight=Math.round(se),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(ye,ve),this._isResizing=!1},Ee.prototype.scaleMarkers=function(ue,se){var ye,ve=this;this._currentMarker&&this._currentMarker instanceof Rt?this._currentMarker.scale(ue,se):(ye=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(le){le!==ve._currentMarker&&le.scale(ue,se)}),ye!==void 0&&this.setCurrentMarker(ye)},Ee.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"},Ee.prototype.setTopLeft=function(){var ue=this.editingTarget.getBoundingClientRect(),se=this.editorCanvas.getBoundingClientRect();this.left=ue.left-se.left,this.top=ue.top-se.top},Ee.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)},Ee.prototype.addDefs=function(){for(var ue,se=[],ye=0;ye<arguments.length;ye++)se[ye]=arguments[ye];this.defs=_e.createDefs(),this.addDefsToImage(),(ue=this.defs).append.apply(ue,se)},Ee.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Ee.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)},Ee.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Ee.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Ee.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)},Ee.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Ee.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)},Ee.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 ue=document.createElement("a");ue.href="https://markerjs.com/",ue.target="_blank",ue.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>',ue.title="Powered by marker.js",ue.style.display="grid",ue.style.alignItems="center",ue.style.justifyItems="center",ue.style.padding="3px",ue.style.width="20px",ue.style.height="20px",this.logoUI.appendChild(ue),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Ee.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")},Ee.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"},Ee.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Ee.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 ue=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=ue+"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 Pt(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 kt(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Ee.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Ee.prototype.removeMarker=function(ue){this.markerImage.removeChild(ue.container),this.markers.indexOf(ue)>-1&&this.markers.splice(this.markers.indexOf(ue),1),ue.dispose()},Ee.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())},Ee.prototype.toolbarButtonClicked=function(ue,se){if(ue==="marker"&&se!==void 0)this.createNewMarker(se);else if(ue==="action")switch(se){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()}},Ee.prototype.deleteSelectedMarker=function(){var ue=this;if(this._currentMarker!==void 0){var se=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ve){var le=new Ft(ue,ue._currentMarker,!0);ve(le),le.defaultPrevented&&(se=!0)}),!se){var ye=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(ve){return ve(new Ft(ue,ye))})}}},Ee.prototype.clear=function(){var ue=this,se=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(We){var Lt=new Ft(ue,void 0,!0);We(Lt),Lt.defaultPrevented&&(se=!0)}),!se)){this.setCurrentMarker();for(var ye=function(We){var Lt=ve.markers[We];ve.setCurrentMarker(ve.markers[We]),ve._currentMarker.dispose(),ve.markerImage.removeChild(ve._currentMarker.container),ve.markers.splice(ve.markers.indexOf(ve._currentMarker),1),ve.eventListeners.markerdelete.forEach(function(tn){return tn(new Ft(ue,Lt))})},ve=this,le=this.markers.length-1;le>=0;le--)ye(le);this.addUndoStep()}},Object.defineProperty(Ee.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Ee.prototype.showNotesEditor=function(){var ue;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=(ue=this._currentMarker.notes)!==null&&ue!==void 0?ue:"",this.overlayContainer.appendChild(this.notesArea))},Ee.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)},Ee.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Ee.prototype.addUndoStep=function(){var ue=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var se=this.getState(),ye=this.undoRedoManager.getLastUndoStep();if(!ye||ye.width===se.width&&ye.height===se.height){var ve=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(se),ve<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(le){return le(new mn(ue))})}else this.undoRedoManager.replaceLastUndoStep(se),this.eventListeners.statechange.forEach(function(le){return le(new mn(ue))})}},Ee.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Ee.prototype.undoStep=function(){var ue=this,se=this.undoRedoManager.undo();se!==void 0&&(this.restoreState(se),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ye){return ye(new mn(ue))}))},Ee.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Ee.prototype.redoStep=function(){var ue=this,se=this.undoRedoManager.redo();se!==void 0&&(this.restoreState(se),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(ye){return ye(new mn(ue))}))},Ee.prototype.stepZoom=function(){var ue=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=ue<this.zoomSteps.length-1?this.zoomSteps[ue+1]:this.zoomSteps[0]},Ee.prototype.panTo=function(ue){this.contentDiv.scrollBy({left:this.prevPanPoint.x-ue.x,top:this.prevPanPoint.y-ue.y}),this.prevPanPoint=ue},Ee.prototype.startRenderAndClose=function(){return Fe(this,void 0,void 0,function(){var ue,se,ye=this;return Ye(this,function(ve){switch(ve.label){case 0:return[4,this.render()];case 1:return ue=ve.sent(),se=this.getState(),this.eventListeners.render.forEach(function(le){return le(new nn(ye,ue,se))}),this.close(!0),[2]}})})},Ee.prototype.getState=function(ue){ue===!0&&this.setCurrentMarker();var se={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(ye){return se.markers.push(ye.getState())}),se},Ee.prototype.restoreState=function(ue){var se=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);ue.markers.forEach(function(ye){var ve=se._availableMarkerTypes.find(function(We){return We.typeName===ye.typeName});if(ve!==void 0){var le=se.addNewMarker(ve);le.restoreState(ye),se.markers.push(le)}}),ue.width&&ue.height&&(ue.width!==this.imageWidth||ue.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/ue.width,this.imageHeight/ue.height),this.eventListeners.restorestate.forEach(function(ye){return ye(new mn(se))})},Ee.prototype.addNewMarker=function(ue){var se=_e.createGroup();return this.markerImage.appendChild(se),new ue(se,this.overlayContainer,this.settings)},Ee.prototype.createNewMarker=function(ue){var se,ye=this;(se=typeof ue=="string"?this._availableMarkerTypes.find(function(ve){return ve.typeName===ue}):ue)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(se),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(se.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ve){return ve(new Ft(ye,ye._currentMarker))}))},Ee.prototype.markerCreated=function(ue){var se=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(ue),this.setCurrentMarker(ue),ue instanceof At&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(At):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(ye){return ye(new Ft(se,se._currentMarker))})},Ee.prototype.colorChanged=function(ue){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=ue,this.settings.defaultStrokeColor=ue)},Ee.prototype.fillColorChanged=function(ue){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=ue)},Ee.prototype.markerStateChanged=function(ue){var se=this;this.eventListeners.markerchange.forEach(function(ye){return ye(new Ft(se,ue))})},Ee.prototype.setCurrentMarker=function(ue){var se=this;this._currentMarker!==ue&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(ye){return ye(new Ft(se,se._currentMarker))})),this._currentMarker=ue,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(ye){return ye(new Ft(se,se._currentMarker))}))},Ee.prototype.onPointerDown=function(ue){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||ue.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var se=this.markers.find(function(ye){return ye.ownsTarget(ue.target)});se!==void 0?(this.setCurrentMarker(se),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(ue.clientX,ue.clientY),ue.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:ue.clientX,y:ue.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(ue.clientX,ue.clientY))},Ee.prototype.onDblClick=function(ue){if(this._isFocused||this.focus(),this.mode==="select"){var se=this.markers.find(function(ye){return ye.ownsTarget(ue.target)});se!==void 0&&se!==this._currentMarker&&this.setCurrentMarker(se),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(ue.clientX,ue.clientY),ue.target):this.setCurrentMarker()}},Ee.prototype.onPointerMove=function(ue){this.touchPoints!==1&&ue.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||ue.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(ue.clientX,ue.clientY)):this.zoomLevel>1&&this.panTo({x:ue.clientX,y:ue.clientY}))},Ee.prototype.onPointerUp=function(ue){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(ue.clientX,ue.clientY)),this.isDragging=!1,this.addUndoStep()},Ee.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Ee.prototype.onKeyUp=function(ue){this._currentMarker===void 0||this.notesArea!==void 0||ue.key!=="Delete"&&ue.key!=="Backspace"||this.deleteSelectedMarker()},Ee.prototype.clientToLocalCoordinates=function(ue,se){var ye=this.markerImage.getBoundingClientRect();return{x:(ue-ye.left)/this.zoomLevel,y:(se-ye.top)/this.zoomLevel}},Ee.prototype.onWindowResize=function(){this.positionUI()},Ee.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var ue=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=ue+"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()},Ee.prototype.addLicenseKey=function(ue){Le.addKey(ue)},Ee.prototype.addEventListener=function(ue,se){this.eventListeners.addEventListener(ue,se)},Ee.prototype.removeEventListener=function(ue,se){this.eventListeners.removeEventListener(ue,se)},Ee.prototype.renderState=function(ue){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(ue),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Ee.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Ee.prototype.focus=function(){var ue=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(se){return se(new mn(ue))}))},Ee.prototype.blur=function(){var ue=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(se){return se(new mn(ue))}))},Ee.instanceCounter=0,Ee}()},95860:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return nt}});var fe=ce(87462),tt=ce(1413),Fe=ce(4942),Ye=ce(97685),be=ce(45987),_e=ce(94184),Le=ce.n(_e),Se=ce(67294);function pe(ct){var Ie=Se.useRef();Ie.current=ct;var Me=Se.useCallback(function(){for(var Ve,Xe=arguments.length,Ct=new Array(Xe),wt=0;wt<Xe;wt++)Ct[wt]=arguments[wt];return(Ve=Ie.current)===null||Ve===void 0?void 0:Ve.call.apply(Ve,[Ie].concat(Ct))},[]);return Me}function Te(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var gt=Te()?Se.useLayoutEffect:Se.useEffect,ze=function(Ie,Me){var Ve=Se.useRef(!0);gt(function(){return Ie(Ve.current)},Me),gt(function(){return Ve.current=!1,function(){Ve.current=!0}},[])},Pt=function(Ie,Me){ze(function(Ve){if(!Ve)return Ie()},Me)},kt=null;function pt(ct){var Ie=Se.useRef(!1),Me=Se.useState(ct),Ve=(0,Ye.Z)(Me,2),Xe=Ve[0],Ct=Ve[1];Se.useEffect(function(){return Ie.current=!1,function(){Ie.current=!0}},[]);function wt(Mt,je){je&&Ie.current||Ct(Mt)}return[Xe,wt]}function Je(ct){return ct!==void 0}function De(ct,Ie){var Me=Ie||{},Ve=Me.defaultValue,Xe=Me.value,Ct=Me.onChange,wt=Me.postState,Mt=pt(function(){return Je(Xe)?Xe:Je(Ve)?typeof Ve=="function"?Ve():Ve:typeof ct=="function"?ct():ct}),je=(0,Ye.Z)(Mt,2),Rt=je[0],At=je[1],xn=Xe!==void 0?Xe:Rt,jt=wt?wt(xn):xn,vn=pe(Ct),er=pt([xn]),Sr=(0,Ye.Z)(er,2),qe=Sr[0],Ae=Sr[1];Pt(function(){var Hn=qe[0];Rt!==Hn&&vn(Rt,Hn)},[qe]),Pt(function(){Je(Xe)||At(Xe)},[Xe]);var $t=pe(function(Hn,bn){At(Hn,bn),Ae([xn],bn)});return[jt,$t]}var Dt=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],Yt=(0,Se.forwardRef)(function(ct,Ie){var Me,Ve=ct.prefixCls,Xe=Ve===void 0?"rc-checkbox":Ve,Ct=ct.className,wt=ct.style,Mt=ct.checked,je=ct.disabled,Rt=ct.defaultChecked,At=Rt===void 0?!1:Rt,xn=ct.type,jt=xn===void 0?"checkbox":xn,vn=ct.title,er=ct.onChange,Sr=(0,be.Z)(ct,Dt),qe=(0,Se.useRef)(null),Ae=De(At,{value:Mt}),$t=(0,Ye.Z)(Ae,2),Hn=$t[0],bn=$t[1];(0,Se.useImperativeHandle)(Ie,function(){return{focus:function(){var zn;(zn=qe.current)===null||zn===void 0||zn.focus()},blur:function(){var zn;(zn=qe.current)===null||zn===void 0||zn.blur()},input:qe.current}});var at=Le()(Xe,Ct,(Me={},(0,Fe.Z)(Me,"".concat(Xe,"-checked"),Hn),(0,Fe.Z)(Me,"".concat(Xe,"-disabled"),je),Me)),ft=function(zn){je||("checked"in ct||bn(zn.target.checked),er==null||er({target:(0,tt.Z)((0,tt.Z)({},ct),{},{type:jt,checked:zn.target.checked}),stopPropagation:function(){zn.stopPropagation()},preventDefault:function(){zn.preventDefault()},nativeEvent:zn.nativeEvent}))};return Se.createElement("span",{className:at,title:vn,style:wt},Se.createElement("input",(0,fe.Z)({},Sr,{className:"".concat(Xe,"-input"),ref:qe,onChange:ft,disabled:je,checked:!!Hn,type:jt})),Se.createElement("span",{className:"".concat(Xe,"-inner")}))}),nt=Yt},26819:function(Ln,qt){"use strict";var ce;var fe=typeof Symbol=="function"&&Symbol.for,tt=fe?Symbol.for("react.element"):60103,Fe=fe?Symbol.for("react.portal"):60106,Ye=fe?Symbol.for("react.fragment"):60107,be=fe?Symbol.for("react.strict_mode"):60108,_e=fe?Symbol.for("react.profiler"):60114,Le=fe?Symbol.for("react.provider"):60109,Se=fe?Symbol.for("react.context"):60110,pe=fe?Symbol.for("react.async_mode"):60111,Te=fe?Symbol.for("react.concurrent_mode"):60111,gt=fe?Symbol.for("react.forward_ref"):60112,ze=fe?Symbol.for("react.suspense"):60113,Pt=fe?Symbol.for("react.suspense_list"):60120,kt=fe?Symbol.for("react.memo"):60115,pt=fe?Symbol.for("react.lazy"):60116,Je=fe?Symbol.for("react.block"):60121,De=fe?Symbol.for("react.fundamental"):60117,Dt=fe?Symbol.for("react.responder"):60118,Yt=fe?Symbol.for("react.scope"):60119;function nt(Ie){if(typeof Ie=="object"&&Ie!==null){var Me=Ie.$$typeof;switch(Me){case tt:switch(Ie=Ie.type,Ie){case pe:case Te:case Ye:case _e:case be:case ze:return Ie;default:switch(Ie=Ie&&Ie.$$typeof,Ie){case Se:case gt:case pt:case kt:case Le:return Ie;default:return Me}}case Fe:return Me}}}function ct(Ie){return nt(Ie)===Te}ce=pe,ce=Te,ce=Se,ce=Le,ce=tt,ce=gt,ce=Ye,ce=pt,ce=kt,ce=Fe,ce=_e,ce=be,ce=ze,ce=function(Ie){return ct(Ie)||nt(Ie)===pe},ce=ct,ce=function(Ie){return nt(Ie)===Se},ce=function(Ie){return nt(Ie)===Le},ce=function(Ie){return typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===tt},ce=function(Ie){return nt(Ie)===gt},ce=function(Ie){return nt(Ie)===Ye},ce=function(Ie){return nt(Ie)===pt},qt.isMemo=function(Ie){return nt(Ie)===kt},ce=function(Ie){return nt(Ie)===Fe},ce=function(Ie){return nt(Ie)===_e},ce=function(Ie){return nt(Ie)===be},ce=function(Ie){return nt(Ie)===ze},ce=function(Ie){return typeof Ie=="string"||typeof Ie=="function"||Ie===Ye||Ie===Te||Ie===_e||Ie===be||Ie===ze||Ie===Pt||typeof Ie=="object"&&Ie!==null&&(Ie.$$typeof===pt||Ie.$$typeof===kt||Ie.$$typeof===Le||Ie.$$typeof===Se||Ie.$$typeof===gt||Ie.$$typeof===De||Ie.$$typeof===Dt||Ie.$$typeof===Yt||Ie.$$typeof===Je)},ce=nt},18459:function(Ln,qt,ce){"use strict";Ln.exports=ce(26819)},16651:function(Ln,qt){"use strict";var ce;var fe=Symbol.for("react.element"),tt=Symbol.for("react.portal"),Fe=Symbol.for("react.fragment"),Ye=Symbol.for("react.strict_mode"),be=Symbol.for("react.profiler"),_e=Symbol.for("react.provider"),Le=Symbol.for("react.context"),Se=Symbol.for("react.server_context"),pe=Symbol.for("react.forward_ref"),Te=Symbol.for("react.suspense"),gt=Symbol.for("react.suspense_list"),ze=Symbol.for("react.memo"),Pt=Symbol.for("react.lazy"),kt=Symbol.for("react.offscreen"),pt;pt=Symbol.for("react.module.reference");function Je(De){if(typeof De=="object"&&De!==null){var Dt=De.$$typeof;switch(Dt){case fe:switch(De=De.type,De){case Fe:case be:case Ye:case Te:case gt:return De;default:switch(De=De&&De.$$typeof,De){case Se:case Le:case pe:case Pt:case ze:case _e:return De;default:return Dt}}case tt:return Dt}}}ce=Le,ce=_e,ce=fe,ce=pe,ce=Fe,ce=Pt,ce=ze,ce=tt,ce=be,ce=Ye,ce=Te,ce=gt,ce=function(){return!1},ce=function(){return!1},ce=function(De){return Je(De)===Le},ce=function(De){return Je(De)===_e},ce=function(De){return typeof De=="object"&&De!==null&&De.$$typeof===fe},ce=function(De){return Je(De)===pe},ce=function(De){return Je(De)===Fe},ce=function(De){return Je(De)===Pt},ce=function(De){return Je(De)===ze},ce=function(De){return Je(De)===tt},ce=function(De){return Je(De)===be},ce=function(De){return Je(De)===Ye},ce=function(De){return Je(De)===Te},ce=function(De){return Je(De)===gt},ce=function(De){return typeof De=="string"||typeof De=="function"||De===Fe||De===be||De===Ye||De===Te||De===gt||De===kt||typeof De=="object"&&De!==null&&(De.$$typeof===Pt||De.$$typeof===ze||De.$$typeof===_e||De.$$typeof===Le||De.$$typeof===pe||De.$$typeof===pt||De.getModuleId!==void 0)},ce=Je},33993:function(Ln,qt,ce){"use strict";ce(16651)},82523:function(Ln,qt){"use strict";var ce;var fe=Symbol.for("react.element"),tt=Symbol.for("react.portal"),Fe=Symbol.for("react.fragment"),Ye=Symbol.for("react.strict_mode"),be=Symbol.for("react.profiler"),_e=Symbol.for("react.provider"),Le=Symbol.for("react.context"),Se=Symbol.for("react.server_context"),pe=Symbol.for("react.forward_ref"),Te=Symbol.for("react.suspense"),gt=Symbol.for("react.suspense_list"),ze=Symbol.for("react.memo"),Pt=Symbol.for("react.lazy"),kt=Symbol.for("react.offscreen"),pt;pt=Symbol.for("react.module.reference");function Je(De){if(typeof De=="object"&&De!==null){var Dt=De.$$typeof;switch(Dt){case fe:switch(De=De.type,De){case Fe:case be:case Ye:case Te:case gt:return De;default:switch(De=De&&De.$$typeof,De){case Se:case Le:case pe:case Pt:case ze:case _e:return De;default:return Dt}}case tt:return Dt}}}ce=Le,ce=_e,ce=fe,ce=pe,ce=Fe,ce=Pt,ce=ze,ce=tt,ce=be,ce=Ye,ce=Te,ce=gt,ce=function(){return!1},ce=function(){return!1},ce=function(De){return Je(De)===Le},ce=function(De){return Je(De)===_e},ce=function(De){return typeof De=="object"&&De!==null&&De.$$typeof===fe},ce=function(De){return Je(De)===pe},ce=function(De){return Je(De)===Fe},ce=function(De){return Je(De)===Pt},ce=function(De){return Je(De)===ze},ce=function(De){return Je(De)===tt},ce=function(De){return Je(De)===be},ce=function(De){return Je(De)===Ye},ce=function(De){return Je(De)===Te},ce=function(De){return Je(De)===gt},ce=function(De){return typeof De=="string"||typeof De=="function"||De===Fe||De===be||De===Ye||De===Te||De===gt||De===kt||typeof De=="object"&&De!==null&&(De.$$typeof===Pt||De.$$typeof===ze||De.$$typeof===_e||De.$$typeof===Le||De.$$typeof===pe||De.$$typeof===pt||De.getModuleId!==void 0)},ce=Je},27183:function(Ln,qt,ce){"use strict";ce(82523)},67656:function(Ln,qt,ce){"use strict";ce.r(qt),ce.d(qt,{BaseInput:function(){return Te},default:function(){return Yt}});var fe=ce(87462),tt=ce(1413),Fe=ce(4942),Ye=ce(71002),be=ce(94184),_e=ce.n(be),Le=ce(67294),Se=ce(87887),pe=function(ct){var Ie,Me,Ve=ct.inputElement,Xe=ct.prefixCls,Ct=ct.prefix,wt=ct.suffix,Mt=ct.addonBefore,je=ct.addonAfter,Rt=ct.className,At=ct.style,xn=ct.disabled,jt=ct.readOnly,vn=ct.focused,er=ct.triggerFocus,Sr=ct.allowClear,qe=ct.value,Ae=ct.handleReset,$t=ct.hidden,Hn=ct.classes,bn=ct.classNames,at=ct.dataAttrs,ft=ct.styles,Gt=ct.components,zn=(Gt==null?void 0:Gt.affixWrapper)||"span",mn=(Gt==null?void 0:Gt.groupWrapper)||"span",nn=(Gt==null?void 0:Gt.wrapper)||"span",Ft=(Gt==null?void 0:Gt.groupAddon)||"span",Pn=(0,Le.useRef)(null),_n=function(yn){var ln;(ln=Pn.current)!==null&&ln!==void 0&&ln.contains(yn.target)&&(er==null||er())},Ee=function(){var yn;if(!Sr)return null;var ln=!xn&&!jt&&qe,yr="".concat(Xe,"-clear-icon"),Fr=(0,Ye.Z)(Sr)==="object"&&Sr!==null&&Sr!==void 0&&Sr.clearIcon?Sr.clearIcon:"\u2716";return Le.createElement("span",{onClick:Ae,onMouseDown:function(Rn){return Rn.preventDefault()},className:_e()(yr,(yn={},(0,Fe.Z)(yn,"".concat(yr,"-hidden"),!ln),(0,Fe.Z)(yn,"".concat(yr,"-has-suffix"),!!wt),yn)),role:"button",tabIndex:-1},Fr)},ue=(0,Le.cloneElement)(Ve,{value:qe,hidden:$t,className:_e()((Ie=Ve.props)===null||Ie===void 0?void 0:Ie.className,!(0,Se.X3)(ct)&&!(0,Se.He)(ct)&&Rt)||null,style:(0,tt.Z)((0,tt.Z)({},(Me=Ve.props)===null||Me===void 0?void 0:Me.style),!(0,Se.X3)(ct)&&!(0,Se.He)(ct)?At:{})});if((0,Se.X3)(ct)){var se,ye="".concat(Xe,"-affix-wrapper"),ve=_e()(ye,(se={},(0,Fe.Z)(se,"".concat(ye,"-disabled"),xn),(0,Fe.Z)(se,"".concat(ye,"-focused"),vn),(0,Fe.Z)(se,"".concat(ye,"-readonly"),jt),(0,Fe.Z)(se,"".concat(ye,"-input-with-clear-btn"),wt&&Sr&&qe),se),!(0,Se.He)(ct)&&Rt,Hn==null?void 0:Hn.affixWrapper,bn==null?void 0:bn.affixWrapper),le=(wt||Sr)&&Le.createElement("span",{className:_e()("".concat(Xe,"-suffix"),bn==null?void 0:bn.suffix),style:ft==null?void 0:ft.suffix},Ee(),wt);ue=Le.createElement(zn,(0,fe.Z)({className:ve,style:(0,tt.Z)((0,tt.Z)({},(0,Se.He)(ct)?void 0:At),ft==null?void 0:ft.affixWrapper),hidden:!(0,Se.He)(ct)&&$t,onClick:_n},at==null?void 0:at.affixWrapper,{ref:Pn}),Ct&&Le.createElement("span",{className:_e()("".concat(Xe,"-prefix"),bn==null?void 0:bn.prefix),style:ft==null?void 0:ft.prefix},Ct),(0,Le.cloneElement)(Ve,{value:qe,hidden:null}),le)}if((0,Se.He)(ct)){var We="".concat(Xe,"-group"),Lt="".concat(We,"-addon"),tn=_e()("".concat(Xe,"-wrapper"),We,Hn==null?void 0:Hn.wrapper),hn=_e()("".concat(Xe,"-group-wrapper"),Rt,Hn==null?void 0:Hn.group);return Le.createElement(mn,{className:hn,style:At,hidden:$t},Le.createElement(nn,{className:tn},Mt&&Le.createElement(Ft,{className:Lt},Mt),(0,Le.cloneElement)(ue,{hidden:null}),je&&Le.createElement(Ft,{className:Lt},je)))}return ue},Te=pe,gt=ce(74902),ze=ce(97685),Pt=ce(45987),kt=ce(21770),pt=ce(98423),Je=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","classes","classNames","styles"],De=(0,Le.forwardRef)(function(nt,ct){var Ie=nt.autoComplete,Me=nt.onChange,Ve=nt.onFocus,Xe=nt.onBlur,Ct=nt.onPressEnter,wt=nt.onKeyDown,Mt=nt.prefixCls,je=Mt===void 0?"rc-input":Mt,Rt=nt.disabled,At=nt.htmlSize,xn=nt.className,jt=nt.maxLength,vn=nt.suffix,er=nt.showCount,Sr=nt.type,qe=Sr===void 0?"text":Sr,Ae=nt.classes,$t=nt.classNames,Hn=nt.styles,bn=(0,Pt.Z)(nt,Je),at=(0,kt.Z)(nt.defaultValue,{value:nt.value}),ft=(0,ze.Z)(at,2),Gt=ft[0],zn=ft[1],mn=(0,Le.useState)(!1),nn=(0,ze.Z)(mn,2),Ft=nn[0],Pn=nn[1],_n=(0,Le.useRef)(null),Ee=function(hn){_n.current&&(0,Se.nH)(_n.current,hn)};(0,Le.useImperativeHandle)(ct,function(){return{focus:Ee,blur:function(){var hn;(hn=_n.current)===null||hn===void 0||hn.blur()},setSelectionRange:function(hn,sn,yn){var ln;(ln=_n.current)===null||ln===void 0||ln.setSelectionRange(hn,sn,yn)},select:function(){var hn;(hn=_n.current)===null||hn===void 0||hn.select()},input:_n.current}}),(0,Le.useEffect)(function(){Pn(function(tn){return tn&&Rt?!1:tn})},[Rt]);var ue=function(hn){nt.value===void 0&&zn(hn.target.value),_n.current&&(0,Se.rJ)(_n.current,hn,Me)},se=function(hn){Ct&&hn.key==="Enter"&&Ct(hn),wt==null||wt(hn)},ye=function(hn){Pn(!0),Ve==null||Ve(hn)},ve=function(hn){Pn(!1),Xe==null||Xe(hn)},le=function(hn){zn(""),Ee(),_n.current&&(0,Se.rJ)(_n.current,hn,Me)},We=function(){var hn=(0,pt.Z)(nt,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","classes","htmlSize","styles","classNames"]);return Le.createElement("input",(0,fe.Z)({autoComplete:Ie},hn,{onChange:ue,onFocus:ye,onBlur:ve,onKeyDown:se,className:_e()(je,(0,Fe.Z)({},"".concat(je,"-disabled"),Rt),$t==null?void 0:$t.input),style:Hn==null?void 0:Hn.input,ref:_n,size:At,type:qe}))},Lt=function(){var hn=Number(jt)>0;if(vn||er){var sn=(0,Se.D7)(Gt),yn=(0,gt.Z)(sn).length,ln=(0,Ye.Z)(er)==="object"?er.formatter({value:sn,count:yn,maxLength:jt}):"".concat(yn).concat(hn?" / ".concat(jt):"");return Le.createElement(Le.Fragment,null,!!er&&Le.createElement("span",{className:_e()("".concat(je,"-show-count-suffix"),(0,Fe.Z)({},"".concat(je,"-show-count-has-suffix"),!!vn),$t==null?void 0:$t.count),style:(0,tt.Z)({},Hn==null?void 0:Hn.count)},ln),vn)}return null};return Le.createElement(Te,(0,fe.Z)({},bn,{prefixCls:je,className:xn,inputElement:We(),handleReset:le,value:(0,Se.D7)(Gt),focused:Ft,triggerFocus:Ee,suffix:Lt(),disabled:Rt,classes:Ae,classNames:$t,styles:Hn}))}),Dt=De,Yt=Dt},87887:function(Ln,qt,ce){"use strict";ce.d(qt,{D7:function(){return be},He:function(){return fe},X3:function(){return tt},nH:function(){return Ye},rJ:function(){return Fe}});function fe(_e){return!!(_e.addonBefore||_e.addonAfter)}function tt(_e){return!!(_e.prefix||_e.suffix||_e.allowClear)}function Fe(_e,Le,Se,pe){if(Se){var Te=Le;if(Le.type==="click"){var gt=_e.cloneNode(!0);Te=Object.create(Le,{target:{value:gt},currentTarget:{value:gt}}),gt.value="",Se(Te);return}if(pe!==void 0){Te=Object.create(Le,{target:{value:_e},currentTarget:{value:_e}}),_e.value=pe,Se(Te);return}Se(Te)}}function Ye(_e,Le){if(_e){_e.focus(Le);var Se=Le||{},pe=Se.cursor;if(pe){var Te=_e.value.length;switch(pe){case"start":_e.setSelectionRange(0,0);break;case"end":_e.setSelectionRange(Te,Te);break;default:_e.setSelectionRange(0,Te)}}}}function be(_e){return typeof _e=="undefined"||_e===null?"":String(_e)}},78595:function(Ln,qt,ce){"use strict";ce.d(qt,{iz:function(){return Hr},ck:function(){return or},BW:function(){return Br},sN:function(){return or},Wd:function(){return Bt},ZP:function(){return Ne},Xl:function(){return ln}});var fe=ce(87462),tt=ce(4942),Fe=ce(1413),Ye=ce(74902),be=ce(97685),_e=ce(45987),Le=ce(94184),Se=ce.n(Le),pe=ce(67294),Te=ce(48555);function gt(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var ze=gt()?pe.useLayoutEffect:pe.useEffect,Pt=function(He,Ge){var et=pe.useRef(!0);ze(function(){return He(et.current)},Ge),ze(function(){return et.current=!1,function(){et.current=!0}},[])},kt=function(He,Ge){Pt(function(et){if(!et)return He()},Ge)},pt=Pt,Je=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],De=void 0;function Dt(Be,He){var Ge=Be.prefixCls,et=Be.invalidate,bt=Be.item,Zt=Be.renderItem,Jt=Be.responsive,Gn=Be.responsiveDisabled,fr=Be.registerSize,Wn=Be.itemKey,pn=Be.className,dn=Be.style,Cn=Be.children,In=Be.display,cr=Be.order,jn=Be.component,Zn=jn===void 0?"div":jn,Jn=(0,_e.Z)(Be,Je),Qn=Jt&&!In;function hr(It){fr(Wn,It)}pe.useEffect(function(){return function(){hr(null)}},[]);var Pe=Zt&&bt!==De?Zt(bt):Cn,$e;et||($e={opacity:Qn?0:1,height:Qn?0:De,overflowY:Qn?"hidden":De,order:Jt?cr:De,pointerEvents:Qn?"none":De,position:Qn?"absolute":De});var xt={};Qn&&(xt["aria-hidden"]=!0);var rt=pe.createElement(Zn,(0,fe.Z)({className:Se()(!et&&Ge,pn),style:(0,Fe.Z)((0,Fe.Z)({},$e),dn)},xt,Jn,{ref:He}),Pe);return Jt&&(rt=pe.createElement(Te.Z,{onResize:function(rn){var fn=rn.offsetWidth;hr(fn)},disabled:Gn},rt)),rt}var Yt=pe.forwardRef(Dt);Yt.displayName="Item";var nt=Yt;function ct(Be){var He=pe.useRef();He.current=Be;var Ge=pe.useCallback(function(){for(var et,bt=arguments.length,Zt=new Array(bt),Jt=0;Jt<bt;Jt++)Zt[Jt]=arguments[Jt];return(et=He.current)===null||et===void 0?void 0:et.call.apply(et,[He].concat(Zt))},[]);return Ge}var Ie=ce(73935),Me=function(He){return+setTimeout(He,16)},Ve=function(He){return clearTimeout(He)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(Me=function(He){return window.requestAnimationFrame(He)},Ve=function(He){return window.cancelAnimationFrame(He)});var Xe=0,Ct=new Map;function wt(Be){Ct.delete(Be)}var Mt=function(He){var Ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Xe+=1;var et=Xe;function bt(Zt){if(Zt===0)wt(et),He();else{var Jt=Me(function(){bt(Zt-1)});Ct.set(et,Jt)}}return bt(Ge),et};Mt.cancel=function(Be){var He=Ct.get(Be);return wt(He),Ve(He)};var je=Mt;function Rt(Be){if(typeof MessageChannel=="undefined")je(Be);else{var He=new MessageChannel;He.port1.onmessage=function(){return Be()},He.port2.postMessage(void 0)}}function At(){var Be=pe.useRef(null),He=function(et){Be.current||(Be.current=[],Rt(function(){(0,Ie.unstable_batchedUpdates)(function(){Be.current.forEach(function(bt){bt()}),Be.current=null})})),Be.current.push(et)};return He}function xn(Be,He){var Ge=pe.useState(He),et=(0,be.Z)(Ge,2),bt=et[0],Zt=et[1],Jt=ct(function(Gn){Be(function(){Zt(Gn)})});return[bt,Jt]}var jt=pe.createContext(null),vn=["component"],er=["className"],Sr=["className"],qe=function(He,Ge){var et=pe.useContext(jt);if(!et){var bt=He.component,Zt=bt===void 0?"div":bt,Jt=(0,_e.Z)(He,vn);return pe.createElement(Zt,(0,fe.Z)({},Jt,{ref:Ge}))}var Gn=et.className,fr=(0,_e.Z)(et,er),Wn=He.className,pn=(0,_e.Z)(He,Sr);return pe.createElement(jt.Provider,{value:null},pe.createElement(nt,(0,fe.Z)({ref:Ge,className:Se()(Gn,Wn)},fr,pn)))},Ae=pe.forwardRef(qe);Ae.displayName="RawItem";var $t=Ae,Hn=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],bn="responsive",at="invalidate";function ft(Be){return"+ ".concat(Be.length," ...")}function Gt(Be,He){var Ge=Be.prefixCls,et=Ge===void 0?"rc-overflow":Ge,bt=Be.data,Zt=bt===void 0?[]:bt,Jt=Be.renderItem,Gn=Be.renderRawItem,fr=Be.itemKey,Wn=Be.itemWidth,pn=Wn===void 0?10:Wn,dn=Be.ssr,Cn=Be.style,In=Be.className,cr=Be.maxCount,jn=Be.renderRest,Zn=Be.renderRawRest,Jn=Be.suffix,Qn=Be.component,hr=Qn===void 0?"div":Qn,Pe=Be.itemComponent,$e=Be.onVisibleChange,xt=(0,_e.Z)(Be,Hn),rt=dn==="full",It=At(),rn=xn(It,null),fn=(0,be.Z)(rn,2),On=fn[0],wn=fn[1],Xt=On||0,Nn=xn(It,new Map),Fn=(0,be.Z)(Nn,2),mr=Fn[0],Bn=Fn[1],Lr=xn(It,0),Zr=(0,be.Z)(Lr,2),Dr=Zr[0],zr=Zr[1],xr=xn(It,0),Or=(0,be.Z)(xr,2),Jr=Or[0],ai=Or[1],Ir=xn(It,0),ci=(0,be.Z)(Ir,2),Pi=ci[0],ta=ci[1],Vi=(0,pe.useState)(null),Bi=(0,be.Z)(Vi,2),Xi=Bi[0],qi=Bi[1],bi=(0,pe.useState)(null),$i=(0,be.Z)(bi,2),jr=$i[0],di=$i[1],Ti=pe.useMemo(function(){return jr===null&&rt?Number.MAX_SAFE_INTEGER:jr||0},[jr,On]),ji=(0,pe.useState)(!1),Ba=(0,be.Z)(ji,2),$a=Ba[0],Aa=Ba[1],ca="".concat(et,"-item"),Yi=Math.max(Dr,Jr),Mi=cr===bn,Oa=Zt.length&&Mi,ki=cr===at,Qr=Oa||typeof cr=="number"&&Zt.length>cr,zi=(0,pe.useMemo)(function(){var _i=Zt;return Oa?On===null&&rt?_i=Zt:_i=Zt.slice(0,Math.min(Zt.length,Xt/pn)):typeof cr=="number"&&(_i=Zt.slice(0,cr)),_i},[Zt,pn,On,cr,Oa]),ua=(0,pe.useMemo)(function(){return Oa?Zt.slice(Ti+1):Zt.slice(zi.length)},[Zt,zi,Oa,Ti]),Ui=(0,pe.useCallback)(function(_i,Ki){var da;return typeof fr=="function"?fr(_i):(da=fr&&(_i==null?void 0:_i[fr]))!==null&&da!==void 0?da:Ki},[fr]),ia=(0,pe.useCallback)(Jt||function(_i){return _i},[Jt]);function hi(_i,Ki,da){jr===_i&&(Ki===void 0||Ki===Xi)||(di(_i),da||(Aa(_i<Zt.length-1),$e==null||$e(_i)),Ki!==void 0&&qi(Ki))}function pa(_i,Ki){wn(Ki.clientWidth)}function xa(_i,Ki){Bn(function(da){var Sa=new Map(da);return Ki===null?Sa.delete(_i):Sa.set(_i,Ki),Sa})}function fa(_i,Ki){ai(Ki),zr(Jr)}function wa(_i,Ki){ta(Ki)}function Ea(_i){return mr.get(Ui(zi[_i],_i))}pt(function(){if(Xt&&typeof Yi=="number"&&zi){var _i=Pi,Ki=zi.length,da=Ki-1;if(!Ki){hi(0,null);return}for(var Sa=0;Sa<Ki;Sa+=1){var Ka=Ea(Sa);if(rt&&(Ka=Ka||0),Ka===void 0){hi(Sa-1,void 0,!0);break}if(_i+=Ka,da===0&&_i<=Xt||Sa===da-1&&_i+Ea(da)<=Xt){hi(da,null);break}else if(_i+Yi>Xt){hi(Sa-1,_i-Ka-Pi+Jr);break}}Jn&&Ea(0)+Pi>Xt&&qi(null)}},[Xt,mr,Jr,Pi,Ui,zi]);var Va=$a&&!!ua.length,ha={};Xi!==null&&Oa&&(ha={position:"absolute",left:Xi,top:0});var ka={prefixCls:ca,responsive:Oa,component:Pe,invalidate:ki},Ja=Gn?function(_i,Ki){var da=Ui(_i,Ki);return pe.createElement(jt.Provider,{key:da,value:(0,Fe.Z)((0,Fe.Z)({},ka),{},{order:Ki,item:_i,itemKey:da,registerSize:xa,display:Ki<=Ti})},Gn(_i,Ki))}:function(_i,Ki){var da=Ui(_i,Ki);return pe.createElement(nt,(0,fe.Z)({},ka,{order:Ki,key:da,item:_i,renderItem:ia,itemKey:da,registerSize:xa,display:Ki<=Ti}))},Ga,so={order:Va?Ti:Number.MAX_SAFE_INTEGER,className:"".concat(ca,"-rest"),registerSize:fa,display:Va};if(Zn)Zn&&(Ga=pe.createElement(jt.Provider,{value:(0,Fe.Z)((0,Fe.Z)({},ka),so)},Zn(ua)));else{var Fa=jn||ft;Ga=pe.createElement(nt,(0,fe.Z)({},ka,so),typeof Fa=="function"?Fa(ua):Fa)}var Ca=pe.createElement(hr,(0,fe.Z)({className:Se()(!ki&&et,In),style:Cn,ref:He},xt),zi.map(Ja),Qr?Ga:null,Jn&&pe.createElement(nt,(0,fe.Z)({},ka,{responsive:Mi,responsiveDisabled:!Oa,order:Ti,className:"".concat(ca,"-suffix"),registerSize:wa,display:!0,style:ha}),Jn));return Mi&&(Ca=pe.createElement(Te.Z,{onResize:pa,disabled:!Oa},Ca)),Ca}var zn=pe.forwardRef(Gt);zn.displayName="Overflow",zn.Item=$t,zn.RESPONSIVE=bn,zn.INVALIDATE=at;var mn=zn,nn=mn,Ft=ce(21770),Pn=ce(80334),_n=ce(91881),Ee=pe.createContext(null);function ue(Be,He){return Be===void 0?null:"".concat(Be,"-").concat(He)}function se(Be){var He=pe.useContext(Ee);return ue(He,Be)}var ye=ce(56982),ve=["children","locked"],le=pe.createContext(null);function We(Be,He){var Ge=(0,Fe.Z)({},Be);return Object.keys(He).forEach(function(et){var bt=He[et];bt!==void 0&&(Ge[et]=bt)}),Ge}function Lt(Be){var He=Be.children,Ge=Be.locked,et=(0,_e.Z)(Be,ve),bt=pe.useContext(le),Zt=(0,ye.Z)(function(){return We(bt,et)},[bt,et],function(Jt,Gn){return!Ge&&(Jt[0]!==Gn[0]||!(0,_n.Z)(Jt[1],Gn[1],!0))});return pe.createElement(le.Provider,{value:Zt},He)}var tn=[],hn=pe.createContext(null);function sn(){return pe.useContext(hn)}var yn=pe.createContext(tn);function ln(Be){var He=pe.useContext(yn);return pe.useMemo(function(){return Be!==void 0?[].concat((0,Ye.Z)(He),[Be]):He},[He,Be])}var yr=pe.createContext(null),Fr=pe.createContext({}),Nt=Fr,Rn=ce(15105),Gr=ce(75164),li=function(Be){if(!Be)return!1;if(Be instanceof Element){if(Be.offsetParent)return!0;if(Be.getBBox){var He=Be.getBBox(),Ge=He.width,et=He.height;if(Ge||et)return!0}if(Be.getBoundingClientRect){var bt=Be.getBoundingClientRect(),Zt=bt.width,Jt=bt.height;if(Zt||Jt)return!0}}return!1};function st(Be){var He=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(li(Be)){var Ge=Be.nodeName.toLowerCase(),et=["input","select","textarea","button"].includes(Ge)||Be.isContentEditable||Ge==="a"&&!!Be.getAttribute("href"),bt=Be.getAttribute("tabindex"),Zt=Number(bt),Jt=null;return bt&&!Number.isNaN(Zt)?Jt=Zt:et&&Jt===null&&(Jt=0),et&&Be.disabled&&(Jt=null),Jt!==null&&(Jt>=0||He&&Jt<0)}return!1}function Wt(Be){var He=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ge=(0,Ye.Z)(Be.querySelectorAll("*")).filter(function(et){return st(et,He)});return st(Be,He)&&Ge.unshift(Be),Ge}var Vn=null;function ir(){Vn=document.activeElement}function gr(){Vn=null}function Pr(){if(Vn)try{Vn.focus()}catch(Be){}}function Ur(Be,He){if(He.keyCode===9){var Ge=Wt(Be),et=Ge[He.shiftKey?0:Ge.length-1],bt=et===document.activeElement||Be===document.activeElement;if(bt){var Zt=Ge[He.shiftKey?Ge.length-1:0];Zt.focus(),He.preventDefault()}}}var Xr=Rn.Z.LEFT,qr=Rn.Z.RIGHT,ui=Rn.Z.UP,br=Rn.Z.DOWN,Ei=Rn.Z.ENTER,sa=Rn.Z.ESC,Ji=Rn.Z.HOME,Qi=Rn.Z.END,Ci=[ui,br,Xr,qr];function mt(Be,He,Ge,et){var bt,Zt,Jt,Gn,fr="prev",Wn="next",pn="children",dn="parent";if(Be==="inline"&&et===Ei)return{inlineTrigger:!0};var Cn=(bt={},(0,tt.Z)(bt,ui,fr),(0,tt.Z)(bt,br,Wn),bt),In=(Zt={},(0,tt.Z)(Zt,Xr,Ge?Wn:fr),(0,tt.Z)(Zt,qr,Ge?fr:Wn),(0,tt.Z)(Zt,br,pn),(0,tt.Z)(Zt,Ei,pn),Zt),cr=(Jt={},(0,tt.Z)(Jt,ui,fr),(0,tt.Z)(Jt,br,Wn),(0,tt.Z)(Jt,Ei,pn),(0,tt.Z)(Jt,sa,dn),(0,tt.Z)(Jt,Xr,Ge?pn:dn),(0,tt.Z)(Jt,qr,Ge?dn:pn),Jt),jn={inline:Cn,horizontal:In,vertical:cr,inlineSub:Cn,horizontalSub:cr,verticalSub:cr},Zn=(Gn=jn["".concat(Be).concat(He?"":"Sub")])===null||Gn===void 0?void 0:Gn[et];switch(Zn){case fr:return{offset:-1,sibling:!0};case Wn:return{offset:1,sibling:!0};case dn:return{offset:-1,sibling:!1};case pn:return{offset:1,sibling:!1};default:return null}}function Mn(Be){for(var He=Be;He;){if(He.getAttribute("data-menu-list"))return He;He=He.parentElement}return null}function En(Be,He){for(var Ge=Be||document.activeElement;Ge;){if(He.has(Ge))return Ge;Ge=Ge.parentElement}return null}function An(Be,He){var Ge=Wt(Be,!0);return Ge.filter(function(et){return He.has(et)})}function sr(Be,He,Ge){var et=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!Be)return null;var bt=An(Be,He),Zt=bt.length,Jt=bt.findIndex(function(Gn){return Ge===Gn});return et<0?Jt===-1?Jt=Zt-1:Jt-=1:et>0&&(Jt+=1),Jt=(Jt+Zt)%Zt,bt[Jt]}function nr(Be,He,Ge,et,bt,Zt,Jt,Gn,fr,Wn){var pn=pe.useRef(),dn=pe.useRef();dn.current=He;var Cn=function(){Gr.Z.cancel(pn.current)};return pe.useEffect(function(){return function(){Cn()}},[]),function(In){var cr=In.which;if([].concat(Ci,[Ei,sa,Ji,Qi]).includes(cr)){var jn,Zn,Jn,Qn=function(){jn=new Set,Zn=new Map,Jn=new Map;var Fn=Zt();return Fn.forEach(function(mr){var Bn=document.querySelector("[data-menu-id='".concat(ue(et,mr),"']"));Bn&&(jn.add(Bn),Jn.set(Bn,mr),Zn.set(mr,Bn))}),jn};Qn();var hr=Zn.get(He),Pe=En(hr,jn),$e=Jn.get(Pe),xt=mt(Be,Jt($e,!0).length===1,Ge,cr);if(!xt&&cr!==Ji&&cr!==Qi)return;(Ci.includes(cr)||[Ji,Qi].includes(cr))&&In.preventDefault();var rt=function(Fn){if(Fn){var mr=Fn,Bn=Fn.querySelector("a");Bn!=null&&Bn.getAttribute("href")&&(mr=Bn);var Lr=Jn.get(Fn);Gn(Lr),Cn(),pn.current=(0,Gr.Z)(function(){dn.current===Lr&&mr.focus()})}};if([Ji,Qi].includes(cr)||xt.sibling||!Pe){var It;!Pe||Be==="inline"?It=bt.current:It=Mn(Pe);var rn,fn=An(It,jn);cr===Ji?rn=fn[0]:cr===Qi?rn=fn[fn.length-1]:rn=sr(It,jn,Pe,xt.offset),rt(rn)}else if(xt.inlineTrigger)fr($e);else if(xt.offset>0)fr($e,!0),Cn(),pn.current=(0,Gr.Z)(function(){Qn();var Nn=Pe.getAttribute("aria-controls"),Fn=document.getElementById(Nn),mr=sr(Fn,jn);rt(mr)},5);else if(xt.offset<0){var On=Jt($e,!0),wn=On[On.length-2],Xt=Zn.get(wn);fr(wn,!1),rt(Xt)}}Wn==null||Wn(In)}}function pr(Be){Promise.resolve().then(Be)}var Kn="__RC_UTIL_PATH_SPLIT__",Ue=function(He){return He.join(Kn)},it=function(He){return He.split(Kn)},_t="rc-menu-more";function Ut(){var Be=pe.useState({}),He=(0,be.Z)(Be,2),Ge=He[1],et=(0,pe.useRef)(new Map),bt=(0,pe.useRef)(new Map),Zt=pe.useState([]),Jt=(0,be.Z)(Zt,2),Gn=Jt[0],fr=Jt[1],Wn=(0,pe.useRef)(0),pn=(0,pe.useRef)(!1),dn=function(){pn.current||Ge({})},Cn=(0,pe.useCallback)(function(hr,Pe){var $e=Ue(Pe);bt.current.set($e,hr),et.current.set(hr,$e),Wn.current+=1;var xt=Wn.current;pr(function(){xt===Wn.current&&dn()})},[]),In=(0,pe.useCallback)(function(hr,Pe){var $e=Ue(Pe);bt.current.delete($e),et.current.delete(hr)},[]),cr=(0,pe.useCallback)(function(hr){fr(hr)},[]),jn=(0,pe.useCallback)(function(hr,Pe){var $e=et.current.get(hr)||"",xt=it($e);return Pe&&Gn.includes(xt[0])&&xt.unshift(_t),xt},[Gn]),Zn=(0,pe.useCallback)(function(hr,Pe){return hr.some(function($e){var xt=jn($e,!0);return xt.includes(Pe)})},[jn]),Jn=function(){var Pe=(0,Ye.Z)(et.current.keys());return Gn.length&&Pe.push(_t),Pe},Qn=(0,pe.useCallback)(function(hr){var Pe="".concat(et.current.get(hr)).concat(Kn),$e=new Set;return(0,Ye.Z)(bt.current.keys()).forEach(function(xt){xt.startsWith(Pe)&&$e.add(bt.current.get(xt))}),$e},[]);return pe.useEffect(function(){return function(){pn.current=!0}},[]),{registerPath:Cn,unregisterPath:In,refreshOverflowKeys:cr,isSubPathKey:Zn,getKeyPath:jn,getKeys:Jn,getSubPathKeys:Qn}}function Ke(Be){var He=pe.useRef(Be);He.current=Be;var Ge=pe.useCallback(function(){for(var et,bt=arguments.length,Zt=new Array(bt),Jt=0;Jt<bt;Jt++)Zt[Jt]=arguments[Jt];return(et=He.current)===null||et===void 0?void 0:et.call.apply(et,[He].concat(Zt))},[]);return Be?Ge:void 0}var ut=Math.random().toFixed(5).toString().slice(2),Ot=0;function Tt(Be){var He=(0,Ft.Z)(Be,{value:Be}),Ge=(0,be.Z)(He,2),et=Ge[0],bt=Ge[1];return pe.useEffect(function(){Ot+=1;var Zt="".concat(ut,"-").concat(Ot);bt("rc-menu-uuid-".concat(Zt))},[]),et}var zt=ce(15671),Ht=ce(43144),$n=ce(60136),Cr=ce(51630),Yn=ce(98423),qn=ce(42550);function rr(Be,He,Ge,et){var bt=pe.useContext(le),Zt=bt.activeKey,Jt=bt.onActive,Gn=bt.onInactive,fr={active:Zt===Be};return He||(fr.onMouseEnter=function(Wn){Ge==null||Ge({key:Be,domEvent:Wn}),Jt(Be)},fr.onMouseLeave=function(Wn){et==null||et({key:Be,domEvent:Wn}),Gn(Be)}),fr}function ar(Be){var He=pe.useContext(le),Ge=He.mode,et=He.rtl,bt=He.inlineIndent;if(Ge!=="inline")return null;var Zt=Be;return et?{paddingRight:Zt*bt}:{paddingLeft:Zt*bt}}function ot(Be){var He=Be.icon,Ge=Be.props,et=Be.children,bt;return He===null||He===!1?null:(typeof He=="function"?bt=pe.createElement(He,(0,Fe.Z)({},Ge)):typeof He!="boolean"&&(bt=He),bt||et||null)}var Qe=["item"];function vt(Be){var He=Be.item,Ge=(0,_e.Z)(Be,Qe);return Object.defineProperty(Ge,"item",{get:function(){return(0,Pn.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),He}}),Ge}var Qt=["title","attribute","elementRef"],Tn=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],en=["active"],cn=function(Be){(0,$n.Z)(Ge,Be);var He=(0,Cr.Z)(Ge);function Ge(){return(0,zt.Z)(this,Ge),He.apply(this,arguments)}return(0,Ht.Z)(Ge,[{key:"render",value:function(){var bt=this.props,Zt=bt.title,Jt=bt.attribute,Gn=bt.elementRef,fr=(0,_e.Z)(bt,Qt),Wn=(0,Yn.Z)(fr,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,Pn.ZP)(!Jt,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),pe.createElement(nn.Item,(0,fe.Z)({},Jt,{title:typeof Zt=="string"?Zt:void 0},Wn,{ref:Gn}))}}]),Ge}(pe.Component),un=pe.forwardRef(function(Be,He){var Ge,et=Be.style,bt=Be.className,Zt=Be.eventKey,Jt=Be.warnKey,Gn=Be.disabled,fr=Be.itemIcon,Wn=Be.children,pn=Be.role,dn=Be.onMouseEnter,Cn=Be.onMouseLeave,In=Be.onClick,cr=Be.onKeyDown,jn=Be.onFocus,Zn=(0,_e.Z)(Be,Tn),Jn=se(Zt),Qn=pe.useContext(le),hr=Qn.prefixCls,Pe=Qn.onItemClick,$e=Qn.disabled,xt=Qn.overflowDisabled,rt=Qn.itemIcon,It=Qn.selectedKeys,rn=Qn.onActive,fn=pe.useContext(Nt),On=fn._internalRenderMenuItem,wn="".concat(hr,"-item"),Xt=pe.useRef(),Nn=pe.useRef(),Fn=$e||Gn,mr=(0,qn.x1)(He,Nn),Bn=ln(Zt),Lr=function(Bi){return{key:Zt,keyPath:(0,Ye.Z)(Bn).reverse(),item:Xt.current,domEvent:Bi}},Zr=fr||rt,Dr=rr(Zt,Fn,dn,Cn),zr=Dr.active,xr=(0,_e.Z)(Dr,en),Or=It.includes(Zt),Jr=ar(Bn.length),ai=function(Bi){if(!Fn){var Xi=Lr(Bi);In==null||In(vt(Xi)),Pe(Xi)}},Ir=function(Bi){if(cr==null||cr(Bi),Bi.which===Rn.Z.ENTER){var Xi=Lr(Bi);In==null||In(vt(Xi)),Pe(Xi)}},ci=function(Bi){rn(Zt),jn==null||jn(Bi)},Pi={};Be.role==="option"&&(Pi["aria-selected"]=Or);var ta=pe.createElement(cn,(0,fe.Z)({ref:Xt,elementRef:mr,role:pn===null?"none":pn||"menuitem",tabIndex:Gn?null:-1,"data-menu-id":xt&&Jn?null:Jn},Zn,xr,Pi,{component:"li","aria-disabled":Gn,style:(0,Fe.Z)((0,Fe.Z)({},Jr),et),className:Se()(wn,(Ge={},(0,tt.Z)(Ge,"".concat(wn,"-active"),zr),(0,tt.Z)(Ge,"".concat(wn,"-selected"),Or),(0,tt.Z)(Ge,"".concat(wn,"-disabled"),Fn),Ge),bt),onClick:ai,onKeyDown:Ir,onFocus:ci}),Wn,pe.createElement(ot,{props:(0,Fe.Z)((0,Fe.Z)({},Be),{},{isSelected:Or}),icon:Zr}));return On&&(ta=On(ta,Be,{selected:Or})),ta});function Dn(Be,He){var Ge=Be.eventKey,et=sn(),bt=ln(Ge);return pe.useEffect(function(){if(et)return et.registerPath(Ge,bt),function(){et.unregisterPath(Ge,bt)}},[bt]),et?null:pe.createElement(un,(0,fe.Z)({},Be,{ref:He}))}var or=pe.forwardRef(Dn),Kt=["className","children"],Yr=function(He,Ge){var et=He.className,bt=He.children,Zt=(0,_e.Z)(He,Kt),Jt=pe.useContext(le),Gn=Jt.prefixCls,fr=Jt.mode,Wn=Jt.rtl;return pe.createElement("ul",(0,fe.Z)({className:Se()(Gn,Wn&&"".concat(Gn,"-rtl"),"".concat(Gn,"-sub"),"".concat(Gn,"-").concat(fr==="inline"?"inline":"vertical"),et),role:"menu"},Zt,{"data-menu-list":!0,ref:Ge}),bt)},$r=pe.forwardRef(Yr);$r.displayName="SubMenuList";var Ri=$r,Li=ce(50344);function pi(Be,He){return(0,Li.Z)(Be).map(function(Ge,et){if(pe.isValidElement(Ge)){var bt,Zt,Jt=Ge.key,Gn=(bt=(Zt=Ge.props)===null||Zt===void 0?void 0:Zt.eventKey)!==null&&bt!==void 0?bt:Jt,fr=Gn==null;fr&&(Gn="tmp_key-".concat([].concat((0,Ye.Z)(He),[et]).join("-")));var Wn={key:Gn,eventKey:Gn};return pe.cloneElement(Ge,Wn)}return Ge})}var Gi=ce(62709),yi={adjustX:1,adjustY:1},ii={topLeft:{points:["bl","tl"],overflow:yi},topRight:{points:["br","tr"],overflow:yi},bottomLeft:{points:["tl","bl"],overflow:yi},bottomRight:{points:["tr","br"],overflow:yi},leftTop:{points:["tr","tl"],overflow:yi},leftBottom:{points:["br","bl"],overflow:yi},rightTop:{points:["tl","tr"],overflow:yi},rightBottom:{points:["bl","br"],overflow:yi}},Ni={topLeft:{points:["bl","tl"],overflow:yi},topRight:{points:["br","tr"],overflow:yi},bottomLeft:{points:["tl","bl"],overflow:yi},bottomRight:{points:["tr","br"],overflow:yi},rightTop:{points:["tr","tl"],overflow:yi},rightBottom:{points:["br","bl"],overflow:yi},leftTop:{points:["tl","tr"],overflow:yi},leftBottom:{points:["bl","br"],overflow:yi}},Zi=null;function Vr(Be,He,Ge){if(He)return He;if(Ge)return Ge[Be]||Ge.other}var mi={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function Wi(Be){var He=Be.prefixCls,Ge=Be.visible,et=Be.children,bt=Be.popup,Zt=Be.popupStyle,Jt=Be.popupClassName,Gn=Be.popupOffset,fr=Be.disabled,Wn=Be.mode,pn=Be.onVisibleChange,dn=pe.useContext(le),Cn=dn.getPopupContainer,In=dn.rtl,cr=dn.subMenuOpenDelay,jn=dn.subMenuCloseDelay,Zn=dn.builtinPlacements,Jn=dn.triggerSubMenuAction,Qn=dn.forceSubMenuRender,hr=dn.rootClassName,Pe=dn.motion,$e=dn.defaultMotions,xt=pe.useState(!1),rt=(0,be.Z)(xt,2),It=rt[0],rn=rt[1],fn=In?(0,Fe.Z)((0,Fe.Z)({},Ni),Zn):(0,Fe.Z)((0,Fe.Z)({},ii),Zn),On=mi[Wn],wn=Vr(Wn,Pe,$e),Xt=pe.useRef(wn);Wn!=="inline"&&(Xt.current=wn);var Nn=(0,Fe.Z)((0,Fe.Z)({},Xt.current),{},{leavedClassName:"".concat(He,"-hidden"),removeOnLeave:!1,motionAppear:!0}),Fn=pe.useRef();return pe.useEffect(function(){return Fn.current=(0,Gr.Z)(function(){rn(Ge)}),function(){Gr.Z.cancel(Fn.current)}},[Ge]),pe.createElement(Gi.Z,{prefixCls:He,popupClassName:Se()("".concat(He,"-popup"),(0,tt.Z)({},"".concat(He,"-rtl"),In),Jt,hr),stretch:Wn==="horizontal"?"minWidth":null,getPopupContainer:Cn,builtinPlacements:fn,popupPlacement:On,popupVisible:It,popup:bt,popupStyle:Zt,popupAlign:Gn&&{offset:Gn},action:fr?[]:[Jn],mouseEnterDelay:cr,mouseLeaveDelay:jn,onPopupVisibleChange:pn,forceRender:Qn,popupMotion:Nn,fresh:!0},et)}var la=ce(62874);function ea(Be){var He=Be.id,Ge=Be.open,et=Be.keyPath,bt=Be.children,Zt="inline",Jt=pe.useContext(le),Gn=Jt.prefixCls,fr=Jt.forceSubMenuRender,Wn=Jt.motion,pn=Jt.defaultMotions,dn=Jt.mode,Cn=pe.useRef(!1);Cn.current=dn===Zt;var In=pe.useState(!Cn.current),cr=(0,be.Z)(In,2),jn=cr[0],Zn=cr[1],Jn=Cn.current?Ge:!1;pe.useEffect(function(){Cn.current&&Zn(!1)},[dn]);var Qn=(0,Fe.Z)({},Vr(Zt,Wn,pn));et.length>1&&(Qn.motionAppear=!1);var hr=Qn.onVisibleChanged;return Qn.onVisibleChanged=function(Pe){return!Cn.current&&!Pe&&Zn(!0),hr==null?void 0:hr(Pe)},jn?null:pe.createElement(Lt,{mode:Zt,locked:!Cn.current},pe.createElement(la.Z,(0,fe.Z)({visible:Jn},Qn,{forceRender:fr,removeOnLeave:!1,leavedClassName:"".concat(Gn,"-hidden")}),function(Pe){var $e=Pe.className,xt=Pe.style;return pe.createElement(Ri,{id:He,className:$e,style:xt},bt)}))}var ti=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],yt=["active"],ht=function(He){var Ge,et=He.style,bt=He.className,Zt=He.title,Jt=He.eventKey,Gn=He.warnKey,fr=He.disabled,Wn=He.internalPopupClose,pn=He.children,dn=He.itemIcon,Cn=He.expandIcon,In=He.popupClassName,cr=He.popupOffset,jn=He.popupStyle,Zn=He.onClick,Jn=He.onMouseEnter,Qn=He.onMouseLeave,hr=He.onTitleClick,Pe=He.onTitleMouseEnter,$e=He.onTitleMouseLeave,xt=(0,_e.Z)(He,ti),rt=se(Jt),It=pe.useContext(le),rn=It.prefixCls,fn=It.mode,On=It.openKeys,wn=It.disabled,Xt=It.overflowDisabled,Nn=It.activeKey,Fn=It.selectedKeys,mr=It.itemIcon,Bn=It.expandIcon,Lr=It.onItemClick,Zr=It.onOpenChange,Dr=It.onActive,zr=pe.useContext(Nt),xr=zr._internalRenderSubMenuItem,Or=pe.useContext(yr),Jr=Or.isSubPathKey,ai=ln(),Ir="".concat(rn,"-submenu"),ci=wn||fr,Pi=pe.useRef(),ta=pe.useRef(),Vi=dn!=null?dn:mr,Bi=Cn!=null?Cn:Bn,Xi=On.includes(Jt),qi=!Xt&&Xi,bi=Jr(Fn,Jt),$i=rr(Jt,ci,Pe,$e),jr=$i.active,di=(0,_e.Z)($i,yt),Ti=pe.useState(!1),ji=(0,be.Z)(Ti,2),Ba=ji[0],$a=ji[1],Aa=function(wa){ci||$a(wa)},ca=function(wa){Aa(!0),Jn==null||Jn({key:Jt,domEvent:wa})},Yi=function(wa){Aa(!1),Qn==null||Qn({key:Jt,domEvent:wa})},Mi=pe.useMemo(function(){return jr||(fn!=="inline"?Ba||Jr([Nn],Jt):!1)},[fn,jr,Nn,Ba,Jt,Jr]),Oa=ar(ai.length),ki=function(wa){ci||(hr==null||hr({key:Jt,domEvent:wa}),fn==="inline"&&Zr(Jt,!Xi))},Qr=Ke(function(fa){Zn==null||Zn(vt(fa)),Lr(fa)}),zi=function(wa){fn!=="inline"&&Zr(Jt,wa)},ua=function(){Dr(Jt)},Ui=rt&&"".concat(rt,"-popup"),ia=pe.createElement("div",(0,fe.Z)({role:"menuitem",style:Oa,className:"".concat(Ir,"-title"),tabIndex:ci?null:-1,ref:Pi,title:typeof Zt=="string"?Zt:null,"data-menu-id":Xt&&rt?null:rt,"aria-expanded":qi,"aria-haspopup":!0,"aria-controls":Ui,"aria-disabled":ci,onClick:ki,onFocus:ua},di),Zt,pe.createElement(ot,{icon:fn!=="horizontal"?Bi:void 0,props:(0,Fe.Z)((0,Fe.Z)({},He),{},{isOpen:qi,isSubMenu:!0})},pe.createElement("i",{className:"".concat(Ir,"-arrow")}))),hi=pe.useRef(fn);if(fn!=="inline"&&ai.length>1?hi.current="vertical":hi.current=fn,!Xt){var pa=hi.current;ia=pe.createElement(Wi,{mode:pa,prefixCls:Ir,visible:!Wn&&qi&&fn!=="inline",popupClassName:In,popupOffset:cr,popupStyle:jn,popup:pe.createElement(Lt,{mode:pa==="horizontal"?"vertical":pa},pe.createElement(Ri,{id:Ui,ref:ta},pn)),disabled:ci,onVisibleChange:zi},ia)}var xa=pe.createElement(nn.Item,(0,fe.Z)({role:"none"},xt,{component:"li",style:et,className:Se()(Ir,"".concat(Ir,"-").concat(fn),bt,(Ge={},(0,tt.Z)(Ge,"".concat(Ir,"-open"),qi),(0,tt.Z)(Ge,"".concat(Ir,"-active"),Mi),(0,tt.Z)(Ge,"".concat(Ir,"-selected"),bi),(0,tt.Z)(Ge,"".concat(Ir,"-disabled"),ci),Ge)),onMouseEnter:ca,onMouseLeave:Yi}),ia,!Xt&&pe.createElement(ea,{id:Ui,open:qi,keyPath:ai},pn));return xr&&(xa=xr(xa,He,{selected:bi,active:Mi,open:qi,disabled:ci})),pe.createElement(Lt,{onItemClick:Qr,mode:fn==="horizontal"?"vertical":fn,itemIcon:Vi,expandIcon:Bi},xa)};function Bt(Be){var He=Be.eventKey,Ge=Be.children,et=ln(He),bt=pi(Ge,et),Zt=sn();pe.useEffect(function(){if(Zt)return Zt.registerPath(He,et),function(){Zt.unregisterPath(He,et)}},[et]);var Jt;return Zt?Jt=bt:Jt=pe.createElement(ht,Be,bt),pe.createElement(yn.Provider,{value:et},Jt)}var an=ce(71002),kn=["className","title","eventKey","children"],ur=["children"],Er=function(He){var Ge=He.className,et=He.title,bt=He.eventKey,Zt=He.children,Jt=(0,_e.Z)(He,kn),Gn=pe.useContext(le),fr=Gn.prefixCls,Wn="".concat(fr,"-item-group");return pe.createElement("li",(0,fe.Z)({role:"presentation"},Jt,{onClick:function(dn){return dn.stopPropagation()},className:Se()(Wn,Ge)}),pe.createElement("div",{role:"presentation",className:"".concat(Wn,"-title"),title:typeof et=="string"?et:void 0},et),pe.createElement("ul",{role:"group",className:"".concat(Wn,"-list")},Zt))};function Br(Be){var He=Be.children,Ge=(0,_e.Z)(Be,ur),et=ln(Ge.eventKey),bt=pi(He,et),Zt=sn();return Zt?bt:pe.createElement(Er,(0,Yn.Z)(Ge,["warnKey"]),bt)}function Hr(Be){var He=Be.className,Ge=Be.style,et=pe.useContext(le),bt=et.prefixCls,Zt=sn();return Zt?null:pe.createElement("li",{role:"separator",className:Se()("".concat(bt,"-item-divider"),He),style:Ge})}var Nr=["label","children","key","type"];function ei(Be){return(Be||[]).map(function(He,Ge){if(He&&(0,an.Z)(He)==="object"){var et=He,bt=et.label,Zt=et.children,Jt=et.key,Gn=et.type,fr=(0,_e.Z)(et,Nr),Wn=Jt!=null?Jt:"tmp-".concat(Ge);return Zt||Gn==="group"?Gn==="group"?pe.createElement(Br,(0,fe.Z)({key:Wn},fr,{title:bt}),ei(Zt)):pe.createElement(Bt,(0,fe.Z)({key:Wn},fr,{title:bt}),ei(Zt)):Gn==="divider"?pe.createElement(Hr,(0,fe.Z)({key:Wn},fr)):pe.createElement(or,(0,fe.Z)({key:Wn},fr),bt)}return null}).filter(function(He){return He})}function gi(Be,He,Ge){var et=Be;return He&&(et=ei(He)),pi(et,Ge)}var Mr=["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"],fi=[],Ai=pe.forwardRef(function(Be,He){var Ge,et,bt=Be,Zt=bt.prefixCls,Jt=Zt===void 0?"rc-menu":Zt,Gn=bt.rootClassName,fr=bt.style,Wn=bt.className,pn=bt.tabIndex,dn=pn===void 0?0:pn,Cn=bt.items,In=bt.children,cr=bt.direction,jn=bt.id,Zn=bt.mode,Jn=Zn===void 0?"vertical":Zn,Qn=bt.inlineCollapsed,hr=bt.disabled,Pe=bt.disabledOverflow,$e=bt.subMenuOpenDelay,xt=$e===void 0?.1:$e,rt=bt.subMenuCloseDelay,It=rt===void 0?.1:rt,rn=bt.forceSubMenuRender,fn=bt.defaultOpenKeys,On=bt.openKeys,wn=bt.activeKey,Xt=bt.defaultActiveFirst,Nn=bt.selectable,Fn=Nn===void 0?!0:Nn,mr=bt.multiple,Bn=mr===void 0?!1:mr,Lr=bt.defaultSelectedKeys,Zr=bt.selectedKeys,Dr=bt.onSelect,zr=bt.onDeselect,xr=bt.inlineIndent,Or=xr===void 0?24:xr,Jr=bt.motion,ai=bt.defaultMotions,Ir=bt.triggerSubMenuAction,ci=Ir===void 0?"hover":Ir,Pi=bt.builtinPlacements,ta=bt.itemIcon,Vi=bt.expandIcon,Bi=bt.overflowedIndicator,Xi=Bi===void 0?"...":Bi,qi=bt.overflowedIndicatorPopupClassName,bi=bt.getPopupContainer,$i=bt.onClick,jr=bt.onOpenChange,di=bt.onKeyDown,Ti=bt.openAnimation,ji=bt.openTransitionName,Ba=bt._internalRenderMenuItem,$a=bt._internalRenderSubMenuItem,Aa=(0,_e.Z)(bt,Mr),ca=pe.useMemo(function(){return gi(In,Cn,fi)},[In,Cn]),Yi=pe.useState(!1),Mi=(0,be.Z)(Yi,2),Oa=Mi[0],ki=Mi[1],Qr=pe.useRef(),zi=Tt(jn),ua=cr==="rtl",Ui=(0,Ft.Z)(fn,{value:On,postState:function(Da){return Da||fi}}),ia=(0,be.Z)(Ui,2),hi=ia[0],pa=ia[1],xa=function(Da){var Xa=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function go(){pa(Da),jr==null||jr(Da)}Xa?(0,Ie.flushSync)(go):go()},fa=pe.useState(hi),wa=(0,be.Z)(fa,2),Ea=wa[0],Va=wa[1],ha=pe.useRef(!1),ka=pe.useMemo(function(){return(Jn==="inline"||Jn==="vertical")&&Qn?["vertical",Qn]:[Jn,!1]},[Jn,Qn]),Ja=(0,be.Z)(ka,2),Ga=Ja[0],so=Ja[1],Fa=Ga==="inline",Ca=pe.useState(Ga),_i=(0,be.Z)(Ca,2),Ki=_i[0],da=_i[1],Sa=pe.useState(so),Ka=(0,be.Z)(Sa,2),io=Ka[0],ho=Ka[1];pe.useEffect(function(){da(Ga),ho(so),ha.current&&(Fa?pa(Ea):xa(fi))},[Ga,so]);var Oo=pe.useState(0),Ro=(0,be.Z)(Oo,2),lo=Ro[0],Ao=Ro[1],na=lo>=ca.length-1||Ki!=="horizontal"||Pe;pe.useEffect(function(){Fa&&Va(hi)},[hi]),pe.useEffect(function(){return ha.current=!0,function(){ha.current=!1}},[]);var Oi=Ut(),Ta=Oi.registerPath,_a=Oi.unregisterPath,co=Oi.refreshOverflowKeys,ao=Oi.isSubPathKey,hs=Oi.getKeyPath,Qo=Oi.getKeys,ps=Oi.getSubPathKeys,aa=pe.useMemo(function(){return{registerPath:Ta,unregisterPath:_a}},[Ta,_a]),Ar=pe.useMemo(function(){return{isSubPathKey:ao}},[ao]);pe.useEffect(function(){co(na?fi:ca.slice(lo+1).map(function(oo){return oo.key}))},[lo,na]);var xi=(0,Ft.Z)(wn||Xt&&((Ge=ca[0])===null||Ge===void 0?void 0:Ge.key),{value:wn}),wi=(0,be.Z)(xi,2),Di=wi[0],Ha=wi[1],ja=Ke(function(oo){Ha(oo)}),Fo=Ke(function(){Ha(void 0)});(0,pe.useImperativeHandle)(He,function(){return{list:Qr.current,focus:function(Da){var Xa,go=Di!=null?Di:(Xa=ca.find(function(xs){return!xs.props.disabled}))===null||Xa===void 0?void 0:Xa.key;if(go){var yo,Ko,wo;(yo=Qr.current)===null||yo===void 0||(Ko=yo.querySelector("li[data-menu-id='".concat(ue(zi,go),"']")))===null||Ko===void 0||(wo=Ko.focus)===null||wo===void 0||wo.call(Ko,Da)}}}});var Uo=(0,Ft.Z)(Lr||[],{value:Zr,postState:function(Da){return Array.isArray(Da)?Da:Da==null?fi:[Da]}}),ls=(0,be.Z)(Uo,2),va=ls[0],No=ls[1],cs=function(Da){if(Fn){var Xa=Da.key,go=va.includes(Xa),yo;Bn?go?yo=va.filter(function(wo){return wo!==Xa}):yo=[].concat((0,Ye.Z)(va),[Xa]):yo=[Xa],No(yo);var Ko=(0,Fe.Z)((0,Fe.Z)({},Da),{},{selectedKeys:yo});go?zr==null||zr(Ko):Dr==null||Dr(Ko)}!Bn&&hi.length&&Ki!=="inline"&&xa(fi)},ul=Ke(function(oo){$i==null||$i(vt(oo)),cs(oo)}),As=Ke(function(oo,Da){var Xa=hi.filter(function(yo){return yo!==oo});if(Da)Xa.push(oo);else if(Ki!=="inline"){var go=ps(oo);Xa=Xa.filter(function(yo){return!go.has(yo)})}(0,_n.Z)(hi,Xa,!0)||xa(Xa,!0)}),ms=function(Da,Xa){var go=Xa!=null?Xa:!hi.includes(Da);As(Da,go)},zo=nr(Ki,Di,ua,zi,Qr,Qo,hs,Ha,ms,di);pe.useEffect(function(){ki(!0)},[]);var Ts=pe.useMemo(function(){return{_internalRenderMenuItem:Ba,_internalRenderSubMenuItem:$a}},[Ba,$a]),Ds=Ki!=="horizontal"||Pe?ca:ca.map(function(oo,Da){return pe.createElement(Lt,{key:oo.key,overflowDisabled:Da>lo},oo)}),Ys=pe.createElement(nn,(0,fe.Z)({id:jn,ref:Qr,prefixCls:"".concat(Jt,"-overflow"),component:"ul",itemComponent:or,className:Se()(Jt,"".concat(Jt,"-root"),"".concat(Jt,"-").concat(Ki),Wn,(et={},(0,tt.Z)(et,"".concat(Jt,"-inline-collapsed"),io),(0,tt.Z)(et,"".concat(Jt,"-rtl"),ua),et),Gn),dir:cr,style:fr,role:"menu",tabIndex:dn,data:Ds,renderRawItem:function(Da){return Da},renderRawRest:function(Da){var Xa=Da.length,go=Xa?ca.slice(-Xa):null;return pe.createElement(Bt,{eventKey:_t,title:Xi,disabled:na,internalPopupClose:Xa===0,popupClassName:qi},go)},maxCount:Ki!=="horizontal"||Pe?nn.INVALIDATE:nn.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Da){Ao(Da)},onKeyDown:zo},Aa));return pe.createElement(Nt.Provider,{value:Ts},pe.createElement(Ee.Provider,{value:zi},pe.createElement(Lt,{prefixCls:Jt,rootClassName:Gn,mode:Ki,openKeys:hi,rtl:ua,disabled:hr,motion:Oa?Jr:null,defaultMotions:Oa?ai:null,activeKey:Di,onActive:ja,onInactive:Fo,selectedKeys:va,inlineIndent:Or,subMenuOpenDelay:xt,subMenuCloseDelay:It,forceSubMenuRender:rn,builtinPlacements:Pi,triggerSubMenuAction:ci,getPopupContainer:bi,itemIcon:ta,expandIcon:Vi,onItemClick:ul,onOpenChange:As},pe.createElement(yr.Provider,{value:Ar},Ys),pe.createElement("div",{style:{display:"none"},"aria-hidden":!0},pe.createElement(hn.Provider,{value:aa},ca)))))}),Si=Ai,Ce=Si;Ce.Item=or,Ce.SubMenu=Bt,Ce.ItemGroup=Br,Ce.Divider=Hr;var Ne=Ce},66680:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return tt}});var fe=ce(67294);function tt(Fe){var Ye=fe.useRef();Ye.current=Fe;var be=fe.useCallback(function(){for(var _e,Le=arguments.length,Se=new Array(Le),pe=0;pe<Le;pe++)Se[pe]=arguments[pe];return(_e=Ye.current)===null||_e===void 0?void 0:_e.call.apply(_e,[Ye].concat(Se))},[]);return be}},21770:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return _e}});var fe=ce(97685),tt=ce(66680),Fe=ce(8410),Ye=ce(63896);function be(Le){return Le!==void 0}function _e(Le,Se){var pe=Se||{},Te=pe.defaultValue,gt=pe.value,ze=pe.onChange,Pt=pe.postState,kt=(0,Ye.Z)(function(){return be(gt)?gt:be(Te)?typeof Te=="function"?Te():Te:typeof Le=="function"?Le():Le}),pt=(0,fe.Z)(kt,2),Je=pt[0],De=pt[1],Dt=gt!==void 0?gt:Je,Yt=Pt?Pt(Dt):Dt,nt=(0,tt.Z)(ze),ct=(0,Ye.Z)([Dt]),Ie=(0,fe.Z)(ct,2),Me=Ie[0],Ve=Ie[1];(0,Fe.o)(function(){var Ct=Me[0];Je!==Ct&&nt(Je,Ct)},[Me]),(0,Fe.o)(function(){be(gt)||De(gt)},[gt]);var Xe=(0,tt.Z)(function(Ct,wt){De(Ct,wt),Ve([Dt],wt)});return[Yt,Xe]}},91881:function(Ln,qt,ce){"use strict";var fe=ce(71002),tt=ce(80334);function Fe(Ye,be){var _e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Le=new Set;function Se(pe,Te){var gt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,ze=Le.has(pe);if((0,tt.ZP)(!ze,"Warning: There may be circular references"),ze)return!1;if(pe===Te)return!0;if(_e&&gt>1)return!1;Le.add(pe);var Pt=gt+1;if(Array.isArray(pe)){if(!Array.isArray(Te)||pe.length!==Te.length)return!1;for(var kt=0;kt<pe.length;kt++)if(!Se(pe[kt],Te[kt],Pt))return!1;return!0}if(pe&&Te&&(0,fe.Z)(pe)==="object"&&(0,fe.Z)(Te)==="object"){var pt=Object.keys(pe);return pt.length!==Object.keys(Te).length?!1:pt.every(function(Je){return Se(pe[Je],Te[Je],Pt)})}return!1}return Se(Ye,be)}qt.Z=Fe},98423:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return tt}});var fe=ce(1413);function tt(Fe,Ye){var be=(0,fe.Z)({},Fe);return Array.isArray(Ye)&&Ye.forEach(function(_e){delete be[_e]}),be}},64217:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return Se}});var fe=ce(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`,Ye="".concat(tt," ").concat(Fe).split(/[\s\n]+/),be="aria-",_e="data-";function Le(pe,Te){return pe.indexOf(Te)===0}function Se(pe){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,gt;Te===!1?gt={aria:!0,data:!0,attr:!0}:Te===!0?gt={aria:!0}:gt=(0,fe.Z)({},Te);var ze={};return Object.keys(pe).forEach(function(Pt){(gt.aria&&(Pt==="role"||Le(Pt,be))||gt.data&&Le(Pt,_e)||gt.attr&&Ye.includes(Pt))&&(ze[Pt]=pe[Pt])}),ze}},73299:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return Ci}});var fe=ce(87462),tt=ce(1413),Fe=ce(71002),Ye=ce(97685),be=ce(4942),_e=ce(45987),Le=ce(67294),Se=ce(73935),pe=ce(94184),Te=ce.n(pe),gt=ce(48555),ze=Le.forwardRef(function(mt,Mn){var En=mt.height,An=mt.offsetY,sr=mt.offsetX,nr=mt.children,pr=mt.prefixCls,Kn=mt.onInnerResize,Ue=mt.innerProps,it=mt.rtl,_t=mt.extra,Ut={},Ke={display:"flex",flexDirection:"column"};if(An!==void 0){var ut;Ut={height:En,position:"relative",overflow:"hidden"},Ke=(0,tt.Z)((0,tt.Z)({},Ke),{},(ut={transform:"translateY(".concat(An,"px)")},(0,be.Z)(ut,it?"marginRight":"marginLeft",-sr),(0,be.Z)(ut,"position","absolute"),(0,be.Z)(ut,"left",0),(0,be.Z)(ut,"right",0),(0,be.Z)(ut,"top",0),ut))}return Le.createElement("div",{style:Ut},Le.createElement(gt.Z,{onResize:function(Tt){var zt=Tt.offsetHeight;zt&&Kn&&Kn()}},Le.createElement("div",(0,fe.Z)({style:Ke,className:Te()((0,be.Z)({},"".concat(pr,"-holder-inner"),pr)),ref:Mn},Ue),nr,_t)))});ze.displayName="Filler";var Pt=ze,kt=function(Mn){return+setTimeout(Mn,16)},pt=function(Mn){return clearTimeout(Mn)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(kt=function(Mn){return window.requestAnimationFrame(Mn)},pt=function(Mn){return window.cancelAnimationFrame(Mn)});var Je=0,De=new Map;function Dt(mt){De.delete(mt)}var Yt=function(Mn){var En=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Je+=1;var An=Je;function sr(nr){if(nr===0)Dt(An),Mn();else{var pr=kt(function(){sr(nr-1)});De.set(An,pr)}}return sr(En),An};Yt.cancel=function(mt){var Mn=De.get(mt);return Dt(Mn),pt(Mn)};var nt=Yt;function ct(mt,Mn){var En="touches"in mt?mt.touches[0]:mt;return En[Mn?"pageX":"pageY"]}var Ie=Le.forwardRef(function(mt,Mn){var En,An=mt.prefixCls,sr=mt.rtl,nr=mt.scrollOffset,pr=mt.scrollRange,Kn=mt.onStartMove,Ue=mt.onStopMove,it=mt.onScroll,_t=mt.horizontal,Ut=mt.spinSize,Ke=mt.containerSize,ut=mt.style,Ot=mt.thumbStyle,Tt=Le.useState(!1),zt=(0,Ye.Z)(Tt,2),Ht=zt[0],$n=zt[1],Cr=Le.useState(null),Yn=(0,Ye.Z)(Cr,2),qn=Yn[0],rr=Yn[1],ar=Le.useState(null),ot=(0,Ye.Z)(ar,2),Qe=ot[0],vt=ot[1],Qt=!sr,Tn=Le.useRef(),en=Le.useRef(),cn=Le.useState(!1),un=(0,Ye.Z)(cn,2),Dn=un[0],or=un[1],Kt=Le.useRef(),Yr=function(){clearTimeout(Kt.current),or(!0),Kt.current=setTimeout(function(){or(!1)},3e3)},$r=pr-Ke||0,Ri=Ke-Ut||0,Li=$r>0,pi=Le.useMemo(function(){if(nr===0||$r===0)return 0;var la=nr/$r;return la*Ri},[nr,$r,Ri]),Gi=function(ea){ea.stopPropagation(),ea.preventDefault()},yi=Le.useRef({top:pi,dragging:Ht,pageY:qn,startTop:Qe});yi.current={top:pi,dragging:Ht,pageY:qn,startTop:Qe};var ii=function(ea){$n(!0),rr(ct(ea,_t)),vt(yi.current.top),Kn(),ea.stopPropagation(),ea.preventDefault()};Le.useEffect(function(){var la=function(ht){ht.preventDefault()},ea=Tn.current,ti=en.current;return ea.addEventListener("touchstart",la),ti.addEventListener("touchstart",ii),function(){ea.removeEventListener("touchstart",la),ti.removeEventListener("touchstart",ii)}},[]);var Ni=Le.useRef();Ni.current=$r;var Zi=Le.useRef();Zi.current=Ri,Le.useEffect(function(){if(Ht){var la,ea=function(ht){var Bt=yi.current,an=Bt.dragging,kn=Bt.pageY,ur=Bt.startTop;if(nt.cancel(la),an){var Er=ct(ht,_t)-kn,Br=ur;!Qt&&_t?Br-=Er:Br+=Er;var Hr=Ni.current,Nr=Zi.current,ei=Nr?Br/Nr:0,gi=Math.ceil(ei*Hr);gi=Math.max(gi,0),gi=Math.min(gi,Hr),la=nt(function(){it(gi,_t)})}},ti=function(){$n(!1),Ue()};return window.addEventListener("mousemove",ea),window.addEventListener("touchmove",ea),window.addEventListener("mouseup",ti),window.addEventListener("touchend",ti),function(){window.removeEventListener("mousemove",ea),window.removeEventListener("touchmove",ea),window.removeEventListener("mouseup",ti),window.removeEventListener("touchend",ti),nt.cancel(la)}}},[Ht]),Le.useEffect(function(){Yr()},[nr]),Le.useImperativeHandle(Mn,function(){return{delayHidden:Yr}});var Vr="".concat(An,"-scrollbar"),mi={position:"absolute",visibility:Dn&&Li?null:"hidden"},Wi={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return _t?(mi.height=8,mi.left=0,mi.right=0,mi.bottom=0,Wi.height="100%",Wi.width=Ut,Qt?Wi.left=pi:Wi.right=pi):(mi.width=8,mi.top=0,mi.bottom=0,Qt?mi.right=0:mi.left=0,Wi.width="100%",Wi.height=Ut,Wi.top=pi),Le.createElement("div",{ref:Tn,className:Te()(Vr,(En={},(0,be.Z)(En,"".concat(Vr,"-horizontal"),_t),(0,be.Z)(En,"".concat(Vr,"-vertical"),!_t),(0,be.Z)(En,"".concat(Vr,"-visible"),Dn),En)),style:(0,tt.Z)((0,tt.Z)({},mi),ut),onMouseDown:Gi,onMouseMove:Yr},Le.createElement("div",{ref:en,className:Te()("".concat(Vr,"-thumb"),(0,be.Z)({},"".concat(Vr,"-thumb-moving"),Ht)),style:(0,tt.Z)((0,tt.Z)({},Wi),Ot),onMouseDown:ii}))}),Me=Ie;function Ve(mt){var Mn=mt.children,En=mt.setRef,An=Le.useCallback(function(sr){En(sr)},[]);return Le.cloneElement(Mn,{ref:An})}function Xe(mt,Mn,En,An,sr,nr,pr){var Kn=pr.getKey;return mt.slice(Mn,En+1).map(function(Ue,it){var _t=Mn+it,Ut=nr(Ue,_t,{style:{width:An}}),Ke=Kn(Ue);return Le.createElement(Ve,{key:Ke,setRef:function(Ot){return sr(Ue,Ot)}},Ut)})}function Ct(mt){return mt instanceof HTMLElement||mt instanceof SVGElement}function wt(mt){return Ct(mt)?mt:mt instanceof Le.Component?Se.findDOMNode(mt):null}var Mt=ce(15671),je=ce(43144),Rt=function(){function mt(){(0,Mt.Z)(this,mt),this.maps=void 0,this.id=0,this.maps=Object.create(null)}return(0,je.Z)(mt,[{key:"set",value:function(En,An){this.maps[En]=An,this.id+=1}},{key:"get",value:function(En){return this.maps[En]}}]),mt}(),At=Rt;function xn(mt,Mn,En){var An=Le.useState(0),sr=(0,Ye.Z)(An,2),nr=sr[0],pr=sr[1],Kn=(0,Le.useRef)(new Map),Ue=(0,Le.useRef)(new At),it=(0,Le.useRef)();function _t(){nt.cancel(it.current)}function Ut(){var ut=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;_t();var Ot=function(){Kn.current.forEach(function(zt,Ht){if(zt&&zt.offsetParent){var $n=wt(zt),Cr=$n.offsetHeight;Ue.current.get(Ht)!==Cr&&Ue.current.set(Ht,$n.offsetHeight)}}),pr(function(zt){return zt+1})};ut?Ot():it.current=nt(Ot)}function Ke(ut,Ot){var Tt=mt(ut),zt=Kn.current.get(Tt);Ot?(Kn.current.set(Tt,Ot),Ut()):Kn.current.delete(Tt),!zt!=!Ot&&(Ot?Mn==null||Mn(ut):En==null||En(ut))}return(0,Le.useEffect)(function(){return _t},[]),[Ke,Ut,Ue.current,nr]}function jt(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var vn=jt()?Le.useLayoutEffect:Le.useEffect,er=function(Mn,En){var An=Le.useRef(!0);vn(function(){return Mn(An.current)},En),vn(function(){return An.current=!1,function(){An.current=!0}},[])},Sr=function(Mn,En){er(function(An){if(!An)return Mn()},En)},qe=er;function Ae(mt){var Mn=Le.useRef();Mn.current=mt;var En=Le.useCallback(function(){for(var An,sr=arguments.length,nr=new Array(sr),pr=0;pr<sr;pr++)nr[pr]=arguments[pr];return(An=Mn.current)===null||An===void 0?void 0:An.call.apply(An,[Mn].concat(nr))},[]);return En}function $t(mt){var Mn=React.useRef(!1),En=React.useState(mt),An=_slicedToArray(En,2),sr=An[0],nr=An[1];React.useEffect(function(){return Mn.current=!1,function(){Mn.current=!0}},[]);function pr(Kn,Ue){Ue&&Mn.current||nr(Kn)}return[sr,pr]}function Hn(mt){return mt!==void 0}function bn(mt,Mn){var En=Mn||{},An=En.defaultValue,sr=En.value,nr=En.onChange,pr=En.postState,Kn=useState(function(){return Hn(sr)?sr:Hn(An)?typeof An=="function"?An():An:typeof mt=="function"?mt():mt}),Ue=_slicedToArray(Kn,2),it=Ue[0],_t=Ue[1],Ut=sr!==void 0?sr:it,Ke=pr?pr(Ut):Ut,ut=useEvent(nr),Ot=useState([Ut]),Tt=_slicedToArray(Ot,2),zt=Tt[0],Ht=Tt[1];useLayoutUpdateEffect(function(){var Cr=zt[0];it!==Cr&&ut(it,Cr)},[zt]),useLayoutUpdateEffect(function(){Hn(sr)||_t(sr)},[sr]);var $n=useEvent(function(Cr,Yn){_t(Cr,Yn),Ht([Ut],Yn)});return[Ke,$n]}var at=ce(31461);function ft(mt,Mn,En){var An=React.useRef({});return(!("value"in An.current)||En(An.current.condition,Mn))&&(An.current.value=mt(),An.current.condition=Mn),An.current.value}function Gt(mt,Mn){typeof mt=="function"?mt(Mn):_typeof(mt)==="object"&&mt&&"current"in mt&&(mt.current=Mn)}function zn(){for(var mt=arguments.length,Mn=new Array(mt),En=0;En<mt;En++)Mn[En]=arguments[En];var An=Mn.filter(function(sr){return sr});return An.length<=1?An[0]:function(sr){Mn.forEach(function(nr){Gt(nr,sr)})}}function mn(){for(var mt=arguments.length,Mn=new Array(mt),En=0;En<mt;En++)Mn[En]=arguments[En];return useMemo(function(){return zn.apply(void 0,Mn)},Mn,function(An,sr){return An.length!==sr.length||An.every(function(nr,pr){return nr!==sr[pr]})})}function nn(mt){var Mn,En,An=isMemo(mt)?mt.type.type:mt.type;return!(typeof An=="function"&&!((Mn=An.prototype)!==null&&Mn!==void 0&&Mn.render)||typeof mt=="function"&&!((En=mt.prototype)!==null&&En!==void 0&&En.render))}function Ft(mt){return!isValidElement(mt)||isFragment(mt)?!1:nn(mt)}function Pn(mt,Mn,En,An){if(!Mn.length)return En;var sr=_toArray(Mn),nr=sr[0],pr=sr.slice(1),Kn;return!mt&&typeof nr=="number"?Kn=[]:Array.isArray(mt)?Kn=_toConsumableArray(mt):Kn=_objectSpread({},mt),An&&En===void 0&&pr.length===1?delete Kn[nr][pr[0]]:Kn[nr]=Pn(Kn[nr],pr,En,An),Kn}function _n(mt,Mn,En){var An=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return Mn.length&&An&&En===void 0&&!get(mt,Mn.slice(0,-1))?mt:Pn(mt,Mn,En,An)}function Ee(mt){return _typeof(mt)==="object"&&mt!==null&&Object.getPrototypeOf(mt)===Object.prototype}function ue(mt){return Array.isArray(mt)?[]:{}}var se=typeof Reflect=="undefined"?Object.keys:Reflect.ownKeys;function ye(){for(var mt=arguments.length,Mn=new Array(mt),En=0;En<mt;En++)Mn[En]=arguments[En];var An=ue(Mn[0]);return Mn.forEach(function(sr){function nr(pr,Kn){var Ue=new Set(Kn),it=get(sr,pr),_t=Array.isArray(it);if(_t||Ee(it)){if(!Ue.has(it)){Ue.add(it);var Ut=get(An,pr);_t?An=_n(An,pr,[]):(!Ut||_typeof(Ut)!=="object")&&(An=_n(An,pr,ue(it))),se(it).forEach(function(Ke){nr([].concat(_toConsumableArray(pr),[Ke]),Ue)})}}else An=_n(An,pr,it)}nr([])}),An}var ve={},le=[],We=function(Mn){le.push(Mn)};function Lt(mt,Mn){if(0)var En}function tn(mt,Mn){if(0)var En}function hn(){ve={}}function sn(mt,Mn,En){!Mn&&!ve[En]&&(mt(!1,En),ve[En]=!0)}function yn(mt,Mn){sn(Lt,mt,Mn)}function ln(mt,Mn){sn(tn,mt,Mn)}yn.preMessage=We,yn.resetWarned=hn,yn.noteOnce=ln;var yr=null,Fr=10;function Nt(mt,Mn,En,An,sr,nr,pr,Kn){var Ue=Le.useRef(),it=Le.useState(null),_t=(0,Ye.Z)(it,2),Ut=_t[0],Ke=_t[1];return qe(function(){if(Ut&&Ut.times<Fr){if(!mt.current){Ke(function(Yr){return(0,tt.Z)({},Yr)});return}nr();var ut=Ut.targetAlign,Ot=Ut.originAlign,Tt=Ut.index,zt=Ut.offset,Ht=mt.current.clientHeight,$n=!1,Cr=ut,Yn=null;if(Ht){for(var qn=ut||Ot,rr=0,ar=0,ot=0,Qe=Math.min(Mn.length-1,Tt),vt=0;vt<=Qe;vt+=1){var Qt=sr(Mn[vt]);ar=rr;var Tn=En.get(Qt);ot=ar+(Tn===void 0?An:Tn),rr=ot}for(var en=qn==="top"?zt:Ht-zt,cn=Qe;cn>=0;cn-=1){var un=sr(Mn[cn]),Dn=En.get(un);if(Dn===void 0){$n=!0;break}if(en-=Dn,en<=0)break}switch(qn){case"top":Yn=ar-zt;break;case"bottom":Yn=ot-Ht+zt;break;default:{var or=mt.current.scrollTop,Kt=or+Ht;ar<or?Cr="top":ot>Kt&&(Cr="bottom")}}Yn!==null&&pr(Yn),Yn!==Ut.lastTop&&($n=!0)}$n&&Ke(function(Yr){return(0,tt.Z)((0,tt.Z)({},Yr),{},{times:Yr.times+1,targetAlign:Cr,lastTop:Yn})})}},[Ut,mt.current]),function(ut){if(ut==null){Kn();return}if(nt.cancel(Ue.current),typeof ut=="number")pr(ut);else if(ut&&(0,Fe.Z)(ut)==="object"){var Ot,Tt=ut.align;"index"in ut?Ot=ut.index:Ot=Mn.findIndex(function($n){return sr($n)===ut.key});var zt=ut.offset,Ht=zt===void 0?0:zt;Ke({times:0,index:Ot,offset:Ht,originAlign:Tt})}}}function Rn(mt,Mn,En,An){var sr=En-mt,nr=Mn-En,pr=Math.min(sr,nr)*2;if(An<=pr){var Kn=Math.floor(An/2);return An%2?En+Kn+1:En-Kn}return sr>nr?En-(An-nr):En+(An-sr)}function Gr(mt,Mn,En){var An=mt.length,sr=Mn.length,nr,pr;if(An===0&&sr===0)return null;An<sr?(nr=mt,pr=Mn):(nr=Mn,pr=mt);var Kn={__EMPTY_ITEM__:!0};function Ue(Ot){return Ot!==void 0?En(Ot):Kn}for(var it=null,_t=Math.abs(An-sr)!==1,Ut=0;Ut<pr.length;Ut+=1){var Ke=Ue(nr[Ut]),ut=Ue(pr[Ut]);if(Ke!==ut){it=Ut,_t=_t||Ke!==Ue(pr[Ut+1]);break}}return it===null?null:{index:it,multiple:_t}}function li(mt,Mn,En){var An=Le.useState(mt),sr=(0,Ye.Z)(An,2),nr=sr[0],pr=sr[1],Kn=Le.useState(null),Ue=(0,Ye.Z)(Kn,2),it=Ue[0],_t=Ue[1];return Le.useEffect(function(){var Ut=Gr(nr||[],mt||[],Mn);(Ut==null?void 0:Ut.index)!==void 0&&(En==null||En(Ut.index),_t(mt[Ut.index])),pr(mt)},[mt]),[it]}var st=(typeof navigator=="undefined"?"undefined":(0,Fe.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),Wt=st,Vn=function(mt,Mn){var En=(0,Le.useRef)(!1),An=(0,Le.useRef)(null);function sr(){clearTimeout(An.current),En.current=!0,An.current=setTimeout(function(){En.current=!1},50)}var nr=(0,Le.useRef)({top:mt,bottom:Mn});return nr.current.top=mt,nr.current.bottom=Mn,function(pr){var Kn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ue=pr<0&&nr.current.top||pr>0&&nr.current.bottom;return Kn&&Ue?(clearTimeout(An.current),En.current=!1):(!Ue||En.current)&&sr(),!En.current&&Ue}};function ir(mt,Mn,En,An,sr){var nr=(0,Le.useRef)(0),pr=(0,Le.useRef)(null),Kn=(0,Le.useRef)(null),Ue=(0,Le.useRef)(!1),it=Vn(Mn,En);function _t(zt,Ht){nt.cancel(pr.current),nr.current+=Ht,Kn.current=Ht,!it(Ht)&&(Wt||zt.preventDefault(),pr.current=nt(function(){var $n=Ue.current?10:1;sr(nr.current*$n),nr.current=0}))}function Ut(zt,Ht){sr(Ht,!0),Wt||zt.preventDefault()}var Ke=(0,Le.useRef)(null),ut=(0,Le.useRef)(null);function Ot(zt){if(mt){nt.cancel(ut.current),ut.current=nt(function(){Ke.current=null},2);var Ht=zt.deltaX,$n=zt.deltaY,Cr=zt.shiftKey,Yn=Ht,qn=$n;(Ke.current==="sx"||!Ke.current&&Cr&&$n&&!Ht)&&(Yn=$n,qn=0,Ke.current="sx");var rr=Math.abs(Yn),ar=Math.abs(qn);Ke.current===null&&(Ke.current=An&&rr>ar?"x":"y"),Ke.current==="y"?_t(zt,qn):Ut(zt,Yn)}}function Tt(zt){mt&&(Ue.current=zt.detail===Kn.current)}return[Ot,Tt]}var gr=14/15;function Pr(mt,Mn,En){var An=(0,Le.useRef)(!1),sr=(0,Le.useRef)(0),nr=(0,Le.useRef)(null),pr=(0,Le.useRef)(null),Kn,Ue=function(Ke){if(An.current){var ut=Math.ceil(Ke.touches[0].pageY),Ot=sr.current-ut;sr.current=ut,En(Ot)&&Ke.preventDefault(),clearInterval(pr.current),pr.current=setInterval(function(){Ot*=gr,(!En(Ot,!0)||Math.abs(Ot)<=.1)&&clearInterval(pr.current)},16)}},it=function(){An.current=!1,Kn()},_t=function(Ke){Kn(),Ke.touches.length===1&&!An.current&&(An.current=!0,sr.current=Math.ceil(Ke.touches[0].pageY),nr.current=Ke.target,nr.current.addEventListener("touchmove",Ue),nr.current.addEventListener("touchend",it))};Kn=function(){nr.current&&(nr.current.removeEventListener("touchmove",Ue),nr.current.removeEventListener("touchend",it))},qe(function(){return mt&&Mn.current.addEventListener("touchstart",_t),function(){var Ut;(Ut=Mn.current)===null||Ut===void 0||Ut.removeEventListener("touchstart",_t),Kn(),clearInterval(pr.current)}},[mt])}var Ur=20;function Xr(){var mt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,En=mt/Mn*100;return isNaN(En)&&(En=0),En=Math.max(En,Ur),En=Math.min(En,mt/2),Math.floor(En)}function qr(mt,Mn,En,An){var sr=Le.useMemo(function(){return[new Map,[]]},[mt,En.id,An]),nr=(0,Ye.Z)(sr,2),pr=nr[0],Kn=nr[1],Ue=function(_t){var Ut=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_t,Ke=pr.get(_t),ut=pr.get(Ut);if(Ke===void 0||ut===void 0)for(var Ot=mt.length,Tt=Kn.length;Tt<Ot;Tt+=1){var zt,Ht=mt[Tt],$n=Mn(Ht);pr.set($n,Tt);var Cr=(zt=En.get($n))!==null&&zt!==void 0?zt:An;if(Kn[Tt]=(Kn[Tt-1]||0)+Cr,$n===_t&&(Ke=Tt),$n===Ut&&(ut=Tt),Ke!==void 0&&ut!==void 0)break}return{top:Kn[Ke-1]||0,bottom:Kn[ut]}};return Ue}var ui=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles"],br=[],Ei={overflowY:"auto",overflowAnchor:"none"};function sa(mt,Mn){var En=mt.prefixCls,An=En===void 0?"rc-virtual-list":En,sr=mt.className,nr=mt.height,pr=mt.itemHeight,Kn=mt.fullHeight,Ue=Kn===void 0?!0:Kn,it=mt.style,_t=mt.data,Ut=mt.children,Ke=mt.itemKey,ut=mt.virtual,Ot=mt.direction,Tt=mt.scrollWidth,zt=mt.component,Ht=zt===void 0?"div":zt,$n=mt.onScroll,Cr=mt.onVirtualScroll,Yn=mt.onVisibleChange,qn=mt.innerProps,rr=mt.extraRender,ar=mt.styles,ot=(0,_e.Z)(mt,ui),Qe=!!(ut!==!1&&nr&&pr),vt=Qe&&_t&&(pr*_t.length>nr||!!Tt),Qt=Ot==="rtl",Tn=Te()(An,(0,be.Z)({},"".concat(An,"-rtl"),Qt),sr),en=_t||br,cn=(0,Le.useRef)(),un=(0,Le.useRef)(),Dn=(0,Le.useState)(0),or=(0,Ye.Z)(Dn,2),Kt=or[0],Yr=or[1],$r=(0,Le.useState)(0),Ri=(0,Ye.Z)($r,2),Li=Ri[0],pi=Ri[1],Gi=(0,Le.useState)(!1),yi=(0,Ye.Z)(Gi,2),ii=yi[0],Ni=yi[1],Zi=function(){Ni(!0)},Vr=function(){Ni(!1)},mi=Le.useCallback(function(Xt){return typeof Ke=="function"?Ke(Xt):Xt==null?void 0:Xt[Ke]},[Ke]),Wi={getKey:mi};function la(Xt){Yr(function(Nn){var Fn;typeof Xt=="function"?Fn=Xt(Nn):Fn=Xt;var mr=Gn(Fn);return cn.current.scrollTop=mr,mr})}var ea=(0,Le.useRef)({start:0,end:en.length}),ti=(0,Le.useRef)(),yt=li(en,mi),ht=(0,Ye.Z)(yt,1),Bt=ht[0];ti.current=Bt;var an=xn(mi,null,null),kn=(0,Ye.Z)(an,4),ur=kn[0],Er=kn[1],Br=kn[2],Hr=kn[3],Nr=Le.useMemo(function(){if(!Qe)return{scrollHeight:void 0,start:0,end:en.length-1,offset:void 0};if(!vt){var Xt;return{scrollHeight:((Xt=un.current)===null||Xt===void 0?void 0:Xt.offsetHeight)||0,start:0,end:en.length-1,offset:void 0}}for(var Nn=0,Fn,mr,Bn,Lr=en.length,Zr=0;Zr<Lr;Zr+=1){var Dr=en[Zr],zr=mi(Dr),xr=Br.get(zr),Or=Nn+(xr===void 0?pr:xr);Or>=Kt&&Fn===void 0&&(Fn=Zr,mr=Nn),Or>Kt+nr&&Bn===void 0&&(Bn=Zr),Nn=Or}return Fn===void 0&&(Fn=0,mr=0,Bn=Math.ceil(nr/pr)),Bn===void 0&&(Bn=en.length-1),Bn=Math.min(Bn+1,en.length-1),{scrollHeight:Nn,start:Fn,end:Bn,offset:mr}},[vt,Qe,Kt,en,Hr,nr]),ei=Nr.scrollHeight,gi=Nr.start,Mr=Nr.end,fi=Nr.offset;ea.current.start=gi,ea.current.end=Mr;var Ai=Le.useState({width:0,height:nr}),Si=(0,Ye.Z)(Ai,2),Ce=Si[0],Ne=Si[1],Be=function(Nn){Ne({width:Nn.width||Nn.offsetWidth,height:Nn.height||Nn.offsetHeight})},He=(0,Le.useRef)(),Ge=(0,Le.useRef)(),et=Le.useMemo(function(){return Xr(Ce.width,Tt)},[Ce.width,Tt]),bt=Le.useMemo(function(){return Xr(Ce.height,ei)},[Ce.height,ei]),Zt=ei-nr,Jt=(0,Le.useRef)(Zt);Jt.current=Zt;function Gn(Xt){var Nn=Xt;return Number.isNaN(Jt.current)||(Nn=Math.min(Nn,Jt.current)),Nn=Math.max(Nn,0),Nn}var fr=Kt<=0,Wn=Kt>=Zt,pn=Vn(fr,Wn),dn=function(){return{x:Qt?-Li:Li,y:Kt}},Cn=(0,Le.useRef)(dn()),In=Ae(function(){if(Cr){var Xt=dn();(Cn.current.x!==Xt.x||Cn.current.y!==Xt.y)&&(Cr(Xt),Cn.current=Xt)}});function cr(Xt,Nn){var Fn=Xt;Nn?((0,Se.flushSync)(function(){pi(Fn)}),In()):la(Fn)}function jn(Xt){var Nn=Xt.currentTarget.scrollTop;Nn!==Kt&&la(Nn),$n==null||$n(Xt),In()}var Zn=function(Nn){var Fn=Nn,mr=Tt-Ce.width;return Fn=Math.max(Fn,0),Fn=Math.min(Fn,mr),Fn},Jn=Ae(function(Xt,Nn){Nn?((0,Se.flushSync)(function(){pi(function(Fn){var mr=Fn+(Qt?-Xt:Xt);return Zn(mr)})}),In()):la(function(Fn){var mr=Fn+Xt;return mr})}),Qn=ir(Qe,fr,Wn,!!Tt,Jn),hr=(0,Ye.Z)(Qn,2),Pe=hr[0],$e=hr[1];Pr(Qe,cn,function(Xt,Nn){return pn(Xt,Nn)?!1:(Pe({preventDefault:function(){},deltaY:Xt}),!0)}),qe(function(){function Xt(Fn){Qe&&Fn.preventDefault()}var Nn=cn.current;return Nn.addEventListener("wheel",Pe),Nn.addEventListener("DOMMouseScroll",$e),Nn.addEventListener("MozMousePixelScroll",Xt),function(){Nn.removeEventListener("wheel",Pe),Nn.removeEventListener("DOMMouseScroll",$e),Nn.removeEventListener("MozMousePixelScroll",Xt)}},[Qe]),qe(function(){Tt&&pi(function(Xt){return Zn(Xt)})},[Ce.width,Tt]);var xt=function(){var Nn,Fn;(Nn=He.current)===null||Nn===void 0||Nn.delayHidden(),(Fn=Ge.current)===null||Fn===void 0||Fn.delayHidden()},rt=Nt(cn,en,Br,pr,mi,function(){return Er(!0)},la,xt);Le.useImperativeHandle(Mn,function(){return{getScrollInfo:dn,scrollTo:function(Nn){function Fn(mr){return mr&&(0,Fe.Z)(mr)==="object"&&("left"in mr||"top"in mr)}Fn(Nn)?(Nn.left!==void 0&&pi(Zn(Nn.left)),rt(Nn.top)):rt(Nn)}}}),qe(function(){if(Yn){var Xt=en.slice(gi,Mr+1);Yn(Xt,en)}},[gi,Mr,en]);var It=qr(en,mi,Br,pr),rn=rr==null?void 0:rr({start:gi,end:Mr,virtual:vt,offsetX:Li,offsetY:fi,rtl:Qt,getSize:It}),fn=Xe(en,gi,Mr,Tt,ur,Ut,Wi),On=null;nr&&(On=(0,tt.Z)((0,be.Z)({},Ue?"height":"maxHeight",nr),Ei),Qe&&(On.overflowY="hidden",Tt&&(On.overflowX="hidden"),ii&&(On.pointerEvents="none")));var wn={};return Qt&&(wn.dir="rtl"),Le.createElement("div",(0,fe.Z)({style:(0,tt.Z)((0,tt.Z)({},it),{},{position:"relative"}),className:Tn},wn,ot),Le.createElement(gt.Z,{onResize:Be},Le.createElement(Ht,{className:"".concat(An,"-holder"),style:On,ref:cn,onScroll:jn,onMouseEnter:xt},Le.createElement(Pt,{prefixCls:An,height:ei,offsetX:Li,offsetY:fi,scrollWidth:Tt,onInnerResize:Er,ref:un,innerProps:qn,rtl:Qt,extra:rn},fn))),vt&&ei>nr&&Le.createElement(Me,{ref:He,prefixCls:An,scrollOffset:Kt,scrollRange:ei,rtl:Qt,onScroll:cr,onStartMove:Zi,onStopMove:Vr,spinSize:bt,containerSize:Ce.height,style:ar==null?void 0:ar.verticalScrollBar,thumbStyle:ar==null?void 0:ar.verticalScrollBarThumb}),vt&&Tt&&Le.createElement(Me,{ref:Ge,prefixCls:An,scrollOffset:Li,scrollRange:Tt,rtl:Qt,onScroll:cr,onStartMove:Zi,onStopMove:Vr,spinSize:et,containerSize:Ce.width,horizontal:!0,style:ar==null?void 0:ar.horizontalScrollBar,thumbStyle:ar==null?void 0:ar.horizontalScrollBarThumb}))}var Ji=Le.forwardRef(sa);Ji.displayName="List";var Qi=Ji,Ci=Qi},66392:function(Ln,qt){"use strict";var ce;var fe=Symbol.for("react.element"),tt=Symbol.for("react.portal"),Fe=Symbol.for("react.fragment"),Ye=Symbol.for("react.strict_mode"),be=Symbol.for("react.profiler"),_e=Symbol.for("react.provider"),Le=Symbol.for("react.context"),Se=Symbol.for("react.server_context"),pe=Symbol.for("react.forward_ref"),Te=Symbol.for("react.suspense"),gt=Symbol.for("react.suspense_list"),ze=Symbol.for("react.memo"),Pt=Symbol.for("react.lazy"),kt=Symbol.for("react.offscreen"),pt;pt=Symbol.for("react.module.reference");function Je(De){if(typeof De=="object"&&De!==null){var Dt=De.$$typeof;switch(Dt){case fe:switch(De=De.type,De){case Fe:case be:case Ye:case Te:case gt:return De;default:switch(De=De&&De.$$typeof,De){case Se:case Le:case pe:case Pt:case ze:case _e:return De;default:return Dt}}case tt:return Dt}}}ce=Le,ce=_e,ce=fe,ce=pe,ce=Fe,ce=Pt,ce=ze,ce=tt,ce=be,ce=Ye,ce=Te,ce=gt,ce=function(){return!1},ce=function(){return!1},ce=function(De){return Je(De)===Le},ce=function(De){return Je(De)===_e},ce=function(De){return typeof De=="object"&&De!==null&&De.$$typeof===fe},ce=function(De){return Je(De)===pe},ce=function(De){return Je(De)===Fe},ce=function(De){return Je(De)===Pt},ce=function(De){return Je(De)===ze},ce=function(De){return Je(De)===tt},ce=function(De){return Je(De)===be},ce=function(De){return Je(De)===Ye},ce=function(De){return Je(De)===Te},ce=function(De){return Je(De)===gt},ce=function(De){return typeof De=="string"||typeof De=="function"||De===Fe||De===be||De===Ye||De===Te||De===gt||De===kt||typeof De=="object"&&De!==null&&(De.$$typeof===Pt||De.$$typeof===ze||De.$$typeof===_e||De.$$typeof===Le||De.$$typeof===pe||De.$$typeof===pt||De.getModuleId!==void 0)},ce=Je},31461:function(Ln,qt,ce){"use strict";ce(66392)},84279:function(Ln,qt,ce){"use strict";var fe=Object.defineProperty,tt=Object.defineProperties,Fe=Object.getOwnPropertyDescriptors,Ye=Object.getOwnPropertySymbols,be=Object.prototype.hasOwnProperty,_e=Object.prototype.propertyIsEnumerable,Le=(a,y,b)=>y in a?fe(a,y,{enumerable:!0,configurable:!0,writable:!0,value:b}):a[y]=b,Se=(a,y)=>{for(var b in y||(y={}))be.call(y,b)&&Le(a,b,y[b]);if(Ye)for(var b of Ye(y))_e.call(y,b)&&Le(a,b,y[b]);return a},pe=(a,y)=>tt(a,Fe(y)),Te=a=>typeof a=="symbol"?a:a+"",gt=(a,y)=>{var b={};for(var E in a)be.call(a,E)&&y.indexOf(E)<0&&(b[E]=a[E]);if(a!=null&&Ye)for(var E of Ye(a))y.indexOf(E)<0&&_e.call(a,E)&&(b[E]=a[E]);return b};function ze(a){return Array.isArray(a)}var Pt={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 kt(){return"window"in globalThis&&"document"in globalThis}function pt(){return"matchMedia"in window?window.matchMedia("(pointer: coarse)").matches:"ontouchstart"in window||navigator.maxTouchPoints>0}function Je(){return typeof navigator.vibrate=="function"}function De(){var a,y;if(!kt())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 Dt(){if(!kt())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 Yt(){return HTMLElement.prototype.hasOwnProperty("popover")}var nt={strings:Pt,_locale:"",_dirty:!1,_subscribers:[],_numberFormatter:void 0,get locale(){return nt._locale||(nt._locale=kt()?navigator.language.slice(0,5):"en-US"),nt._locale},set locale(a){nt._locale=a,nt._numberFormatter=void 0,nt.dirty=!0},get numberFormatter(){return nt._numberFormatter||(nt._numberFormatter=new Intl.NumberFormat(nt.locale)),nt._numberFormatter},merge(a,y){if(typeof a=="string"&&y)nt.strings[a]=Se(Se({},nt.strings[a]),y),nt.dirty=!0;else for(const b of Object.keys(a))nt.merge(b,a[b])},get dirty(){return nt._dirty},set dirty(a){nt._dirty||nt._dirty===a||(nt._dirty=!0,setTimeout(()=>{nt._dirty=!1,this._subscribers.forEach(y=>y==null?void 0:y())},0))},subscribe(a){return nt._subscribers.push(a),nt._subscribers.length-1},unsubscribe(a){a<0||a>=nt._subscribers.length||(nt._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=ct(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=ct(E);ee&&b.setAttribute("aria-label",ee)}}}};function ct(a,...y){if(a===void 0)return;let b="";const E=nt.locale;nt.strings[E]&&(b=nt.strings[E][a]);const ee=E.slice(0,2);if(!b&&nt.strings[ee]&&(b=nt.strings[ee][a]),b||(b=nt.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=nt.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"},Me={blue:"#0072BD",orange:"#D95319",yellow:"#EDB120",purple:"#7E2F8E",green:"#77AC30",cyan:"#4DBEEE",red:"#A2142F"},Ve={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"},Xe={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"},Ct={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"},wt={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 Mt(a){var y,b,E,ee,re,ae;const de=a.split("!");let he,ge,xe,Re=255,Ze=255,dt=255,St=-1;const Sn=de.length>0&&de[0].startsWith("-");Sn&&(de[0]=de[0].slice(1));for(let wr=0;wr<de.length;wr++){he=Re,ge=Ze,xe=dt;const gn=(y=de[wr].trim().match(/^([A-Za-z\d-]+)/))==null?void 0:y[1],tr=gn==null?void 0:gn.toLowerCase(),_r=gn&&(ae=(re=(ee=(E=(b=Xe[tr])!=null?b:Xe[Ct[gn]])!=null?E:Me[gn])!=null?ee:wt[gn])!=null?re:Ie[gn])!=null?ae:de[wr].trim();let lr=_r.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(lr!=null&&lr[1]&&lr[2]&&lr[3])Re=Math.max(0,Math.min(255,Number.parseInt(lr[1],16))),Ze=Math.max(0,Math.min(255,Number.parseInt(lr[2],16))),dt=Math.max(0,Math.min(255,Number.parseInt(lr[3],16)));else if(lr=_r.match(/^#([\da-f]{3})$/i),lr!=null&&lr[1]){const si=Number.parseInt(lr[1][0],16),Ii=Number.parseInt(lr[1][1],16),vi=Number.parseInt(lr[1][2],16);Re=Math.max(0,Math.min(255,si*16+si)),Ze=Math.max(0,Math.min(255,Ii*16+Ii)),dt=Math.max(0,Math.min(255,vi*16+vi))}else if(lr=_r.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i),lr!=null&&lr[1]&&lr[2]&&lr[3])Re=Math.max(0,Math.min(255,Number.parseInt(lr[1]))),Ze=Math.max(0,Math.min(255,Number.parseInt(lr[2]))),dt=Math.max(0,Math.min(255,Number.parseInt(lr[3])));else return;St>=0&&(Re=(1-St)*Re+St*he,Ze=(1-St)*Ze+St*ge,dt=(1-St)*dt+St*xe,St=-1),wr+1<de.length&&(St=Math.max(0,Math.min(100,Number.parseInt(de[++wr])))/100)}return St>=0&&(Re=St*Re+(1-St)*he,Ze=St*Ze+(1-St)*ge,dt=St*dt+(1-St)*xe),Sn&&(Re=255-Re,Ze=255-Ze,dt=255-dt),"#"+("00"+Math.round(Re).toString(16)).slice(-2)+("00"+Math.round(Ze).toString(16)).slice(-2)+("00"+Math.round(dt).toString(16)).slice(-2)}function je(a){var y,b;return a=a.trim(),(b=(y=Ve[a.toLowerCase()])!=null?y:Ve[Ct[a]])!=null?b:Mt(a)}function Rt(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 At(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 xn(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*At(re,ee,y+2)),g:Math.round(255*At(re,ee,y)),b:Math.round(255*At(re,ee,y-2))}}function jt(a){return a<0?0:a>255?255:Math.round(a)}function vn(a){const{r:y,g:b,b:E}=a;let ee=((1<<24)+(jt(y)<<16)+(jt(b)<<8)+jt(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 er(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,he;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?he=0:ge<=.5?he=ae/(re+ee):he=ae/(2-re-ee),{h:de,s:he,l:ge}}function Sr(a){let y=Rt(a);if(!y)return a;let{h:b,s:E,l:ee}=er(y);return E+=.1,ee-=.1,vn(xn({h:b,s:E,l:ee}))}var qe={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"},Ae={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},$t=[{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 Hn(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 $t)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(Ae[re]||re)}return a}function bn(a){var y;if((a<119808||a>120831)&&(a<8448||a>8527))return{char:String.fromCodePoint(a)};for(const b in Ae)if(Ae[b]===a){a=(y=b.codePointAt(0))!=null?y:0;break}for(const b of $t)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 at(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=qe[ee];if(re)re.startsWith("\\")?b+=re+" ":b+=re;else{const{char:ae,variant:de,style:he}=bn(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(he){case"bold":re=`\\mathbf{${re}}`;break;case"italic":re=`\\mathit{${re}}`;break;case"bolditalic":re=`\\mathbfit{${re}}`;break}b+=re}}return b}function ft(a){return a?Array.isArray(a)?a:typeof a=="object"&&"group"in a?a.group:[]:[]}var Gt={},zn=Se({},qe),mn={},nn={},Ft={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}"},Pn={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}},_n={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}},Ee={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:_n},"amsmath.sty":{package:Pn,primitive:!0},"texvc.sty":{package:Ft,primitive:!1}},ue={" ":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},se=/[\w!@*()-=+{}\[\]\\';:?/.,~<>`|$%#&^" ]/,ye,ve;Dt()?(ye=new RegExp("\\p{Letter}","u"),ve=new RegExp("[0-9\\p{Letter}]","u")):(ye=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/,ve=/[\da-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/);function le(a,y,b="mord",E){y!==void 0&&(Gt[a]={definitionType:"symbol",type:b,variant:E,codepoint:y},zn[y]||(zn[y]=a))}function We(a,y,b){if(typeof a=="string"){for(let E=0;E<a.length;E++){const ee=a.charAt(E);le(ee,ee.codePointAt(0))}return}for(const[E,ee,re,ae]of a)le(E,ee,re!=null?re:y,ae!=null?ae:b)}function Lt(a,y){for(let b=a;b<=y;b++)le(String.fromCodePoint(b),b)}function tn(a){var y;return(y=nn[a])!=null?y:null}function hn(a,y){var b,E;if(y.length===0||y==="\\"||!y.startsWith("\\"))return[];const ee=[];for(const ae in mn)ae.startsWith(y)&&!mn[ae].infix&&ee.push({match:ae,frequency:(b=mn[ae].frequency)!=null?b:0});for(const ae in Gt)ae.startsWith(y)&&ee.push({match:ae,frequency:(E=Gt[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 he,ge;return ae.frequency===de.frequency?ae.match.length===de.match.length?ae.match<de.match?-1:1:ae.match.length-de.match.length:((he=de.frequency)!=null?he:0)-((ge=ae.frequency)!=null?ge:0)}),ee.map(ae=>ae.match)}function sn(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:sn(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:sn(b[0].slice(1))});for(let E=1;E<=b.length;E++)y.push(...yn(b[E]))}return y}function ln(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 yr(a,y){typeof a=="string"&&(a=[a]);const b={tabular:!1,params:[],createAtom:y};for(const E of a)nn[E]=b}function Fr(a,y,b){typeof a=="string"&&(a=[a]);const ee={tabular:!0,params:yn(y),createAtom:b};for(const re of a)nn[re]=ee}function Nt(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")mn["\\"+a]=re;else for(const ae of a)mn["\\"+ae]=re}var Rn;function Gr(a){return Rn||(Rn=st(Ee)),a?st(Se(Se({},Rn),a)):Rn}function li(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 Se({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 st(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]=li(E.package[ee],{expand:!E.primitive,captureSelection:E.captureSelection});else y[b]=li(E)}return y}function Wt(a,y="math"){if(!a||a.length===0)return null;let b=null;if(a.startsWith("\\")){if(b=mn[a],b)return!b.ifMode||b.ifMode===y?b:null;y==="math"?b=Gt[a]:ue[a]&&(b={definitionType:"symbol",type:"mord",codepoint:ue[a]})}else if(y==="math"){if(b=Gt[a],!b&&a.length===1){const E=ir("math",a.codePointAt(0));return E.startsWith("\\")?pe(Se({},Wt(E,"math")),{command:E}):null}}else ue[a]?b={definitionType:"symbol",type:"mord",codepoint:ue[a]}:y==="text"&&(b={definitionType:"symbol",type:"mord",codepoint:a.codePointAt(0)});return b!=null?b:null}function Vn(a,y){if(!a.startsWith("\\"))return null;const b=a.slice(1);return y[b]}function ir(a,y){if(y===void 0)return"";if(a==="math"&&zn[y])return zn[y];if(a==="text"){const b=Object.keys(ue).find(E=>ue[E]===y);return b||String.fromCodePoint(y)}return String.fromCodePoint(y)}var gr=[0,.68889,0,0,.72222],Pr=[0,.68889,0,0,.66667],Ur=[0,.68889,0,0,.77778],Xr=[0,.68889,0,0,.61111],qr=[.16667,.68889,0,0,.77778],ui=[0,.68889,0,0,.55556],br=[0,0,0,0,.25],Ei=[0,.825,0,0,2.33334],sa=[0,.9,0,0,2.33334],Ji=[0,.68889,0,0,.54028],Qi=[-.03598,.46402,0,0,.5],Ci=[-.13313,.36687,0,0,1],mt=[.01354,.52239,0,0,1],Mn=[.01354,.52239,0,0,1.11111],En=[0,.54986,0,0,1],An=[0,.69224,0,0,.5],sr=[0,.43056,0,0,1],nr=[.08198,.58198,0,0,.77778],pr=[.19444,.69224,0,0,.41667],Kn=[.1808,.675,0,0,1],Ue=[.19444,.69224,0,0,.83334],it=[.13667,.63667,0,0,1],_t=[-.064,.437,0,0,1.334],Ut=[.08167,.58167,0,0,.77778],Ke=[0,.69224,0,0,.72222],ut=[0,.69224,0,0,.66667],Ot=[-.13313,.36687,0,0,.77778],Tt=[.06062,.54986,0,0,.77778],zt=[0,.69224,0,0,.77778],Ht=[.25583,.75583,0,0,.77778],$n=[.25142,.75726,0,0,.77778],Cr=[.20576,.70576,0,0,.77778],Yn=[.30274,.79383,0,0,.77778],qn=[.22958,.72958,0,0,.77778],rr=[.1808,.675,0,0,.77778],ar=[.13667,.63667,0,0,.77778],ot=[.13597,.63597,0,0,.77778],Qe=[.03517,.54986,0,0,.77778],vt=[0,.675,0,0,.77778],Qt=[.19444,.69224,0,0,.61111],Tn=[0,.54986,0,0,.76042],en=[0,.54986,0,0,.66667],cn=[.0391,.5391,0,0,.77778],un=[.03517,.54986,0,0,1.33334],Dn=[.38569,.88569,0,0,.77778],or=[.23222,.74111,0,0,.77778],Kt=[.19444,.69224,0,0,.77778],Yr=[0,.37788,0,0,.5],$r=[0,.54986,0,0,.72222],Ri=[0,.69224,0,0,.83334],Li=[.11111,.69224,0,0,.66667],pi=[.26167,.75726,0,0,.77778],Gi=[.48256,.98256,0,0,.77778],yi=[.28481,.79383,0,0,.77778],ii=[.08167,.58167,0,0,.22222],Ni=[.08167,.58167,0,0,.38889],Zi=[0,.43056,.04028,0,.66667],Vr=[.41951,.91951,0,0,.77778],mi=[.24982,.74947,0,0,.38865],Wi=[.08319,.58283,0,0,.75623],la=[0,.10803,0,0,.27764],ea=[0,.47534,0,0,.50181],ti=[.18906,.47534,0,0,.50181],yt=[0,.69141,0,0,.50181],ht=[.24982,.74947,0,0,.27764],Bt=[0,.69141,0,0,.21471],an=[.25,.75,0,0,.44722],kn=[0,.64444,0,0,.575],ur=[.08556,.58556,0,0,.89444],Er=[0,.69444,0,0,.89444],Br=[0,.68611,0,0,.9],Hr=[0,.68611,0,0,.86944],Nr=[.25,.75,0,0,.575],ei=[.25,.75,0,0,.31944],gi=[0,.69444,0,0,.63889],Mr=[0,.69444,0,0,.31944],fi=[0,.44444,0,0,.63889],Ai=[0,.44444,0,0,.51111],Si=[0,.69444,0,0,.575],Ce=[.13333,.63333,0,0,.89444],Ne=[0,.44444,0,0,.31944],Be=[0,.69444,0,0,.86944],He=[0,.68611,0,0,.69166],Ge=[0,.68611,0,0,.83055],et=[0,.68611,0,0,.89444],bt=[0,.69444,0,0,.60278],Zt=[.19444,.69444,0,0,.51111],Jt=[0,.69444,0,0,.83055],Gn=[-.10889,.39111,0,0,1.14999],fr=[.19444,.69444,0,0,.575],Wn=[.19444,.69444,0,0,1.14999],pn=[.19444,.69444,0,0,.70277],dn=[.05556,.75,0,0,.575],Cn=[0,.68611,0,0,.95833],In=[.08556,.58556,0,0,.76666],cr=[-.02639,.47361,0,0,.575],jn=[0,.44444,0,0,.89444],Zn=[0,.55556,0,0,.76666],Jn=[-.10889,.39111,0,0,.89444],Qn=[.00222,.50222,0,0,.89444],hr=[.19667,.69667,0,0,.89444],Pe=[.08556,.58556,0,0,1.14999],$e=[0,.69444,0,0,.70277],xt=[-.02778,.47222,0,0,.575],rt=[.25,.75,0,0,.51111],It=[-.13889,.36111,0,0,1.14999],rn=[.19444,.69444,0,0,1.02222],fn=[.12963,.69444,0,0,.89444],On=[.19444,.69444,0,0,.44722],wn=[0,.64444,.13167,0,.59111],Xt=[.19444,.64444,.13167,0,.59111],Nn=[0,.68611,.17208,0,.8961],Fn=[.19444,.44444,.105,0,.53222],mr=[0,.44444,.085,0,.82666],Bn=[0,.69444,.06709,0,.59111],Lr=[0,.69444,.12945,0,.35555],Zr=[0,.69444,0,0,.94888],Dr=[0,.69444,.11472,0,.59111],zr=[0,.68611,.10778,0,.88555],xr=[0,.69444,.07939,0,.62055],Or=[0,.69444,.12417,0,.30667],Jr=[0,.64444,.13556,0,.51111],ai=[.19444,.64444,.13556,0,.51111],Ir=[0,.68333,.16389,0,.74333],ci=[.19444,.43056,.08847,0,.46],Pi=[0,.43056,.07514,0,.71555],ta=[0,.69444,.06646,0,.51111],Vi=[0,.69444,0,0,.83129],Bi=[0,.69444,.1225,0,.51111],Xi=[0,.68333,.09403,0,.76666],qi=[0,.68333,.11111,0,.76666],bi=[0,.69444,.06961,0,.51444],$i=[0,.69444,0,0,.27778],jr=[.25,.75,0,0,.38889],di=[0,.64444,0,0,.5],Ti=[0,.69444,0,0,.77778],ji=[0,.68333,0,0,.75],Ba=[0,.68333,0,0,.77778],$a=[0,.68333,0,0,.68056],Aa=[0,.68333,0,0,.72222],ca=[.25,.75,0,0,.5],Yi=[.25,.75,0,0,.27778],Mi=[0,.69444,0,0,.5],Oa=[0,.69444,0,0,.55556],ki=[0,.43056,0,0,.44445],Qr=[0,.43056,0,0,.5],zi=[.19444,.43056,0,0,.55556],ua=[0,.43056,0,0,.55556],Ui=[.08333,.58333,0,0,.77778],ia=[0,.43056,0,0,.27778],hi=[0,.66786,0,0,.27778],pa=[0,.69444,0,0,.75],xa=[0,.66786,0,0,.5],fa=[0,.68333,0,0,.625],wa=[.19444,.69444,0,0,.44445],Ea=[0,.69444,0,0,.72222],Va=[.19444,.69444,0,0,.5],ha=[.19444,.69444,0,0,1],ka=[.011,.511,0,0,1.126],Ja=[.19444,.69444,0,0,.61111],Ga=[.05556,.75,0,0,.5],so=[0,.68333,0,0,.83334],Fa=[.0391,.5391,0,0,.66667],Ca=[-.05555,.44445,0,0,.5],_i=[0,.43056,0,0,.77778],Ki=[0,.55556,0,0,.66667],da=[-.03625,.46375,0,0,.77778],Sa=[-.01688,.48312,0,0,.77778],Ka=[.0391,.5391,0,0,1],io=[0,.69444,0,0,.61111],ho=[-.03472,.46528,0,0,.5],Oo=[.25,.75,0,0,.44445],Ro=[-.14236,.35764,0,0,1],lo=[.244,.744,0,0,.412],Ao=[.19444,.69444,0,0,.88889],na=[.12963,.69444,0,0,.77778],Oi=[.19444,.69444,0,0,.38889],Ta=[.011,.511,0,0,1.638],_a=[.19444,.69444,0,0,0],co=[0,.44444,0,0,.575],ao=[.19444,.44444,0,0,.575],hs=[0,.68611,0,0,.75555],Qo=[0,.69444,0,0,.66759],ps=[0,.68611,0,0,.80555],aa=[0,.68611,.08229,0,.98229],Ar=[0,.68611,0,0,.76666],xi=[0,.44444,0,0,.58472],wi=[.19444,.44444,0,0,.6118],Di=[.19444,.43056,0,0,.5],Ha=[0,.68333,.02778,.08334,.76278],ja=[0,.68333,.08125,.05556,.83125],Fo=[0,.43056,0,.05556,.48472],Uo=[.19444,.43056,0,.08334,.51702],ls=[.25,.75,0,0,.42778],va=[0,.69444,0,0,.55],No=[0,.69444,0,0,.73334],cs=[0,.69444,0,0,.79445],ul=[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],oo=[0,.45833,0,0,.56111],Da=[0,.69444,0,0,.30556],Xa=[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],vc=[0,.69444,0,0,.73752],Xc=[0,.69444,.09205,0,.5],Ks=[0,.69444,.09031,0,.77778],Is=[0,.69444,.07816,0,.27778],yc=[0,.69444,.00316,0,.5],Yl=[.19444,.69444,0,0,.83334],Ia=[.05556,.75,0,0,.83334],ma=[0,.75,0,0,.5],Ho=[.125,.08333,0,0,.27778],es=[0,.08333,0,0,.27778],ga=[0,.65556,0,0,.5],za=[0,.69444,0,0,.47222],Ra=[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],Zd=[0,.44444,0,0,.44445],Vd=[.19444,.44444,0,0,.51667],qc=[0,.44444,0,0,.38333],Zu=[0,.44444,0,0,.51667],Yc=[0,.69444,0,0,.83334],jd=[.35001,.85,0,0,.45834],Jc=[.35001,.85,0,0,.57778],Qc=[.35001,.85,0,0,.41667],Vu=[.35001,.85,0,0,.58334],bc=[0,.72222,0,0,.55556],eu=[1e-5,.6,0,0,.66667],ju=[1e-5,.6,0,0,.77778],Ql=[.25001,.75,0,0,.94445],Gd=[.306,.805,.19445,0,.47222],xc=[.30612,.805,.19445,0,.47222],Zo=[.25001,.75,0,0,.83334],Pl=[.35001,.85,0,0,.47222],Gu=[.25001,.75,0,0,1.11111],Xu=[.65002,1.15,0,0,.59722],vs=[.65002,1.15,0,0,.81111],Za=[.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],qu=[.862,1.36,.44445,0,.55556],tu=[.86225,1.36,.44445,0,.55556],Ol=[.55001,1.05,0,0,1.11111],nu=[.65002,1.15,0,0,.52778],ru=[.65002,1.15,0,0,.61111],Rl=[.55001,1.05,0,0,1.51112],Yu=[.95003,1.45,0,0,.73611],iu=[.95003,1.45,0,0,1.04445],Qs=[.95003,1.45,0,0,.52778],wc=[.95003,1.45,0,0,.75],Sc=[0,.75,0,0,1.44445],au=[.95003,1.45,0,0,.58334],Cc=[1.25003,1.75,0,0,.79167],ou=[1.25003,1.75,0,0,1.27778],Ju=[1.25003,1.75,0,0,.58334],su=[1.25003,1.75,0,0,.80556],Mc=[0,.825,0,0,1.8889],lu=[1.25003,1.75,0,0,.63889],cu=[.64502,1.155,0,0,.875],Ec=[1e-5,.6,0,0,.875],uu=[-99e-5,.601,0,0,.66667],du=[.64502,1.155,0,0,.66667],Xd=[1e-5,.9,0,0,.88889],Qu=[.65002,1.15,0,0,.88889],Nl=[.90001,0,0,0,.88889],fu=[-.00499,.605,0,0,1.05556],Bl=[0,.12,0,0,.45],oi=[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],kc=[0,0,0,0,.525],Yd={"AMS-Regular":{32:br,65:gr,66:Pr,67:gr,68:gr,69:Pr,70:Xr,71:Ur,72:Ur,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:Ur,76:Pr,77:[0,.68889,0,0,.94445],78:gr,79:qr,80:Xr,81:qr,82:gr,83:ui,84:Pr,85:gr,86:gr,87:[0,.68889,0,0,1],88:gr,89:gr,90:Pr,107:ui,160:br,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:ui,295:Ji,710:Ei,732:sa,770:Ei,771:sa,989:Ut,1008:Zi,8245:[0,.54986,0,0,.275],8463:Ji,8487:gr,8498:ui,8502:Pr,8503:[0,.68889,0,0,.44445],8504:Pr,8513:[0,.68889,0,0,.63889],8592:Qi,8594:Qi,8602:Ci,8603:Ci,8606:mt,8608:mt,8610:Mn,8611:Mn,8619:En,8620:En,8621:[-.13313,.37788,0,0,1.38889],8622:Ci,8624:An,8625:An,8630:sr,8631:sr,8634:nr,8635:nr,8638:pr,8639:pr,8642:pr,8643:pr,8644:Kn,8646:Kn,8647:Kn,8648:Ue,8649:Kn,8650:Ue,8651:mt,8652:mt,8653:Ci,8654:Ci,8655:Ci,8666:it,8667:it,8669:[-.13313,.37788,0,0,1],8672:_t,8674:_t,8705:[0,.825,0,0,.5],8708:ui,8709:Ut,8717:[0,.43056,0,0,.42917],8722:Qi,8724:[.08198,.69224,0,0,.77778],8726:Ut,8733:zt,8736:Ke,8737:Ke,8738:[.03517,.52239,0,0,.72222],8739:ii,8740:[.25142,.74111,0,0,.27778],8741:Ni,8742:[.25142,.74111,0,0,.5],8756:ut,8757:ut,8764:Ot,8765:[-.13313,.37788,0,0,.77778],8769:Ot,8770:da,8774:Yn,8776:Sa,8778:Ut,8782:Tt,8783:Tt,8785:nr,8786:nr,8787:nr,8790:zt,8791:qn,8796:[.08198,.91667,0,0,.77778],8806:Ht,8807:Ht,8808:$n,8809:$n,8812:[.25583,.75583,0,0,.5],8814:Cr,8815:Cr,8816:Yn,8817:Yn,8818:qn,8819:qn,8822:rr,8823:rr,8828:ar,8829:ar,8830:qn,8831:qn,8832:Cr,8833:Cr,8840:Yn,8841:Yn,8842:ot,8843:ot,8847:Qe,8848:Qe,8858:nr,8859:nr,8861:nr,8862:vt,8863:vt,8864:vt,8865:vt,8872:[0,.69224,0,0,.61111],8873:Ke,8874:[0,.69224,0,0,.88889],8876:Xr,8877:Xr,8878:gr,8879:gr,8882:Qe,8883:Qe,8884:ar,8885:ar,8888:[0,.54986,0,0,1.11111],8890:zi,8891:Qt,8892:Qt,8901:[0,.54986,0,0,.27778],8903:Ut,8905:Ut,8906:Ut,8907:zt,8908:zt,8909:[-.03598,.46402,0,0,.77778],8910:Tn,8911:Tn,8912:Qe,8913:Qe,8914:en,8915:en,8916:ut,8918:cn,8919:cn,8920:un,8921:un,8922:Dn,8923:Dn,8926:ar,8927:ar,8928:Yn,8929:Yn,8934:or,8935:or,8936:or,8937:or,8938:Cr,8939:Cr,8940:Yn,8941:Yn,8994:Kt,8995:Kt,9416:[.15559,.69224,0,0,.90222],9484:An,9488:An,9492:Yr,9496:Yr,9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:vt,9633:vt,9650:$r,9651:$r,9654:Qe,9660:$r,9661:$r,9664:Qe,9674:Li,9733:[.19444,.69224,0,0,.94445],10003:Ri,10016:Ri,10731:Li,10846:[.19444,.75583,0,0,.61111],10877:ar,10878:ar,10885:Ht,10886:Ht,10887:ot,10888:ot,10889:pi,10890:pi,10891:Gi,10892:Gi,10901:ar,10902:ar,10933:$n,10934:$n,10935:pi,10936:pi,10937:pi,10938:pi,10949:Ht,10950:Ht,10955:yi,10956:yi,57350:ii,57351:Ni,57352:Ut,57353:Zi,57356:$n,57357:$n,57358:Vr,57359:Yn,57360:Yn,57361:Vr,57366:$n,57367:$n,57368:$n,57369:$n,57370:ot,57371:ot},"Caligraphic-Regular":{32:br,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:br},"Fraktur-Regular":{32:br,33:[0,.69141,0,0,.29574],34:Bt,38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:mi,41:mi,42:[0,.62119,0,0,.27764],43:Wi,44:la,45:Wi,46:la,47:[.24982,.74947,0,0,.50181],48:ea,49:ea,50:ea,51:ti,52:ti,53:ti,54:yt,55:ti,56:yt,57:ti,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:ht,93:ht,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:br,8216:Bt,8217:Bt,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:br,33:[0,.69444,0,0,.35],34:bt,35:[.19444,.69444,0,0,.95833],36:dn,37:[.05556,.75,0,0,.95833],38:Er,39:Mr,40:an,41:an,42:[0,.75,0,0,.575],43:Ce,44:[.19444,.15556,0,0,.31944],45:qc,46:[0,.15556,0,0,.31944],47:Nr,48:kn,49:kn,50:kn,51:kn,52:kn,53:kn,54:kn,55:kn,56:kn,57:kn,58:Ne,59:[.19444,.44444,0,0,.31944],60:ur,61:Jn,62:ur,63:[0,.69444,0,0,.54305],64:Er,65:Hr,66:[0,.68611,0,0,.81805],67:Ge,68:[0,.68611,0,0,.88194],69:hs,70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:Br,73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:He,77:[0,.68611,0,0,1.09166],78:Br,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:Hr,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:ei,92:Nr,93:ei,94:Si,95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:gi,99:Ai,100:gi,101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:gi,105:Mr,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:Mr,109:[0,.44444,0,0,.95833],110:fi,111:co,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:fi,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:Ai,123:Nr,124:ei,125:Nr,126:[.35,.34444,0,0,.575],160:br,163:[0,.69444,0,0,.86853],168:Si,172:[0,.44444,0,0,.76666],176:Be,177:Ce,184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:Ce,216:[.04861,.73472,0,0,.89444],223:po,230:[0,.44444,0,0,.83055],247:Ce,248:[.09722,.54167,0,0,.575],305:Ne,338:[0,.68611,0,0,1.16944],339:jn,567:[.19444,.44444,0,0,.35139],710:Si,711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:Si,715:Si,728:Si,729:Mr,730:Be,732:Si,733:Si,915:He,916:Cn,920:et,923:ps,926:Ar,928:Br,931:Ge,933:et,934:Ge,936:et,937:Ge,8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:Mr,8217:Mr,8220:bt,8221:bt,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:$e,8592:Gn,8593:fr,8594:Gn,8595:fr,8596:Gn,8597:Nr,8598:Wn,8599:Wn,8600:Wn,8601:Wn,8636:Gn,8637:Gn,8640:Gn,8641:Gn,8656:Gn,8657:pn,8658:Gn,8659:pn,8660:Gn,8661:[.25,.75,0,0,.70277],8704:gi,8706:[0,.69444,.06389,0,.62847],8707:gi,8709:dn,8711:Cn,8712:In,8715:In,8722:Ce,8723:Ce,8725:Nr,8726:Nr,8727:xt,8728:cr,8729:cr,8730:[.18,.82,0,0,.95833],8733:jn,8734:[0,.44444,0,0,1.14999],8736:Ke,8739:ei,8741:Nr,8743:Zn,8744:Zn,8745:Zn,8746:Zn,8747:[.19444,.69444,.12778,0,.56875],8764:Jn,8768:[.19444,.69444,0,0,.31944],8771:Qn,8776:[.02444,.52444,0,0,.89444],8781:Qn,8801:Qn,8804:hr,8805:hr,8810:Pe,8811:Pe,8826:ur,8827:ur,8834:ur,8835:ur,8838:hr,8839:hr,8846:Zn,8849:hr,8850:hr,8851:Zn,8852:Zn,8853:Ce,8854:Ce,8855:Ce,8856:Ce,8857:Ce,8866:$e,8867:$e,8868:Er,8869:Er,8900:cr,8901:[-.02639,.47361,0,0,.31944],8902:xt,8968:rt,8969:rt,8970:rt,8971:rt,8994:It,8995:It,9651:rn,9657:xt,9661:rn,9667:xt,9711:Wn,9824:fn,9825:fn,9826:fn,9827:fn,9837:[0,.75,0,0,.44722],9838:On,9839:On,10216:an,10217:an,10815:Br,10927:hr,10928:hr,57376:_a},"Main-BoldItalic":{32:br,33:[0,.69444,.11417,0,.38611],34:xr,35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:Lr,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:wn,49:wn,50:wn,51:wn,52:Xt,53:wn,54:wn,55:Xt,56:wn,57:wn,58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:Dr,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:Nn,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:Nn,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:Bn,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:Fn,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:Fn,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:br,168:[0,.69444,.11473,0,.59111],176:Zr,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:mr,248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:mr,567:[.19444,.44444,.04611,0,.385],710:Bn,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:Lr,730:Zr,732:Dr,733:Dr,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:Nn,931:[0,.68611,.11431,0,.82666],933:zr,934:[0,.68611,.05632,0,.82666],936:zr,937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:Lr,8217:Lr,8220:[0,.69444,.16772,0,.62055],8221:xr},"Main-Italic":{32:br,33:Or,34:bi,35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:Or,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:Jr,49:Jr,50:Jr,51:Jr,52:ai,53:Jr,54:Jr,55:ai,56:Jr,57:Jr,58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:Bi,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:Ir,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:Ir,79:Xi,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:Ir,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:ta,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:ci,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:ci,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:br,168:[0,.66786,.10474,0,.51111],176:Vi,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:Pi,248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:Pi,710:ta,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:Vi,732:[0,.66786,.11585,0,.51111],733:Bi,915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:Xi,923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:Ir,931:[0,.68333,.12028,0,.71555],933:qi,934:[0,.68333,.05986,0,.71555],936:qi,937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:Or,8217:Or,8220:[0,.69444,.1685,0,.51444],8221:bi,8463:Ji},"Main-Regular":{32:br,33:$i,34:Mi,35:Yl,36:Ga,37:Ia,38:Ti,39:$i,40:jr,41:jr,42:ma,43:Ui,44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:ca,48:di,49:di,50:di,51:di,52:di,53:di,54:di,55:di,56:di,57:di,58:ia,59:[.19444,.43056,0,0,.27778],60:cn,61:Ot,62:cn,63:za,64:Ti,65:ji,66:[0,.68333,0,0,.70834],67:Aa,68:[0,.68333,0,0,.76389],69:$a,70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:ji,73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:Ba,76:fa,77:[0,.68333,0,0,.91667],78:ji,79:Ba,80:$a,81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:Aa,85:ji,86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:ji,89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:Yi,92:ca,93:Yi,94:Mi,95:[.31,.12056,.02778,0,.5],97:Qr,98:Oa,99:ki,100:Oa,101:ki,102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:Oa,105:hi,106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:$i,109:[0,.43056,0,0,.83334],110:ua,111:Qr,112:zi,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:ua,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:ki,123:ca,124:Yi,125:ca,126:[.35,.31786,0,0,.5],160:br,163:[0,.69444,0,0,.76909],167:wa,168:xa,172:[0,.43056,0,0,.66667],176:pa,177:Ui,182:Ja,184:Xl,198:[0,.68333,0,0,.90278],215:Ui,216:[.04861,.73194,0,0,.77778],223:Mi,230:[0,.43056,0,0,.72222],247:Ui,248:[.09722,.52778,0,0,.5],305:ia,338:[0,.68333,0,0,1.01389],339:_i,567:[.19444,.43056,0,0,.30556],710:Mi,711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:Mi,715:Mi,728:Mi,729:hi,730:pa,732:xa,733:Mi,915:fa,916:so,920:Ba,923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:ji,931:Aa,933:Ba,934:Aa,936:Ba,937:Aa,8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:$i,8217:$i,8220:Mi,8221:Mi,8224:wa,8225:wa,8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:Ji,8465:Ea,8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:Ea,8501:io,8592:Ci,8593:Va,8594:Ci,8595:Va,8596:Ci,8597:ca,8598:ha,8599:ha,8600:ha,8601:ha,8614:[.011,.511,0,0,1],8617:ka,8618:ka,8636:Ci,8637:Ci,8640:Ci,8641:Ci,8652:[.011,.671,0,0,1],8656:Ci,8657:Ja,8658:Ci,8659:Ja,8660:Ci,8661:[.25,.75,0,0,.61111],8704:Oa,8706:[0,.69444,.05556,.08334,.5309],8707:Oa,8709:Ga,8711:so,8712:Fa,8715:Fa,8722:Ui,8723:Ui,8725:ca,8726:ca,8727:ho,8728:Ca,8729:Ca,8730:[.2,.8,0,0,.83334],8733:_i,8734:sr,8736:Ke,8739:Yi,8741:ca,8743:Ki,8744:Ki,8745:Ki,8746:Ki,8747:[.19444,.69444,.11111,0,.41667],8764:Ot,8768:[.19444,.69444,0,0,.27778],8771:da,8773:[-.022,.589,0,0,1],8776:Sa,8781:da,8784:[-.133,.67,0,0,.778],8801:da,8804:ot,8805:ot,8810:Ka,8811:Ka,8826:cn,8827:cn,8834:cn,8835:cn,8838:ot,8839:ot,8846:Ki,8849:ot,8850:ot,8851:Ki,8852:Ki,8853:Ui,8854:Ui,8855:Ui,8856:Ui,8857:Ui,8866:io,8867:io,8868:Ti,8869:Ti,8872:[.249,.75,0,0,.867],8900:Ca,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:Oo,8969:Oo,8970:Oo,8971:Oo,8994:Ro,8995:Ro,9136:lo,9137:lo,9651:Ao,9657:ho,9661:Ao,9667:ho,9711:ha,9824:na,9825:na,9826:na,9827:na,9837:[0,.75,0,0,.38889],9838:Oi,9839:Oi,10216:jr,10217:jr,10222:lo,10223:lo,10229:[.011,.511,0,0,1.609],10230:Ta,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:Ta,10815:ji,10927:ot,10928:ot,57376:_a},"Math-BoldItalic":{32:br,48:co,49:co,50:co,51:ao,52:ao,53:ao,54:kn,55:ao,56:kn,57:ao,65:Hr,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:aa,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:xi,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:br,915:[0,.68611,.15972,0,.65694],916:Cn,920:[0,.68611,.03194,0,.86722],923:ps,926:[0,.68611,.07458,0,.84125],928:aa,931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:Ar,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:xi,960:[0,.44444,.03704,0,.68241],961:wi,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:wi,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:br,48:Qr,49:Qr,50:Qr,51:Di,52:Di,53:Di,54:di,55:Di,56:di,57:Di,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:ja,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:Ha,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:Fo,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:br,915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:Ha,923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:ja,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:Fo,960:[0,.43056,.03588,0,.57003],961:Uo,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:Uo,1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:br,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:Da,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:va,49:va,50:va,51:va,52:va,53:va,54:va,55:va,56:va,57:va,58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:ul,64:No,65:No,66:No,67:As,68:cs,69:[0,.69444,0,0,.64167],70:io,71:No,72:cs,73:[0,.69444,0,0,.33056],74:ul,75:ms,76:Xa,77:[0,.69444,0,0,.97778],78:cs,79:cs,80:As,81:[.10556,.69444,0,0,.79445],82:As,83:io,84:No,85:ms,86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:No,89:[0,.69444,.0275,0,.73334],90:go,91:zo,93:zo,94:va,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:oo,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:oo,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:br,168:va,176:No,180:va,184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:va,711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:va,729:Da,730:No,732:va,733:va,915:Xa,916:[0,.69444,0,0,.91667],920:yo,923:go,926:No,928:cs,931:cs,933:yo,934:cs,936:yo,937:cs,8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:Da,8217:Da,8220:Ko,8221:Ko},"SansSerif-Italic":{32:br,33:[0,.69444,.05733,0,.31945],34:yc,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:Ra,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:br,168:[0,.67937,.06385,0,.5],176:vc,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:Xc,715:Mi,728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:vc,732:[0,.67659,.08826,0,.5],733:Xc,915:[0,.69444,.13372,0,.54167],916:Yc,920:[0,.69444,.07555,0,.77778],923:io,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:yc},"SansSerif-Regular":{32:br,33:[0,.69444,0,0,.31945],34:Mi,35:Yl,36:Ga,37:Ia,38:[0,.69444,0,0,.75834],39:$i,40:jr,41:jr,42:ma,43:Ui,44:Ho,45:[0,.44444,0,0,.33333],46:es,47:ca,48:ga,49:ga,50:ga,51:ga,52:ga,53:ga,54:ga,55:ga,56:ga,57:ga,58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:za,64:Ra,65:Ra,66:Ra,67:gi,68:[0,.69444,0,0,.72223],69:po,70:[0,.69444,0,0,.56945],71:Ra,72:Hs,73:$i,74:za,75:[0,.69444,0,0,.69445],76:is,77:[0,.69444,0,0,.875],78:Hs,79:[0,.69444,0,0,.73611],80:gi,81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:Oa,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:Ra,89:[0,.69444,.025,0,.66667],90:io,91:gs,93:gs,94:Mi,95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:Jl,99:Zd,100:Jl,101:Zd,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:Zu,111:[0,.44444,0,0,.5],112:Vd,113:Vd,114:[0,.44444,.01389,0,.34167],115:qc,116:[0,.57143,0,0,.36111],117:Zu,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:br,168:[0,.67937,0,0,.5],176:Ra,184:Xl,305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:Mi,711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:Mi,715:Mi,728:Mi,729:[0,.67937,0,0,.27778],730:Ra,732:[0,.67659,0,0,.5],733:Mi,915:is,916:Yc,920:Ti,923:io,926:Ra,928:Hs,931:Ea,933:Ti,934:Ea,936:Ti,937:Ea,8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:$i,8217:$i,8220:Mi,8221:Mi},"Script-Regular":{32:br,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:br},"Size1-Regular":{32:br,40:jd,41:jd,47:Jc,91:Qc,92:Jc,93:Qc,123:Vu,125:Vu,160:br,710:bc,732:bc,770:bc,771:bc,8214:[-99e-5,.601,0,0,.77778],8593:eu,8595:eu,8657:ju,8659:ju,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:xc,8748:Gd,8749:Gd,8750:xc,8896:Zo,8897:Zo,8898:Zo,8899:Zo,8968:Pl,8969:Pl,8970:Pl,8971:Pl,9168:uu,10216:Pl,10217:Pl,10752:Gu,10753:Gu,10754:Gu,10756:Zo,10758:Zo},"Size2-Regular":{32:br,40:Xu,41:Xu,47:vs,91:Za,92:vs,93:Za,123:Es,125:Es,160:br,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:tu,8748:qu,8749:qu,8750:tu,8896:Ol,8897:Ol,8898:Ol,8899:Ol,8968:nu,8969:nu,8970:nu,8971:nu,10216:ru,10217:ru,10752:Rl,10753:Rl,10754:Rl,10756:Ol,10758:Ol},"Size3-Regular":{32:br,40:Yu,41:Yu,47:iu,91:Qs,92:iu,93:Qs,123:wc,125:wc,160:br,710:Sc,732:Sc,770:Sc,771:Sc,8730:[.95003,1.45,0,0,1],8968:au,8969:au,8970:au,8971:au,10216:wc,10217:wc},"Size4-Regular":{32:br,40:Cc,41:Cc,47:ou,91:Ju,92:ou,93:Ju,123:su,125:su,160:br,710:Mc,732:Mc,770:Mc,771:Mc,8730:[1.25003,1.75,0,0,1],8968:lu,8969:lu,8970:lu,8971:lu,9115:cu,9116:Ec,9117:cu,9118:cu,9119:Ec,9120:cu,9121:du,9122:uu,9123:du,9124:du,9125:uu,9126:du,9127:Xd,9128:Qu,9129:Nl,9130:[0,.3,0,0,.88889],9131:Xd,9132:Qu,9133:Nl,9143:[.88502,.915,0,0,1.05556],10216:su,10217:su,57344:fu,57345:fu,57680:Bl,57681:Bl,57682:Bl,57683:Bl},"Typewriter-Regular":{32:kc,33:oi,34:oi,35:oi,36:ws,37:ws,38:oi,39:oi,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:oi,49:oi,50:oi,51:oi,52:oi,53:oi,54:oi,55:oi,56:oi,57:oi,58:as,59:[.13889,.43056,0,0,.525],60:qd,61:[-.19549,.41562,0,0,.525],62:qd,63:oi,64:oi,65:oi,66:oi,67:oi,68:oi,69:oi,70:oi,71:oi,72:oi,73:oi,74:oi,75:oi,76:oi,77:oi,78:oi,79:oi,80:oi,81:[.13889,.61111,0,0,.525],82:oi,83:oi,84:oi,85:oi,86:oi,87:oi,88:oi,89:oi,90:oi,91:ws,92:ws,93:ws,94:oi,95:[.09514,0,0,0,.525],96:oi,97:as,98:oi,99:as,100:oi,101:as,102:oi,103:To,104:oi,105:oi,106:[.22222,.61111,0,0,.525],107:oi,108:oi,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:oi,127:oi,160:kc,176:oi,184:[.19445,0,0,0,.525],305:as,567:To,711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:oi,715:oi,728:oi,730:oi,770:oi,771:oi,776:oi,915:oi,916:oi,920:oi,923:oi,926:oi,928:oi,931:oi,933:oi,934:oi,936:oi,937:oi,8216:oi,8217:oi,8242:oi,9251:[.11111,.21944,0,0,.525]}},Jd=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,$l=10,os=.25,hu=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]},pu=[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 mu={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]},Fl={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 ec(a){if(Fl[a]){const[ge,xe,Re]=Fl[a],Ze=`<span class="stretchy" style="height:${Re}em"><svg width="100%" height="${Re}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*Re/2)/100}em;min-width:0">${Ze}</span>`}const[y,b,E,ee]=mu[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 he=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;">${he}</span>`}function ef(a){return mu[a]?mu[a][2]/1e3:Fl[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 _c=8205,Lc=[[_c,1],[65038,2],[127995,5],[129456,4],[917536,96]],fl,tc=[127462,127487];function nc(a){var y;if(fl===void 0){fl={};for(const b of Lc)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>=tc[0]&&a<=tc[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===_c){const ae=E-1;for(E+=2;b[E]===_c;)E+=2;y.push(String.fromCodePoint(...b.slice(ae,E-ae+1)))}else if(nc(re)){const ae=E-1;for(;nc(b[E]);)E+=b[E]===_c?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 he of de)ae.push(he==="\\"?"\\backslash":he);else de==="<{>"?ae.push("\\{"):de==="<space>"?ae.push("~"):de==="<}>"&&ae.push("\\}")}else if(de==="\\csname"){for(;a.peek()==="<space>";)a.next();let he="",ge=!1,xe=[];do{if(xe.length===0)if(/^#[\d?@]$/.test(a.peek())){const Re=a.get().slice(1);xe=nl((E=(b=y==null?void 0:y(Re))!=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||(he+=xe.shift())}while(!ge);he&&ae.push("\\"+he),ae.push(...xe)}else if(de!=="\\endcsname")if(de.length>1&&de.startsWith("#")){const he=de.slice(1);ae.push(...nl((re=(ee=y==null?void 0:y(he))!=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(at(b.join(""))),re=[];do re.push(...hl(ee,y));while(!ee.end());return re}function ya(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:ya([a,...y.map(b=>`{${b}}`)])}function pl(a){return ya(a.map(y=>{var b;return(b={"<space>":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[y])!=null?b:y}))}var of=class Ud{constructor(y){Ud._registry[y]=this}static createAtom(y,b,E){return Ud._registry[y].createAtom(b,Wt(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=Ud._registry[re[0].mode];ee.push(...ae.serialize(re,b))}return ya(ee)}return ya(th(y,b))}static getFont(y,b,E){return Ud._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 he of Eo(ae,"color")){const ge=he[0].computedStyle,xe=Ss._registry[he[0].mode].serialize(he,pe(Se({},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,ya(xe))):re.push(ya(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,ya(rd(ee,pe(Se({},y),{defaultMode:"text"}))))}return ya(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 rc(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 ic(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 kr=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:ze(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 he=b==null?void 0:b.fontFamily;b!=null&&b.style&&this.value&&(he=(de=Ss.getFont((ae=b.mode)!=null?ae:"math",this,pe(Se({variant:"normal"},b.style),{letterShapeStyle:b.letterShapeStyle})))!=null?de:void 0),he||(he="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),Ac(this,he)}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=ic(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=ic(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"]=ic(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"]=ic(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"]=ic(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=Sr(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 dt of this.children)re+=dt.toMarkup();let ae="";if(this.svgBody)ae=ec(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 dt=(b=this.cssProperties)==null?void 0:b.padding;dt?(ae+=`top:${dt};`,ae+=`left:${dt};`,ae+=`width:calc(100% - 2 * ${dt} );`):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 he=this.classes.split(" ");he.push((E={latex:"ML__raw-latex",placeholder:"ML__placeholder",error:"ML__error"}[this.type])!=null?E:""),this.caret==="latex"&&he.push("ML__latex-caret"),this.isSelected&&he.push("ML__selected");const ge=he.length===1?he[0]:he.filter((dt,St,Sn)=>dt.length>0&&Sn.indexOf(dt)===St).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(dt=>`${dt}="${this.attributes[dt]}"`).join(" ")),this.htmlData){const dt=this.htmlData.split(",");for(const St of dt){const Sn=St.match(/([^=]+)=(.+$)/);if(Sn){const wr=Sn[1].trim().replace(/ /g,"-");wr&&(de+=` data-${wr}="${Sn[2]}" `)}else{const wr=St.trim().replace(/ /g,"-");wr&&(de+=` data-${wr} `)}}}const xe=(ee=this.cssProperties)!=null?ee:{};this.hasExplicitWidth&&xe.width===void 0&&(xe.width=`${Math.ceil(this._width*100)/100}em`);const Re=Object.keys(xe).map(dt=>`${dt}:${xe[dt]}`);if(this.scale!==void 0&&this.scale!==1&&(re.length>0||ae.length>0)&&Re.push(`font-size: ${Math.ceil(this.scale*1e4)/100}%`),this.htmlStyle){const dt=this.htmlStyle.split(";");let St="";for(const Sn of dt){const wr=Sn.match(/([^=]+):(.+$)/);if(wr){const gn=wr[1].trim().replace(/ /g,"-");gn&&(St+=`${gn}:${wr[2]};`)}}St&&(de+=` style="${St}"`)}Re.length>0&&(de+=` style="${Re.join(";")}"`);let Ze="";return de.length>0||ae.length>0?Ze=`<span${de}>${re}${ae}</span>`:Ze=re,this.caret==="text"?Ze+='<span class="ML__text-caret"></span>':this.caret==="math"&&(Ze+='<span class="ML__caret"></span>'),Ze}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 he of["border","border-left","border-right","border-right-width","left","margin","margin-left","margin-right","padding","position","width"])if(y.cssProperties&&he in y.cssProperties||this.cssProperties&&he 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 he of Object.keys(this.cssProperties))if(this.cssProperties[he]!==y.cssProperties[he])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[he,ge]of ae.entries())if(ge==="vertical-separator"||ge!==de[he])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 gu(a){return a.children&&(a.children=ad(a.children)),a}function vu(a,y){if(!a)return new kr(null,y);const b=new kr(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 kr(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 kr(E,pe(Se({},y),{type:"lift"}))}function Os(a){const y=ef(a)/2,b=new kr(null,{maxFontSize:0});return b.height=y+.166,b.depth=y-.166,b.svgBody=a,b}function Ac(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 yu(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],he=-de.shift-re-de.box.depth,ge=he-(b.box.height+b.box.depth);re=re+he,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 Tc(a){var y;const[b,E]=yu(a);if(!b)return[[],0,0];const ee=new kr(null,{classes:"pstrut"});let re=0;for(const St of b)if(typeof St!="number"){const Sn=St.box;re=Math.max(re,Sn.maxFontSize,Sn.height)}re+=2,ee.height=re,ee.setStyle("height",re,"em");const ae=[];let de=E,he=E,ge=E,xe=0;for(const St of b){if(typeof St=="number")ge+=St;else{const Sn=St.box,wr=(y=St.classes)!=null?y:[],gn=new kr([ee,Sn],{classes:wr.join(" "),style:St.style});Sn.setStyle("height",Sn.height+Sn.depth,"em"),Sn.setStyle("display","inline-block"),gn.setStyle("top",-re-ge-Sn.depth,"em"),St.marginLeft&&gn.setStyle("margin-left",St.marginLeft,"em"),St.marginRight&&gn.setStyle("margin-right",St.marginRight,"em"),ae.push(gn),ge+=Sn.height+Sn.depth,xe=Math.max(xe,gn.width)}de=Math.min(de,ge),he=Math.max(he,ge)}ae.forEach(St=>{St.softWidth=xe});const Re=new kr(ae,{classes:"vlist"});if(Re.softWidth=xe,Re.height=he,Re.setStyle("height",he,"em"),de>=0)return[[new kr(Re,{classes:"vlist-r"})],he,-de];const Ze=new kr(new kr(null),{classes:"vlist"});Ze.height=-de,Ze.setStyle("height",-de,"em");const dt=new kr(8203,{classes:"vlist-s",maxFontSize:0});return dt.softWidth=0,dt.height=0,dt.depth=0,[[new kr([Re,dt],{classes:"vlist-r"}),new kr(Ze,{classes:"vlist-r"})],he,-de]}var Qa=class extends kr{constructor(a,y){var b;const[E,ee,re]=Tc(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,he=new kr(y.base),ge=(b=y.baseShift)!=null?b:0,xe=(E=y.slant)!=null?E:0;let Re=0,Ze=0;y.above&&(Re=(ee=y.aboveShift)!=null?ee:Math.max(de.bigOpSpacing1,de.bigOpSpacing3-y.above.depth)),y.below&&(Ze=(re=y.belowShift)!=null?re:Math.max(de.bigOpSpacing2,de.bigOpSpacing4-y.below.height));let dt=null;if(y.below&&y.above){const St=de.bigOpSpacing5+y.below.height+y.below.depth+Ze+he.depth+ge;dt=new Qa({bottom:St,children:[de.bigOpSpacing5,{box:y.below,marginLeft:-xe,classes:["ML__center"]},Ze,{box:he,classes:["ML__center"]},Re,{box:y.above,marginLeft:xe,classes:["ML__center"]},de.bigOpSpacing5]}).wrap(a)}else if(y.below&&!y.above)dt=new Qa({top:he.height-ge,children:[de.bigOpSpacing5,{box:y.below,marginLeft:-xe,classes:["ML__center"]},Ze,{box:he,classes:["ML__center"]}]}).wrap(a);else if(!y.below&&y.above){const St=he.depth+ge;dt=new Qa({bottom:St,children:[{box:he,classes:["ML__center"]},Re,{box:y.above,marginLeft:xe,classes:["ML__center"]},de.bigOpSpacing5]}).wrap(a)}else{const St=he.depth+ge;dt=new Qa({bottom:St,children:[{box:he},de.bigOpSpacing5]}).wrap(a)}return new kr(dt,{type:(ae=y.type)!=null?ae:"op"})}var od=7,rl=6,Dc=5,ml=4,zl=3,ss=2,ks=1,Vo=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)=>pe(Se({},ee),{[re]:td[re][E]}),{})}getFontSize(a){return Math.max(1,a+this.sizeDelta)}get sup(){return Us[[Vo,ks,Vo,ks,ss,zl,ss,zl][this.id]]}get sub(){return Us[[Vo,Vo,Vo,Vo,ss,ss,ss,ss][this.id]]}get fracNum(){return Us[[Vo,ks,Vo,ks,ss,zl,ml,Dc][this.id]]}get fracDen(){return Us[[Vo,Vo,Vo,Vo,ss,ss,ml,ml][this.id]]}get cramp(){return Us[[Vo,Vo,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(Dc,0,!1),4:new Ws(ml,0,!0),3:new Ws(zl,-3,!1),2:new Ws(ss,-3,!0),1:new Ws(ks,-4,!1),0:new Ws(Vo,-4,!0)},Us=pe(Se({},Kl),{displaystyle:Kl[od],textstyle:Kl[Dc],scriptstyle:Kl[zl],scriptscriptstyle:Kl[ks]});function ac(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:$l,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/$l*E*ee)/ee}return a.dimension*E}function sd(a,y){if(a===null)return 0;const b=ac(a)/$l;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 Zs(a,y){return a==null?null:"number"in a?pe(Se({},a),{number:a.number*y}):"register"in a?"factor"in a&&a.factor?pe(Se({},a),{factor:a.factor*y}):pe(Se({},a),{factor:y}):"dimension"in a?pe(Se({},a),{dimension:a.dimension*y}):"glue"in a?a.shrink&&a.grow?{glue:Zs(a.glue,y),shrink:Zs(a.shrink,y),grow:Zs(a.grow,y)}:a.shrink?{glue:Zs(a.glue,y),shrink:Zs(a.shrink,y)}:a.grow?{glue:Zs(a.glue,y),grow:Zs(a.grow,y)}:{glue:Zs(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 oc(){return Se({},rh)}function bu(){return{registers:oc(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"\u25A2",letterShapeStyle:nt.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:Mt,backgroundColorMap:je,getMacro:a=>Vn(a,Gr())}}var La=class Ep{constructor(y,b){var E,ee,re,ae,de,he,ge,xe,Re,Ze,dt,St,Sn,wr,gn;let tr;y!=null&&y.parent?(this.parent=y.parent,tr=y.parent,this.registers={}):(tr=Se(Se({},bu()),(E=y==null?void 0:y.from)!=null?E:{}),this.registers=tr.registers),tr.atomIdsSettings&&(this.atomIdsSettings=Se({},tr.atomIdsSettings)),this.renderPlaceholder=tr.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=tr.letterShapeStyle,this.minFontScale=tr.minFontScale,b!=null&&b.color&&b.color!=="none"?this.color=b.color:this.color=(he=(de=this.parent)==null?void 0:de.color)!=null?he:"",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!==((Re=this.parent)==null?void 0:Re.size)?this.size=b.fontSize:this.size=(dt=(Ze=this.parent)==null?void 0:Ze.size)!=null?dt:dl;let _r=(Sn=(St=this.parent)==null?void 0:St.mathstyle)!=null?Sn:Us.displaystyle;if(typeof(y==null?void 0:y.mathstyle)=="string"){if(tr instanceof Ep)switch(y.mathstyle){case"cramp":_r=_r.cramp;break;case"superscript":_r=_r.sup;break;case"subscript":_r=_r.sub;break;case"numerator":_r=_r.fracNum;break;case"denominator":_r=_r.fracDen;break}switch(y.mathstyle){case"textstyle":_r=Us.textstyle;break;case"displaystyle":_r=Us.displaystyle;break;case"scriptstyle":_r=Us.scriptstyle;break;case"scriptscriptstyle":_r=Us.scriptscriptstyle;break;case"":case"auto":break}}this.mathstyle=_r,this.smartFence=tr.smartFence,this.placeholderSymbol=tr.placeholderSymbol,this.colorMap=(wr=tr.colorMap)!=null?wr:lr=>lr,this.backgroundColorMap=(gn=tr.backgroundColorMap)!=null?gn:lr=>lr,this.getMacro=tr.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(pu[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?pe(Se({},re),{dimension:E*re.dimension}):"glue"in re?pe(Se({},re),{glue:pe(Se({},re.glue),{dimension:E*re.glue.dimension}),shrink:re.shrink?pe(Se({},re.shrink),{dimension:E*re.shrink.dimension}):void 0,grow:re.grow?pe(Se({},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:ac(E,b)/$l}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}},sc=["body","above","below","superscript","subscript"];function il(a){return typeof a=="string"&&sc.includes(a)}function Ic(a){return a!==void 0&&Array.isArray(a)&&a.length===2}var Un=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=Se({},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=cf(b),ae=[];for(const he of re){const ge=he[0].style,xe=uf(y,he,{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 kr(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=Se({},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=ud(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=Wt(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):this.body&&this.command?ya([uo(this.command,this.bodyToLatex(y)),this.supsubToLatex(y)]):this.body?ya([this.bodyToLatex(y),this.supsubToLatex(y)]):!this.value||this.value==="\u200B"?"":this.command}bodyToLatex(y){var b;return Ss.serialize(this.body,pe(Se({},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=pe(Se({},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 sc)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 Ic(this.parentBranch)?this.parentBranch[0]:-1}get col(){return Ic(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=Se(Se({},(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=Se(Se({},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 sc)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=Wt(this.command,this.mode);if(b!=null&&b.render)return b.render(this,y);const E=new La({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,he=null;const ge=(E=b.isCharacterBox)!=null?E:this.isCharacterBox();let xe=0;if(re){const Sn=new La({parent:y,mathstyle:"superscript"});de=jl.createBox(Sn,re),ge||(xe=ee.height-y.metrics.supDrop*Sn.scalingFactor)}let Re=0;if(ae){const Sn=new La({parent:y,mathstyle:"subscript"});he=jl.createBox(Sn,ae),ge||(Re=ee.depth+y.metrics.subDrop*Sn.scalingFactor)}let Ze;y.isDisplayStyle?Ze=y.metrics.sup1:y.isCramped?Ze=y.metrics.sup3:Ze=y.metrics.sup2;const dt=.5/$l/y.scalingFactor;let St=null;if(he&&de){xe=Math.max(xe,Ze,de.depth+.25*y.metrics.xHeight),Re=Math.max(Re,y.metrics.sub2);const Sn=y.metrics.defaultRuleThickness;if(xe-de.depth-(he.height-Re)<4*Sn){Re=4*Sn-(xe-de.depth)+he.height;const gn=.8*y.metrics.xHeight-(xe-de.depth);gn>0&&(xe+=gn,Re-=gn)}const wr=this.isExtensibleSymbol&&ee.italic?-ee.italic:0;St=new Qa({individualShift:[{box:he,shift:Re,marginLeft:wr},{box:de,shift:-xe}]}).wrap(y)}else he&&!de?(Re=Math.max(Re,y.metrics.sub1,he.height-.8*el),St=new Qa({shift:Re,children:[{box:he,marginRight:dt,marginLeft:this.isCharacterBox()?-ee.italic:0}]})):!he&&de&&(xe=Math.max(xe,Ze,de.depth+.25*el),St=new Qa({shift:-xe,children:[{box:de,marginRight:dt}]}));return new kr([ee,new kr(St,{caret:this.caret,isSelected:this.isSelected,classes:"msubsup"})],{type:b.type})}attachLimits(y,b){const E=this.superscript?jl.createBox(new La({parent:y,mathstyle:"superscript"},this.style),this.superscript):null,ee=this.subscript?jl.createBox(new La({parent:y,mathstyle:"subscript"},this.style),this.subscript):null;return!E&&!ee?b.base.wrap(y):nh(y,pe(Se({},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,he=(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 kr(de!=null?de:null,{type:he,isSelected:this.isSelected,mode:this.mode,maxFontSize:y.scalingFactor,style:pe(Se({variant:"normal"},this.style),{fontSize:Math.max(1,y.size+y.mathstyle.sizeDelta)}),letterShapeStyle:y.letterShapeStyle,classes:ge}):(ae=jl.createBox(y,de,{type:he,classes:ge}))!=null?ae:new kr(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 cf(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 uf(a,y,b){var E,ee,re,ae,de;if(!y||y.length===0)return null;const he=new La({parent:a},b.style),ge=!((E=he.atomIdsSettings)!=null&&E.groupNumbers);let xe=[];if(y.length===1){const Ze=y[0],dt=Ze.render(he);dt&&(ge&&Ze.isSelected&&dt.selected(!0),xe=[dt])}else{let Ze="",dt=!0;for(const St of y){(ee=he.atomIdsSettings)!=null&&ee.groupNumbers&&Ze&&(dt&&St.isDigit()||!dt&&cd(St))&&(he.atomIdsSettings.overrideID=Ze);const Sn=St.render(he);he.atomIdsSettings&&(he.atomIdsSettings.overrideID=void 0),Sn&&((re=he.atomIdsSettings)!=null&&re.groupNumbers&&((St.isDigit()||cd(St))&&(!Ze||dt!==St.isDigit())&&(dt=St.isDigit(),Ze=(ae=St.id)!=null?ae:""),Ze&&(!(St.isDigit()||cd(St))||!St.hasEmptyBranch("superscript")||!St.hasEmptyBranch("subscript"))&&(Ze="")),ge&&St.isSelected&&Sn.selected(!0),xe.push(Sn))}}if(xe.length===0)return null;const Re=new kr(xe,pe(Se({isTight:he.isTight},b),{type:(de=b.type)!=null?de:"lift"}));return Re.isSelected=xe.every(Ze=>Ze.isSelected),Re.wrap(he)}function cd(a){return a.mode==="text"}function ud(a){return a.map(y=>y===null?"<null>":Array.isArray(y)&&y[0]instanceof Un?{atoms:y.map(b=>b.toJson())}:typeof y=="object"&&"group"in y?{group:y.group.map(b=>b.toJson())}:y)}var al=class kp extends Un{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 kp(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:ir("text",this.value.codePointAt(0))}};function Pc(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 xu(a){return Array.isArray(a)&&a.length===2}function wu(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,he=!1,ge=!1,xe=!1,Re=!1,Ze=!1,dt=!1,St=!1,Sn=!1,wr=!1,gn=a[0],tr=0;for(;gn!=null&&gn.type&&/^(subsup|placeholder)$/.test(gn.type);)tr+=1,gn=a[tr];return b=!gn||gn.type==="first",gn&&(Sn=gn.mode==="text",E=!Sn&&gn.type==="mord"&&ye.test(gn.value),ee=!Sn&&gn.type==="mord"&&/\d+$/.test(gn.value),re=!Sn&&gn.isFunction,ae=gn.type==="genfrac",de=gn.type==="surd",he=gn.type==="mbin",ge=gn.type==="mrel",xe=gn.type==="mop"||gn.type==="operator"||gn.type==="extensible-symbol",Re=gn.type==="mpunct"||gn.type==="minner",Ze=gn.type==="array",dt=gn.type==="mopen",St=gn.type==="mclose"||gn.type==="leftright",wr=gn.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")&&he||y.after.includes("relop")&&ge||y.after.includes("operator")&&xe||y.after.includes("punct")&&Re||y.after.includes("array")&&Ze||y.after.includes("openfence")&&dt||y.after.includes("closefence")&&St||y.after.includes("text")&&Sn||y.after.includes("space")&&wr?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 Oc(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 he=vl(ae.rest.slice(1),{inlineShortcuts:de,noWrap:!0});he.match&&(a="\\frac{"+ae.match+"}{"+he.match+"}"+ts(he.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 Su="$$",oh="$$",sh=(a,y,b)=>(fd.some(E=>y.startsWith(E[0])&&y.endsWith(E[1]))||(y=`${Su} ${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 he;return(he=de.value)!=null?he:""}).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(he){}if(ae.length===1){const he=ae[0];(he.type==="root"||he.type==="group")&&(ae=he.body.filter(ge=>ge.type!=="first"))}try{b.clipboardData.setData("application/json+mathlive",JSON.stringify(ae.map(he=>he.toJson())))}catch(he){}if((E=window[Symbol.for("io.cortexjs.compute-engine")])!=null&&E.ComputeEngine){const he=window.MathfieldElement.computeEngine;if(he)try{const ge=he.jsonSerializationOptions;he.jsonSerializationOptions={metadata:["latex"]};const xe=he.parse(ee.getValue(re,"latex-unstyled"));he.jsonSerializationOptions=ge;const Re=JSON.stringify(xe.json);Re&&b.clipboardData.setData("application/json",Re)}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 ra=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 Rs(a){var y;return((y=a.element)==null?void 0:y.mathfield)===a}function Ns(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=Ns(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 lc(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 he=Math.floor(re.getBoundingClientRect().width)/ae;he=isNaN(he)?1:he;const ge=md(a,lc(a,ee),he);if(ge){const xe=pd(ee);if(E.has(xe)){const Re=E.get(xe);E.set(xe,{left:Math.min(Re.left,ge.left),right:Math.max(Re.right,ge.right),top:Math.min(Re.top,ge.top),bottom:Math.max(Re.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 Cu(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;
}
`,qa=`.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);
}
`,ch=`/* 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;
}
`,cc=`/* 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);*/
}
`,uh=`.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));
}
`,Mu=`: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;
}
`,eo;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=qa;break;case"mathfield":y=vf;break;case"environment-popover":y=yf;break;case"suggestion-popover":y=ch;break;case"keystroke-caption":y=cc;break;case"virtual-keyboard":y=uh;break;case"ui":y=Mu;break;case"menu":y=dh;break;default:debugger}return y}function uc(a){return eo||(eo={}),eo[a]||(eo[a]=new CSSStyleSheet,eo[a].replaceSync(Hl(a))),eo[a]}var ol;function _s(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=uc(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=eo[a];document.adoptedStyleSheets=document.adoptedStyleSheets.filter(b=>b!==y)}}var z=class _p extends Un{constructor(y){var b;super(pe(Se({},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 _p(y)}toJson(){return pe(Se({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(y){var b;const E=new La({parent:y,mathstyle:"cramp"},this.style),ee=(b=Un.createBox(E,this.body))!=null?b:new kr("\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=Os(this.svgAccent),ae=E.metrics.bigOpSpacing1-ae;else if(this.accent){const ge=new kr(this.accent,{fontFamily:"Main-Regular"});ge.italic=0;const xe=this.accent===8407?" ML__accent-vec":"";de=new kr(new kr(ge),{classes:"ML__accent-body"+xe})}de=new Qa({shift:0,children:[{box:new kr(ee)},-ae,{box:de,marginLeft:ee.left+2*re,classes:["ML__center"]}]});const he=new kr(de,{type:"lift"});return this.caret&&(he.caret=this.caret),this.bind(E,he.wrap(E)),this.attachSupsub(E,{base:he})}},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 oe(a,y,b,E){var ee;const ae=new kr(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 La({parent:E,mathstyle:"textstyle"},ee==null?void 0:ee.style),he=new kr(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&&he.setTop((1-de.scalingFactor)*os),he}function we(a,y,b,E,ee){var re;let ae,de,he,ge;ae=he=ge=ie(a),de=null;let xe="Size1-Regular";a==="\\vert"||a==="\\lvert"||a==="\\rvert"||a==="\\mvert"||a==="\\mid"?he=ae=ge=8739:a==="\\Vert"||a==="\\lVert"||a==="\\rVert"||a==="\\mVert"||a==="\\|"?he=ae=ge=8741:a==="\\uparrow"?he=ge=9168:a==="\\Uparrow"?he=ge=8214:a==="\\downarrow"?ae=he=9168:a==="\\Downarrow"?ae=he=8214:a==="\\updownarrow"?(ae=8593,he=9168,ge=8595):a==="\\Updownarrow"?(ae=8657,he=8214,ge=8659):a==="["||a==="\\lbrack"?(ae=9121,he=9122,ge=9123,xe="Size4-Regular"):a==="]"||a==="\\rbrack"?(ae=9124,he=9125,ge=9126,xe="Size4-Regular"):a==="\\lfloor"||a==="\u230A"?(he=ae=9122,ge=9123,xe="Size4-Regular"):a==="\\lceil"||a==="\u2308"?(ae=9121,he=ge=9122,xe="Size4-Regular"):a==="\\rfloor"||a==="\u230B"?(he=ae=9125,ge=9126,xe="Size4-Regular"):a==="\\rceil"||a==="\u2309"?(ae=9124,he=ge=9125,xe="Size4-Regular"):a==="("||a==="\\lparen"?(ae=9115,he=9116,ge=9117,xe="Size4-Regular"):a===")"||a==="\\rparen"?(ae=9118,he=9119,ge=9120,xe="Size4-Regular"):a==="\\{"||a==="\\lbrace"?(ae=9127,de=9128,ge=9129,he=9130,xe="Size4-Regular"):a==="\\}"||a==="\\rbrace"?(ae=9131,de=9132,ge=9133,he=9130,xe="Size4-Regular"):a==="\\lgroup"||a==="\u27EE"?(ae=9127,ge=9129,he=9130,xe="Size4-Regular"):a==="\\rgroup"||a==="\u27EF"?(ae=9131,ge=9133,he=9130,xe="Size4-Regular"):a==="\\lmoustache"||a==="\u23B0"?(ae=9127,ge=9133,he=9130,xe="Size4-Regular"):a==="\\rmoustache"||a==="\u23B1"?(ae=9131,ge=9129,he=9130,xe="Size4-Regular"):a==="\\surd"?(ae=57345,ge=9143,he=57344,xe="Size4-Regular"):a==="\\ulcorner"?(ae=9484,he=ge=32):a==="\\urcorner"?(ae=9488,he=ge=32):a==="\\llcorner"?(ge=9492,he=ae=32):a==="\\lrcorner"&&(ae=9496,he=ae=32);const Re=tl(ae,xe),Ze=Re.height+Re.depth,dt=tl(he,xe),St=dt.height+dt.depth,Sn=tl(ge,xe),wr=Sn.height+Sn.depth;let gn=0,tr=1;if(de!==null){const Yo=tl(de,xe);gn=Yo.height+Yo.depth,tr=2}const _r=Ze+wr+gn,lr=Math.max(0,Math.ceil((y-_r)/(tr*St))),si=_r+lr*tr*St;let Ii=os;b&&(Ii=Ii*E.scalingFactor);const vi=si/2-Ii,Pa=.008,Ya=[];Ya.push({box:new kr(ge,{fontFamily:xe})}),Ya.push(-Pa);const Rr=new kr(he,{fontFamily:xe});if(de===null)for(let Yo=0;Yo<lr;Yo++)Ya.push({box:Rr});else{for(let Yo=0;Yo<lr;Yo++)Ya.push({box:Rr});Ya.push(-Pa),Ya.push({box:new kr(de,{fontFamily:xe})}),Ya.push(-Pa);for(let Yo=0;Yo<lr;Yo++)Ya.push({box:Rr})}Ya.push(-Pa),Ya.push({box:new kr(ae,{fontFamily:xe})});let Fs="";xe==="Size1-Regular"?Fs=" delim-size1":xe==="Size4-Regular"&&(Fs=" delim-size4");const _l=new Qa({bottom:vi,children:Ya},{classes:Fs});return new kr(_l,pe(Se({},ee!=null?ee:{}),{classes:((re=ee==null?void 0:ee.classes)!=null?re:"")+" ML__delim-mult"}))}var ke=new Set(["(",")","\\lparen","\\rparen","[","]","\\lbrack","\\rbrack","\\{","\\}","\\lbrace","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd","\u230A","\u230B","\u2308","\u2309"]),Oe=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","\u27EE","\u27EF","\u23B0","\u23B1"]),lt=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Et=[0,1.2,1.8,2.4,3];function on(a,y,b,E){return a===void 0||a==="."?ri(b,E.classes):(a==="<"||a==="\\lt"||a==="\u27E8"?a="\\langle":(a===">"||a==="\\gt"||a==="\u27E9")&&(a="\\rangle"),ke.has(a)||lt.has(a)?me(a,y,!1,b,E):Oe.has(a)?we(a,Et[y],!1,b,E):(console.assert(!1,"Unknown delimiter '"+a+"'"),null))}var Vt=[{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}],Xn=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"stack"}],dr=[{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 Tr(a){return a.type==="small"?"Main-Regular":a.type==="large"?"Size"+a.size+"-Regular":(console.assert(a.type==="stack"),"Size4-Regular")}function Wr(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,Tr(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(pu[Math.max(1,E.size-2)],E.minFontScale):b[re].mathstyle==="scriptstyle"&&(de*=Math.max(pu[Math.max(1,E.size-1)],E.minFontScale))),de>y)return b[re]}return b[b.length-1]}function ni(a,y,b,E,ee,re){if(!y||y.length===0||y===".")return ri(ee);y==="<"||y==="\\lt"?y="\\langle":(y===">"||y==="\\gt")&&(y="\\rangle");let ae;lt.has(y)?ae=Vt:ke.has(y)?ae=dr:ae=Xn;const de=Wr(ie(y),b,ae,ee),he=new La({parent:ee,mathstyle:de.mathstyle},re==null?void 0:re.style);return de.type==="small"?oe(y,he,E,pe(Se({},re),{type:a})):de.type==="large"?me(y,de.size,E,he,pe(Se({},re),{type:a})):(console.assert(de.type==="stack"),we(y,b,E,he,pe(Se({},re),{type:a})))}function Kr(a,y,b,E,ee,re){if(y===".")return ri(ee,re==null?void 0:re.classes);const ae=os*ee.scalingFactor,de=901,he=5/$l,ge=Math.max(b-ae,E+ae),xe=Math.max(ge/500*de,2*ge-he);return ni(a,y,xe,!0,ee,re)}function ri(a,y){const b=new kr(null,{classes:" nulldelimiter "+(y!=null?y:""),type:"ignore"});return b.width=a.getRegisterAsEm("nulldelimiterspace"),b.wrap(new La({parent:a,mathstyle:"textstyle"}))}var Fi=class Lp extends Un{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{}"}},Hi=["matrix","matrix*","pmatrix","pmatrix*","bmatrix","bmatrix*","Bmatrix","Bmatrix*","vmatrix","vmatrix*","Vmatrix","Vmatrix*"],ba=["cases","dcases","rcases"],to=["align","align*","aligned","gather","gathered","split"],Wo=["array","subequations","eqnarray"];function bo(a){return Wo.concat(to).concat(ba).concat(Hi).includes(a)}function us(a){return Hi.includes(a)}function ds(a){return ba.includes(a)}function Io(a){return to.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 Re=[],Ze=Math.min(ge.length,xe+E);for(;xe<Ze;){const dt=ge[xe];dt.length===0?Re.push([new Un({type:"first",mode:a.mode})]):dt[0].type!=="first"?Re.push([new Un({type:"first",mode:a.mode}),...dt]):(console.assert(!dt.slice(1).some(St=>St.type==="first")),Re.push(dt)),xe+=1}re.push(Re)}}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 Un({type:"first",mode:a.mode}),new Fi]);ae.push(ge)}let de=0,he=0;for(const ge of ae){he=0;for(const xe of ge){for(const Re of xe)Re.parent=a,Re.parentBranch=[de,he];he+=1}de+=1}return a.isDirty=!0,ae}var oa=class Ap extends Un{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=pe(Se({},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(Ic(y))return(b=this.array[y[0]][y[1]])!=null?b:void 0}createBranch(y){var b;return Ic(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 he=new La({parent:y,mathstyle:this.mathstyleName},this.style),ge=he.getRegisterAsEm("arrayrulewidth"),xe=he.getRegisterAsEm("arraycolsep"),Re=he.getRegisterAsEm("doublerulesep"),Ze=(E=(b=this.arraystretch)!=null?b:he.getRegisterAsNumber("arraystretch"))!=null?E:1;let dt=typeof this.arraycolsep=="number"?this.arraycolsep:xe;this.colSeparationType==="small"&&(dt=.2778*(new La({parent:y,mathstyle:"scriptstyle"}).scalingFactor/y.scalingFactor));const St=Ze*hu,Sn=.7*St,wr=.3*St;let gn=0;const tr=[];let _r=0;const lr=this.array.length;for(let ro=0;ro<lr;++ro){const Lo=this.array[ro];_r=Math.max(_r,Lo.length);const Jo=new La({parent:he,mathstyle:this.mathstyleName},this.style);let Ll=Sn/Jo.scalingFactor,Al=wr/Jo.scalingFactor;const Tl={cells:[],height:0,depth:0,pos:0};for(const cl of Lo){const e0=(ee=Un.createBox(Jo,cl,{type:"ignore"}))!=null?ee:new kr(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[ro]))!=null?re:0;Dl>0&&(Dl+=wr,Al=Math.max(Al,Dl),Dl=0),ro<lr-1&&!us(this.environmentName)&&this.environmentName!=="cases"&&this.environmentName!=="array"&&(Al+=he.getRegisterAsEm("jot")),Tl.height=Ll,Tl.depth=Al,gn+=Ll,Tl.pos=gn,gn+=Al+Dl,tr.push(Tl)}const si=gn/2+os,Ii=[];for(let ro=0;ro<_r;ro++){const Lo=[];for(const Jo of tr){const Ll=Jo.cells[ro];Ll.depth=Jo.depth,Ll.height=Jo.height,Lo.push({box:Ll,shift:Jo.pos-si})}Lo.length>0&&Ii.push(new Qa({individualShift:Lo}))}const vi=[];let Pa=!1,Ya=!1,Rr=0,Fs=!this.leftDelim;const{colFormat:_l}=this;for(const ro of _l){if("align"in ro&&Rr>=Ii.length)break;if("align"in ro)Pa?vi.push(xo(2*dt)):(Ya||Fs)&&vi.push(xo(dt)),vi.push(new kr(Ii[Rr],{classes:"col-align-"+ro.align})),Rr++,Pa=!0,Ya=!1,Fs=!1;else if("gap"in ro){if(typeof ro.gap=="number")vi.push(xo(ro.gap));else{const Lo=Co(y,tr,si,ro.gap);Lo&&vi.push(Lo)}Pa=!1,Ya=!1,Fs=!1}else if("separator"in ro){const Lo=new kr(null,{classes:"vertical-separator"});Lo.height=gn,Lo.setStyle("height",gn,"em"),Lo.setStyle("border-right",`${ge}em ${ro.separator} currentColor`),Lo.setStyle("vertical-align",-(gn-si),"em");let Jo=0;Ya?Jo=Re-ge:Pa&&(Jo=dt-ge),Lo.left=Jo,vi.push(Lo),Pa=!1,Ya=!0,Fs=!1}}Pa&&!this.rightDelim&&vi.push(xo(dt));const Xs=new kr(vi,{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 kr([this.bind(y,Kr("open",(ae=this.leftDelim)!=null?ae:".",Yo,zs,he,{isSelected:this.isSelected})),Xs,this.bind(y,Kr("close",(de=this.rightDelim)!=null?de:".",Yo,zs,he,{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(Un.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}}`),ya(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 Un({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 Un({type:"first",mode:a.mode});y.parent=a;const b=new Fi;return b.parent=a,[y,b]}function xo(a){const y=new kr(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=Un.createBox(a,E,{type:"ignore"});ae&&(ae.depth=re.depth,ae.height=re.height,ee.push({box:ae,shift:re.pos-b}))}return new Qa({individualShift:ee}).wrap(a)}var ko=class Tp extends Un{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 pe(Se({},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=Un.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 he=new La({parent:y},this.style),ge=he.toEm((E=this.padding)!=null?E:{register:"fboxsep"}),xe=new kr(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=he.toColor(this.backgroundcolor))!=null?ee:"transparent"),this.framecolor&&xe.setStyle("border",`${he.getRegisterAsEm("fboxrule",2)}em solid ${(re=he.toColor(this.framecolor))!=null?re:"black"}`),this.border&&xe.setStyle("border",this.border);const Re=new kr([xe,ae],{type:"lift"});return Re.setStyle("display","inline-block"),Re.setStyle("position","relative"),Re.setStyle("line-height",0),Re.height=ae.height+ge+(de>0?de:0),Re.depth=ae.depth+ge+(de<0?-de:0),Re.setStyle("padding-left",ge,"em"),Re.setStyle("padding-right",ge,"em"),Re.setStyle("height",Math.floor(100*(ae.height+ae.depth+2*ge+Math.abs(de)))/100,"em"),Re.setStyle("margin-top",-ge,"em"),Re.setStyle("top",Math.floor(100*(ae.depth-ae.height+2*ge-de))/100,"em"),Re.setStyle("vertical-align",Math.floor(100*(ae.depth+2*ge))/100,"em"),this.caret&&(Re.caret=this.caret),this.attachSupsub(y,{base:Re})}_serialize(y){return y.skipStyles?ya([this.bodyToLatex(y),this.supsubToLatex(y)]):super._serialize(y)}},Wl=class Dp extends Un{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 kr(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 Un{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 Un{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=Un.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=Wt(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):`{${this.bodyToLatex(y)}}`}},Wa=class Op extends Un{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 Op((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"?ya(["\\left",(b=this.leftDelim)!=null?b:".",this.bodyToLatex(y),"\\right",ee]):this.variant==="mleft...mright"?ya(["\\mleft",(E=this.leftDelim)!=null?E:".",this.bodyToLatex(y),"\\mright",ee]):ya([!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 La({parent:y},this.style);console.assert(this.body!==void 0);const re=new La({parent:y,mathstyle:"textstyle"},this.style),ae=(b=Un.createBox(ee,this.body,{type:"inner"}))!=null?b:new kr(null,{type:"inner"}),de=ae.height/re.scalingFactor,he=ae.depth/re.scalingFactor,ge=[];if(this.leftDelim&&ge.push(this.bind(re,Kr("open",this.leftDelim,de,he,re,{isSelected:this.isSelected,classes:"ML__open"+(this.containsCaret?" ML__contains-caret":""),mode:this.mode,style:this.style}))),ae&&(Bo(ae.children,this,ee,de,he),ge.push(ae)),this.rightDelim){let dt=this.containsCaret?" ML__contains-caret":"",St=this.rightDelim;St==="?"&&(ee.smartFence?(St=this.matchingRightDelim(),dt+=" ML__smart-fence__close"):St="."),ge.push(this.bind(re,Kr("close",St,de,he,re,{isSelected:this.isSelected,classes:dt+" ML__close",mode:this.mode,style:this.style})))}let xe=this.variant==="mleft...mright";const Re=this.leftSibling;Re&&(!xe&&Re.isFunction&&(xe=!0),!xe&&Re.type==="subsup"&&((E=Re.leftSibling)!=null&&E.isFunction)&&(xe=!0));const Ze=new kr(ge,{type:xe?"close":"inner",classes:"left-right"});return Ze.setStyle("margin-top",`${-ae.depth}em`),Ze.setStyle("height",`${ae.height+ae.depth}em`),this.caret&&(Ze.caret=this.caret),this.bind(ee,Ze.wrap(ee))}};function Bo(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,Kr("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&&Bo(ae.children,y,b,E,ee)}}var Eu=class Rp extends Un{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 Rp(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=Un.createBox(y,this.body);return b?(this.caret&&(b.caret=this.caret),this.bind(y,b)):null}},sl=class Np extends Un{constructor(){super({type:"macro-argument"})}static fromJson(y){return new Np}toJson(){return super.toJson()}_serialize(y){return""}render(y){return null}},xl=class Bp extends Un{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 Bp(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 La({parent:y}),E=b.getRegisterAsEm("fboxsep"),ee=E,re=E,ae=Un.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 kr(ae,{type:"ord"});de.setStyle("display","inline-block"),de.setStyle("height",ae.height+ae.depth,"em"),de.setStyle("vertical-align",-re,"em");let he="ML__prompt ";this.locked?he+=" ML__lockedPromptBox ":he+=" ML__editablePromptBox ",this.correctness==="correct"?he+=" ML__correctPromptBox ":this.correctness==="incorrect"&&(he+=" ML__incorrectPromptBox "),this.containsCaret&&(he+=" ML__focusedPromptBox ");const ge=new kr(null,{classes:he,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 Re=new kr([ge,de],{classes:"ML__prompt-atom"});return Re.setStyle("position","relative"),Re.setStyle("display","inline-block"),Re.setStyle("line-height",0),Re.height=de.height+re+.2,Re.depth=de.depth+re,Re.left=ee,Re.right=ee,Re.setStyle("height",de.height+re,"em"),Re.setStyle("top",de.depth-de.height,"em"),Re.setStyle("vertical-align",de.depth+re,"em"),Re.setStyle("margin-left",.5,"em"),Re.setStyle("margin-right",.5,"em"),this.caret&&(Re.caret=this.caret),this.bind(b,this.attachSupsub(y,{base:Re}))}_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)}},Vs=class $p extends Un{constructor(y){super({type:"subsup",style:y==null?void 0:y.style}),this.subsupPlacement="auto"}static fromJson(y){const b=new $p(y);for(const E of sc)y[E]&&b.setChildren(y[E],E);return b}render(y){var b;const E=new La({parent:y,isPhantom:!0}),ee=this.leftSibling,re=(b=ee.render(E))!=null?b:new kr(null),ae=new kr(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 Ul=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 La&&!(b!=null&&b.parseMode)&&!b.mathstyle?y:new La({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:Se({},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(Se({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 Se({},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 Vs({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=Wt(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 Fi({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 he=a?Number.parseInt(de,re):Number.parseFloat(de);return Number.isNaN(he)?null:{number:E?-he:he,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=tn(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 he=this.scanArgument(de.type);he||this.onError({code:"missing-argument",arg:a}),b.push(he)}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=Wt(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 Wa("",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=Wt(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 Wa(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 Un({type:"mord",command:"\\doubleprime",mode:"math",value:"\u2032\u2032"}),"superscript"):y.addChild(new Un({type:"mord",command:"\\prime",mode:"math",value:"\u2032"}),"superscript"):(this.match("^")||this.match("_"))&&y.addChildren(ft(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,Se({},this.style));return b?[b]:null}if(y=this.scanMacro(a),y)return[y];if(a.startsWith("\\")){const b=Wt(a,this.parseMode);if(!b)return this.onError({code:"unknown-command",arg:a}),[new ys(a)];if(b.definitionType==="symbol"){const E=Se({},this.style);b.variant&&(E.variant=b.variant),y=new Un({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"),he=this.scanOptionalArgument("math"),ge=Un.serialize(he,{defaultMode:"math"});let xe=[],Re;!Re&&ge==="correct"?Re="correct":!Re&&ge==="incorrect"?Re="incorrect":ge!==""&&(xe=he);const Ze=this.scanOptionalArgument("string")==="locked",dt=this.scanArgument("auto");let St;return dt&&Array.isArray(dt)&&dt.length>0?St=dt:dt&&typeof dt=="object"&&"group"in dt?St=dt.group:St=xe,de?[new xl(de,Re,Ze,St!=null?St:xe,{mode:this.parseMode,style:this.style})]:[new Fi({mode:this.parseMode,style:this.style})]}if(a==="\\renewcommand"||a==="\\newcommand"||a==="\\providecommand"||a==="\\def"){const de=this.index,he=this.scanLiteralGroup()||this.next();if(!he)return null;if(this.context.registers[he.substring(1)]){const ge=this.scanArgument("string");ge!==null&&(this.context.registers[he.substring(1)]=ge);const xe=ya([a,pl(this.tokens.slice(de,this.index))]);return[new Un({type:"text",value:"",verbatimLatex:xe})]}}let ee=this.scanMacro(a);if(ee)return[ee];const re=Wt(a,this.parseMode);if(!re)return this.parseMode==="text"?(/[a-zA-Z]/.test((y=this.peek())!=null?y:"")&&(a+=" "),[...a].map(de=>new Un({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=Se({},this.style);re.variant&&(de.variant=re.variant),ee=new Un({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 he,ge=[];if(re.parse?ge=re.parse(this):[he,ge]=this.scanArguments(re),this.parseMode=de,re.applyMode&&!re.applyStyle&&!re.createAtom)return ft(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}),he&&(ee.body=ft(this.scanArgument(he)));else if(typeof re.applyStyle=="function"){const xe=Se(Se({},this.style),re.applyStyle(a,ge,this.context)),Re=this.parseMode;if(re.applyMode&&(this.parseMode=re.applyMode),he){const Ze=this.style;this.style=xe;const dt=this.scanArgument(he);return this.style=Ze,this.parseMode=Re,ft(dt)}this.style=xe}else ee=new Un({type:"mord",command:(b=re.command)!=null?b:a,style:Se({},this.style),value:a,mode:(E=re.applyMode)!=null?E:this.parseMode})}if(!ee)return null;if(ee instanceof Un&&ee.verbatimLatex===void 0&&!/^\\(llap|rlap|class|cssId|htmlData)$/.test(a)){const de=ya([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,Se({},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 he=this.index;this.scanExpression(),de=pl(this.tokens.slice(he,this.index))}re[ae]=de}return new Eu(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 Ul(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:{}}),he=[];for(;!de.end();)he.push(...de.scan(()=>!1));return he}function t0(a,y){var b;const E=new Ul(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 Fp extends Un{constructor(y,b){super({type:"chem"},{command:y,mode:"math"});const E=vo.go(vr.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 Fp(y.command,y.arg)}set verbatimLatex(y){}get verbatimLatex(){return this._verbatimLatex}toJson(){return pe(Se({},super.toJson()),{arg:this.arg})}render(y){const b=Un.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}};Nt(["ce","pu"],"{chemformula:balanced-string}",{createAtom:a=>{var y;return new n0(a.command,(y=a.args[0])!=null?y:"")}});var vr={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=vr.stateMachines[y],he=de.transitions[b]||de.transitions["*"];e:for(var ge=0;ge<he.length;ge++){var xe=vr.patterns.match_(he[ge].pattern,a);if(xe){for(var Re=he[ge].task,Ze=0;Ze<Re.action_.length;Ze++){var dt;if(de.actions[Re.action_[Ze].type_])dt=de.actions[Re.action_[Ze].type_](E,xe.match_,Re.action_[Ze].option);else if(vr.actions[Re.action_[Ze].type_])dt=vr.actions[Re.action_[Ze].type_](E,xe.match_,Re.action_[Ze].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+Re.action_[Ze].type_+")"];vr.concatArray(ae,dt)}if(b=Re.nextState||b,a.length>0){if(Re.revisit||(a=xe.remainder),!Re.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=vr.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 vr.patterns.findObserveGroups(a,"^{","","","}")},"^($...$)":function(a){return vr.patterns.findObserveGroups(a,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(a){return vr.patterns.findObserveGroups(a,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(a){return vr.patterns.findObserveGroups(a,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(a){return vr.patterns.findObserveGroups(a,"_{","","","}")},"_($...$)":function(a){return vr.patterns.findObserveGroups(a,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(a){return vr.patterns.findObserveGroups(a,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(a){return vr.patterns.findObserveGroups(a,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(a){return vr.patterns.findObserveGroups(a,"","{","}","")},"{(...)}":function(a){return vr.patterns.findObserveGroups(a,"{","","","}")},"$...$":function(a){return vr.patterns.findObserveGroups(a,"","$","$","")},"${(...)}$":function(a){return vr.patterns.findObserveGroups(a,"${","","","}$")},"$(...)$":function(a){return vr.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 vr.patterns.findObserveGroups(a,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(a){return vr.patterns.findObserveGroups(a,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(a){return vr.patterns.findObserveGroups(a,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(a){return vr.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 vr.patterns.findObserveGroups(a,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(a){return vr.patterns.findObserveGroups(a,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(a){return vr.patterns.findObserveGroups(a,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(a){return vr.patterns.findObserveGroups(a,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(a){return vr.patterns.findObserveGroups(a,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(a){return vr.patterns.findObserveGroups(a,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(a){return vr.patterns.findObserveGroups(a,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(a){return vr.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=vr.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,he,ge){var xe=function(gn,tr){if(typeof tr=="string")return gn.indexOf(tr)!==0?null:tr;var _r=gn.match(tr);return _r?_r[0]:null},Re=function(gn,tr,_r){for(var lr=0;tr<gn.length;){var si=gn.charAt(tr),Ii=xe(gn.substr(tr),_r);if(Ii!==null&&lr===0)return{endMatchBegin:tr,endMatchEnd:tr+Ii.length};if(si==="{")lr++;else if(si==="}"){if(lr===0)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];lr--}tr++}return lr>0,null},Ze=xe(a,y);if(Ze===null||(a=a.substr(Ze.length),Ze=xe(a,b),Ze===null))return null;var dt=Re(a,Ze.length,E||ee);if(dt===null)return null;var St=a.substring(0,E?dt.endMatchEnd:dt.endMatchBegin);if(re||ae){var Sn=this.findObserveGroups(a.substr(dt.endMatchEnd),re,ae,de,he);if(Sn===null)return null;var wr=[St,Sn.match_];return{match_:ge?wr.join(""):wr,remainder:Sn.remainder}}else return{match_:St,remainder:a.substr(dt.endMatchEnd)}},match_:function(a,y){var b=vr.patterns.patterns[a];if(b===void 0)throw["MhchemBugP","mhchem bug P. Please report. ("+a+")"];if(typeof b=="function")return vr.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 vr.go(y,"text")},"{text}":function(a,y){var b=["{"];return vr.concatArray(b,vr.go(y,"text")),b.push("}"),b},"tex-math":function(a,y){return vr.go(y,"tex-math")},"tex-math tight":function(a,y){return vr.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 vr.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 vr.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 he=y.split("|"),ge=0;ge<he.length;ge++)if(E[ee]==="*")for(var xe in re)re[xe].push({pattern:he[ge],task:ae});else re[E[ee]].push({pattern:he[ge],task:ae})}return re},stateMachines:{}};vr.stateMachines={ce:{transitions:vr.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 vr.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 vr.concatArray(b,this.output(a)),vr.concatArray(b,vr.actions.bond(a,y,"-")),b}else a.d=y},"- after o/d":function(a,y,b){var E=vr.patterns.match_("orbital",a.o||""),ee=vr.patterns.match_("one lowercase greek letter $",a.o||""),re=vr.patterns.match_("one lowercase latin letter $",a.o||""),ae=vr.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 he=[];return de?(vr.concatArray(he,this.output(a)),he.push({type_:"hyphen"})):(E=vr.patterns.match_("digits",a.d||""),b&&E&&E.remainder===""?(vr.concatArray(he,vr.actions["d="](a,y)),vr.concatArray(he,this.output(a))):(vr.concatArray(he,this.output(a)),vr.concatArray(he,vr.actions.bond(a,y,"-")))),he},"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:vr.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"&&vr.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:vr.go(a.a,"a"),b:vr.go(a.b,"bd"),p:vr.go(a.p,"pq"),o:vr.go(a.o,"o"),q:vr.go(a.q,"pq"),d:vr.go(a.d,a.dType==="oxidation"?"oxidation":"bd"),dType:a.dType}));else{var ee;a.rdt==="M"?ee=vr.go(a.rd,"tex-math"):a.rdt==="T"?ee=[{type_:"text",p1:a.rd||""}]:ee=vr.go(a.rd);var re;a.rqt==="M"?re=vr.go(a.rq,"tex-math"):a.rqt==="T"?re=[{type_:"text",p1:a.rq||""}]:re=vr.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 vr.concatArray(b,vr.go(y,"oxidation")),b.push("}"),b},"frac-output":function(a,y){return{type_:"frac-ce",p1:vr.go(y[0]),p2:vr.go(y[1])}},"overset-output":function(a,y){return{type_:"overset",p1:vr.go(y[0]),p2:vr.go(y[1])}},"underset-output":function(a,y){return{type_:"underset",p1:vr.go(y[0]),p2:vr.go(y[1])}},"underbrace-output":function(a,y){return{type_:"underbrace",p1:vr.go(y[0]),p2:vr.go(y[1])}},"color-output":function(a,y){return{type_:"color",color1:y[0],color2:vr.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:vr.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:vr.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:vr.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:vr.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:vr.go(y,"o")}},"color-output":function(a,y){return{type_:"color",color1:y[0],color2:vr.go(y[1],"pq")}}}},bd:{transitions:vr.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:vr.go(y[1],"bd")}}}},oxidation:{transitions:vr.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:vr.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:vr.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:vr.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:vr.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]&&(vr.concatArray(b,vr.go(y[1],"pu-9,9")),y[2]&&(y[2].match(/[,.]/)?vr.concatArray(b,vr.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]),vr.concatArray(b,vr.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=vr.patterns.match_("{(...)}",a.d||"");b&&b.remainder===""&&(a.d=b.match_);var E=vr.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:vr.go(a.d,"pu"),q:vr.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_:"/"}),vr.concatArray(y,ee.q))}else y=vr.go(a.d,"pu-2");for(var re in a)delete a[re];return y}}},"pu-2":{transitions:vr.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=vr.patterns.match_("{(...)}",a.rm||"");b&&b.remainder===""?y=vr.go(b.match_,"pu"):y={type_:"rm",p1:a.rm}}for(var E in a)delete a[E];return y}}},"pu-9,9":{transitions:vr.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 k1(a){}var r0=class zp extends Un{constructor(y){super(pe(Se({},y),{type:"delim"})),this.value=y.delim,this.size=y.size}static fromJson(y){return new zp(y)}toJson(){return pe(Se({},super.toJson()),{delim:this.value,size:this.size})}render(y){return new kr(this.value,{type:"middle"})}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Wt(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):uo(this.command,this.value)}},i0=class Kp extends Un{constructor(y){super(pe(Se({},y),{type:"sizeddelim",value:y.delim})),this.delimType=y.delimType,this.size=y.size}static fromJson(y){return new Kp(y)}toJson(){return pe(Se({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(y){let b=on(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=Wt(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):uo(this.command,this.value)}},bd=class Hp extends Un{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 pe(Se({},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=Wt(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 La({parent:y},this.style),E=Un.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 kr(null,{classes:"ML__notation"});let de=E.height+E.depth+2*re;const he=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 St=.03*Math.sqrt(he*he+de*de)*1,Sn=E.width*St,wr=(E.depth+E.height)*St,gn=re+E.width;let tr=re;tr+wr-.4*Sn<0&&(tr=.4*Sn-wr),ge+='<polygon points="',ge+=`${gn},${tr} ${gn-Sn-.4*wr},${tr+wr-.4*Sn} `,ge+=`${gn-.7*Sn},${tr+.7*wr} ${gn-Sn+.4*wr},${tr+wr+.4*Sn} `,ge+=`${gn},${tr}`,ge+=`" stroke='none' fill="${this.strokeColor}"`,ge+="/>"}let xe=0;if(this.notation.phasorangle){const Ze=a0(b),dt=(E.height+E.depth+2*Ze+re).toString(),St=(E.height+E.depth)/2;ge+=this.line(re.toString(),dt,(re+St+E.width).toString(),dt),ge+=this.line(re.toString(),dt,(re+St).toString(),(re-Ze).toString()),de+=Ze,xe=St,E.left+=de/2-re}if(this.notation.longdiv){const Ze=a0(b);de+=Ze,ge+=this.line(re.toString(),re.toString(),(re+E.width).toString(),re.toString());const dt=.3;xe=dt+Ze,E.left+=dt+Ze,E.setTop(re+Ze),ge+='<path d="',ge+=`M ${re} ${re} a${dt} ${(E.depth+E.height+2*Ze)/2}, 0, 1, 1, 0 ${E.depth+E.height+2*Ze} "`,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 Ze="";this.shadow==="auto"&&(Ze+="filter: drop-shadow(0 0 .5px rgba(255, 255, 255, .7)) drop-shadow(1px 1px 2px #333)"),this.shadow!=="none"&&(Ze+=`filter: drop-shadow(${this.shadow})`),Ze+=` stroke-width="${this.strokeWidth}" stroke="${this.strokeColor}"`,Ze+=' stroke-linecap="round"',this.svgStrokeStyle&&(Ze+=` stroke-dasharray="${this.svgStrokeStyle}"`),ae.svgStyle=Ze,ae.svgOverlay=ge}const Re=new kr([ae,E]);return Re.setStyle("position","relative"),Re.setStyle("vertical-align",re,"em"),Re.setStyle("height",`${Math.floor(100*(E.height+E.depth+2*re))/100}em`),Re.setStyle("display","inline-block"),Re.height=ae.height,Re.depth=ae.depth,Re.width=ae.width-2*re,Re.left=re,Re.right=re,this.caret&&(Re.caret=this.caret),Re.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 ku=class Wp extends Un{constructor(y,b,E){var ee,re;super(pe(Se({},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),Se(Se({},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 La({parent:y,mathstyle:this.mathstyleName},this.style),re=ee.metrics,ae=new La({parent:ee,mathstyle:this.continuousFraction?"":"numerator"},this.style),de=this.numerPrefix?new kr([new kr(this.numerPrefix),Un.createBox(ae,this.above)],{isTight:ae.isTight,type:"ignore"}):(b=Un.createBox(ae,this.above,{type:"ignore"}))!=null?b:new kr(null,{type:"ignore"}),he=new La({parent:ee,mathstyle:this.continuousFraction?"":"denominator"},this.style),ge=this.denomPrefix?new kr([new kr(this.denomPrefix),Un.createBox(he,this.below,{type:"ignore"})]):(E=Un.createBox(he,this.below,{type:"ignore"}))!=null?E:new kr(null,{type:"ignore"}),xe=this.hasBarLine?re.defaultRuleThickness:0;let Re,Ze=0,dt;ee.isDisplayStyle?(Re=ae.metrics.num1,Ze=xe>0?3*xe:7*xe,dt=he.metrics.denom1):(xe>0?(Re=ae.metrics.num2,Ze=xe):(Re=ae.metrics.num3,Ze=3*re.defaultRuleThickness),dt=he.metrics.denom2);const St=[];this.isSelected&&St.push("ML__selected");const Sn=de.depth,wr=ge.height;let gn;if(xe<=0){const vi=Re-Sn-(wr-dt);vi<Ze&&(Re+=(Ze-vi)/2,dt+=(Ze-vi)/2),gn=new Qa({individualShift:[{box:de,shift:-Re,classes:[...St,"ML__center"]},{box:ge,shift:dt,classes:[...St,"ML__center"]}]}).wrap(ee)}else{const vi=new kr(null,{classes:"ML__frac-line",mode:this.mode,style:this.style});vi.softWidth=Math.max(de.width,ge.width),vi.height=xe/2,vi.depth=xe/2;const Pa=os+xe/2;Re<Ze+Sn+Pa&&(Re=Ze+Sn+Pa);const Ya=os-xe/2;dt<Ze+wr-Ya&&(dt=Ze+wr-Ya),gn=new Qa({individualShift:[{box:ge,shift:dt,classes:[...St,"ML__center"]},{box:vi,shift:-Ya,classes:St},{box:de,shift:-Re,classes:[...St,"ML__center"]}]}).wrap(ee)}const tr=ee.isDisplayStyle?re.delim1:re.delim2,_r=this.leftDelim?this.bind(y,ni("open",this.leftDelim,tr,!0,y,{style:this.style,mode:this.mode,isSelected:this.isSelected})):ri(ee,"open");let lr=null;this.continuousFraction?lr=new kr(null,{type:"close"}):this.rightDelim?lr=this.bind(y,ni("close",this.rightDelim,tr,!0,y,{style:this.style,mode:this.mode,isSelected:this.isSelected})):lr=ri(ee,"close");const si=new kr([_r,gn,lr],{isTight:ee.isTight,type:"inner",classes:"mfrac"}),Ii=this.bind(y,si);return this.caret&&(Ii.caret=this.caret),this.attachSupsub(y,{base:Ii})}},ns=class Up extends Un{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 Up(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),Se({type:"latex",value:this.value},y)}get computedStyle(){return{}}render(y){const b=new kr(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 Zp extends Un{constructor(y){super({type:"latexgroup",mode:"latex"}),this.body=[...y].map(b=>new ns(b)),this.skipBoundary=!1}static fromJson(y){return new Zp("")}toJson(){return super.toJson()}render(y){const b=Un.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 Vp extends Un{constructor(y,b){super(pe(Se({},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 Vp(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 kr(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 he=(b=this.subsupPlacement)!=null?b:"auto";de=he==="over-under"||he==="auto"&&y.isDisplayStyle?this.attachLimits(y,{base:ee,baseShift:re,slant:ae}):this.attachSupsub(y,{base:ee})}return new kr(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=Wt(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)),ya(E)}},Rc=class jp extends Un{constructor(y){const b=y.body;super(pe(Se({},y),{type:"overlap",body:typeof b=="string"?[new Un({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),Se(Se({},super.toJson()),y)}render(y){const b=Un.createBox(y,this.body,{classes:"inner"});return b?(this.caret&&(b.caret=this.caret),this.bind(y,new kr([b,new kr(null,{classes:"fix"})],{classes:this.align==="right"?"rlap":"llap",type:this.boxType}))):null}},js=class Gp extends Un{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?Os(this.svgBody):Un.createBox(y,this.body,{type:"ignore"});const E=new La({parent:y,mathstyle:"scriptstyle"},this.style);let ee=null;this.svgAbove?ee=Os(this.svgAbove):this.above&&(ee=Un.createBox(E,this.above,{type:"ignore"}));let re=null;this.svgBelow?re=Os(this.svgBelow):this.below&&(re=Un.createBox(E,this.below,{type:"ignore"})),this.paddedBody&&(b=new kr([ri(y,"open"),b,ri(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 kr(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 Qa({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 Qa({top:ee.height-re,children:[a.metrics.bigOpSpacing5,{box:y.below,classes:ae},{box:ee,classes:["ML__center"]}]}):y.above&&(E=new Qa({bottom:ee.depth+re,children:[{box:ee,classes:["ML__center"]},b,{box:y.above,classes:ae},a.metrics.bigOpSpacing5]}));return new kr(E,{type:y.type})}var wd=class Xp extends Un{constructor(y){var b,E,ee,re;super(pe(Se({},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),Se(Se({},super.toJson()),y)}render(y){const b=new La({parent:y,isPhantom:!0});if(!this.smashDepth&&!this.smashHeight&&!this.smashWidth)return console.assert(this.isInvisible),Un.createBox(b,this.body,{classes:"inner"});const E=Un.createBox(this.isInvisible?b:y,this.body);if(!E)return null;if(this.smashWidth){const ee=new kr(null,{classes:"fix"});return new kr([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 Qa({firstBaseline:[{box:E}]},{type:E.type}).wrap(y)}},Sd=class qp extends Un{constructor(y){var b;super(Se({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 kr(this.mode==="math"?null:" ");let E;if(this.width!==void 0)E=new kr(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 kr(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=Wt(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 Un{constructor(y){var b;super(pe(Se({},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(pe(Se({},y),{index:y.above}))}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Wt(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 La({parent:y,mathstyle:"cramp"},this.style),ee=(b=Un.createBox(E,this.body,{type:"inner"}))!=null?b:new kr(null),re=E.scalingFactor,ae=E.metrics.defaultRuleThickness/re,de=y.isDisplayStyle?el:ae,he=new kr(null,{classes:"ML__sqrt-line",style:this.style});he.height=ae,he.softWidth=ee.width;let ge=re*(ae+de/4);const Re=Math.max(re*2*de,ee.height+ee.depth)+ge+ae,Ze=new La({parent:y},this.style),dt=this.bind(Ze,new kr(ni("inner","\\surd",Re,!1,Ze,{isSelected:this.isSelected}),{isSelected:this.isSelected,classes:"ML__sqrt-sign",style:this.style}));if(!dt)return null;const St=dt.height+dt.depth-ae;St>ee.height+ee.depth+ge&&(ge=(ge+St-(ee.height+ee.depth))/2),dt.setTop(dt.height-ee.height-ge);const Sn=this.bind(y,new Qa({firstBaseline:[{box:new kr(ee)},ge-2*ae,{box:he},ae]})),wr=Un.createBox(new La({parent:y,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!wr){const _r=new kr([dt,Sn],{classes:this.containsCaret?"ML__contains-caret":"",type:"inner"});return _r.setStyle("display","inline-block"),_r.setStyle("height",_r.height+_r.depth,"em"),this.caret&&(_r.caret=this.caret),this.bind(y,_r)}const gn=new Qa({shift:-.6*(Math.max(dt.height,Sn.height)-Math.max(dt.depth,Sn.depth)),children:[{box:wr}]}),tr=new kr([new kr(gn,{classes:"ML__sqrt-index",type:"ignore"}),dt,Sn],{type:"inner",classes:this.containsCaret?"ML__contains-caret":""});return tr.height=dt.height,tr.depth=dt.depth,this.caret&&(tr.caret=this.caret),this.bind(y,tr)}},sm=class extends kr{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}},cm={ord:{op:3},op:{ord:3,op:3},close:{op:3},inner:{op:3}};function um(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;um(b);const E=y.getRegisterAsEm("thinmuskip"),ee=y.getRegisterAsEm("medmuskip"),re=y.getRegisterAsEm("thickmuskip");return Md(b,(ae,de)=>{var he,ge,xe;if(!ae)return;const Re=ae.type,Ze=de.isTight?(he=cm[Re])!=null?he:null:(ge=lm[Re])!=null?ge:null,dt=(xe=Ze==null?void 0:Ze[de.type])!=null?xe:null;dt===3&&xf(de,E),dt===4&&xf(de,ee),dt===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 Un{constructor(y){super({type:"tooltip",command:y.command,mode:y.mode,style:y.style,body:y.body,displayContainsHighlight:!0}),this.tooltip=new Un({type:"root",mode:y.content,body:y.tooltip,style:{}}),this.skipBoundary=!0,this.captureSelection=!1}static fromJson(y){return new Jp(pe(Se({},y),{tooltip:dc(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 pe(Se({},super.toJson()),{tooltip:b})}render(y){const b=Un.createBox(new La,this.body);if(!b)return null;const E=new La({parent:y,mathstyle:"displaystyle"},{fontSize:dl}),ee=gu(Cd(new kr(this.tooltip.render(E),{classes:"ML__tooltip-content"}),E)),re=new kr([ee,b],{classes:"ML__tooltip-container"});return this.caret&&(re.caret=this.caret),this.bind(y,re)}},Nc=class Qp extends Un{constructor(y,b){super(pe(Se({},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 kr(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 kr(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=Wt(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)),ya(E)}};function dc(a){if(ze(a))return a.map(E=>dc(E));if(typeof a=="string")return Un.fromJson(a);a=Se({},a);for(const E of sc)a[E]&&(a[E]=dc(a[E]));a.args&&(a.args=dm(a.args)),a.array&&(a.array=dc(a.array));const y=a.type;let b;y==="accent"&&(b=z.fromJson(a)),y==="array"&&(b=oa.fromJson(a)),y==="box"&&(b=ko.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=ku.fromJson(a)),y==="group"&&(b=Go.fromJson(a)),y==="latex"&&(b=ns.fromJson(a)),y==="latexgroup"&&(b=xd.fromJson(a)),y==="leftright"&&(b=Wa.fromJson(a)),y==="macro"&&(b=Eu.fromJson(a)),y==="macro-argument"&&(b=sl.fromJson(a)),y==="operator"&&(b=Nc.fromJson(a)),y==="overlap"&&(b=Rc.fromJson(a)),y==="overunder"&&(b=js.fromJson(a)),y==="placeholder"&&(b=Fi.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=Vs.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=Un.fromJson(a));for(const E of sc)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=>dc(b))}:typeof y=="object"&&"atoms"in y?y.atoms.map(b=>dc(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 Un({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 Un({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 he=new Un({type:"mord",mode:"math",command:(ae=y.command)!=null?ae:a,value:a,style:b});return de&&(he.isFunction=!0),a.startsWith("\\")&&(he.verbatimLatex=a),he}serialize(a,y){const b=gm(a,pe(Se({},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,he)=>{var ge;de.test(a.value)&&pm[(ge=y.letterShapeStyle)!=null?ge:"tex"][he]==="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=Hn(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=c0(b);return Eo(a,"variant").map(ee=>{const re=c0(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=ya(ee.map(he=>he._serialize(y)));return ae?uo(ae,de):de})}function c0(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)}${ya(E)}}`:re?uo(re,ya(E)):ya(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)}${ya(E)}}`:re?uo(re,ya(E)):ya(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} ${ya(re)}`:ya(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}{${ya(ae)}}`:E[0].style.fontFamily?`{\\fontfamily{${E[0].style.fontFamily}} ${ya(ae)}}`:b?`\\text{${ya(ae)}}`:ya(ae)})}var u0={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,pe(Se({},y),{defaultMode:"text"}),y.defaultMode!=="text")}getFont(a,y){var b,E,ee,re,ae;const{fontFamily:de}=y;if(u0[de]?a.classes+=" "+u0[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 he=y.fontSeries.match(/(.?[lbm])?(.?[cx])?/);he&&(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=he[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=he[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:["=","=","=","="]}},km={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:["<",">","",""]}},_m={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 _u(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 Om={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=[],kd;function gh(){switch(De()){case"macos":case"ios":return"apple";case"windows":return"windows"}return"linux"}function Bs(a){(!a.platform||a.platform===gh())&&Ed.push(a)}function Rm(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=Om[a])!=null?b:"",E}function Nm(a){if(a.code)return a;const y=Object.entries(_d().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,pe(Se({},a),{altKey:b,shiftKey:E,code:ee}))}function Bm(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 $m(a){kd=Ed.find(y=>a.startsWith(y.locale))}function _d(){return kd!=null?kd:Ed[0]}function Fm(){switch(gh()){case"apple":return mh;case"windows":return d0;case"linux":return f0}return mh}switch(gh()){case"apple":Bs(mh),Bs(Em),Bs(Dm),Bs(Lm);break;case"windows":Bs(d0),Bs(km),Bs(Im),Bs(Am);break;case"linux":Bs(f0),Bs(_m),Bs(Pm),Bs(Tm);break}Bs(Mm);function vh(a){var y;const b=/macos|ios/.test(De()),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 Bc(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 he=new AbortController,ge=he.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 Re;if(!re&&(a.textContent="",xe.inputType!=="insertCompositionText")){if(xe.inputType==="insertFromPaste"){xe.preventDefault(),xe.stopPropagation();return}b.onInput((Re=xe.data)!=null?Re:""),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 Re,Ze;if(((Ze=(Re=xe.relatedTarget)==null?void 0:Re._mathfield)==null?void 0:Ze.element)===y){a.focus({preventScroll:!0}),xe.preventDefault(),xe.stopPropagation();return}const dt=wl.state;if(dt==="open"||dt==="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:()=>he.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 Re;a.textContent=xe,a.style.left="-1000px",(Re=window.getSelection())==null||Re.selectAllChildren(a)},moveTo:(xe,Re)=>{a.style.top=`${Re}px`,a.style.left=`${xe}px`}}}function Lu(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=Nm(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(kt()){const y=De(),b=a.startsWith("!"),E=a.endsWith(y);if(b&&!E||!b&&E)return!0}return a==="!other"?!1:a==="other"}function Um(a,y,b){if(a.length===0)return"";const E=_u(h0(p0(b))),ee=_u({key:b.key,shift:b.shiftKey,alt:b.altKey,ctrl:b.ctrlKey,meta:b.metaKey||b.ctrlKey&&/macos|ios/.test(De()),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 ze(y)&&(y=y.length>0?y[0]+"("+y.slice(1).join("")+")":""),y}function Zm(a,y){let b=[];if(typeof y=="string"){const re=hd[y];ze(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 Vm(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=De()==="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 pe(Se({},a),{key:_u(b)});const ee=Rm(b.key,y);if(!ee)return pe(Se({},a),{key:_u(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 ${_u(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,pe(Se({},a),{key:_u(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=Vm(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 ra{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 he of y)se.test(he)&&re.push(new ns(he));let ae=a.at(a.position);if(ae instanceof xd&&(ae=ae.lastChild),!(ae.parent instanceof xd)){const he=new xd("");ae.parent.addChildAfter(he,ae),ae=he.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 he=a.at(E);ee=he instanceof ns&&he.isSuggestion,ee||E++}if(!ee)return[void 0,void 0];let ae=E,de=!1;for(;ae<=re&&!de;){const he=a.at(ae);de=!(he instanceof ns&&he.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"){Tu(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=hn(a,ae);if(de.length===0){if(/^\\[a-zA-Z\*]+$/.test(ae))for(const xe of ee)xe.isError=!0;Tu(a);return}const he=(b=y==null?void 0:y.atIndex)!=null?b:0;a.suggestionIndex=he<0?de.length-1:he%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(Re=>new ns(Re,{isSuggestion:!0})),xe),$c(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 Au(a,y="accept",b){var E,ee;Tu(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(""),he=re.leftSibling;return re.parent.removeChild(re),a.model.position=a.model.offsetOf(he),a.switchMode((E=b==null?void 0:b.mode)!=null?E:"math"),y==="reject"||(ra.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 La({from:a.context}),E=new Un({mode:"math",type:"root",body:Xo(y,{context:b})}),ee=gu(Cd(new kr(E.render(b),{classes:"ML__base"}),b));return vu(ee,{classes:"ML__latex"}).toMarkup()}function Ym(a,y){var b;if(y.length===0){Tu(a);return}let E="";for(const[re,ae]of y.entries()){const de=ae,he=qm(a,ae),ge=Zm(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">${he}</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"),kf(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 kf(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"){Tu(a);return}if(y!=null&&y.deferred){setTimeout(()=>kf(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,he=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-he-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 Tu(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"),_s("suggestion-popover"),_s("core"),b.addEventListener("pointerdown",E=>E.preventDefault()),b.addEventListener("click",E=>{let ee=E.target;for(;ee&&!ee.dataset.command;)ee=ee.parentElement;ee&&(Au(a,"reject"),ra.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 _f=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 gc(this,null,function*(){if(/^(?:[a-z+]+:)?\/\//i.test(a))return new URL(a).href;if(_f===null)try{const y=yield fetch(wh,{method:"HEAD"});y.status===200&&(_f=y.url)}catch(y){console.error(`Invalid URL "${a}" (relative to "${wh}")`)}return new URL(a,_f!=null?_f:wh).href})}function tg(a,y,b={}){return new FontFace(a,`url(${y}.woff2) format('woff2')`,b)}var $s="not-loaded";function ng(){return gc(this,null,function*(){return $s="not-loaded",Lf()})}function Lf(){return gc(this,null,function*(){var a;if($s!=="not-loaded")return;if($s="loading",(a=getComputedStyle(document.documentElement).getPropertyValue("--ML__static-fonts"))!=null?a:!1){$s="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))){$s="ready";return}if(!window.MathfieldElement.fontsDirectory){$s="not-loaded";return}const ee=yield x0(window.MathfieldElement.fontsDirectory);if(!ee){document.body.classList.add("ML__fonts-did-not-load"),$s="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(he){}}))).forEach(de=>document.fonts.add(de)),$s="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")}$s="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(()=>{Rs(a)&&a.dirty&&(a.atomBoundsCache=new Map,$c(a,y),a.atomBoundsCache=void 0)})))}function ig(a,y){var b;y=y!=null?y:{};const E=new La({from:pe(Se({},a.context),{atomIdsSettings:{seed:y.forHighlighting?rg(Un.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 vu(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 $c(a,y){if(!Rs(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 he=a.options.contentPlaceholder;he&&(ae+=`<span part=placeholder class="ML__content-placeholder">${qo(he)}</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)&&$s!=="error"&&$s!=="ready"&&setTimeout(()=>{$s==="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){kf(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 he=md(a,lc(a,de),ae);if(he){he.left/=ae,he.right/=ae,he.top/=ae,he.bottom/=ae;const ge=document.createElement("div");ge.classList.add("ML__contains-highlight"),ge.style.position="absolute",ge.style.left=`${he.left+1}px`,ge.style.top=`${Math.ceil(he.top)}px`,ge.style.width=`${Math.ceil(he.right-he.left)}px`,ge.style.height=`${Math.ceil(he.bottom-he.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 he=document.createElement("div");he.classList.add("ML__selection"),he.style.position="absolute",he.style.left=`${de.left}px`,he.style.top=`${de.top}px`,he.style.width=`${Math.ceil(de.right-de.left)}px`,he.style.height=`${Math.ceil(de.bottom-de.top-1)}px`,b.insertBefore(he,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=Se({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]=pe(Se({},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 Du(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;ze(y)?(E=y[0],ee=y.slice(1)):E=y,E=E.replace(/-\w/g,ge=>ge[1].toUpperCase());const de=Sl[E],he=de==null?void 0:de.target;if(he==="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(he==="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 he!=="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&&Je()&&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 cg(a){return Ad(a,{atIndex:a.suggestionIndex-1}),!1}Ls({complete:Au},{target:"mathfield",audioFeedback:"return",canUndo:!0,changeContent:!0,changeSelection:!0}),Ls({nextSuggestion:lg,previousSuggestion:cg},{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 ug=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;Du(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(Se({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=fc.singleton;if(!re)return;const ae=Iu(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 he={};let ge="";for(const Sn of fg(de)){const wr=_0(Sn),gn=Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);he[gn]=wr;const[tr,_r]=If(wr);ge+=`<div id=${gn} class="item ${_r}">${tr}</div>`}const xe=document.createElement("div");xe.setAttribute("aria-hidden","true"),xe.className="MLK__variant-panel",xe.style.height="auto";const Re=Object.keys(he).length;let Ze=5;Re===1?Ze=1:Re===2||Re===4?Ze=2:Re===3||Re===5||Re===6?Ze=3:Re>=7&&Re<14&&(Ze=4),xe.style.width=`calc(var(--variant-keycap-length) * ${Ze} + 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:dt}=Td,St=a==null?void 0:a.getBoundingClientRect();if(St){St.top-xe.clientHeight<0&&(xe.style.width="auto",Re<=6?xe.style.height="56px":Re<=12?xe.style.height="108px":Re<=18?xe.style.height="205px":xe.classList.add("compact"));const Sn=Math.max(0,Math.min(window.innerWidth-xe.offsetWidth,(St.left+St.right-xe.offsetWidth)/2)),wr=St.top-xe.clientHeight+5;xe.style.transform=`translate(${Sn}px, ${wr}px)`,xe.classList.add("is-visible"),requestAnimationFrame(()=>{xe.addEventListener("pointerup",gn=>{const tr=Iu(gn.target);!(tr!=null&&tr.id)||!he[tr.id]||(Mh(he[tr.id]),Dd(),y==null||y(),gn.preventDefault())},{capture:!0,passive:!1,signal:dt}),xe.addEventListener("pointerenter",gn=>{const tr=Iu(gn.target);!(tr!=null&&tr.id)||!he[tr.id]||tr.classList.add("is-active")},{capture:!0,signal:dt}),xe.addEventListener("pointerleave",gn=>{const tr=Iu(gn.target);!(tr!=null&&tr.id)||!he[tr.id]||tr.classList.remove("is-active")},{capture:!0,signal:dt}),window.addEventListener("pointercancel",()=>{Dd(),y==null||y()},{signal:dt}),window.addEventListener("pointerup",()=>{Dd(),y==null||y()},{signal:dt})})}}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(Xe))y.push({class:"swatch-button",label:'<span style="border: 3px solid '+Xe[b]+'"></span>',command:["applyStyle",{color:b}]});return y}if(a==="background-color"){const y=[];for(const b of Object.keys(Ve))y.push({class:"swatch-button",label:'<span style="background:'+Ve[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 La,b=new Un({mode:"math",type:"root",body:Xo(a,{context:y,args:ee=>ee==="@"?"{\\class{ML__box-placeholder}{\\blacksquare}}":"\\placeholder{}"})}),E=gu(Cd(new kr(b.render(y),{classes:"ML__base"}),y));return vu(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=>_0(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=_d();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"}[nt.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 he=[];for(const ge of de)/[a-z]/.test(ge)?he.push({label:ge,class:"hide-shift",shift:{label:ge.toUpperCase()},variants:E0(ge)?ge:void 0}):ge==="~"?E!=="dvorak"?he.push("[backspace]"):he.push({label:"[backspace]",width:1}):ge==="^"?he.push("[shift]"):ge===" "&&he.push("[separator-5]");ae.push(he)}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 k0(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}"`),k0(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=gt(ee,["rows"]);y=pe(Se({},ae),{layers:Pd({rows:a.rows})})}else if("markup"in a&&typeof a.markup=="string"){const ee=a,{markup:re}=ee,ae=gt(ee,["markup"]);y=pe(Se({},ae),{layers:Pd(a.markup)})}else y=Se({},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()){Pu(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,he=[re===y?"selected":"layer-switch"];de.tooltip&&he.push("MLK__tooltip"),de.labelClass&&he.push(...de.labelClass.split(" ")),ee+=`<div class="${he.join(" ")}"`,de.tooltip&&(ee+=" data-tooltip='"+((b=ct(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='${ct("tooltip.undo")}'>
<svg><use xlink:href='#svg-undo' /></svg>
</div>`,redo:`<div class='action ${y.canRedo===!1?"disabled":""}'
data-command='"redo"'
data-tooltip='${ct("tooltip.redo")}'>
<svg><use xlink:href='#svg-redo' /></svg>
</div>`,cutToClipboard:`
<div class='action'
data-command='"cutToClipboard"'
data-tooltip='${ct("tooltip.cut to clipboard")}'>
<svg><use xlink:href='#svg-cut' /></svg>
</div>
`,copyToClipboard:`
<div class='action'
data-command='"copyToClipboard"'
data-tooltip='${ct("tooltip.copy to clipboard")}'>
<svg><use xlink:href='#svg-copy' /></svg>
</div>
`,pasteFromClipboard:`
<div class='action'
data-command='"pasteFromClipboard"'
data-tooltip='${ct("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=fc.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(){_s("virtual-keyboard"),_s("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",kg,{passive:!1});const ee=y.querySelectorAll(".ML__edit-toolbar");if(ee)for(const ae of ee)ae.addEventListener("click",de=>{var he,ge;let xe=de.target,Re="";for(;xe&&!Re;)Re=(he=xe==null?void 0:xe.getAttribute("data-command"))!=null?he:"",xe=(ge=xe==null?void 0:xe.parentElement)!=null?ge:null;Re&&a.executeCommand(JSON.parse(Re))});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,he;let ge="",xe=(b=a.class)!=null?b:"";if(y.shifted&&Pu(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 Re;typeof a.shift=="string"?Re=Id(a.shift):a.shift.label?Re=a.shift.label:Re=(de=Id(a.shift.latex||a.shift.insert||"")||a.shift.key)!=null?de:"",ge+=`<span class="MLK__shift">${Re}</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+=(he={0:" w0",.5:" w5",1.5:" w15",2:" w20",5:" w50"}[a.width])!=null?he:""),[ge,xe||"MLK__keycap"]}var Fc={"[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 _0(a){var y;if(typeof a=="string"){if(a==="[.]"&&window.MathfieldElement.decimalSeparator===","&&(a="[,]"),!Fc[a])return{latex:a};a={label:a}}let b;return"label"in a&&a.label&&Fc[a.label]&&(b=pe(Se(Se({},Fc[a.label]),a),{label:Fc[a.label].label})),"key"in a&&a.key&&Fc[a.key]&&(b=pe(Se(Se({},Fc[a.key]),a),{key:Fc[a.key].key})),b?(b.command==="insertDecimalSeparator"&&(b.label=(y=window.MathfieldElement.decimalSeparator)!=null?y:"."),a.label==="[action]"&&(b=Se(Se({},b),window.mathVirtualKeyboard.actionKeycap)),a.label==="[shift]"&&(b=Se(Se({},b),window.mathVirtualKeyboard.shiftKeycap)),a.label==="[backspace]"&&(b=Se(Se({},b),window.mathVirtualKeyboard.backspaceKeycap)),a.label==="[tab]"&&(b=Se(Se({},b),window.mathVirtualKeyboard.tabKeycap)),b):a}var Od;function kg(a){var y;if(a.button!==0)return;const b=fc.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=Iu(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}),Pu(re)&&(ee.classList.add("is-active"),b.shiftPressCount++),re.variants&&(Od&&clearTimeout(Od),Od=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=Iu(y.target);if(!(b!=null&&b.id))return;const E=fc.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"),Pu(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"),Pu(ee)&&(E.shiftPressCount--,b.classList.toggle("is-active",E.isShifted));return}if(y.type==="pointerup"){Od&&clearTimeout(Od),Pu(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=fc.singleton)==null||y.executeCommand(b)}function _g(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 Iu(a){if(!a)return;let y=a;for(;y&&!_g(y);)y=y.parentElement;return y!=null?y:void 0}function Pu(a){return!!a.class&&/(^|\s)shift($|\s)/.test(a.class)}var fc=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"&&pt()&&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=>k0(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=Du(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:Se({type:Tf,action:y},b)}));return}if(E)E.postMessage(Se({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=Du(y);return ze(y)?(b=y[0],b==="performWithFeedback"&&(y=y.slice(1),ee=Du(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(kt()&&!("mathVirtualKeyboard"in window))if(window===window.top){const a=fc.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>a})}else Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>ug.singleton,configurable:!0});function Of(a){const y={};for(const b of Object.keys(a))switch(b){case"scriptDepth":const E=a.scriptDepth;if(ze(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=fc.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>re})}ee="manual"}y.mathVirtualKeyboardPolicy=ee;break;case"letterShapeStyle":a.letterShapeStyle==="auto"?nt.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=st(a.macros);break;default:ze(a[b])?y[b]=[...a[b]]:typeof a[b]=="object"&&!(a[b]instanceof Element)&&b!=="computeEngine"?y[b]=Se({},a[b]):y[b]=a[b]}return y}function zc(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:ze(a[ee])?E[ee]=[...a[ee]]:typeof a[ee]=="object"&&!(a[ee]instanceof Element)&&ee!=="computeEngine"?E[ee]=Se({},a[ee]):E[ee]=a[ee];return typeof y=="string"?E[y]:E}function Rf(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:Mt,backgroundColorMap:je,letterShapeStyle:nt.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 hc(a,y){!a||!y||(ze(a)?a.forEach(b=>hc(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),hc(a.body,y),hc(a.above,y),hc(a.below,y),hc(a.subscript,y),hc(a.superscript,y)))}function Eh(a,y,b,E){function ee(ae,de){for(const he of re)if(he.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)}yr(["math","displaymath"],Gs),yr("center",Gs),Nt("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 oa("lines",a.args,[],{leftDelim:".",rightDelim:".",columns:[{align:"l"}]})}),Fr("array","{columns:colspec}",(a,y,b,E)=>new oa(a,kh(y),b,{columns:E[0],mathstyleName:"textstyle"})),Fr(["equation","equation*","subequations"],"",(a,y,b)=>new oa(a,kh(y),b,{columns:[{align:"c"}]})),Fr(["multline","multline*"],"",Gs),Fr(["align","align*","aligned","eqnarray"],"",Gs),Fr("split","",Gs),Fr(["gather","gathered"],"",Gs),Fr(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",Gs),Fr(["smallmatrix","smallmatrix*"],"[columns:colspec]",Gs),Fr(["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 kh(a,y=1){return Tg(a)?Array(y).fill([[new Un({type:"first"}),new Fi]]):a.map(b=>b.length===0?[[new Un({type:"first"})]]:b.map(E=>E.length===0?[new Un({type:"first"})]:(E[0].type!=="first"&&E.unshift(new Un({type:"first"})),E)))}function Gs(a,y=[[[]]],b=[],E=[]){switch(y=kh(y,["split","align","align*","aligned","eqnarray"].includes(a)?2:1),a){case"math":return new oa(a,y,b,{mathstyleName:"textstyle"});case"displaymath":return new oa(a,y,b,{mathstyleName:"textstyle"});case"center":return new oa(a,y,b,{columns:[{align:"c"}]});case"multline":case"multline*":return new oa(a,y,b,{columns:[{align:"m"}],leftDelim:".",rightDelim:"."});case"split":return new oa(a,y,b,{columns:[{align:"r"},{align:"l"}],minColumns:2});case"gather":case"gathered":return new oa(a,y,b,{columns:[{gap:.25},{align:"c"},{gap:0}]});case"pmatrix":case"pmatrix*":return new oa(a,y,b,{mathstyleName:"textstyle",leftDelim:"(",rightDelim:")",columns:Kc(E[0])});case"bmatrix":case"bmatrix*":return new oa(a,y,b,{mathstyleName:"textstyle",leftDelim:"[",rightDelim:"]",columns:Kc(E[0])});case"Bmatrix":case"Bmatrix*":return new oa(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\lbrace",rightDelim:"\\rbrace",columns:Kc(E[0])});case"vmatrix":case"vmatrix*":return new oa(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\vert",rightDelim:"\\vert",columns:Kc(E[0])});case"Vmatrix":case"Vmatrix*":return new oa(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\Vert",rightDelim:"\\Vert",columns:Kc(E[0])});case"matrix":case"matrix*":return new oa(a,y,b,{mathstyleName:"textstyle",leftDelim:".",rightDelim:".",columns:Kc(E==null?void 0:E[0])});case"smallmatrix":case"smallmatrix*":return new oa(a,y,b,{mathstyleName:"scriptstyle",columns:Kc(E==null?void 0:E[0]),colSeparationType:"small",arraystretch:.5});case"cases":case"dcases":return new oa(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 oa(a,y,b,{arraystretch:1.2,leftDelim:".",rightDelim:"\\rbrace",columns:[{align:"l"},{gap:1},{align:"l"}]});case"lines":return new oa(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 oa(a,y,b,{arraycolsep:0,columns:re,minColumns:2})}}return new oa(a,y,b,{mathstyleName:"textstyle"})}function Kc(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 oa);)b=b.parent;if(b&&b.type==="array"&&b.environmentName,!b||!(b.parent instanceof oa)){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=$f()),ee.length===0&&(ee=$f());let ae;return y.endsWith("column")?(ae=Gs("split",[[re,ee]]),a.root=ae,Hc(ae,0,0)?Wc(a,ae,0,0):Hc(ae,0,1)?Wc(a,ae,0,1):a.position=a.offsetOf(E)):(ae=Gs("lines",[[re],[ee]]),a.root=ae,Hc(ae,0,0)?Wc(a,ae,0,0):Hc(ae,1,0)?Wc(a,ae,1,0):a.position=a.offsetOf(E)),[void 0,[0,0]]}if(b.parent instanceof Wa){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=$f()),re.length===0&&(re=$f());let de="pmatrix";const he=ee.leftDelim,ge=ee.rightDelim;he==="("&&(ge===")"||ge==="?")?de="pmatrix":(he==="["||he==="\\lbrack")&&(ge==="]"||ge==="\\rbrack"||ge==="?")?de="bmatrix":he==="\\vert"&&ge==="\\vert"?de="vmatrix":he==="\\Vert"&&ge==="\\Vert"?de="Vmatrix":(he==="{"||he==="\\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),Hc(xe,0,0)?Wc(a,xe,0,0):y.endsWith("column")?Hc(xe,0,1)?Wc(a,xe,0,1):a.position=a.offsetOf(b):Hc(xe,1,0)?Wc(a,xe,1,0):a.position=a.offsetOf(b),[void 0,[0,0]]}}return b&&b.parent instanceof oa?[b.parent,b.parentBranch]:[void 0,[0,0]]}function Hc(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 Wc(a,y,b,E){const ee=Ig(a,y,b,E);typeof ee!="number"&&a.setSelection(ee)}function Nf(a,y,b,E,ee){const re=y.getCell(b,E);re&&a.setPositionHandlingPlaceholder(a.offsetOf(re[ee==="start"?0:re.length-1]))}function Bf(a,y){const[b,[E,ee]]=Dg(a,y);if(b)switch(y){case"after row":b.addRowAfter(E),Nf(a,b,E+1,0,"end");break;case"after column":if(b.maxColumns<=b.colCount){a.announce("plonk");return}b.addColumnAfter(ee),Nf(a,b,E,ee+1,"end");break;case"before row":b.addRowBefore(E),Nf(a,b,E,0,"start");break;case"before column":if(b.maxColumns<=b.colCount){a.announce("plonk");return}b.addColumnBefore(ee),Nf(a,b,E,ee,"start");break}}function T0(a){return a.contentWillChange({inputType:"insertText"})?(Bf(a,"after row"),a.contentDidChange({inputType:"insertText"}),!0):!1}function Pg(a){return a.contentWillChange({inputType:"insertText"})?(Bf(a,"before row"),a.contentDidChange({inputType:"insertText"}),!0):!1}function D0(a){return a.contentWillChange({inputType:"insertText"})?(Bf(a,"after column"),a.contentDidChange({inputType:"insertText"}),!0):!1}function Og(a){return a.contentWillChange({inputType:"insertText"})?(Bf(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 oa);)b=b.parent;if(Array.isArray(b==null?void 0:b.parentBranch)&&(b==null?void 0:b.parent)instanceof oa){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 Rg(a){return a.contentWillChange({inputType:"deleteContent"})?(P0(a,"row"),a.contentDidChange({inputType:"deleteContent"}),!0):!1}function Ng(a){return a.contentWillChange({inputType:"deleteContent"})?(P0(a,"column"),a.contentDidChange({inputType:"deleteContent"}),!0):!1}Ls({addRowAfter:T0,addColumnAfter:D0,addRowBefore:Pg,addColumnBefore:Og,removeRow:Rg,removeColumn:Ng,setEnvironment:I0},{target:"model",canUndo:!0,changeContent:!0,changeSelection:!0});function $f(){return[new Fi]}var O0=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}};O0.maximumDepth=1e3;var Bg=O0;function _h(a,y,b){if(a.at(y).mode!=="text")return y;const E=b==="backward"?-1:1;let ee;if(ve.test(a.at(y).value)){let re=y,ae;do ae=a.at(re).mode==="text"&&ve.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 Ou(a,y,b){var E,ee,re,ae,de,he,ge;const xe=a.position;(E=b==null?void 0:b.extend)!=null&&E||a.collapseSelection(y);let Re=a.at(a.position);if(y==="forward"&&(Re.type==="subsup"?(Re=Re.rightSibling,Re||(Re=a.at(a.position+1))):Re=a.at(a.position+1)),!Re)return a.announce("plonk"),!1;let Ze=a.offsetOf(Re);if(Re instanceof al)Ze=_h(a,Ze,y);else if(Re instanceof ns)if(Re.isSuggestion)for(console.assert(y==="forward");Re&&Re instanceof ns;)Re.isSuggestion=!1,Ze=a.offsetOf(Re),Re=Re.rightSibling;else if(y==="forward"){if(Re=Re.rightSibling,!Re||!(Re instanceof ns))return a.announce("plonk"),!1;for(;Re&&Re instanceof ns&&/[a-zA-Z\*]/.test(Re.value);)Ze=a.offsetOf(Re),Re=Re.rightSibling}else{if(Re=Re.leftSibling,!Re||!(Re instanceof ns))return a.announce("plonk"),!1;for(;Re&&Re instanceof ns&&/[a-zA-Z\*]/.test(Re.value);)Ze=a.offsetOf(Re),Re=Re.leftSibling}else if(y==="forward"&&Re.type==="mopen"){let dt=0;do Re.type==="mopen"?dt+=1:Re.type==="mclose"&&(dt-=1),Re=Re.rightSibling;while(!Re.isLastSibling&&dt!==0);Ze=a.offsetOf(Re.leftSibling)}else if(y==="backward"&&Re.type==="mclose"){let dt=0;do Re.type==="mopen"?dt+=1:Re.type==="mclose"&&(dt-=1),Re=Re.leftSibling;while(!Re.isFirstSibling&&dt!==0);Ze=a.offsetOf(Re)}else if(y==="backward")if(Re.type==="first")for(;Ze>0&&Re.type==="first";)Ze-=1,Re=a.at(Ze);else{const dt=Re.type;Re.type==="subsup"&&(Ze=a.offsetOf(a.at(Ze).leftSibling)),Ze-=1;let St=(ee=a.at(Ze))==null?void 0:ee.type;for(;Ze>=0&&St===dt;)((re=a.at(Ze))==null?void 0:re.type)==="subsup"?Ze=a.offsetOf(a.at(Ze).leftSibling):Ze-=1,St=a.at(Ze).type}else{const{type:dt}=Re;let St=(ae=a.at(Ze))==null?void 0:ae.type;const{lastOffset:Sn}=a;for(;Ze<=Sn&&(St===dt||St==="subsup");){for(;((de=a.at(Ze).rightSibling)==null?void 0:de.type)==="subsup";)Ze=a.offsetOf(a.at(Ze).rightSibling);Ze+=1,St=(he=a.at(Ze))==null?void 0:he.type}Ze-=1}if((ge=b==null?void 0:b.extend)!=null&&ge){if(!a.setSelection(a.anchor,Ze))return a.announce("plonk"),!1}else{if(Ze===a.position)return a.announce("plonk"),!1;a.position=Ze}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,he]=g0(a);de!==void 0&&he!==void 0&&a.deleteAtoms([de,he])}if(y==="upward")return Fg(a,b);if(y==="downward")return zg(a,b);if(b.extend){let de=Ff(a,a.position,y);de<0&&(de=0),de>a.lastOffset&&(de=a.lastOffset);const he=a.setSelection(a.anchor,de);return a.mathfield.stopCoalescingUndo(),he}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,R0(a,re)||(re=Ff(a,re,y))):re=Ff(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 Ff(a,y,b){return y=y+(b==="forward"?1:-1),y<0||y>a.lastOffset||R0(a,y)?y:Ff(a,y,b)}function R0(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 $g(a,y,b){let E=1/0,ee=0;for(;ee<y.length;ee++){const re=Cu(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=Cu(a.mathfield.getHTMLElement(y)).right,he=a.offsetOf($g(a.mathfield,ae,de))-(re?1:0);if(E){const[ge,xe]=a.selection.ranges[0];let Re;he<(ee==="up"?ge:xe)?Re={ranges:[[he,xe]],direction:"backward"}:Re={ranges:[[ge,he]],direction:"forward"},a.setSelection(Re)}else a.setPositionHandlingPlaceholder(he);a.announce(`move ${ee}`)}function Fg(a,y){var b,E;const ee=(b=y==null?void 0:y.extend)!=null?b:!1;ee||a.collapseSelection("backward");const re=()=>{var he,ge;let xe=!0;return a.silenceNotifications||(xe=(ge=(he=a.mathfield.host)==null?void 0:he.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 oa);)de=de.parent;if(Array.isArray(de==null?void 0:de.parentBranch)&&de.parent instanceof oa){const he=de.parent;if(de.parentBranch[0]<1)return re();const ge=de.parentBranch[0]-1,xe=he.array[ge][de.parentBranch[1]];if(!xe.some(Ze=>Ze.type==="prompt"&&!Ze.captureSelection)&&a.mathfield.hasEditablePrompts)return re();zf(a,ae,xe,ee,"up")}else if(de){const he=(E=de.parent.branch("above"))!=null?E:de.parent.createBranch("above");if(!he.some(xe=>xe.type==="prompt"&&xe.placeholderId)&&a.mathfield.hasEditablePrompts)return re();zf(a,ae,he,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 he,ge;let xe=!0;return a.silenceNotifications||(xe=(ge=(he=a.mathfield.host)==null?void 0:he.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 oa);)de=de.parent;if(Array.isArray(de==null?void 0:de.parentBranch)&&de.parent instanceof oa){const he=de.parent;if(de.parentBranch[0]+1>he.array.length-1)return re();const ge=de.parentBranch[0]+1,xe=he.array[ge][de.parentBranch[1]];if(!xe.some(Ze=>Ze.type==="prompt"&&!Ze.captureSelection)&&a.mathfield.hasEditablePrompts)return re();zf(a,ae,xe,ee,"down")}else if(de){const he=(E=de.parent.branch("below"))!=null?E:de.parent.createBranch("below");if(!he.some(xe=>xe.type==="prompt")&&a.mathfield.hasEditablePrompts)return re();zf(a,ae,he,ee,"down")}else return re();return!0}function N0(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 B0(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 Vs({style:b.computedStyle}),b),b=b.rightSibling),b.createBranch("superscript"),a.setSelection(a.getSiblingsRange(a.offsetOf(b.superscript[0]))),!0}function $0(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 Vs({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(he){const ge=[],xe=[];return[...he.querySelectorAll(`input, select, textarea, a[href], button,
[tabindex], audio[controls], video[controls],
[contenteditable]:not([contenteditable="false"]), details>summary`)].filter(y).forEach((Ze,dt)=>{const St=E(Ze);St===0?ge.push(Ze):xe.push({documentOrder:dt,tabIndex:St,node:Ze})}),xe.sort((Ze,dt)=>Ze.tabIndex===dt.tabIndex?Ze.documentOrder-dt.documentOrder:Ze.tabIndex-dt.tabIndex).map(Ze=>Ze.node).concat(ge)}function y(he){return!(!b(he)||ee(he)||E(he)<0)}function b(he){return!(he.disabled||he.type==="hidden"&&he.tagName.toUpperCase()==="INPUT"||de(he))}function E(he){var ge;const xe=Number.parseInt((ge=he.getAttribute("tabindex"))!=null?ge:"NaN",10);return Number.isNaN(xe)?he.contentEditable==="true"||(he.nodeName==="AUDIO"||he.nodeName==="VIDEO")&&he.getAttribute("tabindex")===null?0:he.tabIndex:xe}function ee(he){return he.tagName.toUpperCase()==="INPUT"&&he.type==="radio"&&!ae(he)}function re(he,ge){for(const xe of he)if(xe.checked&&xe.form===ge)return xe;return null}function ae(he){var ge;if(!he.name)return!0;const Re=((ge=he.form)!=null?ge:he.ownerDocument).querySelectorAll('input[type="radio"][name="'+he.name+'"]'),Ze=re(Re,he.form);return!Ze||Ze===he}function de(he){if(!kt()||he===document.activeElement||he.contains(document.activeElement))return!1;if(getComputedStyle(he).visibility==="hidden")return!0;const ge=he.getBoundingClientRect();if(ge.width===0||ge.height===0)return!0;for(;he;){if(getComputedStyle(he).display==="none")return!0;he=he.parentElement}return!1}return kt()?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 he=Lh(a,ae,y);if(!he||y==="forward"&&a.offsetOf(he)<ae||y==="backward"&&a.offsetOf(he)>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 Re=xe.indexOf(document.activeElement)+re;return Re<0&&(Re=xe.length-1),Re>=xe.length&&(Re=0),xe[Re].focus(),a.mathfield.stopCoalescingUndo(),!0}return ll(a,he),!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?$0(a):B0(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=>N0(a),moveToNextChar:a=>Cl(a,"forward"),moveToPreviousChar:a=>Cl(a,"backward"),moveUp:a=>Cl(a,"upward"),moveDown:a=>Cl(a,"downward"),moveToNextWord:a=>Ou(a,"forward"),moveToPreviousWord:a=>Ou(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 Ze=re;for(;Ze&&Ze.mode==="text";)Ze=Ze.leftSibling;let dt=re;for(;((y=dt.rightSibling)==null?void 0:y.mode)==="text";)dt=dt.rightSibling;if(Ze&&dt)return bs(a,[Ze,dt])}if(re.rightSibling.mode==="text"){let Ze=re;for(;Ze&&Ze.mode==="text";)Ze=Ze.rightSibling;return Ze?(ll(a,(b=Ze.leftSibling)!=null?b:Ze),a.mathfield.switchMode("math"),!0):ll(a,a.lastOffset)}}const de=a.at(a.anchor).parentPrompt,he=de?a.offsetOf(de)+1:Math.max(a.position+1,0),ge=Lh(a,he,"forward");if(ge)return ll(a,ge);const xe=F0(a,re,Ze=>Ze.type==="leftright"||Ze.type==="text","forward");if(xe){if(xe.mode==="text"){let Ze=xe;for(;Ze&&Ze.mode==="text";)Ze=Ze.rightSibling;return bs(a,[(E=xe.leftSibling)!=null?E:xe,(ee=Ze.leftSibling)!=null?ee:Ze])}return bs(a,xe)}const Re=re.parent;if(Re){if(Re.type==="leftright"||Re.type==="surd")return bs(a,Re);if(re.parentBranch==="superscript"&&Re.subscript)return bs(a,Re.subscript);if(re.parentBranch==="above"&&Re.below)return bs(a,Re.below);if(re.parentBranch==="superscript"||re.parentBranch==="subscript")return ll(a,Re);if(re.parentBranch==="above"||re.parentBranch==="below")return bs(a,Re)}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 he=b;for(;((y=he.rightSibling)==null?void 0:y.mode)==="text";)he=he.rightSibling;if(de&&he)return bs(a,[de,he])}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=F0(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 he=b.parent;if(he){if(he.type==="leftright"||he.type==="surd")return bs(a,he);if(b.parentBranch==="subscript"&&he.superscript)return bs(a,he.superscript);if(b.parentBranch==="below"&&he.above)return bs(a,he.above);if(b.parentBranch==="superscript"||b.parentBranch==="subscript")return ll(a,he);if(b.parentBranch==="above"||b.parentBranch==="below")return bs(a,he)}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:B0,moveToSubscript:$0},{target:"model",changeSelection:!0}),Ls({moveToNextPlaceholder:a=>Kf(a,"forward"),moveToPreviousPlaceholder:a=>Kf(a,"backward")},{target:"model",changeSelection:!0,audioFeedback:"return"});function F0(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 Uc(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(Un.serialize([ae],{defaultMode:"math"})),ae.mode="math"),E-=1,y-=1}Ah(a),a.contentDidChange({data:ya(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 Ug(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 Zg(a,y,b){const{model:E}=a;if(E.mode==="latex"||!E.at(E.position).isLastSibling||!b||!Sf(b))return!1;const ee=Lu(b);if(!E.selectionIsCollapsed)return!!(a.model.mode==="text"&&/[/_^]/.test(ee));const re=Ug(E)+ee;if(a.model.mode==="text"){if(y==="Esc"||/[/\\]/.test(ee))return!0;if(/[\^_]/.test(ee))return/(^|\s)[a-zA-Z][^_]$/.test(re)&&Uc(E,1),!0;const ae={")":"(","}":"{","]":"["}[ee],{parent:de}=E.at(E.position);if(ae&&de instanceof Wa&&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 Uc(E,1),!1;if(/\D\.[^\d\s]$/.test(re)){Uc(E,1);const he=E.at(E.position);return he.value="\u22C5",he.style.variant="normal",he.command="\\cdot",he.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 Uc(E,1),!0;if(/\([a-z][,;]$/.test(re))return Uc(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 Vg(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||(_s("keystroke-caption"),_s("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){Bm(y);const dt=_d();a.keyboardLayout!==dt.id&&(a.keyboardLayout=dt.id,a._keybindings=void 0)}if(clearTimeout(a.inlineShortcutBufferFlushTimer),a.inlineShortcutBufferFlushTimer=0,Vg(a,ae),y.isTrusted&&y.defaultPrevented)return a.flushInlineShortcutBuffer(),!1;let de,he="",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 dt=Lu(y),St=[...(E=(b=xe[xe.length-1])==null?void 0:b.keystrokes)!=null?E:[],dt];xe.push({state:re.getState(),keystrokes:St,leftSiblings:Xg(a)});let Sn=0,wr="";for(;!de&&Sn<St.length;)ge=xe.length-(St.length-Sn),wr=St.slice(Sn).join(""),de=dd(xe[ge].leftSiblings,wr,a.options.inlineShortcuts),!de&&/^[a-zA-Z][a-zA-Z0-9]+?([_\^][a-zA-Z0-9\*\+\-]+?)?$/.test(wr)&&(de=a.options.onInlineShortcut(a,wr)),Sn+=1;a.flushInlineShortcutBuffer({defer:!0})}a.options.smartMode&&(de?a.switchMode("math"):Zg(a,ae,y)&&(a.switchMode({math:"text",text:"math"}[re.mode]),he=""))}if(!de){if(he||(he=Um(a.keybindings,re.mode,y)),!he&&(ae==="[Enter]"||ae==="[Return]")){let dt=!1;return re.contentWillChange({inputType:"insertLineBreak"})&&(a.host&&(dt=!a.host.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),dt||y.preventDefault&&(y.preventDefault(),y.stopPropagation()),re.contentDidChange({inputType:"insertLineBreak"})),dt}if((!he||ae==="[Space]")&&re.mode==="math"){if(ae==="[Space]"){if(a.adoptStyle="none",a.flushInlineShortcutBuffer(),a.options.mathModeSpace)return ra.insert(re,a.options.mathModeSpace,{format:"latex",mode:"math"}),a.snapshot("insert-space"),he="",a.dirty=!0,a.scrollIntoView(),y.preventDefault&&(y.preventDefault(),y.stopPropagation()),!1;const dt=re.at(re.position+1),St=re.at(re.position-1);if((dt==null?void 0:dt.mode)==="text"||(St==null?void 0:St.mode)==="text")return ra.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===","&&Lu(y)===","&&(he="insertDecimalSeparator")}}if(!de&&!he){if(re.mathfield.smartFence){if(Dh(re,Lu(y),a.effectiveStyle))return a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}else{const{parent:dt}=re.at(re.position);if(dt instanceof Wa&&dt.rightDelim==="?"&&re.at(re.position).isLastSibling&&/^[)}\]|]$/.test(ae))return a.snapshot(),dt.isDirty=!0,dt.rightDelim=ae,re.position+=1,re.selectionDidChange(),re.contentDidChange({data:Lu(y),inputType:"insertText"}),a.snapshot("insert-fence"),a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1;if(!re.selectionIsCollapsed){const St=Lu(y);if(St==="("||St==="{"||St==="["){const Sn={"(":"(","{":"\\lbrace","[":"\\lbrack"}[St],wr={"(":")","{":"\\rbrace","[":"\\rbrack"}[St],[gn,tr]=jo(re.selection);return a.snapshot(),re.position=tr,ra.insert(re,wr,{format:"latex"}),re.position=gn,ra.insert(re,Sn,{format:"latex"}),re.setSelection(gn+1,tr+1),re.contentDidChange({data:St,inputType:"insertText"}),a.snapshot("insert-fence"),a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}}}return!0}const Re=re.at(Math.max(re.position,re.anchor)),{parent:Ze}=Re;if(he==="moveAfterParent"&&(Ze==null?void 0:Ze.type)==="leftright"&&Re.isLastSibling&&a.options.smartFence&&Dh(re,".",a.defaultStyle)&&(he="",Mo(a)),a.keyboardDelegate.cancelComposition(),he)a.executeCommand(he);else if(de){const dt=a.effectiveStyle;re.setState(xe[ge].state);const St=xe[xe.length-1].keystrokes;for(const Sn of St)ra.insert(re,Sn,{silenceNotifications:!0,style:dt});a.snapshot("insert-shortcut"),re.setState(xe[ge].state),re.deferNotifications({content:!0,selection:!0,data:de,type:"insertText"},()=>(ra.insert(re,de,{format:"latex",style:dt}),Ah(a.model),de.endsWith(" ")&&(a.switchMode("text"),ra.insert(re," ",{style:dt,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(he=>he.toUpperCase())),b.simulateKeystroke){let he=!0;for(const ge of ee)K0(a,new KeyboardEvent("keypress",{key:ge}))&&(he=!1);if(he)return}const ae=E.at(E.position),de=Se(Se({},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 he of ee)ra.insert(E,he);a.snapshot("insert-latex"),Ad(a)});else if(E.mode==="text"){for(const he of ee)ra.insert(E,he,{style:de});a.snapshot("insert-text")}else if(E.mode==="math")for(const he of ee)qg(a,he,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),ra.insert(ee,y,{style:b}),a.snapshot(),N0(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=Se({},b),ae.style.variant&&(b.variant=ae.style.variant),ae.style.variantStyle&&(b.variantStyle=ae.style.variantStyle))}ra.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[he,ge]=jo(a.selection),xe=a.extractAtoms([he,ge]),Re=ee.addChildrenAfter([new Wa("left...right",xe,{leftDelim:re,rightDelim:de})],a.at(he));return a.setSelection(a.offsetOf(Re.firstChild),a.offsetOf(Re.lastChild)),a.mathfield.snapshot("insert-fence"),a.contentDidChange({data:re,inputType:"insertText"}),!0}if(re==="|"){const he=ee instanceof Wa?ee.leftDelim+ee.rightDelim:"";if(he==="\\lbrace\\rbrace"||he==="\\{\\}"||he==="\\lbrace?")return a.mathfield.snapshot(),ra.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 Wa&&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 Wa)){let Re=E;for(;Re&&!(Re.type==="mclose"&&Re.value===de);)Re=Re.rightSibling;if(Re){a.mathfield.snapshot();const Ze=a.extractAtoms([a.offsetOf(E),a.offsetOf(Re)]);return Ze.pop(),ee.addChildrenAfter([new Wa("left...right",Ze,{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 he=a.offsetOf(E.lastSibling);let ge;for(ge=a.position;ge<=he;ge++){const Re=a.at(ge);if(Re instanceof Wa&&(Re.leftDelim==="?"||Re.leftDelim===".")&&H0(re,Re.rightDelim))break}const xe=a.at(ge);if(ge<=he&&xe instanceof Wa){xe.leftDelim=re,a.mathfield.snapshot();let Re=a.extractAtoms([a.position,ge-1]);return Re=Re.filter(Ze=>Ze.type!=="first"),xe.addChildren(Re,xe.parentBranch),a.position+=1,a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}if(ee instanceof Wa&&(ee.leftDelim==="?"||ee.leftDelim===".")&&H0(re,ee.rightDelim)){ee.isDirty=!0,ee.leftDelim=re,a.mathfield.snapshot();const Re=a.extractAtoms([a.offsetOf(E.firstSibling),a.position]);for(const Ze of Re)ee.parent.addChildBefore(Ze,ee);return a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}if(!(ee instanceof Wa&&ee.leftDelim==="|")){if(a.mathfield.snapshot(),ra.insert(a,`\\left${re}\\right?`,{format:"latex",style:b}),E.lastSibling.type!=="first"){const Re=a.offsetOf(E.lastSibling),Ze=a.extractAtoms([a.position,Re]);a.at(a.position).body=Ze,a.position-=1}return a.mathfield.snapshot("insert-fence"),!0}}if(ae){let he=E;for(;he;){if(he.type==="mopen"&&he.value===ae){a.mathfield.snapshot();const dt=he.leftSibling,St=a.extractAtoms([a.offsetOf(he.leftSibling),a.offsetOf(E)]);St.shift();const Sn=new Wa("left...right",St,{leftDelim:ae,rightDelim:re});return ee.addChildrenAfter([Sn],dt),a.position=a.offsetOf(Sn),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}he=he.leftSibling}if(ee instanceof Wa&&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 dt=a.at(xe);if(dt instanceof Wa&&(dt.rightDelim==="?"||dt.rightDelim===".")&&Ih(dt.leftDelim,re))break}const Re=a.at(xe);if(xe>=ge&&Re instanceof Wa)return a.mathfield.snapshot(),Re.rightDelim=re,Re.addChildren(a.extractAtoms([xe,a.position]),Re.parentBranch),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0;if(ee instanceof Wa&&(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 Ze=ee.parent;return Ze instanceof Wa&&(Ze.rightDelim==="?"||Ze.rightDelim===".")&&a.at(a.position).isLastSibling?(a.position=a.offsetOf(Ze),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=Se(Se({},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,he,ge,xe,Re;const Ze={};if(typeof y.color=="string"){const St=(E=a.colorMap((b=y.color)!=null?b:y.verbatimColor))!=null?E:"none";St!==y.color&&(Ze.verbatimColor=(ee=y.verbatimColor)!=null?ee:y.color),Ze.color=St}if(typeof y.backgroundColor=="string"){const St=(ae=a.backgroundColorMap((re=y.backgroundColor)!=null?re:y.verbatimBackgroundColor))!=null?ae:"none";St!==y.backgroundColor&&(Ze.verbatimBackgroundColor=(de=y.verbatimBackgroundColor)!=null?de:y.backgroundColor),Ze.backgroundColor=St}typeof y.fontFamily=="string"&&(Ze.fontFamily=y.fontFamily),typeof y.series=="string"&&(Ze.fontSeries=y.series),typeof y.fontSeries=="string"&&(Ze.fontSeries=y.fontSeries.toLowerCase()),Ze.fontSeries&&(Ze.fontSeries=(he={bold:"b",medium:"m",normal:"m"}[Ze.fontSeries])!=null?he:Ze.fontSeries),typeof y.shape=="string"&&(Ze.fontShape=y.shape),typeof y.fontShape=="string"&&(Ze.fontShape=y.fontShape.toLowerCase()),Ze.fontShape&&(Ze.fontShape=(ge={italic:"it",up:"n",upright:"n",normal:"n"}[Ze.fontShape])!=null?ge:Ze.fontShape),y.variant&&(Ze.variant=y.variant.toLowerCase()),y.variantStyle&&(Ze.variantStyle=y.variantStyle.toLowerCase());const dt=(xe=y.size)!=null?xe:y.fontSize;return typeof dt=="number"?Ze.fontSize=Math.max(1,Math.min(10,dt)):typeof dt=="string"&&(Ze.fontSize=(Re={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[dt.toLowerCase()])!=null?Re:{tiny:1,scriptsize:2,footnotesize:3,small:4,normal:5,normalsize:5,large:6,Large:7,LARGE:8,huge:9,Huge:10}[dt]),Ze}function Oh(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"||!ve.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 he=(ee=a.at(y))==null?void 0:ee.style;for(;he&&he.variant===ae.style.variant&&he.variantStyle===ae.style.variantStyle;)he=(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=Oh(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=>Ou(a,"forward",{extend:!0}),extendToPreviousWord:a=>Ou(a,"backward",{extend:!0}),extendSelectionUpward:a=>Cl(a,"upward",{extend:!0}),extendSelectionDownward:a=>Cl(a,"downward",{extend:!0}),extendToNextBoundary:a=>Ou(a,"forward",{extend:!0}),extendToPreviousBoundary:a=>Ou(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 Zc=null,Rd=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),Rh(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 Rh(a){return a!==null&&globalThis.PointerEvent!==void 0&&a instanceof PointerEvent}function U0(a,y){var b;if(y.buttons>1)return;a.atomBoundsCache=new Map;const E=a;let ee,re=!1,ae=!1,de="none",he=!1,ge=!1;const xe=y.clientX,Re=y.clientY,Ze=Date.now(),dt=E.field,St=setInterval(()=>{he?dt.scroll({top:0,left:dt.scrollLeft-16}):ge&&dt.scroll({top:0,left:dt.scrollLeft+16})},32);function Sn(){Wf.stop(),re=!1,clearInterval(St),a.element.classList.remove("tracking"),y&&y.preventDefault()}function wr(tr){if(!E.hasFocus()){Sn();return}const _r=tr.clientX,lr=tr.clientY,si=Rh(tr)&&tr.pointerType==="touch"?20:5;if(Date.now()<Ze+500&&Math.abs(xe-_r)<si&&Math.abs(Re-lr)<si){tr.preventDefault(),tr.stopPropagation();return}const Ii=dt.getBoundingClientRect();ge=_r>Ii.right,he=_r<Ii.left;let vi=ee;Rh(tr)&&(tr.isPrimary||(vi=Nd(E,tr.clientX,tr.clientY,{bias:0})));const Pa=Nd(E,_r,lr,{bias:_r<=xe?_r===xe?0:-1:1});vi>=0&&Pa>=0&&(E.model.extendSelectionTo(vi,Pa),Mo(a)),ae&&Oh(E.model)}Zc&&Math.abs(Zc.x-xe)<5&&Math.abs(Zc.y-Re)<5&&Date.now()<Zc.time+500?(Rd+=1,Zc.time=Ze):(Zc={x:xe,y:Re,time:Ze},Rd=1);const gn=dt.getBoundingClientRect();if(xe>=gn.left&&xe<=gn.right&&Re>=gn.top&&Re<=gn.bottom){if(a.flushInlineShortcutBuffer(),a.adoptStyle="left",ee=Nd(a,xe,Re,{bias:0}),ee>=0){if(a.element.classList.add("tracking"),y.shiftKey){const tr=a.model.selectionIsCollapsed;a.model.extendSelectionTo(a.model.anchor,ee),v0(a.model)||tr?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||Rd>2?(Sn(),(y.detail===3||Rd===3)&&(a.model.selection={ranges:[[0,a.model.lastOffset]]},de="all")):re||(re=!0,Wf.start(dt,y,wr,Sn),(y.detail===2||Rd===2)&&(ae=!0,Oh(a.model),de="all"))}a.hasFocus()||(de="none",a.focus({preventScroll:!0}))}else Zc=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 Z0(a,y,b,E,ee){if(!b.id)return[1/0,null];if(y.has(b.id))return y.get(b.id);const re=lc(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 he=Z0(a,y,de,E,ee);he[0]<=ae[0]&&(ae=he)}return ae[1]||(ae=[Qg(E,ee,re),b]),y.set(b.id,ae),ae}function ev(a,y,b){const[,E]=Z0(a,new Map,a.model.root,y,b);return E}function Nd(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 he=ae;for(;he;)de.unshift(he),he=he.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=lc(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 ra{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=dc(re),{model:de}=a;de.selectionIsCollapsed||de.deleteAtoms(jo(de.selection));const he=de.at(de.position);if(he.parent instanceof oa){console.assert(he.parentBranch!==void 0);const ge=[];let xe=[];ae[0].type==="first"&&ae.shift(),ae[ae.length-1].type==="first"&&ae.pop();for(const St of ae)St.type==="first"&&xe.length>0?(ge.push(xe),xe=[St]):xe.push(St);xe.length>0&&ge.push(xe);let Re=Number(he.parentBranch[0]),Ze=Number(he.parentBranch[1]);const dt=he.parent.maxColumns;for(;he.parent.colCount-Ze<ge.length&&he.parent.colCount<dt;)he.parent.addColumn();he.parent.addChildrenAfter(ge[0],he);for(let St=1;St<ge.length;St++)Ze++,Ze>=dt&&(Ze=0,he.parent.addRowAfter(Re),Re++),he.parent.setCell(Re,Ze,ge[St])}else he.parent.addChildrenAfter(ae.filter(ge=>ge.type!=="first"),he);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 he={"?":"\\placeholder{}","@":"\\placeholder{}"};he[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;he[0]?he["@"]=he[0]:typeof y=="string"&&/(^|[^\\])#@/.test(y)&&(ge=rv(a),ge>=0&&(he["@"]=a.getValue(ge,a.position,"latex"))),he[0]||(he[0]=he["?"]);let xe=!1;const Re=_r=>(xe=!0,he[_r]);let[Ze,dt]=V0(a,y,Re,b);if(!dt)return!1;const St=dt.length===1&&dt[0].type==="genfrac";St&&ge>=0&&typeof a.mathfield.options.isImplicitFunction=="function"&&a.mathfield.options.isImplicitFunction(a.at(a.position).command)?(he["@"]=he["?"],xe=!1,[Ze,dt]=V0(a,y,Re,b)):ge>=0&&a.deleteAtoms([ge,a.position]);const{parent:Sn}=a.at(a.position),wr=Sn.hasEmptyBranch("body");if(St&&Ze!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&Sn instanceof Wa&&Sn.leftDelim==="("&&wr){const _r=Sn.parent,lr=Sn.parentBranch;_r.removeChild(Sn),_r.setChildren(dt,lr)}const gn=a.at(a.position);gn.parent.addChildrenAfter(dt,gn),Ze==="latex"&&typeof y=="string"&&(Sn==null?void 0:Sn.type)==="root"&&wr&&!xe&&(Sn.verbatimLatex=y),a.silenceNotifications=de;const tr=dt[dt.length-1];if(b.selectionMode==="placeholder"){const _r=dt.flatMap(lr=>[lr,...lr.children]).find(lr=>lr.type==="placeholder");if(_r){const lr=a.offsetOf(_r);a.setSelection(lr-1,lr),a.announce("move")}else tr&&(a.position=a.offsetOf(tr))}else b.selectionMode==="before"||(b.selectionMode==="after"?tr&&(a.position=a.offsetOf(tr)):b.selectionMode==="item"&&a.setSelection(a.anchor,a.offsetOf(tr)));return a.contentDidChange({data:re,inputType:"insertText"}),a.silenceNotifications=ae,!0}};function V0(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]=Oc(y,{format:"ascii-math",inlineShortcuts:a.mathfield.options.inlineShortcuts}),ae=Xo(y,{context:a.mathfield.context}),re!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&Uf(ae)):(E.format==="auto"||(ee=E.format)!=null&&ee.startsWith("latex"))&&(E.format==="auto"&&([re,y]=Oc(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&&Uf(ae));return hc(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 Wa&&y.leftDelim==="("&&y.rightDelim===")"?y.removeBranch("body"):null}function Uf(a){if(a){for(let y=0;a[y];y++){const b=a[y];if(b instanceof Wa&&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)){Uf(y.branch(b));const E=nv(y.branch(b));E&&y.setChildren(E,b)}if(y instanceof oa)for(const b of y.cells)Uf(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 ra{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(hc(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 fo=4,Cs=20,$o=2*(Cs+fo),Zf=(a,y)=>`
<line x1="${a+Cs}" y1="${y+Cs}"
x2="${a>y?a+Cs:7*Cs+10*fo}"
y2="${a<y?y+Cs:7*Cs+10*fo}"/>
<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*fo}"
y2="${a<y?y+Cs:7*Cs+10*fo}"/>
<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>`,Vf=(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*fo+5} ${8*Cs+10*fo+5}">
<rect
class="MLEP__array-insert-background rows"
x="0"
y="${$o+fo}"
height="${3*$o}"
width="${$o}"
rx="${$o/2}"/>
<rect
class="MLEP__array-insert-background columns"
x="${$o+fo}"
y="0"
height="${$o}"
width="${3*$o}"
rx="${$o/2}"/>
<g data-command='"moveDown"'>
${Vf(2*(fo+$o),2*fo+3*$o,0)}
</g>
<g data-command='"moveUp"'>
${Vf(2*(fo+$o),2*fo+$o,180)}
</g>
<g data-command='"moveToNextWord"'>
${Vf(2*fo+3*$o,2*(fo+$o),-90)}
</g>
<g data-command='"moveToPreviousWord"'>
${Vf(2*fo+$o,2*(fo+$o),90)}
</g>
<g>
<g data-command='"addColumnBefore"'>
${Zf(2*fo+$o,fo)}
</g>
<g data-command='"removeColumn"'>
${G0(2*fo+2*$o,fo)}
</g>
<g data-command='"addColumnAfter"'>
${Zf(2*fo+3*$o,fo)}
</g>
<g data-command='"addRowBefore"'>
${Zf(fo,2*fo+$o)}
</g>
<g data-command='"removeRow"'>
${G0(fo,2*fo+2*$o)}
</g>
<g data-command='"addRowAfter"'>
${Zf(fo,2*fo+3*$o)}
</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>`,cv=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>`,uv=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>`,Nh={matrix:sv,pmatrix:lv,bmatrix:cv,Bmatrix:X0,vmatrix:uv,Vmatrix:dv},Bh={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(St=>{(!ee||St.length>ee)&&(ee=St.length)});let re=document.getElementById("mathlive-environment-popover");re||(re=Ef("mathlive-environment-popover"),_s("environment-popover"),_s("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 he=[],ge="";const xe=a.model.parentEnvironment.environmentName;if(us(xe)){const St=gv(xe);ge=Nh[St]("active");const Sn=Nh,{[St]:wr}=Sn,gn=gt(Sn,[Te(St)]);he=Object.values(gn).map(tr=>tr("inactive"))}else if(ds(xe)){const St=vv(xe);ge=Bh[St]("active");const Sn=Bh,{[St]:wr}=Sn,gn=gt(Sn,[Te(St)]);he=Object.values(gn).map(tr=>tr("inactive"))}else Io(xe)&&(ge=Nh.matrix("active"),he=Object.values(Bh).map(St=>St("inactive")));const Re=document.createElement("div");Re.className="MLEP__environment-delimiter-controls",Re.style.display="flex",Re.style.flexDirection="column",Re.innerHTML=`
<div class='MLEP__array-delimiter-options'>
${ge}
${he.join("")}
</div>`,ge&&ae.appendChild(Re),ae.querySelectorAll("[data-command]").forEach(St=>{const Sn=St.dataset.command;let wr=Sn;try{wr=JSON.parse(Sn)}catch(gn){}St.addEventListener("mousedown",gn=>gn.preventDefault()),wr&&St.addEventListener("click",()=>a.executeCommand(wr))});const dt=(b=a.field)==null?void 0:b.getBoundingClientRect();dt&&(re.style.top=`${window.scrollY+(dt.top-re.clientHeight-15)}px`,re.style.left=`${dt.left+20}px`,re.classList.add("is-visible"))}function $h(){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):$h()}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 Fh(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 he=Math.min(de,(E=y.height)!=null?E:ae.height),ge=Fh(y.location.y,he,y.verticalPos,re);ge+he>window.innerHeight-8&&(y.alternateLocation?(ge=Fh(y.alternateLocation.y,he,y.verticalPos,re),ge+he>window.innerHeight-8&&(ge=void 0)):ge=void 0),Number.isFinite(ge)||(ge=Math.max(8,window.innerHeight-8-he),8+he>window.innerHeight-8&&(a.style.bottom="8px")),he=Math.min(ge+he,window.innerHeight-8)-ge;const xe=Number.isFinite(y.maxWidth)?Math.min(y.maxWidth,window.innerWidth):window.innerWidth;let Re=Math.min(xe,(ee=y.width)!=null?ee:ae.width),Ze=Fh(y.location.x,Re,y.horizontalPos,re);Ze+Re>window.innerWidth-8&&(y.alternateLocation?(Ze=yv(y.alternateLocation.x,Re,y.verticalPos,re),Ze+Re>window.innerWidth-8&&(Ze=void 0)):Ze=void 0),Number.isFinite(Ze)||(Ze=Math.max(8,window.innerWidth-8-Re),8+Re>window.innerWidth-8&&(a.style.right="8px")),Re=Math.min(Ze+Re,window.innerWidth-8)-Ze,re==="rtl"?a.style.right=`${Math.ceil(window.innerWidth-Ze-Re).toString()}px`:a.style.left=`${Math.ceil(Ze).toString()}px`,a.style.top=`${Math.ceil(ge).toString()}px`,he!==ae.height&&(a.style.height=`${Math.ceil(he).toString()}px`),Re!==ae.width&&(a.style.width=`${Math.ceil(Re).toString()}px`)}function xv(a,y){return Math.hypot(y.x-a.x,y.y-a.y)}function Ru(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,Ru(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=Nu(ee.checked,a))!=null?y:!1)),(El(ee)||Ru(ee))&&(this.enabled=(b=Nu(ee.enabled,a))!=null?b:!0,this.visible=(E=Nu(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)||Ru(ee))&&(this.label=Nu(ee.label,a),this.tooltip=Nu(ee.tooltip,a),this.ariaLabel=Nu(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)||Ru(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 Nu(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 Uu{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 he=!0;for(const ge of this._menuItems)ge.type==="divider"?(ge.visible=!he,he=!0):ge.visible&&(he=!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 Uu._collator||(Uu._collator=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),Uu._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=>Uu.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),Yt()&&(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),Yt()&&((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=Bc(y)),y.stopImmediatePropagation()}handleKeydownEvent(y){var b,E,ee;if(y.key==="Tab"||y.key==="Escape"){this.hide();return}this.isDynamic&&(this.modifiers=Bc(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(Bc(y));break;case"ArrowRight":if((de==null?void 0:de.type)==="submenu")de.select(Bc(y)),this.activeSubmenu.activeMenuItem=this.activeSubmenu.firstMenuItem;else if(!de)ae.activeMenuItem=ae.firstMenuItem;else{const he=(b=ae.getMenuItemColumn(de))!=null?b:-1;if(he>=0&&he<((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 he=ae.findMenuItem(this.typingBuffer);he&&(ae.activeMenuItem=he),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}break;default:if(Sf(y)){isFinite(this.typingBufferResetTimer)&&clearTimeout(this.typingBufferResetTimer),this.typingBuffer+=y.key;const he=ae.findMenuItem(this.typingBuffer);he&&(ae.activeMenuItem=he),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(pe(Se({},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)||Ru(a))&&(typeof a.enabled=="function"||typeof a.visible=="function")||El(a)&&typeof a.checked=="function"?!0:Ru(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 he of["pointermove","pointerup","pointercancel"])window.addEventListener(he,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 gc(this,null,function*(){if(a.type==="contextmenu"){const E=a;if(b.show({target:y,location:wf(E),modifiers:Bc(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:Bc(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};Nt(Object.keys(ap),"{body:auto}",{createAtom:a=>new z(pe(Se({},a),{body:ft(a.args[0]),accentChar:ap[a.command.slice(1)]}))}),Nt(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:a=>{const y=ln(ft(a.args[0]));return new z(pe(Se({},a),{body:ft(a.args[0]),svgAccent:a.command.slice(1)+(y.length>5?"4":["1","1","2","2","3","3"][y.length])}))}}),Nt(["overarc","overparen","wideparen"],"{body:auto}",{createAtom:a=>new z(pe(Se({},a),{body:ft(a.args[0]),svgAccent:"overarc"}))}),Nt(["underarc","underparen"],"{body:auto}",{createAtom:a=>new js(pe(Se({},a),{body:ft(a.args[0]),svgBelow:"underarc"}))}),Nt("utilde","{body:auto}",{createAtom:a=>{const y=ft(a.args[0]),b=ln(y),E="widetilde"+(b.length>5?"4":["1","1","2","2","3","3"][b.length]);return new js(pe(Se({},a),{body:y,svgBelow:E,boxType:rc(y)}))}}),Nt("^","{:string}",{createAtom:a=>{var y;return new Un(pe(Se({},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:"^"}))}}),Nt("`","{:string}",{createAtom:a=>{var y;return new Un(pe(Se({},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:"`"}))}}),Nt("'","{:string}",{createAtom:a=>{var y;return new Un(pe(Se({},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:"'"}))}}),Nt('"',"{:string}",{createAtom:a=>{var y,b;return new Un(pe(Se({},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]:'"'}))}}),Nt(".","{:string}",{createAtom:a=>{var y,b;return new Un(pe(Se({},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]:"."}))}}),Nt("=","{:string}",{createAtom:a=>{var y,b;return new Un(pe(Se({},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]:"="}))}}),Nt("~","{:string}",{createAtom:a=>{var y;return new Un(pe(Se({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"}))}}),Nt("c","{:string}",{createAtom:a=>{var y;return new Un(pe(Se({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={c:"\xE7",C:"\xC7"}[a.args[0]])!=null?y:""}))}}),Nt("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 he=de.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(he)ee.strokeWidth=he[1],ee.strokeStyle=he[2],ee.strokeColor=he[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,ft(E[2]),re,ee)}}),Nt("cancel","{body:auto}",{createAtom:a=>{var y;return new bd(a.command,ft(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:{}})}}),Nt("bcancel","{body:auto}",{createAtom:a=>{var y;return new bd(a.command,ft(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:{}})}}),Nt("xcancel","{body:auto}",{createAtom:a=>{var y;return new bd(a.command,ft(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:{}})}}),Nt(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overlinesegment","overgroup"],"{:auto}",{createAtom:a=>{var y;return new js(pe(Se({},a),{body:ft((y=a.args)==null?void 0:y[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgAbove:a.command.slice(1)}))}}),Nt("overbrace","{:auto}",{createAtom:a=>new js(pe(Se({},a),{body:ft(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgAbove:a.command.slice(1)}))}),Nt(["underrightarrow","underleftarrow","underleftrightarrow","underlinesegment","undergroup"],"{:auto}",{createAtom:a=>new js(pe(Se({},a),{body:ft(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgBelow:a.command.slice(1)}))}),Nt(["underbrace"],"{:auto}",{createAtom:a=>new js(pe(Se({},a),{body:ft(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgBelow:a.command.slice(1)}))}),Nt(["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(pe(Se({},a),{svgBody:a.command.slice(1),above:((b=ft((y=a.args)==null?void 0:y[1]))==null?void 0:b.length)===0?void 0:ft((E=a.args)==null?void 0:E[1]),below:(re=ft((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)}`}),Nt(["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 Nc(a.command.slice(1),pe(Se({},a),{limits:"adjacent",isFunction:!0,variant:"main",variantStyle:"up"}))}),Nt(["liminf","limsup"],"",{ifMode:"math",createAtom:a=>new Nc({"\\liminf":"lim inf","\\limsup":"lim sup"}[a.command],pe(Se({},a),{limits:"over-under",variant:"main"}))}),Nt(["lim","mod"],"",{ifMode:"math",createAtom:a=>new Nc(a.command.slice(1),pe(Se({},a),{limits:"over-under",variant:"main"}))}),Nt(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:a=>new Nc(a.command.slice(1),pe(Se({},a),{limits:"over-under",isFunction:!0,variant:"main"}))}),Nt(["ang"],"{:math}",{ifMode:"math",createAtom:a=>new Un(pe(Se({},a),{body:ft(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 kr("\xB0",{style:pe(Se({},a.style),{variant:"normal",variantStyle:"up"})});return new kr([b,ee],{type:"inner",isSelected:a.isSelected,caret:E})}}),Nt("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:a=>new o0(pe(Se({},a),{body:ft(a.args[1]),index:a.args[0]?ft(a.args[0]):void 0}))}),Nt(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{:expression}{:expression}",{ifMode:"math",createAtom:a=>{const y=Se({},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 ku(E[0]?ft(E[0]):[new Fi],E[1]?ft(E[1]):[new Fi],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)}}),Nt(["brace","brack"],"",{infix:!0,createAtom:a=>new ku(ft(a.args[0]),ft(a.args[1]),pe(Se({},a),{hasBarLine:!1,leftDelim:a.command==="\\brace"?"\\lbrace":"\\lbrack",rightDelim:a.command==="\\brace"?"\\rbrace":"\\rbrack"})),serialize:(a,y)=>ya([a.aboveToLatex(y),a.command,a.belowToLatex(y)])}),Nt(["over","atop","choose"],"",{infix:!0,createAtom:a=>{let y,b;const E=a.args;return a.command==="\\choose"&&(y="(",b=")"),new ku(ft(E[0]),ft(E[1]),pe(Se({},a),{hasBarLine:a.command==="\\over",leftDelim:y,rightDelim:b}))},serialize:(a,y)=>ya([a.aboveToLatex(y),a.command,a.belowToLatex(y)])}),Nt(["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 ku(ft(E[0]),ft(E[1]),pe(Se({},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)}`}),Nt("pdiff","{numerator}{denominator}",{ifMode:"math",createAtom:a=>new ku(ft(a.args[0]),ft(a.args[1]),pe(Se({},a),{hasBarLine:!0,numerPrefix:"\u2202",denomPrefix:"\u2202"}))}),Nt(["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)],pe(Se({},a),{limits:"auto",variant:"main"}))}),Nt("smallint","",{ifMode:"math",createAtom:a=>new Nc("\u222B",pe(Se({},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"};Nt(Object.keys(op),"",{ifMode:"math",createAtom:a=>{const y=a.command,b=op[y.slice(1)];return new fh(b,pe(Se({},a),{limits:"adjacent",variant:{"\u22D2":"ams","\u22D3":"ams"}[b]}))}}),Nt(["Re","Im"],"",{ifMode:"math",createAtom:a=>new Nc({"\\Re":"\u211C","\\Im":"\u2111"}[a.command],pe(Se({},a),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))}),Nt("middle","{:delim}",{ifMode:"math",createAtom:a=>{var y;return new r0(pe(Se({},a),{delim:(y=a.args[0])!=null?y:"|",size:1}))}}),Nt("the","{:value}",{createAtom:a=>new Un(pe(Se({},a),{captureSelection:!0,verbatimLatex:null})),render:(a,y)=>{var b;const E=new La({parent:y},a.style);let ee="";a.isSelected&&(ee+=" ML__selected");const re=E.evaluate(a.args[0]);return new kr(((b=Do(re))!=null?b:"").split("").map(ae=>new kr(ae,{type:"ord",classes:ee,mode:a.mode,isSelected:a.isSelected,style:Se({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"}`}}),Nt("mathtip","{:auto}{:math}",{createAtom:a=>new hh(pe(Se({},a),{body:ft(a.args[0]),tooltip:ft(a.args[1]),content:"math"})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`\\texttip{${a.bodyToLatex(y)}}{${Un.serialize([a.tooltip],pe(Se({},y),{defaultMode:"math"}))}}`}),Nt("texttip","{:auto}{:text}",{createAtom:a=>new hh(pe(Se({},a),{body:ft(a.args[0]),tooltip:ft(a.args[1]),content:"text"})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`\\texttip{${a.bodyToLatex(y)}}{${Un.serialize([a.tooltip],pe(Se({},y),{defaultMode:"text"}))}}`}),Nt("error","{:math}",{createAtom:a=>new Un(pe(Se({},a),{body:ft(a.args[0])})),serialize:(a,y)=>`\\error{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__error"})}),Nt("ensuremath","{:math}",{createAtom:a=>new Un(pe(Se({},a),{body:ft(a.args[0])})),serialize:(a,y)=>`${a.command}{${a.bodyToLatex(pe(Se({},y),{defaultMode:"math"}))}}`}),Nt("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"})}}}),Nt("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"})}}}),Nt("boxed","{content:math}",{createAtom:a=>new ko(pe(Se({},a),{body:ft(a.args[0]),framecolor:{string:"black"}}))}),Nt("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"})}}}),Nt("fcolorbox","{frame-color:value}{background-color:value}{content:text}",{applyMode:"text",createAtom:a=>{var y,b;return new ko(pe(Se({},a),{body:ft(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(pe(Se({},y),{defaultMode:"text"})):uo(a.command,(b=Do(a.framecolor))!=null?b:"",(E=Do(a.backgroundcolor))!=null?E:"",a.bodyToLatex(pe(Se({},y),{defaultMode:"text"})))}}),Nt("bbox","[:bbox]{body:auto}",{createAtom:a=>{var y;const b=a.args[0],E=ft(a.args[1]);return b?new ko(pe(Se({},a),{body:E,padding:b.padding,border:b.border,backgroundcolor:(y=b.backgroundcolor)!=null?y:void 0})):new ko(pe(Se({},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))}}),Nt(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:a=>new Un(pe(Se({},a),{body:ft(a.args[0])})),render:(a,y)=>{const b=new La({parent:y,mathstyle:a.command.slice(1)},a.style),E=Un.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):`{${ya([a.command,a.bodyToLatex(y)])}}`}),Nt(["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]})}),Nt("fontseries","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontSeries:(b=y[0])!=null?b:"auto"}}}),Nt("fontshape","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontShape:(b=y[0])!=null?b:"auto"}}}),Nt("fontfamily","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontFamily:(b=y[0])!=null?b:"roman"}}}),Nt("selectfont","",{ifMode:"text",applyStyle:()=>({})}),Nt("bf","{:rest}",{applyStyle:()=>({fontSeries:"b",fontShape:"n",fontFamily:"roman"})}),Nt(["boldsymbol","bm"],"{:math}",{applyMode:"math",createAtom:a=>new Un(pe(Se({},a),{body:ft(a.args[0])})),serialize:(a,y)=>`${a.command}{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__boldsymbol"})}),Nt("bold","{:math*}",{applyMode:"math",applyStyle:()=>({variantStyle:"bold"})}),Nt("bfseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),Nt("mdseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),Nt("upshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),Nt("slshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),Nt("scshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),Nt("textbf","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),Nt("textmd","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),Nt("textup","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),Nt("textnormal","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n",fontSeries:"m"})}),Nt("textsl","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),Nt("textit","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"it"})}),Nt("textsc","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),Nt("textrm","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"roman"})}),Nt("textsf","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"sans-serif"})}),Nt("texttt","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"monospace"})}),Nt("mathbf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"bold"})}),Nt("mathit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"italic"})}),Nt("mathnormal","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"italic"})}),Nt("mathbfit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"bolditalic"})}),Nt("mathrm","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"up"})}),Nt("mathsf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"sans-serif",variantStyle:"up"})}),Nt("mathtt","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"monospace",variantStyle:"up"})}),Nt("it","{:rest}",{applyStyle:()=>({fontSeries:"m",fontShape:"it",fontFamily:"roman",variantStyle:"italic"})}),Nt("rmfamily","",{applyStyle:()=>({fontFamily:"roman"})}),Nt("sffamily","",{applyStyle:()=>({fontFamily:"sans-serif"})}),Nt("ttfamily","",{applyStyle:()=>({fontFamily:"monospace"})}),Nt(["Bbb","mathbb"],"{:math*}",{applyStyle:()=>({variant:"double-struck",variantStyle:"up"})}),Nt(["frak","mathfrak"],"{:math*}",{applyStyle:()=>({variant:"fraktur",variantStyle:"up"})}),Nt("mathcal","{:math*}",{applyStyle:()=>({variant:"calligraphic",variantStyle:"up"})}),Nt("mathscr","{:math*}",{applyStyle:()=>({variant:"script",variantStyle:"up"})}),Nt("mbox","{:text}",{ifMode:"math",createAtom:a=>new Un(pe(Se({},a),{type:"mord",body:ft(a.args[0]),mode:"math"})),serialize:(a,y)=>uo("\\mbox",a.bodyToLatex(pe(Se({},y),{defaultMode:"text"})))}),Nt("text","{:text}",{ifMode:"math",applyMode:"text"}),Nt(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:a=>new Un(pe(Se({},a),{body:ft(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:""})}}),Nt(["cssId","htmlId"],"{id:string}{content:auto}",{createAtom:a=>new Un(pe(Se({},a),{body:ft(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}}),Nt("htmlData","{data:string}{content:auto}",{createAtom:a=>new Un(pe(Se({},a),{body:ft(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}}),Nt(["style","htmlStyle"],"{data:string}{content:auto}",{createAtom:a=>new Un(pe(Se({},a),{body:ft(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}}),Nt("em","{:rest}",{createAtom:a=>new Un(pe(Se({},a),{body:ft(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"})}),Nt("emph","{:auto}",{createAtom:a=>new Un(pe(Se({},a),{body:ft(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}};Nt(["bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr","bigm","Bigm","biggm","Biggm","big","Big","bigg","Bigg"],"{:delim}",{createAtom:a=>{var y;return new i0(pe(Se({},a),{delim:(y=a.args[0])!=null?y:".",size:sp[a.command].size,delimType:sp[a.command].mclass}))}}),Nt(["hspace","hspace*"],"{width:value}",{createAtom:a=>{var y;return new Sd(pe(Se({},a),{width:(y=a.args[0])!=null?y:{dimension:0}}))}}),Nt(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:a=>{var y;return new Sd(pe(Se({},a),{width:(y=a.args[0])!=null?y:{dimension:0}}))}}),Nt("mathchoice","{:math}{:math}{:math}{:math}",{createAtom:a=>new Un(a),render:(a,y)=>{let b=0;const E=y.mathstyle.id;(E===Dc||E===ml)&&(b=1),(E===zl||E===ss)&&(b=2),(E===ks||E===Vo)&&(b=3);const ee=ft(a.args[b]);return Un.createBox(y,ee)},serialize:(a,y)=>`\\mathchoice{${Un.serialize(a.args[0],y)}}{${Un.serialize(a.args[1],y)}}{${Un.serialize(a.args[2],y)}}{${Un.serialize(a.args[3],y)}}`}),Nt("mathop","{:auto}",{createAtom:a=>new Un(pe(Se({},a),{type:"mop",body:ft(a.args[0]),limits:"over-under",isFunction:!0,captureSelection:!0})),render:(a,y)=>{var b;let E=Un.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 kr(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)),ya(b)}}),Nt(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:a=>new Un(pe(Se({},a),{type:{"\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[a.command],body:ft(a.args[0])}))}),Nt(["operatorname","operatorname*"],"{operator:math}",{createAtom:a=>{const y=ft(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 Un(pe(Se({},a),{type:"mop",body:y,isFunction:!0,limits:a.command==="\\operatorname"?"adjacent":"over-under"}))},render:(a,y)=>{var b;let E=Un.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 kr(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)),ya(b)}}),Nt(["char","unicode"],"{charcode:value}",{createAtom:a=>new Un(pe(Se({},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)}}),Nt("rule","[raise:value]{width:value}{thickness:value}",{createAtom:a=>new Un(a),render:(a,y)=>{var b,E,ee;const re=new La({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}),he=re.toEm((ee=a.args[2])!=null?ee:{dimension:10}),ge=new kr(null,{classes:"rule",type:"ord"});return ge.width=de,ge.height=he+ae,ge.depth=-ae,ge.setStyle("border-right-width",de,"em"),ge.setStyle("border-top-width",he,"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])}}`}),Nt(["overline","underline"],"{:auto}",{createAtom:a=>new Un(pe(Se({},a),{body:ft(a.args[0])})),render:(a,y)=>{const b=a.command.substring(1),E=new La({parent:y,mathstyle:"cramp"},a.style),ee=Un.createBox(E,a.body);if(!ee)return null;const re=E.metrics.defaultRuleThickness/E.scalingFactor,ae=new kr(null,{classes:b+"-line"});ae.height=re,ae.maxFontSize=re*1.125*E.scalingFactor;let de;return b==="overline"?de=new Qa({shift:0,children:[{box:ee},3*re,{box:ae},re]}):de=new Qa({top:ee.height,children:[re,{box:ae},3*re,{box:ee}]}),a.caret&&(de.caret=a.caret),new kr(de,{classes:b,type:"ignore"})}}),Nt("overset","{:auto}{base:auto}",{createAtom:a=>{const y=ft(a.args[1]);return new js(pe(Se({},a),{above:ft(a.args[0]),body:y,skipBoundary:!1,boxType:rc(y)}))},serialize:(a,y)=>uo(a.command,a.aboveToLatex(y),a.bodyToLatex(y))}),Nt("underset","{:auto}{base:auto}",{createAtom:a=>{const y=ft(a.args[1]);return new js(pe(Se({},a),{below:ft(a.args[0]),body:y,skipBoundary:!1,boxType:rc(y)}))},serialize:(a,y)=>uo(a.command,a.belowToLatex(y),a.bodyToLatex(y))}),Nt("overunderset","{above:auto}{below:auto}{base:auto}",{createAtom:a=>{const y=ft(a.args[2]);return new js(pe(Se({},a),{above:ft(a.args[0]),below:ft(a.args[1]),body:y,skipBoundary:!1,boxType:rc(y)}))},serialize:(a,y)=>uo(a.command,a.belowToLatex(y),a.bodyToLatex(y))}),Nt(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:a=>new js(pe(Se({},a),{body:ft(a.args[2]),above:ft(a.args[1]),below:ft(a.args[0]),skipBoundary:!1,boxType:a.command==="\\stackrel"?"rel":"bin"})),serialize:(a,y)=>uo(a.command,a.aboveToLatex(y),a.bodyToLatex(y))}),Nt("smash","[:string]{:auto}",{createAtom:a=>{var y,b,E,ee;return new wd(pe(Se({},a),{body:ft(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}))}}),Nt(["vphantom"],"{:auto}",{createAtom:a=>new wd(pe(Se({},a),{body:ft(a.args[0]),isInvisible:!0,smashWidth:!0}))}),Nt(["hphantom"],"{:auto}",{createAtom:a=>new wd(pe(Se({},a),{body:ft(a.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))}),Nt(["phantom"],"{:auto}",{createAtom:a=>new wd(pe(Se({},a),{body:ft(a.args[0]),isInvisible:!0}))}),Nt("not","{:math}",{createAtom:a=>{const y=ft(a.args[0]);return y.length===0?new Un(pe(Se({},a),{type:"mrel",value:"\uE020"})):new Un(pe(Se({},a),{body:[new Rc(pe(Se({},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{${Un.serialize(b.group,y)}}`:`\\not${Un.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":rc(ft(a.args[0])),ee=Un.createBox(y,a.body,{type:E});return a.caret&&(ee.caret=a.caret),a.bind(y,ee)}}),Nt(["ne","neq"],"",{createAtom:a=>new Un(pe(Se({},a),{type:"mrel",body:[new Rc(pe(Se({},a),{body:"\uE020",align:"right",boxType:"rel"})),new Un(pe(Se({},a),{value:"="}))],captureSelection:!0})),serialize:a=>a.command}),Nt("rlap","{:auto}",{createAtom:a=>new Rc(pe(Se({},a),{body:ft(a.args[0]),align:"right"}))}),Nt("llap","{:auto}",{createAtom:a=>new Rc(pe(Se({},a),{body:ft(a.args[0]),align:"left"}))}),Nt("mathrlap","{:math}",{createAtom:a=>new Rc(pe(Se({},a),{body:ft(a.args[0]),align:"left"}))}),Nt("mathllap","{:math}",{createAtom:a=>new Rc(pe(Se({},a),{body:ft(a.args[0]),align:"left"}))}),Nt("raisebox","{:value}{:text}",{createAtom:a=>{var y;return new ko(pe(Se({},a),{body:ft(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))}}),Nt("raise","{:value}{:auto}",{createAtom:a=>{var y;return new ko(pe(Se({},a),{body:ft(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))}}),Nt("lower","{:value}{:auto}",{createAtom:a=>{var y;return new ko(pe(Se({},a),{body:ft(a.args[1]),padding:{dimension:0},offset:(y=Zs(a.args[0],-1))!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b,E;return uo("\\lower",(E=Do(Zs((b=a.offset)!=null?b:{dimension:0},-1)))!=null?E:"0pt",a.bodyToLatex(y))}}),We("0123456789/@.?!"),Lt(65,90),Lt(97,122),We([["\\forall",8704],["\\exists",8707],["\\nexists",8708,"mord","ams"],["\\mid",8739,"mrel"],["\\top",8868],["\\bot",8869]]),We([["\\#",35],["\\&",38],["\\parallelogram",9649],["\\spadesuit",9824],["\\heartsuit",9825],["\\diamondsuit",9826],["\\clubsuit",9827],["\\flat",9837],["\\natural",9838],["\\sharp",9839]]),We([["\\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]]),We([["\\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"),We([["\\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"]]),We([["\\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"]]),We([["\\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"),We([["+",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"),We([["\\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"),We([["\\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]]),We([["=",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"),We([["\\lnot",172],["\\neg",172],["\\triangle",9651],["\\subsetneq",8842],["\\varsubsetneq",57370],["\\subsetneqq",10955],["\\varsubsetneqq",57367],["\\nsubset",8836],["\\nsupset",8837],["\\nsubseteq",8840],["\\nsupseteq",8841]],"mrel","ams"),We([["\\wp",8472],["\\aleph",8501]]),We([["\\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"),We([["\\ ",160],["~",160]],"space"),Nt(["!",",",":",";",">","enskip","enspace","quad","qquad"],"",{createAtom:a=>new Sd(a)}),Nt("space","",{createAtom:a=>new Sd(a)}),We([["\\colon",58],["\\cdotp",8901],["\\vdots",8942,"mord"],["\\ldotp",46],[",",44],[";",59]],"mpunct"),We([["\\cdots",8943],["\\ddots",8945],["\\ldots",8230],["\\mathellipsis",8230]],"minner"),We([["\\/",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 no(a,y){return!a||!y.generateID?"":` extid="${a}"`}function Mv(a,y,b){var E,ee,re,ae,de,he,ge,xe,Re,Ze,dt;let St=!1;y=y!=null?y:a.atoms.length;let Sn="",wr="",gn=a.atoms[a.index];const tr=(ee=(E=gn.style)==null?void 0:E.variant)!=null?ee:"",_r=(ae=(re=gn.style)==null?void 0:re.variantStyle)!=null?ae:"";let lr="";if(tr||_r){const Ii=Hn(gn.value,(de=gn.style)==null?void 0:de.variant,(he=gn.style)==null?void 0:he.variantStyle);if(Ii!==gn.value)return a.index+=1,Sn=`<mi${no(gn.id,b)}>${Ii}</mi>`,Zl(Sn,a,b)||(a.mathML+=Sn,a.lastType="mi"),!0;lr=(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"}[_r+tr])!=null?ge:"",lr=` mathvariant="${lr}"`}const si={"\\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(gn.command==="!")return a.index+=1,Sn="<mo>!</mo>",Zl(Sn,a,b)||(a.mathML+=Sn,a.lastType="mo"),!0;if(si[gn.command]){a.index+=1;let Ii=`<mi${no(gn.id,b)}${lr}>${si[gn.command]}</mi>`;return(a.lastType==="mi"||a.lastType==="mn"||a.lastType==="mtext"||a.lastType==="fence")&&(Ii=Xf+Ii),Zl(Ii,a,b)||(a.mathML+=Ii,a.lastType="mi"),!0}if(gn.command==="\\operatorname")wr=Bu(gn.body),a.index+=1;else if(tr||_r)for(;a.index<y&&(gn.type==="mord"||gn.type==="macro")&&!gn.isDigit()&&tr===((Re=(xe=gn.style)==null?void 0:xe.variant)!=null?Re:"")&&_r===((dt=(Ze=gn.style)==null?void 0:Ze.variantStyle)!=null?dt:"");)wr+=Bu([gn]),a.index+=1,gn=a.atoms[a.index];else(gn.type==="mord"||gn.type==="macro")&&!gn.isDigit()&&(wr+=Bu([gn]),a.index+=1);if(wr.length>0){St=!0,Sn=`<mi${lr}>${wr}</mi>`;const Ii=a.lastType;Sn.endsWith(">f</mi>")||Sn.endsWith(">g</mi>")?(Sn+=lp,a.lastType="applyfunction"):a.lastType=/^<mo>(.*)<\/mo>$/.test(Sn)?"mo":"mi",Zl(Sn,a,b)||((Ii==="mi"||Ii==="mn"||Ii==="mtext"||Ii==="fence")&&(Sn=Xf+Sn),a.mathML+=Sn)}return St}function Ev(a){return a.index<a.atoms.length&&a.atoms[a.index].superscript&&a.atoms[a.index].type==="subsup"}function kv(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 Zl(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=Ua(ee.superscript,b);y.lastType="";const de=Ua(ee.subscript,b);if(y.lastType=re,!ae&&!de)return!1;let he="";return ae&&de?he=`<msubsup>${a}${de}${ae}</msubsup>`:ae?he=`<msup>${a}${ae}</msup>`:de&&(he=`<msub>${a}${de}</msub>`),y.mathML+=he,y.lastType="",!0}function _v(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 ${no(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=kv(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"+no(a.atoms[E].id,b)+">"+ee+"</mn>",re<0&&Ev(a)&&(re=a.index,a.index+=1),Zl(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 he=a.index;let ge=-1,xe=he+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+=Vc(a.atoms[he],b),ee+=Ua(a.atoms,b,he+1,ge),ee+=Vc(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),Zl(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 he=`<mo${no(ae.id,b)}>${de[ae.command]}</mo>`;return Zl(he,a,b)||(a.mathML+=he,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 he=Vc(ae,b);return ae.superscript&&ae.subscript?(ee+="<munderover>"+he,ee+=Ua(ae.subscript,b),ee+=Ua(ae.superscript,b),ee+="</munderover>"):ae.superscript?(ee+="<mover>"+he,ee+=Ua(ae.superscript,b),ee+="</mover>"):ae.subscript&&(ee+="<munder>"+he,ee+=Ua(ae.subscript,b),ee+="</munder>"),a.mathML+=ee,a.lastType="mo",a.index+=1,!0}{const he=a.atoms[a.index],ge=he.value==="\\operatorname",xe=ge?'<mi class="MathML-Unit"'+no(he.id,b)+">"+Bu(he.value)+"</mi>":Vc(he,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,Zl(ee,a,b)||(a.mathML+=ee,a.lastType=re)),E}function Ua(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 Un)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(_v(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,Zl(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 Vc(a,y){let b="";const E=Bu(a.value);return E&&(b="<mo"+no(a.id,y)+">"+E+"</mo>"),b}function Bu(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,he,ge,xe,Re,Ze,dt,St,Sn,wr,gn,tr,_r,lr,si,Ii,vi;if(a.mode==="text")return`<mi${no(a.id,y)}>${a.value}</mi>`;const Pa={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"},Ya={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\>":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let Rr="",Fs="",_l,Xs,Yo,zs,Ms,ro;const{command:Lo}=a;if(a.command==="\\error")return`<merror${no(a.id,y)}>${Ua(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":Rr=Ua(a.body,y);break;case"array":if((a.leftDelim&&a.leftDelim!=="."||a.rightDelim&&a.rightDelim!==".")&&(Rr+="<mrow>",a.leftDelim&&a.leftDelim!=="."&&(Rr+="<mo>"+(Jo[a.leftDelim]||a.leftDelim)+"</mo>")),Rr+="<mtable",a.colFormat){for(Rr+=' columnalign="',Yo=0;Yo<a.colFormat.length;Yo++)a.colFormat[Yo].align&&(Rr+={l:"left",c:"center",r:"right"}[a.colFormat[Yo].align]+" ");Rr+='"'}for(Rr+=">",Xs=0;Xs<a.array.length;Xs++){for(Rr+="<mtr>",_l=0;_l<a.array[Xs].length;_l++)Rr+="<mtd>"+Ua(a.array[Xs][_l],y)+"</mtd>";Rr+="</mtr>"}Rr+="</mtable>",(a.leftDelim&&a.leftDelim!=="."||a.rightDelim&&a.rightDelim!==".")&&(a.rightDelim&&a.rightDelim!=="."&&(Rr+="<mo>"+(Jo[a.leftDelim]||a.rightDelim)+"</mo>"),Rr+="</mrow>");break;case"genfrac":(a.leftDelim||a.rightDelim)&&(Rr+="<mrow>"),a.leftDelim&&a.leftDelim!=="."&&(Rr+="<mo"+no(a.id,y)+">"+(Jo[a.leftDelim]||a.leftDelim)+"</mo>"),a.hasBarLine?(Rr+="<mfrac>",Rr+=Ua(a.above,y)||"<mi>&nbsp;</mi>",Rr+=Ua(a.below,y)||"<mi>&nbsp;</mi>",Rr+="</mfrac>"):(Rr+="<mtable"+no(a.id,y)+">",Rr+="<mtr>"+Ua(a.above,y)+"</mtr>",Rr+="<mtr>"+Ua(a.below,y)+"</mtr>",Rr+="</mtable>"),a.rightDelim&&a.rightDelim!=="."&&(Rr+="<mo"+no(a.id,y)+">"+(Jo[a.rightDelim]||a.rightDelim)+"</mo>"),(a.leftDelim||a.rightDelim)&&(Rr+="</mrow>");break;case"surd":a.hasEmptyBranch("above")?(Rr+="<msqrt"+no(a.id,y)+">",Rr+=Ua(a.body,y),Rr+="</msqrt>"):(Rr+="<mroot"+no(a.id,y)+">",Rr+=Ua(a.body,y),Rr+=Ua(a.above,y),Rr+="</mroot>");break;case"leftright":const Al=a,Tl=Al.leftDelim;Rr="<mrow>",Tl&&Tl!=="."&&(Rr+=`<mo${no(a.id,y)}>${(b=Jo[Tl])!=null?b:Tl}</mo>`),a.body&&(Rr+=Ua(a.body,y));const Dl=Al.matchingRightDelim();Dl&&Dl!=="."&&(Rr+=`<mo${no(a.id,y)}>${(E=Jo[Dl])!=null?E:Dl}</mo>`),Rr+="</mrow>";break;case"sizeddelim":case"delim":Rr+=`<mo${no(a.id,y)}>${Jo[a.value]||a.value}</mo>`;break;case"accent":Rr+='<mover accent="true"'+no(a.id,y)+">",Rr+=Ua(a.body,y),Rr+="<mo>"+(Ll[Lo]||a.accent)+"</mo>",Rr+="</mover>";break;case"line":case"overlap":break;case"overunder":Ms=a.above,zs=a.below,(a.svgAbove||Ms)&&(a.svgBelow||zs)?ro=a.body:Ms&&Ms.length>0?(ro=a.body,(re=(ee=a.body)==null?void 0:ee[0])!=null&&re.below?(zs=a.body[0].below,ro=a.body[0].body):((de=(ae=a.body)==null?void 0:ae[0])==null?void 0:de.type)==="first"&&((ge=(he=a.body)==null?void 0:he[1])!=null&&ge.below)&&(zs=a.body[1].below,ro=a.body[1].body)):zs&&zs.length>0&&(ro=a.body,(Re=(xe=a.body)==null?void 0:xe[0])!=null&&Re.above?(Ms=a.body[0].above,ro=a.body[0].body):((dt=(Ze=a.body)==null?void 0:Ze[0])==null?void 0:dt.type)==="first"&&((Sn=(St=a.body)==null?void 0:St[1])!=null&&Sn.above)&&(Ms=a.body[1].overscript,ro=a.body[1].body)),(a.svgAbove||Ms)&&(a.svgBelow||zs)?(Rr+=`<munderover ${no(a.id,y)}>`,Rr+=(wr=Pa[a.svgBody])!=null?wr:Ua(ro,y),Rr+=(gn=Pa[a.svgBelow])!=null?gn:Ua(zs,y),Rr+=(tr=Pa[a.svgAbove])!=null?tr:Ua(Ms,y),Rr+="</munderover>"):a.svgAbove||Ms?(Rr+=`<mover ${no(a.id,y)}>`+((_r=Pa[a.svgBody])!=null?_r:Ua(ro,y)),Rr+=(lr=Pa[a.svgAbove])!=null?lr:Ua(Ms,y),Rr+="</mover>"):(a.svgBelow||zs)&&(Rr+=`<munder ${no(a.id,y)}>`+((si=Pa[a.svgBody])!=null?si:Ua(ro,y)),Rr+=(Ii=Pa[a.svgBelow])!=null?Ii:Ua(zs,y),Rr+="</munder>");break;case"placeholder":Rr+="?";break;case"mord":{Rr=typeof a.value=="string"?a.value:Lo,Lo==="\\char"?Rr="&#x"+("000000"+a.args[0].number.toString(16)).slice(-4)+";":Rr.length>0&&Rr.startsWith("\\")&&(typeof a.value=="string"&&a.value.charCodeAt(0)>255?Rr="&#x"+("000000"+a.value.charCodeAt(0).toString(16)).slice(-4)+";":typeof a.value=="string"?Rr=a.value.charAt(0):(console.error("Did not expect this"),Rr=""));const cl=/\d/.test(Rr)?"mn":"mi";Rr=`<${cl}${no(a.id,y)}>${qf(Rr)}</${cl}>`;break}case"mbin":case"mrel":case"minner":Rr=Vc(a,y);break;case"mpunct":Rr='<mo separator="true"'+no(a.id,y)+">"+Lo+"</mo>";break;case"mop":case"operator":case"extensible-symbol":a.body!=="\u200B"&&(Rr="<mo"+no(a.id,y)+">",Rr+=Lo==="\\operatorname"?a.body:Lo||a.body,Rr+="</mo>");break;case"box":Rr='<menclose notation="box"',a.backgroundcolor&&(Rr+=' mathbackground="'+a.backgroundcolor+'"'),Rr+=no(a.id,y)+">"+Ua(a.body,y)+"</menclose>";break;case"spacing":Rr+='<mspace width="'+((vi=Ya[Lo])!=null?vi:0)+'em"/>';break;case"enclose":Rr='<menclose notation="';for(const cl in a.notation)Object.prototype.hasOwnProperty.call(a.notation,cl)&&a.notation[cl]&&(Rr+=Fs+cl,Fs=" ");Rr+=no(a.id,y)+'">'+Ua(a.body,y)+"</menclose>";break;case"prompt":Rr='<menclose notation="roundexbox""">'+Ua(a.body,y)+"</menclose>";break;case"space":Rr+="&nbsp;";break;case"subsup":break;case"phantom":break;case"composition":break;case"rule":break;case"chem":break;case"mopen":Rr+=Vc(a,y);break;case"mclose":Rr+=Vc(a,y);break;case"macro":{const cl=a.command+Bu(a.macroArgs);cl&&(Rr+=`<mo ${no(a.id,y)}>${cl}</mo>`)}break;case"latexgroup":Rr+=Ua(a.body,y);break;case"latex":Rr+="<mtext"+no(a.id,y)+">"+a.value+"</mtext>";break;case"tooltip":Rr+=Ua(a.body,y);break;case"text":Rr+=`<mtext ${no(a.id,y)}x>${a.value}</mtext>`;break;default:if(a.command==="\\displaystyle")return`<mrow ${no(a.id,y)} displaystyle="true">${Ua(a.body,y)}</mrow>`;if(a.command==="\\textstyle")return`<mrow ${no(a.id,y)} displaystyle="false">${Ua(a.body,y)}</mrow>`;console.info("Unexpected element in conversion to MathML:",a)}return Rr}var $u={"\\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"},Uh={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 Bd(a){let y=0;if(ze(a))for(const b of a)b.type!=="first"&&(y+=1);return y===1}function Iv(a){if(ze(a)){for(const y of a)if(y.type!=="first"&&y.id)return y.id.toString()}return""}function cp(a){let y="";if(ze(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 Ma(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 he(xe){return"<emphasis>"+xe+"</emphasis>"}if(!y)return"";let ge="";if(ze(y)){let xe=!1,Re=!1;for(let Ze=0;Ze<y.length;Ze++)y[Ze].type!=="first"&&(y[Ze].mode!=="text"&&(Re=!1),Ze<y.length-2&&y[Ze].type==="mopen"&&y[Ze+2].type==="mclose"&&y[Ze+1].type==="mord"?(ge+=" of ",ge+=he(Ma(a,y[Ze+1])),Ze+=2):y[Ze].mode==="text"?Re?ge+=(b=y[Ze].value)!=null?b:" ":(Re=!0,ge+=Ma("text",y[Ze])):y[Ze].isDigit()?xe?ge+=y[Ze].asDigit():(xe=!0,ge+=Ma(a,y[Ze])):(xe=!1,ge+=Ma(a,y[Ze])))}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="",Re="",Ze="",dt=!1;const{command:St}=y;switch(St){case"\\vec":return"vector "+Ma(a,y.body);case"\\acute":return Ma(a,y.body)+" acute";case"\\grave":return Ma(a,y.body)+" grave";case"\\dot":return"dot over"+Ma(a,y.body);case"\\ddot":return"double dot over"+Ma(a,y.body);case"\\mathring":return"ring over"+Ma(a,y.body);case"\\tilde":case"\\widetilde":return"tilde over"+Ma(a,y.body);case"\\bar":return Ma(a,y.body)+" bar";case"\\breve":return Ma(a,y.body)+" breve";case"\\check":case"\\widecheck":return"check over "+Ma(a,y.body);case"\\hat":case"\\widehat":return"hat over"+Ma(a,y.body);case"\\overarc":case"\\overparen":case"\\wideparen":return"arc over "+Ma(a,y.body);case"\\underarc":case"\\underparen":return"arc under "+Ma(a,y.body)}switch(y.type){case"prompt":const Sn=y.body.length>1?'start input . <break time="500ms"/> '+Ma(a,y.body)+'. <break time="500ms"/> end input':"blank";ge+=' <break time="300ms"/> '+Sn+'. <break time="700ms"/>'+((E=y.correctness)!=null?E:"")+' . <break time="700ms"/> ';break;case"array":const wr=y.array,gn=y.environmentName;if(Object.keys(Uh).includes(gn)){ge+=` begin ${Uh[gn]} `;for(let lr=0;lr<wr.length;lr++){lr>0&&(ge+=","),ge+=` row ${lr+1} `;for(let si=0;si<wr[lr].length;si++)si>0&&(ge+=","),ge+=` column ${si+1}: `,ge+=Ma("math",wr[lr][si])}ge+=` end ${Uh[gn]} `}break;case"group":St==="\\ne"?ge+=" not equal ":(St==="\\not"&&(ge+=" not "),ge+=Ma("math",y.body));break;case"root":ge+=Ma("math",y.body);break;case"genfrac":if(xe=Ma("math",y.above),Re=Ma("math",y.below),Bd(y.above)&&Bd(y.below)){const si={"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 "}[cp(y.above)+"/"+cp(y.below)];si?ge=si:ge+=xe+" over "+Re}else ge+=' the fraction <break time="150ms"/>'+xe+' over <break time="150ms"/>'+Re+'.<break time="150ms"/> End fraction.<break time="150ms"/>';break;case"surd":if(Ze=Ma("math",y.body),y.hasEmptyBranch("above"))ge+=Bd(y.body)?" the square root of "+Ze+" , ":' the square root of <break time="200ms"/>'+Ze+'. <break time="200ms"/> End square root';else{let lr=Ma("math",y.above);lr=lr.trim();const si=lr.replace(/<mark([^/]*)\/>/g,"");si==="3"?ge+=' the cube root of <break time="200ms"/>'+Ze+'. <break time="200ms"/> End cube root':si==="n"?ge+=' the nth root of <break time="200ms"/>'+Ze+'. <break time="200ms"/> End root':ge+=' the root with index: <break time="200ms"/>'+lr+', of <break time="200ms"/>'+Ze+'. <break time="200ms"/> End root'}break;case"leftright":{const lr=y;ge+=(ee=lr.leftDelim?$u[lr.leftDelim]:void 0)!=null?ee:lr.leftDelim,ge+=Ma("math",y.body),ge+=(re=lr.rightDelim?$u[lr.rightDelim]:void 0)!=null?re:lr.rightDelim}break;case"rule":break;case"overunder":break;case"overlap":break;case"macro":const tr=St.replace(/^\\/g,""),_r=Gr()[tr];_r&&(_r!=null&&_r.expand?ge+=Ma("math",y.body):ge+=`${tr} `);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(St==="\\mathbin"||St==="\\mathrel"||St==="\\mathopen"||St==="\\mathclose"||St==="\\mathpunct"||St==="\\mathord"||St==="\\mathinner"){ge=Ma(a,y.body);break}let lr=y.isDigit()?y.asDigit():y.value,si=y.command;if((y.type==="delim"||y.type==="sizeddelim")&&(si=y.value,lr=si),a==="text")ge+=lr;else{if(y.type==="mbin"&&(ge+='<break time="150ms"/>'),lr){const Ii=$u[lr]||(si?$u[si.trim()]:"");if(Ii)ge+=" "+Ii;else{const vi=si?Dv(si.trim()):"";ge+=vi||de(lr)}}else ge+=Ma("math",y.body);y.type==="mbin"&&(ge+='<break time="150ms"/>')}break}case"mop":case"operator":case"extensible-symbol":if(y.value!=="\u200B"){const lr=y.command;if(lr==="\\sum")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let si=Ma("math",y.superscript);si=si.trim();let Ii=Ma("math",y.subscript);Ii=Ii.trim(),ge+=' the summation from <break time="200ms"/>'+Ii+'<break time="200ms"/> to <break time="200ms"/>'+si+'<break time="200ms"/> of <break time="150ms"/>',dt=!0}else if(y.hasEmptyBranch("subscript"))ge+=" the summation of";else{let si=Ma("math",y.subscript);si=si.trim(),ge+=' the summation from <break time="200ms"/>'+si+'<break time="200ms"/> of <break time="150ms"/>',dt=!0}else if(lr==="\\prod")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let si=Ma("math",y.superscript);si=si.trim();let Ii=Ma("math",y.subscript);Ii=Ii.trim(),ge+=' the product from <break time="200ms"/>'+Ii+'<break time="200ms"/> to <break time="200ms"/>'+si+'<break time="200ms"/> of <break time="150ms"/>',dt=!0}else if(y.hasEmptyBranch("subscript"))ge+=" the product of ";else{let si=Ma("math",y.subscript);si=si.trim(),ge+=' the product from <break time="200ms"/>'+si+'<break time="200ms"/> of <break time="150ms"/>',dt=!0}else if(lr==="\\int")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let si=Ma("math",y.superscript);si=si.trim();let Ii=Ma("math",y.subscript);Ii=Ii.trim(),ge+=' the integral from <break time="200ms"/>'+he(Ii)+'<break time="200ms"/> to <break time="200ms"/>'+he(si)+' <break time="200ms"/> of ',dt=!0}else ge+=' the integral of <break time="200ms"/> ';else if(typeof y.value=="string"){const si=(ae=$u[y.value])!=null?ae:y.command?$u[y.command]:void 0;ge+=si||" "+y.value}else y.command&&(y.command==="\\mathop"?ge+=Ma("math",y.body):y.command==="\\operatorname"?ge+=Pv(y.body):ge+=y.command.startsWith("\\")?" "+y.command.slice(1):" "+y.command)}break;case"enclose":Ze=Ma("math",y.body),ge+=" crossed out "+Ze+". End crossed out.";break;case"space":case"spacing":break}if(!dt&&!y.hasEmptyBranch("superscript")){let Sn=Ma(a,y.superscript);Sn=Sn.trim();const wr=Sn.replace(/<[^>]*>/g,"");if(Bd(y.superscript)){if(a==="math"){const gn=Iv(y.superscript);gn&&(ge+='<mark name="'+gn+'"/>')}wr==="\u2032"?ge+=" prime ":wr==="2"?ge+=" squared ":wr==="3"?ge+=" cubed ":Number.isNaN(Number.parseInt(wr))?ge+=" to the "+Sn+"; ":ge+=' to the <say-as interpret-as="ordinal">'+wr+"</say-as> power; "}else Number.isNaN(Number.parseInt(wr))?ge+=" raised to the "+Sn+"; ":ge+=' raised to the <say-as interpret-as="ordinal">'+wr+"</say-as> power; "}if(!dt&&!y.hasEmptyBranch("subscript")){let Sn=Ma("math",y.subscript);Sn=Sn.trim(),ge+=Bd(y.subscript)?" sub "+Sn:" subscript "+Sn+". End subscript. "}}return ge}function Fu(a){var y,b;if(window.MathfieldElement.textToSpeechRules==="sre"&&("sre"in window||"SRE"in window)){const ee=Ua(a);if(ee){window.MathfieldElement.textToSpeechMarkup&&(window.MathfieldElement.textToSpeechRulesOptions=(y=window.MathfieldElement.textToSpeechRulesOptions)!=null?y:{},window.MathfieldElement.textToSpeechRulesOptions=pe(Se({},window.MathfieldElement.textToSpeechRulesOptions),{markup:window.MathfieldElement.textToSpeechMarkup}),window.MathfieldElement.textToSpeechRulesOptions.markup==="ssml"&&(window.MathfieldElement.textToSpeechRulesOptions=pe(Se({},window.MathfieldElement.textToSpeechRulesOptions),{markup:"ssml_step"})),window.MathfieldElement.textToSpeechRulesOptions=pe(Se({},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=Ma("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"&&De()==="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 $d={"\\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"},Fd={"\\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 Ov(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 _o(a){var y,b,E,ee,re,ae,de,he,ge,xe,Re,Ze,dt;if(!a)return"";if(ze(a)){if(a.length===0)return"";if(a[0].mode==="latex")return a.map(_o).join("");if(a[0].mode==="text"){let _r=0,lr="";for(;((y=a[_r])==null?void 0:y.mode)==="text";)lr+=a[_r].body?_o(a[_r].body):a[_r].value,_r++;return`"${lr}" ${_o(a.slice(_r))}`}let gn=0;const tr=[];for(;a[gn]&&a[gn].mode==="math";){let _r="";for(;a[gn]&&a[gn].type==="mord"&&/\d/.test(a[gn].value);)_r+=a[gn++].value;_r?tr.push(_r):tr.push(_o(a[gn++]))}return tr.push(_o(a.slice(gn))),Ov(tr)}if(a.mode==="text")return`"${a.value}"`;let St="";const{command:Sn}=a;let wr;if(Sn==="\\placeholder")return`(${_o(a.body)})`;switch(a.type){case"accent":const gn={"\\vec":"vec","\\dot":"dot","\\ddot":"ddot","\\bar":"bar","\\hat":"hat","\\acute":"acute;","\\grave":"grave","\\tilde":"tilde","\\breve":"breave","\\check":"check"}[Sn];St=`${gn!=null?gn:""} ${_o(a.body)} `;break;case"first":return"";case"latexgroup":return a.body.map(vi=>vi.value).join("");case"group":case"root":St=(b=$d[Sn])!=null?b:_o(a.body);break;case"genfrac":{const vi=a;(vi.leftDelim||vi.rightDelim)&&(St=vi.leftDelim==="."||!vi.leftDelim?"{:":vi.leftDelim),vi.hasBarLine?(St+="(",St+=_o(vi.above),St+=")/(",St+=_o(vi.below),St+=")"):(St+="("+_o(vi.above)+"),",St+="("+_o(vi.below)+")"),(vi.leftDelim||vi.rightDelim)&&(St+=vi.rightDelim==="."||!vi.rightDelim?"{:":vi.rightDelim)}break;case"surd":St+=a.hasEmptyBranch("above")?"sqrt("+_o(a.body)+")":"root("+_o(a.above)+")("+_o(a.body)+")";break;case"latex":St=a.value;break;case"leftright":{const vi=a,Pa=vi.leftDelim;St+=Pa==="."||!Pa?"{:":Pa,St+=_o(vi.body);const Ya=vi.matchingRightDelim();St+=Ya==="."||!Ya?":}":Ya}break;case"sizeddelim":case"delim":St=a.value;break;case"overlap":break;case"overunder":break;case"mord":St=(ee=(E=$d[Sn])!=null?E:Sn)!=null?ee:typeof a.value=="string"?a.value:"",St.startsWith("\\")&&(St+=" "),wr=Sn?Sn.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,wr?St=String.fromCodePoint(Number.parseInt("0x"+wr[1])):St.length>0&&St.startsWith("\\")&&(St=typeof a.value=="string"?a.value.charAt(0):a.command),St=Rv(St,a.style);break;case"mbin":case"mrel":case"minner":St=(ae=(re=$d[Sn])!=null?re:Fd[Sn])!=null?ae:a.value;break;case"mopen":case"mclose":St=a.value;break;case"mpunct":St=(de=Fd[Sn])!=null?de:Sn;break;case"mop":case"operator":case"extensible-symbol":a.value!=="\u200B"&&(Fd[Sn]?St=Fd[Sn]:St=Sn==="\\operatorname"?_o(a.body):(he=a.value)!=null?he:Sn,St+=" ");break;case"array":const tr=a.array,_r=a.environmentName,lr=(ge={bmatrix:["[","]"],"bmatrix*":["[","]"]}[_r])!=null?ge:["(",")"],si=[];for(const vi of tr){const Pa=[];for(const Ya of vi)Pa.push(lr[0]+_o(Ya)+lr[1]);si.push(Pa.join(","))}const Ii=(xe={bmatrix:["[","]"],"bmatrix*":["[","]"],cases:["{",":}"]}[_r])!=null?xe:["(",")"];St=Ii[0]+si.join(",")+Ii[1];break;case"box":break;case"spacing":St=(Re=$d[Sn])!=null?Re:" ";break;case"enclose":St="("+_o(a.body)+")";break;case"space":St=" ";break;case"subsup":St="";break;case"macro":St=(dt=(Ze=$d[Sn])!=null?Ze:Fd[Sn])!=null?dt:_o(a.body);break}if(!a.hasEmptyBranch("subscript")){St+="_";const gn=_o(a.subscript);St+=gn.length!==1?`(${gn})`:gn}if(!a.hasEmptyBranch("superscript")){St+="^";const gn=_o(a.superscript);St+=gn.length!==1?`(${gn})`:gn}return St}function Rv(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 La({from:pe(Se({},bu()),{renderPlaceholder:()=>new kr(160,{maxFontSize:1}),letterShapeStyle:(E=y==null?void 0:y.letterShapeStyle)!=null?E:"tex"}),mathstyle:y.mathstyle}),ae=new Un({mode:"math",type:"root",body:Xo(a,{context:ee,parseMode:"math",mathstyle:y.mathstyle})}).render(ee);return ae?(gu(Cd(ae,ee)),vu(ae,{classes:"ML__latex"}).toMarkup()):""}function _1(a){return t0(a,{context:bu()})}function Nv(a,y={}){return Ua(Xo(a,{parseMode:"math",args:()=>"",mathstyle:"displaystyle"}),y)}function Bv(a){const y=Xo(a,{parseMode:"math",mathstyle:"displaystyle"});return Fu(y)}var Yf;function $v(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 _o(new Un({type:"root",body:Xo(a,{parseMode:y})}))}function A1(a){return Oc(a,{format:"ascii-math"})[1]}function Zh(a){if(typeof a=="string"){const y=Fv(a);if(!y)throw new Error(`Invalid color: ${a}`);return y}return"C"in a?Kv(a):"a"in a?up(a):a}function zu(a){return a<0?0:a>255?255:Math.round(a)}function Fv(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 Vh(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,he=-1.2684380040921763*ee+2.6097574006633715*re-.3413193963102197*ae,ge=-.004196086541837188*ee-.7034186144594493*re+1.7076147009309444*ae,xe=Re=>{const Ze=Math.abs(Re);return Ze<=.0031308?Re*12.92:(Math.sign(Re)||1)*(1.055*Math.pow(Ze,1/2.4)-.055)};return[xe(de),xe(he),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=zu(b*255),E=zu(E*255),ee=zu(ee*255),y!==void 0?{r:b,g:E,b:ee,alpha:y}:{r:b,g:E,b:ee}}function up(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(Vh(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 he=.36/Math.pow(2,12);for(;ae-re>he;)de=(re+ae)/2,ee.C=de,[y,b,E]=jh(Vh(ee)),Gh([y,b,E])?re=de:ae=de;return Xh([y,b,E],a.alpha)}function Kv(a){return up(Vh(a))}function dp(a,y){const b=Zh(a),E=Zh(y),ee=.56,re=.57,ae=.62,de=.65,he=.022,ge=1.414,xe=.1,Re=5e-4,Ze=1.14,dt=.027,St=1.14,Sn=.027;function wr(vi){return vi>=he?vi:vi+Il(he-vi,ge)}function gn(vi){return(vi<0?-1:1)*Math.pow(Math.abs(vi),2.4)}const tr=wr(gn(E.r/255)*.2126729+gn(E.g/255)*.7151522+gn(E.b/255)*.072175),_r=wr(gn(b.r/255)*.2126729+gn(b.g/255)*.7151522+gn(b.b/255)*.072175);let lr,si,Ii;return Math.abs(_r-tr)<Re?si=0:_r>tr?(lr=Il(_r,ee)-Il(tr,re),si=lr*Ze):(lr=Il(_r,de)-Il(tr,ae),si=lr*St),Math.abs(si)<xe?Ii=0:si>0?Ii=si-Sn:Ii=si+dt,Ii*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=Zh(a);let b=((1<<24)+(zu(y.r)<<16)+(zu(y.g)<<8)+zu(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 Uv(a,y){return mo(a).length>0}function Zv(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 Vv(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(Ve))y.push({class:(Hv(fp(Ve[b]))==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${Ve[b]} "></span>`,ariaLabel:()=>{var E;return(E=ct(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(Xe))y.push({class:(fp(Xe[b])==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${Xe[b]} "></span>`,ariaLabel:()=>{var E;return(E=ct(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:()=>ct("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:()=>ct("menu.array.add row above"),id:"add-row-above",onMenuSelect:()=>a.executeCommand("addRowBefore"),visible:()=>jc(a)},{label:()=>ct("menu.array.add row below"),id:"add-row-below",onMenuSelect:()=>a.executeCommand("addRowAfter"),visible:()=>jc(a)},{label:()=>ct("menu.array.add column before"),id:"add-column-before",onMenuSelect:()=>a.executeCommand("addColumnBefore"),visible:()=>jc(a),enabled:()=>{const y=a.model.parentEnvironment;if(!y)return!1;const[b,E]=e1(a);return b<y.maxColumns}},{label:()=>ct("menu.array.add column after"),id:"add-column-after",onMenuSelect:()=>a.executeCommand("addColumnAfter"),visible:()=>jc(a)},{type:"divider"},{label:()=>ct("menu.array.delete row"),id:"delete-row",onMenuSelect:()=>a.executeCommand("removeRow"),visible:()=>jc(a)},{label:()=>ct("menu.array.delete column"),id:"delete-column",onMenuSelect:()=>a.executeCommand("removeColumn"),visible:()=>jc(a)},{type:"divider"},{label:()=>ct("menu.borders"),visible:()=>(Qv(a)||jc(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:()=>ct("menu.insert matrix"),id:"insert-matrix",visible:()=>a.isSelectionEditable,submenu:Yv(a),submenuClass:"insert-matrix-submenu",columnCount:5},{label:()=>ct("menu.mode"),id:"mode",visible:()=>a.isSelectionEditable&&a.model.selectionIsCollapsed,submenu:[{label:()=>ct("menu.mode-math"),id:"mode-math",onMenuSelect:()=>{Au(a,"accept-all"),a.executeCommand(["switchMode","math"])},checked:()=>a.model.mode==="math"},{label:()=>ct("menu.mode-text"),id:"mode-text",onMenuSelect:()=>{Au(a,"accept-all"),a.executeCommand(["switchMode","text"])},checked:()=>a.model.mode==="text"},{label:()=>ct("menu.mode-latex"),id:"mode-latex",onMenuSelect:()=>a.executeCommand(["switchMode","latex"]),checked:()=>a.model.mode==="latex"}]},{type:"divider"},{label:()=>ct("menu.font-style"),id:"variant",visible:()=>a.isSelectionEditable,submenu:Zv(a),submenuClass:"variant-submenu"},{label:()=>ct("menu.color"),id:"color",visible:()=>a.isSelectionEditable,submenu:Xv(a),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>ct("menu.background-color"),id:"background-color",visible:()=>a.isSelectionEditable,submenu:Gv(a),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>ct("menu.accent"),id:"accent",visible:()=>a.isSelectionEditable,submenu:Vv(a),submenuClass:"variant-submenu"},{label:()=>ct("menu.decoration"),id:"decoration",visible:()=>a.isSelectionEditable&&mo(a).length>0,submenu:jv(a),submenuClass:"variant-submenu"},{type:"divider"},{label:()=>ct("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:()=>ct("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?ct("menu.solve-for",qo(b)):ct("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:()=>ct("menu.cut"),onMenuSelect:()=>a.executeCommand("cutToClipboard"),visible:()=>!a.options.readOnly&&a.isSelectionEditable,keyboardShortcut:"meta+X"},{label:()=>ct("menu.copy"),id:"copy",submenu:[{label:()=>ct("menu.copy-as-latex"),id:"copy-latex",onMenuSelect:()=>ra.copyToClipboard(a,"latex"),keyboardShortcut:"meta+C"},{label:()=>ct("menu.copy-as-ascii-math"),id:"copy-ascii-math",onMenuSelect:()=>ra.copyToClipboard(a,"ascii-math")},{label:()=>ct("menu.copy-as-mathml"),id:"copy-math-ml",onMenuSelect:()=>ra.copyToClipboard(a,"math-ml")}]},{label:()=>ct("menu.paste"),id:"paste",onMenuSelect:()=>a.executeCommand("pasteFromClipboard"),visible:()=>a.hasEditableContent,keyboardShortcut:"meta+V"},{label:()=>ct("menu.select-all"),id:"select-all",keyboardShortcut:"meta+A",onMenuSelect:()=>a.executeCommand("selectAll")}]}function jc(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=ct(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=ct(E))!=null?ee:E},visible:()=>Uv(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 Ku(a,y){return a+Fu(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 Re=null;switch(xe){case"all":Re=re.root;break;case"selection":Re=re.getAtoms(re.selection);break;case"left":{Re=re.getAtoms(re.offsetOf(re.at(re.position).leftSibling),re.position);break}case"right":{Re=re.getAtoms(re.position,re.offsetOf(re.at(re.position).rightSibling));break}case"group":Re=re.getAtoms(re.getSiblingsRange(re.position));break;case"parent":{const{parent:Ze}=re.at(re.position);Ze!=null&&Ze.parent?Re=Ze:Re=re.root;break}default:Re=re.root}return Re}function de(xe){let Re="";switch(xe){case"all":console.log("Internal failure: speak all failed");break;case"selection":Re="no selection";break;case"left":Re="at start";break;case"right":Re="at end";break;case"group":console.log("Internal failure: speak group failed");break;case"parent":Re="no parent";break;default:console.log('unknown speak_ param value: "'+xe+'"');break}return Re}const he=ae(y);if(he===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=Fu(he);return kt()&&b.withHighlighting?(mc().readAloudMathfield=a,$c(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(!kt()){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),he=new Blob([de.buffer],{type:"audio/mpeg"}),ge=URL.createObjectURL(he);new Audio(ge).play().catch(Re=>console.log(Re))}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=Ku("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=Ku("",a.model.at(a.model.position));else if(y==="line"){const re=Ku("",a.model.root);a.keyboardDelegate.setAriaLabel(re)}else ee=E?Ku(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 Ku("",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+=Ku("",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=dc(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),he=this.at(ae[1]),ge=Un.commonAncestor(de,he);(ge==null?void 0:ge.type)==="array"&&de.parent===ge&&he.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(wu(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 he=[];for(let ge=ae;ge<=de;ge++){const xe=this.atoms[ge];mp(this,xe,ae,de)&&he.push(xe)}return E.includeChildren||(he=he.filter(ge=>{let xe=!1,{parent:Re}=ge;for(;Re&&!xe;)xe=mp(this,Re,ae,de),Re=Re.parent;return!xe})),he}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 Un({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 Un.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 Ua(a);if(b==="spoken")return Fu(a);if(b==="spoken-text"){const E=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="";const ee=Fu(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=Fu(a);return window.MathfieldElement.textToSpeechMarkup=E,ee}return b==="ascii-math"?_o(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):xu(a)?(E=[this.normalizeRange(a)],ee=y):wu(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 ya(E.map(ae=>Un.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,he=E!==this._anchor||ee!==this._position||Pc(this._selection,b)==="different";return this.silenceNotifications=re,a.content&&de&&this.contentDidChange({inputType:a.type}),a.selection&&he&&this.selectionDidChange(),de||he}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(xu(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 wu(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",pe(Se({},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,he,ge;const xe=b.parent;if(xe&&b instanceof Wa){const Re=!E&&y==="forward"||E==="body"&&y==="backward";let Ze=Re?a.offsetOf(b.firstChild):a.offsetOf(b.lastChild);return Re?b.rightDelim!=="?"&&b.rightDelim!=="."?(b.leftDelim=".",b.isDirty=!0):(xe.addChildrenAfter(b.removeBranch("body"),b),xe.removeChild(b),Ze--):b.leftDelim!=="?"&&b.leftDelim!=="."?(b.rightDelim=".",b.isDirty=!0):(xe.addChildrenAfter(b.removeBranch("body"),b),xe.removeChild(b),Ze--),a.position=Ze,!0}if(xe&&b.type==="surd"){if(y==="forward"&&!E||y==="backward"&&E==="body"){const Re=b.leftSibling;b.hasChildren&&xe.addChildrenAfter(b.removeBranch("body"),b),xe.removeChild(b),a.position=a.offsetOf(Re)}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 Re=E&&y==="backward"||!E&&y==="forward"?b.leftSibling:b.lastChild;return xe.addChildrenAfter(b.removeBranch("body"),b),xe.removeChild(b),a.position=a.offsetOf(Re),!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 Re=Hd.fractionNavigationOrder==="numerator-denominator"?"above":"below",Ze=Re==="above"?"below":"above";if(xe&&(y==="forward"&&E===Re||y==="backward"&&E===Ze)){const dt=b.removeBranch(Re),St=b.removeBranch(Ze);return xe.addChildrenAfter([...dt,...St],b),xe.removeChild(b),a.position=a.offsetOf(dt.length>0?dt[dt.length-1]:St[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 Re=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:(he=b.superscript)==null?void 0:he[0].lastSibling;return Re&&(a.position=a.offsetOf(Re)),!0}return!1}if(!b.hasChildren&&b.type==="subsup"){const Re=y==="forward"?a.offsetOf(b):Math.max(0,a.offsetOf(b)-1);return b.parent.removeChild(b),a.position=Re,!0}if(E==="superscript")if(y==="backward"){const Re=a.offsetOf(b.firstChild)-1;console.assert(Re>=0),a.position=Re}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 Re=y==="forward"?a.offsetOf(b):Math.max(0,a.offsetOf(b)-1);b.parent.removeChild(b),a.position=Re}return!0}if((xe==null?void 0:xe.type)==="genfrac"&&!E&&b.type!=="first"){let Re=a.offsetOf(b.leftSibling);return xe.removeChild(b),xe.hasEmptyBranch("above")&&xe.hasEmptyBranch("below")?(Re=a.offsetOf(xe.leftSibling),xe.parent.removeChild(xe),a.announce("delete",void 0,[xe]),a.position=Re,!0):(a.announce("delete",void 0,[b]),a.position=Re,!0)}if(y==="backward"&&((xe==null?void 0:xe.command)==="\\ln"||(xe==null?void 0:xe.command)==="\\log")&&b.parentBranch!=="body"){const Re=a.offsetOf(xe.leftSibling);return xe.parent.removeChild(xe),a.announce("delete",void 0,[xe]),a.position=Re,!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])}}):kl(a,jo(a.selection),"deleteContentBackward")}function c1(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])}):kl(a,jo(a.selection),"deleteContentForward")}function kl(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 he=E[0].parent;he.parent&&he.type!=="prompt"&&(y=[a.offsetOf(he.leftSibling),a.offsetOf(he)])}if(E.length===1&&E[0].type==="placeholder"&&E[0].parent.type==="genfrac"){const he=E[0].parent,ge=E[0].parentBranch==="below"?"above":"below",xe=a.offsetOf(he.leftSibling);return a.deferNotifications({content:!0,selection:!0,type:b},()=>{var Re,Ze;const dt=he.removeBranch(ge);if(dt.length===1&&dt[0].type==="placeholder")(Ze=he.parent)==null||Ze.removeChild(he),a.position=Math.max(0,xe);else{const St=he.parent.addChildrenAfter(dt,he);(Re=he.parent)==null||Re.removeChild(he),a.position=a.offsetOf(St)}})}}return a.deferNotifications({content:!0,selection:!0,type:b},()=>a.deleteAtoms(y))}Ls({deleteAll:a=>a.contentWillChange({inputType:"deleteContent"})&&kl(a,[0,-1],"deleteContent"),deleteForward:a=>c1(a),deleteBackward:a=>l1(a),deleteNextWord:a=>a.contentWillChange({inputType:"deleteWordForward"})&&kl(a,[a.anchor,_h(a,a.position,"forward")],"deleteWordForward"),deletePreviousWord:a=>a.contentWillChange({inputType:"deleteWordBackward"})&&kl(a,[a.anchor,_h(a,a.position,"backward")],"deleteWordBackward"),deleteToGroupStart:a=>a.contentWillChange({inputType:"deleteSoftLineBackward"})&&kl(a,[a.anchor,a.offsetOf(a.at(a.position).firstSibling)],"deleteSoftLineBackward"),deleteToGroupEnd:a=>a.contentWillChange({inputType:"deleteSoftLineForward"})&&kl(a,[a.anchor,a.offsetOf(a.at(a.position).lastSibling)],"deleteSoftLineForward"),deleteToMathFieldStart:a=>a.contentWillChange({inputType:"deleteHardLineBackward"})&&kl(a,[a.anchor,0],"deleteHardLineBackward"),deleteToMathFieldEnd:a=>a.contentWillChange({inputType:"deleteHardLineForward"})&&kl(a,[a.anchor,-1],"deleteHardLineForward")},{target:"model",audioFeedback:"delete",canUndo:!0,changeContent:!0,changeSelection:!0});var u1=`<svg xmlns="http://www.w3.org/2000/svg" style="width: 21px;" viewBox="0 0 576 512" role="img" aria-label="${ct("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="${ct("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=Se(pe(Se({},Rf()),{macros:Gr(),registers:oc()}),Of(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),he=new Un({type:"root",mode:de,body:Xo(ae,{context:this.context})});this.model=new s1(this,de,he),this.undoManager=new Bg(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(u1),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=nt.subscribe(()=>nt.update(this.element)),nt.update(this.element),this.field=this.element.querySelector("[part=content]"),this.field.addEventListener("click",Re=>Re.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",Re=>{if(Re.currentTarget!==xe||this._menu.state!=="closed")return;this.element.classList.add("tracking");const Ze=xe.getBoundingClientRect();this._menu.modifiers=Bc(Re),this._menu.show({target:xe,location:{x:Ze.left,y:Ze.bottom},onDismiss:()=>this.element.classList.remove("tracking")}),Re.preventDefault(),Re.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}),kd&&!nt.locale.startsWith(kd.locale)&&$m(nt.locale),$s!=="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,$h())}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:Mt(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:je(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=Un.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=Se({},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 he of Object.keys(y)){const ge=this.queryStyle({[he]:y[he]});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 he of re){if(he.type==="first"){ae-=1;continue}he.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=_d())!=null?a:Fm());return((y=_d())==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=Se(Se({},this.options),Of(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=Un.serialize([this.model.root],{expandMacro:!1,defaultMode:this.options.defaultMode});("macros"in a||this.model.getValue()!==E)&&ra.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 zc(this.options,a)}getOption(a){return zc(this.options,a)}handleEvent(a){return gc(this,null,function*(){var y;if(Rs(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(Du(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"&&U0(this,a);break;case"pointerdown":this.userSelect!=="none"&&(U0(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(()=>Rs(this)&&this.onGeometryChange());break;case"scroll":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Rs(this)&&this.onGeometryChange());break;case"wheel":this.onWheel(a);break;default:console.warn("Unexpected event type",a.type)}}})}dispose(){if(!Rs(this))return;nt.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 Du(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();ra.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&&$c(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&&Je()&&navigator.vibrate(S0),window.MathfieldElement.playSound("keypress")),a==="\\\\"?T0(this.model):a==="&"?D0(this.model):this.model.selectionIsCollapsed?ra.insert(this.model,a,Se({style:this.model.at(this.model.position).computedStyle},y)):ra.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 he=Xo(y,{context:this.context,parseMode:a});ae.collapseSelection("forward");const ge=ae.at(ae.position);ae.position=ae.offsetOf(ge.parent.addChildrenAfter(he,ge)),de=!0}if(this.model.mode=a,a==="latex"){let he=ae.selectionIsCollapsed;Au(this,"accept");let ge,xe=ae.at(ae.position);if(he)ge="\\";else{const Ze=jo(ae.selection);ge=this.model.getValue(Ze,"latex");const dt=this.model.extractAtoms(Ze);dt.length===1&&dt[0].type==="placeholder"&&(ge=y,he=!0),xe=ae.at(Ze[0])}const Re=new xd(ge);xe.parent.addChildAfter(Re,xe),he?ae.position=ae.offsetOf(Re.lastChild):ae.setSelection(ae.offsetOf(Re.firstChild),ae.offsetOf(Re.lastChild))}else Ld(ae).forEach(he=>{he.isError=!1});if(b){const he=Xo(b,{context:this.context,parseMode:re});ae.collapseSelection("forward");const ge=ae.at(ae.position);ae.position=ae.offsetOf(ge.parent.addChildrenAfter(he,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};xu(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=Se(Se({},this.defaultStyle),re);return}const de=Se({},this.defaultStyle);for(const he of Object.keys(re))de[he]===re[he]?(he==="color"&&delete de.verbatimColor,he==="backgroundColor"&&delete de.verbatimBackgroundColor,delete de[he]):de[he]=re[he];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=Nd(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,pe(Se({},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"?(Au(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",pe(Se({},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(),$c(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="",Tu(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,$h();const E=new AbortController,ee=E.signal;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&document.addEventListener("visibilitychange",()=>{Rs(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(()=>{$c(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(),ra.onCopy(this,a),kl(this.model,jo(this.model.selection),"deleteByCut"),this.snapshot("cut"),Mo(this))}onCopy(a){ra.onCopy(this,a)}onPaste(a){let y=this.isSelectionEditable;return y&&(y=ra.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(),kf(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=>Vn(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(!kt())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"]};mc().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));mc().readAloudMarks=de.split(`
`).map(he=>he?JSON.parse(he):{}),mc().readAloudTokens=[];for(const he of mc().readAloudMarks)he.value&&mc().readAloudTokens.push(he.value);mc().readAloudCurrentMark="",ee.OutputFormat="mp3",ee.SpeechMarkTypes=[],E.synthesizeSpeech(ee,(he,ge)=>{if(he){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech("${y}") error:${he}`);return}if(!(ge!=null&&ge.AudioStream))return;const xe=new Uint8Array(ge.AudioStream),Re=new Blob([xe.buffer],{type:"audio/mpeg"}),Ze=URL.createObjectURL(Re),dt=mc();dt.readAloudAudio?dt.readAloudAudio.pause():(dt.readAloudAudio=new Audio,dt.readAloudAudio.addEventListener("ended",()=>{const St=dt.readAloudMathfield;dt.readAloudStatus="ended",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),St?($c(St),dt.readAloudElement=null,dt.readAloudMathfield=null,dt.readAloudTokens=[],dt.readAloudMarks=[],dt.readAloudCurrentMark=""):gp(dt.readAloudElement)}),dt.readAloudAudio.addEventListener("timeupdate",()=>{let St="";const Sn=dt.readAloudAudio.currentTime*1e3+100;for(const wr of dt.readAloudMarks)wr.time<Sn&&(St=wr.value);dt.readAloudCurrentMark!==St&&(dt.readAloudCurrentToken=St,St&&St===dt.readAloudFinalToken?dt.readAloudAudio.pause():(dt.readAloudCurrentMark=St,Qh(dt.readAloudElement,dt.readAloudCurrentMark)))})),dt.readAloudAudio.src=Ze,dt.readAloudStatus="playing",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),dt.readAloudAudio.play()})})}kt()||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 Na=new WeakMap,p1=.5,pc={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 Gc extends HTMLElement{static get formAssociated(){return Hu()}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 nt.locale}static set locale(y){y==="auto"&&(y=navigator.language.slice(0,5)),nt.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 nt.strings}static set strings(y){nt.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 gc(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 gc(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(pc[E])if(pc[E].startsWith("mf."))if(pc[E].startsWith(`mf.${E}`))b.push(`Option \`${E}\` cannot be used as a constructor option. Use ${pc[E]}`);else{const ee=pc[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 ${pc[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(Hu()&&(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=[uc("core"),uc("mathfield"),uc("mathfield-element"),uc("ui"),uc("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=Gc.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?zc(this._mathfield.options,y):Na.has(this)?Se({},zc(Se(Se({},Rf()),Of(Na.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?zc(this._mathfield.options,y):Na.has(this)?zc(Se(Se({},Rf()),Of(Na.get(this).options)),y):null}reflectAttributes(){const y=Rf(),b=this._getOptions();Object.keys(Gc.optionsAttributes).forEach(E=>{const ee=Vl(E);Gc.optionsAttributes[E]==="on/off"?y[ee]!==b[ee]?this.setAttribute(E,b[ee]?"on":"off"):this.removeAttribute(E):y[ee]!==b[ee]&&(Gc.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(Na.has(this)){const b=Se(Se({},Na.get(this).options),y);Na.set(this,pe(Se({},Na.get(this)),{selection:{ranges:b.readOnly?[[0,0]]:[[0,-1]]},options:b}))}else Na.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))pc[b]&&console.warn(`\`mf.setOptions({${b}:...})\` -> ${pc[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(Na.has(this)){let ae,de,he;if(wu(y)?([ae,de]=y.ranges[0],he=b):xu(y)?([ae,de]=y,he=b):gl(y)&&gl(b)?(ae=y,de=b,he=E):(ae=0,de=-1,he=y),(he===void 0||he==="latex")&&ae===0&&de===-1)return(re=(ee=Na.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(Na.has(this)){const ee=Na.get(this).options;Na.set(this,{value:y,selection:{ranges:[[-1,-1]],direction:"forward"},options:ee,menuItems:void 0});return}const E=Wd(this);Na.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?Nd(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=lc(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),Hu()||(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 he=ae.querySelector("slot:not([name])");if(he)try{this._style=he.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=he==null?void 0:he.assignedNodes().map(xe=>xe.nodeType===3?xe.textContent:"").join("").trim())!=null?y:"",this._mathfield=new f1(ae.querySelector(":host > span"),pe(Se({},(E=(b=Na.get(this))==null?void 0:b.options)!=null?E:Wd(this)),{eventSink:this,value:ge})),!Na.has(this)){this.upgradeProperty("disabled"),this.upgradeProperty("readonly");for(const xe of Object.keys(Gc.optionsAttributes))this.upgradeProperty(Vl(xe))}if(!((ee=this._mathfield)!=null&&ee.model)){this._mathfield=null;return}if(Na.has(this)){const xe=this._mathfield,Re=Na.get(this),Ze=Re.menuItems;xe.model.deferNotifications({content:!1,selection:!1},()=>{const dt=Re.value;dt!==void 0&&xe.setValue(dt),xe.model.selection=Re.selection,Na.delete(this)}),Ze&&(this.menuItems=Ze)}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=zc(this._mathfield.options,Object.keys(Gc.optionsAttributes).map(ee=>Vl(ee)));Na.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",""),Hu()?this._internals.ariaReadOnly="true":this.setAttribute("aria-readonly","true"),this.setAttribute("aria-readonly","true")):(Hu()?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"),Hu()?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:pe(Se({},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=Na.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}Na.has(this)?Na.set(this,pe(Se({},Na.get(this)),{menuItems:y})):Na.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:Na.has(this)?Na.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(Na.has(this)){Na.set(this,pe(Se({},Na.get(this)),{selection:y}));return}Na.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:Na.has(this)?Na.get(this).selection.ranges[0][0]:0}set position(y){if(this._mathfield&&(this._mathfield.model.position=y,Mo(this._mathfield)),Na.has(this)){Na.set(this,pe(Se({},Na.get(this)),{selection:{ranges:[[y,y]]}}));return}Na.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 Vl(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[Vl(E)]=!0:b[E]==="on/off"?ee==="on"?y[Vl(E)]=!0:ee==="off"?y[Vl(E)]=!1:y[Vl(E)]=void 0:b[E]==="number"?y[Vl(E)]=Number.parseFloat(ee!=null?ee:"0"):y[Vl(E)]=ee}}),y}function Hu(){return!(!("ElementInternals"in window)||!HTMLElement.prototype.attachInternals||!("role"in window.ElementInternals.prototype))}var vp=Hd,yp,bp,xp,wp;if(kt()&&!((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 he=!0,ge=0,xe;xe=de.indexOf(y),xe!==-1&&(ge=xe,ge>0&&re.push({type:"text",data:de.slice(0,ge)}),he=!1);let Re=!1;for(;!Re;){if(he){if(xe=de.indexOf(y,ge),xe===-1){Re=!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){Re=!0;break}let Ze=de.slice(ge+y.length,xe);ee==="ascii-math"&&([,Ze]=Oc(Ze,{format:"ascii-math"})),re.push({type:"math",data:Ze,rawData:de.slice(ge,xe+b.length),mathstyle:E}),ge=xe+b.length}he=!he}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 Wu(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 he=document.createElement("span");he.setAttribute("translate","no");const ge=b.renderToSpeakableText(a);he.innerHTML=window.MathfieldElement.createHTML(ge),he.className="ML__sr-only",de.append(he)}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=Wu(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 he=Wu(de.data,de.mathstyle==="textstyle"?"textstyle":"displaystyle",y,!0);he&&re.appendChild(he)}}return re}function Cp(a,y){var b,E,ee,re,ae,de,he,ge,xe,Re,Ze,dt,St,Sn,wr,gn;if(a.childNodes.length===1&&a.childNodes[0].nodeType===3){const tr=(b=a.childNodes[0].textContent)!=null?b:"";if((E=y.TeX)!=null&&E.processEnvironments&&/^\s*\\begin/.test(tr)){a.textContent="";const lr=Wu(tr,"",y,!0);lr&&a.append(lr);return}const _r=Sp(tr,(ee=y.TeX)==null?void 0:ee.delimiters,(re=y.asciiMath)==null?void 0:re.delimiters);if(_r.length===1&&_r[0].type==="math"){a.textContent="";const lr=Wu(_r[0].data,_r[0].mathstyle==="textstyle"?"textstyle":"displaystyle",y,!0);lr&&a.append(lr);return}if(_r.length===1&&_r[0].type==="text")return}for(let tr=a.childNodes.length-1;tr>=0;tr--){const _r=a.childNodes[tr];if(_r.nodeType===3){const lr=y1((ae=_r.textContent)!=null?ae:"",y);lr&&(tr+=lr.childNodes.length-1,_r.replaceWith(lr))}else if(_r.nodeType===1){const lr=_r,si=_r.nodeName.toLowerCase();if(si==="script"){const Ii=_r;let vi;if((de=y.processScriptTypePattern)!=null&&de.test(Ii.type))vi=(he=Ii.textContent)!=null?he:"";else if((ge=y.processMathJSONScriptTypePattern)!=null&&ge.test(Ii.type))try{vi=(Re=y.serializeToLatex)==null?void 0:Re.call(y,JSON.parse((xe=Ii.textContent)!=null?xe:""))}catch(Pa){console.error(Pa)}if(vi){let Pa="textstyle";for(const Rr of Ii.type.split(";")){const[Fs,_l]=Rr.toLowerCase().split("=");Fs.trim()==="mode"&&(Pa=_l.trim()==="display"?"displaystyle":"textstyle")}const Ya=Wu(vi,Pa,y,!0);Ya&&Ii.parentNode.replaceChild(Ya,Ii)}}else if(((dt=(Ze=y.processClassPattern)==null?void 0:Ze.test(lr.className))!=null?dt:!1)||!((Sn=(St=y.skipTags)==null?void 0:St.includes(si))!=null&&Sn||(gn=(wr=y.ignoreClassPattern)==null?void 0:wr.test(lr.className))!=null&&gn))if(a.childNodes.length===1&&a.childNodes[0].nodeType===3){const vi=a.textContent;a.textContent="";const Pa=Wu(vi!=null?vi:"","displaystyle",y,!0);Pa&&a.append(Pa)}else Cp(lr,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=Se(Se({},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(),_s("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=fc.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 mc(){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=Nv),(ee=de.renderToSpeakableText)!=null||(de.renderToSpeakableText=Bv),(re=de.serializeToLatex)!=null||(de.serializeToLatex=$v),x1(ae,de)}var I1={mathlive:"0.98.5"}},17423:function(Ln,qt,ce){"use strict";ce.d(qt,{Z:function(){return Se}});const fe=pe=>typeof pe=="object"&&pe!=null&&pe.nodeType===1,tt=(pe,Te)=>(!Te||pe!=="hidden")&&pe!=="visible"&&pe!=="clip",Fe=(pe,Te)=>{if(pe.clientHeight<pe.scrollHeight||pe.clientWidth<pe.scrollWidth){const gt=getComputedStyle(pe,null);return tt(gt.overflowY,Te)||tt(gt.overflowX,Te)||(ze=>{const Pt=(kt=>{if(!kt.ownerDocument||!kt.ownerDocument.defaultView)return null;try{return kt.ownerDocument.defaultView.frameElement}catch(pt){return null}})(ze);return!!Pt&&(Pt.clientHeight<ze.scrollHeight||Pt.clientWidth<ze.scrollWidth)})(pe)}return!1},Ye=(pe,Te,gt,ze,Pt,kt,pt,Je)=>kt<pe&&pt>Te||kt>pe&&pt<Te?0:kt<=pe&&Je<=gt||pt>=Te&&Je>=gt?kt-pe-ze:pt>Te&&Je<gt||kt<pe&&Je>gt?pt-Te+Pt:0,be=pe=>{const Te=pe.parentElement;return Te==null?pe.getRootNode().host||null:Te},_e=(pe,Te)=>{var gt,ze,Pt,kt;if(typeof document=="undefined")return[];const{scrollMode:pt,block:Je,inline:De,boundary:Dt,skipOverflowHiddenElements:Yt}=Te,nt=typeof Dt=="function"?Dt:bn=>bn!==Dt;if(!fe(pe))throw new TypeError("Invalid target");const ct=document.scrollingElement||document.documentElement,Ie=[];let Me=pe;for(;fe(Me)&&nt(Me);){if(Me=be(Me),Me===ct){Ie.push(Me);break}Me!=null&&Me===document.body&&Fe(Me)&&!Fe(document.documentElement)||Me!=null&&Fe(Me,Yt)&&Ie.push(Me)}const Ve=(ze=(gt=window.visualViewport)==null?void 0:gt.width)!=null?ze:innerWidth,Xe=(kt=(Pt=window.visualViewport)==null?void 0:Pt.height)!=null?kt:innerHeight,{scrollX:Ct,scrollY:wt}=window,{height:Mt,width:je,top:Rt,right:At,bottom:xn,left:jt}=pe.getBoundingClientRect(),{top:vn,right:er,bottom:Sr,left:qe}=(bn=>{const at=window.getComputedStyle(bn);return{top:parseFloat(at.scrollMarginTop)||0,right:parseFloat(at.scrollMarginRight)||0,bottom:parseFloat(at.scrollMarginBottom)||0,left:parseFloat(at.scrollMarginLeft)||0}})(pe);let Ae=Je==="start"||Je==="nearest"?Rt-vn:Je==="end"?xn+Sr:Rt+Mt/2-vn+Sr,$t=De==="center"?jt+je/2-qe+er:De==="end"?At+er:jt-qe;const Hn=[];for(let bn=0;bn<Ie.length;bn++){const at=Ie[bn],{height:ft,width:Gt,top:zn,right:mn,bottom:nn,left:Ft}=at.getBoundingClientRect();if(pt==="if-needed"&&Rt>=0&&jt>=0&&xn<=Xe&&At<=Ve&&Rt>=zn&&xn<=nn&&jt>=Ft&&At<=mn)return Hn;const Pn=getComputedStyle(at),_n=parseInt(Pn.borderLeftWidth,10),Ee=parseInt(Pn.borderTopWidth,10),ue=parseInt(Pn.borderRightWidth,10),se=parseInt(Pn.borderBottomWidth,10);let ye=0,ve=0;const le="offsetWidth"in at?at.offsetWidth-at.clientWidth-_n-ue:0,We="offsetHeight"in at?at.offsetHeight-at.clientHeight-Ee-se:0,Lt="offsetWidth"in at?at.offsetWidth===0?0:Gt/at.offsetWidth:0,tn="offsetHeight"in at?at.offsetHeight===0?0:ft/at.offsetHeight:0;if(ct===at)ye=Je==="start"?Ae:Je==="end"?Ae-Xe:Je==="nearest"?Ye(wt,wt+Xe,Xe,Ee,se,wt+Ae,wt+Ae+Mt,Mt):Ae-Xe/2,ve=De==="start"?$t:De==="center"?$t-Ve/2:De==="end"?$t-Ve:Ye(Ct,Ct+Ve,Ve,_n,ue,Ct+$t,Ct+$t+je,je),ye=Math.max(0,ye+wt),ve=Math.max(0,ve+Ct);else{ye=Je==="start"?Ae-zn-Ee:Je==="end"?Ae-nn+se+We:Je==="nearest"?Ye(zn,nn,ft,Ee,se+We,Ae,Ae+Mt,Mt):Ae-(zn+ft/2)+We/2,ve=De==="start"?$t-Ft-_n:De==="center"?$t-(Ft+Gt/2)+le/2:De==="end"?$t-mn+ue+le:Ye(Ft,mn,Gt,_n,ue+le,$t,$t+je,je);const{scrollLeft:hn,scrollTop:sn}=at;ye=tn===0?0:Math.max(0,Math.min(sn+ye/tn,at.scrollHeight-ft/tn+We)),ve=Lt===0?0:Math.max(0,Math.min(hn+ve/Lt,at.scrollWidth-Gt/Lt+le)),Ae+=sn-ye,$t+=hn-ve}Hn.push({el:at,top:ye,left:ve})}return Hn},Le=pe=>pe===!1?{block:"end",inline:"nearest"}:(Te=>Te===Object(Te)&&Object.keys(Te).length!==0)(pe)?pe:{block:"start",inline:"nearest"};function Se(pe,Te){if(!pe.isConnected||!(Pt=>{let kt=Pt;for(;kt&&kt.parentNode;){if(kt.parentNode===document)return!0;kt=kt.parentNode instanceof ShadowRoot?kt.parentNode.host:kt.parentNode}return!1})(pe))return;const gt=(Pt=>{const kt=window.getComputedStyle(Pt);return{top:parseFloat(kt.scrollMarginTop)||0,right:parseFloat(kt.scrollMarginRight)||0,bottom:parseFloat(kt.scrollMarginBottom)||0,left:parseFloat(kt.scrollMarginLeft)||0}})(pe);if((Pt=>typeof Pt=="object"&&typeof Pt.behavior=="function")(Te))return Te.behavior(_e(pe,Te));const ze=typeof Te=="boolean"||Te==null?void 0:Te.behavior;for(const{el:Pt,top:kt,left:pt}of _e(pe,Le(Te))){const Je=kt-gt.top+gt.bottom,De=pt-gt.left+gt.right;Pt.scroll({top:Je,left:De,behavior:ze})}}}}]);
}());