|
|
!(function(){var Ys=Math.pow;var zl=(kn,cn,ue)=>new Promise((me,je)=>{var Ke=Ae=>{try{be(ue.next(Ae))}catch(Ne){je(Ne)}},ot=Ae=>{try{be(ue.throw(Ae))}catch(Ne){je(Ne)}},be=Ae=>Ae.done?me(Ae.value):Promise.resolve(Ae.value).then(Ke,ot);be((ue=ue.apply(kn,cn)).next())});(self.webpackChunk=self.webpackChunk||[]).push([[6820],{40001:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Ce}});var me=ue(60499),je=ue(59301),Ke={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"},ot=Ke,be=ue(7657),Ae=function(ze,ut){return je.createElement(be.Z,(0,me.Z)({},ze,{ref:ut,icon:ot}))},Ne=je.forwardRef(Ae),Ce=Ne},26227:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Ce}});var me=ue(60499),je=ue(59301),Ke={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"},ot=Ke,be=ue(7657),Ae=function(ze,ut){return je.createElement(be.Z,(0,me.Z)({},ze,{ref:ut,icon:ot}))},Ne=je.forwardRef(Ae),Ce=Ne},84105:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Ce}});var me=ue(60499),je=ue(59301),Ke={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"},ot=Ke,be=ue(7657),Ae=function(ze,ut){return je.createElement(be.Z,(0,me.Z)({},ze,{ref:ut,icon:ot}))},Ne=je.forwardRef(Ae),Ce=Ne},41464:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Ce}});var me=ue(60499),je=ue(59301),Ke={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"},ot=Ke,be=ue(7657),Ae=function(ze,ut){return je.createElement(be.Z,(0,me.Z)({},ze,{ref:ut,icon:ot}))},Ne=je.forwardRef(Ae),Ce=Ne},18785:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Ce}});var me=ue(60499),je=ue(59301),Ke={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"},ot=Ke,be=ue(7657),Ae=function(ze,ut){return je.createElement(be.Z,(0,me.Z)({},ze,{ref:ut,icon:ot}))},Ne=je.forwardRef(Ae),Ce=Ne},73331:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Ce}});var me=ue(60499),je=ue(59301),Ke={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"},ot=Ke,be=ue(7657),Ae=function(ze,ut){return je.createElement(be.Z,(0,me.Z)({},ze,{ref:ut,icon:ot}))},Ne=je.forwardRef(Ae),Ce=Ne},15277:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Ce}});var me=ue(60499),je=ue(59301),Ke={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"},ot=Ke,be=ue(7657),Ae=function(ze,ut){return je.createElement(be.Z,(0,me.Z)({},ze,{ref:ut,icon:ot}))},Ne=je.forwardRef(Ae),Ce=Ne},33853:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Ce}});var me=ue(60499),je=ue(59301),Ke={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},ot=Ke,be=ue(7657),Ae=function(ze,ut){return je.createElement(be.Z,(0,me.Z)({},ze,{ref:ut,icon:ot}))},Ne=je.forwardRef(Ae),Ce=Ne},62772:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Ce}});var me=ue(60499),je=ue(59301),Ke={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"},ot=Ke,be=ue(7657),Ae=function(ze,ut){return je.createElement(be.Z,(0,me.Z)({},ze,{ref:ut,icon:ot}))},Ne=je.forwardRef(Ae),Ce=Ne},61485:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Ce}});var me=ue(60499),je=ue(59301),Ke={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"},ot=Ke,be=ue(7657),Ae=function(ze,ut){return je.createElement(be.Z,(0,me.Z)({},ze,{ref:ut,icon:ot}))},Ne=je.forwardRef(Ae),Ce=Ne},38819:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Ce}});var me=ue(60499),je=ue(59301),Ke={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},ot=Ke,be=ue(7657),Ae=function(ze,ut){return je.createElement(be.Z,(0,me.Z)({},ze,{ref:ut,icon:ot}))},Ne=je.forwardRef(Ae),Ce=Ne},47472:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Ce}});var me=ue(60499),je=ue(59301),Ke={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"},ot=Ke,be=ue(7657),Ae=function(ze,ut){return je.createElement(be.Z,(0,me.Z)({},ze,{ref:ut,icon:ot}))},Ne=je.forwardRef(Ae),Ce=Ne},87395:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Ce}});var me=ue(60499),je=ue(59301),Ke={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"},ot=Ke,be=ue(7657),Ae=function(ze,ut){return je.createElement(be.Z,(0,me.Z)({},ze,{ref:ut,icon:ot}))},Ne=je.forwardRef(Ae),Ce=Ne},14618:function(){"use strict"},66552:function(){"use strict"},18760:function(kn,cn){"use strict";cn.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},3352: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 kn={},cn="5.0",ue={},me=null,je=!1,Ke=!1,ot=null,be=!1,Ae=null,Ne=null,Ce=0;Ce<arguments.length;Ce++){var Me=arguments[Ce];if(Me!==null)switch(typeof Me){case"number":cn=Me.toFixed(1);break;case"string":Me.match(new RegExp("^[0-9]\\.[0-9]+$"))?cn=Me:ot=Me;break;case"object":typeof Me.is3D!="undefined"?me=Me:ue=Me;break;case"boolean":je=Me,Ke=!0;break}}me===null&&(me={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},ue.material_id!==void 0&&!Ke&&(je=!0)),ot!==null&&ue.id===void 0&&(ue.id=ot);var ze="",ut="",Le=!1,We=null,yt=null,et=null,pt=!1,at=null,St=null,Qt=null,nt=null,ft=null;ue.height!==void 0&&(ue.height=Math.round(ue.height)),ue.width!==void 0&&(ue.width=Math.round(ue.width));var Ze=function(Xe){return parseFloat(Xe)>4?parseFloat(Xe):5};kn.setHTML5Codebase=function(Xe,Ye){Ne=Xe,ht(Xe,Ye)},kn.setJavaCodebase=kn.setJavaCodebaseVersion=kn.isCompiledInstalled=kn.setPreCompiledScriptPath=kn.setPreCompiledResourcePath=function(){},kn.setHTML5CodebaseVersion=function(Xe,Ye){var Dt=parseFloat(Xe);if(Dt!==NaN&&Dt<5){console.log("The GeoGebra HTML5 codebase version "+Dt+" is deprecated. Using version latest instead.");return}Ae=Xe,xe(Xe,Ye)},kn.getHTML5CodebaseVersion=function(){return yt},kn.getParameters=function(){return ue},kn.setFontsCSSURL=function(Xe){nt=Xe},kn.setGiacJSURL=function(Xe){},kn.setJNLPFile=function(Xe){ze=Xe},kn.setJNLPBaseDir=function(Xe){},kn.inject=function(){function Xe(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var Ye="auto",Dt=ue.id,bn,tn=!1,un=0;un<arguments.length;un++){var Vt=arguments[un];typeof Vt=="string"?(Vt=Vt.toLowerCase(),Vt.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?Ye=Vt:Dt=arguments[un]):typeof Vt=="boolean"?tn=Vt:Vt instanceof HTMLElement&&(bn=Vt)}Gt();function Gt(){if(!be){setTimeout(Gt,200);return}Ye=mt(Ye);var Wt=bn||document.getElementById(Dt);if(!Wt){console.log("possibly bug on ajax loading? ");return}if(kn.removeExistingApplet(Wt,!1),ue.width===void 0&&Wt.clientWidth&&(ue.width=Wt.clientWidth),ue.height===void 0&&Wt.clientHeight&&(ue.height=Wt.clientHeight),!(ue.width&&ue.height)&&Ye==="html5"&&(delete ue.width,delete ue.height),We=Ye,Ye==="screenshot")Qe(Wt,ue);else{var ye=!1;ue.hasOwnProperty("playButton")&&ue.playButton||ue.hasOwnProperty("clickToLoad")&&ue.clickToLoad?ye=!0:ue.hasOwnProperty("playButtonAutoDecide")&&ue.playButtonAutoDecide&&(ye=(!ke()||Xe())&&He()),ye?(We="screenshot",ct(Wt,ue,tn,Ye)):Bt(Wt,ue,tn)}}};function ke(){try{return window.self!==window.top}catch(Xe){return!0}}function He(){return ue.hasOwnProperty("screenshotGenerator")&&ue.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}kn.getViews=function(){return me},kn.isJavaInstalled=function(){return!1};var Ue=function(Xe){var Ye=function(un){var Vt=JSON.parse(un),Gt=function(se){return se.type=="G"||se.type=="E"},Wt=Vt.elements?Vt.elements.filter(Gt)[0]:Vt;if(!Wt||!Wt.url){Dt();return}ue.fileName=Wt.url,bt(Wt.settings||{}),me.is3D=!0;var ye="https://www.geogebra.org/images/";kn.setPreviewImage(at||Wt.previewUrl,ye+"GeoGebra_loading.png",ye+"applet_play.png"),Xe()},Dt=function(){ue.onError&&ue.onError(),nn("Error: Fetching material (id "+ue.material_id+") failed.",ue)},bn=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",tn="/materials/"+ue.material_id+"?scope=basic";Ve("https://"+bn+"/api/proxy.php?path="+encodeURIComponent(tn),Ye,Dt)};function bt(Xe){var Ye=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(Dt){Xe[Dt]=!!Xe[Dt]}),Ye.forEach(function(Dt){ue[Dt]===void 0&&Xe[Dt]!==void 0&&(ue[Dt]=Xe[Dt])}),ue.showToolBarHelp===void 0&&(ue.showToolBarHelp=ue.showToolBar)}function Ve(Xe,Ye,Dt){var bn=new XMLHttpRequest;bn.open("GET",Xe),bn.onload=function(){Ye(bn.responseText)},bn.onerror=Dt,bn.send()}kn.isHTML5Installed=function(){return!0},kn.getLoadedAppletType=function(){return We},kn.setPreviewImage=function(Xe,Ye,Dt){at=Xe,St=Ye,Qt=Dt},kn.removeExistingApplet=function(Xe,Ye){var Dt;typeof Xe=="string"&&(Xe=document.getElementById(Xe)),We=null;var bn=null;for(Dt=0;Dt<Xe.childNodes.length;Dt++){var tn=Xe.childNodes[Dt],un=tn.className;un==="applet_screenshot"?Ye?(tn.style.display="block",We="screenshot"):tn.style.display="none":un!=="applet_scaler prerender"&&(Xe.removeChild(tn),bn=un&&un.indexOf("appletParameters")!=-1?tn.id:null,Dt--)}var Vt=ue.id!==void 0?ue.id:bn,Gt=window[Vt];Gt&&typeof Gt.getBase64=="function"&&(Gt.remove(),window[Vt]=null)},kn.refreshHitPoints=function(){if(Ze(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var Xe=kn.getAppletObject();return Xe&&typeof Xe.recalculateEnvironments=="function"?(Xe.recalculateEnvironments(),!0):!1},kn.startAnimation=function(){var Xe=kn.getAppletObject();return Xe&&typeof Xe.startAnimation=="function"?(Xe.startAnimation(),!0):!1},kn.stopAnimation=function(){var Xe=kn.getAppletObject();return Xe&&typeof Xe.stopAnimation=="function"?(Xe.stopAnimation(),!0):!1},kn.getAppletObject=function(){var Xe=ue.id!==void 0?ue.id:"ggbApplet";return window[Xe]},kn.resize=function(){};var jt=function(Xe,Ye,Dt){var bn=document.createElement("param");bn.setAttribute("name",Ye),bn.setAttribute("value",Dt),Xe.appendChild(bn)},st=function(Xe){return Xe&&Xe!=="false"},Bt=function(Xe,Ye,Dt){Ze(yt)<=4.2&&(Dt=!0);var bn=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==yt||ggbHTML5LoadedCodebaseIsWebSimple&&!pt)&&(bn=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var tn=document.createElement("div");tn.classList.add("appletParameters","notranslate");var un=Ye.width,Vt=Ye.height;if(Ye.disableAutoScale=Ye.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():Ye.disableAutoScale,Ye.width!==void 0)if(Ze(yt)<=4.4)st(Ye.showToolBar)&&(Ye.height-=7),st(Ye.showAlgebraInput)&&(Ye.height-=37),Ye.width<605&&st(Ye.showToolBar)&&(Ye.width=605,un=605);else{var Gt=100;(st(Ye.showToolBar)||st(Ye.showMenuBar))&&(Ye.hasOwnProperty("customToolBar")&&(Ye.customToolbar=Ye.customToolBar),Gt=st(Ye.showMenuBar)?245:155),un<Gt&&(Ye.width=Gt,un=Gt)}tn.style.border="none",tn.style.display="inline-block";for(var Wt in Ye)Ye.hasOwnProperty(Wt)&&Wt!=="appletOnLoad"&&tn.setAttribute("data-param-"+Wt,Ye[Wt]);nt&&tn.setAttribute("data-param-fontscssurl",nt),kn.resize=function(){GGBAppletUtils.responsiveResize(Xe,Ye)},window.addEventListener("resize",function(on){kn.resize()});var ye=typeof Ye.appletOnLoad=="function"?Ye.appletOnLoad:function(){};if(!Dt&&Ye.width!==void 0){Ye.hasOwnProperty("showSplash")||tn.setAttribute("data-param-showSplash","false");var se=Xe.querySelector(".applet_scaler.prerender"),oe=se!==null;if(oe)var de=se.querySelector(".ggb_preview");else{var de=Rt(un,Vt,Ye.borderColor,!1);se=document.createElement("div"),se.className="applet_scaler",se.style.position="relative",se.style.display="block",se.style.width=un+"px",se.style.height=Vt+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(se,"66%"),Ze(yt)>=5?(Ye.appletOnLoad=function(on){var mn=Xe.querySelector(".ggb_preview");mn&&mn.parentNode.removeChild(mn),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(se),window.GGBT_wsf_view&&$(window).trigger("resize"),ye(on)},oe||se.appendChild(de)):tn.appendChild(de),se.appendChild(tn),oe||Xe.appendChild(se),setTimeout(function(){kn.resize()},1)}else{var fe=document.createElement("div");fe.className="applet_scaler",fe.style.position="relative",fe.style.display="block",fe.appendChild(tn),Xe.appendChild(fe),Ye.appletOnLoad=function(on){kn.resize(),ye(on)}}function le(on,mn){mn&&typeof mn.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(on,mn.appletOnLoad):renderGGBElement(on),nn("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",mn)}function Ie(on,mn){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:on,params:mn}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(Cn){le(Cn.article,Cn.params)}),html5AppletsToProcess=null)},Ze(yt)<5&&(on.className+=" geogebraweb")):le(on,mn)}if(bn){scriptLoadStarted=!0;for(var it=0;it<tn.childNodes.length;it++){var Kt=tn.childNodes[it].tagName;Kt==="TABLE"&&(tn.removeChild(tn.childNodes[it]),it--)}if(ggbHTML5LoadedScript!==null){var $t=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');$t!=null&&$t.parentNode.removeChild($t)}var Jt=document.createElement("script"),qt=function(){Ie(tn,Ye)};Jt.src=ut+et,ggbHTML5LoadedCodebaseIsWebSimple=pt,ggbHTML5LoadedCodebaseVersion=yt,ggbHTML5LoadedScript=Jt.src,nn("GeoGebra HTML5 codebase loaded: '"+ut+"'.",Ye),!Ne&&(!Ae||Ae=="5.0")?(pt?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),qt()):ut.requirejs?__webpack_require__.e(7206).then(function(){var on=[__webpack_require__(97206)];qt.apply(null,on)}.bind(this)).catch(__webpack_require__.oe):(Jt.onload=qt,Xe.appendChild(Jt))}else Ie(tn,Ye);Ye.height=Vt,Ye.width=un},Qe=function(Xe,Ye,Dt){var bn=Rt(Ye.width,Ye.height,Ye.borderColor,Dt),tn=document.createElement("div");tn.style.position="relative",tn.style.display="block",tn.style.width=Ye.width+"px",tn.style.height=Ye.height+"px",tn.className="applet_screenshot applet_scaler"+(Dt?" applet_screenshot_play":""),tn.appendChild(bn);var un=GGBAppletUtils.getScale(Ye,Xe,Dt);Dt?(Xe.appendChild(It()),window.GGBT_wsf_view||(Xe.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(tn,"66%"),Xe.appendChild(tn),un!==1&&!isNaN(un)&&(GGBAppletUtils.scaleElement(tn,un),tn.style.width=Ye.width+"px",tn.style.height=Ye.height+"px",tn.parentNode.style.width=Ye.width*un+"px",tn.parentNode.style.height=Ye.height*un+"px"),kn.resize=function(){zt(Xe,bn,tn,Dt)},window.addEventListener("resize",function(Vt){kn.resize()}),kn.resize()};function zt(Xe,Ye,Dt,bn){if(Xe.contains(Ye)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Xe.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(Xe)}var tn=GGBAppletUtils.getScale(ue,Xe,bn);Dt.parentNode!==null&&(!isNaN(tn)&&tn!==1?(GGBAppletUtils.scaleElement(Dt,tn),Dt.parentNode.style.width=ue.width*tn+"px",Dt.parentNode.style.height=ue.height*tn+"px"):(GGBAppletUtils.scaleElement(Dt,1),Dt.parentNode.style.width=ue.width+"px",Dt.parentNode.style.height=ue.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(Xe),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}kn.onExitFullscreen=function(Xe,Ye){Ye.appendChild(Xe)};var ct=function(Xe,Ye,Dt,bn){Qe(Xe,Ye,!0);for(var tn=function(){var Gt=[];for(Vt=0;Vt<Xe.childNodes.length;Vt++)Gt.push(Xe.childNodes[Vt]);if(window.GGBT_wsf_view){var Wt=window.GGBT_wsf_view.renderFullScreen(Xe,Ye.id),ye=document.getElementById("fullscreencontainer"),se=jQuery(Xe).find(".fullscreencontent");se.length>0?(Wt.remove(),se.attr("id","fullscreencontent").show(),jQuery(ye).append(se),window.dispatchEvent(new Event("resize"))):Bt(Wt,Ye,!1),window.GGBT_wsf_view.launchFullScreen(ye)}else We=bn,Bt(Xe,Ye,!1);if(!window.GGBT_wsf_view)for(Vt=0;Vt<Gt.length;Vt++)Xe.removeChild(Gt[Vt])},un=Xe.getElementsByClassName("ggb_preview_play"),Vt=0;Vt<un.length;Vt++)un[Vt].addEventListener("click",tn,!1),un[Vt].addEventListener("ontouchstart",tn,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(Xe),He()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},It=function(){var Xe=document.createElement("div");if(Xe.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var Ye='.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");}',Dt=document.createElement("style");Dt.styleSheet?Dt.styleSheet.cssText=Ye:Dt.appendChild(document.createTextNode(Ye)),document.getElementsByTagName("head")[0].appendChild(Dt)}return Xe},Rt=function(Xe,Ye,Dt,bn){var tn=document.createElement("div");tn.className="ggb_preview",tn.style.position="absolute",tn.style.zIndex="90",tn.style.width=Xe-2+"px",tn.style.height=Ye-2+"px",tn.style.top="0px",tn.style.left="0px",tn.style.overflow="hidden",tn.style.backgroundColor="white";var un="lightgrey";Dt!==void 0&&(Dt==="none"?un="transparent":un=Dt),tn.style.border="1px solid "+un;var Vt=document.createElement("img");if(Vt.style.position="relative",Vt.style.zIndex="1000",Vt.style.top="-1px",Vt.style.left="-1px",at!==null&&Vt.setAttribute("src",at),Vt.style.opacity=.7,St!==null){var Gt,Wt,ye;if(!bn){Gt=document.createElement("img"),Gt.style.position="absolute",Gt.style.zIndex="1001",Gt.style.opacity=1,Vt.style.opacity=.3,Wt=360,Wt>Xe/4*3&&(Wt=Xe/4*3),ye=Wt/5.8,Gt.setAttribute("src",St),Gt.setAttribute("width",Wt),Gt.setAttribute("height",ye);var se=(Xe-Wt)/2,oe=(Ye-ye)/2;Gt.style.left=se+"px",Gt.style.top=oe+"px",tn.appendChild(Gt)}}return tn.appendChild(Vt),tn},mt=function(Xe){return Xe=Xe.toLowerCase(),Xe==="html5"||Xe==="screenshot"?Xe:"html5"},$e=["web","webSimple","web3d","tablet","tablet3d","phone"],xe=function(Xe,Ye){if(yt=Xe,Ye){ht(yt,!0);return}var Dt=!je;if(Dt){var bn=Ze(yt);!isNaN(bn)&&bn<4.4&&(Dt=!1)}var tn,un;window.location.protocol.substr(0,4)==="http"?tn=window.location.protocol:tn="http:";var Vt=yt.indexOf("//");Vt>0?un=yt:Vt===0?un=tn+yt:un="https://www.geogebra.org/apps/5.2.814.0/";for(var Gt in $e)if(yt.slice($e[Gt].length*-1)===$e[Gt]||yt.slice(($e[Gt].length+1)*-1)===$e[Gt]+"/"){ht(un,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&Dt&&!me.is3D&&!me.AV&&!me.SV&&!me.CV&&!me.EV2&&!me.CP&&!me.PC&&!me.DA&&!me.FI&&!me.PV&&!st(ue.showToolBar)&&!st(ue.showMenuBar)&&!st(ue.showAlgebraInput)&&!st(ue.enableRightClick)&&(!ue.appName||ue.appName=="classic")?un+="webSimple/":un+="web3d/",ht(un,!1)},ht=function(Xe,Ye){if(Xe.requirejs){ut=Xe;return}Xe.slice(-1)!=="/"&&(Xe+="/"),ut=Xe,Ye===null&&(Ye=Xe.indexOf("http")===-1),Le=Ye,et="web.nocache.js",pt=!1;var Dt=ut.split("/");Dt.length>1&&(!Ye&&Dt[Dt.length-2]==="webSimple"?(et="webSimple.nocache.js",pt=!0):$e.indexOf(Dt[Dt.length-2])>=0&&(et=Dt[Dt.length-2]+".nocache.js")),Dt=Xe.split("/"),yt=Dt[Dt.length-3],yt.substr(0,4)==="test"?yt=yt.substr(4,1)+"."+yt.substr(5,1):(yt.substr(0,3)==="war"||yt.substr(0,4)==="beta")&&(yt="5.0");var bn=parseFloat(yt);bn!==NaN&&bn<5&&Xe.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+bn+" is deprecated. Using version latest instead."),xe("5.0",Ye))},nn=function(Xe,Ye){window.console&&window.console.log&&(!Ye||typeof Ye.showLogging=="undefined"||Ye.showLogging&&Ye.showLogging!=="false")&&console.log(Xe)};ue.material_id!==void 0?Ue(Ut):Ut();function Ut(){var Xe=cn;Ae!==null?Xe=Ae:parseFloat(Xe)<5&&(Xe="5.0"),xe(Xe,!1),Ne!==null&&ht(Ne,Le),be=!0}return kn},GGBAppletUtils=function(){"use strict";function kn(){return window.GGBT_wsf_edit!==void 0}function cn(be,Ae){Ae!=1?(be.style.transformOrigin="0% 0% 0px",be.style.webkitTransformOrigin="0% 0% 0px",be.style.transform="scale("+Ae+","+Ae+")",be.style.webkitTransform="scale("+Ae+","+Ae+")",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 ue(be,Ae,Ne,Ce,Me,ze){var ut=null;if(ze!=null&&ze!="")for(var Le=be.parentNode;Le!=null;)if((" "+Le.className+" ").indexOf(" "+ze+" ")>-1){ut=Le;break}else Le=Le.parentNode;var We=0,yt=0,et=0,pt=0,at=0,St=0,Qt=0;if(ut)We=ut.offsetWidth,yt=Math.max(Ce?ut.offsetWidth:0,ut.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(We=Math.min(window.innerWidth,document.documentElement.clientWidth),yt=Math.min(window.innerHeight,document.documentElement.clientHeight),et=We):(We=window.innerWidth,yt=window.innerHeight,et=window.innerWidth),be){var nt=be.getBoundingClientRect();nt.left>0&&nt.left<=We&&(Me===void 0||!Me)&&(document.dir==="rtl"?(at=We-nt.width-nt.left,St=et<=480?10:30):(St=nt.left,at=et<=480?10:30),pt=St+at)}if(be&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var ft=be.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(pt=40,Qt=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(pt=0,Qt=40)}}return be&&((Ne===void 0||!Ne)&&Ae>0&&Ae+pt<We?We=Ae:We-=pt,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Ne===void 0||!Ne)&&(yt-=Qt)),{width:We,height:yt}}function me(be,Ae,Ne,Ce,Me){if(be.isScreenshoGenerator)return 1;var ze=Ce!==void 0&&Ce,ut=be.noScaleMargin!=null&&be.noScaleMargin,Le=function(ft){return ft&&ft!=="false"},We=Le(be.autoHeight),yt=ue(Ae,be.width,Ne,We,ze&&window.GGBT_wsf_view||ut,Me),et=parseInt(yt.width),pt=be.width,at=be.height;if(pt===void 0){var St=Ae.querySelector(".appletParameters");St&&(pt=St.offsetWidth,at=St.offsetHeight)}var Qt=et/pt,nt=ze?1:yt.height/at;return Ne!==void 0&&!Ne&&(Qt=Math.min(1,Qt),nt=Math.min(1,nt)),Math.min(Qt,nt)}function je(be,Ae,Ne){var Ce=1,Me,ze=!1;if(be.hasOwnProperty("allowUpscale")&&(ze=be.allowUpscale),be.hasOwnProperty("scale")&&(Ce=parseFloat(be.scale),(isNaN(Ce)||Ce===null||Ce===0)&&(Ce=1),Ce>1&&(ze=!0)),Ae&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(ze=!0),!(be.hasOwnProperty("disableAutoScale")&&be.disableAutoScale))Me=me(be,Ae,ze,Ne,be.scaleContainerClass);else return Ce;return ze&&(!be.hasOwnProperty("scale")||Ce===1)?Me:Math.min(Ce,Me)}function Ke(be){var Ae=Math.min(window.innerWidth,document.documentElement.clientWidth),Ne=Math.min(window.innerHeight,document.documentElement.clientHeight),Ce=be.getBoundingClientRect(),Me=(Ae-Ce.width)/2,ze=(Ne-Ce.height)/2;ze<0&&(ze=0),be.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(Me<40?be.style.left="40px":be.style.left=Me+"px",be.style.top=ze+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(ze<40?be.style.top="40px":be.style.top=ze+"px",be.style.left=Me+"px")}function ot(be,Ae){var Ne=be.querySelector(".appletParameters");if(Ne){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Ae.id!==Ne.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(be)}if(Ne.parentElement&&/fullscreen/.test(Ne.parentElement.className))return;var Ce=je(Ae,be);kn()&&Ne.setAttribute("data-param-scale",Ce);for(var Me=null,ze=0;ze<be.childNodes.length;ze++)if(be.childNodes[ze].className!==void 0&&be.childNodes[ze].className.match(/^applet_scaler/)){Me=be.childNodes[ze];break}if(Me!==null&&Me.querySelector(".noscale")!==null)return;var ut=Ae.id!==void 0?Ae.id:"ggbApplet",Le=window[ut];(Le==null||!Le.recalculateEnvironments)&&Me!==null&&!Me.className.match(/fullscreen/)&&(Me.parentNode.style.transform="",!isNaN(Ce)&&Ce!==1?(Me.parentNode.style.width=Ae.width*Ce+"px",Me.parentNode.style.height=Ae.height*Ce+"px",cn(Me,Ce)):(cn(Me,1),Me.parentNode.style.width=Ae.width+"px",Me.parentNode.style.height=Ae.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&Ke(be),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(Ne).parents(".content-added-content"))}}return{responsiveResize:ot,isFlexibleWorksheetEditor:kn,positionCenter:Ke,getScale:je,scaleElement:cn}}();__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 kn=n.location.search;return kn.indexOf(J)!=-1||kn.indexOf(K)!=-1}function q(kn,cn){}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(kn){var cn=s[L].bindings;s[L].bindings=function(){for(var ue=cn?cn():{},me=kn[webModule.__softPermutationId],je=O;je<me.length;je++){var Ke=me[je];ue[Ke[O]]=Ke[P]}return ue}};var t;function u(){return v(),t}function v(){if(!t){var kn=o.createElement(Q);if(kn.id=L,kn.style.cssText=R+S,kn.tabIndex=-1,o.body.appendChild(kn),t=kn.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var cn=document.compatMode==U?V:W;t.write(cn+X),t.close()}}}function w(kn){function cn(me){function je(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var Ke=je();if(Ke){me();return}function ot(){if(!Ke){if(!je())return;Ke=!0,me(),o.removeEventListener&&o.removeEventListener(Z,ot,!1),be&&clearInterval(be)}}o.addEventListener&&o.addEventListener(Z,ot,!1);var be=setInterval(function(){ot()},$)}function ue(me){var je=u(),Ke=je.body,ot=je.createElement(_);ot.language=ab,ot.crossOrigin=W,ot.src=me,webModule.__errFn&&(ot.onerror=function(){webModule.__errFn(L,new Error(bb+me))}),Ke.appendChild(ot)}cn(function(){ue(kn)})}webModule.__startLoadingFragment=function(kn){return C(kn)},webModule.__installRunAsyncCode=function(kn){var cn=u(),ue=cn.body,me=cn.createElement(_);me.language=ab,me.text=kn,ue.appendChild(me),ue.removeChild(me)};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(kn){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(kn){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(kn){var cn=c[kn];return cn==null?null:cn},r=d,webModule.__errFn=e}function B(){function kn(be){var Ae=be.lastIndexOf(rb);Ae==-1&&(Ae=be.length);var Ne=be.indexOf(sb);Ne==-1&&(Ne=be.length);var Ce=be.lastIndexOf(tb,Math.min(Ne,Ae));return Ce>=O?be.substring(O,Ce+P):W}function cn(be){if(!be.match(/^\w+:\/\//)){var Ae=o.createElement(ub);Ae.src=be+vb,be=kn(Ae.src)}return be}function ue(){var be=__gwt_getMetaProperty(wb);return be!=null?be:W}function me(){for(var be=o.getElementsByTagName(_),Ae=O;Ae<be.length;++Ae)if(be[Ae].src.indexOf(xb)!=-1)return kn(be[Ae].src);return W}function je(){var be=o.getElementsByTagName(yb);return be.length>O?be[be.length-P].href:W}function Ke(){var be=o.location;return be.href==be.protocol+zb+be.host+be.pathname+be.search+be.hash}var ot=ue();return ot==W&&(ot=me()),ot==W&&(ot=je()),ot==W&&Ke()&&(ot=kn(o.location.href)),ot=cn(ot),ot}function C(kn){return kn.match(/^\//)||kn.match(/^[a-zA-Z]+:\/\//)?kn:webModule.__moduleBase+kn}function D(){var kn=[],cn=O,ue=[],me=[];function je(be){var Ae=me[be](),Ne=ue[be];if(Ae in Ne)return Ae;var Ce=[];for(var Me in Ne)Ce[Ne[Me]]=Me;throw r&&r(be,Ce,Ae),null}if(__gwt_isKnownPropertyValue=function(be,Ae){return Ae in ue[be]},webModule.__getPropMap=function(){var be={};for(var Ae in ue)ue.hasOwnProperty(Ae)&&(be[Ae]=je(Ae));return be},webModule.__computePropValue=je,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var Ke;try{Ke=Cb;var ot=Ke.indexOf(Db);ot!=-1&&(cn=parseInt(Ke.substring(ot+P),$),Ke=Ke.substring(O,ot))}catch(be){}return webModule.__softPermutationId=cn,C(Ke+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})()},79090:function(kn,cn,ue){"use strict";ue.d(cn,{Ax:function(){return ot},Ds:function(){return be},KI:function(){return Ne},SI:function(){return Ke},f1:function(){return je}});var me=ue(6521);function je(Ce){let Me=!0;if(Ce.length>0){for(let ze=0;ze<Ce.length;ze++)if(Ce[ze].compile_success==0||!Ce[ze].compile_success){Me=!1;break}}else Me=!1;return Me}function Ke(Ce,Me=""){let ze=[];for(let ut=0;ut<Ce.length;ut++){let Le=Ce[ut],We=Me?`${Me}/${Le.name}`:`${Le.name}`;ze.push({title:Le.name,type:Le.type,isLeaf:Le.type!=="tree",key:We})}return ze}function ot(Ce,Me,ze){for(let ut=0;ut<Ce.length;ut++){let Le=Ce[ut];if(Le.key===Me){Le.children=ze;break}Le.children&&ot(Le.children,Me,ze)}return Ce}function be(Ce,Me,ze){let ut;return function(){let Le=this,We=arguments,yt=function(){ut=null,ze||Ce.apply(Le,We)},et=ze&&!ut;clearTimeout(ut),ut=setTimeout(yt,Me),et&&Ce.apply(Le,We)}}const Ae=!0,Ne=me.Z.API_SERVER},15868:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return ut}});var me=ue(59301),je={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},Ke=ue(92310),ot=ue.n(Ke),be=ue(71418),Ae=ue(2859),Ne=ue(79769),Ce=ue(25544),Me=(Le,We,yt)=>new Promise((et,pt)=>{var at=nt=>{try{Qt(yt.next(nt))}catch(ft){pt(ft)}},St=nt=>{try{Qt(yt.throw(nt))}catch(ft){pt(ft)}},Qt=nt=>nt.done?et(nt.value):Promise.resolve(nt.value).then(at,St);Qt((yt=yt.apply(Le,We)).next())}),ut=({data:Le,className:We,fullWidth:yt,style:et={},onClose:pt,onOk:at,showFullTools:St,noAssociationId:Qt})=>{const nt=(0,me.useRef)(null),ft=(0,me.useRef)(null),Ze=(0,me.useRef)(null),ke=(0,me.useRef)(null),[He,Ue]=(0,me.useState)(!1),[bt,Ve]=(0,me.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,me.useEffect)(()=>{Ze.current||(Ze.current=document.createElement("style"),document.head.appendChild(Ze.current)),Le!=null&&Le.visible?(document.body.setAttribute("data-custom","y-hidden"),Ze.current.innerHTML=" html { overflow-y: hidden; }",Le!=null&&Le.src&&jt()):(document.body.removeAttribute("data-custom"),Ze.current&&(document.head.removeChild(Ze.current),Ze.current=null))},[Le==null?void 0:Le.visible]);const jt=()=>Me(void 0,null,function*(){Ue(!0),Ve("\u6B63\u5728\u52A0\u8F7D\u4E2D");const ct=yield(0,Ce.ZJ)(Le==null?void 0:Le.src);nt.current.src="",nt.current.src=ct,nt.current.onload=function(){zt()},Ue(!1),Ve("")}),st=()=>{document.body.removeAttribute("data-custom"),Ze.current.innerHTML=" ",pt()},Bt=ct=>Me(void 0,null,function*(){Ue(!0),Ve("\u6B63\u5728\u4FDD\u5B58\u4E2D");const It=yield(0,Ne.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Le.title,file:ct.dataUrl}});It!=null&&It.id&&!Qt?(yield(0,Ne.ZP)(`/api/attachments/${Le.id}/add_subitem.json`,{method:"post",body:{subitem_id:It==null?void 0:It.id,settings:JSON.stringify(ct.state)}})).status===0&&at():It!=null&&It.id&&at(It),document.body.removeAttribute("data-custom"),Ze.current.innerHTML=" ",Ue(!1),Ve("")}),Qe=()=>{const ct=document.querySelector('a[href="https://markerjs.com/"]');ct&&ct.parentNode&&(ct.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(Rt=>{const mt=document.querySelector(Rt.name);mt&&mt.setAttribute("title",Rt.title)})},zt=()=>{ft.current=new Ae.hP(nt.current),ft.current.targetRoot=ke.current,ft.current.addEventListener("render",Bt),ft.current.addEventListener("beforeclose",st),St&&(ft.current.availableMarkerTypes=ft.current.ALL_MARKER_TYPES,ft.current.uiStyleSettings.redoButtonVisible=!0,ft.current.uiStyleSettings.notesButtonVisible=!0,ft.current.uiStyleSettings.zoomButtonVisible=!0,ft.current.uiStyleSettings.zoomOutButtonVisible=!0,ft.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=ft.current.uiStyleSettings,ft.current.show(),Le!=null&&Le.snapshotData&&ft.current.restoreState(Le.snapshotData),setTimeout(()=>{window.scrollTo(0,0),Qe()},300)};return me.createElement(me.Fragment,null,(Le==null?void 0:Le.visible)&&me.createElement(be.Z,{spinning:He,tip:bt,style:{position:"absolute"}},me.createElement("div",{ref:ke,className:ot()(je.imageDimensions,We,yt?je.fullWidth:""),style:et},me.createElement("img",{className:je.img,ref:nt}))))}},3315:function(kn,cn,ue){"use strict";var me=ue(59301),je=ue(95237),Ke=ue(43604),ot=ue(99313),be=ue(3113),Ae=ue(39655),Ne=ue(18760),Ce=ue(48136),Me=ue(59301);const ze=(0,me.forwardRef)(({callback:ut,showSaveButton:Le,value:We=""},yt)=>{const et=(0,me.useRef)(),pt=[{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 "}]}]}],at=[{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}`}]}]}],St=ft=>{et.current.setValue(et.current.getValue()+" "+ft.value+" ")},Qt=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:Me.createElement(je.Z,{className:Ne.Z.lists,gutter:[10,10]},pt.map((ft,Ze)=>Me.createElement(Ke.Z,{flex:"110px",className:Ne.Z.item},Me.createElement("div",null,Me.createElement(Ae.Z,{value:`$$${ft.value}$$`}),ft.name),Me.createElement("div",{className:Ne.Z.children},ft.children.map((ke,He)=>Me.createElement("div",{key:He},Me.createElement("h1",null,ke.name),Me.createElement(je.Z,{gutter:[10,10]},ke.data.map((Ue,bt)=>Me.createElement(Ke.Z,{key:bt,onClick:()=>St(Ue),className:Ne.Z.diamond},Me.createElement(Ae.Z,{value:"`$$"+Ue.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:Me.createElement(je.Z,{className:Ne.Z.lists,gutter:[10,10]},at.map((ft,Ze)=>Me.createElement(Ke.Z,{flex:"110px",className:Ne.Z.item},Me.createElement("div",null,Me.createElement(Ae.Z,{value:"`$$"+ft.value+"$$`"}),ft.name),Me.createElement("div",{className:Ne.Z.children},ft.children.map((ke,He)=>Me.createElement("div",{key:He},ke.name&&Me.createElement("h1",null,ke.name),Me.createElement(je.Z,{gutter:[10,10]},ke.data.map((Ue,bt)=>Me.createElement(Ke.Z,{key:bt,onClick:()=>St(Ue),className:Ne.Z.diamond},Me.createElement(Ae.Z,{value:"`$$"+Ue.value+"$$`"}))))))))))}],nt=()=>{var ft=document.createElement("div");ft.innerHTML=et.current.getValue();var Ze=ft.innerText;return ut&&ut(Ze),Ze};return(0,me.useImperativeHandle)(yt,()=>({getData:nt})),Me.createElement("div",{className:Ne.Z.mathWrap},Me.createElement(ot.default,{defaultActiveKey:"1",items:Qt}),Me.createElement("math-field",{locale:"zh_cn",className:Ne.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:et,style:{width:800,marginTop:30,fontSize:18}},We||""),Le&&Me.createElement("div",{className:Ne.Z.button},Me.createElement(be.ZP,{size:"large",onClick:nt,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});cn.Z=ze},67831:function(kn,cn,ue){"use strict";ue.d(cn,{h:function(){return ft}});var me=ue(59301),je=ue(57809),Ke=ue(78241),ot=ue(3113),be=ue(89780),Ae=ue.n(be),Ne=ue(14618),Ce=ue(66552),Me=Object.defineProperty,ze=Object.defineProperties,ut=Object.getOwnPropertyDescriptors,Le=Object.getOwnPropertySymbols,We=Object.prototype.hasOwnProperty,yt=Object.prototype.propertyIsEnumerable,et=(Ze,ke,He)=>ke in Ze?Me(Ze,ke,{enumerable:!0,configurable:!0,writable:!0,value:He}):Ze[ke]=He,pt=(Ze,ke)=>{for(var He in ke||(ke={}))We.call(ke,He)&&et(Ze,He,ke[He]);if(Le)for(var He of Le(ke))yt.call(ke,He)&&et(Ze,He,ke[He]);return Ze},at=(Ze,ke)=>ze(Ze,ut(ke));const St=je.default.Option,Qt={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"]};cn.Z=({callback:Ze,onCancel:ke})=>{const[He,Ue]=(0,me.useState)("python");function bt(jt){Ue(nt[jt][1])}function Ve(jt){Ze(jt)}return me.createElement(Ke.default,at(pt({},Qt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Ve,style:{width:500}}),me.createElement(Ke.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},me.createElement(je.default,{getPopupContainer:jt=>jt.parentNode,onChange:bt},Object.keys(nt).map(jt=>me.createElement(St,{key:jt,value:jt},nt[jt][0])))),me.createElement(Ke.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},me.createElement(ft,{mode:He})),me.createElement("div",{className:"flex-container flex-end"},me.createElement(ot.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),me.createElement(ot.ZP,{type:"ghost",onClick:ke},"\u53D6\u6D88")))};function ft({value:Ze,onChange:ke,mode:He,options:Ue={}}){const bt=(0,me.useRef)(),[Ve,jt]=(0,me.useState)();return(0,me.useEffect)(()=>{if(Ve){let st=function(Bt){const Qe=Bt.getValue();ke&&ke(Qe)};return Ve.on("change",st),()=>{Ve.off("change",st)}}},[Ve,ke]),(0,me.useEffect)(()=>{Ve&&Ve.setOption("mode",He)},[Ve,He]),(0,me.useEffect)(()=>{Ve&&(Ze!==Ve.getValue()||Ze==="")&&setTimeout(()=>{Ve.setValue(Ze||"")},300)},[Ve,Ze]),(0,me.useEffect)(()=>{if(bt.current&&!Ve){const st=Ae().fromTextArea(bt.current,pt({mode:He,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Ue));jt(st)}},[bt.current,Ve]),me.createElement("div",{className:"my-codemirror-container"},me.createElement("textarea",{ref:bt}))}},40973:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Nr}});var me=ue(59301),je=ue(89780),Ke=ue.n(je),ot=ue(76374),be=ue(14618),Ae=ue(6313),Ne=ue(25717),Ce=ue(99498),Me=ue(25419),ze=ue(67549),ut=ue(39655),Le=({value:Jn="",className:lr,showTextOnly:Rn,showLines:$n,style:wr={}})=>{const lt=(0,me.useMemo)(()=>"",[Jn]);return me.createElement(me.Fragment,null,me.createElement("div",{dangerouslySetInnerHTML:{__html:lt}}))},We=ue(59301),yt=Object.defineProperty,et=Object.defineProperties,pt=Object.getOwnPropertyDescriptors,at=Object.getOwnPropertySymbols,St=Object.prototype.hasOwnProperty,Qt=Object.prototype.propertyIsEnumerable,nt=(Jn,lr,Rn)=>lr in Jn?yt(Jn,lr,{enumerable:!0,configurable:!0,writable:!0,value:Rn}):Jn[lr]=Rn,ft=(Jn,lr)=>{for(var Rn in lr||(lr={}))St.call(lr,Rn)&&nt(Jn,Rn,lr[Rn]);if(at)for(var Rn of at(lr))Qt.call(lr,Rn)&&nt(Jn,Rn,lr[Rn]);return Jn},Ze=(Jn,lr)=>et(Jn,pt(lr));let ke=[{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 He({onActionCallback:Jn,title:lr,icon:Rn,actionName:$n,className:wr="",children:lt}){function _e(){Jn($n)}return We.createElement("a",{title:lr,className:wr,onClick:_e},We.createElement("i",{className:`${Rn}`}),lt)}var Ue=({watch:Jn,showNullButton:lr,showNullProgramButton:Rn,onActionCallback:$n,fullScreen:wr,insertTemp:lt,hidetoolBar:_e,extraUse:Pe})=>{const De=[...ke,{title:`${Jn?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${Jn?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return We.createElement("ul",{className:"markdown-toolbar-container"},!_e&&De.map((Te,qe)=>We.createElement("li",{key:qe},Te.actionName?We.createElement(He,Ze(ft({},Te),{onActionCallback:$n})):We.createElement("span",{className:"v-line"}))),lr?We.createElement("li",null,We.createElement(He,{icon:"iconfont icon-tianjia5 insert-blank",className:"btn-null ml5",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:$n},We.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u65B0\u589E\u586B\u7A7A\u9879"))):null,Rn?We.createElement(We.Fragment,null,We.createElement("li",null,We.createElement(He,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:$n},We.createElement("span",{className:"fill-tip"},"+\u5355\u884C\u586B\u7A7A\u9879"))),We.createElement("li",null,We.createElement(He,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:$n},We.createElement("span",{className:"fill-tip"},"+\u591A\u884C\u586B\u7A7A\u9879")))):null,lt&&We.createElement("li",null,We.createElement(He,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${lt}`,onActionCallback:$n},We.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),Pe&&We.createElement("li",null,Pe),We.createElement("li",{className:"btn-full-screen"},We.createElement(He,{icon:`${wr?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:wr?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:$n})))},bt=ue(53531),Ve=ue(78241),jt=ue(92832),st=ue(3113),Bt=Object.defineProperty,Qe=Object.defineProperties,zt=Object.getOwnPropertyDescriptors,ct=Object.getOwnPropertySymbols,It=Object.prototype.hasOwnProperty,Rt=Object.prototype.propertyIsEnumerable,mt=(Jn,lr,Rn)=>lr in Jn?Bt(Jn,lr,{enumerable:!0,configurable:!0,writable:!0,value:Rn}):Jn[lr]=Rn,$e=(Jn,lr)=>{for(var Rn in lr||(lr={}))It.call(lr,Rn)&&mt(Jn,Rn,lr[Rn]);if(ct)for(var Rn of ct(lr))Rt.call(lr,Rn)&&mt(Jn,Rn,lr[Rn]);return Jn},xe=(Jn,lr)=>Qe(Jn,zt(lr));const ht={labelCol:{span:4},wrapperCol:{span:20}};var nn=({callback:Jn,onCancel:lr})=>{function Rn($n){Jn($n)}return me.createElement(Ve.default,xe($e({},ht),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Rn,style:{width:500}}),me.createElement(Ve.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},me.createElement(jt.default,null)),me.createElement(Ve.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},me.createElement(jt.default,null)),me.createElement("div",{className:"flex-container flex-end"},me.createElement(st.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),me.createElement(st.ZP,{type:"ghost",onClick:lr},"\u53D6\u6D88")))},Ut=ue(67831),Xe=ue(58448),Ye=ue(43418),Dt=ue(95237),bn=ue(15868),tn=ue(59301),un=({callback:Jn,onCancel:lr})=>{const Rn=document.createElement("canvas"),$n=Rn.getContext("2d");Rn.width=1e3,Rn.height=800,$n.fillStyle="#ffffff",$n.fillRect(0,0,Rn.width,Rn.height);const wr=Rn.toDataURL("image/png");return tn.createElement(Ye.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},tn.createElement(Dt.Z,{style:{height:"100vh"}},tn.createElement(bn.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:wr,visible:!0,title:String(Date.now())},onOk:lt=>{Jn({src:lt.url})},onClose:lr})))},Vt=ue(8591),Gt=ue(43428),Wt=ue(43604),ye={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},se=ue(59301),de=(0,me.forwardRef)(({onCancel:Jn,editImgId:lr,callback:Rn},$n)=>{let wr=(0,me.useRef)(),lt=(0,me.useRef)(),_e=(0,me.useRef)(),Pe=(0,me.useRef)(!1);const De=(0,me.useRef)(!1);console.log("ref:",$n);const[Te,qe]=(0,me.useState)(0),[dt,Xt]=(0,me.useState)("100vh");(0,me.useEffect)(()=>{qe(1);try{indexedDB.databases().then(pn=>{pn.forEach(vn=>indexedDB.deleteDatabase(vn.name))})}catch(pn){}},[]),(0,me.useEffect)(()=>(window.addEventListener("message",Yt),()=>{window.removeEventListener("message",Yt)}),[]),(0,me.useImperativeHandle)($n,()=>({setHeight:Xt}));const Ot=pn=>{window.saveDrawData(vn=>{if(vn===null&&!pn){Vt.ZP.warning({content:"\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u8BF7\u5148\u7ED8\u5236\u6D41\u7A0B\u56FE",key:"saveFlowChart"});return}Vt.ZP.success({content:"\u4FDD\u5B58\u6210\u529F",key:"saveFlowChart",style:{zIndex:999999999}}),Rn({src:`/api/attachments/${vn}`,id:vn,disabledClose:!0})})},Yt=pn=>{var vn;((vn=pn==null?void 0:pn.data)==null?void 0:vn.type)==="closePop"&&Ot(!0)};return se.createElement("div",{ref:De,className:"body-overflow-initial"},se.createElement(Gt.Z,{width:"100vw",height:dt,footer:null,closable:!0,placement:"bottom",open:!!Te,destroyOnClose:!0,maskClosable:!1,mask:!1,rootClassName:`zIndex-9999 ${ye.drawerWrap}`,onClose:()=>{window.saveDrawData(pn=>{Rn({src:`/api/attachments/${pn}`,id:pn})})},title:se.createElement(Dt.Z,{align:"middle"},se.createElement(Wt.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),se.createElement(Wt.Z,{onClick:()=>{Xt(dt==="60px"?"100vh":"60px")}},se.createElement("span",{className:"current c-blue",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77")),se.createElement(Wt.Z,{onClick:Ot},se.createElement(st.ZP,{type:"primary",className:"ml20"},"\u4FDD\u5B58")))},se.createElement("iframe",{src:`${window.ENV==="build"?"/react/build":""}/drawio/src/main/webapp/?id=${lr||""}&gapi=0&od=0&db=0&gh=0&gl=0&local=0`,width:"100%",height:"100%",frameBorder:"0",ref:lt})))}),fe=ue(6521),le=ue(5112),Ie=ue(5871);const it=le.ZP.Group,Kt={margin:"0 8px"};var $t=({callback:Jn,onCancel:lr})=>{function Rn($n){Jn($n)}return me.createElement(Ve.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Rn},me.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},me.createElement("span",{style:Kt},"\u5355\u5143\u683C\u6570\uFF1A"),me.createElement("span",{style:Kt},"\u884C\u6570"),me.createElement(Ve.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},me.createElement(Ie.Z,null)),me.createElement("span",{style:Kt},"\u5217\u6570"),me.createElement(Ve.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},me.createElement(Ie.Z,null))),me.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},me.createElement("span",{style:Kt},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),me.createElement(Ve.default.Item,{name:"align"},me.createElement(it,null,me.createElement(le.ZP,{value:"default"},me.createElement("i",{className:"fa fa-align-justify"})),me.createElement(le.ZP,{value:"left"},me.createElement("i",{className:"fa fa-align-left"})),me.createElement(le.ZP,{value:"center"},me.createElement("i",{className:"fa fa-align-center"})),me.createElement(le.ZP,{value:"right"},me.createElement("i",{className:"fa fa-align-right"}))))),me.createElement("div",{className:"flex-container flex-end"},me.createElement(st.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),me.createElement(st.ZP,{type:"ghost",onClick:lr},"\u53D6\u6D88")))},Jt=ue(78673),qt=ue(3352),on=ue.n(qt),Cn=(0,me.forwardRef)(({use3d:Jn,width:lr,height:Rn,callback:$n,showSaveButton:wr},lt)=>{const _e=(0,me.useRef)(),Pe=(0,me.useRef)(),[De,Te]=(0,me.useState)(!1),qe=(0,me.useRef)({id:_e,appName:"graphing",width:lr||1e3,height:Rn||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,me.useEffect)(()=>{Pe.current=new(on())(qe.current,!0),window.onload=function(){Pe.current.inject("applet_container")}},[]);const dt=()=>{var Xt=window.ggbApplet.getPNGBase64(1,!0,72);return $n&&$n(Xt),Xt};return(0,me.useEffect)(()=>{qe.current.appName=De?"3D":"graphing",Pe.current.inject("applet_container")},[De]),(0,me.useEffect)(()=>{Te(Jn)},[Jn]),(0,me.useImperativeHandle)(lt,()=>({getImgData:dt})),me.createElement(me.Fragment,null,me.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:_e}),me.createElement(Dt.Z,{align:"middle"},me.createElement(Wt.Z,{flex:1},me.createElement(Jt.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:De,onChange:Xt=>Te(Xt)})),me.createElement(Wt.Z,null,me.createElement(st.ZP,{size:"large",onClick:dt,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),xt=ue(3315),hn=ue(1012);const On="link",tt="upload-image",Fe="add-flowchart",Ge="draw-image",Zt="add-flowchart",en="code-block",ln="add-table",Dn="------------",Tn={default:Dn,left:`:${Dn}`,center:`:${Dn}:`,right:`${Dn}:`};var En=ue(57649),Fn=(Jn,lr,Rn)=>new Promise(($n,wr)=>{var lt=De=>{try{Pe(Rn.next(De))}catch(Te){wr(Te)}},_e=De=>{try{Pe(Rn.throw(De))}catch(Te){wr(Te)}},Pe=De=>De.done?$n(De.value):Promise.resolve(De.value).then(lt,_e);Pe((Rn=Rn.apply(Jn,lr)).next())});function jn(){}let An=0;const hr=1e4,_r="\u2581",Tr="@\u2581\u2581@",Hr="@\u2581@",sr=`
|
|
|
**\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`,Mr=["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 rr(Jn){return/^\d+$/.test(Jn)?`${Jn}px`:Jn}const Fr=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",Er={[Fr+"-B"]:"bold",[Fr+"-I"]:"italic"},jr={[On]:"\u6DFB\u52A0\u94FE\u63A5",[en]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[tt]:"\u6DFB\u52A0\u56FE\u7247",[Ge]:"\u6DFB\u52A0\u753B\u56FE",[Fe]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[ln]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var Nr=({defaultValue:Jn="",onChange:lr,width:Rn="100%",height:$n=400,miniToolbar:wr=!1,isFocus:lt=!1,watch:_e,insertTemp:Pe,mode:De="markdown",id:Te="markdown-editor-id",showResizeBar:qe=!1,noStorage:dt=!1,showNullButton:Xt=!1,showNullProgramButton:Ot=!1,hidetoolBar:Yt=!1,fullScreen:pn=!1,onBlur:vn,onCMBeforeChange:Sn,onFullScreen:At,className:dn="",disablePaste:rt=!1,disabled:Mt=!1,disabledFill:Lt=!1,placeholder:Pt="",values:an="",extraUse:Et,onAddBlank:rn})=>{const[Be,wt]=(0,me.useState)(null),[Ct,Nt]=(0,me.useState)(Jn),[Tt,Ft]=(0,me.useState)(_e),[Ht,gn]=(0,me.useState)(pn),[wn,Ln]=(0,me.useState)(""),[zn,er]=(0,me.useState)(0),[cr,Un]=(0,me.useState)($n),[In,fr]=(0,me.useState)(!1),tr=(0,me.useRef)((0,hn.Z)()),yr=(0,me.useRef)(!1),Gn=(0,me.useRef)(),[Xn,br]=(0,me.useState)(0),[ur,Br]=(0,me.useState)(0),Gr=(0,me.useRef)(),ar=(0,me.useRef)(),_n=(0,me.useRef)(),Mn=(0,me.useRef)(),gr=(0,me.useRef)(),nr=(0,me.useRef)(),kr=()=>Fn(void 0,null,function*(){var Yn;const Vn=yield Fetch("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:tr.current}});(Yn=Vn==null?void 0:Vn.attachments)!=null&&Yn.length&&(console.log("cm:",Be,Gr),Vn.attachments.map(Zn=>{Zn.content_type.indexOf("image")>-1?Be.replaceSelection(``):Zn.content_type.indexOf("video")>-1?Be.replaceSelection(`<video width="100%" controls src="${fe.Z.API_SERVER}/api/attachments/${data.id}"></video>`):Zn.content_type.indexOf("pdf")>-1?Be.replaceSelection(`<a href="${fe.Z.API_SERVER}/api/attachments/${Zn.id}?type=${Zn.content_type}&disposition=inline" target="_blank">${Zn.name}</a>`):Be.replaceSelection(`[${Zn.name}](${fe.Z.API_SERVER}/api/attachments/${Zn.id}?type=${Zn.content_type})`)}))});(0,me.useEffect)(()=>{const Yn=window.scrollY||window.pageYOffset;Nt(an),Be==null||Be.setValue(an),window.scrollTo(0,Yn)},[an]),(0,me.useEffect)(()=>{At==null||At(Ht)},[Ht]),(0,me.useEffect)(()=>{if(Gr.current){let Yn=function(Zn,mr){var ni;if(rt){mr.preventDefault();return}const xi=mr.clipboardData;if(xi){const Mi=xi.types.toString(),gi=xi.items;if(Mi==="Files"||xi.types.indexOf("Files")>-1){if(mr.preventDefault(),De=="stex")return;try{let ci=gi[1];((ni=gi[0])==null?void 0:ni.kind)==="file"&&(ci=gi[0]);const _i=ci.getAsFile(),Hi=_i.name.split(".").pop();(0,Xe.I)(_i,Ni=>{var oa,Xr,ei;Ni.id?((oa=_i==null?void 0:_i.type)==null?void 0:oa.indexOf("image"))>-1?Vn.replaceSelection(`<img width="100%" src="/api/attachments/${Ni.id}?type=${Ni.content_type})" alt="" />`):((Xr=_i==null?void 0:_i.type)==null?void 0:Xr.indexOf("video"))>-1?Vn.replaceSelection(`<video width="100%" controls src="/api/attachments/${Ni.id}"></video>`):((ei=_i==null?void 0:_i.type)==null?void 0:ei.indexOf("pdf"))>-1?Vn.replaceSelection(`<a href="/api/attachments/${Ni.id}?type=${_i.type}&disposition=inline" target="_blank">${_i.name}</a>`):Mr.includes(Hi)?Vn.replaceSelection(`<a href="/api/attachments/${Ni.id}?type=office&disposition=inline" target="_blank">${_i.name}</a>`):Vn.replaceSelection(`[${_i.name}](/api/attachments/${Ni.id}?type=${Ni.content_type})`):(Ni==null?void 0:Ni.status)===401&&(Vt.ZP.warning((Ni==null?void 0:Ni.message)||"\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C"),document.location.href="/user/login")})}catch(ci){Vt.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const Vn=Ke().fromTextArea(Gr.current,{mode:De,lineNumbers:!wr,lineWrapping:!0,value:Jn,autoCloseTags:!Ot,autoCloseBrackets:!0});return Vn.on("keyup",function(Zn,mr){mr.keyCode===8&&(Zn.getValue()==""?Vn.setOption("placeholder",Pt):Vn.setOption("placeholder",null))}),Vn.on("keydown",function(Zn,mr){if(mr.keyCode===8){var ni=Ir(Zn);ni&&mr.preventDefault()}}),lt&&Vn.focus(),Vn.on("paste",Yn),Vn.on("dragleave",function(Zn,mr){ar.current.classList.remove("mouse-hover-md")}),Mt&&Vn.on("beforeChange",function(Zn,mr){(mr.origin==="paste"||mr.origin==="+input")&&mr.cancel()}),wt(Vn),()=>{Vn.off("paste",Yn)}}},[]);const Lr=(0,me.useCallback)(()=>{if(ar.current)try{}catch(Yn){console.log(Yn,"---- to set md editor body height")}},[cr,ar,Ht]);(0,me.useEffect)(()=>{function Yn(){let Vn=new ot.Z(Zn=>{for(let mr of Zn)(mr.target.offsetHeight>0||mr.target.offsetWidth>0)&&(Lr(),Be.setSize("100%","100%"),Be.refresh())});return Vn.observe(Gr.current.parentElement),Vn}if(Be){const Vn=Yn();return()=>{var Zn,mr;(Zn=Gr.current)!=null&&Zn.parentElement&&Vn.unobserve((mr=Gr.current)==null?void 0:mr.parentElement)}}},[Be,Lr]),(0,me.useEffect)(()=>{if(Be){let Yn=[];for(const[Vn,Zn]of Object.entries(Er)){let mr={[Vn]:()=>{pr(Zn)}};Yn.push(mr),Be.addKeyMap(mr)}return Gn.current=setInterval(()=>{yr.current&&kr()},4e3),()=>{clearInterval(Gn.current);for(let Vn of Yn)Be.removeKeyMap(Vn)}}},[Be]),(0,me.useEffect)(()=>{pn!==Ht&&gn(pn)},[pn]),(0,En.Z)(()=>{if(!dt&&zn>0){let Yn=new Date().getTime(),Vn=window.sessionStorage.getItem(Te);Yn>=zn+hr&&(!Vn||Vn!==Ct)&&(window.sessionStorage.setItem(Te,Ct),fr(!0))}},hr),(0,me.useEffect)(()=>{Ft(_e)},[Be,_e]),(0,me.useEffect)(()=>{Be&<&&Be.focus()},[Be,lt]),(0,me.useEffect)(()=>{if(Tt&&Be){let Yn=function(Zn){let mr=Zn.target;if(Mn.current){let ni=mr.scrollTop/mr.scrollHeight;Mn.current.scrollTop=Mn.current.scrollHeight*ni}};const Vn=Be.getScrollerElement();return Vn.addEventListener("scroll",Yn),()=>{Vn.removeEventListener("scroll",Yn)}}},[Be,Tt]),(0,me.useEffect)(()=>{if(Be&&Sn){let Yn=function(Vn,Zn){Sn(Vn,Zn)};return Be.on("beforeChange",Yn),()=>{Be.off("beforeChange",Yn)}}},[Be,Sn]),(0,me.useEffect)(()=>{if(Be&&vn){let Yn=function(){vn(Be.getValue())};return Be.on("blur",Yn),()=>{Be.off("blur",Yn)}}},[Be,vn]);function Ir(Yn,Vn){var Zn=Yn.getDoc(),mr=Zn.getCursor(),ni=Zn.getLine(mr.line),xi=ni.charAt(mr.ch-1),Mi=ni.lastIndexOf("@\u2581@",mr.ch),gi=ni.lastIndexOf("@\u2581\u2581@",mr.ch),ci=Mi>gi?Mi:gi,_i=Mi>gi?3:4;if(Tr.indexOf(xi)===-1)return null;if(console.log("change1:",Vn,Yn,ni,mr,ci,Mi,gi,xi),ci>=0&&mr.ch-ci<5){var Hi=ci+_i;return Zn.replaceRange("",{line:mr.line,ch:ci},{line:mr.line,ch:Hi}),{line:mr.line,ch:Hi}}return null}(0,me.useEffect)(()=>{if(Be){let Yn=function(Vn,Zn){const mr=Vn.getValue();Nt(mr),er(new Date().getTime()),Vn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),lr&&(Ot?lr(mr,di(mr)):lr(mr))};return Be.on("change",Yn),()=>{Be.off("change",Yn)}}},[Be,lr]),(0,me.useEffect)(()=>{if(Be)if(Jn==null)Be.setValue(""),Nt("");else{const Yn=window.scrollY||window.pageYOffset;Jn!==Be.getValue()&&(Be.setValue(Jn),Nt(Jn),Be.setCursor(Mt?1:Be.lineCount(),0),window.scrollTo(0,Yn))}},[Be,Jn]);const pr=(0,me.useCallback)(Yn=>{const Vn=Be.getCursor(),Zn=Be.getSelection();let mr=Zn.split(`
|
|
|
`);switch(Yn){case"bold":return Be.replaceSelection("**"+Zn+"**"),Zn===""&&Be.setCursor(Vn.line,Vn.ch+2),Be.focus();case"italic":return Be.replaceSelection("*"+Zn+"*"),Zn===""&&Be.setCursor(Vn.line,Vn.ch+1),Be.focus();case"code":return Be.replaceSelection("`"+Zn+"`"),Zn===""&&Be.setCursor(Vn.line,Vn.ch+1),Be.focus();case"inline-latex":return Ln("inline-latex"),Be.focus();case"latex":return Be.replaceSelection("```latex\n"+Zn+"\n```"),Be.setCursor(Vn.line+1,Zn.length+1),Be.focus();case"line-break":return Be.replaceSelection(`<br/>
|
|
|
`),Be.focus();case"list-ul":return Zn===""?Be.replaceSelection("- "+Zn):Be.replaceSelection(mr.map(ni=>ni===""?"":`- ${ni}`).join(`
|
|
|
`)),Be.focus();case"list-ol":return Zn===""?Be.replaceSelection("1. "+Zn):Be.replaceSelection(mr.map((ni,xi)=>ni===""?"":`${xi+1}. ${ni}`).join(`
|
|
|
`)),Be.focus();case"add-null-ch":rn==null||rn();return;case"add-signal":return Zn===""&&Be.setCursor(Vn.line,Vn.ch),Be.replaceSelection(Hr),Be.focus();case"add-multiple":return Zn===""&&Be.setCursor(Vn.line,Vn.ch),Be.replaceSelection(Tr),Be.focus();case"inster-template-1":return Zn===""&&Be.setCursor(Vn.line,Vn.ch),Be.replaceSelection(sr),Be.focus();case"eraser":return Be.setValue(""),Be.focus();case"trigger-watch":return Ft(!Tt),Be.focus();case"trigger-full-screen":return gn(!Ht),Be.focus();case On:Ln(On);return;case en:Ln(en);return;case tt:Ln(tt);return;case Ge:Ln(Ge);return;case"maths-latex":Ln("maths-latex");return;case Fe:gr.current="",sessionStorage.removeItem("file_id"),Ln(Fe);return;case ln:Ln(ln);return;default:throw new Error}},[Be,Tt,Ht]),Sr=(0,me.useCallback)((Yn,Vn)=>{var Zn,mr,ni,xi,Mi,gi;Ln("");const{src:ci,alt:_i,id:Hi}=Yn||{};switch(wn){case On:const{title:Ai,link:ai}=Yn;return Be.replaceSelection(`[${Ai}](${ai})`),Be.focus();case en:const{language:fi,content:ki}=Yn;return Be.replaceSelection(["```"+fi,ki,"```"].join(`
|
|
|
`)),Be.focus();case"maths-latex":for(var Ni=atob(Yn),oa=new Uint8Array(Ni.length),Xr=0;Xr<Ni.length;Xr++)oa[Xr]=Ni.charCodeAt(Xr);var ei=new Blob([oa],{type:"image/png"});(0,Xe.I)(ei,oi=>{oi.id?Be.replaceSelection(``):(oi==null?void 0:oi.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":Be.replaceSelection("`$$"+Yn+"$$`");break;case Zt:if(!Hi)return;Be.focus(),Be.getValue().indexOf(ci)===-1?Be.replaceSelection(`<center><img id="${Hi}" width="80%" src="${ci}" class="draw-flowchart" alt="${_i||""}" /></center>`):document.getElementById(Hi).src=fe.Z.API_SERVER+ci+"?t="+Date.now();try{setTimeout(()=>{vn(Be.getValue())},100)}catch(oi){}break;case tt:case Ge:const pi=Vn,Pr=(ni=(mr=(Zn=pi==null?void 0:pi.name)==null?void 0:Zn.split("."))==null?void 0:mr.pop)==null?void 0:ni.call(mr);return((xi=pi==null?void 0:pi.type)==null?void 0:xi.indexOf("image"))>-1||!(pi!=null&&pi.type)?pi!=null&&pi.align||pi!=null&&pi.width?Be.replaceSelection(`<p style="text-align:${pi.align||"initial"}"><img width="${pi.width?pi.width+"%":"initial"}" src="${ci}" alt="${_i||""}" /></p>`):Be.replaceSelection(`<img width="100%" src="${ci}" alt="${_i||""}" />`):((Mi=pi==null?void 0:pi.type)==null?void 0:Mi.indexOf("video"))>-1?Be.replaceSelection(`<video width="100%" controls src="${ci}"></video>`):((gi=pi==null?void 0:pi.type)==null?void 0:gi.indexOf("pdf"))>-1?Be.replaceSelection(`<a href="${ci}?type=${pi.type}&disposition=inline" target="_blank">${pi.name}</a>`):Mr.includes(Pr)?Be.replaceSelection(`<a href="${ci}?type=office&disposition=inline" target="_blank">${pi.name}</a>`):Be.replaceSelection(`[${pi.name}](${ci})`),Be.focus();case ln:const{row:Yr,col:Ur,align:zr}=Yn;let ui=`
|
|
|
`;for(let oi=0;oi<Yr;oi++){let zi=[],Wi=[];for(let Zi=0;Zi<Ur;Zi++)oi===1&&Wi.push(Tn[zr]),zi.push(" ");oi===1&&(ui+=`| ${Wi.join(" | ")} |
|
|
|
`),ui+=`| ${zi.join(Ur===1?"":" | ")} |
|
|
|
`}return Be.replaceSelection(ui+`
|
|
|
`),Be.focus();default:throw new Error}},[Be,wn]),ii=(0,me.useMemo)(()=>{switch(wn){case On:return me.createElement(nn,{callback:Sr,onCancel:Hn});case en:return me.createElement(Ut.Z,{callback:Sr,onCancel:Hn});case tt:return me.createElement(Xe.Z,{callback:Sr,onCancel:Hn});case Fe:return me.createElement(de,{editImgId:gr.current,callback:Sr,onCancel:Hn});case ln:return me.createElement($t,{callback:Sr,onCancel:Hn});case"maths-latex":return me.createElement(Cn,{showSaveButton:!0,callback:Sr});case"inline-latex":return me.createElement(xt.Z,{showSaveButton:!0,callback:Sr});default:return null}},[wn]);function Hn(){Ln("")}(0,me.useEffect)(()=>{if(_n.current){let Yn=function(Mi){ni=!0,xi=Mi.pageY},Vn=function(){ni=!1},Zn=function(Mi){if(ni){let gi=Mi.pageY-xi;gi<0&&(gi=0),gi>300&&(gi=300);let ci=$n+gi+"px";Un(ci)}},mr=_n.current,ni=!1,xi=0;return mr.addEventListener("mousedown",Yn),document.addEventListener("mousemove",Zn),document.addEventListener("mouseup",Vn),()=>{mr.removeEventListener("mousedown",Yn),document.removeEventListener("mousemove",Zn),document.removeEventListener("mouseup",Vn)}}},[Be,_n]),(0,me.useEffect)(()=>{Un($n)},[$n]);const qn=rr(Rn),Dr=rr(cr),$r={width:qn,height:Dr},li=(0,me.useMemo)(()=>{if(zn){let Yn=new Date(zn),Vn=Yn.getHours(),Zn=Yn.getMinutes(),mr=Yn.getSeconds();return Vn=Vn<10?"0"+Vn:Vn,Zn=Zn<10?"0"+Zn:Zn,mr=mr<10?"0"+mr:mr,`${Vn}:${Zn}:${mr}`}return 0},[zn]),di=Yn=>{const Vn=[];if(Ot){let Zn=-1;Yn=Yn.replace(/(@▁▁@|@▁@)/g,function(mr,ni,xi){Vn.push({multiLine:mr!==Hr})})}return Vn};function ri(){window.sessionStorage.removeItem(Te),fr(!1),er(0)}function Jr(){fr(!1),er(0),Be.setValue(window.sessionStorage.getItem(Te))}(0,me.useEffect)(()=>{jr[wn]&&wn!==Ge&&wn!==Fe&&setTimeout(()=>{const Yn=document.getElementsByClassName("markdown-popup-form")[0],Vn=window.innerWidth/2-Yn.offsetWidth/2,Zn=window.innerHeight/2-Yn.offsetHeight/2;br(Vn),Br(Zn)},0)},[wn]);const yi=Yn=>{Yn.preventDefault();const Vn=Yn.clientX-Xn,Zn=Yn.clientY-ur;document.body.onmousemove=mr=>{let ni=mr.clientX-Vn,xi=mr.clientY-Zn;const Mi=document.getElementsByClassName("markdown-popup-form")[0],gi=window.innerWidth-Mi.offsetWidth,ci=window.innerHeight-Mi.offsetHeight;ni=Math.max(0,Math.min(ni,gi)),xi=Math.max(0,Math.min(xi,ci)),bi(mr.clientX,mr.clientY,Vn,Zn)&&(br(ni),Br(xi))},document.body.onmouseup=function(){document.body.onmousemove=null}},bi=(Yn,Vn,Zn,mr)=>{const ni=document.body.clientHeight,xi=document.body.clientWidth;return Yn<20&&Zn>Yn||Yn>xi-20&&Zn<Yn||Vn<20&&mr>Vn||Vn>ni-20&&mr<Vn?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return me.createElement(me.Fragment,null,me.createElement("div",{className:"markdown-editor-wrapper",ref:ar},me.createElement("div",{className:`markdown-editor-container ${dn} ${Tt?"on-preview":""} ${wr?"mini":""} ${Ht?"full-screen":""}`,style:$r},me.createElement(Ue,{insertTemp:Pe,watch:Tt,fullScreen:Ht,showNullButton:Xt,showNullProgramButton:Ot,onActionCallback:pr,hidetoolBar:Yt,extraUse:Et}),me.createElement("div",{className:"markdown-editor-body"},me.createElement("div",{className:"codemirror-container"},me.createElement("textarea",{ref:Gr,placeholder:Pt})),Tt?me.createElement("div",{ref:Mn,className:"preview-container"},De==="stex"&&me.createElement(Le,{value:Ct}),De!=="stex"&&me.createElement(ut.Z,{edit:!0,disabledFill:Lt,showProgramFill:Ot,value:Ct,openEditor:Yn=>{var Vn;gr.current=Yn,(Vn=nr.current)==null||Vn.setHeight("100vh"),setTimeout(()=>{Ln("add-flowchart")},150)}})):null))),qe?me.createElement("a",{ref:_n,className:"editor-resize"}):null,wn===Ge&&me.createElement(un,{callback:Sr,onCancel:Hn}),wn===Fe&&me.createElement(de,{ref:nr,editImgId:gr.current,callback:Sr,onCancel:Hn}),me.createElement(bt.Z,null,jr[wn]&&wn!==Ge&&wn!==Fe?me.createElement(Ye.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:Xn,top:ur},title:me.createElement("div",{style:{cursor:"move"},onMouseDown:yi},jr[wn]),open:!0,onCancel:Hn,footer:null,destroyOnClose:!0,width:wn===Fe?"1200px":null,height:wn===Fe?"80vh":null,className:"markdown-popup-form"},ii):null))}},58448:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return He},I:function(){return bt}});var me=ue(78241),je=ue(8591),Ke=ue(92832),ot=ue(81327),be=ue(5871),Ae=ue(5112),Ne=ue(3113),Ce=ue(79090),Me=ue(59301),ze=ue(7544),ut=ue(59301),Le=Object.defineProperty,We=Object.defineProperties,yt=Object.getOwnPropertyDescriptors,et=Object.getOwnPropertySymbols,pt=Object.prototype.hasOwnProperty,at=Object.prototype.propertyIsEnumerable,St=(Ve,jt,st)=>jt in Ve?Le(Ve,jt,{enumerable:!0,configurable:!0,writable:!0,value:st}):Ve[jt]=st,Qt=(Ve,jt)=>{for(var st in jt||(jt={}))pt.call(jt,st)&&St(Ve,st,jt[st]);if(et)for(var st of et(jt))at.call(jt,st)&&St(Ve,st,jt[st]);return Ve},nt=(Ve,jt)=>We(Ve,yt(jt));const{useForm:ft}=me.default,Ze={width:280,marginRight:10},ke={labelCol:{span:5},wrapperCol:{span:19}};var He=({callback:Ve,onCancel:jt})=>{const[st]=ft();let Bt=(0,Me.useRef)();function Qe(It){Bt.current.width=st.getFieldValue("width"),Bt.current.align=st.getFieldValue("align"),Ve(It,Bt.current)}function zt(It,Rt){if(It.status===-1){je.ZP.error(It.message);return}st.setFieldsValue({src:`/api/attachments/${It.id}`,type:Rt.type})}function ct(It){let Rt=It.target.files[0];Bt.current=Rt,bt(Rt,zt)}return ut.createElement(me.default,nt(Qt({form:st},ke),{className:"upload-image-panel",onFinish:Qe,style:{width:470,overflow:"hidden"}}),ut.createElement(me.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},ut.createElement("div",{className:"flex-container"},ut.createElement(me.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},ut.createElement(Ke.default,{style:Ze})),ut.createElement(Ue,{onFileChange:ct}))),ut.createElement(me.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},ut.createElement(Ke.default,{style:{width:264}})),ut.createElement(me.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},ut.createElement(ot.Z,null,ut.createElement(me.default.Item,{name:"width",style:{margin:0}},ut.createElement(be.Z,{style:{width:264}})),ut.createElement("span",{className:"ml8"},"%"))),ut.createElement(me.default.Item,{label:"\u5BF9\u9F50\u65B9\u5F0F",name:"align"},ut.createElement(Ae.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"}]})),ut.createElement("aside",null,ut.createElement(me.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},ut.createElement(Ne.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),ut.createElement(Ne.ZP,{type:"default",onClick:jt},"\u53D6\u6D88"))))};function Ue({onFileChange:Ve}){return ut.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",ut.createElement("input",{type:"file",onChange:Ve}))}function bt(Ve,jt){if(!Ve)throw new String("\u6CA1\u6709\u6587\u4EF6");if(!(0,ze.bg)())throw je.ZP.warning("\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C"),new String("\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C");let st=new FormData;st.append("editormd-image-file",Ve),st.append("file_param_name","editormd-image-file"),st.append("byxhr","true");var Bt=new window.XMLHttpRequest;Bt.withCredentials=!0,Bt.addEventListener("load",function(Qe){jt(JSON.parse(Qe.target.responseText),Ve)},!1),Bt.addEventListener("error",function(Qe){console.error(Qe)},!1),Bt.open("POST",`${Ce.KI}/api/attachments.json`),Bt.send(st)}},53531:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Ke}});var me=ue(59301),je=ue(4676);class Ke extends me.Component{constructor(be){super(be);const Ae=window.document;this.node=Ae.createElement("div"),Ae.body.appendChild(this.node)}render(){const{children:be}=this.props;return(0,je.createPortal)(be,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},57649:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return je}});var me=ue(59301);function je(Ke,ot){const be=(0,me.useRef)();(0,me.useEffect)(()=>{be.current=Ke}),(0,me.useEffect)(()=>{function Ae(){be.current()}if(ot!==null){let Ne=setInterval(Ae,ot);return()=>clearInterval(Ne)}},[ot])}},77688:function(kn,cn,ue){"use strict";ue.r(cn),ue.d(cn,{default:function(){return He}});var me=ue(59301),je=ue(91482),Ke=ue(78241),ot=ue(8591),be=ue(66104),Ae=ue(92832),Ne=ue(54580),Ce=ue(3113),Me=ue(40973),ze=ue(6475),ut=ue(6521),Le={bg:"bg___VqFqM",flexRow:"flexRow___BMnDG",flexJustifyCenter:"flexJustifyCenter___oeWhy",flexAlignEnd:"flexAlignEnd___AM_yy",flexAlignCenter:"flexAlignCenter___oCn1N",flexColumn:"flexColumn___PQMFg",formWrap:"formWrap___iwUem",titleWrap:"titleWrap___SA96h",fieldWrap:"fieldWrap___tSPUZ",mdWrap:"mdWrap___C7Agk",backgroundFa:"backgroundFa___FaNz_",button:"button___fqiOn"},We=Object.defineProperty,yt=Object.defineProperties,et=Object.getOwnPropertyDescriptors,pt=Object.getOwnPropertySymbols,at=Object.prototype.hasOwnProperty,St=Object.prototype.propertyIsEnumerable,Qt=(Ue,bt,Ve)=>bt in Ue?We(Ue,bt,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):Ue[bt]=Ve,nt=(Ue,bt)=>{for(var Ve in bt||(bt={}))at.call(bt,Ve)&&Qt(Ue,Ve,bt[Ve]);if(pt)for(var Ve of pt(bt))St.call(bt,Ve)&&Qt(Ue,Ve,bt[Ve]);return Ue},ft=(Ue,bt)=>yt(Ue,et(bt)),Ze=(Ue,bt,Ve)=>new Promise((jt,st)=>{var Bt=ct=>{try{zt(Ve.next(ct))}catch(It){st(It)}},Qe=ct=>{try{zt(Ve.throw(ct))}catch(It){st(It)}},zt=ct=>ct.done?jt(ct.value):Promise.resolve(ct.value).then(Bt,Qe);zt((Ve=Ve.apply(Ue,bt)).next())});const ke=({shixunHomeworks:Ue,newCourse:bt,globalSetting:Ve,loading:jt,dispatch:st,match:Bt})=>{var Qe;const zt=(0,je.useParams)(),[ct]=Ke.default.useForm(),[It,Rt]=(0,me.useState)({}),[mt,$e]=(0,me.useState)(!1),[xe,ht]=(0,me.useState)([]),[nn,Ut]=(0,me.useState)([]),{commonHomeWorkEditDefaultData:Xe}=Ue,Ye={name:"file",multiple:!0,action:ut.Z.API_SERVER+"/api/attachments.json",defaultFileList:xe,onChange(un){const{status:Vt}=un.file;Vt==="done"?ot.ZP.success(`${un.file.name} \u6587\u4EF6\u4E0A\u4F20\u6210\u529F`):Vt==="error"&&ot.ZP.error(`${un.file.name} \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25`)}};(0,me.useEffect)(()=>{bn()},[zt.topicId]);const Dt=un=>un==null?void 0:un.map(Vt=>({uid:Vt.id,response:{id:Vt.id},name:Vt.title,status:"done",url:Vt.url})),bn=()=>Ze(void 0,null,function*(){const un=yield st({type:"shixunHomeworks/editCommonHomeWorkDefaultBankData",payload:{id:zt.topicId}});un&&(ct.setFieldsValue({name:un.name}),ct.setFieldsValue({description:un.description}),ct.setFieldsValue({reference_answer:un.reference_answer}),ht([...Dt(un.attachments)]),Ut([...Dt(un.reference_attachments)]),$e(!0))}),tn=un=>Ze(void 0,null,function*(){var Vt,Gt;const Wt=nt({},It);Wt.attachment_ids&&(Wt.attachment_ids=(Vt=Wt==null?void 0:Wt.attachment_ids.fileList)==null?void 0:Vt.map(se=>{var oe;return(oe=se.response)==null?void 0:oe.id})),Wt.reference_attachment_ids&&(Wt.reference_attachment_ids=(Gt=Wt==null?void 0:Wt.reference_attachment_ids.fileList)==null?void 0:Gt.map(se=>{var oe;return(oe=se.response)==null?void 0:oe.id})),(yield(0,ze.yT)(ft(nt({id:zt.topicId},Wt),{base_on_project:null,type:1})))&&je.history.push(`/users/${zt.username}/topics/${zt.topicId}/${zt.topictype}/normal/detail`)});return me.createElement("section",{className:Le.bg},me.createElement("section",{className:"animated fadeIn"},me.createElement("aside",{className:"mt10"},me.createElement(be.Z,{separator:">"},me.createElement(be.Z.Item,null,me.createElement(je.Link,{to:`/users/${zt.username}/${zt.topictype==="personal"?"topics":"topicbank"}/${zt.topictype}`},zt.topictype==="personal"?"\u6211\u7684\u8BFE\u5802\u8D44\u6E90":"\u516C\u5171\u9898\u5E93")),me.createElement(be.Z.Item,null,me.createElement(je.Link,{to:`/users/${zt.username}/topics/${zt.topicId}/${zt.topictype}/normal/detail`},"\u8BE6\u60C5")),me.createElement(be.Z.Item,null,"\u7F16\u8F91")))),me.createElement("aside",{className:"font24 bold mt20 mb20"},"\u7F16\u8F91"),me.createElement(Ke.default,{form:ct,className:Le.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:()=>{Rt(nt({},ct.getFieldsValue()))},onFinish:tn},me.createElement("div",{className:Le.fieldWrap},me.createElement(Ke.default.Item,{name:"name",label:"\u6807\u9898:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u9898"}]},me.createElement(Ae.default,{maxLength:60,suffix:`${((Qe=It.name)==null?void 0:Qe.length)||0}/60`,placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),me.createElement("div",{className:Le.mdWrap},me.createElement(Ke.default.Item,{name:"description",label:"\u7B80\u4ECB:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:5e3,message:"\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"}]},me.createElement(Me.Z,{id:"topic-normal-description",watch:!0,defaultValue:Xe.description})),me.createElement("div",null,me.createElement(Ke.default.Item,{name:"attachment_ids"},mt&&me.createElement(Ne.default,nt({defaultFileList:xe},Ye),me.createElement("span",{className:"c-blue"},"\u4E0A\u4F20\u9644\u4EF6")," \uFF08\u5355\u4E2A\u6587\u4EF6150MB\u4EE5\u5185\uFF09")))),me.createElement("div",{className:Le.mdWrap},me.createElement(Ke.default.Item,{name:"reference_answer",label:"\u53C2\u8003\u7B54\u6848:"},me.createElement(Me.Z,{id:"topic-normal-reference_answer",defaultValue:Xe.reference_answer,watch:!0})),me.createElement("div",null,me.createElement(Ke.default.Item,{name:"reference_attachment_ids"},mt&&me.createElement(Ne.default,ft(nt({},Ye),{defaultFileList:nn}),me.createElement("span",{className:"c-blue"},"\u4E0A\u4F20\u9644\u4EF6")," \uFF08\u5355\u4E2A\u6587\u4EF6150MB\u4EE5\u5185\uFF09")))),me.createElement("div",{className:Le.backgroundFa},me.createElement("div",{className:"pt40 mb30"},me.createElement(Ke.default.Item,null,me.createElement(Ce.ZP,{size:"middle",type:"primary",className:`${Le.button} mr20`,htmlType:"submit"},"\u63D0\u4EA4"),me.createElement(Ce.ZP,{size:"middle",type:"primary",ghost:!0,className:Le.button,onClick:()=>je.history.push(`/users/${zt.username}/topics/${zt.topicId}/${zt.topictype}/normal/detail`)},"\u53D6\u6D88"))))))};var He=(0,je.connect)(({shixunHomeworks:Ue,newCourse:bt,loading:Ve,globalSetting:jt})=>({shixunHomeworks:Ue,newCourse:bt,globalSetting:jt,loading:Ve.effects}))(ke)},56762:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return je}});var me=ue(59301);function je(){const[,Ke]=me.useReducer(ot=>ot+1,0);return Ke}},19080:function(kn,cn,ue){"use strict";ue.d(cn,{F:function(){return be},Z:function(){return ot}});var me=ue(92310),je=ue.n(me);const Ke=null;function ot(Ae,Ne,Ce){return je()({[`${Ae}-status-success`]:Ne==="success",[`${Ae}-status-warning`]:Ne==="warning",[`${Ae}-status-error`]:Ne==="error",[`${Ae}-status-validating`]:Ne==="validating",[`${Ae}-has-feedback`]:Ce})}const be=(Ae,Ne)=>Ne||Ae},66104:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return zt}});var me=ue(92310),je=ue.n(me),Ke=ue(11592),ot=ue(26112),be=ue(59301),Ae=ue(92343),Ne=ue(36355),Ce=ue(84105),Me=ue(91857);const ze=ct=>{let{children:It}=ct;const{getPrefixCls:Rt}=be.useContext(Ne.E_),mt=Rt("breadcrumb");return be.createElement("li",{className:`${mt}-separator`,"aria-hidden":"true"},It===""?It:It||"/")};ze.__ANT_BREADCRUMB_SEPARATOR=!0;var ut=ze,Le=function(ct,It){var Rt={};for(var mt in ct)Object.prototype.hasOwnProperty.call(ct,mt)&&It.indexOf(mt)<0&&(Rt[mt]=ct[mt]);if(ct!=null&&typeof Object.getOwnPropertySymbols=="function")for(var $e=0,mt=Object.getOwnPropertySymbols(ct);$e<mt.length;$e++)It.indexOf(mt[$e])<0&&Object.prototype.propertyIsEnumerable.call(ct,mt[$e])&&(Rt[mt[$e]]=ct[mt[$e]]);return Rt};function We(ct,It){if(ct.title===void 0||ct.title===null)return null;const Rt=Object.keys(It).join("|");return typeof ct.title=="object"?ct.title:String(ct.title).replace(new RegExp(`:(${Rt})`,"g"),(mt,$e)=>It[$e]||mt)}function yt(ct,It,Rt,mt){if(Rt==null)return null;const{className:$e,onClick:xe}=It,ht=Le(It,["className","onClick"]),nn=Object.assign(Object.assign({},(0,ot.Z)(ht,{data:!0,aria:!0})),{onClick:xe});return mt!==void 0?be.createElement("a",Object.assign({},nn,{className:je()(`${ct}-link`,$e),href:mt}),Rt):be.createElement("span",Object.assign({},nn,{className:je()(`${ct}-link`,$e)}),Rt)}function et(ct,It){return(mt,$e,xe,ht,nn)=>{if(It)return It(mt,$e,xe,ht);const Ut=We(mt,$e);return yt(ct,mt,Ut,nn)}}var pt=function(ct,It){var Rt={};for(var mt in ct)Object.prototype.hasOwnProperty.call(ct,mt)&&It.indexOf(mt)<0&&(Rt[mt]=ct[mt]);if(ct!=null&&typeof Object.getOwnPropertySymbols=="function")for(var $e=0,mt=Object.getOwnPropertySymbols(ct);$e<mt.length;$e++)It.indexOf(mt[$e])<0&&Object.prototype.propertyIsEnumerable.call(ct,mt[$e])&&(Rt[mt[$e]]=ct[mt[$e]]);return Rt};const at=ct=>{const{prefixCls:It,separator:Rt="/",children:mt,menu:$e,overlay:xe,dropdownProps:ht,href:nn}=ct,Xe=(Ye=>{if($e||xe){const Dt=Object.assign({},ht);if($e){const bn=$e||{},{items:tn}=bn,un=pt(bn,["items"]);Dt.menu=Object.assign(Object.assign({},un),{items:tn==null?void 0:tn.map((Vt,Gt)=>{var{key:Wt,title:ye,label:se,path:oe}=Vt,de=pt(Vt,["key","title","label","path"]);let fe=se!=null?se:ye;return oe&&(fe=be.createElement("a",{href:`${nn}${oe}`},fe)),Object.assign(Object.assign({},de),{key:Wt!=null?Wt:Gt,label:fe})})})}else xe&&(Dt.overlay=xe);return be.createElement(Me.Z,Object.assign({placement:"bottom"},Dt),be.createElement("span",{className:`${It}-overlay-link`},Ye,be.createElement(Ce.Z,null)))}return Ye})(mt);return Xe!=null?be.createElement(be.Fragment,null,be.createElement("li",null,Xe),Rt&&be.createElement(ut,null,Rt)):null},St=ct=>{const{prefixCls:It,children:Rt,href:mt}=ct,$e=pt(ct,["prefixCls","children","href"]),{getPrefixCls:xe}=be.useContext(Ne.E_),ht=xe("breadcrumb",It);return be.createElement(at,Object.assign({},$e,{prefixCls:ht}),yt(ht,$e,Rt,mt))};St.__ANT_BREADCRUMB_ITEM=!0;var Qt=St,nt=ue(17313),ft=ue(83116),Ze=ue(37613);const ke=ct=>{const{componentCls:It,iconCls:Rt}=ct;return{[It]:Object.assign(Object.assign({},(0,nt.Wf)(ct)),{color:ct.itemColor,fontSize:ct.fontSize,[Rt]:{fontSize:ct.iconFontSize},ol:{display:"flex",flexWrap:"wrap",margin:0,padding:0,listStyle:"none"},a:Object.assign({color:ct.linkColor,transition:`color ${ct.motionDurationMid}`,padding:`0 ${ct.paddingXXS}px`,borderRadius:ct.borderRadiusSM,height:ct.lineHeight*ct.fontSize,display:"inline-block",marginInline:-ct.marginXXS,"&:hover":{color:ct.linkHoverColor,backgroundColor:ct.colorBgTextHover}},(0,nt.Qy)(ct)),"li:last-child":{color:ct.lastItemColor},[`${It}-separator`]:{marginInline:ct.separatorMargin,color:ct.separatorColor},[`${It}-link`]:{[`
|
|
|
> ${Rt} + span,
|
|
|
> ${Rt} + a
|
|
|
`]:{marginInlineStart:ct.marginXXS}},[`${It}-overlay-link`]:{borderRadius:ct.borderRadiusSM,height:ct.lineHeight*ct.fontSize,display:"inline-block",padding:`0 ${ct.paddingXXS}px`,marginInline:-ct.marginXXS,[`> ${Rt}`]:{marginInlineStart:ct.marginXXS,fontSize:ct.fontSizeIcon},"&:hover":{color:ct.linkHoverColor,backgroundColor:ct.colorBgTextHover,a:{color:ct.linkHoverColor}},a:{"&:hover":{backgroundColor:"transparent"}}},[`&${ct.componentCls}-rtl`]:{direction:"rtl"}})}};var He=(0,ft.Z)("Breadcrumb",ct=>{const It=(0,Ze.TS)(ct,{});return[ke(It)]},ct=>({itemColor:ct.colorTextDescription,lastItemColor:ct.colorText,iconFontSize:ct.fontSize,linkColor:ct.colorTextDescription,linkHoverColor:ct.colorText,separatorColor:ct.colorTextDescription,separatorMargin:ct.marginXS})),Ue=function(ct,It){var Rt={};for(var mt in ct)Object.prototype.hasOwnProperty.call(ct,mt)&&It.indexOf(mt)<0&&(Rt[mt]=ct[mt]);if(ct!=null&&typeof Object.getOwnPropertySymbols=="function")for(var $e=0,mt=Object.getOwnPropertySymbols(ct);$e<mt.length;$e++)It.indexOf(mt[$e])<0&&Object.prototype.propertyIsEnumerable.call(ct,mt[$e])&&(Rt[mt[$e]]=ct[mt[$e]]);return Rt};function bt(ct){const{breadcrumbName:It,children:Rt}=ct,mt=Ue(ct,["breadcrumbName","children"]),$e=Object.assign({title:It},mt);return Rt&&($e.menu={items:Rt.map(xe=>{var{breadcrumbName:ht}=xe,nn=Ue(xe,["breadcrumbName"]);return Object.assign(Object.assign({},nn),{title:ht})})}),$e}function Ve(ct,It){return(0,be.useMemo)(()=>ct||(It?It.map(bt):null),[ct,It])}var jt=function(ct,It){var Rt={};for(var mt in ct)Object.prototype.hasOwnProperty.call(ct,mt)&&It.indexOf(mt)<0&&(Rt[mt]=ct[mt]);if(ct!=null&&typeof Object.getOwnPropertySymbols=="function")for(var $e=0,mt=Object.getOwnPropertySymbols(ct);$e<mt.length;$e++)It.indexOf(mt[$e])<0&&Object.prototype.propertyIsEnumerable.call(ct,mt[$e])&&(Rt[mt[$e]]=ct[mt[$e]]);return Rt};const st=(ct,It)=>{if(It===void 0)return It;let Rt=(It||"").replace(/^\//,"");return Object.keys(ct).forEach(mt=>{Rt=Rt.replace(`:${mt}`,ct[mt])}),Rt},Bt=ct=>{const{prefixCls:It,separator:Rt="/",style:mt,className:$e,rootClassName:xe,routes:ht,items:nn,children:Ut,itemRender:Xe,params:Ye={}}=ct,Dt=jt(ct,["prefixCls","separator","style","className","rootClassName","routes","items","children","itemRender","params"]),{getPrefixCls:bn,direction:tn,breadcrumb:un}=be.useContext(Ne.E_);let Vt;const Gt=bn("breadcrumb",It),[Wt,ye]=He(Gt),se=Ve(nn,ht),oe=et(Gt,Xe);if(se&&se.length>0){const le=[],Ie=nn||ht;Vt=se.map((it,Kt)=>{const{path:$t,key:Jt,type:qt,menu:on,overlay:mn,onClick:Cn,className:xt,separator:hn,dropdownProps:On}=it,tt=st(Ye,$t);tt!==void 0&&le.push(tt);const Fe=Jt!=null?Jt:Kt;if(qt==="separator")return be.createElement(ut,{key:Fe},hn);const Ge={},Zt=Kt===se.length-1;on?Ge.menu=on:mn&&(Ge.overlay=mn);let{href:en}=it;return le.length&&tt!==void 0&&(en=`#/${le.join("/")}`),be.createElement(at,Object.assign({key:Fe},Ge,(0,ot.Z)(it,{data:!0,aria:!0}),{className:xt,dropdownProps:On,href:en,separator:Zt?"":Rt,onClick:Cn,prefixCls:Gt}),oe(it,Ye,Ie,le,en))})}else if(Ut){const le=(0,Ke.Z)(Ut).length;Vt=(0,Ke.Z)(Ut).map((Ie,it)=>{if(!Ie)return Ie;const Kt=it===le-1;return(0,Ae.Tm)(Ie,{separator:Kt?"":Rt,key:it})})}const de=je()(Gt,un==null?void 0:un.className,{[`${Gt}-rtl`]:tn==="rtl"},$e,xe,ye),fe=Object.assign(Object.assign({},un==null?void 0:un.style),mt);return Wt(be.createElement("nav",Object.assign({className:de,style:fe},Dt),be.createElement("ol",null,Vt)))};Bt.Item=Qt,Bt.Separator=ut;var Qe=Bt,zt=Qe},93891:function(kn,cn,ue){"use strict";var me=ue(59301),je=ue(36355),Ke=ue(64165);const ot=be=>{const{componentName:Ae}=be,{getPrefixCls:Ne}=(0,me.useContext)(je.E_),Ce=Ne("empty");switch(Ae){case"Table":case"List":return me.createElement(Ke.Z,{image:Ke.Z.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return me.createElement(Ke.Z,{image:Ke.Z.PRESENTED_IMAGE_SIMPLE,className:`${Ce}-small`});default:return me.createElement(Ke.Z,null)}};cn.Z=ot},43428:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Vt}});var me=ue(92310),je=ue.n(me),Ke=ue(85899),ot=ue(72190),be=ue(43403),Ae=ue(34280),Ne=ue(59301),Ce=Ne.createContext(null),Me=Ne.createContext({}),ze=Ce,ut=ue(18642),Le=ue(60499),We=ue(77900),yt=ue(10228),et=ue(26112),pt=ue(70425),at=function(Wt){var ye=Wt.prefixCls,se=Wt.className,oe=Wt.style,de=Wt.children,fe=Wt.containerRef,le=Wt.id,Ie=Wt.onMouseEnter,it=Wt.onMouseOver,Kt=Wt.onMouseLeave,$t=Wt.onClick,Jt=Wt.onKeyDown,qt=Wt.onKeyUp,on={onMouseEnter:Ie,onMouseOver:it,onMouseLeave:Kt,onClick:$t,onKeyDown:Jt,onKeyUp:qt},mn=Ne.useContext(Me),Cn=mn.panel,xt=(0,pt.useComposeRef)(Cn,fe);return Ne.createElement(Ne.Fragment,null,Ne.createElement("div",(0,Le.Z)({id:le,className:je()("".concat(ye,"-content"),se),style:(0,Ke.Z)({},oe),"aria-modal":"true",role:"dialog",ref:xt},on),de))},St=at,Qt=ue(48736);function nt(Gt){return typeof Gt=="string"&&String(Number(Gt))===Gt?((0,Qt.ZP)(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(Gt)):Gt}function ft(Gt){warning(!("wrapperClassName"in Gt),"'wrapperClassName' is removed. Please use 'rootClassName' instead."),warning(canUseDom()||!Gt.open,"Drawer with 'open' in SSR is not work since no place to createPortal. Please move to 'useEffect' instead.")}var Ze={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function ke(Gt,Wt){var ye,se,oe,de,fe=Gt.prefixCls,le=Gt.open,Ie=Gt.placement,it=Gt.inline,Kt=Gt.push,$t=Gt.forceRender,Jt=Gt.autoFocus,qt=Gt.keyboard,on=Gt.rootClassName,mn=Gt.rootStyle,Cn=Gt.zIndex,xt=Gt.className,hn=Gt.id,On=Gt.style,tt=Gt.motion,Fe=Gt.width,Ge=Gt.height,Zt=Gt.children,en=Gt.contentWrapperStyle,ln=Gt.mask,Dn=Gt.maskClosable,Tn=Gt.maskMotion,En=Gt.maskClassName,Fn=Gt.maskStyle,jn=Gt.afterOpenChange,An=Gt.onClose,hr=Gt.onMouseEnter,_r=Gt.onMouseOver,Tr=Gt.onMouseLeave,Hr=Gt.onClick,sr=Gt.onKeyDown,Mr=Gt.onKeyUp,rr=Ne.useRef(),Or=Ne.useRef(),Fr=Ne.useRef();Ne.useImperativeHandle(Wt,function(){return rr.current});var Er=function(Ot){var Yt=Ot.keyCode,pn=Ot.shiftKey;switch(Yt){case yt.Z.TAB:{if(Yt===yt.Z.TAB){if(!pn&&document.activeElement===Fr.current){var vn;(vn=Or.current)===null||vn===void 0||vn.focus({preventScroll:!0})}else if(pn&&document.activeElement===Or.current){var Sn;(Sn=Fr.current)===null||Sn===void 0||Sn.focus({preventScroll:!0})}}break}case yt.Z.ESC:{An&&qt&&(Ot.stopPropagation(),An(Ot));break}}};Ne.useEffect(function(){if(le&&Jt){var Xt;(Xt=rr.current)===null||Xt===void 0||Xt.focus({preventScroll:!0})}},[le]);var jr=Ne.useState(!1),Nr=(0,ot.Z)(jr,2),Jn=Nr[0],lr=Nr[1],Rn=Ne.useContext(ze),$n;Kt===!1?$n={distance:0}:Kt===!0?$n={}:$n=Kt||{};var wr=(ye=(se=(oe=$n)===null||oe===void 0?void 0:oe.distance)!==null&&se!==void 0?se:Rn==null?void 0:Rn.pushDistance)!==null&&ye!==void 0?ye:180,lt=Ne.useMemo(function(){return{pushDistance:wr,push:function(){lr(!0)},pull:function(){lr(!1)}}},[wr]);Ne.useEffect(function(){if(le){var Xt;Rn==null||(Xt=Rn.push)===null||Xt===void 0||Xt.call(Rn)}else{var Ot;Rn==null||(Ot=Rn.pull)===null||Ot===void 0||Ot.call(Rn)}},[le]),Ne.useEffect(function(){return function(){var Xt;Rn==null||(Xt=Rn.pull)===null||Xt===void 0||Xt.call(Rn)}},[]);var _e=ln&&Ne.createElement(We.default,(0,Le.Z)({key:"mask"},Tn,{visible:le}),function(Xt,Ot){var Yt=Xt.className,pn=Xt.style;return Ne.createElement("div",{className:je()("".concat(fe,"-mask"),Yt,En),style:(0,Ke.Z)((0,Ke.Z)({},pn),Fn),onClick:Dn&&le?An:void 0,ref:Ot})}),Pe=typeof tt=="function"?tt(Ie):tt,De={};if(Jn&&wr)switch(Ie){case"top":De.transform="translateY(".concat(wr,"px)");break;case"bottom":De.transform="translateY(".concat(-wr,"px)");break;case"left":De.transform="translateX(".concat(wr,"px)");break;default:De.transform="translateX(".concat(-wr,"px)");break}Ie==="left"||Ie==="right"?De.width=nt(Fe):De.height=nt(Ge);var Te={onMouseEnter:hr,onMouseOver:_r,onMouseLeave:Tr,onClick:Hr,onKeyDown:sr,onKeyUp:Mr},qe=Ne.createElement(We.default,(0,Le.Z)({key:"panel"},Pe,{visible:le,forceRender:$t,onVisibleChanged:function(Ot){jn==null||jn(Ot)},removeOnLeave:!1,leavedClassName:"".concat(fe,"-content-wrapper-hidden")}),function(Xt,Ot){var Yt=Xt.className,pn=Xt.style;return Ne.createElement("div",(0,Le.Z)({className:je()("".concat(fe,"-content-wrapper"),Yt),style:(0,Ke.Z)((0,Ke.Z)((0,Ke.Z)({},De),pn),en)},(0,et.Z)(Gt,{data:!0})),Ne.createElement(St,(0,Le.Z)({id:hn,containerRef:Ot,prefixCls:fe,className:xt,style:On},Te),Zt))}),dt=(0,Ke.Z)({},mn);return Cn&&(dt.zIndex=Cn),Ne.createElement(ze.Provider,{value:lt},Ne.createElement("div",{className:je()(fe,"".concat(fe,"-").concat(Ie),on,(de={},(0,ut.Z)(de,"".concat(fe,"-open"),le),(0,ut.Z)(de,"".concat(fe,"-inline"),it),de)),style:dt,tabIndex:-1,ref:rr,onKeyDown:Er},_e,Ne.createElement("div",{tabIndex:0,ref:Or,style:Ze,"aria-hidden":"true","data-sentinel":"start"}),qe,Ne.createElement("div",{tabIndex:0,ref:Fr,style:Ze,"aria-hidden":"true","data-sentinel":"end"})))}var He=Ne.forwardRef(ke),Ue=He,bt=function(Wt){var ye=Wt.open,se=ye===void 0?!1:ye,oe=Wt.prefixCls,de=oe===void 0?"rc-drawer":oe,fe=Wt.placement,le=fe===void 0?"right":fe,Ie=Wt.autoFocus,it=Ie===void 0?!0:Ie,Kt=Wt.keyboard,$t=Kt===void 0?!0:Kt,Jt=Wt.width,qt=Jt===void 0?378:Jt,on=Wt.mask,mn=on===void 0?!0:on,Cn=Wt.maskClosable,xt=Cn===void 0?!0:Cn,hn=Wt.getContainer,On=Wt.forceRender,tt=Wt.afterOpenChange,Fe=Wt.destroyOnClose,Ge=Wt.onMouseEnter,Zt=Wt.onMouseOver,en=Wt.onMouseLeave,ln=Wt.onClick,Dn=Wt.onKeyDown,Tn=Wt.onKeyUp,En=Wt.panelRef,Fn=Ne.useState(!1),jn=(0,ot.Z)(Fn,2),An=jn[0],hr=jn[1],_r=Ne.useState(!1),Tr=(0,ot.Z)(_r,2),Hr=Tr[0],sr=Tr[1];(0,Ae.Z)(function(){sr(!0)},[]);var Mr=Hr?se:!1,rr=Ne.useRef(),Or=Ne.useRef();(0,Ae.Z)(function(){Mr&&(Or.current=document.activeElement)},[Mr]);var Fr=function(lr){var Rn;if(hr(lr),tt==null||tt(lr),!lr&&Or.current&&!((Rn=rr.current)!==null&&Rn!==void 0&&Rn.contains(Or.current))){var $n;($n=Or.current)===null||$n===void 0||$n.focus({preventScroll:!0})}},Er=Ne.useMemo(function(){return{panel:En}},[En]);if(!On&&!An&&!Mr&&Fe)return null;var jr={onMouseEnter:Ge,onMouseOver:Zt,onMouseLeave:en,onClick:ln,onKeyDown:Dn,onKeyUp:Tn},Nr=(0,Ke.Z)((0,Ke.Z)({},Wt),{},{open:Mr,prefixCls:de,placement:le,autoFocus:it,keyboard:$t,width:qt,mask:mn,maskClosable:xt,inline:hn===!1,afterOpenChange:Fr,ref:rr},jr);return Ne.createElement(Me.Provider,{value:Er},Ne.createElement(be.Z,{open:Mr||On||An,autoDestroy:!1,getContainer:hn,autoLock:mn&&(Mr||An)},Ne.createElement(Ue,Nr)))},Ve=bt,jt=Ve,st=ue(62892),Bt=ue(36355),Qe=ue(32441),zt=ue(47729),It=Gt=>{const{prefixCls:Wt,title:ye,footer:se,extra:oe,closeIcon:de,closable:fe,onClose:le,headerStyle:Ie,drawerStyle:it,bodyStyle:Kt,footerStyle:$t,children:Jt}=Gt,qt=Ne.useCallback(hn=>Ne.createElement("button",{type:"button",onClick:le,"aria-label":"Close",className:`${Wt}-close`},hn),[le]),[on,mn]=(0,zt.Z)(fe,de,qt,void 0,!0),Cn=Ne.useMemo(()=>!ye&&!on?null:Ne.createElement("div",{style:Ie,className:je()(`${Wt}-header`,{[`${Wt}-header-close-only`]:on&&!ye&&!oe})},Ne.createElement("div",{className:`${Wt}-header-title`},mn,ye&&Ne.createElement("div",{className:`${Wt}-title`},ye)),oe&&Ne.createElement("div",{className:`${Wt}-extra`},oe)),[on,mn,oe,Ie,Wt,ye]),xt=Ne.useMemo(()=>{if(!se)return null;const hn=`${Wt}-footer`;return Ne.createElement("div",{className:hn,style:$t},se)},[se,$t,Wt]);return Ne.createElement("div",{className:`${Wt}-wrapper-body`,style:it},Cn,Ne.createElement("div",{className:`${Wt}-body`,style:Kt},Jt),xt)},Rt=ue(33234),mt=ue(83116),$e=ue(37613),ht=Gt=>{const{componentCls:Wt,motionDurationSlow:ye}=Gt,se={"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${ye}`}}};return{[Wt]:{[`${Wt}-mask-motion`]:{"&-enter, &-appear, &-leave":{"&-active":{transition:`all ${ye}`}},"&-enter, &-appear":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}}},[`${Wt}-panel-motion`]:{"&-left":[se,{"&-enter, &-appear":{"&-start":{transform:"translateX(-100%) !important"},"&-active":{transform:"translateX(0)"}},"&-leave":{transform:"translateX(0)","&-active":{transform:"translateX(-100%)"}}}],"&-right":[se,{"&-enter, &-appear":{"&-start":{transform:"translateX(100%) !important"},"&-active":{transform:"translateX(0)"}},"&-leave":{transform:"translateX(0)","&-active":{transform:"translateX(100%)"}}}],"&-top":[se,{"&-enter, &-appear":{"&-start":{transform:"translateY(-100%) !important"},"&-active":{transform:"translateY(0)"}},"&-leave":{transform:"translateY(0)","&-active":{transform:"translateY(-100%)"}}}],"&-bottom":[se,{"&-enter, &-appear":{"&-start":{transform:"translateY(100%) !important"},"&-active":{transform:"translateY(0)"}},"&-leave":{transform:"translateY(0)","&-active":{transform:"translateY(100%)"}}}]}}}};const nn=Gt=>{const{componentCls:Wt,zIndexPopup:ye,colorBgMask:se,colorBgElevated:oe,motionDurationSlow:de,motionDurationMid:fe,padding:le,paddingLG:Ie,fontSizeLG:it,lineHeightLG:Kt,lineWidth:$t,lineType:Jt,colorSplit:qt,marginSM:on,colorIcon:mn,colorIconHover:Cn,colorText:xt,fontWeightStrong:hn,footerPaddingBlock:On,footerPaddingInline:tt}=Gt,Fe=`${Wt}-content-wrapper`;return{[Wt]:{position:"fixed",inset:0,zIndex:ye,pointerEvents:"none","&-pure":{position:"relative",background:oe,[`&${Wt}-left`]:{boxShadow:Gt.boxShadowDrawerLeft},[`&${Wt}-right`]:{boxShadow:Gt.boxShadowDrawerRight},[`&${Wt}-top`]:{boxShadow:Gt.boxShadowDrawerUp},[`&${Wt}-bottom`]:{boxShadow:Gt.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${Wt}-mask`]:{position:"absolute",inset:0,zIndex:ye,background:se,pointerEvents:"auto"},[Fe]:{position:"absolute",zIndex:ye,maxWidth:"100vw",transition:`all ${de}`,"&-hidden":{display:"none"}},[`&-left > ${Fe}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:Gt.boxShadowDrawerLeft},[`&-right > ${Fe}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:Gt.boxShadowDrawerRight},[`&-top > ${Fe}`]:{top:0,insetInline:0,boxShadow:Gt.boxShadowDrawerUp},[`&-bottom > ${Fe}`]:{bottom:0,insetInline:0,boxShadow:Gt.boxShadowDrawerDown},[`${Wt}-content`]:{width:"100%",height:"100%",overflow:"auto",background:oe,pointerEvents:"auto"},[`${Wt}-wrapper-body`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%"},[`${Wt}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${le}px ${Ie}px`,fontSize:it,lineHeight:Kt,borderBottom:`${$t}px ${Jt} ${qt}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${Wt}-extra`]:{flex:"none"},[`${Wt}-close`]:{display:"inline-block",marginInlineEnd:on,color:mn,fontWeight:hn,fontSize:it,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,outline:0,cursor:"pointer",transition:`color ${fe}`,textRendering:"auto","&:focus, &:hover":{color:Cn,textDecoration:"none"}},[`${Wt}-title`]:{flex:1,margin:0,color:xt,fontWeight:Gt.fontWeightStrong,fontSize:it,lineHeight:Kt},[`${Wt}-body`]:{flex:1,minWidth:0,minHeight:0,padding:Ie,overflow:"auto"},[`${Wt}-footer`]:{flexShrink:0,padding:`${On}px ${tt}px`,borderTop:`${$t}px ${Jt} ${qt}`},"&-rtl":{direction:"rtl"}}}};var Ut=(0,mt.Z)("Drawer",Gt=>{const Wt=(0,$e.TS)(Gt,{});return[nn(Wt),ht(Wt)]},Gt=>({zIndexPopup:Gt.zIndexPopupBase,footerPaddingBlock:Gt.paddingXS,footerPaddingInline:Gt.padding})),Xe=ue(11575),Ye=function(Gt,Wt){var ye={};for(var se in Gt)Object.prototype.hasOwnProperty.call(Gt,se)&&Wt.indexOf(se)<0&&(ye[se]=Gt[se]);if(Gt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var oe=0,se=Object.getOwnPropertySymbols(Gt);oe<se.length;oe++)Wt.indexOf(se[oe])<0&&Object.prototype.propertyIsEnumerable.call(Gt,se[oe])&&(ye[se[oe]]=Gt[se[oe]]);return ye};const Dt=null,bn={distance:180},tn=Gt=>{var Wt;const{rootClassName:ye,width:se,height:oe,size:de="default",mask:fe=!0,push:le=bn,open:Ie,afterOpenChange:it,onClose:Kt,prefixCls:$t,getContainer:Jt,style:qt,className:on,visible:mn,afterVisibleChange:Cn}=Gt,xt=Ye(Gt,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","style","className","visible","afterVisibleChange"]),{getPopupContainer:hn,getPrefixCls:On,direction:tt,drawer:Fe}=Ne.useContext(Bt.E_),Ge=On("drawer",$t),[Zt,en]=Ut(Ge),ln=Jt===void 0&&hn?()=>hn(document.body):Jt,Dn=je()({"no-mask":!fe,[`${Ge}-rtl`]:tt==="rtl"},ye,en),Tn=Ne.useMemo(()=>se!=null?se:de==="large"?736:378,[se,de]),En=Ne.useMemo(()=>oe!=null?oe:de==="large"?736:378,[oe,de]),Fn={motionName:(0,st.m)(Ge,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},jn=hr=>({motionName:(0,st.m)(Ge,`panel-motion-${hr}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),An=(0,Xe.H)();return Zt(Ne.createElement(Rt.BR,null,Ne.createElement(Qe.Ux,{status:!0,override:!0},Ne.createElement(jt,Object.assign({prefixCls:Ge,onClose:Kt,maskMotion:Fn,motion:jn},xt,{open:Ie!=null?Ie:mn,mask:fe,push:le,width:Tn,height:En,style:Object.assign(Object.assign({},Fe==null?void 0:Fe.style),qt),className:je()(Fe==null?void 0:Fe.className,on),rootClassName:Dn,getContainer:ln,afterOpenChange:it!=null?it:Cn,panelRef:An}),Ne.createElement(It,Object.assign({prefixCls:Ge},xt,{onClose:Kt}))))))},un=Gt=>{const{prefixCls:Wt,style:ye,className:se,placement:oe="right"}=Gt,de=Ye(Gt,["prefixCls","style","className","placement"]),{getPrefixCls:fe}=Ne.useContext(Bt.E_),le=fe("drawer",Wt),[Ie,it]=Ut(le),Kt=je()(le,`${le}-pure`,`${le}-${oe}`,it,se);return Ie(Ne.createElement("div",{className:Kt,style:ye},Ne.createElement(It,Object.assign({prefixCls:le},de))))};tn._InternalPanelDoNotUseOrYouWillBeFired=un;var Vt=tn},91857:function(kn,cn,ue){"use strict";var me=ue(59301),je=ue(38819),Ke=ue(92310),ot=ue.n(Ke),be=ue(31561),Ae=ue(70425),Ne=ue(18929),Ce=ue(2738),Me=ue(79676),ze=ue(53487),ut=ue(92343),Le=ue(36355),We=ue(20834),yt=ue(40875),et=ue(88088),pt=ue(47211);const at=null,St=Ze=>{const{menu:ke,arrow:He,prefixCls:Ue,children:bt,trigger:Ve,disabled:jt,dropdownRender:st,getPopupContainer:Bt,overlayClassName:Qe,rootClassName:zt,open:ct,onOpenChange:It,visible:Rt,onVisibleChange:mt,mouseEnterDelay:$e=.15,mouseLeaveDelay:xe=.1,autoAdjustOverflow:ht=!0,placement:nn="",overlay:Ut,transitionName:Xe}=Ze,{getPopupContainer:Ye,getPrefixCls:Dt,direction:bn}=me.useContext(Le.E_),tn=me.useMemo(()=>{const on=Dt();return Xe!==void 0?Xe:nn.includes("top")?`${on}-slide-down`:`${on}-slide-up`},[Dt,nn,Xe]),un=me.useMemo(()=>nn?nn.includes("Center")?nn.slice(0,nn.indexOf("Center")):nn:bn==="rtl"?"bottomRight":"bottomLeft",[nn,bn]),Vt=Dt("dropdown",Ue),[Gt,Wt]=(0,pt.Z)(Vt),[,ye]=(0,et.Z)(),se=me.Children.only(bt),oe=(0,ut.Tm)(se,{className:ot()(`${Vt}-trigger`,{[`${Vt}-rtl`]:bn==="rtl"},se.props.className),disabled:jt}),de=jt?[]:Ve;let fe;de&&de.includes("contextMenu")&&(fe=!0);const[le,Ie]=(0,Ne.Z)(!1,{value:ct!=null?ct:Rt}),it=(0,Ae.useEvent)(on=>{It==null||It(on),mt==null||mt(on),Ie(on)}),Kt=ot()(Qe,zt,Wt,{[`${Vt}-rtl`]:bn==="rtl"}),$t=(0,Me.Z)({arrowPointAtCenter:typeof He=="object"&&He.pointAtCenter,autoAdjustOverflow:ht,offset:ye.marginXXS,arrowWidth:He?ye.sizePopupArrow:0,borderRadius:ye.borderRadius}),Jt=me.useCallback(()=>{Ie(!1)},[]),qt=()=>{let on;return ke!=null&&ke.items?on=me.createElement(We.default,Object.assign({},ke)):typeof Ut=="function"?on=Ut():on=Ut,st&&(on=st(on)),on=me.Children.only(typeof on=="string"?me.createElement("span",null,on):on),me.createElement(yt.J,{prefixCls:`${Vt}-menu`,expandIcon:me.createElement("span",{className:`${Vt}-menu-submenu-arrow`},me.createElement(je.Z,{className:`${Vt}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:Jt,validator:mn=>{let{mode:Cn}=mn}},on)};return Gt(me.createElement(be.Z,Object.assign({alignPoint:fe},(0,Ce.Z)(Ze,["rootClassName"]),{mouseEnterDelay:$e,mouseLeaveDelay:xe,visible:le,builtinPlacements:$t,arrow:!!He,overlayClassName:Kt,prefixCls:Vt,getPopupContainer:Bt||Ye,transitionName:tn,trigger:de,overlay:qt,placement:un,onVisibleChange:it}),oe))};function Qt(Ze){return Object.assign(Object.assign({},Ze),{align:{overflow:{adjustX:!1,adjustY:!1}}})}const nt=(0,ze.Z)(St,"dropdown",Ze=>Ze,Qt),ft=Ze=>me.createElement(nt,Object.assign({},Ze),me.createElement("span",null));St._InternalPanelDoNotUseOrYouWillBeFired=ft,cn.Z=St},47211:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return ut}});var me=ue(17313),je=ue(13826),Ke=ue(92899),ot=ue(29878),be=ue(19447),Ae=ue(83116),Ne=ue(37613),Me=Le=>{const{componentCls:We,menuCls:yt,colorError:et,colorTextLightSolid:pt}=Le,at=`${yt}-item`;return{[`${We}, ${We}-menu-submenu`]:{[`${yt} ${at}`]:{[`&${at}-danger:not(${at}-disabled)`]:{color:et,"&:hover":{color:pt,backgroundColor:et}}}}}};const ze=Le=>{const{componentCls:We,menuCls:yt,zIndexPopup:et,dropdownArrowDistance:pt,sizePopupArrow:at,antCls:St,iconCls:Qt,motionDurationMid:nt,dropdownPaddingVertical:ft,fontSize:Ze,dropdownEdgeChildPadding:ke,colorTextDisabled:He,fontSizeIcon:Ue,controlPaddingHorizontal:bt,colorBgElevated:Ve}=Le;return[{[We]:Object.assign(Object.assign({},(0,me.Wf)(Le)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:et,display:"block","&::before":{position:"absolute",insetBlock:-pt+at/2,zIndex:-9999,opacity:1e-4,content:'""'},[`&-trigger${St}-btn`]:{[`& > ${Qt}-down, & > ${St}-btn-icon > ${Qt}-down`]:{fontSize:Ue}},[`${We}-wrap`]:{position:"relative",[`${St}-btn > ${Qt}-down`]:{fontSize:Ue},[`${Qt}-down::before`]:{transition:`transform ${nt}`}},[`${We}-wrap-open`]:{[`${Qt}-down::before`]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},[`&${St}-slide-down-enter${St}-slide-down-enter-active${We}-placement-bottomLeft,
|
|
|
&${St}-slide-down-appear${St}-slide-down-appear-active${We}-placement-bottomLeft,
|
|
|
&${St}-slide-down-enter${St}-slide-down-enter-active${We}-placement-bottom,
|
|
|
&${St}-slide-down-appear${St}-slide-down-appear-active${We}-placement-bottom,
|
|
|
&${St}-slide-down-enter${St}-slide-down-enter-active${We}-placement-bottomRight,
|
|
|
&${St}-slide-down-appear${St}-slide-down-appear-active${We}-placement-bottomRight`]:{animationName:je.fJ},[`&${St}-slide-up-enter${St}-slide-up-enter-active${We}-placement-topLeft,
|
|
|
&${St}-slide-up-appear${St}-slide-up-appear-active${We}-placement-topLeft,
|
|
|
&${St}-slide-up-enter${St}-slide-up-enter-active${We}-placement-top,
|
|
|
&${St}-slide-up-appear${St}-slide-up-appear-active${We}-placement-top,
|
|
|
&${St}-slide-up-enter${St}-slide-up-enter-active${We}-placement-topRight,
|
|
|
&${St}-slide-up-appear${St}-slide-up-appear-active${We}-placement-topRight`]:{animationName:je.Qt},[`&${St}-slide-down-leave${St}-slide-down-leave-active${We}-placement-bottomLeft,
|
|
|
&${St}-slide-down-leave${St}-slide-down-leave-active${We}-placement-bottom,
|
|
|
&${St}-slide-down-leave${St}-slide-down-leave-active${We}-placement-bottomRight`]:{animationName:je.Uw},[`&${St}-slide-up-leave${St}-slide-up-leave-active${We}-placement-topLeft,
|
|
|
&${St}-slide-up-leave${St}-slide-up-leave-active${We}-placement-top,
|
|
|
&${St}-slide-up-leave${St}-slide-up-leave-active${We}-placement-topRight`]:{animationName:je.ly}})},(0,be.ZP)(Le,{colorBg:Ve,limitVerticalRadius:!0,arrowPlacement:{top:!0,bottom:!0}}),{[`${We} ${yt}`]:{position:"relative",margin:0},[`${yt}-submenu-popup`]:{position:"absolute",zIndex:et,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${We}, ${We}-menu-submenu`]:{[yt]:Object.assign(Object.assign({padding:ke,listStyleType:"none",backgroundColor:Ve,backgroundClip:"padding-box",borderRadius:Le.borderRadiusLG,outline:"none",boxShadow:Le.boxShadowSecondary},(0,me.Qy)(Le)),{[`${yt}-item-group-title`]:{padding:`${ft}px ${bt}px`,color:Le.colorTextDescription,transition:`all ${nt}`},[`${yt}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${yt}-item-icon`]:{minWidth:Ze,marginInlineEnd:Le.marginXS,fontSize:Le.fontSizeSM},[`${yt}-title-content`]:{flex:"auto","> a":{color:"inherit",transition:`all ${nt}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}}},[`${yt}-item, ${yt}-submenu-title`]:Object.assign(Object.assign({clear:"both",margin:0,padding:`${ft}px ${bt}px`,color:Le.colorText,fontWeight:"normal",fontSize:Ze,lineHeight:Le.lineHeight,cursor:"pointer",transition:`all ${nt}`,borderRadius:Le.borderRadiusSM,"&:hover, &-active":{backgroundColor:Le.controlItemBgHover}},(0,me.Qy)(Le)),{"&-selected":{color:Le.colorPrimary,backgroundColor:Le.controlItemBgActive,"&:hover, &-active":{backgroundColor:Le.controlItemBgActiveHover}},"&-disabled":{color:He,cursor:"not-allowed","&:hover":{color:He,backgroundColor:Ve,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${Le.marginXXS}px 0`,overflow:"hidden",lineHeight:0,backgroundColor:Le.colorSplit},[`${We}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:Le.paddingXS,[`${We}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:Le.colorTextDescription,fontSize:Ue,fontStyle:"normal"}}}),[`${yt}-item-group-list`]:{margin:`0 ${Le.marginXS}px`,padding:0,listStyle:"none"},[`${yt}-submenu-title`]:{paddingInlineEnd:bt+Le.fontSizeSM},[`${yt}-submenu-vertical`]:{position:"relative"},[`${yt}-submenu${yt}-submenu-disabled ${We}-menu-submenu-title`]:{[`&, ${We}-menu-submenu-arrow-icon`]:{color:He,backgroundColor:Ve,cursor:"not-allowed"}},[`${yt}-submenu-selected ${We}-menu-submenu-title`]:{color:Le.colorPrimary}})}},[(0,je.oN)(Le,"slide-up"),(0,je.oN)(Le,"slide-down"),(0,Ke.Fm)(Le,"move-up"),(0,Ke.Fm)(Le,"move-down"),(0,ot._y)(Le,"zoom-big")]]};var ut=(0,Ae.Z)("Dropdown",(Le,We)=>{let{rootPrefixCls:yt}=We;const{marginXXS:et,sizePopupArrow:pt,controlHeight:at,fontSize:St,lineHeight:Qt,paddingXXS:nt,componentCls:ft,borderRadiusLG:Ze}=Le,ke=(at-St*Qt)/2,{dropdownArrowOffset:He}=(0,be.fS)({contentRadius:Ze}),Ue=(0,Ne.TS)(Le,{menuCls:`${ft}-menu`,rootPrefixCls:yt,dropdownArrowDistance:pt/2+et,dropdownArrowOffset:He,dropdownPaddingVertical:ke,dropdownEdgeChildPadding:nt});return[ze(Ue),Me(Ue)]},Le=>({zIndexPopup:Le.zIndexPopupBase+50}))},64165:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return nt}});var me=ue(92310),je=ue.n(me),Ke=ue(59301),ot=ue(36355),be=ue(9763),Ae=ue(64993),Ne=ue(88088),Me=()=>{const[,ft]=(0,Ne.Z)(),ke=new Ae.C(ft.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return Ke.createElement("svg",{style:ke,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},Ke.createElement("g",{fill:"none",fillRule:"evenodd"},Ke.createElement("g",{transform:"translate(24 31.67)"},Ke.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),Ke.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"}),Ke.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)"}),Ke.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"}),Ke.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"})),Ke.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"}),Ke.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},Ke.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),Ke.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},ut=()=>{const[,ft]=(0,Ne.Z)(),{colorFill:Ze,colorFillTertiary:ke,colorFillQuaternary:He,colorBgContainer:Ue}=ft,{borderColor:bt,shadowColor:Ve,contentColor:jt}=(0,Ke.useMemo)(()=>({borderColor:new Ae.C(Ze).onBackground(Ue).toHexShortString(),shadowColor:new Ae.C(ke).onBackground(Ue).toHexShortString(),contentColor:new Ae.C(He).onBackground(Ue).toHexShortString()}),[Ze,ke,He,Ue]);return Ke.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},Ke.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},Ke.createElement("ellipse",{fill:Ve,cx:"32",cy:"33",rx:"32",ry:"7"}),Ke.createElement("g",{fillRule:"nonzero",stroke:bt},Ke.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"}),Ke.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:jt}))))},Le=ue(83116),We=ue(37613);const yt=ft=>{const{componentCls:Ze,margin:ke,marginXS:He,marginXL:Ue,fontSize:bt,lineHeight:Ve}=ft;return{[Ze]:{marginInline:He,fontSize:bt,lineHeight:Ve,textAlign:"center",[`${Ze}-image`]:{height:ft.emptyImgHeight,marginBottom:He,opacity:ft.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${Ze}-description`]:{color:ft.colorText},[`${Ze}-footer`]:{marginTop:ke},"&-normal":{marginBlock:Ue,color:ft.colorTextDisabled,[`${Ze}-description`]:{color:ft.colorTextDisabled},[`${Ze}-image`]:{height:ft.emptyImgHeightMD}},"&-small":{marginBlock:He,color:ft.colorTextDisabled,[`${Ze}-image`]:{height:ft.emptyImgHeightSM}}}}};var et=(0,Le.Z)("Empty",ft=>{const{componentCls:Ze,controlHeightLG:ke}=ft,He=(0,We.TS)(ft,{emptyImgCls:`${Ze}-img`,emptyImgHeight:ke*2.5,emptyImgHeightMD:ke,emptyImgHeightSM:ke*.875});return[yt(He)]}),pt=function(ft,Ze){var ke={};for(var He in ft)Object.prototype.hasOwnProperty.call(ft,He)&&Ze.indexOf(He)<0&&(ke[He]=ft[He]);if(ft!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ue=0,He=Object.getOwnPropertySymbols(ft);Ue<He.length;Ue++)Ze.indexOf(He[Ue])<0&&Object.prototype.propertyIsEnumerable.call(ft,He[Ue])&&(ke[He[Ue]]=ft[He[Ue]]);return ke};const at=Ke.createElement(Me,null),St=Ke.createElement(ut,null),Qt=ft=>{var{className:Ze,rootClassName:ke,prefixCls:He,image:Ue=at,description:bt,children:Ve,imageStyle:jt,style:st}=ft,Bt=pt(ft,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:Qe,direction:zt,empty:ct}=Ke.useContext(ot.E_),It=Qe("empty",He),[Rt,mt]=et(It),[$e]=(0,be.Z)("Empty"),xe=typeof bt!="undefined"?bt:$e==null?void 0:$e.description,ht=typeof xe=="string"?xe:"empty";let nn=null;return typeof Ue=="string"?nn=Ke.createElement("img",{alt:ht,src:Ue}):nn=Ue,Rt(Ke.createElement("div",Object.assign({className:je()(mt,It,ct==null?void 0:ct.className,{[`${It}-normal`]:Ue===St,[`${It}-rtl`]:zt==="rtl"},Ze,ke),style:Object.assign(Object.assign({},ct==null?void 0:ct.style),st)},Bt),Ke.createElement("div",{className:`${It}-image`,style:jt},nn),xe&&Ke.createElement("div",{className:`${It}-description`},xe),Ve&&Ke.createElement("div",{className:`${It}-footer`},Ve)))};Qt.PRESENTED_IMAGE_DEFAULT=at,Qt.PRESENTED_IMAGE_SIMPLE=St;var nt=Qt},78241:function(kn,cn,ue){"use strict";ue.d(cn,{default:function(){return wr}});var me=ue(77654),je=ue(92310),Ke=ue.n(je),ot=ue(77900),be=ue(59301),Ae=ue(62892),Ne=ue(32441);function Ce(lt){const[_e,Pe]=be.useState(lt);return be.useEffect(()=>{const De=setTimeout(()=>{Pe(lt)},lt.length?0:10);return()=>{clearTimeout(De)}},[lt]),_e}var Me=ue(17313),ze=ue(29878),ut=ue(8378),Le=ue(37613),We=ue(83116),et=lt=>{const{componentCls:_e}=lt,Pe=`${_e}-show-help`,De=`${_e}-show-help-item`;return{[Pe]:{transition:`opacity ${lt.motionDurationSlow} ${lt.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[De]:{overflow:"hidden",transition:`height ${lt.motionDurationSlow} ${lt.motionEaseInOut},
|
|
|
opacity ${lt.motionDurationSlow} ${lt.motionEaseInOut},
|
|
|
transform ${lt.motionDurationSlow} ${lt.motionEaseInOut} !important`,[`&${De}-appear, &${De}-enter`]:{transform:"translateY(-5px)",opacity:0,"&-active":{transform:"translateY(0)",opacity:1}},[`&${De}-leave-active`]:{transform:"translateY(-5px)"}}}}};const pt=lt=>({legend:{display:"block",width:"100%",marginBottom:lt.marginLG,padding:0,color:lt.colorTextDescription,fontSize:lt.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:`${lt.lineWidth}px ${lt.lineType} ${lt.colorBorder}`},label:{fontSize:lt.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 ${lt.controlOutlineWidth}px ${lt.controlOutline}`},output:{display:"block",paddingTop:15,color:lt.colorText,fontSize:lt.fontSize,lineHeight:lt.lineHeight}}),at=(lt,_e)=>{const{formItemCls:Pe}=lt;return{[Pe]:{[`${Pe}-label > label`]:{height:_e},[`${Pe}-control-input`]:{minHeight:_e}}}},St=lt=>{const{componentCls:_e}=lt;return{[lt.componentCls]:Object.assign(Object.assign(Object.assign({},(0,Me.Wf)(lt)),pt(lt)),{[`${_e}-text`]:{display:"inline-block",paddingInlineEnd:lt.paddingSM},"&-small":Object.assign({},at(lt,lt.controlHeightSM)),"&-large":Object.assign({},at(lt,lt.controlHeightLG))})}},Qt=lt=>{const{formItemCls:_e,iconCls:Pe,componentCls:De,rootPrefixCls:Te,labelRequiredMarkColor:qe,labelColor:dt,labelFontSize:Xt,labelHeight:Ot,labelColonMarginInlineStart:Yt,labelColonMarginInlineEnd:pn,itemMarginBottom:vn}=lt;return{[_e]:Object.assign(Object.assign({},(0,Me.Wf)(lt)),{marginBottom:vn,verticalAlign:"top","&-with-help":{transition:"none"},[`&-hidden,
|
|
|
&-hidden.${Te}-row`]:{display:"none"},"&-has-warning":{[`${_e}-split`]:{color:lt.colorError}},"&-has-error":{[`${_e}-split`]:{color:lt.colorWarning}},[`${_e}-label`]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:`${lt.lineHeight} - 0.25em`,whiteSpace:"unset"},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:Ot,color:dt,fontSize:Xt,[`> ${Pe}`]:{fontSize:lt.fontSize,verticalAlign:"top"},[`&${_e}-required:not(${_e}-required-mark-optional)::before`]:{display:"inline-block",marginInlineEnd:lt.marginXXS,color:qe,fontSize:lt.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"',[`${De}-hide-required-mark &`]:{display:"none"}},[`${_e}-optional`]:{display:"inline-block",marginInlineStart:lt.marginXXS,color:lt.colorTextDescription,[`${De}-hide-required-mark &`]:{display:"none"}},[`${_e}-tooltip`]:{color:lt.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:lt.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:Yt,marginInlineEnd:pn},[`&${_e}-no-colon::after`]:{content:'"\\a0"'}}},[`${_e}-control`]:{"--ant-display":"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${Te}-col-'"]):not([class*="' ${Te}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:lt.controlHeight,"&-content":{flex:"auto",maxWidth:"100%"}}},[_e]:{"&-explain, &-extra":{clear:"both",color:lt.colorTextDescription,fontSize:lt.fontSize,lineHeight:lt.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:lt.controlHeightSM,transition:`color ${lt.motionDurationMid} ${lt.motionEaseOut}`},"&-explain":{"&-error":{color:lt.colorError},"&-warning":{color:lt.colorWarning}}},[`&-with-help ${_e}-explain`]:{height:"auto",opacity:1},[`${_e}-feedback-icon`]:{fontSize:lt.fontSize,textAlign:"center",visibility:"visible",animationName:ze.kr,animationDuration:lt.motionDurationMid,animationTimingFunction:lt.motionEaseOutBack,pointerEvents:"none","&-success":{color:lt.colorSuccess},"&-error":{color:lt.colorError},"&-warning":{color:lt.colorWarning},"&-validating":{color:lt.colorPrimary}}})}},nt=lt=>{const{componentCls:_e,formItemCls:Pe}=lt;return{[`${_e}-horizontal`]:{[`${Pe}-label`]:{flexGrow:0},[`${Pe}-control`]:{flex:"1 1 0",minWidth:0},[`${Pe}-label[class$='-24'], ${Pe}-label[class*='-24 ']`]:{[`& + ${Pe}-control`]:{minWidth:"unset"}}}}},ft=lt=>{const{componentCls:_e,formItemCls:Pe}=lt;return{[`${_e}-inline`]:{display:"flex",flexWrap:"wrap",[Pe]:{flex:"none",marginInlineEnd:lt.margin,marginBottom:0,"&-row":{flexWrap:"nowrap"},[`> ${Pe}-label,
|
|
|
> ${Pe}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${Pe}-label`]:{flex:"none"},[`${_e}-text`]:{display:"inline-block"},[`${Pe}-has-feedback`]:{display:"inline-block"}}}}},Ze=lt=>({padding:lt.verticalLabelPadding,margin:lt.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),ke=lt=>{const{componentCls:_e,formItemCls:Pe,rootPrefixCls:De}=lt;return{[`${Pe} ${Pe}-label`]:Ze(lt),[_e]:{[Pe]:{flexWrap:"wrap",[`${Pe}-label, ${Pe}-control`]:{[`&:not([class*=" ${De}-col-xs"])`]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},He=lt=>{const{componentCls:_e,formItemCls:Pe,rootPrefixCls:De}=lt;return{[`${_e}-vertical`]:{[Pe]:{"&-row":{flexDirection:"column"},"&-label > label":{height:"auto"},[`${_e}-item-control`]:{width:"100%"}}},[`${_e}-vertical ${Pe}-label,
|
|
|
.${De}-col-24${Pe}-label,
|
|
|
.${De}-col-xl-24${Pe}-label`]:Ze(lt),[`@media (max-width: ${lt.screenXSMax}px)`]:[ke(lt),{[_e]:{[`.${De}-col-xs-24${Pe}-label`]:Ze(lt)}}],[`@media (max-width: ${lt.screenSMMax}px)`]:{[_e]:{[`.${De}-col-sm-24${Pe}-label`]:Ze(lt)}},[`@media (max-width: ${lt.screenMDMax}px)`]:{[_e]:{[`.${De}-col-md-24${Pe}-label`]:Ze(lt)}},[`@media (max-width: ${lt.screenLGMax}px)`]:{[_e]:{[`.${De}-col-lg-24${Pe}-label`]:Ze(lt)}}}},Ue=(lt,_e)=>(0,Le.TS)(lt,{formItemCls:`${lt.componentCls}-item`,rootPrefixCls:_e});var bt=(0,We.Z)("Form",(lt,_e)=>{let{rootPrefixCls:Pe}=_e;const De=Ue(lt,Pe);return[St(De),Qt(De),et(De),nt(De),ft(De),He(De),(0,ut.Z)(De),ze.kr]},lt=>({labelRequiredMarkColor:lt.colorError,labelColor:lt.colorTextHeading,labelFontSize:lt.fontSize,labelHeight:lt.controlHeight,labelColonMarginInlineStart:lt.marginXXS/2,labelColonMarginInlineEnd:lt.marginXS,itemMarginBottom:lt.marginLG,verticalLabelPadding:`0 0 ${lt.paddingXS}px`,verticalLabelMargin:0}),{order:-1e3});const Ve=[];function jt(lt,_e,Pe){let De=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof lt=="string"?lt:`${_e}-${De}`,error:lt,errorStatus:Pe}}var Bt=lt=>{let{help:_e,helpStatus:Pe,errors:De=Ve,warnings:Te=Ve,className:qe,fieldId:dt,onVisibleChanged:Xt}=lt;const{prefixCls:Ot}=be.useContext(Ne.Rk),Yt=`${Ot}-item-explain`,[,pn]=bt(Ot),vn=(0,be.useMemo)(()=>(0,Ae.Z)(Ot),[Ot]),Sn=Ce(De),At=Ce(Te),dn=be.useMemo(()=>_e!=null?[jt(_e,"help",Pe)]:[].concat((0,me.Z)(Sn.map((Mt,Lt)=>jt(Mt,"error","error",Lt))),(0,me.Z)(At.map((Mt,Lt)=>jt(Mt,"warning","warning",Lt)))),[_e,Pe,Sn,At]),rt={};return dt&&(rt.id=`${dt}_help`),be.createElement(ot.default,{motionDeadline:vn.motionDeadline,motionName:`${Ot}-show-help`,visible:!!dn.length,onVisibleChanged:Xt},Mt=>{const{className:Lt,style:Pt}=Mt;return be.createElement("div",Object.assign({},rt,{className:Ke()(Yt,Lt,qe,pn),style:Pt,role:"alert"}),be.createElement(ot.CSSMotionList,Object.assign({keys:dn},(0,Ae.Z)(Ot),{motionName:`${Ot}-show-help-item`,component:!1}),an=>{const{key:Et,error:rn,errorStatus:Be,className:wt,style:Ct}=an;return be.createElement("div",{key:Et,className:Ke()(wt,{[`${Yt}-${Be}`]:Be}),style:Ct},rn)}))})},Qe=ue(95013),zt=ue(36355),ct=ue(1684),It=ue(52946),Rt=ue(19716),mt=ue(16722);const $e=["parentNode"],xe="form_item";function ht(lt){return lt===void 0||lt===!1?[]:Array.isArray(lt)?lt:[lt]}function nn(lt,_e){if(!lt.length)return;const Pe=lt.join("_");return _e?`${_e}_${Pe}`:$e.includes(Pe)?`${xe}_${Pe}`:Pe}function Ut(lt,_e,Pe,De,Te,qe){let dt=De;return qe!==void 0?dt=qe:Pe.validating?dt="validating":lt.length?dt="error":_e.length?dt="warning":(Pe.touched||Te&&Pe.validated)&&(dt="success"),dt}function Xe(lt){return ht(lt).join("_")}function Ye(lt){const[_e]=(0,Qe.useForm)(),Pe=be.useRef({}),De=be.useMemo(()=>lt!=null?lt:Object.assign(Object.assign({},_e),{__INTERNAL__:{itemRef:Te=>qe=>{const dt=Xe(Te);qe?Pe.current[dt]=qe:delete Pe.current[dt]}},scrollToField:function(Te){let qe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const dt=ht(Te),Xt=nn(dt,De.__INTERNAL__.name),Ot=Xt?document.getElementById(Xt):null;Ot&&(0,mt.Z)(Ot,Object.assign({scrollMode:"if-needed",block:"nearest"},qe))},getFieldInstance:Te=>{const qe=Xe(Te);return Pe.current[qe]}}),[lt,_e]);return[De]}var Dt=ue(28726),bn=function(lt,_e){var Pe={};for(var De in lt)Object.prototype.hasOwnProperty.call(lt,De)&&_e.indexOf(De)<0&&(Pe[De]=lt[De]);if(lt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Te=0,De=Object.getOwnPropertySymbols(lt);Te<De.length;Te++)_e.indexOf(De[Te])<0&&Object.prototype.propertyIsEnumerable.call(lt,De[Te])&&(Pe[De[Te]]=lt[De[Te]]);return Pe};const tn=(lt,_e)=>{const Pe=be.useContext(ct.Z),{getPrefixCls:De,direction:Te,form:qe}=be.useContext(zt.E_),{prefixCls:dt,className:Xt,rootClassName:Ot,size:Yt,disabled:pn=Pe,form:vn,colon:Sn,labelAlign:At,labelWrap:dn,labelCol:rt,wrapperCol:Mt,hideRequiredMark:Lt,layout:Pt="horizontal",scrollToFirstError:an,requiredMark:Et,onFinishFailed:rn,name:Be,style:wt,feedbackIcons:Ct}=lt,Nt=bn(lt,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons"]),Tt=(0,Rt.Z)(Yt),Ft=be.useContext(Dt.Z),Ht=(0,be.useMemo)(()=>Et!==void 0?Et:qe&&qe.requiredMark!==void 0?qe.requiredMark:!Lt,[Lt,Et,qe]),gn=Sn!=null?Sn:qe==null?void 0:qe.colon,wn=De("form",dt),[Ln,zn]=bt(wn),er=Ke()(wn,`${wn}-${Pt}`,{[`${wn}-hide-required-mark`]:Ht===!1,[`${wn}-rtl`]:Te==="rtl",[`${wn}-${Tt}`]:Tt},zn,qe==null?void 0:qe.className,Xt,Ot),[cr]=Ye(vn),{__INTERNAL__:Un}=cr;Un.name=Be;const In=(0,be.useMemo)(()=>({name:Be,labelAlign:At,labelCol:rt,labelWrap:dn,wrapperCol:Mt,vertical:Pt==="vertical",colon:gn,requiredMark:Ht,itemRef:Un.itemRef,form:cr,feedbackIcons:Ct}),[Be,At,rt,Mt,Pt,gn,Ht,cr,Ct]);be.useImperativeHandle(_e,()=>cr);const fr=(yr,Gn)=>{if(yr){let Xn={block:"nearest"};typeof yr=="object"&&(Xn=yr),cr.scrollToField(Gn,Xn)}},tr=yr=>{if(rn==null||rn(yr),yr.errorFields.length){const Gn=yr.errorFields[0].name;if(an!==void 0){fr(an,Gn);return}qe&&qe.scrollToFirstError!==void 0&&fr(qe.scrollToFirstError,Gn)}};return Ln(be.createElement(ct.n,{disabled:pn},be.createElement(It.q,{size:Tt},be.createElement(Ne.RV,Object.assign({},{validateMessages:Ft}),be.createElement(Ne.q3.Provider,{value:In},be.createElement(Qe.default,Object.assign({id:Be},Nt,{name:Be,onFinishFailed:tr,form:cr,style:Object.assign(Object.assign({},qe==null?void 0:qe.style),wt),className:er})))))))};var Vt=be.forwardRef(tn),Gt=ue(41799),Wt=ue(8654),ye=ue(92343),se=ue(11592);function oe(lt){if(typeof lt=="function")return lt;const _e=(0,se.Z)(lt);return _e.length<=1?_e[0]:_e}const de=()=>{const{status:lt,errors:_e=[],warnings:Pe=[]}=(0,be.useContext)(Ne.aM);return{status:lt,errors:_e,warnings:Pe}};de.Context=Ne.aM;var fe=de,le=ue(16089);function Ie(lt){const[_e,Pe]=be.useState(lt),De=(0,be.useRef)(null),Te=(0,be.useRef)([]),qe=(0,be.useRef)(!1);be.useEffect(()=>(qe.current=!1,()=>{qe.current=!0,le.Z.cancel(De.current),De.current=null}),[]);function dt(Xt){qe.current||(De.current===null&&(Te.current=[],De.current=(0,le.Z)(()=>{De.current=null,Pe(Ot=>{let Yt=Ot;return Te.current.forEach(pn=>{Yt=pn(Yt)}),Yt})})),Te.current.push(Xt))}return[_e,dt]}function it(){const{itemRef:lt}=be.useContext(Ne.q3),_e=be.useRef({});function Pe(De,Te){const qe=Te&&typeof Te=="object"&&Te.ref,dt=De.join("_");return(_e.current.name!==dt||_e.current.originRef!==qe)&&(_e.current.name=dt,_e.current.originRef=qe,_e.current.ref=(0,Wt.sQ)(lt(De),qe)),_e.current.ref}return Pe}var Kt=ue(29194),$t=ue(34280),Jt=ue(2738),qt=ue(27382),on=ue(37028);const mn=lt=>{const{formItemCls:_e}=lt;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${_e}-control`]:{display:"flex"}}}};var Cn=(0,We.b)(["Form","item-item"],(lt,_e)=>{let{rootPrefixCls:Pe}=_e;const De=Ue(lt,Pe);return[mn(De)]}),hn=lt=>{const{prefixCls:_e,status:Pe,wrapperCol:De,children:Te,errors:qe,warnings:dt,_internalItemRender:Xt,extra:Ot,help:Yt,fieldId:pn,marginBottom:vn,onErrorVisibleChanged:Sn}=lt,At=`${_e}-item`,dn=be.useContext(Ne.q3),rt=De||dn.wrapperCol||{},Mt=Ke()(`${At}-control`,rt.className),Lt=be.useMemo(()=>Object.assign({},dn),[dn]);delete Lt.labelCol,delete Lt.wrapperCol;const Pt=be.createElement("div",{className:`${At}-control-input`},be.createElement("div",{className:`${At}-control-input-content`},Te)),an=be.useMemo(()=>({prefixCls:_e,status:Pe}),[_e,Pe]),Et=vn!==null||qe.length||dt.length?be.createElement("div",{style:{display:"flex",flexWrap:"nowrap"}},be.createElement(Ne.Rk.Provider,{value:an},be.createElement(Bt,{fieldId:pn,errors:qe,warnings:dt,help:Yt,helpStatus:Pe,className:`${At}-explain-connected`,onVisibleChanged:Sn})),!!vn&&be.createElement("div",{style:{width:0,height:vn}})):null,rn={};pn&&(rn.id=`${pn}_extra`);const Be=Ot?be.createElement("div",Object.assign({},rn,{className:`${At}-extra`}),Ot):null,wt=Xt&&Xt.mark==="pro_table_render"&&Xt.render?Xt.render(lt,{input:Pt,errorList:Et,extra:Be}):be.createElement(be.Fragment,null,Pt,Et,Be);return be.createElement(Ne.q3.Provider,{value:Lt},be.createElement(on.Z,Object.assign({},rt,{className:Mt}),wt),be.createElement(Cn,{prefixCls:_e}))},On=ue(61485),tt=ue(31724),Fe=ue(9763),Ge=ue(6848),Zt=function(lt,_e){var Pe={};for(var De in lt)Object.prototype.hasOwnProperty.call(lt,De)&&_e.indexOf(De)<0&&(Pe[De]=lt[De]);if(lt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Te=0,De=Object.getOwnPropertySymbols(lt);Te<De.length;Te++)_e.indexOf(De[Te])<0&&Object.prototype.propertyIsEnumerable.call(lt,De[Te])&&(Pe[De[Te]]=lt[De[Te]]);return Pe};function en(lt){return lt?typeof lt=="object"&&!be.isValidElement(lt)?lt:{title:lt}:null}var Dn=lt=>{let{prefixCls:_e,label:Pe,htmlFor:De,labelCol:Te,labelAlign:qe,colon:dt,required:Xt,requiredMark:Ot,tooltip:Yt}=lt;var pn;const[vn]=(0,Fe.Z)("Form"),{vertical:Sn,labelAlign:At,labelCol:dn,labelWrap:rt,colon:Mt}=be.useContext(Ne.q3);if(!Pe)return null;const Lt=Te||dn||{},Pt=qe||At,an=`${_e}-item-label`,Et=Ke()(an,Pt==="left"&&`${an}-left`,Lt.className,{[`${an}-wrap`]:!!rt});let rn=Pe;const Be=dt===!0||Mt!==!1&&dt!==!1;Be&&!Sn&&typeof Pe=="string"&&Pe.trim()!==""&&(rn=Pe.replace(/[:|:]\s*$/,""));const Ct=en(Yt);if(Ct){const{icon:Ht=be.createElement(On.Z,null)}=Ct,gn=Zt(Ct,["icon"]),wn=be.createElement(Ge.Z,Object.assign({},gn),be.cloneElement(Ht,{className:`${_e}-item-tooltip`,title:""}));rn=be.createElement(be.Fragment,null,rn,wn)}const Nt=Ot==="optional",Tt=typeof Ot=="function";Tt?rn=Ot(rn,{required:!!Xt}):Nt&&!Xt&&(rn=be.createElement(be.Fragment,null,rn,be.createElement("span",{className:`${_e}-item-optional`,title:""},(vn==null?void 0:vn.optional)||((pn=tt.Z.Form)===null||pn===void 0?void 0:pn.optional))));const Ft=Ke()({[`${_e}-item-required`]:Xt,[`${_e}-item-required-mark-optional`]:Nt||Tt,[`${_e}-item-no-colon`]:!Be});return be.createElement(on.Z,Object.assign({},Lt,{className:Et}),be.createElement("label",{htmlFor:De,className:Ft,title:typeof Pe=="string"?Pe:""},rn))},Tn=ue(29679),En=ue(19248),Fn=ue(96512),jn=ue(58617);const An={success:Tn.Z,warning:Fn.Z,error:En.Z,validating:jn.Z};function hr(lt){let{children:_e,errors:Pe,warnings:De,hasFeedback:Te,validateStatus:qe,prefixCls:dt,meta:Xt,noStyle:Ot}=lt;const Yt=`${dt}-item`,{feedbackIcons:pn}=be.useContext(Ne.q3),vn=Ut(Pe,De,Xt,null,!!Te,qe),{isFormItemInput:Sn,status:At}=be.useContext(Ne.aM),dn=be.useMemo(()=>{var rt;let Mt;if(Te){const an=Te!==!0&&Te.icons||pn,Et=vn&&((rt=an==null?void 0:an({status:vn,errors:Pe,warnings:De}))===null||rt===void 0?void 0:rt[vn]),rn=vn&&An[vn];Mt=Et!==!1&&rn?be.createElement("span",{className:Ke()(`${Yt}-feedback-icon`,`${Yt}-feedback-icon-${vn}`)},Et||be.createElement(rn,null)):null}let Lt=!0,Pt=vn||"";return Ot&&(Lt=Sn,Pt=(vn!=null?vn:At)||""),{status:Pt,errors:Pe,warnings:De,hasFeedback:!!Te,feedbackIcon:Mt,isFormItemInput:Lt}},[vn,Te,Ot,Sn,At]);return be.createElement(Ne.aM.Provider,{value:dn},_e)}var _r=function(lt,_e){var Pe={};for(var De in lt)Object.prototype.hasOwnProperty.call(lt,De)&&_e.indexOf(De)<0&&(Pe[De]=lt[De]);if(lt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Te=0,De=Object.getOwnPropertySymbols(lt);Te<De.length;Te++)_e.indexOf(De[Te])<0&&Object.prototype.propertyIsEnumerable.call(lt,De[Te])&&(Pe[De[Te]]=lt[De[Te]]);return Pe};function Tr(lt){const{prefixCls:_e,className:Pe,rootClassName:De,style:Te,help:qe,errors:dt,warnings:Xt,validateStatus:Ot,meta:Yt,hasFeedback:pn,hidden:vn,children:Sn,fieldId:At,required:dn,isRequired:rt,onSubItemMetaChange:Mt}=lt,Lt=_r(lt,["prefixCls","className","rootClassName","style","help","errors","warnings","validateStatus","meta","hasFeedback","hidden","children","fieldId","required","isRequired","onSubItemMetaChange"]),Pt=`${_e}-item`,{requiredMark:an}=be.useContext(Ne.q3),Et=be.useRef(null),rn=Ce(dt),Be=Ce(Xt),wt=qe!=null,Ct=!!(wt||dt.length||Xt.length),Nt=!!Et.current&&(0,Kt.Z)(Et.current),[Tt,Ft]=be.useState(null);(0,$t.Z)(()=>{if(Ct&&Et.current){const zn=getComputedStyle(Et.current);Ft(parseInt(zn.marginBottom,10))}},[Ct,Nt]);const Ht=zn=>{zn||Ft(null)},wn=function(){let zn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const er=zn?rn:Yt.errors,cr=zn?Be:Yt.warnings;return Ut(er,cr,Yt,"",!!pn,Ot)}(),Ln=Ke()(Pt,Pe,De,{[`${Pt}-with-help`]:wt||rn.length||Be.length,[`${Pt}-has-feedback`]:wn&&pn,[`${Pt}-has-success`]:wn==="success",[`${Pt}-has-warning`]:wn==="warning",[`${Pt}-has-error`]:wn==="error",[`${Pt}-is-validating`]:wn==="validating",[`${Pt}-hidden`]:vn});return be.createElement("div",{className:Ln,style:Te,ref:Et},be.createElement(qt.Z,Object.assign({className:`${Pt}-row`},(0,Jt.Z)(Lt,["_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(Dn,Object.assign({htmlFor:At},lt,{requiredMark:an,required:dn!=null?dn:rt,prefixCls:_e})),be.createElement(hn,Object.assign({},lt,Yt,{errors:rn,warnings:Be,prefixCls:_e,status:wn,help:qe,marginBottom:Tt,onErrorVisibleChanged:Ht}),be.createElement(Ne.qI.Provider,{value:Mt},be.createElement(hr,{prefixCls:_e,meta:Yt,errors:Yt.errors,warnings:Yt.warnings,hasFeedback:pn,validateStatus:wn},Sn)))),!!Tt&&be.createElement("div",{className:`${Pt}-margin-offset`,style:{marginBottom:-Tt}}))}const Hr="__SPLIT__",sr=null,Mr=be.memo(lt=>{let{children:_e}=lt;return _e},(lt,_e)=>lt.value===_e.value&<.update===_e.update&<.childProps.length===_e.childProps.length&<.childProps.every((Pe,De)=>Pe===_e.childProps[De]));function rr(lt){return lt!=null}function Or(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function Fr(lt){const{name:_e,noStyle:Pe,className:De,dependencies:Te,prefixCls:qe,shouldUpdate:dt,rules:Xt,children:Ot,required:Yt,label:pn,messageVariables:vn,trigger:Sn="onChange",validateTrigger:At,hidden:dn,help:rt}=lt,{getPrefixCls:Mt}=be.useContext(zt.E_),{name:Lt}=be.useContext(Ne.q3),Pt=oe(Ot),an=typeof Pt=="function",Et=be.useContext(Ne.qI),{validateTrigger:rn}=be.useContext(Qe.FieldContext),Be=At!==void 0?At:rn,wt=rr(_e),Ct=Mt("form",qe),[Nt,Tt]=bt(Ct),Ft=be.useContext(Qe.ListContext),Ht=be.useRef(),[gn,wn]=Ie({}),[Ln,zn]=(0,Gt.Z)(()=>Or()),er=Gn=>{const Xn=Ft==null?void 0:Ft.getKey(Gn.name);if(zn(Gn.destroy?Or():Gn,!0),Pe&&rt!==!1&&Et){let br=Gn.name;if(Gn.destroy)br=Ht.current||br;else if(Xn!==void 0){const[ur,Br]=Xn;br=[ur].concat((0,me.Z)(Br)),Ht.current=br}Et(Gn,br)}},cr=(Gn,Xn)=>{wn(br=>{const ur=Object.assign({},br),Gr=[].concat((0,me.Z)(Gn.name.slice(0,-1)),(0,me.Z)(Xn)).join(Hr);return Gn.destroy?delete ur[Gr]:ur[Gr]=Gn,ur})},[Un,In]=be.useMemo(()=>{const Gn=(0,me.Z)(Ln.errors),Xn=(0,me.Z)(Ln.warnings);return Object.values(gn).forEach(br=>{Gn.push.apply(Gn,(0,me.Z)(br.errors||[])),Xn.push.apply(Xn,(0,me.Z)(br.warnings||[]))}),[Gn,Xn]},[gn,Ln.errors,Ln.warnings]),fr=it();function tr(Gn,Xn,br){return Pe&&!dn?be.createElement(hr,{prefixCls:Ct,hasFeedback:lt.hasFeedback,validateStatus:lt.validateStatus,meta:Ln,errors:Un,warnings:In,noStyle:!0},Gn):be.createElement(Tr,Object.assign({key:"row"},lt,{className:Ke()(De,Tt),prefixCls:Ct,fieldId:Xn,isRequired:br,errors:Un,warnings:In,meta:Ln,onSubItemMetaChange:cr}),Gn)}if(!wt&&!an&&!Te)return Nt(tr(Pt));let yr={};return typeof pn=="string"?yr.label=pn:_e&&(yr.label=String(_e)),vn&&(yr=Object.assign(Object.assign({},yr),vn)),Nt(be.createElement(Qe.Field,Object.assign({},lt,{messageVariables:yr,trigger:Sn,validateTrigger:Be,onMetaChange:er}),(Gn,Xn,br)=>{const ur=ht(_e).length&&Xn?Xn.name:[],Br=nn(ur,Lt),Gr=Yt!==void 0?Yt:!!(Xt&&Xt.some(Mn=>{if(Mn&&typeof Mn=="object"&&Mn.required&&!Mn.warningOnly)return!0;if(typeof Mn=="function"){const gr=Mn(br);return gr&&gr.required&&!gr.warningOnly}return!1})),ar=Object.assign({},Gn);let _n=null;if(Array.isArray(Pt)&&wt)_n=Pt;else if(!(an&&(!(dt||Te)||wt))){if(!(Te&&!an&&!wt))if((0,ye.l$)(Pt)){const Mn=Object.assign(Object.assign({},Pt.props),ar);if(Mn.id||(Mn.id=Br),rt||Un.length>0||In.length>0||lt.extra){const kr=[];(rt||Un.length>0)&&kr.push(`${Br}_help`),lt.extra&&kr.push(`${Br}_extra`),Mn["aria-describedby"]=kr.join(" ")}Un.length>0&&(Mn["aria-invalid"]="true"),Gr&&(Mn["aria-required"]="true"),(0,Wt.Yr)(Pt)&&(Mn.ref=fr(ur,Pt)),new Set([].concat((0,me.Z)(ht(Sn)),(0,me.Z)(ht(Be)))).forEach(kr=>{Mn[kr]=function(){for(var Lr,Ir,pr,Sr,ii,Hn=arguments.length,qn=new Array(Hn),Dr=0;Dr<Hn;Dr++)qn[Dr]=arguments[Dr];(pr=ar[kr])===null||pr===void 0||(Lr=pr).call.apply(Lr,[ar].concat(qn)),(ii=(Sr=Pt.props)[kr])===null||ii===void 0||(Ir=ii).call.apply(Ir,[Sr].concat(qn))}});const nr=[Mn["aria-required"],Mn["aria-invalid"],Mn["aria-describedby"]];_n=be.createElement(Mr,{value:ar[lt.valuePropName||"value"],update:Pt,childProps:nr},(0,ye.Tm)(Pt,Mn))}else an&&(dt||Te)&&!wt?_n=Pt(br):_n=Pt}return tr(_n,Br,Gr)}))}const Er=Fr;Er.useStatus=fe;var jr=Er,Nr=function(lt,_e){var Pe={};for(var De in lt)Object.prototype.hasOwnProperty.call(lt,De)&&_e.indexOf(De)<0&&(Pe[De]=lt[De]);if(lt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Te=0,De=Object.getOwnPropertySymbols(lt);Te<De.length;Te++)_e.indexOf(De[Te])<0&&Object.prototype.propertyIsEnumerable.call(lt,De[Te])&&(Pe[De[Te]]=lt[De[Te]]);return Pe},lr=lt=>{var{prefixCls:_e,children:Pe}=lt,De=Nr(lt,["prefixCls","children"]);const{getPrefixCls:Te}=be.useContext(zt.E_),qe=Te("form",_e),dt=be.useMemo(()=>({prefixCls:qe,status:"error"}),[qe]);return be.createElement(Qe.List,Object.assign({},De),(Xt,Ot,Yt)=>be.createElement(Ne.Rk.Provider,{value:dt},Pe(Xt.map(pn=>Object.assign(Object.assign({},pn),{fieldKey:pn.key})),Ot,{errors:Yt.errors,warnings:Yt.warnings})))};function Rn(){const{form:lt}=(0,be.useContext)(Ne.q3);return lt}const $n=Vt;$n.Item=jr,$n.List=lr,$n.ErrorList=Bt,$n.useForm=Ye,$n.useFormInstance=Rn,$n.useWatch=Qe.useWatch,$n.Provider=Ne.RV,$n.create=()=>{};var wr=$n},5871:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return On}});var me=ue(84105),je=ue(87395),Ke=ue(92310),ot=ue.n(Ke),be=ue(60499),Ae=ue(18642),Ne=ue(43749),Ce=ue(72190),Me=ue(42244),ze=ue(38705),ut=ue(17212);function Le(){return typeof BigInt=="function"}function We(tt){return!tt&&tt!==0&&!Number.isNaN(tt)||!String(tt).trim()}function yt(tt){var Fe=tt.trim(),Ge=Fe.startsWith("-");Ge&&(Fe=Fe.slice(1)),Fe=Fe.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),Fe.startsWith(".")&&(Fe="0".concat(Fe));var Zt=Fe||"0",en=Zt.split("."),ln=en[0]||"0",Dn=en[1]||"0";ln==="0"&&Dn==="0"&&(Ge=!1);var Tn=Ge?"-":"";return{negative:Ge,negativeStr:Tn,trimStr:Zt,integerStr:ln,decimalStr:Dn,fullStr:"".concat(Tn).concat(Zt)}}function et(tt){var Fe=String(tt);return!Number.isNaN(Number(Fe))&&Fe.includes("e")}function pt(tt){var Fe=String(tt);if(et(tt)){var Ge=Number(Fe.slice(Fe.indexOf("e-")+2)),Zt=Fe.match(/\.(\d+)/);return Zt!=null&&Zt[1]&&(Ge+=Zt[1].length),Ge}return Fe.includes(".")&&St(Fe)?Fe.length-Fe.indexOf(".")-1:0}function at(tt){var Fe=String(tt);if(et(tt)){if(tt>Number.MAX_SAFE_INTEGER)return String(Le()?BigInt(tt).toString():Number.MAX_SAFE_INTEGER);if(tt<Number.MIN_SAFE_INTEGER)return String(Le()?BigInt(tt).toString():Number.MIN_SAFE_INTEGER);Fe=tt.toFixed(pt(Fe))}return yt(Fe).fullStr}function St(tt){return typeof tt=="number"?!Number.isNaN(tt):tt?/^\s*-?\d+(\.\d+)?\s*$/.test(tt)||/^\s*-?\d+\.\s*$/.test(tt)||/^\s*-?\.\d+\s*$/.test(tt):!1}var Qt=function(){function tt(Fe){if((0,ze.Z)(this,tt),(0,Ae.Z)(this,"origin",""),(0,Ae.Z)(this,"negative",void 0),(0,Ae.Z)(this,"integer",void 0),(0,Ae.Z)(this,"decimal",void 0),(0,Ae.Z)(this,"decimalLen",void 0),(0,Ae.Z)(this,"empty",void 0),(0,Ae.Z)(this,"nan",void 0),We(Fe)){this.empty=!0;return}if(this.origin=String(Fe),Fe==="-"||Number.isNaN(Fe)){this.nan=!0;return}var Ge=Fe;if(et(Ge)&&(Ge=Number(Ge)),Ge=typeof Ge=="string"?Ge:at(Ge),St(Ge)){var Zt=yt(Ge);this.negative=Zt.negative;var en=Zt.trimStr.split(".");this.integer=BigInt(en[0]);var ln=en[1]||"0";this.decimal=BigInt(ln),this.decimalLen=ln.length}else this.nan=!0}return(0,ut.Z)(tt,[{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(Ge){var Zt="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(Ge,"0"));return BigInt(Zt)}},{key:"negate",value:function(){var Ge=new tt(this.toString());return Ge.negative=!Ge.negative,Ge}},{key:"cal",value:function(Ge,Zt,en){var ln=Math.max(this.getDecimalStr().length,Ge.getDecimalStr().length),Dn=this.alignDecimal(ln),Tn=Ge.alignDecimal(ln),En=Zt(Dn,Tn).toString(),Fn=en(ln),jn=yt(En),An=jn.negativeStr,hr=jn.trimStr,_r="".concat(An).concat(hr.padStart(Fn+1,"0"));return new tt("".concat(_r.slice(0,-Fn),".").concat(_r.slice(-Fn)))}},{key:"add",value:function(Ge){if(this.isInvalidate())return new tt(Ge);var Zt=new tt(Ge);return Zt.isInvalidate()?this:this.cal(Zt,function(en,ln){return en+ln},function(en){return en})}},{key:"multi",value:function(Ge){var Zt=new tt(Ge);return this.isInvalidate()||Zt.isInvalidate()?new tt(NaN):this.cal(Zt,function(en,ln){return en*ln},function(en){return en*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(Ge){return this.toString()===(Ge==null?void 0:Ge.toString())}},{key:"lessEquals",value:function(Ge){return this.add(Ge.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var Ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return Ge?this.isInvalidate()?"":yt("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),tt}(),nt=function(){function tt(Fe){if((0,ze.Z)(this,tt),(0,Ae.Z)(this,"origin",""),(0,Ae.Z)(this,"number",void 0),(0,Ae.Z)(this,"empty",void 0),We(Fe)){this.empty=!0;return}this.origin=String(Fe),this.number=Number(Fe)}return(0,ut.Z)(tt,[{key:"negate",value:function(){return new tt(-this.toNumber())}},{key:"add",value:function(Ge){if(this.isInvalidate())return new tt(Ge);var Zt=Number(Ge);if(Number.isNaN(Zt))return this;var en=this.number+Zt;if(en>Number.MAX_SAFE_INTEGER)return new tt(Number.MAX_SAFE_INTEGER);if(en<Number.MIN_SAFE_INTEGER)return new tt(Number.MIN_SAFE_INTEGER);var ln=Math.max(pt(this.number),pt(Zt));return new tt(en.toFixed(ln))}},{key:"multi",value:function(Ge){var Zt=Number(Ge);if(this.isInvalidate()||Number.isNaN(Zt))return new tt(NaN);var en=this.number*Zt;if(en>Number.MAX_SAFE_INTEGER)return new tt(Number.MAX_SAFE_INTEGER);if(en<Number.MIN_SAFE_INTEGER)return new tt(Number.MIN_SAFE_INTEGER);var ln=Math.max(pt(this.number),pt(Zt));return new tt(en.toFixed(ln))}},{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(Ge){return this.toNumber()===(Ge==null?void 0:Ge.toNumber())}},{key:"lessEquals",value:function(Ge){return this.add(Ge.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var Ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return Ge?this.isInvalidate()?"":at(this.number):this.origin}}]),tt}();function ft(tt){return Le()?new Qt(tt):new nt(tt)}function Ze(tt,Fe,Ge){var Zt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(tt==="")return"";var en=yt(tt),ln=en.negativeStr,Dn=en.integerStr,Tn=en.decimalStr,En="".concat(Fe).concat(Tn),Fn="".concat(ln).concat(Dn);if(Ge>=0){var jn=Number(Tn[Ge]);if(jn>=5&&!Zt){var An=ft(tt).add("".concat(ln,"0.").concat("0".repeat(Ge)).concat(10-jn));return Ze(An.toString(),Fe,Ge,Zt)}return Ge===0?Fn:"".concat(Fn).concat(Fe).concat(Tn.padEnd(Ge,"0").slice(0,Ge))}return En===".0"?Fn:"".concat(Fn).concat(En)}var ke=ft,He=ue(93681),Ue=ue(34280),bt=ue(8654),Ve=ue(59301),jt=ue(48736);function st(tt,Fe){var Ge=(0,Ve.useRef)(null);function Zt(){try{var ln=tt.selectionStart,Dn=tt.selectionEnd,Tn=tt.value,En=Tn.substring(0,ln),Fn=Tn.substring(Dn);Ge.current={start:ln,end:Dn,value:Tn,beforeTxt:En,afterTxt:Fn}}catch(jn){}}function en(){if(tt&&Ge.current&&Fe)try{var ln=tt.value,Dn=Ge.current,Tn=Dn.beforeTxt,En=Dn.afterTxt,Fn=Dn.start,jn=ln.length;if(ln.endsWith(En))jn=ln.length-Ge.current.afterTxt.length;else if(ln.startsWith(Tn))jn=Tn.length;else{var An=Tn[Fn-1],hr=ln.indexOf(An,Fn-1);hr!==-1&&(jn=hr+1)}tt.setSelectionRange(jn,jn)}catch(_r){(0,jt.ZP)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(_r.message))}}return[Zt,en]}var Bt=ue(49658),Qe=function(){var Fe=(0,Ve.useState)(!1),Ge=(0,Ce.Z)(Fe,2),Zt=Ge[0],en=Ge[1];return(0,Ue.Z)(function(){en((0,Bt.Z)())},[]),Zt},zt=Qe,ct=ue(16089),It=200,Rt=600;function mt(tt){var Fe=tt.prefixCls,Ge=tt.upNode,Zt=tt.downNode,en=tt.upDisabled,ln=tt.downDisabled,Dn=tt.onStep,Tn=Ve.useRef(),En=Ve.useRef([]),Fn=Ve.useRef();Fn.current=Dn;var jn=function(){clearTimeout(Tn.current)},An=function(Or,Fr){Or.preventDefault(),jn(),Fn.current(Fr);function Er(){Fn.current(Fr),Tn.current=setTimeout(Er,It)}Tn.current=setTimeout(Er,Rt)};Ve.useEffect(function(){return function(){jn(),En.current.forEach(function(rr){return ct.Z.cancel(rr)})}},[]);var hr=zt();if(hr)return null;var _r="".concat(Fe,"-handler"),Tr=ot()(_r,"".concat(_r,"-up"),(0,Ae.Z)({},"".concat(_r,"-up-disabled"),en)),Hr=ot()(_r,"".concat(_r,"-down"),(0,Ae.Z)({},"".concat(_r,"-down-disabled"),ln)),sr=function(){return En.current.push((0,ct.Z)(jn))},Mr={unselectable:"on",role:"button",onMouseUp:sr,onMouseLeave:sr};return Ve.createElement("div",{className:"".concat(_r,"-wrap")},Ve.createElement("span",(0,be.Z)({},Mr,{onMouseDown:function(Or){An(Or,!0)},"aria-label":"Increase Value","aria-disabled":en,className:Tr}),Ge||Ve.createElement("span",{unselectable:"on",className:"".concat(Fe,"-handler-up-inner")})),Ve.createElement("span",(0,be.Z)({},Mr,{onMouseDown:function(Or){An(Or,!1)},"aria-label":"Decrease Value","aria-disabled":ln,className:Hr}),Zt||Ve.createElement("span",{unselectable:"on",className:"".concat(Fe,"-handler-down-inner")})))}function $e(tt){var Fe=typeof tt=="number"?at(tt):yt(tt).fullStr,Ge=Fe.includes(".");return Ge?yt(Fe.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:tt+"0"}var xe=ue(5643),ht=function(){var tt=(0,Ve.useRef)(0),Fe=function(){ct.Z.cancel(tt.current)};return(0,Ve.useEffect)(function(){return Fe},[]),function(Ge){Fe(),tt.current=(0,ct.Z)(function(){Ge()})}},nn=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],Ut=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","classes","className","classNames"],Xe=function(Fe,Ge){return Fe||Ge.isEmpty()?Ge.toString():Ge.toNumber()},Ye=function(Fe){var Ge=ke(Fe);return Ge.isInvalidate()?null:Ge},Dt=Ve.forwardRef(function(tt,Fe){var Ge,Zt=tt.prefixCls,en=Zt===void 0?"rc-input-number":Zt,ln=tt.className,Dn=tt.style,Tn=tt.min,En=tt.max,Fn=tt.step,jn=Fn===void 0?1:Fn,An=tt.defaultValue,hr=tt.value,_r=tt.disabled,Tr=tt.readOnly,Hr=tt.upHandler,sr=tt.downHandler,Mr=tt.keyboard,rr=tt.controls,Or=rr===void 0?!0:rr,Fr=tt.classNames,Er=tt.stringMode,jr=tt.parser,Nr=tt.formatter,Jn=tt.precision,lr=tt.decimalSeparator,Rn=tt.onChange,$n=tt.onInput,wr=tt.onPressEnter,lt=tt.onStep,_e=(0,Me.Z)(tt,nn),Pe="".concat(en,"-input"),De=Ve.useRef(null),Te=Ve.useState(!1),qe=(0,Ce.Z)(Te,2),dt=qe[0],Xt=qe[1],Ot=Ve.useRef(!1),Yt=Ve.useRef(!1),pn=Ve.useRef(!1),vn=Ve.useState(function(){return ke(hr!=null?hr:An)}),Sn=(0,Ce.Z)(vn,2),At=Sn[0],dn=Sn[1];function rt(_n){hr===void 0&&dn(_n)}var Mt=Ve.useCallback(function(_n,Mn){if(!Mn)return Jn>=0?Jn:Math.max(pt(_n),pt(jn))},[Jn,jn]),Lt=Ve.useCallback(function(_n){var Mn=String(_n);if(jr)return jr(Mn);var gr=Mn;return lr&&(gr=gr.replace(lr,".")),gr.replace(/[^\w.-]+/g,"")},[jr,lr]),Pt=Ve.useRef(""),an=Ve.useCallback(function(_n,Mn){if(Nr)return Nr(_n,{userTyping:Mn,input:String(Pt.current)});var gr=typeof _n=="number"?at(_n):_n;if(!Mn){var nr=Mt(gr,Mn);if(St(gr)&&(lr||nr>=0)){var kr=lr||".";gr=Ze(gr,kr,nr)}}return gr},[Nr,Mt,lr]),Et=Ve.useState(function(){var _n=An!=null?An:hr;return At.isInvalidate()&&["string","number"].includes((0,Ne.Z)(_n))?Number.isNaN(_n)?"":_n:an(At.toString(),!1)}),rn=(0,Ce.Z)(Et,2),Be=rn[0],wt=rn[1];Pt.current=Be;function Ct(_n,Mn){wt(an(_n.isInvalidate()?_n.toString(!1):_n.toString(!Mn),Mn))}var Nt=Ve.useMemo(function(){return Ye(En)},[En,Jn]),Tt=Ve.useMemo(function(){return Ye(Tn)},[Tn,Jn]),Ft=Ve.useMemo(function(){return!Nt||!At||At.isInvalidate()?!1:Nt.lessEquals(At)},[Nt,At]),Ht=Ve.useMemo(function(){return!Tt||!At||At.isInvalidate()?!1:At.lessEquals(Tt)},[Tt,At]),gn=st(De.current,dt),wn=(0,Ce.Z)(gn,2),Ln=wn[0],zn=wn[1],er=function(Mn){return Nt&&!Mn.lessEquals(Nt)?Nt:Tt&&!Tt.lessEquals(Mn)?Tt:null},cr=function(Mn){return!er(Mn)},Un=function(Mn,gr){var nr=Mn,kr=cr(nr)||nr.isEmpty();if(!nr.isEmpty()&&!gr&&(nr=er(nr)||nr,kr=!0),!Tr&&!_r&&kr){var Lr=nr.toString(),Ir=Mt(Lr,gr);return Ir>=0&&(nr=ke(Ze(Lr,".",Ir)),cr(nr)||(nr=ke(Ze(Lr,".",Ir,!0)))),nr.equals(At)||(rt(nr),Rn==null||Rn(nr.isEmpty()?null:Xe(Er,nr)),hr===void 0&&Ct(nr,gr)),nr}return At},In=ht(),fr=function _n(Mn){if(Ln(),Pt.current=Mn,wt(Mn),!Yt.current){var gr=Lt(Mn),nr=ke(gr);nr.isNaN()||Un(nr,!0)}$n==null||$n(Mn),In(function(){var kr=Mn;jr||(kr=Mn.replace(/。/g,".")),kr!==Mn&&_n(kr)})},tr=function(){Yt.current=!0},yr=function(){Yt.current=!1,fr(De.current.value)},Gn=function(Mn){fr(Mn.target.value)},Xn=function(Mn){var gr;if(!(Mn&&Ft||!Mn&&Ht)){Ot.current=!1;var nr=ke(pn.current?$e(jn):jn);Mn||(nr=nr.negate());var kr=(At||ke(0)).add(nr.toString()),Lr=Un(kr,!1);lt==null||lt(Xe(Er,Lr),{offset:pn.current?$e(jn):jn,type:Mn?"up":"down"}),(gr=De.current)===null||gr===void 0||gr.focus()}},br=function(Mn){var gr=ke(Lt(Be)),nr=gr;gr.isNaN()?nr=Un(At,Mn):nr=Un(gr,Mn),hr!==void 0?Ct(At,!1):nr.isNaN()||Ct(nr,!1)},ur=function(){Ot.current=!0},Br=function(Mn){var gr=Mn.key,nr=Mn.shiftKey;Ot.current=!0,pn.current=nr,gr==="Enter"&&(Yt.current||(Ot.current=!1),br(!1),wr==null||wr(Mn)),Mr!==!1&&!Yt.current&&["Up","ArrowUp","Down","ArrowDown"].includes(gr)&&(Xn(gr==="Up"||gr==="ArrowUp"),Mn.preventDefault())},Gr=function(){Ot.current=!1,pn.current=!1},ar=function(){br(!1),Xt(!1),Ot.current=!1};return(0,Ue.o)(function(){At.isInvalidate()||Ct(At,!1)},[Jn]),(0,Ue.o)(function(){var _n=ke(hr);dn(_n);var Mn=ke(Lt(Be));(!_n.equals(Mn)||!Ot.current||Nr)&&Ct(_n,Ot.current)},[hr]),(0,Ue.o)(function(){Nr&&zn()},[Be]),Ve.createElement("div",{className:ot()(en,Fr==null?void 0:Fr.input,ln,(Ge={},(0,Ae.Z)(Ge,"".concat(en,"-focused"),dt),(0,Ae.Z)(Ge,"".concat(en,"-disabled"),_r),(0,Ae.Z)(Ge,"".concat(en,"-readonly"),Tr),(0,Ae.Z)(Ge,"".concat(en,"-not-a-number"),At.isNaN()),(0,Ae.Z)(Ge,"".concat(en,"-out-of-range"),!At.isInvalidate()&&!cr(At)),Ge)),style:Dn,onFocus:function(){Xt(!0)},onBlur:ar,onKeyDown:Br,onKeyUp:Gr,onCompositionStart:tr,onCompositionEnd:yr,onBeforeInput:ur},Or&&Ve.createElement(mt,{prefixCls:en,upNode:Hr,downNode:sr,upDisabled:Ft,downDisabled:Ht,onStep:Xn}),Ve.createElement("div",{className:"".concat(Pe,"-wrap")},Ve.createElement("input",(0,be.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":Tn,"aria-valuemax":En,"aria-valuenow":At.isInvalidate()?null:At.toString(),step:jn},_e,{ref:(0,bt.sQ)(De,Fe),className:Pe,value:Be,onChange:Gn,disabled:_r,readOnly:Tr}))))}),bn=Ve.forwardRef(function(tt,Fe){var Ge=tt.disabled,Zt=tt.style,en=tt.prefixCls,ln=tt.value,Dn=tt.prefix,Tn=tt.suffix,En=tt.addonBefore,Fn=tt.addonAfter,jn=tt.classes,An=tt.className,hr=tt.classNames,_r=(0,Me.Z)(tt,Ut),Tr=Ve.useRef(null),Hr=function(Mr){Tr.current&&(0,xe.nH)(Tr.current,Mr)};return Ve.createElement(He.BaseInput,{inputElement:Ve.createElement(Dt,(0,be.Z)({prefixCls:en,disabled:Ge,classNames:hr,ref:(0,bt.sQ)(Tr,Fe)},_r)),className:An,triggerFocus:Hr,prefixCls:en,value:ln,disabled:Ge,style:Zt,prefix:Dn,suffix:Tn,addonAfter:Fn,addonBefore:En,classes:jn,classNames:hr,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}})});bn.displayName="InputNumber";var tn=bn,un=tn,Vt=ue(19080),Gt=ue(36355),Wt=ue(92736),ye=ue(1684),se=ue(19716),oe=ue(32441),de=ue(33234),fe=ue(9937),le=ue(17313),Ie=ue(74207),it=ue(83116),Kt=ue(37613);const $t=(tt,Fe)=>{let{componentCls:Ge,borderRadiusSM:Zt,borderRadiusLG:en}=tt;const ln=Fe==="lg"?en:Zt;return{[`&-${Fe}`]:{[`${Ge}-handler-wrap`]:{borderStartEndRadius:ln,borderEndEndRadius:ln},[`${Ge}-handler-up`]:{borderStartEndRadius:ln},[`${Ge}-handler-down`]:{borderEndEndRadius:ln}}}},Jt=tt=>{const{componentCls:Fe,lineWidth:Ge,lineType:Zt,colorBorder:en,borderRadius:ln,fontSizeLG:Dn,controlHeightLG:Tn,controlHeightSM:En,colorError:Fn,paddingInlineSM:jn,colorTextDescription:An,motionDurationMid:hr,handleHoverColor:_r,paddingInline:Tr,paddingBlock:Hr,handleBg:sr,handleActiveBg:Mr,colorTextDisabled:rr,borderRadiusSM:Or,borderRadiusLG:Fr,controlWidth:Er,handleVisible:jr,handleBorderColor:Nr}=tt;return[{[Fe]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,le.Wf)(tt)),(0,fe.ik)(tt)),(0,fe.bi)(tt,Fe)),{display:"inline-block",width:Er,margin:0,padding:0,border:`${Ge}px ${Zt} ${en}`,borderRadius:ln,"&-rtl":{direction:"rtl",[`${Fe}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:Dn,borderRadius:Fr,[`input${Fe}-input`]:{height:Tn-2*Ge}},"&-sm":{padding:0,borderRadius:Or,[`input${Fe}-input`]:{height:En-2*Ge,padding:`0 ${jn}px`}},"&:hover":Object.assign({},(0,fe.pU)(tt)),"&-focused":Object.assign({},(0,fe.M1)(tt)),"&-out-of-range":{[`${Fe}-input-wrap`]:{input:{color:Fn}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,le.Wf)(tt)),(0,fe.s7)(tt)),{"&-wrapper":{display:"inline-block",textAlign:"start",verticalAlign:"top",[`${Fe}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${Fe}-group-addon`]:{borderRadius:Fr,fontSize:tt.fontSizeLG}},"&-sm":{[`${Fe}-group-addon`]:{borderRadius:Or}},[`${Fe}-wrapper-disabled > ${Fe}-group-addon`]:Object.assign({},(0,fe.Xy)(tt))}}),[`&-disabled ${Fe}-input`]:{cursor:"not-allowed"},[Fe]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,le.Wf)(tt)),{width:"100%",padding:`${Hr}px ${Tr}px`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:ln,outline:0,transition:`all ${hr} linear`,appearance:"textfield",fontSize:"inherit"}),(0,fe.nz)(tt.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[Fe]:Object.assign(Object.assign(Object.assign({[`&:hover ${Fe}-handler-wrap, &-focused ${Fe}-handler-wrap`]:{opacity:1},[`${Fe}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:tt.handleWidth,height:"100%",background:sr,borderStartStartRadius:0,borderStartEndRadius:ln,borderEndEndRadius:ln,borderEndStartRadius:0,opacity:jr===!0?1:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${hr} linear ${hr}`,[`${Fe}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[`
|
|
|
${Fe}-handler-up-inner,
|
|
|
${Fe}-handler-down-inner
|
|
|
`]:{marginInlineEnd:0,fontSize:tt.handleFontSize}}},[`${Fe}-handler`]:{height:"50%",overflow:"hidden",color:An,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:`${Ge}px ${Zt} ${Nr}`,transition:`all ${hr} linear`,"&:active":{background:Mr},"&:hover":{height:"60%",[`
|
|
|
${Fe}-handler-up-inner,
|
|
|
${Fe}-handler-down-inner
|
|
|
`]:{color:_r}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,le.Ro)()),{color:An,transition:`all ${hr} linear`,userSelect:"none"})},[`${Fe}-handler-up`]:{borderStartEndRadius:ln},[`${Fe}-handler-down`]:{borderBlockStart:`${Ge}px ${Zt} ${Nr}`,borderEndEndRadius:ln}},$t(tt,"lg")),$t(tt,"sm")),{"&-disabled, &-readonly":{[`${Fe}-handler-wrap`]:{display:"none"},[`${Fe}-input`]:{color:"inherit"}},[`
|
|
|
${Fe}-handler-up-disabled,
|
|
|
${Fe}-handler-down-disabled
|
|
|
`]:{cursor:"not-allowed"},[`
|
|
|
${Fe}-handler-up-disabled:hover &-handler-up-inner,
|
|
|
${Fe}-handler-down-disabled:hover &-handler-down-inner
|
|
|
`]:{color:rr}})},{[`${Fe}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${Fe}-handler-down`]:{borderBlockStartWidth:0}}}]},qt=tt=>{const{componentCls:Fe,paddingBlock:Ge,paddingInline:Zt,inputAffixPadding:en,controlWidth:ln,borderRadiusLG:Dn,borderRadiusSM:Tn}=tt;return{[`${Fe}-affix-wrapper`]:Object.assign(Object.assign(Object.assign({},(0,fe.ik)(tt)),(0,fe.bi)(tt,`${Fe}-affix-wrapper`)),{position:"relative",display:"inline-flex",width:ln,padding:0,paddingInlineStart:Zt,"&-lg":{borderRadius:Dn},"&-sm":{borderRadius:Tn},[`&:not(${Fe}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},(0,fe.pU)(tt)),{zIndex:1}),"&-focused, &:focus":{zIndex:1},[`&-disabled > ${Fe}-disabled`]:{background:"transparent"},[`> div${Fe}`]:{width:"100%",border:"none",outline:"none",[`&${Fe}-focused`]:{boxShadow:"none !important"}},[`input${Fe}-input`]:{padding:`${Ge}px 0`},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${Fe}-handler-wrap`]:{zIndex:2},[Fe]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:en},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:Zt,marginInlineStart:en}}})}};var on=(0,it.Z)("InputNumber",tt=>{const Fe=(0,Kt.TS)(tt,(0,fe.e5)(tt));return[Jt(Fe),qt(Fe),(0,Ie.c)(Fe)]},tt=>Object.assign(Object.assign({},(0,fe.TM)(tt)),{controlWidth:90,handleWidth:tt.controlHeightSM-tt.lineWidth*2,handleFontSize:tt.fontSize/2,handleVisible:"auto",handleActiveBg:tt.colorFillAlter,handleBg:tt.colorBgContainer,handleHoverColor:tt.colorPrimary,handleBorderColor:tt.colorBorder})),mn=function(tt,Fe){var Ge={};for(var Zt in tt)Object.prototype.hasOwnProperty.call(tt,Zt)&&Fe.indexOf(Zt)<0&&(Ge[Zt]=tt[Zt]);if(tt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var en=0,Zt=Object.getOwnPropertySymbols(tt);en<Zt.length;en++)Fe.indexOf(Zt[en])<0&&Object.prototype.propertyIsEnumerable.call(tt,Zt[en])&&(Ge[Zt[en]]=tt[Zt[en]]);return Ge};const Cn=Ve.forwardRef((tt,Fe)=>{const{getPrefixCls:Ge,direction:Zt}=Ve.useContext(Gt.E_),en=Ve.useRef(null);Ve.useImperativeHandle(Fe,()=>en.current);const{className:ln,rootClassName:Dn,size:Tn,disabled:En,prefixCls:Fn,addonBefore:jn,addonAfter:An,prefix:hr,bordered:_r=!0,readOnly:Tr,status:Hr,controls:sr}=tt,Mr=mn(tt,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls"]),rr=Ge("input-number",Fn),[Or,Fr]=on(rr),{compactSize:Er,compactItemClassnames:jr}=(0,de.ri)(rr,Zt);let Nr=Ve.createElement(je.Z,{className:`${rr}-handler-up-inner`}),Jn=Ve.createElement(me.Z,{className:`${rr}-handler-down-inner`});const lr=typeof sr=="boolean"?sr:void 0;typeof sr=="object"&&(Nr=typeof sr.upIcon=="undefined"?Nr:Ve.createElement("span",{className:`${rr}-handler-up-inner`},sr.upIcon),Jn=typeof sr.downIcon=="undefined"?Jn:Ve.createElement("span",{className:`${rr}-handler-down-inner`},sr.downIcon));const{hasFeedback:Rn,status:$n,isFormItemInput:wr,feedbackIcon:lt}=Ve.useContext(oe.aM),_e=(0,Vt.F)($n,Hr),Pe=(0,se.Z)(Ot=>{var Yt;return(Yt=Tn!=null?Tn:Er)!==null&&Yt!==void 0?Yt:Ot}),De=Ve.useContext(ye.Z),Te=En!=null?En:De,qe=ot()({[`${rr}-lg`]:Pe==="large",[`${rr}-sm`]:Pe==="small",[`${rr}-rtl`]:Zt==="rtl",[`${rr}-borderless`]:!_r,[`${rr}-in-form-item`]:wr},(0,Vt.Z)(rr,_e),jr,Fr),dt=`${rr}-group`,Xt=Ve.createElement(un,Object.assign({ref:en,disabled:Te,className:ot()(ln,Dn),upHandler:Nr,downHandler:Jn,prefixCls:rr,readOnly:Tr,controls:lr,prefix:hr,suffix:Rn&<,addonAfter:An&&Ve.createElement(de.BR,null,Ve.createElement(oe.Ux,{override:!0,status:!0},An)),addonBefore:jn&&Ve.createElement(de.BR,null,Ve.createElement(oe.Ux,{override:!0,status:!0},jn)),classNames:{input:qe},classes:{affixWrapper:ot()((0,Vt.Z)(`${rr}-affix-wrapper`,_e,Rn),{[`${rr}-affix-wrapper-sm`]:Pe==="small",[`${rr}-affix-wrapper-lg`]:Pe==="large",[`${rr}-affix-wrapper-rtl`]:Zt==="rtl",[`${rr}-affix-wrapper-borderless`]:!_r},Fr),wrapper:ot()({[`${dt}-rtl`]:Zt==="rtl",[`${rr}-wrapper-disabled`]:Te},Fr),group:ot()({[`${rr}-group-wrapper-sm`]:Pe==="small",[`${rr}-group-wrapper-lg`]:Pe==="large",[`${rr}-group-wrapper-rtl`]:Zt==="rtl"},(0,Vt.Z)(`${rr}-group-wrapper`,_e,Rn),Fr)}},Mr));return Or(Xt)}),xt=Cn,hn=tt=>Ve.createElement(Wt.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},Ve.createElement(Cn,Object.assign({},tt)));xt._InternalPanelDoNotUseOrYouWillBeFired=hn;var On=xt},9432:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Qt},n:function(){return at}});var me=ue(19248),je=ue(92310),Ke=ue.n(je),ot=ue(93681),be=ue(8654),Ae=ue(59301),Ne=ue(19080),Ce=ue(36355),Me=ue(1684),ze=ue(19716),ut=ue(32441),Le=ue(33234),We=ue(59412),yt=ue(9937);function et(nt){return!!(nt.prefix||nt.suffix||nt.allowClear)}var pt=function(nt,ft){var Ze={};for(var ke in nt)Object.prototype.hasOwnProperty.call(nt,ke)&&ft.indexOf(ke)<0&&(Ze[ke]=nt[ke]);if(nt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var He=0,ke=Object.getOwnPropertySymbols(nt);He<ke.length;He++)ft.indexOf(ke[He])<0&&Object.prototype.propertyIsEnumerable.call(nt,ke[He])&&(Ze[ke[He]]=nt[ke[He]]);return Ze};function at(nt,ft){if(!nt)return;nt.focus(ft);const{cursor:Ze}=ft||{};if(Ze){const ke=nt.value.length;switch(Ze){case"start":nt.setSelectionRange(0,0);break;case"end":nt.setSelectionRange(ke,ke);break;default:nt.setSelectionRange(0,ke);break}}}var Qt=(0,Ae.forwardRef)((nt,ft)=>{var Ze;const{prefixCls:ke,bordered:He=!0,status:Ue,size:bt,disabled:Ve,onBlur:jt,onFocus:st,suffix:Bt,allowClear:Qe,addonAfter:zt,addonBefore:ct,className:It,style:Rt,styles:mt,rootClassName:$e,onChange:xe,classNames:ht}=nt,nn=pt(nt,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames"]),{getPrefixCls:Ut,direction:Xe,input:Ye}=Ae.useContext(Ce.E_),Dt=Ut("input",ke),bn=(0,Ae.useRef)(null),[tn,un]=(0,yt.ZP)(Dt),{compactSize:Vt,compactItemClassnames:Gt}=(0,Le.ri)(Dt,Xe),Wt=(0,ze.Z)(Cn=>{var xt;return(xt=bt!=null?bt:Vt)!==null&&xt!==void 0?xt:Cn}),ye=Ae.useContext(Me.Z),se=Ve!=null?Ve:ye,{status:oe,hasFeedback:de,feedbackIcon:fe}=(0,Ae.useContext)(ut.aM),le=(0,Ne.F)(oe,Ue),Ie=et(nt)||!!de,it=(0,Ae.useRef)(Ie);(0,Ae.useEffect)(()=>{var Cn;Ie&&it.current,it.current=Ie},[Ie]);const Kt=(0,We.Z)(bn,!0),$t=Cn=>{Kt(),jt==null||jt(Cn)},Jt=Cn=>{Kt(),st==null||st(Cn)},qt=Cn=>{Kt(),xe==null||xe(Cn)},on=(de||Bt)&&Ae.createElement(Ae.Fragment,null,Bt,de&&fe);let mn;return typeof Qe=="object"&&(Qe!=null&&Qe.clearIcon)?mn=Qe:Qe&&(mn={clearIcon:Ae.createElement(me.Z,null)}),tn(Ae.createElement(ot.default,Object.assign({ref:(0,be.sQ)(ft,bn),prefixCls:Dt,autoComplete:Ye==null?void 0:Ye.autoComplete},nn,{disabled:se,onBlur:$t,onFocus:Jt,style:Object.assign(Object.assign({},Ye==null?void 0:Ye.style),Rt),styles:Object.assign(Object.assign({},Ye==null?void 0:Ye.styles),mt),suffix:on,allowClear:mn,className:Ke()(It,$e,Gt,Ye==null?void 0:Ye.className),onChange:qt,addonAfter:zt&&Ae.createElement(Le.BR,null,Ae.createElement(ut.Ux,{override:!0,status:!0},zt)),addonBefore:ct&&Ae.createElement(Le.BR,null,Ae.createElement(ut.Ux,{override:!0,status:!0},ct)),classNames:Object.assign(Object.assign(Object.assign({},ht),Ye==null?void 0:Ye.classNames),{input:Ke()({[`${Dt}-sm`]:Wt==="small",[`${Dt}-lg`]:Wt==="large",[`${Dt}-rtl`]:Xe==="rtl",[`${Dt}-borderless`]:!He},!Ie&&(0,Ne.Z)(Dt,le),ht==null?void 0:ht.input,(Ze=Ye==null?void 0:Ye.classNames)===null||Ze===void 0?void 0:Ze.input,un)}),classes:{affixWrapper:Ke()({[`${Dt}-affix-wrapper-sm`]:Wt==="small",[`${Dt}-affix-wrapper-lg`]:Wt==="large",[`${Dt}-affix-wrapper-rtl`]:Xe==="rtl",[`${Dt}-affix-wrapper-borderless`]:!He},(0,Ne.Z)(`${Dt}-affix-wrapper`,le,de),un),wrapper:Ke()({[`${Dt}-group-rtl`]:Xe==="rtl"},un),group:Ke()({[`${Dt}-group-wrapper-sm`]:Wt==="small",[`${Dt}-group-wrapper-lg`]:Wt==="large",[`${Dt}-group-wrapper-rtl`]:Xe==="rtl",[`${Dt}-group-wrapper-disabled`]:se},(0,Ne.Z)(`${Dt}-group-wrapper`,le,de),un)}})))})},1643:function(kn,cn,ue){"use strict";var me=ue(19248),je=ue(92310),Ke=ue.n(je),ot=ue(9296),be=ue(59301),Ae=ue(19080),Ne=ue(36355),Ce=ue(1684),Me=ue(19716),ze=ue(32441),ut=ue(9432),Le=ue(9937),We=function(et,pt){var at={};for(var St in et)Object.prototype.hasOwnProperty.call(et,St)&&pt.indexOf(St)<0&&(at[St]=et[St]);if(et!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Qt=0,St=Object.getOwnPropertySymbols(et);Qt<St.length;Qt++)pt.indexOf(St[Qt])<0&&Object.prototype.propertyIsEnumerable.call(et,St[Qt])&&(at[St[Qt]]=et[St[Qt]]);return at};const yt=(0,be.forwardRef)((et,pt)=>{const{prefixCls:at,bordered:St=!0,size:Qt,disabled:nt,status:ft,allowClear:Ze,showCount:ke,classNames:He,rootClassName:Ue,className:bt}=et,Ve=We(et,["prefixCls","bordered","size","disabled","status","allowClear","showCount","classNames","rootClassName","className"]),{getPrefixCls:jt,direction:st}=be.useContext(Ne.E_),Bt=(0,Me.Z)(Qt),Qe=be.useContext(Ce.Z),zt=nt!=null?nt:Qe,{status:ct,hasFeedback:It,feedbackIcon:Rt}=be.useContext(ze.aM),mt=(0,Ae.F)(ct,ft),$e=be.useRef(null);be.useImperativeHandle(pt,()=>{var Xe;return{resizableTextArea:(Xe=$e.current)===null||Xe===void 0?void 0:Xe.resizableTextArea,focus:Ye=>{var Dt,bn;(0,ut.n)((bn=(Dt=$e.current)===null||Dt===void 0?void 0:Dt.resizableTextArea)===null||bn===void 0?void 0:bn.textArea,Ye)},blur:()=>{var Ye;return(Ye=$e.current)===null||Ye===void 0?void 0:Ye.blur()}}});const xe=jt("input",at);let ht;typeof Ze=="object"&&(Ze!=null&&Ze.clearIcon)?ht=Ze:Ze&&(ht={clearIcon:be.createElement(me.Z,null)});const[nn,Ut]=(0,Le.ZP)(xe);return nn(be.createElement(ot.default,Object.assign({},Ve,{disabled:zt,allowClear:ht,className:Ke()(bt,Ue),classes:{affixWrapper:Ke()(`${xe}-textarea-affix-wrapper`,{[`${xe}-affix-wrapper-rtl`]:st==="rtl",[`${xe}-affix-wrapper-borderless`]:!St,[`${xe}-affix-wrapper-sm`]:Bt==="small",[`${xe}-affix-wrapper-lg`]:Bt==="large",[`${xe}-textarea-show-count`]:ke},(0,Ae.Z)(`${xe}-affix-wrapper`,mt),Ut)},classNames:Object.assign(Object.assign({},He),{textarea:Ke()({[`${xe}-borderless`]:!St,[`${xe}-sm`]:Bt==="small",[`${xe}-lg`]:Bt==="large"},(0,Ae.Z)(xe,mt),Ut,He==null?void 0:He.textarea)}),prefixCls:xe,suffix:It&&be.createElement("span",{className:`${xe}-textarea-suffix`},Rt),showCount:ke,ref:$e})))});cn.Z=yt},59412:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return je}});var me=ue(59301);function je(Ke,ot){const be=(0,me.useRef)([]),Ae=()=>{be.current.push(setTimeout(()=>{var Ne,Ce,Me,ze;!((Ne=Ke.current)===null||Ne===void 0)&&Ne.input&&((Ce=Ke.current)===null||Ce===void 0?void 0:Ce.input.getAttribute("type"))==="password"&&(!((Me=Ke.current)===null||Me===void 0)&&Me.input.hasAttribute("value"))&&((ze=Ke.current)===null||ze===void 0||ze.input.removeAttribute("value"))}))};return(0,me.useEffect)(()=>(ot&&Ae(),()=>be.current.forEach(Ne=>{Ne&&clearTimeout(Ne)})),[]),Ae}},92832:function(kn,cn,ue){"use strict";ue.d(cn,{default:function(){return Bt}});var me=ue(92310),je=ue.n(me),Ke=ue(59301),ot=ue(36355),be=ue(32441),Ae=ue(9937),Ce=Qe=>{const{getPrefixCls:zt,direction:ct}=(0,Ke.useContext)(ot.E_),{prefixCls:It,className:Rt}=Qe,mt=zt("input-group",It),$e=zt("input"),[xe,ht]=(0,Ae.ZP)($e),nn=je()(mt,{[`${mt}-lg`]:Qe.size==="large",[`${mt}-sm`]:Qe.size==="small",[`${mt}-compact`]:Qe.compact,[`${mt}-rtl`]:ct==="rtl"},ht,Rt),Ut=(0,Ke.useContext)(be.aM),Xe=(0,Ke.useMemo)(()=>Object.assign(Object.assign({},Ut),{isFormItemInput:!1}),[Ut]);return xe(Ke.createElement("span",{className:nn,style:Qe.style,onMouseEnter:Qe.onMouseEnter,onMouseLeave:Qe.onMouseLeave,onFocus:Qe.onFocus,onBlur:Qe.onBlur},Ke.createElement(be.aM.Provider,{value:Xe},Qe.children)))},Me=ue(9432),ze=ue(73331),ut=ue(15277),Le=ue(2738),We=ue(8654),yt=ue(59412),et=function(Qe,zt){var ct={};for(var It in Qe)Object.prototype.hasOwnProperty.call(Qe,It)&&zt.indexOf(It)<0&&(ct[It]=Qe[It]);if(Qe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Rt=0,It=Object.getOwnPropertySymbols(Qe);Rt<It.length;Rt++)zt.indexOf(It[Rt])<0&&Object.prototype.propertyIsEnumerable.call(Qe,It[Rt])&&(ct[It[Rt]]=Qe[It[Rt]]);return ct};const pt=Qe=>Qe?Ke.createElement(ut.Z,null):Ke.createElement(ze.Z,null),at={click:"onClick",hover:"onMouseOver"};var Qt=Ke.forwardRef((Qe,zt)=>{const{visibilityToggle:ct=!0}=Qe,It=typeof ct=="object"&&ct.visible!==void 0,[Rt,mt]=(0,Ke.useState)(()=>It?ct.visible:!1),$e=(0,Ke.useRef)(null);Ke.useEffect(()=>{It&&mt(ct.visible)},[It,ct]);const xe=(0,yt.Z)($e),ht=()=>{const{disabled:se}=Qe;se||(Rt&&xe(),mt(oe=>{var de;const fe=!oe;return typeof ct=="object"&&((de=ct.onVisibleChange)===null||de===void 0||de.call(ct,fe)),fe}))},nn=se=>{const{action:oe="click",iconRender:de=pt}=Qe,fe=at[oe]||"",le=de(Rt),Ie={[fe]:ht,className:`${se}-icon`,key:"passwordIcon",onMouseDown:it=>{it.preventDefault()},onMouseUp:it=>{it.preventDefault()}};return Ke.cloneElement(Ke.isValidElement(le)?le:Ke.createElement("span",null,le),Ie)},{className:Ut,prefixCls:Xe,inputPrefixCls:Ye,size:Dt}=Qe,bn=et(Qe,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:tn}=Ke.useContext(ot.E_),un=tn("input",Ye),Vt=tn("input-password",Xe),Gt=ct&&nn(Vt),Wt=je()(Vt,Ut,{[`${Vt}-${Dt}`]:!!Dt}),ye=Object.assign(Object.assign({},(0,Le.Z)(bn,["suffix","iconRender","visibilityToggle"])),{type:Rt?"text":"password",className:Wt,prefixCls:un,suffix:Gt});return Dt&&(ye.size=Dt),Ke.createElement(Me.Z,Object.assign({ref:(0,We.sQ)(zt,$e)},ye))}),nt=ue(47472),ft=ue(92343),Ze=ue(3113),ke=ue(19716),He=ue(33234),Ue=function(Qe,zt){var ct={};for(var It in Qe)Object.prototype.hasOwnProperty.call(Qe,It)&&zt.indexOf(It)<0&&(ct[It]=Qe[It]);if(Qe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Rt=0,It=Object.getOwnPropertySymbols(Qe);Rt<It.length;Rt++)zt.indexOf(It[Rt])<0&&Object.prototype.propertyIsEnumerable.call(Qe,It[Rt])&&(ct[It[Rt]]=Qe[It[Rt]]);return ct},Ve=Ke.forwardRef((Qe,zt)=>{const{prefixCls:ct,inputPrefixCls:It,className:Rt,size:mt,suffix:$e,enterButton:xe=!1,addonAfter:ht,loading:nn,disabled:Ut,onSearch:Xe,onChange:Ye,onCompositionStart:Dt,onCompositionEnd:bn}=Qe,tn=Ue(Qe,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:un,direction:Vt}=Ke.useContext(ot.E_),Gt=Ke.useRef(!1),Wt=un("input-search",ct),ye=un("input",It),{compactSize:se}=(0,He.ri)(Wt,Vt),oe=(0,ke.Z)(hn=>{var On;return(On=mt!=null?mt:se)!==null&&On!==void 0?On:hn}),de=Ke.useRef(null),fe=hn=>{hn&&hn.target&&hn.type==="click"&&Xe&&Xe(hn.target.value,hn,{source:"clear"}),Ye&&Ye(hn)},le=hn=>{var On;document.activeElement===((On=de.current)===null||On===void 0?void 0:On.input)&&hn.preventDefault()},Ie=hn=>{var On,tt;Xe&&Xe((tt=(On=de.current)===null||On===void 0?void 0:On.input)===null||tt===void 0?void 0:tt.value,hn,{source:"input"})},it=hn=>{Gt.current||nn||Ie(hn)},Kt=typeof xe=="boolean"?Ke.createElement(nt.Z,null):null,$t=`${Wt}-button`;let Jt;const qt=xe||{},on=qt.type&&qt.type.__ANT_BUTTON===!0;on||qt.type==="button"?Jt=(0,ft.Tm)(qt,Object.assign({onMouseDown:le,onClick:hn=>{var On,tt;(tt=(On=qt==null?void 0:qt.props)===null||On===void 0?void 0:On.onClick)===null||tt===void 0||tt.call(On,hn),Ie(hn)},key:"enterButton"},on?{className:$t,size:oe}:{})):Jt=Ke.createElement(Ze.ZP,{className:$t,type:xe?"primary":void 0,size:oe,disabled:Ut,key:"enterButton",onMouseDown:le,onClick:Ie,loading:nn,icon:Kt},xe),ht&&(Jt=[Jt,(0,ft.Tm)(ht,{key:"addonAfter"})]);const mn=je()(Wt,{[`${Wt}-rtl`]:Vt==="rtl",[`${Wt}-${oe}`]:!!oe,[`${Wt}-with-button`]:!!xe},Rt),Cn=hn=>{Gt.current=!0,Dt==null||Dt(hn)},xt=hn=>{Gt.current=!1,bn==null||bn(hn)};return Ke.createElement(Me.Z,Object.assign({ref:(0,We.sQ)(de,zt),onPressEnter:it},tn,{size:oe,onCompositionStart:Cn,onCompositionEnd:xt,prefixCls:ye,addonAfter:Jt,suffix:$e,onChange:fe,className:mn,disabled:Ut}))}),jt=ue(1643);const st=Me.Z;st.Group=Ce,st.Search=Ve,st.TextArea=jt.Z,st.Password=Qt;var Bt=st},9937:function(kn,cn,ue){"use strict";ue.d(cn,{M1:function(){return Ne},TM:function(){return ft},Xy:function(){return Ce},bi:function(){return ut},e5:function(){return nt},ik:function(){return Le},nz:function(){return be},pU:function(){return Ae},s7:function(){return We},x0:function(){return ze}});var me=ue(17313),je=ue(74207),Ke=ue(37613),ot=ue(83116);const be=Ze=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:Ze,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),Ae=Ze=>({borderColor:Ze.hoverBorderColor}),Ne=Ze=>({borderColor:Ze.activeBorderColor,boxShadow:Ze.activeShadow,outline:0}),Ce=Ze=>({color:Ze.colorTextDisabled,backgroundColor:Ze.colorBgContainerDisabled,borderColor:Ze.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},Ae((0,Ke.TS)(Ze,{hoverBorderColor:Ze.colorBorder})))}),Me=Ze=>{const{paddingBlockLG:ke,fontSizeLG:He,lineHeightLG:Ue,borderRadiusLG:bt,paddingInlineLG:Ve}=Ze;return{padding:`${ke}px ${Ve}px`,fontSize:He,lineHeight:Ue,borderRadius:bt}},ze=Ze=>({padding:`${Ze.paddingBlockSM}px ${Ze.paddingInlineSM}px`,borderRadius:Ze.borderRadiusSM}),ut=(Ze,ke)=>{const{componentCls:He,colorError:Ue,colorWarning:bt,errorActiveShadow:Ve,warningActiveShadow:jt,colorErrorBorderHover:st,colorWarningBorderHover:Bt}=Ze;return{[`&-status-error:not(${ke}-disabled):not(${ke}-borderless)${ke}`]:{borderColor:Ue,"&:hover":{borderColor:st},"&:focus, &-focused":Object.assign({},Ne((0,Ke.TS)(Ze,{activeBorderColor:Ue,activeShadow:Ve}))),[`${He}-prefix, ${He}-suffix`]:{color:Ue}},[`&-status-warning:not(${ke}-disabled):not(${ke}-borderless)${ke}`]:{borderColor:bt,"&:hover":{borderColor:Bt},"&:focus, &-focused":Object.assign({},Ne((0,Ke.TS)(Ze,{activeBorderColor:bt,activeShadow:jt}))),[`${He}-prefix, ${He}-suffix`]:{color:bt}}}},Le=Ze=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${Ze.paddingBlock}px ${Ze.paddingInline}px`,color:Ze.colorText,fontSize:Ze.fontSize,lineHeight:Ze.lineHeight,backgroundColor:Ze.colorBgContainer,backgroundImage:"none",borderWidth:Ze.lineWidth,borderStyle:Ze.lineType,borderColor:Ze.colorBorder,borderRadius:Ze.borderRadius,transition:`all ${Ze.motionDurationMid}`},be(Ze.colorTextPlaceholder)),{"&:hover":Object.assign({},Ae(Ze)),"&:focus, &-focused":Object.assign({},Ne(Ze)),"&-disabled, &[disabled]":Object.assign({},Ce(Ze)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:"transparent",border:"none",boxShadow:"none"}},"textarea&":{maxWidth:"100%",height:"auto",minHeight:Ze.controlHeight,lineHeight:Ze.lineHeight,verticalAlign:"bottom",transition:`all ${Ze.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},Me(Ze)),"&-sm":Object.assign({},ze(Ze)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),We=Ze=>{const{componentCls:ke,antCls:He}=Ze;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:Ze.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${ke}, &-lg > ${ke}-group-addon`]:Object.assign({},Me(Ze)),[`&-sm ${ke}, &-sm > ${ke}-group-addon`]:Object.assign({},ze(Ze)),[`&-lg ${He}-select-single ${He}-select-selector`]:{height:Ze.controlHeightLG},[`&-sm ${He}-select-single ${He}-select-selector`]:{height:Ze.controlHeightSM},[`> ${ke}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${ke}-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 ${Ze.paddingInline}px`,color:Ze.colorText,fontWeight:"normal",fontSize:Ze.fontSize,textAlign:"center",backgroundColor:Ze.colorFillAlter,border:`${Ze.lineWidth}px ${Ze.lineType} ${Ze.colorBorder}`,borderRadius:Ze.borderRadius,transition:`all ${Ze.motionDurationSlow}`,lineHeight:1,[`${He}-select`]:{margin:`-${Ze.paddingBlock+1}px -${Ze.paddingInline}px`,[`&${He}-select-single:not(${He}-select-customize-input)`]:{[`${He}-select-selector`]:{backgroundColor:"inherit",border:`${Ze.lineWidth}px ${Ze.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${He}-select-selector`]:{color:Ze.colorPrimary}}},[`${He}-cascader-picker`]:{margin:`-9px -${Ze.paddingInline}px`,backgroundColor:"transparent",[`${He}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${ke}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${ke}-search-with-button &`]:{zIndex:0}}},[`> ${ke}:first-child, ${ke}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${He}-select ${He}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${ke}-affix-wrapper`]:{[`&:not(:first-child) ${ke}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${ke}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${ke}:last-child, ${ke}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${He}-select ${He}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${ke}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${ke}-search &`]:{borderStartStartRadius:Ze.borderRadius,borderEndStartRadius:Ze.borderRadius}},[`&:not(:first-child), ${ke}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${ke}-group-compact`]:Object.assign(Object.assign({display:"block"},(0,me.dF)()),{[`${ke}-group-addon, ${ke}-group-wrap, > ${ke}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:Ze.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`
|
|
|
& > ${ke}-affix-wrapper,
|
|
|
& > ${ke}-number-affix-wrapper,
|
|
|
& > ${He}-picker-range
|
|
|
`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-Ze.lineWidth,borderInlineEndWidth:Ze.lineWidth},[`${ke}`]:{float:"none"},[`& > ${He}-select > ${He}-select-selector,
|
|
|
& > ${He}-select-auto-complete ${ke},
|
|
|
& > ${He}-cascader-picker ${ke},
|
|
|
& > ${ke}-group-wrapper ${ke}`]:{borderInlineEndWidth:Ze.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${He}-select-focused`]:{zIndex:1},[`& > ${He}-select > ${He}-select-arrow`]:{zIndex:1},[`& > *:first-child,
|
|
|
& > ${He}-select:first-child > ${He}-select-selector,
|
|
|
& > ${He}-select-auto-complete:first-child ${ke},
|
|
|
& > ${He}-cascader-picker:first-child ${ke}`]:{borderStartStartRadius:Ze.borderRadius,borderEndStartRadius:Ze.borderRadius},[`& > *:last-child,
|
|
|
& > ${He}-select:last-child > ${He}-select-selector,
|
|
|
& > ${He}-cascader-picker:last-child ${ke},
|
|
|
& > ${He}-cascader-picker-focused:last-child ${ke}`]:{borderInlineEndWidth:Ze.lineWidth,borderStartEndRadius:Ze.borderRadius,borderEndEndRadius:Ze.borderRadius},[`& > ${He}-select-auto-complete ${ke}`]:{verticalAlign:"top"},[`${ke}-group-wrapper + ${ke}-group-wrapper`]:{marginInlineStart:-Ze.lineWidth,[`${ke}-affix-wrapper`]:{borderRadius:0}},[`${ke}-group-wrapper:not(:last-child)`]:{[`&${ke}-search > ${ke}-group`]:{[`& > ${ke}-group-addon > ${ke}-search-button`]:{borderRadius:0},[`& > ${ke}`]:{borderStartStartRadius:Ze.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:Ze.borderRadius}}}})}},yt=Ze=>{const{componentCls:ke,controlHeightSM:He,lineWidth:Ue}=Ze,Ve=(He-Ue*2-16)/2;return{[ke]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,me.Wf)(Ze)),Le(Ze)),ut(Ze,ke)),{'&[type="color"]':{height:Ze.controlHeight,[`&${ke}-lg`]:{height:Ze.controlHeightLG},[`&${ke}-sm`]:{height:He,paddingTop:Ve,paddingBottom:Ve}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},et=Ze=>{const{componentCls:ke}=Ze;return{[`${ke}-clear-icon`]:{margin:0,color:Ze.colorTextQuaternary,fontSize:Ze.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${Ze.motionDurationSlow}`,"&:hover":{color:Ze.colorTextTertiary},"&:active":{color:Ze.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${Ze.inputAffixPadding}px`}}}},pt=Ze=>{const{componentCls:ke,inputAffixPadding:He,colorTextDescription:Ue,motionDurationSlow:bt,colorIcon:Ve,colorIconHover:jt,iconCls:st}=Ze;return{[`${ke}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Le(Ze)),{display:"inline-flex",[`&:not(${ke}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},Ae(Ze)),{zIndex:1,[`${ke}-search-with-button &`]:{zIndex:0}}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${ke}[disabled]`]:{background:"transparent"}},[`> input${ke}`]:{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"'},[`${ke}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:Ze.paddingXS}},"&-show-count-suffix":{color:Ue},"&-show-count-has-suffix":{marginInlineEnd:Ze.paddingXXS},"&-prefix":{marginInlineEnd:He},"&-suffix":{marginInlineStart:He}}}),et(Ze)),{[`${st}${ke}-password-icon`]:{color:Ve,cursor:"pointer",transition:`all ${bt}`,"&:hover":{color:jt}}}),ut(Ze,`${ke}-affix-wrapper`))}},at=Ze=>{const{componentCls:ke,colorError:He,colorWarning:Ue,borderRadiusLG:bt,borderRadiusSM:Ve}=Ze;return{[`${ke}-group`]:Object.assign(Object.assign(Object.assign({},(0,me.Wf)(Ze)),We(Ze)),{"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${ke}-group-addon`]:{borderRadius:bt,fontSize:Ze.fontSizeLG}},"&-sm":{[`${ke}-group-addon`]:{borderRadius:Ve}},"&-status-error":{[`${ke}-group-addon`]:{color:He,borderColor:He}},"&-status-warning":{[`${ke}-group-addon`]:{color:Ue,borderColor:Ue}},"&-disabled":{[`${ke}-group-addon`]:Object.assign({},Ce(Ze))},[`&:not(${ke}-compact-first-item):not(${ke}-compact-last-item)${ke}-compact-item`]:{[`${ke}, ${ke}-group-addon`]:{borderRadius:0}},[`&:not(${ke}-compact-last-item)${ke}-compact-first-item`]:{[`${ke}, ${ke}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${ke}-compact-first-item)${ke}-compact-last-item`]:{[`${ke}, ${ke}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}})}},St=Ze=>{const{componentCls:ke,antCls:He}=Ze,Ue=`${ke}-search`;return{[Ue]:{[`${ke}`]:{"&:hover, &:focus":{borderColor:Ze.colorPrimaryHover,[`+ ${ke}-group-addon ${Ue}-button:not(${He}-btn-primary)`]:{borderInlineStartColor:Ze.colorPrimaryHover}}},[`${ke}-affix-wrapper`]:{borderRadius:0},[`${ke}-lg`]:{lineHeight:Ze.lineHeightLG-2e-4},[`> ${ke}-group`]:{[`> ${ke}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${Ue}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:Ze.borderRadius,borderEndEndRadius:Ze.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${Ue}-button:not(${He}-btn-primary)`]:{color:Ze.colorTextDescription,"&:hover":{color:Ze.colorPrimaryHover},"&:active":{color:Ze.colorPrimaryActive},[`&${He}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${Ue}-button`]:{height:Ze.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${Ue}-button`]:{height:Ze.controlHeightLG},[`&-small ${Ue}-button`]:{height:Ze.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${ke}-compact-item`]:{[`&:not(${ke}-compact-last-item)`]:{[`${ke}-group-addon`]:{[`${ke}-search-button`]:{marginInlineEnd:-Ze.lineWidth,borderRadius:0}}},[`&:not(${ke}-compact-first-item)`]:{[`${ke},${ke}-affix-wrapper`]:{borderRadius:0}},[`> ${ke}-group-addon ${ke}-search-button,
|
|
|
> ${ke},
|
|
|
${ke}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${ke}-affix-wrapper-focused`]:{zIndex:2}}}}},Qt=Ze=>{const{componentCls:ke,paddingLG:He}=Ze,Ue=`${ke}-textarea`;return{[Ue]:{position:"relative","&-show-count":{[`> ${ke}`]:{height:"100%"},[`${ke}-data-count`]:{position:"absolute",bottom:-Ze.fontSize*Ze.lineHeight,insetInlineEnd:0,color:Ze.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${ke}`]:{paddingInlineEnd:He}},[`&-affix-wrapper${Ue}-has-feedback`]:{[`${ke}`]:{paddingInlineEnd:He}},[`&-affix-wrapper${ke}-affix-wrapper`]:{padding:0,[`> textarea${ke}`]:{fontSize:"inherit",border:"none",outline:"none","&:focus":{boxShadow:"none !important"}},[`${ke}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${ke}-clear-icon`]:{position:"absolute",insetInlineEnd:Ze.paddingXS,insetBlockStart:Ze.paddingXS},[`${Ue}-suffix`]:{position:"absolute",top:0,insetInlineEnd:Ze.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}};function nt(Ze){return(0,Ke.TS)(Ze,{inputAffixPadding:Ze.paddingXXS})}const ft=Ze=>{const{controlHeight:ke,fontSize:He,lineHeight:Ue,lineWidth:bt,controlHeightSM:Ve,controlHeightLG:jt,fontSizeLG:st,lineHeightLG:Bt,paddingSM:Qe,controlPaddingHorizontalSM:zt,controlPaddingHorizontal:ct,colorFillAlter:It,colorPrimaryHover:Rt,controlOutlineWidth:mt,controlOutline:$e,colorErrorOutline:xe,colorWarningOutline:ht}=Ze;return{paddingBlock:Math.max(Math.round((ke-He*Ue)/2*10)/10-bt,3),paddingBlockSM:Math.max(Math.round((Ve-He*Ue)/2*10)/10-bt,0),paddingBlockLG:Math.ceil((jt-st*Bt)/2*10)/10-bt,paddingInline:Qe-bt,paddingInlineSM:zt-bt,paddingInlineLG:ct-bt,addonBg:It,activeBorderColor:Rt,hoverBorderColor:Rt,activeShadow:`0 0 0 ${mt}px ${$e}`,errorActiveShadow:`0 0 0 ${mt}px ${xe}`,warningActiveShadow:`0 0 0 ${mt}px ${ht}`}};cn.ZP=(0,ot.Z)("Input",Ze=>{const ke=(0,Ke.TS)(Ze,nt(Ze));return[yt(ke),Qt(ke),pt(ke),at(ke),St(ke),(0,je.c)(ke)]},ft)},45818:function(kn,cn,ue){"use strict";ue.d(cn,{D:function(){return nt},Z:function(){return ke}});var me=ue(60499),je=ue(59301),Ke={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},ot=Ke,be=ue(7657),Ae=function(Ue,bt){return je.createElement(be.Z,(0,me.Z)({},Ue,{ref:bt,icon:ot}))},Ne=je.forwardRef(Ae),Ce=Ne,Me=ue(33853),ze=ue(38819),ut=ue(92310),Le=ue.n(ut),We=ue(2738),et=He=>!isNaN(parseFloat(He))&&isFinite(He),pt=ue(36355),at=ue(84966),St=function(He,Ue){var bt={};for(var Ve in He)Object.prototype.hasOwnProperty.call(He,Ve)&&Ue.indexOf(Ve)<0&&(bt[Ve]=He[Ve]);if(He!=null&&typeof Object.getOwnPropertySymbols=="function")for(var jt=0,Ve=Object.getOwnPropertySymbols(He);jt<Ve.length;jt++)Ue.indexOf(Ve[jt])<0&&Object.prototype.propertyIsEnumerable.call(He,Ve[jt])&&(bt[Ve[jt]]=He[Ve[jt]]);return bt};const Qt={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px"},nt=je.createContext({}),ft=(()=>{let He=0;return function(){let Ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return He+=1,`${Ue}${He}`}})();var ke=je.forwardRef((He,Ue)=>{const{prefixCls:bt,className:Ve,trigger:jt,children:st,defaultCollapsed:Bt=!1,theme:Qe="dark",style:zt={},collapsible:ct=!1,reverseArrow:It=!1,width:Rt=200,collapsedWidth:mt=80,zeroWidthTriggerStyle:$e,breakpoint:xe,onCollapse:ht,onBreakpoint:nn}=He,Ut=St(He,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:Xe}=(0,je.useContext)(at.Gs),[Ye,Dt]=(0,je.useState)("collapsed"in He?He.collapsed:Bt),[bn,tn]=(0,je.useState)(!1);(0,je.useEffect)(()=>{"collapsed"in He&&Dt(He.collapsed)},[He.collapsed]);const un=(oe,de)=>{"collapsed"in He||Dt(oe),ht==null||ht(oe,de)},Vt=(0,je.useRef)();Vt.current=oe=>{tn(oe.matches),nn==null||nn(oe.matches),Ye!==oe.matches&&un(oe.matches,"responsive")},(0,je.useEffect)(()=>{function oe(fe){return Vt.current(fe)}let de;if(typeof window!="undefined"){const{matchMedia:fe}=window;if(fe&&xe&&xe in Qt){de=fe(`(max-width: ${Qt[xe]})`);try{de.addEventListener("change",oe)}catch(le){de.addListener(oe)}oe(de)}}return()=>{try{de==null||de.removeEventListener("change",oe)}catch(fe){de==null||de.removeListener(oe)}}},[xe]),(0,je.useEffect)(()=>{const oe=ft("ant-sider-");return Xe.addSider(oe),()=>Xe.removeSider(oe)},[]);const Gt=()=>{un(!Ye,"clickTrigger")},{getPrefixCls:Wt}=(0,je.useContext)(pt.E_),ye=()=>{const oe=Wt("layout-sider",bt),de=(0,We.Z)(Ut,["collapsed"]),fe=Ye?mt:Rt,le=et(fe)?`${fe}px`:String(fe),Ie=parseFloat(String(mt||0))===0?je.createElement("span",{onClick:Gt,className:Le()(`${oe}-zero-width-trigger`,`${oe}-zero-width-trigger-${It?"right":"left"}`),style:$e},jt||je.createElement(Ce,null)):null,$t={expanded:It?je.createElement(ze.Z,null):je.createElement(Me.Z,null),collapsed:It?je.createElement(Me.Z,null):je.createElement(ze.Z,null)}[Ye?"collapsed":"expanded"],Jt=jt!==null?Ie||je.createElement("div",{className:`${oe}-trigger`,onClick:Gt,style:{width:le}},jt||$t):null,qt=Object.assign(Object.assign({},zt),{flex:`0 0 ${le}`,maxWidth:le,minWidth:le,width:le}),on=Le()(oe,`${oe}-${Qe}`,{[`${oe}-collapsed`]:!!Ye,[`${oe}-has-trigger`]:ct&&jt!==null&&!Ie,[`${oe}-below`]:!!bn,[`${oe}-zero-width`]:parseFloat(le)===0},Ve);return je.createElement("aside",Object.assign({className:on},de,{style:qt,ref:Ue}),je.createElement("div",{className:`${oe}-children`},st),ct||bn&&Ie?Jt:null)},se=je.useMemo(()=>({siderCollapsed:Ye}),[Ye]);return je.createElement(nt.Provider,{value:se},ye())})},84966:function(kn,cn,ue){"use strict";ue.d(cn,{VY:function(){return nt},$_:function(){return Qt},h4:function(){return St},Gs:function(){return We},ZP:function(){return ft}});var me=ue(77654),je=ue(92310),Ke=ue.n(je),ot=ue(2738),be=ue(59301),Ae=ue(36355),Ne=ue(83116),Me=Ze=>{const{componentCls:ke,bodyBg:He,lightSiderBg:Ue,lightTriggerBg:bt,lightTriggerColor:Ve}=Ze;return{[`${ke}-sider-light`]:{background:Ue,[`${ke}-sider-trigger`]:{color:Ve,background:bt},[`${ke}-sider-zero-width-trigger`]:{color:Ve,background:bt,border:`1px solid ${He}`,borderInlineStart:0}}}};const ze=Ze=>{const{antCls:ke,componentCls:He,colorText:Ue,triggerColor:bt,footerBg:Ve,triggerBg:jt,headerHeight:st,headerPadding:Bt,headerColor:Qe,footerPadding:zt,triggerHeight:ct,zeroTriggerHeight:It,zeroTriggerWidth:Rt,motionDurationMid:mt,motionDurationSlow:$e,fontSize:xe,borderRadius:ht,bodyBg:nn,headerBg:Ut,siderBg:Xe}=Ze;return{[He]:Object.assign(Object.assign({display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:nn,"&, *":{boxSizing:"border-box"},[`&${He}-has-sider`]:{flexDirection:"row",[`> ${He}, > ${He}-content`]:{width:0}},[`${He}-header, &${He}-footer`]:{flex:"0 0 auto"},[`${He}-sider`]:{position:"relative",minWidth:0,background:Xe,transition:`all ${mt}, background 0s`,"&-children":{height:"100%",marginTop:-.1,paddingTop:.1,[`${ke}-menu${ke}-menu-inline-collapsed`]:{width:"auto"}},"&-has-trigger":{paddingBottom:ct},"&-right":{order:1},"&-trigger":{position:"fixed",bottom:0,zIndex:1,height:ct,color:bt,lineHeight:`${ct}px`,textAlign:"center",background:jt,cursor:"pointer",transition:`all ${mt}`},"&-zero-width":{"> *":{overflow:"hidden"},"&-trigger":{position:"absolute",top:st,insetInlineEnd:-Rt,zIndex:1,width:Rt,height:It,color:bt,fontSize:Ze.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:Xe,borderStartStartRadius:0,borderStartEndRadius:ht,borderEndEndRadius:ht,borderEndStartRadius:0,cursor:"pointer",transition:`background ${$e} ease`,"&::after":{position:"absolute",inset:0,background:"transparent",transition:`all ${$e}`,content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:-Rt,borderStartStartRadius:ht,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:ht}}}}},Me(Ze)),{"&-rtl":{direction:"rtl"}}),[`${He}-header`]:{height:st,padding:Bt,color:Qe,lineHeight:`${st}px`,background:Ut,[`${ke}-menu`]:{lineHeight:"inherit"}},[`${He}-footer`]:{padding:zt,color:Ue,fontSize:xe,background:Ve},[`${He}-content`]:{flex:"auto",minHeight:0}}};var ut=(0,Ne.Z)("Layout",Ze=>[ze(Ze)],Ze=>{const{colorBgLayout:ke,controlHeight:He,controlHeightLG:Ue,colorText:bt,controlHeightSM:Ve,marginXXS:jt,colorTextLightSolid:st,colorBgContainer:Bt}=Ze,Qe=Ue*1.25;return{colorBgHeader:"#001529",colorBgBody:ke,colorBgTrigger:"#002140",bodyBg:ke,headerBg:"#001529",headerHeight:He*2,headerPadding:`0 ${Qe}px`,headerColor:bt,footerPadding:`${Ve}px ${Qe}px`,footerBg:ke,siderBg:"#001529",triggerHeight:Ue+jt*2,triggerBg:"#002140",triggerColor:st,zeroTriggerWidth:Ue,zeroTriggerHeight:Ue,lightSiderBg:Bt,lightTriggerBg:Bt,lightTriggerColor:bt}},{deprecatedTokens:[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]]}),Le=function(Ze,ke){var He={};for(var Ue in Ze)Object.prototype.hasOwnProperty.call(Ze,Ue)&&ke.indexOf(Ue)<0&&(He[Ue]=Ze[Ue]);if(Ze!=null&&typeof Object.getOwnPropertySymbols=="function")for(var bt=0,Ue=Object.getOwnPropertySymbols(Ze);bt<Ue.length;bt++)ke.indexOf(Ue[bt])<0&&Object.prototype.propertyIsEnumerable.call(Ze,Ue[bt])&&(He[Ue[bt]]=Ze[Ue[bt]]);return He};const We=be.createContext({siderHook:{addSider:()=>null,removeSider:()=>null}});function yt(Ze){let{suffixCls:ke,tagName:He,displayName:Ue}=Ze;return bt=>be.forwardRef((jt,st)=>be.createElement(bt,Object.assign({ref:st,suffixCls:ke,tagName:He},jt)))}const et=be.forwardRef((Ze,ke)=>{const{prefixCls:He,suffixCls:Ue,className:bt,tagName:Ve}=Ze,jt=Le(Ze,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:st}=be.useContext(Ae.E_),Bt=st("layout",He),[Qe,zt]=ut(Bt),ct=Ue?`${Bt}-${Ue}`:Bt;return Qe(be.createElement(Ve,Object.assign({className:Ke()(He||ct,bt,zt),ref:ke},jt)))}),pt=be.forwardRef((Ze,ke)=>{const{direction:He}=be.useContext(Ae.E_),[Ue,bt]=be.useState([]),{prefixCls:Ve,className:jt,rootClassName:st,children:Bt,hasSider:Qe,tagName:zt,style:ct}=Ze,It=Le(Ze,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),Rt=(0,ot.Z)(It,["suffixCls"]),{getPrefixCls:mt,layout:$e}=be.useContext(Ae.E_),xe=mt("layout",Ve),[ht,nn]=ut(xe),Ut=Ke()(xe,{[`${xe}-has-sider`]:typeof Qe=="boolean"?Qe:Ue.length>0,[`${xe}-rtl`]:He==="rtl"},$e==null?void 0:$e.className,jt,st,nn),Xe=be.useMemo(()=>({siderHook:{addSider:Ye=>{bt(Dt=>[].concat((0,me.Z)(Dt),[Ye]))},removeSider:Ye=>{bt(Dt=>Dt.filter(bn=>bn!==Ye))}}}),[]);return ht(be.createElement(We.Provider,{value:Xe},be.createElement(zt,Object.assign({ref:ke,className:Ut,style:Object.assign(Object.assign({},$e==null?void 0:$e.style),ct)},Rt),Bt)))}),at=yt({tagName:"div",displayName:"Layout"})(pt),St=yt({suffixCls:"header",tagName:"header",displayName:"Header"})(et),Qt=yt({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(et),nt=yt({suffixCls:"content",tagName:"main",displayName:"Content"})(et);var ft=at},40875:function(kn,cn,ue){"use strict";ue.d(cn,{J:function(){return Ae}});var me=ue(59301),je=ue(33234),Ke=ue(70425),ot=function(Ne,Ce){var Me={};for(var ze in Ne)Object.prototype.hasOwnProperty.call(Ne,ze)&&Ce.indexOf(ze)<0&&(Me[ze]=Ne[ze]);if(Ne!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ut=0,ze=Object.getOwnPropertySymbols(Ne);ut<ze.length;ut++)Ce.indexOf(ze[ut])<0&&Object.prototype.propertyIsEnumerable.call(Ne,ze[ut])&&(Me[ze[ut]]=Ne[ze[ut]]);return Me};const be=me.createContext(null),Ae=me.forwardRef((Ne,Ce)=>{const{children:Me}=Ne,ze=ot(Ne,["children"]),ut=me.useContext(be),Le=me.useMemo(()=>Object.assign(Object.assign({},ut),ze),[ut,ze.prefixCls,ze.mode,ze.selectable]);return me.createElement(be.Provider,{value:Le},me.createElement(je.BR,null,(0,Ke.supportNodeRef)(Me)?me.cloneElement(Me,{ref:Ce}):Me))});cn.Z=be},20834:function(kn,cn,ue){"use strict";ue.d(cn,{default:function(){return se}});var me=ue(15285),je=ue(59301),Ke=ue(45818),ot=ue(92310),be=ue.n(ot),Ae=ue(36355),Ne=function(oe,de){var fe={};for(var le in oe)Object.prototype.hasOwnProperty.call(oe,le)&&de.indexOf(le)<0&&(fe[le]=oe[le]);if(oe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ie=0,le=Object.getOwnPropertySymbols(oe);Ie<le.length;Ie++)de.indexOf(le[Ie])<0&&Object.prototype.propertyIsEnumerable.call(oe,le[Ie])&&(fe[le[Ie]]=oe[le[Ie]]);return fe},Me=oe=>{const{prefixCls:de,className:fe,dashed:le}=oe,Ie=Ne(oe,["prefixCls","className","dashed"]),{getPrefixCls:it}=je.useContext(Ae.E_),Kt=it("menu",de),$t=be()({[`${Kt}-item-divider-dashed`]:!!le},fe);return je.createElement(me.iz,Object.assign({className:$t},Ie))},ze=ue(11592),ut=ue(2738),Le=ue(6848),We=ue(92343),et=(0,je.createContext)({prefixCls:"",firstLevel:!0,inlineCollapsed:!1}),at=oe=>{var de;const{className:fe,children:le,icon:Ie,title:it,danger:Kt}=oe,{prefixCls:$t,firstLevel:Jt,direction:qt,disableMenuItemTitleTooltip:on,inlineCollapsed:mn}=je.useContext(et),Cn=Ge=>{const Zt=je.createElement("span",{className:`${$t}-title-content`},le);return(!Ie||(0,We.l$)(le)&&le.type==="span")&&le&&Ge&&Jt&&typeof le=="string"?je.createElement("div",{className:`${$t}-inline-collapsed-noicon`},le.charAt(0)):Zt},{siderCollapsed:xt}=je.useContext(Ke.D);let hn=it;typeof it=="undefined"?hn=Jt?le:"":it===!1&&(hn="");const On={title:hn};!xt&&!mn&&(On.title=null,On.open=!1);const tt=(0,ze.Z)(le).length;let Fe=je.createElement(me.ck,Object.assign({},(0,ut.Z)(oe,["title","icon","danger"]),{className:be()({[`${$t}-item-danger`]:Kt,[`${$t}-item-only-child`]:(Ie?tt+1:tt)===1},fe),title:typeof it=="string"?it:void 0}),(0,We.Tm)(Ie,{className:be()((0,We.l$)(Ie)?(de=Ie.props)===null||de===void 0?void 0:de.className:"",`${$t}-item-icon`)}),Cn(mn));return on||(Fe=je.createElement(Le.Z,Object.assign({},On,{placement:qt==="rtl"?"left":"right",overlayClassName:`${$t}-inline-collapsed-tooltip`}),Fe)),Fe},Qt=oe=>{var de;const{popupClassName:fe,icon:le,title:Ie,theme:it}=oe,Kt=je.useContext(et),{prefixCls:$t,inlineCollapsed:Jt,theme:qt}=Kt,on=(0,me.Xl)();let mn;if(!le)mn=Jt&&!on.length&&Ie&&typeof Ie=="string"?je.createElement("div",{className:`${$t}-inline-collapsed-noicon`},Ie.charAt(0)):je.createElement("span",{className:`${$t}-title-content`},Ie);else{const xt=(0,We.l$)(Ie)&&Ie.type==="span";mn=je.createElement(je.Fragment,null,(0,We.Tm)(le,{className:be()((0,We.l$)(le)?(de=le.props)===null||de===void 0?void 0:de.className:"",`${$t}-item-icon`)}),xt?Ie:je.createElement("span",{className:`${$t}-title-content`},Ie))}const Cn=je.useMemo(()=>Object.assign(Object.assign({},Kt),{firstLevel:!1}),[Kt]);return je.createElement(et.Provider,{value:Cn},je.createElement(me.Wd,Object.assign({},(0,ut.Z)(oe,["icon"]),{title:mn,popupClassName:be()($t,fe,`${$t}-${it||qt}`)})))},nt=ue(18785),ft=ue(70425),Ze=ue(62892),ke=ue(40875),He=function(oe,de){var fe={};for(var le in oe)Object.prototype.hasOwnProperty.call(oe,le)&&de.indexOf(le)<0&&(fe[le]=oe[le]);if(oe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ie=0,le=Object.getOwnPropertySymbols(oe);Ie<le.length;Ie++)de.indexOf(le[Ie])<0&&Object.prototype.propertyIsEnumerable.call(oe,le[Ie])&&(fe[le[Ie]]=oe[le[Ie]]);return fe};function Ue(oe){return(oe||[]).map((de,fe)=>{if(de&&typeof de=="object"){const le=de,{label:Ie,children:it,key:Kt,type:$t}=le,Jt=He(le,["label","children","key","type"]),qt=Kt!=null?Kt:`tmp-${fe}`;return it||$t==="group"?$t==="group"?je.createElement(me.BW,Object.assign({key:qt},Jt,{title:Ie}),Ue(it)):je.createElement(Qt,Object.assign({key:qt},Jt,{title:Ie}),Ue(it)):$t==="divider"?je.createElement(Me,Object.assign({key:qt},Jt)):je.createElement(at,Object.assign({key:qt},Jt),Ie)}return null}).filter(de=>de)}function bt(oe){return je.useMemo(()=>oe&&Ue(oe),[oe])}var Ve=ue(64993),jt=ue(17313),st=ue(8378),Bt=ue(13826),Qe=ue(29878),zt=ue(83116),ct=ue(37613),Rt=oe=>{const{componentCls:de,motionDurationSlow:fe,horizontalLineHeight:le,colorSplit:Ie,lineWidth:it,lineType:Kt,itemPaddingInline:$t}=oe;return{[`${de}-horizontal`]:{lineHeight:le,border:0,borderBottom:`${it}px ${Kt} ${Ie}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${de}-item, ${de}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:$t},[`> ${de}-item:hover,
|
|
|
> ${de}-item-active,
|
|
|
> ${de}-submenu ${de}-submenu-title:hover`]:{backgroundColor:"transparent"},[`${de}-item, ${de}-submenu-title`]:{transition:[`border-color ${fe}`,`background ${fe}`].join(",")},[`${de}-submenu-arrow`]:{display:"none"}}}},$e=oe=>{let{componentCls:de,menuArrowOffset:fe}=oe;return{[`${de}-rtl`]:{direction:"rtl"},[`${de}-submenu-rtl`]:{transformOrigin:"100% 0"},[`${de}-rtl${de}-vertical,
|
|
|
${de}-submenu-rtl ${de}-vertical`]:{[`${de}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(-${fe})`},"&::after":{transform:`rotate(45deg) translateY(${fe})`}}}}};const xe=oe=>Object.assign({},(0,jt.oN)(oe));var nn=(oe,de)=>{const{componentCls:fe,itemColor:le,itemSelectedColor:Ie,groupTitleColor:it,itemBg:Kt,subMenuItemBg:$t,itemSelectedBg:Jt,activeBarHeight:qt,activeBarWidth:on,activeBarBorderWidth:mn,motionDurationSlow:Cn,motionEaseInOut:xt,motionEaseOut:hn,itemPaddingInline:On,motionDurationMid:tt,itemHoverColor:Fe,lineType:Ge,colorSplit:Zt,itemDisabledColor:en,dangerItemColor:ln,dangerItemHoverColor:Dn,dangerItemSelectedColor:Tn,dangerItemActiveBg:En,dangerItemSelectedBg:Fn,itemHoverBg:jn,itemActiveBg:An,menuSubMenuBg:hr,horizontalItemSelectedColor:_r,horizontalItemSelectedBg:Tr,horizontalItemBorderRadius:Hr,horizontalItemHoverBg:sr,popupBg:Mr}=oe;return{[`${fe}-${de}, ${fe}-${de} > ${fe}`]:{color:le,background:Kt,[`&${fe}-root:focus-visible`]:Object.assign({},xe(oe)),[`${fe}-item-group-title`]:{color:it},[`${fe}-submenu-selected`]:{[`> ${fe}-submenu-title`]:{color:Ie}},[`${fe}-item-disabled, ${fe}-submenu-disabled`]:{color:`${en} !important`},[`${fe}-item:not(${fe}-item-selected):not(${fe}-submenu-selected)`]:{[`&:hover, > ${fe}-submenu-title:hover`]:{color:Fe}},[`&:not(${fe}-horizontal)`]:{[`${fe}-item:not(${fe}-item-selected)`]:{"&:hover":{backgroundColor:jn},"&:active":{backgroundColor:An}},[`${fe}-submenu-title`]:{"&:hover":{backgroundColor:jn},"&:active":{backgroundColor:An}}},[`${fe}-item-danger`]:{color:ln,[`&${fe}-item:hover`]:{[`&:not(${fe}-item-selected):not(${fe}-submenu-selected)`]:{color:Dn}},[`&${fe}-item:active`]:{background:En}},[`${fe}-item a`]:{"&, &:hover":{color:"inherit"}},[`${fe}-item-selected`]:{color:Ie,[`&${fe}-item-danger`]:{color:Tn},"a, a:hover":{color:"inherit"}},[`& ${fe}-item-selected`]:{backgroundColor:Jt,[`&${fe}-item-danger`]:{backgroundColor:Fn}},[`${fe}-item, ${fe}-submenu-title`]:{[`&:not(${fe}-item-disabled):focus-visible`]:Object.assign({},xe(oe))},[`&${fe}-submenu > ${fe}`]:{backgroundColor:hr},[`&${fe}-popup > ${fe}`]:{backgroundColor:Mr},[`&${fe}-horizontal`]:Object.assign(Object.assign({},de==="dark"?{borderBottom:0}:{}),{[`> ${fe}-item, > ${fe}-submenu`]:{top:mn,marginTop:-mn,marginBottom:0,borderRadius:Hr,"&::after":{position:"absolute",insetInline:On,bottom:0,borderBottom:`${qt}px solid transparent`,transition:`border-color ${Cn} ${xt}`,content:'""'},"&:hover, &-active, &-open":{background:sr,"&::after":{borderBottomWidth:qt,borderBottomColor:_r}},"&-selected":{color:_r,backgroundColor:Tr,"&:hover":{backgroundColor:Tr},"&::after":{borderBottomWidth:qt,borderBottomColor:_r}}}}),[`&${fe}-root`]:{[`&${fe}-inline, &${fe}-vertical`]:{borderInlineEnd:`${mn}px ${Ge} ${Zt}`}},[`&${fe}-inline`]:{[`${fe}-sub${fe}-inline`]:{background:$t},[`${fe}-item, ${fe}-submenu-title`]:mn&&on?{width:`calc(100% + ${mn}px)`}:{},[`${fe}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${on}px solid ${Ie}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${tt} ${hn}`,`opacity ${tt} ${hn}`].join(","),content:'""'},[`&${fe}-item-danger`]:{"&::after":{borderInlineEndColor:Tn}}},[`${fe}-selected, ${fe}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${tt} ${xt}`,`opacity ${tt} ${xt}`].join(",")}}}}}};const Ut=oe=>{const{componentCls:de,itemHeight:fe,itemMarginInline:le,padding:Ie,menuArrowSize:it,marginXS:Kt,itemMarginBlock:$t}=oe,Jt=Ie+it+Kt;return{[`${de}-item`]:{position:"relative",overflow:"hidden"},[`${de}-item, ${de}-submenu-title`]:{height:fe,lineHeight:`${fe}px`,paddingInline:Ie,overflow:"hidden",textOverflow:"ellipsis",marginInline:le,marginBlock:$t,width:`calc(100% - ${le*2}px)`},[`> ${de}-item,
|
|
|
> ${de}-submenu > ${de}-submenu-title`]:{height:fe,lineHeight:`${fe}px`},[`${de}-item-group-list ${de}-submenu-title,
|
|
|
${de}-submenu-title`]:{paddingInlineEnd:Jt}}};var Ye=oe=>{const{componentCls:de,iconCls:fe,itemHeight:le,colorTextLightSolid:Ie,dropdownWidth:it,controlHeightLG:Kt,motionDurationMid:$t,motionEaseOut:Jt,paddingXL:qt,itemMarginInline:on,fontSizeLG:mn,motionDurationSlow:Cn,paddingXS:xt,boxShadowSecondary:hn,collapsedWidth:On,collapsedIconSize:tt}=oe,Fe={height:le,lineHeight:`${le}px`,listStylePosition:"inside",listStyleType:"disc"};return[{[de]:{"&-inline, &-vertical":Object.assign({[`&${de}-root`]:{boxShadow:"none"}},Ut(oe))},[`${de}-submenu-popup`]:{[`${de}-vertical`]:Object.assign(Object.assign({},Ut(oe)),{boxShadow:hn})}},{[`${de}-submenu-popup ${de}-vertical${de}-sub`]:{minWidth:it,maxHeight:`calc(100vh - ${Kt*2.5}px)`,padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{[`${de}-inline`]:{width:"100%",[`&${de}-root`]:{[`${de}-item, ${de}-submenu-title`]:{display:"flex",alignItems:"center",transition:[`border-color ${Cn}`,`background ${Cn}`,`padding ${$t} ${Jt}`].join(","),[`> ${de}-title-content`]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},[`${de}-sub${de}-inline`]:{padding:0,border:0,borderRadius:0,boxShadow:"none",[`& > ${de}-submenu > ${de}-submenu-title`]:Fe,[`& ${de}-item-group-title`]:{paddingInlineStart:qt}},[`${de}-item`]:Fe}},{[`${de}-inline-collapsed`]:{width:On,[`&${de}-root`]:{[`${de}-item, ${de}-submenu ${de}-submenu-title`]:{[`> ${de}-inline-collapsed-noicon`]:{fontSize:mn,textAlign:"center"}}},[`> ${de}-item,
|
|
|
> ${de}-item-group > ${de}-item-group-list > ${de}-item,
|
|
|
> ${de}-item-group > ${de}-item-group-list > ${de}-submenu > ${de}-submenu-title,
|
|
|
> ${de}-submenu > ${de}-submenu-title`]:{insetInlineStart:0,paddingInline:`calc(50% - ${mn/2}px - ${on}px)`,textOverflow:"clip",[`
|
|
|
${de}-submenu-arrow,
|
|
|
${de}-submenu-expand-icon
|
|
|
`]:{opacity:0},[`${de}-item-icon, ${fe}`]:{margin:0,fontSize:tt,lineHeight:`${le}px`,"+ span":{display:"inline-block",opacity:0}}},[`${de}-item-icon, ${fe}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${de}-item-icon, ${fe}`]:{display:"none"},"a, a:hover":{color:Ie}},[`${de}-item-group-title`]:Object.assign(Object.assign({},jt.vS),{paddingInline:xt})}}]};const Dt=oe=>{const{componentCls:de,motionDurationSlow:fe,motionDurationMid:le,motionEaseInOut:Ie,motionEaseOut:it,iconCls:Kt,iconSize:$t,iconMarginInlineEnd:Jt}=oe;return{[`${de}-item, ${de}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${fe}`,`background ${fe}`,`padding ${fe} ${Ie}`].join(","),[`${de}-item-icon, ${Kt}`]:{minWidth:$t,fontSize:$t,transition:[`font-size ${le} ${it}`,`margin ${fe} ${Ie}`,`color ${fe}`].join(","),"+ span":{marginInlineStart:Jt,opacity:1,transition:[`opacity ${fe} ${Ie}`,`margin ${fe}`,`color ${fe}`].join(",")}},[`${de}-item-icon`]:Object.assign({},(0,jt.Ro)()),[`&${de}-item-only-child`]:{[`> ${Kt}, > ${de}-item-icon`]:{marginInlineEnd:0}}},[`${de}-item-disabled, ${de}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important"},[`> ${de}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},bn=oe=>{const{componentCls:de,motionDurationSlow:fe,motionEaseInOut:le,borderRadius:Ie,menuArrowSize:it,menuArrowOffset:Kt}=oe;return{[`${de}-submenu`]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:oe.margin,width:it,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${fe} ${le}, opacity ${fe}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:it*.6,height:it*.15,backgroundColor:"currentcolor",borderRadius:Ie,transition:[`background ${fe} ${le}`,`transform ${fe} ${le}`,`top ${fe} ${le}`,`color ${fe} ${le}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(-${Kt})`},"&::after":{transform:`rotate(-45deg) translateY(${Kt})`}}}}},tn=oe=>{const{antCls:de,componentCls:fe,fontSize:le,motionDurationSlow:Ie,motionDurationMid:it,motionEaseInOut:Kt,paddingXS:$t,padding:Jt,colorSplit:qt,lineWidth:on,zIndexPopup:mn,borderRadiusLG:Cn,subMenuItemBorderRadius:xt,menuArrowSize:hn,menuArrowOffset:On,lineType:tt,menuPanelMaskInset:Fe,groupTitleLineHeight:Ge,groupTitleFontSize:Zt}=oe;return[{"":{[`${fe}`]:Object.assign(Object.assign({},(0,jt.dF)()),{"&-hidden":{display:"none"}})},[`${fe}-submenu-hidden`]:{display:"none"}},{[fe]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,jt.Wf)(oe)),(0,jt.dF)()),{marginBottom:0,paddingInlineStart:0,fontSize:le,lineHeight:0,listStyle:"none",outline:"none",transition:`width ${Ie} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",[`${fe}-item`]:{flex:"none"}},[`${fe}-item, ${fe}-submenu, ${fe}-submenu-title`]:{borderRadius:oe.itemBorderRadius},[`${fe}-item-group-title`]:{padding:`${$t}px ${Jt}px`,fontSize:Zt,lineHeight:Ge,transition:`all ${Ie}`},[`&-horizontal ${fe}-submenu`]:{transition:[`border-color ${Ie} ${Kt}`,`background ${Ie} ${Kt}`].join(",")},[`${fe}-submenu, ${fe}-submenu-inline`]:{transition:[`border-color ${Ie} ${Kt}`,`background ${Ie} ${Kt}`,`padding ${it} ${Kt}`].join(",")},[`${fe}-submenu ${fe}-sub`]:{cursor:"initial",transition:[`background ${Ie} ${Kt}`,`padding ${Ie} ${Kt}`].join(",")},[`${fe}-title-content`]:{transition:`color ${Ie}`},[`${fe}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${fe}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:qt,borderStyle:tt,borderWidth:0,borderTopWidth:on,marginBlock:on,padding:0,"&-dashed":{borderStyle:"dashed"}}}),Dt(oe)),{[`${fe}-item-group`]:{[`${fe}-item-group-list`]:{margin:0,padding:0,[`${fe}-item, ${fe}-submenu-title`]:{paddingInline:`${le*2}px ${Jt}px`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:mn,borderRadius:Cn,boxShadow:"none",transformOrigin:"0 0",[`&${fe}-submenu`]:{background:"transparent"},"&::before":{position:"absolute",inset:`${Fe}px 0 0`,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'}},"&-placement-rightTop::before":{top:0,insetInlineStart:Fe},"\n &-placement-leftTop,\n &-placement-bottomRight,\n ":{transformOrigin:"100% 0"},"\n &-placement-leftBottom,\n &-placement-topRight,\n ":{transformOrigin:"100% 100%"},"\n &-placement-rightBottom,\n &-placement-topLeft,\n ":{transformOrigin:"0 100%"},"\n &-placement-bottomLeft,\n &-placement-rightTop,\n ":{transformOrigin:"0 0"},"\n &-placement-leftTop,\n &-placement-leftBottom\n ":{paddingInlineEnd:oe.paddingXS},"\n &-placement-rightTop,\n &-placement-rightBottom\n ":{paddingInlineStart:oe.paddingXS},"\n &-placement-topRight,\n &-placement-topLeft\n ":{paddingBottom:oe.paddingXS},"\n &-placement-bottomRight,\n &-placement-bottomLeft\n ":{paddingTop:oe.paddingXS},[`> ${fe}`]:Object.assign(Object.assign(Object.assign({borderRadius:Cn},Dt(oe)),bn(oe)),{[`${fe}-item, ${fe}-submenu > ${fe}-submenu-title`]:{borderRadius:xt},[`${fe}-submenu-title::after`]:{transition:`transform ${Ie} ${Kt}`}})}}),bn(oe)),{[`&-inline-collapsed ${fe}-submenu-arrow,
|
|
|
&-inline ${fe}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${On})`},"&::after":{transform:`rotate(45deg) translateX(-${On})`}},[`${fe}-submenu-open${fe}-submenu-inline > ${fe}-submenu-title > ${fe}-submenu-arrow`]:{transform:`translateY(-${hn*.2}px)`,"&::after":{transform:`rotate(-45deg) translateX(-${On})`},"&::before":{transform:`rotate(45deg) translateX(${On})`}}})},{[`${de}-layout-header`]:{[fe]:{lineHeight:"inherit"}}}]};var un=(oe,de)=>(0,zt.Z)("Menu",le=>{if(de===!1)return[];const{colorBgElevated:Ie,colorPrimary:it,colorTextLightSolid:Kt,controlHeightLG:$t,fontSize:Jt,darkItemColor:qt,darkDangerItemColor:on,darkItemBg:mn,darkSubMenuItemBg:Cn,darkItemSelectedColor:xt,darkItemSelectedBg:hn,darkDangerItemSelectedBg:On,darkItemHoverBg:tt,darkGroupTitleColor:Fe,darkItemHoverColor:Ge,darkItemDisabledColor:Zt,darkDangerItemHoverColor:en,darkDangerItemSelectedColor:ln,darkDangerItemActiveBg:Dn}=le,Tn=Jt/7*5,En=(0,ct.TS)(le,{menuArrowSize:Tn,menuHorizontalHeight:$t*1.15,menuArrowOffset:`${Tn*.25}px`,menuPanelMaskInset:-7,menuSubMenuBg:Ie}),Fn=(0,ct.TS)(En,{itemColor:qt,itemHoverColor:Ge,groupTitleColor:Fe,itemSelectedColor:xt,itemBg:mn,popupBg:mn,subMenuItemBg:Cn,itemActiveBg:"transparent",itemSelectedBg:hn,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:tt,itemDisabledColor:Zt,dangerItemColor:on,dangerItemHoverColor:en,dangerItemSelectedColor:ln,dangerItemActiveBg:Dn,dangerItemSelectedBg:On,menuSubMenuBg:Cn,horizontalItemSelectedColor:Kt,horizontalItemSelectedBg:it});return[tn(En),Rt(En),Ye(En),nn(En,"light"),nn(Fn,"dark"),$e(En),(0,st.Z)(En),(0,Bt.oN)(En,"slide-up"),(0,Bt.oN)(En,"slide-down"),(0,Qe._y)(En,"zoom-big")]},le=>{const{colorPrimary:Ie,colorError:it,colorTextDisabled:Kt,colorErrorBg:$t,colorText:Jt,colorTextDescription:qt,colorBgContainer:on,colorFillAlter:mn,colorFillContent:Cn,lineWidth:xt,lineWidthBold:hn,controlItemBgActive:On,colorBgTextHover:tt,controlHeightLG:Fe,lineHeight:Ge,colorBgElevated:Zt,marginXXS:en,padding:ln,fontSize:Dn,controlHeightSM:Tn,fontSizeLG:En,colorTextLightSolid:Fn,colorErrorHover:jn}=le,An=new Ve.C(Fn).setAlpha(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:le.zIndexPopupBase+50,radiusItem:le.borderRadiusLG,itemBorderRadius:le.borderRadiusLG,radiusSubMenuItem:le.borderRadiusSM,subMenuItemBorderRadius:le.borderRadiusSM,colorItemText:Jt,itemColor:Jt,colorItemTextHover:Jt,itemHoverColor:Jt,colorItemTextHoverHorizontal:Ie,horizontalItemHoverColor:Ie,colorGroupTitle:qt,groupTitleColor:qt,colorItemTextSelected:Ie,itemSelectedColor:Ie,colorItemTextSelectedHorizontal:Ie,horizontalItemSelectedColor:Ie,colorItemBg:on,itemBg:on,colorItemBgHover:tt,itemHoverBg:tt,colorItemBgActive:Cn,itemActiveBg:On,colorSubItemBg:mn,subMenuItemBg:mn,colorItemBgSelected:On,itemSelectedBg:On,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:0,colorActiveBarHeight:hn,activeBarHeight:hn,colorActiveBarBorderSize:xt,activeBarBorderWidth:xt,colorItemTextDisabled:Kt,itemDisabledColor:Kt,colorDangerItemText:it,dangerItemColor:it,colorDangerItemTextHover:it,dangerItemHoverColor:it,colorDangerItemTextSelected:it,dangerItemSelectedColor:it,colorDangerItemBgActive:$t,dangerItemActiveBg:$t,colorDangerItemBgSelected:$t,dangerItemSelectedBg:$t,itemMarginInline:le.marginXXS,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:Fe,groupTitleLineHeight:Ge,collapsedWidth:Fe*2,popupBg:Zt,itemMarginBlock:en,itemPaddingInline:ln,horizontalLineHeight:`${Fe*1.15}px`,iconSize:Dn,iconMarginInlineEnd:Tn-Dn,collapsedIconSize:En,groupTitleFontSize:Dn,darkItemDisabledColor:new Ve.C(Fn).setAlpha(.25).toRgbString(),darkItemColor:An,darkDangerItemColor:it,darkItemBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:Fn,darkItemSelectedBg:Ie,darkDangerItemSelectedBg:it,darkItemHoverBg:"transparent",darkGroupTitleColor:An,darkItemHoverColor:Fn,darkDangerItemHoverColor:jn,darkDangerItemSelectedColor:Fn,darkDangerItemActiveBg:it}},{deprecatedTokens:[["colorGroupTitle","groupTitleColor"],["radiusItem","itemBorderRadius"],["radiusSubMenuItem","subMenuItemBorderRadius"],["colorItemText","itemColor"],["colorItemTextHover","itemHoverColor"],["colorItemTextHoverHorizontal","horizontalItemHoverColor"],["colorItemTextSelected","itemSelectedColor"],["colorItemTextSelectedHorizontal","horizontalItemSelectedColor"],["colorItemTextDisabled","itemDisabledColor"],["colorDangerItemText","dangerItemColor"],["colorDangerItemTextHover","dangerItemHoverColor"],["colorDangerItemTextSelected","dangerItemSelectedColor"],["colorDangerItemBgActive","dangerItemActiveBg"],["colorDangerItemBgSelected","dangerItemSelectedBg"],["colorItemBg","itemBg"],["colorItemBgHover","itemHoverBg"],["colorSubItemBg","subMenuItemBg"],["colorItemBgActive","itemActiveBg"],["colorItemBgSelectedHorizontal","horizontalItemSelectedBg"],["colorActiveBarWidth","activeBarWidth"],["colorActiveBarHeight","activeBarHeight"],["colorActiveBarBorderSize","activeBarBorderWidth"],["colorItemBgSelected","itemSelectedBg"]]})(oe),Vt=function(oe,de){var fe={};for(var le in oe)Object.prototype.hasOwnProperty.call(oe,le)&&de.indexOf(le)<0&&(fe[le]=oe[le]);if(oe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ie=0,le=Object.getOwnPropertySymbols(oe);Ie<le.length;Ie++)de.indexOf(le[Ie])<0&&Object.prototype.propertyIsEnumerable.call(oe,le[Ie])&&(fe[le[Ie]]=oe[le[Ie]]);return fe},Wt=(0,je.forwardRef)((oe,de)=>{var fe,le;const Ie=je.useContext(ke.Z),it=Ie||{},{getPrefixCls:Kt,getPopupContainer:$t,direction:Jt,menu:qt}=je.useContext(Ae.E_),on=Kt(),{prefixCls:mn,className:Cn,style:xt,theme:hn="light",expandIcon:On,_internalDisableMenuItemTitleTooltip:tt,inlineCollapsed:Fe,siderCollapsed:Ge,items:Zt,children:en,rootClassName:ln,mode:Dn,selectable:Tn,onClick:En,overflowedIndicatorPopupClassName:Fn}=oe,jn=Vt(oe,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","items","children","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),An=(0,ut.Z)(jn,["collapsedWidth"]),hr=bt(Zt)||en;(fe=it.validator)===null||fe===void 0||fe.call(it,{mode:Dn});const _r=(0,ft.useEvent)(function(){var Jn;En==null||En.apply(void 0,arguments),(Jn=it.onClick)===null||Jn===void 0||Jn.call(it)}),Tr=it.mode||Dn,Hr=Tn!=null?Tn:it.selectable,sr=je.useMemo(()=>Ge!==void 0?Ge:Fe,[Fe,Ge]),Mr={horizontal:{motionName:`${on}-slide-up`},inline:(0,Ze.Z)(on),other:{motionName:`${on}-zoom-big`}},rr=Kt("menu",mn||it.prefixCls),[Or,Fr]=un(rr,!Ie),Er=be()(`${rr}-${hn}`,qt==null?void 0:qt.className,Cn);let jr;if(typeof On=="function")jr=On;else if(On===null||On===!1)jr=null;else if(it.expandIcon===null||it.expandIcon===!1)jr=null;else{const Jn=On!=null?On:it.expandIcon;jr=(0,We.Tm)(Jn,{className:be()(`${rr}-submenu-expand-icon`,(0,We.l$)(Jn)?(le=Jn.props)===null||le===void 0?void 0:le.className:"")})}const Nr=je.useMemo(()=>({prefixCls:rr,inlineCollapsed:sr||!1,direction:Jt,firstLevel:!0,theme:hn,mode:Tr,disableMenuItemTitleTooltip:tt}),[rr,sr,Jt,tt,hn]);return Or(je.createElement(ke.Z.Provider,{value:null},je.createElement(et.Provider,{value:Nr},je.createElement(me.ZP,Object.assign({getPopupContainer:$t,overflowedIndicator:je.createElement(nt.Z,null),overflowedIndicatorPopupClassName:be()(rr,`${rr}-${hn}`,Fn),mode:Tr,selectable:Hr,onClick:_r},An,{inlineCollapsed:sr,style:Object.assign(Object.assign({},qt==null?void 0:qt.style),xt),className:Er,prefixCls:rr,direction:Jt,defaultMotions:Mr,expandIcon:jr,ref:de,rootClassName:be()(ln,Fr)}),hr))))});const ye=(0,je.forwardRef)((oe,de)=>{const fe=(0,je.useRef)(null),le=je.useContext(Ke.D);return(0,je.useImperativeHandle)(de,()=>({menu:fe.current,focus:Ie=>{var it;(it=fe.current)===null||it===void 0||it.focus(Ie)}})),je.createElement(Wt,Object.assign({ref:fe},oe,le))});ye.Item=at,ye.SubMenu=Qt,ye.Divider=Me,ye.ItemGroup=me.BW;var se=ye},93948:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return tt}});var me=ue(59301),je=ue(29679),Ke=ue(40001),ot=ue(19248),be=ue(99267),Ae=ue(92310),Ne=ue.n(Ae),Ce=ue(2738),Me=ue(36355),ze=ue(60499),ut=ue(85899),Le=ue(42244),We={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},yt=function(){var Ge=(0,me.useRef)([]),Zt=(0,me.useRef)(null);return(0,me.useEffect)(function(){var en=Date.now(),ln=!1;Ge.current.forEach(function(Dn){if(Dn){ln=!0;var Tn=Dn.style;Tn.transitionDuration=".3s, .3s, .3s, .06s",Zt.current&&en-Zt.current<100&&(Tn.transitionDuration="0s, 0s")}}),ln&&(Zt.current=Date.now())}),Ge.current},et=["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"],pt=function(Ge){var Zt=(0,ut.Z)((0,ut.Z)({},We),Ge),en=Zt.className,ln=Zt.percent,Dn=Zt.prefixCls,Tn=Zt.strokeColor,En=Zt.strokeLinecap,Fn=Zt.strokeWidth,jn=Zt.style,An=Zt.trailColor,hr=Zt.trailWidth,_r=Zt.transition,Tr=(0,Le.Z)(Zt,et);delete Tr.gapPosition;var Hr=Array.isArray(ln)?ln:[ln],sr=Array.isArray(Tn)?Tn:[Tn],Mr=yt(),rr=Fn/2,Or=100-Fn/2,Fr="M ".concat(En==="round"?rr:0,",").concat(rr,`
|
|
|
L `).concat(En==="round"?Or:100,",").concat(rr),Er="0 0 100 ".concat(Fn),jr=0;return me.createElement("svg",(0,ze.Z)({className:Ne()("".concat(Dn,"-line"),en),viewBox:Er,preserveAspectRatio:"none",style:jn},Tr),me.createElement("path",{className:"".concat(Dn,"-line-trail"),d:Fr,strokeLinecap:En,stroke:An,strokeWidth:hr||Fn,fillOpacity:"0"}),Hr.map(function(Nr,Jn){var lr=1;switch(En){case"round":lr=1-Fn/100;break;case"square":lr=1-Fn/2/100;break;default:lr=1;break}var Rn={strokeDasharray:"".concat(Nr*lr,"px, 100px"),strokeDashoffset:"-".concat(jr,"px"),transition:_r||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},$n=sr[Jn]||sr[sr.length-1];return jr+=Nr,me.createElement("path",{key:Jn,className:"".concat(Dn,"-line-path"),d:Fr,strokeLinecap:En,stroke:$n,strokeWidth:Fn,fillOpacity:"0",ref:function(lt){Mr[Jn]=lt},style:Rn})}))},at=pt,St=ue(43749),Qt=ue(72190),nt=ue(47273),ft=0,Ze=(0,nt.Z)();function ke(){var Fe;return Ze?(Fe=ft,ft+=1):Fe="TEST_OR_SSR",Fe}var He=function(Fe){var Ge=me.useState(),Zt=(0,Qt.Z)(Ge,2),en=Zt[0],ln=Zt[1];return me.useEffect(function(){ln("rc_progress_".concat(ke()))},[]),Fe||en},Ue=function(Ge){var Zt=Ge.bg,en=Ge.children;return me.createElement("div",{style:{width:"100%",height:"100%",background:Zt}},en)};function bt(Fe,Ge){return Object.keys(Fe).map(function(Zt){var en=parseFloat(Zt),ln="".concat(Math.floor(en*Ge),"%");return"".concat(Fe[Zt]," ").concat(ln)})}var Ve=me.forwardRef(function(Fe,Ge){var Zt=Fe.prefixCls,en=Fe.color,ln=Fe.gradientId,Dn=Fe.radius,Tn=Fe.style,En=Fe.ptg,Fn=Fe.strokeLinecap,jn=Fe.strokeWidth,An=Fe.size,hr=Fe.gapDegree,_r=en&&(0,St.Z)(en)==="object",Tr=_r?"#FFF":void 0,Hr=An/2,sr=me.createElement("circle",{className:"".concat(Zt,"-circle-path"),r:Dn,cx:Hr,cy:Hr,stroke:Tr,strokeLinecap:Fn,strokeWidth:jn,opacity:En===0?0:1,style:Tn,ref:Ge});if(!_r)return sr;var Mr="".concat(ln,"-conic"),rr=hr?"".concat(180+hr/2,"deg"):"0deg",Or=bt(en,(360-hr)/360),Fr=bt(en,1),Er="conic-gradient(from ".concat(rr,", ").concat(Or.join(", "),")"),jr="linear-gradient(to ".concat(hr?"bottom":"top",", ").concat(Fr.join(", "),")");return me.createElement(me.Fragment,null,me.createElement("mask",{id:Mr},sr),me.createElement("foreignObject",{x:0,y:0,width:An,height:An,mask:"url(#".concat(Mr,")")},me.createElement(Ue,{bg:jr},me.createElement(Ue,{bg:Er}))))}),jt=Ve,st=100,Bt=function(Ge,Zt,en,ln,Dn,Tn,En,Fn,jn,An){var hr=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,_r=en/100*360*((360-Tn)/360),Tr=Tn===0?0:{bottom:0,top:180,left:90,right:-90}[En],Hr=(100-ln)/100*Zt;jn==="round"&&ln!==100&&(Hr+=An/2,Hr>=Zt&&(Hr=Zt-.01));var sr=st/2;return{stroke:typeof Fn=="string"?Fn:void 0,strokeDasharray:"".concat(Zt,"px ").concat(Ge),strokeDashoffset:Hr+hr,transform:"rotate(".concat(Dn+_r+Tr,"deg)"),transformOrigin:"".concat(sr,"px ").concat(sr,"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}},Qe=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function zt(Fe){var Ge=Fe!=null?Fe:[];return Array.isArray(Ge)?Ge:[Ge]}var ct=function(Ge){var Zt=(0,ut.Z)((0,ut.Z)({},We),Ge),en=Zt.id,ln=Zt.prefixCls,Dn=Zt.steps,Tn=Zt.strokeWidth,En=Zt.trailWidth,Fn=Zt.gapDegree,jn=Fn===void 0?0:Fn,An=Zt.gapPosition,hr=Zt.trailColor,_r=Zt.strokeLinecap,Tr=Zt.style,Hr=Zt.className,sr=Zt.strokeColor,Mr=Zt.percent,rr=(0,Le.Z)(Zt,Qe),Or=st/2,Fr=He(en),Er="".concat(Fr,"-gradient"),jr=Or-Tn/2,Nr=Math.PI*2*jr,Jn=jn>0?90+jn/2:-90,lr=Nr*((360-jn)/360),Rn=(0,St.Z)(Dn)==="object"?Dn:{count:Dn,space:2},$n=Rn.count,wr=Rn.space,lt=zt(Mr),_e=zt(sr),Pe=_e.find(function(Yt){return Yt&&(0,St.Z)(Yt)==="object"}),De=Pe&&(0,St.Z)(Pe)==="object",Te=De?"butt":_r,qe=Bt(Nr,lr,0,100,Jn,jn,An,hr,Te,Tn),dt=yt(),Xt=function(){var pn=0;return lt.map(function(vn,Sn){var At=_e[Sn]||_e[_e.length-1],dn=Bt(Nr,lr,pn,vn,Jn,jn,An,At,Te,Tn);return pn+=vn,me.createElement(jt,{key:Sn,color:At,ptg:vn,radius:jr,prefixCls:ln,gradientId:Er,style:dn,strokeLinecap:Te,strokeWidth:Tn,gapDegree:jn,ref:function(Mt){dt[Sn]=Mt},size:st})}).reverse()},Ot=function(){var pn=Math.round($n*(lt[0]/100)),vn=100/$n,Sn=0;return new Array($n).fill(null).map(function(At,dn){var rt=dn<=pn-1?_e[0]:hr,Mt=rt&&(0,St.Z)(rt)==="object"?"url(#".concat(Er,")"):void 0,Lt=Bt(Nr,lr,Sn,vn,Jn,jn,An,rt,"butt",Tn,wr);return Sn+=(lr-Lt.strokeDashoffset+wr)*100/lr,me.createElement("circle",{key:dn,className:"".concat(ln,"-circle-path"),r:jr,cx:Or,cy:Or,stroke:Mt,strokeWidth:Tn,opacity:1,style:Lt,ref:function(an){dt[dn]=an}})})};return me.createElement("svg",(0,ze.Z)({className:Ne()("".concat(ln,"-circle"),Hr),viewBox:"0 0 ".concat(st," ").concat(st),style:Tr,id:en,role:"presentation"},rr),!$n&&me.createElement("circle",{className:"".concat(ln,"-circle-trail"),r:jr,cx:Or,cy:Or,stroke:hr,strokeLinecap:Te,strokeWidth:En||Tn,style:qe}),$n?Ot():Xt())},It=ct,Rt={Line:at,Circle:It},mt=ue(6848),$e=ue(30071);function xe(Fe){return!Fe||Fe<0?0:Fe>100?100:Fe}function ht(Fe){let{success:Ge,successPercent:Zt}=Fe,en=Zt;return Ge&&"progress"in Ge&&(en=Ge.progress),Ge&&"percent"in Ge&&(en=Ge.percent),en}const nn=Fe=>{let{percent:Ge,success:Zt,successPercent:en}=Fe;const ln=xe(ht({success:Zt,successPercent:en}));return[ln,xe(xe(Ge)-ln)]},Ut=Fe=>{let{success:Ge={},strokeColor:Zt}=Fe;const{strokeColor:en}=Ge;return[en||$e.presetPrimaryColors.green,Zt||null]},Xe=(Fe,Ge,Zt)=>{var en,ln,Dn,Tn;let En=-1,Fn=-1;if(Ge==="step"){const jn=Zt.steps,An=Zt.strokeWidth;typeof Fe=="string"||typeof Fe=="undefined"?(En=Fe==="small"?2:14,Fn=An!=null?An:8):typeof Fe=="number"?[En,Fn]=[Fe,Fe]:[En=14,Fn=8]=Fe,En*=jn}else if(Ge==="line"){const jn=Zt==null?void 0:Zt.strokeWidth;typeof Fe=="string"||typeof Fe=="undefined"?Fn=jn||(Fe==="small"?6:8):typeof Fe=="number"?[En,Fn]=[Fe,Fe]:[En=-1,Fn=8]=Fe}else(Ge==="circle"||Ge==="dashboard")&&(typeof Fe=="string"||typeof Fe=="undefined"?[En,Fn]=Fe==="small"?[60,60]:[120,120]:typeof Fe=="number"?[En,Fn]=[Fe,Fe]:(En=(ln=(en=Fe[0])!==null&&en!==void 0?en:Fe[1])!==null&&ln!==void 0?ln:120,Fn=(Tn=(Dn=Fe[0])!==null&&Dn!==void 0?Dn:Fe[1])!==null&&Tn!==void 0?Tn:120));return[En,Fn]},Ye=3,Dt=Fe=>Ye/Fe*100;var tn=Fe=>{const{prefixCls:Ge,trailColor:Zt=null,strokeLinecap:en="round",gapPosition:ln,gapDegree:Dn,width:Tn=120,type:En,children:Fn,success:jn,size:An=Tn}=Fe,[hr,_r]=Xe(An,"circle");let{strokeWidth:Tr}=Fe;Tr===void 0&&(Tr=Math.max(Dt(hr),6));const Hr={width:hr,height:_r,fontSize:hr*.15+6},sr=me.useMemo(()=>{if(Dn||Dn===0)return Dn;if(En==="dashboard")return 75},[Dn,En]),Mr=ln||En==="dashboard"&&"bottom"||void 0,rr=Object.prototype.toString.call(Fe.strokeColor)==="[object Object]",Or=Ut({success:jn,strokeColor:Fe.strokeColor}),Fr=Ne()(`${Ge}-inner`,{[`${Ge}-circle-gradient`]:rr}),Er=me.createElement(It,{percent:nn(Fe),strokeWidth:Tr,trailWidth:Tr,strokeColor:Or,strokeLinecap:en,trailColor:Zt,prefixCls:Ge,gapDegree:sr,gapPosition:Mr});return me.createElement("div",{className:Fr,style:Hr},hr<=20?me.createElement(mt.Z,{title:Fn},me.createElement("span",null,Er)):me.createElement(me.Fragment,null,Er,Fn))},un=function(Fe,Ge){var Zt={};for(var en in Fe)Object.prototype.hasOwnProperty.call(Fe,en)&&Ge.indexOf(en)<0&&(Zt[en]=Fe[en]);if(Fe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ln=0,en=Object.getOwnPropertySymbols(Fe);ln<en.length;ln++)Ge.indexOf(en[ln])<0&&Object.prototype.propertyIsEnumerable.call(Fe,en[ln])&&(Zt[en[ln]]=Fe[en[ln]]);return Zt};const Vt=Fe=>{let Ge=[];return Object.keys(Fe).forEach(Zt=>{const en=parseFloat(Zt.replace(/%/g,""));isNaN(en)||Ge.push({key:en,value:Fe[Zt]})}),Ge=Ge.sort((Zt,en)=>Zt.key-en.key),Ge.map(Zt=>{let{key:en,value:ln}=Zt;return`${ln} ${en}%`}).join(", ")},Gt=(Fe,Ge)=>{const{from:Zt=$e.presetPrimaryColors.blue,to:en=$e.presetPrimaryColors.blue,direction:ln=Ge==="rtl"?"to left":"to right"}=Fe,Dn=un(Fe,["from","to","direction"]);if(Object.keys(Dn).length!==0){const Tn=Vt(Dn);return{backgroundImage:`linear-gradient(${ln}, ${Tn})`}}return{backgroundImage:`linear-gradient(${ln}, ${Zt}, ${en})`}};var ye=Fe=>{const{prefixCls:Ge,direction:Zt,percent:en,size:ln,strokeWidth:Dn,strokeColor:Tn,strokeLinecap:En="round",children:Fn,trailColor:jn=null,success:An}=Fe,hr=Tn&&typeof Tn!="string"?Gt(Tn,Zt):{backgroundColor:Tn},_r=En==="square"||En==="butt"?0:void 0,Tr={backgroundColor:jn||void 0,borderRadius:_r},Hr=ln!=null?ln:[-1,Dn||(ln==="small"?6:8)],[sr,Mr]=Xe(Hr,"line",{strokeWidth:Dn}),rr=Object.assign({width:`${xe(en)}%`,height:Mr,borderRadius:_r},hr),Or=ht(Fe),Fr={width:`${xe(Or)}%`,height:Mr,borderRadius:_r,backgroundColor:An==null?void 0:An.strokeColor},Er={width:sr<0?"100%":sr,height:Mr};return me.createElement(me.Fragment,null,me.createElement("div",{className:`${Ge}-outer`,style:Er},me.createElement("div",{className:`${Ge}-inner`,style:Tr},me.createElement("div",{className:`${Ge}-bg`,style:rr}),Or!==void 0?me.createElement("div",{className:`${Ge}-success-bg`,style:Fr}):null)),Fn)},oe=Fe=>{const{size:Ge,steps:Zt,percent:en=0,strokeWidth:ln=8,strokeColor:Dn,trailColor:Tn=null,prefixCls:En,children:Fn}=Fe,jn=Math.round(Zt*(en/100)),An=Ge==="small"?2:14,hr=Ge!=null?Ge:[An,ln],[_r,Tr]=Xe(hr,"step",{steps:Zt,strokeWidth:ln}),Hr=_r/Zt,sr=new Array(Zt);for(let Mr=0;Mr<Zt;Mr++){const rr=Array.isArray(Dn)?Dn[Mr]:Dn;sr[Mr]=me.createElement("div",{key:Mr,className:Ne()(`${En}-steps-item`,{[`${En}-steps-item-active`]:Mr<=jn-1}),style:{backgroundColor:Mr<=jn-1?rr:Tn,width:Hr,height:Tr}})}return me.createElement("div",{className:`${En}-steps-outer`},sr,Fn)},de=ue(36237),fe=ue(17313),le=ue(83116),Ie=ue(37613);const it=Fe=>{const Ge=Fe?"100%":"-100%";return new de.Keyframes(`antProgress${Fe?"RTL":"LTR"}Active`,{"0%":{transform:`translateX(${Ge}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${Ge}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},Kt=Fe=>{const{componentCls:Ge,iconCls:Zt}=Fe;return{[Ge]:Object.assign(Object.assign({},(0,fe.Wf)(Fe)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:Fe.fontSize,marginInlineEnd:Fe.marginXS,marginBottom:Fe.marginXS},[`${Ge}-outer`]:{display:"inline-block",width:"100%"},[`&${Ge}-show-info`]:{[`${Ge}-outer`]:{marginInlineEnd:`calc(-2em - ${Fe.marginXS}px)`,paddingInlineEnd:`calc(2em + ${Fe.paddingXS}px)`}},[`${Ge}-inner`]:{position:"relative",display:"inline-block",width:"100%",overflow:"hidden",verticalAlign:"middle",backgroundColor:Fe.remainingColor,borderRadius:Fe.lineBorderRadius},[`${Ge}-inner:not(${Ge}-circle-gradient)`]:{[`${Ge}-circle-path`]:{stroke:Fe.defaultColor}},[`${Ge}-success-bg, ${Ge}-bg`]:{position:"relative",backgroundColor:Fe.defaultColor,borderRadius:Fe.lineBorderRadius,transition:`all ${Fe.motionDurationSlow} ${Fe.motionEaseInOutCirc}`},[`${Ge}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:Fe.colorSuccess},[`${Ge}-text`]:{display:"inline-block",width:"2em",marginInlineStart:Fe.marginXS,color:Fe.colorText,lineHeight:1,whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[Zt]:{fontSize:Fe.fontSize}},[`&${Ge}-status-active`]:{[`${Ge}-bg::before`]:{position:"absolute",inset:0,backgroundColor:Fe.colorBgContainer,borderRadius:Fe.lineBorderRadius,opacity:0,animationName:it(),animationDuration:Fe.progressActiveMotionDuration,animationTimingFunction:Fe.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${Ge}-rtl${Ge}-status-active`]:{[`${Ge}-bg::before`]:{animationName:it(!0)}},[`&${Ge}-status-exception`]:{[`${Ge}-bg`]:{backgroundColor:Fe.colorError},[`${Ge}-text`]:{color:Fe.colorError}},[`&${Ge}-status-exception ${Ge}-inner:not(${Ge}-circle-gradient)`]:{[`${Ge}-circle-path`]:{stroke:Fe.colorError}},[`&${Ge}-status-success`]:{[`${Ge}-bg`]:{backgroundColor:Fe.colorSuccess},[`${Ge}-text`]:{color:Fe.colorSuccess}},[`&${Ge}-status-success ${Ge}-inner:not(${Ge}-circle-gradient)`]:{[`${Ge}-circle-path`]:{stroke:Fe.colorSuccess}}})}},$t=Fe=>{const{componentCls:Ge,iconCls:Zt}=Fe;return{[Ge]:{[`${Ge}-circle-trail`]:{stroke:Fe.remainingColor},[`&${Ge}-circle ${Ge}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${Ge}-circle ${Ge}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:Fe.circleTextColor,fontSize:Fe.circleTextFontSize,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[Zt]:{fontSize:`${Fe.fontSize/Fe.fontSizeSM}em`}},[`${Ge}-circle&-status-exception`]:{[`${Ge}-text`]:{color:Fe.colorError}},[`${Ge}-circle&-status-success`]:{[`${Ge}-text`]:{color:Fe.colorSuccess}}},[`${Ge}-inline-circle`]:{lineHeight:1,[`${Ge}-inner`]:{verticalAlign:"bottom"}}}},Jt=Fe=>{const{componentCls:Ge}=Fe;return{[Ge]:{[`${Ge}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:Fe.progressStepMinWidth,marginInlineEnd:Fe.progressStepMarginInlineEnd,backgroundColor:Fe.remainingColor,transition:`all ${Fe.motionDurationSlow}`,"&-active":{backgroundColor:Fe.defaultColor}}}}}},qt=Fe=>{const{componentCls:Ge,iconCls:Zt}=Fe;return{[Ge]:{[`${Ge}-small&-line, ${Ge}-small&-line ${Ge}-text ${Zt}`]:{fontSize:Fe.fontSizeSM}}}};var on=(0,le.Z)("Progress",Fe=>{const Ge=Fe.marginXXS/2,Zt=(0,Ie.TS)(Fe,{progressStepMarginInlineEnd:Ge,progressStepMinWidth:Ge,progressActiveMotionDuration:"2.4s"});return[Kt(Zt),$t(Zt),Jt(Zt),qt(Zt)]},Fe=>({circleTextColor:Fe.colorText,defaultColor:Fe.colorInfo,remainingColor:Fe.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em"})),mn=function(Fe,Ge){var Zt={};for(var en in Fe)Object.prototype.hasOwnProperty.call(Fe,en)&&Ge.indexOf(en)<0&&(Zt[en]=Fe[en]);if(Fe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ln=0,en=Object.getOwnPropertySymbols(Fe);ln<en.length;ln++)Ge.indexOf(en[ln])<0&&Object.prototype.propertyIsEnumerable.call(Fe,en[ln])&&(Zt[en[ln]]=Fe[en[ln]]);return Zt};const Cn=null,xt=["normal","exception","active","success"];var On=me.forwardRef((Fe,Ge)=>{const{prefixCls:Zt,className:en,rootClassName:ln,steps:Dn,strokeColor:Tn,percent:En=0,size:Fn="default",showInfo:jn=!0,type:An="line",status:hr,format:_r,style:Tr}=Fe,Hr=mn(Fe,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style"]),sr=me.useMemo(()=>{var lt,_e;const Pe=ht(Fe);return parseInt(Pe!==void 0?(lt=Pe!=null?Pe:0)===null||lt===void 0?void 0:lt.toString():(_e=En!=null?En:0)===null||_e===void 0?void 0:_e.toString(),10)},[En,Fe.success,Fe.successPercent]),Mr=me.useMemo(()=>!xt.includes(hr)&&sr>=100?"success":hr||"normal",[hr,sr]),{getPrefixCls:rr,direction:Or,progress:Fr}=me.useContext(Me.E_),Er=rr("progress",Zt),[jr,Nr]=on(Er),Jn=me.useMemo(()=>{if(!jn)return null;const lt=ht(Fe);let _e;const Pe=_r||(Te=>`${Te}%`),De=An==="line";return _r||Mr!=="exception"&&Mr!=="success"?_e=Pe(xe(En),xe(lt)):Mr==="exception"?_e=De?me.createElement(ot.Z,null):me.createElement(be.Z,null):Mr==="success"&&(_e=De?me.createElement(je.Z,null):me.createElement(Ke.Z,null)),me.createElement("span",{className:`${Er}-text`,title:typeof _e=="string"?_e:void 0},_e)},[jn,En,sr,Mr,An,Er,_r]),lr=Array.isArray(Tn)?Tn[0]:Tn,Rn=typeof Tn=="string"||Array.isArray(Tn)?Tn:void 0;let $n;An==="line"?$n=Dn?me.createElement(oe,Object.assign({},Fe,{strokeColor:Rn,prefixCls:Er,steps:Dn}),Jn):me.createElement(ye,Object.assign({},Fe,{strokeColor:lr,prefixCls:Er,direction:Or}),Jn):(An==="circle"||An==="dashboard")&&($n=me.createElement(tn,Object.assign({},Fe,{strokeColor:lr,prefixCls:Er,progressStatus:Mr}),Jn));const wr=Ne()(Er,`${Er}-status-${Mr}`,`${Er}-${An==="dashboard"&&"circle"||Dn&&"steps"||An}`,{[`${Er}-inline-circle`]:An==="circle"&&Xe(Fn,"circle")[0]<=20,[`${Er}-show-info`]:jn,[`${Er}-${Fn}`]:typeof Fn=="string",[`${Er}-rtl`]:Or==="rtl"},Fr==null?void 0:Fr.className,en,ln,Nr);return jr(me.createElement("div",Object.assign({ref:Ge,style:Object.assign(Object.assign({},Fr==null?void 0:Fr.style),Tr),className:wr,role:"progressbar","aria-valuenow":sr},(0,Ce.Z)(Hr,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),$n))}),tt=On},5112:function(kn,cn,ue){"use strict";ue.d(cn,{ZP:function(){return $e}});var me=ue(92310),je=ue.n(me),Ke=ue(18929),ot=ue(26112),be=ue(59301),Ae=ue(36355),Ne=ue(19716);const Ce=be.createContext(null),Me=Ce.Provider;var ze=Ce;const ut=be.createContext(null),Le=ut.Provider;var We=ue(5630),yt=ue(8654),et=ue(1684),pt=ue(32441),at=ue(17313),St=ue(83116),Qt=ue(37613);const nt=xe=>{const{componentCls:ht,antCls:nn}=xe,Ut=`${ht}-group`;return{[Ut]:Object.assign(Object.assign({},(0,at.Wf)(xe)),{display:"inline-block",fontSize:0,[`&${Ut}-rtl`]:{direction:"rtl"},[`${nn}-badge ${nn}-badge-count`]:{zIndex:1},[`> ${nn}-badge:not(:first-child) > ${nn}-button-wrapper`]:{borderInlineStart:"none"}})}},ft=xe=>{const{componentCls:ht,wrapperMarginInlineEnd:nn,colorPrimary:Ut,radioSize:Xe,motionDurationSlow:Ye,motionDurationMid:Dt,motionEaseInOutCirc:bn,colorBgContainer:tn,colorBorder:un,lineWidth:Vt,dotSize:Gt,colorBgContainerDisabled:Wt,colorTextDisabled:ye,paddingXS:se,dotColorDisabled:oe,lineType:de,radioDotDisabledSize:fe,wireframe:le,colorWhite:Ie}=xe,it=`${ht}-inner`;return{[`${ht}-wrapper`]:Object.assign(Object.assign({},(0,at.Wf)(xe)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:nn,cursor:"pointer",[`&${ht}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:xe.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${ht}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${Vt}px ${de} ${Ut}`,borderRadius:"50%",visibility:"hidden",content:'""'},[ht]:Object.assign(Object.assign({},(0,at.Wf)(xe)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${ht}-wrapper:hover &,
|
|
|
&:hover ${it}`]:{borderColor:Ut},[`${ht}-input:focus-visible + ${it}`]:Object.assign({},(0,at.oN)(xe)),[`${ht}:hover::after, ${ht}-wrapper:hover &::after`]:{visibility:"visible"},[`${ht}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:Xe,height:Xe,marginBlockStart:Xe/-2,marginInlineStart:Xe/-2,backgroundColor:le?Ut:Ie,borderBlockStart:0,borderInlineStart:0,borderRadius:Xe,transform:"scale(0)",opacity:0,transition:`all ${Ye} ${bn}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:Xe,height:Xe,backgroundColor:tn,borderColor:un,borderStyle:"solid",borderWidth:Vt,borderRadius:"50%",transition:`all ${Dt}`},[`${ht}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${ht}-checked`]:{[it]:{borderColor:Ut,backgroundColor:le?tn:Ut,"&::after":{transform:`scale(${Gt/Xe})`,opacity:1,transition:`all ${Ye} ${bn}`}}},[`${ht}-disabled`]:{cursor:"not-allowed",[it]:{backgroundColor:Wt,borderColor:un,cursor:"not-allowed","&::after":{backgroundColor:oe}},[`${ht}-input`]:{cursor:"not-allowed"},[`${ht}-disabled + span`]:{color:ye,cursor:"not-allowed"},[`&${ht}-checked`]:{[it]:{"&::after":{transform:`scale(${fe/Xe})`}}}},[`span${ht} + *`]:{paddingInlineStart:se,paddingInlineEnd:se}})}},Ze=xe=>{const{buttonColor:ht,controlHeight:nn,componentCls:Ut,lineWidth:Xe,lineType:Ye,colorBorder:Dt,motionDurationSlow:bn,motionDurationMid:tn,buttonPaddingInline:un,fontSize:Vt,buttonBg:Gt,fontSizeLG:Wt,controlHeightLG:ye,controlHeightSM:se,paddingXS:oe,borderRadius:de,borderRadiusSM:fe,borderRadiusLG:le,buttonCheckedBg:Ie,buttonSolidCheckedColor:it,colorTextDisabled:Kt,colorBgContainerDisabled:$t,buttonCheckedBgDisabled:Jt,buttonCheckedColorDisabled:qt,colorPrimary:on,colorPrimaryHover:mn,colorPrimaryActive:Cn,buttonSolidCheckedBg:xt,buttonSolidCheckedHoverBg:hn,buttonSolidCheckedActiveBg:On}=xe;return{[`${Ut}-button-wrapper`]:{position:"relative",display:"inline-block",height:nn,margin:0,paddingInline:un,paddingBlock:0,color:ht,fontSize:Vt,lineHeight:`${nn-Xe*2}px`,background:Gt,border:`${Xe}px ${Ye} ${Dt}`,borderBlockStartWidth:Xe+.02,borderInlineStartWidth:0,borderInlineEndWidth:Xe,cursor:"pointer",transition:[`color ${tn}`,`background ${tn}`,`box-shadow ${tn}`].join(","),a:{color:ht},[`> ${Ut}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:-Xe,insetInlineStart:-Xe,display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:Xe,paddingInline:0,backgroundColor:Dt,transition:`background-color ${bn}`,content:'""'}},"&:first-child":{borderInlineStart:`${Xe}px ${Ye} ${Dt}`,borderStartStartRadius:de,borderEndStartRadius:de},"&:last-child":{borderStartEndRadius:de,borderEndEndRadius:de},"&:first-child:last-child":{borderRadius:de},[`${Ut}-group-large &`]:{height:ye,fontSize:Wt,lineHeight:`${ye-Xe*2}px`,"&:first-child":{borderStartStartRadius:le,borderEndStartRadius:le},"&:last-child":{borderStartEndRadius:le,borderEndEndRadius:le}},[`${Ut}-group-small &`]:{height:se,paddingInline:oe-Xe,paddingBlock:0,lineHeight:`${se-Xe*2}px`,"&:first-child":{borderStartStartRadius:fe,borderEndStartRadius:fe},"&:last-child":{borderStartEndRadius:fe,borderEndEndRadius:fe}},"&:hover":{position:"relative",color:on},"&:has(:focus-visible)":Object.assign({},(0,at.oN)(xe)),[`${Ut}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${Ut}-button-wrapper-disabled)`]:{zIndex:1,color:on,background:Ie,borderColor:on,"&::before":{backgroundColor:on},"&:first-child":{borderColor:on},"&:hover":{color:mn,borderColor:mn,"&::before":{backgroundColor:mn}},"&:active":{color:Cn,borderColor:Cn,"&::before":{backgroundColor:Cn}}},[`${Ut}-group-solid &-checked:not(${Ut}-button-wrapper-disabled)`]:{color:it,background:xt,borderColor:xt,"&:hover":{color:it,background:hn,borderColor:hn},"&:active":{color:it,background:On,borderColor:On}},"&-disabled":{color:Kt,backgroundColor:$t,borderColor:Dt,cursor:"not-allowed","&:first-child, &:hover":{color:Kt,backgroundColor:$t,borderColor:Dt}},[`&-disabled${Ut}-button-wrapper-checked`]:{color:qt,backgroundColor:Jt,borderColor:Dt,boxShadow:"none"}}}},ke=xe=>xe-4*2;var He=(0,St.Z)("Radio",xe=>{const{controlOutline:ht,controlOutlineWidth:nn,radioSize:Ut}=xe,Xe=`0 0 0 ${nn}px ${ht}`,Ye=Xe,Dt=ke(Ut),bn=(0,Qt.TS)(xe,{radioDotDisabledSize:Dt,radioFocusShadow:Xe,radioButtonFocusShadow:Ye});return[nt(bn),ft(bn),Ze(bn)]},xe=>{const{wireframe:ht,padding:nn,marginXS:Ut,lineWidth:Xe,fontSizeLG:Ye,colorText:Dt,colorBgContainer:bn,colorTextDisabled:tn,controlItemBgActiveDisabled:un,colorTextLightSolid:Vt,colorPrimary:Gt,colorPrimaryHover:Wt,colorPrimaryActive:ye}=xe,se=4,oe=Ye,de=ht?ke(oe):oe-(se+Xe)*2;return{radioSize:oe,dotSize:de,dotColorDisabled:tn,buttonSolidCheckedColor:Vt,buttonSolidCheckedBg:Gt,buttonSolidCheckedHoverBg:Wt,buttonSolidCheckedActiveBg:ye,buttonBg:bn,buttonCheckedBg:bn,buttonColor:Dt,buttonCheckedBgDisabled:un,buttonCheckedColorDisabled:tn,buttonPaddingInline:nn-Xe,wrapperMarginInlineEnd:Ut}}),Ue=ue(14088),bt=ue(4572),Ve=function(xe,ht){var nn={};for(var Ut in xe)Object.prototype.hasOwnProperty.call(xe,Ut)&&ht.indexOf(Ut)<0&&(nn[Ut]=xe[Ut]);if(xe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Xe=0,Ut=Object.getOwnPropertySymbols(xe);Xe<Ut.length;Xe++)ht.indexOf(Ut[Xe])<0&&Object.prototype.propertyIsEnumerable.call(xe,Ut[Xe])&&(nn[Ut[Xe]]=xe[Ut[Xe]]);return nn};const jt=(xe,ht)=>{var nn,Ut;const Xe=be.useContext(ze),Ye=be.useContext(ut),{getPrefixCls:Dt,direction:bn,radio:tn}=be.useContext(Ae.E_),un=be.useRef(null),Vt=(0,yt.sQ)(ht,un),{isFormItemInput:Gt}=be.useContext(pt.aM),Wt=Cn=>{var xt,hn;(xt=xe.onChange)===null||xt===void 0||xt.call(xe,Cn),(hn=Xe==null?void 0:Xe.onChange)===null||hn===void 0||hn.call(Xe,Cn)},{prefixCls:ye,className:se,rootClassName:oe,children:de,style:fe}=xe,le=Ve(xe,["prefixCls","className","rootClassName","children","style"]),Ie=Dt("radio",ye),it=((Xe==null?void 0:Xe.optionType)||Ye)==="button",Kt=it?`${Ie}-button`:Ie,[$t,Jt]=He(Ie),qt=Object.assign({},le),on=be.useContext(et.Z);Xe&&(qt.name=Xe.name,qt.onChange=Wt,qt.checked=xe.value===Xe.value,qt.disabled=(nn=qt.disabled)!==null&&nn!==void 0?nn:Xe.disabled),qt.disabled=(Ut=qt.disabled)!==null&&Ut!==void 0?Ut:on;const mn=je()(`${Kt}-wrapper`,{[`${Kt}-wrapper-checked`]:qt.checked,[`${Kt}-wrapper-disabled`]:qt.disabled,[`${Kt}-wrapper-rtl`]:bn==="rtl",[`${Kt}-wrapper-in-form-item`]:Gt},tn==null?void 0:tn.className,se,oe,Jt);return $t(be.createElement(Ue.Z,{component:"Radio",disabled:qt.disabled},be.createElement("label",{className:mn,style:Object.assign(Object.assign({},tn==null?void 0:tn.style),fe),onMouseEnter:xe.onMouseEnter,onMouseLeave:xe.onMouseLeave},be.createElement(We.Z,Object.assign({},qt,{className:je()(qt.className,!it&&bt.A),type:"radio",prefixCls:Kt,ref:Vt})),de!==void 0?be.createElement("span",null,de):null)))};var Bt=be.forwardRef(jt);const Qe=be.forwardRef((xe,ht)=>{const{getPrefixCls:nn,direction:Ut}=be.useContext(Ae.E_),[Xe,Ye]=(0,Ke.Z)(xe.defaultValue,{value:xe.value}),Dt=xt=>{const hn=Xe,On=xt.target.value;"value"in xe||Ye(On);const{onChange:tt}=xe;tt&&On!==hn&&tt(xt)},{prefixCls:bn,className:tn,rootClassName:un,options:Vt,buttonStyle:Gt="outline",disabled:Wt,children:ye,size:se,style:oe,id:de,onMouseEnter:fe,onMouseLeave:le,onFocus:Ie,onBlur:it}=xe,Kt=nn("radio",bn),$t=`${Kt}-group`,[Jt,qt]=He(Kt);let on=ye;Vt&&Vt.length>0&&(on=Vt.map(xt=>typeof xt=="string"||typeof xt=="number"?be.createElement(Bt,{key:xt.toString(),prefixCls:Kt,disabled:Wt,value:xt,checked:Xe===xt},xt):be.createElement(Bt,{key:`radio-group-value-options-${xt.value}`,prefixCls:Kt,disabled:xt.disabled||Wt,value:xt.value,checked:Xe===xt.value,title:xt.title,style:xt.style},xt.label)));const mn=(0,Ne.Z)(se),Cn=je()($t,`${$t}-${Gt}`,{[`${$t}-${mn}`]:mn,[`${$t}-rtl`]:Ut==="rtl"},tn,un,qt);return Jt(be.createElement("div",Object.assign({},(0,ot.Z)(xe,{aria:!0,data:!0}),{className:Cn,style:oe,onMouseEnter:fe,onMouseLeave:le,onFocus:Ie,onBlur:it,id:de,ref:ht}),be.createElement(Me,{value:{onChange:Dt,value:Xe,disabled:xe.disabled,name:xe.name,optionType:xe.optionType}},on)))});var zt=be.memo(Qe),ct=function(xe,ht){var nn={};for(var Ut in xe)Object.prototype.hasOwnProperty.call(xe,Ut)&&ht.indexOf(Ut)<0&&(nn[Ut]=xe[Ut]);if(xe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Xe=0,Ut=Object.getOwnPropertySymbols(xe);Xe<Ut.length;Xe++)ht.indexOf(Ut[Xe])<0&&Object.prototype.propertyIsEnumerable.call(xe,Ut[Xe])&&(nn[Ut[Xe]]=xe[Ut[Xe]]);return nn};const It=(xe,ht)=>{const{getPrefixCls:nn}=be.useContext(Ae.E_),{prefixCls:Ut}=xe,Xe=ct(xe,["prefixCls"]),Ye=nn("radio",Ut);return be.createElement(Le,{value:"button"},be.createElement(Bt,Object.assign({prefixCls:Ye},Xe,{type:"radio",ref:ht})))};var Rt=be.forwardRef(It);const mt=Bt;mt.Button=Rt,mt.Group=zt,mt.__ANT_RADIO=!0;var $e=mt},57809:function(kn,cn,ue){"use strict";var me=ue(92310),je=ue.n(me),Ke=ue(77861),ot=ue(2738),be=ue(59301),Ae=ue(53487),Ne=ue(62892),Ce=ue(19080),Me=ue(36355),ze=ue(1684),ut=ue(93891),Le=ue(19716),We=ue(32441),yt=ue(33234),et=ue(14154),pt=ue(58582),at=ue(84443),St=ue(66339),Qt=function(He,Ue){var bt={};for(var Ve in He)Object.prototype.hasOwnProperty.call(He,Ve)&&Ue.indexOf(Ve)<0&&(bt[Ve]=He[Ve]);if(He!=null&&typeof Object.getOwnPropertySymbols=="function")for(var jt=0,Ve=Object.getOwnPropertySymbols(He);jt<Ve.length;jt++)Ue.indexOf(Ve[jt])<0&&Object.prototype.propertyIsEnumerable.call(He,Ve[jt])&&(bt[Ve[jt]]=He[Ve[jt]]);return bt};const nt="SECRET_COMBOBOX_MODE_DO_NOT_USE",ft=(He,Ue)=>{var bt,{prefixCls:Ve,bordered:jt=!0,className:st,rootClassName:Bt,getPopupContainer:Qe,popupClassName:zt,dropdownClassName:ct,listHeight:It=256,placement:Rt,listItemHeight:mt=24,size:$e,disabled:xe,notFoundContent:ht,status:nn,builtinPlacements:Ut,dropdownMatchSelectWidth:Xe,popupMatchSelectWidth:Ye,direction:Dt,style:bn,allowClear:tn}=He,un=Qt(He,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:Vt,getPrefixCls:Gt,renderEmpty:Wt,direction:ye,virtual:se,popupMatchSelectWidth:oe,popupOverflow:de,select:fe}=be.useContext(Me.E_),le=Gt("select",Ve),Ie=Gt(),it=Dt!=null?Dt:ye,{compactSize:Kt,compactItemClassnames:$t}=(0,yt.ri)(le,it),[Jt,qt]=(0,et.Z)(le),on=be.useMemo(()=>{const{mode:Mr}=un;if(Mr!=="combobox")return Mr===nt?"combobox":Mr},[un.mode]),mn=on==="multiple"||on==="tags",Cn=(0,at.Z)(un.suffixIcon,un.showArrow),xt=(bt=Ye!=null?Ye:Xe)!==null&&bt!==void 0?bt:oe,{status:hn,hasFeedback:On,isFormItemInput:tt,feedbackIcon:Fe}=be.useContext(We.aM),Ge=(0,Ce.F)(hn,nn);let Zt;ht!==void 0?Zt=ht:on==="combobox"?Zt=null:Zt=(Wt==null?void 0:Wt("Select"))||be.createElement(ut.Z,{componentName:"Select"});const{suffixIcon:en,itemIcon:ln,removeIcon:Dn,clearIcon:Tn}=(0,St.Z)(Object.assign(Object.assign({},un),{multiple:mn,hasFeedback:On,feedbackIcon:Fe,showSuffixIcon:Cn,prefixCls:le,showArrow:un.showArrow,componentName:"Select"})),En=tn===!0?{clearIcon:Tn}:tn,Fn=(0,ot.Z)(un,["suffixIcon","itemIcon"]),jn=je()(zt||ct,{[`${le}-dropdown-${it}`]:it==="rtl"},Bt,qt),An=(0,Le.Z)(Mr=>{var rr;return(rr=$e!=null?$e:Kt)!==null&&rr!==void 0?rr:Mr}),hr=be.useContext(ze.Z),_r=xe!=null?xe:hr,Tr=je()({[`${le}-lg`]:An==="large",[`${le}-sm`]:An==="small",[`${le}-rtl`]:it==="rtl",[`${le}-borderless`]:!jt,[`${le}-in-form-item`]:tt},(0,Ce.Z)(le,Ge,On),$t,fe==null?void 0:fe.className,st,Bt,qt),Hr=be.useMemo(()=>Rt!==void 0?Rt:it==="rtl"?"bottomRight":"bottomLeft",[Rt,it]),sr=(0,pt.Z)(Ut,de);return Jt(be.createElement(Ke.ZP,Object.assign({ref:Ue,virtual:se,showSearch:fe==null?void 0:fe.showSearch},Fn,{style:Object.assign(Object.assign({},fe==null?void 0:fe.style),bn),dropdownMatchSelectWidth:xt,builtinPlacements:sr,transitionName:(0,Ne.m)(Ie,"slide-up",un.transitionName),listHeight:It,listItemHeight:mt,mode:on,prefixCls:le,placement:Hr,direction:it,suffixIcon:en,menuItemSelectedIcon:ln,removeIcon:Dn,allowClear:En,notFoundContent:Zt,className:Tr,getPopupContainer:Qe||Vt,dropdownClassName:jn,disabled:_r})))},Ze=be.forwardRef(ft),ke=(0,Ae.Z)(Ze);Ze.SECRET_COMBOBOX_MODE_DO_NOT_USE=nt,Ze.Option=Ke.Wx,Ze.OptGroup=Ke.Xo,Ze._InternalPanelDoNotUseOrYouWillBeFired=ke,cn.default=Ze},14154:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Ze}});var me=ue(17313),je=ue(74207),Ke=ue(37613),ot=ue(83116),be=ue(13826),Ae=ue(92899);const Ne=ke=>{const{optionHeight:He,optionFontSize:Ue,optionLineHeight:bt,optionPadding:Ve}=ke;return{position:"relative",display:"block",minHeight:He,padding:Ve,color:ke.colorText,fontWeight:"normal",fontSize:Ue,lineHeight:bt,boxSizing:"border-box"}};var Me=ke=>{const{antCls:He,componentCls:Ue}=ke,bt=`${Ue}-item`,Ve=`&${He}-slide-up-enter${He}-slide-up-enter-active`,jt=`&${He}-slide-up-appear${He}-slide-up-appear-active`,st=`&${He}-slide-up-leave${He}-slide-up-leave-active`,Bt=`${Ue}-dropdown-placement-`;return[{[`${Ue}-dropdown`]:Object.assign(Object.assign({},(0,me.Wf)(ke)),{position:"absolute",top:-9999,zIndex:ke.zIndexPopup,boxSizing:"border-box",padding:ke.paddingXXS,overflow:"hidden",fontSize:ke.fontSize,fontVariant:"initial",backgroundColor:ke.colorBgElevated,borderRadius:ke.borderRadiusLG,outline:"none",boxShadow:ke.boxShadowSecondary,[`
|
|
|
${Ve}${Bt}bottomLeft,
|
|
|
${jt}${Bt}bottomLeft
|
|
|
`]:{animationName:be.fJ},[`
|
|
|
${Ve}${Bt}topLeft,
|
|
|
${jt}${Bt}topLeft,
|
|
|
${Ve}${Bt}topRight,
|
|
|
${jt}${Bt}topRight
|
|
|
`]:{animationName:be.Qt},[`${st}${Bt}bottomLeft`]:{animationName:be.Uw},[`
|
|
|
${st}${Bt}topLeft,
|
|
|
${st}${Bt}topRight
|
|
|
`]:{animationName:be.ly},"&-hidden":{display:"none"},[`${bt}`]:Object.assign(Object.assign({},Ne(ke)),{cursor:"pointer",transition:`background ${ke.motionDurationSlow} ease`,borderRadius:ke.borderRadiusSM,"&-group":{color:ke.colorTextDescription,fontSize:ke.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},me.vS),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${bt}-option-disabled)`]:{backgroundColor:ke.optionActiveBg},[`&-selected:not(${bt}-option-disabled)`]:{color:ke.optionSelectedColor,fontWeight:ke.optionSelectedFontWeight,backgroundColor:ke.optionSelectedBg,[`${bt}-option-state`]:{color:ke.colorPrimary}},"&-disabled":{[`&${bt}-option-selected`]:{backgroundColor:ke.colorBgContainerDisabled},color:ke.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:ke.controlPaddingHorizontal*2}}}),"&-rtl":{direction:"rtl"}})},(0,be.oN)(ke,"slide-up"),(0,be.oN)(ke,"slide-down"),(0,Ae.Fm)(ke,"move-up"),(0,Ae.Fm)(ke,"move-down")]};const ze=2,ut=ke=>{let{controlHeightSM:He,controlHeight:Ue,lineWidth:bt}=ke;const Ve=(Ue-He)/2-bt,jt=Math.ceil(Ve/2);return[Ve,jt]};function Le(ke,He){const{componentCls:Ue,iconCls:bt}=ke,Ve=`${Ue}-selection-overflow`,jt=ke.multipleSelectItemHeight,[st]=ut(ke),Bt=He?`${Ue}-${He}`:"";return{[`${Ue}-multiple${Bt}`]:{fontSize:ke.fontSize,[Ve]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${Ue}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",padding:`${st-ze}px ${ze*2}px`,borderRadius:ke.borderRadius,[`${Ue}-show-search&`]:{cursor:"text"},[`${Ue}-disabled&`]:{background:ke.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${ze}px 0`,lineHeight:`${jt}px`,visibility:"hidden",content:'"\\a0"'}},[`
|
|
|
&${Ue}-show-arrow ${Ue}-selector,
|
|
|
&${Ue}-allow-clear ${Ue}-selector
|
|
|
`]:{paddingInlineEnd:ke.fontSizeIcon+ke.controlPaddingHorizontal},[`${Ue}-selection-item`]:{position:"relative",display:"flex",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:jt,marginTop:ze,marginBottom:ze,lineHeight:`${jt-ke.lineWidth*2}px`,background:ke.multipleItemBg,border:`${ke.lineWidth}px ${ke.lineType} ${ke.multipleItemBorderColor}`,borderRadius:ke.borderRadiusSM,cursor:"default",transition:`font-size ${ke.motionDurationSlow}, line-height ${ke.motionDurationSlow}, height ${ke.motionDurationSlow}`,userSelect:"none",marginInlineEnd:ze*2,paddingInlineStart:ke.paddingXS,paddingInlineEnd:ke.paddingXS/2,[`${Ue}-disabled&`]:{color:ke.multipleItemColorDisabled,borderColor:ke.multipleItemBorderColorDisabled,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:ke.paddingXS/2,overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},(0,me.Ro)()),{display:"inline-flex",alignItems:"center",color:ke.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${bt}`]:{verticalAlign:"-0.2em"},"&:hover":{color:ke.colorIconHover}})},[`${Ve}-item + ${Ve}-item`]:{[`${Ue}-selection-search`]:{marginInlineStart:0}},[`${Ue}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:ke.inputPaddingHorizontalBase-st,"\n &-input,\n &-mirror\n ":{height:jt,fontFamily:ke.fontFamily,lineHeight:`${jt}px`,transition:`all ${ke.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${Ue}-selection-placeholder `]:{position:"absolute",top:"50%",insetInlineStart:ke.inputPaddingHorizontalBase,insetInlineEnd:ke.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${ke.motionDurationSlow}`}}}}var yt=ke=>{const{componentCls:He}=ke,Ue=(0,Ke.TS)(ke,{controlHeight:ke.controlHeightSM,multipleSelectItemHeight:ke.controlHeightXS,borderRadius:ke.borderRadiusSM,borderRadiusSM:ke.borderRadiusXS}),bt=(0,Ke.TS)(ke,{fontSize:ke.fontSizeLG,controlHeight:ke.controlHeightLG,multipleSelectItemHeight:ke.multipleItemHeightLG,borderRadius:ke.borderRadiusLG,borderRadiusSM:ke.borderRadius}),[,Ve]=ut(ke);return[Le(ke),Le(Ue,"sm"),{[`${He}-multiple${He}-sm`]:{[`${He}-selection-placeholder`]:{insetInline:ke.controlPaddingHorizontalSM-ke.lineWidth},[`${He}-selection-search`]:{marginInlineStart:Ve}}},Le(bt,"lg")]};function et(ke,He){const{componentCls:Ue,inputPaddingHorizontalBase:bt,borderRadius:Ve}=ke,jt=ke.controlHeight-ke.lineWidth*2,st=Math.ceil(ke.fontSize*1.25),Bt=He?`${Ue}-${He}`:"";return{[`${Ue}-single${Bt}`]:{fontSize:ke.fontSize,[`${Ue}-selector`]:Object.assign(Object.assign({},(0,me.Wf)(ke)),{display:"flex",borderRadius:Ve,[`${Ue}-selection-search`]:{position:"absolute",top:0,insetInlineStart:bt,insetInlineEnd:bt,bottom:0,"&-input":{width:"100%"}},[`
|
|
|
${Ue}-selection-item,
|
|
|
${Ue}-selection-placeholder
|
|
|
`]:{padding:0,lineHeight:`${jt}px`,transition:`all ${ke.motionDurationSlow}, visibility 0s`,"@supports (-moz-appearance: meterbar)":{lineHeight:`${jt}px`}},[`${Ue}-selection-item`]:{position:"relative",userSelect:"none"},[`${Ue}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${Ue}-selection-item:after`,`${Ue}-selection-placeholder:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[`
|
|
|
&${Ue}-show-arrow ${Ue}-selection-item,
|
|
|
&${Ue}-show-arrow ${Ue}-selection-placeholder
|
|
|
`]:{paddingInlineEnd:st},[`&${Ue}-open ${Ue}-selection-item`]:{color:ke.colorTextPlaceholder},[`&:not(${Ue}-customize-input)`]:{[`${Ue}-selector`]:{width:"100%",height:ke.controlHeight,padding:`0 ${bt}px`,[`${Ue}-selection-search-input`]:{height:jt},"&:after":{lineHeight:`${jt}px`}}},[`&${Ue}-customize-input`]:{[`${Ue}-selector`]:{"&:after":{display:"none"},[`${Ue}-selection-search`]:{position:"static",width:"100%"},[`${Ue}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${bt}px`,"&:after":{display:"none"}}}}}}}function pt(ke){const{componentCls:He}=ke,Ue=ke.controlPaddingHorizontalSM-ke.lineWidth;return[et(ke),et((0,Ke.TS)(ke,{controlHeight:ke.controlHeightSM,borderRadius:ke.borderRadiusSM}),"sm"),{[`${He}-single${He}-sm`]:{[`&:not(${He}-customize-input)`]:{[`${He}-selection-search`]:{insetInlineStart:Ue,insetInlineEnd:Ue},[`${He}-selector`]:{padding:`0 ${Ue}px`},[`&${He}-show-arrow ${He}-selection-search`]:{insetInlineEnd:Ue+ke.fontSize*1.5},[`
|
|
|
&${He}-show-arrow ${He}-selection-item,
|
|
|
&${He}-show-arrow ${He}-selection-placeholder
|
|
|
`]:{paddingInlineEnd:ke.fontSize*1.5}}}},et((0,Ke.TS)(ke,{controlHeight:ke.singleItemHeightLG,fontSize:ke.fontSizeLG,borderRadius:ke.borderRadiusLG}),"lg")]}const at=ke=>{const{componentCls:He,selectorBg:Ue}=ke;return{position:"relative",backgroundColor:Ue,border:`${ke.lineWidth}px ${ke.lineType} ${ke.colorBorder}`,transition:`all ${ke.motionDurationMid} ${ke.motionEaseInOut}`,input:{cursor:"pointer"},[`${He}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit"}},[`${He}-disabled&`]:{color:ke.colorTextDisabled,background:ke.colorBgContainerDisabled,cursor:"not-allowed",[`${He}-multiple&`]:{background:ke.multipleSelectorBgDisabled},input:{cursor:"not-allowed"}}}},St=function(ke,He){let Ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const{componentCls:bt,borderHoverColor:Ve,outlineColor:jt,antCls:st}=He,Bt=Ue?{[`${bt}-selector`]:{borderColor:Ve}}:{};return{[ke]:{[`&:not(${bt}-disabled):not(${bt}-customize-input):not(${st}-pagination-size-changer)`]:Object.assign(Object.assign({},Bt),{[`${bt}-focused& ${bt}-selector`]:{borderColor:Ve,boxShadow:`0 0 0 ${He.controlOutlineWidth}px ${jt}`,outline:0},[`&:hover ${bt}-selector`]:{borderColor:Ve}})}}},Qt=ke=>{const{componentCls:He}=ke;return{[`${He}-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=ke=>{const{componentCls:He,inputPaddingHorizontalBase:Ue,iconCls:bt}=ke;return{[He]:Object.assign(Object.assign({},(0,me.Wf)(ke)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${He}-customize-input) ${He}-selector`]:Object.assign(Object.assign({},at(ke)),Qt(ke)),[`${He}-selection-item`]:Object.assign({flex:1,fontWeight:"normal"},me.vS),[`${He}-selection-placeholder`]:Object.assign(Object.assign({},me.vS),{flex:1,color:ke.colorTextPlaceholder,pointerEvents:"none"}),[`${He}-arrow`]:Object.assign(Object.assign({},(0,me.Ro)()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:Ue,height:ke.fontSizeIcon,marginTop:-ke.fontSizeIcon/2,color:ke.colorTextQuaternary,fontSize:ke.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",[bt]:{verticalAlign:"top",transition:`transform ${ke.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${He}-suffix)`]:{pointerEvents:"auto"}},[`${He}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${He}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:Ue,zIndex:1,display:"inline-block",width:ke.fontSizeIcon,height:ke.fontSizeIcon,marginTop:-ke.fontSizeIcon/2,color:ke.colorTextQuaternary,fontSize:ke.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",background:ke.clearBg,cursor:"pointer",opacity:0,transition:`color ${ke.motionDurationMid} ease, opacity ${ke.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:ke.colorTextTertiary}},"&:hover":{[`${He}-clear`]:{opacity:1}}}),[`${He}-has-feedback`]:{[`${He}-clear`]:{insetInlineEnd:Ue+ke.fontSize+ke.paddingXS}}}},ft=ke=>{const{componentCls:He}=ke;return[{[He]:{[`&-borderless ${He}-selector`]:{backgroundColor:"transparent !important",borderColor:"transparent !important",boxShadow:"none !important"},[`&${He}-in-form-item`]:{width:"100%"}}},nt(ke),pt(ke),yt(ke),Me(ke),{[`${He}-rtl`]:{direction:"rtl"}},St(He,(0,Ke.TS)(ke,{borderHoverColor:ke.colorPrimaryHover,outlineColor:ke.controlOutline})),St(`${He}-status-error`,(0,Ke.TS)(ke,{borderHoverColor:ke.colorErrorHover,outlineColor:ke.colorErrorOutline}),!0),St(`${He}-status-warning`,(0,Ke.TS)(ke,{borderHoverColor:ke.colorWarningHover,outlineColor:ke.colorWarningOutline}),!0),(0,je.c)(ke,{borderElCls:`${He}-selector`,focusElCls:`${He}-focused`})]};var Ze=(0,ot.Z)("Select",(ke,He)=>{let{rootPrefixCls:Ue}=He;const bt=(0,Ke.TS)(ke,{rootPrefixCls:Ue,inputPaddingHorizontalBase:ke.paddingSM-1,multipleSelectItemHeight:ke.multipleItemHeight});return[ft(bt)]},ke=>{const{fontSize:He,lineHeight:Ue,controlHeight:bt,controlPaddingHorizontal:Ve,zIndexPopupBase:jt,colorText:st,fontWeightStrong:Bt,controlItemBgActive:Qe,controlItemBgHover:zt,colorBgContainer:ct,colorFillSecondary:It,controlHeightLG:Rt,controlHeightSM:mt,colorBgContainerDisabled:$e,colorTextDisabled:xe}=ke;return{zIndexPopup:jt+50,optionSelectedColor:st,optionSelectedFontWeight:Bt,optionSelectedBg:Qe,optionActiveBg:zt,optionPadding:`${(bt-He*Ue)/2}px ${Ve}px`,optionFontSize:He,optionLineHeight:Ue,optionHeight:bt,selectorBg:ct,clearBg:ct,singleItemHeightLG:Rt,multipleItemBg:It,multipleItemBorderColor:"transparent",multipleItemHeight:mt,multipleItemHeightLG:bt,multipleSelectorBgDisabled:$e,multipleItemColorDisabled:xe,multipleItemBorderColorDisabled:"transparent"}})},58582:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return je}});const me=Ke=>{const be={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:Ke==="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 je(Ke,ot){return Ke||me(ot)}},84443:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return me}});function me(je,Ke){return Ke!==void 0?Ke:je!==null}},66339:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Ce}});var me=ue(40001),je=ue(19248),Ke=ue(99267),ot=ue(84105),be=ue(58617),Ae=ue(47472),Ne=ue(59301);function Ce(Me){let{suffixIcon:ze,clearIcon:ut,menuItemSelectedIcon:Le,removeIcon:We,loading:yt,multiple:et,hasFeedback:pt,prefixCls:at,showSuffixIcon:St,feedbackIcon:Qt,showArrow:nt,componentName:ft}=Me;const Ze=ut!=null?ut:Ne.createElement(je.Z,null),ke=Ve=>ze===null&&!pt&&!nt?null:Ne.createElement(Ne.Fragment,null,St!==!1&&Ve,pt&&Qt);let He=null;if(ze!==void 0)He=ke(ze);else if(yt)He=ke(Ne.createElement(be.Z,{spin:!0}));else{const Ve=`${at}-suffix`;He=jt=>{let{open:st,showSearch:Bt}=jt;return ke(st&&Bt?Ne.createElement(Ae.Z,{className:Ve}):Ne.createElement(ot.Z,{className:Ve}))}}let Ue=null;Le!==void 0?Ue=Le:et?Ue=Ne.createElement(me.Z,null):Ue=null;let bt=null;return We!==void 0?bt=We:bt=Ne.createElement(Ke.Z,null),{clearIcon:Ze,suffixIcon:He,itemIcon:Ue,removeIcon:bt}}},8378:function(kn,cn){"use strict";const ue=me=>({[me.componentCls]:{[`${me.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${me.motionDurationMid} ${me.motionEaseInOut},
|
|
|
opacity ${me.motionDurationMid} ${me.motionEaseInOut} !important`}},[`${me.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${me.motionDurationMid} ${me.motionEaseInOut},
|
|
|
opacity ${me.motionDurationMid} ${me.motionEaseInOut} !important`}}});cn.Z=ue},92899:function(kn,cn,ue){"use strict";ue.d(cn,{Fm:function(){return Le}});var me=ue(36237),je=ue(95406);const Ke=new me.Keyframes("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),ot=new me.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 me.Keyframes("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Ae=new me.Keyframes("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),Ne=new me.Keyframes("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Ce=new me.Keyframes("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),Me=new me.Keyframes("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),ze=new me.Keyframes("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),ut={"move-up":{inKeyframes:Me,outKeyframes:ze},"move-down":{inKeyframes:Ke,outKeyframes:ot},"move-left":{inKeyframes:be,outKeyframes:Ae},"move-right":{inKeyframes:Ne,outKeyframes:Ce}},Le=(We,yt)=>{const{antCls:et}=We,pt=`${et}-${yt}`,{inKeyframes:at,outKeyframes:St}=ut[yt];return[(0,je.R)(pt,at,St,We.motionDurationMid),{[`
|
|
|
${pt}-enter,
|
|
|
${pt}-appear
|
|
|
`]:{opacity:0,animationTimingFunction:We.motionEaseOutCirc},[`${pt}-leave`]:{animationTimingFunction:We.motionEaseInOutCirc}}]}},13826:function(kn,cn,ue){"use strict";ue.d(cn,{Qt:function(){return be},Uw:function(){return ot},fJ:function(){return Ke},ly:function(){return Ae},oN:function(){return Le}});var me=ue(36237),je=ue(95406);const Ke=new me.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),ot=new me.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),be=new me.Keyframes("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),Ae=new me.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),Ne=new me.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),Ce=new me.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),Me=new me.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),ze=new me.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),ut={"slide-up":{inKeyframes:Ke,outKeyframes:ot},"slide-down":{inKeyframes:be,outKeyframes:Ae},"slide-left":{inKeyframes:Ne,outKeyframes:Ce},"slide-right":{inKeyframes:Me,outKeyframes:ze}},Le=(We,yt)=>{const{antCls:et}=We,pt=`${et}-${yt}`,{inKeyframes:at,outKeyframes:St}=ut[yt];return[(0,je.R)(pt,at,St,We.motionDurationMid),{[`
|
|
|
${pt}-enter,
|
|
|
${pt}-appear
|
|
|
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:We.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${pt}-leave`]:{animationTimingFunction:We.motionEaseInQuint}}]}},78673:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Bt}});var me=ue(58617),je=ue(92310),Ke=ue.n(je),ot=ue(60499),be=ue(18642),Ae=ue(72190),Ne=ue(42244),Ce=ue(59301),Me=ue(18929),ze=ue(10228),ut=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],Le=Ce.forwardRef(function(Qe,zt){var ct,It=Qe.prefixCls,Rt=It===void 0?"rc-switch":It,mt=Qe.className,$e=Qe.checked,xe=Qe.defaultChecked,ht=Qe.disabled,nn=Qe.loadingIcon,Ut=Qe.checkedChildren,Xe=Qe.unCheckedChildren,Ye=Qe.onClick,Dt=Qe.onChange,bn=Qe.onKeyDown,tn=(0,Ne.Z)(Qe,ut),un=(0,Me.Z)(!1,{value:$e,defaultValue:xe}),Vt=(0,Ae.Z)(un,2),Gt=Vt[0],Wt=Vt[1];function ye(fe,le){var Ie=Gt;return ht||(Ie=fe,Wt(Ie),Dt==null||Dt(Ie,le)),Ie}function se(fe){fe.which===ze.Z.LEFT?ye(!1,fe):fe.which===ze.Z.RIGHT&&ye(!0,fe),bn==null||bn(fe)}function oe(fe){var le=ye(!Gt,fe);Ye==null||Ye(le,fe)}var de=Ke()(Rt,mt,(ct={},(0,be.Z)(ct,"".concat(Rt,"-checked"),Gt),(0,be.Z)(ct,"".concat(Rt,"-disabled"),ht),ct));return Ce.createElement("button",(0,ot.Z)({},tn,{type:"button",role:"switch","aria-checked":Gt,disabled:ht,className:de,ref:zt,onKeyDown:se,onClick:oe}),nn,Ce.createElement("span",{className:"".concat(Rt,"-inner")},Ce.createElement("span",{className:"".concat(Rt,"-inner-checked")},Ut),Ce.createElement("span",{className:"".concat(Rt,"-inner-unchecked")},Xe)))});Le.displayName="Switch";var We=Le,yt=ue(14088),et=ue(36355),pt=ue(1684),at=ue(19716),St=ue(64993),Qt=ue(17313),nt=ue(83116),ft=ue(37613);const Ze=Qe=>{const{componentCls:zt,trackHeightSM:ct,trackPadding:It,trackMinWidthSM:Rt,innerMinMarginSM:mt,innerMaxMarginSM:$e,handleSizeSM:xe}=Qe,ht=`${zt}-inner`;return{[zt]:{[`&${zt}-small`]:{minWidth:Rt,height:ct,lineHeight:`${ct}px`,[`${zt}-inner`]:{paddingInlineStart:$e,paddingInlineEnd:mt,[`${ht}-checked`]:{marginInlineStart:`calc(-100% + ${xe+It*2}px - ${$e*2}px)`,marginInlineEnd:`calc(100% - ${xe+It*2}px + ${$e*2}px)`},[`${ht}-unchecked`]:{marginTop:-ct,marginInlineStart:0,marginInlineEnd:0}},[`${zt}-handle`]:{width:xe,height:xe},[`${zt}-loading-icon`]:{top:(xe-Qe.switchLoadingIconSize)/2,fontSize:Qe.switchLoadingIconSize},[`&${zt}-checked`]:{[`${zt}-inner`]:{paddingInlineStart:mt,paddingInlineEnd:$e,[`${ht}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${ht}-unchecked`]:{marginInlineStart:`calc(100% - ${xe+It*2}px + ${$e*2}px)`,marginInlineEnd:`calc(-100% + ${xe+It*2}px - ${$e*2}px)`}},[`${zt}-handle`]:{insetInlineStart:`calc(100% - ${xe+It}px)`}},[`&:not(${zt}-disabled):active`]:{[`&:not(${zt}-checked) ${ht}`]:{[`${ht}-unchecked`]:{marginInlineStart:Qe.marginXXS/2,marginInlineEnd:-Qe.marginXXS/2}},[`&${zt}-checked ${ht}`]:{[`${ht}-checked`]:{marginInlineStart:-Qe.marginXXS/2,marginInlineEnd:Qe.marginXXS/2}}}}}}},ke=Qe=>{const{componentCls:zt,handleSize:ct}=Qe;return{[zt]:{[`${zt}-loading-icon${Qe.iconCls}`]:{position:"relative",top:(ct-Qe.fontSize)/2,color:Qe.switchLoadingIconColor,verticalAlign:"top"},[`&${zt}-checked ${zt}-loading-icon`]:{color:Qe.switchColor}}}},He=Qe=>{const{componentCls:zt,motion:ct,trackPadding:It,handleBg:Rt,handleShadow:mt,handleSize:$e}=Qe,xe=`${zt}-handle`;return{[zt]:{[xe]:{position:"absolute",top:It,insetInlineStart:It,width:$e,height:$e,transition:`all ${Qe.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:Rt,borderRadius:$e/2,boxShadow:mt,transition:`all ${Qe.switchDuration} ease-in-out`,content:'""'}},[`&${zt}-checked ${xe}`]:{insetInlineStart:`calc(100% - ${$e+It}px)`},[`&:not(${zt}-disabled):active`]:ct?{[`${xe}::before`]:{insetInlineEnd:Qe.switchHandleActiveInset,insetInlineStart:0},[`&${zt}-checked ${xe}::before`]:{insetInlineEnd:0,insetInlineStart:Qe.switchHandleActiveInset}}:{}}}},Ue=Qe=>{const{componentCls:zt,trackHeight:ct,trackPadding:It,innerMinMargin:Rt,innerMaxMargin:mt,handleSize:$e}=Qe,xe=`${zt}-inner`;return{[zt]:{[xe]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:mt,paddingInlineEnd:Rt,transition:`padding-inline-start ${Qe.switchDuration} ease-in-out, padding-inline-end ${Qe.switchDuration} ease-in-out`,[`${xe}-checked, ${xe}-unchecked`]:{display:"block",color:Qe.colorTextLightSolid,fontSize:Qe.fontSizeSM,transition:`margin-inline-start ${Qe.switchDuration} ease-in-out, margin-inline-end ${Qe.switchDuration} ease-in-out`,pointerEvents:"none"},[`${xe}-checked`]:{marginInlineStart:`calc(-100% + ${$e+It*2}px - ${mt*2}px)`,marginInlineEnd:`calc(100% - ${$e+It*2}px + ${mt*2}px)`},[`${xe}-unchecked`]:{marginTop:-ct,marginInlineStart:0,marginInlineEnd:0}},[`&${zt}-checked ${xe}`]:{paddingInlineStart:Rt,paddingInlineEnd:mt,[`${xe}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${xe}-unchecked`]:{marginInlineStart:`calc(100% - ${$e+It*2}px + ${mt*2}px)`,marginInlineEnd:`calc(-100% + ${$e+It*2}px - ${mt*2}px)`}},[`&:not(${zt}-disabled):active`]:{[`&:not(${zt}-checked) ${xe}`]:{[`${xe}-unchecked`]:{marginInlineStart:It*2,marginInlineEnd:-It*2}},[`&${zt}-checked ${xe}`]:{[`${xe}-checked`]:{marginInlineStart:-It*2,marginInlineEnd:It*2}}}}}},bt=Qe=>{const{componentCls:zt,trackHeight:ct,trackMinWidth:It}=Qe;return{[zt]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,Qt.Wf)(Qe)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:It,height:ct,lineHeight:`${ct}px`,verticalAlign:"middle",background:Qe.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${Qe.motionDurationMid}`,userSelect:"none",[`&:hover:not(${zt}-disabled)`]:{background:Qe.colorTextTertiary}}),(0,Qt.Qy)(Qe)),{[`&${zt}-checked`]:{background:Qe.switchColor,[`&:hover:not(${zt}-disabled)`]:{background:Qe.colorPrimaryHover}},[`&${zt}-loading, &${zt}-disabled`]:{cursor:"not-allowed",opacity:Qe.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${zt}-rtl`]:{direction:"rtl"}})}};var Ve=(0,nt.Z)("Switch",Qe=>{const zt=(0,ft.TS)(Qe,{switchDuration:Qe.motionDurationMid,switchColor:Qe.colorPrimary,switchDisabledOpacity:Qe.opacityLoading,switchLoadingIconSize:Qe.fontSizeIcon*.75,switchLoadingIconColor:`rgba(0, 0, 0, ${Qe.opacityLoading})`,switchHandleActiveInset:"-30%"});return[bt(zt),Ue(zt),He(zt),ke(zt),Ze(zt)]},Qe=>{const{fontSize:zt,lineHeight:ct,controlHeight:It,colorWhite:Rt}=Qe,mt=zt*ct,$e=It/2,xe=2,ht=mt-xe*2,nn=$e-xe*2;return{trackHeight:mt,trackHeightSM:$e,trackMinWidth:ht*2+xe*4,trackMinWidthSM:nn*2+xe*2,trackPadding:xe,handleBg:Rt,handleSize:ht,handleSizeSM:nn,handleShadow:`0 2px 4px 0 ${new St.C("#00230b").setAlpha(.2).toRgbString()}`,innerMinMargin:ht/2,innerMaxMargin:ht+xe+xe*2,innerMinMarginSM:nn/2,innerMaxMarginSM:nn+xe+xe*2}}),jt=function(Qe,zt){var ct={};for(var It in Qe)Object.prototype.hasOwnProperty.call(Qe,It)&&zt.indexOf(It)<0&&(ct[It]=Qe[It]);if(Qe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Rt=0,It=Object.getOwnPropertySymbols(Qe);Rt<It.length;Rt++)zt.indexOf(It[Rt])<0&&Object.prototype.propertyIsEnumerable.call(Qe,It[Rt])&&(ct[It[Rt]]=Qe[It[Rt]]);return ct};const st=Ce.forwardRef((Qe,zt)=>{const{prefixCls:ct,size:It,disabled:Rt,loading:mt,className:$e,rootClassName:xe,style:ht}=Qe,nn=jt(Qe,["prefixCls","size","disabled","loading","className","rootClassName","style"]),{getPrefixCls:Ut,direction:Xe,switch:Ye}=Ce.useContext(et.E_),Dt=Ce.useContext(pt.Z),bn=(Rt!=null?Rt:Dt)||mt,tn=Ut("switch",ct),un=Ce.createElement("div",{className:`${tn}-handle`},mt&&Ce.createElement(me.Z,{className:`${tn}-loading-icon`})),[Vt,Gt]=Ve(tn),Wt=(0,at.Z)(It),ye=Ke()(Ye==null?void 0:Ye.className,{[`${tn}-small`]:Wt==="small",[`${tn}-loading`]:mt,[`${tn}-rtl`]:Xe==="rtl"},$e,xe,Gt),se=Object.assign(Object.assign({},Ye==null?void 0:Ye.style),ht);return Vt(Ce.createElement(yt.Z,{component:"Switch"},Ce.createElement(We,Object.assign({},nn,{prefixCls:tn,className:ye,style:se,disabled:bn,ref:zt,loadingIcon:un}))))});st.__ANT_SWITCH=!0;var Bt=st},99313:function(kn,cn,ue){"use strict";ue.d(cn,{default:function(){return lt}});var me=ue(99267),je=ue(18785),Ke=ue(62772),ot=ue(92310),be=ue.n(ot),Ae=ue(60499),Ne=ue(18642),Ce=ue(85899),Me=ue(72190),ze=ue(43749),ut=ue(42244),Le=ue(59301),We=ue(49658),yt=ue(18929),et=ue(77900),pt=(0,Le.createContext)(null),at=Le.forwardRef(function(_e,Pe){var De=_e.prefixCls,Te=_e.className,qe=_e.style,dt=_e.id,Xt=_e.active,Ot=_e.tabKey,Yt=_e.children;return Le.createElement("div",{id:dt&&"".concat(dt,"-panel-").concat(Ot),role:"tabpanel",tabIndex:Xt?0:-1,"aria-labelledby":dt&&"".concat(dt,"-tab-").concat(Ot),"aria-hidden":!Xt,style:qe,className:be()(De,Xt&&"".concat(De,"-active"),Te),ref:Pe},Yt)}),St=at,Qt=["key","forceRender","style","className"];function nt(_e){var Pe=_e.id,De=_e.activeKey,Te=_e.animated,qe=_e.tabPosition,dt=_e.destroyInactiveTabPane,Xt=Le.useContext(pt),Ot=Xt.prefixCls,Yt=Xt.tabs,pn=Te.tabPane,vn="".concat(Ot,"-tabpane");return Le.createElement("div",{className:be()("".concat(Ot,"-content-holder"))},Le.createElement("div",{className:be()("".concat(Ot,"-content"),"".concat(Ot,"-content-").concat(qe),(0,Ne.Z)({},"".concat(Ot,"-content-animated"),pn))},Yt.map(function(Sn){var At=Sn.key,dn=Sn.forceRender,rt=Sn.style,Mt=Sn.className,Lt=(0,ut.Z)(Sn,Qt),Pt=At===De;return Le.createElement(et.default,(0,Ae.Z)({key:At,visible:Pt,forceRender:dn,removeOnLeave:!!dt,leavedClassName:"".concat(vn,"-hidden")},Te.tabPaneMotion),function(an,Et){var rn=an.style,Be=an.className;return Le.createElement(St,(0,Ae.Z)({},Lt,{prefixCls:vn,id:Pe,tabKey:At,animated:pn,active:Pt,style:(0,Ce.Z)((0,Ce.Z)({},rt),rn),className:be()(Mt,Be),ref:Et}))})})))}var ft=ue(77654),Ze=ue(29301),ke=ue(6089),He=ue(8654),Ue={width:0,height:0,left:0,top:0};function bt(_e,Pe,De){return(0,Le.useMemo)(function(){for(var Te,qe=new Map,dt=Pe.get((Te=_e[0])===null||Te===void 0?void 0:Te.key)||Ue,Xt=dt.left+dt.width,Ot=0;Ot<_e.length;Ot+=1){var Yt=_e[Ot].key,pn=Pe.get(Yt);if(!pn){var vn;pn=Pe.get((vn=_e[Ot-1])===null||vn===void 0?void 0:vn.key)||Ue}var Sn=qe.get(Yt)||(0,Ce.Z)({},pn);Sn.right=Xt-Sn.left-Sn.width,qe.set(Yt,Sn)}return qe},[_e.map(function(Te){return Te.key}).join("_"),Pe,De])}function Ve(_e,Pe){var De=Le.useRef(_e),Te=Le.useState({}),qe=(0,Me.Z)(Te,2),dt=qe[1];function Xt(Ot){var Yt=typeof Ot=="function"?Ot(De.current):Ot;Yt!==De.current&&Pe(Yt,De.current),De.current=Yt,dt({})}return[De.current,Xt]}var jt=.1,st=.01,Bt=20,Qe=Math.pow(.995,Bt);function zt(_e,Pe){var De=(0,Le.useState)(),Te=(0,Me.Z)(De,2),qe=Te[0],dt=Te[1],Xt=(0,Le.useState)(0),Ot=(0,Me.Z)(Xt,2),Yt=Ot[0],pn=Ot[1],vn=(0,Le.useState)(0),Sn=(0,Me.Z)(vn,2),At=Sn[0],dn=Sn[1],rt=(0,Le.useState)(),Mt=(0,Me.Z)(rt,2),Lt=Mt[0],Pt=Mt[1],an=(0,Le.useRef)();function Et(Tt){var Ft=Tt.touches[0],Ht=Ft.screenX,gn=Ft.screenY;dt({x:Ht,y:gn}),window.clearInterval(an.current)}function rn(Tt){if(qe){Tt.preventDefault();var Ft=Tt.touches[0],Ht=Ft.screenX,gn=Ft.screenY;dt({x:Ht,y:gn});var wn=Ht-qe.x,Ln=gn-qe.y;Pe(wn,Ln);var zn=Date.now();pn(zn),dn(zn-Yt),Pt({x:wn,y:Ln})}}function Be(){if(qe&&(dt(null),Pt(null),Lt)){var Tt=Lt.x/At,Ft=Lt.y/At,Ht=Math.abs(Tt),gn=Math.abs(Ft);if(Math.max(Ht,gn)<jt)return;var wn=Tt,Ln=Ft;an.current=window.setInterval(function(){if(Math.abs(wn)<st&&Math.abs(Ln)<st){window.clearInterval(an.current);return}wn*=Qe,Ln*=Qe,Pe(wn*Bt,Ln*Bt)},Bt)}}var wt=(0,Le.useRef)();function Ct(Tt){var Ft=Tt.deltaX,Ht=Tt.deltaY,gn=0,wn=Math.abs(Ft),Ln=Math.abs(Ht);wn===Ln?gn=wt.current==="x"?Ft:Ht:wn>Ln?(gn=Ft,wt.current="x"):(gn=Ht,wt.current="y"),Pe(-gn,-gn)&&Tt.preventDefault()}var Nt=(0,Le.useRef)(null);Nt.current={onTouchStart:Et,onTouchMove:rn,onTouchEnd:Be,onWheel:Ct},Le.useEffect(function(){function Tt(wn){Nt.current.onTouchStart(wn)}function Ft(wn){Nt.current.onTouchMove(wn)}function Ht(wn){Nt.current.onTouchEnd(wn)}function gn(wn){Nt.current.onWheel(wn)}return document.addEventListener("touchmove",Ft,{passive:!1}),document.addEventListener("touchend",Ht,{passive:!1}),_e.current.addEventListener("touchstart",Tt,{passive:!1}),_e.current.addEventListener("wheel",gn),function(){document.removeEventListener("touchmove",Ft),document.removeEventListener("touchend",Ht)}},[])}var ct=ue(34280);function It(_e){var Pe=(0,Le.useState)(0),De=(0,Me.Z)(Pe,2),Te=De[0],qe=De[1],dt=(0,Le.useRef)(0),Xt=(0,Le.useRef)();return Xt.current=_e,(0,ct.o)(function(){var Ot;(Ot=Xt.current)===null||Ot===void 0||Ot.call(Xt)},[Te]),function(){dt.current===Te&&(dt.current+=1,qe(dt.current))}}function Rt(_e){var Pe=(0,Le.useRef)([]),De=(0,Le.useState)({}),Te=(0,Me.Z)(De,2),qe=Te[1],dt=(0,Le.useRef)(typeof _e=="function"?_e():_e),Xt=It(function(){var Yt=dt.current;Pe.current.forEach(function(pn){Yt=pn(Yt)}),Pe.current=[],dt.current=Yt,qe({})});function Ot(Yt){Pe.current.push(Yt),Xt()}return[dt.current,Ot]}var mt={width:0,height:0,left:0,top:0,right:0};function $e(_e,Pe,De,Te,qe,dt,Xt){var Ot=Xt.tabs,Yt=Xt.tabPosition,pn=Xt.rtl,vn,Sn,At;return["top","bottom"].includes(Yt)?(vn="width",Sn=pn?"right":"left",At=Math.abs(De)):(vn="height",Sn="top",At=-De),(0,Le.useMemo)(function(){if(!Ot.length)return[0,0];for(var dn=Ot.length,rt=dn,Mt=0;Mt<dn;Mt+=1){var Lt=_e.get(Ot[Mt].key)||mt;if(Lt[Sn]+Lt[vn]>At+Pe){rt=Mt-1;break}}for(var Pt=0,an=dn-1;an>=0;an-=1){var Et=_e.get(Ot[an].key)||mt;if(Et[Sn]<At){Pt=an+1;break}}return Pt>=rt?[0,0]:[Pt,rt]},[_e,Pe,Te,qe,dt,At,Yt,Ot.map(function(dn){return dn.key}).join("_"),pn])}function xe(_e){var Pe;return _e instanceof Map?(Pe={},_e.forEach(function(De,Te){Pe[Te]=De})):Pe=_e,JSON.stringify(Pe)}var ht="TABS_DQ";function nn(_e){return String(_e).replace(/"/g,ht)}function Ut(_e,Pe,De,Te){return!(!De||Te||_e===!1||_e===void 0&&(Pe===!1||Pe===null))}function Xe(_e,Pe){var De=_e.prefixCls,Te=_e.editable,qe=_e.locale,dt=_e.style;return!Te||Te.showAdd===!1?null:Le.createElement("button",{ref:Pe,type:"button",className:"".concat(De,"-nav-add"),style:dt,"aria-label":(qe==null?void 0:qe.addAriaLabel)||"Add tab",onClick:function(Ot){Te.onEdit("add",{event:Ot})}},Te.addIcon||"+")}var Ye=Le.forwardRef(Xe),Dt=Le.forwardRef(function(_e,Pe){var De=_e.position,Te=_e.prefixCls,qe=_e.extra;if(!qe)return null;var dt,Xt={};return(0,ze.Z)(qe)==="object"&&!Le.isValidElement(qe)?Xt=qe:Xt.right=qe,De==="right"&&(dt=Xt.right),De==="left"&&(dt=Xt.left),dt?Le.createElement("div",{className:"".concat(Te,"-extra-content"),ref:Pe},dt):null}),bn=Dt,tn=ue(31561),un=ue(15285),Vt=ue(10228);function Gt(_e,Pe){var De=_e.prefixCls,Te=_e.id,qe=_e.tabs,dt=_e.locale,Xt=_e.mobile,Ot=_e.moreIcon,Yt=Ot===void 0?"More":Ot,pn=_e.moreTransitionName,vn=_e.style,Sn=_e.className,At=_e.editable,dn=_e.tabBarGutter,rt=_e.rtl,Mt=_e.removeAriaLabel,Lt=_e.onTabClick,Pt=_e.getPopupContainer,an=_e.popupClassName,Et=(0,Le.useState)(!1),rn=(0,Me.Z)(Et,2),Be=rn[0],wt=rn[1],Ct=(0,Le.useState)(null),Nt=(0,Me.Z)(Ct,2),Tt=Nt[0],Ft=Nt[1],Ht="".concat(Te,"-more-popup"),gn="".concat(De,"-dropdown"),wn=Tt!==null?"".concat(Ht,"-").concat(Tt):null,Ln=dt==null?void 0:dt.dropdownAriaLabel;function zn(yr,Gn){yr.preventDefault(),yr.stopPropagation(),At.onEdit("remove",{key:Gn,event:yr})}var er=Le.createElement(un.ZP,{onClick:function(Gn){var Xn=Gn.key,br=Gn.domEvent;Lt(Xn,br),wt(!1)},prefixCls:"".concat(gn,"-menu"),id:Ht,tabIndex:-1,role:"listbox","aria-activedescendant":wn,selectedKeys:[Tt],"aria-label":Ln!==void 0?Ln:"expanded dropdown"},qe.map(function(yr){var Gn=yr.closable,Xn=yr.disabled,br=yr.closeIcon,ur=yr.key,Br=yr.label,Gr=Ut(Gn,br,At,Xn);return Le.createElement(un.sN,{key:ur,id:"".concat(Ht,"-").concat(ur),role:"option","aria-controls":Te&&"".concat(Te,"-panel-").concat(ur),disabled:Xn},Le.createElement("span",null,Br),Gr&&Le.createElement("button",{type:"button","aria-label":Mt||"remove",tabIndex:0,className:"".concat(gn,"-menu-item-remove"),onClick:function(_n){_n.stopPropagation(),zn(_n,ur)}},br||At.removeIcon||"\xD7"))}));function cr(yr){for(var Gn=qe.filter(function(Gr){return!Gr.disabled}),Xn=Gn.findIndex(function(Gr){return Gr.key===Tt})||0,br=Gn.length,ur=0;ur<br;ur+=1){Xn=(Xn+yr+br)%br;var Br=Gn[Xn];if(!Br.disabled){Ft(Br.key);return}}}function Un(yr){var Gn=yr.which;if(!Be){[Vt.Z.DOWN,Vt.Z.SPACE,Vt.Z.ENTER].includes(Gn)&&(wt(!0),yr.preventDefault());return}switch(Gn){case Vt.Z.UP:cr(-1),yr.preventDefault();break;case Vt.Z.DOWN:cr(1),yr.preventDefault();break;case Vt.Z.ESC:wt(!1);break;case Vt.Z.SPACE:case Vt.Z.ENTER:Tt!==null&&Lt(Tt,yr);break}}(0,Le.useEffect)(function(){var yr=document.getElementById(wn);yr&&yr.scrollIntoView&&yr.scrollIntoView(!1)},[Tt]),(0,Le.useEffect)(function(){Be||Ft(null)},[Be]);var In=(0,Ne.Z)({},rt?"marginRight":"marginLeft",dn);qe.length||(In.visibility="hidden",In.order=1);var fr=be()((0,Ne.Z)({},"".concat(gn,"-rtl"),rt)),tr=Xt?null:Le.createElement(tn.Z,{prefixCls:gn,overlay:er,trigger:["hover"],visible:qe.length?Be:!1,transitionName:pn,onVisibleChange:wt,overlayClassName:be()(fr,an),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:Pt},Le.createElement("button",{type:"button",className:"".concat(De,"-nav-more"),style:In,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Ht,id:"".concat(Te,"-more"),"aria-expanded":Be,onKeyDown:Un},Yt));return Le.createElement("div",{className:be()("".concat(De,"-nav-operations"),Sn),style:vn,ref:Pe},tr,Le.createElement(Ye,{prefixCls:De,locale:dt,editable:At}))}var Wt=Le.memo(Le.forwardRef(Gt),function(_e,Pe){return Pe.tabMoving});function ye(_e){var Pe,De=_e.prefixCls,Te=_e.id,qe=_e.active,dt=_e.tab,Xt=dt.key,Ot=dt.label,Yt=dt.disabled,pn=dt.closeIcon,vn=_e.closable,Sn=_e.renderWrapper,At=_e.removeAriaLabel,dn=_e.editable,rt=_e.onClick,Mt=_e.onFocus,Lt=_e.style,Pt="".concat(De,"-tab"),an=Ut(vn,pn,dn,Yt);function Et(wt){Yt||rt(wt)}function rn(wt){wt.preventDefault(),wt.stopPropagation(),dn.onEdit("remove",{key:Xt,event:wt})}var Be=Le.createElement("div",{key:Xt,"data-node-key":nn(Xt),className:be()(Pt,(Pe={},(0,Ne.Z)(Pe,"".concat(Pt,"-with-remove"),an),(0,Ne.Z)(Pe,"".concat(Pt,"-active"),qe),(0,Ne.Z)(Pe,"".concat(Pt,"-disabled"),Yt),Pe)),style:Lt,onClick:Et},Le.createElement("div",{role:"tab","aria-selected":qe,id:Te&&"".concat(Te,"-tab-").concat(Xt),className:"".concat(Pt,"-btn"),"aria-controls":Te&&"".concat(Te,"-panel-").concat(Xt),"aria-disabled":Yt,tabIndex:Yt?null:0,onClick:function(Ct){Ct.stopPropagation(),Et(Ct)},onKeyDown:function(Ct){[Vt.Z.SPACE,Vt.Z.ENTER].includes(Ct.which)&&(Ct.preventDefault(),Et(Ct))},onFocus:Mt},Ot),an&&Le.createElement("button",{type:"button","aria-label":At||"remove",tabIndex:0,className:"".concat(Pt,"-remove"),onClick:function(Ct){Ct.stopPropagation(),rn(Ct)}},pn||dn.removeIcon||"\xD7"));return Sn?Sn(Be):Be}var se=ye,oe=ue(16089),de=function(Pe){var De=Pe.activeTabOffset,Te=Pe.horizontal,qe=Pe.rtl,dt=Pe.indicatorSize,Xt=(0,Le.useState)(),Ot=(0,Me.Z)(Xt,2),Yt=Ot[0],pn=Ot[1],vn=(0,Le.useRef)(),Sn=function(rt){return typeof dt=="function"?dt(rt):typeof dt=="number"?dt:rt};function At(){oe.Z.cancel(vn.current)}return(0,Le.useEffect)(function(){var dn={};return De&&(Te?(qe?(dn.right=De.right+De.width/2,dn.transform="translateX(50%)"):(dn.left=De.left+De.width/2,dn.transform="translateX(-50%)"),dn.width=Sn(De.width)):(dn.top=De.top+De.height/2,dn.transform="translateY(-50%)",dn.height=Sn(De.height))),At(),vn.current=(0,oe.Z)(function(){pn(dn)}),At},[De,Te,qe,dt]),{style:Yt}},fe=de,le=function(Pe){var De=Pe.current||{},Te=De.offsetWidth,qe=Te===void 0?0:Te,dt=De.offsetHeight,Xt=dt===void 0?0:dt;return[qe,Xt]},Ie=function(Pe,De){return Pe[De?0:1]};function it(_e,Pe){var De,Te=Le.useContext(pt),qe=Te.prefixCls,dt=Te.tabs,Xt=_e.className,Ot=_e.style,Yt=_e.id,pn=_e.animated,vn=_e.activeKey,Sn=_e.rtl,At=_e.extra,dn=_e.editable,rt=_e.locale,Mt=_e.tabPosition,Lt=_e.tabBarGutter,Pt=_e.children,an=_e.onTabClick,Et=_e.onTabScroll,rn=_e.indicatorSize,Be=(0,Le.useRef)(),wt=(0,Le.useRef)(),Ct=(0,Le.useRef)(),Nt=(0,Le.useRef)(),Tt=(0,Le.useRef)(),Ft=(0,Le.useRef)(),Ht=(0,Le.useRef)(),gn=Mt==="top"||Mt==="bottom",wn=Ve(0,function(wi,vi){gn&&Et&&Et({direction:wi>vi?"left":"right"})}),Ln=(0,Me.Z)(wn,2),zn=Ln[0],er=Ln[1],cr=Ve(0,function(wi,vi){!gn&&Et&&Et({direction:wi>vi?"top":"bottom"})}),Un=(0,Me.Z)(cr,2),In=Un[0],fr=Un[1],tr=(0,Le.useState)([0,0]),yr=(0,Me.Z)(tr,2),Gn=yr[0],Xn=yr[1],br=(0,Le.useState)([0,0]),ur=(0,Me.Z)(br,2),Br=ur[0],Gr=ur[1],ar=(0,Le.useState)([0,0]),_n=(0,Me.Z)(ar,2),Mn=_n[0],gr=_n[1],nr=(0,Le.useState)([0,0]),kr=(0,Me.Z)(nr,2),Lr=kr[0],Ir=kr[1],pr=Rt(new Map),Sr=(0,Me.Z)(pr,2),ii=Sr[0],Hn=Sr[1],qn=bt(dt,ii,Br[0]),Dr=Ie(Gn,gn),$r=Ie(Br,gn),li=Ie(Mn,gn),di=Ie(Lr,gn),ri=Dr<$r+li,Jr=ri?Dr-di:Dr-li,yi="".concat(qe,"-nav-operations-hidden"),bi=0,Yn=0;gn&&Sn?(bi=0,Yn=Math.max(0,$r-Jr)):(bi=Math.min(0,Jr-$r),Yn=0);function Vn(wi){return wi<bi?bi:wi>Yn?Yn:wi}var Zn=(0,Le.useRef)(),mr=(0,Le.useState)(),ni=(0,Me.Z)(mr,2),xi=ni[0],Mi=ni[1];function gi(){Mi(Date.now())}function ci(){window.clearTimeout(Zn.current)}zt(Nt,function(wi,vi){function Gi(ca,sa){ca(function(ta){var ts=Vn(ta+sa);return ts})}return ri?(gn?Gi(er,wi):Gi(fr,vi),ci(),gi(),!0):!1}),(0,Le.useEffect)(function(){return ci(),xi&&(Zn.current=window.setTimeout(function(){Mi(0)},100)),ci},[xi]);var _i=$e(qn,Jr,gn?zn:In,$r,li,di,(0,Ce.Z)((0,Ce.Z)({},_e),{},{tabs:dt})),Hi=(0,Me.Z)(_i,2),Ni=Hi[0],oa=Hi[1],Xr=(0,ke.Z)(function(){var wi=arguments.length>0&&arguments[0]!==void 0?arguments[0]:vn,vi=qn.get(wi)||{width:0,height:0,left:0,right:0,top:0};if(gn){var Gi=zn;Sn?vi.right<zn?Gi=vi.right:vi.right+vi.width>zn+Jr&&(Gi=vi.right+vi.width-Jr):vi.left<-zn?Gi=-vi.left:vi.left+vi.width>-zn+Jr&&(Gi=-(vi.left+vi.width-Jr)),fr(0),er(Vn(Gi))}else{var ca=In;vi.top<-In?ca=-vi.top:vi.top+vi.height>-In+Jr&&(ca=-(vi.top+vi.height-Jr)),er(0),fr(Vn(ca))}}),ei={};Mt==="top"||Mt==="bottom"?ei[Sn?"marginRight":"marginLeft"]=Lt:ei.marginTop=Lt;var Ai=dt.map(function(wi,vi){var Gi=wi.key;return Le.createElement(se,{id:Yt,prefixCls:qe,key:Gi,tab:wi,style:vi===0?void 0:ei,closable:wi.closable,editable:dn,active:Gi===vn,renderWrapper:Pt,removeAriaLabel:rt==null?void 0:rt.removeAriaLabel,onClick:function(sa){an(Gi,sa)},onFocus:function(){Xr(Gi),gi(),Nt.current&&(Sn||(Nt.current.scrollLeft=0),Nt.current.scrollTop=0)}})}),ai=function(){return Hn(function(){var vi=new Map;return dt.forEach(function(Gi){var ca,sa=Gi.key,ta=(ca=Tt.current)===null||ca===void 0?void 0:ca.querySelector('[data-node-key="'.concat(nn(sa),'"]'));ta&&vi.set(sa,{width:ta.offsetWidth,height:ta.offsetHeight,left:ta.offsetLeft,top:ta.offsetTop})}),vi})};(0,Le.useEffect)(function(){ai()},[dt.map(function(wi){return wi.key}).join("_")]);var fi=It(function(){var wi=le(Be),vi=le(wt),Gi=le(Ct);Xn([wi[0]-vi[0]-Gi[0],wi[1]-vi[1]-Gi[1]]);var ca=le(Ht);gr(ca);var sa=le(Ft);Ir(sa);var ta=le(Tt);Gr([ta[0]-ca[0],ta[1]-ca[1]]),ai()}),ki=dt.slice(0,Ni),pi=dt.slice(oa+1),Pr=[].concat((0,ft.Z)(ki),(0,ft.Z)(pi)),Yr=qn.get(vn),Ur=fe({activeTabOffset:Yr,horizontal:gn,rtl:Sn,indicatorSize:rn}),zr=Ur.style;(0,Le.useEffect)(function(){Xr()},[vn,bi,Yn,xe(Yr),xe(qn),gn]),(0,Le.useEffect)(function(){fi()},[Sn]);var ui=!!Pr.length,oi="".concat(qe,"-nav-wrap"),zi,Wi,Zi,na;return gn?Sn?(Wi=zn>0,zi=zn!==Yn):(zi=zn<0,Wi=zn!==bi):(Zi=In<0,na=In!==bi),Le.createElement(Ze.Z,{onResize:fi},Le.createElement("div",{ref:(0,He.x1)(Pe,Be),role:"tablist",className:be()("".concat(qe,"-nav"),Xt),style:Ot,onKeyDown:function(){gi()}},Le.createElement(bn,{ref:wt,position:"left",extra:At,prefixCls:qe}),Le.createElement(Ze.Z,{onResize:fi},Le.createElement("div",{className:be()(oi,(De={},(0,Ne.Z)(De,"".concat(oi,"-ping-left"),zi),(0,Ne.Z)(De,"".concat(oi,"-ping-right"),Wi),(0,Ne.Z)(De,"".concat(oi,"-ping-top"),Zi),(0,Ne.Z)(De,"".concat(oi,"-ping-bottom"),na),De)),ref:Nt},Le.createElement(Ze.Z,{onResize:fi},Le.createElement("div",{ref:Tt,className:"".concat(qe,"-nav-list"),style:{transform:"translate(".concat(zn,"px, ").concat(In,"px)"),transition:xi?"none":void 0}},Ai,Le.createElement(Ye,{ref:Ht,prefixCls:qe,locale:rt,editable:dn,style:(0,Ce.Z)((0,Ce.Z)({},Ai.length===0?void 0:ei),{},{visibility:ui?"hidden":null})}),Le.createElement("div",{className:be()("".concat(qe,"-ink-bar"),(0,Ne.Z)({},"".concat(qe,"-ink-bar-animated"),pn.inkBar)),style:zr}))))),Le.createElement(Wt,(0,Ae.Z)({},_e,{removeAriaLabel:rt==null?void 0:rt.removeAriaLabel,ref:Ft,prefixCls:qe,tabs:Pr,className:!ui&&yi,tabMoving:!!xi})),Le.createElement(bn,{ref:Ct,position:"right",extra:At,prefixCls:qe})))}var Kt=Le.forwardRef(it),$t=["renderTabBar"],Jt=["label","key"];function qt(_e){var Pe=_e.renderTabBar,De=(0,ut.Z)(_e,$t),Te=Le.useContext(pt),qe=Te.tabs;if(Pe){var dt=(0,Ce.Z)((0,Ce.Z)({},De),{},{panes:qe.map(function(Xt){var Ot=Xt.label,Yt=Xt.key,pn=(0,ut.Z)(Xt,Jt);return Le.createElement(St,(0,Ae.Z)({tab:Ot,key:Yt,tabKey:Yt},pn))})});return Pe(dt,Kt)}return Le.createElement(Kt,De)}var on=ue(48736);function mn(){var _e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},Pe;return _e===!1?Pe={inkBar:!1,tabPane:!1}:_e===!0?Pe={inkBar:!0,tabPane:!1}:Pe=(0,Ce.Z)({inkBar:!0},(0,ze.Z)(_e)==="object"?_e:{}),Pe.tabPaneMotion&&Pe.tabPane===void 0&&(Pe.tabPane=!0),!Pe.tabPaneMotion&&Pe.tabPane&&(Pe.tabPane=!1),Pe}var Cn=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicatorSize"],xt=0;function hn(_e,Pe){var De,Te=_e.id,qe=_e.prefixCls,dt=qe===void 0?"rc-tabs":qe,Xt=_e.className,Ot=_e.items,Yt=_e.direction,pn=_e.activeKey,vn=_e.defaultActiveKey,Sn=_e.editable,At=_e.animated,dn=_e.tabPosition,rt=dn===void 0?"top":dn,Mt=_e.tabBarGutter,Lt=_e.tabBarStyle,Pt=_e.tabBarExtraContent,an=_e.locale,Et=_e.moreIcon,rn=_e.moreTransitionName,Be=_e.destroyInactiveTabPane,wt=_e.renderTabBar,Ct=_e.onChange,Nt=_e.onTabClick,Tt=_e.onTabScroll,Ft=_e.getPopupContainer,Ht=_e.popupClassName,gn=_e.indicatorSize,wn=(0,ut.Z)(_e,Cn),Ln=Le.useMemo(function(){return(Ot||[]).filter(function(Ir){return Ir&&(0,ze.Z)(Ir)==="object"&&"key"in Ir})},[Ot]),zn=Yt==="rtl",er=mn(At),cr=(0,Le.useState)(!1),Un=(0,Me.Z)(cr,2),In=Un[0],fr=Un[1];(0,Le.useEffect)(function(){fr((0,We.Z)())},[]);var tr=(0,yt.Z)(function(){var Ir;return(Ir=Ln[0])===null||Ir===void 0?void 0:Ir.key},{value:pn,defaultValue:vn}),yr=(0,Me.Z)(tr,2),Gn=yr[0],Xn=yr[1],br=(0,Le.useState)(function(){return Ln.findIndex(function(Ir){return Ir.key===Gn})}),ur=(0,Me.Z)(br,2),Br=ur[0],Gr=ur[1];(0,Le.useEffect)(function(){var Ir=Ln.findIndex(function(Sr){return Sr.key===Gn});if(Ir===-1){var pr;Ir=Math.max(0,Math.min(Br,Ln.length-1)),Xn((pr=Ln[Ir])===null||pr===void 0?void 0:pr.key)}Gr(Ir)},[Ln.map(function(Ir){return Ir.key}).join("_"),Gn,Br]);var ar=(0,yt.Z)(null,{value:Te}),_n=(0,Me.Z)(ar,2),Mn=_n[0],gr=_n[1];(0,Le.useEffect)(function(){Te||(gr("rc-tabs-".concat(xt)),xt+=1)},[]);function nr(Ir,pr){Nt==null||Nt(Ir,pr);var Sr=Ir!==Gn;Xn(Ir),Sr&&(Ct==null||Ct(Ir))}var kr={id:Mn,activeKey:Gn,animated:er,tabPosition:rt,rtl:zn,mobile:In},Lr=(0,Ce.Z)((0,Ce.Z)({},kr),{},{editable:Sn,locale:an,moreIcon:Et,moreTransitionName:rn,tabBarGutter:Mt,onTabClick:nr,onTabScroll:Tt,extra:Pt,style:Lt,panes:null,getPopupContainer:Ft,popupClassName:Ht,indicatorSize:gn});return Le.createElement(pt.Provider,{value:{tabs:Ln,prefixCls:dt}},Le.createElement("div",(0,Ae.Z)({ref:Pe,id:Te,className:be()(dt,"".concat(dt,"-").concat(rt),(De={},(0,Ne.Z)(De,"".concat(dt,"-mobile"),In),(0,Ne.Z)(De,"".concat(dt,"-editable"),Sn),(0,Ne.Z)(De,"".concat(dt,"-rtl"),zn),De),Xt)},wn),Le.createElement(qt,(0,Ae.Z)({},Lr,{renderTabBar:wt})),Le.createElement(nt,(0,Ae.Z)({destroyInactiveTabPane:Be},kr,{animated:er}))))}var On=Le.forwardRef(hn),tt=On,Fe=tt,Ge=ue(36355),Zt=ue(19716),ln=()=>null,Dn=ue(62892);const Tn={motionAppear:!1,motionEnter:!0,motionLeave:!0};function En(_e){let Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},De;return Pe===!1?De={inkBar:!1,tabPane:!1}:Pe===!0?De={inkBar:!0,tabPane:!0}:De=Object.assign({inkBar:!0},typeof Pe=="object"?Pe:{}),De.tabPane&&(De.tabPaneMotion=Object.assign(Object.assign({},Tn),{motionName:(0,Dn.m)(_e,"switch")})),De}var Fn=ue(11592),jn=function(_e,Pe){var De={};for(var Te in _e)Object.prototype.hasOwnProperty.call(_e,Te)&&Pe.indexOf(Te)<0&&(De[Te]=_e[Te]);if(_e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var qe=0,Te=Object.getOwnPropertySymbols(_e);qe<Te.length;qe++)Pe.indexOf(Te[qe])<0&&Object.prototype.propertyIsEnumerable.call(_e,Te[qe])&&(De[Te[qe]]=_e[Te[qe]]);return De};function An(_e){return _e.filter(Pe=>Pe)}function hr(_e,Pe){if(_e)return _e;const De=(0,Fn.Z)(Pe).map(Te=>{if(Le.isValidElement(Te)){const{key:qe,props:dt}=Te,Xt=dt||{},{tab:Ot}=Xt,Yt=jn(Xt,["tab"]);return Object.assign(Object.assign({key:String(qe)},Yt),{label:Ot})}return null});return An(De)}var _r=ue(17313),Tr=ue(83116),Hr=ue(37613),sr=ue(13826),rr=_e=>{const{componentCls:Pe,motionDurationSlow:De}=_e;return[{[Pe]:{[`${Pe}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${De}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${De}`}}}}},[(0,sr.oN)(_e,"slide-up"),(0,sr.oN)(_e,"slide-down")]]};const Or=_e=>{const{componentCls:Pe,tabsCardPadding:De,cardBg:Te,cardGutter:qe,colorBorderSecondary:dt,itemSelectedColor:Xt}=_e;return{[`${Pe}-card`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{[`${Pe}-tab`]:{margin:0,padding:De,background:Te,border:`${_e.lineWidth}px ${_e.lineType} ${dt}`,transition:`all ${_e.motionDurationSlow} ${_e.motionEaseInOut}`},[`${Pe}-tab-active`]:{color:Xt,background:_e.colorBgContainer},[`${Pe}-ink-bar`]:{visibility:"hidden"}},[`&${Pe}-top, &${Pe}-bottom`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{[`${Pe}-tab + ${Pe}-tab`]:{marginLeft:{_skip_check_:!0,value:`${qe}px`}}}},[`&${Pe}-top`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{[`${Pe}-tab`]:{borderRadius:`${_e.borderRadiusLG}px ${_e.borderRadiusLG}px 0 0`},[`${Pe}-tab-active`]:{borderBottomColor:_e.colorBgContainer}}},[`&${Pe}-bottom`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{[`${Pe}-tab`]:{borderRadius:`0 0 ${_e.borderRadiusLG}px ${_e.borderRadiusLG}px`},[`${Pe}-tab-active`]:{borderTopColor:_e.colorBgContainer}}},[`&${Pe}-left, &${Pe}-right`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{[`${Pe}-tab + ${Pe}-tab`]:{marginTop:`${qe}px`}}},[`&${Pe}-left`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{[`${Pe}-tab`]:{borderRadius:{_skip_check_:!0,value:`${_e.borderRadiusLG}px 0 0 ${_e.borderRadiusLG}px`}},[`${Pe}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:_e.colorBgContainer}}}},[`&${Pe}-right`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{[`${Pe}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${_e.borderRadiusLG}px ${_e.borderRadiusLG}px 0`}},[`${Pe}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:_e.colorBgContainer}}}}}}},Fr=_e=>{const{componentCls:Pe,itemHoverColor:De,dropdownEdgeChildVerticalPadding:Te}=_e;return{[`${Pe}-dropdown`]:Object.assign(Object.assign({},(0,_r.Wf)(_e)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:_e.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${Pe}-dropdown-menu`]:{maxHeight:_e.tabsDropdownHeight,margin:0,padding:`${Te}px 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:_e.colorBgContainer,backgroundClip:"padding-box",borderRadius:_e.borderRadiusLG,outline:"none",boxShadow:_e.boxShadowSecondary,"&-item":Object.assign(Object.assign({},_r.vS),{display:"flex",alignItems:"center",minWidth:_e.tabsDropdownWidth,margin:0,padding:`${_e.paddingXXS}px ${_e.paddingSM}px`,color:_e.colorText,fontWeight:"normal",fontSize:_e.fontSize,lineHeight:_e.lineHeight,cursor:"pointer",transition:`all ${_e.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:_e.marginSM},color:_e.colorTextDescription,fontSize:_e.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:De}},"&:hover":{background:_e.controlItemBgHover},"&-disabled":{"&, &:hover":{color:_e.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},Er=_e=>{const{componentCls:Pe,margin:De,colorBorderSecondary:Te,horizontalMargin:qe,verticalItemPadding:dt,verticalItemMargin:Xt}=_e;return{[`${Pe}-top, ${Pe}-bottom`]:{flexDirection:"column",[`> ${Pe}-nav, > div > ${Pe}-nav`]:{margin:qe,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${_e.lineWidth}px ${_e.lineType} ${Te}`,content:"''"},[`${Pe}-ink-bar`]:{height:_e.lineWidthBold,"&-animated":{transition:`width ${_e.motionDurationSlow}, left ${_e.motionDurationSlow},
|
|
|
right ${_e.motionDurationSlow}`}},[`${Pe}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:_e.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:_e.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:_e.boxShadowTabsOverflowRight},[`&${Pe}-nav-wrap-ping-left::before`]:{opacity:1},[`&${Pe}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${Pe}-top`]:{[`> ${Pe}-nav,
|
|
|
> div > ${Pe}-nav`]:{"&::before":{bottom:0},[`${Pe}-ink-bar`]:{bottom:0}}},[`${Pe}-bottom`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{order:1,marginTop:`${De}px`,marginBottom:0,"&::before":{top:0},[`${Pe}-ink-bar`]:{top:0}},[`> ${Pe}-content-holder, > div > ${Pe}-content-holder`]:{order:0}},[`${Pe}-left, ${Pe}-right`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{flexDirection:"column",minWidth:_e.controlHeight*1.25,[`${Pe}-tab`]:{padding:dt,textAlign:"center"},[`${Pe}-tab + ${Pe}-tab`]:{margin:Xt},[`${Pe}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:_e.controlHeight},"&::before":{top:0,boxShadow:_e.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:_e.boxShadowTabsOverflowBottom},[`&${Pe}-nav-wrap-ping-top::before`]:{opacity:1},[`&${Pe}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${Pe}-ink-bar`]:{width:_e.lineWidthBold,"&-animated":{transition:`height ${_e.motionDurationSlow}, top ${_e.motionDurationSlow}`}},[`${Pe}-nav-list, ${Pe}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${Pe}-left`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{[`${Pe}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${Pe}-content-holder, > div > ${Pe}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${_e.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${_e.lineWidth}px ${_e.lineType} ${_e.colorBorder}`},[`> ${Pe}-content > ${Pe}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:_e.paddingLG}}}},[`${Pe}-right`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{order:1,[`${Pe}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${Pe}-content-holder, > div > ${Pe}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-_e.lineWidth},borderRight:{_skip_check_:!0,value:`${_e.lineWidth}px ${_e.lineType} ${_e.colorBorder}`},[`> ${Pe}-content > ${Pe}-tabpane`]:{paddingRight:{_skip_check_:!0,value:_e.paddingLG}}}}}},jr=_e=>{const{componentCls:Pe,cardPaddingSM:De,cardPaddingLG:Te,horizontalItemPaddingSM:qe,horizontalItemPaddingLG:dt}=_e;return{[Pe]:{"&-small":{[`> ${Pe}-nav`]:{[`${Pe}-tab`]:{padding:qe,fontSize:_e.titleFontSizeSM}}},"&-large":{[`> ${Pe}-nav`]:{[`${Pe}-tab`]:{padding:dt,fontSize:_e.titleFontSizeLG}}}},[`${Pe}-card`]:{[`&${Pe}-small`]:{[`> ${Pe}-nav`]:{[`${Pe}-tab`]:{padding:De}},[`&${Pe}-bottom`]:{[`> ${Pe}-nav ${Pe}-tab`]:{borderRadius:`0 0 ${_e.borderRadius}px ${_e.borderRadius}px`}},[`&${Pe}-top`]:{[`> ${Pe}-nav ${Pe}-tab`]:{borderRadius:`${_e.borderRadius}px ${_e.borderRadius}px 0 0`}},[`&${Pe}-right`]:{[`> ${Pe}-nav ${Pe}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${_e.borderRadius}px ${_e.borderRadius}px 0`}}},[`&${Pe}-left`]:{[`> ${Pe}-nav ${Pe}-tab`]:{borderRadius:{_skip_check_:!0,value:`${_e.borderRadius}px 0 0 ${_e.borderRadius}px`}}}},[`&${Pe}-large`]:{[`> ${Pe}-nav`]:{[`${Pe}-tab`]:{padding:Te}}}}}},Nr=_e=>{const{componentCls:Pe,itemActiveColor:De,itemHoverColor:Te,iconCls:qe,tabsHorizontalItemMargin:dt,horizontalItemPadding:Xt,itemSelectedColor:Ot,itemColor:Yt}=_e,pn=`${Pe}-tab`;return{[pn]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:Xt,fontSize:_e.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:Yt,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:De}},(0,_r.Qy)(_e)),"&-btn":{outline:"none",transition:"all 0.3s"},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:-_e.marginXXS},marginLeft:{_skip_check_:!0,value:_e.marginXS},color:_e.colorTextDescription,fontSize:_e.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${_e.motionDurationSlow}`,"&:hover":{color:_e.colorTextHeading}},"&:hover":{color:Te},[`&${pn}-active ${pn}-btn`]:{color:Ot,textShadow:_e.tabsActiveTextShadow},[`&${pn}-disabled`]:{color:_e.colorTextDisabled,cursor:"not-allowed"},[`&${pn}-disabled ${pn}-btn, &${pn}-disabled ${Pe}-remove`]:{"&:focus, &:active":{color:_e.colorTextDisabled}},[`& ${pn}-remove ${qe}`]:{margin:0},[qe]:{marginRight:{_skip_check_:!0,value:_e.marginSM}}},[`${pn} + ${pn}`]:{margin:{_skip_check_:!0,value:dt}}}},Jn=_e=>{const{componentCls:Pe,tabsHorizontalItemMarginRTL:De,iconCls:Te,cardGutter:qe}=_e;return{[`${Pe}-rtl`]:{direction:"rtl",[`${Pe}-nav`]:{[`${Pe}-tab`]:{margin:{_skip_check_:!0,value:De},[`${Pe}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[Te]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${_e.marginSM}px`}},[`${Pe}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${_e.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${_e.marginXXS}px`},[Te]:{margin:0}}}},[`&${Pe}-left`]:{[`> ${Pe}-nav`]:{order:1},[`> ${Pe}-content-holder`]:{order:0}},[`&${Pe}-right`]:{[`> ${Pe}-nav`]:{order:0},[`> ${Pe}-content-holder`]:{order:1}},[`&${Pe}-card${Pe}-top, &${Pe}-card${Pe}-bottom`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{[`${Pe}-tab + ${Pe}-tab`]:{marginRight:{_skip_check_:!0,value:qe},marginLeft:{_skip_check_:!0,value:0}}}}},[`${Pe}-dropdown-rtl`]:{direction:"rtl"},[`${Pe}-menu-item`]:{[`${Pe}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},lr=_e=>{const{componentCls:Pe,tabsCardPadding:De,cardHeight:Te,cardGutter:qe,itemHoverColor:dt,itemActiveColor:Xt,colorBorderSecondary:Ot}=_e;return{[Pe]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,_r.Wf)(_e)),{display:"flex",[`> ${Pe}-nav, > div > ${Pe}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${Pe}-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 ${_e.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${Pe}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${_e.motionDurationSlow}`},[`${Pe}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${Pe}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${Pe}-nav-more`]:{position:"relative",padding:De,background:"transparent",border:0,color:_e.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:_e.controlHeightLG/8,transform:"translateY(100%)",content:"''"}},[`${Pe}-nav-add`]:Object.assign({minWidth:Te,marginLeft:{_skip_check_:!0,value:qe},padding:`0 ${_e.paddingXS}px`,background:"transparent",border:`${_e.lineWidth}px ${_e.lineType} ${Ot}`,borderRadius:`${_e.borderRadiusLG}px ${_e.borderRadiusLG}px 0 0`,outline:"none",cursor:"pointer",color:_e.colorText,transition:`all ${_e.motionDurationSlow} ${_e.motionEaseInOut}`,"&:hover":{color:dt},"&:active, &:focus:not(:focus-visible)":{color:Xt}},(0,_r.Qy)(_e))},[`${Pe}-extra-content`]:{flex:"none"},[`${Pe}-ink-bar`]:{position:"absolute",background:_e.inkBarColor,pointerEvents:"none"}}),Nr(_e)),{[`${Pe}-content`]:{position:"relative",width:"100%"},[`${Pe}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${Pe}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${Pe}-centered`]:{[`> ${Pe}-nav, > div > ${Pe}-nav`]:{[`${Pe}-nav-wrap`]:{[`&:not([class*='${Pe}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}};var Rn=(0,Tr.Z)("Tabs",_e=>{const Pe=(0,Hr.TS)(_e,{tabsCardPadding:_e.cardPadding||`${(_e.cardHeight-Math.round(_e.fontSize*_e.lineHeight))/2-_e.lineWidth}px ${_e.padding}px`,dropdownEdgeChildVerticalPadding:_e.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${_e.horizontalItemGutter}px`,tabsHorizontalItemMarginRTL:`0 0 0 ${_e.horizontalItemGutter}px`});return[jr(Pe),Jn(Pe),Er(Pe),Fr(Pe),Or(Pe),lr(Pe),rr(Pe)]},_e=>{const Pe=_e.controlHeightLG;return{zIndexPopup:_e.zIndexPopupBase+50,cardBg:_e.colorFillAlter,cardHeight:Pe,cardPadding:"",cardPaddingSM:`${_e.paddingXXS*1.5}px ${_e.padding}px`,cardPaddingLG:`${_e.paddingXS}px ${_e.padding}px ${_e.paddingXXS*1.5}px`,titleFontSize:_e.fontSize,titleFontSizeLG:_e.fontSizeLG,titleFontSizeSM:_e.fontSize,inkBarColor:_e.colorPrimary,horizontalMargin:`0 0 ${_e.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${_e.paddingSM}px 0`,horizontalItemPaddingSM:`${_e.paddingXS}px 0`,horizontalItemPaddingLG:`${_e.padding}px 0`,verticalItemPadding:`${_e.paddingXS}px ${_e.paddingLG}px`,verticalItemMargin:`${_e.margin}px 0 0 0`,itemColor:_e.colorText,itemSelectedColor:_e.colorPrimary,itemHoverColor:_e.colorPrimaryHover,itemActiveColor:_e.colorPrimaryActive,cardGutter:_e.marginXXS/2}}),$n=function(_e,Pe){var De={};for(var Te in _e)Object.prototype.hasOwnProperty.call(_e,Te)&&Pe.indexOf(Te)<0&&(De[Te]=_e[Te]);if(_e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var qe=0,Te=Object.getOwnPropertySymbols(_e);qe<Te.length;qe++)Pe.indexOf(Te[qe])<0&&Object.prototype.propertyIsEnumerable.call(_e,Te[qe])&&(De[Te[qe]]=_e[Te[qe]]);return De};const wr=_e=>{const{type:Pe,className:De,rootClassName:Te,size:qe,onEdit:dt,hideAdd:Xt,centered:Ot,addIcon:Yt,popupClassName:pn,children:vn,items:Sn,animated:At,style:dn,indicatorSize:rt}=_e,Mt=$n(_e,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize"]),{prefixCls:Lt,moreIcon:Pt=Le.createElement(je.Z,null)}=Mt,{direction:an,tabs:Et,getPrefixCls:rn,getPopupContainer:Be}=Le.useContext(Ge.E_),wt=rn("tabs",Lt),[Ct,Nt]=Rn(wt);let Tt;Pe==="editable-card"&&(Tt={onEdit:(zn,er)=>{let{key:cr,event:Un}=er;dt==null||dt(zn==="add"?Un:cr,zn)},removeIcon:Le.createElement(me.Z,null),addIcon:Yt||Le.createElement(Ke.Z,null),showAdd:Xt!==!0});const Ft=rn(),Ht=hr(Sn,vn),gn=En(wt,At),wn=(0,Zt.Z)(qe),Ln=Object.assign(Object.assign({},Et==null?void 0:Et.style),dn);return Ct(Le.createElement(Fe,Object.assign({direction:an,getPopupContainer:Be,moreTransitionName:`${Ft}-slide-up`},Mt,{items:Ht,className:be()({[`${wt}-${wn}`]:wn,[`${wt}-card`]:["card","editable-card"].includes(Pe),[`${wt}-editable-card`]:Pe==="editable-card",[`${wt}-centered`]:Ot},Et==null?void 0:Et.className,De,Te,Nt),popupClassName:be()(pn,Nt),style:Ln,editable:Tt,moreIcon:Pt,prefixCls:wt,animated:gn,indicatorSize:rt!=null?rt:Et==null?void 0:Et.indicatorSize})))};wr.TabPane=ln;var lt=wr},54580:function(kn,cn,ue){"use strict";ue.d(cn,{default:function(){return dn}});var me=ue(59301),je=ue(77654),Ke=ue(92310),ot=ue.n(Ke),be=ue(60499),Ae=ue(38705),Ne=ue(17212),Ce=ue(39153),Me=ue(55401),ze=ue(18642),ut=ue(42244),Le=ue(73001),We=ue(43749),yt=ue(11576),et=ue(26112);function pt(rt,Mt){var Lt="cannot ".concat(rt.method," ").concat(rt.action," ").concat(Mt.status,"'"),Pt=new Error(Lt);return Pt.status=Mt.status,Pt.method=rt.method,Pt.url=rt.action,Pt}function at(rt){var Mt=rt.responseText||rt.response;if(!Mt)return Mt;try{return JSON.parse(Mt)}catch(Lt){return Mt}}function St(rt){var Mt=new XMLHttpRequest;rt.onProgress&&Mt.upload&&(Mt.upload.onprogress=function(Et){Et.total>0&&(Et.percent=Et.loaded/Et.total*100),rt.onProgress(Et)});var Lt=new FormData;rt.data&&Object.keys(rt.data).forEach(function(an){var Et=rt.data[an];if(Array.isArray(Et)){Et.forEach(function(rn){Lt.append("".concat(an,"[]"),rn)});return}Lt.append(an,Et)}),rt.file instanceof Blob?Lt.append(rt.filename,rt.file,rt.file.name):Lt.append(rt.filename,rt.file),Mt.onerror=function(Et){rt.onError(Et)},Mt.onload=function(){return Mt.status<200||Mt.status>=300?rt.onError(pt(rt,Mt),at(Mt)):rt.onSuccess(at(Mt),Mt)},Mt.open(rt.method,rt.action,!0),rt.withCredentials&&"withCredentials"in Mt&&(Mt.withCredentials=!0);var Pt=rt.headers||{};return Pt["X-Requested-With"]!==null&&Mt.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(Pt).forEach(function(an){Pt[an]!==null&&Mt.setRequestHeader(an,Pt[an])}),Mt.send(Lt),{abort:function(){Mt.abort()}}}var Qt=+new Date,nt=0;function ft(){return"rc-upload-".concat(Qt,"-").concat(++nt)}var Ze=ue(48736),ke=function(rt,Mt){if(rt&&Mt){var Lt=Array.isArray(Mt)?Mt:Mt.split(","),Pt=rt.name||"",an=rt.type||"",Et=an.replace(/\/.*$/,"");return Lt.some(function(rn){var Be=rn.trim();if(/^\*(\/\*)?$/.test(rn))return!0;if(Be.charAt(0)==="."){var wt=Pt.toLowerCase(),Ct=Be.toLowerCase(),Nt=[Ct];return(Ct===".jpg"||Ct===".jpeg")&&(Nt=[".jpg",".jpeg"]),Nt.some(function(Tt){return wt.endsWith(Tt)})}return/\/\*$/.test(Be)?Et===Be.replace(/\/.*$/,""):an===Be?!0:/^\w+$/.test(Be)?((0,Ze.ZP)(!1,"Upload takes an invalidate 'accept' type '".concat(Be,"'.Skip for check.")),!0):!1})}return!0};function He(rt,Mt){var Lt=rt.createReader(),Pt=[];function an(){Lt.readEntries(function(Et){var rn=Array.prototype.slice.apply(Et);Pt=Pt.concat(rn);var Be=!rn.length;Be?Mt(Pt):an()})}an()}var Ue=function(Mt,Lt,Pt){var an=function Et(rn,Be){rn&&(rn.path=Be||"",rn.isFile?rn.file(function(wt){Pt(wt)&&(rn.fullPath&&!wt.webkitRelativePath&&(Object.defineProperties(wt,{webkitRelativePath:{writable:!0}}),wt.webkitRelativePath=rn.fullPath.replace(/^\//,""),Object.defineProperties(wt,{webkitRelativePath:{writable:!1}})),Lt([wt]))}):rn.isDirectory&&He(rn,function(wt){wt.forEach(function(Ct){Et(Ct,"".concat(Be).concat(rn.name,"/"))})}))};Mt.forEach(function(Et){an(Et.webkitGetAsEntry())})},bt=Ue,Ve=["component","prefixCls","className","disabled","id","style","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"],jt=function(rt){(0,Ce.Z)(Lt,rt);var Mt=(0,Me.Z)(Lt);function Lt(){var Pt;(0,Ae.Z)(this,Lt);for(var an=arguments.length,Et=new Array(an),rn=0;rn<an;rn++)Et[rn]=arguments[rn];return Pt=Mt.call.apply(Mt,[this].concat(Et)),Pt.state={uid:ft()},Pt.reqs={},Pt.fileInput=void 0,Pt._isMounted=void 0,Pt.onChange=function(Be){var wt=Pt.props,Ct=wt.accept,Nt=wt.directory,Tt=Be.target.files,Ft=(0,je.Z)(Tt).filter(function(Ht){return!Nt||ke(Ht,Ct)});Pt.uploadFiles(Ft),Pt.reset()},Pt.onClick=function(Be){var wt=Pt.fileInput;if(wt){var Ct=Be.target,Nt=Pt.props.onClick;if(Ct&&Ct.tagName==="BUTTON"){var Tt=wt.parentNode;Tt.focus(),Ct.blur()}wt.click(),Nt&&Nt(Be)}},Pt.onKeyDown=function(Be){Be.key==="Enter"&&Pt.onClick(Be)},Pt.onFileDrop=function(Be){var wt=Pt.props.multiple;if(Be.preventDefault(),Be.type!=="dragover")if(Pt.props.directory)bt(Array.prototype.slice.call(Be.dataTransfer.items),Pt.uploadFiles,function(Nt){return ke(Nt,Pt.props.accept)});else{var Ct=(0,je.Z)(Be.dataTransfer.files).filter(function(Nt){return ke(Nt,Pt.props.accept)});wt===!1&&(Ct=Ct.slice(0,1)),Pt.uploadFiles(Ct)}},Pt.uploadFiles=function(Be){var wt=(0,je.Z)(Be),Ct=wt.map(function(Nt){return Nt.uid=ft(),Pt.processFile(Nt,wt)});Promise.all(Ct).then(function(Nt){var Tt=Pt.props.onBatchStart;Tt==null||Tt(Nt.map(function(Ft){var Ht=Ft.origin,gn=Ft.parsedFile;return{file:Ht,parsedFile:gn}})),Nt.filter(function(Ft){return Ft.parsedFile!==null}).forEach(function(Ft){Pt.post(Ft)})})},Pt.processFile=function(){var Be=(0,yt.Z)((0,Le.Z)().mark(function wt(Ct,Nt){var Tt,Ft,Ht,gn,wn,Ln,zn,er,cr;return(0,Le.Z)().wrap(function(In){for(;;)switch(In.prev=In.next){case 0:if(Tt=Pt.props.beforeUpload,Ft=Ct,!Tt){In.next=14;break}return In.prev=3,In.next=6,Tt(Ct,Nt);case 6:Ft=In.sent,In.next=12;break;case 9:In.prev=9,In.t0=In.catch(3),Ft=!1;case 12:if(Ft!==!1){In.next=14;break}return In.abrupt("return",{origin:Ct,parsedFile:null,action:null,data:null});case 14:if(Ht=Pt.props.action,typeof Ht!="function"){In.next=21;break}return In.next=18,Ht(Ct);case 18:gn=In.sent,In.next=22;break;case 21:gn=Ht;case 22:if(wn=Pt.props.data,typeof wn!="function"){In.next=29;break}return In.next=26,wn(Ct);case 26:Ln=In.sent,In.next=30;break;case 29:Ln=wn;case 30:return zn=((0,We.Z)(Ft)==="object"||typeof Ft=="string")&&Ft?Ft:Ct,zn instanceof File?er=zn:er=new File([zn],Ct.name,{type:Ct.type}),cr=er,cr.uid=Ct.uid,In.abrupt("return",{origin:Ct,data:Ln,parsedFile:cr,action:gn});case 35:case"end":return In.stop()}},wt,null,[[3,9]])}));return function(wt,Ct){return Be.apply(this,arguments)}}(),Pt.saveFileInput=function(Be){Pt.fileInput=Be},Pt}return(0,Ne.Z)(Lt,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"post",value:function(an){var Et=this,rn=an.data,Be=an.origin,wt=an.action,Ct=an.parsedFile;if(this._isMounted){var Nt=this.props,Tt=Nt.onStart,Ft=Nt.customRequest,Ht=Nt.name,gn=Nt.headers,wn=Nt.withCredentials,Ln=Nt.method,zn=Be.uid,er=Ft||St,cr={action:wt,filename:Ht,data:rn,file:Ct,headers:gn,withCredentials:wn,method:Ln||"post",onProgress:function(In){var fr=Et.props.onProgress;fr==null||fr(In,Ct)},onSuccess:function(In,fr){var tr=Et.props.onSuccess;tr==null||tr(In,Ct,fr),delete Et.reqs[zn]},onError:function(In,fr){var tr=Et.props.onError;tr==null||tr(In,fr,Ct),delete Et.reqs[zn]}};Tt(Be),this.reqs[zn]=er(cr)}}},{key:"reset",value:function(){this.setState({uid:ft()})}},{key:"abort",value:function(an){var Et=this.reqs;if(an){var rn=an.uid?an.uid:an;Et[rn]&&Et[rn].abort&&Et[rn].abort(),delete Et[rn]}else Object.keys(Et).forEach(function(Be){Et[Be]&&Et[Be].abort&&Et[Be].abort(),delete Et[Be]})}},{key:"render",value:function(){var an=this.props,Et=an.component,rn=an.prefixCls,Be=an.className,wt=an.disabled,Ct=an.id,Nt=an.style,Tt=an.multiple,Ft=an.accept,Ht=an.capture,gn=an.children,wn=an.directory,Ln=an.openFileDialogOnClick,zn=an.onMouseEnter,er=an.onMouseLeave,cr=(0,ut.Z)(an,Ve),Un=ot()((0,ze.Z)((0,ze.Z)((0,ze.Z)({},rn,!0),"".concat(rn,"-disabled"),wt),Be,Be)),In=wn?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},fr=wt?{}:{onClick:Ln?this.onClick:function(){},onKeyDown:Ln?this.onKeyDown:function(){},onMouseEnter:zn,onMouseLeave:er,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return me.createElement(Et,(0,be.Z)({},fr,{className:Un,role:"button",style:Nt}),me.createElement("input",(0,be.Z)({},(0,et.Z)(cr,{aria:!0,data:!0}),{id:Ct,disabled:wt,type:"file",ref:this.saveFileInput,onClick:function(yr){return yr.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:Ft},In,{multiple:Tt,onChange:this.onChange},Ht!=null?{capture:Ht}:{})),gn)}}]),Lt}(me.Component),st=jt;function Bt(){}var Qe=function(rt){(0,Ce.Z)(Lt,rt);var Mt=(0,Me.Z)(Lt);function Lt(){var Pt;(0,Ae.Z)(this,Lt);for(var an=arguments.length,Et=new Array(an),rn=0;rn<an;rn++)Et[rn]=arguments[rn];return Pt=Mt.call.apply(Mt,[this].concat(Et)),Pt.uploader=void 0,Pt.saveUploader=function(Be){Pt.uploader=Be},Pt}return(0,Ne.Z)(Lt,[{key:"abort",value:function(an){this.uploader.abort(an)}},{key:"render",value:function(){return me.createElement(st,(0,be.Z)({},this.props,{ref:this.saveUploader}))}}]),Lt}(me.Component);Qe.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:Bt,onError:Bt,onSuccess:Bt,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var zt=Qe,ct=zt,It=ue(18929),Rt=ue(4676),mt=ue(36355),$e=ue(1684),xe=ue(9763),ht=ue(31724),nn={icon:function(Mt,Lt){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:Lt}},{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:Mt}}]}},name:"file",theme:"twotone"},Ut=nn,Xe=ue(7657),Ye=function(Mt,Lt){return me.createElement(Xe.Z,(0,be.Z)({},Mt,{ref:Lt,icon:Ut}))},Dt=me.forwardRef(Ye),bn=Dt,tn=ue(58617),un={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"},Vt=un,Gt=function(Mt,Lt){return me.createElement(Xe.Z,(0,be.Z)({},Mt,{ref:Lt,icon:Vt}))},Wt=me.forwardRef(Gt),ye=Wt,se={icon:function(Mt,Lt){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:Mt}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:Lt}},{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:Lt}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:Lt}},{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:Mt}}]}},name:"picture",theme:"twotone"},oe=se,de=function(Mt,Lt){return me.createElement(Xe.Z,(0,be.Z)({},Mt,{ref:Lt,icon:oe}))},fe=me.forwardRef(de),le=fe,Ie=ue(77900),it=ue(56762),Kt=ue(62892),$t=ue(92343),Jt=ue(3113);function qt(rt){return Object.assign(Object.assign({},rt),{lastModified:rt.lastModified,lastModifiedDate:rt.lastModifiedDate,name:rt.name,size:rt.size,type:rt.type,uid:rt.uid,percent:0,originFileObj:rt})}function on(rt,Mt){const Lt=(0,je.Z)(Mt),Pt=Lt.findIndex(an=>{let{uid:Et}=an;return Et===rt.uid});return Pt===-1?Lt.push(rt):Lt[Pt]=rt,Lt}function mn(rt,Mt){const Lt=rt.uid!==void 0?"uid":"name";return Mt.filter(Pt=>Pt[Lt]===rt[Lt])[0]}function Cn(rt,Mt){const Lt=rt.uid!==void 0?"uid":"name",Pt=Mt.filter(an=>an[Lt]!==rt[Lt]);return Pt.length===Mt.length?null:Pt}const xt=function(){const Mt=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"").split("/"),Pt=Mt[Mt.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(Pt)||[""])[0]},hn=rt=>rt.indexOf("image/")===0,On=rt=>{if(rt.type&&!rt.thumbUrl)return hn(rt.type);const Mt=rt.thumbUrl||rt.url||"",Lt=xt(Mt);return/^data:image\//.test(Mt)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(Lt)?!0:!(/^data:/.test(Mt)||Lt)},tt=200;function Fe(rt){return new Promise(Mt=>{if(!rt.type||!hn(rt.type)){Mt("");return}const Lt=document.createElement("canvas");Lt.width=tt,Lt.height=tt,Lt.style.cssText=`position: fixed; left: 0; top: 0; width: ${tt}px; height: ${tt}px; z-index: 9999; display: none;`,document.body.appendChild(Lt);const Pt=Lt.getContext("2d"),an=new Image;if(an.onload=()=>{const{width:Et,height:rn}=an;let Be=tt,wt=tt,Ct=0,Nt=0;Et>rn?(wt=rn*(tt/Et),Nt=-(wt-Be)/2):(Be=Et*(tt/rn),Ct=-(Be-wt)/2),Pt.drawImage(an,Ct,Nt,Be,wt);const Tt=Lt.toDataURL();document.body.removeChild(Lt),window.URL.revokeObjectURL(an.src),Mt(Tt)},an.crossOrigin="anonymous",rt.type.startsWith("image/svg+xml")){const Et=new FileReader;Et.onload=()=>{Et.result&&(an.src=Et.result)},Et.readAsDataURL(rt)}else if(rt.type.startsWith("image/gif")){const Et=new FileReader;Et.onload=()=>{Et.result&&Mt(Et.result)},Et.readAsDataURL(rt)}else an.src=window.URL.createObjectURL(rt)})}var Ge=ue(26227),Zt=ue(41464),en=ue(15277),ln=ue(93948),Dn=ue(6848),En=me.forwardRef((rt,Mt)=>{let{prefixCls:Lt,className:Pt,style:an,locale:Et,listType:rn,file:Be,items:wt,progress:Ct,iconRender:Nt,actionIconRender:Tt,itemRender:Ft,isImgUrl:Ht,showPreviewIcon:gn,showRemoveIcon:wn,showDownloadIcon:Ln,previewIcon:zn,removeIcon:er,downloadIcon:cr,onPreview:Un,onDownload:In,onClose:fr}=rt;var tr,yr;const{status:Gn}=Be,[Xn,br]=me.useState(Gn);me.useEffect(()=>{Gn!=="removed"&&br(Gn)},[Gn]);const[ur,Br]=me.useState(!1);me.useEffect(()=>{const di=setTimeout(()=>{Br(!0)},300);return()=>{clearTimeout(di)}},[]);const Gr=Nt(Be);let ar=me.createElement("div",{className:`${Lt}-icon`},Gr);if(rn==="picture"||rn==="picture-card"||rn==="picture-circle")if(Xn==="uploading"||!Be.thumbUrl&&!Be.url){const di=ot()(`${Lt}-list-item-thumbnail`,{[`${Lt}-list-item-file`]:Xn!=="uploading"});ar=me.createElement("div",{className:di},Gr)}else{const di=Ht!=null&&Ht(Be)?me.createElement("img",{src:Be.thumbUrl||Be.url,alt:Be.name,className:`${Lt}-list-item-image`,crossOrigin:Be.crossOrigin}):Gr,ri=ot()(`${Lt}-list-item-thumbnail`,{[`${Lt}-list-item-file`]:Ht&&!Ht(Be)});ar=me.createElement("a",{className:ri,onClick:Jr=>Un(Be,Jr),href:Be.url||Be.thumbUrl,target:"_blank",rel:"noopener noreferrer"},di)}const _n=ot()(`${Lt}-list-item`,`${Lt}-list-item-${Xn}`),Mn=typeof Be.linkProps=="string"?JSON.parse(Be.linkProps):Be.linkProps,gr=wn?Tt((typeof er=="function"?er(Be):er)||me.createElement(Ge.Z,null),()=>fr(Be),Lt,Et.removeFile):null,nr=Ln&&Xn==="done"?Tt((typeof cr=="function"?cr(Be):cr)||me.createElement(Zt.Z,null),()=>In(Be),Lt,Et.downloadFile):null,kr=rn!=="picture-card"&&rn!=="picture-circle"&&me.createElement("span",{key:"download-delete",className:ot()(`${Lt}-list-item-actions`,{picture:rn==="picture"})},nr,gr),Lr=ot()(`${Lt}-list-item-name`),Ir=Be.url?[me.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:Lr,title:Be.name},Mn,{href:Be.url,onClick:di=>Un(Be,di)}),Be.name),kr]:[me.createElement("span",{key:"view",className:Lr,onClick:di=>Un(Be,di),title:Be.name},Be.name),kr],pr={pointerEvents:"none",opacity:.5},Sr=gn?me.createElement("a",{href:Be.url||Be.thumbUrl,target:"_blank",rel:"noopener noreferrer",style:Be.url||Be.thumbUrl?void 0:pr,onClick:di=>Un(Be,di),title:Et.previewFile},typeof zn=="function"?zn(Be):zn||me.createElement(en.Z,null)):null,ii=(rn==="picture-card"||rn==="picture-circle")&&Xn!=="uploading"&&me.createElement("span",{className:`${Lt}-list-item-actions`},Sr,Xn==="done"&&nr,gr),{getPrefixCls:Hn}=me.useContext(mt.E_),qn=Hn(),Dr=me.createElement("div",{className:_n},ar,Ir,ii,ur&&me.createElement(Ie.default,{motionName:`${qn}-fade`,visible:Xn==="uploading",motionDeadline:2e3},di=>{let{className:ri}=di;const Jr="percent"in Be?me.createElement(ln.Z,Object.assign({},Ct,{type:"line",percent:Be.percent,"aria-label":Be["aria-label"],"aria-labelledby":Be["aria-labelledby"]})):null;return me.createElement("div",{className:ot()(`${Lt}-list-item-progress`,ri)},Jr)})),$r=Be.response&&typeof Be.response=="string"?Be.response:((tr=Be.error)===null||tr===void 0?void 0:tr.statusText)||((yr=Be.error)===null||yr===void 0?void 0:yr.message)||Et.uploadError,li=Xn==="error"?me.createElement(Dn.Z,{title:$r,getPopupContainer:di=>di.parentNode},Dr):Dr;return me.createElement("div",{className:ot()(`${Lt}-list-item-container`,Pt),style:an,ref:Mt},Ft?Ft(li,Be,wt,{download:In.bind(null,Be),preview:Un.bind(null,Be),remove:fr.bind(null,Be)}):li)});const Fn=(rt,Mt)=>{const{listType:Lt="text",previewFile:Pt=Fe,onPreview:an,onDownload:Et,onRemove:rn,locale:Be,iconRender:wt,isImageUrl:Ct=On,prefixCls:Nt,items:Tt=[],showPreviewIcon:Ft=!0,showRemoveIcon:Ht=!0,showDownloadIcon:gn=!1,removeIcon:wn,previewIcon:Ln,downloadIcon:zn,progress:er={size:[-1,2],showInfo:!1},appendAction:cr,appendActionVisible:Un=!0,itemRender:In,disabled:fr}=rt,tr=(0,it.Z)(),[yr,Gn]=me.useState(!1);me.useEffect(()=>{Lt!=="picture"&&Lt!=="picture-card"&&Lt!=="picture-circle"||(Tt||[]).forEach(pr=>{typeof document=="undefined"||typeof window=="undefined"||!window.FileReader||!window.File||!(pr.originFileObj instanceof File||pr.originFileObj instanceof Blob)||pr.thumbUrl!==void 0||(pr.thumbUrl="",Pt&&Pt(pr.originFileObj).then(Sr=>{pr.thumbUrl=Sr||"",tr()}))})},[Lt,Tt,Pt]),me.useEffect(()=>{Gn(!0)},[]);const Xn=(pr,Sr)=>{if(an)return Sr==null||Sr.preventDefault(),an(pr)},br=pr=>{typeof Et=="function"?Et(pr):pr.url&&window.open(pr.url)},ur=pr=>{rn==null||rn(pr)},Br=pr=>{if(wt)return wt(pr,Lt);const Sr=pr.status==="uploading",ii=Ct&&Ct(pr)?me.createElement(le,null):me.createElement(bn,null);let Hn=Sr?me.createElement(tn.Z,null):me.createElement(ye,null);return Lt==="picture"?Hn=Sr?me.createElement(tn.Z,null):ii:(Lt==="picture-card"||Lt==="picture-circle")&&(Hn=Sr?Be.uploading:ii),Hn},Gr=(pr,Sr,ii,Hn)=>{const qn={type:"text",size:"small",title:Hn,onClick:Dr=>{Sr(),(0,$t.l$)(pr)&&pr.props.onClick&&pr.props.onClick(Dr)},className:`${ii}-list-item-action`,disabled:fr};if((0,$t.l$)(pr)){const Dr=(0,$t.Tm)(pr,Object.assign(Object.assign({},pr.props),{onClick:()=>{}}));return me.createElement(Jt.ZP,Object.assign({},qn,{icon:Dr}))}return me.createElement(Jt.ZP,Object.assign({},qn),me.createElement("span",null,pr))};me.useImperativeHandle(Mt,()=>({handlePreview:Xn,handleDownload:br}));const{getPrefixCls:ar}=me.useContext(mt.E_),_n=ar("upload",Nt),Mn=ar(),gr=ot()(`${_n}-list`,`${_n}-list-${Lt}`),nr=(0,je.Z)(Tt.map(pr=>({key:pr.uid,file:pr})));let Lr={motionDeadline:2e3,motionName:`${_n}-${Lt==="picture-card"||Lt==="picture-circle"?"animate-inline":"animate"}`,keys:nr,motionAppear:yr};const Ir=me.useMemo(()=>{const pr=Object.assign({},(0,Kt.Z)(Mn));return delete pr.onAppearEnd,delete pr.onEnterEnd,delete pr.onLeaveEnd,pr},[Mn]);return Lt!=="picture-card"&&Lt!=="picture-circle"&&(Lr=Object.assign(Object.assign({},Ir),Lr)),me.createElement("div",{className:gr},me.createElement(Ie.CSSMotionList,Object.assign({},Lr,{component:!1}),pr=>{let{key:Sr,file:ii,className:Hn,style:qn}=pr;return me.createElement(En,{key:Sr,locale:Be,prefixCls:_n,className:Hn,style:qn,file:ii,items:Tt,progress:er,listType:Lt,isImgUrl:Ct,showPreviewIcon:Ft,showRemoveIcon:Ht,showDownloadIcon:gn,removeIcon:wn,previewIcon:Ln,downloadIcon:zn,iconRender:Br,actionIconRender:Gr,itemRender:In,onPreview:Xn,onDownload:br,onClose:ur})}),cr&&me.createElement(Ie.default,Object.assign({},Lr,{visible:Un,forceRender:!0}),pr=>{let{className:Sr,style:ii}=pr;return(0,$t.Tm)(cr,Hn=>({className:ot()(Hn.className,Sr),style:Object.assign(Object.assign(Object.assign({},ii),{pointerEvents:Sr?"none":void 0}),Hn.style)}))}))};var An=me.forwardRef(Fn),hr=ue(17313),_r=ue(8378),Tr=ue(83116),Hr=ue(37613),Mr=rt=>{const{componentCls:Mt,iconCls:Lt}=rt;return{[`${Mt}-wrapper`]:{[`${Mt}-drag`]:{position:"relative",width:"100%",height:"100%",textAlign:"center",background:rt.colorFillAlter,border:`${rt.lineWidth}px dashed ${rt.colorBorder}`,borderRadius:rt.borderRadiusLG,cursor:"pointer",transition:`border-color ${rt.motionDurationSlow}`,[Mt]:{padding:`${rt.padding}px 0`},[`${Mt}-btn`]:{display:"table",width:"100%",height:"100%",outline:"none"},[`${Mt}-drag-container`]:{display:"table-cell",verticalAlign:"middle"},[`&:not(${Mt}-disabled):hover`]:{borderColor:rt.colorPrimaryHover},[`p${Mt}-drag-icon`]:{marginBottom:rt.margin,[Lt]:{color:rt.colorPrimary,fontSize:rt.uploadThumbnailSize}},[`p${Mt}-text`]:{margin:`0 0 ${rt.marginXXS}px`,color:rt.colorTextHeading,fontSize:rt.fontSizeLG},[`p${Mt}-hint`]:{color:rt.colorTextDescription,fontSize:rt.fontSize},[`&${Mt}-disabled`]:{cursor:"not-allowed",[`p${Mt}-drag-icon ${Lt},
|
|
|
p${Mt}-text,
|
|
|
p${Mt}-hint
|
|
|
`]:{color:rt.colorTextDisabled}}}}}},Or=rt=>{const{componentCls:Mt,antCls:Lt,iconCls:Pt,fontSize:an,lineHeight:Et}=rt,rn=`${Mt}-list-item`,Be=`${rn}-actions`,wt=`${rn}-action`,Ct=Math.round(an*Et);return{[`${Mt}-wrapper`]:{[`${Mt}-list`]:Object.assign(Object.assign({},(0,hr.dF)()),{lineHeight:rt.lineHeight,[rn]:{position:"relative",height:rt.lineHeight*an,marginTop:rt.marginXS,fontSize:an,display:"flex",alignItems:"center",transition:`background-color ${rt.motionDurationSlow}`,"&:hover":{backgroundColor:rt.controlItemBgHover},[`${rn}-name`]:Object.assign(Object.assign({},hr.vS),{padding:`0 ${rt.paddingXS}px`,lineHeight:Et,flex:"auto",transition:`all ${rt.motionDurationSlow}`}),[Be]:{[wt]:{opacity:0},[`${wt}${Lt}-btn-sm`]:{height:Ct,border:0,lineHeight:1,"> span":{transform:"scale(1)"}},[`
|
|
|
${wt}:focus-visible,
|
|
|
&.picture ${wt}
|
|
|
`]:{opacity:1},[Pt]:{color:rt.actionsColor,transition:`all ${rt.motionDurationSlow}`},[`&:hover ${Pt}`]:{color:rt.colorText}},[`${Mt}-icon ${Pt}`]:{color:rt.colorTextDescription,fontSize:an},[`${rn}-progress`]:{position:"absolute",bottom:-rt.uploadProgressOffset,width:"100%",paddingInlineStart:an+rt.paddingXS,fontSize:an,lineHeight:0,pointerEvents:"none","> div":{margin:0}}},[`${rn}:hover ${wt}`]:{opacity:1,color:rt.colorText},[`${rn}-error`]:{color:rt.colorError,[`${rn}-name, ${Mt}-icon ${Pt}`]:{color:rt.colorError},[Be]:{[`${Pt}, ${Pt}:hover`]:{color:rt.colorError},[wt]:{opacity:1}}},[`${Mt}-list-item-container`]:{transition:`opacity ${rt.motionDurationSlow}, height ${rt.motionDurationSlow}`,"&::before":{display:"table",width:0,height:0,content:'""'}}})}}},Fr=ue(36237),Er=ue(1950);const jr=new Fr.Keyframes("uploadAnimateInlineIn",{from:{width:0,height:0,margin:0,padding:0,opacity:0}}),Nr=new Fr.Keyframes("uploadAnimateInlineOut",{to:{width:0,height:0,margin:0,padding:0,opacity:0}});var lr=rt=>{const{componentCls:Mt}=rt,Lt=`${Mt}-animate-inline`;return[{[`${Mt}-wrapper`]:{[`${Lt}-appear, ${Lt}-enter, ${Lt}-leave`]:{animationDuration:rt.motionDurationSlow,animationTimingFunction:rt.motionEaseInOutCirc,animationFillMode:"forwards"},[`${Lt}-appear, ${Lt}-enter`]:{animationName:jr},[`${Lt}-leave`]:{animationName:Nr}}},{[`${Mt}-wrapper`]:(0,Er.J$)(rt)},jr,Nr]},Rn=ue(30071),$n=ue(64993);const wr=rt=>{const{componentCls:Mt,iconCls:Lt,uploadThumbnailSize:Pt,uploadProgressOffset:an}=rt,Et=`${Mt}-list`,rn=`${Et}-item`;return{[`${Mt}-wrapper`]:{[`
|
|
|
${Et}${Et}-picture,
|
|
|
${Et}${Et}-picture-card,
|
|
|
${Et}${Et}-picture-circle
|
|
|
`]:{[rn]:{position:"relative",height:Pt+rt.lineWidth*2+rt.paddingXS*2,padding:rt.paddingXS,border:`${rt.lineWidth}px ${rt.lineType} ${rt.colorBorder}`,borderRadius:rt.borderRadiusLG,"&:hover":{background:"transparent"},[`${rn}-thumbnail`]:Object.assign(Object.assign({},hr.vS),{width:Pt,height:Pt,lineHeight:`${Pt+rt.paddingSM}px`,textAlign:"center",flex:"none",[Lt]:{fontSize:rt.fontSizeHeading2,color:rt.colorPrimary},img:{display:"block",width:"100%",height:"100%",overflow:"hidden"}}),[`${rn}-progress`]:{bottom:an,width:`calc(100% - ${rt.paddingSM*2}px)`,marginTop:0,paddingInlineStart:Pt+rt.paddingXS}},[`${rn}-error`]:{borderColor:rt.colorError,[`${rn}-thumbnail ${Lt}`]:{[`svg path[fill='${Rn.blue[0]}']`]:{fill:rt.colorErrorBg},[`svg path[fill='${Rn.blue.primary}']`]:{fill:rt.colorError}}},[`${rn}-uploading`]:{borderStyle:"dashed",[`${rn}-name`]:{marginBottom:an}}},[`${Et}${Et}-picture-circle ${rn}`]:{[`&, &::before, ${rn}-thumbnail`]:{borderRadius:"50%"}}}}},lt=rt=>{const{componentCls:Mt,iconCls:Lt,fontSizeLG:Pt,colorTextLightSolid:an}=rt,Et=`${Mt}-list`,rn=`${Et}-item`,Be=rt.uploadPicCardSize;return{[`
|
|
|
${Mt}-wrapper${Mt}-picture-card-wrapper,
|
|
|
${Mt}-wrapper${Mt}-picture-circle-wrapper
|
|
|
`]:Object.assign(Object.assign({},(0,hr.dF)()),{display:"inline-block",width:"100%",[`${Mt}${Mt}-select`]:{width:Be,height:Be,marginInlineEnd:rt.marginXS,marginBottom:rt.marginXS,textAlign:"center",verticalAlign:"top",backgroundColor:rt.colorFillAlter,border:`${rt.lineWidth}px dashed ${rt.colorBorder}`,borderRadius:rt.borderRadiusLG,cursor:"pointer",transition:`border-color ${rt.motionDurationSlow}`,[`> ${Mt}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",textAlign:"center"},[`&:not(${Mt}-disabled):hover`]:{borderColor:rt.colorPrimary}},[`${Et}${Et}-picture-card, ${Et}${Et}-picture-circle`]:{[`${Et}-item-container`]:{display:"inline-block",width:Be,height:Be,marginBlock:`0 ${rt.marginXS}px`,marginInline:`0 ${rt.marginXS}px`,verticalAlign:"top"},"&::after":{display:"none"},[rn]:{height:"100%",margin:0,"&::before":{position:"absolute",zIndex:1,width:`calc(100% - ${rt.paddingXS*2}px)`,height:`calc(100% - ${rt.paddingXS*2}px)`,backgroundColor:rt.colorBgMask,opacity:0,transition:`all ${rt.motionDurationSlow}`,content:'" "'}},[`${rn}:hover`]:{[`&::before, ${rn}-actions`]:{opacity:1}},[`${rn}-actions`]:{position:"absolute",insetInlineStart:0,zIndex:10,width:"100%",whiteSpace:"nowrap",textAlign:"center",opacity:0,transition:`all ${rt.motionDurationSlow}`,[`${Lt}-eye, ${Lt}-download, ${Lt}-delete`]:{zIndex:10,width:Pt,margin:`0 ${rt.marginXXS}px`,fontSize:Pt,cursor:"pointer",transition:`all ${rt.motionDurationSlow}`,svg:{verticalAlign:"baseline"}}},[`${rn}-actions, ${rn}-actions:hover`]:{[`${Lt}-eye, ${Lt}-download, ${Lt}-delete`]:{color:new $n.C(an).setAlpha(.65).toRgbString(),"&:hover":{color:an}}},[`${rn}-thumbnail, ${rn}-thumbnail img`]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},[`${rn}-name`]:{display:"none",textAlign:"center"},[`${rn}-file + ${rn}-name`]:{position:"absolute",bottom:rt.margin,display:"block",width:`calc(100% - ${rt.paddingXS*2}px)`},[`${rn}-uploading`]:{[`&${rn}`]:{backgroundColor:rt.colorFillAlter},[`&::before, ${Lt}-eye, ${Lt}-download, ${Lt}-delete`]:{display:"none"}},[`${rn}-progress`]:{bottom:rt.marginXL,width:`calc(100% - ${rt.paddingXS*2}px)`,paddingInlineStart:0}}}),[`${Mt}-wrapper${Mt}-picture-circle-wrapper`]:{[`${Mt}${Mt}-select`]:{borderRadius:"50%"}}}};var Pe=rt=>{const{componentCls:Mt}=rt;return{[`${Mt}-rtl`]:{direction:"rtl"}}};const De=rt=>{const{componentCls:Mt,colorTextDisabled:Lt}=rt;return{[`${Mt}-wrapper`]:Object.assign(Object.assign({},(0,hr.Wf)(rt)),{[Mt]:{outline:0,"input[type='file']":{cursor:"pointer"}},[`${Mt}-select`]:{display:"inline-block"},[`${Mt}-disabled`]:{color:Lt,cursor:"not-allowed"}})}};var Te=(0,Tr.Z)("Upload",rt=>{const{fontSizeHeading3:Mt,fontSize:Lt,lineHeight:Pt,lineWidth:an,controlHeightLG:Et}=rt,rn=Math.round(Lt*Pt),Be=(0,Hr.TS)(rt,{uploadThumbnailSize:Mt*2,uploadProgressOffset:rn/2+an,uploadPicCardSize:Et*2.55});return[De(Be),Mr(Be),wr(Be),lt(Be),Or(Be),lr(Be),Pe(Be),(0,_r.Z)(Be)]},rt=>({actionsColor:rt.colorTextDescription})),qe=function(rt,Mt,Lt,Pt){function an(Et){return Et instanceof Lt?Et:new Lt(function(rn){rn(Et)})}return new(Lt||(Lt=Promise))(function(Et,rn){function Be(Nt){try{Ct(Pt.next(Nt))}catch(Tt){rn(Tt)}}function wt(Nt){try{Ct(Pt.throw(Nt))}catch(Tt){rn(Tt)}}function Ct(Nt){Nt.done?Et(Nt.value):an(Nt.value).then(Be,wt)}Ct((Pt=Pt.apply(rt,Mt||[])).next())})};const dt=`__LIST_IGNORE_${Date.now()}__`,Xt=(rt,Mt)=>{const{fileList:Lt,defaultFileList:Pt,onRemove:an,showUploadList:Et=!0,listType:rn="text",onPreview:Be,onDownload:wt,onChange:Ct,onDrop:Nt,previewFile:Tt,disabled:Ft,locale:Ht,iconRender:gn,isImageUrl:wn,progress:Ln,prefixCls:zn,className:er,type:cr="select",children:Un,style:In,itemRender:fr,maxCount:tr,data:yr={},multiple:Gn=!1,action:Xn="",accept:br="",supportServerRender:ur=!0,rootClassName:Br}=rt,Gr=me.useContext($e.Z),ar=Ft!=null?Ft:Gr,[_n,Mn]=(0,It.Z)(Pt||[],{value:Lt,postState:Xr=>Xr!=null?Xr:[]}),[gr,nr]=me.useState("drop"),kr=me.useRef(null);me.useMemo(()=>{const Xr=Date.now();(Lt||[]).forEach((ei,Ai)=>{!ei.uid&&!Object.isFrozen(ei)&&(ei.uid=`__AUTO__${Xr}_${Ai}__`)})},[Lt]);const Lr=(Xr,ei,Ai)=>{let ai=(0,je.Z)(ei),fi=!1;tr===1?ai=ai.slice(-1):tr&&(fi=ai.length>tr,ai=ai.slice(0,tr)),(0,Rt.flushSync)(()=>{Mn(ai)});const ki={file:Xr,fileList:ai};Ai&&(ki.event=Ai),(!fi||ai.some(pi=>pi.uid===Xr.uid))&&(0,Rt.flushSync)(()=>{Ct==null||Ct(ki)})},Ir=(Xr,ei)=>qe(void 0,void 0,void 0,function*(){const{beforeUpload:Ai,transformFile:ai}=rt;let fi=Xr;if(Ai){const ki=yield Ai(Xr,ei);if(ki===!1)return!1;if(delete Xr[dt],ki===dt)return Object.defineProperty(Xr,dt,{value:!0,configurable:!0}),!1;typeof ki=="object"&&ki&&(fi=ki)}return ai&&(fi=yield ai(fi)),fi}),pr=Xr=>{const ei=Xr.filter(fi=>!fi.file[dt]);if(!ei.length)return;const Ai=ei.map(fi=>qt(fi.file));let ai=(0,je.Z)(_n);Ai.forEach(fi=>{ai=on(fi,ai)}),Ai.forEach((fi,ki)=>{let pi=fi;if(ei[ki].parsedFile)fi.status="uploading";else{const{originFileObj:Pr}=fi;let Yr;try{Yr=new File([Pr],Pr.name,{type:Pr.type})}catch(Ur){Yr=new Blob([Pr],{type:Pr.type}),Yr.name=Pr.name,Yr.lastModifiedDate=new Date,Yr.lastModified=new Date().getTime()}Yr.uid=fi.uid,pi=Yr}Lr(pi,ai)})},Sr=(Xr,ei,Ai)=>{try{typeof Xr=="string"&&(Xr=JSON.parse(Xr))}catch(ki){}if(!mn(ei,_n))return;const ai=qt(ei);ai.status="done",ai.percent=100,ai.response=Xr,ai.xhr=Ai;const fi=on(ai,_n);Lr(ai,fi)},ii=(Xr,ei)=>{if(!mn(ei,_n))return;const Ai=qt(ei);Ai.status="uploading",Ai.percent=Xr.percent;const ai=on(Ai,_n);Lr(Ai,ai,Xr)},Hn=(Xr,ei,Ai)=>{if(!mn(Ai,_n))return;const ai=qt(Ai);ai.error=Xr,ai.response=ei,ai.status="error";const fi=on(ai,_n);Lr(ai,fi)},qn=Xr=>{let ei;Promise.resolve(typeof an=="function"?an(Xr):an).then(Ai=>{var ai;if(Ai===!1)return;const fi=Cn(Xr,_n);fi&&(ei=Object.assign(Object.assign({},Xr),{status:"removed"}),_n==null||_n.forEach(ki=>{const pi=ei.uid!==void 0?"uid":"name";ki[pi]===ei[pi]&&!Object.isFrozen(ki)&&(ki.status="removed")}),(ai=kr.current)===null||ai===void 0||ai.abort(ei),Lr(ei,fi))})},Dr=Xr=>{nr(Xr.type),Xr.type==="drop"&&(Nt==null||Nt(Xr))};me.useImperativeHandle(Mt,()=>({onBatchStart:pr,onSuccess:Sr,onProgress:ii,onError:Hn,fileList:_n,upload:kr.current}));const{getPrefixCls:$r,direction:li,upload:di}=me.useContext(mt.E_),ri=$r("upload",zn),Jr=Object.assign(Object.assign({onBatchStart:pr,onError:Hn,onProgress:ii,onSuccess:Sr},rt),{data:yr,multiple:Gn,action:Xn,accept:br,supportServerRender:ur,prefixCls:ri,disabled:ar,beforeUpload:Ir,onChange:void 0});delete Jr.className,delete Jr.style,(!Un||ar)&&delete Jr.id;const[yi,bi]=Te(ri),[Yn]=(0,xe.Z)("Upload",ht.Z.Upload),{showRemoveIcon:Vn,showPreviewIcon:Zn,showDownloadIcon:mr,removeIcon:ni,previewIcon:xi,downloadIcon:Mi}=typeof Et=="boolean"?{}:Et,gi=(Xr,ei)=>Et?me.createElement(An,{prefixCls:ri,listType:rn,items:_n,previewFile:Tt,onPreview:Be,onDownload:wt,onRemove:qn,showRemoveIcon:!ar&&Vn,showPreviewIcon:Zn,showDownloadIcon:mr,removeIcon:ni,previewIcon:xi,downloadIcon:Mi,iconRender:gn,locale:Object.assign(Object.assign({},Yn),Ht),isImageUrl:wn,progress:Ln,appendAction:Xr,appendActionVisible:ei,itemRender:fr,disabled:ar}):Xr,ci=ot()(`${ri}-wrapper`,er,Br,bi,di==null?void 0:di.className,{[`${ri}-rtl`]:li==="rtl",[`${ri}-picture-card-wrapper`]:rn==="picture-card",[`${ri}-picture-circle-wrapper`]:rn==="picture-circle"}),_i=Object.assign(Object.assign({},di==null?void 0:di.style),In);if(cr==="drag"){const Xr=ot()(bi,ri,`${ri}-drag`,{[`${ri}-drag-uploading`]:_n.some(ei=>ei.status==="uploading"),[`${ri}-drag-hover`]:gr==="dragover",[`${ri}-disabled`]:ar,[`${ri}-rtl`]:li==="rtl"});return yi(me.createElement("span",{className:ci},me.createElement("div",{className:Xr,style:_i,onDrop:Dr,onDragOver:Dr,onDragLeave:Dr},me.createElement(ct,Object.assign({},Jr,{ref:kr,className:`${ri}-btn`}),me.createElement("div",{className:`${ri}-drag-container`},Un))),gi()))}const Hi=ot()(ri,`${ri}-select`,{[`${ri}-disabled`]:ar}),oa=(Xr=>me.createElement("div",{className:Hi,style:Xr},me.createElement(ct,Object.assign({},Jr,{ref:kr}))))(Un?void 0:{display:"none"});return yi(rn==="picture-card"||rn==="picture-circle"?me.createElement("span",{className:ci},gi(oa,!!Un)):me.createElement("span",{className:ci},oa,gi()))};var Yt=me.forwardRef(Xt),pn=function(rt,Mt){var Lt={};for(var Pt in rt)Object.prototype.hasOwnProperty.call(rt,Pt)&&Mt.indexOf(Pt)<0&&(Lt[Pt]=rt[Pt]);if(rt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var an=0,Pt=Object.getOwnPropertySymbols(rt);an<Pt.length;an++)Mt.indexOf(Pt[an])<0&&Object.prototype.propertyIsEnumerable.call(rt,Pt[an])&&(Lt[Pt[an]]=rt[Pt[an]]);return Lt},Sn=me.forwardRef((rt,Mt)=>{var{style:Lt,height:Pt}=rt,an=pn(rt,["style","height"]);return me.createElement(Yt,Object.assign({ref:Mt},an,{type:"drag",style:Object.assign(Object.assign({},Lt),{height:Pt})}))});const At=Yt;At.Dragger=Sn,At.LIST_IGNORE=dt;var dn=At},99498:function(kn,cn,ue){(function(me){me(ue(89780))})(function(me){me.defineOption("placeholder","",function(Ce,Me,ze){var ut=ze&&ze!=me.Init;if(Me&&!ut)Ce.on("blur",be),Ce.on("change",Ae),Ce.on("swapDoc",Ae),me.on(Ce.getInputField(),"compositionupdate",Ce.state.placeholderCompose=function(){ot(Ce)}),Ae(Ce);else if(!Me&&ut){Ce.off("blur",be),Ce.off("change",Ae),Ce.off("swapDoc",Ae),me.off(Ce.getInputField(),"compositionupdate",Ce.state.placeholderCompose),je(Ce);var Le=Ce.getWrapperElement();Le.className=Le.className.replace(" CodeMirror-empty","")}Me&&!Ce.hasFocus()&&be(Ce)});function je(Ce){Ce.state.placeholder&&(Ce.state.placeholder.parentNode.removeChild(Ce.state.placeholder),Ce.state.placeholder=null)}function Ke(Ce){je(Ce);var Me=Ce.state.placeholder=document.createElement("pre");Me.style.cssText="height: 0; overflow: visible",Me.style.direction=Ce.getOption("direction"),Me.className="CodeMirror-placeholder CodeMirror-line-like";var ze=Ce.getOption("placeholder");typeof ze=="string"&&(ze=document.createTextNode(ze)),Me.appendChild(ze),Ce.display.lineSpace.insertBefore(Me,Ce.display.lineSpace.firstChild)}function ot(Ce){setTimeout(function(){var Me=!1,ze=Ce.getInputField();ze.nodeName=="TEXTAREA"?Me=!ze.value:Ce.lineCount()==1&&(Me=!/[^\u200b]/.test(ze.querySelector(".CodeMirror-line").textContent)),Me?Ke(Ce):je(Ce)},20)}function be(Ce){Ne(Ce)&&Ke(Ce)}function Ae(Ce){var Me=Ce.getWrapperElement(),ze=Ne(Ce);Me.className=Me.className.replace(" CodeMirror-empty","")+(ze?" CodeMirror-empty":""),ze?Ke(Ce):je(Ce)}function Ne(Ce){return Ce.lineCount()===1&&Ce.getLine(0)===""}})},25717:function(kn,cn,ue){(function(me){me(ue(89780))})(function(me){var je={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},Ke=me.Pos;me.defineOption("autoCloseBrackets",!1,function(et,pt,at){at&&at!=me.Init&&(et.removeKeyMap(be),et.state.closeBrackets=null),pt&&(Ae(ot(pt,"pairs")),et.state.closeBrackets=pt,et.addKeyMap(be))});function ot(et,pt){return pt=="pairs"&&typeof et=="string"?et:typeof et=="object"&&et[pt]!=null?et[pt]:je[pt]}var be={Backspace:Me,Enter:ze};function Ae(et){for(var pt=0;pt<et.length;pt++){var at=et.charAt(pt),St="'"+at+"'";be[St]||(be[St]=Ne(at))}}Ae(je.pairs+"`");function Ne(et){return function(pt){return Le(pt,et)}}function Ce(et){var pt=et.state.closeBrackets;if(!pt||pt.override)return pt;var at=et.getModeAt(et.getCursor());return at.closeBrackets||pt}function Me(et){var pt=Ce(et);if(!pt||et.getOption("disableInput"))return me.Pass;for(var at=ot(pt,"pairs"),St=et.listSelections(),Qt=0;Qt<St.length;Qt++){if(!St[Qt].empty())return me.Pass;var nt=We(et,St[Qt].head);if(!nt||at.indexOf(nt)%2!=0)return me.Pass}for(var Qt=St.length-1;Qt>=0;Qt--){var ft=St[Qt].head;et.replaceRange("",Ke(ft.line,ft.ch-1),Ke(ft.line,ft.ch+1),"+delete")}}function ze(et){var pt=Ce(et),at=pt&&ot(pt,"explode");if(!at||et.getOption("disableInput"))return me.Pass;for(var St=et.listSelections(),Qt=0;Qt<St.length;Qt++){if(!St[Qt].empty())return me.Pass;var nt=We(et,St[Qt].head);if(!nt||at.indexOf(nt)%2!=0)return me.Pass}et.operation(function(){var ft=et.lineSeparator()||`
|
|
|
`;et.replaceSelection(ft+ft,null),et.execCommand("goCharLeft"),St=et.listSelections();for(var Ze=0;Ze<St.length;Ze++){var ke=St[Ze].head.line;et.indentLine(ke,null,!0),et.indentLine(ke+1,null,!0)}})}function ut(et){var pt=me.cmpPos(et.anchor,et.head)>0;return{anchor:new Ke(et.anchor.line,et.anchor.ch+(pt?-1:1)),head:new Ke(et.head.line,et.head.ch+(pt?1:-1))}}function Le(et,pt){var at=Ce(et);if(!at||et.getOption("disableInput"))return me.Pass;var St=ot(at,"pairs"),Qt=St.indexOf(pt);if(Qt==-1)return me.Pass;for(var nt=ot(at,"closeBefore"),ft=ot(at,"triples"),Ze=St.charAt(Qt+1)==pt,ke=et.listSelections(),He=Qt%2==0,Ue,bt=0;bt<ke.length;bt++){var Ve=ke[bt],jt=Ve.head,st,Bt=et.getRange(jt,Ke(jt.line,jt.ch+1));if(He&&!Ve.empty())st="surround";else if((Ze||!He)&&Bt==pt)Ze&&yt(et,jt)?st="both":ft.indexOf(pt)>=0&&et.getRange(jt,Ke(jt.line,jt.ch+3))==pt+pt+pt?st="skipThree":st="skip";else if(Ze&&jt.ch>1&&ft.indexOf(pt)>=0&&et.getRange(Ke(jt.line,jt.ch-2),jt)==pt+pt){if(jt.ch>2&&/\bstring/.test(et.getTokenTypeAt(Ke(jt.line,jt.ch-2))))return me.Pass;st="addFour"}else if(Ze){var Qe=jt.ch==0?" ":et.getRange(Ke(jt.line,jt.ch-1),jt);if(!me.isWordChar(Bt)&&Qe!=pt&&!me.isWordChar(Qe))st="both";else return me.Pass}else if(He&&(Bt.length===0||/\s/.test(Bt)||nt.indexOf(Bt)>-1))st="both";else return me.Pass;if(!Ue)Ue=st;else if(Ue!=st)return me.Pass}var zt=Qt%2?St.charAt(Qt-1):pt,ct=Qt%2?pt:St.charAt(Qt+1);et.operation(function(){if(Ue=="skip")et.execCommand("goCharRight");else if(Ue=="skipThree")for(var It=0;It<3;It++)et.execCommand("goCharRight");else if(Ue=="surround"){for(var Rt=et.getSelections(),It=0;It<Rt.length;It++)Rt[It]=zt+Rt[It]+ct;et.replaceSelections(Rt,"around"),Rt=et.listSelections().slice();for(var It=0;It<Rt.length;It++)Rt[It]=ut(Rt[It]);et.setSelections(Rt)}else Ue=="both"?(et.replaceSelection(zt+ct,null),et.triggerElectric(zt+ct),et.execCommand("goCharLeft")):Ue=="addFour"&&(et.replaceSelection(zt+zt+zt+zt,"before"),et.execCommand("goCharRight"))})}function We(et,pt){var at=et.getRange(Ke(pt.line,pt.ch-1),Ke(pt.line,pt.ch+1));return at.length==2?at:null}function yt(et,pt){var at=et.getTokenAt(Ke(pt.line,pt.ch+1));return/\bstring/.test(at.type)&&at.start==pt.ch&&(pt.ch==0||!/\bstring/.test(et.getTokenTypeAt(pt)))}})},6313:function(kn,cn,ue){(function(me){me(ue(89780),ue(32855))})(function(me){me.defineOption("autoCloseTags",!1,function(Me,ze,ut){if(ut!=me.Init&&ut&&Me.removeKeyMap("autoCloseTags"),!!ze){var Le={name:"autoCloseTags"};(typeof ze!="object"||ze.whenClosing!==!1)&&(Le["'/'"]=function(We){return Ae(We)}),(typeof ze!="object"||ze.whenOpening!==!1)&&(Le["'>'"]=function(We){return ot(We)}),Me.addKeyMap(Le)}});var je=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],Ke=["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 ot(Me){if(Me.getOption("disableInput"))return me.Pass;for(var ze=Me.listSelections(),ut=[],Le=Me.getOption("autoCloseTags"),We=0;We<ze.length;We++){if(!ze[We].empty())return me.Pass;var yt=ze[We].head,et=Me.getTokenAt(yt),pt=me.innerMode(Me.getMode(),et.state),at=pt.state,St=pt.mode.xmlCurrentTag&&pt.mode.xmlCurrentTag(at),Qt=St&&St.name;if(!Qt)return me.Pass;var nt=pt.mode.configuration=="html",ft=typeof Le=="object"&&Le.dontCloseTags||nt&&je,Ze=typeof Le=="object"&&Le.indentTags||nt&&Ke;et.end>yt.ch&&(Qt=Qt.slice(0,Qt.length-et.end+yt.ch));var ke=Qt.toLowerCase();if(!Qt||et.type=="string"&&(et.end!=yt.ch||!/[\"\']/.test(et.string.charAt(et.string.length-1))||et.string.length==1)||et.type=="tag"&&St.close||et.string.indexOf("/")==yt.ch-et.start-1||ft&&Ne(ft,ke)>-1||Ce(Me,pt.mode.xmlCurrentContext&&pt.mode.xmlCurrentContext(at)||[],Qt,yt,!0))return me.Pass;var He=typeof Le=="object"&&Le.emptyTags;if(He&&Ne(He,Qt)>-1){ut[We]={text:"/>",newPos:me.Pos(yt.line,yt.ch+2)};continue}var Ue=Ze&&Ne(Ze,ke)>-1;ut[We]={indent:Ue,text:">"+(Ue?`
|
|
|
|
|
|
`:"")+"</"+Qt+">",newPos:Ue?me.Pos(yt.line+1,0):me.Pos(yt.line,yt.ch+1)}}for(var bt=typeof Le=="object"&&Le.dontIndentOnAutoClose,We=ze.length-1;We>=0;We--){var Ve=ut[We];Me.replaceRange(Ve.text,ze[We].head,ze[We].anchor,"+insert");var jt=Me.listSelections().slice(0);jt[We]={head:Ve.newPos,anchor:Ve.newPos},Me.setSelections(jt),!bt&&Ve.indent&&(Me.indentLine(Ve.newPos.line,null,!0),Me.indentLine(Ve.newPos.line+1,null,!0))}}function be(Me,ze){for(var ut=Me.listSelections(),Le=[],We=ze?"/":"</",yt=Me.getOption("autoCloseTags"),et=typeof yt=="object"&&yt.dontIndentOnSlash,pt=0;pt<ut.length;pt++){if(!ut[pt].empty())return me.Pass;var at=ut[pt].head,St=Me.getTokenAt(at),Qt=me.innerMode(Me.getMode(),St.state),nt=Qt.state;if(ze&&(St.type=="string"||St.string.charAt(0)!="<"||St.start!=at.ch-1))return me.Pass;var ft,Ze=Qt.mode.name!="xml"&&Me.getMode().name=="htmlmixed";if(Ze&&Qt.mode.name=="javascript")ft=We+"script";else if(Ze&&Qt.mode.name=="css")ft=We+"style";else{var ke=Qt.mode.xmlCurrentContext&&Qt.mode.xmlCurrentContext(nt);if(!ke||ke.length&&Ce(Me,ke,ke[ke.length-1],at))return me.Pass;ft=We+ke[ke.length-1]}Me.getLine(at.line).charAt(St.end)!=">"&&(ft+=">"),Le[pt]=ft}if(Me.replaceSelections(Le),ut=Me.listSelections(),!et)for(var pt=0;pt<ut.length;pt++)(pt==ut.length-1||ut[pt].head.line<ut[pt+1].head.line)&&Me.indentLine(ut[pt].head.line)}function Ae(Me){return Me.getOption("disableInput")?me.Pass:be(Me,!0)}me.commands.closeTag=function(Me){return be(Me)};function Ne(Me,ze){if(Me.indexOf)return Me.indexOf(ze);for(var ut=0,Le=Me.length;ut<Le;++ut)if(Me[ut]==ze)return ut;return-1}function Ce(Me,ze,ut,Le,We){if(!me.scanForClosingTag)return!1;var yt=Math.min(Me.lastLine()+1,Le.line+500),et=me.scanForClosingTag(Me,Le,null,yt);if(!et||et.tag!=ut)return!1;for(var pt=We?1:0,at=ze.length-1;at>=0&&ze[at]==ut;at--)++pt;Le=et.to;for(var at=1;at<pt;at++){var St=me.scanForClosingTag(Me,Le,null,yt);if(!St||St.tag!=ut)return!1;Le=St.to}return!0}})},32855:function(kn,cn,ue){(function(me){me(ue(89780))})(function(me){"use strict";var je=me.Pos;function Ke(at,St){return at.line-St.line||at.ch-St.ch}var ot="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=ot+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Ae=new RegExp("<(/?)(["+ot+"]["+be+"]*)","g");function Ne(at,St,Qt,nt){this.line=St,this.ch=Qt,this.cm=at,this.text=at.getLine(St),this.min=nt?Math.max(nt.from,at.firstLine()):at.firstLine(),this.max=nt?Math.min(nt.to-1,at.lastLine()):at.lastLine()}function Ce(at,St){var Qt=at.cm.getTokenTypeAt(je(at.line,St));return Qt&&/\btag\b/.test(Qt)}function Me(at){if(!(at.line>=at.max))return at.ch=0,at.text=at.cm.getLine(++at.line),!0}function ze(at){if(!(at.line<=at.min))return at.text=at.cm.getLine(--at.line),at.ch=at.text.length,!0}function ut(at){for(;;){var St=at.text.indexOf(">",at.ch);if(St==-1){if(Me(at))continue;return}if(!Ce(at,St+1)){at.ch=St+1;continue}var Qt=at.text.lastIndexOf("/",St),nt=Qt>-1&&!/\S/.test(at.text.slice(Qt+1,St));return at.ch=St+1,nt?"selfClose":"regular"}}function Le(at){for(;;){var St=at.ch?at.text.lastIndexOf("<",at.ch-1):-1;if(St==-1){if(ze(at))continue;return}if(!Ce(at,St+1)){at.ch=St;continue}Ae.lastIndex=St,at.ch=St;var Qt=Ae.exec(at.text);if(Qt&&Qt.index==St)return Qt}}function We(at){for(;;){Ae.lastIndex=at.ch;var St=Ae.exec(at.text);if(!St){if(Me(at))continue;return}if(!Ce(at,St.index+1)){at.ch=St.index+1;continue}return at.ch=St.index+St[0].length,St}}function yt(at){for(;;){var St=at.ch?at.text.lastIndexOf(">",at.ch-1):-1;if(St==-1){if(ze(at))continue;return}if(!Ce(at,St+1)){at.ch=St;continue}var Qt=at.text.lastIndexOf("/",St),nt=Qt>-1&&!/\S/.test(at.text.slice(Qt+1,St));return at.ch=St+1,nt?"selfClose":"regular"}}function et(at,St){for(var Qt=[];;){var nt=We(at),ft,Ze=at.line,ke=at.ch-(nt?nt[0].length:0);if(!nt||!(ft=ut(at)))return;if(ft!="selfClose")if(nt[1]){for(var He=Qt.length-1;He>=0;--He)if(Qt[He]==nt[2]){Qt.length=He;break}if(He<0&&(!St||St==nt[2]))return{tag:nt[2],from:je(Ze,ke),to:je(at.line,at.ch)}}else Qt.push(nt[2])}}function pt(at,St){for(var Qt=[];;){var nt=yt(at);if(!nt)return;if(nt=="selfClose"){Le(at);continue}var ft=at.line,Ze=at.ch,ke=Le(at);if(!ke)return;if(ke[1])Qt.push(ke[2]);else{for(var He=Qt.length-1;He>=0;--He)if(Qt[He]==ke[2]){Qt.length=He;break}if(He<0&&(!St||St==ke[2]))return{tag:ke[2],from:je(at.line,at.ch),to:je(ft,Ze)}}}}me.registerHelper("fold","xml",function(at,St){for(var Qt=new Ne(at,St.line,0);;){var nt=We(Qt);if(!nt||Qt.line!=St.line)return;var ft=ut(Qt);if(!ft)return;if(!nt[1]&&ft!="selfClose"){var Ze=je(Qt.line,Qt.ch),ke=et(Qt,nt[2]);return ke&&Ke(ke.from,Ze)>0?{from:Ze,to:ke.from}:null}}}),me.findMatchingTag=function(at,St,Qt){var nt=new Ne(at,St.line,St.ch,Qt);if(!(nt.text.indexOf(">")==-1&&nt.text.indexOf("<")==-1)){var ft=ut(nt),Ze=ft&&je(nt.line,nt.ch),ke=ft&&Le(nt);if(!(!ft||!ke||Ke(nt,St)>0)){var He={from:je(nt.line,nt.ch),to:Ze,tag:ke[2]};return ft=="selfClose"?{open:He,close:null,at:"open"}:ke[1]?{open:pt(nt,ke[2]),close:He,at:"close"}:(nt=new Ne(at,Ze.line,Ze.ch,Qt),{open:He,close:et(nt,ke[2]),at:"open"})}}},me.findEnclosingTag=function(at,St,Qt,nt){for(var ft=new Ne(at,St.line,St.ch,Qt);;){var Ze=pt(ft,nt);if(!Ze)break;var ke=new Ne(at,St.line,St.ch,Qt),He=et(ke,Ze.tag);if(He)return{open:Ze,close:He}}},me.scanForClosingTag=function(at,St,Qt,nt){var ft=new Ne(at,St.line,St.ch,nt?{from:0,to:nt}:null);return et(ft,Qt)}})},89780:function(kn){(function(cn,ue){kn.exports=ue()})(this,function(){"use strict";var cn=navigator.userAgent,ue=navigator.platform,me=/gecko\/\d/i.test(cn),je=/MSIE \d/.test(cn),Ke=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(cn),ot=/Edge\/(\d+)/.exec(cn),be=je||Ke||ot,Ae=be&&(je?document.documentMode||6:+(ot||Ke)[1]),Ne=!ot&&/WebKit\//.test(cn),Ce=Ne&&/Qt\/\d+\.\d+/.test(cn),Me=!ot&&/Chrome\//.test(cn),ze=/Opera\//.test(cn),ut=/Apple Computer/.test(navigator.vendor),Le=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(cn),We=/PhantomJS/.test(cn),yt=!ot&&/AppleWebKit/.test(cn)&&/Mobile\/\w+/.test(cn),et=/Android/.test(cn),pt=yt||et||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(cn),at=yt||/Mac/.test(ue),St=/\bCrOS\b/.test(cn),Qt=/win/i.test(ue),nt=ze&&cn.match(/Version\/(\d*\.\d*)/);nt&&(nt=Number(nt[1])),nt&&nt>=15&&(ze=!1,Ne=!0);var ft=at&&(Ce||ze&&(nt==null||nt<12.11)),Ze=me||be&&Ae>=9;function ke(x){return new RegExp("(^|\\s)"+x+"(?:$|\\s)\\s*")}var He=function(x,z){var ne=x.className,te=ke(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 Ue(x){for(var z=x.childNodes.length;z>0;--z)x.removeChild(x.firstChild);return x}function bt(x,z){return Ue(x).appendChild(z)}function Ve(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 ce=0;ce<z.length;++ce)ie.appendChild(z[ce]);return ie}function jt(x,z,ne,te){var ie=Ve(x,z,ne,te);return ie.setAttribute("role","presentation"),ie}var st;document.createRange?st=function(x,z,ne,te){var ie=document.createRange();return ie.setEnd(te||x,ne),ie.setStart(x,z),ie}:st=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 Bt(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 Qe(){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 zt(x,z){var ne=x.className;ke(z).test(ne)||(x.className+=(ne?" ":"")+z)}function ct(x,z){for(var ne=x.split(" "),te=0;te<ne.length;te++)ne[te]&&!ke(ne[te]).test(z)&&(z+=" "+ne[te]);return z}var It=function(x){x.select()};yt?It=function(x){x.selectionStart=0,x.selectionEnd=x.value.length}:be&&(It=function(x){try{x.select()}catch(z){}});function Rt(x){var z=Array.prototype.slice.call(arguments,1);return function(){return x.apply(null,z)}}function mt(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 $e(x,z,ne,te,ie){z==null&&(z=x.search(/[^\s\u00a0]/),z==-1&&(z=x.length));for(var ce=te||0,ge=ie||0;;){var Se=x.indexOf(" ",ce);if(Se<0||Se>=z)return ge+(z-ce);ge+=Se-ce,ge+=ne-ge%ne,ce=Se+1}}var xe=function(){this.id=null,this.f=null,this.time=0,this.handler=Rt(this.onTimeout,this)};xe.prototype.onTimeout=function(x){x.id=0,x.time<=+new Date?x.f():setTimeout(x.handler,x.time-+new Date)},xe.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 ht(x,z){for(var ne=0;ne<x.length;++ne)if(x[ne]==z)return ne;return-1}var nn=50,Ut={toString:function(){return"CodeMirror.Pass"}},Xe={scroll:!1},Ye={origin:"*mouse"},Dt={origin:"+move"};function bn(x,z,ne){for(var te=0,ie=0;;){var ce=x.indexOf(" ",te);ce==-1&&(ce=x.length);var ge=ce-te;if(ce==x.length||ie+ge>=z)return te+Math.min(ge,z-ie);if(ie+=ce-te,ie+=ne-ie%ne,te=ce+1,ie>=z)return te}}var tn=[""];function un(x){for(;tn.length<=x;)tn.push(Vt(tn)+" ");return tn[x]}function Vt(x){return x[x.length-1]}function Gt(x,z){for(var ne=[],te=0;te<x.length;te++)ne[te]=z(x[te],te);return ne}function Wt(x,z,ne){for(var te=0,ie=ne(z);te<x.length&&ne(x[te])<=ie;)te++;x.splice(te,0,z)}function ye(){}function se(x,z){var ne;return Object.create?ne=Object.create(x):(ye.prototype=x,ne=new ye),z&&mt(z,ne),ne}var oe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function de(x){return/\w/.test(x)||x>"\x80"&&(x.toUpperCase()!=x.toLowerCase()||oe.test(x))}function fe(x,z){return z?z.source.indexOf("\\w")>-1&&de(x)?!0:z.test(x):de(x)}function le(x){for(var z in x)if(x.hasOwnProperty(z)&&x[z])return!1;return!0}var Ie=/[\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 it(x){return x.charCodeAt(0)>=768&&Ie.test(x)}function Kt(x,z,ne){for(;(ne<0?z>0:z<x.length)&&it(x.charAt(z));)z+=ne;return z}function $t(x,z,ne){for(var te=z>ne?-1:1;;){if(z==ne)return z;var ie=(z+ne)/2,ce=te<0?Math.ceil(ie):Math.floor(ie);if(ce==z)return x(ce)?z:ne;x(ce)?ne=ce:z=ce+te}}function Jt(x,z,ne,te){if(!x)return te(z,ne,"ltr",0);for(var ie=!1,ce=0;ce<x.length;++ce){var ge=x[ce];(ge.from<ne&&ge.to>z||z==ne&&ge.to==z)&&(te(Math.max(ge.from,z),Math.min(ge.to,ne),ge.level==1?"rtl":"ltr",ce),ie=!0)}ie||te(z,ne,"ltr")}var qt=null;function on(x,z,ne){var te;qt=null;for(var ie=0;ie<x.length;++ie){var ce=x[ie];if(ce.from<z&&ce.to>z)return ie;ce.to==z&&(ce.from!=ce.to&&ne=="before"?te=ie:qt=ie),ce.from==z&&(ce.from!=ce.to&&ne!="before"?te=ie:qt=ie)}return te!=null?te:qt}var mn=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]/,ce=/[LRr]/,ge=/[Lb1n]/,Se=/[1n]/;function Ee(Oe,gt,_t){this.level=Oe,this.from=gt,this.to=_t}return function(Oe,gt){var _t=gt=="ltr"?"L":"R";if(Oe.length==0||gt=="ltr"&&!te.test(Oe))return!1;for(var fn=Oe.length,sn=[],Bn=0;Bn<fn;++Bn)sn.push(ne(Oe.charCodeAt(Bn)));for(var Wn=0,vr=_t;Wn<fn;++Wn){var Ar=sn[Wn];Ar=="m"?sn[Wn]=vr:vr=Ar}for(var Rr=0,Cr=_t;Rr<fn;++Rr){var Kr=sn[Rr];Kr=="1"&&Cr=="r"?sn[Rr]="n":ce.test(Kr)&&(Cr=Kr,Kr=="r"&&(sn[Rr]="R"))}for(var Qr=1,ti=sn[0];Qr<fn-1;++Qr){var Ci=sn[Qr];Ci=="+"&&ti=="1"&&sn[Qr+1]=="1"?sn[Qr]="1":Ci==","&&ti==sn[Qr+1]&&(ti=="1"||ti=="n")&&(sn[Qr]=ti),ti=Ci}for(var qi=0;qi<fn;++qi){var Na=sn[qi];if(Na==",")sn[qi]="N";else if(Na=="%"){var da=void 0;for(da=qi+1;da<fn&&sn[da]=="%";++da);for(var co=qi&&sn[qi-1]=="!"||da<fn&&sn[da]=="1"?"1":"N",uo=qi;uo<da;++uo)sn[uo]=co;qi=da-1}}for(var ka=0,ho=_t;ka<fn;++ka){var hi=sn[ka];ho=="L"&&hi=="1"?sn[ka]="L":ce.test(hi)&&(ho=hi)}for(var ma=0;ma<fn;++ma)if(ie.test(sn[ma])){var ha=void 0;for(ha=ma+1;ha<fn&&ie.test(sn[ha]);++ha);for(var ga=(ma?sn[ma-1]:_t)=="L",ba=(ha<fn?sn[ha]:_t)=="L",fl=ga==ba?ga?"L":"R":_t,vo=ma;vo<ha;++vo)sn[vo]=fl;ma=ha-1}for(var Za=[],$i,Pa=0;Pa<fn;)if(ge.test(sn[Pa])){var au=Pa;for(++Pa;Pa<fn&&ge.test(sn[Pa]);++Pa);Za.push(new Ee(0,au,Pa))}else{var bs=Pa,Ns=Za.length,Yo=gt=="rtl"?1:0;for(++Pa;Pa<fn&&sn[Pa]!="L";++Pa);for(var _a=bs;_a<Pa;)if(Se.test(sn[_a])){bs<_a&&(Za.splice(Ns,0,new Ee(1,bs,_a)),Ns+=Yo);var pl=_a;for(++_a;_a<Pa&&Se.test(sn[_a]);++_a);Za.splice(Ns,0,new Ee(2,pl,_a)),Ns+=Yo,bs=_a}else++_a;bs<Pa&&Za.splice(Ns,0,new Ee(1,bs,Pa))}return gt=="ltr"&&(Za[0].level==1&&($i=Oe.match(/^\s+/))&&(Za[0].from=$i[0].length,Za.unshift(new Ee(0,0,$i[0].length))),Vt(Za).level==1&&($i=Oe.match(/\s+$/))&&(Vt(Za).to-=$i[0].length,Za.push(new Ee(0,fn-$i[0].length,fn)))),gt=="rtl"?Za.reverse():Za}}();function Cn(x,z){var ne=x.order;return ne==null&&(ne=x.order=mn(x.text,z)),ne}var xt=[],hn=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]||xt).concat(ne)}};function On(x,z){return x._handlers&&x._handlers[z]||xt}function tt(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 ce=ht(ie,ne);ce>-1&&(te[z]=ie.slice(0,ce).concat(ie.slice(ce+1)))}}}function Fe(x,z){var ne=On(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 Ge(x,z,ne){return typeof z=="string"&&(z={type:z,preventDefault:function(){this.defaultPrevented=!0}}),Fe(x,ne||z.type,x,z),En(z)||z.codemirrorIgnore}function Zt(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)ht(ne,z[te])==-1&&ne.push(z[te])}function en(x,z){return On(x,z).length>0}function ln(x){x.prototype.on=function(z,ne){hn(this,z,ne)},x.prototype.off=function(z,ne){tt(this,z,ne)}}function Dn(x){x.preventDefault?x.preventDefault():x.returnValue=!1}function Tn(x){x.stopPropagation?x.stopPropagation():x.cancelBubble=!0}function En(x){return x.defaultPrevented!=null?x.defaultPrevented:x.returnValue==!1}function Fn(x){Dn(x),Tn(x)}function jn(x){return x.target||x.srcElement}function An(x){var z=x.which;return z==null&&(x.button&1?z=1:x.button&2?z=3:x.button&4&&(z=2)),at&&x.ctrlKey&&z==1&&(z=3),z}var hr=function(){if(be&&Ae<9)return!1;var x=Ve("div");return"draggable"in x||"dragDrop"in x}(),_r;function Tr(x){if(_r==null){var z=Ve("span","\u200B");bt(x,Ve("span",[z,document.createTextNode("x")])),x.firstChild.offsetHeight!=0&&(_r=z.offsetWidth<=1&&z.offsetHeight>2&&!(be&&Ae<8))}var ne=_r?Ve("span","\u200B"):Ve("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return ne.setAttribute("cm-text",""),ne}var Hr;function sr(x){if(Hr!=null)return Hr;var z=bt(x,document.createTextNode("A\u062EA")),ne=st(z,0,1).getBoundingClientRect(),te=st(z,1,2).getBoundingClientRect();return Ue(x),!ne||ne.left==ne.right?!1:Hr=te.right-ne.right<3}var Mr=`
|
|
|
|
|
|
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 ce=x.slice(z,x.charAt(ie-1)=="\r"?ie-1:ie),ge=ce.indexOf("\r");ge!=-1?(ne.push(ce.slice(0,ge)),z+=ge+1):(ne.push(ce),z=ie+1)}return ne}:function(x){return x.split(/\r\n?|\n/)},rr=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},Or=function(){var x=Ve("div");return"oncopy"in x?!0:(x.setAttribute("oncopy","return;"),typeof x.oncopy=="function")}(),Fr=null;function Er(x){if(Fr!=null)return Fr;var z=bt(x,Ve("span","x")),ne=z.getBoundingClientRect(),te=st(z,0,1).getBoundingClientRect();return Fr=Math.abs(ne.left-te.left)>1}var jr={},Nr={};function Jn(x,z){arguments.length>2&&(z.dependencies=Array.prototype.slice.call(arguments,2)),jr[x]=z}function lr(x,z){Nr[x]=z}function Rn(x){if(typeof x=="string"&&Nr.hasOwnProperty(x))x=Nr[x];else if(x&&typeof x.name=="string"&&Nr.hasOwnProperty(x.name)){var z=Nr[x.name];typeof z=="string"&&(z={name:z}),x=se(z,x),x.name=z.name}else{if(typeof x=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(x))return Rn("application/xml");if(typeof x=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(x))return Rn("application/json")}return typeof x=="string"?{name:x}:x||{name:"null"}}function $n(x,z){z=Rn(z);var ne=jr[z.name];if(!ne)return $n(x,"text/plain");var te=ne(x,z);if(wr.hasOwnProperty(z.name)){var ie=wr[z.name];for(var ce in ie)ie.hasOwnProperty(ce)&&(te.hasOwnProperty(ce)&&(te["_"+ce]=te[ce]),te[ce]=ie[ce])}if(te.name=z.name,z.helperType&&(te.helperType=z.helperType),z.modeProps)for(var ge in z.modeProps)te[ge]=z.modeProps[ge];return te}var wr={};function lt(x,z){var ne=wr.hasOwnProperty(x)?wr[x]:wr[x]={};mt(z,ne)}function _e(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 Pe(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 De(x,z,ne){return x.startState?x.startState(z,ne):!0}var Te=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};Te.prototype.eol=function(){return this.pos>=this.string.length},Te.prototype.sol=function(){return this.pos==this.lineStart},Te.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Te.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Te.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},Te.prototype.eatWhile=function(x){for(var z=this.pos;this.eat(x););return this.pos>z},Te.prototype.eatSpace=function(){for(var x=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>x},Te.prototype.skipToEnd=function(){this.pos=this.string.length},Te.prototype.skipTo=function(x){var z=this.string.indexOf(x,this.pos);if(z>-1)return this.pos=z,!0},Te.prototype.backUp=function(x){this.pos-=x},Te.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=$e(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?$e(this.string,this.lineStart,this.tabSize):0)},Te.prototype.indentation=function(){return $e(this.string,null,this.tabSize)-(this.lineStart?$e(this.string,this.lineStart,this.tabSize):0)},Te.prototype.match=function(x,z,ne){if(typeof x=="string"){var te=function(ge){return ne?ge.toLowerCase():ge},ie=this.string.substr(this.pos,x.length);if(te(ie)==te(x))return z!==!1&&(this.pos+=x.length),!0}else{var ce=this.string.slice(this.pos).match(x);return ce&&ce.index>0?null:(ce&&z!==!1&&(this.pos+=ce[0].length),ce)}},Te.prototype.current=function(){return this.string.slice(this.start,this.pos)},Te.prototype.hideFirstChars=function(x,z){this.lineStart+=x;try{return z()}finally{this.lineStart-=x}},Te.prototype.lookAhead=function(x){var z=this.lineOracle;return z&&z.lookAhead(x)},Te.prototype.baseToken=function(){var x=this.lineOracle;return x&&x.baseToken(this.pos)};function qe(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],ce=ie.chunkSize();if(z<ce){ne=ie;break}z-=ce}return ne.lines[z]}function dt(x,z,ne){var te=[],ie=z.line;return x.iter(z.line,ne.line+1,function(ce){var ge=ce.text;ie==ne.line&&(ge=ge.slice(0,ne.ch)),ie==z.line&&(ge=ge.slice(z.ch)),te.push(ge),++ie}),te}function Xt(x,z,ne){var te=[];return x.iter(z,ne,function(ie){te.push(ie.text)}),te}function Ot(x,z){var ne=z-x.height;if(ne)for(var te=x;te;te=te.parent)te.height+=ne}function Yt(x){if(x.parent==null)return null;for(var z=x.parent,ne=ht(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 pn(x,z){var ne=x.first;e:do{for(var te=0;te<x.children.length;++te){var ie=x.children[te],ce=ie.height;if(z<ce){x=ie;continue e}z-=ce,ne+=ie.chunkSize()}return ne}while(!x.lines);for(var ge=0;ge<x.lines.length;++ge){var Se=x.lines[ge],Ee=Se.height;if(z<Ee)break;z-=Ee}return ne+ge}function vn(x,z){return z>=x.first&&z<x.first+x.size}function Sn(x,z){return String(x.lineNumberFormatter(z+x.firstLineNumber))}function At(x,z,ne){if(ne===void 0&&(ne=null),!(this instanceof At))return new At(x,z,ne);this.line=x,this.ch=z,this.sticky=ne}function dn(x,z){return x.line-z.line||x.ch-z.ch}function rt(x,z){return x.sticky==z.sticky&&dn(x,z)==0}function Mt(x){return At(x.line,x.ch)}function Lt(x,z){return dn(x,z)<0?z:x}function Pt(x,z){return dn(x,z)<0?x:z}function an(x,z){return Math.max(x.first,Math.min(z,x.first+x.size-1))}function Et(x,z){if(z.line<x.first)return At(x.first,0);var ne=x.first+x.size-1;return z.line>ne?At(ne,qe(x,ne).text.length):rn(z,qe(x,z.line).text.length)}function rn(x,z){var ne=x.ch;return ne==null||ne>z?At(x.line,z):ne<0?At(x.line,0):x}function Be(x,z){for(var ne=[],te=0;te<z.length;te++)ne[te]=Et(x,z[te]);return ne}var wt=function(x,z){this.state=x,this.lookAhead=z},Ct=function(x,z,ne,te){this.state=z,this.doc=x,this.line=ne,this.maxLookAhead=te||0,this.baseTokens=null,this.baseTokenPos=1};Ct.prototype.lookAhead=function(x){var z=this.doc.getLine(this.line+x);return z!=null&&x>this.maxLookAhead&&(this.maxLookAhead=x),z},Ct.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}},Ct.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Ct.fromSaved=function(x,z,ne){return z instanceof wt?new Ct(x,_e(x.mode,z.state),ne,z.lookAhead):new Ct(x,_e(x.mode,z),ne)},Ct.prototype.save=function(x){var z=x!==!1?_e(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new wt(z,this.maxLookAhead):z};function Nt(x,z,ne,te){var ie=[x.state.modeGen],ce={};cr(x,z.text,x.doc.mode,ne,function(Oe,gt){return ie.push(Oe,gt)},ce,te);for(var ge=ne.state,Se=function(Oe){ne.baseTokens=ie;var gt=x.state.overlays[Oe],_t=1,fn=0;ne.state=!0,cr(x,z.text,gt.mode,ne,function(sn,Bn){for(var Wn=_t;fn<sn;){var vr=ie[_t];vr>sn&&ie.splice(_t,1,sn,ie[_t+1],vr),_t+=2,fn=Math.min(sn,vr)}if(Bn)if(gt.opaque)ie.splice(Wn,_t-Wn,sn,"overlay "+Bn),_t=Wn+2;else for(;Wn<_t;Wn+=2){var Ar=ie[Wn+1];ie[Wn+1]=(Ar?Ar+" ":"")+"overlay "+Bn}},ce),ne.state=ge,ne.baseTokens=null,ne.baseTokenPos=1},Ee=0;Ee<x.state.overlays.length;++Ee)Se(Ee);return{styles:ie,classes:ce.bgClass||ce.textClass?ce:null}}function Tt(x,z,ne){if(!z.styles||z.styles[0]!=x.state.modeGen){var te=Ft(x,Yt(z)),ie=z.text.length>x.options.maxHighlightLength&&_e(x.doc.mode,te.state),ce=Nt(x,z,te);ie&&(te.state=ie),z.stateAfter=te.save(!ie),z.styles=ce.styles,ce.classes?z.styleClasses=ce.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 Ft(x,z,ne){var te=x.doc,ie=x.display;if(!te.mode.startState)return new Ct(te,!0,z);var ce=Un(x,z,ne),ge=ce>te.first&&qe(te,ce-1).stateAfter,Se=ge?Ct.fromSaved(te,ge,ce):new Ct(te,De(te.mode),ce);return te.iter(ce,z,function(Ee){Ht(x,Ee.text,Se);var Oe=Se.line;Ee.stateAfter=Oe==z-1||Oe%5==0||Oe>=ie.viewFrom&&Oe<ie.viewTo?Se.save():null,Se.nextLine()}),ne&&(te.modeFrontier=Se.line),Se}function Ht(x,z,ne,te){var ie=x.doc.mode,ce=new Te(z,x.options.tabSize,ne);for(ce.start=ce.pos=te||0,z==""&&gn(ie,ne.state);!ce.eol();)wn(ie,ce,ne.state),ce.start=ce.pos}function gn(x,z){if(x.blankLine)return x.blankLine(z);if(x.innerMode){var ne=Pe(x,z);if(ne.mode.blankLine)return ne.mode.blankLine(ne.state)}}function wn(x,z,ne,te){for(var ie=0;ie<10;ie++){te&&(te[0]=Pe(x,ne).mode);var ce=x.token(z,ne);if(z.pos>z.start)return ce}throw new Error("Mode "+x.name+" failed to advance stream.")}var Ln=function(x,z,ne){this.start=x.start,this.end=x.pos,this.string=x.current(),this.type=z||null,this.state=ne};function zn(x,z,ne,te){var ie=x.doc,ce=ie.mode,ge;z=Et(ie,z);var Se=qe(ie,z.line),Ee=Ft(x,z.line,ne),Oe=new Te(Se.text,x.options.tabSize,Ee),gt;for(te&&(gt=[]);(te||Oe.pos<z.ch)&&!Oe.eol();)Oe.start=Oe.pos,ge=wn(ce,Oe,Ee.state),te&>.push(new Ln(Oe,ge,_e(ie.mode,Ee.state)));return te?gt:new Ln(Oe,ge,Ee.state)}function er(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 cr(x,z,ne,te,ie,ce,ge){var Se=ne.flattenSpans;Se==null&&(Se=x.options.flattenSpans);var Ee=0,Oe=null,gt=new Te(z,x.options.tabSize,te),_t,fn=x.options.addModeClass&&[null];for(z==""&&er(gn(ne,te.state),ce);!gt.eol();){if(gt.pos>x.options.maxHighlightLength?(Se=!1,ge&&Ht(x,z,te,gt.pos),gt.pos=z.length,_t=null):_t=er(wn(ne,gt,te.state,fn),ce),fn){var sn=fn[0].name;sn&&(_t="m-"+(_t?sn+" "+_t:sn))}if(!Se||Oe!=_t){for(;Ee<gt.start;)Ee=Math.min(gt.start,Ee+5e3),ie(Ee,Oe);Oe=_t}gt.start=gt.pos}for(;Ee<gt.pos;){var Bn=Math.min(gt.pos,Ee+5e3);ie(Bn,Oe),Ee=Bn}}function Un(x,z,ne){for(var te,ie,ce=x.doc,ge=ne?-1:z-(x.doc.mode.innerMode?1e3:100),Se=z;Se>ge;--Se){if(Se<=ce.first)return ce.first;var Ee=qe(ce,Se-1),Oe=Ee.stateAfter;if(Oe&&(!ne||Se+(Oe instanceof wt?Oe.lookAhead:0)<=ce.modeFrontier))return Se;var gt=$e(Ee.text,null,x.options.tabSize);(ie==null||te>gt)&&(ie=Se-1,te=gt)}return ie}function In(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=qe(x,te).stateAfter;if(ie&&(!(ie instanceof wt)||te+ie.lookAhead<z)){ne=te+1;break}}x.highlightFrontier=Math.min(x.highlightFrontier,ne)}}var fr=!1,tr=!1;function yr(){fr=!0}function Gn(){tr=!0}function Xn(x,z,ne){this.marker=x,this.from=z,this.to=ne}function br(x,z){if(x)for(var ne=0;ne<x.length;++ne){var te=x[ne];if(te.marker==z)return te}}function ur(x,z){for(var ne,te=0;te<x.length;++te)x[te]!=z&&(ne||(ne=[])).push(x[te]);return ne}function Br(x,z){x.markedSpans=x.markedSpans?x.markedSpans.concat([z]):[z],z.marker.attachLine(x)}function Gr(x,z,ne){var te;if(x)for(var ie=0;ie<x.length;++ie){var ce=x[ie],ge=ce.marker,Se=ce.from==null||(ge.inclusiveLeft?ce.from<=z:ce.from<z);if(Se||ce.from==z&&ge.type=="bookmark"&&(!ne||!ce.marker.insertLeft)){var Ee=ce.to==null||(ge.inclusiveRight?ce.to>=z:ce.to>z);(te||(te=[])).push(new Xn(ge,ce.from,Ee?null:ce.to))}}return te}function ar(x,z,ne){var te;if(x)for(var ie=0;ie<x.length;++ie){var ce=x[ie],ge=ce.marker,Se=ce.to==null||(ge.inclusiveRight?ce.to>=z:ce.to>z);if(Se||ce.from==z&&ge.type=="bookmark"&&(!ne||ce.marker.insertLeft)){var Ee=ce.from==null||(ge.inclusiveLeft?ce.from<=z:ce.from<z);(te||(te=[])).push(new Xn(ge,Ee?null:ce.from-z,ce.to==null?null:ce.to-z))}}return te}function _n(x,z){if(z.full)return null;var ne=vn(x,z.from.line)&&qe(x,z.from.line).markedSpans,te=vn(x,z.to.line)&&qe(x,z.to.line).markedSpans;if(!ne&&!te)return null;var ie=z.from.ch,ce=z.to.ch,ge=dn(z.from,z.to)==0,Se=Gr(ne,ie,ge),Ee=ar(te,ce,ge),Oe=z.text.length==1,gt=Vt(z.text).length+(Oe?ie:0);if(Se)for(var _t=0;_t<Se.length;++_t){var fn=Se[_t];if(fn.to==null){var sn=br(Ee,fn.marker);sn?Oe&&(fn.to=sn.to==null?null:sn.to+gt):fn.to=ie}}if(Ee)for(var Bn=0;Bn<Ee.length;++Bn){var Wn=Ee[Bn];if(Wn.to!=null&&(Wn.to+=gt),Wn.from==null){var vr=br(Se,Wn.marker);vr||(Wn.from=gt,Oe&&(Se||(Se=[])).push(Wn))}else Wn.from+=gt,Oe&&(Se||(Se=[])).push(Wn)}Se&&(Se=Mn(Se)),Ee&&Ee!=Se&&(Ee=Mn(Ee));var Ar=[Se];if(!Oe){var Rr=z.text.length-2,Cr;if(Rr>0&&Se)for(var Kr=0;Kr<Se.length;++Kr)Se[Kr].to==null&&(Cr||(Cr=[])).push(new Xn(Se[Kr].marker,null,null));for(var Qr=0;Qr<Rr;++Qr)Ar.push(Cr);Ar.push(Ee)}return Ar}function Mn(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 gr(x,z,ne){var te=null;if(x.iter(z.line,ne.line+1,function(sn){if(sn.markedSpans)for(var Bn=0;Bn<sn.markedSpans.length;++Bn){var Wn=sn.markedSpans[Bn].marker;Wn.readOnly&&(!te||ht(te,Wn)==-1)&&(te||(te=[])).push(Wn)}}),!te)return null;for(var ie=[{from:z,to:ne}],ce=0;ce<te.length;++ce)for(var ge=te[ce],Se=ge.find(0),Ee=0;Ee<ie.length;++Ee){var Oe=ie[Ee];if(!(dn(Oe.to,Se.from)<0||dn(Oe.from,Se.to)>0)){var gt=[Ee,1],_t=dn(Oe.from,Se.from),fn=dn(Oe.to,Se.to);(_t<0||!ge.inclusiveLeft&&!_t)&>.push({from:Oe.from,to:Se.from}),(fn>0||!ge.inclusiveRight&&!fn)&>.push({from:Se.to,to:Oe.to}),ie.splice.apply(ie,gt),Ee+=gt.length-3}}return ie}function nr(x){var z=x.markedSpans;if(z){for(var ne=0;ne<z.length;++ne)z[ne].marker.detachLine(x);x.markedSpans=null}}function kr(x,z){if(z){for(var ne=0;ne<z.length;++ne)z[ne].marker.attachLine(x);x.markedSpans=z}}function Lr(x){return x.inclusiveLeft?-1:0}function Ir(x){return x.inclusiveRight?1:0}function pr(x,z){var ne=x.lines.length-z.lines.length;if(ne!=0)return ne;var te=x.find(),ie=z.find(),ce=dn(te.from,ie.from)||Lr(x)-Lr(z);if(ce)return-ce;var ge=dn(te.to,ie.to)||Ir(x)-Ir(z);return ge||z.id-x.id}function Sr(x,z){var ne=tr&&x.markedSpans,te;if(ne)for(var ie=void 0,ce=0;ce<ne.length;++ce)ie=ne[ce],ie.marker.collapsed&&(z?ie.from:ie.to)==null&&(!te||pr(te,ie.marker)<0)&&(te=ie.marker);return te}function ii(x){return Sr(x,!0)}function Hn(x){return Sr(x,!1)}function qn(x,z){var ne=tr&&x.markedSpans,te;if(ne)for(var ie=0;ie<ne.length;++ie){var ce=ne[ie];ce.marker.collapsed&&(ce.from==null||ce.from<z)&&(ce.to==null||ce.to>z)&&(!te||pr(te,ce.marker)<0)&&(te=ce.marker)}return te}function Dr(x,z,ne,te,ie){var ce=qe(x,z),ge=tr&&ce.markedSpans;if(ge)for(var Se=0;Se<ge.length;++Se){var Ee=ge[Se];if(Ee.marker.collapsed){var Oe=Ee.marker.find(0),gt=dn(Oe.from,ne)||Lr(Ee.marker)-Lr(ie),_t=dn(Oe.to,te)||Ir(Ee.marker)-Ir(ie);if(!(gt>=0&&_t<=0||gt<=0&&_t>=0)&&(gt<=0&&(Ee.marker.inclusiveRight&&ie.inclusiveLeft?dn(Oe.to,ne)>=0:dn(Oe.to,ne)>0)||gt>=0&&(Ee.marker.inclusiveRight&&ie.inclusiveLeft?dn(Oe.from,te)<=0:dn(Oe.from,te)<0)))return!0}}}function $r(x){for(var z;z=ii(x);)x=z.find(-1,!0).line;return x}function li(x){for(var z;z=Hn(x);)x=z.find(1,!0).line;return x}function di(x){for(var z,ne;z=Hn(x);)x=z.find(1,!0).line,(ne||(ne=[])).push(x);return ne}function ri(x,z){var ne=qe(x,z),te=$r(ne);return ne==te?z:Yt(te)}function Jr(x,z){if(z>x.lastLine())return z;var ne=qe(x,z),te;if(!yi(x,ne))return z;for(;te=Hn(ne);)ne=te.find(1,!0).line;return Yt(ne)+1}function yi(x,z){var ne=tr&&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&&bi(x,z,te))return!0}}}function bi(x,z,ne){if(ne.to==null){var te=ne.marker.find(1,!0);return bi(x,te.line,br(te.line.markedSpans,ne.marker))}if(ne.marker.inclusiveRight&&ne.to==z.text.length)return!0;for(var ie=void 0,ce=0;ce<z.markedSpans.length;++ce)if(ie=z.markedSpans[ce],ie.marker.collapsed&&!ie.marker.widgetNode&&ie.from==ne.to&&(ie.to==null||ie.to!=ne.from)&&(ie.marker.inclusiveLeft||ne.marker.inclusiveRight)&&bi(x,z,ie))return!0}function Yn(x){x=$r(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 ce=ne.parent;ce;ne=ce,ce=ne.parent)for(var ge=0;ge<ce.children.length;++ge){var Se=ce.children[ge];if(Se==ne)break;z+=Se.height}return z}function Vn(x){if(x.height==0)return 0;for(var z=x.text.length,ne,te=x;ne=ii(te);){var ie=ne.find(0,!0);te=ie.from.line,z+=ie.from.ch-ie.to.ch}for(te=x;ne=Hn(te);){var ce=ne.find(0,!0);z-=te.text.length-ce.from.ch,te=ce.to.line,z+=te.text.length-ce.to.ch}return z}function Zn(x){var z=x.display,ne=x.doc;z.maxLine=qe(ne,ne.first),z.maxLineLength=Vn(z.maxLine),z.maxLineChanged=!0,ne.iter(function(te){var ie=Vn(te);ie>z.maxLineLength&&(z.maxLineLength=ie,z.maxLine=te)})}var mr=function(x,z,ne){this.text=x,kr(this,z),this.height=ne?ne(this):1};mr.prototype.lineNo=function(){return Yt(this)},ln(mr);function ni(x,z,ne,te){x.text=z,x.stateAfter&&(x.stateAfter=null),x.styles&&(x.styles=null),x.order!=null&&(x.order=null),nr(x),kr(x,ne);var ie=te?te(x):1;ie!=x.height&&Ot(x,ie)}function xi(x){x.parent=null,nr(x)}var Mi={},gi={};function ci(x,z){if(!x||/^\s*$/.test(x))return null;var ne=z.addModeClass?gi:Mi;return ne[x]||(ne[x]=x.replace(/\S+/g,"cm-$&"))}function _i(x,z){var ne=jt("span",null,null,Ne?"padding-right: .1px":null),te={pre:jt("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 ce=ie?z.rest[ie-1]:z.line,ge=void 0;te.pos=0,te.addToken=Ni,sr(x.display.measure)&&(ge=Cn(ce,x.doc.direction))&&(te.addToken=Xr(te.addToken,ge)),te.map=[];var Se=z!=x.display.externalMeasured&&Yt(ce);Ai(ce,te,Tt(x,ce,Se)),ce.styleClasses&&(ce.styleClasses.bgClass&&(te.bgClass=ct(ce.styleClasses.bgClass,te.bgClass||"")),ce.styleClasses.textClass&&(te.textClass=ct(ce.styleClasses.textClass,te.textClass||""))),te.map.length==0&&te.map.push(0,0,te.content.appendChild(Tr(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(Ne){var Ee=te.content.lastChild;(/\bcm-tab\b/.test(Ee.className)||Ee.querySelector&&Ee.querySelector(".cm-tab"))&&(te.content.className="cm-tab-wrap-hack")}return Fe(x,"renderLine",x,z.line,te.pre),te.pre.className&&(te.textClass=ct(te.pre.className,te.textClass||"")),te}function Hi(x){var z=Ve("span","\u2022","cm-invalidchar");return z.title="\\u"+x.charCodeAt(0).toString(16),z.setAttribute("aria-label",z.title),z}function Ni(x,z,ne,te,ie,ce,ge){if(z){var Se=x.splitSpaces?oa(z,x.trailingSpace):z,Ee=x.cm.state.specialChars,Oe=!1,gt;if(!Ee.test(z))x.col+=z.length,gt=document.createTextNode(Se),x.map.push(x.pos,x.pos+z.length,gt),be&&Ae<9&&(Oe=!0),x.pos+=z.length;else{gt=document.createDocumentFragment();for(var _t=0;;){Ee.lastIndex=_t;var fn=Ee.exec(z),sn=fn?fn.index-_t:z.length-_t;if(sn){var Bn=document.createTextNode(Se.slice(_t,_t+sn));be&&Ae<9?gt.appendChild(Ve("span",[Bn])):gt.appendChild(Bn),x.map.push(x.pos,x.pos+sn,Bn),x.col+=sn,x.pos+=sn}if(!fn)break;_t+=sn+1;var Wn=void 0;if(fn[0]==" "){var vr=x.cm.options.tabSize,Ar=vr-x.col%vr;Wn=gt.appendChild(Ve("span",un(Ar),"cm-tab")),Wn.setAttribute("role","presentation"),Wn.setAttribute("cm-text"," "),x.col+=Ar}else fn[0]=="\r"||fn[0]==`
|
|
|
`?(Wn=gt.appendChild(Ve("span",fn[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Wn.setAttribute("cm-text",fn[0]),x.col+=1):(Wn=x.cm.options.specialCharPlaceholder(fn[0]),Wn.setAttribute("cm-text",fn[0]),be&&Ae<9?gt.appendChild(Ve("span",[Wn])):gt.appendChild(Wn),x.col+=1);x.map.push(x.pos,x.pos+1,Wn),x.pos++}}if(x.trailingSpace=Se.charCodeAt(z.length-1)==32,ne||te||ie||Oe||ce||ge){var Rr=ne||"";te&&(Rr+=te),ie&&(Rr+=ie);var Cr=Ve("span",[gt],Rr,ce);if(ge)for(var Kr in ge)ge.hasOwnProperty(Kr)&&Kr!="style"&&Kr!="class"&&Cr.setAttribute(Kr,ge[Kr]);return x.content.appendChild(Cr)}x.content.appendChild(gt)}}function oa(x,z){if(x.length>1&&!/ /.test(x))return x;for(var ne=z,te="",ie=0;ie<x.length;ie++){var ce=x.charAt(ie);ce==" "&&ne&&(ie==x.length-1||x.charCodeAt(ie+1)==32)&&(ce="\xA0"),te+=ce,ne=ce==" "}return te}function Xr(x,z){return function(ne,te,ie,ce,ge,Se,Ee){ie=ie?ie+" cm-force-border":"cm-force-border";for(var Oe=ne.pos,gt=Oe+te.length;;){for(var _t=void 0,fn=0;fn<z.length&&(_t=z[fn],!(_t.to>Oe&&_t.from<=Oe));fn++);if(_t.to>=gt)return x(ne,te,ie,ce,ge,Se,Ee);x(ne,te.slice(0,_t.to-Oe),ie,ce,null,Se,Ee),ce=null,te=te.slice(_t.to-Oe),Oe=_t.to}}}function ei(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 Ai(x,z,ne){var te=x.markedSpans,ie=x.text,ce=0;if(!te){for(var ge=1;ge<ne.length;ge+=2)z.addToken(z,ie.slice(ce,ce=ne[ge]),ci(ne[ge+1],z.cm.options));return}for(var Se=ie.length,Ee=0,Oe=1,gt="",_t,fn,sn=0,Bn,Wn,vr,Ar,Rr;;){if(sn==Ee){Bn=Wn=vr=fn="",Rr=null,Ar=null,sn=1/0;for(var Cr=[],Kr=void 0,Qr=0;Qr<te.length;++Qr){var ti=te[Qr],Ci=ti.marker;if(Ci.type=="bookmark"&&ti.from==Ee&&Ci.widgetNode)Cr.push(Ci);else if(ti.from<=Ee&&(ti.to==null||ti.to>Ee||Ci.collapsed&&ti.to==Ee&&ti.from==Ee)){if(ti.to!=null&&ti.to!=Ee&&sn>ti.to&&(sn=ti.to,Wn=""),Ci.className&&(Bn+=" "+Ci.className),Ci.css&&(fn=(fn?fn+";":"")+Ci.css),Ci.startStyle&&ti.from==Ee&&(vr+=" "+Ci.startStyle),Ci.endStyle&&ti.to==sn&&(Kr||(Kr=[])).push(Ci.endStyle,ti.to),Ci.title&&((Rr||(Rr={})).title=Ci.title),Ci.attributes)for(var qi in Ci.attributes)(Rr||(Rr={}))[qi]=Ci.attributes[qi];Ci.collapsed&&(!Ar||pr(Ar.marker,Ci)<0)&&(Ar=ti)}else ti.from>Ee&&sn>ti.from&&(sn=ti.from)}if(Kr)for(var Na=0;Na<Kr.length;Na+=2)Kr[Na+1]==sn&&(Wn+=" "+Kr[Na]);if(!Ar||Ar.from==Ee)for(var da=0;da<Cr.length;++da)ei(z,0,Cr[da]);if(Ar&&(Ar.from||0)==Ee){if(ei(z,(Ar.to==null?Se+1:Ar.to)-Ee,Ar.marker,Ar.from==null),Ar.to==null)return;Ar.to==Ee&&(Ar=!1)}}if(Ee>=Se)break;for(var co=Math.min(Se,sn);;){if(gt){var uo=Ee+gt.length;if(!Ar){var ka=uo>co?gt.slice(0,co-Ee):gt;z.addToken(z,ka,_t?_t+Bn:Bn,vr,Ee+ka.length==sn?Wn:"",fn,Rr)}if(uo>=co){gt=gt.slice(co-Ee),Ee=co;break}Ee=uo,vr=""}gt=ie.slice(ce,ce=ne[Oe++]),_t=ci(ne[Oe++],z.cm.options)}}}function ai(x,z,ne){this.line=z,this.rest=di(z),this.size=this.rest?Yt(Vt(this.rest))-ne+1:1,this.node=this.text=null,this.hidden=yi(x,z)}function fi(x,z,ne){for(var te=[],ie,ce=z;ce<ne;ce=ie){var ge=new ai(x.doc,qe(x.doc,ce),ce);ie=ce+ge.size,te.push(ge)}return te}var ki=null;function pi(x){ki?ki.ops.push(x):x.ownsGroup=ki={ops:[x],delayedCallbacks:[]}}function Pr(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 Yr(x,z){var ne=x.ownsGroup;if(ne)try{Pr(ne)}finally{ki=null,z(ne)}}var Ur=null;function zr(x,z){var ne=On(x,z);if(ne.length){var te=Array.prototype.slice.call(arguments,2),ie;ki?ie=ki.delayedCallbacks:Ur?ie=Ur:(ie=Ur=[],setTimeout(ui,0));for(var ce=function(Se){ie.push(function(){return ne[Se].apply(null,te)})},ge=0;ge<ne.length;++ge)ce(ge)}}function ui(){var x=Ur;Ur=null;for(var z=0;z<x.length;++z)x[z]()}function oi(x,z,ne,te){for(var ie=0;ie<z.changes.length;ie++){var ce=z.changes[ie];ce=="text"?na(x,z):ce=="gutter"?vi(x,z,ne,te):ce=="class"?wi(x,z):ce=="widget"&&Gi(x,z,te)}z.changes=null}function zi(x){return x.node==x.text&&(x.node=Ve("div",null,null,"position: relative"),x.text.parentNode&&x.text.parentNode.replaceChild(x.node,x.text),x.node.appendChild(x.text),be&&Ae<8&&(x.node.style.zIndex=2)),x.node}function Wi(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=zi(z);z.background=te.insertBefore(Ve("div",null,ne),te.firstChild),x.display.input.setUneditable(z.background)}}function Zi(x,z){var ne=x.display.externalMeasured;return ne&&ne.line==z.line?(x.display.externalMeasured=null,z.measure=ne.measure,ne.built):_i(x,z)}function na(x,z){var ne=z.text.className,te=Zi(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,wi(x,z)):ne&&(z.text.className=ne)}function wi(x,z){Wi(x,z),z.line.wrapClass?zi(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 vi(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=zi(z);z.gutterBackground=Ve("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 ce=z.line.gutterMarkers;if(x.options.lineNumbers||ce){var ge=zi(z),Se=z.gutter=Ve("div",null,"CodeMirror-gutter-wrapper","left: "+(x.options.fixedGutter?te.fixedPos:-te.gutterTotalWidth)+"px");if(x.display.input.setUneditable(Se),ge.insertBefore(Se,z.text),z.line.gutterClass&&(Se.className+=" "+z.line.gutterClass),x.options.lineNumbers&&(!ce||!ce["CodeMirror-linenumbers"])&&(z.lineNumber=Se.appendChild(Ve("div",Sn(x.options,ne),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+te.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+x.display.lineNumInnerWidth+"px"))),ce)for(var Ee=0;Ee<x.display.gutterSpecs.length;++Ee){var Oe=x.display.gutterSpecs[Ee].className,gt=ce.hasOwnProperty(Oe)&&ce[Oe];gt&&Se.appendChild(Ve("div",[gt],"CodeMirror-gutter-elt","left: "+te.gutterLeft[Oe]+"px; width: "+te.gutterWidth[Oe]+"px"))}}}function Gi(x,z,ne){z.alignable&&(z.alignable=null);for(var te=ke("CodeMirror-linewidget"),ie=z.node.firstChild,ce=void 0;ie;ie=ce)ce=ie.nextSibling,te.test(ie.className)&&z.node.removeChild(ie);sa(x,z,ne)}function ca(x,z,ne,te){var ie=Zi(x,z);return z.text=z.node=ie.pre,ie.bgClass&&(z.bgClass=ie.bgClass),ie.textClass&&(z.textClass=ie.textClass),wi(x,z),vi(x,z,ne,te),sa(x,z,te),z.node}function sa(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 ce=zi(ne),ge=0,Se=z.widgets;ge<Se.length;++ge){var Ee=Se[ge],Oe=Ve("div",[Ee.node],"CodeMirror-linewidget"+(Ee.className?" "+Ee.className:""));Ee.handleMouseEvents||Oe.setAttribute("cm-ignore-events","true"),ts(Ee,Oe,ne,te),x.display.input.setUneditable(Oe),ie&&Ee.above?ce.insertBefore(Oe,ne.gutter||ne.text):ce.appendChild(Oe),zr(Ee,"redraw")}}function ts(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 ao(x){if(x.height!=null)return x.height;var z=x.doc.cm;if(!z)return 0;if(!Bt(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;"),bt(z.display.measure,Ve("div",[x.node],null,ne))}return x.height=x.node.parentNode.offsetHeight}function oo(x,z){for(var ne=jn(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 eo(x){return x.lineSpace.offsetTop}function Ss(x){return x.mover.offsetHeight-x.lineSpace.offsetHeight}function fo(x){if(x.cachedPaddingH)return x.cachedPaddingH;var z=bt(x.measure,Ve("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 Ea(x){return nn-x.display.nativeBarWidth}function fa(x){return x.display.scroller.clientWidth-Ea(x)-x.display.barWidth}function bo(x){return x.display.scroller.clientHeight-Ea(x)-x.display.barHeight}function _o(x,z,ne){var te=x.options.lineWrapping,ie=te&&fa(x);if(!z.measure.heights||te&&z.measure.width!=ie){var ce=z.measure.heights=[];if(te){z.measure.width=ie;for(var ge=z.text.firstChild.getClientRects(),Se=0;Se<ge.length-1;Se++){var Ee=ge[Se],Oe=ge[Se+1];Math.abs(Ee.bottom-Oe.bottom)>2&&ce.push((Ee.bottom+Oe.top)/2-ne.top)}}ce.push(ne.bottom-ne.top)}}function Eo(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(Yt(x.rest[ie])>ne)return{map:x.measure.maps[ie],cache:x.measure.caches[ie],before:!0}}function ns(x,z){z=$r(z);var ne=Yt(z),te=x.display.externalMeasured=new ai(x.doc,z,ne);te.lineN=ne;var ie=te.built=_i(x,te);return te.text=ie.pre,bt(x.display.lineMeasure,ie.pre),te}function $o(x,z,ne,te){return Oi(x,Oa(x,z),ne,te)}function Xa(x,z){if(z>=x.display.viewFrom&&z<x.display.viewTo)return x.display.view[po(x,z)];var ne=x.display.externalMeasured;if(ne&&z>=ne.lineN&&z<ne.lineN+ne.size)return ne}function Oa(x,z){var ne=Yt(z),te=Xa(x,ne);te&&!te.text?te=null:te&&te.changes&&(oi(x,te,ne,Bi(x)),x.curOp.forceUpdate=!0),te||(te=ns(x,z));var ie=Eo(te,z,ne);return{line:z,view:te,rect:null,map:ie.map,cache:ie.cache,before:ie.before,hasHeights:!1}}function Oi(x,z,ne,te,ie){z.before&&(ne=-1);var ce=ne+(te||""),ge;return z.cache.hasOwnProperty(ce)?ge=z.cache[ce]:(z.rect||(z.rect=z.view.text.getBoundingClientRect()),z.hasHeights||(_o(x,z.view,z.rect),z.hasHeights=!0),ge=Ei(x,z,ne,te),ge.bogus||(z.cache[ce]=ge)),{left:ge.left,right:ge.right,top:ie?ge.rtop:ge.top,bottom:ie?ge.rbottom:ge.bottom}}var Lo={left:0,right:0,top:0,bottom:0};function rs(x,z,ne){for(var te,ie,ce,ge,Se,Ee,Oe=0;Oe<x.length;Oe+=3)if(Se=x[Oe],Ee=x[Oe+1],z<Se?(ie=0,ce=1,ge="left"):z<Ee?(ie=z-Se,ce=ie+1):(Oe==x.length-3||z==Ee&&x[Oe+3]>z)&&(ce=Ee-Se,ie=ce-1,z>=Ee&&(ge="right")),ie!=null){if(te=x[Oe+2],Se==Ee&&ne==(te.insertLeft?"left":"right")&&(ge=ne),ne=="left"&&ie==0)for(;Oe&&x[Oe-2]==x[Oe-3]&&x[Oe-1].insertLeft;)te=x[(Oe-=3)+2],ge="left";if(ne=="right"&&ie==Ee-Se)for(;Oe<x.length-3&&x[Oe+3]==x[Oe+4]&&!x[Oe+5].insertLeft;)te=x[(Oe+=3)+2],ge="right";break}return{node:te,start:ie,end:ce,collapse:ge,coverStart:Se,coverEnd:Ee}}function Do(x,z){var ne=Lo;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 Ei(x,z,ne,te){var ie=rs(z.map,ne,te),ce=ie.node,ge=ie.start,Se=ie.end,Ee=ie.collapse,Oe;if(ce.nodeType==3){for(var gt=0;gt<4;gt++){for(;ge&&it(z.line.text.charAt(ie.coverStart+ge));)--ge;for(;ie.coverStart+Se<ie.coverEnd&&it(z.line.text.charAt(ie.coverStart+Se));)++Se;if(be&&Ae<9&&ge==0&&Se==ie.coverEnd-ie.coverStart?Oe=ce.parentNode.getBoundingClientRect():Oe=Do(st(ce,ge,Se).getClientRects(),te),Oe.left||Oe.right||ge==0)break;Se=ge,ge=ge-1,Ee="right"}be&&Ae<11&&(Oe=mi(x.display.measure,Oe))}else{ge>0&&(Ee=te="right");var _t;x.options.lineWrapping&&(_t=ce.getClientRects()).length>1?Oe=_t[te=="right"?_t.length-1:0]:Oe=ce.getBoundingClientRect()}if(be&&Ae<9&&!ge&&(!Oe||!Oe.left&&!Oe.right)){var fn=ce.parentNode.getClientRects()[0];fn?Oe={left:fn.left,right:fn.left+Ii(x.display),top:fn.top,bottom:fn.bottom}:Oe=Lo}for(var sn=Oe.top-z.rect.top,Bn=Oe.bottom-z.rect.top,Wn=(sn+Bn)/2,vr=z.view.measure.heights,Ar=0;Ar<vr.length-1&&!(Wn<vr[Ar]);Ar++);var Rr=Ar?vr[Ar-1]:0,Cr=vr[Ar],Kr={left:(Ee=="right"?Oe.right:Oe.left)-z.rect.left,right:(Ee=="left"?Oe.left:Oe.right)-z.rect.left,top:Rr,bottom:Cr};return!Oe.left&&!Oe.right&&(Kr.bogus=!0),x.options.singleCursorHeightPerLine||(Kr.rtop=sn,Kr.rbottom=Bn),Kr}function mi(x,z){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Er(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 Ki(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 La(x){x.display.externalMeasure=null,Ue(x.display.lineMeasure);for(var z=0;z<x.display.view.length;z++)Ki(x.display.view[z])}function Xi(x){La(x),x.display.cachedCharWidth=x.display.cachedTextHeight=x.display.cachedPaddingH=null,x.options.lineWrapping||(x.display.maxLineChanged=!0),x.display.lineNumChars=null}function $a(){return Me&&et?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Fa(){return Me&&et?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function to(x){var z=0;if(x.widgets)for(var ne=0;ne<x.widgets.length;++ne)x.widgets[ne].above&&(z+=ao(x.widgets[ne]));return z}function Ra(x,z,ne,te,ie){if(!ie){var ce=to(z);ne.top+=ce,ne.bottom+=ce}if(te=="line")return ne;te||(te="local");var ge=Yn(z);if(te=="local"?ge+=eo(x.display):ge-=x.display.viewOffset,te=="page"||te=="window"){var Se=x.display.lineSpace.getBoundingClientRect();ge+=Se.top+(te=="window"?0:Fa());var Ee=Se.left+(te=="window"?0:$a());ne.left+=Ee,ne.right+=Ee}return ne.top+=ge,ne.bottom+=ge,ne}function so(x,z,ne){if(ne=="div")return z;var te=z.left,ie=z.top;if(ne=="page")te-=$a(),ie-=Fa();else if(ne=="local"||!ne){var ce=x.display.sizer.getBoundingClientRect();te+=ce.left,ie+=ce.top}var ge=x.display.lineSpace.getBoundingClientRect();return{left:te-ge.left,top:ie-ge.top}}function lo(x,z,ne,te,ie){return te||(te=qe(x.doc,z.line)),Ra(x,te,$o(x,te,z.ch,ie),ne)}function Da(x,z,ne,te,ie,ce){te=te||qe(x.doc,z.line),ie||(ie=Oa(x,te));function ge(Bn,Wn){var vr=Oi(x,ie,Bn,Wn?"right":"left",ce);return Wn?vr.left=vr.right:vr.right=vr.left,Ra(x,te,vr,ne)}var Se=Cn(te,x.doc.direction),Ee=z.ch,Oe=z.sticky;if(Ee>=te.text.length?(Ee=te.text.length,Oe="before"):Ee<=0&&(Ee=0,Oe="after"),!Se)return ge(Oe=="before"?Ee-1:Ee,Oe=="before");function gt(Bn,Wn,vr){var Ar=Se[Wn],Rr=Ar.level==1;return ge(vr?Bn-1:Bn,Rr!=vr)}var _t=on(Se,Ee,Oe),fn=qt,sn=gt(Ee,_t,Oe=="before");return fn!=null&&(sn.other=gt(Ee,fn,Oe!="before")),sn}function bl(x,z){var ne=0;z=Et(x.doc,z),x.options.lineWrapping||(ne=Ii(x.display)*z.ch);var te=qe(x.doc,z.line),ie=Yn(te)+eo(x.display);return{left:ne,right:ne,top:ie,bottom:ie+te.height}}function jo(x,z,ne,te,ie){var ce=At(x,z,ne);return ce.xRel=ie,te&&(ce.outside=te),ce}function Js(x,z,ne){var te=x.doc;if(ne+=x.display.viewOffset,ne<0)return jo(te.first,0,null,-1,-1);var ie=pn(te,ne),ce=te.first+te.size-1;if(ie>ce)return jo(te.first+te.size-1,qe(te,ce).text.length,null,1,1);z<0&&(z=0);for(var ge=qe(te,ie);;){var Se=kc(x,ge,ie,z,ne),Ee=qn(ge,Se.ch+(Se.xRel>0||Se.outside>0?1:0));if(!Ee)return Se;var Oe=Ee.find(1);if(Oe.line==ie)return Oe;ge=qe(te,ie=Oe.line)}}function Kl(x,z,ne,te){te-=to(z);var ie=z.text.length,ce=$t(function(ge){return Oi(x,ne,ge-1).bottom<=te},ie,0);return ie=$t(function(ge){return Oi(x,ne,ge).top>te},ce,ie),{begin:ce,end:ie}}function Hl(x,z,ne,te){ne||(ne=Oa(x,z));var ie=Ra(x,z,Oi(x,ne,te),"line").top;return Kl(x,z,ne,ie)}function Cs(x,z,ne,te){return x.bottom<=ne?!1:x.top>ne?!0:(te?x.left:x.right)>z}function kc(x,z,ne,te,ie){ie-=Yn(z);var ce=Oa(x,z),ge=to(z),Se=0,Ee=z.text.length,Oe=!0,gt=Cn(z,x.doc.direction);if(gt){var _t=(x.options.lineWrapping?xl:is)(x,z,ne,ce,gt,te,ie);Oe=_t.level!=1,Se=Oe?_t.from:_t.to-1,Ee=Oe?_t.to:_t.from-1}var fn=null,sn=null,Bn=$t(function(Qr){var ti=Oi(x,ce,Qr);return ti.top+=ge,ti.bottom+=ge,Cs(ti,te,ie,!1)?(ti.top<=ie&&ti.left<=te&&(fn=Qr,sn=ti),!0):!1},Se,Ee),Wn,vr,Ar=!1;if(sn){var Rr=te-sn.left<sn.right-te,Cr=Rr==Oe;Bn=fn+(Cr?0:1),vr=Cr?"after":"before",Wn=Rr?sn.left:sn.right}else{!Oe&&(Bn==Ee||Bn==Se)&&Bn++,vr=Bn==0?"after":Bn==z.text.length?"before":Oi(x,ce,Bn-(Oe?1:0)).bottom+ge<=ie==Oe?"after":"before";var Kr=Da(x,At(ne,Bn,vr),"line",z,ce);Wn=Kr.left,Ar=ie<Kr.top?-1:ie>=Kr.bottom?1:0}return Bn=Kt(z.text,Bn,1),jo(ne,Bn,vr,Ar,te-Wn)}function is(x,z,ne,te,ie,ce,ge){var Se=$t(function(_t){var fn=ie[_t],sn=fn.level!=1;return Cs(Da(x,At(ne,sn?fn.to:fn.from,sn?"before":"after"),"line",z,te),ce,ge,!0)},0,ie.length-1),Ee=ie[Se];if(Se>0){var Oe=Ee.level!=1,gt=Da(x,At(ne,Oe?Ee.from:Ee.to,Oe?"after":"before"),"line",z,te);Cs(gt,ce,ge,!0)&>.top>ge&&(Ee=ie[Se-1])}return Ee}function xl(x,z,ne,te,ie,ce,ge){var Se=Kl(x,z,te,ge),Ee=Se.begin,Oe=Se.end;/\s/.test(z.text.charAt(Oe-1))&&Oe--;for(var gt=null,_t=null,fn=0;fn<ie.length;fn++){var sn=ie[fn];if(!(sn.from>=Oe||sn.to<=Ee)){var Bn=sn.level!=1,Wn=Oi(x,te,Bn?Math.min(Oe,sn.to)-1:Math.max(Ee,sn.from)).right,vr=Wn<ce?ce-Wn+1e9:Wn-ce;(!gt||_t>vr)&&(gt=sn,_t=vr)}}return gt||(gt=ie[ie.length-1]),gt.from<Ee&&(gt={from:Ee,to:gt.to,level:gt.level}),gt.to>Oe&&(gt={from:gt.from,to:Oe,level:gt.level}),gt}var Vo;function as(x){if(x.cachedTextHeight!=null)return x.cachedTextHeight;if(Vo==null){Vo=Ve("pre",null,"CodeMirror-line-like");for(var z=0;z<49;++z)Vo.appendChild(document.createTextNode("x")),Vo.appendChild(Ve("br"));Vo.appendChild(document.createTextNode("x"))}bt(x.measure,Vo);var ne=Vo.offsetHeight/50;return ne>3&&(x.cachedTextHeight=ne),Ue(x.measure),ne||1}function Ii(x){if(x.cachedCharWidth!=null)return x.cachedCharWidth;var z=Ve("span","xxxxxxxxxx"),ne=Ve("pre",[z],"CodeMirror-line-like");bt(x.measure,ne);var te=z.getBoundingClientRect(),ie=(te.right-te.left)/10;return ie>2&&(x.cachedCharWidth=ie),ie||10}function Bi(x){for(var z=x.display,ne={},te={},ie=z.gutters.clientLeft,ce=z.gutters.firstChild,ge=0;ce;ce=ce.nextSibling,++ge){var Se=x.display.gutterSpecs[ge].className;ne[Se]=ce.offsetLeft+ce.clientLeft+ie,te[Se]=ce.clientWidth}return{fixedPos:ji(z),gutterTotalWidth:z.gutters.offsetWidth,gutterLeft:ne,gutterWidth:te,wrapperWidth:z.wrapper.clientWidth}}function ji(x){return x.scroller.getBoundingClientRect().left-x.sizer.getBoundingClientRect().left}function Ya(x){var z=as(x.display),ne=x.options.lineWrapping,te=ne&&Math.max(5,x.display.scroller.clientWidth/Ii(x.display)-3);return function(ie){if(yi(x.doc,ie))return 0;var ce=0;if(ie.widgets)for(var ge=0;ge<ie.widgets.length;ge++)ie.widgets[ge].height&&(ce+=ie.widgets[ge].height);return ne?ce+(Math.ceil(ie.text.length/te)||1)*z:ce+z}}function Aa(x){var z=x.doc,ne=Ya(x);z.iter(function(te){var ie=ne(te);ie!=te.height&&Ot(te,ie)})}function xo(x,z,ne,te){var ie=x.display;if(!ne&&jn(z).getAttribute("cm-not-content")=="true")return null;var ce,ge,Se=ie.lineSpace.getBoundingClientRect();try{ce=z.clientX-Se.left,ge=z.clientY-Se.top}catch(_t){return null}var Ee=Js(x,ce,ge),Oe;if(te&&Ee.xRel>0&&(Oe=qe(x.doc,Ee.line).text).length==Ee.ch){var gt=$e(Oe,Oe.length,x.options.tabSize)-Oe.length;Ee=At(Ee.line,Math.max(0,Math.round((ce-fo(x.display).left)/Ii(x.display))-gt))}return Ee}function po(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 za(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)tr&&ri(x.doc,z)<ie.viewTo&&To(x);else if(ne<=ie.viewFrom)tr&&Jr(x.doc,ne+te)>ie.viewFrom?To(x):(ie.viewFrom+=te,ie.viewTo+=te);else if(z<=ie.viewFrom&&ne>=ie.viewTo)To(x);else if(z<=ie.viewFrom){var ce=wo(x,ne,ne+te,1);ce?(ie.view=ie.view.slice(ce.index),ie.viewFrom=ce.lineN,ie.viewTo+=te):To(x)}else if(ne>=ie.viewTo){var ge=wo(x,z,z,-1);ge?(ie.view=ie.view.slice(0,ge.index),ie.viewTo=ge.lineN):To(x)}else{var Se=wo(x,z,z,-1),Ee=wo(x,ne,ne+te,1);Se&&Ee?(ie.view=ie.view.slice(0,Se.index).concat(fi(x,Se.lineN,Ee.lineN)).concat(ie.view.slice(Ee.index)),ie.viewTo+=te):To(x)}var Oe=ie.externalMeasured;Oe&&(ne<Oe.lineN?Oe.lineN+=te:z<Oe.lineN+Oe.size&&(ie.externalMeasured=null))}function Ao(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 ce=te.view[po(x,z)];if(ce.node!=null){var ge=ce.changes||(ce.changes=[]);ht(ge,ne)==-1&&ge.push(ne)}}}function To(x){x.display.viewFrom=x.display.viewTo=x.doc.first,x.display.view=[],x.display.viewOffset=0}function wo(x,z,ne,te){var ie=po(x,z),ce,ge=x.display.view;if(!tr||ne==x.doc.first+x.doc.size)return{index:ie,lineN:ne};for(var Se=x.display.viewFrom,Ee=0;Ee<ie;Ee++)Se+=ge[Ee].size;if(Se!=z){if(te>0){if(ie==ge.length-1)return null;ce=Se+ge[ie].size-z,ie++}else ce=Se-z;z+=ce,ne+=ce}for(;ri(x.doc,ne)!=ne;){if(ie==(te<0?0:ge.length-1))return null;ne+=te*ge[ie-(te<0?1:0)].size,ie+=te}return{index:ie,lineN:ne}}function os(x,z,ne){var te=x.display,ie=te.view;ie.length==0||z>=te.viewTo||ne<=te.viewFrom?(te.view=fi(x,z,ne),te.viewFrom=z):(te.viewFrom>z?te.view=fi(x,z,te.viewFrom).concat(te.view):te.viewFrom<z&&(te.view=te.view.slice(po(x,z))),te.viewFrom=z,te.viewTo<ne?te.view=te.view.concat(fi(x,te.viewTo,ne)):te.viewTo>ne&&(te.view=te.view.slice(0,po(x,ne)))),te.viewTo=ne}function Wl(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 wl(x){x.display.input.showSelection(x.display.input.prepareSelection())}function ku(x,z){z===void 0&&(z=!0);for(var ne=x.doc,te={},ie=te.cursors=document.createDocumentFragment(),ce=te.selection=document.createDocumentFragment(),ge=0;ge<ne.sel.ranges.length;ge++)if(!(!z&&ge==ne.sel.primIndex)){var Se=ne.sel.ranges[ge];if(!(Se.from().line>=x.display.viewTo||Se.to().line<x.display.viewFrom)){var Ee=Se.empty();(Ee||x.options.showCursorWhenSelecting)&&_u(x,Se.head,ie),Ee||Od(x,Se,ce)}}return te}function _u(x,z,ne){var te=Da(x,z,"div",null,null,!x.options.singleCursorHeightPerLine),ie=ne.appendChild(Ve("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 ce=ne.appendChild(Ve("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));ce.style.display="",ce.style.left=te.other.left+"px",ce.style.top=te.other.top+"px",ce.style.height=(te.other.bottom-te.other.top)*.85+"px"}}function Zl(x,z){return x.top-z.top||x.left-z.left}function Od(x,z,ne){var te=x.display,ie=x.doc,ce=document.createDocumentFragment(),ge=fo(x.display),Se=ge.left,Ee=Math.max(te.sizerWidth,fa(x)-te.sizer.offsetLeft)-ge.right,Oe=ie.direction=="ltr";function gt(Cr,Kr,Qr,ti){Kr<0&&(Kr=0),Kr=Math.round(Kr),ti=Math.round(ti),ce.appendChild(Ve("div",null,"CodeMirror-selected","position: absolute; left: "+Cr+`px;
|
|
|
top: `+Kr+"px; width: "+(Qr==null?Ee-Cr:Qr)+`px;
|
|
|
height: `+(ti-Kr)+"px"))}function _t(Cr,Kr,Qr){var ti=qe(ie,Cr),Ci=ti.text.length,qi,Na;function da(ka,ho){return lo(x,At(Cr,ka),"div",ti,ho)}function co(ka,ho,hi){var ma=Hl(x,ti,null,ka),ha=ho=="ltr"==(hi=="after")?"left":"right",ga=hi=="after"?ma.begin:ma.end-(/\s/.test(ti.text.charAt(ma.end-1))?2:1);return da(ga,ha)[ha]}var uo=Cn(ti,ie.direction);return Jt(uo,Kr||0,Qr==null?Ci:Qr,function(ka,ho,hi,ma){var ha=hi=="ltr",ga=da(ka,ha?"left":"right"),ba=da(ho-1,ha?"right":"left"),fl=Kr==null&&ka==0,vo=Qr==null&&ho==Ci,Za=ma==0,$i=!uo||ma==uo.length-1;if(ba.top-ga.top<=3){var Pa=(Oe?fl:vo)&&Za,au=(Oe?vo:fl)&&$i,bs=Pa?Se:(ha?ga:ba).left,Ns=au?Ee:(ha?ba:ga).right;gt(bs,ga.top,Ns-bs,ga.bottom)}else{var Yo,_a,pl,ja;ha?(Yo=Oe&&fl&&Za?Se:ga.left,_a=Oe?Ee:co(ka,hi,"before"),pl=Oe?Se:co(ho,hi,"after"),ja=Oe&&vo&&$i?Ee:ba.right):(Yo=Oe?co(ka,hi,"before"):Se,_a=!Oe&&fl&&Za?Ee:ga.right,pl=!Oe&&vo&&$i?Se:ba.left,ja=Oe?co(ho,hi,"after"):Ee),gt(Yo,ga.top,_a-Yo,ga.bottom),ga.bottom<ba.top&>(Se,ga.bottom,null,ba.top),gt(pl,ba.top,ja-pl,ba.bottom)}(!qi||Zl(ga,qi)<0)&&(qi=ga),Zl(ba,qi)<0&&(qi=ba),(!Na||Zl(ga,Na)<0)&&(Na=ga),Zl(ba,Na)<0&&(Na=ba)}),{start:qi,end:Na}}var fn=z.from(),sn=z.to();if(fn.line==sn.line)_t(fn.line,fn.ch,sn.ch);else{var Bn=qe(ie,fn.line),Wn=qe(ie,sn.line),vr=$r(Bn)==$r(Wn),Ar=_t(fn.line,fn.ch,vr?Bn.text.length+1:null).end,Rr=_t(sn.line,vr?0:null,sn.ch).start;vr&&(Ar.top<Rr.top-2?(gt(Ar.right,Ar.top,null,Ar.bottom),gt(Se,Rr.top,Rr.left,Rr.bottom)):gt(Ar.right,Ar.top,Rr.left-Ar.right,Ar.bottom)),Ar.bottom<Rr.top&>(Se,Ar.bottom,null,Rr.top)}ne.appendChild(ce)}function _c(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()||qs(x),z.cursorDiv.style.visibility=(ne=!ne)?"":"hidden"},x.options.cursorBlinkRate):x.options.cursorBlinkRate<0&&(z.cursorDiv.style.visibility="hidden")}}function Sl(x){x.state.focused||(x.display.input.focus(),Ec(x))}function Eu(x){x.state.delayingBlurEvent=!0,setTimeout(function(){x.state.delayingBlurEvent&&(x.state.delayingBlurEvent=!1,qs(x))},100)}function Ec(x,z){x.state.delayingBlurEvent&&(x.state.delayingBlurEvent=!1),x.options.readOnly!="nocursor"&&(x.state.focused||(Fe(x,"focus",x,z),x.state.focused=!0,zt(x.display.wrapper,"CodeMirror-focused"),!x.curOp&&x.display.selForContextMenu!=x.doc.sel&&(x.display.input.reset(),Ne&&setTimeout(function(){return x.display.input.reset(!0)},20)),x.display.input.receivedFocus()),_c(x))}function qs(x,z){x.state.delayingBlurEvent||(x.state.focused&&(Fe(x,"blur",x,z),x.state.focused=!1,He(x.display.wrapper,"CodeMirror-focused")),clearInterval(x.display.blinker),setTimeout(function(){x.state.focused||(x.display.shift=!1)},150))}function jl(x){for(var z=x.display,ne=z.lineDiv.offsetTop,te=0;te<z.view.length;te++){var ie=z.view[te],ce=x.options.lineWrapping,ge=void 0,Se=0;if(!ie.hidden){if(be&&Ae<8){var Ee=ie.node.offsetTop+ie.node.offsetHeight;ge=Ee-ne,ne=Ee}else{var Oe=ie.node.getBoundingClientRect();ge=Oe.bottom-Oe.top,!ce&&ie.text.firstChild&&(Se=ie.text.firstChild.getBoundingClientRect().right-Oe.left-1)}var gt=ie.line.height-ge;if((gt>.005||gt<-.005)&&(Ot(ie.line,ge),Lu(ie.line),ie.rest))for(var _t=0;_t<ie.rest.length;_t++)Lu(ie.rest[_t]);if(Se>x.display.sizerWidth){var fn=Math.ceil(Se/Ii(x.display));fn>x.display.maxLineLength&&(x.display.maxLineLength=fn,x.display.maxLine=ie.line,x.display.maxLineChanged=!0)}}}}function Lu(x){if(x.widgets)for(var z=0;z<x.widgets.length;++z){var ne=x.widgets[z],te=ne.node.parentNode;te&&(ne.height=te.offsetHeight)}}function Ta(x,z,ne){var te=ne&&ne.top!=null?Math.max(0,ne.top):x.scroller.scrollTop;te=Math.floor(te-eo(x));var ie=ne&&ne.bottom!=null?ne.bottom:te+x.wrapper.clientHeight,ce=pn(z,te),ge=pn(z,ie);if(ne&&ne.ensure){var Se=ne.ensure.from.line,Ee=ne.ensure.to.line;Se<ce?(ce=Se,ge=pn(z,Yn(qe(z,Se))+x.wrapper.clientHeight)):Math.min(Ee,z.lastLine())>=ge&&(ce=pn(z,Yn(qe(z,Ee))-x.wrapper.clientHeight),ge=Ee)}return{from:ce,to:Math.max(ge,ce+1)}}function ss(x,z){if(!Ge(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&&!We){var ce=Ve("div","\u200B",null,`position: absolute;
|
|
|
top: `+(z.top-ne.viewOffset-eo(x.display))+`px;
|
|
|
height: `+(z.bottom-z.top+Ea(x)+ne.barHeight)+`px;
|
|
|
left: `+z.left+"px; width: "+Math.max(2,z.right-z.left)+"px;");x.display.lineSpace.appendChild(ce),ce.scrollIntoView(ie),x.display.lineSpace.removeChild(ce)}}}function Ms(x,z,ne,te){te==null&&(te=0);var ie;!x.options.lineWrapping&&z==ne&&(z=z.ch?At(z.line,z.sticky=="before"?z.ch-1:z.ch,"after"):z,ne=z.sticky=="before"?At(z.line,z.ch+1,"before"):z);for(var ce=0;ce<5;ce++){var ge=!1,Se=Da(x,z),Ee=!ne||ne==z?Se:Da(x,ne);ie={left:Math.min(Se.left,Ee.left),top:Math.min(Se.top,Ee.top)-te,right:Math.max(Se.left,Ee.left),bottom:Math.max(Se.bottom,Ee.bottom)+te};var Oe=Vl(x,ie),gt=x.doc.scrollTop,_t=x.doc.scrollLeft;if(Oe.scrollTop!=null&&(ks(x,Oe.scrollTop),Math.abs(x.doc.scrollTop-gt)>1&&(ge=!0)),Oe.scrollLeft!=null&&(_s(x,Oe.scrollLeft),Math.abs(x.doc.scrollLeft-_t)>1&&(ge=!0)),!ge)break}return ie}function $d(x,z){var ne=Vl(x,z);ne.scrollTop!=null&&ks(x,ne.scrollTop),ne.scrollLeft!=null&&_s(x,ne.scrollLeft)}function Vl(x,z){var ne=x.display,te=as(x.display);z.top<0&&(z.top=0);var ie=x.curOp&&x.curOp.scrollTop!=null?x.curOp.scrollTop:ne.scroller.scrollTop,ce=bo(x),ge={};z.bottom-z.top>ce&&(z.bottom=z.top+ce);var Se=x.doc.height+Ss(ne),Ee=z.top<te,Oe=z.bottom>Se-te;if(z.top<ie)ge.scrollTop=Ee?0:z.top;else if(z.bottom>ie+ce){var gt=Math.min(z.top,(Oe?Se:z.bottom)-ce);gt!=ie&&(ge.scrollTop=gt)}var _t=x.options.fixedGutter?0:ne.gutters.offsetWidth,fn=x.curOp&&x.curOp.scrollLeft!=null?x.curOp.scrollLeft:ne.scroller.scrollLeft-_t,sn=fa(x)-ne.gutters.offsetWidth,Bn=z.right-z.left>sn;return Bn&&(z.right=z.left+sn),z.left<10?ge.scrollLeft=0:z.left<fn?ge.scrollLeft=Math.max(0,z.left+_t-(Bn?0:10)):z.right>sn+fn-3&&(ge.scrollLeft=z.right+(Bn?0:10)-sn),ge}function Lc(x,z){z!=null&&(Ul(x),x.curOp.scrollTop=(x.curOp.scrollTop==null?x.doc.scrollTop:x.curOp.scrollTop)+z)}function Qs(x){Ul(x);var z=x.getCursor();x.curOp.scrollToPos={from:z,to:z,margin:x.options.cursorScrollMargin}}function el(x,z,ne){(z!=null||ne!=null)&&Ul(x),z!=null&&(x.curOp.scrollLeft=z),ne!=null&&(x.curOp.scrollTop=ne)}function Rd(x,z){Ul(x),x.curOp.scrollToPos=z}function Ul(x){var z=x.curOp.scrollToPos;if(z){x.curOp.scrollToPos=null;var ne=bl(x,z.from),te=bl(x,z.to);Du(x,ne,te,z.margin)}}function Du(x,z,ne,te){var ie=Vl(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});el(x,ie.scrollLeft,ie.scrollTop)}function ks(x,z){Math.abs(x.doc.scrollTop-z)<2||(me||Tc(x,{top:z}),Au(x,z,!0),me&&Tc(x),nl(x,100))}function Au(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 _s(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,$u(x),x.display.scroller.scrollLeft!=z&&(x.display.scroller.scrollLeft=z),x.display.scrollbars.setScrollLeft(z))}function tl(x){var z=x.display,ne=z.gutters.offsetWidth,te=Math.round(x.doc.height+Ss(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+Ea(x)+z.barHeight,nativeBarWidth:z.nativeBarWidth,gutterWidth:ne}}var ls=function(x,z,ne){this.cm=ne;var te=this.vert=Ve("div",[Ve("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),ie=this.horiz=Ve("div",[Ve("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");te.tabIndex=ie.tabIndex=-1,x(te),x(ie),hn(te,"scroll",function(){te.clientHeight&&z(te.scrollTop,"vertical")}),hn(ie,"scroll",function(){ie.clientWidth&&z(ie.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,be&&Ae<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ls.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 ce=x.viewWidth-x.barLeft-(ne?te:0);this.horiz.firstChild.style.width=Math.max(0,x.scrollWidth-x.clientWidth+ce)+"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}},ls.prototype.setScrollLeft=function(x){this.horiz.scrollLeft!=x&&(this.horiz.scrollLeft=x),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ls.prototype.setScrollTop=function(x){this.vert.scrollTop!=x&&(this.vert.scrollTop=x),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ls.prototype.zeroWidthHack=function(){var x=at&&!Le?"12px":"18px";this.horiz.style.height=this.vert.style.width=x,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new xe,this.disableVert=new xe},ls.prototype.enableZeroWidthBar=function(x,z,ne){x.style.pointerEvents="auto";function te(){var ie=x.getBoundingClientRect(),ce=ne=="vert"?document.elementFromPoint(ie.right-1,(ie.top+ie.bottom)/2):document.elementFromPoint((ie.right+ie.left)/2,ie.bottom-1);ce!=x?x.style.pointerEvents="none":z.set(1e3,te)}z.set(1e3,te)},ls.prototype.clear=function(){var x=this.horiz.parentNode;x.removeChild(this.horiz),x.removeChild(this.vert)};var mo=function(){};mo.prototype.update=function(){return{bottom:0,right:0}},mo.prototype.setScrollLeft=function(){},mo.prototype.setScrollTop=function(){},mo.prototype.clear=function(){};function Es(x,z){z||(z=tl(x));var ne=x.display.barWidth,te=x.display.barHeight;Dc(x,z);for(var ie=0;ie<4&&ne!=x.display.barWidth||te!=x.display.barHeight;ie++)ne!=x.display.barWidth&&x.options.lineWrapping&&jl(x),Dc(x,tl(x)),ne=x.display.barWidth,te=x.display.barHeight}function Dc(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 Tu={native:ls,null:mo};function Iu(x){x.display.scrollbars&&(x.display.scrollbars.clear(),x.display.scrollbars.addClass&&He(x.display.wrapper,x.display.scrollbars.addClass)),x.display.scrollbars=new Tu[x.options.scrollbarStyle](function(z){x.display.wrapper.insertBefore(z,x.display.scrollbarFiller),hn(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"?_s(x,z):ks(x,z)},x),x.display.scrollbars.addClass&&zt(x.display.wrapper,x.display.scrollbars.addClass)}var Nd=0;function Ls(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:++Nd},pi(x.curOp)}function cs(x){var z=x.curOp;z&&Yr(z,function(ne){for(var te=0;te<ne.ops.length;te++)ne.ops[te].cm.curOp=null;Fd(ne)})}function Fd(x){for(var z=x.ops,ne=0;ne<z.length;ne++)zd(z[ne]);for(var te=0;te<z.length;te++)Kd(z[te]);for(var ie=0;ie<z.length;ie++)Hd(z[ie]);for(var ce=0;ce<z.length;ce++)Wd(z[ce]);for(var ge=0;ge<z.length;ge++)Zd(z[ge])}function zd(x){var z=x.cm,ne=z.display;Bu(z),x.updateMaxLine&&Zn(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 Gl(z,x.mustUpdate&&{top:x.scrollTop,ensure:x.scrollToPos},x.forceUpdate)}function Kd(x){x.updatedDisplay=x.mustUpdate&&Ac(x.cm,x.update)}function Hd(x){var z=x.cm,ne=z.display;x.updatedDisplay&&jl(z),x.barMeasure=tl(z),ne.maxLineChanged&&!z.options.lineWrapping&&(x.adjustWidthTo=$o(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+Ea(z)+z.display.barWidth),x.maxScrollLeft=Math.max(0,ne.sizer.offsetLeft+x.adjustWidthTo-fa(z))),(x.updatedDisplay||x.selectionChanged)&&(x.preparedSelection=ne.input.prepareSelection())}function Wd(x){var z=x.cm;x.adjustWidthTo!=null&&(z.display.sizer.style.minWidth=x.adjustWidthTo+"px",x.maxScrollLeft<z.doc.scrollLeft&&_s(z,Math.min(z.display.scroller.scrollLeft,x.maxScrollLeft),!0),z.display.maxLineChanged=!1);var ne=x.focus&&x.focus==Qe();x.preparedSelection&&z.display.input.showSelection(x.preparedSelection,ne),(x.updatedDisplay||x.startHeight!=z.doc.height)&&Es(z,x.barMeasure),x.updatedDisplay&&Pc(z,x.barMeasure),x.selectionChanged&&_c(z),z.state.focused&&x.updateInput&&z.display.input.reset(x.typing),ne&&Sl(x.cm)}function Zd(x){var z=x.cm,ne=z.display,te=z.doc;if(x.updatedDisplay&&Ou(z,x.update),ne.wheelStartX!=null&&(x.scrollTop!=null||x.scrollLeft!=null||x.scrollToPos)&&(ne.wheelStartX=ne.wheelStartY=null),x.scrollTop!=null&&Au(z,x.scrollTop,x.forceScroll),x.scrollLeft!=null&&_s(z,x.scrollLeft,!0,!0),x.scrollToPos){var ie=Ms(z,Et(te,x.scrollToPos.from),Et(te,x.scrollToPos.to),x.scrollToPos.margin);ss(z,ie)}var ce=x.maybeHiddenMarkers,ge=x.maybeUnhiddenMarkers;if(ce)for(var Se=0;Se<ce.length;++Se)ce[Se].lines.length||Fe(ce[Se],"hide");if(ge)for(var Ee=0;Ee<ge.length;++Ee)ge[Ee].lines.length&&Fe(ge[Ee],"unhide");ne.wrapper.offsetHeight&&(te.scrollTop=z.display.scroller.scrollTop),x.changeObjs&&Fe(z,"changes",z,x.changeObjs),x.update&&x.update.finish()}function pa(x,z){if(x.curOp)return z();Ls(x);try{return z()}finally{cs(x)}}function Sa(x,z){return function(){if(x.curOp)return z.apply(x,arguments);Ls(x);try{return z.apply(x,arguments)}finally{cs(x)}}}function ua(x){return function(){if(this.curOp)return x.apply(this,arguments);Ls(this);try{return x.apply(this,arguments)}finally{cs(this)}}}function Ia(x){return function(){var z=this.cm;if(!z||z.curOp)return x.apply(this,arguments);Ls(z);try{return x.apply(this,arguments)}finally{cs(z)}}}function nl(x,z){x.doc.highlightFrontier<x.display.viewTo&&x.state.highlight.set(z,Rt(Pu,x))}function Pu(x){var z=x.doc;if(!(z.highlightFrontier>=x.display.viewTo)){var ne=+new Date+x.options.workTime,te=Ft(x,z.highlightFrontier),ie=[];z.iter(te.line,Math.min(z.first+z.size,x.display.viewTo+500),function(ce){if(te.line>=x.display.viewFrom){var ge=ce.styles,Se=ce.text.length>x.options.maxHighlightLength?_e(z.mode,te.state):null,Ee=Nt(x,ce,te,!0);Se&&(te.state=Se),ce.styles=Ee.styles;var Oe=ce.styleClasses,gt=Ee.classes;gt?ce.styleClasses=gt:Oe&&(ce.styleClasses=null);for(var _t=!ge||ge.length!=ce.styles.length||Oe!=gt&&(!Oe||!gt||Oe.bgClass!=gt.bgClass||Oe.textClass!=gt.textClass),fn=0;!_t&&fn<ge.length;++fn)_t=ge[fn]!=ce.styles[fn];_t&&ie.push(te.line),ce.stateAfter=te.save(),te.nextLine()}else ce.text.length<=x.options.maxHighlightLength&&Ht(x,ce.text,te),ce.stateAfter=te.line%5==0?te.save():null,te.nextLine();if(+new Date>ne)return nl(x,x.options.workDelay),!0}),z.highlightFrontier=te.line,z.modeFrontier=Math.max(z.modeFrontier,te.line),ie.length&&pa(x,function(){for(var ce=0;ce<ie.length;ce++)Ao(x,ie[ce],"text")})}}var Gl=function(x,z,ne){var te=x.display;this.viewport=z,this.visible=Ta(te,x.doc,z),this.editorIsHidden=!te.wrapper.offsetWidth,this.wrapperHeight=te.wrapper.clientHeight,this.wrapperWidth=te.wrapper.clientWidth,this.oldDisplayWidth=fa(x),this.force=ne,this.dims=Bi(x),this.events=[]};Gl.prototype.signal=function(x,z){en(x,z)&&this.events.push(arguments)},Gl.prototype.finish=function(){for(var x=0;x<this.events.length;x++)Fe.apply(null,this.events[x])};function Bu(x){var z=x.display;!z.scrollbarsClipped&&z.scroller.offsetWidth&&(z.nativeBarWidth=z.scroller.offsetWidth-z.scroller.clientWidth,z.heightForcer.style.height=Ea(x)+"px",z.sizer.style.marginBottom=-z.nativeBarWidth+"px",z.sizer.style.borderRightWidth=Ea(x)+"px",z.scrollbarsClipped=!0)}function jd(x){if(x.hasFocus())return null;var z=Qe();if(!z||!Bt(x.display.lineDiv,z))return null;var ne={activeElt:z};if(window.getSelection){var te=window.getSelection();te.anchorNode&&te.extend&&Bt(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==Qe())&&(x.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(x.activeElt.nodeName)&&x.anchorNode&&Bt(document.body,x.anchorNode)&&Bt(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 Ac(x,z){var ne=x.display,te=x.doc;if(z.editorIsHidden)return To(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&&Wl(x)==0)return!1;Xl(x)&&(To(x),z.dims=Bi(x));var ie=te.first+te.size,ce=Math.max(z.visible.from-x.options.viewportMargin,te.first),ge=Math.min(ie,z.visible.to+x.options.viewportMargin);ne.viewFrom<ce&&ce-ne.viewFrom<20&&(ce=Math.max(te.first,ne.viewFrom)),ne.viewTo>ge&&ne.viewTo-ge<20&&(ge=Math.min(ie,ne.viewTo)),tr&&(ce=ri(x.doc,ce),ge=Jr(x.doc,ge));var Se=ce!=ne.viewFrom||ge!=ne.viewTo||ne.lastWrapHeight!=z.wrapperHeight||ne.lastWrapWidth!=z.wrapperWidth;os(x,ce,ge),ne.viewOffset=Yn(qe(x.doc,ne.viewFrom)),x.display.mover.style.top=ne.viewOffset+"px";var Ee=Wl(x);if(!Se&&Ee==0&&!z.force&&ne.renderedView==ne.view&&(ne.updateLineNumbers==null||ne.updateLineNumbers>=ne.viewTo))return!1;var Oe=jd(x);return Ee>4&&(ne.lineDiv.style.display="none"),Ud(x,ne.updateLineNumbers,z.dims),Ee>4&&(ne.lineDiv.style.display=""),ne.renderedView=ne.view,Vd(Oe),Ue(ne.cursorDiv),Ue(ne.selectionDiv),ne.gutters.style.height=ne.sizer.style.minHeight=0,Se&&(ne.lastWrapHeight=z.wrapperHeight,ne.lastWrapWidth=z.wrapperWidth,nl(x,400)),ne.updateLineNumbers=null,!0}function Ou(x,z){for(var ne=z.viewport,te=!0;;te=!1){if(!te||!x.options.lineWrapping||z.oldDisplayWidth==fa(x)){if(ne&&ne.top!=null&&(ne={top:Math.min(x.doc.height+Ss(x.display)-bo(x),ne.top)}),z.visible=Ta(x.display,x.doc,ne),z.visible.from>=x.display.viewFrom&&z.visible.to<=x.display.viewTo)break}else te&&(z.visible=Ta(x.display,x.doc,ne));if(!Ac(x,z))break;jl(x);var ie=tl(x);wl(x),Es(x,ie),Pc(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 Tc(x,z){var ne=new Gl(x,z);if(Ac(x,ne)){jl(x),Ou(x,ne);var te=tl(x);wl(x),Es(x,te),Pc(x,te),ne.finish()}}function Ud(x,z,ne){var te=x.display,ie=x.options.lineNumbers,ce=te.lineDiv,ge=ce.firstChild;function Se(Bn){var Wn=Bn.nextSibling;return Ne&&at&&x.display.currentWheelTarget==Bn?Bn.style.display="none":Bn.parentNode.removeChild(Bn),Wn}for(var Ee=te.view,Oe=te.viewFrom,gt=0;gt<Ee.length;gt++){var _t=Ee[gt];if(!_t.hidden)if(!_t.node||_t.node.parentNode!=ce){var fn=ca(x,_t,Oe,ne);ce.insertBefore(fn,ge)}else{for(;ge!=_t.node;)ge=Se(ge);var sn=ie&&z!=null&&z<=Oe&&_t.lineNumber;_t.changes&&(ht(_t.changes,"gutter")>-1&&(sn=!1),oi(x,_t,Oe,ne)),sn&&(Ue(_t.lineNumber),_t.lineNumber.appendChild(document.createTextNode(Sn(x.options,Oe)))),ge=_t.node.nextSibling}Oe+=_t.size}for(;ge;)ge=Se(ge)}function Ic(x){var z=x.gutters.offsetWidth;x.sizer.style.marginLeft=z+"px"}function Pc(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+Ea(x)+"px"}function $u(x){var z=x.display,ne=z.view;if(!(!z.alignWidgets&&(!z.gutters.firstChild||!x.options.fixedGutter))){for(var te=ji(z)-z.scroller.scrollLeft+x.doc.scrollLeft,ie=z.gutters.offsetWidth,ce=te+"px",ge=0;ge<ne.length;ge++)if(!ne[ge].hidden){x.options.fixedGutter&&(ne[ge].gutter&&(ne[ge].gutter.style.left=ce),ne[ge].gutterBackground&&(ne[ge].gutterBackground.style.left=ce));var Se=ne[ge].alignable;if(Se)for(var Ee=0;Ee<Se.length;Ee++)Se[Ee].style.left=ce}x.options.fixedGutter&&(z.gutters.style.left=te+ie+"px")}}function Xl(x){if(!x.options.lineNumbers)return!1;var z=x.doc,ne=Sn(x.options,z.first+z.size-1),te=x.display;if(ne.length!=te.lineNumChars){var ie=te.measure.appendChild(Ve("div",[Ve("div",ne)],"CodeMirror-linenumber CodeMirror-gutter-elt")),ce=ie.firstChild.offsetWidth,ge=ie.offsetWidth-ce;return te.lineGutter.style.width="",te.lineNumInnerWidth=Math.max(ce,te.lineGutter.offsetWidth-ge)+1,te.lineNumWidth=te.lineNumInnerWidth+ge,te.lineNumChars=te.lineNumInnerWidth?ne.length:-1,te.lineGutter.style.width=te.lineNumWidth+"px",Ic(x.display),!0}return!1}function Bc(x,z){for(var ne=[],te=!1,ie=0;ie<x.length;ie++){var ce=x[ie],ge=null;if(typeof ce!="string"&&(ge=ce.style,ce=ce.className),ce=="CodeMirror-linenumbers")if(z)te=!0;else continue;ne.push({className:ce,style:ge})}return z&&!te&&ne.push({className:"CodeMirror-linenumbers",style:null}),ne}function Ru(x){var z=x.gutters,ne=x.gutterSpecs;Ue(z),x.lineGutter=null;for(var te=0;te<ne.length;++te){var ie=ne[te],ce=ie.className,ge=ie.style,Se=z.appendChild(Ve("div",null,"CodeMirror-gutter "+ce));ge&&(Se.style.cssText=ge),ce=="CodeMirror-linenumbers"&&(x.lineGutter=Se,Se.style.width=(x.lineNumWidth||1)+"px")}z.style.display=ne.length?"":"none",Ic(x)}function Cl(x){Ru(x.display),za(x),$u(x)}function Gd(x,z,ne,te){var ie=this;this.input=ne,ie.scrollbarFiller=Ve("div",null,"CodeMirror-scrollbar-filler"),ie.scrollbarFiller.setAttribute("cm-not-content","true"),ie.gutterFiller=Ve("div",null,"CodeMirror-gutter-filler"),ie.gutterFiller.setAttribute("cm-not-content","true"),ie.lineDiv=jt("div",null,"CodeMirror-code"),ie.selectionDiv=Ve("div",null,null,"position: relative; z-index: 1"),ie.cursorDiv=Ve("div",null,"CodeMirror-cursors"),ie.measure=Ve("div",null,"CodeMirror-measure"),ie.lineMeasure=Ve("div",null,"CodeMirror-measure"),ie.lineSpace=jt("div",[ie.measure,ie.lineMeasure,ie.selectionDiv,ie.cursorDiv,ie.lineDiv],null,"position: relative; outline: none");var ce=jt("div",[ie.lineSpace],"CodeMirror-lines");ie.mover=Ve("div",[ce],null,"position: relative"),ie.sizer=Ve("div",[ie.mover],"CodeMirror-sizer"),ie.sizerWidth=null,ie.heightForcer=Ve("div",null,null,"position: absolute; height: "+nn+"px; width: 1px;"),ie.gutters=Ve("div",null,"CodeMirror-gutters"),ie.lineGutter=null,ie.scroller=Ve("div",[ie.sizer,ie.heightForcer,ie.gutters],"CodeMirror-scroll"),ie.scroller.setAttribute("tabIndex","-1"),ie.wrapper=Ve("div",[ie.scrollbarFiller,ie.gutterFiller,ie.scroller],"CodeMirror"),be&&Ae<8&&(ie.gutters.style.zIndex=-1,ie.scroller.style.paddingRight=0),!Ne&&!(me&&pt)&&(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=Bc(te.gutters,te.lineNumbers),Ru(ie),ne.init(ie)}var Yl=0,Ka=null;be?Ka=-.53:me?Ka=15:Me?Ka=-.7:ut&&(Ka=-1/3);function rl(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 Nu(x){var z=rl(x);return z.x*=Ka,z.y*=Ka,z}function Fu(x,z){var ne=rl(z),te=ne.x,ie=ne.y,ce=x.display,ge=ce.scroller,Se=ge.scrollWidth>ge.clientWidth,Ee=ge.scrollHeight>ge.clientHeight;if(te&&Se||ie&&Ee){if(ie&&at&&Ne){e:for(var Oe=z.target,gt=ce.view;Oe!=ge;Oe=Oe.parentNode)for(var _t=0;_t<gt.length;_t++)if(gt[_t].node==Oe){x.display.currentWheelTarget=Oe;break e}}if(te&&!me&&!ze&&Ka!=null){ie&&Ee&&ks(x,Math.max(0,ge.scrollTop+ie*Ka)),_s(x,Math.max(0,ge.scrollLeft+te*Ka)),(!ie||ie&&Ee)&&Dn(z),ce.wheelStartX=null;return}if(ie&&Ka!=null){var fn=ie*Ka,sn=x.doc.scrollTop,Bn=sn+ce.wrapper.clientHeight;fn<0?sn=Math.max(0,sn+fn-50):Bn=Math.min(x.doc.height,Bn+fn+50),Tc(x,{top:sn,bottom:Bn})}Yl<20&&(ce.wheelStartX==null?(ce.wheelStartX=ge.scrollLeft,ce.wheelStartY=ge.scrollTop,ce.wheelDX=te,ce.wheelDY=ie,setTimeout(function(){if(ce.wheelStartX!=null){var Wn=ge.scrollLeft-ce.wheelStartX,vr=ge.scrollTop-ce.wheelStartY,Ar=vr&&ce.wheelDY&&vr/ce.wheelDY||Wn&&ce.wheelDX&&Wn/ce.wheelDX;ce.wheelStartX=ce.wheelStartY=null,Ar&&(Ka=(Ka*Yl+Ar)/(Yl+1),++Yl)}},200)):(ce.wheelDX+=te,ce.wheelDY+=ie))}}var go=function(x,z){this.ranges=x,this.primIndex=z};go.prototype.primary=function(){return this.ranges[this.primIndex]},go.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(!rt(ne.anchor,te.anchor)||!rt(ne.head,te.head))return!1}return!0},go.prototype.deepCopy=function(){for(var x=[],z=0;z<this.ranges.length;z++)x[z]=new Fi(Mt(this.ranges[z].anchor),Mt(this.ranges[z].head));return new go(x,this.primIndex)},go.prototype.somethingSelected=function(){for(var x=0;x<this.ranges.length;x++)if(!this.ranges[x].empty())return!0;return!1},go.prototype.contains=function(x,z){z||(z=x);for(var ne=0;ne<this.ranges.length;ne++){var te=this.ranges[ne];if(dn(z,te.from())>=0&&dn(x,te.to())<=0)return ne}return-1};var Fi=function(x,z){this.anchor=x,this.head=z};Fi.prototype.from=function(){return Pt(this.anchor,this.head)},Fi.prototype.to=function(){return Lt(this.anchor,this.head)},Fi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Io(x,z,ne){var te=x&&x.options.selectionsMayTouch,ie=z[ne];z.sort(function(fn,sn){return dn(fn.from(),sn.from())}),ne=ht(z,ie);for(var ce=1;ce<z.length;ce++){var ge=z[ce],Se=z[ce-1],Ee=dn(Se.to(),ge.from());if(te&&!ge.empty()?Ee>0:Ee>=0){var Oe=Pt(Se.from(),ge.from()),gt=Lt(Se.to(),ge.to()),_t=Se.empty()?ge.from()==ge.head:Se.from()==Se.head;ce<=ne&&--ne,z.splice(--ce,2,new Fi(_t?gt:Oe,_t?Oe:gt))}}return new go(z,ne)}function Ro(x,z){return new go([new Fi(x,z||x)],0)}function us(x){return x.text?At(x.from.line+x.text.length-1,Vt(x.text).length+(x.text.length==1?x.from.ch:0)):x.to}function zu(x,z){if(dn(x,z.from)<0)return x;if(dn(x,z.to)<=0)return us(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+=us(z).ch-z.to.ch),At(ne,te)}function Oc(x,z){for(var ne=[],te=0;te<x.sel.ranges.length;te++){var ie=x.sel.ranges[te];ne.push(new Fi(zu(ie.anchor,z),zu(ie.head,z)))}return Io(x.cm,ne,x.sel.primIndex)}function il(x,z,ne){return x.line==z.line?At(ne.line,x.ch-z.ch+ne.ch):At(ne.line+(x.line-z.line),x.ch)}function $c(x,z,ne){for(var te=[],ie=At(x.first,0),ce=ie,ge=0;ge<z.length;ge++){var Se=z[ge],Ee=il(Se.from,ie,ce),Oe=il(us(Se),ie,ce);if(ie=Se.to,ce=Oe,ne=="around"){var gt=x.sel.ranges[ge],_t=dn(gt.head,gt.anchor)<0;te[ge]=new Fi(_t?Oe:Ee,_t?Ee:Oe)}else te[ge]=new Fi(Ee,Ee)}return new go(te,x.sel.primIndex)}function Rc(x){x.doc.mode=$n(x.options,x.doc.modeOption),al(x)}function al(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,nl(x,100),x.state.modeGen++,x.curOp&&za(x)}function Ku(x,z){return z.from.ch==0&&z.to.ch==0&&Vt(z.text)==""&&(!x.cm||x.cm.options.wholeLineUpdateBefore)}function Nc(x,z,ne,te){function ie(Rr){return ne?ne[Rr]:null}function ce(Rr,Cr,Kr){ni(Rr,Cr,Kr,te),zr(Rr,"change",Rr,z)}function ge(Rr,Cr){for(var Kr=[],Qr=Rr;Qr<Cr;++Qr)Kr.push(new mr(Oe[Qr],ie(Qr),te));return Kr}var Se=z.from,Ee=z.to,Oe=z.text,gt=qe(x,Se.line),_t=qe(x,Ee.line),fn=Vt(Oe),sn=ie(Oe.length-1),Bn=Ee.line-Se.line;if(z.full)x.insert(0,ge(0,Oe.length)),x.remove(Oe.length,x.size-Oe.length);else if(Ku(x,z)){var Wn=ge(0,Oe.length-1);ce(_t,_t.text,sn),Bn&&x.remove(Se.line,Bn),Wn.length&&x.insert(Se.line,Wn)}else if(gt==_t)if(Oe.length==1)ce(gt,gt.text.slice(0,Se.ch)+fn+gt.text.slice(Ee.ch),sn);else{var vr=ge(1,Oe.length-1);vr.push(new mr(fn+gt.text.slice(Ee.ch),sn,te)),ce(gt,gt.text.slice(0,Se.ch)+Oe[0],ie(0)),x.insert(Se.line+1,vr)}else if(Oe.length==1)ce(gt,gt.text.slice(0,Se.ch)+Oe[0]+_t.text.slice(Ee.ch),ie(0)),x.remove(Se.line+1,Bn);else{ce(gt,gt.text.slice(0,Se.ch)+Oe[0],ie(0)),ce(_t,fn+_t.text.slice(Ee.ch),sn);var Ar=ge(1,Oe.length-1);Bn>1&&x.remove(Se.line+1,Bn-1),x.insert(Se.line+1,Ar)}zr(x,"change",x,z)}function ds(x,z,ne){function te(ie,ce,ge){if(ie.linked)for(var Se=0;Se<ie.linked.length;++Se){var Ee=ie.linked[Se];if(Ee.doc!=ce){var Oe=ge&&Ee.sharedHist;ne&&!Oe||(z(Ee.doc,Oe),te(Ee.doc,ie,Oe))}}}te(x,null,!0)}function Jl(x,z){if(z.cm)throw new Error("This document is already in use.");x.doc=z,z.cm=x,Aa(x),Rc(x),ql(x),x.options.lineWrapping||Zn(x),x.options.mode=z.modeOption,za(x)}function ql(x){(x.doc.direction=="rtl"?zt:He)(x.display.lineDiv,"CodeMirror-rtl")}function Fc(x){pa(x,function(){ql(x),za(x)})}function Ql(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 zc(x,z){var ne={from:Mt(z.from),to:us(z),text:dt(x,z.from,z.to)};return Zc(x,ne,z.from.line,z.to.line+1),ds(x,function(te){return Zc(te,ne,z.from.line,z.to.line+1)},!0),ne}function Hu(x){for(;x.length;){var z=Vt(x);if(z.ranges)x.pop();else break}}function Kc(x,z){if(z)return Hu(x.done),Vt(x.done);if(x.done.length&&!Vt(x.done).ranges)return Vt(x.done);if(x.done.length>1&&!x.done[x.done.length-2].ranges)return x.done.pop(),Vt(x.done)}function ec(x,z,ne,te){var ie=x.history;ie.undone.length=0;var ce=+new Date,ge,Se;if((ie.lastOp==te||ie.lastOrigin==z.origin&&z.origin&&(z.origin.charAt(0)=="+"&&ie.lastModTime>ce-(x.cm?x.cm.options.historyEventDelay:500)||z.origin.charAt(0)=="*"))&&(ge=Kc(ie,ie.lastOp==te)))Se=Vt(ge.changes),dn(z.from,z.to)==0&&dn(z.from,Se.to)==0?Se.to=us(z):ge.changes.push(zc(x,z));else{var Ee=Vt(ie.done);for((!Ee||!Ee.ranges)&&tc(x.sel,ie.done),ge={changes:[zc(x,z)],generation:ie.generation},ie.done.push(ge);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=ce,ie.lastOp=ie.lastSelOp=te,ie.lastOrigin=ie.lastSelOrigin=z.origin,Se||Fe(x,"historyAdded")}function Hc(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 Wc(x,z,ne,te){var ie=x.history,ce=te&&te.origin;ne==ie.lastSelOp||ce&&ie.lastSelOrigin==ce&&(ie.lastModTime==ie.lastSelTime&&ie.lastOrigin==ce||Hc(x,ce,Vt(ie.done),z))?ie.done[ie.done.length-1]=z:tc(z,ie.done),ie.lastSelTime=+new Date,ie.lastSelOrigin=ce,ie.lastSelOp=ne,te&&te.clearRedo!==!1&&Hu(ie.undone)}function tc(x,z){var ne=Vt(z);ne&&ne.ranges&&ne.equals(x)||z.push(x)}function Zc(x,z,ne,te){var ie=z["spans_"+x.id],ce=0;x.iter(Math.max(x.first,ne),Math.min(x.first+x.size,te),function(ge){ge.markedSpans&&((ie||(ie=z["spans_"+x.id]={}))[ce]=ge.markedSpans),++ce})}function jc(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(jc(ne[ie]));return te}function Wu(x,z){var ne=Xd(x,z),te=_n(x,z);if(!ne)return te;if(!te)return ne;for(var ie=0;ie<ne.length;++ie){var ce=ne[ie],ge=te[ie];if(ce&&ge)e:for(var Se=0;Se<ge.length;++Se){for(var Ee=ge[Se],Oe=0;Oe<ce.length;++Oe)if(ce[Oe].marker==Ee.marker)continue e;ce.push(Ee)}else ge&&(ne[ie]=ge)}return ne}function ol(x,z,ne){for(var te=[],ie=0;ie<x.length;++ie){var ce=x[ie];if(ce.ranges){te.push(ne?go.prototype.deepCopy.call(ce):ce);continue}var ge=ce.changes,Se=[];te.push({changes:Se});for(var Ee=0;Ee<ge.length;++Ee){var Oe=ge[Ee],gt=void 0;if(Se.push({from:Oe.from,to:Oe.to,text:Oe.text}),z)for(var _t in Oe)(gt=_t.match(/^spans_(\d+)$/))&&ht(z,Number(gt[1]))>-1&&(Vt(Se)[_t]=Oe[_t],delete Oe[_t])}}return te}function Vc(x,z,ne,te){if(te){var ie=x.anchor;if(ne){var ce=dn(z,ie)<0;ce!=dn(ne,ie)<0?(ie=z,z=ne):ce!=dn(z,ne)<0&&(z=ne)}return new Fi(ie,z)}else return new Fi(ne||z,z)}function sl(x,z,ne,te,ie){ie==null&&(ie=x.cm&&(x.cm.display.shift||x.extend)),Ca(x,new go([Vc(x.sel.primary(),z,ne,ie)],0),te)}function Wr(x,z,ne){for(var te=[],ie=x.cm&&(x.cm.display.shift||x.extend),ce=0;ce<x.sel.ranges.length;ce++)te[ce]=Vc(x.sel.ranges[ce],z[ce],null,ie);var ge=Io(x.cm,te,x.sel.primIndex);Ca(x,ge,ne)}function So(x,z,ne,te){var ie=x.sel.ranges.slice(0);ie[z]=ne,Ca(x,Io(x.cm,ie,x.sel.primIndex),te)}function Zu(x,z,ne,te){Ca(x,Ro(z,ne),te)}function Yd(x,z,ne){var te={ranges:z.ranges,update:function(ie){this.ranges=[];for(var ce=0;ce<ie.length;ce++)this.ranges[ce]=new Fi(Et(x,ie[ce].anchor),Et(x,ie[ce].head))},origin:ne&&ne.origin};return Fe(x,"beforeSelectionChange",x,te),x.cm&&Fe(x.cm,"beforeSelectionChange",x.cm,te),te.ranges!=z.ranges?Io(x.cm,te.ranges,te.ranges.length-1):z}function no(x,z,ne){var te=x.history.done,ie=Vt(te);ie&&ie.ranges?(te[te.length-1]=z,nc(x,z,ne)):Ca(x,z,ne)}function Ca(x,z,ne){nc(x,z,ne),Wc(x,x.sel,x.cm?x.cm.curOp.id:NaN,ne)}function nc(x,z,ne){(en(x,"beforeSelectionChange")||x.cm&&en(x.cm,"beforeSelectionChange"))&&(z=Yd(x,z,ne));var te=ne&&ne.bias||(dn(z.primary().head,x.sel.primary().head)<0?-1:1);Jd(x,ll(x,z,te,!0)),!(ne&&ne.scroll===!1)&&x.cm&&Qs(x.cm)}function Jd(x,z){z.equals(x.sel)||(x.sel=z,x.cm&&(x.cm.curOp.updateInput=1,x.cm.curOp.selectionChanged=!0,Zt(x.cm)),zr(x,"cursorActivity",x))}function qd(x){Jd(x,ll(x,x.sel,null,!1))}function ll(x,z,ne,te){for(var ie,ce=0;ce<z.ranges.length;ce++){var ge=z.ranges[ce],Se=z.ranges.length==x.sel.ranges.length&&x.sel.ranges[ce],Ee=Uc(x,ge.anchor,Se&&Se.anchor,ne,te),Oe=Uc(x,ge.head,Se&&Se.head,ne,te);(ie||Ee!=ge.anchor||Oe!=ge.head)&&(ie||(ie=z.ranges.slice(0,ce)),ie[ce]=new Fi(Ee,Oe))}return ie?Io(x.cm,ie,z.primIndex):z}function ro(x,z,ne,te,ie){var ce=qe(x,z.line);if(ce.markedSpans)for(var ge=0;ge<ce.markedSpans.length;++ge){var Se=ce.markedSpans[ge],Ee=Se.marker,Oe="selectLeft"in Ee?!Ee.selectLeft:Ee.inclusiveLeft,gt="selectRight"in Ee?!Ee.selectRight:Ee.inclusiveRight;if((Se.from==null||(Oe?Se.from<=z.ch:Se.from<z.ch))&&(Se.to==null||(gt?Se.to>=z.ch:Se.to>z.ch))){if(ie&&(Fe(Ee,"beforeCursorEnter"),Ee.explicitlyCleared))if(ce.markedSpans){--ge;continue}else break;if(!Ee.atomic)continue;if(ne){var _t=Ee.find(te<0?1:-1),fn=void 0;if((te<0?gt:Oe)&&(_t=hs(x,_t,-te,_t&&_t.line==z.line?ce:null)),_t&&_t.line==z.line&&(fn=dn(_t,ne))&&(te<0?fn<0:fn>0))return ro(x,_t,z,te,ie)}var sn=Ee.find(te<0?-1:1);return(te<0?Oe:gt)&&(sn=hs(x,sn,te,sn.line==z.line?ce:null)),sn?ro(x,sn,z,te,ie):null}}return z}function Uc(x,z,ne,te,ie){var ce=te||1,ge=ro(x,z,ne,ce,ie)||!ie&&ro(x,z,ne,ce,!0)||ro(x,z,ne,-ce,ie)||!ie&&ro(x,z,ne,-ce,!0);return ge||(x.cantEdit=!0,At(x.first,0))}function hs(x,z,ne,te){return ne<0&&z.ch==0?z.line>x.first?Et(x,At(z.line-1)):null:ne>0&&z.ch==(te||qe(x,z.line)).text.length?z.line<x.first+x.size-1?At(z.line+1,0):null:new At(z.line,z.ch+ne)}function ju(x){x.setSelection(At(x.firstLine(),0),At(x.lastLine()),Xe)}function Gc(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,ce,ge,Se){ie&&(te.from=Et(x,ie)),ce&&(te.to=Et(x,ce)),ge&&(te.text=ge),Se!==void 0&&(te.origin=Se)}),Fe(x,"beforeChange",x,te),x.cm&&Fe(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 Ds(x,z,ne){if(x.cm){if(!x.cm.curOp)return Sa(x.cm,Ds)(x,z,ne);if(x.cm.state.suppressEdits)return}if(!((en(x,"beforeChange")||x.cm&&en(x.cm,"beforeChange"))&&(z=Gc(x,z,!0),!z))){var te=fr&&!ne&&gr(x,z.from,z.to);if(te)for(var ie=te.length-1;ie>=0;--ie)Vu(x,{from:te[ie].from,to:te[ie].to,text:ie?[""]:z.text,origin:z.origin});else Vu(x,z)}}function Vu(x,z){if(!(z.text.length==1&&z.text[0]==""&&dn(z.from,z.to)==0)){var ne=Oc(x,z);ec(x,z,ne,x.cm?x.cm.curOp.id:NaN),cl(x,z,ne,_n(x,z));var te=[];ds(x,function(ie,ce){!ce&&ht(te,ie.history)==-1&&(rc(ie.history,z),te.push(ie.history)),cl(ie,z,null,_n(ie,z))})}}function fs(x,z,ne){var te=x.cm&&x.cm.state.suppressEdits;if(!(te&&!ne)){for(var ie=x.history,ce,ge=x.sel,Se=z=="undo"?ie.done:ie.undone,Ee=z=="undo"?ie.undone:ie.done,Oe=0;Oe<Se.length&&(ce=Se[Oe],!(ne?ce.ranges&&!ce.equals(x.sel):!ce.ranges));Oe++);if(Oe!=Se.length){for(ie.lastOrigin=ie.lastSelOrigin=null;;)if(ce=Se.pop(),ce.ranges){if(tc(ce,Ee),ne&&!ce.equals(x.sel)){Ca(x,ce,{clearRedo:!1});return}ge=ce}else if(te){Se.push(ce);return}else break;var gt=[];tc(ge,Ee),Ee.push({changes:gt,generation:ie.generation}),ie.generation=ce.generation||++ie.maxGeneration;for(var _t=en(x,"beforeChange")||x.cm&&en(x.cm,"beforeChange"),fn=function(Wn){var vr=ce.changes[Wn];if(vr.origin=z,_t&&!Gc(x,vr,!1))return Se.length=0,{};gt.push(zc(x,vr));var Ar=Wn?Oc(x,vr):Vt(Se);cl(x,vr,Ar,Wu(x,vr)),!Wn&&x.cm&&x.cm.scrollIntoView({from:vr.from,to:us(vr)});var Rr=[];ds(x,function(Cr,Kr){!Kr&&ht(Rr,Cr.history)==-1&&(rc(Cr.history,vr),Rr.push(Cr.history)),cl(Cr,vr,null,Wu(Cr,vr))})},sn=ce.changes.length-1;sn>=0;--sn){var Bn=fn(sn);if(Bn)return Bn.v}}}}function Xc(x,z){if(z!=0&&(x.first+=z,x.sel=new go(Gt(x.sel.ranges,function(ie){return new Fi(At(ie.anchor.line+z,ie.anchor.ch),At(ie.head.line+z,ie.head.ch))}),x.sel.primIndex),x.cm)){za(x.cm,x.first,x.first-z,z);for(var ne=x.cm.display,te=ne.viewFrom;te<ne.viewTo;te++)Ao(x.cm,te,"gutter")}}function cl(x,z,ne,te){if(x.cm&&!x.cm.curOp)return Sa(x.cm,cl)(x,z,ne,te);if(z.to.line<x.first){Xc(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);Xc(x,ie),z={from:At(x.first,0),to:At(z.to.line+ie,z.to.ch),text:[Vt(z.text)],origin:z.origin}}var ce=x.lastLine();z.to.line>ce&&(z={from:z.from,to:At(ce,qe(x,ce).text.length),text:[z.text[0]],origin:z.origin}),z.removed=dt(x,z.from,z.to),ne||(ne=Oc(x,z)),x.cm?Qd(x.cm,z,te):Nc(x,z,te),nc(x,ne,Xe),x.cantEdit&&Uc(x,At(x.firstLine(),0))&&(x.cantEdit=!1)}}function Qd(x,z,ne){var te=x.doc,ie=x.display,ce=z.from,ge=z.to,Se=!1,Ee=ce.line;x.options.lineWrapping||(Ee=Yt($r(qe(te,ce.line))),te.iter(Ee,ge.line+1,function(sn){if(sn==ie.maxLine)return Se=!0,!0})),te.sel.contains(z.from,z.to)>-1&&Zt(x),Nc(te,z,ne,Ya(x)),x.options.lineWrapping||(te.iter(Ee,ce.line+z.text.length,function(sn){var Bn=Vn(sn);Bn>ie.maxLineLength&&(ie.maxLine=sn,ie.maxLineLength=Bn,ie.maxLineChanged=!0,Se=!1)}),Se&&(x.curOp.updateMaxLine=!0)),In(te,ce.line),nl(x,400);var Oe=z.text.length-(ge.line-ce.line)-1;z.full?za(x):ce.line==ge.line&&z.text.length==1&&!Ku(x.doc,z)?Ao(x,ce.line,"text"):za(x,ce.line,ge.line+1,Oe);var gt=en(x,"changes"),_t=en(x,"change");if(_t||gt){var fn={from:ce,to:ge,text:z.text,removed:z.removed,origin:z.origin};_t&&zr(x,"change",x,fn),gt&&(x.curOp.changeObjs||(x.curOp.changeObjs=[])).push(fn)}x.display.selForContextMenu=null}function Ml(x,z,ne,te,ie){var ce;te||(te=ne),dn(te,ne)<0&&(ce=[te,ne],ne=ce[0],te=ce[1]),typeof z=="string"&&(z=x.splitLines(z)),Ds(x,{from:ne,to:te,text:z,origin:ie})}function eh(x,z,ne,te){ne<x.line?x.line+=te:z<x.line&&(x.line=z,x.ch=0)}function th(x,z,ne,te){for(var ie=0;ie<x.length;++ie){var ce=x[ie],ge=!0;if(ce.ranges){ce.copied||(ce=x[ie]=ce.deepCopy(),ce.copied=!0);for(var Se=0;Se<ce.ranges.length;Se++)eh(ce.ranges[Se].anchor,z,ne,te),eh(ce.ranges[Se].head,z,ne,te);continue}for(var Ee=0;Ee<ce.changes.length;++Ee){var Oe=ce.changes[Ee];if(ne<Oe.from.line)Oe.from=At(Oe.from.line+te,Oe.from.ch),Oe.to=At(Oe.to.line+te,Oe.to.ch);else if(z<=Oe.to.line){ge=!1;break}}ge||(x.splice(0,ie+1),ie=0)}}function rc(x,z){var ne=z.from.line,te=z.to.line,ie=z.text.length-(te-ne)-1;th(x.done,ne,te,ie),th(x.undone,ne,te,ie)}function ic(x,z,ne,te){var ie=z,ce=z;return typeof z=="number"?ce=qe(x,an(x,z)):ie=Yt(z),ie==null?null:(te(ce,ie)&&x.cm&&Ao(x.cm,ie,ne),ce)}function As(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}As.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,xi(ie),zr(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 kl(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}kl.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 ce=Math.min(z,ie-x),ge=te.height;if(te.removeInner(x,ce),this.height-=ge-te.height,ie==ce&&(this.children.splice(ne--,1),te.parent=null),(z-=ce)==0)break;x=0}else x-=ie}if(this.size-z<25&&(this.children.length>1||!(this.children[0]instanceof As))){var Se=[];this.collapse(Se),this.children=[new As(Se)],this.children[0].parent=this}},collapse:function(x){for(var z=0;z<this.children.length;++z)this.children[z].collapse(x)},insertInner:function(x,z,ne){this.size+=z.length,this.height+=ne;for(var te=0;te<this.children.length;++te){var ie=this.children[te],ce=ie.chunkSize();if(x<=ce){if(ie.insertInner(x,z,ne),ie.lines&&ie.lines.length>50){for(var ge=ie.lines.length%25+25,Se=ge;Se<ie.lines.length;){var Ee=new As(ie.lines.slice(Se,Se+=25));ie.height-=Ee.height,this.children.splice(++te,0,Ee),Ee.parent=this}ie.lines=ie.lines.slice(0,ge),this.maybeSpill()}break}x-=ce}},maybeSpill:function(){if(!(this.children.length<=10)){var x=this;do{var z=x.children.splice(x.children.length-5,5),ne=new kl(z);if(x.parent){x.size-=ne.size,x.height-=ne.height;var ie=ht(x.parent.children,x);x.parent.children.splice(ie+1,0,ne)}else{var te=new kl(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],ce=ie.chunkSize();if(x<ce){var ge=Math.min(z,ce-x);if(ie.iterN(x,ge,ne))return!0;if((z-=ge)==0)break;x=0}else x-=ce}}};var _l=function(x,z,ne){if(ne)for(var te in ne)ne.hasOwnProperty(te)&&(this[te]=ne[te]);this.doc=x,this.node=z};_l.prototype.clear=function(){var x=this.doc.cm,z=this.line.widgets,ne=this.line,te=Yt(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 ce=ao(this);Ot(ne,Math.max(0,ne.height-ce)),x&&(pa(x,function(){nh(x,ne,-ce),Ao(x,te,"widget")}),zr(x,"lineWidgetCleared",x,this,te))}},_l.prototype.changed=function(){var x=this,z=this.height,ne=this.doc.cm,te=this.line;this.height=null;var ie=ao(this)-z;ie&&(yi(this.doc,te)||Ot(te,te.height+ie),ne&&pa(ne,function(){ne.curOp.forceUpdate=!0,nh(ne,te,ie),zr(ne,"lineWidgetChanged",ne,x,Yt(te))}))},ln(_l);function nh(x,z,ne){Yn(z)<(x.curOp&&x.curOp.scrollTop||x.doc.scrollTop)&&Lc(x,ne)}function rh(x,z,ne,te){var ie=new _l(x,ne,te),ce=x.cm;return ce&&ie.noHScroll&&(ce.display.alignWidgets=!0),ic(x,z,"widget",function(ge){var Se=ge.widgets||(ge.widgets=[]);if(ie.insertAt==null?Se.push(ie):Se.splice(Math.min(Se.length-1,Math.max(0,ie.insertAt)),0,ie),ie.line=ge,ce&&!yi(x,ge)){var Ee=Yn(ge)<x.scrollTop;Ot(ge,ge.height+ao(ie)),Ee&&Lc(ce,ie.height),ce.curOp.forceUpdate=!0}return!0}),ce&&zr(ce,"lineWidgetAdded",ce,ie,typeof z=="number"?z:Yt(z)),ie}var ih=0,Ts=function(x,z){this.lines=[],this.type=z,this.doc=x,this.id=++ih};Ts.prototype.clear=function(){if(!this.explicitlyCleared){var x=this.doc.cm,z=x&&!x.curOp;if(z&&Ls(x),en(this,"clear")){var ne=this.find();ne&&zr(this,"clear",ne.from,ne.to)}for(var te=null,ie=null,ce=0;ce<this.lines.length;++ce){var ge=this.lines[ce],Se=br(ge.markedSpans,this);x&&!this.collapsed?Ao(x,Yt(ge),"text"):x&&(Se.to!=null&&(ie=Yt(ge)),Se.from!=null&&(te=Yt(ge))),ge.markedSpans=ur(ge.markedSpans,Se),Se.from==null&&this.collapsed&&!yi(this.doc,ge)&&x&&Ot(ge,as(x.display))}if(x&&this.collapsed&&!x.options.lineWrapping)for(var Ee=0;Ee<this.lines.length;++Ee){var Oe=$r(this.lines[Ee]),gt=Vn(Oe);gt>x.display.maxLineLength&&(x.display.maxLine=Oe,x.display.maxLineLength=gt,x.display.maxLineChanged=!0)}te!=null&&x&&this.collapsed&&za(x,te,ie+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,x&&qd(x.doc)),x&&zr(x,"markerCleared",x,this,te,ie),z&&cs(x),this.parent&&this.parent.clear()}},Ts.prototype.find=function(x,z){x==null&&this.type=="bookmark"&&(x=1);for(var ne,te,ie=0;ie<this.lines.length;++ie){var ce=this.lines[ie],ge=br(ce.markedSpans,this);if(ge.from!=null&&(ne=At(z?ce:Yt(ce),ge.from),x==-1))return ne;if(ge.to!=null&&(te=At(z?ce:Yt(ce),ge.to),x==1))return te}return ne&&{from:ne,to:te}},Ts.prototype.changed=function(){var x=this,z=this.find(-1,!0),ne=this,te=this.doc.cm;!z||!te||pa(te,function(){var ie=z.line,ce=Yt(z.line),ge=Xa(te,ce);if(ge&&(Ki(ge),te.curOp.selectionChanged=te.curOp.forceUpdate=!0),te.curOp.updateMaxLine=!0,!yi(ne.doc,ie)&&ne.height!=null){var Se=ne.height;ne.height=null;var Ee=ao(ne)-Se;Ee&&Ot(ie,ie.height+Ee)}zr(te,"markerChanged",te,x)})},Ts.prototype.attachLine=function(x){if(!this.lines.length&&this.doc.cm){var z=this.doc.cm.curOp;(!z.maybeHiddenMarkers||ht(z.maybeHiddenMarkers,this)==-1)&&(z.maybeUnhiddenMarkers||(z.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(x)},Ts.prototype.detachLine=function(x){if(this.lines.splice(ht(this.lines,x),1),!this.lines.length&&this.doc.cm){var z=this.doc.cm.curOp;(z.maybeHiddenMarkers||(z.maybeHiddenMarkers=[])).push(this)}},ln(Ts);function ps(x,z,ne,te,ie){if(te&&te.shared)return ra(x,z,ne,te,ie);if(x.cm&&!x.cm.curOp)return Sa(x.cm,ps)(x,z,ne,te,ie);var ce=new Ts(x,ie),ge=dn(z,ne);if(te&&mt(te,ce,!1),ge>0||ge==0&&ce.clearWhenEmpty!==!1)return ce;if(ce.replacedWith&&(ce.collapsed=!0,ce.widgetNode=jt("span",[ce.replacedWith],"CodeMirror-widget"),te.handleMouseEvents||ce.widgetNode.setAttribute("cm-ignore-events","true"),te.insertLeft&&(ce.widgetNode.insertLeft=!0)),ce.collapsed){if(Dr(x,z.line,z,ne,ce)||z.line!=ne.line&&Dr(x,ne.line,z,ne,ce))throw new Error("Inserting collapsed marker partially overlapping an existing one");Gn()}ce.addToHistory&&ec(x,{from:z,to:ne,origin:"markText"},x.sel,NaN);var Se=z.line,Ee=x.cm,Oe;if(x.iter(Se,ne.line+1,function(_t){Ee&&ce.collapsed&&!Ee.options.lineWrapping&&$r(_t)==Ee.display.maxLine&&(Oe=!0),ce.collapsed&&Se!=z.line&&Ot(_t,0),Br(_t,new Xn(ce,Se==z.line?z.ch:null,Se==ne.line?ne.ch:null)),++Se}),ce.collapsed&&x.iter(z.line,ne.line+1,function(_t){yi(x,_t)&&Ot(_t,0)}),ce.clearOnEnter&&hn(ce,"beforeCursorEnter",function(){return ce.clear()}),ce.readOnly&&(yr(),(x.history.done.length||x.history.undone.length)&&x.clearHistory()),ce.collapsed&&(ce.id=++ih,ce.atomic=!0),Ee){if(Oe&&(Ee.curOp.updateMaxLine=!0),ce.collapsed)za(Ee,z.line,ne.line+1);else if(ce.className||ce.startStyle||ce.endStyle||ce.css||ce.attributes||ce.title)for(var gt=z.line;gt<=ne.line;gt++)Ao(Ee,gt,"text");ce.atomic&&qd(Ee.doc),zr(Ee,"markerAdded",Ee,ce)}return ce}var Si=function(x,z){this.markers=x,this.primary=z;for(var ne=0;ne<x.length;++ne)x[ne].parent=this};Si.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var x=0;x<this.markers.length;++x)this.markers[x].clear();zr(this,"clear")}},Si.prototype.find=function(x,z){return this.primary.find(x,z)},ln(Si);function ra(x,z,ne,te,ie){te=mt(te),te.shared=!1;var ce=[ps(x,z,ne,te,ie)],ge=ce[0],Se=te.widgetNode;return ds(x,function(Ee){Se&&(te.widgetNode=Se.cloneNode(!0)),ce.push(ps(Ee,Et(Ee,z),Et(Ee,ne),te,ie));for(var Oe=0;Oe<Ee.linked.length;++Oe)if(Ee.linked[Oe].isParent)return;ge=Vt(ce)}),new Si(ce,ge)}function Is(x){return x.findMarks(At(x.first,0),x.clipPos(At(x.lastLine())),function(z){return z.parent})}function ah(x,z){for(var ne=0;ne<z.length;ne++){var te=z[ne],ie=te.find(),ce=x.clipPos(ie.from),ge=x.clipPos(ie.to);if(dn(ce,ge)){var Se=ps(x,ce,ge,te.primary,te.primary.type);te.markers.push(Se),Se.parent=te}}}function Co(x){for(var z=function(te){var ie=x[te],ce=[ie.primary.doc];ds(ie.primary.doc,function(Ee){return ce.push(Ee)});for(var ge=0;ge<ie.markers.length;ge++){var Se=ie.markers[ge];ht(ce,Se.doc)==-1&&(Se.parent=null,ie.markers.splice(ge--,1))}},ne=0;ne<x.length;ne++)z(ne)}var oh=0,ya=function(x,z,ne,te,ie){if(!(this instanceof ya))return new ya(x,z,ne,te,ie);ne==null&&(ne=0),kl.call(this,[new As([new mr("",null)])]),this.first=ne,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=ne;var ce=At(ne,0);this.sel=Ro(ce),this.history=new Ql(null),this.id=++oh,this.modeOption=z,this.lineSep=te,this.direction=ie=="rtl"?"rtl":"ltr",this.extend=!1,typeof x=="string"&&(x=this.splitLines(x)),Nc(this,{from:ce,to:ce,text:x}),Ca(this,Ro(ce),Xe)};ya.prototype=se(kl.prototype,{constructor:ya,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=Xt(this,this.first,this.first+this.size);return x===!1?z:z.join(x||this.lineSeparator())},setValue:Ia(function(x){var z=At(this.first,0),ne=this.first+this.size-1;Ds(this,{from:z,to:At(ne,qe(this,ne).text.length),text:this.splitLines(x),origin:"setValue",full:!0},!0),this.cm&&el(this.cm,0,0),Ca(this,Ro(z),Xe)}),replaceRange:function(x,z,ne,te){z=Et(this,z),ne=ne?Et(this,ne):z,Ml(this,x,z,ne,te)},getRange:function(x,z,ne){var te=dt(this,Et(this,x),Et(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(vn(this,x))return qe(this,x)},getLineNumber:function(x){return Yt(x)},getLineHandleVisualStart:function(x){return typeof x=="number"&&(x=qe(this,x)),$r(x)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(x){return Et(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:Ia(function(x,z,ne){Zu(this,Et(this,typeof x=="number"?At(x,z||0):x),null,ne)}),setSelection:Ia(function(x,z,ne){Zu(this,Et(this,x),Et(this,z||x),ne)}),extendSelection:Ia(function(x,z,ne){sl(this,Et(this,x),z&&Et(this,z),ne)}),extendSelections:Ia(function(x,z){Wr(this,Be(this,x),z)}),extendSelectionsBy:Ia(function(x,z){var ne=Gt(this.sel.ranges,x);Wr(this,Be(this,ne),z)}),setSelections:Ia(function(x,z,ne){if(x.length){for(var te=[],ie=0;ie<x.length;ie++)te[ie]=new Fi(Et(this,x[ie].anchor),Et(this,x[ie].head));z==null&&(z=Math.min(x.length-1,this.sel.primIndex)),Ca(this,Io(this.cm,te,z),ne)}}),addSelection:Ia(function(x,z,ne){var te=this.sel.ranges.slice(0);te.push(new Fi(Et(this,x),Et(this,z||x))),Ca(this,Io(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=dt(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=dt(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:Ia(function(x,z,ne){for(var te=[],ie=this.sel,ce=0;ce<ie.ranges.length;ce++){var ge=ie.ranges[ce];te[ce]={from:ge.from(),to:ge.to(),text:this.splitLines(x[ce]),origin:ne}}for(var Se=z&&z!="end"&&$c(this,te,z),Ee=te.length-1;Ee>=0;Ee--)Ds(this,te[Ee]);Se?no(this,Se):this.cm&&Qs(this.cm)}),undo:Ia(function(){fs(this,"undo")}),redo:Ia(function(){fs(this,"redo")}),undoSelection:Ia(function(){fs(this,"undo",!0)}),redoSelection:Ia(function(){fs(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 Ql(this.history.maxGeneration),ds(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:ol(this.history.done),undone:ol(this.history.undone)}},setHistory:function(x){var z=this.history=new Ql(this.history.maxGeneration);z.done=ol(x.done.slice(0),null,!0),z.undone=ol(x.undone.slice(0),null,!0)},setGutterMarker:Ia(function(x,z,ne){return ic(this,x,"gutter",function(te){var ie=te.gutterMarkers||(te.gutterMarkers={});return ie[z]=ne,!ne&&le(ie)&&(te.gutterMarkers=null),!0})}),clearGutter:Ia(function(x){var z=this;this.iter(function(ne){ne.gutterMarkers&&ne.gutterMarkers[x]&&ic(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(!vn(this,x)||(z=x,x=qe(this,x),!x))return null}else if(z=Yt(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:Ia(function(x,z,ne){return ic(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(ke(ne).test(te[ie]))return!1;te[ie]+=" "+ne}return!0})}),removeLineClass:Ia(function(x,z,ne){return ic(this,x,z=="gutter"?"gutter":"class",function(te){var ie=z=="text"?"textClass":z=="background"?"bgClass":z=="gutter"?"gutterClass":"wrapClass",ce=te[ie];if(ce)if(ne==null)te[ie]=null;else{var ge=ce.match(ke(ne));if(!ge)return!1;var Se=ge.index+ge[0].length;te[ie]=ce.slice(0,ge.index)+(!ge.index||Se==ce.length?"":" ")+ce.slice(Se)||null}else return!1;return!0})}),addLineWidget:Ia(function(x,z,ne){return rh(this,x,z,ne)}),removeLineWidget:function(x){x.clear()},markText:function(x,z,ne){return ps(this,Et(this,x),Et(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=Et(this,x),ps(this,x,x,ne,"bookmark")},findMarksAt:function(x){x=Et(this,x);var z=[],ne=qe(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=Et(this,x),z=Et(this,z);var te=[],ie=x.line;return this.iter(x.line,z.line+1,function(ce){var ge=ce.markedSpans;if(ge)for(var Se=0;Se<ge.length;Se++){var Ee=ge[Se];!(Ee.to!=null&&ie==x.line&&x.ch>=Ee.to||Ee.from==null&&ie!=x.line||Ee.from!=null&&ie==z.line&&Ee.from>=z.ch)&&(!ne||ne(Ee.marker))&&te.push(Ee.marker.parent||Ee.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 ce=ie.text.length+te;if(ce>x)return z=x,!0;x-=ce,++ne}),Et(this,At(ne,z))},indexFromPos:function(x){x=Et(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 ya(Xt(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 ya(Xt(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}],ah(te,Is(this)),te},unlinkDoc:function(x){if(x instanceof si&&(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),Co(Is(this));break}}if(x.history==this.history){var te=[x.id];ds(x,function(ie){return te.push(ie.id)},!0),x.history=new Ql(null),x.history.done=ol(this.history.done,te),x.history.undone=ol(this.history.undone,te)}},iterLinkedDocs:function(x){ds(this,x)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(x){return this.lineSep?x.split(this.lineSep):Mr(x)},lineSeparator:function(){return this.lineSep||`
|
|
|
`},setDirection:Ia(function(x){x!="rtl"&&(x="ltr"),x!=this.direction&&(this.direction=x,this.iter(function(z){return z.order=null}),this.cm&&Fc(this.cm))})}),ya.prototype.eachLine=ya.prototype.iter;var Uu=0;function Qh(x){var z=this;if(El(z),!(Ge(z,x)||oo(z.display,x))){Dn(x),be&&(Uu=+new Date);var ne=xo(z,x,!0),te=x.dataTransfer.files;if(!(!ne||z.isReadOnly()))if(te&&te.length&&window.FileReader&&window.File)for(var ie=te.length,ce=Array(ie),ge=0,Se=function(){++ge==ie&&Sa(z,function(){ne=Et(z.doc,ne);var sn={from:ne,to:ne,text:z.doc.splitLines(ce.filter(function(Bn){return Bn!=null}).join(z.doc.lineSeparator())),origin:"paste"};Ds(z.doc,sn),no(z.doc,Ro(Et(z.doc,ne),Et(z.doc,us(sn))))})()},Ee=function(sn,Bn){if(z.options.allowDropFileTypes&&ht(z.options.allowDropFileTypes,sn.type)==-1){Se();return}var Wn=new FileReader;Wn.onerror=function(){return Se()},Wn.onload=function(){var vr=Wn.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(vr)){Se();return}ce[Bn]=vr,Se()},Wn.readAsText(sn)},Oe=0;Oe<te.length;Oe++)Ee(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 gt=x.dataTransfer.getData("Text");if(gt){var _t;if(z.state.draggingText&&!z.state.draggingText.copy&&(_t=z.listSelections()),nc(z.doc,Ro(ne,ne)),_t)for(var fn=0;fn<_t.length;++fn)Ml(z.doc,"",_t[fn].anchor,_t[fn].head,"drag");z.replaceSelection(gt,"around","paste"),z.display.input.focus()}}catch(sn){}}}}function ef(x,z){if(be&&(!x.state.draggingText||+new Date-Uu<100)){Fn(z);return}if(!(Ge(x,z)||oo(x.display,z))&&(z.dataTransfer.setData("Text",x.getSelection()),z.dataTransfer.effectAllowed="copyMove",z.dataTransfer.setDragImage&&!ut)){var ne=Ve("img",null,null,"position: fixed; left: 0; top: 0;");ne.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",ze&&(ne.width=ne.height=1,x.display.wrapper.appendChild(ne),ne._top=ne.offsetTop),z.dataTransfer.setDragImage(ne,0,0),ze&&ne.parentNode.removeChild(ne)}}function Gu(x,z){var ne=xo(x,z);if(ne){var te=document.createDocumentFragment();_u(x,ne,te),x.display.dragCursor||(x.display.dragCursor=Ve("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),x.display.lineSpace.insertBefore(x.display.dragCursor,x.display.cursorDiv)),bt(x.display.dragCursor,te)}}function El(x){x.display.dragCursor&&(x.display.lineSpace.removeChild(x.display.dragCursor),x.display.dragCursor=null)}function Ll(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 ce=0;ce<ne.length;ce++)x(ne[ce])})}}var or=!1;function Xu(){or||(Yc(),or=!0)}function Yc(){var x;hn(window,"resize",function(){x==null&&(x=setTimeout(function(){x=null,Ll(Jc)},100))}),hn(window,"blur",function(){return Ll(qs)})}function Jc(x){var z=x.display;z.cachedCharWidth=z.cachedTextHeight=z.cachedPaddingH=null,z.scrollbarsClipped=!1,x.setSize()}for(var No={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++)No[ac+48]=No[ac+96]=String(ac);for(var qc=65;qc<=90;qc++)No[qc]=String.fromCharCode(qc);for(var oc=1;oc<=12;oc++)No[oc+111]=No[oc+63235]="F"+oc;var Yi={};Yi.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"},Yi.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"},Yi.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"},Yi.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"]},Yi.default=at?Yi.macDefault:Yi.pcDefault;function tf(x){var z=x.split(/-(?!$)/);x=z[z.length-1];for(var ne,te,ie,ce,ge=0;ge<z.length-1;ge++){var Se=z[ge];if(/^(cmd|meta|m)$/i.test(Se))ce=!0;else if(/^a(lt)?$/i.test(Se))ne=!0;else if(/^(c|ctrl|control)$/i.test(Se))te=!0;else if(/^s(hift)?$/i.test(Se))ie=!0;else throw new Error("Unrecognized modifier name: "+Se)}return ne&&(x="Alt-"+x),te&&(x="Ctrl-"+x),ce&&(x="Cmd-"+x),ie&&(x="Shift-"+x),x}function Yu(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=Gt(ne.split(" "),tf),ce=0;ce<ie.length;ce++){var ge=void 0,Se=void 0;ce==ie.length-1?(Se=ie.join(" "),ge=te):(Se=ie.slice(0,ce+1).join(" "),ge="...");var Ee=z[Se];if(!Ee)z[Se]=ge;else if(Ee!=ge)throw new Error("Inconsistent bindings for "+Se)}delete x[ne]}for(var Oe in z)x[Oe]=z[Oe];return x}function ms(x,z,ne,te){z=io(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 ms(x,z.fallthrough,ne,te);for(var ce=0;ce<z.fallthrough.length;ce++){var ge=ms(x,z.fallthrough[ce],ne,te);if(ge)return ge}}}function sc(x){var z=typeof x=="string"?x:No[x.keyCode];return z=="Ctrl"||z=="Alt"||z=="Shift"||z=="Mod"}function Ps(x,z,ne){var te=x;return z.altKey&&te!="Alt"&&(x="Alt-"+x),(ft?z.metaKey:z.ctrlKey)&&te!="Ctrl"&&(x="Ctrl-"+x),(ft?z.ctrlKey:z.metaKey)&&te!="Mod"&&(x="Cmd-"+x),!ne&&z.shiftKey&&te!="Shift"&&(x="Shift-"+x),x}function ul(x,z){if(ze&&x.keyCode==34&&x.char)return!1;var ne=No[x.keyCode];return ne==null||x.altGraphKey?!1:(x.keyCode==3&&x.code&&(ne=x.code),Ps(ne,x,z))}function io(x){return typeof x=="string"?Yi[x]:x}function Po(x,z){for(var ne=x.doc.sel.ranges,te=[],ie=0;ie<ne.length;ie++){for(var ce=z(ne[ie]);te.length&&dn(ce.from,Vt(te).to)<=0;){var ge=te.pop();if(dn(ge.from,ce.from)<0){ce.from=ge.from;break}}te.push(ce)}pa(x,function(){for(var Se=te.length-1;Se>=0;Se--)Ml(x.doc,"",te[Se].from,te[Se].to,"+delete");Qs(x)})}function Ha(x,z,ne){var te=Kt(x.text,z+ne,ne);return te<0||te>x.text.length?null:te}function Uo(x,z,ne){var te=Ha(x,z.ch,ne);return te==null?null:new At(z.line,te,ne<0?"after":"before")}function dl(x,z,ne,te,ie){if(x){z.doc.direction=="rtl"&&(ie=-ie);var ce=Cn(ne,z.doc.direction);if(ce){var ge=ie<0?Vt(ce):ce[0],Se=ie<0==(ge.level==1),Ee=Se?"after":"before",Oe;if(ge.level>0||z.doc.direction=="rtl"){var gt=Oa(z,ne);Oe=ie<0?ne.text.length-1:0;var _t=Oi(z,gt,Oe).top;Oe=$t(function(fn){return Oi(z,gt,fn).top==_t},ie<0==(ge.level==1)?ge.from:ge.to-1,Oe),Ee=="before"&&(Oe=Ha(ne,Oe,1))}else Oe=ie<0?ge.to:ge.from;return new At(te,Oe,Ee)}}return new At(te,ie<0?ne.text.length:0,ie<0?"before":"after")}function Go(x,z,ne,te){var ie=Cn(z,x.doc.direction);if(!ie)return Uo(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 ce=on(ie,ne.ch,ne.sticky),ge=ie[ce];if(x.doc.direction=="ltr"&&ge.level%2==0&&(te>0?ge.to>ne.ch:ge.from<ne.ch))return Uo(z,ne,te);var Se=function(Ar,Rr){return Ha(z,Ar instanceof At?Ar.ch:Ar,Rr)},Ee,Oe=function(Ar){return x.options.lineWrapping?(Ee=Ee||Oa(x,z),Hl(x,z,Ee,Ar)):{begin:0,end:z.text.length}},gt=Oe(ne.sticky=="before"?Se(ne,-1):ne.ch);if(x.doc.direction=="rtl"||ge.level==1){var _t=ge.level==1==te<0,fn=Se(ne,_t?1:-1);if(fn!=null&&(_t?fn<=ge.to&&fn<=gt.end:fn>=ge.from&&fn>=gt.begin)){var sn=_t?"before":"after";return new At(ne.line,fn,sn)}}var Bn=function(Ar,Rr,Cr){for(var Kr=function(qi,Na){return Na?new At(ne.line,Se(qi,1),"before"):new At(ne.line,qi,"after")};Ar>=0&&Ar<ie.length;Ar+=Rr){var Qr=ie[Ar],ti=Rr>0==(Qr.level!=1),Ci=ti?Cr.begin:Se(Cr.end,-1);if(Qr.from<=Ci&&Ci<Qr.to||(Ci=ti?Qr.from:Se(Qr.to,-1),Cr.begin<=Ci&&Ci<Cr.end))return Kr(Ci,ti)}},Wn=Bn(ce+te,te,gt);if(Wn)return Wn;var vr=te>0?gt.end:Se(gt.begin,-1);return vr!=null&&!(te>0&&vr==z.text.length)&&(Wn=Bn(te>0?0:ie.length-1,te,Oe(vr)),Wn)?Wn:null}var Dl={selectAll:ju,singleSelection:function(x){return x.setSelection(x.getCursor("anchor"),x.getCursor("head"),Xe)},killLine:function(x){return Po(x,function(z){if(z.empty()){var ne=qe(x.doc,z.head.line).text.length;return z.head.ch==ne&&z.head.line<x.lastLine()?{from:z.head,to:At(z.head.line+1,0)}:{from:z.head,to:At(z.head.line,ne)}}else return{from:z.from(),to:z.to()}})},deleteLine:function(x){return Po(x,function(z){return{from:At(z.from().line,0),to:Et(x.doc,At(z.to().line+1,0))}})},delLineLeft:function(x){return Po(x,function(z){return{from:At(z.from().line,0),to:z.from()}})},delWrappedLineLeft:function(x){return Po(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 Po(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(At(x.firstLine(),0))},goDocEnd:function(x){return x.extendSelection(At(x.lastLine()))},goLineStart:function(x){return x.extendSelectionsBy(function(z){return Ju(x,z.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(x){return x.extendSelectionsBy(function(z){return sh(x,z.head)},{origin:"+move",bias:1})},goLineEnd:function(x){return x.extendSelectionsBy(function(z){return qu(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")},Dt)},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")},Dt)},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/)?sh(x,z.head):te},Dt)},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 ce=ne[ie].from(),ge=$e(x.getLine(ce.line),ce.ch,te);z.push(un(te-ge%te))}x.replaceSelections(z)},defaultTab:function(x){x.somethingSelected()?x.indentSelection("add"):x.execCommand("insertTab")},transposeChars:function(x){return pa(x,function(){for(var z=x.listSelections(),ne=[],te=0;te<z.length;te++)if(z[te].empty()){var ie=z[te].head,ce=qe(x.doc,ie.line).text;if(ce){if(ie.ch==ce.length&&(ie=new At(ie.line,ie.ch-1)),ie.ch>0)ie=new At(ie.line,ie.ch+1),x.replaceRange(ce.charAt(ie.ch-1)+ce.charAt(ie.ch-2),At(ie.line,ie.ch-2),ie,"+transpose");else if(ie.line>x.doc.first){var ge=qe(x.doc,ie.line-1).text;ge&&(ie=new At(ie.line,1),x.replaceRange(ce.charAt(0)+x.doc.lineSeparator()+ge.charAt(ge.length-1),At(ie.line-1,ge.length-1),ie,"+transpose"))}}ne.push(new Fi(ie,ie))}x.setSelections(ne)})},newlineAndIndent:function(x){return pa(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);Qs(x)})},openLine:function(x){return x.replaceSelection(`
|
|
|
`,"start")},toggleOverwrite:function(x){return x.toggleOverwrite()}};function Ju(x,z){var ne=qe(x.doc,z),te=$r(ne);return te!=ne&&(z=Yt(te)),dl(!0,x,te,z,1)}function qu(x,z){var ne=qe(x.doc,z),te=li(ne);return te!=ne&&(z=Yt(te)),dl(!0,x,ne,z,-1)}function sh(x,z){var ne=Ju(x,z.line),te=qe(x.doc,ne.line),ie=Cn(te,x.doc.direction);if(!ie||ie[0].level==0){var ce=Math.max(ne.ch,te.text.search(/\S/)),ge=z.line==ne.line&&z.ch<=ce&&z.ch;return At(ne.line,ge?0:ce,ne.sticky)}return ne}function Ma(x,z,ne){if(typeof z=="string"&&(z=Dl[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)!=Ut}finally{x.display.shift=te,x.state.suppressEdits=!1}return ie}function Xo(x,z,ne){for(var te=0;te<x.state.keyMaps.length;te++){var ie=ms(z,x.state.keyMaps[te],ne,x);if(ie)return ie}return x.options.extraKeys&&ms(z,x.options.extraKeys,ne,x)||ms(z,x.options.keyMap,ne,x)}var nf=new xe;function Al(x,z,ne,te){var ie=x.state.keySeq;if(ie){if(sc(z))return"handled";if(/\'$/.test(z)?x.state.keySeq=null:nf.set(50,function(){x.state.keySeq==ie&&(x.state.keySeq=null,x.display.input.reset())}),Qc(x,ie+" "+z,ne,te))return!0}return Qc(x,z,ne,te)}function Qc(x,z,ne,te){var ie=Xo(x,z,te);return ie=="multi"&&(x.state.keySeq=z),ie=="handled"&&zr(x,"keyHandled",x,z,ne),(ie=="handled"||ie=="multi")&&(Dn(ne),_c(x)),!!ie}function Di(x,z){var ne=ul(z,!0);return ne?z.shiftKey&&!x.state.keySeq?Al(x,"Shift-"+ne,z,function(te){return Ma(x,te,!0)})||Al(x,ne,z,function(te){if(typeof te=="string"?/^go[A-Z]/.test(te):te.motion)return Ma(x,te)}):Al(x,ne,z,function(te){return Ma(x,te)}):!1}function Tl(x,z,ne){return Al(x,"'"+ne+"'",z,function(te){return Ma(x,te,!0)})}var gs=null;function lc(x){var z=this;if(!(x.target&&x.target!=z.display.input.getField())&&(z.curOp.focus=Qe(),!Ge(z,x))){be&&Ae<11&&x.keyCode==27&&(x.returnValue=!1);var ne=x.keyCode;z.display.shift=ne==16||x.shiftKey;var te=Di(z,x);ze&&(gs=te?ne:null,!te&&ne==88&&!Or&&(at?x.metaKey:x.ctrlKey)&&z.replaceSelection("",null,"cut")),me&&!at&&!te&&ne==46&&x.shiftKey&&!x.ctrlKey&&document.execCommand&&document.execCommand("cut"),ne==18&&!/\bCodeMirror-crosshair\b/.test(z.display.lineDiv.className)&&Pn(z)}}function Pn(x){var z=x.display.lineDiv;zt(z,"CodeMirror-crosshair");function ne(te){(te.keyCode==18||!te.altKey)&&(He(z,"CodeMirror-crosshair"),tt(document,"keyup",ne),tt(document,"mouseover",ne))}hn(document,"keyup",ne),hn(document,"mouseover",ne)}function lh(x){x.keyCode==16&&(this.doc.sel.shift=!1),Ge(this,x)}function ch(x){var z=this;if(!(x.target&&x.target!=z.display.input.getField())&&!(oo(z.display,x)||Ge(z,x)||x.ctrlKey&&!x.altKey||at&&x.metaKey)){var ne=x.keyCode,te=x.charCode;if(ze&&ne==gs){gs=null,Dn(x);return}if(!(ze&&(!x.which||x.which<10)&&Di(z,x))){var ie=String.fromCharCode(te==null?ne:te);ie!="\b"&&(Tl(z,x,ie)||z.display.input.onKeyPress(x))}}}var Qu=400,ed=function(x,z,ne){this.time=x,this.pos=z,this.button=ne};ed.prototype.compare=function(x,z,ne){return this.time+Qu>x&&dn(z,this.pos)==0&&ne==this.button};var vs,cc;function rf(x,z){var ne=+new Date;return cc&&cc.compare(ne,x,z)?(vs=cc=null,"triple"):vs&&vs.compare(ne,x,z)?(cc=new ed(ne,x,z),vs=null,"double"):(vs=new ed(ne,x,z),cc=null,"single")}function Wa(x){var z=this,ne=z.display;if(!(Ge(z,x)||ne.activeTouch&&ne.input.supportsTouch())){if(ne.input.ensurePolled(),ne.shift=x.shiftKey,oo(ne,x)){Ne||(ne.scroller.draggable=!1,setTimeout(function(){return ne.scroller.draggable=!0},100));return}if(!Ja(z,x)){var te=xo(z,x),ie=An(x),ce=te?rf(te,ie):"single";window.focus(),ie==1&&z.state.selectingText&&z.state.selectingText(x),!(te&&Bs(z,ie,te,ce,x))&&(ie==1?te?tu(z,te,ce,x):jn(x)==ne.scroller&&Dn(x):ie==2?(te&&sl(z.doc,te),setTimeout(function(){return ne.input.focus()},20)):ie==3&&(Ze?z.display.input.onContextMenu(x):Eu(z)))}}}function Bs(x,z,ne,te,ie){var ce="Click";return te=="double"?ce="Double"+ce:te=="triple"&&(ce="Triple"+ce),ce=(z==1?"Left":z==2?"Middle":"Right")+ce,Al(x,Ps(ce,ie),ie,function(ge){if(typeof ge=="string"&&(ge=Dl[ge]),!ge)return!1;var Se=!1;try{x.isReadOnly()&&(x.state.suppressEdits=!0),Se=ge(x,ne)!=Ut}finally{x.state.suppressEdits=!1}return Se})}function eu(x,z,ne){var te=x.getOption("configureMouse"),ie=te?te(x,z,ne):{};if(ie.unit==null){var ce=St?ne.shiftKey&&ne.metaKey:ne.altKey;ie.unit=ce?"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=at?ne.metaKey:ne.ctrlKey),ie.moveOnDrag==null&&(ie.moveOnDrag=!(at?ne.altKey:ne.ctrlKey)),ie}function tu(x,z,ne,te){be?setTimeout(Rt(Sl,x),0):x.curOp.focus=Qe();var ie=eu(x,ne,te),ce=x.doc.sel,ge;x.options.dragDrop&&hr&&!x.isReadOnly()&&ne=="single"&&(ge=ce.contains(z))>-1&&(dn((ge=ce.ranges[ge]).from(),z)<0||z.xRel>0)&&(dn(ge.to(),z)>0||z.xRel<0)?af(x,te,z,ie):td(x,te,z,ie)}function af(x,z,ne,te){var ie=x.display,ce=!1,ge=Sa(x,function(Oe){Ne&&(ie.scroller.draggable=!1),x.state.draggingText=!1,tt(ie.wrapper.ownerDocument,"mouseup",ge),tt(ie.wrapper.ownerDocument,"mousemove",Se),tt(ie.scroller,"dragstart",Ee),tt(ie.scroller,"drop",ge),ce||(Dn(Oe),te.addNew||sl(x.doc,ne,null,null,te.extend),Ne&&!ut||be&&Ae==9?setTimeout(function(){ie.wrapper.ownerDocument.body.focus({preventScroll:!0}),ie.input.focus()},20):ie.input.focus())}),Se=function(Oe){ce=ce||Math.abs(z.clientX-Oe.clientX)+Math.abs(z.clientY-Oe.clientY)>=10},Ee=function(){return ce=!0};Ne&&(ie.scroller.draggable=!0),x.state.draggingText=ge,ge.copy=!te.moveOnDrag,ie.scroller.dragDrop&&ie.scroller.dragDrop(),hn(ie.wrapper.ownerDocument,"mouseup",ge),hn(ie.wrapper.ownerDocument,"mousemove",Se),hn(ie.scroller,"dragstart",Ee),hn(ie.scroller,"drop",ge),Eu(x),setTimeout(function(){return ie.input.focus()},20)}function uh(x,z,ne){if(ne=="char")return new Fi(z,z);if(ne=="word")return x.findWordAt(z);if(ne=="line")return new Fi(At(z.line,0),Et(x.doc,At(z.line+1,0)));var te=ne(x,z);return new Fi(te.from,te.to)}function td(x,z,ne,te){var ie=x.display,ce=x.doc;Dn(z);var ge,Se,Ee=ce.sel,Oe=Ee.ranges;if(te.addNew&&!te.extend?(Se=ce.sel.contains(ne),Se>-1?ge=Oe[Se]:ge=new Fi(ne,ne)):(ge=ce.sel.primary(),Se=ce.sel.primIndex),te.unit=="rectangle")te.addNew||(ge=new Fi(ne,ne)),ne=xo(x,z,!0,!0),Se=-1;else{var gt=uh(x,ne,te.unit);te.extend?ge=Vc(ge,gt.anchor,gt.head,te.extend):ge=gt}te.addNew?Se==-1?(Se=Oe.length,Ca(ce,Io(x,Oe.concat([ge]),Se),{scroll:!1,origin:"*mouse"})):Oe.length>1&&Oe[Se].empty()&&te.unit=="char"&&!te.extend?(Ca(ce,Io(x,Oe.slice(0,Se).concat(Oe.slice(Se+1)),0),{scroll:!1,origin:"*mouse"}),Ee=ce.sel):So(ce,Se,ge,Ye):(Se=0,Ca(ce,new go([ge],0),Ye),Ee=ce.sel);var _t=ne;function fn(Cr){if(dn(_t,Cr)!=0)if(_t=Cr,te.unit=="rectangle"){for(var Kr=[],Qr=x.options.tabSize,ti=$e(qe(ce,ne.line).text,ne.ch,Qr),Ci=$e(qe(ce,Cr.line).text,Cr.ch,Qr),qi=Math.min(ti,Ci),Na=Math.max(ti,Ci),da=Math.min(ne.line,Cr.line),co=Math.min(x.lastLine(),Math.max(ne.line,Cr.line));da<=co;da++){var uo=qe(ce,da).text,ka=bn(uo,qi,Qr);qi==Na?Kr.push(new Fi(At(da,ka),At(da,ka))):uo.length>ka&&Kr.push(new Fi(At(da,ka),At(da,bn(uo,Na,Qr))))}Kr.length||Kr.push(new Fi(ne,ne)),Ca(ce,Io(x,Ee.ranges.slice(0,Se).concat(Kr),Se),{origin:"*mouse",scroll:!1}),x.scrollIntoView(Cr)}else{var ho=ge,hi=uh(x,Cr,te.unit),ma=ho.anchor,ha;dn(hi.anchor,ma)>0?(ha=hi.head,ma=Pt(ho.from(),hi.anchor)):(ha=hi.anchor,ma=Lt(ho.to(),hi.head));var ga=Ee.ranges.slice(0);ga[Se]=dh(x,new Fi(Et(ce,ma),ha)),Ca(ce,Io(x,ga,Se),Ye)}}var sn=ie.wrapper.getBoundingClientRect(),Bn=0;function Wn(Cr){var Kr=++Bn,Qr=xo(x,Cr,!0,te.unit=="rectangle");if(Qr)if(dn(Qr,_t)!=0){x.curOp.focus=Qe(),fn(Qr);var ti=Ta(ie,ce);(Qr.line>=ti.to||Qr.line<ti.from)&&setTimeout(Sa(x,function(){Bn==Kr&&Wn(Cr)}),150)}else{var Ci=Cr.clientY<sn.top?-20:Cr.clientY>sn.bottom?20:0;Ci&&setTimeout(Sa(x,function(){Bn==Kr&&(ie.scroller.scrollTop+=Ci,Wn(Cr))}),50)}}function vr(Cr){x.state.selectingText=!1,Bn=1/0,Cr&&(Dn(Cr),ie.input.focus()),tt(ie.wrapper.ownerDocument,"mousemove",Ar),tt(ie.wrapper.ownerDocument,"mouseup",Rr),ce.history.lastSelOrigin=null}var Ar=Sa(x,function(Cr){Cr.buttons===0||!An(Cr)?vr(Cr):Wn(Cr)}),Rr=Sa(x,vr);x.state.selectingText=Rr,hn(ie.wrapper.ownerDocument,"mousemove",Ar),hn(ie.wrapper.ownerDocument,"mouseup",Rr)}function dh(x,z){var ne=z.anchor,te=z.head,ie=qe(x.doc,ne.line);if(dn(ne,te)==0&&ne.sticky==te.sticky)return z;var ce=Cn(ie);if(!ce)return z;var ge=on(ce,ne.ch,ne.sticky),Se=ce[ge];if(Se.from!=ne.ch&&Se.to!=ne.ch)return z;var Ee=ge+(Se.from==ne.ch==(Se.level!=1)?0:1);if(Ee==0||Ee==ce.length)return z;var Oe;if(te.line!=ne.line)Oe=(te.line-ne.line)*(x.doc.direction=="ltr"?1:-1)>0;else{var gt=on(ce,te.ch,te.sticky),_t=gt-ge||(te.ch-ne.ch)*(Se.level==1?-1:1);gt==Ee-1||gt==Ee?Oe=_t<0:Oe=_t>0}var fn=ce[Ee+(Oe?-1:0)],sn=Oe==(fn.level==1),Bn=sn?fn.from:fn.to,Wn=sn?"after":"before";return ne.ch==Bn&&ne.sticky==Wn?z:new Fi(new At(ne.line,Bn,Wn),te)}function uc(x,z,ne,te){var ie,ce;if(z.touches)ie=z.touches[0].clientX,ce=z.touches[0].clientY;else try{ie=z.clientX,ce=z.clientY}catch(fn){return!1}if(ie>=Math.floor(x.display.gutters.getBoundingClientRect().right))return!1;te&&Dn(z);var ge=x.display,Se=ge.lineDiv.getBoundingClientRect();if(ce>Se.bottom||!en(x,ne))return En(z);ce-=Se.top-ge.viewOffset;for(var Ee=0;Ee<x.display.gutterSpecs.length;++Ee){var Oe=ge.gutters.childNodes[Ee];if(Oe&&Oe.getBoundingClientRect().right>=ie){var gt=pn(x.doc,ce),_t=x.display.gutterSpecs[Ee];return Fe(x,ne,x,gt,_t.className,z),En(z)}}}function Ja(x,z){return uc(x,z,"gutterClick",!0)}function Os(x,z){oo(x.display,z)||hh(x,z)||Ge(x,z,"contextmenu")||Ze||x.display.input.onContextMenu(z)}function hh(x,z){return en(x,"gutterContextMenu")?uc(x,z,"gutterContextMenu",!1):!1}function nd(x){x.display.wrapper.className=x.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+x.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Xi(x)}var $s={toString:function(){return"CodeMirror.Init"}},fh={},nu={};function of(x){var z=x.optionHandlers;function ne(te,ie,ce,ge){x.defaults[te]=ie,ce&&(z[te]=ge?function(Se,Ee,Oe){Oe!=$s&&ce(Se,Ee,Oe)}:ce)}x.defineOption=ne,x.Init=$s,ne("value","",function(te,ie){return te.setValue(ie)},!0),ne("mode",null,function(te,ie){te.doc.modeOption=ie,Rc(te)},!0),ne("indentUnit",2,Rc,!0),ne("indentWithTabs",!1),ne("smartIndent",!0),ne("tabSize",4,function(te){al(te),Xi(te),za(te)},!0),ne("lineSeparator",null,function(te,ie){if(te.doc.lineSep=ie,!!ie){var ce=[],ge=te.doc.first;te.doc.iter(function(Ee){for(var Oe=0;;){var gt=Ee.text.indexOf(ie,Oe);if(gt==-1)break;Oe=gt+ie.length,ce.push(At(ge,gt))}ge++});for(var Se=ce.length-1;Se>=0;Se--)Ml(te.doc,ie,ce[Se],At(ce[Se].line,ce[Se].ch+ie.length))}}),ne("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(te,ie,ce){te.state.specialChars=new RegExp(ie.source+(ie.test(" ")?"":"| "),"g"),ce!=$s&&te.refresh()}),ne("specialCharPlaceholder",Hi,function(te){return te.refresh()},!0),ne("electricChars",!0),ne("inputStyle",pt?"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",!Qt),ne("wholeLineUpdateBefore",!0),ne("theme","default",function(te){nd(te),Cl(te)},!0),ne("keyMap","default",function(te,ie,ce){var ge=io(ie),Se=ce!=$s&&io(ce);Se&&Se.detach&&Se.detach(te,ge),ge.attach&&ge.attach(te,Se||null)}),ne("extraKeys",null),ne("configureMouse",null),ne("lineWrapping",!1,ph,!0),ne("gutters",[],function(te,ie){te.display.gutterSpecs=Bc(ie,te.options.lineNumbers),Cl(te)},!0),ne("fixedGutter",!0,function(te,ie){te.display.gutters.style.left=ie?ji(te.display)+"px":"0",te.refresh()},!0),ne("coverGutterNextToScrollbar",!1,function(te){return Es(te)},!0),ne("scrollbarStyle","native",function(te){Iu(te),Es(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=Bc(te.options.gutters,ie),Cl(te)},!0),ne("firstLineNumber",1,Cl,!0),ne("lineNumberFormatter",function(te){return te},Cl,!0),ne("showCursorWhenSelecting",!1,wl,!0),ne("resetSelectionOnContextMenu",!0),ne("lineWiseCopyCut",!0),ne("pasteLinesPerSelection",!0),ne("selectionsMayTouch",!1),ne("readOnly",!1,function(te,ie){ie=="nocursor"&&(qs(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,sf),ne("allowDropFileTypes",null),ne("cursorBlinkRate",530),ne("cursorScrollMargin",0),ne("cursorHeight",1,wl,!0),ne("singleCursorHeightPerLine",!0,wl,!0),ne("workTime",100),ne("workDelay",100),ne("flattenSpans",!0,al,!0),ne("addModeClass",!1,al,!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,al,!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 sf(x,z,ne){var te=ne&&ne!=$s;if(!z!=!te){var ie=x.display.dragFunctions,ce=z?hn:tt;ce(x.display.scroller,"dragstart",ie.start),ce(x.display.scroller,"dragenter",ie.enter),ce(x.display.scroller,"dragover",ie.over),ce(x.display.scroller,"dragleave",ie.leave),ce(x.display.scroller,"drop",ie.drop)}}function ph(x){x.options.lineWrapping?(zt(x.display.wrapper,"CodeMirror-wrap"),x.display.sizer.style.minWidth="",x.display.sizerWidth=null):(He(x.display.wrapper,"CodeMirror-wrap"),Zn(x)),Aa(x),za(x),Xi(x),setTimeout(function(){return Es(x)},100)}function si(x,z){var ne=this;if(!(this instanceof si))return new si(x,z);this.options=z=z?mt(z):{},mt(fh,z,!1);var te=z.value;typeof te=="string"?te=new ya(te,z.mode,null,z.lineSeparator,z.direction):z.mode&&(te.modeOption=z.mode),this.doc=te;var ie=new si.inputStyles[z.inputStyle](this),ce=this.display=new Gd(x,te,ie,z);ce.wrapper.CodeMirror=this,nd(this),z.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Iu(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 xe,keySeq:null,specialChars:null},z.autofocus&&!pt&&ce.input.focus(),be&&Ae<11&&setTimeout(function(){return ne.display.input.reset(!0)},20),lf(this),Xu(),Ls(this),this.curOp.forceUpdate=!0,Jl(this,te),z.autofocus&&!pt||this.hasFocus()?setTimeout(function(){ne.hasFocus()&&!ne.state.focused&&Ec(ne)},20):qs(this);for(var ge in nu)nu.hasOwnProperty(ge)&&nu[ge](this,z[ge],$s);Xl(this),z.finishInit&&z.finishInit(this);for(var Se=0;Se<rd.length;++Se)rd[Se](this);cs(this),Ne&&z.lineWrapping&&getComputedStyle(ce.lineDiv).textRendering=="optimizelegibility"&&(ce.lineDiv.style.textRendering="auto")}si.defaults=fh,si.optionHandlers=nu;function lf(x){var z=x.display;hn(z.scroller,"mousedown",Sa(x,Wa)),be&&Ae<11?hn(z.scroller,"dblclick",Sa(x,function(Ee){if(!Ge(x,Ee)){var Oe=xo(x,Ee);if(!(!Oe||Ja(x,Ee)||oo(x.display,Ee))){Dn(Ee);var gt=x.findWordAt(Oe);sl(x.doc,gt.anchor,gt.head)}}})):hn(z.scroller,"dblclick",function(Ee){return Ge(x,Ee)||Dn(Ee)}),hn(z.scroller,"contextmenu",function(Ee){return Os(x,Ee)}),hn(z.input.getField(),"contextmenu",function(Ee){z.scroller.contains(Ee.target)||Os(x,Ee)});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 ce(Ee){if(Ee.touches.length!=1)return!1;var Oe=Ee.touches[0];return Oe.radiusX<=1&&Oe.radiusY<=1}function ge(Ee,Oe){if(Oe.left==null)return!0;var gt=Oe.left-Ee.left,_t=Oe.top-Ee.top;return gt*gt+_t*_t>20*20}hn(z.scroller,"touchstart",function(Ee){if(!Ge(x,Ee)&&!ce(Ee)&&!Ja(x,Ee)){z.input.ensurePolled(),clearTimeout(ne);var Oe=+new Date;z.activeTouch={start:Oe,moved:!1,prev:Oe-te.end<=300?te:null},Ee.touches.length==1&&(z.activeTouch.left=Ee.touches[0].pageX,z.activeTouch.top=Ee.touches[0].pageY)}}),hn(z.scroller,"touchmove",function(){z.activeTouch&&(z.activeTouch.moved=!0)}),hn(z.scroller,"touchend",function(Ee){var Oe=z.activeTouch;if(Oe&&!oo(z,Ee)&&Oe.left!=null&&!Oe.moved&&new Date-Oe.start<300){var gt=x.coordsChar(z.activeTouch,"page"),_t;!Oe.prev||ge(Oe,Oe.prev)?_t=new Fi(gt,gt):!Oe.prev.prev||ge(Oe,Oe.prev.prev)?_t=x.findWordAt(gt):_t=new Fi(At(gt.line,0),Et(x.doc,At(gt.line+1,0))),x.setSelection(_t.anchor,_t.head),x.focus(),Dn(Ee)}ie()}),hn(z.scroller,"touchcancel",ie),hn(z.scroller,"scroll",function(){z.scroller.clientHeight&&(ks(x,z.scroller.scrollTop),_s(x,z.scroller.scrollLeft,!0),Fe(x,"scroll",x))}),hn(z.scroller,"mousewheel",function(Ee){return Fu(x,Ee)}),hn(z.scroller,"DOMMouseScroll",function(Ee){return Fu(x,Ee)}),hn(z.wrapper,"scroll",function(){return z.wrapper.scrollTop=z.wrapper.scrollLeft=0}),z.dragFunctions={enter:function(Ee){Ge(x,Ee)||Fn(Ee)},over:function(Ee){Ge(x,Ee)||(Gu(x,Ee),Fn(Ee))},start:function(Ee){return ef(x,Ee)},drop:Sa(x,Qh),leave:function(Ee){Ge(x,Ee)||El(x)}};var Se=z.input.getField();hn(Se,"keyup",function(Ee){return lh.call(x,Ee)}),hn(Se,"keydown",Sa(x,lc)),hn(Se,"keypress",Sa(x,ch)),hn(Se,"focus",function(Ee){return Ec(x,Ee)}),hn(Se,"blur",function(Ee){return qs(x,Ee)})}var rd=[];si.defineInitHook=function(x){return rd.push(x)};function Fo(x,z,ne,te){var ie=x.doc,ce;ne==null&&(ne="add"),ne=="smart"&&(ie.mode.indent?ce=Ft(x,z).state:ne="prev");var ge=x.options.tabSize,Se=qe(ie,z),Ee=$e(Se.text,null,ge);Se.stateAfter&&(Se.stateAfter=null);var Oe=Se.text.match(/^\s*/)[0],gt;if(!te&&!/\S/.test(Se.text))gt=0,ne="not";else if(ne=="smart"&&(gt=ie.mode.indent(ce,Se.text.slice(Oe.length),Se.text),gt==Ut||gt>150)){if(!te)return;ne="prev"}ne=="prev"?z>ie.first?gt=$e(qe(ie,z-1).text,null,ge):gt=0:ne=="add"?gt=Ee+x.options.indentUnit:ne=="subtract"?gt=Ee-x.options.indentUnit:typeof ne=="number"&&(gt=Ee+ne),gt=Math.max(0,gt);var _t="",fn=0;if(x.options.indentWithTabs)for(var sn=Math.floor(gt/ge);sn;--sn)fn+=ge,_t+=" ";if(fn<gt&&(_t+=un(gt-fn)),_t!=Oe)return Ml(ie,_t,At(z,0),At(z,Oe.length),"+input"),Se.stateAfter=null,!0;for(var Bn=0;Bn<ie.sel.ranges.length;Bn++){var Wn=ie.sel.ranges[Bn];if(Wn.head.line==z&&Wn.head.ch<Oe.length){var vr=At(z,Oe.length);So(ie,Bn,new Fi(vr,vr));break}}}var zo=null;function Rs(x){zo=x}function id(x,z,ne,te,ie){var ce=x.doc;x.display.shift=!1,te||(te=ce.sel);var ge=+new Date-200,Se=ie=="paste"||x.state.pasteIncoming>ge,Ee=Mr(z),Oe=null;if(Se&&te.ranges.length>1)if(zo&&zo.text.join(`
|
|
|
`)==z){if(te.ranges.length%zo.text.length==0){Oe=[];for(var gt=0;gt<zo.text.length;gt++)Oe.push(ce.splitLines(zo.text[gt]))}}else Ee.length==te.ranges.length&&x.options.pasteLinesPerSelection&&(Oe=Gt(Ee,function(Ar){return[Ar]}));for(var _t=x.curOp.updateInput,fn=te.ranges.length-1;fn>=0;fn--){var sn=te.ranges[fn],Bn=sn.from(),Wn=sn.to();sn.empty()&&(ne&&ne>0?Bn=At(Bn.line,Bn.ch-ne):x.state.overwrite&&!Se?Wn=At(Wn.line,Math.min(qe(ce,Wn.line).text.length,Wn.ch+Vt(Ee).length)):Se&&zo&&zo.lineWise&&zo.text.join(`
|
|
|
`)==Ee.join(`
|
|
|
`)&&(Bn=Wn=At(Bn.line,0)));var vr={from:Bn,to:Wn,text:Oe?Oe[fn%Oe.length]:Ee,origin:ie||(Se?"paste":x.state.cutIncoming>ge?"cut":"+input")};Ds(x.doc,vr),zr(x,"inputRead",x,vr)}z&&!Se&&od(x,z),Qs(x),x.curOp.updateInput<2&&(x.curOp.updateInput=_t),x.curOp.typing=!0,x.state.pasteIncoming=x.state.cutIncoming=-1}function ad(x,z){var ne=x.clipboardData&&x.clipboardData.getData("Text");if(ne)return x.preventDefault(),!z.isReadOnly()&&!z.options.disableInput&&pa(z,function(){return id(z,ne,0,null,"paste")}),!0}function od(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 ce=x.getModeAt(ie.head),ge=!1;if(ce.electricChars){for(var Se=0;Se<ce.electricChars.length;Se++)if(z.indexOf(ce.electricChars.charAt(Se))>-1){ge=Fo(x,ie.head.line,"smart");break}}else ce.electricInput&&ce.electricInput.test(qe(x.doc,ie.head.line).text.slice(0,ie.head.ch))&&(ge=Fo(x,ie.head.line,"smart"));ge&&zr(x,"electricInput",x,ie.head.line)}}}function Il(x){for(var z=[],ne=[],te=0;te<x.doc.sel.ranges.length;te++){var ie=x.doc.sel.ranges[te].head.line,ce={anchor:At(ie,0),head:At(ie+1,0)};ne.push(ce),z.push(x.getRange(ce.anchor,ce.head))}return{text:z,ranges:ne}}function mh(x,z,ne,te){x.setAttribute("autocorrect",ne?"":"off"),x.setAttribute("autocapitalize",te?"":"off"),x.setAttribute("spellcheck",!!z)}function sd(){var x=Ve("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),z=Ve("div",[x],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return Ne?x.style.width="1000px":x.setAttribute("wrap","off"),yt&&(x.style.border="1px solid black"),mh(x),z}function ld(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 ce=this.options,ge=ce[te];ce[te]==ie&&te!="mode"||(ce[te]=ie,z.hasOwnProperty(te)&&Sa(this,z[te])(this,ie,ge),Fe(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"](io(te))},removeKeyMap:function(te){for(var ie=this.state.keyMaps,ce=0;ce<ie.length;++ce)if(ie[ce]==te||ie[ce].name==te)return ie.splice(ce,1),!0},addOverlay:ua(function(te,ie){var ce=te.token?te:x.getMode(this.options,te);if(ce.startState)throw new Error("Overlays may not be stateful.");Wt(this.state.overlays,{mode:ce,modeSpec:te,opaque:ie&&ie.opaque,priority:ie&&ie.priority||0},function(ge){return ge.priority}),this.state.modeGen++,za(this)}),removeOverlay:ua(function(te){for(var ie=this.state.overlays,ce=0;ce<ie.length;++ce){var ge=ie[ce].modeSpec;if(ge==te||typeof te=="string"&&ge.name==te){ie.splice(ce,1),this.state.modeGen++,za(this);return}}}),indentLine:ua(function(te,ie,ce){typeof ie!="string"&&typeof ie!="number"&&(ie==null?ie=this.options.smartIndent?"smart":"prev":ie=ie?"add":"subtract"),vn(this.doc,te)&&Fo(this,te,ie,ce)}),indentSelection:ua(function(te){for(var ie=this.doc.sel.ranges,ce=-1,ge=0;ge<ie.length;ge++){var Se=ie[ge];if(Se.empty())Se.head.line>ce&&(Fo(this,Se.head.line,te,!0),ce=Se.head.line,ge==this.doc.sel.primIndex&&Qs(this));else{var Ee=Se.from(),Oe=Se.to(),gt=Math.max(ce,Ee.line);ce=Math.min(this.lastLine(),Oe.line-(Oe.ch?0:1))+1;for(var _t=gt;_t<ce;++_t)Fo(this,_t,te);var fn=this.doc.sel.ranges;Ee.ch==0&&ie.length==fn.length&&fn[ge].from().ch>0&&So(this.doc,ge,new Fi(Ee,fn[ge].to()),Xe)}}}),getTokenAt:function(te,ie){return zn(this,te,ie)},getLineTokens:function(te,ie){return zn(this,At(te),ie,!0)},getTokenTypeAt:function(te){te=Et(this.doc,te);var ie=Tt(this,qe(this.doc,te.line)),ce=0,ge=(ie.length-1)/2,Se=te.ch,Ee;if(Se==0)Ee=ie[2];else for(;;){var Oe=ce+ge>>1;if((Oe?ie[Oe*2-1]:0)>=Se)ge=Oe;else if(ie[Oe*2+1]<Se)ce=Oe+1;else{Ee=ie[Oe*2+2];break}}var gt=Ee?Ee.indexOf("overlay "):-1;return gt<0?Ee:gt==0?null:Ee.slice(0,gt-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 ce=[];if(!ne.hasOwnProperty(ie))return ce;var ge=ne[ie],Se=this.getModeAt(te);if(typeof Se[ie]=="string")ge[Se[ie]]&&ce.push(ge[Se[ie]]);else if(Se[ie])for(var Ee=0;Ee<Se[ie].length;Ee++){var Oe=ge[Se[ie][Ee]];Oe&&ce.push(Oe)}else Se.helperType&&ge[Se.helperType]?ce.push(ge[Se.helperType]):ge[Se.name]&&ce.push(ge[Se.name]);for(var gt=0;gt<ge._global.length;gt++){var _t=ge._global[gt];_t.pred(Se,this)&&ht(ce,_t.val)==-1&&ce.push(_t.val)}return ce},getStateAfter:function(te,ie){var ce=this.doc;return te=an(ce,te==null?ce.first+ce.size-1:te),Ft(this,te+1,ie).state},cursorCoords:function(te,ie){var ce,ge=this.doc.sel.primary();return te==null?ce=ge.head:typeof te=="object"?ce=Et(this.doc,te):ce=te?ge.from():ge.to(),Da(this,ce,ie||"page")},charCoords:function(te,ie){return lo(this,Et(this.doc,te),ie||"page")},coordsChar:function(te,ie){return te=so(this,te,ie||"page"),Js(this,te.left,te.top)},lineAtHeight:function(te,ie){return te=so(this,{top:te,left:0},ie||"page").top,pn(this.doc,te+this.display.viewOffset)},heightAtLine:function(te,ie,ce){var ge=!1,Se;if(typeof te=="number"){var Ee=this.doc.first+this.doc.size-1;te<this.doc.first?te=this.doc.first:te>Ee&&(te=Ee,ge=!0),Se=qe(this.doc,te)}else Se=te;return Ra(this,Se,{top:0,left:0},ie||"page",ce||ge).top+(ge?this.doc.height-Yn(Se):0)},defaultTextHeight:function(){return as(this.display)},defaultCharWidth:function(){return Ii(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(te,ie,ce,ge,Se){var Ee=this.display;te=Da(this,Et(this.doc,te));var Oe=te.bottom,gt=te.left;if(ie.style.position="absolute",ie.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(ie),Ee.sizer.appendChild(ie),ge=="over")Oe=te.top;else if(ge=="above"||ge=="near"){var _t=Math.max(Ee.wrapper.clientHeight,this.doc.height),fn=Math.max(Ee.sizer.clientWidth,Ee.lineSpace.clientWidth);(ge=="above"||te.bottom+ie.offsetHeight>_t)&&te.top>ie.offsetHeight?Oe=te.top-ie.offsetHeight:te.bottom+ie.offsetHeight<=_t&&(Oe=te.bottom),gt+ie.offsetWidth>fn&&(gt=fn-ie.offsetWidth)}ie.style.top=Oe+"px",ie.style.left=ie.style.right="",Se=="right"?(gt=Ee.sizer.clientWidth-ie.offsetWidth,ie.style.right="0px"):(Se=="left"?gt=0:Se=="middle"&&(gt=(Ee.sizer.clientWidth-ie.offsetWidth)/2),ie.style.left=gt+"px"),ce&&$d(this,{left:gt,top:Oe,right:gt+ie.offsetWidth,bottom:Oe+ie.offsetHeight})},triggerOnKeyDown:ua(lc),triggerOnKeyPress:ua(ch),triggerOnKeyUp:lh,triggerOnMouseDown:ua(Wa),execCommand:function(te){if(Dl.hasOwnProperty(te))return Dl[te].call(null,this)},triggerElectric:ua(function(te){od(this,te)}),findPosH:function(te,ie,ce,ge){var Se=1;ie<0&&(Se=-1,ie=-ie);for(var Ee=Et(this.doc,te),Oe=0;Oe<ie&&(Ee=ru(this.doc,Ee,Se,ce,ge),!Ee.hitSide);++Oe);return Ee},moveH:ua(function(te,ie){var ce=this;this.extendSelectionsBy(function(ge){return ce.display.shift||ce.doc.extend||ge.empty()?ru(ce.doc,ge.head,te,ie,ce.options.rtlMoveVisually):te<0?ge.from():ge.to()},Dt)}),deleteH:ua(function(te,ie){var ce=this.doc.sel,ge=this.doc;ce.somethingSelected()?ge.replaceSelection("",null,"+delete"):Po(this,function(Se){var Ee=ru(ge,Se.head,te,ie,!1);return te<0?{from:Ee,to:Se.head}:{from:Se.head,to:Ee}})}),findPosV:function(te,ie,ce,ge){var Se=1,Ee=ge;ie<0&&(Se=-1,ie=-ie);for(var Oe=Et(this.doc,te),gt=0;gt<ie;++gt){var _t=Da(this,Oe,"div");if(Ee==null?Ee=_t.left:_t.left=Ee,Oe=gh(this,_t,Se,ce),Oe.hitSide)break}return Oe},moveV:ua(function(te,ie){var ce=this,ge=this.doc,Se=[],Ee=!this.display.shift&&!ge.extend&&ge.sel.somethingSelected();if(ge.extendSelectionsBy(function(gt){if(Ee)return te<0?gt.from():gt.to();var _t=Da(ce,gt.head,"div");gt.goalColumn!=null&&(_t.left=gt.goalColumn),Se.push(_t.left);var fn=gh(ce,_t,te,ie);return ie=="page"&>==ge.sel.primary()&&Lc(ce,lo(ce,fn,"div").top-_t.top),fn},Dt),Se.length)for(var Oe=0;Oe<ge.sel.ranges.length;Oe++)ge.sel.ranges[Oe].goalColumn=Se[Oe]}),findWordAt:function(te){var ie=this.doc,ce=qe(ie,te.line).text,ge=te.ch,Se=te.ch;if(ce){var Ee=this.getHelper(te,"wordChars");(te.sticky=="before"||Se==ce.length)&&ge?--ge:++Se;for(var Oe=ce.charAt(ge),gt=fe(Oe,Ee)?function(_t){return fe(_t,Ee)}:/\s/.test(Oe)?function(_t){return/\s/.test(_t)}:function(_t){return!/\s/.test(_t)&&!fe(_t)};ge>0&>(ce.charAt(ge-1));)--ge;for(;Se<ce.length&>(ce.charAt(Se));)++Se}return new Fi(At(te.line,ge),At(te.line,Se))},toggleOverwrite:function(te){te!=null&&te==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?zt(this.display.cursorDiv,"CodeMirror-overwrite"):He(this.display.cursorDiv,"CodeMirror-overwrite"),Fe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Qe()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:ua(function(te,ie){el(this,te,ie)}),getScrollInfo:function(){var te=this.display.scroller;return{left:te.scrollLeft,top:te.scrollTop,height:te.scrollHeight-Ea(this)-this.display.barHeight,width:te.scrollWidth-Ea(this)-this.display.barWidth,clientHeight:bo(this),clientWidth:fa(this)}},scrollIntoView:ua(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:At(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?Rd(this,te):Du(this,te.from,te.to,te.margin)}),setSize:ua(function(te,ie){var ce=this,ge=function(Ee){return typeof Ee=="number"||/^\d+$/.test(String(Ee))?Ee+"px":Ee};te!=null&&(this.display.wrapper.style.width=ge(te)),ie!=null&&(this.display.wrapper.style.height=ge(ie)),this.options.lineWrapping&&La(this);var Se=this.display.viewFrom;this.doc.iter(Se,this.display.viewTo,function(Ee){if(Ee.widgets){for(var Oe=0;Oe<Ee.widgets.length;Oe++)if(Ee.widgets[Oe].noHScroll){Ao(ce,Se,"widget");break}}++Se}),this.curOp.forceUpdate=!0,Fe(this,"refresh",this)}),operation:function(te){return pa(this,te)},startOperation:function(){return Ls(this)},endOperation:function(){return cs(this)},refresh:ua(function(){var te=this.display.cachedTextHeight;za(this),this.curOp.forceUpdate=!0,Xi(this),el(this,this.doc.scrollLeft,this.doc.scrollTop),Ic(this.display),(te==null||Math.abs(te-as(this.display))>.5||this.options.lineWrapping)&&Aa(this),Fe(this,"refresh",this)}),swapDoc:ua(function(te){var ie=this.doc;return ie.cm=null,this.state.selectingText&&this.state.selectingText(),Jl(this,te),Xi(this),this.display.input.reset(),el(this,te.scrollLeft,te.scrollTop),this.curOp.forceScroll=!0,zr(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}},ln(x),x.registerHelper=function(te,ie,ce){ne.hasOwnProperty(te)||(ne[te]=x[te]={_global:[]}),ne[te][ie]=ce},x.registerGlobalHelper=function(te,ie,ce,ge){x.registerHelper(te,ie,ge),ne[te]._global.push({pred:ce,val:ge})}}function ru(x,z,ne,te,ie){var ce=z,ge=ne,Se=qe(x,z.line),Ee=ie&&x.direction=="rtl"?-ne:ne;function Oe(){var Rr=z.line+Ee;return Rr<x.first||Rr>=x.first+x.size?!1:(z=new At(Rr,z.ch,z.sticky),Se=qe(x,Rr))}function gt(Rr){var Cr;if(te=="codepoint"){var Kr=Se.text.charCodeAt(z.ch+(te>0?0:-1));isNaN(Kr)?Cr=null:Cr=new At(z.line,Math.max(0,Math.min(Se.text.length,z.ch+ne*(Kr>=55296&&Kr<56320?2:1))),-ne)}else ie?Cr=Go(x.cm,Se,z,ne):Cr=Uo(Se,z,ne);if(Cr==null)if(!Rr&&Oe())z=dl(ie,x.cm,Se,z.line,Ee);else return!1;else z=Cr;return!0}if(te=="char"||te=="codepoint")gt();else if(te=="column")gt(!0);else if(te=="word"||te=="group")for(var _t=null,fn=te=="group",sn=x.cm&&x.cm.getHelper(z,"wordChars"),Bn=!0;!(ne<0&&!gt(!Bn));Bn=!1){var Wn=Se.text.charAt(z.ch)||`
|
|
|
`,vr=fe(Wn,sn)?"w":fn&&Wn==`
|
|
|
`?"n":!fn||/\s/.test(Wn)?null:"p";if(fn&&!Bn&&!vr&&(vr="s"),_t&&_t!=vr){ne<0&&(ne=1,gt(),z.sticky="after");break}if(vr&&(_t=vr),ne>0&&!gt(!Bn))break}var Ar=Uc(x,z,ce,ge,!0);return rt(ce,Ar)&&(Ar.hitSide=!0),Ar}function gh(x,z,ne,te){var ie=x.doc,ce=z.left,ge;if(te=="page"){var Se=Math.min(x.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Ee=Math.max(Se-.5*as(x.display),3);ge=(ne>0?z.bottom:z.top)+ne*Ee}else te=="line"&&(ge=ne>0?z.bottom+3:z.top-3);for(var Oe;Oe=Js(x,ce,ge),!!Oe.outside;){if(ne<0?ge<=0:ge>=ie.height){Oe.hitSide=!0;break}ge+=ne*5}return Oe}var Vi=function(x){this.cm=x,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new xe,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Vi.prototype.init=function(x){var z=this,ne=this,te=ne.cm,ie=ne.div=x.lineDiv;mh(ie,te.options.spellcheck,te.options.autocorrect,te.options.autocapitalize);function ce(Se){for(var Ee=Se.target;Ee;Ee=Ee.parentNode){if(Ee==ie)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Ee.className))break}return!1}hn(ie,"paste",function(Se){!ce(Se)||Ge(te,Se)||ad(Se,te)||Ae<=11&&setTimeout(Sa(te,function(){return z.updateFromDOM()}),20)}),hn(ie,"compositionstart",function(Se){z.composing={data:Se.data,done:!1}}),hn(ie,"compositionupdate",function(Se){z.composing||(z.composing={data:Se.data,done:!1})}),hn(ie,"compositionend",function(Se){z.composing&&(Se.data!=z.composing.data&&z.readFromDOMSoon(),z.composing.done=!0)}),hn(ie,"touchstart",function(){return ne.forceCompositionEnd()}),hn(ie,"input",function(){z.composing||z.readFromDOMSoon()});function ge(Se){if(!(!ce(Se)||Ge(te,Se))){if(te.somethingSelected())Rs({lineWise:!1,text:te.getSelections()}),Se.type=="cut"&&te.replaceSelection("",null,"cut");else if(te.options.lineWiseCopyCut){var Ee=Il(te);Rs({lineWise:!0,text:Ee.text}),Se.type=="cut"&&te.operation(function(){te.setSelections(Ee.ranges,0,Xe),te.replaceSelection("",null,"cut")})}else return;if(Se.clipboardData){Se.clipboardData.clearData();var Oe=zo.text.join(`
|
|
|
`);if(Se.clipboardData.setData("Text",Oe),Se.clipboardData.getData("Text")==Oe){Se.preventDefault();return}}var gt=sd(),_t=gt.firstChild;te.display.lineSpace.insertBefore(gt,te.display.lineSpace.firstChild),_t.value=zo.text.join(`
|
|
|
`);var fn=document.activeElement;It(_t),setTimeout(function(){te.display.lineSpace.removeChild(gt),fn.focus(),fn==ie&&ne.showPrimarySelection()},50)}}hn(ie,"copy",ge),hn(ie,"cut",ge)},Vi.prototype.screenReaderLabelChanged=function(x){x?this.div.setAttribute("aria-label",x):this.div.removeAttribute("aria-label")},Vi.prototype.prepareSelection=function(){var x=ku(this.cm,!1);return x.focus=document.activeElement==this.div,x},Vi.prototype.showSelection=function(x,z){!x||!this.cm.display.view.length||((x.focus||z)&&this.showPrimarySelection(),this.showMultipleSelections(x))},Vi.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Vi.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 ce=iu(z,x.anchorNode,x.anchorOffset),ge=iu(z,x.focusNode,x.focusOffset);if(!(ce&&!ce.bad&&ge&&!ge.bad&&dn(Pt(ce,ge),te)==0&&dn(Lt(ce,ge),ie)==0)){var Se=z.display.view,Ee=te.line>=z.display.viewFrom&&vh(z,te)||{node:Se[0].measure.map[2],offset:0},Oe=ie.line<z.display.viewTo&&vh(z,ie);if(!Oe){var gt=Se[Se.length-1].measure,_t=gt.maps?gt.maps[gt.maps.length-1]:gt.map;Oe={node:_t[_t.length-1],offset:_t[_t.length-2]-_t[_t.length-3]}}if(!Ee||!Oe){x.removeAllRanges();return}var fn=x.rangeCount&&x.getRangeAt(0),sn;try{sn=st(Ee.node,Ee.offset,Oe.offset,Oe.node)}catch(Bn){}sn&&(!me&&z.state.focused?(x.collapse(Ee.node,Ee.offset),sn.collapsed||(x.removeAllRanges(),x.addRange(sn))):(x.removeAllRanges(),x.addRange(sn)),fn&&x.anchorNode==null?x.addRange(fn):me&&this.startGracePeriod()),this.rememberSelection()}},Vi.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)},Vi.prototype.showMultipleSelections=function(x){bt(this.cm.display.cursorDiv,x.cursors),bt(this.cm.display.selectionDiv,x.selection)},Vi.prototype.rememberSelection=function(){var x=this.getSelection();this.lastAnchorNode=x.anchorNode,this.lastAnchorOffset=x.anchorOffset,this.lastFocusNode=x.focusNode,this.lastFocusOffset=x.focusOffset},Vi.prototype.selectionInEditor=function(){var x=this.getSelection();if(!x.rangeCount)return!1;var z=x.getRangeAt(0).commonAncestorContainer;return Bt(this.div,z)},Vi.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Vi.prototype.blur=function(){this.div.blur()},Vi.prototype.getField=function(){return this.div},Vi.prototype.supportsTouch=function(){return!0},Vi.prototype.receivedFocus=function(){var x=this;this.selectionInEditor()?this.pollSelection():pa(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)},Vi.prototype.selectionChanged=function(){var x=this.getSelection();return x.anchorNode!=this.lastAnchorNode||x.anchorOffset!=this.lastAnchorOffset||x.focusNode!=this.lastFocusNode||x.focusOffset!=this.lastFocusOffset},Vi.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var x=this.getSelection(),z=this.cm;if(et&&Me&&this.cm.display.gutterSpecs.length&&cf(x.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var ne=iu(z,x.anchorNode,x.anchorOffset),te=iu(z,x.focusNode,x.focusOffset);ne&&te&&pa(z,function(){Ca(z.doc,Ro(ne,te),Xe),(ne.bad||te.bad)&&(z.curOp.selectionChanged=!0)})}}},Vi.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=At(te.line-1,qe(x.doc,te.line-1).length)),ie.ch==qe(x.doc,ie.line).text.length&&ie.line<x.lastLine()&&(ie=At(ie.line+1,0)),te.line<z.viewFrom||ie.line>z.viewTo-1)return!1;var ce,ge,Se;te.line==z.viewFrom||(ce=po(x,te.line))==0?(ge=Yt(z.view[0].line),Se=z.view[0].node):(ge=Yt(z.view[ce].line),Se=z.view[ce-1].node.nextSibling);var Ee=po(x,ie.line),Oe,gt;if(Ee==z.view.length-1?(Oe=z.viewTo-1,gt=z.lineDiv.lastChild):(Oe=Yt(z.view[Ee+1].line)-1,gt=z.view[Ee+1].node.previousSibling),!Se)return!1;for(var _t=x.doc.splitLines(uf(x,Se,gt,ge,Oe)),fn=dt(x.doc,At(ge,0),At(Oe,qe(x.doc,Oe).text.length));_t.length>1&&fn.length>1;)if(Vt(_t)==Vt(fn))_t.pop(),fn.pop(),Oe--;else if(_t[0]==fn[0])_t.shift(),fn.shift(),ge++;else break;for(var sn=0,Bn=0,Wn=_t[0],vr=fn[0],Ar=Math.min(Wn.length,vr.length);sn<Ar&&Wn.charCodeAt(sn)==vr.charCodeAt(sn);)++sn;for(var Rr=Vt(_t),Cr=Vt(fn),Kr=Math.min(Rr.length-(_t.length==1?sn:0),Cr.length-(fn.length==1?sn:0));Bn<Kr&&Rr.charCodeAt(Rr.length-Bn-1)==Cr.charCodeAt(Cr.length-Bn-1);)++Bn;if(_t.length==1&&fn.length==1&&ge==te.line)for(;sn&&sn>te.ch&&Rr.charCodeAt(Rr.length-Bn-1)==Cr.charCodeAt(Cr.length-Bn-1);)sn--,Bn++;_t[_t.length-1]=Rr.slice(0,Rr.length-Bn).replace(/^\u200b+/,""),_t[0]=_t[0].slice(sn).replace(/\u200b+$/,"");var Qr=At(ge,sn),ti=At(Oe,fn.length?Vt(fn).length-Bn:0);if(_t.length>1||_t[0]||dn(Qr,ti))return Ml(x.doc,_t,Qr,ti,"+input"),!0},Vi.prototype.ensurePolled=function(){this.forceCompositionEnd()},Vi.prototype.reset=function(){this.forceCompositionEnd()},Vi.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Vi.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))},Vi.prototype.updateFromDOM=function(){var x=this;(this.cm.isReadOnly()||!this.pollContent())&&pa(this.cm,function(){return za(x.cm)})},Vi.prototype.setUneditable=function(x){x.contentEditable="false"},Vi.prototype.onKeyPress=function(x){x.charCode==0||this.composing||(x.preventDefault(),this.cm.isReadOnly()||Sa(this.cm,id)(this.cm,String.fromCharCode(x.charCode==null?x.keyCode:x.charCode),0))},Vi.prototype.readOnlyChanged=function(x){this.div.contentEditable=String(x!="nocursor")},Vi.prototype.onContextMenu=function(){},Vi.prototype.resetPosition=function(){},Vi.prototype.needsContentAttribute=!0;function vh(x,z){var ne=Xa(x,z.line);if(!ne||ne.hidden)return null;var te=qe(x.doc,z.line),ie=Eo(ne,te,z.line),ce=Cn(te,x.doc.direction),ge="left";if(ce){var Se=on(ce,z.ch);ge=Se%2?"right":"left"}var Ee=rs(ie.map,z.ch,ge);return Ee.offset=Ee.collapse=="right"?Ee.end:Ee.start,Ee}function cf(x){for(var z=x;z;z=z.parentNode)if(/CodeMirror-gutter-wrapper/.test(z.className))return!0;return!1}function Pl(x,z){return z&&(x.bad=!0),x}function uf(x,z,ne,te,ie){var ce="",ge=!1,Se=x.doc.lineSeparator(),Ee=!1;function Oe(sn){return function(Bn){return Bn.id==sn}}function gt(){ge&&(ce+=Se,Ee&&(ce+=Se),ge=Ee=!1)}function _t(sn){sn&&(gt(),ce+=sn)}function fn(sn){if(sn.nodeType==1){var Bn=sn.getAttribute("cm-text");if(Bn){_t(Bn);return}var Wn=sn.getAttribute("cm-marker"),vr;if(Wn){var Ar=x.findMarks(At(te,0),At(ie+1,0),Oe(+Wn));Ar.length&&(vr=Ar[0].find(0))&&_t(dt(x.doc,vr.from,vr.to).join(Se));return}if(sn.getAttribute("contenteditable")=="false")return;var Rr=/^(pre|div|p|li|table|br)$/i.test(sn.nodeName);if(!/^br$/i.test(sn.nodeName)&&sn.textContent.length==0)return;Rr&>();for(var Cr=0;Cr<sn.childNodes.length;Cr++)fn(sn.childNodes[Cr]);/^(pre|p)$/i.test(sn.nodeName)&&(Ee=!0),Rr&&(ge=!0)}else sn.nodeType==3&&_t(sn.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;fn(z),z!=ne;)z=z.nextSibling,Ee=!1;return ce}function iu(x,z,ne){var te;if(z==x.display.lineDiv){if(te=x.display.lineDiv.childNodes[ne],!te)return Pl(x.clipPos(At(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 ce=x.display.view[ie];if(ce.node==te)return df(ce,z,ne)}}function df(x,z,ne){var te=x.text.firstChild,ie=!1;if(!z||!Bt(te,z))return Pl(At(Yt(x.line),0),!0);if(z==te&&(ie=!0,z=te.childNodes[ne],ne=0,!z)){var ce=x.rest?Vt(x.rest):x.line;return Pl(At(Yt(ce),ce.text.length),ie)}var ge=z.nodeType==3?z:null,Se=z;for(!ge&&z.childNodes.length==1&&z.firstChild.nodeType==3&&(ge=z.firstChild,ne&&(ne=ge.nodeValue.length));Se.parentNode!=te;)Se=Se.parentNode;var Ee=x.measure,Oe=Ee.maps;function gt(vr,Ar,Rr){for(var Cr=-1;Cr<(Oe?Oe.length:0);Cr++)for(var Kr=Cr<0?Ee.map:Oe[Cr],Qr=0;Qr<Kr.length;Qr+=3){var ti=Kr[Qr+2];if(ti==vr||ti==Ar){var Ci=Yt(Cr<0?x.line:x.rest[Cr]),qi=Kr[Qr]+Rr;return(Rr<0||ti!=vr)&&(qi=Kr[Qr+(Rr?1:0)]),At(Ci,qi)}}}var _t=gt(ge,Se,ne);if(_t)return Pl(_t,ie);for(var fn=Se.nextSibling,sn=ge?ge.nodeValue.length-ne:0;fn;fn=fn.nextSibling){if(_t=gt(fn,fn.firstChild,0),_t)return Pl(At(_t.line,_t.ch-sn),ie);sn+=fn.textContent.length}for(var Bn=Se.previousSibling,Wn=ne;Bn;Bn=Bn.previousSibling){if(_t=gt(Bn,Bn.firstChild,-1),_t)return Pl(At(_t.line,_t.ch+Wn),ie);Wn+=Bn.textContent.length}}var Ji=function(x){this.cm=x,this.prevInput="",this.pollingFast=!1,this.polling=new xe,this.hasSelection=!1,this.composing=null};Ji.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),yt&&(ie.style.width="0px"),hn(ie,"input",function(){be&&Ae>=9&&z.hasSelection&&(z.hasSelection=null),ne.poll()}),hn(ie,"paste",function(ge){Ge(te,ge)||ad(ge,te)||(te.state.pasteIncoming=+new Date,ne.fastPoll())});function ce(ge){if(!Ge(te,ge)){if(te.somethingSelected())Rs({lineWise:!1,text:te.getSelections()});else if(te.options.lineWiseCopyCut){var Se=Il(te);Rs({lineWise:!0,text:Se.text}),ge.type=="cut"?te.setSelections(Se.ranges,null,Xe):(ne.prevInput="",ie.value=Se.text.join(`
|
|
|
`),It(ie))}else return;ge.type=="cut"&&(te.state.cutIncoming=+new Date)}}hn(ie,"cut",ce),hn(ie,"copy",ce),hn(x.scroller,"paste",function(ge){if(!(oo(x,ge)||Ge(te,ge))){if(!ie.dispatchEvent){te.state.pasteIncoming=+new Date,ne.focus();return}var Se=new Event("paste");Se.clipboardData=ge.clipboardData,ie.dispatchEvent(Se)}}),hn(x.lineSpace,"selectstart",function(ge){oo(x,ge)||Dn(ge)}),hn(ie,"compositionstart",function(){var ge=te.getCursor("from");ne.composing&&ne.composing.range.clear(),ne.composing={start:ge,range:te.markText(ge,te.getCursor("to"),{className:"CodeMirror-composing"})}}),hn(ie,"compositionend",function(){ne.composing&&(ne.poll(),ne.composing.range.clear(),ne.composing=null)})},Ji.prototype.createField=function(x){this.wrapper=sd(),this.textarea=this.wrapper.firstChild},Ji.prototype.screenReaderLabelChanged=function(x){x?this.textarea.setAttribute("aria-label",x):this.textarea.removeAttribute("aria-label")},Ji.prototype.prepareSelection=function(){var x=this.cm,z=x.display,ne=x.doc,te=ku(x);if(x.options.moveInputWithCursor){var ie=Da(x,ne.sel.primary().head,"div"),ce=z.wrapper.getBoundingClientRect(),ge=z.lineDiv.getBoundingClientRect();te.teTop=Math.max(0,Math.min(z.wrapper.clientHeight-10,ie.top+ge.top-ce.top)),te.teLeft=Math.max(0,Math.min(z.wrapper.clientWidth-10,ie.left+ge.left-ce.left))}return te},Ji.prototype.showSelection=function(x){var z=this.cm,ne=z.display;bt(ne.cursorDiv,x.cursors),bt(ne.selectionDiv,x.selection),x.teTop!=null&&(this.wrapper.style.top=x.teTop+"px",this.wrapper.style.left=x.teLeft+"px")},Ji.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&&It(this.textarea),be&&Ae>=9&&(this.hasSelection=ne)}else x||(this.prevInput=this.textarea.value="",be&&Ae>=9&&(this.hasSelection=null))}},Ji.prototype.getField=function(){return this.textarea},Ji.prototype.supportsTouch=function(){return!1},Ji.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!pt||Qe()!=this.textarea))try{this.textarea.focus()}catch(x){}},Ji.prototype.blur=function(){this.textarea.blur()},Ji.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ji.prototype.receivedFocus=function(){this.slowPoll()},Ji.prototype.slowPoll=function(){var x=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){x.poll(),x.cm.state.focused&&x.slowPoll()})},Ji.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)},Ji.prototype.poll=function(){var x=this,z=this.cm,ne=this.textarea,te=this.prevInput;if(this.contextMenuPending||!z.state.focused||rr(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&&Ae>=9&&this.hasSelection===ie||at&&/[\uf700-\uf7ff]/.test(ie))return z.display.input.reset(),!1;if(z.doc.sel==z.display.selForContextMenu){var ce=ie.charCodeAt(0);if(ce==8203&&!te&&(te="\u200B"),ce==8666)return this.reset(),this.cm.execCommand("undo")}for(var ge=0,Se=Math.min(te.length,ie.length);ge<Se&&te.charCodeAt(ge)==ie.charCodeAt(ge);)++ge;return pa(z,function(){id(z,ie.slice(ge),te.length-ge,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},Ji.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ji.prototype.onKeyPress=function(){be&&Ae>=9&&(this.hasSelection=null),this.fastPoll()},Ji.prototype.onContextMenu=function(x){var z=this,ne=z.cm,te=ne.display,ie=z.textarea;z.contextMenuPending&&z.contextMenuPending();var ce=xo(ne,x),ge=te.scroller.scrollTop;if(!ce||ze)return;var Se=ne.options.resetSelectionOnContextMenu;Se&&ne.doc.sel.contains(ce)==-1&&Sa(ne,Ca)(ne.doc,Ro(ce),Xe);var Ee=ie.style.cssText,Oe=z.wrapper.style.cssText,gt=z.wrapper.offsetParent.getBoundingClientRect();z.wrapper.style.cssText="position: static",ie.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
|
top: `+(x.clientY-gt.top-5)+"px; left: "+(x.clientX-gt.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 _t;Ne&&(_t=window.scrollY),te.input.focus(),Ne&&window.scrollTo(null,_t),te.input.reset(),ne.somethingSelected()||(ie.value=z.prevInput=" "),z.contextMenuPending=sn,te.selForContextMenu=ne.doc.sel,clearTimeout(te.detectingSelectAll);function fn(){if(ie.selectionStart!=null){var Wn=ne.somethingSelected(),vr="\u200B"+(Wn?ie.value:"");ie.value="\u21DA",ie.value=vr,z.prevInput=Wn?"":"\u200B",ie.selectionStart=1,ie.selectionEnd=vr.length,te.selForContextMenu=ne.doc.sel}}function sn(){if(z.contextMenuPending==sn&&(z.contextMenuPending=!1,z.wrapper.style.cssText=Oe,ie.style.cssText=Ee,be&&Ae<9&&te.scrollbars.setScrollTop(te.scroller.scrollTop=ge),ie.selectionStart!=null)){(!be||be&&Ae<9)&&fn();var Wn=0,vr=function(){te.selForContextMenu==ne.doc.sel&&ie.selectionStart==0&&ie.selectionEnd>0&&z.prevInput=="\u200B"?Sa(ne,ju)(ne):Wn++<10?te.detectingSelectAll=setTimeout(vr,500):(te.selForContextMenu=null,te.input.reset())};te.detectingSelectAll=setTimeout(vr,200)}}if(be&&Ae>=9&&fn(),Ze){Fn(x);var Bn=function(){tt(window,"mouseup",Bn),setTimeout(sn,20)};hn(window,"mouseup",Bn)}else setTimeout(sn,50)},Ji.prototype.readOnlyChanged=function(x){x||this.reset(),this.textarea.disabled=x=="nocursor",this.textarea.readOnly=!!x},Ji.prototype.setUneditable=function(){},Ji.prototype.needsContentAttribute=!1;function hl(x,z){if(z=z?mt(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=Qe();z.autofocus=ne==x||x.getAttribute("autofocus")!=null&&ne==document.body}function te(){x.value=Se.getValue()}var ie;if(x.form&&(hn(x.form,"submit",te),!z.leaveSubmitMethodAlone)){var ce=x.form;ie=ce.submit;try{var ge=ce.submit=function(){te(),ce.submit=ie,ce.submit(),ce.submit=ge}}catch(Ee){}}z.finishInit=function(Ee){Ee.save=te,Ee.getTextArea=function(){return x},Ee.toTextArea=function(){Ee.toTextArea=isNaN,te(),x.parentNode.removeChild(Ee.getWrapperElement()),x.style.display="",x.form&&(tt(x.form,"submit",te),!z.leaveSubmitMethodAlone&&typeof x.form.submit=="function"&&(x.form.submit=ie))}},x.style.display="none";var Se=si(function(Ee){return x.parentNode.insertBefore(Ee,x.nextSibling)},z);return Se}function Bl(x){x.off=tt,x.on=hn,x.wheelEventPixels=Nu,x.Doc=ya,x.splitLines=Mr,x.countColumn=$e,x.findColumn=bn,x.isWordChar=de,x.Pass=Ut,x.signal=Fe,x.Line=mr,x.changeEnd=us,x.scrollbarModel=Tu,x.Pos=At,x.cmpPos=dn,x.modes=jr,x.mimeModes=Nr,x.resolveMode=Rn,x.getMode=$n,x.modeExtensions=wr,x.extendMode=lt,x.copyState=_e,x.startState=De,x.innerMode=Pe,x.commands=Dl,x.keyMap=Yi,x.keyName=ul,x.isModifierKey=sc,x.lookupKey=ms,x.normalizeKeyMap=Yu,x.StringStream=Te,x.SharedTextMarker=Si,x.TextMarker=Ts,x.LineWidget=_l,x.e_preventDefault=Dn,x.e_stopPropagation=Tn,x.e_stop=Fn,x.addClass=zt,x.contains=Bt,x.rmClass=He,x.keyNames=No}of(si),ld(si);var ys="iter insert remove copy getEditor constructor".split(" ");for(var Bo in ya.prototype)ya.prototype.hasOwnProperty(Bo)&&ht(ys,Bo)<0&&(si.prototype[Bo]=function(x){return function(){return x.apply(this.doc,arguments)}}(ya.prototype[Bo]));return ln(ya),si.inputStyles={textarea:Ji,contenteditable:Vi},si.defineMode=function(x){!si.defaults.mode&&x!="null"&&(si.defaults.mode=x),Jn.apply(this,arguments)},si.defineMIME=lr,si.defineMode("null",function(){return{token:function(x){return x.skipToEnd()}}}),si.defineMIME("text/plain","null"),si.defineExtension=function(x,z){si.prototype[x]=z},si.defineDocExtension=function(x,z){ya.prototype[x]=z},si.fromTextArea=hl,Bl(si),si.version="5.58.2",si})},25419:function(kn,cn,ue){(function(me){me(ue(89780),ue(15525),ue(98101))})(function(me){"use strict";me.defineMode("markdown",function(je,Ke){var ot=me.getMode(je,"text/html"),be=ot.name=="null";function Ae($e){if(me.findModeByName){var xe=me.findModeByName($e);xe&&($e=xe.mime||xe.mimes[0])}var ht=me.getMode(je,$e);return ht.name=="null"?null:ht}Ke.highlightFormatting===void 0&&(Ke.highlightFormatting=!1),Ke.maxBlockquoteDepth===void 0&&(Ke.maxBlockquoteDepth=0),Ke.taskLists===void 0&&(Ke.taskLists=!1),Ke.strikethrough===void 0&&(Ke.strikethrough=!1),Ke.emoji===void 0&&(Ke.emoji=!1),Ke.fencedCodeBlockHighlighting===void 0&&(Ke.fencedCodeBlockHighlighting=!0),Ke.fencedCodeBlockDefaultMode===void 0&&(Ke.fencedCodeBlockDefaultMode="text/plain"),Ke.xml===void 0&&(Ke.xml=!0),Ke.tokenTypeOverrides===void 0&&(Ke.tokenTypeOverrides={});var Ne={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 Ce in Ne)Ne.hasOwnProperty(Ce)&&Ke.tokenTypeOverrides[Ce]&&(Ne[Ce]=Ke.tokenTypeOverrides[Ce]);var Me=/^([*\-_])(?:\s*\1){2,}\s*$/,ze=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,ut=/^\[(x| )\](?=\s)/i,Le=Ke.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,We=/^ {0,3}(?:\={1,}|-{2,})\s*$/,yt=/^[^#!\[\]*_\\<>` "'(~:]+/,et=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,pt=/^\s*\[[^\]]+?\]:.*$/,at=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,St=" ";function Qt($e,xe,ht){return xe.f=xe.inline=ht,ht($e,xe)}function nt($e,xe,ht){return xe.f=xe.block=ht,ht($e,xe)}function ft($e){return!$e||!/\S/.test($e.string)}function Ze($e){if($e.linkTitle=!1,$e.linkHref=!1,$e.linkText=!1,$e.em=!1,$e.strong=!1,$e.strikethrough=!1,$e.quote=0,$e.indentedCode=!1,$e.f==He){var xe=be;if(!xe){var ht=me.innerMode(ot,$e.htmlState);xe=ht.mode.name=="xml"&&ht.state.tagStart===null&&!ht.state.context&&ht.state.tokenize.isInText}xe&&($e.f=jt,$e.block=ke,$e.htmlState=null)}return $e.trailingSpace=0,$e.trailingSpaceNewLine=!1,$e.prevLine=$e.thisLine,$e.thisLine={stream:null},null}function ke($e,xe){var ht=$e.column()===xe.indentation,nn=ft(xe.prevLine.stream),Ut=xe.indentedCode,Xe=xe.prevLine.hr,Ye=xe.list!==!1,Dt=(xe.listStack[xe.listStack.length-1]||0)+3;xe.indentedCode=!1;var bn=xe.indentation;if(xe.indentationDiff===null&&(xe.indentationDiff=xe.indentation,Ye)){for(xe.list=null;bn<xe.listStack[xe.listStack.length-1];)xe.listStack.pop(),xe.listStack.length?xe.indentation=xe.listStack[xe.listStack.length-1]:xe.list=!1;xe.list!==!1&&(xe.indentationDiff=bn-xe.listStack[xe.listStack.length-1])}var tn=!nn&&!Xe&&!xe.prevLine.header&&(!Ye||!Ut)&&!xe.prevLine.fencedCodeEnd,un=(xe.list===!1||Xe||nn)&&xe.indentation<=Dt&&$e.match(Me),Vt=null;if(xe.indentationDiff>=4&&(Ut||xe.prevLine.fencedCodeEnd||xe.prevLine.header||nn))return $e.skipToEnd(),xe.indentedCode=!0,Ne.code;if($e.eatSpace())return null;if(ht&&xe.indentation<=Dt&&(Vt=$e.match(Le))&&Vt[1].length<=6)return xe.quote=0,xe.header=Vt[1].length,xe.thisLine.header=!0,Ke.highlightFormatting&&(xe.formatting="header"),xe.f=xe.inline,bt(xe);if(xe.indentation<=Dt&&$e.eat(">"))return xe.quote=ht?1:xe.quote+1,Ke.highlightFormatting&&(xe.formatting="quote"),$e.eatSpace(),bt(xe);if(!un&&!xe.setext&&ht&&xe.indentation<=Dt&&(Vt=$e.match(ze))){var Gt=Vt[1]?"ol":"ul";return xe.indentation=bn+$e.current().length,xe.list=!0,xe.quote=0,xe.listStack.push(xe.indentation),xe.em=!1,xe.strong=!1,xe.code=!1,xe.strikethrough=!1,Ke.taskLists&&$e.match(ut,!1)&&(xe.taskList=!0),xe.f=xe.inline,Ke.highlightFormatting&&(xe.formatting=["list","list-"+Gt]),bt(xe)}else{if(ht&&xe.indentation<=Dt&&(Vt=$e.match(et,!0)))return xe.quote=0,xe.fencedEndRE=new RegExp(Vt[1]+"+ *$"),xe.localMode=Ke.fencedCodeBlockHighlighting&&Ae(Vt[2]||Ke.fencedCodeBlockDefaultMode),xe.localMode&&(xe.localState=me.startState(xe.localMode)),xe.f=xe.block=Ue,Ke.highlightFormatting&&(xe.formatting="code-block"),xe.code=-1,bt(xe);if(xe.setext||(!tn||!Ye)&&!xe.quote&&xe.list===!1&&!xe.code&&!un&&!pt.test($e.string)&&(Vt=$e.lookAhead(1))&&(Vt=Vt.match(We)))return xe.setext?(xe.header=xe.setext,xe.setext=0,$e.skipToEnd(),Ke.highlightFormatting&&(xe.formatting="header")):(xe.header=Vt[0].charAt(0)=="="?1:2,xe.setext=xe.header),xe.thisLine.header=!0,xe.f=xe.inline,bt(xe);if(un)return $e.skipToEnd(),xe.hr=!0,xe.thisLine.hr=!0,Ne.hr;if($e.peek()==="[")return Qt($e,xe,ct)}return Qt($e,xe,xe.inline)}function He($e,xe){var ht=ot.token($e,xe.htmlState);if(!be){var nn=me.innerMode(ot,xe.htmlState);(nn.mode.name=="xml"&&nn.state.tagStart===null&&!nn.state.context&&nn.state.tokenize.isInText||xe.md_inside&&$e.current().indexOf(">")>-1)&&(xe.f=jt,xe.block=ke,xe.htmlState=null)}return ht}function Ue($e,xe){var ht=xe.listStack[xe.listStack.length-1]||0,nn=xe.indentation<ht,Ut=ht+3;if(xe.fencedEndRE&&xe.indentation<=Ut&&(nn||$e.match(xe.fencedEndRE))){Ke.highlightFormatting&&(xe.formatting="code-block");var Xe;return nn||(Xe=bt(xe)),xe.localMode=xe.localState=null,xe.block=ke,xe.f=jt,xe.fencedEndRE=null,xe.code=0,xe.thisLine.fencedCodeEnd=!0,nn?nt($e,xe,xe.block):Xe}else return xe.localMode?xe.localMode.token($e,xe.localState):($e.skipToEnd(),Ne.code)}function bt($e){var xe=[];if($e.formatting){xe.push(Ne.formatting),typeof $e.formatting=="string"&&($e.formatting=[$e.formatting]);for(var ht=0;ht<$e.formatting.length;ht++)xe.push(Ne.formatting+"-"+$e.formatting[ht]),$e.formatting[ht]==="header"&&xe.push(Ne.formatting+"-"+$e.formatting[ht]+"-"+$e.header),$e.formatting[ht]==="quote"&&(!Ke.maxBlockquoteDepth||Ke.maxBlockquoteDepth>=$e.quote?xe.push(Ne.formatting+"-"+$e.formatting[ht]+"-"+$e.quote):xe.push("error"))}if($e.taskOpen)return xe.push("meta"),xe.length?xe.join(" "):null;if($e.taskClosed)return xe.push("property"),xe.length?xe.join(" "):null;if($e.linkHref?xe.push(Ne.linkHref,"url"):($e.strong&&xe.push(Ne.strong),$e.em&&xe.push(Ne.em),$e.strikethrough&&xe.push(Ne.strikethrough),$e.emoji&&xe.push(Ne.emoji),$e.linkText&&xe.push(Ne.linkText),$e.code&&xe.push(Ne.code),$e.image&&xe.push(Ne.image),$e.imageAltText&&xe.push(Ne.imageAltText,"link"),$e.imageMarker&&xe.push(Ne.imageMarker)),$e.header&&xe.push(Ne.header,Ne.header+"-"+$e.header),$e.quote&&(xe.push(Ne.quote),!Ke.maxBlockquoteDepth||Ke.maxBlockquoteDepth>=$e.quote?xe.push(Ne.quote+"-"+$e.quote):xe.push(Ne.quote+"-"+Ke.maxBlockquoteDepth)),$e.list!==!1){var nn=($e.listStack.length-1)%3;nn?nn===1?xe.push(Ne.list2):xe.push(Ne.list3):xe.push(Ne.list1)}return $e.trailingSpaceNewLine?xe.push("trailing-space-new-line"):$e.trailingSpace&&xe.push("trailing-space-"+($e.trailingSpace%2?"a":"b")),xe.length?xe.join(" "):null}function Ve($e,xe){if($e.match(yt,!0))return bt(xe)}function jt($e,xe){var ht=xe.text($e,xe);if(typeof ht!="undefined")return ht;if(xe.list)return xe.list=null,bt(xe);if(xe.taskList){var nn=$e.match(ut,!0)[1]===" ";return nn?xe.taskOpen=!0:xe.taskClosed=!0,Ke.highlightFormatting&&(xe.formatting="task"),xe.taskList=!1,bt(xe)}if(xe.taskOpen=!1,xe.taskClosed=!1,xe.header&&$e.match(/^#+$/,!0))return Ke.highlightFormatting&&(xe.formatting="header"),bt(xe);var Ut=$e.next();if(xe.linkTitle){xe.linkTitle=!1;var Xe=Ut;Ut==="("&&(Xe=")"),Xe=(Xe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ye="^\\s*(?:[^"+Xe+"\\\\]+|\\\\\\\\|\\\\.)"+Xe;if($e.match(new RegExp(Ye),!0))return Ne.linkHref}if(Ut==="`"){var Dt=xe.formatting;Ke.highlightFormatting&&(xe.formatting="code"),$e.eatWhile("`");var bn=$e.current().length;if(xe.code==0&&(!xe.quote||bn==1))return xe.code=bn,bt(xe);if(bn==xe.code){var tn=bt(xe);return xe.code=0,tn}else return xe.formatting=Dt,bt(xe)}else if(xe.code)return bt(xe);if(Ut==="\\"&&($e.next(),Ke.highlightFormatting)){var un=bt(xe),Vt=Ne.formatting+"-escape";return un?un+" "+Vt:Vt}if(Ut==="!"&&$e.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return xe.imageMarker=!0,xe.image=!0,Ke.highlightFormatting&&(xe.formatting="image"),bt(xe);if(Ut==="["&&xe.imageMarker&&$e.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return xe.imageMarker=!1,xe.imageAltText=!0,Ke.highlightFormatting&&(xe.formatting="image"),bt(xe);if(Ut==="]"&&xe.imageAltText){Ke.highlightFormatting&&(xe.formatting="image");var un=bt(xe);return xe.imageAltText=!1,xe.image=!1,xe.inline=xe.f=Bt,un}if(Ut==="["&&!xe.image)return xe.linkText&&$e.match(/^.*?\]/)||(xe.linkText=!0,Ke.highlightFormatting&&(xe.formatting="link")),bt(xe);if(Ut==="]"&&xe.linkText){Ke.highlightFormatting&&(xe.formatting="link");var un=bt(xe);return xe.linkText=!1,xe.inline=xe.f=$e.match(/\(.*?\)| ?\[.*?\]/,!1)?Bt:jt,un}if(Ut==="<"&&$e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){xe.f=xe.inline=st,Ke.highlightFormatting&&(xe.formatting="link");var un=bt(xe);return un?un+=" ":un="",un+Ne.linkInline}if(Ut==="<"&&$e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){xe.f=xe.inline=st,Ke.highlightFormatting&&(xe.formatting="link");var un=bt(xe);return un?un+=" ":un="",un+Ne.linkEmail}if(Ke.xml&&Ut==="<"&&$e.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Gt=$e.string.indexOf(">",$e.pos);if(Gt!=-1){var Wt=$e.string.substring($e.start,Gt);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Wt)&&(xe.md_inside=!0)}return $e.backUp(1),xe.htmlState=me.startState(ot),nt($e,xe,He)}if(Ke.xml&&Ut==="<"&&$e.match(/^\/\w*?>/))return xe.md_inside=!1,"tag";if(Ut==="*"||Ut==="_"){for(var ye=1,se=$e.pos==1?" ":$e.string.charAt($e.pos-2);ye<3&&$e.eat(Ut);)ye++;var oe=$e.peek()||" ",de=!/\s/.test(oe)&&(!at.test(oe)||/\s/.test(se)||at.test(se)),fe=!/\s/.test(se)&&(!at.test(se)||/\s/.test(oe)||at.test(oe)),le=null,Ie=null;if(ye%2&&(!xe.em&&de&&(Ut==="*"||!fe||at.test(se))?le=!0:xe.em==Ut&&fe&&(Ut==="*"||!de||at.test(oe))&&(le=!1)),ye>1&&(!xe.strong&&de&&(Ut==="*"||!fe||at.test(se))?Ie=!0:xe.strong==Ut&&fe&&(Ut==="*"||!de||at.test(oe))&&(Ie=!1)),Ie!=null||le!=null){Ke.highlightFormatting&&(xe.formatting=le==null?"strong":Ie==null?"em":"strong em"),le===!0&&(xe.em=Ut),Ie===!0&&(xe.strong=Ut);var tn=bt(xe);return le===!1&&(xe.em=!1),Ie===!1&&(xe.strong=!1),tn}}else if(Ut===" "&&($e.eat("*")||$e.eat("_"))){if($e.peek()===" ")return bt(xe);$e.backUp(1)}if(Ke.strikethrough){if(Ut==="~"&&$e.eatWhile(Ut)){if(xe.strikethrough){Ke.highlightFormatting&&(xe.formatting="strikethrough");var tn=bt(xe);return xe.strikethrough=!1,tn}else if($e.match(/^[^\s]/,!1))return xe.strikethrough=!0,Ke.highlightFormatting&&(xe.formatting="strikethrough"),bt(xe)}else if(Ut===" "&&$e.match(/^~~/,!0)){if($e.peek()===" ")return bt(xe);$e.backUp(2)}}if(Ke.emoji&&Ut===":"&&$e.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){xe.emoji=!0,Ke.highlightFormatting&&(xe.formatting="emoji");var it=bt(xe);return xe.emoji=!1,it}return Ut===" "&&($e.match(/^ +$/,!1)?xe.trailingSpace++:xe.trailingSpace&&(xe.trailingSpaceNewLine=!0)),bt(xe)}function st($e,xe){var ht=$e.next();if(ht===">"){xe.f=xe.inline=jt,Ke.highlightFormatting&&(xe.formatting="link");var nn=bt(xe);return nn?nn+=" ":nn="",nn+Ne.linkInline}return $e.match(/^[^>]+/,!0),Ne.linkInline}function Bt($e,xe){if($e.eatSpace())return null;var ht=$e.next();return ht==="("||ht==="["?(xe.f=xe.inline=zt(ht==="("?")":"]"),Ke.highlightFormatting&&(xe.formatting="link-string"),xe.linkHref=!0,bt(xe)):"error"}var Qe={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function zt($e){return function(xe,ht){var nn=xe.next();if(nn===$e){ht.f=ht.inline=jt,Ke.highlightFormatting&&(ht.formatting="link-string");var Ut=bt(ht);return ht.linkHref=!1,Ut}return xe.match(Qe[$e]),ht.linkHref=!0,bt(ht)}}function ct($e,xe){return $e.match(/^([^\]\\]|\\.)*\]:/,!1)?(xe.f=It,$e.next(),Ke.highlightFormatting&&(xe.formatting="link"),xe.linkText=!0,bt(xe)):Qt($e,xe,jt)}function It($e,xe){if($e.match(/^\]:/,!0)){xe.f=xe.inline=Rt,Ke.highlightFormatting&&(xe.formatting="link");var ht=bt(xe);return xe.linkText=!1,ht}return $e.match(/^([^\]\\]|\\.)+/,!0),Ne.linkText}function Rt($e,xe){return $e.eatSpace()?null:($e.match(/^[^\s]+/,!0),$e.peek()===void 0?xe.linkTitle=!0:$e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),xe.f=xe.inline=jt,Ne.linkHref+" url")}var mt={startState:function(){return{f:ke,prevLine:{stream:null},thisLine:{stream:null},block:ke,htmlState:null,indentation:0,inline:jt,text:Ve,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($e){return{f:$e.f,prevLine:$e.prevLine,thisLine:$e.thisLine,block:$e.block,htmlState:$e.htmlState&&me.copyState(ot,$e.htmlState),indentation:$e.indentation,localMode:$e.localMode,localState:$e.localMode?me.copyState($e.localMode,$e.localState):null,inline:$e.inline,text:$e.text,formatting:!1,linkText:$e.linkText,linkTitle:$e.linkTitle,linkHref:$e.linkHref,code:$e.code,em:$e.em,strong:$e.strong,strikethrough:$e.strikethrough,emoji:$e.emoji,header:$e.header,setext:$e.setext,hr:$e.hr,taskList:$e.taskList,list:$e.list,listStack:$e.listStack.slice(0),quote:$e.quote,indentedCode:$e.indentedCode,trailingSpace:$e.trailingSpace,trailingSpaceNewLine:$e.trailingSpaceNewLine,md_inside:$e.md_inside,fencedEndRE:$e.fencedEndRE}},token:function($e,xe){if(xe.formatting=!1,$e!=xe.thisLine.stream){if(xe.header=0,xe.hr=!1,$e.match(/^\s*$/,!0))return Ze(xe),null;if(xe.prevLine=xe.thisLine,xe.thisLine={stream:$e},xe.taskList=!1,xe.trailingSpace=0,xe.trailingSpaceNewLine=!1,!xe.localState&&(xe.f=xe.block,xe.f!=He)){var ht=$e.match(/^\s*/,!0)[0].replace(/\t/g,St).length;if(xe.indentation=ht,xe.indentationDiff=null,ht>0)return null}}return xe.f($e,xe)},innerMode:function($e){return $e.block==He?{state:$e.htmlState,mode:ot}:$e.localState?{state:$e.localState,mode:$e.localMode}:{state:$e,mode:mt}},indent:function($e,xe,ht){return $e.block==He&&ot.indent?ot.indent($e.htmlState,xe,ht):$e.localState&&$e.localMode.indent?$e.localMode.indent($e.localState,xe,ht):me.Pass},blankLine:Ze,getType:bt,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return mt},"xml"),me.defineMIME("text/markdown","markdown"),me.defineMIME("text/x-markdown","markdown")})},98101:function(kn,cn,ue){(function(me){me(ue(89780))})(function(me){"use strict";me.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 je=0;je<me.modeInfo.length;je++){var Ke=me.modeInfo[je];Ke.mimes&&(Ke.mime=Ke.mimes[0])}me.findModeByMIME=function(ot){ot=ot.toLowerCase();for(var be=0;be<me.modeInfo.length;be++){var Ae=me.modeInfo[be];if(Ae.mime==ot)return Ae;if(Ae.mimes){for(var Ne=0;Ne<Ae.mimes.length;Ne++)if(Ae.mimes[Ne]==ot)return Ae}}if(/\+xml$/.test(ot))return me.findModeByMIME("application/xml");if(/\+json$/.test(ot))return me.findModeByMIME("application/json")},me.findModeByExtension=function(ot){ot=ot.toLowerCase();for(var be=0;be<me.modeInfo.length;be++){var Ae=me.modeInfo[be];if(Ae.ext){for(var Ne=0;Ne<Ae.ext.length;Ne++)if(Ae.ext[Ne]==ot)return Ae}}},me.findModeByFileName=function(ot){for(var be=0;be<me.modeInfo.length;be++){var Ae=me.modeInfo[be];if(Ae.file&&Ae.file.test(ot))return Ae}var Ne=ot.lastIndexOf("."),Ce=Ne>-1&&ot.substring(Ne+1,ot.length);if(Ce)return me.findModeByExtension(Ce)},me.findModeByName=function(ot){ot=ot.toLowerCase();for(var be=0;be<me.modeInfo.length;be++){var Ae=me.modeInfo[be];if(Ae.name.toLowerCase()==ot)return Ae;if(Ae.alias){for(var Ne=0;Ne<Ae.alias.length;Ne++)if(Ae.alias[Ne].toLowerCase()==ot)return Ae}}}})},67549:function(kn,cn,ue){(function(me){me(ue(89780))})(function(me){"use strict";me.defineMode("stex",function(je,Ke){"use strict";function ot(yt,et){yt.cmdState.push(et)}function be(yt){return yt.cmdState.length>0?yt.cmdState[yt.cmdState.length-1]:null}function Ae(yt){var et=yt.cmdState.pop();et&&et.closeBracket()}function Ne(yt){for(var et=yt.cmdState,pt=et.length-1;pt>=0;pt--){var at=et[pt];if(at.name!="DEFAULT")return at}return{styleIdentifier:function(){return null}}}function Ce(yt,et,pt){return function(){this.name=yt,this.bracketNo=0,this.style=et,this.styles=pt,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var Me={};Me.importmodule=Ce("importmodule","tag",["string","builtin"]),Me.documentclass=Ce("documentclass","tag",["","atom"]),Me.usepackage=Ce("usepackage","tag",["atom"]),Me.begin=Ce("begin","tag",["atom"]),Me.end=Ce("end","tag",["atom"]),Me.label=Ce("label","tag",["atom"]),Me.ref=Ce("ref","tag",["atom"]),Me.eqref=Ce("eqref","tag",["atom"]),Me.cite=Ce("cite","tag",["atom"]),Me.bibitem=Ce("bibitem","tag",["atom"]),Me.Bibitem=Ce("Bibitem","tag",["atom"]),Me.RBibitem=Ce("RBibitem","tag",["atom"]),Me.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function ze(yt,et){yt.f=et}function ut(yt,et){var pt;if(yt.match(/^\\[a-zA-Z@]+/)){var at=yt.current().slice(1);return pt=Me.hasOwnProperty(at)?Me[at]:Me.DEFAULT,pt=new pt,ot(et,pt),ze(et,We),pt.style}if(yt.match(/^\\[$&%#{}_]/)||yt.match(/^\\[,;!\/\\]/))return"tag";if(yt.match("\\["))return ze(et,function(Qt,nt){return Le(Qt,nt,"\\]")}),"keyword";if(yt.match("\\("))return ze(et,function(Qt,nt){return Le(Qt,nt,"\\)")}),"keyword";if(yt.match("$$"))return ze(et,function(Qt,nt){return Le(Qt,nt,"$$")}),"keyword";if(yt.match("$"))return ze(et,function(Qt,nt){return Le(Qt,nt,"$")}),"keyword";var St=yt.next();if(St=="%")return yt.skipToEnd(),"comment";if(St=="}"||St=="]"){if(pt=be(et),pt)pt.closeBracket(St),ze(et,We);else return"error";return"bracket"}else return St=="{"||St=="["?(pt=Me.DEFAULT,pt=new pt,ot(et,pt),"bracket"):/\d/.test(St)?(yt.eatWhile(/[\w.%]/),"atom"):(yt.eatWhile(/[\w\-_]/),pt=Ne(et),pt.name=="begin"&&(pt.argument=yt.current()),pt.styleIdentifier())}function Le(yt,et,pt){if(yt.eatSpace())return null;if(pt&&yt.match(pt))return ze(et,ut),"keyword";if(yt.match(/^\\[a-zA-Z@]+/))return"tag";if(yt.match(/^[a-zA-Z]+/))return"variable-2";if(yt.match(/^\\[$&%#{}_]/)||yt.match(/^\\[,;!\/]/)||yt.match(/^[\^_&]/))return"tag";if(yt.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(yt.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var at=yt.next();return at=="{"||at=="}"||at=="["||at=="]"||at=="("||at==")"?"bracket":at=="%"?(yt.skipToEnd(),"comment"):"error"}function We(yt,et){var pt=yt.peek(),at;return pt=="{"||pt=="["?(at=be(et),at.openBracket(pt),yt.eat(pt),ze(et,ut),"bracket"):/[ \t\r]/.test(pt)?(yt.eat(pt),null):(ze(et,ut),Ae(et),ut(yt,et))}return{startState:function(){var yt=Ke.inMathMode?function(et,pt){return Le(et,pt)}:ut;return{cmdState:[],f:yt}},copyState:function(yt){return{cmdState:yt.cmdState.slice(),f:yt.f}},token:function(yt,et){return et.f(yt,et)},blankLine:function(yt){yt.f=ut,yt.cmdState.length=0},lineComment:"%"}}),me.defineMIME("text/x-stex","stex"),me.defineMIME("text/x-latex","stex")})},15525:function(kn,cn,ue){(function(me){me(ue(89780))})(function(me){"use strict";var je={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},Ke={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};me.defineMode("xml",function(ot,be){var Ae=ot.indentUnit,Ne={},Ce=be.htmlMode?je:Ke;for(var Me in Ce)Ne[Me]=Ce[Me];for(var Me in be)Ne[Me]=be[Me];var ze,ut;function Le(st,Bt){function Qe(It){return Bt.tokenize=It,It(st,Bt)}var zt=st.next();if(zt=="<")return st.eat("!")?st.eat("[")?st.match("CDATA[")?Qe(et("atom","]]>")):null:st.match("--")?Qe(et("comment","-->")):st.match("DOCTYPE",!0,!0)?(st.eatWhile(/[\w\._\-]/),Qe(pt(1))):null:st.eat("?")?(st.eatWhile(/[\w\._\-]/),Bt.tokenize=et("meta","?>"),"meta"):(ze=st.eat("/")?"closeTag":"openTag",Bt.tokenize=We,"tag bracket");if(zt=="&"){var ct;return st.eat("#")?st.eat("x")?ct=st.eatWhile(/[a-fA-F\d]/)&&st.eat(";"):ct=st.eatWhile(/[\d]/)&&st.eat(";"):ct=st.eatWhile(/[\w\.\-:]/)&&st.eat(";"),ct?"atom":"error"}else return st.eatWhile(/[^&<]/),null}Le.isInText=!0;function We(st,Bt){var Qe=st.next();if(Qe==">"||Qe=="/"&&st.eat(">"))return Bt.tokenize=Le,ze=Qe==">"?"endTag":"selfcloseTag","tag bracket";if(Qe=="=")return ze="equals",null;if(Qe=="<"){Bt.tokenize=Le,Bt.state=nt,Bt.tagName=Bt.tagStart=null;var zt=Bt.tokenize(st,Bt);return zt?zt+" tag error":"tag error"}else return/[\'\"]/.test(Qe)?(Bt.tokenize=yt(Qe),Bt.stringStartCol=st.column(),Bt.tokenize(st,Bt)):(st.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function yt(st){var Bt=function(Qe,zt){for(;!Qe.eol();)if(Qe.next()==st){zt.tokenize=We;break}return"string"};return Bt.isInAttribute=!0,Bt}function et(st,Bt){return function(Qe,zt){for(;!Qe.eol();){if(Qe.match(Bt)){zt.tokenize=Le;break}Qe.next()}return st}}function pt(st){return function(Bt,Qe){for(var zt;(zt=Bt.next())!=null;){if(zt=="<")return Qe.tokenize=pt(st+1),Qe.tokenize(Bt,Qe);if(zt==">")if(st==1){Qe.tokenize=Le;break}else return Qe.tokenize=pt(st-1),Qe.tokenize(Bt,Qe)}return"meta"}}function at(st,Bt,Qe){this.prev=st.context,this.tagName=Bt,this.indent=st.indented,this.startOfLine=Qe,(Ne.doNotIndent.hasOwnProperty(Bt)||st.context&&st.context.noIndent)&&(this.noIndent=!0)}function St(st){st.context&&(st.context=st.context.prev)}function Qt(st,Bt){for(var Qe;;){if(!st.context||(Qe=st.context.tagName,!Ne.contextGrabbers.hasOwnProperty(Qe)||!Ne.contextGrabbers[Qe].hasOwnProperty(Bt)))return;St(st)}}function nt(st,Bt,Qe){return st=="openTag"?(Qe.tagStart=Bt.column(),ft):st=="closeTag"?Ze:nt}function ft(st,Bt,Qe){return st=="word"?(Qe.tagName=Bt.current(),ut="tag",Ue):Ne.allowMissingTagName&&st=="endTag"?(ut="tag bracket",Ue(st,Bt,Qe)):(ut="error",ft)}function Ze(st,Bt,Qe){if(st=="word"){var zt=Bt.current();return Qe.context&&Qe.context.tagName!=zt&&Ne.implicitlyClosed.hasOwnProperty(Qe.context.tagName)&&St(Qe),Qe.context&&Qe.context.tagName==zt||Ne.matchClosing===!1?(ut="tag",ke):(ut="tag error",He)}else return Ne.allowMissingTagName&&st=="endTag"?(ut="tag bracket",ke(st,Bt,Qe)):(ut="error",He)}function ke(st,Bt,Qe){return st!="endTag"?(ut="error",ke):(St(Qe),nt)}function He(st,Bt,Qe){return ut="error",ke(st,Bt,Qe)}function Ue(st,Bt,Qe){if(st=="word")return ut="attribute",bt;if(st=="endTag"||st=="selfcloseTag"){var zt=Qe.tagName,ct=Qe.tagStart;return Qe.tagName=Qe.tagStart=null,st=="selfcloseTag"||Ne.autoSelfClosers.hasOwnProperty(zt)?Qt(Qe,zt):(Qt(Qe,zt),Qe.context=new at(Qe,zt,ct==Qe.indented)),nt}return ut="error",Ue}function bt(st,Bt,Qe){return st=="equals"?Ve:(Ne.allowMissing||(ut="error"),Ue(st,Bt,Qe))}function Ve(st,Bt,Qe){return st=="string"?jt:st=="word"&&Ne.allowUnquoted?(ut="string",Ue):(ut="error",Ue(st,Bt,Qe))}function jt(st,Bt,Qe){return st=="string"?jt:Ue(st,Bt,Qe)}return{startState:function(st){var Bt={tokenize:Le,state:nt,indented:st||0,tagName:null,tagStart:null,context:null};return st!=null&&(Bt.baseIndent=st),Bt},token:function(st,Bt){if(!Bt.tagName&&st.sol()&&(Bt.indented=st.indentation()),st.eatSpace())return null;ze=null;var Qe=Bt.tokenize(st,Bt);return(Qe||ze)&&Qe!="comment"&&(ut=null,Bt.state=Bt.state(ze||Qe,st,Bt),ut&&(Qe=ut=="error"?Qe+" error":ut)),Qe},indent:function(st,Bt,Qe){var zt=st.context;if(st.tokenize.isInAttribute)return st.tagStart==st.indented?st.stringStartCol+1:st.indented+Ae;if(zt&&zt.noIndent)return me.Pass;if(st.tokenize!=We&&st.tokenize!=Le)return Qe?Qe.match(/^(\s*)/)[0].length:0;if(st.tagName)return Ne.multilineTagIndentPastTag!==!1?st.tagStart+st.tagName.length+2:st.tagStart+Ae*(Ne.multilineTagIndentFactor||1);if(Ne.alignCDATA&&/<!\[CDATA\[/.test(Bt))return 0;var ct=Bt&&/^<(\/)?([\w_:\.-]*)/.exec(Bt);if(ct&&ct[1])for(;zt;)if(zt.tagName==ct[2]){zt=zt.prev;break}else if(Ne.implicitlyClosed.hasOwnProperty(zt.tagName))zt=zt.prev;else break;else if(ct)for(;zt;){var It=Ne.contextGrabbers[zt.tagName];if(It&&It.hasOwnProperty(ct[2]))zt=zt.prev;else break}for(;zt&&zt.prev&&!zt.startOfLine;)zt=zt.prev;return zt?zt.indent+Ae:st.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:Ne.htmlMode?"html":"xml",helperType:Ne.htmlMode?"html":"xml",skipAttribute:function(st){st.state==Ve&&(st.state=Ue)},xmlCurrentTag:function(st){return st.tagName?{name:st.tagName,close:st.type=="closeTag"}:null},xmlCurrentContext:function(st){for(var Bt=[],Qe=st.context;Qe;Qe=Qe.prev)Qe.tagName&&Bt.push(Qe.tagName);return Bt.reverse()}}}),me.defineMIME("text/xml","xml"),me.defineMIME("application/xml","xml"),me.mimeModes.hasOwnProperty("text/html")||me.defineMIME("text/html",{name:"xml",htmlMode:!0})})},2859:function(kn,cn,ue){"use strict";ue.d(cn,{hP:function(){return Wt}});var me=function(ye,se){return(me=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(oe,de){oe.__proto__=de}||function(oe,de){for(var fe in de)Object.prototype.hasOwnProperty.call(de,fe)&&(oe[fe]=de[fe])})(ye,se)};function je(ye,se){function oe(){this.constructor=ye}me(ye,se),ye.prototype=se===null?Object.create(se):(oe.prototype=se.prototype,new oe)}function Ke(ye,se,oe,de){return new(oe||(oe=Promise))(function(fe,le){function Ie($t){try{Kt(de.next($t))}catch(Jt){le(Jt)}}function it($t){try{Kt(de.throw($t))}catch(Jt){le(Jt)}}function Kt($t){var Jt;$t.done?fe($t.value):(Jt=$t.value,Jt instanceof oe?Jt:new oe(function(qt){qt(Jt)})).then(Ie,it)}Kt((de=de.apply(ye,se||[])).next())})}function ot(ye,se){var oe,de,fe,le,Ie={label:0,sent:function(){if(1&fe[0])throw fe[1];return fe[1]},trys:[],ops:[]};return le={next:it(0),throw:it(1),return:it(2)},typeof Symbol=="function"&&(le[Symbol.iterator]=function(){return this}),le;function it(Kt){return function($t){return function(Jt){if(oe)throw new TypeError("Generator is already executing.");for(;Ie;)try{if(oe=1,de&&(fe=2&Jt[0]?de.return:Jt[0]?de.throw||((fe=de.return)&&fe.call(de),0):de.next)&&!(fe=fe.call(de,Jt[1])).done)return fe;switch(de=0,fe&&(Jt=[2&Jt[0],fe.value]),Jt[0]){case 0:case 1:fe=Jt;break;case 4:return Ie.label++,{value:Jt[1],done:!1};case 5:Ie.label++,de=Jt[1],Jt=[0];continue;case 7:Jt=Ie.ops.pop(),Ie.trys.pop();continue;default:if(fe=Ie.trys,!((fe=fe.length>0&&fe[fe.length-1])||Jt[0]!==6&&Jt[0]!==2)){Ie=0;continue}if(Jt[0]===3&&(!fe||Jt[1]>fe[0]&&Jt[1]<fe[3])){Ie.label=Jt[1];break}if(Jt[0]===6&&Ie.label<fe[1]){Ie.label=fe[1],fe=Jt;break}if(fe&&Ie.label<fe[2]){Ie.label=fe[2],Ie.ops.push(Jt);break}fe[2]&&Ie.ops.pop(),Ie.trys.pop();continue}Jt=se.call(ye,Ie)}catch(qt){Jt=[6,qt],de=0}finally{oe=fe=0}if(5&Jt[0])throw Jt[1];return{value:Jt[0]?Jt[1]:void 0,done:!0}}([Kt,$t])}}}function be(){for(var ye=0,se=0,oe=arguments.length;se<oe;se++)ye+=arguments[se].length;var de=Array(ye),fe=0;for(se=0;se<oe;se++)for(var le=arguments[se],Ie=0,it=le.length;Ie<it;Ie++,fe++)de[fe]=le[Ie];return de}var Ae=function(){function ye(){}return ye.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ye.setAttributes=function(se,oe){for(var de=0,fe=oe;de<fe.length;de++){var le=fe[de],Ie=le[0],it=le[1];se.setAttribute(Ie,it)}},ye.createRect=function(se,oe,de){var fe=document.createElementNS("http://www.w3.org/2000/svg","rect");return fe.setAttribute("width",se.toString()),fe.setAttribute("height",oe.toString()),de&&ye.setAttributes(fe,de),fe},ye.createLine=function(se,oe,de,fe,le){var Ie=document.createElementNS("http://www.w3.org/2000/svg","line");return Ie.setAttribute("x1",se.toString()),Ie.setAttribute("y1",oe.toString()),Ie.setAttribute("x2",de.toString()),Ie.setAttribute("y2",fe.toString()),le&&ye.setAttributes(Ie,le),Ie},ye.createPolygon=function(se,oe){var de=document.createElementNS("http://www.w3.org/2000/svg","polygon");return de.setAttribute("points",se),oe&&ye.setAttributes(de,oe),de},ye.createCircle=function(se,oe){var de=document.createElementNS("http://www.w3.org/2000/svg","circle");return de.setAttribute("cx",(se/2).toString()),de.setAttribute("cy",(se/2).toString()),de.setAttribute("r",se.toString()),oe&&ye.setAttributes(de,oe),de},ye.createEllipse=function(se,oe,de){var fe=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return fe.setAttribute("cx",(se/2).toString()),fe.setAttribute("cy",(oe/2).toString()),fe.setAttribute("rx",(se/2).toString()),fe.setAttribute("ry",(oe/2).toString()),de&&ye.setAttributes(fe,de),fe},ye.createGroup=function(se){var oe=document.createElementNS("http://www.w3.org/2000/svg","g");return se&&ye.setAttributes(oe,se),oe},ye.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ye.createMarker=function(se,oe,de,fe,le,Ie,it){var Kt=document.createElementNS("http://www.w3.org/2000/svg","marker");return ye.setAttributes(Kt,[["id",se],["orient",oe],["markerWidth",de.toString()],["markerHeight",fe.toString()],["refX",le.toString()],["refY",Ie.toString()]]),Kt.appendChild(it),Kt},ye.createText=function(se){var oe=document.createElementNS("http://www.w3.org/2000/svg","text");return oe.setAttribute("x","0"),oe.setAttribute("y","0"),se&&ye.setAttributes(oe,se),oe},ye.createTSpan=function(se,oe){var de=document.createElementNS("http://www.w3.org/2000/svg","tspan");return de.textContent=se,oe&&ye.setAttributes(de,oe),de},ye.createImage=function(se){var oe=document.createElementNS("http://www.w3.org/2000/svg","image");return se&&ye.setAttributes(oe,se),oe},ye.createPoint=function(se,oe){var de=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return de.x=se,de.y=oe,de},ye.createPath=function(se,oe){var de=document.createElementNS("http://www.w3.org/2000/svg","path");return de.setAttribute("d",se),oe&&ye.setAttributes(de,oe),de},ye}(),Ne=function(){function ye(){}return ye.addKey=function(se){ye.key=se},Object.defineProperty(ye,"isLicensed",{get:function(){return!!ye.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ye.key)},enumerable:!1,configurable:!0}),ye}(),Ce=function(){function ye(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return ye.prototype.rasterize=function(se,oe,de){var fe=this;return new Promise(function(le){var Ie=de!==void 0?de:document.createElement("canvas");se===null&&(fe.markersOnly=!0,fe.naturalSize=!1);var it=document.createElementNS("http://www.w3.org/2000/svg","svg");it.setAttribute("xmlns","http://www.w3.org/2000/svg"),it.setAttribute("width",oe.width.baseVal.valueAsString),it.setAttribute("height",oe.height.baseVal.valueAsString),it.setAttribute("viewBox","0 0 "+oe.viewBox.baseVal.width.toString()+" "+oe.viewBox.baseVal.height.toString()),it.innerHTML=oe.innerHTML,fe.naturalSize===!0?(it.width.baseVal.value=se.naturalWidth,it.height.baseVal.value=se.naturalHeight):fe.width!==void 0&&fe.height!==void 0&&(it.width.baseVal.value=fe.width,it.height.baseVal.value=fe.height),Ie.width=it.width.baseVal.value,Ie.height=it.height.baseVal.value;var Kt=it.outerHTML,$t=Ie.getContext("2d");fe.markersOnly!==!0&&$t.drawImage(se,0,0,Ie.width,Ie.height);var Jt=window.URL,qt=new Image(Ie.width,Ie.height);qt.setAttribute("crossOrigin","anonymous");var on=new Blob([Kt],{type:"image/svg+xml"}),mn=Jt.createObjectURL(on);qt.onload=function(){$t.drawImage(qt,0,0),Jt.revokeObjectURL(mn);var Cn=Ie.toDataURL(fe.imageType,fe.imageQuality);le(Cn)},qt.src=mn})},ye}(),Me=function(){},ze=function(){function ye(se){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+se+"_"}return Object.defineProperty(ye.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ye.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(ye.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),ye.prototype.addClass=function(se){return this.styleSheet===void 0&&this.addStyleSheet(),se.name=""+this.classNamePrefix+se.localName,this.classes.push(se),this.styleSheet.sheet.insertRule("."+se.name+" {"+se.style+"}",this.styleSheet.sheet.cssRules.length),se},ye.prototype.addRule=function(se){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(se),this.styleSheet.sheet.insertRule(se.selector+" {"+se.style+"}",this.styleSheet.sheet.cssRules.length)},ye.prototype.addStyleSheet=function(){var se;this.styleSheet=document.createElement("style"),((se=this.styleSheetRoot)!==null&&se!==void 0?se:document.head).appendChild(this.styleSheet),this.addRule(new ut("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ut("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
|
from {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`)),this.addRule(new ut("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
|
from {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)),this.addClass(new Le("fade_in",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
|
`)),this.addClass(new Le("fade_out",`
|
|
|
animation-duration: 0.3s;
|
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
|
`))},ye.prototype.removeStyleSheet=function(){var se;this.styleSheet&&(((se=this.styleSheetRoot)!==null&&se!==void 0?se:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ye}(),ut=function(ye,se){this.selector=ye,this.style=se},Le=function(ye,se){this.localName=ye,this.style=se},We=function(){function ye(se,oe,de,fe,le){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=se,this.displayMode=oe,this.markerItems=de,this.uiStyleSettings=fe,this.styles=le,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return ye.prototype.show=function(se){var oe=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=se,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var de=document.createElement("div");de.className=this.toolbarBlockStyleClass.name,de.style.whiteSpace="nowrap",this.uiContainer.appendChild(de),this.addActionButton(de,'<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(de,'<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(de,'<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(de,'<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(de,'<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(de,'<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(de,'<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(de,'<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 Ie=document.createElement("div");Ie.className=""+oe.toolbarButtonStyleClass.name,Ie.setAttribute("data-type-name",le.typeName),Ie.innerHTML=le.icon,Ie.addEventListener("click",function(){oe.markerToolbarButtonClicked(Ie,le)}),oe.buttons.push(Ie),oe.markerButtons.push(Ie)}),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 fe=document.createElement("div");fe.className=this.toolbarBlockStyleClass.name,fe.style.whiteSpace="nowrap",fe.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(fe),this.addActionButton(fe,'<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(fe,'<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()},ye.prototype.addButtonClickListener=function(se){this.buttonClickListeners.push(se)},ye.prototype.removeButtonClickListener=function(se){this.buttonClickListeners.indexOf(se)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(se),1)},ye.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ye.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var se=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var oe=0;oe<this.markerButtons.length;oe++)oe<se||oe===se&&this.markerButtons.length-1===se?this.markerButtonBlock.appendChild(this.markerButtons[oe]):(oe===se&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[oe]))}},ye.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")},ye.prototype.resetButtonStyles=function(){var se=this;this.buttons.forEach(function(oe){oe.className=oe.className.replace(se.uiStyleSettings.toolbarButtonStyleColorsClassName?se.uiStyleSettings.toolbarButtonStyleColorsClassName:se.toolbarButtonStyleColorsClass.name,"").trim(),oe.className=oe.className.replace(se.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?se.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:se.toolbarActiveButtonStyleColorsClass.name,"").trim(),oe.className+=" "+(se.uiStyleSettings.toolbarButtonStyleColorsClassName?se.uiStyleSettings.toolbarButtonStyleColorsClassName:se.toolbarButtonStyleColorsClass.name)})},ye.prototype.addActionButton=function(se,oe,de){var fe=this,le=document.createElement("div");switch(le.className=""+this.toolbarButtonStyleClass.name,le.innerHTML=oe,le.setAttribute("data-action",de),le.addEventListener("click",function(){fe.actionToolbarButtonClicked(le,de)}),de){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}se.appendChild(le),this.buttons.push(le)},ye.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Le("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 Le("toolbar_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Le("toolbar-block",`
|
|
|
display: inline-block;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Le("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 Le("toolbar-overflow-block_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`));var se=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Le("toolbar_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.toolbarButtonStyleColorsClass=this.styles.addClass(new Le("toolbar_button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Le("toolbar_active_button",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new ut("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`)),this.styles.addRule(new ut("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`))},ye.prototype.markerToolbarButtonClicked=function(se,oe){this.setActiveButton(se),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(de){return de("marker",oe)}),this.markerButtonOverflowBlock.style.display="none"},ye.prototype.actionToolbarButtonClicked=function(se,oe){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(de){return de("action",oe)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},ye.prototype.setActiveButton=function(se){this.resetButtonStyles(),se.className=se.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),se.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},ye.prototype.setActiveMarkerButton=function(se){var oe=this.markerButtons.find(function(de){return de.getAttribute("data-type-name")===se});oe&&this.setActiveButton(oe)},ye.prototype.setCurrentMarker=function(se){var oe=this;this.currentMarker=se,this.buttons.filter(function(de){return/delete|notes/.test(de.getAttribute("data-action"))}).forEach(function(de){oe.currentMarker===void 0?(de.style.fillOpacity="0.4",de.style.pointerEvents="none"):(de.style.fillOpacity="1",de.style.pointerEvents="all")})},ye}(),yt=function(){function ye(se,oe,de,fe){this.panels=[],this.panelButtons=[],this.markerjsContainer=se,this.displayMode=oe,this.uiStyleSettings=de,this.styles=fe,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ye.prototype.addStyles=function(){var se;this.toolboxStyleClass=this.styles.addClass(new Le("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 Le("toolbox_colors",`
|
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
|
`));var oe=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Le("toolbox-button-row",`
|
|
|
display: flex;
|
|
|
cursor: default;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Le("toolbox-button-row_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Le("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 Le("toolbox-panel-row_colors",`
|
|
|
background-color: `+((se=this.uiStyleSettings.toolboxBackgroundColor)!==null&&se!==void 0?se:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Le("toolbox_button",`
|
|
|
display: inline-block;
|
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*oe)+`px;
|
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*oe)+`px;
|
|
|
padding: `+oe+`px;
|
|
|
box-sizing: content-box;
|
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Le("toolbox-button_colors",`
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Le("toolbox-active-button_colors",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
|
`)),this.styles.addRule(new ut("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
|
`)),this.styles.addRule(new ut("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
|
`))},ye.prototype.show=function(se){var oe;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=se,this.uiContainer.className=this.toolboxStyleClass.name+" "+((oe=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&oe!==void 0?oe:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},ye.prototype.setPanelButtons=function(se){var oe,de,fe=this;this.panels=se,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((oe=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&oe!==void 0?oe:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((de=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&de!==void 0?de:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(le){var Ie;le.uiStyleSettings=fe.uiStyleSettings;var it=document.createElement("div");it.className=fe.toolboxButtonStyleClass.name+" "+((Ie=fe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ie!==void 0?Ie:fe.toolboxButtonStyleColorsClass.name),it.innerHTML=le.icon,it.title=le.title,it.addEventListener("click",function(){fe.panelButtonClick(le)}),fe.panelButtons.push(it),fe.buttonRow.appendChild(it)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ye.prototype.panelButtonClick=function(se){var oe=this,de=-1;if(se!==this.activePanel){de=this.panels.indexOf(se),this.panelRow.innerHTML="";var fe=se.getUi();fe.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(fe),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=se}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){oe.displayMode==="inline"?oe.panelRow.style.display="none":oe.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(le,Ie){var it,Kt;le.className=oe.toolboxButtonStyleClass.name+" "+(Ie===de?""+((it=oe.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&it!==void 0?it:oe.toolboxActiveButtonStyleColorsClass.name):""+((Kt=oe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Kt!==void 0?Kt:oe.toolboxButtonStyleColorsClass.name))})},ye}(),et=function(ye,se){this.title=ye,this.icon=se},pt=function(ye){function se(oe,de,fe,le){var Ie=ye.call(this,oe,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 Ie.colors=[],Ie.addTransparent=!1,Ie.colorBoxes=[],Ie.colors=de,Ie.currentColor=fe,Ie.setCurrentColor=Ie.setCurrentColor.bind(Ie),Ie.getColorBox=Ie.getColorBox.bind(Ie),Ie}return je(se,ye),se.prototype.getUi=function(){var oe=this,de=document.createElement("div");return de.style.overflow="hidden",de.style.whiteSpace="nowrap",this.colors.forEach(function(fe){var le=oe.getColorBox(fe);de.appendChild(le),oe.colorBoxes.push(le)}),de},se.prototype.getColorBox=function(oe){var de=this,fe=this.uiStyleSettings.toolbarHeight/4,le=this.uiStyleSettings.toolbarHeight-fe,Ie=document.createElement("div");Ie.style.display="inline-block",Ie.style.boxSizing="content-box",Ie.style.width=le-2+"px",Ie.style.height=le-2+"px",Ie.style.padding="1px",Ie.style.marginRight="2px",Ie.style.marginBottom="2px",Ie.style.borderWidth="2px",Ie.style.borderStyle="solid",Ie.style.borderRadius=(le+2)/2+"px",Ie.style.borderColor=oe===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ie.addEventListener("click",function(){de.setCurrentColor(oe,Ie)});var it=document.createElement("div");return it.style.display="inline-block",it.style.width=le-2+"px",it.style.height=le-2+"px",it.style.backgroundColor=oe,it.style.borderRadius=le/2+"px",oe==="transparent"&&(it.style.fill=this.uiStyleSettings.toolboxAccentColor,it.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>`),Ie.appendChild(it),Ie},se.prototype.setCurrentColor=function(oe,de){var fe=this;this.currentColor=oe,this.colorBoxes.forEach(function(le){le.style.borderColor=le===de?fe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(oe)},se}(et),at=function(){function ye(se,oe,de){this._state="new",this._isSelected=!1,this._container=se,this._overlayContainer=oe,this.globalSettings=de,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(ye.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),ye.prototype.ownsTarget=function(se){return!1},Object.defineProperty(ye.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),ye.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},ye.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},ye.prototype.pointerDown=function(se,oe){},ye.prototype.dblClick=function(se,oe){},ye.prototype.manipulate=function(se){},ye.prototype.pointerUp=function(se){this.stateChanged()},ye.prototype.dispose=function(){},ye.prototype.addMarkerVisualToContainer=function(se){this.container.childNodes.length>0?this.container.insertBefore(se,this.container.childNodes[0]):this.container.appendChild(se)},ye.prototype.getState=function(){return{typeName:ye.typeName,state:this.state,notes:this.notes}},ye.prototype.restoreState=function(se){this._state=se.state,this.notes=se.notes},ye.prototype.scale=function(se,oe){},ye.prototype.colorChanged=function(se){this.onColorChanged&&this.onColorChanged(se),this.stateChanged()},ye.prototype.fillColorChanged=function(se){this.onFillColorChanged&&this.onFillColorChanged(se),this.stateChanged()},ye.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var se=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),se.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(se)&&this.onStateChanged(this)}},ye.typeName="MarkerBase",ye}(),St=function(){function ye(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ye.prototype.findGripByVisual=function(se){return this.topLeft.ownsTarget(se)?this.topLeft:this.topCenter.ownsTarget(se)?this.topCenter:this.topRight.ownsTarget(se)?this.topRight:this.centerLeft.ownsTarget(se)?this.centerLeft:this.centerRight.ownsTarget(se)?this.centerRight:this.bottomLeft.ownsTarget(se)?this.bottomLeft:this.bottomCenter.ownsTarget(se)?this.bottomCenter:this.bottomRight.ownsTarget(se)?this.bottomRight:void 0},ye}(),Qt=function(){function ye(){this.GRIP_SIZE=10,this.visual=Ae.createGroup(),this.visual.appendChild(Ae.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ae.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ye.prototype.ownsTarget=function(se){return se===this.visual||se===this.visual.childNodes[0]||se===this.visual.childNodes[1]},ye}(),nt=function(){function ye(){}return ye.toITransformMatrix=function(se){return{a:se.a,b:se.b,c:se.c,d:se.d,e:se.e,f:se.f}},ye.toSVGMatrix=function(se,oe){return se.a=oe.a,se.b=oe.b,se.c=oe.c,se.d=oe.d,se.e=oe.e,se.f=oe.f,se},ye}(),ft=function(ye){function se(oe,de,fe){var le=ye.call(this,oe,de,fe)||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(Ae.createTransform()),le.setupControlBox(),le}return je(se,ye),Object.defineProperty(se.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(se.prototype,"visual",{get:function(){return this._visual},set:function(oe){this._visual=oe;var de=Ae.createTransform();this._visual.transform.baseVal.appendItem(de)},enumerable:!1,configurable:!0}),se.prototype.ownsTarget=function(oe){return!!ye.prototype.ownsTarget.call(this,oe)||!!(this.controlGrips.findGripByVisual(oe)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(oe))},se.prototype.pointerDown=function(oe,de){ye.prototype.pointerDown.call(this,oe,de),this.state==="new"&&(this.left=oe.x,this.top=oe.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var fe=this.unrotatePoint(oe);if(this.manipulationStartX=fe.x,this.manipulationStartY=fe.y,this.offsetX=fe.x-this.left,this.offsetY=fe.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(de),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(de)){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 Ie=this.container.transform.baseVal.getItem(0);Ie.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ie,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},se.prototype.pointerUp=function(oe){var de=this.state;ye.prototype.pointerUp.call(this,oe),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(oe),this._state="select",de==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},se.prototype.moveVisual=function(oe){this.visual.style.transform="translate("+oe.x+"px, "+oe.y+"px)"},se.prototype.manipulate=function(oe){var de=this.unrotatePoint(oe);this.state==="creating"?this.resize(oe):this.state==="move"?(this.left=this.manipulationStartLeft+(de.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(de.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(de):this.state==="rotate"&&this.rotate(oe)},se.prototype.resize=function(oe){var de=this.manipulationStartLeft,fe=this.manipulationStartWidth,le=this.manipulationStartTop,Ie=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:de=this.manipulationStartLeft+oe.x-this.manipulationStartX,fe=this.manipulationStartWidth+this.manipulationStartLeft-de;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:fe=this.manipulationStartWidth+oe.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:le=this.manipulationStartTop+oe.y-this.manipulationStartY,Ie=this.manipulationStartHeight+this.manipulationStartTop-le;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ie=this.manipulationStartHeight+oe.y-this.manipulationStartY}fe>=0?(this.left=de,this.width=fe):(this.left=de+fe,this.width=-fe),Ie>=0?(this.top=le,this.height=Ie):(this.top=le+Ie,this.height=-Ie),this.setSize()},se.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},se.prototype.rotate=function(oe){if(Math.abs(oe.x-this.centerX)>.1){var de=Math.sign(oe.x-this.centerX);this.rotationAngle=180*Math.atan((oe.y-this.centerY)/(oe.x-this.centerX))/Math.PI+90*de,this.applyRotation()}},se.prototype.applyRotation=function(){var oe=this.container.transform.baseVal.getItem(0);oe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(oe,0)},se.prototype.rotatePoint=function(oe){if(this.rotationAngle===0)return oe;var de=this.container.getCTM(),fe=Ae.createPoint(oe.x,oe.y);return{x:(fe=fe.matrixTransform(de)).x,y:fe.y}},se.prototype.unrotatePoint=function(oe){if(this.rotationAngle===0)return oe;var de=this.container.getCTM();de=de.inverse();var fe=Ae.createPoint(oe.x,oe.y);return{x:(fe=fe.matrixTransform(de)).x,y:fe.y}},se.prototype.select=function(){ye.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},se.prototype.deselect=function(){ye.prototype.deselect.call(this),this.controlBox.style.display="none"},se.prototype.setupControlBox=function(){this.controlBox=Ae.createGroup();var oe=Ae.createTransform();oe.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(oe),this.container.appendChild(this.controlBox),this.controlRect=Ae.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=Ae.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 St,this.addControlGrips(),this.controlBox.style.display="none"},se.prototype.adjustControlBox=function(){var oe=this.controlBox.transform.baseVal.getItem(0);oe.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(oe,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()},se.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()},se.prototype.createGrip=function(){var oe=new Qt;return oe.visual.transform.baseVal.appendItem(Ae.createTransform()),this.controlBox.appendChild(oe.visual),oe},se.prototype.positionGrips=function(){var oe=this.controlGrips.topLeft.GRIP_SIZE,de=-oe/2,fe=de,le=(this.width+this.CB_DISTANCE)/2-oe/2,Ie=(this.height+this.CB_DISTANCE)/2-oe/2,it=this.height+this.CB_DISTANCE-oe/2,Kt=this.width+this.CB_DISTANCE-oe/2;this.positionGrip(this.controlGrips.topLeft.visual,de,fe),this.positionGrip(this.controlGrips.topCenter.visual,le,fe),this.positionGrip(this.controlGrips.topRight.visual,Kt,fe),this.positionGrip(this.controlGrips.centerLeft.visual,de,Ie),this.positionGrip(this.controlGrips.centerRight.visual,Kt,Ie),this.positionGrip(this.controlGrips.bottomLeft.visual,de,it),this.positionGrip(this.controlGrips.bottomCenter.visual,le,it),this.positionGrip(this.controlGrips.bottomRight.visual,Kt,it),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,le,fe-3*this.CB_DISTANCE)},se.prototype.positionGrip=function(oe,de,fe){var le=oe.transform.baseVal.getItem(0);le.setTranslate(de,fe),oe.transform.baseVal.replaceItem(le,0)},se.prototype.hideControlBox=function(){this.controlBox.style.display="none"},se.prototype.showControlBox=function(){this.controlBox.style.display=""},se.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)},ye.prototype.getState.call(this))},se.prototype.restoreState=function(oe){ye.prototype.restoreState.call(this,oe);var de=oe;this.left=de.left,this.top=de.top,this.width=de.width,this.height=de.height,this.rotationAngle=de.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(nt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,de.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(nt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,de.containerTransformMatrix))},se.prototype.scale=function(oe,de){ye.prototype.scale.call(this,oe,de);var fe=this.rotatePoint({x:this.left,y:this.top}),le=this.unrotatePoint({x:fe.x*oe,y:fe.y*de});this.left=le.x,this.top=le.y,this.width=this.width*oe,this.height=this.height*de,this.adjustControlBox()},se}(at),Ze=function(ye){function se(oe,de,fe){var le=ye.call(this,oe,de,fe)||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 je(se,ye),se.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.visual)},se.prototype.createVisual=function(){this.visual=Ae.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)},se.prototype.pointerDown=function(oe,de){ye.prototype.pointerDown.call(this,oe,de),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},se.prototype.manipulate=function(oe){ye.prototype.manipulate.call(this,oe)},se.prototype.resize=function(oe){ye.prototype.resize.call(this,oe),this.setSize()},se.prototype.setSize=function(){ye.prototype.setSize.call(this),Ae.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},se.prototype.pointerUp=function(oe){ye.prototype.pointerUp.call(this,oe),this.setSize()},se.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.visual&&Ae.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(oe),this.stateChanged()},se.prototype.setFillColor=function(oe){this.fillColor=oe,this.visual&&Ae.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},se.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.visual&&Ae.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},se.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.visual&&Ae.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},se.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ye.prototype.getState.call(this))},se.prototype.restoreState=function(oe){var de=oe;this.fillColor=de.fillColor,this.strokeColor=de.strokeColor,this.strokeWidth=de.strokeWidth,this.strokeDasharray=de.strokeDasharray,this.opacity=de.opacity,this.createVisual(),ye.prototype.restoreState.call(this,oe),this.setSize()},se.prototype.scale=function(oe,de){ye.prototype.scale.call(this,oe,de),this.setSize()},se.title="Rectangle marker",se}(ft),ke=function(ye){function se(oe,de,fe,le){var Ie=ye.call(this,oe,le||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Ie.widths=[],Ie.widthBoxes=[],Ie.widths=de,Ie.currentWidth=fe,Ie.setCurrentWidth=Ie.setCurrentWidth.bind(Ie),Ie}return je(se,ye),se.prototype.getUi=function(){var oe=this,de=document.createElement("div");return de.style.display="flex",de.style.overflow="hidden",de.style.flexGrow="2",this.widths.forEach(function(fe){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=fe===oe.currentWidth?oe.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){oe.setCurrentWidth(fe,le)}),de.appendChild(le);var Ie=document.createElement("div");Ie.innerText=fe.toString(),Ie.style.marginRight="5px",le.appendChild(Ie);var it=document.createElement("div");it.style.minHeight="20px",it.style.flexGrow="2",it.style.display="flex",it.style.alignItems="center";var Kt=document.createElement("hr");Kt.style.minWidth="20px",Kt.style.border="0px",Kt.style.borderTop=fe+"px solid "+oe.uiStyleSettings.toolboxColor,Kt.style.flexGrow="2",it.appendChild(Kt),le.appendChild(it),oe.widthBoxes.push(le)}),de},se.prototype.setCurrentWidth=function(oe,de){var fe=this;this.currentWidth=oe,this.widthBoxes.forEach(function(le){le.style.borderColor=le===de?fe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},se}(et),He=function(ye){function se(oe,de,fe,le){var Ie=ye.call(this,oe,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 Ie.styles=[],Ie.styleBoxes=[],Ie.styles=de,Ie.currentStyle=fe,Ie.setCurrentStyle=Ie.setCurrentStyle.bind(Ie),Ie}return je(se,ye),se.prototype.getUi=function(){var oe=this,de=document.createElement("div");return de.style.display="flex",de.style.overflow="hidden",de.style.flexGrow="2",this.styles.forEach(function(fe){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/oe.styles.length-5+"%",le.style.borderColor=fe===oe.currentStyle?oe.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){oe.setCurrentStyle(fe,le)}),de.appendChild(le);var Ie=document.createElement("div");Ie.style.minHeight="20px",Ie.style.flexGrow="2",Ie.style.overflow="hidden";var it=`<svg width="100" height="20">
|
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+oe.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(fe!==""?'stroke-dasharray="'+fe+'"':"")+` />
|
|
|
</svg>`;Ie.innerHTML=it,le.appendChild(Ie),oe.styleBoxes.push(le)}),de},se.prototype.setCurrentStyle=function(oe,de){var fe=this;this.currentStyle=oe,this.styleBoxes.forEach(function(le){le.style.borderColor=le===de?fe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},se}(et),Ue=function(ye){function se(oe,de,fe){var le=ye.call(this,oe,de,fe)||this;return le.strokeColor=fe.defaultColor,le.strokeWidth=fe.defaultStrokeWidth,le.strokeDasharray=fe.defaultStrokeDasharray,le.strokePanel=new pt("Line color",fe.defaultColorSet,fe.defaultColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.strokeWidthPanel=new ke("Line width",fe.defaultStrokeWidths,fe.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new He("Line style",fe.defaultStrokeDasharrays,fe.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le}return je(se,ye),Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=ye.prototype.getState.call(this);return oe.typeName=se.typeName,oe},se.typeName="FrameMarker",se.title="Frame marker",se.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',se}(Ze),bt=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"},Ve=function(ye){function se(oe,de,fe){var le=ye.call(this,oe,de,fe)||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 je(se,ye),se.prototype.ownsTarget=function(oe){return!!ye.prototype.ownsTarget.call(this,oe)||!(!this.grip1.ownsTarget(oe)&&!this.grip2.ownsTarget(oe))},se.prototype.pointerDown=function(oe,de){ye.prototype.pointerDown.call(this,oe,de),this.manipulationStartX=oe.x,this.manipulationStartY=oe.y,this.state==="new"&&(this.x1=oe.x,this.y1=oe.y,this.x2=oe.x,this.y2=oe.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(de)?this.activeGrip=this.grip1:this.grip2.ownsTarget(de)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},se.prototype.pointerUp=function(oe){var de=this.state;ye.prototype.pointerUp.call(this,oe),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(oe),this._state="select",de==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},se.prototype.adjustVisual=function(){},se.prototype.manipulate=function(oe){this.state==="creating"?this.resize(oe):this.state==="move"?(this.x1=this.manipulationStartX1+oe.x-this.manipulationStartX,this.y1=this.manipulationStartY1+oe.y-this.manipulationStartY,this.x2=this.manipulationStartX2+oe.x-this.manipulationStartX,this.y2=this.manipulationStartY2+oe.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(oe)},se.prototype.resize=function(oe){switch(this.activeGrip){case this.grip1:this.x1=oe.x,this.y1=oe.y;break;case this.grip2:case void 0:this.x2=oe.x,this.y2=oe.y}this.adjustVisual(),this.adjustControlBox()},se.prototype.select=function(){ye.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},se.prototype.deselect=function(){ye.prototype.deselect.call(this),this.controlBox.style.display="none"},se.prototype.setupControlBox=function(){this.controlBox=Ae.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},se.prototype.adjustControlBox=function(){this.positionGrips()},se.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},se.prototype.createGrip=function(){var oe=new Qt;return oe.visual.transform.baseVal.appendItem(Ae.createTransform()),this.controlBox.appendChild(oe.visual),oe},se.prototype.positionGrips=function(){var oe=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-oe/2,this.y1-oe/2),this.positionGrip(this.grip2.visual,this.x2-oe/2,this.y2-oe/2)},se.prototype.positionGrip=function(oe,de,fe){var le=oe.transform.baseVal.getItem(0);le.setTranslate(de,fe),oe.transform.baseVal.replaceItem(le,0)},se.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},ye.prototype.getState.call(this))},se.prototype.restoreState=function(oe){ye.prototype.restoreState.call(this,oe);var de=oe;this.x1=de.x1,this.y1=de.y1,this.x2=de.x2,this.y2=de.y2},se.prototype.scale=function(oe,de){ye.prototype.scale.call(this,oe,de),this.x1=this.x1*oe,this.y1=this.y1*de,this.x2=this.x2*oe,this.y2=this.y2*de,this.adjustVisual(),this.adjustControlBox()},se}(at),jt=function(ye){function se(oe,de,fe){var le=ye.call(this,oe,de,fe)||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=fe.defaultColor,le.strokeWidth=fe.defaultStrokeWidth,le.strokeDasharray=fe.defaultStrokeDasharray,le.strokePanel=new pt("Line color",fe.defaultColorSet,fe.defaultColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.strokeWidthPanel=new ke("Line width",fe.defaultStrokeWidths,fe.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new He("Line style",fe.defaultStrokeDasharrays,fe.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le}return je(se,ye),se.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.selectorLine&&oe!==this.visibleLine)},se.prototype.createVisual=function(){this.visual=Ae.createGroup(),this.selectorLine=Ae.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=Ae.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)},se.prototype.pointerDown=function(oe,de){ye.prototype.pointerDown.call(this,oe,de),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},se.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()),Ae.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),Ae.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),Ae.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},se.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.adjustVisual(),this.colorChanged(oe)},se.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.adjustVisual()},se.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.adjustVisual(),this.stateChanged()},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},ye.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){ye.prototype.restoreState.call(this,oe);var de=oe;this.strokeColor=de.strokeColor,this.strokeWidth=de.strokeWidth,this.strokeDasharray=de.strokeDasharray,this.createVisual(),this.adjustVisual()},se.typeName="LineMarker",se.title="Line marker",se.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',se}(Ve),st=function(ye){function se(oe,de,fe,le){var Ie=ye.call(this,oe,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 Ie.fonts=[],Ie.fontBoxes=[],Ie.fonts=de,Ie.currentFont=fe,Ie.setCurrentFont=Ie.setCurrentFont.bind(Ie),Ie}return je(se,ye),se.prototype.getUi=function(){var oe=this,de=document.createElement("div");return de.style.overflow="hidden",de.style.flexGrow="2",this.fonts.forEach(function(fe){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/oe.fonts.length-5+"%",le.style.borderColor=fe===oe.currentFont?oe.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){oe.setCurrentFont(fe,le)}),de.appendChild(le);var Ie=document.createElement("div");Ie.style.display="flex",Ie.style.minHeight="20px",Ie.style.flexGrow="2",Ie.style.fontFamily=fe,Ie.style.overflow="hidden";var it=document.createElement("div");it.style.whiteSpace="nowrap",it.style.overflow="hidden",it.style.textOverflow="ellipsis",it.innerHTML="The quick brown fox jumps over the lazy dog",Ie.appendChild(it),le.appendChild(Ie),oe.fontBoxes.push(le)}),de},se.prototype.setCurrentFont=function(oe,de){var fe=this;this.currentFont=oe,this.fontBoxes.forEach(function(le){le.style.borderColor=le===de?fe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},se}(et),Bt=function(ye){function se(oe,de,fe){var le=ye.call(this,oe,de,fe)||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=fe.defaultColor,le.fontFamily=fe.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 pt("Color",fe.defaultColorSet,fe.defaultColor),le.colorPanel.onColorChanged=le.setColor,le.fontFamilyPanel=new st("Font",fe.defaultFontFamilies,fe.defaultFontFamily),le.fontFamilyPanel.onFontChanged=le.setFont,le}return je(se,ye),se.prototype.ownsTarget=function(oe){if(ye.prototype.ownsTarget.call(this,oe)||oe===this.visual||oe===this.textElement||oe===this.bgRectangle)return!0;var de=!1;return this.textElement.childNodes.forEach(function(fe){fe===oe&&(de=!0)}),de},se.prototype.createVisual=function(){this.visual=Ae.createGroup(),this.bgRectangle=Ae.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=Ae.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(Ae.createTransform()),this.textElement.transform.baseVal.appendItem(Ae.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},se.prototype.pointerDown=function(oe,de){ye.prototype.pointerDown.call(this,oe,de),this.isMoved=!1,this.pointerDownPoint=oe,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},se.prototype.renderText=function(){var oe=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(de){oe.textElement.appendChild(Ae.createTSpan(de.trim()===""?" ":de.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},se.prototype.getTextScale=function(){var oe=this.textElement.getBBox(),de=1;if(oe.width>0&&oe.height>0){var fe=(1*this.width-this.width*this.padding*2/100)/oe.width,le=(1*this.height-this.height*this.padding*2/100)/oe.height;de=Math.min(fe,le)}return de},se.prototype.getTextPosition=function(oe){var de=this.textElement.getBBox(),fe=0,le=0;return de.width>0&&de.height>0&&(fe=(this.width-de.width*oe)/2,le=this.height/2-de.height*oe/2),{x:fe,y:le}},se.prototype.sizeText=function(){var oe=this.textElement.getBBox(),de=this.getTextScale(),fe=this.getTextPosition(de);fe.y-=oe.y*de,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+fe.x+"px, "+fe.y+"px) scale("+de+", "+de+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(fe.x,fe.y),this.textElement.transform.baseVal.getItem(1).setScale(de,de))},se.prototype.manipulate=function(oe){ye.prototype.manipulate.call(this,oe),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(oe.x-this.pointerDownPoint.x)>5||Math.abs(oe.y-this.pointerDownPoint.y)>5)},se.prototype.resize=function(oe){ye.prototype.resize.call(this,oe),this.isMoved=!0,this.setSize(),this.sizeText()},se.prototype.setSize=function(){ye.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(Ae.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Ae.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},se.prototype.pointerUp=function(oe){var de=this.state;de==="creating"&&(this._suppressMarkerCreateEvent=!0),ye.prototype.pointerUp.call(this,oe),this.setSize(),(de==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},se.prototype.showTextEditor=function(){var oe=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(de){de.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var de=Number.parseFloat(oe.textEditor.style.fontSize);oe.textEditor.clientWidth>=Number.parseInt(oe.textEditor.style.maxWidth)&&de>.9;)de-=.1,oe.textEditor.style.fontSize=Math.max(de,.9)+"em"}),this.textEditor.addEventListener("keyup",function(de){de.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(de){if(de.clipboardData){var fe=de.clipboardData.getData("text"),le=window.getSelection();if(!le.rangeCount)return!1;le.deleteFromDocument(),le.getRangeAt(0).insertNode(document.createTextNode(fe)),de.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){oe.textEditDivClicked(oe.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},se.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var oe=this.getTextScale(),de=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),fe=this.textElement.getBBox(),le={x:fe.width*oe,y:fe.height*oe};de.x-=le.x/2,de.y-=le.y/2,this.textEditor.style.top=de.y+"px",this.textEditor.style.left=de.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-de.x+"px",this.textEditor.style.fontSize=Math.max(16*oe,12)+"px",this.textElement.style.display="none"}},se.prototype.textEditDivClicked=function(oe){this.text=oe.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},se.prototype.select=function(){ye.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},se.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ye.prototype.deselect.call(this)},se.prototype.dblClick=function(oe,de){ye.prototype.dblClick.call(this,oe,de),this.showTextEditor()},se.prototype.setColor=function(oe){this.textElement&&Ae.setAttributes(this.textElement,[["fill",oe]]),this.color=oe,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(oe)},se.prototype.setFont=function(oe){this.textElement&&Ae.setAttributes(this.textElement,[["font-family",oe]]),this.fontFamily=oe,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},se.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},se.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},ye.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){var de=oe;this.color=de.color,this.fontFamily=de.fontFamily,this.padding=de.padding,this.text=de.text,this.createVisual(),ye.prototype.restoreState.call(this,oe),this.setSize()},se.prototype.scale=function(oe,de){ye.prototype.scale.call(this,oe,de),this.setSize(),this.sizeText(),this.positionTextEditor()},se.typeName="TextMarker",se.title="Text marker",se.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>',se}(ft),Qe=function(ye){function se(oe,de,fe){var le=ye.call(this,oe,de,fe)||this;return le.color="transparent",le.lineWidth=3,le.drawing=!1,le.pixelRatio=1,le.color=fe.defaultColor,le.lineWidth=fe.defaultStrokeWidth,le.pixelRatio=fe.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 pt("Color",fe.defaultColorSet,fe.defaultColor),le.colorPanel.onColorChanged=le.setColor,le.lineWidthPanel=new ke("Line width",fe.defaultStrokeWidths,fe.defaultStrokeWidth),le.lineWidthPanel.onWidthChanged=le.setLineWidth,le}return je(se,ye),se.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.drawingImage)},se.prototype.createVisual=function(){this.visual=Ae.createGroup(),this.drawingImage=Ae.createImage(),this.visual.appendChild(this.drawingImage);var oe=Ae.createTransform();this.visual.transform.baseVal.appendItem(oe),this.addMarkerVisualToContainer(this.visual)},se.prototype.pointerDown=function(oe,de){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(oe.x,oe.y),this.drawing=!0):ye.prototype.pointerDown.call(this,oe,de)},se.prototype.manipulate=function(oe){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(oe.x,oe.y),this.canvasContext.stroke()):ye.prototype.manipulate.call(this,oe)},se.prototype.resize=function(oe){ye.prototype.resize.call(this,oe),Ae.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Ae.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},se.prototype.pointerUp=function(oe){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):ye.prototype.pointerUp.call(this,oe)},se.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)},se.prototype.select=function(){this.state==="creating"&&this.finishCreation(),ye.prototype.select.call(this)},se.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ye.prototype.deselect.call(this)},se.prototype.finishCreation=function(){for(var oe=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),de=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],fe=de[0],le=de[1],Ie=de[2],it=de[3],Kt=!1,$t=0;$t<this.canvasElement.height;$t++)for(var Jt=0;Jt<this.canvasElement.width;Jt++)oe.data[$t*this.canvasElement.width*4+4*Jt+3]>0&&(Kt=!0,$t<le&&(le=$t),Jt<fe&&(fe=Jt),$t>it&&(it=$t),Jt>Ie&&(Ie=Jt));if(Kt){this.left=fe/this.pixelRatio,this.top=le/this.pixelRatio,this.width=(Ie-fe)/this.pixelRatio,this.height=(it-le)/this.pixelRatio;var qt=document.createElement("canvas");qt.width=Ie-fe,qt.height=it-le,qt.getContext("2d").putImageData(this.canvasContext.getImageData(fe,le,Ie-fe,it-le),0,0),this.drawingImgUrl=qt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},se.prototype.setDrawingImage=function(){Ae.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),Ae.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},se.prototype.setColor=function(oe){this.color=oe,this.colorChanged(oe)},se.prototype.setLineWidth=function(oe){this.lineWidth=oe},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=Object.assign({drawingImgUrl:this.drawingImgUrl},ye.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){this.createVisual(),ye.prototype.restoreState.call(this,oe),this.drawingImgUrl=oe.drawingImgUrl,this.setDrawingImage()},se.prototype.scale=function(oe,de){ye.prototype.scale.call(this,oe,de),this.setDrawingImage()},se.typeName="FreehandMarker",se.title="Freehand marker",se.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>',se}(ft),zt=function(ye){function se(oe,de,fe){var le=ye.call(this,oe,fe||'<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=de,le.setCurrentType=le.setCurrentType.bind(le),le}return je(se,ye),se.prototype.getUi=function(){var oe=this,de=document.createElement("div");de.style.display="flex",de.style.overflow="hidden",de.style.flexGrow="2";for(var fe=function(it){var Kt="both";switch(it){case 0:Kt="both";break;case 1:Kt="start";break;case 2:Kt="end";break;case 3:Kt="none"}var $t=document.createElement("div");if($t.style.display="flex",$t.style.flexGrow="2",$t.style.alignItems="center",$t.style.justifyContent="space-between",$t.style.padding="5px",$t.style.borderWidth="2px",$t.style.borderStyle="solid",$t.style.borderColor=Kt===le.currentType?le.uiStyleSettings.toolboxAccentColor:"transparent",$t.addEventListener("click",function(){oe.setCurrentType(Kt,$t)}),de.appendChild($t),Kt==="both"||Kt==="start"){var Jt=document.createElement("div");Jt.style.display="flex",Jt.style.alignItems="center",Jt.style.minHeight="20px",Jt.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>`,Jt.style.marginLeft="5px",$t.appendChild(Jt)}var qt=document.createElement("div");qt.style.display="flex",qt.style.alignItems="center",qt.style.minHeight="20px",qt.style.flexGrow="2";var on=document.createElement("hr");if(on.style.minWidth="20px",on.style.border="0px",on.style.borderTop="3px solid "+(le.uiStyleSettings!==void 0?le.uiStyleSettings.toolboxColor:"#eeeeee"),on.style.flexGrow="2",qt.appendChild(on),$t.appendChild(qt),Kt==="both"||Kt==="end"){var mn=document.createElement("div");mn.style.display="flex",mn.style.alignItems="center",mn.style.minHeight="20px",mn.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>`,mn.style.marginRight="5px",$t.appendChild(mn)}le.typeBoxes.push($t)},le=this,Ie=0;Ie<4;Ie++)fe(Ie);return de},se.prototype.setCurrentType=function(oe,de){var fe=this;this.currentType=oe,this.typeBoxes.forEach(function(le){le.style.borderColor=le===de?fe.uiStyleSettings!==void 0?fe.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},se}(et),ct=function(ye){function se(oe,de,fe){var le=ye.call(this,oe,de,fe)||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 zt("Arrow type","end"),le.arrowTypePanel.onArrowTypeChanged=le.setArrowType,le}return je(se,ye),se.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.arrow1&&oe!==this.arrow2)},se.prototype.getArrowPoints=function(oe,de){var fe=this.arrowBaseWidth+2*this.strokeWidth,le=this.arrowBaseHeight+2*this.strokeWidth;return oe-fe/2+","+(de+le/2)+" "+oe+","+(de-le/2)+" "+(oe+fe/2)+","+(de+le/2)},se.prototype.createTips=function(){this.arrow1=Ae.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(Ae.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=Ae.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(Ae.createTransform()),this.visual.appendChild(this.arrow2)},se.prototype.pointerDown=function(oe,de){ye.prototype.pointerDown.call(this,oe,de),this.state==="creating"&&this.createTips()},se.prototype.adjustVisual=function(){if(ye.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",Ae.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),Ae.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var oe=0;Math.abs(this.x1-this.x2)>.1&&(oe=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var de=this.arrow1.transform.baseVal.getItem(0);de.setRotate(oe,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(de,0);var fe=this.arrow2.transform.baseVal.getItem(0);fe.setRotate(oe+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(fe,0)}},se.prototype.setArrowType=function(oe){this.arrowType=oe,this.adjustVisual(),this.stateChanged()},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=Object.assign({arrowType:this.arrowType},ye.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){ye.prototype.restoreState.call(this,oe);var de=oe;this.arrowType=de.arrowType,this.createTips(),this.adjustVisual()},se.typeName="ArrowMarker",se.title="Arrow marker",se.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',se}(jt),It=function(ye){function se(oe,de,fe){var le=ye.call(this,oe,de,fe)||this;return le.fillColor=fe.defaultFillColor,le.strokeWidth=0,le.fillPanel=new pt("Color",fe.defaultColorSet,fe.defaultFillColor),le.fillPanel.onColorChanged=le.setFillColor,le}return je(se,ye),Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=ye.prototype.getState.call(this);return oe.typeName=se.typeName,oe},se.typeName="CoverMarker",se.title="Cover marker",se.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',se}(Ze),Rt=function(ye){function se(oe,de,fe,le){var Ie=ye.call(this,oe,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 Ie.opacities=[],Ie.opacityBoxes=[],Ie.opacities=de,Ie.currentOpacity=fe,Ie.setCurrentOpacity=Ie.setCurrentOpacity.bind(Ie),Ie}return je(se,ye),se.prototype.getUi=function(){var oe=this,de=document.createElement("div");return de.style.display="flex",de.style.overflow="hidden",de.style.flexGrow="2",de.style.justifyContent="space-between",this.opacities.forEach(function(fe){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=fe===oe.currentOpacity?oe.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){oe.setCurrentOpacity(fe,le)}),de.appendChild(le);var Ie=document.createElement("div");Ie.innerText=100*fe+"%",le.appendChild(Ie),oe.opacityBoxes.push(le)}),de},se.prototype.setCurrentOpacity=function(oe,de){var fe=this;this.currentOpacity=oe,this.opacityBoxes.forEach(function(le){le.style.borderColor=le===de?fe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},se}(et),mt=function(ye){function se(oe,de,fe){var le=ye.call(this,oe,de,fe)||this;return le.setOpacity=le.setOpacity.bind(le),le.fillColor=fe.defaultHighlightColor,le.strokeWidth=0,le.opacity=fe.defaultHighlightOpacity,le.fillPanel=new pt("Color",fe.defaultColorSet,le.fillColor),le.fillPanel.onColorChanged=le.setFillColor,le.opacityPanel=new Rt("Opacity",fe.defaultOpacitySteps,le.opacity),le.opacityPanel.onOpacityChanged=le.setOpacity,le}return je(se,ye),se.prototype.setOpacity=function(oe){this.opacity=oe,this.visual&&Ae.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=ye.prototype.getState.call(this);return oe.typeName=se.typeName,oe},se.typeName="HighlightMarker",se.title="Highlight marker",se.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>',se}(It),$e='<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>',xe='<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>',ht=function(ye){function se(oe,de,fe){var le=ye.call(this,oe,de,fe)||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=fe.defaultStrokeColor,le.bgColor=fe.defaultFillColor,le.fontFamily=fe.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 pt("Text color",fe.defaultColorSet,le.color,$e),le.colorPanel.onColorChanged=le.setColor,le.bgColorPanel=new pt("Fill color",fe.defaultColorSet,le.bgColor,xe),le.bgColorPanel.onColorChanged=le.setBgColor,le.fontFamilyPanel=new st("Font",fe.defaultFontFamilies,fe.defaultFontFamily),le.fontFamilyPanel.onFontChanged=le.setFont,le.tipGrip=new Qt,le.tipGrip.visual.transform.baseVal.appendItem(Ae.createTransform()),le.controlBox.appendChild(le.tipGrip.visual),le}return je(se,ye),se.prototype.ownsTarget=function(oe){return ye.prototype.ownsTarget.call(this,oe)||this.tipGrip.ownsTarget(oe)||this.tip===oe},se.prototype.createTip=function(){Ae.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=Ae.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},se.prototype.pointerDown=function(oe,de){this.state==="new"&&ye.prototype.pointerDown.call(this,oe,de),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(de)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ye.prototype.pointerDown.call(this,oe,de)},se.prototype.pointerUp=function(oe){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ye.prototype.pointerUp.call(this,oe);else{var de=this.state==="creating";ye.prototype.pointerUp.call(this,oe),this.setTipPoints(de),this.positionTip()}},se.prototype.manipulate=function(oe){if(this.tipMoving){var de=this.unrotatePoint(oe);this.tipPosition={x:de.x-this.manipulationStartLeft,y:de.y-this.manipulationStartTop},this.positionTip()}else ye.prototype.manipulate.call(this,oe)},se.prototype.setBgColor=function(oe){this.bgRectangle&&this.tip&&(Ae.setAttributes(this.bgRectangle,[["fill",oe]]),Ae.setAttributes(this.tip,[["fill",oe]])),this.bgColor=oe,this.fillColorChanged(oe)},se.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},se.prototype.setTipPoints=function(oe){oe===void 0&&(oe=!1);var de=Math.min(this.height/2,15),fe=this.height/5;oe&&(this.tipPosition={x:de+fe/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))?(fe=this.width/5,de=Math.min(this.width/2,15),this.tipBase1Position={x:de,y:0},this.tipBase2Position={x:de+fe,y:0}):(this.tipBase1Position={x:0,y:de},this.tipBase2Position={x:0,y:de+fe}):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))?(fe=this.width/5,de=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-de-fe,y:0},this.tipBase2Position={x:this.width-de,y:0}):(this.tipBase1Position={x:this.width,y:de},this.tipBase2Position={x:this.width,y:de+fe}):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))?(fe=this.width/5,de=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-de-fe,y:this.height},this.tipBase2Position={x:this.width-de,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-de-fe},this.tipBase2Position={x:this.width,y:this.height-de}):le<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(fe=this.width/5,de=Math.min(this.width/2,15),this.tipBase1Position={x:de,y:this.height},this.tipBase2Position={x:de+fe,y:this.height}):(this.tipBase1Position={x:0,y:this.height-de},this.tipBase2Position={x:0,y:this.height-de-fe})},se.prototype.resize=function(oe){ye.prototype.resize.call(this,oe),this.positionTip()},se.prototype.positionTip=function(){Ae.setAttributes(this.tip,[["points",this.getTipPoints()]]);var oe=this.tipGrip.visual.transform.baseVal.getItem(0);oe.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(oe,0)},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),se.prototype.select=function(){this.positionTip(),ye.prototype.select.call(this)},se.prototype.getState=function(){var oe=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},ye.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){var de=oe;this.bgColor=de.bgColor,this.tipPosition=de.tipPosition,ye.prototype.restoreState.call(this,oe),this.createTip(),this.setTipPoints()},se.prototype.scale=function(oe,de){ye.prototype.scale.call(this,oe,de),this.tipPosition={x:this.tipPosition.x*oe,y:this.tipPosition.y*de},this.positionTip()},se.typeName="CalloutMarker",se.title="Callout marker",se.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>',se}(Bt),nn=function(ye){function se(oe,de,fe){var le=ye.call(this,oe,de,fe)||this;return le.fillColor="transparent",le.strokeColor="transparent",le.strokeWidth=0,le.strokeDasharray="",le.opacity=1,le.strokeColor=fe.defaultColor,le.strokeWidth=fe.defaultStrokeWidth,le.strokeDasharray=fe.defaultStrokeDasharray,le.fillColor=fe.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 pt("Line color",be(fe.defaultColorSet,["transparent"]),fe.defaultColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.fillPanel=new pt("Fill color",be(fe.defaultColorSet,["transparent"]),le.fillColor,xe),le.fillPanel.onColorChanged=le.setFillColor,le.strokeWidthPanel=new ke("Line width",fe.defaultStrokeWidths,fe.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new He("Line style",fe.defaultStrokeDasharrays,fe.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le.opacityPanel=new Rt("Opacity",fe.defaultOpacitySteps,le.opacity),le.opacityPanel.onOpacityChanged=le.setOpacity,le}return je(se,ye),se.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.visual)},se.prototype.createVisual=function(){this.visual=Ae.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)},se.prototype.pointerDown=function(oe,de){ye.prototype.pointerDown.call(this,oe,de),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},se.prototype.manipulate=function(oe){ye.prototype.manipulate.call(this,oe)},se.prototype.resize=function(oe){ye.prototype.resize.call(this,oe),this.setSize()},se.prototype.setSize=function(){ye.prototype.setSize.call(this),Ae.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},se.prototype.pointerUp=function(oe){ye.prototype.pointerUp.call(this,oe),this.setSize()},se.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.visual&&Ae.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(oe),this.stateChanged()},se.prototype.setFillColor=function(oe){this.fillColor=oe,this.visual&&Ae.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(oe),this.stateChanged()},se.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.visual&&Ae.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},se.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.visual&&Ae.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},se.prototype.setOpacity=function(oe){this.opacity=oe,this.visual&&Ae.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ye.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){var de=oe;this.fillColor=de.fillColor,this.strokeColor=de.strokeColor,this.strokeWidth=de.strokeWidth,this.strokeDasharray=de.strokeDasharray,this.opacity=de.opacity,this.createVisual(),ye.prototype.restoreState.call(this,oe),this.setSize()},se.prototype.scale=function(oe,de){ye.prototype.scale.call(this,oe,de),this.setSize()},se.typeName="EllipseMarker",se.title="Ellipse marker",se.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>',se}(ft),Ut=function(ye){function se(oe,de,fe){return ye.call(this,oe,de,fe)||this}return je(se,ye),Object.defineProperty(se.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),se.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.tip1&&oe!==this.tip2)},se.prototype.createTips=function(){this.tip1=Ae.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(Ae.createTransform()),this.visual.appendChild(this.tip1),this.tip2=Ae.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(Ae.createTransform()),this.visual.appendChild(this.tip2)},se.prototype.pointerDown=function(oe,de){ye.prototype.pointerDown.call(this,oe,de),this.state==="creating"&&this.createTips()},se.prototype.adjustVisual=function(){if(ye.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(Ae.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()]]),Ae.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 oe=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),de=this.tip1.transform.baseVal.getItem(0);de.setRotate(oe,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(de,0);var fe=this.tip2.transform.baseVal.getItem(0);fe.setRotate(oe+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(fe,0)}},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=ye.prototype.getState.call(this);return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){ye.prototype.restoreState.call(this,oe),this.createTips(),this.adjustVisual()},se.typeName="MeasurementMarker",se.title="Measurement marker",se.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>',se}(jt),Xe=function(ye){function se(oe,de,fe){var le=ye.call(this,oe,de,fe)||this;return le.strokePanel.colors=fe.defaultColorSet,le.fillColor="transparent",le}return je(se,ye),Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=ye.prototype.getState.call(this);return oe.typeName=se.typeName,oe},se.typeName="EllipseFrameMarker",se.title="Ellipse frame marker",se.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>',se}(nn),Ye=function(){function ye(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(ye.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),ye.prototype.addUndoStep=function(se){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(se)||(this.undoStack.push(se),JSON.stringify(this.lastRedoStep)!==JSON.stringify(se)&&this.redoStack.splice(0,this.redoStack.length))},ye.prototype.replaceLastUndoStep=function(se){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=se)},ye.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},ye.prototype.undo=function(){if(this.undoStack.length>1){var se=this.undoStack.pop();return se!==void 0&&this.redoStack.push(se),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},ye.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},ye}(),Dt=function(ye){function se(oe,de,fe){var le=ye.call(this,oe,de,fe)||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=fe.defaultColor,le.strokeWidth=fe.defaultStrokeWidth,le.strokeDasharray=fe.defaultStrokeDasharray,le.strokePanel=new pt("Line color",fe.defaultColorSet,fe.defaultColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.strokeWidthPanel=new ke("Line width",fe.defaultStrokeWidths,fe.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new He("Line style",fe.defaultStrokeDasharrays,fe.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le}return je(se,ye),se.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.selectorCurve&&oe!==this.visibleCurve&&!this.curveGrip.ownsTarget(oe))},se.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},se.prototype.createVisual=function(){this.visual=Ae.createGroup(),this.selectorCurve=Ae.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=Ae.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)},se.prototype.pointerDown=function(oe,de){ye.prototype.pointerDown.call(this,oe,de),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=oe.x,this.curveY=oe.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(de)&&(this.activeGrip=this.curveGrip,this._state="resize")},se.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),Ae.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),Ae.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),Ae.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},se.prototype.setupControlBox=function(){ye.prototype.setupControlBox.call(this),this.curveControlLine1=Ae.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=Ae.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)},se.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,ye.prototype.addControlGrips.call(this)},se.prototype.positionGrips=function(){ye.prototype.positionGrips.call(this);var oe=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-oe/2,this.curveY-oe/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()))},se.prototype.manipulate=function(oe){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+oe.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+oe.y-this.manipulationStartY),ye.prototype.manipulate.call(this,oe)},se.prototype.resize=function(oe){this.activeGrip===this.curveGrip&&(this.curveX=oe.x,this.curveY=oe.y),ye.prototype.resize.call(this,oe),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},se.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.adjustVisual(),this.colorChanged(oe)},se.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.adjustVisual()},se.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.adjustVisual()},se.prototype.scale=function(oe,de){this.curveX=this.curveX*oe,this.curveY=this.curveY*de,ye.prototype.scale.call(this,oe,de)},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},ye.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){ye.prototype.restoreState.call(this,oe);var de=oe;this.strokeColor=de.strokeColor,this.strokeWidth=de.strokeWidth,this.strokeDasharray=de.strokeDasharray,this.curveX=de.curveX,this.curveY=de.curveY,this.createVisual(),this.adjustVisual()},se.typeName="CurveMarker",se.title="Curve marker",se.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>',se}(Ve),bn=function(ye){function se(oe,de,fe){var le=ye.call(this,oe,de,fe)||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=fe.defaultColor,le.strokeWidth=fe.defaultStrokeWidth,le.strokeDasharray=fe.defaultStrokeDasharray,le.fillColor=fe.defaultFillColor,le.textColor=fe.defaultStrokeColor,le.fontFamily=fe.defaultFontFamily,le.fontSize=fe.defaultCaptionFontSize,le.captionText=fe.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 pt("Line color",be(fe.defaultColorSet,["transparent"]),le.strokeColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.fillPanel=new pt("Fill color",be(fe.defaultColorSet,["transparent"]),le.fillColor,xe),le.fillPanel.onColorChanged=le.setFillColor,le.strokeWidthPanel=new ke("Line width",fe.defaultStrokeWidths,fe.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new He("Line style",fe.defaultStrokeDasharrays,fe.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le.fontFamilyPanel=new st("Font",fe.defaultFontFamilies,fe.defaultFontFamily),le.fontFamilyPanel.onFontChanged=le.setFont,le.textColorPanel=new pt("Text color",fe.defaultColorSet,le.textColor,$e),le.textColorPanel.onColorChanged=le.setTextColor,le}return je(se,ye),se.prototype.ownsTarget=function(oe){return!(!ye.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.frame&&oe!==this.captionBg&&oe!==this.captionElement)},se.prototype.createVisual=function(){this.visual=Ae.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=Ae.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=Ae.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=Ae.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()},se.prototype.setCaptionText=function(oe){this.captionText=oe,this.captionElement.textContent=this.captionText,this.sizeCaption()},se.prototype.pointerDown=function(oe,de){ye.prototype.pointerDown.call(this,oe,de),this.isMoved=!1,this.pointerDownPoint=oe,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},se.prototype.manipulate=function(oe){ye.prototype.manipulate.call(this,oe),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(oe.x-this.pointerDownPoint.x)>5||Math.abs(oe.y-this.pointerDownPoint.y)>5)},se.prototype.resize=function(oe){ye.prototype.resize.call(this,oe),this.setSize()},se.prototype.sizeCaption=function(){var oe=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=oe.width+2*this.PADDING,this.captionBoxHeight=oe.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),Ae.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')"]]),Ae.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')"]])},se.prototype.showTextEditor=function(){var oe=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(de){de.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(de){de.key==="Enter"&&oe.finishTextEditing(oe.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(de){de.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){oe.finishTextEditing(oe.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){oe.finishTextEditing(oe.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},se.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"))},se.prototype.finishTextEditing=function(oe){this.setCaptionText(oe.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},se.prototype.setFont=function(oe){this.captionElement&&Ae.setAttributes(this.captionElement,[["font-family",oe]]),this.fontFamily=oe,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},se.prototype.setTextColor=function(oe){this.captionElement&&Ae.setAttributes(this.captionElement,[["fill",oe]]),this.textColor=oe,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},se.prototype.setSize=function(){ye.prototype.setSize.call(this),Ae.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},se.prototype.pointerUp=function(oe){ye.prototype.pointerUp.call(this,oe),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},se.prototype.dblClick=function(oe,de){ye.prototype.dblClick.call(this,oe,de),this.showTextEditor()},se.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.frame&&Ae.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(oe),this.stateChanged()},se.prototype.setFillColor=function(oe){this.fillColor=oe,this.captionBg&&Ae.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(oe),this.stateChanged()},se.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.frame&&Ae.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},se.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.frame&&Ae.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=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},ye.prototype.getState.call(this));return oe.typeName=this.typeName,oe},se.prototype.restoreState=function(oe){var de=oe;this.fillColor=de.fillColor,this.strokeColor=de.strokeColor,this.strokeWidth=de.strokeWidth,this.strokeDasharray=de.strokeDasharray,this.textColor=de.textColor,this.fontFamily=de.fontFamily,this.captionText=de.captionText,this.fontSize=de.fontSize,this.createVisual(),ye.prototype.restoreState.call(this,oe),this.setSize()},se.prototype.scale=function(oe,de){ye.prototype.scale.call(this,oe,de),this.setSize()},se.typeName="CaptionFrameMarker",se.title="Caption frame marker",se.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>',se}(ft),tn=function(){function ye(se,oe){oe===void 0&&(oe=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=se,this.cancelable=oe}return Object.defineProperty(ye.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ye.prototype.preventDefault=function(){this._defaultPrevented=!0},ye}(),un=function(ye){function se(oe,de,fe){var le=ye.call(this,oe,!1)||this;return le.dataUrl=de,le.state=fe,le}return je(se,ye),se}(tn),Vt=function(ye){function se(oe,de,fe){fe===void 0&&(fe=!1);var le=ye.call(this,oe,fe)||this;return le.marker=de,le}return je(se,ye),se}(tn),Gt=function(){function ye(){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 ye.prototype.addEventListener=function(se,oe){this[se].push(oe)},ye.prototype.removeEventListener=function(se,oe){var de=this[se].indexOf(oe);de>-1&&this[se].splice(de,1)},ye}(),Wt=function(){function ye(se){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new bt,this._isOpen=!1,this.undoRedoManager=new Ye,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 Gt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ye.instanceCounter++,this.styles=new ze(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=se,this.targetRoot=document.body,this.width=se.clientWidth,this.height=se.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(ye.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ue,Qe,ct,Bt,Xe,nn,mt,ht,Ut,It,jt,Dt,bn]},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ue,Qe,ct,Bt,nn,mt,ht]},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ue,Qe,ct,Bt,mt]},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(se){var oe=this;this._availableMarkerTypes.splice(0),se.forEach(function(de){if(typeof de=="string"){var fe=oe.ALL_MARKER_TYPES.find(function(le){return le.typeName===de});fe!==void 0&&oe._availableMarkerTypes.push(fe)}else oe._availableMarkerTypes.push(de)})},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ye.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(se){this._zoomLevel=se,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(ye.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),ye.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ne.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ye.prototype.show=function(){var se=this;this.styles.styleSheetRoot===void 0&&Me.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Me.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(oe){return oe(new tn(se))})},ye.prototype.render=function(){return Ke(this,void 0,void 0,function(){var se;return ot(this,function(oe){switch(oe.label){case 0:return this.setCurrentMarker(),(se=new Ce).naturalSize=this.renderAtNaturalSize,se.imageType=this.renderImageType,se.imageQuality=this.renderImageQuality,se.markersOnly=this.renderMarkersOnly,se.width=this.renderWidth,se.height=this.renderHeight,[4,se.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return oe.sent(),[4,se.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,oe.sent()]}})})},ye.prototype.close=function(se){var oe=this;if(se===void 0&&(se=!1),this.isOpen){var de=!1;se||this.eventListeners.beforeclose.forEach(function(fe){var le=new tn(oe,!0);fe(le),le.defaultPrevented&&(de=!0)}),de||(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(fe){return fe(new tn(oe))}),this.detachEvents(),this._isOpen=!1)}},ye.prototype.addMarkersToToolbar=function(){for(var se,oe=[],de=0;de<arguments.length;de++)oe[de]=arguments[de];(se=this._availableMarkerTypes).push.apply(se,oe)},ye.prototype.addRenderEventListener=function(se){this.addEventListener("render",function(oe){se(oe.dataUrl,oe.state)})},ye.prototype.removeRenderEventListener=function(se){},ye.prototype.addCloseEventListener=function(se){this.addEventListener("close",function(){se()})},ye.prototype.removeCloseEventListener=function(se){},ye.prototype.setupResizeObserver=function(){var se=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){se.resize(se.target.clientWidth,se.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return se.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},ye.prototype.onPopupTargetResize=function(){var se=1*this.target.clientWidth/this.target.clientHeight,oe=this.editorCanvas.clientWidth/se>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*se:this.editorCanvas.clientWidth,de=oe<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/se;this.resize(oe,de)},ye.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ye.prototype.resize=function(se,oe){this._isResizing=!0;var de=se/this.imageWidth,fe=oe/this.imageHeight;this.imageWidth=Math.round(se),this.imageHeight=Math.round(oe),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(de,fe),this._isResizing=!1},ye.prototype.scaleMarkers=function(se,oe){var de,fe=this;this._currentMarker&&this._currentMarker instanceof Bt?this._currentMarker.scale(se,oe):(de=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(le){le!==fe._currentMarker&&le.scale(se,oe)}),de!==void 0&&this.setCurrentMarker(de)},ye.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"},ye.prototype.setTopLeft=function(){var se=this.editingTarget.getBoundingClientRect(),oe=this.editorCanvas.getBoundingClientRect();this.left=se.left-oe.left,this.top=se.top-oe.top},ye.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)},ye.prototype.addDefs=function(){for(var se,oe=[],de=0;de<arguments.length;de++)oe[de]=arguments[de];this.defs=Ae.createDefs(),this.addDefsToImage(),(se=this.defs).append.apply(se,oe)},ye.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},ye.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)},ye.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},ye.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},ye.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)},ye.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},ye.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)},ye.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 se=document.createElement("a");se.href="https://markerjs.com/",se.target="_blank",se.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>',se.title="Powered by marker.js",se.style.display="grid",se.style.alignItems="center",se.style.justifyItems="center",se.style.padding="3px",se.style.width="20px",se.style.height="20px",this.logoUI.appendChild(se),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},ye.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")},ye.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"},ye.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ye.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 se=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=se+"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 We(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 yt(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},ye.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ye.prototype.removeMarker=function(se){this.markerImage.removeChild(se.container),this.markers.indexOf(se)>-1&&this.markers.splice(this.markers.indexOf(se),1),se.dispose()},ye.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())},ye.prototype.toolbarButtonClicked=function(se,oe){if(se==="marker"&&oe!==void 0)this.createNewMarker(oe);else if(se==="action")switch(oe){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()}},ye.prototype.deleteSelectedMarker=function(){var se=this;if(this._currentMarker!==void 0){var oe=!1;if(this.eventListeners.markerbeforedelete.forEach(function(fe){var le=new Vt(se,se._currentMarker,!0);fe(le),le.defaultPrevented&&(oe=!0)}),!oe){var de=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(fe){return fe(new Vt(se,de))})}}},ye.prototype.clear=function(){var se=this,oe=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ie){var it=new Vt(se,void 0,!0);Ie(it),it.defaultPrevented&&(oe=!0)}),!oe)){this.setCurrentMarker();for(var de=function(Ie){var it=fe.markers[Ie];fe.setCurrentMarker(fe.markers[Ie]),fe._currentMarker.dispose(),fe.markerImage.removeChild(fe._currentMarker.container),fe.markers.splice(fe.markers.indexOf(fe._currentMarker),1),fe.eventListeners.markerdelete.forEach(function(Kt){return Kt(new Vt(se,it))})},fe=this,le=this.markers.length-1;le>=0;le--)de(le);this.addUndoStep()}},Object.defineProperty(ye.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ye.prototype.showNotesEditor=function(){var se;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=(se=this._currentMarker.notes)!==null&&se!==void 0?se:"",this.overlayContainer.appendChild(this.notesArea))},ye.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)},ye.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},ye.prototype.addUndoStep=function(){var se=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var oe=this.getState(),de=this.undoRedoManager.getLastUndoStep();if(!de||de.width===oe.width&&de.height===oe.height){var fe=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(oe),fe<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(le){return le(new tn(se))})}else this.undoRedoManager.replaceLastUndoStep(oe),this.eventListeners.statechange.forEach(function(le){return le(new tn(se))})}},ye.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},ye.prototype.undoStep=function(){var se=this,oe=this.undoRedoManager.undo();oe!==void 0&&(this.restoreState(oe),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(de){return de(new tn(se))}))},ye.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},ye.prototype.redoStep=function(){var se=this,oe=this.undoRedoManager.redo();oe!==void 0&&(this.restoreState(oe),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(de){return de(new tn(se))}))},ye.prototype.stepZoom=function(){var se=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=se<this.zoomSteps.length-1?this.zoomSteps[se+1]:this.zoomSteps[0]},ye.prototype.panTo=function(se){this.contentDiv.scrollBy({left:this.prevPanPoint.x-se.x,top:this.prevPanPoint.y-se.y}),this.prevPanPoint=se},ye.prototype.startRenderAndClose=function(){return Ke(this,void 0,void 0,function(){var se,oe,de=this;return ot(this,function(fe){switch(fe.label){case 0:return[4,this.render()];case 1:return se=fe.sent(),oe=this.getState(),this.eventListeners.render.forEach(function(le){return le(new un(de,se,oe))}),this.close(!0),[2]}})})},ye.prototype.getState=function(se){se===!0&&this.setCurrentMarker();var oe={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(de){return oe.markers.push(de.getState())}),oe},ye.prototype.restoreState=function(se){var oe=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);se.markers.forEach(function(de){var fe=oe._availableMarkerTypes.find(function(Ie){return Ie.typeName===de.typeName});if(fe!==void 0){var le=oe.addNewMarker(fe);le.restoreState(de),oe.markers.push(le)}}),se.width&&se.height&&(se.width!==this.imageWidth||se.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/se.width,this.imageHeight/se.height),this.eventListeners.restorestate.forEach(function(de){return de(new tn(oe))})},ye.prototype.addNewMarker=function(se){var oe=Ae.createGroup();return this.markerImage.appendChild(oe),new se(oe,this.overlayContainer,this.settings)},ye.prototype.createNewMarker=function(se){var oe,de=this;(oe=typeof se=="string"?this._availableMarkerTypes.find(function(fe){return fe.typeName===se}):se)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(oe),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(oe.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(fe){return fe(new Vt(de,de._currentMarker))}))},ye.prototype.markerCreated=function(se){var oe=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(se),this.setCurrentMarker(se),se instanceof Qe&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Qe):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(de){return de(new Vt(oe,oe._currentMarker))})},ye.prototype.colorChanged=function(se){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=se,this.settings.defaultStrokeColor=se)},ye.prototype.fillColorChanged=function(se){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=se)},ye.prototype.markerStateChanged=function(se){var oe=this;this.eventListeners.markerchange.forEach(function(de){return de(new Vt(oe,se))})},ye.prototype.setCurrentMarker=function(se){var oe=this;this._currentMarker!==se&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(de){return de(new Vt(oe,oe._currentMarker))})),this._currentMarker=se,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(de){return de(new Vt(oe,oe._currentMarker))}))},ye.prototype.onPointerDown=function(se){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||se.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var oe=this.markers.find(function(de){return de.ownsTarget(se.target)});oe!==void 0?(this.setCurrentMarker(oe),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(se.clientX,se.clientY),se.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:se.clientX,y:se.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(se.clientX,se.clientY))},ye.prototype.onDblClick=function(se){if(this._isFocused||this.focus(),this.mode==="select"){var oe=this.markers.find(function(de){return de.ownsTarget(se.target)});oe!==void 0&&oe!==this._currentMarker&&this.setCurrentMarker(oe),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(se.clientX,se.clientY),se.target):this.setCurrentMarker()}},ye.prototype.onPointerMove=function(se){this.touchPoints!==1&&se.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||se.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(se.clientX,se.clientY)):this.zoomLevel>1&&this.panTo({x:se.clientX,y:se.clientY}))},ye.prototype.onPointerUp=function(se){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(se.clientX,se.clientY)),this.isDragging=!1,this.addUndoStep()},ye.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ye.prototype.onKeyUp=function(se){this._currentMarker===void 0||this.notesArea!==void 0||se.key!=="Delete"&&se.key!=="Backspace"||this.deleteSelectedMarker()},ye.prototype.clientToLocalCoordinates=function(se,oe){var de=this.markerImage.getBoundingClientRect();return{x:(se-de.left)/this.zoomLevel,y:(oe-de.top)/this.zoomLevel}},ye.prototype.onWindowResize=function(){this.positionUI()},ye.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var se=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=se+"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()},ye.prototype.addLicenseKey=function(se){Ne.addKey(se)},ye.prototype.addEventListener=function(se,oe){this.eventListeners.addEventListener(se,oe)},ye.prototype.removeEventListener=function(se,oe){this.eventListeners.removeEventListener(se,oe)},ye.prototype.renderState=function(se){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(se),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(ye.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ye.prototype.focus=function(){var se=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(oe){return oe(new tn(se))}))},ye.prototype.blur=function(){var se=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(oe){return oe(new tn(se))}))},ye.instanceCounter=0,ye}()},5630:function(kn,cn,ue){"use strict";var me=ue(60499),je=ue(85899),Ke=ue(18642),ot=ue(72190),be=ue(42244),Ae=ue(92310),Ne=ue.n(Ae),Ce=ue(18929),Me=ue(59301),ze=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],ut=(0,Me.forwardRef)(function(Le,We){var yt,et=Le.prefixCls,pt=et===void 0?"rc-checkbox":et,at=Le.className,St=Le.style,Qt=Le.checked,nt=Le.disabled,ft=Le.defaultChecked,Ze=ft===void 0?!1:ft,ke=Le.type,He=ke===void 0?"checkbox":ke,Ue=Le.title,bt=Le.onChange,Ve=(0,be.Z)(Le,ze),jt=(0,Me.useRef)(null),st=(0,Ce.Z)(Ze,{value:Qt}),Bt=(0,ot.Z)(st,2),Qe=Bt[0],zt=Bt[1];(0,Me.useImperativeHandle)(We,function(){return{focus:function(){var mt;(mt=jt.current)===null||mt===void 0||mt.focus()},blur:function(){var mt;(mt=jt.current)===null||mt===void 0||mt.blur()},input:jt.current}});var ct=Ne()(pt,at,(yt={},(0,Ke.Z)(yt,"".concat(pt,"-checked"),Qe),(0,Ke.Z)(yt,"".concat(pt,"-disabled"),nt),yt)),It=function(mt){nt||("checked"in Le||zt(mt.target.checked),bt==null||bt({target:(0,je.Z)((0,je.Z)({},Le),{},{type:He,checked:mt.target.checked}),stopPropagation:function(){mt.stopPropagation()},preventDefault:function(){mt.preventDefault()},nativeEvent:mt.nativeEvent}))};return Me.createElement("span",{className:ct,title:Ue,style:St},Me.createElement("input",(0,me.Z)({},Ve,{className:"".concat(pt,"-input"),ref:jt,onChange:It,disabled:nt,checked:!!Qe,type:He})),Me.createElement("span",{className:"".concat(pt,"-inner")}))});cn.Z=ut},31561:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return He}});var me=ue(60499),je=ue(18642),Ke=ue(72190),ot=ue(42244),be=ue(35593),Ae=ue(92310),Ne=ue.n(Ae),Ce=ue(8654),Me=ue(59301),ze=ue(10228),ut=ue(16089),Le=ze.Z.ESC,We=ze.Z.TAB;function yt(Ue){var bt=Ue.visible,Ve=Ue.triggerRef,jt=Ue.onVisibleChange,st=Ue.autoFocus,Bt=Ue.overlayRef,Qe=Me.useRef(!1),zt=function(){if(bt){var mt,$e;(mt=Ve.current)===null||mt===void 0||($e=mt.focus)===null||$e===void 0||$e.call(mt),jt==null||jt(!1)}},ct=function(){var mt;return(mt=Bt.current)!==null&&mt!==void 0&&mt.focus?(Bt.current.focus(),Qe.current=!0,!0):!1},It=function(mt){switch(mt.keyCode){case Le:zt();break;case We:{var $e=!1;Qe.current||($e=ct()),$e?mt.preventDefault():zt();break}}};Me.useEffect(function(){return bt?(window.addEventListener("keydown",It),st&&(0,ut.Z)(ct,3),function(){window.removeEventListener("keydown",It),Qe.current=!1}):function(){Qe.current=!1}},[bt])}var et=(0,Me.forwardRef)(function(Ue,bt){var Ve=Ue.overlay,jt=Ue.arrow,st=Ue.prefixCls,Bt=(0,Me.useMemo)(function(){var zt;return typeof Ve=="function"?zt=Ve():zt=Ve,zt},[Ve]),Qe=(0,Ce.sQ)(bt,Bt==null?void 0:Bt.ref);return Me.createElement(Me.Fragment,null,jt&&Me.createElement("div",{className:"".concat(st,"-arrow")}),Me.cloneElement(Bt,{ref:(0,Ce.Yr)(Bt)?Qe:void 0}))}),pt=et,at={adjustX:1,adjustY:1},St=[0,0],Qt={topLeft:{points:["bl","tl"],overflow:at,offset:[0,-4],targetOffset:St},top:{points:["bc","tc"],overflow:at,offset:[0,-4],targetOffset:St},topRight:{points:["br","tr"],overflow:at,offset:[0,-4],targetOffset:St},bottomLeft:{points:["tl","bl"],overflow:at,offset:[0,4],targetOffset:St},bottom:{points:["tc","bc"],overflow:at,offset:[0,4],targetOffset:St},bottomRight:{points:["tr","br"],overflow:at,offset:[0,4],targetOffset:St}},nt=Qt,ft=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function Ze(Ue,bt){var Ve,jt=Ue.arrow,st=jt===void 0?!1:jt,Bt=Ue.prefixCls,Qe=Bt===void 0?"rc-dropdown":Bt,zt=Ue.transitionName,ct=Ue.animation,It=Ue.align,Rt=Ue.placement,mt=Rt===void 0?"bottomLeft":Rt,$e=Ue.placements,xe=$e===void 0?nt:$e,ht=Ue.getPopupContainer,nn=Ue.showAction,Ut=Ue.hideAction,Xe=Ue.overlayClassName,Ye=Ue.overlayStyle,Dt=Ue.visible,bn=Ue.trigger,tn=bn===void 0?["hover"]:bn,un=Ue.autoFocus,Vt=Ue.overlay,Gt=Ue.children,Wt=Ue.onVisibleChange,ye=(0,ot.Z)(Ue,ft),se=Me.useState(),oe=(0,Ke.Z)(se,2),de=oe[0],fe=oe[1],le="visible"in Ue?Dt:de,Ie=Me.useRef(null),it=Me.useRef(null),Kt=Me.useRef(null);Me.useImperativeHandle(bt,function(){return Ie.current});var $t=function(tt){fe(tt),Wt==null||Wt(tt)};yt({visible:le,triggerRef:Kt,onVisibleChange:$t,autoFocus:un,overlayRef:it});var Jt=function(tt){var Fe=Ue.onOverlayClick;fe(!1),Fe&&Fe(tt)},qt=function(){return Me.createElement(pt,{ref:it,overlay:Vt,prefixCls:Qe,arrow:st})},on=function(){return typeof Vt=="function"?qt:qt()},mn=function(){var tt=Ue.minOverlayWidthMatchTrigger,Fe=Ue.alignPoint;return"minOverlayWidthMatchTrigger"in Ue?tt:!Fe},Cn=function(){var tt=Ue.openClassName;return tt!==void 0?tt:"".concat(Qe,"-open")},xt=Me.cloneElement(Gt,{className:Ne()((Ve=Gt.props)===null||Ve===void 0?void 0:Ve.className,le&&Cn()),ref:(0,Ce.Yr)(Gt)?(0,Ce.sQ)(Kt,Gt.ref):void 0}),hn=Ut;return!hn&&tn.indexOf("contextMenu")!==-1&&(hn=["click"]),Me.createElement(be.Z,(0,me.Z)({builtinPlacements:xe},ye,{prefixCls:Qe,ref:Ie,popupClassName:Ne()(Xe,(0,je.Z)({},"".concat(Qe,"-show-arrow"),st)),popupStyle:Ye,action:tn,showAction:nn,hideAction:hn,popupPlacement:mt,popupAlign:It,popupTransitionName:zt,popupAnimation:ct,popupVisible:le,stretch:mn()?"minWidth":"",popup:on(),onPopupVisibleChange:$t,onPopupClick:Jt,getPopupContainer:ht}),xt)}var ke=Me.forwardRef(Ze),He=ke},93681:function(kn,cn,ue){"use strict";ue.r(cn),ue.d(cn,{BaseInput:function(){return ze},default:function(){return Qt}});var me=ue(60499),je=ue(85899),Ke=ue(18642),ot=ue(43749),be=ue(92310),Ae=ue.n(be),Ne=ue(59301),Ce=ue(5643),Me=function(ft){var Ze,ke,He=ft.inputElement,Ue=ft.prefixCls,bt=ft.prefix,Ve=ft.suffix,jt=ft.addonBefore,st=ft.addonAfter,Bt=ft.className,Qe=ft.style,zt=ft.disabled,ct=ft.readOnly,It=ft.focused,Rt=ft.triggerFocus,mt=ft.allowClear,$e=ft.value,xe=ft.handleReset,ht=ft.hidden,nn=ft.classes,Ut=ft.classNames,Xe=ft.dataAttrs,Ye=ft.styles,Dt=ft.components,bn=(Dt==null?void 0:Dt.affixWrapper)||"span",tn=(Dt==null?void 0:Dt.groupWrapper)||"span",un=(Dt==null?void 0:Dt.wrapper)||"span",Vt=(Dt==null?void 0:Dt.groupAddon)||"span",Gt=(0,Ne.useRef)(null),Wt=function(qt){var on;(on=Gt.current)!==null&&on!==void 0&&on.contains(qt.target)&&(Rt==null||Rt())},ye=function(){var qt;if(!mt)return null;var on=!zt&&!ct&&$e,mn="".concat(Ue,"-clear-icon"),Cn=(0,ot.Z)(mt)==="object"&&mt!==null&&mt!==void 0&&mt.clearIcon?mt.clearIcon:"\u2716";return Ne.createElement("span",{onClick:xe,onMouseDown:function(hn){return hn.preventDefault()},className:Ae()(mn,(qt={},(0,Ke.Z)(qt,"".concat(mn,"-hidden"),!on),(0,Ke.Z)(qt,"".concat(mn,"-has-suffix"),!!Ve),qt)),role:"button",tabIndex:-1},Cn)},se=(0,Ne.cloneElement)(He,{value:$e,hidden:ht,className:Ae()((Ze=He.props)===null||Ze===void 0?void 0:Ze.className,!(0,Ce.X3)(ft)&&!(0,Ce.He)(ft)&&Bt)||null,style:(0,je.Z)((0,je.Z)({},(ke=He.props)===null||ke===void 0?void 0:ke.style),!(0,Ce.X3)(ft)&&!(0,Ce.He)(ft)?Qe:{})});if((0,Ce.X3)(ft)){var oe,de="".concat(Ue,"-affix-wrapper"),fe=Ae()(de,(oe={},(0,Ke.Z)(oe,"".concat(de,"-disabled"),zt),(0,Ke.Z)(oe,"".concat(de,"-focused"),It),(0,Ke.Z)(oe,"".concat(de,"-readonly"),ct),(0,Ke.Z)(oe,"".concat(de,"-input-with-clear-btn"),Ve&&mt&&$e),oe),!(0,Ce.He)(ft)&&Bt,nn==null?void 0:nn.affixWrapper,Ut==null?void 0:Ut.affixWrapper),le=(Ve||mt)&&Ne.createElement("span",{className:Ae()("".concat(Ue,"-suffix"),Ut==null?void 0:Ut.suffix),style:Ye==null?void 0:Ye.suffix},ye(),Ve);se=Ne.createElement(bn,(0,me.Z)({className:fe,style:(0,je.Z)((0,je.Z)({},(0,Ce.He)(ft)?void 0:Qe),Ye==null?void 0:Ye.affixWrapper),hidden:!(0,Ce.He)(ft)&&ht,onClick:Wt},Xe==null?void 0:Xe.affixWrapper,{ref:Gt}),bt&&Ne.createElement("span",{className:Ae()("".concat(Ue,"-prefix"),Ut==null?void 0:Ut.prefix),style:Ye==null?void 0:Ye.prefix},bt),(0,Ne.cloneElement)(He,{value:$e,hidden:null}),le)}if((0,Ce.He)(ft)){var Ie="".concat(Ue,"-group"),it="".concat(Ie,"-addon"),Kt=Ae()("".concat(Ue,"-wrapper"),Ie,nn==null?void 0:nn.wrapper),$t=Ae()("".concat(Ue,"-group-wrapper"),Bt,nn==null?void 0:nn.group);return Ne.createElement(tn,{className:$t,style:Qe,hidden:ht},Ne.createElement(un,{className:Kt},jt&&Ne.createElement(Vt,{className:it},jt),(0,Ne.cloneElement)(se,{hidden:null}),st&&Ne.createElement(Vt,{className:it},st)))}return se},ze=Me,ut=ue(77654),Le=ue(72190),We=ue(42244),yt=ue(18929),et=ue(2738),pt=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","classes","classNames","styles"],at=(0,Ne.forwardRef)(function(nt,ft){var Ze=nt.autoComplete,ke=nt.onChange,He=nt.onFocus,Ue=nt.onBlur,bt=nt.onPressEnter,Ve=nt.onKeyDown,jt=nt.prefixCls,st=jt===void 0?"rc-input":jt,Bt=nt.disabled,Qe=nt.htmlSize,zt=nt.className,ct=nt.maxLength,It=nt.suffix,Rt=nt.showCount,mt=nt.type,$e=mt===void 0?"text":mt,xe=nt.classes,ht=nt.classNames,nn=nt.styles,Ut=(0,We.Z)(nt,pt),Xe=(0,yt.Z)(nt.defaultValue,{value:nt.value}),Ye=(0,Le.Z)(Xe,2),Dt=Ye[0],bn=Ye[1],tn=(0,Ne.useState)(!1),un=(0,Le.Z)(tn,2),Vt=un[0],Gt=un[1],Wt=(0,Ne.useRef)(null),ye=function($t){Wt.current&&(0,Ce.nH)(Wt.current,$t)};(0,Ne.useImperativeHandle)(ft,function(){return{focus:ye,blur:function(){var $t;($t=Wt.current)===null||$t===void 0||$t.blur()},setSelectionRange:function($t,Jt,qt){var on;(on=Wt.current)===null||on===void 0||on.setSelectionRange($t,Jt,qt)},select:function(){var $t;($t=Wt.current)===null||$t===void 0||$t.select()},input:Wt.current}}),(0,Ne.useEffect)(function(){Gt(function(Kt){return Kt&&Bt?!1:Kt})},[Bt]);var se=function($t){nt.value===void 0&&bn($t.target.value),Wt.current&&(0,Ce.rJ)(Wt.current,$t,ke)},oe=function($t){bt&&$t.key==="Enter"&&bt($t),Ve==null||Ve($t)},de=function($t){Gt(!0),He==null||He($t)},fe=function($t){Gt(!1),Ue==null||Ue($t)},le=function($t){bn(""),ye(),Wt.current&&(0,Ce.rJ)(Wt.current,$t,ke)},Ie=function(){var $t=(0,et.Z)(nt,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","classes","htmlSize","styles","classNames"]);return Ne.createElement("input",(0,me.Z)({autoComplete:Ze},$t,{onChange:se,onFocus:de,onBlur:fe,onKeyDown:oe,className:Ae()(st,(0,Ke.Z)({},"".concat(st,"-disabled"),Bt),ht==null?void 0:ht.input),style:nn==null?void 0:nn.input,ref:Wt,size:Qe,type:$e}))},it=function(){var $t=Number(ct)>0;if(It||Rt){var Jt=(0,Ce.D7)(Dt),qt=(0,ut.Z)(Jt).length,on=(0,ot.Z)(Rt)==="object"?Rt.formatter({value:Jt,count:qt,maxLength:ct}):"".concat(qt).concat($t?" / ".concat(ct):"");return Ne.createElement(Ne.Fragment,null,!!Rt&&Ne.createElement("span",{className:Ae()("".concat(st,"-show-count-suffix"),(0,Ke.Z)({},"".concat(st,"-show-count-has-suffix"),!!It),ht==null?void 0:ht.count),style:(0,je.Z)({},nn==null?void 0:nn.count)},on),It)}return null};return Ne.createElement(ze,(0,me.Z)({},Ut,{prefixCls:st,className:zt,inputElement:Ie(),handleReset:le,value:(0,Ce.D7)(Dt),focused:Vt,triggerFocus:ye,suffix:it(),disabled:Bt,classes:xe,classNames:ht,styles:nn}))}),St=at,Qt=St},5643:function(kn,cn,ue){"use strict";ue.d(cn,{D7:function(){return be},He:function(){return me},X3:function(){return je},nH:function(){return ot},rJ:function(){return Ke}});function me(Ae){return!!(Ae.addonBefore||Ae.addonAfter)}function je(Ae){return!!(Ae.prefix||Ae.suffix||Ae.allowClear)}function Ke(Ae,Ne,Ce,Me){if(Ce){var ze=Ne;if(Ne.type==="click"){var ut=Ae.cloneNode(!0);ze=Object.create(Ne,{target:{value:ut},currentTarget:{value:ut}}),ut.value="",Ce(ze);return}if(Me!==void 0){ze=Object.create(Ne,{target:{value:Ae},currentTarget:{value:Ae}}),Ae.value=Me,Ce(ze);return}Ce(ze)}}function ot(Ae,Ne){if(Ae){Ae.focus(Ne);var Ce=Ne||{},Me=Ce.cursor;if(Me){var ze=Ae.value.length;switch(Me){case"start":Ae.setSelectionRange(0,0);break;case"end":Ae.setSelectionRange(ze,ze);break;default:Ae.setSelectionRange(0,ze)}}}}function be(Ae){return typeof Ae=="undefined"||Ae===null?"":String(Ae)}},15285:function(kn,cn,ue){"use strict";ue.d(cn,{iz:function(){return Sn},ck:function(){return Hr},BW:function(){return vn},sN:function(){return Hr},Wd:function(){return dt},ZP:function(){return rn},Xl:function(){return Ve}});var me=ue(60499),je=ue(18642),Ke=ue(85899),ot=ue(77654),be=ue(72190),Ae=ue(42244),Ne=ue(92310),Ce=ue.n(Ne),Me=ue(83836),ze=ue(18929),ut=ue(13697),Le=ue(48736),We=ue(59301),yt=ue(4676),et=We.createContext(null);function pt(Be,wt){return Be===void 0?null:"".concat(Be,"-").concat(wt)}function at(Be){var wt=We.useContext(et);return pt(wt,Be)}var St=ue(80547),Qt=["children","locked"],nt=We.createContext(null);function ft(Be,wt){var Ct=(0,Ke.Z)({},Be);return Object.keys(wt).forEach(function(Nt){var Tt=wt[Nt];Tt!==void 0&&(Ct[Nt]=Tt)}),Ct}function Ze(Be){var wt=Be.children,Ct=Be.locked,Nt=(0,Ae.Z)(Be,Qt),Tt=We.useContext(nt),Ft=(0,St.Z)(function(){return ft(Tt,Nt)},[Tt,Nt],function(Ht,gn){return!Ct&&(Ht[0]!==gn[0]||!(0,ut.Z)(Ht[1],gn[1],!0))});return We.createElement(nt.Provider,{value:Ft},wt)}var ke=[],He=We.createContext(null);function Ue(){return We.useContext(He)}var bt=We.createContext(ke);function Ve(Be){var wt=We.useContext(bt);return We.useMemo(function(){return Be!==void 0?[].concat((0,ot.Z)(wt),[Be]):wt},[wt,Be])}var jt=We.createContext(null),st=We.createContext({}),Bt=st,Qe=ue(29194);function zt(Be){var wt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,Qe.Z)(Be)){var Ct=Be.nodeName.toLowerCase(),Nt=["input","select","textarea","button"].includes(Ct)||Be.isContentEditable||Ct==="a"&&!!Be.getAttribute("href"),Tt=Be.getAttribute("tabindex"),Ft=Number(Tt),Ht=null;return Tt&&!Number.isNaN(Ft)?Ht=Ft:Nt&&Ht===null&&(Ht=0),Nt&&Be.disabled&&(Ht=null),Ht!==null&&(Ht>=0||wt&&Ht<0)}return!1}function ct(Be){var wt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ct=(0,ot.Z)(Be.querySelectorAll("*")).filter(function(Nt){return zt(Nt,wt)});return zt(Be,wt)&&Ct.unshift(Be),Ct}var It=null;function Rt(){It=document.activeElement}function mt(){It=null}function $e(){if(It)try{It.focus()}catch(Be){}}function xe(Be,wt){if(wt.keyCode===9){var Ct=ct(Be),Nt=Ct[wt.shiftKey?0:Ct.length-1],Tt=Nt===document.activeElement||Be===document.activeElement;if(Tt){var Ft=Ct[wt.shiftKey?Ct.length-1:0];Ft.focus(),wt.preventDefault()}}}var ht=ue(10228),nn=ue(16089),Ut=ht.Z.LEFT,Xe=ht.Z.RIGHT,Ye=ht.Z.UP,Dt=ht.Z.DOWN,bn=ht.Z.ENTER,tn=ht.Z.ESC,un=ht.Z.HOME,Vt=ht.Z.END,Gt=[Ye,Dt,Ut,Xe];function Wt(Be,wt,Ct,Nt){var Tt,Ft,Ht,gn,wn="prev",Ln="next",zn="children",er="parent";if(Be==="inline"&&Nt===bn)return{inlineTrigger:!0};var cr=(Tt={},(0,je.Z)(Tt,Ye,wn),(0,je.Z)(Tt,Dt,Ln),Tt),Un=(Ft={},(0,je.Z)(Ft,Ut,Ct?Ln:wn),(0,je.Z)(Ft,Xe,Ct?wn:Ln),(0,je.Z)(Ft,Dt,zn),(0,je.Z)(Ft,bn,zn),Ft),In=(Ht={},(0,je.Z)(Ht,Ye,wn),(0,je.Z)(Ht,Dt,Ln),(0,je.Z)(Ht,bn,zn),(0,je.Z)(Ht,tn,er),(0,je.Z)(Ht,Ut,Ct?zn:er),(0,je.Z)(Ht,Xe,Ct?er:zn),Ht),fr={inline:cr,horizontal:Un,vertical:In,inlineSub:cr,horizontalSub:In,verticalSub:In},tr=(gn=fr["".concat(Be).concat(wt?"":"Sub")])===null||gn===void 0?void 0:gn[Nt];switch(tr){case wn:return{offset:-1,sibling:!0};case Ln:return{offset:1,sibling:!0};case er:return{offset:-1,sibling:!1};case zn:return{offset:1,sibling:!1};default:return null}}function ye(Be){for(var wt=Be;wt;){if(wt.getAttribute("data-menu-list"))return wt;wt=wt.parentElement}return null}function se(Be,wt){for(var Ct=Be||document.activeElement;Ct;){if(wt.has(Ct))return Ct;Ct=Ct.parentElement}return null}function oe(Be,wt){var Ct=ct(Be,!0);return Ct.filter(function(Nt){return wt.has(Nt)})}function de(Be,wt,Ct){var Nt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!Be)return null;var Tt=oe(Be,wt),Ft=Tt.length,Ht=Tt.findIndex(function(gn){return Ct===gn});return Nt<0?Ht===-1?Ht=Ft-1:Ht-=1:Nt>0&&(Ht+=1),Ht=(Ht+Ft)%Ft,Tt[Ht]}var fe=function(wt,Ct){var Nt=new Set,Tt=new Map,Ft=new Map;return wt.forEach(function(Ht){var gn=document.querySelector("[data-menu-id='".concat(pt(Ct,Ht),"']"));gn&&(Nt.add(gn),Ft.set(gn,Ht),Tt.set(Ht,gn))}),{elements:Nt,key2element:Tt,element2key:Ft}};function le(Be,wt,Ct,Nt,Tt,Ft,Ht,gn,wn,Ln){var zn=We.useRef(),er=We.useRef();er.current=wt;var cr=function(){nn.Z.cancel(zn.current)};return We.useEffect(function(){return function(){cr()}},[]),function(Un){var In=Un.which;if([].concat(Gt,[bn,tn,un,Vt]).includes(In)){var fr=Ft(),tr=fe(fr,Nt),yr=tr,Gn=yr.elements,Xn=yr.key2element,br=yr.element2key,ur=Xn.get(wt),Br=se(ur,Gn),Gr=br.get(Br),ar=Wt(Be,Ht(Gr,!0).length===1,Ct,In);if(!ar&&In!==un&&In!==Vt)return;(Gt.includes(In)||[un,Vt].includes(In))&&Un.preventDefault();var _n=function(Sr){if(Sr){var ii=Sr,Hn=Sr.querySelector("a");Hn!=null&&Hn.getAttribute("href")&&(ii=Hn);var qn=br.get(Sr);gn(qn),cr(),zn.current=(0,nn.Z)(function(){er.current===qn&&ii.focus()})}};if([un,Vt].includes(In)||ar.sibling||!Br){var Mn;!Br||Be==="inline"?Mn=Tt.current:Mn=ye(Br);var gr,nr=oe(Mn,Gn);In===un?gr=nr[0]:In===Vt?gr=nr[nr.length-1]:gr=de(Mn,Gn,Br,ar.offset),_n(gr)}else if(ar.inlineTrigger)wn(Gr);else if(ar.offset>0)wn(Gr,!0),cr(),zn.current=(0,nn.Z)(function(){tr=fe(fr,Nt);var pr=Br.getAttribute("aria-controls"),Sr=document.getElementById(pr),ii=de(Sr,tr.elements);_n(ii)},5);else if(ar.offset<0){var kr=Ht(Gr,!0),Lr=kr[kr.length-2],Ir=Xn.get(Lr);wn(Lr,!1),_n(Ir)}}Ln==null||Ln(Un)}}function Ie(Be){Promise.resolve().then(Be)}var it="__RC_UTIL_PATH_SPLIT__",Kt=function(wt){return wt.join(it)},$t=function(wt){return wt.split(it)},Jt="rc-menu-more";function qt(){var Be=We.useState({}),wt=(0,be.Z)(Be,2),Ct=wt[1],Nt=(0,We.useRef)(new Map),Tt=(0,We.useRef)(new Map),Ft=We.useState([]),Ht=(0,be.Z)(Ft,2),gn=Ht[0],wn=Ht[1],Ln=(0,We.useRef)(0),zn=(0,We.useRef)(!1),er=function(){zn.current||Ct({})},cr=(0,We.useCallback)(function(Xn,br){var ur=Kt(br);Tt.current.set(ur,Xn),Nt.current.set(Xn,ur),Ln.current+=1;var Br=Ln.current;Ie(function(){Br===Ln.current&&er()})},[]),Un=(0,We.useCallback)(function(Xn,br){var ur=Kt(br);Tt.current.delete(ur),Nt.current.delete(Xn)},[]),In=(0,We.useCallback)(function(Xn){wn(Xn)},[]),fr=(0,We.useCallback)(function(Xn,br){var ur=Nt.current.get(Xn)||"",Br=$t(ur);return br&&gn.includes(Br[0])&&Br.unshift(Jt),Br},[gn]),tr=(0,We.useCallback)(function(Xn,br){return Xn.some(function(ur){var Br=fr(ur,!0);return Br.includes(br)})},[fr]),yr=function(){var br=(0,ot.Z)(Nt.current.keys());return gn.length&&br.push(Jt),br},Gn=(0,We.useCallback)(function(Xn){var br="".concat(Nt.current.get(Xn)).concat(it),ur=new Set;return(0,ot.Z)(Tt.current.keys()).forEach(function(Br){Br.startsWith(br)&&ur.add(Tt.current.get(Br))}),ur},[]);return We.useEffect(function(){return function(){zn.current=!0}},[]),{registerPath:cr,unregisterPath:Un,refreshOverflowKeys:In,isSubPathKey:tr,getKeyPath:fr,getKeys:yr,getSubPathKeys:Gn}}function on(Be){var wt=We.useRef(Be);wt.current=Be;var Ct=We.useCallback(function(){for(var Nt,Tt=arguments.length,Ft=new Array(Tt),Ht=0;Ht<Tt;Ht++)Ft[Ht]=arguments[Ht];return(Nt=wt.current)===null||Nt===void 0?void 0:Nt.call.apply(Nt,[wt].concat(Ft))},[]);return Be?Ct:void 0}var mn=Math.random().toFixed(5).toString().slice(2),Cn=0;function xt(Be){var wt=(0,ze.Z)(Be,{value:Be}),Ct=(0,be.Z)(wt,2),Nt=Ct[0],Tt=Ct[1];return We.useEffect(function(){Cn+=1;var Ft="".concat(mn,"-").concat(Cn);Tt("rc-menu-uuid-".concat(Ft))},[]),Nt}var hn=ue(38705),On=ue(17212),tt=ue(39153),Fe=ue(55401),Ge=ue(2738),Zt=ue(8654);function en(Be,wt,Ct,Nt){var Tt=We.useContext(nt),Ft=Tt.activeKey,Ht=Tt.onActive,gn=Tt.onInactive,wn={active:Ft===Be};return wt||(wn.onMouseEnter=function(Ln){Ct==null||Ct({key:Be,domEvent:Ln}),Ht(Be)},wn.onMouseLeave=function(Ln){Nt==null||Nt({key:Be,domEvent:Ln}),gn(Be)}),wn}function ln(Be){var wt=We.useContext(nt),Ct=wt.mode,Nt=wt.rtl,Tt=wt.inlineIndent;if(Ct!=="inline")return null;var Ft=Be;return Nt?{paddingRight:Ft*Tt}:{paddingLeft:Ft*Tt}}function Dn(Be){var wt=Be.icon,Ct=Be.props,Nt=Be.children,Tt;return wt===null||wt===!1?null:(typeof wt=="function"?Tt=We.createElement(wt,(0,Ke.Z)({},Ct)):typeof wt!="boolean"&&(Tt=wt),Tt||Nt||null)}var Tn=["item"];function En(Be){var wt=Be.item,Ct=(0,Ae.Z)(Be,Tn);return Object.defineProperty(Ct,"item",{get:function(){return(0,Le.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),wt}}),Ct}var Fn=["title","attribute","elementRef"],jn=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],An=["active"],hr=function(Be){(0,tt.Z)(Ct,Be);var wt=(0,Fe.Z)(Ct);function Ct(){return(0,hn.Z)(this,Ct),wt.apply(this,arguments)}return(0,On.Z)(Ct,[{key:"render",value:function(){var Tt=this.props,Ft=Tt.title,Ht=Tt.attribute,gn=Tt.elementRef,wn=(0,Ae.Z)(Tt,Fn),Ln=(0,Ge.Z)(wn,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,Le.ZP)(!Ht,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),We.createElement(Me.Z.Item,(0,me.Z)({},Ht,{title:typeof Ft=="string"?Ft:void 0},Ln,{ref:gn}))}}]),Ct}(We.Component),_r=We.forwardRef(function(Be,wt){var Ct,Nt=Be.style,Tt=Be.className,Ft=Be.eventKey,Ht=Be.warnKey,gn=Be.disabled,wn=Be.itemIcon,Ln=Be.children,zn=Be.role,er=Be.onMouseEnter,cr=Be.onMouseLeave,Un=Be.onClick,In=Be.onKeyDown,fr=Be.onFocus,tr=(0,Ae.Z)(Be,jn),yr=at(Ft),Gn=We.useContext(nt),Xn=Gn.prefixCls,br=Gn.onItemClick,ur=Gn.disabled,Br=Gn.overflowDisabled,Gr=Gn.itemIcon,ar=Gn.selectedKeys,_n=Gn.onActive,Mn=We.useContext(Bt),gr=Mn._internalRenderMenuItem,nr="".concat(Xn,"-item"),kr=We.useRef(),Lr=We.useRef(),Ir=ur||gn,pr=(0,Zt.x1)(wt,Lr),Sr=Ve(Ft),ii=function(Zn){return{key:Ft,keyPath:(0,ot.Z)(Sr).reverse(),item:kr.current,domEvent:Zn}},Hn=wn||Gr,qn=en(Ft,Ir,er,cr),Dr=qn.active,$r=(0,Ae.Z)(qn,An),li=ar.includes(Ft),di=ln(Sr.length),ri=function(Zn){if(!Ir){var mr=ii(Zn);Un==null||Un(En(mr)),br(mr)}},Jr=function(Zn){if(In==null||In(Zn),Zn.which===ht.Z.ENTER){var mr=ii(Zn);Un==null||Un(En(mr)),br(mr)}},yi=function(Zn){_n(Ft),fr==null||fr(Zn)},bi={};Be.role==="option"&&(bi["aria-selected"]=li);var Yn=We.createElement(hr,(0,me.Z)({ref:kr,elementRef:pr,role:zn===null?"none":zn||"menuitem",tabIndex:gn?null:-1,"data-menu-id":Br&&yr?null:yr},tr,$r,bi,{component:"li","aria-disabled":gn,style:(0,Ke.Z)((0,Ke.Z)({},di),Nt),className:Ce()(nr,(Ct={},(0,je.Z)(Ct,"".concat(nr,"-active"),Dr),(0,je.Z)(Ct,"".concat(nr,"-selected"),li),(0,je.Z)(Ct,"".concat(nr,"-disabled"),Ir),Ct),Tt),onClick:ri,onKeyDown:Jr,onFocus:yi}),Ln,We.createElement(Dn,{props:(0,Ke.Z)((0,Ke.Z)({},Be),{},{isSelected:li}),icon:Hn}));return gr&&(Yn=gr(Yn,Be,{selected:li})),Yn});function Tr(Be,wt){var Ct=Be.eventKey,Nt=Ue(),Tt=Ve(Ct);return We.useEffect(function(){if(Nt)return Nt.registerPath(Ct,Tt),function(){Nt.unregisterPath(Ct,Tt)}},[Tt]),Nt?null:We.createElement(_r,(0,me.Z)({},Be,{ref:wt}))}var Hr=We.forwardRef(Tr),sr=["className","children"],Mr=function(wt,Ct){var Nt=wt.className,Tt=wt.children,Ft=(0,Ae.Z)(wt,sr),Ht=We.useContext(nt),gn=Ht.prefixCls,wn=Ht.mode,Ln=Ht.rtl;return We.createElement("ul",(0,me.Z)({className:Ce()(gn,Ln&&"".concat(gn,"-rtl"),"".concat(gn,"-sub"),"".concat(gn,"-").concat(wn==="inline"?"inline":"vertical"),Nt),role:"menu"},Ft,{"data-menu-list":!0,ref:Ct}),Tt)},rr=We.forwardRef(Mr);rr.displayName="SubMenuList";var Or=rr,Fr=ue(11592);function Er(Be,wt){return(0,Fr.Z)(Be).map(function(Ct,Nt){if(We.isValidElement(Ct)){var Tt,Ft,Ht=Ct.key,gn=(Tt=(Ft=Ct.props)===null||Ft===void 0?void 0:Ft.eventKey)!==null&&Tt!==void 0?Tt:Ht,wn=gn==null;wn&&(gn="tmp_key-".concat([].concat((0,ot.Z)(wt),[Nt]).join("-")));var Ln={key:gn,eventKey:gn};return We.cloneElement(Ct,Ln)}return Ct})}var jr=ue(35593),Nr={adjustX:1,adjustY:1},Jn={topLeft:{points:["bl","tl"],overflow:Nr},topRight:{points:["br","tr"],overflow:Nr},bottomLeft:{points:["tl","bl"],overflow:Nr},bottomRight:{points:["tr","br"],overflow:Nr},leftTop:{points:["tr","tl"],overflow:Nr},leftBottom:{points:["br","bl"],overflow:Nr},rightTop:{points:["tl","tr"],overflow:Nr},rightBottom:{points:["bl","br"],overflow:Nr}},lr={topLeft:{points:["bl","tl"],overflow:Nr},topRight:{points:["br","tr"],overflow:Nr},bottomLeft:{points:["tl","bl"],overflow:Nr},bottomRight:{points:["tr","br"],overflow:Nr},rightTop:{points:["tr","tl"],overflow:Nr},rightBottom:{points:["br","bl"],overflow:Nr},leftTop:{points:["tl","tr"],overflow:Nr},leftBottom:{points:["bl","br"],overflow:Nr}},Rn=null;function $n(Be,wt,Ct){if(wt)return wt;if(Ct)return Ct[Be]||Ct.other}var wr={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function lt(Be){var wt=Be.prefixCls,Ct=Be.visible,Nt=Be.children,Tt=Be.popup,Ft=Be.popupStyle,Ht=Be.popupClassName,gn=Be.popupOffset,wn=Be.disabled,Ln=Be.mode,zn=Be.onVisibleChange,er=We.useContext(nt),cr=er.getPopupContainer,Un=er.rtl,In=er.subMenuOpenDelay,fr=er.subMenuCloseDelay,tr=er.builtinPlacements,yr=er.triggerSubMenuAction,Gn=er.forceSubMenuRender,Xn=er.rootClassName,br=er.motion,ur=er.defaultMotions,Br=We.useState(!1),Gr=(0,be.Z)(Br,2),ar=Gr[0],_n=Gr[1],Mn=Un?(0,Ke.Z)((0,Ke.Z)({},lr),tr):(0,Ke.Z)((0,Ke.Z)({},Jn),tr),gr=wr[Ln],nr=$n(Ln,br,ur),kr=We.useRef(nr);Ln!=="inline"&&(kr.current=nr);var Lr=(0,Ke.Z)((0,Ke.Z)({},kr.current),{},{leavedClassName:"".concat(wt,"-hidden"),removeOnLeave:!1,motionAppear:!0}),Ir=We.useRef();return We.useEffect(function(){return Ir.current=(0,nn.Z)(function(){_n(Ct)}),function(){nn.Z.cancel(Ir.current)}},[Ct]),We.createElement(jr.Z,{prefixCls:wt,popupClassName:Ce()("".concat(wt,"-popup"),(0,je.Z)({},"".concat(wt,"-rtl"),Un),Ht,Xn),stretch:Ln==="horizontal"?"minWidth":null,getPopupContainer:cr,builtinPlacements:Mn,popupPlacement:gr,popupVisible:ar,popup:Tt,popupStyle:Ft,popupAlign:gn&&{offset:gn},action:wn?[]:[yr],mouseEnterDelay:In,mouseLeaveDelay:fr,onPopupVisibleChange:zn,forceRender:Gn,popupMotion:Lr,fresh:!0},Nt)}var _e=ue(77900);function Pe(Be){var wt=Be.id,Ct=Be.open,Nt=Be.keyPath,Tt=Be.children,Ft="inline",Ht=We.useContext(nt),gn=Ht.prefixCls,wn=Ht.forceSubMenuRender,Ln=Ht.motion,zn=Ht.defaultMotions,er=Ht.mode,cr=We.useRef(!1);cr.current=er===Ft;var Un=We.useState(!cr.current),In=(0,be.Z)(Un,2),fr=In[0],tr=In[1],yr=cr.current?Ct:!1;We.useEffect(function(){cr.current&&tr(!1)},[er]);var Gn=(0,Ke.Z)({},$n(Ft,Ln,zn));Nt.length>1&&(Gn.motionAppear=!1);var Xn=Gn.onVisibleChanged;return Gn.onVisibleChanged=function(br){return!cr.current&&!br&&tr(!0),Xn==null?void 0:Xn(br)},fr?null:We.createElement(Ze,{mode:Ft,locked:!cr.current},We.createElement(_e.default,(0,me.Z)({visible:yr},Gn,{forceRender:wn,removeOnLeave:!1,leavedClassName:"".concat(gn,"-hidden")}),function(br){var ur=br.className,Br=br.style;return We.createElement(Or,{id:wt,className:ur,style:Br},Tt)}))}var De=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Te=["active"],qe=function(wt){var Ct,Nt=wt.style,Tt=wt.className,Ft=wt.title,Ht=wt.eventKey,gn=wt.warnKey,wn=wt.disabled,Ln=wt.internalPopupClose,zn=wt.children,er=wt.itemIcon,cr=wt.expandIcon,Un=wt.popupClassName,In=wt.popupOffset,fr=wt.popupStyle,tr=wt.onClick,yr=wt.onMouseEnter,Gn=wt.onMouseLeave,Xn=wt.onTitleClick,br=wt.onTitleMouseEnter,ur=wt.onTitleMouseLeave,Br=(0,Ae.Z)(wt,De),Gr=at(Ht),ar=We.useContext(nt),_n=ar.prefixCls,Mn=ar.mode,gr=ar.openKeys,nr=ar.disabled,kr=ar.overflowDisabled,Lr=ar.activeKey,Ir=ar.selectedKeys,pr=ar.itemIcon,Sr=ar.expandIcon,ii=ar.onItemClick,Hn=ar.onOpenChange,qn=ar.onActive,Dr=We.useContext(Bt),$r=Dr._internalRenderSubMenuItem,li=We.useContext(jt),di=li.isSubPathKey,ri=Ve(),Jr="".concat(_n,"-submenu"),yi=nr||wn,bi=We.useRef(),Yn=We.useRef(),Vn=er!=null?er:pr,Zn=cr!=null?cr:Sr,mr=gr.includes(Ht),ni=!kr&&mr,xi=di(Ir,Ht),Mi=en(Ht,yi,br,ur),gi=Mi.active,ci=(0,Ae.Z)(Mi,Te),_i=We.useState(!1),Hi=(0,be.Z)(_i,2),Ni=Hi[0],oa=Hi[1],Xr=function(Zi){yi||oa(Zi)},ei=function(Zi){Xr(!0),yr==null||yr({key:Ht,domEvent:Zi})},Ai=function(Zi){Xr(!1),Gn==null||Gn({key:Ht,domEvent:Zi})},ai=We.useMemo(function(){return gi||(Mn!=="inline"?Ni||di([Lr],Ht):!1)},[Mn,gi,Lr,Ni,Ht,di]),fi=ln(ri.length),ki=function(Zi){yi||(Xn==null||Xn({key:Ht,domEvent:Zi}),Mn==="inline"&&Hn(Ht,!mr))},pi=on(function(Wi){tr==null||tr(En(Wi)),ii(Wi)}),Pr=function(Zi){Mn!=="inline"&&Hn(Ht,Zi)},Yr=function(){qn(Ht)},Ur=Gr&&"".concat(Gr,"-popup"),zr=We.createElement("div",(0,me.Z)({role:"menuitem",style:fi,className:"".concat(Jr,"-title"),tabIndex:yi?null:-1,ref:bi,title:typeof Ft=="string"?Ft:null,"data-menu-id":kr&&Gr?null:Gr,"aria-expanded":ni,"aria-haspopup":!0,"aria-controls":Ur,"aria-disabled":yi,onClick:ki,onFocus:Yr},ci),Ft,We.createElement(Dn,{icon:Mn!=="horizontal"?Zn:void 0,props:(0,Ke.Z)((0,Ke.Z)({},wt),{},{isOpen:ni,isSubMenu:!0})},We.createElement("i",{className:"".concat(Jr,"-arrow")}))),ui=We.useRef(Mn);if(Mn!=="inline"&&ri.length>1?ui.current="vertical":ui.current=Mn,!kr){var oi=ui.current;zr=We.createElement(lt,{mode:oi,prefixCls:Jr,visible:!Ln&&ni&&Mn!=="inline",popupClassName:Un,popupOffset:In,popupStyle:fr,popup:We.createElement(Ze,{mode:oi==="horizontal"?"vertical":oi},We.createElement(Or,{id:Ur,ref:Yn},zn)),disabled:yi,onVisibleChange:Pr},zr)}var zi=We.createElement(Me.Z.Item,(0,me.Z)({role:"none"},Br,{component:"li",style:Nt,className:Ce()(Jr,"".concat(Jr,"-").concat(Mn),Tt,(Ct={},(0,je.Z)(Ct,"".concat(Jr,"-open"),ni),(0,je.Z)(Ct,"".concat(Jr,"-active"),ai),(0,je.Z)(Ct,"".concat(Jr,"-selected"),xi),(0,je.Z)(Ct,"".concat(Jr,"-disabled"),yi),Ct)),onMouseEnter:ei,onMouseLeave:Ai}),zr,!kr&&We.createElement(Pe,{id:Ur,open:ni,keyPath:ri},zn));return $r&&(zi=$r(zi,wt,{selected:xi,active:ai,open:ni,disabled:yi})),We.createElement(Ze,{onItemClick:pi,mode:Mn==="horizontal"?"vertical":Mn,itemIcon:Vn,expandIcon:Zn},zi)};function dt(Be){var wt=Be.eventKey,Ct=Be.children,Nt=Ve(wt),Tt=Er(Ct,Nt),Ft=Ue();We.useEffect(function(){if(Ft)return Ft.registerPath(wt,Nt),function(){Ft.unregisterPath(wt,Nt)}},[Nt]);var Ht;return Ft?Ht=Tt:Ht=We.createElement(qe,Be,Tt),We.createElement(bt.Provider,{value:Nt},Ht)}var Xt=ue(43749),Ot=["className","title","eventKey","children"],Yt=["children"],pn=function(wt){var Ct=wt.className,Nt=wt.title,Tt=wt.eventKey,Ft=wt.children,Ht=(0,Ae.Z)(wt,Ot),gn=We.useContext(nt),wn=gn.prefixCls,Ln="".concat(wn,"-item-group");return We.createElement("li",(0,me.Z)({role:"presentation"},Ht,{onClick:function(er){return er.stopPropagation()},className:Ce()(Ln,Ct)}),We.createElement("div",{role:"presentation",className:"".concat(Ln,"-title"),title:typeof Nt=="string"?Nt:void 0},Nt),We.createElement("ul",{role:"group",className:"".concat(Ln,"-list")},Ft))};function vn(Be){var wt=Be.children,Ct=(0,Ae.Z)(Be,Yt),Nt=Ve(Ct.eventKey),Tt=Er(wt,Nt),Ft=Ue();return Ft?Tt:We.createElement(pn,(0,Ge.Z)(Ct,["warnKey"]),Tt)}function Sn(Be){var wt=Be.className,Ct=Be.style,Nt=We.useContext(nt),Tt=Nt.prefixCls,Ft=Ue();return Ft?null:We.createElement("li",{role:"separator",className:Ce()("".concat(Tt,"-item-divider"),wt),style:Ct})}var At=["label","children","key","type"];function dn(Be){return(Be||[]).map(function(wt,Ct){if(wt&&(0,Xt.Z)(wt)==="object"){var Nt=wt,Tt=Nt.label,Ft=Nt.children,Ht=Nt.key,gn=Nt.type,wn=(0,Ae.Z)(Nt,At),Ln=Ht!=null?Ht:"tmp-".concat(Ct);return Ft||gn==="group"?gn==="group"?We.createElement(vn,(0,me.Z)({key:Ln},wn,{title:Tt}),dn(Ft)):We.createElement(dt,(0,me.Z)({key:Ln},wn,{title:Tt}),dn(Ft)):gn==="divider"?We.createElement(Sn,(0,me.Z)({key:Ln},wn)):We.createElement(Hr,(0,me.Z)({key:Ln},wn),Tt)}return null}).filter(function(wt){return wt})}function rt(Be,wt,Ct){var Nt=Be;return wt&&(Nt=dn(wt)),Er(Nt,Ct)}var Mt=["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"],Lt=[],Pt=We.forwardRef(function(Be,wt){var Ct,Nt,Tt=Be,Ft=Tt.prefixCls,Ht=Ft===void 0?"rc-menu":Ft,gn=Tt.rootClassName,wn=Tt.style,Ln=Tt.className,zn=Tt.tabIndex,er=zn===void 0?0:zn,cr=Tt.items,Un=Tt.children,In=Tt.direction,fr=Tt.id,tr=Tt.mode,yr=tr===void 0?"vertical":tr,Gn=Tt.inlineCollapsed,Xn=Tt.disabled,br=Tt.disabledOverflow,ur=Tt.subMenuOpenDelay,Br=ur===void 0?.1:ur,Gr=Tt.subMenuCloseDelay,ar=Gr===void 0?.1:Gr,_n=Tt.forceSubMenuRender,Mn=Tt.defaultOpenKeys,gr=Tt.openKeys,nr=Tt.activeKey,kr=Tt.defaultActiveFirst,Lr=Tt.selectable,Ir=Lr===void 0?!0:Lr,pr=Tt.multiple,Sr=pr===void 0?!1:pr,ii=Tt.defaultSelectedKeys,Hn=Tt.selectedKeys,qn=Tt.onSelect,Dr=Tt.onDeselect,$r=Tt.inlineIndent,li=$r===void 0?24:$r,di=Tt.motion,ri=Tt.defaultMotions,Jr=Tt.triggerSubMenuAction,yi=Jr===void 0?"hover":Jr,bi=Tt.builtinPlacements,Yn=Tt.itemIcon,Vn=Tt.expandIcon,Zn=Tt.overflowedIndicator,mr=Zn===void 0?"...":Zn,ni=Tt.overflowedIndicatorPopupClassName,xi=Tt.getPopupContainer,Mi=Tt.onClick,gi=Tt.onOpenChange,ci=Tt.onKeyDown,_i=Tt.openAnimation,Hi=Tt.openTransitionName,Ni=Tt._internalRenderMenuItem,oa=Tt._internalRenderSubMenuItem,Xr=(0,Ae.Z)(Tt,Mt),ei=We.useMemo(function(){return rt(Un,cr,Lt)},[Un,cr]),Ai=We.useState(!1),ai=(0,be.Z)(Ai,2),fi=ai[0],ki=ai[1],pi=We.useRef(),Pr=xt(fr),Yr=In==="rtl",Ur=(0,ze.Z)(Mn,{value:gr,postState:function(Bi){return Bi||Lt}}),zr=(0,be.Z)(Ur,2),ui=zr[0],oi=zr[1],zi=function(Bi){var ji=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Ya(){oi(Bi),gi==null||gi(Bi)}ji?(0,yt.flushSync)(Ya):Ya()},Wi=We.useState(ui),Zi=(0,be.Z)(Wi,2),na=Zi[0],wi=Zi[1],vi=We.useRef(!1),Gi=We.useMemo(function(){return(yr==="inline"||yr==="vertical")&&Gn?["vertical",Gn]:[yr,!1]},[yr,Gn]),ca=(0,be.Z)(Gi,2),sa=ca[0],ta=ca[1],ts=sa==="inline",ao=We.useState(sa),oo=(0,be.Z)(ao,2),eo=oo[0],Ss=oo[1],fo=We.useState(ta),Ea=(0,be.Z)(fo,2),fa=Ea[0],bo=Ea[1];We.useEffect(function(){Ss(sa),bo(ta),vi.current&&(ts?oi(na):zi(Lt))},[sa,ta]);var _o=We.useState(0),Eo=(0,be.Z)(_o,2),ns=Eo[0],$o=Eo[1],Xa=ns>=ei.length-1||eo!=="horizontal"||br;We.useEffect(function(){ts&&wi(ui)},[ui]),We.useEffect(function(){return vi.current=!0,function(){vi.current=!1}},[]);var Oa=qt(),Oi=Oa.registerPath,Lo=Oa.unregisterPath,rs=Oa.refreshOverflowKeys,Do=Oa.isSubPathKey,Ei=Oa.getKeyPath,mi=Oa.getKeys,Ki=Oa.getSubPathKeys,La=We.useMemo(function(){return{registerPath:Oi,unregisterPath:Lo}},[Oi,Lo]),Xi=We.useMemo(function(){return{isSubPathKey:Do}},[Do]);We.useEffect(function(){rs(Xa?Lt:ei.slice(ns+1).map(function(Ii){return Ii.key}))},[ns,Xa]);var $a=(0,ze.Z)(nr||kr&&((Ct=ei[0])===null||Ct===void 0?void 0:Ct.key),{value:nr}),Fa=(0,be.Z)($a,2),to=Fa[0],Ra=Fa[1],so=on(function(Ii){Ra(Ii)}),lo=on(function(){Ra(void 0)});(0,We.useImperativeHandle)(wt,function(){return{list:pi.current,focus:function(Bi){var ji,Ya=mi(),Aa=fe(Ya,Pr),xo=Aa.elements,po=Aa.key2element,za=Aa.element2key,Ao=oe(pi.current,xo),To=to!=null?to:Ao[0]?za.get(Ao[0]):(ji=ei.find(function(Wl){return!Wl.props.disabled}))===null||ji===void 0?void 0:ji.key,wo=po.get(To);if(To&&wo){var os;wo==null||(os=wo.focus)===null||os===void 0||os.call(wo,Bi)}}}});var Da=(0,ze.Z)(ii||[],{value:Hn,postState:function(Bi){return Array.isArray(Bi)?Bi:Bi==null?Lt:[Bi]}}),bl=(0,be.Z)(Da,2),jo=bl[0],Js=bl[1],Kl=function(Bi){if(Ir){var ji=Bi.key,Ya=jo.includes(ji),Aa;Sr?Ya?Aa=jo.filter(function(po){return po!==ji}):Aa=[].concat((0,ot.Z)(jo),[ji]):Aa=[ji],Js(Aa);var xo=(0,Ke.Z)((0,Ke.Z)({},Bi),{},{selectedKeys:Aa});Ya?Dr==null||Dr(xo):qn==null||qn(xo)}!Sr&&ui.length&&eo!=="inline"&&zi(Lt)},Hl=on(function(Ii){Mi==null||Mi(En(Ii)),Kl(Ii)}),Cs=on(function(Ii,Bi){var ji=ui.filter(function(Aa){return Aa!==Ii});if(Bi)ji.push(Ii);else if(eo!=="inline"){var Ya=Ki(Ii);ji=ji.filter(function(Aa){return!Ya.has(Aa)})}(0,ut.Z)(ui,ji,!0)||zi(ji,!0)}),kc=function(Bi,ji){var Ya=ji!=null?ji:!ui.includes(Bi);Cs(Bi,Ya)},is=le(eo,to,Yr,Pr,pi,mi,Ei,Ra,kc,ci);We.useEffect(function(){ki(!0)},[]);var xl=We.useMemo(function(){return{_internalRenderMenuItem:Ni,_internalRenderSubMenuItem:oa}},[Ni,oa]),Vo=eo!=="horizontal"||br?ei:ei.map(function(Ii,Bi){return We.createElement(Ze,{key:Ii.key,overflowDisabled:Bi>ns},Ii)}),as=We.createElement(Me.Z,(0,me.Z)({id:fr,ref:pi,prefixCls:"".concat(Ht,"-overflow"),component:"ul",itemComponent:Hr,className:Ce()(Ht,"".concat(Ht,"-root"),"".concat(Ht,"-").concat(eo),Ln,(Nt={},(0,je.Z)(Nt,"".concat(Ht,"-inline-collapsed"),fa),(0,je.Z)(Nt,"".concat(Ht,"-rtl"),Yr),Nt),gn),dir:In,style:wn,role:"menu",tabIndex:er,data:Vo,renderRawItem:function(Bi){return Bi},renderRawRest:function(Bi){var ji=Bi.length,Ya=ji?ei.slice(-ji):null;return We.createElement(dt,{eventKey:Jt,title:mr,disabled:Xa,internalPopupClose:ji===0,popupClassName:ni},Ya)},maxCount:eo!=="horizontal"||br?Me.Z.INVALIDATE:Me.Z.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Bi){$o(Bi)},onKeyDown:is},Xr));return We.createElement(Bt.Provider,{value:xl},We.createElement(et.Provider,{value:Pr},We.createElement(Ze,{prefixCls:Ht,rootClassName:gn,mode:eo,openKeys:ui,rtl:Yr,disabled:Xn,motion:fi?di:null,defaultMotions:fi?ri:null,activeKey:to,onActive:so,onInactive:lo,selectedKeys:jo,inlineIndent:li,subMenuOpenDelay:Br,subMenuCloseDelay:ar,forceSubMenuRender:_n,builtinPlacements:bi,triggerSubMenuAction:yi,getPopupContainer:xi,itemIcon:Yn,expandIcon:Vn,onItemClick:Hl,onOpenChange:Cs},We.createElement(jt.Provider,{value:Xi},as),We.createElement("div",{style:{display:"none"},"aria-hidden":!0},We.createElement(He.Provider,{value:La},ei)))))}),an=Pt,Et=an;Et.Item=Hr,Et.SubMenu=dt,Et.ItemGroup=vn,Et.Divider=Sn;var rn=Et},83836:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Rt}});var me=ue(60499),je=ue(85899),Ke=ue(72190),ot=ue(42244),be=ue(59301),Ae=ue(92310),Ne=ue.n(Ae),Ce=ue(29301),Me=ue(34280),ze=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],ut=void 0;function Le(mt,$e){var xe=mt.prefixCls,ht=mt.invalidate,nn=mt.item,Ut=mt.renderItem,Xe=mt.responsive,Ye=mt.responsiveDisabled,Dt=mt.registerSize,bn=mt.itemKey,tn=mt.className,un=mt.style,Vt=mt.children,Gt=mt.display,Wt=mt.order,ye=mt.component,se=ye===void 0?"div":ye,oe=(0,ot.Z)(mt,ze),de=Xe&&!Gt;function fe($t){Dt(bn,$t)}be.useEffect(function(){return function(){fe(null)}},[]);var le=Ut&&nn!==ut?Ut(nn,{index:Wt}):Vt,Ie;ht||(Ie={opacity:de?0:1,height:de?0:ut,overflowY:de?"hidden":ut,order:Xe?Wt:ut,pointerEvents:de?"none":ut,position:de?"absolute":ut});var it={};de&&(it["aria-hidden"]=!0);var Kt=be.createElement(se,(0,me.Z)({className:Ne()(!ht&&xe,tn),style:(0,je.Z)((0,je.Z)({},Ie),un)},it,oe,{ref:$e}),le);return Xe&&(Kt=be.createElement(Ce.Z,{onResize:function(Jt){var qt=Jt.offsetWidth;fe(qt)},disabled:Ye},Kt)),Kt}var We=be.forwardRef(Le);We.displayName="Item";var yt=We,et=ue(6089),pt=ue(4676),at=ue(16089);function St(mt){if(typeof MessageChannel=="undefined")(0,at.Z)(mt);else{var $e=new MessageChannel;$e.port1.onmessage=function(){return mt()},$e.port2.postMessage(void 0)}}function Qt(){var mt=be.useRef(null),$e=function(ht){mt.current||(mt.current=[],St(function(){(0,pt.unstable_batchedUpdates)(function(){mt.current.forEach(function(nn){nn()}),mt.current=null})})),mt.current.push(ht)};return $e}function nt(mt,$e){var xe=be.useState($e),ht=(0,Ke.Z)(xe,2),nn=ht[0],Ut=ht[1],Xe=(0,et.Z)(function(Ye){mt(function(){Ut(Ye)})});return[nn,Xe]}var ft=be.createContext(null),Ze=["component"],ke=["className"],He=["className"],Ue=function($e,xe){var ht=be.useContext(ft);if(!ht){var nn=$e.component,Ut=nn===void 0?"div":nn,Xe=(0,ot.Z)($e,Ze);return be.createElement(Ut,(0,me.Z)({},Xe,{ref:xe}))}var Ye=ht.className,Dt=(0,ot.Z)(ht,ke),bn=$e.className,tn=(0,ot.Z)($e,He);return be.createElement(ft.Provider,{value:null},be.createElement(yt,(0,me.Z)({ref:xe,className:Ne()(Ye,bn)},Dt,tn)))},bt=be.forwardRef(Ue);bt.displayName="RawItem";var Ve=bt,jt=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","prefix","suffix","component","itemComponent","onVisibleChange"],st="responsive",Bt="invalidate";function Qe(mt){return"+ ".concat(mt.length," ...")}function zt(mt,$e){var xe=mt.prefixCls,ht=xe===void 0?"rc-overflow":xe,nn=mt.data,Ut=nn===void 0?[]:nn,Xe=mt.renderItem,Ye=mt.renderRawItem,Dt=mt.itemKey,bn=mt.itemWidth,tn=bn===void 0?10:bn,un=mt.ssr,Vt=mt.style,Gt=mt.className,Wt=mt.maxCount,ye=mt.renderRest,se=mt.renderRawRest,oe=mt.prefix,de=mt.suffix,fe=mt.component,le=fe===void 0?"div":fe,Ie=mt.itemComponent,it=mt.onVisibleChange,Kt=(0,ot.Z)(mt,jt),$t=un==="full",Jt=Qt(),qt=nt(Jt,null),on=(0,Ke.Z)(qt,2),mn=on[0],Cn=on[1],xt=mn||0,hn=nt(Jt,new Map),On=(0,Ke.Z)(hn,2),tt=On[0],Fe=On[1],Ge=nt(Jt,0),Zt=(0,Ke.Z)(Ge,2),en=Zt[0],ln=Zt[1],Dn=nt(Jt,0),Tn=(0,Ke.Z)(Dn,2),En=Tn[0],Fn=Tn[1],jn=nt(Jt,0),An=(0,Ke.Z)(jn,2),hr=An[0],_r=An[1],Tr=nt(Jt,0),Hr=(0,Ke.Z)(Tr,2),sr=Hr[0],Mr=Hr[1],rr=(0,be.useState)(null),Or=(0,Ke.Z)(rr,2),Fr=Or[0],Er=Or[1],jr=(0,be.useState)(null),Nr=(0,Ke.Z)(jr,2),Jn=Nr[0],lr=Nr[1],Rn=be.useMemo(function(){return Jn===null&&$t?Number.MAX_SAFE_INTEGER:Jn||0},[Jn,mn]),$n=(0,be.useState)(!1),wr=(0,Ke.Z)($n,2),lt=wr[0],_e=wr[1],Pe="".concat(ht,"-item"),De=Math.max(en,En),Te=Wt===st,qe=Ut.length&&Te,dt=Wt===Bt,Xt=qe||typeof Wt=="number"&&Ut.length>Wt,Ot=(0,be.useMemo)(function(){var Ft=Ut;return qe?mn===null&&$t?Ft=Ut:Ft=Ut.slice(0,Math.min(Ut.length,xt/tn)):typeof Wt=="number"&&(Ft=Ut.slice(0,Wt)),Ft},[Ut,tn,mn,Wt,qe]),Yt=(0,be.useMemo)(function(){return qe?Ut.slice(Rn+1):Ut.slice(Ot.length)},[Ut,Ot,qe,Rn]),pn=(0,be.useCallback)(function(Ft,Ht){var gn;return typeof Dt=="function"?Dt(Ft):(gn=Dt&&(Ft==null?void 0:Ft[Dt]))!==null&&gn!==void 0?gn:Ht},[Dt]),vn=(0,be.useCallback)(Xe||function(Ft){return Ft},[Xe]);function Sn(Ft,Ht,gn){Jn===Ft&&(Ht===void 0||Ht===Fr)||(lr(Ft),gn||(_e(Ft<Ut.length-1),it==null||it(Ft)),Ht!==void 0&&Er(Ht))}function At(Ft,Ht){Cn(Ht.clientWidth)}function dn(Ft,Ht){Fe(function(gn){var wn=new Map(gn);return Ht===null?wn.delete(Ft):wn.set(Ft,Ht),wn})}function rt(Ft,Ht){Fn(Ht),ln(En)}function Mt(Ft,Ht){_r(Ht)}function Lt(Ft,Ht){Mr(Ht)}function Pt(Ft){return tt.get(pn(Ot[Ft],Ft))}(0,Me.Z)(function(){if(xt&&typeof De=="number"&&Ot){var Ft=hr+sr,Ht=Ot.length,gn=Ht-1;if(!Ht){Sn(0,null);return}for(var wn=0;wn<Ht;wn+=1){var Ln=Pt(wn);if($t&&(Ln=Ln||0),Ln===void 0){Sn(wn-1,void 0,!0);break}if(Ft+=Ln,gn===0&&Ft<=xt||wn===gn-1&&Ft+Pt(gn)<=xt){Sn(gn,null);break}else if(Ft+De>xt){Sn(wn-1,Ft-Ln-sr+En);break}}de&&Pt(0)+sr>xt&&Er(null)}},[xt,tt,En,hr,sr,pn,Ot]);var an=lt&&!!Yt.length,Et={};Fr!==null&&qe&&(Et={position:"absolute",left:Fr,top:0});var rn={prefixCls:Pe,responsive:qe,component:Ie,invalidate:dt},Be=Ye?function(Ft,Ht){var gn=pn(Ft,Ht);return be.createElement(ft.Provider,{key:gn,value:(0,je.Z)((0,je.Z)({},rn),{},{order:Ht,item:Ft,itemKey:gn,registerSize:dn,display:Ht<=Rn})},Ye(Ft,Ht))}:function(Ft,Ht){var gn=pn(Ft,Ht);return be.createElement(yt,(0,me.Z)({},rn,{order:Ht,key:gn,item:Ft,renderItem:vn,itemKey:gn,registerSize:dn,display:Ht<=Rn}))},wt={order:an?Rn:Number.MAX_SAFE_INTEGER,className:"".concat(Pe,"-rest"),registerSize:rt,display:an},Ct=ye||Qe,Nt=se?be.createElement(ft.Provider,{value:(0,je.Z)((0,je.Z)({},rn),wt)},se(Yt)):be.createElement(yt,(0,me.Z)({},rn,wt),typeof Ct=="function"?Ct(Yt):Ct),Tt=be.createElement(le,(0,me.Z)({className:Ne()(!dt&&ht,Gt),style:Vt,ref:$e},Kt),oe&&be.createElement(yt,(0,me.Z)({},rn,{responsive:Te,responsiveDisabled:!qe,order:-1,className:"".concat(Pe,"-prefix"),registerSize:Mt,display:!0}),oe),Ot.map(Be),Xt?Nt:null,de&&be.createElement(yt,(0,me.Z)({},rn,{responsive:Te,responsiveDisabled:!qe,order:Rn,className:"".concat(Pe,"-suffix"),registerSize:Lt,display:!0,style:Et}),de));return Te?be.createElement(Ce.Z,{onResize:At,disabled:!qe},Tt):Tt}var ct=be.forwardRef(zt);ct.displayName="Overflow",ct.Item=Ve,ct.RESPONSIVE=st,ct.INVALIDATE=Bt;var It=ct,Rt=It},17115:function(kn,cn,ue){"use strict";ue.d(cn,{ZP:function(){return Ne}});var me=ue(72190),je=ue(59301),Ke=ue(47273),ot=0,be=(0,Ke.Z)();function Ae(){var Ce;return be?(Ce=ot,ot+=1):Ce="TEST_OR_SSR",Ce}function Ne(Ce){var Me=je.useState(),ze=(0,me.Z)(Me,2),ut=ze[0],Le=ze[1];return je.useEffect(function(){Le("rc_select_".concat(Ae()))},[]),Ce||ut}},77861:function(kn,cn,ue){"use strict";ue.d(cn,{Ac:function(){return mn},Xo:function(){return En},Wx:function(){return jn},ZP:function(){return Pe},lk:function(){return ft}});var me=ue(60499),je=ue(77654),Ke=ue(18642),ot=ue(85899),be=ue(72190),Ae=ue(42244),Ne=ue(43749),Ce=ue(18929),Me=ue(48736),ze=ue(59301),ut=ue(92310),Le=ue.n(ut),We=ue(34280),yt=ue(49658),et=ue(10228),pt=ue(8654),at=function(Te){var qe=Te.className,dt=Te.customizeIcon,Xt=Te.customizeIconProps,Ot=Te.onMouseDown,Yt=Te.onClick,pn=Te.children,vn;return typeof dt=="function"?vn=dt(Xt):vn=dt,ze.createElement("span",{className:qe,onMouseDown:function(At){At.preventDefault(),Ot&&Ot(At)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:Yt,"aria-hidden":!0},vn!==void 0?vn:ze.createElement("span",{className:Le()(qe.split(/\s+/).map(function(Sn){return"".concat(Sn,"-icon")}))},pn))},St=at;function Qt(De,Te,qe,dt,Xt){var Ot=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,Yt=arguments.length>6?arguments[6]:void 0,pn=arguments.length>7?arguments[7]:void 0,vn=ze.useMemo(function(){if((0,Ne.Z)(dt)==="object")return dt.clearIcon;if(Xt)return Xt},[dt,Xt]),Sn=ze.useMemo(function(){return!!(!Ot&&dt&&(qe.length||Yt)&&!(pn==="combobox"&&Yt===""))},[dt,Ot,qe.length,Yt,pn]);return{allowClear:Sn,clearIcon:ze.createElement(St,{className:"".concat(De,"-clear"),onMouseDown:Te,customizeIcon:vn},"\xD7")}}var nt=ze.createContext(null);function ft(){return ze.useContext(nt)}function Ze(){var De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,Te=ze.useState(!1),qe=(0,be.Z)(Te,2),dt=qe[0],Xt=qe[1],Ot=ze.useRef(null),Yt=function(){window.clearTimeout(Ot.current)};ze.useEffect(function(){return Yt},[]);var pn=function(Sn,At){Yt(),Ot.current=window.setTimeout(function(){Xt(Sn),At&&At()},De)};return[dt,pn,Yt]}function ke(){var De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,Te=ze.useRef(null),qe=ze.useRef(null);ze.useEffect(function(){return function(){window.clearTimeout(qe.current)}},[]);function dt(Xt){(Xt||Te.current===null)&&(Te.current=Xt),window.clearTimeout(qe.current),qe.current=window.setTimeout(function(){Te.current=null},De)}return[function(){return Te.current},dt]}function He(De,Te,qe,dt){var Xt=ze.useRef(null);Xt.current={open:Te,triggerOpen:qe,customizedTrigger:dt},ze.useEffect(function(){function Ot(Yt){var pn;if(!((pn=Xt.current)!==null&&pn!==void 0&&pn.customizedTrigger)){var vn=Yt.target;vn.shadowRoot&&Yt.composed&&(vn=Yt.composedPath()[0]||vn),Xt.current.open&&De().filter(function(Sn){return Sn}).every(function(Sn){return!Sn.contains(vn)&&Sn!==vn})&&Xt.current.triggerOpen(!1)}}return window.addEventListener("mousedown",Ot),function(){return window.removeEventListener("mousedown",Ot)}},[])}var Ue=ue(26112),bt=ue(83836),Ve=function(Te,qe){var dt,Xt,Ot=Te.prefixCls,Yt=Te.id,pn=Te.inputElement,vn=Te.disabled,Sn=Te.tabIndex,At=Te.autoFocus,dn=Te.autoComplete,rt=Te.editable,Mt=Te.activeDescendantId,Lt=Te.value,Pt=Te.maxLength,an=Te.onKeyDown,Et=Te.onMouseDown,rn=Te.onChange,Be=Te.onPaste,wt=Te.onCompositionStart,Ct=Te.onCompositionEnd,Nt=Te.open,Tt=Te.attrs,Ft=pn||ze.createElement("input",null),Ht=Ft,gn=Ht.ref,wn=Ht.props,Ln=wn.onKeyDown,zn=wn.onChange,er=wn.onMouseDown,cr=wn.onCompositionStart,Un=wn.onCompositionEnd,In=wn.style;return(0,Me.Kp)(!("maxLength"in Ft.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),Ft=ze.cloneElement(Ft,(0,ot.Z)((0,ot.Z)((0,ot.Z)({type:"search"},wn),{},{id:Yt,ref:(0,pt.sQ)(qe,gn),disabled:vn,tabIndex:Sn,autoComplete:dn||"off",autoFocus:At,className:Le()("".concat(Ot,"-selection-search-input"),(dt=Ft)===null||dt===void 0||(Xt=dt.props)===null||Xt===void 0?void 0:Xt.className),role:"combobox","aria-label":"Search","aria-expanded":Nt||!1,"aria-haspopup":"listbox","aria-owns":"".concat(Yt,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(Yt,"_list"),"aria-activedescendant":Nt?Mt:void 0},Tt),{},{value:rt?Lt:"",maxLength:Pt,readOnly:!rt,unselectable:rt?null:"on",style:(0,ot.Z)((0,ot.Z)({},In),{},{opacity:rt?null:0}),onKeyDown:function(tr){an(tr),Ln&&Ln(tr)},onMouseDown:function(tr){Et(tr),er&&er(tr)},onChange:function(tr){rn(tr),zn&&zn(tr)},onCompositionStart:function(tr){wt(tr),cr&&cr(tr)},onCompositionEnd:function(tr){Ct(tr),Un&&Un(tr)},onPaste:Be})),Ft},jt=ze.forwardRef(Ve);jt.displayName="Input";var st=jt;function Bt(De){return Array.isArray(De)?De:De!==void 0?[De]:[]}var Qe=typeof window!="undefined"&&window.document&&window.document.documentElement,zt=Qe;function ct(De){return De!=null}function It(De){return!De&&De!==0}function Rt(De){return["string","number"].includes((0,Ne.Z)(De))}function mt(De){var Te=void 0;return De&&(Rt(De.title)?Te=De.title.toString():Rt(De.label)&&(Te=De.label.toString())),Te}function $e(De,Te){zt?ze.useLayoutEffect(De,Te):ze.useEffect(De,Te)}function xe(De){var Te;return(Te=De.key)!==null&&Te!==void 0?Te:De.value}var ht=function(Te){Te.preventDefault(),Te.stopPropagation()},nn=function(Te){var qe=Te.id,dt=Te.prefixCls,Xt=Te.values,Ot=Te.open,Yt=Te.searchValue,pn=Te.autoClearSearchValue,vn=Te.inputRef,Sn=Te.placeholder,At=Te.disabled,dn=Te.mode,rt=Te.showSearch,Mt=Te.autoFocus,Lt=Te.autoComplete,Pt=Te.activeDescendantId,an=Te.tabIndex,Et=Te.removeIcon,rn=Te.maxTagCount,Be=Te.maxTagTextLength,wt=Te.maxTagPlaceholder,Ct=wt===void 0?function(Lr){return"+ ".concat(Lr.length," ...")}:wt,Nt=Te.tagRender,Tt=Te.onToggleOpen,Ft=Te.onRemove,Ht=Te.onInputChange,gn=Te.onInputPaste,wn=Te.onInputKeyDown,Ln=Te.onInputMouseDown,zn=Te.onInputCompositionStart,er=Te.onInputCompositionEnd,cr=ze.useRef(null),Un=(0,ze.useState)(0),In=(0,be.Z)(Un,2),fr=In[0],tr=In[1],yr=(0,ze.useState)(!1),Gn=(0,be.Z)(yr,2),Xn=Gn[0],br=Gn[1],ur="".concat(dt,"-selection"),Br=Ot||dn==="multiple"&&pn===!1||dn==="tags"?Yt:"",Gr=dn==="tags"||dn==="multiple"&&pn===!1||rt&&(Ot||Xn);$e(function(){tr(cr.current.scrollWidth)},[Br]);function ar(Lr,Ir,pr,Sr,ii){return ze.createElement("span",{className:Le()("".concat(ur,"-item"),(0,Ke.Z)({},"".concat(ur,"-item-disabled"),pr)),title:mt(Lr)},ze.createElement("span",{className:"".concat(ur,"-item-content")},Ir),Sr&&ze.createElement(St,{className:"".concat(ur,"-item-remove"),onMouseDown:ht,onClick:ii,customizeIcon:Et},"\xD7"))}function _n(Lr,Ir,pr,Sr,ii){var Hn=function(Dr){ht(Dr),Tt(!Ot)};return ze.createElement("span",{onMouseDown:Hn},Nt({label:Ir,value:Lr,disabled:pr,closable:Sr,onClose:ii}))}function Mn(Lr){var Ir=Lr.disabled,pr=Lr.label,Sr=Lr.value,ii=!At&&!Ir,Hn=pr;if(typeof Be=="number"&&(typeof pr=="string"||typeof pr=="number")){var qn=String(Hn);qn.length>Be&&(Hn="".concat(qn.slice(0,Be),"..."))}var Dr=function(li){li&&li.stopPropagation(),Ft(Lr)};return typeof Nt=="function"?_n(Sr,Hn,Ir,ii,Dr):ar(Lr,Hn,Ir,ii,Dr)}function gr(Lr){var Ir=typeof Ct=="function"?Ct(Lr):Ct;return ar({title:Ir},Ir,!1)}var nr=ze.createElement("div",{className:"".concat(ur,"-search"),style:{width:fr},onFocus:function(){br(!0)},onBlur:function(){br(!1)}},ze.createElement(st,{ref:vn,open:Ot,prefixCls:dt,id:qe,inputElement:null,disabled:At,autoFocus:Mt,autoComplete:Lt,editable:Gr,activeDescendantId:Pt,value:Br,onKeyDown:wn,onMouseDown:Ln,onChange:Ht,onPaste:gn,onCompositionStart:zn,onCompositionEnd:er,tabIndex:an,attrs:(0,Ue.Z)(Te,!0)}),ze.createElement("span",{ref:cr,className:"".concat(ur,"-search-mirror"),"aria-hidden":!0},Br,"\xA0")),kr=ze.createElement(bt.Z,{prefixCls:"".concat(ur,"-overflow"),data:Xt,renderItem:Mn,renderRest:gr,suffix:nr,itemKey:xe,maxCount:rn});return ze.createElement(ze.Fragment,null,kr,!Xt.length&&!Br&&ze.createElement("span",{className:"".concat(ur,"-placeholder")},Sn))},Ut=nn,Xe=function(Te){var qe=Te.inputElement,dt=Te.prefixCls,Xt=Te.id,Ot=Te.inputRef,Yt=Te.disabled,pn=Te.autoFocus,vn=Te.autoComplete,Sn=Te.activeDescendantId,At=Te.mode,dn=Te.open,rt=Te.values,Mt=Te.placeholder,Lt=Te.tabIndex,Pt=Te.showSearch,an=Te.searchValue,Et=Te.activeValue,rn=Te.maxLength,Be=Te.onInputKeyDown,wt=Te.onInputMouseDown,Ct=Te.onInputChange,Nt=Te.onInputPaste,Tt=Te.onInputCompositionStart,Ft=Te.onInputCompositionEnd,Ht=Te.title,gn=ze.useState(!1),wn=(0,be.Z)(gn,2),Ln=wn[0],zn=wn[1],er=At==="combobox",cr=er||Pt,Un=rt[0],In=an||"";er&&Et&&!Ln&&(In=Et),ze.useEffect(function(){er&&zn(!1)},[er,Et]);var fr=At!=="combobox"&&!dn&&!Pt?!1:!!In,tr=Ht===void 0?mt(Un):Ht,yr=function(){if(Un)return null;var Xn=fr?{visibility:"hidden"}:void 0;return ze.createElement("span",{className:"".concat(dt,"-selection-placeholder"),style:Xn},Mt)};return ze.createElement(ze.Fragment,null,ze.createElement("span",{className:"".concat(dt,"-selection-search")},ze.createElement(st,{ref:Ot,prefixCls:dt,id:Xt,open:dn,inputElement:qe,disabled:Yt,autoFocus:pn,autoComplete:vn,editable:cr,activeDescendantId:Sn,value:In,onKeyDown:Be,onMouseDown:wt,onChange:function(Xn){zn(!0),Ct(Xn)},onPaste:Nt,onCompositionStart:Tt,onCompositionEnd:Ft,tabIndex:Lt,attrs:(0,Ue.Z)(Te,!0),maxLength:er?rn:void 0})),!er&&Un?ze.createElement("span",{className:"".concat(dt,"-selection-item"),title:tr,style:fr?{visibility:"hidden"}:void 0},Un.label):null,yr())},Ye=Xe;function Dt(De){return![et.Z.ESC,et.Z.SHIFT,et.Z.BACKSPACE,et.Z.TAB,et.Z.WIN_KEY,et.Z.ALT,et.Z.META,et.Z.WIN_KEY_RIGHT,et.Z.CTRL,et.Z.SEMICOLON,et.Z.EQUALS,et.Z.CAPS_LOCK,et.Z.CONTEXT_MENU,et.Z.F1,et.Z.F2,et.Z.F3,et.Z.F4,et.Z.F5,et.Z.F6,et.Z.F7,et.Z.F8,et.Z.F9,et.Z.F10,et.Z.F11,et.Z.F12].includes(De)}var bn=function(Te,qe){var dt=(0,ze.useRef)(null),Xt=(0,ze.useRef)(!1),Ot=Te.prefixCls,Yt=Te.open,pn=Te.mode,vn=Te.showSearch,Sn=Te.tokenWithEnter,At=Te.autoClearSearchValue,dn=Te.onSearch,rt=Te.onSearchSubmit,Mt=Te.onToggleOpen,Lt=Te.onInputKeyDown,Pt=Te.domRef;ze.useImperativeHandle(qe,function(){return{focus:function(){dt.current.focus()},blur:function(){dt.current.blur()}}});var an=ke(0),Et=(0,be.Z)(an,2),rn=Et[0],Be=Et[1],wt=function(In){var fr=In.which;(fr===et.Z.UP||fr===et.Z.DOWN)&&In.preventDefault(),Lt&&Lt(In),fr===et.Z.ENTER&&pn==="tags"&&!Xt.current&&!Yt&&(rt==null||rt(In.target.value)),Dt(fr)&&Mt(!0)},Ct=function(){Be(!0)},Nt=(0,ze.useRef)(null),Tt=function(In){dn(In,!0,Xt.current)!==!1&&Mt(!0)},Ft=function(){Xt.current=!0},Ht=function(In){Xt.current=!1,pn!=="combobox"&&Tt(In.target.value)},gn=function(In){var fr=In.target.value;if(Sn&&Nt.current&&/[\r\n]/.test(Nt.current)){var tr=Nt.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");fr=fr.replace(tr,Nt.current)}Nt.current=null,Tt(fr)},wn=function(In){var fr=In.clipboardData,tr=fr.getData("text");Nt.current=tr},Ln=function(In){var fr=In.target;if(fr!==dt.current){var tr=document.body.style.msTouchAction!==void 0;tr?setTimeout(function(){dt.current.focus()}):dt.current.focus()}},zn=function(In){var fr=rn();In.target!==dt.current&&!fr&&pn!=="combobox"&&In.preventDefault(),(pn!=="combobox"&&(!vn||!fr)||!Yt)&&(Yt&&At!==!1&&dn("",!0,!1),Mt())},er={inputRef:dt,onInputKeyDown:wt,onInputMouseDown:Ct,onInputChange:gn,onInputPaste:wn,onInputCompositionStart:Ft,onInputCompositionEnd:Ht},cr=pn==="multiple"||pn==="tags"?ze.createElement(Ut,(0,me.Z)({},Te,er)):ze.createElement(Ye,(0,me.Z)({},Te,er));return ze.createElement("div",{ref:Pt,className:"".concat(Ot,"-selector"),onClick:Ln,onMouseDown:zn},cr)},tn=ze.forwardRef(bn);tn.displayName="Selector";var un=tn,Vt=ue(35593),Gt=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],Wt=function(Te){var qe=Te===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:qe,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:qe,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:qe,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:qe,adjustY:1},htmlRegion:"scroll"}}},ye=function(Te,qe){var dt=Te.prefixCls,Xt=Te.disabled,Ot=Te.visible,Yt=Te.children,pn=Te.popupElement,vn=Te.animation,Sn=Te.transitionName,At=Te.dropdownStyle,dn=Te.dropdownClassName,rt=Te.direction,Mt=rt===void 0?"ltr":rt,Lt=Te.placement,Pt=Te.builtinPlacements,an=Te.dropdownMatchSelectWidth,Et=Te.dropdownRender,rn=Te.dropdownAlign,Be=Te.getPopupContainer,wt=Te.empty,Ct=Te.getTriggerDOMNode,Nt=Te.onPopupVisibleChange,Tt=Te.onPopupMouseEnter,Ft=(0,Ae.Z)(Te,Gt),Ht="".concat(dt,"-dropdown"),gn=pn;Et&&(gn=Et(pn));var wn=ze.useMemo(function(){return Pt||Wt(an)},[Pt,an]),Ln=vn?"".concat(Ht,"-").concat(vn):Sn,zn=typeof an=="number",er=ze.useMemo(function(){return zn?null:an===!1?"minWidth":"width"},[an,zn]),cr=At;zn&&(cr=(0,ot.Z)((0,ot.Z)({},cr),{},{width:an}));var Un=ze.useRef(null);return ze.useImperativeHandle(qe,function(){return{getPopupElement:function(){return Un.current}}}),ze.createElement(Vt.Z,(0,me.Z)({},Ft,{showAction:Nt?["click"]:[],hideAction:Nt?["click"]:[],popupPlacement:Lt||(Mt==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:wn,prefixCls:Ht,popupTransitionName:Ln,popup:ze.createElement("div",{ref:Un,onMouseEnter:Tt},gn),stretch:er,popupAlign:rn,popupVisible:Ot,getPopupContainer:Be,popupClassName:Le()(dn,(0,Ke.Z)({},"".concat(Ht,"-empty"),wt)),popupStyle:cr,getTriggerDOMNode:Ct,onPopupVisibleChange:Nt}),Yt)},se=ze.forwardRef(ye);se.displayName="SelectTrigger";var oe=se,de=ue(48745);function fe(De,Te){var qe=De.key,dt;return"value"in De&&(dt=De.value),qe!=null?qe:dt!==void 0?dt:"rc-index-key-".concat(Te)}function le(De,Te){var qe=De||{},dt=qe.label,Xt=qe.value,Ot=qe.options,Yt=qe.groupLabel,pn=dt||(Te?"children":"label");return{label:pn,value:Xt||"value",options:Ot||"options",groupLabel:Yt||pn}}function Ie(De){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},qe=Te.fieldNames,dt=Te.childrenAsData,Xt=[],Ot=le(qe,!1),Yt=Ot.label,pn=Ot.value,vn=Ot.options,Sn=Ot.groupLabel;function At(dn,rt){dn.forEach(function(Mt){if(rt||!(vn in Mt)){var Lt=Mt[pn];Xt.push({key:fe(Mt,Xt.length),groupOption:rt,data:Mt,label:Mt[Yt],value:Lt})}else{var Pt=Mt[Sn];Pt===void 0&&dt&&(Pt=Mt.label),Xt.push({key:fe(Mt,Xt.length),group:!0,data:Mt,label:Pt}),At(Mt[vn],!0)}})}return At(De,!1),Xt}function it(De){var Te=(0,ot.Z)({},De);return"props"in Te||Object.defineProperty(Te,"props",{get:function(){return(0,Me.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),Te}}),Te}function Kt(De,Te){if(!Te||!Te.length)return null;var qe=!1;function dt(Ot,Yt){var pn=(0,de.Z)(Yt),vn=pn[0],Sn=pn.slice(1);if(!vn)return[Ot];var At=Ot.split(vn);return qe=qe||At.length>1,At.reduce(function(dn,rt){return[].concat((0,je.Z)(dn),(0,je.Z)(dt(rt,Sn)))},[]).filter(function(dn){return dn})}var Xt=dt(De,Te);return qe?Xt:null}var $t=["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"],Jt=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function qt(De){return De==="tags"||De==="multiple"}var on=ze.forwardRef(function(De,Te){var qe,dt,Xt=De.id,Ot=De.prefixCls,Yt=De.className,pn=De.showSearch,vn=De.tagRender,Sn=De.direction,At=De.omitDomProps,dn=De.displayValues,rt=De.onDisplayValuesChange,Mt=De.emptyOptions,Lt=De.notFoundContent,Pt=Lt===void 0?"Not Found":Lt,an=De.onClear,Et=De.mode,rn=De.disabled,Be=De.loading,wt=De.getInputElement,Ct=De.getRawInputElement,Nt=De.open,Tt=De.defaultOpen,Ft=De.onDropdownVisibleChange,Ht=De.activeValue,gn=De.onActiveValueChange,wn=De.activeDescendantId,Ln=De.searchValue,zn=De.autoClearSearchValue,er=De.onSearch,cr=De.onSearchSplit,Un=De.tokenSeparators,In=De.allowClear,fr=De.suffixIcon,tr=De.clearIcon,yr=De.OptionList,Gn=De.animation,Xn=De.transitionName,br=De.dropdownStyle,ur=De.dropdownClassName,Br=De.dropdownMatchSelectWidth,Gr=De.dropdownRender,ar=De.dropdownAlign,_n=De.placement,Mn=De.builtinPlacements,gr=De.getPopupContainer,nr=De.showAction,kr=nr===void 0?[]:nr,Lr=De.onFocus,Ir=De.onBlur,pr=De.onKeyUp,Sr=De.onKeyDown,ii=De.onMouseDown,Hn=(0,Ae.Z)(De,$t),qn=qt(Et),Dr=(pn!==void 0?pn:qn)||Et==="combobox",$r=(0,ot.Z)({},Hn);Jt.forEach(function(Ei){delete $r[Ei]}),At==null||At.forEach(function(Ei){delete $r[Ei]});var li=ze.useState(!1),di=(0,be.Z)(li,2),ri=di[0],Jr=di[1];ze.useEffect(function(){Jr((0,yt.Z)())},[]);var yi=ze.useRef(null),bi=ze.useRef(null),Yn=ze.useRef(null),Vn=ze.useRef(null),Zn=ze.useRef(null),mr=Ze(),ni=(0,be.Z)(mr,3),xi=ni[0],Mi=ni[1],gi=ni[2];ze.useImperativeHandle(Te,function(){var Ei,mi;return{focus:(Ei=Vn.current)===null||Ei===void 0?void 0:Ei.focus,blur:(mi=Vn.current)===null||mi===void 0?void 0:mi.blur,scrollTo:function(La){var Xi;return(Xi=Zn.current)===null||Xi===void 0?void 0:Xi.scrollTo(La)}}});var ci=ze.useMemo(function(){var Ei;if(Et!=="combobox")return Ln;var mi=(Ei=dn[0])===null||Ei===void 0?void 0:Ei.value;return typeof mi=="string"||typeof mi=="number"?String(mi):""},[Ln,Et,dn]),_i=Et==="combobox"&&typeof wt=="function"&&wt()||null,Hi=typeof Ct=="function"&&Ct(),Ni=(0,pt.x1)(bi,Hi==null||(qe=Hi.props)===null||qe===void 0?void 0:qe.ref),oa=ze.useState(!1),Xr=(0,be.Z)(oa,2),ei=Xr[0],Ai=Xr[1];(0,We.Z)(function(){Ai(!0)},[]);var ai=(0,Ce.Z)(!1,{defaultValue:Tt,value:Nt}),fi=(0,be.Z)(ai,2),ki=fi[0],pi=fi[1],Pr=ei?ki:!1,Yr=!Pt&&Mt;(rn||Yr&&Pr&&Et==="combobox")&&(Pr=!1);var Ur=Yr?!1:Pr,zr=ze.useCallback(function(Ei){var mi=Ei!==void 0?Ei:!Pr;rn||(pi(mi),Pr!==mi&&(Ft==null||Ft(mi)))},[rn,Pr,pi,Ft]),ui=ze.useMemo(function(){return(Un||[]).some(function(Ei){return[`
|
|
|
`,`\r
|
|
|
`].includes(Ei)})},[Un]),oi=function(mi,Ki,La){var Xi=!0,$a=mi;gn==null||gn(null);var Fa=La?null:Kt(mi,Un);return Et!=="combobox"&&Fa&&($a="",cr==null||cr(Fa),zr(!1),Xi=!1),er&&ci!==$a&&er($a,{source:Ki?"typing":"effect"}),Xi},zi=function(mi){!mi||!mi.trim()||er(mi,{source:"submit"})};ze.useEffect(function(){!Pr&&!qn&&Et!=="combobox"&&oi("",!1,!1)},[Pr]),ze.useEffect(function(){ki&&rn&&pi(!1),rn&&Mi(!1)},[rn]);var Wi=ke(),Zi=(0,be.Z)(Wi,2),na=Zi[0],wi=Zi[1],vi=function(mi){var Ki=na(),La=mi.which;if(La===et.Z.ENTER&&(Et!=="combobox"&&mi.preventDefault(),Pr||zr(!0)),wi(!!ci),La===et.Z.BACKSPACE&&!Ki&&qn&&!ci&&dn.length){for(var Xi=(0,je.Z)(dn),$a=null,Fa=Xi.length-1;Fa>=0;Fa-=1){var to=Xi[Fa];if(!to.disabled){Xi.splice(Fa,1),$a=to;break}}$a&&rt(Xi,{type:"remove",values:[$a]})}for(var Ra=arguments.length,so=new Array(Ra>1?Ra-1:0),lo=1;lo<Ra;lo++)so[lo-1]=arguments[lo];if(Pr&&Zn.current){var Da;(Da=Zn.current).onKeyDown.apply(Da,[mi].concat(so))}Sr==null||Sr.apply(void 0,[mi].concat(so))},Gi=function(mi){for(var Ki=arguments.length,La=new Array(Ki>1?Ki-1:0),Xi=1;Xi<Ki;Xi++)La[Xi-1]=arguments[Xi];if(Pr&&Zn.current){var $a;($a=Zn.current).onKeyUp.apply($a,[mi].concat(La))}pr==null||pr.apply(void 0,[mi].concat(La))},ca=function(mi){var Ki=dn.filter(function(La){return La!==mi});rt(Ki,{type:"remove",values:[mi]})},sa=ze.useRef(!1),ta=function(){Mi(!0),rn||(Lr&&!sa.current&&Lr.apply(void 0,arguments),kr.includes("focus")&&zr(!0)),sa.current=!0},ts=function(){Mi(!1,function(){sa.current=!1,zr(!1)}),!rn&&(ci&&(Et==="tags"?er(ci,{source:"submit"}):Et==="multiple"&&er("",{source:"blur"})),Ir&&Ir.apply(void 0,arguments))},ao=[];ze.useEffect(function(){return function(){ao.forEach(function(Ei){return clearTimeout(Ei)}),ao.splice(0,ao.length)}},[]);var oo=function(mi){var Ki,La=mi.target,Xi=(Ki=Yn.current)===null||Ki===void 0?void 0:Ki.getPopupElement();if(Xi&&Xi.contains(La)){var $a=setTimeout(function(){var so=ao.indexOf($a);if(so!==-1&&ao.splice(so,1),gi(),!ri&&!Xi.contains(document.activeElement)){var lo;(lo=Vn.current)===null||lo===void 0||lo.focus()}});ao.push($a)}for(var Fa=arguments.length,to=new Array(Fa>1?Fa-1:0),Ra=1;Ra<Fa;Ra++)to[Ra-1]=arguments[Ra];ii==null||ii.apply(void 0,[mi].concat(to))},eo=ze.useState({}),Ss=(0,be.Z)(eo,2),fo=Ss[1];function Ea(){fo({})}var fa;Hi&&(fa=function(mi){zr(mi)}),He(function(){var Ei;return[yi.current,(Ei=Yn.current)===null||Ei===void 0?void 0:Ei.getPopupElement()]},Ur,zr,!!Hi);var bo=ze.useMemo(function(){return(0,ot.Z)((0,ot.Z)({},De),{},{notFoundContent:Pt,open:Pr,triggerOpen:Ur,id:Xt,showSearch:Dr,multiple:qn,toggleOpen:zr})},[De,Pt,Ur,Pr,Xt,Dr,qn,zr]),_o=!!fr||Be,Eo;_o&&(Eo=ze.createElement(St,{className:Le()("".concat(Ot,"-arrow"),(0,Ke.Z)({},"".concat(Ot,"-arrow-loading"),Be)),customizeIcon:fr,customizeIconProps:{loading:Be,searchValue:ci,open:Pr,focused:xi,showSearch:Dr}}));var ns=function(){var mi;an==null||an(),(mi=Vn.current)===null||mi===void 0||mi.focus(),rt([],{type:"clear",values:dn}),oi("",!1,!1)},$o=Qt(Ot,ns,dn,In,tr,rn,ci,Et),Xa=$o.allowClear,Oa=$o.clearIcon,Oi=ze.createElement(yr,{ref:Zn}),Lo=Le()(Ot,Yt,(dt={},(0,Ke.Z)(dt,"".concat(Ot,"-focused"),xi),(0,Ke.Z)(dt,"".concat(Ot,"-multiple"),qn),(0,Ke.Z)(dt,"".concat(Ot,"-single"),!qn),(0,Ke.Z)(dt,"".concat(Ot,"-allow-clear"),In),(0,Ke.Z)(dt,"".concat(Ot,"-show-arrow"),_o),(0,Ke.Z)(dt,"".concat(Ot,"-disabled"),rn),(0,Ke.Z)(dt,"".concat(Ot,"-loading"),Be),(0,Ke.Z)(dt,"".concat(Ot,"-open"),Pr),(0,Ke.Z)(dt,"".concat(Ot,"-customize-input"),_i),(0,Ke.Z)(dt,"".concat(Ot,"-show-search"),Dr),dt)),rs=ze.createElement(oe,{ref:Yn,disabled:rn,prefixCls:Ot,visible:Ur,popupElement:Oi,animation:Gn,transitionName:Xn,dropdownStyle:br,dropdownClassName:ur,direction:Sn,dropdownMatchSelectWidth:Br,dropdownRender:Gr,dropdownAlign:ar,placement:_n,builtinPlacements:Mn,getPopupContainer:gr,empty:Mt,getTriggerDOMNode:function(){return bi.current},onPopupVisibleChange:fa,onPopupMouseEnter:Ea},Hi?ze.cloneElement(Hi,{ref:Ni}):ze.createElement(un,(0,me.Z)({},De,{domRef:bi,prefixCls:Ot,inputElement:_i,ref:Vn,id:Xt,showSearch:Dr,autoClearSearchValue:zn,mode:Et,activeDescendantId:wn,tagRender:vn,values:dn,open:Pr,onToggleOpen:zr,activeValue:Ht,searchValue:ci,onSearch:oi,onSearchSubmit:zi,onRemove:ca,tokenWithEnter:ui}))),Do;return Hi?Do=rs:Do=ze.createElement("div",(0,me.Z)({className:Lo},$r,{ref:yi,onMouseDown:oo,onKeyDown:vi,onKeyUp:Gi,onFocus:ta,onBlur:ts}),xi&&!Pr&&ze.createElement("span",{style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0},"aria-live":"polite"},"".concat(dn.map(function(Ei){var mi=Ei.label,Ki=Ei.value;return["number","string"].includes((0,Ne.Z)(mi))?mi:Ki}).join(", "))),rs,Eo,Xa&&Oa),ze.createElement(nt.Provider,{value:bo},Do)}),mn=on,Cn=function(De,Te){var qe=ze.useRef({values:new Map,options:new Map}),dt=ze.useMemo(function(){var Ot=qe.current,Yt=Ot.values,pn=Ot.options,vn=De.map(function(dn){if(dn.label===void 0){var rt;return(0,ot.Z)((0,ot.Z)({},dn),{},{label:(rt=Yt.get(dn.value))===null||rt===void 0?void 0:rt.label})}return dn}),Sn=new Map,At=new Map;return vn.forEach(function(dn){Sn.set(dn.value,dn),At.set(dn.value,Te.get(dn.value)||pn.get(dn.value))}),qe.current.values=Sn,qe.current.options=At,vn},[De,Te]),Xt=ze.useCallback(function(Ot){return Te.get(Ot)||qe.current.options.get(Ot)},[Te]);return[dt,Xt]};function xt(De,Te){return Bt(De).join("").toUpperCase().includes(Te)}var hn=function(De,Te,qe,dt,Xt){return ze.useMemo(function(){if(!qe||dt===!1)return De;var Ot=Te.options,Yt=Te.label,pn=Te.value,vn=[],Sn=typeof dt=="function",At=qe.toUpperCase(),dn=Sn?dt:function(Mt,Lt){return Xt?xt(Lt[Xt],At):Lt[Ot]?xt(Lt[Yt!=="children"?Yt:"label"],At):xt(Lt[pn],At)},rt=Sn?function(Mt){return it(Mt)}:function(Mt){return Mt};return De.forEach(function(Mt){if(Mt[Ot]){var Lt=dn(qe,rt(Mt));if(Lt)vn.push(Mt);else{var Pt=Mt[Ot].filter(function(an){return dn(qe,rt(an))});Pt.length&&vn.push((0,ot.Z)((0,ot.Z)({},Mt),{},(0,Ke.Z)({},Ot,Pt)))}return}dn(qe,rt(Mt))&&vn.push(Mt)}),vn},[De,dt,Xt,qe,Te])},On=ue(17115),tt=ue(11592),Fe=["children","value"],Ge=["children"];function Zt(De){var Te=De,qe=Te.key,dt=Te.props,Xt=dt.children,Ot=dt.value,Yt=(0,Ae.Z)(dt,Fe);return(0,ot.Z)({key:qe,value:Ot!==void 0?Ot:qe,children:Xt},Yt)}function en(De){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,tt.Z)(De).map(function(qe,dt){if(!ze.isValidElement(qe)||!qe.type)return null;var Xt=qe,Ot=Xt.type.isSelectOptGroup,Yt=Xt.key,pn=Xt.props,vn=pn.children,Sn=(0,Ae.Z)(pn,Ge);return Te||!Ot?Zt(qe):(0,ot.Z)((0,ot.Z)({key:"__RC_SELECT_GRP__".concat(Yt===null?dt:Yt,"__"),label:Yt},Sn),{},{options:en(vn)})}).filter(function(qe){return qe})}function ln(De,Te,qe,dt,Xt){return ze.useMemo(function(){var Ot=De,Yt=!De;Yt&&(Ot=en(Te));var pn=new Map,vn=new Map,Sn=function(rt,Mt,Lt){Lt&&typeof Lt=="string"&&rt.set(Mt[Lt],Mt)};function At(dn){for(var rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Mt=0;Mt<dn.length;Mt+=1){var Lt=dn[Mt];!Lt[qe.options]||rt?(pn.set(Lt[qe.value],Lt),Sn(vn,Lt,qe.label),Sn(vn,Lt,dt),Sn(vn,Lt,Xt)):At(Lt[qe.options],!0)}}return At(Ot),{options:Ot,valueOptions:pn,labelOptions:vn}},[De,Te,qe,dt,Xt])}function Dn(De){var Te=ze.useRef();Te.current=De;var qe=ze.useCallback(function(){return Te.current.apply(Te,arguments)},[]);return qe}var Tn=function(){return null};Tn.isSelectOptGroup=!0;var En=Tn,Fn=function(){return null};Fn.isSelectOption=!0;var jn=Fn,An=ue(80547),hr=ue(2738),_r=ue(48911),Tr=ze.createContext(null),Hr=Tr;function sr(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var Mr=["disabled","title","children","style","className"];function rr(De){return typeof De=="string"||typeof De=="number"}var Or=function(Te,qe){var dt=ft(),Xt=dt.prefixCls,Ot=dt.id,Yt=dt.open,pn=dt.multiple,vn=dt.mode,Sn=dt.searchValue,At=dt.toggleOpen,dn=dt.notFoundContent,rt=dt.onPopupScroll,Mt=ze.useContext(Hr),Lt=Mt.flattenOptions,Pt=Mt.onActiveValue,an=Mt.defaultActiveFirstOption,Et=Mt.onSelect,rn=Mt.menuItemSelectedIcon,Be=Mt.rawValues,wt=Mt.fieldNames,Ct=Mt.virtual,Nt=Mt.direction,Tt=Mt.listHeight,Ft=Mt.listItemHeight,Ht="".concat(Xt,"-item"),gn=(0,An.Z)(function(){return Lt},[Yt,Lt],function(ar,_n){return _n[0]&&ar[1]!==_n[1]}),wn=ze.useRef(null),Ln=function(_n){_n.preventDefault()},zn=function(_n){wn.current&&wn.current.scrollTo(typeof _n=="number"?{index:_n}:_n)},er=function(_n){for(var Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,gr=gn.length,nr=0;nr<gr;nr+=1){var kr=(_n+nr*Mn+gr)%gr,Lr=gn[kr],Ir=Lr.group,pr=Lr.data;if(!Ir&&!pr.disabled)return kr}return-1},cr=ze.useState(function(){return er(0)}),Un=(0,be.Z)(cr,2),In=Un[0],fr=Un[1],tr=function(_n){var Mn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;fr(_n);var gr={source:Mn?"keyboard":"mouse"},nr=gn[_n];if(!nr){Pt(null,-1,gr);return}Pt(nr.value,_n,gr)};(0,ze.useEffect)(function(){tr(an!==!1?er(0):-1)},[gn.length,Sn]);var yr=ze.useCallback(function(ar){return Be.has(ar)&&vn!=="combobox"},[vn,(0,je.Z)(Be).toString(),Be.size]);(0,ze.useEffect)(function(){var ar=setTimeout(function(){if(!pn&&Yt&&Be.size===1){var Mn=Array.from(Be)[0],gr=gn.findIndex(function(nr){var kr=nr.data;return kr.value===Mn});gr!==-1&&(tr(gr),zn(gr))}});if(Yt){var _n;(_n=wn.current)===null||_n===void 0||_n.scrollTo(void 0)}return function(){return clearTimeout(ar)}},[Yt,Sn,Lt.length]);var Gn=function(_n){_n!==void 0&&Et(_n,{selected:!Be.has(_n)}),pn||At(!1)};if(ze.useImperativeHandle(qe,function(){return{onKeyDown:function(_n){var Mn=_n.which,gr=_n.ctrlKey;switch(Mn){case et.Z.N:case et.Z.P:case et.Z.UP:case et.Z.DOWN:{var nr=0;if(Mn===et.Z.UP?nr=-1:Mn===et.Z.DOWN?nr=1:sr()&&gr&&(Mn===et.Z.N?nr=1:Mn===et.Z.P&&(nr=-1)),nr!==0){var kr=er(In+nr,nr);zn(kr),tr(kr,!0)}break}case et.Z.ENTER:{var Lr=gn[In];Lr&&!Lr.data.disabled?Gn(Lr.value):Gn(void 0),Yt&&_n.preventDefault();break}case et.Z.ESC:At(!1),Yt&&_n.stopPropagation()}},onKeyUp:function(){},scrollTo:function(_n){zn(_n)}}}),gn.length===0)return ze.createElement("div",{role:"listbox",id:"".concat(Ot,"_list"),className:"".concat(Ht,"-empty"),onMouseDown:Ln},dn);var Xn=Object.keys(wt).map(function(ar){return wt[ar]}),br=function(_n){return _n.label};function ur(ar,_n){var Mn=ar.group;return{role:Mn?"presentation":"option",id:"".concat(Ot,"_list_").concat(_n)}}var Br=function(_n){var Mn=gn[_n];if(!Mn)return null;var gr=Mn.data||{},nr=gr.value,kr=Mn.group,Lr=(0,Ue.Z)(gr,!0),Ir=br(Mn);return Mn?ze.createElement("div",(0,me.Z)({"aria-label":typeof Ir=="string"&&!kr?Ir:null},Lr,{key:_n},ur(Mn,_n),{"aria-selected":yr(nr)}),nr):null},Gr={role:"listbox",id:"".concat(Ot,"_list")};return ze.createElement(ze.Fragment,null,Ct&&ze.createElement("div",(0,me.Z)({},Gr,{style:{height:0,width:0,overflow:"hidden"}}),Br(In-1),Br(In),Br(In+1)),ze.createElement(_r.Z,{itemKey:"key",ref:wn,data:gn,height:Tt,itemHeight:Ft,fullHeight:!1,onMouseDown:Ln,onScroll:rt,virtual:Ct,direction:Nt,innerProps:Ct?null:Gr},function(ar,_n){var Mn,gr=ar.group,nr=ar.groupOption,kr=ar.data,Lr=ar.label,Ir=ar.value,pr=kr.key;if(gr){var Sr,ii=(Sr=kr.title)!==null&&Sr!==void 0?Sr:rr(Lr)?Lr.toString():void 0;return ze.createElement("div",{className:Le()(Ht,"".concat(Ht,"-group")),title:ii},Lr!==void 0?Lr:pr)}var Hn=kr.disabled,qn=kr.title,Dr=kr.children,$r=kr.style,li=kr.className,di=(0,Ae.Z)(kr,Mr),ri=(0,hr.Z)(di,Xn),Jr=yr(Ir),yi="".concat(Ht,"-option"),bi=Le()(Ht,yi,li,(Mn={},(0,Ke.Z)(Mn,"".concat(yi,"-grouped"),nr),(0,Ke.Z)(Mn,"".concat(yi,"-active"),In===_n&&!Hn),(0,Ke.Z)(Mn,"".concat(yi,"-disabled"),Hn),(0,Ke.Z)(Mn,"".concat(yi,"-selected"),Jr),Mn)),Yn=br(ar),Vn=!rn||typeof rn=="function"||Jr,Zn=typeof Yn=="number"?Yn:Yn||Ir,mr=rr(Zn)?Zn.toString():void 0;return qn!==void 0&&(mr=qn),ze.createElement("div",(0,me.Z)({},(0,Ue.Z)(ri),Ct?{}:ur(ar,_n),{"aria-selected":Jr,className:bi,title:mr,onMouseMove:function(){In===_n||Hn||tr(_n)},onClick:function(){Hn||Gn(Ir)},style:$r}),ze.createElement("div",{className:"".concat(yi,"-content")},Zn),ze.isValidElement(rn)||Jr,Vn&&ze.createElement(St,{className:"".concat(Ht,"-option-state"),customizeIcon:rn,customizeIconProps:{isSelected:Jr}},Jr?"\u2713":null))}))},Fr=ze.forwardRef(Or);Fr.displayName="OptionList";var Er=Fr;function jr(De){var Te=De.mode,qe=De.options,dt=De.children,Xt=De.backfill,Ot=De.allowClear,Yt=De.placeholder,pn=De.getInputElement,vn=De.showSearch,Sn=De.onSearch,At=De.defaultOpen,dn=De.autoFocus,rt=De.labelInValue,Mt=De.value,Lt=De.inputValue,Pt=De.optionLabelProp,an=isMultiple(Te),Et=vn!==void 0?vn:an||Te==="combobox",rn=qe||convertChildrenToData(dt);if(warning(Te!=="tags"||rn.every(function(Nt){return!Nt.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Te==="tags"||Te==="combobox"){var Be=rn.some(function(Nt){return Nt.options?Nt.options.some(function(Tt){return typeof("value"in Tt?Tt.value:Tt.key)=="number"}):typeof("value"in Nt?Nt.value:Nt.key)=="number"});warning(!Be,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(Te!=="combobox"||!Pt,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(Te==="combobox"||!Xt,"`backfill` only works with `combobox` mode."),warning(Te==="combobox"||!pn,"`getInputElement` only work with `combobox` mode."),noteOnce(Te!=="combobox"||!pn||!Ot||!Yt,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Sn&&!Et&&Te!=="combobox"&&Te!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!At||dn,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Mt!=null){var wt=toArray(Mt);warning(!rt||wt.every(function(Nt){return _typeof(Nt)==="object"&&("key"in Nt||"value"in Nt)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!an||Array.isArray(Mt),"`value` should be array when `mode` is `multiple` or `tags`")}if(dt){var Ct=null;toNodeArray(dt).some(function(Nt){if(!React.isValidElement(Nt)||!Nt.type)return!1;var Tt=Nt,Ft=Tt.type;if(Ft.isSelectOption)return!1;if(Ft.isSelectOptGroup){var Ht=toNodeArray(Nt.props.children).every(function(gn){return!React.isValidElement(gn)||!Nt.type||gn.type.isSelectOption?!0:(Ct=gn.type,!1)});return!Ht}return Ct=Ft,!0}),Ct&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ct.displayName||Ct.name||Ct,"`.")),warning(Lt===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function Nr(De,Te){if(De){var qe=function dt(Xt){for(var Ot=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Yt=0;Yt<Xt.length;Yt++){var pn=Xt[Yt];if(pn[Te==null?void 0:Te.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!Ot&&Array.isArray(pn[Te==null?void 0:Te.options])&&dt(pn[Te==null?void 0:Te.options],!0))break}};qe(De)}}var Jn=null,lr=["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"],Rn=["inputValue"];function $n(De){return!De||(0,Ne.Z)(De)!=="object"}var wr=ze.forwardRef(function(De,Te){var qe=De.id,dt=De.mode,Xt=De.prefixCls,Ot=Xt===void 0?"rc-select":Xt,Yt=De.backfill,pn=De.fieldNames,vn=De.inputValue,Sn=De.searchValue,At=De.onSearch,dn=De.autoClearSearchValue,rt=dn===void 0?!0:dn,Mt=De.onSelect,Lt=De.onDeselect,Pt=De.dropdownMatchSelectWidth,an=Pt===void 0?!0:Pt,Et=De.filterOption,rn=De.filterSort,Be=De.optionFilterProp,wt=De.optionLabelProp,Ct=De.options,Nt=De.children,Tt=De.defaultActiveFirstOption,Ft=De.menuItemSelectedIcon,Ht=De.virtual,gn=De.direction,wn=De.listHeight,Ln=wn===void 0?200:wn,zn=De.listItemHeight,er=zn===void 0?20:zn,cr=De.value,Un=De.defaultValue,In=De.labelInValue,fr=De.onChange,tr=(0,Ae.Z)(De,lr),yr=(0,On.ZP)(qe),Gn=qt(dt),Xn=!!(!Ct&&Nt),br=ze.useMemo(function(){return Et===void 0&&dt==="combobox"?!1:Et},[Et,dt]),ur=ze.useMemo(function(){return le(pn,Xn)},[JSON.stringify(pn),Xn]),Br=(0,Ce.Z)("",{value:Sn!==void 0?Sn:vn,postState:function(Yr){return Yr||""}}),Gr=(0,be.Z)(Br,2),ar=Gr[0],_n=Gr[1],Mn=ln(Ct,Nt,ur,Be,wt),gr=Mn.valueOptions,nr=Mn.labelOptions,kr=Mn.options,Lr=ze.useCallback(function(Pr){var Yr=Bt(Pr);return Yr.map(function(Ur){var zr,ui,oi,zi,Wi;if($n(Ur))zr=Ur;else{var Zi;oi=Ur.key,ui=Ur.label,zr=(Zi=Ur.value)!==null&&Zi!==void 0?Zi:oi}var na=gr.get(zr);if(na){var wi;if(ui===void 0&&(ui=na==null?void 0:na[wt||ur.label]),oi===void 0&&(oi=(wi=na==null?void 0:na.key)!==null&&wi!==void 0?wi:zr),zi=na==null?void 0:na.disabled,Wi=na==null?void 0:na.title,0)var vi}return{label:ui,value:zr,key:oi,disabled:zi,title:Wi}})},[ur,wt,gr]),Ir=(0,Ce.Z)(Un,{value:cr}),pr=(0,be.Z)(Ir,2),Sr=pr[0],ii=pr[1],Hn=ze.useMemo(function(){var Pr,Yr=Lr(Sr);return dt==="combobox"&&It((Pr=Yr[0])===null||Pr===void 0?void 0:Pr.value)?[]:Yr},[Sr,Lr,dt]),qn=Cn(Hn,gr),Dr=(0,be.Z)(qn,2),$r=Dr[0],li=Dr[1],di=ze.useMemo(function(){if(!dt&&$r.length===1){var Pr=$r[0];if(Pr.value===null&&(Pr.label===null||Pr.label===void 0))return[]}return $r.map(function(Yr){var Ur;return(0,ot.Z)((0,ot.Z)({},Yr),{},{label:(Ur=Yr.label)!==null&&Ur!==void 0?Ur:Yr.value})})},[dt,$r]),ri=ze.useMemo(function(){return new Set($r.map(function(Pr){return Pr.value}))},[$r]);ze.useEffect(function(){if(dt==="combobox"){var Pr,Yr=(Pr=$r[0])===null||Pr===void 0?void 0:Pr.value;_n(ct(Yr)?String(Yr):"")}},[$r]);var Jr=Dn(function(Pr,Yr){var Ur,zr=Yr!=null?Yr:Pr;return Ur={},(0,Ke.Z)(Ur,ur.value,Pr),(0,Ke.Z)(Ur,ur.label,zr),Ur}),yi=ze.useMemo(function(){if(dt!=="tags")return kr;var Pr=(0,je.Z)(kr),Yr=function(zr){return gr.has(zr)};return(0,je.Z)($r).sort(function(Ur,zr){return Ur.value<zr.value?-1:1}).forEach(function(Ur){var zr=Ur.value;Yr(zr)||Pr.push(Jr(zr,Ur.label))}),Pr},[Jr,kr,gr,$r,dt]),bi=hn(yi,ur,ar,br,Be),Yn=ze.useMemo(function(){return dt!=="tags"||!ar||bi.some(function(Pr){return Pr[Be||"value"]===ar})||bi.some(function(Pr){return Pr[ur.value]===ar})?bi:[Jr(ar)].concat((0,je.Z)(bi))},[Jr,Be,dt,bi,ar,ur]),Vn=ze.useMemo(function(){return rn?(0,je.Z)(Yn).sort(function(Pr,Yr){return rn(Pr,Yr)}):Yn},[Yn,rn]),Zn=ze.useMemo(function(){return Ie(Vn,{fieldNames:ur,childrenAsData:Xn})},[Vn,ur,Xn]),mr=function(Yr){var Ur=Lr(Yr);if(ii(Ur),fr&&(Ur.length!==$r.length||Ur.some(function(oi,zi){var Wi;return((Wi=$r[zi])===null||Wi===void 0?void 0:Wi.value)!==(oi==null?void 0:oi.value)}))){var zr=In?Ur:Ur.map(function(oi){return oi.value}),ui=Ur.map(function(oi){return it(li(oi.value))});fr(Gn?zr:zr[0],Gn?ui:ui[0])}},ni=ze.useState(null),xi=(0,be.Z)(ni,2),Mi=xi[0],gi=xi[1],ci=ze.useState(0),_i=(0,be.Z)(ci,2),Hi=_i[0],Ni=_i[1],oa=Tt!==void 0?Tt:dt!=="combobox",Xr=ze.useCallback(function(Pr,Yr){var Ur=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},zr=Ur.source,ui=zr===void 0?"keyboard":zr;Ni(Yr),Yt&&dt==="combobox"&&Pr!==null&&ui==="keyboard"&&gi(String(Pr))},[Yt,dt]),ei=function(Yr,Ur,zr){var ui=function(){var sa,ta=li(Yr);return[In?{label:ta==null?void 0:ta[ur.label],value:Yr,key:(sa=ta==null?void 0:ta.key)!==null&&sa!==void 0?sa:Yr}:Yr,it(ta)]};if(Ur&&Mt){var oi=ui(),zi=(0,be.Z)(oi,2),Wi=zi[0],Zi=zi[1];Mt(Wi,Zi)}else if(!Ur&&Lt&&zr!=="clear"){var na=ui(),wi=(0,be.Z)(na,2),vi=wi[0],Gi=wi[1];Lt(vi,Gi)}},Ai=Dn(function(Pr,Yr){var Ur,zr=Gn?Yr.selected:!0;zr?Ur=Gn?[].concat((0,je.Z)($r),[Pr]):[Pr]:Ur=$r.filter(function(ui){return ui.value!==Pr}),mr(Ur),ei(Pr,zr),dt==="combobox"?gi(""):(!qt||rt)&&(_n(""),gi(""))}),ai=function(Yr,Ur){mr(Yr);var zr=Ur.type,ui=Ur.values;(zr==="remove"||zr==="clear")&&ui.forEach(function(oi){ei(oi.value,!1,zr)})},fi=function(Yr,Ur){if(_n(Yr),gi(null),Ur.source==="submit"){var zr=(Yr||"").trim();if(zr){var ui=Array.from(new Set([].concat((0,je.Z)(ri),[zr])));mr(ui),ei(zr,!0),_n("")}return}Ur.source!=="blur"&&(dt==="combobox"&&mr(Yr),At==null||At(Yr))},ki=function(Yr){var Ur=Yr;dt!=="tags"&&(Ur=Yr.map(function(ui){var oi=nr.get(ui);return oi==null?void 0:oi.value}).filter(function(ui){return ui!==void 0}));var zr=Array.from(new Set([].concat((0,je.Z)(ri),(0,je.Z)(Ur))));mr(zr),zr.forEach(function(ui){ei(ui,!0)})},pi=ze.useMemo(function(){var Pr=Ht!==!1&&an!==!1;return(0,ot.Z)((0,ot.Z)({},Mn),{},{flattenOptions:Zn,onActiveValue:Xr,defaultActiveFirstOption:oa,onSelect:Ai,menuItemSelectedIcon:Ft,rawValues:ri,fieldNames:ur,virtual:Pr,direction:gn,listHeight:Ln,listItemHeight:er,childrenAsData:Xn})},[Mn,Zn,Xr,oa,Ai,Ft,ri,ur,Ht,an,Ln,er,Xn]);return ze.createElement(Hr.Provider,{value:pi},ze.createElement(mn,(0,me.Z)({},tr,{id:yr,prefixCls:Ot,ref:Te,omitDomProps:Rn,mode:dt,displayValues:di,onDisplayValuesChange:ai,direction:gn,searchValue:ar,onSearch:fi,autoClearSearchValue:rt,onSearchSplit:ki,dropdownMatchSelectWidth:an,OptionList:Er,emptyOptions:!Zn.length,activeValue:Mi,activeDescendantId:"".concat(yr,"_list_").concat(Hi)})))}),lt=wr;lt.Option=jn,lt.OptGroup=En;var _e=lt,Pe=_e},9296:function(kn,cn,ue){"use strict";ue.r(cn),ue.d(cn,{ResizableTextArea:function(){return jt},default:function(){return It}});var me=ue(60499),je=ue(85899),Ke=ue(18642),ot=ue(43749),be=ue(72190),Ae=ue(42244),Ne=ue(77654),Ce=ue(92310),Me=ue.n(Ce),ze=ue(93681),ut=ue(5643),Le=ue(18929),We=ue(59301),yt=ue(29301),et=ue(34280),pt=ue(16089),at=`
|
|
|
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;
|
|
|
`,St=["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"],Qt={},nt;function ft(Rt){var mt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,$e=Rt.getAttribute("id")||Rt.getAttribute("data-reactid")||Rt.getAttribute("name");if(mt&&Qt[$e])return Qt[$e];var xe=window.getComputedStyle(Rt),ht=xe.getPropertyValue("box-sizing")||xe.getPropertyValue("-moz-box-sizing")||xe.getPropertyValue("-webkit-box-sizing"),nn=parseFloat(xe.getPropertyValue("padding-bottom"))+parseFloat(xe.getPropertyValue("padding-top")),Ut=parseFloat(xe.getPropertyValue("border-bottom-width"))+parseFloat(xe.getPropertyValue("border-top-width")),Xe=St.map(function(Dt){return"".concat(Dt,":").concat(xe.getPropertyValue(Dt))}).join(";"),Ye={sizingStyle:Xe,paddingSize:nn,borderSize:Ut,boxSizing:ht};return mt&&$e&&(Qt[$e]=Ye),Ye}function Ze(Rt){var mt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,$e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,xe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;nt||(nt=document.createElement("textarea"),nt.setAttribute("tab-index","-1"),nt.setAttribute("aria-hidden","true"),document.body.appendChild(nt)),Rt.getAttribute("wrap")?nt.setAttribute("wrap",Rt.getAttribute("wrap")):nt.removeAttribute("wrap");var ht=ft(Rt,mt),nn=ht.paddingSize,Ut=ht.borderSize,Xe=ht.boxSizing,Ye=ht.sizingStyle;nt.setAttribute("style","".concat(Ye,";").concat(at)),nt.value=Rt.value||Rt.placeholder||"";var Dt=void 0,bn=void 0,tn,un=nt.scrollHeight;if(Xe==="border-box"?un+=Ut:Xe==="content-box"&&(un-=nn),$e!==null||xe!==null){nt.value=" ";var Vt=nt.scrollHeight-nn;$e!==null&&(Dt=Vt*$e,Xe==="border-box"&&(Dt=Dt+nn+Ut),un=Math.max(Dt,un)),xe!==null&&(bn=Vt*xe,Xe==="border-box"&&(bn=bn+nn+Ut),tn=un>bn?"":"hidden",un=Math.min(bn,un))}var Gt={height:un,overflowY:tn,resize:"none"};return Dt&&(Gt.minHeight=Dt),bn&&(Gt.maxHeight=bn),Gt}var ke=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],He=0,Ue=1,bt=2,Ve=We.forwardRef(function(Rt,mt){var $e=Rt,xe=$e.prefixCls,ht=$e.onPressEnter,nn=$e.defaultValue,Ut=$e.value,Xe=$e.autoSize,Ye=$e.onResize,Dt=$e.className,bn=$e.style,tn=$e.disabled,un=$e.onChange,Vt=$e.onInternalAutoSize,Gt=(0,Ae.Z)($e,ke),Wt=(0,Le.Z)(nn,{value:Ut,postState:function(En){return En!=null?En:""}}),ye=(0,be.Z)(Wt,2),se=ye[0],oe=ye[1],de=function(En){oe(En.target.value),un==null||un(En)},fe=We.useRef();We.useImperativeHandle(mt,function(){return{textArea:fe.current}});var le=We.useMemo(function(){return Xe&&(0,ot.Z)(Xe)==="object"?[Xe.minRows,Xe.maxRows]:[]},[Xe]),Ie=(0,be.Z)(le,2),it=Ie[0],Kt=Ie[1],$t=!!Xe,Jt=function(){try{if(document.activeElement===fe.current){var En=fe.current,Fn=En.selectionStart,jn=En.selectionEnd,An=En.scrollTop;fe.current.setSelectionRange(Fn,jn),fe.current.scrollTop=An}}catch(hr){}},qt=We.useState(bt),on=(0,be.Z)(qt,2),mn=on[0],Cn=on[1],xt=We.useState(),hn=(0,be.Z)(xt,2),On=hn[0],tt=hn[1],Fe=function(){Cn(He)};(0,et.Z)(function(){$t&&Fe()},[Ut,it,Kt,$t]),(0,et.Z)(function(){if(mn===He)Cn(Ue);else if(mn===Ue){var Tn=Ze(fe.current,!1,it,Kt);Cn(bt),tt(Tn)}else Jt()},[mn]);var Ge=We.useRef(),Zt=function(){pt.Z.cancel(Ge.current)},en=function(En){mn===bt&&(Ye==null||Ye(En),Xe&&(Zt(),Ge.current=(0,pt.Z)(function(){Fe()})))};We.useEffect(function(){return Zt},[]);var ln=$t?On:null,Dn=(0,je.Z)((0,je.Z)({},bn),ln);return(mn===He||mn===Ue)&&(Dn.overflowY="hidden",Dn.overflowX="hidden"),We.createElement(yt.Z,{onResize:en,disabled:!(Xe||Ye)},We.createElement("textarea",(0,me.Z)({},Gt,{ref:fe,style:Dn,className:Me()(xe,Dt,(0,Ke.Z)({},"".concat(xe,"-disabled"),tn)),disabled:tn,value:se,onChange:de})))}),jt=Ve,st=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","classes","showCount","className","style","disabled","hidden","classNames","styles","onResize"];function Bt(Rt,mt){return(0,Ne.Z)(Rt||"").slice(0,mt).join("")}function Qe(Rt,mt,$e,xe){var ht=$e;return Rt?ht=Bt($e,xe):(0,Ne.Z)(mt||"").length<$e.length&&(0,Ne.Z)($e||"").length>xe&&(ht=mt),ht}var zt=We.forwardRef(function(Rt,mt){var $e,xe=Rt.defaultValue,ht=Rt.value,nn=Rt.onFocus,Ut=Rt.onBlur,Xe=Rt.onChange,Ye=Rt.allowClear,Dt=Rt.maxLength,bn=Rt.onCompositionStart,tn=Rt.onCompositionEnd,un=Rt.suffix,Vt=Rt.prefixCls,Gt=Vt===void 0?"rc-textarea":Vt,Wt=Rt.classes,ye=Rt.showCount,se=Rt.className,oe=Rt.style,de=Rt.disabled,fe=Rt.hidden,le=Rt.classNames,Ie=Rt.styles,it=Rt.onResize,Kt=(0,Ae.Z)(Rt,st),$t=(0,Le.Z)(xe,{value:ht,defaultValue:xe}),Jt=(0,be.Z)($t,2),qt=Jt[0],on=Jt[1],mn=(0,We.useRef)(null),Cn=We.useState(!1),xt=(0,be.Z)(Cn,2),hn=xt[0],On=xt[1],tt=We.useState(!1),Fe=(0,be.Z)(tt,2),Ge=Fe[0],Zt=Fe[1],en=We.useRef(),ln=We.useRef(0),Dn=We.useState(null),Tn=(0,be.Z)(Dn,2),En=Tn[0],Fn=Tn[1],jn=function(){var $n;($n=mn.current)===null||$n===void 0||$n.textArea.focus()};(0,We.useImperativeHandle)(mt,function(){return{resizableTextArea:mn.current,focus:jn,blur:function(){var $n;($n=mn.current)===null||$n===void 0||$n.textArea.blur()}}}),(0,We.useEffect)(function(){On(function(Rn){return!de&&Rn})},[de]);var An=Number(Dt)>0,hr=function($n){Zt(!0),en.current=qt,ln.current=$n.currentTarget.selectionStart,bn==null||bn($n)},_r=function($n){Zt(!1);var wr=$n.currentTarget.value;if(An){var lt,_e=ln.current>=Dt+1||ln.current===((lt=en.current)===null||lt===void 0?void 0:lt.length);wr=Qe(_e,en.current,wr,Dt)}wr!==qt&&(on(wr),(0,ut.rJ)($n.currentTarget,$n,Xe,wr)),tn==null||tn($n)},Tr=function($n){var wr=$n.target.value;if(!Ge&&An){var lt=$n.target.selectionStart>=Dt+1||$n.target.selectionStart===wr.length||!$n.target.selectionStart;wr=Qe(lt,qt,wr,Dt)}on(wr),(0,ut.rJ)($n.currentTarget,$n,Xe,wr)},Hr=function($n){var wr=Kt.onPressEnter,lt=Kt.onKeyDown;$n.key==="Enter"&&wr&&wr($n),lt==null||lt($n)},sr=function($n){On(!0),nn==null||nn($n)},Mr=function($n){On(!1),Ut==null||Ut($n)},rr=function($n){var wr;on(""),jn(),(0,ut.rJ)((wr=mn.current)===null||wr===void 0?void 0:wr.textArea,$n,Xe)},Or=(0,ut.D7)(qt);!Ge&&An&&ht==null&&(Or=Bt(Or,Dt));var Fr=un,Er;if(ye){var jr=(0,Ne.Z)(Or).length;(0,ot.Z)(ye)==="object"?Er=ye.formatter({value:Or,count:jr,maxLength:Dt}):Er="".concat(jr).concat(An?" / ".concat(Dt):""),Fr=We.createElement(We.Fragment,null,Fr,We.createElement("span",{className:Me()("".concat(Gt,"-data-count"),le==null?void 0:le.count),style:Ie==null?void 0:Ie.count},Er))}var Nr=function($n){var wr;it==null||it($n),(wr=mn.current)!==null&&wr!==void 0&&wr.textArea.style.height&&Fn(!0)},Jn=!Kt.autoSize&&!ye&&!Ye,lr=We.createElement(ze.BaseInput,{value:Or,allowClear:Ye,handleReset:rr,suffix:Fr,prefixCls:Gt,classes:{affixWrapper:Me()(Wt==null?void 0:Wt.affixWrapper,($e={},(0,Ke.Z)($e,"".concat(Gt,"-show-count"),ye),(0,Ke.Z)($e,"".concat(Gt,"-textarea-allow-clear"),Ye),$e))},disabled:de,focused:hn,className:se,style:(0,je.Z)((0,je.Z)({},oe),En&&!Jn?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof Er=="string"?Er:void 0}},hidden:fe,inputElement:We.createElement(jt,(0,me.Z)({},Kt,{onKeyDown:Hr,onChange:Tr,onFocus:sr,onBlur:Mr,onCompositionStart:hr,onCompositionEnd:_r,className:le==null?void 0:le.textarea,style:(0,je.Z)((0,je.Z)({},Ie==null?void 0:Ie.textarea),{},{resize:oe==null?void 0:oe.resize}),disabled:de,prefixCls:Gt,onResize:Nr,ref:mn}))});return lr}),ct=zt,It=ct},48911:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Wt}});var me=ue(60499),je=ue(43749),Ke=ue(85899),ot=ue(18642),be=ue(72190),Ae=ue(42244),Ne=ue(92310),Ce=ue.n(Ne),Me=ue(29301),ze=ue(70425),ut=ue(34280),Le=ue(59301),We=ue(4676),yt=Le.forwardRef(function(ye,se){var oe=ye.height,de=ye.offsetY,fe=ye.offsetX,le=ye.children,Ie=ye.prefixCls,it=ye.onInnerResize,Kt=ye.innerProps,$t=ye.rtl,Jt=ye.extra,qt={},on={display:"flex",flexDirection:"column"};return de!==void 0&&(qt={height:oe,position:"relative",overflow:"hidden"},on=(0,Ke.Z)((0,Ke.Z)({},on),{},(0,ot.Z)((0,ot.Z)((0,ot.Z)((0,ot.Z)((0,ot.Z)({transform:"translateY(".concat(de,"px)")},$t?"marginRight":"marginLeft",-fe),"position","absolute"),"left",0),"right",0),"top",0))),Le.createElement("div",{style:qt},Le.createElement(Me.Z,{onResize:function(Cn){var xt=Cn.offsetHeight;xt&&it&&it()}},Le.createElement("div",(0,me.Z)({style:on,className:Ce()((0,ot.Z)({},"".concat(Ie,"-holder-inner"),Ie)),ref:se},Kt),le,Jt)))});yt.displayName="Filler";var et=yt;function pt(ye){var se=ye.children,oe=ye.setRef,de=Le.useCallback(function(fe){oe(fe)},[]);return Le.cloneElement(se,{ref:de})}function at(ye,se,oe,de,fe,le,Ie,it){var Kt=it.getKey;return ye.slice(se,oe+1).map(function($t,Jt){var qt=se+Jt,on=Ie($t,qt,{style:{width:de},offsetX:fe}),mn=Kt($t);return Le.createElement(pt,{key:mn,setRef:function(xt){return le($t,xt)}},on)})}function St(ye,se,oe,de){var fe=oe-ye,le=se-oe,Ie=Math.min(fe,le)*2;if(de<=Ie){var it=Math.floor(de/2);return de%2?oe+it+1:oe-it}return fe>le?oe-(de-le):oe+(de-fe)}function Qt(ye,se,oe){var de=ye.length,fe=se.length,le,Ie;if(de===0&&fe===0)return null;de<fe?(le=ye,Ie=se):(le=se,Ie=ye);var it={__EMPTY_ITEM__:!0};function Kt(Cn){return Cn!==void 0?oe(Cn):it}for(var $t=null,Jt=Math.abs(de-fe)!==1,qt=0;qt<Ie.length;qt+=1){var on=Kt(le[qt]),mn=Kt(Ie[qt]);if(on!==mn){$t=qt,Jt=Jt||on!==Kt(Ie[qt+1]);break}}return $t===null?null:{index:$t,multiple:Jt}}function nt(ye,se,oe){var de=Le.useState(ye),fe=(0,be.Z)(de,2),le=fe[0],Ie=fe[1],it=Le.useState(null),Kt=(0,be.Z)(it,2),$t=Kt[0],Jt=Kt[1];return Le.useEffect(function(){var qt=Qt(le||[],ye||[],se);(qt==null?void 0:qt.index)!==void 0&&(oe==null||oe(qt.index),Jt(ye[qt.index])),Ie(ye)},[ye]),[$t]}var ft=ue(16089),Ze=(typeof navigator=="undefined"?"undefined":(0,je.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),ke=Ze,He=function(ye,se,oe,de){var fe=(0,Le.useRef)(!1),le=(0,Le.useRef)(null);function Ie(){clearTimeout(le.current),fe.current=!0,le.current=setTimeout(function(){fe.current=!1},50)}var it=(0,Le.useRef)({top:ye,bottom:se,left:oe,right:de});return it.current.top=ye,it.current.bottom=se,it.current.left=oe,it.current.right=de,function(Kt,$t){var Jt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,qt=Kt?$t<0&&it.current.left||$t>0&&it.current.right:$t<0&&it.current.top||$t>0&&it.current.bottom;return Jt&&qt?(clearTimeout(le.current),fe.current=!1):(!qt||fe.current)&&Ie(),!fe.current&&qt}};function Ue(ye,se,oe,de,fe,le,Ie){var it=(0,Le.useRef)(0),Kt=(0,Le.useRef)(null),$t=(0,Le.useRef)(null),Jt=(0,Le.useRef)(!1),qt=He(se,oe,de,fe);function on(tt,Fe){if(ft.Z.cancel(Kt.current),!qt(!1,Fe)){var Ge=tt;if(!Ge._virtualHandled)Ge._virtualHandled=!0;else return;it.current+=Fe,$t.current=Fe,ke||Ge.preventDefault(),Kt.current=(0,ft.Z)(function(){var Zt=Jt.current?10:1;Ie(it.current*Zt,!1),it.current=0})}}function mn(tt,Fe){Ie(Fe,!0),ke||tt.preventDefault()}var Cn=(0,Le.useRef)(null),xt=(0,Le.useRef)(null);function hn(tt){if(ye){ft.Z.cancel(xt.current),xt.current=(0,ft.Z)(function(){Cn.current=null},2);var Fe=tt.deltaX,Ge=tt.deltaY,Zt=tt.shiftKey,en=Fe,ln=Ge;(Cn.current==="sx"||!Cn.current&&Zt&&Ge&&!Fe)&&(en=Ge,ln=0,Cn.current="sx");var Dn=Math.abs(en),Tn=Math.abs(ln);Cn.current===null&&(Cn.current=le&&Dn>Tn?"x":"y"),Cn.current==="y"?on(tt,ln):mn(tt,en)}}function On(tt){ye&&(Jt.current=tt.detail===$t.current)}return[hn,On]}function bt(ye,se,oe,de){var fe=Le.useMemo(function(){return[new Map,[]]},[ye,oe.id,de]),le=(0,be.Z)(fe,2),Ie=le[0],it=le[1],Kt=function(Jt){var qt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Jt,on=Ie.get(Jt),mn=Ie.get(qt);if(on===void 0||mn===void 0)for(var Cn=ye.length,xt=it.length;xt<Cn;xt+=1){var hn,On=ye[xt],tt=se(On);Ie.set(tt,xt);var Fe=(hn=oe.get(tt))!==null&&hn!==void 0?hn:de;if(it[xt]=(it[xt-1]||0)+Fe,tt===Jt&&(on=xt),tt===qt&&(mn=xt),on!==void 0&&mn!==void 0)break}return{top:it[on-1]||0,bottom:it[mn]}};return Kt}var Ve=ue(38705),jt=ue(17212),st=function(){function ye(){(0,Ve.Z)(this,ye),(0,ot.Z)(this,"maps",void 0),(0,ot.Z)(this,"id",0),(0,ot.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,jt.Z)(ye,[{key:"set",value:function(oe,de){this.diffRecords.set(oe,this.maps[oe]),this.maps[oe]=de,this.id+=1}},{key:"get",value:function(oe){return this.maps[oe]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),ye}(),Bt=st;function Qe(ye){var se=parseFloat(ye);return isNaN(se)?0:se}function zt(ye,se,oe){var de=Le.useState(0),fe=(0,be.Z)(de,2),le=fe[0],Ie=fe[1],it=(0,Le.useRef)(new Map),Kt=(0,Le.useRef)(new Bt),$t=(0,Le.useRef)(0);function Jt(){$t.current+=1}function qt(){var mn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Jt();var Cn=function(){var On=!1;it.current.forEach(function(tt,Fe){if(tt&&tt.offsetParent){var Ge=tt.offsetHeight,Zt=getComputedStyle(tt),en=Zt.marginTop,ln=Zt.marginBottom,Dn=Qe(en),Tn=Qe(ln),En=Ge+Dn+Tn;Kt.current.get(Fe)!==En&&(Kt.current.set(Fe,En),On=!0)}}),On&&Ie(function(tt){return tt+1})};if(mn)Cn();else{$t.current+=1;var xt=$t.current;Promise.resolve().then(function(){xt===$t.current&&Cn()})}}function on(mn,Cn){var xt=ye(mn),hn=it.current.get(xt);Cn?(it.current.set(xt,Cn),qt()):it.current.delete(xt),!hn!=!Cn&&(Cn?se==null||se(mn):oe==null||oe(mn))}return(0,Le.useEffect)(function(){return Jt},[]),[on,qt,Kt.current,le]}var ct=14/15;function It(ye,se,oe){var de=(0,Le.useRef)(!1),fe=(0,Le.useRef)(0),le=(0,Le.useRef)(0),Ie=(0,Le.useRef)(null),it=(0,Le.useRef)(null),Kt,$t=function(mn){if(de.current){var Cn=Math.ceil(mn.touches[0].pageX),xt=Math.ceil(mn.touches[0].pageY),hn=fe.current-Cn,On=le.current-xt,tt=Math.abs(hn)>Math.abs(On);tt?fe.current=Cn:le.current=xt;var Fe=oe(tt,tt?hn:On,!1,mn);Fe&&mn.preventDefault(),clearInterval(it.current),Fe&&(it.current=setInterval(function(){tt?hn*=ct:On*=ct;var Ge=Math.floor(tt?hn:On);(!oe(tt,Ge,!0)||Math.abs(Ge)<=.1)&&clearInterval(it.current)},16))}},Jt=function(){de.current=!1,Kt()},qt=function(mn){Kt(),mn.touches.length===1&&!de.current&&(de.current=!0,fe.current=Math.ceil(mn.touches[0].pageX),le.current=Math.ceil(mn.touches[0].pageY),Ie.current=mn.target,Ie.current.addEventListener("touchmove",$t,{passive:!1}),Ie.current.addEventListener("touchend",Jt,{passive:!0}))};Kt=function(){Ie.current&&(Ie.current.removeEventListener("touchmove",$t),Ie.current.removeEventListener("touchend",Jt))},(0,ut.Z)(function(){return ye&&se.current.addEventListener("touchstart",qt,{passive:!0}),function(){var on;(on=se.current)===null||on===void 0||on.removeEventListener("touchstart",qt),Kt(),clearInterval(it.current)}},[ye])}function Rt(ye){return Math.floor(Math.pow(ye,.5))}function mt(ye,se){var oe="touches"in ye?ye.touches[0]:ye;return oe[se?"pageX":"pageY"]-window[se?"scrollX":"scrollY"]}function $e(ye,se,oe){Le.useEffect(function(){var de=se.current;if(ye&&de){var fe=!1,le,Ie,it=function(){ft.Z.cancel(le)},Kt=function on(){it(),le=(0,ft.Z)(function(){oe(Ie),on()})},$t=function(){fe=!1,it()},Jt=function(mn){if(!(mn.target.draggable||mn.button!==0)){var Cn=mn;Cn._virtualHandled||(Cn._virtualHandled=!0,fe=!0)}},qt=function(mn){if(fe){var Cn=mt(mn,!1),xt=de.getBoundingClientRect(),hn=xt.top,On=xt.bottom;if(Cn<=hn){var tt=hn-Cn;Ie=-Rt(tt),Kt()}else if(Cn>=On){var Fe=Cn-On;Ie=Rt(Fe),Kt()}else it()}};return de.addEventListener("mousedown",Jt),de.ownerDocument.addEventListener("mouseup",$t),de.ownerDocument.addEventListener("mousemove",qt),de.ownerDocument.addEventListener("dragend",$t),function(){de.removeEventListener("mousedown",Jt),de.ownerDocument.removeEventListener("mouseup",$t),de.ownerDocument.removeEventListener("mousemove",qt),de.ownerDocument.removeEventListener("dragend",$t),it()}}},[ye])}var xe=10;function ht(ye,se,oe,de,fe,le,Ie,it){var Kt=Le.useRef(),$t=Le.useState(null),Jt=(0,be.Z)($t,2),qt=Jt[0],on=Jt[1];return(0,ut.Z)(function(){if(qt&&qt.times<xe){if(!ye.current){on(function(Mr){return(0,Ke.Z)({},Mr)});return}le();var mn=qt.targetAlign,Cn=qt.originAlign,xt=qt.index,hn=qt.offset,On=ye.current.clientHeight,tt=!1,Fe=mn,Ge=null;if(On){for(var Zt=mn||Cn,en=0,ln=0,Dn=0,Tn=Math.min(se.length-1,xt),En=0;En<=Tn;En+=1){var Fn=fe(se[En]);ln=en;var jn=oe.get(Fn);Dn=ln+(jn===void 0?de:jn),en=Dn}for(var An=Zt==="top"?hn:On-hn,hr=Tn;hr>=0;hr-=1){var _r=fe(se[hr]),Tr=oe.get(_r);if(Tr===void 0){tt=!0;break}if(An-=Tr,An<=0)break}switch(Zt){case"top":Ge=ln-hn;break;case"bottom":Ge=Dn-On+hn;break;default:{var Hr=ye.current.scrollTop,sr=Hr+On;ln<Hr?Fe="top":Dn>sr&&(Fe="bottom")}}Ge!==null&&Ie(Ge),Ge!==qt.lastTop&&(tt=!0)}tt&&on((0,Ke.Z)((0,Ke.Z)({},qt),{},{times:qt.times+1,targetAlign:Fe,lastTop:Ge}))}},[qt,ye.current]),function(mn){if(mn==null){it();return}if(ft.Z.cancel(Kt.current),typeof mn=="number")Ie(mn);else if(mn&&(0,je.Z)(mn)==="object"){var Cn,xt=mn.align;"index"in mn?Cn=mn.index:Cn=se.findIndex(function(tt){return fe(tt)===mn.key});var hn=mn.offset,On=hn===void 0?0:hn;on({times:0,index:Cn,offset:On,originAlign:xt})}}}var nn=Le.forwardRef(function(ye,se){var oe=ye.prefixCls,de=ye.rtl,fe=ye.scrollOffset,le=ye.scrollRange,Ie=ye.onStartMove,it=ye.onStopMove,Kt=ye.onScroll,$t=ye.horizontal,Jt=ye.spinSize,qt=ye.containerSize,on=ye.style,mn=ye.thumbStyle,Cn=ye.showScrollBar,xt=Le.useState(!1),hn=(0,be.Z)(xt,2),On=hn[0],tt=hn[1],Fe=Le.useState(null),Ge=(0,be.Z)(Fe,2),Zt=Ge[0],en=Ge[1],ln=Le.useState(null),Dn=(0,be.Z)(ln,2),Tn=Dn[0],En=Dn[1],Fn=!de,jn=Le.useRef(),An=Le.useRef(),hr=Le.useState(Cn),_r=(0,be.Z)(hr,2),Tr=_r[0],Hr=_r[1],sr=Le.useRef(),Mr=function(){Cn===!0||Cn===!1||(clearTimeout(sr.current),Hr(!0),sr.current=setTimeout(function(){Hr(!1)},3e3))},rr=le-qt||0,Or=qt-Jt||0,Fr=Le.useMemo(function(){if(fe===0||rr===0)return 0;var lt=fe/rr;return lt*Or},[fe,rr,Or]),Er=function(_e){_e.stopPropagation(),_e.preventDefault()},jr=Le.useRef({top:Fr,dragging:On,pageY:Zt,startTop:Tn});jr.current={top:Fr,dragging:On,pageY:Zt,startTop:Tn};var Nr=function(_e){tt(!0),en(mt(_e,$t)),En(jr.current.top),Ie(),_e.stopPropagation(),_e.preventDefault()};Le.useEffect(function(){var lt=function(Te){Te.preventDefault()},_e=jn.current,Pe=An.current;return _e.addEventListener("touchstart",lt,{passive:!1}),Pe.addEventListener("touchstart",Nr,{passive:!1}),function(){_e.removeEventListener("touchstart",lt),Pe.removeEventListener("touchstart",Nr)}},[]);var Jn=Le.useRef();Jn.current=rr;var lr=Le.useRef();lr.current=Or,Le.useEffect(function(){if(On){var lt,_e=function(Te){var qe=jr.current,dt=qe.dragging,Xt=qe.pageY,Ot=qe.startTop;ft.Z.cancel(lt);var Yt=jn.current.getBoundingClientRect(),pn=qt/($t?Yt.width:Yt.height);if(dt){var vn=(mt(Te,$t)-Xt)*pn,Sn=Ot;!Fn&&$t?Sn-=vn:Sn+=vn;var At=Jn.current,dn=lr.current,rt=dn?Sn/dn:0,Mt=Math.ceil(rt*At);Mt=Math.max(Mt,0),Mt=Math.min(Mt,At),lt=(0,ft.Z)(function(){Kt(Mt,$t)})}},Pe=function(){tt(!1),it()};return window.addEventListener("mousemove",_e,{passive:!0}),window.addEventListener("touchmove",_e,{passive:!0}),window.addEventListener("mouseup",Pe,{passive:!0}),window.addEventListener("touchend",Pe,{passive:!0}),function(){window.removeEventListener("mousemove",_e),window.removeEventListener("touchmove",_e),window.removeEventListener("mouseup",Pe),window.removeEventListener("touchend",Pe),ft.Z.cancel(lt)}}},[On]),Le.useEffect(function(){return Mr(),function(){clearTimeout(sr.current)}},[fe]),Le.useImperativeHandle(se,function(){return{delayHidden:Mr}});var Rn="".concat(oe,"-scrollbar"),$n={position:"absolute",visibility:Tr?null:"hidden"},wr={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return $t?(Object.assign($n,{height:8,left:0,right:0,bottom:0}),Object.assign(wr,(0,ot.Z)({height:"100%",width:Jt},Fn?"left":"right",Fr))):(Object.assign($n,(0,ot.Z)({width:8,top:0,bottom:0},Fn?"right":"left",0)),Object.assign(wr,{width:"100%",height:Jt,top:Fr})),Le.createElement("div",{ref:jn,className:Ce()(Rn,(0,ot.Z)((0,ot.Z)((0,ot.Z)({},"".concat(Rn,"-horizontal"),$t),"".concat(Rn,"-vertical"),!$t),"".concat(Rn,"-visible"),Tr)),style:(0,Ke.Z)((0,Ke.Z)({},$n),on),onMouseDown:Er,onMouseMove:Mr},Le.createElement("div",{ref:An,className:Ce()("".concat(Rn,"-thumb"),(0,ot.Z)({},"".concat(Rn,"-thumb-moving"),On)),style:(0,Ke.Z)((0,Ke.Z)({},wr),mn),onMouseDown:Nr}))}),Ut=nn,Xe=20;function Ye(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,oe=ye/se*ye;return isNaN(oe)&&(oe=0),oe=Math.max(oe,Xe),Math.floor(oe)}var Dt=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],bn=[],tn={overflowY:"auto",overflowAnchor:"none"};function un(ye,se){var oe=ye.prefixCls,de=oe===void 0?"rc-virtual-list":oe,fe=ye.className,le=ye.height,Ie=ye.itemHeight,it=ye.fullHeight,Kt=it===void 0?!0:it,$t=ye.style,Jt=ye.data,qt=ye.children,on=ye.itemKey,mn=ye.virtual,Cn=ye.direction,xt=ye.scrollWidth,hn=ye.component,On=hn===void 0?"div":hn,tt=ye.onScroll,Fe=ye.onVirtualScroll,Ge=ye.onVisibleChange,Zt=ye.innerProps,en=ye.extraRender,ln=ye.styles,Dn=ye.showScrollBar,Tn=Dn===void 0?"optional":Dn,En=(0,Ae.Z)(ye,Dt),Fn=Le.useCallback(function(Hn){return typeof on=="function"?on(Hn):Hn==null?void 0:Hn[on]},[on]),jn=zt(Fn,null,null),An=(0,be.Z)(jn,4),hr=An[0],_r=An[1],Tr=An[2],Hr=An[3],sr=!!(mn!==!1&&le&&Ie),Mr=Le.useMemo(function(){return Object.values(Tr.maps).reduce(function(Hn,qn){return Hn+qn},0)},[Tr.id,Tr.maps]),rr=sr&&Jt&&(Math.max(Ie*Jt.length,Mr)>le||!!xt),Or=Cn==="rtl",Fr=Ce()(de,(0,ot.Z)({},"".concat(de,"-rtl"),Or),fe),Er=Jt||bn,jr=(0,Le.useRef)(),Nr=(0,Le.useRef)(),Jn=(0,Le.useRef)(),lr=(0,Le.useState)(0),Rn=(0,be.Z)(lr,2),$n=Rn[0],wr=Rn[1],lt=(0,Le.useState)(0),_e=(0,be.Z)(lt,2),Pe=_e[0],De=_e[1],Te=(0,Le.useState)(!1),qe=(0,be.Z)(Te,2),dt=qe[0],Xt=qe[1],Ot=function(){Xt(!0)},Yt=function(){Xt(!1)},pn={getKey:Fn};function vn(Hn){wr(function(qn){var Dr;typeof Hn=="function"?Dr=Hn(qn):Dr=Hn;var $r=er(Dr);return jr.current.scrollTop=$r,$r})}var Sn=(0,Le.useRef)({start:0,end:Er.length}),At=(0,Le.useRef)(),dn=nt(Er,Fn),rt=(0,be.Z)(dn,1),Mt=rt[0];At.current=Mt;var Lt=Le.useMemo(function(){if(!sr)return{scrollHeight:void 0,start:0,end:Er.length-1,offset:void 0};if(!rr){var Hn;return{scrollHeight:((Hn=Nr.current)===null||Hn===void 0?void 0:Hn.offsetHeight)||0,start:0,end:Er.length-1,offset:void 0}}for(var qn=0,Dr,$r,li,di=Er.length,ri=0;ri<di;ri+=1){var Jr=Er[ri],yi=Fn(Jr),bi=Tr.get(yi),Yn=qn+(bi===void 0?Ie:bi);Yn>=$n&&Dr===void 0&&(Dr=ri,$r=qn),Yn>$n+le&&li===void 0&&(li=ri),qn=Yn}return Dr===void 0&&(Dr=0,$r=0,li=Math.ceil(le/Ie)),li===void 0&&(li=Er.length-1),li=Math.min(li+1,Er.length-1),{scrollHeight:qn,start:Dr,end:li,offset:$r}},[rr,sr,$n,Er,Hr,le]),Pt=Lt.scrollHeight,an=Lt.start,Et=Lt.end,rn=Lt.offset;Sn.current.start=an,Sn.current.end=Et,Le.useLayoutEffect(function(){var Hn=Tr.getRecord();if(Hn.size===1){var qn=Array.from(Hn.keys())[0],Dr=Hn.get(qn),$r=Er[an];if($r&&Dr===void 0){var li=Fn($r);if(li===qn){var di=Tr.get(qn),ri=di-Ie;vn(function(Jr){return Jr+ri})}}}Tr.resetRecord()},[Pt]);var Be=Le.useState({width:0,height:le}),wt=(0,be.Z)(Be,2),Ct=wt[0],Nt=wt[1],Tt=function(qn){Nt({width:qn.offsetWidth,height:qn.offsetHeight})},Ft=(0,Le.useRef)(),Ht=(0,Le.useRef)(),gn=Le.useMemo(function(){return Ye(Ct.width,xt)},[Ct.width,xt]),wn=Le.useMemo(function(){return Ye(Ct.height,Pt)},[Ct.height,Pt]),Ln=Pt-le,zn=(0,Le.useRef)(Ln);zn.current=Ln;function er(Hn){var qn=Hn;return Number.isNaN(zn.current)||(qn=Math.min(qn,zn.current)),qn=Math.max(qn,0),qn}var cr=$n<=0,Un=$n>=Ln,In=Pe<=0,fr=Pe>=xt,tr=He(cr,Un,In,fr),yr=function(){return{x:Or?-Pe:Pe,y:$n}},Gn=(0,Le.useRef)(yr()),Xn=(0,ze.useEvent)(function(Hn){if(Fe){var qn=(0,Ke.Z)((0,Ke.Z)({},yr()),Hn);(Gn.current.x!==qn.x||Gn.current.y!==qn.y)&&(Fe(qn),Gn.current=qn)}});function br(Hn,qn){var Dr=Hn;qn?((0,We.flushSync)(function(){De(Dr)}),Xn()):vn(Dr)}function ur(Hn){var qn=Hn.currentTarget.scrollTop;qn!==$n&&vn(qn),tt==null||tt(Hn),Xn()}var Br=function(qn){var Dr=qn,$r=xt?xt-Ct.width:0;return Dr=Math.max(Dr,0),Dr=Math.min(Dr,$r),Dr},Gr=(0,ze.useEvent)(function(Hn,qn){qn?((0,We.flushSync)(function(){De(function(Dr){var $r=Dr+(Or?-Hn:Hn);return Br($r)})}),Xn()):vn(function(Dr){var $r=Dr+Hn;return $r})}),ar=Ue(sr,cr,Un,In,fr,!!xt,Gr),_n=(0,be.Z)(ar,2),Mn=_n[0],gr=_n[1];It(sr,jr,function(Hn,qn,Dr,$r){var li=$r;return tr(Hn,qn,Dr)?!1:!li||!li._virtualHandled?(li&&(li._virtualHandled=!0),Mn({preventDefault:function(){},deltaX:Hn?qn:0,deltaY:Hn?0:qn}),!0):!1}),$e(rr,jr,function(Hn){vn(function(qn){return qn+Hn})}),(0,ut.Z)(function(){function Hn(Dr){var $r=cr&&Dr.detail<0,li=Un&&Dr.detail>0;sr&&!$r&&!li&&Dr.preventDefault()}var qn=jr.current;return qn.addEventListener("wheel",Mn,{passive:!1}),qn.addEventListener("DOMMouseScroll",gr,{passive:!0}),qn.addEventListener("MozMousePixelScroll",Hn,{passive:!1}),function(){qn.removeEventListener("wheel",Mn),qn.removeEventListener("DOMMouseScroll",gr),qn.removeEventListener("MozMousePixelScroll",Hn)}},[sr,cr,Un]),(0,ut.Z)(function(){if(xt){var Hn=Br(Pe);De(Hn),Xn({x:Hn})}},[Ct.width,xt]);var nr=function(){var qn,Dr;(qn=Ft.current)===null||qn===void 0||qn.delayHidden(),(Dr=Ht.current)===null||Dr===void 0||Dr.delayHidden()},kr=ht(jr,Er,Tr,Ie,Fn,function(){return _r(!0)},vn,nr);Le.useImperativeHandle(se,function(){return{nativeElement:Jn.current,getScrollInfo:yr,scrollTo:function(qn){function Dr($r){return $r&&(0,je.Z)($r)==="object"&&("left"in $r||"top"in $r)}Dr(qn)?(qn.left!==void 0&&De(Br(qn.left)),kr(qn.top)):kr(qn)}}}),(0,ut.Z)(function(){if(Ge){var Hn=Er.slice(an,Et+1);Ge(Hn,Er)}},[an,Et,Er]);var Lr=bt(Er,Fn,Tr,Ie),Ir=en==null?void 0:en({start:an,end:Et,virtual:rr,offsetX:Pe,offsetY:rn,rtl:Or,getSize:Lr}),pr=at(Er,an,Et,xt,Pe,hr,qt,pn),Sr=null;le&&(Sr=(0,Ke.Z)((0,ot.Z)({},Kt?"height":"maxHeight",le),tn),sr&&(Sr.overflowY="hidden",xt&&(Sr.overflowX="hidden"),dt&&(Sr.pointerEvents="none")));var ii={};return Or&&(ii.dir="rtl"),Le.createElement("div",(0,me.Z)({ref:Jn,style:(0,Ke.Z)((0,Ke.Z)({},$t),{},{position:"relative"}),className:Fr},ii,En),Le.createElement(Me.Z,{onResize:Tt},Le.createElement(On,{className:"".concat(de,"-holder"),style:Sr,ref:jr,onScroll:ur,onMouseEnter:nr},Le.createElement(et,{prefixCls:de,height:Pt,offsetX:Pe,offsetY:rn,scrollWidth:xt,onInnerResize:_r,ref:Nr,innerProps:Zt,rtl:Or,extra:Ir},pr))),rr&&Pt>le&&Le.createElement(Ut,{ref:Ft,prefixCls:de,scrollOffset:$n,scrollRange:Pt,rtl:Or,onScroll:br,onStartMove:Ot,onStopMove:Yt,spinSize:wn,containerSize:Ct.height,style:ln==null?void 0:ln.verticalScrollBar,thumbStyle:ln==null?void 0:ln.verticalScrollBarThumb,showScrollBar:Tn}),rr&&xt>Ct.width&&Le.createElement(Ut,{ref:Ht,prefixCls:de,scrollOffset:Pe,scrollRange:xt,rtl:Or,onScroll:br,onStartMove:Ot,onStopMove:Yt,spinSize:gn,containerSize:Ct.width,horizontal:!0,style:ln==null?void 0:ln.horizontalScrollBar,thumbStyle:ln==null?void 0:ln.horizontalScrollBarThumb,showScrollBar:Tn}))}var Vt=Le.forwardRef(un);Vt.displayName="List";var Gt=Vt,Wt=Gt},48136:function(kn,cn,ue){"use strict";var me=Object.defineProperty,je=Object.defineProperties,Ke=Object.getOwnPropertyDescriptors,ot=Object.getOwnPropertySymbols,be=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable,Ne=(a,y,b)=>y in a?me(a,y,{enumerable:!0,configurable:!0,writable:!0,value:b}):a[y]=b,Ce=(a,y)=>{for(var b in y||(y={}))be.call(y,b)&&Ne(a,b,y[b]);if(ot)for(var b of ot(y))Ae.call(y,b)&&Ne(a,b,y[b]);return a},Me=(a,y)=>je(a,Ke(y)),ze=a=>typeof a=="symbol"?a:a+"",ut=(a,y)=>{var b={};for(var E in a)be.call(a,E)&&y.indexOf(E)<0&&(b[E]=a[E]);if(a!=null&&ot)for(var E of ot(a))y.indexOf(E)<0&&Ae.call(a,E)&&(b[E]=a[E]);return b};function Le(a){return Array.isArray(a)}var We={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 yt(){return"window"in globalThis&&"document"in globalThis}function et(){return"matchMedia"in window?window.matchMedia("(pointer: coarse)").matches:"ontouchstart"in window||navigator.maxTouchPoints>0}function pt(){return typeof navigator.vibrate=="function"}function at(){var a,y;if(!yt())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 St(){if(!yt())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 Qt(){return HTMLElement.prototype.hasOwnProperty("popover")}var nt={strings:We,_locale:"",_dirty:!1,_subscribers:[],_numberFormatter:void 0,get locale(){return nt._locale||(nt._locale=yt()?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]=Ce(Ce({},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=ft(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=ft(E);ee&&b.setAttribute("aria-label",ee)}}}};function ft(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),he=0;for(;ae;){if(y[he++]){const ve=ae[2]?parseInt(ae[2],10)-1:he-1;let we=y[ve];typeof we=="number"&&(we=nt.numberFormatter.format(we)),b=b.replace(ae[1],we)}ae=re.exec(b)}return b=b.replace(/%%/g,"%"),b}var Ze={m0:"#3F3D99",m1:"#993D71",m2:"#998B3D",m3:"#3D9956",m4:"#3D5A99",m5:"#993D90",m6:"#996D3D",m7:"#43993D",m8:"#3D7999",m9:"#843D99"},ke={blue:"#0072BD",orange:"#D95319",yellow:"#EDB120",purple:"#7E2F8E",green:"#77AC30",cyan:"#4DBEEE",red:"#A2142F"},He={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"},Ue={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"},bt={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"},Ve={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 jt(a){var y,b,E,ee,re,ae;const he=a.split("!");let pe,ve,we,Re=255,Je=255,vt=255,kt=-1;const xn=he.length>0&&he[0].startsWith("-");xn&&(he[0]=he[0].slice(1));for(let ir=0;ir<he.length;ir++){pe=Re,ve=Je,we=vt;const yn=(y=he[ir].trim().match(/^([A-Za-z\d-]+)/))==null?void 0:y[1],Nn=yn==null?void 0:yn.toLowerCase(),dr=yn&&(ae=(re=(ee=(E=(b=Ue[Nn])!=null?b:Ue[bt[yn]])!=null?E:ke[yn])!=null?ee:Ve[yn])!=null?re:Ze[yn])!=null?ae:he[ir].trim();let Kn=dr.match(/^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(Kn!=null&&Kn[1]&&Kn[2]&&Kn[3])Re=Math.max(0,Math.min(255,Number.parseInt(Kn[1],16))),Je=Math.max(0,Math.min(255,Number.parseInt(Kn[2],16))),vt=Math.max(0,Math.min(255,Number.parseInt(Kn[3],16)));else if(Kn=dr.match(/^#([\da-f]{3})$/i),Kn!=null&&Kn[1]){const Zr=Number.parseInt(Kn[1][0],16),qr=Number.parseInt(Kn[1][1],16),Vr=Number.parseInt(Kn[1][2],16);Re=Math.max(0,Math.min(255,Zr*16+Zr)),Je=Math.max(0,Math.min(255,qr*16+qr)),vt=Math.max(0,Math.min(255,Vr*16+Vr))}else if(Kn=dr.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i),Kn!=null&&Kn[1]&&Kn[2]&&Kn[3])Re=Math.max(0,Math.min(255,Number.parseInt(Kn[1]))),Je=Math.max(0,Math.min(255,Number.parseInt(Kn[2]))),vt=Math.max(0,Math.min(255,Number.parseInt(Kn[3])));else return;kt>=0&&(Re=(1-kt)*Re+kt*pe,Je=(1-kt)*Je+kt*ve,vt=(1-kt)*vt+kt*we,kt=-1),ir+1<he.length&&(kt=Math.max(0,Math.min(100,Number.parseInt(he[++ir])))/100)}return kt>=0&&(Re=kt*Re+(1-kt)*pe,Je=kt*Je+(1-kt)*ve,vt=kt*vt+(1-kt)*we),xn&&(Re=255-Re,Je=255-Je,vt=255-vt),"#"+("00"+Math.round(Re).toString(16)).slice(-2)+("00"+Math.round(Je).toString(16)).slice(-2)+("00"+Math.round(vt).toString(16)).slice(-2)}function st(a){var y,b;return a=a.trim(),(b=(y=He[a.toLowerCase()])!=null?y:He[bt[a]])!=null?b:jt(a)}function Bt(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 Qe(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 zt(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*Qe(re,ee,y+2)),g:Math.round(255*Qe(re,ee,y)),b:Math.round(255*Qe(re,ee,y-2))}}function ct(a){return a<0?0:a>255?255:Math.round(a)}function It(a){const{r:y,g:b,b:E}=a;let ee=((1<<24)+(ct(y)<<16)+(ct(b)<<8)+ct(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 Rt(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 he,pe;re===ee?he=0:y===re?he=(b-E)/ae:b===re?he=2+(E-y)/ae:E===re&&(he=4+(y-b)/ae),he=Math.min(he*60,360),he<0&&(he+=360);const ve=(ee+re)/2;return re===ee?pe=0:ve<=.5?pe=ae/(re+ee):pe=ae/(2-re-ee),{h:he,s:pe,l:ve}}function mt(a){let y=Bt(a);if(!y)return a;let{h:b,s:E,l:ee}=Rt(y);return E+=.1,ee-=.1,It(zt({h:b,s:E,l:ee}))}var $e={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"},xe={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},ht=[{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 nn(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 ht)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(xe[re]||re)}return a}function Ut(a){var y;if((a<119808||a>120831)&&(a<8448||a>8527))return{char:String.fromCodePoint(a)};for(const b in xe)if(xe[b]===a){a=(y=b.codePointAt(0))!=null?y:0;break}for(const b of ht)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 Xe(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=$e[ee];if(re)re.startsWith("\\")?b+=re+" ":b+=re;else{const{char:ae,variant:he,style:pe}=Ut(ee);switch(re=ae,he){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(pe){case"bold":re=`\\mathbf{${re}}`;break;case"italic":re=`\\mathit{${re}}`;break;case"bolditalic":re=`\\mathbfit{${re}}`;break}b+=re}}return b}function Ye(a){return a?Array.isArray(a)?a:typeof a=="object"&&"group"in a?a.group:[]:[]}var Dt={},bn=Ce({},$e),tn={},un={},Vt={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}"},Gt={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}},Wt={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}},ye={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:Wt},"amsmath.sty":{package:Gt,primitive:!0},"texvc.sty":{package:Vt,primitive:!1}},se={" ":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},oe=/[\w!@*()-=+{}\[\]\\';:?/.,~<>`|$%#&^" ]/,de,fe;St()?(de=new RegExp("\\p{Letter}","u"),fe=new RegExp("[0-9\\p{Letter}]","u")):(de=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/,fe=/[\da-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/);function le(a,y,b="mord",E){y!==void 0&&(Dt[a]={definitionType:"symbol",type:b,variant:E,codepoint:y},bn[y]||(bn[y]=a))}function Ie(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 it(a,y){for(let b=a;b<=y;b++)le(String.fromCodePoint(b),b)}function Kt(a){var y;return(y=un[a])!=null?y:null}function $t(a,y){var b,E;if(y.length===0||y==="\\"||!y.startsWith("\\"))return[];const ee=[];for(const ae in tn)ae.startsWith(y)&&!tn[ae].infix&&ee.push({match:ae,frequency:(b=tn[ae].frequency)!=null?b:0});for(const ae in Dt)ae.startsWith(y)&&ee.push({match:ae,frequency:(E=Dt[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,he)=>{var pe,ve;return ae.frequency===he.frequency?ae.match.length===he.match.length?ae.match<he.match?-1:1:ae.match.length-he.match.length:((pe=he.frequency)!=null?pe:0)-((ve=ae.frequency)!=null?ve:0)}),ee.map(ae=>ae.match)}function Jt(a){let y="auto";const b=a.match(/:([^=]+)/);return b&&(y=b[1].trim()),y}function qt(a){if(!a)return[];const y=[];let b=a.split("]");if(b[0].startsWith("[")){y.push({isOptional:!0,type:Jt(b[0].slice(1))});for(let E=1;E<=b.length;E++)y.push(...qt(b[E]))}else if(b=a.split("}"),b[0].startsWith("{")){y.push({isOptional:!1,type:Jt(b[0].slice(1))});for(let E=1;E<=b.length;E++)y.push(...qt(b[E]))}return y}function on(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 mn(a,y){typeof a=="string"&&(a=[a]);const b={tabular:!1,params:[],createAtom:y};for(const E of a)un[E]=b}function Cn(a,y,b){typeof a=="string"&&(a=[a]);const ee={tabular:!0,params:qt(y),createAtom:b};for(const re of a)un[re]=ee}function xt(a,y,b){var E,ee;b||(b={});const re={definitionType:"function",params:qt(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")tn["\\"+a]=re;else for(const ae of a)tn["\\"+ae]=re}var hn;function On(a){return hn||(hn=Fe(ye)),a?Fe(Ce(Ce({},hn),a)):hn}function tt(a,y){var b,E,ee,re;if(typeof a=="string"){let ae=0;const he=a;return/(^|[^\\])#1/.test(he)&&(ae=1),/(^|[^\\])#2/.test(he)&&(ae=2),/(^|[^\\])#3/.test(he)&&(ae=3),/(^|[^\\])#4/.test(he)&&(ae=4),/(^|[^\\])#5/.test(he)&&(ae=5),/(^|[^\\])#6/.test(he)&&(ae=6),/(^|[^\\])#7/.test(he)&&(ae=7),/(^|[^\\])#8/.test(he)&&(ae=8),/(^|[^\\])#9/.test(he)&&(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:he}}return Ce({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 Fe(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]=tt(E.package[ee],{expand:!E.primitive,captureSelection:E.captureSelection});else y[b]=tt(E)}return y}function Ge(a,y="math"){if(!a||a.length===0)return null;let b=null;if(a.startsWith("\\")){if(b=tn[a],b)return!b.ifMode||b.ifMode===y?b:null;y==="math"?b=Dt[a]:se[a]&&(b={definitionType:"symbol",type:"mord",codepoint:se[a]})}else if(y==="math"){if(b=Dt[a],!b&&a.length===1){const E=en("math",a.codePointAt(0));return E.startsWith("\\")?Me(Ce({},Ge(E,"math")),{command:E}):null}}else se[a]?b={definitionType:"symbol",type:"mord",codepoint:se[a]}:y==="text"&&(b={definitionType:"symbol",type:"mord",codepoint:a.codePointAt(0)});return b!=null?b:null}function Zt(a,y){if(!a.startsWith("\\"))return null;const b=a.slice(1);return y[b]}function en(a,y){if(y===void 0)return"";if(a==="math"&&bn[y])return bn[y];if(a==="text"){const b=Object.keys(se).find(E=>se[E]===y);return b||String.fromCodePoint(y)}return String.fromCodePoint(y)}var ln=[0,.68889,0,0,.72222],Dn=[0,.68889,0,0,.66667],Tn=[0,.68889,0,0,.77778],En=[0,.68889,0,0,.61111],Fn=[.16667,.68889,0,0,.77778],jn=[0,.68889,0,0,.55556],An=[0,0,0,0,.25],hr=[0,.825,0,0,2.33334],_r=[0,.9,0,0,2.33334],Tr=[0,.68889,0,0,.54028],Hr=[-.03598,.46402,0,0,.5],sr=[-.13313,.36687,0,0,1],Mr=[.01354,.52239,0,0,1],rr=[.01354,.52239,0,0,1.11111],Or=[0,.54986,0,0,1],Fr=[0,.69224,0,0,.5],Er=[0,.43056,0,0,1],jr=[.08198,.58198,0,0,.77778],Nr=[.19444,.69224,0,0,.41667],Jn=[.1808,.675,0,0,1],lr=[.19444,.69224,0,0,.83334],Rn=[.13667,.63667,0,0,1],$n=[-.064,.437,0,0,1.334],wr=[.08167,.58167,0,0,.77778],lt=[0,.69224,0,0,.72222],_e=[0,.69224,0,0,.66667],Pe=[-.13313,.36687,0,0,.77778],De=[.06062,.54986,0,0,.77778],Te=[0,.69224,0,0,.77778],qe=[.25583,.75583,0,0,.77778],dt=[.25142,.75726,0,0,.77778],Xt=[.20576,.70576,0,0,.77778],Ot=[.30274,.79383,0,0,.77778],Yt=[.22958,.72958,0,0,.77778],pn=[.1808,.675,0,0,.77778],vn=[.13667,.63667,0,0,.77778],Sn=[.13597,.63597,0,0,.77778],At=[.03517,.54986,0,0,.77778],dn=[0,.675,0,0,.77778],rt=[.19444,.69224,0,0,.61111],Mt=[0,.54986,0,0,.76042],Lt=[0,.54986,0,0,.66667],Pt=[.0391,.5391,0,0,.77778],an=[.03517,.54986,0,0,1.33334],Et=[.38569,.88569,0,0,.77778],rn=[.23222,.74111,0,0,.77778],Be=[.19444,.69224,0,0,.77778],wt=[0,.37788,0,0,.5],Ct=[0,.54986,0,0,.72222],Nt=[0,.69224,0,0,.83334],Tt=[.11111,.69224,0,0,.66667],Ft=[.26167,.75726,0,0,.77778],Ht=[.48256,.98256,0,0,.77778],gn=[.28481,.79383,0,0,.77778],wn=[.08167,.58167,0,0,.22222],Ln=[.08167,.58167,0,0,.38889],zn=[0,.43056,.04028,0,.66667],er=[.41951,.91951,0,0,.77778],cr=[.24982,.74947,0,0,.38865],Un=[.08319,.58283,0,0,.75623],In=[0,.10803,0,0,.27764],fr=[0,.47534,0,0,.50181],tr=[.18906,.47534,0,0,.50181],yr=[0,.69141,0,0,.50181],Gn=[.24982,.74947,0,0,.27764],Xn=[0,.69141,0,0,.21471],br=[.25,.75,0,0,.44722],ur=[0,.64444,0,0,.575],Br=[.08556,.58556,0,0,.89444],Gr=[0,.69444,0,0,.89444],ar=[0,.68611,0,0,.9],_n=[0,.68611,0,0,.86944],Mn=[.25,.75,0,0,.575],gr=[.25,.75,0,0,.31944],nr=[0,.69444,0,0,.63889],kr=[0,.69444,0,0,.31944],Lr=[0,.44444,0,0,.63889],Ir=[0,.44444,0,0,.51111],pr=[0,.69444,0,0,.575],Sr=[.13333,.63333,0,0,.89444],ii=[0,.44444,0,0,.31944],Hn=[0,.69444,0,0,.86944],qn=[0,.68611,0,0,.69166],Dr=[0,.68611,0,0,.83055],$r=[0,.68611,0,0,.89444],li=[0,.69444,0,0,.60278],di=[.19444,.69444,0,0,.51111],ri=[0,.69444,0,0,.83055],Jr=[-.10889,.39111,0,0,1.14999],yi=[.19444,.69444,0,0,.575],bi=[.19444,.69444,0,0,1.14999],Yn=[.19444,.69444,0,0,.70277],Vn=[.05556,.75,0,0,.575],Zn=[0,.68611,0,0,.95833],mr=[.08556,.58556,0,0,.76666],ni=[-.02639,.47361,0,0,.575],xi=[0,.44444,0,0,.89444],Mi=[0,.55556,0,0,.76666],gi=[-.10889,.39111,0,0,.89444],ci=[.00222,.50222,0,0,.89444],_i=[.19667,.69667,0,0,.89444],Hi=[.08556,.58556,0,0,1.14999],Ni=[0,.69444,0,0,.70277],oa=[-.02778,.47222,0,0,.575],Xr=[.25,.75,0,0,.51111],ei=[-.13889,.36111,0,0,1.14999],Ai=[.19444,.69444,0,0,1.02222],ai=[.12963,.69444,0,0,.89444],fi=[.19444,.69444,0,0,.44722],ki=[0,.64444,.13167,0,.59111],pi=[.19444,.64444,.13167,0,.59111],Pr=[0,.68611,.17208,0,.8961],Yr=[.19444,.44444,.105,0,.53222],Ur=[0,.44444,.085,0,.82666],zr=[0,.69444,.06709,0,.59111],ui=[0,.69444,.12945,0,.35555],oi=[0,.69444,0,0,.94888],zi=[0,.69444,.11472,0,.59111],Wi=[0,.68611,.10778,0,.88555],Zi=[0,.69444,.07939,0,.62055],na=[0,.69444,.12417,0,.30667],wi=[0,.64444,.13556,0,.51111],vi=[.19444,.64444,.13556,0,.51111],Gi=[0,.68333,.16389,0,.74333],ca=[.19444,.43056,.08847,0,.46],sa=[0,.43056,.07514,0,.71555],ta=[0,.69444,.06646,0,.51111],ts=[0,.69444,0,0,.83129],ao=[0,.69444,.1225,0,.51111],oo=[0,.68333,.09403,0,.76666],eo=[0,.68333,.11111,0,.76666],Ss=[0,.69444,.06961,0,.51444],fo=[0,.69444,0,0,.27778],Ea=[.25,.75,0,0,.38889],fa=[0,.64444,0,0,.5],bo=[0,.69444,0,0,.77778],_o=[0,.68333,0,0,.75],Eo=[0,.68333,0,0,.77778],ns=[0,.68333,0,0,.68056],$o=[0,.68333,0,0,.72222],Xa=[.25,.75,0,0,.5],Oa=[.25,.75,0,0,.27778],Oi=[0,.69444,0,0,.5],Lo=[0,.69444,0,0,.55556],rs=[0,.43056,0,0,.44445],Do=[0,.43056,0,0,.5],Ei=[.19444,.43056,0,0,.55556],mi=[0,.43056,0,0,.55556],Ki=[.08333,.58333,0,0,.77778],La=[0,.43056,0,0,.27778],Xi=[0,.66786,0,0,.27778],$a=[0,.69444,0,0,.75],Fa=[0,.66786,0,0,.5],to=[0,.68333,0,0,.625],Ra=[.19444,.69444,0,0,.44445],so=[0,.69444,0,0,.72222],lo=[.19444,.69444,0,0,.5],Da=[.19444,.69444,0,0,1],bl=[.011,.511,0,0,1.126],jo=[.19444,.69444,0,0,.61111],Js=[.05556,.75,0,0,.5],Kl=[0,.68333,0,0,.83334],Hl=[.0391,.5391,0,0,.66667],Cs=[-.05555,.44445,0,0,.5],kc=[0,.43056,0,0,.77778],is=[0,.55556,0,0,.66667],xl=[-.03625,.46375,0,0,.77778],Vo=[-.01688,.48312,0,0,.77778],as=[.0391,.5391,0,0,1],Ii=[0,.69444,0,0,.61111],Bi=[-.03472,.46528,0,0,.5],ji=[.25,.75,0,0,.44445],Ya=[-.14236,.35764,0,0,1],Aa=[.244,.744,0,0,.412],xo=[.19444,.69444,0,0,.88889],po=[.12963,.69444,0,0,.77778],za=[.19444,.69444,0,0,.38889],Ao=[.011,.511,0,0,1.638],To=[.19444,.69444,0,0,0],wo=[0,.44444,0,0,.575],os=[.19444,.44444,0,0,.575],Wl=[0,.68611,0,0,.75555],wl=[0,.69444,0,0,.66759],ku=[0,.68611,0,0,.80555],_u=[0,.68611,.08229,0,.98229],Zl=[0,.68611,0,0,.76666],Od=[0,.44444,0,0,.58472],_c=[.19444,.44444,0,0,.6118],Sl=[.19444,.43056,0,0,.5],Eu=[0,.68333,.02778,.08334,.76278],Ec=[0,.68333,.08125,.05556,.83125],qs=[0,.43056,0,.05556,.48472],jl=[.19444,.43056,0,.08334,.51702],Lu=[.25,.75,0,0,.42778],Ta=[0,.69444,0,0,.55],ss=[0,.69444,0,0,.73334],Ms=[0,.69444,0,0,.79445],$d=[0,.69444,0,0,.51945],Vl=[0,.69444,0,0,.70278],Lc=[0,.69444,0,0,.76389],Qs=[.25,.75,0,0,.34306],el=[0,.69444,0,0,.56111],Rd=[0,.69444,0,0,.25556],Ul=[.19444,.45833,0,0,.56111],Du=[0,.45833,0,0,.56111],ks=[0,.69444,0,0,.30556],Au=[0,.69444,0,0,.58056],_s=[0,.69444,0,0,.67223],tl=[0,.69444,0,0,.85556],ls=[0,.69444,0,0,.55834],mo=[0,.65556,.11156,0,.5],Es=[0,.69444,.08094,0,.70834],Dc=[.17014,0,0,0,.44445],Tu=[0,.69444,.0799,0,.5],Iu=[0,.69444,0,0,.73752],Nd=[0,.69444,.09205,0,.5],Ls=[0,.69444,.09031,0,.77778],cs=[0,.69444,.07816,0,.27778],Fd=[0,.69444,.00316,0,.5],zd=[.19444,.69444,0,0,.83334],Kd=[.05556,.75,0,0,.83334],Hd=[0,.75,0,0,.5],Wd=[.125,.08333,0,0,.27778],Zd=[0,.08333,0,0,.27778],pa=[0,.65556,0,0,.5],Sa=[0,.69444,0,0,.47222],ua=[0,.69444,0,0,.66667],Ia=[0,.69444,0,0,.59722],nl=[0,.69444,0,0,.54167],Pu=[0,.69444,0,0,.70834],Gl=[.25,.75,0,0,.28889],Bu=[0,.69444,0,0,.51667],jd=[0,.44444,0,0,.44445],Vd=[.19444,.44444,0,0,.51667],Ac=[0,.44444,0,0,.38333],Ou=[0,.44444,0,0,.51667],Tc=[0,.69444,0,0,.83334],Ud=[.35001,.85,0,0,.45834],Ic=[.35001,.85,0,0,.57778],Pc=[.35001,.85,0,0,.41667],$u=[.35001,.85,0,0,.58334],Xl=[0,.72222,0,0,.55556],Bc=[1e-5,.6,0,0,.66667],Ru=[1e-5,.6,0,0,.77778],Cl=[.25001,.75,0,0,.94445],Gd=[.306,.805,.19445,0,.47222],Yl=[.30612,.805,.19445,0,.47222],Ka=[.25001,.75,0,0,.83334],rl=[.35001,.85,0,0,.47222],Nu=[.25001,.75,0,0,1.11111],Fu=[.65002,1.15,0,0,.59722],go=[.65002,1.15,0,0,.81111],Fi=[.65002,1.15,0,0,.47222],Io=[.65002,1.15,0,0,.66667],Ro=[0,.75,0,0,1],us=[.55001,1.05,0,0,1.27778],zu=[.862,1.36,.44445,0,.55556],Oc=[.86225,1.36,.44445,0,.55556],il=[.55001,1.05,0,0,1.11111],$c=[.65002,1.15,0,0,.52778],Rc=[.65002,1.15,0,0,.61111],al=[.55001,1.05,0,0,1.51112],Ku=[.95003,1.45,0,0,.73611],Nc=[.95003,1.45,0,0,1.04445],ds=[.95003,1.45,0,0,.52778],Jl=[.95003,1.45,0,0,.75],ql=[0,.75,0,0,1.44445],Fc=[.95003,1.45,0,0,.58334],Ql=[1.25003,1.75,0,0,.79167],zc=[1.25003,1.75,0,0,1.27778],Hu=[1.25003,1.75,0,0,.58334],Kc=[1.25003,1.75,0,0,.80556],ec=[0,.825,0,0,1.8889],Hc=[1.25003,1.75,0,0,.63889],Wc=[.64502,1.155,0,0,.875],tc=[1e-5,.6,0,0,.875],Zc=[-99e-5,.601,0,0,.66667],jc=[.64502,1.155,0,0,.66667],Xd=[1e-5,.9,0,0,.88889],Wu=[.65002,1.15,0,0,.88889],ol=[.90001,0,0,0,.88889],Vc=[-.00499,.605,0,0,1.05556],sl=[0,.12,0,0,.45],Wr=[0,.61111,0,0,.525],So=[.08333,.69444,0,0,.525],Zu=[-.08056,.53055,0,0,.525],Yd=[-.05556,.55556,0,0,.525],no=[0,.43056,0,0,.525],Ca=[.22222,.43056,0,0,.525],nc=[0,0,0,0,.525],Jd={"AMS-Regular":{32:An,65:ln,66:Dn,67:ln,68:ln,69:Dn,70:En,71:Tn,72:Tn,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:Tn,76:Dn,77:[0,.68889,0,0,.94445],78:ln,79:Fn,80:En,81:Fn,82:ln,83:jn,84:Dn,85:ln,86:ln,87:[0,.68889,0,0,1],88:ln,89:ln,90:Dn,107:jn,160:An,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:jn,295:Tr,710:hr,732:_r,770:hr,771:_r,989:wr,1008:zn,8245:[0,.54986,0,0,.275],8463:Tr,8487:ln,8498:jn,8502:Dn,8503:[0,.68889,0,0,.44445],8504:Dn,8513:[0,.68889,0,0,.63889],8592:Hr,8594:Hr,8602:sr,8603:sr,8606:Mr,8608:Mr,8610:rr,8611:rr,8619:Or,8620:Or,8621:[-.13313,.37788,0,0,1.38889],8622:sr,8624:Fr,8625:Fr,8630:Er,8631:Er,8634:jr,8635:jr,8638:Nr,8639:Nr,8642:Nr,8643:Nr,8644:Jn,8646:Jn,8647:Jn,8648:lr,8649:Jn,8650:lr,8651:Mr,8652:Mr,8653:sr,8654:sr,8655:sr,8666:Rn,8667:Rn,8669:[-.13313,.37788,0,0,1],8672:$n,8674:$n,8705:[0,.825,0,0,.5],8708:jn,8709:wr,8717:[0,.43056,0,0,.42917],8722:Hr,8724:[.08198,.69224,0,0,.77778],8726:wr,8733:Te,8736:lt,8737:lt,8738:[.03517,.52239,0,0,.72222],8739:wn,8740:[.25142,.74111,0,0,.27778],8741:Ln,8742:[.25142,.74111,0,0,.5],8756:_e,8757:_e,8764:Pe,8765:[-.13313,.37788,0,0,.77778],8769:Pe,8770:xl,8774:Ot,8776:Vo,8778:wr,8782:De,8783:De,8785:jr,8786:jr,8787:jr,8790:Te,8791:Yt,8796:[.08198,.91667,0,0,.77778],8806:qe,8807:qe,8808:dt,8809:dt,8812:[.25583,.75583,0,0,.5],8814:Xt,8815:Xt,8816:Ot,8817:Ot,8818:Yt,8819:Yt,8822:pn,8823:pn,8828:vn,8829:vn,8830:Yt,8831:Yt,8832:Xt,8833:Xt,8840:Ot,8841:Ot,8842:Sn,8843:Sn,8847:At,8848:At,8858:jr,8859:jr,8861:jr,8862:dn,8863:dn,8864:dn,8865:dn,8872:[0,.69224,0,0,.61111],8873:lt,8874:[0,.69224,0,0,.88889],8876:En,8877:En,8878:ln,8879:ln,8882:At,8883:At,8884:vn,8885:vn,8888:[0,.54986,0,0,1.11111],8890:Ei,8891:rt,8892:rt,8901:[0,.54986,0,0,.27778],8903:wr,8905:wr,8906:wr,8907:Te,8908:Te,8909:[-.03598,.46402,0,0,.77778],8910:Mt,8911:Mt,8912:At,8913:At,8914:Lt,8915:Lt,8916:_e,8918:Pt,8919:Pt,8920:an,8921:an,8922:Et,8923:Et,8926:vn,8927:vn,8928:Ot,8929:Ot,8934:rn,8935:rn,8936:rn,8937:rn,8938:Xt,8939:Xt,8940:Ot,8941:Ot,8994:Be,8995:Be,9416:[.15559,.69224,0,0,.90222],9484:Fr,9488:Fr,9492:wt,9496:wt,9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:dn,9633:dn,9650:Ct,9651:Ct,9654:At,9660:Ct,9661:Ct,9664:At,9674:Tt,9733:[.19444,.69224,0,0,.94445],10003:Nt,10016:Nt,10731:Tt,10846:[.19444,.75583,0,0,.61111],10877:vn,10878:vn,10885:qe,10886:qe,10887:Sn,10888:Sn,10889:Ft,10890:Ft,10891:Ht,10892:Ht,10901:vn,10902:vn,10933:dt,10934:dt,10935:Ft,10936:Ft,10937:Ft,10938:Ft,10949:qe,10950:qe,10955:gn,10956:gn,57350:wn,57351:Ln,57352:wr,57353:zn,57356:dt,57357:dt,57358:er,57359:Ot,57360:Ot,57361:er,57366:dt,57367:dt,57368:dt,57369:dt,57370:Sn,57371:Sn},"Caligraphic-Regular":{32:An,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:An},"Fraktur-Regular":{32:An,33:[0,.69141,0,0,.29574],34:Xn,38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:cr,41:cr,42:[0,.62119,0,0,.27764],43:Un,44:In,45:Un,46:In,47:[.24982,.74947,0,0,.50181],48:fr,49:fr,50:fr,51:tr,52:tr,53:tr,54:yr,55:tr,56:yr,57:tr,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:Gn,93:Gn,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:An,8216:Xn,8217:Xn,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:An,33:[0,.69444,0,0,.35],34:li,35:[.19444,.69444,0,0,.95833],36:Vn,37:[.05556,.75,0,0,.95833],38:Gr,39:kr,40:br,41:br,42:[0,.75,0,0,.575],43:Sr,44:[.19444,.15556,0,0,.31944],45:Ac,46:[0,.15556,0,0,.31944],47:Mn,48:ur,49:ur,50:ur,51:ur,52:ur,53:ur,54:ur,55:ur,56:ur,57:ur,58:ii,59:[.19444,.44444,0,0,.31944],60:Br,61:gi,62:Br,63:[0,.69444,0,0,.54305],64:Gr,65:_n,66:[0,.68611,0,0,.81805],67:Dr,68:[0,.68611,0,0,.88194],69:Wl,70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:ar,73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:qn,77:[0,.68611,0,0,1.09166],78:ar,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:_n,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:gr,92:Mn,93:gr,94:pr,95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:nr,99:Ir,100:nr,101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:nr,105:kr,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:kr,109:[0,.44444,0,0,.95833],110:Lr,111:wo,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:Lr,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:Ir,123:Mn,124:gr,125:Mn,126:[.35,.34444,0,0,.575],160:An,163:[0,.69444,0,0,.86853],168:pr,172:[0,.44444,0,0,.76666],176:Hn,177:Sr,184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:Sr,216:[.04861,.73472,0,0,.89444],223:Ia,230:[0,.44444,0,0,.83055],247:Sr,248:[.09722,.54167,0,0,.575],305:ii,338:[0,.68611,0,0,1.16944],339:xi,567:[.19444,.44444,0,0,.35139],710:pr,711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:pr,715:pr,728:pr,729:kr,730:Hn,732:pr,733:pr,915:qn,916:Zn,920:$r,923:ku,926:Zl,928:ar,931:Dr,933:$r,934:Dr,936:$r,937:Dr,8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:kr,8217:kr,8220:li,8221:li,8224:di,8225:di,8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:wl,8465:ri,8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:ri,8501:Ni,8592:Jr,8593:yi,8594:Jr,8595:yi,8596:Jr,8597:Mn,8598:bi,8599:bi,8600:bi,8601:bi,8636:Jr,8637:Jr,8640:Jr,8641:Jr,8656:Jr,8657:Yn,8658:Jr,8659:Yn,8660:Jr,8661:[.25,.75,0,0,.70277],8704:nr,8706:[0,.69444,.06389,0,.62847],8707:nr,8709:Vn,8711:Zn,8712:mr,8715:mr,8722:Sr,8723:Sr,8725:Mn,8726:Mn,8727:oa,8728:ni,8729:ni,8730:[.18,.82,0,0,.95833],8733:xi,8734:[0,.44444,0,0,1.14999],8736:lt,8739:gr,8741:Mn,8743:Mi,8744:Mi,8745:Mi,8746:Mi,8747:[.19444,.69444,.12778,0,.56875],8764:gi,8768:[.19444,.69444,0,0,.31944],8771:ci,8776:[.02444,.52444,0,0,.89444],8781:ci,8801:ci,8804:_i,8805:_i,8810:Hi,8811:Hi,8826:Br,8827:Br,8834:Br,8835:Br,8838:_i,8839:_i,8846:Mi,8849:_i,8850:_i,8851:Mi,8852:Mi,8853:Sr,8854:Sr,8855:Sr,8856:Sr,8857:Sr,8866:Ni,8867:Ni,8868:Gr,8869:Gr,8900:ni,8901:[-.02639,.47361,0,0,.31944],8902:oa,8968:Xr,8969:Xr,8970:Xr,8971:Xr,8994:ei,8995:ei,9651:Ai,9657:oa,9661:Ai,9667:oa,9711:bi,9824:ai,9825:ai,9826:ai,9827:ai,9837:[0,.75,0,0,.44722],9838:fi,9839:fi,10216:br,10217:br,10815:ar,10927:_i,10928:_i,57376:To},"Main-BoldItalic":{32:An,33:[0,.69444,.11417,0,.38611],34:Zi,35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:ui,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:ki,49:ki,50:ki,51:ki,52:pi,53:ki,54:ki,55:pi,56:ki,57:ki,58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:zi,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:Pr,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:Pr,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:zr,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:Yr,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:Yr,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:An,168:[0,.69444,.11473,0,.59111],176:oi,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:Ur,248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:Ur,567:[.19444,.44444,.04611,0,.385],710:zr,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:ui,730:oi,732:zi,733:zi,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:Pr,931:[0,.68611,.11431,0,.82666],933:Wi,934:[0,.68611,.05632,0,.82666],936:Wi,937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:ui,8217:ui,8220:[0,.69444,.16772,0,.62055],8221:Zi},"Main-Italic":{32:An,33:na,34:Ss,35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:na,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:wi,49:wi,50:wi,51:wi,52:vi,53:wi,54:wi,55:vi,56:wi,57:wi,58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:ao,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:Gi,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:Gi,79:oo,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:Gi,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:ca,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:ca,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:An,168:[0,.66786,.10474,0,.51111],176:ts,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:sa,248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:sa,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:ts,732:[0,.66786,.11585,0,.51111],733:ao,915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:oo,923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:Gi,931:[0,.68333,.12028,0,.71555],933:eo,934:[0,.68333,.05986,0,.71555],936:eo,937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:na,8217:na,8220:[0,.69444,.1685,0,.51444],8221:Ss,8463:Tr},"Main-Regular":{32:An,33:fo,34:Oi,35:zd,36:Js,37:Kd,38:bo,39:fo,40:Ea,41:Ea,42:Hd,43:Ki,44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:Xa,48:fa,49:fa,50:fa,51:fa,52:fa,53:fa,54:fa,55:fa,56:fa,57:fa,58:La,59:[.19444,.43056,0,0,.27778],60:Pt,61:Pe,62:Pt,63:Sa,64:bo,65:_o,66:[0,.68333,0,0,.70834],67:$o,68:[0,.68333,0,0,.76389],69:ns,70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:_o,73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:Eo,76:to,77:[0,.68333,0,0,.91667],78:_o,79:Eo,80:ns,81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:$o,85:_o,86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:_o,89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:Oa,92:Xa,93:Oa,94:Oi,95:[.31,.12056,.02778,0,.5],97:Do,98:Lo,99:rs,100:Lo,101:rs,102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:Lo,105:Xi,106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:fo,109:[0,.43056,0,0,.83334],110:mi,111:Do,112:Ei,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:mi,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:rs,123:Xa,124:Oa,125:Xa,126:[.35,.31786,0,0,.5],160:An,163:[0,.69444,0,0,.76909],167:Ra,168:Fa,172:[0,.43056,0,0,.66667],176:$a,177:Ki,182:jo,184:Dc,198:[0,.68333,0,0,.90278],215:Ki,216:[.04861,.73194,0,0,.77778],223:Oi,230:[0,.43056,0,0,.72222],247:Ki,248:[.09722,.52778,0,0,.5],305:La,338:[0,.68333,0,0,1.01389],339:kc,567:[.19444,.43056,0,0,.30556],710:Oi,711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:Oi,715:Oi,728:Oi,729:Xi,730:$a,732:Fa,733:Oi,915:to,916:Kl,920:Eo,923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:_o,931:$o,933:Eo,934:$o,936:Eo,937:$o,8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:fo,8217:fo,8220:Oi,8221:Oi,8224:Ra,8225:Ra,8230:[0,.12,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:Tr,8465:so,8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:so,8501:Ii,8592:sr,8593:lo,8594:sr,8595:lo,8596:sr,8597:Xa,8598:Da,8599:Da,8600:Da,8601:Da,8614:[.011,.511,0,0,1],8617:bl,8618:bl,8636:sr,8637:sr,8640:sr,8641:sr,8652:[.011,.671,0,0,1],8656:sr,8657:jo,8658:sr,8659:jo,8660:sr,8661:[.25,.75,0,0,.61111],8704:Lo,8706:[0,.69444,.05556,.08334,.5309],8707:Lo,8709:Js,8711:Kl,8712:Hl,8715:Hl,8722:Ki,8723:Ki,8725:Xa,8726:Xa,8727:Bi,8728:Cs,8729:Cs,8730:[.2,.8,0,0,.83334],8733:kc,8734:Er,8736:lt,8739:Oa,8741:Xa,8743:is,8744:is,8745:is,8746:is,8747:[.19444,.69444,.11111,0,.41667],8764:Pe,8768:[.19444,.69444,0,0,.27778],8771:xl,8773:[-.022,.589,0,0,1],8776:Vo,8781:xl,8784:[-.133,.67,0,0,.778],8801:xl,8804:Sn,8805:Sn,8810:as,8811:as,8826:Pt,8827:Pt,8834:Pt,8835:Pt,8838:Sn,8839:Sn,8846:is,8849:Sn,8850:Sn,8851:is,8852:is,8853:Ki,8854:Ki,8855:Ki,8856:Ki,8857:Ki,8866:Ii,8867:Ii,8868:bo,8869:bo,8872:[.249,.75,0,0,.867],8900:Cs,8901:[-.05555,.44445,0,0,.27778],8902:Bi,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:ji,8969:ji,8970:ji,8971:ji,8994:Ya,8995:Ya,9136:Aa,9137:Aa,9651:xo,9657:Bi,9661:xo,9667:Bi,9711:Da,9824:po,9825:po,9826:po,9827:po,9837:[0,.75,0,0,.38889],9838:za,9839:za,10216:Ea,10217:Ea,10222:Aa,10223:Aa,10229:[.011,.511,0,0,1.609],10230:Ao,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:Ao,10815:_o,10927:Sn,10928:Sn,57376:To},"Math-BoldItalic":{32:An,48:wo,49:wo,50:wo,51:os,52:os,53:os,54:ur,55:os,56:ur,57:os,65:_n,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:_u,73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:Wl,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:wl,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:Od,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:An,915:[0,.68611,.15972,0,.65694],916:Zn,920:[0,.68611,.03194,0,.86722],923:ku,926:[0,.68611,.07458,0,.84125],928:_u,931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:Zl,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:Od,960:[0,.44444,.03704,0,.68241],961:_c,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:_c,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:An,48:Do,49:Do,50:Do,51:Sl,52:Sl,53:Sl,54:fa,55:Sl,56:fa,57:Sl,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:Ec,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:Eu,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:qs,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:An,915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:Eu,923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:Ec,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:qs,960:[0,.43056,.03588,0,.57003],961:jl,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:jl,1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:An,33:[0,.69444,0,0,.36667],34:ls,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:ks,40:Lu,41:Lu,42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:Ta,49:Ta,50:Ta,51:Ta,52:Ta,53:Ta,54:Ta,55:Ta,56:Ta,57:Ta,58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:$d,64:ss,65:ss,66:ss,67:Vl,68:Ms,69:[0,.69444,0,0,.64167],70:Ii,71:ss,72:Ms,73:[0,.69444,0,0,.33056],74:$d,75:Lc,76:Au,77:[0,.69444,0,0,.97778],78:Ms,79:Ms,80:Vl,81:[.10556,.69444,0,0,.79445],82:Vl,83:Ii,84:ss,85:Lc,86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:ss,89:[0,.69444,.0275,0,.73334],90:_s,91:Qs,93:Qs,94:Ta,95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:el,99:[0,.45833,0,0,.48889],100:el,101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:el,105:Rd,106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:Rd,109:[0,.45833,0,0,.86667],110:Du,111:[0,.45833,0,0,.55],112:Ul,113:Ul,114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:Du,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:An,168:Ta,176:ss,180:Ta,184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:Ta,711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:Ta,729:ks,730:ss,732:Ta,733:Ta,915:Au,916:[0,.69444,0,0,.91667],920:tl,923:_s,926:ss,928:Ms,931:Ms,933:tl,934:Ms,936:tl,937:Ms,8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:ks,8217:ks,8220:ls,8221:ls},"SansSerif-Italic":{32:An,33:[0,.69444,.05733,0,.31945],34:Fd,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:cs,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:Wd,45:[0,.44444,.01946,0,.33333],46:Zd,47:[.25,.75,.13164,0,.5],48:mo,49:mo,50:mo,51:mo,52:mo,53:mo,54:mo,55:mo,56:mo,57:mo,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:ua,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:Es,73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:nl,77:[0,.69444,.08094,0,.875],78:Es,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:Tu,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:An,168:[0,.67937,.06385,0,.5],176:Iu,184:Dc,305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:Tu,711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:Nd,715:Oi,728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:Iu,732:[0,.67659,.08826,0,.5],733:Nd,915:[0,.69444,.13372,0,.54167],916:Tc,920:[0,.69444,.07555,0,.77778],923:Ii,926:[0,.69444,.12816,0,.66667],928:Es,931:[0,.69444,.11983,0,.72222],933:Ls,934:[0,.69444,.04603,0,.72222],936:Ls,937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:cs,8217:cs,8220:[0,.69444,.14205,0,.5],8221:Fd},"SansSerif-Regular":{32:An,33:[0,.69444,0,0,.31945],34:Oi,35:zd,36:Js,37:Kd,38:[0,.69444,0,0,.75834],39:fo,40:Ea,41:Ea,42:Hd,43:Ki,44:Wd,45:[0,.44444,0,0,.33333],46:Zd,47:Xa,48:pa,49:pa,50:pa,51:pa,52:pa,53:pa,54:pa,55:pa,56:pa,57:pa,58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:Sa,64:ua,65:ua,66:ua,67:nr,68:[0,.69444,0,0,.72223],69:Ia,70:[0,.69444,0,0,.56945],71:ua,72:Pu,73:fo,74:Sa,75:[0,.69444,0,0,.69445],76:nl,77:[0,.69444,0,0,.875],78:Pu,79:[0,.69444,0,0,.73611],80:nr,81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:Lo,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:ua,89:[0,.69444,.025,0,.66667],90:Ii,91:Gl,93:Gl,94:Oi,95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:Bu,99:jd,100:Bu,101:jd,102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:Bu,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:Ou,111:[0,.44444,0,0,.5],112:Vd,113:Vd,114:[0,.44444,.01389,0,.34167],115:Ac,116:[0,.57143,0,0,.36111],117:Ou,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:An,168:[0,.67937,0,0,.5],176:ua,184:Dc,305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:Oi,711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:Oi,715:Oi,728:Oi,729:[0,.67937,0,0,.27778],730:ua,732:[0,.67659,0,0,.5],733:Oi,915:nl,916:Tc,920:bo,923:Ii,926:ua,928:Pu,931:so,933:bo,934:so,936:bo,937:so,8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:fo,8217:fo,8220:Oi,8221:Oi},"Script-Regular":{32:An,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:An},"Size1-Regular":{32:An,40:Ud,41:Ud,47:Ic,91:Pc,92:Ic,93:Pc,123:$u,125:$u,160:An,710:Xl,732:Xl,770:Xl,771:Xl,8214:[-99e-5,.601,0,0,.77778],8593:Bc,8595:Bc,8657:Ru,8659:Ru,8719:Cl,8720:Cl,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:Yl,8748:Gd,8749:Gd,8750:Yl,8896:Ka,8897:Ka,8898:Ka,8899:Ka,8968:rl,8969:rl,8970:rl,8971:rl,9168:Zc,10216:rl,10217:rl,10752:Nu,10753:Nu,10754:Nu,10756:Ka,10758:Ka},"Size2-Regular":{32:An,40:Fu,41:Fu,47:go,91:Fi,92:go,93:Fi,123:Io,125:Io,160:An,710:Ro,732:Ro,770:Ro,771:Ro,8719:us,8720:us,8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:Oc,8748:zu,8749:zu,8750:Oc,8896:il,8897:il,8898:il,8899:il,8968:$c,8969:$c,8970:$c,8971:$c,10216:Rc,10217:Rc,10752:al,10753:al,10754:al,10756:il,10758:il},"Size3-Regular":{32:An,40:Ku,41:Ku,47:Nc,91:ds,92:Nc,93:ds,123:Jl,125:Jl,160:An,710:ql,732:ql,770:ql,771:ql,8730:[.95003,1.45,0,0,1],8968:Fc,8969:Fc,8970:Fc,8971:Fc,10216:Jl,10217:Jl},"Size4-Regular":{32:An,40:Ql,41:Ql,47:zc,91:Hu,92:zc,93:Hu,123:Kc,125:Kc,160:An,710:ec,732:ec,770:ec,771:ec,8730:[1.25003,1.75,0,0,1],8968:Hc,8969:Hc,8970:Hc,8971:Hc,9115:Wc,9116:tc,9117:Wc,9118:Wc,9119:tc,9120:Wc,9121:jc,9122:Zc,9123:jc,9124:jc,9125:Zc,9126:jc,9127:Xd,9128:Wu,9129:ol,9130:[0,.3,0,0,.88889],9131:Xd,9132:Wu,9133:ol,9143:[.88502,.915,0,0,1.05556],10216:Kc,10217:Kc,57344:Vc,57345:Vc,57680:sl,57681:sl,57682:sl,57683:sl},"Typewriter-Regular":{32:nc,33:Wr,34:Wr,35:Wr,36:So,37:So,38:Wr,39:Wr,40:So,41:So,42:[0,.52083,0,0,.525],43:Zu,44:[.13889,.125,0,0,.525],45:Zu,46:[0,.125,0,0,.525],47:So,48:Wr,49:Wr,50:Wr,51:Wr,52:Wr,53:Wr,54:Wr,55:Wr,56:Wr,57:Wr,58:no,59:[.13889,.43056,0,0,.525],60:Yd,61:[-.19549,.41562,0,0,.525],62:Yd,63:Wr,64:Wr,65:Wr,66:Wr,67:Wr,68:Wr,69:Wr,70:Wr,71:Wr,72:Wr,73:Wr,74:Wr,75:Wr,76:Wr,77:Wr,78:Wr,79:Wr,80:Wr,81:[.13889,.61111,0,0,.525],82:Wr,83:Wr,84:Wr,85:Wr,86:Wr,87:Wr,88:Wr,89:Wr,90:Wr,91:So,92:So,93:So,94:Wr,95:[.09514,0,0,0,.525],96:Wr,97:no,98:Wr,99:no,100:Wr,101:no,102:Wr,103:Ca,104:Wr,105:Wr,106:[.22222,.61111,0,0,.525],107:Wr,108:Wr,109:no,110:no,111:no,112:Ca,113:Ca,114:no,115:no,116:[0,.55358,0,0,.525],117:no,118:no,119:no,120:no,121:Ca,122:no,123:So,124:So,125:So,126:Wr,127:Wr,160:nc,176:Wr,184:[.19445,0,0,0,.525],305:no,567:Ca,711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:Wr,715:Wr,728:Wr,730:Wr,770:Wr,771:Wr,776:Wr,915:Wr,916:Wr,920:Wr,923:Wr,926:Wr,928:Wr,931:Wr,933:Wr,934:Wr,936:Wr,937:Wr,8216:Wr,8217:Wr,8242:Wr,9251:[.11111,.21944,0,0,.525]}},qd=/[\u3040-\u309F]|[\u30A0-\u30FF]|[\u4E00-\u9FAF]|[\uAC00-\uD7AF]/,ll=10,ro=.25,Uc=1.2,hs=.431,ju={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[hs,hs,hs],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:[ro,ro,ro],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]},Gc=[0,.5,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Ds=5,Vu={"\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 fs(a,y){a===void 0&&(a=77);const b=Jd[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 Vu)a=Vu[E].codePointAt(0);else if(qd.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 Xc={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]},cl={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 Ml(a){if(cl[a]){const[ve,we,Re]=cl[a],Je=`<span class="stretchy" style="height:${Re}em"><svg width="100%" height="${Re}em" viewBox="0 0 ${ve} ${we}" 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">${Je}</span>`}const[y,b,E,ee]=Xc[a];let re,ae;const he=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 pe=y.map((ve,we)=>`<span class="${re[we]}" style=height:${he}em><svg width=400em height=${he}em viewBox="0 0 400000 ${E}" preserveAspectRatio="${ae[we]} slice"><path fill="currentcolor" d="${Qd[ve]}"></path></svg></span>`).join("");return`<span style="display:inline-block;height:${he}em;min-width:${b}em;">${pe}</span>`}function eh(a){return Xc[a]?Xc[a][2]/1e3:cl[a][2]}function th(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=Ys(2,16)+re*Ys(2,10)+ae,b++}}y.push(E)}return y}var rc=8205,ic=[[rc,1],[65038,2],[127995,5],[129456,4],[917536,96]],As,kl=[127462,127487];function _l(a){var y;if(As===void 0){As={};for(const b of ic)for(let E=b[0];E<=b[0]+b[1]-1;E++)As[E]=!0}return(y=As[a])!=null?y:!1}function nh(a){return a>=kl[0]&&a<=kl[1]}function rh(a){if(/^[\u0020-\u00FF]*$/.test(a))return a;const y=[],b=th(a);let E=0;for(;E<b.length;){const ee=b[E++],re=b[E];if(re===rc){const ae=E-1;for(E+=2;b[E]===rc;)E+=2;y.push(String.fromCodePoint(...b.slice(ae,E-ae+1)))}else if(_l(re)){const ae=E-1;for(;_l(b[E]);)E+=b[E]===rc?2:1;y.push(String.fromCodePoint(...b.slice(ae,2*E-ae-1)))}else nh(ee)?(E+=1,y.push(String.fromCodePoint(...b.slice(E-2,2)))):y.push(String.fromCodePoint(ee))}return y}var ih=class{constructor(a){this.obeyspaces=!1,this.pos=0,this.s=rh(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 Ts(a,y){var b,E,ee,re;const ae=[];let he=a.next();if(he&&he!=="\\relax"){if(he==="\\noexpand")he=a.next(),he&&ae.push(he);else if(he==="\\obeyspaces")a.obeyspaces=!0;else if(he==="\\bgroup")ae.push("<{>");else if(he==="\\egroup")ae.push("<}>");else if(he==="\\string"){if(he=a.next(),he)if(he.startsWith("\\"))for(const pe of he)ae.push(pe==="\\"?"\\backslash":pe);else he==="<{>"?ae.push("\\{"):he==="<space>"?ae.push("~"):he==="<}>"&&ae.push("\\}")}else if(he==="\\csname"){for(;a.peek()==="<space>";)a.next();let pe="",ve=!1,we=[];do{if(we.length===0)if(/^#[\d?@]$/.test(a.peek())){const Re=a.get().slice(1);we=ps((E=(b=y==null?void 0:y(Re))!=null?b:y==null?void 0:y("?"))!=null?E:"\\placeholder{}",y),he=we[0]}else he=a.next(),we=he?[he]:[];ve=we.length===0,!ve&&he==="\\endcsname"&&(ve=!0,we.shift()),ve||(ve=he==="<$>"||he==="<$$>"||he==="<{>"||he==="<}>"||typeof he=="string"&&he.length>1&&he.startsWith("\\")),ve||(pe+=we.shift())}while(!ve);pe&&ae.push("\\"+pe),ae.push(...we)}else if(he!=="\\endcsname")if(he.length>1&&he.startsWith("#")){const pe=he.slice(1);ae.push(...ps((re=(ee=y==null?void 0:y(pe))!=null?ee:y==null?void 0:y("?"))!=null?re:"\\placeholder{}",y))}else ae.push(he)}return ae}function ps(a,y=null){const b=[];let E="";for(const ae of a.toString().split(/\r?\n/)){E&&b.push(E),E=" ";const he=ae.match(/((?:\\%)|[^%])*/);he!==null&&b.push(he[0])}const ee=new ih(Xe(b.join(""))),re=[];do re.push(...Ts(ee,y));while(!ee.end());return re}function Si(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 ra(a,...y){return console.assert(a.startsWith("\\")),y.length===0?a:Si([a,...y.map(b=>`{${b}}`)])}function Is(a){return Si(a.map(y=>{var b;return(b={"<space>":" ","<$$>":"$$","<$>":"$","<{>":"{","<}>":"}"}[y])!=null?b:y}))}var ah=class Bd{constructor(y){Bd._registry[y]=this}static createAtom(y,b,E){return Bd._registry[y].createAtom(b,Ge(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 oh(y)){const ae=Bd._registry[re[0].mode];ee.push(...ae.serialize(re,b))}return Si(ee)}return Si(ef(y,b))}static getFont(y,b,E){return Bd._registry[y].getFont(b,E)}};ah._registry={};var Co=ah;function oh(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 ya(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 Uu(a,y){var b;const{parent:E}=a[0],ee=E==null?void 0:E.computedStyle.color,re=[];for(const ae of oh(a)){const he=y.defaultMode;for(const pe of ya(ae,"color")){const ve=pe[0].computedStyle,we=Co._registry[pe[0].mode].serialize(pe,Me(Ce({},y),{defaultMode:he==="text"?"text":"math"}));!y.skipStyles&&ve.color&&ve.color!=="none"&&(!E||ee!==ve.color)?re.push(ra("\\textcolor",(b=ve.verbatimColor)!=null?b:ve.color,Si(we))):re.push(Si(we))}}return re}function Qh(a,y){const{parent:b}=a[0],E=b==null?void 0:b.computedStyle.backgroundColor;return ya(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 ra("\\colorbox",(re=ae.verbatimBackgroundColor)!=null?re:ae.backgroundColor,Si(Uu(ee,Me(Ce({},y),{defaultMode:"text"}))))}return Si(Uu(ee,y))})}function ef(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 ya(a,"fontSize")){const ae=re[0].computedStyle.fontSize,he=Qh(re,y);he&&(ae&&ae!=="auto"&&(!b||E!==ae)?ee.push(["","\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"][ae],...he):ee.push(...he))}return ee}function Gu(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 El(a){if(a.length===0)return"ord";const y=Gu(a[0].type),b=Gu(a[a.length-1].type);return y&&y===b?y:"ord"}function Ll(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 or=class Mp{constructor(y,b){var E,ee,re,ae,he;if(typeof y=="number"?this.value=String.fromCodePoint(y):typeof y=="string"?this.value=y:Le(y)?this.children=y.filter(ve=>ve!==null):y&&y instanceof Mp&&(this.children=[y]),this.children)for(const ve of this.children)ve.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 pe=b==null?void 0:b.fontFamily;b!=null&&b.style&&this.value&&(pe=(he=Co.getFont((ae=b.mode)!=null?ae:"math",this,Me(Ce({variant:"normal"},b.style),{letterShapeStyle:b.letterShapeStyle})))!=null?he:void 0),pe||(pe="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,pe)}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=Ll(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=Ll(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"]=Ll(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"]=Ll(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"]=Ll(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=mt(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 vt of this.children)re+=vt.toMarkup();let ae="";if(this.svgBody)ae=Ml(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 vt=(b=this.cssProperties)==null?void 0:b.padding;vt?(ae+=`top:${vt};`,ae+=`left:${vt};`,ae+=`width:calc(100% - 2 * ${vt} );`):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 he="";const pe=this.classes.split(" ");pe.push((E={latex:"ML__raw-latex",placeholder:"ML__placeholder",error:"ML__error"}[this.type])!=null?E:""),this.caret==="latex"&&pe.push("ML__latex-caret"),this.isSelected&&pe.push("ML__selected");const ve=pe.length===1?pe[0]:pe.filter((vt,kt,xn)=>vt.length>0&&xn.indexOf(vt)===kt).join(" ");if(ve.length>0&&(he+=` class="${ve}"`),this.id&&(he+=` data-atom-id=${this.id}`),this.cssId&&(he+=` id="${this.cssId.replace(/ /g,"-")}" `),this.attributes&&(he+=" "+Object.keys(this.attributes).map(vt=>`${vt}="${this.attributes[vt]}"`).join(" ")),this.htmlData){const vt=this.htmlData.split(",");for(const kt of vt){const xn=kt.match(/([^=]+)=(.+$)/);if(xn){const ir=xn[1].trim().replace(/ /g,"-");ir&&(he+=` data-${ir}="${xn[2]}" `)}else{const ir=kt.trim().replace(/ /g,"-");ir&&(he+=` data-${ir} `)}}}const we=(ee=this.cssProperties)!=null?ee:{};this.hasExplicitWidth&&we.width===void 0&&(we.width=`${Math.ceil(this._width*100)/100}em`);const Re=Object.keys(we).map(vt=>`${vt}:${we[vt]}`);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 vt=this.htmlStyle.split(";");let kt="";for(const xn of vt){const ir=xn.match(/([^=]+):(.+$)/);if(ir){const yn=ir[1].trim().replace(/ /g,"-");yn&&(kt+=`${yn}:${ir[2]};`)}}kt&&(he+=` style="${kt}"`)}Re.length>0&&(he+=` style="${Re.join(";")}"`);let Je="";return he.length>0||ae.length>0?Je=`<span${he}>${re}${ae}</span>`:Je=re,this.caret==="text"?Je+='<span class="ML__text-caret"></span>':this.caret==="math"&&(Je+='<span class="ML__caret"></span>'),Je}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 pe of["border","border-left","border-right","border-right-width","left","margin","margin-left","margin-right","padding","position","width"])if(y.cssProperties&&pe in y.cssProperties||this.cssProperties&&pe 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 pe of Object.keys(this.cssProperties))if(this.cssProperties[pe]!==y.cssProperties[pe])return!1}const ae=this.classes.trim().replace(/\s+/g," ").split(" "),he=y.classes.trim().replace(/\s+/g," ").split(" ");if(ae.length!==he.length)return!1;ae.sort(),he.sort();for(const[pe,ve]of ae.entries())if(ve==="vertical-separator"||ve!==he[pe])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 Xu(a){if(!a||a.length===0)return[];a[0].children=Xu(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=Xu(a[b].children),y.push(a[b]));return y}function Yc(a){return a.children&&(a.children=Xu(a.children)),a}function Jc(a,y){if(!a)return new or(null,y);const b=new or(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 or(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 or(E,Me(Ce({},y),{type:"lift"}))}function No(a){const y=eh(a)/2,b=new or(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=fs(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,he)=>ae+he.width,0),a.maxFontSize=re}}function qc(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 he=y[ae],pe=-he.shift-re-he.box.depth,ve=pe-(b.box.height+b.box.depth);re=re+pe,E.push(ve),E.push(he),b=he}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 oc(a){var y;const[b,E]=qc(a);if(!b)return[[],0,0];const ee=new or(null,{classes:"pstrut"});let re=0;for(const kt of b)if(typeof kt!="number"){const xn=kt.box;re=Math.max(re,xn.maxFontSize,xn.height)}re+=2,ee.height=re,ee.setStyle("height",re,"em");const ae=[];let he=E,pe=E,ve=E,we=0;for(const kt of b){if(typeof kt=="number")ve+=kt;else{const xn=kt.box,ir=(y=kt.classes)!=null?y:[],yn=new or([ee,xn],{classes:ir.join(" "),style:kt.style});xn.setStyle("height",xn.height+xn.depth,"em"),xn.setStyle("display","inline-block"),yn.setStyle("top",-re-ve-xn.depth,"em"),kt.marginLeft&&yn.setStyle("margin-left",kt.marginLeft,"em"),kt.marginRight&&yn.setStyle("margin-right",kt.marginRight,"em"),ae.push(yn),ve+=xn.height+xn.depth,we=Math.max(we,yn.width)}he=Math.min(he,ve),pe=Math.max(pe,ve)}ae.forEach(kt=>{kt.softWidth=we});const Re=new or(ae,{classes:"vlist"});if(Re.softWidth=we,Re.height=pe,Re.setStyle("height",pe,"em"),he>=0)return[[new or(Re,{classes:"vlist-r"})],pe,-he];const Je=new or(new or(null),{classes:"vlist"});Je.height=-he,Je.setStyle("height",-he,"em");const vt=new or(8203,{classes:"vlist-s",maxFontSize:0});return vt.softWidth=0,vt.height=0,vt.depth=0,[[new or([Re,vt],{classes:"vlist-r"}),new or(Je,{classes:"vlist-r"})],pe,-he]}var Yi=class extends or{constructor(a,y){var b;const[E,ee,re]=oc(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,he)=>Math.max(ae,he.width),0)}};function tf(a,y){var b,E,ee,re,ae;const he=a.metrics,pe=new or(y.base),ve=(b=y.baseShift)!=null?b:0,we=(E=y.slant)!=null?E:0;let Re=0,Je=0;y.above&&(Re=(ee=y.aboveShift)!=null?ee:Math.max(he.bigOpSpacing1,he.bigOpSpacing3-y.above.depth)),y.below&&(Je=(re=y.belowShift)!=null?re:Math.max(he.bigOpSpacing2,he.bigOpSpacing4-y.below.height));let vt=null;if(y.below&&y.above){const kt=he.bigOpSpacing5+y.below.height+y.below.depth+Je+pe.depth+ve;vt=new Yi({bottom:kt,children:[he.bigOpSpacing5,{box:y.below,marginLeft:-we,classes:["ML__center"]},Je,{box:pe,classes:["ML__center"]},Re,{box:y.above,marginLeft:we,classes:["ML__center"]},he.bigOpSpacing5]}).wrap(a)}else if(y.below&&!y.above)vt=new Yi({top:pe.height-ve,children:[he.bigOpSpacing5,{box:y.below,marginLeft:-we,classes:["ML__center"]},Je,{box:pe,classes:["ML__center"]}]}).wrap(a);else if(!y.below&&y.above){const kt=pe.depth+ve;vt=new Yi({bottom:kt,children:[{box:pe,classes:["ML__center"]},Re,{box:y.above,marginLeft:we,classes:["ML__center"]},he.bigOpSpacing5]}).wrap(a)}else{const kt=pe.depth+ve;vt=new Yi({bottom:kt,children:[{box:pe},he.bigOpSpacing5]}).wrap(a)}return new or(vt,{type:(ae=y.type)!=null?ae:"op"})}var Yu=7,ms=6,sc=5,Ps=4,ul=3,io=2,Po=1,Ha=0,Uo=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(ju).reduce((ee,re)=>Me(Ce({},ee),{[re]:ju[re][E]}),{})}getFontSize(a){return Math.max(1,a+this.sizeDelta)}get sup(){return Go[[Ha,Po,Ha,Po,io,ul,io,ul][this.id]]}get sub(){return Go[[Ha,Ha,Ha,Ha,io,io,io,io][this.id]]}get fracNum(){return Go[[Ha,Po,Ha,Po,io,ul,Ps,sc][this.id]]}get fracDen(){return Go[[Ha,Ha,Ha,Ha,io,io,Ps,Ps][this.id]]}get cramp(){return Go[[Ha,Ha,io,io,Ps,Ps,ms,ms][this.id]]}get isTight(){return this.sizeDelta<0}},dl={7:new Uo(Yu,0,!1),6:new Uo(ms,0,!0),5:new Uo(sc,0,!1),4:new Uo(Ps,0,!0),3:new Uo(ul,-3,!1),2:new Uo(io,-3,!0),1:new Uo(Po,-4,!1),0:new Uo(Ha,-4,!0)},Go=Me(Ce({},dl),{displaystyle:dl[Yu],textstyle:dl[sc],scriptstyle:dl[ul],scriptscriptstyle:dl[Po]});function Dl(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:ll,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=Ys(10,y);return Math.round(a.dimension/ll*E*ee)/ee}return a.dimension*E}function Ju(a,y){if(a===null)return 0;const b=Dl(a)/ll;if(Number.isFinite(y)){const E=Ys(10,y);return Math.round(b*E)/E}return b}function qu(a){var y;return`${a.dimension}${(y=a.unit)!=null?y:"pt"}`}function sh(a){let y=qu(a.glue);return a.grow&&a.grow.dimension!==0&&(y+=` plus ${qu(a.grow)}`),a.shrink&&a.shrink.dimension!==0&&(y+=` minus ${qu(a.shrink)}`),y}function Ma(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=sh(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 Xo(a,y){return a==null?null:"number"in a?Me(Ce({},a),{number:a.number*y}):"register"in a?"factor"in a&&a.factor?Me(Ce({},a),{factor:a.factor*y}):Me(Ce({},a),{factor:y}):"dimension"in a?Me(Ce({},a),{dimension:a.dimension*y}):"glue"in a?a.shrink&&a.grow?{glue:Xo(a.glue,y),shrink:Xo(a.shrink,y),grow:Xo(a.grow,y)}:a.shrink?{glue:Xo(a.glue,y),shrink:Xo(a.shrink,y)}:a.grow?{glue:Xo(a.glue,y),grow:Xo(a.grow,y)}:{glue:Xo(a.glue,y)}:null}var nf={"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 Al(){return Ce({},nf)}function Qc(){return{registers:Al(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"\u25A2",letterShapeStyle:nt.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:jt,backgroundColorMap:st,getMacro:a=>Zt(a,On())}}var Di=class kp{constructor(y,b){var E,ee,re,ae,he,pe,ve,we,Re,Je,vt,kt,xn,ir,yn;let Nn;y!=null&&y.parent?(this.parent=y.parent,Nn=y.parent,this.registers={}):(Nn=Ce(Ce({},Qc()),(E=y==null?void 0:y.from)!=null?E:{}),this.registers=Nn.registers),Nn.atomIdsSettings&&(this.atomIdsSettings=Ce({},Nn.atomIdsSettings)),this.renderPlaceholder=Nn.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=Nn.letterShapeStyle,this.minFontScale=Nn.minFontScale,b!=null&&b.color&&b.color!=="none"?this.color=b.color:this.color=(pe=(he=this.parent)==null?void 0:he.color)!=null?pe:"",b!=null&&b.backgroundColor&&b.backgroundColor!=="none"?this.backgroundColor=b.backgroundColor:this.backgroundColor=(we=(ve=this.parent)==null?void 0:ve.backgroundColor)!=null?we:"",b!=null&&b.fontSize&&b.fontSize!=="auto"&&b.fontSize!==((Re=this.parent)==null?void 0:Re.size)?this.size=b.fontSize:this.size=(vt=(Je=this.parent)==null?void 0:Je.size)!=null?vt:Ds;let dr=(xn=(kt=this.parent)==null?void 0:kt.mathstyle)!=null?xn:Go.displaystyle;if(typeof(y==null?void 0:y.mathstyle)=="string"){if(Nn instanceof kp)switch(y.mathstyle){case"cramp":dr=dr.cramp;break;case"superscript":dr=dr.sup;break;case"subscript":dr=dr.sub;break;case"numerator":dr=dr.fracNum;break;case"denominator":dr=dr.fracDen;break}switch(y.mathstyle){case"textstyle":dr=Go.textstyle;break;case"displaystyle":dr=Go.displaystyle;break;case"scriptstyle":dr=Go.scriptstyle;break;case"scriptscriptstyle":dr=Go.scriptscriptstyle;break;case"":case"auto":break}}this.mathstyle=dr,this.smartFence=Nn.smartFence,this.placeholderSymbol=Nn.placeholderSymbol,this.colorMap=(ir=Nn.colorMap)!=null?ir:Kn=>Kn,this.backgroundColorMap=(yn=Nn.backgroundColorMap)!=null?yn:Kn=>Kn,this.getMacro=Nn.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===Yu||this.mathstyle.id===ms}get isCramped(){return this.mathstyle.cramped}get isTight(){return this.mathstyle.isTight}get metrics(){return this.mathstyle.metrics}get effectiveFontSize(){return Math.max(Gc[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 Ju(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?Me(Ce({},re),{dimension:E*re.dimension}):"glue"in re?Me(Ce({},re),{glue:Me(Ce({},re.glue),{dimension:E*re.glue.dimension}),shrink:re.shrink?Me(Ce({},re.shrink),{dimension:E*re.shrink.dimension}):void 0,grow:re.grow?Me(Ce({},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:Dl(E,b)/ll}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}},Tl=["body","above","below","superscript","subscript"];function gs(a){return typeof a=="string"&&Tl.includes(a)}function lc(a){return a!==void 0&&Array.isArray(a)&&a.length===2}var Pn=class vl{constructor(y){var b,E,ee,re,ae,he;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=Ce({},y.style),this.displayContainsHighlight=(re=y.displayContainsHighlight)!=null?re:!1,this.captureSelection=(ae=y.captureSelection)!=null?ae:!1,this.skipBoundary=(he=y.skipBoundary)!=null?he:!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=lh(b),ae=[];for(const pe of re){const ve=pe[0].style,we=ch(y,pe,{style:{color:ve.color,backgroundColor:ve.backgroundColor,fontSize:ve.fontSize}});we&&ae.push(we)}if(ae.length===0)return null;const he=((ee=E==null?void 0:E.classes)!=null?ee:"").trim();return ae.length===1&&!he&&!(E!=null&&E.type)?ae[0].wrap(y):new or(ae,{classes:he,type:E==null?void 0:E.type}).wrap(y)}static serialize(y,b){return Co.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 vl({type:"mord",value:y,mode:"math"}):new vl(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=Ce({},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=ed(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=Ge(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):this.body&&this.command?Si([ra(this.command,this.bodyToLatex(y)),this.supsubToLatex(y)]):this.body?Si([this.bodyToLatex(y),this.supsubToLatex(y)]):!this.value||this.value==="\u200B"?"":this.command}bodyToLatex(y){var b;return Co.serialize(this.body,Me(Ce({},y),{defaultMode:(b=y.defaultMode)!=null?b:this.latexMode}))}aboveToLatex(y){return Co.serialize(this.above,y)}belowToLatex(y){return Co.serialize(this.below,y)}supsubToLatex(y){let b="";if(y=Me(Ce({},y),{defaultMode:"math"}),this.branch("subscript")!==void 0){const E=Co.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=Co.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(gs(y)&&this._branches)return this._branches[y]}get branches(){if(!this._branches)return[];const y=[];for(const b of Tl)this._branches[b]&&y.push(b);return y}createBranch(y){return console.assert(gs(y)),gs(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 lc(this.parentBranch)?this.parentBranch[0]:-1}get col(){return lc(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=Ce(Ce({},(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=Ce(Ce({},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(gs(b)),!gs(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 vl({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(gs(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 Tl)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=Ge(this.command,this.mode);if(b!=null&&b.render)return b.render(this,y);const E=new Di({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 he=null,pe=null;const ve=(E=b.isCharacterBox)!=null?E:this.isCharacterBox();let we=0;if(re){const xn=new Di({parent:y,mathstyle:"superscript"});he=vl.createBox(xn,re),ve||(we=ee.height-y.metrics.supDrop*xn.scalingFactor)}let Re=0;if(ae){const xn=new Di({parent:y,mathstyle:"subscript"});pe=vl.createBox(xn,ae),ve||(Re=ee.depth+y.metrics.subDrop*xn.scalingFactor)}let Je;y.isDisplayStyle?Je=y.metrics.sup1:y.isCramped?Je=y.metrics.sup3:Je=y.metrics.sup2;const vt=.5/ll/y.scalingFactor;let kt=null;if(pe&&he){we=Math.max(we,Je,he.depth+.25*y.metrics.xHeight),Re=Math.max(Re,y.metrics.sub2);const xn=y.metrics.defaultRuleThickness;if(we-he.depth-(pe.height-Re)<4*xn){Re=4*xn-(we-he.depth)+pe.height;const yn=.8*y.metrics.xHeight-(we-he.depth);yn>0&&(we+=yn,Re-=yn)}const ir=this.isExtensibleSymbol&&ee.italic?-ee.italic:0;kt=new Yi({individualShift:[{box:pe,shift:Re,marginLeft:ir},{box:he,shift:-we}]}).wrap(y)}else pe&&!he?(Re=Math.max(Re,y.metrics.sub1,pe.height-.8*hs),kt=new Yi({shift:Re,children:[{box:pe,marginRight:vt,marginLeft:this.isCharacterBox()?-ee.italic:0}]})):!pe&&he&&(we=Math.max(we,Je,he.depth+.25*hs),kt=new Yi({shift:-we,children:[{box:he,marginRight:vt}]}));return new or([ee,new or(kt,{caret:this.caret,isSelected:this.isSelected,classes:"msubsup"})],{type:b.type})}attachLimits(y,b){const E=this.superscript?vl.createBox(new Di({parent:y,mathstyle:"superscript"},this.style),this.superscript):null,ee=this.subscript?vl.createBox(new Di({parent:y,mathstyle:"subscript"},this.style),this.subscript):null;return!E&&!ee?b.base.wrap(y):tf(y,Me(Ce({},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 he=(E=this.value)!=null?E:this.body,pe=(ee=b==null?void 0:b.boxType)!=null?ee:Gu(this.type);let ve=(re=b==null?void 0:b.classes)!=null?re:"";this.mode==="text"&&(ve+=" ML__text");const we=typeof he=="string"||he===void 0?new or(he!=null?he:null,{type:pe,isSelected:this.isSelected,mode:this.mode,maxFontSize:y.scalingFactor,style:Me(Ce({variant:"normal"},this.style),{fontSize:Math.max(1,y.size+y.mathstyle.sizeDelta)}),letterShapeStyle:y.letterShapeStyle,classes:ve}):(ae=vl.createBox(y,he,{type:pe,classes:ve}))!=null?ae:new or(null);return y.isTight&&(we.isTight=!0),(this.mode!=="math"||this.style.variant==="main")&&(we.italic=0),we.right=we.italic,this.bind(y,we),this.caret&&!this.superscript&&!this.subscript&&(we.caret=this.caret),we}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 lh(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 ch(a,y,b){var E,ee,re,ae,he;if(!y||y.length===0)return null;const pe=new Di({parent:a},b.style),ve=!((E=pe.atomIdsSettings)!=null&&E.groupNumbers);let we=[];if(y.length===1){const Je=y[0],vt=Je.render(pe);vt&&(ve&&Je.isSelected&&vt.selected(!0),we=[vt])}else{let Je="",vt=!0;for(const kt of y){(ee=pe.atomIdsSettings)!=null&&ee.groupNumbers&&Je&&(vt&&kt.isDigit()||!vt&&Qu(kt))&&(pe.atomIdsSettings.overrideID=Je);const xn=kt.render(pe);pe.atomIdsSettings&&(pe.atomIdsSettings.overrideID=void 0),xn&&((re=pe.atomIdsSettings)!=null&&re.groupNumbers&&((kt.isDigit()||Qu(kt))&&(!Je||vt!==kt.isDigit())&&(vt=kt.isDigit(),Je=(ae=kt.id)!=null?ae:""),Je&&(!(kt.isDigit()||Qu(kt))||!kt.hasEmptyBranch("superscript")||!kt.hasEmptyBranch("subscript"))&&(Je="")),ve&&kt.isSelected&&xn.selected(!0),we.push(xn))}}if(we.length===0)return null;const Re=new or(we,Me(Ce({isTight:pe.isTight},b),{type:(he=b.type)!=null?he:"lift"}));return Re.isSelected=we.every(Je=>Je.isSelected),Re.wrap(pe)}function Qu(a){return a.mode==="text"}function ed(a){return a.map(y=>y===null?"<null>":Array.isArray(y)&&y[0]instanceof Pn?{atoms:y.map(b=>b.toJson())}:typeof y=="object"&&"group"in y?{group:y.group.map(b=>b.toJson())}:y)}var vs=class _p extends Pn{constructor(y,b,E){super({type:"text",command:y,mode:"text",displayContainsHighlight:!0}),this.value=b,this.verbatimLatex=b,this.applyStyle(E)}static fromJson(y){return new _p(y.command,y.value,y.style)}render(y){const b=this.createBox(y);return this.caret&&(b.caret=this.caret),b}_serialize(y){var b;return(b=this.verbatimLatex)!=null?b:en("text",this.value.codePointAt(0))}};function cc(a,y){if(a.direction===y.direction){const b=a.ranges.length;if(y.ranges.length===b){let E=0;for(;E<b&&rf(a.ranges[E],y.ranges[E])==="equal";)E++;return E===b?"equal":"different"}}return"different"}function rf(a,y){return a[0]===y[0]&&a[1]===y[1]?"equal":"different"}function Wa(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 Bs(a){return typeof a=="number"&&!Number.isNaN(a)}function eu(a){return Array.isArray(a)&&a.length===2}function tu(a){return a!=null&&typeof a=="object"&&"ranges"in a&&Array.isArray(a.ranges)}function af(a,y){const b=a.at(y);let E;if(b){E=b.mode;let ee=b.parent;for(;!E&ⅇ)ee&&(E=ee.mode),ee=ee.parent}return E}function uh(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,he=!1,pe=!1,ve=!1,we=!1,Re=!1,Je=!1,vt=!1,kt=!1,xn=!1,ir=!1,yn=a[0],Nn=0;for(;yn!=null&&yn.type&&/^(subsup|placeholder)$/.test(yn.type);)Nn+=1,yn=a[Nn];return b=!yn||yn.type==="first",yn&&(xn=yn.mode==="text",E=!xn&&yn.type==="mord"&&de.test(yn.value),ee=!xn&&yn.type==="mord"&&/\d+$/.test(yn.value),re=!xn&&yn.isFunction,ae=yn.type==="genfrac",he=yn.type==="surd",pe=yn.type==="mbin",ve=yn.type==="mrel",we=yn.type==="mop"||yn.type==="operator"||yn.type==="extensible-symbol",Re=yn.type==="mpunct"||yn.type==="minner",Je=yn.type==="array",vt=yn.type==="mopen",kt=yn.type==="mclose"||yn.type==="leftright",ir=yn.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")&&he||y.after.includes("binop")&&pe||y.after.includes("relop")&&ve||y.after.includes("operator")&&we||y.after.includes("punct")&&Re||y.after.includes("array")&&Je||y.after.includes("openfence")&&vt||y.after.includes("closefence")&&kt||y.after.includes("text")&&xn||y.after.includes("space")&&ir?y.value:""}function td(a,y,b){return b?uh(a,b[y]):""}var dh={"&":"\\&","%":"\\%",$:"\\$","''":"^{\\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 uc(a,y){var b;let E=(b=y==null?void 0:y.format)!=null?b:"auto";return E==="auto"&&([E,a]=fh(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",Ja(a,{inlineShortcuts:y==null?void 0:y.inlineShortcuts})]):["latex",a]}function Ja(a,y){var b,E,ee;if(!a)return"";let re=!1,ae;const he=(b=y.inlineShortcuts)!=null?b:dh;if(!re&&(a.startsWith("^")||a.startsWith("_"))&&(ae=Os(a.slice(1),{inlineShortcuts:he,noWrap:!0}),a=a[0]+"{"+ae.match+"}",a+=Ja(ae.rest,y),re=!0),re||(ae=a.match(/^(sqrt|\u221A)(.*)/),ae&&(ae=Os(ae[2],{inlineShortcuts:he,noWrap:!0}),a="\\sqrt{"+((E=ae.match)!=null?E:"\\placeholder{}")+"}",a+=Ja(ae.rest,y),re=!0)),re||(ae=a.match(/^(\\cbrt|\u221B)(.*)/),ae&&(ae=Os(ae[2],{inlineShortcuts:he,noWrap:!0}),a="\\sqrt[3]{"+((ee=ae.match)!=null?ee:"\\placeholder{}")+"}",a+=Ja(ae.rest,y),re=!0)),re||(ae=a.match(/^abs(.*)/),ae&&(ae=Os(ae[1],{inlineShortcuts:he,noWrap:!0}),a="\\left|"+ae.match+"\\right|",a+=Ja(ae.rest,y),re=!0)),re||(ae=a.match(/^["”“](.*?)["”“](.*)/),ae&&(a="\\text{"+ae[1]+"}",a+=Ja(ae[2],y),re=!0)),re||(ae=a.match(/^([^a-zA-Z\(\{\[\_\^\\\s"]+)(.*)/),ae&&(a=hh(ae[1],he),a+=Ja(ae[2],y),re=!0)),!re&&/^([fgh])[^a-zA-Z]/.test(a)&&(ae=Os(a.slice(1),{inlineShortcuts:he,noWrap:!0}),a=a[1]==="("?a[0]+"\\left("+ae.match+"\\right)":a[0]+ae.match,a+=Ja(ae.rest,y),re=!0),re||(ae=a.match(/^([a-zA-Z]+)(.*)/),ae&&(a=hh(ae[1],he),a+=Ja(ae[2],y),re=!0)),!re)if(ae=Os(a,{inlineShortcuts:he,noWrap:!0}),ae.match&&ae.rest[0]==="/"){const pe=Os(ae.rest.slice(1),{inlineShortcuts:he,noWrap:!0});pe.match&&(a="\\frac{"+ae.match+"}{"+pe.match+"}"+Ja(pe.rest,y)),re=!0}else ae.match&&(a=a.startsWith("(")?"\\left("+ae.match+"\\right)"+Ja(ae.rest,y):ae.match+Ja(ae.rest,y),re=!0);return re||(ae=a.match(/^(\s+)(.*)$/),ae&&(a=" "+Ja(ae[2],y),re=!0)),a}function Os(a,y){let b="";a=a.trim();let E=a,ee=a.charAt(0),re={"(":")","{":"}","[":"]"}[ee];if(re){let ae=1,he=1;for(;he<a.length&&ae>0;)a[he]===ee&&ae++,a[he]===re&&ae--,he++;ae===0?(y.noWrap&&ee==="("?b=Ja(a.substring(1,he-1),y):(ee==="{"&&re==="}"&&(ee="\\{",re="\\}"),b="\\left"+ee+Ja(a.substring(1,he-1),y)+"\\right"+re),E=a.slice(Math.max(0,he))):(b=a.substring(1,he),E="")}else{let ae=a.match(/^([a-zA-Z]+)/);if(ae){let he=td(null,a,y.inlineShortcuts);if(he)return he=he.replace("_{#?}",""),he=he.replace("^{#?}",""),{match:he,rest:a.slice(he.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 hh(a,y){let b=td(null,a,y);return b?(b=b.replace("_{#?}",""),b=b.replace("^{#?}",""),b+=" "):b=a,b}var nd=[["\\[","\\]"],["\\(","\\)"],["$$","$$"],["$","$"],["\\begin{math}","\\end{math}"],["\\begin{displaymath}","\\end{displaymath}"],["\\begin{equation}","\\end{equation}"],["\\begin{equation*}","\\end{equation*}"]];function $s(a){const y=a.trim();for(const b of nd)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 fh(a){if(a=a.trim(),a.length<=1)return["latex",a];let y;return[y,a]=$s(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 nu="$$",of="$$",sf=(a,y,b)=>(nd.some(E=>y.startsWith(E[0])&&y.endsWith(E[1]))||(y=`${nu} ${y} ${of}`),y),ph=class qh{constructor(y){qh._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)?qh._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]:Wa(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]:Wa(ee.selection);let ae=ee.getAtoms(re);if(ae.every(he=>he.mode==="text"||!he.mode))b.clipboardData.setData("text/plain",ae.filter(he=>he instanceof vs).map(he=>he.value).join(""));else if(ae.every(he=>he.mode==="latex"))b.clipboardData.setData("text/plain",ee.getAtoms(re,{includeChildren:!0}).map(he=>{var pe;return(pe=he.value)!=null?pe:""}).join(""));else{let he;ae.length===1&&ae[0].verbatimLatex!==void 0?he=ae[0].verbatimLatex:he=ee.getValue(re,"latex-expanded"),b.clipboardData.setData("application/x-latex",he);try{b.clipboardData.setData("text/plain",y.options.onExport(y,he,re))}catch(pe){}if(ae.length===1){const pe=ae[0];(pe.type==="root"||pe.type==="group")&&(ae=pe.body.filter(ve=>ve.type!=="first"))}try{b.clipboardData.setData("application/json+mathlive",JSON.stringify(ae.map(pe=>pe.toJson())))}catch(pe){}if((E=window[Symbol.for("io.cortexjs.compute-engine")])!=null&&E.ComputeEngine){const pe=window.MathfieldElement.computeEngine;if(pe)try{const ve=pe.jsonSerializationOptions;pe.jsonSerializationOptions={metadata:["latex"]};const we=pe.parse(ee.getValue(re,"latex-unstyled"));pe.jsonSerializationOptions=ve;const Re=JSON.stringify(we.json);Re&&b.clipboardData.setData("application/json",Re)}catch(ve){}}}b.preventDefault()}static insert(y,b,E={}){var ee;const re=E.mode==="auto"?y.mode:(ee=E.mode)!=null?ee:y.mode;return qh._modes[re].insert(y,b,E)}onPaste(y,b){return!1}insert(y,b,E){return!1}};ph._modes={};var si=ph,lf=[{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","^"]}],rd={"\\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 Fo(a){var y;return((y=a.element)==null?void 0:y.mathfield)===a}function zo(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 Rs(a){const y=zo(a);if(!y)return null;const b=y.getBoundingClientRect();return{x:b.right,y:b.bottom,height:b.height}}function id(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 ad(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),he=Math.ceil(y.top-E.top);return{left:ae,right:ae+ee,top:he,bottom:he+re}}function od(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=od(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 Il(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?od(re):null,a.atomBoundsCache&&(ee?a.atomBoundsCache.set(y.id,ee):a.atomBoundsCache.delete(y.id)),ee!=null?ee:null}function mh(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 pe=Math.floor(re.getBoundingClientRect().width)/ae;pe=isNaN(pe)?1:pe;const ve=ad(a,Il(a,ee),pe);if(ve){const we=id(ee);if(E.has(we)){const Re=E.get(we);E.set(we,{left:Math.min(Re.left,ve.left),right:Math.max(Re.right,ve.right),top:Math.min(Re.top,ve.top),bottom:Math.max(Re.bottom,ve.bottom)})}else E.set(we,ve)}}return[...E.values()]}function sd(a,y){return a.model.selection.ranges.reduce((b,E)=>b.concat(...mh(a,E,y)),[])}function ld(a,y){return a==="*"||y==="none"?!0:y==="same-origin"?!window.origin||a===window.origin:typeof y=="function"?y(a):!1}function ru(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 gh=`@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;
|
|
|
}
|
|
|
`,Vi=`.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);
|
|
|
}
|
|
|
`,vh=`#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);
|
|
|
}
|
|
|
`,cf=`/* 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;
|
|
|
}
|
|
|
`,Pl=`/* 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);*/
|
|
|
}
|
|
|
`,uf=`.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));
|
|
|
}
|
|
|
`,iu=`: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;
|
|
|
}
|
|
|
`,df=`.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;
|
|
|
}
|
|
|
`,Ji;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=Vi;break;case"mathfield":y=gh;break;case"environment-popover":y=vh;break;case"suggestion-popover":y=cf;break;case"keystroke-caption":y=Pl;break;case"virtual-keyboard":y=uf;break;case"ui":y=iu;break;case"menu":y=df;break;default:debugger}return y}function Bl(a){return Ji||(Ji={}),Ji[a]||(Ji[a]=new CSSStyleSheet,Ji[a].replaceSync(hl(a))),Ji[a]}var ys;function Bo(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(ys||(ys={}),((y=ys[a])!=null?y:0)!==0)ys[a]+=1;else{const b=Bl(a);document.adoptedStyleSheets=[...document.adoptedStyleSheets,b],ys[a]=1}}function x(a){if("adoptedStyleSheets"in document&&ys!=null&&ys[a]&&(ys[a]-=1,ys[a]<=0)){const y=Ji[a];document.adoptedStyleSheets=document.adoptedStyleSheets.filter(b=>b!==y)}}var z=class Ep extends Pn{constructor(y){var b;super(Me(Ce({},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 Ep(y)}toJson(){return Me(Ce({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(y){var b;const E=new Di({parent:y,mathstyle:"cramp"},this.style),ee=(b=Pn.createBox(E,this.body))!=null?b:new or("\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,hs),he;if(this.svgAccent)he=No(this.svgAccent),ae=E.metrics.bigOpSpacing1-ae;else if(this.accent){const ve=new or(this.accent,{fontFamily:"Main-Regular"});ve.italic=0;const we=this.accent===8407?" ML__accent-vec":"";he=new or(new or(ve),{classes:"ML__accent-body"+we})}he=new Yi({shift:0,children:[{box:new or(ee)},-ae,{box:he,marginLeft:ee.left+2*re,classes:["ML__center"]}]});const pe=new or(he,{type:"lift"});return this.caret&&(pe.caret=this.caret),this.bind(E,pe.wrap(E)),this.attachSupsub(E,{base:pe})}},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 ce(a,y,b,E){var ee;const ae=new or(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)*ro),ae}function ge(a,y,b,E,ee){var re,ae;const he=new Di({parent:E,mathstyle:"textstyle"},ee==null?void 0:ee.style),pe=new or(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(he);return b&&pe.setTop((1-he.scalingFactor)*ro),pe}function Se(a,y,b,E,ee){var re;let ae,he,pe,ve;ae=pe=ve=ie(a),he=null;let we="Size1-Regular";a==="\\vert"||a==="\\lvert"||a==="\\rvert"||a==="\\mvert"||a==="\\mid"?pe=ae=ve=8739:a==="\\Vert"||a==="\\lVert"||a==="\\rVert"||a==="\\mVert"||a==="\\|"?pe=ae=ve=8741:a==="\\uparrow"?pe=ve=9168:a==="\\Uparrow"?pe=ve=8214:a==="\\downarrow"?ae=pe=9168:a==="\\Downarrow"?ae=pe=8214:a==="\\updownarrow"?(ae=8593,pe=9168,ve=8595):a==="\\Updownarrow"?(ae=8657,pe=8214,ve=8659):a==="["||a==="\\lbrack"?(ae=9121,pe=9122,ve=9123,we="Size4-Regular"):a==="]"||a==="\\rbrack"?(ae=9124,pe=9125,ve=9126,we="Size4-Regular"):a==="\\lfloor"||a==="\u230A"?(pe=ae=9122,ve=9123,we="Size4-Regular"):a==="\\lceil"||a==="\u2308"?(ae=9121,pe=ve=9122,we="Size4-Regular"):a==="\\rfloor"||a==="\u230B"?(pe=ae=9125,ve=9126,we="Size4-Regular"):a==="\\rceil"||a==="\u2309"?(ae=9124,pe=ve=9125,we="Size4-Regular"):a==="("||a==="\\lparen"?(ae=9115,pe=9116,ve=9117,we="Size4-Regular"):a===")"||a==="\\rparen"?(ae=9118,pe=9119,ve=9120,we="Size4-Regular"):a==="\\{"||a==="\\lbrace"?(ae=9127,he=9128,ve=9129,pe=9130,we="Size4-Regular"):a==="\\}"||a==="\\rbrace"?(ae=9131,he=9132,ve=9133,pe=9130,we="Size4-Regular"):a==="\\lgroup"||a==="\u27EE"?(ae=9127,ve=9129,pe=9130,we="Size4-Regular"):a==="\\rgroup"||a==="\u27EF"?(ae=9131,ve=9133,pe=9130,we="Size4-Regular"):a==="\\lmoustache"||a==="\u23B0"?(ae=9127,ve=9133,pe=9130,we="Size4-Regular"):a==="\\rmoustache"||a==="\u23B1"?(ae=9131,ve=9129,pe=9130,we="Size4-Regular"):a==="\\surd"?(ae=57345,ve=9143,pe=57344,we="Size4-Regular"):a==="\\ulcorner"?(ae=9484,pe=ve=32):a==="\\urcorner"?(ae=9488,pe=ve=32):a==="\\llcorner"?(ve=9492,pe=ae=32):a==="\\lrcorner"&&(ae=9496,pe=ae=32);const Re=fs(ae,we),Je=Re.height+Re.depth,vt=fs(pe,we),kt=vt.height+vt.depth,xn=fs(ve,we),ir=xn.height+xn.depth;let yn=0,Nn=1;if(he!==null){const Ua=fs(he,we);yn=Ua.height+Ua.depth,Nn=2}const dr=Je+ir+yn,Kn=Math.max(0,Math.ceil((y-dr)/(Nn*kt))),Zr=dr+Kn*Nn*kt;let qr=ro;b&&(qr=qr*E.scalingFactor);const Vr=Zr/2-qr,Ti=.008,Ui=[];Ui.push({box:new or(ve,{fontFamily:we})}),Ui.push(-Ti);const xr=new or(pe,{fontFamily:we});if(he===null)for(let Ua=0;Ua<Kn;Ua++)Ui.push({box:xr});else{for(let Ua=0;Ua<Kn;Ua++)Ui.push({box:xr});Ui.push(-Ti),Ui.push({box:new or(he,{fontFamily:we})}),Ui.push(-Ti);for(let Ua=0;Ua<Kn;Ua++)Ui.push({box:xr})}Ui.push(-Ti),Ui.push({box:new or(ae,{fontFamily:we})});let Wo="";we==="Size1-Regular"?Wo=" delim-size1":we==="Size4-Regular"&&(Wo=" delim-size4");const js=new Yi({bottom:Vr,children:Ui},{classes:Wo});return new or(js,Me(Ce({},ee!=null?ee:{}),{classes:((re=ee==null?void 0:ee.classes)!=null?re:"")+" ML__delim-mult"}))}var Ee=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"]),gt=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),_t=[0,1.2,1.8,2.4,3];function fn(a,y,b,E){return a===void 0||a==="."?Kr(b,E.classes):(a==="<"||a==="\\lt"||a==="\u27E8"?a="\\langle":(a===">"||a==="\\gt"||a==="\u27E9")&&(a="\\rangle"),Ee.has(a)||gt.has(a)?ge(a,y,!1,b,E):Oe.has(a)?Se(a,_t[y],!1,b,E):(console.assert(!1,"Unknown delimiter '"+a+"'"),null))}var sn=[{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}],Bn=[{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"scriptscriptstyle"},{type:"small",mathstyle:"textstyle"},{type:"stack"}],Wn=[{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 vr(a){return a.type==="small"?"Main-Regular":a.type==="large"?"Size"+a.size+"-Regular":(console.assert(a.type==="stack"),"Size4-Regular")}function Ar(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=fs(a,vr(b[re]));if(ae.defaultMetrics)return{type:"small",mathstyle:"scriptstyle"};let he=ae.height+ae.depth;if(b[re].type==="small"&&(b[re].mathstyle==="scriptscriptstyle"?he*=Math.max(Gc[Math.max(1,E.size-2)],E.minFontScale):b[re].mathstyle==="scriptstyle"&&(he*=Math.max(Gc[Math.max(1,E.size-1)],E.minFontScale))),he>y)return b[re]}return b[b.length-1]}function Rr(a,y,b,E,ee,re){if(!y||y.length===0||y===".")return Kr(ee);y==="<"||y==="\\lt"?y="\\langle":(y===">"||y==="\\gt")&&(y="\\rangle");let ae;gt.has(y)?ae=sn:Ee.has(y)?ae=Wn:ae=Bn;const he=Ar(ie(y),b,ae,ee),pe=new Di({parent:ee,mathstyle:he.mathstyle},re==null?void 0:re.style);return he.type==="small"?ce(y,pe,E,Me(Ce({},re),{type:a})):he.type==="large"?ge(y,he.size,E,pe,Me(Ce({},re),{type:a})):(console.assert(he.type==="stack"),Se(y,b,E,pe,Me(Ce({},re),{type:a})))}function Cr(a,y,b,E,ee,re){if(y===".")return Kr(ee,re==null?void 0:re.classes);const ae=ro*ee.scalingFactor,he=901,pe=5/ll,ve=Math.max(b-ae,E+ae),we=Math.max(ve/500*he,2*ve-pe);return Rr(a,y,we,!0,ee,re)}function Kr(a,y){const b=new or(null,{classes:" nulldelimiter "+(y!=null?y:""),type:"ignore"});return b.width=a.getRegisterAsEm("nulldelimiterspace"),b.wrap(new Di({parent:a,mathstyle:"textstyle"}))}var Qr=class Lp extends Pn{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{}"}},ti=["matrix","matrix*","pmatrix","pmatrix*","bmatrix","bmatrix*","Bmatrix","Bmatrix*","vmatrix","vmatrix*","Vmatrix","Vmatrix*"],Ci=["cases","dcases","rcases"],qi=["align","align*","aligned","gather","gathered","split"],Na=["array","subequations","eqnarray"];function da(a){return Na.concat(qi).concat(Ci).concat(ti).includes(a)}function co(a){return ti.includes(a)}function uo(a){return Ci.includes(a)}function ka(a){return qi.includes(a)}function ho(a,y,b){let E=0;for(const ve of b)"align"in ve&&(E+=1);let ee=0;const re=[];for(const ve of y){let we=0;for(ee=Math.max(ee,Math.min(ve.length,E));we<ve.length;){const Re=[],Je=Math.min(ve.length,we+E);for(;we<Je;){const vt=ve[we];vt.length===0?Re.push([new Pn({type:"first",mode:a.mode})]):vt[0].type!=="first"?Re.push([new Pn({type:"first",mode:a.mode}),...vt]):(console.assert(!vt.slice(1).some(kt=>kt.type==="first")),Re.push(vt)),we+=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 ve of re){if(ve.length!==ee)for(let we=ve.length;we<ee;we++)ve.push([new Pn({type:"first",mode:a.mode}),new Qr]);ae.push(ve)}let he=0,pe=0;for(const ve of ae){pe=0;for(const we of ve){for(const Re of we)Re.parent=a,Re.parentBranch=[he,pe];pe+=1}he+=1}return a.isDirty=!0,ae}var hi=class Dp extends Pn{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=ho(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 Dp(y.environmentName,y.array,y.rowGaps,y)}toJson(){const y=Me(Ce({},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(lc(y))return(b=this.array[y[0]][y[1]])!=null?b:void 0}createBranch(y){var b;return lc(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(gs(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,he;const pe=new Di({parent:y,mathstyle:this.mathstyleName},this.style),ve=pe.getRegisterAsEm("arrayrulewidth"),we=pe.getRegisterAsEm("arraycolsep"),Re=pe.getRegisterAsEm("doublerulesep"),Je=(E=(b=this.arraystretch)!=null?b:pe.getRegisterAsNumber("arraystretch"))!=null?E:1;let vt=typeof this.arraycolsep=="number"?this.arraycolsep:we;this.colSeparationType==="small"&&(vt=.2778*(new Di({parent:y,mathstyle:"scriptstyle"}).scalingFactor/y.scalingFactor));const kt=Je*Uc,xn=.7*kt,ir=.3*kt;let yn=0;const Nn=[];let dr=0;const Kn=this.array.length;for(let ea=0;ea<Kn;++ea){const wa=this.array[ea];dr=Math.max(dr,wa.length);const Ga=new Di({parent:pe,mathstyle:this.mathstyleName},this.style);let Vs=xn/Ga.scalingFactor,Us=ir/Ga.scalingFactor;const Gs={cells:[],height:0,depth:0,pos:0};for(const ws of wa){const e0=(ee=Pn.createBox(Ga,ws,{type:"ignore"}))!=null?ee:new or(null,{type:"ignore"});Us=Math.max(Us,e0.depth),Vs=Math.max(Vs,e0.height),Gs.cells.push(e0)}let Xs=(re=Ju(this.rowGaps[ea]))!=null?re:0;Xs>0&&(Xs+=ir,Us=Math.max(Us,Xs),Xs=0),ea<Kn-1&&!co(this.environmentName)&&this.environmentName!=="cases"&&this.environmentName!=="array"&&(Us+=pe.getRegisterAsEm("jot")),Gs.height=Vs,Gs.depth=Us,yn+=Vs,Gs.pos=yn,yn+=Us+Xs,Nn.push(Gs)}const Zr=yn/2+ro,qr=[];for(let ea=0;ea<dr;ea++){const wa=[];for(const Ga of Nn){const Vs=Ga.cells[ea];Vs.depth=Ga.depth,Vs.height=Ga.height,wa.push({box:Vs,shift:Ga.pos-Zr})}wa.length>0&&qr.push(new Yi({individualShift:wa}))}const Vr=[];let Ti=!1,Ui=!1,xr=0,Wo=!this.leftDelim;const{colFormat:js}=this;for(const ea of js){if("align"in ea&&xr>=qr.length)break;if("align"in ea)Ti?Vr.push(ha(2*vt)):(Ui||Wo)&&Vr.push(ha(vt)),Vr.push(new or(qr[xr],{classes:"col-align-"+ea.align})),xr++,Ti=!0,Ui=!1,Wo=!1;else if("gap"in ea){if(typeof ea.gap=="number")Vr.push(ha(ea.gap));else{const wa=ga(y,Nn,Zr,ea.gap);wa&&Vr.push(wa)}Ti=!1,Ui=!1,Wo=!1}else if("separator"in ea){const wa=new or(null,{classes:"vertical-separator"});wa.height=yn,wa.setStyle("height",yn,"em"),wa.setStyle("border-right",`${ve}em ${ea.separator} currentColor`),wa.setStyle("vertical-align",-(yn-Zr),"em");let Ga=0;Ui?Ga=Re-ve:Ti&&(Ga=vt-ve),wa.left=Ga,Vr.push(wa),Ti=!1,Ui=!0,Wo=!1}}Ti&&!this.rightDelim&&Vr.push(ha(vt));const Qo=new or(Vr,{classes:"mtable"});if((!this.leftDelim||this.leftDelim===".")&&(!this.rightDelim||this.rightDelim==="."))return this.caret&&(Qo.caret=this.caret),this.bind(y,Qo);const Ua=Qo.height,Zo=Qo.depth,ko=this.bind(y,new or([this.bind(y,Cr("open",(ae=this.leftDelim)!=null?ae:".",Ua,Zo,pe,{isSelected:this.isSelected})),Qo,this.bind(y,Cr("close",(he=this.rightDelim)!=null?he:".",Ua,Zo,pe,{isSelected:this.isSelected}))],{type:"ord"}));return ko?(ko.setStyle("display","inline-block"),this.caret&&(ko.caret=this.caret),this.bind(y,this.attachSupsub(y,{base:ko}))):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(Pn.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}}`),Si(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 Pn({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(ma(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(ma(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,ma(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,ma(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 ma(a){const y=new Pn({type:"first",mode:a.mode});y.parent=a;const b=new Qr;return b.parent=a,[y,b]}function ha(a){const y=new or(null,{classes:"arraycolsep"});return y.width=a,y}function ga(a,y,b,E){if(!E)return null;const ee=[];for(const re of y){const ae=Pn.createBox(a,E,{type:"ignore"});ae&&(ae.depth=re.depth,ae.height=re.height,ee.push({box:ae,shift:re.pos-b}))}return new Yi({individualShift:ee}).wrap(a)}var ba=class Ap extends Pn{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 Ap(y)}toJson(){return Me(Ce({},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=Pn.createBox(y,this.body,{type:"lift"});if(!ae)return null;const he=y.toEm((b=this.offset)!=null?b:{dimension:0});ae.depth+=he,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 pe=new Di({parent:y},this.style),ve=pe.toEm((E=this.padding)!=null?E:{register:"fboxsep"}),we=new or(null,{classes:"ML__box"});we.height=ae.height+ve,we.depth=ae.depth+ve,we.setStyle("box-sizing","border-box"),we.setStyle("position","absolute"),we.setStyle("top",-ve+.3,"em"),we.setStyle("left",0),we.setStyle("height",we.height+we.depth,"em"),we.setStyle("width","100%"),this.backgroundcolor&&we.setStyle("background-color",(ee=pe.toColor(this.backgroundcolor))!=null?ee:"transparent"),this.framecolor&&we.setStyle("border",`${pe.getRegisterAsEm("fboxrule",2)}em solid ${(re=pe.toColor(this.framecolor))!=null?re:"black"}`),this.border&&we.setStyle("border",this.border);const Re=new or([we,ae],{type:"lift"});return Re.setStyle("display","inline-block"),Re.setStyle("position","relative"),Re.setStyle("line-height",0),Re.height=ae.height+ve+(he>0?he:0),Re.depth=ae.depth+ve+(he<0?-he:0),Re.setStyle("padding-left",ve,"em"),Re.setStyle("padding-right",ve,"em"),Re.setStyle("height",Math.floor(100*(ae.height+ae.depth+2*ve+Math.abs(he)))/100,"em"),Re.setStyle("margin-top",-ve,"em"),Re.setStyle("top",Math.floor(100*(ae.depth-ae.height+2*ve-he))/100,"em"),Re.setStyle("vertical-align",Math.floor(100*(ae.depth+2*ve))/100,"em"),this.caret&&(Re.caret=this.caret),this.attachSupsub(y,{base:Re})}_serialize(y){return y.skipStyles?Si([this.bodyToLatex(y),this.supsubToLatex(y)]):super._serialize(y)}},fl=class Tp extends Pn{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 Tp(y.value,y)}toJson(){return super.toJson()}get computedStyle(){return{}}render(y){const b=new or(this.value,{classes:"ML__composition",type:"composition"});return this.bind(y,b),this.caret&&(b.caret=this.caret),b}_serialize(y){return""}},vo=class Ip extends Pn{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}},Za=class Pp extends Pn{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=Pn.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=Ge(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):`{${this.bodyToLatex(y)}}`}},$i=class Bp extends Pn{constructor(y,b,E){super({type:"leftright",style:E.style,displayContainsHighlight:!0}),this.variant=y,this.body=b,this.leftDelim=E.leftDelim,this.rightDelim=E.rightDelim}static fromJson(y){var b;return new Bp((b=y.variant)!=null?b:"",y.body,y)}toJson(){const y=super.toJson();return this.variant&&(y.variant=this.variant),this.leftDelim&&(y.leftDelim=this.leftDelim),this.rightDelim&&(y.rightDelim=this.rightDelim),y}_serialize(y){var b,E;const ee=this.matchingRightDelim();return this.variant==="left...right"?Si(["\\left",(b=this.leftDelim)!=null?b:".",this.bodyToLatex(y),"\\right",ee]):this.variant==="mleft...mright"?Si(["\\mleft",(E=this.leftDelim)!=null?E:".",this.bodyToLatex(y),"\\mright",ee]):Si([!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 Di({parent:y},this.style);console.assert(this.body!==void 0);const re=new Di({parent:y,mathstyle:"textstyle"},this.style),ae=(b=Pn.createBox(ee,this.body,{type:"inner"}))!=null?b:new or(null,{type:"inner"}),he=ae.height/re.scalingFactor,pe=ae.depth/re.scalingFactor,ve=[];if(this.leftDelim&&ve.push(this.bind(re,Cr("open",this.leftDelim,he,pe,re,{isSelected:this.isSelected,classes:"ML__open"+(this.containsCaret?" ML__contains-caret":""),mode:this.mode,style:this.style}))),ae&&(Pa(ae.children,this,ee,he,pe),ve.push(ae)),this.rightDelim){let vt=this.containsCaret?" ML__contains-caret":"",kt=this.rightDelim;kt==="?"&&(ee.smartFence?(kt=this.matchingRightDelim(),vt+=" ML__smart-fence__close"):kt="."),ve.push(this.bind(re,Cr("close",kt,he,pe,re,{isSelected:this.isSelected,classes:vt+" ML__close",mode:this.mode,style:this.style})))}let we=this.variant==="mleft...mright";const Re=this.leftSibling;Re&&(!we&&Re.isFunction&&(we=!0),!we&&Re.type==="subsup"&&((E=Re.leftSibling)!=null&&E.isFunction)&&(we=!0));const Je=new or(ve,{type:we?"close":"inner",classes:"left-right"});return Je.setStyle("margin-top",`${-ae.depth}em`),Je.setStyle("height",`${ae.height+ae.depth}em`),this.caret&&(Je.caret=this.caret),this.bind(ee,Je.wrap(ee))}};function Pa(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,Cr("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&&Pa(ae.children,y,b,E,ee)}}var au=class Op extends Pn{constructor(y,b){var E;super({type:"macro",command:y,style:b.style}),this.body=b.body,b.captureSelection===void 0?b.args?this.captureSelection=!1:this.captureSelection=!0:this.captureSelection=b.captureSelection,this.macroArgs=b.args,this.expand=(E=b.expand)!=null?E:!1}static fromJson(y){return new Op(y.command,y)}toJson(){const y=super.toJson();return this.expand&&(y.expand=!0),this.captureSelection!==void 0&&(y.captureSelection=this.captureSelection),this.macroArgs&&(y.args=this.macroArgs),y}_serialize(y){var b;return y.expandMacro&&this.expand?this.bodyToLatex(y):this.command+((b=this.macroArgs)!=null?b:"")}render(y){const b=Pn.createBox(y,this.body);return b?(this.caret&&(b.caret=this.caret),this.bind(y,b)):null}},bs=class $p extends Pn{constructor(){super({type:"macro-argument"})}static fromJson(y){return new $p}toJson(){return super.toJson()}_serialize(y){return""}render(y){return null}},Ns=class Rp extends Pn{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 Rp(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 Di({parent:y}),E=b.getRegisterAsEm("fboxsep"),ee=E,re=E,ae=Pn.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 he=new or(ae,{type:"ord"});he.setStyle("display","inline-block"),he.setStyle("height",ae.height+ae.depth,"em"),he.setStyle("vertical-align",-re,"em");let pe="ML__prompt ";this.locked?pe+=" ML__lockedPromptBox ":pe+=" ML__editablePromptBox ",this.correctness==="correct"?pe+=" ML__correctPromptBox ":this.correctness==="incorrect"&&(pe+=" ML__incorrectPromptBox "),this.containsCaret&&(pe+=" ML__focusedPromptBox ");const ve=new or(null,{classes:pe,attributes:{part:"prompt"}});ve.height=he.height+re,ve.depth=he.depth+re,ve.width=he.width+2*ee,ve.setStyle("box-sizing","border-box"),ve.setStyle("position","absolute"),ve.setStyle("height",he.height+he.depth+2*re,"em"),ee===0&&ve.setStyle("width","100%"),ee!==0&&(ve.setStyle("width",`calc(100% + ${2*ee}em)`),ve.setStyle("top",E,"em"),ve.setStyle("left",-ee,"em")),(!this.body||this.body.length===1)&&(ve.width=3*ee,ve.setStyle("width",`calc(100% + ${3*ee}em)`),ve.setStyle("left",-1.5*ee,"em"));let we="";this.correctness==="incorrect"&&(we+='<line x1="3%" y1="97%" x2="97%" y2="3%" stroke-width="0.5" stroke="var(--incorrect-color, var(--ML__incorrect-color))" stroke-linecap="round" />'),we&&(ve.svgOverlay=we);const Re=new or([ve,he],{classes:"ML__prompt-atom"});return Re.setStyle("position","relative"),Re.setStyle("display","inline-block"),Re.setStyle("line-height",0),Re.height=he.height+re+.2,Re.depth=he.depth+re,Re.left=ee,Re.right=ee,Re.setStyle("height",he.height+re,"em"),Re.setStyle("top",he.depth-he.height,"em"),Re.setStyle("vertical-align",he.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]"),ra(ee,E)}},Yo=class Np extends Pn{constructor(y){super({type:"subsup",style:y==null?void 0:y.style}),this.subsupPlacement="auto"}static fromJson(y){const b=new Np(y);for(const E of Tl)y[E]&&b.setChildren(y[E],E);return b}render(y){var b;const E=new Di({parent:y,isPhantom:!0}),ee=this.leftSibling,re=(b=ee.render(E))!=null?b:new or(null),ae=new or(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 _a(a){return a?!/^(<$$>|<$>|<space>|<{>|<}>|#[0-9\?]|\\.+)$/.test(a):!1}var pl=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 Di&&!(b!=null&&b.parseMode)&&!b.mathstyle?y:new Di({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:Ce({},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(Ce({before:Is(this.tokens.slice(this.index,this.index+10)),after:Is(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 Ce({},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 Yo({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=Ge(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?ja(y,{parseMode:this.parseMode,mathstyle:"textstyle"}):[new Qr({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();_a(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(_a(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 he="";for(;this.hasPattern(ae);)he+=this.get();if(!a&&(this.match(".")||this.match(",")))for(he+=".";this.hasPattern(ae);)he+=this.get();const pe=a?Number.parseInt(he,re):Number.parseFloat(he);return Number.isNaN(pe)?null:{number:E?-pe:pe,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()||!_a(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=Kt(a);if(!y)return this.onError({code:"unknown-environment",arg:a}),null;const b=[];if(y.params)for(const he of y.params)if(he.isOptional)b.push(this.scanOptionalArgument(he.type));else{const pe=this.scanArgument(he.type);pe||this.onError({code:"missing-argument",arg:a}),b.push(pe)}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 he=null;this.skipWhitespace(),this.match("[")&&(he=this.scanDimen(),this.skipWhitespace(),this.match("]")),ee.push(he!=null?he:{dimension:0}),E.push(re),re=[]}else this.mathlist.push(...this.scan(he=>["<}>","&","\\end","\\cr","\\\\","\\tabularnewline"].includes(he)));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=Ge(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 Za(y,this.parseMode,this.style);return b.verbatimLatex=Is(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 $i("",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(!_a(a)&&!a.startsWith("\\"))return null;this.next();const y=Ge(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 vo("\\right");if(this.match("\\mright"))return this.onError({code:"unbalanced-braces"}),new vo("\\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 vo(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 $i(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 Pn({type:"mord",command:"\\doubleprime",mode:"math",value:"\u2032\u2032"}),"superscript"):y.addChild(new Pn({type:"mord",command:"\\prime",mode:"math",value:"\u2032"}),"superscript"):(this.match("^")||this.match("_"))&&y.addChildren(Ye(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(_a(a)){const b=Co.createAtom(this.parseMode,a,Ce({},this.style));return b?[b]:null}if(y=this.scanMacro(a),y)return[y];if(a.startsWith("\\")){const b=Ge(a,this.parseMode);if(!b)return this.onError({code:"unknown-command",arg:a}),[new vo(a)];if(b.definitionType==="symbol"){const E=Ce({},this.style);b.variant&&(E.variant=b.variant),y=new Pn({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 vo(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 he=this.scanOptionalArgument("string"),pe=this.scanOptionalArgument("math"),ve=Pn.serialize(pe,{defaultMode:"math"});let we=[],Re;!Re&&ve==="correct"?Re="correct":!Re&&ve==="incorrect"?Re="incorrect":ve!==""&&(we=pe);const Je=this.scanOptionalArgument("string")==="locked",vt=this.scanArgument("auto");let kt;return vt&&Array.isArray(vt)&&vt.length>0?kt=vt:vt&&typeof vt=="object"&&"group"in vt?kt=vt.group:kt=we,he?[new Ns(he,Re,Je,kt!=null?kt:we,{mode:this.parseMode,style:this.style})]:[new Qr({mode:this.parseMode,style:this.style})]}if(a==="\\renewcommand"||a==="\\newcommand"||a==="\\providecommand"||a==="\\def"){const he=this.index,pe=this.scanLiteralGroup()||this.next();if(!pe)return null;if(this.context.registers[pe.substring(1)]){const ve=this.scanArgument("string");ve!==null&&(this.context.registers[pe.substring(1)]=ve);const we=Si([a,Is(this.tokens.slice(he,this.index))]);return[new Pn({type:"text",value:"",verbatimLatex:we})]}}let ee=this.scanMacro(a);if(ee)return[ee];const re=Ge(a,this.parseMode);if(!re)return this.parseMode==="text"?(/[a-zA-Z]/.test((y=this.peek())!=null?y:"")&&(a+=" "),[...a].map(he=>new Pn({type:"text",value:he,mode:"text",style:this.style}))):(this.onError({code:"unknown-command",arg:a}),[new vo(a)]);const ae=this.index;if(re.definitionType==="symbol"){const he=Ce({},this.style);re.variant&&(he.variant=re.variant),ee=new Pn({type:re.type,command:a,style:he,value:String.fromCodePoint(re.codepoint),mode:this.parseMode})}else{if(re.ifMode&&!re.ifMode.includes(this.parseMode))return[];const he=this.parseMode;re.applyMode&&(this.parseMode=re.applyMode);let pe,ve=[];if(re.parse?ve=re.parse(this):[pe,ve]=this.scanArguments(re),this.parseMode=he,re.applyMode&&!re.applyStyle&&!re.createAtom)return Ye(ve[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:ve,style:this.style,mode:this.parseMode}),pe&&(ee.body=Ye(this.scanArgument(pe)));else if(typeof re.applyStyle=="function"){const we=Ce(Ce({},this.style),re.applyStyle(a,ve,this.context)),Re=this.parseMode;if(re.applyMode&&(this.parseMode=re.applyMode),pe){const Je=this.style;this.style=we;const vt=this.scanArgument(pe);return this.style=Je,this.parseMode=Re,Ye(vt)}this.style=we}else ee=new Pn({type:"mord",command:(b=re.command)!=null?b:a,style:Ce({},this.style),value:a,mode:(E=re.applyMode)!=null?E:this.parseMode})}if(!ee)return null;if(ee instanceof Pn&&ee.verbatimLatex===void 0&&!/^\\(llap|rlap|class|cssId|htmlData)$/.test(a)){const he=Si([a,Is(this.tokens.slice(ae,this.index))]);he&&(ee.verbatimLatex=he)}if(ee.verbatimLatex===null&&(ee.verbatimLatex=void 0),ee.isFunction&&this.smartFence){const he=this.scanSmartFence();if(he)return[ee,he]}return[ee]}scanSymbolCommandOrLiteral(){const a=this.get();if(!a)return null;if(_a(a)){const y=Co.createAtom(this.parseMode,a,Ce({},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 vs(" "," ",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 he=this.scanLiteralGroup();if(!he){const pe=this.index;this.scanExpression(),he=Is(this.tokens.slice(pe,this.index))}re[ae]=he}return new au(a,{expand:b.expand,captureSelection:b.captureSelection,args:E===this.index?null:Is(this.tokens.slice(E,this.index)),style:this.parsingContext.style,body:ja(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 ja(a,y){var b,E,ee,re;const ae=(b=y==null?void 0:y.args)!=null?b:void 0,he=new pl(ps(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:{}}),pe=[];for(;!he.end();)pe.push(...he.scan(()=>!1));return pe}function t0(a,y){var b;const E=new pl(ps(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 Pn{constructor(y,b){super({type:"chem"},{command:y,mode:"math"});const E=la.go(Qn.go(b,y==="\\pu"?"pu":"ce"),!1);this.body=ja(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 Me(Ce({},super.toJson()),{arg:this.arg})}render(y){const b=Pn.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}};xt(["ce","pu"],"{chemformula:balanced-string}",{createAtom:a=>{var y;return new n0(a.command,(y=a.args[0])!=null?y:"")}});var Qn={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 he=Qn.stateMachines[y],pe=he.transitions[b]||he.transitions["*"];e:for(var ve=0;ve<pe.length;ve++){var we=Qn.patterns.match_(pe[ve].pattern,a);if(we){for(var Re=pe[ve].task,Je=0;Je<Re.action_.length;Je++){var vt;if(he.actions[Re.action_[Je].type_])vt=he.actions[Re.action_[Je].type_](E,we.match_,Re.action_[Je].option);else if(Qn.actions[Re.action_[Je].type_])vt=Qn.actions[Re.action_[Je].type_](E,we.match_,Re.action_[Je].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+Re.action_[Je].type_+")"];Qn.concatArray(ae,vt)}if(b=Re.nextState||b,a.length>0){if(Re.revisit||(a=we.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=Qn.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 Qn.patterns.findObserveGroups(a,"^{","","","}")},"^($...$)":function(a){return Qn.patterns.findObserveGroups(a,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(a){return Qn.patterns.findObserveGroups(a,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(a){return Qn.patterns.findObserveGroups(a,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(a){return Qn.patterns.findObserveGroups(a,"_{","","","}")},"_($...$)":function(a){return Qn.patterns.findObserveGroups(a,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(a){return Qn.patterns.findObserveGroups(a,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(a){return Qn.patterns.findObserveGroups(a,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(a){return Qn.patterns.findObserveGroups(a,"","{","}","")},"{(...)}":function(a){return Qn.patterns.findObserveGroups(a,"{","","","}")},"$...$":function(a){return Qn.patterns.findObserveGroups(a,"","$","$","")},"${(...)}$":function(a){return Qn.patterns.findObserveGroups(a,"${","","","}$")},"$(...)$":function(a){return Qn.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 Qn.patterns.findObserveGroups(a,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(a){return Qn.patterns.findObserveGroups(a,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(a){return Qn.patterns.findObserveGroups(a,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(a){return Qn.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 Qn.patterns.findObserveGroups(a,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(a){return Qn.patterns.findObserveGroups(a,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(a){return Qn.patterns.findObserveGroups(a,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(a){return Qn.patterns.findObserveGroups(a,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(a){return Qn.patterns.findObserveGroups(a,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(a){return Qn.patterns.findObserveGroups(a,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(a){return Qn.patterns.findObserveGroups(a,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(a){return Qn.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=Qn.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,he,pe,ve){var we=function(yn,Nn){if(typeof Nn=="string")return yn.indexOf(Nn)!==0?null:Nn;var dr=yn.match(Nn);return dr?dr[0]:null},Re=function(yn,Nn,dr){for(var Kn=0;Nn<yn.length;){var Zr=yn.charAt(Nn),qr=we(yn.substr(Nn),dr);if(qr!==null&&Kn===0)return{endMatchBegin:Nn,endMatchEnd:Nn+qr.length};if(Zr==="{")Kn++;else if(Zr==="}"){if(Kn===0)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];Kn--}Nn++}return Kn>0,null},Je=we(a,y);if(Je===null||(a=a.substr(Je.length),Je=we(a,b),Je===null))return null;var vt=Re(a,Je.length,E||ee);if(vt===null)return null;var kt=a.substring(0,E?vt.endMatchEnd:vt.endMatchBegin);if(re||ae){var xn=this.findObserveGroups(a.substr(vt.endMatchEnd),re,ae,he,pe);if(xn===null)return null;var ir=[kt,xn.match_];return{match_:ve?ir.join(""):ir,remainder:xn.remainder}}else return{match_:kt,remainder:a.substr(vt.endMatchEnd)}},match_:function(a,y){var b=Qn.patterns.patterns[a];if(b===void 0)throw["MhchemBugP","mhchem bug P. Please report. ("+a+")"];if(typeof b=="function")return Qn.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 Qn.go(y,"text")},"{text}":function(a,y){var b=["{"];return Qn.concatArray(b,Qn.go(y,"text")),b.push("}"),b},"tex-math":function(a,y){return Qn.go(y,"tex-math")},"tex-math tight":function(a,y){return Qn.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 Qn.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 Qn.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 he=0;he<ae.action_.length;he++)typeof ae.action_[he]=="string"&&(ae.action_[he]={type_:ae.action_[he]})}else ae.action_=[];for(var pe=y.split("|"),ve=0;ve<pe.length;ve++)if(E[ee]==="*")for(var we in re)re[we].push({pattern:pe[ve],task:ae});else re[E[ee]].push({pattern:pe[ve],task:ae})}return re},stateMachines:{}};Qn.stateMachines={ce:{transitions:Qn.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 Qn.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 Qn.concatArray(b,this.output(a)),Qn.concatArray(b,Qn.actions.bond(a,y,"-")),b}else a.d=y},"- after o/d":function(a,y,b){var E=Qn.patterns.match_("orbital",a.o||""),ee=Qn.patterns.match_("one lowercase greek letter $",a.o||""),re=Qn.patterns.match_("one lowercase latin letter $",a.o||""),ae=Qn.patterns.match_("$one lowercase latin letter$ $",a.o||""),he=y==="-"&&(E&&E.remainder===""||ee||re||ae);he&&!a.a&&!a.b&&!a.p&&!a.d&&!a.q&&!E&&re&&(a.o="$"+a.o+"$");var pe=[];return he?(Qn.concatArray(pe,this.output(a)),pe.push({type_:"hyphen"})):(E=Qn.patterns.match_("digits",a.d||""),b&&E&&E.remainder===""?(Qn.concatArray(pe,Qn.actions["d="](a,y)),Qn.concatArray(pe,this.output(a))):(Qn.concatArray(pe,this.output(a)),Qn.concatArray(pe,Qn.actions.bond(a,y,"-")))),pe},"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:Qn.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"&&Qn.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:Qn.go(a.a,"a"),b:Qn.go(a.b,"bd"),p:Qn.go(a.p,"pq"),o:Qn.go(a.o,"o"),q:Qn.go(a.q,"pq"),d:Qn.go(a.d,a.dType==="oxidation"?"oxidation":"bd"),dType:a.dType}));else{var ee;a.rdt==="M"?ee=Qn.go(a.rd,"tex-math"):a.rdt==="T"?ee=[{type_:"text",p1:a.rd||""}]:ee=Qn.go(a.rd);var re;a.rqt==="M"?re=Qn.go(a.rq,"tex-math"):a.rqt==="T"?re=[{type_:"text",p1:a.rq||""}]:re=Qn.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 Qn.concatArray(b,Qn.go(y,"oxidation")),b.push("}"),b},"frac-output":function(a,y){return{type_:"frac-ce",p1:Qn.go(y[0]),p2:Qn.go(y[1])}},"overset-output":function(a,y){return{type_:"overset",p1:Qn.go(y[0]),p2:Qn.go(y[1])}},"underset-output":function(a,y){return{type_:"underset",p1:Qn.go(y[0]),p2:Qn.go(y[1])}},"underbrace-output":function(a,y){return{type_:"underbrace",p1:Qn.go(y[0]),p2:Qn.go(y[1])}},"color-output":function(a,y){return{type_:"color",color1:y[0],color2:Qn.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:Qn.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:Qn.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:Qn.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:Qn.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:Qn.go(y,"o")}},"color-output":function(a,y){return{type_:"color",color1:y[0],color2:Qn.go(y[1],"pq")}}}},bd:{transitions:Qn.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:Qn.go(y[1],"bd")}}}},oxidation:{transitions:Qn.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:Qn.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:Qn.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:Qn.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:Qn.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]&&(Qn.concatArray(b,Qn.go(y[1],"pu-9,9")),y[2]&&(y[2].match(/[,.]/)?Qn.concatArray(b,Qn.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]),Qn.concatArray(b,Qn.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=Qn.patterns.match_("{(...)}",a.d||"");b&&b.remainder===""&&(a.d=b.match_);var E=Qn.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:Qn.go(a.d,"pu"),q:Qn.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_:"/"}),Qn.concatArray(y,ee.q))}else y=Qn.go(a.d,"pu-2");for(var re in a)delete a[re];return y}}},"pu-2":{transitions:Qn.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=Qn.patterns.match_("{(...)}",a.rm||"");b&&b.remainder===""?y=Qn.go(b.match_,"pu"):y={type_:"rm",p1:a.rm}}for(var E in a)delete a[E];return y}}},"pu-9,9":{transitions:Qn.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 la={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+=la._go2(re),re.type_==="1st-level escape"&&(E=!0))}return!y&&!E&&b&&(b="{"+b+"}"),b},_goInner:function(a){return a&&la.go(a,!0)},_go2:function(a){var y;switch(a.type_){case"chemfive":y="";var b={a:la._goInner(a.a),b:la._goInner(a.b),p:la._goInner(a.p),o:la._goInner(a.o),q:la._goInner(a.q),d:la._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 "+la._goInner(a.p1);break;case"state of aggregation subscript":y="\\mskip1mu "+la._goInner(a.p1);break;case"bond":if(y=la._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{"+la._goInner(a.p1)+"}{"+la._goInner(a.p2)+"}";y="\\mathchoice{\\textstyle"+ee+"}{"+ee+"}{"+ee+"}{"+ee+"}";break;case"tex-math":y=a.p1+" ";break;case"frac-ce":y="\\frac{"+la._goInner(a.p1)+"}{"+la._goInner(a.p2)+"}";break;case"overset":y="\\overset{"+la._goInner(a.p1)+"}{"+la._goInner(a.p2)+"}";break;case"underset":y="\\underset{"+la._goInner(a.p1)+"}{"+la._goInner(a.p2)+"}";break;case"underbrace":y="\\underbrace{"+la._goInner(a.p1)+"}_{"+la._goInner(a.p2)+"}";break;case"color":y="{\\color{"+a.color1+"}{"+la._goInner(a.color2)+"}}";break;case"color0":y="\\color{"+a.color+"}";break;case"arrow":var re={rd:la._goInner(a.rd),rq:la._goInner(a.rq)},ae=la._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=la._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 k1(a){}function _1(a){}var r0=class zp extends Pn{constructor(y){super(Me(Ce({},y),{type:"delim"})),this.value=y.delim,this.size=y.size}static fromJson(y){return new zp(y)}toJson(){return Me(Ce({},super.toJson()),{delim:this.value,size:this.size})}render(y){return new or(this.value,{type:"middle"})}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Ge(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):ra(this.command,this.value)}},i0=class Kp extends Pn{constructor(y){super(Me(Ce({},y),{type:"sizeddelim",value:y.delim})),this.delimType=y.delimType,this.size=y.size}static fromJson(y){return new Kp(y)}toJson(){return Me(Ce({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(y){let b=fn(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=Ge(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):ra(this.command,this.value)}},cd=class Hp extends Pn{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 Me(Ce({},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=Ge(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 ra(ee,this.bodyToLatex(y))}render(y){const b=new Di({parent:y},this.style),E=Pn.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 or(null,{classes:"ML__notation"});let he=E.height+E.depth+2*re;const pe=E.width+2*re;let ve="";if(this.notation.horizontalstrike&&(ve+=this.line(3,50,97,50)),this.notation.verticalstrike&&(ve+=this.line(50,3,50,97)),this.notation.updiagonalstrike&&(ve+=this.line(3,97,97,3)),this.notation.downdiagonalstrike&&(ve+=this.line(3,3,97,97)),this.notation.updiagonalarrow){ve+=this.line(re.toString(),(re+E.depth+E.height).toString(),(re+E.width).toString(),re.toString());const kt=.03*Math.sqrt(pe*pe+he*he)*1,xn=E.width*kt,ir=(E.depth+E.height)*kt,yn=re+E.width;let Nn=re;Nn+ir-.4*xn<0&&(Nn=.4*xn-ir),ve+='<polygon points="',ve+=`${yn},${Nn} ${yn-xn-.4*ir},${Nn+ir-.4*xn} `,ve+=`${yn-.7*xn},${Nn+.7*ir} ${yn-xn+.4*ir},${Nn+ir+.4*xn} `,ve+=`${yn},${Nn}`,ve+=`" stroke='none' fill="${this.strokeColor}"`,ve+="/>"}let we=0;if(this.notation.phasorangle){const Je=a0(b),vt=(E.height+E.depth+2*Je+re).toString(),kt=(E.height+E.depth)/2;ve+=this.line(re.toString(),vt,(re+kt+E.width).toString(),vt),ve+=this.line(re.toString(),vt,(re+kt).toString(),(re-Je).toString()),he+=Je,we=kt,E.left+=he/2-re}if(this.notation.longdiv){const Je=a0(b);he+=Je,ve+=this.line(re.toString(),re.toString(),(re+E.width).toString(),re.toString());const vt=.3;we=vt+Je,E.left+=vt+Je,E.setTop(re+Je),ve+='<path d="',ve+=`M ${re} ${re} a${vt} ${(E.depth+E.height+2*Je)/2}, 0, 1, 1, 0 ${E.depth+E.height+2*Je} "`,ve+=` stroke-width="${am(b)}" stroke="${this.strokeColor}" fill="none"`,ve+="/>"}if(ae.width=E.width+2*re+we,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*he)/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),ve){let Je="";this.shadow==="auto"&&(Je+="filter: drop-shadow(0 0 .5px rgba(255, 255, 255, .7)) drop-shadow(1px 1px 2px #333)"),this.shadow!=="none"&&(Je+=`filter: drop-shadow(${this.shadow})`),Je+=` stroke-width="${this.strokeWidth}" stroke="${this.strokeColor}"`,Je+=' stroke-linecap="round"',this.svgStrokeStyle&&(Je+=` stroke-dasharray="${this.svgStrokeStyle}"`),ae.svgStyle=Je,ae.svgOverlay=ve}const Re=new or([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="${yh(y)}" y1="${yh(b)}" x2="${yh(E)}" y2="${yh(ee)}" vector-effect="non-scaling-stroke"></line>`}};function yh(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?hs:a.metrics.defaultRuleThickness;return a.metrics.defaultRuleThickness+a.scalingFactor*y/4}var ou=class Wp extends Pn{constructor(y,b,E){var ee,re;super(Me(Ce({},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),Ce(Ce({},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 Di({parent:y,mathstyle:this.mathstyleName},this.style),re=ee.metrics,ae=new Di({parent:ee,mathstyle:this.continuousFraction?"":"numerator"},this.style),he=this.numerPrefix?new or([new or(this.numerPrefix),Pn.createBox(ae,this.above)],{isTight:ae.isTight,type:"ignore"}):(b=Pn.createBox(ae,this.above,{type:"ignore"}))!=null?b:new or(null,{type:"ignore"}),pe=new Di({parent:ee,mathstyle:this.continuousFraction?"":"denominator"},this.style),ve=this.denomPrefix?new or([new or(this.denomPrefix),Pn.createBox(pe,this.below,{type:"ignore"})]):(E=Pn.createBox(pe,this.below,{type:"ignore"}))!=null?E:new or(null,{type:"ignore"}),we=this.hasBarLine?re.defaultRuleThickness:0;let Re,Je=0,vt;ee.isDisplayStyle?(Re=ae.metrics.num1,Je=we>0?3*we:7*we,vt=pe.metrics.denom1):(we>0?(Re=ae.metrics.num2,Je=we):(Re=ae.metrics.num3,Je=3*re.defaultRuleThickness),vt=pe.metrics.denom2);const kt=[];this.isSelected&&kt.push("ML__selected");const xn=he.depth,ir=ve.height;let yn;if(we<=0){const Vr=Re-xn-(ir-vt);Vr<Je&&(Re+=(Je-Vr)/2,vt+=(Je-Vr)/2),yn=new Yi({individualShift:[{box:he,shift:-Re,classes:[...kt,"ML__center"]},{box:ve,shift:vt,classes:[...kt,"ML__center"]}]}).wrap(ee)}else{const Vr=new or(null,{classes:"ML__frac-line",mode:this.mode,style:this.style});Vr.softWidth=Math.max(he.width,ve.width),Vr.height=we/2,Vr.depth=we/2;const Ti=ro+we/2;Re<Je+xn+Ti&&(Re=Je+xn+Ti);const Ui=ro-we/2;vt<Je+ir-Ui&&(vt=Je+ir-Ui),yn=new Yi({individualShift:[{box:ve,shift:vt,classes:[...kt,"ML__center"]},{box:Vr,shift:-Ui,classes:kt},{box:he,shift:-Re,classes:[...kt,"ML__center"]}]}).wrap(ee)}const Nn=ee.isDisplayStyle?re.delim1:re.delim2,dr=this.leftDelim?this.bind(y,Rr("open",this.leftDelim,Nn,!0,y,{style:this.style,mode:this.mode,isSelected:this.isSelected})):Kr(ee,"open");let Kn=null;this.continuousFraction?Kn=new or(null,{type:"close"}):this.rightDelim?Kn=this.bind(y,Rr("close",this.rightDelim,Nn,!0,y,{style:this.style,mode:this.mode,isSelected:this.isSelected})):Kn=Kr(ee,"close");const Zr=new or([dr,yn,Kn],{isTight:ee.isTight,type:"inner",classes:"mfrac"}),qr=this.bind(y,Zr);return this.caret&&(qr.caret=this.caret),this.attachSupsub(y,{base:qr})}},qa=class Zp extends Pn{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 Zp(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),Ce({type:"latex",value:this.value},y)}get computedStyle(){return{}}render(y){const b=new or(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}},ud=class jp extends Pn{constructor(y){super({type:"latexgroup",mode:"latex"}),this.body=[...y].map(b=>new qa(b)),this.skipBoundary=!1}static fromJson(y){return new jp("")}toJson(){return super.toJson()}render(y){const b=Pn.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:""}},hf=class Vp extends Pn{constructor(y,b){super(Me(Ce({},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 or(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-ro*y.scalingFactor,ae=ee.italic;ee.setTop(re);let he=ee;if(this.superscript||this.subscript){const pe=(b=this.subsupPlacement)!=null?b:"auto";he=pe==="over-under"||pe==="auto"&&y.isDisplayStyle?this.attachLimits(y,{base:ee,baseShift:re,slant:ae}):this.attachSupsub(y,{base:ee})}return new or(this.bind(y,he),{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=Ge(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)),Si(E)}},dc=class Up extends Pn{constructor(y){const b=y.body;super(Me(Ce({},y),{type:"overlap",body:typeof b=="string"?[new Pn({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 Up(y)}toJson(){const y={};return this.align&&(y.align=this.align),this.boxType&&(y.boxType=this.boxType),Ce(Ce({},super.toJson()),y)}render(y){const b=Pn.createBox(y,this.body,{classes:"inner"});return b?(this.caret&&(b.caret=this.caret),this.bind(y,new or([b,new or(null,{classes:"fix"})],{classes:this.align==="right"?"rlap":"llap",type:this.boxType}))):null}},Jo=class Gp extends Pn{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?No(this.svgBody):Pn.createBox(y,this.body,{type:"ignore"});const E=new Di({parent:y,mathstyle:"scriptstyle"},this.style);let ee=null;this.svgAbove?ee=No(this.svgAbove):this.above&&(ee=Pn.createBox(E,this.above,{type:"ignore"}));let re=null;this.svgBelow?re=No(this.svgBelow):this.below&&(re=Pn.createBox(E,this.below,{type:"ignore"})),this.paddedBody&&(b=new or([Kr(y,"open"),b,Kr(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 he=new or(y.base,{type:y.type});return he.setStyle("position","relative"),he}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 he=a.metrics.bigOpSpacing5+y.below.height+y.below.depth+ee.depth+re;E=new Yi({bottom:he,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 Yi({top:ee.height-re,children:[a.metrics.bigOpSpacing5,{box:y.below,classes:ae},{box:ee,classes:["ML__center"]}]}):y.above&&(E=new Yi({bottom:ee.depth+re,children:[{box:ee,classes:["ML__center"]},b,{box:y.above,classes:ae},a.metrics.bigOpSpacing5]}));return new or(E,{type:y.type})}var dd=class Xp extends Pn{constructor(y){var b,E,ee,re;super(Me(Ce({},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),Ce(Ce({},super.toJson()),y)}render(y){const b=new Di({parent:y,isPhantom:!0});if(!this.smashDepth&&!this.smashHeight&&!this.smashWidth)return console.assert(this.isInvisible),Pn.createBox(b,this.body,{classes:"inner"});const E=Pn.createBox(this.isInvisible?b:y,this.body);if(!E)return null;if(this.smashWidth){const ee=new or(null,{classes:"fix"});return new or([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 Yi({firstBaseline:[{box:E}]},{type:E.type}).wrap(y)}},hd=class Yp extends Pn{constructor(y){var b;super(Ce({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 Yp(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 or(this.mode==="math"?null:" ");let E;if(this.width!==void 0)E=new or(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 or(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=Ge(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}{${Ma(this.width)}}`:`${ee}${Ma(this.width)}`}},o0=class Jp extends Pn{constructor(y){var b;super(Me(Ce({},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 Jp(Me(Ce({},y),{index:y.above}))}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Ge(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")?ra(`${E}[${this.aboveToLatex(y)}]`,ee):/^[0-9]$/.test(ee)?`${E}${ee}`:ra(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 Di({parent:y,mathstyle:"cramp"},this.style),ee=(b=Pn.createBox(E,this.body,{type:"inner"}))!=null?b:new or(null),re=E.scalingFactor,ae=E.metrics.defaultRuleThickness/re,he=y.isDisplayStyle?hs:ae,pe=new or(null,{classes:"ML__sqrt-line",style:this.style});pe.height=ae,pe.softWidth=ee.width;let ve=re*(ae+he/4);const Re=Math.max(re*2*he,ee.height+ee.depth)+ve+ae,Je=new Di({parent:y},this.style),vt=this.bind(Je,new or(Rr("inner","\\surd",Re,!1,Je,{isSelected:this.isSelected}),{isSelected:this.isSelected,classes:"ML__sqrt-sign",style:this.style}));if(!vt)return null;const kt=vt.height+vt.depth-ae;kt>ee.height+ee.depth+ve&&(ve=(ve+kt-(ee.height+ee.depth))/2),vt.setTop(vt.height-ee.height-ve);const xn=this.bind(y,new Yi({firstBaseline:[{box:new or(ee)},ve-2*ae,{box:pe},ae]})),ir=Pn.createBox(new Di({parent:y,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!ir){const dr=new or([vt,xn],{classes:this.containsCaret?"ML__contains-caret":"",type:"inner"});return dr.setStyle("display","inline-block"),dr.setStyle("height",dr.height+dr.depth,"em"),this.caret&&(dr.caret=this.caret),this.bind(y,dr)}const yn=new Yi({shift:-.6*(Math.max(vt.height,xn.height)-Math.max(vt.depth,xn.depth)),children:[{box:ir}]}),Nn=new or([new or(yn,{classes:"ML__sqrt-index",type:"ignore"}),vt,xn],{type:"inner",classes:this.containsCaret?"ML__contains-caret":""});return Nn.height=vt.height,Nn.depth=vt.depth,this.caret&&(Nn.caret=this.caret),this.bind(y,Nn)}},sm=class extends or{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 bh(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"){bh(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){pd(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 fd(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 pd(b,(ae,he)=>{var pe,ve,we;if(!ae)return;const Re=ae.type,Je=he.isTight?(pe=cm[Re])!=null?pe:null:(ve=lm[Re])!=null?ve:null,vt=(we=Je==null?void 0:Je[he.type])!=null?we:null;vt===3&&bh(he,E),vt===4&&bh(he,ee),vt===5&&bh(he,re)}),a}function pd(a,y,b=void 0){if(!a)return b;a=[...a];for(const E of a)E.type==="lift"?b=pd(E.children,y,b):E.type==="ignore"?pd(E.children,y):(y(b,E),pd(E.children,y),b=E);return b}var ff=class qp extends Pn{constructor(y){super({type:"tooltip",command:y.command,mode:y.mode,style:y.style,body:y.body,displayContainsHighlight:!0}),this.tooltip=new Pn({type:"root",mode:y.content,body:y.tooltip,style:{}}),this.skipBoundary=!0,this.captureSelection=!1}static fromJson(y){return new qp(Me(Ce({},y),{tooltip:Ol(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 Me(Ce({},super.toJson()),{tooltip:b})}render(y){const b=Pn.createBox(new Di,this.body);if(!b)return null;const E=new Di({parent:y,mathstyle:"displaystyle"},{fontSize:Ds}),ee=Yc(fd(new or(this.tooltip.render(E),{classes:"ML__tooltip-content"}),E)),re=new or([ee,b],{classes:"ML__tooltip-container"});return this.caret&&(re.caret=this.caret),this.bind(y,re)}},hc=class Qp extends Pn{constructor(y,b){super(Me(Ce({},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 or(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 or(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=Ge(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)),Si(E)}};function Ol(a){if(Le(a))return a.map(E=>Ol(E));if(typeof a=="string")return Pn.fromJson(a);a=Ce({},a);for(const E of Tl)a[E]&&(a[E]=Ol(a[E]));a.args&&(a.args=dm(a.args)),a.array&&(a.array=Ol(a.array));const y=a.type;let b;y==="accent"&&(b=z.fromJson(a)),y==="array"&&(b=hi.fromJson(a)),y==="box"&&(b=ba.fromJson(a)),y==="chem"&&(b=n0.fromJson(a)),y==="composition"&&(b=fl.fromJson(a)),y==="delim"&&(b=r0.fromJson(a)),y==="enclose"&&(b=cd.fromJson(a)),y==="error"&&(b=vo.fromJson(a)),y==="extensible-symbol"&&(b=hf.fromJson(a)),y==="genfrac"&&(b=ou.fromJson(a)),y==="group"&&(b=Za.fromJson(a)),y==="latex"&&(b=qa.fromJson(a)),y==="latexgroup"&&(b=ud.fromJson(a)),y==="leftright"&&(b=$i.fromJson(a)),y==="macro"&&(b=au.fromJson(a)),y==="macro-argument"&&(b=bs.fromJson(a)),y==="operator"&&(b=hc.fromJson(a)),y==="overlap"&&(b=dc.fromJson(a)),y==="overunder"&&(b=Jo.fromJson(a)),y==="placeholder"&&(b=Qr.fromJson(a)),y==="prompt"&&(b=Ns.fromJson(a)),y==="phantom"&&(b=dd.fromJson(a)),y==="sizeddelim"&&(b=i0.fromJson(a)),y==="spacing"&&(b=hd.fromJson(a)),y==="subsup"&&(b=Yo.fromJson(a)),y==="surd"&&(b=o0.fromJson(a)),y==="text"&&(b=vs.fromJson(a)),y==="tooltip"&&(b=ff.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=Pn.fromJson(a));for(const E of Tl)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=>Ol(b))}:typeof y=="object"&&"atoms"in y?y.atoms.map(b=>Ol(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"]},pf={"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]$/,hm=/^[\u0393|\u0394\u0398\u039B\u039E\u03A0\u03A3\u03A5\u03A6\u03A8\u03A9]$/,fm=[/^[a-z]$/,/^[A-Z]$/,l0,hm],pm={iso:["it","it","it","it"],tex:["it","it","it","up"],french:["it","up","up","up"],upright:["up","up","up","up"]},mm=class extends Co{constructor(){super("math")}createAtom(a,y,b){var E,ee,re,ae;if(y===null)return new Pn({type:"mord",mode:"math",command:a,value:a,style:b});const he=window.MathfieldElement.isFunction((E=y.command)!=null?E:a);if(y.definitionType==="symbol"){const ve=new Pn({type:(ee=y.type)!=null?ee:"mord",mode:"math",command:(re=y.command)!=null?re:a,value:String.fromCodePoint(y.codepoint),style:b});return he&&(ve.isFunction=!0),a.startsWith("\\")&&(ve.verbatimLatex=a),ve}const pe=new Pn({type:"mord",mode:"math",command:(ae=y.command)!=null?ae:a,value:a,style:b});return he&&(pe.isFunction=!0),a.startsWith("\\")&&(pe.verbatimLatex=a),pe}serialize(a,y){const b=gm(a,Me(Ce({},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&&fm.forEach((he,pe)=>{var ve;he.test(a.value)&&pm[(ve=y.letterShapeStyle)!=null?ve:"tex"][pe]==="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 pf[b]&&!pf[b].test(a.value)?(a.value=nn(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 ya(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 he=Si(ee.map(pe=>pe._serialize(y)));return ae?ra(ae,he):he})}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 ya(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?`{${ra("\\fontshape",ee)}${Si(E)}}`:re?ra(re,Si(E)):Si(E)})}function bm(a,y){return ya(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?`{${ra("\\fontseries",ee)}${Si(E)}}`:re?ra(re,Si(E)):Si(E)})}function xm(a,y){return ya(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} ${Si(re)}`:Si(re)})}function wm(a,y,b){return ya(a,"fontFamily").map(E=>{var ee,re;const ae=xm(E,y),he=(re={roman:"textrm",monospace:"texttt","sans-serif":"textsf"}[(ee=E[0].style.fontFamily)!=null?ee:""])!=null?re:"";return he?`\\${he}{${Si(ae)}}`:E[0].style.fontFamily?`{\\fontfamily{${E[0].style.fontFamily}} ${Si(ae)}}`:b?`\\text{${Si(ae)}}`:Si(ae)})}var u0={roman:"","sans-serif":"ML__sans",monospace:"ML__tt"},Sm=class extends Co{constructor(){super("text")}createAtom(a,y,b){return y&&y.definitionType==="symbol"?new vs(a,String.fromCodePoint(y.codepoint),b!=null?b:{}):null}serialize(a,y){return wm(a,Me(Ce({},y),{defaultMode:"text"}),y.defaultMode!=="text")}getFont(a,y){var b,E,ee,re,ae;const{fontFamily:he}=y;if(u0[he]?a.classes+=" "+u0[he]:he&&a.setStyle("font-family",he),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 pe=y.fontSeries.match(/(.?[lbm])?(.?[cx])?/);pe&&(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=pe[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=pe[2])!=null?re:""])!=null?ae:"")}return"Main-Regular"}};new Sm;var Cm=class extends Co{constructor(){super("latex")}createAtom(a){return new qa(a)}serialize(a,y){return a.filter(b=>b instanceof qa&&!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:["","=","","="]}},mf={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:["\\","|","",""]}},h0={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:[")",")",")",")"]}},km={id:"apple.french",locale:"fr",displayName:"French",platform:"apple",virtualLayout:"azerty",score:0,mapping:{KeyA:["q","Q","\u2021","\u03A9"],KeyB:["b","B","\xDF","\u222B"],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\xEA","\xCA"],KeyF:["f","F","\u0192","\xB7"],KeyG:["g","G","\uFB01","\uFB02"],KeyH:["h","H","\xCC","\xCE"],KeyI:["i","I","\xEE","\xEF"],KeyJ:["j","J","\xCF","\xCD"],KeyK:["k","K","\xC8","\xCB"],KeyL:["l","L","\xAC","|"],KeyM:[",","?","\u221E","\xBF"],KeyN:["n","N","~","\u0131"],KeyO:["o","O","\u0153","\u0152"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xAE","\u201A"],KeyS:["s","S","\xD2","\u2211"],KeyT:["t","T","\u2020","\u2122"],KeyU:["u","U","\xBA","\xAA"],KeyV:["v","V","\u25CA","\u221A"],KeyW:["z","Z","\xC2","\xC5"],KeyX:["x","X","\u2248","\u2044"],KeyY:["y","Y","\xDA","\u0178"],KeyZ:["w","W","\u2039","\u203A"],Digit1:["&","1","\uF8FF","\xB4"],Digit2:["\xE9","2","\xEB","\u201E"],Digit3:['"',"3","\u201C","\u201D"],Digit4:["'","4","\u2018","\u2019"],Digit5:["(","5","{","["],Digit6:["\xA7","6","\xB6","\xE5"],Digit7:["\xE8","7","\xAB","\xBB"],Digit8:["!","8","\xA1","\xDB"],Digit9:["\xE7","9","\xC7","\xC1"],Digit0:["\xE0","0","\xF8","\xD8"],Space:[" "," "," "," "],Minus:[")","\xB0","}","]"],Equal:["-","_","\u2014","\u2013"],BracketLeft:["^","\xA8","\xF4","\xD4"],BracketRight:["$","*","\u20AC","\xA5"],Backslash:["`","\xA3","@","#"],Semicolon:["m","M","\xB5","\xD3"],Quote:["\xF9","%","\xD9","\u2030"],Backquote:["<",">","\u2264","\u2265"],Comma:[";",".","\u2026","\u2022"],Period:[":","/","\xF7","\\"],Slash:["=","+","\u2260","\xB1"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",".",",","."],IntlBackslash:["@","#","\u2022","\u0178"],NumpadEqual:["=","=","=","="]}},_m={id:"windows.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"windows",score:0,mapping:{KeyA:["q","Q","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:[",","?","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["a","A","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["z","Z","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["w","W","",""],Digit1:["&","1","",""],Digit2:["\xE9","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["\xE8","7","`",""],Digit8:["_","8","\\",""],Digit9:["\xE7","9","^",""],Digit0:["\xE0","0","@",""],Space:[" "," ","",""],Minus:[")","\xB0","]",""],Equal:["=","+","}",""],BracketLeft:["^","\xA8","",""],BracketRight:["$","\xA3","\xA4",""],Backslash:["*","\xB5","",""],Semicolon:["m","M","",""],Quote:["\xF9","%","",""],Backquote:["\xB2","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","\xA7","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},Em={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:["=","=","=","="]}},Dm={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:["<",">","|",""]}},Am={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:[".",".",".","."]}},Tm={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 f0(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 su(a){let y="";return a.shift&&(y+="shift+"),a.alt&&(y+="alt+"),a.ctrl&&(y+="ctrl+"),a.cmd&&(y+="cmd+"),a.win&&(y+="win+"),a.meta&&(y+="meta+"),y+a.key}var Bm={enter:"[Enter]",escape:"[Escape]",backspace:"[Backspace]",tab:"[Tab]",space:"[Space]",pausebreak:"[Pause]",insert:"[Insert]",home:"[Home]",pageup:"[PageUp]",delete:"[Delete]",end:"[End]",pagedown:"[PageDown]",right:"[ArrowRight]",left:"[ArrowLeft]",down:"[ArrowDown]",up:"[ArrowUp]",numpad0:"[Numpad0]",numpad1:"[Numpad1]",numpad2:"[Numpad2]",numpad3:"[Numpad3]",numpad4:"[Numpad4]",numpad5:"[Numpad5]",numpad6:"[Numpad6]",numpad7:"[Numpad7]",numpad8:"[Numpad8]",numpad9:"[Numpad9]",numpad_divide:"[NumpadDivide]",numpad_multiply:"[NumpadMultiply]",numpad_subtract:"[NumpadSubtract]",numpad_add:"[NumpadAdd]",numpad_decimal:"[NumpadDecimal]",numpad_separator:"[NumpadComma]",capslock:"[Capslock]",f1:"[F1]",f2:"[F2]",f3:"[F3]",f4:"[F4]",f5:"[F5]",f6:"[F6]",f7:"[F7]",f8:"[F8]",f9:"[F9]",f10:"[F10]",f11:"[F11]",f12:"[F12]",f13:"[F13]",f14:"[F14]",f15:"[F15]",f16:"[F16]",f17:"[F17]",f18:"[F18]",f19:"[F19]"},md=[],gd;function gf(){switch(at()){case"macos":case"ios":return"apple";case"windows":return"windows"}return"linux"}function Ko(a){(!a.platform||a.platform===gf())&&md.push(a)}function Om(a,y){var b;const E={shift:!1,alt:!1,cmd:!1,win:!1,meta:!1,ctrl:!1,key:""};if(!a)return E;for(const[ee,re]of Object.entries(y.mapping)){if(re[0]===a)return E.key=`[${ee}]`,E;if(re[1]===a)return E.shift=!0,E.key=`[${ee}]`,E;if(re[2]===a)return E.alt=!0,E.key=`[${ee}]`,E;if(re[3]===a)return E.shift=!0,E.alt=!0,E.key=`[${ee}]`,E}return E.key=(b=Bm[a])!=null?b:"",E}function $m(a){if(a.code)return a;const y=Object.entries(vd().mapping);let b=!1,E=!1,ee="";for(let re=0;re<4;re++){for(const[ae,he]of y)if(he[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,Me(Ce({},a),{altKey:b,shiftKey:E,code:ee}))}function Rm(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 md)((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);md.sort((ee,re)=>re.score-ee.score)}function Nm(a){gd=md.find(y=>a.startsWith(y.locale))}function vd(){return gd!=null?gd:md[0]}function Fm(){switch(gf()){case"apple":return mf;case"windows":return d0;case"linux":return h0}return mf}switch(gf()){case"apple":Ko(mf),Ko(km),Ko(Tm),Ko(Lm);break;case"windows":Ko(d0),Ko(_m),Ko(Im),Ko(Dm);break;case"linux":Ko(h0),Ko(Em),Ko(Pm),Ko(Am);break}Ko(Mm);function vf(a){var y;const b=/macos|ios/.test(at()),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:"* 🔢",numpaddivide:"/ 🔢",numpadsubtract:"- 🔢",numpadadd:"+ 🔢",numpaddecimal:". 🔢",numpadcomma:", 🔢",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 xh(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 fc(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 wh(a){return a.ctrlKey||a.metaKey||["Dead","Process"].includes(a.key)?!1:a.code===""?!0:Km.has(a.code)}function Sh(){var a;let y=document.activeElement;for(;(a=y==null?void 0:y.shadowRoot)!=null&&a.activeElement;)y=y.shadowRoot.activeElement;return y}var Fs=class yl{static get scrim(){return yl._scrim||(yl._scrim=new yl),yl._scrim}static open(y){yl.scrim.open(y)}static close(){yl.scrim.close()}static get state(){return yl.scrim.state}static get element(){return yl.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=Sh();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:"",Sh()!==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,he=!1;const pe=new AbortController,ve=pe.signal;return a.addEventListener("keydown",we=>{if(re||we.key==="Process"||we.code==="CapsLock"||/(Control|Meta|Alt|Shift)(Left|Right)/.test(we.code)){E=null;return}E=we,ee=null,b.onKeystroke(we)?a.textContent="":E=null},{capture:!0,signal:ve}),a.addEventListener("keypress",we=>{re||(E&&ee&&b.onKeystroke(E),ee=we)},{capture:!0,signal:ve}),a.addEventListener("compositionstart",we=>{a.textContent="",re=!0,b.onCompositionStart(we.data)},{capture:!0,signal:ve}),a.addEventListener("compositionupdate",we=>{re&&b.onCompositionUpdate(we.data)},{capture:!0,signal:ve}),a.addEventListener("compositionend",we=>{a.textContent="",re&&(re=!1,b.onCompositionEnd(we.data))},{capture:!0,signal:ve}),a.addEventListener("beforeinput",we=>we.stopImmediatePropagation(),{signal:ve}),a.addEventListener("input",we=>{var Re;if(!re&&(a.textContent="",we.inputType!=="insertCompositionText")){if(we.inputType==="insertFromPaste"){we.preventDefault(),we.stopPropagation();return}b.onInput((Re=we.data)!=null?Re:""),we.preventDefault(),we.stopPropagation()}},{signal:ve}),a.addEventListener("paste",we=>{a.focus({preventScroll:!0}),a.textContent="",b.onPaste(we)||we.preventDefault(),we.stopImmediatePropagation()},{signal:ve}),a.addEventListener("cut",we=>b.onCut(we),{capture:!0,signal:ve}),a.addEventListener("copy",we=>b.onCopy(we),{capture:!0,signal:ve}),a.addEventListener("blur",we=>{var Re,Je;if(((Je=(Re=we.relatedTarget)==null?void 0:Re._mathfield)==null?void 0:Je.element)===y){a.focus({preventScroll:!0}),we.preventDefault(),we.stopPropagation();return}const vt=Fs.state;if(vt==="open"||vt==="opening"){we.preventDefault(),we.stopPropagation();return}if(we.relatedTarget===we.target.getRootNode().host){we.preventDefault(),we.stopPropagation();return}he||ae||(he=!0,E=null,ee=null,b.onBlur(),he=!1)},{capture:!0,signal:ve}),a.addEventListener("focus",we=>{he||ae||(ae=!0,b.onFocus(),ae=!1)},{capture:!0,signal:ve}),{dispose:()=>pe.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:()=>Sh()===a,setAriaLabel:we=>a.setAttribute("aria-label",we),setValue:we=>{var Re;a.textContent=we,a.style.left="-1000px",(Re=window.getSelection())==null||Re.selectAllChildren(a)},moveTo:(we,Re)=>{a.style.top=`${Re}px`,a.style.left=`${we}px`}}}function lu(a){var y;if(!a||!wh(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=$m(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(yt()){const y=at(),b=a.startsWith("!"),E=a.endsWith(y);if(b&&!E||!b&&E)return!0}return a==="!other"?!1:a==="other"}function Zm(a,y,b){if(a.length===0)return"";const E=su(f0(p0(b))),ee=su({key:b.key,shift:b.shiftKey,alt:b.altKey,ctrl:b.ctrlKey,meta:b.metaKey||b.ctrlKey&&/macos|ios/.test(at()),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 Le(y)&&(y=y.length>0?y[0]+"("+y.slice(1).join("")+")":""),y}function jm(a,y){let b=[];if(typeof y=="string"){const re=rd[y];Le(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(vf)}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=f0(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=at()==="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 Me(Ce({},a),{key:su(b)});const ee=Om(b.key,y);if(!ee)return Me(Ce({},a),{key:su(b)});if(ee.shift&&b.shift||ee.alt&&b.alt)throw new Error(`The keybinding ${a.key} (${yf(a.command)}) is conflicting with the key combination ${su(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,Me(Ce({},a),{key:su(ee)})}function yf(a){if(Array.isArray(a)){const y=[...a];return y.shift()+"("+y.map(b=>typeof b=="string"?`"${b}"`:b.toString()).join(", ")+")"}return a}function Um(a,y){const b=[],E=[];for(const ee of a)try{const re=Vm(ee,y);if(!re)continue;const ae=E.find(he=>he.key===re.key&&he.ifMode===re.ifMode);if(ae)throw new Error(`Ambiguous key binding ${ee.key} (${yf(ee.command)}) matches ${ae.key} (${yf(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 si{constructor(){super("latex")}createAtom(a){return new qa(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"}),va(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(Wa(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 pe of y)oe.test(pe)&&re.push(new qa(pe));let ae=a.at(a.position);if(ae instanceof ud&&(ae=ae.lastChild),!(ae.parent instanceof ud)){const pe=new ud("");ae.parent.addChildAfter(pe,ae),ae=pe.firstChild}const he=ae.parent.addChildrenAfter(re,ae);return a.silenceNotifications=ee,b.selectionMode==="before"||(b.selectionMode==="item"?a.setSelection(a.anchor,a.offsetOf(he)):he&&(a.position=a.offsetOf(he))),a.contentDidChange({data:y,inputType:"insertText"}),a.silenceNotifications=E,!0}};function Xm(a){return a.atoms.find(y=>y.type==="latexgroup")}function yd(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 pe=a.at(E);ee=pe instanceof qa&&pe.isSuggestion,ee||E++}if(!ee)return[void 0,void 0];let ae=E,he=!1;for(;ae<=re&&!he;){const pe=a.at(ae);he=!(pe instanceof qa&&pe.isSuggestion),he||ae++}return[E-1,ae-1]}new Gm;function Ch(a){const y=yd(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 bd(a,y){var b;const{model:E}=a;Ch(a);for(const we of yd(E))we.isError=!1;if(!E.selectionIsCollapsed||a.options.popoverPolicy==="off"){uu(a);return}const ee=[];let re=E.at(E.position);for(;re&&re instanceof qa&&/^[a-zA-Z\*]$/.test(re.value);)re=re.leftSibling;if(re&&re instanceof qa&&re.value==="\\")for(ee.push(re),re=re.rightSibling;re&&re instanceof qa&&/^[a-zA-Z\*]$/.test(re.value);)ee.push(re),re=re.rightSibling;const ae=ee.map(we=>we.value).join(""),he=$t(a,ae);if(he.length===0){if(/^\\[a-zA-Z\*]+$/.test(ae))for(const we of ee)we.isError=!0;uu(a);return}const pe=(b=y==null?void 0:y.atIndex)!=null?b:0;a.suggestionIndex=pe<0?he.length-1:pe%he.length;const ve=he[a.suggestionIndex];if(ve!==ae){const we=ee[ee.length-1];we.parent.addChildrenAfter([...ve.slice(ae.length-ve.length)].map(Re=>new qa(Re,{isSuggestion:!0})),we),pc(a,{interactive:!0})}Jm(a,he)}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 cu(a,y="accept",b){var E,ee;uu(a);const re=Xm(a.model);if(!re)return!1;if(y==="accept-suggestion"||y==="accept-all"){const ve=yd(a.model).filter(we=>we.isSuggestion);if(ve.length!==0){for(const we of ve)we.isSuggestion=!1;a.model.position=a.model.offsetOf(ve[ve.length-1])}if(y==="accept-suggestion")return ve.length!==0}const he=yd(a.model).filter(ve=>!ve.isSuggestion).map(ve=>ve.value).join(""),pe=re.leftSibling;return re.parent.removeChild(re),a.model.position=a.model.offsetOf(pe),a.switchMode((E=b==null?void 0:b.mode)!=null?E:"math"),y==="reject"||(si.insert(a.model,he,{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 Mh(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 bf(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 Ym(a,y){const b=new Di({from:a.context}),E=new Pn({mode:"math",type:"root",body:ja(y,{context:b})}),ee=Yc(fd(new or(E.render(b),{classes:"ML__base"}),b));return Jc(ee,{classes:"ML__latex"}).toMarkup()}function Jm(a,y){var b;if(y.length===0){uu(a);return}let E="";for(const[re,ae]of y.entries()){const he=ae,pe=Ym(a,ae),ve=jm(a.keybindings,he).join("<br>");E+=`<li role="button" data-command="${he}" ${re===a.suggestionIndex?"class=ML__popover__current":""}><span class="ML__popover__latex">${he}</span><span class="ML__popover__command">${pe}</span>`,ve&&(E+=`<span class="ML__popover__keybinding">${ve}</span>`),E+="</li>"}const ee=qm(a,`<ul>${E}</ul>`);xf()&&((b=ee.querySelector(".ML__popover__current"))==null||b.scrollIntoView({block:"nearest",inline:"nearest"})),setTimeout(()=>{var re;ee&&!xf()&&(ee.classList.add("is-visible"),kh(a),(re=ee.querySelector(".ML__popover__current"))==null||re.scrollIntoView({block:"nearest",inline:"nearest"}))},32)}function xf(){const a=document.getElementById("mathlive-suggestion-popover");return a?a.classList.contains("is-visible"):!1}function kh(a,y){var b;if(!a.element||a.element.mathfield!==a||!xf())return;if(((b=a.model.at(a.model.position))==null?void 0:b.type)!=="latex"){uu(a);return}if(y!=null&&y.deferred){setTimeout(()=>kh(a),32);return}const E=Rs(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,he=window.innerHeight-document.documentElement.clientHeight,pe=window.mathVirtualKeyboard.boundingRect.height,ve=document.getElementById("mathlive-suggestion-popover");E.x+ve.offsetWidth/2>re-ae?ve.style.left=`${re-ve.offsetWidth-ae}px`:E.x-ve.offsetWidth/2<0?ve.style.left="0":ve.style.left=`${E.x-ve.offsetWidth/2}px`;const we=E.y-E.height;ee-he-pe-E.y<we?(ve.classList.add("ML__popover--reverse-direction"),ve.classList.remove("top-tip"),ve.classList.add("bottom-tip"),ve.style.top=`${E.y-E.height-ve.offsetHeight-15}px`):(ve.classList.remove("ML__popover--reverse-direction"),ve.classList.add("top-tip"),ve.classList.remove("bottom-tip"),ve.style.top=`${E.y+15}px`)}function uu(a){a.suggestionIndex=0;const y=document.getElementById("mathlive-suggestion-popover");y&&(y.classList.remove("is-visible"),y.innerHTML="")}function qm(a,y){let b=document.getElementById("mathlive-suggestion-popover");return b||(b=Mh("mathlive-suggestion-popover"),Bo("suggestion-popover"),Bo("core"),b.addEventListener("pointerdown",E=>E.preventDefault()),b.addEventListener("click",E=>{let ee=E.target;for(;ee&&!ee.dataset.command;)ee=ee.parentElement;ee&&(cu(a,"reject"),si.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")&&(bf("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 _h=null,y0,b0,wf=((b0=(y0=globalThis==null?void 0:globalThis.document)==null?void 0:y0.currentScript)==null?void 0:b0.src)||eg();function x0(a){return zl(this,null,function*(){if(/^(?:[a-z+]+:)?\/\//i.test(a))return new URL(a).href;if(_h===null)try{const y=yield fetch(wf,{method:"HEAD"});y.status===200&&(_h=y.url)}catch(y){console.error(`Invalid URL "${a}" (relative to "${wf}")`)}return new URL(a,_h!=null?_h:wf).href})}function tg(a,y,b={}){return new FontFace(a,`url(${y}.woff2) format('woff2')`,b)}var Ho="not-loaded";function ng(){return zl(this,null,function*(){return Ho="not-loaded",Eh()})}function Eh(){return zl(this,null,function*(){var a;if(Ho!=="not-loaded")return;if(Ho="loading",(a=getComputedStyle(document.documentElement).getPropertyValue("--ML__static-fonts"))!=null?a:!1){Ho="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))){Ho="ready";return}if(!window.MathfieldElement.fontsDirectory){Ho="not-loaded";return}const ee=yield x0(window.MathfieldElement.fontsDirectory);if(!ee){document.body.classList.add("ML__fonts-did-not-load"),Ho="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(he=>{try{return he.load()}catch(pe){}}))).forEach(he=>document.fonts.add(he)),Ho="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")}Ho="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 va(a,y){a&&(a.dirty||(a.dirty=!0,requestAnimationFrame(()=>{Fo(a)&&a.dirty&&(a.atomBoundsCache=new Map,pc(a,y),a.atomBoundsCache=void 0)})))}function ig(a,y){var b;y=y!=null?y:{};const E=new Di({from:Me(Ce({},a.context),{atomIdsSettings:{seed:y.forHighlighting?rg(Pn.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 Jc(fd(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 pc(a,y){if(!Fo(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 he=a.element.querySelector("[part=menu-toggle]");if(he&&(a.model.atoms.length<=1||a.disabled||a.readOnly&&!a.hasEditableContent||a.userSelect==="none"?he.style.display="none":he.style.display=""),a.model.atoms.length<=1){const pe=a.options.contentPlaceholder;pe&&(ae+=`<span part=placeholder class="ML__content-placeholder">${Va(pe)}</span>`)}E.innerHTML=window.MathfieldElement.createHTML(ae),Lh(a,y.interactive),a.dirty=!1}function Lh(a,y){const b=a.field;if(!b)return;for(const he of b.querySelectorAll(".ML__selection, .ML__contains-highlight"))he.remove();!(y!=null&&y)&&Ho!=="error"&&Ho!=="ready"&&setTimeout(()=>{Ho==="ready"?Lh(a):setTimeout(()=>Lh(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){kh(a,{deferred:!0});let he=E.at(E.position);for(;he&&he.type!=="prompt"&&!(he.containsCaret&&he.displayContainsHighlight);)he=he.parent;if(he!=null&&he.containsCaret&&he.displayContainsHighlight){const pe=ad(a,Il(a,he),ae);if(pe){pe.left/=ae,pe.right/=ae,pe.top/=ae,pe.bottom/=ae;const ve=document.createElement("div");ve.classList.add("ML__contains-highlight"),ve.style.position="absolute",ve.style.left=`${pe.left+1}px`,ve.style.top=`${Math.ceil(pe.top)}px`,ve.style.width=`${Math.ceil(pe.right-pe.left)}px`,ve.style.height=`${Math.ceil(pe.bottom-pe.top)}px`,b.insertBefore(ve,b.childNodes[0])}}return}for(const he of ag(sd(a,{excludeAtomsWithBackground:!0}))){he.left/=ae,he.right/=ae,he.top/=ae,he.bottom/=ae;const pe=document.createElement("div");pe.classList.add("ML__selection"),pe.style.position="absolute",pe.style.left=`${he.left}px`,pe.style.top=`${he.top}px`,pe.style.width=`${Math.ceil(he.right-he.left)}px`,pe.style.height=`${Math.ceil(he.bottom-he.top-1)}px`,b.insertBefore(pe,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,zs;function Oo(a,y){y=Ce({target:"mathfield",canUndo:!1,audioFeedback:void 0,changeContent:!1,changeSelection:!1},y!=null?y:{}),zs||(zs={});for(const b of Object.keys(a))console.assert(!zs[b],"Selector already defined: ",b),zs[b]=Me(Ce({},y),{fn:a[b]})}function Sf(a){let y;if(Array.isArray(a)){if(a[0]==="performWithFeedback")return Sf(a[1]);y=a[0]}else y=a;return y=y.replace(/-\w/g,b=>b[1].toUpperCase()),zs[y]}function du(a){var y;return(y=Sf(a))==null?void 0:y.target}function og(a,y){var b;if(!y)return!1;let E,ee=[],re=!1,ae=!1;Le(y)?(E=y[0],ee=y.slice(1)):E=y,E=E.replace(/-\w/g,ve=>ve[1].toUpperCase());const he=zs[E],pe=he==null?void 0:he.target;if(pe==="model"){if(!a.isSelectionEditable&&(he!=null&&he.changeContent))return a.model.announce("plonk"),!1;/^(delete|add)/.test(E)&&(E!=="deleteBackward"&&a.flushInlineShortcutBuffer(),a.snapshot(E)),/^complete/.test(E)||Ch(a),zs[E].fn(a.model,...ee),bd(a),ae=!0,re=!0}else if(pe==="virtual-keyboard")ae=(b=window.mathVirtualKeyboard.executeCommand(y))!=null?b:!1,re=!0;else if(zs[E]){if(!a.isSelectionEditable&&(he!=null&&he.changeContent))return a.model.announce("plonk"),!1;/^(undo|redo)/.test(E)&&a.flushInlineShortcutBuffer(),ae=zs[E].fn(a,...ee),re=!0}else throw new Error(`Unknown command "${E}"`);return pe!=="virtual-keyboard"&&(!a.model.selectionIsCollapsed||he!=null&&he.changeSelection&&y!=="deleteBackward")&&(a.flushInlineShortcutBuffer(),he!=null&&he.changeContent||a.stopCoalescingUndo(),a.defaultStyle={}),ae&&va(a),re}function sg(a,y){var b;if(!a)return!1;a.focus(),vp.keypressVibration&&pt()&&navigator.vibrate(S0);const E=Sf(y);window.MathfieldElement.playSound((b=E==null?void 0:E.audioFeedback)!=null?b:"keypress");const ee=a.executeCommand(y);return a.scrollIntoView(),ee}Oo({performWithFeedback:(a,y)=>sg(a,y)});function lg(a){return bd(a,{atIndex:a.suggestionIndex+1}),!1}function cg(a){return bd(a,{atIndex:a.suggestionIndex-1}),!1}Oo({complete:cu},{target:"mathfield",audioFeedback:"return",canUndo:!0,changeContent:!0,changeSelection:!0}),Oo({nextSuggestion:lg,previousSuggestion:cg},{target:"mathfield",audioFeedback:"keypress",changeSelection:!0});var Dh="mathlive#virtual-keyboard-message";function Cf(a){var y;return a.type!=="message"?!1:((y=a.data)==null?void 0:y.type)===Dh}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(Cf(y)){if(!ld(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(Ce({type:Dh,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:"αβγ",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.greek",rows:[[{label:"<i>φ</i>",class:"MLK__tex hide-shift",insert:"\\varphi",aside:"phi var.",shift:"\\Phi"},{label:"<i>ς</i>",class:"MLK__tex hide-shift",insert:"\\varsigma",aside:"sigma var.",shift:"\\Sigma"},{label:"<i>ϵ</i>",class:"MLK__tex hide-shift",insert:"\\epsilon",aside:"espilon",shift:'\\char"0190'},{label:"<i>ρ</i>",class:"MLK__tex hide-shift",insert:"\\rho",aside:"rho",shift:'\\char"3A1'},{label:"<i>τ</i>",class:"MLK__tex hide-shift",insert:"\\tau",aside:"tau",shift:'\\char"3A4'},{label:"<i>υ</i>",class:"MLK__tex hide-shift",insert:"\\upsilon",aside:"upsilon",shift:"\\Upsilon"},{label:"<i>θ</i>",class:"MLK__tex hide-shift",insert:"\\theta",aside:"theta",shift:"\\Theta"},{label:"<i>ι</i>",class:"MLK__tex hide-shift",insert:"\\iota",aside:"iota",shift:'\\char"399'},{label:"<i>ο</i>",class:"MLK__tex hide-shift",insert:"\\omicron",aside:"omicron",shift:'\\char"39F'},{label:"<i>π</i>",class:"MLK__tex hide-shift",insert:"\\pi",aside:"pi",shift:"\\Pi"}],["[separator-5]",{label:"<i>α</i>",class:"MLK__tex hide-shift",insert:"\\alpha",aside:"alpha",shift:'\\char"391'},{label:"<i>σ</i>",class:"MLK__tex hide-shift",insert:"\\sigma",aside:"sigma",shift:"\\Sigma"},{label:"<i>δ</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>γ</i>",class:"MLK__tex hide-shift",insert:"\\gamma",aside:"gamma",shift:"\\Gamma"},{label:"<i>η</i>",class:"MLK__tex hide-shift",insert:"\\eta",aside:"eta",shift:'\\char"397'},{label:"<i>ξ</i>",class:"MLK__tex hide-shift",insert:"\\xi",aside:"xi",shift:"\\Xi"},{label:"<i>κ</i>",class:"MLK__tex hide-shift",insert:"\\kappa",aside:"kappa",shift:"\\Kappa"},{label:"<i>λ</i>",class:"MLK__tex hide-shift",insert:"\\lambda",aside:"lambda",shift:"\\Lambda"},"[separator-5]"],["[shift]",{label:"<i>ζ</i>",class:"MLK__tex hide-shift",insert:"\\zeta",aside:"zeta",shift:'\\char"396'},{label:"<i>χ</i>",class:"MLK__tex hide-shift",insert:"\\chi",aside:"chi",shift:'\\char"3A7'},{label:"<i>ψ</i>",class:"MLK__tex hide-shift",insert:"\\psi",aside:"zeta",shift:"\\Psi"},{label:"<i>ω</i>",class:"MLK__tex hide-shift",insert:"\\omega",aside:"omega",shift:"\\Omega"},{label:"<i>β</i>",class:"MLK__tex hide-shift",insert:"\\beta",aside:"beta",shift:'\\char"392'},{label:"<i>ν</i>",class:"MLK__tex hide-shift",insert:"\\nu",aside:"nu",shift:'\\char"39D'},{label:"<i>μ</i>",class:"MLK__tex hide-shift",insert:"\\mu",aside:"mu",shift:'\\char"39C'},"[backspace]"],["[separator]",{label:"<i>ε</i>",class:"MLK__tex",insert:"\\varepsilon",aside:"espilon var."},{label:"<i>ϑ</i>",class:"MLK__tex",insert:"\\vartheta",aside:"theta var."},{label:"<i>ϰ</i>",class:"MLK__tex",insert:"\\varkappa",aside:"kappa var."},{label:"<i>ϖ</i>",class:"MLK__tex",insert:"\\varpi",aside:"pi var."},{label:"<i>ϱ</i>",class:"MLK__tex",insert:"\\varrho",aside:"rho var."},"[left]","[right]","[action]"]]},symbols:{label:"∞\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]"]]}},Ah={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"}]},xd;function M0(a,y){var b,E,ee;const re=$l.singleton;if(!re)return;const ae=hu(a),he=(E=(b=re.getKeycap(ae==null?void 0:ae.id))==null?void 0:b.variants)!=null?E:"";if(typeof he=="string"&&!k0(he)||Array.isArray(he)&&he.length===0){y==null||y();return}const pe={};let ve="";for(const xn of hg(he)){const ir=E0(xn),yn=Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);pe[yn]=ir;const[Nn,dr]=Th(ir);ve+=`<div id=${yn} class="item ${dr}">${Nn}</div>`}const we=document.createElement("div");we.setAttribute("aria-hidden","true"),we.className="MLK__variant-panel",we.style.height="auto";const Re=Object.keys(pe).length;let Je=5;Re===1?Je=1:Re===2||Re===4?Je=2:Re===3||Re===5||Re===6?Je=3:Re>=7&&Re<14&&(Je=4),we.style.width=`calc(var(--variant-keycap-length) * ${Je} + 12px)`,we.innerHTML=vp.createHTML(ve),Fs.open({root:(ee=re==null?void 0:re.container)==null?void 0:ee.querySelector(".ML__keyboard"),child:we}),xd=new AbortController;const{signal:vt}=xd,kt=a==null?void 0:a.getBoundingClientRect();if(kt){kt.top-we.clientHeight<0&&(we.style.width="auto",Re<=6?we.style.height="56px":Re<=12?we.style.height="108px":Re<=18?we.style.height="205px":we.classList.add("compact"));const xn=Math.max(0,Math.min(window.innerWidth-we.offsetWidth,(kt.left+kt.right-we.offsetWidth)/2)),ir=kt.top-we.clientHeight+5;we.style.transform=`translate(${xn}px, ${ir}px)`,we.classList.add("is-visible"),requestAnimationFrame(()=>{we.addEventListener("pointerup",yn=>{const Nn=hu(yn.target);!(Nn!=null&&Nn.id)||!pe[Nn.id]||(Mf(pe[Nn.id]),wd(),y==null||y(),yn.preventDefault())},{capture:!0,passive:!1,signal:vt}),we.addEventListener("pointerenter",yn=>{const Nn=hu(yn.target);!(Nn!=null&&Nn.id)||!pe[Nn.id]||Nn.classList.add("is-active")},{capture:!0,signal:vt}),we.addEventListener("pointerleave",yn=>{const Nn=hu(yn.target);!(Nn!=null&&Nn.id)||!pe[Nn.id]||Nn.classList.remove("is-active")},{capture:!0,signal:vt}),window.addEventListener("pointercancel",()=>{wd(),y==null||y()},{signal:vt}),window.addEventListener("pointerup",()=>{wd(),y==null||y()},{signal:vt})})}}function wd(){xd==null||xd.abort(),xd=null,Fs.state==="open"&&Fs.close()}function dg(a){if(a==="foreground-color"){const y=[];for(const b of Object.keys(Ue))y.push({class:"swatch-button",label:'<span style="border: 3px solid '+Ue[b]+'"></span>',command:["applyStyle",{color:b}]});return y}if(a==="background-color"){const y=[];for(const b of Object.keys(He))y.push({class:"swatch-button",label:'<span style="background:'+He[b]+'"></span>',command:["applyStyle",{backgroundColor:b}]});return y}}function k0(a){return Ah[a]!==void 0}function hg(a){var y;return typeof a!="string"?a:(Ah[a]||(Ah[a]=(y=dg(a))!=null?y:[]),Ah[a])}function fg(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} {${fg(a[y])}}`).join("")}function Sd(a){if(!a)return"";const y=new Di,b=new Pn({mode:"math",type:"root",body:ja(a,{context:y,args:ee=>ee==="@"?"{\\class{ML__box-placeholder}{\\blacksquare}}":"\\placeholder{}"})}),E=Yc(fd(new or(b.render(y),{classes:"ML__base"}),y));return Jc(E,{classes:"ML__latex"}).toMarkup()}function Cd(a){var y;if(Array.isArray(a))return a.map(E=>Cd(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=>E0(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 he=vd();he&&(E=he.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 he of re){const pe=[];for(const ve of he)/[a-z]/.test(ve)?pe.push({label:ve,class:"hide-shift",shift:{label:ve.toUpperCase()},variants:k0(ve)?ve:void 0}):ve==="~"?E!=="dvorak"?pe.push("[backspace]"):pe.push({label:"[backspace]",width:1}):ve==="^"?pe.push("[shift]"):ve===" "&&pe.push("[separator-5]");ae.push(pe)}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:Cd({rows:ae})}}function _0(a){if(a==="alphabetic")return mg();if(typeof a=="string")return console.assert(C0[a]!==void 0,`MathLive 0.98.5: unknown keyboard layout "${a}"`),_0(C0[a]);let y;if("rows"in a&&Array.isArray(a.rows)){console.assert(!("layers"in a||"markup"in a),'MathLive 0.98.5: when providing a "rows" property, "layers" and "markup" are ignored');const ee=a,{rows:re}=ee,ae=ut(ee,["rows"]);y=Me(Ce({},ae),{layers:Cd({rows:a.rows})})}else if("markup"in a&&typeof a.markup=="string"){const ee=a,{markup:re}=ee,ae=ut(ee,["markup"]);y=Me(Ce({},ae),{layers:Cd(a.markup)})}else y=Ce({},a),"layers"in a?y.layers=Cd(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()){fu(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 he=ae,pe=[re===y?"selected":"layer-switch"];he.tooltip&&pe.push("MLK__tooltip"),he.labelClass&&pe.push(...he.labelClass.split(" ")),ee+=`<div class="${pe.join(" ")}"`,he.tooltip&&(ee+=" data-tooltip='"+((b=ft(he.tooltip))!=null?b:he.tooltip)+"' "),re!==y&&(ee+=`data-layer="${he.layers[0].id}"`),ee+=`>${(E=he.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='${ft("tooltip.undo")}'>
|
|
|
<svg><use xlink:href='#svg-undo' /></svg>
|
|
|
</div>`,redo:`<div class='action ${y.canRedo===!1?"disabled":""}'
|
|
|
data-command='"redo"'
|
|
|
data-tooltip='${ft("tooltip.redo")}'>
|
|
|
<svg><use xlink:href='#svg-redo' /></svg>
|
|
|
</div>`,cutToClipboard:`
|
|
|
<div class='action'
|
|
|
data-command='"cutToClipboard"'
|
|
|
data-tooltip='${ft("tooltip.cut to clipboard")}'>
|
|
|
<svg><use xlink:href='#svg-cut' /></svg>
|
|
|
</div>
|
|
|
`,copyToClipboard:`
|
|
|
<div class='action'
|
|
|
data-command='"copyToClipboard"'
|
|
|
data-tooltip='${ft("tooltip.copy to clipboard")}'>
|
|
|
<svg><use xlink:href='#svg-copy' /></svg>
|
|
|
</div>
|
|
|
`,pasteFromClipboard:`
|
|
|
<div class='action'
|
|
|
data-command='"pasteFromClipboard"'
|
|
|
data-tooltip='${ft("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=$l.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]=Th(b);a.innerHTML=window.MathfieldElement.createHTML(E)}}function xg(){Bo("virtual-keyboard"),Bo("core"),Eh()}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,he)=>Mg(a,ae,he)).join(""));const E=document.createElement("div");E.className="MLK__backdrop",E.appendChild(b),y.appendChild(E),y.addEventListener("pointerdown",_g,{passive:!1});const ee=y.querySelectorAll(".ML__edit-toolbar");if(ee)for(const ae of ee)ae.addEventListener("click",he=>{var pe,ve;let we=he.target,Re="";for(;we&&!Re;)Re=(pe=we==null?void 0:we.getAttribute("data-command"))!=null?pe:"",we=(ve=we==null?void 0:we.parentElement)!=null?ve: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",he=>he.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(kg(a,ee)),E.push("</div>");return E.join("")}function kg(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,he]=Th(ee);/(^|\s)separator/.test(he)?b+=`<div class="${he}"`:b+=`<div tabindex="-1" id="${re}" class="${he}"`,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 Th(a,y={shifted:!1}){var b,E,ee,re,ae,he,pe;let ve="",we=(b=a.class)!=null?b:"";if(y.shifted&&fu(a)&&(we+=" is-active"),y.shifted&&"shift"in a)typeof a.shift=="string"?ve=Sd(a.shift):typeof a.shift=="object"&&(ve=a.shift.label?a.shift.label:(E=Sd(a.shift.latex||a.shift.insert||"")||a.shift.key)!=null?E:""),typeof a.shift=="object"&&(we=(re=(ee=a.shift.class)!=null?ee:a.class)!=null?re:"");else{if(ve=a.label?a.label:(ae=Sd(a.latex||a.insert||"")||a.key)!=null?ae:"",a.shift){let Re;typeof a.shift=="string"?Re=Sd(a.shift):a.shift.label?Re=a.shift.label:Re=(he=Sd(a.shift.latex||a.shift.insert||"")||a.shift.key)!=null?he:"",ve+=`<span class="MLK__shift">${Re}</span>`}a.aside&&(ve+=`<aside>${a.aside}</aside>`)}return a.layer&&!/layer-switch/.test(we)&&(we+=" layer-switch"),/(^|\s)(separator|action|shift|fnbutton|bigfnbutton)($|\s)/.test(we)||(we+=" MLK__keycap"),!/\bw[0-9]+\b/.test(we)&&a.width&&(we+=(pe={0:" w0",.5:" w5",1.5:" w15",2:" w20",5:" w50"}[a.width])!=null?pe:""),[ve,we||"MLK__keycap"]}var mc={"[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:"−",shift:"\\pm",class:"big-op hide-shift"},"[/]":{class:"big-op hide-shift",shift:{class:"",latex:"\\frac{1}{#@}"},variants:["/","\\div","\\%","\\oslash"],latex:"\\frac{#@}{#?}",label:"÷"},"[*]":{variants:[{latex:"\\prod_{#0}^{#0}",class:"small"},"\\otimes","\\cdot"],latex:"\\cdot",label:"×",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 E0(a){var y;if(typeof a=="string"){if(a==="[.]"&&window.MathfieldElement.decimalSeparator===","&&(a="[,]"),!mc[a])return{latex:a};a={label:a}}let b;return"label"in a&&a.label&&mc[a.label]&&(b=Me(Ce(Ce({},mc[a.label]),a),{label:mc[a.label].label})),"key"in a&&a.key&&mc[a.key]&&(b=Me(Ce(Ce({},mc[a.key]),a),{key:mc[a.key].key})),b?(b.command==="insertDecimalSeparator"&&(b.label=(y=window.MathfieldElement.decimalSeparator)!=null?y:"."),a.label==="[action]"&&(b=Ce(Ce({},b),window.mathVirtualKeyboard.actionKeycap)),a.label==="[shift]"&&(b=Ce(Ce({},b),window.mathVirtualKeyboard.shiftKeycap)),a.label==="[backspace]"&&(b=Ce(Ce({},b),window.mathVirtualKeyboard.backspaceKeycap)),a.label==="[tab]"&&(b=Ce(Ce({},b),window.mathVirtualKeyboard.tabKeycap)),b):a}var Md;function _g(a){var y;if(a.button!==0)return;const b=$l.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=hu(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,he=ae.signal;ee.classList.add("is-pressed"),ee.addEventListener("pointerenter",Ih(ae),{capture:!0,signal:he}),ee.addEventListener("pointerleave",Ih(ae),{capture:!0,signal:he}),ee.addEventListener("pointercancel",Ih(ae),{signal:he}),ee.addEventListener("pointerup",Ih(ae),{signal:he}),fu(re)&&(ee.classList.add("is-active"),b.shiftPressCount++),re.variants&&(Md&&clearTimeout(Md),Md=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 Ih(a){return y=>{const b=hu(y.target);if(!(b!=null&&b.id))return;const E=$l.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"),fu(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"),fu(ee)&&(E.shiftPressCount--,b.classList.toggle("is-active",E.isShifted));return}if(y.type==="pointerup"){Md&&clearTimeout(Md),fu(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"}]):Mf(ee.shift):Mf(ee),E.shiftPressCount===1&&!y.shiftKey&&(E.shiftPressCount=0)),a.abort(),y.preventDefault();return}}}}function Mf(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=$l.singleton)==null||y.executeCommand(b)}function Eg(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 hu(a){if(!a)return;let y=a;for(;y&&!Eg(y);)y=y.parentElement;return y!=null?y:void 0}function fu(a){return!!a.class&&/(^|\s)shift($|\s)/.test(a.class)}var $l=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"&&et()&&this.show({animate:!0})},300)}),document.addEventListener("focusout",ee=>{ee.target.mathVirtualKeyboardPolicy!=="manual"&&setTimeout(()=>{L0()||this.hide()},300)})}get currentLayer(){var y,b,E;return(E=(b=(y=this._element)==null?void 0:y.querySelector(".MLK__layer.is-visible"))==null?void 0:b.id)!=null?E:""}set currentLayer(y){var b;if(!this._element){this.latentLayer=y;return}let E=y?this._element.querySelector(`#${y}.MLK__layer`):null;E||(E=this._element.querySelector(".MLK__layer")),E&&((b=this._element.querySelector(".MLK__layer.is-visible"))==null||b.classList.remove("is-visible"),E.classList.add("is-visible")),this.render()}get shiftPressCount(){return this._shiftPressCount}set shiftPressCount(y){var b;this._shiftPressCount=y>2||y<0?0:y,(b=this._element)==null||b.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.render()}get isShifted(){return this._shiftPressCount>0}resetKeycapRegistry(){this.keycapRegistry={}}registerKeycap(y){const b="ML__k"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);return this.keycapRegistry[b]=y,b}getKeycap(y){return y?this.keycapRegistry[y]:void 0}getLayer(y){const b=this.normalizedLayouts;for(const E of b)for(const ee of E.layers)if(ee.id===y)return ee}get alphabeticLayout(){return this._alphabeticLayout}set alphabeticLayout(y){this._alphabeticLayout=y,this.rebuild()}get actionKeycap(){return this._actionKeycap}set actionKeycap(y){this._actionKeycap=typeof y=="string"?{label:y}:y}get shiftKeycap(){return this._shiftKeycap}set shiftKeycap(y){this._shiftKeycap=typeof y=="string"?{label:y}:y}get backspaceKeycap(){return this._backspaceKeycap}set backspaceKeycap(y){this._backspaceKeycap=typeof y=="string"?{label:y}:y}get tabKeycap(){return this._tabKeycap}set tabKeycap(y){this._tabKeycap=typeof y=="string"?{label:y}:y}get layouts(){return this._layouts}set layouts(y){this.updateNormalizedLayouts(y),this.rebuild()}updateNormalizedLayouts(y){const b=Array.isArray(y)?[...y]:[y],E=b.findIndex(ee=>ee==="default");E>=0&&b.splice(E,1,"numeric","symbols","alphabetic","greek"),this._layouts=Object.freeze(b),this._normalizedLayouts=b.map(ee=>_0(ee))}get normalizedLayouts(){return this._normalizedLayouts||this.updateNormalizedLayouts(this._layouts),this._normalizedLayouts}get editToolbar(){return this._editToolbar}set editToolbar(y){this._editToolbar=y,this.rebuild()}get container(){return this._container}set container(y){this._container=y,this.rebuild()}static get singleton(){if(this._singleton===void 0)try{this._singleton=new tm}catch(y){this._singleton=null}return this._singleton}get style(){return this._style}addEventListener(y,b,E){this.listeners[y]||(this.listeners[y]=new Set),this.listeners[y].has(b)||this.listeners[y].add(b)}dispatchEvent(y){return!this.listeners[y.type]||this.listeners[y.type].size===0?!0:(this.listeners[y.type].forEach(b=>{typeof b=="function"?b(y):b==null||b.handleEvent(y)}),!y.defaultPrevented)}removeEventListener(y,b,E){this.listeners[y]&&this.listeners[y].delete(b)}get element(){return this._element}set element(y){var b;this._element!==y&&((b=this._element)==null||b.remove(),this._element=y)}get visible(){return this._visible}set visible(y){y?this.show():this.hide()}get boundingRect(){var y;if(!this._visible)return new DOMRect;const b=(y=this._element)==null?void 0:y.getElementsByClassName("MLK__plate")[0];return b?b.getBoundingClientRect():new DOMRect}adjustBoundingRect(){var y,b;const E=this.boundingRect.height;if(this.container===document.body){(y=this._element)==null||y.style.setProperty("--_keyboard-height",`calc(${E}px + var(--_padding-top) + var(--_padding-bottom) + env(safe-area-inset-bottom, 0))`);const ee=E-1;this.container.style.paddingBottom=this.originalContainerBottomPadding?`calc(${this.originalContainerBottomPadding} + ${ee}px)`:`${ee}px`}else(b=this._element)==null||b.style.setProperty("--_keyboard-height",`${E}px`)}rebuild(){if(this._rebuilding||!this._element)return;this._rebuilding=!0;const y=this.currentLayer;requestAnimationFrame(()=>{this._rebuilding=!1,this._element&&(this._element.remove(),this._element=void 0),this.visible&&(this.buildAndAttachElement(),this.currentLayer=y,this.render(),this.adjustBoundingRect(),this._element.classList.add("is-visible"))})}render(){if(!this._element)return;const y=this.getLayer(this.currentLayer);this._element.classList.toggle("backdrop-is-transparent",!!(y&&(y.backdrop||y.container)));const b=this._element.querySelectorAll(".MLK__layer.is-visible .MLK__keycap, .MLK__layer.is-visible .action, .fnbutton, .MLK__layer.is-visible .bigfnbutton, .MLK__layer.is-visible .shift");if(b)for(const E of b){const ee=this.getKeycap(E.id);if(ee){const[re,ae]=Th(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}),wd(),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(Cf(y)){if(!ld(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:Ce({type:Dh,action:y},b)}));return}if(E)E.postMessage(Ce({type:Dh,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 Le(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"?zs[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=Sh(),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(yt()&&!("mathVirtualKeyboard"in window))if(window===window.top){const a=$l.singleton;Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>a})}else Object.defineProperty(window,"mathVirtualKeyboard",{get:()=>ug.singleton,configurable:!0});function Ph(a){const y={};for(const b of Object.keys(a))switch(b){case"scriptDepth":const E=a.scriptDepth;if(Le(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(he=>parseInt(he.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=$l.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=Fe(a.macros);break;default:Le(a[b])?y[b]=[...a[b]]:typeof a[b]=="object"&&!(a[b]instanceof Element)&&b!=="computeEngine"?y[b]=Ce({},a[b]):y[b]=a[b]}return y}function gc(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:Le(a[ee])?E[ee]=[...a[ee]]:typeof a[ee]=="object"&&!(a[ee]instanceof Element)&&ee!=="computeEngine"?E[ee]=Ce({},a[ee]):E[ee]=a[ee];return typeof y=="string"?E[y]:E}function Bh(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:jt,backgroundColorMap:st,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:lf,inlineShortcuts:dh,inlineShortcutTimeout:0,mathVirtualKeyboardPolicy:"auto",virtualKeyboardTargetOrigin:window==null?void 0:window.origin,originValidator:"none",onInlineShortcut:()=>"",onScrollIntoView:null,onExport:sf,value:""}}function D0(a){return a.defaultMode==="inline-math"?"math":a.defaultMode}function Rl(a,y){!a||!y||(Le(a)?a.forEach(b=>Rl(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),Rl(a.body,y),Rl(a.above,y),Rl(a.below,y),Rl(a.subscript,y),Rl(a.superscript,y)))}function kf(a,y,b,E){function ee(ae,he){for(const pe of re)if(pe.style[ae]!==he)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=Ds),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 fl(y,{mode:b.mode});ee.caret=E,b.parent.addChildAfter(ee,b),a.position+=1}}function Dg(a){const y=a.at(a.position);y.type==="composition"&&(y.parent.removeChild(y),a.position-=1)}mn(["math","displaymath"],qo),mn("center",qo),xt("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 hi("lines",a.args,[],{leftDelim:".",rightDelim:".",columns:[{align:"l"}]})}),Cn("array","{columns:colspec}",(a,y,b,E)=>new hi(a,_f(y),b,{columns:E[0],mathstyleName:"textstyle"})),Cn(["equation","equation*","subequations"],"",(a,y,b)=>new hi(a,_f(y),b,{columns:[{align:"c"}]})),Cn(["multline","multline*"],"",qo),Cn(["align","align*","aligned","eqnarray"],"",qo),Cn("split","",qo),Cn(["gather","gathered"],"",qo),Cn(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",qo),Cn(["smallmatrix","smallmatrix*"],"[columns:colspec]",qo),Cn(["cases","dcases","rcases"],"",qo);function Ag(a){for(const y of a)for(const b of y)if(b.length>0)return!1;return!0}function _f(a,y=1){return Ag(a)?Array(y).fill([[new Pn({type:"first"}),new Qr]]):a.map(b=>b.length===0?[[new Pn({type:"first"})]]:b.map(E=>E.length===0?[new Pn({type:"first"})]:(E[0].type!=="first"&&E.unshift(new Pn({type:"first"})),E)))}function qo(a,y=[[[]]],b=[],E=[]){switch(y=_f(y,["split","align","align*","aligned","eqnarray"].includes(a)?2:1),a){case"math":return new hi(a,y,b,{mathstyleName:"textstyle"});case"displaymath":return new hi(a,y,b,{mathstyleName:"textstyle"});case"center":return new hi(a,y,b,{columns:[{align:"c"}]});case"multline":case"multline*":return new hi(a,y,b,{columns:[{align:"m"}],leftDelim:".",rightDelim:"."});case"split":return new hi(a,y,b,{columns:[{align:"r"},{align:"l"}],minColumns:2});case"gather":case"gathered":return new hi(a,y,b,{columns:[{gap:.25},{align:"c"},{gap:0}]});case"pmatrix":case"pmatrix*":return new hi(a,y,b,{mathstyleName:"textstyle",leftDelim:"(",rightDelim:")",columns:vc(E[0])});case"bmatrix":case"bmatrix*":return new hi(a,y,b,{mathstyleName:"textstyle",leftDelim:"[",rightDelim:"]",columns:vc(E[0])});case"Bmatrix":case"Bmatrix*":return new hi(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\lbrace",rightDelim:"\\rbrace",columns:vc(E[0])});case"vmatrix":case"vmatrix*":return new hi(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\vert",rightDelim:"\\vert",columns:vc(E[0])});case"Vmatrix":case"Vmatrix*":return new hi(a,y,b,{mathstyleName:"textstyle",leftDelim:"\\Vert",rightDelim:"\\Vert",columns:vc(E[0])});case"matrix":case"matrix*":return new hi(a,y,b,{mathstyleName:"textstyle",leftDelim:".",rightDelim:".",columns:vc(E==null?void 0:E[0])});case"smallmatrix":case"smallmatrix*":return new hi(a,y,b,{mathstyleName:"scriptstyle",columns:vc(E==null?void 0:E[0]),colSeparationType:"small",arraystretch:.5});case"cases":case"dcases":return new hi(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 hi(a,y,b,{arraystretch:1.2,leftDelim:".",rightDelim:"\\rbrace",columns:[{align:"l"},{gap:1},{align:"l"}]});case"lines":return new hi(a,y,b,{leftDelim:".",rightDelim:".",columns:[{align:"l"}]});case"align":case"align*":case"aligned":case"eqnarray":{let ee=0;for(const he of y)ee=Math.max(ee,he.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 hi(a,y,b,{arraycolsep:0,columns:re,minColumns:2})}}return new hi(a,y,b,{mathstyleName:"textstyle"})}function vc(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 Tg(a,y){let b=a.at(a.position);for(;b&&!(b.parent instanceof hi);)b=b.parent;if(b&&b.type==="array"&&b.environmentName,!b||!(b.parent instanceof hi)){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=Rh()),ee.length===0&&(ee=Rh());let ae;return y.endsWith("column")?(ae=qo("split",[[re,ee]]),a.root=ae,yc(ae,0,0)?bc(a,ae,0,0):yc(ae,0,1)?bc(a,ae,0,1):a.position=a.offsetOf(E)):(ae=qo("lines",[[re],[ee]]),a.root=ae,yc(ae,0,0)?bc(a,ae,0,0):yc(ae,1,0)?bc(a,ae,1,0):a.position=a.offsetOf(E)),[void 0,[0,0]]}if(b.parent instanceof $i){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=Rh()),re.length===0&&(re=Rh());let he="pmatrix";const pe=ee.leftDelim,ve=ee.rightDelim;pe==="("&&(ve===")"||ve==="?")?he="pmatrix":(pe==="["||pe==="\\lbrack")&&(ve==="]"||ve==="\\rbrack"||ve==="?")?he="bmatrix":pe==="\\vert"&&ve==="\\vert"?he="vmatrix":pe==="\\Vert"&&ve==="\\Vert"?he="Vmatrix":(pe==="{"||pe==="\\lbrace")&&(ve==="."||ve==="?")&&(he="cases");const we=qo(he,y.endsWith("column")?[[ae,re]]:[[ae],[re]]);return ee.parent.addChildBefore(we,ee),ee.parent.removeChild(ee),yc(we,0,0)?bc(a,we,0,0):y.endsWith("column")?yc(we,0,1)?bc(a,we,0,1):a.position=a.offsetOf(b):yc(we,1,0)?bc(a,we,1,0):a.position=a.offsetOf(b),[void 0,[0,0]]}}return b&&b.parent instanceof hi?[b.parent,b.parentBranch]:[void 0,[0,0]]}function yc(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 bc(a,y,b,E){const ee=Ig(a,y,b,E);typeof ee!="number"&&a.setSelection(ee)}function Oh(a,y,b,E,ee){const re=y.getCell(b,E);re&&a.setPositionHandlingPlaceholder(a.offsetOf(re[ee==="start"?0:re.length-1]))}function $h(a,y){const[b,[E,ee]]=Tg(a,y);if(b)switch(y){case"after row":b.addRowAfter(E),Oh(a,b,E+1,0,"end");break;case"after column":if(b.maxColumns<=b.colCount){a.announce("plonk");return}b.addColumnAfter(ee),Oh(a,b,E,ee+1,"end");break;case"before row":b.addRowBefore(E),Oh(a,b,E,0,"start");break;case"before column":if(b.maxColumns<=b.colCount){a.announce("plonk");return}b.addColumnBefore(ee),Oh(a,b,E,ee,"start");break}}function A0(a){return a.contentWillChange({inputType:"insertText"})?($h(a,"after row"),a.contentDidChange({inputType:"insertText"}),!0):!1}function Pg(a){return a.contentWillChange({inputType:"insertText"})?($h(a,"before row"),a.contentDidChange({inputType:"insertText"}),!0):!1}function T0(a){return a.contentWillChange({inputType:"insertText"})?($h(a,"after column"),a.contentDidChange({inputType:"insertText"}),!0):!1}function Bg(a){return a.contentWillChange({inputType:"insertText"})?($h(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 hi);)b=b.parent;if(Array.isArray(b==null?void 0:b.parentBranch)&&(b==null?void 0:b.parent)instanceof hi){const E=b.parent,ee=b.parentBranch;let re;switch(y){case"row":if(E.rowCount>1){E.removeRow(ee[0]);const ae=E.getCell(Math.max(0,ee[0]-1),ee[1]);re=a.offsetOf(ae[ae.length-1])}break;case"column":if(E.colCount>E.minColumns){E.removeColumn(ee[1]);const ae=E.getCell(ee[0],Math.max(0,ee[1]-1));re=a.offsetOf(ae[ae.length-1])}break}re&&a.setPositionHandlingPlaceholder(re)}}function Og(a){return a.contentWillChange({inputType:"deleteContent"})?(P0(a,"row"),a.contentDidChange({inputType:"deleteContent"}),!0):!1}function $g(a){return a.contentWillChange({inputType:"deleteContent"})?(P0(a,"column"),a.contentDidChange({inputType:"deleteContent"}),!0):!1}Oo({addRowAfter:A0,addColumnAfter:T0,addRowBefore:Pg,addColumnBefore:Bg,removeRow:Og,removeColumn:$g,setEnvironment:I0},{target:"model",canUndo:!0,changeContent:!0,changeSelection:!0});function Rh(){return[new Qr]}var B0=class nm{constructor(y){this.recording=!1,this.model=y,this.reset()}reset(){this.stack=[],this.index=-1,this.lastOp=""}startRecording(){this.recording=!0}stopRecording(){this.recording=!1}canUndo(){return this.index-1>=0}canRedo(){return this.stack.length-1>this.index}stopCoalescing(y){y&&this.index>=0&&(this.stack[this.index].selection=y),this.lastOp=""}undo(){return this.canUndo()?(this.model.setState(this.stack[this.index-1],{silenceNotifications:!1,type:"undo"}),this.index-=1,this.lastOp="",!0):!1}redo(){return this.canRedo()?(this.index+=1,this.model.setState(this.stack[this.index],{silenceNotifications:!1,type:"redo"}),this.lastOp="",!0):!1}pop(){this.canUndo()&&(this.stack.splice(this.index,this.stack.length-this.index),this.index-=1)}snapshot(y){return this.recording?(y&&y===this.lastOp&&this.pop(),this.stack.splice(this.index+1,this.stack.length-this.index-1),this.stack.push(this.model.getState()),this.index+=1,this.stack.length>nm.maximumDepth&&(this.stack.shift(),this.index-=1),this.lastOp=y!=null?y:"",!0):!1}};B0.maximumDepth=1e3;var Rg=B0;function Ef(a,y,b){if(a.at(y).mode!=="text")return y;const E=b==="backward"?-1:1;let ee;if(fe.test(a.at(y).value)){let re=y,ae;do ae=a.at(re).mode==="text"&&fe.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 pu(a,y,b){var E,ee,re,ae,he,pe,ve;const we=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 Je=a.offsetOf(Re);if(Re instanceof vs)Je=Ef(a,Je,y);else if(Re instanceof qa)if(Re.isSuggestion)for(console.assert(y==="forward");Re&&Re instanceof qa;)Re.isSuggestion=!1,Je=a.offsetOf(Re),Re=Re.rightSibling;else if(y==="forward"){if(Re=Re.rightSibling,!Re||!(Re instanceof qa))return a.announce("plonk"),!1;for(;Re&&Re instanceof qa&&/[a-zA-Z\*]/.test(Re.value);)Je=a.offsetOf(Re),Re=Re.rightSibling}else{if(Re=Re.leftSibling,!Re||!(Re instanceof qa))return a.announce("plonk"),!1;for(;Re&&Re instanceof qa&&/[a-zA-Z\*]/.test(Re.value);)Je=a.offsetOf(Re),Re=Re.leftSibling}else if(y==="forward"&&Re.type==="mopen"){let vt=0;do Re.type==="mopen"?vt+=1:Re.type==="mclose"&&(vt-=1),Re=Re.rightSibling;while(!Re.isLastSibling&&vt!==0);Je=a.offsetOf(Re.leftSibling)}else if(y==="backward"&&Re.type==="mclose"){let vt=0;do Re.type==="mopen"?vt+=1:Re.type==="mclose"&&(vt-=1),Re=Re.leftSibling;while(!Re.isFirstSibling&&vt!==0);Je=a.offsetOf(Re)}else if(y==="backward")if(Re.type==="first")for(;Je>0&&Re.type==="first";)Je-=1,Re=a.at(Je);else{const vt=Re.type;Re.type==="subsup"&&(Je=a.offsetOf(a.at(Je).leftSibling)),Je-=1;let kt=(ee=a.at(Je))==null?void 0:ee.type;for(;Je>=0&&kt===vt;)((re=a.at(Je))==null?void 0:re.type)==="subsup"?Je=a.offsetOf(a.at(Je).leftSibling):Je-=1,kt=a.at(Je).type}else{const{type:vt}=Re;let kt=(ae=a.at(Je))==null?void 0:ae.type;const{lastOffset:xn}=a;for(;Je<=xn&&(kt===vt||kt==="subsup");){for(;((he=a.at(Je).rightSibling)==null?void 0:he.type)==="subsup";)Je=a.offsetOf(a.at(Je).rightSibling);Je+=1,kt=(pe=a.at(Je))==null?void 0:pe.type}Je-=1}if((ve=b==null?void 0:b.extend)!=null&&ve){if(!a.setSelection(a.anchor,Je))return a.announce("plonk"),!1}else{if(Je===a.position)return a.announce("plonk"),!1;a.position=Je}return a.announce("move",we),a.mathfield.stopCoalescingUndo(),!0}function Ks(a,y,b){var E,ee;if(b=b!=null?b:{extend:!1},a.mathfield.adoptStyle=y==="backward"?"right":"left",y!=="forward"){const[he,pe]=g0(a);he!==void 0&&pe!==void 0&&a.deleteAtoms([he,pe])}if(y==="upward")return Fg(a,b);if(y==="downward")return zg(a,b);if(b.extend){let he=Nh(a,a.position,y);he<0&&(he=0),he>a.lastOffset&&(he=a.lastOffset);const pe=a.setSelection(a.anchor,he);return a.mathfield.stopCoalescingUndo(),pe}if(a.selectionIsPlaceholder){a.collapseSelection(y);const he=Ks(a,y);return a.mathfield.stopCoalescingUndo(),he}let re=a.position;const ae=re;if(a.collapseSelection(y)?(re=a.position,O0(a,re)||(re=Nh(a,re,y))):re=Nh(a,re,y),re<0||re>a.lastOffset){let he=!0;return a.silenceNotifications||(he=(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),he&&a.announce("plonk"),he}return a.setPositionHandlingPlaceholder(re),a.mathfield.stopCoalescingUndo(),a.announce("move",ae),!0}function Nh(a,y,b){return y=y+(b==="forward"?1:-1),y<0||y>a.lastOffset||O0(a,y)?y:Nh(a,y,b)}function O0(a,y){var b;const E=a.at(y);let ee=E.parent;for(;ee&&!ee.inCaptureSelection;)ee=ee.parent;return!(ee!=null&&ee.inCaptureSelection||(b=E.parent)!=null&&b.skipBoundary&&(!E.isFirstSibling&&E.isLastSibling||E.type==="first")||a.mathfield.hasEditablePrompts&&!E.parentPrompt)}function Ng(a,y,b){let E=1/0,ee=0;for(;ee<y.length;ee++){const re=ru(a.getHTMLElement(y[ee])).right,ae=Math.abs(b-re);if(ae<=E)E=ae;else break}return y[ee-1]}function Fh(a,y,b,E,ee){const re=a.mathfield.hasEditablePrompts,ae=re?b.filter(ve=>ve.type==="prompt"&&!ve.captureSelection):b,he=ru(a.mathfield.getHTMLElement(y)).right,pe=a.offsetOf(Ng(a.mathfield,ae,he))-(re?1:0);if(E){const[ve,we]=a.selection.ranges[0];let Re;pe<(ee==="up"?ve:we)?Re={ranges:[[pe,we]],direction:"backward"}:Re={ranges:[[ve,pe]],direction:"forward"},a.setSelection(Re)}else a.setPositionHandlingPlaceholder(pe);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 pe,ve;let we=!0;return a.silenceNotifications||(we=(ve=(pe=a.mathfield.host)==null?void 0:pe.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"upward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?ve:!0),a.announce(we?"plonk":"line"),we},ae=a.at(a.position);let he=ae;for(;he&&he.parentBranch!=="below"&&!(Array.isArray(he.parentBranch)&&he.parent instanceof hi);)he=he.parent;if(Array.isArray(he==null?void 0:he.parentBranch)&&he.parent instanceof hi){const pe=he.parent;if(he.parentBranch[0]<1)return re();const ve=he.parentBranch[0]-1,we=pe.array[ve][he.parentBranch[1]];if(!we.some(Je=>Je.type==="prompt"&&!Je.captureSelection)&&a.mathfield.hasEditablePrompts)return re();Fh(a,ae,we,ee,"up")}else if(he){const pe=(E=he.parent.branch("above"))!=null?E:he.parent.createBranch("above");if(!pe.some(we=>we.type==="prompt"&&we.placeholderId)&&a.mathfield.hasEditablePrompts)return re();Fh(a,ae,pe,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 pe,ve;let we=!0;return a.silenceNotifications||(we=(ve=(pe=a.mathfield.host)==null?void 0:pe.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"downward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?ve:!0),a.announce(we?"plonk":"line"),we},ae=a.at(a.position);let he=ae;for(;he&&he.parentBranch!=="above"&&!(Array.isArray(he.parentBranch)&&he.parent instanceof hi);)he=he.parent;if(Array.isArray(he==null?void 0:he.parentBranch)&&he.parent instanceof hi){const pe=he.parent;if(he.parentBranch[0]+1>pe.array.length-1)return re();const ve=he.parentBranch[0]+1,we=pe.array[ve][he.parentBranch[1]];if(!we.some(Je=>Je.type==="prompt"&&!Je.captureSelection)&&a.mathfield.hasEditablePrompts)return re();Fh(a,ae,we,ee,"down")}else if(he){const pe=(E=he.parent.branch("below"))!=null?E:he.parent.createBranch("below");if(!pe.some(we=>we.type==="prompt")&&a.mathfield.hasEditablePrompts)return re();Fh(a,ae,pe,ee,"down")}else return re();return!0}function $0(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 R0(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 Yo({style:b.computedStyle}),b),b=b.rightSibling),b.createBranch("superscript"),a.setSelection(a.getSiblingsRange(a.offsetOf(b.superscript[0]))),!0}function N0(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 Yo({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(pe){const ve=[],we=[];return[...pe.querySelectorAll(`input, select, textarea, a[href], button,
|
|
|
[tabindex], audio[controls], video[controls],
|
|
|
[contenteditable]:not([contenteditable="false"]), details>summary`)].filter(y).forEach((Je,vt)=>{const kt=E(Je);kt===0?ve.push(Je):we.push({documentOrder:vt,tabIndex:kt,node:Je})}),we.sort((Je,vt)=>Je.tabIndex===vt.tabIndex?Je.documentOrder-vt.documentOrder:Je.tabIndex-vt.tabIndex).map(Je=>Je.node).concat(ve)}function y(pe){return!(!b(pe)||ee(pe)||E(pe)<0)}function b(pe){return!(pe.disabled||pe.type==="hidden"&&pe.tagName.toUpperCase()==="INPUT"||he(pe))}function E(pe){var ve;const we=Number.parseInt((ve=pe.getAttribute("tabindex"))!=null?ve:"NaN",10);return Number.isNaN(we)?pe.contentEditable==="true"||(pe.nodeName==="AUDIO"||pe.nodeName==="VIDEO")&&pe.getAttribute("tabindex")===null?0:pe.tabIndex:we}function ee(pe){return pe.tagName.toUpperCase()==="INPUT"&&pe.type==="radio"&&!ae(pe)}function re(pe,ve){for(const we of pe)if(we.checked&&we.form===ve)return we;return null}function ae(pe){var ve;if(!pe.name)return!0;const Re=((ve=pe.form)!=null?ve:pe.ownerDocument).querySelectorAll('input[type="radio"][name="'+pe.name+'"]'),Je=re(Re,pe.form);return!Je||Je===pe}function he(pe){if(!yt()||pe===document.activeElement||pe.contains(document.activeElement))return!1;if(getComputedStyle(pe).visibility==="hidden")return!0;const ve=pe.getBoundingClientRect();if(ve.width===0||ve.height===0)return!0;for(;pe;){if(getComputedStyle(pe).display==="none")return!0;pe=pe.parentElement}return!1}return yt()?a(document.body):[]}function yo(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"?yo(a,[y.leftSibling,y]):yo(a,[y,y.leftSibling])}function xs(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 zh(a,y,b=!0){var E,ee;const re=y==="forward"?1:-1;a.at(a.anchor).type==="placeholder"&&Ks(a,y);let ae;const he=a.at(a.anchor).parentPrompt;he?y==="forward"?ae=a.offsetOf(he)+1:ae=a.offsetOf(he.leftSibling):ae=Math.max(a.position+re,0);const pe=Lf(a,ae,y);if(!pe||y==="forward"&&a.offsetOf(pe)<ae||y==="backward"&&a.offsetOf(pe)>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 we=Wg();if(!document.activeElement||we.length<=1)return a.announce("plonk"),!1;let Re=we.indexOf(document.activeElement)+re;return Re<0&&(Re=we.length-1),Re>=we.length&&(Re=0),we[Re].focus(),a.mathfield.stopCoalescingUndo(),!0}return xs(a,pe),!0}function Lf(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)}Oo({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 he=b.subsupPlacement?N0(a):R0(a);return a.mathfield.stopCoalescingUndo(),he}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=>$0(a),moveToNextChar:a=>Ks(a,"forward"),moveToPreviousChar:a=>Ks(a,"backward"),moveUp:a=>Ks(a,"upward"),moveDown:a=>Ks(a,"downward"),moveToNextWord:a=>pu(a,"forward"),moveToPreviousWord:a=>pu(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 zh(a,"forward");const re=a.at(a.position);if(re.mode==="text"){if(a.selectionIsCollapsed){let Je=re;for(;Je&&Je.mode==="text";)Je=Je.leftSibling;let vt=re;for(;((y=vt.rightSibling)==null?void 0:y.mode)==="text";)vt=vt.rightSibling;if(Je&&vt)return yo(a,[Je,vt])}if(re.rightSibling.mode==="text"){let Je=re;for(;Je&&Je.mode==="text";)Je=Je.rightSibling;return Je?(xs(a,(b=Je.leftSibling)!=null?b:Je),a.mathfield.switchMode("math"),!0):xs(a,a.lastOffset)}}const he=a.at(a.anchor).parentPrompt,pe=he?a.offsetOf(he)+1:Math.max(a.position+1,0),ve=Lf(a,pe,"forward");if(ve)return xs(a,ve);const we=F0(a,re,Je=>Je.type==="leftright"||Je.type==="text","forward");if(we){if(we.mode==="text"){let Je=we;for(;Je&&Je.mode==="text";)Je=Je.rightSibling;return yo(a,[(E=we.leftSibling)!=null?E:we,(ee=Je.leftSibling)!=null?ee:Je])}return yo(a,we)}const Re=re.parent;if(Re){if(Re.type==="leftright"||Re.type==="surd")return yo(a,Re);if(re.parentBranch==="superscript"&&Re.subscript)return yo(a,Re.subscript);if(re.parentBranch==="above"&&Re.below)return yo(a,Re.below);if(re.parentBranch==="superscript"||re.parentBranch==="subscript")return xs(a,Re);if(re.parentBranch==="above"||re.parentBranch==="below")return yo(a,Re)}return xs(a,a.lastOffset)},moveToPreviousGroup:a=>{var y;if(a.position===0&&a.anchor===0)return zh(a,"backward");let b=a.at(a.position);const E=b.mode;if(E==="text"){if(a.selectionIsCollapsed){let he=b;for(;he&&he.mode==="text";)he=he.leftSibling;let pe=b;for(;((y=pe.rightSibling)==null?void 0:y.mode)==="text";)pe=pe.rightSibling;if(he&&pe)return yo(a,[he,pe])}for(;b&&b.mode==="text";)b=b.leftSibling;return b?xs(a,b):xs(a,0)}const ee=a.at(a.anchor).parentPrompt,re=ee?a.offsetOf(ee.leftSibling):Math.max(a.position-1,0),ae=Lf(a,re,"backward");if(ae)return xs(a,ae);if(E==="math"){const he=F0(a,b,ve=>ve.type==="leftright"||ve.type==="text","backward");if(he){if(he.mode==="text"){let ve=he;for(;ve&&ve.mode==="text";)ve=ve.leftSibling;return yo(a,[he,ve])}return yo(a,he)}const pe=b.parent;if(pe){if(pe.type==="leftright"||pe.type==="surd")return yo(a,pe);if(b.parentBranch==="subscript"&&pe.superscript)return yo(a,pe.superscript);if(b.parentBranch==="below"&&pe.above)return yo(a,pe.above);if(b.parentBranch==="superscript"||b.parentBranch==="subscript")return xs(a,pe);if(b.parentBranch==="above"||b.parentBranch==="below")return yo(a,pe)}return xs(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:R0,moveToSubscript:N0},{target:"model",changeSelection:!0}),Oo({moveToNextPlaceholder:a=>zh(a,"forward"),moveToPreviousPlaceholder:a=>zh(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 Kh(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 xc(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(Pn.serialize([ae],{defaultMode:"math"})),ae.mode="math"),E-=1,y-=1}Df(a),a.contentDidChange({data:Si(re),inputType:"insertText"})}function Df(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 Zg(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 jg(a,y,b){const{model:E}=a;if(E.mode==="latex"||!E.at(E.position).isLastSibling||!b||!wh(b))return!1;const ee=lu(b);if(!E.selectionIsCollapsed)return!!(a.model.mode==="text"&&/[/_^]/.test(ee));const re=Zg(E)+ee;if(a.model.mode==="text"){if(y==="Esc"||/[/\\]/.test(ee))return!0;if(/[\^_]/.test(ee))return/(^|\s)[a-zA-Z][^_]$/.test(re)&&xc(E,1),!0;const ae={")":"(","}":"{","]":"["}[ee],{parent:he}=E.at(E.position);if(ae&&he instanceof $i&&he.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 xc(E,1),!1;if(/\D\.[^\d\s]$/.test(re)){xc(E,1);const pe=E.at(E.position);return pe.value="\u22C5",pe.style.variant="normal",pe.command="\\cdot",pe.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 xc(E,1),!0;if(/\([a-z][,;]$/.test(re))return xc(E,2),!0;if(/[\d+\-=><*|]$/.test(ee))return Df(E),!0}else{if(y==="[Space]")return Kh(E,void 0,ae=>/[a-z][:,;.]$/.test(ae.value)),!0;if(/[a-zA-Z]{3,}$/.test(re)&&!/(dxd|abc|xyz|uvw)$/.test(re))return Kh(E,void 0,ae=>/[a-zA-Z]/.test(ae.value)),!0;if(/(^|\W)(if)$/i.test(re))return Kh(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 Kh(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>"+(vf(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 Ug(a){if(a.keystrokeCaptionVisible=!a.keystrokeCaptionVisible,a.keystrokeCaptionVisible){const y=z0();y.innerHTML=""}else{const y=Mh("mathlive-keystroke-caption-panel");y.style.visibility="hidden"}return!1}function z0(){const a=document.getElementById("mathlive-keystroke-caption-panel");return a||(Bo("keystroke-caption"),Bo("core"),Mh("mathlive-keystroke-caption-panel"))}function Gg(){document.getElementById("mathlive-keystroke-caption-panel")&&(bf("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){Rm(y);const vt=vd();a.keyboardLayout!==vt.id&&(a.keyboardLayout=vt.id,a._keybindings=void 0)}if(clearTimeout(a.inlineShortcutBufferFlushTimer),a.inlineShortcutBufferFlushTimer=0,Vg(a,ae),y.isTrusted&&y.defaultPrevented)return a.flushInlineShortcutBuffer(),!1;let he,pe="",ve;const we=a.inlineShortcutBuffer;if(a.isSelectionEditable){if(re.mode==="math")if(ae==="[Backspace]")we.pop();else if(!wh(y))a.flushInlineShortcutBuffer();else{const vt=lu(y),kt=[...(E=(b=we[we.length-1])==null?void 0:b.keystrokes)!=null?E:[],vt];we.push({state:re.getState(),keystrokes:kt,leftSiblings:Xg(a)});let xn=0,ir="";for(;!he&&xn<kt.length;)ve=we.length-(kt.length-xn),ir=kt.slice(xn).join(""),he=td(we[ve].leftSiblings,ir,a.options.inlineShortcuts),!he&&/^[a-zA-Z][a-zA-Z0-9]+?([_\^][a-zA-Z0-9\*\+\-]+?)?$/.test(ir)&&(he=a.options.onInlineShortcut(a,ir)),xn+=1;a.flushInlineShortcutBuffer({defer:!0})}a.options.smartMode&&(he?a.switchMode("math"):jg(a,ae,y)&&(a.switchMode({math:"text",text:"math"}[re.mode]),pe=""))}if(!he){if(pe||(pe=Zm(a.keybindings,re.mode,y)),!pe&&(ae==="[Enter]"||ae==="[Return]")){let vt=!1;return re.contentWillChange({inputType:"insertLineBreak"})&&(a.host&&(vt=!a.host.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),vt||y.preventDefault&&(y.preventDefault(),y.stopPropagation()),re.contentDidChange({inputType:"insertLineBreak"})),vt}if((!pe||ae==="[Space]")&&re.mode==="math"){if(ae==="[Space]"){if(a.adoptStyle="none",a.flushInlineShortcutBuffer(),a.options.mathModeSpace)return si.insert(re,a.options.mathModeSpace,{format:"latex",mode:"math"}),a.snapshot("insert-space"),pe="",a.dirty=!0,a.scrollIntoView(),y.preventDefault&&(y.preventDefault(),y.stopPropagation()),!1;const vt=re.at(re.position+1),kt=re.at(re.position-1);if((vt==null?void 0:vt.mode)==="text"||(kt==null?void 0:kt.mode)==="text")return si.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)===","&&(pe="insertDecimalSeparator")}}if(!he&&!pe){if(re.mathfield.smartFence){if(Tf(re,lu(y),a.effectiveStyle))return a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}else{const{parent:vt}=re.at(re.position);if(vt instanceof $i&&vt.rightDelim==="?"&&re.at(re.position).isLastSibling&&/^[)}\]|]$/.test(ae))return a.snapshot(),vt.isDirty=!0,vt.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 kt=lu(y);if(kt==="("||kt==="{"||kt==="["){const xn={"(":"(","{":"\\lbrace","[":"\\lbrack"}[kt],ir={"(":")","{":"\\rbrace","[":"\\rbrack"}[kt],[yn,Nn]=Wa(re.selection);return a.snapshot(),re.position=Nn,si.insert(re,ir,{format:"latex"}),re.position=yn,si.insert(re,xn,{format:"latex"}),re.setSelection(yn+1,Nn+1),re.contentDidChange({data:kt,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:Je}=Re;if(pe==="moveAfterParent"&&(Je==null?void 0:Je.type)==="leftright"&&Re.isLastSibling&&a.options.smartFence&&Tf(re,".",a.defaultStyle)&&(pe="",va(a)),a.keyboardDelegate.cancelComposition(),pe)a.executeCommand(pe);else if(he){const vt=a.effectiveStyle;re.setState(we[ve].state);const kt=we[we.length-1].keystrokes;for(const xn of kt)si.insert(re,xn,{silenceNotifications:!0,style:vt});a.snapshot("insert-shortcut"),re.setState(we[ve].state),re.deferNotifications({content:!0,selection:!0,data:he,type:"insertText"},()=>(si.insert(re,he,{format:"latex",style:vt}),Df(a.model),he.endsWith(" ")&&(a.switchMode("text"),si.insert(re," ",{style:vt,mode:"text"})),a.snapshot(),re.selectionIsCollapsed||a.flushInlineShortcutBuffer(),!0)),a.dirty=!0,re.announce("replacement")}return a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}function Af(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=rh(y);const re=window.mathVirtualKeyboard;if(re!=null&&re.isShifted&&(ee=typeof ee=="string"?ee.toUpperCase():ee.map(pe=>pe.toUpperCase())),b.simulateKeystroke){let pe=!0;for(const ve of ee)K0(a,new KeyboardEvent("keypress",{key:ve}))&&(pe=!1);if(pe)return}const ae=E.at(E.position),he=Ce(Ce({},ae.computedStyle),a.defaultStyle);if(E.selectionIsCollapsed||(E.deleteAtoms(Wa(E.selection)),a.snapshot("delete")),E.mode==="latex")E.deferNotifications({content:!0,selection:!0,data:y,type:"insertText"},()=>{Ch(a);for(const pe of ee)si.insert(E,pe);a.snapshot("insert-latex"),bd(a)});else if(E.mode==="text"){for(const pe of ee)si.insert(E,pe,{style:he});a.snapshot("insert-text")}else if(E.mode==="math")for(const pe of ee)Yg(a,pe,he,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 Yg(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){Jg(ee),si.insert(ee,y,{style:b}),a.snapshot(),$0(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=Ce({},b),ae.style.variant&&(b.variant=ae.style.variant),ae.style.variantStyle&&(b.variantStyle=ae.style.variantStyle))}si.insert(ee,y,{style:b}),a.snapshot(`insert-${ee.at(ee.position).type}`)}function Jg(a){a.selectionIsCollapsed||(a.deleteAtoms(Wa(a.selection)),a.mathfield.snapshot("delete"))}function Tf(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],he=ne[re];if(!a.selectionIsCollapsed){a.mathfield.snapshot();const[pe,ve]=Wa(a.selection),we=a.extractAtoms([pe,ve]),Re=ee.addChildrenAfter([new $i("left...right",we,{leftDelim:re,rightDelim:he})],a.at(pe));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 pe=ee instanceof $i?ee.leftDelim+ee.rightDelim:"";if(pe==="\\lbrace\\rbrace"||pe==="\\{\\}"||pe==="\\lbrace?")return a.mathfield.snapshot(),si.insert(a,"\\,\\middle\\vert\\,",{format:"latex",style:b}),a.mathfield.snapshot("insert-fence"),a.contentDidChange({data:re,inputType:"insertText"}),!0}if(he){if(ee instanceof $i&&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 $i)){let Re=E;for(;Re&&!(Re.type==="mclose"&&Re.value===he);)Re=Re.rightSibling;if(Re){a.mathfield.snapshot();const Je=a.extractAtoms([a.offsetOf(E),a.offsetOf(Re)]);return Je.pop(),ee.addChildrenAfter([new $i("left...right",Je,{leftDelim:re,rightDelim:he})],E),a.position=a.offsetOf(ee.firstChild)+1,a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}}const pe=a.offsetOf(E.lastSibling);let ve;for(ve=a.position;ve<=pe;ve++){const Re=a.at(ve);if(Re instanceof $i&&(Re.leftDelim==="?"||Re.leftDelim===".")&&H0(re,Re.rightDelim))break}const we=a.at(ve);if(ve<=pe&&we instanceof $i){we.leftDelim=re,a.mathfield.snapshot();let Re=a.extractAtoms([a.position,ve-1]);return Re=Re.filter(Je=>Je.type!=="first"),we.addChildren(Re,we.parentBranch),a.position+=1,a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}if(ee instanceof $i&&(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 Je of Re)ee.parent.addChildBefore(Je,ee);return a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}if(!(ee instanceof $i&&ee.leftDelim==="|")){if(a.mathfield.snapshot(),si.insert(a,`\\left${re}\\right?`,{format:"latex",style:b}),E.lastSibling.type!=="first"){const Re=a.offsetOf(E.lastSibling),Je=a.extractAtoms([a.position,Re]);a.at(a.position).body=Je,a.position-=1}return a.mathfield.snapshot("insert-fence"),!0}}if(ae){let pe=E;for(;pe;){if(pe.type==="mopen"&&pe.value===ae){a.mathfield.snapshot();const vt=pe.leftSibling,kt=a.extractAtoms([a.offsetOf(pe.leftSibling),a.offsetOf(E)]);kt.shift();const xn=new $i("left...right",kt,{leftDelim:ae,rightDelim:re});return ee.addChildrenAfter([xn],vt),a.position=a.offsetOf(xn),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}pe=pe.leftSibling}if(ee instanceof $i&&E.isLastSibling&&If(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 ve=a.offsetOf(E.firstSibling);let we;for(we=a.position;we>=ve;we--){const vt=a.at(we);if(vt instanceof $i&&(vt.rightDelim==="?"||vt.rightDelim===".")&&If(vt.leftDelim,re))break}const Re=a.at(we);if(we>=ve&&Re instanceof $i)return a.mathfield.snapshot(),Re.rightDelim=re,Re.addChildren(a.extractAtoms([we,a.position]),Re.parentBranch),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0;if(ee instanceof $i&&(ee.rightDelim==="?"||ee.rightDelim===".")&&If(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 Je=ee.parent;return Je instanceof $i&&(Je.rightDelim==="?"||Je.rightDelim===".")&&a.at(a.position).isLastSibling?(a.position=a.offsetOf(Je),Tf(a,re,b)):!1}return!1}function If(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}Oo({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:Ug,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)=>(Af(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}}),Oo({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"}),Oo({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})&&(bd(a),a.startRecording(),a.snapshot("paste"),a.model.contentDidChange({inputType:"insertFromPaste"}),va(a))):a.model.announce("plonk"),a.startRecording()}),!0))},{target:"mathfield",canUndo:!0,changeContent:!0,changeSelection:!0});function qg(a,y){a.flushInlineShortcutBuffer(),a.stopCoalescingUndo();const b=Pf(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=Ce(Ce({},a.defaultStyle),b)):a.model.deferNotifications({content:!0,type:"insertText"},()=>{E.selection.ranges.forEach(ee=>kf(E,ee,b,{operation:"toggle"})),a.snapshot("style-change")}),!0}Oo({applyStyle:qg},{target:"mathfield",canUndo:!0,changeContent:!0});function Pf(a,y){var b,E,ee,re,ae,he,pe,ve,we,Re;const Je={};if(typeof y.color=="string"){const kt=(E=a.colorMap((b=y.color)!=null?b:y.verbatimColor))!=null?E:"none";kt!==y.color&&(Je.verbatimColor=(ee=y.verbatimColor)!=null?ee:y.color),Je.color=kt}if(typeof y.backgroundColor=="string"){const kt=(ae=a.backgroundColorMap((re=y.backgroundColor)!=null?re:y.verbatimBackgroundColor))!=null?ae:"none";kt!==y.backgroundColor&&(Je.verbatimBackgroundColor=(he=y.verbatimBackgroundColor)!=null?he:y.backgroundColor),Je.backgroundColor=kt}typeof y.fontFamily=="string"&&(Je.fontFamily=y.fontFamily),typeof y.series=="string"&&(Je.fontSeries=y.series),typeof y.fontSeries=="string"&&(Je.fontSeries=y.fontSeries.toLowerCase()),Je.fontSeries&&(Je.fontSeries=(pe={bold:"b",medium:"m",normal:"m"}[Je.fontSeries])!=null?pe:Je.fontSeries),typeof y.shape=="string"&&(Je.fontShape=y.shape),typeof y.fontShape=="string"&&(Je.fontShape=y.fontShape.toLowerCase()),Je.fontShape&&(Je.fontShape=(ve={italic:"it",up:"n",upright:"n",normal:"n"}[Je.fontShape])!=null?ve:Je.fontShape),y.variant&&(Je.variant=y.variant.toLowerCase()),y.variantStyle&&(Je.variantStyle=y.variantStyle.toLowerCase());const vt=(we=y.size)!=null?we:y.fontSize;return typeof vt=="number"?Je.fontSize=Math.max(1,Math.min(10,vt)):typeof vt=="string"&&(Je.fontSize=(Re={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[vt.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}[vt]),Je}function Bf(a){let[y,b]=Wa(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 he=b==="forward"?1:-1;if(ae.mode==="text"){for(;ae&&!(ae.mode!=="text"||!fe.test(ae.value));)y+=he,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+=he,ae=a.at(y);else for(;ae&&ae.mode==="latex"&&/[a-zA-Z\*]/.test(ae.value);)y+=he,ae=a.at(y);else if(ae.value==="{"){if(b==="forward"){for(;ae&&ae.mode==="latex"&&ae.value!=="}";)y+=he,ae=a.at(y);return y}return y-1}else if(ae.value==="}"){if(b==="backward"){for(;ae&&ae.mode==="latex"&&ae.value!=="{";)y+=he,ae=a.at(y);return y-1}return y}return y-1}if(ae.mode==="math"){if(ae.isDigit()){for(;(E=a.at(y+he))!=null&&E.isDigit();)y+=he;return b==="backward"?y-1:y}if(ae.style.variant||ae.style.variantStyle){let pe=(ee=a.at(y))==null?void 0:ee.style;for(;pe&&pe.variant===ae.style.variant&&pe.variantStyle===ae.style.variantStyle;)pe=(re=a.at(y+he))==null?void 0:re.style,y+=he;return b==="backward"?y-1:y}return y}return y}Oo({selectGroup:a=>{const y=Bf(a);return y||a.announce("plonk"),y},selectAll:a=>a.setSelection(0,a.lastOffset),extendSelectionForward:a=>Ks(a,"forward",{extend:!0}),extendSelectionBackward:a=>Ks(a,"backward",{extend:!0}),extendToNextWord:a=>pu(a,"forward",{extend:!0}),extendToPreviousWord:a=>pu(a,"backward",{extend:!0}),extendSelectionUpward:a=>Ks(a,"upward",{extend:!0}),extendSelectionDownward:a=>Ks(a,"downward",{extend:!0}),extendToNextBoundary:a=>pu(a,"forward",{extend:!0}),extendToPreviousBoundary:a=>pu(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 wc=null,kd=0,Hh=class es{static start(y,b,E,ee){var re;es.element=y,(re=es.controller)==null||re.abort(),es.controller=new AbortController;const ae={signal:es.controller.signal};"PointerEvent"in window?(y.addEventListener("pointermove",E,ae),y.addEventListener("pointerup",ee,ae),y.addEventListener("pointercancel",ee,ae),Of(b)&&(es.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=es.controller)==null||y.abort(),es.controller=void 0,typeof es.pointerId=="number"&&(es.element.releasePointerCapture(es.pointerId),es.pointerId=void 0)}};function Of(a){return a!==null&&globalThis.PointerEvent!==void 0&&a instanceof PointerEvent}function Z0(a,y){var b;if(y.buttons>1)return;a.atomBoundsCache=new Map;const E=a;let ee,re=!1,ae=!1,he="none",pe=!1,ve=!1;const we=y.clientX,Re=y.clientY,Je=Date.now(),vt=E.field,kt=setInterval(()=>{pe?vt.scroll({top:0,left:vt.scrollLeft-16}):ve&&vt.scroll({top:0,left:vt.scrollLeft+16})},32);function xn(){Hh.stop(),re=!1,clearInterval(kt),a.element.classList.remove("tracking"),y&&y.preventDefault()}function ir(Nn){if(!E.hasFocus()){xn();return}const dr=Nn.clientX,Kn=Nn.clientY,Zr=Of(Nn)&&Nn.pointerType==="touch"?20:5;if(Date.now()<Je+500&&Math.abs(we-dr)<Zr&&Math.abs(Re-Kn)<Zr){Nn.preventDefault(),Nn.stopPropagation();return}const qr=vt.getBoundingClientRect();ve=dr>qr.right,pe=dr<qr.left;let Vr=ee;Of(Nn)&&(Nn.isPrimary||(Vr=_d(E,Nn.clientX,Nn.clientY,{bias:0})));const Ti=_d(E,dr,Kn,{bias:dr<=we?dr===we?0:-1:1});Vr>=0&&Ti>=0&&(E.model.extendSelectionTo(Vr,Ti),va(a)),ae&&Bf(E.model)}wc&&Math.abs(wc.x-we)<5&&Math.abs(wc.y-Re)<5&&Date.now()<wc.time+500?(kd+=1,wc.time=Je):(wc={x:we,y:Re,time:Je},kd=1);const yn=vt.getBoundingClientRect();if(we>=yn.left&&we<=yn.right&&Re>=yn.top&&Re<=yn.bottom){if(a.flushInlineShortcutBuffer(),a.adoptStyle="left",ee=_d(a,we,Re,{bias:0}),ee>=0){if(a.element.classList.add("tracking"),y.shiftKey){const Nn=a.model.selectionIsCollapsed;a.model.extendSelectionTo(a.model.anchor,ee),v0(a.model)||Nn?he="all":he="selection"}else a.model.at(ee).type==="placeholder"?(a.model.setSelection(ee-1,ee),he="selection"):((b=a.model.at(ee).rightSibling)==null?void 0:b.type)==="placeholder"?(a.model.setSelection(ee,ee+1),he="selection"):(a.model.position=ee,v0(a.model)?he="all":he="selection");a.defaultStyle={},y.detail===3||kd>2?(xn(),(y.detail===3||kd===3)&&(a.model.selection={ranges:[[0,a.model.lastOffset]]},he="all")):re||(re=!0,Hh.start(vt,y,ir,xn),(y.detail===2||kd===2)&&(ae=!0,Bf(a.model),he="all"))}a.hasFocus()||(he="none",a.focus({preventScroll:!0}))}else wc=null;a.stopCoalescingUndo(),he!=="none"&&(a.model.selectionIsCollapsed&&(he="all"),va(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 j0(a,y,b,E,ee){if(!b.id)return[1/0,null];if(y.has(b.id))return y.get(b.id);const re=Il(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 he of b.children){const pe=j0(a,y,he,E,ee);pe[0]<=ae[0]&&(ae=pe)}return ae[1]||(ae=[Qg(E,ee,re),b]),y.set(b.id,ae),ae}function ev(a,y,b){const[,E]=j0(a,new Map,a.model.root,y,b);return E}function _d(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 he=[];let pe=ae;for(;pe;)he.unshift(pe),pe=pe.parent;for(const we of he)if(we.captureSelection){ae=we;break}let ve=a.model.offsetOf(ae);if(ve<0)return-1;if(ae.leftSibling)if(E.bias===0&&ae.type!=="placeholder"){const we=Il(a,ae);we&&y<(we.left+we.right)/2&&(ve=a.model.offsetOf(ae.leftSibling))}else E.bias<0&&(ve=a.model.offsetOf(ae.leftSibling));return ve}var tv=class extends si{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=Ol(re),{model:he}=a;he.selectionIsCollapsed||he.deleteAtoms(Wa(he.selection));const pe=he.at(he.position);if(pe.parent instanceof hi){console.assert(pe.parentBranch!==void 0);const ve=[];let we=[];ae[0].type==="first"&&ae.shift(),ae[ae.length-1].type==="first"&&ae.pop();for(const kt of ae)kt.type==="first"&&we.length>0?(ve.push(we),we=[kt]):we.push(kt);we.length>0&&ve.push(we);let Re=Number(pe.parentBranch[0]),Je=Number(pe.parentBranch[1]);const vt=pe.parent.maxColumns;for(;pe.parent.colCount-Je<ve.length&&pe.parent.colCount<vt;)pe.parent.addColumn();pe.parent.addChildrenAfter(ve[0],pe);for(let kt=1;kt<ve.length;kt++)Je++,Je>=vt&&(Je=0,pe.parent.addRowAfter(Re),Re++),pe.parent.setCell(Re,Je,ve[kt])}else pe.parent.addChildrenAfter(ae.filter(ve=>ve.type!=="first"),pe);return he.position=he.offsetOf(ae[ae.length-1]),he.contentDidChange({inputType:"insertFromPaste"}),va(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]=$s(b),E==="auto"&&re&&(E="latex"),a.stopCoalescingUndo(),a.stopRecording(),this.insert(a.model,b,{format:E})&&(a.startRecording(),a.snapshot("paste"),va(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 he=a.silenceNotifications;a.silenceNotifications=!0;const pe={"?":"\\placeholder{}","@":"\\placeholder{}"};pe[0]=b.insertionMode==="replaceAll"?"":a.getValue(a.selection,"latex-unstyled"),b.insertionMode==="replaceSelection"&&!a.selectionIsCollapsed?a.deleteAtoms(Wa(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 ve=-1;pe[0]?pe["@"]=pe[0]:typeof y=="string"&&/(^|[^\\])#@/.test(y)&&(ve=rv(a),ve>=0&&(pe["@"]=a.getValue(ve,a.position,"latex"))),pe[0]||(pe[0]=pe["?"]);let we=!1;const Re=dr=>(we=!0,pe[dr]);let[Je,vt]=V0(a,y,Re,b);if(!vt)return!1;const kt=vt.length===1&&vt[0].type==="genfrac";kt&&ve>=0&&typeof a.mathfield.options.isImplicitFunction=="function"&&a.mathfield.options.isImplicitFunction(a.at(a.position).command)?(pe["@"]=pe["?"],we=!1,[Je,vt]=V0(a,y,Re,b)):ve>=0&&a.deleteAtoms([ve,a.position]);const{parent:xn}=a.at(a.position),ir=xn.hasEmptyBranch("body");if(kt&&Je!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&xn instanceof $i&&xn.leftDelim==="("&&ir){const dr=xn.parent,Kn=xn.parentBranch;dr.removeChild(xn),dr.setChildren(vt,Kn)}const yn=a.at(a.position);yn.parent.addChildrenAfter(vt,yn),Je==="latex"&&typeof y=="string"&&(xn==null?void 0:xn.type)==="root"&&ir&&!we&&(xn.verbatimLatex=y),a.silenceNotifications=he;const Nn=vt[vt.length-1];if(b.selectionMode==="placeholder"){const dr=vt.flatMap(Kn=>[Kn,...Kn.children]).find(Kn=>Kn.type==="placeholder");if(dr){const Kn=a.offsetOf(dr);a.setSelection(Kn-1,Kn),a.announce("move")}else Nn&&(a.position=a.offsetOf(Nn))}else b.selectionMode==="before"||(b.selectionMode==="after"?Nn&&(a.position=a.offsetOf(Nn)):b.selectionMode==="item"&&a.setSelection(a.anchor,a.offsetOf(Nn)));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 he=window.MathfieldElement.computeEngine;if(!he)return["math-json",[]];[re,y]=["latex",he.box(y).latex],ae=ja(y,{context:a.mathfield.context})}else typeof y=="string"&&E.format==="ascii-math"?([re,y]=uc(y,{format:"ascii-math",inlineShortcuts:a.mathfield.options.inlineShortcuts}),ae=ja(y,{context:a.mathfield.context}),re!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&Wh(ae)):(E.format==="auto"||(ee=E.format)!=null&&ee.startsWith("latex"))&&(E.format==="auto"&&([re,y]=uc(y,{format:"auto",inlineShortcuts:a.mathfield.options.inlineShortcuts})),E.format==="latex"&&([,y]=$s(y)),ae=ja(y,{context:a.mathfield.context,args:b}),E.format!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&Wh(ae));return Rl(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 $i&&y.leftDelim==="("&&y.rightDelim===")"?y.removeBranch("body"):null}function Wh(a){if(a){for(let y=0;a[y];y++){const b=a[y];if(b instanceof $i&&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)){Wh(y.branch(b));const E=nv(y.branch(b));E&&y.setChildren(E,b)}if(y instanceof hi)for(const b of y.cells)Wh(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||U0(y));)y=y.leftSibling;else{const ee=[];for(;!y.isFirstSibling&&(U0(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 U0(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 si{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"),va(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(Wa(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(Rl(re,b.style),!re)return!1;const ae=a.at(a.position),he=ae.parent.addChildrenAfter(re,ae);return a.silenceNotifications=ee,b.selectionMode==="before"||(b.selectionMode==="item"?a.setSelection(a.anchor,a.offsetOf(he)):he&&(a.position=a.offsetOf(he))),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 "),ja(a,{context:y,parseMode:"text"})}new iv;function Hs(a){return{value:a.model.getValue(),selectionIsCollapsed:a.model.selectionIsCollapsed,canUndo:a.canUndo(),canRedo:a.canRedo(),style:a.selectionStyle,mode:a.model.mode}}var ia=4,Mo=20,Ba=2*(Mo+ia),Zh=(a,y)=>`
|
|
|
<line x1="${a+Mo}" y1="${y+Mo}"
|
|
|
x2="${a>y?a+Mo:7*Mo+10*ia}"
|
|
|
y2="${a<y?y+Mo:7*Mo+10*ia}"/>
|
|
|
<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+Mo}" y1="${y+Mo}"
|
|
|
x2="${a>y?a+Mo:7*Mo+10*ia}"
|
|
|
y2="${a<y?y+Mo:7*Mo+10*ia}"/>
|
|
|
<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>`,jh=(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*Mo+10*ia+5} ${8*Mo+10*ia+5}">
|
|
|
<rect
|
|
|
class="MLEP__array-insert-background rows"
|
|
|
x="0"
|
|
|
y="${Ba+ia}"
|
|
|
height="${3*Ba}"
|
|
|
width="${Ba}"
|
|
|
rx="${Ba/2}"/>
|
|
|
<rect
|
|
|
class="MLEP__array-insert-background columns"
|
|
|
x="${Ba+ia}"
|
|
|
y="0"
|
|
|
height="${Ba}"
|
|
|
width="${3*Ba}"
|
|
|
rx="${Ba/2}"/>
|
|
|
<g data-command='"moveDown"'>
|
|
|
${jh(2*(ia+Ba),2*ia+3*Ba,0)}
|
|
|
</g>
|
|
|
<g data-command='"moveUp"'>
|
|
|
${jh(2*(ia+Ba),2*ia+Ba,180)}
|
|
|
</g>
|
|
|
<g data-command='"moveToNextWord"'>
|
|
|
${jh(2*ia+3*Ba,2*(ia+Ba),-90)}
|
|
|
</g>
|
|
|
<g data-command='"moveToPreviousWord"'>
|
|
|
${jh(2*ia+Ba,2*(ia+Ba),90)}
|
|
|
</g>
|
|
|
<g>
|
|
|
|
|
|
<g data-command='"addColumnBefore"'>
|
|
|
${Zh(2*ia+Ba,ia)}
|
|
|
</g>
|
|
|
<g data-command='"removeColumn"'>
|
|
|
${G0(2*ia+2*Ba,ia)}
|
|
|
</g>
|
|
|
<g data-command='"addColumnAfter"'>
|
|
|
${Zh(2*ia+3*Ba,ia)}
|
|
|
</g>
|
|
|
<g data-command='"addRowBefore"'>
|
|
|
${Zh(ia,2*ia+Ba)}
|
|
|
</g>
|
|
|
<g data-command='"removeRow"'>
|
|
|
${G0(ia,2*ia+2*Ba)}
|
|
|
</g>
|
|
|
<g data-command='"addRowAfter"'>
|
|
|
${Zh(ia,2*ia+3*Ba)}
|
|
|
</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>`,hv=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>`,fv=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>`,$f={matrix:sv,pmatrix:lv,bmatrix:cv,Bmatrix:X0,vmatrix:uv,Vmatrix:dv},Rf={cases:hv,rcases:fv,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(kt=>{(!ee||kt.length>ee)&&(ee=kt.length)});let re=document.getElementById("mathlive-environment-popover");re||(re=Mh("mathlive-environment-popover"),Bo("environment-popover"),Bo("core"),re.setAttribute("aria-hidden","true"));let ae;const he=re.querySelector(".MLEP__environment-controls");he?ae=he:(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 pe=[],ve="";const we=a.model.parentEnvironment.environmentName;if(co(we)){const kt=gv(we);ve=$f[kt]("active");const xn=$f,{[kt]:ir}=xn,yn=ut(xn,[ze(kt)]);pe=Object.values(yn).map(Nn=>Nn("inactive"))}else if(uo(we)){const kt=vv(we);ve=Rf[kt]("active");const xn=Rf,{[kt]:ir}=xn,yn=ut(xn,[ze(kt)]);pe=Object.values(yn).map(Nn=>Nn("inactive"))}else ka(we)&&(ve=$f.matrix("active"),pe=Object.values(Rf).map(kt=>kt("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'>
|
|
|
${ve}
|
|
|
${pe.join("")}
|
|
|
</div>`,ve&&ae.appendChild(Re),ae.querySelectorAll("[data-command]").forEach(kt=>{const xn=kt.dataset.command;let ir=xn;try{ir=JSON.parse(xn)}catch(yn){}kt.addEventListener("mousedown",yn=>yn.preventDefault()),ir&&kt.addEventListener("click",()=>a.executeCommand(ir))});const vt=(b=a.field)==null?void 0:b.getBoundingClientRect();vt&&(re.style.top=`${window.scrollY+(vt.top-re.clientHeight-15)}px`,re.style.left=`${vt.left+20}px`,re.classList.add("is-visible"))}function Nf(){const a=document.getElementById("mathlive-environment-popover");a==null||a.classList.remove("is-visible")}function mv(){document.getElementById("mathlive-environment-popover")&&(bf("mathlive-environment-popover"),x("environment-popover"),x("core"))}function Vh(a){if(!a.hasFocus())return;let y=!1;if(a.model.mode==="math"){const b=a.model.parentEnvironment;if(b!=null&&b.array&&da(b.environmentName)){const E=a.options.environmentPopoverPolicy;y=E==="auto"||E==="on"}}y?pv(a):Nf()}function gv(a){return a.replace("*","")}function vv(a){return a==="dcases"?"cases":a}function Y0(a){const y=getComputedStyle(a).direction;return y==="ltr"||y==="rtl"?y:"ltr"}function J0(a,y,b){return y==="left"||y==="leading"&&b==="ltr"||y==="trailing"&&b==="rtl"?a.left:a.right}function Ff(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=Y0(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(),he=Number.isFinite(y.maxHeight)?Math.min(y.maxHeight,window.innerHeight):window.innerHeight;let pe=Math.min(he,(E=y.height)!=null?E:ae.height),ve=Ff(y.location.y,pe,y.verticalPos,re);ve+pe>window.innerHeight-8&&(y.alternateLocation?(ve=Ff(y.alternateLocation.y,pe,y.verticalPos,re),ve+pe>window.innerHeight-8&&(ve=void 0)):ve=void 0),Number.isFinite(ve)||(ve=Math.max(8,window.innerHeight-8-pe),8+pe>window.innerHeight-8&&(a.style.bottom="8px")),pe=Math.min(ve+pe,window.innerHeight-8)-ve;const we=Number.isFinite(y.maxWidth)?Math.min(y.maxWidth,window.innerWidth):window.innerWidth;let Re=Math.min(we,(ee=y.width)!=null?ee:ae.width),Je=Ff(y.location.x,Re,y.horizontalPos,re);Je+Re>window.innerWidth-8&&(y.alternateLocation?(Je=yv(y.alternateLocation.x,Re,y.verticalPos,re),Je+Re>window.innerWidth-8&&(Je=void 0)):Je=void 0),Number.isFinite(Je)||(Je=Math.max(8,window.innerWidth-8-Re),8+Re>window.innerWidth-8&&(a.style.right="8px")),Re=Math.min(Je+Re,window.innerWidth-8)-Je,re==="rtl"?a.style.right=`${Math.ceil(window.innerWidth-Je-Re).toString()}px`:a.style.left=`${Math.ceil(Je).toString()}px`,a.style.top=`${Math.ceil(ve).toString()}px`,pe!==ae.height&&(a.style.height=`${Math.ceil(pe).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 mu(a){return"submenu"in a}function Ws(a){return"type"in a&&a.type==="command"||"onMenuSelect"in a||"id"in a}function zf(a){return"type"in a&&a.type==="divider"}function Kf(a){return"type"in a&&a.type==="heading"}var q0={};function Hf(a){let y=q0[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,q0[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,mu(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=Ws(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(zf(ee)){this.enabled=!1,this.checked=!1;return}Kf(ee)&&(this.enabled=!1,this.checked=!1,this.visible=!0),Ws(ee)&&(this.checked=Ws(ee)&&((y=gu(ee.checked,a))!=null?y:!1)),(Ws(ee)||mu(ee))&&(this.enabled=(b=gu(ee.enabled,a))!=null?b:!0,this.visible=(E=gu(ee.visible,a))!=null?E:!0,this.visible&&this.enabled&&this.submenu&&(this.submenu.updateState(a),this.submenu.visible||(this.visible=!1))),(Ws(ee)||Kf(ee)||mu(ee))&&(this.label=gu(ee.label,a),this.tooltip=gu(ee.tooltip,a),this.ariaLabel=gu(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(Hf("checkmark"))):this.checked==="mixed"?(a.setAttribute("aria-checked","mixed"),a.append(Hf("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),Ws(this._declaration)&&this._declaration.keyboardShortcut){const b=document.createElement("kbd");b.innerHTML=vf(this._declaration.keyboardShortcut),a.append(b)}this.type==="submenu"&&a.append(Hf("trailing-chevron"))}get element(){if(this._element)return this._element;if(zf(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,(Ws(this._declaration)||Kf(this._declaration)||mu(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(!Ws(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=Y0(this.element);this.submenu.show({container:this.rootMenu.element.parentNode,location:{x:J0(b,"trailing",E),y:b.top-4},alternateLocation:{x:J0(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(),he=this.element.getBoundingClientRect();ae.left<he.left+he.width/2&&(re="left")}return re==="right"?E>0:E<0}};function wv(a,y,b){return Math.hypot(a,y)/b}function gu(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 Mu{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(ve=>ve.updateState(y));const re=this.hasCheck;this.hasCheck=this._menuItems.some(ve=>ve.visible&&ve.hasCheck),this.hasCheck!==re&&this._menuItems.forEach(ve=>ve.updateState(y));let ae,he=0;for(const ve of this._menuItems)ve.type==="heading"?(ae&&he===0&&(ae.visible=!1),ae=ve,he=0):ve.type==="divider"&&ae?(ae.visible=he>0,ae=void 0,he=0):ae&&ve.visible&&(he+=1);ae&&(ae.visible=he>0);let pe=!0;for(const ve of this._menuItems)ve.type==="divider"?(ve.visible=!pe,pe=!0):ve.visible&&(pe=!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 Mu._collator||(Mu._collator=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),Mu._collator}findMenuItem(y){var b;this.updateIfDirty();const E=this._menuItems.filter(he=>he.type!=="divider"&&he.visible&&he.enabled);if(E.length===0)return null;const ee=Math.max(...E.map(he=>he.label.length))-y.length;if(ee<0)return null;let re=null,ae=0;for(;ae<ee&&!re;)re=(b=E.find(he=>Mu.collator.compare(y,he.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),Qt()&&(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),Qt()&&((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=fc(y)),y.stopImmediatePropagation()}handleKeydownEvent(y){var b,E,ee;if(y.key==="Tab"||y.key==="Escape"){this.hide();return}this.isDynamic&&(this.modifiers=fc(y));let re=!0;const ae=this.activeSubmenu,he=ae.activeMenuItem;switch(y.key){case" ":case"Space":case"Return":case"Enter":he==null||he.select(fc(y));break;case"ArrowRight":if((he==null?void 0:he.type)==="submenu")he.select(fc(y)),this.activeSubmenu.activeMenuItem=this.activeSubmenu.firstMenuItem;else if(!he)ae.activeMenuItem=ae.firstMenuItem;else{const pe=(b=ae.getMenuItemColumn(he))!=null?b:-1;if(pe>=0&&pe<((E=ae.columnCount)!=null?E:1)-1){const ve=ae.nextMenuItem(1);ve&&(ae.activeMenuItem=ve)}}break;case"ArrowLeft":if(ae===this.rootMenu)he||(ae.activeMenuItem=ae.firstMenuItem);else if((he&&(ee=ae.getMenuItemColumn(he))!=null?ee:-1)<=0||!he){ae.hide();const ve=ae.parentMenu.activeMenuItem;if(ve){const{element:we}=ve;we==null||we.focus(),we==null||we.classList.remove("is-submenu-open")}}else{const ve=ae.nextMenuItem(-1);ve&&(ae.activeMenuItem=ve)}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 pe=ae.findMenuItem(this.typingBuffer);pe&&(ae.activeMenuItem=pe),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}break;default:if(wh(y)){isFinite(this.typingBufferResetTimer)&&clearTimeout(this.typingBufferResetTimer),this.typingBuffer+=y.key;const pe=ae.findMenuItem(this.typingBuffer);pe&&(ae.activeMenuItem=pe),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 Fs.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),Fs.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),Fs.state==="open"&&Fs.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(Me(Ce({},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,Fs.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 zf(a)?!1:typeof a.label=="function"||typeof a.ariaLabel=="function"||typeof a.tooltip=="function"||(Ws(a)||mu(a))&&(typeof a.enabled=="function"||typeof a.visible=="function")||Ws(a)&&typeof a.checked=="function"?!0:mu(a)?a.submenu.some(rp):!1}var Uh=class{};Uh.DELAY=300,Uh.MAX_DISTANCE=10;function Cv(a){return new Promise((y,b)=>{const E=xh(a);E||y(!1);let ee=E;const re=setTimeout(()=>{ae.abort(),y(xv(ee,E)<Uh.MAX_DISTANCE)},Uh.DELAY),ae=new AbortController,he=ae.signal;for(const pe of["pointermove","pointerup","pointercancel"])window.addEventListener(pe,ve=>{if(ve.type==="pointerup"||ve.type==="pointercancel")clearTimeout(re),ae.abort(),y(!1);else if(ve.type==="pointermove"){const we=xh(ve);we&&(ee=we)}},{passive:!0,signal:he})})}function ip(a,y,b){return zl(this,null,function*(){if(a.type==="contextmenu"){const E=a;if(b.show({target:y,location:xh(E),modifiers:fc(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:fc(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=xh(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};xt(Object.keys(ap),"{body:auto}",{createAtom:a=>new z(Me(Ce({},a),{body:Ye(a.args[0]),accentChar:ap[a.command.slice(1)]}))}),xt(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:a=>{const y=on(Ye(a.args[0]));return new z(Me(Ce({},a),{body:Ye(a.args[0]),svgAccent:a.command.slice(1)+(y.length>5?"4":["1","1","2","2","3","3"][y.length])}))}}),xt(["overarc","overparen","wideparen"],"{body:auto}",{createAtom:a=>new z(Me(Ce({},a),{body:Ye(a.args[0]),svgAccent:"overarc"}))}),xt(["underarc","underparen"],"{body:auto}",{createAtom:a=>new Jo(Me(Ce({},a),{body:Ye(a.args[0]),svgBelow:"underarc"}))}),xt("utilde","{body:auto}",{createAtom:a=>{const y=Ye(a.args[0]),b=on(y),E="widetilde"+(b.length>5?"4":["1","1","2","2","3","3"][b.length]);return new Jo(Me(Ce({},a),{body:y,svgBelow:E,boxType:El(y)}))}}),xt("^","{:string}",{createAtom:a=>{var y;return new Pn(Me(Ce({},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:"^"}))}}),xt("`","{:string}",{createAtom:a=>{var y;return new Pn(Me(Ce({},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:"`"}))}}),xt("'","{:string}",{createAtom:a=>{var y;return new Pn(Me(Ce({},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:"'"}))}}),xt('"',"{:string}",{createAtom:a=>{var y,b;return new Pn(Me(Ce({},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]:'"'}))}}),xt(".","{:string}",{createAtom:a=>{var y,b;return new Pn(Me(Ce({},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]:"."}))}}),xt("=","{:string}",{createAtom:a=>{var y,b;return new Pn(Me(Ce({},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]:"="}))}}),xt("~","{:string}",{createAtom:a=>{var y;return new Pn(Me(Ce({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"}))}}),xt("c","{:string}",{createAtom:a=>{var y;return new Pn(Me(Ce({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={c:"\xE7",C:"\xC7"}[a.args[0]])!=null?y:""}))}}),xt("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 he of ae){const pe=he.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(pe)ee.strokeWidth=pe[1],ee.strokeStyle=pe[2],ee.strokeColor=pe[3];else{const ve=he.match(/\s*([a-z]*)\s*=\s*"(.*)"/);ve&&(ve[1]==="mathbackground"?ee.backgroundcolor=ve[2]:ve[1]==="mathcolor"?ee.strokeColor=ve[2]:ve[1]==="padding"?ee.padding=ve[2]:ve[1]==="shadow"&&(ee.shadow=ve[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 cd(a.command,Ye(E[2]),re,ee)}}),xt("cancel","{body:auto}",{createAtom:a=>{var y;return new cd(a.command,Ye(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:{}})}}),xt("bcancel","{body:auto}",{createAtom:a=>{var y;return new cd(a.command,Ye(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:{}})}}),xt("xcancel","{body:auto}",{createAtom:a=>{var y;return new cd(a.command,Ye(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:{}})}}),xt(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overlinesegment","overgroup"],"{:auto}",{createAtom:a=>{var y;return new Jo(Me(Ce({},a),{body:Ye((y=a.args)==null?void 0:y[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgAbove:a.command.slice(1)}))}}),xt("overbrace","{:auto}",{createAtom:a=>new Jo(Me(Ce({},a),{body:Ye(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgAbove:a.command.slice(1)}))}),xt(["underrightarrow","underleftarrow","underleftrightarrow","underlinesegment","undergroup"],"{:auto}",{createAtom:a=>new Jo(Me(Ce({},a),{body:Ye(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgBelow:a.command.slice(1)}))}),xt(["underbrace"],"{:auto}",{createAtom:a=>new Jo(Me(Ce({},a),{body:Ye(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgBelow:a.command.slice(1)}))}),xt(["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 Jo(Me(Ce({},a),{svgBody:a.command.slice(1),above:((b=Ye((y=a.args)==null?void 0:y[1]))==null?void 0:b.length)===0?void 0:Ye((E=a.args)==null?void 0:E[1]),below:(re=Ye((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)}`}),xt(["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 hc(a.command.slice(1),Me(Ce({},a),{limits:"adjacent",isFunction:!0,variant:"main",variantStyle:"up"}))}),xt(["liminf","limsup"],"",{ifMode:"math",createAtom:a=>new hc({"\\liminf":"lim inf","\\limsup":"lim sup"}[a.command],Me(Ce({},a),{limits:"over-under",variant:"main"}))}),xt(["lim","mod"],"",{ifMode:"math",createAtom:a=>new hc(a.command.slice(1),Me(Ce({},a),{limits:"over-under",variant:"main"}))}),xt(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:a=>new hc(a.command.slice(1),Me(Ce({},a),{limits:"over-under",isFunction:!0,variant:"main"}))}),xt(["ang"],"{:math}",{ifMode:"math",createAtom:a=>new Pn(Me(Ce({},a),{body:Ye(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 or("\xB0",{style:Me(Ce({},a.style),{variant:"normal",variantStyle:"up"})});return new or([b,ee],{type:"inner",isSelected:a.isSelected,caret:E})}}),xt("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:a=>new o0(Me(Ce({},a),{body:Ye(a.args[1]),index:a.args[0]?Ye(a.args[0]):void 0}))}),xt(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{:expression}{:expression}",{ifMode:"math",createAtom:a=>{const y=Ce({},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 ou(E[0]?Ye(E[0]):[new Qr],E[1]?Ye(E[1]):[new Qr],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}`:ra(a.command,b,E)}}),xt(["brace","brack"],"",{infix:!0,createAtom:a=>new ou(Ye(a.args[0]),Ye(a.args[1]),Me(Ce({},a),{hasBarLine:!1,leftDelim:a.command==="\\brace"?"\\lbrace":"\\lbrack",rightDelim:a.command==="\\brace"?"\\rbrace":"\\rbrack"})),serialize:(a,y)=>Si([a.aboveToLatex(y),a.command,a.belowToLatex(y)])}),xt(["over","atop","choose"],"",{infix:!0,createAtom:a=>{let y,b;const E=a.args;return a.command==="\\choose"&&(y="(",b=")"),new ou(Ye(E[0]),Ye(E[1]),Me(Ce({},a),{hasBarLine:a.command==="\\over",leftDelim:y,rightDelim:b}))},serialize:(a,y)=>Si([a.aboveToLatex(y),a.command,a.belowToLatex(y)])}),xt(["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 ou(Ye(E[0]),Ye(E[1]),Me(Ce({},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)}`}),xt("pdiff","{numerator}{denominator}",{ifMode:"math",createAtom:a=>new ou(Ye(a.args[0]),Ye(a.args[1]),Me(Ce({},a),{hasBarLine:!0,numerPrefix:"\u2202",denomPrefix:"\u2202"}))}),xt(["sum","prod","bigcup","bigcap","coprod","bigvee","bigwedge","biguplus","bigotimes","bigoplus","bigodot","bigsqcup","intop"],"",{ifMode:"math",createAtom:a=>new hf({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)],Me(Ce({},a),{limits:"auto",variant:"main"}))}),xt("smallint","",{ifMode:"math",createAtom:a=>new hc("\u222B",Me(Ce({},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"};xt(Object.keys(op),"",{ifMode:"math",createAtom:a=>{const y=a.command,b=op[y.slice(1)];return new hf(b,Me(Ce({},a),{limits:"adjacent",variant:{"\u22D2":"ams","\u22D3":"ams"}[b]}))}}),xt(["Re","Im"],"",{ifMode:"math",createAtom:a=>new hc({"\\Re":"\u211C","\\Im":"\u2111"}[a.command],Me(Ce({},a),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))}),xt("middle","{:delim}",{ifMode:"math",createAtom:a=>{var y;return new r0(Me(Ce({},a),{delim:(y=a.args[0])!=null?y:"|",size:1}))}}),xt("the","{:value}",{createAtom:a=>new Pn(Me(Ce({},a),{captureSelection:!0,verbatimLatex:null})),render:(a,y)=>{var b;const E=new Di({parent:y},a.style);let ee="";a.isSelected&&(ee+=" ML__selected");const re=E.evaluate(a.args[0]);return new or(((b=Ma(re))!=null?b:"").split("").map(ae=>new or(ae,{type:"ord",classes:ee,mode:a.mode,isSelected:a.isSelected,style:Ce({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=Ma(a.args[0]))!=null?y:"\\relax"}`}}),xt("mathtip","{:auto}{:math}",{createAtom:a=>new ff(Me(Ce({},a),{body:Ye(a.args[0]),tooltip:Ye(a.args[1]),content:"math"})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`\\texttip{${a.bodyToLatex(y)}}{${Pn.serialize([a.tooltip],Me(Ce({},y),{defaultMode:"math"}))}}`}),xt("texttip","{:auto}{:text}",{createAtom:a=>new ff(Me(Ce({},a),{body:Ye(a.args[0]),tooltip:Ye(a.args[1]),content:"text"})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`\\texttip{${a.bodyToLatex(y)}}{${Pn.serialize([a.tooltip],Me(Ce({},y),{defaultMode:"text"}))}}`}),xt("error","{:math}",{createAtom:a=>new Pn(Me(Ce({},a),{body:Ye(a.args[0])})),serialize:(a,y)=>`\\error{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__error"})}),xt("ensuremath","{:math}",{createAtom:a=>new Pn(Me(Ce({},a),{body:Ye(a.args[0])})),serialize:(a,y)=>`${a.command}{${a.bodyToLatex(Me(Ce({},y),{defaultMode:"math"}))}}`}),xt("color","{:value}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimColor:(E=Ma(y[0]))!=null?E:void 0,color:b.toColor((ee=y[0])!=null?ee:{string:"red"})}}}),xt("textcolor","{:value}{content:auto*}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimColor:(E=Ma(y[0]))!=null?E:void 0,color:b.toColor((ee=y[0])!=null?ee:{string:"red"})}}}),xt("boxed","{content:math}",{createAtom:a=>new ba(Me(Ce({},a),{body:Ye(a.args[0]),framecolor:{string:"black"}}))}),xt("colorbox","{:value}{:text*}",{applyStyle:(a,y,b)=>{var E,ee;return{verbatimBackgroundColor:(E=Ma(y[0]))!=null?E:void 0,backgroundColor:b.toBackgroundColor((ee=y[0])!=null?ee:{string:"yellow"})}}}),xt("fcolorbox","{frame-color:value}{background-color:value}{content:text}",{applyMode:"text",createAtom:a=>{var y,b;return new ba(Me(Ce({},a),{body:Ye(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(Me(Ce({},y),{defaultMode:"text"})):ra(a.command,(b=Ma(a.framecolor))!=null?b:"",(E=Ma(a.backgroundcolor))!=null?E:"",a.bodyToLatex(Me(Ce({},y),{defaultMode:"text"})))}}),xt("bbox","[:bbox]{body:auto}",{createAtom:a=>{var y;const b=a.args[0],E=Ye(a.args[1]);return b?new ba(Me(Ce({},a),{body:E,padding:b.padding,border:b.border,backgroundcolor:(y=b.backgroundcolor)!=null?y:void 0})):new ba(Me(Ce({},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=Ma(a.padding))!=null?b:""),a.border&&re.push(`border: ${a.border}`),a.backgroundcolor&&re.push((E=Ma(a.backgroundcolor))!=null?E:""),ee+=`[${re.join(",")}]`}return ra(ee,a.bodyToLatex(y))}}),xt(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:a=>new Pn(Me(Ce({},a),{body:Ye(a.args[0])})),render:(a,y)=>{const b=new Di({parent:y,mathstyle:a.command.slice(1)},a.style),E=Pn.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):`{${Si([a.command,a.bodyToLatex(y)])}}`}),xt(["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]})}),xt("fontseries","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontSeries:(b=y[0])!=null?b:"auto"}}}),xt("fontshape","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontShape:(b=y[0])!=null?b:"auto"}}}),xt("fontfamily","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontFamily:(b=y[0])!=null?b:"roman"}}}),xt("selectfont","",{ifMode:"text",applyStyle:()=>({})}),xt("bf","{:rest}",{applyStyle:()=>({fontSeries:"b",fontShape:"n",fontFamily:"roman"})}),xt(["boldsymbol","bm"],"{:math}",{applyMode:"math",createAtom:a=>new Pn(Me(Ce({},a),{body:Ye(a.args[0])})),serialize:(a,y)=>`${a.command}{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__boldsymbol"})}),xt("bold","{:math*}",{applyMode:"math",applyStyle:()=>({variantStyle:"bold"})}),xt("bfseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),xt("mdseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),xt("upshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),xt("slshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),xt("scshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),xt("textbf","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),xt("textmd","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),xt("textup","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),xt("textnormal","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n",fontSeries:"m"})}),xt("textsl","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),xt("textit","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"it"})}),xt("textsc","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),xt("textrm","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"roman"})}),xt("textsf","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"sans-serif"})}),xt("texttt","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"monospace"})}),xt("mathbf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"bold"})}),xt("mathit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"italic"})}),xt("mathnormal","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"italic"})}),xt("mathbfit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"bolditalic"})}),xt("mathrm","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"up"})}),xt("mathsf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"sans-serif",variantStyle:"up"})}),xt("mathtt","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"monospace",variantStyle:"up"})}),xt("it","{:rest}",{applyStyle:()=>({fontSeries:"m",fontShape:"it",fontFamily:"roman",variantStyle:"italic"})}),xt("rmfamily","",{applyStyle:()=>({fontFamily:"roman"})}),xt("sffamily","",{applyStyle:()=>({fontFamily:"sans-serif"})}),xt("ttfamily","",{applyStyle:()=>({fontFamily:"monospace"})}),xt(["Bbb","mathbb"],"{:math*}",{applyStyle:()=>({variant:"double-struck",variantStyle:"up"})}),xt(["frak","mathfrak"],"{:math*}",{applyStyle:()=>({variant:"fraktur",variantStyle:"up"})}),xt("mathcal","{:math*}",{applyStyle:()=>({variant:"calligraphic",variantStyle:"up"})}),xt("mathscr","{:math*}",{applyStyle:()=>({variant:"script",variantStyle:"up"})}),xt("mbox","{:text}",{ifMode:"math",createAtom:a=>new Pn(Me(Ce({},a),{type:"mord",body:Ye(a.args[0]),mode:"math"})),serialize:(a,y)=>ra("\\mbox",a.bodyToLatex(Me(Ce({},y),{defaultMode:"text"})))}),xt("text","{:text}",{ifMode:"math",applyMode:"text"}),xt(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:a=>new Pn(Me(Ce({},a),{body:Ye(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:""})}}),xt(["cssId","htmlId"],"{id:string}{content:auto}",{createAtom:a=>new Pn(Me(Ce({},a),{body:Ye(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}}),xt("htmlData","{data:string}{content:auto}",{createAtom:a=>new Pn(Me(Ce({},a),{body:Ye(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}}),xt(["style","htmlStyle"],"{data:string}{content:auto}",{createAtom:a=>new Pn(Me(Ce({},a),{body:Ye(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}}),xt("em","{:rest}",{createAtom:a=>new Pn(Me(Ce({},a),{body:Ye(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"})}),xt("emph","{:auto}",{createAtom:a=>new Pn(Me(Ce({},a),{body:Ye(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}};xt(["bigl","Bigl","biggl","Biggl","bigr","Bigr","biggr","Biggr","bigm","Bigm","biggm","Biggm","big","Big","bigg","Bigg"],"{:delim}",{createAtom:a=>{var y;return new i0(Me(Ce({},a),{delim:(y=a.args[0])!=null?y:".",size:sp[a.command].size,delimType:sp[a.command].mclass}))}}),xt(["hspace","hspace*"],"{width:value}",{createAtom:a=>{var y;return new hd(Me(Ce({},a),{width:(y=a.args[0])!=null?y:{dimension:0}}))}}),xt(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:a=>{var y;return new hd(Me(Ce({},a),{width:(y=a.args[0])!=null?y:{dimension:0}}))}}),xt("mathchoice","{:math}{:math}{:math}{:math}",{createAtom:a=>new Pn(a),render:(a,y)=>{let b=0;const E=y.mathstyle.id;(E===sc||E===Ps)&&(b=1),(E===ul||E===io)&&(b=2),(E===Po||E===Ha)&&(b=3);const ee=Ye(a.args[b]);return Pn.createBox(y,ee)},serialize:(a,y)=>`\\mathchoice{${Pn.serialize(a.args[0],y)}}{${Pn.serialize(a.args[1],y)}}{${Pn.serialize(a.args[2],y)}}{${Pn.serialize(a.args[3],y)}}`}),xt("mathop","{:auto}",{createAtom:a=>new Pn(Me(Ce({},a),{type:"mop",body:Ye(a.args[0]),limits:"over-under",isFunction:!0,captureSelection:!0})),render:(a,y)=>{var b;let E=Pn.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 or(a.bind(y,E),{type:"op",isSelected:a.isSelected,classes:"op-group"})},serialize:(a,y)=>{const b=[ra(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)),Si(b)}}),xt(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:a=>new Pn(Me(Ce({},a),{type:{"\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[a.command],body:Ye(a.args[0])}))}),xt(["operatorname","operatorname*"],"{operator:math}",{createAtom:a=>{const y=Ye(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 Pn(Me(Ce({},a),{type:"mop",body:y,isFunction:!0,limits:a.command==="\\operatorname"?"adjacent":"over-under"}))},render:(a,y)=>{var b;let E=Pn.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 or(a.bind(y,E),{type:"op",isSelected:a.isSelected,classes:"op-group"})},serialize:(a,y)=>{const b=[ra(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)),Si(b)}}),xt(["char","unicode"],"{charcode:value}",{createAtom:a=>new Pn(Me(Ce({},a),{type:a.mode==="text"?"text":"mord"})),serialize:a=>{var y;return`${a.command}${Ma((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)}}),xt("rule","[raise:value]{width:value}{thickness:value}",{createAtom:a=>new Pn(a),render:(a,y)=>{var b,E,ee;const re=new Di({parent:y,mathstyle:"textstyle"},a.style),ae=re.toEm((b=a.args[0])!=null?b:{dimension:0}),he=re.toEm((E=a.args[1])!=null?E:{dimension:10}),pe=re.toEm((ee=a.args[2])!=null?ee:{dimension:10}),ve=new or(null,{classes:"rule",type:"ord"});return ve.width=he,ve.height=pe+ae,ve.depth=-ae,ve.setStyle("border-right-width",he,"em"),ve.setStyle("border-top-width",pe,"em"),ve.setStyle("border-color",a.style.color),ve.setStyle("vertical-align",ae,"em"),a.isSelected&&ve.setStyle("opacity","50%"),a.bind(re,ve),a.caret&&(ve.caret=a.caret),ve.wrap(y)},serialize:a=>`\\rule${a.args[0]?`[${Ma(a.args[0])}]`:""}{${Ma(a.args[1])}}{${Ma(a.args[2])}}`}),xt(["overline","underline"],"{:auto}",{createAtom:a=>new Pn(Me(Ce({},a),{body:Ye(a.args[0])})),render:(a,y)=>{const b=a.command.substring(1),E=new Di({parent:y,mathstyle:"cramp"},a.style),ee=Pn.createBox(E,a.body);if(!ee)return null;const re=E.metrics.defaultRuleThickness/E.scalingFactor,ae=new or(null,{classes:b+"-line"});ae.height=re,ae.maxFontSize=re*1.125*E.scalingFactor;let he;return b==="overline"?he=new Yi({shift:0,children:[{box:ee},3*re,{box:ae},re]}):he=new Yi({top:ee.height,children:[re,{box:ae},3*re,{box:ee}]}),a.caret&&(he.caret=a.caret),new or(he,{classes:b,type:"ignore"})}}),xt("overset","{:auto}{base:auto}",{createAtom:a=>{const y=Ye(a.args[1]);return new Jo(Me(Ce({},a),{above:Ye(a.args[0]),body:y,skipBoundary:!1,boxType:El(y)}))},serialize:(a,y)=>ra(a.command,a.aboveToLatex(y),a.bodyToLatex(y))}),xt("underset","{:auto}{base:auto}",{createAtom:a=>{const y=Ye(a.args[1]);return new Jo(Me(Ce({},a),{below:Ye(a.args[0]),body:y,skipBoundary:!1,boxType:El(y)}))},serialize:(a,y)=>ra(a.command,a.belowToLatex(y),a.bodyToLatex(y))}),xt("overunderset","{above:auto}{below:auto}{base:auto}",{createAtom:a=>{const y=Ye(a.args[2]);return new Jo(Me(Ce({},a),{above:Ye(a.args[0]),below:Ye(a.args[1]),body:y,skipBoundary:!1,boxType:El(y)}))},serialize:(a,y)=>ra(a.command,a.belowToLatex(y),a.bodyToLatex(y))}),xt(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:a=>new Jo(Me(Ce({},a),{body:Ye(a.args[2]),above:Ye(a.args[1]),below:Ye(a.args[0]),skipBoundary:!1,boxType:a.command==="\\stackrel"?"rel":"bin"})),serialize:(a,y)=>ra(a.command,a.aboveToLatex(y),a.bodyToLatex(y))}),xt("smash","[:string]{:auto}",{createAtom:a=>{var y,b,E,ee;return new dd(Me(Ce({},a),{body:Ye(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}))}}),xt(["vphantom"],"{:auto}",{createAtom:a=>new dd(Me(Ce({},a),{body:Ye(a.args[0]),isInvisible:!0,smashWidth:!0}))}),xt(["hphantom"],"{:auto}",{createAtom:a=>new dd(Me(Ce({},a),{body:Ye(a.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))}),xt(["phantom"],"{:auto}",{createAtom:a=>new dd(Me(Ce({},a),{body:Ye(a.args[0]),isInvisible:!0}))}),xt("not","{:math}",{createAtom:a=>{const y=Ye(a.args[0]);return y.length===0?new Pn(Me(Ce({},a),{type:"mrel",value:"\uE020"})):new Pn(Me(Ce({},a),{body:[new dc(Me(Ce({},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{${Pn.serialize(b.group,y)}}`:`\\not${Pn.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":El(Ye(a.args[0])),ee=Pn.createBox(y,a.body,{type:E});return a.caret&&(ee.caret=a.caret),a.bind(y,ee)}}),xt(["ne","neq"],"",{createAtom:a=>new Pn(Me(Ce({},a),{type:"mrel",body:[new dc(Me(Ce({},a),{body:"\uE020",align:"right",boxType:"rel"})),new Pn(Me(Ce({},a),{value:"="}))],captureSelection:!0})),serialize:a=>a.command}),xt("rlap","{:auto}",{createAtom:a=>new dc(Me(Ce({},a),{body:Ye(a.args[0]),align:"right"}))}),xt("llap","{:auto}",{createAtom:a=>new dc(Me(Ce({},a),{body:Ye(a.args[0]),align:"left"}))}),xt("mathrlap","{:math}",{createAtom:a=>new dc(Me(Ce({},a),{body:Ye(a.args[0]),align:"left"}))}),xt("mathllap","{:math}",{createAtom:a=>new dc(Me(Ce({},a),{body:Ye(a.args[0]),align:"left"}))}),xt("raisebox","{:value}{:text}",{createAtom:a=>{var y;return new ba(Me(Ce({},a),{body:Ye(a.args[1]),padding:{dimension:0},offset:(y=a.args[0])!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b;return ra("\\raisebox",(b=Ma(a.offset))!=null?b:"0pt",a.bodyToLatex(y))}}),xt("raise","{:value}{:auto}",{createAtom:a=>{var y;return new ba(Me(Ce({},a),{body:Ye(a.args[1]),padding:{dimension:0},offset:(y=a.args[0])!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b;return ra("\\raise",(b=Ma(a.offset))!=null?b:"0pt",a.bodyToLatex(y))}}),xt("lower","{:value}{:auto}",{createAtom:a=>{var y;return new ba(Me(Ce({},a),{body:Ye(a.args[1]),padding:{dimension:0},offset:(y=Xo(a.args[0],-1))!=null?y:{dimension:0}}))},serialize:(a,y)=>{var b,E;return ra("\\lower",(E=Ma(Xo((b=a.offset)!=null?b:{dimension:0},-1)))!=null?E:"0pt",a.bodyToLatex(y))}}),Ie("0123456789/@.?!"),it(65,90),it(97,122),Ie([["\\forall",8704],["\\exists",8707],["\\nexists",8708,"mord","ams"],["\\mid",8739,"mrel"],["\\top",8868],["\\bot",8869]]),Ie([["\\#",35],["\\&",38],["\\parallelogram",9649],["\\spadesuit",9824],["\\heartsuit",9825],["\\diamondsuit",9826],["\\clubsuit",9827],["\\flat",9837],["\\natural",9838],["\\sharp",9839]]),Ie([["\\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]]),Ie([["\\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"),Ie([["\\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"]]),Ie([["\\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"]]),Ie([["\\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"),Ie([["+",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"),Ie([["\\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"),Ie([["\\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]]),Ie([["=",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"),Ie([["\\lnot",172],["\\neg",172],["\\triangle",9651],["\\subsetneq",8842],["\\varsubsetneq",57370],["\\subsetneqq",10955],["\\varsubsetneqq",57367],["\\nsubset",8836],["\\nsupset",8837],["\\nsubseteq",8840],["\\nsupseteq",8841]],"mrel","ams"),Ie([["\\wp",8472],["\\aleph",8501]]),Ie([["\\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"),Ie([["\\ ",160],["~",160]],"space"),xt(["!",",",":",";",">","enskip","enspace","quad","qquad"],"",{createAtom:a=>new hd(a)}),xt("space","",{createAtom:a=>new hd(a)}),Ie([["\\colon",58],["\\cdotp",8901],["\\vdots",8942,"mord"],["\\ldotp",46],[",",44],[";",59]],"mpunct"),Ie([["\\cdots",8943],["\\ddots",8945],["\\ldots",8230],["\\mathellipsis",8230]],"minner"),Ie([["\\/",47],["|",8739,"mord"],["\\imath",305],["\\jmath",567],["\\degree",176],["'",8242],['"',8221]]);var lp="<mo>⁡</mo>",Gh="<mo>⁢</mo>";function Xh(a){return a.replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function Qi(a,y){return!a||!y.generateID?"":` extid="${a}"`}function Mv(a,y,b){var E,ee,re,ae,he,pe,ve,we,Re,Je,vt;let kt=!1;y=y!=null?y:a.atoms.length;let xn="",ir="",yn=a.atoms[a.index];const Nn=(ee=(E=yn.style)==null?void 0:E.variant)!=null?ee:"",dr=(ae=(re=yn.style)==null?void 0:re.variantStyle)!=null?ae:"";let Kn="";if(Nn||dr){const qr=nn(yn.value,(he=yn.style)==null?void 0:he.variant,(pe=yn.style)==null?void 0:pe.variantStyle);if(qr!==yn.value)return a.index+=1,xn=`<mi${Qi(yn.id,b)}>${qr}</mi>`,ml(xn,a,b)||(a.mathML+=xn,a.lastType="mi"),!0;Kn=(ve={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"}[dr+Nn])!=null?ve:"",Kn=` mathvariant="${Kn}"`}const Zr={"\\exponentialE":"ⅇ","\\imaginaryI":"ⅈ","\\differentialD":"ⅆ","\\capitalDifferentialD":"ⅅ","\\alpha":"α","\\pi":"π","\\infty":"∞","\\forall":"∀","\\nexists":"∄","\\exists":"∃","\\hbar":"\u210F","\\cdotp":"\u22C5","\\ldots":"\u2026","\\cdots":"\u22EF","\\ddots":"\u22F1","\\vdots":"\u22EE","\\ldotp":"."};if(yn.command==="!")return a.index+=1,xn="<mo>!</mo>",ml(xn,a,b)||(a.mathML+=xn,a.lastType="mo"),!0;if(Zr[yn.command]){a.index+=1;let qr=`<mi${Qi(yn.id,b)}${Kn}>${Zr[yn.command]}</mi>`;return(a.lastType==="mi"||a.lastType==="mn"||a.lastType==="mtext"||a.lastType==="fence")&&(qr=Gh+qr),ml(qr,a,b)||(a.mathML+=qr,a.lastType="mi"),!0}if(yn.command==="\\operatorname")ir=vu(yn.body),a.index+=1;else if(Nn||dr)for(;a.index<y&&(yn.type==="mord"||yn.type==="macro")&&!yn.isDigit()&&Nn===((Re=(we=yn.style)==null?void 0:we.variant)!=null?Re:"")&&dr===((vt=(Je=yn.style)==null?void 0:Je.variantStyle)!=null?vt:"");)ir+=vu([yn]),a.index+=1,yn=a.atoms[a.index];else(yn.type==="mord"||yn.type==="macro")&&!yn.isDigit()&&(ir+=vu([yn]),a.index+=1);if(ir.length>0){kt=!0,xn=`<mi${Kn}>${ir}</mi>`;const qr=a.lastType;xn.endsWith(">f</mi>")||xn.endsWith(">g</mi>")?(xn+=lp,a.lastType="applyfunction"):a.lastType=/^<mo>(.*)<\/mo>$/.test(xn)?"mo":"mi",ml(xn,a,b)||((qr==="mi"||qr==="mn"||qr==="mtext"||qr==="fence")&&(xn=Gh+xn),a.mathML+=xn)}return kt}function kv(a){return a.index<a.atoms.length&&a.atoms[a.index].superscript&&a.atoms[a.index].type==="subsup"}function _v(a){let y=-1,b=a.index,E=!1,ee=!1;for(;b<a.atoms.length&&!E&&!ee;){const re=a.atoms[b];E=!re.isDigit(),ee=!E&&re.superscript!==void 0,b++}return ee&&(y=b-1),y}function ml(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=Ri(ee.superscript,b);y.lastType="";const he=Ri(ee.subscript,b);if(y.lastType=re,!ae&&!he)return!1;let pe="";return ae&&he?pe=`<msubsup>${a}${he}${ae}</msubsup>`:ae?pe=`<msup>${a}${ae}</msup>`:he&&(pe=`<msub>${a}${he}</msub>`),y.mathML+=pe,y.lastType="",!0}function Ev(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 ${Qi(a.atoms[E].id,b)}>${ee}</mtext>`,a.lastType="mtext",!0):!1}function Lv(a,y,b){y=y!=null?y:a.atoms.length;const E=a.index;let ee="",re=_v(a);for(re>=0&&re<y&&(y=re);a.index<y&&a.atoms[a.index].isDigit();)ee+=a.atoms[a.index].asDigit(),a.index+=1;return ee.length<=0?!1:(ee="<mn"+Qi(a.atoms[E].id,b)+">"+ee+"</mn>",re<0&&kv(a)&&(re=a.index,a.index+=1),ml(ee,a,b)||(a.mathML+=ee,a.lastType="mn"),!0)}function Dv(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,he=0;const pe=a.index;let ve=-1,we=pe+1;for(;we<y&&!ae;)a.atoms[we].type==="mopen"?he+=1:a.atoms[we].type==="mclose"&&(he-=1),he===-1&&(ae=!0,ve=we),we+=1;ae&&(ee="<mrow>",ee+=Sc(a.atoms[pe],b),ee+=Ri(a.atoms,b,pe+1,ve),ee+=Sc(a.atoms[ve],b),ee+="</mrow>",a.index=ve+1,(a.lastType==="mi"||a.lastType==="mn"||a.lastType==="mfrac"||a.lastType==="fence")&&(a.mathML+=Gh),ml(ee,a,b)&&(E=!0,a.lastType="",ee=""),re="fence")}return ee.length>0&&(E=!0,a.mathML+=ee,a.lastType=re),E}function Av(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 he={"\\ne":"≠","\\neq":"&neq;","\\pm":"±","\\times":"×","\\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(he[ae.command]){a.index+=1;const pe=`<mo${Qi(ae.id,b)}>${he[ae.command]}</mo>`;return ml(pe,a,b)||(a.mathML+=pe,a.lastType="mo"),!0}if(a.index<y&&(ae.type==="mbin"||ae.type==="mrel"))ee+=Wf(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 pe=Sc(ae,b);return ae.superscript&&ae.subscript?(ee+="<munderover>"+pe,ee+=Ri(ae.subscript,b),ee+=Ri(ae.superscript,b),ee+="</munderover>"):ae.superscript?(ee+="<mover>"+pe,ee+=Ri(ae.superscript,b),ee+="</mover>"):ae.subscript&&(ee+="<munder>"+pe,ee+=Ri(ae.subscript,b),ee+="</munder>"),a.mathML+=ee,a.lastType="mo",a.index+=1,!0}{const pe=a.atoms[a.index],ve=pe.value==="\\operatorname",we=ve?'<mi class="MathML-Unit"'+Qi(pe.id,b)+">"+vu(pe.value)+"</mi>":Sc(pe,b);ee+=we,!ve&&!/^<mo>(.*)<\/mo>$/.test(we)?(ee+=lp,re="applyfunction"):re=ve?"mi":"mo"}(a.lastType==="mi"||a.lastType==="mn")&&!/^<mo>(.*)<\/mo>$/.test(ee)&&(ee=Gh+ee),a.index+=1}return ee.length>0&&(E=!0,ml(ee,a,b)||(a.mathML+=ee,a.lastType=re)),E}function Ri(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 Pn)ee.mathML=Wf(a,y);else if(Array.isArray(a)){ee.atoms=a;let re=0;for(E=E||(a?a.length:0);ee.index<E;)if(Ev(ee,E,y)||Lv(ee,E,y)||Mv(ee,E,y)||Av(ee,E,y)||Dv(ee,E,y))re+=1;else if(ee.index<E){let ae=Wf(ee.atoms[ee.index],y);ee.lastType==="mn"&&ae.length>0&&ee.atoms[ee.index].type==="genfrac"&&(ae="<mo>⁤</mo>"+ae),ee.atoms[ee.index].type==="genfrac"?ee.lastType="mfrac":ee.lastType="",ee.index+=1,ml(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 Sc(a,y){let b="";const E=vu(a.value);return E&&(b="<mo"+Qi(a.id,y)+">"+E+"</mo>"),b}function vu(a){if(!a)return"";if(typeof a=="string")return Xh(a);if(!Array.isArray(a)&&typeof a.body=="string")return Xh(a.body);let y="";for(const b of a)typeof b.value=="string"&&(y+=b.value);return Xh(y)}function Wf(a,y){var b,E,ee,re,ae,he,pe,ve,we,Re,Je,vt,kt,xn,ir,yn,Nn,dr,Kn,Zr,qr,Vr;if(a.mode==="text")return`<mi${Qi(a.id,y)}>${a.value}</mi>`;const Ti={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"},Ui={"\\!":-3/18,"\\ ":6/18,"\\,":3/18,"\\:":4/18,"\\>":4/18,"\\;":5/18,"\\enspace":.5,"\\quad":1,"\\qquad":2,"\\enskip":.5};let xr="",Wo="",js,Qo,Ua,Zo,ko,ea;const{command:wa}=a;if(a.command==="\\error")return`<merror${Qi(a.id,y)}>${Ri(a.body,y)}</merror>`;const Ga={"\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\lbrack":"[","\\rbrack":"]","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"},Vs={"\\vec":"⃗","\\acute":"´","\\grave":"`","\\dot":"˙","\\ddot":"¨","\\tilde":"~","\\bar":"¯","\\breve":"˘","\\check":"ˇ","\\hat":"^"};switch(a.type){case"first":break;case"group":case"root":xr=Ri(a.body,y);break;case"array":if((a.leftDelim&&a.leftDelim!=="."||a.rightDelim&&a.rightDelim!==".")&&(xr+="<mrow>",a.leftDelim&&a.leftDelim!=="."&&(xr+="<mo>"+(Ga[a.leftDelim]||a.leftDelim)+"</mo>")),xr+="<mtable",a.colFormat){for(xr+=' columnalign="',Ua=0;Ua<a.colFormat.length;Ua++)a.colFormat[Ua].align&&(xr+={l:"left",c:"center",r:"right"}[a.colFormat[Ua].align]+" ");xr+='"'}for(xr+=">",Qo=0;Qo<a.array.length;Qo++){for(xr+="<mtr>",js=0;js<a.array[Qo].length;js++)xr+="<mtd>"+Ri(a.array[Qo][js],y)+"</mtd>";xr+="</mtr>"}xr+="</mtable>",(a.leftDelim&&a.leftDelim!=="."||a.rightDelim&&a.rightDelim!==".")&&(a.rightDelim&&a.rightDelim!=="."&&(xr+="<mo>"+(Ga[a.leftDelim]||a.rightDelim)+"</mo>"),xr+="</mrow>");break;case"genfrac":(a.leftDelim||a.rightDelim)&&(xr+="<mrow>"),a.leftDelim&&a.leftDelim!=="."&&(xr+="<mo"+Qi(a.id,y)+">"+(Ga[a.leftDelim]||a.leftDelim)+"</mo>"),a.hasBarLine?(xr+="<mfrac>",xr+=Ri(a.above,y)||"<mi> </mi>",xr+=Ri(a.below,y)||"<mi> </mi>",xr+="</mfrac>"):(xr+="<mtable"+Qi(a.id,y)+">",xr+="<mtr>"+Ri(a.above,y)+"</mtr>",xr+="<mtr>"+Ri(a.below,y)+"</mtr>",xr+="</mtable>"),a.rightDelim&&a.rightDelim!=="."&&(xr+="<mo"+Qi(a.id,y)+">"+(Ga[a.rightDelim]||a.rightDelim)+"</mo>"),(a.leftDelim||a.rightDelim)&&(xr+="</mrow>");break;case"surd":a.hasEmptyBranch("above")?(xr+="<msqrt"+Qi(a.id,y)+">",xr+=Ri(a.body,y),xr+="</msqrt>"):(xr+="<mroot"+Qi(a.id,y)+">",xr+=Ri(a.body,y),xr+=Ri(a.above,y),xr+="</mroot>");break;case"leftright":const Us=a,Gs=Us.leftDelim;xr="<mrow>",Gs&&Gs!=="."&&(xr+=`<mo${Qi(a.id,y)}>${(b=Ga[Gs])!=null?b:Gs}</mo>`),a.body&&(xr+=Ri(a.body,y));const Xs=Us.matchingRightDelim();Xs&&Xs!=="."&&(xr+=`<mo${Qi(a.id,y)}>${(E=Ga[Xs])!=null?E:Xs}</mo>`),xr+="</mrow>";break;case"sizeddelim":case"delim":xr+=`<mo${Qi(a.id,y)}>${Ga[a.value]||a.value}</mo>`;break;case"accent":xr+='<mover accent="true"'+Qi(a.id,y)+">",xr+=Ri(a.body,y),xr+="<mo>"+(Vs[wa]||a.accent)+"</mo>",xr+="</mover>";break;case"line":case"overlap":break;case"overunder":ko=a.above,Zo=a.below,(a.svgAbove||ko)&&(a.svgBelow||Zo)?ea=a.body:ko&&ko.length>0?(ea=a.body,(re=(ee=a.body)==null?void 0:ee[0])!=null&&re.below?(Zo=a.body[0].below,ea=a.body[0].body):((he=(ae=a.body)==null?void 0:ae[0])==null?void 0:he.type)==="first"&&((ve=(pe=a.body)==null?void 0:pe[1])!=null&&ve.below)&&(Zo=a.body[1].below,ea=a.body[1].body)):Zo&&Zo.length>0&&(ea=a.body,(Re=(we=a.body)==null?void 0:we[0])!=null&&Re.above?(ko=a.body[0].above,ea=a.body[0].body):((vt=(Je=a.body)==null?void 0:Je[0])==null?void 0:vt.type)==="first"&&((xn=(kt=a.body)==null?void 0:kt[1])!=null&&xn.above)&&(ko=a.body[1].overscript,ea=a.body[1].body)),(a.svgAbove||ko)&&(a.svgBelow||Zo)?(xr+=`<munderover ${Qi(a.id,y)}>`,xr+=(ir=Ti[a.svgBody])!=null?ir:Ri(ea,y),xr+=(yn=Ti[a.svgBelow])!=null?yn:Ri(Zo,y),xr+=(Nn=Ti[a.svgAbove])!=null?Nn:Ri(ko,y),xr+="</munderover>"):a.svgAbove||ko?(xr+=`<mover ${Qi(a.id,y)}>`+((dr=Ti[a.svgBody])!=null?dr:Ri(ea,y)),xr+=(Kn=Ti[a.svgAbove])!=null?Kn:Ri(ko,y),xr+="</mover>"):(a.svgBelow||Zo)&&(xr+=`<munder ${Qi(a.id,y)}>`+((Zr=Ti[a.svgBody])!=null?Zr:Ri(ea,y)),xr+=(qr=Ti[a.svgBelow])!=null?qr:Ri(Zo,y),xr+="</munder>");break;case"placeholder":xr+="?";break;case"mord":{xr=typeof a.value=="string"?a.value:wa,wa==="\\char"?xr="&#x"+("000000"+a.args[0].number.toString(16)).slice(-4)+";":xr.length>0&&xr.startsWith("\\")&&(typeof a.value=="string"&&a.value.charCodeAt(0)>255?xr="&#x"+("000000"+a.value.charCodeAt(0).toString(16)).slice(-4)+";":typeof a.value=="string"?xr=a.value.charAt(0):(console.error("Did not expect this"),xr=""));const ws=/\d/.test(xr)?"mn":"mi";xr=`<${ws}${Qi(a.id,y)}>${Xh(xr)}</${ws}>`;break}case"mbin":case"mrel":case"minner":xr=Sc(a,y);break;case"mpunct":xr='<mo separator="true"'+Qi(a.id,y)+">"+wa+"</mo>";break;case"mop":case"operator":case"extensible-symbol":a.body!=="\u200B"&&(xr="<mo"+Qi(a.id,y)+">",xr+=wa==="\\operatorname"?a.body:wa||a.body,xr+="</mo>");break;case"box":xr='<menclose notation="box"',a.backgroundcolor&&(xr+=' mathbackground="'+a.backgroundcolor+'"'),xr+=Qi(a.id,y)+">"+Ri(a.body,y)+"</menclose>";break;case"spacing":xr+='<mspace width="'+((Vr=Ui[wa])!=null?Vr:0)+'em"/>';break;case"enclose":xr='<menclose notation="';for(const ws in a.notation)Object.prototype.hasOwnProperty.call(a.notation,ws)&&a.notation[ws]&&(xr+=Wo+ws,Wo=" ");xr+=Qi(a.id,y)+'">'+Ri(a.body,y)+"</menclose>";break;case"prompt":xr='<menclose notation="roundexbox""">'+Ri(a.body,y)+"</menclose>";break;case"space":xr+=" ";break;case"subsup":break;case"phantom":break;case"composition":break;case"rule":break;case"chem":break;case"mopen":xr+=Sc(a,y);break;case"mclose":xr+=Sc(a,y);break;case"macro":{const ws=a.command+vu(a.macroArgs);ws&&(xr+=`<mo ${Qi(a.id,y)}>${ws}</mo>`)}break;case"latexgroup":xr+=Ri(a.body,y);break;case"latex":xr+="<mtext"+Qi(a.id,y)+">"+a.value+"</mtext>";break;case"tooltip":xr+=Ri(a.body,y);break;case"text":xr+=`<mtext ${Qi(a.id,y)}x>${a.value}</mtext>`;break;default:if(a.command==="\\displaystyle")return`<mrow ${Qi(a.id,y)} displaystyle="true">${Ri(a.body,y)}</mrow>`;if(a.command==="\\textstyle")return`<mrow ${Qi(a.id,y)} displaystyle="false">${Ri(a.body,y)}</mrow>`;console.info("Unexpected element in conversion to MathML:",a)}return xr}var yu={"\\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"},Zf={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 Tv(a){let y="";return a.startsWith("\\")&&(y=" "+a.replace("\\","")+" "),y}function Ed(a){let y=0;if(Le(a))for(const b of a)b.type!=="first"&&(y+=1);return y===1}function Iv(a){if(Le(a)){for(const y of a)if(y.type!=="first"&&y.id)return y.id.toString()}return""}function cp(a){let y="";if(Le(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 Li(a,y){var b,E,ee,re,ae;function he(we){return window.MathfieldElement.textToSpeechMarkup?/[a-z]/.test(we)?` <say-as interpret-as="character">${we}</say-as>`:/[A-Z]/.test(we)?`capital <say-as interpret-as="character">${we.toLowerCase()}</say-as>`:we:/[a-z]/.test(we)?" '"+we.toUpperCase()+"'":/[A-Z]/.test(we)?" 'capital "+we.toUpperCase()+"'":we}function pe(we){return"<emphasis>"+we+"</emphasis>"}if(!y)return"";let ve="";if(Le(y)){let we=!1,Re=!1;for(let Je=0;Je<y.length;Je++)y[Je].type!=="first"&&(y[Je].mode!=="text"&&(Re=!1),Je<y.length-2&&y[Je].type==="mopen"&&y[Je+2].type==="mclose"&&y[Je+1].type==="mord"?(ve+=" of ",ve+=pe(Li(a,y[Je+1])),Je+=2):y[Je].mode==="text"?Re?ve+=(b=y[Je].value)!=null?b:" ":(Re=!0,ve+=Li("text",y[Je])):y[Je].isDigit()?we?ve+=y[Je].asDigit():(we=!0,ve+=Li(a,y[Je])):(we=!1,ve+=Li(a,y[Je])))}else if(y.mode==="text")y.id&&a==="math"&&(ve+='<mark name="'+y.id.toString()+'"/>'),ve+=y.value;else{y.id&&a==="math"&&(ve+='<mark name="'+y.id.toString()+'"/>');let we="",Re="",Je="",vt=!1;const{command:kt}=y;switch(kt){case"\\vec":return"vector "+Li(a,y.body);case"\\acute":return Li(a,y.body)+" acute";case"\\grave":return Li(a,y.body)+" grave";case"\\dot":return"dot over"+Li(a,y.body);case"\\ddot":return"double dot over"+Li(a,y.body);case"\\mathring":return"ring over"+Li(a,y.body);case"\\tilde":case"\\widetilde":return"tilde over"+Li(a,y.body);case"\\bar":return Li(a,y.body)+" bar";case"\\breve":return Li(a,y.body)+" breve";case"\\check":case"\\widecheck":return"check over "+Li(a,y.body);case"\\hat":case"\\widehat":return"hat over"+Li(a,y.body);case"\\overarc":case"\\overparen":case"\\wideparen":return"arc over "+Li(a,y.body);case"\\underarc":case"\\underparen":return"arc under "+Li(a,y.body)}switch(y.type){case"prompt":const xn=y.body.length>1?'start input . <break time="500ms"/> '+Li(a,y.body)+'. <break time="500ms"/> end input':"blank";ve+=' <break time="300ms"/> '+xn+'. <break time="700ms"/>'+((E=y.correctness)!=null?E:"")+' . <break time="700ms"/> ';break;case"array":const ir=y.array,yn=y.environmentName;if(Object.keys(Zf).includes(yn)){ve+=` begin ${Zf[yn]} `;for(let Kn=0;Kn<ir.length;Kn++){Kn>0&&(ve+=","),ve+=` row ${Kn+1} `;for(let Zr=0;Zr<ir[Kn].length;Zr++)Zr>0&&(ve+=","),ve+=` column ${Zr+1}: `,ve+=Li("math",ir[Kn][Zr])}ve+=` end ${Zf[yn]} `}break;case"group":kt==="\\ne"?ve+=" not equal ":(kt==="\\not"&&(ve+=" not "),ve+=Li("math",y.body));break;case"root":ve+=Li("math",y.body);break;case"genfrac":if(we=Li("math",y.above),Re=Li("math",y.below),Ed(y.above)&&Ed(y.below)){const Zr={"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)];Zr?ve=Zr:ve+=we+" over "+Re}else ve+=' the fraction <break time="150ms"/>'+we+' over <break time="150ms"/>'+Re+'.<break time="150ms"/> End fraction.<break time="150ms"/>';break;case"surd":if(Je=Li("math",y.body),y.hasEmptyBranch("above"))ve+=Ed(y.body)?" the square root of "+Je+" , ":' the square root of <break time="200ms"/>'+Je+'. <break time="200ms"/> End square root';else{let Kn=Li("math",y.above);Kn=Kn.trim();const Zr=Kn.replace(/<mark([^/]*)\/>/g,"");Zr==="3"?ve+=' the cube root of <break time="200ms"/>'+Je+'. <break time="200ms"/> End cube root':Zr==="n"?ve+=' the nth root of <break time="200ms"/>'+Je+'. <break time="200ms"/> End root':ve+=' the root with index: <break time="200ms"/>'+Kn+', of <break time="200ms"/>'+Je+'. <break time="200ms"/> End root'}break;case"leftright":{const Kn=y;ve+=(ee=Kn.leftDelim?yu[Kn.leftDelim]:void 0)!=null?ee:Kn.leftDelim,ve+=Li("math",y.body),ve+=(re=Kn.rightDelim?yu[Kn.rightDelim]:void 0)!=null?re:Kn.rightDelim}break;case"rule":break;case"overunder":break;case"overlap":break;case"macro":const Nn=kt.replace(/^\\/g,""),dr=On()[Nn];dr&&(dr!=null&&dr.expand?ve+=Li("math",y.body):ve+=`${Nn} `);break;case"placeholder":ve+="placeholder ";break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":{if(kt==="\\mathbin"||kt==="\\mathrel"||kt==="\\mathopen"||kt==="\\mathclose"||kt==="\\mathpunct"||kt==="\\mathord"||kt==="\\mathinner"){ve=Li(a,y.body);break}let Kn=y.isDigit()?y.asDigit():y.value,Zr=y.command;if((y.type==="delim"||y.type==="sizeddelim")&&(Zr=y.value,Kn=Zr),a==="text")ve+=Kn;else{if(y.type==="mbin"&&(ve+='<break time="150ms"/>'),Kn){const qr=yu[Kn]||(Zr?yu[Zr.trim()]:"");if(qr)ve+=" "+qr;else{const Vr=Zr?Tv(Zr.trim()):"";ve+=Vr||he(Kn)}}else ve+=Li("math",y.body);y.type==="mbin"&&(ve+='<break time="150ms"/>')}break}case"mop":case"operator":case"extensible-symbol":if(y.value!=="\u200B"){const Kn=y.command;if(Kn==="\\sum")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let Zr=Li("math",y.superscript);Zr=Zr.trim();let qr=Li("math",y.subscript);qr=qr.trim(),ve+=' the summation from <break time="200ms"/>'+qr+'<break time="200ms"/> to <break time="200ms"/>'+Zr+'<break time="200ms"/> of <break time="150ms"/>',vt=!0}else if(y.hasEmptyBranch("subscript"))ve+=" the summation of";else{let Zr=Li("math",y.subscript);Zr=Zr.trim(),ve+=' the summation from <break time="200ms"/>'+Zr+'<break time="200ms"/> of <break time="150ms"/>',vt=!0}else if(Kn==="\\prod")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let Zr=Li("math",y.superscript);Zr=Zr.trim();let qr=Li("math",y.subscript);qr=qr.trim(),ve+=' the product from <break time="200ms"/>'+qr+'<break time="200ms"/> to <break time="200ms"/>'+Zr+'<break time="200ms"/> of <break time="150ms"/>',vt=!0}else if(y.hasEmptyBranch("subscript"))ve+=" the product of ";else{let Zr=Li("math",y.subscript);Zr=Zr.trim(),ve+=' the product from <break time="200ms"/>'+Zr+'<break time="200ms"/> of <break time="150ms"/>',vt=!0}else if(Kn==="\\int")if(!y.hasEmptyBranch("superscript")&&!y.hasEmptyBranch("subscript")){let Zr=Li("math",y.superscript);Zr=Zr.trim();let qr=Li("math",y.subscript);qr=qr.trim(),ve+=' the integral from <break time="200ms"/>'+pe(qr)+'<break time="200ms"/> to <break time="200ms"/>'+pe(Zr)+' <break time="200ms"/> of ',vt=!0}else ve+=' the integral of <break time="200ms"/> ';else if(typeof y.value=="string"){const Zr=(ae=yu[y.value])!=null?ae:y.command?yu[y.command]:void 0;ve+=Zr||" "+y.value}else y.command&&(y.command==="\\mathop"?ve+=Li("math",y.body):y.command==="\\operatorname"?ve+=Pv(y.body):ve+=y.command.startsWith("\\")?" "+y.command.slice(1):" "+y.command)}break;case"enclose":Je=Li("math",y.body),ve+=" crossed out "+Je+". End crossed out.";break;case"space":case"spacing":break}if(!vt&&!y.hasEmptyBranch("superscript")){let xn=Li(a,y.superscript);xn=xn.trim();const ir=xn.replace(/<[^>]*>/g,"");if(Ed(y.superscript)){if(a==="math"){const yn=Iv(y.superscript);yn&&(ve+='<mark name="'+yn+'"/>')}ir==="\u2032"?ve+=" prime ":ir==="2"?ve+=" squared ":ir==="3"?ve+=" cubed ":Number.isNaN(Number.parseInt(ir))?ve+=" to the "+xn+"; ":ve+=' to the <say-as interpret-as="ordinal">'+ir+"</say-as> power; "}else Number.isNaN(Number.parseInt(ir))?ve+=" raised to the "+xn+"; ":ve+=' raised to the <say-as interpret-as="ordinal">'+ir+"</say-as> power; "}if(!vt&&!y.hasEmptyBranch("subscript")){let xn=Li("math",y.subscript);xn=xn.trim(),ve+=Ed(y.subscript)?" sub "+xn:" subscript "+xn+". End subscript. "}}return ve}function bu(a){var y,b;if(window.MathfieldElement.textToSpeechRules==="sre"&&("sre"in window||"SRE"in window)){const ee=Ri(a);if(ee){window.MathfieldElement.textToSpeechMarkup&&(window.MathfieldElement.textToSpeechRulesOptions=(y=window.MathfieldElement.textToSpeechRulesOptions)!=null?y:{},window.MathfieldElement.textToSpeechRulesOptions=Me(Ce({},window.MathfieldElement.textToSpeechRulesOptions),{markup:window.MathfieldElement.textToSpeechMarkup}),window.MathfieldElement.textToSpeechRulesOptions.markup==="ssml"&&(window.MathfieldElement.textToSpeechRulesOptions=Me(Ce({},window.MathfieldElement.textToSpeechRulesOptions),{markup:"ssml_step"})),window.MathfieldElement.textToSpeechRulesOptions=Me(Ce({},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(he){console.error("MathLive 0.98.5: `SRE.toSpeech()` runtime error",he)}return ae}return""}let E=Li("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"&&at()==="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 Ld={"\\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"},Dd={"\\pm":"+-","\\colon":":","\\vert":"|","\\Vert":"||","\\mid":"|","\\lbrack":"[","\\rbrack":"]","\\lbrace":"{","\\rbrace":"}","\\lparen":"(","\\rparen":")","\\langle":"(:","\\rangle":":)","\\sum":" sum ","\\prod":" prod ","\\bigcap":" nnn ","\\bigcup":" uuu ","\\int":" int ","\\oint":" oint ","\\ge":">=","\\le":"<=","\\ne":"!=","\\neq":"!=","\\lt":"<","\\gt":">","\\gets":"<-","\\to":"->","\\land":" and ","\\lor":" or ","\\lnot":" not ","\\forall":" AA ","\\exists":" EE ","\\in":" in ","\\notin":" !in ","\\mapsto":"|->","\\implies":"=>","\\iff":"<=>","\\cdot":"*","\\ast":"**","\\star":"***","\\times":"xx","\\div":"-:","\\ltimes":"|><","\\rtimes":"><|","\\bowtie":"|><|","\\circ":"@"};function Bv(a){let y="";for(const b of a){const E=y[y.length-1];E!==void 0&&/\d/.test(E)&&/^\d/.test(b)&&(y+=" "),y+=b}return y}function xa(a){var y,b,E,ee,re,ae,he,pe,ve,we,Re,Je,vt;if(!a)return"";if(Le(a)){if(a.length===0)return"";if(a[0].mode==="latex")return a.map(xa).join("");if(a[0].mode==="text"){let dr=0,Kn="";for(;((y=a[dr])==null?void 0:y.mode)==="text";)Kn+=a[dr].body?xa(a[dr].body):a[dr].value,dr++;return`"${Kn}" ${xa(a.slice(dr))}`}let yn=0;const Nn=[];for(;a[yn]&&a[yn].mode==="math";){let dr="";for(;a[yn]&&a[yn].type==="mord"&&/\d/.test(a[yn].value);)dr+=a[yn++].value;dr?Nn.push(dr):Nn.push(xa(a[yn++]))}return Nn.push(xa(a.slice(yn))),Bv(Nn)}if(a.mode==="text")return`"${a.value}"`;let kt="";const{command:xn}=a;let ir;if(xn==="\\placeholder")return`(${xa(a.body)})`;switch(a.type){case"accent":const yn={"\\vec":"vec","\\dot":"dot","\\ddot":"ddot","\\bar":"bar","\\hat":"hat","\\acute":"acute;","\\grave":"grave","\\tilde":"tilde","\\breve":"breave","\\check":"check"}[xn];kt=`${yn!=null?yn:""} ${xa(a.body)} `;break;case"first":return"";case"latexgroup":return a.body.map(Vr=>Vr.value).join("");case"group":case"root":kt=(b=Ld[xn])!=null?b:xa(a.body);break;case"genfrac":{const Vr=a;(Vr.leftDelim||Vr.rightDelim)&&(kt=Vr.leftDelim==="."||!Vr.leftDelim?"{:":Vr.leftDelim),Vr.hasBarLine?(kt+="(",kt+=xa(Vr.above),kt+=")/(",kt+=xa(Vr.below),kt+=")"):(kt+="("+xa(Vr.above)+"),",kt+="("+xa(Vr.below)+")"),(Vr.leftDelim||Vr.rightDelim)&&(kt+=Vr.rightDelim==="."||!Vr.rightDelim?"{:":Vr.rightDelim)}break;case"surd":kt+=a.hasEmptyBranch("above")?"sqrt("+xa(a.body)+")":"root("+xa(a.above)+")("+xa(a.body)+")";break;case"latex":kt=a.value;break;case"leftright":{const Vr=a,Ti=Vr.leftDelim;kt+=Ti==="."||!Ti?"{:":Ti,kt+=xa(Vr.body);const Ui=Vr.matchingRightDelim();kt+=Ui==="."||!Ui?":}":Ui}break;case"sizeddelim":case"delim":kt=a.value;break;case"overlap":break;case"overunder":break;case"mord":kt=(ee=(E=Ld[xn])!=null?E:xn)!=null?ee:typeof a.value=="string"?a.value:"",kt.startsWith("\\")&&(kt+=" "),ir=xn?xn.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,ir?kt=String.fromCodePoint(Number.parseInt("0x"+ir[1])):kt.length>0&&kt.startsWith("\\")&&(kt=typeof a.value=="string"?a.value.charAt(0):a.command),kt=Ov(kt,a.style);break;case"mbin":case"mrel":case"minner":kt=(ae=(re=Ld[xn])!=null?re:Dd[xn])!=null?ae:a.value;break;case"mopen":case"mclose":kt=a.value;break;case"mpunct":kt=(he=Dd[xn])!=null?he:xn;break;case"mop":case"operator":case"extensible-symbol":a.value!=="\u200B"&&(Dd[xn]?kt=Dd[xn]:kt=xn==="\\operatorname"?xa(a.body):(pe=a.value)!=null?pe:xn,kt+=" ");break;case"array":const Nn=a.array,dr=a.environmentName,Kn=(ve={bmatrix:["[","]"],"bmatrix*":["[","]"]}[dr])!=null?ve:["(",")"],Zr=[];for(const Vr of Nn){const Ti=[];for(const Ui of Vr)Ti.push(Kn[0]+xa(Ui)+Kn[1]);Zr.push(Ti.join(","))}const qr=(we={bmatrix:["[","]"],"bmatrix*":["[","]"],cases:["{",":}"]}[dr])!=null?we:["(",")"];kt=qr[0]+Zr.join(",")+qr[1];break;case"box":break;case"spacing":kt=(Re=Ld[xn])!=null?Re:" ";break;case"enclose":kt="("+xa(a.body)+")";break;case"space":kt=" ";break;case"subsup":kt="";break;case"macro":kt=(vt=(Je=Ld[xn])!=null?Je:Dd[xn])!=null?vt:xa(a.body);break}if(!a.hasEmptyBranch("subscript")){kt+="_";const yn=xa(a.subscript);kt+=yn.length!==1?`(${yn})`:yn}if(!a.hasEmptyBranch("superscript")){kt+="^";const yn=xa(a.superscript);kt+=yn.length!==1?`(${yn})`:yn}return kt}function Ov(a,y){if(!y)return a;let b=a;return y.variant==="double-struck"&&(b=`bbb "${b}"`),y.variant==="script"&&(b=`cc "${b}"`),y.variant==="fraktur"&&(b=`fr "${b}"`),y.variant==="sans-serif"&&(b=`sf "${b}"`),y.variant==="monospace"&&(b=`tt "${b}"`),y.variantStyle==="bold"&&(b=`bb "${b}"`),y.color?`color({${y.color}})(${b})`:b}function Va(a,y){var b,E;y!=null||(y={}),y.mathstyle=(b=y.mathstyle)!=null?b:"displaystyle";const ee=new Di({from:Me(Ce({},Qc()),{renderPlaceholder:()=>new or(160,{maxFontSize:1}),letterShapeStyle:(E=y==null?void 0:y.letterShapeStyle)!=null?E:"tex"}),mathstyle:y.mathstyle}),ae=new Pn({mode:"math",type:"root",body:ja(a,{context:ee,parseMode:"math",mathstyle:y.mathstyle})}).render(ee);return ae?(Yc(fd(ae,ee)),Jc(ae,{classes:"ML__latex"}).toMarkup()):""}function E1(a){return t0(a,{context:Qc()})}function $v(a,y={}){return Ri(ja(a,{parseMode:"math",args:()=>"",mathstyle:"displaystyle"}),y)}function Rv(a){const y=ja(a,{parseMode:"math",mathstyle:"displaystyle"});return bu(y)}var Yh;function Nv(a){var y,b;if(!Yh){const E=(y=globalThis[Symbol.for("io.cortexjs.compute-engine")])==null?void 0:y.ComputeEngine;E?Yh=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=Yh==null?void 0:Yh.box(a).latex)!=null?b:""}function L1(a,y="math"){return xa(new Pn({type:"root",body:ja(a,{parseMode:y})}))}function D1(a){return uc(a,{format:"ascii-math"})[1]}function jf(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 xu(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 Vf(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,he={L:y,C:ee,H:ae};return a.alpha!==void 0&&(he.alpha=a.alpha),he}function Uf(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),he=4.076741661347994*ee-3.307711590408193*re+.230969928729428*ae,pe=-1.2684380040921763*ee+2.6097574006633715*re-.3413193963102197*ae,ve=-.004196086541837188*ee-.7034186144594493*re+1.7076147009309444*ae,we=Re=>{const Je=Math.abs(Re);return Je<=.0031308?Re*12.92:(Math.sign(Re)||1)*(1.055*Math.pow(Je,1/2.4)-.055)};return[we(he),we(pe),we(ve)]}function Gf(a){const[y,b,E]=a;return y>=0&&y<=1&&b>=0&&b<=1&&E>=0&&E<=1}function Xf(a,y){let[b,E,ee]=a;return b=xu(b*255),E=xu(E*255),ee=xu(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]=Uf(a);if(Gf([y,b,E]))return Xf([y,b,E],a.alpha);const ee=zv(a);if(ee.C=0,[y,b,E]=Uf(Vf(ee)),!Gf([y,b,E]))return Xf([y,b,E],a.alpha);let re=0,ae=a.L,he=(re+ae)/2;ee.C=he;const pe=.36/Math.pow(2,12);for(;ae-re>pe;)he=(re+ae)/2,ee.C=he,[y,b,E]=Uf(Vf(ee)),Gf([y,b,E])?re=he:ae=he;return Xf([y,b,E],a.alpha)}function Kv(a){return up(Vf(a))}function dp(a,y){const b=jf(a),E=jf(y),ee=.56,re=.57,ae=.62,he=.65,pe=.022,ve=1.414,we=.1,Re=5e-4,Je=1.14,vt=.027,kt=1.14,xn=.027;function ir(Vr){return Vr>=pe?Vr:Vr+Ys(pe-Vr,ve)}function yn(Vr){return(Vr<0?-1:1)*Math.pow(Math.abs(Vr),2.4)}const Nn=ir(yn(E.r/255)*.2126729+yn(E.g/255)*.7151522+yn(E.b/255)*.072175),dr=ir(yn(b.r/255)*.2126729+yn(b.g/255)*.7151522+yn(b.b/255)*.072175);let Kn,Zr,qr;return Math.abs(dr-Nn)<Re?Zr=0:dr>Nn?(Kn=Ys(dr,ee)-Ys(Nn,re),Zr=Kn*Je):(Kn=Ys(dr,he)-Ys(Nn,ae),Zr=Kn*kt),Math.abs(Zr)<we?qr=0:Zr>0?qr=Zr-xn:qr=Zr+vt,qr*100}function hp(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=jf(a);let b=((1<<24)+(xu(y.r)<<16)+(xu(y.g)<<8)+xu(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 aa(a){const y=fp(a);let b="";for(const E of y){if(typeof E.value!="string")return"";b+=E.value}return b}function fp(a){const b=a.model.selection.ranges;return b.length!==1?[]:a.model.getAtoms(b[0])}function Wv(a,y){const b=fp(a);if(b.length!==1)return!1;const E=pf[y];return E?!!E.test(b[0].value):!1}function Zv(a,y){return aa(a).length>0}function jv(a){return[Yf(a,"double-struck","mathbb","tooltip.blackboard"),Yf(a,"fraktur","mathfrak","tooltip.fraktur"),Yf(a,"calligraphic","mathcal","tooltip.caligraphic"),Jf(a,"up","mathrm","tooltip.roman-upright"),Jf(a,"bold","mathbf","tooltip.bold"),Jf(a,"italic","mathit","tooltip.italic")]}function Vv(a){return[{label:()=>Va(`\\vec{${aa(a)}}`),visible:()=>aa(a).length===1,onMenuSelect:()=>a.insert("\\vec{#@}",{selectionMode:"item"})},{label:()=>Va(`\\overrightarrow{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\overrightarrow{#@}",{selectionMode:"item"})},{label:()=>Va(`\\overleftarrow{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\overleftarrow{#@}",{selectionMode:"item"})},{label:()=>Va(`\\dot{${aa(a)}}`),visible:()=>aa(a).length===1,onMenuSelect:()=>a.insert("\\dot{#@}",{selectionMode:"item"})},{label:()=>Va(`\\ddot{${aa(a)}}`),visible:()=>aa(a).length===1,onMenuSelect:()=>a.insert("\\ddot{#@}",{selectionMode:"item"})},{label:()=>Va(`\\bar{${aa(a)}}`),visible:()=>aa(a).length===1,onMenuSelect:()=>a.insert("\\bar{#@}",{selectionMode:"item"})},{label:()=>Va(`\\overline{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\overline{#@}",{selectionMode:"item"})},{label:()=>Va(`\\overgroup{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\overgroup{#@}",{selectionMode:"item"})},{label:()=>Va(`\\overbrace{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\overbrace{#@}",{selectionMode:"item"})},{label:()=>Va(`\\underline{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\underline{#@}",{selectionMode:"item"})},{label:()=>Va(`\\undergroup{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\undergroup{#@}",{selectionMode:"item"})},{label:()=>Va(`\\underbrace{${aa(a)}}`),visible:()=>aa(a).length>0,onMenuSelect:()=>a.insert("\\underbrace{#@}",{selectionMode:"item"})}]}function Uv(a){return[{label:()=>Va(`\\boxed{${a.getValue(a.model.selection)}}}`),onMenuSelect:()=>a.insert("\\boxed{#@}",{selectionMode:"item"})},{label:()=>Va(`\\bbox[5px, border: 2px solid red]{${a.getValue(a.model.selection)}}`),onMenuSelect:()=>a.insert("\\bbox[5px, border: 2px solid red]{#@}",{selectionMode:"item"})},{label:()=>Va(`\\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(He))y.push({class:(Hv(hp(He[b]))==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${He[b]} "></span>`,ariaLabel:()=>{var E;return(E=ft(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(Ue))y.push({class:(hp(Ue[b])==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${Ue[b]} "></span>`,ariaLabel:()=>{var E;return(E=ft(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 Yv=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 Jv(a){const y=[];for(let b=1;b<=5;b++)for(let E=1;E<=5;E++)y.push({onCreate:(ee,re)=>new Yv(ee,re,b,E),label:"\u2610",tooltip:()=>ft("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 qv(a){return[{label:()=>ft("menu.array.add row above"),id:"add-row-above",onMenuSelect:()=>a.executeCommand("addRowBefore"),visible:()=>Cc(a)},{label:()=>ft("menu.array.add row below"),id:"add-row-below",onMenuSelect:()=>a.executeCommand("addRowAfter"),visible:()=>Cc(a)},{label:()=>ft("menu.array.add column before"),id:"add-column-before",onMenuSelect:()=>a.executeCommand("addColumnBefore"),visible:()=>Cc(a),enabled:()=>{const y=a.model.parentEnvironment;if(!y)return!1;const[b,E]=e1(a);return b<y.maxColumns}},{label:()=>ft("menu.array.add column after"),id:"add-column-after",onMenuSelect:()=>a.executeCommand("addColumnAfter"),visible:()=>Cc(a)},{type:"divider"},{label:()=>ft("menu.array.delete row"),id:"delete-row",onMenuSelect:()=>a.executeCommand("removeRow"),visible:()=>Cc(a)},{label:()=>ft("menu.array.delete column"),id:"delete-column",onMenuSelect:()=>a.executeCommand("removeColumn"),visible:()=>Cc(a)},{type:"divider"},{label:()=>ft("menu.borders"),visible:()=>(Qv(a)||Cc(a))&&a.isSelectionEditable,submenu:[{label:" \u22F1 ",id:"environment-no-border",onMenuSelect:()=>Ad(a,"matrix")},{label:"(\u22F1)",id:"environment-parentheses",onMenuSelect:()=>Ad(a,"pmatrix")},{label:"[\u22F1]",id:"environment-brackets",onMenuSelect:()=>Ad(a,"bmatrix")},{label:"|\u22F1|",id:"environment-bar",onMenuSelect:()=>Ad(a,"vmatrix")},{label:"{\u22F1}",id:"environment-braces",onMenuSelect:()=>Ad(a,"Bmatrix")}],submenuClass:"border-submenu"},{type:"divider"},{label:()=>ft("menu.insert matrix"),id:"insert-matrix",visible:()=>a.isSelectionEditable,submenu:Jv(a),submenuClass:"insert-matrix-submenu",columnCount:5},{label:()=>ft("menu.mode"),id:"mode",visible:()=>a.isSelectionEditable&&a.model.selectionIsCollapsed,submenu:[{label:()=>ft("menu.mode-math"),id:"mode-math",onMenuSelect:()=>{cu(a,"accept-all"),a.executeCommand(["switchMode","math"])},checked:()=>a.model.mode==="math"},{label:()=>ft("menu.mode-text"),id:"mode-text",onMenuSelect:()=>{cu(a,"accept-all"),a.executeCommand(["switchMode","text"])},checked:()=>a.model.mode==="text"},{label:()=>ft("menu.mode-latex"),id:"mode-latex",onMenuSelect:()=>a.executeCommand(["switchMode","latex"]),checked:()=>a.model.mode==="latex"}]},{type:"divider"},{label:()=>ft("menu.font-style"),id:"variant",visible:()=>a.isSelectionEditable,submenu:jv(a),submenuClass:"variant-submenu"},{label:()=>ft("menu.color"),id:"color",visible:()=>a.isSelectionEditable,submenu:Xv(a),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>ft("menu.background-color"),id:"background-color",visible:()=>a.isSelectionEditable,submenu:Gv(a),columnCount:4,submenuClass:"swatches-submenu"},{label:()=>ft("menu.accent"),id:"accent",visible:()=>a.isSelectionEditable,submenu:Vv(a),submenuClass:"variant-submenu"},{label:()=>ft("menu.decoration"),id:"decoration",visible:()=>a.isSelectionEditable&&aa(a).length>0,submenu:Uv(a),submenuClass:"variant-submenu"},{type:"divider"},{label:()=>ft("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:()=>ft("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?ft("menu.solve-for",Va(b)):ft("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:()=>ft("menu.cut"),onMenuSelect:()=>a.executeCommand("cutToClipboard"),visible:()=>!a.options.readOnly&&a.isSelectionEditable,keyboardShortcut:"meta+X"},{label:()=>ft("menu.copy"),id:"copy",submenu:[{label:()=>ft("menu.copy-as-latex"),id:"copy-latex",onMenuSelect:()=>si.copyToClipboard(a,"latex"),keyboardShortcut:"meta+C"},{label:()=>ft("menu.copy-as-ascii-math"),id:"copy-ascii-math",onMenuSelect:()=>si.copyToClipboard(a,"ascii-math")},{label:()=>ft("menu.copy-as-mathml"),id:"copy-math-ml",onMenuSelect:()=>si.copyToClipboard(a,"math-ml")}]},{label:()=>ft("menu.paste"),id:"paste",onMenuSelect:()=>a.executeCommand("pasteFromClipboard"),visible:()=>a.hasEditableContent,keyboardShortcut:"meta+V"},{label:()=>ft("menu.select-all"),id:"select-all",keyboardShortcut:"meta+A",onMenuSelect:()=>a.executeCommand("selectAll")}]}function Cc(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 Ad(a,y){Ch(a),a.flushInlineShortcutBuffer(),I0(a.model,y),va(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 Yf(a,y,b,E){return{label:()=>Va(`\\${b}{${aa(a)}}`),tooltip:()=>{var ee;return(ee=ft(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 Jf(a,y,b,E){return{label:()=>Va(`\\${b}{${aa(a)}}`),tooltip:()=>{var ee;return(ee=ft(E))!=null?ee:E},visible:()=>Zv(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 wu(a,y){return a+bu(y)}Oo({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(we){let Re=null;switch(we){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:Je}=re.at(re.position);Je!=null&&Je.parent?Re=Je:Re=re.root;break}default:Re=re.root}return Re}function he(we){let Re="";switch(we){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: "'+we+'"');break}return Re}const pe=ae(y);if(pe===null)return(ee=(E=window.MathfieldElement).speakHook)==null||ee.call(E,he(y)),!1;(b.withHighlighting||window.MathfieldElement.speechEngine==="amazon")&&(window.MathfieldElement.textToSpeechMarkup=window.sre&&window.MathfieldElement.textToSpeechRules==="sre"?"ssml_step":"ssml");const ve=bu(pe);return yt()&&b.withHighlighting?(Fl().readAloudMathfield=a,pc(a,{forHighlighting:!0}),window.MathfieldElement.readAloudHook&&window.MathfieldElement.readAloudHook(a.field,ve)):window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(ve),!1}function r1(a){var y,b;if(!yt()){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 he=new Uint8Array(ae.AudioStream),pe=new Blob([he.buffer],{type:"audio/mpeg"}),ve=URL.createObjectURL(pe);new Audio(ve).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=wu("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=wu("",a.model.at(a.model.position));else if(y==="line"){const re=wu("",a.model.root);a.keyboardDelegate.setAriaLabel(re)}else ee=E?wu(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 wu("",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+=wu("",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=Ol(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 we=re.ranges[0][0];if(!this.mathfield.dirty&&!((b=this.at(we))!=null&&b.parentPrompt)&&this.mathfield.hasEditablePrompts){if((E=this.at(we-1))!=null&&E.parentPrompt){this._anchor=this.normalizeOffset(we-1),this._position=this._anchor,this._selection=this.normalizeSelection(this._anchor);return}if((ee=this.at(we+1))!=null&&ee.parentPrompt){this._anchor=this.normalizeOffset(we+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=we,this._position=we,this._selection=re;return}const ae=Wa(re);re.direction==="backward"?[this._position,this._anchor]=ae:[this._anchor,this._position]=ae;const he=this.at(ae[0]+1),pe=this.at(ae[1]),ve=Pn.commonAncestor(he,pe);(ve==null?void 0:ve.type)==="array"&&he.parent===ve&&pe.parent===ve?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 qa&&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(tu(a)){if(E=y!=null?y:{},a.ranges.length>1)return a.ranges.reduce((ve,we)=>[...ve,...this.getAtoms(we,E)],[]);a=a.ranges[0]}let ee,re;if(Bs(a)){if(ee=a,!Bs(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,he=Math.max(ee,re);if(!E.includeChildren&&ae===1&&he===this.lastOffset)return[this.root];let pe=[];for(let ve=ae;ve<=he;ve++){const we=this.atoms[ve];mp(this,we,ae,he)&&pe.push(we)}return E.includeChildren||(pe=pe.filter(ve=>{let we=!1,{parent:Re}=ve;for(;Re&&!we;)we=mp(this,Re,ae,he),Re=Re.parent;return!we})),pe}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 Pn({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 Pn.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 Ri(a);if(b==="spoken")return bu(a);if(b==="spoken-text"){const E=window.MathfieldElement.textToSpeechMarkup;window.MathfieldElement.textToSpeechMarkup="";const ee=bu(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=bu(a);return window.MathfieldElement.textToSpeechMarkup=E,ee}return b==="ascii-math"?xa(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(Bs(a)&&Bs(y)?(E=[this.normalizeRange([a,y])],ee=b):eu(a)?(E=[this.normalizeRange(a)],ee=y):tu(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 Si(E.map(ae=>Pn.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&&qf(this,re,[E,ee]);)ee=this.offsetOf(re),re=re.parent;for(re=this.at(E).parent;re!==this.root&&qf(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&&qf(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 he=this.root.changeCounter!==ae,pe=E!==this._anchor||ee!==this._position||cc(this._selection,b)==="different";return this.silenceNotifications=re,a.content&&he&&this.contentDidChange({inputType:a.type}),a.selection&&pe&&this.selectionDidChange(),he||pe}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(Bs(a)){const ee=this.normalizeOffset(a);if(Bs(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(eu(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 tu(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(Hs(this.mathfield)),this.silenceNotifications||!this.mathfield.host||!this.mathfield)return;const b=this.silenceNotifications;this.silenceNotifications=!0,this.mathfield.host.dispatchEvent(new InputEvent("input",Me(Ce({},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(Hs(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 qf(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 Td(a,y,b,E){var ee,re,ae,he,pe,ve;const we=b.parent;if(we&&b instanceof $i){const Re=!E&&y==="forward"||E==="body"&&y==="backward";let Je=Re?a.offsetOf(b.firstChild):a.offsetOf(b.lastChild);return Re?b.rightDelim!=="?"&&b.rightDelim!=="."?(b.leftDelim=".",b.isDirty=!0):(we.addChildrenAfter(b.removeBranch("body"),b),we.removeChild(b),Je--):b.leftDelim!=="?"&&b.leftDelim!=="."?(b.rightDelim=".",b.isDirty=!0):(we.addChildrenAfter(b.removeBranch("body"),b),we.removeChild(b),Je--),a.position=Je,!0}if(we&&b.type==="surd"){if(y==="forward"&&!E||y==="backward"&&E==="body"){const Re=b.leftSibling;b.hasChildren&&we.addChildrenAfter(b.removeBranch("body"),b),we.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),we.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(we&&(b.type==="box"||b.type==="enclose")){const Re=E&&y==="backward"||!E&&y==="forward"?b.leftSibling:b.lastChild;return we.addChildrenAfter(b.removeBranch("body"),b),we.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=Id.fractionNavigationOrder==="numerator-denominator"?"above":"below",Je=Re==="above"?"below":"above";if(we&&(y==="forward"&&E===Re||y==="backward"&&E===Je)){const vt=b.removeBranch(Re),kt=b.removeBranch(Je);return we.addChildrenAfter([...vt,...kt],b),we.removeChild(b),a.position=a.offsetOf(vt.length>0?vt[vt.length-1]:kt[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]:(ve=(he=b.subscript)==null?void 0:he[0].lastSibling)!=null?ve:(pe=b.superscript)==null?void 0:pe[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((we==null?void 0:we.type)==="genfrac"&&!E&&b.type!=="first"){let Re=a.offsetOf(b.leftSibling);return we.removeChild(b),we.hasEmptyBranch("above")&&we.hasEmptyBranch("below")?(Re=a.offsetOf(we.leftSibling),we.parent.removeChild(we),a.announce("delete",void 0,[we]),a.position=Re,!0):(a.announce("delete",void 0,[b]),a.position=Re,!0)}if(y==="backward"&&((we==null?void 0:we.command)==="\\ln"||(we==null?void 0:we.command)==="\\log")&&b.parentBranch!=="body"){const Re=a.offsetOf(we.leftSibling);return we.parent.removeChild(we),a.announce("delete",void 0,[we]),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&&Td(a,"backward",y))){if(y!=null&&y.isFirstSibling){if(Td(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])}}):Zs(a,Wa(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&&Td(a,"forward",E))return;if(E){if(a.at(a.position).isLastSibling&&Td(a,"forward",E.parent,E.parentBranch))return}else{if(E=a.at(a.position),E.isLastSibling&&Td(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])}):Zs(a,Wa(a.selection),"deleteContentForward")}function Zs(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 he=E[E.length-1];if(ae===ee&&he===re){const pe=E[0].parent;pe.parent&&pe.type!=="prompt"&&(y=[a.offsetOf(pe.leftSibling),a.offsetOf(pe)])}if(E.length===1&&E[0].type==="placeholder"&&E[0].parent.type==="genfrac"){const pe=E[0].parent,ve=E[0].parentBranch==="below"?"above":"below",we=a.offsetOf(pe.leftSibling);return a.deferNotifications({content:!0,selection:!0,type:b},()=>{var Re,Je;const vt=pe.removeBranch(ve);if(vt.length===1&&vt[0].type==="placeholder")(Je=pe.parent)==null||Je.removeChild(pe),a.position=Math.max(0,we);else{const kt=pe.parent.addChildrenAfter(vt,pe);(Re=pe.parent)==null||Re.removeChild(pe),a.position=a.offsetOf(kt)}})}}return a.deferNotifications({content:!0,selection:!0,type:b},()=>a.deleteAtoms(y))}Oo({deleteAll:a=>a.contentWillChange({inputType:"deleteContent"})&&Zs(a,[0,-1],"deleteContent"),deleteForward:a=>c1(a),deleteBackward:a=>l1(a),deleteNextWord:a=>a.contentWillChange({inputType:"deleteWordForward"})&&Zs(a,[a.anchor,Ef(a,a.position,"forward")],"deleteWordForward"),deletePreviousWord:a=>a.contentWillChange({inputType:"deleteWordBackward"})&&Zs(a,[a.anchor,Ef(a,a.position,"backward")],"deleteWordBackward"),deleteToGroupStart:a=>a.contentWillChange({inputType:"deleteSoftLineBackward"})&&Zs(a,[a.anchor,a.offsetOf(a.at(a.position).firstSibling)],"deleteSoftLineBackward"),deleteToGroupEnd:a=>a.contentWillChange({inputType:"deleteSoftLineForward"})&&Zs(a,[a.anchor,a.offsetOf(a.at(a.position).lastSibling)],"deleteSoftLineForward"),deleteToMathFieldStart:a=>a.contentWillChange({inputType:"deleteHardLineBackward"})&&Zs(a,[a.anchor,0],"deleteHardLineBackward"),deleteToMathFieldEnd:a=>a.contentWillChange({inputType:"deleteHardLineForward"})&&Zs(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="${ft("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="${ft("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>`,h1=class{constructor(a,y){this.focusBlurInProgress=!1;var b,E,ee;this.options=Ce(Me(Ce({},Bh()),{macros:On(),registers:Al()}),Ph(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 he=D0(this.options),pe=new Pn({type:"root",mode:he,body:ja(ae,{context:this.context})});this.model=new s1(this,he,pe),this.undoManager=new Rg(this.model);const ve=[];if(ve.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>"),ve.push('<span part=container class=ML__container aria-hidden=true style="visibility:hidden">'),ve.push("<span part=content class=ML__content>"),ve.push(w0(this)),ve.push("</span>"),window.mathVirtualKeyboard&&(ve.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">`),ve.push(u1),ve.push("</div>")),ve.push('<div part=menu-toggle class=ML__menu-toggle role=button data-l10n-tooltip="tooltip.menu">'),ve.push(d1),ve.push("</div>"),ve.push("</span>"),ve.push("<span class=ML__sr-only>"),ve.push("<span role=status aria-live=assertive aria-atomic=true></span>"),ve.push("</span>"),this.element.innerHTML=window.MathfieldElement.createHTML(ve.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(Hs(this)))},{signal:re}),this._menu=new Sv(qv(this),{host:this.host}),this.field.addEventListener("contextmenu",this,{signal:re});const we=this.element.querySelector("[part=menu-toggle]");we==null||we.addEventListener("pointerdown",Re=>{if(Re.currentTarget!==we||this._menu.state!=="closed")return;this.element.classList.add("tracking");const Je=we.getBoundingClientRect();this._menu.modifiers=fc(Re),this._menu.show({target:we,location:{x:Je.left,y:Je.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")&&(we.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(()=>va(this)),this.resizeObserver.observe(this.field),window.mathVirtualKeyboard.addEventListener("virtual-keyboard-toggle",this,{signal:re}),gd&&!nt.locale.startsWith(gd.locale)&&Nm(nt.locale),Ho!=="ready"&&document.fonts.ready.then(()=>Lh(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(Hs(this)),Vh(this))}disconnectFromVirtualKeyboard(){this.connectedToVirtualKeyboard&&(window.removeEventListener("message",this),window.mathVirtualKeyboard.disconnect(),this.connectedToVirtualKeyboard=!1,Nf())}showMenu(a){var y,b;const E=(b=(y=a==null?void 0:a.location)!=null?y:Rs(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:jt(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:st(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=Pn.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=Ce({},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=Pf(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 pe of Object.keys(y)){const ve=this.queryStyle({[pe]:y[pe]});if(ve==="none")return"none";if(ve==="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 he=0;for(const pe of re){if(pe.type==="first"){ae-=1;continue}pe.style[E]===ee&&(he+=1)}return he===0?"none":he===ae?"all":"some"}get keybindings(){var a,y;if(this._keybindings)return this._keybindings;const[b,E]=Um(this.options.keybindings,(a=vd())!=null?a:Fm());return((y=vd())==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=Ce(Ce({},this.options),Ph(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=Pn.serialize([this.model.root],{expandMacro:!1,defaultMode:this.options.defaultMode});("macros"in a||this.model.getValue()!==E)&&si.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)&&va(this)}getOptions(a){return gc(this.options,a)}getOption(a){return gc(this.options,a)}handleEvent(a){return zl(this,null,function*(){var y;if(Fo(this)){if(Cf(a)){if(!ld(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"&&Z0(this,a);break;case"pointerdown":this.userSelect!=="none"&&(Z0(this,a),a.shiftKey===!1&&(yield ip(a,this.element.querySelector("[part=container]"),this._menu))&&Hh.stop());break;case"contextmenu":this.userSelect!=="none"&&a.shiftKey===!1&&(yield ip(a,this.element.querySelector("[part=container]"),this._menu))&&Hh.stop();break;case"virtual-keyboard-toggle":this.hasFocus()&&Vh(this);break;case"resize":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Fo(this)&&this.onGeometryChange());break;case"scroll":this.geometryChangeTimer&&cancelAnimationFrame(this.geometryChangeTimer),this.geometryChangeTimer=requestAnimationFrame(()=>Fo(this)&&this.onGeometryChange());break;case"wheel":this.onWheel(a);break;default:console.warn("Unexpected event type",a.type)}}})}dispose(){if(!Fo(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(Hs(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=af(this.model,this.model.position))!=null?b:"math");const E=this.undoManager.canUndo();si.insert(this.model,a,y)&&(va(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&&pc(this,{interactive:!0});const y=this.field.getBoundingClientRect();let b=null;if(this.model.selectionIsCollapsed)b=Rs(this.field);else{const E=sd(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&&pt()&&navigator.vibrate(S0),window.MathfieldElement.playSound("keypress")),a==="\\\\"?A0(this.model):a==="&"?T0(this.model):this.model.selectionIsCollapsed?si.insert(this.model,a,Ce({style:this.model.at(this.model.position).computedStyle},y)):si.insert(this.model,a,y),this.snapshot(`insert-${this.model.at(this.model.position).type}`),va(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 he=!1;if(this.flushInlineShortcutBuffer(),this.stopCoalescingUndo(),y&&a!=="latex"){const pe=ja(y,{context:this.context,parseMode:a});ae.collapseSelection("forward");const ve=ae.at(ae.position);ae.position=ae.offsetOf(ve.parent.addChildrenAfter(pe,ve)),he=!0}if(this.model.mode=a,a==="latex"){let pe=ae.selectionIsCollapsed;cu(this,"accept");let ve,we=ae.at(ae.position);if(pe)ve="\\";else{const Je=Wa(ae.selection);ve=this.model.getValue(Je,"latex");const vt=this.model.extractAtoms(Je);vt.length===1&&vt[0].type==="placeholder"&&(ve=y,pe=!0),we=ae.at(Je[0])}const Re=new ud(ve);we.parent.addChildAfter(Re,we),pe?ae.position=ae.offsetOf(Re.lastChild):ae.setSelection(ae.offsetOf(Re.firstChild),ae.offsetOf(Re.lastChild))}else yd(ae).forEach(pe=>{pe.isError=!1});if(b){const pe=ja(b,{context:this.context,parseMode:re});ae.collapseSelection("forward");const ve=ae.at(ae.position);ae.position=ae.offsetOf(ve.parent.addChildrenAfter(pe,ve)),he=!0}return va(this),this.undoManager.snapshot(a==="latex"?"insert-latex":"insert"),he}),this.model.mode=a,window.mathVirtualKeyboard.update(Hs(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};eu(y)?ee.range=y:(y.operation==="toggle"&&(ee.operation="toggle"),ee.range=y.range,ee.silenceNotifications=(b=y.silenceNotifications)!=null?b:!1);const re=Pf(this,a),ae=(E=ee.operation)!=null?E:"set";if(ee.range===void 0&&this.model.selectionIsCollapsed){if(ae==="set"){this.defaultStyle=Ce(Ce({},this.defaultStyle),re);return}const he=Ce({},this.defaultStyle);for(const pe of Object.keys(re))he[pe]===re[pe]?(pe==="color"&&delete he.verbatimColor,pe==="backgroundColor"&&delete he.verbatimBackgroundColor,delete he[pe]):he[pe]=re[pe];this.defaultStyle=he;return}this.model.deferNotifications({content:!ee.silenceNotifications,type:"insertText"},()=>{if(ee.range===void 0)for(const he of this.model.selection.ranges)kf(this.model,he,re,{operation:ae});else kf(this.model,ee.range,re,{operation:ae})}),va(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=Rs(this.field);return a?{x:a.x,y:a.y}:null}setCaretPoint(a,y){const b=_d(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),va(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,Me(Ce({},b),{insertionMode:"replaceSelection"}))}b!=null&&b.silenceNotifications&&(this.valueOnFocus=this.getValue()),va(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),va(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(Hs(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(Hs(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(Hs(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:D0(this.options);this.model.mode!==ee&&(this.model.mode==="latex"?(cu(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(Hs(this)),Vh(this)}onContentWillChange(a){var y,b,E;return(E=(b=this.host)==null?void 0:b.dispatchEvent(new InputEvent("beforeinput",Me(Ce({},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(),pc(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="",uu(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})),va(this),this.focusBlurInProgress=!1,Nf();const E=new AbortController,ee=E.signal;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&document.addEventListener("visibilitychange",()=>{Fo(this)&&document.visibilityState==="visible"&&this.focus({preventScroll:!0})},{once:!0,signal:ee})},{once:!0,signal:ee}),setTimeout(()=>E.abort(),100)}onInput(a){Af(this,a)}onKeystroke(a){return K0(this,a)}onCompositionStart(a){this.model.deleteAtoms(Wa(this.model.selection));const y=Rs(this.field);y&&requestAnimationFrame(()=>{pc(this),this.keyboardDelegate.moveTo(y.x,y.y-y.height)})}onCompositionUpdate(a){Lg(this.model,a),va(this)}onCompositionEnd(a){Dg(this.model),Af(this,a,{simulateKeystroke:!0})}onCut(a){if(!this.isSelectionEditable){this.model.announce("plonk");return}this.model.contentWillChange({inputType:"deleteByCut"})&&(this.stopCoalescingUndo(),si.onCopy(this,a),Zs(this.model,Wa(this.model.selection),"deleteByCut"),this.snapshot("cut"),va(this))}onCopy(a){si.onCopy(this,a)}onPaste(a){let y=this.isSelectionEditable;return y&&(y=si.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(),kh(this),Vh(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=>Zt(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 Qf(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&&Qf(E)})):(a.classList.remove("ML__highlight"),a.children&&a.children.length>0&&[...a.children].forEach(E=>{E instanceof HTMLElement&&Qf(E,y)})))}function f1(a,y){var b;if(!yt())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"]};Fl().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 he=new TextDecoder("utf-8").decode(new Uint8Array(ae.AudioStream));Fl().readAloudMarks=he.split(`
|
|
|
`).map(pe=>pe?JSON.parse(pe):{}),Fl().readAloudTokens=[];for(const pe of Fl().readAloudMarks)pe.value&&Fl().readAloudTokens.push(pe.value);Fl().readAloudCurrentMark="",ee.OutputFormat="mp3",ee.SpeechMarkTypes=[],E.synthesizeSpeech(ee,(pe,ve)=>{if(pe){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech("${y}") error:${pe}`);return}if(!(ve!=null&&ve.AudioStream))return;const we=new Uint8Array(ve.AudioStream),Re=new Blob([we.buffer],{type:"audio/mpeg"}),Je=URL.createObjectURL(Re),vt=Fl();vt.readAloudAudio?vt.readAloudAudio.pause():(vt.readAloudAudio=new Audio,vt.readAloudAudio.addEventListener("ended",()=>{const kt=vt.readAloudMathfield;vt.readAloudStatus="ended",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),kt?(pc(kt),vt.readAloudElement=null,vt.readAloudMathfield=null,vt.readAloudTokens=[],vt.readAloudMarks=[],vt.readAloudCurrentMark=""):gp(vt.readAloudElement)}),vt.readAloudAudio.addEventListener("timeupdate",()=>{let kt="";const xn=vt.readAloudAudio.currentTime*1e3+100;for(const ir of vt.readAloudMarks)ir.time<xn&&(kt=ir.value);vt.readAloudCurrentMark!==kt&&(vt.readAloudCurrentToken=kt,kt&&kt===vt.readAloudFinalToken?vt.readAloudAudio.pause():(vt.readAloudCurrentMark=kt,Qf(vt.readAloudElement,vt.readAloudCurrentMark)))})),vt.readAloudAudio.src=Je,vt.readAloudStatus="playing",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),vt.readAloudAudio.play()})})}yt()||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 Pi=new WeakMap,p1=.5,Nl={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 = ..."},Qa=class Mc extends HTMLElement{static get formAssociated(){return Su()}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 zl(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 zl(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(Nl[E])if(Nl[E].startsWith("mf."))if(Nl[E].startsWith(`mf.${E}`))b.push(`Option \`${E}\` cannot be used as a constructor option. Use ${Nl[E]}`);else{const ee=Nl[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 ${Nl[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(Su()&&(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=[Bl("core"),Bl("mathfield"),Bl("mathfield-element"),Bl("ui"),Bl("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=Mc.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?gc(this._mathfield.options,y):Pi.has(this)?Ce({},gc(Ce(Ce({},Bh()),Ph(Pi.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?gc(this._mathfield.options,y):Pi.has(this)?gc(Ce(Ce({},Bh()),Ph(Pi.get(this).options)),y):null}reflectAttributes(){const y=Bh(),b=this._getOptions();Object.keys(Mc.optionsAttributes).forEach(E=>{const ee=gl(E);Mc.optionsAttributes[E]==="on/off"?y[ee]!==b[ee]?this.setAttribute(E,b[ee]?"on":"off"):this.removeAttribute(E):y[ee]!==b[ee]&&(Mc.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(Pi.has(this)){const b=Ce(Ce({},Pi.get(this).options),y);Pi.set(this,Me(Ce({},Pi.get(this)),{selection:{ranges:b.readOnly?[[0,0]]:[[0,-1]]},options:b}))}else Pi.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))Nl[b]&&console.warn(`\`mf.setOptions({${b}:...})\` -> ${Nl[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(Pi.has(this)){let ae,he,pe;if(tu(y)?([ae,he]=y.ranges[0],pe=b):eu(y)?([ae,he]=y,pe=b):Bs(y)&&Bs(b)?(ae=y,he=b,pe=E):(ae=0,he=-1,pe=y),(pe===void 0||pe==="latex")&&ae===0&&he===-1)return(re=(ee=Pi.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(Pi.has(this)){const ee=Pi.get(this).options;Pi.set(this,{value:y,selection:{ranges:[[-1,-1]],direction:"forward"},options:ee,menuItems:void 0});return}const E=Pd(this);Pi.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?_d(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=Il(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;Fs.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,he=re.userSelect!=="none";if(he)ae.host.addEventListener("pointerdown",this,!0);else{const we=ae.querySelector("span");we.style.pointerEvents="none"}ae.host.addEventListener("focus",this,!0),ae.host.addEventListener("blur",this,!0),Su()||(this.hasAttribute("role")||this.setAttribute("role","math"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","math input field"),this.setAttribute("aria-multiline","false")),he&&!this.hasAttribute("contenteditable")&&this.setAttribute("contenteditable","true"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const pe=ae.querySelector("slot:not([name])");if(pe)try{this._style=pe.assignedElements().filter(we=>we.tagName.toLowerCase()==="style").map(we=>we.textContent).join("")}catch(we){console.error(we)}if(this._style){const we=document.createElement("style");we.textContent=this._style,ae.appendChild(we)}let ve="";if(this.hasAttribute("value")?ve=this.getAttribute("value"):ve=(y=pe==null?void 0:pe.assignedNodes().map(we=>we.nodeType===3?we.textContent:"").join("").trim())!=null?y:"",this._mathfield=new h1(ae.querySelector(":host > span"),Me(Ce({},(E=(b=Pi.get(this))==null?void 0:b.options)!=null?E:Pd(this)),{eventSink:this,value:ve})),!Pi.has(this)){this.upgradeProperty("disabled"),this.upgradeProperty("readonly");for(const we of Object.keys(Mc.optionsAttributes))this.upgradeProperty(gl(we))}if(!((ee=this._mathfield)!=null&&ee.model)){this._mathfield=null;return}if(Pi.has(this)){const we=this._mathfield,Re=Pi.get(this),Je=Re.menuItems;we.model.deferNotifications({content:!1,selection:!1},()=>{const vt=Re.value;vt!==void 0&&we.setValue(vt),we.model.selection=Re.selection,Pi.delete(this)}),Je&&(this.menuItems=Je)}window.queueMicrotask(()=>{this.isConnected&&this.dispatchEvent(new Event("mount",{cancelable:!1,bubbles:!0,composed:!0}))}),Eh()}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=gc(this._mathfield.options,Object.keys(Mc.optionsAttributes).map(ee=>gl(ee)));Pi.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":va(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",""),Su()?this._internals.ariaReadOnly="true":this.setAttribute("aria-readonly","true"),this.setAttribute("aria-readonly","true")):(Su()?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"),Su()?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:Me(Ce({},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=Pi.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}Pi.has(this)?Pi.set(this,Me(Ce({},Pi.get(this)),{menuItems:y})):Pi.set(this,{value:void 0,selection:{ranges:[[0,0]]},options:Pd(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:Pi.has(this)?Pi.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,va(this._mathfield);return}if(Pi.has(this)){Pi.set(this,Me(Ce({},Pi.get(this)),{selection:y}));return}Pi.set(this,{value:void 0,selection:y,options:Pd(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:Pi.has(this)?Pi.get(this).selection.ranges[0][0]:0}set position(y){if(this._mathfield&&(this._mathfield.model.position=y,va(this._mathfield)),Pi.has(this)){Pi.set(this,Me(Ce({},Pi.get(this)),{selection:{ranges:[[y,y]]}}));return}Pi.set(this,{value:void 0,selection:{ranges:[[y,y]]},options:Pd(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}};Qa.version="0.98.5",Qa._fontsDirectory="./fonts",Qa._soundsDirectory="./sounds",Qa.keypressVibration=!0,Qa._keypressSound={spacebar:"keypress-spacebar.wav",return:"keypress-return.wav",delete:"keypress-delete.wav",default:"keypress-standard.wav"},Qa._plonkSound="plonk.wav",Qa.audioBuffers={},Qa.createHTML=a=>a,Qa._speechEngineRate="100%",Qa._speechEngineVoice="Joanna",Qa._textToSpeechMarkup="",Qa._textToSpeechRules="mathlive",Qa._textToSpeechRulesOptions={},Qa.speakHook=r1,Qa.readAloudHook=f1,Qa._decimalSeparator=".",Qa.fractionNavigationOrder="numerator-denominator",Qa._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 Id=Qa;function gl(a){return a.replace(/[^a-zA-Z\d]+(.)/g,(y,b)=>b.toUpperCase())}function Pd(a){const y={readOnly:!1},b=Id.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[gl(E)]=!0:b[E]==="on/off"?ee==="on"?y[gl(E)]=!0:ee==="off"?y[gl(E)]=!1:y[gl(E)]=void 0:b[E]==="number"?y[gl(E)]=Number.parseFloat(ee!=null?ee:"0"):y[gl(E)]=ee}}),y}function Su(){return!(!("ElementInternals"in window)||!HTMLElement.prototype.attachInternals||!("role"in window.ElementInternals.prototype))}var vp=Id,yp,bp,xp,wp;if(yt()&&!((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=Id,(wp=window.customElements)==null||wp.define("math-field",Id)}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 Jh(a,y,b,E,ee="latex"){const re=[];for(const ae of a)if(ae.type==="text"){const he=ae.data;let pe=!0,ve=0,we;we=he.indexOf(y),we!==-1&&(ve=we,ve>0&&re.push({type:"text",data:he.slice(0,ve)}),pe=!1);let Re=!1;for(;!Re;){if(pe){if(we=he.indexOf(y,ve),we===-1){Re=!0;break}ve!==we&&re.push({type:"text",data:he.slice(ve,we)}),ve=we}else{if(we=m1(b,he,ve+y.length),we===-1){Re=!0;break}let Je=he.slice(ve+y.length,we);ee==="ascii-math"&&([,Je]=uc(Je,{format:"ascii-math"})),re.push({type:"math",data:Je,rawData:he.slice(ve,we+b.length),mathstyle:E}),ve=we+b.length}pe=!pe}ve<he.length&&re.push({type:"text",data:he.slice(ve)})}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=Jh(E,ee,re,"textstyle")}),y!=null&&y.display&&y.display.forEach(([ee,re])=>{E=Jh(E,ee,re,"displaystyle")}),b!=null&&b.inline&&b.inline.forEach(([ee,re])=>{E=Jh(E,ee,re,"textstyle","ascii-math")}),b!=null&&b.display&&b.display.forEach(([ee,re])=>{E=Jh(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 Cu(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 he=document.createElement("span");if(/\bmathml\b/i.test(ae)&&b.renderToMathML&&he.append(g1(a,b)),/\bspeakable-text\b/i.test(ae)&&b.renderToSpeakableText){const pe=document.createElement("span");pe.setAttribute("translate","no");const ve=b.renderToSpeakableText(a);pe.innerHTML=window.MathfieldElement.createHTML(ve),pe.className="ML__sr-only",he.append(pe)}return he.append(re),he}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=Cu(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 he of ae)if(he.type==="text")re.appendChild(document.createTextNode(he.data));else{const pe=Cu(he.data,he.mathstyle==="textstyle"?"textstyle":"displaystyle",y,!0);pe&&re.appendChild(pe)}}return re}function Cp(a,y){var b,E,ee,re,ae,he,pe,ve,we,Re,Je,vt,kt,xn,ir,yn;if(a.childNodes.length===1&&a.childNodes[0].nodeType===3){const Nn=(b=a.childNodes[0].textContent)!=null?b:"";if((E=y.TeX)!=null&&E.processEnvironments&&/^\s*\\begin/.test(Nn)){a.textContent="";const Kn=Cu(Nn,"",y,!0);Kn&&a.append(Kn);return}const dr=Sp(Nn,(ee=y.TeX)==null?void 0:ee.delimiters,(re=y.asciiMath)==null?void 0:re.delimiters);if(dr.length===1&&dr[0].type==="math"){a.textContent="";const Kn=Cu(dr[0].data,dr[0].mathstyle==="textstyle"?"textstyle":"displaystyle",y,!0);Kn&&a.append(Kn);return}if(dr.length===1&&dr[0].type==="text")return}for(let Nn=a.childNodes.length-1;Nn>=0;Nn--){const dr=a.childNodes[Nn];if(dr.nodeType===3){const Kn=y1((ae=dr.textContent)!=null?ae:"",y);Kn&&(Nn+=Kn.childNodes.length-1,dr.replaceWith(Kn))}else if(dr.nodeType===1){const Kn=dr,Zr=dr.nodeName.toLowerCase();if(Zr==="script"){const qr=dr;let Vr;if((he=y.processScriptTypePattern)!=null&&he.test(qr.type))Vr=(pe=qr.textContent)!=null?pe:"";else if((ve=y.processMathJSONScriptTypePattern)!=null&&ve.test(qr.type))try{Vr=(Re=y.serializeToLatex)==null?void 0:Re.call(y,JSON.parse((we=qr.textContent)!=null?we:""))}catch(Ti){console.error(Ti)}if(Vr){let Ti="textstyle";for(const xr of qr.type.split(";")){const[Wo,js]=xr.toLowerCase().split("=");Wo.trim()==="mode"&&(Ti=js.trim()==="display"?"displaystyle":"textstyle")}const Ui=Cu(Vr,Ti,y,!0);Ui&&qr.parentNode.replaceChild(Ui,qr)}}else if(((vt=(Je=y.processClassPattern)==null?void 0:Je.test(Kn.className))!=null?vt:!1)||!((xn=(kt=y.skipTags)==null?void 0:kt.includes(Zr))!=null&&xn||(yn=(ir=y.ignoreClassPattern)==null?void 0:ir.test(Kn.className))!=null&&yn))if(a.childNodes.length===1&&a.childNodes[0].nodeType===3){const Vr=a.textContent;a.textContent="";const Ti=Cu(Vr!=null?Vr:"","displaystyle",y,!0);Ti&&a.append(Ti)}else Cp(Kn,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=Ce(Ce({},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:""),Eh(),Bo("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=$l.singleton;return b?(b.show(),wd(),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}Oo({switchKeyboardLayer:w1,toggleVirtualKeyboard:S1,hideVirtualKeyboard:()=>(window.mathVirtualKeyboard.hide({animate:!0}),!1),showVirtualKeyboard:()=>(window.mathVirtualKeyboard.show({animate:!0}),!1)},{target:"virtual-keyboard"});function Fl(){var a,y;return(y=globalThis[a=Symbol.for("io.cortexjs.mathlive")])!=null||(globalThis[a]={}),globalThis[Symbol.for("io.cortexjs.mathlive")]}function A1(){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 T1(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 he=y!=null?y:{};(b=he.renderToMarkup)!=null||(he.renderToMarkup=Va),(E=he.renderToMathML)!=null||(he.renderToMathML=$v),(ee=he.renderToSpeakableText)!=null||(he.renderToSpeakableText=Rv),(re=he.serializeToLatex)!=null||(he.serializeToLatex=Nv),x1(ae,he)}var I1={mathlive:"0.98.5"}},16722:function(kn,cn,ue){"use strict";ue.d(cn,{Z:function(){return Ce}});const me=Me=>typeof Me=="object"&&Me!=null&&Me.nodeType===1,je=(Me,ze)=>(!ze||Me!=="hidden")&&Me!=="visible"&&Me!=="clip",Ke=(Me,ze)=>{if(Me.clientHeight<Me.scrollHeight||Me.clientWidth<Me.scrollWidth){const ut=getComputedStyle(Me,null);return je(ut.overflowY,ze)||je(ut.overflowX,ze)||(Le=>{const We=(yt=>{if(!yt.ownerDocument||!yt.ownerDocument.defaultView)return null;try{return yt.ownerDocument.defaultView.frameElement}catch(et){return null}})(Le);return!!We&&(We.clientHeight<Le.scrollHeight||We.clientWidth<Le.scrollWidth)})(Me)}return!1},ot=(Me,ze,ut,Le,We,yt,et,pt)=>yt<Me&&et>ze||yt>Me&&et<ze?0:yt<=Me&&pt<=ut||et>=ze&&pt>=ut?yt-Me-Le:et>ze&&pt<ut||yt<Me&&pt>ut?et-ze+We:0,be=Me=>{const ze=Me.parentElement;return ze==null?Me.getRootNode().host||null:ze},Ae=(Me,ze)=>{var ut,Le,We,yt;if(typeof document=="undefined")return[];const{scrollMode:et,block:pt,inline:at,boundary:St,skipOverflowHiddenElements:Qt}=ze,nt=typeof St=="function"?St:Ut=>Ut!==St;if(!me(Me))throw new TypeError("Invalid target");const ft=document.scrollingElement||document.documentElement,Ze=[];let ke=Me;for(;me(ke)&&nt(ke);){if(ke=be(ke),ke===ft){Ze.push(ke);break}ke!=null&&ke===document.body&&Ke(ke)&&!Ke(document.documentElement)||ke!=null&&Ke(ke,Qt)&&Ze.push(ke)}const He=(Le=(ut=window.visualViewport)==null?void 0:ut.width)!=null?Le:innerWidth,Ue=(yt=(We=window.visualViewport)==null?void 0:We.height)!=null?yt:innerHeight,{scrollX:bt,scrollY:Ve}=window,{height:jt,width:st,top:Bt,right:Qe,bottom:zt,left:ct}=Me.getBoundingClientRect(),{top:It,right:Rt,bottom:mt,left:$e}=(Ut=>{const Xe=window.getComputedStyle(Ut);return{top:parseFloat(Xe.scrollMarginTop)||0,right:parseFloat(Xe.scrollMarginRight)||0,bottom:parseFloat(Xe.scrollMarginBottom)||0,left:parseFloat(Xe.scrollMarginLeft)||0}})(Me);let xe=pt==="start"||pt==="nearest"?Bt-It:pt==="end"?zt+mt:Bt+jt/2-It+mt,ht=at==="center"?ct+st/2-$e+Rt:at==="end"?Qe+Rt:ct-$e;const nn=[];for(let Ut=0;Ut<Ze.length;Ut++){const Xe=Ze[Ut],{height:Ye,width:Dt,top:bn,right:tn,bottom:un,left:Vt}=Xe.getBoundingClientRect();if(et==="if-needed"&&Bt>=0&&ct>=0&&zt<=Ue&&Qe<=He&&(Xe===ft&&!Ke(Xe)||Bt>=bn&&zt<=un&&ct>=Vt&&Qe<=tn))return nn;const Gt=getComputedStyle(Xe),Wt=parseInt(Gt.borderLeftWidth,10),ye=parseInt(Gt.borderTopWidth,10),se=parseInt(Gt.borderRightWidth,10),oe=parseInt(Gt.borderBottomWidth,10);let de=0,fe=0;const le="offsetWidth"in Xe?Xe.offsetWidth-Xe.clientWidth-Wt-se:0,Ie="offsetHeight"in Xe?Xe.offsetHeight-Xe.clientHeight-ye-oe:0,it="offsetWidth"in Xe?Xe.offsetWidth===0?0:Dt/Xe.offsetWidth:0,Kt="offsetHeight"in Xe?Xe.offsetHeight===0?0:Ye/Xe.offsetHeight:0;if(ft===Xe)de=pt==="start"?xe:pt==="end"?xe-Ue:pt==="nearest"?ot(Ve,Ve+Ue,Ue,ye,oe,Ve+xe,Ve+xe+jt,jt):xe-Ue/2,fe=at==="start"?ht:at==="center"?ht-He/2:at==="end"?ht-He:ot(bt,bt+He,He,Wt,se,bt+ht,bt+ht+st,st),de=Math.max(0,de+Ve),fe=Math.max(0,fe+bt);else{de=pt==="start"?xe-bn-ye:pt==="end"?xe-un+oe+Ie:pt==="nearest"?ot(bn,un,Ye,ye,oe+Ie,xe,xe+jt,jt):xe-(bn+Ye/2)+Ie/2,fe=at==="start"?ht-Vt-Wt:at==="center"?ht-(Vt+Dt/2)+le/2:at==="end"?ht-tn+se+le:ot(Vt,tn,Dt,Wt,se+le,ht,ht+st,st);const{scrollLeft:$t,scrollTop:Jt}=Xe;de=Kt===0?0:Math.max(0,Math.min(Jt+de/Kt,Xe.scrollHeight-Ye/Kt+Ie)),fe=it===0?0:Math.max(0,Math.min($t+fe/it,Xe.scrollWidth-Dt/it+le)),xe+=Jt-de,ht+=$t-fe}nn.push({el:Xe,top:de,left:fe})}return nn},Ne=Me=>Me===!1?{block:"end",inline:"nearest"}:(ze=>ze===Object(ze)&&Object.keys(ze).length!==0)(Me)?Me:{block:"start",inline:"nearest"};function Ce(Me,ze){if(!Me.isConnected||!(We=>{let yt=We;for(;yt&&yt.parentNode;){if(yt.parentNode===document)return!0;yt=yt.parentNode instanceof ShadowRoot?yt.parentNode.host:yt.parentNode}return!1})(Me))return;const ut=(We=>{const yt=window.getComputedStyle(We);return{top:parseFloat(yt.scrollMarginTop)||0,right:parseFloat(yt.scrollMarginRight)||0,bottom:parseFloat(yt.scrollMarginBottom)||0,left:parseFloat(yt.scrollMarginLeft)||0}})(Me);if((We=>typeof We=="object"&&typeof We.behavior=="function")(ze))return ze.behavior(Ae(Me,ze));const Le=typeof ze=="boolean"||ze==null?void 0:ze.behavior;for(const{el:We,top:yt,left:et}of Ae(Me,Ne(ze))){const pt=yt-ut.top+ut.bottom,at=et-ut.left+ut.right;We.scroll({top:pt,left:at,behavior:Le})}}}}]);
|
|
|
}()); |