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

3382 lines
1.5 MiB

This file contains ambiguous Unicode characters!

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

!(function(){var Ys=Math.pow;var zl=(Mn,Qt,ue)=>new Promise((fe,Ze)=>{var Fe=Le=>{try{be(ue.next(Le))}catch(Re){Ze(Re)}},tt=Le=>{try{be(ue.throw(Le))}catch(Re){Ze(Re)}},be=Le=>Le.done?fe(Le.value):Promise.resolve(Le.value).then(Fe,tt);be((ue=ue.apply(Mn,Qt)).next())});(self.webpackChunk=self.webpackChunk||[]).push([[8999],{40001:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Se}});var fe=ue(54476),Ze=ue(59301),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},tt=Fe,be=ue(7657),Le=function(Pe,rt){return Ze.createElement(be.Z,(0,fe.Z)({},Pe,{ref:rt,icon:tt}))},Re=Ze.forwardRef(Le),Se=Re},26227:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Se}});var fe=ue(54476),Ze=ue(59301),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},tt=Fe,be=ue(7657),Le=function(Pe,rt){return Ze.createElement(be.Z,(0,fe.Z)({},Pe,{ref:rt,icon:tt}))},Re=Ze.forwardRef(Le),Se=Re},84105:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Se}});var fe=ue(54476),Ze=ue(59301),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},tt=Fe,be=ue(7657),Le=function(Pe,rt){return Ze.createElement(be.Z,(0,fe.Z)({},Pe,{ref:rt,icon:tt}))},Re=Ze.forwardRef(Le),Se=Re},41464:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Se}});var fe=ue(54476),Ze=ue(59301),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},tt=Fe,be=ue(7657),Le=function(Pe,rt){return Ze.createElement(be.Z,(0,fe.Z)({},Pe,{ref:rt,icon:tt}))},Re=Ze.forwardRef(Le),Se=Re},18785:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Se}});var fe=ue(54476),Ze=ue(59301),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},tt=Fe,be=ue(7657),Le=function(Pe,rt){return Ze.createElement(be.Z,(0,fe.Z)({},Pe,{ref:rt,icon:tt}))},Re=Ze.forwardRef(Le),Se=Re},87169:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Se}});var fe=ue(54476),Ze=ue(59301),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},tt=Fe,be=ue(7657),Le=function(Pe,rt){return Ze.createElement(be.Z,(0,fe.Z)({},Pe,{ref:rt,icon:tt}))},Re=Ze.forwardRef(Le),Se=Re},73331:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Se}});var fe=ue(54476),Ze=ue(59301),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},tt=Fe,be=ue(7657),Le=function(Pe,rt){return Ze.createElement(be.Z,(0,fe.Z)({},Pe,{ref:rt,icon:tt}))},Re=Ze.forwardRef(Le),Se=Re},15277:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Se}});var fe=ue(54476),Ze=ue(59301),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},tt=Fe,be=ue(7657),Le=function(Pe,rt){return Ze.createElement(be.Z,(0,fe.Z)({},Pe,{ref:rt,icon:tt}))},Re=Ze.forwardRef(Le),Se=Re},33853:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Se}});var fe=ue(54476),Ze=ue(59301),Fe={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"},tt=Fe,be=ue(7657),Le=function(Pe,rt){return Ze.createElement(be.Z,(0,fe.Z)({},Pe,{ref:rt,icon:tt}))},Re=Ze.forwardRef(Le),Se=Re},62772:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Se}});var fe=ue(54476),Ze=ue(59301),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},tt=Fe,be=ue(7657),Le=function(Pe,rt){return Ze.createElement(be.Z,(0,fe.Z)({},Pe,{ref:rt,icon:tt}))},Re=Ze.forwardRef(Le),Se=Re},43531:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Se}});var fe=ue(54476),Ze=ue(59301),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},tt=Fe,be=ue(7657),Le=function(Pe,rt){return Ze.createElement(be.Z,(0,fe.Z)({},Pe,{ref:rt,icon:tt}))},Re=Ze.forwardRef(Le),Se=Re},61485:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Se}});var fe=ue(54476),Ze=ue(59301),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},tt=Fe,be=ue(7657),Le=function(Pe,rt){return Ze.createElement(be.Z,(0,fe.Z)({},Pe,{ref:rt,icon:tt}))},Re=Ze.forwardRef(Le),Se=Re},38819:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Se}});var fe=ue(54476),Ze=ue(59301),Fe={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"},tt=Fe,be=ue(7657),Le=function(Pe,rt){return Ze.createElement(be.Z,(0,fe.Z)({},Pe,{ref:rt,icon:tt}))},Re=Ze.forwardRef(Le),Se=Re},47472:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Se}});var fe=ue(54476),Ze=ue(59301),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},tt=Fe,be=ue(7657),Le=function(Pe,rt){return Ze.createElement(be.Z,(0,fe.Z)({},Pe,{ref:rt,icon:tt}))},Re=Ze.forwardRef(Le),Se=Re},87395:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Se}});var fe=ue(54476),Ze=ue(59301),Fe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"},tt=Fe,be=ue(7657),Le=function(Pe,rt){return Ze.createElement(be.Z,(0,fe.Z)({},Pe,{ref:rt,icon:tt}))},Re=Ze.forwardRef(Le),Se=Re},76809:function(){"use strict"},17022:function(){"use strict"},89722:function(Mn,Qt){"use strict";Qt.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},20063:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(){if(typeof window.GGBApplet=="function"){console.warn("deployggb.js was loaded twice");return}var isRenderGGBElementEnabled=!1,scriptLoadStarted=!1,html5AppletsToProcess=null,ggbHTML5LoadedCodebaseIsWebSimple=!1,ggbHTML5LoadedCodebaseVersion=null,ggbHTML5LoadedScript=null,GGBApplet=function(){"use strict";for(var Mn={},Qt="5.0",ue={},fe=null,Ze=!1,Fe=!1,tt=null,be=!1,Le=null,Re=null,Se=0;Se<arguments.length;Se++){var Me=arguments[Se];if(Me!==null)switch(typeof Me){case"number":Qt=Me.toFixed(1);break;case"string":Me.match(new RegExp("^[0-9]\\.[0-9]+$"))?Qt=Me:tt=Me;break;case"object":typeof Me.is3D!="undefined"?fe=Me:ue=Me;break;case"boolean":Ze=Me,Fe=!0;break}}fe===null&&(fe={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},ue.material_id!==void 0&&!Fe&&(Ze=!0)),tt!==null&&ue.id===void 0&&(ue.id=tt);var Pe="",rt="",Te=!1,He=null,ht=null,Je=null,lt=!1,st=null,Rt=null,qt=null,at=null,ft=null;ue.height!==void 0&&(ue.height=Math.round(ue.height)),ue.width!==void 0&&(ue.width=Math.round(ue.width));var Ve=function(qe){return parseFloat(qe)>4?parseFloat(qe):5};Mn.setHTML5Codebase=function(qe,je){Re=qe,bt(qe,je)},Mn.setJavaCodebase=Mn.setJavaCodebaseVersion=Mn.isCompiledInstalled=Mn.setPreCompiledScriptPath=Mn.setPreCompiledResourcePath=function(){},Mn.setHTML5CodebaseVersion=function(qe,je){var gt=parseFloat(qe);if(gt!==NaN&&gt<5){console.log("The GeoGebra HTML5 codebase version "+gt+" is deprecated. Using version latest instead.");return}Le=qe,xe(qe,je)},Mn.getHTML5CodebaseVersion=function(){return ht},Mn.getParameters=function(){return ue},Mn.setFontsCSSURL=function(qe){at=qe},Mn.setGiacJSURL=function(qe){},Mn.setJNLPFile=function(qe){Pe=qe},Mn.setJNLPBaseDir=function(qe){},Mn.inject=function(){function qe(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var je="auto",gt=ue.id,en,Zt=!1,pn=0;pn<arguments.length;pn++){var Vt=arguments[pn];typeof Vt=="string"?(Vt=Vt.toLowerCase(),Vt.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?je=Vt:gt=arguments[pn]):typeof Vt=="boolean"?Zt=Vt:Vt instanceof HTMLElement&&(en=Vt)}Ft();function Ft(){if(!be){setTimeout(Ft,200);return}je=jt(je);var Tt=en||document.getElementById(gt);if(!Tt){console.log("possibly bug on ajax loading? ");return}if(Mn.removeExistingApplet(Tt,!1),ue.width===void 0&&Tt.clientWidth&&(ue.width=Tt.clientWidth),ue.height===void 0&&Tt.clientHeight&&(ue.height=Tt.clientHeight),!(ue.width&&ue.height)&&je==="html5"&&(delete ue.width,delete ue.height),He=je,je==="screenshot")nt(Tt,ue);else{var ge=!1;ue.hasOwnProperty("playButton")&&ue.playButton||ue.hasOwnProperty("clickToLoad")&&ue.clickToLoad?ge=!0:ue.hasOwnProperty("playButtonAutoDecide")&&ue.playButtonAutoDecide&&(ge=(!_e()||qe())&&We()),ge?(He="screenshot",mn(Tt,ue,Zt,je)):Pt(Tt,ue,Zt)}}};function _e(){try{return window.self!==window.top}catch(qe){return!0}}function We(){return ue.hasOwnProperty("screenshotGenerator")&&ue.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}Mn.getViews=function(){return fe},Mn.isJavaInstalled=function(){return!1};var et=function(qe){var je=function(pn){var Vt=JSON.parse(pn),Ft=function(se){return se.type=="G"||se.type=="E"},Tt=Vt.elements?Vt.elements.filter(Ft)[0]:Vt;if(!Tt||!Tt.url){gt();return}ue.fileName=Tt.url,Mt(Tt.settings||{}),fe.is3D=!0;var ge="https://www.geogebra.org/images/";Mn.setPreviewImage(st||Tt.previewUrl,ge+"GeoGebra_loading.png",ge+"applet_play.png"),qe()},gt=function(){ue.onError&&ue.onError(),fn("Error: Fetching material (id "+ue.material_id+") failed.",ue)},en=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",Zt="/materials/"+ue.material_id+"?scope=basic";Qe("https://"+en+"/api/proxy.php?path="+encodeURIComponent(Zt),je,gt)};function Mt(qe){var je=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(gt){qe[gt]=!!qe[gt]}),je.forEach(function(gt){ue[gt]===void 0&&qe[gt]!==void 0&&(ue[gt]=qe[gt])}),ue.showToolBarHelp===void 0&&(ue.showToolBarHelp=ue.showToolBar)}function Qe(qe,je,gt){var en=new XMLHttpRequest;en.open("GET",qe),en.onload=function(){je(en.responseText)},en.onerror=gt,en.send()}Mn.isHTML5Installed=function(){return!0},Mn.getLoadedAppletType=function(){return He},Mn.setPreviewImage=function(qe,je,gt){st=qe,Rt=je,qt=gt},Mn.removeExistingApplet=function(qe,je){var gt;typeof qe=="string"&&(qe=document.getElementById(qe)),He=null;var en=null;for(gt=0;gt<qe.childNodes.length;gt++){var Zt=qe.childNodes[gt],pn=Zt.className;pn==="applet_screenshot"?je?(Zt.style.display="block",He="screenshot"):Zt.style.display="none":pn!=="applet_scaler prerender"&&(qe.removeChild(Zt),en=pn&&pn.indexOf("appletParameters")!=-1?Zt.id:null,gt--)}var Vt=ue.id!==void 0?ue.id:en,Ft=window[Vt];Ft&&typeof Ft.getBase64=="function"&&(Ft.remove(),window[Vt]=null)},Mn.refreshHitPoints=function(){if(Ve(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var qe=Mn.getAppletObject();return qe&&typeof qe.recalculateEnvironments=="function"?(qe.recalculateEnvironments(),!0):!1},Mn.startAnimation=function(){var qe=Mn.getAppletObject();return qe&&typeof qe.startAnimation=="function"?(qe.startAnimation(),!0):!1},Mn.stopAnimation=function(){var qe=Mn.getAppletObject();return qe&&typeof qe.stopAnimation=="function"?(qe.stopAnimation(),!0):!1},Mn.getAppletObject=function(){var qe=ue.id!==void 0?ue.id:"ggbApplet";return window[qe]},Mn.resize=function(){};var Kt=function(qe,je,gt){var en=document.createElement("param");en.setAttribute("name",je),en.setAttribute("value",gt),qe.appendChild(en)},ut=function(qe){return qe&&qe!=="false"},Pt=function(qe,je,gt){Ve(ht)<=4.2&&(gt=!0);var en=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==ht||ggbHTML5LoadedCodebaseIsWebSimple&&!lt)&&(en=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var Zt=document.createElement("div");Zt.classList.add("appletParameters","notranslate");var pn=je.width,Vt=je.height;if(je.disableAutoScale=je.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():je.disableAutoScale,je.width!==void 0)if(Ve(ht)<=4.4)ut(je.showToolBar)&&(je.height-=7),ut(je.showAlgebraInput)&&(je.height-=37),je.width<605&&ut(je.showToolBar)&&(je.width=605,pn=605);else{var Ft=100;(ut(je.showToolBar)||ut(je.showMenuBar))&&(je.hasOwnProperty("customToolBar")&&(je.customToolbar=je.customToolBar),Ft=ut(je.showMenuBar)?245:155),pn<Ft&&(je.width=Ft,pn=Ft)}Zt.style.border="none",Zt.style.display="inline-block";for(var Tt in je)je.hasOwnProperty(Tt)&&Tt!=="appletOnLoad"&&Zt.setAttribute("data-param-"+Tt,je[Tt]);at&&Zt.setAttribute("data-param-fontscssurl",at),Mn.resize=function(){GGBAppletUtils.responsiveResize(qe,je)},window.addEventListener("resize",function(dn){Mn.resize()});var ge=typeof je.appletOnLoad=="function"?je.appletOnLoad:function(){};if(!gt&&je.width!==void 0){je.hasOwnProperty("showSplash")||Zt.setAttribute("data-param-showSplash","false");var se=qe.querySelector(".applet_scaler.prerender"),oe=se!==null;if(oe)var de=se.querySelector(".ggb_preview");else{var de=sn(pn,Vt,je.borderColor,!1);se=document.createElement("div"),se.className="applet_scaler",se.style.position="relative",se.style.display="block",se.style.width=pn+"px",se.style.height=Vt+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(se,"66%"),Ve(ht)>=5?(je.appletOnLoad=function(dn){var hn=qe.querySelector(".ggb_preview");hn&&hn.parentNode.removeChild(hn),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(se),window.GGBT_wsf_view&&$(window).trigger("resize"),ge(dn)},oe||se.appendChild(de)):Zt.appendChild(de),se.appendChild(Zt),oe||qe.appendChild(se),setTimeout(function(){Mn.resize()},1)}else{var pe=document.createElement("div");pe.className="applet_scaler",pe.style.position="relative",pe.style.display="block",pe.appendChild(Zt),qe.appendChild(pe),je.appletOnLoad=function(dn){Mn.resize(),ge(dn)}}function le(dn,hn){hn&&typeof hn.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(dn,hn.appletOnLoad):renderGGBElement(dn),fn("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",hn)}function De(dn,hn){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:dn,params:hn}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(_n){le(_n.article,_n.params)}),html5AppletsToProcess=null)},Ve(ht)<5&&(dn.className+=" geogebraweb")):le(dn,hn)}if(en){scriptLoadStarted=!0;for(var ot=0;ot<Zt.childNodes.length;ot++){var $t=Zt.childNodes[ot].tagName;$t==="TABLE"&&(Zt.removeChild(Zt.childNodes[ot]),ot--)}if(ggbHTML5LoadedScript!==null){var It=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');It!=null&&It.parentNode.removeChild(It)}var Ut=document.createElement("script"),Yt=function(){De(Zt,je)};Ut.src=rt+Je,ggbHTML5LoadedCodebaseIsWebSimple=lt,ggbHTML5LoadedCodebaseVersion=ht,ggbHTML5LoadedScript=Ut.src,fn("GeoGebra HTML5 codebase loaded: '"+rt+"'.",je),!Re&&(!Le||Le=="5.0")?(lt?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),Yt()):rt.requirejs?__webpack_require__.e(5795).then(function(){var dn=[__webpack_require__(95795)];Yt.apply(null,dn)}.bind(this)).catch(__webpack_require__.oe):(Ut.onload=Yt,qe.appendChild(Ut))}else De(Zt,je);je.height=Vt,je.width=pn},nt=function(qe,je,gt){var en=sn(je.width,je.height,je.borderColor,gt),Zt=document.createElement("div");Zt.style.position="relative",Zt.style.display="block",Zt.style.width=je.width+"px",Zt.style.height=je.height+"px",Zt.className="applet_screenshot applet_scaler"+(gt?" applet_screenshot_play":""),Zt.appendChild(en);var pn=GGBAppletUtils.getScale(je,qe,gt);gt?(qe.appendChild(on()),window.GGBT_wsf_view||(qe.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Zt,"66%"),qe.appendChild(Zt),pn!==1&&!isNaN(pn)&&(GGBAppletUtils.scaleElement(Zt,pn),Zt.style.width=je.width+"px",Zt.style.height=je.height+"px",Zt.parentNode.style.width=je.width*pn+"px",Zt.parentNode.style.height=je.height*pn+"px"),Mn.resize=function(){Gt(qe,en,Zt,gt)},window.addEventListener("resize",function(Vt){Mn.resize()}),Mn.resize()};function Gt(qe,je,gt,en){if(qe.contains(je)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(qe.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(qe)}var Zt=GGBAppletUtils.getScale(ue,qe,en);gt.parentNode!==null&&(!isNaN(Zt)&&Zt!==1?(GGBAppletUtils.scaleElement(gt,Zt),gt.parentNode.style.width=ue.width*Zt+"px",gt.parentNode.style.height=ue.height*Zt+"px"):(GGBAppletUtils.scaleElement(gt,1),gt.parentNode.style.width=ue.width+"px",gt.parentNode.style.height=ue.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(qe),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}Mn.onExitFullscreen=function(qe,je){je.appendChild(qe)};var mn=function(qe,je,gt,en){nt(qe,je,!0);for(var Zt=function(){var Ft=[];for(Vt=0;Vt<qe.childNodes.length;Vt++)Ft.push(qe.childNodes[Vt]);if(window.GGBT_wsf_view){var Tt=window.GGBT_wsf_view.renderFullScreen(qe,je.id),ge=document.getElementById("fullscreencontainer"),se=jQuery(qe).find(".fullscreencontent");se.length>0?(Tt.remove(),se.attr("id","fullscreencontent").show(),jQuery(ge).append(se),window.dispatchEvent(new Event("resize"))):Pt(Tt,je,!1),window.GGBT_wsf_view.launchFullScreen(ge)}else He=en,Pt(qe,je,!1);if(!window.GGBT_wsf_view)for(Vt=0;Vt<Ft.length;Vt++)qe.removeChild(Ft[Vt])},pn=qe.getElementsByClassName("ggb_preview_play"),Vt=0;Vt<pn.length;Vt++)pn[Vt].addEventListener("click",Zt,!1),pn[Vt].addEventListener("ontouchstart",Zt,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(qe),We()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},on=function(){var qe=document.createElement("div");if(qe.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var je='.icon-applet-play { width: 100%; height: 100%;box-sizing: border-box;position: absolute;z-index: 1001;cursor: pointer;border-width: 0px; background-color: transparent;background-repeat: no-repeat;left: 0;top: 0;background-position: center center; background-image: url("https://www.geogebra.org/images/worksheet/icon-start-applet.png");}.icon-applet-play:hover {background-image: url("https://www.geogebra.org/images/worksheet/icon-start-applet-hover.png");}',gt=document.createElement("style");gt.styleSheet?gt.styleSheet.cssText=je:gt.appendChild(document.createTextNode(je)),document.getElementsByTagName("head")[0].appendChild(gt)}return qe},sn=function(qe,je,gt,en){var Zt=document.createElement("div");Zt.className="ggb_preview",Zt.style.position="absolute",Zt.style.zIndex="90",Zt.style.width=qe-2+"px",Zt.style.height=je-2+"px",Zt.style.top="0px",Zt.style.left="0px",Zt.style.overflow="hidden",Zt.style.backgroundColor="white";var pn="lightgrey";gt!==void 0&&(gt==="none"?pn="transparent":pn=gt),Zt.style.border="1px solid "+pn;var Vt=document.createElement("img");if(Vt.style.position="relative",Vt.style.zIndex="1000",Vt.style.top="-1px",Vt.style.left="-1px",st!==null&&Vt.setAttribute("src",st),Vt.style.opacity=.7,Rt!==null){var Ft,Tt,ge;if(!en){Ft=document.createElement("img"),Ft.style.position="absolute",Ft.style.zIndex="1001",Ft.style.opacity=1,Vt.style.opacity=.3,Tt=360,Tt>qe/4*3&&(Tt=qe/4*3),ge=Tt/5.8,Ft.setAttribute("src",Rt),Ft.setAttribute("width",Tt),Ft.setAttribute("height",ge);var se=(qe-Tt)/2,oe=(je-ge)/2;Ft.style.left=se+"px",Ft.style.top=oe+"px",Zt.appendChild(Ft)}}return Zt.appendChild(Vt),Zt},jt=function(qe){return qe=qe.toLowerCase(),qe==="html5"||qe==="screenshot"?qe:"html5"},Ke=["web","webSimple","web3d","tablet","tablet3d","phone"],xe=function(qe,je){if(ht=qe,je){bt(ht,!0);return}var gt=!Ze;if(gt){var en=Ve(ht);!isNaN(en)&&en<4.4&&(gt=!1)}var Zt,pn;window.location.protocol.substr(0,4)==="http"?Zt=window.location.protocol:Zt="http:";var Vt=ht.indexOf("//");Vt>0?pn=ht:Vt===0?pn=Zt+ht:pn="https://www.geogebra.org/apps/5.2.814.0/";for(var Ft in Ke)if(ht.slice(Ke[Ft].length*-1)===Ke[Ft]||ht.slice((Ke[Ft].length+1)*-1)===Ke[Ft]+"/"){bt(pn,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&gt&&!fe.is3D&&!fe.AV&&!fe.SV&&!fe.CV&&!fe.EV2&&!fe.CP&&!fe.PC&&!fe.DA&&!fe.FI&&!fe.PV&&!ut(ue.showToolBar)&&!ut(ue.showMenuBar)&&!ut(ue.showAlgebraInput)&&!ut(ue.enableRightClick)&&(!ue.appName||ue.appName=="classic")?pn+="webSimple/":pn+="web3d/",bt(pn,!1)},bt=function(qe,je){if(qe.requirejs){rt=qe;return}qe.slice(-1)!=="/"&&(qe+="/"),rt=qe,je===null&&(je=qe.indexOf("http")===-1),Te=je,Je="web.nocache.js",lt=!1;var gt=rt.split("/");gt.length>1&&(!je&&gt[gt.length-2]==="webSimple"?(Je="webSimple.nocache.js",lt=!0):Ke.indexOf(gt[gt.length-2])>=0&&(Je=gt[gt.length-2]+".nocache.js")),gt=qe.split("/"),ht=gt[gt.length-3],ht.substr(0,4)==="test"?ht=ht.substr(4,1)+"."+ht.substr(5,1):(ht.substr(0,3)==="war"||ht.substr(0,4)==="beta")&&(ht="5.0");var en=parseFloat(ht);en!==NaN&&en<5&&qe.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+en+" is deprecated. Using version latest instead."),xe("5.0",je))},fn=function(qe,je){window.console&&window.console.log&&(!je||typeof je.showLogging=="undefined"||je.showLogging&&je.showLogging!=="false")&&console.log(qe)};ue.material_id!==void 0?et(Xt):Xt();function Xt(){var qe=Qt;Le!==null?qe=Le:parseFloat(qe)<5&&(qe="5.0"),xe(qe,!1),Re!==null&&bt(Re,Te),be=!0}return Mn},GGBAppletUtils=function(){"use strict";function Mn(){return window.GGBT_wsf_edit!==void 0}function Qt(be,Le){Le!=1?(be.style.transformOrigin="0% 0% 0px",be.style.webkitTransformOrigin="0% 0% 0px",be.style.transform="scale("+Le+","+Le+")",be.style.webkitTransform="scale("+Le+","+Le+")",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,Le,Re,Se,Me,Pe){var rt=null;if(Pe!=null&&Pe!="")for(var Te=be.parentNode;Te!=null;)if((" "+Te.className+" ").indexOf(" "+Pe+" ")>-1){rt=Te;break}else Te=Te.parentNode;var He=0,ht=0,Je=0,lt=0,st=0,Rt=0,qt=0;if(rt)He=rt.offsetWidth,ht=Math.max(Se?rt.offsetWidth:0,rt.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(He=Math.min(window.innerWidth,document.documentElement.clientWidth),ht=Math.min(window.innerHeight,document.documentElement.clientHeight),Je=He):(He=window.innerWidth,ht=window.innerHeight,Je=window.innerWidth),be){var at=be.getBoundingClientRect();at.left>0&&at.left<=He&&(Me===void 0||!Me)&&(document.dir==="rtl"?(st=He-at.width-at.left,Rt=Je<=480?10:30):(Rt=at.left,st=Je<=480?10:30),lt=Rt+st)}if(be&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var ft=be.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(lt=40,qt=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(lt=0,qt=40)}}return be&&((Re===void 0||!Re)&&Le>0&&Le+lt<He?He=Le:He-=lt,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Re===void 0||!Re)&&(ht-=qt)),{width:He,height:ht}}function fe(be,Le,Re,Se,Me){if(be.isScreenshoGenerator)return 1;var Pe=Se!==void 0&&Se,rt=be.noScaleMargin!=null&&be.noScaleMargin,Te=function(ft){return ft&&ft!=="false"},He=Te(be.autoHeight),ht=ue(Le,be.width,Re,He,Pe&&window.GGBT_wsf_view||rt,Me),Je=parseInt(ht.width),lt=be.width,st=be.height;if(lt===void 0){var Rt=Le.querySelector(".appletParameters");Rt&&(lt=Rt.offsetWidth,st=Rt.offsetHeight)}var qt=Je/lt,at=Pe?1:ht.height/st;return Re!==void 0&&!Re&&(qt=Math.min(1,qt),at=Math.min(1,at)),Math.min(qt,at)}function Ze(be,Le,Re){var Se=1,Me,Pe=!1;if(be.hasOwnProperty("allowUpscale")&&(Pe=be.allowUpscale),be.hasOwnProperty("scale")&&(Se=parseFloat(be.scale),(isNaN(Se)||Se===null||Se===0)&&(Se=1),Se>1&&(Pe=!0)),Le&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Pe=!0),!(be.hasOwnProperty("disableAutoScale")&&be.disableAutoScale))Me=fe(be,Le,Pe,Re,be.scaleContainerClass);else return Se;return Pe&&(!be.hasOwnProperty("scale")||Se===1)?Me:Math.min(Se,Me)}function Fe(be){var Le=Math.min(window.innerWidth,document.documentElement.clientWidth),Re=Math.min(window.innerHeight,document.documentElement.clientHeight),Se=be.getBoundingClientRect(),Me=(Le-Se.width)/2,Pe=(Re-Se.height)/2;Pe<0&&(Pe=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=Pe+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(Pe<40?be.style.top="40px":be.style.top=Pe+"px",be.style.left=Me+"px")}function tt(be,Le){var Re=be.querySelector(".appletParameters");if(Re){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Le.id!==Re.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(be)}if(Re.parentElement&&/fullscreen/.test(Re.parentElement.className))return;var Se=Ze(Le,be);Mn()&&Re.setAttribute("data-param-scale",Se);for(var Me=null,Pe=0;Pe<be.childNodes.length;Pe++)if(be.childNodes[Pe].className!==void 0&&be.childNodes[Pe].className.match(/^applet_scaler/)){Me=be.childNodes[Pe];break}if(Me!==null&&Me.querySelector(".noscale")!==null)return;var rt=Le.id!==void 0?Le.id:"ggbApplet",Te=window[rt];(Te==null||!Te.recalculateEnvironments)&&Me!==null&&!Me.className.match(/fullscreen/)&&(Me.parentNode.style.transform="",!isNaN(Se)&&Se!==1?(Me.parentNode.style.width=Le.width*Se+"px",Me.parentNode.style.height=Le.height*Se+"px",Qt(Me,Se)):(Qt(Me,1),Me.parentNode.style.width=Le.width+"px",Me.parentNode.style.height=Le.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&Fe(be),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(Re).parents(".content-added-content"))}}return{responsiveResize:tt,isFlexibleWorksheetEditor:Mn,positionCenter:Fe,getScale:Ze,scaleElement:Qt}}();__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return GGBApplet}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),__WEBPACK_AMD_DEFINE_RESULT__!==void 0&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__),GGBAppletUtils.makeModule=function(name,permutation){function webModule(){var H="bootstrap",I="begin",J="gwt.codesvr."+name+"=",K="gwt.codesvr=",L=name,M="startup",N="DUMMY",O=0,P=1,Q="iframe",R="position:absolute; width:0; height:0; border:none; left: -1000px;",S=" top: -1000px;",T="Chrome",U="CSS1Compat",V="<!doctype html>",W="",X="<html><head></head><body></body></html>",Y="undefined",Z="readystatechange",$=10,_="script",ab="javascript",bb="Failed to load ",cb="moduleStartup",db="scriptTagAdded",eb="moduleRequested",fb="meta",gb="name",hb=name+"::",ib="::",jb="gwt:property",kb="content",lb="=",mb="gwt:onPropertyErrorFn",nb='Bad handler "',ob='" for "gwt:onPropertyErrorFn"',pb="gwt:onLoadErrorFn",qb='" for "gwt:onLoadErrorFn"',rb="#",sb="?",tb="/",ub="img",vb="clear.cache.gif",wb="baseUrl",xb=name+".nocache.js",yb="base",zb="//",Ab="selectingPermutation",Bb=name+".devmode.js",Cb=permutation,Db=":",Eb=".cache.js",Fb="loadExternalRefs",Gb="end",n=window,o=document;function p(){var Mn=n.location.search;return Mn.indexOf(J)!=-1||Mn.indexOf(K)!=-1}function q(Mn,Qt){}webModule.__sendStats=q,webModule.__moduleName=L,webModule.__errFn=null,webModule.__moduleBase=N,webModule.__softPermutationId=O,webModule.__computePropValue=null,webModule.__getPropMap=null,webModule.__installRunAsyncCode=function(){},webModule.__gwtStartLoadingFragment=function(){return null},webModule.__gwt_isKnownPropertyValue=function(){return!1},webModule.__gwt_getMetaProperty=function(){return null};var r=null,s=n.__gwt_activeModules=n.__gwt_activeModules||{};s[L]={moduleName:L},webModule.__moduleStartupDone=function(Mn){var Qt=s[L].bindings;s[L].bindings=function(){for(var ue=Qt?Qt():{},fe=Mn[webModule.__softPermutationId],Ze=O;Ze<fe.length;Ze++){var Fe=fe[Ze];ue[Fe[O]]=Fe[P]}return ue}};var t;function u(){return v(),t}function v(){if(!t){var Mn=o.createElement(Q);if(Mn.id=L,Mn.style.cssText=R+S,Mn.tabIndex=-1,o.body.appendChild(Mn),t=Mn.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var Qt=document.compatMode==U?V:W;t.write(Qt+X),t.close()}}}function w(Mn){function Qt(fe){function Ze(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var Fe=Ze();if(Fe){fe();return}function tt(){if(!Fe){if(!Ze())return;Fe=!0,fe(),o.removeEventListener&&o.removeEventListener(Z,tt,!1),be&&clearInterval(be)}}o.addEventListener&&o.addEventListener(Z,tt,!1);var be=setInterval(function(){tt()},$)}function ue(fe){var Ze=u(),Fe=Ze.body,tt=Ze.createElement(_);tt.language=ab,tt.crossOrigin=W,tt.src=fe,webModule.__errFn&&(tt.onerror=function(){webModule.__errFn(L,new Error(bb+fe))}),Fe.appendChild(tt)}Qt(function(){ue(Mn)})}webModule.__startLoadingFragment=function(Mn){return C(Mn)},webModule.__installRunAsyncCode=function(Mn){var Qt=u(),ue=Qt.body,fe=Qt.createElement(_);fe.language=ab,fe.text=Mn,ue.appendChild(fe),ue.removeChild(fe)};function A(){for(var c={},d,e,f=o.getElementsByTagName(fb),g=O,h=f.length;g<h;++g){var i=f[g],j=i.getAttribute(gb),k;if(j){if(j=j.replace(hb,W),j.indexOf(ib)>=O)continue;if(j==jb){if(k=i.getAttribute(kb),k){var l,m=k.indexOf(lb);m>=O?(j=k.substring(O,m),l=k.substring(m+P)):(j=k,l=W),c[j]=l}}else if(j==mb){if(k=i.getAttribute(kb),k)try{d=eval(k)}catch(Mn){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(Mn){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(Mn){var Qt=c[Mn];return Qt==null?null:Qt},r=d,webModule.__errFn=e}function B(){function Mn(be){var Le=be.lastIndexOf(rb);Le==-1&&(Le=be.length);var Re=be.indexOf(sb);Re==-1&&(Re=be.length);var Se=be.lastIndexOf(tb,Math.min(Re,Le));return Se>=O?be.substring(O,Se+P):W}function Qt(be){if(!be.match(/^\w+:\/\//)){var Le=o.createElement(ub);Le.src=be+vb,be=Mn(Le.src)}return be}function ue(){var be=__gwt_getMetaProperty(wb);return be!=null?be:W}function fe(){for(var be=o.getElementsByTagName(_),Le=O;Le<be.length;++Le)if(be[Le].src.indexOf(xb)!=-1)return Mn(be[Le].src);return W}function Ze(){var be=o.getElementsByTagName(yb);return be.length>O?be[be.length-P].href:W}function Fe(){var be=o.location;return be.href==be.protocol+zb+be.host+be.pathname+be.search+be.hash}var tt=ue();return tt==W&&(tt=fe()),tt==W&&(tt=Ze()),tt==W&&Fe()&&(tt=Mn(o.location.href)),tt=Qt(tt),tt}function C(Mn){return Mn.match(/^\//)||Mn.match(/^[a-zA-Z]+:\/\//)?Mn:webModule.__moduleBase+Mn}function D(){var Mn=[],Qt=O,ue=[],fe=[];function Ze(be){var Le=fe[be](),Re=ue[be];if(Le in Re)return Le;var Se=[];for(var Me in Re)Se[Re[Me]]=Me;throw r&&r(be,Se,Le),null}if(__gwt_isKnownPropertyValue=function(be,Le){return Le in ue[be]},webModule.__getPropMap=function(){var be={};for(var Le in ue)ue.hasOwnProperty(Le)&&(be[Le]=Ze(Le));return be},webModule.__computePropValue=Ze,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var Fe;try{Fe=Cb;var tt=Fe.indexOf(Db);tt!=-1&&(Qt=parseInt(Fe.substring(tt+P),$),Fe=Fe.substring(O,tt))}catch(be){}return webModule.__softPermutationId=Qt,C(Fe+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}A(),webModule.__moduleBase=window.ENV==="build"?"/react/build/js/mathematicalGraphics/"+name+"/":"/js/mathematicalGraphics/"+name+"/",s[L].moduleBase=webModule.__moduleBase;var G=D();return F(),w(G),!0}return webModule},typeof window.web3d!="function"&&(window.web3d=GGBAppletUtils.makeModule("web3d","A18F540516513B1292CA7CEF2F6AFC7E")),typeof window.webSimple!="function"&&(window.webSimple=GGBAppletUtils.makeModule("webSimple","96B09BF1B436BF53F0DF54116700F16A")),window.GGBApplet=GGBApplet})()},25676:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Ax:function(){return tt},Ds:function(){return be},KI:function(){return Re},SI:function(){return Fe},f1:function(){return Ze}});var fe=ue(11662);function Ze(Se){let Me=!0;if(Se.length>0){for(let Pe=0;Pe<Se.length;Pe++)if(Se[Pe].compile_success==0||!Se[Pe].compile_success){Me=!1;break}}else Me=!1;return Me}function Fe(Se,Me=""){let Pe=[];for(let rt=0;rt<Se.length;rt++){let Te=Se[rt],He=Me?`${Me}/${Te.name}`:`${Te.name}`;Pe.push({title:Te.name,type:Te.type,isLeaf:Te.type!=="tree",key:He})}return Pe}function tt(Se,Me,Pe){for(let rt=0;rt<Se.length;rt++){let Te=Se[rt];if(Te.key===Me){Te.children=Pe;break}Te.children&&tt(Te.children,Me,Pe)}return Se}function be(Se,Me,Pe){let rt;return function(){let Te=this,He=arguments,ht=function(){rt=null,Pe||Se.apply(Te,He)},Je=Pe&&!rt;clearTimeout(rt),rt=setTimeout(ht,Me),Je&&Se.apply(Te,He)}}const Le=!0,Re=fe.Z.API_SERVER},2781:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return rt}});var fe=ue(59301),Ze={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},Fe=ue(92310),tt=ue.n(Fe),be=ue(71418),Le=ue(2859),Re=ue(64866),Se=ue(22566),Me=(Te,He,ht)=>new Promise((Je,lt)=>{var st=at=>{try{qt(ht.next(at))}catch(ft){lt(ft)}},Rt=at=>{try{qt(ht.throw(at))}catch(ft){lt(ft)}},qt=at=>at.done?Je(at.value):Promise.resolve(at.value).then(st,Rt);qt((ht=ht.apply(Te,He)).next())}),rt=({data:Te,className:He,fullWidth:ht,style:Je={},onClose:lt,onOk:st,showFullTools:Rt,noAssociationId:qt})=>{const at=(0,fe.useRef)(null),ft=(0,fe.useRef)(null),Ve=(0,fe.useRef)(null),_e=(0,fe.useRef)(null),[We,et]=(0,fe.useState)(!1),[Mt,Qe]=(0,fe.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,fe.useEffect)(()=>{Ve.current||(Ve.current=document.createElement("style"),document.head.appendChild(Ve.current)),Te!=null&&Te.visible?(document.body.setAttribute("data-custom","y-hidden"),Ve.current.innerHTML=" html { overflow-y: hidden; }",Te!=null&&Te.src&&Kt()):(document.body.removeAttribute("data-custom"),Ve.current&&(document.head.removeChild(Ve.current),Ve.current=null))},[Te==null?void 0:Te.visible]);const Kt=()=>Me(void 0,null,function*(){et(!0),Qe("\u6B63\u5728\u52A0\u8F7D\u4E2D");const mn=yield(0,Se.ZJ)(Te==null?void 0:Te.src);at.current.src="",at.current.src=mn,at.current.onload=function(){Gt()},et(!1),Qe("")}),ut=()=>{document.body.removeAttribute("data-custom"),Ve.current.innerHTML=" ",lt()},Pt=mn=>Me(void 0,null,function*(){et(!0),Qe("\u6B63\u5728\u4FDD\u5B58\u4E2D");const on=yield(0,Re.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Te.title,file:mn.dataUrl}});on!=null&&on.id&&!qt?(yield(0,Re.ZP)(`/api/attachments/${Te.id}/add_subitem.json`,{method:"post",body:{subitem_id:on==null?void 0:on.id,settings:JSON.stringify(mn.state)}})).status===0&&st():on!=null&&on.id&&st(on),document.body.removeAttribute("data-custom"),Ve.current.innerHTML=" ",et(!1),Qe("")}),nt=()=>{const mn=document.querySelector('a[href="https://markerjs.com/"]');mn&&mn.parentNode&&(mn.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(sn=>{const jt=document.querySelector(sn.name);jt&&jt.setAttribute("title",sn.title)})},Gt=()=>{ft.current=new Le.hP(at.current),ft.current.targetRoot=_e.current,ft.current.addEventListener("render",Pt),ft.current.addEventListener("beforeclose",ut),Rt&&(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(),Te!=null&&Te.snapshotData&&ft.current.restoreState(Te.snapshotData),setTimeout(()=>{window.scrollTo(0,0),nt()},300)};return fe.createElement(fe.Fragment,null,(Te==null?void 0:Te.visible)&&fe.createElement(be.Z,{spinning:We,tip:Mt,style:{position:"absolute"}},fe.createElement("div",{ref:_e,className:tt()(Ze.imageDimensions,He,ht?Ze.fullWidth:""),style:Je},fe.createElement("img",{className:Ze.img,ref:at}))))}},50892:function(Mn,Qt,ue){"use strict";var fe=ue(59301),Ze=ue(95237),Fe=ue(43604),tt=ue(99313),be=ue(3113),Le=ue(9200),Re=ue(89722),Se=ue(48136),Me=ue(59301);const Pe=(0,fe.forwardRef)(({callback:rt,showSaveButton:Te,value:He=""},ht)=>{const Je=(0,fe.useRef)(),lt=[{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 "}]}]}],st=[{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}`}]}]}],Rt=ft=>{Je.current.setValue(Je.current.getValue()+" "+ft.value+" ")},qt=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:Me.createElement(Ze.Z,{className:Re.Z.lists,gutter:[10,10]},lt.map((ft,Ve)=>Me.createElement(Fe.Z,{flex:"110px",className:Re.Z.item},Me.createElement("div",null,Me.createElement(Le.Z,{value:`$$${ft.value}$$`}),ft.name),Me.createElement("div",{className:Re.Z.children},ft.children.map((_e,We)=>Me.createElement("div",{key:We},Me.createElement("h1",null,_e.name),Me.createElement(Ze.Z,{gutter:[10,10]},_e.data.map((et,Mt)=>Me.createElement(Fe.Z,{key:Mt,onClick:()=>Rt(et),className:Re.Z.diamond},Me.createElement(Le.Z,{value:"`$$"+et.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:Me.createElement(Ze.Z,{className:Re.Z.lists,gutter:[10,10]},st.map((ft,Ve)=>Me.createElement(Fe.Z,{flex:"110px",className:Re.Z.item},Me.createElement("div",null,Me.createElement(Le.Z,{value:"`$$"+ft.value+"$$`"}),ft.name),Me.createElement("div",{className:Re.Z.children},ft.children.map((_e,We)=>Me.createElement("div",{key:We},_e.name&&Me.createElement("h1",null,_e.name),Me.createElement(Ze.Z,{gutter:[10,10]},_e.data.map((et,Mt)=>Me.createElement(Fe.Z,{key:Mt,onClick:()=>Rt(et),className:Re.Z.diamond},Me.createElement(Le.Z,{value:"`$$"+et.value+"$$`"}))))))))))}],at=()=>{var ft=document.createElement("div");ft.innerHTML=Je.current.getValue();var Ve=ft.innerText;return rt&&rt(Ve),Ve};return(0,fe.useImperativeHandle)(ht,()=>({getData:at})),Me.createElement("div",{className:Re.Z.mathWrap},Me.createElement(tt.default,{defaultActiveKey:"1",items:qt}),Me.createElement("math-field",{locale:"zh_cn",className:Re.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:Je,style:{width:800,marginTop:30,fontSize:18}},He||""),Te&&Me.createElement("div",{className:Re.Z.button},Me.createElement(be.ZP,{size:"large",onClick:at,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});Qt.Z=Pe},62319:function(Mn,Qt,ue){"use strict";ue.d(Qt,{h:function(){return ft}});var fe=ue(59301),Ze=ue(57809),Fe=ue(78241),tt=ue(3113),be=ue(89780),Le=ue.n(be),Re=ue(76809),Se=ue(17022),Me=Object.defineProperty,Pe=Object.defineProperties,rt=Object.getOwnPropertyDescriptors,Te=Object.getOwnPropertySymbols,He=Object.prototype.hasOwnProperty,ht=Object.prototype.propertyIsEnumerable,Je=(Ve,_e,We)=>_e in Ve?Me(Ve,_e,{enumerable:!0,configurable:!0,writable:!0,value:We}):Ve[_e]=We,lt=(Ve,_e)=>{for(var We in _e||(_e={}))He.call(_e,We)&&Je(Ve,We,_e[We]);if(Te)for(var We of Te(_e))ht.call(_e,We)&&Je(Ve,We,_e[We]);return Ve},st=(Ve,_e)=>Pe(Ve,rt(_e));const Rt=Ze.default.Option,qt={labelCol:{span:4},wrapperCol:{span:20}},at={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Qt.Z=({callback:Ve,onCancel:_e})=>{const[We,et]=(0,fe.useState)("python");function Mt(Kt){et(at[Kt][1])}function Qe(Kt){Ve(Kt)}return fe.createElement(Fe.default,st(lt({},qt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Qe,style:{width:500}}),fe.createElement(Fe.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},fe.createElement(Ze.default,{getPopupContainer:Kt=>Kt.parentNode,onChange:Mt},Object.keys(at).map(Kt=>fe.createElement(Rt,{key:Kt,value:Kt},at[Kt][0])))),fe.createElement(Fe.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},fe.createElement(ft,{mode:We})),fe.createElement("div",{className:"flex-container flex-end"},fe.createElement(tt.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),fe.createElement(tt.ZP,{type:"ghost",onClick:_e},"\u53D6\u6D88")))};function ft({value:Ve,onChange:_e,mode:We,options:et={}}){const Mt=(0,fe.useRef)(),[Qe,Kt]=(0,fe.useState)();return(0,fe.useEffect)(()=>{if(Qe){let ut=function(Pt){const nt=Pt.getValue();_e&&_e(nt)};return Qe.on("change",ut),()=>{Qe.off("change",ut)}}},[Qe,_e]),(0,fe.useEffect)(()=>{Qe&&Qe.setOption("mode",We)},[Qe,We]),(0,fe.useEffect)(()=>{Qe&&(Ve!==Qe.getValue()||Ve==="")&&setTimeout(()=>{Qe.setValue(Ve||"")},300)},[Qe,Ve]),(0,fe.useEffect)(()=>{if(Mt.current&&!Qe){const ut=Le().fromTextArea(Mt.current,lt({mode:We,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},et));Kt(ut)}},[Mt.current,Qe]),fe.createElement("div",{className:"my-codemirror-container"},fe.createElement("textarea",{ref:Mt}))}},98263:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Nr}});var fe=ue(59301),Ze=ue(89780),Fe=ue.n(Ze),tt=ue(76374),be=ue(76809),Le=ue(6313),Re=ue(25717),Se=ue(99498),Me=ue(25419),Pe=ue(67549),rt=ue(9200),Te=({value:Jn="",className:lr,showTextOnly:Rn,showLines:$n,style:wr={}})=>{const ct=(0,fe.useMemo)(()=>"",[Jn]);return fe.createElement(fe.Fragment,null,fe.createElement("div",{dangerouslySetInnerHTML:{__html:ct}}))},He=ue(59301),ht=Object.defineProperty,Je=Object.defineProperties,lt=Object.getOwnPropertyDescriptors,st=Object.getOwnPropertySymbols,Rt=Object.prototype.hasOwnProperty,qt=Object.prototype.propertyIsEnumerable,at=(Jn,lr,Rn)=>lr in Jn?ht(Jn,lr,{enumerable:!0,configurable:!0,writable:!0,value:Rn}):Jn[lr]=Rn,ft=(Jn,lr)=>{for(var Rn in lr||(lr={}))Rt.call(lr,Rn)&&at(Jn,Rn,lr[Rn]);if(st)for(var Rn of st(lr))qt.call(lr,Rn)&&at(Jn,Rn,lr[Rn]);return Jn},Ve=(Jn,lr)=>Je(Jn,lt(lr));let _e=[{title:"\u7C97\u4F53",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"md-iconfont icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"\u6570\u5B66\u56FE\u50CF",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"iconfont icon-jisuan1",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"\u63D2\u5165\u753B\u56FE",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"\u63D2\u5165\u6D41\u7A0B\u56FE",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"\u8868\u683C",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function We({onActionCallback:Jn,title:lr,icon:Rn,actionName:$n,className:wr="",children:ct}){function ke(){Jn($n)}return He.createElement("a",{title:lr,className:wr,onClick:ke},He.createElement("i",{className:`${Rn}`}),ct)}var et=({watch:Jn,showNullButton:lr,showNullProgramButton:Rn,onActionCallback:$n,fullScreen:wr,insertTemp:ct,hidetoolBar:ke,extraUse:Be})=>{const Ae=[..._e,{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 He.createElement("ul",{className:"markdown-toolbar-container"},!ke&&Ae.map((Ie,Xe)=>He.createElement("li",{key:Xe},Ie.actionName?He.createElement(We,Ve(ft({},Ie),{onActionCallback:$n})):He.createElement("span",{className:"v-line"}))),lr?He.createElement("li",null,He.createElement(We,{icon:"iconfont icon-tianjia5 insert-blank",className:"btn-null ml5",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:$n},He.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u65B0\u589E\u586B\u7A7A\u9879"))):null,Rn?He.createElement(He.Fragment,null,He.createElement("li",null,He.createElement(We,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:$n},He.createElement("span",{className:"fill-tip"},"+\u5355\u884C\u586B\u7A7A\u9879"))),He.createElement("li",null,He.createElement(We,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:$n},He.createElement("span",{className:"fill-tip"},"+\u591A\u884C\u586B\u7A7A\u9879")))):null,ct&&He.createElement("li",null,He.createElement(We,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${ct}`,onActionCallback:$n},He.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),Be&&He.createElement("li",null,Be),He.createElement("li",{className:"btn-full-screen"},He.createElement(We,{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})))},Mt=ue(61569),Qe=ue(78241),Kt=ue(92832),ut=ue(3113),Pt=Object.defineProperty,nt=Object.defineProperties,Gt=Object.getOwnPropertyDescriptors,mn=Object.getOwnPropertySymbols,on=Object.prototype.hasOwnProperty,sn=Object.prototype.propertyIsEnumerable,jt=(Jn,lr,Rn)=>lr in Jn?Pt(Jn,lr,{enumerable:!0,configurable:!0,writable:!0,value:Rn}):Jn[lr]=Rn,Ke=(Jn,lr)=>{for(var Rn in lr||(lr={}))on.call(lr,Rn)&&jt(Jn,Rn,lr[Rn]);if(mn)for(var Rn of mn(lr))sn.call(lr,Rn)&&jt(Jn,Rn,lr[Rn]);return Jn},xe=(Jn,lr)=>nt(Jn,Gt(lr));const bt={labelCol:{span:4},wrapperCol:{span:20}};var fn=({callback:Jn,onCancel:lr})=>{function Rn($n){Jn($n)}return fe.createElement(Qe.default,xe(Ke({},bt),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Rn,style:{width:500}}),fe.createElement(Qe.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},fe.createElement(Kt.default,null)),fe.createElement(Qe.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},fe.createElement(Kt.default,null)),fe.createElement("div",{className:"flex-container flex-end"},fe.createElement(ut.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),fe.createElement(ut.ZP,{type:"ghost",onClick:lr},"\u53D6\u6D88")))},Xt=ue(62319),qe=ue(52999),je=ue(43418),gt=ue(95237),en=ue(2781),Zt=ue(59301),pn=({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 Zt.createElement(je.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},Zt.createElement(gt.Z,{style:{height:"100vh"}},Zt.createElement(en.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:wr,visible:!0,title:String(Date.now())},onOk:ct=>{Jn({src:ct.url})},onClose:lr})))},Vt=ue(43428),Ft=ue(43604),Tt=ue(8591),ge={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},se=ue(59301),de=(0,fe.forwardRef)(({onCancel:Jn,editImgId:lr,callback:Rn},$n)=>{let wr=(0,fe.useRef)(),ct=(0,fe.useRef)(),ke=(0,fe.useRef)(),Be=(0,fe.useRef)(!1);const Ae=(0,fe.useRef)(!1);console.log("ref:",$n);const[Ie,Xe]=(0,fe.useState)(0),[dt,Ht]=(0,fe.useState)("100vh");return(0,fe.useEffect)(()=>{Xe(1);try{indexedDB.databases().then(kt=>{kt.forEach(Wt=>indexedDB.deleteDatabase(Wt.name))})}catch(kt){}},[]),(0,fe.useImperativeHandle)($n,()=>({setHeight:Ht})),se.createElement("div",{ref:Ae,className:"body-overflow-initial"},se.createElement(Vt.Z,{width:"100vw",height:dt,footer:null,closable:!0,placement:"bottom",open:!!Ie,destroyOnClose:!0,maskClosable:!1,mask:!1,rootClassName:`zIndex-9999 ${ge.drawerWrap}`,onClose:()=>{window.saveDrawData(kt=>{Rn({src:`/api/attachments/${kt}`,id:kt})})},title:se.createElement(gt.Z,{align:"middle"},se.createElement(Ft.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),se.createElement(Ft.Z,{onClick:()=>{Ht(dt==="60px"?"100vh":"60px")}},se.createElement("span",{className:"current c-blue",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77")),se.createElement(Ft.Z,{onClick:()=>{window.saveDrawData(kt=>{if(kt===null){Tt.ZP.warning({content:"\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u8BF7\u5148\u7ED8\u5236\u6D41\u7A0B\u56FE",key:"saveFlowChart"});return}Tt.ZP.success({content:"\u4FDD\u5B58\u6210\u529F",key:"saveFlowChart",style:{zIndex:999999999}}),Rn({src:`/api/attachments/${kt}`,id:kt,disabledClose:!0})})}},se.createElement(ut.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:ct})))}),pe=ue(11662),le=ue(5112),De=ue(5871);const ot=le.ZP.Group,$t={margin:"0 8px"};var It=({callback:Jn,onCancel:lr})=>{function Rn($n){Jn($n)}return fe.createElement(Qe.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Rn},fe.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},fe.createElement("span",{style:$t},"\u5355\u5143\u683C\u6570\uFF1A"),fe.createElement("span",{style:$t},"\u884C\u6570"),fe.createElement(Qe.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},fe.createElement(De.Z,null)),fe.createElement("span",{style:$t},"\u5217\u6570"),fe.createElement(Qe.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},fe.createElement(De.Z,null))),fe.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},fe.createElement("span",{style:$t},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),fe.createElement(Qe.default.Item,{name:"align"},fe.createElement(ot,null,fe.createElement(le.ZP,{value:"default"},fe.createElement("i",{className:"fa fa-align-justify"})),fe.createElement(le.ZP,{value:"left"},fe.createElement("i",{className:"fa fa-align-left"})),fe.createElement(le.ZP,{value:"center"},fe.createElement("i",{className:"fa fa-align-center"})),fe.createElement(le.ZP,{value:"right"},fe.createElement("i",{className:"fa fa-align-right"}))))),fe.createElement("div",{className:"flex-container flex-end"},fe.createElement(ut.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),fe.createElement(ut.ZP,{type:"ghost",onClick:lr},"\u53D6\u6D88")))},Ut=ue(78673),Yt=ue(20063),dn=ue.n(Yt),_n=(0,fe.forwardRef)(({use3d:Jn,width:lr,height:Rn,callback:$n,showSaveButton:wr},ct)=>{const ke=(0,fe.useRef)(),Be=(0,fe.useRef)(),[Ae,Ie]=(0,fe.useState)(!1),Xe=(0,fe.useRef)({id:ke,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,fe.useEffect)(()=>{Be.current=new(dn())(Xe.current,!0),window.onload=function(){Be.current.inject("applet_container")}},[]);const dt=()=>{var Ht=window.ggbApplet.getPNGBase64(1,!0,72);return $n&&$n(Ht),Ht};return(0,fe.useEffect)(()=>{Xe.current.appName=Ae?"3D":"graphing",Be.current.inject("applet_container")},[Ae]),(0,fe.useEffect)(()=>{Ie(Jn)},[Jn]),(0,fe.useImperativeHandle)(ct,()=>({getImgData:dt})),fe.createElement(fe.Fragment,null,fe.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:ke}),fe.createElement(gt.Z,{align:"middle"},fe.createElement(Ft.Z,{flex:1},fe.createElement(Ut.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:Ae,onChange:Ht=>Ie(Ht)})),fe.createElement(Ft.Z,null,fe.createElement(ut.ZP,{size:"large",onClick:dt,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),vt=ue(50892),cn=ue(1012);const Sn="link",Ye="upload-image",ze="add-flowchart",Ue="draw-image",Bt="add-flowchart",Jt="code-block",rn="add-table",An="------------",In={default:An,left:`:${An}`,center:`:${An}:`,right:`${An}:`};var Ln=ue(29152),Fn=(Jn,lr,Rn)=>new Promise(($n,wr)=>{var ct=Ae=>{try{Be(Rn.next(Ae))}catch(Ie){wr(Ie)}},ke=Ae=>{try{Be(Rn.throw(Ae))}catch(Ie){wr(Ie)}},Be=Ae=>Ae.done?$n(Ae.value):Promise.resolve(Ae.value).then(ct,ke);Be((Rn=Rn.apply(Jn,lr)).next())});function jn(){}let Tn=0;const hr=1e4,kr="\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={[Sn]:"\u6DFB\u52A0\u94FE\u63A5",[Jt]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[Ye]:"\u6DFB\u52A0\u56FE\u7247",[Ue]:"\u6DFB\u52A0\u753B\u56FE",[ze]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[rn]:"\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:ct=!1,watch:ke,insertTemp:Be,mode:Ae="markdown",id:Ie="markdown-editor-id",showResizeBar:Xe=!1,noStorage:dt=!1,showNullButton:Ht=!1,showNullProgramButton:kt=!1,hidetoolBar:Wt=!1,fullScreen:vn=!1,onBlur:xn,onCMBeforeChange:Cn,onFullScreen:Lt,className:ln="",disablePaste:it=!1,disabled:wt=!1,disabledFill:Et=!1,placeholder:At="",values:nn="",extraUse:_t,onAddBlank:tn})=>{const[Oe,yt]=(0,fe.useState)(null),[xt,Ot]=(0,fe.useState)(Jn),[Dt,Nt]=(0,fe.useState)(ke),[zt,gn]=(0,fe.useState)(vn),[wn,Dn]=(0,fe.useState)(""),[zn,er]=(0,fe.useState)(0),[cr,Un]=(0,fe.useState)($n),[Pn,fr]=(0,fe.useState)(!1),tr=(0,fe.useRef)((0,cn.Z)()),yr=(0,fe.useRef)(!1),Gn=(0,fe.useRef)(),[Xn,br]=(0,fe.useState)(0),[ur,Br]=(0,fe.useState)(0),Gr=(0,fe.useRef)(),ar=(0,fe.useRef)(),En=(0,fe.useRef)(),kn=(0,fe.useRef)(),gr=(0,fe.useRef)(),nr=(0,fe.useRef)(),_r=()=>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:",Oe,Gr),Vn.attachments.map(Zn=>{Zn.content_type.indexOf("image")>-1?Oe.replaceSelection(`![,](/api/attachments/${Zn.id}?type=${Zn.content_type})`):Zn.content_type.indexOf("video")>-1?Oe.replaceSelection(`<video width="100%" controls src="${pe.Z.API_SERVER}/api/attachments/${data.id}"></video>`):Zn.content_type.indexOf("pdf")>-1?Oe.replaceSelection(`<a href="${pe.Z.API_SERVER}/api/attachments/${Zn.id}?type=${Zn.content_type}&disposition=inline" target="_blank">${Zn.name}</a>`):Oe.replaceSelection(`[${Zn.name}](${pe.Z.API_SERVER}/api/attachments/${Zn.id}?type=${Zn.content_type})`)}))});(0,fe.useEffect)(()=>{const Yn=window.scrollY||window.pageYOffset;Ot(nn),Oe==null||Oe.setValue(nn),window.scrollTo(0,Yn)},[nn]),(0,fe.useEffect)(()=>{Lt==null||Lt(zt)},[zt]),(0,fe.useEffect)(()=>{if(Gr.current){let Yn=function(Zn,mr){var ni;if(it){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(),Ae=="stex")return;try{let ci=gi[1];((ni=gi[0])==null?void 0:ni.kind)==="file"&&(ci=gi[0]);const ki=ci.getAsFile(),Hi=ki.name.split(".").pop();(0,qe.I)(ki,Ni=>{var oa,Xr,ei;Ni.id?((oa=ki==null?void 0:ki.type)==null?void 0:oa.indexOf("image"))>-1?Vn.replaceSelection(`<img width="100%" src="/api/attachments/${Ni.id}?type=${Ni.content_type})" alt="" />`):((Xr=ki==null?void 0:ki.type)==null?void 0:Xr.indexOf("video"))>-1?Vn.replaceSelection(`<video width="100%" controls src="/api/attachments/${Ni.id}"></video>`):((ei=ki==null?void 0:ki.type)==null?void 0:ei.indexOf("pdf"))>-1?Vn.replaceSelection(`<a href="/api/attachments/${Ni.id}?type=${ki.type}&disposition=inline" target="_blank">${ki.name}</a>`):Mr.includes(Hi)?Vn.replaceSelection(`<a href="/api/attachments/${Ni.id}?type=office&disposition=inline" target="_blank">${ki.name}</a>`):Vn.replaceSelection(`[${ki.name}](/api/attachments/${Ni.id}?type=${Ni.content_type})`):(Ni==null?void 0:Ni.status)===401&&(Tt.ZP.warning((Ni==null?void 0:Ni.message)||"\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C"),document.location.href="/user/login")})}catch(ci){Tt.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const Vn=Fe().fromTextArea(Gr.current,{mode:Ae,lineNumbers:!wr,lineWrapping:!0,value:Jn,autoCloseTags:!kt,autoCloseBrackets:!0});return Vn.on("keyup",function(Zn,mr){mr.keyCode===8&&(Zn.getValue()==""?Vn.setOption("placeholder",At):Vn.setOption("placeholder",null))}),Vn.on("keydown",function(Zn,mr){if(mr.keyCode===8){var ni=Ir(Zn);ni&&mr.preventDefault()}}),ct&&Vn.focus(),Vn.on("paste",Yn),Vn.on("dragleave",function(Zn,mr){ar.current.classList.remove("mouse-hover-md")}),wt&&Vn.on("beforeChange",function(Zn,mr){(mr.origin==="paste"||mr.origin==="+input")&&mr.cancel()}),yt(Vn),()=>{Vn.off("paste",Yn)}}},[]);const Lr=(0,fe.useCallback)(()=>{if(ar.current)try{}catch(Yn){console.log(Yn,"---- to set md editor body height")}},[cr,ar,zt]);(0,fe.useEffect)(()=>{function Yn(){let Vn=new tt.Z(Zn=>{for(let mr of Zn)(mr.target.offsetHeight>0||mr.target.offsetWidth>0)&&(Lr(),Oe.setSize("100%","100%"),Oe.refresh())});return Vn.observe(Gr.current.parentElement),Vn}if(Oe){const Vn=Yn();return()=>{var Zn,mr;(Zn=Gr.current)!=null&&Zn.parentElement&&Vn.unobserve((mr=Gr.current)==null?void 0:mr.parentElement)}}},[Oe,Lr]),(0,fe.useEffect)(()=>{if(Oe){let Yn=[];for(const[Vn,Zn]of Object.entries(Er)){let mr={[Vn]:()=>{pr(Zn)}};Yn.push(mr),Oe.addKeyMap(mr)}return Gn.current=setInterval(()=>{yr.current&&_r()},4e3),()=>{clearInterval(Gn.current);for(let Vn of Yn)Oe.removeKeyMap(Vn)}}},[Oe]),(0,fe.useEffect)(()=>{vn!==zt&&gn(vn)},[vn]),(0,Ln.Z)(()=>{if(!dt&&zn>0){let Yn=new Date().getTime(),Vn=window.sessionStorage.getItem(Ie);Yn>=zn+hr&&(!Vn||Vn!==xt)&&(window.sessionStorage.setItem(Ie,xt),fr(!0))}},hr),(0,fe.useEffect)(()=>{Nt(ke)},[Oe,ke]),(0,fe.useEffect)(()=>{Oe&&ct&&Oe.focus()},[Oe,ct]),(0,fe.useEffect)(()=>{if(Dt&&Oe){let Yn=function(Zn){let mr=Zn.target;if(kn.current){let ni=mr.scrollTop/mr.scrollHeight;kn.current.scrollTop=kn.current.scrollHeight*ni}};const Vn=Oe.getScrollerElement();return Vn.addEventListener("scroll",Yn),()=>{Vn.removeEventListener("scroll",Yn)}}},[Oe,Dt]),(0,fe.useEffect)(()=>{if(Oe&&Cn){let Yn=function(Vn,Zn){Cn(Vn,Zn)};return Oe.on("beforeChange",Yn),()=>{Oe.off("beforeChange",Yn)}}},[Oe,Cn]),(0,fe.useEffect)(()=>{if(Oe&&xn){let Yn=function(){xn(Oe.getValue())};return Oe.on("blur",Yn),()=>{Oe.off("blur",Yn)}}},[Oe,xn]);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,ki=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+ki;return Zn.replaceRange("",{line:mr.line,ch:ci},{line:mr.line,ch:Hi}),{line:mr.line,ch:Hi}}return null}(0,fe.useEffect)(()=>{if(Oe){let Yn=function(Vn,Zn){const mr=Vn.getValue();Ot(mr),er(new Date().getTime()),Vn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),lr&&(kt?lr(mr,di(mr)):lr(mr))};return Oe.on("change",Yn),()=>{Oe.off("change",Yn)}}},[Oe,lr]),(0,fe.useEffect)(()=>{if(Oe)if(Jn==null)Oe.setValue(""),Ot("");else{const Yn=window.scrollY||window.pageYOffset;Jn!==Oe.getValue()&&(Oe.setValue(Jn),Ot(Jn),Oe.setCursor(wt?1:Oe.lineCount(),0),window.scrollTo(0,Yn))}},[Oe,Jn]);const pr=(0,fe.useCallback)(Yn=>{const Vn=Oe.getCursor(),Zn=Oe.getSelection();let mr=Zn.split(`
`);switch(Yn){case"bold":return Oe.replaceSelection("**"+Zn+"**"),Zn===""&&Oe.setCursor(Vn.line,Vn.ch+2),Oe.focus();case"italic":return Oe.replaceSelection("*"+Zn+"*"),Zn===""&&Oe.setCursor(Vn.line,Vn.ch+1),Oe.focus();case"code":return Oe.replaceSelection("`"+Zn+"`"),Zn===""&&Oe.setCursor(Vn.line,Vn.ch+1),Oe.focus();case"inline-latex":return Dn("inline-latex"),Oe.focus();case"latex":return Oe.replaceSelection("```latex\n"+Zn+"\n```"),Oe.setCursor(Vn.line+1,Zn.length+1),Oe.focus();case"line-break":return Oe.replaceSelection(`<br/>
`),Oe.focus();case"list-ul":return Zn===""?Oe.replaceSelection("- "+Zn):Oe.replaceSelection(mr.map(ni=>ni===""?"":`- ${ni}`).join(`
`)),Oe.focus();case"list-ol":return Zn===""?Oe.replaceSelection("1. "+Zn):Oe.replaceSelection(mr.map((ni,xi)=>ni===""?"":`${xi+1}. ${ni}`).join(`
`)),Oe.focus();case"add-null-ch":tn==null||tn();return;case"add-signal":return Zn===""&&Oe.setCursor(Vn.line,Vn.ch),Oe.replaceSelection(Hr),Oe.focus();case"add-multiple":return Zn===""&&Oe.setCursor(Vn.line,Vn.ch),Oe.replaceSelection(Tr),Oe.focus();case"inster-template-1":return Zn===""&&Oe.setCursor(Vn.line,Vn.ch),Oe.replaceSelection(sr),Oe.focus();case"eraser":return Oe.setValue(""),Oe.focus();case"trigger-watch":return Nt(!Dt),Oe.focus();case"trigger-full-screen":return gn(!zt),Oe.focus();case Sn:Dn(Sn);return;case Jt:Dn(Jt);return;case Ye:Dn(Ye);return;case Ue:Dn(Ue);return;case"maths-latex":Dn("maths-latex");return;case ze:gr.current="",sessionStorage.removeItem("file_id"),Dn(ze);return;case rn:Dn(rn);return;default:throw new Error}},[Oe,Dt,zt]),Sr=(0,fe.useCallback)((Yn,Vn)=>{var Zn,mr,ni,xi,Mi,gi;Dn("");const{src:ci,alt:ki,id:Hi}=Yn||{};switch(wn){case Sn:const{title:Ai,link:ai}=Yn;return Oe.replaceSelection(`[${Ai}](${ai})`),Oe.focus();case Jt:const{language:fi,content:_i}=Yn;return Oe.replaceSelection(["```"+fi,_i,"```"].join(`
`)),Oe.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,qe.I)(ei,oi=>{oi.id?Oe.replaceSelection(`![,](/api/attachments/${oi.id}?type=${oi.content_type})`):(oi==null?void 0:oi.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":Oe.replaceSelection("`$$"+Yn+"$$`");break;case Bt:if(!Hi)return;Oe.focus(),Oe.getValue().indexOf(ci)===-1?Oe.replaceSelection(`<center><img id="${Hi}" width="80%" src="${ci}" class="draw-flowchart" alt="${ki||""}" /></center>`):document.getElementById(Hi).src=pe.Z.API_SERVER+ci+"?t="+Date.now();try{setTimeout(()=>{xn(Oe.getValue())},100)}catch(oi){}break;case Ye:case Ue: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?Oe.replaceSelection(`<p style="text-align:${pi.align||"initial"}"><img width="${pi.width?pi.width+"%":"initial"}" src="${ci}" alt="${ki||""}" /></p>`):Oe.replaceSelection(`<img width="100%" src="${ci}" alt="${ki||""}" />`):((Mi=pi==null?void 0:pi.type)==null?void 0:Mi.indexOf("video"))>-1?Oe.replaceSelection(`<video width="100%" controls src="${ci}"></video>`):((gi=pi==null?void 0:pi.type)==null?void 0:gi.indexOf("pdf"))>-1?Oe.replaceSelection(`<a href="${ci}?type=${pi.type}&disposition=inline" target="_blank">${pi.name}</a>`):Mr.includes(Pr)?Oe.replaceSelection(`<a href="${ci}?type=office&disposition=inline" target="_blank">${pi.name}</a>`):Oe.replaceSelection(`[${pi.name}](${ci})`),Oe.focus();case rn: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(In[zr]),zi.push(" ");oi===1&&(ui+=`| ${Wi.join(" | ")} |
`),ui+=`| ${zi.join(Ur===1?"":" | ")} |
`}return Oe.replaceSelection(ui+`
`),Oe.focus();default:throw new Error}},[Oe,wn]),ii=(0,fe.useMemo)(()=>{switch(wn){case Sn:return fe.createElement(fn,{callback:Sr,onCancel:Hn});case Jt:return fe.createElement(Xt.Z,{callback:Sr,onCancel:Hn});case Ye:return fe.createElement(qe.Z,{callback:Sr,onCancel:Hn});case ze:return fe.createElement(de,{editImgId:gr.current,callback:Sr,onCancel:Hn});case rn:return fe.createElement(It,{callback:Sr,onCancel:Hn});case"maths-latex":return fe.createElement(_n,{showSaveButton:!0,callback:Sr});case"inline-latex":return fe.createElement(vt.Z,{showSaveButton:!0,callback:Sr});default:return null}},[wn]);function Hn(){Dn("")}(0,fe.useEffect)(()=>{if(En.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=En.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)}}},[Oe,En]),(0,fe.useEffect)(()=>{Un($n)},[$n]);const qn=rr(Rn),Dr=rr(cr),$r={width:qn,height:Dr},li=(0,fe.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(kt){let Zn=-1;Yn=Yn.replace(/(@▁▁@|@▁@)/g,function(mr,ni,xi){Vn.push({multiLine:mr!==Hr})})}return Vn};function ri(){window.sessionStorage.removeItem(Ie),fr(!1),er(0)}function Jr(){fr(!1),er(0),Oe.setValue(window.sessionStorage.getItem(Ie))}(0,fe.useEffect)(()=>{jr[wn]&&wn!==Ue&&wn!==ze&&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 fe.createElement(fe.Fragment,null,fe.createElement("div",{className:"markdown-editor-wrapper",ref:ar},fe.createElement("div",{className:`markdown-editor-container ${ln} ${Dt?"on-preview":""} ${wr?"mini":""} ${zt?"full-screen":""}`,style:$r},fe.createElement(et,{insertTemp:Be,watch:Dt,fullScreen:zt,showNullButton:Ht,showNullProgramButton:kt,onActionCallback:pr,hidetoolBar:Wt,extraUse:_t}),fe.createElement("div",{className:"markdown-editor-body"},fe.createElement("div",{className:"codemirror-container"},fe.createElement("textarea",{ref:Gr,placeholder:At})),Dt?fe.createElement("div",{ref:kn,className:"preview-container"},Ae==="stex"&&fe.createElement(Te,{value:xt}),Ae!=="stex"&&fe.createElement(rt.Z,{edit:!0,disabledFill:Et,showProgramFill:kt,value:xt,openEditor:Yn=>{var Vn;gr.current=Yn,(Vn=nr.current)==null||Vn.setHeight("100vh"),setTimeout(()=>{Dn("add-flowchart")},150)}})):null))),Xe?fe.createElement("a",{ref:En,className:"editor-resize"}):null,wn===Ue&&fe.createElement(pn,{callback:Sr,onCancel:Hn}),wn===ze&&fe.createElement(de,{ref:nr,editImgId:gr.current,callback:Sr,onCancel:Hn}),fe.createElement(Mt.Z,null,jr[wn]&&wn!==Ue&&wn!==ze?fe.createElement(je.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:Xn,top:ur},title:fe.createElement("div",{style:{cursor:"move"},onMouseDown:yi},jr[wn]),open:!0,onCancel:Hn,footer:null,destroyOnClose:!0,width:wn===ze?"1200px":null,height:wn===ze?"80vh":null,className:"markdown-popup-form"},ii):null))}},52999:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return We},I:function(){return Mt}});var fe=ue(78241),Ze=ue(8591),Fe=ue(92832),tt=ue(81327),be=ue(5871),Le=ue(5112),Re=ue(3113),Se=ue(25676),Me=ue(59301),Pe=ue(16624),rt=ue(59301),Te=Object.defineProperty,He=Object.defineProperties,ht=Object.getOwnPropertyDescriptors,Je=Object.getOwnPropertySymbols,lt=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable,Rt=(Qe,Kt,ut)=>Kt in Qe?Te(Qe,Kt,{enumerable:!0,configurable:!0,writable:!0,value:ut}):Qe[Kt]=ut,qt=(Qe,Kt)=>{for(var ut in Kt||(Kt={}))lt.call(Kt,ut)&&Rt(Qe,ut,Kt[ut]);if(Je)for(var ut of Je(Kt))st.call(Kt,ut)&&Rt(Qe,ut,Kt[ut]);return Qe},at=(Qe,Kt)=>He(Qe,ht(Kt));const{useForm:ft}=fe.default,Ve={width:280,marginRight:10},_e={labelCol:{span:5},wrapperCol:{span:19}};var We=({callback:Qe,onCancel:Kt})=>{const[ut]=ft();let Pt=(0,Me.useRef)();function nt(on){Pt.current.width=ut.getFieldValue("width"),Pt.current.align=ut.getFieldValue("align"),Qe(on,Pt.current)}function Gt(on,sn){if(on.status===-1){Ze.ZP.error(on.message);return}ut.setFieldsValue({src:`/api/attachments/${on.id}`,type:sn.type})}function mn(on){let sn=on.target.files[0];Pt.current=sn,Mt(sn,Gt)}return rt.createElement(fe.default,at(qt({form:ut},_e),{className:"upload-image-panel",onFinish:nt,style:{width:470,overflow:"hidden"}}),rt.createElement(fe.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},rt.createElement("div",{className:"flex-container"},rt.createElement(fe.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},rt.createElement(Fe.default,{style:Ve})),rt.createElement(et,{onFileChange:mn}))),rt.createElement(fe.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},rt.createElement(Fe.default,{style:{width:264}})),rt.createElement(fe.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},rt.createElement(tt.Z,null,rt.createElement(fe.default.Item,{name:"width",style:{margin:0}},rt.createElement(be.Z,{style:{width:264}})),rt.createElement("span",{className:"ml8"},"%"))),rt.createElement(fe.default.Item,{label:"\u5BF9\u9F50\u65B9\u5F0F",name:"align"},rt.createElement(Le.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"}]})),rt.createElement("aside",null,rt.createElement(fe.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},rt.createElement(Re.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),rt.createElement(Re.ZP,{type:"default",onClick:Kt},"\u53D6\u6D88"))))};function et({onFileChange:Qe}){return rt.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",rt.createElement("input",{type:"file",onChange:Qe}))}function Mt(Qe,Kt){if(!Qe)throw new String("\u6CA1\u6709\u6587\u4EF6");if(!(0,Pe.bg)())throw Ze.ZP.warning("\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C"),new String("\u8BF7\u767B\u5F55\u540E\u518D\u64CD\u4F5C");let ut=new FormData;ut.append("editormd-image-file",Qe),ut.append("file_param_name","editormd-image-file"),ut.append("byxhr","true");var Pt=new window.XMLHttpRequest;Pt.withCredentials=!0,Pt.addEventListener("load",function(nt){Kt(JSON.parse(nt.target.responseText),Qe)},!1),Pt.addEventListener("error",function(nt){console.error(nt)},!1),Pt.open("POST",`${Se.KI}/api/attachments.json`),Pt.send(ut)}},61569:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Fe}});var fe=ue(59301),Ze=ue(4676);class Fe extends fe.Component{constructor(be){super(be);const Le=window.document;this.node=Le.createElement("div"),Le.body.appendChild(this.node)}render(){const{children:be}=this.props;return(0,Ze.createPortal)(be,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},29152:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Ze}});var fe=ue(59301);function Ze(Fe,tt){const be=(0,fe.useRef)();(0,fe.useEffect)(()=>{be.current=Fe}),(0,fe.useEffect)(()=>{function Le(){be.current()}if(tt!==null){let Re=setInterval(Le,tt);return()=>clearInterval(Re)}},[tt])}},65007:function(Mn,Qt,ue){"use strict";ue.r(Qt),ue.d(Qt,{default:function(){return qe}});var fe=ue(59301),Ze=ue(20834),Fe=ue(44e3),tt=ue(8591),be=ue(43418),Le=ue(60324),Re=ue(11662),Se={flex_box_center:"flex_box_center___GfbI9",flex_space_between:"flex_space_between___m14JJ",flex_box_vertical_center:"flex_box_vertical_center___IKGDg",flex_box_center_end:"flex_box_center_end___JZxvM",flex_box_column:"flex_box_column___WnVa8",SubMentItem:"SubMentItem___P0LXo",MenuItem:"MenuItem___p91mQ",wrp:"wrp___kMQ4i",classroomInfo:"classroomInfo___rb1qC",title:"title___AQndp",titleLeft:"titleLeft___K7c9u",titleRight:"titleRight___BUODH",classroomUser:"classroomUser___NkYxe",headPic:"headPic___RD_it",teacherInfo:"teacherInfo___Gyj_W",classroomDesc:"classroomDesc___ng_AB",classroomDescBg:"classroomDescBg___Dz_DM",joinCouses:"joinCouses___U2D0G",bg:"bg___IcypX",leftMenus:"leftMenus___fF5qD",titleSelected:"titleSelected___Rqtd8",menuText:"menuText___jhrfq",totalCount:"totalCount___fqkbl",actions:"actions___NAYZl",task_count:"task_count___a1sYB",container:"container___djeCS",leftMenuActions:"leftMenuActions___lRhBF"},Me=ue(64866),Pe=ue(90115),rt=ue(87169),Te=ue(43531),He=ue(16624),ht=ue(92832),Je=(je,gt,en)=>new Promise((Zt,pn)=>{var Vt=ge=>{try{Tt(en.next(ge))}catch(se){pn(se)}},Ft=ge=>{try{Tt(en.throw(ge))}catch(se){pn(se)}},Tt=ge=>ge.done?Zt(ge.value):Promise.resolve(ge.value).then(Vt,Ft);Tt((en=en.apply(je,gt)).next())});function lt({user:je,CategoryId:gt,IsShow:en,setIsShow:Zt,dispatch:pn,init:Vt}){const[Ft,Tt]=(0,fe.useState)();return fe.createElement(be.default,{title:gt?"\u65B0\u5EFA\u4E09\u7EA7\u7C7B\u76EE":"\u65B0\u5EFA\u4E8C\u7EA7\u7C7B\u76EE",width:424,onCancel:()=>{Zt(!1)},onOk:()=>Je(this,null,function*(){if(!Ft){tt.ZP.error("\u680F\u76EE\u540D\u4E0D\u80FD\u4E3A\u7A7A");return}(yield(0,Me.ZP)("/api/programas.json",{method:"post",body:{name:Ft,parent_id:gt}})).status===0&&(tt.ZP.info("\u521B\u5EFA\u6210\u529F"),Zt(!1),Tt(""),Vt())}),open:en},fe.createElement(ht.default,{value:Ft,onChange:ge=>Tt(ge.target.value),placeholder:"\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC710\u4E2A\u6C49\u5B57\u7684\u540D\u79F0",maxLength:10}))}var st=(0,Pe.connect)(({user:je})=>({user:je}))(lt),Rt=(je,gt,en)=>new Promise((Zt,pn)=>{var Vt=ge=>{try{Tt(en.next(ge))}catch(se){pn(se)}},Ft=ge=>{try{Tt(en.throw(ge))}catch(se){pn(se)}},Tt=ge=>ge.done?Zt(ge.value):Promise.resolve(ge.value).then(Vt,Ft);Tt((en=en.apply(je,gt)).next())});function qt({user:je,CategoryId:gt,name:en,IsShow:Zt,setIsShow:pn,dispatch:Vt,init:Ft}){const[Tt,ge]=(0,fe.useState)();return(0,fe.useEffect)(()=>{ge(en)},[en]),fe.createElement(be.default,{title:"\u76EE\u5F55\u91CD\u547D\u540D",width:424,onCancel:()=>{pn(!1)},onOk:()=>Rt(this,null,function*(){if(!Tt){tt.ZP.error("\u680F\u76EE\u540D\u4E0D\u80FD\u4E3A\u7A7A");return}(yield(0,Me.ZP)(`/api/programas/${gt}/rename.json`,{method:"put",body:{name:Tt,id:gt}})).status===0&&(tt.ZP.info("\u4FEE\u6539\u6210\u529F"),pn(!1),ge(""),Ft())}),open:Zt},fe.createElement(ht.default,{value:Tt,onChange:se=>ge(se.target.value),placeholder:"\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC710\u4E2A\u6C49\u5B57\u7684\u540D\u79F0",maxLength:10}))}var at=(0,Pe.connect)(({user:je})=>({user:je}))(qt),ft=ue(3113),Ve=ue(9200);function _e({user:je,ItemData:gt,setIssee:en,dispatch:Zt,init:pn}){var Vt,Ft,Tt,ge;return fe.createElement("div",null,fe.createElement("div",{style:{textAlign:"right"}},(0,He.Ny)()&&fe.createElement(ft.ZP,{onClick:()=>en(!1)},"\u7F16\u8F91")),fe.createElement(Ve.Z,{value:gt.content}),((Vt=gt==null?void 0:gt.attachment)==null?void 0:Vt.id)&&fe.createElement("div",null,fe.createElement("a",{href:(Ft=gt==null?void 0:gt.attachment)==null?void 0:Ft.url,target:"_self",download:(Tt=gt==null?void 0:gt.attachment)==null?void 0:Tt.title},fe.createElement("i",{style:{color:"#29BD8B"},className:"font-14 color-green iconfont icon-fujian mr8"}),fe.createElement("span",{style:{color:"#000000"}},(ge=gt==null?void 0:gt.attachment)==null?void 0:ge.title))))}var We=(0,Pe.connect)(({user:je})=>({user:je}))(_e),et=ue(54580),Mt=ue(98263),Qe=ue(79439),Kt=Object.defineProperty,ut=Object.getOwnPropertySymbols,Pt=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,Gt=(je,gt,en)=>gt in je?Kt(je,gt,{enumerable:!0,configurable:!0,writable:!0,value:en}):je[gt]=en,mn=(je,gt)=>{for(var en in gt||(gt={}))Pt.call(gt,en)&&Gt(je,en,gt[en]);if(ut)for(var en of ut(gt))nt.call(gt,en)&&Gt(je,en,gt[en]);return je},on=(je,gt,en)=>new Promise((Zt,pn)=>{var Vt=ge=>{try{Tt(en.next(ge))}catch(se){pn(se)}},Ft=ge=>{try{Tt(en.throw(ge))}catch(se){pn(se)}},Tt=ge=>ge.done?Zt(ge.value):Promise.resolve(ge.value).then(Vt,Ft);Tt((en=en.apply(je,gt)).next())});function sn({user:je,ItemData:gt,setIssee:en,CategoryId:Zt,dispatch:pn,init:Vt}){let[Ft,Tt]=(0,fe.useState)([]);const[ge,se]=(0,fe.useState)(gt.content);function oe(){var De;let ot=[];return(De=gt==null?void 0:gt.attachments)==null||De.map($t=>{let It={uid:$t==null?void 0:$t.id,name:$t.title,response:{id:$t.id}};ot.push(It)}),ot}const de={name:"file",multiple:!0,action:Re.Z.API_SERVER+"/api/attachments.json",defaultFileList:oe(),onRemove(De){(0,Qe.y8)({id:De.uid})},onChange(De){console.log("info",De);const{status:ot}=De.file;ot==="removed"&&Tt(De.fileList),ot==="done"?(Tt(De.fileList),tt.ZP.success(`${De.file.name} \u6587\u4EF6\u4E0A\u4F20\u6210\u529F`)):ot==="error"&&tt.ZP.error(`${De.file.name} \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25`)},beforeUpload:De=>{const ot=De.size/1024/1024<150;return ot||tt.ZP.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E150MB"),ot}};function pe(){return on(this,null,function*(){(yield(0,Me.ZP)(`/api/programas/${Zt}/update_content.json`,{method:"put",body:{id:Zt,content:ge,attachment_id:le(Ft)}}))&&(tt.ZP.info("\u63D0\u4EA4\u6210\u529F"),en(!0))})}function le(De){let ot;return De&&De.map($t=>{ot=$t.response.id}),ot}return fe.createElement("div",null,fe.createElement(Mt.Z,{defaultValue:ge,onChange:De=>se(De)}),fe.createElement(et.default,mn({},de),fe.createElement(ft.ZP,{className:"uploadBtn"},"\u4E0A\u4F20\u9644\u4EF6"),"(\u5355\u4E2A\u6587\u4EF6150M\u4EE5\u5185)"),fe.createElement("p",{style:{marginTop:"10px"}},fe.createElement(ft.ZP,{style:{width:"90px"},onClick:()=>pe()},"\u63D0\u4EA4"),fe.createElement(ft.ZP,{style:{marginLeft:"30px",width:"90px"},type:"primary",onClick:()=>en(!0)},"\u53D6\u6D88")))}var jt=(0,Pe.connect)(({user:je})=>({user:je}))(sn),Ke=(je,gt,en)=>new Promise((Zt,pn)=>{var Vt=ge=>{try{Tt(en.next(ge))}catch(se){pn(se)}},Ft=ge=>{try{Tt(en.throw(ge))}catch(se){pn(se)}},Tt=ge=>ge.done?Zt(ge.value):Promise.resolve(ge.value).then(Vt,Ft);Tt((en=en.apply(je,gt)).next())});const{SubMenu:xe}=Ze.default,{Content:bt,Sider:fn}=Fe.default;function Xt({user:je,dispatch:gt,globalSetting:en}){var Zt;const[pn,Vt]=(0,fe.useState)(),[Ft,Tt]=(0,fe.useState)(!1),[ge,se]=(0,fe.useState)();let[oe,de]=(0,fe.useState)();const[pe,le]=(0,fe.useState)(!1),[De,ot]=(0,fe.useState)(""),[$t,It]=(0,fe.useState)(""),[Ut,Yt]=(0,fe.useState)(!0);(0,fe.useEffect)(()=>{dn()},[]),console.log("globalSetting",en);function dn(){return Ke(this,null,function*(){const Sn=yield(0,Me.ZP)("/api/programas.json",{method:"get"});Sn&&se(Sn==null?void 0:Sn.programas)})}const hn=(Sn,Ye,ze)=>Ke(this,null,function*(){switch(Sn){case 1:de(Ye==null?void 0:Ye.id),Tt(!0);break;case 2:de(Ye==null?void 0:Ye.id),le(!0),ot(Ye==null?void 0:Ye.name);break;case 3:(yield(0,Me.ZP)(`/api/programas/${Ye==null?void 0:Ye.id}/top.json`,{method:"post",body:{id:Ye==null?void 0:Ye.id}})).status===0&&dn();break;case 4:_n(fe.createElement("p",null,"\u5220\u9664\u4E4B\u540E\u4E0D\u80FD\u6062\u590D,",fe.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),()=>Ke(this,null,function*(){(yield(0,Me.ZP)(`/api/programas/${Ye==null?void 0:Ye.id}.json`,{method:"delete",body:{id:Ye==null?void 0:Ye.id}})).status===0&&(tt.ZP.info("\u5220\u9664\u6210\u529F"),dn())}));break}}),_n=(Sn,Ye)=>{be.default.confirm({centered:!0,title:"\u63D0\u793A",icon:fe.createElement(rt.Z,null),content:Sn,okText:"\u786E\u8BA4",onOk:()=>Ye(),cancelText:"\u53D6\u6D88"})},vt=(Sn,Ye)=>fe.createElement("div",{className:Se.leftMenuActions},Ye===1&&fe.createElement("p",{className:"current",onClick:()=>hn(1,Sn,Ye)},"\u65B0\u5EFA"),fe.createElement("p",{className:"current",onClick:()=>hn(2,Sn,Ye)},"\u91CD\u547D\u540D"),fe.createElement("p",{className:"current",onClick:()=>hn(3,Sn,Ye)},"\u7F6E\u9876"),fe.createElement("p",{className:"current",onClick:()=>hn(4,Sn,Ye)},"\u5220\u9664"));function cn(){return Ke(this,null,function*(){const Sn=yield(0,Me.ZP)(`/api/programas/${oe}/content.json`,{method:"get",params:{id:oe}});Sn&&It(Sn)})}return fe.createElement("div",{style:{marginBottom:"40px"}},fe.createElement("img",{style:{width:"100%"},src:Re.Z.IMG_SERVER+`/${(Zt=en==null?void 0:en.setting)==null?void 0:Zt.shixun_banner_url}`}),fe.createElement("div",{className:"edu-container minH500",style:{display:"flex",width:"1200px"}},fe.createElement(fn,{width:244,className:Se.leftMenus,style:{background:"none",marginTop:"20px",height:"auto"}},fe.createElement(Ze.default,{mode:"inline"},ge==null?void 0:ge.map((Sn,Ye)=>{var ze,Ue;return(Sn==null?void 0:Sn.children.length)>0?fe.createElement(xe,{title:fe.createElement("span",{className:"font16"},fe.createElement("span",null,Sn.name),!(0,He.Ny)()&&fe.createElement("span",null),(0,He.Ny)()&&fe.createElement(Le.Z,{placement:"right",content:()=>vt(Sn,1),trigger:"hover"},fe.createElement("span",{className:["iconfont icon-sandian",Se.actions].join(" ")})))},(ze=Sn==null?void 0:Sn.children)==null?void 0:ze.map((Bt,Jt)=>{var rn;return fe.createElement(Ze.default.Item,{className:(rn=Se)==null?void 0:rn.SubMentItem,onClick:()=>{de(Bt==null?void 0:Bt.id),oe=Bt==null?void 0:Bt.id,cn()}},fe.createElement("span",{style:{flex:"1"}},Bt==null?void 0:Bt.name),(0,He.Ny)()&&fe.createElement(Le.Z,{placement:"right",content:()=>vt(Bt,2),trigger:"hover"},fe.createElement("span",{className:["iconfont icon-sandian",Se.actions].join(" ")})))})):fe.createElement(Ze.default.Item,{className:(Ue=Se)==null?void 0:Ue.SubMentItem,onClick:()=>{de(Sn==null?void 0:Sn.id),oe=Sn==null?void 0:Sn.id,cn()}},fe.createElement("span",{style:{flex:"1"}},Sn==null?void 0:Sn.name),(0,He.Ny)()&&fe.createElement(Le.Z,{placement:"right",content:()=>vt(Sn,1),trigger:"hover"},fe.createElement("span",{className:["iconfont icon-sandian",Se.actions].join(" ")})))}),fe.createElement(Ze.default.Item,{onClick:()=>{de(""),oe="",Tt(!0)},style:{color:"#0152d9",fontSize:"16px",height:"40px",display:"flex",alignItems:"center"},icon:fe.createElement(Te.Z,{style:{color:"#0152d9",fontSize:"16px"}})},"\u65B0\u589E\u4E8C\u7EA7\u7C7B\u76EE"))),fe.createElement("div",{style:{width:"937px",marginLeft:"17px",background:"#fff",padding:"20px"}},Ut&&fe.createElement(We,{ItemData:$t,setIssee:Yt}),Ut===!1&&fe.createElement(jt,{ItemData:$t,setIssee:Yt,CategoryId:oe}))),fe.createElement(st,{CategoryId:oe,IsShow:Ft,setIsShow:Tt,init:dn}),fe.createElement(at,{CategoryId:oe,name:De,IsShow:pe,setIsShow:le,init:dn}))}var qe=(0,Pe.connect)(({user:je,globalSetting:gt})=>({user:je,globalSetting:gt}))(Xt)},77578:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return fe}});const fe=Ze=>Ze?typeof Ze=="function"?Ze():Ze:null},56762:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Ze}});var fe=ue(59301);function Ze(){const[,Fe]=fe.useReducer(tt=>tt+1,0);return Fe}},19080:function(Mn,Qt,ue){"use strict";ue.d(Qt,{F:function(){return be},Z:function(){return tt}});var fe=ue(92310),Ze=ue.n(fe);const Fe=null;function tt(Le,Re,Se){return Ze()({[`${Le}-status-success`]:Re==="success",[`${Le}-status-warning`]:Re==="warning",[`${Le}-status-error`]:Re==="error",[`${Le}-status-validating`]:Re==="validating",[`${Le}-has-feedback`]:Se})}const be=(Le,Re)=>Re||Le},93891:function(Mn,Qt,ue){"use strict";var fe=ue(59301),Ze=ue(36355),Fe=ue(64165);const tt=be=>{const{componentName:Le}=be,{getPrefixCls:Re}=(0,fe.useContext)(Ze.E_),Se=Re("empty");switch(Le){case"Table":case"List":return fe.createElement(Fe.Z,{image:Fe.Z.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return fe.createElement(Fe.Z,{image:Fe.Z.PRESENTED_IMAGE_SIMPLE,className:`${Se}-small`});default:return fe.createElement(Fe.Z,null)}};Qt.Z=tt},43428:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Vt}});var fe=ue(92310),Ze=ue.n(fe),Fe=ue(33885),tt=ue(42978),be=ue(43403),Le=ue(34280),Re=ue(59301),Se=Re.createContext(null),Me=Re.createContext({}),Pe=Se,rt=ue(20068),Te=ue(54476),He=ue(77900),ht=ue(10228),Je=ue(26112),lt=ue(70425),st=function(Tt){var ge=Tt.prefixCls,se=Tt.className,oe=Tt.style,de=Tt.children,pe=Tt.containerRef,le=Tt.id,De=Tt.onMouseEnter,ot=Tt.onMouseOver,$t=Tt.onMouseLeave,It=Tt.onClick,Ut=Tt.onKeyDown,Yt=Tt.onKeyUp,dn={onMouseEnter:De,onMouseOver:ot,onMouseLeave:$t,onClick:It,onKeyDown:Ut,onKeyUp:Yt},hn=Re.useContext(Me),_n=hn.panel,vt=(0,lt.useComposeRef)(_n,pe);return Re.createElement(Re.Fragment,null,Re.createElement("div",(0,Te.Z)({id:le,className:Ze()("".concat(ge,"-content"),se),style:(0,Fe.Z)({},oe),"aria-modal":"true",role:"dialog",ref:vt},dn),de))},Rt=st,qt=ue(48736);function at(Ft){return typeof Ft=="string"&&String(Number(Ft))===Ft?((0,qt.ZP)(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(Ft)):Ft}function ft(Ft){warning(!("wrapperClassName"in Ft),"'wrapperClassName' is removed. Please use 'rootClassName' instead."),warning(canUseDom()||!Ft.open,"Drawer with 'open' in SSR is not work since no place to createPortal. Please move to 'useEffect' instead.")}var Ve={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function _e(Ft,Tt){var ge,se,oe,de,pe=Ft.prefixCls,le=Ft.open,De=Ft.placement,ot=Ft.inline,$t=Ft.push,It=Ft.forceRender,Ut=Ft.autoFocus,Yt=Ft.keyboard,dn=Ft.rootClassName,hn=Ft.rootStyle,_n=Ft.zIndex,vt=Ft.className,cn=Ft.id,Sn=Ft.style,Ye=Ft.motion,ze=Ft.width,Ue=Ft.height,Bt=Ft.children,Jt=Ft.contentWrapperStyle,rn=Ft.mask,An=Ft.maskClosable,In=Ft.maskMotion,Ln=Ft.maskClassName,Fn=Ft.maskStyle,jn=Ft.afterOpenChange,Tn=Ft.onClose,hr=Ft.onMouseEnter,kr=Ft.onMouseOver,Tr=Ft.onMouseLeave,Hr=Ft.onClick,sr=Ft.onKeyDown,Mr=Ft.onKeyUp,rr=Re.useRef(),Or=Re.useRef(),Fr=Re.useRef();Re.useImperativeHandle(Tt,function(){return rr.current});var Er=function(kt){var Wt=kt.keyCode,vn=kt.shiftKey;switch(Wt){case ht.Z.TAB:{if(Wt===ht.Z.TAB){if(!vn&&document.activeElement===Fr.current){var xn;(xn=Or.current)===null||xn===void 0||xn.focus({preventScroll:!0})}else if(vn&&document.activeElement===Or.current){var Cn;(Cn=Fr.current)===null||Cn===void 0||Cn.focus({preventScroll:!0})}}break}case ht.Z.ESC:{Tn&&Yt&&(kt.stopPropagation(),Tn(kt));break}}};Re.useEffect(function(){if(le&&Ut){var Ht;(Ht=rr.current)===null||Ht===void 0||Ht.focus({preventScroll:!0})}},[le]);var jr=Re.useState(!1),Nr=(0,tt.Z)(jr,2),Jn=Nr[0],lr=Nr[1],Rn=Re.useContext(Pe),$n;$t===!1?$n={distance:0}:$t===!0?$n={}:$n=$t||{};var wr=(ge=(se=(oe=$n)===null||oe===void 0?void 0:oe.distance)!==null&&se!==void 0?se:Rn==null?void 0:Rn.pushDistance)!==null&&ge!==void 0?ge:180,ct=Re.useMemo(function(){return{pushDistance:wr,push:function(){lr(!0)},pull:function(){lr(!1)}}},[wr]);Re.useEffect(function(){if(le){var Ht;Rn==null||(Ht=Rn.push)===null||Ht===void 0||Ht.call(Rn)}else{var kt;Rn==null||(kt=Rn.pull)===null||kt===void 0||kt.call(Rn)}},[le]),Re.useEffect(function(){return function(){var Ht;Rn==null||(Ht=Rn.pull)===null||Ht===void 0||Ht.call(Rn)}},[]);var ke=rn&&Re.createElement(He.default,(0,Te.Z)({key:"mask"},In,{visible:le}),function(Ht,kt){var Wt=Ht.className,vn=Ht.style;return Re.createElement("div",{className:Ze()("".concat(pe,"-mask"),Wt,Ln),style:(0,Fe.Z)((0,Fe.Z)({},vn),Fn),onClick:An&&le?Tn:void 0,ref:kt})}),Be=typeof Ye=="function"?Ye(De):Ye,Ae={};if(Jn&&wr)switch(De){case"top":Ae.transform="translateY(".concat(wr,"px)");break;case"bottom":Ae.transform="translateY(".concat(-wr,"px)");break;case"left":Ae.transform="translateX(".concat(wr,"px)");break;default:Ae.transform="translateX(".concat(-wr,"px)");break}De==="left"||De==="right"?Ae.width=at(ze):Ae.height=at(Ue);var Ie={onMouseEnter:hr,onMouseOver:kr,onMouseLeave:Tr,onClick:Hr,onKeyDown:sr,onKeyUp:Mr},Xe=Re.createElement(He.default,(0,Te.Z)({key:"panel"},Be,{visible:le,forceRender:It,onVisibleChanged:function(kt){jn==null||jn(kt)},removeOnLeave:!1,leavedClassName:"".concat(pe,"-content-wrapper-hidden")}),function(Ht,kt){var Wt=Ht.className,vn=Ht.style;return Re.createElement("div",(0,Te.Z)({className:Ze()("".concat(pe,"-content-wrapper"),Wt),style:(0,Fe.Z)((0,Fe.Z)((0,Fe.Z)({},Ae),vn),Jt)},(0,Je.Z)(Ft,{data:!0})),Re.createElement(Rt,(0,Te.Z)({id:cn,containerRef:kt,prefixCls:pe,className:vt,style:Sn},Ie),Bt))}),dt=(0,Fe.Z)({},hn);return _n&&(dt.zIndex=_n),Re.createElement(Pe.Provider,{value:ct},Re.createElement("div",{className:Ze()(pe,"".concat(pe,"-").concat(De),dn,(de={},(0,rt.Z)(de,"".concat(pe,"-open"),le),(0,rt.Z)(de,"".concat(pe,"-inline"),ot),de)),style:dt,tabIndex:-1,ref:rr,onKeyDown:Er},ke,Re.createElement("div",{tabIndex:0,ref:Or,style:Ve,"aria-hidden":"true","data-sentinel":"start"}),Xe,Re.createElement("div",{tabIndex:0,ref:Fr,style:Ve,"aria-hidden":"true","data-sentinel":"end"})))}var We=Re.forwardRef(_e),et=We,Mt=function(Tt){var ge=Tt.open,se=ge===void 0?!1:ge,oe=Tt.prefixCls,de=oe===void 0?"rc-drawer":oe,pe=Tt.placement,le=pe===void 0?"right":pe,De=Tt.autoFocus,ot=De===void 0?!0:De,$t=Tt.keyboard,It=$t===void 0?!0:$t,Ut=Tt.width,Yt=Ut===void 0?378:Ut,dn=Tt.mask,hn=dn===void 0?!0:dn,_n=Tt.maskClosable,vt=_n===void 0?!0:_n,cn=Tt.getContainer,Sn=Tt.forceRender,Ye=Tt.afterOpenChange,ze=Tt.destroyOnClose,Ue=Tt.onMouseEnter,Bt=Tt.onMouseOver,Jt=Tt.onMouseLeave,rn=Tt.onClick,An=Tt.onKeyDown,In=Tt.onKeyUp,Ln=Tt.panelRef,Fn=Re.useState(!1),jn=(0,tt.Z)(Fn,2),Tn=jn[0],hr=jn[1],kr=Re.useState(!1),Tr=(0,tt.Z)(kr,2),Hr=Tr[0],sr=Tr[1];(0,Le.Z)(function(){sr(!0)},[]);var Mr=Hr?se:!1,rr=Re.useRef(),Or=Re.useRef();(0,Le.Z)(function(){Mr&&(Or.current=document.activeElement)},[Mr]);var Fr=function(lr){var Rn;if(hr(lr),Ye==null||Ye(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=Re.useMemo(function(){return{panel:Ln}},[Ln]);if(!Sn&&!Tn&&!Mr&&ze)return null;var jr={onMouseEnter:Ue,onMouseOver:Bt,onMouseLeave:Jt,onClick:rn,onKeyDown:An,onKeyUp:In},Nr=(0,Fe.Z)((0,Fe.Z)({},Tt),{},{open:Mr,prefixCls:de,placement:le,autoFocus:ot,keyboard:It,width:Yt,mask:hn,maskClosable:vt,inline:cn===!1,afterOpenChange:Fr,ref:rr},jr);return Re.createElement(Me.Provider,{value:Er},Re.createElement(be.Z,{open:Mr||Sn||Tn,autoDestroy:!1,getContainer:cn,autoLock:hn&&(Mr||Tn)},Re.createElement(et,Nr)))},Qe=Mt,Kt=Qe,ut=ue(62892),Pt=ue(36355),nt=ue(32441),Gt=ue(47729),on=Ft=>{const{prefixCls:Tt,title:ge,footer:se,extra:oe,closeIcon:de,closable:pe,onClose:le,headerStyle:De,drawerStyle:ot,bodyStyle:$t,footerStyle:It,children:Ut}=Ft,Yt=Re.useCallback(cn=>Re.createElement("button",{type:"button",onClick:le,"aria-label":"Close",className:`${Tt}-close`},cn),[le]),[dn,hn]=(0,Gt.Z)(pe,de,Yt,void 0,!0),_n=Re.useMemo(()=>!ge&&!dn?null:Re.createElement("div",{style:De,className:Ze()(`${Tt}-header`,{[`${Tt}-header-close-only`]:dn&&!ge&&!oe})},Re.createElement("div",{className:`${Tt}-header-title`},hn,ge&&Re.createElement("div",{className:`${Tt}-title`},ge)),oe&&Re.createElement("div",{className:`${Tt}-extra`},oe)),[dn,hn,oe,De,Tt,ge]),vt=Re.useMemo(()=>{if(!se)return null;const cn=`${Tt}-footer`;return Re.createElement("div",{className:cn,style:It},se)},[se,It,Tt]);return Re.createElement("div",{className:`${Tt}-wrapper-body`,style:ot},_n,Re.createElement("div",{className:`${Tt}-body`,style:$t},Ut),vt)},sn=ue(33234),jt=ue(83116),Ke=ue(37613),bt=Ft=>{const{componentCls:Tt,motionDurationSlow:ge}=Ft,se={"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${ge}`}}};return{[Tt]:{[`${Tt}-mask-motion`]:{"&-enter, &-appear, &-leave":{"&-active":{transition:`all ${ge}`}},"&-enter, &-appear":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}}},[`${Tt}-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 fn=Ft=>{const{componentCls:Tt,zIndexPopup:ge,colorBgMask:se,colorBgElevated:oe,motionDurationSlow:de,motionDurationMid:pe,padding:le,paddingLG:De,fontSizeLG:ot,lineHeightLG:$t,lineWidth:It,lineType:Ut,colorSplit:Yt,marginSM:dn,colorIcon:hn,colorIconHover:_n,colorText:vt,fontWeightStrong:cn,footerPaddingBlock:Sn,footerPaddingInline:Ye}=Ft,ze=`${Tt}-content-wrapper`;return{[Tt]:{position:"fixed",inset:0,zIndex:ge,pointerEvents:"none","&-pure":{position:"relative",background:oe,[`&${Tt}-left`]:{boxShadow:Ft.boxShadowDrawerLeft},[`&${Tt}-right`]:{boxShadow:Ft.boxShadowDrawerRight},[`&${Tt}-top`]:{boxShadow:Ft.boxShadowDrawerUp},[`&${Tt}-bottom`]:{boxShadow:Ft.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${Tt}-mask`]:{position:"absolute",inset:0,zIndex:ge,background:se,pointerEvents:"auto"},[ze]:{position:"absolute",zIndex:ge,maxWidth:"100vw",transition:`all ${de}`,"&-hidden":{display:"none"}},[`&-left > ${ze}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:Ft.boxShadowDrawerLeft},[`&-right > ${ze}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:Ft.boxShadowDrawerRight},[`&-top > ${ze}`]:{top:0,insetInline:0,boxShadow:Ft.boxShadowDrawerUp},[`&-bottom > ${ze}`]:{bottom:0,insetInline:0,boxShadow:Ft.boxShadowDrawerDown},[`${Tt}-content`]:{width:"100%",height:"100%",overflow:"auto",background:oe,pointerEvents:"auto"},[`${Tt}-wrapper-body`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%"},[`${Tt}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${le}px ${De}px`,fontSize:ot,lineHeight:$t,borderBottom:`${It}px ${Ut} ${Yt}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${Tt}-extra`]:{flex:"none"},[`${Tt}-close`]:{display:"inline-block",marginInlineEnd:dn,color:hn,fontWeight:cn,fontSize:ot,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,outline:0,cursor:"pointer",transition:`color ${pe}`,textRendering:"auto","&:focus, &:hover":{color:_n,textDecoration:"none"}},[`${Tt}-title`]:{flex:1,margin:0,color:vt,fontWeight:Ft.fontWeightStrong,fontSize:ot,lineHeight:$t},[`${Tt}-body`]:{flex:1,minWidth:0,minHeight:0,padding:De,overflow:"auto"},[`${Tt}-footer`]:{flexShrink:0,padding:`${Sn}px ${Ye}px`,borderTop:`${It}px ${Ut} ${Yt}`},"&-rtl":{direction:"rtl"}}}};var Xt=(0,jt.Z)("Drawer",Ft=>{const Tt=(0,Ke.TS)(Ft,{});return[fn(Tt),bt(Tt)]},Ft=>({zIndexPopup:Ft.zIndexPopupBase,footerPaddingBlock:Ft.paddingXS,footerPaddingInline:Ft.padding})),qe=ue(11575),je=function(Ft,Tt){var ge={};for(var se in Ft)Object.prototype.hasOwnProperty.call(Ft,se)&&Tt.indexOf(se)<0&&(ge[se]=Ft[se]);if(Ft!=null&&typeof Object.getOwnPropertySymbols=="function")for(var oe=0,se=Object.getOwnPropertySymbols(Ft);oe<se.length;oe++)Tt.indexOf(se[oe])<0&&Object.prototype.propertyIsEnumerable.call(Ft,se[oe])&&(ge[se[oe]]=Ft[se[oe]]);return ge};const gt=null,en={distance:180},Zt=Ft=>{var Tt;const{rootClassName:ge,width:se,height:oe,size:de="default",mask:pe=!0,push:le=en,open:De,afterOpenChange:ot,onClose:$t,prefixCls:It,getContainer:Ut,style:Yt,className:dn,visible:hn,afterVisibleChange:_n}=Ft,vt=je(Ft,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","style","className","visible","afterVisibleChange"]),{getPopupContainer:cn,getPrefixCls:Sn,direction:Ye,drawer:ze}=Re.useContext(Pt.E_),Ue=Sn("drawer",It),[Bt,Jt]=Xt(Ue),rn=Ut===void 0&&cn?()=>cn(document.body):Ut,An=Ze()({"no-mask":!pe,[`${Ue}-rtl`]:Ye==="rtl"},ge,Jt),In=Re.useMemo(()=>se!=null?se:de==="large"?736:378,[se,de]),Ln=Re.useMemo(()=>oe!=null?oe:de==="large"?736:378,[oe,de]),Fn={motionName:(0,ut.m)(Ue,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},jn=hr=>({motionName:(0,ut.m)(Ue,`panel-motion-${hr}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),Tn=(0,qe.H)();return Bt(Re.createElement(sn.BR,null,Re.createElement(nt.Ux,{status:!0,override:!0},Re.createElement(Kt,Object.assign({prefixCls:Ue,onClose:$t,maskMotion:Fn,motion:jn},vt,{open:De!=null?De:hn,mask:pe,push:le,width:In,height:Ln,style:Object.assign(Object.assign({},ze==null?void 0:ze.style),Yt),className:Ze()(ze==null?void 0:ze.className,dn),rootClassName:An,getContainer:rn,afterOpenChange:ot!=null?ot:_n,panelRef:Tn}),Re.createElement(on,Object.assign({prefixCls:Ue},vt,{onClose:$t}))))))},pn=Ft=>{const{prefixCls:Tt,style:ge,className:se,placement:oe="right"}=Ft,de=je(Ft,["prefixCls","style","className","placement"]),{getPrefixCls:pe}=Re.useContext(Pt.E_),le=pe("drawer",Tt),[De,ot]=Xt(le),$t=Ze()(le,`${le}-pure`,`${le}-${oe}`,ot,se);return De(Re.createElement("div",{className:$t,style:ge},Re.createElement(on,Object.assign({prefixCls:le},de))))};Zt._InternalPanelDoNotUseOrYouWillBeFired=pn;var Vt=Zt},64165:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return at}});var fe=ue(92310),Ze=ue.n(fe),Fe=ue(59301),tt=ue(36355),be=ue(9763),Le=ue(64993),Re=ue(88088),Me=()=>{const[,ft]=(0,Re.Z)(),_e=new Le.C(ft.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return Fe.createElement("svg",{style:_e,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},Fe.createElement("g",{fill:"none",fillRule:"evenodd"},Fe.createElement("g",{transform:"translate(24 31.67)"},Fe.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),Fe.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),Fe.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),Fe.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),Fe.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),Fe.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),Fe.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},Fe.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),Fe.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},rt=()=>{const[,ft]=(0,Re.Z)(),{colorFill:Ve,colorFillTertiary:_e,colorFillQuaternary:We,colorBgContainer:et}=ft,{borderColor:Mt,shadowColor:Qe,contentColor:Kt}=(0,Fe.useMemo)(()=>({borderColor:new Le.C(Ve).onBackground(et).toHexShortString(),shadowColor:new Le.C(_e).onBackground(et).toHexShortString(),contentColor:new Le.C(We).onBackground(et).toHexShortString()}),[Ve,_e,We,et]);return Fe.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},Fe.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},Fe.createElement("ellipse",{fill:Qe,cx:"32",cy:"33",rx:"32",ry:"7"}),Fe.createElement("g",{fillRule:"nonzero",stroke:Mt},Fe.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),Fe.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:Kt}))))},Te=ue(83116),He=ue(37613);const ht=ft=>{const{componentCls:Ve,margin:_e,marginXS:We,marginXL:et,fontSize:Mt,lineHeight:Qe}=ft;return{[Ve]:{marginInline:We,fontSize:Mt,lineHeight:Qe,textAlign:"center",[`${Ve}-image`]:{height:ft.emptyImgHeight,marginBottom:We,opacity:ft.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${Ve}-description`]:{color:ft.colorText},[`${Ve}-footer`]:{marginTop:_e},"&-normal":{marginBlock:et,color:ft.colorTextDisabled,[`${Ve}-description`]:{color:ft.colorTextDisabled},[`${Ve}-image`]:{height:ft.emptyImgHeightMD}},"&-small":{marginBlock:We,color:ft.colorTextDisabled,[`${Ve}-image`]:{height:ft.emptyImgHeightSM}}}}};var Je=(0,Te.Z)("Empty",ft=>{const{componentCls:Ve,controlHeightLG:_e}=ft,We=(0,He.TS)(ft,{emptyImgCls:`${Ve}-img`,emptyImgHeight:_e*2.5,emptyImgHeightMD:_e,emptyImgHeightSM:_e*.875});return[ht(We)]}),lt=function(ft,Ve){var _e={};for(var We in ft)Object.prototype.hasOwnProperty.call(ft,We)&&Ve.indexOf(We)<0&&(_e[We]=ft[We]);if(ft!=null&&typeof Object.getOwnPropertySymbols=="function")for(var et=0,We=Object.getOwnPropertySymbols(ft);et<We.length;et++)Ve.indexOf(We[et])<0&&Object.prototype.propertyIsEnumerable.call(ft,We[et])&&(_e[We[et]]=ft[We[et]]);return _e};const st=Fe.createElement(Me,null),Rt=Fe.createElement(rt,null),qt=ft=>{var{className:Ve,rootClassName:_e,prefixCls:We,image:et=st,description:Mt,children:Qe,imageStyle:Kt,style:ut}=ft,Pt=lt(ft,["className","rootClassName","prefixCls","image","description","children","imageStyle","style"]);const{getPrefixCls:nt,direction:Gt,empty:mn}=Fe.useContext(tt.E_),on=nt("empty",We),[sn,jt]=Je(on),[Ke]=(0,be.Z)("Empty"),xe=typeof Mt!="undefined"?Mt:Ke==null?void 0:Ke.description,bt=typeof xe=="string"?xe:"empty";let fn=null;return typeof et=="string"?fn=Fe.createElement("img",{alt:bt,src:et}):fn=et,sn(Fe.createElement("div",Object.assign({className:Ze()(jt,on,mn==null?void 0:mn.className,{[`${on}-normal`]:et===Rt,[`${on}-rtl`]:Gt==="rtl"},Ve,_e),style:Object.assign(Object.assign({},mn==null?void 0:mn.style),ut)},Pt),Fe.createElement("div",{className:`${on}-image`,style:Kt},fn),xe&&Fe.createElement("div",{className:`${on}-description`},xe),Qe&&Fe.createElement("div",{className:`${on}-footer`},Qe)))};qt.PRESENTED_IMAGE_DEFAULT=st,qt.PRESENTED_IMAGE_SIMPLE=Rt;var at=qt},78241:function(Mn,Qt,ue){"use strict";ue.d(Qt,{default:function(){return wr}});var fe=ue(94480),Ze=ue(92310),Fe=ue.n(Ze),tt=ue(77900),be=ue(59301),Le=ue(62892),Re=ue(32441);function Se(ct){const[ke,Be]=be.useState(ct);return be.useEffect(()=>{const Ae=setTimeout(()=>{Be(ct)},ct.length?0:10);return()=>{clearTimeout(Ae)}},[ct]),ke}var Me=ue(17313),Pe=ue(29878),rt=ue(8378),Te=ue(37613),He=ue(83116),Je=ct=>{const{componentCls:ke}=ct,Be=`${ke}-show-help`,Ae=`${ke}-show-help-item`;return{[Be]:{transition:`opacity ${ct.motionDurationSlow} ${ct.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[Ae]:{overflow:"hidden",transition:`height ${ct.motionDurationSlow} ${ct.motionEaseInOut},
opacity ${ct.motionDurationSlow} ${ct.motionEaseInOut},
transform ${ct.motionDurationSlow} ${ct.motionEaseInOut} !important`,[`&${Ae}-appear, &${Ae}-enter`]:{transform:"translateY(-5px)",opacity:0,"&-active":{transform:"translateY(0)",opacity:1}},[`&${Ae}-leave-active`]:{transform:"translateY(-5px)"}}}}};const lt=ct=>({legend:{display:"block",width:"100%",marginBottom:ct.marginLG,padding:0,color:ct.colorTextDescription,fontSize:ct.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:`${ct.lineWidth}px ${ct.lineType} ${ct.colorBorder}`},label:{fontSize:ct.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 ${ct.controlOutlineWidth}px ${ct.controlOutline}`},output:{display:"block",paddingTop:15,color:ct.colorText,fontSize:ct.fontSize,lineHeight:ct.lineHeight}}),st=(ct,ke)=>{const{formItemCls:Be}=ct;return{[Be]:{[`${Be}-label > label`]:{height:ke},[`${Be}-control-input`]:{minHeight:ke}}}},Rt=ct=>{const{componentCls:ke}=ct;return{[ct.componentCls]:Object.assign(Object.assign(Object.assign({},(0,Me.Wf)(ct)),lt(ct)),{[`${ke}-text`]:{display:"inline-block",paddingInlineEnd:ct.paddingSM},"&-small":Object.assign({},st(ct,ct.controlHeightSM)),"&-large":Object.assign({},st(ct,ct.controlHeightLG))})}},qt=ct=>{const{formItemCls:ke,iconCls:Be,componentCls:Ae,rootPrefixCls:Ie,labelRequiredMarkColor:Xe,labelColor:dt,labelFontSize:Ht,labelHeight:kt,labelColonMarginInlineStart:Wt,labelColonMarginInlineEnd:vn,itemMarginBottom:xn}=ct;return{[ke]:Object.assign(Object.assign({},(0,Me.Wf)(ct)),{marginBottom:xn,verticalAlign:"top","&-with-help":{transition:"none"},[`&-hidden,
&-hidden.${Ie}-row`]:{display:"none"},"&-has-warning":{[`${ke}-split`]:{color:ct.colorError}},"&-has-error":{[`${ke}-split`]:{color:ct.colorWarning}},[`${ke}-label`]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:`${ct.lineHeight} - 0.25em`,whiteSpace:"unset"},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:kt,color:dt,fontSize:Ht,[`> ${Be}`]:{fontSize:ct.fontSize,verticalAlign:"top"},[`&${ke}-required:not(${ke}-required-mark-optional)::before`]:{display:"inline-block",marginInlineEnd:ct.marginXXS,color:Xe,fontSize:ct.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"',[`${Ae}-hide-required-mark &`]:{display:"none"}},[`${ke}-optional`]:{display:"inline-block",marginInlineStart:ct.marginXXS,color:ct.colorTextDescription,[`${Ae}-hide-required-mark &`]:{display:"none"}},[`${ke}-tooltip`]:{color:ct.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:ct.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:Wt,marginInlineEnd:vn},[`&${ke}-no-colon::after`]:{content:'"\\a0"'}}},[`${ke}-control`]:{"--ant-display":"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${Ie}-col-'"]):not([class*="' ${Ie}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:ct.controlHeight,"&-content":{flex:"auto",maxWidth:"100%"}}},[ke]:{"&-explain, &-extra":{clear:"both",color:ct.colorTextDescription,fontSize:ct.fontSize,lineHeight:ct.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:ct.controlHeightSM,transition:`color ${ct.motionDurationMid} ${ct.motionEaseOut}`},"&-explain":{"&-error":{color:ct.colorError},"&-warning":{color:ct.colorWarning}}},[`&-with-help ${ke}-explain`]:{height:"auto",opacity:1},[`${ke}-feedback-icon`]:{fontSize:ct.fontSize,textAlign:"center",visibility:"visible",animationName:Pe.kr,animationDuration:ct.motionDurationMid,animationTimingFunction:ct.motionEaseOutBack,pointerEvents:"none","&-success":{color:ct.colorSuccess},"&-error":{color:ct.colorError},"&-warning":{color:ct.colorWarning},"&-validating":{color:ct.colorPrimary}}})}},at=ct=>{const{componentCls:ke,formItemCls:Be}=ct;return{[`${ke}-horizontal`]:{[`${Be}-label`]:{flexGrow:0},[`${Be}-control`]:{flex:"1 1 0",minWidth:0},[`${Be}-label[class$='-24'], ${Be}-label[class*='-24 ']`]:{[`& + ${Be}-control`]:{minWidth:"unset"}}}}},ft=ct=>{const{componentCls:ke,formItemCls:Be}=ct;return{[`${ke}-inline`]:{display:"flex",flexWrap:"wrap",[Be]:{flex:"none",marginInlineEnd:ct.margin,marginBottom:0,"&-row":{flexWrap:"nowrap"},[`> ${Be}-label,
> ${Be}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${Be}-label`]:{flex:"none"},[`${ke}-text`]:{display:"inline-block"},[`${Be}-has-feedback`]:{display:"inline-block"}}}}},Ve=ct=>({padding:ct.verticalLabelPadding,margin:ct.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),_e=ct=>{const{componentCls:ke,formItemCls:Be,rootPrefixCls:Ae}=ct;return{[`${Be} ${Be}-label`]:Ve(ct),[ke]:{[Be]:{flexWrap:"wrap",[`${Be}-label, ${Be}-control`]:{[`&:not([class*=" ${Ae}-col-xs"])`]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},We=ct=>{const{componentCls:ke,formItemCls:Be,rootPrefixCls:Ae}=ct;return{[`${ke}-vertical`]:{[Be]:{"&-row":{flexDirection:"column"},"&-label > label":{height:"auto"},[`${ke}-item-control`]:{width:"100%"}}},[`${ke}-vertical ${Be}-label,
.${Ae}-col-24${Be}-label,
.${Ae}-col-xl-24${Be}-label`]:Ve(ct),[`@media (max-width: ${ct.screenXSMax}px)`]:[_e(ct),{[ke]:{[`.${Ae}-col-xs-24${Be}-label`]:Ve(ct)}}],[`@media (max-width: ${ct.screenSMMax}px)`]:{[ke]:{[`.${Ae}-col-sm-24${Be}-label`]:Ve(ct)}},[`@media (max-width: ${ct.screenMDMax}px)`]:{[ke]:{[`.${Ae}-col-md-24${Be}-label`]:Ve(ct)}},[`@media (max-width: ${ct.screenLGMax}px)`]:{[ke]:{[`.${Ae}-col-lg-24${Be}-label`]:Ve(ct)}}}},et=(ct,ke)=>(0,Te.TS)(ct,{formItemCls:`${ct.componentCls}-item`,rootPrefixCls:ke});var Mt=(0,He.Z)("Form",(ct,ke)=>{let{rootPrefixCls:Be}=ke;const Ae=et(ct,Be);return[Rt(Ae),qt(Ae),Je(Ae),at(Ae),ft(Ae),We(Ae),(0,rt.Z)(Ae),Pe.kr]},ct=>({labelRequiredMarkColor:ct.colorError,labelColor:ct.colorTextHeading,labelFontSize:ct.fontSize,labelHeight:ct.controlHeight,labelColonMarginInlineStart:ct.marginXXS/2,labelColonMarginInlineEnd:ct.marginXS,itemMarginBottom:ct.marginLG,verticalLabelPadding:`0 0 ${ct.paddingXS}px`,verticalLabelMargin:0}),{order:-1e3});const Qe=[];function Kt(ct,ke,Be){let Ae=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof ct=="string"?ct:`${ke}-${Ae}`,error:ct,errorStatus:Be}}var Pt=ct=>{let{help:ke,helpStatus:Be,errors:Ae=Qe,warnings:Ie=Qe,className:Xe,fieldId:dt,onVisibleChanged:Ht}=ct;const{prefixCls:kt}=be.useContext(Re.Rk),Wt=`${kt}-item-explain`,[,vn]=Mt(kt),xn=(0,be.useMemo)(()=>(0,Le.Z)(kt),[kt]),Cn=Se(Ae),Lt=Se(Ie),ln=be.useMemo(()=>ke!=null?[Kt(ke,"help",Be)]:[].concat((0,fe.Z)(Cn.map((wt,Et)=>Kt(wt,"error","error",Et))),(0,fe.Z)(Lt.map((wt,Et)=>Kt(wt,"warning","warning",Et)))),[ke,Be,Cn,Lt]),it={};return dt&&(it.id=`${dt}_help`),be.createElement(tt.default,{motionDeadline:xn.motionDeadline,motionName:`${kt}-show-help`,visible:!!ln.length,onVisibleChanged:Ht},wt=>{const{className:Et,style:At}=wt;return be.createElement("div",Object.assign({},it,{className:Fe()(Wt,Et,Xe,vn),style:At,role:"alert"}),be.createElement(tt.CSSMotionList,Object.assign({keys:ln},(0,Le.Z)(kt),{motionName:`${kt}-show-help-item`,component:!1}),nn=>{const{key:_t,error:tn,errorStatus:Oe,className:yt,style:xt}=nn;return be.createElement("div",{key:_t,className:Fe()(yt,{[`${Wt}-${Oe}`]:Oe}),style:xt},tn)}))})},nt=ue(95013),Gt=ue(36355),mn=ue(1684),on=ue(52946),sn=ue(19716),jt=ue(16722);const Ke=["parentNode"],xe="form_item";function bt(ct){return ct===void 0||ct===!1?[]:Array.isArray(ct)?ct:[ct]}function fn(ct,ke){if(!ct.length)return;const Be=ct.join("_");return ke?`${ke}_${Be}`:Ke.includes(Be)?`${xe}_${Be}`:Be}function Xt(ct,ke,Be,Ae,Ie,Xe){let dt=Ae;return Xe!==void 0?dt=Xe:Be.validating?dt="validating":ct.length?dt="error":ke.length?dt="warning":(Be.touched||Ie&&Be.validated)&&(dt="success"),dt}function qe(ct){return bt(ct).join("_")}function je(ct){const[ke]=(0,nt.useForm)(),Be=be.useRef({}),Ae=be.useMemo(()=>ct!=null?ct:Object.assign(Object.assign({},ke),{__INTERNAL__:{itemRef:Ie=>Xe=>{const dt=qe(Ie);Xe?Be.current[dt]=Xe:delete Be.current[dt]}},scrollToField:function(Ie){let Xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const dt=bt(Ie),Ht=fn(dt,Ae.__INTERNAL__.name),kt=Ht?document.getElementById(Ht):null;kt&&(0,jt.Z)(kt,Object.assign({scrollMode:"if-needed",block:"nearest"},Xe))},getFieldInstance:Ie=>{const Xe=qe(Ie);return Be.current[Xe]}}),[ct,ke]);return[Ae]}var gt=ue(28726),en=function(ct,ke){var Be={};for(var Ae in ct)Object.prototype.hasOwnProperty.call(ct,Ae)&&ke.indexOf(Ae)<0&&(Be[Ae]=ct[Ae]);if(ct!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ie=0,Ae=Object.getOwnPropertySymbols(ct);Ie<Ae.length;Ie++)ke.indexOf(Ae[Ie])<0&&Object.prototype.propertyIsEnumerable.call(ct,Ae[Ie])&&(Be[Ae[Ie]]=ct[Ae[Ie]]);return Be};const Zt=(ct,ke)=>{const Be=be.useContext(mn.Z),{getPrefixCls:Ae,direction:Ie,form:Xe}=be.useContext(Gt.E_),{prefixCls:dt,className:Ht,rootClassName:kt,size:Wt,disabled:vn=Be,form:xn,colon:Cn,labelAlign:Lt,labelWrap:ln,labelCol:it,wrapperCol:wt,hideRequiredMark:Et,layout:At="horizontal",scrollToFirstError:nn,requiredMark:_t,onFinishFailed:tn,name:Oe,style:yt,feedbackIcons:xt}=ct,Ot=en(ct,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons"]),Dt=(0,sn.Z)(Wt),Nt=be.useContext(gt.Z),zt=(0,be.useMemo)(()=>_t!==void 0?_t:Xe&&Xe.requiredMark!==void 0?Xe.requiredMark:!Et,[Et,_t,Xe]),gn=Cn!=null?Cn:Xe==null?void 0:Xe.colon,wn=Ae("form",dt),[Dn,zn]=Mt(wn),er=Fe()(wn,`${wn}-${At}`,{[`${wn}-hide-required-mark`]:zt===!1,[`${wn}-rtl`]:Ie==="rtl",[`${wn}-${Dt}`]:Dt},zn,Xe==null?void 0:Xe.className,Ht,kt),[cr]=je(xn),{__INTERNAL__:Un}=cr;Un.name=Oe;const Pn=(0,be.useMemo)(()=>({name:Oe,labelAlign:Lt,labelCol:it,labelWrap:ln,wrapperCol:wt,vertical:At==="vertical",colon:gn,requiredMark:zt,itemRef:Un.itemRef,form:cr,feedbackIcons:xt}),[Oe,Lt,it,wt,At,gn,zt,cr,xt]);be.useImperativeHandle(ke,()=>cr);const fr=(yr,Gn)=>{if(yr){let Xn={block:"nearest"};typeof yr=="object"&&(Xn=yr),cr.scrollToField(Gn,Xn)}},tr=yr=>{if(tn==null||tn(yr),yr.errorFields.length){const Gn=yr.errorFields[0].name;if(nn!==void 0){fr(nn,Gn);return}Xe&&Xe.scrollToFirstError!==void 0&&fr(Xe.scrollToFirstError,Gn)}};return Dn(be.createElement(mn.n,{disabled:vn},be.createElement(on.q,{size:Dt},be.createElement(Re.RV,Object.assign({},{validateMessages:Nt}),be.createElement(Re.q3.Provider,{value:Pn},be.createElement(nt.default,Object.assign({id:Oe},Ot,{name:Oe,onFinishFailed:tr,form:cr,style:Object.assign(Object.assign({},Xe==null?void 0:Xe.style),yt),className:er})))))))};var Vt=be.forwardRef(Zt),Ft=ue(41799),Tt=ue(8654),ge=ue(92343),se=ue(11592);function oe(ct){if(typeof ct=="function")return ct;const ke=(0,se.Z)(ct);return ke.length<=1?ke[0]:ke}const de=()=>{const{status:ct,errors:ke=[],warnings:Be=[]}=(0,be.useContext)(Re.aM);return{status:ct,errors:ke,warnings:Be}};de.Context=Re.aM;var pe=de,le=ue(16089);function De(ct){const[ke,Be]=be.useState(ct),Ae=(0,be.useRef)(null),Ie=(0,be.useRef)([]),Xe=(0,be.useRef)(!1);be.useEffect(()=>(Xe.current=!1,()=>{Xe.current=!0,le.Z.cancel(Ae.current),Ae.current=null}),[]);function dt(Ht){Xe.current||(Ae.current===null&&(Ie.current=[],Ae.current=(0,le.Z)(()=>{Ae.current=null,Be(kt=>{let Wt=kt;return Ie.current.forEach(vn=>{Wt=vn(Wt)}),Wt})})),Ie.current.push(Ht))}return[ke,dt]}function ot(){const{itemRef:ct}=be.useContext(Re.q3),ke=be.useRef({});function Be(Ae,Ie){const Xe=Ie&&typeof Ie=="object"&&Ie.ref,dt=Ae.join("_");return(ke.current.name!==dt||ke.current.originRef!==Xe)&&(ke.current.name=dt,ke.current.originRef=Xe,ke.current.ref=(0,Tt.sQ)(ct(Ae),Xe)),ke.current.ref}return Be}var $t=ue(29194),It=ue(34280),Ut=ue(2738),Yt=ue(27382),dn=ue(37028);const hn=ct=>{const{formItemCls:ke}=ct;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${ke}-control`]:{display:"flex"}}}};var _n=(0,He.b)(["Form","item-item"],(ct,ke)=>{let{rootPrefixCls:Be}=ke;const Ae=et(ct,Be);return[hn(Ae)]}),cn=ct=>{const{prefixCls:ke,status:Be,wrapperCol:Ae,children:Ie,errors:Xe,warnings:dt,_internalItemRender:Ht,extra:kt,help:Wt,fieldId:vn,marginBottom:xn,onErrorVisibleChanged:Cn}=ct,Lt=`${ke}-item`,ln=be.useContext(Re.q3),it=Ae||ln.wrapperCol||{},wt=Fe()(`${Lt}-control`,it.className),Et=be.useMemo(()=>Object.assign({},ln),[ln]);delete Et.labelCol,delete Et.wrapperCol;const At=be.createElement("div",{className:`${Lt}-control-input`},be.createElement("div",{className:`${Lt}-control-input-content`},Ie)),nn=be.useMemo(()=>({prefixCls:ke,status:Be}),[ke,Be]),_t=xn!==null||Xe.length||dt.length?be.createElement("div",{style:{display:"flex",flexWrap:"nowrap"}},be.createElement(Re.Rk.Provider,{value:nn},be.createElement(Pt,{fieldId:vn,errors:Xe,warnings:dt,help:Wt,helpStatus:Be,className:`${Lt}-explain-connected`,onVisibleChanged:Cn})),!!xn&&be.createElement("div",{style:{width:0,height:xn}})):null,tn={};vn&&(tn.id=`${vn}_extra`);const Oe=kt?be.createElement("div",Object.assign({},tn,{className:`${Lt}-extra`}),kt):null,yt=Ht&&Ht.mark==="pro_table_render"&&Ht.render?Ht.render(ct,{input:At,errorList:_t,extra:Oe}):be.createElement(be.Fragment,null,At,_t,Oe);return be.createElement(Re.q3.Provider,{value:Et},be.createElement(dn.Z,Object.assign({},it,{className:wt}),yt),be.createElement(_n,{prefixCls:ke}))},Sn=ue(61485),Ye=ue(31724),ze=ue(9763),Ue=ue(6848),Bt=function(ct,ke){var Be={};for(var Ae in ct)Object.prototype.hasOwnProperty.call(ct,Ae)&&ke.indexOf(Ae)<0&&(Be[Ae]=ct[Ae]);if(ct!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ie=0,Ae=Object.getOwnPropertySymbols(ct);Ie<Ae.length;Ie++)ke.indexOf(Ae[Ie])<0&&Object.prototype.propertyIsEnumerable.call(ct,Ae[Ie])&&(Be[Ae[Ie]]=ct[Ae[Ie]]);return Be};function Jt(ct){return ct?typeof ct=="object"&&!be.isValidElement(ct)?ct:{title:ct}:null}var An=ct=>{let{prefixCls:ke,label:Be,htmlFor:Ae,labelCol:Ie,labelAlign:Xe,colon:dt,required:Ht,requiredMark:kt,tooltip:Wt}=ct;var vn;const[xn]=(0,ze.Z)("Form"),{vertical:Cn,labelAlign:Lt,labelCol:ln,labelWrap:it,colon:wt}=be.useContext(Re.q3);if(!Be)return null;const Et=Ie||ln||{},At=Xe||Lt,nn=`${ke}-item-label`,_t=Fe()(nn,At==="left"&&`${nn}-left`,Et.className,{[`${nn}-wrap`]:!!it});let tn=Be;const Oe=dt===!0||wt!==!1&&dt!==!1;Oe&&!Cn&&typeof Be=="string"&&Be.trim()!==""&&(tn=Be.replace(/[:|]\s*$/,""));const xt=Jt(Wt);if(xt){const{icon:zt=be.createElement(Sn.Z,null)}=xt,gn=Bt(xt,["icon"]),wn=be.createElement(Ue.Z,Object.assign({},gn),be.cloneElement(zt,{className:`${ke}-item-tooltip`,title:""}));tn=be.createElement(be.Fragment,null,tn,wn)}const Ot=kt==="optional",Dt=typeof kt=="function";Dt?tn=kt(tn,{required:!!Ht}):Ot&&!Ht&&(tn=be.createElement(be.Fragment,null,tn,be.createElement("span",{className:`${ke}-item-optional`,title:""},(xn==null?void 0:xn.optional)||((vn=Ye.Z.Form)===null||vn===void 0?void 0:vn.optional))));const Nt=Fe()({[`${ke}-item-required`]:Ht,[`${ke}-item-required-mark-optional`]:Ot||Dt,[`${ke}-item-no-colon`]:!Oe});return be.createElement(dn.Z,Object.assign({},Et,{className:_t}),be.createElement("label",{htmlFor:Ae,className:Nt,title:typeof Be=="string"?Be:""},tn))},In=ue(29679),Ln=ue(19248),Fn=ue(96512),jn=ue(58617);const Tn={success:In.Z,warning:Fn.Z,error:Ln.Z,validating:jn.Z};function hr(ct){let{children:ke,errors:Be,warnings:Ae,hasFeedback:Ie,validateStatus:Xe,prefixCls:dt,meta:Ht,noStyle:kt}=ct;const Wt=`${dt}-item`,{feedbackIcons:vn}=be.useContext(Re.q3),xn=Xt(Be,Ae,Ht,null,!!Ie,Xe),{isFormItemInput:Cn,status:Lt}=be.useContext(Re.aM),ln=be.useMemo(()=>{var it;let wt;if(Ie){const nn=Ie!==!0&&Ie.icons||vn,_t=xn&&((it=nn==null?void 0:nn({status:xn,errors:Be,warnings:Ae}))===null||it===void 0?void 0:it[xn]),tn=xn&&Tn[xn];wt=_t!==!1&&tn?be.createElement("span",{className:Fe()(`${Wt}-feedback-icon`,`${Wt}-feedback-icon-${xn}`)},_t||be.createElement(tn,null)):null}let Et=!0,At=xn||"";return kt&&(Et=Cn,At=(xn!=null?xn:Lt)||""),{status:At,errors:Be,warnings:Ae,hasFeedback:!!Ie,feedbackIcon:wt,isFormItemInput:Et}},[xn,Ie,kt,Cn,Lt]);return be.createElement(Re.aM.Provider,{value:ln},ke)}var kr=function(ct,ke){var Be={};for(var Ae in ct)Object.prototype.hasOwnProperty.call(ct,Ae)&&ke.indexOf(Ae)<0&&(Be[Ae]=ct[Ae]);if(ct!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ie=0,Ae=Object.getOwnPropertySymbols(ct);Ie<Ae.length;Ie++)ke.indexOf(Ae[Ie])<0&&Object.prototype.propertyIsEnumerable.call(ct,Ae[Ie])&&(Be[Ae[Ie]]=ct[Ae[Ie]]);return Be};function Tr(ct){const{prefixCls:ke,className:Be,rootClassName:Ae,style:Ie,help:Xe,errors:dt,warnings:Ht,validateStatus:kt,meta:Wt,hasFeedback:vn,hidden:xn,children:Cn,fieldId:Lt,required:ln,isRequired:it,onSubItemMetaChange:wt}=ct,Et=kr(ct,["prefixCls","className","rootClassName","style","help","errors","warnings","validateStatus","meta","hasFeedback","hidden","children","fieldId","required","isRequired","onSubItemMetaChange"]),At=`${ke}-item`,{requiredMark:nn}=be.useContext(Re.q3),_t=be.useRef(null),tn=Se(dt),Oe=Se(Ht),yt=Xe!=null,xt=!!(yt||dt.length||Ht.length),Ot=!!_t.current&&(0,$t.Z)(_t.current),[Dt,Nt]=be.useState(null);(0,It.Z)(()=>{if(xt&&_t.current){const zn=getComputedStyle(_t.current);Nt(parseInt(zn.marginBottom,10))}},[xt,Ot]);const zt=zn=>{zn||Nt(null)},wn=function(){let zn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const er=zn?tn:Wt.errors,cr=zn?Oe:Wt.warnings;return Xt(er,cr,Wt,"",!!vn,kt)}(),Dn=Fe()(At,Be,Ae,{[`${At}-with-help`]:yt||tn.length||Oe.length,[`${At}-has-feedback`]:wn&&vn,[`${At}-has-success`]:wn==="success",[`${At}-has-warning`]:wn==="warning",[`${At}-has-error`]:wn==="error",[`${At}-is-validating`]:wn==="validating",[`${At}-hidden`]:xn});return be.createElement("div",{className:Dn,style:Ie,ref:_t},be.createElement(Yt.Z,Object.assign({className:`${At}-row`},(0,Ut.Z)(Et,["_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(An,Object.assign({htmlFor:Lt},ct,{requiredMark:nn,required:ln!=null?ln:it,prefixCls:ke})),be.createElement(cn,Object.assign({},ct,Wt,{errors:tn,warnings:Oe,prefixCls:ke,status:wn,help:Xe,marginBottom:Dt,onErrorVisibleChanged:zt}),be.createElement(Re.qI.Provider,{value:wt},be.createElement(hr,{prefixCls:ke,meta:Wt,errors:Wt.errors,warnings:Wt.warnings,hasFeedback:vn,validateStatus:wn},Cn)))),!!Dt&&be.createElement("div",{className:`${At}-margin-offset`,style:{marginBottom:-Dt}}))}const Hr="__SPLIT__",sr=null,Mr=be.memo(ct=>{let{children:ke}=ct;return ke},(ct,ke)=>ct.value===ke.value&&ct.update===ke.update&&ct.childProps.length===ke.childProps.length&&ct.childProps.every((Be,Ae)=>Be===ke.childProps[Ae]));function rr(ct){return ct!=null}function Or(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function Fr(ct){const{name:ke,noStyle:Be,className:Ae,dependencies:Ie,prefixCls:Xe,shouldUpdate:dt,rules:Ht,children:kt,required:Wt,label:vn,messageVariables:xn,trigger:Cn="onChange",validateTrigger:Lt,hidden:ln,help:it}=ct,{getPrefixCls:wt}=be.useContext(Gt.E_),{name:Et}=be.useContext(Re.q3),At=oe(kt),nn=typeof At=="function",_t=be.useContext(Re.qI),{validateTrigger:tn}=be.useContext(nt.FieldContext),Oe=Lt!==void 0?Lt:tn,yt=rr(ke),xt=wt("form",Xe),[Ot,Dt]=Mt(xt),Nt=be.useContext(nt.ListContext),zt=be.useRef(),[gn,wn]=De({}),[Dn,zn]=(0,Ft.Z)(()=>Or()),er=Gn=>{const Xn=Nt==null?void 0:Nt.getKey(Gn.name);if(zn(Gn.destroy?Or():Gn,!0),Be&&it!==!1&&_t){let br=Gn.name;if(Gn.destroy)br=zt.current||br;else if(Xn!==void 0){const[ur,Br]=Xn;br=[ur].concat((0,fe.Z)(Br)),zt.current=br}_t(Gn,br)}},cr=(Gn,Xn)=>{wn(br=>{const ur=Object.assign({},br),Gr=[].concat((0,fe.Z)(Gn.name.slice(0,-1)),(0,fe.Z)(Xn)).join(Hr);return Gn.destroy?delete ur[Gr]:ur[Gr]=Gn,ur})},[Un,Pn]=be.useMemo(()=>{const Gn=(0,fe.Z)(Dn.errors),Xn=(0,fe.Z)(Dn.warnings);return Object.values(gn).forEach(br=>{Gn.push.apply(Gn,(0,fe.Z)(br.errors||[])),Xn.push.apply(Xn,(0,fe.Z)(br.warnings||[]))}),[Gn,Xn]},[gn,Dn.errors,Dn.warnings]),fr=ot();function tr(Gn,Xn,br){return Be&&!ln?be.createElement(hr,{prefixCls:xt,hasFeedback:ct.hasFeedback,validateStatus:ct.validateStatus,meta:Dn,errors:Un,warnings:Pn,noStyle:!0},Gn):be.createElement(Tr,Object.assign({key:"row"},ct,{className:Fe()(Ae,Dt),prefixCls:xt,fieldId:Xn,isRequired:br,errors:Un,warnings:Pn,meta:Dn,onSubItemMetaChange:cr}),Gn)}if(!yt&&!nn&&!Ie)return Ot(tr(At));let yr={};return typeof vn=="string"?yr.label=vn:ke&&(yr.label=String(ke)),xn&&(yr=Object.assign(Object.assign({},yr),xn)),Ot(be.createElement(nt.Field,Object.assign({},ct,{messageVariables:yr,trigger:Cn,validateTrigger:Oe,onMetaChange:er}),(Gn,Xn,br)=>{const ur=bt(ke).length&&Xn?Xn.name:[],Br=fn(ur,Et),Gr=Wt!==void 0?Wt:!!(Ht&&Ht.some(kn=>{if(kn&&typeof kn=="object"&&kn.required&&!kn.warningOnly)return!0;if(typeof kn=="function"){const gr=kn(br);return gr&&gr.required&&!gr.warningOnly}return!1})),ar=Object.assign({},Gn);let En=null;if(Array.isArray(At)&&yt)En=At;else if(!(nn&&(!(dt||Ie)||yt))){if(!(Ie&&!nn&&!yt))if((0,ge.l$)(At)){const kn=Object.assign(Object.assign({},At.props),ar);if(kn.id||(kn.id=Br),it||Un.length>0||Pn.length>0||ct.extra){const _r=[];(it||Un.length>0)&&_r.push(`${Br}_help`),ct.extra&&_r.push(`${Br}_extra`),kn["aria-describedby"]=_r.join(" ")}Un.length>0&&(kn["aria-invalid"]="true"),Gr&&(kn["aria-required"]="true"),(0,Tt.Yr)(At)&&(kn.ref=fr(ur,At)),new Set([].concat((0,fe.Z)(bt(Cn)),(0,fe.Z)(bt(Oe)))).forEach(_r=>{kn[_r]=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[_r])===null||pr===void 0||(Lr=pr).call.apply(Lr,[ar].concat(qn)),(ii=(Sr=At.props)[_r])===null||ii===void 0||(Ir=ii).call.apply(Ir,[Sr].concat(qn))}});const nr=[kn["aria-required"],kn["aria-invalid"],kn["aria-describedby"]];En=be.createElement(Mr,{value:ar[ct.valuePropName||"value"],update:At,childProps:nr},(0,ge.Tm)(At,kn))}else nn&&(dt||Ie)&&!yt?En=At(br):En=At}return tr(En,Br,Gr)}))}const Er=Fr;Er.useStatus=pe;var jr=Er,Nr=function(ct,ke){var Be={};for(var Ae in ct)Object.prototype.hasOwnProperty.call(ct,Ae)&&ke.indexOf(Ae)<0&&(Be[Ae]=ct[Ae]);if(ct!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Ie=0,Ae=Object.getOwnPropertySymbols(ct);Ie<Ae.length;Ie++)ke.indexOf(Ae[Ie])<0&&Object.prototype.propertyIsEnumerable.call(ct,Ae[Ie])&&(Be[Ae[Ie]]=ct[Ae[Ie]]);return Be},lr=ct=>{var{prefixCls:ke,children:Be}=ct,Ae=Nr(ct,["prefixCls","children"]);const{getPrefixCls:Ie}=be.useContext(Gt.E_),Xe=Ie("form",ke),dt=be.useMemo(()=>({prefixCls:Xe,status:"error"}),[Xe]);return be.createElement(nt.List,Object.assign({},Ae),(Ht,kt,Wt)=>be.createElement(Re.Rk.Provider,{value:dt},Be(Ht.map(vn=>Object.assign(Object.assign({},vn),{fieldKey:vn.key})),kt,{errors:Wt.errors,warnings:Wt.warnings})))};function Rn(){const{form:ct}=(0,be.useContext)(Re.q3);return ct}const $n=Vt;$n.Item=jr,$n.List=lr,$n.ErrorList=Pt,$n.useForm=je,$n.useFormInstance=Rn,$n.useWatch=nt.useWatch,$n.Provider=Re.RV,$n.create=()=>{};var wr=$n},5871:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Sn}});var fe=ue(84105),Ze=ue(87395),Fe=ue(92310),tt=ue.n(Fe),be=ue(54476),Le=ue(20068),Re=ue(76190),Se=ue(42978),Me=ue(75931),Pe=ue(67732),rt=ue(83652);function Te(){return typeof BigInt=="function"}function He(Ye){return!Ye&&Ye!==0&&!Number.isNaN(Ye)||!String(Ye).trim()}function ht(Ye){var ze=Ye.trim(),Ue=ze.startsWith("-");Ue&&(ze=ze.slice(1)),ze=ze.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),ze.startsWith(".")&&(ze="0".concat(ze));var Bt=ze||"0",Jt=Bt.split("."),rn=Jt[0]||"0",An=Jt[1]||"0";rn==="0"&&An==="0"&&(Ue=!1);var In=Ue?"-":"";return{negative:Ue,negativeStr:In,trimStr:Bt,integerStr:rn,decimalStr:An,fullStr:"".concat(In).concat(Bt)}}function Je(Ye){var ze=String(Ye);return!Number.isNaN(Number(ze))&&ze.includes("e")}function lt(Ye){var ze=String(Ye);if(Je(Ye)){var Ue=Number(ze.slice(ze.indexOf("e-")+2)),Bt=ze.match(/\.(\d+)/);return Bt!=null&&Bt[1]&&(Ue+=Bt[1].length),Ue}return ze.includes(".")&&Rt(ze)?ze.length-ze.indexOf(".")-1:0}function st(Ye){var ze=String(Ye);if(Je(Ye)){if(Ye>Number.MAX_SAFE_INTEGER)return String(Te()?BigInt(Ye).toString():Number.MAX_SAFE_INTEGER);if(Ye<Number.MIN_SAFE_INTEGER)return String(Te()?BigInt(Ye).toString():Number.MIN_SAFE_INTEGER);ze=Ye.toFixed(lt(ze))}return ht(ze).fullStr}function Rt(Ye){return typeof Ye=="number"?!Number.isNaN(Ye):Ye?/^\s*-?\d+(\.\d+)?\s*$/.test(Ye)||/^\s*-?\d+\.\s*$/.test(Ye)||/^\s*-?\.\d+\s*$/.test(Ye):!1}var qt=function(){function Ye(ze){if((0,Pe.Z)(this,Ye),(0,Le.Z)(this,"origin",""),(0,Le.Z)(this,"negative",void 0),(0,Le.Z)(this,"integer",void 0),(0,Le.Z)(this,"decimal",void 0),(0,Le.Z)(this,"decimalLen",void 0),(0,Le.Z)(this,"empty",void 0),(0,Le.Z)(this,"nan",void 0),He(ze)){this.empty=!0;return}if(this.origin=String(ze),ze==="-"||Number.isNaN(ze)){this.nan=!0;return}var Ue=ze;if(Je(Ue)&&(Ue=Number(Ue)),Ue=typeof Ue=="string"?Ue:st(Ue),Rt(Ue)){var Bt=ht(Ue);this.negative=Bt.negative;var Jt=Bt.trimStr.split(".");this.integer=BigInt(Jt[0]);var rn=Jt[1]||"0";this.decimal=BigInt(rn),this.decimalLen=rn.length}else this.nan=!0}return(0,rt.Z)(Ye,[{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(Ue){var Bt="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(Ue,"0"));return BigInt(Bt)}},{key:"negate",value:function(){var Ue=new Ye(this.toString());return Ue.negative=!Ue.negative,Ue}},{key:"cal",value:function(Ue,Bt,Jt){var rn=Math.max(this.getDecimalStr().length,Ue.getDecimalStr().length),An=this.alignDecimal(rn),In=Ue.alignDecimal(rn),Ln=Bt(An,In).toString(),Fn=Jt(rn),jn=ht(Ln),Tn=jn.negativeStr,hr=jn.trimStr,kr="".concat(Tn).concat(hr.padStart(Fn+1,"0"));return new Ye("".concat(kr.slice(0,-Fn),".").concat(kr.slice(-Fn)))}},{key:"add",value:function(Ue){if(this.isInvalidate())return new Ye(Ue);var Bt=new Ye(Ue);return Bt.isInvalidate()?this:this.cal(Bt,function(Jt,rn){return Jt+rn},function(Jt){return Jt})}},{key:"multi",value:function(Ue){var Bt=new Ye(Ue);return this.isInvalidate()||Bt.isInvalidate()?new Ye(NaN):this.cal(Bt,function(Jt,rn){return Jt*rn},function(Jt){return Jt*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(Ue){return this.toString()===(Ue==null?void 0:Ue.toString())}},{key:"lessEquals",value:function(Ue){return this.add(Ue.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var Ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return Ue?this.isInvalidate()?"":ht("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),Ye}(),at=function(){function Ye(ze){if((0,Pe.Z)(this,Ye),(0,Le.Z)(this,"origin",""),(0,Le.Z)(this,"number",void 0),(0,Le.Z)(this,"empty",void 0),He(ze)){this.empty=!0;return}this.origin=String(ze),this.number=Number(ze)}return(0,rt.Z)(Ye,[{key:"negate",value:function(){return new Ye(-this.toNumber())}},{key:"add",value:function(Ue){if(this.isInvalidate())return new Ye(Ue);var Bt=Number(Ue);if(Number.isNaN(Bt))return this;var Jt=this.number+Bt;if(Jt>Number.MAX_SAFE_INTEGER)return new Ye(Number.MAX_SAFE_INTEGER);if(Jt<Number.MIN_SAFE_INTEGER)return new Ye(Number.MIN_SAFE_INTEGER);var rn=Math.max(lt(this.number),lt(Bt));return new Ye(Jt.toFixed(rn))}},{key:"multi",value:function(Ue){var Bt=Number(Ue);if(this.isInvalidate()||Number.isNaN(Bt))return new Ye(NaN);var Jt=this.number*Bt;if(Jt>Number.MAX_SAFE_INTEGER)return new Ye(Number.MAX_SAFE_INTEGER);if(Jt<Number.MIN_SAFE_INTEGER)return new Ye(Number.MIN_SAFE_INTEGER);var rn=Math.max(lt(this.number),lt(Bt));return new Ye(Jt.toFixed(rn))}},{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(Ue){return this.toNumber()===(Ue==null?void 0:Ue.toNumber())}},{key:"lessEquals",value:function(Ue){return this.add(Ue.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.number}},{key:"toString",value:function(){var Ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return Ue?this.isInvalidate()?"":st(this.number):this.origin}}]),Ye}();function ft(Ye){return Te()?new qt(Ye):new at(Ye)}function Ve(Ye,ze,Ue){var Bt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(Ye==="")return"";var Jt=ht(Ye),rn=Jt.negativeStr,An=Jt.integerStr,In=Jt.decimalStr,Ln="".concat(ze).concat(In),Fn="".concat(rn).concat(An);if(Ue>=0){var jn=Number(In[Ue]);if(jn>=5&&!Bt){var Tn=ft(Ye).add("".concat(rn,"0.").concat("0".repeat(Ue)).concat(10-jn));return Ve(Tn.toString(),ze,Ue,Bt)}return Ue===0?Fn:"".concat(Fn).concat(ze).concat(In.padEnd(Ue,"0").slice(0,Ue))}return Ln===".0"?Fn:"".concat(Fn).concat(Ln)}var _e=ft,We=ue(93681),et=ue(34280),Mt=ue(8654),Qe=ue(59301),Kt=ue(48736);function ut(Ye,ze){var Ue=(0,Qe.useRef)(null);function Bt(){try{var rn=Ye.selectionStart,An=Ye.selectionEnd,In=Ye.value,Ln=In.substring(0,rn),Fn=In.substring(An);Ue.current={start:rn,end:An,value:In,beforeTxt:Ln,afterTxt:Fn}}catch(jn){}}function Jt(){if(Ye&&Ue.current&&ze)try{var rn=Ye.value,An=Ue.current,In=An.beforeTxt,Ln=An.afterTxt,Fn=An.start,jn=rn.length;if(rn.endsWith(Ln))jn=rn.length-Ue.current.afterTxt.length;else if(rn.startsWith(In))jn=In.length;else{var Tn=In[Fn-1],hr=rn.indexOf(Tn,Fn-1);hr!==-1&&(jn=hr+1)}Ye.setSelectionRange(jn,jn)}catch(kr){(0,Kt.ZP)(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(kr.message))}}return[Bt,Jt]}var Pt=ue(49658),nt=function(){var ze=(0,Qe.useState)(!1),Ue=(0,Se.Z)(ze,2),Bt=Ue[0],Jt=Ue[1];return(0,et.Z)(function(){Jt((0,Pt.Z)())},[]),Bt},Gt=nt,mn=ue(16089),on=200,sn=600;function jt(Ye){var ze=Ye.prefixCls,Ue=Ye.upNode,Bt=Ye.downNode,Jt=Ye.upDisabled,rn=Ye.downDisabled,An=Ye.onStep,In=Qe.useRef(),Ln=Qe.useRef([]),Fn=Qe.useRef();Fn.current=An;var jn=function(){clearTimeout(In.current)},Tn=function(Or,Fr){Or.preventDefault(),jn(),Fn.current(Fr);function Er(){Fn.current(Fr),In.current=setTimeout(Er,on)}In.current=setTimeout(Er,sn)};Qe.useEffect(function(){return function(){jn(),Ln.current.forEach(function(rr){return mn.Z.cancel(rr)})}},[]);var hr=Gt();if(hr)return null;var kr="".concat(ze,"-handler"),Tr=tt()(kr,"".concat(kr,"-up"),(0,Le.Z)({},"".concat(kr,"-up-disabled"),Jt)),Hr=tt()(kr,"".concat(kr,"-down"),(0,Le.Z)({},"".concat(kr,"-down-disabled"),rn)),sr=function(){return Ln.current.push((0,mn.Z)(jn))},Mr={unselectable:"on",role:"button",onMouseUp:sr,onMouseLeave:sr};return Qe.createElement("div",{className:"".concat(kr,"-wrap")},Qe.createElement("span",(0,be.Z)({},Mr,{onMouseDown:function(Or){Tn(Or,!0)},"aria-label":"Increase Value","aria-disabled":Jt,className:Tr}),Ue||Qe.createElement("span",{unselectable:"on",className:"".concat(ze,"-handler-up-inner")})),Qe.createElement("span",(0,be.Z)({},Mr,{onMouseDown:function(Or){Tn(Or,!1)},"aria-label":"Decrease Value","aria-disabled":rn,className:Hr}),Bt||Qe.createElement("span",{unselectable:"on",className:"".concat(ze,"-handler-down-inner")})))}function Ke(Ye){var ze=typeof Ye=="number"?st(Ye):ht(Ye).fullStr,Ue=ze.includes(".");return Ue?ht(ze.replace(/(\d)\.(\d)/g,"$1$2.")).fullStr:Ye+"0"}var xe=ue(5643),bt=function(){var Ye=(0,Qe.useRef)(0),ze=function(){mn.Z.cancel(Ye.current)};return(0,Qe.useEffect)(function(){return ze},[]),function(Ue){ze(),Ye.current=(0,mn.Z)(function(){Ue()})}},fn=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","classNames","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],Xt=["disabled","style","prefixCls","value","prefix","suffix","addonBefore","addonAfter","classes","className","classNames"],qe=function(ze,Ue){return ze||Ue.isEmpty()?Ue.toString():Ue.toNumber()},je=function(ze){var Ue=_e(ze);return Ue.isInvalidate()?null:Ue},gt=Qe.forwardRef(function(Ye,ze){var Ue,Bt=Ye.prefixCls,Jt=Bt===void 0?"rc-input-number":Bt,rn=Ye.className,An=Ye.style,In=Ye.min,Ln=Ye.max,Fn=Ye.step,jn=Fn===void 0?1:Fn,Tn=Ye.defaultValue,hr=Ye.value,kr=Ye.disabled,Tr=Ye.readOnly,Hr=Ye.upHandler,sr=Ye.downHandler,Mr=Ye.keyboard,rr=Ye.controls,Or=rr===void 0?!0:rr,Fr=Ye.classNames,Er=Ye.stringMode,jr=Ye.parser,Nr=Ye.formatter,Jn=Ye.precision,lr=Ye.decimalSeparator,Rn=Ye.onChange,$n=Ye.onInput,wr=Ye.onPressEnter,ct=Ye.onStep,ke=(0,Me.Z)(Ye,fn),Be="".concat(Jt,"-input"),Ae=Qe.useRef(null),Ie=Qe.useState(!1),Xe=(0,Se.Z)(Ie,2),dt=Xe[0],Ht=Xe[1],kt=Qe.useRef(!1),Wt=Qe.useRef(!1),vn=Qe.useRef(!1),xn=Qe.useState(function(){return _e(hr!=null?hr:Tn)}),Cn=(0,Se.Z)(xn,2),Lt=Cn[0],ln=Cn[1];function it(En){hr===void 0&&ln(En)}var wt=Qe.useCallback(function(En,kn){if(!kn)return Jn>=0?Jn:Math.max(lt(En),lt(jn))},[Jn,jn]),Et=Qe.useCallback(function(En){var kn=String(En);if(jr)return jr(kn);var gr=kn;return lr&&(gr=gr.replace(lr,".")),gr.replace(/[^\w.-]+/g,"")},[jr,lr]),At=Qe.useRef(""),nn=Qe.useCallback(function(En,kn){if(Nr)return Nr(En,{userTyping:kn,input:String(At.current)});var gr=typeof En=="number"?st(En):En;if(!kn){var nr=wt(gr,kn);if(Rt(gr)&&(lr||nr>=0)){var _r=lr||".";gr=Ve(gr,_r,nr)}}return gr},[Nr,wt,lr]),_t=Qe.useState(function(){var En=Tn!=null?Tn:hr;return Lt.isInvalidate()&&["string","number"].includes((0,Re.Z)(En))?Number.isNaN(En)?"":En:nn(Lt.toString(),!1)}),tn=(0,Se.Z)(_t,2),Oe=tn[0],yt=tn[1];At.current=Oe;function xt(En,kn){yt(nn(En.isInvalidate()?En.toString(!1):En.toString(!kn),kn))}var Ot=Qe.useMemo(function(){return je(Ln)},[Ln,Jn]),Dt=Qe.useMemo(function(){return je(In)},[In,Jn]),Nt=Qe.useMemo(function(){return!Ot||!Lt||Lt.isInvalidate()?!1:Ot.lessEquals(Lt)},[Ot,Lt]),zt=Qe.useMemo(function(){return!Dt||!Lt||Lt.isInvalidate()?!1:Lt.lessEquals(Dt)},[Dt,Lt]),gn=ut(Ae.current,dt),wn=(0,Se.Z)(gn,2),Dn=wn[0],zn=wn[1],er=function(kn){return Ot&&!kn.lessEquals(Ot)?Ot:Dt&&!Dt.lessEquals(kn)?Dt:null},cr=function(kn){return!er(kn)},Un=function(kn,gr){var nr=kn,_r=cr(nr)||nr.isEmpty();if(!nr.isEmpty()&&!gr&&(nr=er(nr)||nr,_r=!0),!Tr&&!kr&&_r){var Lr=nr.toString(),Ir=wt(Lr,gr);return Ir>=0&&(nr=_e(Ve(Lr,".",Ir)),cr(nr)||(nr=_e(Ve(Lr,".",Ir,!0)))),nr.equals(Lt)||(it(nr),Rn==null||Rn(nr.isEmpty()?null:qe(Er,nr)),hr===void 0&&xt(nr,gr)),nr}return Lt},Pn=bt(),fr=function En(kn){if(Dn(),At.current=kn,yt(kn),!Wt.current){var gr=Et(kn),nr=_e(gr);nr.isNaN()||Un(nr,!0)}$n==null||$n(kn),Pn(function(){var _r=kn;jr||(_r=kn.replace(/。/g,".")),_r!==kn&&En(_r)})},tr=function(){Wt.current=!0},yr=function(){Wt.current=!1,fr(Ae.current.value)},Gn=function(kn){fr(kn.target.value)},Xn=function(kn){var gr;if(!(kn&&Nt||!kn&&zt)){kt.current=!1;var nr=_e(vn.current?Ke(jn):jn);kn||(nr=nr.negate());var _r=(Lt||_e(0)).add(nr.toString()),Lr=Un(_r,!1);ct==null||ct(qe(Er,Lr),{offset:vn.current?Ke(jn):jn,type:kn?"up":"down"}),(gr=Ae.current)===null||gr===void 0||gr.focus()}},br=function(kn){var gr=_e(Et(Oe)),nr=gr;gr.isNaN()?nr=Un(Lt,kn):nr=Un(gr,kn),hr!==void 0?xt(Lt,!1):nr.isNaN()||xt(nr,!1)},ur=function(){kt.current=!0},Br=function(kn){var gr=kn.key,nr=kn.shiftKey;kt.current=!0,vn.current=nr,gr==="Enter"&&(Wt.current||(kt.current=!1),br(!1),wr==null||wr(kn)),Mr!==!1&&!Wt.current&&["Up","ArrowUp","Down","ArrowDown"].includes(gr)&&(Xn(gr==="Up"||gr==="ArrowUp"),kn.preventDefault())},Gr=function(){kt.current=!1,vn.current=!1},ar=function(){br(!1),Ht(!1),kt.current=!1};return(0,et.o)(function(){Lt.isInvalidate()||xt(Lt,!1)},[Jn]),(0,et.o)(function(){var En=_e(hr);ln(En);var kn=_e(Et(Oe));(!En.equals(kn)||!kt.current||Nr)&&xt(En,kt.current)},[hr]),(0,et.o)(function(){Nr&&zn()},[Oe]),Qe.createElement("div",{className:tt()(Jt,Fr==null?void 0:Fr.input,rn,(Ue={},(0,Le.Z)(Ue,"".concat(Jt,"-focused"),dt),(0,Le.Z)(Ue,"".concat(Jt,"-disabled"),kr),(0,Le.Z)(Ue,"".concat(Jt,"-readonly"),Tr),(0,Le.Z)(Ue,"".concat(Jt,"-not-a-number"),Lt.isNaN()),(0,Le.Z)(Ue,"".concat(Jt,"-out-of-range"),!Lt.isInvalidate()&&!cr(Lt)),Ue)),style:An,onFocus:function(){Ht(!0)},onBlur:ar,onKeyDown:Br,onKeyUp:Gr,onCompositionStart:tr,onCompositionEnd:yr,onBeforeInput:ur},Or&&Qe.createElement(jt,{prefixCls:Jt,upNode:Hr,downNode:sr,upDisabled:Nt,downDisabled:zt,onStep:Xn}),Qe.createElement("div",{className:"".concat(Be,"-wrap")},Qe.createElement("input",(0,be.Z)({autoComplete:"off",role:"spinbutton","aria-valuemin":In,"aria-valuemax":Ln,"aria-valuenow":Lt.isInvalidate()?null:Lt.toString(),step:jn},ke,{ref:(0,Mt.sQ)(Ae,ze),className:Be,value:Oe,onChange:Gn,disabled:kr,readOnly:Tr}))))}),en=Qe.forwardRef(function(Ye,ze){var Ue=Ye.disabled,Bt=Ye.style,Jt=Ye.prefixCls,rn=Ye.value,An=Ye.prefix,In=Ye.suffix,Ln=Ye.addonBefore,Fn=Ye.addonAfter,jn=Ye.classes,Tn=Ye.className,hr=Ye.classNames,kr=(0,Me.Z)(Ye,Xt),Tr=Qe.useRef(null),Hr=function(Mr){Tr.current&&(0,xe.nH)(Tr.current,Mr)};return Qe.createElement(We.BaseInput,{inputElement:Qe.createElement(gt,(0,be.Z)({prefixCls:Jt,disabled:Ue,classNames:hr,ref:(0,Mt.sQ)(Tr,ze)},kr)),className:Tn,triggerFocus:Hr,prefixCls:Jt,value:rn,disabled:Ue,style:Bt,prefix:An,suffix:In,addonAfter:Fn,addonBefore:Ln,classes:jn,classNames:hr,components:{affixWrapper:"div",groupWrapper:"div",wrapper:"div",groupAddon:"div"}})});en.displayName="InputNumber";var Zt=en,pn=Zt,Vt=ue(19080),Ft=ue(36355),Tt=ue(92736),ge=ue(1684),se=ue(19716),oe=ue(32441),de=ue(33234),pe=ue(9937),le=ue(17313),De=ue(74207),ot=ue(83116),$t=ue(37613);const It=(Ye,ze)=>{let{componentCls:Ue,borderRadiusSM:Bt,borderRadiusLG:Jt}=Ye;const rn=ze==="lg"?Jt:Bt;return{[`&-${ze}`]:{[`${Ue}-handler-wrap`]:{borderStartEndRadius:rn,borderEndEndRadius:rn},[`${Ue}-handler-up`]:{borderStartEndRadius:rn},[`${Ue}-handler-down`]:{borderEndEndRadius:rn}}}},Ut=Ye=>{const{componentCls:ze,lineWidth:Ue,lineType:Bt,colorBorder:Jt,borderRadius:rn,fontSizeLG:An,controlHeightLG:In,controlHeightSM:Ln,colorError:Fn,paddingInlineSM:jn,colorTextDescription:Tn,motionDurationMid:hr,handleHoverColor:kr,paddingInline:Tr,paddingBlock:Hr,handleBg:sr,handleActiveBg:Mr,colorTextDisabled:rr,borderRadiusSM:Or,borderRadiusLG:Fr,controlWidth:Er,handleVisible:jr,handleBorderColor:Nr}=Ye;return[{[ze]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,le.Wf)(Ye)),(0,pe.ik)(Ye)),(0,pe.bi)(Ye,ze)),{display:"inline-block",width:Er,margin:0,padding:0,border:`${Ue}px ${Bt} ${Jt}`,borderRadius:rn,"&-rtl":{direction:"rtl",[`${ze}-input`]:{direction:"rtl"}},"&-lg":{padding:0,fontSize:An,borderRadius:Fr,[`input${ze}-input`]:{height:In-2*Ue}},"&-sm":{padding:0,borderRadius:Or,[`input${ze}-input`]:{height:Ln-2*Ue,padding:`0 ${jn}px`}},"&:hover":Object.assign({},(0,pe.pU)(Ye)),"&-focused":Object.assign({},(0,pe.M1)(Ye)),"&-out-of-range":{[`${ze}-input-wrap`]:{input:{color:Fn}}},"&-group":Object.assign(Object.assign(Object.assign({},(0,le.Wf)(Ye)),(0,pe.s7)(Ye)),{"&-wrapper":{display:"inline-block",textAlign:"start",verticalAlign:"top",[`${ze}-affix-wrapper`]:{width:"100%"},"&-lg":{[`${ze}-group-addon`]:{borderRadius:Fr,fontSize:Ye.fontSizeLG}},"&-sm":{[`${ze}-group-addon`]:{borderRadius:Or}},[`${ze}-wrapper-disabled > ${ze}-group-addon`]:Object.assign({},(0,pe.Xy)(Ye))}}),[`&-disabled ${ze}-input`]:{cursor:"not-allowed"},[ze]:{"&-input":Object.assign(Object.assign(Object.assign(Object.assign({},(0,le.Wf)(Ye)),{width:"100%",padding:`${Hr}px ${Tr}px`,textAlign:"start",backgroundColor:"transparent",border:0,borderRadius:rn,outline:0,transition:`all ${hr} linear`,appearance:"textfield",fontSize:"inherit"}),(0,pe.nz)(Ye.colorTextPlaceholder)),{'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':{margin:0,webkitAppearance:"none",appearance:"none"}})}})},{[ze]:Object.assign(Object.assign(Object.assign({[`&:hover ${ze}-handler-wrap, &-focused ${ze}-handler-wrap`]:{opacity:1},[`${ze}-handler-wrap`]:{position:"absolute",insetBlockStart:0,insetInlineEnd:0,width:Ye.handleWidth,height:"100%",background:sr,borderStartStartRadius:0,borderStartEndRadius:rn,borderEndEndRadius:rn,borderEndStartRadius:0,opacity:jr===!0?1:0,display:"flex",flexDirection:"column",alignItems:"stretch",transition:`opacity ${hr} linear ${hr}`,[`${ze}-handler`]:{display:"flex",alignItems:"center",justifyContent:"center",flex:"auto",height:"40%",[`
${ze}-handler-up-inner,
${ze}-handler-down-inner
`]:{marginInlineEnd:0,fontSize:Ye.handleFontSize}}},[`${ze}-handler`]:{height:"50%",overflow:"hidden",color:Tn,fontWeight:"bold",lineHeight:0,textAlign:"center",cursor:"pointer",borderInlineStart:`${Ue}px ${Bt} ${Nr}`,transition:`all ${hr} linear`,"&:active":{background:Mr},"&:hover":{height:"60%",[`
${ze}-handler-up-inner,
${ze}-handler-down-inner
`]:{color:kr}},"&-up-inner, &-down-inner":Object.assign(Object.assign({},(0,le.Ro)()),{color:Tn,transition:`all ${hr} linear`,userSelect:"none"})},[`${ze}-handler-up`]:{borderStartEndRadius:rn},[`${ze}-handler-down`]:{borderBlockStart:`${Ue}px ${Bt} ${Nr}`,borderEndEndRadius:rn}},It(Ye,"lg")),It(Ye,"sm")),{"&-disabled, &-readonly":{[`${ze}-handler-wrap`]:{display:"none"},[`${ze}-input`]:{color:"inherit"}},[`
${ze}-handler-up-disabled,
${ze}-handler-down-disabled
`]:{cursor:"not-allowed"},[`
${ze}-handler-up-disabled:hover &-handler-up-inner,
${ze}-handler-down-disabled:hover &-handler-down-inner
`]:{color:rr}})},{[`${ze}-borderless`]:{borderColor:"transparent",boxShadow:"none",[`${ze}-handler-down`]:{borderBlockStartWidth:0}}}]},Yt=Ye=>{const{componentCls:ze,paddingBlock:Ue,paddingInline:Bt,inputAffixPadding:Jt,controlWidth:rn,borderRadiusLG:An,borderRadiusSM:In}=Ye;return{[`${ze}-affix-wrapper`]:Object.assign(Object.assign(Object.assign({},(0,pe.ik)(Ye)),(0,pe.bi)(Ye,`${ze}-affix-wrapper`)),{position:"relative",display:"inline-flex",width:rn,padding:0,paddingInlineStart:Bt,"&-lg":{borderRadius:An},"&-sm":{borderRadius:In},[`&:not(${ze}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},(0,pe.pU)(Ye)),{zIndex:1}),"&-focused, &:focus":{zIndex:1},[`&-disabled > ${ze}-disabled`]:{background:"transparent"},[`> div${ze}`]:{width:"100%",border:"none",outline:"none",[`&${ze}-focused`]:{boxShadow:"none !important"}},[`input${ze}-input`]:{padding:`${Ue}px 0`},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${ze}-handler-wrap`]:{zIndex:2},[ze]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center",pointerEvents:"none"},"&-prefix":{marginInlineEnd:Jt},"&-suffix":{position:"absolute",insetBlockStart:0,insetInlineEnd:0,zIndex:1,height:"100%",marginInlineEnd:Bt,marginInlineStart:Jt}}})}};var dn=(0,ot.Z)("InputNumber",Ye=>{const ze=(0,$t.TS)(Ye,(0,pe.e5)(Ye));return[Ut(ze),Yt(ze),(0,De.c)(ze)]},Ye=>Object.assign(Object.assign({},(0,pe.TM)(Ye)),{controlWidth:90,handleWidth:Ye.controlHeightSM-Ye.lineWidth*2,handleFontSize:Ye.fontSize/2,handleVisible:"auto",handleActiveBg:Ye.colorFillAlter,handleBg:Ye.colorBgContainer,handleHoverColor:Ye.colorPrimary,handleBorderColor:Ye.colorBorder})),hn=function(Ye,ze){var Ue={};for(var Bt in Ye)Object.prototype.hasOwnProperty.call(Ye,Bt)&&ze.indexOf(Bt)<0&&(Ue[Bt]=Ye[Bt]);if(Ye!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Jt=0,Bt=Object.getOwnPropertySymbols(Ye);Jt<Bt.length;Jt++)ze.indexOf(Bt[Jt])<0&&Object.prototype.propertyIsEnumerable.call(Ye,Bt[Jt])&&(Ue[Bt[Jt]]=Ye[Bt[Jt]]);return Ue};const _n=Qe.forwardRef((Ye,ze)=>{const{getPrefixCls:Ue,direction:Bt}=Qe.useContext(Ft.E_),Jt=Qe.useRef(null);Qe.useImperativeHandle(ze,()=>Jt.current);const{className:rn,rootClassName:An,size:In,disabled:Ln,prefixCls:Fn,addonBefore:jn,addonAfter:Tn,prefix:hr,bordered:kr=!0,readOnly:Tr,status:Hr,controls:sr}=Ye,Mr=hn(Ye,["className","rootClassName","size","disabled","prefixCls","addonBefore","addonAfter","prefix","bordered","readOnly","status","controls"]),rr=Ue("input-number",Fn),[Or,Fr]=dn(rr),{compactSize:Er,compactItemClassnames:jr}=(0,de.ri)(rr,Bt);let Nr=Qe.createElement(Ze.Z,{className:`${rr}-handler-up-inner`}),Jn=Qe.createElement(fe.Z,{className:`${rr}-handler-down-inner`});const lr=typeof sr=="boolean"?sr:void 0;typeof sr=="object"&&(Nr=typeof sr.upIcon=="undefined"?Nr:Qe.createElement("span",{className:`${rr}-handler-up-inner`},sr.upIcon),Jn=typeof sr.downIcon=="undefined"?Jn:Qe.createElement("span",{className:`${rr}-handler-down-inner`},sr.downIcon));const{hasFeedback:Rn,status:$n,isFormItemInput:wr,feedbackIcon:ct}=Qe.useContext(oe.aM),ke=(0,Vt.F)($n,Hr),Be=(0,se.Z)(kt=>{var Wt;return(Wt=In!=null?In:Er)!==null&&Wt!==void 0?Wt:kt}),Ae=Qe.useContext(ge.Z),Ie=Ln!=null?Ln:Ae,Xe=tt()({[`${rr}-lg`]:Be==="large",[`${rr}-sm`]:Be==="small",[`${rr}-rtl`]:Bt==="rtl",[`${rr}-borderless`]:!kr,[`${rr}-in-form-item`]:wr},(0,Vt.Z)(rr,ke),jr,Fr),dt=`${rr}-group`,Ht=Qe.createElement(pn,Object.assign({ref:Jt,disabled:Ie,className:tt()(rn,An),upHandler:Nr,downHandler:Jn,prefixCls:rr,readOnly:Tr,controls:lr,prefix:hr,suffix:Rn&&ct,addonAfter:Tn&&Qe.createElement(de.BR,null,Qe.createElement(oe.Ux,{override:!0,status:!0},Tn)),addonBefore:jn&&Qe.createElement(de.BR,null,Qe.createElement(oe.Ux,{override:!0,status:!0},jn)),classNames:{input:Xe},classes:{affixWrapper:tt()((0,Vt.Z)(`${rr}-affix-wrapper`,ke,Rn),{[`${rr}-affix-wrapper-sm`]:Be==="small",[`${rr}-affix-wrapper-lg`]:Be==="large",[`${rr}-affix-wrapper-rtl`]:Bt==="rtl",[`${rr}-affix-wrapper-borderless`]:!kr},Fr),wrapper:tt()({[`${dt}-rtl`]:Bt==="rtl",[`${rr}-wrapper-disabled`]:Ie},Fr),group:tt()({[`${rr}-group-wrapper-sm`]:Be==="small",[`${rr}-group-wrapper-lg`]:Be==="large",[`${rr}-group-wrapper-rtl`]:Bt==="rtl"},(0,Vt.Z)(`${rr}-group-wrapper`,ke,Rn),Fr)}},Mr));return Or(Ht)}),vt=_n,cn=Ye=>Qe.createElement(Tt.ZP,{theme:{components:{InputNumber:{handleVisible:!0}}}},Qe.createElement(_n,Object.assign({},Ye)));vt._InternalPanelDoNotUseOrYouWillBeFired=cn;var Sn=vt},9432:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return qt},n:function(){return st}});var fe=ue(19248),Ze=ue(92310),Fe=ue.n(Ze),tt=ue(93681),be=ue(8654),Le=ue(59301),Re=ue(19080),Se=ue(36355),Me=ue(1684),Pe=ue(19716),rt=ue(32441),Te=ue(33234),He=ue(59412),ht=ue(9937);function Je(at){return!!(at.prefix||at.suffix||at.allowClear)}var lt=function(at,ft){var Ve={};for(var _e in at)Object.prototype.hasOwnProperty.call(at,_e)&&ft.indexOf(_e)<0&&(Ve[_e]=at[_e]);if(at!=null&&typeof Object.getOwnPropertySymbols=="function")for(var We=0,_e=Object.getOwnPropertySymbols(at);We<_e.length;We++)ft.indexOf(_e[We])<0&&Object.prototype.propertyIsEnumerable.call(at,_e[We])&&(Ve[_e[We]]=at[_e[We]]);return Ve};function st(at,ft){if(!at)return;at.focus(ft);const{cursor:Ve}=ft||{};if(Ve){const _e=at.value.length;switch(Ve){case"start":at.setSelectionRange(0,0);break;case"end":at.setSelectionRange(_e,_e);break;default:at.setSelectionRange(0,_e);break}}}var qt=(0,Le.forwardRef)((at,ft)=>{var Ve;const{prefixCls:_e,bordered:We=!0,status:et,size:Mt,disabled:Qe,onBlur:Kt,onFocus:ut,suffix:Pt,allowClear:nt,addonAfter:Gt,addonBefore:mn,className:on,style:sn,styles:jt,rootClassName:Ke,onChange:xe,classNames:bt}=at,fn=lt(at,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","style","styles","rootClassName","onChange","classNames"]),{getPrefixCls:Xt,direction:qe,input:je}=Le.useContext(Se.E_),gt=Xt("input",_e),en=(0,Le.useRef)(null),[Zt,pn]=(0,ht.ZP)(gt),{compactSize:Vt,compactItemClassnames:Ft}=(0,Te.ri)(gt,qe),Tt=(0,Pe.Z)(_n=>{var vt;return(vt=Mt!=null?Mt:Vt)!==null&&vt!==void 0?vt:_n}),ge=Le.useContext(Me.Z),se=Qe!=null?Qe:ge,{status:oe,hasFeedback:de,feedbackIcon:pe}=(0,Le.useContext)(rt.aM),le=(0,Re.F)(oe,et),De=Je(at)||!!de,ot=(0,Le.useRef)(De);(0,Le.useEffect)(()=>{var _n;De&&ot.current,ot.current=De},[De]);const $t=(0,He.Z)(en,!0),It=_n=>{$t(),Kt==null||Kt(_n)},Ut=_n=>{$t(),ut==null||ut(_n)},Yt=_n=>{$t(),xe==null||xe(_n)},dn=(de||Pt)&&Le.createElement(Le.Fragment,null,Pt,de&&pe);let hn;return typeof nt=="object"&&(nt!=null&&nt.clearIcon)?hn=nt:nt&&(hn={clearIcon:Le.createElement(fe.Z,null)}),Zt(Le.createElement(tt.default,Object.assign({ref:(0,be.sQ)(ft,en),prefixCls:gt,autoComplete:je==null?void 0:je.autoComplete},fn,{disabled:se,onBlur:It,onFocus:Ut,style:Object.assign(Object.assign({},je==null?void 0:je.style),sn),styles:Object.assign(Object.assign({},je==null?void 0:je.styles),jt),suffix:dn,allowClear:hn,className:Fe()(on,Ke,Ft,je==null?void 0:je.className),onChange:Yt,addonAfter:Gt&&Le.createElement(Te.BR,null,Le.createElement(rt.Ux,{override:!0,status:!0},Gt)),addonBefore:mn&&Le.createElement(Te.BR,null,Le.createElement(rt.Ux,{override:!0,status:!0},mn)),classNames:Object.assign(Object.assign(Object.assign({},bt),je==null?void 0:je.classNames),{input:Fe()({[`${gt}-sm`]:Tt==="small",[`${gt}-lg`]:Tt==="large",[`${gt}-rtl`]:qe==="rtl",[`${gt}-borderless`]:!We},!De&&(0,Re.Z)(gt,le),bt==null?void 0:bt.input,(Ve=je==null?void 0:je.classNames)===null||Ve===void 0?void 0:Ve.input,pn)}),classes:{affixWrapper:Fe()({[`${gt}-affix-wrapper-sm`]:Tt==="small",[`${gt}-affix-wrapper-lg`]:Tt==="large",[`${gt}-affix-wrapper-rtl`]:qe==="rtl",[`${gt}-affix-wrapper-borderless`]:!We},(0,Re.Z)(`${gt}-affix-wrapper`,le,de),pn),wrapper:Fe()({[`${gt}-group-rtl`]:qe==="rtl"},pn),group:Fe()({[`${gt}-group-wrapper-sm`]:Tt==="small",[`${gt}-group-wrapper-lg`]:Tt==="large",[`${gt}-group-wrapper-rtl`]:qe==="rtl",[`${gt}-group-wrapper-disabled`]:se},(0,Re.Z)(`${gt}-group-wrapper`,le,de),pn)}})))})},1643:function(Mn,Qt,ue){"use strict";var fe=ue(19248),Ze=ue(92310),Fe=ue.n(Ze),tt=ue(9296),be=ue(59301),Le=ue(19080),Re=ue(36355),Se=ue(1684),Me=ue(19716),Pe=ue(32441),rt=ue(9432),Te=ue(9937),He=function(Je,lt){var st={};for(var Rt in Je)Object.prototype.hasOwnProperty.call(Je,Rt)&&lt.indexOf(Rt)<0&&(st[Rt]=Je[Rt]);if(Je!=null&&typeof Object.getOwnPropertySymbols=="function")for(var qt=0,Rt=Object.getOwnPropertySymbols(Je);qt<Rt.length;qt++)lt.indexOf(Rt[qt])<0&&Object.prototype.propertyIsEnumerable.call(Je,Rt[qt])&&(st[Rt[qt]]=Je[Rt[qt]]);return st};const ht=(0,be.forwardRef)((Je,lt)=>{const{prefixCls:st,bordered:Rt=!0,size:qt,disabled:at,status:ft,allowClear:Ve,showCount:_e,classNames:We,rootClassName:et,className:Mt}=Je,Qe=He(Je,["prefixCls","bordered","size","disabled","status","allowClear","showCount","classNames","rootClassName","className"]),{getPrefixCls:Kt,direction:ut}=be.useContext(Re.E_),Pt=(0,Me.Z)(qt),nt=be.useContext(Se.Z),Gt=at!=null?at:nt,{status:mn,hasFeedback:on,feedbackIcon:sn}=be.useContext(Pe.aM),jt=(0,Le.F)(mn,ft),Ke=be.useRef(null);be.useImperativeHandle(lt,()=>{var qe;return{resizableTextArea:(qe=Ke.current)===null||qe===void 0?void 0:qe.resizableTextArea,focus:je=>{var gt,en;(0,rt.n)((en=(gt=Ke.current)===null||gt===void 0?void 0:gt.resizableTextArea)===null||en===void 0?void 0:en.textArea,je)},blur:()=>{var je;return(je=Ke.current)===null||je===void 0?void 0:je.blur()}}});const xe=Kt("input",st);let bt;typeof Ve=="object"&&(Ve!=null&&Ve.clearIcon)?bt=Ve:Ve&&(bt={clearIcon:be.createElement(fe.Z,null)});const[fn,Xt]=(0,Te.ZP)(xe);return fn(be.createElement(tt.default,Object.assign({},Qe,{disabled:Gt,allowClear:bt,className:Fe()(Mt,et),classes:{affixWrapper:Fe()(`${xe}-textarea-affix-wrapper`,{[`${xe}-affix-wrapper-rtl`]:ut==="rtl",[`${xe}-affix-wrapper-borderless`]:!Rt,[`${xe}-affix-wrapper-sm`]:Pt==="small",[`${xe}-affix-wrapper-lg`]:Pt==="large",[`${xe}-textarea-show-count`]:_e},(0,Le.Z)(`${xe}-affix-wrapper`,jt),Xt)},classNames:Object.assign(Object.assign({},We),{textarea:Fe()({[`${xe}-borderless`]:!Rt,[`${xe}-sm`]:Pt==="small",[`${xe}-lg`]:Pt==="large"},(0,Le.Z)(xe,jt),Xt,We==null?void 0:We.textarea)}),prefixCls:xe,suffix:on&&be.createElement("span",{className:`${xe}-textarea-suffix`},sn),showCount:_e,ref:Ke})))});Qt.Z=ht},59412:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Ze}});var fe=ue(59301);function Ze(Fe,tt){const be=(0,fe.useRef)([]),Le=()=>{be.current.push(setTimeout(()=>{var Re,Se,Me,Pe;!((Re=Fe.current)===null||Re===void 0)&&Re.input&&((Se=Fe.current)===null||Se===void 0?void 0:Se.input.getAttribute("type"))==="password"&&(!((Me=Fe.current)===null||Me===void 0)&&Me.input.hasAttribute("value"))&&((Pe=Fe.current)===null||Pe===void 0||Pe.input.removeAttribute("value"))}))};return(0,fe.useEffect)(()=>(tt&&Le(),()=>be.current.forEach(Re=>{Re&&clearTimeout(Re)})),[]),Le}},92832:function(Mn,Qt,ue){"use strict";ue.d(Qt,{default:function(){return Pt}});var fe=ue(92310),Ze=ue.n(fe),Fe=ue(59301),tt=ue(36355),be=ue(32441),Le=ue(9937),Se=nt=>{const{getPrefixCls:Gt,direction:mn}=(0,Fe.useContext)(tt.E_),{prefixCls:on,className:sn}=nt,jt=Gt("input-group",on),Ke=Gt("input"),[xe,bt]=(0,Le.ZP)(Ke),fn=Ze()(jt,{[`${jt}-lg`]:nt.size==="large",[`${jt}-sm`]:nt.size==="small",[`${jt}-compact`]:nt.compact,[`${jt}-rtl`]:mn==="rtl"},bt,sn),Xt=(0,Fe.useContext)(be.aM),qe=(0,Fe.useMemo)(()=>Object.assign(Object.assign({},Xt),{isFormItemInput:!1}),[Xt]);return xe(Fe.createElement("span",{className:fn,style:nt.style,onMouseEnter:nt.onMouseEnter,onMouseLeave:nt.onMouseLeave,onFocus:nt.onFocus,onBlur:nt.onBlur},Fe.createElement(be.aM.Provider,{value:qe},nt.children)))},Me=ue(9432),Pe=ue(73331),rt=ue(15277),Te=ue(2738),He=ue(8654),ht=ue(59412),Je=function(nt,Gt){var mn={};for(var on in nt)Object.prototype.hasOwnProperty.call(nt,on)&&Gt.indexOf(on)<0&&(mn[on]=nt[on]);if(nt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var sn=0,on=Object.getOwnPropertySymbols(nt);sn<on.length;sn++)Gt.indexOf(on[sn])<0&&Object.prototype.propertyIsEnumerable.call(nt,on[sn])&&(mn[on[sn]]=nt[on[sn]]);return mn};const lt=nt=>nt?Fe.createElement(rt.Z,null):Fe.createElement(Pe.Z,null),st={click:"onClick",hover:"onMouseOver"};var qt=Fe.forwardRef((nt,Gt)=>{const{visibilityToggle:mn=!0}=nt,on=typeof mn=="object"&&mn.visible!==void 0,[sn,jt]=(0,Fe.useState)(()=>on?mn.visible:!1),Ke=(0,Fe.useRef)(null);Fe.useEffect(()=>{on&&jt(mn.visible)},[on,mn]);const xe=(0,ht.Z)(Ke),bt=()=>{const{disabled:se}=nt;se||(sn&&xe(),jt(oe=>{var de;const pe=!oe;return typeof mn=="object"&&((de=mn.onVisibleChange)===null||de===void 0||de.call(mn,pe)),pe}))},fn=se=>{const{action:oe="click",iconRender:de=lt}=nt,pe=st[oe]||"",le=de(sn),De={[pe]:bt,className:`${se}-icon`,key:"passwordIcon",onMouseDown:ot=>{ot.preventDefault()},onMouseUp:ot=>{ot.preventDefault()}};return Fe.cloneElement(Fe.isValidElement(le)?le:Fe.createElement("span",null,le),De)},{className:Xt,prefixCls:qe,inputPrefixCls:je,size:gt}=nt,en=Je(nt,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:Zt}=Fe.useContext(tt.E_),pn=Zt("input",je),Vt=Zt("input-password",qe),Ft=mn&&fn(Vt),Tt=Ze()(Vt,Xt,{[`${Vt}-${gt}`]:!!gt}),ge=Object.assign(Object.assign({},(0,Te.Z)(en,["suffix","iconRender","visibilityToggle"])),{type:sn?"text":"password",className:Tt,prefixCls:pn,suffix:Ft});return gt&&(ge.size=gt),Fe.createElement(Me.Z,Object.assign({ref:(0,He.sQ)(Gt,Ke)},ge))}),at=ue(47472),ft=ue(92343),Ve=ue(3113),_e=ue(19716),We=ue(33234),et=function(nt,Gt){var mn={};for(var on in nt)Object.prototype.hasOwnProperty.call(nt,on)&&Gt.indexOf(on)<0&&(mn[on]=nt[on]);if(nt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var sn=0,on=Object.getOwnPropertySymbols(nt);sn<on.length;sn++)Gt.indexOf(on[sn])<0&&Object.prototype.propertyIsEnumerable.call(nt,on[sn])&&(mn[on[sn]]=nt[on[sn]]);return mn},Qe=Fe.forwardRef((nt,Gt)=>{const{prefixCls:mn,inputPrefixCls:on,className:sn,size:jt,suffix:Ke,enterButton:xe=!1,addonAfter:bt,loading:fn,disabled:Xt,onSearch:qe,onChange:je,onCompositionStart:gt,onCompositionEnd:en}=nt,Zt=et(nt,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:pn,direction:Vt}=Fe.useContext(tt.E_),Ft=Fe.useRef(!1),Tt=pn("input-search",mn),ge=pn("input",on),{compactSize:se}=(0,We.ri)(Tt,Vt),oe=(0,_e.Z)(cn=>{var Sn;return(Sn=jt!=null?jt:se)!==null&&Sn!==void 0?Sn:cn}),de=Fe.useRef(null),pe=cn=>{cn&&cn.target&&cn.type==="click"&&qe&&qe(cn.target.value,cn,{source:"clear"}),je&&je(cn)},le=cn=>{var Sn;document.activeElement===((Sn=de.current)===null||Sn===void 0?void 0:Sn.input)&&cn.preventDefault()},De=cn=>{var Sn,Ye;qe&&qe((Ye=(Sn=de.current)===null||Sn===void 0?void 0:Sn.input)===null||Ye===void 0?void 0:Ye.value,cn,{source:"input"})},ot=cn=>{Ft.current||fn||De(cn)},$t=typeof xe=="boolean"?Fe.createElement(at.Z,null):null,It=`${Tt}-button`;let Ut;const Yt=xe||{},dn=Yt.type&&Yt.type.__ANT_BUTTON===!0;dn||Yt.type==="button"?Ut=(0,ft.Tm)(Yt,Object.assign({onMouseDown:le,onClick:cn=>{var Sn,Ye;(Ye=(Sn=Yt==null?void 0:Yt.props)===null||Sn===void 0?void 0:Sn.onClick)===null||Ye===void 0||Ye.call(Sn,cn),De(cn)},key:"enterButton"},dn?{className:It,size:oe}:{})):Ut=Fe.createElement(Ve.ZP,{className:It,type:xe?"primary":void 0,size:oe,disabled:Xt,key:"enterButton",onMouseDown:le,onClick:De,loading:fn,icon:$t},xe),bt&&(Ut=[Ut,(0,ft.Tm)(bt,{key:"addonAfter"})]);const hn=Ze()(Tt,{[`${Tt}-rtl`]:Vt==="rtl",[`${Tt}-${oe}`]:!!oe,[`${Tt}-with-button`]:!!xe},sn),_n=cn=>{Ft.current=!0,gt==null||gt(cn)},vt=cn=>{Ft.current=!1,en==null||en(cn)};return Fe.createElement(Me.Z,Object.assign({ref:(0,He.sQ)(de,Gt),onPressEnter:ot},Zt,{size:oe,onCompositionStart:_n,onCompositionEnd:vt,prefixCls:ge,addonAfter:Ut,suffix:Ke,onChange:pe,className:hn,disabled:Xt}))}),Kt=ue(1643);const ut=Me.Z;ut.Group=Se,ut.Search=Qe,ut.TextArea=Kt.Z,ut.Password=qt;var Pt=ut},9937:function(Mn,Qt,ue){"use strict";ue.d(Qt,{M1:function(){return Re},TM:function(){return ft},Xy:function(){return Se},bi:function(){return rt},e5:function(){return at},ik:function(){return Te},nz:function(){return be},pU:function(){return Le},s7:function(){return He},x0:function(){return Pe}});var fe=ue(17313),Ze=ue(74207),Fe=ue(37613),tt=ue(83116);const be=Ve=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:Ve,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),Le=Ve=>({borderColor:Ve.hoverBorderColor}),Re=Ve=>({borderColor:Ve.activeBorderColor,boxShadow:Ve.activeShadow,outline:0}),Se=Ve=>({color:Ve.colorTextDisabled,backgroundColor:Ve.colorBgContainerDisabled,borderColor:Ve.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},Le((0,Fe.TS)(Ve,{hoverBorderColor:Ve.colorBorder})))}),Me=Ve=>{const{paddingBlockLG:_e,fontSizeLG:We,lineHeightLG:et,borderRadiusLG:Mt,paddingInlineLG:Qe}=Ve;return{padding:`${_e}px ${Qe}px`,fontSize:We,lineHeight:et,borderRadius:Mt}},Pe=Ve=>({padding:`${Ve.paddingBlockSM}px ${Ve.paddingInlineSM}px`,borderRadius:Ve.borderRadiusSM}),rt=(Ve,_e)=>{const{componentCls:We,colorError:et,colorWarning:Mt,errorActiveShadow:Qe,warningActiveShadow:Kt,colorErrorBorderHover:ut,colorWarningBorderHover:Pt}=Ve;return{[`&-status-error:not(${_e}-disabled):not(${_e}-borderless)${_e}`]:{borderColor:et,"&:hover":{borderColor:ut},"&:focus, &-focused":Object.assign({},Re((0,Fe.TS)(Ve,{activeBorderColor:et,activeShadow:Qe}))),[`${We}-prefix, ${We}-suffix`]:{color:et}},[`&-status-warning:not(${_e}-disabled):not(${_e}-borderless)${_e}`]:{borderColor:Mt,"&:hover":{borderColor:Pt},"&:focus, &-focused":Object.assign({},Re((0,Fe.TS)(Ve,{activeBorderColor:Mt,activeShadow:Kt}))),[`${We}-prefix, ${We}-suffix`]:{color:Mt}}}},Te=Ve=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${Ve.paddingBlock}px ${Ve.paddingInline}px`,color:Ve.colorText,fontSize:Ve.fontSize,lineHeight:Ve.lineHeight,backgroundColor:Ve.colorBgContainer,backgroundImage:"none",borderWidth:Ve.lineWidth,borderStyle:Ve.lineType,borderColor:Ve.colorBorder,borderRadius:Ve.borderRadius,transition:`all ${Ve.motionDurationMid}`},be(Ve.colorTextPlaceholder)),{"&:hover":Object.assign({},Le(Ve)),"&:focus, &-focused":Object.assign({},Re(Ve)),"&-disabled, &[disabled]":Object.assign({},Se(Ve)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:"transparent",border:"none",boxShadow:"none"}},"textarea&":{maxWidth:"100%",height:"auto",minHeight:Ve.controlHeight,lineHeight:Ve.lineHeight,verticalAlign:"bottom",transition:`all ${Ve.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},Me(Ve)),"&-sm":Object.assign({},Pe(Ve)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),He=Ve=>{const{componentCls:_e,antCls:We}=Ve;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:Ve.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${_e}, &-lg > ${_e}-group-addon`]:Object.assign({},Me(Ve)),[`&-sm ${_e}, &-sm > ${_e}-group-addon`]:Object.assign({},Pe(Ve)),[`&-lg ${We}-select-single ${We}-select-selector`]:{height:Ve.controlHeightLG},[`&-sm ${We}-select-single ${We}-select-selector`]:{height:Ve.controlHeightSM},[`> ${_e}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${_e}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${Ve.paddingInline}px`,color:Ve.colorText,fontWeight:"normal",fontSize:Ve.fontSize,textAlign:"center",backgroundColor:Ve.colorFillAlter,border:`${Ve.lineWidth}px ${Ve.lineType} ${Ve.colorBorder}`,borderRadius:Ve.borderRadius,transition:`all ${Ve.motionDurationSlow}`,lineHeight:1,[`${We}-select`]:{margin:`-${Ve.paddingBlock+1}px -${Ve.paddingInline}px`,[`&${We}-select-single:not(${We}-select-customize-input)`]:{[`${We}-select-selector`]:{backgroundColor:"inherit",border:`${Ve.lineWidth}px ${Ve.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${We}-select-selector`]:{color:Ve.colorPrimary}}},[`${We}-cascader-picker`]:{margin:`-9px -${Ve.paddingInline}px`,backgroundColor:"transparent",[`${We}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${_e}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${_e}-search-with-button &`]:{zIndex:0}}},[`> ${_e}:first-child, ${_e}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${We}-select ${We}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${_e}-affix-wrapper`]:{[`&:not(:first-child) ${_e}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${_e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${_e}:last-child, ${_e}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${We}-select ${We}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${_e}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${_e}-search &`]:{borderStartStartRadius:Ve.borderRadius,borderEndStartRadius:Ve.borderRadius}},[`&:not(:first-child), ${_e}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${_e}-group-compact`]:Object.assign(Object.assign({display:"block"},(0,fe.dF)()),{[`${_e}-group-addon, ${_e}-group-wrap, > ${_e}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:Ve.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`
& > ${_e}-affix-wrapper,
& > ${_e}-number-affix-wrapper,
& > ${We}-picker-range
`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-Ve.lineWidth,borderInlineEndWidth:Ve.lineWidth},[`${_e}`]:{float:"none"},[`& > ${We}-select > ${We}-select-selector,
& > ${We}-select-auto-complete ${_e},
& > ${We}-cascader-picker ${_e},
& > ${_e}-group-wrapper ${_e}`]:{borderInlineEndWidth:Ve.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${We}-select-focused`]:{zIndex:1},[`& > ${We}-select > ${We}-select-arrow`]:{zIndex:1},[`& > *:first-child,
& > ${We}-select:first-child > ${We}-select-selector,
& > ${We}-select-auto-complete:first-child ${_e},
& > ${We}-cascader-picker:first-child ${_e}`]:{borderStartStartRadius:Ve.borderRadius,borderEndStartRadius:Ve.borderRadius},[`& > *:last-child,
& > ${We}-select:last-child > ${We}-select-selector,
& > ${We}-cascader-picker:last-child ${_e},
& > ${We}-cascader-picker-focused:last-child ${_e}`]:{borderInlineEndWidth:Ve.lineWidth,borderStartEndRadius:Ve.borderRadius,borderEndEndRadius:Ve.borderRadius},[`& > ${We}-select-auto-complete ${_e}`]:{verticalAlign:"top"},[`${_e}-group-wrapper + ${_e}-group-wrapper`]:{marginInlineStart:-Ve.lineWidth,[`${_e}-affix-wrapper`]:{borderRadius:0}},[`${_e}-group-wrapper:not(:last-child)`]:{[`&${_e}-search > ${_e}-group`]:{[`& > ${_e}-group-addon > ${_e}-search-button`]:{borderRadius:0},[`& > ${_e}`]:{borderStartStartRadius:Ve.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:Ve.borderRadius}}}})}},ht=Ve=>{const{componentCls:_e,controlHeightSM:We,lineWidth:et}=Ve,Qe=(We-et*2-16)/2;return{[_e]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,fe.Wf)(Ve)),Te(Ve)),rt(Ve,_e)),{'&[type="color"]':{height:Ve.controlHeight,[`&${_e}-lg`]:{height:Ve.controlHeightLG},[`&${_e}-sm`]:{height:We,paddingTop:Qe,paddingBottom:Qe}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},Je=Ve=>{const{componentCls:_e}=Ve;return{[`${_e}-clear-icon`]:{margin:0,color:Ve.colorTextQuaternary,fontSize:Ve.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${Ve.motionDurationSlow}`,"&:hover":{color:Ve.colorTextTertiary},"&:active":{color:Ve.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${Ve.inputAffixPadding}px`}}}},lt=Ve=>{const{componentCls:_e,inputAffixPadding:We,colorTextDescription:et,motionDurationSlow:Mt,colorIcon:Qe,colorIconHover:Kt,iconCls:ut}=Ve;return{[`${_e}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Te(Ve)),{display:"inline-flex",[`&:not(${_e}-affix-wrapper-disabled):hover`]:Object.assign(Object.assign({},Le(Ve)),{zIndex:1,[`${_e}-search-with-button &`]:{zIndex:0}}),"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${_e}[disabled]`]:{background:"transparent"}},[`> input${_e}`]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${_e}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:Ve.paddingXS}},"&-show-count-suffix":{color:et},"&-show-count-has-suffix":{marginInlineEnd:Ve.paddingXXS},"&-prefix":{marginInlineEnd:We},"&-suffix":{marginInlineStart:We}}}),Je(Ve)),{[`${ut}${_e}-password-icon`]:{color:Qe,cursor:"pointer",transition:`all ${Mt}`,"&:hover":{color:Kt}}}),rt(Ve,`${_e}-affix-wrapper`))}},st=Ve=>{const{componentCls:_e,colorError:We,colorWarning:et,borderRadiusLG:Mt,borderRadiusSM:Qe}=Ve;return{[`${_e}-group`]:Object.assign(Object.assign(Object.assign({},(0,fe.Wf)(Ve)),He(Ve)),{"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${_e}-group-addon`]:{borderRadius:Mt,fontSize:Ve.fontSizeLG}},"&-sm":{[`${_e}-group-addon`]:{borderRadius:Qe}},"&-status-error":{[`${_e}-group-addon`]:{color:We,borderColor:We}},"&-status-warning":{[`${_e}-group-addon`]:{color:et,borderColor:et}},"&-disabled":{[`${_e}-group-addon`]:Object.assign({},Se(Ve))},[`&:not(${_e}-compact-first-item):not(${_e}-compact-last-item)${_e}-compact-item`]:{[`${_e}, ${_e}-group-addon`]:{borderRadius:0}},[`&:not(${_e}-compact-last-item)${_e}-compact-first-item`]:{[`${_e}, ${_e}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${_e}-compact-first-item)${_e}-compact-last-item`]:{[`${_e}, ${_e}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}})}},Rt=Ve=>{const{componentCls:_e,antCls:We}=Ve,et=`${_e}-search`;return{[et]:{[`${_e}`]:{"&:hover, &:focus":{borderColor:Ve.colorPrimaryHover,[`+ ${_e}-group-addon ${et}-button:not(${We}-btn-primary)`]:{borderInlineStartColor:Ve.colorPrimaryHover}}},[`${_e}-affix-wrapper`]:{borderRadius:0},[`${_e}-lg`]:{lineHeight:Ve.lineHeightLG-2e-4},[`> ${_e}-group`]:{[`> ${_e}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${et}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:Ve.borderRadius,borderEndEndRadius:Ve.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${et}-button:not(${We}-btn-primary)`]:{color:Ve.colorTextDescription,"&:hover":{color:Ve.colorPrimaryHover},"&:active":{color:Ve.colorPrimaryActive},[`&${We}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${et}-button`]:{height:Ve.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${et}-button`]:{height:Ve.controlHeightLG},[`&-small ${et}-button`]:{height:Ve.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${_e}-compact-item`]:{[`&:not(${_e}-compact-last-item)`]:{[`${_e}-group-addon`]:{[`${_e}-search-button`]:{marginInlineEnd:-Ve.lineWidth,borderRadius:0}}},[`&:not(${_e}-compact-first-item)`]:{[`${_e},${_e}-affix-wrapper`]:{borderRadius:0}},[`> ${_e}-group-addon ${_e}-search-button,
> ${_e},
${_e}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${_e}-affix-wrapper-focused`]:{zIndex:2}}}}},qt=Ve=>{const{componentCls:_e,paddingLG:We}=Ve,et=`${_e}-textarea`;return{[et]:{position:"relative","&-show-count":{[`> ${_e}`]:{height:"100%"},[`${_e}-data-count`]:{position:"absolute",bottom:-Ve.fontSize*Ve.lineHeight,insetInlineEnd:0,color:Ve.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${_e}`]:{paddingInlineEnd:We}},[`&-affix-wrapper${et}-has-feedback`]:{[`${_e}`]:{paddingInlineEnd:We}},[`&-affix-wrapper${_e}-affix-wrapper`]:{padding:0,[`> textarea${_e}`]:{fontSize:"inherit",border:"none",outline:"none","&:focus":{boxShadow:"none !important"}},[`${_e}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${_e}-clear-icon`]:{position:"absolute",insetInlineEnd:Ve.paddingXS,insetBlockStart:Ve.paddingXS},[`${et}-suffix`]:{position:"absolute",top:0,insetInlineEnd:Ve.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}};function at(Ve){return(0,Fe.TS)(Ve,{inputAffixPadding:Ve.paddingXXS})}const ft=Ve=>{const{controlHeight:_e,fontSize:We,lineHeight:et,lineWidth:Mt,controlHeightSM:Qe,controlHeightLG:Kt,fontSizeLG:ut,lineHeightLG:Pt,paddingSM:nt,controlPaddingHorizontalSM:Gt,controlPaddingHorizontal:mn,colorFillAlter:on,colorPrimaryHover:sn,controlOutlineWidth:jt,controlOutline:Ke,colorErrorOutline:xe,colorWarningOutline:bt}=Ve;return{paddingBlock:Math.max(Math.round((_e-We*et)/2*10)/10-Mt,3),paddingBlockSM:Math.max(Math.round((Qe-We*et)/2*10)/10-Mt,0),paddingBlockLG:Math.ceil((Kt-ut*Pt)/2*10)/10-Mt,paddingInline:nt-Mt,paddingInlineSM:Gt-Mt,paddingInlineLG:mn-Mt,addonBg:on,activeBorderColor:sn,hoverBorderColor:sn,activeShadow:`0 0 0 ${jt}px ${Ke}`,errorActiveShadow:`0 0 0 ${jt}px ${xe}`,warningActiveShadow:`0 0 0 ${jt}px ${bt}`}};Qt.ZP=(0,tt.Z)("Input",Ve=>{const _e=(0,Fe.TS)(Ve,at(Ve));return[ht(_e),qt(_e),lt(_e),st(_e),Rt(_e),(0,Ze.c)(_e)]},ft)},45818:function(Mn,Qt,ue){"use strict";ue.d(Qt,{D:function(){return at},Z:function(){return _e}});var fe=ue(54476),Ze=ue(59301),Fe={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"},tt=Fe,be=ue(7657),Le=function(et,Mt){return Ze.createElement(be.Z,(0,fe.Z)({},et,{ref:Mt,icon:tt}))},Re=Ze.forwardRef(Le),Se=Re,Me=ue(33853),Pe=ue(38819),rt=ue(92310),Te=ue.n(rt),He=ue(2738),Je=We=>!isNaN(parseFloat(We))&&isFinite(We),lt=ue(36355),st=ue(84966),Rt=function(We,et){var Mt={};for(var Qe in We)Object.prototype.hasOwnProperty.call(We,Qe)&&et.indexOf(Qe)<0&&(Mt[Qe]=We[Qe]);if(We!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Kt=0,Qe=Object.getOwnPropertySymbols(We);Kt<Qe.length;Kt++)et.indexOf(Qe[Kt])<0&&Object.prototype.propertyIsEnumerable.call(We,Qe[Kt])&&(Mt[Qe[Kt]]=We[Qe[Kt]]);return Mt};const qt={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px"},at=Ze.createContext({}),ft=(()=>{let We=0;return function(){let et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return We+=1,`${et}${We}`}})();var _e=Ze.forwardRef((We,et)=>{const{prefixCls:Mt,className:Qe,trigger:Kt,children:ut,defaultCollapsed:Pt=!1,theme:nt="dark",style:Gt={},collapsible:mn=!1,reverseArrow:on=!1,width:sn=200,collapsedWidth:jt=80,zeroWidthTriggerStyle:Ke,breakpoint:xe,onCollapse:bt,onBreakpoint:fn}=We,Xt=Rt(We,["prefixCls","className","trigger","children","defaultCollapsed","theme","style","collapsible","reverseArrow","width","collapsedWidth","zeroWidthTriggerStyle","breakpoint","onCollapse","onBreakpoint"]),{siderHook:qe}=(0,Ze.useContext)(st.Gs),[je,gt]=(0,Ze.useState)("collapsed"in We?We.collapsed:Pt),[en,Zt]=(0,Ze.useState)(!1);(0,Ze.useEffect)(()=>{"collapsed"in We&&gt(We.collapsed)},[We.collapsed]);const pn=(oe,de)=>{"collapsed"in We||gt(oe),bt==null||bt(oe,de)},Vt=(0,Ze.useRef)();Vt.current=oe=>{Zt(oe.matches),fn==null||fn(oe.matches),je!==oe.matches&&pn(oe.matches,"responsive")},(0,Ze.useEffect)(()=>{function oe(pe){return Vt.current(pe)}let de;if(typeof window!="undefined"){const{matchMedia:pe}=window;if(pe&&xe&&xe in qt){de=pe(`(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(pe){de==null||de.removeListener(oe)}}},[xe]),(0,Ze.useEffect)(()=>{const oe=ft("ant-sider-");return qe.addSider(oe),()=>qe.removeSider(oe)},[]);const Ft=()=>{pn(!je,"clickTrigger")},{getPrefixCls:Tt}=(0,Ze.useContext)(lt.E_),ge=()=>{const oe=Tt("layout-sider",Mt),de=(0,He.Z)(Xt,["collapsed"]),pe=je?jt:sn,le=Je(pe)?`${pe}px`:String(pe),De=parseFloat(String(jt||0))===0?Ze.createElement("span",{onClick:Ft,className:Te()(`${oe}-zero-width-trigger`,`${oe}-zero-width-trigger-${on?"right":"left"}`),style:Ke},Kt||Ze.createElement(Se,null)):null,It={expanded:on?Ze.createElement(Pe.Z,null):Ze.createElement(Me.Z,null),collapsed:on?Ze.createElement(Me.Z,null):Ze.createElement(Pe.Z,null)}[je?"collapsed":"expanded"],Ut=Kt!==null?De||Ze.createElement("div",{className:`${oe}-trigger`,onClick:Ft,style:{width:le}},Kt||It):null,Yt=Object.assign(Object.assign({},Gt),{flex:`0 0 ${le}`,maxWidth:le,minWidth:le,width:le}),dn=Te()(oe,`${oe}-${nt}`,{[`${oe}-collapsed`]:!!je,[`${oe}-has-trigger`]:mn&&Kt!==null&&!De,[`${oe}-below`]:!!en,[`${oe}-zero-width`]:parseFloat(le)===0},Qe);return Ze.createElement("aside",Object.assign({className:dn},de,{style:Yt,ref:et}),Ze.createElement("div",{className:`${oe}-children`},ut),mn||en&&De?Ut:null)},se=Ze.useMemo(()=>({siderCollapsed:je}),[je]);return Ze.createElement(at.Provider,{value:se},ge())})},44e3:function(Mn,Qt,ue){"use strict";var fe=ue(84966),Ze=ue(45818);const Fe=fe.ZP;Fe.Header=fe.h4,Fe.Footer=fe.$_,Fe.Content=fe.VY,Fe.Sider=Ze.Z,Qt.default=Fe},84966:function(Mn,Qt,ue){"use strict";ue.d(Qt,{VY:function(){return at},$_:function(){return qt},h4:function(){return Rt},Gs:function(){return He},ZP:function(){return ft}});var fe=ue(94480),Ze=ue(92310),Fe=ue.n(Ze),tt=ue(2738),be=ue(59301),Le=ue(36355),Re=ue(83116),Me=Ve=>{const{componentCls:_e,bodyBg:We,lightSiderBg:et,lightTriggerBg:Mt,lightTriggerColor:Qe}=Ve;return{[`${_e}-sider-light`]:{background:et,[`${_e}-sider-trigger`]:{color:Qe,background:Mt},[`${_e}-sider-zero-width-trigger`]:{color:Qe,background:Mt,border:`1px solid ${We}`,borderInlineStart:0}}}};const Pe=Ve=>{const{antCls:_e,componentCls:We,colorText:et,triggerColor:Mt,footerBg:Qe,triggerBg:Kt,headerHeight:ut,headerPadding:Pt,headerColor:nt,footerPadding:Gt,triggerHeight:mn,zeroTriggerHeight:on,zeroTriggerWidth:sn,motionDurationMid:jt,motionDurationSlow:Ke,fontSize:xe,borderRadius:bt,bodyBg:fn,headerBg:Xt,siderBg:qe}=Ve;return{[We]:Object.assign(Object.assign({display:"flex",flex:"auto",flexDirection:"column",minHeight:0,background:fn,"&, *":{boxSizing:"border-box"},[`&${We}-has-sider`]:{flexDirection:"row",[`> ${We}, > ${We}-content`]:{width:0}},[`${We}-header, &${We}-footer`]:{flex:"0 0 auto"},[`${We}-sider`]:{position:"relative",minWidth:0,background:qe,transition:`all ${jt}, background 0s`,"&-children":{height:"100%",marginTop:-.1,paddingTop:.1,[`${_e}-menu${_e}-menu-inline-collapsed`]:{width:"auto"}},"&-has-trigger":{paddingBottom:mn},"&-right":{order:1},"&-trigger":{position:"fixed",bottom:0,zIndex:1,height:mn,color:Mt,lineHeight:`${mn}px`,textAlign:"center",background:Kt,cursor:"pointer",transition:`all ${jt}`},"&-zero-width":{"> *":{overflow:"hidden"},"&-trigger":{position:"absolute",top:ut,insetInlineEnd:-sn,zIndex:1,width:sn,height:on,color:Mt,fontSize:Ve.fontSizeXL,display:"flex",alignItems:"center",justifyContent:"center",background:qe,borderStartStartRadius:0,borderStartEndRadius:bt,borderEndEndRadius:bt,borderEndStartRadius:0,cursor:"pointer",transition:`background ${Ke} ease`,"&::after":{position:"absolute",inset:0,background:"transparent",transition:`all ${Ke}`,content:'""'},"&:hover::after":{background:"rgba(255, 255, 255, 0.2)"},"&-right":{insetInlineStart:-sn,borderStartStartRadius:bt,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:bt}}}}},Me(Ve)),{"&-rtl":{direction:"rtl"}}),[`${We}-header`]:{height:ut,padding:Pt,color:nt,lineHeight:`${ut}px`,background:Xt,[`${_e}-menu`]:{lineHeight:"inherit"}},[`${We}-footer`]:{padding:Gt,color:et,fontSize:xe,background:Qe},[`${We}-content`]:{flex:"auto",minHeight:0}}};var rt=(0,Re.Z)("Layout",Ve=>[Pe(Ve)],Ve=>{const{colorBgLayout:_e,controlHeight:We,controlHeightLG:et,colorText:Mt,controlHeightSM:Qe,marginXXS:Kt,colorTextLightSolid:ut,colorBgContainer:Pt}=Ve,nt=et*1.25;return{colorBgHeader:"#001529",colorBgBody:_e,colorBgTrigger:"#002140",bodyBg:_e,headerBg:"#001529",headerHeight:We*2,headerPadding:`0 ${nt}px`,headerColor:Mt,footerPadding:`${Qe}px ${nt}px`,footerBg:_e,siderBg:"#001529",triggerHeight:et+Kt*2,triggerBg:"#002140",triggerColor:ut,zeroTriggerWidth:et,zeroTriggerHeight:et,lightSiderBg:Pt,lightTriggerBg:Pt,lightTriggerColor:Mt}},{deprecatedTokens:[["colorBgBody","bodyBg"],["colorBgHeader","headerBg"],["colorBgTrigger","triggerBg"]]}),Te=function(Ve,_e){var We={};for(var et in Ve)Object.prototype.hasOwnProperty.call(Ve,et)&&_e.indexOf(et)<0&&(We[et]=Ve[et]);if(Ve!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Mt=0,et=Object.getOwnPropertySymbols(Ve);Mt<et.length;Mt++)_e.indexOf(et[Mt])<0&&Object.prototype.propertyIsEnumerable.call(Ve,et[Mt])&&(We[et[Mt]]=Ve[et[Mt]]);return We};const He=be.createContext({siderHook:{addSider:()=>null,removeSider:()=>null}});function ht(Ve){let{suffixCls:_e,tagName:We,displayName:et}=Ve;return Mt=>be.forwardRef((Kt,ut)=>be.createElement(Mt,Object.assign({ref:ut,suffixCls:_e,tagName:We},Kt)))}const Je=be.forwardRef((Ve,_e)=>{const{prefixCls:We,suffixCls:et,className:Mt,tagName:Qe}=Ve,Kt=Te(Ve,["prefixCls","suffixCls","className","tagName"]),{getPrefixCls:ut}=be.useContext(Le.E_),Pt=ut("layout",We),[nt,Gt]=rt(Pt),mn=et?`${Pt}-${et}`:Pt;return nt(be.createElement(Qe,Object.assign({className:Fe()(We||mn,Mt,Gt),ref:_e},Kt)))}),lt=be.forwardRef((Ve,_e)=>{const{direction:We}=be.useContext(Le.E_),[et,Mt]=be.useState([]),{prefixCls:Qe,className:Kt,rootClassName:ut,children:Pt,hasSider:nt,tagName:Gt,style:mn}=Ve,on=Te(Ve,["prefixCls","className","rootClassName","children","hasSider","tagName","style"]),sn=(0,tt.Z)(on,["suffixCls"]),{getPrefixCls:jt,layout:Ke}=be.useContext(Le.E_),xe=jt("layout",Qe),[bt,fn]=rt(xe),Xt=Fe()(xe,{[`${xe}-has-sider`]:typeof nt=="boolean"?nt:et.length>0,[`${xe}-rtl`]:We==="rtl"},Ke==null?void 0:Ke.className,Kt,ut,fn),qe=be.useMemo(()=>({siderHook:{addSider:je=>{Mt(gt=>[].concat((0,fe.Z)(gt),[je]))},removeSider:je=>{Mt(gt=>gt.filter(en=>en!==je))}}}),[]);return bt(be.createElement(He.Provider,{value:qe},be.createElement(Gt,Object.assign({ref:_e,className:Xt,style:Object.assign(Object.assign({},Ke==null?void 0:Ke.style),mn)},sn),Pt)))}),st=ht({tagName:"div",displayName:"Layout"})(lt),Rt=ht({suffixCls:"header",tagName:"header",displayName:"Header"})(Je),qt=ht({suffixCls:"footer",tagName:"footer",displayName:"Footer"})(Je),at=ht({suffixCls:"content",tagName:"main",displayName:"Content"})(Je);var ft=st},40875:function(Mn,Qt,ue){"use strict";ue.d(Qt,{J:function(){return Le}});var fe=ue(59301),Ze=ue(33234),Fe=ue(70425),tt=function(Re,Se){var Me={};for(var Pe in Re)Object.prototype.hasOwnProperty.call(Re,Pe)&&Se.indexOf(Pe)<0&&(Me[Pe]=Re[Pe]);if(Re!=null&&typeof Object.getOwnPropertySymbols=="function")for(var rt=0,Pe=Object.getOwnPropertySymbols(Re);rt<Pe.length;rt++)Se.indexOf(Pe[rt])<0&&Object.prototype.propertyIsEnumerable.call(Re,Pe[rt])&&(Me[Pe[rt]]=Re[Pe[rt]]);return Me};const be=fe.createContext(null),Le=fe.forwardRef((Re,Se)=>{const{children:Me}=Re,Pe=tt(Re,["children"]),rt=fe.useContext(be),Te=fe.useMemo(()=>Object.assign(Object.assign({},rt),Pe),[rt,Pe.prefixCls,Pe.mode,Pe.selectable]);return fe.createElement(be.Provider,{value:Te},fe.createElement(Ze.BR,null,(0,Fe.supportNodeRef)(Me)?fe.cloneElement(Me,{ref:Se}):Me))});Qt.Z=be},20834:function(Mn,Qt,ue){"use strict";ue.d(Qt,{default:function(){return se}});var fe=ue(15285),Ze=ue(59301),Fe=ue(45818),tt=ue(92310),be=ue.n(tt),Le=ue(36355),Re=function(oe,de){var pe={};for(var le in oe)Object.prototype.hasOwnProperty.call(oe,le)&&de.indexOf(le)<0&&(pe[le]=oe[le]);if(oe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var De=0,le=Object.getOwnPropertySymbols(oe);De<le.length;De++)de.indexOf(le[De])<0&&Object.prototype.propertyIsEnumerable.call(oe,le[De])&&(pe[le[De]]=oe[le[De]]);return pe},Me=oe=>{const{prefixCls:de,className:pe,dashed:le}=oe,De=Re(oe,["prefixCls","className","dashed"]),{getPrefixCls:ot}=Ze.useContext(Le.E_),$t=ot("menu",de),It=be()({[`${$t}-item-divider-dashed`]:!!le},pe);return Ze.createElement(fe.iz,Object.assign({className:It},De))},Pe=ue(11592),rt=ue(2738),Te=ue(6848),He=ue(92343),Je=(0,Ze.createContext)({prefixCls:"",firstLevel:!0,inlineCollapsed:!1}),st=oe=>{var de;const{className:pe,children:le,icon:De,title:ot,danger:$t}=oe,{prefixCls:It,firstLevel:Ut,direction:Yt,disableMenuItemTitleTooltip:dn,inlineCollapsed:hn}=Ze.useContext(Je),_n=Ue=>{const Bt=Ze.createElement("span",{className:`${It}-title-content`},le);return(!De||(0,He.l$)(le)&&le.type==="span")&&le&&Ue&&Ut&&typeof le=="string"?Ze.createElement("div",{className:`${It}-inline-collapsed-noicon`},le.charAt(0)):Bt},{siderCollapsed:vt}=Ze.useContext(Fe.D);let cn=ot;typeof ot=="undefined"?cn=Ut?le:"":ot===!1&&(cn="");const Sn={title:cn};!vt&&!hn&&(Sn.title=null,Sn.open=!1);const Ye=(0,Pe.Z)(le).length;let ze=Ze.createElement(fe.ck,Object.assign({},(0,rt.Z)(oe,["title","icon","danger"]),{className:be()({[`${It}-item-danger`]:$t,[`${It}-item-only-child`]:(De?Ye+1:Ye)===1},pe),title:typeof ot=="string"?ot:void 0}),(0,He.Tm)(De,{className:be()((0,He.l$)(De)?(de=De.props)===null||de===void 0?void 0:de.className:"",`${It}-item-icon`)}),_n(hn));return dn||(ze=Ze.createElement(Te.Z,Object.assign({},Sn,{placement:Yt==="rtl"?"left":"right",overlayClassName:`${It}-inline-collapsed-tooltip`}),ze)),ze},qt=oe=>{var de;const{popupClassName:pe,icon:le,title:De,theme:ot}=oe,$t=Ze.useContext(Je),{prefixCls:It,inlineCollapsed:Ut,theme:Yt}=$t,dn=(0,fe.Xl)();let hn;if(!le)hn=Ut&&!dn.length&&De&&typeof De=="string"?Ze.createElement("div",{className:`${It}-inline-collapsed-noicon`},De.charAt(0)):Ze.createElement("span",{className:`${It}-title-content`},De);else{const vt=(0,He.l$)(De)&&De.type==="span";hn=Ze.createElement(Ze.Fragment,null,(0,He.Tm)(le,{className:be()((0,He.l$)(le)?(de=le.props)===null||de===void 0?void 0:de.className:"",`${It}-item-icon`)}),vt?De:Ze.createElement("span",{className:`${It}-title-content`},De))}const _n=Ze.useMemo(()=>Object.assign(Object.assign({},$t),{firstLevel:!1}),[$t]);return Ze.createElement(Je.Provider,{value:_n},Ze.createElement(fe.Wd,Object.assign({},(0,rt.Z)(oe,["icon"]),{title:hn,popupClassName:be()(It,pe,`${It}-${ot||Yt}`)})))},at=ue(18785),ft=ue(70425),Ve=ue(62892),_e=ue(40875),We=function(oe,de){var pe={};for(var le in oe)Object.prototype.hasOwnProperty.call(oe,le)&&de.indexOf(le)<0&&(pe[le]=oe[le]);if(oe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var De=0,le=Object.getOwnPropertySymbols(oe);De<le.length;De++)de.indexOf(le[De])<0&&Object.prototype.propertyIsEnumerable.call(oe,le[De])&&(pe[le[De]]=oe[le[De]]);return pe};function et(oe){return(oe||[]).map((de,pe)=>{if(de&&typeof de=="object"){const le=de,{label:De,children:ot,key:$t,type:It}=le,Ut=We(le,["label","children","key","type"]),Yt=$t!=null?$t:`tmp-${pe}`;return ot||It==="group"?It==="group"?Ze.createElement(fe.BW,Object.assign({key:Yt},Ut,{title:De}),et(ot)):Ze.createElement(qt,Object.assign({key:Yt},Ut,{title:De}),et(ot)):It==="divider"?Ze.createElement(Me,Object.assign({key:Yt},Ut)):Ze.createElement(st,Object.assign({key:Yt},Ut),De)}return null}).filter(de=>de)}function Mt(oe){return Ze.useMemo(()=>oe&&et(oe),[oe])}var Qe=ue(64993),Kt=ue(17313),ut=ue(8378),Pt=ue(13826),nt=ue(29878),Gt=ue(83116),mn=ue(37613),sn=oe=>{const{componentCls:de,motionDurationSlow:pe,horizontalLineHeight:le,colorSplit:De,lineWidth:ot,lineType:$t,itemPaddingInline:It}=oe;return{[`${de}-horizontal`]:{lineHeight:le,border:0,borderBottom:`${ot}px ${$t} ${De}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${de}-item, ${de}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:It},[`> ${de}-item:hover,
> ${de}-item-active,
> ${de}-submenu ${de}-submenu-title:hover`]:{backgroundColor:"transparent"},[`${de}-item, ${de}-submenu-title`]:{transition:[`border-color ${pe}`,`background ${pe}`].join(",")},[`${de}-submenu-arrow`]:{display:"none"}}}},Ke=oe=>{let{componentCls:de,menuArrowOffset:pe}=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(-${pe})`},"&::after":{transform:`rotate(45deg) translateY(${pe})`}}}}};const xe=oe=>Object.assign({},(0,Kt.oN)(oe));var fn=(oe,de)=>{const{componentCls:pe,itemColor:le,itemSelectedColor:De,groupTitleColor:ot,itemBg:$t,subMenuItemBg:It,itemSelectedBg:Ut,activeBarHeight:Yt,activeBarWidth:dn,activeBarBorderWidth:hn,motionDurationSlow:_n,motionEaseInOut:vt,motionEaseOut:cn,itemPaddingInline:Sn,motionDurationMid:Ye,itemHoverColor:ze,lineType:Ue,colorSplit:Bt,itemDisabledColor:Jt,dangerItemColor:rn,dangerItemHoverColor:An,dangerItemSelectedColor:In,dangerItemActiveBg:Ln,dangerItemSelectedBg:Fn,itemHoverBg:jn,itemActiveBg:Tn,menuSubMenuBg:hr,horizontalItemSelectedColor:kr,horizontalItemSelectedBg:Tr,horizontalItemBorderRadius:Hr,horizontalItemHoverBg:sr,popupBg:Mr}=oe;return{[`${pe}-${de}, ${pe}-${de} > ${pe}`]:{color:le,background:$t,[`&${pe}-root:focus-visible`]:Object.assign({},xe(oe)),[`${pe}-item-group-title`]:{color:ot},[`${pe}-submenu-selected`]:{[`> ${pe}-submenu-title`]:{color:De}},[`${pe}-item-disabled, ${pe}-submenu-disabled`]:{color:`${Jt} !important`},[`${pe}-item:not(${pe}-item-selected):not(${pe}-submenu-selected)`]:{[`&:hover, > ${pe}-submenu-title:hover`]:{color:ze}},[`&:not(${pe}-horizontal)`]:{[`${pe}-item:not(${pe}-item-selected)`]:{"&:hover":{backgroundColor:jn},"&:active":{backgroundColor:Tn}},[`${pe}-submenu-title`]:{"&:hover":{backgroundColor:jn},"&:active":{backgroundColor:Tn}}},[`${pe}-item-danger`]:{color:rn,[`&${pe}-item:hover`]:{[`&:not(${pe}-item-selected):not(${pe}-submenu-selected)`]:{color:An}},[`&${pe}-item:active`]:{background:Ln}},[`${pe}-item a`]:{"&, &:hover":{color:"inherit"}},[`${pe}-item-selected`]:{color:De,[`&${pe}-item-danger`]:{color:In},"a, a:hover":{color:"inherit"}},[`& ${pe}-item-selected`]:{backgroundColor:Ut,[`&${pe}-item-danger`]:{backgroundColor:Fn}},[`${pe}-item, ${pe}-submenu-title`]:{[`&:not(${pe}-item-disabled):focus-visible`]:Object.assign({},xe(oe))},[`&${pe}-submenu > ${pe}`]:{backgroundColor:hr},[`&${pe}-popup > ${pe}`]:{backgroundColor:Mr},[`&${pe}-horizontal`]:Object.assign(Object.assign({},de==="dark"?{borderBottom:0}:{}),{[`> ${pe}-item, > ${pe}-submenu`]:{top:hn,marginTop:-hn,marginBottom:0,borderRadius:Hr,"&::after":{position:"absolute",insetInline:Sn,bottom:0,borderBottom:`${Yt}px solid transparent`,transition:`border-color ${_n} ${vt}`,content:'""'},"&:hover, &-active, &-open":{background:sr,"&::after":{borderBottomWidth:Yt,borderBottomColor:kr}},"&-selected":{color:kr,backgroundColor:Tr,"&:hover":{backgroundColor:Tr},"&::after":{borderBottomWidth:Yt,borderBottomColor:kr}}}}),[`&${pe}-root`]:{[`&${pe}-inline, &${pe}-vertical`]:{borderInlineEnd:`${hn}px ${Ue} ${Bt}`}},[`&${pe}-inline`]:{[`${pe}-sub${pe}-inline`]:{background:It},[`${pe}-item, ${pe}-submenu-title`]:hn&&dn?{width:`calc(100% + ${hn}px)`}:{},[`${pe}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${dn}px solid ${De}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${Ye} ${cn}`,`opacity ${Ye} ${cn}`].join(","),content:'""'},[`&${pe}-item-danger`]:{"&::after":{borderInlineEndColor:In}}},[`${pe}-selected, ${pe}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${Ye} ${vt}`,`opacity ${Ye} ${vt}`].join(",")}}}}}};const Xt=oe=>{const{componentCls:de,itemHeight:pe,itemMarginInline:le,padding:De,menuArrowSize:ot,marginXS:$t,itemMarginBlock:It}=oe,Ut=De+ot+$t;return{[`${de}-item`]:{position:"relative",overflow:"hidden"},[`${de}-item, ${de}-submenu-title`]:{height:pe,lineHeight:`${pe}px`,paddingInline:De,overflow:"hidden",textOverflow:"ellipsis",marginInline:le,marginBlock:It,width:`calc(100% - ${le*2}px)`},[`> ${de}-item,
> ${de}-submenu > ${de}-submenu-title`]:{height:pe,lineHeight:`${pe}px`},[`${de}-item-group-list ${de}-submenu-title,
${de}-submenu-title`]:{paddingInlineEnd:Ut}}};var je=oe=>{const{componentCls:de,iconCls:pe,itemHeight:le,colorTextLightSolid:De,dropdownWidth:ot,controlHeightLG:$t,motionDurationMid:It,motionEaseOut:Ut,paddingXL:Yt,itemMarginInline:dn,fontSizeLG:hn,motionDurationSlow:_n,paddingXS:vt,boxShadowSecondary:cn,collapsedWidth:Sn,collapsedIconSize:Ye}=oe,ze={height:le,lineHeight:`${le}px`,listStylePosition:"inside",listStyleType:"disc"};return[{[de]:{"&-inline, &-vertical":Object.assign({[`&${de}-root`]:{boxShadow:"none"}},Xt(oe))},[`${de}-submenu-popup`]:{[`${de}-vertical`]:Object.assign(Object.assign({},Xt(oe)),{boxShadow:cn})}},{[`${de}-submenu-popup ${de}-vertical${de}-sub`]:{minWidth:ot,maxHeight:`calc(100vh - ${$t*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 ${_n}`,`background ${_n}`,`padding ${It} ${Ut}`].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`]:ze,[`& ${de}-item-group-title`]:{paddingInlineStart:Yt}},[`${de}-item`]:ze}},{[`${de}-inline-collapsed`]:{width:Sn,[`&${de}-root`]:{[`${de}-item, ${de}-submenu ${de}-submenu-title`]:{[`> ${de}-inline-collapsed-noicon`]:{fontSize:hn,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% - ${hn/2}px - ${dn}px)`,textOverflow:"clip",[`
${de}-submenu-arrow,
${de}-submenu-expand-icon
`]:{opacity:0},[`${de}-item-icon, ${pe}`]:{margin:0,fontSize:Ye,lineHeight:`${le}px`,"+ span":{display:"inline-block",opacity:0}}},[`${de}-item-icon, ${pe}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${de}-item-icon, ${pe}`]:{display:"none"},"a, a:hover":{color:De}},[`${de}-item-group-title`]:Object.assign(Object.assign({},Kt.vS),{paddingInline:vt})}}]};const gt=oe=>{const{componentCls:de,motionDurationSlow:pe,motionDurationMid:le,motionEaseInOut:De,motionEaseOut:ot,iconCls:$t,iconSize:It,iconMarginInlineEnd:Ut}=oe;return{[`${de}-item, ${de}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${pe}`,`background ${pe}`,`padding ${pe} ${De}`].join(","),[`${de}-item-icon, ${$t}`]:{minWidth:It,fontSize:It,transition:[`font-size ${le} ${ot}`,`margin ${pe} ${De}`,`color ${pe}`].join(","),"+ span":{marginInlineStart:Ut,opacity:1,transition:[`opacity ${pe} ${De}`,`margin ${pe}`,`color ${pe}`].join(",")}},[`${de}-item-icon`]:Object.assign({},(0,Kt.Ro)()),[`&${de}-item-only-child`]:{[`> ${$t}, > ${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"}}}},en=oe=>{const{componentCls:de,motionDurationSlow:pe,motionEaseInOut:le,borderRadius:De,menuArrowSize:ot,menuArrowOffset:$t}=oe;return{[`${de}-submenu`]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:oe.margin,width:ot,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${pe} ${le}, opacity ${pe}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:ot*.6,height:ot*.15,backgroundColor:"currentcolor",borderRadius:De,transition:[`background ${pe} ${le}`,`transform ${pe} ${le}`,`top ${pe} ${le}`,`color ${pe} ${le}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(-${$t})`},"&::after":{transform:`rotate(-45deg) translateY(${$t})`}}}}},Zt=oe=>{const{antCls:de,componentCls:pe,fontSize:le,motionDurationSlow:De,motionDurationMid:ot,motionEaseInOut:$t,paddingXS:It,padding:Ut,colorSplit:Yt,lineWidth:dn,zIndexPopup:hn,borderRadiusLG:_n,subMenuItemBorderRadius:vt,menuArrowSize:cn,menuArrowOffset:Sn,lineType:Ye,menuPanelMaskInset:ze,groupTitleLineHeight:Ue,groupTitleFontSize:Bt}=oe;return[{"":{[`${pe}`]:Object.assign(Object.assign({},(0,Kt.dF)()),{"&-hidden":{display:"none"}})},[`${pe}-submenu-hidden`]:{display:"none"}},{[pe]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},(0,Kt.Wf)(oe)),(0,Kt.dF)()),{marginBottom:0,paddingInlineStart:0,fontSize:le,lineHeight:0,listStyle:"none",outline:"none",transition:`width ${De} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",[`${pe}-item`]:{flex:"none"}},[`${pe}-item, ${pe}-submenu, ${pe}-submenu-title`]:{borderRadius:oe.itemBorderRadius},[`${pe}-item-group-title`]:{padding:`${It}px ${Ut}px`,fontSize:Bt,lineHeight:Ue,transition:`all ${De}`},[`&-horizontal ${pe}-submenu`]:{transition:[`border-color ${De} ${$t}`,`background ${De} ${$t}`].join(",")},[`${pe}-submenu, ${pe}-submenu-inline`]:{transition:[`border-color ${De} ${$t}`,`background ${De} ${$t}`,`padding ${ot} ${$t}`].join(",")},[`${pe}-submenu ${pe}-sub`]:{cursor:"initial",transition:[`background ${De} ${$t}`,`padding ${De} ${$t}`].join(",")},[`${pe}-title-content`]:{transition:`color ${De}`},[`${pe}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${pe}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:Yt,borderStyle:Ye,borderWidth:0,borderTopWidth:dn,marginBlock:dn,padding:0,"&-dashed":{borderStyle:"dashed"}}}),gt(oe)),{[`${pe}-item-group`]:{[`${pe}-item-group-list`]:{margin:0,padding:0,[`${pe}-item, ${pe}-submenu-title`]:{paddingInline:`${le*2}px ${Ut}px`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:hn,borderRadius:_n,boxShadow:"none",transformOrigin:"0 0",[`&${pe}-submenu`]:{background:"transparent"},"&::before":{position:"absolute",inset:`${ze}px 0 0`,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'}},"&-placement-rightTop::before":{top:0,insetInlineStart:ze},"\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},[`> ${pe}`]:Object.assign(Object.assign(Object.assign({borderRadius:_n},gt(oe)),en(oe)),{[`${pe}-item, ${pe}-submenu > ${pe}-submenu-title`]:{borderRadius:vt},[`${pe}-submenu-title::after`]:{transition:`transform ${De} ${$t}`}})}}),en(oe)),{[`&-inline-collapsed ${pe}-submenu-arrow,
&-inline ${pe}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${Sn})`},"&::after":{transform:`rotate(45deg) translateX(-${Sn})`}},[`${pe}-submenu-open${pe}-submenu-inline > ${pe}-submenu-title > ${pe}-submenu-arrow`]:{transform:`translateY(-${cn*.2}px)`,"&::after":{transform:`rotate(-45deg) translateX(-${Sn})`},"&::before":{transform:`rotate(45deg) translateX(${Sn})`}}})},{[`${de}-layout-header`]:{[pe]:{lineHeight:"inherit"}}}]};var pn=(oe,de)=>(0,Gt.Z)("Menu",le=>{if(de===!1)return[];const{colorBgElevated:De,colorPrimary:ot,colorTextLightSolid:$t,controlHeightLG:It,fontSize:Ut,darkItemColor:Yt,darkDangerItemColor:dn,darkItemBg:hn,darkSubMenuItemBg:_n,darkItemSelectedColor:vt,darkItemSelectedBg:cn,darkDangerItemSelectedBg:Sn,darkItemHoverBg:Ye,darkGroupTitleColor:ze,darkItemHoverColor:Ue,darkItemDisabledColor:Bt,darkDangerItemHoverColor:Jt,darkDangerItemSelectedColor:rn,darkDangerItemActiveBg:An}=le,In=Ut/7*5,Ln=(0,mn.TS)(le,{menuArrowSize:In,menuHorizontalHeight:It*1.15,menuArrowOffset:`${In*.25}px`,menuPanelMaskInset:-7,menuSubMenuBg:De}),Fn=(0,mn.TS)(Ln,{itemColor:Yt,itemHoverColor:Ue,groupTitleColor:ze,itemSelectedColor:vt,itemBg:hn,popupBg:hn,subMenuItemBg:_n,itemActiveBg:"transparent",itemSelectedBg:cn,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:Ye,itemDisabledColor:Bt,dangerItemColor:dn,dangerItemHoverColor:Jt,dangerItemSelectedColor:rn,dangerItemActiveBg:An,dangerItemSelectedBg:Sn,menuSubMenuBg:_n,horizontalItemSelectedColor:$t,horizontalItemSelectedBg:ot});return[Zt(Ln),sn(Ln),je(Ln),fn(Ln,"light"),fn(Fn,"dark"),Ke(Ln),(0,ut.Z)(Ln),(0,Pt.oN)(Ln,"slide-up"),(0,Pt.oN)(Ln,"slide-down"),(0,nt._y)(Ln,"zoom-big")]},le=>{const{colorPrimary:De,colorError:ot,colorTextDisabled:$t,colorErrorBg:It,colorText:Ut,colorTextDescription:Yt,colorBgContainer:dn,colorFillAlter:hn,colorFillContent:_n,lineWidth:vt,lineWidthBold:cn,controlItemBgActive:Sn,colorBgTextHover:Ye,controlHeightLG:ze,lineHeight:Ue,colorBgElevated:Bt,marginXXS:Jt,padding:rn,fontSize:An,controlHeightSM:In,fontSizeLG:Ln,colorTextLightSolid:Fn,colorErrorHover:jn}=le,Tn=new Qe.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:Ut,itemColor:Ut,colorItemTextHover:Ut,itemHoverColor:Ut,colorItemTextHoverHorizontal:De,horizontalItemHoverColor:De,colorGroupTitle:Yt,groupTitleColor:Yt,colorItemTextSelected:De,itemSelectedColor:De,colorItemTextSelectedHorizontal:De,horizontalItemSelectedColor:De,colorItemBg:dn,itemBg:dn,colorItemBgHover:Ye,itemHoverBg:Ye,colorItemBgActive:_n,itemActiveBg:Sn,colorSubItemBg:hn,subMenuItemBg:hn,colorItemBgSelected:Sn,itemSelectedBg:Sn,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:0,colorActiveBarHeight:cn,activeBarHeight:cn,colorActiveBarBorderSize:vt,activeBarBorderWidth:vt,colorItemTextDisabled:$t,itemDisabledColor:$t,colorDangerItemText:ot,dangerItemColor:ot,colorDangerItemTextHover:ot,dangerItemHoverColor:ot,colorDangerItemTextSelected:ot,dangerItemSelectedColor:ot,colorDangerItemBgActive:It,dangerItemActiveBg:It,colorDangerItemBgSelected:It,dangerItemSelectedBg:It,itemMarginInline:le.marginXXS,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:ze,groupTitleLineHeight:Ue,collapsedWidth:ze*2,popupBg:Bt,itemMarginBlock:Jt,itemPaddingInline:rn,horizontalLineHeight:`${ze*1.15}px`,iconSize:An,iconMarginInlineEnd:In-An,collapsedIconSize:Ln,groupTitleFontSize:An,darkItemDisabledColor:new Qe.C(Fn).setAlpha(.25).toRgbString(),darkItemColor:Tn,darkDangerItemColor:ot,darkItemBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:Fn,darkItemSelectedBg:De,darkDangerItemSelectedBg:ot,darkItemHoverBg:"transparent",darkGroupTitleColor:Tn,darkItemHoverColor:Fn,darkDangerItemHoverColor:jn,darkDangerItemSelectedColor:Fn,darkDangerItemActiveBg:ot}},{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 pe={};for(var le in oe)Object.prototype.hasOwnProperty.call(oe,le)&&de.indexOf(le)<0&&(pe[le]=oe[le]);if(oe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var De=0,le=Object.getOwnPropertySymbols(oe);De<le.length;De++)de.indexOf(le[De])<0&&Object.prototype.propertyIsEnumerable.call(oe,le[De])&&(pe[le[De]]=oe[le[De]]);return pe},Tt=(0,Ze.forwardRef)((oe,de)=>{var pe,le;const De=Ze.useContext(_e.Z),ot=De||{},{getPrefixCls:$t,getPopupContainer:It,direction:Ut,menu:Yt}=Ze.useContext(Le.E_),dn=$t(),{prefixCls:hn,className:_n,style:vt,theme:cn="light",expandIcon:Sn,_internalDisableMenuItemTitleTooltip:Ye,inlineCollapsed:ze,siderCollapsed:Ue,items:Bt,children:Jt,rootClassName:rn,mode:An,selectable:In,onClick:Ln,overflowedIndicatorPopupClassName:Fn}=oe,jn=Vt(oe,["prefixCls","className","style","theme","expandIcon","_internalDisableMenuItemTitleTooltip","inlineCollapsed","siderCollapsed","items","children","rootClassName","mode","selectable","onClick","overflowedIndicatorPopupClassName"]),Tn=(0,rt.Z)(jn,["collapsedWidth"]),hr=Mt(Bt)||Jt;(pe=ot.validator)===null||pe===void 0||pe.call(ot,{mode:An});const kr=(0,ft.useEvent)(function(){var Jn;Ln==null||Ln.apply(void 0,arguments),(Jn=ot.onClick)===null||Jn===void 0||Jn.call(ot)}),Tr=ot.mode||An,Hr=In!=null?In:ot.selectable,sr=Ze.useMemo(()=>Ue!==void 0?Ue:ze,[ze,Ue]),Mr={horizontal:{motionName:`${dn}-slide-up`},inline:(0,Ve.Z)(dn),other:{motionName:`${dn}-zoom-big`}},rr=$t("menu",hn||ot.prefixCls),[Or,Fr]=pn(rr,!De),Er=be()(`${rr}-${cn}`,Yt==null?void 0:Yt.className,_n);let jr;if(typeof Sn=="function")jr=Sn;else if(Sn===null||Sn===!1)jr=null;else if(ot.expandIcon===null||ot.expandIcon===!1)jr=null;else{const Jn=Sn!=null?Sn:ot.expandIcon;jr=(0,He.Tm)(Jn,{className:be()(`${rr}-submenu-expand-icon`,(0,He.l$)(Jn)?(le=Jn.props)===null||le===void 0?void 0:le.className:"")})}const Nr=Ze.useMemo(()=>({prefixCls:rr,inlineCollapsed:sr||!1,direction:Ut,firstLevel:!0,theme:cn,mode:Tr,disableMenuItemTitleTooltip:Ye}),[rr,sr,Ut,Ye,cn]);return Or(Ze.createElement(_e.Z.Provider,{value:null},Ze.createElement(Je.Provider,{value:Nr},Ze.createElement(fe.ZP,Object.assign({getPopupContainer:It,overflowedIndicator:Ze.createElement(at.Z,null),overflowedIndicatorPopupClassName:be()(rr,`${rr}-${cn}`,Fn),mode:Tr,selectable:Hr,onClick:kr},Tn,{inlineCollapsed:sr,style:Object.assign(Object.assign({},Yt==null?void 0:Yt.style),vt),className:Er,prefixCls:rr,direction:Ut,defaultMotions:Mr,expandIcon:jr,ref:de,rootClassName:be()(rn,Fr)}),hr))))});const ge=(0,Ze.forwardRef)((oe,de)=>{const pe=(0,Ze.useRef)(null),le=Ze.useContext(Fe.D);return(0,Ze.useImperativeHandle)(de,()=>({menu:pe.current,focus:De=>{var ot;(ot=pe.current)===null||ot===void 0||ot.focus(De)}})),Ze.createElement(Tt,Object.assign({ref:pe},oe,le))});ge.Item=st,ge.SubMenu=qt,ge.Divider=Me,ge.ItemGroup=fe.BW;var se=ge},39722:function(Mn,Qt,ue){"use strict";ue.d(Qt,{t5:function(){return Pe}});var fe=ue(92310),Ze=ue.n(fe),Fe=ue(55477),tt=ue(59301),be=ue(36355),Le=ue(77578),Re=ue(17356),Se=function(Te,He){var ht={};for(var Je in Te)Object.prototype.hasOwnProperty.call(Te,Je)&&He.indexOf(Je)<0&&(ht[Je]=Te[Je]);if(Te!=null&&typeof Object.getOwnPropertySymbols=="function")for(var lt=0,Je=Object.getOwnPropertySymbols(Te);lt<Je.length;lt++)He.indexOf(Je[lt])<0&&Object.prototype.propertyIsEnumerable.call(Te,Je[lt])&&(ht[Je[lt]]=Te[Je[lt]]);return ht};const Me=(Te,He,ht)=>{if(!(!He&&!ht))return tt.createElement(tt.Fragment,null,He&&tt.createElement("div",{className:`${Te}-title`},(0,Le.Z)(He)),tt.createElement("div",{className:`${Te}-inner-content`},(0,Le.Z)(ht)))},Pe=Te=>{const{hashId:He,prefixCls:ht,className:Je,style:lt,placement:st="top",title:Rt,content:qt,children:at}=Te;return tt.createElement("div",{className:Ze()(He,ht,`${ht}-pure`,`${ht}-placement-${st}`,Je),style:lt},tt.createElement("div",{className:`${ht}-arrow`}),tt.createElement(Fe.G,Object.assign({},Te,{className:He,prefixCls:ht}),at||Me(ht,Rt,qt)))},rt=Te=>{const{prefixCls:He}=Te,ht=Se(Te,["prefixCls"]),{getPrefixCls:Je}=tt.useContext(be.E_),lt=Je("popover",He),[st,Rt]=(0,Re.Z)(lt);return st(tt.createElement(Pe,Object.assign({},ht,{prefixCls:lt,hashId:Rt})))};Qt.ZP=rt},60324:function(Mn,Qt,ue){"use strict";var fe=ue(92310),Ze=ue.n(fe),Fe=ue(59301),tt=ue(77578),be=ue(62892),Le=ue(36355),Re=ue(6848),Se=ue(39722),Me=ue(17356),Pe=function(He,ht){var Je={};for(var lt in He)Object.prototype.hasOwnProperty.call(He,lt)&&ht.indexOf(lt)<0&&(Je[lt]=He[lt]);if(He!=null&&typeof Object.getOwnPropertySymbols=="function")for(var st=0,lt=Object.getOwnPropertySymbols(He);st<lt.length;st++)ht.indexOf(lt[st])<0&&Object.prototype.propertyIsEnumerable.call(He,lt[st])&&(Je[lt[st]]=He[lt[st]]);return Je};const rt=He=>{let{title:ht,content:Je,prefixCls:lt}=He;return Fe.createElement(Fe.Fragment,null,ht&&Fe.createElement("div",{className:`${lt}-title`},(0,tt.Z)(ht)),Fe.createElement("div",{className:`${lt}-inner-content`},(0,tt.Z)(Je)))},Te=Fe.forwardRef((He,ht)=>{const{prefixCls:Je,title:lt,content:st,overlayClassName:Rt,placement:qt="top",trigger:at="hover",mouseEnterDelay:ft=.1,mouseLeaveDelay:Ve=.1,overlayStyle:_e={}}=He,We=Pe(He,["prefixCls","title","content","overlayClassName","placement","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle"]),{getPrefixCls:et}=Fe.useContext(Le.E_),Mt=et("popover",Je),[Qe,Kt]=(0,Me.Z)(Mt),ut=et(),Pt=Ze()(Rt,Kt);return Qe(Fe.createElement(Re.Z,Object.assign({placement:qt,trigger:at,mouseEnterDelay:ft,mouseLeaveDelay:Ve,overlayStyle:_e},We,{prefixCls:Mt,overlayClassName:Pt,ref:ht,overlay:lt||st?Fe.createElement(rt,{prefixCls:Mt,title:lt,content:st}):null,transitionName:(0,be.m)(ut,"zoom-big",We.transitionName),"data-popover-inject":!0})))});Te._InternalPanelDoNotUseOrYouWillBeFired=Se.ZP,Qt.Z=Te},17356:function(Mn,Qt,ue){"use strict";var fe=ue(17313),Ze=ue(29878),Fe=ue(19447),tt=ue(33166),be=ue(83116),Le=ue(37613);const Re=Pe=>{const{componentCls:rt,popoverColor:Te,minWidth:He,fontWeightStrong:ht,popoverPadding:Je,boxShadowSecondary:lt,colorTextHeading:st,borderRadiusLG:Rt,zIndexPopup:qt,marginXS:at,colorBgElevated:ft,popoverBg:Ve}=Pe;return[{[rt]:Object.assign(Object.assign({},(0,fe.Wf)(Pe)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:qt,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","--antd-arrow-background-color":ft,"&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${rt}-content`]:{position:"relative"},[`${rt}-inner`]:{backgroundColor:Ve,backgroundClip:"padding-box",borderRadius:Rt,boxShadow:lt,padding:Je},[`${rt}-title`]:{minWidth:He,marginBottom:at,color:st,fontWeight:ht},[`${rt}-inner-content`]:{color:Te}})},(0,Fe.ZP)(Pe,{colorBg:"var(--antd-arrow-background-color)"}),{[`${rt}-pure`]:{position:"relative",maxWidth:"none",margin:Pe.sizePopupArrow,display:"inline-block",[`${rt}-content`]:{display:"inline-block"}}}]},Se=Pe=>{const{componentCls:rt}=Pe;return{[rt]:tt.i.map(Te=>{const He=Pe[`${Te}6`];return{[`&${rt}-${Te}`]:{"--antd-arrow-background-color":He,[`${rt}-inner`]:{backgroundColor:He},[`${rt}-arrow`]:{background:"transparent"}}}})}},Me=Pe=>{const{componentCls:rt,lineWidth:Te,lineType:He,colorSplit:ht,paddingSM:Je,controlHeight:lt,fontSize:st,lineHeight:Rt,padding:qt}=Pe,at=lt-Math.round(st*Rt),ft=at/2,Ve=at/2-Te,_e=qt;return{[rt]:{[`${rt}-inner`]:{padding:0},[`${rt}-title`]:{margin:0,padding:`${ft}px ${_e}px ${Ve}px`,borderBottom:`${Te}px ${He} ${ht}`},[`${rt}-inner-content`]:{padding:`${Je}px ${_e}px`}}}};Qt.Z=(0,be.Z)("Popover",Pe=>{const{colorBgElevated:rt,colorText:Te,wireframe:He}=Pe,ht=(0,Le.TS)(Pe,{popoverPadding:12,popoverBg:rt,popoverColor:Te});return[Re(ht),Se(ht),He&&Me(ht),(0,Ze._y)(ht,"zoom-big")]},Pe=>({width:177,minWidth:177,zIndexPopup:Pe.zIndexPopupBase+30}),{resetStyle:!1,deprecatedTokens:[["width","minWidth"]]})},93948:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Ye}});var fe=ue(59301),Ze=ue(29679),Fe=ue(40001),tt=ue(19248),be=ue(99267),Le=ue(92310),Re=ue.n(Le),Se=ue(2738),Me=ue(36355),Pe=ue(54476),rt=ue(33885),Te=ue(75931),He={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},ht=function(){var Ue=(0,fe.useRef)([]),Bt=(0,fe.useRef)(null);return(0,fe.useEffect)(function(){var Jt=Date.now(),rn=!1;Ue.current.forEach(function(An){if(An){rn=!0;var In=An.style;In.transitionDuration=".3s, .3s, .3s, .06s",Bt.current&&Jt-Bt.current<100&&(In.transitionDuration="0s, 0s")}}),rn&&(Bt.current=Date.now())}),Ue.current},Je=["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"],lt=function(Ue){var Bt=(0,rt.Z)((0,rt.Z)({},He),Ue),Jt=Bt.className,rn=Bt.percent,An=Bt.prefixCls,In=Bt.strokeColor,Ln=Bt.strokeLinecap,Fn=Bt.strokeWidth,jn=Bt.style,Tn=Bt.trailColor,hr=Bt.trailWidth,kr=Bt.transition,Tr=(0,Te.Z)(Bt,Je);delete Tr.gapPosition;var Hr=Array.isArray(rn)?rn:[rn],sr=Array.isArray(In)?In:[In],Mr=ht(),rr=Fn/2,Or=100-Fn/2,Fr="M ".concat(Ln==="round"?rr:0,",").concat(rr,`
L `).concat(Ln==="round"?Or:100,",").concat(rr),Er="0 0 100 ".concat(Fn),jr=0;return fe.createElement("svg",(0,Pe.Z)({className:Re()("".concat(An,"-line"),Jt),viewBox:Er,preserveAspectRatio:"none",style:jn},Tr),fe.createElement("path",{className:"".concat(An,"-line-trail"),d:Fr,strokeLinecap:Ln,stroke:Tn,strokeWidth:hr||Fn,fillOpacity:"0"}),Hr.map(function(Nr,Jn){var lr=1;switch(Ln){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:kr||"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,fe.createElement("path",{key:Jn,className:"".concat(An,"-line-path"),d:Fr,strokeLinecap:Ln,stroke:$n,strokeWidth:Fn,fillOpacity:"0",ref:function(ct){Mr[Jn]=ct},style:Rn})}))},st=lt,Rt=ue(76190),qt=ue(42978),at=ue(47273),ft=0,Ve=(0,at.Z)();function _e(){var ze;return Ve?(ze=ft,ft+=1):ze="TEST_OR_SSR",ze}var We=function(ze){var Ue=fe.useState(),Bt=(0,qt.Z)(Ue,2),Jt=Bt[0],rn=Bt[1];return fe.useEffect(function(){rn("rc_progress_".concat(_e()))},[]),ze||Jt},et=function(Ue){var Bt=Ue.bg,Jt=Ue.children;return fe.createElement("div",{style:{width:"100%",height:"100%",background:Bt}},Jt)};function Mt(ze,Ue){return Object.keys(ze).map(function(Bt){var Jt=parseFloat(Bt),rn="".concat(Math.floor(Jt*Ue),"%");return"".concat(ze[Bt]," ").concat(rn)})}var Qe=fe.forwardRef(function(ze,Ue){var Bt=ze.prefixCls,Jt=ze.color,rn=ze.gradientId,An=ze.radius,In=ze.style,Ln=ze.ptg,Fn=ze.strokeLinecap,jn=ze.strokeWidth,Tn=ze.size,hr=ze.gapDegree,kr=Jt&&(0,Rt.Z)(Jt)==="object",Tr=kr?"#FFF":void 0,Hr=Tn/2,sr=fe.createElement("circle",{className:"".concat(Bt,"-circle-path"),r:An,cx:Hr,cy:Hr,stroke:Tr,strokeLinecap:Fn,strokeWidth:jn,opacity:Ln===0?0:1,style:In,ref:Ue});if(!kr)return sr;var Mr="".concat(rn,"-conic"),rr=hr?"".concat(180+hr/2,"deg"):"0deg",Or=Mt(Jt,(360-hr)/360),Fr=Mt(Jt,1),Er="conic-gradient(from ".concat(rr,", ").concat(Or.join(", "),")"),jr="linear-gradient(to ".concat(hr?"bottom":"top",", ").concat(Fr.join(", "),")");return fe.createElement(fe.Fragment,null,fe.createElement("mask",{id:Mr},sr),fe.createElement("foreignObject",{x:0,y:0,width:Tn,height:Tn,mask:"url(#".concat(Mr,")")},fe.createElement(et,{bg:jr},fe.createElement(et,{bg:Er}))))}),Kt=Qe,ut=100,Pt=function(Ue,Bt,Jt,rn,An,In,Ln,Fn,jn,Tn){var hr=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,kr=Jt/100*360*((360-In)/360),Tr=In===0?0:{bottom:0,top:180,left:90,right:-90}[Ln],Hr=(100-rn)/100*Bt;jn==="round"&&rn!==100&&(Hr+=Tn/2,Hr>=Bt&&(Hr=Bt-.01));var sr=ut/2;return{stroke:typeof Fn=="string"?Fn:void 0,strokeDasharray:"".concat(Bt,"px ").concat(Ue),strokeDashoffset:Hr+hr,transform:"rotate(".concat(An+kr+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}},nt=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function Gt(ze){var Ue=ze!=null?ze:[];return Array.isArray(Ue)?Ue:[Ue]}var mn=function(Ue){var Bt=(0,rt.Z)((0,rt.Z)({},He),Ue),Jt=Bt.id,rn=Bt.prefixCls,An=Bt.steps,In=Bt.strokeWidth,Ln=Bt.trailWidth,Fn=Bt.gapDegree,jn=Fn===void 0?0:Fn,Tn=Bt.gapPosition,hr=Bt.trailColor,kr=Bt.strokeLinecap,Tr=Bt.style,Hr=Bt.className,sr=Bt.strokeColor,Mr=Bt.percent,rr=(0,Te.Z)(Bt,nt),Or=ut/2,Fr=We(Jt),Er="".concat(Fr,"-gradient"),jr=Or-In/2,Nr=Math.PI*2*jr,Jn=jn>0?90+jn/2:-90,lr=Nr*((360-jn)/360),Rn=(0,Rt.Z)(An)==="object"?An:{count:An,space:2},$n=Rn.count,wr=Rn.space,ct=Gt(Mr),ke=Gt(sr),Be=ke.find(function(Wt){return Wt&&(0,Rt.Z)(Wt)==="object"}),Ae=Be&&(0,Rt.Z)(Be)==="object",Ie=Ae?"butt":kr,Xe=Pt(Nr,lr,0,100,Jn,jn,Tn,hr,Ie,In),dt=ht(),Ht=function(){var vn=0;return ct.map(function(xn,Cn){var Lt=ke[Cn]||ke[ke.length-1],ln=Pt(Nr,lr,vn,xn,Jn,jn,Tn,Lt,Ie,In);return vn+=xn,fe.createElement(Kt,{key:Cn,color:Lt,ptg:xn,radius:jr,prefixCls:rn,gradientId:Er,style:ln,strokeLinecap:Ie,strokeWidth:In,gapDegree:jn,ref:function(wt){dt[Cn]=wt},size:ut})}).reverse()},kt=function(){var vn=Math.round($n*(ct[0]/100)),xn=100/$n,Cn=0;return new Array($n).fill(null).map(function(Lt,ln){var it=ln<=vn-1?ke[0]:hr,wt=it&&(0,Rt.Z)(it)==="object"?"url(#".concat(Er,")"):void 0,Et=Pt(Nr,lr,Cn,xn,Jn,jn,Tn,it,"butt",In,wr);return Cn+=(lr-Et.strokeDashoffset+wr)*100/lr,fe.createElement("circle",{key:ln,className:"".concat(rn,"-circle-path"),r:jr,cx:Or,cy:Or,stroke:wt,strokeWidth:In,opacity:1,style:Et,ref:function(nn){dt[ln]=nn}})})};return fe.createElement("svg",(0,Pe.Z)({className:Re()("".concat(rn,"-circle"),Hr),viewBox:"0 0 ".concat(ut," ").concat(ut),style:Tr,id:Jt,role:"presentation"},rr),!$n&&fe.createElement("circle",{className:"".concat(rn,"-circle-trail"),r:jr,cx:Or,cy:Or,stroke:hr,strokeLinecap:Ie,strokeWidth:Ln||In,style:Xe}),$n?kt():Ht())},on=mn,sn={Line:st,Circle:on},jt=ue(6848),Ke=ue(30071);function xe(ze){return!ze||ze<0?0:ze>100?100:ze}function bt(ze){let{success:Ue,successPercent:Bt}=ze,Jt=Bt;return Ue&&"progress"in Ue&&(Jt=Ue.progress),Ue&&"percent"in Ue&&(Jt=Ue.percent),Jt}const fn=ze=>{let{percent:Ue,success:Bt,successPercent:Jt}=ze;const rn=xe(bt({success:Bt,successPercent:Jt}));return[rn,xe(xe(Ue)-rn)]},Xt=ze=>{let{success:Ue={},strokeColor:Bt}=ze;const{strokeColor:Jt}=Ue;return[Jt||Ke.presetPrimaryColors.green,Bt||null]},qe=(ze,Ue,Bt)=>{var Jt,rn,An,In;let Ln=-1,Fn=-1;if(Ue==="step"){const jn=Bt.steps,Tn=Bt.strokeWidth;typeof ze=="string"||typeof ze=="undefined"?(Ln=ze==="small"?2:14,Fn=Tn!=null?Tn:8):typeof ze=="number"?[Ln,Fn]=[ze,ze]:[Ln=14,Fn=8]=ze,Ln*=jn}else if(Ue==="line"){const jn=Bt==null?void 0:Bt.strokeWidth;typeof ze=="string"||typeof ze=="undefined"?Fn=jn||(ze==="small"?6:8):typeof ze=="number"?[Ln,Fn]=[ze,ze]:[Ln=-1,Fn=8]=ze}else(Ue==="circle"||Ue==="dashboard")&&(typeof ze=="string"||typeof ze=="undefined"?[Ln,Fn]=ze==="small"?[60,60]:[120,120]:typeof ze=="number"?[Ln,Fn]=[ze,ze]:(Ln=(rn=(Jt=ze[0])!==null&&Jt!==void 0?Jt:ze[1])!==null&&rn!==void 0?rn:120,Fn=(In=(An=ze[0])!==null&&An!==void 0?An:ze[1])!==null&&In!==void 0?In:120));return[Ln,Fn]},je=3,gt=ze=>je/ze*100;var Zt=ze=>{const{prefixCls:Ue,trailColor:Bt=null,strokeLinecap:Jt="round",gapPosition:rn,gapDegree:An,width:In=120,type:Ln,children:Fn,success:jn,size:Tn=In}=ze,[hr,kr]=qe(Tn,"circle");let{strokeWidth:Tr}=ze;Tr===void 0&&(Tr=Math.max(gt(hr),6));const Hr={width:hr,height:kr,fontSize:hr*.15+6},sr=fe.useMemo(()=>{if(An||An===0)return An;if(Ln==="dashboard")return 75},[An,Ln]),Mr=rn||Ln==="dashboard"&&"bottom"||void 0,rr=Object.prototype.toString.call(ze.strokeColor)==="[object Object]",Or=Xt({success:jn,strokeColor:ze.strokeColor}),Fr=Re()(`${Ue}-inner`,{[`${Ue}-circle-gradient`]:rr}),Er=fe.createElement(on,{percent:fn(ze),strokeWidth:Tr,trailWidth:Tr,strokeColor:Or,strokeLinecap:Jt,trailColor:Bt,prefixCls:Ue,gapDegree:sr,gapPosition:Mr});return fe.createElement("div",{className:Fr,style:Hr},hr<=20?fe.createElement(jt.Z,{title:Fn},fe.createElement("span",null,Er)):fe.createElement(fe.Fragment,null,Er,Fn))},pn=function(ze,Ue){var Bt={};for(var Jt in ze)Object.prototype.hasOwnProperty.call(ze,Jt)&&Ue.indexOf(Jt)<0&&(Bt[Jt]=ze[Jt]);if(ze!=null&&typeof Object.getOwnPropertySymbols=="function")for(var rn=0,Jt=Object.getOwnPropertySymbols(ze);rn<Jt.length;rn++)Ue.indexOf(Jt[rn])<0&&Object.prototype.propertyIsEnumerable.call(ze,Jt[rn])&&(Bt[Jt[rn]]=ze[Jt[rn]]);return Bt};const Vt=ze=>{let Ue=[];return Object.keys(ze).forEach(Bt=>{const Jt=parseFloat(Bt.replace(/%/g,""));isNaN(Jt)||Ue.push({key:Jt,value:ze[Bt]})}),Ue=Ue.sort((Bt,Jt)=>Bt.key-Jt.key),Ue.map(Bt=>{let{key:Jt,value:rn}=Bt;return`${rn} ${Jt}%`}).join(", ")},Ft=(ze,Ue)=>{const{from:Bt=Ke.presetPrimaryColors.blue,to:Jt=Ke.presetPrimaryColors.blue,direction:rn=Ue==="rtl"?"to left":"to right"}=ze,An=pn(ze,["from","to","direction"]);if(Object.keys(An).length!==0){const In=Vt(An);return{backgroundImage:`linear-gradient(${rn}, ${In})`}}return{backgroundImage:`linear-gradient(${rn}, ${Bt}, ${Jt})`}};var ge=ze=>{const{prefixCls:Ue,direction:Bt,percent:Jt,size:rn,strokeWidth:An,strokeColor:In,strokeLinecap:Ln="round",children:Fn,trailColor:jn=null,success:Tn}=ze,hr=In&&typeof In!="string"?Ft(In,Bt):{backgroundColor:In},kr=Ln==="square"||Ln==="butt"?0:void 0,Tr={backgroundColor:jn||void 0,borderRadius:kr},Hr=rn!=null?rn:[-1,An||(rn==="small"?6:8)],[sr,Mr]=qe(Hr,"line",{strokeWidth:An}),rr=Object.assign({width:`${xe(Jt)}%`,height:Mr,borderRadius:kr},hr),Or=bt(ze),Fr={width:`${xe(Or)}%`,height:Mr,borderRadius:kr,backgroundColor:Tn==null?void 0:Tn.strokeColor},Er={width:sr<0?"100%":sr,height:Mr};return fe.createElement(fe.Fragment,null,fe.createElement("div",{className:`${Ue}-outer`,style:Er},fe.createElement("div",{className:`${Ue}-inner`,style:Tr},fe.createElement("div",{className:`${Ue}-bg`,style:rr}),Or!==void 0?fe.createElement("div",{className:`${Ue}-success-bg`,style:Fr}):null)),Fn)},oe=ze=>{const{size:Ue,steps:Bt,percent:Jt=0,strokeWidth:rn=8,strokeColor:An,trailColor:In=null,prefixCls:Ln,children:Fn}=ze,jn=Math.round(Bt*(Jt/100)),Tn=Ue==="small"?2:14,hr=Ue!=null?Ue:[Tn,rn],[kr,Tr]=qe(hr,"step",{steps:Bt,strokeWidth:rn}),Hr=kr/Bt,sr=new Array(Bt);for(let Mr=0;Mr<Bt;Mr++){const rr=Array.isArray(An)?An[Mr]:An;sr[Mr]=fe.createElement("div",{key:Mr,className:Re()(`${Ln}-steps-item`,{[`${Ln}-steps-item-active`]:Mr<=jn-1}),style:{backgroundColor:Mr<=jn-1?rr:In,width:Hr,height:Tr}})}return fe.createElement("div",{className:`${Ln}-steps-outer`},sr,Fn)},de=ue(36237),pe=ue(17313),le=ue(83116),De=ue(37613);const ot=ze=>{const Ue=ze?"100%":"-100%";return new de.Keyframes(`antProgress${ze?"RTL":"LTR"}Active`,{"0%":{transform:`translateX(${Ue}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${Ue}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},$t=ze=>{const{componentCls:Ue,iconCls:Bt}=ze;return{[Ue]:Object.assign(Object.assign({},(0,pe.Wf)(ze)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:ze.fontSize,marginInlineEnd:ze.marginXS,marginBottom:ze.marginXS},[`${Ue}-outer`]:{display:"inline-block",width:"100%"},[`&${Ue}-show-info`]:{[`${Ue}-outer`]:{marginInlineEnd:`calc(-2em - ${ze.marginXS}px)`,paddingInlineEnd:`calc(2em + ${ze.paddingXS}px)`}},[`${Ue}-inner`]:{position:"relative",display:"inline-block",width:"100%",overflow:"hidden",verticalAlign:"middle",backgroundColor:ze.remainingColor,borderRadius:ze.lineBorderRadius},[`${Ue}-inner:not(${Ue}-circle-gradient)`]:{[`${Ue}-circle-path`]:{stroke:ze.defaultColor}},[`${Ue}-success-bg, ${Ue}-bg`]:{position:"relative",backgroundColor:ze.defaultColor,borderRadius:ze.lineBorderRadius,transition:`all ${ze.motionDurationSlow} ${ze.motionEaseInOutCirc}`},[`${Ue}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:ze.colorSuccess},[`${Ue}-text`]:{display:"inline-block",width:"2em",marginInlineStart:ze.marginXS,color:ze.colorText,lineHeight:1,whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[Bt]:{fontSize:ze.fontSize}},[`&${Ue}-status-active`]:{[`${Ue}-bg::before`]:{position:"absolute",inset:0,backgroundColor:ze.colorBgContainer,borderRadius:ze.lineBorderRadius,opacity:0,animationName:ot(),animationDuration:ze.progressActiveMotionDuration,animationTimingFunction:ze.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${Ue}-rtl${Ue}-status-active`]:{[`${Ue}-bg::before`]:{animationName:ot(!0)}},[`&${Ue}-status-exception`]:{[`${Ue}-bg`]:{backgroundColor:ze.colorError},[`${Ue}-text`]:{color:ze.colorError}},[`&${Ue}-status-exception ${Ue}-inner:not(${Ue}-circle-gradient)`]:{[`${Ue}-circle-path`]:{stroke:ze.colorError}},[`&${Ue}-status-success`]:{[`${Ue}-bg`]:{backgroundColor:ze.colorSuccess},[`${Ue}-text`]:{color:ze.colorSuccess}},[`&${Ue}-status-success ${Ue}-inner:not(${Ue}-circle-gradient)`]:{[`${Ue}-circle-path`]:{stroke:ze.colorSuccess}}})}},It=ze=>{const{componentCls:Ue,iconCls:Bt}=ze;return{[Ue]:{[`${Ue}-circle-trail`]:{stroke:ze.remainingColor},[`&${Ue}-circle ${Ue}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${Ue}-circle ${Ue}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:ze.circleTextColor,fontSize:ze.circleTextFontSize,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[Bt]:{fontSize:`${ze.fontSize/ze.fontSizeSM}em`}},[`${Ue}-circle&-status-exception`]:{[`${Ue}-text`]:{color:ze.colorError}},[`${Ue}-circle&-status-success`]:{[`${Ue}-text`]:{color:ze.colorSuccess}}},[`${Ue}-inline-circle`]:{lineHeight:1,[`${Ue}-inner`]:{verticalAlign:"bottom"}}}},Ut=ze=>{const{componentCls:Ue}=ze;return{[Ue]:{[`${Ue}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:ze.progressStepMinWidth,marginInlineEnd:ze.progressStepMarginInlineEnd,backgroundColor:ze.remainingColor,transition:`all ${ze.motionDurationSlow}`,"&-active":{backgroundColor:ze.defaultColor}}}}}},Yt=ze=>{const{componentCls:Ue,iconCls:Bt}=ze;return{[Ue]:{[`${Ue}-small&-line, ${Ue}-small&-line ${Ue}-text ${Bt}`]:{fontSize:ze.fontSizeSM}}}};var dn=(0,le.Z)("Progress",ze=>{const Ue=ze.marginXXS/2,Bt=(0,De.TS)(ze,{progressStepMarginInlineEnd:Ue,progressStepMinWidth:Ue,progressActiveMotionDuration:"2.4s"});return[$t(Bt),It(Bt),Ut(Bt),Yt(Bt)]},ze=>({circleTextColor:ze.colorText,defaultColor:ze.colorInfo,remainingColor:ze.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em"})),hn=function(ze,Ue){var Bt={};for(var Jt in ze)Object.prototype.hasOwnProperty.call(ze,Jt)&&Ue.indexOf(Jt)<0&&(Bt[Jt]=ze[Jt]);if(ze!=null&&typeof Object.getOwnPropertySymbols=="function")for(var rn=0,Jt=Object.getOwnPropertySymbols(ze);rn<Jt.length;rn++)Ue.indexOf(Jt[rn])<0&&Object.prototype.propertyIsEnumerable.call(ze,Jt[rn])&&(Bt[Jt[rn]]=ze[Jt[rn]]);return Bt};const _n=null,vt=["normal","exception","active","success"];var Sn=fe.forwardRef((ze,Ue)=>{const{prefixCls:Bt,className:Jt,rootClassName:rn,steps:An,strokeColor:In,percent:Ln=0,size:Fn="default",showInfo:jn=!0,type:Tn="line",status:hr,format:kr,style:Tr}=ze,Hr=hn(ze,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style"]),sr=fe.useMemo(()=>{var ct,ke;const Be=bt(ze);return parseInt(Be!==void 0?(ct=Be!=null?Be:0)===null||ct===void 0?void 0:ct.toString():(ke=Ln!=null?Ln:0)===null||ke===void 0?void 0:ke.toString(),10)},[Ln,ze.success,ze.successPercent]),Mr=fe.useMemo(()=>!vt.includes(hr)&&sr>=100?"success":hr||"normal",[hr,sr]),{getPrefixCls:rr,direction:Or,progress:Fr}=fe.useContext(Me.E_),Er=rr("progress",Bt),[jr,Nr]=dn(Er),Jn=fe.useMemo(()=>{if(!jn)return null;const ct=bt(ze);let ke;const Be=kr||(Ie=>`${Ie}%`),Ae=Tn==="line";return kr||Mr!=="exception"&&Mr!=="success"?ke=Be(xe(Ln),xe(ct)):Mr==="exception"?ke=Ae?fe.createElement(tt.Z,null):fe.createElement(be.Z,null):Mr==="success"&&(ke=Ae?fe.createElement(Ze.Z,null):fe.createElement(Fe.Z,null)),fe.createElement("span",{className:`${Er}-text`,title:typeof ke=="string"?ke:void 0},ke)},[jn,Ln,sr,Mr,Tn,Er,kr]),lr=Array.isArray(In)?In[0]:In,Rn=typeof In=="string"||Array.isArray(In)?In:void 0;let $n;Tn==="line"?$n=An?fe.createElement(oe,Object.assign({},ze,{strokeColor:Rn,prefixCls:Er,steps:An}),Jn):fe.createElement(ge,Object.assign({},ze,{strokeColor:lr,prefixCls:Er,direction:Or}),Jn):(Tn==="circle"||Tn==="dashboard")&&($n=fe.createElement(Zt,Object.assign({},ze,{strokeColor:lr,prefixCls:Er,progressStatus:Mr}),Jn));const wr=Re()(Er,`${Er}-status-${Mr}`,`${Er}-${Tn==="dashboard"&&"circle"||An&&"steps"||Tn}`,{[`${Er}-inline-circle`]:Tn==="circle"&&qe(Fn,"circle")[0]<=20,[`${Er}-show-info`]:jn,[`${Er}-${Fn}`]:typeof Fn=="string",[`${Er}-rtl`]:Or==="rtl"},Fr==null?void 0:Fr.className,Jt,rn,Nr);return jr(fe.createElement("div",Object.assign({ref:Ue,style:Object.assign(Object.assign({},Fr==null?void 0:Fr.style),Tr),className:wr,role:"progressbar","aria-valuenow":sr},(0,Se.Z)(Hr,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),$n))}),Ye=Sn},5112:function(Mn,Qt,ue){"use strict";ue.d(Qt,{ZP:function(){return Ke}});var fe=ue(92310),Ze=ue.n(fe),Fe=ue(18929),tt=ue(26112),be=ue(59301),Le=ue(36355),Re=ue(19716);const Se=be.createContext(null),Me=Se.Provider;var Pe=Se;const rt=be.createContext(null),Te=rt.Provider;var He=ue(5630),ht=ue(8654),Je=ue(1684),lt=ue(32441),st=ue(17313),Rt=ue(83116),qt=ue(37613);const at=xe=>{const{componentCls:bt,antCls:fn}=xe,Xt=`${bt}-group`;return{[Xt]:Object.assign(Object.assign({},(0,st.Wf)(xe)),{display:"inline-block",fontSize:0,[`&${Xt}-rtl`]:{direction:"rtl"},[`${fn}-badge ${fn}-badge-count`]:{zIndex:1},[`> ${fn}-badge:not(:first-child) > ${fn}-button-wrapper`]:{borderInlineStart:"none"}})}},ft=xe=>{const{componentCls:bt,wrapperMarginInlineEnd:fn,colorPrimary:Xt,radioSize:qe,motionDurationSlow:je,motionDurationMid:gt,motionEaseInOutCirc:en,colorBgContainer:Zt,colorBorder:pn,lineWidth:Vt,dotSize:Ft,colorBgContainerDisabled:Tt,colorTextDisabled:ge,paddingXS:se,dotColorDisabled:oe,lineType:de,radioDotDisabledSize:pe,wireframe:le,colorWhite:De}=xe,ot=`${bt}-inner`;return{[`${bt}-wrapper`]:Object.assign(Object.assign({},(0,st.Wf)(xe)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:fn,cursor:"pointer",[`&${bt}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:xe.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},[`${bt}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${Vt}px ${de} ${Xt}`,borderRadius:"50%",visibility:"hidden",content:'""'},[bt]:Object.assign(Object.assign({},(0,st.Wf)(xe)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${bt}-wrapper:hover &,
&:hover ${ot}`]:{borderColor:Xt},[`${bt}-input:focus-visible + ${ot}`]:Object.assign({},(0,st.oN)(xe)),[`${bt}:hover::after, ${bt}-wrapper:hover &::after`]:{visibility:"visible"},[`${bt}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:qe,height:qe,marginBlockStart:qe/-2,marginInlineStart:qe/-2,backgroundColor:le?Xt:De,borderBlockStart:0,borderInlineStart:0,borderRadius:qe,transform:"scale(0)",opacity:0,transition:`all ${je} ${en}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:qe,height:qe,backgroundColor:Zt,borderColor:pn,borderStyle:"solid",borderWidth:Vt,borderRadius:"50%",transition:`all ${gt}`},[`${bt}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${bt}-checked`]:{[ot]:{borderColor:Xt,backgroundColor:le?Zt:Xt,"&::after":{transform:`scale(${Ft/qe})`,opacity:1,transition:`all ${je} ${en}`}}},[`${bt}-disabled`]:{cursor:"not-allowed",[ot]:{backgroundColor:Tt,borderColor:pn,cursor:"not-allowed","&::after":{backgroundColor:oe}},[`${bt}-input`]:{cursor:"not-allowed"},[`${bt}-disabled + span`]:{color:ge,cursor:"not-allowed"},[`&${bt}-checked`]:{[ot]:{"&::after":{transform:`scale(${pe/qe})`}}}},[`span${bt} + *`]:{paddingInlineStart:se,paddingInlineEnd:se}})}},Ve=xe=>{const{buttonColor:bt,controlHeight:fn,componentCls:Xt,lineWidth:qe,lineType:je,colorBorder:gt,motionDurationSlow:en,motionDurationMid:Zt,buttonPaddingInline:pn,fontSize:Vt,buttonBg:Ft,fontSizeLG:Tt,controlHeightLG:ge,controlHeightSM:se,paddingXS:oe,borderRadius:de,borderRadiusSM:pe,borderRadiusLG:le,buttonCheckedBg:De,buttonSolidCheckedColor:ot,colorTextDisabled:$t,colorBgContainerDisabled:It,buttonCheckedBgDisabled:Ut,buttonCheckedColorDisabled:Yt,colorPrimary:dn,colorPrimaryHover:hn,colorPrimaryActive:_n,buttonSolidCheckedBg:vt,buttonSolidCheckedHoverBg:cn,buttonSolidCheckedActiveBg:Sn}=xe;return{[`${Xt}-button-wrapper`]:{position:"relative",display:"inline-block",height:fn,margin:0,paddingInline:pn,paddingBlock:0,color:bt,fontSize:Vt,lineHeight:`${fn-qe*2}px`,background:Ft,border:`${qe}px ${je} ${gt}`,borderBlockStartWidth:qe+.02,borderInlineStartWidth:0,borderInlineEndWidth:qe,cursor:"pointer",transition:[`color ${Zt}`,`background ${Zt}`,`box-shadow ${Zt}`].join(","),a:{color:bt},[`> ${Xt}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:-qe,insetInlineStart:-qe,display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:qe,paddingInline:0,backgroundColor:gt,transition:`background-color ${en}`,content:'""'}},"&:first-child":{borderInlineStart:`${qe}px ${je} ${gt}`,borderStartStartRadius:de,borderEndStartRadius:de},"&:last-child":{borderStartEndRadius:de,borderEndEndRadius:de},"&:first-child:last-child":{borderRadius:de},[`${Xt}-group-large &`]:{height:ge,fontSize:Tt,lineHeight:`${ge-qe*2}px`,"&:first-child":{borderStartStartRadius:le,borderEndStartRadius:le},"&:last-child":{borderStartEndRadius:le,borderEndEndRadius:le}},[`${Xt}-group-small &`]:{height:se,paddingInline:oe-qe,paddingBlock:0,lineHeight:`${se-qe*2}px`,"&:first-child":{borderStartStartRadius:pe,borderEndStartRadius:pe},"&:last-child":{borderStartEndRadius:pe,borderEndEndRadius:pe}},"&:hover":{position:"relative",color:dn},"&:has(:focus-visible)":Object.assign({},(0,st.oN)(xe)),[`${Xt}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${Xt}-button-wrapper-disabled)`]:{zIndex:1,color:dn,background:De,borderColor:dn,"&::before":{backgroundColor:dn},"&:first-child":{borderColor:dn},"&:hover":{color:hn,borderColor:hn,"&::before":{backgroundColor:hn}},"&:active":{color:_n,borderColor:_n,"&::before":{backgroundColor:_n}}},[`${Xt}-group-solid &-checked:not(${Xt}-button-wrapper-disabled)`]:{color:ot,background:vt,borderColor:vt,"&:hover":{color:ot,background:cn,borderColor:cn},"&:active":{color:ot,background:Sn,borderColor:Sn}},"&-disabled":{color:$t,backgroundColor:It,borderColor:gt,cursor:"not-allowed","&:first-child, &:hover":{color:$t,backgroundColor:It,borderColor:gt}},[`&-disabled${Xt}-button-wrapper-checked`]:{color:Yt,backgroundColor:Ut,borderColor:gt,boxShadow:"none"}}}},_e=xe=>xe-4*2;var We=(0,Rt.Z)("Radio",xe=>{const{controlOutline:bt,controlOutlineWidth:fn,radioSize:Xt}=xe,qe=`0 0 0 ${fn}px ${bt}`,je=qe,gt=_e(Xt),en=(0,qt.TS)(xe,{radioDotDisabledSize:gt,radioFocusShadow:qe,radioButtonFocusShadow:je});return[at(en),ft(en),Ve(en)]},xe=>{const{wireframe:bt,padding:fn,marginXS:Xt,lineWidth:qe,fontSizeLG:je,colorText:gt,colorBgContainer:en,colorTextDisabled:Zt,controlItemBgActiveDisabled:pn,colorTextLightSolid:Vt,colorPrimary:Ft,colorPrimaryHover:Tt,colorPrimaryActive:ge}=xe,se=4,oe=je,de=bt?_e(oe):oe-(se+qe)*2;return{radioSize:oe,dotSize:de,dotColorDisabled:Zt,buttonSolidCheckedColor:Vt,buttonSolidCheckedBg:Ft,buttonSolidCheckedHoverBg:Tt,buttonSolidCheckedActiveBg:ge,buttonBg:en,buttonCheckedBg:en,buttonColor:gt,buttonCheckedBgDisabled:pn,buttonCheckedColorDisabled:Zt,buttonPaddingInline:fn-qe,wrapperMarginInlineEnd:Xt}}),et=ue(14088),Mt=ue(4572),Qe=function(xe,bt){var fn={};for(var Xt in xe)Object.prototype.hasOwnProperty.call(xe,Xt)&&bt.indexOf(Xt)<0&&(fn[Xt]=xe[Xt]);if(xe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var qe=0,Xt=Object.getOwnPropertySymbols(xe);qe<Xt.length;qe++)bt.indexOf(Xt[qe])<0&&Object.prototype.propertyIsEnumerable.call(xe,Xt[qe])&&(fn[Xt[qe]]=xe[Xt[qe]]);return fn};const Kt=(xe,bt)=>{var fn,Xt;const qe=be.useContext(Pe),je=be.useContext(rt),{getPrefixCls:gt,direction:en,radio:Zt}=be.useContext(Le.E_),pn=be.useRef(null),Vt=(0,ht.sQ)(bt,pn),{isFormItemInput:Ft}=be.useContext(lt.aM),Tt=_n=>{var vt,cn;(vt=xe.onChange)===null||vt===void 0||vt.call(xe,_n),(cn=qe==null?void 0:qe.onChange)===null||cn===void 0||cn.call(qe,_n)},{prefixCls:ge,className:se,rootClassName:oe,children:de,style:pe}=xe,le=Qe(xe,["prefixCls","className","rootClassName","children","style"]),De=gt("radio",ge),ot=((qe==null?void 0:qe.optionType)||je)==="button",$t=ot?`${De}-button`:De,[It,Ut]=We(De),Yt=Object.assign({},le),dn=be.useContext(Je.Z);qe&&(Yt.name=qe.name,Yt.onChange=Tt,Yt.checked=xe.value===qe.value,Yt.disabled=(fn=Yt.disabled)!==null&&fn!==void 0?fn:qe.disabled),Yt.disabled=(Xt=Yt.disabled)!==null&&Xt!==void 0?Xt:dn;const hn=Ze()(`${$t}-wrapper`,{[`${$t}-wrapper-checked`]:Yt.checked,[`${$t}-wrapper-disabled`]:Yt.disabled,[`${$t}-wrapper-rtl`]:en==="rtl",[`${$t}-wrapper-in-form-item`]:Ft},Zt==null?void 0:Zt.className,se,oe,Ut);return It(be.createElement(et.Z,{component:"Radio",disabled:Yt.disabled},be.createElement("label",{className:hn,style:Object.assign(Object.assign({},Zt==null?void 0:Zt.style),pe),onMouseEnter:xe.onMouseEnter,onMouseLeave:xe.onMouseLeave},be.createElement(He.Z,Object.assign({},Yt,{className:Ze()(Yt.className,!ot&&Mt.A),type:"radio",prefixCls:$t,ref:Vt})),de!==void 0?be.createElement("span",null,de):null)))};var Pt=be.forwardRef(Kt);const nt=be.forwardRef((xe,bt)=>{const{getPrefixCls:fn,direction:Xt}=be.useContext(Le.E_),[qe,je]=(0,Fe.Z)(xe.defaultValue,{value:xe.value}),gt=vt=>{const cn=qe,Sn=vt.target.value;"value"in xe||je(Sn);const{onChange:Ye}=xe;Ye&&Sn!==cn&&Ye(vt)},{prefixCls:en,className:Zt,rootClassName:pn,options:Vt,buttonStyle:Ft="outline",disabled:Tt,children:ge,size:se,style:oe,id:de,onMouseEnter:pe,onMouseLeave:le,onFocus:De,onBlur:ot}=xe,$t=fn("radio",en),It=`${$t}-group`,[Ut,Yt]=We($t);let dn=ge;Vt&&Vt.length>0&&(dn=Vt.map(vt=>typeof vt=="string"||typeof vt=="number"?be.createElement(Pt,{key:vt.toString(),prefixCls:$t,disabled:Tt,value:vt,checked:qe===vt},vt):be.createElement(Pt,{key:`radio-group-value-options-${vt.value}`,prefixCls:$t,disabled:vt.disabled||Tt,value:vt.value,checked:qe===vt.value,title:vt.title,style:vt.style},vt.label)));const hn=(0,Re.Z)(se),_n=Ze()(It,`${It}-${Ft}`,{[`${It}-${hn}`]:hn,[`${It}-rtl`]:Xt==="rtl"},Zt,pn,Yt);return Ut(be.createElement("div",Object.assign({},(0,tt.Z)(xe,{aria:!0,data:!0}),{className:_n,style:oe,onMouseEnter:pe,onMouseLeave:le,onFocus:De,onBlur:ot,id:de,ref:bt}),be.createElement(Me,{value:{onChange:gt,value:qe,disabled:xe.disabled,name:xe.name,optionType:xe.optionType}},dn)))});var Gt=be.memo(nt),mn=function(xe,bt){var fn={};for(var Xt in xe)Object.prototype.hasOwnProperty.call(xe,Xt)&&bt.indexOf(Xt)<0&&(fn[Xt]=xe[Xt]);if(xe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var qe=0,Xt=Object.getOwnPropertySymbols(xe);qe<Xt.length;qe++)bt.indexOf(Xt[qe])<0&&Object.prototype.propertyIsEnumerable.call(xe,Xt[qe])&&(fn[Xt[qe]]=xe[Xt[qe]]);return fn};const on=(xe,bt)=>{const{getPrefixCls:fn}=be.useContext(Le.E_),{prefixCls:Xt}=xe,qe=mn(xe,["prefixCls"]),je=fn("radio",Xt);return be.createElement(Te,{value:"button"},be.createElement(Pt,Object.assign({prefixCls:je},qe,{type:"radio",ref:bt})))};var sn=be.forwardRef(on);const jt=Pt;jt.Button=sn,jt.Group=Gt,jt.__ANT_RADIO=!0;var Ke=jt},57809:function(Mn,Qt,ue){"use strict";var fe=ue(92310),Ze=ue.n(fe),Fe=ue(77861),tt=ue(2738),be=ue(59301),Le=ue(53487),Re=ue(62892),Se=ue(19080),Me=ue(36355),Pe=ue(1684),rt=ue(93891),Te=ue(19716),He=ue(32441),ht=ue(33234),Je=ue(14154),lt=ue(58582),st=ue(84443),Rt=ue(66339),qt=function(We,et){var Mt={};for(var Qe in We)Object.prototype.hasOwnProperty.call(We,Qe)&&et.indexOf(Qe)<0&&(Mt[Qe]=We[Qe]);if(We!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Kt=0,Qe=Object.getOwnPropertySymbols(We);Kt<Qe.length;Kt++)et.indexOf(Qe[Kt])<0&&Object.prototype.propertyIsEnumerable.call(We,Qe[Kt])&&(Mt[Qe[Kt]]=We[Qe[Kt]]);return Mt};const at="SECRET_COMBOBOX_MODE_DO_NOT_USE",ft=(We,et)=>{var Mt,{prefixCls:Qe,bordered:Kt=!0,className:ut,rootClassName:Pt,getPopupContainer:nt,popupClassName:Gt,dropdownClassName:mn,listHeight:on=256,placement:sn,listItemHeight:jt=24,size:Ke,disabled:xe,notFoundContent:bt,status:fn,builtinPlacements:Xt,dropdownMatchSelectWidth:qe,popupMatchSelectWidth:je,direction:gt,style:en,allowClear:Zt}=We,pn=qt(We,["prefixCls","bordered","className","rootClassName","getPopupContainer","popupClassName","dropdownClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","direction","style","allowClear"]);const{getPopupContainer:Vt,getPrefixCls:Ft,renderEmpty:Tt,direction:ge,virtual:se,popupMatchSelectWidth:oe,popupOverflow:de,select:pe}=be.useContext(Me.E_),le=Ft("select",Qe),De=Ft(),ot=gt!=null?gt:ge,{compactSize:$t,compactItemClassnames:It}=(0,ht.ri)(le,ot),[Ut,Yt]=(0,Je.Z)(le),dn=be.useMemo(()=>{const{mode:Mr}=pn;if(Mr!=="combobox")return Mr===at?"combobox":Mr},[pn.mode]),hn=dn==="multiple"||dn==="tags",_n=(0,st.Z)(pn.suffixIcon,pn.showArrow),vt=(Mt=je!=null?je:qe)!==null&&Mt!==void 0?Mt:oe,{status:cn,hasFeedback:Sn,isFormItemInput:Ye,feedbackIcon:ze}=be.useContext(He.aM),Ue=(0,Se.F)(cn,fn);let Bt;bt!==void 0?Bt=bt:dn==="combobox"?Bt=null:Bt=(Tt==null?void 0:Tt("Select"))||be.createElement(rt.Z,{componentName:"Select"});const{suffixIcon:Jt,itemIcon:rn,removeIcon:An,clearIcon:In}=(0,Rt.Z)(Object.assign(Object.assign({},pn),{multiple:hn,hasFeedback:Sn,feedbackIcon:ze,showSuffixIcon:_n,prefixCls:le,showArrow:pn.showArrow,componentName:"Select"})),Ln=Zt===!0?{clearIcon:In}:Zt,Fn=(0,tt.Z)(pn,["suffixIcon","itemIcon"]),jn=Ze()(Gt||mn,{[`${le}-dropdown-${ot}`]:ot==="rtl"},Pt,Yt),Tn=(0,Te.Z)(Mr=>{var rr;return(rr=Ke!=null?Ke:$t)!==null&&rr!==void 0?rr:Mr}),hr=be.useContext(Pe.Z),kr=xe!=null?xe:hr,Tr=Ze()({[`${le}-lg`]:Tn==="large",[`${le}-sm`]:Tn==="small",[`${le}-rtl`]:ot==="rtl",[`${le}-borderless`]:!Kt,[`${le}-in-form-item`]:Ye},(0,Se.Z)(le,Ue,Sn),It,pe==null?void 0:pe.className,ut,Pt,Yt),Hr=be.useMemo(()=>sn!==void 0?sn:ot==="rtl"?"bottomRight":"bottomLeft",[sn,ot]),sr=(0,lt.Z)(Xt,de);return Ut(be.createElement(Fe.ZP,Object.assign({ref:et,virtual:se,showSearch:pe==null?void 0:pe.showSearch},Fn,{style:Object.assign(Object.assign({},pe==null?void 0:pe.style),en),dropdownMatchSelectWidth:vt,builtinPlacements:sr,transitionName:(0,Re.m)(De,"slide-up",pn.transitionName),listHeight:on,listItemHeight:jt,mode:dn,prefixCls:le,placement:Hr,direction:ot,suffixIcon:Jt,menuItemSelectedIcon:rn,removeIcon:An,allowClear:Ln,notFoundContent:Bt,className:Tr,getPopupContainer:nt||Vt,dropdownClassName:jn,disabled:kr})))},Ve=be.forwardRef(ft),_e=(0,Le.Z)(Ve);Ve.SECRET_COMBOBOX_MODE_DO_NOT_USE=at,Ve.Option=Fe.Wx,Ve.OptGroup=Fe.Xo,Ve._InternalPanelDoNotUseOrYouWillBeFired=_e,Qt.default=Ve},14154:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Ve}});var fe=ue(17313),Ze=ue(74207),Fe=ue(37613),tt=ue(83116),be=ue(13826),Le=ue(92899);const Re=_e=>{const{optionHeight:We,optionFontSize:et,optionLineHeight:Mt,optionPadding:Qe}=_e;return{position:"relative",display:"block",minHeight:We,padding:Qe,color:_e.colorText,fontWeight:"normal",fontSize:et,lineHeight:Mt,boxSizing:"border-box"}};var Me=_e=>{const{antCls:We,componentCls:et}=_e,Mt=`${et}-item`,Qe=`&${We}-slide-up-enter${We}-slide-up-enter-active`,Kt=`&${We}-slide-up-appear${We}-slide-up-appear-active`,ut=`&${We}-slide-up-leave${We}-slide-up-leave-active`,Pt=`${et}-dropdown-placement-`;return[{[`${et}-dropdown`]:Object.assign(Object.assign({},(0,fe.Wf)(_e)),{position:"absolute",top:-9999,zIndex:_e.zIndexPopup,boxSizing:"border-box",padding:_e.paddingXXS,overflow:"hidden",fontSize:_e.fontSize,fontVariant:"initial",backgroundColor:_e.colorBgElevated,borderRadius:_e.borderRadiusLG,outline:"none",boxShadow:_e.boxShadowSecondary,[`
${Qe}${Pt}bottomLeft,
${Kt}${Pt}bottomLeft
`]:{animationName:be.fJ},[`
${Qe}${Pt}topLeft,
${Kt}${Pt}topLeft,
${Qe}${Pt}topRight,
${Kt}${Pt}topRight
`]:{animationName:be.Qt},[`${ut}${Pt}bottomLeft`]:{animationName:be.Uw},[`
${ut}${Pt}topLeft,
${ut}${Pt}topRight
`]:{animationName:be.ly},"&-hidden":{display:"none"},[`${Mt}`]:Object.assign(Object.assign({},Re(_e)),{cursor:"pointer",transition:`background ${_e.motionDurationSlow} ease`,borderRadius:_e.borderRadiusSM,"&-group":{color:_e.colorTextDescription,fontSize:_e.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":Object.assign({flex:"auto"},fe.vS),"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${Mt}-option-disabled)`]:{backgroundColor:_e.optionActiveBg},[`&-selected:not(${Mt}-option-disabled)`]:{color:_e.optionSelectedColor,fontWeight:_e.optionSelectedFontWeight,backgroundColor:_e.optionSelectedBg,[`${Mt}-option-state`]:{color:_e.colorPrimary}},"&-disabled":{[`&${Mt}-option-selected`]:{backgroundColor:_e.colorBgContainerDisabled},color:_e.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:_e.controlPaddingHorizontal*2}}}),"&-rtl":{direction:"rtl"}})},(0,be.oN)(_e,"slide-up"),(0,be.oN)(_e,"slide-down"),(0,Le.Fm)(_e,"move-up"),(0,Le.Fm)(_e,"move-down")]};const Pe=2,rt=_e=>{let{controlHeightSM:We,controlHeight:et,lineWidth:Mt}=_e;const Qe=(et-We)/2-Mt,Kt=Math.ceil(Qe/2);return[Qe,Kt]};function Te(_e,We){const{componentCls:et,iconCls:Mt}=_e,Qe=`${et}-selection-overflow`,Kt=_e.multipleSelectItemHeight,[ut]=rt(_e),Pt=We?`${et}-${We}`:"";return{[`${et}-multiple${Pt}`]:{fontSize:_e.fontSize,[Qe]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"100%",display:"inline-flex"}},[`${et}-selector`]:{display:"flex",flexWrap:"wrap",alignItems:"center",padding:`${ut-Pe}px ${Pe*2}px`,borderRadius:_e.borderRadius,[`${et}-show-search&`]:{cursor:"text"},[`${et}-disabled&`]:{background:_e.multipleSelectorBgDisabled,cursor:"not-allowed"},"&:after":{display:"inline-block",width:0,margin:`${Pe}px 0`,lineHeight:`${Kt}px`,visibility:"hidden",content:'"\\a0"'}},[`
&${et}-show-arrow ${et}-selector,
&${et}-allow-clear ${et}-selector
`]:{paddingInlineEnd:_e.fontSizeIcon+_e.controlPaddingHorizontal},[`${et}-selection-item`]:{position:"relative",display:"flex",flex:"none",boxSizing:"border-box",maxWidth:"100%",height:Kt,marginTop:Pe,marginBottom:Pe,lineHeight:`${Kt-_e.lineWidth*2}px`,background:_e.multipleItemBg,border:`${_e.lineWidth}px ${_e.lineType} ${_e.multipleItemBorderColor}`,borderRadius:_e.borderRadiusSM,cursor:"default",transition:`font-size ${_e.motionDurationSlow}, line-height ${_e.motionDurationSlow}, height ${_e.motionDurationSlow}`,userSelect:"none",marginInlineEnd:Pe*2,paddingInlineStart:_e.paddingXS,paddingInlineEnd:_e.paddingXS/2,[`${et}-disabled&`]:{color:_e.multipleItemColorDisabled,borderColor:_e.multipleItemBorderColorDisabled,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:_e.paddingXS/2,overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":Object.assign(Object.assign({},(0,fe.Ro)()),{display:"inline-flex",alignItems:"center",color:_e.colorIcon,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${Mt}`]:{verticalAlign:"-0.2em"},"&:hover":{color:_e.colorIconHover}})},[`${Qe}-item + ${Qe}-item`]:{[`${et}-selection-search`]:{marginInlineStart:0}},[`${et}-selection-search`]:{display:"inline-flex",position:"relative",maxWidth:"100%",marginInlineStart:_e.inputPaddingHorizontalBase-ut,"\n &-input,\n &-mirror\n ":{height:Kt,fontFamily:_e.fontFamily,lineHeight:`${Kt}px`,transition:`all ${_e.motionDurationSlow}`},"&-input":{width:"100%",minWidth:4.1},"&-mirror":{position:"absolute",top:0,insetInlineStart:0,insetInlineEnd:"auto",zIndex:999,whiteSpace:"pre",visibility:"hidden"}},[`${et}-selection-placeholder `]:{position:"absolute",top:"50%",insetInlineStart:_e.inputPaddingHorizontalBase,insetInlineEnd:_e.inputPaddingHorizontalBase,transform:"translateY(-50%)",transition:`all ${_e.motionDurationSlow}`}}}}var ht=_e=>{const{componentCls:We}=_e,et=(0,Fe.TS)(_e,{controlHeight:_e.controlHeightSM,multipleSelectItemHeight:_e.controlHeightXS,borderRadius:_e.borderRadiusSM,borderRadiusSM:_e.borderRadiusXS}),Mt=(0,Fe.TS)(_e,{fontSize:_e.fontSizeLG,controlHeight:_e.controlHeightLG,multipleSelectItemHeight:_e.multipleItemHeightLG,borderRadius:_e.borderRadiusLG,borderRadiusSM:_e.borderRadius}),[,Qe]=rt(_e);return[Te(_e),Te(et,"sm"),{[`${We}-multiple${We}-sm`]:{[`${We}-selection-placeholder`]:{insetInline:_e.controlPaddingHorizontalSM-_e.lineWidth},[`${We}-selection-search`]:{marginInlineStart:Qe}}},Te(Mt,"lg")]};function Je(_e,We){const{componentCls:et,inputPaddingHorizontalBase:Mt,borderRadius:Qe}=_e,Kt=_e.controlHeight-_e.lineWidth*2,ut=Math.ceil(_e.fontSize*1.25),Pt=We?`${et}-${We}`:"";return{[`${et}-single${Pt}`]:{fontSize:_e.fontSize,[`${et}-selector`]:Object.assign(Object.assign({},(0,fe.Wf)(_e)),{display:"flex",borderRadius:Qe,[`${et}-selection-search`]:{position:"absolute",top:0,insetInlineStart:Mt,insetInlineEnd:Mt,bottom:0,"&-input":{width:"100%"}},[`
${et}-selection-item,
${et}-selection-placeholder
`]:{padding:0,lineHeight:`${Kt}px`,transition:`all ${_e.motionDurationSlow}, visibility 0s`,"@supports (-moz-appearance: meterbar)":{lineHeight:`${Kt}px`}},[`${et}-selection-item`]:{position:"relative",userSelect:"none"},[`${et}-selection-placeholder`]:{transition:"none",pointerEvents:"none"},[["&:after",`${et}-selection-item:after`,`${et}-selection-placeholder:after`].join(",")]:{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'}}),[`
&${et}-show-arrow ${et}-selection-item,
&${et}-show-arrow ${et}-selection-placeholder
`]:{paddingInlineEnd:ut},[`&${et}-open ${et}-selection-item`]:{color:_e.colorTextPlaceholder},[`&:not(${et}-customize-input)`]:{[`${et}-selector`]:{width:"100%",height:_e.controlHeight,padding:`0 ${Mt}px`,[`${et}-selection-search-input`]:{height:Kt},"&:after":{lineHeight:`${Kt}px`}}},[`&${et}-customize-input`]:{[`${et}-selector`]:{"&:after":{display:"none"},[`${et}-selection-search`]:{position:"static",width:"100%"},[`${et}-selection-placeholder`]:{position:"absolute",insetInlineStart:0,insetInlineEnd:0,padding:`0 ${Mt}px`,"&:after":{display:"none"}}}}}}}function lt(_e){const{componentCls:We}=_e,et=_e.controlPaddingHorizontalSM-_e.lineWidth;return[Je(_e),Je((0,Fe.TS)(_e,{controlHeight:_e.controlHeightSM,borderRadius:_e.borderRadiusSM}),"sm"),{[`${We}-single${We}-sm`]:{[`&:not(${We}-customize-input)`]:{[`${We}-selection-search`]:{insetInlineStart:et,insetInlineEnd:et},[`${We}-selector`]:{padding:`0 ${et}px`},[`&${We}-show-arrow ${We}-selection-search`]:{insetInlineEnd:et+_e.fontSize*1.5},[`
&${We}-show-arrow ${We}-selection-item,
&${We}-show-arrow ${We}-selection-placeholder
`]:{paddingInlineEnd:_e.fontSize*1.5}}}},Je((0,Fe.TS)(_e,{controlHeight:_e.singleItemHeightLG,fontSize:_e.fontSizeLG,borderRadius:_e.borderRadiusLG}),"lg")]}const st=_e=>{const{componentCls:We,selectorBg:et}=_e;return{position:"relative",backgroundColor:et,border:`${_e.lineWidth}px ${_e.lineType} ${_e.colorBorder}`,transition:`all ${_e.motionDurationMid} ${_e.motionEaseInOut}`,input:{cursor:"pointer"},[`${We}-show-search&`]:{cursor:"text",input:{cursor:"auto",color:"inherit"}},[`${We}-disabled&`]:{color:_e.colorTextDisabled,background:_e.colorBgContainerDisabled,cursor:"not-allowed",[`${We}-multiple&`]:{background:_e.multipleSelectorBgDisabled},input:{cursor:"not-allowed"}}}},Rt=function(_e,We){let et=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const{componentCls:Mt,borderHoverColor:Qe,outlineColor:Kt,antCls:ut}=We,Pt=et?{[`${Mt}-selector`]:{borderColor:Qe}}:{};return{[_e]:{[`&:not(${Mt}-disabled):not(${Mt}-customize-input):not(${ut}-pagination-size-changer)`]:Object.assign(Object.assign({},Pt),{[`${Mt}-focused& ${Mt}-selector`]:{borderColor:Qe,boxShadow:`0 0 0 ${We.controlOutlineWidth}px ${Kt}`,outline:0},[`&:hover ${Mt}-selector`]:{borderColor:Qe}})}}},qt=_e=>{const{componentCls:We}=_e;return{[`${We}-selection-search-input`]:{margin:0,padding:0,background:"transparent",border:"none",outline:"none",appearance:"none","&::-webkit-search-cancel-button":{display:"none","-webkit-appearance":"none"}}}},at=_e=>{const{componentCls:We,inputPaddingHorizontalBase:et,iconCls:Mt}=_e;return{[We]:Object.assign(Object.assign({},(0,fe.Wf)(_e)),{position:"relative",display:"inline-block",cursor:"pointer",[`&:not(${We}-customize-input) ${We}-selector`]:Object.assign(Object.assign({},st(_e)),qt(_e)),[`${We}-selection-item`]:Object.assign({flex:1,fontWeight:"normal"},fe.vS),[`${We}-selection-placeholder`]:Object.assign(Object.assign({},fe.vS),{flex:1,color:_e.colorTextPlaceholder,pointerEvents:"none"}),[`${We}-arrow`]:Object.assign(Object.assign({},(0,fe.Ro)()),{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:et,height:_e.fontSizeIcon,marginTop:-_e.fontSizeIcon/2,color:_e.colorTextQuaternary,fontSize:_e.fontSizeIcon,lineHeight:1,textAlign:"center",pointerEvents:"none",display:"flex",alignItems:"center",[Mt]:{verticalAlign:"top",transition:`transform ${_e.motionDurationSlow}`,"> svg":{verticalAlign:"top"},[`&:not(${We}-suffix)`]:{pointerEvents:"auto"}},[`${We}-disabled &`]:{cursor:"not-allowed"},"> *:not(:last-child)":{marginInlineEnd:8}}),[`${We}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:et,zIndex:1,display:"inline-block",width:_e.fontSizeIcon,height:_e.fontSizeIcon,marginTop:-_e.fontSizeIcon/2,color:_e.colorTextQuaternary,fontSize:_e.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",background:_e.clearBg,cursor:"pointer",opacity:0,transition:`color ${_e.motionDurationMid} ease, opacity ${_e.motionDurationSlow} ease`,textRendering:"auto","&:before":{display:"block"},"&:hover":{color:_e.colorTextTertiary}},"&:hover":{[`${We}-clear`]:{opacity:1}}}),[`${We}-has-feedback`]:{[`${We}-clear`]:{insetInlineEnd:et+_e.fontSize+_e.paddingXS}}}},ft=_e=>{const{componentCls:We}=_e;return[{[We]:{[`&-borderless ${We}-selector`]:{backgroundColor:"transparent !important",borderColor:"transparent !important",boxShadow:"none !important"},[`&${We}-in-form-item`]:{width:"100%"}}},at(_e),lt(_e),ht(_e),Me(_e),{[`${We}-rtl`]:{direction:"rtl"}},Rt(We,(0,Fe.TS)(_e,{borderHoverColor:_e.colorPrimaryHover,outlineColor:_e.controlOutline})),Rt(`${We}-status-error`,(0,Fe.TS)(_e,{borderHoverColor:_e.colorErrorHover,outlineColor:_e.colorErrorOutline}),!0),Rt(`${We}-status-warning`,(0,Fe.TS)(_e,{borderHoverColor:_e.colorWarningHover,outlineColor:_e.colorWarningOutline}),!0),(0,Ze.c)(_e,{borderElCls:`${We}-selector`,focusElCls:`${We}-focused`})]};var Ve=(0,tt.Z)("Select",(_e,We)=>{let{rootPrefixCls:et}=We;const Mt=(0,Fe.TS)(_e,{rootPrefixCls:et,inputPaddingHorizontalBase:_e.paddingSM-1,multipleSelectItemHeight:_e.multipleItemHeight});return[ft(Mt)]},_e=>{const{fontSize:We,lineHeight:et,controlHeight:Mt,controlPaddingHorizontal:Qe,zIndexPopupBase:Kt,colorText:ut,fontWeightStrong:Pt,controlItemBgActive:nt,controlItemBgHover:Gt,colorBgContainer:mn,colorFillSecondary:on,controlHeightLG:sn,controlHeightSM:jt,colorBgContainerDisabled:Ke,colorTextDisabled:xe}=_e;return{zIndexPopup:Kt+50,optionSelectedColor:ut,optionSelectedFontWeight:Pt,optionSelectedBg:nt,optionActiveBg:Gt,optionPadding:`${(Mt-We*et)/2}px ${Qe}px`,optionFontSize:We,optionLineHeight:et,optionHeight:Mt,selectorBg:mn,clearBg:mn,singleItemHeightLG:sn,multipleItemBg:on,multipleItemBorderColor:"transparent",multipleItemHeight:jt,multipleItemHeightLG:Mt,multipleSelectorBgDisabled:Ke,multipleItemColorDisabled:xe,multipleItemBorderColorDisabled:"transparent"}})},58582:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Ze}});const fe=Fe=>{const be={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:Fe==="scroll"?"scroll":"visible",_experimental:{dynamicInset:!0}};return{bottomLeft:Object.assign(Object.assign({},be),{points:["tl","bl"],offset:[0,4]}),bottomRight:Object.assign(Object.assign({},be),{points:["tr","br"],offset:[0,4]}),topLeft:Object.assign(Object.assign({},be),{points:["bl","tl"],offset:[0,-4]}),topRight:Object.assign(Object.assign({},be),{points:["br","tr"],offset:[0,-4]})}};function Ze(Fe,tt){return Fe||fe(tt)}},84443:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return fe}});function fe(Ze,Fe){return Fe!==void 0?Fe:Ze!==null}},66339:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Se}});var fe=ue(40001),Ze=ue(19248),Fe=ue(99267),tt=ue(84105),be=ue(58617),Le=ue(47472),Re=ue(59301);function Se(Me){let{suffixIcon:Pe,clearIcon:rt,menuItemSelectedIcon:Te,removeIcon:He,loading:ht,multiple:Je,hasFeedback:lt,prefixCls:st,showSuffixIcon:Rt,feedbackIcon:qt,showArrow:at,componentName:ft}=Me;const Ve=rt!=null?rt:Re.createElement(Ze.Z,null),_e=Qe=>Pe===null&&!lt&&!at?null:Re.createElement(Re.Fragment,null,Rt!==!1&&Qe,lt&&qt);let We=null;if(Pe!==void 0)We=_e(Pe);else if(ht)We=_e(Re.createElement(be.Z,{spin:!0}));else{const Qe=`${st}-suffix`;We=Kt=>{let{open:ut,showSearch:Pt}=Kt;return _e(ut&&Pt?Re.createElement(Le.Z,{className:Qe}):Re.createElement(tt.Z,{className:Qe}))}}let et=null;Te!==void 0?et=Te:Je?et=Re.createElement(fe.Z,null):et=null;let Mt=null;return He!==void 0?Mt=He:Mt=Re.createElement(Fe.Z,null),{clearIcon:Ve,suffixIcon:We,itemIcon:et,removeIcon:Mt}}},8378:function(Mn,Qt){"use strict";const ue=fe=>({[fe.componentCls]:{[`${fe.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${fe.motionDurationMid} ${fe.motionEaseInOut},
opacity ${fe.motionDurationMid} ${fe.motionEaseInOut} !important`}},[`${fe.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${fe.motionDurationMid} ${fe.motionEaseInOut},
opacity ${fe.motionDurationMid} ${fe.motionEaseInOut} !important`}}});Qt.Z=ue},92899:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Fm:function(){return Te}});var fe=ue(36237),Ze=ue(95406);const Fe=new fe.Keyframes("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),tt=new fe.Keyframes("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),be=new fe.Keyframes("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Le=new fe.Keyframes("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),Re=new fe.Keyframes("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Se=new fe.Keyframes("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),Me=new fe.Keyframes("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),Pe=new fe.Keyframes("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),rt={"move-up":{inKeyframes:Me,outKeyframes:Pe},"move-down":{inKeyframes:Fe,outKeyframes:tt},"move-left":{inKeyframes:be,outKeyframes:Le},"move-right":{inKeyframes:Re,outKeyframes:Se}},Te=(He,ht)=>{const{antCls:Je}=He,lt=`${Je}-${ht}`,{inKeyframes:st,outKeyframes:Rt}=rt[ht];return[(0,Ze.R)(lt,st,Rt,He.motionDurationMid),{[`
${lt}-enter,
${lt}-appear
`]:{opacity:0,animationTimingFunction:He.motionEaseOutCirc},[`${lt}-leave`]:{animationTimingFunction:He.motionEaseInOutCirc}}]}},13826:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Qt:function(){return be},Uw:function(){return tt},fJ:function(){return Fe},ly:function(){return Le},oN:function(){return Te}});var fe=ue(36237),Ze=ue(95406);const Fe=new fe.Keyframes("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),tt=new fe.Keyframes("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),be=new fe.Keyframes("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),Le=new fe.Keyframes("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),Re=new fe.Keyframes("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),Se=new fe.Keyframes("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),Me=new fe.Keyframes("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),Pe=new fe.Keyframes("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),rt={"slide-up":{inKeyframes:Fe,outKeyframes:tt},"slide-down":{inKeyframes:be,outKeyframes:Le},"slide-left":{inKeyframes:Re,outKeyframes:Se},"slide-right":{inKeyframes:Me,outKeyframes:Pe}},Te=(He,ht)=>{const{antCls:Je}=He,lt=`${Je}-${ht}`,{inKeyframes:st,outKeyframes:Rt}=rt[ht];return[(0,Ze.R)(lt,st,Rt,He.motionDurationMid),{[`
${lt}-enter,
${lt}-appear
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:He.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${lt}-leave`]:{animationTimingFunction:He.motionEaseInQuint}}]}},78673:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Pt}});var fe=ue(58617),Ze=ue(92310),Fe=ue.n(Ze),tt=ue(54476),be=ue(20068),Le=ue(42978),Re=ue(75931),Se=ue(59301),Me=ue(18929),Pe=ue(10228),rt=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],Te=Se.forwardRef(function(nt,Gt){var mn,on=nt.prefixCls,sn=on===void 0?"rc-switch":on,jt=nt.className,Ke=nt.checked,xe=nt.defaultChecked,bt=nt.disabled,fn=nt.loadingIcon,Xt=nt.checkedChildren,qe=nt.unCheckedChildren,je=nt.onClick,gt=nt.onChange,en=nt.onKeyDown,Zt=(0,Re.Z)(nt,rt),pn=(0,Me.Z)(!1,{value:Ke,defaultValue:xe}),Vt=(0,Le.Z)(pn,2),Ft=Vt[0],Tt=Vt[1];function ge(pe,le){var De=Ft;return bt||(De=pe,Tt(De),gt==null||gt(De,le)),De}function se(pe){pe.which===Pe.Z.LEFT?ge(!1,pe):pe.which===Pe.Z.RIGHT&&ge(!0,pe),en==null||en(pe)}function oe(pe){var le=ge(!Ft,pe);je==null||je(le,pe)}var de=Fe()(sn,jt,(mn={},(0,be.Z)(mn,"".concat(sn,"-checked"),Ft),(0,be.Z)(mn,"".concat(sn,"-disabled"),bt),mn));return Se.createElement("button",(0,tt.Z)({},Zt,{type:"button",role:"switch","aria-checked":Ft,disabled:bt,className:de,ref:Gt,onKeyDown:se,onClick:oe}),fn,Se.createElement("span",{className:"".concat(sn,"-inner")},Se.createElement("span",{className:"".concat(sn,"-inner-checked")},Xt),Se.createElement("span",{className:"".concat(sn,"-inner-unchecked")},qe)))});Te.displayName="Switch";var He=Te,ht=ue(14088),Je=ue(36355),lt=ue(1684),st=ue(19716),Rt=ue(64993),qt=ue(17313),at=ue(83116),ft=ue(37613);const Ve=nt=>{const{componentCls:Gt,trackHeightSM:mn,trackPadding:on,trackMinWidthSM:sn,innerMinMarginSM:jt,innerMaxMarginSM:Ke,handleSizeSM:xe}=nt,bt=`${Gt}-inner`;return{[Gt]:{[`&${Gt}-small`]:{minWidth:sn,height:mn,lineHeight:`${mn}px`,[`${Gt}-inner`]:{paddingInlineStart:Ke,paddingInlineEnd:jt,[`${bt}-checked`]:{marginInlineStart:`calc(-100% + ${xe+on*2}px - ${Ke*2}px)`,marginInlineEnd:`calc(100% - ${xe+on*2}px + ${Ke*2}px)`},[`${bt}-unchecked`]:{marginTop:-mn,marginInlineStart:0,marginInlineEnd:0}},[`${Gt}-handle`]:{width:xe,height:xe},[`${Gt}-loading-icon`]:{top:(xe-nt.switchLoadingIconSize)/2,fontSize:nt.switchLoadingIconSize},[`&${Gt}-checked`]:{[`${Gt}-inner`]:{paddingInlineStart:jt,paddingInlineEnd:Ke,[`${bt}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${bt}-unchecked`]:{marginInlineStart:`calc(100% - ${xe+on*2}px + ${Ke*2}px)`,marginInlineEnd:`calc(-100% + ${xe+on*2}px - ${Ke*2}px)`}},[`${Gt}-handle`]:{insetInlineStart:`calc(100% - ${xe+on}px)`}},[`&:not(${Gt}-disabled):active`]:{[`&:not(${Gt}-checked) ${bt}`]:{[`${bt}-unchecked`]:{marginInlineStart:nt.marginXXS/2,marginInlineEnd:-nt.marginXXS/2}},[`&${Gt}-checked ${bt}`]:{[`${bt}-checked`]:{marginInlineStart:-nt.marginXXS/2,marginInlineEnd:nt.marginXXS/2}}}}}}},_e=nt=>{const{componentCls:Gt,handleSize:mn}=nt;return{[Gt]:{[`${Gt}-loading-icon${nt.iconCls}`]:{position:"relative",top:(mn-nt.fontSize)/2,color:nt.switchLoadingIconColor,verticalAlign:"top"},[`&${Gt}-checked ${Gt}-loading-icon`]:{color:nt.switchColor}}}},We=nt=>{const{componentCls:Gt,motion:mn,trackPadding:on,handleBg:sn,handleShadow:jt,handleSize:Ke}=nt,xe=`${Gt}-handle`;return{[Gt]:{[xe]:{position:"absolute",top:on,insetInlineStart:on,width:Ke,height:Ke,transition:`all ${nt.switchDuration} ease-in-out`,"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,backgroundColor:sn,borderRadius:Ke/2,boxShadow:jt,transition:`all ${nt.switchDuration} ease-in-out`,content:'""'}},[`&${Gt}-checked ${xe}`]:{insetInlineStart:`calc(100% - ${Ke+on}px)`},[`&:not(${Gt}-disabled):active`]:mn?{[`${xe}::before`]:{insetInlineEnd:nt.switchHandleActiveInset,insetInlineStart:0},[`&${Gt}-checked ${xe}::before`]:{insetInlineEnd:0,insetInlineStart:nt.switchHandleActiveInset}}:{}}}},et=nt=>{const{componentCls:Gt,trackHeight:mn,trackPadding:on,innerMinMargin:sn,innerMaxMargin:jt,handleSize:Ke}=nt,xe=`${Gt}-inner`;return{[Gt]:{[xe]:{display:"block",overflow:"hidden",borderRadius:100,height:"100%",paddingInlineStart:jt,paddingInlineEnd:sn,transition:`padding-inline-start ${nt.switchDuration} ease-in-out, padding-inline-end ${nt.switchDuration} ease-in-out`,[`${xe}-checked, ${xe}-unchecked`]:{display:"block",color:nt.colorTextLightSolid,fontSize:nt.fontSizeSM,transition:`margin-inline-start ${nt.switchDuration} ease-in-out, margin-inline-end ${nt.switchDuration} ease-in-out`,pointerEvents:"none"},[`${xe}-checked`]:{marginInlineStart:`calc(-100% + ${Ke+on*2}px - ${jt*2}px)`,marginInlineEnd:`calc(100% - ${Ke+on*2}px + ${jt*2}px)`},[`${xe}-unchecked`]:{marginTop:-mn,marginInlineStart:0,marginInlineEnd:0}},[`&${Gt}-checked ${xe}`]:{paddingInlineStart:sn,paddingInlineEnd:jt,[`${xe}-checked`]:{marginInlineStart:0,marginInlineEnd:0},[`${xe}-unchecked`]:{marginInlineStart:`calc(100% - ${Ke+on*2}px + ${jt*2}px)`,marginInlineEnd:`calc(-100% + ${Ke+on*2}px - ${jt*2}px)`}},[`&:not(${Gt}-disabled):active`]:{[`&:not(${Gt}-checked) ${xe}`]:{[`${xe}-unchecked`]:{marginInlineStart:on*2,marginInlineEnd:-on*2}},[`&${Gt}-checked ${xe}`]:{[`${xe}-checked`]:{marginInlineStart:-on*2,marginInlineEnd:on*2}}}}}},Mt=nt=>{const{componentCls:Gt,trackHeight:mn,trackMinWidth:on}=nt;return{[Gt]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,qt.Wf)(nt)),{position:"relative",display:"inline-block",boxSizing:"border-box",minWidth:on,height:mn,lineHeight:`${mn}px`,verticalAlign:"middle",background:nt.colorTextQuaternary,border:"0",borderRadius:100,cursor:"pointer",transition:`all ${nt.motionDurationMid}`,userSelect:"none",[`&:hover:not(${Gt}-disabled)`]:{background:nt.colorTextTertiary}}),(0,qt.Qy)(nt)),{[`&${Gt}-checked`]:{background:nt.switchColor,[`&:hover:not(${Gt}-disabled)`]:{background:nt.colorPrimaryHover}},[`&${Gt}-loading, &${Gt}-disabled`]:{cursor:"not-allowed",opacity:nt.switchDisabledOpacity,"*":{boxShadow:"none",cursor:"not-allowed"}},[`&${Gt}-rtl`]:{direction:"rtl"}})}};var Qe=(0,at.Z)("Switch",nt=>{const Gt=(0,ft.TS)(nt,{switchDuration:nt.motionDurationMid,switchColor:nt.colorPrimary,switchDisabledOpacity:nt.opacityLoading,switchLoadingIconSize:nt.fontSizeIcon*.75,switchLoadingIconColor:`rgba(0, 0, 0, ${nt.opacityLoading})`,switchHandleActiveInset:"-30%"});return[Mt(Gt),et(Gt),We(Gt),_e(Gt),Ve(Gt)]},nt=>{const{fontSize:Gt,lineHeight:mn,controlHeight:on,colorWhite:sn}=nt,jt=Gt*mn,Ke=on/2,xe=2,bt=jt-xe*2,fn=Ke-xe*2;return{trackHeight:jt,trackHeightSM:Ke,trackMinWidth:bt*2+xe*4,trackMinWidthSM:fn*2+xe*2,trackPadding:xe,handleBg:sn,handleSize:bt,handleSizeSM:fn,handleShadow:`0 2px 4px 0 ${new Rt.C("#00230b").setAlpha(.2).toRgbString()}`,innerMinMargin:bt/2,innerMaxMargin:bt+xe+xe*2,innerMinMarginSM:fn/2,innerMaxMarginSM:fn+xe+xe*2}}),Kt=function(nt,Gt){var mn={};for(var on in nt)Object.prototype.hasOwnProperty.call(nt,on)&&Gt.indexOf(on)<0&&(mn[on]=nt[on]);if(nt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var sn=0,on=Object.getOwnPropertySymbols(nt);sn<on.length;sn++)Gt.indexOf(on[sn])<0&&Object.prototype.propertyIsEnumerable.call(nt,on[sn])&&(mn[on[sn]]=nt[on[sn]]);return mn};const ut=Se.forwardRef((nt,Gt)=>{const{prefixCls:mn,size:on,disabled:sn,loading:jt,className:Ke,rootClassName:xe,style:bt}=nt,fn=Kt(nt,["prefixCls","size","disabled","loading","className","rootClassName","style"]),{getPrefixCls:Xt,direction:qe,switch:je}=Se.useContext(Je.E_),gt=Se.useContext(lt.Z),en=(sn!=null?sn:gt)||jt,Zt=Xt("switch",mn),pn=Se.createElement("div",{className:`${Zt}-handle`},jt&&Se.createElement(fe.Z,{className:`${Zt}-loading-icon`})),[Vt,Ft]=Qe(Zt),Tt=(0,st.Z)(on),ge=Fe()(je==null?void 0:je.className,{[`${Zt}-small`]:Tt==="small",[`${Zt}-loading`]:jt,[`${Zt}-rtl`]:qe==="rtl"},Ke,xe,Ft),se=Object.assign(Object.assign({},je==null?void 0:je.style),bt);return Vt(Se.createElement(ht.Z,{component:"Switch"},Se.createElement(He,Object.assign({},fn,{prefixCls:Zt,className:ge,style:se,disabled:en,ref:Gt,loadingIcon:pn}))))});ut.__ANT_SWITCH=!0;var Pt=ut},99313:function(Mn,Qt,ue){"use strict";ue.d(Qt,{default:function(){return ct}});var fe=ue(99267),Ze=ue(18785),Fe=ue(62772),tt=ue(92310),be=ue.n(tt),Le=ue(54476),Re=ue(20068),Se=ue(33885),Me=ue(42978),Pe=ue(76190),rt=ue(75931),Te=ue(59301),He=ue(49658),ht=ue(18929),Je=ue(77900),lt=(0,Te.createContext)(null),st=Te.forwardRef(function(ke,Be){var Ae=ke.prefixCls,Ie=ke.className,Xe=ke.style,dt=ke.id,Ht=ke.active,kt=ke.tabKey,Wt=ke.children;return Te.createElement("div",{id:dt&&"".concat(dt,"-panel-").concat(kt),role:"tabpanel",tabIndex:Ht?0:-1,"aria-labelledby":dt&&"".concat(dt,"-tab-").concat(kt),"aria-hidden":!Ht,style:Xe,className:be()(Ae,Ht&&"".concat(Ae,"-active"),Ie),ref:Be},Wt)}),Rt=st,qt=["key","forceRender","style","className"];function at(ke){var Be=ke.id,Ae=ke.activeKey,Ie=ke.animated,Xe=ke.tabPosition,dt=ke.destroyInactiveTabPane,Ht=Te.useContext(lt),kt=Ht.prefixCls,Wt=Ht.tabs,vn=Ie.tabPane,xn="".concat(kt,"-tabpane");return Te.createElement("div",{className:be()("".concat(kt,"-content-holder"))},Te.createElement("div",{className:be()("".concat(kt,"-content"),"".concat(kt,"-content-").concat(Xe),(0,Re.Z)({},"".concat(kt,"-content-animated"),vn))},Wt.map(function(Cn){var Lt=Cn.key,ln=Cn.forceRender,it=Cn.style,wt=Cn.className,Et=(0,rt.Z)(Cn,qt),At=Lt===Ae;return Te.createElement(Je.default,(0,Le.Z)({key:Lt,visible:At,forceRender:ln,removeOnLeave:!!dt,leavedClassName:"".concat(xn,"-hidden")},Ie.tabPaneMotion),function(nn,_t){var tn=nn.style,Oe=nn.className;return Te.createElement(Rt,(0,Le.Z)({},Et,{prefixCls:xn,id:Be,tabKey:Lt,animated:vn,active:At,style:(0,Se.Z)((0,Se.Z)({},it),tn),className:be()(wt,Oe),ref:_t}))})})))}var ft=ue(94480),Ve=ue(29301),_e=ue(6089),We=ue(8654),et={width:0,height:0,left:0,top:0};function Mt(ke,Be,Ae){return(0,Te.useMemo)(function(){for(var Ie,Xe=new Map,dt=Be.get((Ie=ke[0])===null||Ie===void 0?void 0:Ie.key)||et,Ht=dt.left+dt.width,kt=0;kt<ke.length;kt+=1){var Wt=ke[kt].key,vn=Be.get(Wt);if(!vn){var xn;vn=Be.get((xn=ke[kt-1])===null||xn===void 0?void 0:xn.key)||et}var Cn=Xe.get(Wt)||(0,Se.Z)({},vn);Cn.right=Ht-Cn.left-Cn.width,Xe.set(Wt,Cn)}return Xe},[ke.map(function(Ie){return Ie.key}).join("_"),Be,Ae])}function Qe(ke,Be){var Ae=Te.useRef(ke),Ie=Te.useState({}),Xe=(0,Me.Z)(Ie,2),dt=Xe[1];function Ht(kt){var Wt=typeof kt=="function"?kt(Ae.current):kt;Wt!==Ae.current&&Be(Wt,Ae.current),Ae.current=Wt,dt({})}return[Ae.current,Ht]}var Kt=.1,ut=.01,Pt=20,nt=Math.pow(.995,Pt);function Gt(ke,Be){var Ae=(0,Te.useState)(),Ie=(0,Me.Z)(Ae,2),Xe=Ie[0],dt=Ie[1],Ht=(0,Te.useState)(0),kt=(0,Me.Z)(Ht,2),Wt=kt[0],vn=kt[1],xn=(0,Te.useState)(0),Cn=(0,Me.Z)(xn,2),Lt=Cn[0],ln=Cn[1],it=(0,Te.useState)(),wt=(0,Me.Z)(it,2),Et=wt[0],At=wt[1],nn=(0,Te.useRef)();function _t(Dt){var Nt=Dt.touches[0],zt=Nt.screenX,gn=Nt.screenY;dt({x:zt,y:gn}),window.clearInterval(nn.current)}function tn(Dt){if(Xe){Dt.preventDefault();var Nt=Dt.touches[0],zt=Nt.screenX,gn=Nt.screenY;dt({x:zt,y:gn});var wn=zt-Xe.x,Dn=gn-Xe.y;Be(wn,Dn);var zn=Date.now();vn(zn),ln(zn-Wt),At({x:wn,y:Dn})}}function Oe(){if(Xe&&(dt(null),At(null),Et)){var Dt=Et.x/Lt,Nt=Et.y/Lt,zt=Math.abs(Dt),gn=Math.abs(Nt);if(Math.max(zt,gn)<Kt)return;var wn=Dt,Dn=Nt;nn.current=window.setInterval(function(){if(Math.abs(wn)<ut&&Math.abs(Dn)<ut){window.clearInterval(nn.current);return}wn*=nt,Dn*=nt,Be(wn*Pt,Dn*Pt)},Pt)}}var yt=(0,Te.useRef)();function xt(Dt){var Nt=Dt.deltaX,zt=Dt.deltaY,gn=0,wn=Math.abs(Nt),Dn=Math.abs(zt);wn===Dn?gn=yt.current==="x"?Nt:zt:wn>Dn?(gn=Nt,yt.current="x"):(gn=zt,yt.current="y"),Be(-gn,-gn)&&Dt.preventDefault()}var Ot=(0,Te.useRef)(null);Ot.current={onTouchStart:_t,onTouchMove:tn,onTouchEnd:Oe,onWheel:xt},Te.useEffect(function(){function Dt(wn){Ot.current.onTouchStart(wn)}function Nt(wn){Ot.current.onTouchMove(wn)}function zt(wn){Ot.current.onTouchEnd(wn)}function gn(wn){Ot.current.onWheel(wn)}return document.addEventListener("touchmove",Nt,{passive:!1}),document.addEventListener("touchend",zt,{passive:!1}),ke.current.addEventListener("touchstart",Dt,{passive:!1}),ke.current.addEventListener("wheel",gn),function(){document.removeEventListener("touchmove",Nt),document.removeEventListener("touchend",zt)}},[])}var mn=ue(34280);function on(ke){var Be=(0,Te.useState)(0),Ae=(0,Me.Z)(Be,2),Ie=Ae[0],Xe=Ae[1],dt=(0,Te.useRef)(0),Ht=(0,Te.useRef)();return Ht.current=ke,(0,mn.o)(function(){var kt;(kt=Ht.current)===null||kt===void 0||kt.call(Ht)},[Ie]),function(){dt.current===Ie&&(dt.current+=1,Xe(dt.current))}}function sn(ke){var Be=(0,Te.useRef)([]),Ae=(0,Te.useState)({}),Ie=(0,Me.Z)(Ae,2),Xe=Ie[1],dt=(0,Te.useRef)(typeof ke=="function"?ke():ke),Ht=on(function(){var Wt=dt.current;Be.current.forEach(function(vn){Wt=vn(Wt)}),Be.current=[],dt.current=Wt,Xe({})});function kt(Wt){Be.current.push(Wt),Ht()}return[dt.current,kt]}var jt={width:0,height:0,left:0,top:0,right:0};function Ke(ke,Be,Ae,Ie,Xe,dt,Ht){var kt=Ht.tabs,Wt=Ht.tabPosition,vn=Ht.rtl,xn,Cn,Lt;return["top","bottom"].includes(Wt)?(xn="width",Cn=vn?"right":"left",Lt=Math.abs(Ae)):(xn="height",Cn="top",Lt=-Ae),(0,Te.useMemo)(function(){if(!kt.length)return[0,0];for(var ln=kt.length,it=ln,wt=0;wt<ln;wt+=1){var Et=ke.get(kt[wt].key)||jt;if(Et[Cn]+Et[xn]>Lt+Be){it=wt-1;break}}for(var At=0,nn=ln-1;nn>=0;nn-=1){var _t=ke.get(kt[nn].key)||jt;if(_t[Cn]<Lt){At=nn+1;break}}return At>=it?[0,0]:[At,it]},[ke,Be,Ie,Xe,dt,Lt,Wt,kt.map(function(ln){return ln.key}).join("_"),vn])}function xe(ke){var Be;return ke instanceof Map?(Be={},ke.forEach(function(Ae,Ie){Be[Ie]=Ae})):Be=ke,JSON.stringify(Be)}var bt="TABS_DQ";function fn(ke){return String(ke).replace(/"/g,bt)}function Xt(ke,Be,Ae,Ie){return!(!Ae||Ie||ke===!1||ke===void 0&&(Be===!1||Be===null))}function qe(ke,Be){var Ae=ke.prefixCls,Ie=ke.editable,Xe=ke.locale,dt=ke.style;return!Ie||Ie.showAdd===!1?null:Te.createElement("button",{ref:Be,type:"button",className:"".concat(Ae,"-nav-add"),style:dt,"aria-label":(Xe==null?void 0:Xe.addAriaLabel)||"Add tab",onClick:function(kt){Ie.onEdit("add",{event:kt})}},Ie.addIcon||"+")}var je=Te.forwardRef(qe),gt=Te.forwardRef(function(ke,Be){var Ae=ke.position,Ie=ke.prefixCls,Xe=ke.extra;if(!Xe)return null;var dt,Ht={};return(0,Pe.Z)(Xe)==="object"&&!Te.isValidElement(Xe)?Ht=Xe:Ht.right=Xe,Ae==="right"&&(dt=Ht.right),Ae==="left"&&(dt=Ht.left),dt?Te.createElement("div",{className:"".concat(Ie,"-extra-content"),ref:Be},dt):null}),en=gt,Zt=ue(31561),pn=ue(15285),Vt=ue(10228);function Ft(ke,Be){var Ae=ke.prefixCls,Ie=ke.id,Xe=ke.tabs,dt=ke.locale,Ht=ke.mobile,kt=ke.moreIcon,Wt=kt===void 0?"More":kt,vn=ke.moreTransitionName,xn=ke.style,Cn=ke.className,Lt=ke.editable,ln=ke.tabBarGutter,it=ke.rtl,wt=ke.removeAriaLabel,Et=ke.onTabClick,At=ke.getPopupContainer,nn=ke.popupClassName,_t=(0,Te.useState)(!1),tn=(0,Me.Z)(_t,2),Oe=tn[0],yt=tn[1],xt=(0,Te.useState)(null),Ot=(0,Me.Z)(xt,2),Dt=Ot[0],Nt=Ot[1],zt="".concat(Ie,"-more-popup"),gn="".concat(Ae,"-dropdown"),wn=Dt!==null?"".concat(zt,"-").concat(Dt):null,Dn=dt==null?void 0:dt.dropdownAriaLabel;function zn(yr,Gn){yr.preventDefault(),yr.stopPropagation(),Lt.onEdit("remove",{key:Gn,event:yr})}var er=Te.createElement(pn.ZP,{onClick:function(Gn){var Xn=Gn.key,br=Gn.domEvent;Et(Xn,br),yt(!1)},prefixCls:"".concat(gn,"-menu"),id:zt,tabIndex:-1,role:"listbox","aria-activedescendant":wn,selectedKeys:[Dt],"aria-label":Dn!==void 0?Dn:"expanded dropdown"},Xe.map(function(yr){var Gn=yr.closable,Xn=yr.disabled,br=yr.closeIcon,ur=yr.key,Br=yr.label,Gr=Xt(Gn,br,Lt,Xn);return Te.createElement(pn.sN,{key:ur,id:"".concat(zt,"-").concat(ur),role:"option","aria-controls":Ie&&"".concat(Ie,"-panel-").concat(ur),disabled:Xn},Te.createElement("span",null,Br),Gr&&Te.createElement("button",{type:"button","aria-label":wt||"remove",tabIndex:0,className:"".concat(gn,"-menu-item-remove"),onClick:function(En){En.stopPropagation(),zn(En,ur)}},br||Lt.removeIcon||"\xD7"))}));function cr(yr){for(var Gn=Xe.filter(function(Gr){return!Gr.disabled}),Xn=Gn.findIndex(function(Gr){return Gr.key===Dt})||0,br=Gn.length,ur=0;ur<br;ur+=1){Xn=(Xn+yr+br)%br;var Br=Gn[Xn];if(!Br.disabled){Nt(Br.key);return}}}function Un(yr){var Gn=yr.which;if(!Oe){[Vt.Z.DOWN,Vt.Z.SPACE,Vt.Z.ENTER].includes(Gn)&&(yt(!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:yt(!1);break;case Vt.Z.SPACE:case Vt.Z.ENTER:Dt!==null&&Et(Dt,yr);break}}(0,Te.useEffect)(function(){var yr=document.getElementById(wn);yr&&yr.scrollIntoView&&yr.scrollIntoView(!1)},[Dt]),(0,Te.useEffect)(function(){Oe||Nt(null)},[Oe]);var Pn=(0,Re.Z)({},it?"marginRight":"marginLeft",ln);Xe.length||(Pn.visibility="hidden",Pn.order=1);var fr=be()((0,Re.Z)({},"".concat(gn,"-rtl"),it)),tr=Ht?null:Te.createElement(Zt.Z,{prefixCls:gn,overlay:er,trigger:["hover"],visible:Xe.length?Oe:!1,transitionName:vn,onVisibleChange:yt,overlayClassName:be()(fr,nn),mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:At},Te.createElement("button",{type:"button",className:"".concat(Ae,"-nav-more"),style:Pn,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":zt,id:"".concat(Ie,"-more"),"aria-expanded":Oe,onKeyDown:Un},Wt));return Te.createElement("div",{className:be()("".concat(Ae,"-nav-operations"),Cn),style:xn,ref:Be},tr,Te.createElement(je,{prefixCls:Ae,locale:dt,editable:Lt}))}var Tt=Te.memo(Te.forwardRef(Ft),function(ke,Be){return Be.tabMoving});function ge(ke){var Be,Ae=ke.prefixCls,Ie=ke.id,Xe=ke.active,dt=ke.tab,Ht=dt.key,kt=dt.label,Wt=dt.disabled,vn=dt.closeIcon,xn=ke.closable,Cn=ke.renderWrapper,Lt=ke.removeAriaLabel,ln=ke.editable,it=ke.onClick,wt=ke.onFocus,Et=ke.style,At="".concat(Ae,"-tab"),nn=Xt(xn,vn,ln,Wt);function _t(yt){Wt||it(yt)}function tn(yt){yt.preventDefault(),yt.stopPropagation(),ln.onEdit("remove",{key:Ht,event:yt})}var Oe=Te.createElement("div",{key:Ht,"data-node-key":fn(Ht),className:be()(At,(Be={},(0,Re.Z)(Be,"".concat(At,"-with-remove"),nn),(0,Re.Z)(Be,"".concat(At,"-active"),Xe),(0,Re.Z)(Be,"".concat(At,"-disabled"),Wt),Be)),style:Et,onClick:_t},Te.createElement("div",{role:"tab","aria-selected":Xe,id:Ie&&"".concat(Ie,"-tab-").concat(Ht),className:"".concat(At,"-btn"),"aria-controls":Ie&&"".concat(Ie,"-panel-").concat(Ht),"aria-disabled":Wt,tabIndex:Wt?null:0,onClick:function(xt){xt.stopPropagation(),_t(xt)},onKeyDown:function(xt){[Vt.Z.SPACE,Vt.Z.ENTER].includes(xt.which)&&(xt.preventDefault(),_t(xt))},onFocus:wt},kt),nn&&Te.createElement("button",{type:"button","aria-label":Lt||"remove",tabIndex:0,className:"".concat(At,"-remove"),onClick:function(xt){xt.stopPropagation(),tn(xt)}},vn||ln.removeIcon||"\xD7"));return Cn?Cn(Oe):Oe}var se=ge,oe=ue(16089),de=function(Be){var Ae=Be.activeTabOffset,Ie=Be.horizontal,Xe=Be.rtl,dt=Be.indicatorSize,Ht=(0,Te.useState)(),kt=(0,Me.Z)(Ht,2),Wt=kt[0],vn=kt[1],xn=(0,Te.useRef)(),Cn=function(it){return typeof dt=="function"?dt(it):typeof dt=="number"?dt:it};function Lt(){oe.Z.cancel(xn.current)}return(0,Te.useEffect)(function(){var ln={};return Ae&&(Ie?(Xe?(ln.right=Ae.right+Ae.width/2,ln.transform="translateX(50%)"):(ln.left=Ae.left+Ae.width/2,ln.transform="translateX(-50%)"),ln.width=Cn(Ae.width)):(ln.top=Ae.top+Ae.height/2,ln.transform="translateY(-50%)",ln.height=Cn(Ae.height))),Lt(),xn.current=(0,oe.Z)(function(){vn(ln)}),Lt},[Ae,Ie,Xe,dt]),{style:Wt}},pe=de,le=function(Be){var Ae=Be.current||{},Ie=Ae.offsetWidth,Xe=Ie===void 0?0:Ie,dt=Ae.offsetHeight,Ht=dt===void 0?0:dt;return[Xe,Ht]},De=function(Be,Ae){return Be[Ae?0:1]};function ot(ke,Be){var Ae,Ie=Te.useContext(lt),Xe=Ie.prefixCls,dt=Ie.tabs,Ht=ke.className,kt=ke.style,Wt=ke.id,vn=ke.animated,xn=ke.activeKey,Cn=ke.rtl,Lt=ke.extra,ln=ke.editable,it=ke.locale,wt=ke.tabPosition,Et=ke.tabBarGutter,At=ke.children,nn=ke.onTabClick,_t=ke.onTabScroll,tn=ke.indicatorSize,Oe=(0,Te.useRef)(),yt=(0,Te.useRef)(),xt=(0,Te.useRef)(),Ot=(0,Te.useRef)(),Dt=(0,Te.useRef)(),Nt=(0,Te.useRef)(),zt=(0,Te.useRef)(),gn=wt==="top"||wt==="bottom",wn=Qe(0,function(wi,vi){gn&&_t&&_t({direction:wi>vi?"left":"right"})}),Dn=(0,Me.Z)(wn,2),zn=Dn[0],er=Dn[1],cr=Qe(0,function(wi,vi){!gn&&_t&&_t({direction:wi>vi?"top":"bottom"})}),Un=(0,Me.Z)(cr,2),Pn=Un[0],fr=Un[1],tr=(0,Te.useState)([0,0]),yr=(0,Me.Z)(tr,2),Gn=yr[0],Xn=yr[1],br=(0,Te.useState)([0,0]),ur=(0,Me.Z)(br,2),Br=ur[0],Gr=ur[1],ar=(0,Te.useState)([0,0]),En=(0,Me.Z)(ar,2),kn=En[0],gr=En[1],nr=(0,Te.useState)([0,0]),_r=(0,Me.Z)(nr,2),Lr=_r[0],Ir=_r[1],pr=sn(new Map),Sr=(0,Me.Z)(pr,2),ii=Sr[0],Hn=Sr[1],qn=Mt(dt,ii,Br[0]),Dr=De(Gn,gn),$r=De(Br,gn),li=De(kn,gn),di=De(Lr,gn),ri=Dr<$r+li,Jr=ri?Dr-di:Dr-li,yi="".concat(Xe,"-nav-operations-hidden"),bi=0,Yn=0;gn&&Cn?(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,Te.useRef)(),mr=(0,Te.useState)(),ni=(0,Me.Z)(mr,2),xi=ni[0],Mi=ni[1];function gi(){Mi(Date.now())}function ci(){window.clearTimeout(Zn.current)}Gt(Ot,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,Te.useEffect)(function(){return ci(),xi&&(Zn.current=window.setTimeout(function(){Mi(0)},100)),ci},[xi]);var ki=Ke(qn,Jr,gn?zn:Pn,$r,li,di,(0,Se.Z)((0,Se.Z)({},ke),{},{tabs:dt})),Hi=(0,Me.Z)(ki,2),Ni=Hi[0],oa=Hi[1],Xr=(0,_e.Z)(function(){var wi=arguments.length>0&&arguments[0]!==void 0?arguments[0]:xn,vi=qn.get(wi)||{width:0,height:0,left:0,right:0,top:0};if(gn){var Gi=zn;Cn?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=Pn;vi.top<-Pn?ca=-vi.top:vi.top+vi.height>-Pn+Jr&&(ca=-(vi.top+vi.height-Jr)),er(0),fr(Vn(ca))}}),ei={};wt==="top"||wt==="bottom"?ei[Cn?"marginRight":"marginLeft"]=Et:ei.marginTop=Et;var Ai=dt.map(function(wi,vi){var Gi=wi.key;return Te.createElement(se,{id:Wt,prefixCls:Xe,key:Gi,tab:wi,style:vi===0?void 0:ei,closable:wi.closable,editable:ln,active:Gi===xn,renderWrapper:At,removeAriaLabel:it==null?void 0:it.removeAriaLabel,onClick:function(sa){nn(Gi,sa)},onFocus:function(){Xr(Gi),gi(),Ot.current&&(Cn||(Ot.current.scrollLeft=0),Ot.current.scrollTop=0)}})}),ai=function(){return Hn(function(){var vi=new Map;return dt.forEach(function(Gi){var ca,sa=Gi.key,ta=(ca=Dt.current)===null||ca===void 0?void 0:ca.querySelector('[data-node-key="'.concat(fn(sa),'"]'));ta&&vi.set(sa,{width:ta.offsetWidth,height:ta.offsetHeight,left:ta.offsetLeft,top:ta.offsetTop})}),vi})};(0,Te.useEffect)(function(){ai()},[dt.map(function(wi){return wi.key}).join("_")]);var fi=on(function(){var wi=le(Oe),vi=le(yt),Gi=le(xt);Xn([wi[0]-vi[0]-Gi[0],wi[1]-vi[1]-Gi[1]]);var ca=le(zt);gr(ca);var sa=le(Nt);Ir(sa);var ta=le(Dt);Gr([ta[0]-ca[0],ta[1]-ca[1]]),ai()}),_i=dt.slice(0,Ni),pi=dt.slice(oa+1),Pr=[].concat((0,ft.Z)(_i),(0,ft.Z)(pi)),Yr=qn.get(xn),Ur=pe({activeTabOffset:Yr,horizontal:gn,rtl:Cn,indicatorSize:tn}),zr=Ur.style;(0,Te.useEffect)(function(){Xr()},[xn,bi,Yn,xe(Yr),xe(qn),gn]),(0,Te.useEffect)(function(){fi()},[Cn]);var ui=!!Pr.length,oi="".concat(Xe,"-nav-wrap"),zi,Wi,Zi,na;return gn?Cn?(Wi=zn>0,zi=zn!==Yn):(zi=zn<0,Wi=zn!==bi):(Zi=Pn<0,na=Pn!==bi),Te.createElement(Ve.Z,{onResize:fi},Te.createElement("div",{ref:(0,We.x1)(Be,Oe),role:"tablist",className:be()("".concat(Xe,"-nav"),Ht),style:kt,onKeyDown:function(){gi()}},Te.createElement(en,{ref:yt,position:"left",extra:Lt,prefixCls:Xe}),Te.createElement(Ve.Z,{onResize:fi},Te.createElement("div",{className:be()(oi,(Ae={},(0,Re.Z)(Ae,"".concat(oi,"-ping-left"),zi),(0,Re.Z)(Ae,"".concat(oi,"-ping-right"),Wi),(0,Re.Z)(Ae,"".concat(oi,"-ping-top"),Zi),(0,Re.Z)(Ae,"".concat(oi,"-ping-bottom"),na),Ae)),ref:Ot},Te.createElement(Ve.Z,{onResize:fi},Te.createElement("div",{ref:Dt,className:"".concat(Xe,"-nav-list"),style:{transform:"translate(".concat(zn,"px, ").concat(Pn,"px)"),transition:xi?"none":void 0}},Ai,Te.createElement(je,{ref:zt,prefixCls:Xe,locale:it,editable:ln,style:(0,Se.Z)((0,Se.Z)({},Ai.length===0?void 0:ei),{},{visibility:ui?"hidden":null})}),Te.createElement("div",{className:be()("".concat(Xe,"-ink-bar"),(0,Re.Z)({},"".concat(Xe,"-ink-bar-animated"),vn.inkBar)),style:zr}))))),Te.createElement(Tt,(0,Le.Z)({},ke,{removeAriaLabel:it==null?void 0:it.removeAriaLabel,ref:Nt,prefixCls:Xe,tabs:Pr,className:!ui&&yi,tabMoving:!!xi})),Te.createElement(en,{ref:xt,position:"right",extra:Lt,prefixCls:Xe})))}var $t=Te.forwardRef(ot),It=["renderTabBar"],Ut=["label","key"];function Yt(ke){var Be=ke.renderTabBar,Ae=(0,rt.Z)(ke,It),Ie=Te.useContext(lt),Xe=Ie.tabs;if(Be){var dt=(0,Se.Z)((0,Se.Z)({},Ae),{},{panes:Xe.map(function(Ht){var kt=Ht.label,Wt=Ht.key,vn=(0,rt.Z)(Ht,Ut);return Te.createElement(Rt,(0,Le.Z)({tab:kt,key:Wt,tabKey:Wt},vn))})});return Be(dt,$t)}return Te.createElement($t,Ae)}var dn=ue(48736);function hn(){var ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{inkBar:!0,tabPane:!1},Be;return ke===!1?Be={inkBar:!1,tabPane:!1}:ke===!0?Be={inkBar:!0,tabPane:!1}:Be=(0,Se.Z)({inkBar:!0},(0,Pe.Z)(ke)==="object"?ke:{}),Be.tabPaneMotion&&Be.tabPane===void 0&&(Be.tabPane=!0),!Be.tabPaneMotion&&Be.tabPane&&(Be.tabPane=!1),Be}var _n=["id","prefixCls","className","items","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll","getPopupContainer","popupClassName","indicatorSize"],vt=0;function cn(ke,Be){var Ae,Ie=ke.id,Xe=ke.prefixCls,dt=Xe===void 0?"rc-tabs":Xe,Ht=ke.className,kt=ke.items,Wt=ke.direction,vn=ke.activeKey,xn=ke.defaultActiveKey,Cn=ke.editable,Lt=ke.animated,ln=ke.tabPosition,it=ln===void 0?"top":ln,wt=ke.tabBarGutter,Et=ke.tabBarStyle,At=ke.tabBarExtraContent,nn=ke.locale,_t=ke.moreIcon,tn=ke.moreTransitionName,Oe=ke.destroyInactiveTabPane,yt=ke.renderTabBar,xt=ke.onChange,Ot=ke.onTabClick,Dt=ke.onTabScroll,Nt=ke.getPopupContainer,zt=ke.popupClassName,gn=ke.indicatorSize,wn=(0,rt.Z)(ke,_n),Dn=Te.useMemo(function(){return(kt||[]).filter(function(Ir){return Ir&&(0,Pe.Z)(Ir)==="object"&&"key"in Ir})},[kt]),zn=Wt==="rtl",er=hn(Lt),cr=(0,Te.useState)(!1),Un=(0,Me.Z)(cr,2),Pn=Un[0],fr=Un[1];(0,Te.useEffect)(function(){fr((0,He.Z)())},[]);var tr=(0,ht.Z)(function(){var Ir;return(Ir=Dn[0])===null||Ir===void 0?void 0:Ir.key},{value:vn,defaultValue:xn}),yr=(0,Me.Z)(tr,2),Gn=yr[0],Xn=yr[1],br=(0,Te.useState)(function(){return Dn.findIndex(function(Ir){return Ir.key===Gn})}),ur=(0,Me.Z)(br,2),Br=ur[0],Gr=ur[1];(0,Te.useEffect)(function(){var Ir=Dn.findIndex(function(Sr){return Sr.key===Gn});if(Ir===-1){var pr;Ir=Math.max(0,Math.min(Br,Dn.length-1)),Xn((pr=Dn[Ir])===null||pr===void 0?void 0:pr.key)}Gr(Ir)},[Dn.map(function(Ir){return Ir.key}).join("_"),Gn,Br]);var ar=(0,ht.Z)(null,{value:Ie}),En=(0,Me.Z)(ar,2),kn=En[0],gr=En[1];(0,Te.useEffect)(function(){Ie||(gr("rc-tabs-".concat(vt)),vt+=1)},[]);function nr(Ir,pr){Ot==null||Ot(Ir,pr);var Sr=Ir!==Gn;Xn(Ir),Sr&&(xt==null||xt(Ir))}var _r={id:kn,activeKey:Gn,animated:er,tabPosition:it,rtl:zn,mobile:Pn},Lr=(0,Se.Z)((0,Se.Z)({},_r),{},{editable:Cn,locale:nn,moreIcon:_t,moreTransitionName:tn,tabBarGutter:wt,onTabClick:nr,onTabScroll:Dt,extra:At,style:Et,panes:null,getPopupContainer:Nt,popupClassName:zt,indicatorSize:gn});return Te.createElement(lt.Provider,{value:{tabs:Dn,prefixCls:dt}},Te.createElement("div",(0,Le.Z)({ref:Be,id:Ie,className:be()(dt,"".concat(dt,"-").concat(it),(Ae={},(0,Re.Z)(Ae,"".concat(dt,"-mobile"),Pn),(0,Re.Z)(Ae,"".concat(dt,"-editable"),Cn),(0,Re.Z)(Ae,"".concat(dt,"-rtl"),zn),Ae),Ht)},wn),Te.createElement(Yt,(0,Le.Z)({},Lr,{renderTabBar:yt})),Te.createElement(at,(0,Le.Z)({destroyInactiveTabPane:Oe},_r,{animated:er}))))}var Sn=Te.forwardRef(cn),Ye=Sn,ze=Ye,Ue=ue(36355),Bt=ue(19716),rn=()=>null,An=ue(62892);const In={motionAppear:!1,motionEnter:!0,motionLeave:!0};function Ln(ke){let Be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inkBar:!0,tabPane:!1},Ae;return Be===!1?Ae={inkBar:!1,tabPane:!1}:Be===!0?Ae={inkBar:!0,tabPane:!0}:Ae=Object.assign({inkBar:!0},typeof Be=="object"?Be:{}),Ae.tabPane&&(Ae.tabPaneMotion=Object.assign(Object.assign({},In),{motionName:(0,An.m)(ke,"switch")})),Ae}var Fn=ue(11592),jn=function(ke,Be){var Ae={};for(var Ie in ke)Object.prototype.hasOwnProperty.call(ke,Ie)&&Be.indexOf(Ie)<0&&(Ae[Ie]=ke[Ie]);if(ke!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Xe=0,Ie=Object.getOwnPropertySymbols(ke);Xe<Ie.length;Xe++)Be.indexOf(Ie[Xe])<0&&Object.prototype.propertyIsEnumerable.call(ke,Ie[Xe])&&(Ae[Ie[Xe]]=ke[Ie[Xe]]);return Ae};function Tn(ke){return ke.filter(Be=>Be)}function hr(ke,Be){if(ke)return ke;const Ae=(0,Fn.Z)(Be).map(Ie=>{if(Te.isValidElement(Ie)){const{key:Xe,props:dt}=Ie,Ht=dt||{},{tab:kt}=Ht,Wt=jn(Ht,["tab"]);return Object.assign(Object.assign({key:String(Xe)},Wt),{label:kt})}return null});return Tn(Ae)}var kr=ue(17313),Tr=ue(83116),Hr=ue(37613),sr=ue(13826),rr=ke=>{const{componentCls:Be,motionDurationSlow:Ae}=ke;return[{[Be]:{[`${Be}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${Ae}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${Ae}`}}}}},[(0,sr.oN)(ke,"slide-up"),(0,sr.oN)(ke,"slide-down")]]};const Or=ke=>{const{componentCls:Be,tabsCardPadding:Ae,cardBg:Ie,cardGutter:Xe,colorBorderSecondary:dt,itemSelectedColor:Ht}=ke;return{[`${Be}-card`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{[`${Be}-tab`]:{margin:0,padding:Ae,background:Ie,border:`${ke.lineWidth}px ${ke.lineType} ${dt}`,transition:`all ${ke.motionDurationSlow} ${ke.motionEaseInOut}`},[`${Be}-tab-active`]:{color:Ht,background:ke.colorBgContainer},[`${Be}-ink-bar`]:{visibility:"hidden"}},[`&${Be}-top, &${Be}-bottom`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{[`${Be}-tab + ${Be}-tab`]:{marginLeft:{_skip_check_:!0,value:`${Xe}px`}}}},[`&${Be}-top`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{[`${Be}-tab`]:{borderRadius:`${ke.borderRadiusLG}px ${ke.borderRadiusLG}px 0 0`},[`${Be}-tab-active`]:{borderBottomColor:ke.colorBgContainer}}},[`&${Be}-bottom`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{[`${Be}-tab`]:{borderRadius:`0 0 ${ke.borderRadiusLG}px ${ke.borderRadiusLG}px`},[`${Be}-tab-active`]:{borderTopColor:ke.colorBgContainer}}},[`&${Be}-left, &${Be}-right`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{[`${Be}-tab + ${Be}-tab`]:{marginTop:`${Xe}px`}}},[`&${Be}-left`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{[`${Be}-tab`]:{borderRadius:{_skip_check_:!0,value:`${ke.borderRadiusLG}px 0 0 ${ke.borderRadiusLG}px`}},[`${Be}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:ke.colorBgContainer}}}},[`&${Be}-right`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{[`${Be}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${ke.borderRadiusLG}px ${ke.borderRadiusLG}px 0`}},[`${Be}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:ke.colorBgContainer}}}}}}},Fr=ke=>{const{componentCls:Be,itemHoverColor:Ae,dropdownEdgeChildVerticalPadding:Ie}=ke;return{[`${Be}-dropdown`]:Object.assign(Object.assign({},(0,kr.Wf)(ke)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:ke.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${Be}-dropdown-menu`]:{maxHeight:ke.tabsDropdownHeight,margin:0,padding:`${Ie}px 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:ke.colorBgContainer,backgroundClip:"padding-box",borderRadius:ke.borderRadiusLG,outline:"none",boxShadow:ke.boxShadowSecondary,"&-item":Object.assign(Object.assign({},kr.vS),{display:"flex",alignItems:"center",minWidth:ke.tabsDropdownWidth,margin:0,padding:`${ke.paddingXXS}px ${ke.paddingSM}px`,color:ke.colorText,fontWeight:"normal",fontSize:ke.fontSize,lineHeight:ke.lineHeight,cursor:"pointer",transition:`all ${ke.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:ke.marginSM},color:ke.colorTextDescription,fontSize:ke.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:Ae}},"&:hover":{background:ke.controlItemBgHover},"&-disabled":{"&, &:hover":{color:ke.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}})}})}},Er=ke=>{const{componentCls:Be,margin:Ae,colorBorderSecondary:Ie,horizontalMargin:Xe,verticalItemPadding:dt,verticalItemMargin:Ht}=ke;return{[`${Be}-top, ${Be}-bottom`]:{flexDirection:"column",[`> ${Be}-nav, > div > ${Be}-nav`]:{margin:Xe,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${ke.lineWidth}px ${ke.lineType} ${Ie}`,content:"''"},[`${Be}-ink-bar`]:{height:ke.lineWidthBold,"&-animated":{transition:`width ${ke.motionDurationSlow}, left ${ke.motionDurationSlow},
right ${ke.motionDurationSlow}`}},[`${Be}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:ke.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:ke.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:ke.boxShadowTabsOverflowRight},[`&${Be}-nav-wrap-ping-left::before`]:{opacity:1},[`&${Be}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${Be}-top`]:{[`> ${Be}-nav,
> div > ${Be}-nav`]:{"&::before":{bottom:0},[`${Be}-ink-bar`]:{bottom:0}}},[`${Be}-bottom`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{order:1,marginTop:`${Ae}px`,marginBottom:0,"&::before":{top:0},[`${Be}-ink-bar`]:{top:0}},[`> ${Be}-content-holder, > div > ${Be}-content-holder`]:{order:0}},[`${Be}-left, ${Be}-right`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{flexDirection:"column",minWidth:ke.controlHeight*1.25,[`${Be}-tab`]:{padding:dt,textAlign:"center"},[`${Be}-tab + ${Be}-tab`]:{margin:Ht},[`${Be}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:ke.controlHeight},"&::before":{top:0,boxShadow:ke.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:ke.boxShadowTabsOverflowBottom},[`&${Be}-nav-wrap-ping-top::before`]:{opacity:1},[`&${Be}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${Be}-ink-bar`]:{width:ke.lineWidthBold,"&-animated":{transition:`height ${ke.motionDurationSlow}, top ${ke.motionDurationSlow}`}},[`${Be}-nav-list, ${Be}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${Be}-left`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{[`${Be}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${Be}-content-holder, > div > ${Be}-content-holder`]:{marginLeft:{_skip_check_:!0,value:`-${ke.lineWidth}px`},borderLeft:{_skip_check_:!0,value:`${ke.lineWidth}px ${ke.lineType} ${ke.colorBorder}`},[`> ${Be}-content > ${Be}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:ke.paddingLG}}}},[`${Be}-right`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{order:1,[`${Be}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${Be}-content-holder, > div > ${Be}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:-ke.lineWidth},borderRight:{_skip_check_:!0,value:`${ke.lineWidth}px ${ke.lineType} ${ke.colorBorder}`},[`> ${Be}-content > ${Be}-tabpane`]:{paddingRight:{_skip_check_:!0,value:ke.paddingLG}}}}}},jr=ke=>{const{componentCls:Be,cardPaddingSM:Ae,cardPaddingLG:Ie,horizontalItemPaddingSM:Xe,horizontalItemPaddingLG:dt}=ke;return{[Be]:{"&-small":{[`> ${Be}-nav`]:{[`${Be}-tab`]:{padding:Xe,fontSize:ke.titleFontSizeSM}}},"&-large":{[`> ${Be}-nav`]:{[`${Be}-tab`]:{padding:dt,fontSize:ke.titleFontSizeLG}}}},[`${Be}-card`]:{[`&${Be}-small`]:{[`> ${Be}-nav`]:{[`${Be}-tab`]:{padding:Ae}},[`&${Be}-bottom`]:{[`> ${Be}-nav ${Be}-tab`]:{borderRadius:`0 0 ${ke.borderRadius}px ${ke.borderRadius}px`}},[`&${Be}-top`]:{[`> ${Be}-nav ${Be}-tab`]:{borderRadius:`${ke.borderRadius}px ${ke.borderRadius}px 0 0`}},[`&${Be}-right`]:{[`> ${Be}-nav ${Be}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${ke.borderRadius}px ${ke.borderRadius}px 0`}}},[`&${Be}-left`]:{[`> ${Be}-nav ${Be}-tab`]:{borderRadius:{_skip_check_:!0,value:`${ke.borderRadius}px 0 0 ${ke.borderRadius}px`}}}},[`&${Be}-large`]:{[`> ${Be}-nav`]:{[`${Be}-tab`]:{padding:Ie}}}}}},Nr=ke=>{const{componentCls:Be,itemActiveColor:Ae,itemHoverColor:Ie,iconCls:Xe,tabsHorizontalItemMargin:dt,horizontalItemPadding:Ht,itemSelectedColor:kt,itemColor:Wt}=ke,vn=`${Be}-tab`;return{[vn]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:Ht,fontSize:ke.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:Wt,"&-btn, &-remove":Object.assign({"&:focus:not(:focus-visible), &:active":{color:Ae}},(0,kr.Qy)(ke)),"&-btn":{outline:"none",transition:"all 0.3s"},"&-remove":{flex:"none",marginRight:{_skip_check_:!0,value:-ke.marginXXS},marginLeft:{_skip_check_:!0,value:ke.marginXS},color:ke.colorTextDescription,fontSize:ke.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${ke.motionDurationSlow}`,"&:hover":{color:ke.colorTextHeading}},"&:hover":{color:Ie},[`&${vn}-active ${vn}-btn`]:{color:kt,textShadow:ke.tabsActiveTextShadow},[`&${vn}-disabled`]:{color:ke.colorTextDisabled,cursor:"not-allowed"},[`&${vn}-disabled ${vn}-btn, &${vn}-disabled ${Be}-remove`]:{"&:focus, &:active":{color:ke.colorTextDisabled}},[`& ${vn}-remove ${Xe}`]:{margin:0},[Xe]:{marginRight:{_skip_check_:!0,value:ke.marginSM}}},[`${vn} + ${vn}`]:{margin:{_skip_check_:!0,value:dt}}}},Jn=ke=>{const{componentCls:Be,tabsHorizontalItemMarginRTL:Ae,iconCls:Ie,cardGutter:Xe}=ke;return{[`${Be}-rtl`]:{direction:"rtl",[`${Be}-nav`]:{[`${Be}-tab`]:{margin:{_skip_check_:!0,value:Ae},[`${Be}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[Ie]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:`${ke.marginSM}px`}},[`${Be}-tab-remove`]:{marginRight:{_skip_check_:!0,value:`${ke.marginXS}px`},marginLeft:{_skip_check_:!0,value:`-${ke.marginXXS}px`},[Ie]:{margin:0}}}},[`&${Be}-left`]:{[`> ${Be}-nav`]:{order:1},[`> ${Be}-content-holder`]:{order:0}},[`&${Be}-right`]:{[`> ${Be}-nav`]:{order:0},[`> ${Be}-content-holder`]:{order:1}},[`&${Be}-card${Be}-top, &${Be}-card${Be}-bottom`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{[`${Be}-tab + ${Be}-tab`]:{marginRight:{_skip_check_:!0,value:Xe},marginLeft:{_skip_check_:!0,value:0}}}}},[`${Be}-dropdown-rtl`]:{direction:"rtl"},[`${Be}-menu-item`]:{[`${Be}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},lr=ke=>{const{componentCls:Be,tabsCardPadding:Ae,cardHeight:Ie,cardGutter:Xe,itemHoverColor:dt,itemActiveColor:Ht,colorBorderSecondary:kt}=ke;return{[Be]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,kr.Wf)(ke)),{display:"flex",[`> ${Be}-nav, > div > ${Be}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${Be}-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 ${ke.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${Be}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${ke.motionDurationSlow}`},[`${Be}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${Be}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${Be}-nav-more`]:{position:"relative",padding:Ae,background:"transparent",border:0,color:ke.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:ke.controlHeightLG/8,transform:"translateY(100%)",content:"''"}},[`${Be}-nav-add`]:Object.assign({minWidth:Ie,marginLeft:{_skip_check_:!0,value:Xe},padding:`0 ${ke.paddingXS}px`,background:"transparent",border:`${ke.lineWidth}px ${ke.lineType} ${kt}`,borderRadius:`${ke.borderRadiusLG}px ${ke.borderRadiusLG}px 0 0`,outline:"none",cursor:"pointer",color:ke.colorText,transition:`all ${ke.motionDurationSlow} ${ke.motionEaseInOut}`,"&:hover":{color:dt},"&:active, &:focus:not(:focus-visible)":{color:Ht}},(0,kr.Qy)(ke))},[`${Be}-extra-content`]:{flex:"none"},[`${Be}-ink-bar`]:{position:"absolute",background:ke.inkBarColor,pointerEvents:"none"}}),Nr(ke)),{[`${Be}-content`]:{position:"relative",width:"100%"},[`${Be}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${Be}-tabpane`]:{outline:"none","&-hidden":{display:"none"}}}),[`${Be}-centered`]:{[`> ${Be}-nav, > div > ${Be}-nav`]:{[`${Be}-nav-wrap`]:{[`&:not([class*='${Be}-nav-wrap-ping'])`]:{justifyContent:"center"}}}}}};var Rn=(0,Tr.Z)("Tabs",ke=>{const Be=(0,Hr.TS)(ke,{tabsCardPadding:ke.cardPadding||`${(ke.cardHeight-Math.round(ke.fontSize*ke.lineHeight))/2-ke.lineWidth}px ${ke.padding}px`,dropdownEdgeChildVerticalPadding:ke.paddingXXS,tabsActiveTextShadow:"0 0 0.25px currentcolor",tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${ke.horizontalItemGutter}px`,tabsHorizontalItemMarginRTL:`0 0 0 ${ke.horizontalItemGutter}px`});return[jr(Be),Jn(Be),Er(Be),Fr(Be),Or(Be),lr(Be),rr(Be)]},ke=>{const Be=ke.controlHeightLG;return{zIndexPopup:ke.zIndexPopupBase+50,cardBg:ke.colorFillAlter,cardHeight:Be,cardPadding:"",cardPaddingSM:`${ke.paddingXXS*1.5}px ${ke.padding}px`,cardPaddingLG:`${ke.paddingXS}px ${ke.padding}px ${ke.paddingXXS*1.5}px`,titleFontSize:ke.fontSize,titleFontSizeLG:ke.fontSizeLG,titleFontSizeSM:ke.fontSize,inkBarColor:ke.colorPrimary,horizontalMargin:`0 0 ${ke.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${ke.paddingSM}px 0`,horizontalItemPaddingSM:`${ke.paddingXS}px 0`,horizontalItemPaddingLG:`${ke.padding}px 0`,verticalItemPadding:`${ke.paddingXS}px ${ke.paddingLG}px`,verticalItemMargin:`${ke.margin}px 0 0 0`,itemColor:ke.colorText,itemSelectedColor:ke.colorPrimary,itemHoverColor:ke.colorPrimaryHover,itemActiveColor:ke.colorPrimaryActive,cardGutter:ke.marginXXS/2}}),$n=function(ke,Be){var Ae={};for(var Ie in ke)Object.prototype.hasOwnProperty.call(ke,Ie)&&Be.indexOf(Ie)<0&&(Ae[Ie]=ke[Ie]);if(ke!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Xe=0,Ie=Object.getOwnPropertySymbols(ke);Xe<Ie.length;Xe++)Be.indexOf(Ie[Xe])<0&&Object.prototype.propertyIsEnumerable.call(ke,Ie[Xe])&&(Ae[Ie[Xe]]=ke[Ie[Xe]]);return Ae};const wr=ke=>{const{type:Be,className:Ae,rootClassName:Ie,size:Xe,onEdit:dt,hideAdd:Ht,centered:kt,addIcon:Wt,popupClassName:vn,children:xn,items:Cn,animated:Lt,style:ln,indicatorSize:it}=ke,wt=$n(ke,["type","className","rootClassName","size","onEdit","hideAdd","centered","addIcon","popupClassName","children","items","animated","style","indicatorSize"]),{prefixCls:Et,moreIcon:At=Te.createElement(Ze.Z,null)}=wt,{direction:nn,tabs:_t,getPrefixCls:tn,getPopupContainer:Oe}=Te.useContext(Ue.E_),yt=tn("tabs",Et),[xt,Ot]=Rn(yt);let Dt;Be==="editable-card"&&(Dt={onEdit:(zn,er)=>{let{key:cr,event:Un}=er;dt==null||dt(zn==="add"?Un:cr,zn)},removeIcon:Te.createElement(fe.Z,null),addIcon:Wt||Te.createElement(Fe.Z,null),showAdd:Ht!==!0});const Nt=tn(),zt=hr(Cn,xn),gn=Ln(yt,Lt),wn=(0,Bt.Z)(Xe),Dn=Object.assign(Object.assign({},_t==null?void 0:_t.style),ln);return xt(Te.createElement(ze,Object.assign({direction:nn,getPopupContainer:Oe,moreTransitionName:`${Nt}-slide-up`},wt,{items:zt,className:be()({[`${yt}-${wn}`]:wn,[`${yt}-card`]:["card","editable-card"].includes(Be),[`${yt}-editable-card`]:Be==="editable-card",[`${yt}-centered`]:kt},_t==null?void 0:_t.className,Ae,Ie,Ot),popupClassName:be()(vn,Ot),style:Dn,editable:Dt,moreIcon:At,prefixCls:yt,animated:gn,indicatorSize:it!=null?it:_t==null?void 0:_t.indicatorSize})))};wr.TabPane=rn;var ct=wr},54580:function(Mn,Qt,ue){"use strict";ue.d(Qt,{default:function(){return ln}});var fe=ue(59301),Ze=ue(94480),Fe=ue(92310),tt=ue.n(Fe),be=ue(54476),Le=ue(67732),Re=ue(83652),Se=ue(42403),Me=ue(158),Pe=ue(20068),rt=ue(75931),Te=ue(75044),He=ue(76190),ht=ue(3202),Je=ue(26112);function lt(it,wt){var Et="cannot ".concat(it.method," ").concat(it.action," ").concat(wt.status,"'"),At=new Error(Et);return At.status=wt.status,At.method=it.method,At.url=it.action,At}function st(it){var wt=it.responseText||it.response;if(!wt)return wt;try{return JSON.parse(wt)}catch(Et){return wt}}function Rt(it){var wt=new XMLHttpRequest;it.onProgress&&wt.upload&&(wt.upload.onprogress=function(_t){_t.total>0&&(_t.percent=_t.loaded/_t.total*100),it.onProgress(_t)});var Et=new FormData;it.data&&Object.keys(it.data).forEach(function(nn){var _t=it.data[nn];if(Array.isArray(_t)){_t.forEach(function(tn){Et.append("".concat(nn,"[]"),tn)});return}Et.append(nn,_t)}),it.file instanceof Blob?Et.append(it.filename,it.file,it.file.name):Et.append(it.filename,it.file),wt.onerror=function(_t){it.onError(_t)},wt.onload=function(){return wt.status<200||wt.status>=300?it.onError(lt(it,wt),st(wt)):it.onSuccess(st(wt),wt)},wt.open(it.method,it.action,!0),it.withCredentials&&"withCredentials"in wt&&(wt.withCredentials=!0);var At=it.headers||{};return At["X-Requested-With"]!==null&&wt.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(At).forEach(function(nn){At[nn]!==null&&wt.setRequestHeader(nn,At[nn])}),wt.send(Et),{abort:function(){wt.abort()}}}var qt=+new Date,at=0;function ft(){return"rc-upload-".concat(qt,"-").concat(++at)}var Ve=ue(48736),_e=function(it,wt){if(it&&wt){var Et=Array.isArray(wt)?wt:wt.split(","),At=it.name||"",nn=it.type||"",_t=nn.replace(/\/.*$/,"");return Et.some(function(tn){var Oe=tn.trim();if(/^\*(\/\*)?$/.test(tn))return!0;if(Oe.charAt(0)==="."){var yt=At.toLowerCase(),xt=Oe.toLowerCase(),Ot=[xt];return(xt===".jpg"||xt===".jpeg")&&(Ot=[".jpg",".jpeg"]),Ot.some(function(Dt){return yt.endsWith(Dt)})}return/\/\*$/.test(Oe)?_t===Oe.replace(/\/.*$/,""):nn===Oe?!0:/^\w+$/.test(Oe)?((0,Ve.ZP)(!1,"Upload takes an invalidate 'accept' type '".concat(Oe,"'.Skip for check.")),!0):!1})}return!0};function We(it,wt){var Et=it.createReader(),At=[];function nn(){Et.readEntries(function(_t){var tn=Array.prototype.slice.apply(_t);At=At.concat(tn);var Oe=!tn.length;Oe?wt(At):nn()})}nn()}var et=function(wt,Et,At){var nn=function _t(tn,Oe){tn&&(tn.path=Oe||"",tn.isFile?tn.file(function(yt){At(yt)&&(tn.fullPath&&!yt.webkitRelativePath&&(Object.defineProperties(yt,{webkitRelativePath:{writable:!0}}),yt.webkitRelativePath=tn.fullPath.replace(/^\//,""),Object.defineProperties(yt,{webkitRelativePath:{writable:!1}})),Et([yt]))}):tn.isDirectory&&We(tn,function(yt){yt.forEach(function(xt){_t(xt,"".concat(Oe).concat(tn.name,"/"))})}))};wt.forEach(function(_t){nn(_t.webkitGetAsEntry())})},Mt=et,Qe=["component","prefixCls","className","disabled","id","style","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"],Kt=function(it){(0,Se.Z)(Et,it);var wt=(0,Me.Z)(Et);function Et(){var At;(0,Le.Z)(this,Et);for(var nn=arguments.length,_t=new Array(nn),tn=0;tn<nn;tn++)_t[tn]=arguments[tn];return At=wt.call.apply(wt,[this].concat(_t)),At.state={uid:ft()},At.reqs={},At.fileInput=void 0,At._isMounted=void 0,At.onChange=function(Oe){var yt=At.props,xt=yt.accept,Ot=yt.directory,Dt=Oe.target.files,Nt=(0,Ze.Z)(Dt).filter(function(zt){return!Ot||_e(zt,xt)});At.uploadFiles(Nt),At.reset()},At.onClick=function(Oe){var yt=At.fileInput;if(yt){var xt=Oe.target,Ot=At.props.onClick;if(xt&&xt.tagName==="BUTTON"){var Dt=yt.parentNode;Dt.focus(),xt.blur()}yt.click(),Ot&&Ot(Oe)}},At.onKeyDown=function(Oe){Oe.key==="Enter"&&At.onClick(Oe)},At.onFileDrop=function(Oe){var yt=At.props.multiple;if(Oe.preventDefault(),Oe.type!=="dragover")if(At.props.directory)Mt(Array.prototype.slice.call(Oe.dataTransfer.items),At.uploadFiles,function(Ot){return _e(Ot,At.props.accept)});else{var xt=(0,Ze.Z)(Oe.dataTransfer.files).filter(function(Ot){return _e(Ot,At.props.accept)});yt===!1&&(xt=xt.slice(0,1)),At.uploadFiles(xt)}},At.uploadFiles=function(Oe){var yt=(0,Ze.Z)(Oe),xt=yt.map(function(Ot){return Ot.uid=ft(),At.processFile(Ot,yt)});Promise.all(xt).then(function(Ot){var Dt=At.props.onBatchStart;Dt==null||Dt(Ot.map(function(Nt){var zt=Nt.origin,gn=Nt.parsedFile;return{file:zt,parsedFile:gn}})),Ot.filter(function(Nt){return Nt.parsedFile!==null}).forEach(function(Nt){At.post(Nt)})})},At.processFile=function(){var Oe=(0,ht.Z)((0,Te.Z)().mark(function yt(xt,Ot){var Dt,Nt,zt,gn,wn,Dn,zn,er,cr;return(0,Te.Z)().wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:if(Dt=At.props.beforeUpload,Nt=xt,!Dt){Pn.next=14;break}return Pn.prev=3,Pn.next=6,Dt(xt,Ot);case 6:Nt=Pn.sent,Pn.next=12;break;case 9:Pn.prev=9,Pn.t0=Pn.catch(3),Nt=!1;case 12:if(Nt!==!1){Pn.next=14;break}return Pn.abrupt("return",{origin:xt,parsedFile:null,action:null,data:null});case 14:if(zt=At.props.action,typeof zt!="function"){Pn.next=21;break}return Pn.next=18,zt(xt);case 18:gn=Pn.sent,Pn.next=22;break;case 21:gn=zt;case 22:if(wn=At.props.data,typeof wn!="function"){Pn.next=29;break}return Pn.next=26,wn(xt);case 26:Dn=Pn.sent,Pn.next=30;break;case 29:Dn=wn;case 30:return zn=((0,He.Z)(Nt)==="object"||typeof Nt=="string")&&Nt?Nt:xt,zn instanceof File?er=zn:er=new File([zn],xt.name,{type:xt.type}),cr=er,cr.uid=xt.uid,Pn.abrupt("return",{origin:xt,data:Dn,parsedFile:cr,action:gn});case 35:case"end":return Pn.stop()}},yt,null,[[3,9]])}));return function(yt,xt){return Oe.apply(this,arguments)}}(),At.saveFileInput=function(Oe){At.fileInput=Oe},At}return(0,Re.Z)(Et,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"post",value:function(nn){var _t=this,tn=nn.data,Oe=nn.origin,yt=nn.action,xt=nn.parsedFile;if(this._isMounted){var Ot=this.props,Dt=Ot.onStart,Nt=Ot.customRequest,zt=Ot.name,gn=Ot.headers,wn=Ot.withCredentials,Dn=Ot.method,zn=Oe.uid,er=Nt||Rt,cr={action:yt,filename:zt,data:tn,file:xt,headers:gn,withCredentials:wn,method:Dn||"post",onProgress:function(Pn){var fr=_t.props.onProgress;fr==null||fr(Pn,xt)},onSuccess:function(Pn,fr){var tr=_t.props.onSuccess;tr==null||tr(Pn,xt,fr),delete _t.reqs[zn]},onError:function(Pn,fr){var tr=_t.props.onError;tr==null||tr(Pn,fr,xt),delete _t.reqs[zn]}};Dt(Oe),this.reqs[zn]=er(cr)}}},{key:"reset",value:function(){this.setState({uid:ft()})}},{key:"abort",value:function(nn){var _t=this.reqs;if(nn){var tn=nn.uid?nn.uid:nn;_t[tn]&&_t[tn].abort&&_t[tn].abort(),delete _t[tn]}else Object.keys(_t).forEach(function(Oe){_t[Oe]&&_t[Oe].abort&&_t[Oe].abort(),delete _t[Oe]})}},{key:"render",value:function(){var nn=this.props,_t=nn.component,tn=nn.prefixCls,Oe=nn.className,yt=nn.disabled,xt=nn.id,Ot=nn.style,Dt=nn.multiple,Nt=nn.accept,zt=nn.capture,gn=nn.children,wn=nn.directory,Dn=nn.openFileDialogOnClick,zn=nn.onMouseEnter,er=nn.onMouseLeave,cr=(0,rt.Z)(nn,Qe),Un=tt()((0,Pe.Z)((0,Pe.Z)((0,Pe.Z)({},tn,!0),"".concat(tn,"-disabled"),yt),Oe,Oe)),Pn=wn?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},fr=yt?{}:{onClick:Dn?this.onClick:function(){},onKeyDown:Dn?this.onKeyDown:function(){},onMouseEnter:zn,onMouseLeave:er,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return fe.createElement(_t,(0,be.Z)({},fr,{className:Un,role:"button",style:Ot}),fe.createElement("input",(0,be.Z)({},(0,Je.Z)(cr,{aria:!0,data:!0}),{id:xt,disabled:yt,type:"file",ref:this.saveFileInput,onClick:function(yr){return yr.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:Nt},Pn,{multiple:Dt,onChange:this.onChange},zt!=null?{capture:zt}:{})),gn)}}]),Et}(fe.Component),ut=Kt;function Pt(){}var nt=function(it){(0,Se.Z)(Et,it);var wt=(0,Me.Z)(Et);function Et(){var At;(0,Le.Z)(this,Et);for(var nn=arguments.length,_t=new Array(nn),tn=0;tn<nn;tn++)_t[tn]=arguments[tn];return At=wt.call.apply(wt,[this].concat(_t)),At.uploader=void 0,At.saveUploader=function(Oe){At.uploader=Oe},At}return(0,Re.Z)(Et,[{key:"abort",value:function(nn){this.uploader.abort(nn)}},{key:"render",value:function(){return fe.createElement(ut,(0,be.Z)({},this.props,{ref:this.saveUploader}))}}]),Et}(fe.Component);nt.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:Pt,onError:Pt,onSuccess:Pt,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var Gt=nt,mn=Gt,on=ue(18929),sn=ue(4676),jt=ue(36355),Ke=ue(1684),xe=ue(9763),bt=ue(31724),fn={icon:function(wt,Et){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:Et}},{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:wt}}]}},name:"file",theme:"twotone"},Xt=fn,qe=ue(7657),je=function(wt,Et){return fe.createElement(qe.Z,(0,be.Z)({},wt,{ref:Et,icon:Xt}))},gt=fe.forwardRef(je),en=gt,Zt=ue(58617),pn={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=pn,Ft=function(wt,Et){return fe.createElement(qe.Z,(0,be.Z)({},wt,{ref:Et,icon:Vt}))},Tt=fe.forwardRef(Ft),ge=Tt,se={icon:function(wt,Et){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:wt}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:Et}},{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:Et}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:Et}},{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:wt}}]}},name:"picture",theme:"twotone"},oe=se,de=function(wt,Et){return fe.createElement(qe.Z,(0,be.Z)({},wt,{ref:Et,icon:oe}))},pe=fe.forwardRef(de),le=pe,De=ue(77900),ot=ue(56762),$t=ue(62892),It=ue(92343),Ut=ue(3113);function Yt(it){return Object.assign(Object.assign({},it),{lastModified:it.lastModified,lastModifiedDate:it.lastModifiedDate,name:it.name,size:it.size,type:it.type,uid:it.uid,percent:0,originFileObj:it})}function dn(it,wt){const Et=(0,Ze.Z)(wt),At=Et.findIndex(nn=>{let{uid:_t}=nn;return _t===it.uid});return At===-1?Et.push(it):Et[At]=it,Et}function hn(it,wt){const Et=it.uid!==void 0?"uid":"name";return wt.filter(At=>At[Et]===it[Et])[0]}function _n(it,wt){const Et=it.uid!==void 0?"uid":"name",At=wt.filter(nn=>nn[Et]!==it[Et]);return At.length===wt.length?null:At}const vt=function(){const wt=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"").split("/"),At=wt[wt.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(At)||[""])[0]},cn=it=>it.indexOf("image/")===0,Sn=it=>{if(it.type&&!it.thumbUrl)return cn(it.type);const wt=it.thumbUrl||it.url||"",Et=vt(wt);return/^data:image\//.test(wt)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(Et)?!0:!(/^data:/.test(wt)||Et)},Ye=200;function ze(it){return new Promise(wt=>{if(!it.type||!cn(it.type)){wt("");return}const Et=document.createElement("canvas");Et.width=Ye,Et.height=Ye,Et.style.cssText=`position: fixed; left: 0; top: 0; width: ${Ye}px; height: ${Ye}px; z-index: 9999; display: none;`,document.body.appendChild(Et);const At=Et.getContext("2d"),nn=new Image;if(nn.onload=()=>{const{width:_t,height:tn}=nn;let Oe=Ye,yt=Ye,xt=0,Ot=0;_t>tn?(yt=tn*(Ye/_t),Ot=-(yt-Oe)/2):(Oe=_t*(Ye/tn),xt=-(Oe-yt)/2),At.drawImage(nn,xt,Ot,Oe,yt);const Dt=Et.toDataURL();document.body.removeChild(Et),window.URL.revokeObjectURL(nn.src),wt(Dt)},nn.crossOrigin="anonymous",it.type.startsWith("image/svg+xml")){const _t=new FileReader;_t.onload=()=>{_t.result&&(nn.src=_t.result)},_t.readAsDataURL(it)}else if(it.type.startsWith("image/gif")){const _t=new FileReader;_t.onload=()=>{_t.result&&wt(_t.result)},_t.readAsDataURL(it)}else nn.src=window.URL.createObjectURL(it)})}var Ue=ue(26227),Bt=ue(41464),Jt=ue(15277),rn=ue(93948),An=ue(6848),Ln=fe.forwardRef((it,wt)=>{let{prefixCls:Et,className:At,style:nn,locale:_t,listType:tn,file:Oe,items:yt,progress:xt,iconRender:Ot,actionIconRender:Dt,itemRender:Nt,isImgUrl:zt,showPreviewIcon:gn,showRemoveIcon:wn,showDownloadIcon:Dn,previewIcon:zn,removeIcon:er,downloadIcon:cr,onPreview:Un,onDownload:Pn,onClose:fr}=it;var tr,yr;const{status:Gn}=Oe,[Xn,br]=fe.useState(Gn);fe.useEffect(()=>{Gn!=="removed"&&br(Gn)},[Gn]);const[ur,Br]=fe.useState(!1);fe.useEffect(()=>{const di=setTimeout(()=>{Br(!0)},300);return()=>{clearTimeout(di)}},[]);const Gr=Ot(Oe);let ar=fe.createElement("div",{className:`${Et}-icon`},Gr);if(tn==="picture"||tn==="picture-card"||tn==="picture-circle")if(Xn==="uploading"||!Oe.thumbUrl&&!Oe.url){const di=tt()(`${Et}-list-item-thumbnail`,{[`${Et}-list-item-file`]:Xn!=="uploading"});ar=fe.createElement("div",{className:di},Gr)}else{const di=zt!=null&&zt(Oe)?fe.createElement("img",{src:Oe.thumbUrl||Oe.url,alt:Oe.name,className:`${Et}-list-item-image`,crossOrigin:Oe.crossOrigin}):Gr,ri=tt()(`${Et}-list-item-thumbnail`,{[`${Et}-list-item-file`]:zt&&!zt(Oe)});ar=fe.createElement("a",{className:ri,onClick:Jr=>Un(Oe,Jr),href:Oe.url||Oe.thumbUrl,target:"_blank",rel:"noopener noreferrer"},di)}const En=tt()(`${Et}-list-item`,`${Et}-list-item-${Xn}`),kn=typeof Oe.linkProps=="string"?JSON.parse(Oe.linkProps):Oe.linkProps,gr=wn?Dt((typeof er=="function"?er(Oe):er)||fe.createElement(Ue.Z,null),()=>fr(Oe),Et,_t.removeFile):null,nr=Dn&&Xn==="done"?Dt((typeof cr=="function"?cr(Oe):cr)||fe.createElement(Bt.Z,null),()=>Pn(Oe),Et,_t.downloadFile):null,_r=tn!=="picture-card"&&tn!=="picture-circle"&&fe.createElement("span",{key:"download-delete",className:tt()(`${Et}-list-item-actions`,{picture:tn==="picture"})},nr,gr),Lr=tt()(`${Et}-list-item-name`),Ir=Oe.url?[fe.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:Lr,title:Oe.name},kn,{href:Oe.url,onClick:di=>Un(Oe,di)}),Oe.name),_r]:[fe.createElement("span",{key:"view",className:Lr,onClick:di=>Un(Oe,di),title:Oe.name},Oe.name),_r],pr={pointerEvents:"none",opacity:.5},Sr=gn?fe.createElement("a",{href:Oe.url||Oe.thumbUrl,target:"_blank",rel:"noopener noreferrer",style:Oe.url||Oe.thumbUrl?void 0:pr,onClick:di=>Un(Oe,di),title:_t.previewFile},typeof zn=="function"?zn(Oe):zn||fe.createElement(Jt.Z,null)):null,ii=(tn==="picture-card"||tn==="picture-circle")&&Xn!=="uploading"&&fe.createElement("span",{className:`${Et}-list-item-actions`},Sr,Xn==="done"&&nr,gr),{getPrefixCls:Hn}=fe.useContext(jt.E_),qn=Hn(),Dr=fe.createElement("div",{className:En},ar,Ir,ii,ur&&fe.createElement(De.default,{motionName:`${qn}-fade`,visible:Xn==="uploading",motionDeadline:2e3},di=>{let{className:ri}=di;const Jr="percent"in Oe?fe.createElement(rn.Z,Object.assign({},xt,{type:"line",percent:Oe.percent,"aria-label":Oe["aria-label"],"aria-labelledby":Oe["aria-labelledby"]})):null;return fe.createElement("div",{className:tt()(`${Et}-list-item-progress`,ri)},Jr)})),$r=Oe.response&&typeof Oe.response=="string"?Oe.response:((tr=Oe.error)===null||tr===void 0?void 0:tr.statusText)||((yr=Oe.error)===null||yr===void 0?void 0:yr.message)||_t.uploadError,li=Xn==="error"?fe.createElement(An.Z,{title:$r,getPopupContainer:di=>di.parentNode},Dr):Dr;return fe.createElement("div",{className:tt()(`${Et}-list-item-container`,At),style:nn,ref:wt},Nt?Nt(li,Oe,yt,{download:Pn.bind(null,Oe),preview:Un.bind(null,Oe),remove:fr.bind(null,Oe)}):li)});const Fn=(it,wt)=>{const{listType:Et="text",previewFile:At=ze,onPreview:nn,onDownload:_t,onRemove:tn,locale:Oe,iconRender:yt,isImageUrl:xt=Sn,prefixCls:Ot,items:Dt=[],showPreviewIcon:Nt=!0,showRemoveIcon:zt=!0,showDownloadIcon:gn=!1,removeIcon:wn,previewIcon:Dn,downloadIcon:zn,progress:er={size:[-1,2],showInfo:!1},appendAction:cr,appendActionVisible:Un=!0,itemRender:Pn,disabled:fr}=it,tr=(0,ot.Z)(),[yr,Gn]=fe.useState(!1);fe.useEffect(()=>{Et!=="picture"&&Et!=="picture-card"&&Et!=="picture-circle"||(Dt||[]).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="",At&&At(pr.originFileObj).then(Sr=>{pr.thumbUrl=Sr||"",tr()}))})},[Et,Dt,At]),fe.useEffect(()=>{Gn(!0)},[]);const Xn=(pr,Sr)=>{if(nn)return Sr==null||Sr.preventDefault(),nn(pr)},br=pr=>{typeof _t=="function"?_t(pr):pr.url&&window.open(pr.url)},ur=pr=>{tn==null||tn(pr)},Br=pr=>{if(yt)return yt(pr,Et);const Sr=pr.status==="uploading",ii=xt&&xt(pr)?fe.createElement(le,null):fe.createElement(en,null);let Hn=Sr?fe.createElement(Zt.Z,null):fe.createElement(ge,null);return Et==="picture"?Hn=Sr?fe.createElement(Zt.Z,null):ii:(Et==="picture-card"||Et==="picture-circle")&&(Hn=Sr?Oe.uploading:ii),Hn},Gr=(pr,Sr,ii,Hn)=>{const qn={type:"text",size:"small",title:Hn,onClick:Dr=>{Sr(),(0,It.l$)(pr)&&pr.props.onClick&&pr.props.onClick(Dr)},className:`${ii}-list-item-action`,disabled:fr};if((0,It.l$)(pr)){const Dr=(0,It.Tm)(pr,Object.assign(Object.assign({},pr.props),{onClick:()=>{}}));return fe.createElement(Ut.ZP,Object.assign({},qn,{icon:Dr}))}return fe.createElement(Ut.ZP,Object.assign({},qn),fe.createElement("span",null,pr))};fe.useImperativeHandle(wt,()=>({handlePreview:Xn,handleDownload:br}));const{getPrefixCls:ar}=fe.useContext(jt.E_),En=ar("upload",Ot),kn=ar(),gr=tt()(`${En}-list`,`${En}-list-${Et}`),nr=(0,Ze.Z)(Dt.map(pr=>({key:pr.uid,file:pr})));let Lr={motionDeadline:2e3,motionName:`${En}-${Et==="picture-card"||Et==="picture-circle"?"animate-inline":"animate"}`,keys:nr,motionAppear:yr};const Ir=fe.useMemo(()=>{const pr=Object.assign({},(0,$t.Z)(kn));return delete pr.onAppearEnd,delete pr.onEnterEnd,delete pr.onLeaveEnd,pr},[kn]);return Et!=="picture-card"&&Et!=="picture-circle"&&(Lr=Object.assign(Object.assign({},Ir),Lr)),fe.createElement("div",{className:gr},fe.createElement(De.CSSMotionList,Object.assign({},Lr,{component:!1}),pr=>{let{key:Sr,file:ii,className:Hn,style:qn}=pr;return fe.createElement(Ln,{key:Sr,locale:Oe,prefixCls:En,className:Hn,style:qn,file:ii,items:Dt,progress:er,listType:Et,isImgUrl:xt,showPreviewIcon:Nt,showRemoveIcon:zt,showDownloadIcon:gn,removeIcon:wn,previewIcon:Dn,downloadIcon:zn,iconRender:Br,actionIconRender:Gr,itemRender:Pn,onPreview:Xn,onDownload:br,onClose:ur})}),cr&&fe.createElement(De.default,Object.assign({},Lr,{visible:Un,forceRender:!0}),pr=>{let{className:Sr,style:ii}=pr;return(0,It.Tm)(cr,Hn=>({className:tt()(Hn.className,Sr),style:Object.assign(Object.assign(Object.assign({},ii),{pointerEvents:Sr?"none":void 0}),Hn.style)}))}))};var Tn=fe.forwardRef(Fn),hr=ue(17313),kr=ue(8378),Tr=ue(83116),Hr=ue(37613),Mr=it=>{const{componentCls:wt,iconCls:Et}=it;return{[`${wt}-wrapper`]:{[`${wt}-drag`]:{position:"relative",width:"100%",height:"100%",textAlign:"center",background:it.colorFillAlter,border:`${it.lineWidth}px dashed ${it.colorBorder}`,borderRadius:it.borderRadiusLG,cursor:"pointer",transition:`border-color ${it.motionDurationSlow}`,[wt]:{padding:`${it.padding}px 0`},[`${wt}-btn`]:{display:"table",width:"100%",height:"100%",outline:"none"},[`${wt}-drag-container`]:{display:"table-cell",verticalAlign:"middle"},[`&:not(${wt}-disabled):hover`]:{borderColor:it.colorPrimaryHover},[`p${wt}-drag-icon`]:{marginBottom:it.margin,[Et]:{color:it.colorPrimary,fontSize:it.uploadThumbnailSize}},[`p${wt}-text`]:{margin:`0 0 ${it.marginXXS}px`,color:it.colorTextHeading,fontSize:it.fontSizeLG},[`p${wt}-hint`]:{color:it.colorTextDescription,fontSize:it.fontSize},[`&${wt}-disabled`]:{cursor:"not-allowed",[`p${wt}-drag-icon ${Et},
p${wt}-text,
p${wt}-hint
`]:{color:it.colorTextDisabled}}}}}},Or=it=>{const{componentCls:wt,antCls:Et,iconCls:At,fontSize:nn,lineHeight:_t}=it,tn=`${wt}-list-item`,Oe=`${tn}-actions`,yt=`${tn}-action`,xt=Math.round(nn*_t);return{[`${wt}-wrapper`]:{[`${wt}-list`]:Object.assign(Object.assign({},(0,hr.dF)()),{lineHeight:it.lineHeight,[tn]:{position:"relative",height:it.lineHeight*nn,marginTop:it.marginXS,fontSize:nn,display:"flex",alignItems:"center",transition:`background-color ${it.motionDurationSlow}`,"&:hover":{backgroundColor:it.controlItemBgHover},[`${tn}-name`]:Object.assign(Object.assign({},hr.vS),{padding:`0 ${it.paddingXS}px`,lineHeight:_t,flex:"auto",transition:`all ${it.motionDurationSlow}`}),[Oe]:{[yt]:{opacity:0},[`${yt}${Et}-btn-sm`]:{height:xt,border:0,lineHeight:1,"> span":{transform:"scale(1)"}},[`
${yt}:focus-visible,
&.picture ${yt}
`]:{opacity:1},[At]:{color:it.actionsColor,transition:`all ${it.motionDurationSlow}`},[`&:hover ${At}`]:{color:it.colorText}},[`${wt}-icon ${At}`]:{color:it.colorTextDescription,fontSize:nn},[`${tn}-progress`]:{position:"absolute",bottom:-it.uploadProgressOffset,width:"100%",paddingInlineStart:nn+it.paddingXS,fontSize:nn,lineHeight:0,pointerEvents:"none","> div":{margin:0}}},[`${tn}:hover ${yt}`]:{opacity:1,color:it.colorText},[`${tn}-error`]:{color:it.colorError,[`${tn}-name, ${wt}-icon ${At}`]:{color:it.colorError},[Oe]:{[`${At}, ${At}:hover`]:{color:it.colorError},[yt]:{opacity:1}}},[`${wt}-list-item-container`]:{transition:`opacity ${it.motionDurationSlow}, height ${it.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=it=>{const{componentCls:wt}=it,Et=`${wt}-animate-inline`;return[{[`${wt}-wrapper`]:{[`${Et}-appear, ${Et}-enter, ${Et}-leave`]:{animationDuration:it.motionDurationSlow,animationTimingFunction:it.motionEaseInOutCirc,animationFillMode:"forwards"},[`${Et}-appear, ${Et}-enter`]:{animationName:jr},[`${Et}-leave`]:{animationName:Nr}}},{[`${wt}-wrapper`]:(0,Er.J$)(it)},jr,Nr]},Rn=ue(30071),$n=ue(64993);const wr=it=>{const{componentCls:wt,iconCls:Et,uploadThumbnailSize:At,uploadProgressOffset:nn}=it,_t=`${wt}-list`,tn=`${_t}-item`;return{[`${wt}-wrapper`]:{[`
${_t}${_t}-picture,
${_t}${_t}-picture-card,
${_t}${_t}-picture-circle
`]:{[tn]:{position:"relative",height:At+it.lineWidth*2+it.paddingXS*2,padding:it.paddingXS,border:`${it.lineWidth}px ${it.lineType} ${it.colorBorder}`,borderRadius:it.borderRadiusLG,"&:hover":{background:"transparent"},[`${tn}-thumbnail`]:Object.assign(Object.assign({},hr.vS),{width:At,height:At,lineHeight:`${At+it.paddingSM}px`,textAlign:"center",flex:"none",[Et]:{fontSize:it.fontSizeHeading2,color:it.colorPrimary},img:{display:"block",width:"100%",height:"100%",overflow:"hidden"}}),[`${tn}-progress`]:{bottom:nn,width:`calc(100% - ${it.paddingSM*2}px)`,marginTop:0,paddingInlineStart:At+it.paddingXS}},[`${tn}-error`]:{borderColor:it.colorError,[`${tn}-thumbnail ${Et}`]:{[`svg path[fill='${Rn.blue[0]}']`]:{fill:it.colorErrorBg},[`svg path[fill='${Rn.blue.primary}']`]:{fill:it.colorError}}},[`${tn}-uploading`]:{borderStyle:"dashed",[`${tn}-name`]:{marginBottom:nn}}},[`${_t}${_t}-picture-circle ${tn}`]:{[`&, &::before, ${tn}-thumbnail`]:{borderRadius:"50%"}}}}},ct=it=>{const{componentCls:wt,iconCls:Et,fontSizeLG:At,colorTextLightSolid:nn}=it,_t=`${wt}-list`,tn=`${_t}-item`,Oe=it.uploadPicCardSize;return{[`
${wt}-wrapper${wt}-picture-card-wrapper,
${wt}-wrapper${wt}-picture-circle-wrapper
`]:Object.assign(Object.assign({},(0,hr.dF)()),{display:"inline-block",width:"100%",[`${wt}${wt}-select`]:{width:Oe,height:Oe,marginInlineEnd:it.marginXS,marginBottom:it.marginXS,textAlign:"center",verticalAlign:"top",backgroundColor:it.colorFillAlter,border:`${it.lineWidth}px dashed ${it.colorBorder}`,borderRadius:it.borderRadiusLG,cursor:"pointer",transition:`border-color ${it.motionDurationSlow}`,[`> ${wt}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",textAlign:"center"},[`&:not(${wt}-disabled):hover`]:{borderColor:it.colorPrimary}},[`${_t}${_t}-picture-card, ${_t}${_t}-picture-circle`]:{[`${_t}-item-container`]:{display:"inline-block",width:Oe,height:Oe,marginBlock:`0 ${it.marginXS}px`,marginInline:`0 ${it.marginXS}px`,verticalAlign:"top"},"&::after":{display:"none"},[tn]:{height:"100%",margin:0,"&::before":{position:"absolute",zIndex:1,width:`calc(100% - ${it.paddingXS*2}px)`,height:`calc(100% - ${it.paddingXS*2}px)`,backgroundColor:it.colorBgMask,opacity:0,transition:`all ${it.motionDurationSlow}`,content:'" "'}},[`${tn}:hover`]:{[`&::before, ${tn}-actions`]:{opacity:1}},[`${tn}-actions`]:{position:"absolute",insetInlineStart:0,zIndex:10,width:"100%",whiteSpace:"nowrap",textAlign:"center",opacity:0,transition:`all ${it.motionDurationSlow}`,[`${Et}-eye, ${Et}-download, ${Et}-delete`]:{zIndex:10,width:At,margin:`0 ${it.marginXXS}px`,fontSize:At,cursor:"pointer",transition:`all ${it.motionDurationSlow}`,svg:{verticalAlign:"baseline"}}},[`${tn}-actions, ${tn}-actions:hover`]:{[`${Et}-eye, ${Et}-download, ${Et}-delete`]:{color:new $n.C(nn).setAlpha(.65).toRgbString(),"&:hover":{color:nn}}},[`${tn}-thumbnail, ${tn}-thumbnail img`]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},[`${tn}-name`]:{display:"none",textAlign:"center"},[`${tn}-file + ${tn}-name`]:{position:"absolute",bottom:it.margin,display:"block",width:`calc(100% - ${it.paddingXS*2}px)`},[`${tn}-uploading`]:{[`&${tn}`]:{backgroundColor:it.colorFillAlter},[`&::before, ${Et}-eye, ${Et}-download, ${Et}-delete`]:{display:"none"}},[`${tn}-progress`]:{bottom:it.marginXL,width:`calc(100% - ${it.paddingXS*2}px)`,paddingInlineStart:0}}}),[`${wt}-wrapper${wt}-picture-circle-wrapper`]:{[`${wt}${wt}-select`]:{borderRadius:"50%"}}}};var Be=it=>{const{componentCls:wt}=it;return{[`${wt}-rtl`]:{direction:"rtl"}}};const Ae=it=>{const{componentCls:wt,colorTextDisabled:Et}=it;return{[`${wt}-wrapper`]:Object.assign(Object.assign({},(0,hr.Wf)(it)),{[wt]:{outline:0,"input[type='file']":{cursor:"pointer"}},[`${wt}-select`]:{display:"inline-block"},[`${wt}-disabled`]:{color:Et,cursor:"not-allowed"}})}};var Ie=(0,Tr.Z)("Upload",it=>{const{fontSizeHeading3:wt,fontSize:Et,lineHeight:At,lineWidth:nn,controlHeightLG:_t}=it,tn=Math.round(Et*At),Oe=(0,Hr.TS)(it,{uploadThumbnailSize:wt*2,uploadProgressOffset:tn/2+nn,uploadPicCardSize:_t*2.55});return[Ae(Oe),Mr(Oe),wr(Oe),ct(Oe),Or(Oe),lr(Oe),Be(Oe),(0,kr.Z)(Oe)]},it=>({actionsColor:it.colorTextDescription})),Xe=function(it,wt,Et,At){function nn(_t){return _t instanceof Et?_t:new Et(function(tn){tn(_t)})}return new(Et||(Et=Promise))(function(_t,tn){function Oe(Ot){try{xt(At.next(Ot))}catch(Dt){tn(Dt)}}function yt(Ot){try{xt(At.throw(Ot))}catch(Dt){tn(Dt)}}function xt(Ot){Ot.done?_t(Ot.value):nn(Ot.value).then(Oe,yt)}xt((At=At.apply(it,wt||[])).next())})};const dt=`__LIST_IGNORE_${Date.now()}__`,Ht=(it,wt)=>{const{fileList:Et,defaultFileList:At,onRemove:nn,showUploadList:_t=!0,listType:tn="text",onPreview:Oe,onDownload:yt,onChange:xt,onDrop:Ot,previewFile:Dt,disabled:Nt,locale:zt,iconRender:gn,isImageUrl:wn,progress:Dn,prefixCls:zn,className:er,type:cr="select",children:Un,style:Pn,itemRender:fr,maxCount:tr,data:yr={},multiple:Gn=!1,action:Xn="",accept:br="",supportServerRender:ur=!0,rootClassName:Br}=it,Gr=fe.useContext(Ke.Z),ar=Nt!=null?Nt:Gr,[En,kn]=(0,on.Z)(At||[],{value:Et,postState:Xr=>Xr!=null?Xr:[]}),[gr,nr]=fe.useState("drop"),_r=fe.useRef(null);fe.useMemo(()=>{const Xr=Date.now();(Et||[]).forEach((ei,Ai)=>{!ei.uid&&!Object.isFrozen(ei)&&(ei.uid=`__AUTO__${Xr}_${Ai}__`)})},[Et]);const Lr=(Xr,ei,Ai)=>{let ai=(0,Ze.Z)(ei),fi=!1;tr===1?ai=ai.slice(-1):tr&&(fi=ai.length>tr,ai=ai.slice(0,tr)),(0,sn.flushSync)(()=>{kn(ai)});const _i={file:Xr,fileList:ai};Ai&&(_i.event=Ai),(!fi||ai.some(pi=>pi.uid===Xr.uid))&&(0,sn.flushSync)(()=>{xt==null||xt(_i)})},Ir=(Xr,ei)=>Xe(void 0,void 0,void 0,function*(){const{beforeUpload:Ai,transformFile:ai}=it;let fi=Xr;if(Ai){const _i=yield Ai(Xr,ei);if(_i===!1)return!1;if(delete Xr[dt],_i===dt)return Object.defineProperty(Xr,dt,{value:!0,configurable:!0}),!1;typeof _i=="object"&&_i&&(fi=_i)}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=>Yt(fi.file));let ai=(0,Ze.Z)(En);Ai.forEach(fi=>{ai=dn(fi,ai)}),Ai.forEach((fi,_i)=>{let pi=fi;if(ei[_i].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(_i){}if(!hn(ei,En))return;const ai=Yt(ei);ai.status="done",ai.percent=100,ai.response=Xr,ai.xhr=Ai;const fi=dn(ai,En);Lr(ai,fi)},ii=(Xr,ei)=>{if(!hn(ei,En))return;const Ai=Yt(ei);Ai.status="uploading",Ai.percent=Xr.percent;const ai=dn(Ai,En);Lr(Ai,ai,Xr)},Hn=(Xr,ei,Ai)=>{if(!hn(Ai,En))return;const ai=Yt(Ai);ai.error=Xr,ai.response=ei,ai.status="error";const fi=dn(ai,En);Lr(ai,fi)},qn=Xr=>{let ei;Promise.resolve(typeof nn=="function"?nn(Xr):nn).then(Ai=>{var ai;if(Ai===!1)return;const fi=_n(Xr,En);fi&&(ei=Object.assign(Object.assign({},Xr),{status:"removed"}),En==null||En.forEach(_i=>{const pi=ei.uid!==void 0?"uid":"name";_i[pi]===ei[pi]&&!Object.isFrozen(_i)&&(_i.status="removed")}),(ai=_r.current)===null||ai===void 0||ai.abort(ei),Lr(ei,fi))})},Dr=Xr=>{nr(Xr.type),Xr.type==="drop"&&(Ot==null||Ot(Xr))};fe.useImperativeHandle(wt,()=>({onBatchStart:pr,onSuccess:Sr,onProgress:ii,onError:Hn,fileList:En,upload:_r.current}));const{getPrefixCls:$r,direction:li,upload:di}=fe.useContext(jt.E_),ri=$r("upload",zn),Jr=Object.assign(Object.assign({onBatchStart:pr,onError:Hn,onProgress:ii,onSuccess:Sr},it),{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]=Ie(ri),[Yn]=(0,xe.Z)("Upload",bt.Z.Upload),{showRemoveIcon:Vn,showPreviewIcon:Zn,showDownloadIcon:mr,removeIcon:ni,previewIcon:xi,downloadIcon:Mi}=typeof _t=="boolean"?{}:_t,gi=(Xr,ei)=>_t?fe.createElement(Tn,{prefixCls:ri,listType:tn,items:En,previewFile:Dt,onPreview:Oe,onDownload:yt,onRemove:qn,showRemoveIcon:!ar&&Vn,showPreviewIcon:Zn,showDownloadIcon:mr,removeIcon:ni,previewIcon:xi,downloadIcon:Mi,iconRender:gn,locale:Object.assign(Object.assign({},Yn),zt),isImageUrl:wn,progress:Dn,appendAction:Xr,appendActionVisible:ei,itemRender:fr,disabled:ar}):Xr,ci=tt()(`${ri}-wrapper`,er,Br,bi,di==null?void 0:di.className,{[`${ri}-rtl`]:li==="rtl",[`${ri}-picture-card-wrapper`]:tn==="picture-card",[`${ri}-picture-circle-wrapper`]:tn==="picture-circle"}),ki=Object.assign(Object.assign({},di==null?void 0:di.style),Pn);if(cr==="drag"){const Xr=tt()(bi,ri,`${ri}-drag`,{[`${ri}-drag-uploading`]:En.some(ei=>ei.status==="uploading"),[`${ri}-drag-hover`]:gr==="dragover",[`${ri}-disabled`]:ar,[`${ri}-rtl`]:li==="rtl"});return yi(fe.createElement("span",{className:ci},fe.createElement("div",{className:Xr,style:ki,onDrop:Dr,onDragOver:Dr,onDragLeave:Dr},fe.createElement(mn,Object.assign({},Jr,{ref:_r,className:`${ri}-btn`}),fe.createElement("div",{className:`${ri}-drag-container`},Un))),gi()))}const Hi=tt()(ri,`${ri}-select`,{[`${ri}-disabled`]:ar}),oa=(Xr=>fe.createElement("div",{className:Hi,style:Xr},fe.createElement(mn,Object.assign({},Jr,{ref:_r}))))(Un?void 0:{display:"none"});return yi(tn==="picture-card"||tn==="picture-circle"?fe.createElement("span",{className:ci},gi(oa,!!Un)):fe.createElement("span",{className:ci},oa,gi()))};var Wt=fe.forwardRef(Ht),vn=function(it,wt){var Et={};for(var At in it)Object.prototype.hasOwnProperty.call(it,At)&&wt.indexOf(At)<0&&(Et[At]=it[At]);if(it!=null&&typeof Object.getOwnPropertySymbols=="function")for(var nn=0,At=Object.getOwnPropertySymbols(it);nn<At.length;nn++)wt.indexOf(At[nn])<0&&Object.prototype.propertyIsEnumerable.call(it,At[nn])&&(Et[At[nn]]=it[At[nn]]);return Et},Cn=fe.forwardRef((it,wt)=>{var{style:Et,height:At}=it,nn=vn(it,["style","height"]);return fe.createElement(Wt,Object.assign({ref:wt},nn,{type:"drag",style:Object.assign(Object.assign({},Et),{height:At})}))});const Lt=Wt;Lt.Dragger=Cn,Lt.LIST_IGNORE=dt;var ln=Lt},99498:function(Mn,Qt,ue){(function(fe){fe(ue(89780))})(function(fe){fe.defineOption("placeholder","",function(Se,Me,Pe){var rt=Pe&&Pe!=fe.Init;if(Me&&!rt)Se.on("blur",be),Se.on("change",Le),Se.on("swapDoc",Le),fe.on(Se.getInputField(),"compositionupdate",Se.state.placeholderCompose=function(){tt(Se)}),Le(Se);else if(!Me&&rt){Se.off("blur",be),Se.off("change",Le),Se.off("swapDoc",Le),fe.off(Se.getInputField(),"compositionupdate",Se.state.placeholderCompose),Ze(Se);var Te=Se.getWrapperElement();Te.className=Te.className.replace(" CodeMirror-empty","")}Me&&!Se.hasFocus()&&be(Se)});function Ze(Se){Se.state.placeholder&&(Se.state.placeholder.parentNode.removeChild(Se.state.placeholder),Se.state.placeholder=null)}function Fe(Se){Ze(Se);var Me=Se.state.placeholder=document.createElement("pre");Me.style.cssText="height: 0; overflow: visible",Me.style.direction=Se.getOption("direction"),Me.className="CodeMirror-placeholder CodeMirror-line-like";var Pe=Se.getOption("placeholder");typeof Pe=="string"&&(Pe=document.createTextNode(Pe)),Me.appendChild(Pe),Se.display.lineSpace.insertBefore(Me,Se.display.lineSpace.firstChild)}function tt(Se){setTimeout(function(){var Me=!1,Pe=Se.getInputField();Pe.nodeName=="TEXTAREA"?Me=!Pe.value:Se.lineCount()==1&&(Me=!/[^\u200b]/.test(Pe.querySelector(".CodeMirror-line").textContent)),Me?Fe(Se):Ze(Se)},20)}function be(Se){Re(Se)&&Fe(Se)}function Le(Se){var Me=Se.getWrapperElement(),Pe=Re(Se);Me.className=Me.className.replace(" CodeMirror-empty","")+(Pe?" CodeMirror-empty":""),Pe?Fe(Se):Ze(Se)}function Re(Se){return Se.lineCount()===1&&Se.getLine(0)===""}})},25717:function(Mn,Qt,ue){(function(fe){fe(ue(89780))})(function(fe){var Ze={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},Fe=fe.Pos;fe.defineOption("autoCloseBrackets",!1,function(Je,lt,st){st&&st!=fe.Init&&(Je.removeKeyMap(be),Je.state.closeBrackets=null),lt&&(Le(tt(lt,"pairs")),Je.state.closeBrackets=lt,Je.addKeyMap(be))});function tt(Je,lt){return lt=="pairs"&&typeof Je=="string"?Je:typeof Je=="object"&&Je[lt]!=null?Je[lt]:Ze[lt]}var be={Backspace:Me,Enter:Pe};function Le(Je){for(var lt=0;lt<Je.length;lt++){var st=Je.charAt(lt),Rt="'"+st+"'";be[Rt]||(be[Rt]=Re(st))}}Le(Ze.pairs+"`");function Re(Je){return function(lt){return Te(lt,Je)}}function Se(Je){var lt=Je.state.closeBrackets;if(!lt||lt.override)return lt;var st=Je.getModeAt(Je.getCursor());return st.closeBrackets||lt}function Me(Je){var lt=Se(Je);if(!lt||Je.getOption("disableInput"))return fe.Pass;for(var st=tt(lt,"pairs"),Rt=Je.listSelections(),qt=0;qt<Rt.length;qt++){if(!Rt[qt].empty())return fe.Pass;var at=He(Je,Rt[qt].head);if(!at||st.indexOf(at)%2!=0)return fe.Pass}for(var qt=Rt.length-1;qt>=0;qt--){var ft=Rt[qt].head;Je.replaceRange("",Fe(ft.line,ft.ch-1),Fe(ft.line,ft.ch+1),"+delete")}}function Pe(Je){var lt=Se(Je),st=lt&&tt(lt,"explode");if(!st||Je.getOption("disableInput"))return fe.Pass;for(var Rt=Je.listSelections(),qt=0;qt<Rt.length;qt++){if(!Rt[qt].empty())return fe.Pass;var at=He(Je,Rt[qt].head);if(!at||st.indexOf(at)%2!=0)return fe.Pass}Je.operation(function(){var ft=Je.lineSeparator()||`
`;Je.replaceSelection(ft+ft,null),Je.execCommand("goCharLeft"),Rt=Je.listSelections();for(var Ve=0;Ve<Rt.length;Ve++){var _e=Rt[Ve].head.line;Je.indentLine(_e,null,!0),Je.indentLine(_e+1,null,!0)}})}function rt(Je){var lt=fe.cmpPos(Je.anchor,Je.head)>0;return{anchor:new Fe(Je.anchor.line,Je.anchor.ch+(lt?-1:1)),head:new Fe(Je.head.line,Je.head.ch+(lt?1:-1))}}function Te(Je,lt){var st=Se(Je);if(!st||Je.getOption("disableInput"))return fe.Pass;var Rt=tt(st,"pairs"),qt=Rt.indexOf(lt);if(qt==-1)return fe.Pass;for(var at=tt(st,"closeBefore"),ft=tt(st,"triples"),Ve=Rt.charAt(qt+1)==lt,_e=Je.listSelections(),We=qt%2==0,et,Mt=0;Mt<_e.length;Mt++){var Qe=_e[Mt],Kt=Qe.head,ut,Pt=Je.getRange(Kt,Fe(Kt.line,Kt.ch+1));if(We&&!Qe.empty())ut="surround";else if((Ve||!We)&&Pt==lt)Ve&&ht(Je,Kt)?ut="both":ft.indexOf(lt)>=0&&Je.getRange(Kt,Fe(Kt.line,Kt.ch+3))==lt+lt+lt?ut="skipThree":ut="skip";else if(Ve&&Kt.ch>1&&ft.indexOf(lt)>=0&&Je.getRange(Fe(Kt.line,Kt.ch-2),Kt)==lt+lt){if(Kt.ch>2&&/\bstring/.test(Je.getTokenTypeAt(Fe(Kt.line,Kt.ch-2))))return fe.Pass;ut="addFour"}else if(Ve){var nt=Kt.ch==0?" ":Je.getRange(Fe(Kt.line,Kt.ch-1),Kt);if(!fe.isWordChar(Pt)&&nt!=lt&&!fe.isWordChar(nt))ut="both";else return fe.Pass}else if(We&&(Pt.length===0||/\s/.test(Pt)||at.indexOf(Pt)>-1))ut="both";else return fe.Pass;if(!et)et=ut;else if(et!=ut)return fe.Pass}var Gt=qt%2?Rt.charAt(qt-1):lt,mn=qt%2?lt:Rt.charAt(qt+1);Je.operation(function(){if(et=="skip")Je.execCommand("goCharRight");else if(et=="skipThree")for(var on=0;on<3;on++)Je.execCommand("goCharRight");else if(et=="surround"){for(var sn=Je.getSelections(),on=0;on<sn.length;on++)sn[on]=Gt+sn[on]+mn;Je.replaceSelections(sn,"around"),sn=Je.listSelections().slice();for(var on=0;on<sn.length;on++)sn[on]=rt(sn[on]);Je.setSelections(sn)}else et=="both"?(Je.replaceSelection(Gt+mn,null),Je.triggerElectric(Gt+mn),Je.execCommand("goCharLeft")):et=="addFour"&&(Je.replaceSelection(Gt+Gt+Gt+Gt,"before"),Je.execCommand("goCharRight"))})}function He(Je,lt){var st=Je.getRange(Fe(lt.line,lt.ch-1),Fe(lt.line,lt.ch+1));return st.length==2?st:null}function ht(Je,lt){var st=Je.getTokenAt(Fe(lt.line,lt.ch+1));return/\bstring/.test(st.type)&&st.start==lt.ch&&(lt.ch==0||!/\bstring/.test(Je.getTokenTypeAt(lt)))}})},6313:function(Mn,Qt,ue){(function(fe){fe(ue(89780),ue(32855))})(function(fe){fe.defineOption("autoCloseTags",!1,function(Me,Pe,rt){if(rt!=fe.Init&&rt&&Me.removeKeyMap("autoCloseTags"),!!Pe){var Te={name:"autoCloseTags"};(typeof Pe!="object"||Pe.whenClosing!==!1)&&(Te["'/'"]=function(He){return Le(He)}),(typeof Pe!="object"||Pe.whenOpening!==!1)&&(Te["'>'"]=function(He){return tt(He)}),Me.addKeyMap(Te)}});var Ze=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],Fe=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function tt(Me){if(Me.getOption("disableInput"))return fe.Pass;for(var Pe=Me.listSelections(),rt=[],Te=Me.getOption("autoCloseTags"),He=0;He<Pe.length;He++){if(!Pe[He].empty())return fe.Pass;var ht=Pe[He].head,Je=Me.getTokenAt(ht),lt=fe.innerMode(Me.getMode(),Je.state),st=lt.state,Rt=lt.mode.xmlCurrentTag&&lt.mode.xmlCurrentTag(st),qt=Rt&&Rt.name;if(!qt)return fe.Pass;var at=lt.mode.configuration=="html",ft=typeof Te=="object"&&Te.dontCloseTags||at&&Ze,Ve=typeof Te=="object"&&Te.indentTags||at&&Fe;Je.end>ht.ch&&(qt=qt.slice(0,qt.length-Je.end+ht.ch));var _e=qt.toLowerCase();if(!qt||Je.type=="string"&&(Je.end!=ht.ch||!/[\"\']/.test(Je.string.charAt(Je.string.length-1))||Je.string.length==1)||Je.type=="tag"&&Rt.close||Je.string.indexOf("/")==ht.ch-Je.start-1||ft&&Re(ft,_e)>-1||Se(Me,lt.mode.xmlCurrentContext&&lt.mode.xmlCurrentContext(st)||[],qt,ht,!0))return fe.Pass;var We=typeof Te=="object"&&Te.emptyTags;if(We&&Re(We,qt)>-1){rt[He]={text:"/>",newPos:fe.Pos(ht.line,ht.ch+2)};continue}var et=Ve&&Re(Ve,_e)>-1;rt[He]={indent:et,text:">"+(et?`
`:"")+"</"+qt+">",newPos:et?fe.Pos(ht.line+1,0):fe.Pos(ht.line,ht.ch+1)}}for(var Mt=typeof Te=="object"&&Te.dontIndentOnAutoClose,He=Pe.length-1;He>=0;He--){var Qe=rt[He];Me.replaceRange(Qe.text,Pe[He].head,Pe[He].anchor,"+insert");var Kt=Me.listSelections().slice(0);Kt[He]={head:Qe.newPos,anchor:Qe.newPos},Me.setSelections(Kt),!Mt&&Qe.indent&&(Me.indentLine(Qe.newPos.line,null,!0),Me.indentLine(Qe.newPos.line+1,null,!0))}}function be(Me,Pe){for(var rt=Me.listSelections(),Te=[],He=Pe?"/":"</",ht=Me.getOption("autoCloseTags"),Je=typeof ht=="object"&&ht.dontIndentOnSlash,lt=0;lt<rt.length;lt++){if(!rt[lt].empty())return fe.Pass;var st=rt[lt].head,Rt=Me.getTokenAt(st),qt=fe.innerMode(Me.getMode(),Rt.state),at=qt.state;if(Pe&&(Rt.type=="string"||Rt.string.charAt(0)!="<"||Rt.start!=st.ch-1))return fe.Pass;var ft,Ve=qt.mode.name!="xml"&&Me.getMode().name=="htmlmixed";if(Ve&&qt.mode.name=="javascript")ft=He+"script";else if(Ve&&qt.mode.name=="css")ft=He+"style";else{var _e=qt.mode.xmlCurrentContext&&qt.mode.xmlCurrentContext(at);if(!_e||_e.length&&Se(Me,_e,_e[_e.length-1],st))return fe.Pass;ft=He+_e[_e.length-1]}Me.getLine(st.line).charAt(Rt.end)!=">"&&(ft+=">"),Te[lt]=ft}if(Me.replaceSelections(Te),rt=Me.listSelections(),!Je)for(var lt=0;lt<rt.length;lt++)(lt==rt.length-1||rt[lt].head.line<rt[lt+1].head.line)&&Me.indentLine(rt[lt].head.line)}function Le(Me){return Me.getOption("disableInput")?fe.Pass:be(Me,!0)}fe.commands.closeTag=function(Me){return be(Me)};function Re(Me,Pe){if(Me.indexOf)return Me.indexOf(Pe);for(var rt=0,Te=Me.length;rt<Te;++rt)if(Me[rt]==Pe)return rt;return-1}function Se(Me,Pe,rt,Te,He){if(!fe.scanForClosingTag)return!1;var ht=Math.min(Me.lastLine()+1,Te.line+500),Je=fe.scanForClosingTag(Me,Te,null,ht);if(!Je||Je.tag!=rt)return!1;for(var lt=He?1:0,st=Pe.length-1;st>=0&&Pe[st]==rt;st--)++lt;Te=Je.to;for(var st=1;st<lt;st++){var Rt=fe.scanForClosingTag(Me,Te,null,ht);if(!Rt||Rt.tag!=rt)return!1;Te=Rt.to}return!0}})},32855:function(Mn,Qt,ue){(function(fe){fe(ue(89780))})(function(fe){"use strict";var Ze=fe.Pos;function Fe(st,Rt){return st.line-Rt.line||st.ch-Rt.ch}var tt="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=tt+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Le=new RegExp("<(/?)(["+tt+"]["+be+"]*)","g");function Re(st,Rt,qt,at){this.line=Rt,this.ch=qt,this.cm=st,this.text=st.getLine(Rt),this.min=at?Math.max(at.from,st.firstLine()):st.firstLine(),this.max=at?Math.min(at.to-1,st.lastLine()):st.lastLine()}function Se(st,Rt){var qt=st.cm.getTokenTypeAt(Ze(st.line,Rt));return qt&&/\btag\b/.test(qt)}function Me(st){if(!(st.line>=st.max))return st.ch=0,st.text=st.cm.getLine(++st.line),!0}function Pe(st){if(!(st.line<=st.min))return st.text=st.cm.getLine(--st.line),st.ch=st.text.length,!0}function rt(st){for(;;){var Rt=st.text.indexOf(">",st.ch);if(Rt==-1){if(Me(st))continue;return}if(!Se(st,Rt+1)){st.ch=Rt+1;continue}var qt=st.text.lastIndexOf("/",Rt),at=qt>-1&&!/\S/.test(st.text.slice(qt+1,Rt));return st.ch=Rt+1,at?"selfClose":"regular"}}function Te(st){for(;;){var Rt=st.ch?st.text.lastIndexOf("<",st.ch-1):-1;if(Rt==-1){if(Pe(st))continue;return}if(!Se(st,Rt+1)){st.ch=Rt;continue}Le.lastIndex=Rt,st.ch=Rt;var qt=Le.exec(st.text);if(qt&&qt.index==Rt)return qt}}function He(st){for(;;){Le.lastIndex=st.ch;var Rt=Le.exec(st.text);if(!Rt){if(Me(st))continue;return}if(!Se(st,Rt.index+1)){st.ch=Rt.index+1;continue}return st.ch=Rt.index+Rt[0].length,Rt}}function ht(st){for(;;){var Rt=st.ch?st.text.lastIndexOf(">",st.ch-1):-1;if(Rt==-1){if(Pe(st))continue;return}if(!Se(st,Rt+1)){st.ch=Rt;continue}var qt=st.text.lastIndexOf("/",Rt),at=qt>-1&&!/\S/.test(st.text.slice(qt+1,Rt));return st.ch=Rt+1,at?"selfClose":"regular"}}function Je(st,Rt){for(var qt=[];;){var at=He(st),ft,Ve=st.line,_e=st.ch-(at?at[0].length:0);if(!at||!(ft=rt(st)))return;if(ft!="selfClose")if(at[1]){for(var We=qt.length-1;We>=0;--We)if(qt[We]==at[2]){qt.length=We;break}if(We<0&&(!Rt||Rt==at[2]))return{tag:at[2],from:Ze(Ve,_e),to:Ze(st.line,st.ch)}}else qt.push(at[2])}}function lt(st,Rt){for(var qt=[];;){var at=ht(st);if(!at)return;if(at=="selfClose"){Te(st);continue}var ft=st.line,Ve=st.ch,_e=Te(st);if(!_e)return;if(_e[1])qt.push(_e[2]);else{for(var We=qt.length-1;We>=0;--We)if(qt[We]==_e[2]){qt.length=We;break}if(We<0&&(!Rt||Rt==_e[2]))return{tag:_e[2],from:Ze(st.line,st.ch),to:Ze(ft,Ve)}}}}fe.registerHelper("fold","xml",function(st,Rt){for(var qt=new Re(st,Rt.line,0);;){var at=He(qt);if(!at||qt.line!=Rt.line)return;var ft=rt(qt);if(!ft)return;if(!at[1]&&ft!="selfClose"){var Ve=Ze(qt.line,qt.ch),_e=Je(qt,at[2]);return _e&&Fe(_e.from,Ve)>0?{from:Ve,to:_e.from}:null}}}),fe.findMatchingTag=function(st,Rt,qt){var at=new Re(st,Rt.line,Rt.ch,qt);if(!(at.text.indexOf(">")==-1&&at.text.indexOf("<")==-1)){var ft=rt(at),Ve=ft&&Ze(at.line,at.ch),_e=ft&&Te(at);if(!(!ft||!_e||Fe(at,Rt)>0)){var We={from:Ze(at.line,at.ch),to:Ve,tag:_e[2]};return ft=="selfClose"?{open:We,close:null,at:"open"}:_e[1]?{open:lt(at,_e[2]),close:We,at:"close"}:(at=new Re(st,Ve.line,Ve.ch,qt),{open:We,close:Je(at,_e[2]),at:"open"})}}},fe.findEnclosingTag=function(st,Rt,qt,at){for(var ft=new Re(st,Rt.line,Rt.ch,qt);;){var Ve=lt(ft,at);if(!Ve)break;var _e=new Re(st,Rt.line,Rt.ch,qt),We=Je(_e,Ve.tag);if(We)return{open:Ve,close:We}}},fe.scanForClosingTag=function(st,Rt,qt,at){var ft=new Re(st,Rt.line,Rt.ch,at?{from:0,to:at}:null);return Je(ft,qt)}})},89780:function(Mn){(function(Qt,ue){Mn.exports=ue()})(this,function(){"use strict";var Qt=navigator.userAgent,ue=navigator.platform,fe=/gecko\/\d/i.test(Qt),Ze=/MSIE \d/.test(Qt),Fe=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Qt),tt=/Edge\/(\d+)/.exec(Qt),be=Ze||Fe||tt,Le=be&&(Ze?document.documentMode||6:+(tt||Fe)[1]),Re=!tt&&/WebKit\//.test(Qt),Se=Re&&/Qt\/\d+\.\d+/.test(Qt),Me=!tt&&/Chrome\//.test(Qt),Pe=/Opera\//.test(Qt),rt=/Apple Computer/.test(navigator.vendor),Te=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Qt),He=/PhantomJS/.test(Qt),ht=!tt&&/AppleWebKit/.test(Qt)&&/Mobile\/\w+/.test(Qt),Je=/Android/.test(Qt),lt=ht||Je||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Qt),st=ht||/Mac/.test(ue),Rt=/\bCrOS\b/.test(Qt),qt=/win/i.test(ue),at=Pe&&Qt.match(/Version\/(\d*\.\d*)/);at&&(at=Number(at[1])),at&&at>=15&&(Pe=!1,Re=!0);var ft=st&&(Se||Pe&&(at==null||at<12.11)),Ve=fe||be&&Le>=9;function _e(x){return new RegExp("(^|\\s)"+x+"(?:$|\\s)\\s*")}var We=function(x,z){var ne=x.className,te=_e(z).exec(ne);if(te){var ie=ne.slice(te.index+te[0].length);x.className=ne.slice(0,te.index)+(ie?te[1]+ie:"")}};function et(x){for(var z=x.childNodes.length;z>0;--z)x.removeChild(x.firstChild);return x}function Mt(x,z){return et(x).appendChild(z)}function Qe(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 Kt(x,z,ne,te){var ie=Qe(x,z,ne,te);return ie.setAttribute("role","presentation"),ie}var ut;document.createRange?ut=function(x,z,ne,te){var ie=document.createRange();return ie.setEnd(te||x,ne),ie.setStart(x,z),ie}:ut=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 Pt(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 nt(){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 Gt(x,z){var ne=x.className;_e(z).test(ne)||(x.className+=(ne?" ":"")+z)}function mn(x,z){for(var ne=x.split(" "),te=0;te<ne.length;te++)ne[te]&&!_e(ne[te]).test(z)&&(z+=" "+ne[te]);return z}var on=function(x){x.select()};ht?on=function(x){x.selectionStart=0,x.selectionEnd=x.value.length}:be&&(on=function(x){try{x.select()}catch(z){}});function sn(x){var z=Array.prototype.slice.call(arguments,1);return function(){return x.apply(null,z)}}function jt(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 Ke(x,z,ne,te,ie){z==null&&(z=x.search(/[^\s\u00a0]/),z==-1&&(z=x.length));for(var ce=te||0,ve=ie||0;;){var Ce=x.indexOf(" ",ce);if(Ce<0||Ce>=z)return ve+(z-ce);ve+=Ce-ce,ve+=ne-ve%ne,ce=Ce+1}}var xe=function(){this.id=null,this.f=null,this.time=0,this.handler=sn(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 bt(x,z){for(var ne=0;ne<x.length;++ne)if(x[ne]==z)return ne;return-1}var fn=50,Xt={toString:function(){return"CodeMirror.Pass"}},qe={scroll:!1},je={origin:"*mouse"},gt={origin:"+move"};function en(x,z,ne){for(var te=0,ie=0;;){var ce=x.indexOf(" ",te);ce==-1&&(ce=x.length);var ve=ce-te;if(ce==x.length||ie+ve>=z)return te+Math.min(ve,z-ie);if(ie+=ce-te,ie+=ne-ie%ne,te=ce+1,ie>=z)return te}}var Zt=[""];function pn(x){for(;Zt.length<=x;)Zt.push(Vt(Zt)+" ");return Zt[x]}function Vt(x){return x[x.length-1]}function Ft(x,z){for(var ne=[],te=0;te<x.length;te++)ne[te]=z(x[te],te);return ne}function Tt(x,z,ne){for(var te=0,ie=ne(z);te<x.length&&ne(x[te])<=ie;)te++;x.splice(te,0,z)}function ge(){}function se(x,z){var ne;return Object.create?ne=Object.create(x):(ge.prototype=x,ne=new ge),z&&jt(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 pe(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 De=/[\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 ot(x){return x.charCodeAt(0)>=768&&De.test(x)}function $t(x,z,ne){for(;(ne<0?z>0:z<x.length)&&ot(x.charAt(z));)z+=ne;return z}function It(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 Ut(x,z,ne,te){if(!x)return te(z,ne,"ltr",0);for(var ie=!1,ce=0;ce<x.length;++ce){var ve=x[ce];(ve.from<ne&&ve.to>z||z==ne&&ve.to==z)&&(te(Math.max(ve.from,z),Math.min(ve.to,ne),ve.level==1?"rtl":"ltr",ce),ie=!0)}ie||te(z,ne,"ltr")}var Yt=null;function dn(x,z,ne){var te;Yt=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:Yt=ie),ce.from==z&&(ce.from!=ce.to&&ne!="before"?te=ie:Yt=ie)}return te!=null?te:Yt}var hn=function(){var x="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",z="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function ne($e){return $e<=247?x.charAt($e):1424<=$e&&$e<=1524?"R":1536<=$e&&$e<=1785?z.charAt($e-1536):1774<=$e&&$e<=2220?"r":8192<=$e&&$e<=8203?"w":$e==8204?"b":"L"}var te=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,ie=/[stwN]/,ce=/[LRr]/,ve=/[Lb1n]/,Ce=/[1n]/;function Ee($e,pt,Ct){this.level=$e,this.from=pt,this.to=Ct}return function($e,pt){var Ct=pt=="ltr"?"L":"R";if($e.length==0||pt=="ltr"&&!te.test($e))return!1;for(var un=$e.length,an=[],On=0;On<un;++On)an.push(ne($e.charCodeAt(On)));for(var Wn=0,vr=Ct;Wn<un;++Wn){var Ar=an[Wn];Ar=="m"?an[Wn]=vr:vr=Ar}for(var Rr=0,Cr=Ct;Rr<un;++Rr){var Kr=an[Rr];Kr=="1"&&Cr=="r"?an[Rr]="n":ce.test(Kr)&&(Cr=Kr,Kr=="r"&&(an[Rr]="R"))}for(var Qr=1,ti=an[0];Qr<un-1;++Qr){var Ci=an[Qr];Ci=="+"&&ti=="1"&&an[Qr+1]=="1"?an[Qr]="1":Ci==","&&ti==an[Qr+1]&&(ti=="1"||ti=="n")&&(an[Qr]=ti),ti=Ci}for(var qi=0;qi<un;++qi){var Na=an[qi];if(Na==",")an[qi]="N";else if(Na=="%"){var da=void 0;for(da=qi+1;da<un&&an[da]=="%";++da);for(var co=qi&&an[qi-1]=="!"||da<un&&an[da]=="1"?"1":"N",uo=qi;uo<da;++uo)an[uo]=co;qi=da-1}}for(var _a=0,ho=Ct;_a<un;++_a){var hi=an[_a];ho=="L"&&hi=="1"?an[_a]="L":ce.test(hi)&&(ho=hi)}for(var ma=0;ma<un;++ma)if(ie.test(an[ma])){var ha=void 0;for(ha=ma+1;ha<un&&ie.test(an[ha]);++ha);for(var ga=(ma?an[ma-1]:Ct)=="L",ba=(ha<un?an[ha]:Ct)=="L",fl=ga==ba?ga?"L":"R":Ct,vo=ma;vo<ha;++vo)an[vo]=fl;ma=ha-1}for(var Za=[],$i,Pa=0;Pa<un;)if(ve.test(an[Pa])){var au=Pa;for(++Pa;Pa<un&&ve.test(an[Pa]);++Pa);Za.push(new Ee(0,au,Pa))}else{var bs=Pa,Ns=Za.length,Yo=pt=="rtl"?1:0;for(++Pa;Pa<un&&an[Pa]!="L";++Pa);for(var ka=bs;ka<Pa;)if(Ce.test(an[ka])){bs<ka&&(Za.splice(Ns,0,new Ee(1,bs,ka)),Ns+=Yo);var pl=ka;for(++ka;ka<Pa&&Ce.test(an[ka]);++ka);Za.splice(Ns,0,new Ee(2,pl,ka)),Ns+=Yo,bs=ka}else++ka;bs<Pa&&Za.splice(Ns,0,new Ee(1,bs,Pa))}return pt=="ltr"&&(Za[0].level==1&&($i=$e.match(/^\s+/))&&(Za[0].from=$i[0].length,Za.unshift(new Ee(0,0,$i[0].length))),Vt(Za).level==1&&($i=$e.match(/\s+$/))&&(Vt(Za).to-=$i[0].length,Za.push(new Ee(0,un-$i[0].length,un)))),pt=="rtl"?Za.reverse():Za}}();function _n(x,z){var ne=x.order;return ne==null&&(ne=x.order=hn(x.text,z)),ne}var vt=[],cn=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]||vt).concat(ne)}};function Sn(x,z){return x._handlers&&x._handlers[z]||vt}function Ye(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=bt(ie,ne);ce>-1&&(te[z]=ie.slice(0,ce).concat(ie.slice(ce+1)))}}}function ze(x,z){var ne=Sn(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 Ue(x,z,ne){return typeof z=="string"&&(z={type:z,preventDefault:function(){this.defaultPrevented=!0}}),ze(x,ne||z.type,x,z),Ln(z)||z.codemirrorIgnore}function Bt(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)bt(ne,z[te])==-1&&ne.push(z[te])}function Jt(x,z){return Sn(x,z).length>0}function rn(x){x.prototype.on=function(z,ne){cn(this,z,ne)},x.prototype.off=function(z,ne){Ye(this,z,ne)}}function An(x){x.preventDefault?x.preventDefault():x.returnValue=!1}function In(x){x.stopPropagation?x.stopPropagation():x.cancelBubble=!0}function Ln(x){return x.defaultPrevented!=null?x.defaultPrevented:x.returnValue==!1}function Fn(x){An(x),In(x)}function jn(x){return x.target||x.srcElement}function Tn(x){var z=x.which;return z==null&&(x.button&1?z=1:x.button&2?z=3:x.button&4&&(z=2)),st&&x.ctrlKey&&z==1&&(z=3),z}var hr=function(){if(be&&Le<9)return!1;var x=Qe("div");return"draggable"in x||"dragDrop"in x}(),kr;function Tr(x){if(kr==null){var z=Qe("span","\u200B");Mt(x,Qe("span",[z,document.createTextNode("x")])),x.firstChild.offsetHeight!=0&&(kr=z.offsetWidth<=1&&z.offsetHeight>2&&!(be&&Le<8))}var ne=kr?Qe("span","\u200B"):Qe("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=Mt(x,document.createTextNode("A\u062EA")),ne=ut(z,0,1).getBoundingClientRect(),te=ut(z,1,2).getBoundingClientRect();return et(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),ve=ce.indexOf("\r");ve!=-1?(ne.push(ce.slice(0,ve)),z+=ve+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=Qe("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=Mt(x,Qe("span","x")),ne=z.getBoundingClientRect(),te=ut(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 ve in z.modeProps)te[ve]=z.modeProps[ve];return te}var wr={};function ct(x,z){var ne=wr.hasOwnProperty(x)?wr[x]:wr[x]={};jt(z,ne)}function ke(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 Be(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 Ae(x,z,ne){return x.startState?x.startState(z,ne):!0}var Ie=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};Ie.prototype.eol=function(){return this.pos>=this.string.length},Ie.prototype.sol=function(){return this.pos==this.lineStart},Ie.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ie.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ie.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},Ie.prototype.eatWhile=function(x){for(var z=this.pos;this.eat(x););return this.pos>z},Ie.prototype.eatSpace=function(){for(var x=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>x},Ie.prototype.skipToEnd=function(){this.pos=this.string.length},Ie.prototype.skipTo=function(x){var z=this.string.indexOf(x,this.pos);if(z>-1)return this.pos=z,!0},Ie.prototype.backUp=function(x){this.pos-=x},Ie.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Ke(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Ke(this.string,this.lineStart,this.tabSize):0)},Ie.prototype.indentation=function(){return Ke(this.string,null,this.tabSize)-(this.lineStart?Ke(this.string,this.lineStart,this.tabSize):0)},Ie.prototype.match=function(x,z,ne){if(typeof x=="string"){var te=function(ve){return ne?ve.toLowerCase():ve},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)}},Ie.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ie.prototype.hideFirstChars=function(x,z){this.lineStart+=x;try{return z()}finally{this.lineStart-=x}},Ie.prototype.lookAhead=function(x){var z=this.lineOracle;return z&&z.lookAhead(x)},Ie.prototype.baseToken=function(){var x=this.lineOracle;return x&&x.baseToken(this.pos)};function Xe(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 ve=ce.text;ie==ne.line&&(ve=ve.slice(0,ne.ch)),ie==z.line&&(ve=ve.slice(z.ch)),te.push(ve),++ie}),te}function Ht(x,z,ne){var te=[];return x.iter(z,ne,function(ie){te.push(ie.text)}),te}function kt(x,z){var ne=z-x.height;if(ne)for(var te=x;te;te=te.parent)te.height+=ne}function Wt(x){if(x.parent==null)return null;for(var z=x.parent,ne=bt(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 vn(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 ve=0;ve<x.lines.length;++ve){var Ce=x.lines[ve],Ee=Ce.height;if(z<Ee)break;z-=Ee}return ne+ve}function xn(x,z){return z>=x.first&&z<x.first+x.size}function Cn(x,z){return String(x.lineNumberFormatter(z+x.firstLineNumber))}function Lt(x,z,ne){if(ne===void 0&&(ne=null),!(this instanceof Lt))return new Lt(x,z,ne);this.line=x,this.ch=z,this.sticky=ne}function ln(x,z){return x.line-z.line||x.ch-z.ch}function it(x,z){return x.sticky==z.sticky&&ln(x,z)==0}function wt(x){return Lt(x.line,x.ch)}function Et(x,z){return ln(x,z)<0?z:x}function At(x,z){return ln(x,z)<0?x:z}function nn(x,z){return Math.max(x.first,Math.min(z,x.first+x.size-1))}function _t(x,z){if(z.line<x.first)return Lt(x.first,0);var ne=x.first+x.size-1;return z.line>ne?Lt(ne,Xe(x,ne).text.length):tn(z,Xe(x,z.line).text.length)}function tn(x,z){var ne=x.ch;return ne==null||ne>z?Lt(x.line,z):ne<0?Lt(x.line,0):x}function Oe(x,z){for(var ne=[],te=0;te<z.length;te++)ne[te]=_t(x,z[te]);return ne}var yt=function(x,z){this.state=x,this.lookAhead=z},xt=function(x,z,ne,te){this.state=z,this.doc=x,this.line=ne,this.maxLookAhead=te||0,this.baseTokens=null,this.baseTokenPos=1};xt.prototype.lookAhead=function(x){var z=this.doc.getLine(this.line+x);return z!=null&&x>this.maxLookAhead&&(this.maxLookAhead=x),z},xt.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}},xt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},xt.fromSaved=function(x,z,ne){return z instanceof yt?new xt(x,ke(x.mode,z.state),ne,z.lookAhead):new xt(x,ke(x.mode,z),ne)},xt.prototype.save=function(x){var z=x!==!1?ke(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new yt(z,this.maxLookAhead):z};function Ot(x,z,ne,te){var ie=[x.state.modeGen],ce={};cr(x,z.text,x.doc.mode,ne,function($e,pt){return ie.push($e,pt)},ce,te);for(var ve=ne.state,Ce=function($e){ne.baseTokens=ie;var pt=x.state.overlays[$e],Ct=1,un=0;ne.state=!0,cr(x,z.text,pt.mode,ne,function(an,On){for(var Wn=Ct;un<an;){var vr=ie[Ct];vr>an&&ie.splice(Ct,1,an,ie[Ct+1],vr),Ct+=2,un=Math.min(an,vr)}if(On)if(pt.opaque)ie.splice(Wn,Ct-Wn,an,"overlay "+On),Ct=Wn+2;else for(;Wn<Ct;Wn+=2){var Ar=ie[Wn+1];ie[Wn+1]=(Ar?Ar+" ":"")+"overlay "+On}},ce),ne.state=ve,ne.baseTokens=null,ne.baseTokenPos=1},Ee=0;Ee<x.state.overlays.length;++Ee)Ce(Ee);return{styles:ie,classes:ce.bgClass||ce.textClass?ce:null}}function Dt(x,z,ne){if(!z.styles||z.styles[0]!=x.state.modeGen){var te=Nt(x,Wt(z)),ie=z.text.length>x.options.maxHighlightLength&&ke(x.doc.mode,te.state),ce=Ot(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 Nt(x,z,ne){var te=x.doc,ie=x.display;if(!te.mode.startState)return new xt(te,!0,z);var ce=Un(x,z,ne),ve=ce>te.first&&Xe(te,ce-1).stateAfter,Ce=ve?xt.fromSaved(te,ve,ce):new xt(te,Ae(te.mode),ce);return te.iter(ce,z,function(Ee){zt(x,Ee.text,Ce);var $e=Ce.line;Ee.stateAfter=$e==z-1||$e%5==0||$e>=ie.viewFrom&&$e<ie.viewTo?Ce.save():null,Ce.nextLine()}),ne&&(te.modeFrontier=Ce.line),Ce}function zt(x,z,ne,te){var ie=x.doc.mode,ce=new Ie(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=Be(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]=Be(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 Dn=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,ve;z=_t(ie,z);var Ce=Xe(ie,z.line),Ee=Nt(x,z.line,ne),$e=new Ie(Ce.text,x.options.tabSize,Ee),pt;for(te&&(pt=[]);(te||$e.pos<z.ch)&&!$e.eol();)$e.start=$e.pos,ve=wn(ce,$e,Ee.state),te&&pt.push(new Dn($e,ve,ke(ie.mode,Ee.state)));return te?pt:new Dn($e,ve,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,ve){var Ce=ne.flattenSpans;Ce==null&&(Ce=x.options.flattenSpans);var Ee=0,$e=null,pt=new Ie(z,x.options.tabSize,te),Ct,un=x.options.addModeClass&&[null];for(z==""&&er(gn(ne,te.state),ce);!pt.eol();){if(pt.pos>x.options.maxHighlightLength?(Ce=!1,ve&&zt(x,z,te,pt.pos),pt.pos=z.length,Ct=null):Ct=er(wn(ne,pt,te.state,un),ce),un){var an=un[0].name;an&&(Ct="m-"+(Ct?an+" "+Ct:an))}if(!Ce||$e!=Ct){for(;Ee<pt.start;)Ee=Math.min(pt.start,Ee+5e3),ie(Ee,$e);$e=Ct}pt.start=pt.pos}for(;Ee<pt.pos;){var On=Math.min(pt.pos,Ee+5e3);ie(On,$e),Ee=On}}function Un(x,z,ne){for(var te,ie,ce=x.doc,ve=ne?-1:z-(x.doc.mode.innerMode?1e3:100),Ce=z;Ce>ve;--Ce){if(Ce<=ce.first)return ce.first;var Ee=Xe(ce,Ce-1),$e=Ee.stateAfter;if($e&&(!ne||Ce+($e instanceof yt?$e.lookAhead:0)<=ce.modeFrontier))return Ce;var pt=Ke(Ee.text,null,x.options.tabSize);(ie==null||te>pt)&&(ie=Ce-1,te=pt)}return ie}function Pn(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=Xe(x,te).stateAfter;if(ie&&(!(ie instanceof yt)||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],ve=ce.marker,Ce=ce.from==null||(ve.inclusiveLeft?ce.from<=z:ce.from<z);if(Ce||ce.from==z&&ve.type=="bookmark"&&(!ne||!ce.marker.insertLeft)){var Ee=ce.to==null||(ve.inclusiveRight?ce.to>=z:ce.to>z);(te||(te=[])).push(new Xn(ve,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],ve=ce.marker,Ce=ce.to==null||(ve.inclusiveRight?ce.to>=z:ce.to>z);if(Ce||ce.from==z&&ve.type=="bookmark"&&(!ne||ce.marker.insertLeft)){var Ee=ce.from==null||(ve.inclusiveLeft?ce.from<=z:ce.from<z);(te||(te=[])).push(new Xn(ve,Ee?null:ce.from-z,ce.to==null?null:ce.to-z))}}return te}function En(x,z){if(z.full)return null;var ne=xn(x,z.from.line)&&Xe(x,z.from.line).markedSpans,te=xn(x,z.to.line)&&Xe(x,z.to.line).markedSpans;if(!ne&&!te)return null;var ie=z.from.ch,ce=z.to.ch,ve=ln(z.from,z.to)==0,Ce=Gr(ne,ie,ve),Ee=ar(te,ce,ve),$e=z.text.length==1,pt=Vt(z.text).length+($e?ie:0);if(Ce)for(var Ct=0;Ct<Ce.length;++Ct){var un=Ce[Ct];if(un.to==null){var an=br(Ee,un.marker);an?$e&&(un.to=an.to==null?null:an.to+pt):un.to=ie}}if(Ee)for(var On=0;On<Ee.length;++On){var Wn=Ee[On];if(Wn.to!=null&&(Wn.to+=pt),Wn.from==null){var vr=br(Ce,Wn.marker);vr||(Wn.from=pt,$e&&(Ce||(Ce=[])).push(Wn))}else Wn.from+=pt,$e&&(Ce||(Ce=[])).push(Wn)}Ce&&(Ce=kn(Ce)),Ee&&Ee!=Ce&&(Ee=kn(Ee));var Ar=[Ce];if(!$e){var Rr=z.text.length-2,Cr;if(Rr>0&&Ce)for(var Kr=0;Kr<Ce.length;++Kr)Ce[Kr].to==null&&(Cr||(Cr=[])).push(new Xn(Ce[Kr].marker,null,null));for(var Qr=0;Qr<Rr;++Qr)Ar.push(Cr);Ar.push(Ee)}return Ar}function kn(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(an){if(an.markedSpans)for(var On=0;On<an.markedSpans.length;++On){var Wn=an.markedSpans[On].marker;Wn.readOnly&&(!te||bt(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 ve=te[ce],Ce=ve.find(0),Ee=0;Ee<ie.length;++Ee){var $e=ie[Ee];if(!(ln($e.to,Ce.from)<0||ln($e.from,Ce.to)>0)){var pt=[Ee,1],Ct=ln($e.from,Ce.from),un=ln($e.to,Ce.to);(Ct<0||!ve.inclusiveLeft&&!Ct)&&pt.push({from:$e.from,to:Ce.from}),(un>0||!ve.inclusiveRight&&!un)&&pt.push({from:Ce.to,to:$e.to}),ie.splice.apply(ie,pt),Ee+=pt.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 _r(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=ln(te.from,ie.from)||Lr(x)-Lr(z);if(ce)return-ce;var ve=ln(te.to,ie.to)||Ir(x)-Ir(z);return ve||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=Xe(x,z),ve=tr&&ce.markedSpans;if(ve)for(var Ce=0;Ce<ve.length;++Ce){var Ee=ve[Ce];if(Ee.marker.collapsed){var $e=Ee.marker.find(0),pt=ln($e.from,ne)||Lr(Ee.marker)-Lr(ie),Ct=ln($e.to,te)||Ir(Ee.marker)-Ir(ie);if(!(pt>=0&&Ct<=0||pt<=0&&Ct>=0)&&(pt<=0&&(Ee.marker.inclusiveRight&&ie.inclusiveLeft?ln($e.to,ne)>=0:ln($e.to,ne)>0)||pt>=0&&(Ee.marker.inclusiveRight&&ie.inclusiveLeft?ln($e.from,te)<=0:ln($e.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=Xe(x,z),te=$r(ne);return ne==te?z:Wt(te)}function Jr(x,z){if(z>x.lastLine())return z;var ne=Xe(x,z),te;if(!yi(x,ne))return z;for(;te=Hn(ne);)ne=te.find(1,!0).line;return Wt(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 ve=0;ve<ce.children.length;++ve){var Ce=ce.children[ve];if(Ce==ne)break;z+=Ce.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=Xe(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,_r(this,z),this.height=ne?ne(this):1};mr.prototype.lineNo=function(){return Wt(this)},rn(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),_r(x,ne);var ie=te?te(x):1;ie!=x.height&&kt(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 ki(x,z){var ne=Kt("span",null,null,Re?"padding-right: .1px":null),te={pre:Kt("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,ve=void 0;te.pos=0,te.addToken=Ni,sr(x.display.measure)&&(ve=_n(ce,x.doc.direction))&&(te.addToken=Xr(te.addToken,ve)),te.map=[];var Ce=z!=x.display.externalMeasured&&Wt(ce);Ai(ce,te,Dt(x,ce,Ce)),ce.styleClasses&&(ce.styleClasses.bgClass&&(te.bgClass=mn(ce.styleClasses.bgClass,te.bgClass||"")),ce.styleClasses.textClass&&(te.textClass=mn(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(Re){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 ze(x,"renderLine",x,z.line,te.pre),te.pre.className&&(te.textClass=mn(te.pre.className,te.textClass||"")),te}function Hi(x){var z=Qe("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,ve){if(z){var Ce=x.splitSpaces?oa(z,x.trailingSpace):z,Ee=x.cm.state.specialChars,$e=!1,pt;if(!Ee.test(z))x.col+=z.length,pt=document.createTextNode(Ce),x.map.push(x.pos,x.pos+z.length,pt),be&&Le<9&&($e=!0),x.pos+=z.length;else{pt=document.createDocumentFragment();for(var Ct=0;;){Ee.lastIndex=Ct;var un=Ee.exec(z),an=un?un.index-Ct:z.length-Ct;if(an){var On=document.createTextNode(Ce.slice(Ct,Ct+an));be&&Le<9?pt.appendChild(Qe("span",[On])):pt.appendChild(On),x.map.push(x.pos,x.pos+an,On),x.col+=an,x.pos+=an}if(!un)break;Ct+=an+1;var Wn=void 0;if(un[0]==" "){var vr=x.cm.options.tabSize,Ar=vr-x.col%vr;Wn=pt.appendChild(Qe("span",pn(Ar),"cm-tab")),Wn.setAttribute("role","presentation"),Wn.setAttribute("cm-text"," "),x.col+=Ar}else un[0]=="\r"||un[0]==`
`?(Wn=pt.appendChild(Qe("span",un[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Wn.setAttribute("cm-text",un[0]),x.col+=1):(Wn=x.cm.options.specialCharPlaceholder(un[0]),Wn.setAttribute("cm-text",un[0]),be&&Le<9?pt.appendChild(Qe("span",[Wn])):pt.appendChild(Wn),x.col+=1);x.map.push(x.pos,x.pos+1,Wn),x.pos++}}if(x.trailingSpace=Ce.charCodeAt(z.length-1)==32,ne||te||ie||$e||ce||ve){var Rr=ne||"";te&&(Rr+=te),ie&&(Rr+=ie);var Cr=Qe("span",[pt],Rr,ce);if(ve)for(var Kr in ve)ve.hasOwnProperty(Kr)&&Kr!="style"&&Kr!="class"&&Cr.setAttribute(Kr,ve[Kr]);return x.content.appendChild(Cr)}x.content.appendChild(pt)}}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,ve,Ce,Ee){ie=ie?ie+" cm-force-border":"cm-force-border";for(var $e=ne.pos,pt=$e+te.length;;){for(var Ct=void 0,un=0;un<z.length&&(Ct=z[un],!(Ct.to>$e&&Ct.from<=$e));un++);if(Ct.to>=pt)return x(ne,te,ie,ce,ve,Ce,Ee);x(ne,te.slice(0,Ct.to-$e),ie,ce,null,Ce,Ee),ce=null,te=te.slice(Ct.to-$e),$e=Ct.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 ve=1;ve<ne.length;ve+=2)z.addToken(z,ie.slice(ce,ce=ne[ve]),ci(ne[ve+1],z.cm.options));return}for(var Ce=ie.length,Ee=0,$e=1,pt="",Ct,un,an=0,On,Wn,vr,Ar,Rr;;){if(an==Ee){On=Wn=vr=un="",Rr=null,Ar=null,an=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&&an>ti.to&&(an=ti.to,Wn=""),Ci.className&&(On+=" "+Ci.className),Ci.css&&(un=(un?un+";":"")+Ci.css),Ci.startStyle&&ti.from==Ee&&(vr+=" "+Ci.startStyle),Ci.endStyle&&ti.to==an&&(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&&an>ti.from&&(an=ti.from)}if(Kr)for(var Na=0;Na<Kr.length;Na+=2)Kr[Na+1]==an&&(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?Ce+1:Ar.to)-Ee,Ar.marker,Ar.from==null),Ar.to==null)return;Ar.to==Ee&&(Ar=!1)}}if(Ee>=Ce)break;for(var co=Math.min(Ce,an);;){if(pt){var uo=Ee+pt.length;if(!Ar){var _a=uo>co?pt.slice(0,co-Ee):pt;z.addToken(z,_a,Ct?Ct+On:On,vr,Ee+_a.length==an?Wn:"",un,Rr)}if(uo>=co){pt=pt.slice(co-Ee),Ee=co;break}Ee=uo,vr=""}pt=ie.slice(ce,ce=ne[$e++]),Ct=ci(ne[$e++],z.cm.options)}}}function ai(x,z,ne){this.line=z,this.rest=di(z),this.size=this.rest?Wt(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 ve=new ai(x.doc,Xe(x.doc,ce),ce);ie=ce+ve.size,te.push(ve)}return te}var _i=null;function pi(x){_i?_i.ops.push(x):x.ownsGroup=_i={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{_i=null,z(ne)}}var Ur=null;function zr(x,z){var ne=Sn(x,z);if(ne.length){var te=Array.prototype.slice.call(arguments,2),ie;_i?ie=_i.delayedCallbacks:Ur?ie=Ur:(ie=Ur=[],setTimeout(ui,0));for(var ce=function(Ce){ie.push(function(){return ne[Ce].apply(null,te)})},ve=0;ve<ne.length;++ve)ce(ve)}}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=Qe("div",null,null,"position: relative"),x.text.parentNode&&x.text.parentNode.replaceChild(x.node,x.text),x.node.appendChild(x.text),be&&Le<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(Qe("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):ki(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=Qe("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 ve=zi(z),Ce=z.gutter=Qe("div",null,"CodeMirror-gutter-wrapper","left: "+(x.options.fixedGutter?te.fixedPos:-te.gutterTotalWidth)+"px");if(x.display.input.setUneditable(Ce),ve.insertBefore(Ce,z.text),z.line.gutterClass&&(Ce.className+=" "+z.line.gutterClass),x.options.lineNumbers&&(!ce||!ce["CodeMirror-linenumbers"])&&(z.lineNumber=Ce.appendChild(Qe("div",Cn(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 $e=x.display.gutterSpecs[Ee].className,pt=ce.hasOwnProperty($e)&&ce[$e];pt&&Ce.appendChild(Qe("div",[pt],"CodeMirror-gutter-elt","left: "+te.gutterLeft[$e]+"px; width: "+te.gutterWidth[$e]+"px"))}}}function Gi(x,z,ne){z.alignable&&(z.alignable=null);for(var te=_e("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),ve=0,Ce=z.widgets;ve<Ce.length;++ve){var Ee=Ce[ve],$e=Qe("div",[Ee.node],"CodeMirror-linewidget"+(Ee.className?" "+Ee.className:""));Ee.handleMouseEvents||$e.setAttribute("cm-ignore-events","true"),ts(Ee,$e,ne,te),x.display.input.setUneditable($e),ie&&Ee.above?ce.insertBefore($e,ne.gutter||ne.text):ce.appendChild($e),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(!Pt(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;"),Mt(z.display.measure,Qe("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=Mt(x.measure,Qe("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 fn-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 ko(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 ve=z.text.firstChild.getClientRects(),Ce=0;Ce<ve.length-1;Ce++){var Ee=ve[Ce],$e=ve[Ce+1];Math.abs(Ee.bottom-$e.bottom)>2&&ce.push((Ee.bottom+$e.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(Wt(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=Wt(z),te=x.display.externalMeasured=new ai(x.doc,z,ne);te.lineN=ne;var ie=te.built=ki(x,te);return te.text=ie.pre,Mt(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=Wt(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||""),ve;return z.cache.hasOwnProperty(ce)?ve=z.cache[ce]:(z.rect||(z.rect=z.view.text.getBoundingClientRect()),z.hasHeights||(ko(x,z.view,z.rect),z.hasHeights=!0),ve=Ei(x,z,ne,te),ve.bogus||(z.cache[ce]=ve)),{left:ve.left,right:ve.right,top:ie?ve.rtop:ve.top,bottom:ie?ve.rbottom:ve.bottom}}var Lo={left:0,right:0,top:0,bottom:0};function rs(x,z,ne){for(var te,ie,ce,ve,Ce,Ee,$e=0;$e<x.length;$e+=3)if(Ce=x[$e],Ee=x[$e+1],z<Ce?(ie=0,ce=1,ve="left"):z<Ee?(ie=z-Ce,ce=ie+1):($e==x.length-3||z==Ee&&x[$e+3]>z)&&(ce=Ee-Ce,ie=ce-1,z>=Ee&&(ve="right")),ie!=null){if(te=x[$e+2],Ce==Ee&&ne==(te.insertLeft?"left":"right")&&(ve=ne),ne=="left"&&ie==0)for(;$e&&x[$e-2]==x[$e-3]&&x[$e-1].insertLeft;)te=x[($e-=3)+2],ve="left";if(ne=="right"&&ie==Ee-Ce)for(;$e<x.length-3&&x[$e+3]==x[$e+4]&&!x[$e+5].insertLeft;)te=x[($e+=3)+2],ve="right";break}return{node:te,start:ie,end:ce,collapse:ve,coverStart:Ce,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,ve=ie.start,Ce=ie.end,Ee=ie.collapse,$e;if(ce.nodeType==3){for(var pt=0;pt<4;pt++){for(;ve&&ot(z.line.text.charAt(ie.coverStart+ve));)--ve;for(;ie.coverStart+Ce<ie.coverEnd&&ot(z.line.text.charAt(ie.coverStart+Ce));)++Ce;if(be&&Le<9&&ve==0&&Ce==ie.coverEnd-ie.coverStart?$e=ce.parentNode.getBoundingClientRect():$e=Do(ut(ce,ve,Ce).getClientRects(),te),$e.left||$e.right||ve==0)break;Ce=ve,ve=ve-1,Ee="right"}be&&Le<11&&($e=mi(x.display.measure,$e))}else{ve>0&&(Ee=te="right");var Ct;x.options.lineWrapping&&(Ct=ce.getClientRects()).length>1?$e=Ct[te=="right"?Ct.length-1:0]:$e=ce.getBoundingClientRect()}if(be&&Le<9&&!ve&&(!$e||!$e.left&&!$e.right)){var un=ce.parentNode.getClientRects()[0];un?$e={left:un.left,right:un.left+Ii(x.display),top:un.top,bottom:un.bottom}:$e=Lo}for(var an=$e.top-z.rect.top,On=$e.bottom-z.rect.top,Wn=(an+On)/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"?$e.right:$e.left)-z.rect.left,right:(Ee=="left"?$e.left:$e.right)-z.rect.left,top:Rr,bottom:Cr};return!$e.left&&!$e.right&&(Kr.bogus=!0),x.options.singleCursorHeightPerLine||(Kr.rtop=an,Kr.rbottom=On),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,et(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&&Je?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Fa(){return Me&&Je?-(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 ve=Yn(z);if(te=="local"?ve+=eo(x.display):ve-=x.display.viewOffset,te=="page"||te=="window"){var Ce=x.display.lineSpace.getBoundingClientRect();ve+=Ce.top+(te=="window"?0:Fa());var Ee=Ce.left+(te=="window"?0:$a());ne.left+=Ee,ne.right+=Ee}return ne.top+=ve,ne.bottom+=ve,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 ve=x.display.lineSpace.getBoundingClientRect();return{left:te-ve.left,top:ie-ve.top}}function lo(x,z,ne,te,ie){return te||(te=Xe(x.doc,z.line)),Ra(x,te,$o(x,te,z.ch,ie),ne)}function Da(x,z,ne,te,ie,ce){te=te||Xe(x.doc,z.line),ie||(ie=Oa(x,te));function ve(On,Wn){var vr=Oi(x,ie,On,Wn?"right":"left",ce);return Wn?vr.left=vr.right:vr.right=vr.left,Ra(x,te,vr,ne)}var Ce=_n(te,x.doc.direction),Ee=z.ch,$e=z.sticky;if(Ee>=te.text.length?(Ee=te.text.length,$e="before"):Ee<=0&&(Ee=0,$e="after"),!Ce)return ve($e=="before"?Ee-1:Ee,$e=="before");function pt(On,Wn,vr){var Ar=Ce[Wn],Rr=Ar.level==1;return ve(vr?On-1:On,Rr!=vr)}var Ct=dn(Ce,Ee,$e),un=Yt,an=pt(Ee,Ct,$e=="before");return un!=null&&(an.other=pt(Ee,un,$e!="before")),an}function bl(x,z){var ne=0;z=_t(x.doc,z),x.options.lineWrapping||(ne=Ii(x.display)*z.ch);var te=Xe(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=Lt(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=vn(te,ne),ce=te.first+te.size-1;if(ie>ce)return jo(te.first+te.size-1,Xe(te,ce).text.length,null,1,1);z<0&&(z=0);for(var ve=Xe(te,ie);;){var Ce=_c(x,ve,ie,z,ne),Ee=qn(ve,Ce.ch+(Ce.xRel>0||Ce.outside>0?1:0));if(!Ee)return Ce;var $e=Ee.find(1);if($e.line==ie)return $e;ve=Xe(te,ie=$e.line)}}function Kl(x,z,ne,te){te-=to(z);var ie=z.text.length,ce=It(function(ve){return Oi(x,ne,ve-1).bottom<=te},ie,0);return ie=It(function(ve){return Oi(x,ne,ve).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 _c(x,z,ne,te,ie){ie-=Yn(z);var ce=Oa(x,z),ve=to(z),Ce=0,Ee=z.text.length,$e=!0,pt=_n(z,x.doc.direction);if(pt){var Ct=(x.options.lineWrapping?xl:is)(x,z,ne,ce,pt,te,ie);$e=Ct.level!=1,Ce=$e?Ct.from:Ct.to-1,Ee=$e?Ct.to:Ct.from-1}var un=null,an=null,On=It(function(Qr){var ti=Oi(x,ce,Qr);return ti.top+=ve,ti.bottom+=ve,Cs(ti,te,ie,!1)?(ti.top<=ie&&ti.left<=te&&(un=Qr,an=ti),!0):!1},Ce,Ee),Wn,vr,Ar=!1;if(an){var Rr=te-an.left<an.right-te,Cr=Rr==$e;On=un+(Cr?0:1),vr=Cr?"after":"before",Wn=Rr?an.left:an.right}else{!$e&&(On==Ee||On==Ce)&&On++,vr=On==0?"after":On==z.text.length?"before":Oi(x,ce,On-($e?1:0)).bottom+ve<=ie==$e?"after":"before";var Kr=Da(x,Lt(ne,On,vr),"line",z,ce);Wn=Kr.left,Ar=ie<Kr.top?-1:ie>=Kr.bottom?1:0}return On=$t(z.text,On,1),jo(ne,On,vr,Ar,te-Wn)}function is(x,z,ne,te,ie,ce,ve){var Ce=It(function(Ct){var un=ie[Ct],an=un.level!=1;return Cs(Da(x,Lt(ne,an?un.to:un.from,an?"before":"after"),"line",z,te),ce,ve,!0)},0,ie.length-1),Ee=ie[Ce];if(Ce>0){var $e=Ee.level!=1,pt=Da(x,Lt(ne,$e?Ee.from:Ee.to,$e?"after":"before"),"line",z,te);Cs(pt,ce,ve,!0)&&pt.top>ve&&(Ee=ie[Ce-1])}return Ee}function xl(x,z,ne,te,ie,ce,ve){var Ce=Kl(x,z,te,ve),Ee=Ce.begin,$e=Ce.end;/\s/.test(z.text.charAt($e-1))&&$e--;for(var pt=null,Ct=null,un=0;un<ie.length;un++){var an=ie[un];if(!(an.from>=$e||an.to<=Ee)){var On=an.level!=1,Wn=Oi(x,te,On?Math.min($e,an.to)-1:Math.max(Ee,an.from)).right,vr=Wn<ce?ce-Wn+1e9:Wn-ce;(!pt||Ct>vr)&&(pt=an,Ct=vr)}}return pt||(pt=ie[ie.length-1]),pt.from<Ee&&(pt={from:Ee,to:pt.to,level:pt.level}),pt.to>$e&&(pt={from:pt.from,to:$e,level:pt.level}),pt}var Vo;function as(x){if(x.cachedTextHeight!=null)return x.cachedTextHeight;if(Vo==null){Vo=Qe("pre",null,"CodeMirror-line-like");for(var z=0;z<49;++z)Vo.appendChild(document.createTextNode("x")),Vo.appendChild(Qe("br"));Vo.appendChild(document.createTextNode("x"))}Mt(x.measure,Vo);var ne=Vo.offsetHeight/50;return ne>3&&(x.cachedTextHeight=ne),et(x.measure),ne||1}function Ii(x){if(x.cachedCharWidth!=null)return x.cachedCharWidth;var z=Qe("span","xxxxxxxxxx"),ne=Qe("pre",[z],"CodeMirror-line-like");Mt(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,ve=0;ce;ce=ce.nextSibling,++ve){var Ce=x.display.gutterSpecs[ve].className;ne[Ce]=ce.offsetLeft+ce.clientLeft+ie,te[Ce]=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 ve=0;ve<ie.widgets.length;ve++)ie.widgets[ve].height&&(ce+=ie.widgets[ve].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&&kt(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,ve,Ce=ie.lineSpace.getBoundingClientRect();try{ce=z.clientX-Ce.left,ve=z.clientY-Ce.top}catch(Ct){return null}var Ee=Js(x,ce,ve),$e;if(te&&Ee.xRel>0&&($e=Xe(x.doc,Ee.line).text).length==Ee.ch){var pt=Ke($e,$e.length,x.options.tabSize)-$e.length;Ee=Lt(Ee.line,Math.max(0,Math.round((ce-fo(x.display).left)/Ii(x.display))-pt))}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 ve=wo(x,z,z,-1);ve?(ie.view=ie.view.slice(0,ve.index),ie.viewTo=ve.lineN):To(x)}else{var Ce=wo(x,z,z,-1),Ee=wo(x,ne,ne+te,1);Ce&&Ee?(ie.view=ie.view.slice(0,Ce.index).concat(fi(x,Ce.lineN,Ee.lineN)).concat(ie.view.slice(Ee.index)),ie.viewTo+=te):To(x)}var $e=ie.externalMeasured;$e&&(ne<$e.lineN?$e.lineN+=te:z<$e.lineN+$e.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 ve=ce.changes||(ce.changes=[]);bt(ve,ne)==-1&&ve.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,ve=x.display.view;if(!tr||ne==x.doc.first+x.doc.size)return{index:ie,lineN:ne};for(var Ce=x.display.viewFrom,Ee=0;Ee<ie;Ee++)Ce+=ve[Ee].size;if(Ce!=z){if(te>0){if(ie==ve.length-1)return null;ce=Ce+ve[ie].size-z,ie++}else ce=Ce-z;z+=ce,ne+=ce}for(;ri(x.doc,ne)!=ne;){if(ie==(te<0?0:ve.length-1))return null;ne+=te*ve[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 _u(x,z){z===void 0&&(z=!0);for(var ne=x.doc,te={},ie=te.cursors=document.createDocumentFragment(),ce=te.selection=document.createDocumentFragment(),ve=0;ve<ne.sel.ranges.length;ve++)if(!(!z&&ve==ne.sel.primIndex)){var Ce=ne.sel.ranges[ve];if(!(Ce.from().line>=x.display.viewTo||Ce.to().line<x.display.viewFrom)){var Ee=Ce.empty();(Ee||x.options.showCursorWhenSelecting)&&ku(x,Ce.head,ie),Ee||Od(x,Ce,ce)}}return te}function ku(x,z,ne){var te=Da(x,z,"div",null,null,!x.options.singleCursorHeightPerLine),ie=ne.appendChild(Qe("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(Qe("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(),ve=fo(x.display),Ce=ve.left,Ee=Math.max(te.sizerWidth,fa(x)-te.sizer.offsetLeft)-ve.right,$e=ie.direction=="ltr";function pt(Cr,Kr,Qr,ti){Kr<0&&(Kr=0),Kr=Math.round(Kr),ti=Math.round(ti),ce.appendChild(Qe("div",null,"CodeMirror-selected","position: absolute; left: "+Cr+`px;
top: `+Kr+"px; width: "+(Qr==null?Ee-Cr:Qr)+`px;
height: `+(ti-Kr)+"px"))}function Ct(Cr,Kr,Qr){var ti=Xe(ie,Cr),Ci=ti.text.length,qi,Na;function da(_a,ho){return lo(x,Lt(Cr,_a),"div",ti,ho)}function co(_a,ho,hi){var ma=Hl(x,ti,null,_a),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=_n(ti,ie.direction);return Ut(uo,Kr||0,Qr==null?Ci:Qr,function(_a,ho,hi,ma){var ha=hi=="ltr",ga=da(_a,ha?"left":"right"),ba=da(ho-1,ha?"right":"left"),fl=Kr==null&&_a==0,vo=Qr==null&&ho==Ci,Za=ma==0,$i=!uo||ma==uo.length-1;if(ba.top-ga.top<=3){var Pa=($e?fl:vo)&&Za,au=($e?vo:fl)&&$i,bs=Pa?Ce:(ha?ga:ba).left,Ns=au?Ee:(ha?ba:ga).right;pt(bs,ga.top,Ns-bs,ga.bottom)}else{var Yo,ka,pl,ja;ha?(Yo=$e&&fl&&Za?Ce:ga.left,ka=$e?Ee:co(_a,hi,"before"),pl=$e?Ce:co(ho,hi,"after"),ja=$e&&vo&&$i?Ee:ba.right):(Yo=$e?co(_a,hi,"before"):Ce,ka=!$e&&fl&&Za?Ee:ga.right,pl=!$e&&vo&&$i?Ce:ba.left,ja=$e?co(ho,hi,"after"):Ee),pt(Yo,ga.top,ka-Yo,ga.bottom),ga.bottom<ba.top&&pt(Ce,ga.bottom,null,ba.top),pt(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 un=z.from(),an=z.to();if(un.line==an.line)Ct(un.line,un.ch,an.ch);else{var On=Xe(ie,un.line),Wn=Xe(ie,an.line),vr=$r(On)==$r(Wn),Ar=Ct(un.line,un.ch,vr?On.text.length+1:null).end,Rr=Ct(an.line,vr?0:null,an.ch).start;vr&&(Ar.top<Rr.top-2?(pt(Ar.right,Ar.top,null,Ar.bottom),pt(Ce,Rr.top,Rr.left,Rr.bottom)):pt(Ar.right,Ar.top,Rr.left-Ar.right,Ar.bottom)),Ar.bottom<Rr.top&&pt(Ce,Ar.bottom,null,Rr.top)}ne.appendChild(ce)}function kc(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||(ze(x,"focus",x,z),x.state.focused=!0,Gt(x.display.wrapper,"CodeMirror-focused"),!x.curOp&&x.display.selForContextMenu!=x.doc.sel&&(x.display.input.reset(),Re&&setTimeout(function(){return x.display.input.reset(!0)},20)),x.display.input.receivedFocus()),kc(x))}function qs(x,z){x.state.delayingBlurEvent||(x.state.focused&&(ze(x,"blur",x,z),x.state.focused=!1,We(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,ve=void 0,Ce=0;if(!ie.hidden){if(be&&Le<8){var Ee=ie.node.offsetTop+ie.node.offsetHeight;ve=Ee-ne,ne=Ee}else{var $e=ie.node.getBoundingClientRect();ve=$e.bottom-$e.top,!ce&&ie.text.firstChild&&(Ce=ie.text.firstChild.getBoundingClientRect().right-$e.left-1)}var pt=ie.line.height-ve;if((pt>.005||pt<-.005)&&(kt(ie.line,ve),Lu(ie.line),ie.rest))for(var Ct=0;Ct<ie.rest.length;Ct++)Lu(ie.rest[Ct]);if(Ce>x.display.sizerWidth){var un=Math.ceil(Ce/Ii(x.display));un>x.display.maxLineLength&&(x.display.maxLineLength=un,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=vn(z,te),ve=vn(z,ie);if(ne&&ne.ensure){var Ce=ne.ensure.from.line,Ee=ne.ensure.to.line;Ce<ce?(ce=Ce,ve=vn(z,Yn(Xe(z,Ce))+x.wrapper.clientHeight)):Math.min(Ee,z.lastLine())>=ve&&(ce=vn(z,Yn(Xe(z,Ee))-x.wrapper.clientHeight),ve=Ee)}return{from:ce,to:Math.max(ve,ce+1)}}function ss(x,z){if(!Ue(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&&!He){var ce=Qe("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?Lt(z.line,z.sticky=="before"?z.ch-1:z.ch,"after"):z,ne=z.sticky=="before"?Lt(z.line,z.ch+1,"before"):z);for(var ce=0;ce<5;ce++){var ve=!1,Ce=Da(x,z),Ee=!ne||ne==z?Ce:Da(x,ne);ie={left:Math.min(Ce.left,Ee.left),top:Math.min(Ce.top,Ee.top)-te,right:Math.max(Ce.left,Ee.left),bottom:Math.max(Ce.bottom,Ee.bottom)+te};var $e=Vl(x,ie),pt=x.doc.scrollTop,Ct=x.doc.scrollLeft;if($e.scrollTop!=null&&(_s(x,$e.scrollTop),Math.abs(x.doc.scrollTop-pt)>1&&(ve=!0)),$e.scrollLeft!=null&&(ks(x,$e.scrollLeft),Math.abs(x.doc.scrollLeft-Ct)>1&&(ve=!0)),!ve)break}return ie}function $d(x,z){var ne=Vl(x,z);ne.scrollTop!=null&&_s(x,ne.scrollTop),ne.scrollLeft!=null&&ks(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),ve={};z.bottom-z.top>ce&&(z.bottom=z.top+ce);var Ce=x.doc.height+Ss(ne),Ee=z.top<te,$e=z.bottom>Ce-te;if(z.top<ie)ve.scrollTop=Ee?0:z.top;else if(z.bottom>ie+ce){var pt=Math.min(z.top,($e?Ce:z.bottom)-ce);pt!=ie&&(ve.scrollTop=pt)}var Ct=x.options.fixedGutter?0:ne.gutters.offsetWidth,un=x.curOp&&x.curOp.scrollLeft!=null?x.curOp.scrollLeft:ne.scroller.scrollLeft-Ct,an=fa(x)-ne.gutters.offsetWidth,On=z.right-z.left>an;return On&&(z.right=z.left+an),z.left<10?ve.scrollLeft=0:z.left<un?ve.scrollLeft=Math.max(0,z.left+Ct-(On?0:10)):z.right>an+un-3&&(ve.scrollLeft=z.right+(On?0:10)-an),ve}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 _s(x,z){Math.abs(x.doc.scrollTop-z)<2||(fe||Tc(x,{top:z}),Au(x,z,!0),fe&&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 ks(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=Qe("div",[Qe("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),ie=this.horiz=Qe("div",[Qe("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");te.tabIndex=ie.tabIndex=-1,x(te),x(ie),cn(te,"scroll",function(){te.clientHeight&&z(te.scrollTop,"vertical")}),cn(ie,"scroll",function(){ie.clientWidth&&z(ie.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,be&&Le<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=st&&!Te?"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&&We(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),cn(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"?ks(x,z):_s(x,z)},x),x.display.scrollbars.addClass&&Gt(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 ve=0;ve<z.length;ve++)Zd(z[ve])}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&&ks(z,Math.min(z.display.scroller.scrollLeft,x.maxScrollLeft),!0),z.display.maxLineChanged=!1);var ne=x.focus&&x.focus==nt();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&&kc(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&&ks(z,x.scrollLeft,!0,!0),x.scrollToPos){var ie=Ms(z,_t(te,x.scrollToPos.from),_t(te,x.scrollToPos.to),x.scrollToPos.margin);ss(z,ie)}var ce=x.maybeHiddenMarkers,ve=x.maybeUnhiddenMarkers;if(ce)for(var Ce=0;Ce<ce.length;++Ce)ce[Ce].lines.length||ze(ce[Ce],"hide");if(ve)for(var Ee=0;Ee<ve.length;++Ee)ve[Ee].lines.length&&ze(ve[Ee],"unhide");ne.wrapper.offsetHeight&&(te.scrollTop=z.display.scroller.scrollTop),x.changeObjs&&ze(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,sn(Pu,x))}function Pu(x){var z=x.doc;if(!(z.highlightFrontier>=x.display.viewTo)){var ne=+new Date+x.options.workTime,te=Nt(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 ve=ce.styles,Ce=ce.text.length>x.options.maxHighlightLength?ke(z.mode,te.state):null,Ee=Ot(x,ce,te,!0);Ce&&(te.state=Ce),ce.styles=Ee.styles;var $e=ce.styleClasses,pt=Ee.classes;pt?ce.styleClasses=pt:$e&&(ce.styleClasses=null);for(var Ct=!ve||ve.length!=ce.styles.length||$e!=pt&&(!$e||!pt||$e.bgClass!=pt.bgClass||$e.textClass!=pt.textClass),un=0;!Ct&&un<ve.length;++un)Ct=ve[un]!=ce.styles[un];Ct&&ie.push(te.line),ce.stateAfter=te.save(),te.nextLine()}else ce.text.length<=x.options.maxHighlightLength&&zt(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){Jt(x,z)&&this.events.push(arguments)},Gl.prototype.finish=function(){for(var x=0;x<this.events.length;x++)ze.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=nt();if(!z||!Pt(x.display.lineDiv,z))return null;var ne={activeElt:z};if(window.getSelection){var te=window.getSelection();te.anchorNode&&te.extend&&Pt(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==nt())&&(x.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(x.activeElt.nodeName)&&x.anchorNode&&Pt(document.body,x.anchorNode)&&Pt(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),ve=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>ve&&ne.viewTo-ve<20&&(ve=Math.min(ie,ne.viewTo)),tr&&(ce=ri(x.doc,ce),ve=Jr(x.doc,ve));var Ce=ce!=ne.viewFrom||ve!=ne.viewTo||ne.lastWrapHeight!=z.wrapperHeight||ne.lastWrapWidth!=z.wrapperWidth;os(x,ce,ve),ne.viewOffset=Yn(Xe(x.doc,ne.viewFrom)),x.display.mover.style.top=ne.viewOffset+"px";var Ee=Wl(x);if(!Ce&&Ee==0&&!z.force&&ne.renderedView==ne.view&&(ne.updateLineNumbers==null||ne.updateLineNumbers>=ne.viewTo))return!1;var $e=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($e),et(ne.cursorDiv),et(ne.selectionDiv),ne.gutters.style.height=ne.sizer.style.minHeight=0,Ce&&(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,ve=ce.firstChild;function Ce(On){var Wn=On.nextSibling;return Re&&st&&x.display.currentWheelTarget==On?On.style.display="none":On.parentNode.removeChild(On),Wn}for(var Ee=te.view,$e=te.viewFrom,pt=0;pt<Ee.length;pt++){var Ct=Ee[pt];if(!Ct.hidden)if(!Ct.node||Ct.node.parentNode!=ce){var un=ca(x,Ct,$e,ne);ce.insertBefore(un,ve)}else{for(;ve!=Ct.node;)ve=Ce(ve);var an=ie&&z!=null&&z<=$e&&Ct.lineNumber;Ct.changes&&(bt(Ct.changes,"gutter")>-1&&(an=!1),oi(x,Ct,$e,ne)),an&&(et(Ct.lineNumber),Ct.lineNumber.appendChild(document.createTextNode(Cn(x.options,$e)))),ve=Ct.node.nextSibling}$e+=Ct.size}for(;ve;)ve=Ce(ve)}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",ve=0;ve<ne.length;ve++)if(!ne[ve].hidden){x.options.fixedGutter&&(ne[ve].gutter&&(ne[ve].gutter.style.left=ce),ne[ve].gutterBackground&&(ne[ve].gutterBackground.style.left=ce));var Ce=ne[ve].alignable;if(Ce)for(var Ee=0;Ee<Ce.length;Ee++)Ce[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=Cn(x.options,z.first+z.size-1),te=x.display;if(ne.length!=te.lineNumChars){var ie=te.measure.appendChild(Qe("div",[Qe("div",ne)],"CodeMirror-linenumber CodeMirror-gutter-elt")),ce=ie.firstChild.offsetWidth,ve=ie.offsetWidth-ce;return te.lineGutter.style.width="",te.lineNumInnerWidth=Math.max(ce,te.lineGutter.offsetWidth-ve)+1,te.lineNumWidth=te.lineNumInnerWidth+ve,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],ve=null;if(typeof ce!="string"&&(ve=ce.style,ce=ce.className),ce=="CodeMirror-linenumbers")if(z)te=!0;else continue;ne.push({className:ce,style:ve})}return z&&!te&&ne.push({className:"CodeMirror-linenumbers",style:null}),ne}function Ru(x){var z=x.gutters,ne=x.gutterSpecs;et(z),x.lineGutter=null;for(var te=0;te<ne.length;++te){var ie=ne[te],ce=ie.className,ve=ie.style,Ce=z.appendChild(Qe("div",null,"CodeMirror-gutter "+ce));ve&&(Ce.style.cssText=ve),ce=="CodeMirror-linenumbers"&&(x.lineGutter=Ce,Ce.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=Qe("div",null,"CodeMirror-scrollbar-filler"),ie.scrollbarFiller.setAttribute("cm-not-content","true"),ie.gutterFiller=Qe("div",null,"CodeMirror-gutter-filler"),ie.gutterFiller.setAttribute("cm-not-content","true"),ie.lineDiv=Kt("div",null,"CodeMirror-code"),ie.selectionDiv=Qe("div",null,null,"position: relative; z-index: 1"),ie.cursorDiv=Qe("div",null,"CodeMirror-cursors"),ie.measure=Qe("div",null,"CodeMirror-measure"),ie.lineMeasure=Qe("div",null,"CodeMirror-measure"),ie.lineSpace=Kt("div",[ie.measure,ie.lineMeasure,ie.selectionDiv,ie.cursorDiv,ie.lineDiv],null,"position: relative; outline: none");var ce=Kt("div",[ie.lineSpace],"CodeMirror-lines");ie.mover=Qe("div",[ce],null,"position: relative"),ie.sizer=Qe("div",[ie.mover],"CodeMirror-sizer"),ie.sizerWidth=null,ie.heightForcer=Qe("div",null,null,"position: absolute; height: "+fn+"px; width: 1px;"),ie.gutters=Qe("div",null,"CodeMirror-gutters"),ie.lineGutter=null,ie.scroller=Qe("div",[ie.sizer,ie.heightForcer,ie.gutters],"CodeMirror-scroll"),ie.scroller.setAttribute("tabIndex","-1"),ie.wrapper=Qe("div",[ie.scrollbarFiller,ie.gutterFiller,ie.scroller],"CodeMirror"),be&&Le<8&&(ie.gutters.style.zIndex=-1,ie.scroller.style.paddingRight=0),!Re&&!(fe&&lt)&&(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:fe?Ka=15:Me?Ka=-.7:rt&&(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,ve=ce.scroller,Ce=ve.scrollWidth>ve.clientWidth,Ee=ve.scrollHeight>ve.clientHeight;if(te&&Ce||ie&&Ee){if(ie&&st&&Re){e:for(var $e=z.target,pt=ce.view;$e!=ve;$e=$e.parentNode)for(var Ct=0;Ct<pt.length;Ct++)if(pt[Ct].node==$e){x.display.currentWheelTarget=$e;break e}}if(te&&!fe&&!Pe&&Ka!=null){ie&&Ee&&_s(x,Math.max(0,ve.scrollTop+ie*Ka)),ks(x,Math.max(0,ve.scrollLeft+te*Ka)),(!ie||ie&&Ee)&&An(z),ce.wheelStartX=null;return}if(ie&&Ka!=null){var un=ie*Ka,an=x.doc.scrollTop,On=an+ce.wrapper.clientHeight;un<0?an=Math.max(0,an+un-50):On=Math.min(x.doc.height,On+un+50),Tc(x,{top:an,bottom:On})}Yl<20&&(ce.wheelStartX==null?(ce.wheelStartX=ve.scrollLeft,ce.wheelStartY=ve.scrollTop,ce.wheelDX=te,ce.wheelDY=ie,setTimeout(function(){if(ce.wheelStartX!=null){var Wn=ve.scrollLeft-ce.wheelStartX,vr=ve.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(!it(ne.anchor,te.anchor)||!it(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(wt(this.ranges[z].anchor),wt(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(ln(z,te.from())>=0&&ln(x,te.to())<=0)return ne}return-1};var Fi=function(x,z){this.anchor=x,this.head=z};Fi.prototype.from=function(){return At(this.anchor,this.head)},Fi.prototype.to=function(){return Et(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(un,an){return ln(un.from(),an.from())}),ne=bt(z,ie);for(var ce=1;ce<z.length;ce++){var ve=z[ce],Ce=z[ce-1],Ee=ln(Ce.to(),ve.from());if(te&&!ve.empty()?Ee>0:Ee>=0){var $e=At(Ce.from(),ve.from()),pt=Et(Ce.to(),ve.to()),Ct=Ce.empty()?ve.from()==ve.head:Ce.from()==Ce.head;ce<=ne&&--ne,z.splice(--ce,2,new Fi(Ct?pt:$e,Ct?$e:pt))}}return new go(z,ne)}function Ro(x,z){return new go([new Fi(x,z||x)],0)}function us(x){return x.text?Lt(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(ln(x,z.from)<0)return x;if(ln(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),Lt(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?Lt(ne.line,x.ch-z.ch+ne.ch):Lt(ne.line+(x.line-z.line),x.ch)}function $c(x,z,ne){for(var te=[],ie=Lt(x.first,0),ce=ie,ve=0;ve<z.length;ve++){var Ce=z[ve],Ee=il(Ce.from,ie,ce),$e=il(us(Ce),ie,ce);if(ie=Ce.to,ce=$e,ne=="around"){var pt=x.sel.ranges[ve],Ct=ln(pt.head,pt.anchor)<0;te[ve]=new Fi(Ct?$e:Ee,Ct?Ee:$e)}else te[ve]=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 ve(Rr,Cr){for(var Kr=[],Qr=Rr;Qr<Cr;++Qr)Kr.push(new mr($e[Qr],ie(Qr),te));return Kr}var Ce=z.from,Ee=z.to,$e=z.text,pt=Xe(x,Ce.line),Ct=Xe(x,Ee.line),un=Vt($e),an=ie($e.length-1),On=Ee.line-Ce.line;if(z.full)x.insert(0,ve(0,$e.length)),x.remove($e.length,x.size-$e.length);else if(Ku(x,z)){var Wn=ve(0,$e.length-1);ce(Ct,Ct.text,an),On&&x.remove(Ce.line,On),Wn.length&&x.insert(Ce.line,Wn)}else if(pt==Ct)if($e.length==1)ce(pt,pt.text.slice(0,Ce.ch)+un+pt.text.slice(Ee.ch),an);else{var vr=ve(1,$e.length-1);vr.push(new mr(un+pt.text.slice(Ee.ch),an,te)),ce(pt,pt.text.slice(0,Ce.ch)+$e[0],ie(0)),x.insert(Ce.line+1,vr)}else if($e.length==1)ce(pt,pt.text.slice(0,Ce.ch)+$e[0]+Ct.text.slice(Ee.ch),ie(0)),x.remove(Ce.line+1,On);else{ce(pt,pt.text.slice(0,Ce.ch)+$e[0],ie(0)),ce(Ct,un+Ct.text.slice(Ee.ch),an);var Ar=ve(1,$e.length-1);On>1&&x.remove(Ce.line+1,On-1),x.insert(Ce.line+1,Ar)}zr(x,"change",x,z)}function ds(x,z,ne){function te(ie,ce,ve){if(ie.linked)for(var Ce=0;Ce<ie.linked.length;++Ce){var Ee=ie.linked[Ce];if(Ee.doc!=ce){var $e=ve&&Ee.sharedHist;ne&&!$e||(z(Ee.doc,$e),te(Ee.doc,ie,$e))}}}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"?Gt:We)(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:wt(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,ve,Ce;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)=="*"))&&(ve=Kc(ie,ie.lastOp==te)))Ce=Vt(ve.changes),ln(z.from,z.to)==0&&ln(z.from,Ce.to)==0?Ce.to=us(z):ve.changes.push(zc(x,z));else{var Ee=Vt(ie.done);for((!Ee||!Ee.ranges)&&tc(x.sel,ie.done),ve={changes:[zc(x,z)],generation:ie.generation},ie.done.push(ve);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,Ce||ze(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(ve){ve.markedSpans&&((ie||(ie=z["spans_"+x.id]={}))[ce]=ve.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=En(x,z);if(!ne)return te;if(!te)return ne;for(var ie=0;ie<ne.length;++ie){var ce=ne[ie],ve=te[ie];if(ce&&ve)e:for(var Ce=0;Ce<ve.length;++Ce){for(var Ee=ve[Ce],$e=0;$e<ce.length;++$e)if(ce[$e].marker==Ee.marker)continue e;ce.push(Ee)}else ve&&(ne[ie]=ve)}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 ve=ce.changes,Ce=[];te.push({changes:Ce});for(var Ee=0;Ee<ve.length;++Ee){var $e=ve[Ee],pt=void 0;if(Ce.push({from:$e.from,to:$e.to,text:$e.text}),z)for(var Ct in $e)(pt=Ct.match(/^spans_(\d+)$/))&&bt(z,Number(pt[1]))>-1&&(Vt(Ce)[Ct]=$e[Ct],delete $e[Ct])}}return te}function Vc(x,z,ne,te){if(te){var ie=x.anchor;if(ne){var ce=ln(z,ie)<0;ce!=ln(ne,ie)<0?(ie=z,z=ne):ce!=ln(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 ve=Io(x.cm,te,x.sel.primIndex);Ca(x,ve,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(_t(x,ie[ce].anchor),_t(x,ie[ce].head))},origin:ne&&ne.origin};return ze(x,"beforeSelectionChange",x,te),x.cm&&ze(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){(Jt(x,"beforeSelectionChange")||x.cm&&Jt(x.cm,"beforeSelectionChange"))&&(z=Yd(x,z,ne));var te=ne&&ne.bias||(ln(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,Bt(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 ve=z.ranges[ce],Ce=z.ranges.length==x.sel.ranges.length&&x.sel.ranges[ce],Ee=Uc(x,ve.anchor,Ce&&Ce.anchor,ne,te),$e=Uc(x,ve.head,Ce&&Ce.head,ne,te);(ie||Ee!=ve.anchor||$e!=ve.head)&&(ie||(ie=z.ranges.slice(0,ce)),ie[ce]=new Fi(Ee,$e))}return ie?Io(x.cm,ie,z.primIndex):z}function ro(x,z,ne,te,ie){var ce=Xe(x,z.line);if(ce.markedSpans)for(var ve=0;ve<ce.markedSpans.length;++ve){var Ce=ce.markedSpans[ve],Ee=Ce.marker,$e="selectLeft"in Ee?!Ee.selectLeft:Ee.inclusiveLeft,pt="selectRight"in Ee?!Ee.selectRight:Ee.inclusiveRight;if((Ce.from==null||($e?Ce.from<=z.ch:Ce.from<z.ch))&&(Ce.to==null||(pt?Ce.to>=z.ch:Ce.to>z.ch))){if(ie&&(ze(Ee,"beforeCursorEnter"),Ee.explicitlyCleared))if(ce.markedSpans){--ve;continue}else break;if(!Ee.atomic)continue;if(ne){var Ct=Ee.find(te<0?1:-1),un=void 0;if((te<0?pt:$e)&&(Ct=hs(x,Ct,-te,Ct&&Ct.line==z.line?ce:null)),Ct&&Ct.line==z.line&&(un=ln(Ct,ne))&&(te<0?un<0:un>0))return ro(x,Ct,z,te,ie)}var an=Ee.find(te<0?-1:1);return(te<0?$e:pt)&&(an=hs(x,an,te,an.line==z.line?ce:null)),an?ro(x,an,z,te,ie):null}}return z}function Uc(x,z,ne,te,ie){var ce=te||1,ve=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 ve||(x.cantEdit=!0,Lt(x.first,0))}function hs(x,z,ne,te){return ne<0&&z.ch==0?z.line>x.first?_t(x,Lt(z.line-1)):null:ne>0&&z.ch==(te||Xe(x,z.line)).text.length?z.line<x.first+x.size-1?Lt(z.line+1,0):null:new Lt(z.line,z.ch+ne)}function ju(x){x.setSelection(Lt(x.firstLine(),0),Lt(x.lastLine()),qe)}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,ve,Ce){ie&&(te.from=_t(x,ie)),ce&&(te.to=_t(x,ce)),ve&&(te.text=ve),Ce!==void 0&&(te.origin=Ce)}),ze(x,"beforeChange",x,te),x.cm&&ze(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(!((Jt(x,"beforeChange")||x.cm&&Jt(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]==""&&ln(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,En(x,z));var te=[];ds(x,function(ie,ce){!ce&&bt(te,ie.history)==-1&&(rc(ie.history,z),te.push(ie.history)),cl(ie,z,null,En(ie,z))})}}function fs(x,z,ne){var te=x.cm&&x.cm.state.suppressEdits;if(!(te&&!ne)){for(var ie=x.history,ce,ve=x.sel,Ce=z=="undo"?ie.done:ie.undone,Ee=z=="undo"?ie.undone:ie.done,$e=0;$e<Ce.length&&(ce=Ce[$e],!(ne?ce.ranges&&!ce.equals(x.sel):!ce.ranges));$e++);if($e!=Ce.length){for(ie.lastOrigin=ie.lastSelOrigin=null;;)if(ce=Ce.pop(),ce.ranges){if(tc(ce,Ee),ne&&!ce.equals(x.sel)){Ca(x,ce,{clearRedo:!1});return}ve=ce}else if(te){Ce.push(ce);return}else break;var pt=[];tc(ve,Ee),Ee.push({changes:pt,generation:ie.generation}),ie.generation=ce.generation||++ie.maxGeneration;for(var Ct=Jt(x,"beforeChange")||x.cm&&Jt(x.cm,"beforeChange"),un=function(Wn){var vr=ce.changes[Wn];if(vr.origin=z,Ct&&!Gc(x,vr,!1))return Ce.length=0,{};pt.push(zc(x,vr));var Ar=Wn?Oc(x,vr):Vt(Ce);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&&bt(Rr,Cr.history)==-1&&(rc(Cr.history,vr),Rr.push(Cr.history)),cl(Cr,vr,null,Wu(Cr,vr))})},an=ce.changes.length-1;an>=0;--an){var On=un(an);if(On)return On.v}}}}function Xc(x,z){if(z!=0&&(x.first+=z,x.sel=new go(Ft(x.sel.ranges,function(ie){return new Fi(Lt(ie.anchor.line+z,ie.anchor.ch),Lt(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:Lt(x.first,0),to:Lt(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:Lt(ce,Xe(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,qe),x.cantEdit&&Uc(x,Lt(x.firstLine(),0))&&(x.cantEdit=!1)}}function Qd(x,z,ne){var te=x.doc,ie=x.display,ce=z.from,ve=z.to,Ce=!1,Ee=ce.line;x.options.lineWrapping||(Ee=Wt($r(Xe(te,ce.line))),te.iter(Ee,ve.line+1,function(an){if(an==ie.maxLine)return Ce=!0,!0})),te.sel.contains(z.from,z.to)>-1&&Bt(x),Nc(te,z,ne,Ya(x)),x.options.lineWrapping||(te.iter(Ee,ce.line+z.text.length,function(an){var On=Vn(an);On>ie.maxLineLength&&(ie.maxLine=an,ie.maxLineLength=On,ie.maxLineChanged=!0,Ce=!1)}),Ce&&(x.curOp.updateMaxLine=!0)),Pn(te,ce.line),nl(x,400);var $e=z.text.length-(ve.line-ce.line)-1;z.full?za(x):ce.line==ve.line&&z.text.length==1&&!Ku(x.doc,z)?Ao(x,ce.line,"text"):za(x,ce.line,ve.line+1,$e);var pt=Jt(x,"changes"),Ct=Jt(x,"change");if(Ct||pt){var un={from:ce,to:ve,text:z.text,removed:z.removed,origin:z.origin};Ct&&zr(x,"change",x,un),pt&&(x.curOp.changeObjs||(x.curOp.changeObjs=[])).push(un)}x.display.selForContextMenu=null}function Ml(x,z,ne,te,ie){var ce;te||(te=ne),ln(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],ve=!0;if(ce.ranges){ce.copied||(ce=x[ie]=ce.deepCopy(),ce.copied=!0);for(var Ce=0;Ce<ce.ranges.length;Ce++)eh(ce.ranges[Ce].anchor,z,ne,te),eh(ce.ranges[Ce].head,z,ne,te);continue}for(var Ee=0;Ee<ce.changes.length;++Ee){var $e=ce.changes[Ee];if(ne<$e.from.line)$e.from=Lt($e.from.line+te,$e.from.ch),$e.to=Lt($e.to.line+te,$e.to.ch);else if(z<=$e.to.line){ve=!1;break}}ve||(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=Xe(x,nn(x,z)):ie=Wt(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 _l(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}_l.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),ve=te.height;if(te.removeInner(x,ce),this.height-=ve-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 Ce=[];this.collapse(Ce),this.children=[new As(Ce)],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 ve=ie.lines.length%25+25,Ce=ve;Ce<ie.lines.length;){var Ee=new As(ie.lines.slice(Ce,Ce+=25));ie.height-=Ee.height,this.children.splice(++te,0,Ee),Ee.parent=this}ie.lines=ie.lines.slice(0,ve),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 _l(z);if(x.parent){x.size-=ne.size,x.height-=ne.height;var ie=bt(x.parent.children,x);x.parent.children.splice(ie+1,0,ne)}else{var te=new _l(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 ve=Math.min(z,ce-x);if(ie.iterN(x,ve,ne))return!0;if((z-=ve)==0)break;x=0}else x-=ce}}};var kl=function(x,z,ne){if(ne)for(var te in ne)ne.hasOwnProperty(te)&&(this[te]=ne[te]);this.doc=x,this.node=z};kl.prototype.clear=function(){var x=this.doc.cm,z=this.line.widgets,ne=this.line,te=Wt(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);kt(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))}},kl.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)||kt(te,te.height+ie),ne&&pa(ne,function(){ne.curOp.forceUpdate=!0,nh(ne,te,ie),zr(ne,"lineWidgetChanged",ne,x,Wt(te))}))},rn(kl);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 kl(x,ne,te),ce=x.cm;return ce&&ie.noHScroll&&(ce.display.alignWidgets=!0),ic(x,z,"widget",function(ve){var Ce=ve.widgets||(ve.widgets=[]);if(ie.insertAt==null?Ce.push(ie):Ce.splice(Math.min(Ce.length-1,Math.max(0,ie.insertAt)),0,ie),ie.line=ve,ce&&!yi(x,ve)){var Ee=Yn(ve)<x.scrollTop;kt(ve,ve.height+ao(ie)),Ee&&Lc(ce,ie.height),ce.curOp.forceUpdate=!0}return!0}),ce&&zr(ce,"lineWidgetAdded",ce,ie,typeof z=="number"?z:Wt(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),Jt(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 ve=this.lines[ce],Ce=br(ve.markedSpans,this);x&&!this.collapsed?Ao(x,Wt(ve),"text"):x&&(Ce.to!=null&&(ie=Wt(ve)),Ce.from!=null&&(te=Wt(ve))),ve.markedSpans=ur(ve.markedSpans,Ce),Ce.from==null&&this.collapsed&&!yi(this.doc,ve)&&x&&kt(ve,as(x.display))}if(x&&this.collapsed&&!x.options.lineWrapping)for(var Ee=0;Ee<this.lines.length;++Ee){var $e=$r(this.lines[Ee]),pt=Vn($e);pt>x.display.maxLineLength&&(x.display.maxLine=$e,x.display.maxLineLength=pt,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],ve=br(ce.markedSpans,this);if(ve.from!=null&&(ne=Lt(z?ce:Wt(ce),ve.from),x==-1))return ne;if(ve.to!=null&&(te=Lt(z?ce:Wt(ce),ve.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=Wt(z.line),ve=Xa(te,ce);if(ve&&(Ki(ve),te.curOp.selectionChanged=te.curOp.forceUpdate=!0),te.curOp.updateMaxLine=!0,!yi(ne.doc,ie)&&ne.height!=null){var Ce=ne.height;ne.height=null;var Ee=ao(ne)-Ce;Ee&&kt(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||bt(z.maybeHiddenMarkers,this)==-1)&&(z.maybeUnhiddenMarkers||(z.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(x)},Ts.prototype.detachLine=function(x){if(this.lines.splice(bt(this.lines,x),1),!this.lines.length&&this.doc.cm){var z=this.doc.cm.curOp;(z.maybeHiddenMarkers||(z.maybeHiddenMarkers=[])).push(this)}},rn(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),ve=ln(z,ne);if(te&&jt(te,ce,!1),ve>0||ve==0&&ce.clearWhenEmpty!==!1)return ce;if(ce.replacedWith&&(ce.collapsed=!0,ce.widgetNode=Kt("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 Ce=z.line,Ee=x.cm,$e;if(x.iter(Ce,ne.line+1,function(Ct){Ee&&ce.collapsed&&!Ee.options.lineWrapping&&$r(Ct)==Ee.display.maxLine&&($e=!0),ce.collapsed&&Ce!=z.line&&kt(Ct,0),Br(Ct,new Xn(ce,Ce==z.line?z.ch:null,Ce==ne.line?ne.ch:null)),++Ce}),ce.collapsed&&x.iter(z.line,ne.line+1,function(Ct){yi(x,Ct)&&kt(Ct,0)}),ce.clearOnEnter&&cn(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($e&&(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 pt=z.line;pt<=ne.line;pt++)Ao(Ee,pt,"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)},rn(Si);function ra(x,z,ne,te,ie){te=jt(te),te.shared=!1;var ce=[ps(x,z,ne,te,ie)],ve=ce[0],Ce=te.widgetNode;return ds(x,function(Ee){Ce&&(te.widgetNode=Ce.cloneNode(!0)),ce.push(ps(Ee,_t(Ee,z),_t(Ee,ne),te,ie));for(var $e=0;$e<Ee.linked.length;++$e)if(Ee.linked[$e].isParent)return;ve=Vt(ce)}),new Si(ce,ve)}function Is(x){return x.findMarks(Lt(x.first,0),x.clipPos(Lt(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),ve=x.clipPos(ie.to);if(ln(ce,ve)){var Ce=ps(x,ce,ve,te.primary,te.primary.type);te.markers.push(Ce),Ce.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 ve=0;ve<ie.markers.length;ve++){var Ce=ie.markers[ve];bt(ce,Ce.doc)==-1&&(Ce.parent=null,ie.markers.splice(ve--,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),_l.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=Lt(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),qe)};ya.prototype=se(_l.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=Ht(this,this.first,this.first+this.size);return x===!1?z:z.join(x||this.lineSeparator())},setValue:Ia(function(x){var z=Lt(this.first,0),ne=this.first+this.size-1;Ds(this,{from:z,to:Lt(ne,Xe(this,ne).text.length),text:this.splitLines(x),origin:"setValue",full:!0},!0),this.cm&&el(this.cm,0,0),Ca(this,Ro(z),qe)}),replaceRange:function(x,z,ne,te){z=_t(this,z),ne=ne?_t(this,ne):z,Ml(this,x,z,ne,te)},getRange:function(x,z,ne){var te=dt(this,_t(this,x),_t(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(xn(this,x))return Xe(this,x)},getLineNumber:function(x){return Wt(x)},getLineHandleVisualStart:function(x){return typeof x=="number"&&(x=Xe(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 _t(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,_t(this,typeof x=="number"?Lt(x,z||0):x),null,ne)}),setSelection:Ia(function(x,z,ne){Zu(this,_t(this,x),_t(this,z||x),ne)}),extendSelection:Ia(function(x,z,ne){sl(this,_t(this,x),z&&_t(this,z),ne)}),extendSelections:Ia(function(x,z){Wr(this,Oe(this,x),z)}),extendSelectionsBy:Ia(function(x,z){var ne=Ft(this.sel.ranges,x);Wr(this,Oe(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(_t(this,x[ie].anchor),_t(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(_t(this,x),_t(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 ve=ie.ranges[ce];te[ce]={from:ve.from(),to:ve.to(),text:this.splitLines(x[ce]),origin:ne}}for(var Ce=z&&z!="end"&&$c(this,te,z),Ee=te.length-1;Ee>=0;Ee--)Ds(this,te[Ee]);Ce?no(this,Ce):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(!xn(this,x)||(z=x,x=Xe(this,x),!x))return null}else if(z=Wt(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(_e(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 ve=ce.match(_e(ne));if(!ve)return!1;var Ce=ve.index+ve[0].length;te[ie]=ce.slice(0,ve.index)+(!ve.index||Ce==ce.length?"":" ")+ce.slice(Ce)||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,_t(this,x),_t(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=_t(this,x),ps(this,x,x,ne,"bookmark")},findMarksAt:function(x){x=_t(this,x);var z=[],ne=Xe(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=_t(this,x),z=_t(this,z);var te=[],ie=x.line;return this.iter(x.line,z.line+1,function(ce){var ve=ce.markedSpans;if(ve)for(var Ce=0;Ce<ve.length;Ce++){var Ee=ve[Ce];!(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}),_t(this,Lt(ne,z))},indexFromPos:function(x){x=_t(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(Ht(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(Ht(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),!(Ue(z,x)||oo(z.display,x))){An(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),ve=0,Ce=function(){++ve==ie&&Sa(z,function(){ne=_t(z.doc,ne);var an={from:ne,to:ne,text:z.doc.splitLines(ce.filter(function(On){return On!=null}).join(z.doc.lineSeparator())),origin:"paste"};Ds(z.doc,an),no(z.doc,Ro(_t(z.doc,ne),_t(z.doc,us(an))))})()},Ee=function(an,On){if(z.options.allowDropFileTypes&&bt(z.options.allowDropFileTypes,an.type)==-1){Ce();return}var Wn=new FileReader;Wn.onerror=function(){return Ce()},Wn.onload=function(){var vr=Wn.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(vr)){Ce();return}ce[On]=vr,Ce()},Wn.readAsText(an)},$e=0;$e<te.length;$e++)Ee(te[$e],$e);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 pt=x.dataTransfer.getData("Text");if(pt){var Ct;if(z.state.draggingText&&!z.state.draggingText.copy&&(Ct=z.listSelections()),nc(z.doc,Ro(ne,ne)),Ct)for(var un=0;un<Ct.length;++un)Ml(z.doc,"",Ct[un].anchor,Ct[un].head,"drag");z.replaceSelection(pt,"around","paste"),z.display.input.focus()}}catch(an){}}}}function ef(x,z){if(be&&(!x.state.draggingText||+new Date-Uu<100)){Fn(z);return}if(!(Ue(x,z)||oo(x.display,z))&&(z.dataTransfer.setData("Text",x.getSelection()),z.dataTransfer.effectAllowed="copyMove",z.dataTransfer.setDragImage&&!rt)){var ne=Qe("img",null,null,"position: fixed; left: 0; top: 0;");ne.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Pe&&(ne.width=ne.height=1,x.display.wrapper.appendChild(ne),ne._top=ne.offsetTop),z.dataTransfer.setDragImage(ne,0,0),Pe&&ne.parentNode.removeChild(ne)}}function Gu(x,z){var ne=xo(x,z);if(ne){var te=document.createDocumentFragment();ku(x,ne,te),x.display.dragCursor||(x.display.dragCursor=Qe("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),x.display.lineSpace.insertBefore(x.display.dragCursor,x.display.cursorDiv)),Mt(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;cn(window,"resize",function(){x==null&&(x=setTimeout(function(){x=null,Ll(Jc)},100))}),cn(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=st?Yi.macDefault:Yi.pcDefault;function tf(x){var z=x.split(/-(?!$)/);x=z[z.length-1];for(var ne,te,ie,ce,ve=0;ve<z.length-1;ve++){var Ce=z[ve];if(/^(cmd|meta|m)$/i.test(Ce))ce=!0;else if(/^a(lt)?$/i.test(Ce))ne=!0;else if(/^(c|ctrl|control)$/i.test(Ce))te=!0;else if(/^s(hift)?$/i.test(Ce))ie=!0;else throw new Error("Unrecognized modifier name: "+Ce)}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=Ft(ne.split(" "),tf),ce=0;ce<ie.length;ce++){var ve=void 0,Ce=void 0;ce==ie.length-1?(Ce=ie.join(" "),ve=te):(Ce=ie.slice(0,ce+1).join(" "),ve="...");var Ee=z[Ce];if(!Ee)z[Ce]=ve;else if(Ee!=ve)throw new Error("Inconsistent bindings for "+Ce)}delete x[ne]}for(var $e in z)x[$e]=z[$e];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 ve=ms(x,z.fallthrough[ce],ne,te);if(ve)return ve}}}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(Pe&&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&&ln(ce.from,Vt(te).to)<=0;){var ve=te.pop();if(ln(ve.from,ce.from)<0){ce.from=ve.from;break}}te.push(ce)}pa(x,function(){for(var Ce=te.length-1;Ce>=0;Ce--)Ml(x.doc,"",te[Ce].from,te[Ce].to,"+delete");Qs(x)})}function Ha(x,z,ne){var te=$t(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 Lt(z.line,te,ne<0?"after":"before")}function dl(x,z,ne,te,ie){if(x){z.doc.direction=="rtl"&&(ie=-ie);var ce=_n(ne,z.doc.direction);if(ce){var ve=ie<0?Vt(ce):ce[0],Ce=ie<0==(ve.level==1),Ee=Ce?"after":"before",$e;if(ve.level>0||z.doc.direction=="rtl"){var pt=Oa(z,ne);$e=ie<0?ne.text.length-1:0;var Ct=Oi(z,pt,$e).top;$e=It(function(un){return Oi(z,pt,un).top==Ct},ie<0==(ve.level==1)?ve.from:ve.to-1,$e),Ee=="before"&&($e=Ha(ne,$e,1))}else $e=ie<0?ve.to:ve.from;return new Lt(te,$e,Ee)}}return new Lt(te,ie<0?ne.text.length:0,ie<0?"before":"after")}function Go(x,z,ne,te){var ie=_n(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=dn(ie,ne.ch,ne.sticky),ve=ie[ce];if(x.doc.direction=="ltr"&&ve.level%2==0&&(te>0?ve.to>ne.ch:ve.from<ne.ch))return Uo(z,ne,te);var Ce=function(Ar,Rr){return Ha(z,Ar instanceof Lt?Ar.ch:Ar,Rr)},Ee,$e=function(Ar){return x.options.lineWrapping?(Ee=Ee||Oa(x,z),Hl(x,z,Ee,Ar)):{begin:0,end:z.text.length}},pt=$e(ne.sticky=="before"?Ce(ne,-1):ne.ch);if(x.doc.direction=="rtl"||ve.level==1){var Ct=ve.level==1==te<0,un=Ce(ne,Ct?1:-1);if(un!=null&&(Ct?un<=ve.to&&un<=pt.end:un>=ve.from&&un>=pt.begin)){var an=Ct?"before":"after";return new Lt(ne.line,un,an)}}var On=function(Ar,Rr,Cr){for(var Kr=function(qi,Na){return Na?new Lt(ne.line,Ce(qi,1),"before"):new Lt(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:Ce(Cr.end,-1);if(Qr.from<=Ci&&Ci<Qr.to||(Ci=ti?Qr.from:Ce(Qr.to,-1),Cr.begin<=Ci&&Ci<Cr.end))return Kr(Ci,ti)}},Wn=On(ce+te,te,pt);if(Wn)return Wn;var vr=te>0?pt.end:Ce(pt.begin,-1);return vr!=null&&!(te>0&&vr==z.text.length)&&(Wn=On(te>0?0:ie.length-1,te,$e(vr)),Wn)?Wn:null}var Dl={selectAll:ju,singleSelection:function(x){return x.setSelection(x.getCursor("anchor"),x.getCursor("head"),qe)},killLine:function(x){return Po(x,function(z){if(z.empty()){var ne=Xe(x.doc,z.head.line).text.length;return z.head.ch==ne&&z.head.line<x.lastLine()?{from:z.head,to:Lt(z.head.line+1,0)}:{from:z.head,to:Lt(z.head.line,ne)}}else return{from:z.from(),to:z.to()}})},deleteLine:function(x){return Po(x,function(z){return{from:Lt(z.from().line,0),to:_t(x.doc,Lt(z.to().line+1,0))}})},delLineLeft:function(x){return Po(x,function(z){return{from:Lt(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(Lt(x.firstLine(),0))},goDocEnd:function(x){return x.extendSelection(Lt(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")},gt)},goLineLeft:function(x){return x.extendSelectionsBy(function(z){var ne=x.cursorCoords(z.head,"div").top+5;return x.coordsChar({left:0,top:ne},"div")},gt)},goLineLeftSmart:function(x){return x.extendSelectionsBy(function(z){var ne=x.cursorCoords(z.head,"div").top+5,te=x.coordsChar({left:0,top:ne},"div");return te.ch<x.getLine(te.line).search(/\S/)?sh(x,z.head):te},gt)},goLineUp:function(x){return x.moveV(-1,"line")},goLineDown:function(x){return x.moveV(1,"line")},goPageUp:function(x){return x.moveV(-1,"page")},goPageDown:function(x){return x.moveV(1,"page")},goCharLeft:function(x){return x.moveH(-1,"char")},goCharRight:function(x){return x.moveH(1,"char")},goColumnLeft:function(x){return x.moveH(-1,"column")},goColumnRight:function(x){return x.moveH(1,"column")},goWordLeft:function(x){return x.moveH(-1,"word")},goGroupRight:function(x){return x.moveH(1,"group")},goGroupLeft:function(x){return x.moveH(-1,"group")},goWordRight:function(x){return x.moveH(1,"word")},delCharBefore:function(x){return x.deleteH(-1,"codepoint")},delCharAfter:function(x){return x.deleteH(1,"char")},delWordBefore:function(x){return x.deleteH(-1,"word")},delWordAfter:function(x){return x.deleteH(1,"word")},delGroupBefore:function(x){return x.deleteH(-1,"group")},delGroupAfter:function(x){return x.deleteH(1,"group")},indentAuto:function(x){return x.indentSelection("smart")},indentMore:function(x){return x.indentSelection("add")},indentLess:function(x){return x.indentSelection("subtract")},insertTab:function(x){return x.replaceSelection(" ")},insertSoftTab:function(x){for(var z=[],ne=x.listSelections(),te=x.options.tabSize,ie=0;ie<ne.length;ie++){var ce=ne[ie].from(),ve=Ke(x.getLine(ce.line),ce.ch,te);z.push(pn(te-ve%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=Xe(x.doc,ie.line).text;if(ce){if(ie.ch==ce.length&&(ie=new Lt(ie.line,ie.ch-1)),ie.ch>0)ie=new Lt(ie.line,ie.ch+1),x.replaceRange(ce.charAt(ie.ch-1)+ce.charAt(ie.ch-2),Lt(ie.line,ie.ch-2),ie,"+transpose");else if(ie.line>x.doc.first){var ve=Xe(x.doc,ie.line-1).text;ve&&(ie=new Lt(ie.line,1),x.replaceRange(ce.charAt(0)+x.doc.lineSeparator()+ve.charAt(ve.length-1),Lt(ie.line-1,ve.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=Xe(x.doc,z),te=$r(ne);return te!=ne&&(z=Wt(te)),dl(!0,x,te,z,1)}function qu(x,z){var ne=Xe(x.doc,z),te=li(ne);return te!=ne&&(z=Wt(te)),dl(!0,x,ne,z,-1)}function sh(x,z){var ne=Ju(x,z.line),te=Xe(x.doc,ne.line),ie=_n(te,x.doc.direction);if(!ie||ie[0].level==0){var ce=Math.max(ne.ch,te.text.search(/\S/)),ve=z.line==ne.line&&z.ch<=ce&&z.ch;return Lt(ne.line,ve?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)!=Xt}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")&&(An(ne),kc(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=nt(),!Ue(z,x))){be&&Le<11&&x.keyCode==27&&(x.returnValue=!1);var ne=x.keyCode;z.display.shift=ne==16||x.shiftKey;var te=Di(z,x);Pe&&(gs=te?ne:null,!te&&ne==88&&!Or&&(st?x.metaKey:x.ctrlKey)&&z.replaceSelection("",null,"cut")),fe&&!st&&!te&&ne==46&&x.shiftKey&&!x.ctrlKey&&document.execCommand&&document.execCommand("cut"),ne==18&&!/\bCodeMirror-crosshair\b/.test(z.display.lineDiv.className)&&Bn(z)}}function Bn(x){var z=x.display.lineDiv;Gt(z,"CodeMirror-crosshair");function ne(te){(te.keyCode==18||!te.altKey)&&(We(z,"CodeMirror-crosshair"),Ye(document,"keyup",ne),Ye(document,"mouseover",ne))}cn(document,"keyup",ne),cn(document,"mouseover",ne)}function lh(x){x.keyCode==16&&(this.doc.sel.shift=!1),Ue(this,x)}function ch(x){var z=this;if(!(x.target&&x.target!=z.display.input.getField())&&!(oo(z.display,x)||Ue(z,x)||x.ctrlKey&&!x.altKey||st&&x.metaKey)){var ne=x.keyCode,te=x.charCode;if(Pe&&ne==gs){gs=null,An(x);return}if(!(Pe&&(!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&&ln(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(!(Ue(z,x)||ne.activeTouch&&ne.input.supportsTouch())){if(ne.input.ensurePolled(),ne.shift=x.shiftKey,oo(ne,x)){Re||(ne.scroller.draggable=!1,setTimeout(function(){return ne.scroller.draggable=!0},100));return}if(!Ja(z,x)){var te=xo(z,x),ie=Tn(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&&An(x):ie==2?(te&&sl(z.doc,te),setTimeout(function(){return ne.input.focus()},20)):ie==3&&(Ve?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(ve){if(typeof ve=="string"&&(ve=Dl[ve]),!ve)return!1;var Ce=!1;try{x.isReadOnly()&&(x.state.suppressEdits=!0),Ce=ve(x,ne)!=Xt}finally{x.state.suppressEdits=!1}return Ce})}function eu(x,z,ne){var te=x.getOption("configureMouse"),ie=te?te(x,z,ne):{};if(ie.unit==null){var ce=Rt?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=st?ne.metaKey:ne.ctrlKey),ie.moveOnDrag==null&&(ie.moveOnDrag=!(st?ne.altKey:ne.ctrlKey)),ie}function tu(x,z,ne,te){be?setTimeout(sn(Sl,x),0):x.curOp.focus=nt();var ie=eu(x,ne,te),ce=x.doc.sel,ve;x.options.dragDrop&&hr&&!x.isReadOnly()&&ne=="single"&&(ve=ce.contains(z))>-1&&(ln((ve=ce.ranges[ve]).from(),z)<0||z.xRel>0)&&(ln(ve.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,ve=Sa(x,function($e){Re&&(ie.scroller.draggable=!1),x.state.draggingText=!1,Ye(ie.wrapper.ownerDocument,"mouseup",ve),Ye(ie.wrapper.ownerDocument,"mousemove",Ce),Ye(ie.scroller,"dragstart",Ee),Ye(ie.scroller,"drop",ve),ce||(An($e),te.addNew||sl(x.doc,ne,null,null,te.extend),Re&&!rt||be&&Le==9?setTimeout(function(){ie.wrapper.ownerDocument.body.focus({preventScroll:!0}),ie.input.focus()},20):ie.input.focus())}),Ce=function($e){ce=ce||Math.abs(z.clientX-$e.clientX)+Math.abs(z.clientY-$e.clientY)>=10},Ee=function(){return ce=!0};Re&&(ie.scroller.draggable=!0),x.state.draggingText=ve,ve.copy=!te.moveOnDrag,ie.scroller.dragDrop&&ie.scroller.dragDrop(),cn(ie.wrapper.ownerDocument,"mouseup",ve),cn(ie.wrapper.ownerDocument,"mousemove",Ce),cn(ie.scroller,"dragstart",Ee),cn(ie.scroller,"drop",ve),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(Lt(z.line,0),_t(x.doc,Lt(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;An(z);var ve,Ce,Ee=ce.sel,$e=Ee.ranges;if(te.addNew&&!te.extend?(Ce=ce.sel.contains(ne),Ce>-1?ve=$e[Ce]:ve=new Fi(ne,ne)):(ve=ce.sel.primary(),Ce=ce.sel.primIndex),te.unit=="rectangle")te.addNew||(ve=new Fi(ne,ne)),ne=xo(x,z,!0,!0),Ce=-1;else{var pt=uh(x,ne,te.unit);te.extend?ve=Vc(ve,pt.anchor,pt.head,te.extend):ve=pt}te.addNew?Ce==-1?(Ce=$e.length,Ca(ce,Io(x,$e.concat([ve]),Ce),{scroll:!1,origin:"*mouse"})):$e.length>1&&$e[Ce].empty()&&te.unit=="char"&&!te.extend?(Ca(ce,Io(x,$e.slice(0,Ce).concat($e.slice(Ce+1)),0),{scroll:!1,origin:"*mouse"}),Ee=ce.sel):So(ce,Ce,ve,je):(Ce=0,Ca(ce,new go([ve],0),je),Ee=ce.sel);var Ct=ne;function un(Cr){if(ln(Ct,Cr)!=0)if(Ct=Cr,te.unit=="rectangle"){for(var Kr=[],Qr=x.options.tabSize,ti=Ke(Xe(ce,ne.line).text,ne.ch,Qr),Ci=Ke(Xe(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=Xe(ce,da).text,_a=en(uo,qi,Qr);qi==Na?Kr.push(new Fi(Lt(da,_a),Lt(da,_a))):uo.length>_a&&Kr.push(new Fi(Lt(da,_a),Lt(da,en(uo,Na,Qr))))}Kr.length||Kr.push(new Fi(ne,ne)),Ca(ce,Io(x,Ee.ranges.slice(0,Ce).concat(Kr),Ce),{origin:"*mouse",scroll:!1}),x.scrollIntoView(Cr)}else{var ho=ve,hi=uh(x,Cr,te.unit),ma=ho.anchor,ha;ln(hi.anchor,ma)>0?(ha=hi.head,ma=At(ho.from(),hi.anchor)):(ha=hi.anchor,ma=Et(ho.to(),hi.head));var ga=Ee.ranges.slice(0);ga[Ce]=dh(x,new Fi(_t(ce,ma),ha)),Ca(ce,Io(x,ga,Ce),je)}}var an=ie.wrapper.getBoundingClientRect(),On=0;function Wn(Cr){var Kr=++On,Qr=xo(x,Cr,!0,te.unit=="rectangle");if(Qr)if(ln(Qr,Ct)!=0){x.curOp.focus=nt(),un(Qr);var ti=Ta(ie,ce);(Qr.line>=ti.to||Qr.line<ti.from)&&setTimeout(Sa(x,function(){On==Kr&&Wn(Cr)}),150)}else{var Ci=Cr.clientY<an.top?-20:Cr.clientY>an.bottom?20:0;Ci&&setTimeout(Sa(x,function(){On==Kr&&(ie.scroller.scrollTop+=Ci,Wn(Cr))}),50)}}function vr(Cr){x.state.selectingText=!1,On=1/0,Cr&&(An(Cr),ie.input.focus()),Ye(ie.wrapper.ownerDocument,"mousemove",Ar),Ye(ie.wrapper.ownerDocument,"mouseup",Rr),ce.history.lastSelOrigin=null}var Ar=Sa(x,function(Cr){Cr.buttons===0||!Tn(Cr)?vr(Cr):Wn(Cr)}),Rr=Sa(x,vr);x.state.selectingText=Rr,cn(ie.wrapper.ownerDocument,"mousemove",Ar),cn(ie.wrapper.ownerDocument,"mouseup",Rr)}function dh(x,z){var ne=z.anchor,te=z.head,ie=Xe(x.doc,ne.line);if(ln(ne,te)==0&&ne.sticky==te.sticky)return z;var ce=_n(ie);if(!ce)return z;var ve=dn(ce,ne.ch,ne.sticky),Ce=ce[ve];if(Ce.from!=ne.ch&&Ce.to!=ne.ch)return z;var Ee=ve+(Ce.from==ne.ch==(Ce.level!=1)?0:1);if(Ee==0||Ee==ce.length)return z;var $e;if(te.line!=ne.line)$e=(te.line-ne.line)*(x.doc.direction=="ltr"?1:-1)>0;else{var pt=dn(ce,te.ch,te.sticky),Ct=pt-ve||(te.ch-ne.ch)*(Ce.level==1?-1:1);pt==Ee-1||pt==Ee?$e=Ct<0:$e=Ct>0}var un=ce[Ee+($e?-1:0)],an=$e==(un.level==1),On=an?un.from:un.to,Wn=an?"after":"before";return ne.ch==On&&ne.sticky==Wn?z:new Fi(new Lt(ne.line,On,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(un){return!1}if(ie>=Math.floor(x.display.gutters.getBoundingClientRect().right))return!1;te&&An(z);var ve=x.display,Ce=ve.lineDiv.getBoundingClientRect();if(ce>Ce.bottom||!Jt(x,ne))return Ln(z);ce-=Ce.top-ve.viewOffset;for(var Ee=0;Ee<x.display.gutterSpecs.length;++Ee){var $e=ve.gutters.childNodes[Ee];if($e&&$e.getBoundingClientRect().right>=ie){var pt=vn(x.doc,ce),Ct=x.display.gutterSpecs[Ee];return ze(x,ne,x,pt,Ct.className,z),Ln(z)}}}function Ja(x,z){return uc(x,z,"gutterClick",!0)}function Os(x,z){oo(x.display,z)||hh(x,z)||Ue(x,z,"contextmenu")||Ve||x.display.input.onContextMenu(z)}function hh(x,z){return Jt(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,ve){x.defaults[te]=ie,ce&&(z[te]=ve?function(Ce,Ee,$e){$e!=$s&&ce(Ce,Ee,$e)}: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=[],ve=te.doc.first;te.doc.iter(function(Ee){for(var $e=0;;){var pt=Ee.text.indexOf(ie,$e);if(pt==-1)break;$e=pt+ie.length,ce.push(Lt(ve,pt))}ve++});for(var Ce=ce.length-1;Ce>=0;Ce--)Ml(te.doc,ie,ce[Ce],Lt(ce[Ce].line,ce[Ce].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",lt?"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 ve=io(ie),Ce=ce!=$s&&io(ce);Ce&&Ce.detach&&Ce.detach(te,ve),ve.attach&&ve.attach(te,Ce||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?cn:Ye;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?(Gt(x.display.wrapper,"CodeMirror-wrap"),x.display.sizer.style.minWidth="",x.display.sizerWidth=null):(We(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?jt(z):{},jt(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&&!lt&&ce.input.focus(),be&&Le<11&&setTimeout(function(){return ne.display.input.reset(!0)},20),lf(this),Xu(),Ls(this),this.curOp.forceUpdate=!0,Jl(this,te),z.autofocus&&!lt||this.hasFocus()?setTimeout(function(){ne.hasFocus()&&!ne.state.focused&&Ec(ne)},20):qs(this);for(var ve in nu)nu.hasOwnProperty(ve)&&nu[ve](this,z[ve],$s);Xl(this),z.finishInit&&z.finishInit(this);for(var Ce=0;Ce<rd.length;++Ce)rd[Ce](this);cs(this),Re&&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;cn(z.scroller,"mousedown",Sa(x,Wa)),be&&Le<11?cn(z.scroller,"dblclick",Sa(x,function(Ee){if(!Ue(x,Ee)){var $e=xo(x,Ee);if(!(!$e||Ja(x,Ee)||oo(x.display,Ee))){An(Ee);var pt=x.findWordAt($e);sl(x.doc,pt.anchor,pt.head)}}})):cn(z.scroller,"dblclick",function(Ee){return Ue(x,Ee)||An(Ee)}),cn(z.scroller,"contextmenu",function(Ee){return Os(x,Ee)}),cn(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 $e=Ee.touches[0];return $e.radiusX<=1&&$e.radiusY<=1}function ve(Ee,$e){if($e.left==null)return!0;var pt=$e.left-Ee.left,Ct=$e.top-Ee.top;return pt*pt+Ct*Ct>20*20}cn(z.scroller,"touchstart",function(Ee){if(!Ue(x,Ee)&&!ce(Ee)&&!Ja(x,Ee)){z.input.ensurePolled(),clearTimeout(ne);var $e=+new Date;z.activeTouch={start:$e,moved:!1,prev:$e-te.end<=300?te:null},Ee.touches.length==1&&(z.activeTouch.left=Ee.touches[0].pageX,z.activeTouch.top=Ee.touches[0].pageY)}}),cn(z.scroller,"touchmove",function(){z.activeTouch&&(z.activeTouch.moved=!0)}),cn(z.scroller,"touchend",function(Ee){var $e=z.activeTouch;if($e&&!oo(z,Ee)&&$e.left!=null&&!$e.moved&&new Date-$e.start<300){var pt=x.coordsChar(z.activeTouch,"page"),Ct;!$e.prev||ve($e,$e.prev)?Ct=new Fi(pt,pt):!$e.prev.prev||ve($e,$e.prev.prev)?Ct=x.findWordAt(pt):Ct=new Fi(Lt(pt.line,0),_t(x.doc,Lt(pt.line+1,0))),x.setSelection(Ct.anchor,Ct.head),x.focus(),An(Ee)}ie()}),cn(z.scroller,"touchcancel",ie),cn(z.scroller,"scroll",function(){z.scroller.clientHeight&&(_s(x,z.scroller.scrollTop),ks(x,z.scroller.scrollLeft,!0),ze(x,"scroll",x))}),cn(z.scroller,"mousewheel",function(Ee){return Fu(x,Ee)}),cn(z.scroller,"DOMMouseScroll",function(Ee){return Fu(x,Ee)}),cn(z.wrapper,"scroll",function(){return z.wrapper.scrollTop=z.wrapper.scrollLeft=0}),z.dragFunctions={enter:function(Ee){Ue(x,Ee)||Fn(Ee)},over:function(Ee){Ue(x,Ee)||(Gu(x,Ee),Fn(Ee))},start:function(Ee){return ef(x,Ee)},drop:Sa(x,Qh),leave:function(Ee){Ue(x,Ee)||El(x)}};var Ce=z.input.getField();cn(Ce,"keyup",function(Ee){return lh.call(x,Ee)}),cn(Ce,"keydown",Sa(x,lc)),cn(Ce,"keypress",Sa(x,ch)),cn(Ce,"focus",function(Ee){return Ec(x,Ee)}),cn(Ce,"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=Nt(x,z).state:ne="prev");var ve=x.options.tabSize,Ce=Xe(ie,z),Ee=Ke(Ce.text,null,ve);Ce.stateAfter&&(Ce.stateAfter=null);var $e=Ce.text.match(/^\s*/)[0],pt;if(!te&&!/\S/.test(Ce.text))pt=0,ne="not";else if(ne=="smart"&&(pt=ie.mode.indent(ce,Ce.text.slice($e.length),Ce.text),pt==Xt||pt>150)){if(!te)return;ne="prev"}ne=="prev"?z>ie.first?pt=Ke(Xe(ie,z-1).text,null,ve):pt=0:ne=="add"?pt=Ee+x.options.indentUnit:ne=="subtract"?pt=Ee-x.options.indentUnit:typeof ne=="number"&&(pt=Ee+ne),pt=Math.max(0,pt);var Ct="",un=0;if(x.options.indentWithTabs)for(var an=Math.floor(pt/ve);an;--an)un+=ve,Ct+=" ";if(un<pt&&(Ct+=pn(pt-un)),Ct!=$e)return Ml(ie,Ct,Lt(z,0),Lt(z,$e.length),"+input"),Ce.stateAfter=null,!0;for(var On=0;On<ie.sel.ranges.length;On++){var Wn=ie.sel.ranges[On];if(Wn.head.line==z&&Wn.head.ch<$e.length){var vr=Lt(z,$e.length);So(ie,On,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 ve=+new Date-200,Ce=ie=="paste"||x.state.pasteIncoming>ve,Ee=Mr(z),$e=null;if(Ce&&te.ranges.length>1)if(zo&&zo.text.join(`
`)==z){if(te.ranges.length%zo.text.length==0){$e=[];for(var pt=0;pt<zo.text.length;pt++)$e.push(ce.splitLines(zo.text[pt]))}}else Ee.length==te.ranges.length&&x.options.pasteLinesPerSelection&&($e=Ft(Ee,function(Ar){return[Ar]}));for(var Ct=x.curOp.updateInput,un=te.ranges.length-1;un>=0;un--){var an=te.ranges[un],On=an.from(),Wn=an.to();an.empty()&&(ne&&ne>0?On=Lt(On.line,On.ch-ne):x.state.overwrite&&!Ce?Wn=Lt(Wn.line,Math.min(Xe(ce,Wn.line).text.length,Wn.ch+Vt(Ee).length)):Ce&&zo&&zo.lineWise&&zo.text.join(`
`)==Ee.join(`
`)&&(On=Wn=Lt(On.line,0)));var vr={from:On,to:Wn,text:$e?$e[un%$e.length]:Ee,origin:ie||(Ce?"paste":x.state.cutIncoming>ve?"cut":"+input")};Ds(x.doc,vr),zr(x,"inputRead",x,vr)}z&&!Ce&&od(x,z),Qs(x),x.curOp.updateInput<2&&(x.curOp.updateInput=Ct),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),ve=!1;if(ce.electricChars){for(var Ce=0;Ce<ce.electricChars.length;Ce++)if(z.indexOf(ce.electricChars.charAt(Ce))>-1){ve=Fo(x,ie.head.line,"smart");break}}else ce.electricInput&&ce.electricInput.test(Xe(x.doc,ie.head.line).text.slice(0,ie.head.ch))&&(ve=Fo(x,ie.head.line,"smart"));ve&&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:Lt(ie,0),head:Lt(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=Qe("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),z=Qe("div",[x],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return Re?x.style.width="1000px":x.setAttribute("wrap","off"),ht&&(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,ve=ce[te];ce[te]==ie&&te!="mode"||(ce[te]=ie,z.hasOwnProperty(te)&&Sa(this,z[te])(this,ie,ve),ze(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.");Tt(this.state.overlays,{mode:ce,modeSpec:te,opaque:ie&&ie.opaque,priority:ie&&ie.priority||0},function(ve){return ve.priority}),this.state.modeGen++,za(this)}),removeOverlay:ua(function(te){for(var ie=this.state.overlays,ce=0;ce<ie.length;++ce){var ve=ie[ce].modeSpec;if(ve==te||typeof te=="string"&&ve.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"),xn(this.doc,te)&&Fo(this,te,ie,ce)}),indentSelection:ua(function(te){for(var ie=this.doc.sel.ranges,ce=-1,ve=0;ve<ie.length;ve++){var Ce=ie[ve];if(Ce.empty())Ce.head.line>ce&&(Fo(this,Ce.head.line,te,!0),ce=Ce.head.line,ve==this.doc.sel.primIndex&&Qs(this));else{var Ee=Ce.from(),$e=Ce.to(),pt=Math.max(ce,Ee.line);ce=Math.min(this.lastLine(),$e.line-($e.ch?0:1))+1;for(var Ct=pt;Ct<ce;++Ct)Fo(this,Ct,te);var un=this.doc.sel.ranges;Ee.ch==0&&ie.length==un.length&&un[ve].from().ch>0&&So(this.doc,ve,new Fi(Ee,un[ve].to()),qe)}}}),getTokenAt:function(te,ie){return zn(this,te,ie)},getLineTokens:function(te,ie){return zn(this,Lt(te),ie,!0)},getTokenTypeAt:function(te){te=_t(this.doc,te);var ie=Dt(this,Xe(this.doc,te.line)),ce=0,ve=(ie.length-1)/2,Ce=te.ch,Ee;if(Ce==0)Ee=ie[2];else for(;;){var $e=ce+ve>>1;if(($e?ie[$e*2-1]:0)>=Ce)ve=$e;else if(ie[$e*2+1]<Ce)ce=$e+1;else{Ee=ie[$e*2+2];break}}var pt=Ee?Ee.indexOf("overlay "):-1;return pt<0?Ee:pt==0?null:Ee.slice(0,pt-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 ve=ne[ie],Ce=this.getModeAt(te);if(typeof Ce[ie]=="string")ve[Ce[ie]]&&ce.push(ve[Ce[ie]]);else if(Ce[ie])for(var Ee=0;Ee<Ce[ie].length;Ee++){var $e=ve[Ce[ie][Ee]];$e&&ce.push($e)}else Ce.helperType&&ve[Ce.helperType]?ce.push(ve[Ce.helperType]):ve[Ce.name]&&ce.push(ve[Ce.name]);for(var pt=0;pt<ve._global.length;pt++){var Ct=ve._global[pt];Ct.pred(Ce,this)&&bt(ce,Ct.val)==-1&&ce.push(Ct.val)}return ce},getStateAfter:function(te,ie){var ce=this.doc;return te=nn(ce,te==null?ce.first+ce.size-1:te),Nt(this,te+1,ie).state},cursorCoords:function(te,ie){var ce,ve=this.doc.sel.primary();return te==null?ce=ve.head:typeof te=="object"?ce=_t(this.doc,te):ce=te?ve.from():ve.to(),Da(this,ce,ie||"page")},charCoords:function(te,ie){return lo(this,_t(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,vn(this.doc,te+this.display.viewOffset)},heightAtLine:function(te,ie,ce){var ve=!1,Ce;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,ve=!0),Ce=Xe(this.doc,te)}else Ce=te;return Ra(this,Ce,{top:0,left:0},ie||"page",ce||ve).top+(ve?this.doc.height-Yn(Ce):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,ve,Ce){var Ee=this.display;te=Da(this,_t(this.doc,te));var $e=te.bottom,pt=te.left;if(ie.style.position="absolute",ie.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(ie),Ee.sizer.appendChild(ie),ve=="over")$e=te.top;else if(ve=="above"||ve=="near"){var Ct=Math.max(Ee.wrapper.clientHeight,this.doc.height),un=Math.max(Ee.sizer.clientWidth,Ee.lineSpace.clientWidth);(ve=="above"||te.bottom+ie.offsetHeight>Ct)&&te.top>ie.offsetHeight?$e=te.top-ie.offsetHeight:te.bottom+ie.offsetHeight<=Ct&&($e=te.bottom),pt+ie.offsetWidth>un&&(pt=un-ie.offsetWidth)}ie.style.top=$e+"px",ie.style.left=ie.style.right="",Ce=="right"?(pt=Ee.sizer.clientWidth-ie.offsetWidth,ie.style.right="0px"):(Ce=="left"?pt=0:Ce=="middle"&&(pt=(Ee.sizer.clientWidth-ie.offsetWidth)/2),ie.style.left=pt+"px"),ce&&$d(this,{left:pt,top:$e,right:pt+ie.offsetWidth,bottom:$e+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,ve){var Ce=1;ie<0&&(Ce=-1,ie=-ie);for(var Ee=_t(this.doc,te),$e=0;$e<ie&&(Ee=ru(this.doc,Ee,Ce,ce,ve),!Ee.hitSide);++$e);return Ee},moveH:ua(function(te,ie){var ce=this;this.extendSelectionsBy(function(ve){return ce.display.shift||ce.doc.extend||ve.empty()?ru(ce.doc,ve.head,te,ie,ce.options.rtlMoveVisually):te<0?ve.from():ve.to()},gt)}),deleteH:ua(function(te,ie){var ce=this.doc.sel,ve=this.doc;ce.somethingSelected()?ve.replaceSelection("",null,"+delete"):Po(this,function(Ce){var Ee=ru(ve,Ce.head,te,ie,!1);return te<0?{from:Ee,to:Ce.head}:{from:Ce.head,to:Ee}})}),findPosV:function(te,ie,ce,ve){var Ce=1,Ee=ve;ie<0&&(Ce=-1,ie=-ie);for(var $e=_t(this.doc,te),pt=0;pt<ie;++pt){var Ct=Da(this,$e,"div");if(Ee==null?Ee=Ct.left:Ct.left=Ee,$e=gh(this,Ct,Ce,ce),$e.hitSide)break}return $e},moveV:ua(function(te,ie){var ce=this,ve=this.doc,Ce=[],Ee=!this.display.shift&&!ve.extend&&ve.sel.somethingSelected();if(ve.extendSelectionsBy(function(pt){if(Ee)return te<0?pt.from():pt.to();var Ct=Da(ce,pt.head,"div");pt.goalColumn!=null&&(Ct.left=pt.goalColumn),Ce.push(Ct.left);var un=gh(ce,Ct,te,ie);return ie=="page"&&pt==ve.sel.primary()&&Lc(ce,lo(ce,un,"div").top-Ct.top),un},gt),Ce.length)for(var $e=0;$e<ve.sel.ranges.length;$e++)ve.sel.ranges[$e].goalColumn=Ce[$e]}),findWordAt:function(te){var ie=this.doc,ce=Xe(ie,te.line).text,ve=te.ch,Ce=te.ch;if(ce){var Ee=this.getHelper(te,"wordChars");(te.sticky=="before"||Ce==ce.length)&&ve?--ve:++Ce;for(var $e=ce.charAt(ve),pt=pe($e,Ee)?function(Ct){return pe(Ct,Ee)}:/\s/.test($e)?function(Ct){return/\s/.test(Ct)}:function(Ct){return!/\s/.test(Ct)&&!pe(Ct)};ve>0&&pt(ce.charAt(ve-1));)--ve;for(;Ce<ce.length&&pt(ce.charAt(Ce));)++Ce}return new Fi(Lt(te.line,ve),Lt(te.line,Ce))},toggleOverwrite:function(te){te!=null&&te==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Gt(this.display.cursorDiv,"CodeMirror-overwrite"):We(this.display.cursorDiv,"CodeMirror-overwrite"),ze(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==nt()},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:Lt(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,ve=function(Ee){return typeof Ee=="number"||/^\d+$/.test(String(Ee))?Ee+"px":Ee};te!=null&&(this.display.wrapper.style.width=ve(te)),ie!=null&&(this.display.wrapper.style.height=ve(ie)),this.options.lineWrapping&&La(this);var Ce=this.display.viewFrom;this.doc.iter(Ce,this.display.viewTo,function(Ee){if(Ee.widgets){for(var $e=0;$e<Ee.widgets.length;$e++)if(Ee.widgets[$e].noHScroll){Ao(ce,Ce,"widget");break}}++Ce}),this.curOp.forceUpdate=!0,ze(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),ze(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}},rn(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,ve){x.registerHelper(te,ie,ve),ne[te]._global.push({pred:ce,val:ve})}}function ru(x,z,ne,te,ie){var ce=z,ve=ne,Ce=Xe(x,z.line),Ee=ie&&x.direction=="rtl"?-ne:ne;function $e(){var Rr=z.line+Ee;return Rr<x.first||Rr>=x.first+x.size?!1:(z=new Lt(Rr,z.ch,z.sticky),Ce=Xe(x,Rr))}function pt(Rr){var Cr;if(te=="codepoint"){var Kr=Ce.text.charCodeAt(z.ch+(te>0?0:-1));isNaN(Kr)?Cr=null:Cr=new Lt(z.line,Math.max(0,Math.min(Ce.text.length,z.ch+ne*(Kr>=55296&&Kr<56320?2:1))),-ne)}else ie?Cr=Go(x.cm,Ce,z,ne):Cr=Uo(Ce,z,ne);if(Cr==null)if(!Rr&&$e())z=dl(ie,x.cm,Ce,z.line,Ee);else return!1;else z=Cr;return!0}if(te=="char"||te=="codepoint")pt();else if(te=="column")pt(!0);else if(te=="word"||te=="group")for(var Ct=null,un=te=="group",an=x.cm&&x.cm.getHelper(z,"wordChars"),On=!0;!(ne<0&&!pt(!On));On=!1){var Wn=Ce.text.charAt(z.ch)||`
`,vr=pe(Wn,an)?"w":un&&Wn==`
`?"n":!un||/\s/.test(Wn)?null:"p";if(un&&!On&&!vr&&(vr="s"),Ct&&Ct!=vr){ne<0&&(ne=1,pt(),z.sticky="after");break}if(vr&&(Ct=vr),ne>0&&!pt(!On))break}var Ar=Uc(x,z,ce,ve,!0);return it(ce,Ar)&&(Ar.hitSide=!0),Ar}function gh(x,z,ne,te){var ie=x.doc,ce=z.left,ve;if(te=="page"){var Ce=Math.min(x.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Ee=Math.max(Ce-.5*as(x.display),3);ve=(ne>0?z.bottom:z.top)+ne*Ee}else te=="line"&&(ve=ne>0?z.bottom+3:z.top-3);for(var $e;$e=Js(x,ce,ve),!!$e.outside;){if(ne<0?ve<=0:ve>=ie.height){$e.hitSide=!0;break}ve+=ne*5}return $e}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(Ce){for(var Ee=Ce.target;Ee;Ee=Ee.parentNode){if(Ee==ie)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Ee.className))break}return!1}cn(ie,"paste",function(Ce){!ce(Ce)||Ue(te,Ce)||ad(Ce,te)||Le<=11&&setTimeout(Sa(te,function(){return z.updateFromDOM()}),20)}),cn(ie,"compositionstart",function(Ce){z.composing={data:Ce.data,done:!1}}),cn(ie,"compositionupdate",function(Ce){z.composing||(z.composing={data:Ce.data,done:!1})}),cn(ie,"compositionend",function(Ce){z.composing&&(Ce.data!=z.composing.data&&z.readFromDOMSoon(),z.composing.done=!0)}),cn(ie,"touchstart",function(){return ne.forceCompositionEnd()}),cn(ie,"input",function(){z.composing||z.readFromDOMSoon()});function ve(Ce){if(!(!ce(Ce)||Ue(te,Ce))){if(te.somethingSelected())Rs({lineWise:!1,text:te.getSelections()}),Ce.type=="cut"&&te.replaceSelection("",null,"cut");else if(te.options.lineWiseCopyCut){var Ee=Il(te);Rs({lineWise:!0,text:Ee.text}),Ce.type=="cut"&&te.operation(function(){te.setSelections(Ee.ranges,0,qe),te.replaceSelection("",null,"cut")})}else return;if(Ce.clipboardData){Ce.clipboardData.clearData();var $e=zo.text.join(`
`);if(Ce.clipboardData.setData("Text",$e),Ce.clipboardData.getData("Text")==$e){Ce.preventDefault();return}}var pt=sd(),Ct=pt.firstChild;te.display.lineSpace.insertBefore(pt,te.display.lineSpace.firstChild),Ct.value=zo.text.join(`
`);var un=document.activeElement;on(Ct),setTimeout(function(){te.display.lineSpace.removeChild(pt),un.focus(),un==ie&&ne.showPrimarySelection()},50)}}cn(ie,"copy",ve),cn(ie,"cut",ve)},Vi.prototype.screenReaderLabelChanged=function(x){x?this.div.setAttribute("aria-label",x):this.div.removeAttribute("aria-label")},Vi.prototype.prepareSelection=function(){var x=_u(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),ve=iu(z,x.focusNode,x.focusOffset);if(!(ce&&!ce.bad&&ve&&!ve.bad&&ln(At(ce,ve),te)==0&&ln(Et(ce,ve),ie)==0)){var Ce=z.display.view,Ee=te.line>=z.display.viewFrom&&vh(z,te)||{node:Ce[0].measure.map[2],offset:0},$e=ie.line<z.display.viewTo&&vh(z,ie);if(!$e){var pt=Ce[Ce.length-1].measure,Ct=pt.maps?pt.maps[pt.maps.length-1]:pt.map;$e={node:Ct[Ct.length-1],offset:Ct[Ct.length-2]-Ct[Ct.length-3]}}if(!Ee||!$e){x.removeAllRanges();return}var un=x.rangeCount&&x.getRangeAt(0),an;try{an=ut(Ee.node,Ee.offset,$e.offset,$e.node)}catch(On){}an&&(!fe&&z.state.focused?(x.collapse(Ee.node,Ee.offset),an.collapsed||(x.removeAllRanges(),x.addRange(an))):(x.removeAllRanges(),x.addRange(an)),un&&x.anchorNode==null?x.addRange(un):fe&&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){Mt(this.cm.display.cursorDiv,x.cursors),Mt(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 Pt(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(Je&&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),qe),(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=Lt(te.line-1,Xe(x.doc,te.line-1).length)),ie.ch==Xe(x.doc,ie.line).text.length&&ie.line<x.lastLine()&&(ie=Lt(ie.line+1,0)),te.line<z.viewFrom||ie.line>z.viewTo-1)return!1;var ce,ve,Ce;te.line==z.viewFrom||(ce=po(x,te.line))==0?(ve=Wt(z.view[0].line),Ce=z.view[0].node):(ve=Wt(z.view[ce].line),Ce=z.view[ce-1].node.nextSibling);var Ee=po(x,ie.line),$e,pt;if(Ee==z.view.length-1?($e=z.viewTo-1,pt=z.lineDiv.lastChild):($e=Wt(z.view[Ee+1].line)-1,pt=z.view[Ee+1].node.previousSibling),!Ce)return!1;for(var Ct=x.doc.splitLines(uf(x,Ce,pt,ve,$e)),un=dt(x.doc,Lt(ve,0),Lt($e,Xe(x.doc,$e).text.length));Ct.length>1&&un.length>1;)if(Vt(Ct)==Vt(un))Ct.pop(),un.pop(),$e--;else if(Ct[0]==un[0])Ct.shift(),un.shift(),ve++;else break;for(var an=0,On=0,Wn=Ct[0],vr=un[0],Ar=Math.min(Wn.length,vr.length);an<Ar&&Wn.charCodeAt(an)==vr.charCodeAt(an);)++an;for(var Rr=Vt(Ct),Cr=Vt(un),Kr=Math.min(Rr.length-(Ct.length==1?an:0),Cr.length-(un.length==1?an:0));On<Kr&&Rr.charCodeAt(Rr.length-On-1)==Cr.charCodeAt(Cr.length-On-1);)++On;if(Ct.length==1&&un.length==1&&ve==te.line)for(;an&&an>te.ch&&Rr.charCodeAt(Rr.length-On-1)==Cr.charCodeAt(Cr.length-On-1);)an--,On++;Ct[Ct.length-1]=Rr.slice(0,Rr.length-On).replace(/^\u200b+/,""),Ct[0]=Ct[0].slice(an).replace(/\u200b+$/,"");var Qr=Lt(ve,an),ti=Lt($e,un.length?Vt(un).length-On:0);if(Ct.length>1||Ct[0]||ln(Qr,ti))return Ml(x.doc,Ct,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=Xe(x.doc,z.line),ie=Eo(ne,te,z.line),ce=_n(te,x.doc.direction),ve="left";if(ce){var Ce=dn(ce,z.ch);ve=Ce%2?"right":"left"}var Ee=rs(ie.map,z.ch,ve);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="",ve=!1,Ce=x.doc.lineSeparator(),Ee=!1;function $e(an){return function(On){return On.id==an}}function pt(){ve&&(ce+=Ce,Ee&&(ce+=Ce),ve=Ee=!1)}function Ct(an){an&&(pt(),ce+=an)}function un(an){if(an.nodeType==1){var On=an.getAttribute("cm-text");if(On){Ct(On);return}var Wn=an.getAttribute("cm-marker"),vr;if(Wn){var Ar=x.findMarks(Lt(te,0),Lt(ie+1,0),$e(+Wn));Ar.length&&(vr=Ar[0].find(0))&&Ct(dt(x.doc,vr.from,vr.to).join(Ce));return}if(an.getAttribute("contenteditable")=="false")return;var Rr=/^(pre|div|p|li|table|br)$/i.test(an.nodeName);if(!/^br$/i.test(an.nodeName)&&an.textContent.length==0)return;Rr&&pt();for(var Cr=0;Cr<an.childNodes.length;Cr++)un(an.childNodes[Cr]);/^(pre|p)$/i.test(an.nodeName)&&(Ee=!0),Rr&&(ve=!0)}else an.nodeType==3&&Ct(an.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;un(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(Lt(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||!Pt(te,z))return Pl(Lt(Wt(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(Lt(Wt(ce),ce.text.length),ie)}var ve=z.nodeType==3?z:null,Ce=z;for(!ve&&z.childNodes.length==1&&z.firstChild.nodeType==3&&(ve=z.firstChild,ne&&(ne=ve.nodeValue.length));Ce.parentNode!=te;)Ce=Ce.parentNode;var Ee=x.measure,$e=Ee.maps;function pt(vr,Ar,Rr){for(var Cr=-1;Cr<($e?$e.length:0);Cr++)for(var Kr=Cr<0?Ee.map:$e[Cr],Qr=0;Qr<Kr.length;Qr+=3){var ti=Kr[Qr+2];if(ti==vr||ti==Ar){var Ci=Wt(Cr<0?x.line:x.rest[Cr]),qi=Kr[Qr]+Rr;return(Rr<0||ti!=vr)&&(qi=Kr[Qr+(Rr?1:0)]),Lt(Ci,qi)}}}var Ct=pt(ve,Ce,ne);if(Ct)return Pl(Ct,ie);for(var un=Ce.nextSibling,an=ve?ve.nodeValue.length-ne:0;un;un=un.nextSibling){if(Ct=pt(un,un.firstChild,0),Ct)return Pl(Lt(Ct.line,Ct.ch-an),ie);an+=un.textContent.length}for(var On=Ce.previousSibling,Wn=ne;On;On=On.previousSibling){if(Ct=pt(On,On.firstChild,-1),Ct)return Pl(Lt(Ct.line,Ct.ch+Wn),ie);Wn+=On.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),ht&&(ie.style.width="0px"),cn(ie,"input",function(){be&&Le>=9&&z.hasSelection&&(z.hasSelection=null),ne.poll()}),cn(ie,"paste",function(ve){Ue(te,ve)||ad(ve,te)||(te.state.pasteIncoming=+new Date,ne.fastPoll())});function ce(ve){if(!Ue(te,ve)){if(te.somethingSelected())Rs({lineWise:!1,text:te.getSelections()});else if(te.options.lineWiseCopyCut){var Ce=Il(te);Rs({lineWise:!0,text:Ce.text}),ve.type=="cut"?te.setSelections(Ce.ranges,null,qe):(ne.prevInput="",ie.value=Ce.text.join(`
`),on(ie))}else return;ve.type=="cut"&&(te.state.cutIncoming=+new Date)}}cn(ie,"cut",ce),cn(ie,"copy",ce),cn(x.scroller,"paste",function(ve){if(!(oo(x,ve)||Ue(te,ve))){if(!ie.dispatchEvent){te.state.pasteIncoming=+new Date,ne.focus();return}var Ce=new Event("paste");Ce.clipboardData=ve.clipboardData,ie.dispatchEvent(Ce)}}),cn(x.lineSpace,"selectstart",function(ve){oo(x,ve)||An(ve)}),cn(ie,"compositionstart",function(){var ve=te.getCursor("from");ne.composing&&ne.composing.range.clear(),ne.composing={start:ve,range:te.markText(ve,te.getCursor("to"),{className:"CodeMirror-composing"})}}),cn(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=_u(x);if(x.options.moveInputWithCursor){var ie=Da(x,ne.sel.primary().head,"div"),ce=z.wrapper.getBoundingClientRect(),ve=z.lineDiv.getBoundingClientRect();te.teTop=Math.max(0,Math.min(z.wrapper.clientHeight-10,ie.top+ve.top-ce.top)),te.teLeft=Math.max(0,Math.min(z.wrapper.clientWidth-10,ie.left+ve.left-ce.left))}return te},Ji.prototype.showSelection=function(x){var z=this.cm,ne=z.display;Mt(ne.cursorDiv,x.cursors),Mt(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&&on(this.textarea),be&&Le>=9&&(this.hasSelection=ne)}else x||(this.prevInput=this.textarea.value="",be&&Le>=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"&&(!lt||nt()!=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&&Le>=9&&this.hasSelection===ie||st&&/[\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 ve=0,Ce=Math.min(te.length,ie.length);ve<Ce&&te.charCodeAt(ve)==ie.charCodeAt(ve);)++ve;return pa(z,function(){id(z,ie.slice(ve),te.length-ve,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&&Le>=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),ve=te.scroller.scrollTop;if(!ce||Pe)return;var Ce=ne.options.resetSelectionOnContextMenu;Ce&&ne.doc.sel.contains(ce)==-1&&Sa(ne,Ca)(ne.doc,Ro(ce),qe);var Ee=ie.style.cssText,$e=z.wrapper.style.cssText,pt=z.wrapper.offsetParent.getBoundingClientRect();z.wrapper.style.cssText="position: static",ie.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(x.clientY-pt.top-5)+"px; left: "+(x.clientX-pt.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 Ct;Re&&(Ct=window.scrollY),te.input.focus(),Re&&window.scrollTo(null,Ct),te.input.reset(),ne.somethingSelected()||(ie.value=z.prevInput=" "),z.contextMenuPending=an,te.selForContextMenu=ne.doc.sel,clearTimeout(te.detectingSelectAll);function un(){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 an(){if(z.contextMenuPending==an&&(z.contextMenuPending=!1,z.wrapper.style.cssText=$e,ie.style.cssText=Ee,be&&Le<9&&te.scrollbars.setScrollTop(te.scroller.scrollTop=ve),ie.selectionStart!=null)){(!be||be&&Le<9)&&un();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&&Le>=9&&un(),Ve){Fn(x);var On=function(){Ye(window,"mouseup",On),setTimeout(an,20)};cn(window,"mouseup",On)}else setTimeout(an,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?jt(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=nt();z.autofocus=ne==x||x.getAttribute("autofocus")!=null&&ne==document.body}function te(){x.value=Ce.getValue()}var ie;if(x.form&&(cn(x.form,"submit",te),!z.leaveSubmitMethodAlone)){var ce=x.form;ie=ce.submit;try{var ve=ce.submit=function(){te(),ce.submit=ie,ce.submit(),ce.submit=ve}}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&&(Ye(x.form,"submit",te),!z.leaveSubmitMethodAlone&&typeof x.form.submit=="function"&&(x.form.submit=ie))}},x.style.display="none";var Ce=si(function(Ee){return x.parentNode.insertBefore(Ee,x.nextSibling)},z);return Ce}function Bl(x){x.off=Ye,x.on=cn,x.wheelEventPixels=Nu,x.Doc=ya,x.splitLines=Mr,x.countColumn=Ke,x.findColumn=en,x.isWordChar=de,x.Pass=Xt,x.signal=ze,x.Line=mr,x.changeEnd=us,x.scrollbarModel=Tu,x.Pos=Lt,x.cmpPos=ln,x.modes=jr,x.mimeModes=Nr,x.resolveMode=Rn,x.getMode=$n,x.modeExtensions=wr,x.extendMode=ct,x.copyState=ke,x.startState=Ae,x.innerMode=Be,x.commands=Dl,x.keyMap=Yi,x.keyName=ul,x.isModifierKey=sc,x.lookupKey=ms,x.normalizeKeyMap=Yu,x.StringStream=Ie,x.SharedTextMarker=Si,x.TextMarker=Ts,x.LineWidget=kl,x.e_preventDefault=An,x.e_stopPropagation=In,x.e_stop=Fn,x.addClass=Gt,x.contains=Pt,x.rmClass=We,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)&&bt(ys,Bo)<0&&(si.prototype[Bo]=function(x){return function(){return x.apply(this.doc,arguments)}}(ya.prototype[Bo]));return rn(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(Mn,Qt,ue){(function(fe){fe(ue(89780),ue(15525),ue(98101))})(function(fe){"use strict";fe.defineMode("markdown",function(Ze,Fe){var tt=fe.getMode(Ze,"text/html"),be=tt.name=="null";function Le(Ke){if(fe.findModeByName){var xe=fe.findModeByName(Ke);xe&&(Ke=xe.mime||xe.mimes[0])}var bt=fe.getMode(Ze,Ke);return bt.name=="null"?null:bt}Fe.highlightFormatting===void 0&&(Fe.highlightFormatting=!1),Fe.maxBlockquoteDepth===void 0&&(Fe.maxBlockquoteDepth=0),Fe.taskLists===void 0&&(Fe.taskLists=!1),Fe.strikethrough===void 0&&(Fe.strikethrough=!1),Fe.emoji===void 0&&(Fe.emoji=!1),Fe.fencedCodeBlockHighlighting===void 0&&(Fe.fencedCodeBlockHighlighting=!0),Fe.fencedCodeBlockDefaultMode===void 0&&(Fe.fencedCodeBlockDefaultMode="text/plain"),Fe.xml===void 0&&(Fe.xml=!0),Fe.tokenTypeOverrides===void 0&&(Fe.tokenTypeOverrides={});var Re={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var Se in Re)Re.hasOwnProperty(Se)&&Fe.tokenTypeOverrides[Se]&&(Re[Se]=Fe.tokenTypeOverrides[Se]);var Me=/^([*\-_])(?:\s*\1){2,}\s*$/,Pe=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,rt=/^\[(x| )\](?=\s)/i,Te=Fe.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,He=/^ {0,3}(?:\={1,}|-{2,})\s*$/,ht=/^[^#!\[\]*_\\<>` "'(~:]+/,Je=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,lt=/^\s*\[[^\]]+?\]:.*$/,st=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,Rt=" ";function qt(Ke,xe,bt){return xe.f=xe.inline=bt,bt(Ke,xe)}function at(Ke,xe,bt){return xe.f=xe.block=bt,bt(Ke,xe)}function ft(Ke){return!Ke||!/\S/.test(Ke.string)}function Ve(Ke){if(Ke.linkTitle=!1,Ke.linkHref=!1,Ke.linkText=!1,Ke.em=!1,Ke.strong=!1,Ke.strikethrough=!1,Ke.quote=0,Ke.indentedCode=!1,Ke.f==We){var xe=be;if(!xe){var bt=fe.innerMode(tt,Ke.htmlState);xe=bt.mode.name=="xml"&&bt.state.tagStart===null&&!bt.state.context&&bt.state.tokenize.isInText}xe&&(Ke.f=Kt,Ke.block=_e,Ke.htmlState=null)}return Ke.trailingSpace=0,Ke.trailingSpaceNewLine=!1,Ke.prevLine=Ke.thisLine,Ke.thisLine={stream:null},null}function _e(Ke,xe){var bt=Ke.column()===xe.indentation,fn=ft(xe.prevLine.stream),Xt=xe.indentedCode,qe=xe.prevLine.hr,je=xe.list!==!1,gt=(xe.listStack[xe.listStack.length-1]||0)+3;xe.indentedCode=!1;var en=xe.indentation;if(xe.indentationDiff===null&&(xe.indentationDiff=xe.indentation,je)){for(xe.list=null;en<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=en-xe.listStack[xe.listStack.length-1])}var Zt=!fn&&!qe&&!xe.prevLine.header&&(!je||!Xt)&&!xe.prevLine.fencedCodeEnd,pn=(xe.list===!1||qe||fn)&&xe.indentation<=gt&&Ke.match(Me),Vt=null;if(xe.indentationDiff>=4&&(Xt||xe.prevLine.fencedCodeEnd||xe.prevLine.header||fn))return Ke.skipToEnd(),xe.indentedCode=!0,Re.code;if(Ke.eatSpace())return null;if(bt&&xe.indentation<=gt&&(Vt=Ke.match(Te))&&Vt[1].length<=6)return xe.quote=0,xe.header=Vt[1].length,xe.thisLine.header=!0,Fe.highlightFormatting&&(xe.formatting="header"),xe.f=xe.inline,Mt(xe);if(xe.indentation<=gt&&Ke.eat(">"))return xe.quote=bt?1:xe.quote+1,Fe.highlightFormatting&&(xe.formatting="quote"),Ke.eatSpace(),Mt(xe);if(!pn&&!xe.setext&&bt&&xe.indentation<=gt&&(Vt=Ke.match(Pe))){var Ft=Vt[1]?"ol":"ul";return xe.indentation=en+Ke.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,Fe.taskLists&&Ke.match(rt,!1)&&(xe.taskList=!0),xe.f=xe.inline,Fe.highlightFormatting&&(xe.formatting=["list","list-"+Ft]),Mt(xe)}else{if(bt&&xe.indentation<=gt&&(Vt=Ke.match(Je,!0)))return xe.quote=0,xe.fencedEndRE=new RegExp(Vt[1]+"+ *$"),xe.localMode=Fe.fencedCodeBlockHighlighting&&Le(Vt[2]||Fe.fencedCodeBlockDefaultMode),xe.localMode&&(xe.localState=fe.startState(xe.localMode)),xe.f=xe.block=et,Fe.highlightFormatting&&(xe.formatting="code-block"),xe.code=-1,Mt(xe);if(xe.setext||(!Zt||!je)&&!xe.quote&&xe.list===!1&&!xe.code&&!pn&&!lt.test(Ke.string)&&(Vt=Ke.lookAhead(1))&&(Vt=Vt.match(He)))return xe.setext?(xe.header=xe.setext,xe.setext=0,Ke.skipToEnd(),Fe.highlightFormatting&&(xe.formatting="header")):(xe.header=Vt[0].charAt(0)=="="?1:2,xe.setext=xe.header),xe.thisLine.header=!0,xe.f=xe.inline,Mt(xe);if(pn)return Ke.skipToEnd(),xe.hr=!0,xe.thisLine.hr=!0,Re.hr;if(Ke.peek()==="[")return qt(Ke,xe,mn)}return qt(Ke,xe,xe.inline)}function We(Ke,xe){var bt=tt.token(Ke,xe.htmlState);if(!be){var fn=fe.innerMode(tt,xe.htmlState);(fn.mode.name=="xml"&&fn.state.tagStart===null&&!fn.state.context&&fn.state.tokenize.isInText||xe.md_inside&&Ke.current().indexOf(">")>-1)&&(xe.f=Kt,xe.block=_e,xe.htmlState=null)}return bt}function et(Ke,xe){var bt=xe.listStack[xe.listStack.length-1]||0,fn=xe.indentation<bt,Xt=bt+3;if(xe.fencedEndRE&&xe.indentation<=Xt&&(fn||Ke.match(xe.fencedEndRE))){Fe.highlightFormatting&&(xe.formatting="code-block");var qe;return fn||(qe=Mt(xe)),xe.localMode=xe.localState=null,xe.block=_e,xe.f=Kt,xe.fencedEndRE=null,xe.code=0,xe.thisLine.fencedCodeEnd=!0,fn?at(Ke,xe,xe.block):qe}else return xe.localMode?xe.localMode.token(Ke,xe.localState):(Ke.skipToEnd(),Re.code)}function Mt(Ke){var xe=[];if(Ke.formatting){xe.push(Re.formatting),typeof Ke.formatting=="string"&&(Ke.formatting=[Ke.formatting]);for(var bt=0;bt<Ke.formatting.length;bt++)xe.push(Re.formatting+"-"+Ke.formatting[bt]),Ke.formatting[bt]==="header"&&xe.push(Re.formatting+"-"+Ke.formatting[bt]+"-"+Ke.header),Ke.formatting[bt]==="quote"&&(!Fe.maxBlockquoteDepth||Fe.maxBlockquoteDepth>=Ke.quote?xe.push(Re.formatting+"-"+Ke.formatting[bt]+"-"+Ke.quote):xe.push("error"))}if(Ke.taskOpen)return xe.push("meta"),xe.length?xe.join(" "):null;if(Ke.taskClosed)return xe.push("property"),xe.length?xe.join(" "):null;if(Ke.linkHref?xe.push(Re.linkHref,"url"):(Ke.strong&&xe.push(Re.strong),Ke.em&&xe.push(Re.em),Ke.strikethrough&&xe.push(Re.strikethrough),Ke.emoji&&xe.push(Re.emoji),Ke.linkText&&xe.push(Re.linkText),Ke.code&&xe.push(Re.code),Ke.image&&xe.push(Re.image),Ke.imageAltText&&xe.push(Re.imageAltText,"link"),Ke.imageMarker&&xe.push(Re.imageMarker)),Ke.header&&xe.push(Re.header,Re.header+"-"+Ke.header),Ke.quote&&(xe.push(Re.quote),!Fe.maxBlockquoteDepth||Fe.maxBlockquoteDepth>=Ke.quote?xe.push(Re.quote+"-"+Ke.quote):xe.push(Re.quote+"-"+Fe.maxBlockquoteDepth)),Ke.list!==!1){var fn=(Ke.listStack.length-1)%3;fn?fn===1?xe.push(Re.list2):xe.push(Re.list3):xe.push(Re.list1)}return Ke.trailingSpaceNewLine?xe.push("trailing-space-new-line"):Ke.trailingSpace&&xe.push("trailing-space-"+(Ke.trailingSpace%2?"a":"b")),xe.length?xe.join(" "):null}function Qe(Ke,xe){if(Ke.match(ht,!0))return Mt(xe)}function Kt(Ke,xe){var bt=xe.text(Ke,xe);if(typeof bt!="undefined")return bt;if(xe.list)return xe.list=null,Mt(xe);if(xe.taskList){var fn=Ke.match(rt,!0)[1]===" ";return fn?xe.taskOpen=!0:xe.taskClosed=!0,Fe.highlightFormatting&&(xe.formatting="task"),xe.taskList=!1,Mt(xe)}if(xe.taskOpen=!1,xe.taskClosed=!1,xe.header&&Ke.match(/^#+$/,!0))return Fe.highlightFormatting&&(xe.formatting="header"),Mt(xe);var Xt=Ke.next();if(xe.linkTitle){xe.linkTitle=!1;var qe=Xt;Xt==="("&&(qe=")"),qe=(qe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var je="^\\s*(?:[^"+qe+"\\\\]+|\\\\\\\\|\\\\.)"+qe;if(Ke.match(new RegExp(je),!0))return Re.linkHref}if(Xt==="`"){var gt=xe.formatting;Fe.highlightFormatting&&(xe.formatting="code"),Ke.eatWhile("`");var en=Ke.current().length;if(xe.code==0&&(!xe.quote||en==1))return xe.code=en,Mt(xe);if(en==xe.code){var Zt=Mt(xe);return xe.code=0,Zt}else return xe.formatting=gt,Mt(xe)}else if(xe.code)return Mt(xe);if(Xt==="\\"&&(Ke.next(),Fe.highlightFormatting)){var pn=Mt(xe),Vt=Re.formatting+"-escape";return pn?pn+" "+Vt:Vt}if(Xt==="!"&&Ke.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return xe.imageMarker=!0,xe.image=!0,Fe.highlightFormatting&&(xe.formatting="image"),Mt(xe);if(Xt==="["&&xe.imageMarker&&Ke.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return xe.imageMarker=!1,xe.imageAltText=!0,Fe.highlightFormatting&&(xe.formatting="image"),Mt(xe);if(Xt==="]"&&xe.imageAltText){Fe.highlightFormatting&&(xe.formatting="image");var pn=Mt(xe);return xe.imageAltText=!1,xe.image=!1,xe.inline=xe.f=Pt,pn}if(Xt==="["&&!xe.image)return xe.linkText&&Ke.match(/^.*?\]/)||(xe.linkText=!0,Fe.highlightFormatting&&(xe.formatting="link")),Mt(xe);if(Xt==="]"&&xe.linkText){Fe.highlightFormatting&&(xe.formatting="link");var pn=Mt(xe);return xe.linkText=!1,xe.inline=xe.f=Ke.match(/\(.*?\)| ?\[.*?\]/,!1)?Pt:Kt,pn}if(Xt==="<"&&Ke.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){xe.f=xe.inline=ut,Fe.highlightFormatting&&(xe.formatting="link");var pn=Mt(xe);return pn?pn+=" ":pn="",pn+Re.linkInline}if(Xt==="<"&&Ke.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){xe.f=xe.inline=ut,Fe.highlightFormatting&&(xe.formatting="link");var pn=Mt(xe);return pn?pn+=" ":pn="",pn+Re.linkEmail}if(Fe.xml&&Xt==="<"&&Ke.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Ft=Ke.string.indexOf(">",Ke.pos);if(Ft!=-1){var Tt=Ke.string.substring(Ke.start,Ft);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Tt)&&(xe.md_inside=!0)}return Ke.backUp(1),xe.htmlState=fe.startState(tt),at(Ke,xe,We)}if(Fe.xml&&Xt==="<"&&Ke.match(/^\/\w*?>/))return xe.md_inside=!1,"tag";if(Xt==="*"||Xt==="_"){for(var ge=1,se=Ke.pos==1?" ":Ke.string.charAt(Ke.pos-2);ge<3&&Ke.eat(Xt);)ge++;var oe=Ke.peek()||" ",de=!/\s/.test(oe)&&(!st.test(oe)||/\s/.test(se)||st.test(se)),pe=!/\s/.test(se)&&(!st.test(se)||/\s/.test(oe)||st.test(oe)),le=null,De=null;if(ge%2&&(!xe.em&&de&&(Xt==="*"||!pe||st.test(se))?le=!0:xe.em==Xt&&pe&&(Xt==="*"||!de||st.test(oe))&&(le=!1)),ge>1&&(!xe.strong&&de&&(Xt==="*"||!pe||st.test(se))?De=!0:xe.strong==Xt&&pe&&(Xt==="*"||!de||st.test(oe))&&(De=!1)),De!=null||le!=null){Fe.highlightFormatting&&(xe.formatting=le==null?"strong":De==null?"em":"strong em"),le===!0&&(xe.em=Xt),De===!0&&(xe.strong=Xt);var Zt=Mt(xe);return le===!1&&(xe.em=!1),De===!1&&(xe.strong=!1),Zt}}else if(Xt===" "&&(Ke.eat("*")||Ke.eat("_"))){if(Ke.peek()===" ")return Mt(xe);Ke.backUp(1)}if(Fe.strikethrough){if(Xt==="~"&&Ke.eatWhile(Xt)){if(xe.strikethrough){Fe.highlightFormatting&&(xe.formatting="strikethrough");var Zt=Mt(xe);return xe.strikethrough=!1,Zt}else if(Ke.match(/^[^\s]/,!1))return xe.strikethrough=!0,Fe.highlightFormatting&&(xe.formatting="strikethrough"),Mt(xe)}else if(Xt===" "&&Ke.match(/^~~/,!0)){if(Ke.peek()===" ")return Mt(xe);Ke.backUp(2)}}if(Fe.emoji&&Xt===":"&&Ke.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){xe.emoji=!0,Fe.highlightFormatting&&(xe.formatting="emoji");var ot=Mt(xe);return xe.emoji=!1,ot}return Xt===" "&&(Ke.match(/^ +$/,!1)?xe.trailingSpace++:xe.trailingSpace&&(xe.trailingSpaceNewLine=!0)),Mt(xe)}function ut(Ke,xe){var bt=Ke.next();if(bt===">"){xe.f=xe.inline=Kt,Fe.highlightFormatting&&(xe.formatting="link");var fn=Mt(xe);return fn?fn+=" ":fn="",fn+Re.linkInline}return Ke.match(/^[^>]+/,!0),Re.linkInline}function Pt(Ke,xe){if(Ke.eatSpace())return null;var bt=Ke.next();return bt==="("||bt==="["?(xe.f=xe.inline=Gt(bt==="("?")":"]"),Fe.highlightFormatting&&(xe.formatting="link-string"),xe.linkHref=!0,Mt(xe)):"error"}var nt={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function Gt(Ke){return function(xe,bt){var fn=xe.next();if(fn===Ke){bt.f=bt.inline=Kt,Fe.highlightFormatting&&(bt.formatting="link-string");var Xt=Mt(bt);return bt.linkHref=!1,Xt}return xe.match(nt[Ke]),bt.linkHref=!0,Mt(bt)}}function mn(Ke,xe){return Ke.match(/^([^\]\\]|\\.)*\]:/,!1)?(xe.f=on,Ke.next(),Fe.highlightFormatting&&(xe.formatting="link"),xe.linkText=!0,Mt(xe)):qt(Ke,xe,Kt)}function on(Ke,xe){if(Ke.match(/^\]:/,!0)){xe.f=xe.inline=sn,Fe.highlightFormatting&&(xe.formatting="link");var bt=Mt(xe);return xe.linkText=!1,bt}return Ke.match(/^([^\]\\]|\\.)+/,!0),Re.linkText}function sn(Ke,xe){return Ke.eatSpace()?null:(Ke.match(/^[^\s]+/,!0),Ke.peek()===void 0?xe.linkTitle=!0:Ke.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),xe.f=xe.inline=Kt,Re.linkHref+" url")}var jt={startState:function(){return{f:_e,prevLine:{stream:null},thisLine:{stream:null},block:_e,htmlState:null,indentation:0,inline:Kt,text:Qe,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(Ke){return{f:Ke.f,prevLine:Ke.prevLine,thisLine:Ke.thisLine,block:Ke.block,htmlState:Ke.htmlState&&fe.copyState(tt,Ke.htmlState),indentation:Ke.indentation,localMode:Ke.localMode,localState:Ke.localMode?fe.copyState(Ke.localMode,Ke.localState):null,inline:Ke.inline,text:Ke.text,formatting:!1,linkText:Ke.linkText,linkTitle:Ke.linkTitle,linkHref:Ke.linkHref,code:Ke.code,em:Ke.em,strong:Ke.strong,strikethrough:Ke.strikethrough,emoji:Ke.emoji,header:Ke.header,setext:Ke.setext,hr:Ke.hr,taskList:Ke.taskList,list:Ke.list,listStack:Ke.listStack.slice(0),quote:Ke.quote,indentedCode:Ke.indentedCode,trailingSpace:Ke.trailingSpace,trailingSpaceNewLine:Ke.trailingSpaceNewLine,md_inside:Ke.md_inside,fencedEndRE:Ke.fencedEndRE}},token:function(Ke,xe){if(xe.formatting=!1,Ke!=xe.thisLine.stream){if(xe.header=0,xe.hr=!1,Ke.match(/^\s*$/,!0))return Ve(xe),null;if(xe.prevLine=xe.thisLine,xe.thisLine={stream:Ke},xe.taskList=!1,xe.trailingSpace=0,xe.trailingSpaceNewLine=!1,!xe.localState&&(xe.f=xe.block,xe.f!=We)){var bt=Ke.match(/^\s*/,!0)[0].replace(/\t/g,Rt).length;if(xe.indentation=bt,xe.indentationDiff=null,bt>0)return null}}return xe.f(Ke,xe)},innerMode:function(Ke){return Ke.block==We?{state:Ke.htmlState,mode:tt}:Ke.localState?{state:Ke.localState,mode:Ke.localMode}:{state:Ke,mode:jt}},indent:function(Ke,xe,bt){return Ke.block==We&&tt.indent?tt.indent(Ke.htmlState,xe,bt):Ke.localState&&Ke.localMode.indent?Ke.localMode.indent(Ke.localState,xe,bt):fe.Pass},blankLine:Ve,getType:Mt,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return jt},"xml"),fe.defineMIME("text/markdown","markdown"),fe.defineMIME("text/x-markdown","markdown")})},98101:function(Mn,Qt,ue){(function(fe){fe(ue(89780))})(function(fe){"use strict";fe.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var Ze=0;Ze<fe.modeInfo.length;Ze++){var Fe=fe.modeInfo[Ze];Fe.mimes&&(Fe.mime=Fe.mimes[0])}fe.findModeByMIME=function(tt){tt=tt.toLowerCase();for(var be=0;be<fe.modeInfo.length;be++){var Le=fe.modeInfo[be];if(Le.mime==tt)return Le;if(Le.mimes){for(var Re=0;Re<Le.mimes.length;Re++)if(Le.mimes[Re]==tt)return Le}}if(/\+xml$/.test(tt))return fe.findModeByMIME("application/xml");if(/\+json$/.test(tt))return fe.findModeByMIME("application/json")},fe.findModeByExtension=function(tt){tt=tt.toLowerCase();for(var be=0;be<fe.modeInfo.length;be++){var Le=fe.modeInfo[be];if(Le.ext){for(var Re=0;Re<Le.ext.length;Re++)if(Le.ext[Re]==tt)return Le}}},fe.findModeByFileName=function(tt){for(var be=0;be<fe.modeInfo.length;be++){var Le=fe.modeInfo[be];if(Le.file&&Le.file.test(tt))return Le}var Re=tt.lastIndexOf("."),Se=Re>-1&&tt.substring(Re+1,tt.length);if(Se)return fe.findModeByExtension(Se)},fe.findModeByName=function(tt){tt=tt.toLowerCase();for(var be=0;be<fe.modeInfo.length;be++){var Le=fe.modeInfo[be];if(Le.name.toLowerCase()==tt)return Le;if(Le.alias){for(var Re=0;Re<Le.alias.length;Re++)if(Le.alias[Re].toLowerCase()==tt)return Le}}}})},67549:function(Mn,Qt,ue){(function(fe){fe(ue(89780))})(function(fe){"use strict";fe.defineMode("stex",function(Ze,Fe){"use strict";function tt(ht,Je){ht.cmdState.push(Je)}function be(ht){return ht.cmdState.length>0?ht.cmdState[ht.cmdState.length-1]:null}function Le(ht){var Je=ht.cmdState.pop();Je&&Je.closeBracket()}function Re(ht){for(var Je=ht.cmdState,lt=Je.length-1;lt>=0;lt--){var st=Je[lt];if(st.name!="DEFAULT")return st}return{styleIdentifier:function(){return null}}}function Se(ht,Je,lt){return function(){this.name=ht,this.bracketNo=0,this.style=Je,this.styles=lt,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=Se("importmodule","tag",["string","builtin"]),Me.documentclass=Se("documentclass","tag",["","atom"]),Me.usepackage=Se("usepackage","tag",["atom"]),Me.begin=Se("begin","tag",["atom"]),Me.end=Se("end","tag",["atom"]),Me.label=Se("label","tag",["atom"]),Me.ref=Se("ref","tag",["atom"]),Me.eqref=Se("eqref","tag",["atom"]),Me.cite=Se("cite","tag",["atom"]),Me.bibitem=Se("bibitem","tag",["atom"]),Me.Bibitem=Se("Bibitem","tag",["atom"]),Me.RBibitem=Se("RBibitem","tag",["atom"]),Me.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function Pe(ht,Je){ht.f=Je}function rt(ht,Je){var lt;if(ht.match(/^\\[a-zA-Z@]+/)){var st=ht.current().slice(1);return lt=Me.hasOwnProperty(st)?Me[st]:Me.DEFAULT,lt=new lt,tt(Je,lt),Pe(Je,He),lt.style}if(ht.match(/^\\[$&%#{}_]/)||ht.match(/^\\[,;!\/\\]/))return"tag";if(ht.match("\\["))return Pe(Je,function(qt,at){return Te(qt,at,"\\]")}),"keyword";if(ht.match("\\("))return Pe(Je,function(qt,at){return Te(qt,at,"\\)")}),"keyword";if(ht.match("$$"))return Pe(Je,function(qt,at){return Te(qt,at,"$$")}),"keyword";if(ht.match("$"))return Pe(Je,function(qt,at){return Te(qt,at,"$")}),"keyword";var Rt=ht.next();if(Rt=="%")return ht.skipToEnd(),"comment";if(Rt=="}"||Rt=="]"){if(lt=be(Je),lt)lt.closeBracket(Rt),Pe(Je,He);else return"error";return"bracket"}else return Rt=="{"||Rt=="["?(lt=Me.DEFAULT,lt=new lt,tt(Je,lt),"bracket"):/\d/.test(Rt)?(ht.eatWhile(/[\w.%]/),"atom"):(ht.eatWhile(/[\w\-_]/),lt=Re(Je),lt.name=="begin"&&(lt.argument=ht.current()),lt.styleIdentifier())}function Te(ht,Je,lt){if(ht.eatSpace())return null;if(lt&&ht.match(lt))return Pe(Je,rt),"keyword";if(ht.match(/^\\[a-zA-Z@]+/))return"tag";if(ht.match(/^[a-zA-Z]+/))return"variable-2";if(ht.match(/^\\[$&%#{}_]/)||ht.match(/^\\[,;!\/]/)||ht.match(/^[\^_&]/))return"tag";if(ht.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(ht.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var st=ht.next();return st=="{"||st=="}"||st=="["||st=="]"||st=="("||st==")"?"bracket":st=="%"?(ht.skipToEnd(),"comment"):"error"}function He(ht,Je){var lt=ht.peek(),st;return lt=="{"||lt=="["?(st=be(Je),st.openBracket(lt),ht.eat(lt),Pe(Je,rt),"bracket"):/[ \t\r]/.test(lt)?(ht.eat(lt),null):(Pe(Je,rt),Le(Je),rt(ht,Je))}return{startState:function(){var ht=Fe.inMathMode?function(Je,lt){return Te(Je,lt)}:rt;return{cmdState:[],f:ht}},copyState:function(ht){return{cmdState:ht.cmdState.slice(),f:ht.f}},token:function(ht,Je){return Je.f(ht,Je)},blankLine:function(ht){ht.f=rt,ht.cmdState.length=0},lineComment:"%"}}),fe.defineMIME("text/x-stex","stex"),fe.defineMIME("text/x-latex","stex")})},15525:function(Mn,Qt,ue){(function(fe){fe(ue(89780))})(function(fe){"use strict";var Ze={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},Fe={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};fe.defineMode("xml",function(tt,be){var Le=tt.indentUnit,Re={},Se=be.htmlMode?Ze:Fe;for(var Me in Se)Re[Me]=Se[Me];for(var Me in be)Re[Me]=be[Me];var Pe,rt;function Te(ut,Pt){function nt(on){return Pt.tokenize=on,on(ut,Pt)}var Gt=ut.next();if(Gt=="<")return ut.eat("!")?ut.eat("[")?ut.match("CDATA[")?nt(Je("atom","]]>")):null:ut.match("--")?nt(Je("comment","-->")):ut.match("DOCTYPE",!0,!0)?(ut.eatWhile(/[\w\._\-]/),nt(lt(1))):null:ut.eat("?")?(ut.eatWhile(/[\w\._\-]/),Pt.tokenize=Je("meta","?>"),"meta"):(Pe=ut.eat("/")?"closeTag":"openTag",Pt.tokenize=He,"tag bracket");if(Gt=="&"){var mn;return ut.eat("#")?ut.eat("x")?mn=ut.eatWhile(/[a-fA-F\d]/)&&ut.eat(";"):mn=ut.eatWhile(/[\d]/)&&ut.eat(";"):mn=ut.eatWhile(/[\w\.\-:]/)&&ut.eat(";"),mn?"atom":"error"}else return ut.eatWhile(/[^&<]/),null}Te.isInText=!0;function He(ut,Pt){var nt=ut.next();if(nt==">"||nt=="/"&&ut.eat(">"))return Pt.tokenize=Te,Pe=nt==">"?"endTag":"selfcloseTag","tag bracket";if(nt=="=")return Pe="equals",null;if(nt=="<"){Pt.tokenize=Te,Pt.state=at,Pt.tagName=Pt.tagStart=null;var Gt=Pt.tokenize(ut,Pt);return Gt?Gt+" tag error":"tag error"}else return/[\'\"]/.test(nt)?(Pt.tokenize=ht(nt),Pt.stringStartCol=ut.column(),Pt.tokenize(ut,Pt)):(ut.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function ht(ut){var Pt=function(nt,Gt){for(;!nt.eol();)if(nt.next()==ut){Gt.tokenize=He;break}return"string"};return Pt.isInAttribute=!0,Pt}function Je(ut,Pt){return function(nt,Gt){for(;!nt.eol();){if(nt.match(Pt)){Gt.tokenize=Te;break}nt.next()}return ut}}function lt(ut){return function(Pt,nt){for(var Gt;(Gt=Pt.next())!=null;){if(Gt=="<")return nt.tokenize=lt(ut+1),nt.tokenize(Pt,nt);if(Gt==">")if(ut==1){nt.tokenize=Te;break}else return nt.tokenize=lt(ut-1),nt.tokenize(Pt,nt)}return"meta"}}function st(ut,Pt,nt){this.prev=ut.context,this.tagName=Pt,this.indent=ut.indented,this.startOfLine=nt,(Re.doNotIndent.hasOwnProperty(Pt)||ut.context&&ut.context.noIndent)&&(this.noIndent=!0)}function Rt(ut){ut.context&&(ut.context=ut.context.prev)}function qt(ut,Pt){for(var nt;;){if(!ut.context||(nt=ut.context.tagName,!Re.contextGrabbers.hasOwnProperty(nt)||!Re.contextGrabbers[nt].hasOwnProperty(Pt)))return;Rt(ut)}}function at(ut,Pt,nt){return ut=="openTag"?(nt.tagStart=Pt.column(),ft):ut=="closeTag"?Ve:at}function ft(ut,Pt,nt){return ut=="word"?(nt.tagName=Pt.current(),rt="tag",et):Re.allowMissingTagName&&ut=="endTag"?(rt="tag bracket",et(ut,Pt,nt)):(rt="error",ft)}function Ve(ut,Pt,nt){if(ut=="word"){var Gt=Pt.current();return nt.context&&nt.context.tagName!=Gt&&Re.implicitlyClosed.hasOwnProperty(nt.context.tagName)&&Rt(nt),nt.context&&nt.context.tagName==Gt||Re.matchClosing===!1?(rt="tag",_e):(rt="tag error",We)}else return Re.allowMissingTagName&&ut=="endTag"?(rt="tag bracket",_e(ut,Pt,nt)):(rt="error",We)}function _e(ut,Pt,nt){return ut!="endTag"?(rt="error",_e):(Rt(nt),at)}function We(ut,Pt,nt){return rt="error",_e(ut,Pt,nt)}function et(ut,Pt,nt){if(ut=="word")return rt="attribute",Mt;if(ut=="endTag"||ut=="selfcloseTag"){var Gt=nt.tagName,mn=nt.tagStart;return nt.tagName=nt.tagStart=null,ut=="selfcloseTag"||Re.autoSelfClosers.hasOwnProperty(Gt)?qt(nt,Gt):(qt(nt,Gt),nt.context=new st(nt,Gt,mn==nt.indented)),at}return rt="error",et}function Mt(ut,Pt,nt){return ut=="equals"?Qe:(Re.allowMissing||(rt="error"),et(ut,Pt,nt))}function Qe(ut,Pt,nt){return ut=="string"?Kt:ut=="word"&&Re.allowUnquoted?(rt="string",et):(rt="error",et(ut,Pt,nt))}function Kt(ut,Pt,nt){return ut=="string"?Kt:et(ut,Pt,nt)}return{startState:function(ut){var Pt={tokenize:Te,state:at,indented:ut||0,tagName:null,tagStart:null,context:null};return ut!=null&&(Pt.baseIndent=ut),Pt},token:function(ut,Pt){if(!Pt.tagName&&ut.sol()&&(Pt.indented=ut.indentation()),ut.eatSpace())return null;Pe=null;var nt=Pt.tokenize(ut,Pt);return(nt||Pe)&&nt!="comment"&&(rt=null,Pt.state=Pt.state(Pe||nt,ut,Pt),rt&&(nt=rt=="error"?nt+" error":rt)),nt},indent:function(ut,Pt,nt){var Gt=ut.context;if(ut.tokenize.isInAttribute)return ut.tagStart==ut.indented?ut.stringStartCol+1:ut.indented+Le;if(Gt&&Gt.noIndent)return fe.Pass;if(ut.tokenize!=He&&ut.tokenize!=Te)return nt?nt.match(/^(\s*)/)[0].length:0;if(ut.tagName)return Re.multilineTagIndentPastTag!==!1?ut.tagStart+ut.tagName.length+2:ut.tagStart+Le*(Re.multilineTagIndentFactor||1);if(Re.alignCDATA&&/<!\[CDATA\[/.test(Pt))return 0;var mn=Pt&&/^<(\/)?([\w_:\.-]*)/.exec(Pt);if(mn&&mn[1])for(;Gt;)if(Gt.tagName==mn[2]){Gt=Gt.prev;break}else if(Re.implicitlyClosed.hasOwnProperty(Gt.tagName))Gt=Gt.prev;else break;else if(mn)for(;Gt;){var on=Re.contextGrabbers[Gt.tagName];if(on&&on.hasOwnProperty(mn[2]))Gt=Gt.prev;else break}for(;Gt&&Gt.prev&&!Gt.startOfLine;)Gt=Gt.prev;return Gt?Gt.indent+Le:ut.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:Re.htmlMode?"html":"xml",helperType:Re.htmlMode?"html":"xml",skipAttribute:function(ut){ut.state==Qe&&(ut.state=et)},xmlCurrentTag:function(ut){return ut.tagName?{name:ut.tagName,close:ut.type=="closeTag"}:null},xmlCurrentContext:function(ut){for(var Pt=[],nt=ut.context;nt;nt=nt.prev)nt.tagName&&Pt.push(nt.tagName);return Pt.reverse()}}}),fe.defineMIME("text/xml","xml"),fe.defineMIME("application/xml","xml"),fe.mimeModes.hasOwnProperty("text/html")||fe.defineMIME("text/html",{name:"xml",htmlMode:!0})})},2859:function(Mn,Qt,ue){"use strict";ue.d(Qt,{hP:function(){return Tt}});var fe=function(ge,se){return(fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(oe,de){oe.__proto__=de}||function(oe,de){for(var pe in de)Object.prototype.hasOwnProperty.call(de,pe)&&(oe[pe]=de[pe])})(ge,se)};function Ze(ge,se){function oe(){this.constructor=ge}fe(ge,se),ge.prototype=se===null?Object.create(se):(oe.prototype=se.prototype,new oe)}function Fe(ge,se,oe,de){return new(oe||(oe=Promise))(function(pe,le){function De(It){try{$t(de.next(It))}catch(Ut){le(Ut)}}function ot(It){try{$t(de.throw(It))}catch(Ut){le(Ut)}}function $t(It){var Ut;It.done?pe(It.value):(Ut=It.value,Ut instanceof oe?Ut:new oe(function(Yt){Yt(Ut)})).then(De,ot)}$t((de=de.apply(ge,se||[])).next())})}function tt(ge,se){var oe,de,pe,le,De={label:0,sent:function(){if(1&pe[0])throw pe[1];return pe[1]},trys:[],ops:[]};return le={next:ot(0),throw:ot(1),return:ot(2)},typeof Symbol=="function"&&(le[Symbol.iterator]=function(){return this}),le;function ot($t){return function(It){return function(Ut){if(oe)throw new TypeError("Generator is already executing.");for(;De;)try{if(oe=1,de&&(pe=2&Ut[0]?de.return:Ut[0]?de.throw||((pe=de.return)&&pe.call(de),0):de.next)&&!(pe=pe.call(de,Ut[1])).done)return pe;switch(de=0,pe&&(Ut=[2&Ut[0],pe.value]),Ut[0]){case 0:case 1:pe=Ut;break;case 4:return De.label++,{value:Ut[1],done:!1};case 5:De.label++,de=Ut[1],Ut=[0];continue;case 7:Ut=De.ops.pop(),De.trys.pop();continue;default:if(pe=De.trys,!((pe=pe.length>0&&pe[pe.length-1])||Ut[0]!==6&&Ut[0]!==2)){De=0;continue}if(Ut[0]===3&&(!pe||Ut[1]>pe[0]&&Ut[1]<pe[3])){De.label=Ut[1];break}if(Ut[0]===6&&De.label<pe[1]){De.label=pe[1],pe=Ut;break}if(pe&&De.label<pe[2]){De.label=pe[2],De.ops.push(Ut);break}pe[2]&&De.ops.pop(),De.trys.pop();continue}Ut=se.call(ge,De)}catch(Yt){Ut=[6,Yt],de=0}finally{oe=pe=0}if(5&Ut[0])throw Ut[1];return{value:Ut[0]?Ut[1]:void 0,done:!0}}([$t,It])}}}function be(){for(var ge=0,se=0,oe=arguments.length;se<oe;se++)ge+=arguments[se].length;var de=Array(ge),pe=0;for(se=0;se<oe;se++)for(var le=arguments[se],De=0,ot=le.length;De<ot;De++,pe++)de[pe]=le[De];return de}var Le=function(){function ge(){}return ge.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ge.setAttributes=function(se,oe){for(var de=0,pe=oe;de<pe.length;de++){var le=pe[de],De=le[0],ot=le[1];se.setAttribute(De,ot)}},ge.createRect=function(se,oe,de){var pe=document.createElementNS("http://www.w3.org/2000/svg","rect");return pe.setAttribute("width",se.toString()),pe.setAttribute("height",oe.toString()),de&&ge.setAttributes(pe,de),pe},ge.createLine=function(se,oe,de,pe,le){var De=document.createElementNS("http://www.w3.org/2000/svg","line");return De.setAttribute("x1",se.toString()),De.setAttribute("y1",oe.toString()),De.setAttribute("x2",de.toString()),De.setAttribute("y2",pe.toString()),le&&ge.setAttributes(De,le),De},ge.createPolygon=function(se,oe){var de=document.createElementNS("http://www.w3.org/2000/svg","polygon");return de.setAttribute("points",se),oe&&ge.setAttributes(de,oe),de},ge.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&&ge.setAttributes(de,oe),de},ge.createEllipse=function(se,oe,de){var pe=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return pe.setAttribute("cx",(se/2).toString()),pe.setAttribute("cy",(oe/2).toString()),pe.setAttribute("rx",(se/2).toString()),pe.setAttribute("ry",(oe/2).toString()),de&&ge.setAttributes(pe,de),pe},ge.createGroup=function(se){var oe=document.createElementNS("http://www.w3.org/2000/svg","g");return se&&ge.setAttributes(oe,se),oe},ge.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ge.createMarker=function(se,oe,de,pe,le,De,ot){var $t=document.createElementNS("http://www.w3.org/2000/svg","marker");return ge.setAttributes($t,[["id",se],["orient",oe],["markerWidth",de.toString()],["markerHeight",pe.toString()],["refX",le.toString()],["refY",De.toString()]]),$t.appendChild(ot),$t},ge.createText=function(se){var oe=document.createElementNS("http://www.w3.org/2000/svg","text");return oe.setAttribute("x","0"),oe.setAttribute("y","0"),se&&ge.setAttributes(oe,se),oe},ge.createTSpan=function(se,oe){var de=document.createElementNS("http://www.w3.org/2000/svg","tspan");return de.textContent=se,oe&&ge.setAttributes(de,oe),de},ge.createImage=function(se){var oe=document.createElementNS("http://www.w3.org/2000/svg","image");return se&&ge.setAttributes(oe,se),oe},ge.createPoint=function(se,oe){var de=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return de.x=se,de.y=oe,de},ge.createPath=function(se,oe){var de=document.createElementNS("http://www.w3.org/2000/svg","path");return de.setAttribute("d",se),oe&&ge.setAttributes(de,oe),de},ge}(),Re=function(){function ge(){}return ge.addKey=function(se){ge.key=se},Object.defineProperty(ge,"isLicensed",{get:function(){return!!ge.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ge.key)},enumerable:!1,configurable:!0}),ge}(),Se=function(){function ge(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return ge.prototype.rasterize=function(se,oe,de){var pe=this;return new Promise(function(le){var De=de!==void 0?de:document.createElement("canvas");se===null&&(pe.markersOnly=!0,pe.naturalSize=!1);var ot=document.createElementNS("http://www.w3.org/2000/svg","svg");ot.setAttribute("xmlns","http://www.w3.org/2000/svg"),ot.setAttribute("width",oe.width.baseVal.valueAsString),ot.setAttribute("height",oe.height.baseVal.valueAsString),ot.setAttribute("viewBox","0 0 "+oe.viewBox.baseVal.width.toString()+" "+oe.viewBox.baseVal.height.toString()),ot.innerHTML=oe.innerHTML,pe.naturalSize===!0?(ot.width.baseVal.value=se.naturalWidth,ot.height.baseVal.value=se.naturalHeight):pe.width!==void 0&&pe.height!==void 0&&(ot.width.baseVal.value=pe.width,ot.height.baseVal.value=pe.height),De.width=ot.width.baseVal.value,De.height=ot.height.baseVal.value;var $t=ot.outerHTML,It=De.getContext("2d");pe.markersOnly!==!0&&It.drawImage(se,0,0,De.width,De.height);var Ut=window.URL,Yt=new Image(De.width,De.height);Yt.setAttribute("crossOrigin","anonymous");var dn=new Blob([$t],{type:"image/svg+xml"}),hn=Ut.createObjectURL(dn);Yt.onload=function(){It.drawImage(Yt,0,0),Ut.revokeObjectURL(hn);var _n=De.toDataURL(pe.imageType,pe.imageQuality);le(_n)},Yt.src=hn})},ge}(),Me=function(){},Pe=function(){function ge(se){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+se+"_"}return Object.defineProperty(ge.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ge.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(ge.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),ge.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},ge.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)},ge.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 rt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new rt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new rt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Te("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Te("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},ge.prototype.removeStyleSheet=function(){var se;this.styleSheet&&(((se=this.styleSheetRoot)!==null&&se!==void 0?se:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ge}(),rt=function(ge,se){this.selector=ge,this.style=se},Te=function(ge,se){this.localName=ge,this.style=se},He=function(){function ge(se,oe,de,pe,le){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=se,this.displayMode=oe,this.markerItems=de,this.uiStyleSettings=pe,this.styles=le,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return ge.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 De=document.createElement("div");De.className=""+oe.toolbarButtonStyleClass.name,De.setAttribute("data-type-name",le.typeName),De.innerHTML=le.icon,De.addEventListener("click",function(){oe.markerToolbarButtonClicked(De,le)}),oe.buttons.push(De),oe.markerButtons.push(De)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var pe=document.createElement("div");pe.className=this.toolbarBlockStyleClass.name,pe.style.whiteSpace="nowrap",pe.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(pe),this.addActionButton(pe,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(pe,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},ge.prototype.addButtonClickListener=function(se){this.buttonClickListeners.push(se)},ge.prototype.removeButtonClickListener=function(se){this.buttonClickListeners.indexOf(se)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(se),1)},ge.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ge.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]))}},ge.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")},ge.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)})},ge.prototype.addActionButton=function(se,oe,de){var pe=this,le=document.createElement("div");switch(le.className=""+this.toolbarButtonStyleClass.name,le.innerHTML=oe,le.setAttribute("data-action",de),le.addEventListener("click",function(){pe.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)},ge.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Te("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 Te("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Te("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Te("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 Te("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var se=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Te("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 Te("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Te("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new rt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new rt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},ge.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"},ge.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])},ge.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)},ge.prototype.setActiveMarkerButton=function(se){var oe=this.markerButtons.find(function(de){return de.getAttribute("data-type-name")===se});oe&&this.setActiveButton(oe)},ge.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")})},ge}(),ht=function(){function ge(se,oe,de,pe){this.panels=[],this.panelButtons=[],this.markerjsContainer=se,this.displayMode=oe,this.uiStyleSettings=de,this.styles=pe,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ge.prototype.addStyles=function(){var se;this.toolboxStyleClass=this.styles.addClass(new Te("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 Te("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var oe=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Te("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Te("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Te("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 Te("toolbox-panel-row_colors",`
background-color: `+((se=this.uiStyleSettings.toolboxBackgroundColor)!==null&&se!==void 0?se:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Te("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 Te("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Te("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new rt("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new rt("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},ge.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)},ge.prototype.setPanelButtons=function(se){var oe,de,pe=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 De;le.uiStyleSettings=pe.uiStyleSettings;var ot=document.createElement("div");ot.className=pe.toolboxButtonStyleClass.name+" "+((De=pe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&De!==void 0?De:pe.toolboxButtonStyleColorsClass.name),ot.innerHTML=le.icon,ot.title=le.title,ot.addEventListener("click",function(){pe.panelButtonClick(le)}),pe.panelButtons.push(ot),pe.buttonRow.appendChild(ot)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ge.prototype.panelButtonClick=function(se){var oe=this,de=-1;if(se!==this.activePanel){de=this.panels.indexOf(se),this.panelRow.innerHTML="";var pe=se.getUi();pe.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(pe),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=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,De){var ot,$t;le.className=oe.toolboxButtonStyleClass.name+" "+(De===de?""+((ot=oe.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ot!==void 0?ot:oe.toolboxActiveButtonStyleColorsClass.name):""+(($t=oe.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&$t!==void 0?$t:oe.toolboxButtonStyleColorsClass.name))})},ge}(),Je=function(ge,se){this.title=ge,this.icon=se},lt=function(ge){function se(oe,de,pe,le){var De=ge.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 De.colors=[],De.addTransparent=!1,De.colorBoxes=[],De.colors=de,De.currentColor=pe,De.setCurrentColor=De.setCurrentColor.bind(De),De.getColorBox=De.getColorBox.bind(De),De}return Ze(se,ge),se.prototype.getUi=function(){var oe=this,de=document.createElement("div");return de.style.overflow="hidden",de.style.whiteSpace="nowrap",this.colors.forEach(function(pe){var le=oe.getColorBox(pe);de.appendChild(le),oe.colorBoxes.push(le)}),de},se.prototype.getColorBox=function(oe){var de=this,pe=this.uiStyleSettings.toolbarHeight/4,le=this.uiStyleSettings.toolbarHeight-pe,De=document.createElement("div");De.style.display="inline-block",De.style.boxSizing="content-box",De.style.width=le-2+"px",De.style.height=le-2+"px",De.style.padding="1px",De.style.marginRight="2px",De.style.marginBottom="2px",De.style.borderWidth="2px",De.style.borderStyle="solid",De.style.borderRadius=(le+2)/2+"px",De.style.borderColor=oe===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",De.addEventListener("click",function(){de.setCurrentColor(oe,De)});var ot=document.createElement("div");return ot.style.display="inline-block",ot.style.width=le-2+"px",ot.style.height=le-2+"px",ot.style.backgroundColor=oe,ot.style.borderRadius=le/2+"px",oe==="transparent"&&(ot.style.fill=this.uiStyleSettings.toolboxAccentColor,ot.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>`),De.appendChild(ot),De},se.prototype.setCurrentColor=function(oe,de){var pe=this;this.currentColor=oe,this.colorBoxes.forEach(function(le){le.style.borderColor=le===de?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(oe)},se}(Je),st=function(){function ge(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(ge.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),ge.prototype.ownsTarget=function(se){return!1},Object.defineProperty(ge.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),ge.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},ge.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},ge.prototype.pointerDown=function(se,oe){},ge.prototype.dblClick=function(se,oe){},ge.prototype.manipulate=function(se){},ge.prototype.pointerUp=function(se){this.stateChanged()},ge.prototype.dispose=function(){},ge.prototype.addMarkerVisualToContainer=function(se){this.container.childNodes.length>0?this.container.insertBefore(se,this.container.childNodes[0]):this.container.appendChild(se)},ge.prototype.getState=function(){return{typeName:ge.typeName,state:this.state,notes:this.notes}},ge.prototype.restoreState=function(se){this._state=se.state,this.notes=se.notes},ge.prototype.scale=function(se,oe){},ge.prototype.colorChanged=function(se){this.onColorChanged&&this.onColorChanged(se),this.stateChanged()},ge.prototype.fillColorChanged=function(se){this.onFillColorChanged&&this.onFillColorChanged(se),this.stateChanged()},ge.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)}},ge.typeName="MarkerBase",ge}(),Rt=function(){function ge(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ge.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},ge}(),qt=function(){function ge(){this.GRIP_SIZE=10,this.visual=Le.createGroup(),this.visual.appendChild(Le.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Le.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ge.prototype.ownsTarget=function(se){return se===this.visual||se===this.visual.childNodes[0]||se===this.visual.childNodes[1]},ge}(),at=function(){function ge(){}return ge.toITransformMatrix=function(se){return{a:se.a,b:se.b,c:se.c,d:se.d,e:se.e,f:se.f}},ge.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},ge}(),ft=function(ge){function se(oe,de,pe){var le=ge.call(this,oe,de,pe)||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(Le.createTransform()),le.setupControlBox(),le}return Ze(se,ge),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=Le.createTransform();this._visual.transform.baseVal.appendItem(de)},enumerable:!1,configurable:!0}),se.prototype.ownsTarget=function(oe){return!!ge.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){ge.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 pe=this.unrotatePoint(oe);if(this.manipulationStartX=pe.x,this.manipulationStartY=pe.y,this.offsetX=pe.x-this.left,this.offsetY=pe.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(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 De=this.container.transform.baseVal.getItem(0);De.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(De,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},se.prototype.pointerUp=function(oe){var de=this.state;ge.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,pe=this.manipulationStartWidth,le=this.manipulationStartTop,De=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:de=this.manipulationStartLeft+oe.x-this.manipulationStartX,pe=this.manipulationStartWidth+this.manipulationStartLeft-de;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:pe=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,De=this.manipulationStartHeight+this.manipulationStartTop-le;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:De=this.manipulationStartHeight+oe.y-this.manipulationStartY}pe>=0?(this.left=de,this.width=pe):(this.left=de+pe,this.width=-pe),De>=0?(this.top=le,this.height=De):(this.top=le+De,this.height=-De),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(),pe=Le.createPoint(oe.x,oe.y);return{x:(pe=pe.matrixTransform(de)).x,y:pe.y}},se.prototype.unrotatePoint=function(oe){if(this.rotationAngle===0)return oe;var de=this.container.getCTM();de=de.inverse();var pe=Le.createPoint(oe.x,oe.y);return{x:(pe=pe.matrixTransform(de)).x,y:pe.y}},se.prototype.select=function(){ge.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},se.prototype.deselect=function(){ge.prototype.deselect.call(this),this.controlBox.style.display="none"},se.prototype.setupControlBox=function(){this.controlBox=Le.createGroup();var oe=Le.createTransform();oe.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(oe),this.container.appendChild(this.controlBox),this.controlRect=Le.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=Le.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 Rt,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(Le.createTransform()),this.controlBox.appendChild(oe.visual),oe},se.prototype.positionGrips=function(){var oe=this.controlGrips.topLeft.GRIP_SIZE,de=-oe/2,pe=de,le=(this.width+this.CB_DISTANCE)/2-oe/2,De=(this.height+this.CB_DISTANCE)/2-oe/2,ot=this.height+this.CB_DISTANCE-oe/2,$t=this.width+this.CB_DISTANCE-oe/2;this.positionGrip(this.controlGrips.topLeft.visual,de,pe),this.positionGrip(this.controlGrips.topCenter.visual,le,pe),this.positionGrip(this.controlGrips.topRight.visual,$t,pe),this.positionGrip(this.controlGrips.centerLeft.visual,de,De),this.positionGrip(this.controlGrips.centerRight.visual,$t,De),this.positionGrip(this.controlGrips.bottomLeft.visual,de,ot),this.positionGrip(this.controlGrips.bottomCenter.visual,le,ot),this.positionGrip(this.controlGrips.bottomRight.visual,$t,ot),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,le,pe-3*this.CB_DISTANCE)},se.prototype.positionGrip=function(oe,de,pe){var le=oe.transform.baseVal.getItem(0);le.setTranslate(de,pe),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:at.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:at.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},ge.prototype.getState.call(this))},se.prototype.restoreState=function(oe){ge.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(at.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,de.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(at.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,de.containerTransformMatrix))},se.prototype.scale=function(oe,de){ge.prototype.scale.call(this,oe,de);var pe=this.rotatePoint({x:this.left,y:this.top}),le=this.unrotatePoint({x:pe.x*oe,y:pe.y*de});this.left=le.x,this.top=le.y,this.width=this.width*oe,this.height=this.height*de,this.adjustControlBox()},se}(st),Ve=function(ge){function se(oe,de,pe){var le=ge.call(this,oe,de,pe)||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 Ze(se,ge),se.prototype.ownsTarget=function(oe){return!(!ge.prototype.ownsTarget.call(this,oe)&&oe!==this.visual)},se.prototype.createVisual=function(){this.visual=Le.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){ge.prototype.pointerDown.call(this,oe,de),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},se.prototype.manipulate=function(oe){ge.prototype.manipulate.call(this,oe)},se.prototype.resize=function(oe){ge.prototype.resize.call(this,oe),this.setSize()},se.prototype.setSize=function(){ge.prototype.setSize.call(this),Le.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},se.prototype.pointerUp=function(oe){ge.prototype.pointerUp.call(this,oe),this.setSize()},se.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.visual&&Le.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(oe),this.stateChanged()},se.prototype.setFillColor=function(oe){this.fillColor=oe,this.visual&&Le.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},se.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.visual&&Le.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},se.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.visual&&Le.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},ge.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(),ge.prototype.restoreState.call(this,oe),this.setSize()},se.prototype.scale=function(oe,de){ge.prototype.scale.call(this,oe,de),this.setSize()},se.title="Rectangle marker",se}(ft),_e=function(ge){function se(oe,de,pe,le){var De=ge.call(this,oe,le||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return De.widths=[],De.widthBoxes=[],De.widths=de,De.currentWidth=pe,De.setCurrentWidth=De.setCurrentWidth.bind(De),De}return Ze(se,ge),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(pe){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=pe===oe.currentWidth?oe.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){oe.setCurrentWidth(pe,le)}),de.appendChild(le);var De=document.createElement("div");De.innerText=pe.toString(),De.style.marginRight="5px",le.appendChild(De);var ot=document.createElement("div");ot.style.minHeight="20px",ot.style.flexGrow="2",ot.style.display="flex",ot.style.alignItems="center";var $t=document.createElement("hr");$t.style.minWidth="20px",$t.style.border="0px",$t.style.borderTop=pe+"px solid "+oe.uiStyleSettings.toolboxColor,$t.style.flexGrow="2",ot.appendChild($t),le.appendChild(ot),oe.widthBoxes.push(le)}),de},se.prototype.setCurrentWidth=function(oe,de){var pe=this;this.currentWidth=oe,this.widthBoxes.forEach(function(le){le.style.borderColor=le===de?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},se}(Je),We=function(ge){function se(oe,de,pe,le){var De=ge.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 De.styles=[],De.styleBoxes=[],De.styles=de,De.currentStyle=pe,De.setCurrentStyle=De.setCurrentStyle.bind(De),De}return Ze(se,ge),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(pe){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=pe===oe.currentStyle?oe.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){oe.setCurrentStyle(pe,le)}),de.appendChild(le);var De=document.createElement("div");De.style.minHeight="20px",De.style.flexGrow="2",De.style.overflow="hidden";var ot=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+oe.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(pe!==""?'stroke-dasharray="'+pe+'"':"")+` />
</svg>`;De.innerHTML=ot,le.appendChild(De),oe.styleBoxes.push(le)}),de},se.prototype.setCurrentStyle=function(oe,de){var pe=this;this.currentStyle=oe,this.styleBoxes.forEach(function(le){le.style.borderColor=le===de?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},se}(Je),et=function(ge){function se(oe,de,pe){var le=ge.call(this,oe,de,pe)||this;return le.strokeColor=pe.defaultColor,le.strokeWidth=pe.defaultStrokeWidth,le.strokeDasharray=pe.defaultStrokeDasharray,le.strokePanel=new lt("Line color",pe.defaultColorSet,pe.defaultColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.strokeWidthPanel=new _e("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new We("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le}return Ze(se,ge),Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=ge.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}(Ve),Mt=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"},Qe=function(ge){function se(oe,de,pe){var le=ge.call(this,oe,de,pe)||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 Ze(se,ge),se.prototype.ownsTarget=function(oe){return!!ge.prototype.ownsTarget.call(this,oe)||!(!this.grip1.ownsTarget(oe)&&!this.grip2.ownsTarget(oe))},se.prototype.pointerDown=function(oe,de){ge.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;ge.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(){ge.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},se.prototype.deselect=function(){ge.prototype.deselect.call(this),this.controlBox.style.display="none"},se.prototype.setupControlBox=function(){this.controlBox=Le.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(Le.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,pe){var le=oe.transform.baseVal.getItem(0);le.setTranslate(de,pe),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},ge.prototype.getState.call(this))},se.prototype.restoreState=function(oe){ge.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){ge.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}(st),Kt=function(ge){function se(oe,de,pe){var le=ge.call(this,oe,de,pe)||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=pe.defaultColor,le.strokeWidth=pe.defaultStrokeWidth,le.strokeDasharray=pe.defaultStrokeDasharray,le.strokePanel=new lt("Line color",pe.defaultColorSet,pe.defaultColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.strokeWidthPanel=new _e("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new We("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le}return Ze(se,ge),se.prototype.ownsTarget=function(oe){return!(!ge.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.selectorLine&&oe!==this.visibleLine)},se.prototype.createVisual=function(){this.visual=Le.createGroup(),this.selectorLine=Le.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=Le.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){ge.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()),Le.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),Le.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),Le.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},ge.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){ge.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}(Qe),ut=function(ge){function se(oe,de,pe,le){var De=ge.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 De.fonts=[],De.fontBoxes=[],De.fonts=de,De.currentFont=pe,De.setCurrentFont=De.setCurrentFont.bind(De),De}return Ze(se,ge),se.prototype.getUi=function(){var oe=this,de=document.createElement("div");return de.style.overflow="hidden",de.style.flexGrow="2",this.fonts.forEach(function(pe){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=pe===oe.currentFont?oe.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){oe.setCurrentFont(pe,le)}),de.appendChild(le);var De=document.createElement("div");De.style.display="flex",De.style.minHeight="20px",De.style.flexGrow="2",De.style.fontFamily=pe,De.style.overflow="hidden";var ot=document.createElement("div");ot.style.whiteSpace="nowrap",ot.style.overflow="hidden",ot.style.textOverflow="ellipsis",ot.innerHTML="The quick brown fox jumps over the lazy dog",De.appendChild(ot),le.appendChild(De),oe.fontBoxes.push(le)}),de},se.prototype.setCurrentFont=function(oe,de){var pe=this;this.currentFont=oe,this.fontBoxes.forEach(function(le){le.style.borderColor=le===de?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},se}(Je),Pt=function(ge){function se(oe,de,pe){var le=ge.call(this,oe,de,pe)||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=pe.defaultColor,le.fontFamily=pe.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 lt("Color",pe.defaultColorSet,pe.defaultColor),le.colorPanel.onColorChanged=le.setColor,le.fontFamilyPanel=new ut("Font",pe.defaultFontFamilies,pe.defaultFontFamily),le.fontFamilyPanel.onFontChanged=le.setFont,le}return Ze(se,ge),se.prototype.ownsTarget=function(oe){if(ge.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(pe){pe===oe&&(de=!0)}),de},se.prototype.createVisual=function(){this.visual=Le.createGroup(),this.bgRectangle=Le.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=Le.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(Le.createTransform()),this.textElement.transform.baseVal.appendItem(Le.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},se.prototype.pointerDown=function(oe,de){ge.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(Le.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 pe=(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(pe,le)}return de},se.prototype.getTextPosition=function(oe){var de=this.textElement.getBBox(),pe=0,le=0;return de.width>0&&de.height>0&&(pe=(this.width-de.width*oe)/2,le=this.height/2-de.height*oe/2),{x:pe,y:le}},se.prototype.sizeText=function(){var oe=this.textElement.getBBox(),de=this.getTextScale(),pe=this.getTextPosition(de);pe.y-=oe.y*de,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+pe.x+"px, "+pe.y+"px) scale("+de+", "+de+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(pe.x,pe.y),this.textElement.transform.baseVal.getItem(1).setScale(de,de))},se.prototype.manipulate=function(oe){ge.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){ge.prototype.resize.call(this,oe),this.isMoved=!0,this.setSize(),this.sizeText()},se.prototype.setSize=function(){ge.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(Le.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Le.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),ge.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 pe=de.clipboardData.getData("text"),le=window.getSelection();if(!le.rangeCount)return!1;le.deleteFromDocument(),le.getRangeAt(0).insertNode(document.createTextNode(pe)),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}),pe=this.textElement.getBBox(),le={x:pe.width*oe,y:pe.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(){ge.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},se.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ge.prototype.deselect.call(this)},se.prototype.dblClick=function(oe,de){ge.prototype.dblClick.call(this,oe,de),this.showTextEditor()},se.prototype.setColor=function(oe){this.textElement&&Le.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&&Le.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},ge.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(),ge.prototype.restoreState.call(this,oe),this.setSize()},se.prototype.scale=function(oe,de){ge.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),nt=function(ge){function se(oe,de,pe){var le=ge.call(this,oe,de,pe)||this;return le.color="transparent",le.lineWidth=3,le.drawing=!1,le.pixelRatio=1,le.color=pe.defaultColor,le.lineWidth=pe.defaultStrokeWidth,le.pixelRatio=pe.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 lt("Color",pe.defaultColorSet,pe.defaultColor),le.colorPanel.onColorChanged=le.setColor,le.lineWidthPanel=new _e("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),le.lineWidthPanel.onWidthChanged=le.setLineWidth,le}return Ze(se,ge),se.prototype.ownsTarget=function(oe){return!(!ge.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.drawingImage)},se.prototype.createVisual=function(){this.visual=Le.createGroup(),this.drawingImage=Le.createImage(),this.visual.appendChild(this.drawingImage);var oe=Le.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):ge.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()):ge.prototype.manipulate.call(this,oe)},se.prototype.resize=function(oe){ge.prototype.resize.call(this,oe),Le.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Le.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()):ge.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(),ge.prototype.select.call(this)},se.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ge.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],pe=de[0],le=de[1],De=de[2],ot=de[3],$t=!1,It=0;It<this.canvasElement.height;It++)for(var Ut=0;Ut<this.canvasElement.width;Ut++)oe.data[It*this.canvasElement.width*4+4*Ut+3]>0&&($t=!0,It<le&&(le=It),Ut<pe&&(pe=Ut),It>ot&&(ot=It),Ut>De&&(De=Ut));if($t){this.left=pe/this.pixelRatio,this.top=le/this.pixelRatio,this.width=(De-pe)/this.pixelRatio,this.height=(ot-le)/this.pixelRatio;var Yt=document.createElement("canvas");Yt.width=De-pe,Yt.height=ot-le,Yt.getContext("2d").putImageData(this.canvasContext.getImageData(pe,le,De-pe,ot-le),0,0),this.drawingImgUrl=Yt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},se.prototype.setDrawingImage=function(){Le.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),Le.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},ge.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){this.createVisual(),ge.prototype.restoreState.call(this,oe),this.drawingImgUrl=oe.drawingImgUrl,this.setDrawingImage()},se.prototype.scale=function(oe,de){ge.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),Gt=function(ge){function se(oe,de,pe){var le=ge.call(this,oe,pe||'<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 Ze(se,ge),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 pe=function(ot){var $t="both";switch(ot){case 0:$t="both";break;case 1:$t="start";break;case 2:$t="end";break;case 3:$t="none"}var It=document.createElement("div");if(It.style.display="flex",It.style.flexGrow="2",It.style.alignItems="center",It.style.justifyContent="space-between",It.style.padding="5px",It.style.borderWidth="2px",It.style.borderStyle="solid",It.style.borderColor=$t===le.currentType?le.uiStyleSettings.toolboxAccentColor:"transparent",It.addEventListener("click",function(){oe.setCurrentType($t,It)}),de.appendChild(It),$t==="both"||$t==="start"){var Ut=document.createElement("div");Ut.style.display="flex",Ut.style.alignItems="center",Ut.style.minHeight="20px",Ut.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>`,Ut.style.marginLeft="5px",It.appendChild(Ut)}var Yt=document.createElement("div");Yt.style.display="flex",Yt.style.alignItems="center",Yt.style.minHeight="20px",Yt.style.flexGrow="2";var dn=document.createElement("hr");if(dn.style.minWidth="20px",dn.style.border="0px",dn.style.borderTop="3px solid "+(le.uiStyleSettings!==void 0?le.uiStyleSettings.toolboxColor:"#eeeeee"),dn.style.flexGrow="2",Yt.appendChild(dn),It.appendChild(Yt),$t==="both"||$t==="end"){var hn=document.createElement("div");hn.style.display="flex",hn.style.alignItems="center",hn.style.minHeight="20px",hn.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>`,hn.style.marginRight="5px",It.appendChild(hn)}le.typeBoxes.push(It)},le=this,De=0;De<4;De++)pe(De);return de},se.prototype.setCurrentType=function(oe,de){var pe=this;this.currentType=oe,this.typeBoxes.forEach(function(le){le.style.borderColor=le===de?pe.uiStyleSettings!==void 0?pe.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},se}(Je),mn=function(ge){function se(oe,de,pe){var le=ge.call(this,oe,de,pe)||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 Gt("Arrow type","end"),le.arrowTypePanel.onArrowTypeChanged=le.setArrowType,le}return Ze(se,ge),se.prototype.ownsTarget=function(oe){return!(!ge.prototype.ownsTarget.call(this,oe)&&oe!==this.arrow1&&oe!==this.arrow2)},se.prototype.getArrowPoints=function(oe,de){var pe=this.arrowBaseWidth+2*this.strokeWidth,le=this.arrowBaseHeight+2*this.strokeWidth;return oe-pe/2+","+(de+le/2)+" "+oe+","+(de-le/2)+" "+(oe+pe/2)+","+(de+le/2)},se.prototype.createTips=function(){this.arrow1=Le.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(Le.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=Le.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(Le.createTransform()),this.visual.appendChild(this.arrow2)},se.prototype.pointerDown=function(oe,de){ge.prototype.pointerDown.call(this,oe,de),this.state==="creating"&&this.createTips()},se.prototype.adjustVisual=function(){if(ge.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",Le.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),Le.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 pe=this.arrow2.transform.baseVal.getItem(0);pe.setRotate(oe+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(pe,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},ge.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){ge.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}(Kt),on=function(ge){function se(oe,de,pe){var le=ge.call(this,oe,de,pe)||this;return le.fillColor=pe.defaultFillColor,le.strokeWidth=0,le.fillPanel=new lt("Color",pe.defaultColorSet,pe.defaultFillColor),le.fillPanel.onColorChanged=le.setFillColor,le}return Ze(se,ge),Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=ge.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}(Ve),sn=function(ge){function se(oe,de,pe,le){var De=ge.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 De.opacities=[],De.opacityBoxes=[],De.opacities=de,De.currentOpacity=pe,De.setCurrentOpacity=De.setCurrentOpacity.bind(De),De}return Ze(se,ge),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(pe){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=pe===oe.currentOpacity?oe.uiStyleSettings.toolboxAccentColor:"transparent",le.addEventListener("click",function(){oe.setCurrentOpacity(pe,le)}),de.appendChild(le);var De=document.createElement("div");De.innerText=100*pe+"%",le.appendChild(De),oe.opacityBoxes.push(le)}),de},se.prototype.setCurrentOpacity=function(oe,de){var pe=this;this.currentOpacity=oe,this.opacityBoxes.forEach(function(le){le.style.borderColor=le===de?pe.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},se}(Je),jt=function(ge){function se(oe,de,pe){var le=ge.call(this,oe,de,pe)||this;return le.setOpacity=le.setOpacity.bind(le),le.fillColor=pe.defaultHighlightColor,le.strokeWidth=0,le.opacity=pe.defaultHighlightOpacity,le.fillPanel=new lt("Color",pe.defaultColorSet,le.fillColor),le.fillPanel.onColorChanged=le.setFillColor,le.opacityPanel=new sn("Opacity",pe.defaultOpacitySteps,le.opacity),le.opacityPanel.onOpacityChanged=le.setOpacity,le}return Ze(se,ge),se.prototype.setOpacity=function(oe){this.opacity=oe,this.visual&&Le.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=ge.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}(on),Ke='<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>',bt=function(ge){function se(oe,de,pe){var le=ge.call(this,oe,de,pe)||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=pe.defaultStrokeColor,le.bgColor=pe.defaultFillColor,le.fontFamily=pe.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 lt("Text color",pe.defaultColorSet,le.color,Ke),le.colorPanel.onColorChanged=le.setColor,le.bgColorPanel=new lt("Fill color",pe.defaultColorSet,le.bgColor,xe),le.bgColorPanel.onColorChanged=le.setBgColor,le.fontFamilyPanel=new ut("Font",pe.defaultFontFamilies,pe.defaultFontFamily),le.fontFamilyPanel.onFontChanged=le.setFont,le.tipGrip=new qt,le.tipGrip.visual.transform.baseVal.appendItem(Le.createTransform()),le.controlBox.appendChild(le.tipGrip.visual),le}return Ze(se,ge),se.prototype.ownsTarget=function(oe){return ge.prototype.ownsTarget.call(this,oe)||this.tipGrip.ownsTarget(oe)||this.tip===oe},se.prototype.createTip=function(){Le.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=Le.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},se.prototype.pointerDown=function(oe,de){this.state==="new"&&ge.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):ge.prototype.pointerDown.call(this,oe,de)},se.prototype.pointerUp=function(oe){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ge.prototype.pointerUp.call(this,oe);else{var de=this.state==="creating";ge.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 ge.prototype.manipulate.call(this,oe)},se.prototype.setBgColor=function(oe){this.bgRectangle&&this.tip&&(Le.setAttributes(this.bgRectangle,[["fill",oe]]),Le.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),pe=this.height/5;oe&&(this.tipPosition={x:de+pe/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))?(pe=this.width/5,de=Math.min(this.width/2,15),this.tipBase1Position={x:de,y:0},this.tipBase2Position={x:de+pe,y:0}):(this.tipBase1Position={x:0,y:de},this.tipBase2Position={x:0,y:de+pe}):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))?(pe=this.width/5,de=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-de-pe,y:0},this.tipBase2Position={x:this.width-de,y:0}):(this.tipBase1Position={x:this.width,y:de},this.tipBase2Position={x:this.width,y:de+pe}):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))?(pe=this.width/5,de=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-de-pe,y:this.height},this.tipBase2Position={x:this.width-de,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-de-pe},this.tipBase2Position={x:this.width,y:this.height-de}):le<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(pe=this.width/5,de=Math.min(this.width/2,15),this.tipBase1Position={x:de,y:this.height},this.tipBase2Position={x:de+pe,y:this.height}):(this.tipBase1Position={x:0,y:this.height-de},this.tipBase2Position={x:0,y:this.height-de-pe})},se.prototype.resize=function(oe){ge.prototype.resize.call(this,oe),this.positionTip()},se.prototype.positionTip=function(){Le.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(),ge.prototype.select.call(this)},se.prototype.getState=function(){var oe=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},ge.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,ge.prototype.restoreState.call(this,oe),this.createTip(),this.setTipPoints()},se.prototype.scale=function(oe,de){ge.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}(Pt),fn=function(ge){function se(oe,de,pe){var le=ge.call(this,oe,de,pe)||this;return le.fillColor="transparent",le.strokeColor="transparent",le.strokeWidth=0,le.strokeDasharray="",le.opacity=1,le.strokeColor=pe.defaultColor,le.strokeWidth=pe.defaultStrokeWidth,le.strokeDasharray=pe.defaultStrokeDasharray,le.fillColor=pe.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 lt("Line color",be(pe.defaultColorSet,["transparent"]),pe.defaultColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.fillPanel=new lt("Fill color",be(pe.defaultColorSet,["transparent"]),le.fillColor,xe),le.fillPanel.onColorChanged=le.setFillColor,le.strokeWidthPanel=new _e("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new We("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le.opacityPanel=new sn("Opacity",pe.defaultOpacitySteps,le.opacity),le.opacityPanel.onOpacityChanged=le.setOpacity,le}return Ze(se,ge),se.prototype.ownsTarget=function(oe){return!(!ge.prototype.ownsTarget.call(this,oe)&&oe!==this.visual)},se.prototype.createVisual=function(){this.visual=Le.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){ge.prototype.pointerDown.call(this,oe,de),this.state==="new"&&(this.createVisual(),this.moveVisual(oe),this._state="creating")},se.prototype.manipulate=function(oe){ge.prototype.manipulate.call(this,oe)},se.prototype.resize=function(oe){ge.prototype.resize.call(this,oe),this.setSize()},se.prototype.setSize=function(){ge.prototype.setSize.call(this),Le.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){ge.prototype.pointerUp.call(this,oe),this.setSize()},se.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.visual&&Le.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(oe),this.stateChanged()},se.prototype.setFillColor=function(oe){this.fillColor=oe,this.visual&&Le.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(oe),this.stateChanged()},se.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.visual&&Le.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},se.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.visual&&Le.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},se.prototype.setOpacity=function(oe){this.opacity=oe,this.visual&&Le.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},ge.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(),ge.prototype.restoreState.call(this,oe),this.setSize()},se.prototype.scale=function(oe,de){ge.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),Xt=function(ge){function se(oe,de,pe){return ge.call(this,oe,de,pe)||this}return Ze(se,ge),Object.defineProperty(se.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),se.prototype.ownsTarget=function(oe){return!(!ge.prototype.ownsTarget.call(this,oe)&&oe!==this.tip1&&oe!==this.tip2)},se.prototype.createTips=function(){this.tip1=Le.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(Le.createTransform()),this.visual.appendChild(this.tip1),this.tip2=Le.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(Le.createTransform()),this.visual.appendChild(this.tip2)},se.prototype.pointerDown=function(oe,de){ge.prototype.pointerDown.call(this,oe,de),this.state==="creating"&&this.createTips()},se.prototype.adjustVisual=function(){if(ge.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(Le.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()]]),Le.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 pe=this.tip2.transform.baseVal.getItem(0);pe.setRotate(oe+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(pe,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=ge.prototype.getState.call(this);return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){ge.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}(Kt),qe=function(ge){function se(oe,de,pe){var le=ge.call(this,oe,de,pe)||this;return le.strokePanel.colors=pe.defaultColorSet,le.fillColor="transparent",le}return Ze(se,ge),Object.defineProperty(se.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),se.prototype.getState=function(){var oe=ge.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}(fn),je=function(){function ge(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(ge.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),ge.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))},ge.prototype.replaceLastUndoStep=function(se){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=se)},ge.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},ge.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}},ge.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},ge}(),gt=function(ge){function se(oe,de,pe){var le=ge.call(this,oe,de,pe)||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=pe.defaultColor,le.strokeWidth=pe.defaultStrokeWidth,le.strokeDasharray=pe.defaultStrokeDasharray,le.strokePanel=new lt("Line color",pe.defaultColorSet,pe.defaultColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.strokeWidthPanel=new _e("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new We("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le}return Ze(se,ge),se.prototype.ownsTarget=function(oe){return!(!ge.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=Le.createGroup(),this.selectorCurve=Le.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=Le.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){ge.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()),Le.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),Le.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),Le.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},se.prototype.setupControlBox=function(){ge.prototype.setupControlBox.call(this),this.curveControlLine1=Le.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=Le.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,ge.prototype.addControlGrips.call(this)},se.prototype.positionGrips=function(){ge.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),ge.prototype.manipulate.call(this,oe)},se.prototype.resize=function(oe){this.activeGrip===this.curveGrip&&(this.curveX=oe.x,this.curveY=oe.y),ge.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,ge.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},ge.prototype.getState.call(this));return oe.typeName=se.typeName,oe},se.prototype.restoreState=function(oe){ge.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}(Qe),en=function(ge){function se(oe,de,pe){var le=ge.call(this,oe,de,pe)||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=pe.defaultColor,le.strokeWidth=pe.defaultStrokeWidth,le.strokeDasharray=pe.defaultStrokeDasharray,le.fillColor=pe.defaultFillColor,le.textColor=pe.defaultStrokeColor,le.fontFamily=pe.defaultFontFamily,le.fontSize=pe.defaultCaptionFontSize,le.captionText=pe.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 lt("Line color",be(pe.defaultColorSet,["transparent"]),le.strokeColor),le.strokePanel.onColorChanged=le.setStrokeColor,le.fillPanel=new lt("Fill color",be(pe.defaultColorSet,["transparent"]),le.fillColor,xe),le.fillPanel.onColorChanged=le.setFillColor,le.strokeWidthPanel=new _e("Line width",pe.defaultStrokeWidths,pe.defaultStrokeWidth),le.strokeWidthPanel.onWidthChanged=le.setStrokeWidth,le.strokeStylePanel=new We("Line style",pe.defaultStrokeDasharrays,pe.defaultStrokeDasharray),le.strokeStylePanel.onStyleChanged=le.setStrokeDasharray,le.fontFamilyPanel=new ut("Font",pe.defaultFontFamilies,pe.defaultFontFamily),le.fontFamilyPanel.onFontChanged=le.setFont,le.textColorPanel=new lt("Text color",pe.defaultColorSet,le.textColor,Ke),le.textColorPanel.onColorChanged=le.setTextColor,le}return Ze(se,ge),se.prototype.ownsTarget=function(oe){return!(!ge.prototype.ownsTarget.call(this,oe)&&oe!==this.visual&&oe!==this.frame&&oe!==this.captionBg&&oe!==this.captionElement)},se.prototype.createVisual=function(){this.visual=Le.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=Le.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=Le.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=Le.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){ge.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){ge.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){ge.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),Le.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')"]]),Le.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&&Le.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&&Le.setAttributes(this.captionElement,[["fill",oe]]),this.textColor=oe,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},se.prototype.setSize=function(){ge.prototype.setSize.call(this),Le.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},se.prototype.pointerUp=function(oe){ge.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){ge.prototype.dblClick.call(this,oe,de),this.showTextEditor()},se.prototype.setStrokeColor=function(oe){this.strokeColor=oe,this.frame&&Le.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(oe),this.stateChanged()},se.prototype.setFillColor=function(oe){this.fillColor=oe,this.captionBg&&Le.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(oe),this.stateChanged()},se.prototype.setStrokeWidth=function(oe){this.strokeWidth=oe,this.frame&&Le.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},se.prototype.setStrokeDasharray=function(oe){this.strokeDasharray=oe,this.frame&&Le.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},ge.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(),ge.prototype.restoreState.call(this,oe),this.setSize()},se.prototype.scale=function(oe,de){ge.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),Zt=function(){function ge(se,oe){oe===void 0&&(oe=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=se,this.cancelable=oe}return Object.defineProperty(ge.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ge.prototype.preventDefault=function(){this._defaultPrevented=!0},ge}(),pn=function(ge){function se(oe,de,pe){var le=ge.call(this,oe,!1)||this;return le.dataUrl=de,le.state=pe,le}return Ze(se,ge),se}(Zt),Vt=function(ge){function se(oe,de,pe){pe===void 0&&(pe=!1);var le=ge.call(this,oe,pe)||this;return le.marker=de,le}return Ze(se,ge),se}(Zt),Ft=function(){function ge(){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 ge.prototype.addEventListener=function(se,oe){this[se].push(oe)},ge.prototype.removeEventListener=function(se,oe){var de=this[se].indexOf(oe);de>-1&&this[se].splice(de,1)},ge}(),Tt=function(){function ge(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 Mt,this._isOpen=!1,this.undoRedoManager=new je,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 Ft,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ge.instanceCounter++,this.styles=new Pe(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(ge.prototype,"ALL_MARKER_TYPES",{get:function(){return[et,nt,mn,Pt,qe,fn,jt,bt,Xt,on,Kt,gt,en]},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[et,nt,mn,Pt,fn,jt,bt]},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"BASIC_MARKER_TYPES",{get:function(){return[et,nt,mn,Pt,jt]},enumerable:!1,configurable:!0}),Object.defineProperty(ge.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 pe=oe.ALL_MARKER_TYPES.find(function(le){return le.typeName===de});pe!==void 0&&oe._availableMarkerTypes.push(pe)}else oe._availableMarkerTypes.push(de)})},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ge.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ge.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(ge.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),ge.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Re.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ge.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 Zt(se))})},ge.prototype.render=function(){return Fe(this,void 0,void 0,function(){var se;return tt(this,function(oe){switch(oe.label){case 0:return this.setCurrentMarker(),(se=new Se).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()]}})})},ge.prototype.close=function(se){var oe=this;if(se===void 0&&(se=!1),this.isOpen){var de=!1;se||this.eventListeners.beforeclose.forEach(function(pe){var le=new Zt(oe,!0);pe(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(pe){return pe(new Zt(oe))}),this.detachEvents(),this._isOpen=!1)}},ge.prototype.addMarkersToToolbar=function(){for(var se,oe=[],de=0;de<arguments.length;de++)oe[de]=arguments[de];(se=this._availableMarkerTypes).push.apply(se,oe)},ge.prototype.addRenderEventListener=function(se){this.addEventListener("render",function(oe){se(oe.dataUrl,oe.state)})},ge.prototype.removeRenderEventListener=function(se){},ge.prototype.addCloseEventListener=function(se){this.addEventListener("close",function(){se()})},ge.prototype.removeCloseEventListener=function(se){},ge.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))},ge.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)},ge.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ge.prototype.resize=function(se,oe){this._isResizing=!0;var de=se/this.imageWidth,pe=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,pe),this._isResizing=!1},ge.prototype.scaleMarkers=function(se,oe){var de,pe=this;this._currentMarker&&this._currentMarker instanceof Pt?this._currentMarker.scale(se,oe):(de=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(le){le!==pe._currentMarker&&le.scale(se,oe)}),de!==void 0&&this.setCurrentMarker(de)},ge.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"},ge.prototype.setTopLeft=function(){var se=this.editingTarget.getBoundingClientRect(),oe=this.editorCanvas.getBoundingClientRect();this.left=se.left-oe.left,this.top=se.top-oe.top},ge.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)},ge.prototype.addDefs=function(){for(var se,oe=[],de=0;de<arguments.length;de++)oe[de]=arguments[de];this.defs=Le.createDefs(),this.addDefsToImage(),(se=this.defs).append.apply(se,oe)},ge.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},ge.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)},ge.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},ge.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},ge.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)},ge.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},ge.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)},ge.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()},ge.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")},ge.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"},ge.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ge.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 He(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 ht(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},ge.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ge.prototype.removeMarker=function(se){this.markerImage.removeChild(se.container),this.markers.indexOf(se)>-1&&this.markers.splice(this.markers.indexOf(se),1),se.dispose()},ge.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())},ge.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()}},ge.prototype.deleteSelectedMarker=function(){var se=this;if(this._currentMarker!==void 0){var oe=!1;if(this.eventListeners.markerbeforedelete.forEach(function(pe){var le=new Vt(se,se._currentMarker,!0);pe(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(pe){return pe(new Vt(se,de))})}}},ge.prototype.clear=function(){var se=this,oe=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(De){var ot=new Vt(se,void 0,!0);De(ot),ot.defaultPrevented&&(oe=!0)}),!oe)){this.setCurrentMarker();for(var de=function(De){var ot=pe.markers[De];pe.setCurrentMarker(pe.markers[De]),pe._currentMarker.dispose(),pe.markerImage.removeChild(pe._currentMarker.container),pe.markers.splice(pe.markers.indexOf(pe._currentMarker),1),pe.eventListeners.markerdelete.forEach(function($t){return $t(new Vt(se,ot))})},pe=this,le=this.markers.length-1;le>=0;le--)de(le);this.addUndoStep()}},Object.defineProperty(ge.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ge.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))},ge.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)},ge.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},ge.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 pe=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(oe),pe<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(le){return le(new Zt(se))})}else this.undoRedoManager.replaceLastUndoStep(oe),this.eventListeners.statechange.forEach(function(le){return le(new Zt(se))})}},ge.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},ge.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 Zt(se))}))},ge.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},ge.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 Zt(se))}))},ge.prototype.stepZoom=function(){var se=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=se<this.zoomSteps.length-1?this.zoomSteps[se+1]:this.zoomSteps[0]},ge.prototype.panTo=function(se){this.contentDiv.scrollBy({left:this.prevPanPoint.x-se.x,top:this.prevPanPoint.y-se.y}),this.prevPanPoint=se},ge.prototype.startRenderAndClose=function(){return Fe(this,void 0,void 0,function(){var se,oe,de=this;return tt(this,function(pe){switch(pe.label){case 0:return[4,this.render()];case 1:return se=pe.sent(),oe=this.getState(),this.eventListeners.render.forEach(function(le){return le(new pn(de,se,oe))}),this.close(!0),[2]}})})},ge.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},ge.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 pe=oe._availableMarkerTypes.find(function(De){return De.typeName===de.typeName});if(pe!==void 0){var le=oe.addNewMarker(pe);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 Zt(oe))})},ge.prototype.addNewMarker=function(se){var oe=Le.createGroup();return this.markerImage.appendChild(oe),new se(oe,this.overlayContainer,this.settings)},ge.prototype.createNewMarker=function(se){var oe,de=this;(oe=typeof se=="string"?this._availableMarkerTypes.find(function(pe){return pe.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(pe){return pe(new Vt(de,de._currentMarker))}))},ge.prototype.markerCreated=function(se){var oe=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(se),this.setCurrentMarker(se),se instanceof nt&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(nt):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(de){return de(new Vt(oe,oe._currentMarker))})},ge.prototype.colorChanged=function(se){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=se,this.settings.defaultStrokeColor=se)},ge.prototype.fillColorChanged=function(se){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=se)},ge.prototype.markerStateChanged=function(se){var oe=this;this.eventListeners.markerchange.forEach(function(de){return de(new Vt(oe,se))})},ge.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))}))},ge.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))},ge.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()}},ge.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}))},ge.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()},ge.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ge.prototype.onKeyUp=function(se){this._currentMarker===void 0||this.notesArea!==void 0||se.key!=="Delete"&&se.key!=="Backspace"||this.deleteSelectedMarker()},ge.prototype.clientToLocalCoordinates=function(se,oe){var de=this.markerImage.getBoundingClientRect();return{x:(se-de.left)/this.zoomLevel,y:(oe-de.top)/this.zoomLevel}},ge.prototype.onWindowResize=function(){this.positionUI()},ge.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()},ge.prototype.addLicenseKey=function(se){Re.addKey(se)},ge.prototype.addEventListener=function(se,oe){this.eventListeners.addEventListener(se,oe)},ge.prototype.removeEventListener=function(se,oe){this.eventListeners.removeEventListener(se,oe)},ge.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(ge.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ge.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 Zt(se))}))},ge.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 Zt(se))}))},ge.instanceCounter=0,ge}()},5630:function(Mn,Qt,ue){"use strict";var fe=ue(54476),Ze=ue(33885),Fe=ue(20068),tt=ue(42978),be=ue(75931),Le=ue(92310),Re=ue.n(Le),Se=ue(18929),Me=ue(59301),Pe=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],rt=(0,Me.forwardRef)(function(Te,He){var ht,Je=Te.prefixCls,lt=Je===void 0?"rc-checkbox":Je,st=Te.className,Rt=Te.style,qt=Te.checked,at=Te.disabled,ft=Te.defaultChecked,Ve=ft===void 0?!1:ft,_e=Te.type,We=_e===void 0?"checkbox":_e,et=Te.title,Mt=Te.onChange,Qe=(0,be.Z)(Te,Pe),Kt=(0,Me.useRef)(null),ut=(0,Se.Z)(Ve,{value:qt}),Pt=(0,tt.Z)(ut,2),nt=Pt[0],Gt=Pt[1];(0,Me.useImperativeHandle)(He,function(){return{focus:function(){var jt;(jt=Kt.current)===null||jt===void 0||jt.focus()},blur:function(){var jt;(jt=Kt.current)===null||jt===void 0||jt.blur()},input:Kt.current}});var mn=Re()(lt,st,(ht={},(0,Fe.Z)(ht,"".concat(lt,"-checked"),nt),(0,Fe.Z)(ht,"".concat(lt,"-disabled"),at),ht)),on=function(jt){at||("checked"in Te||Gt(jt.target.checked),Mt==null||Mt({target:(0,Ze.Z)((0,Ze.Z)({},Te),{},{type:We,checked:jt.target.checked}),stopPropagation:function(){jt.stopPropagation()},preventDefault:function(){jt.preventDefault()},nativeEvent:jt.nativeEvent}))};return Me.createElement("span",{className:mn,title:et,style:Rt},Me.createElement("input",(0,fe.Z)({},Qe,{className:"".concat(lt,"-input"),ref:Kt,onChange:on,disabled:at,checked:!!nt,type:We})),Me.createElement("span",{className:"".concat(lt,"-inner")}))});Qt.Z=rt},31561:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return We}});var fe=ue(54476),Ze=ue(20068),Fe=ue(42978),tt=ue(75931),be=ue(35593),Le=ue(92310),Re=ue.n(Le),Se=ue(8654),Me=ue(59301),Pe=ue(10228),rt=ue(16089),Te=Pe.Z.ESC,He=Pe.Z.TAB;function ht(et){var Mt=et.visible,Qe=et.triggerRef,Kt=et.onVisibleChange,ut=et.autoFocus,Pt=et.overlayRef,nt=Me.useRef(!1),Gt=function(){if(Mt){var jt,Ke;(jt=Qe.current)===null||jt===void 0||(Ke=jt.focus)===null||Ke===void 0||Ke.call(jt),Kt==null||Kt(!1)}},mn=function(){var jt;return(jt=Pt.current)!==null&&jt!==void 0&&jt.focus?(Pt.current.focus(),nt.current=!0,!0):!1},on=function(jt){switch(jt.keyCode){case Te:Gt();break;case He:{var Ke=!1;nt.current||(Ke=mn()),Ke?jt.preventDefault():Gt();break}}};Me.useEffect(function(){return Mt?(window.addEventListener("keydown",on),ut&&(0,rt.Z)(mn,3),function(){window.removeEventListener("keydown",on),nt.current=!1}):function(){nt.current=!1}},[Mt])}var Je=(0,Me.forwardRef)(function(et,Mt){var Qe=et.overlay,Kt=et.arrow,ut=et.prefixCls,Pt=(0,Me.useMemo)(function(){var Gt;return typeof Qe=="function"?Gt=Qe():Gt=Qe,Gt},[Qe]),nt=(0,Se.sQ)(Mt,Pt==null?void 0:Pt.ref);return Me.createElement(Me.Fragment,null,Kt&&Me.createElement("div",{className:"".concat(ut,"-arrow")}),Me.cloneElement(Pt,{ref:(0,Se.Yr)(Pt)?nt:void 0}))}),lt=Je,st={adjustX:1,adjustY:1},Rt=[0,0],qt={topLeft:{points:["bl","tl"],overflow:st,offset:[0,-4],targetOffset:Rt},top:{points:["bc","tc"],overflow:st,offset:[0,-4],targetOffset:Rt},topRight:{points:["br","tr"],overflow:st,offset:[0,-4],targetOffset:Rt},bottomLeft:{points:["tl","bl"],overflow:st,offset:[0,4],targetOffset:Rt},bottom:{points:["tc","bc"],overflow:st,offset:[0,4],targetOffset:Rt},bottomRight:{points:["tr","br"],overflow:st,offset:[0,4],targetOffset:Rt}},at=qt,ft=["arrow","prefixCls","transitionName","animation","align","placement","placements","getPopupContainer","showAction","hideAction","overlayClassName","overlayStyle","visible","trigger","autoFocus","overlay","children","onVisibleChange"];function Ve(et,Mt){var Qe,Kt=et.arrow,ut=Kt===void 0?!1:Kt,Pt=et.prefixCls,nt=Pt===void 0?"rc-dropdown":Pt,Gt=et.transitionName,mn=et.animation,on=et.align,sn=et.placement,jt=sn===void 0?"bottomLeft":sn,Ke=et.placements,xe=Ke===void 0?at:Ke,bt=et.getPopupContainer,fn=et.showAction,Xt=et.hideAction,qe=et.overlayClassName,je=et.overlayStyle,gt=et.visible,en=et.trigger,Zt=en===void 0?["hover"]:en,pn=et.autoFocus,Vt=et.overlay,Ft=et.children,Tt=et.onVisibleChange,ge=(0,tt.Z)(et,ft),se=Me.useState(),oe=(0,Fe.Z)(se,2),de=oe[0],pe=oe[1],le="visible"in et?gt:de,De=Me.useRef(null),ot=Me.useRef(null),$t=Me.useRef(null);Me.useImperativeHandle(Mt,function(){return De.current});var It=function(Ye){pe(Ye),Tt==null||Tt(Ye)};ht({visible:le,triggerRef:$t,onVisibleChange:It,autoFocus:pn,overlayRef:ot});var Ut=function(Ye){var ze=et.onOverlayClick;pe(!1),ze&&ze(Ye)},Yt=function(){return Me.createElement(lt,{ref:ot,overlay:Vt,prefixCls:nt,arrow:ut})},dn=function(){return typeof Vt=="function"?Yt:Yt()},hn=function(){var Ye=et.minOverlayWidthMatchTrigger,ze=et.alignPoint;return"minOverlayWidthMatchTrigger"in et?Ye:!ze},_n=function(){var Ye=et.openClassName;return Ye!==void 0?Ye:"".concat(nt,"-open")},vt=Me.cloneElement(Ft,{className:Re()((Qe=Ft.props)===null||Qe===void 0?void 0:Qe.className,le&&_n()),ref:(0,Se.Yr)(Ft)?(0,Se.sQ)($t,Ft.ref):void 0}),cn=Xt;return!cn&&Zt.indexOf("contextMenu")!==-1&&(cn=["click"]),Me.createElement(be.Z,(0,fe.Z)({builtinPlacements:xe},ge,{prefixCls:nt,ref:De,popupClassName:Re()(qe,(0,Ze.Z)({},"".concat(nt,"-show-arrow"),ut)),popupStyle:je,action:Zt,showAction:fn,hideAction:cn,popupPlacement:jt,popupAlign:on,popupTransitionName:Gt,popupAnimation:mn,popupVisible:le,stretch:hn()?"minWidth":"",popup:dn(),onPopupVisibleChange:It,onPopupClick:Ut,getPopupContainer:bt}),vt)}var _e=Me.forwardRef(Ve),We=_e},93681:function(Mn,Qt,ue){"use strict";ue.r(Qt),ue.d(Qt,{BaseInput:function(){return Pe},default:function(){return qt}});var fe=ue(54476),Ze=ue(33885),Fe=ue(20068),tt=ue(76190),be=ue(92310),Le=ue.n(be),Re=ue(59301),Se=ue(5643),Me=function(ft){var Ve,_e,We=ft.inputElement,et=ft.prefixCls,Mt=ft.prefix,Qe=ft.suffix,Kt=ft.addonBefore,ut=ft.addonAfter,Pt=ft.className,nt=ft.style,Gt=ft.disabled,mn=ft.readOnly,on=ft.focused,sn=ft.triggerFocus,jt=ft.allowClear,Ke=ft.value,xe=ft.handleReset,bt=ft.hidden,fn=ft.classes,Xt=ft.classNames,qe=ft.dataAttrs,je=ft.styles,gt=ft.components,en=(gt==null?void 0:gt.affixWrapper)||"span",Zt=(gt==null?void 0:gt.groupWrapper)||"span",pn=(gt==null?void 0:gt.wrapper)||"span",Vt=(gt==null?void 0:gt.groupAddon)||"span",Ft=(0,Re.useRef)(null),Tt=function(Yt){var dn;(dn=Ft.current)!==null&&dn!==void 0&&dn.contains(Yt.target)&&(sn==null||sn())},ge=function(){var Yt;if(!jt)return null;var dn=!Gt&&!mn&&Ke,hn="".concat(et,"-clear-icon"),_n=(0,tt.Z)(jt)==="object"&&jt!==null&&jt!==void 0&&jt.clearIcon?jt.clearIcon:"\u2716";return Re.createElement("span",{onClick:xe,onMouseDown:function(cn){return cn.preventDefault()},className:Le()(hn,(Yt={},(0,Fe.Z)(Yt,"".concat(hn,"-hidden"),!dn),(0,Fe.Z)(Yt,"".concat(hn,"-has-suffix"),!!Qe),Yt)),role:"button",tabIndex:-1},_n)},se=(0,Re.cloneElement)(We,{value:Ke,hidden:bt,className:Le()((Ve=We.props)===null||Ve===void 0?void 0:Ve.className,!(0,Se.X3)(ft)&&!(0,Se.He)(ft)&&Pt)||null,style:(0,Ze.Z)((0,Ze.Z)({},(_e=We.props)===null||_e===void 0?void 0:_e.style),!(0,Se.X3)(ft)&&!(0,Se.He)(ft)?nt:{})});if((0,Se.X3)(ft)){var oe,de="".concat(et,"-affix-wrapper"),pe=Le()(de,(oe={},(0,Fe.Z)(oe,"".concat(de,"-disabled"),Gt),(0,Fe.Z)(oe,"".concat(de,"-focused"),on),(0,Fe.Z)(oe,"".concat(de,"-readonly"),mn),(0,Fe.Z)(oe,"".concat(de,"-input-with-clear-btn"),Qe&&jt&&Ke),oe),!(0,Se.He)(ft)&&Pt,fn==null?void 0:fn.affixWrapper,Xt==null?void 0:Xt.affixWrapper),le=(Qe||jt)&&Re.createElement("span",{className:Le()("".concat(et,"-suffix"),Xt==null?void 0:Xt.suffix),style:je==null?void 0:je.suffix},ge(),Qe);se=Re.createElement(en,(0,fe.Z)({className:pe,style:(0,Ze.Z)((0,Ze.Z)({},(0,Se.He)(ft)?void 0:nt),je==null?void 0:je.affixWrapper),hidden:!(0,Se.He)(ft)&&bt,onClick:Tt},qe==null?void 0:qe.affixWrapper,{ref:Ft}),Mt&&Re.createElement("span",{className:Le()("".concat(et,"-prefix"),Xt==null?void 0:Xt.prefix),style:je==null?void 0:je.prefix},Mt),(0,Re.cloneElement)(We,{value:Ke,hidden:null}),le)}if((0,Se.He)(ft)){var De="".concat(et,"-group"),ot="".concat(De,"-addon"),$t=Le()("".concat(et,"-wrapper"),De,fn==null?void 0:fn.wrapper),It=Le()("".concat(et,"-group-wrapper"),Pt,fn==null?void 0:fn.group);return Re.createElement(Zt,{className:It,style:nt,hidden:bt},Re.createElement(pn,{className:$t},Kt&&Re.createElement(Vt,{className:ot},Kt),(0,Re.cloneElement)(se,{hidden:null}),ut&&Re.createElement(Vt,{className:ot},ut)))}return se},Pe=Me,rt=ue(94480),Te=ue(42978),He=ue(75931),ht=ue(18929),Je=ue(2738),lt=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","classes","classNames","styles"],st=(0,Re.forwardRef)(function(at,ft){var Ve=at.autoComplete,_e=at.onChange,We=at.onFocus,et=at.onBlur,Mt=at.onPressEnter,Qe=at.onKeyDown,Kt=at.prefixCls,ut=Kt===void 0?"rc-input":Kt,Pt=at.disabled,nt=at.htmlSize,Gt=at.className,mn=at.maxLength,on=at.suffix,sn=at.showCount,jt=at.type,Ke=jt===void 0?"text":jt,xe=at.classes,bt=at.classNames,fn=at.styles,Xt=(0,He.Z)(at,lt),qe=(0,ht.Z)(at.defaultValue,{value:at.value}),je=(0,Te.Z)(qe,2),gt=je[0],en=je[1],Zt=(0,Re.useState)(!1),pn=(0,Te.Z)(Zt,2),Vt=pn[0],Ft=pn[1],Tt=(0,Re.useRef)(null),ge=function(It){Tt.current&&(0,Se.nH)(Tt.current,It)};(0,Re.useImperativeHandle)(ft,function(){return{focus:ge,blur:function(){var It;(It=Tt.current)===null||It===void 0||It.blur()},setSelectionRange:function(It,Ut,Yt){var dn;(dn=Tt.current)===null||dn===void 0||dn.setSelectionRange(It,Ut,Yt)},select:function(){var It;(It=Tt.current)===null||It===void 0||It.select()},input:Tt.current}}),(0,Re.useEffect)(function(){Ft(function($t){return $t&&Pt?!1:$t})},[Pt]);var se=function(It){at.value===void 0&&en(It.target.value),Tt.current&&(0,Se.rJ)(Tt.current,It,_e)},oe=function(It){Mt&&It.key==="Enter"&&Mt(It),Qe==null||Qe(It)},de=function(It){Ft(!0),We==null||We(It)},pe=function(It){Ft(!1),et==null||et(It)},le=function(It){en(""),ge(),Tt.current&&(0,Se.rJ)(Tt.current,It,_e)},De=function(){var It=(0,Je.Z)(at,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","classes","htmlSize","styles","classNames"]);return Re.createElement("input",(0,fe.Z)({autoComplete:Ve},It,{onChange:se,onFocus:de,onBlur:pe,onKeyDown:oe,className:Le()(ut,(0,Fe.Z)({},"".concat(ut,"-disabled"),Pt),bt==null?void 0:bt.input),style:fn==null?void 0:fn.input,ref:Tt,size:nt,type:Ke}))},ot=function(){var It=Number(mn)>0;if(on||sn){var Ut=(0,Se.D7)(gt),Yt=(0,rt.Z)(Ut).length,dn=(0,tt.Z)(sn)==="object"?sn.formatter({value:Ut,count:Yt,maxLength:mn}):"".concat(Yt).concat(It?" / ".concat(mn):"");return Re.createElement(Re.Fragment,null,!!sn&&Re.createElement("span",{className:Le()("".concat(ut,"-show-count-suffix"),(0,Fe.Z)({},"".concat(ut,"-show-count-has-suffix"),!!on),bt==null?void 0:bt.count),style:(0,Ze.Z)({},fn==null?void 0:fn.count)},dn),on)}return null};return Re.createElement(Pe,(0,fe.Z)({},Xt,{prefixCls:ut,className:Gt,inputElement:De(),handleReset:le,value:(0,Se.D7)(gt),focused:Vt,triggerFocus:ge,suffix:ot(),disabled:Pt,classes:xe,classNames:bt,styles:fn}))}),Rt=st,qt=Rt},5643:function(Mn,Qt,ue){"use strict";ue.d(Qt,{D7:function(){return be},He:function(){return fe},X3:function(){return Ze},nH:function(){return tt},rJ:function(){return Fe}});function fe(Le){return!!(Le.addonBefore||Le.addonAfter)}function Ze(Le){return!!(Le.prefix||Le.suffix||Le.allowClear)}function Fe(Le,Re,Se,Me){if(Se){var Pe=Re;if(Re.type==="click"){var rt=Le.cloneNode(!0);Pe=Object.create(Re,{target:{value:rt},currentTarget:{value:rt}}),rt.value="",Se(Pe);return}if(Me!==void 0){Pe=Object.create(Re,{target:{value:Le},currentTarget:{value:Le}}),Le.value=Me,Se(Pe);return}Se(Pe)}}function tt(Le,Re){if(Le){Le.focus(Re);var Se=Re||{},Me=Se.cursor;if(Me){var Pe=Le.value.length;switch(Me){case"start":Le.setSelectionRange(0,0);break;case"end":Le.setSelectionRange(Pe,Pe);break;default:Le.setSelectionRange(0,Pe)}}}}function be(Le){return typeof Le=="undefined"||Le===null?"":String(Le)}},15285:function(Mn,Qt,ue){"use strict";ue.d(Qt,{iz:function(){return Cn},ck:function(){return Hr},BW:function(){return xn},sN:function(){return Hr},Wd:function(){return dt},ZP:function(){return tn},Xl:function(){return Qe}});var fe=ue(54476),Ze=ue(20068),Fe=ue(33885),tt=ue(94480),be=ue(42978),Le=ue(75931),Re=ue(92310),Se=ue.n(Re),Me=ue(83836),Pe=ue(18929),rt=ue(13697),Te=ue(48736),He=ue(59301),ht=ue(4676),Je=He.createContext(null);function lt(Oe,yt){return Oe===void 0?null:"".concat(Oe,"-").concat(yt)}function st(Oe){var yt=He.useContext(Je);return lt(yt,Oe)}var Rt=ue(80547),qt=["children","locked"],at=He.createContext(null);function ft(Oe,yt){var xt=(0,Fe.Z)({},Oe);return Object.keys(yt).forEach(function(Ot){var Dt=yt[Ot];Dt!==void 0&&(xt[Ot]=Dt)}),xt}function Ve(Oe){var yt=Oe.children,xt=Oe.locked,Ot=(0,Le.Z)(Oe,qt),Dt=He.useContext(at),Nt=(0,Rt.Z)(function(){return ft(Dt,Ot)},[Dt,Ot],function(zt,gn){return!xt&&(zt[0]!==gn[0]||!(0,rt.Z)(zt[1],gn[1],!0))});return He.createElement(at.Provider,{value:Nt},yt)}var _e=[],We=He.createContext(null);function et(){return He.useContext(We)}var Mt=He.createContext(_e);function Qe(Oe){var yt=He.useContext(Mt);return He.useMemo(function(){return Oe!==void 0?[].concat((0,tt.Z)(yt),[Oe]):yt},[yt,Oe])}var Kt=He.createContext(null),ut=He.createContext({}),Pt=ut,nt=ue(29194);function Gt(Oe){var yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if((0,nt.Z)(Oe)){var xt=Oe.nodeName.toLowerCase(),Ot=["input","select","textarea","button"].includes(xt)||Oe.isContentEditable||xt==="a"&&!!Oe.getAttribute("href"),Dt=Oe.getAttribute("tabindex"),Nt=Number(Dt),zt=null;return Dt&&!Number.isNaN(Nt)?zt=Nt:Ot&&zt===null&&(zt=0),Ot&&Oe.disabled&&(zt=null),zt!==null&&(zt>=0||yt&&zt<0)}return!1}function mn(Oe){var yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,xt=(0,tt.Z)(Oe.querySelectorAll("*")).filter(function(Ot){return Gt(Ot,yt)});return Gt(Oe,yt)&&xt.unshift(Oe),xt}var on=null;function sn(){on=document.activeElement}function jt(){on=null}function Ke(){if(on)try{on.focus()}catch(Oe){}}function xe(Oe,yt){if(yt.keyCode===9){var xt=mn(Oe),Ot=xt[yt.shiftKey?0:xt.length-1],Dt=Ot===document.activeElement||Oe===document.activeElement;if(Dt){var Nt=xt[yt.shiftKey?xt.length-1:0];Nt.focus(),yt.preventDefault()}}}var bt=ue(10228),fn=ue(16089),Xt=bt.Z.LEFT,qe=bt.Z.RIGHT,je=bt.Z.UP,gt=bt.Z.DOWN,en=bt.Z.ENTER,Zt=bt.Z.ESC,pn=bt.Z.HOME,Vt=bt.Z.END,Ft=[je,gt,Xt,qe];function Tt(Oe,yt,xt,Ot){var Dt,Nt,zt,gn,wn="prev",Dn="next",zn="children",er="parent";if(Oe==="inline"&&Ot===en)return{inlineTrigger:!0};var cr=(Dt={},(0,Ze.Z)(Dt,je,wn),(0,Ze.Z)(Dt,gt,Dn),Dt),Un=(Nt={},(0,Ze.Z)(Nt,Xt,xt?Dn:wn),(0,Ze.Z)(Nt,qe,xt?wn:Dn),(0,Ze.Z)(Nt,gt,zn),(0,Ze.Z)(Nt,en,zn),Nt),Pn=(zt={},(0,Ze.Z)(zt,je,wn),(0,Ze.Z)(zt,gt,Dn),(0,Ze.Z)(zt,en,zn),(0,Ze.Z)(zt,Zt,er),(0,Ze.Z)(zt,Xt,xt?zn:er),(0,Ze.Z)(zt,qe,xt?er:zn),zt),fr={inline:cr,horizontal:Un,vertical:Pn,inlineSub:cr,horizontalSub:Pn,verticalSub:Pn},tr=(gn=fr["".concat(Oe).concat(yt?"":"Sub")])===null||gn===void 0?void 0:gn[Ot];switch(tr){case wn:return{offset:-1,sibling:!0};case Dn:return{offset:1,sibling:!0};case er:return{offset:-1,sibling:!1};case zn:return{offset:1,sibling:!1};default:return null}}function ge(Oe){for(var yt=Oe;yt;){if(yt.getAttribute("data-menu-list"))return yt;yt=yt.parentElement}return null}function se(Oe,yt){for(var xt=Oe||document.activeElement;xt;){if(yt.has(xt))return xt;xt=xt.parentElement}return null}function oe(Oe,yt){var xt=mn(Oe,!0);return xt.filter(function(Ot){return yt.has(Ot)})}function de(Oe,yt,xt){var Ot=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!Oe)return null;var Dt=oe(Oe,yt),Nt=Dt.length,zt=Dt.findIndex(function(gn){return xt===gn});return Ot<0?zt===-1?zt=Nt-1:zt-=1:Ot>0&&(zt+=1),zt=(zt+Nt)%Nt,Dt[zt]}var pe=function(yt,xt){var Ot=new Set,Dt=new Map,Nt=new Map;return yt.forEach(function(zt){var gn=document.querySelector("[data-menu-id='".concat(lt(xt,zt),"']"));gn&&(Ot.add(gn),Nt.set(gn,zt),Dt.set(zt,gn))}),{elements:Ot,key2element:Dt,element2key:Nt}};function le(Oe,yt,xt,Ot,Dt,Nt,zt,gn,wn,Dn){var zn=He.useRef(),er=He.useRef();er.current=yt;var cr=function(){fn.Z.cancel(zn.current)};return He.useEffect(function(){return function(){cr()}},[]),function(Un){var Pn=Un.which;if([].concat(Ft,[en,Zt,pn,Vt]).includes(Pn)){var fr=Nt(),tr=pe(fr,Ot),yr=tr,Gn=yr.elements,Xn=yr.key2element,br=yr.element2key,ur=Xn.get(yt),Br=se(ur,Gn),Gr=br.get(Br),ar=Tt(Oe,zt(Gr,!0).length===1,xt,Pn);if(!ar&&Pn!==pn&&Pn!==Vt)return;(Ft.includes(Pn)||[pn,Vt].includes(Pn))&&Un.preventDefault();var En=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,fn.Z)(function(){er.current===qn&&ii.focus()})}};if([pn,Vt].includes(Pn)||ar.sibling||!Br){var kn;!Br||Oe==="inline"?kn=Dt.current:kn=ge(Br);var gr,nr=oe(kn,Gn);Pn===pn?gr=nr[0]:Pn===Vt?gr=nr[nr.length-1]:gr=de(kn,Gn,Br,ar.offset),En(gr)}else if(ar.inlineTrigger)wn(Gr);else if(ar.offset>0)wn(Gr,!0),cr(),zn.current=(0,fn.Z)(function(){tr=pe(fr,Ot);var pr=Br.getAttribute("aria-controls"),Sr=document.getElementById(pr),ii=de(Sr,tr.elements);En(ii)},5);else if(ar.offset<0){var _r=zt(Gr,!0),Lr=_r[_r.length-2],Ir=Xn.get(Lr);wn(Lr,!1),En(Ir)}}Dn==null||Dn(Un)}}function De(Oe){Promise.resolve().then(Oe)}var ot="__RC_UTIL_PATH_SPLIT__",$t=function(yt){return yt.join(ot)},It=function(yt){return yt.split(ot)},Ut="rc-menu-more";function Yt(){var Oe=He.useState({}),yt=(0,be.Z)(Oe,2),xt=yt[1],Ot=(0,He.useRef)(new Map),Dt=(0,He.useRef)(new Map),Nt=He.useState([]),zt=(0,be.Z)(Nt,2),gn=zt[0],wn=zt[1],Dn=(0,He.useRef)(0),zn=(0,He.useRef)(!1),er=function(){zn.current||xt({})},cr=(0,He.useCallback)(function(Xn,br){var ur=$t(br);Dt.current.set(ur,Xn),Ot.current.set(Xn,ur),Dn.current+=1;var Br=Dn.current;De(function(){Br===Dn.current&&er()})},[]),Un=(0,He.useCallback)(function(Xn,br){var ur=$t(br);Dt.current.delete(ur),Ot.current.delete(Xn)},[]),Pn=(0,He.useCallback)(function(Xn){wn(Xn)},[]),fr=(0,He.useCallback)(function(Xn,br){var ur=Ot.current.get(Xn)||"",Br=It(ur);return br&&gn.includes(Br[0])&&Br.unshift(Ut),Br},[gn]),tr=(0,He.useCallback)(function(Xn,br){return Xn.some(function(ur){var Br=fr(ur,!0);return Br.includes(br)})},[fr]),yr=function(){var br=(0,tt.Z)(Ot.current.keys());return gn.length&&br.push(Ut),br},Gn=(0,He.useCallback)(function(Xn){var br="".concat(Ot.current.get(Xn)).concat(ot),ur=new Set;return(0,tt.Z)(Dt.current.keys()).forEach(function(Br){Br.startsWith(br)&&ur.add(Dt.current.get(Br))}),ur},[]);return He.useEffect(function(){return function(){zn.current=!0}},[]),{registerPath:cr,unregisterPath:Un,refreshOverflowKeys:Pn,isSubPathKey:tr,getKeyPath:fr,getKeys:yr,getSubPathKeys:Gn}}function dn(Oe){var yt=He.useRef(Oe);yt.current=Oe;var xt=He.useCallback(function(){for(var Ot,Dt=arguments.length,Nt=new Array(Dt),zt=0;zt<Dt;zt++)Nt[zt]=arguments[zt];return(Ot=yt.current)===null||Ot===void 0?void 0:Ot.call.apply(Ot,[yt].concat(Nt))},[]);return Oe?xt:void 0}var hn=Math.random().toFixed(5).toString().slice(2),_n=0;function vt(Oe){var yt=(0,Pe.Z)(Oe,{value:Oe}),xt=(0,be.Z)(yt,2),Ot=xt[0],Dt=xt[1];return He.useEffect(function(){_n+=1;var Nt="".concat(hn,"-").concat(_n);Dt("rc-menu-uuid-".concat(Nt))},[]),Ot}var cn=ue(67732),Sn=ue(83652),Ye=ue(42403),ze=ue(158),Ue=ue(2738),Bt=ue(8654);function Jt(Oe,yt,xt,Ot){var Dt=He.useContext(at),Nt=Dt.activeKey,zt=Dt.onActive,gn=Dt.onInactive,wn={active:Nt===Oe};return yt||(wn.onMouseEnter=function(Dn){xt==null||xt({key:Oe,domEvent:Dn}),zt(Oe)},wn.onMouseLeave=function(Dn){Ot==null||Ot({key:Oe,domEvent:Dn}),gn(Oe)}),wn}function rn(Oe){var yt=He.useContext(at),xt=yt.mode,Ot=yt.rtl,Dt=yt.inlineIndent;if(xt!=="inline")return null;var Nt=Oe;return Ot?{paddingRight:Nt*Dt}:{paddingLeft:Nt*Dt}}function An(Oe){var yt=Oe.icon,xt=Oe.props,Ot=Oe.children,Dt;return yt===null||yt===!1?null:(typeof yt=="function"?Dt=He.createElement(yt,(0,Fe.Z)({},xt)):typeof yt!="boolean"&&(Dt=yt),Dt||Ot||null)}var In=["item"];function Ln(Oe){var yt=Oe.item,xt=(0,Le.Z)(Oe,In);return Object.defineProperty(xt,"item",{get:function(){return(0,Te.ZP)(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),yt}}),xt}var Fn=["title","attribute","elementRef"],jn=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],Tn=["active"],hr=function(Oe){(0,Ye.Z)(xt,Oe);var yt=(0,ze.Z)(xt);function xt(){return(0,cn.Z)(this,xt),yt.apply(this,arguments)}return(0,Sn.Z)(xt,[{key:"render",value:function(){var Dt=this.props,Nt=Dt.title,zt=Dt.attribute,gn=Dt.elementRef,wn=(0,Le.Z)(Dt,Fn),Dn=(0,Ue.Z)(wn,["eventKey","popupClassName","popupOffset","onTitleClick"]);return(0,Te.ZP)(!zt,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),He.createElement(Me.Z.Item,(0,fe.Z)({},zt,{title:typeof Nt=="string"?Nt:void 0},Dn,{ref:gn}))}}]),xt}(He.Component),kr=He.forwardRef(function(Oe,yt){var xt,Ot=Oe.style,Dt=Oe.className,Nt=Oe.eventKey,zt=Oe.warnKey,gn=Oe.disabled,wn=Oe.itemIcon,Dn=Oe.children,zn=Oe.role,er=Oe.onMouseEnter,cr=Oe.onMouseLeave,Un=Oe.onClick,Pn=Oe.onKeyDown,fr=Oe.onFocus,tr=(0,Le.Z)(Oe,jn),yr=st(Nt),Gn=He.useContext(at),Xn=Gn.prefixCls,br=Gn.onItemClick,ur=Gn.disabled,Br=Gn.overflowDisabled,Gr=Gn.itemIcon,ar=Gn.selectedKeys,En=Gn.onActive,kn=He.useContext(Pt),gr=kn._internalRenderMenuItem,nr="".concat(Xn,"-item"),_r=He.useRef(),Lr=He.useRef(),Ir=ur||gn,pr=(0,Bt.x1)(yt,Lr),Sr=Qe(Nt),ii=function(Zn){return{key:Nt,keyPath:(0,tt.Z)(Sr).reverse(),item:_r.current,domEvent:Zn}},Hn=wn||Gr,qn=Jt(Nt,Ir,er,cr),Dr=qn.active,$r=(0,Le.Z)(qn,Tn),li=ar.includes(Nt),di=rn(Sr.length),ri=function(Zn){if(!Ir){var mr=ii(Zn);Un==null||Un(Ln(mr)),br(mr)}},Jr=function(Zn){if(Pn==null||Pn(Zn),Zn.which===bt.Z.ENTER){var mr=ii(Zn);Un==null||Un(Ln(mr)),br(mr)}},yi=function(Zn){En(Nt),fr==null||fr(Zn)},bi={};Oe.role==="option"&&(bi["aria-selected"]=li);var Yn=He.createElement(hr,(0,fe.Z)({ref:_r,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,Fe.Z)((0,Fe.Z)({},di),Ot),className:Se()(nr,(xt={},(0,Ze.Z)(xt,"".concat(nr,"-active"),Dr),(0,Ze.Z)(xt,"".concat(nr,"-selected"),li),(0,Ze.Z)(xt,"".concat(nr,"-disabled"),Ir),xt),Dt),onClick:ri,onKeyDown:Jr,onFocus:yi}),Dn,He.createElement(An,{props:(0,Fe.Z)((0,Fe.Z)({},Oe),{},{isSelected:li}),icon:Hn}));return gr&&(Yn=gr(Yn,Oe,{selected:li})),Yn});function Tr(Oe,yt){var xt=Oe.eventKey,Ot=et(),Dt=Qe(xt);return He.useEffect(function(){if(Ot)return Ot.registerPath(xt,Dt),function(){Ot.unregisterPath(xt,Dt)}},[Dt]),Ot?null:He.createElement(kr,(0,fe.Z)({},Oe,{ref:yt}))}var Hr=He.forwardRef(Tr),sr=["className","children"],Mr=function(yt,xt){var Ot=yt.className,Dt=yt.children,Nt=(0,Le.Z)(yt,sr),zt=He.useContext(at),gn=zt.prefixCls,wn=zt.mode,Dn=zt.rtl;return He.createElement("ul",(0,fe.Z)({className:Se()(gn,Dn&&"".concat(gn,"-rtl"),"".concat(gn,"-sub"),"".concat(gn,"-").concat(wn==="inline"?"inline":"vertical"),Ot),role:"menu"},Nt,{"data-menu-list":!0,ref:xt}),Dt)},rr=He.forwardRef(Mr);rr.displayName="SubMenuList";var Or=rr,Fr=ue(11592);function Er(Oe,yt){return(0,Fr.Z)(Oe).map(function(xt,Ot){if(He.isValidElement(xt)){var Dt,Nt,zt=xt.key,gn=(Dt=(Nt=xt.props)===null||Nt===void 0?void 0:Nt.eventKey)!==null&&Dt!==void 0?Dt:zt,wn=gn==null;wn&&(gn="tmp_key-".concat([].concat((0,tt.Z)(yt),[Ot]).join("-")));var Dn={key:gn,eventKey:gn};return He.cloneElement(xt,Dn)}return xt})}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(Oe,yt,xt){if(yt)return yt;if(xt)return xt[Oe]||xt.other}var wr={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function ct(Oe){var yt=Oe.prefixCls,xt=Oe.visible,Ot=Oe.children,Dt=Oe.popup,Nt=Oe.popupStyle,zt=Oe.popupClassName,gn=Oe.popupOffset,wn=Oe.disabled,Dn=Oe.mode,zn=Oe.onVisibleChange,er=He.useContext(at),cr=er.getPopupContainer,Un=er.rtl,Pn=er.subMenuOpenDelay,fr=er.subMenuCloseDelay,tr=er.builtinPlacements,yr=er.triggerSubMenuAction,Gn=er.forceSubMenuRender,Xn=er.rootClassName,br=er.motion,ur=er.defaultMotions,Br=He.useState(!1),Gr=(0,be.Z)(Br,2),ar=Gr[0],En=Gr[1],kn=Un?(0,Fe.Z)((0,Fe.Z)({},lr),tr):(0,Fe.Z)((0,Fe.Z)({},Jn),tr),gr=wr[Dn],nr=$n(Dn,br,ur),_r=He.useRef(nr);Dn!=="inline"&&(_r.current=nr);var Lr=(0,Fe.Z)((0,Fe.Z)({},_r.current),{},{leavedClassName:"".concat(yt,"-hidden"),removeOnLeave:!1,motionAppear:!0}),Ir=He.useRef();return He.useEffect(function(){return Ir.current=(0,fn.Z)(function(){En(xt)}),function(){fn.Z.cancel(Ir.current)}},[xt]),He.createElement(jr.Z,{prefixCls:yt,popupClassName:Se()("".concat(yt,"-popup"),(0,Ze.Z)({},"".concat(yt,"-rtl"),Un),zt,Xn),stretch:Dn==="horizontal"?"minWidth":null,getPopupContainer:cr,builtinPlacements:kn,popupPlacement:gr,popupVisible:ar,popup:Dt,popupStyle:Nt,popupAlign:gn&&{offset:gn},action:wn?[]:[yr],mouseEnterDelay:Pn,mouseLeaveDelay:fr,onPopupVisibleChange:zn,forceRender:Gn,popupMotion:Lr,fresh:!0},Ot)}var ke=ue(77900);function Be(Oe){var yt=Oe.id,xt=Oe.open,Ot=Oe.keyPath,Dt=Oe.children,Nt="inline",zt=He.useContext(at),gn=zt.prefixCls,wn=zt.forceSubMenuRender,Dn=zt.motion,zn=zt.defaultMotions,er=zt.mode,cr=He.useRef(!1);cr.current=er===Nt;var Un=He.useState(!cr.current),Pn=(0,be.Z)(Un,2),fr=Pn[0],tr=Pn[1],yr=cr.current?xt:!1;He.useEffect(function(){cr.current&&tr(!1)},[er]);var Gn=(0,Fe.Z)({},$n(Nt,Dn,zn));Ot.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:He.createElement(Ve,{mode:Nt,locked:!cr.current},He.createElement(ke.default,(0,fe.Z)({visible:yr},Gn,{forceRender:wn,removeOnLeave:!1,leavedClassName:"".concat(gn,"-hidden")}),function(br){var ur=br.className,Br=br.style;return He.createElement(Or,{id:yt,className:ur,style:Br},Dt)}))}var Ae=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","popupStyle","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Ie=["active"],Xe=function(yt){var xt,Ot=yt.style,Dt=yt.className,Nt=yt.title,zt=yt.eventKey,gn=yt.warnKey,wn=yt.disabled,Dn=yt.internalPopupClose,zn=yt.children,er=yt.itemIcon,cr=yt.expandIcon,Un=yt.popupClassName,Pn=yt.popupOffset,fr=yt.popupStyle,tr=yt.onClick,yr=yt.onMouseEnter,Gn=yt.onMouseLeave,Xn=yt.onTitleClick,br=yt.onTitleMouseEnter,ur=yt.onTitleMouseLeave,Br=(0,Le.Z)(yt,Ae),Gr=st(zt),ar=He.useContext(at),En=ar.prefixCls,kn=ar.mode,gr=ar.openKeys,nr=ar.disabled,_r=ar.overflowDisabled,Lr=ar.activeKey,Ir=ar.selectedKeys,pr=ar.itemIcon,Sr=ar.expandIcon,ii=ar.onItemClick,Hn=ar.onOpenChange,qn=ar.onActive,Dr=He.useContext(Pt),$r=Dr._internalRenderSubMenuItem,li=He.useContext(Kt),di=li.isSubPathKey,ri=Qe(),Jr="".concat(En,"-submenu"),yi=nr||wn,bi=He.useRef(),Yn=He.useRef(),Vn=er!=null?er:pr,Zn=cr!=null?cr:Sr,mr=gr.includes(zt),ni=!_r&&mr,xi=di(Ir,zt),Mi=Jt(zt,yi,br,ur),gi=Mi.active,ci=(0,Le.Z)(Mi,Ie),ki=He.useState(!1),Hi=(0,be.Z)(ki,2),Ni=Hi[0],oa=Hi[1],Xr=function(Zi){yi||oa(Zi)},ei=function(Zi){Xr(!0),yr==null||yr({key:zt,domEvent:Zi})},Ai=function(Zi){Xr(!1),Gn==null||Gn({key:zt,domEvent:Zi})},ai=He.useMemo(function(){return gi||(kn!=="inline"?Ni||di([Lr],zt):!1)},[kn,gi,Lr,Ni,zt,di]),fi=rn(ri.length),_i=function(Zi){yi||(Xn==null||Xn({key:zt,domEvent:Zi}),kn==="inline"&&Hn(zt,!mr))},pi=dn(function(Wi){tr==null||tr(Ln(Wi)),ii(Wi)}),Pr=function(Zi){kn!=="inline"&&Hn(zt,Zi)},Yr=function(){qn(zt)},Ur=Gr&&"".concat(Gr,"-popup"),zr=He.createElement("div",(0,fe.Z)({role:"menuitem",style:fi,className:"".concat(Jr,"-title"),tabIndex:yi?null:-1,ref:bi,title:typeof Nt=="string"?Nt:null,"data-menu-id":_r&&Gr?null:Gr,"aria-expanded":ni,"aria-haspopup":!0,"aria-controls":Ur,"aria-disabled":yi,onClick:_i,onFocus:Yr},ci),Nt,He.createElement(An,{icon:kn!=="horizontal"?Zn:void 0,props:(0,Fe.Z)((0,Fe.Z)({},yt),{},{isOpen:ni,isSubMenu:!0})},He.createElement("i",{className:"".concat(Jr,"-arrow")}))),ui=He.useRef(kn);if(kn!=="inline"&&ri.length>1?ui.current="vertical":ui.current=kn,!_r){var oi=ui.current;zr=He.createElement(ct,{mode:oi,prefixCls:Jr,visible:!Dn&&ni&&kn!=="inline",popupClassName:Un,popupOffset:Pn,popupStyle:fr,popup:He.createElement(Ve,{mode:oi==="horizontal"?"vertical":oi},He.createElement(Or,{id:Ur,ref:Yn},zn)),disabled:yi,onVisibleChange:Pr},zr)}var zi=He.createElement(Me.Z.Item,(0,fe.Z)({role:"none"},Br,{component:"li",style:Ot,className:Se()(Jr,"".concat(Jr,"-").concat(kn),Dt,(xt={},(0,Ze.Z)(xt,"".concat(Jr,"-open"),ni),(0,Ze.Z)(xt,"".concat(Jr,"-active"),ai),(0,Ze.Z)(xt,"".concat(Jr,"-selected"),xi),(0,Ze.Z)(xt,"".concat(Jr,"-disabled"),yi),xt)),onMouseEnter:ei,onMouseLeave:Ai}),zr,!_r&&He.createElement(Be,{id:Ur,open:ni,keyPath:ri},zn));return $r&&(zi=$r(zi,yt,{selected:xi,active:ai,open:ni,disabled:yi})),He.createElement(Ve,{onItemClick:pi,mode:kn==="horizontal"?"vertical":kn,itemIcon:Vn,expandIcon:Zn},zi)};function dt(Oe){var yt=Oe.eventKey,xt=Oe.children,Ot=Qe(yt),Dt=Er(xt,Ot),Nt=et();He.useEffect(function(){if(Nt)return Nt.registerPath(yt,Ot),function(){Nt.unregisterPath(yt,Ot)}},[Ot]);var zt;return Nt?zt=Dt:zt=He.createElement(Xe,Oe,Dt),He.createElement(Mt.Provider,{value:Ot},zt)}var Ht=ue(76190),kt=["className","title","eventKey","children"],Wt=["children"],vn=function(yt){var xt=yt.className,Ot=yt.title,Dt=yt.eventKey,Nt=yt.children,zt=(0,Le.Z)(yt,kt),gn=He.useContext(at),wn=gn.prefixCls,Dn="".concat(wn,"-item-group");return He.createElement("li",(0,fe.Z)({role:"presentation"},zt,{onClick:function(er){return er.stopPropagation()},className:Se()(Dn,xt)}),He.createElement("div",{role:"presentation",className:"".concat(Dn,"-title"),title:typeof Ot=="string"?Ot:void 0},Ot),He.createElement("ul",{role:"group",className:"".concat(Dn,"-list")},Nt))};function xn(Oe){var yt=Oe.children,xt=(0,Le.Z)(Oe,Wt),Ot=Qe(xt.eventKey),Dt=Er(yt,Ot),Nt=et();return Nt?Dt:He.createElement(vn,(0,Ue.Z)(xt,["warnKey"]),Dt)}function Cn(Oe){var yt=Oe.className,xt=Oe.style,Ot=He.useContext(at),Dt=Ot.prefixCls,Nt=et();return Nt?null:He.createElement("li",{role:"separator",className:Se()("".concat(Dt,"-item-divider"),yt),style:xt})}var Lt=["label","children","key","type"];function ln(Oe){return(Oe||[]).map(function(yt,xt){if(yt&&(0,Ht.Z)(yt)==="object"){var Ot=yt,Dt=Ot.label,Nt=Ot.children,zt=Ot.key,gn=Ot.type,wn=(0,Le.Z)(Ot,Lt),Dn=zt!=null?zt:"tmp-".concat(xt);return Nt||gn==="group"?gn==="group"?He.createElement(xn,(0,fe.Z)({key:Dn},wn,{title:Dt}),ln(Nt)):He.createElement(dt,(0,fe.Z)({key:Dn},wn,{title:Dt}),ln(Nt)):gn==="divider"?He.createElement(Cn,(0,fe.Z)({key:Dn},wn)):He.createElement(Hr,(0,fe.Z)({key:Dn},wn),Dt)}return null}).filter(function(yt){return yt})}function it(Oe,yt,xt){var Ot=Oe;return yt&&(Ot=ln(yt)),Er(Ot,xt)}var wt=["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"],Et=[],At=He.forwardRef(function(Oe,yt){var xt,Ot,Dt=Oe,Nt=Dt.prefixCls,zt=Nt===void 0?"rc-menu":Nt,gn=Dt.rootClassName,wn=Dt.style,Dn=Dt.className,zn=Dt.tabIndex,er=zn===void 0?0:zn,cr=Dt.items,Un=Dt.children,Pn=Dt.direction,fr=Dt.id,tr=Dt.mode,yr=tr===void 0?"vertical":tr,Gn=Dt.inlineCollapsed,Xn=Dt.disabled,br=Dt.disabledOverflow,ur=Dt.subMenuOpenDelay,Br=ur===void 0?.1:ur,Gr=Dt.subMenuCloseDelay,ar=Gr===void 0?.1:Gr,En=Dt.forceSubMenuRender,kn=Dt.defaultOpenKeys,gr=Dt.openKeys,nr=Dt.activeKey,_r=Dt.defaultActiveFirst,Lr=Dt.selectable,Ir=Lr===void 0?!0:Lr,pr=Dt.multiple,Sr=pr===void 0?!1:pr,ii=Dt.defaultSelectedKeys,Hn=Dt.selectedKeys,qn=Dt.onSelect,Dr=Dt.onDeselect,$r=Dt.inlineIndent,li=$r===void 0?24:$r,di=Dt.motion,ri=Dt.defaultMotions,Jr=Dt.triggerSubMenuAction,yi=Jr===void 0?"hover":Jr,bi=Dt.builtinPlacements,Yn=Dt.itemIcon,Vn=Dt.expandIcon,Zn=Dt.overflowedIndicator,mr=Zn===void 0?"...":Zn,ni=Dt.overflowedIndicatorPopupClassName,xi=Dt.getPopupContainer,Mi=Dt.onClick,gi=Dt.onOpenChange,ci=Dt.onKeyDown,ki=Dt.openAnimation,Hi=Dt.openTransitionName,Ni=Dt._internalRenderMenuItem,oa=Dt._internalRenderSubMenuItem,Xr=(0,Le.Z)(Dt,wt),ei=He.useMemo(function(){return it(Un,cr,Et)},[Un,cr]),Ai=He.useState(!1),ai=(0,be.Z)(Ai,2),fi=ai[0],_i=ai[1],pi=He.useRef(),Pr=vt(fr),Yr=Pn==="rtl",Ur=(0,Pe.Z)(kn,{value:gr,postState:function(Bi){return Bi||Et}}),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,ht.flushSync)(Ya):Ya()},Wi=He.useState(ui),Zi=(0,be.Z)(Wi,2),na=Zi[0],wi=Zi[1],vi=He.useRef(!1),Gi=He.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=He.useState(sa),oo=(0,be.Z)(ao,2),eo=oo[0],Ss=oo[1],fo=He.useState(ta),Ea=(0,be.Z)(fo,2),fa=Ea[0],bo=Ea[1];He.useEffect(function(){Ss(sa),bo(ta),vi.current&&(ts?oi(na):zi(Et))},[sa,ta]);var ko=He.useState(0),Eo=(0,be.Z)(ko,2),ns=Eo[0],$o=Eo[1],Xa=ns>=ei.length-1||eo!=="horizontal"||br;He.useEffect(function(){ts&&wi(ui)},[ui]),He.useEffect(function(){return vi.current=!0,function(){vi.current=!1}},[]);var Oa=Yt(),Oi=Oa.registerPath,Lo=Oa.unregisterPath,rs=Oa.refreshOverflowKeys,Do=Oa.isSubPathKey,Ei=Oa.getKeyPath,mi=Oa.getKeys,Ki=Oa.getSubPathKeys,La=He.useMemo(function(){return{registerPath:Oi,unregisterPath:Lo}},[Oi,Lo]),Xi=He.useMemo(function(){return{isSubPathKey:Do}},[Do]);He.useEffect(function(){rs(Xa?Et:ei.slice(ns+1).map(function(Ii){return Ii.key}))},[ns,Xa]);var $a=(0,Pe.Z)(nr||_r&&((xt=ei[0])===null||xt===void 0?void 0:xt.key),{value:nr}),Fa=(0,be.Z)($a,2),to=Fa[0],Ra=Fa[1],so=dn(function(Ii){Ra(Ii)}),lo=dn(function(){Ra(void 0)});(0,He.useImperativeHandle)(yt,function(){return{list:pi.current,focus:function(Bi){var ji,Ya=mi(),Aa=pe(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,Pe.Z)(ii||[],{value:Hn,postState:function(Bi){return Array.isArray(Bi)?Bi:Bi==null?Et:[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,tt.Z)(jo),[ji]):Aa=[ji],Js(Aa);var xo=(0,Fe.Z)((0,Fe.Z)({},Bi),{},{selectedKeys:Aa});Ya?Dr==null||Dr(xo):qn==null||qn(xo)}!Sr&&ui.length&&eo!=="inline"&&zi(Et)},Hl=dn(function(Ii){Mi==null||Mi(Ln(Ii)),Kl(Ii)}),Cs=dn(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,rt.Z)(ui,ji,!0)||zi(ji,!0)}),_c=function(Bi,ji){var Ya=ji!=null?ji:!ui.includes(Bi);Cs(Bi,Ya)},is=le(eo,to,Yr,Pr,pi,mi,Ei,Ra,_c,ci);He.useEffect(function(){_i(!0)},[]);var xl=He.useMemo(function(){return{_internalRenderMenuItem:Ni,_internalRenderSubMenuItem:oa}},[Ni,oa]),Vo=eo!=="horizontal"||br?ei:ei.map(function(Ii,Bi){return He.createElement(Ve,{key:Ii.key,overflowDisabled:Bi>ns},Ii)}),as=He.createElement(Me.Z,(0,fe.Z)({id:fr,ref:pi,prefixCls:"".concat(zt,"-overflow"),component:"ul",itemComponent:Hr,className:Se()(zt,"".concat(zt,"-root"),"".concat(zt,"-").concat(eo),Dn,(Ot={},(0,Ze.Z)(Ot,"".concat(zt,"-inline-collapsed"),fa),(0,Ze.Z)(Ot,"".concat(zt,"-rtl"),Yr),Ot),gn),dir:Pn,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 He.createElement(dt,{eventKey:Ut,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 He.createElement(Pt.Provider,{value:xl},He.createElement(Je.Provider,{value:Pr},He.createElement(Ve,{prefixCls:zt,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:En,builtinPlacements:bi,triggerSubMenuAction:yi,getPopupContainer:xi,itemIcon:Yn,expandIcon:Vn,onItemClick:Hl,onOpenChange:Cs},He.createElement(Kt.Provider,{value:Xi},as),He.createElement("div",{style:{display:"none"},"aria-hidden":!0},He.createElement(We.Provider,{value:La},ei)))))}),nn=At,_t=nn;_t.Item=Hr,_t.SubMenu=dt,_t.ItemGroup=xn,_t.Divider=Cn;var tn=_t},83836:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return sn}});var fe=ue(54476),Ze=ue(33885),Fe=ue(42978),tt=ue(75931),be=ue(59301),Le=ue(92310),Re=ue.n(Le),Se=ue(29301),Me=ue(34280),Pe=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],rt=void 0;function Te(jt,Ke){var xe=jt.prefixCls,bt=jt.invalidate,fn=jt.item,Xt=jt.renderItem,qe=jt.responsive,je=jt.responsiveDisabled,gt=jt.registerSize,en=jt.itemKey,Zt=jt.className,pn=jt.style,Vt=jt.children,Ft=jt.display,Tt=jt.order,ge=jt.component,se=ge===void 0?"div":ge,oe=(0,tt.Z)(jt,Pe),de=qe&&!Ft;function pe(It){gt(en,It)}be.useEffect(function(){return function(){pe(null)}},[]);var le=Xt&&fn!==rt?Xt(fn,{index:Tt}):Vt,De;bt||(De={opacity:de?0:1,height:de?0:rt,overflowY:de?"hidden":rt,order:qe?Tt:rt,pointerEvents:de?"none":rt,position:de?"absolute":rt});var ot={};de&&(ot["aria-hidden"]=!0);var $t=be.createElement(se,(0,fe.Z)({className:Re()(!bt&&xe,Zt),style:(0,Ze.Z)((0,Ze.Z)({},De),pn)},ot,oe,{ref:Ke}),le);return qe&&($t=be.createElement(Se.Z,{onResize:function(Ut){var Yt=Ut.offsetWidth;pe(Yt)},disabled:je},$t)),$t}var He=be.forwardRef(Te);He.displayName="Item";var ht=He,Je=ue(6089),lt=ue(4676),st=ue(16089);function Rt(jt){if(typeof MessageChannel=="undefined")(0,st.Z)(jt);else{var Ke=new MessageChannel;Ke.port1.onmessage=function(){return jt()},Ke.port2.postMessage(void 0)}}function qt(){var jt=be.useRef(null),Ke=function(bt){jt.current||(jt.current=[],Rt(function(){(0,lt.unstable_batchedUpdates)(function(){jt.current.forEach(function(fn){fn()}),jt.current=null})})),jt.current.push(bt)};return Ke}function at(jt,Ke){var xe=be.useState(Ke),bt=(0,Fe.Z)(xe,2),fn=bt[0],Xt=bt[1],qe=(0,Je.Z)(function(je){jt(function(){Xt(je)})});return[fn,qe]}var ft=be.createContext(null),Ve=["component"],_e=["className"],We=["className"],et=function(Ke,xe){var bt=be.useContext(ft);if(!bt){var fn=Ke.component,Xt=fn===void 0?"div":fn,qe=(0,tt.Z)(Ke,Ve);return be.createElement(Xt,(0,fe.Z)({},qe,{ref:xe}))}var je=bt.className,gt=(0,tt.Z)(bt,_e),en=Ke.className,Zt=(0,tt.Z)(Ke,We);return be.createElement(ft.Provider,{value:null},be.createElement(ht,(0,fe.Z)({ref:xe,className:Re()(je,en)},gt,Zt)))},Mt=be.forwardRef(et);Mt.displayName="RawItem";var Qe=Mt,Kt=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","prefix","suffix","component","itemComponent","onVisibleChange"],ut="responsive",Pt="invalidate";function nt(jt){return"+ ".concat(jt.length," ...")}function Gt(jt,Ke){var xe=jt.prefixCls,bt=xe===void 0?"rc-overflow":xe,fn=jt.data,Xt=fn===void 0?[]:fn,qe=jt.renderItem,je=jt.renderRawItem,gt=jt.itemKey,en=jt.itemWidth,Zt=en===void 0?10:en,pn=jt.ssr,Vt=jt.style,Ft=jt.className,Tt=jt.maxCount,ge=jt.renderRest,se=jt.renderRawRest,oe=jt.prefix,de=jt.suffix,pe=jt.component,le=pe===void 0?"div":pe,De=jt.itemComponent,ot=jt.onVisibleChange,$t=(0,tt.Z)(jt,Kt),It=pn==="full",Ut=qt(),Yt=at(Ut,null),dn=(0,Fe.Z)(Yt,2),hn=dn[0],_n=dn[1],vt=hn||0,cn=at(Ut,new Map),Sn=(0,Fe.Z)(cn,2),Ye=Sn[0],ze=Sn[1],Ue=at(Ut,0),Bt=(0,Fe.Z)(Ue,2),Jt=Bt[0],rn=Bt[1],An=at(Ut,0),In=(0,Fe.Z)(An,2),Ln=In[0],Fn=In[1],jn=at(Ut,0),Tn=(0,Fe.Z)(jn,2),hr=Tn[0],kr=Tn[1],Tr=at(Ut,0),Hr=(0,Fe.Z)(Tr,2),sr=Hr[0],Mr=Hr[1],rr=(0,be.useState)(null),Or=(0,Fe.Z)(rr,2),Fr=Or[0],Er=Or[1],jr=(0,be.useState)(null),Nr=(0,Fe.Z)(jr,2),Jn=Nr[0],lr=Nr[1],Rn=be.useMemo(function(){return Jn===null&&It?Number.MAX_SAFE_INTEGER:Jn||0},[Jn,hn]),$n=(0,be.useState)(!1),wr=(0,Fe.Z)($n,2),ct=wr[0],ke=wr[1],Be="".concat(bt,"-item"),Ae=Math.max(Jt,Ln),Ie=Tt===ut,Xe=Xt.length&&Ie,dt=Tt===Pt,Ht=Xe||typeof Tt=="number"&&Xt.length>Tt,kt=(0,be.useMemo)(function(){var Nt=Xt;return Xe?hn===null&&It?Nt=Xt:Nt=Xt.slice(0,Math.min(Xt.length,vt/Zt)):typeof Tt=="number"&&(Nt=Xt.slice(0,Tt)),Nt},[Xt,Zt,hn,Tt,Xe]),Wt=(0,be.useMemo)(function(){return Xe?Xt.slice(Rn+1):Xt.slice(kt.length)},[Xt,kt,Xe,Rn]),vn=(0,be.useCallback)(function(Nt,zt){var gn;return typeof gt=="function"?gt(Nt):(gn=gt&&(Nt==null?void 0:Nt[gt]))!==null&&gn!==void 0?gn:zt},[gt]),xn=(0,be.useCallback)(qe||function(Nt){return Nt},[qe]);function Cn(Nt,zt,gn){Jn===Nt&&(zt===void 0||zt===Fr)||(lr(Nt),gn||(ke(Nt<Xt.length-1),ot==null||ot(Nt)),zt!==void 0&&Er(zt))}function Lt(Nt,zt){_n(zt.clientWidth)}function ln(Nt,zt){ze(function(gn){var wn=new Map(gn);return zt===null?wn.delete(Nt):wn.set(Nt,zt),wn})}function it(Nt,zt){Fn(zt),rn(Ln)}function wt(Nt,zt){kr(zt)}function Et(Nt,zt){Mr(zt)}function At(Nt){return Ye.get(vn(kt[Nt],Nt))}(0,Me.Z)(function(){if(vt&&typeof Ae=="number"&&kt){var Nt=hr+sr,zt=kt.length,gn=zt-1;if(!zt){Cn(0,null);return}for(var wn=0;wn<zt;wn+=1){var Dn=At(wn);if(It&&(Dn=Dn||0),Dn===void 0){Cn(wn-1,void 0,!0);break}if(Nt+=Dn,gn===0&&Nt<=vt||wn===gn-1&&Nt+At(gn)<=vt){Cn(gn,null);break}else if(Nt+Ae>vt){Cn(wn-1,Nt-Dn-sr+Ln);break}}de&&At(0)+sr>vt&&Er(null)}},[vt,Ye,Ln,hr,sr,vn,kt]);var nn=ct&&!!Wt.length,_t={};Fr!==null&&Xe&&(_t={position:"absolute",left:Fr,top:0});var tn={prefixCls:Be,responsive:Xe,component:De,invalidate:dt},Oe=je?function(Nt,zt){var gn=vn(Nt,zt);return be.createElement(ft.Provider,{key:gn,value:(0,Ze.Z)((0,Ze.Z)({},tn),{},{order:zt,item:Nt,itemKey:gn,registerSize:ln,display:zt<=Rn})},je(Nt,zt))}:function(Nt,zt){var gn=vn(Nt,zt);return be.createElement(ht,(0,fe.Z)({},tn,{order:zt,key:gn,item:Nt,renderItem:xn,itemKey:gn,registerSize:ln,display:zt<=Rn}))},yt={order:nn?Rn:Number.MAX_SAFE_INTEGER,className:"".concat(Be,"-rest"),registerSize:it,display:nn},xt=ge||nt,Ot=se?be.createElement(ft.Provider,{value:(0,Ze.Z)((0,Ze.Z)({},tn),yt)},se(Wt)):be.createElement(ht,(0,fe.Z)({},tn,yt),typeof xt=="function"?xt(Wt):xt),Dt=be.createElement(le,(0,fe.Z)({className:Re()(!dt&&bt,Ft),style:Vt,ref:Ke},$t),oe&&be.createElement(ht,(0,fe.Z)({},tn,{responsive:Ie,responsiveDisabled:!Xe,order:-1,className:"".concat(Be,"-prefix"),registerSize:wt,display:!0}),oe),kt.map(Oe),Ht?Ot:null,de&&be.createElement(ht,(0,fe.Z)({},tn,{responsive:Ie,responsiveDisabled:!Xe,order:Rn,className:"".concat(Be,"-suffix"),registerSize:Et,display:!0,style:_t}),de));return Ie?be.createElement(Se.Z,{onResize:Lt,disabled:!Xe},Dt):Dt}var mn=be.forwardRef(Gt);mn.displayName="Overflow",mn.Item=Qe,mn.RESPONSIVE=ut,mn.INVALIDATE=Pt;var on=mn,sn=on},17115:function(Mn,Qt,ue){"use strict";ue.d(Qt,{ZP:function(){return Re}});var fe=ue(42978),Ze=ue(59301),Fe=ue(47273),tt=0,be=(0,Fe.Z)();function Le(){var Se;return be?(Se=tt,tt+=1):Se="TEST_OR_SSR",Se}function Re(Se){var Me=Ze.useState(),Pe=(0,fe.Z)(Me,2),rt=Pe[0],Te=Pe[1];return Ze.useEffect(function(){Te("rc_select_".concat(Le()))},[]),Se||rt}},77861:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Ac:function(){return hn},Xo:function(){return Ln},Wx:function(){return jn},ZP:function(){return Be},lk:function(){return ft}});var fe=ue(54476),Ze=ue(94480),Fe=ue(20068),tt=ue(33885),be=ue(42978),Le=ue(75931),Re=ue(76190),Se=ue(18929),Me=ue(48736),Pe=ue(59301),rt=ue(92310),Te=ue.n(rt),He=ue(34280),ht=ue(49658),Je=ue(10228),lt=ue(8654),st=function(Ie){var Xe=Ie.className,dt=Ie.customizeIcon,Ht=Ie.customizeIconProps,kt=Ie.onMouseDown,Wt=Ie.onClick,vn=Ie.children,xn;return typeof dt=="function"?xn=dt(Ht):xn=dt,Pe.createElement("span",{className:Xe,onMouseDown:function(Lt){Lt.preventDefault(),kt&&kt(Lt)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:Wt,"aria-hidden":!0},xn!==void 0?xn:Pe.createElement("span",{className:Te()(Xe.split(/\s+/).map(function(Cn){return"".concat(Cn,"-icon")}))},vn))},Rt=st;function qt(Ae,Ie,Xe,dt,Ht){var kt=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,Wt=arguments.length>6?arguments[6]:void 0,vn=arguments.length>7?arguments[7]:void 0,xn=Pe.useMemo(function(){if((0,Re.Z)(dt)==="object")return dt.clearIcon;if(Ht)return Ht},[dt,Ht]),Cn=Pe.useMemo(function(){return!!(!kt&&dt&&(Xe.length||Wt)&&!(vn==="combobox"&&Wt===""))},[dt,kt,Xe.length,Wt,vn]);return{allowClear:Cn,clearIcon:Pe.createElement(Rt,{className:"".concat(Ae,"-clear"),onMouseDown:Ie,customizeIcon:xn},"\xD7")}}var at=Pe.createContext(null);function ft(){return Pe.useContext(at)}function Ve(){var Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,Ie=Pe.useState(!1),Xe=(0,be.Z)(Ie,2),dt=Xe[0],Ht=Xe[1],kt=Pe.useRef(null),Wt=function(){window.clearTimeout(kt.current)};Pe.useEffect(function(){return Wt},[]);var vn=function(Cn,Lt){Wt(),kt.current=window.setTimeout(function(){Ht(Cn),Lt&&Lt()},Ae)};return[dt,vn,Wt]}function _e(){var Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,Ie=Pe.useRef(null),Xe=Pe.useRef(null);Pe.useEffect(function(){return function(){window.clearTimeout(Xe.current)}},[]);function dt(Ht){(Ht||Ie.current===null)&&(Ie.current=Ht),window.clearTimeout(Xe.current),Xe.current=window.setTimeout(function(){Ie.current=null},Ae)}return[function(){return Ie.current},dt]}function We(Ae,Ie,Xe,dt){var Ht=Pe.useRef(null);Ht.current={open:Ie,triggerOpen:Xe,customizedTrigger:dt},Pe.useEffect(function(){function kt(Wt){var vn;if(!((vn=Ht.current)!==null&&vn!==void 0&&vn.customizedTrigger)){var xn=Wt.target;xn.shadowRoot&&Wt.composed&&(xn=Wt.composedPath()[0]||xn),Ht.current.open&&Ae().filter(function(Cn){return Cn}).every(function(Cn){return!Cn.contains(xn)&&Cn!==xn})&&Ht.current.triggerOpen(!1)}}return window.addEventListener("mousedown",kt),function(){return window.removeEventListener("mousedown",kt)}},[])}var et=ue(26112),Mt=ue(83836),Qe=function(Ie,Xe){var dt,Ht,kt=Ie.prefixCls,Wt=Ie.id,vn=Ie.inputElement,xn=Ie.disabled,Cn=Ie.tabIndex,Lt=Ie.autoFocus,ln=Ie.autoComplete,it=Ie.editable,wt=Ie.activeDescendantId,Et=Ie.value,At=Ie.maxLength,nn=Ie.onKeyDown,_t=Ie.onMouseDown,tn=Ie.onChange,Oe=Ie.onPaste,yt=Ie.onCompositionStart,xt=Ie.onCompositionEnd,Ot=Ie.open,Dt=Ie.attrs,Nt=vn||Pe.createElement("input",null),zt=Nt,gn=zt.ref,wn=zt.props,Dn=wn.onKeyDown,zn=wn.onChange,er=wn.onMouseDown,cr=wn.onCompositionStart,Un=wn.onCompositionEnd,Pn=wn.style;return(0,Me.Kp)(!("maxLength"in Nt.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),Nt=Pe.cloneElement(Nt,(0,tt.Z)((0,tt.Z)((0,tt.Z)({type:"search"},wn),{},{id:Wt,ref:(0,lt.sQ)(Xe,gn),disabled:xn,tabIndex:Cn,autoComplete:ln||"off",autoFocus:Lt,className:Te()("".concat(kt,"-selection-search-input"),(dt=Nt)===null||dt===void 0||(Ht=dt.props)===null||Ht===void 0?void 0:Ht.className),role:"combobox","aria-label":"Search","aria-expanded":Ot||!1,"aria-haspopup":"listbox","aria-owns":"".concat(Wt,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(Wt,"_list"),"aria-activedescendant":Ot?wt:void 0},Dt),{},{value:it?Et:"",maxLength:At,readOnly:!it,unselectable:it?null:"on",style:(0,tt.Z)((0,tt.Z)({},Pn),{},{opacity:it?null:0}),onKeyDown:function(tr){nn(tr),Dn&&Dn(tr)},onMouseDown:function(tr){_t(tr),er&&er(tr)},onChange:function(tr){tn(tr),zn&&zn(tr)},onCompositionStart:function(tr){yt(tr),cr&&cr(tr)},onCompositionEnd:function(tr){xt(tr),Un&&Un(tr)},onPaste:Oe})),Nt},Kt=Pe.forwardRef(Qe);Kt.displayName="Input";var ut=Kt;function Pt(Ae){return Array.isArray(Ae)?Ae:Ae!==void 0?[Ae]:[]}var nt=typeof window!="undefined"&&window.document&&window.document.documentElement,Gt=nt;function mn(Ae){return Ae!=null}function on(Ae){return!Ae&&Ae!==0}function sn(Ae){return["string","number"].includes((0,Re.Z)(Ae))}function jt(Ae){var Ie=void 0;return Ae&&(sn(Ae.title)?Ie=Ae.title.toString():sn(Ae.label)&&(Ie=Ae.label.toString())),Ie}function Ke(Ae,Ie){Gt?Pe.useLayoutEffect(Ae,Ie):Pe.useEffect(Ae,Ie)}function xe(Ae){var Ie;return(Ie=Ae.key)!==null&&Ie!==void 0?Ie:Ae.value}var bt=function(Ie){Ie.preventDefault(),Ie.stopPropagation()},fn=function(Ie){var Xe=Ie.id,dt=Ie.prefixCls,Ht=Ie.values,kt=Ie.open,Wt=Ie.searchValue,vn=Ie.autoClearSearchValue,xn=Ie.inputRef,Cn=Ie.placeholder,Lt=Ie.disabled,ln=Ie.mode,it=Ie.showSearch,wt=Ie.autoFocus,Et=Ie.autoComplete,At=Ie.activeDescendantId,nn=Ie.tabIndex,_t=Ie.removeIcon,tn=Ie.maxTagCount,Oe=Ie.maxTagTextLength,yt=Ie.maxTagPlaceholder,xt=yt===void 0?function(Lr){return"+ ".concat(Lr.length," ...")}:yt,Ot=Ie.tagRender,Dt=Ie.onToggleOpen,Nt=Ie.onRemove,zt=Ie.onInputChange,gn=Ie.onInputPaste,wn=Ie.onInputKeyDown,Dn=Ie.onInputMouseDown,zn=Ie.onInputCompositionStart,er=Ie.onInputCompositionEnd,cr=Pe.useRef(null),Un=(0,Pe.useState)(0),Pn=(0,be.Z)(Un,2),fr=Pn[0],tr=Pn[1],yr=(0,Pe.useState)(!1),Gn=(0,be.Z)(yr,2),Xn=Gn[0],br=Gn[1],ur="".concat(dt,"-selection"),Br=kt||ln==="multiple"&&vn===!1||ln==="tags"?Wt:"",Gr=ln==="tags"||ln==="multiple"&&vn===!1||it&&(kt||Xn);Ke(function(){tr(cr.current.scrollWidth)},[Br]);function ar(Lr,Ir,pr,Sr,ii){return Pe.createElement("span",{className:Te()("".concat(ur,"-item"),(0,Fe.Z)({},"".concat(ur,"-item-disabled"),pr)),title:jt(Lr)},Pe.createElement("span",{className:"".concat(ur,"-item-content")},Ir),Sr&&Pe.createElement(Rt,{className:"".concat(ur,"-item-remove"),onMouseDown:bt,onClick:ii,customizeIcon:_t},"\xD7"))}function En(Lr,Ir,pr,Sr,ii){var Hn=function(Dr){bt(Dr),Dt(!kt)};return Pe.createElement("span",{onMouseDown:Hn},Ot({label:Ir,value:Lr,disabled:pr,closable:Sr,onClose:ii}))}function kn(Lr){var Ir=Lr.disabled,pr=Lr.label,Sr=Lr.value,ii=!Lt&&!Ir,Hn=pr;if(typeof Oe=="number"&&(typeof pr=="string"||typeof pr=="number")){var qn=String(Hn);qn.length>Oe&&(Hn="".concat(qn.slice(0,Oe),"..."))}var Dr=function(li){li&&li.stopPropagation(),Nt(Lr)};return typeof Ot=="function"?En(Sr,Hn,Ir,ii,Dr):ar(Lr,Hn,Ir,ii,Dr)}function gr(Lr){var Ir=typeof xt=="function"?xt(Lr):xt;return ar({title:Ir},Ir,!1)}var nr=Pe.createElement("div",{className:"".concat(ur,"-search"),style:{width:fr},onFocus:function(){br(!0)},onBlur:function(){br(!1)}},Pe.createElement(ut,{ref:xn,open:kt,prefixCls:dt,id:Xe,inputElement:null,disabled:Lt,autoFocus:wt,autoComplete:Et,editable:Gr,activeDescendantId:At,value:Br,onKeyDown:wn,onMouseDown:Dn,onChange:zt,onPaste:gn,onCompositionStart:zn,onCompositionEnd:er,tabIndex:nn,attrs:(0,et.Z)(Ie,!0)}),Pe.createElement("span",{ref:cr,className:"".concat(ur,"-search-mirror"),"aria-hidden":!0},Br,"\xA0")),_r=Pe.createElement(Mt.Z,{prefixCls:"".concat(ur,"-overflow"),data:Ht,renderItem:kn,renderRest:gr,suffix:nr,itemKey:xe,maxCount:tn});return Pe.createElement(Pe.Fragment,null,_r,!Ht.length&&!Br&&Pe.createElement("span",{className:"".concat(ur,"-placeholder")},Cn))},Xt=fn,qe=function(Ie){var Xe=Ie.inputElement,dt=Ie.prefixCls,Ht=Ie.id,kt=Ie.inputRef,Wt=Ie.disabled,vn=Ie.autoFocus,xn=Ie.autoComplete,Cn=Ie.activeDescendantId,Lt=Ie.mode,ln=Ie.open,it=Ie.values,wt=Ie.placeholder,Et=Ie.tabIndex,At=Ie.showSearch,nn=Ie.searchValue,_t=Ie.activeValue,tn=Ie.maxLength,Oe=Ie.onInputKeyDown,yt=Ie.onInputMouseDown,xt=Ie.onInputChange,Ot=Ie.onInputPaste,Dt=Ie.onInputCompositionStart,Nt=Ie.onInputCompositionEnd,zt=Ie.title,gn=Pe.useState(!1),wn=(0,be.Z)(gn,2),Dn=wn[0],zn=wn[1],er=Lt==="combobox",cr=er||At,Un=it[0],Pn=nn||"";er&&_t&&!Dn&&(Pn=_t),Pe.useEffect(function(){er&&zn(!1)},[er,_t]);var fr=Lt!=="combobox"&&!ln&&!At?!1:!!Pn,tr=zt===void 0?jt(Un):zt,yr=function(){if(Un)return null;var Xn=fr?{visibility:"hidden"}:void 0;return Pe.createElement("span",{className:"".concat(dt,"-selection-placeholder"),style:Xn},wt)};return Pe.createElement(Pe.Fragment,null,Pe.createElement("span",{className:"".concat(dt,"-selection-search")},Pe.createElement(ut,{ref:kt,prefixCls:dt,id:Ht,open:ln,inputElement:Xe,disabled:Wt,autoFocus:vn,autoComplete:xn,editable:cr,activeDescendantId:Cn,value:Pn,onKeyDown:Oe,onMouseDown:yt,onChange:function(Xn){zn(!0),xt(Xn)},onPaste:Ot,onCompositionStart:Dt,onCompositionEnd:Nt,tabIndex:Et,attrs:(0,et.Z)(Ie,!0),maxLength:er?tn:void 0})),!er&&Un?Pe.createElement("span",{className:"".concat(dt,"-selection-item"),title:tr,style:fr?{visibility:"hidden"}:void 0},Un.label):null,yr())},je=qe;function gt(Ae){return![Je.Z.ESC,Je.Z.SHIFT,Je.Z.BACKSPACE,Je.Z.TAB,Je.Z.WIN_KEY,Je.Z.ALT,Je.Z.META,Je.Z.WIN_KEY_RIGHT,Je.Z.CTRL,Je.Z.SEMICOLON,Je.Z.EQUALS,Je.Z.CAPS_LOCK,Je.Z.CONTEXT_MENU,Je.Z.F1,Je.Z.F2,Je.Z.F3,Je.Z.F4,Je.Z.F5,Je.Z.F6,Je.Z.F7,Je.Z.F8,Je.Z.F9,Je.Z.F10,Je.Z.F11,Je.Z.F12].includes(Ae)}var en=function(Ie,Xe){var dt=(0,Pe.useRef)(null),Ht=(0,Pe.useRef)(!1),kt=Ie.prefixCls,Wt=Ie.open,vn=Ie.mode,xn=Ie.showSearch,Cn=Ie.tokenWithEnter,Lt=Ie.autoClearSearchValue,ln=Ie.onSearch,it=Ie.onSearchSubmit,wt=Ie.onToggleOpen,Et=Ie.onInputKeyDown,At=Ie.domRef;Pe.useImperativeHandle(Xe,function(){return{focus:function(){dt.current.focus()},blur:function(){dt.current.blur()}}});var nn=_e(0),_t=(0,be.Z)(nn,2),tn=_t[0],Oe=_t[1],yt=function(Pn){var fr=Pn.which;(fr===Je.Z.UP||fr===Je.Z.DOWN)&&Pn.preventDefault(),Et&&Et(Pn),fr===Je.Z.ENTER&&vn==="tags"&&!Ht.current&&!Wt&&(it==null||it(Pn.target.value)),gt(fr)&&wt(!0)},xt=function(){Oe(!0)},Ot=(0,Pe.useRef)(null),Dt=function(Pn){ln(Pn,!0,Ht.current)!==!1&&wt(!0)},Nt=function(){Ht.current=!0},zt=function(Pn){Ht.current=!1,vn!=="combobox"&&Dt(Pn.target.value)},gn=function(Pn){var fr=Pn.target.value;if(Cn&&Ot.current&&/[\r\n]/.test(Ot.current)){var tr=Ot.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");fr=fr.replace(tr,Ot.current)}Ot.current=null,Dt(fr)},wn=function(Pn){var fr=Pn.clipboardData,tr=fr.getData("text");Ot.current=tr},Dn=function(Pn){var fr=Pn.target;if(fr!==dt.current){var tr=document.body.style.msTouchAction!==void 0;tr?setTimeout(function(){dt.current.focus()}):dt.current.focus()}},zn=function(Pn){var fr=tn();Pn.target!==dt.current&&!fr&&vn!=="combobox"&&Pn.preventDefault(),(vn!=="combobox"&&(!xn||!fr)||!Wt)&&(Wt&&Lt!==!1&&ln("",!0,!1),wt())},er={inputRef:dt,onInputKeyDown:yt,onInputMouseDown:xt,onInputChange:gn,onInputPaste:wn,onInputCompositionStart:Nt,onInputCompositionEnd:zt},cr=vn==="multiple"||vn==="tags"?Pe.createElement(Xt,(0,fe.Z)({},Ie,er)):Pe.createElement(je,(0,fe.Z)({},Ie,er));return Pe.createElement("div",{ref:At,className:"".concat(kt,"-selector"),onClick:Dn,onMouseDown:zn},cr)},Zt=Pe.forwardRef(en);Zt.displayName="Selector";var pn=Zt,Vt=ue(35593),Ft=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],Tt=function(Ie){var Xe=Ie===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:Xe,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:Xe,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:Xe,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:Xe,adjustY:1},htmlRegion:"scroll"}}},ge=function(Ie,Xe){var dt=Ie.prefixCls,Ht=Ie.disabled,kt=Ie.visible,Wt=Ie.children,vn=Ie.popupElement,xn=Ie.animation,Cn=Ie.transitionName,Lt=Ie.dropdownStyle,ln=Ie.dropdownClassName,it=Ie.direction,wt=it===void 0?"ltr":it,Et=Ie.placement,At=Ie.builtinPlacements,nn=Ie.dropdownMatchSelectWidth,_t=Ie.dropdownRender,tn=Ie.dropdownAlign,Oe=Ie.getPopupContainer,yt=Ie.empty,xt=Ie.getTriggerDOMNode,Ot=Ie.onPopupVisibleChange,Dt=Ie.onPopupMouseEnter,Nt=(0,Le.Z)(Ie,Ft),zt="".concat(dt,"-dropdown"),gn=vn;_t&&(gn=_t(vn));var wn=Pe.useMemo(function(){return At||Tt(nn)},[At,nn]),Dn=xn?"".concat(zt,"-").concat(xn):Cn,zn=typeof nn=="number",er=Pe.useMemo(function(){return zn?null:nn===!1?"minWidth":"width"},[nn,zn]),cr=Lt;zn&&(cr=(0,tt.Z)((0,tt.Z)({},cr),{},{width:nn}));var Un=Pe.useRef(null);return Pe.useImperativeHandle(Xe,function(){return{getPopupElement:function(){return Un.current}}}),Pe.createElement(Vt.Z,(0,fe.Z)({},Nt,{showAction:Ot?["click"]:[],hideAction:Ot?["click"]:[],popupPlacement:Et||(wt==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:wn,prefixCls:zt,popupTransitionName:Dn,popup:Pe.createElement("div",{ref:Un,onMouseEnter:Dt},gn),stretch:er,popupAlign:tn,popupVisible:kt,getPopupContainer:Oe,popupClassName:Te()(ln,(0,Fe.Z)({},"".concat(zt,"-empty"),yt)),popupStyle:cr,getTriggerDOMNode:xt,onPopupVisibleChange:Ot}),Wt)},se=Pe.forwardRef(ge);se.displayName="SelectTrigger";var oe=se,de=ue(66712);function pe(Ae,Ie){var Xe=Ae.key,dt;return"value"in Ae&&(dt=Ae.value),Xe!=null?Xe:dt!==void 0?dt:"rc-index-key-".concat(Ie)}function le(Ae,Ie){var Xe=Ae||{},dt=Xe.label,Ht=Xe.value,kt=Xe.options,Wt=Xe.groupLabel,vn=dt||(Ie?"children":"label");return{label:vn,value:Ht||"value",options:kt||"options",groupLabel:Wt||vn}}function De(Ae){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Xe=Ie.fieldNames,dt=Ie.childrenAsData,Ht=[],kt=le(Xe,!1),Wt=kt.label,vn=kt.value,xn=kt.options,Cn=kt.groupLabel;function Lt(ln,it){ln.forEach(function(wt){if(it||!(xn in wt)){var Et=wt[vn];Ht.push({key:pe(wt,Ht.length),groupOption:it,data:wt,label:wt[Wt],value:Et})}else{var At=wt[Cn];At===void 0&&dt&&(At=wt.label),Ht.push({key:pe(wt,Ht.length),group:!0,data:wt,label:At}),Lt(wt[xn],!0)}})}return Lt(Ae,!1),Ht}function ot(Ae){var Ie=(0,tt.Z)({},Ae);return"props"in Ie||Object.defineProperty(Ie,"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`."),Ie}}),Ie}function $t(Ae,Ie){if(!Ie||!Ie.length)return null;var Xe=!1;function dt(kt,Wt){var vn=(0,de.Z)(Wt),xn=vn[0],Cn=vn.slice(1);if(!xn)return[kt];var Lt=kt.split(xn);return Xe=Xe||Lt.length>1,Lt.reduce(function(ln,it){return[].concat((0,Ze.Z)(ln),(0,Ze.Z)(dt(it,Cn)))},[]).filter(function(ln){return ln})}var Ht=dt(Ae,Ie);return Xe?Ht:null}var It=["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"],Ut=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function Yt(Ae){return Ae==="tags"||Ae==="multiple"}var dn=Pe.forwardRef(function(Ae,Ie){var Xe,dt,Ht=Ae.id,kt=Ae.prefixCls,Wt=Ae.className,vn=Ae.showSearch,xn=Ae.tagRender,Cn=Ae.direction,Lt=Ae.omitDomProps,ln=Ae.displayValues,it=Ae.onDisplayValuesChange,wt=Ae.emptyOptions,Et=Ae.notFoundContent,At=Et===void 0?"Not Found":Et,nn=Ae.onClear,_t=Ae.mode,tn=Ae.disabled,Oe=Ae.loading,yt=Ae.getInputElement,xt=Ae.getRawInputElement,Ot=Ae.open,Dt=Ae.defaultOpen,Nt=Ae.onDropdownVisibleChange,zt=Ae.activeValue,gn=Ae.onActiveValueChange,wn=Ae.activeDescendantId,Dn=Ae.searchValue,zn=Ae.autoClearSearchValue,er=Ae.onSearch,cr=Ae.onSearchSplit,Un=Ae.tokenSeparators,Pn=Ae.allowClear,fr=Ae.suffixIcon,tr=Ae.clearIcon,yr=Ae.OptionList,Gn=Ae.animation,Xn=Ae.transitionName,br=Ae.dropdownStyle,ur=Ae.dropdownClassName,Br=Ae.dropdownMatchSelectWidth,Gr=Ae.dropdownRender,ar=Ae.dropdownAlign,En=Ae.placement,kn=Ae.builtinPlacements,gr=Ae.getPopupContainer,nr=Ae.showAction,_r=nr===void 0?[]:nr,Lr=Ae.onFocus,Ir=Ae.onBlur,pr=Ae.onKeyUp,Sr=Ae.onKeyDown,ii=Ae.onMouseDown,Hn=(0,Le.Z)(Ae,It),qn=Yt(_t),Dr=(vn!==void 0?vn:qn)||_t==="combobox",$r=(0,tt.Z)({},Hn);Ut.forEach(function(Ei){delete $r[Ei]}),Lt==null||Lt.forEach(function(Ei){delete $r[Ei]});var li=Pe.useState(!1),di=(0,be.Z)(li,2),ri=di[0],Jr=di[1];Pe.useEffect(function(){Jr((0,ht.Z)())},[]);var yi=Pe.useRef(null),bi=Pe.useRef(null),Yn=Pe.useRef(null),Vn=Pe.useRef(null),Zn=Pe.useRef(null),mr=Ve(),ni=(0,be.Z)(mr,3),xi=ni[0],Mi=ni[1],gi=ni[2];Pe.useImperativeHandle(Ie,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=Pe.useMemo(function(){var Ei;if(_t!=="combobox")return Dn;var mi=(Ei=ln[0])===null||Ei===void 0?void 0:Ei.value;return typeof mi=="string"||typeof mi=="number"?String(mi):""},[Dn,_t,ln]),ki=_t==="combobox"&&typeof yt=="function"&&yt()||null,Hi=typeof xt=="function"&&xt(),Ni=(0,lt.x1)(bi,Hi==null||(Xe=Hi.props)===null||Xe===void 0?void 0:Xe.ref),oa=Pe.useState(!1),Xr=(0,be.Z)(oa,2),ei=Xr[0],Ai=Xr[1];(0,He.Z)(function(){Ai(!0)},[]);var ai=(0,Se.Z)(!1,{defaultValue:Dt,value:Ot}),fi=(0,be.Z)(ai,2),_i=fi[0],pi=fi[1],Pr=ei?_i:!1,Yr=!At&&wt;(tn||Yr&&Pr&&_t==="combobox")&&(Pr=!1);var Ur=Yr?!1:Pr,zr=Pe.useCallback(function(Ei){var mi=Ei!==void 0?Ei:!Pr;tn||(pi(mi),Pr!==mi&&(Nt==null||Nt(mi)))},[tn,Pr,pi,Nt]),ui=Pe.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:$t(mi,Un);return _t!=="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"})};Pe.useEffect(function(){!Pr&&!qn&&_t!=="combobox"&&oi("",!1,!1)},[Pr]),Pe.useEffect(function(){_i&&tn&&pi(!1),tn&&Mi(!1)},[tn]);var Wi=_e(),Zi=(0,be.Z)(Wi,2),na=Zi[0],wi=Zi[1],vi=function(mi){var Ki=na(),La=mi.which;if(La===Je.Z.ENTER&&(_t!=="combobox"&&mi.preventDefault(),Pr||zr(!0)),wi(!!ci),La===Je.Z.BACKSPACE&&!Ki&&qn&&!ci&&ln.length){for(var Xi=(0,Ze.Z)(ln),$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&&it(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=ln.filter(function(La){return La!==mi});it(Ki,{type:"remove",values:[mi]})},sa=Pe.useRef(!1),ta=function(){Mi(!0),tn||(Lr&&!sa.current&&Lr.apply(void 0,arguments),_r.includes("focus")&&zr(!0)),sa.current=!0},ts=function(){Mi(!1,function(){sa.current=!1,zr(!1)}),!tn&&(ci&&(_t==="tags"?er(ci,{source:"submit"}):_t==="multiple"&&er("",{source:"blur"})),Ir&&Ir.apply(void 0,arguments))},ao=[];Pe.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=Pe.useState({}),Ss=(0,be.Z)(eo,2),fo=Ss[1];function Ea(){fo({})}var fa;Hi&&(fa=function(mi){zr(mi)}),We(function(){var Ei;return[yi.current,(Ei=Yn.current)===null||Ei===void 0?void 0:Ei.getPopupElement()]},Ur,zr,!!Hi);var bo=Pe.useMemo(function(){return(0,tt.Z)((0,tt.Z)({},Ae),{},{notFoundContent:At,open:Pr,triggerOpen:Ur,id:Ht,showSearch:Dr,multiple:qn,toggleOpen:zr})},[Ae,At,Ur,Pr,Ht,Dr,qn,zr]),ko=!!fr||Oe,Eo;ko&&(Eo=Pe.createElement(Rt,{className:Te()("".concat(kt,"-arrow"),(0,Fe.Z)({},"".concat(kt,"-arrow-loading"),Oe)),customizeIcon:fr,customizeIconProps:{loading:Oe,searchValue:ci,open:Pr,focused:xi,showSearch:Dr}}));var ns=function(){var mi;nn==null||nn(),(mi=Vn.current)===null||mi===void 0||mi.focus(),it([],{type:"clear",values:ln}),oi("",!1,!1)},$o=qt(kt,ns,ln,Pn,tr,tn,ci,_t),Xa=$o.allowClear,Oa=$o.clearIcon,Oi=Pe.createElement(yr,{ref:Zn}),Lo=Te()(kt,Wt,(dt={},(0,Fe.Z)(dt,"".concat(kt,"-focused"),xi),(0,Fe.Z)(dt,"".concat(kt,"-multiple"),qn),(0,Fe.Z)(dt,"".concat(kt,"-single"),!qn),(0,Fe.Z)(dt,"".concat(kt,"-allow-clear"),Pn),(0,Fe.Z)(dt,"".concat(kt,"-show-arrow"),ko),(0,Fe.Z)(dt,"".concat(kt,"-disabled"),tn),(0,Fe.Z)(dt,"".concat(kt,"-loading"),Oe),(0,Fe.Z)(dt,"".concat(kt,"-open"),Pr),(0,Fe.Z)(dt,"".concat(kt,"-customize-input"),ki),(0,Fe.Z)(dt,"".concat(kt,"-show-search"),Dr),dt)),rs=Pe.createElement(oe,{ref:Yn,disabled:tn,prefixCls:kt,visible:Ur,popupElement:Oi,animation:Gn,transitionName:Xn,dropdownStyle:br,dropdownClassName:ur,direction:Cn,dropdownMatchSelectWidth:Br,dropdownRender:Gr,dropdownAlign:ar,placement:En,builtinPlacements:kn,getPopupContainer:gr,empty:wt,getTriggerDOMNode:function(){return bi.current},onPopupVisibleChange:fa,onPopupMouseEnter:Ea},Hi?Pe.cloneElement(Hi,{ref:Ni}):Pe.createElement(pn,(0,fe.Z)({},Ae,{domRef:bi,prefixCls:kt,inputElement:ki,ref:Vn,id:Ht,showSearch:Dr,autoClearSearchValue:zn,mode:_t,activeDescendantId:wn,tagRender:xn,values:ln,open:Pr,onToggleOpen:zr,activeValue:zt,searchValue:ci,onSearch:oi,onSearchSubmit:zi,onRemove:ca,tokenWithEnter:ui}))),Do;return Hi?Do=rs:Do=Pe.createElement("div",(0,fe.Z)({className:Lo},$r,{ref:yi,onMouseDown:oo,onKeyDown:vi,onKeyUp:Gi,onFocus:ta,onBlur:ts}),xi&&!Pr&&Pe.createElement("span",{style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0},"aria-live":"polite"},"".concat(ln.map(function(Ei){var mi=Ei.label,Ki=Ei.value;return["number","string"].includes((0,Re.Z)(mi))?mi:Ki}).join(", "))),rs,Eo,Xa&&Oa),Pe.createElement(at.Provider,{value:bo},Do)}),hn=dn,_n=function(Ae,Ie){var Xe=Pe.useRef({values:new Map,options:new Map}),dt=Pe.useMemo(function(){var kt=Xe.current,Wt=kt.values,vn=kt.options,xn=Ae.map(function(ln){if(ln.label===void 0){var it;return(0,tt.Z)((0,tt.Z)({},ln),{},{label:(it=Wt.get(ln.value))===null||it===void 0?void 0:it.label})}return ln}),Cn=new Map,Lt=new Map;return xn.forEach(function(ln){Cn.set(ln.value,ln),Lt.set(ln.value,Ie.get(ln.value)||vn.get(ln.value))}),Xe.current.values=Cn,Xe.current.options=Lt,xn},[Ae,Ie]),Ht=Pe.useCallback(function(kt){return Ie.get(kt)||Xe.current.options.get(kt)},[Ie]);return[dt,Ht]};function vt(Ae,Ie){return Pt(Ae).join("").toUpperCase().includes(Ie)}var cn=function(Ae,Ie,Xe,dt,Ht){return Pe.useMemo(function(){if(!Xe||dt===!1)return Ae;var kt=Ie.options,Wt=Ie.label,vn=Ie.value,xn=[],Cn=typeof dt=="function",Lt=Xe.toUpperCase(),ln=Cn?dt:function(wt,Et){return Ht?vt(Et[Ht],Lt):Et[kt]?vt(Et[Wt!=="children"?Wt:"label"],Lt):vt(Et[vn],Lt)},it=Cn?function(wt){return ot(wt)}:function(wt){return wt};return Ae.forEach(function(wt){if(wt[kt]){var Et=ln(Xe,it(wt));if(Et)xn.push(wt);else{var At=wt[kt].filter(function(nn){return ln(Xe,it(nn))});At.length&&xn.push((0,tt.Z)((0,tt.Z)({},wt),{},(0,Fe.Z)({},kt,At)))}return}ln(Xe,it(wt))&&xn.push(wt)}),xn},[Ae,dt,Ht,Xe,Ie])},Sn=ue(17115),Ye=ue(11592),ze=["children","value"],Ue=["children"];function Bt(Ae){var Ie=Ae,Xe=Ie.key,dt=Ie.props,Ht=dt.children,kt=dt.value,Wt=(0,Le.Z)(dt,ze);return(0,tt.Z)({key:Xe,value:kt!==void 0?kt:Xe,children:Ht},Wt)}function Jt(Ae){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,Ye.Z)(Ae).map(function(Xe,dt){if(!Pe.isValidElement(Xe)||!Xe.type)return null;var Ht=Xe,kt=Ht.type.isSelectOptGroup,Wt=Ht.key,vn=Ht.props,xn=vn.children,Cn=(0,Le.Z)(vn,Ue);return Ie||!kt?Bt(Xe):(0,tt.Z)((0,tt.Z)({key:"__RC_SELECT_GRP__".concat(Wt===null?dt:Wt,"__"),label:Wt},Cn),{},{options:Jt(xn)})}).filter(function(Xe){return Xe})}function rn(Ae,Ie,Xe,dt,Ht){return Pe.useMemo(function(){var kt=Ae,Wt=!Ae;Wt&&(kt=Jt(Ie));var vn=new Map,xn=new Map,Cn=function(it,wt,Et){Et&&typeof Et=="string"&&it.set(wt[Et],wt)};function Lt(ln){for(var it=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,wt=0;wt<ln.length;wt+=1){var Et=ln[wt];!Et[Xe.options]||it?(vn.set(Et[Xe.value],Et),Cn(xn,Et,Xe.label),Cn(xn,Et,dt),Cn(xn,Et,Ht)):Lt(Et[Xe.options],!0)}}return Lt(kt),{options:kt,valueOptions:vn,labelOptions:xn}},[Ae,Ie,Xe,dt,Ht])}function An(Ae){var Ie=Pe.useRef();Ie.current=Ae;var Xe=Pe.useCallback(function(){return Ie.current.apply(Ie,arguments)},[]);return Xe}var In=function(){return null};In.isSelectOptGroup=!0;var Ln=In,Fn=function(){return null};Fn.isSelectOption=!0;var jn=Fn,Tn=ue(80547),hr=ue(2738),kr=ue(48911),Tr=Pe.createContext(null),Hr=Tr;function sr(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var Mr=["disabled","title","children","style","className"];function rr(Ae){return typeof Ae=="string"||typeof Ae=="number"}var Or=function(Ie,Xe){var dt=ft(),Ht=dt.prefixCls,kt=dt.id,Wt=dt.open,vn=dt.multiple,xn=dt.mode,Cn=dt.searchValue,Lt=dt.toggleOpen,ln=dt.notFoundContent,it=dt.onPopupScroll,wt=Pe.useContext(Hr),Et=wt.flattenOptions,At=wt.onActiveValue,nn=wt.defaultActiveFirstOption,_t=wt.onSelect,tn=wt.menuItemSelectedIcon,Oe=wt.rawValues,yt=wt.fieldNames,xt=wt.virtual,Ot=wt.direction,Dt=wt.listHeight,Nt=wt.listItemHeight,zt="".concat(Ht,"-item"),gn=(0,Tn.Z)(function(){return Et},[Wt,Et],function(ar,En){return En[0]&&ar[1]!==En[1]}),wn=Pe.useRef(null),Dn=function(En){En.preventDefault()},zn=function(En){wn.current&&wn.current.scrollTo(typeof En=="number"?{index:En}:En)},er=function(En){for(var kn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,gr=gn.length,nr=0;nr<gr;nr+=1){var _r=(En+nr*kn+gr)%gr,Lr=gn[_r],Ir=Lr.group,pr=Lr.data;if(!Ir&&!pr.disabled)return _r}return-1},cr=Pe.useState(function(){return er(0)}),Un=(0,be.Z)(cr,2),Pn=Un[0],fr=Un[1],tr=function(En){var kn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;fr(En);var gr={source:kn?"keyboard":"mouse"},nr=gn[En];if(!nr){At(null,-1,gr);return}At(nr.value,En,gr)};(0,Pe.useEffect)(function(){tr(nn!==!1?er(0):-1)},[gn.length,Cn]);var yr=Pe.useCallback(function(ar){return Oe.has(ar)&&xn!=="combobox"},[xn,(0,Ze.Z)(Oe).toString(),Oe.size]);(0,Pe.useEffect)(function(){var ar=setTimeout(function(){if(!vn&&Wt&&Oe.size===1){var kn=Array.from(Oe)[0],gr=gn.findIndex(function(nr){var _r=nr.data;return _r.value===kn});gr!==-1&&(tr(gr),zn(gr))}});if(Wt){var En;(En=wn.current)===null||En===void 0||En.scrollTo(void 0)}return function(){return clearTimeout(ar)}},[Wt,Cn,Et.length]);var Gn=function(En){En!==void 0&&_t(En,{selected:!Oe.has(En)}),vn||Lt(!1)};if(Pe.useImperativeHandle(Xe,function(){return{onKeyDown:function(En){var kn=En.which,gr=En.ctrlKey;switch(kn){case Je.Z.N:case Je.Z.P:case Je.Z.UP:case Je.Z.DOWN:{var nr=0;if(kn===Je.Z.UP?nr=-1:kn===Je.Z.DOWN?nr=1:sr()&&gr&&(kn===Je.Z.N?nr=1:kn===Je.Z.P&&(nr=-1)),nr!==0){var _r=er(Pn+nr,nr);zn(_r),tr(_r,!0)}break}case Je.Z.ENTER:{var Lr=gn[Pn];Lr&&!Lr.data.disabled?Gn(Lr.value):Gn(void 0),Wt&&En.preventDefault();break}case Je.Z.ESC:Lt(!1),Wt&&En.stopPropagation()}},onKeyUp:function(){},scrollTo:function(En){zn(En)}}}),gn.length===0)return Pe.createElement("div",{role:"listbox",id:"".concat(kt,"_list"),className:"".concat(zt,"-empty"),onMouseDown:Dn},ln);var Xn=Object.keys(yt).map(function(ar){return yt[ar]}),br=function(En){return En.label};function ur(ar,En){var kn=ar.group;return{role:kn?"presentation":"option",id:"".concat(kt,"_list_").concat(En)}}var Br=function(En){var kn=gn[En];if(!kn)return null;var gr=kn.data||{},nr=gr.value,_r=kn.group,Lr=(0,et.Z)(gr,!0),Ir=br(kn);return kn?Pe.createElement("div",(0,fe.Z)({"aria-label":typeof Ir=="string"&&!_r?Ir:null},Lr,{key:En},ur(kn,En),{"aria-selected":yr(nr)}),nr):null},Gr={role:"listbox",id:"".concat(kt,"_list")};return Pe.createElement(Pe.Fragment,null,xt&&Pe.createElement("div",(0,fe.Z)({},Gr,{style:{height:0,width:0,overflow:"hidden"}}),Br(Pn-1),Br(Pn),Br(Pn+1)),Pe.createElement(kr.Z,{itemKey:"key",ref:wn,data:gn,height:Dt,itemHeight:Nt,fullHeight:!1,onMouseDown:Dn,onScroll:it,virtual:xt,direction:Ot,innerProps:xt?null:Gr},function(ar,En){var kn,gr=ar.group,nr=ar.groupOption,_r=ar.data,Lr=ar.label,Ir=ar.value,pr=_r.key;if(gr){var Sr,ii=(Sr=_r.title)!==null&&Sr!==void 0?Sr:rr(Lr)?Lr.toString():void 0;return Pe.createElement("div",{className:Te()(zt,"".concat(zt,"-group")),title:ii},Lr!==void 0?Lr:pr)}var Hn=_r.disabled,qn=_r.title,Dr=_r.children,$r=_r.style,li=_r.className,di=(0,Le.Z)(_r,Mr),ri=(0,hr.Z)(di,Xn),Jr=yr(Ir),yi="".concat(zt,"-option"),bi=Te()(zt,yi,li,(kn={},(0,Fe.Z)(kn,"".concat(yi,"-grouped"),nr),(0,Fe.Z)(kn,"".concat(yi,"-active"),Pn===En&&!Hn),(0,Fe.Z)(kn,"".concat(yi,"-disabled"),Hn),(0,Fe.Z)(kn,"".concat(yi,"-selected"),Jr),kn)),Yn=br(ar),Vn=!tn||typeof tn=="function"||Jr,Zn=typeof Yn=="number"?Yn:Yn||Ir,mr=rr(Zn)?Zn.toString():void 0;return qn!==void 0&&(mr=qn),Pe.createElement("div",(0,fe.Z)({},(0,et.Z)(ri),xt?{}:ur(ar,En),{"aria-selected":Jr,className:bi,title:mr,onMouseMove:function(){Pn===En||Hn||tr(En)},onClick:function(){Hn||Gn(Ir)},style:$r}),Pe.createElement("div",{className:"".concat(yi,"-content")},Zn),Pe.isValidElement(tn)||Jr,Vn&&Pe.createElement(Rt,{className:"".concat(zt,"-option-state"),customizeIcon:tn,customizeIconProps:{isSelected:Jr}},Jr?"\u2713":null))}))},Fr=Pe.forwardRef(Or);Fr.displayName="OptionList";var Er=Fr;function jr(Ae){var Ie=Ae.mode,Xe=Ae.options,dt=Ae.children,Ht=Ae.backfill,kt=Ae.allowClear,Wt=Ae.placeholder,vn=Ae.getInputElement,xn=Ae.showSearch,Cn=Ae.onSearch,Lt=Ae.defaultOpen,ln=Ae.autoFocus,it=Ae.labelInValue,wt=Ae.value,Et=Ae.inputValue,At=Ae.optionLabelProp,nn=isMultiple(Ie),_t=xn!==void 0?xn:nn||Ie==="combobox",tn=Xe||convertChildrenToData(dt);if(warning(Ie!=="tags"||tn.every(function(Ot){return!Ot.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Ie==="tags"||Ie==="combobox"){var Oe=tn.some(function(Ot){return Ot.options?Ot.options.some(function(Dt){return typeof("value"in Dt?Dt.value:Dt.key)=="number"}):typeof("value"in Ot?Ot.value:Ot.key)=="number"});warning(!Oe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(Ie!=="combobox"||!At,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(Ie==="combobox"||!Ht,"`backfill` only works with `combobox` mode."),warning(Ie==="combobox"||!vn,"`getInputElement` only work with `combobox` mode."),noteOnce(Ie!=="combobox"||!vn||!kt||!Wt,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Cn&&!_t&&Ie!=="combobox"&&Ie!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!Lt||ln,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),wt!=null){var yt=toArray(wt);warning(!it||yt.every(function(Ot){return _typeof(Ot)==="object"&&("key"in Ot||"value"in Ot)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!nn||Array.isArray(wt),"`value` should be array when `mode` is `multiple` or `tags`")}if(dt){var xt=null;toNodeArray(dt).some(function(Ot){if(!React.isValidElement(Ot)||!Ot.type)return!1;var Dt=Ot,Nt=Dt.type;if(Nt.isSelectOption)return!1;if(Nt.isSelectOptGroup){var zt=toNodeArray(Ot.props.children).every(function(gn){return!React.isValidElement(gn)||!Ot.type||gn.type.isSelectOption?!0:(xt=gn.type,!1)});return!zt}return xt=Nt,!0}),xt&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(xt.displayName||xt.name||xt,"`.")),warning(Et===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function Nr(Ae,Ie){if(Ae){var Xe=function dt(Ht){for(var kt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Wt=0;Wt<Ht.length;Wt++){var vn=Ht[Wt];if(vn[Ie==null?void 0:Ie.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!kt&&Array.isArray(vn[Ie==null?void 0:Ie.options])&&dt(vn[Ie==null?void 0:Ie.options],!0))break}};Xe(Ae)}}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(Ae){return!Ae||(0,Re.Z)(Ae)!=="object"}var wr=Pe.forwardRef(function(Ae,Ie){var Xe=Ae.id,dt=Ae.mode,Ht=Ae.prefixCls,kt=Ht===void 0?"rc-select":Ht,Wt=Ae.backfill,vn=Ae.fieldNames,xn=Ae.inputValue,Cn=Ae.searchValue,Lt=Ae.onSearch,ln=Ae.autoClearSearchValue,it=ln===void 0?!0:ln,wt=Ae.onSelect,Et=Ae.onDeselect,At=Ae.dropdownMatchSelectWidth,nn=At===void 0?!0:At,_t=Ae.filterOption,tn=Ae.filterSort,Oe=Ae.optionFilterProp,yt=Ae.optionLabelProp,xt=Ae.options,Ot=Ae.children,Dt=Ae.defaultActiveFirstOption,Nt=Ae.menuItemSelectedIcon,zt=Ae.virtual,gn=Ae.direction,wn=Ae.listHeight,Dn=wn===void 0?200:wn,zn=Ae.listItemHeight,er=zn===void 0?20:zn,cr=Ae.value,Un=Ae.defaultValue,Pn=Ae.labelInValue,fr=Ae.onChange,tr=(0,Le.Z)(Ae,lr),yr=(0,Sn.ZP)(Xe),Gn=Yt(dt),Xn=!!(!xt&&Ot),br=Pe.useMemo(function(){return _t===void 0&&dt==="combobox"?!1:_t},[_t,dt]),ur=Pe.useMemo(function(){return le(vn,Xn)},[JSON.stringify(vn),Xn]),Br=(0,Se.Z)("",{value:Cn!==void 0?Cn:xn,postState:function(Yr){return Yr||""}}),Gr=(0,be.Z)(Br,2),ar=Gr[0],En=Gr[1],kn=rn(xt,Ot,ur,Oe,yt),gr=kn.valueOptions,nr=kn.labelOptions,_r=kn.options,Lr=Pe.useCallback(function(Pr){var Yr=Pt(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[yt||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,yt,gr]),Ir=(0,Se.Z)(Un,{value:cr}),pr=(0,be.Z)(Ir,2),Sr=pr[0],ii=pr[1],Hn=Pe.useMemo(function(){var Pr,Yr=Lr(Sr);return dt==="combobox"&&on((Pr=Yr[0])===null||Pr===void 0?void 0:Pr.value)?[]:Yr},[Sr,Lr,dt]),qn=_n(Hn,gr),Dr=(0,be.Z)(qn,2),$r=Dr[0],li=Dr[1],di=Pe.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,tt.Z)((0,tt.Z)({},Yr),{},{label:(Ur=Yr.label)!==null&&Ur!==void 0?Ur:Yr.value})})},[dt,$r]),ri=Pe.useMemo(function(){return new Set($r.map(function(Pr){return Pr.value}))},[$r]);Pe.useEffect(function(){if(dt==="combobox"){var Pr,Yr=(Pr=$r[0])===null||Pr===void 0?void 0:Pr.value;En(mn(Yr)?String(Yr):"")}},[$r]);var Jr=An(function(Pr,Yr){var Ur,zr=Yr!=null?Yr:Pr;return Ur={},(0,Fe.Z)(Ur,ur.value,Pr),(0,Fe.Z)(Ur,ur.label,zr),Ur}),yi=Pe.useMemo(function(){if(dt!=="tags")return _r;var Pr=(0,Ze.Z)(_r),Yr=function(zr){return gr.has(zr)};return(0,Ze.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,_r,gr,$r,dt]),bi=cn(yi,ur,ar,br,Oe),Yn=Pe.useMemo(function(){return dt!=="tags"||!ar||bi.some(function(Pr){return Pr[Oe||"value"]===ar})||bi.some(function(Pr){return Pr[ur.value]===ar})?bi:[Jr(ar)].concat((0,Ze.Z)(bi))},[Jr,Oe,dt,bi,ar,ur]),Vn=Pe.useMemo(function(){return tn?(0,Ze.Z)(Yn).sort(function(Pr,Yr){return tn(Pr,Yr)}):Yn},[Yn,tn]),Zn=Pe.useMemo(function(){return De(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=Pn?Ur:Ur.map(function(oi){return oi.value}),ui=Ur.map(function(oi){return ot(li(oi.value))});fr(Gn?zr:zr[0],Gn?ui:ui[0])}},ni=Pe.useState(null),xi=(0,be.Z)(ni,2),Mi=xi[0],gi=xi[1],ci=Pe.useState(0),ki=(0,be.Z)(ci,2),Hi=ki[0],Ni=ki[1],oa=Dt!==void 0?Dt:dt!=="combobox",Xr=Pe.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),Wt&&dt==="combobox"&&Pr!==null&&ui==="keyboard"&&gi(String(Pr))},[Wt,dt]),ei=function(Yr,Ur,zr){var ui=function(){var sa,ta=li(Yr);return[Pn?{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,ot(ta)]};if(Ur&&wt){var oi=ui(),zi=(0,be.Z)(oi,2),Wi=zi[0],Zi=zi[1];wt(Wi,Zi)}else if(!Ur&&Et&&zr!=="clear"){var na=ui(),wi=(0,be.Z)(na,2),vi=wi[0],Gi=wi[1];Et(vi,Gi)}},Ai=An(function(Pr,Yr){var Ur,zr=Gn?Yr.selected:!0;zr?Ur=Gn?[].concat((0,Ze.Z)($r),[Pr]):[Pr]:Ur=$r.filter(function(ui){return ui.value!==Pr}),mr(Ur),ei(Pr,zr),dt==="combobox"?gi(""):(!Yt||it)&&(En(""),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(En(Yr),gi(null),Ur.source==="submit"){var zr=(Yr||"").trim();if(zr){var ui=Array.from(new Set([].concat((0,Ze.Z)(ri),[zr])));mr(ui),ei(zr,!0),En("")}return}Ur.source!=="blur"&&(dt==="combobox"&&mr(Yr),Lt==null||Lt(Yr))},_i=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,Ze.Z)(ri),(0,Ze.Z)(Ur))));mr(zr),zr.forEach(function(ui){ei(ui,!0)})},pi=Pe.useMemo(function(){var Pr=zt!==!1&&nn!==!1;return(0,tt.Z)((0,tt.Z)({},kn),{},{flattenOptions:Zn,onActiveValue:Xr,defaultActiveFirstOption:oa,onSelect:Ai,menuItemSelectedIcon:Nt,rawValues:ri,fieldNames:ur,virtual:Pr,direction:gn,listHeight:Dn,listItemHeight:er,childrenAsData:Xn})},[kn,Zn,Xr,oa,Ai,Nt,ri,ur,zt,nn,Dn,er,Xn]);return Pe.createElement(Hr.Provider,{value:pi},Pe.createElement(hn,(0,fe.Z)({},tr,{id:yr,prefixCls:kt,ref:Ie,omitDomProps:Rn,mode:dt,displayValues:di,onDisplayValuesChange:ai,direction:gn,searchValue:ar,onSearch:fi,autoClearSearchValue:it,onSearchSplit:_i,dropdownMatchSelectWidth:nn,OptionList:Er,emptyOptions:!Zn.length,activeValue:Mi,activeDescendantId:"".concat(yr,"_list_").concat(Hi)})))}),ct=wr;ct.Option=jn,ct.OptGroup=Ln;var ke=ct,Be=ke},9296:function(Mn,Qt,ue){"use strict";ue.r(Qt),ue.d(Qt,{ResizableTextArea:function(){return Kt},default:function(){return on}});var fe=ue(54476),Ze=ue(33885),Fe=ue(20068),tt=ue(76190),be=ue(42978),Le=ue(75931),Re=ue(94480),Se=ue(92310),Me=ue.n(Se),Pe=ue(93681),rt=ue(5643),Te=ue(18929),He=ue(59301),ht=ue(29301),Je=ue(34280),lt=ue(16089),st=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important;
pointer-events: none !important;
`,Rt=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],qt={},at;function ft(sn){var jt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ke=sn.getAttribute("id")||sn.getAttribute("data-reactid")||sn.getAttribute("name");if(jt&&qt[Ke])return qt[Ke];var xe=window.getComputedStyle(sn),bt=xe.getPropertyValue("box-sizing")||xe.getPropertyValue("-moz-box-sizing")||xe.getPropertyValue("-webkit-box-sizing"),fn=parseFloat(xe.getPropertyValue("padding-bottom"))+parseFloat(xe.getPropertyValue("padding-top")),Xt=parseFloat(xe.getPropertyValue("border-bottom-width"))+parseFloat(xe.getPropertyValue("border-top-width")),qe=Rt.map(function(gt){return"".concat(gt,":").concat(xe.getPropertyValue(gt))}).join(";"),je={sizingStyle:qe,paddingSize:fn,borderSize:Xt,boxSizing:bt};return jt&&Ke&&(qt[Ke]=je),je}function Ve(sn){var jt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ke=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,xe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;at||(at=document.createElement("textarea"),at.setAttribute("tab-index","-1"),at.setAttribute("aria-hidden","true"),document.body.appendChild(at)),sn.getAttribute("wrap")?at.setAttribute("wrap",sn.getAttribute("wrap")):at.removeAttribute("wrap");var bt=ft(sn,jt),fn=bt.paddingSize,Xt=bt.borderSize,qe=bt.boxSizing,je=bt.sizingStyle;at.setAttribute("style","".concat(je,";").concat(st)),at.value=sn.value||sn.placeholder||"";var gt=void 0,en=void 0,Zt,pn=at.scrollHeight;if(qe==="border-box"?pn+=Xt:qe==="content-box"&&(pn-=fn),Ke!==null||xe!==null){at.value=" ";var Vt=at.scrollHeight-fn;Ke!==null&&(gt=Vt*Ke,qe==="border-box"&&(gt=gt+fn+Xt),pn=Math.max(gt,pn)),xe!==null&&(en=Vt*xe,qe==="border-box"&&(en=en+fn+Xt),Zt=pn>en?"":"hidden",pn=Math.min(en,pn))}var Ft={height:pn,overflowY:Zt,resize:"none"};return gt&&(Ft.minHeight=gt),en&&(Ft.maxHeight=en),Ft}var _e=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],We=0,et=1,Mt=2,Qe=He.forwardRef(function(sn,jt){var Ke=sn,xe=Ke.prefixCls,bt=Ke.onPressEnter,fn=Ke.defaultValue,Xt=Ke.value,qe=Ke.autoSize,je=Ke.onResize,gt=Ke.className,en=Ke.style,Zt=Ke.disabled,pn=Ke.onChange,Vt=Ke.onInternalAutoSize,Ft=(0,Le.Z)(Ke,_e),Tt=(0,Te.Z)(fn,{value:Xt,postState:function(Ln){return Ln!=null?Ln:""}}),ge=(0,be.Z)(Tt,2),se=ge[0],oe=ge[1],de=function(Ln){oe(Ln.target.value),pn==null||pn(Ln)},pe=He.useRef();He.useImperativeHandle(jt,function(){return{textArea:pe.current}});var le=He.useMemo(function(){return qe&&(0,tt.Z)(qe)==="object"?[qe.minRows,qe.maxRows]:[]},[qe]),De=(0,be.Z)(le,2),ot=De[0],$t=De[1],It=!!qe,Ut=function(){try{if(document.activeElement===pe.current){var Ln=pe.current,Fn=Ln.selectionStart,jn=Ln.selectionEnd,Tn=Ln.scrollTop;pe.current.setSelectionRange(Fn,jn),pe.current.scrollTop=Tn}}catch(hr){}},Yt=He.useState(Mt),dn=(0,be.Z)(Yt,2),hn=dn[0],_n=dn[1],vt=He.useState(),cn=(0,be.Z)(vt,2),Sn=cn[0],Ye=cn[1],ze=function(){_n(We)};(0,Je.Z)(function(){It&&ze()},[Xt,ot,$t,It]),(0,Je.Z)(function(){if(hn===We)_n(et);else if(hn===et){var In=Ve(pe.current,!1,ot,$t);_n(Mt),Ye(In)}else Ut()},[hn]);var Ue=He.useRef(),Bt=function(){lt.Z.cancel(Ue.current)},Jt=function(Ln){hn===Mt&&(je==null||je(Ln),qe&&(Bt(),Ue.current=(0,lt.Z)(function(){ze()})))};He.useEffect(function(){return Bt},[]);var rn=It?Sn:null,An=(0,Ze.Z)((0,Ze.Z)({},en),rn);return(hn===We||hn===et)&&(An.overflowY="hidden",An.overflowX="hidden"),He.createElement(ht.Z,{onResize:Jt,disabled:!(qe||je)},He.createElement("textarea",(0,fe.Z)({},Ft,{ref:pe,style:An,className:Me()(xe,gt,(0,Fe.Z)({},"".concat(xe,"-disabled"),Zt)),disabled:Zt,value:se,onChange:de})))}),Kt=Qe,ut=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","classes","showCount","className","style","disabled","hidden","classNames","styles","onResize"];function Pt(sn,jt){return(0,Re.Z)(sn||"").slice(0,jt).join("")}function nt(sn,jt,Ke,xe){var bt=Ke;return sn?bt=Pt(Ke,xe):(0,Re.Z)(jt||"").length<Ke.length&&(0,Re.Z)(Ke||"").length>xe&&(bt=jt),bt}var Gt=He.forwardRef(function(sn,jt){var Ke,xe=sn.defaultValue,bt=sn.value,fn=sn.onFocus,Xt=sn.onBlur,qe=sn.onChange,je=sn.allowClear,gt=sn.maxLength,en=sn.onCompositionStart,Zt=sn.onCompositionEnd,pn=sn.suffix,Vt=sn.prefixCls,Ft=Vt===void 0?"rc-textarea":Vt,Tt=sn.classes,ge=sn.showCount,se=sn.className,oe=sn.style,de=sn.disabled,pe=sn.hidden,le=sn.classNames,De=sn.styles,ot=sn.onResize,$t=(0,Le.Z)(sn,ut),It=(0,Te.Z)(xe,{value:bt,defaultValue:xe}),Ut=(0,be.Z)(It,2),Yt=Ut[0],dn=Ut[1],hn=(0,He.useRef)(null),_n=He.useState(!1),vt=(0,be.Z)(_n,2),cn=vt[0],Sn=vt[1],Ye=He.useState(!1),ze=(0,be.Z)(Ye,2),Ue=ze[0],Bt=ze[1],Jt=He.useRef(),rn=He.useRef(0),An=He.useState(null),In=(0,be.Z)(An,2),Ln=In[0],Fn=In[1],jn=function(){var $n;($n=hn.current)===null||$n===void 0||$n.textArea.focus()};(0,He.useImperativeHandle)(jt,function(){return{resizableTextArea:hn.current,focus:jn,blur:function(){var $n;($n=hn.current)===null||$n===void 0||$n.textArea.blur()}}}),(0,He.useEffect)(function(){Sn(function(Rn){return!de&&Rn})},[de]);var Tn=Number(gt)>0,hr=function($n){Bt(!0),Jt.current=Yt,rn.current=$n.currentTarget.selectionStart,en==null||en($n)},kr=function($n){Bt(!1);var wr=$n.currentTarget.value;if(Tn){var ct,ke=rn.current>=gt+1||rn.current===((ct=Jt.current)===null||ct===void 0?void 0:ct.length);wr=nt(ke,Jt.current,wr,gt)}wr!==Yt&&(dn(wr),(0,rt.rJ)($n.currentTarget,$n,qe,wr)),Zt==null||Zt($n)},Tr=function($n){var wr=$n.target.value;if(!Ue&&Tn){var ct=$n.target.selectionStart>=gt+1||$n.target.selectionStart===wr.length||!$n.target.selectionStart;wr=nt(ct,Yt,wr,gt)}dn(wr),(0,rt.rJ)($n.currentTarget,$n,qe,wr)},Hr=function($n){var wr=$t.onPressEnter,ct=$t.onKeyDown;$n.key==="Enter"&&wr&&wr($n),ct==null||ct($n)},sr=function($n){Sn(!0),fn==null||fn($n)},Mr=function($n){Sn(!1),Xt==null||Xt($n)},rr=function($n){var wr;dn(""),jn(),(0,rt.rJ)((wr=hn.current)===null||wr===void 0?void 0:wr.textArea,$n,qe)},Or=(0,rt.D7)(Yt);!Ue&&Tn&&bt==null&&(Or=Pt(Or,gt));var Fr=pn,Er;if(ge){var jr=(0,Re.Z)(Or).length;(0,tt.Z)(ge)==="object"?Er=ge.formatter({value:Or,count:jr,maxLength:gt}):Er="".concat(jr).concat(Tn?" / ".concat(gt):""),Fr=He.createElement(He.Fragment,null,Fr,He.createElement("span",{className:Me()("".concat(Ft,"-data-count"),le==null?void 0:le.count),style:De==null?void 0:De.count},Er))}var Nr=function($n){var wr;ot==null||ot($n),(wr=hn.current)!==null&&wr!==void 0&&wr.textArea.style.height&&Fn(!0)},Jn=!$t.autoSize&&!ge&&!je,lr=He.createElement(Pe.BaseInput,{value:Or,allowClear:je,handleReset:rr,suffix:Fr,prefixCls:Ft,classes:{affixWrapper:Me()(Tt==null?void 0:Tt.affixWrapper,(Ke={},(0,Fe.Z)(Ke,"".concat(Ft,"-show-count"),ge),(0,Fe.Z)(Ke,"".concat(Ft,"-textarea-allow-clear"),je),Ke))},disabled:de,focused:cn,className:se,style:(0,Ze.Z)((0,Ze.Z)({},oe),Ln&&!Jn?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof Er=="string"?Er:void 0}},hidden:pe,inputElement:He.createElement(Kt,(0,fe.Z)({},$t,{onKeyDown:Hr,onChange:Tr,onFocus:sr,onBlur:Mr,onCompositionStart:hr,onCompositionEnd:kr,className:le==null?void 0:le.textarea,style:(0,Ze.Z)((0,Ze.Z)({},De==null?void 0:De.textarea),{},{resize:oe==null?void 0:oe.resize}),disabled:de,prefixCls:Ft,onResize:Nr,ref:hn}))});return lr}),mn=Gt,on=mn},48911:function(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Tt}});var fe=ue(54476),Ze=ue(76190),Fe=ue(33885),tt=ue(20068),be=ue(42978),Le=ue(75931),Re=ue(92310),Se=ue.n(Re),Me=ue(29301),Pe=ue(70425),rt=ue(34280),Te=ue(59301),He=ue(4676),ht=Te.forwardRef(function(ge,se){var oe=ge.height,de=ge.offsetY,pe=ge.offsetX,le=ge.children,De=ge.prefixCls,ot=ge.onInnerResize,$t=ge.innerProps,It=ge.rtl,Ut=ge.extra,Yt={},dn={display:"flex",flexDirection:"column"};return de!==void 0&&(Yt={height:oe,position:"relative",overflow:"hidden"},dn=(0,Fe.Z)((0,Fe.Z)({},dn),{},(0,tt.Z)((0,tt.Z)((0,tt.Z)((0,tt.Z)((0,tt.Z)({transform:"translateY(".concat(de,"px)")},It?"marginRight":"marginLeft",-pe),"position","absolute"),"left",0),"right",0),"top",0))),Te.createElement("div",{style:Yt},Te.createElement(Me.Z,{onResize:function(_n){var vt=_n.offsetHeight;vt&&ot&&ot()}},Te.createElement("div",(0,fe.Z)({style:dn,className:Se()((0,tt.Z)({},"".concat(De,"-holder-inner"),De)),ref:se},$t),le,Ut)))});ht.displayName="Filler";var Je=ht;function lt(ge){var se=ge.children,oe=ge.setRef,de=Te.useCallback(function(pe){oe(pe)},[]);return Te.cloneElement(se,{ref:de})}function st(ge,se,oe,de,pe,le,De,ot){var $t=ot.getKey;return ge.slice(se,oe+1).map(function(It,Ut){var Yt=se+Ut,dn=De(It,Yt,{style:{width:de},offsetX:pe}),hn=$t(It);return Te.createElement(lt,{key:hn,setRef:function(vt){return le(It,vt)}},dn)})}function Rt(ge,se,oe,de){var pe=oe-ge,le=se-oe,De=Math.min(pe,le)*2;if(de<=De){var ot=Math.floor(de/2);return de%2?oe+ot+1:oe-ot}return pe>le?oe-(de-le):oe+(de-pe)}function qt(ge,se,oe){var de=ge.length,pe=se.length,le,De;if(de===0&&pe===0)return null;de<pe?(le=ge,De=se):(le=se,De=ge);var ot={__EMPTY_ITEM__:!0};function $t(_n){return _n!==void 0?oe(_n):ot}for(var It=null,Ut=Math.abs(de-pe)!==1,Yt=0;Yt<De.length;Yt+=1){var dn=$t(le[Yt]),hn=$t(De[Yt]);if(dn!==hn){It=Yt,Ut=Ut||dn!==$t(De[Yt+1]);break}}return It===null?null:{index:It,multiple:Ut}}function at(ge,se,oe){var de=Te.useState(ge),pe=(0,be.Z)(de,2),le=pe[0],De=pe[1],ot=Te.useState(null),$t=(0,be.Z)(ot,2),It=$t[0],Ut=$t[1];return Te.useEffect(function(){var Yt=qt(le||[],ge||[],se);(Yt==null?void 0:Yt.index)!==void 0&&(oe==null||oe(Yt.index),Ut(ge[Yt.index])),De(ge)},[ge]),[It]}var ft=ue(16089),Ve=(typeof navigator=="undefined"?"undefined":(0,Ze.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),_e=Ve,We=function(ge,se,oe,de){var pe=(0,Te.useRef)(!1),le=(0,Te.useRef)(null);function De(){clearTimeout(le.current),pe.current=!0,le.current=setTimeout(function(){pe.current=!1},50)}var ot=(0,Te.useRef)({top:ge,bottom:se,left:oe,right:de});return ot.current.top=ge,ot.current.bottom=se,ot.current.left=oe,ot.current.right=de,function($t,It){var Ut=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Yt=$t?It<0&&ot.current.left||It>0&&ot.current.right:It<0&&ot.current.top||It>0&&ot.current.bottom;return Ut&&Yt?(clearTimeout(le.current),pe.current=!1):(!Yt||pe.current)&&De(),!pe.current&&Yt}};function et(ge,se,oe,de,pe,le,De){var ot=(0,Te.useRef)(0),$t=(0,Te.useRef)(null),It=(0,Te.useRef)(null),Ut=(0,Te.useRef)(!1),Yt=We(se,oe,de,pe);function dn(Ye,ze){if(ft.Z.cancel($t.current),!Yt(!1,ze)){var Ue=Ye;if(!Ue._virtualHandled)Ue._virtualHandled=!0;else return;ot.current+=ze,It.current=ze,_e||Ue.preventDefault(),$t.current=(0,ft.Z)(function(){var Bt=Ut.current?10:1;De(ot.current*Bt,!1),ot.current=0})}}function hn(Ye,ze){De(ze,!0),_e||Ye.preventDefault()}var _n=(0,Te.useRef)(null),vt=(0,Te.useRef)(null);function cn(Ye){if(ge){ft.Z.cancel(vt.current),vt.current=(0,ft.Z)(function(){_n.current=null},2);var ze=Ye.deltaX,Ue=Ye.deltaY,Bt=Ye.shiftKey,Jt=ze,rn=Ue;(_n.current==="sx"||!_n.current&&Bt&&Ue&&!ze)&&(Jt=Ue,rn=0,_n.current="sx");var An=Math.abs(Jt),In=Math.abs(rn);_n.current===null&&(_n.current=le&&An>In?"x":"y"),_n.current==="y"?dn(Ye,rn):hn(Ye,Jt)}}function Sn(Ye){ge&&(Ut.current=Ye.detail===It.current)}return[cn,Sn]}function Mt(ge,se,oe,de){var pe=Te.useMemo(function(){return[new Map,[]]},[ge,oe.id,de]),le=(0,be.Z)(pe,2),De=le[0],ot=le[1],$t=function(Ut){var Yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ut,dn=De.get(Ut),hn=De.get(Yt);if(dn===void 0||hn===void 0)for(var _n=ge.length,vt=ot.length;vt<_n;vt+=1){var cn,Sn=ge[vt],Ye=se(Sn);De.set(Ye,vt);var ze=(cn=oe.get(Ye))!==null&&cn!==void 0?cn:de;if(ot[vt]=(ot[vt-1]||0)+ze,Ye===Ut&&(dn=vt),Ye===Yt&&(hn=vt),dn!==void 0&&hn!==void 0)break}return{top:ot[dn-1]||0,bottom:ot[hn]}};return $t}var Qe=ue(67732),Kt=ue(83652),ut=function(){function ge(){(0,Qe.Z)(this,ge),(0,tt.Z)(this,"maps",void 0),(0,tt.Z)(this,"id",0),(0,tt.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,Kt.Z)(ge,[{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}}]),ge}(),Pt=ut;function nt(ge){var se=parseFloat(ge);return isNaN(se)?0:se}function Gt(ge,se,oe){var de=Te.useState(0),pe=(0,be.Z)(de,2),le=pe[0],De=pe[1],ot=(0,Te.useRef)(new Map),$t=(0,Te.useRef)(new Pt),It=(0,Te.useRef)(0);function Ut(){It.current+=1}function Yt(){var hn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Ut();var _n=function(){var Sn=!1;ot.current.forEach(function(Ye,ze){if(Ye&&Ye.offsetParent){var Ue=Ye.offsetHeight,Bt=getComputedStyle(Ye),Jt=Bt.marginTop,rn=Bt.marginBottom,An=nt(Jt),In=nt(rn),Ln=Ue+An+In;$t.current.get(ze)!==Ln&&($t.current.set(ze,Ln),Sn=!0)}}),Sn&&De(function(Ye){return Ye+1})};if(hn)_n();else{It.current+=1;var vt=It.current;Promise.resolve().then(function(){vt===It.current&&_n()})}}function dn(hn,_n){var vt=ge(hn),cn=ot.current.get(vt);_n?(ot.current.set(vt,_n),Yt()):ot.current.delete(vt),!cn!=!_n&&(_n?se==null||se(hn):oe==null||oe(hn))}return(0,Te.useEffect)(function(){return Ut},[]),[dn,Yt,$t.current,le]}var mn=14/15;function on(ge,se,oe){var de=(0,Te.useRef)(!1),pe=(0,Te.useRef)(0),le=(0,Te.useRef)(0),De=(0,Te.useRef)(null),ot=(0,Te.useRef)(null),$t,It=function(hn){if(de.current){var _n=Math.ceil(hn.touches[0].pageX),vt=Math.ceil(hn.touches[0].pageY),cn=pe.current-_n,Sn=le.current-vt,Ye=Math.abs(cn)>Math.abs(Sn);Ye?pe.current=_n:le.current=vt;var ze=oe(Ye,Ye?cn:Sn,!1,hn);ze&&hn.preventDefault(),clearInterval(ot.current),ze&&(ot.current=setInterval(function(){Ye?cn*=mn:Sn*=mn;var Ue=Math.floor(Ye?cn:Sn);(!oe(Ye,Ue,!0)||Math.abs(Ue)<=.1)&&clearInterval(ot.current)},16))}},Ut=function(){de.current=!1,$t()},Yt=function(hn){$t(),hn.touches.length===1&&!de.current&&(de.current=!0,pe.current=Math.ceil(hn.touches[0].pageX),le.current=Math.ceil(hn.touches[0].pageY),De.current=hn.target,De.current.addEventListener("touchmove",It,{passive:!1}),De.current.addEventListener("touchend",Ut,{passive:!0}))};$t=function(){De.current&&(De.current.removeEventListener("touchmove",It),De.current.removeEventListener("touchend",Ut))},(0,rt.Z)(function(){return ge&&se.current.addEventListener("touchstart",Yt,{passive:!0}),function(){var dn;(dn=se.current)===null||dn===void 0||dn.removeEventListener("touchstart",Yt),$t(),clearInterval(ot.current)}},[ge])}function sn(ge){return Math.floor(Math.pow(ge,.5))}function jt(ge,se){var oe="touches"in ge?ge.touches[0]:ge;return oe[se?"pageX":"pageY"]-window[se?"scrollX":"scrollY"]}function Ke(ge,se,oe){Te.useEffect(function(){var de=se.current;if(ge&&de){var pe=!1,le,De,ot=function(){ft.Z.cancel(le)},$t=function dn(){ot(),le=(0,ft.Z)(function(){oe(De),dn()})},It=function(){pe=!1,ot()},Ut=function(hn){if(!(hn.target.draggable||hn.button!==0)){var _n=hn;_n._virtualHandled||(_n._virtualHandled=!0,pe=!0)}},Yt=function(hn){if(pe){var _n=jt(hn,!1),vt=de.getBoundingClientRect(),cn=vt.top,Sn=vt.bottom;if(_n<=cn){var Ye=cn-_n;De=-sn(Ye),$t()}else if(_n>=Sn){var ze=_n-Sn;De=sn(ze),$t()}else ot()}};return de.addEventListener("mousedown",Ut),de.ownerDocument.addEventListener("mouseup",It),de.ownerDocument.addEventListener("mousemove",Yt),de.ownerDocument.addEventListener("dragend",It),function(){de.removeEventListener("mousedown",Ut),de.ownerDocument.removeEventListener("mouseup",It),de.ownerDocument.removeEventListener("mousemove",Yt),de.ownerDocument.removeEventListener("dragend",It),ot()}}},[ge])}var xe=10;function bt(ge,se,oe,de,pe,le,De,ot){var $t=Te.useRef(),It=Te.useState(null),Ut=(0,be.Z)(It,2),Yt=Ut[0],dn=Ut[1];return(0,rt.Z)(function(){if(Yt&&Yt.times<xe){if(!ge.current){dn(function(Mr){return(0,Fe.Z)({},Mr)});return}le();var hn=Yt.targetAlign,_n=Yt.originAlign,vt=Yt.index,cn=Yt.offset,Sn=ge.current.clientHeight,Ye=!1,ze=hn,Ue=null;if(Sn){for(var Bt=hn||_n,Jt=0,rn=0,An=0,In=Math.min(se.length-1,vt),Ln=0;Ln<=In;Ln+=1){var Fn=pe(se[Ln]);rn=Jt;var jn=oe.get(Fn);An=rn+(jn===void 0?de:jn),Jt=An}for(var Tn=Bt==="top"?cn:Sn-cn,hr=In;hr>=0;hr-=1){var kr=pe(se[hr]),Tr=oe.get(kr);if(Tr===void 0){Ye=!0;break}if(Tn-=Tr,Tn<=0)break}switch(Bt){case"top":Ue=rn-cn;break;case"bottom":Ue=An-Sn+cn;break;default:{var Hr=ge.current.scrollTop,sr=Hr+Sn;rn<Hr?ze="top":An>sr&&(ze="bottom")}}Ue!==null&&De(Ue),Ue!==Yt.lastTop&&(Ye=!0)}Ye&&dn((0,Fe.Z)((0,Fe.Z)({},Yt),{},{times:Yt.times+1,targetAlign:ze,lastTop:Ue}))}},[Yt,ge.current]),function(hn){if(hn==null){ot();return}if(ft.Z.cancel($t.current),typeof hn=="number")De(hn);else if(hn&&(0,Ze.Z)(hn)==="object"){var _n,vt=hn.align;"index"in hn?_n=hn.index:_n=se.findIndex(function(Ye){return pe(Ye)===hn.key});var cn=hn.offset,Sn=cn===void 0?0:cn;dn({times:0,index:_n,offset:Sn,originAlign:vt})}}}var fn=Te.forwardRef(function(ge,se){var oe=ge.prefixCls,de=ge.rtl,pe=ge.scrollOffset,le=ge.scrollRange,De=ge.onStartMove,ot=ge.onStopMove,$t=ge.onScroll,It=ge.horizontal,Ut=ge.spinSize,Yt=ge.containerSize,dn=ge.style,hn=ge.thumbStyle,_n=ge.showScrollBar,vt=Te.useState(!1),cn=(0,be.Z)(vt,2),Sn=cn[0],Ye=cn[1],ze=Te.useState(null),Ue=(0,be.Z)(ze,2),Bt=Ue[0],Jt=Ue[1],rn=Te.useState(null),An=(0,be.Z)(rn,2),In=An[0],Ln=An[1],Fn=!de,jn=Te.useRef(),Tn=Te.useRef(),hr=Te.useState(_n),kr=(0,be.Z)(hr,2),Tr=kr[0],Hr=kr[1],sr=Te.useRef(),Mr=function(){_n===!0||_n===!1||(clearTimeout(sr.current),Hr(!0),sr.current=setTimeout(function(){Hr(!1)},3e3))},rr=le-Yt||0,Or=Yt-Ut||0,Fr=Te.useMemo(function(){if(pe===0||rr===0)return 0;var ct=pe/rr;return ct*Or},[pe,rr,Or]),Er=function(ke){ke.stopPropagation(),ke.preventDefault()},jr=Te.useRef({top:Fr,dragging:Sn,pageY:Bt,startTop:In});jr.current={top:Fr,dragging:Sn,pageY:Bt,startTop:In};var Nr=function(ke){Ye(!0),Jt(jt(ke,It)),Ln(jr.current.top),De(),ke.stopPropagation(),ke.preventDefault()};Te.useEffect(function(){var ct=function(Ie){Ie.preventDefault()},ke=jn.current,Be=Tn.current;return ke.addEventListener("touchstart",ct,{passive:!1}),Be.addEventListener("touchstart",Nr,{passive:!1}),function(){ke.removeEventListener("touchstart",ct),Be.removeEventListener("touchstart",Nr)}},[]);var Jn=Te.useRef();Jn.current=rr;var lr=Te.useRef();lr.current=Or,Te.useEffect(function(){if(Sn){var ct,ke=function(Ie){var Xe=jr.current,dt=Xe.dragging,Ht=Xe.pageY,kt=Xe.startTop;ft.Z.cancel(ct);var Wt=jn.current.getBoundingClientRect(),vn=Yt/(It?Wt.width:Wt.height);if(dt){var xn=(jt(Ie,It)-Ht)*vn,Cn=kt;!Fn&&It?Cn-=xn:Cn+=xn;var Lt=Jn.current,ln=lr.current,it=ln?Cn/ln:0,wt=Math.ceil(it*Lt);wt=Math.max(wt,0),wt=Math.min(wt,Lt),ct=(0,ft.Z)(function(){$t(wt,It)})}},Be=function(){Ye(!1),ot()};return window.addEventListener("mousemove",ke,{passive:!0}),window.addEventListener("touchmove",ke,{passive:!0}),window.addEventListener("mouseup",Be,{passive:!0}),window.addEventListener("touchend",Be,{passive:!0}),function(){window.removeEventListener("mousemove",ke),window.removeEventListener("touchmove",ke),window.removeEventListener("mouseup",Be),window.removeEventListener("touchend",Be),ft.Z.cancel(ct)}}},[Sn]),Te.useEffect(function(){return Mr(),function(){clearTimeout(sr.current)}},[pe]),Te.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 It?(Object.assign($n,{height:8,left:0,right:0,bottom:0}),Object.assign(wr,(0,tt.Z)({height:"100%",width:Ut},Fn?"left":"right",Fr))):(Object.assign($n,(0,tt.Z)({width:8,top:0,bottom:0},Fn?"right":"left",0)),Object.assign(wr,{width:"100%",height:Ut,top:Fr})),Te.createElement("div",{ref:jn,className:Se()(Rn,(0,tt.Z)((0,tt.Z)((0,tt.Z)({},"".concat(Rn,"-horizontal"),It),"".concat(Rn,"-vertical"),!It),"".concat(Rn,"-visible"),Tr)),style:(0,Fe.Z)((0,Fe.Z)({},$n),dn),onMouseDown:Er,onMouseMove:Mr},Te.createElement("div",{ref:Tn,className:Se()("".concat(Rn,"-thumb"),(0,tt.Z)({},"".concat(Rn,"-thumb-moving"),Sn)),style:(0,Fe.Z)((0,Fe.Z)({},wr),hn),onMouseDown:Nr}))}),Xt=fn,qe=20;function je(){var ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,oe=ge/se*ge;return isNaN(oe)&&(oe=0),oe=Math.max(oe,qe),Math.floor(oe)}var gt=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],en=[],Zt={overflowY:"auto",overflowAnchor:"none"};function pn(ge,se){var oe=ge.prefixCls,de=oe===void 0?"rc-virtual-list":oe,pe=ge.className,le=ge.height,De=ge.itemHeight,ot=ge.fullHeight,$t=ot===void 0?!0:ot,It=ge.style,Ut=ge.data,Yt=ge.children,dn=ge.itemKey,hn=ge.virtual,_n=ge.direction,vt=ge.scrollWidth,cn=ge.component,Sn=cn===void 0?"div":cn,Ye=ge.onScroll,ze=ge.onVirtualScroll,Ue=ge.onVisibleChange,Bt=ge.innerProps,Jt=ge.extraRender,rn=ge.styles,An=ge.showScrollBar,In=An===void 0?"optional":An,Ln=(0,Le.Z)(ge,gt),Fn=Te.useCallback(function(Hn){return typeof dn=="function"?dn(Hn):Hn==null?void 0:Hn[dn]},[dn]),jn=Gt(Fn,null,null),Tn=(0,be.Z)(jn,4),hr=Tn[0],kr=Tn[1],Tr=Tn[2],Hr=Tn[3],sr=!!(hn!==!1&&le&&De),Mr=Te.useMemo(function(){return Object.values(Tr.maps).reduce(function(Hn,qn){return Hn+qn},0)},[Tr.id,Tr.maps]),rr=sr&&Ut&&(Math.max(De*Ut.length,Mr)>le||!!vt),Or=_n==="rtl",Fr=Se()(de,(0,tt.Z)({},"".concat(de,"-rtl"),Or),pe),Er=Ut||en,jr=(0,Te.useRef)(),Nr=(0,Te.useRef)(),Jn=(0,Te.useRef)(),lr=(0,Te.useState)(0),Rn=(0,be.Z)(lr,2),$n=Rn[0],wr=Rn[1],ct=(0,Te.useState)(0),ke=(0,be.Z)(ct,2),Be=ke[0],Ae=ke[1],Ie=(0,Te.useState)(!1),Xe=(0,be.Z)(Ie,2),dt=Xe[0],Ht=Xe[1],kt=function(){Ht(!0)},Wt=function(){Ht(!1)},vn={getKey:Fn};function xn(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 Cn=(0,Te.useRef)({start:0,end:Er.length}),Lt=(0,Te.useRef)(),ln=at(Er,Fn),it=(0,be.Z)(ln,1),wt=it[0];Lt.current=wt;var Et=Te.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?De: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/De)),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]),At=Et.scrollHeight,nn=Et.start,_t=Et.end,tn=Et.offset;Cn.current.start=nn,Cn.current.end=_t,Te.useLayoutEffect(function(){var Hn=Tr.getRecord();if(Hn.size===1){var qn=Array.from(Hn.keys())[0],Dr=Hn.get(qn),$r=Er[nn];if($r&&Dr===void 0){var li=Fn($r);if(li===qn){var di=Tr.get(qn),ri=di-De;xn(function(Jr){return Jr+ri})}}}Tr.resetRecord()},[At]);var Oe=Te.useState({width:0,height:le}),yt=(0,be.Z)(Oe,2),xt=yt[0],Ot=yt[1],Dt=function(qn){Ot({width:qn.offsetWidth,height:qn.offsetHeight})},Nt=(0,Te.useRef)(),zt=(0,Te.useRef)(),gn=Te.useMemo(function(){return je(xt.width,vt)},[xt.width,vt]),wn=Te.useMemo(function(){return je(xt.height,At)},[xt.height,At]),Dn=At-le,zn=(0,Te.useRef)(Dn);zn.current=Dn;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>=Dn,Pn=Be<=0,fr=Be>=vt,tr=We(cr,Un,Pn,fr),yr=function(){return{x:Or?-Be:Be,y:$n}},Gn=(0,Te.useRef)(yr()),Xn=(0,Pe.useEvent)(function(Hn){if(ze){var qn=(0,Fe.Z)((0,Fe.Z)({},yr()),Hn);(Gn.current.x!==qn.x||Gn.current.y!==qn.y)&&(ze(qn),Gn.current=qn)}});function br(Hn,qn){var Dr=Hn;qn?((0,He.flushSync)(function(){Ae(Dr)}),Xn()):xn(Dr)}function ur(Hn){var qn=Hn.currentTarget.scrollTop;qn!==$n&&xn(qn),Ye==null||Ye(Hn),Xn()}var Br=function(qn){var Dr=qn,$r=vt?vt-xt.width:0;return Dr=Math.max(Dr,0),Dr=Math.min(Dr,$r),Dr},Gr=(0,Pe.useEvent)(function(Hn,qn){qn?((0,He.flushSync)(function(){Ae(function(Dr){var $r=Dr+(Or?-Hn:Hn);return Br($r)})}),Xn()):xn(function(Dr){var $r=Dr+Hn;return $r})}),ar=et(sr,cr,Un,Pn,fr,!!vt,Gr),En=(0,be.Z)(ar,2),kn=En[0],gr=En[1];on(sr,jr,function(Hn,qn,Dr,$r){var li=$r;return tr(Hn,qn,Dr)?!1:!li||!li._virtualHandled?(li&&(li._virtualHandled=!0),kn({preventDefault:function(){},deltaX:Hn?qn:0,deltaY:Hn?0:qn}),!0):!1}),Ke(rr,jr,function(Hn){xn(function(qn){return qn+Hn})}),(0,rt.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",kn,{passive:!1}),qn.addEventListener("DOMMouseScroll",gr,{passive:!0}),qn.addEventListener("MozMousePixelScroll",Hn,{passive:!1}),function(){qn.removeEventListener("wheel",kn),qn.removeEventListener("DOMMouseScroll",gr),qn.removeEventListener("MozMousePixelScroll",Hn)}},[sr,cr,Un]),(0,rt.Z)(function(){if(vt){var Hn=Br(Be);Ae(Hn),Xn({x:Hn})}},[xt.width,vt]);var nr=function(){var qn,Dr;(qn=Nt.current)===null||qn===void 0||qn.delayHidden(),(Dr=zt.current)===null||Dr===void 0||Dr.delayHidden()},_r=bt(jr,Er,Tr,De,Fn,function(){return kr(!0)},xn,nr);Te.useImperativeHandle(se,function(){return{nativeElement:Jn.current,getScrollInfo:yr,scrollTo:function(qn){function Dr($r){return $r&&(0,Ze.Z)($r)==="object"&&("left"in $r||"top"in $r)}Dr(qn)?(qn.left!==void 0&&Ae(Br(qn.left)),_r(qn.top)):_r(qn)}}}),(0,rt.Z)(function(){if(Ue){var Hn=Er.slice(nn,_t+1);Ue(Hn,Er)}},[nn,_t,Er]);var Lr=Mt(Er,Fn,Tr,De),Ir=Jt==null?void 0:Jt({start:nn,end:_t,virtual:rr,offsetX:Be,offsetY:tn,rtl:Or,getSize:Lr}),pr=st(Er,nn,_t,vt,Be,hr,Yt,vn),Sr=null;le&&(Sr=(0,Fe.Z)((0,tt.Z)({},$t?"height":"maxHeight",le),Zt),sr&&(Sr.overflowY="hidden",vt&&(Sr.overflowX="hidden"),dt&&(Sr.pointerEvents="none")));var ii={};return Or&&(ii.dir="rtl"),Te.createElement("div",(0,fe.Z)({ref:Jn,style:(0,Fe.Z)((0,Fe.Z)({},It),{},{position:"relative"}),className:Fr},ii,Ln),Te.createElement(Me.Z,{onResize:Dt},Te.createElement(Sn,{className:"".concat(de,"-holder"),style:Sr,ref:jr,onScroll:ur,onMouseEnter:nr},Te.createElement(Je,{prefixCls:de,height:At,offsetX:Be,offsetY:tn,scrollWidth:vt,onInnerResize:kr,ref:Nr,innerProps:Bt,rtl:Or,extra:Ir},pr))),rr&&At>le&&Te.createElement(Xt,{ref:Nt,prefixCls:de,scrollOffset:$n,scrollRange:At,rtl:Or,onScroll:br,onStartMove:kt,onStopMove:Wt,spinSize:wn,containerSize:xt.height,style:rn==null?void 0:rn.verticalScrollBar,thumbStyle:rn==null?void 0:rn.verticalScrollBarThumb,showScrollBar:In}),rr&&vt>xt.width&&Te.createElement(Xt,{ref:zt,prefixCls:de,scrollOffset:Be,scrollRange:vt,rtl:Or,onScroll:br,onStartMove:kt,onStopMove:Wt,spinSize:gn,containerSize:xt.width,horizontal:!0,style:rn==null?void 0:rn.horizontalScrollBar,thumbStyle:rn==null?void 0:rn.horizontalScrollBarThumb,showScrollBar:In}))}var Vt=Te.forwardRef(pn);Vt.displayName="List";var Ft=Vt,Tt=Ft},48136:function(Mn,Qt,ue){"use strict";var fe=Object.defineProperty,Ze=Object.defineProperties,Fe=Object.getOwnPropertyDescriptors,tt=Object.getOwnPropertySymbols,be=Object.prototype.hasOwnProperty,Le=Object.prototype.propertyIsEnumerable,Re=(a,y,b)=>y in a?fe(a,y,{enumerable:!0,configurable:!0,writable:!0,value:b}):a[y]=b,Se=(a,y)=>{for(var b in y||(y={}))be.call(y,b)&&Re(a,b,y[b]);if(tt)for(var b of tt(y))Le.call(y,b)&&Re(a,b,y[b]);return a},Me=(a,y)=>Ze(a,Fe(y)),Pe=a=>typeof a=="symbol"?a:a+"",rt=(a,y)=>{var b={};for(var E in a)be.call(a,E)&&y.indexOf(E)<0&&(b[E]=a[E]);if(a!=null&&tt)for(var E of tt(a))y.indexOf(E)<0&&Le.call(a,E)&&(b[E]=a[E]);return b};function Te(a){return Array.isArray(a)}var He={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 ht(){return"window"in globalThis&&"document"in globalThis}function Je(){return"matchMedia"in window?window.matchMedia("(pointer: coarse)").matches:"ontouchstart"in window||navigator.maxTouchPoints>0}function lt(){return typeof navigator.vibrate=="function"}function st(){var a,y;if(!ht())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 Rt(){if(!ht())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 at={strings:He,_locale:"",_dirty:!1,_subscribers:[],_numberFormatter:void 0,get locale(){return at._locale||(at._locale=ht()?navigator.language.slice(0,5):"en-US"),at._locale},set locale(a){at._locale=a,at._numberFormatter=void 0,at.dirty=!0},get numberFormatter(){return at._numberFormatter||(at._numberFormatter=new Intl.NumberFormat(at.locale)),at._numberFormatter},merge(a,y){if(typeof a=="string"&&y)at.strings[a]=Se(Se({},at.strings[a]),y),at.dirty=!0;else for(const b of Object.keys(a))at.merge(b,a[b])},get dirty(){return at._dirty},set dirty(a){at._dirty||at._dirty===a||(at._dirty=!0,setTimeout(()=>{at._dirty=!1,this._subscribers.forEach(y=>y==null?void 0:y())},0))},subscribe(a){return at._subscribers.push(a),at._subscribers.length-1},unsubscribe(a){a<0||a>=at._subscribers.length||(at._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=at.locale;at.strings[E]&&(b=at.strings[E][a]);const ee=E.slice(0,2);if(!b&&at.strings[ee]&&(b=at.strings[ee][a]),b||(b=at.strings.en[a]),!b)return;const re=/(%@|%([0-9]+)\$@)/g;let ae=re.exec(b),he=0;for(;ae;){if(y[he++]){const ye=ae[2]?parseInt(ae[2],10)-1:he-1;let we=y[ye];typeof we=="number"&&(we=at.numberFormatter.format(we)),b=b.replace(ae[1],we)}ae=re.exec(b)}return b=b.replace(/%%/g,"%"),b}var Ve={m0:"#3F3D99",m1:"#993D71",m2:"#998B3D",m3:"#3D9956",m4:"#3D5A99",m5:"#993D90",m6:"#996D3D",m7:"#43993D",m8:"#3D7999",m9:"#843D99"},_e={blue:"#0072BD",orange:"#D95319",yellow:"#EDB120",purple:"#7E2F8E",green:"#77AC30",cyan:"#4DBEEE",red:"#A2142F"},We={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"},et={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"},Mt={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"},Qe={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 Kt(a){var y,b,E,ee,re,ae;const he=a.split("!");let me,ye,we,Ne=255,Ge=255,mt=255,St=-1;const bn=he.length>0&&he[0].startsWith("-");bn&&(he[0]=he[0].slice(1));for(let ir=0;ir<he.length;ir++){me=Ne,ye=Ge,we=mt;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=et[Nn])!=null?b:et[Mt[yn]])!=null?E:_e[yn])!=null?ee:Qe[yn])!=null?re:Ve[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])Ne=Math.max(0,Math.min(255,Number.parseInt(Kn[1],16))),Ge=Math.max(0,Math.min(255,Number.parseInt(Kn[2],16))),mt=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);Ne=Math.max(0,Math.min(255,Zr*16+Zr)),Ge=Math.max(0,Math.min(255,qr*16+qr)),mt=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])Ne=Math.max(0,Math.min(255,Number.parseInt(Kn[1]))),Ge=Math.max(0,Math.min(255,Number.parseInt(Kn[2]))),mt=Math.max(0,Math.min(255,Number.parseInt(Kn[3])));else return;St>=0&&(Ne=(1-St)*Ne+St*me,Ge=(1-St)*Ge+St*ye,mt=(1-St)*mt+St*we,St=-1),ir+1<he.length&&(St=Math.max(0,Math.min(100,Number.parseInt(he[++ir])))/100)}return St>=0&&(Ne=St*Ne+(1-St)*me,Ge=St*Ge+(1-St)*ye,mt=St*mt+(1-St)*we),bn&&(Ne=255-Ne,Ge=255-Ge,mt=255-mt),"#"+("00"+Math.round(Ne).toString(16)).slice(-2)+("00"+Math.round(Ge).toString(16)).slice(-2)+("00"+Math.round(mt).toString(16)).slice(-2)}function ut(a){var y,b;return a=a.trim(),(b=(y=We[a.toLowerCase()])!=null?y:We[Mt[a]])!=null?b:Kt(a)}function Pt(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 nt(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 Gt(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*nt(re,ee,y+2)),g:Math.round(255*nt(re,ee,y)),b:Math.round(255*nt(re,ee,y-2))}}function mn(a){return a<0?0:a>255?255:Math.round(a)}function on(a){const{r:y,g:b,b:E}=a;let ee=((1<<24)+(mn(y)<<16)+(mn(b)<<8)+mn(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 sn(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,me;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 ye=(ee+re)/2;return re===ee?me=0:ye<=.5?me=ae/(re+ee):me=ae/(2-re-ee),{h:he,s:me,l:ye}}function jt(a){let y=Pt(a);if(!y)return a;let{h:b,s:E,l:ee}=sn(y);return E+=.1,ee-=.1,on(Gt({h:b,s:E,l:ee}))}var Ke={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},bt=[{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 fn(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 bt)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 Xt(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 bt)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 qe(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=Ke[ee];if(re)re.startsWith("\\")?b+=re+" ":b+=re;else{const{char:ae,variant:he,style:me}=Xt(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(me){case"bold":re=`\\mathbf{${re}}`;break;case"italic":re=`\\mathit{${re}}`;break;case"bolditalic":re=`\\mathbfit{${re}}`;break}b+=re}}return b}function je(a){return a?Array.isArray(a)?a:typeof a=="object"&&"group"in a?a.group:[]:[]}var gt={},en=Se({},Ke),Zt={},pn={},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}"},Ft={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}},Tt={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}},ge={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:Tt},"amsmath.sty":{package:Ft,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,pe;Rt()?(de=new RegExp("\\p{Letter}","u"),pe=new RegExp("[0-9\\p{Letter}]","u")):(de=/[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/,pe=/[\da-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒößÖẞìíòúÌÍÒÚáñÁÑ]/);function le(a,y,b="mord",E){y!==void 0&&(gt[a]={definitionType:"symbol",type:b,variant:E,codepoint:y},en[y]||(en[y]=a))}function De(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 ot(a,y){for(let b=a;b<=y;b++)le(String.fromCodePoint(b),b)}function $t(a){var y;return(y=pn[a])!=null?y:null}function It(a,y){var b,E;if(y.length===0||y==="\\"||!y.startsWith("\\"))return[];const ee=[];for(const ae in Zt)ae.startsWith(y)&&!Zt[ae].infix&&ee.push({match:ae,frequency:(b=Zt[ae].frequency)!=null?b:0});for(const ae in gt)ae.startsWith(y)&&ee.push({match:ae,frequency:(E=gt[ae].frequency)!=null?E:0});const re=y.substring(1);for(const ae of Object.keys(a.options.macros))ae.startsWith(re)&&ee.push({match:"\\"+ae,frequency:0});return ee.sort((ae,he)=>{var me,ye;return ae.frequency===he.frequency?ae.match.length===he.match.length?ae.match<he.match?-1:1:ae.match.length-he.match.length:((me=he.frequency)!=null?me:0)-((ye=ae.frequency)!=null?ye:0)}),ee.map(ae=>ae.match)}function Ut(a){let y="auto";const b=a.match(/:([^=]+)/);return b&&(y=b[1].trim()),y}function Yt(a){if(!a)return[];const y=[];let b=a.split("]");if(b[0].startsWith("[")){y.push({isOptional:!0,type:Ut(b[0].slice(1))});for(let E=1;E<=b.length;E++)y.push(...Yt(b[E]))}else if(b=a.split("}"),b[0].startsWith("{")){y.push({isOptional:!1,type:Ut(b[0].slice(1))});for(let E=1;E<=b.length;E++)y.push(...Yt(b[E]))}return y}function dn(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 hn(a,y){typeof a=="string"&&(a=[a]);const b={tabular:!1,params:[],createAtom:y};for(const E of a)pn[E]=b}function _n(a,y,b){typeof a=="string"&&(a=[a]);const ee={tabular:!0,params:Yt(y),createAtom:b};for(const re of a)pn[re]=ee}function vt(a,y,b){var E,ee;b||(b={});const re={definitionType:"function",params:Yt(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")Zt["\\"+a]=re;else for(const ae of a)Zt["\\"+ae]=re}var cn;function Sn(a){return cn||(cn=ze(ge)),a?ze(Se(Se({},cn),a)):cn}function Ye(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 Se({expand:(ee=y==null?void 0:y.expand)!=null?ee:!0,captureSelection:(re=y==null?void 0:y.captureSelection)!=null?re:!0,args:0},a)}function ze(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]=Ye(E.package[ee],{expand:!E.primitive,captureSelection:E.captureSelection});else y[b]=Ye(E)}return y}function Ue(a,y="math"){if(!a||a.length===0)return null;let b=null;if(a.startsWith("\\")){if(b=Zt[a],b)return!b.ifMode||b.ifMode===y?b:null;y==="math"?b=gt[a]:se[a]&&(b={definitionType:"symbol",type:"mord",codepoint:se[a]})}else if(y==="math"){if(b=gt[a],!b&&a.length===1){const E=Jt("math",a.codePointAt(0));return E.startsWith("\\")?Me(Se({},Ue(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 Bt(a,y){if(!a.startsWith("\\"))return null;const b=a.slice(1);return y[b]}function Jt(a,y){if(y===void 0)return"";if(a==="math"&&en[y])return en[y];if(a==="text"){const b=Object.keys(se).find(E=>se[E]===y);return b||String.fromCodePoint(y)}return String.fromCodePoint(y)}var rn=[0,.68889,0,0,.72222],An=[0,.68889,0,0,.66667],In=[0,.68889,0,0,.77778],Ln=[0,.68889,0,0,.61111],Fn=[.16667,.68889,0,0,.77778],jn=[0,.68889,0,0,.55556],Tn=[0,0,0,0,.25],hr=[0,.825,0,0,2.33334],kr=[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],ct=[0,.69224,0,0,.72222],ke=[0,.69224,0,0,.66667],Be=[-.13313,.36687,0,0,.77778],Ae=[.06062,.54986,0,0,.77778],Ie=[0,.69224,0,0,.77778],Xe=[.25583,.75583,0,0,.77778],dt=[.25142,.75726,0,0,.77778],Ht=[.20576,.70576,0,0,.77778],kt=[.30274,.79383,0,0,.77778],Wt=[.22958,.72958,0,0,.77778],vn=[.1808,.675,0,0,.77778],xn=[.13667,.63667,0,0,.77778],Cn=[.13597,.63597,0,0,.77778],Lt=[.03517,.54986,0,0,.77778],ln=[0,.675,0,0,.77778],it=[.19444,.69224,0,0,.61111],wt=[0,.54986,0,0,.76042],Et=[0,.54986,0,0,.66667],At=[.0391,.5391,0,0,.77778],nn=[.03517,.54986,0,0,1.33334],_t=[.38569,.88569,0,0,.77778],tn=[.23222,.74111,0,0,.77778],Oe=[.19444,.69224,0,0,.77778],yt=[0,.37788,0,0,.5],xt=[0,.54986,0,0,.72222],Ot=[0,.69224,0,0,.83334],Dt=[.11111,.69224,0,0,.66667],Nt=[.26167,.75726,0,0,.77778],zt=[.48256,.98256,0,0,.77778],gn=[.28481,.79383,0,0,.77778],wn=[.08167,.58167,0,0,.22222],Dn=[.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],Pn=[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],En=[0,.68611,0,0,.86944],kn=[.25,.75,0,0,.575],gr=[.25,.75,0,0,.31944],nr=[0,.69444,0,0,.63889],_r=[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],ki=[.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],_i=[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],ko=[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],_c=[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],_u=[0,.68611,0,0,.80555],ku=[0,.68611,.08229,0,.98229],Zl=[0,.68611,0,0,.76666],Od=[0,.44444,0,0,.58472],kc=[.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],_s=[0,.69444,0,0,.30556],Au=[0,.69444,0,0,.58056],ks=[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:Tn,65:rn,66:An,67:rn,68:rn,69:An,70:Ln,71:In,72:In,73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:In,76:An,77:[0,.68889,0,0,.94445],78:rn,79:Fn,80:Ln,81:Fn,82:rn,83:jn,84:An,85:rn,86:rn,87:[0,.68889,0,0,1],88:rn,89:rn,90:An,107:jn,160:Tn,165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:jn,295:Tr,710:hr,732:kr,770:hr,771:kr,989:wr,1008:zn,8245:[0,.54986,0,0,.275],8463:Tr,8487:rn,8498:jn,8502:An,8503:[0,.68889,0,0,.44445],8504:An,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:Ie,8736:ct,8737:ct,8738:[.03517,.52239,0,0,.72222],8739:wn,8740:[.25142,.74111,0,0,.27778],8741:Dn,8742:[.25142,.74111,0,0,.5],8756:ke,8757:ke,8764:Be,8765:[-.13313,.37788,0,0,.77778],8769:Be,8770:xl,8774:kt,8776:Vo,8778:wr,8782:Ae,8783:Ae,8785:jr,8786:jr,8787:jr,8790:Ie,8791:Wt,8796:[.08198,.91667,0,0,.77778],8806:Xe,8807:Xe,8808:dt,8809:dt,8812:[.25583,.75583,0,0,.5],8814:Ht,8815:Ht,8816:kt,8817:kt,8818:Wt,8819:Wt,8822:vn,8823:vn,8828:xn,8829:xn,8830:Wt,8831:Wt,8832:Ht,8833:Ht,8840:kt,8841:kt,8842:Cn,8843:Cn,8847:Lt,8848:Lt,8858:jr,8859:jr,8861:jr,8862:ln,8863:ln,8864:ln,8865:ln,8872:[0,.69224,0,0,.61111],8873:ct,8874:[0,.69224,0,0,.88889],8876:Ln,8877:Ln,8878:rn,8879:rn,8882:Lt,8883:Lt,8884:xn,8885:xn,8888:[0,.54986,0,0,1.11111],8890:Ei,8891:it,8892:it,8901:[0,.54986,0,0,.27778],8903:wr,8905:wr,8906:wr,8907:Ie,8908:Ie,8909:[-.03598,.46402,0,0,.77778],8910:wt,8911:wt,8912:Lt,8913:Lt,8914:Et,8915:Et,8916:ke,8918:At,8919:At,8920:nn,8921:nn,8922:_t,8923:_t,8926:xn,8927:xn,8928:kt,8929:kt,8934:tn,8935:tn,8936:tn,8937:tn,8938:Ht,8939:Ht,8940:kt,8941:kt,8994:Oe,8995:Oe,9416:[.15559,.69224,0,0,.90222],9484:Fr,9488:Fr,9492:yt,9496:yt,9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:ln,9633:ln,9650:xt,9651:xt,9654:Lt,9660:xt,9661:xt,9664:Lt,9674:Dt,9733:[.19444,.69224,0,0,.94445],10003:Ot,10016:Ot,10731:Dt,10846:[.19444,.75583,0,0,.61111],10877:xn,10878:xn,10885:Xe,10886:Xe,10887:Cn,10888:Cn,10889:Nt,10890:Nt,10891:zt,10892:zt,10901:xn,10902:xn,10933:dt,10934:dt,10935:Nt,10936:Nt,10937:Nt,10938:Nt,10949:Xe,10950:Xe,10955:gn,10956:gn,57350:wn,57351:Dn,57352:wr,57353:zn,57356:dt,57357:dt,57358:er,57359:kt,57360:kt,57361:er,57366:dt,57367:dt,57368:dt,57369:dt,57370:Cn,57371:Cn},"Caligraphic-Regular":{32:Tn,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:Tn},"Fraktur-Regular":{32:Tn,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:Pn,45:Un,46:Pn,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:Tn,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:Tn,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:_r,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:kn,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:En,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:En,89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:gr,92:kn,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:_r,106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:_r,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:kn,124:gr,125:kn,126:[.35,.34444,0,0,.575],160:Tn,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:_r,730:Hn,732:pr,733:pr,915:qn,916:Zn,920:$r,923:_u,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:_r,8217:_r,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:kn,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:kn,8726:kn,8727:oa,8728:ni,8729:ni,8730:[.18,.82,0,0,.95833],8733:xi,8734:[0,.44444,0,0,1.14999],8736:ct,8739:gr,8741:kn,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:ki,8805:ki,8810:Hi,8811:Hi,8826:Br,8827:Br,8834:Br,8835:Br,8838:ki,8839:ki,8846:Mi,8849:ki,8850:ki,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:ki,10928:ki,57376:To},"Main-BoldItalic":{32:Tn,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:_i,49:_i,50:_i,51:_i,52:pi,53:_i,54:_i,55:pi,56:_i,57:_i,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:Tn,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:Tn,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:Tn,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:Tn,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:At,61:Be,62:At,63:Sa,64:bo,65:ko,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:ko,73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:Eo,76:to,77:[0,.68333,0,0,.91667],78:ko,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:ko,86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:ko,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:Tn,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:_c,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:ko,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:_c,8734:Er,8736:ct,8739:Oa,8741:Xa,8743:is,8744:is,8745:is,8746:is,8747:[.19444,.69444,.11111,0,.41667],8764:Be,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:Cn,8805:Cn,8810:as,8811:as,8826:At,8827:At,8834:At,8835:At,8838:Cn,8839:Cn,8846:is,8849:Cn,8850:Cn,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:ko,10927:Cn,10928:Cn,57376:To},"Math-BoldItalic":{32:Tn,48:wo,49:wo,50:wo,51:os,52:os,53:os,54:ur,55:os,56:ur,57:os,65:En,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:ku,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:Tn,915:[0,.68611,.15972,0,.65694],916:Zn,920:[0,.68611,.03194,0,.86722],923:_u,926:[0,.68611,.07458,0,.84125],928:ku,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:kc,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:kc,1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:Tn,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:Tn,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:Tn,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:_s,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:ks,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:Tn,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:_s,730:ss,732:Ta,733:Ta,915:Au,916:[0,.69444,0,0,.91667],920:tl,923:ks,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:_s,8217:_s,8220:ls,8221:ls},"SansSerif-Italic":{32:Tn,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:Tn,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:Tn,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:Tn,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:Tn,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:Tn},"Size1-Regular":{32:Tn,40:Ud,41:Ud,47:Ic,91:Pc,92:Ic,93:Pc,123:$u,125:$u,160:Tn,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:Tn,40:Fu,41:Fu,47:go,91:Fi,92:go,93:Fi,123:Io,125:Io,160:Tn,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:Tn,40:Ku,41:Ku,47:Nc,91:ds,92:Nc,93:ds,123:Jl,125:Jl,160:Tn,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:Tn,40:Ql,41:Ql,47:zc,91:Hu,92:zc,93:Hu,123:Kc,125:Kc,160:Tn,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[ye,we,Ne]=cl[a],Ge=`<span class="stretchy" style="height:${Ne}em"><svg width="100%" height="${Ne}em" viewBox="0 0 ${ye} ${we}" preserveAspectRatio="none" ><path fill="currentcolor" d="${Qd[a]}"></path></svg></span>`;return`<span style="display:inline-block;height:${Math.floor(100*Ne/2)/100}em;min-width:0">${Ge}</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 me=y.map((ye,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[ye]}"></path></svg></span>`).join("");return`<span style="display:inline-block;height:${he}em;min-width:${b}em;">${me}</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,_l=[127462,127487];function kl(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>=_l[0]&&a<=_l[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(kl(re)){const ae=E-1;for(;kl(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 me of he)ae.push(me==="\\"?"\\backslash":me);else he==="<{>"?ae.push("\\{"):he==="<space>"?ae.push("~"):he==="<}>"&&ae.push("\\}")}else if(he==="\\csname"){for(;a.peek()==="<space>";)a.next();let me="",ye=!1,we=[];do{if(we.length===0)if(/^#[\d?@]$/.test(a.peek())){const Ne=a.get().slice(1);we=ps((E=(b=y==null?void 0:y(Ne))!=null?b:y==null?void 0:y("?"))!=null?E:"\\placeholder{}",y),he=we[0]}else he=a.next(),we=he?[he]:[];ye=we.length===0,!ye&&he==="\\endcsname"&&(ye=!0,we.shift()),ye||(ye=he==="<$>"||he==="<$$>"||he==="<{>"||he==="<}>"||typeof he=="string"&&he.length>1&&he.startsWith("\\")),ye||(me+=we.shift())}while(!ye);me&&ae.push("\\"+me),ae.push(...we)}else if(he!=="\\endcsname")if(he.length>1&&he.startsWith("#")){const me=he.slice(1);ae.push(...ps((re=(ee=y==null?void 0:y(me))!=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(qe(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,Ue(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 me of ya(ae,"color")){const ye=me[0].computedStyle,we=Co._registry[me[0].mode].serialize(me,Me(Se({},y),{defaultMode:he==="text"?"text":"math"}));!y.skipStyles&&ye.color&&ye.color!=="none"&&(!E||ee!==ye.color)?re.push(ra("\\textcolor",(b=ye.verbatimColor)!=null?b:ye.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(Se({},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:Te(y)?this.children=y.filter(ye=>ye!==null):y&&y instanceof Mp&&(this.children=[y]),this.children)for(const ye of this.children)ye.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 me=b==null?void 0:b.fontFamily;b!=null&&b.style&&this.value&&(me=(he=Co.getFont((ae=b.mode)!=null?ae:"math",this,Me(Se({variant:"normal"},b.style),{letterShapeStyle:b.letterShapeStyle})))!=null?he:void 0),me||(me="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,me)}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=jt(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 mt of this.children)re+=mt.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 mt=(b=this.cssProperties)==null?void 0:b.padding;mt?(ae+=`top:${mt};`,ae+=`left:${mt};`,ae+=`width:calc(100% - 2 * ${mt} );`):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 me=this.classes.split(" ");me.push((E={latex:"ML__raw-latex",placeholder:"ML__placeholder",error:"ML__error"}[this.type])!=null?E:""),this.caret==="latex"&&me.push("ML__latex-caret"),this.isSelected&&me.push("ML__selected");const ye=me.length===1?me[0]:me.filter((mt,St,bn)=>mt.length>0&&bn.indexOf(mt)===St).join(" ");if(ye.length>0&&(he+=` class="${ye}"`),this.id&&(he+=` data-atom-id=${this.id}`),this.cssId&&(he+=` id="${this.cssId.replace(/ /g,"-")}" `),this.attributes&&(he+=" "+Object.keys(this.attributes).map(mt=>`${mt}="${this.attributes[mt]}"`).join(" ")),this.htmlData){const mt=this.htmlData.split(",");for(const St of mt){const bn=St.match(/([^=]+)=(.+$)/);if(bn){const ir=bn[1].trim().replace(/ /g,"-");ir&&(he+=` data-${ir}="${bn[2]}" `)}else{const ir=St.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 Ne=Object.keys(we).map(mt=>`${mt}:${we[mt]}`);if(this.scale!==void 0&&this.scale!==1&&(re.length>0||ae.length>0)&&Ne.push(`font-size: ${Math.ceil(this.scale*1e4)/100}%`),this.htmlStyle){const mt=this.htmlStyle.split(";");let St="";for(const bn of mt){const ir=bn.match(/([^=]+):(.+$)/);if(ir){const yn=ir[1].trim().replace(/ /g,"-");yn&&(St+=`${yn}:${ir[2]};`)}}St&&(he+=` style="${St}"`)}Ne.length>0&&(he+=` style="${Ne.join(";")}"`);let Ge="";return he.length>0||ae.length>0?Ge=`<span${he}>${re}${ae}</span>`:Ge=re,this.caret==="text"?Ge+='<span class="ML__text-caret"></span>':this.caret==="math"&&(Ge+='<span class="ML__caret"></span>'),Ge}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 me of["border","border-left","border-right","border-right-width","left","margin","margin-left","margin-right","padding","position","width"])if(y.cssProperties&&me in y.cssProperties||this.cssProperties&&me 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 me of Object.keys(this.cssProperties))if(this.cssProperties[me]!==y.cssProperties[me])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[me,ye]of ae.entries())if(ye==="vertical-separator"||ye!==he[me])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(Se({},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],me=-he.shift-re-he.box.depth,ye=me-(b.box.height+b.box.depth);re=re+me,E.push(ye),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 St of b)if(typeof St!="number"){const bn=St.box;re=Math.max(re,bn.maxFontSize,bn.height)}re+=2,ee.height=re,ee.setStyle("height",re,"em");const ae=[];let he=E,me=E,ye=E,we=0;for(const St of b){if(typeof St=="number")ye+=St;else{const bn=St.box,ir=(y=St.classes)!=null?y:[],yn=new or([ee,bn],{classes:ir.join(" "),style:St.style});bn.setStyle("height",bn.height+bn.depth,"em"),bn.setStyle("display","inline-block"),yn.setStyle("top",-re-ye-bn.depth,"em"),St.marginLeft&&yn.setStyle("margin-left",St.marginLeft,"em"),St.marginRight&&yn.setStyle("margin-right",St.marginRight,"em"),ae.push(yn),ye+=bn.height+bn.depth,we=Math.max(we,yn.width)}he=Math.min(he,ye),me=Math.max(me,ye)}ae.forEach(St=>{St.softWidth=we});const Ne=new or(ae,{classes:"vlist"});if(Ne.softWidth=we,Ne.height=me,Ne.setStyle("height",me,"em"),he>=0)return[[new or(Ne,{classes:"vlist-r"})],me,-he];const Ge=new or(new or(null),{classes:"vlist"});Ge.height=-he,Ge.setStyle("height",-he,"em");const mt=new or(8203,{classes:"vlist-s",maxFontSize:0});return mt.softWidth=0,mt.height=0,mt.depth=0,[[new or([Ne,mt],{classes:"vlist-r"}),new or(Ge,{classes:"vlist-r"})],me,-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,me=new or(y.base),ye=(b=y.baseShift)!=null?b:0,we=(E=y.slant)!=null?E:0;let Ne=0,Ge=0;y.above&&(Ne=(ee=y.aboveShift)!=null?ee:Math.max(he.bigOpSpacing1,he.bigOpSpacing3-y.above.depth)),y.below&&(Ge=(re=y.belowShift)!=null?re:Math.max(he.bigOpSpacing2,he.bigOpSpacing4-y.below.height));let mt=null;if(y.below&&y.above){const St=he.bigOpSpacing5+y.below.height+y.below.depth+Ge+me.depth+ye;mt=new Yi({bottom:St,children:[he.bigOpSpacing5,{box:y.below,marginLeft:-we,classes:["ML__center"]},Ge,{box:me,classes:["ML__center"]},Ne,{box:y.above,marginLeft:we,classes:["ML__center"]},he.bigOpSpacing5]}).wrap(a)}else if(y.below&&!y.above)mt=new Yi({top:me.height-ye,children:[he.bigOpSpacing5,{box:y.below,marginLeft:-we,classes:["ML__center"]},Ge,{box:me,classes:["ML__center"]}]}).wrap(a);else if(!y.below&&y.above){const St=me.depth+ye;mt=new Yi({bottom:St,children:[{box:me,classes:["ML__center"]},Ne,{box:y.above,marginLeft:we,classes:["ML__center"]},he.bigOpSpacing5]}).wrap(a)}else{const St=me.depth+ye;mt=new Yi({bottom:St,children:[{box:me},he.bigOpSpacing5]}).wrap(a)}return new or(mt,{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(Se({},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(Se({},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(Se({},a),{number:a.number*y}):"register"in a?"factor"in a&&a.factor?Me(Se({},a),{factor:a.factor*y}):Me(Se({},a),{factor:y}):"dimension"in a?Me(Se({},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 Se({},nf)}function Qc(){return{registers:Al(),smartFence:!1,renderPlaceholder:void 0,placeholderSymbol:"\u25A2",letterShapeStyle:at.locale.startsWith("fr")?"french":"tex",minFontScale:0,colorMap:Kt,backgroundColorMap:ut,getMacro:a=>Bt(a,Sn())}}var Di=class _p{constructor(y,b){var E,ee,re,ae,he,me,ye,we,Ne,Ge,mt,St,bn,ir,yn;let Nn;y!=null&&y.parent?(this.parent=y.parent,Nn=y.parent,this.registers={}):(Nn=Se(Se({},Qc()),(E=y==null?void 0:y.from)!=null?E:{}),this.registers=Nn.registers),Nn.atomIdsSettings&&(this.atomIdsSettings=Se({},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=(me=(he=this.parent)==null?void 0:he.color)!=null?me:"",b!=null&&b.backgroundColor&&b.backgroundColor!=="none"?this.backgroundColor=b.backgroundColor:this.backgroundColor=(we=(ye=this.parent)==null?void 0:ye.backgroundColor)!=null?we:"",b!=null&&b.fontSize&&b.fontSize!=="auto"&&b.fontSize!==((Ne=this.parent)==null?void 0:Ne.size)?this.size=b.fontSize:this.size=(mt=(Ge=this.parent)==null?void 0:Ge.size)!=null?mt:Ds;let dr=(bn=(St=this.parent)==null?void 0:St.mathstyle)!=null?bn:Go.displaystyle;if(typeof(y==null?void 0:y.mathstyle)=="string"){if(Nn instanceof _p)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(Se({},re),{dimension:E*re.dimension}):"glue"in re?Me(Se({},re),{glue:Me(Se({},re.glue),{dimension:E*re.glue.dimension}),shrink:re.shrink?Me(Se({},re.shrink),{dimension:E*re.shrink.dimension}):void 0,grow:re.grow?Me(Se({},re.grow),{dimension:E*re.grow.dimension}):void 0}):y}toDimension(y){const b=this.evaluate(y);return b===void 0?null:"dimension"in b?b:"glue"in b?b.glue:"number"in b?{dimension:b.number}:null}toEm(y,b){if(y===null)return 0;const E=this.toDimension(y);return E===null?0: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 Bn=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=Se({},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 me of re){const ye=me[0].style,we=ch(y,me,{style:{color:ye.color,backgroundColor:ye.backgroundColor,fontSize:ye.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=Se({},this.style)),this.verbatimLatex!==void 0&&(y.verbatimLatex=this.verbatimLatex),this.subsupPlacement&&(y.subsupPlacement=this.subsupPlacement),this.explicitSubsupPlacement&&(y.explicitSubsupPlacement=!0),this.isFunction&&(y.isFunction=!0),this.displayContainsHighlight&&(y.displayContainsHighlight=!0),this.isExtensibleSymbol&&(y.isExtensibleSymbol=!0),this.skipBoundary&&(y.skipBoundary=!0),this.captureSelection&&(y.captureSelection=!0),this.args&&(y.args=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=Ue(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(Se({},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(Se({},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=Se(Se({},(b=(y=this.parent)==null?void 0:y.computedStyle)!=null?b:{}),this.style);return delete re.variant,delete re.variantStyle,ee||delete re.verbatimBackgroundColor,E||delete re.verbatimColor,re}applyStyle(y){this.isDirty=!0,this.style=Se(Se({},this.style),y),this.style.fontFamily==="none"&&delete this.style.fontFamily,this.style.fontShape==="auto"&&delete this.style.fontShape,this.style.fontSeries==="auto"&&delete this.style.fontSeries,this.style.color==="none"&&(delete this.style.color,delete this.style.verbatimColor),this.style.backgroundColor==="none"&&(delete this.style.backgroundColor,delete this.style.verbatimBackgroundColor),this.style.fontSize==="auto"&&delete this.style.fontSize;for(const b of this.children)b.applyStyle(y)}getInitialBaseElement(){var y,b,E;return this.hasEmptyBranch("body")?this:(console.assert(((y=this.body)==null?void 0:y[0].type)==="first"),(E=(b=this.body[1])==null?void 0:b.getInitialBaseElement())!=null?E:this)}getFinalBaseElement(){return this.hasEmptyBranch("body")?this:this.body[this.body.length-1].getFinalBaseElement()}isCharacterBox(){return this.type==="leftright"||this.type==="genfrac"||this.type==="subsup"||this.type==="delim"||this.type==="array"||this.type==="surd"?!1:this.getFinalBaseElement().type==="mord"}hasEmptyBranch(y){const b=this.branch(y);return b?(console.assert(b.length>0),console.assert(b[0].type==="first"),b.length===1):!0}setChildren(y,b){var E;if(!y||(console.assert(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=Ue(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,me=null;const ye=(E=b.isCharacterBox)!=null?E:this.isCharacterBox();let we=0;if(re){const bn=new Di({parent:y,mathstyle:"superscript"});he=vl.createBox(bn,re),ye||(we=ee.height-y.metrics.supDrop*bn.scalingFactor)}let Ne=0;if(ae){const bn=new Di({parent:y,mathstyle:"subscript"});me=vl.createBox(bn,ae),ye||(Ne=ee.depth+y.metrics.subDrop*bn.scalingFactor)}let Ge;y.isDisplayStyle?Ge=y.metrics.sup1:y.isCramped?Ge=y.metrics.sup3:Ge=y.metrics.sup2;const mt=.5/ll/y.scalingFactor;let St=null;if(me&&he){we=Math.max(we,Ge,he.depth+.25*y.metrics.xHeight),Ne=Math.max(Ne,y.metrics.sub2);const bn=y.metrics.defaultRuleThickness;if(we-he.depth-(me.height-Ne)<4*bn){Ne=4*bn-(we-he.depth)+me.height;const yn=.8*y.metrics.xHeight-(we-he.depth);yn>0&&(we+=yn,Ne-=yn)}const ir=this.isExtensibleSymbol&&ee.italic?-ee.italic:0;St=new Yi({individualShift:[{box:me,shift:Ne,marginLeft:ir},{box:he,shift:-we}]}).wrap(y)}else me&&!he?(Ne=Math.max(Ne,y.metrics.sub1,me.height-.8*hs),St=new Yi({shift:Ne,children:[{box:me,marginRight:mt,marginLeft:this.isCharacterBox()?-ee.italic:0}]})):!me&&he&&(we=Math.max(we,Ge,he.depth+.25*hs),St=new Yi({shift:-we,children:[{box:he,marginRight:mt}]}));return new or([ee,new or(St,{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(Se({},b),{above:E,below:ee}))}bind(y,b){if(!b||y.isPhantom||this.value==="\u200B")return b;let E=this.parent;for(;E&&!E.captureSelection;)E=E.parent;return E!=null&&E.captureSelection||(this.id||(this.id=y.makeID()),b.atomID=this.id),b}createBox(y,b){var E,ee,re,ae;const he=(E=this.value)!=null?E:this.body,me=(ee=b==null?void 0:b.boxType)!=null?ee:Gu(this.type);let ye=(re=b==null?void 0:b.classes)!=null?re:"";this.mode==="text"&&(ye+=" ML__text");const we=typeof he=="string"||he===void 0?new or(he!=null?he:null,{type:me,isSelected:this.isSelected,mode:this.mode,maxFontSize:y.scalingFactor,style:Me(Se({variant:"normal"},this.style),{fontSize:Math.max(1,y.size+y.mathstyle.sizeDelta)}),letterShapeStyle:y.letterShapeStyle,classes:ye}):(ae=vl.createBox(y,he,{type:me,classes:ye}))!=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 me=new Di({parent:a},b.style),ye=!((E=me.atomIdsSettings)!=null&&E.groupNumbers);let we=[];if(y.length===1){const Ge=y[0],mt=Ge.render(me);mt&&(ye&&Ge.isSelected&&mt.selected(!0),we=[mt])}else{let Ge="",mt=!0;for(const St of y){(ee=me.atomIdsSettings)!=null&&ee.groupNumbers&&Ge&&(mt&&St.isDigit()||!mt&&Qu(St))&&(me.atomIdsSettings.overrideID=Ge);const bn=St.render(me);me.atomIdsSettings&&(me.atomIdsSettings.overrideID=void 0),bn&&((re=me.atomIdsSettings)!=null&&re.groupNumbers&&((St.isDigit()||Qu(St))&&(!Ge||mt!==St.isDigit())&&(mt=St.isDigit(),Ge=(ae=St.id)!=null?ae:""),Ge&&(!(St.isDigit()||Qu(St))||!St.hasEmptyBranch("superscript")||!St.hasEmptyBranch("subscript"))&&(Ge="")),ye&&St.isSelected&&bn.selected(!0),we.push(bn))}}if(we.length===0)return null;const Ne=new or(we,Me(Se({isTight:me.isTight},b),{type:(he=b.type)!=null?he:"lift"}));return Ne.isSelected=we.every(Ge=>Ge.isSelected),Ne.wrap(me)}function Qu(a){return a.mode==="text"}function ed(a){return a.map(y=>y===null?"<null>":Array.isArray(y)&&y[0]instanceof Bn?{atoms:y.map(b=>b.toJson())}:typeof y=="object"&&"group"in y?{group:y.group.map(b=>b.toJson())}:y)}var vs=class kp extends Bn{constructor(y,b,E){super({type:"text",command:y,mode:"text",displayContainsHighlight:!0}),this.value=b,this.verbatimLatex=b,this.applyStyle(E)}static fromJson(y){return new kp(y.command,y.value,y.style)}render(y){const b=this.createBox(y);return this.caret&&(b.caret=this.caret),b}_serialize(y){var b;return(b=this.verbatimLatex)!=null?b:Jt("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;)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,me=!1,ye=!1,we=!1,Ne=!1,Ge=!1,mt=!1,St=!1,bn=!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&&(bn=yn.mode==="text",E=!bn&&yn.type==="mord"&&de.test(yn.value),ee=!bn&&yn.type==="mord"&&/\d+$/.test(yn.value),re=!bn&&yn.isFunction,ae=yn.type==="genfrac",he=yn.type==="surd",me=yn.type==="mbin",ye=yn.type==="mrel",we=yn.type==="mop"||yn.type==="operator"||yn.type==="extensible-symbol",Ne=yn.type==="mpunct"||yn.type==="minner",Ge=yn.type==="array",mt=yn.type==="mopen",St=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")&&me||y.after.includes("relop")&&ye||y.after.includes("operator")&&we||y.after.includes("punct")&&Ne||y.after.includes("array")&&Ge||y.after.includes("openfence")&&mt||y.after.includes("closefence")&&St||y.after.includes("text")&&bn||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 me=Os(ae.rest.slice(1),{inlineShortcuts:he,noWrap:!0});me.match&&(a="\\frac{"+ae.match+"}{"+me.match+"}"+Ja(me.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 me;return(me=he.value)!=null?me:""}).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(me){}if(ae.length===1){const me=ae[0];(me.type==="root"||me.type==="group")&&(ae=me.body.filter(ye=>ye.type!=="first"))}try{b.clipboardData.setData("application/json+mathlive",JSON.stringify(ae.map(me=>me.toJson())))}catch(me){}if((E=window[Symbol.for("io.cortexjs.compute-engine")])!=null&&E.ComputeEngine){const me=window.MathfieldElement.computeEngine;if(me)try{const ye=me.jsonSerializationOptions;me.jsonSerializationOptions={metadata:["latex"]};const we=me.parse(ee.getValue(re,"latex-unstyled"));me.jsonSerializationOptions=ye;const Ne=JSON.stringify(we.json);Ne&&b.clipboardData.setData("application/json",Ne)}catch(ye){}}}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 me=Math.floor(re.getBoundingClientRect().width)/ae;me=isNaN(me)?1:me;const ye=ad(a,Il(a,ee),me);if(ye){const we=id(ee);if(E.has(we)){const Ne=E.get(we);E.set(we,{left:Math.min(Ne.left,ye.left),right:Math.max(Ne.right,ye.right),top:Math.min(Ne.top,ye.top),bottom:Math.max(Ne.bottom,ye.bottom)})}else E.set(we,ye)}}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 Bn{constructor(y){var b;super(Me(Se({},y),{type:"accent",body:(b=y.body)!=null?b:void 0})),y.accentChar?this.accent=y.accentChar:this.svgAccent=y==null?void 0:y.svgAccent,this.skipBoundary=!0,this.captureSelection=!0}static fromJson(y){return new Ep(y)}toJson(){return Me(Se({},super.toJson()),{accentChar:this.accent,svgAccent:this.svgAccent})}render(y){var b;const E=new Di({parent:y,mathstyle:"cramp"},this.style),ee=(b=Bn.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 ye=new or(this.accent,{fontFamily:"Main-Regular"});ye.italic=0;const we=this.accent===8407?" ML__accent-vec":"";he=new or(new or(ye),{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 me=new or(he,{type:"lift"});return this.caret&&(me.caret=this.caret),this.bind(E,me.wrap(E)),this.attachSupsub(E,{base:me})}},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 ve(a,y,b,E,ee){var re,ae;const he=new Di({parent:E,mathstyle:"textstyle"},ee==null?void 0:ee.style),me=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&&me.setTop((1-he.scalingFactor)*ro),me}function Ce(a,y,b,E,ee){var re;let ae,he,me,ye;ae=me=ye=ie(a),he=null;let we="Size1-Regular";a==="\\vert"||a==="\\lvert"||a==="\\rvert"||a==="\\mvert"||a==="\\mid"?me=ae=ye=8739:a==="\\Vert"||a==="\\lVert"||a==="\\rVert"||a==="\\mVert"||a==="\\|"?me=ae=ye=8741:a==="\\uparrow"?me=ye=9168:a==="\\Uparrow"?me=ye=8214:a==="\\downarrow"?ae=me=9168:a==="\\Downarrow"?ae=me=8214:a==="\\updownarrow"?(ae=8593,me=9168,ye=8595):a==="\\Updownarrow"?(ae=8657,me=8214,ye=8659):a==="["||a==="\\lbrack"?(ae=9121,me=9122,ye=9123,we="Size4-Regular"):a==="]"||a==="\\rbrack"?(ae=9124,me=9125,ye=9126,we="Size4-Regular"):a==="\\lfloor"||a==="\u230A"?(me=ae=9122,ye=9123,we="Size4-Regular"):a==="\\lceil"||a==="\u2308"?(ae=9121,me=ye=9122,we="Size4-Regular"):a==="\\rfloor"||a==="\u230B"?(me=ae=9125,ye=9126,we="Size4-Regular"):a==="\\rceil"||a==="\u2309"?(ae=9124,me=ye=9125,we="Size4-Regular"):a==="("||a==="\\lparen"?(ae=9115,me=9116,ye=9117,we="Size4-Regular"):a===")"||a==="\\rparen"?(ae=9118,me=9119,ye=9120,we="Size4-Regular"):a==="\\{"||a==="\\lbrace"?(ae=9127,he=9128,ye=9129,me=9130,we="Size4-Regular"):a==="\\}"||a==="\\rbrace"?(ae=9131,he=9132,ye=9133,me=9130,we="Size4-Regular"):a==="\\lgroup"||a==="\u27EE"?(ae=9127,ye=9129,me=9130,we="Size4-Regular"):a==="\\rgroup"||a==="\u27EF"?(ae=9131,ye=9133,me=9130,we="Size4-Regular"):a==="\\lmoustache"||a==="\u23B0"?(ae=9127,ye=9133,me=9130,we="Size4-Regular"):a==="\\rmoustache"||a==="\u23B1"?(ae=9131,ye=9129,me=9130,we="Size4-Regular"):a==="\\surd"?(ae=57345,ye=9143,me=57344,we="Size4-Regular"):a==="\\ulcorner"?(ae=9484,me=ye=32):a==="\\urcorner"?(ae=9488,me=ye=32):a==="\\llcorner"?(ye=9492,me=ae=32):a==="\\lrcorner"&&(ae=9496,me=ae=32);const Ne=fs(ae,we),Ge=Ne.height+Ne.depth,mt=fs(me,we),St=mt.height+mt.depth,bn=fs(ye,we),ir=bn.height+bn.depth;let yn=0,Nn=1;if(he!==null){const Ua=fs(he,we);yn=Ua.height+Ua.depth,Nn=2}const dr=Ge+ir+yn,Kn=Math.max(0,Math.ceil((y-dr)/(Nn*St))),Zr=dr+Kn*Nn*St;let qr=ro;b&&(qr=qr*E.scalingFactor);const Vr=Zr/2-qr,Ti=.008,Ui=[];Ui.push({box:new or(ye,{fontFamily:we})}),Ui.push(-Ti);const xr=new or(me,{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(Se({},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"]),$e=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\mvert","\\mid","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","\u27EE","\u27EF","\u23B0","\u23B1"]),pt=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Ct=[0,1.2,1.8,2.4,3];function un(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)||pt.has(a)?ve(a,y,!1,b,E):$e.has(a)?Ce(a,Ct[y],!1,b,E):(console.assert(!1,"Unknown delimiter '"+a+"'"),null))}var an=[{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}],On=[{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;pt.has(y)?ae=an:Ee.has(y)?ae=Wn:ae=On;const he=Ar(ie(y),b,ae,ee),me=new Di({parent:ee,mathstyle:he.mathstyle},re==null?void 0:re.style);return he.type==="small"?ce(y,me,E,Me(Se({},re),{type:a})):he.type==="large"?ve(y,he.size,E,me,Me(Se({},re),{type:a})):(console.assert(he.type==="stack"),Ce(y,b,E,me,Me(Se({},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,me=5/ll,ye=Math.max(b-ae,E+ae),we=Math.max(ye/500*he,2*ye-me);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 Bn{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 _a(a){return qi.includes(a)}function ho(a,y,b){let E=0;for(const ye of b)"align"in ye&&(E+=1);let ee=0;const re=[];for(const ye of y){let we=0;for(ee=Math.max(ee,Math.min(ye.length,E));we<ye.length;){const Ne=[],Ge=Math.min(ye.length,we+E);for(;we<Ge;){const mt=ye[we];mt.length===0?Ne.push([new Bn({type:"first",mode:a.mode})]):mt[0].type!=="first"?Ne.push([new Bn({type:"first",mode:a.mode}),...mt]):(console.assert(!mt.slice(1).some(St=>St.type==="first")),Ne.push(mt)),we+=1}re.push(Ne)}}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 ye of re){if(ye.length!==ee)for(let we=ye.length;we<ee;we++)ye.push([new Bn({type:"first",mode:a.mode}),new Qr]);ae.push(ye)}let he=0,me=0;for(const ye of ae){me=0;for(const we of ye){for(const Ne of we)Ne.parent=a,Ne.parentBranch=[he,me];me+=1}he+=1}return a.isDirty=!0,ae}var hi=class Dp extends Bn{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(Se({},super.toJson()),{environmentName:this.environmentName,array:this.array.map(b=>b.map(E=>E.map(ee=>ee.toJson()))),rowGaps:this.rowGaps,columns:this.colFormat,colSeparationType:this.colSeparationType});return this.arraystretch!==void 0&&(y.arraystretch=this.arraystretch),this.arraycolsep!==void 0&&(y.arraycolsep=this.arraycolsep),this.leftDelim&&(y.leftDelim=this.leftDelim),this.rightDelim&&(y.rightDelim=this.rightDelim),y}branch(y){var b;if(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 me=new Di({parent:y,mathstyle:this.mathstyleName},this.style),ye=me.getRegisterAsEm("arrayrulewidth"),we=me.getRegisterAsEm("arraycolsep"),Ne=me.getRegisterAsEm("doublerulesep"),Ge=(E=(b=this.arraystretch)!=null?b:me.getRegisterAsNumber("arraystretch"))!=null?E:1;let mt=typeof this.arraycolsep=="number"?this.arraycolsep:we;this.colSeparationType==="small"&&(mt=.2778*(new Di({parent:y,mathstyle:"scriptstyle"}).scalingFactor/y.scalingFactor));const St=Ge*Uc,bn=.7*St,ir=.3*St;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:me,mathstyle:this.mathstyleName},this.style);let Vs=bn/Ga.scalingFactor,Us=ir/Ga.scalingFactor;const Gs={cells:[],height:0,depth:0,pos:0};for(const ws of wa){const e0=(ee=Bn.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+=me.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*mt)):(Ui||Wo)&&Vr.push(ha(mt)),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",`${ye}em ${ea.separator} currentColor`),wa.setStyle("vertical-align",-(yn-Zr),"em");let Ga=0;Ui?Ga=Ne-ye:Ti&&(Ga=mt-ye),wa.left=Ga,Vr.push(wa),Ti=!1,Ui=!0,Wo=!1}}Ti&&!this.rightDelim&&Vr.push(ha(mt));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,_o=this.bind(y,new or([this.bind(y,Cr("open",(ae=this.leftDelim)!=null?ae:".",Ua,Zo,me,{isSelected:this.isSelected})),Qo,this.bind(y,Cr("close",(he=this.rightDelim)!=null?he:".",Ua,Zo,me,{isSelected:this.isSelected}))],{type:"ord"}));return _o?(_o.setStyle("display","inline-block"),this.caret&&(_o.caret=this.caret),this.bind(y,this.attachSupsub(y,{base:_o}))):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(Bn.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 Bn({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 Bn({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=Bn.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 Bn{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(Se({},super.toJson()),{framecolor:this.framecolor,backgroundcolor:this.backgroundcolor,padding:this.padding,offset:this.offset,border:this.border})}render(y){var b,E,ee,re;const ae=Bn.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 me=new Di({parent:y},this.style),ye=me.toEm((E=this.padding)!=null?E:{register:"fboxsep"}),we=new or(null,{classes:"ML__box"});we.height=ae.height+ye,we.depth=ae.depth+ye,we.setStyle("box-sizing","border-box"),we.setStyle("position","absolute"),we.setStyle("top",-ye+.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=me.toColor(this.backgroundcolor))!=null?ee:"transparent"),this.framecolor&&we.setStyle("border",`${me.getRegisterAsEm("fboxrule",2)}em solid ${(re=me.toColor(this.framecolor))!=null?re:"black"}`),this.border&&we.setStyle("border",this.border);const Ne=new or([we,ae],{type:"lift"});return Ne.setStyle("display","inline-block"),Ne.setStyle("position","relative"),Ne.setStyle("line-height",0),Ne.height=ae.height+ye+(he>0?he:0),Ne.depth=ae.depth+ye+(he<0?-he:0),Ne.setStyle("padding-left",ye,"em"),Ne.setStyle("padding-right",ye,"em"),Ne.setStyle("height",Math.floor(100*(ae.height+ae.depth+2*ye+Math.abs(he)))/100,"em"),Ne.setStyle("margin-top",-ye,"em"),Ne.setStyle("top",Math.floor(100*(ae.depth-ae.height+2*ye-he))/100,"em"),Ne.setStyle("vertical-align",Math.floor(100*(ae.depth+2*ye))/100,"em"),this.caret&&(Ne.caret=this.caret),this.attachSupsub(y,{base:Ne})}_serialize(y){return y.skipStyles?Si([this.bodyToLatex(y),this.supsubToLatex(y)]):super._serialize(y)}},fl=class Tp extends Bn{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 Bn{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 Bn{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=Bn.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=Ue(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):`{${this.bodyToLatex(y)}}`}},$i=class Bp extends Bn{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=Bn.createBox(ee,this.body,{type:"inner"}))!=null?b:new or(null,{type:"inner"}),he=ae.height/re.scalingFactor,me=ae.depth/re.scalingFactor,ye=[];if(this.leftDelim&&ye.push(this.bind(re,Cr("open",this.leftDelim,he,me,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,me),ye.push(ae)),this.rightDelim){let mt=this.containsCaret?" ML__contains-caret":"",St=this.rightDelim;St==="?"&&(ee.smartFence?(St=this.matchingRightDelim(),mt+=" ML__smart-fence__close"):St="."),ye.push(this.bind(re,Cr("close",St,he,me,re,{isSelected:this.isSelected,classes:mt+" ML__close",mode:this.mode,style:this.style})))}let we=this.variant==="mleft...mright";const Ne=this.leftSibling;Ne&&(!we&&Ne.isFunction&&(we=!0),!we&&Ne.type==="subsup"&&((E=Ne.leftSibling)!=null&&E.isFunction)&&(we=!0));const Ge=new or(ye,{type:we?"close":"inner",classes:"left-right"});return Ge.setStyle("margin-top",`${-ae.depth}em`),Ge.setStyle("height",`${ae.height+ae.depth}em`),this.caret&&(Ge.caret=this.caret),this.bind(ee,Ge.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 Bn{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=Bn.createBox(y,this.body);return b?(this.caret&&(b.caret=this.caret),this.bind(y,b)):null}},bs=class $p extends Bn{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 Bn{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=Bn.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 me="ML__prompt ";this.locked?me+=" ML__lockedPromptBox ":me+=" ML__editablePromptBox ",this.correctness==="correct"?me+=" ML__correctPromptBox ":this.correctness==="incorrect"&&(me+=" ML__incorrectPromptBox "),this.containsCaret&&(me+=" ML__focusedPromptBox ");const ye=new or(null,{classes:me,attributes:{part:"prompt"}});ye.height=he.height+re,ye.depth=he.depth+re,ye.width=he.width+2*ee,ye.setStyle("box-sizing","border-box"),ye.setStyle("position","absolute"),ye.setStyle("height",he.height+he.depth+2*re,"em"),ee===0&&ye.setStyle("width","100%"),ee!==0&&(ye.setStyle("width",`calc(100% + ${2*ee}em)`),ye.setStyle("top",E,"em"),ye.setStyle("left",-ee,"em")),(!this.body||this.body.length===1)&&(ye.width=3*ee,ye.setStyle("width",`calc(100% + ${3*ee}em)`),ye.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&&(ye.svgOverlay=we);const Ne=new or([ye,he],{classes:"ML__prompt-atom"});return Ne.setStyle("position","relative"),Ne.setStyle("display","inline-block"),Ne.setStyle("line-height",0),Ne.height=he.height+re+.2,Ne.depth=he.depth+re,Ne.left=ee,Ne.right=ee,Ne.setStyle("height",he.height+re,"em"),Ne.setStyle("top",he.depth-he.height,"em"),Ne.setStyle("vertical-align",he.depth+re,"em"),Ne.setStyle("margin-left",.5,"em"),Ne.setStyle("margin-right",.5,"em"),this.caret&&(Ne.caret=this.caret),this.bind(b,this.attachSupsub(y,{base:Ne}))}_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 Bn{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 ka(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:Se({},ee.style),parseMode:(y=a==null?void 0:a.mode)!=null?y:ee.parseMode,mathstyle:(b=a==null?void 0:a.mathstyle)!=null?b:ee.mathstyle,tabular:(E=a==null?void 0:a.tabular)!=null?E:!1};this.parsingContext=re}endContext(){this.parsingContext=this.parsingContext.parent}onError(a){this.errors.push(Se({before: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 Se({},a.style);a=a.parent}return{}}set style(a){this.parsingContext.style=a}end(){return this.endCount++,this.index>=this.tokens.length||this.endCount>1e3}next(){this.index+=1}get(){return this.endCount=0,this.index<this.tokens.length?this.tokens[this.index++]:""}peek(){return this.tokens[this.index]}match(a){return this.tokens[this.index]===a?(this.index++,!0):!1}lastSubsupAtom(){let a;return this.mathlist.length>0&&(a=this.mathlist[this.mathlist.length-1],a.type==="subsup"||a.subsupPlacement!==void 0)||(a=new 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=Ue(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();ka(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(ka(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 me=a?Number.parseInt(he,re):Number.parseFloat(he);return Number.isNaN(me)?null:{number:E?-me:me,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()||!ka(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=$t(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 me=this.scanArgument(he.type);me||this.onError({code:"missing-argument",arg:a}),b.push(me)}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=Ue(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(!ka(a)&&!a.startsWith("\\"))return null;this.next();const y=Ue(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 Bn({type:"mord",command:"\\doubleprime",mode:"math",value:"\u2032\u2032"}),"superscript"):y.addChild(new Bn({type:"mord",command:"\\prime",mode:"math",value:"\u2032"}),"superscript"):(this.match("^")||this.match("_"))&&y.addChildren(je(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(ka(a)){const b=Co.createAtom(this.parseMode,a,Se({},this.style));return b?[b]:null}if(y=this.scanMacro(a),y)return[y];if(a.startsWith("\\")){const b=Ue(a,this.parseMode);if(!b)return this.onError({code:"unknown-command",arg:a}),[new vo(a)];if(b.definitionType==="symbol"){const E=Se({},this.style);b.variant&&(E.variant=b.variant),y=new Bn({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"),me=this.scanOptionalArgument("math"),ye=Bn.serialize(me,{defaultMode:"math"});let we=[],Ne;!Ne&&ye==="correct"?Ne="correct":!Ne&&ye==="incorrect"?Ne="incorrect":ye!==""&&(we=me);const Ge=this.scanOptionalArgument("string")==="locked",mt=this.scanArgument("auto");let St;return mt&&Array.isArray(mt)&&mt.length>0?St=mt:mt&&typeof mt=="object"&&"group"in mt?St=mt.group:St=we,he?[new Ns(he,Ne,Ge,St!=null?St: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,me=this.scanLiteralGroup()||this.next();if(!me)return null;if(this.context.registers[me.substring(1)]){const ye=this.scanArgument("string");ye!==null&&(this.context.registers[me.substring(1)]=ye);const we=Si([a,Is(this.tokens.slice(he,this.index))]);return[new Bn({type:"text",value:"",verbatimLatex:we})]}}let ee=this.scanMacro(a);if(ee)return[ee];const re=Ue(a,this.parseMode);if(!re)return this.parseMode==="text"?(/[a-zA-Z]/.test((y=this.peek())!=null?y:"")&&(a+=" "),[...a].map(he=>new Bn({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=Se({},this.style);re.variant&&(he.variant=re.variant),ee=new Bn({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 me,ye=[];if(re.parse?ye=re.parse(this):[me,ye]=this.scanArguments(re),this.parseMode=he,re.applyMode&&!re.applyStyle&&!re.createAtom)return je(ye[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:ye,style:this.style,mode:this.parseMode}),me&&(ee.body=je(this.scanArgument(me)));else if(typeof re.applyStyle=="function"){const we=Se(Se({},this.style),re.applyStyle(a,ye,this.context)),Ne=this.parseMode;if(re.applyMode&&(this.parseMode=re.applyMode),me){const Ge=this.style;this.style=we;const mt=this.scanArgument(me);return this.style=Ge,this.parseMode=Ne,je(mt)}this.style=we}else ee=new Bn({type:"mord",command:(b=re.command)!=null?b:a,style:Se({},this.style),value:a,mode:(E=re.applyMode)!=null?E:this.parseMode})}if(!ee)return null;if(ee instanceof Bn&&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(ka(a)){const y=Co.createAtom(this.parseMode,a,Se({},this.style));if(!y)return null;if(y.isFunction&&this.smartFence){const b=this.scanSmartFence();if(b)return[y,b]}return[y]}return a.startsWith("\\")?this.scanSymbolOrCommand(a):a==="<space>"?this.parseMode==="text"?[new 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 me=this.index;this.scanExpression(),he=Is(this.tokens.slice(me,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:{}}),me=[];for(;!he.end();)me.push(...he.scan(()=>!1));return me}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 Bn{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(Se({},super.toJson()),{arg:this.arg})}render(y){const b=Bn.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}};vt(["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],me=he.transitions[b]||he.transitions["*"];e:for(var ye=0;ye<me.length;ye++){var we=Qn.patterns.match_(me[ye].pattern,a);if(we){for(var Ne=me[ye].task,Ge=0;Ge<Ne.action_.length;Ge++){var mt;if(he.actions[Ne.action_[Ge].type_])mt=he.actions[Ne.action_[Ge].type_](E,we.match_,Ne.action_[Ge].option);else if(Qn.actions[Ne.action_[Ge].type_])mt=Qn.actions[Ne.action_[Ge].type_](E,we.match_,Ne.action_[Ge].option);else throw["MhchemBugA","mhchem bug A. Please report. ("+Ne.action_[Ge].type_+")"];Qn.concatArray(ae,mt)}if(b=Ne.nextState||b,a.length>0){if(Ne.revisit||(a=we.remainder),!Ne.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,me,ye){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},Ne=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},Ge=we(a,y);if(Ge===null||(a=a.substr(Ge.length),Ge=we(a,b),Ge===null))return null;var mt=Ne(a,Ge.length,E||ee);if(mt===null)return null;var St=a.substring(0,E?mt.endMatchEnd:mt.endMatchBegin);if(re||ae){var bn=this.findObserveGroups(a.substr(mt.endMatchEnd),re,ae,he,me);if(bn===null)return null;var ir=[St,bn.match_];return{match_:ye?ir.join(""):ir,remainder:bn.remainder}}else return{match_:St,remainder:a.substr(mt.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 me=y.split("|"),ye=0;ye<me.length;ye++)if(E[ee]==="*")for(var we in re)re[we].push({pattern:me[ye],task:ae});else re[E[ee]].push({pattern:me[ye],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 me=[];return he?(Qn.concatArray(me,this.output(a)),me.push({type_:"hyphen"})):(E=Qn.patterns.match_("digits",a.d||""),b&&E&&E.remainder===""?(Qn.concatArray(me,Qn.actions["d="](a,y)),Qn.concatArray(me,this.output(a))):(Qn.concatArray(me,this.output(a)),Qn.concatArray(me,Qn.actions.bond(a,y,"-")))),me},"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 _1(a){}function k1(a){}var r0=class zp extends Bn{constructor(y){super(Me(Se({},y),{type:"delim"})),this.value=y.delim,this.size=y.size}static fromJson(y){return new zp(y)}toJson(){return Me(Se({},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=Ue(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):ra(this.command,this.value)}},i0=class Kp extends Bn{constructor(y){super(Me(Se({},y),{type:"sizeddelim",value:y.delim})),this.delimType=y.delimType,this.size=y.size}static fromJson(y){return new Kp(y)}toJson(){return Me(Se({},super.toJson()),{delim:this.value,size:this.size,delimType:this.delimType})}render(y){let b=un(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=Ue(this.command,this.mode);return b!=null&&b.serialize?b.serialize(this,y):ra(this.command,this.value)}},cd=class Hp extends Bn{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(Se({},super.toJson()),{notation:this.notation,shadow:this.shadow,strokeWidth:this.strokeWidth,strokeStyle:this.strokeStyle,svgStrokeStyle:this.svgStrokeStyle,strokeColor:this.strokeColor,borderStyle:this.borderStyle,padding:this.padding})}_serialize(y){var b;if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const E=Ue(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=Bn.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 me=E.width+2*re;let ye="";if(this.notation.horizontalstrike&&(ye+=this.line(3,50,97,50)),this.notation.verticalstrike&&(ye+=this.line(50,3,50,97)),this.notation.updiagonalstrike&&(ye+=this.line(3,97,97,3)),this.notation.downdiagonalstrike&&(ye+=this.line(3,3,97,97)),this.notation.updiagonalarrow){ye+=this.line(re.toString(),(re+E.depth+E.height).toString(),(re+E.width).toString(),re.toString());const St=.03*Math.sqrt(me*me+he*he)*1,bn=E.width*St,ir=(E.depth+E.height)*St,yn=re+E.width;let Nn=re;Nn+ir-.4*bn<0&&(Nn=.4*bn-ir),ye+='<polygon points="',ye+=`${yn},${Nn} ${yn-bn-.4*ir},${Nn+ir-.4*bn} `,ye+=`${yn-.7*bn},${Nn+.7*ir} ${yn-bn+.4*ir},${Nn+ir+.4*bn} `,ye+=`${yn},${Nn}`,ye+=`" stroke='none' fill="${this.strokeColor}"`,ye+="/>"}let we=0;if(this.notation.phasorangle){const Ge=a0(b),mt=(E.height+E.depth+2*Ge+re).toString(),St=(E.height+E.depth)/2;ye+=this.line(re.toString(),mt,(re+St+E.width).toString(),mt),ye+=this.line(re.toString(),mt,(re+St).toString(),(re-Ge).toString()),he+=Ge,we=St,E.left+=he/2-re}if(this.notation.longdiv){const Ge=a0(b);he+=Ge,ye+=this.line(re.toString(),re.toString(),(re+E.width).toString(),re.toString());const mt=.3;we=mt+Ge,E.left+=mt+Ge,E.setTop(re+Ge),ye+='<path d="',ye+=`M ${re} ${re} a${mt} ${(E.depth+E.height+2*Ge)/2}, 0, 1, 1, 0 ${E.depth+E.height+2*Ge} "`,ye+=` stroke-width="${am(b)}" stroke="${this.strokeColor}" fill="none"`,ye+="/>"}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),ye){let Ge="";this.shadow==="auto"&&(Ge+="filter: drop-shadow(0 0 .5px rgba(255, 255, 255, .7)) drop-shadow(1px 1px 2px #333)"),this.shadow!=="none"&&(Ge+=`filter: drop-shadow(${this.shadow})`),Ge+=` stroke-width="${this.strokeWidth}" stroke="${this.strokeColor}"`,Ge+=' stroke-linecap="round"',this.svgStrokeStyle&&(Ge+=` stroke-dasharray="${this.svgStrokeStyle}"`),ae.svgStyle=Ge,ae.svgOverlay=ye}const Ne=new or([ae,E]);return Ne.setStyle("position","relative"),Ne.setStyle("vertical-align",re,"em"),Ne.setStyle("height",`${Math.floor(100*(E.height+E.depth+2*re))/100}em`),Ne.setStyle("display","inline-block"),Ne.height=ae.height,Ne.depth=ae.depth,Ne.width=ae.width-2*re,Ne.left=re,Ne.right=re,this.caret&&(Ne.caret=this.caret),Ne.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 Bn{constructor(y,b,E){var ee,re;super(Me(Se({},E),{type:"genfrac",displayContainsHighlight:!0})),this.above=y,this.below=b,this.hasBarLine=(ee=E==null?void 0:E.hasBarLine)!=null?ee:!0,this.continuousFraction=(re=E==null?void 0:E.continuousFraction)!=null?re:!1,this.numerPrefix=E==null?void 0:E.numerPrefix,this.denomPrefix=E==null?void 0:E.denomPrefix,this.mathstyleName=E==null?void 0:E.mathstyleName,this.leftDelim=E==null?void 0:E.leftDelim,this.rightDelim=E==null?void 0:E.rightDelim,this.fractionNavigationOrder=E==null?void 0:E.fractionNavigationOrder}static fromJson(y){return new Wp(y.above,y.below,y)}toJson(){const y={};return this.continuousFraction&&(y.continuousFraction=!0),this.numerPrefix&&(y.numerPrefix=this.numerPrefix),this.denomPrefix&&(y.denomPrefix=this.denomPrefix),this.leftDelim&&(y.leftDelim=this.leftDelim),this.rightDelim&&(y.rightDelim=this.rightDelim),this.hasBarLine||(y.hasBarLine=!1),this.mathstyleName&&(y.mathstyleName=this.mathstyleName),this.fractionNavigationOrder&&(y.fractionNavigationOrder=this.fractionNavigationOrder),Se(Se({},super.toJson()),y)}get children(){if(this._children)return this._children;const y=[];if(this.fractionNavigationOrder==="denominator-numerator"){for(const b of this.below)y.push(...b.children),y.push(b);for(const b of this.above)y.push(...b.children),y.push(b)}else{for(const b of this.above)y.push(...b.children),y.push(b);for(const b of this.below)y.push(...b.children),y.push(b)}return this._children=y,y}render(y){var b,E;const ee=new 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),Bn.createBox(ae,this.above)],{isTight:ae.isTight,type:"ignore"}):(b=Bn.createBox(ae,this.above,{type:"ignore"}))!=null?b:new or(null,{type:"ignore"}),me=new Di({parent:ee,mathstyle:this.continuousFraction?"":"denominator"},this.style),ye=this.denomPrefix?new or([new or(this.denomPrefix),Bn.createBox(me,this.below,{type:"ignore"})]):(E=Bn.createBox(me,this.below,{type:"ignore"}))!=null?E:new or(null,{type:"ignore"}),we=this.hasBarLine?re.defaultRuleThickness:0;let Ne,Ge=0,mt;ee.isDisplayStyle?(Ne=ae.metrics.num1,Ge=we>0?3*we:7*we,mt=me.metrics.denom1):(we>0?(Ne=ae.metrics.num2,Ge=we):(Ne=ae.metrics.num3,Ge=3*re.defaultRuleThickness),mt=me.metrics.denom2);const St=[];this.isSelected&&St.push("ML__selected");const bn=he.depth,ir=ye.height;let yn;if(we<=0){const Vr=Ne-bn-(ir-mt);Vr<Ge&&(Ne+=(Ge-Vr)/2,mt+=(Ge-Vr)/2),yn=new Yi({individualShift:[{box:he,shift:-Ne,classes:[...St,"ML__center"]},{box:ye,shift:mt,classes:[...St,"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,ye.width),Vr.height=we/2,Vr.depth=we/2;const Ti=ro+we/2;Ne<Ge+bn+Ti&&(Ne=Ge+bn+Ti);const Ui=ro-we/2;mt<Ge+ir-Ui&&(mt=Ge+ir-Ui),yn=new Yi({individualShift:[{box:ye,shift:mt,classes:[...St,"ML__center"]},{box:Vr,shift:-Ui,classes:St},{box:he,shift:-Ne,classes:[...St,"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 Bn{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),Se({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 Bn{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=Bn.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 Bn{constructor(y,b){super(Me(Se({},b),{type:"extensible-symbol",isFunction:b==null?void 0:b.isFunction})),this.value=y,this.variant=b==null?void 0:b.variant,this.subsupPlacement=b==null?void 0:b.limits}static fromJson(y){return new Vp(y.symbol,y)}toJson(){const y=super.toJson();return this.variant&&(y.variant=this.variant),this.subsupPlacement&&(y.limits=this.subsupPlacement),this.isExtensibleSymbol&&(y.isExtensibleSymbol=!0),this.value&&(y.symbol=this.value),y}render(y){var b;const E=y.isDisplayStyle&&this.value!=="\\smallint",ee=new 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 me=(b=this.subsupPlacement)!=null?b:"auto";he=me==="over-under"||me==="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=Ue(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 Bn{constructor(y){const b=y.body;super(Me(Se({},y),{type:"overlap",body:typeof b=="string"?[new Bn({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),Se(Se({},super.toJson()),y)}render(y){const b=Bn.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 Bn{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):Bn.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=Bn.createBox(E,this.above,{type:"ignore"}));let re=null;this.svgBelow?re=No(this.svgBelow):this.below&&(re=Bn.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 Bn{constructor(y){var b,E,ee,re;super(Me(Se({},y),{type:"phantom"})),this.captureSelection=!0,this.isInvisible=(b=y.isInvisible)!=null?b:!1,this.smashDepth=(E=y.smashDepth)!=null?E:!1,this.smashHeight=(ee=y.smashHeight)!=null?ee:!1,this.smashWidth=(re=y.smashWidth)!=null?re:!1}static fromJson(y){return new Xp(y)}toJson(){const y={};return this.isInvisible&&(y.isInvisible=!0),this.smashDepth&&(y.smashDepth=!0),this.smashHeight&&(y.smashHeight=!0),this.smashWidth&&(y.smashWidth=!0),Se(Se({},super.toJson()),y)}render(y){const b=new Di({parent:y,isPhantom:!0});if(!this.smashDepth&&!this.smashHeight&&!this.smashWidth)return console.assert(this.isInvisible),Bn.createBox(b,this.body,{classes:"inner"});const E=Bn.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 Bn{constructor(y){var b;super(Se({type:"spacing"},y)),this.width=y==null?void 0:y.width,this._braced=(b=y==null?void 0:y.braced)!=null?b:!1}static fromJson(y){return new 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=Ue(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 Bn{constructor(y){var b;super(Me(Se({},y),{type:"surd",mode:(b=y.mode)!=null?b:"math",style:y.style,displayContainsHighlight:!0,body:y.body})),this.above=y.index}static fromJson(y){return new Jp(Me(Se({},y),{index:y.above}))}_serialize(y){if(!(y.expandMacro||y.skipStyles||y.skipPlaceholders)&&typeof this.verbatimLatex=="string")return this.verbatimLatex;const b=Ue(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=Bn.createBox(E,this.body,{type:"inner"}))!=null?b:new or(null),re=E.scalingFactor,ae=E.metrics.defaultRuleThickness/re,he=y.isDisplayStyle?hs:ae,me=new or(null,{classes:"ML__sqrt-line",style:this.style});me.height=ae,me.softWidth=ee.width;let ye=re*(ae+he/4);const Ne=Math.max(re*2*he,ee.height+ee.depth)+ye+ae,Ge=new Di({parent:y},this.style),mt=this.bind(Ge,new or(Rr("inner","\\surd",Ne,!1,Ge,{isSelected:this.isSelected}),{isSelected:this.isSelected,classes:"ML__sqrt-sign",style:this.style}));if(!mt)return null;const St=mt.height+mt.depth-ae;St>ee.height+ee.depth+ye&&(ye=(ye+St-(ee.height+ee.depth))/2),mt.setTop(mt.height-ee.height-ye);const bn=this.bind(y,new Yi({firstBaseline:[{box:new or(ee)},ye-2*ae,{box:me},ae]})),ir=Bn.createBox(new Di({parent:y,mathstyle:"scriptscriptstyle"}),this.above,{type:"ignore"});if(!ir){const dr=new or([mt,bn],{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(mt.height,bn.height)-Math.max(mt.depth,bn.depth)),children:[{box:ir}]}),Nn=new or([new or(yn,{classes:"ML__sqrt-index",type:"ignore"}),mt,bn],{type:"inner",classes:this.containsCaret?"ML__contains-caret":""});return Nn.height=mt.height,Nn.depth=mt.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 me,ye,we;if(!ae)return;const Ne=ae.type,Ge=he.isTight?(me=cm[Ne])!=null?me:null:(ye=lm[Ne])!=null?ye:null,mt=(we=Ge==null?void 0:Ge[he.type])!=null?we:null;mt===3&&bh(he,E),mt===4&&bh(he,ee),mt===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 Bn{constructor(y){super({type:"tooltip",command:y.command,mode:y.mode,style:y.style,body:y.body,displayContainsHighlight:!0}),this.tooltip=new Bn({type:"root",mode:y.content,body:y.tooltip,style:{}}),this.skipBoundary=!0,this.captureSelection=!1}static fromJson(y){return new qp(Me(Se({},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(Se({},super.toJson()),{tooltip:b})}render(y){const b=Bn.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 Bn{constructor(y,b){super(Me(Se({},b),{type:"operator",isFunction:b==null?void 0:b.isFunction})),this.value=y,this.variant=b==null?void 0:b.variant,this.variantStyle=b==null?void 0:b.variantStyle,this.subsupPlacement=b==null?void 0:b.limits}static fromJson(y){return new Qp(y.symbol,y)}toJson(){const y=super.toJson();return this.variant&&(y.variant=this.variant),this.variantStyle&&(y.variantStyle=this.variantStyle),this.subsupPlacement&&(y.limits=this.subsupPlacement),this.value&&(y.symbol=this.value),y}render(y){var b;const E=new 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=Ue(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(Te(a))return a.map(E=>Ol(E));if(typeof a=="string")return Bn.fromJson(a);a=Se({},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=Bn.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 Bn({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 ye=new Bn({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&&(ye.isFunction=!0),a.startsWith("\\")&&(ye.verbatimLatex=a),ye}const me=new Bn({type:"mord",mode:"math",command:(ae=y.command)!=null?ae:a,value:a,style:b});return he&&(me.isFunction=!0),a.startsWith("\\")&&(me.verbatimLatex=a),me}serialize(a,y){const b=gm(a,Me(Se({},y),{defaultMode:"math"}));return b.length===0||y.defaultMode!=="text"?b:["$ ",...b," $"]}getFont(a,y){console.assert(y.variant!==void 0);let{variant:b}=y,{variantStyle:E}=y;b==="normal"&&!E&&/[\u00A3\u0131\u0237]/.test(a.value)&&(b="main",E="italic"),b==="normal"&&!E&&a.value.length===1&&fm.forEach((he,me)=>{var ye;he.test(a.value)&&pm[(ye=y.letterShapeStyle)!=null?ye:"tex"][me]==="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=fn(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(me=>me._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(Se({},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 me=y.fontSeries.match(/(.?[lbm])?(.?[cx])?/);me&&(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=me[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=me[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:[")",")",")",")"]}},_m={id:"apple.french",locale:"fr",displayName:"French",platform:"apple",virtualLayout:"azerty",score:0,mapping:{KeyA:["q","Q","\u2021","\u03A9"],KeyB:["b","B","\xDF","\u222B"],KeyC:["c","C","\xA9","\xA2"],KeyD:["d","D","\u2202","\u2206"],KeyE:["e","E","\xEA","\xCA"],KeyF:["f","F","\u0192","\xB7"],KeyG:["g","G","\uFB01","\uFB02"],KeyH:["h","H","\xCC","\xCE"],KeyI:["i","I","\xEE","\xEF"],KeyJ:["j","J","\xCF","\xCD"],KeyK:["k","K","\xC8","\xCB"],KeyL:["l","L","\xAC","|"],KeyM:[",","?","\u221E","\xBF"],KeyN:["n","N","~","\u0131"],KeyO:["o","O","\u0153","\u0152"],KeyP:["p","P","\u03C0","\u220F"],KeyQ:["a","A","\xE6","\xC6"],KeyR:["r","R","\xAE","\u201A"],KeyS:["s","S","\xD2","\u2211"],KeyT:["t","T","\u2020","\u2122"],KeyU:["u","U","\xBA","\xAA"],KeyV:["v","V","\u25CA","\u221A"],KeyW:["z","Z","\xC2","\xC5"],KeyX:["x","X","\u2248","\u2044"],KeyY:["y","Y","\xDA","\u0178"],KeyZ:["w","W","\u2039","\u203A"],Digit1:["&","1","\uF8FF","\xB4"],Digit2:["\xE9","2","\xEB","\u201E"],Digit3:['"',"3","\u201C","\u201D"],Digit4:["'","4","\u2018","\u2019"],Digit5:["(","5","{","["],Digit6:["\xA7","6","\xB6","\xE5"],Digit7:["\xE8","7","\xAB","\xBB"],Digit8:["!","8","\xA1","\xDB"],Digit9:["\xE7","9","\xC7","\xC1"],Digit0:["\xE0","0","\xF8","\xD8"],Space:[" "," "," "," "],Minus:[")","\xB0","}","]"],Equal:["-","_","\u2014","\u2013"],BracketLeft:["^","\xA8","\xF4","\xD4"],BracketRight:["$","*","\u20AC","\xA5"],Backslash:["`","\xA3","@","#"],Semicolon:["m","M","\xB5","\xD3"],Quote:["\xF9","%","\xD9","\u2030"],Backquote:["<",">","\u2264","\u2265"],Comma:[";",".","\u2026","\u2022"],Period:[":","/","\xF7","\\"],Slash:["=","+","\u2260","\xB1"],NumpadDivide:["/","/","/","/"],NumpadMultiply:["*","*","*","*"],NumpadSubtract:["-","-","-","-"],NumpadAdd:["+","+","+","+"],NumpadDecimal:[",",".",",","."],IntlBackslash:["@","#","\u2022","\u0178"],NumpadEqual:["=","=","=","="]}},km={id:"windows.french",locale:"fr",displayName:"French",virtualLayout:"azerty",platform:"windows",score:0,mapping:{KeyA:["q","Q","",""],KeyB:["b","B","",""],KeyC:["c","C","",""],KeyD:["d","D","",""],KeyE:["e","E","\u20AC",""],KeyF:["f","F","",""],KeyG:["g","G","",""],KeyH:["h","H","",""],KeyI:["i","I","",""],KeyJ:["j","J","",""],KeyK:["k","K","",""],KeyL:["l","L","",""],KeyM:[",","?","",""],KeyN:["n","N","",""],KeyO:["o","O","",""],KeyP:["p","P","",""],KeyQ:["a","A","",""],KeyR:["r","R","",""],KeyS:["s","S","",""],KeyT:["t","T","",""],KeyU:["u","U","",""],KeyV:["v","V","",""],KeyW:["z","Z","",""],KeyX:["x","X","",""],KeyY:["y","Y","",""],KeyZ:["w","W","",""],Digit1:["&","1","",""],Digit2:["\xE9","2","~",""],Digit3:['"',"3","#",""],Digit4:["'","4","{",""],Digit5:["(","5","[",""],Digit6:["-","6","|",""],Digit7:["\xE8","7","`",""],Digit8:["_","8","\\",""],Digit9:["\xE7","9","^",""],Digit0:["\xE0","0","@",""],Space:[" "," ","",""],Minus:[")","\xB0","]",""],Equal:["=","+","}",""],BracketLeft:["^","\xA8","",""],BracketRight:["$","\xA3","\xA4",""],Backslash:["*","\xB5","",""],Semicolon:["m","M","",""],Quote:["\xF9","%","",""],Backquote:["\xB2","","",""],Comma:[";",".","",""],Period:[":","/","",""],Slash:["!","\xA7","",""],NumpadDivide:["/","/","",""],NumpadMultiply:["*","*","",""],NumpadSubtract:["-","-","",""],NumpadAdd:["+","+","",""],IntlBackslash:["<",">","",""]}},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(st()){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(Se({},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(_m),Ko(Tm),Ko(Lm);break;case"windows":Ko(d0),Ko(km),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(st()),E=a.split("+");let ee="";for(const re of E)ee&&(ee+=b?"\u2009":'<span class="ML__shortcut-join">+</span>'),re.startsWith("[Key")?ee+=re.slice(4,5):re.startsWith("Key")?ee+=re.slice(3,4):re.startsWith("[Digit")?ee+=re.slice(6,7):re.startsWith("Digit")?ee+=re.slice(5,6):ee+=(y={cmd:"\u2318",meta:b?"\u2318":"Ctrl",shift:b?"\u21E7":"Shift",alt:b?"\u2325":"Alt",ctrl:b?"\u2303":"Ctrl","\n":b?"\u23CE":"Return","[return]":b?"\u23CE":"Return","[enter]":b?"\u2324":"Enter","[tab]":b?"\u21E5":"Tab","[escape]":"Esc","[backspace]":b?"\u232B":"Backspace","[delete]":b?"\u2326":"Del","[pageup]":b?"\u21DE":"Page Up","[pagedown]":b?"\u21DF":"Page Down","[home]":b?"\u2912":"Home","[end]":b?"\u2913":"End","[space]":"Space","[equal]":"=","[minus]":"-","[comma]":",","[slash]":"/","[backslash]":"\\","[bracketleft]":"[","[bracketright]":"]",semicolon:";",period:".",comma:",",minus:"-",equal:"=",quote:"'",backslash:"\\",intlbackslash:"\\",backquote:"`",slash:"/",numpadmultiply:"* &#128290;",numpaddivide:"/ &#128290;",numpadsubtract:"- &#128290;",numpadadd:"+ &#128290;",numpaddecimal:". &#128290;",numpadcomma:", &#128290;",help:"help",left:"\u21E0",up:"\u21E1",right:"\u21E2",down:"\u21E3","[arrowleft]":"\u21E0","[arrowup]":"\u21E1","[arrowright]":"\u21E2","[arrowdown]":"\u21E3"}[re.toLowerCase()])!=null?y:re.toUpperCase();return ee}function 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 me=new AbortController,ye=me.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:ye}),a.addEventListener("keypress",we=>{re||(E&&ee&&b.onKeystroke(E),ee=we)},{capture:!0,signal:ye}),a.addEventListener("compositionstart",we=>{a.textContent="",re=!0,b.onCompositionStart(we.data)},{capture:!0,signal:ye}),a.addEventListener("compositionupdate",we=>{re&&b.onCompositionUpdate(we.data)},{capture:!0,signal:ye}),a.addEventListener("compositionend",we=>{a.textContent="",re&&(re=!1,b.onCompositionEnd(we.data))},{capture:!0,signal:ye}),a.addEventListener("beforeinput",we=>we.stopImmediatePropagation(),{signal:ye}),a.addEventListener("input",we=>{var Ne;if(!re&&(a.textContent="",we.inputType!=="insertCompositionText")){if(we.inputType==="insertFromPaste"){we.preventDefault(),we.stopPropagation();return}b.onInput((Ne=we.data)!=null?Ne:""),we.preventDefault(),we.stopPropagation()}},{signal:ye}),a.addEventListener("paste",we=>{a.focus({preventScroll:!0}),a.textContent="",b.onPaste(we)||we.preventDefault(),we.stopImmediatePropagation()},{signal:ye}),a.addEventListener("cut",we=>b.onCut(we),{capture:!0,signal:ye}),a.addEventListener("copy",we=>b.onCopy(we),{capture:!0,signal:ye}),a.addEventListener("blur",we=>{var Ne,Ge;if(((Ge=(Ne=we.relatedTarget)==null?void 0:Ne._mathfield)==null?void 0:Ge.element)===y){a.focus({preventScroll:!0}),we.preventDefault(),we.stopPropagation();return}const mt=Fs.state;if(mt==="open"||mt==="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:ye}),a.addEventListener("focus",we=>{he||ae||(ae=!0,b.onFocus(),ae=!1)},{capture:!0,signal:ye}),{dispose:()=>me.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 Ne;a.textContent=we,a.style.left="-1000px",(Ne=window.getSelection())==null||Ne.selectAllChildren(a)},moveTo:(we,Ne)=>{a.style.top=`${Ne}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(ht()){const y=st(),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(st()),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 Te(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];Te(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=st()==="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(Se({},a),{key:su(b)});const ee=Om(b.key,y);if(!ee)return Me(Se({},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(Se({},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 me of y)oe.test(me)&&re.push(new qa(me));let ae=a.at(a.position);if(ae instanceof ud&&(ae=ae.lastChild),!(ae.parent instanceof ud)){const me=new ud("");ae.parent.addChildAfter(me,ae),ae=me.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 me=a.at(E);ee=me instanceof qa&&me.isSuggestion,ee||E++}if(!ee)return[void 0,void 0];let ae=E,he=!1;for(;ae<=re&&!he;){const me=a.at(ae);he=!(me instanceof qa&&me.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=It(a,ae);if(he.length===0){if(/^\\[a-zA-Z\*]+$/.test(ae))for(const we of ee)we.isError=!0;uu(a);return}const me=(b=y==null?void 0:y.atIndex)!=null?b:0;a.suggestionIndex=me<0?he.length-1:me%he.length;const ye=he[a.suggestionIndex];if(ye!==ae){const we=ee[ee.length-1];we.parent.addChildrenAfter([...ye.slice(ae.length-ye.length)].map(Ne=>new qa(Ne,{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 ye=yd(a.model).filter(we=>we.isSuggestion);if(ye.length!==0){for(const we of ye)we.isSuggestion=!1;a.model.position=a.model.offsetOf(ye[ye.length-1])}if(y==="accept-suggestion")return ye.length!==0}const he=yd(a.model).filter(ye=>!ye.isSuggestion).map(ye=>ye.value).join(""),me=re.leftSibling;return re.parent.removeChild(re),a.model.position=a.model.offsetOf(me),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 Bn({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,me=Ym(a,ae),ye=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">${me}</span>`,ye&&(E+=`<span class="ML__popover__keybinding">${ye}</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"),_h(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 _h(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(()=>_h(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,me=window.mathVirtualKeyboard.boundingRect.height,ye=document.getElementById("mathlive-suggestion-popover");E.x+ye.offsetWidth/2>re-ae?ye.style.left=`${re-ye.offsetWidth-ae}px`:E.x-ye.offsetWidth/2<0?ye.style.left="0":ye.style.left=`${E.x-ye.offsetWidth/2}px`;const we=E.y-E.height;ee-he-me-E.y<we?(ye.classList.add("ML__popover--reverse-direction"),ye.classList.remove("top-tip"),ye.classList.add("bottom-tip"),ye.style.top=`${E.y-E.height-ye.offsetHeight-15}px`):(ye.classList.remove("ML__popover--reverse-direction"),ye.classList.add("top-tip"),ye.classList.remove("bottom-tip"),ye.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 kh=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(kh===null)try{const y=yield fetch(wf,{method:"HEAD"});y.status===200&&(kh=y.url)}catch(y){console.error(`Invalid URL "${a}" (relative to "${wf}")`)}return new URL(a,kh!=null?kh: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(me){}}))).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(Se({},a.context),{atomIdsSettings:{seed:y.forHighlighting?rg(Bn.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 me=a.options.contentPlaceholder;me&&(ae+=`<span part=placeholder class="ML__content-placeholder">${Va(me)}</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){_h(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 me=ad(a,Il(a,he),ae);if(me){me.left/=ae,me.right/=ae,me.top/=ae,me.bottom/=ae;const ye=document.createElement("div");ye.classList.add("ML__contains-highlight"),ye.style.position="absolute",ye.style.left=`${me.left+1}px`,ye.style.top=`${Math.ceil(me.top)}px`,ye.style.width=`${Math.ceil(me.right-me.left)}px`,ye.style.height=`${Math.ceil(me.bottom-me.top)}px`,b.insertBefore(ye,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 me=document.createElement("div");me.classList.add("ML__selection"),me.style.position="absolute",me.style.left=`${he.left}px`,me.style.top=`${he.top}px`,me.style.width=`${Math.ceil(he.right-he.left)}px`,me.style.height=`${Math.ceil(he.bottom-he.top-1)}px`,b.insertBefore(me,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=Se({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(Se({},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;Te(y)?(E=y[0],ee=y.slice(1)):E=y,E=E.replace(/-\w/g,ye=>ye[1].toUpperCase());const he=zs[E],me=he==null?void 0:he.target;if(me==="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(me==="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 me!=="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&&lt()&&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(Se({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:"&alpha;&beta;&gamma;",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.greek",rows:[[{label:"<i>&#x03c6;</i>",class:"MLK__tex hide-shift",insert:"\\varphi",aside:"phi var.",shift:"\\Phi"},{label:"<i>&#x03c2;</i>",class:"MLK__tex hide-shift",insert:"\\varsigma",aside:"sigma var.",shift:"\\Sigma"},{label:"<i>&#x03f5;</i>",class:"MLK__tex hide-shift",insert:"\\epsilon",aside:"espilon",shift:'\\char"0190'},{label:"<i>&rho;</i>",class:"MLK__tex hide-shift",insert:"\\rho",aside:"rho",shift:'\\char"3A1'},{label:"<i>&tau;</i>",class:"MLK__tex hide-shift",insert:"\\tau",aside:"tau",shift:'\\char"3A4'},{label:"<i>&upsilon;</i>",class:"MLK__tex hide-shift",insert:"\\upsilon",aside:"upsilon",shift:"\\Upsilon"},{label:"<i>&theta;</i>",class:"MLK__tex hide-shift",insert:"\\theta",aside:"theta",shift:"\\Theta"},{label:"<i>&iota;</i>",class:"MLK__tex hide-shift",insert:"\\iota",aside:"iota",shift:'\\char"399'},{label:"<i>&omicron;</i>",class:"MLK__tex hide-shift",insert:"\\omicron",aside:"omicron",shift:'\\char"39F'},{label:"<i>&pi;</i>",class:"MLK__tex hide-shift",insert:"\\pi",aside:"pi",shift:"\\Pi"}],["[separator-5]",{label:"<i>&alpha;</i>",class:"MLK__tex hide-shift",insert:"\\alpha",aside:"alpha",shift:'\\char"391'},{label:"<i>&sigma;</i>",class:"MLK__tex hide-shift",insert:"\\sigma",aside:"sigma",shift:"\\Sigma"},{label:"<i>&delta;</i>",class:"MLK__tex hide-shift",insert:"\\delta",aside:"delta",shift:"\\Delta"},{latex:"\\phi",class:"MLK__tex hide-shift",insert:"\\phi",aside:"phi",shift:"\\Phi"},{label:"<i>&gamma;</i>",class:"MLK__tex hide-shift",insert:"\\gamma",aside:"gamma",shift:"\\Gamma"},{label:"<i>&eta;</i>",class:"MLK__tex hide-shift",insert:"\\eta",aside:"eta",shift:'\\char"397'},{label:"<i>&xi;</i>",class:"MLK__tex hide-shift",insert:"\\xi",aside:"xi",shift:"\\Xi"},{label:"<i>&kappa;</i>",class:"MLK__tex hide-shift",insert:"\\kappa",aside:"kappa",shift:"\\Kappa"},{label:"<i>&lambda;</i>",class:"MLK__tex hide-shift",insert:"\\lambda",aside:"lambda",shift:"\\Lambda"},"[separator-5]"],["[shift]",{label:"<i>&zeta;</i>",class:"MLK__tex hide-shift",insert:"\\zeta",aside:"zeta",shift:'\\char"396'},{label:"<i>&chi;</i>",class:"MLK__tex hide-shift",insert:"\\chi",aside:"chi",shift:'\\char"3A7'},{label:"<i>&psi;</i>",class:"MLK__tex hide-shift",insert:"\\psi",aside:"zeta",shift:"\\Psi"},{label:"<i>&omega;</i>",class:"MLK__tex hide-shift",insert:"\\omega",aside:"omega",shift:"\\Omega"},{label:"<i>&beta;</i>",class:"MLK__tex hide-shift",insert:"\\beta",aside:"beta",shift:'\\char"392'},{label:"<i>&nu;</i>",class:"MLK__tex hide-shift",insert:"\\nu",aside:"nu",shift:'\\char"39D'},{label:"<i>&mu;</i>",class:"MLK__tex hide-shift",insert:"\\mu",aside:"mu",shift:'\\char"39C'},"[backspace]"],["[separator]",{label:"<i>&#x03b5;</i>",class:"MLK__tex",insert:"\\varepsilon",aside:"espilon var."},{label:"<i>&#x03d1;</i>",class:"MLK__tex",insert:"\\vartheta",aside:"theta var."},{label:"<i>&#x3f0;</i>",class:"MLK__tex",insert:"\\varkappa",aside:"kappa var."},{label:"<i>&#x03d6;</i>",class:"MLK__tex",insert:"\\varpi",aside:"pi var."},{label:"<i>&#x03f1;</i>",class:"MLK__tex",insert:"\\varrho",aside:"rho var."},"[left]","[right]","[action]"]]},symbols:{label:"&infin;\u2260\u2208",labelClass:"MLK__tex",tooltip:"keyboard.tooltip.symbols",rows:[[{latex:"\\sin",shift:"\\sin^{-1}",variants:[{class:"small",latex:"\\sinh"},{class:"small",latex:"\\sin^{-1}"},{class:"small",latex:"\\arsinh"}]},"\\ln",{latex:"\\mathrm{abs}",insert:"\\mathrm{abs}\\left(#0\\right)"},{latex:"\\rarr",shift:"\\rArr",variants:[{latex:"\\implies",aside:"implies"},{latex:"\\to",aside:"to"},"\\dashv",{latex:"\\roundimplies",aside:"round implies"}]},{latex:"\\exists",variants:["\\nexists"],shift:"\\nexists"},{latex:"\\in",shift:"\\notin",variants:["\\notin","\\owns"]},"\\cup",{latex:"\\overrightarrow{#@}",shift:"\\overleftarrow{#@}",variants:["\\overleftarrow{#@}","\\bar{#@}","\\vec{#@}","\\hat{#@}","\\check{#@}","\\dot{#@}","\\ddot{#@}","\\mathring{#@}","\\breve{#@}","\\acute{#@}","\\tilde{#@}","\\grave{#@}"]},{class:"small",latex:"\\lim_{#?}",shift:"\\lim_{x\\to\\infty}",variants:[{class:"small",latex:"\\liminf_{#?}"},{class:"small",latex:"\\limsup_{#?}"}]},"\\exponentialE"],[{latex:"\\cos",shift:"\\cos^{-1}",variants:[{class:"small",latex:"\\cosh"},{class:"small",latex:"\\cos^{-1}"},{class:"small",latex:"\\arcosh"}]},{latex:"\\log",shift:"\\log_{10}",variants:["\\log_{#0}","\\log_{10}"]},"\\left\\vert#0\\right\\vert",{latex:"\\larr",shift:"\\lArr",variants:[{latex:"\\impliedby",aside:"implied by"},{latex:"\\gets",aside:"gets"},"\\lArr","\\vdash",{latex:"\\models",aside:"models"}]},{latex:"\\forall",shift:"\\lnot",variants:[{latex:"\\land",aside:"and"},{latex:"\\lor",aside:"or"},{latex:"\\oplus",aside:"xor"},{latex:"\\lnot",aside:"not"},{latex:"\\downarrow",aside:"nor"},{latex:"\\uparrow",aside:"nand"},{latex:"\\curlywedge",aside:"nor"},{latex:"\\bar\\curlywedge",aside:"nand"}]},{latex:"\\ni",shift:"\\not\\owns"},"\\cap",{latex:"\\overline{#@}",shift:"\\underline{#@}",variants:["\\overbrace{#@}","\\overlinesegment{#@}","\\overleftrightarrow{#@}","\\overrightarrow{#@}","\\overleftarrow{#@}","\\overgroup{#@}","\\underbrace{#@}","\\underlinesegment{#@}","\\underleftrightarrow{#@}","\\underrightarrow{#@}","\\underleftarrow{#@}","\\undergroup{#@}"]},{class:"hide-shift",latex:"\\int",shift:"\\iint",variants:[{latex:"\\int_{#?}^{#?}",class:"small"},{latex:"\\int",class:"small"},{latex:"\\smallint",class:"small"},{latex:"\\iint",class:"small"},{latex:"\\iiint",class:"small"},{latex:"\\oint",class:"small"},"\\intop","\\iiint","\\oiint","\\oiiint","\\intclockwise","\\varointclockwise","\\ointctrclockwise","\\intctrclockwise"]},{latex:"\\pi",shift:"\\tau",variants:["\\tau"]}],[{latex:"\\tan",shift:"\\tan^{-1}",variants:[{class:"small",latex:"\\tanh"},{class:"small",latex:"\\tan^{-1}"},{class:"small",latex:"\\artanh"},{class:"small",latex:"\\arctan"},{class:"small",latex:"\\arctg"},{class:"small",latex:"\\tg"}]},{latex:"\\exp",insert:"\\exp\\left(#0\\right)",variants:["\\exponentialE^{#0}"]},"\\left\\Vert#0\\right\\Vert",{latex:"\\lrArr",shift:"\\leftrightarrow",variants:[{latex:"\\iff",aside:"if and only if"},"\\leftrightarrow","\\leftrightarrows","\\Leftrightarrow",{latex:"^\\biconditional",aside:"biconditional"}]},{latex:"\\vert",shift:"!"},{latex:"#@^{\\complement}",aside:"complement",variants:[{latex:"\\setminus",aside:"set minus"},{latex:"\\smallsetminus",aside:"small set minus"}]},{latex:"\\subset",shift:"\\subseteq",variants:["\\subset","\\subseteq","\\subsetneq","\\varsubsetneq","\\subsetneqq","\\nsubset","\\nsubseteq","\\supset","\\supseteq","\\supsetneq","\\supsetneqq","\\nsupset","\\nsupseteq"]},{latex:"#@^{\\prime}",shift:"#@^{\\doubleprime}",variants:["#@^{\\doubleprime}","#@\\degree"]},{latex:"\\mathrm{d}",shift:"\\partial",variants:["\\mathrm{d}x",{latex:"\\dfrac{\\mathrm{d}}{\\mathrm{d} x}",class:"small"},{latex:"\\frac{\\partial}{\\partial x}",class:"small"},"\\partial"]},{latex:"\\infty",variants:["\\aleph_0","\\aleph_1","\\omega","\\mathfrak{m}"]}],[{label:"[shift]",width:2},{class:"box",latex:",",shift:";",variants:[";","?"]},{class:"box",latex:"\\colon",shift:"\\Colon",variants:[{latex:"\\Colon",aside:"such that",class:"box"},{latex:":",aside:"ratio",class:"box"},{latex:"\\vdots",aside:"",class:"box"},{latex:"\\ddots",aside:"",class:"box"},{latex:"\\ldotp",aside:"low dot",class:"box"},{latex:"\\cdotp",aside:"center dot",class:"box"},{latex:"\\ldots",aside:"low ellipsis",class:"box"},{latex:"\\cdots",aside:"center ellipsis",class:"box"},{latex:"\\therefore",aside:"therefore",class:"box"},{latex:"\\because",aside:"because",class:"box"}]},{class:"box",latex:"\\cdot",aside:"centered dot",shift:"\\ast",variants:["\\circ","\\bigcirc","\\bullet","\\odot","\\oslash","\\circledcirc","\\ast","\\star","\\times","\\doteq","\\doteqdot"]},"[separator]","[left]","[right]",{label:"[backspace]",width:1,class:"action hide-shift"},{label:"[action]",width:1}]]},compact:{label:"compact",rows:[["[+]","[-]","[*]","[/]","[=]","[.]","[(]","[)]","\\sqrt{#0}","#@^{#?}"],["[1]","[2]","[3]","[4]","[5]","[6]","[7]","[8]","[9]","[0]"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]},minimalist:{label:"minimalist",layers:[{style:`
.minimalist-backdrop {
display: flex;
justify-content: center;
}
.minimalist-container {
--keycap-height: 40px;
--keycap-max-width: 53px;
--keycap-small-font-size: 12px;
background: var(--keyboard-background);
padding: 20px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
border: 1px solid var(--keyboard-border);
box-shadow: 0 0 32px rgb(0 0 0 / 30%);
}
`,backdrop:"minimalist-backdrop",container:"minimalist-container",rows:[["+","-","\\times",{latex:"\\frac{#@}{#0}",class:"small"},"=","[.]","(",")",{latex:"\\sqrt{#0}",class:"small"},{latex:"#@^{#?}",class:"small"}],["1","2","3","4","5","6","7","8","9","0"],["[hr]"],["[undo]","[redo]","[separator]","[separator]","[separator]","[left]","[right]",{label:"[backspace]",class:"action hide-shift"},"[hide-keyboard]"]]}]},"numeric-only":{label:"123",labelClass:"MLK__tex-math",tooltip:"keyboard.tooltip.numeric",id:"numeric-only",rows:[["7","8","9","[separator]",{label:"[backspace]",width:2}],["4","5","6","[separator]","[separator]","[separator]"],["1","2","3","[separator]","[separator]","[separator]"],["0",{label:"[.]",variants:[]},"-","[separator]","[left]","[right]"]]}},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"&&!_0(he)||Array.isArray(he)&&he.length===0){y==null||y();return}const me={};let ye="";for(const bn of hg(he)){const ir=E0(bn),yn=Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);me[yn]=ir;const[Nn,dr]=Th(ir);ye+=`<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 Ne=Object.keys(me).length;let Ge=5;Ne===1?Ge=1:Ne===2||Ne===4?Ge=2:Ne===3||Ne===5||Ne===6?Ge=3:Ne>=7&&Ne<14&&(Ge=4),we.style.width=`calc(var(--variant-keycap-length) * ${Ge} + 12px)`,we.innerHTML=vp.createHTML(ye),Fs.open({root:(ee=re==null?void 0:re.container)==null?void 0:ee.querySelector(".ML__keyboard"),child:we}),xd=new AbortController;const{signal:mt}=xd,St=a==null?void 0:a.getBoundingClientRect();if(St){St.top-we.clientHeight<0&&(we.style.width="auto",Ne<=6?we.style.height="56px":Ne<=12?we.style.height="108px":Ne<=18?we.style.height="205px":we.classList.add("compact"));const bn=Math.max(0,Math.min(window.innerWidth-we.offsetWidth,(St.left+St.right-we.offsetWidth)/2)),ir=St.top-we.clientHeight+5;we.style.transform=`translate(${bn}px, ${ir}px)`,we.classList.add("is-visible"),requestAnimationFrame(()=>{we.addEventListener("pointerup",yn=>{const Nn=hu(yn.target);!(Nn!=null&&Nn.id)||!me[Nn.id]||(Mf(me[Nn.id]),wd(),y==null||y(),yn.preventDefault())},{capture:!0,passive:!1,signal:mt}),we.addEventListener("pointerenter",yn=>{const Nn=hu(yn.target);!(Nn!=null&&Nn.id)||!me[Nn.id]||Nn.classList.add("is-active")},{capture:!0,signal:mt}),we.addEventListener("pointerleave",yn=>{const Nn=hu(yn.target);!(Nn!=null&&Nn.id)||!me[Nn.id]||Nn.classList.remove("is-active")},{capture:!0,signal:mt}),window.addEventListener("pointercancel",()=>{wd(),y==null||y()},{signal:mt}),window.addEventListener("pointerup",()=>{wd(),y==null||y()},{signal:mt})})}}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(et))y.push({class:"swatch-button",label:'<span style="border: 3px solid '+et[b]+'"></span>',command:["applyStyle",{color:b}]});return y}if(a==="background-color"){const y=[];for(const b of Object.keys(We))y.push({class:"swatch-button",label:'<span style="background:'+We[b]+'"></span>',command:["applyStyle",{backgroundColor:b}]});return y}}function _0(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 Bn({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"}[at.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 me=[];for(const ye of he)/[a-z]/.test(ye)?me.push({label:ye,class:"hide-shift",shift:{label:ye.toUpperCase()},variants:_0(ye)?ye:void 0}):ye==="~"?E!=="dvorak"?me.push("[backspace]"):me.push({label:"[backspace]",width:1}):ye==="^"?me.push("[shift]"):ye===" "&&me.push("[separator-5]");ae.push(me)}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 k0(a){if(a==="alphabetic")return mg();if(typeof a=="string")return console.assert(C0[a]!==void 0,`MathLive 0.98.5: unknown keyboard layout "${a}"`),k0(C0[a]);let y;if("rows"in a&&Array.isArray(a.rows)){console.assert(!("layers"in a||"markup"in a),'MathLive 0.98.5: when providing a "rows" property, "layers" and "markup" are ignored');const ee=a,{rows:re}=ee,ae=rt(ee,["rows"]);y=Me(Se({},ae),{layers:Cd({rows:a.rows})})}else if("markup"in a&&typeof a.markup=="string"){const ee=a,{markup:re}=ee,ae=rt(ee,["markup"]);y=Me(Se({},ae),{layers:Cd(a.markup)})}else y=Se({},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,me=[re===y?"selected":"layer-switch"];he.tooltip&&me.push("MLK__tooltip"),he.labelClass&&me.push(...he.labelClass.split(" ")),ee+=`<div class="${me.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",kg,{passive:!1});const ee=y.querySelectorAll(".ML__edit-toolbar");if(ee)for(const ae of ee)ae.addEventListener("click",he=>{var me,ye;let we=he.target,Ne="";for(;we&&!Ne;)Ne=(me=we==null?void 0:we.getAttribute("data-command"))!=null?me:"",we=(ye=we==null?void 0:we.parentElement)!=null?ye:null;Ne&&a.executeCommand(JSON.parse(Ne))});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(_g(a,ee)),E.push("</div>");return E.join("")}function _g(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,me;let ye="",we=(b=a.class)!=null?b:"";if(y.shifted&&fu(a)&&(we+=" is-active"),y.shifted&&"shift"in a)typeof a.shift=="string"?ye=Sd(a.shift):typeof a.shift=="object"&&(ye=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(ye=a.label?a.label:(ae=Sd(a.latex||a.insert||"")||a.key)!=null?ae:"",a.shift){let Ne;typeof a.shift=="string"?Ne=Sd(a.shift):a.shift.label?Ne=a.shift.label:Ne=(he=Sd(a.shift.latex||a.shift.insert||"")||a.shift.key)!=null?he:"",ye+=`<span class="MLK__shift">${Ne}</span>`}a.aside&&(ye+=`<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+=(me={0:" w0",.5:" w5",1.5:" w15",2:" w20",5:" w50"}[a.width])!=null?me:""),[ye,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:"&#x2212;",shift:"\\pm",class:"big-op hide-shift"},"[/]":{class:"big-op hide-shift",shift:{class:"",latex:"\\frac{1}{#@}"},variants:["/","\\div","\\%","\\oslash"],latex:"\\frac{#@}{#?}",label:"&divide;"},"[*]":{variants:[{latex:"\\prod_{#0}^{#0}",class:"small"},"\\otimes","\\cdot"],latex:"\\cdot",label:"&times;",shift:{latex:"\\times"},class:"big-op hide-shift"},"[=]":{variants:["\\neq","\\equiv","\\varpropto","\\thickapprox","\\lt","\\gt","\\le","\\ge"],latex:"=",label:"=",shift:{label:"\u2260",latex:"\\ne"},class:"big-op hide-shift"},"[backspace]":{class:"action bottom right hide-shift",width:1.5,command:["performWithFeedback","deleteBackward"],label:"<svg class=svg-glyph><use xlink:href=#svg-delete-backward /></svg>",shift:{class:"action warning",label:"<svg class=svg-glyph><use xlink:href=#svg-trash /></svg>",command:"deleteAll"}},"[undo]":{class:"ghost if-can-undo",command:"undo",label:"<svg class=svg-glyph><use xlink:href=#svg-undo /></svg>",tooltip:"tooltip.undo"},"[redo]":{class:"ghost if-can-redo",command:"redo",label:"<svg class=svg-glyph><use xlink:href=#svg-redo /></svg>",tooltip:"tooltip.redo"},"[(]":{variants:[{latex:"\\lbrack",key:"["},"\\langle","\\lfloor","\\lceil",{latex:"\\lbrace",key:"{"}],key:"(",label:"(",shift:{label:"[",key:"["},class:"hide-shift"},"[)]":{variants:[{latex:"\\rbrack",key:"]"},"\\rangle","\\rfloor","\\rceil",{latex:"\\rbrace",key:"]"}],key:")",label:")",shift:{label:"]",latex:"\\rbrack"},class:"hide-shift"},"[0]":{variants:"0",latex:"0",label:"0",shift:"\\infty",class:"hide-shift"},"[1]":{variants:"1",latex:"1",label:"1",shift:"#@^{-1}",class:"hide-shift"},"[2]":{variants:"2",latex:"2",label:"2",shift:"#@^2",class:"hide-shift"},"[3]":{variants:"3",latex:"3",label:"3",shift:"#@^3",class:"hide-shift"},"[4]":{variants:"4",latex:"4",label:"4",shift:"#@^4",class:"hide-shift"},"[5]":{variants:"5",latex:"5",label:"5",shift:"#@^5",class:"hide-shift"},"[6]":{variants:"6",latex:"6",label:"6",shift:"#@^6",class:"hide-shift"},"[7]":{variants:"7",latex:"7",label:"7",shift:"#@^7",class:"hide-shift"},"[8]":{variants:"8",latex:"8",label:"8",shift:"#@^8",class:"hide-shift"},"[9]":{variants:"9",latex:"9",label:"9",shift:"#@^9",class:"hide-shift"},"[separator-5]":{class:"separator",width:.5},"[separator]":{class:"separator"},"[separator-10]":{class:"separator"},"[separator-15]":{class:"separator",width:1.5},"[separator-20]":{class:"separator",width:2},"[separator-50]":{class:"separator",width:5},"[shift]":{class:"shift bottom left",width:1.5,label:"<span class=caps-lock-indicator></span><svg class=svg-glyph><use xlink:href=#svg-shift /></svg>"},"[foreground-color]":{variants:"foreground-color",command:["applyStyle",{color:"red"}],label:"<span style='border-radius: 50%;width:22px;height:22px; border: 3px solid #cc2428; box-sizing: border-box'>"},"[background-color]":{variants:"background-color",command:["applyStyle",{backgroundColor:"yellow"}],label:"<span style='border-radius: 50%;width:22px;height:22px; background:#fff590; box-sizing: border-box'></span>"}};function 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(Se(Se({},mc[a.label]),a),{label:mc[a.label].label})),"key"in a&&a.key&&mc[a.key]&&(b=Me(Se(Se({},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=Se(Se({},b),window.mathVirtualKeyboard.actionKeycap)),a.label==="[shift]"&&(b=Se(Se({},b),window.mathVirtualKeyboard.shiftKeycap)),a.label==="[backspace]"&&(b=Se(Se({},b),window.mathVirtualKeyboard.backspaceKeycap)),a.label==="[tab]"&&(b=Se(Se({},b),window.mathVirtualKeyboard.tabKeycap)),b):a}var Md;function kg(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"&&Je()&&this.show({animate:!0})},300)}),document.addEventListener("focusout",ee=>{ee.target.mathVirtualKeyboardPolicy!=="manual"&&setTimeout(()=>{L0()||this.hide()},300)})}get currentLayer(){var y,b,E;return(E=(b=(y=this._element)==null?void 0:y.querySelector(".MLK__layer.is-visible"))==null?void 0:b.id)!=null?E:""}set currentLayer(y){var b;if(!this._element){this.latentLayer=y;return}let E=y?this._element.querySelector(`#${y}.MLK__layer`):null;E||(E=this._element.querySelector(".MLK__layer")),E&&((b=this._element.querySelector(".MLK__layer.is-visible"))==null||b.classList.remove("is-visible"),E.classList.add("is-visible")),this.render()}get shiftPressCount(){return this._shiftPressCount}set shiftPressCount(y){var b;this._shiftPressCount=y>2||y<0?0:y,(b=this._element)==null||b.classList.toggle("is-caps-lock",this.shiftPressCount===2),this.render()}get isShifted(){return this._shiftPressCount>0}resetKeycapRegistry(){this.keycapRegistry={}}registerKeycap(y){const b="ML__k"+Date.now().toString(36).slice(-2)+Math.floor(Math.random()*1e5).toString(36);return this.keycapRegistry[b]=y,b}getKeycap(y){return y?this.keycapRegistry[y]:void 0}getLayer(y){const b=this.normalizedLayouts;for(const E of b)for(const ee of E.layers)if(ee.id===y)return ee}get alphabeticLayout(){return this._alphabeticLayout}set alphabeticLayout(y){this._alphabeticLayout=y,this.rebuild()}get actionKeycap(){return this._actionKeycap}set actionKeycap(y){this._actionKeycap=typeof y=="string"?{label:y}:y}get shiftKeycap(){return this._shiftKeycap}set shiftKeycap(y){this._shiftKeycap=typeof y=="string"?{label:y}:y}get backspaceKeycap(){return this._backspaceKeycap}set backspaceKeycap(y){this._backspaceKeycap=typeof y=="string"?{label:y}:y}get tabKeycap(){return this._tabKeycap}set tabKeycap(y){this._tabKeycap=typeof y=="string"?{label:y}:y}get layouts(){return this._layouts}set layouts(y){this.updateNormalizedLayouts(y),this.rebuild()}updateNormalizedLayouts(y){const b=Array.isArray(y)?[...y]:[y],E=b.findIndex(ee=>ee==="default");E>=0&&b.splice(E,1,"numeric","symbols","alphabetic","greek"),this._layouts=Object.freeze(b),this._normalizedLayouts=b.map(ee=>k0(ee))}get normalizedLayouts(){return this._normalizedLayouts||this.updateNormalizedLayouts(this._layouts),this._normalizedLayouts}get editToolbar(){return this._editToolbar}set editToolbar(y){this._editToolbar=y,this.rebuild()}get container(){return this._container}set container(y){this._container=y,this.rebuild()}static get singleton(){if(this._singleton===void 0)try{this._singleton=new tm}catch(y){this._singleton=null}return this._singleton}get style(){return this._style}addEventListener(y,b,E){this.listeners[y]||(this.listeners[y]=new Set),this.listeners[y].has(b)||this.listeners[y].add(b)}dispatchEvent(y){return!this.listeners[y.type]||this.listeners[y.type].size===0?!0:(this.listeners[y.type].forEach(b=>{typeof b=="function"?b(y):b==null||b.handleEvent(y)}),!y.defaultPrevented)}removeEventListener(y,b,E){this.listeners[y]&&this.listeners[y].delete(b)}get element(){return this._element}set element(y){var b;this._element!==y&&((b=this._element)==null||b.remove(),this._element=y)}get visible(){return this._visible}set visible(y){y?this.show():this.hide()}get boundingRect(){var y;if(!this._visible)return new DOMRect;const b=(y=this._element)==null?void 0:y.getElementsByClassName("MLK__plate")[0];return b?b.getBoundingClientRect():new DOMRect}adjustBoundingRect(){var y,b;const E=this.boundingRect.height;if(this.container===document.body){(y=this._element)==null||y.style.setProperty("--_keyboard-height",`calc(${E}px + var(--_padding-top) + var(--_padding-bottom) + env(safe-area-inset-bottom, 0))`);const ee=E-1;this.container.style.paddingBottom=this.originalContainerBottomPadding?`calc(${this.originalContainerBottomPadding} + ${ee}px)`:`${ee}px`}else(b=this._element)==null||b.style.setProperty("--_keyboard-height",`${E}px`)}rebuild(){if(this._rebuilding||!this._element)return;this._rebuilding=!0;const y=this.currentLayer;requestAnimationFrame(()=>{this._rebuilding=!1,this._element&&(this._element.remove(),this._element=void 0),this.visible&&(this.buildAndAttachElement(),this.currentLayer=y,this.render(),this.adjustBoundingRect(),this._element.classList.add("is-visible"))})}render(){if(!this._element)return;const y=this.getLayer(this.currentLayer);this._element.classList.toggle("backdrop-is-transparent",!!(y&&(y.backdrop||y.container)));const b=this._element.querySelectorAll(".MLK__layer.is-visible .MLK__keycap, .MLK__layer.is-visible .action, .fnbutton, .MLK__layer.is-visible .bigfnbutton, .MLK__layer.is-visible .shift");if(b)for(const E of b){const ee=this.getKeycap(E.id);if(ee){const[re,ae]=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:Se({type:Dh,action:y},b)}));return}if(E)E.postMessage(Se({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 Te(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(ht()&&!("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(Te(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"?at.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=ze(a.macros);break;default:Te(a[b])?y[b]=[...a[b]]:typeof a[b]=="object"&&!(a[b]instanceof Element)&&b!=="computeEngine"?y[b]=Se({},a[b]):y[b]=a[b]}return y}function 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:Te(a[ee])?E[ee]=[...a[ee]]:typeof a[ee]=="object"&&!(a[ee]instanceof Element)&&ee!=="computeEngine"?E[ee]=Se({},a[ee]):E[ee]=a[ee];return typeof y=="string"?E[y]:E}function Bh(){return{readOnly:!1,defaultMode:"math",macros:{},registers:{},colorMap:Kt,backgroundColorMap:ut,letterShapeStyle:at.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||(Te(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 _f(a,y,b,E){function ee(ae,he){for(const me of re)if(me.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)}hn(["math","displaymath"],qo),hn("center",qo),vt("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"}]})}),_n("array","{columns:colspec}",(a,y,b,E)=>new hi(a,kf(y),b,{columns:E[0],mathstyleName:"textstyle"})),_n(["equation","equation*","subequations"],"",(a,y,b)=>new hi(a,kf(y),b,{columns:[{align:"c"}]})),_n(["multline","multline*"],"",qo),_n(["align","align*","aligned","eqnarray"],"",qo),_n("split","",qo),_n(["gather","gathered"],"",qo),_n(["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],"[columns:colspec]",qo),_n(["smallmatrix","smallmatrix*"],"[columns:colspec]",qo),_n(["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 kf(a,y=1){return Ag(a)?Array(y).fill([[new Bn({type:"first"}),new Qr]]):a.map(b=>b.length===0?[[new Bn({type:"first"})]]:b.map(E=>E.length===0?[new Bn({type:"first"})]:(E[0].type!=="first"&&E.unshift(new Bn({type:"first"})),E)))}function qo(a,y=[[[]]],b=[],E=[]){switch(y=kf(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 me=ee.leftDelim,ye=ee.rightDelim;me==="("&&(ye===")"||ye==="?")?he="pmatrix":(me==="["||me==="\\lbrack")&&(ye==="]"||ye==="\\rbrack"||ye==="?")?he="bmatrix":me==="\\vert"&&ye==="\\vert"?he="vmatrix":me==="\\Vert"&&ye==="\\Vert"?he="Vmatrix":(me==="{"||me==="\\lbrace")&&(ye==="."||ye==="?")&&(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(pe.test(a.at(y).value)){let re=y,ae;do ae=a.at(re).mode==="text"&&pe.test(a.at(re).value),re+=E;while(a.at(re)&&ae);ee=a.at(re)?re-2*E:re-E}else if(/\s/.test(a.at(y).value)){let re=y;for(;a.at(re)&&a.at(re).mode==="text"&&/\s/.test(a.at(re).value);)re+=E;if(!a.at(re))ee=re-E;else{let ae=!0;do ae=a.at(re).mode==="text"&&!/\s/.test(a.at(re).value),re+=E;while(a.at(re)&&ae);ee=a.at(re)?re-2*E:re-E}}else{let re=y;for(;a.at(re)&&a.at(re).mode==="text"&&!/\s/.test(a.at(re).value);)re+=E;ee=a.at(re)?re:re-E;let ae=!0;for(;a.at(re)&&ae;)ae=a.at(re).mode==="text"&&/\s/.test(a.at(re).value),ae&&(ee=re),re+=E;ee=a.at(re)?re-2*E:re-E}return ee-(E>0?0:1)}function pu(a,y,b){var E,ee,re,ae,he,me,ye;const we=a.position;(E=b==null?void 0:b.extend)!=null&&E||a.collapseSelection(y);let Ne=a.at(a.position);if(y==="forward"&&(Ne.type==="subsup"?(Ne=Ne.rightSibling,Ne||(Ne=a.at(a.position+1))):Ne=a.at(a.position+1)),!Ne)return a.announce("plonk"),!1;let Ge=a.offsetOf(Ne);if(Ne instanceof vs)Ge=Ef(a,Ge,y);else if(Ne instanceof qa)if(Ne.isSuggestion)for(console.assert(y==="forward");Ne&&Ne instanceof qa;)Ne.isSuggestion=!1,Ge=a.offsetOf(Ne),Ne=Ne.rightSibling;else if(y==="forward"){if(Ne=Ne.rightSibling,!Ne||!(Ne instanceof qa))return a.announce("plonk"),!1;for(;Ne&&Ne instanceof qa&&/[a-zA-Z\*]/.test(Ne.value);)Ge=a.offsetOf(Ne),Ne=Ne.rightSibling}else{if(Ne=Ne.leftSibling,!Ne||!(Ne instanceof qa))return a.announce("plonk"),!1;for(;Ne&&Ne instanceof qa&&/[a-zA-Z\*]/.test(Ne.value);)Ge=a.offsetOf(Ne),Ne=Ne.leftSibling}else if(y==="forward"&&Ne.type==="mopen"){let mt=0;do Ne.type==="mopen"?mt+=1:Ne.type==="mclose"&&(mt-=1),Ne=Ne.rightSibling;while(!Ne.isLastSibling&&mt!==0);Ge=a.offsetOf(Ne.leftSibling)}else if(y==="backward"&&Ne.type==="mclose"){let mt=0;do Ne.type==="mopen"?mt+=1:Ne.type==="mclose"&&(mt-=1),Ne=Ne.leftSibling;while(!Ne.isFirstSibling&&mt!==0);Ge=a.offsetOf(Ne)}else if(y==="backward")if(Ne.type==="first")for(;Ge>0&&Ne.type==="first";)Ge-=1,Ne=a.at(Ge);else{const mt=Ne.type;Ne.type==="subsup"&&(Ge=a.offsetOf(a.at(Ge).leftSibling)),Ge-=1;let St=(ee=a.at(Ge))==null?void 0:ee.type;for(;Ge>=0&&St===mt;)((re=a.at(Ge))==null?void 0:re.type)==="subsup"?Ge=a.offsetOf(a.at(Ge).leftSibling):Ge-=1,St=a.at(Ge).type}else{const{type:mt}=Ne;let St=(ae=a.at(Ge))==null?void 0:ae.type;const{lastOffset:bn}=a;for(;Ge<=bn&&(St===mt||St==="subsup");){for(;((he=a.at(Ge).rightSibling)==null?void 0:he.type)==="subsup";)Ge=a.offsetOf(a.at(Ge).rightSibling);Ge+=1,St=(me=a.at(Ge))==null?void 0:me.type}Ge-=1}if((ye=b==null?void 0:b.extend)!=null&&ye){if(!a.setSelection(a.anchor,Ge))return a.announce("plonk"),!1}else{if(Ge===a.position)return a.announce("plonk"),!1;a.position=Ge}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,me]=g0(a);he!==void 0&&me!==void 0&&a.deleteAtoms([he,me])}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 me=a.setSelection(a.anchor,he);return a.mathfield.stopCoalescingUndo(),me}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(ye=>ye.type==="prompt"&&!ye.captureSelection):b,he=ru(a.mathfield.getHTMLElement(y)).right,me=a.offsetOf(Ng(a.mathfield,ae,he))-(re?1:0);if(E){const[ye,we]=a.selection.ranges[0];let Ne;me<(ee==="up"?ye:we)?Ne={ranges:[[me,we]],direction:"backward"}:Ne={ranges:[[ye,me]],direction:"forward"},a.setSelection(Ne)}else a.setPositionHandlingPlaceholder(me);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 me,ye;let we=!0;return a.silenceNotifications||(we=(ye=(me=a.mathfield.host)==null?void 0:me.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"upward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?ye:!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 me=he.parent;if(he.parentBranch[0]<1)return re();const ye=he.parentBranch[0]-1,we=me.array[ye][he.parentBranch[1]];if(!we.some(Ge=>Ge.type==="prompt"&&!Ge.captureSelection)&&a.mathfield.hasEditablePrompts)return re();Fh(a,ae,we,ee,"up")}else if(he){const me=(E=he.parent.branch("above"))!=null?E:he.parent.createBranch("above");if(!me.some(we=>we.type==="prompt"&&we.placeholderId)&&a.mathfield.hasEditablePrompts)return re();Fh(a,ae,me,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 me,ye;let we=!0;return a.silenceNotifications||(we=(ye=(me=a.mathfield.host)==null?void 0:me.dispatchEvent(new CustomEvent("move-out",{detail:{direction:"downward"},cancelable:!0,bubbles:!0,composed:!0})))!=null?ye:!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 me=he.parent;if(he.parentBranch[0]+1>me.array.length-1)return re();const ye=he.parentBranch[0]+1,we=me.array[ye][he.parentBranch[1]];if(!we.some(Ge=>Ge.type==="prompt"&&!Ge.captureSelection)&&a.mathfield.hasEditablePrompts)return re();Fh(a,ae,we,ee,"down")}else if(he){const me=(E=he.parent.branch("below"))!=null?E:he.parent.createBranch("below");if(!me.some(we=>we.type==="prompt")&&a.mathfield.hasEditablePrompts)return re();Fh(a,ae,me,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(me){const ye=[],we=[];return[...me.querySelectorAll(`input, select, textarea, a[href], button,
[tabindex], audio[controls], video[controls],
[contenteditable]:not([contenteditable="false"]), details>summary`)].filter(y).forEach((Ge,mt)=>{const St=E(Ge);St===0?ye.push(Ge):we.push({documentOrder:mt,tabIndex:St,node:Ge})}),we.sort((Ge,mt)=>Ge.tabIndex===mt.tabIndex?Ge.documentOrder-mt.documentOrder:Ge.tabIndex-mt.tabIndex).map(Ge=>Ge.node).concat(ye)}function y(me){return!(!b(me)||ee(me)||E(me)<0)}function b(me){return!(me.disabled||me.type==="hidden"&&me.tagName.toUpperCase()==="INPUT"||he(me))}function E(me){var ye;const we=Number.parseInt((ye=me.getAttribute("tabindex"))!=null?ye:"NaN",10);return Number.isNaN(we)?me.contentEditable==="true"||(me.nodeName==="AUDIO"||me.nodeName==="VIDEO")&&me.getAttribute("tabindex")===null?0:me.tabIndex:we}function ee(me){return me.tagName.toUpperCase()==="INPUT"&&me.type==="radio"&&!ae(me)}function re(me,ye){for(const we of me)if(we.checked&&we.form===ye)return we;return null}function ae(me){var ye;if(!me.name)return!0;const Ne=((ye=me.form)!=null?ye:me.ownerDocument).querySelectorAll('input[type="radio"][name="'+me.name+'"]'),Ge=re(Ne,me.form);return!Ge||Ge===me}function he(me){if(!ht()||me===document.activeElement||me.contains(document.activeElement))return!1;if(getComputedStyle(me).visibility==="hidden")return!0;const ye=me.getBoundingClientRect();if(ye.width===0||ye.height===0)return!0;for(;me;){if(getComputedStyle(me).display==="none")return!0;me=me.parentElement}return!1}return ht()?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 me=Lf(a,ae,y);if(!me||y==="forward"&&a.offsetOf(me)<ae||y==="backward"&&a.offsetOf(me)>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 Ne=we.indexOf(document.activeElement)+re;return Ne<0&&(Ne=we.length-1),Ne>=we.length&&(Ne=0),we[Ne].focus(),a.mathfield.stopCoalescingUndo(),!0}return xs(a,me),!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 Ge=re;for(;Ge&&Ge.mode==="text";)Ge=Ge.leftSibling;let mt=re;for(;((y=mt.rightSibling)==null?void 0:y.mode)==="text";)mt=mt.rightSibling;if(Ge&&mt)return yo(a,[Ge,mt])}if(re.rightSibling.mode==="text"){let Ge=re;for(;Ge&&Ge.mode==="text";)Ge=Ge.rightSibling;return Ge?(xs(a,(b=Ge.leftSibling)!=null?b:Ge),a.mathfield.switchMode("math"),!0):xs(a,a.lastOffset)}}const he=a.at(a.anchor).parentPrompt,me=he?a.offsetOf(he)+1:Math.max(a.position+1,0),ye=Lf(a,me,"forward");if(ye)return xs(a,ye);const we=F0(a,re,Ge=>Ge.type==="leftright"||Ge.type==="text","forward");if(we){if(we.mode==="text"){let Ge=we;for(;Ge&&Ge.mode==="text";)Ge=Ge.rightSibling;return yo(a,[(E=we.leftSibling)!=null?E:we,(ee=Ge.leftSibling)!=null?ee:Ge])}return yo(a,we)}const Ne=re.parent;if(Ne){if(Ne.type==="leftright"||Ne.type==="surd")return yo(a,Ne);if(re.parentBranch==="superscript"&&Ne.subscript)return yo(a,Ne.subscript);if(re.parentBranch==="above"&&Ne.below)return yo(a,Ne.below);if(re.parentBranch==="superscript"||re.parentBranch==="subscript")return xs(a,Ne);if(re.parentBranch==="above"||re.parentBranch==="below")return yo(a,Ne)}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 me=b;for(;((y=me.rightSibling)==null?void 0:y.mode)==="text";)me=me.rightSibling;if(he&&me)return yo(a,[he,me])}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,ye=>ye.type==="leftright"||ye.type==="text","backward");if(he){if(he.mode==="text"){let ye=he;for(;ye&&ye.mode==="text";)ye=ye.leftSibling;return yo(a,[he,ye])}return yo(a,he)}const me=b.parent;if(me){if(me.type==="leftright"||me.type==="surd")return yo(a,me);if(b.parentBranch==="subscript"&&me.superscript)return yo(a,me.superscript);if(b.parentBranch==="below"&&me.above)return yo(a,me.above);if(b.parentBranch==="superscript"||b.parentBranch==="subscript")return xs(a,me);if(b.parentBranch==="above"||b.parentBranch==="below")return yo(a,me)}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(Bn.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 me=E.at(E.position);return me.value="\u22C5",me.style.variant="normal",me.command="\\cdot",me.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 mt=vd();a.keyboardLayout!==mt.id&&(a.keyboardLayout=mt.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,me="",ye;const we=a.inlineShortcutBuffer;if(a.isSelectionEditable){if(re.mode==="math")if(ae==="[Backspace]")we.pop();else if(!wh(y))a.flushInlineShortcutBuffer();else{const mt=lu(y),St=[...(E=(b=we[we.length-1])==null?void 0:b.keystrokes)!=null?E:[],mt];we.push({state:re.getState(),keystrokes:St,leftSiblings:Xg(a)});let bn=0,ir="";for(;!he&&bn<St.length;)ye=we.length-(St.length-bn),ir=St.slice(bn).join(""),he=td(we[ye].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)),bn+=1;a.flushInlineShortcutBuffer({defer:!0})}a.options.smartMode&&(he?a.switchMode("math"):jg(a,ae,y)&&(a.switchMode({math:"text",text:"math"}[re.mode]),me=""))}if(!he){if(me||(me=Zm(a.keybindings,re.mode,y)),!me&&(ae==="[Enter]"||ae==="[Return]")){let mt=!1;return re.contentWillChange({inputType:"insertLineBreak"})&&(a.host&&(mt=!a.host.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),mt||y.preventDefault&&(y.preventDefault(),y.stopPropagation()),re.contentDidChange({inputType:"insertLineBreak"})),mt}if((!me||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"),me="",a.dirty=!0,a.scrollIntoView(),y.preventDefault&&(y.preventDefault(),y.stopPropagation()),!1;const mt=re.at(re.position+1),St=re.at(re.position-1);if((mt==null?void 0:mt.mode)==="text"||(St==null?void 0:St.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)===","&&(me="insertDecimalSeparator")}}if(!he&&!me){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:mt}=re.at(re.position);if(mt instanceof $i&&mt.rightDelim==="?"&&re.at(re.position).isLastSibling&&/^[)}\]|]$/.test(ae))return a.snapshot(),mt.isDirty=!0,mt.rightDelim=ae,re.position+=1,re.selectionDidChange(),re.contentDidChange({data:lu(y),inputType:"insertText"}),a.snapshot("insert-fence"),a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1;if(!re.selectionIsCollapsed){const St=lu(y);if(St==="("||St==="{"||St==="["){const bn={"(":"(","{":"\\lbrace","[":"\\lbrack"}[St],ir={"(":")","{":"\\rbrace","[":"\\rbrack"}[St],[yn,Nn]=Wa(re.selection);return a.snapshot(),re.position=Nn,si.insert(re,ir,{format:"latex"}),re.position=yn,si.insert(re,bn,{format:"latex"}),re.setSelection(yn+1,Nn+1),re.contentDidChange({data:St,inputType:"insertText"}),a.snapshot("insert-fence"),a.dirty=!0,a.scrollIntoView(),y.preventDefault&&y.preventDefault(),!1}}}return!0}const Ne=re.at(Math.max(re.position,re.anchor)),{parent:Ge}=Ne;if(me==="moveAfterParent"&&(Ge==null?void 0:Ge.type)==="leftright"&&Ne.isLastSibling&&a.options.smartFence&&Tf(re,".",a.defaultStyle)&&(me="",va(a)),a.keyboardDelegate.cancelComposition(),me)a.executeCommand(me);else if(he){const mt=a.effectiveStyle;re.setState(we[ye].state);const St=we[we.length-1].keystrokes;for(const bn of St)si.insert(re,bn,{silenceNotifications:!0,style:mt});a.snapshot("insert-shortcut"),re.setState(we[ye].state),re.deferNotifications({content:!0,selection:!0,data:he,type:"insertText"},()=>(si.insert(re,he,{format:"latex",style:mt}),Df(a.model),he.endsWith(" ")&&(a.switchMode("text"),si.insert(re," ",{style:mt,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(me=>me.toUpperCase())),b.simulateKeystroke){let me=!0;for(const ye of ee)K0(a,new KeyboardEvent("keypress",{key:ye}))&&(me=!1);if(me)return}const ae=E.at(E.position),he=Se(Se({},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 me of ee)si.insert(E,me);a.snapshot("insert-latex"),bd(a)});else if(E.mode==="text"){for(const me of ee)si.insert(E,me,{style:he});a.snapshot("insert-text")}else if(E.mode==="math")for(const me of ee)Yg(a,me,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=Se({},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[me,ye]=Wa(a.selection),we=a.extractAtoms([me,ye]),Ne=ee.addChildrenAfter([new $i("left...right",we,{leftDelim:re,rightDelim:he})],a.at(me));return a.setSelection(a.offsetOf(Ne.firstChild),a.offsetOf(Ne.lastChild)),a.mathfield.snapshot("insert-fence"),a.contentDidChange({data:re,inputType:"insertText"}),!0}if(re==="|"){const me=ee instanceof $i?ee.leftDelim+ee.rightDelim:"";if(me==="\\lbrace\\rbrace"||me==="\\{\\}"||me==="\\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 Ne=E;for(;Ne&&!(Ne.type==="mclose"&&Ne.value===he);)Ne=Ne.rightSibling;if(Ne){a.mathfield.snapshot();const Ge=a.extractAtoms([a.offsetOf(E),a.offsetOf(Ne)]);return Ge.pop(),ee.addChildrenAfter([new $i("left...right",Ge,{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 me=a.offsetOf(E.lastSibling);let ye;for(ye=a.position;ye<=me;ye++){const Ne=a.at(ye);if(Ne instanceof $i&&(Ne.leftDelim==="?"||Ne.leftDelim===".")&&H0(re,Ne.rightDelim))break}const we=a.at(ye);if(ye<=me&&we instanceof $i){we.leftDelim=re,a.mathfield.snapshot();let Ne=a.extractAtoms([a.position,ye-1]);return Ne=Ne.filter(Ge=>Ge.type!=="first"),we.addChildren(Ne,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 Ne=a.extractAtoms([a.offsetOf(E.firstSibling),a.position]);for(const Ge of Ne)ee.parent.addChildBefore(Ge,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 Ne=a.offsetOf(E.lastSibling),Ge=a.extractAtoms([a.position,Ne]);a.at(a.position).body=Ge,a.position-=1}return a.mathfield.snapshot("insert-fence"),!0}}if(ae){let me=E;for(;me;){if(me.type==="mopen"&&me.value===ae){a.mathfield.snapshot();const mt=me.leftSibling,St=a.extractAtoms([a.offsetOf(me.leftSibling),a.offsetOf(E)]);St.shift();const bn=new $i("left...right",St,{leftDelim:ae,rightDelim:re});return ee.addChildrenAfter([bn],mt),a.position=a.offsetOf(bn),a.contentDidChange({data:re,inputType:"insertText"}),a.mathfield.snapshot("insert-fence"),!0}me=me.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 ye=a.offsetOf(E.firstSibling);let we;for(we=a.position;we>=ye;we--){const mt=a.at(we);if(mt instanceof $i&&(mt.rightDelim==="?"||mt.rightDelim===".")&&If(mt.leftDelim,re))break}const Ne=a.at(we);if(we>=ye&&Ne instanceof $i)return a.mathfield.snapshot(),Ne.rightDelim=re,Ne.addChildren(a.extractAtoms([we,a.position]),Ne.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 Ge=ee.parent;return Ge instanceof $i&&(Ge.rightDelim==="?"||Ge.rightDelim===".")&&a.at(a.position).isLastSibling?(a.position=a.offsetOf(Ge),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=Se(Se({},a.defaultStyle),b)):a.model.deferNotifications({content:!0,type:"insertText"},()=>{E.selection.ranges.forEach(ee=>_f(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,me,ye,we,Ne;const Ge={};if(typeof y.color=="string"){const St=(E=a.colorMap((b=y.color)!=null?b:y.verbatimColor))!=null?E:"none";St!==y.color&&(Ge.verbatimColor=(ee=y.verbatimColor)!=null?ee:y.color),Ge.color=St}if(typeof y.backgroundColor=="string"){const St=(ae=a.backgroundColorMap((re=y.backgroundColor)!=null?re:y.verbatimBackgroundColor))!=null?ae:"none";St!==y.backgroundColor&&(Ge.verbatimBackgroundColor=(he=y.verbatimBackgroundColor)!=null?he:y.backgroundColor),Ge.backgroundColor=St}typeof y.fontFamily=="string"&&(Ge.fontFamily=y.fontFamily),typeof y.series=="string"&&(Ge.fontSeries=y.series),typeof y.fontSeries=="string"&&(Ge.fontSeries=y.fontSeries.toLowerCase()),Ge.fontSeries&&(Ge.fontSeries=(me={bold:"b",medium:"m",normal:"m"}[Ge.fontSeries])!=null?me:Ge.fontSeries),typeof y.shape=="string"&&(Ge.fontShape=y.shape),typeof y.fontShape=="string"&&(Ge.fontShape=y.fontShape.toLowerCase()),Ge.fontShape&&(Ge.fontShape=(ye={italic:"it",up:"n",upright:"n",normal:"n"}[Ge.fontShape])!=null?ye:Ge.fontShape),y.variant&&(Ge.variant=y.variant.toLowerCase()),y.variantStyle&&(Ge.variantStyle=y.variantStyle.toLowerCase());const mt=(we=y.size)!=null?we:y.fontSize;return typeof mt=="number"?Ge.fontSize=Math.max(1,Math.min(10,mt)):typeof mt=="string"&&(Ge.fontSize=(Ne={size1:1,size2:2,size3:3,size4:4,size5:5,size6:6,size7:7,size8:8,size9:9,size10:10}[mt.toLowerCase()])!=null?Ne:{tiny:1,scriptsize:2,footnotesize:3,small:4,normal:5,normalsize:5,large:6,Large:7,LARGE:8,huge:9,Huge:10}[mt]),Ge}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"||!pe.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 me=(ee=a.at(y))==null?void 0:ee.style;for(;me&&me.variant===ae.style.variant&&me.variantStyle===ae.style.variantStyle;)me=(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,_d=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",me=!1,ye=!1;const we=y.clientX,Ne=y.clientY,Ge=Date.now(),mt=E.field,St=setInterval(()=>{me?mt.scroll({top:0,left:mt.scrollLeft-16}):ye&&mt.scroll({top:0,left:mt.scrollLeft+16})},32);function bn(){Hh.stop(),re=!1,clearInterval(St),a.element.classList.remove("tracking"),y&&y.preventDefault()}function ir(Nn){if(!E.hasFocus()){bn();return}const dr=Nn.clientX,Kn=Nn.clientY,Zr=Of(Nn)&&Nn.pointerType==="touch"?20:5;if(Date.now()<Ge+500&&Math.abs(we-dr)<Zr&&Math.abs(Ne-Kn)<Zr){Nn.preventDefault(),Nn.stopPropagation();return}const qr=mt.getBoundingClientRect();ye=dr>qr.right,me=dr<qr.left;let Vr=ee;Of(Nn)&&(Nn.isPrimary||(Vr=kd(E,Nn.clientX,Nn.clientY,{bias:0})));const Ti=kd(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-Ne)<5&&Date.now()<wc.time+500?(_d+=1,wc.time=Ge):(wc={x:we,y:Ne,time:Ge},_d=1);const yn=mt.getBoundingClientRect();if(we>=yn.left&&we<=yn.right&&Ne>=yn.top&&Ne<=yn.bottom){if(a.flushInlineShortcutBuffer(),a.adoptStyle="left",ee=kd(a,we,Ne,{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||_d>2?(bn(),(y.detail===3||_d===3)&&(a.model.selection={ranges:[[0,a.model.lastOffset]]},he="all")):re||(re=!0,Hh.start(mt,y,ir,bn),(y.detail===2||_d===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 me=j0(a,y,he,E,ee);me[0]<=ae[0]&&(ae=me)}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 kd(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 me=ae;for(;me;)he.unshift(me),me=me.parent;for(const we of he)if(we.captureSelection){ae=we;break}let ye=a.model.offsetOf(ae);if(ye<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&&(ye=a.model.offsetOf(ae.leftSibling))}else E.bias<0&&(ye=a.model.offsetOf(ae.leftSibling));return ye}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 me=he.at(he.position);if(me.parent instanceof hi){console.assert(me.parentBranch!==void 0);const ye=[];let we=[];ae[0].type==="first"&&ae.shift(),ae[ae.length-1].type==="first"&&ae.pop();for(const St of ae)St.type==="first"&&we.length>0?(ye.push(we),we=[St]):we.push(St);we.length>0&&ye.push(we);let Ne=Number(me.parentBranch[0]),Ge=Number(me.parentBranch[1]);const mt=me.parent.maxColumns;for(;me.parent.colCount-Ge<ye.length&&me.parent.colCount<mt;)me.parent.addColumn();me.parent.addChildrenAfter(ye[0],me);for(let St=1;St<ye.length;St++)Ge++,Ge>=mt&&(Ge=0,me.parent.addRowAfter(Ne),Ne++),me.parent.setCell(Ne,Ge,ye[St])}else me.parent.addChildrenAfter(ae.filter(ye=>ye.type!=="first"),me);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 me={"?":"\\placeholder{}","@":"\\placeholder{}"};me[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 ye=-1;me[0]?me["@"]=me[0]:typeof y=="string"&&/(^|[^\\])#@/.test(y)&&(ye=rv(a),ye>=0&&(me["@"]=a.getValue(ye,a.position,"latex"))),me[0]||(me[0]=me["?"]);let we=!1;const Ne=dr=>(we=!0,me[dr]);let[Ge,mt]=V0(a,y,Ne,b);if(!mt)return!1;const St=mt.length===1&&mt[0].type==="genfrac";St&&ye>=0&&typeof a.mathfield.options.isImplicitFunction=="function"&&a.mathfield.options.isImplicitFunction(a.at(a.position).command)?(me["@"]=me["?"],we=!1,[Ge,mt]=V0(a,y,Ne,b)):ye>=0&&a.deleteAtoms([ye,a.position]);const{parent:bn}=a.at(a.position),ir=bn.hasEmptyBranch("body");if(St&&Ge!=="latex"&&a.mathfield.options.removeExtraneousParentheses&&bn instanceof $i&&bn.leftDelim==="("&&ir){const dr=bn.parent,Kn=bn.parentBranch;dr.removeChild(bn),dr.setChildren(mt,Kn)}const yn=a.at(a.position);yn.parent.addChildrenAfter(mt,yn),Ge==="latex"&&typeof y=="string"&&(bn==null?void 0:bn.type)==="root"&&ir&&!we&&(bn.verbatimLatex=y),a.silenceNotifications=he;const Nn=mt[mt.length-1];if(b.selectionMode==="placeholder"){const dr=mt.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(St=>{(!ee||St.length>ee)&&(ee=St.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 me=[],ye="";const we=a.model.parentEnvironment.environmentName;if(co(we)){const St=gv(we);ye=$f[St]("active");const bn=$f,{[St]:ir}=bn,yn=rt(bn,[Pe(St)]);me=Object.values(yn).map(Nn=>Nn("inactive"))}else if(uo(we)){const St=vv(we);ye=Rf[St]("active");const bn=Rf,{[St]:ir}=bn,yn=rt(bn,[Pe(St)]);me=Object.values(yn).map(Nn=>Nn("inactive"))}else _a(we)&&(ye=$f.matrix("active"),me=Object.values(Rf).map(St=>St("inactive")));const Ne=document.createElement("div");Ne.className="MLEP__environment-delimiter-controls",Ne.style.display="flex",Ne.style.flexDirection="column",Ne.innerHTML=`
<div class='MLEP__array-delimiter-options'>
${ye}
${me.join("")}
</div>`,ye&&ae.appendChild(Ne),ae.querySelectorAll("[data-command]").forEach(St=>{const bn=St.dataset.command;let ir=bn;try{ir=JSON.parse(bn)}catch(yn){}St.addEventListener("mousedown",yn=>yn.preventDefault()),ir&&St.addEventListener("click",()=>a.executeCommand(ir))});const mt=(b=a.field)==null?void 0:b.getBoundingClientRect();mt&&(re.style.top=`${window.scrollY+(mt.top-re.clientHeight-15)}px`,re.style.left=`${mt.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 me=Math.min(he,(E=y.height)!=null?E:ae.height),ye=Ff(y.location.y,me,y.verticalPos,re);ye+me>window.innerHeight-8&&(y.alternateLocation?(ye=Ff(y.alternateLocation.y,me,y.verticalPos,re),ye+me>window.innerHeight-8&&(ye=void 0)):ye=void 0),Number.isFinite(ye)||(ye=Math.max(8,window.innerHeight-8-me),8+me>window.innerHeight-8&&(a.style.bottom="8px")),me=Math.min(ye+me,window.innerHeight-8)-ye;const we=Number.isFinite(y.maxWidth)?Math.min(y.maxWidth,window.innerWidth):window.innerWidth;let Ne=Math.min(we,(ee=y.width)!=null?ee:ae.width),Ge=Ff(y.location.x,Ne,y.horizontalPos,re);Ge+Ne>window.innerWidth-8&&(y.alternateLocation?(Ge=yv(y.alternateLocation.x,Ne,y.verticalPos,re),Ge+Ne>window.innerWidth-8&&(Ge=void 0)):Ge=void 0),Number.isFinite(Ge)||(Ge=Math.max(8,window.innerWidth-8-Ne),8+Ne>window.innerWidth-8&&(a.style.right="8px")),Ne=Math.min(Ge+Ne,window.innerWidth-8)-Ge,re==="rtl"?a.style.right=`${Math.ceil(window.innerWidth-Ge-Ne).toString()}px`:a.style.left=`${Math.ceil(Ge).toString()}px`,a.style.top=`${Math.ceil(ye).toString()}px`,me!==ae.height&&(a.style.height=`${Math.ceil(me).toString()}px`),Ne!==ae.width&&(a.style.width=`${Math.ceil(Ne).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(ye=>ye.updateState(y));const re=this.hasCheck;this.hasCheck=this._menuItems.some(ye=>ye.visible&&ye.hasCheck),this.hasCheck!==re&&this._menuItems.forEach(ye=>ye.updateState(y));let ae,he=0;for(const ye of this._menuItems)ye.type==="heading"?(ae&&he===0&&(ae.visible=!1),ae=ye,he=0):ye.type==="divider"&&ae?(ae.visible=he>0,ae=void 0,he=0):ae&&ye.visible&&(he+=1);ae&&(ae.visible=he>0);let me=!0;for(const ye of this._menuItems)ye.type==="divider"?(ye.visible=!me,me=!0):ye.visible&&(me=!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 me=(b=ae.getMenuItemColumn(he))!=null?b:-1;if(me>=0&&me<((E=ae.columnCount)!=null?E:1)-1){const ye=ae.nextMenuItem(1);ye&&(ae.activeMenuItem=ye)}}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 ye=ae.parentMenu.activeMenuItem;if(ye){const{element:we}=ye;we==null||we.focus(),we==null||we.classList.remove("is-submenu-open")}}else{const ye=ae.nextMenuItem(-1);ye&&(ae.activeMenuItem=ye)}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 me=ae.findMenuItem(this.typingBuffer);me&&(ae.activeMenuItem=me),this.typingBufferResetTimer=setTimeout(()=>{this.typingBuffer=""},500)}break;default:if(wh(y)){isFinite(this.typingBufferResetTimer)&&clearTimeout(this.typingBufferResetTimer),this.typingBuffer+=y.key;const me=ae.findMenuItem(this.typingBuffer);me&&(ae.activeMenuItem=me),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(Se({},y),{container:this.scrim}))?(this._openTimestamp=Date.now(),this.state="open",!0):(this.disconnectScrim(),!1)}hide(){this.cancelDelayedOperation(),this.state!==void 0&&(this.state!=="closed"&&(this.activeMenuItem=null,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 me of["pointermove","pointerup","pointercancel"])window.addEventListener(me,ye=>{if(ye.type==="pointerup"||ye.type==="pointercancel")clearTimeout(re),ae.abort(),y(!1);else if(ye.type==="pointermove"){const we=xh(ye);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};vt(Object.keys(ap),"{body:auto}",{createAtom:a=>new z(Me(Se({},a),{body:je(a.args[0]),accentChar:ap[a.command.slice(1)]}))}),vt(["widehat","widecheck","widetilde"],"{body:auto}",{createAtom:a=>{const y=dn(je(a.args[0]));return new z(Me(Se({},a),{body:je(a.args[0]),svgAccent:a.command.slice(1)+(y.length>5?"4":["1","1","2","2","3","3"][y.length])}))}}),vt(["overarc","overparen","wideparen"],"{body:auto}",{createAtom:a=>new z(Me(Se({},a),{body:je(a.args[0]),svgAccent:"overarc"}))}),vt(["underarc","underparen"],"{body:auto}",{createAtom:a=>new Jo(Me(Se({},a),{body:je(a.args[0]),svgBelow:"underarc"}))}),vt("utilde","{body:auto}",{createAtom:a=>{const y=je(a.args[0]),b=dn(y),E="widetilde"+(b.length>5?"4":["1","1","2","2","3","3"][b.length]);return new Jo(Me(Se({},a),{body:y,svgBelow:E,boxType:El(y)}))}}),vt("^","{:string}",{createAtom:a=>{var y;return new Bn(Me(Se({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={a:"\xE2",e:"\xEA",i:"\xEE",o:"\xF4",u:"\xFB",A:"\xC2",E:"\xCA",I:"\xCE",O:"\xD4",U:"\xDB"}[a.args[0]])!=null?y:"^"}))}}),vt("`","{:string}",{createAtom:a=>{var y;return new Bn(Me(Se({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={a:"\xE0",e:"\xE8",i:"\xEC",o:"\xF2",u:"\xF9",A:"\xC0",E:"\xC8",I:"\xCC",O:"\xD2",U:"\xD9"}[a.args[0]])!=null?y:"`"}))}}),vt("'","{:string}",{createAtom:a=>{var y;return new Bn(Me(Se({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={a:"\xE1",e:"\xE9",i:"\xED",o:"\xF3",u:"\xFA",A:"\xC1",E:"\xC9",I:"\xCD",O:"\xD3",U:"\xDA"}[a.args[0]])!=null?y:"'"}))}}),vt('"',"{:string}",{createAtom:a=>{var y,b;return new Bn(Me(Se({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:(y=a.args)!=null&&y[0]?(b={a:"\xE4",e:"\xEB",i:"\xEF",o:"\xF6",u:"\xFC",A:"\xC4",E:"\xCB",I:"\xCB",O:"\xD6",U:"\xDC"}[a.args[0]])!=null?b:'"'+a.args[0]:'"'}))}}),vt(".","{:string}",{createAtom:a=>{var y,b;return new Bn(Me(Se({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:(y=a.args)!=null&&y[0]?(b={a:"\u0227",e:"\u0117",i:"\u0307i",o:"\u022F",u:"\u0307u",A:"\u0226",E:"\u0116",I:"\u0130",O:"\u022E",U:"\u0307U"}[a.args[0]])!=null?b:"."+a.args[0]:"."}))}}),vt("=","{:string}",{createAtom:a=>{var y,b;return new Bn(Me(Se({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:(y=a.args)!=null&&y[0]?(b={a:"\u0101",e:"\u0113",i:"\u012B",o:"\u014D",u:"\u016B",A:"\u0100",E:"\u0112",I:"\u012A",O:"\u014C",U:"\u016A"}[a.args[0]])!=null?b:"="+a.args[0]:"="}))}}),vt("~","{:string}",{createAtom:a=>{var y;return new Bn(Me(Se({type:"mord"},a),{isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={n:"\xF1",N:"\xD1",a:"\xE3",o:"\xF5",A:"\xC3",O:"\xD5"}[a.args[0]])!=null?y:"\xB4"}))}}),vt("c","{:string}",{createAtom:a=>{var y;return new Bn(Me(Se({},a),{type:"mord",isFunction:!1,limits:"adjacent",value:a.args[0]&&(y={c:"\xE7",C:"\xC7"}[a.args[0]])!=null?y:""}))}}),vt("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 me=he.match(/\s*(\S+)\s+(\S+)\s+(.*)/);if(me)ee.strokeWidth=me[1],ee.strokeStyle=me[2],ee.strokeColor=me[3];else{const ye=he.match(/\s*([a-z]*)\s*=\s*"(.*)"/);ye&&(ye[1]==="mathbackground"?ee.backgroundcolor=ye[2]:ye[1]==="mathcolor"?ee.strokeColor=ye[2]:ye[1]==="padding"?ee.padding=ye[2]:ye[1]==="shadow"&&(ee.shadow=ye[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,je(E[2]),re,ee)}}),vt("cancel","{body:auto}",{createAtom:a=>{var y;return new cd(a.command,je(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:{}})}}),vt("bcancel","{body:auto}",{createAtom:a=>{var y;return new cd(a.command,je(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:{}})}}),vt("xcancel","{body:auto}",{createAtom:a=>{var y;return new cd(a.command,je(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:{}})}}),vt(["overrightarrow","overleftarrow","Overrightarrow","overleftharpoon","overrightharpoon","overleftrightarrow","overlinesegment","overgroup"],"{:auto}",{createAtom:a=>{var y;return new Jo(Me(Se({},a),{body:je((y=a.args)==null?void 0:y[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgAbove:a.command.slice(1)}))}}),vt("overbrace","{:auto}",{createAtom:a=>new Jo(Me(Se({},a),{body:je(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgAbove:a.command.slice(1)}))}),vt(["underrightarrow","underleftarrow","underleftrightarrow","underlinesegment","undergroup"],"{:auto}",{createAtom:a=>new Jo(Me(Se({},a),{body:je(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"rel",svgBelow:a.command.slice(1)}))}),vt(["underbrace"],"{:auto}",{createAtom:a=>new Jo(Me(Se({},a),{body:je(a.args[0]),skipBoundary:!1,supsubPlacement:"over-under",paddedBody:!0,boxType:"ord",svgBelow:a.command.slice(1)}))}),vt(["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(Se({},a),{svgBody:a.command.slice(1),above:((b=je((y=a.args)==null?void 0:y[1]))==null?void 0:b.length)===0?void 0:je((E=a.args)==null?void 0:E[1]),below:(re=je((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)}`}),vt(["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(Se({},a),{limits:"adjacent",isFunction:!0,variant:"main",variantStyle:"up"}))}),vt(["liminf","limsup"],"",{ifMode:"math",createAtom:a=>new hc({"\\liminf":"lim inf","\\limsup":"lim sup"}[a.command],Me(Se({},a),{limits:"over-under",variant:"main"}))}),vt(["lim","mod"],"",{ifMode:"math",createAtom:a=>new hc(a.command.slice(1),Me(Se({},a),{limits:"over-under",variant:"main"}))}),vt(["det","max","min"],"",{ifMode:"math",isFunction:!0,createAtom:a=>new hc(a.command.slice(1),Me(Se({},a),{limits:"over-under",isFunction:!0,variant:"main"}))}),vt(["ang"],"{:math}",{ifMode:"math",createAtom:a=>new Bn(Me(Se({},a),{body:je(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(Se({},a.style),{variant:"normal",variantStyle:"up"})});return new or([b,ee],{type:"inner",isSelected:a.isSelected,caret:E})}}),vt("sqrt","[index:auto]{radicand:expression}",{ifMode:"math",createAtom:a=>new o0(Me(Se({},a),{body:je(a.args[1]),index:a.args[0]?je(a.args[0]):void 0}))}),vt(["frac","dfrac","tfrac","cfrac","binom","dbinom","tbinom"],"{:expression}{:expression}",{ifMode:"math",createAtom:a=>{const y=Se({},a),b=a.command,E=a.args;switch(b){case"\\dfrac":case"\\frac":case"\\tfrac":y.hasBarLine=!0;break;case"\\atopfrac":y.hasBarLine=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":y.hasBarLine=!1,y.leftDelim="(",y.rightDelim=")";break;case"\\cfrac":y.hasBarLine=!0,y.continuousFraction=!0;break;default:}switch(b){case"\\dfrac":case"\\dbinom":y.mathstyleName="displaystyle";break;case"\\tfrac":case"\\tbinom":y.mathstyleName="textstyle";break;default:}return new ou(E[0]?je(E[0]):[new Qr],E[1]?je(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)}}),vt(["brace","brack"],"",{infix:!0,createAtom:a=>new ou(je(a.args[0]),je(a.args[1]),Me(Se({},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)])}),vt(["over","atop","choose"],"",{infix:!0,createAtom:a=>{let y,b;const E=a.args;return a.command==="\\choose"&&(y="(",b=")"),new ou(je(E[0]),je(E[1]),Me(Se({},a),{hasBarLine:a.command==="\\over",leftDelim:y,rightDelim:b}))},serialize:(a,y)=>Si([a.aboveToLatex(y),a.command,a.belowToLatex(y)])}),vt(["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(je(E[0]),je(E[1]),Me(Se({},a),{leftDelim:(y=E[2])!=null?y:".",rightDelim:(b=E[3])!=null?b:".",hasBarLine:!1}))},serialize:(a,y)=>`${a.aboveToLatex(y)} ${a.command}${a.leftDelim}${a.rightDelim}${a.belowToLatex(y)}`}),vt("pdiff","{numerator}{denominator}",{ifMode:"math",createAtom:a=>new ou(je(a.args[0]),je(a.args[1]),Me(Se({},a),{hasBarLine:!0,numerPrefix:"\u2202",denomPrefix:"\u2202"}))}),vt(["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(Se({},a),{limits:"auto",variant:"main"}))}),vt("smallint","",{ifMode:"math",createAtom:a=>new hc("\u222B",Me(Se({},a),{limits:"adjacent",variant:"main"}))});var op={int:"\u222B",iint:"\u222C",iiint:"\u222D",oint:"\u222E",oiint:"\u222F",oiiint:"\u2230",intclockwise:"\u2231",varointclockwise:"\u2232",ointctrclockwise:"\u2233",intctrclockwise:"\u2A11",sqcup:"\u2294",sqcap:"\u2293",uplus:"\u228E",wr:"\u2240",amalg:"\u2A3F",Cap:"\u22D2",Cup:"\u22D3",doublecap:"\u22D2",doublecup:"\u22D3"};vt(Object.keys(op),"",{ifMode:"math",createAtom:a=>{const y=a.command,b=op[y.slice(1)];return new hf(b,Me(Se({},a),{limits:"adjacent",variant:{"\u22D2":"ams","\u22D3":"ams"}[b]}))}}),vt(["Re","Im"],"",{ifMode:"math",createAtom:a=>new hc({"\\Re":"\u211C","\\Im":"\u2111"}[a.command],Me(Se({},a),{limits:"adjacent",isFunction:!0,variant:"fraktur"}))}),vt("middle","{:delim}",{ifMode:"math",createAtom:a=>{var y;return new r0(Me(Se({},a),{delim:(y=a.args[0])!=null?y:"|",size:1}))}}),vt("the","{:value}",{createAtom:a=>new Bn(Me(Se({},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:Se({variant:"main"},a.style)})),{type:"lift",style:a.style,caret:a.caret,isSelected:a.isSelected,classes:ee}).wrap(E)},serialize:a=>{var y;return`\\the${(y=Ma(a.args[0]))!=null?y:"\\relax"}`}}),vt("mathtip","{:auto}{:math}",{createAtom:a=>new ff(Me(Se({},a),{body:je(a.args[0]),tooltip:je(a.args[1]),content:"math"})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`\\texttip{${a.bodyToLatex(y)}}{${Bn.serialize([a.tooltip],Me(Se({},y),{defaultMode:"math"}))}}`}),vt("texttip","{:auto}{:text}",{createAtom:a=>new ff(Me(Se({},a),{body:je(a.args[0]),tooltip:je(a.args[1]),content:"text"})),serialize:(a,y)=>y.skipStyles?a.bodyToLatex(y):`\\texttip{${a.bodyToLatex(y)}}{${Bn.serialize([a.tooltip],Me(Se({},y),{defaultMode:"text"}))}}`}),vt("error","{:math}",{createAtom:a=>new Bn(Me(Se({},a),{body:je(a.args[0])})),serialize:(a,y)=>`\\error{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__error"})}),vt("ensuremath","{:math}",{createAtom:a=>new Bn(Me(Se({},a),{body:je(a.args[0])})),serialize:(a,y)=>`${a.command}{${a.bodyToLatex(Me(Se({},y),{defaultMode:"math"}))}}`}),vt("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"})}}}),vt("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"})}}}),vt("boxed","{content:math}",{createAtom:a=>new ba(Me(Se({},a),{body:je(a.args[0]),framecolor:{string:"black"}}))}),vt("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"})}}}),vt("fcolorbox","{frame-color:value}{background-color:value}{content:text}",{applyMode:"text",createAtom:a=>{var y,b;return new ba(Me(Se({},a),{body:je(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(Se({},y),{defaultMode:"text"})):ra(a.command,(b=Ma(a.framecolor))!=null?b:"",(E=Ma(a.backgroundcolor))!=null?E:"",a.bodyToLatex(Me(Se({},y),{defaultMode:"text"})))}}),vt("bbox","[:bbox]{body:auto}",{createAtom:a=>{var y;const b=a.args[0],E=je(a.args[1]);return b?new ba(Me(Se({},a),{body:E,padding:b.padding,border:b.border,backgroundcolor:(y=b.backgroundcolor)!=null?y:void 0})):new ba(Me(Se({},a),{body:E}))},serialize:(a,y)=>{var b,E;if(y.skipStyles)return a.bodyToLatex(y);let ee=a.command;if(Number.isFinite(a.padding)||a.border!==void 0||a.backgroundcolor!==void 0){const re=[];a.padding&&re.push((b=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))}}),vt(["displaystyle","textstyle","scriptstyle","scriptscriptstyle"],"{:rest}",{createAtom:a=>new Bn(Me(Se({},a),{body:je(a.args[0])})),render:(a,y)=>{const b=new Di({parent:y,mathstyle:a.command.slice(1)},a.style),E=Bn.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)])}}`}),vt(["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]})}),vt("fontseries","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontSeries:(b=y[0])!=null?b:"auto"}}}),vt("fontshape","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontShape:(b=y[0])!=null?b:"auto"}}}),vt("fontfamily","{:string}",{ifMode:"text",applyStyle:(a,y)=>{var b;return{fontFamily:(b=y[0])!=null?b:"roman"}}}),vt("selectfont","",{ifMode:"text",applyStyle:()=>({})}),vt("bf","{:rest}",{applyStyle:()=>({fontSeries:"b",fontShape:"n",fontFamily:"roman"})}),vt(["boldsymbol","bm"],"{:math}",{applyMode:"math",createAtom:a=>new Bn(Me(Se({},a),{body:je(a.args[0])})),serialize:(a,y)=>`${a.command}{${a.bodyToLatex(y)}}`,render:(a,y)=>a.createBox(y,{classes:"ML__boldsymbol"})}),vt("bold","{:math*}",{applyMode:"math",applyStyle:()=>({variantStyle:"bold"})}),vt("bfseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),vt("mdseries","{:rest}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),vt("upshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),vt("slshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),vt("scshape","{:rest}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),vt("textbf","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"b"})}),vt("textmd","{:text*}",{applyMode:"text",applyStyle:()=>({fontSeries:"m"})}),vt("textup","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n"})}),vt("textnormal","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"n",fontSeries:"m"})}),vt("textsl","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sl"})}),vt("textit","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"it"})}),vt("textsc","{:text*}",{applyMode:"text",applyStyle:()=>({fontShape:"sc"})}),vt("textrm","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"roman"})}),vt("textsf","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"sans-serif"})}),vt("texttt","{:text*}",{applyMode:"text",applyStyle:()=>({fontFamily:"monospace"})}),vt("mathbf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"bold"})}),vt("mathit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"italic"})}),vt("mathnormal","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"italic"})}),vt("mathbfit","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"main",variantStyle:"bolditalic"})}),vt("mathrm","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"normal",variantStyle:"up"})}),vt("mathsf","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"sans-serif",variantStyle:"up"})}),vt("mathtt","{:math*}",{applyMode:"math",applyStyle:()=>({variant:"monospace",variantStyle:"up"})}),vt("it","{:rest}",{applyStyle:()=>({fontSeries:"m",fontShape:"it",fontFamily:"roman",variantStyle:"italic"})}),vt("rmfamily","",{applyStyle:()=>({fontFamily:"roman"})}),vt("sffamily","",{applyStyle:()=>({fontFamily:"sans-serif"})}),vt("ttfamily","",{applyStyle:()=>({fontFamily:"monospace"})}),vt(["Bbb","mathbb"],"{:math*}",{applyStyle:()=>({variant:"double-struck",variantStyle:"up"})}),vt(["frak","mathfrak"],"{:math*}",{applyStyle:()=>({variant:"fraktur",variantStyle:"up"})}),vt("mathcal","{:math*}",{applyStyle:()=>({variant:"calligraphic",variantStyle:"up"})}),vt("mathscr","{:math*}",{applyStyle:()=>({variant:"script",variantStyle:"up"})}),vt("mbox","{:text}",{ifMode:"math",createAtom:a=>new Bn(Me(Se({},a),{type:"mord",body:je(a.args[0]),mode:"math"})),serialize:(a,y)=>ra("\\mbox",a.bodyToLatex(Me(Se({},y),{defaultMode:"text"})))}),vt("text","{:text}",{ifMode:"math",applyMode:"text"}),vt(["class","htmlClass"],"{name:string}{content:auto}",{createAtom:a=>new Bn(Me(Se({},a),{body:je(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:""})}}),vt(["cssId","htmlId"],"{id:string}{content:auto}",{createAtom:a=>new Bn(Me(Se({},a),{body:je(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}}),vt("htmlData","{data:string}{content:auto}",{createAtom:a=>new Bn(Me(Se({},a),{body:je(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}}),vt(["style","htmlStyle"],"{data:string}{content:auto}",{createAtom:a=>new Bn(Me(Se({},a),{body:je(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}}),vt("em","{:rest}",{createAtom:a=>new Bn(Me(Se({},a),{body:je(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"})}),vt("emph","{:auto}",{createAtom:a=>new Bn(Me(Se({},a),{body:je(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}};vt(["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(Se({},a),{delim:(y=a.args[0])!=null?y:".",size:sp[a.command].size,delimType:sp[a.command].mclass}))}}),vt(["hspace","hspace*"],"{width:value}",{createAtom:a=>{var y;return new hd(Me(Se({},a),{width:(y=a.args[0])!=null?y:{dimension:0}}))}}),vt(["mkern","kern","mskip","hskip","mspace"],"{width:value}",{createAtom:a=>{var y;return new hd(Me(Se({},a),{width:(y=a.args[0])!=null?y:{dimension:0}}))}}),vt("mathchoice","{:math}{:math}{:math}{:math}",{createAtom:a=>new Bn(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=je(a.args[b]);return Bn.createBox(y,ee)},serialize:(a,y)=>`\\mathchoice{${Bn.serialize(a.args[0],y)}}{${Bn.serialize(a.args[1],y)}}{${Bn.serialize(a.args[2],y)}}{${Bn.serialize(a.args[3],y)}}`}),vt("mathop","{:auto}",{createAtom:a=>new Bn(Me(Se({},a),{type:"mop",body:je(a.args[0]),limits:"over-under",isFunction:!0,captureSelection:!0})),render:(a,y)=>{var b;let E=Bn.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)}}),vt(["mathbin","mathrel","mathopen","mathclose","mathpunct","mathord","mathinner"],"{:auto}",{createAtom:a=>new Bn(Me(Se({},a),{type:{"\\mathbin":"mbin","\\mathrel":"mrel","\\mathopen":"mopen","\\mathclose":"mclose","\\mathpunct":"mpunct","\\mathord":"mord","\\mathinner":"minner"}[a.command],body:je(a.args[0])}))}),vt(["operatorname","operatorname*"],"{operator:math}",{createAtom:a=>{const y=je(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 Bn(Me(Se({},a),{type:"mop",body:y,isFunction:!0,limits:a.command==="\\operatorname"?"adjacent":"over-under"}))},render:(a,y)=>{var b;let E=Bn.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)}}),vt(["char","unicode"],"{charcode:value}",{createAtom:a=>new Bn(Me(Se({},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)}}),vt("rule","[raise:value]{width:value}{thickness:value}",{createAtom:a=>new Bn(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}),me=re.toEm((ee=a.args[2])!=null?ee:{dimension:10}),ye=new or(null,{classes:"rule",type:"ord"});return ye.width=he,ye.height=me+ae,ye.depth=-ae,ye.setStyle("border-right-width",he,"em"),ye.setStyle("border-top-width",me,"em"),ye.setStyle("border-color",a.style.color),ye.setStyle("vertical-align",ae,"em"),a.isSelected&&ye.setStyle("opacity","50%"),a.bind(re,ye),a.caret&&(ye.caret=a.caret),ye.wrap(y)},serialize:a=>`\\rule${a.args[0]?`[${Ma(a.args[0])}]`:""}{${Ma(a.args[1])}}{${Ma(a.args[2])}}`}),vt(["overline","underline"],"{:auto}",{createAtom:a=>new Bn(Me(Se({},a),{body:je(a.args[0])})),render:(a,y)=>{const b=a.command.substring(1),E=new Di({parent:y,mathstyle:"cramp"},a.style),ee=Bn.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"})}}),vt("overset","{:auto}{base:auto}",{createAtom:a=>{const y=je(a.args[1]);return new Jo(Me(Se({},a),{above:je(a.args[0]),body:y,skipBoundary:!1,boxType:El(y)}))},serialize:(a,y)=>ra(a.command,a.aboveToLatex(y),a.bodyToLatex(y))}),vt("underset","{:auto}{base:auto}",{createAtom:a=>{const y=je(a.args[1]);return new Jo(Me(Se({},a),{below:je(a.args[0]),body:y,skipBoundary:!1,boxType:El(y)}))},serialize:(a,y)=>ra(a.command,a.belowToLatex(y),a.bodyToLatex(y))}),vt("overunderset","{above:auto}{below:auto}{base:auto}",{createAtom:a=>{const y=je(a.args[2]);return new Jo(Me(Se({},a),{above:je(a.args[0]),below:je(a.args[1]),body:y,skipBoundary:!1,boxType:El(y)}))},serialize:(a,y)=>ra(a.command,a.belowToLatex(y),a.bodyToLatex(y))}),vt(["stackrel","stackbin"],"[below:auto]{above:auto}{base:auto}",{createAtom:a=>new Jo(Me(Se({},a),{body:je(a.args[2]),above:je(a.args[1]),below:je(a.args[0]),skipBoundary:!1,boxType:a.command==="\\stackrel"?"rel":"bin"})),serialize:(a,y)=>ra(a.command,a.aboveToLatex(y),a.bodyToLatex(y))}),vt("smash","[:string]{:auto}",{createAtom:a=>{var y,b,E,ee;return new dd(Me(Se({},a),{body:je(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}))}}),vt(["vphantom"],"{:auto}",{createAtom:a=>new dd(Me(Se({},a),{body:je(a.args[0]),isInvisible:!0,smashWidth:!0}))}),vt(["hphantom"],"{:auto}",{createAtom:a=>new dd(Me(Se({},a),{body:je(a.args[0]),isInvisible:!0,smashHeight:!0,smashDepth:!0}))}),vt(["phantom"],"{:auto}",{createAtom:a=>new dd(Me(Se({},a),{body:je(a.args[0]),isInvisible:!0}))}),vt("not","{:math}",{createAtom:a=>{const y=je(a.args[0]);return y.length===0?new Bn(Me(Se({},a),{type:"mrel",value:"\uE020"})):new Bn(Me(Se({},a),{body:[new dc(Me(Se({},a),{body:"\uE020",align:"right"})),...y],captureSelection:!0}))},serialize:(a,y)=>{const b=a.args[0],E=b&&typeof b=="object"&&"group"in b;return a.value!=="\uE020"?E?`\\not{${Bn.serialize(b.group,y)}}`:`\\not${Bn.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(je(a.args[0])),ee=Bn.createBox(y,a.body,{type:E});return a.caret&&(ee.caret=a.caret),a.bind(y,ee)}}),vt(["ne","neq"],"",{createAtom:a=>new Bn(Me(Se({},a),{type:"mrel",body:[new dc(Me(Se({},a),{body:"\uE020",align:"right",boxType:"rel"})),new Bn(Me(Se({},a),{value:"="}))],captureSelection:!0})),serialize:a=>a.command}),vt("rlap","{:auto}",{createAtom:a=>new dc(Me(Se({},a),{body:je(a.args[0]),align:"right"}))}),vt("llap","{:auto}",{createAtom:a=>new dc(Me(Se({},a),{body:je(a.args[0]),align:"left"}))}),vt("mathrlap","{:math}",{createAtom:a=>new dc(Me(Se({},a),{body:je(a.args[0]),align:"left"}))}),vt("mathllap","{:math}",{createAtom:a=>new dc(Me(Se({},a),{body:je(a.args[0]),align:"left"}))}),vt("raisebox","{:value}{:text}",{createAtom:a=>{var y;return new ba(Me(Se({},a),{body:je(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))}}),vt("raise","{:value}{:auto}",{createAtom:a=>{var y;return new ba(Me(Se({},a),{body:je(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))}}),vt("lower","{:value}{:auto}",{createAtom:a=>{var y;return new ba(Me(Se({},a),{body:je(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))}}),De("0123456789/@.?!"),ot(65,90),ot(97,122),De([["\\forall",8704],["\\exists",8707],["\\nexists",8708,"mord","ams"],["\\mid",8739,"mrel"],["\\top",8868],["\\bot",8869]]),De([["\\#",35],["\\&",38],["\\parallelogram",9649],["\\spadesuit",9824],["\\heartsuit",9825],["\\diamondsuit",9826],["\\clubsuit",9827],["\\flat",9837],["\\natural",9838],["\\sharp",9839]]),De([["\\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]]),De([["\\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"),De([["\\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"]]),De([["\\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"]]),De([["\\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"),De([["+",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"),De([["\\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"),De([["\\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]]),De([["=",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"),De([["\\lnot",172],["\\neg",172],["\\triangle",9651],["\\subsetneq",8842],["\\varsubsetneq",57370],["\\subsetneqq",10955],["\\varsubsetneqq",57367],["\\nsubset",8836],["\\nsupset",8837],["\\nsubseteq",8840],["\\nsupseteq",8841]],"mrel","ams"),De([["\\wp",8472],["\\aleph",8501]]),De([["\\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"),De([["\\ ",160],["~",160]],"space"),vt(["!",",",":",";",">","enskip","enspace","quad","qquad"],"",{createAtom:a=>new hd(a)}),vt("space","",{createAtom:a=>new hd(a)}),De([["\\colon",58],["\\cdotp",8901],["\\vdots",8942,"mord"],["\\ldotp",46],[",",44],[";",59]],"mpunct"),De([["\\cdots",8943],["\\ddots",8945],["\\ldots",8230],["\\mathellipsis",8230]],"minner"),De([["\\/",47],["|",8739,"mord"],["\\imath",305],["\\jmath",567],["\\degree",176],["'",8242],['"',8221]]);var lp="<mo>&#x2061;</mo>",Gh="<mo>&#8290;</mo>";function Xh(a){return a.replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Qi(a,y){return!a||!y.generateID?"":` extid="${a}"`}function Mv(a,y,b){var E,ee,re,ae,he,me,ye,we,Ne,Ge,mt;let St=!1;y=y!=null?y:a.atoms.length;let bn="",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=fn(yn.value,(he=yn.style)==null?void 0:he.variant,(me=yn.style)==null?void 0:me.variantStyle);if(qr!==yn.value)return a.index+=1,bn=`<mi${Qi(yn.id,b)}>${qr}</mi>`,ml(bn,a,b)||(a.mathML+=bn,a.lastType="mi"),!0;Kn=(ye={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?ye:"",Kn=` mathvariant="${Kn}"`}const Zr={"\\exponentialE":"&#x02147;","\\imaginaryI":"&#x2148;","\\differentialD":"&#x2146;","\\capitalDifferentialD":"&#x2145;","\\alpha":"&#x03b1;","\\pi":"&#x03c0;","\\infty":"&#x221e;","\\forall":"&#x2200;","\\nexists":"&#x2204;","\\exists":"&#x2203;","\\hbar":"\u210F","\\cdotp":"\u22C5","\\ldots":"\u2026","\\cdots":"\u22EF","\\ddots":"\u22F1","\\vdots":"\u22EE","\\ldotp":"."};if(yn.command==="!")return a.index+=1,bn="<mo>!</mo>",ml(bn,a,b)||(a.mathML+=bn,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===((Ne=(we=yn.style)==null?void 0:we.variant)!=null?Ne:"")&&dr===((mt=(Ge=yn.style)==null?void 0:Ge.variantStyle)!=null?mt:"");)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){St=!0,bn=`<mi${Kn}>${ir}</mi>`;const qr=a.lastType;bn.endsWith(">f</mi>")||bn.endsWith(">g</mi>")?(bn+=lp,a.lastType="applyfunction"):a.lastType=/^<mo>(.*)<\/mo>$/.test(bn)?"mo":"mi",ml(bn,a,b)||((qr==="mi"||qr==="mn"||qr==="mtext"||qr==="fence")&&(bn=Gh+bn),a.mathML+=bn)}return St}function _v(a){return a.index<a.atoms.length&&a.atoms[a.index].superscript&&a.atoms[a.index].type==="subsup"}function kv(a){let y=-1,b=a.index,E=!1,ee=!1;for(;b<a.atoms.length&&!E&&!ee;){const re=a.atoms[b];E=!re.isDigit(),ee=!E&&re.superscript!==void 0,b++}return ee&&(y=b-1),y}function 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 me="";return ae&&he?me=`<msubsup>${a}${he}${ae}</msubsup>`:ae?me=`<msup>${a}${ae}</msup>`:he&&(me=`<msub>${a}${he}</msub>`),y.mathML+=me,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=kv(a);for(re>=0&&re<y&&(y=re);a.index<y&&a.atoms[a.index].isDigit();)ee+=a.atoms[a.index].asDigit(),a.index+=1;return ee.length<=0?!1:(ee="<mn"+Qi(a.atoms[E].id,b)+">"+ee+"</mn>",re<0&&_v(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 me=a.index;let ye=-1,we=me+1;for(;we<y&&!ae;)a.atoms[we].type==="mopen"?he+=1:a.atoms[we].type==="mclose"&&(he-=1),he===-1&&(ae=!0,ye=we),we+=1;ae&&(ee="<mrow>",ee+=Sc(a.atoms[me],b),ee+=Ri(a.atoms,b,me+1,ye),ee+=Sc(a.atoms[ye],b),ee+="</mrow>",a.index=ye+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":"&ne;","\\neq":"&neq;","\\pm":"&#177;","\\times":"&#215;","\\colon":":","\\vert":"|","\\Vert":"\u2225","\\mid":"\u2223","\\{":"{","\\}":"}","\\lbrace":"{","\\rbrace":"}","\\lbrack":"[","\\rbrack":"]","\\lparen":"(","\\rparen":")","\\langle":"\u27E8","\\rangle":"\u27E9","\\lfloor":"\u230A","\\rfloor":"\u230B","\\lceil":"\u2308","\\rceil":"\u2309"};if(he[ae.command]){a.index+=1;const me=`<mo${Qi(ae.id,b)}>${he[ae.command]}</mo>`;return ml(me,a,b)||(a.mathML+=me,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 me=Sc(ae,b);return ae.superscript&&ae.subscript?(ee+="<munderover>"+me,ee+=Ri(ae.subscript,b),ee+=Ri(ae.superscript,b),ee+="</munderover>"):ae.superscript?(ee+="<mover>"+me,ee+=Ri(ae.superscript,b),ee+="</mover>"):ae.subscript&&(ee+="<munder>"+me,ee+=Ri(ae.subscript,b),ee+="</munder>"),a.mathML+=ee,a.lastType="mo",a.index+=1,!0}{const me=a.atoms[a.index],ye=me.value==="\\operatorname",we=ye?'<mi class="MathML-Unit"'+Qi(me.id,b)+">"+vu(me.value)+"</mi>":Sc(me,b);ee+=we,!ye&&!/^<mo>(.*)<\/mo>$/.test(we)?(ee+=lp,re="applyfunction"):re=ye?"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 Bn)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>&#x2064;</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,me,ye,we,Ne,Ge,mt,St,bn,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,_o,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":"&#x20d7;","\\acute":"&#x00b4;","\\grave":"&#x0060;","\\dot":"&#x02d9;","\\ddot":"&#x00a8;","\\tilde":"&#x007e;","\\bar":"&#x00af;","\\breve":"&#x02d8;","\\check":"&#x02c7;","\\hat":"&#x005e;"};switch(a.type){case"first":break;case"group":case"root":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>&nbsp;</mi>",xr+=Ri(a.below,y)||"<mi>&nbsp;</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":_o=a.above,Zo=a.below,(a.svgAbove||_o)&&(a.svgBelow||Zo)?ea=a.body:_o&&_o.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"&&((ye=(me=a.body)==null?void 0:me[1])!=null&&ye.below)&&(Zo=a.body[1].below,ea=a.body[1].body)):Zo&&Zo.length>0&&(ea=a.body,(Ne=(we=a.body)==null?void 0:we[0])!=null&&Ne.above?(_o=a.body[0].above,ea=a.body[0].body):((mt=(Ge=a.body)==null?void 0:Ge[0])==null?void 0:mt.type)==="first"&&((bn=(St=a.body)==null?void 0:St[1])!=null&&bn.above)&&(_o=a.body[1].overscript,ea=a.body[1].body)),(a.svgAbove||_o)&&(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(_o,y),xr+="</munderover>"):a.svgAbove||_o?(xr+=`<mover ${Qi(a.id,y)}>`+((dr=Ti[a.svgBody])!=null?dr:Ri(ea,y)),xr+=(Kn=Ti[a.svgAbove])!=null?Kn:Ri(_o,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+="&nbsp;";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(Te(a))for(const b of a)b.type!=="first"&&(y+=1);return y===1}function Iv(a){if(Te(a)){for(const y of a)if(y.type!=="first"&&y.id)return y.id.toString()}return""}function cp(a){let y="";if(Te(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 me(we){return"<emphasis>"+we+"</emphasis>"}if(!y)return"";let ye="";if(Te(y)){let we=!1,Ne=!1;for(let Ge=0;Ge<y.length;Ge++)y[Ge].type!=="first"&&(y[Ge].mode!=="text"&&(Ne=!1),Ge<y.length-2&&y[Ge].type==="mopen"&&y[Ge+2].type==="mclose"&&y[Ge+1].type==="mord"?(ye+=" of ",ye+=me(Li(a,y[Ge+1])),Ge+=2):y[Ge].mode==="text"?Ne?ye+=(b=y[Ge].value)!=null?b:" ":(Ne=!0,ye+=Li("text",y[Ge])):y[Ge].isDigit()?we?ye+=y[Ge].asDigit():(we=!0,ye+=Li(a,y[Ge])):(we=!1,ye+=Li(a,y[Ge])))}else if(y.mode==="text")y.id&&a==="math"&&(ye+='<mark name="'+y.id.toString()+'"/>'),ye+=y.value;else{y.id&&a==="math"&&(ye+='<mark name="'+y.id.toString()+'"/>');let we="",Ne="",Ge="",mt=!1;const{command:St}=y;switch(St){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 bn=y.body.length>1?'start input . <break time="500ms"/> '+Li(a,y.body)+'. <break time="500ms"/> end input':"blank";ye+=' <break time="300ms"/> '+bn+'. <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)){ye+=` begin ${Zf[yn]} `;for(let Kn=0;Kn<ir.length;Kn++){Kn>0&&(ye+=","),ye+=` row ${Kn+1} `;for(let Zr=0;Zr<ir[Kn].length;Zr++)Zr>0&&(ye+=","),ye+=` column ${Zr+1}: `,ye+=Li("math",ir[Kn][Zr])}ye+=` end ${Zf[yn]} `}break;case"group":St==="\\ne"?ye+=" not equal ":(St==="\\not"&&(ye+=" not "),ye+=Li("math",y.body));break;case"root":ye+=Li("math",y.body);break;case"genfrac":if(we=Li("math",y.above),Ne=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?ye=Zr:ye+=we+" over "+Ne}else ye+=' the fraction <break time="150ms"/>'+we+' over <break time="150ms"/>'+Ne+'.<break time="150ms"/> End fraction.<break time="150ms"/>';break;case"surd":if(Ge=Li("math",y.body),y.hasEmptyBranch("above"))ye+=Ed(y.body)?" the square root of "+Ge+" , ":' the square root of <break time="200ms"/>'+Ge+'. <break time="200ms"/> End square root';else{let Kn=Li("math",y.above);Kn=Kn.trim();const Zr=Kn.replace(/<mark([^/]*)\/>/g,"");Zr==="3"?ye+=' the cube root of <break time="200ms"/>'+Ge+'. <break time="200ms"/> End cube root':Zr==="n"?ye+=' the nth root of <break time="200ms"/>'+Ge+'. <break time="200ms"/> End root':ye+=' the root with index: <break time="200ms"/>'+Kn+', of <break time="200ms"/>'+Ge+'. <break time="200ms"/> End root'}break;case"leftright":{const Kn=y;ye+=(ee=Kn.leftDelim?yu[Kn.leftDelim]:void 0)!=null?ee:Kn.leftDelim,ye+=Li("math",y.body),ye+=(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=St.replace(/^\\/g,""),dr=Sn()[Nn];dr&&(dr!=null&&dr.expand?ye+=Li("math",y.body):ye+=`${Nn} `);break;case"placeholder":ye+="placeholder ";break;case"delim":case"sizeddelim":case"mord":case"minner":case"mbin":case"mrel":case"mpunct":case"mopen":case"mclose":{if(St==="\\mathbin"||St==="\\mathrel"||St==="\\mathopen"||St==="\\mathclose"||St==="\\mathpunct"||St==="\\mathord"||St==="\\mathinner"){ye=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")ye+=Kn;else{if(y.type==="mbin"&&(ye+='<break time="150ms"/>'),Kn){const qr=yu[Kn]||(Zr?yu[Zr.trim()]:"");if(qr)ye+=" "+qr;else{const Vr=Zr?Tv(Zr.trim()):"";ye+=Vr||he(Kn)}}else ye+=Li("math",y.body);y.type==="mbin"&&(ye+='<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(),ye+=' the summation from <break time="200ms"/>'+qr+'<break time="200ms"/> to <break time="200ms"/>'+Zr+'<break time="200ms"/> of <break time="150ms"/>',mt=!0}else if(y.hasEmptyBranch("subscript"))ye+=" the summation of";else{let Zr=Li("math",y.subscript);Zr=Zr.trim(),ye+=' the summation from <break time="200ms"/>'+Zr+'<break time="200ms"/> of <break time="150ms"/>',mt=!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(),ye+=' the product from <break time="200ms"/>'+qr+'<break time="200ms"/> to <break time="200ms"/>'+Zr+'<break time="200ms"/> of <break time="150ms"/>',mt=!0}else if(y.hasEmptyBranch("subscript"))ye+=" the product of ";else{let Zr=Li("math",y.subscript);Zr=Zr.trim(),ye+=' the product from <break time="200ms"/>'+Zr+'<break time="200ms"/> of <break time="150ms"/>',mt=!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(),ye+=' the integral from <break time="200ms"/>'+me(qr)+'<break time="200ms"/> to <break time="200ms"/>'+me(Zr)+' <break time="200ms"/> of ',mt=!0}else ye+=' 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;ye+=Zr||" "+y.value}else y.command&&(y.command==="\\mathop"?ye+=Li("math",y.body):y.command==="\\operatorname"?ye+=Pv(y.body):ye+=y.command.startsWith("\\")?" "+y.command.slice(1):" "+y.command)}break;case"enclose":Ge=Li("math",y.body),ye+=" crossed out "+Ge+". End crossed out.";break;case"space":case"spacing":break}if(!mt&&!y.hasEmptyBranch("superscript")){let bn=Li(a,y.superscript);bn=bn.trim();const ir=bn.replace(/<[^>]*>/g,"");if(Ed(y.superscript)){if(a==="math"){const yn=Iv(y.superscript);yn&&(ye+='<mark name="'+yn+'"/>')}ir==="\u2032"?ye+=" prime ":ir==="2"?ye+=" squared ":ir==="3"?ye+=" cubed ":Number.isNaN(Number.parseInt(ir))?ye+=" to the "+bn+"; ":ye+=' to the <say-as interpret-as="ordinal">'+ir+"</say-as> power; "}else Number.isNaN(Number.parseInt(ir))?ye+=" raised to the "+bn+"; ":ye+=' raised to the <say-as interpret-as="ordinal">'+ir+"</say-as> power; "}if(!mt&&!y.hasEmptyBranch("subscript")){let bn=Li("math",y.subscript);bn=bn.trim(),ye+=Ed(y.subscript)?" sub "+bn:" subscript "+bn+". End subscript. "}}return ye}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(Se({},window.MathfieldElement.textToSpeechRulesOptions),{markup:window.MathfieldElement.textToSpeechMarkup}),window.MathfieldElement.textToSpeechRulesOptions.markup==="ssml"&&(window.MathfieldElement.textToSpeechRulesOptions=Me(Se({},window.MathfieldElement.textToSpeechRulesOptions),{markup:"ssml_step"})),window.MathfieldElement.textToSpeechRulesOptions=Me(Se({},window.MathfieldElement.textToSpeechRulesOptions),{rate:window.MathfieldElement.speechEngineRate}));const re=(b=window.SRE)!=null?b:window.sre.System.getInstance();window.MathfieldElement.textToSpeechRulesOptions&&re.setupEngine(window.MathfieldElement.textToSpeechRulesOptions);let ae="";try{ae=re.toSpeech(ee)}catch(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"&&st()==="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,me,ye,we,Ne,Ge,mt;if(!a)return"";if(Te(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 St="";const{command:bn}=a;let ir;if(bn==="\\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"}[bn];St=`${yn!=null?yn:""} ${xa(a.body)} `;break;case"first":return"";case"latexgroup":return a.body.map(Vr=>Vr.value).join("");case"group":case"root":St=(b=Ld[bn])!=null?b:xa(a.body);break;case"genfrac":{const Vr=a;(Vr.leftDelim||Vr.rightDelim)&&(St=Vr.leftDelim==="."||!Vr.leftDelim?"{:":Vr.leftDelim),Vr.hasBarLine?(St+="(",St+=xa(Vr.above),St+=")/(",St+=xa(Vr.below),St+=")"):(St+="("+xa(Vr.above)+"),",St+="("+xa(Vr.below)+")"),(Vr.leftDelim||Vr.rightDelim)&&(St+=Vr.rightDelim==="."||!Vr.rightDelim?"{:":Vr.rightDelim)}break;case"surd":St+=a.hasEmptyBranch("above")?"sqrt("+xa(a.body)+")":"root("+xa(a.above)+")("+xa(a.body)+")";break;case"latex":St=a.value;break;case"leftright":{const Vr=a,Ti=Vr.leftDelim;St+=Ti==="."||!Ti?"{:":Ti,St+=xa(Vr.body);const Ui=Vr.matchingRightDelim();St+=Ui==="."||!Ui?":}":Ui}break;case"sizeddelim":case"delim":St=a.value;break;case"overlap":break;case"overunder":break;case"mord":St=(ee=(E=Ld[bn])!=null?E:bn)!=null?ee:typeof a.value=="string"?a.value:"",St.startsWith("\\")&&(St+=" "),ir=bn?bn.match(/{?\\char"([\dabcdefABCDEF]+)}?/):null,ir?St=String.fromCodePoint(Number.parseInt("0x"+ir[1])):St.length>0&&St.startsWith("\\")&&(St=typeof a.value=="string"?a.value.charAt(0):a.command),St=Ov(St,a.style);break;case"mbin":case"mrel":case"minner":St=(ae=(re=Ld[bn])!=null?re:Dd[bn])!=null?ae:a.value;break;case"mopen":case"mclose":St=a.value;break;case"mpunct":St=(he=Dd[bn])!=null?he:bn;break;case"mop":case"operator":case"extensible-symbol":a.value!=="\u200B"&&(Dd[bn]?St=Dd[bn]:St=bn==="\\operatorname"?xa(a.body):(me=a.value)!=null?me:bn,St+=" ");break;case"array":const Nn=a.array,dr=a.environmentName,Kn=(ye={bmatrix:["[","]"],"bmatrix*":["[","]"]}[dr])!=null?ye:["(",")"],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:["(",")"];St=qr[0]+Zr.join(",")+qr[1];break;case"box":break;case"spacing":St=(Ne=Ld[bn])!=null?Ne:" ";break;case"enclose":St="("+xa(a.body)+")";break;case"space":St=" ";break;case"subsup":St="";break;case"macro":St=(mt=(Ge=Ld[bn])!=null?Ge:Dd[bn])!=null?mt:xa(a.body);break}if(!a.hasEmptyBranch("subscript")){St+="_";const yn=xa(a.subscript);St+=yn.length!==1?`(${yn})`:yn}if(!a.hasEmptyBranch("superscript")){St+="^";const yn=xa(a.superscript);St+=yn.length!==1?`(${yn})`:yn}return St}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(Se({},Qc()),{renderPlaceholder:()=>new or(160,{maxFontSize:1}),letterShapeStyle:(E=y==null?void 0:y.letterShapeStyle)!=null?E:"tex"}),mathstyle:y.mathstyle}),ae=new Bn({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 Bn({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,me=-1.2684380040921763*ee+2.6097574006633715*re-.3413193963102197*ae,ye=-.004196086541837188*ee-.7034186144594493*re+1.7076147009309444*ae,we=Ne=>{const Ge=Math.abs(Ne);return Ge<=.0031308?Ne*12.92:(Math.sign(Ne)||1)*(1.055*Math.pow(Ge,1/2.4)-.055)};return[we(he),we(me),we(ye)]}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 me=.36/Math.pow(2,12);for(;ae-re>me;)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,me=.022,ye=1.414,we=.1,Ne=5e-4,Ge=1.14,mt=.027,St=1.14,bn=.027;function ir(Vr){return Vr>=me?Vr:Vr+Ys(me-Vr,ye)}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)<Ne?Zr=0:dr>Nn?(Kn=Ys(dr,ee)-Ys(Nn,re),Zr=Kn*Ge):(Kn=Ys(dr,he)-Ys(Nn,ae),Zr=Kn*St),Math.abs(Zr)<we?qr=0:Zr>0?qr=Zr-bn:qr=Zr+mt,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(We))y.push({class:(Hv(hp(We[b]))==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${We[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(et))y.push({class:(hp(et[b])==="#000"?"dark-contrast":"light-contrast")+" menu-swatch",label:`<span style="background:${et[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 Ne=null;switch(we){case"all":Ne=re.root;break;case"selection":Ne=re.getAtoms(re.selection);break;case"left":{Ne=re.getAtoms(re.offsetOf(re.at(re.position).leftSibling),re.position);break}case"right":{Ne=re.getAtoms(re.position,re.offsetOf(re.at(re.position).rightSibling));break}case"group":Ne=re.getAtoms(re.getSiblingsRange(re.position));break;case"parent":{const{parent:Ge}=re.at(re.position);Ge!=null&&Ge.parent?Ne=Ge:Ne=re.root;break}default:Ne=re.root}return Ne}function he(we){let Ne="";switch(we){case"all":console.log("Internal failure: speak all failed");break;case"selection":Ne="no selection";break;case"left":Ne="at start";break;case"right":Ne="at end";break;case"group":console.log("Internal failure: speak group failed");break;case"parent":Ne="no parent";break;default:console.log('unknown speak_ param value: "'+we+'"');break}return Ne}const me=ae(y);if(me===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 ye=bu(me);return ht()&&b.withHighlighting?(Fl().readAloudMathfield=a,pc(a,{forHighlighting:!0}),window.MathfieldElement.readAloudHook&&window.MathfieldElement.readAloudHook(a.field,ye)):window.MathfieldElement.speakHook&&window.MathfieldElement.speakHook(ye),!1}function r1(a){var y,b;if(!ht()){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),me=new Blob([he.buffer],{type:"audio/mpeg"}),ye=URL.createObjectURL(me);new Audio(ye).play().catch(Ne=>console.log(Ne))}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),me=this.at(ae[1]),ye=Bn.commonAncestor(he,me);(ye==null?void 0:ye.type)==="array"&&he.parent===ye&&me.parent===ye?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((ye,we)=>[...ye,...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 me=[];for(let ye=ae;ye<=he;ye++){const we=this.atoms[ye];mp(this,we,ae,he)&&me.push(we)}return E.includeChildren||(me=me.filter(ye=>{let we=!1,{parent:Ne}=ye;for(;Ne&&!we;)we=mp(this,Ne,ae,he),Ne=Ne.parent;return!we})),me}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 Bn({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 Bn.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=>Bn.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,me=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&&me&&this.selectionDidChange(),he||me}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(Se({},a),{data:a.data?a.data:(y=a.inputType)!=null?y:"",bubbles:!0,composed:!0}))),this.silenceNotifications=b}selectionDidChange(){if(!this.mathfield||(window.mathVirtualKeyboard.visible&&window.mathVirtualKeyboard.update(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,me,ye;const we=b.parent;if(we&&b instanceof $i){const Ne=!E&&y==="forward"||E==="body"&&y==="backward";let Ge=Ne?a.offsetOf(b.firstChild):a.offsetOf(b.lastChild);return Ne?b.rightDelim!=="?"&&b.rightDelim!=="."?(b.leftDelim=".",b.isDirty=!0):(we.addChildrenAfter(b.removeBranch("body"),b),we.removeChild(b),Ge--):b.leftDelim!=="?"&&b.leftDelim!=="."?(b.rightDelim=".",b.isDirty=!0):(we.addChildrenAfter(b.removeBranch("body"),b),we.removeChild(b),Ge--),a.position=Ge,!0}if(we&&b.type==="surd"){if(y==="forward"&&!E||y==="backward"&&E==="body"){const Ne=b.leftSibling;b.hasChildren&&we.addChildrenAfter(b.removeBranch("body"),b),we.removeChild(b),a.position=a.offsetOf(Ne)}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 Ne=E&&y==="backward"||!E&&y==="forward"?b.leftSibling:b.lastChild;return we.addChildrenAfter(b.removeBranch("body"),b),we.removeChild(b),a.position=a.offsetOf(Ne),!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 Ne=Id.fractionNavigationOrder==="numerator-denominator"?"above":"below",Ge=Ne==="above"?"below":"above";if(we&&(y==="forward"&&E===Ne||y==="backward"&&E===Ge)){const mt=b.removeBranch(Ne),St=b.removeBranch(Ge);return we.addChildrenAfter([...mt,...St],b),we.removeChild(b),a.position=a.offsetOf(mt.length>0?mt[mt.length-1]:St[0]),!0}return y==="backward"?a.position=a.offsetOf(b.leftSibling):a.position=a.offsetOf(b),!0}if(b.isExtensibleSymbol||b.type==="subsup"){if(!E&&y==="forward")return!1;if(!E){if(b.subscript||b.superscript){const Ne=y==="forward"?(ae=(ee=b.superscript)==null?void 0:ee[0])!=null?ae:(re=b.subscript)==null?void 0:re[0]:(ye=(he=b.subscript)==null?void 0:he[0].lastSibling)!=null?ye:(me=b.superscript)==null?void 0:me[0].lastSibling;return Ne&&(a.position=a.offsetOf(Ne)),!0}return!1}if(!b.hasChildren&&b.type==="subsup"){const Ne=y==="forward"?a.offsetOf(b):Math.max(0,a.offsetOf(b)-1);return b.parent.removeChild(b),a.position=Ne,!0}if(E==="superscript")if(y==="backward"){const Ne=a.offsetOf(b.firstChild)-1;console.assert(Ne>=0),a.position=Ne}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 Ne=y==="forward"?a.offsetOf(b):Math.max(0,a.offsetOf(b)-1);b.parent.removeChild(b),a.position=Ne}return!0}if((we==null?void 0:we.type)==="genfrac"&&!E&&b.type!=="first"){let Ne=a.offsetOf(b.leftSibling);return we.removeChild(b),we.hasEmptyBranch("above")&&we.hasEmptyBranch("below")?(Ne=a.offsetOf(we.leftSibling),we.parent.removeChild(we),a.announce("delete",void 0,[we]),a.position=Ne,!0):(a.announce("delete",void 0,[b]),a.position=Ne,!0)}if(y==="backward"&&((we==null?void 0:we.command)==="\\ln"||(we==null?void 0:we.command)==="\\log")&&b.parentBranch!=="body"){const Ne=a.offsetOf(we.leftSibling);return we.parent.removeChild(we),a.announce("delete",void 0,[we]),a.position=Ne,!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 me=E[0].parent;me.parent&&me.type!=="prompt"&&(y=[a.offsetOf(me.leftSibling),a.offsetOf(me)])}if(E.length===1&&E[0].type==="placeholder"&&E[0].parent.type==="genfrac"){const me=E[0].parent,ye=E[0].parentBranch==="below"?"above":"below",we=a.offsetOf(me.leftSibling);return a.deferNotifications({content:!0,selection:!0,type:b},()=>{var Ne,Ge;const mt=me.removeBranch(ye);if(mt.length===1&&mt[0].type==="placeholder")(Ge=me.parent)==null||Ge.removeChild(me),a.position=Math.max(0,we);else{const St=me.parent.addChildrenAfter(mt,me);(Ne=me.parent)==null||Ne.removeChild(me),a.position=a.offsetOf(St)}})}}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=Se(Me(Se({},Bh()),{macros:Sn(),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),me=new Bn({type:"root",mode:he,body:ja(ae,{context:this.context})});this.model=new s1(this,he,me),this.undoManager=new Rg(this.model);const ye=[];if(ye.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>"),ye.push('<span part=container class=ML__container aria-hidden=true style="visibility:hidden">'),ye.push("<span part=content class=ML__content>"),ye.push(w0(this)),ye.push("</span>"),window.mathVirtualKeyboard&&(ye.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">`),ye.push(u1),ye.push("</div>")),ye.push('<div part=menu-toggle class=ML__menu-toggle role=button data-l10n-tooltip="tooltip.menu">'),ye.push(d1),ye.push("</div>"),ye.push("</span>"),ye.push("<span class=ML__sr-only>"),ye.push("<span role=status aria-live=assertive aria-atomic=true></span>"),ye.push("</span>"),this.element.innerHTML=window.MathfieldElement.createHTML(ye.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=at.subscribe(()=>at.update(this.element)),at.update(this.element),this.field=this.element.querySelector("[part=content]"),this.field.addEventListener("click",Ne=>Ne.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",Ne=>{if(Ne.currentTarget!==we||this._menu.state!=="closed")return;this.element.classList.add("tracking");const Ge=we.getBoundingClientRect();this._menu.modifiers=fc(Ne),this._menu.show({target:we,location:{x:Ge.left,y:Ge.bottom},onDismiss:()=>this.element.classList.remove("tracking")}),Ne.preventDefault(),Ne.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&&!at.locale.startsWith(gd.locale)&&Nm(at.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:Kt(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:ut(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=Bn.commonAncestor(a,y);return!!((b==null?void 0:b.type)==="prompt"||b!=null&&b.parentPrompt)}get letterShapeStyle(){var a;return(a=this.options.letterShapeStyle)!=null?a:"tex"}get minFontScale(){return this.options.minFontScale}get selectionStyle(){if(this.model.selectionIsCollapsed)return this.effectiveStyle;const a=this.model.getAtoms(this.model.selection);if(a.length===0)return{};const y=Se({},a[0].style);for(const b of a)for(const[E,ee]of Object.entries(b.style))y[E]!==ee&&delete y[E];return y}queryStyle(a){const y=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 me of Object.keys(y)){const ye=this.queryStyle({[me]:y[me]});if(ye==="none")return"none";if(ye==="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 me of re){if(me.type==="first"){ae-=1;continue}me.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=Se(Se({},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=Bn.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;at.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&&lt()&&navigator.vibrate(S0),window.MathfieldElement.playSound("keypress")),a==="\\\\"?A0(this.model):a==="&"?T0(this.model):this.model.selectionIsCollapsed?si.insert(this.model,a,Se({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 me=ja(y,{context:this.context,parseMode:a});ae.collapseSelection("forward");const ye=ae.at(ae.position);ae.position=ae.offsetOf(ye.parent.addChildrenAfter(me,ye)),he=!0}if(this.model.mode=a,a==="latex"){let me=ae.selectionIsCollapsed;cu(this,"accept");let ye,we=ae.at(ae.position);if(me)ye="\\";else{const Ge=Wa(ae.selection);ye=this.model.getValue(Ge,"latex");const mt=this.model.extractAtoms(Ge);mt.length===1&&mt[0].type==="placeholder"&&(ye=y,me=!0),we=ae.at(Ge[0])}const Ne=new ud(ye);we.parent.addChildAfter(Ne,we),me?ae.position=ae.offsetOf(Ne.lastChild):ae.setSelection(ae.offsetOf(Ne.firstChild),ae.offsetOf(Ne.lastChild))}else yd(ae).forEach(me=>{me.isError=!1});if(b){const me=ja(b,{context:this.context,parseMode:re});ae.collapseSelection("forward");const ye=ae.at(ae.position);ae.position=ae.offsetOf(ye.parent.addChildrenAfter(me,ye)),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=Se(Se({},this.defaultStyle),re);return}const he=Se({},this.defaultStyle);for(const me of Object.keys(re))he[me]===re[me]?(me==="color"&&delete he.verbatimColor,me==="backgroundColor"&&delete he.verbatimBackgroundColor,delete he[me]):he[me]=re[me];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)_f(this.model,he,re,{operation:ae});else _f(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=kd(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(Se({},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(Se({},a),{data:a.data?a.data:(y=a.inputType)!=null?y:"",cancelable:!0,bubbles:!0,composed:!0}))))!=null?E:!0}onFocus(){this.focusBlurInProgress||!this.blurred||(this.focusBlurInProgress=!0,this.blurred=!1,this.keyboardDelegate.focus(),this.stopCoalescingUndo(),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(),_h(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=>Bt(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(!ht())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(me=>me?JSON.parse(me):{}),Fl().readAloudTokens=[];for(const me of Fl().readAloudMarks)me.value&&Fl().readAloudTokens.push(me.value);Fl().readAloudCurrentMark="",ee.OutputFormat="mp3",ee.SpeechMarkTypes=[],E.synthesizeSpeech(ee,(me,ye)=>{if(me){console.trace(`MathLive 0.98.5: \`polly.synthesizeSpeech("${y}") error:${me}`);return}if(!(ye!=null&&ye.AudioStream))return;const we=new Uint8Array(ye.AudioStream),Ne=new Blob([we.buffer],{type:"audio/mpeg"}),Ge=URL.createObjectURL(Ne),mt=Fl();mt.readAloudAudio?mt.readAloudAudio.pause():(mt.readAloudAudio=new Audio,mt.readAloudAudio.addEventListener("ended",()=>{const St=mt.readAloudMathfield;mt.readAloudStatus="ended",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),St?(pc(St),mt.readAloudElement=null,mt.readAloudMathfield=null,mt.readAloudTokens=[],mt.readAloudMarks=[],mt.readAloudCurrentMark=""):gp(mt.readAloudElement)}),mt.readAloudAudio.addEventListener("timeupdate",()=>{let St="";const bn=mt.readAloudAudio.currentTime*1e3+100;for(const ir of mt.readAloudMarks)ir.time<bn&&(St=ir.value);mt.readAloudCurrentMark!==St&&(mt.readAloudCurrentToken=St,St&&St===mt.readAloudFinalToken?mt.readAloudAudio.pause():(mt.readAloudCurrentMark=St,Qf(mt.readAloudElement,mt.readAloudCurrentMark)))})),mt.readAloudAudio.src=Ge,mt.readAloudStatus="playing",document.body.dispatchEvent(new Event("read-aloud-status-change",{bubbles:!0,composed:!0})),mt.readAloudAudio.play()})})}ht()||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 at.locale}static set locale(y){y==="auto"&&(y=navigator.language.slice(0,5)),at.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 at.strings}static set strings(y){at.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)?Se({},gc(Se(Se({},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(Se(Se({},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=Se(Se({},Pi.get(this).options),y);Pi.set(this,Me(Se({},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,me;if(tu(y)?([ae,he]=y.ranges[0],me=b):eu(y)?([ae,he]=y,me=b):Bs(y)&&Bs(b)?(ae=y,he=b,me=E):(ae=0,he=-1,me=y),(me===void 0||me==="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?kd(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 me=ae.querySelector("slot:not([name])");if(me)try{this._style=me.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 ye="";if(this.hasAttribute("value")?ye=this.getAttribute("value"):ye=(y=me==null?void 0:me.assignedNodes().map(we=>we.nodeType===3?we.textContent:"").join("").trim())!=null?y:"",this._mathfield=new h1(ae.querySelector(":host > span"),Me(Se({},(E=(b=Pi.get(this))==null?void 0:b.options)!=null?E:Pd(this)),{eventSink:this,value:ye})),!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,Ne=Pi.get(this),Ge=Ne.menuItems;we.model.deferNotifications({content:!1,selection:!1},()=>{const mt=Ne.value;mt!==void 0&&we.setValue(mt),we.model.selection=Ne.selection,Pi.delete(this)}),Ge&&(this.menuItems=Ge)}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(Se({},y._getOption("registers")),{[E]:ee})}),!0)}})}set registers(y){this._setOptions({registers:y})}get colorMap(){return this._getOption("colorMap")}set colorMap(y){this._setOptions({colorMap:y})}get backgroundColorMap(){return this._getOption("backgroundColorMap")}set backgroundColorMap(y){this._setOptions({backgroundColorMap:y})}get letterShapeStyle(){return this._getOption("letterShapeStyle")}set letterShapeStyle(y){this._setOptions({letterShapeStyle:y})}get minFontScale(){return this._getOption("minFontScale")}set minFontScale(y){this._setOptions({minFontScale:y})}get smartMode(){return this._getOption("smartMode")}set smartMode(y){this._setOptions({smartMode:y})}get smartFence(){return this._getOption("smartFence")}set smartFence(y){this._setOptions({smartFence:y})}get smartSuperscript(){return this._getOption("smartSuperscript")}set smartSuperscript(y){this._setOptions({smartSuperscript:y})}get scriptDepth(){return this._getOption("scriptDepth")}set scriptDepth(y){this._setOptions({scriptDepth:y})}get removeExtraneousParentheses(){return this._getOption("removeExtraneousParentheses")}set removeExtraneousParentheses(y){this._setOptions({removeExtraneousParentheses:y})}get mathModeSpace(){return this._getOption("mathModeSpace")}set mathModeSpace(y){this._setOptions({mathModeSpace:y})}get placeholderSymbol(){return this._getOption("placeholderSymbol")}set placeholderSymbol(y){this._setOptions({placeholderSymbol:y})}get popoverPolicy(){return this._getOption("popoverPolicy")}set popoverPolicy(y){this._setOptions({popoverPolicy:y})}get environmentPopoverPolicy(){return this._getOption("environmentPopoverPolicy")}set environmentPopoverPolicy(y){this._setOptions({environmentPopoverPolicy:y})}get menuItems(){var y,b,E;return this._mathfield?(y=this._mathfield.menu._menuItems.map(ee=>ee.menuItem))!=null?y:[]:(E=(b=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(Se({},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(Se({},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(Se({},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(ht()&&!((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 me=!0,ye=0,we;we=he.indexOf(y),we!==-1&&(ye=we,ye>0&&re.push({type:"text",data:he.slice(0,ye)}),me=!1);let Ne=!1;for(;!Ne;){if(me){if(we=he.indexOf(y,ye),we===-1){Ne=!0;break}ye!==we&&re.push({type:"text",data:he.slice(ye,we)}),ye=we}else{if(we=m1(b,he,ye+y.length),we===-1){Ne=!0;break}let Ge=he.slice(ye+y.length,we);ee==="ascii-math"&&([,Ge]=uc(Ge,{format:"ascii-math"})),re.push({type:"math",data:Ge,rawData:he.slice(ye,we+b.length),mathstyle:E}),ye=we+b.length}me=!me}ye<he.length&&re.push({type:"text",data:he.slice(ye)})}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 me=document.createElement("span");me.setAttribute("translate","no");const ye=b.renderToSpeakableText(a);me.innerHTML=window.MathfieldElement.createHTML(ye),me.className="ML__sr-only",he.append(me)}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 me=Cu(he.data,he.mathstyle==="textstyle"?"textstyle":"displaystyle",y,!0);me&&re.appendChild(me)}}return re}function Cp(a,y){var b,E,ee,re,ae,he,me,ye,we,Ne,Ge,mt,St,bn,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=(me=qr.textContent)!=null?me:"";else if((ye=y.processMathJSONScriptTypePattern)!=null&&ye.test(qr.type))try{Vr=(Ne=y.serializeToLatex)==null?void 0:Ne.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(((mt=(Ge=y.processClassPattern)==null?void 0:Ge.test(Kn.className))!=null?mt:!1)||!((bn=(St=y.skipTags)==null?void 0:St.includes(Zr))!=null&&bn||(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=Se(Se({},b1),y);ae.ignoreClassPattern=new RegExp((b=ae.ignoreClass)!=null?b:""),ae.processClassPattern=new RegExp((E=ae.processClass)!=null?E:""),ae.processScriptTypePattern=new RegExp((ee=ae.processScriptType)!=null?ee:""),ae.processMathJSONScriptTypePattern=new RegExp((re=ae.processMathJSONScriptType)!=null?re:""),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(Mn,Qt,ue){"use strict";ue.d(Qt,{Z:function(){return Se}});const fe=Me=>typeof Me=="object"&&Me!=null&&Me.nodeType===1,Ze=(Me,Pe)=>(!Pe||Me!=="hidden")&&Me!=="visible"&&Me!=="clip",Fe=(Me,Pe)=>{if(Me.clientHeight<Me.scrollHeight||Me.clientWidth<Me.scrollWidth){const rt=getComputedStyle(Me,null);return Ze(rt.overflowY,Pe)||Ze(rt.overflowX,Pe)||(Te=>{const He=(ht=>{if(!ht.ownerDocument||!ht.ownerDocument.defaultView)return null;try{return ht.ownerDocument.defaultView.frameElement}catch(Je){return null}})(Te);return!!He&&(He.clientHeight<Te.scrollHeight||He.clientWidth<Te.scrollWidth)})(Me)}return!1},tt=(Me,Pe,rt,Te,He,ht,Je,lt)=>ht<Me&&Je>Pe||ht>Me&&Je<Pe?0:ht<=Me&&lt<=rt||Je>=Pe&&lt>=rt?ht-Me-Te:Je>Pe&&lt<rt||ht<Me&&lt>rt?Je-Pe+He:0,be=Me=>{const Pe=Me.parentElement;return Pe==null?Me.getRootNode().host||null:Pe},Le=(Me,Pe)=>{var rt,Te,He,ht;if(typeof document=="undefined")return[];const{scrollMode:Je,block:lt,inline:st,boundary:Rt,skipOverflowHiddenElements:qt}=Pe,at=typeof Rt=="function"?Rt:Xt=>Xt!==Rt;if(!fe(Me))throw new TypeError("Invalid target");const ft=document.scrollingElement||document.documentElement,Ve=[];let _e=Me;for(;fe(_e)&&at(_e);){if(_e=be(_e),_e===ft){Ve.push(_e);break}_e!=null&&_e===document.body&&Fe(_e)&&!Fe(document.documentElement)||_e!=null&&Fe(_e,qt)&&Ve.push(_e)}const We=(Te=(rt=window.visualViewport)==null?void 0:rt.width)!=null?Te:innerWidth,et=(ht=(He=window.visualViewport)==null?void 0:He.height)!=null?ht:innerHeight,{scrollX:Mt,scrollY:Qe}=window,{height:Kt,width:ut,top:Pt,right:nt,bottom:Gt,left:mn}=Me.getBoundingClientRect(),{top:on,right:sn,bottom:jt,left:Ke}=(Xt=>{const qe=window.getComputedStyle(Xt);return{top:parseFloat(qe.scrollMarginTop)||0,right:parseFloat(qe.scrollMarginRight)||0,bottom:parseFloat(qe.scrollMarginBottom)||0,left:parseFloat(qe.scrollMarginLeft)||0}})(Me);let xe=lt==="start"||lt==="nearest"?Pt-on:lt==="end"?Gt+jt:Pt+Kt/2-on+jt,bt=st==="center"?mn+ut/2-Ke+sn:st==="end"?nt+sn:mn-Ke;const fn=[];for(let Xt=0;Xt<Ve.length;Xt++){const qe=Ve[Xt],{height:je,width:gt,top:en,right:Zt,bottom:pn,left:Vt}=qe.getBoundingClientRect();if(Je==="if-needed"&&Pt>=0&&mn>=0&&Gt<=et&&nt<=We&&(qe===ft&&!Fe(qe)||Pt>=en&&Gt<=pn&&mn>=Vt&&nt<=Zt))return fn;const Ft=getComputedStyle(qe),Tt=parseInt(Ft.borderLeftWidth,10),ge=parseInt(Ft.borderTopWidth,10),se=parseInt(Ft.borderRightWidth,10),oe=parseInt(Ft.borderBottomWidth,10);let de=0,pe=0;const le="offsetWidth"in qe?qe.offsetWidth-qe.clientWidth-Tt-se:0,De="offsetHeight"in qe?qe.offsetHeight-qe.clientHeight-ge-oe:0,ot="offsetWidth"in qe?qe.offsetWidth===0?0:gt/qe.offsetWidth:0,$t="offsetHeight"in qe?qe.offsetHeight===0?0:je/qe.offsetHeight:0;if(ft===qe)de=lt==="start"?xe:lt==="end"?xe-et:lt==="nearest"?tt(Qe,Qe+et,et,ge,oe,Qe+xe,Qe+xe+Kt,Kt):xe-et/2,pe=st==="start"?bt:st==="center"?bt-We/2:st==="end"?bt-We:tt(Mt,Mt+We,We,Tt,se,Mt+bt,Mt+bt+ut,ut),de=Math.max(0,de+Qe),pe=Math.max(0,pe+Mt);else{de=lt==="start"?xe-en-ge:lt==="end"?xe-pn+oe+De:lt==="nearest"?tt(en,pn,je,ge,oe+De,xe,xe+Kt,Kt):xe-(en+je/2)+De/2,pe=st==="start"?bt-Vt-Tt:st==="center"?bt-(Vt+gt/2)+le/2:st==="end"?bt-Zt+se+le:tt(Vt,Zt,gt,Tt,se+le,bt,bt+ut,ut);const{scrollLeft:It,scrollTop:Ut}=qe;de=$t===0?0:Math.max(0,Math.min(Ut+de/$t,qe.scrollHeight-je/$t+De)),pe=ot===0?0:Math.max(0,Math.min(It+pe/ot,qe.scrollWidth-gt/ot+le)),xe+=Ut-de,bt+=It-pe}fn.push({el:qe,top:de,left:pe})}return fn},Re=Me=>Me===!1?{block:"end",inline:"nearest"}:(Pe=>Pe===Object(Pe)&&Object.keys(Pe).length!==0)(Me)?Me:{block:"start",inline:"nearest"};function Se(Me,Pe){if(!Me.isConnected||!(He=>{let ht=He;for(;ht&&ht.parentNode;){if(ht.parentNode===document)return!0;ht=ht.parentNode instanceof ShadowRoot?ht.parentNode.host:ht.parentNode}return!1})(Me))return;const rt=(He=>{const ht=window.getComputedStyle(He);return{top:parseFloat(ht.scrollMarginTop)||0,right:parseFloat(ht.scrollMarginRight)||0,bottom:parseFloat(ht.scrollMarginBottom)||0,left:parseFloat(ht.scrollMarginLeft)||0}})(Me);if((He=>typeof He=="object"&&typeof He.behavior=="function")(Pe))return Pe.behavior(Le(Me,Pe));const Te=typeof Pe=="boolean"||Pe==null?void 0:Pe.behavior;for(const{el:He,top:ht,left:Je}of Le(Me,Re(Pe))){const lt=ht-rt.top+rt.bottom,st=Je-rt.left+rt.right;He.scroll({top:lt,left:st,behavior:Te})}}}}]);
}());