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__User__Detail__Topics__Po...

1105 lines
641 KiB

(self.webpackChunk=self.webpackChunk||[]).push([[5043],{66543:function(){"use strict"},59598:function(){"use strict"},21697:function(At,_t){"use strict";_t.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},69092:function(At,_t){"use strict";_t.Z={wrap:"wrap___ilWvf",deleteIcon:"deleteIcon___JBDG8",keywordTag:"keywordTag___iieCb",questionTitleEditorWrap:"questionTitleEditorWrap___MHB5s",choiceListWrap:"choiceListWrap___jB8b1",choiceWrap:"choiceWrap___QFkTc",choiceIndex:"choiceIndex___Mr2YO",judgementIndex:"judgementIndex___fUVWK",setAnswerBtn:"setAnswerBtn___Whox5",activeAnswer:"activeAnswer___fGU6Y",activeJudgementAnswer:"activeJudgementAnswer___wJv8P",actionWrapper:"actionWrapper___ERQ7k",addIcon:"addIcon___L9TE0",inputBorder:"inputBorder___Q5tRE",placeholder:"placeholder___p9sFY",blankInputNumberWrapper:"blankInputNumberWrapper___uEHb0",addBtn:"addBtn___WR5ZI",blankIndex:"blankIndex___x9Pny",baseInputWrapper:"baseInputWrapper___eVsG7",collapseWrapper:"collapseWrapper___ZTysU",panelHeader:"panelHeader___QSN9g",open:"open___B6FU9",close:"close___QX19r",hide:"hide___mn25n"}},11081: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 At={},_t="5.0",he={},ie=null,et=!1,Me=!1,ze=null,pe=!1,ge=null,Fe=null,Ie=0;Ie<arguments.length;Ie++){var we=arguments[Ie];if(we!==null)switch(typeof we){case"number":_t=we.toFixed(1);break;case"string":we.match(new RegExp("^[0-9]\\.[0-9]+$"))?_t=we:ze=we;break;case"object":typeof we.is3D!="undefined"?ie=we:he=we;break;case"boolean":et=we,Me=!0;break}}ie===null&&(ie={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},he.material_id!==void 0&&!Me&&(et=!0)),ze!==null&&he.id===void 0&&(he.id=ze);var fe="",Ke="",me=!1,rt=null,Ne=null,De=null,Le=!1,xe=null,Oe=null,Xe=null,Je=null,st=null;he.height!==void 0&&(he.height=Math.round(he.height)),he.width!==void 0&&(he.width=Math.round(he.width));var $e=function(Be){return parseFloat(Be)>4?parseFloat(Be):5};At.setHTML5Codebase=function(Be,tt){Fe=Be,ut(Be,tt)},At.setJavaCodebase=At.setJavaCodebaseVersion=At.isCompiledInstalled=At.setPreCompiledScriptPath=At.setPreCompiledResourcePath=function(){},At.setHTML5CodebaseVersion=function(Be,tt){var at=parseFloat(Be);if(at!==NaN&&at<5){console.log("The GeoGebra HTML5 codebase version "+at+" is deprecated. Using version latest instead.");return}ge=Be,de(Be,tt)},At.getHTML5CodebaseVersion=function(){return Ne},At.getParameters=function(){return he},At.setFontsCSSURL=function(Be){Je=Be},At.setGiacJSURL=function(Be){},At.setJNLPFile=function(Be){fe=Be},At.setJNLPBaseDir=function(Be){},At.inject=function(){function Be(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var tt="auto",at=he.id,en,ct=!1,Pt=0;Pt<arguments.length;Pt++){var We=arguments[Pt];typeof We=="string"?(We=We.toLowerCase(),We.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?tt=We:at=arguments[Pt]):typeof We=="boolean"?ct=We:We instanceof HTMLElement&&(en=We)}gt();function gt(){if(!pe){setTimeout(gt,200);return}tt=Ot(tt);var St=en||document.getElementById(at);if(!St){console.log("possibly bug on ajax loading? ");return}if(At.removeExistingApplet(St,!1),he.width===void 0&&St.clientWidth&&(he.width=St.clientWidth),he.height===void 0&&St.clientHeight&&(he.height=St.clientHeight),!(he.width&&he.height)&&tt==="html5"&&(delete he.width,delete he.height),rt=tt,tt==="screenshot")Pe(St,he);else{var ae=!1;he.hasOwnProperty("playButton")&&he.playButton||he.hasOwnProperty("clickToLoad")&&he.clickToLoad?ae=!0:he.hasOwnProperty("playButtonAutoDecide")&&he.playButtonAutoDecide&&(ae=(!lt()||Be())&&it()),ae?(rt="screenshot",$t(St,he,ct,tt)):Qe(St,he,ct)}}};function lt(){try{return window.self!==window.top}catch(Be){return!0}}function it(){return he.hasOwnProperty("screenshotGenerator")&&he.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}At.getViews=function(){return ie},At.isJavaInstalled=function(){return!1};var Yt=function(Be){var tt=function(Pt){var We=JSON.parse(Pt),gt=function(te){return te.type=="G"||te.type=="E"},St=We.elements?We.elements.filter(gt)[0]:We;if(!St||!St.url){at();return}he.fileName=St.url,Ye(St.settings||{}),ie.is3D=!0;var ae="https://www.geogebra.org/images/";At.setPreviewImage(xe||St.previewUrl,ae+"GeoGebra_loading.png",ae+"applet_play.png"),Be()},at=function(){he.onError&&he.onError(),Jt("Error: Fetching material (id "+he.material_id+") failed.",he)},en=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",ct="/materials/"+he.material_id+"?scope=basic";Ge("https://"+en+"/api/proxy.php?path="+encodeURIComponent(ct),tt,at)};function Ye(Be){var tt=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(at){Be[at]=!!Be[at]}),tt.forEach(function(at){he[at]===void 0&&Be[at]!==void 0&&(he[at]=Be[at])}),he.showToolBarHelp===void 0&&(he.showToolBarHelp=he.showToolBar)}function Ge(Be,tt,at){var en=new XMLHttpRequest;en.open("GET",Be),en.onload=function(){tt(en.responseText)},en.onerror=at,en.send()}At.isHTML5Installed=function(){return!0},At.getLoadedAppletType=function(){return rt},At.setPreviewImage=function(Be,tt,at){xe=Be,Oe=tt,Xe=at},At.removeExistingApplet=function(Be,tt){var at;typeof Be=="string"&&(Be=document.getElementById(Be)),rt=null;var en=null;for(at=0;at<Be.childNodes.length;at++){var ct=Be.childNodes[at],Pt=ct.className;Pt==="applet_screenshot"?tt?(ct.style.display="block",rt="screenshot"):ct.style.display="none":Pt!=="applet_scaler prerender"&&(Be.removeChild(ct),en=Pt&&Pt.indexOf("appletParameters")!=-1?ct.id:null,at--)}var We=he.id!==void 0?he.id:en,gt=window[We];gt&&typeof gt.getBase64=="function"&&(gt.remove(),window[We]=null)},At.refreshHitPoints=function(){if($e(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var Be=At.getAppletObject();return Be&&typeof Be.recalculateEnvironments=="function"?(Be.recalculateEnvironments(),!0):!1},At.startAnimation=function(){var Be=At.getAppletObject();return Be&&typeof Be.startAnimation=="function"?(Be.startAnimation(),!0):!1},At.stopAnimation=function(){var Be=At.getAppletObject();return Be&&typeof Be.stopAnimation=="function"?(Be.stopAnimation(),!0):!1},At.getAppletObject=function(){var Be=he.id!==void 0?he.id:"ggbApplet";return window[Be]},At.resize=function(){};var mt=function(Be,tt,at){var en=document.createElement("param");en.setAttribute("name",tt),en.setAttribute("value",at),Be.appendChild(en)},Te=function(Be){return Be&&Be!=="false"},Qe=function(Be,tt,at){$e(Ne)<=4.2&&(at=!0);var en=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==Ne||ggbHTML5LoadedCodebaseIsWebSimple&&!Le)&&(en=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var ct=document.createElement("div");ct.classList.add("appletParameters","notranslate");var Pt=tt.width,We=tt.height;if(tt.disableAutoScale=tt.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():tt.disableAutoScale,tt.width!==void 0)if($e(Ne)<=4.4)Te(tt.showToolBar)&&(tt.height-=7),Te(tt.showAlgebraInput)&&(tt.height-=37),tt.width<605&&Te(tt.showToolBar)&&(tt.width=605,Pt=605);else{var gt=100;(Te(tt.showToolBar)||Te(tt.showMenuBar))&&(tt.hasOwnProperty("customToolBar")&&(tt.customToolbar=tt.customToolBar),gt=Te(tt.showMenuBar)?245:155),Pt<gt&&(tt.width=gt,Pt=gt)}ct.style.border="none",ct.style.display="inline-block";for(var St in tt)tt.hasOwnProperty(St)&&St!=="appletOnLoad"&&ct.setAttribute("data-param-"+St,tt[St]);Je&&ct.setAttribute("data-param-fontscssurl",Je),At.resize=function(){GGBAppletUtils.responsiveResize(Be,tt)},window.addEventListener("resize",function(Vt){At.resize()});var ae=typeof tt.appletOnLoad=="function"?tt.appletOnLoad:function(){};if(!at&&tt.width!==void 0){tt.hasOwnProperty("showSplash")||ct.setAttribute("data-param-showSplash","false");var te=Be.querySelector(".applet_scaler.prerender"),z=te!==null;if(z)var oe=te.querySelector(".ggb_preview");else{var oe=pn(Pt,We,tt.borderColor,!1);te=document.createElement("div"),te.className="applet_scaler",te.style.position="relative",te.style.display="block",te.style.width=Pt+"px",te.style.height=We+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(te,"66%"),$e(Ne)>=5?(tt.appletOnLoad=function(Vt){var Wt=Be.querySelector(".ggb_preview");Wt&&Wt.parentNode.removeChild(Wt),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(te),window.GGBT_wsf_view&&$(window).trigger("resize"),ae(Vt)},z||te.appendChild(oe)):ct.appendChild(oe),te.appendChild(ct),z||Be.appendChild(te),setTimeout(function(){At.resize()},1)}else{var ue=document.createElement("div");ue.className="applet_scaler",ue.style.position="relative",ue.style.display="block",ue.appendChild(ct),Be.appendChild(ue),tt.appletOnLoad=function(Vt){At.resize(),ae(Vt)}}function ne(Vt,Wt){Wt&&typeof Wt.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(Vt,Wt.appletOnLoad):renderGGBElement(Vt),Jt("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",Wt)}function be(Vt,Wt){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:Vt,params:Wt}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(qe){ne(qe.article,qe.params)}),html5AppletsToProcess=null)},$e(Ne)<5&&(Vt.className+=" geogebraweb")):ne(Vt,Wt)}if(en){scriptLoadStarted=!0;for(var Ve=0;Ve<ct.childNodes.length;Ve++){var Tt=ct.childNodes[Ve].tagName;Tt==="TABLE"&&(ct.removeChild(ct.childNodes[Ve]),Ve--)}if(ggbHTML5LoadedScript!==null){var bt=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');bt!=null&&bt.parentNode.removeChild(bt)}var ft=document.createElement("script"),yt=function(){be(ct,tt)};ft.src=Ke+De,ggbHTML5LoadedCodebaseIsWebSimple=Le,ggbHTML5LoadedCodebaseVersion=Ne,ggbHTML5LoadedScript=ft.src,Jt("GeoGebra HTML5 codebase loaded: '"+Ke+"'.",tt),!Fe&&(!ge||ge=="5.0")?(Le?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),yt()):Ke.requirejs?__webpack_require__.e(981).then(function(){var Vt=[__webpack_require__(60981)];yt.apply(null,Vt)}.bind(this)).catch(__webpack_require__.oe):(ft.onload=yt,Be.appendChild(ft))}else be(ct,tt);tt.height=We,tt.width=Pt},Pe=function(Be,tt,at){var en=pn(tt.width,tt.height,tt.borderColor,at),ct=document.createElement("div");ct.style.position="relative",ct.style.display="block",ct.style.width=tt.width+"px",ct.style.height=tt.height+"px",ct.className="applet_screenshot applet_scaler"+(at?" applet_screenshot_play":""),ct.appendChild(en);var Pt=GGBAppletUtils.getScale(tt,Be,at);at?(Be.appendChild(wt()),window.GGBT_wsf_view||(Be.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(ct,"66%"),Be.appendChild(ct),Pt!==1&&!isNaN(Pt)&&(GGBAppletUtils.scaleElement(ct,Pt),ct.style.width=tt.width+"px",ct.style.height=tt.height+"px",ct.parentNode.style.width=tt.width*Pt+"px",ct.parentNode.style.height=tt.height*Pt+"px"),At.resize=function(){ot(Be,en,ct,at)},window.addEventListener("resize",function(We){At.resize()}),At.resize()};function ot(Be,tt,at,en){if(Be.contains(tt)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Be.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(Be)}var ct=GGBAppletUtils.getScale(he,Be,en);at.parentNode!==null&&(!isNaN(ct)&&ct!==1?(GGBAppletUtils.scaleElement(at,ct),at.parentNode.style.width=he.width*ct+"px",at.parentNode.style.height=he.height*ct+"px"):(GGBAppletUtils.scaleElement(at,1),at.parentNode.style.width=he.width+"px",at.parentNode.style.height=he.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(Be),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}At.onExitFullscreen=function(Be,tt){tt.appendChild(Be)};var $t=function(Be,tt,at,en){Pe(Be,tt,!0);for(var ct=function(){var gt=[];for(We=0;We<Be.childNodes.length;We++)gt.push(Be.childNodes[We]);if(window.GGBT_wsf_view){var St=window.GGBT_wsf_view.renderFullScreen(Be,tt.id),ae=document.getElementById("fullscreencontainer"),te=jQuery(Be).find(".fullscreencontent");te.length>0?(St.remove(),te.attr("id","fullscreencontent").show(),jQuery(ae).append(te),window.dispatchEvent(new Event("resize"))):Qe(St,tt,!1),window.GGBT_wsf_view.launchFullScreen(ae)}else rt=en,Qe(Be,tt,!1);if(!window.GGBT_wsf_view)for(We=0;We<gt.length;We++)Be.removeChild(gt[We])},Pt=Be.getElementsByClassName("ggb_preview_play"),We=0;We<Pt.length;We++)Pt[We].addEventListener("click",ct,!1),Pt[We].addEventListener("ontouchstart",ct,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(Be),it()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},wt=function(){var Be=document.createElement("div");if(Be.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var tt='.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");}',at=document.createElement("style");at.styleSheet?at.styleSheet.cssText=tt:at.appendChild(document.createTextNode(tt)),document.getElementsByTagName("head")[0].appendChild(at)}return Be},pn=function(Be,tt,at,en){var ct=document.createElement("div");ct.className="ggb_preview",ct.style.position="absolute",ct.style.zIndex="90",ct.style.width=Be-2+"px",ct.style.height=tt-2+"px",ct.style.top="0px",ct.style.left="0px",ct.style.overflow="hidden",ct.style.backgroundColor="white";var Pt="lightgrey";at!==void 0&&(at==="none"?Pt="transparent":Pt=at),ct.style.border="1px solid "+Pt;var We=document.createElement("img");if(We.style.position="relative",We.style.zIndex="1000",We.style.top="-1px",We.style.left="-1px",xe!==null&&We.setAttribute("src",xe),We.style.opacity=.7,Oe!==null){var gt,St,ae;if(!en){gt=document.createElement("img"),gt.style.position="absolute",gt.style.zIndex="1001",gt.style.opacity=1,We.style.opacity=.3,St=360,St>Be/4*3&&(St=Be/4*3),ae=St/5.8,gt.setAttribute("src",Oe),gt.setAttribute("width",St),gt.setAttribute("height",ae);var te=(Be-St)/2,z=(tt-ae)/2;gt.style.left=te+"px",gt.style.top=z+"px",ct.appendChild(gt)}}return ct.appendChild(We),ct},Ot=function(Be){return Be=Be.toLowerCase(),Be==="html5"||Be==="screenshot"?Be:"html5"},ve=["web","webSimple","web3d","tablet","tablet3d","phone"],de=function(Be,tt){if(Ne=Be,tt){ut(Ne,!0);return}var at=!et;if(at){var en=$e(Ne);!isNaN(en)&&en<4.4&&(at=!1)}var ct,Pt;window.location.protocol.substr(0,4)==="http"?ct=window.location.protocol:ct="http:";var We=Ne.indexOf("//");We>0?Pt=Ne:We===0?Pt=ct+Ne:Pt="https://www.geogebra.org/apps/5.2.814.0/";for(var gt in ve)if(Ne.slice(ve[gt].length*-1)===ve[gt]||Ne.slice((ve[gt].length+1)*-1)===ve[gt]+"/"){ut(Pt,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&at&&!ie.is3D&&!ie.AV&&!ie.SV&&!ie.CV&&!ie.EV2&&!ie.CP&&!ie.PC&&!ie.DA&&!ie.FI&&!ie.PV&&!Te(he.showToolBar)&&!Te(he.showMenuBar)&&!Te(he.showAlgebraInput)&&!Te(he.enableRightClick)&&(!he.appName||he.appName=="classic")?Pt+="webSimple/":Pt+="web3d/",ut(Pt,!1)},ut=function(Be,tt){if(Be.requirejs){Ke=Be;return}Be.slice(-1)!=="/"&&(Be+="/"),Ke=Be,tt===null&&(tt=Be.indexOf("http")===-1),me=tt,De="web.nocache.js",Le=!1;var at=Ke.split("/");at.length>1&&(!tt&&at[at.length-2]==="webSimple"?(De="webSimple.nocache.js",Le=!0):ve.indexOf(at[at.length-2])>=0&&(De=at[at.length-2]+".nocache.js")),at=Be.split("/"),Ne=at[at.length-3],Ne.substr(0,4)==="test"?Ne=Ne.substr(4,1)+"."+Ne.substr(5,1):(Ne.substr(0,3)==="war"||Ne.substr(0,4)==="beta")&&(Ne="5.0");var en=parseFloat(Ne);en!==NaN&&en<5&&Be.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+en+" is deprecated. Using version latest instead."),de("5.0",tt))},Jt=function(Be,tt){window.console&&window.console.log&&(!tt||typeof tt.showLogging=="undefined"||tt.showLogging&&tt.showLogging!=="false")&&console.log(Be)};he.material_id!==void 0?Yt(Ct):Ct();function Ct(){var Be=_t;ge!==null?Be=ge:parseFloat(Be)<5&&(Be="5.0"),de(Be,!1),Fe!==null&&ut(Fe,me),pe=!0}return At},GGBAppletUtils=function(){"use strict";function At(){return window.GGBT_wsf_edit!==void 0}function _t(pe,ge){ge!=1?(pe.style.transformOrigin="0% 0% 0px",pe.style.webkitTransformOrigin="0% 0% 0px",pe.style.transform="scale("+ge+","+ge+")",pe.style.webkitTransform="scale("+ge+","+ge+")",pe.style.maxWidth="initial",pe.querySelector(".ggb_preview")!==null&&(pe.querySelector(".ggb_preview").style.maxWidth="initial"),pe.querySelectorAll(".ggb_preview img")[0]!==void 0&&(pe.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),pe.querySelectorAll(".ggb_preview img")[1]!==void 0&&(pe.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(pe.style.transform="none",pe.style.webkitTransform="none")}function he(pe,ge,Fe,Ie,we,fe){var Ke=null;if(fe!=null&&fe!="")for(var me=pe.parentNode;me!=null;)if((" "+me.className+" ").indexOf(" "+fe+" ")>-1){Ke=me;break}else me=me.parentNode;var rt=0,Ne=0,De=0,Le=0,xe=0,Oe=0,Xe=0;if(Ke)rt=Ke.offsetWidth,Ne=Math.max(Ie?Ke.offsetWidth:0,Ke.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(rt=Math.min(window.innerWidth,document.documentElement.clientWidth),Ne=Math.min(window.innerHeight,document.documentElement.clientHeight),De=rt):(rt=window.innerWidth,Ne=window.innerHeight,De=window.innerWidth),pe){var Je=pe.getBoundingClientRect();Je.left>0&&Je.left<=rt&&(we===void 0||!we)&&(document.dir==="rtl"?(xe=rt-Je.width-Je.left,Oe=De<=480?10:30):(Oe=Je.left,xe=De<=480?10:30),Le=Oe+xe)}if(pe&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var st=pe.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(Le=40,Xe=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(Le=0,Xe=40)}}return pe&&((Fe===void 0||!Fe)&&ge>0&&ge+Le<rt?rt=ge:rt-=Le,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Fe===void 0||!Fe)&&(Ne-=Xe)),{width:rt,height:Ne}}function ie(pe,ge,Fe,Ie,we){if(pe.isScreenshoGenerator)return 1;var fe=Ie!==void 0&&Ie,Ke=pe.noScaleMargin!=null&&pe.noScaleMargin,me=function(st){return st&&st!=="false"},rt=me(pe.autoHeight),Ne=he(ge,pe.width,Fe,rt,fe&&window.GGBT_wsf_view||Ke,we),De=parseInt(Ne.width),Le=pe.width,xe=pe.height;if(Le===void 0){var Oe=ge.querySelector(".appletParameters");Oe&&(Le=Oe.offsetWidth,xe=Oe.offsetHeight)}var Xe=De/Le,Je=fe?1:Ne.height/xe;return Fe!==void 0&&!Fe&&(Xe=Math.min(1,Xe),Je=Math.min(1,Je)),Math.min(Xe,Je)}function et(pe,ge,Fe){var Ie=1,we,fe=!1;if(pe.hasOwnProperty("allowUpscale")&&(fe=pe.allowUpscale),pe.hasOwnProperty("scale")&&(Ie=parseFloat(pe.scale),(isNaN(Ie)||Ie===null||Ie===0)&&(Ie=1),Ie>1&&(fe=!0)),ge&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(fe=!0),!(pe.hasOwnProperty("disableAutoScale")&&pe.disableAutoScale))we=ie(pe,ge,fe,Fe,pe.scaleContainerClass);else return Ie;return fe&&(!pe.hasOwnProperty("scale")||Ie===1)?we:Math.min(Ie,we)}function Me(pe){var ge=Math.min(window.innerWidth,document.documentElement.clientWidth),Fe=Math.min(window.innerHeight,document.documentElement.clientHeight),Ie=pe.getBoundingClientRect(),we=(ge-Ie.width)/2,fe=(Fe-Ie.height)/2;fe<0&&(fe=0),pe.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(we<40?pe.style.left="40px":pe.style.left=we+"px",pe.style.top=fe+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(fe<40?pe.style.top="40px":pe.style.top=fe+"px",pe.style.left=we+"px")}function ze(pe,ge){var Fe=pe.querySelector(".appletParameters");if(Fe){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(ge.id!==Fe.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(pe)}if(Fe.parentElement&&/fullscreen/.test(Fe.parentElement.className))return;var Ie=et(ge,pe);At()&&Fe.setAttribute("data-param-scale",Ie);for(var we=null,fe=0;fe<pe.childNodes.length;fe++)if(pe.childNodes[fe].className!==void 0&&pe.childNodes[fe].className.match(/^applet_scaler/)){we=pe.childNodes[fe];break}if(we!==null&&we.querySelector(".noscale")!==null)return;var Ke=ge.id!==void 0?ge.id:"ggbApplet",me=window[Ke];(me==null||!me.recalculateEnvironments)&&we!==null&&!we.className.match(/fullscreen/)&&(we.parentNode.style.transform="",!isNaN(Ie)&&Ie!==1?(we.parentNode.style.width=ge.width*Ie+"px",we.parentNode.style.height=ge.height*Ie+"px",_t(we,Ie)):(_t(we,1),we.parentNode.style.width=ge.width+"px",we.parentNode.style.height=ge.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&Me(pe),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(Fe).parents(".content-added-content"))}}return{responsiveResize:ze,isFlexibleWorksheetEditor:At,positionCenter:Me,getScale:et,scaleElement:_t}}();__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 At=n.location.search;return At.indexOf(J)!=-1||At.indexOf(K)!=-1}function q(At,_t){}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(At){var _t=s[L].bindings;s[L].bindings=function(){for(var he=_t?_t():{},ie=At[webModule.__softPermutationId],et=O;et<ie.length;et++){var Me=ie[et];he[Me[O]]=Me[P]}return he}};var t;function u(){return v(),t}function v(){if(!t){var At=o.createElement(Q);if(At.id=L,At.style.cssText=R+S,At.tabIndex=-1,o.body.appendChild(At),t=At.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var _t=document.compatMode==U?V:W;t.write(_t+X),t.close()}}}function w(At){function _t(ie){function et(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var Me=et();if(Me){ie();return}function ze(){if(!Me){if(!et())return;Me=!0,ie(),o.removeEventListener&&o.removeEventListener(Z,ze,!1),pe&&clearInterval(pe)}}o.addEventListener&&o.addEventListener(Z,ze,!1);var pe=setInterval(function(){ze()},$)}function he(ie){var et=u(),Me=et.body,ze=et.createElement(_);ze.language=ab,ze.crossOrigin=W,ze.src=ie,webModule.__errFn&&(ze.onerror=function(){webModule.__errFn(L,new Error(bb+ie))}),Me.appendChild(ze)}_t(function(){he(At)})}webModule.__startLoadingFragment=function(At){return C(At)},webModule.__installRunAsyncCode=function(At){var _t=u(),he=_t.body,ie=_t.createElement(_);ie.language=ab,ie.text=At,he.appendChild(ie),he.removeChild(ie)};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(At){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(At){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(At){var _t=c[At];return _t==null?null:_t},r=d,webModule.__errFn=e}function B(){function At(pe){var ge=pe.lastIndexOf(rb);ge==-1&&(ge=pe.length);var Fe=pe.indexOf(sb);Fe==-1&&(Fe=pe.length);var Ie=pe.lastIndexOf(tb,Math.min(Fe,ge));return Ie>=O?pe.substring(O,Ie+P):W}function _t(pe){if(!pe.match(/^\w+:\/\//)){var ge=o.createElement(ub);ge.src=pe+vb,pe=At(ge.src)}return pe}function he(){var pe=__gwt_getMetaProperty(wb);return pe!=null?pe:W}function ie(){for(var pe=o.getElementsByTagName(_),ge=O;ge<pe.length;++ge)if(pe[ge].src.indexOf(xb)!=-1)return At(pe[ge].src);return W}function et(){var pe=o.getElementsByTagName(yb);return pe.length>O?pe[pe.length-P].href:W}function Me(){var pe=o.location;return pe.href==pe.protocol+zb+pe.host+pe.pathname+pe.search+pe.hash}var ze=he();return ze==W&&(ze=ie()),ze==W&&(ze=et()),ze==W&&Me()&&(ze=At(o.location.href)),ze=_t(ze),ze}function C(At){return At.match(/^\//)||At.match(/^[a-zA-Z]+:\/\//)?At:webModule.__moduleBase+At}function D(){var At=[],_t=O,he=[],ie=[];function et(pe){var ge=ie[pe](),Fe=he[pe];if(ge in Fe)return ge;var Ie=[];for(var we in Fe)Ie[Fe[we]]=we;throw r&&r(pe,Ie,ge),null}if(__gwt_isKnownPropertyValue=function(pe,ge){return ge in he[pe]},webModule.__getPropMap=function(){var pe={};for(var ge in he)he.hasOwnProperty(ge)&&(pe[ge]=et(ge));return pe},webModule.__computePropValue=et,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var Me;try{Me=Cb;var ze=Me.indexOf(Db);ze!=-1&&(_t=parseInt(Me.substring(ze+P),$),Me=Me.substring(O,ze))}catch(pe){}return webModule.__softPermutationId=_t,C(Me+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}A(),webModule.__moduleBase="/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})()},67303:function(At,_t,he){"use strict";he.d(_t,{Ax:function(){return ze},Ds:function(){return pe},KI:function(){return Fe},SI:function(){return Me},f1:function(){return et}});var ie=he(90524);function et(Ie){let we=!0;if(Ie.length>0){for(let fe=0;fe<Ie.length;fe++)if(Ie[fe].compile_success==0||!Ie[fe].compile_success){we=!1;break}}else we=!1;return we}function Me(Ie,we=""){let fe=[];for(let Ke=0;Ke<Ie.length;Ke++){let me=Ie[Ke],rt=we?`${we}/${me.name}`:`${me.name}`;fe.push({title:me.name,type:me.type,isLeaf:me.type!=="tree",key:rt})}return fe}function ze(Ie,we,fe){for(let Ke=0;Ke<Ie.length;Ke++){let me=Ie[Ke];if(me.key===we){me.children=fe;break}me.children&&ze(me.children,we,fe)}return Ie}function pe(Ie,we,fe){let Ke;return function(){let me=this,rt=arguments,Ne=function(){Ke=null,fe||Ie.apply(me,rt)},De=fe&&!Ke;clearTimeout(Ke),Ke=setTimeout(Ne,we),De&&Ie.apply(me,rt)}}const ge=!0,Fe=ie.Z.API_SERVER},6077:function(At,_t,he){"use strict";he.d(_t,{Z:function(){return Ke}});var ie=he(59301),et={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},Me=he(92310),ze=he.n(Me),pe=he(29787),ge=he(2859),Fe=he(82093),Ie=he(49661),we=(me,rt,Ne)=>new Promise((De,Le)=>{var xe=Je=>{try{Xe(Ne.next(Je))}catch(st){Le(st)}},Oe=Je=>{try{Xe(Ne.throw(Je))}catch(st){Le(st)}},Xe=Je=>Je.done?De(Je.value):Promise.resolve(Je.value).then(xe,Oe);Xe((Ne=Ne.apply(me,rt)).next())}),Ke=({data:me,className:rt,fullWidth:Ne,style:De={},onClose:Le,onOk:xe,showFullTools:Oe,noAssociationId:Xe})=>{const Je=(0,ie.useRef)(null),st=(0,ie.useRef)(null),$e=(0,ie.useRef)(null),lt=(0,ie.useRef)(null),[it,Yt]=(0,ie.useState)(!1),[Ye,Ge]=(0,ie.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,ie.useEffect)(()=>($e.current||($e.current=document.createElement("style"),document.head.appendChild($e.current)),me!=null&&me.visible?(document.body.setAttribute("data-custom","y-hidden"),$e.current.innerHTML=" html { overflow-y: hidden; }",me!=null&&me.src&&mt()):(document.body.removeAttribute("data-custom"),$e.current&&(document.head.removeChild($e.current),$e.current=null)),()=>{document.body.removeAttribute("data-custom"),$e.current&&(document.head.removeChild($e.current),$e.current=null)}),[me==null?void 0:me.visible]);const mt=()=>we(void 0,null,function*(){Yt(!0),Ge("\u6B63\u5728\u52A0\u8F7D\u4E2D");const ot=yield(0,Ie.ZJ)(me==null?void 0:me.src);Je.current.src="",Je.current.src=ot,Je.current.onload=function(){Pe()},Yt(!1),Ge("")}),Te=ot=>we(void 0,null,function*(){Yt(!0),Ge("\u6B63\u5728\u4FDD\u5B58\u4E2D");const $t=yield(0,Fe.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:me.title,file:ot.dataUrl}});$t!=null&&$t.id&&!Xe?(yield(0,Fe.ZP)(`/api/attachments/${me.id}/add_subitem.json`,{method:"post",body:{subitem_id:$t==null?void 0:$t.id,settings:JSON.stringify(ot.state)}})).status===0&&xe():$t!=null&&$t.id&&xe($t),Yt(!1),Ge("")}),Qe=()=>{const ot=document.querySelector('a[href="https://markerjs.com/"]');ot&&ot.parentNode&&(ot.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(wt=>{const pn=document.querySelector(wt.name);pn&&pn.setAttribute("title",wt.title)})},Pe=()=>{st.current=new ge.hP(Je.current),st.current.targetRoot=lt.current,st.current.addEventListener("render",Te),st.current.addEventListener("beforeclose",Le),Oe&&(st.current.availableMarkerTypes=st.current.ALL_MARKER_TYPES,st.current.uiStyleSettings.redoButtonVisible=!0,st.current.uiStyleSettings.notesButtonVisible=!0,st.current.uiStyleSettings.zoomButtonVisible=!0,st.current.uiStyleSettings.zoomOutButtonVisible=!0,st.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=st.current.uiStyleSettings,st.current.show(),me!=null&&me.snapshotData&&st.current.restoreState(me.snapshotData),setTimeout(()=>{window.scrollTo(0,0),Qe()},300)};return ie.createElement(ie.Fragment,null,(me==null?void 0:me.visible)&&ie.createElement(pe.Z,{spinning:it,tip:Ye,style:{position:"absolute",width:"100vw"}},ie.createElement("div",{ref:lt,className:ze()(et.imageDimensions,rt,Ne?et.fullWidth:""),style:De},ie.createElement("img",{className:et.img,ref:Je}))))}},88615:function(At,_t,he){"use strict";var ie=he(59301),et=he(77019),Me=he(5269),ze=he(20554),pe=he(99571),ge=he(38394),Fe=he(21697),Ie=he(48136),we=he(59301);const fe=(0,ie.forwardRef)(({callback:Ke,showSaveButton:me,value:rt=""},Ne)=>{const De=(0,ie.useRef)(),Le=[{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 "}]}]}],xe=[{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}`}]}]}],Oe=st=>{De.current.setValue(De.current.getValue()+" "+st.value+" ")},Xe=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:we.createElement(et.Z,{className:Fe.Z.lists,gutter:[10,10]},Le.map((st,$e)=>we.createElement(Me.Z,{flex:"110px",className:Fe.Z.item},we.createElement("div",null,we.createElement(ge.Z,{value:`$$${st.value}$$`}),st.name),we.createElement("div",{className:Fe.Z.children},st.children.map((lt,it)=>we.createElement("div",{key:it},we.createElement("h1",null,lt.name),we.createElement(et.Z,{gutter:[10,10]},lt.data.map((Yt,Ye)=>we.createElement(Me.Z,{key:Ye,onClick:()=>Oe(Yt),className:Fe.Z.diamond},we.createElement(ge.Z,{value:"`$$"+Yt.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:we.createElement(et.Z,{className:Fe.Z.lists,gutter:[10,10]},xe.map((st,$e)=>we.createElement(Me.Z,{flex:"110px",className:Fe.Z.item},we.createElement("div",null,we.createElement(ge.Z,{value:"`$$"+st.value+"$$`"}),st.name),we.createElement("div",{className:Fe.Z.children},st.children.map((lt,it)=>we.createElement("div",{key:it},lt.name&&we.createElement("h1",null,lt.name),we.createElement(et.Z,{gutter:[10,10]},lt.data.map((Yt,Ye)=>we.createElement(Me.Z,{key:Ye,onClick:()=>Oe(Yt),className:Fe.Z.diamond},we.createElement(ge.Z,{value:"`$$"+Yt.value+"$$`"}))))))))))}],Je=()=>{var st=document.createElement("div");st.innerHTML=De.current.getValue();var $e=st.innerText;return Ke&&Ke($e),$e};return(0,ie.useImperativeHandle)(Ne,()=>({getData:Je})),we.createElement("div",{className:Fe.Z.mathWrap},we.createElement(ze.default,{defaultActiveKey:"1",items:Xe}),we.createElement("math-field",{locale:"zh_cn",className:Fe.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:De,style:{width:800,marginTop:30,fontSize:18}},rt||""),me&&we.createElement("div",{className:Fe.Z.button},we.createElement(pe.ZP,{size:"large",onClick:Je,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});_t.Z=fe},57884:function(At,_t,he){"use strict";var ie=he(59301),et=he(93314),Me=he(99571),ze=Object.defineProperty,pe=Object.defineProperties,ge=Object.getOwnPropertyDescriptors,Fe=Object.getOwnPropertySymbols,Ie=Object.prototype.hasOwnProperty,we=Object.prototype.propertyIsEnumerable,fe=(Ne,De,Le)=>De in Ne?ze(Ne,De,{enumerable:!0,configurable:!0,writable:!0,value:Le}):Ne[De]=Le,Ke=(Ne,De)=>{for(var Le in De||(De={}))Ie.call(De,Le)&&fe(Ne,Le,De[Le]);if(Fe)for(var Le of Fe(De))we.call(De,Le)&&fe(Ne,Le,De[Le]);return Ne},me=(Ne,De)=>pe(Ne,ge(De));const rt=({img:Ne,buttonProps:De={},styles:Le={},customText:xe,ButtonText:Oe,ButtonClick:Xe,Buttonclass:Je,ButtonTwo:st,imgStyles:$e,loading:lt=!1,className:it=""})=>ie.createElement("section",{className:`tc animated fadeIn ${it}`,style:Ke({color:"#999",margin:"100px auto",visibility:lt?"hidden":"visible"},Le)},ie.createElement("img",{src:Ne||et,style:me(Ke({},$e),{pointerEvents:"none",userSelect:"none"})}),ie.createElement("p",{className:"mt20 font14"},xe||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),Oe&&ie.createElement(Me.ZP,Ke({className:Je,onClick:Xe},De),Oe),st&&st);_t.Z=rt},41550:function(At,_t,he){"use strict";he.d(_t,{Z:function(){return Je}});var ie=he(59301),et={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},Me=he(99571),ze=he(70557),pe=he(51124),ge=he(25399),Fe=he(49661),Ie=he(72664),we=he(57884),fe=he(90524),Ke=he(14794),me=he(59301),rt=Object.defineProperty,Ne=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,Le=Object.prototype.propertyIsEnumerable,xe=(st,$e,lt)=>$e in st?rt(st,$e,{enumerable:!0,configurable:!0,writable:!0,value:lt}):st[$e]=lt,Oe=(st,$e)=>{for(var lt in $e||($e={}))De.call($e,lt)&&xe(st,lt,$e[lt]);if(Ne)for(var lt of Ne($e))Le.call($e,lt)&&xe(st,lt,$e[lt]);return st},Xe=(st,$e,lt)=>new Promise((it,Yt)=>{var Ye=Te=>{try{mt(lt.next(Te))}catch(Qe){Yt(Qe)}},Ge=Te=>{try{mt(lt.throw(Te))}catch(Qe){Yt(Qe)}},mt=Te=>Te.done?it(Te.value):Promise.resolve(Te.value).then(Ye,Ge);mt((lt=lt.apply(st,$e)).next())}),Je=({editOffice:st="view",data:$e,issaver:lt,onSaver:it,theme:Yt,type:Ye,filename:Ge,monacoEditor:mt,className:Te,style:Qe,close:Pe,onClose:ot,hasMask:$t,disabledDownload:wt,onImgDimensions:pn,showNodata:Ot,recordInfo:ve})=>{const[de,ut]=(0,ie.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[Jt,Ct]=(0,ie.useState)(""),[Be,tt]=(0,ie.useState)(),at=window.ENV==="build"?"/react/build":"",en=location.host.startsWith("localhost")?fe.Z.PROXY_SERVER:fe.Z.API_SERVER,Pt=10*(1024*1024),We=(0,ie.useRef)();$e!=null&&$e.startsWith("/api")&&Ye!=="txt"&&($e=fe.Z.API_SERVER+$e);const gt=oe=>oe.substring(oe.lastIndexOf("/")+1).split(".").pop();Ge&&mt&&(mt.filename=Ge),(0,ie.useEffect)(()=>{var oe,ue;const ne=(ue=(oe=document.cookie)==null?void 0:oe.replace(/\s/g,""))==null?void 0:ue.split(";");ne==null||ne.map(be=>{let Ve=be.split("=");Ve[0]==="_educoder_session"&&Ct(Ve[1])})},[]),(0,ie.useEffect)(()=>{Ye==="office"&&($e.indexOf("bigfilescdn.")>-1||$e.indexOf("bigfiles1")>-1?tt({url:$e,fileType:gt($e),model:$e.indexOf("model=edit")?"edit":"view"}):ae())},[Ye,$e]);function St(oe){return Xe(this,null,function*(){oe.data.type==="pdfdata"&&(it(oe.data.data),window.removeEventListener("message",St,!1)),console.log("mess---:",oe.data)})}const ae=()=>Xe(void 0,null,function*(){console.log("data:",$e);let oe=$e;$e.startsWith("http")||(oe=location.origin+oe);let ue=new URL(oe).pathname.split("/").pop();const ne=yield(0,Ie.gJ)({attachment_id:ue});ne.url=en+ne.url,tt(ne)}),te=()=>{if($e.startsWith("http")||$e.startsWith("blob:")){z();return}(0,Fe.Sv)(Ge||"educoder",$e,Ge)},z=()=>{ve&&(0,Ke.fc)({id:ve==null?void 0:ve.id,watch_type:1,course_id:ve==null?void 0:ve.course_id}),(0,Fe.Nd)(Ge||"educoder",decodeURIComponent($e))};return me.createElement("div",{style:Oe({},Qe||{}),className:`${$t&&et.bgBlack} ${Ye?et.wrp:"hide"}`},Pe&&me.createElement("div",{className:et.close,ref:We},!!pn&&me.createElement(ge.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>We.current},me.createElement("span",{onClick:()=>{ot(),pn()}},me.createElement("i",{className:"icon-yulanpizhu"}))),!wt&&me.createElement(ge.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>We.current},me.createElement("span",{onClick:z},me.createElement("i",{className:"icon-quxiaozhiding"}))),lt&&me.createElement(ge.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>We.current},me.createElement("span",{className:"",onClick:()=>{const oe=document.getElementById("pdfiframe");window.addEventListener("message",St,!1),setTimeout(()=>{oe.contentWindow.postMessage("getData","*")},300)}},me.createElement("i",{className:"icon-baocun"}))),me.createElement(ge.Z,{title:"\u5173\u95ED",getPopupContainer:()=>We.current},me.createElement("span",{className:"",onClick:()=>{ot()}},me.createElement("i",{className:"icon-guanbi1"})))),me.createElement("div",{className:`${et[Te]} ${Te} ${et.monaco} ${Ye==="txt"?"show":"hide"}`},Ye==="txt"&&me.createElement(me.Fragment,null,me.createElement(pe.ZP,Oe({},mt)))),Ye==="audio"&&me.createElement("audio",{src:`${($e==null?void 0:$e.indexOf("http://"))>-1||($e==null?void 0:$e.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${$e}`,autoPlay:!0}),Ye==="video"&&me.createElement(me.Fragment,null,($e==null?void 0:$e.indexOf("http"))>-1?me.createElement("video",{controls:!0,src:`${$e}`,autoPlay:!0}):me.createElement("video",{controls:!0,src:`data:video/mp4;base64,${$e}`,autoPlay:!0})),Ye==="office"&&Be&&me.createElement("iframe",{src:`${at}/office.html?key=${Be.key}&url=${btoa(Be.url)}&callbackUrl=${en+(Be.callbackUrl||"")}&fileType=${Be.fileType}&title=${Be.title||""}&model=${st}&officeServer=${fe.Z.ONLYOFFICE}&disabledDownload=${!!wt}`}),Ye==="html"&&me.createElement("iframe",{src:$e+"&disposition=inline"}),Ye==="pdf"&&me.createElement("iframe",{id:"pdfiframe",src:`${at}/js/pdfview/index.html?filename=${Ge||"educoder.pdf"}&url=${encodeURIComponent($e)}&disabledDownload=${!!wt}&model=${st}`}),Ye==="image"&&me.createElement("img",{src:`${($e==null?void 0:$e.indexOf("http://"))>-1||($e==null?void 0:$e.indexOf("https://"))>-1?"":"data:image/png;base64,"}${$e}`}),(Ye==="other"||Ye==="download")&&me.createElement(me.Fragment,null,Ot?me.createElement(we.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:me.createElement(Me.ZP,{icon:me.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:te,disabled:wt},"\u4E0B\u8F7D")}):me.createElement(Me.ZP,{type:"primary",size:"middle",onClick:te,disabled:wt},me.createElement(ze.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")),Ye==="flowChart"&&me.createElement("div",{className:"embed"},me.createElement("iframe",{src:`/drawio/src/main/webapp/viewer.html?id=${$e||""}&gapi=0&od=0&db=0&gh=0&gl=0`,width:"100%",height:"100%",frameBorder:"0"})))}},54657:function(At,_t,he){"use strict";he.d(_t,{h:function(){return De},x:function(){return Le}});var ie=he(2978),et=he(69092),Me=he(38394),ze=he(59301),pe=Object.defineProperty,ge=Object.defineProperties,Fe=Object.getOwnPropertyDescriptors,Ie=Object.getOwnPropertySymbols,we=Object.prototype.hasOwnProperty,fe=Object.prototype.propertyIsEnumerable,Ke=(xe,Oe,Xe)=>Oe in xe?pe(xe,Oe,{enumerable:!0,configurable:!0,writable:!0,value:Xe}):xe[Oe]=Xe,me=(xe,Oe)=>{for(var Xe in Oe||(Oe={}))we.call(Oe,Xe)&&Ke(xe,Xe,Oe[Xe]);if(Ie)for(var Xe of Ie(Oe))fe.call(Oe,Xe)&&Ke(xe,Xe,Oe[Xe]);return xe},rt=(xe,Oe)=>ge(xe,Fe(Oe)),Ne=(xe,Oe)=>{var Xe={};for(var Je in xe)we.call(xe,Je)&&Oe.indexOf(Je)<0&&(Xe[Je]=xe[Je]);if(xe!=null&&Ie)for(var Je of Ie(xe))Oe.indexOf(Je)<0&&fe.call(xe,Je)&&(Xe[Je]=xe[Je]);return Xe};const De=xe=>{var Oe=xe,{value:Xe,onChange:Je,scrollId:st}=Oe,$e=Ne(Oe,["value","onChange","scrollId"]);return ze.createElement("div",{id:st||""},ze.createElement(ie.Z,rt(me({},$e),{defaultValue:Xe,onChange:(lt,it)=>{it!=null&&it.length?Je(lt,it):Je(lt)}})))},Le=({value:xe,onChange:Oe,placeholder:Xe,height:Je=140,isEdit:st,miniToolbar:$e,watch:lt=!0})=>st?ze.createElement(ie.Z,{watch:lt,isFocus:!0,height:Je||void 0,placeholder:Xe,defaultValue:xe,onChange:Oe,miniToolbar:$e}):ze.createElement("div",{style:{cursor:"pointer"}},xe?ze.createElement(Me.Z,{className:et.Z.inputBorder,value:xe}):ze.createElement("div",{className:`${et.Z.inputBorder} ${et.Z.placeholder} inputBorderError`},Xe))},38394:function(At,_t,he){"use strict";he.d(_t,{z:function(){return mt},Z:function(){return Te}});var ie=he(59301),et=he(88831),Me=he(90290),ze=he(64018),pe=he(68535),ge=he(90524),Fe=he(49661),Ie=he(15342),we=he(77736),fe=he(99571),Ke=he(1012),me=he(41550),rt=he(59301),De=({html:Qe})=>{const Pe=(0,ie.useRef)(null),ot=(0,ie.useRef)(null),$t=`.markdown-body p {
margin: 0 0 16px 0 !important;
line-height: 28px;
white-space: pre-wrap;
}
ol,
ul,
li {
list-style-type: none
}
ol,
ul,
dl {
margin-bottom: 0px;
}
.markdown-body {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
color: #333;
overflow: hidden;
font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "\u534E\u6587\u7EC6\u9ED1", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "\u5B8B\u4F53", Heiti, "\u9ED1\u4F53", sans-serif;
word-break: break-word;
font-size: 16px;
line-height: 1.6;
white-space: normal;
word-wrap: break-word;
position: relative;
}
.markdown-body ul>li {
list-style-type: disc;
}
.markdown-body ol>li {
list-style-type: decimal;
}
.markdown-body a {
background: transparent;
}
.markdown-body a:active,
.markdown-body a:hover {
outline: 0;
}
.markdown-body strong {
font-weight: bold;
}
.markdown-body h1 {
font-size: 2em;
margin: 0.67em 0;
}
.markdown-body img {
border: 0;
}
.markdown-body hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
.markdown-body pre {
overflow: auto;
}
.markdown-body code,
.markdown-body kbd,
.markdown-body pre {
font-family: "Meiryo UI", "YaHei Consolas Hybrid", Consolas, "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace;
font-size: 1em;
}
.markdown-body input {
color: inherit;
font: inherit;
margin: 0;
}
.markdown-body html input[disabled] {
cursor: default;
}
.markdown-body input {
line-height: normal;
}
.markdown-body input[type="checkbox"] {
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 0;
}
.markdown-body table {
border-collapse: collapse;
border-spacing: 0;
}
.markdown-body td,
.markdown-body th {
padding: 0;
}
.markdown-body * {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.markdown-body input {
font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
}
.markdown-body a {
color: #4183c4;
text-decoration: none;
}
.markdown-body a:hover,
.markdown-body a:active {
text-decoration: underline;
}
.markdown-body hr {
height: 0;
margin: 15px 0;
overflow: hidden;
background: transparent;
border: 0;
border-bottom: 1px solid #ddd;
}
.markdown-body hr:before {
display: table;
content: "";
}
.markdown-body hr:after {
display: table;
clear: both;
content: "";
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
margin-top: 15px;
margin-bottom: 15px;
line-height: 1.1;
}
.markdown-body h1 {
font-size: 30px;
}
.markdown-body h2 {
font-size: 21px;
}
.markdown-body h3 {
font-size: 16px;
}
.markdown-body h4 {
font-size: 14px;
}
.markdown-body h5 {
font-size: 12px;
}
.markdown-body h6 {
font-size: 11px;
}
.markdown-body blockquote {
margin: 0;
}
.markdown-body ul,
.markdown-body ol {
padding: 0;
margin-top: 0;
margin-bottom: 0;
}
ul.linenums,
ol.linenums {
padding: 16px 0 0 56px !important;
}
.markdown-body ul,
.markdown-body ol {
padding-left: 2em;
}
.markdown-body ol ol,
.markdown-body ul ol {
list-style-type: lower-roman;
}
.markdown-body ul ul ol,
.markdown-body ul ol ol,
.markdown-body ol ul ol,
.markdown-body ol ol ol {
list-style-type: lower-alpha;
}
.markdown-body dd {
margin-left: 0;
}
.markdown-body code {
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-size: 12px;
}
.markdown-body pre {
margin-top: 0;
margin-bottom: 0;
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
.markdown-body .octicon {
font: normal normal 16px octicons-anchor;
line-height: 1;
display: inline-block;
text-decoration: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.markdown-body .octicon-link:before {
content: '\f05c';
}
.markdown-body>*:first-child {
margin-top: 0 !important;
}
.markdown-body>*:last-child {
margin-bottom: 0 !important;
}
.markdown-body .anchor {
position: absolute;
top: 0;
left: 0;
display: block;
padding-right: 6px;
padding-left: 30px;
margin-left: -30px;
}
.markdown-body .anchor:focus {
outline: none;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
position: relative;
margin-top: 1em;
margin-bottom: 16px;
font-weight: bold;
line-height: 1.4;
}
.markdown-body h1 .octicon-link,
.markdown-body h2 .octicon-link,
.markdown-body h3 .octicon-link,
.markdown-body h4 .octicon-link,
.markdown-body h5 .octicon-link,
.markdown-body h6 .octicon-link {
display: none;
color: #000;
vertical-align: middle;
}
.markdown-body h1:hover .anchor,
.markdown-body h2:hover .anchor,
.markdown-body h3:hover .anchor,
.markdown-body h4:hover .anchor,
.markdown-body h5:hover .anchor,
.markdown-body h6:hover .anchor {
padding-left: 8px;
margin-left: -30px;
text-decoration: none;
}
.markdown-body h1:hover .anchor .octicon-link,
.markdown-body h2:hover .anchor .octicon-link,
.markdown-body h3:hover .anchor .octicon-link,
.markdown-body h4:hover .anchor .octicon-link,
.markdown-body h5:hover .anchor .octicon-link,
.markdown-body h6:hover .anchor .octicon-link {
display: inline-block;
}
.markdown-body h1 {
padding-bottom: 0.3em;
font-size: 2.25em;
line-height: 1.2;
border-bottom: 1px solid #eee;
}
.markdown-body h1 .anchor {
line-height: 1;
}
.markdown-body h2 {
padding-bottom: 0.3em;
font-size: 1.75em;
line-height: 1.225;
border-bottom: 1px solid #eee;
}
.markdown-body h2 .anchor {
line-height: 1;
}
.markdown-body h3 {
font-size: 1.5em;
line-height: 1.43;
}
.markdown-body h3 .anchor {
line-height: 1.2;
}
.markdown-body h4 {
font-size: 1.25em;
}
.markdown-body h4 .anchor {
line-height: 1.2;
}
.markdown-body h5 {
font-size: 1em;
}
.markdown-body h5 .anchor {
line-height: 1.1;
}
.markdown-body h6 {
font-size: 1em;
color: #777;
}
.markdown-body h6 .anchor {
line-height: 1.1;
}
.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol,
.markdown-body dl,
.markdown-body table,
.markdown-body pre {
margin-top: 0;
margin-bottom: 16px;
}
.markdown-body ul ul,
.markdown-body ul ol,
.markdown-body ol ol,
.markdown-body ol ul {
margin-top: 0;
margin-bottom: 0;
}
.markdown-body li>p {
margin-top: 16px;
}
.markdown-body dl {
padding: 0;
}
.markdown-body dl dt {
padding: 0;
margin-top: 16px;
font-size: 1em;
font-style: italic;
font-weight: bold;
}
.markdown-body dl dd {
padding: 0 16px;
margin-bottom: 16px;
}
.markdown-body blockquote {
padding: 0 15px;
color: #777;
border-left: 4px solid #ddd;
}
.markdown-body blockquote> :first-child {
margin-top: 0;
}
.markdown-body blockquote> :last-child {
margin-bottom: 0;
}
.markdown-body table {
display: block;
width: 100%;
overflow: auto;
word-break: normal;
word-break: keep-all;
}
.markdown-body table th {
font-weight: bold;
text-align: revert;
}
.markdown-body table th,
.markdown-body table td {
padding: 6px 13px;
border: 1px solid #ddd;
}
.markdown-body table tr {
background-color: #fff;
border-top: 1px solid #ccc;
}
.markdown-body table tr:nth-child(2n) {
background-color: #f8f8f8;
}
.markdown-body img {
max-width: 100%;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.markdown-body code {
padding: 0;
padding-top: 0.2em;
padding-bottom: 0.2em;
margin: 0;
font-size: 85%;
background-color: rgba(0, 0, 0, 0.04);
border-radius: 3px;
}
.markdown-body code:has(.katex) {
background-color: transparent;
}
.markdown-body code:before,
.markdown-body code:after {
letter-spacing: -0.2em;
content: "\\00a0";
}
.markdown-body pre>code {
padding: 0;
margin: 0;
font-size: 100%;
word-break: normal;
white-space: pre;
background: transparent;
border: 0;
}
.markdown-body .highlight {
margin-bottom: 16px;
}
.markdown-body .highlight pre,
.markdown-body pre {
padding: 16px;
overflow: auto;
font-size: 85%;
line-height: 1.45;
background-color: #f7f7f7;
border-radius: 3px;
}
.markdown-body .highlight pre {
margin-bottom: 0;
word-break: normal;
}
.markdown-body pre {
word-wrap: normal;
}
.markdown-body pre code {
display: inline;
max-width: initial;
padding: 0;
margin: 0;
overflow: initial;
line-height: inherit;
word-wrap: normal;
background-color: transparent;
border: 0;
}
.markdown-body pre code:before,
.markdown-body pre code:after {
content: normal;
}
.markdown-body kbd {
display: inline-block;
padding: 3px 5px;
font-size: 11px;
line-height: 10px;
color: #555;
vertical-align: middle;
background-color: #fcfcfc;
border: solid 1px #ccc;
border-bottom-color: #bbb;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
}
.markdown-body .pl-c {
color: #969896;
}
.markdown-body .pl-c1,
.markdown-body .pl-mdh,
.markdown-body .pl-mm,
.markdown-body .pl-mp,
.markdown-body .pl-mr,
.markdown-body .pl-s1 .pl-v,
.markdown-body .pl-s3,
.markdown-body .pl-sc,
.markdown-body .pl-sv {
color: #0086b3;
}
.markdown-body .pl-e,
.markdown-body .pl-en {
color: #795da3;
}
.markdown-body .pl-s1 .pl-s2,
.markdown-body .pl-smi,
.markdown-body .pl-smp,
.markdown-body .pl-stj,
.markdown-body .pl-vo,
.markdown-body .pl-vpf {
color: #333;
}
.markdown-body .pl-ent {
color: #63a35c;
}
.markdown-body .pl-k,
.markdown-body .pl-s,
.markdown-body .pl-st {
color: #a71d5d;
}
.markdown-body .pl-pds,
.markdown-body .pl-s1,
.markdown-body .pl-s1 .pl-pse .pl-s2,
.markdown-body .pl-sr,
.markdown-body .pl-sr .pl-cce,
.markdown-body .pl-sr .pl-sra,
.markdown-body .pl-sr .pl-sre,
.markdown-body .pl-src {
color: #df5000;
}
.markdown-body .pl-mo,
.markdown-body .pl-v {
color: #1d3e81;
}
.markdown-body .pl-id {
color: #b52a1d;
}
.markdown-body .pl-ii {
background-color: #b52a1d;
color: #f8f8f8;
}
.markdown-body .pl-sr .pl-cce {
color: #63a35c;
font-weight: bold;
}
.markdown-body .pl-ml {
color: #693a17;
}
.markdown-body .pl-mh,
.markdown-body .pl-mh .pl-en,
.markdown-body .pl-ms {
color: #1d3e81;
font-weight: bold;
}
.markdown-body .pl-mq {
color: #008080;
}
.markdown-body .pl-mi {
color: #333;
font-style: italic;
}
.markdown-body .pl-mb {
color: #333;
font-weight: bold;
}
.markdown-body .pl-md,
.markdown-body .pl-mdhf {
background-color: #ffecec;
color: #bd2c00;
}
.markdown-body .pl-mdht,
.markdown-body .pl-mi1 {
background-color: #eaffea;
color: #55a532;
}
.markdown-body .pl-mdr {
color: #795da3;
font-weight: bold;
}
.markdown-body kbd {
display: inline-block;
padding: 3px 5px;
font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
line-height: 10px;
color: #555;
vertical-align: middle;
background-color: #fcfcfc;
border: solid 1px #ccc;
border-bottom-color: #bbb;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
}
.markdown-body .task-list-item {
list-style-type: none;
}
.markdown-body .task-list-item+.task-list-item {
margin-top: 3px;
}
.markdown-body .task-list-item input {
float: left;
margin: 0.3em 0 0.25em -1.6em;
vertical-align: middle;
}
.markdown-body :checked+.radio-label {
z-index: 1;
position: relative;
border-color: #4183c4;
}
/*! Pretty printing styles. Used with prettify.js. */
/* SPAN elements with the classes below are added by prettyprint. */
.pln {
color: #000
}
/* plain text */
@media screen {
.str {
color: #080
}
/* string content */
.kwd {
color: #008
}
/* a keyword */
.com {
color: #800
}
/* a comment */
.typ {
color: #606
}
/* a type name */
.lit {
color: #066
}
/* a literal value */
/* punctuation, lisp open bracket, lisp close bracket */
.pun,
.opn,
.clo {
color: #660
}
.tag {
color: #008
}
/* a markup tag name */
.atn {
color: #606
}
/* a markup attribute name */
.atv {
color: #080
}
/* a markup attribute value */
.dec,
.var {
color: #606
}
/* a declaration; a variable name */
.fun {
color: red
}
/* a function name */
}
/* Use higher contrast and text-weight for printable form. */
@media print,
projection {
.str {
color: #060
}
.kwd {
color: #006;
font-weight: bold
}
.com {
color: #600;
font-style: italic
}
.typ {
color: #404;
font-weight: bold
}
.lit {
color: #044
}
.pun,
.opn,
.clo {
color: #440
}
.tag {
color: #006;
font-weight: bold
}
.atn {
color: #404
}
.atv {
color: #060
}
}
/* Put a border around prettyprinted code snippets. */
pre.prettyprint {
padding: 2px;
/* border: 1px solid #888 */
}
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
margin-top: 0;
margin-bottom: 0
}
/* IE indents via margin-left */
li.L0,
li.L1,
li.L2,
li.L3,
li.L5,
li.L6,
li.L7,
li.L8 {
list-style-type: none
}
/* Alternate shading for lines */
li.L1,
li.L3,
li.L5,
li.L7,
li.L9 {
background: #eee
}
.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol,
.markdown-body dl,
.markdown-body table,
.markdown-body pre {
margin-top: 0;
margin-bottom: 16px;
}`;return(0,ie.useEffect)(()=>{const wt=Pe.current.attachShadow({mode:"open"});ot.current=document.createElement("div"),ot.current.className="markdown-body",ot.current.innerHTML=Qe,wt.appendChild(ot.current);const pn=document.createElement("style");return pn.textContent=$t,wt.appendChild(pn),()=>{wt.innerHTML=""}},[]),(0,ie.useEffect)(()=>{ot.current&&(ot.current.innerHTML=Qe)},[Qe]),rt.createElement("div",{ref:Pe})};function Le(Qe){const Pe=["onabort","onanimationend","onanimationiteration","onanimationstart","onauxclick","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncopy","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitionend","onvolumechange","onwaiting","onwheel"],ot=new RegExp(`\\b(${Pe.join("|")})\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s>]*)`,"gi");return Qe.replace(ot,"").trim()}var xe={mdBody:"mdBody___raKXb",button:"button___Ch5Pc",previewFlowChart:"previewFlowChart___vY1dq"},Oe=Object.defineProperty,Xe=Object.getOwnPropertySymbols,Je=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable,$e=(Qe,Pe,ot)=>Pe in Qe?Oe(Qe,Pe,{enumerable:!0,configurable:!0,writable:!0,value:ot}):Qe[Pe]=ot,lt=(Qe,Pe)=>{for(var ot in Pe||(Pe={}))Je.call(Pe,ot)&&$e(Qe,ot,Pe[ot]);if(Xe)for(var ot of Xe(Pe))st.call(Pe,ot)&&$e(Qe,ot,Pe[ot]);return Qe};const it="@\u2581\u2581@",Yt="@\u2581@",Ye=/<pre[^>]*>/g;function Ge(Qe){let Pe=document.createElement("div");return Pe.innerHTML=Qe,Pe.childNodes.length===0?"":Pe.childNodes[0].nodeValue}const mt=(Qe,Pe)=>{Qe=Qe||"";const ot=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,$t=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,wt=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,pn=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return Pe?Qe.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(ot,(Ot,ve,de,ut,Jt,Ct,Be)=>{const tt=ve||ut||Ct,at=de||Jt||Be||"?";return ge.Z.API_SERVER+"/api/attachments/"+tt+at+"&t="+(0,Fe.Jn)(tt,Date.now())+(Ot.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(Qe=Qe.replace(pn,(Ot,ve,de,ut,Jt,Ct,Be)=>{const tt=ve||ut||Ct,at=de||Jt||Be||"?";return ge.Z.API_SERVER+"/attachments/download/"+tt+at+"&t="+(0,Fe.Jn)(tt,Date.now())+(Ot.indexOf(")")>-1?")":"&")}).replace(ot,(Ot,ve,de,ut,Jt,Ct,Be)=>{const tt=ve||ut||Ct,at=de||Jt||Be||"?";return ge.Z.API_SERVER+"/api/attachments/"+tt+at+"&t="+(0,Fe.Jn)(tt,Date.now())+(Ot.indexOf(")")>-1?")":"&")}).replace($t,(Ot,ve,de,ut,Jt)=>{const Ct=ve||ut,Be=de||Jt||"";return'"'+ge.Z.API_SERVER+"/api/attachments/"+Ct+Be+Ct+Be+"&t="+(0,Fe.Jn)(Ct,Date.now())}).replace(wt,(Ot,ve,de,ut,Jt)=>{const Ct=ve||ut,Be=de||Jt||"";return"("+ge.Z.API_SERVER+"/files/uploads/"+Ct+Be+Ct+Be+"&t="+(0,Fe.Jn)(Ct,Date.now())}).replaceAll('src="(','src="').replaceAll("src='(",'src="').replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`),Qe)};var Te=({value:Qe="",edit:Pe=!1,className:ot,showTextOnly:$t,showLines:wt,style:pn={},stylesPrev:Ot={},highlightKeywords:ve,showProgramFill:de,isProgramFill:ut,disabledFill:Jt=!1,programFillValue:Ct,openEditor:Be=()=>{},onFillChange:tt=ct=>{},onFillBlur:at=()=>{},onFillFocus:en=()=>{}})=>{let ct=Le(String(Qe||""));const Pt=(0,ie.useRef)(),We=(0,ie.useRef)(),[gt,St]=(0,ie.useState)(""),[ae,te]=(0,ie.useState)("office"),[z,oe]=(0,ie.useState)([]),ue=(0,ie.useRef)("a"+(0,Ke.Z)()),ne={},be=Ue=>/<style[\s\S]*?>/i.test(Ue||""),Ve=(Ue,tn,ke)=>{const kt=document.createElement(Ue===Yt?"input":"textarea");kt.style.width="100%",kt.style.height=Ue===Yt?"40px":"151px",kt.rows=5,kt.spellcheck=!1,kt.name="edu-program-fill",kt.placeholder="\u8BF7\u8F93\u5165",kt.dataset.id=tn;const Zt=Object.keys(ne).length;return ne[Zt]=kt,`<span class="edu-program-fill-wrap ${Ue===Yt?"":"show"}" style="width:${Ue===Yt?"600px":"100%"}" title=${ke||""}><span>${kt.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function Tt(Ue){return Ue=Ue.replace(/!\[.*?\]\(.*?\)/g,""),Ue=Ue.replace(/\[.*?\]\(.*?\)/g,""),Ue=Ue.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),Ue=Ue.replace(/<embed.*?>/g,""),Ue=Ue.replace(/<img.*?>/g,""),Ue=Ue.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),Ue=Ue.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),Ue=Ue.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),Ue=Ue.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),Ue}const bt=Ue=>!$t&&be(ct)?Ue:Ue.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(tn,ke){let kt=ke.replace(/(\n|\r)/g,"").split("}"),Zt=[];return kt.map(_n=>{_n!=""&&Zt.push(`.${ue.current} ${_n}`)}),`<style>${Zt.join("}")}</style>`}),ft=(0,ie.useMemo)(()=>{try{const kt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,Zt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,_n=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,Rt=/\(\/attachments\/download\//g;ct=ct.replace(Rt,"("+ge.Z.API_SERVER+"/attachments/download/").replace(kt,"("+ge.Z.API_SERVER+"/api/attachments/").replace(Zt,'"'+ge.Z.API_SERVER+"/api/attachments/").replace(_n,'"'+ge.Z.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`),Pt.current.style.display="none"}catch(kt){}if(de){let kt=-1;return ct=ct.replaceAll("<","&lt;").replaceAll(">","&gt;").replace(/(@▁▁@|@▁@)/g,function(Zt,_n,Rt){var un;return++kt,Ve(Zt,kt,(un=Ct==null?void 0:Ct[kt])==null?void 0:un.value.replaceAll("<","&lt;").replaceAll(">","&gt;"))}),`<pre style="background:#fff;padding:4px">${bt(ct||"")}</pre>`}let Ue=bt(ct);Ue=(0,Me.ZP)(Ue);const tn=(0,Me.ez)();ct.match(/\[TOC\]/)&&(Ue=Ue.replace("<p>[TOC]</p>",(0,Me.Qv)()),(0,Me.Iy)()),Ue=Ue.replace(/(__special_katext_id_\d+__)/g,(kt,Zt)=>{const{type:_n,expression:Rt}=tn[Zt];return(0,Ie.renderToString)(Ge(Rt)||"",{displayMode:_n==="block",throwOnError:!1,output:"html"})}),Ue=Ue.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,Me.AL)();const ke=document.createElement("div");if(ke.innerHTML=Ue,$t)return ke.innerText;if(ve){const kt=ve.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return qe(ke,kt),ke.innerHTML}return setTimeout(()=>xt(),500),ke.innerHTML},[ct,ve]);(0,ie.useEffect)(()=>{nt.current&&nt.current.querySelectorAll(["input","textarea"]).forEach(tn=>{tn.oninput=yt,tn.onblur=Vt,tn.onfocus=Wt})},[z]),(0,ie.useEffect)(()=>{var Ue,tn,ke,kt,Zt;if(Ct!=null&&Ct.length)try{const _n=nt.current.querySelectorAll(".edu-program-fill-score"),Rt=nt.current.querySelectorAll('[name="edu-program-fill"]');for(const[un,$n]of Rt.entries())$n.value=((Ue=Ct==null?void 0:Ct[un])==null?void 0:Ue.value)||"",((tn=Ct==null?void 0:Ct[un])==null?void 0:tn.type)==="warning"?$n.className="program-fill-warning":((ke=Ct==null?void 0:Ct[un])==null?void 0:ke.type)==="success"?$n.className="program-fill-success":$n.className="";for(const[un,$n]of _n.entries())$n.innerHTML=(kt=Ct==null?void 0:Ct[un])!=null&&kt.score?`${(Zt=Ct==null?void 0:Ct[un])==null?void 0:Zt.score}\u5206`:"";oe(Ct)}catch(_n){console.log(_n,"error")}},[Ct]);const yt=Ue=>{z[Ue.target.dataset.id]=z[Ue.target.dataset.id]||{},z[Ue.target.dataset.id].value=Ue.target.value,oe([...z]),tt(z,Ue.target.dataset.id)},Vt=Ue=>{z[Ue.target.dataset.id]=z[Ue.target.dataset.id]||{},z[Ue.target.dataset.id].value=Ue.target.value,oe([...z]),at(z,Ue.target.dataset.id)},Wt=Ue=>{z[Ue.target.dataset.id]=z[Ue.target.dataset.id]||{},z[Ue.target.dataset.id].value=Ue.target.value,oe([...z]),en(z,Ue.target.dataset.id)};function qe(Ue,tn){return Ue.childNodes.forEach(ke=>{var kt;if(ke.childNodes.length>0)qe(ke,tn);else if(ke.nodeName!=="IMG")if(ke.innerHTML)ke.innerHTML=(kt=ke.innerHTML)==null?void 0:kt.replace(new RegExp(tn,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const Zt=document.createElement("span");Zt.innerHTML=ke.textContent.replace(new RegExp(tn,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),ke.replaceWith(Zt)}})}const nt=(0,ie.useRef)();Me.jb.WebkitLineClamp=wt,wt&&(pn=lt(lt({},pn),Me.jb));function _e(Ue){let tn=Ue.target;if(tn.tagName.toUpperCase()==="A"){let ke=tn.getAttribute("href");if(ke.indexOf("office")>-1)Ue.preventDefault(),St(ke),te("office");else if(ke.indexOf("application/pdf")>-1)Ue.preventDefault(),St(ke),te("pdf");else if(ke.indexOf("text/html")>-1)Ue.preventDefault(),St(ke),te("html");else if(ke.startsWith("#")){Ue.preventDefault();let kt=document.getElementById(ke.replace("#",""));kt&&kt.scrollIntoView(!0)}}}const xt=()=>{var Ue;const tn=(Ue=nt.current)==null?void 0:Ue.querySelectorAll("video");tn==null||tn.forEach(ke=>{if(ke.oncontextmenu=()=>!1,ke.src.indexOf(".m3u8")>-1&&!ke.canPlayType("application/vnd.apple.mpegurl")){if(pe.ZP.isSupported()){var kt=new pe.ZP;kt.loadSource(ke.src),kt.attachMedia(ke)}}})};(0,ie.useEffect)(()=>{if(nt.current&&ft&&ft.match(Ye)&&window.PR.prettyPrint(),nt.current)return nt.current.addEventListener("click",_e),()=>{var Ue;(Ue=nt.current)==null||Ue.removeEventListener("click",_e),(0,Me.AL)(),(0,Me.Iy)()}},[ft,nt.current,_e]);const Ft=Ue=>{Ue.target.nodeName==="IMG"&&Ue.target.className.indexOf("draw-flowchart")>-1?(Pt.current.style.zIndex=1,Pt.current.style.display="flex",Pt.current.style.width=Ue.target.clientWidth+"px",Pt.current.style.height=Ue.target.clientHeight+"px",Pt.current.style.top=Ue.target.offsetTop+"px",Pt.current.style.left=Ue.target.offsetLeft+"px",Ue.target.id&&(We.current=Ue.target.id)):Pt.current.style.display="none"},Qt=()=>{Pt.current.style.display="none"};return(0,ie.useEffect)(()=>{var Ue;const tn=ke=>{ke.preventDefault(),ke.clipboardData.setData("text",window.getSelection().toString())};return(Ue=nt.current)==null||Ue.addEventListener("copy",tn),()=>{var ke;(ke=nt.current)==null||ke.removeEventListener("copy",tn)}},[nt.current]),ie.createElement("div",{style:{position:"relative"},onMouseLeave:Qt},$t&&ie.createElement("div",{ref:nt,className:`${xe.mdBody} `},ft),!$t&&!be(ft)&&ie.createElement("div",{ref:nt,style:lt({},pn),onMouseOver:Ft,className:`${ot||""} ${Jt?"disabled-fill":""} markdown-body ${xe.mdBody} ${ue.current}`,dangerouslySetInnerHTML:{__html:ft}}),!$t&&be(ft)&&ie.createElement(De,{html:ft}),ie.createElement("div",{ref:Pt,className:`${xe.button} ${Pe?"":xe.previewFlowChart}`},ie.createElement(we.Z,null,ie.createElement(fe.ZP,{onClick:()=>{Pe?Be(We.current):(St(We.current),te("flowChart"))}},Pe?"\u7F16\u8F91":"\u9884\u89C8"))),ie.createElement(me.Z,{close:!0,data:gt,type:gt!=null&&gt.length?ae:"",style:lt({},Ot),onClose:()=>St("")}))}},44905:function(At,_t,he){"use strict";he.d(_t,{h:function(){return st}});var ie=he(59301),et=he(82326),Me=he(28284),ze=he(99571),pe=he(89780),ge=he.n(pe),Fe=he(66543),Ie=he(59598),we=Object.defineProperty,fe=Object.defineProperties,Ke=Object.getOwnPropertyDescriptors,me=Object.getOwnPropertySymbols,rt=Object.prototype.hasOwnProperty,Ne=Object.prototype.propertyIsEnumerable,De=($e,lt,it)=>lt in $e?we($e,lt,{enumerable:!0,configurable:!0,writable:!0,value:it}):$e[lt]=it,Le=($e,lt)=>{for(var it in lt||(lt={}))rt.call(lt,it)&&De($e,it,lt[it]);if(me)for(var it of me(lt))Ne.call(lt,it)&&De($e,it,lt[it]);return $e},xe=($e,lt)=>fe($e,Ke(lt));const Oe=et.default.Option,Xe={labelCol:{span:4},wrapperCol:{span:20}},Je={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"]};_t.Z=({callback:$e,onCancel:lt})=>{const[it,Yt]=(0,ie.useState)("python");function Ye(mt){Yt(Je[mt][1])}function Ge(mt){$e(mt)}return ie.createElement(Me.default,xe(Le({},Xe),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Ge,style:{width:500}}),ie.createElement(Me.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},ie.createElement(et.default,{getPopupContainer:mt=>mt.parentNode,onChange:Ye},Object.keys(Je).map(mt=>ie.createElement(Oe,{key:mt,value:mt},Je[mt][0])))),ie.createElement(Me.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},ie.createElement(st,{mode:it})),ie.createElement("div",{className:"flex-container flex-end"},ie.createElement(ze.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),ie.createElement(ze.ZP,{type:"ghost",onClick:lt},"\u53D6\u6D88")))};function st({value:$e,onChange:lt,mode:it,options:Yt={}}){const Ye=(0,ie.useRef)(),[Ge,mt]=(0,ie.useState)();return(0,ie.useEffect)(()=>{if(Ge){let Te=function(Qe){const Pe=Qe.getValue();lt&&lt(Pe)};return Ge.on("change",Te),()=>{Ge.off("change",Te)}}},[Ge,lt]),(0,ie.useEffect)(()=>{Ge&&Ge.setOption("mode",it)},[Ge,it]),(0,ie.useEffect)(()=>{Ge&&($e!==Ge.getValue()||$e==="")&&setTimeout(()=>{Ge.setValue($e||"")},300)},[Ge,$e]),(0,ie.useEffect)(()=>{if(Ye.current&&!Ge){const Te=ge().fromTextArea(Ye.current,Le({mode:it,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Yt));mt(Te)}},[Ye.current,Ge]),ie.createElement("div",{className:"my-codemirror-container"},ie.createElement("textarea",{ref:Ye}))}},2978:function(At,_t,he){"use strict";he.d(_t,{Z:function(){return jn}});var ie=he(59301),et=he(76560),Me=he(89780),ze=he.n(Me),pe=he(76374),ge=he(66543),Fe=he(6313),Ie=he(25717),we=he(99498),fe=he(25419),Ke=he(67549),me=he(38394),rt=({value:Gt="",className:cn,showTextOnly:xn,showLines:kn,style:Qn={}})=>{const Cn=(0,ie.useMemo)(()=>"",[Gt]);return ie.createElement(ie.Fragment,null,ie.createElement("div",{dangerouslySetInnerHTML:{__html:Cn}}))},Ne=Object.defineProperty,De=Object.defineProperties,Le=Object.getOwnPropertyDescriptors,xe=Object.getOwnPropertySymbols,Oe=Object.prototype.hasOwnProperty,Xe=Object.prototype.propertyIsEnumerable,Je=(Gt,cn,xn)=>cn in Gt?Ne(Gt,cn,{enumerable:!0,configurable:!0,writable:!0,value:xn}):Gt[cn]=xn,st=(Gt,cn)=>{for(var xn in cn||(cn={}))Oe.call(cn,xn)&&Je(Gt,xn,cn[xn]);if(xe)for(var xn of xe(cn))Xe.call(cn,xn)&&Je(Gt,xn,cn[xn]);return Gt},$e=(Gt,cn)=>De(Gt,Le(cn));let lt=[{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\u516C\u5F0F",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"md-iconfont icon-formula",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 it({onActionCallback:Gt,title:cn,icon:xn,actionName:kn,className:Qn="",children:Cn}){function Fn(){Gt(kn)}return ie.createElement("a",{title:cn,className:Qn,onClick:Fn},ie.createElement("i",{className:`${xn}`}),Cn)}var Yt=({watch:Gt,showNullButton:cn,showNullProgramButton:xn,onActionCallback:kn,fullScreen:Qn,insertTemp:Cn,hidetoolBar:Fn,extraUse:wn})=>{const rn=[...lt,{title:`${Gt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${Gt?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return ie.createElement("ul",{className:"markdown-toolbar-container"},!Fn&&rn.map((nn,dt)=>ie.createElement("li",{key:dt},nn.actionName?ie.createElement(it,$e(st({},nn),{onActionCallback:kn})):ie.createElement("span",{className:"v-line"}))),cn?ie.createElement("li",null,ie.createElement(it,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:kn},ie.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,xn?ie.createElement(ie.Fragment,null,ie.createElement("li",null,ie.createElement(it,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:kn},ie.createElement("span",{className:"fill-tip"},"\u6DFB\u52A0\u5355\u884C\u586B\u7A7A\u9879"))),ie.createElement("li",null,ie.createElement(it,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:kn},ie.createElement("span",{className:"fill-tip"},"\u6DFB\u52A0\u591A\u884C\u586B\u7A7A\u9879")))):null,Cn&&ie.createElement("li",null,ie.createElement(it,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${Cn}`,onActionCallback:kn},ie.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),wn&&ie.createElement("li",null,wn),ie.createElement("li",{className:"btn-full-screen"},ie.createElement(it,{icon:`${Qn?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:Qn?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:kn})))},Ye=he(75790),Ge=he(28284),mt=he(37568),Te=he(99571),Qe=Object.defineProperty,Pe=Object.defineProperties,ot=Object.getOwnPropertyDescriptors,$t=Object.getOwnPropertySymbols,wt=Object.prototype.hasOwnProperty,pn=Object.prototype.propertyIsEnumerable,Ot=(Gt,cn,xn)=>cn in Gt?Qe(Gt,cn,{enumerable:!0,configurable:!0,writable:!0,value:xn}):Gt[cn]=xn,ve=(Gt,cn)=>{for(var xn in cn||(cn={}))wt.call(cn,xn)&&Ot(Gt,xn,cn[xn]);if($t)for(var xn of $t(cn))pn.call(cn,xn)&&Ot(Gt,xn,cn[xn]);return Gt},de=(Gt,cn)=>Pe(Gt,ot(cn));const ut={labelCol:{span:4},wrapperCol:{span:20}};var Jt=({callback:Gt,onCancel:cn})=>{function xn(kn){Gt(kn)}return ie.createElement(Ge.default,de(ve({},ut),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:xn,style:{width:500}}),ie.createElement(Ge.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},ie.createElement(mt.default,null)),ie.createElement(Ge.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},ie.createElement(mt.default,null)),ie.createElement("div",{className:"flex-container flex-end"},ie.createElement(Te.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),ie.createElement(Te.ZP,{type:"ghost",onClick:cn},"\u53D6\u6D88")))},Ct=he(44905),Be=he(45596),tt=he(62957),at=he(77019),en=he(6077),ct=he(59301),Pt=({callback:Gt,onCancel:cn})=>{const xn=document.createElement("canvas"),kn=xn.getContext("2d");xn.width=1e3,xn.height=800,kn.fillStyle="#ffffff",kn.fillRect(0,0,xn.width,xn.height);const Qn=xn.toDataURL("image/png");return ct.createElement(tt.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},ct.createElement(at.Z,{style:{height:"100vh"}},ct.createElement(en.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:Qn,visible:!0,title:String(Date.now())},onOk:Cn=>{Gt({src:Cn.url})},onClose:cn})))},We=he(30641),gt=he(5269),St=he(6767),ae={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re",drawerWrap:"drawerWrap___MfDw8"},te=he(59301),oe=(0,ie.forwardRef)(({onCancel:Gt,editImgId:cn,callback:xn},kn)=>{let Qn=(0,ie.useRef)(),Cn=(0,ie.useRef)(),Fn=(0,ie.useRef)(),wn=(0,ie.useRef)(!1);const rn=(0,ie.useRef)(!1);console.log("ref:",kn);const[nn,dt]=(0,ie.useState)(0),[Ze,Bt]=(0,ie.useState)("100vh");return(0,ie.useEffect)(()=>{dt(1)},[]),(0,ie.useImperativeHandle)(kn,()=>({setHeight:Bt})),te.createElement("div",{ref:rn,className:"body-overflow-initial"},te.createElement(We.Z,{width:"100vw",height:Ze,footer:null,closable:!0,placement:"bottom",open:!!nn,destroyOnClose:!0,maskClosable:!1,mask:!1,rootClassName:`zIndex-9999 ${ae.drawerWrap}`,onClose:()=>{window.saveDrawData(hn=>{xn({src:`/api/attachments/${hn}`,id:hn})})},title:te.createElement(at.Z,{align:"middle"},te.createElement(gt.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),te.createElement(gt.Z,{onClick:()=>{Bt(Ze==="60px"?"100vh":"60px")}},te.createElement("span",{className:"current c-blue",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77")),te.createElement(gt.Z,{onClick:()=>{window.saveDrawData(hn=>{if(hn===null){St.ZP.warning({content:"\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u8BF7\u5148\u7ED8\u5236\u6D41\u7A0B\u56FE",key:"saveFlowChart"});return}St.ZP.success({content:"\u4FDD\u5B58\u6210\u529F",key:"saveFlowChart",style:{zIndex:999999999}}),xn({src:`/api/attachments/${hn}`,id:hn,disabledClose:!0})})}},te.createElement(Te.ZP,{type:"primary",className:"ml20"},"\u4FDD\u5B58")))},te.createElement("iframe",{src:`/drawio/src/main/webapp/?id=${cn||""}&gapi=0&od=0&db=0&gh=0&gl=0&local=0`,width:"100%",height:"100%",frameBorder:"0",ref:Cn})))}),ue=he(90524),ne=he(47889),be=he(71051);const Ve=ne.ZP.Group,Tt={margin:"0 8px"};var bt=({callback:Gt,onCancel:cn})=>{function xn(kn){Gt(kn)}return ie.createElement(Ge.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:xn},ie.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},ie.createElement("span",{style:Tt},"\u5355\u5143\u683C\u6570\uFF1A"),ie.createElement("span",{style:Tt},"\u884C\u6570"),ie.createElement(Ge.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},ie.createElement(be.Z,null)),ie.createElement("span",{style:Tt},"\u5217\u6570"),ie.createElement(Ge.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},ie.createElement(be.Z,null))),ie.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},ie.createElement("span",{style:Tt},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),ie.createElement(Ge.default.Item,{name:"align"},ie.createElement(Ve,null,ie.createElement(ne.ZP,{value:"default"},ie.createElement("i",{className:"fa fa-align-justify"})),ie.createElement(ne.ZP,{value:"left"},ie.createElement("i",{className:"fa fa-align-left"})),ie.createElement(ne.ZP,{value:"center"},ie.createElement("i",{className:"fa fa-align-center"})),ie.createElement(ne.ZP,{value:"right"},ie.createElement("i",{className:"fa fa-align-right"}))))),ie.createElement("div",{className:"flex-container flex-end"},ie.createElement(Te.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),ie.createElement(Te.ZP,{type:"ghost",onClick:cn},"\u53D6\u6D88")))},ft=he(71411),yt=he(11081),Vt=he.n(yt),qe=(0,ie.forwardRef)(({use3d:Gt,width:cn,height:xn,callback:kn,showSaveButton:Qn},Cn)=>{const Fn=(0,ie.useRef)(),wn=(0,ie.useRef)(),[rn,nn]=(0,ie.useState)(!1),dt=(0,ie.useRef)({id:Fn,appName:"graphing",width:cn||1e3,height:xn||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,ie.useEffect)(()=>{wn.current=new(Vt())(dt.current,!0),window.onload=function(){wn.current.inject("applet_container")}},[]);const Ze=()=>{var Bt=window.ggbApplet.getPNGBase64(1,!0,72);return kn&&kn(Bt),Bt};return(0,ie.useEffect)(()=>{dt.current.appName=rn?"3D":"graphing",wn.current.inject("applet_container")},[rn]),(0,ie.useEffect)(()=>{nn(Gt)},[Gt]),(0,ie.useImperativeHandle)(Cn,()=>({getImgData:Ze})),ie.createElement(ie.Fragment,null,ie.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:Fn}),ie.createElement(at.Z,{align:"middle"},ie.createElement(gt.Z,{flex:1},ie.createElement(ft.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:rn,onChange:Bt=>nn(Bt)})),ie.createElement(gt.Z,null,ie.createElement(Te.ZP,{size:"large",onClick:Ze,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),nt=he(88615);const _e="link",xt="upload-image",Ft="add-flowchart",Qt="draw-image",Ue="add-flowchart",tn="code-block",ke="add-table",kt="------------",Zt={default:kt,left:`:${kt}`,center:`:${kt}:`,right:`${kt}:`};var _n=he(17904),Rt=he(49661);function un(){}let $n=0;const Gn=1e4,bi="\u2581",xi="@\u2581\u2581@",ei="@\u2581@",Jn=`
**\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`,Dn=["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 ti(Gt){return/^\d+$/.test(Gt)?`${Gt}px`:Gt}const vn=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",Sn={[vn+"-B"]:"bold",[vn+"-I"]:"italic"},En={[_e]:"\u6DFB\u52A0\u94FE\u63A5",[tn]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[xt]:"\u6DFB\u52A0\u56FE\u7247",[Qt]:"\u6DFB\u52A0\u753B\u56FE",[Ft]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[ke]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var jn=({defaultValue:Gt="",onChange:cn,width:xn="100%",height:kn=400,miniToolbar:Qn=!1,isFocus:Cn=!1,watch:Fn,insertTemp:wn,mode:rn="markdown",id:nn="markdown-editor-id",showResizeBar:dt=!1,noStorage:Ze=!1,showNullButton:Bt=!1,showNullProgramButton:hn=!1,hidetoolBar:Rn=!1,fullScreen:Se=!1,onBlur:Ee,onCMBeforeChange:Et,onFullScreen:ht,className:Re="",disablePaste:pt=!1,disabled:Ut=!1,disabledFill:sn=!1,placeholder:dn="",values:It="",extraUse:Kt})=>{const[Ae,Tn]=(0,ie.useState)(null),[qt,bn]=(0,ie.useState)(Gt),[mn,Mn]=(0,ie.useState)(Fn),[Hn,mi]=(0,ie.useState)(Se),[Vn,On]=(0,ie.useState)(""),[ci,zn]=(0,ie.useState)(0),[gi,Ni]=(0,ie.useState)(kn),[hi,yi]=(0,ie.useState)(!1),[Mi,wi]=(0,ie.useState)(0),[ai,Pi]=(0,ie.useState)(0),li=(0,ie.useRef)(),fi=(0,ie.useRef)(),Ci=(0,ie.useRef)(),Di=(0,ie.useRef)(),pi=(0,ie.useRef)(),ri=(0,ie.useRef)(),ni=(0,et.useDispatch)();(0,ie.useEffect)(()=>{const Nt=window.scrollY||window.pageYOffset;bn(It),Ae==null||Ae.setValue(It),window.scrollTo(0,Nt)},[It]),(0,ie.useEffect)(()=>{ht==null||ht(Hn)},[Hn]),(0,ie.useEffect)(()=>{if(li.current){let Nt=function(jt,Xt){var Wn;if(pt){Xt.preventDefault();return}const Kn=Xt.clipboardData;if(Kn){const Ei=Kn.types.toString(),Xn=Kn.items;if(Ei==="Files"||Kn.types.indexOf("Files")>-1){if(Xt.preventDefault(),rn=="stex")return;try{let si=Xn[1];((Wn=Xn[0])==null?void 0:Wn.kind)==="file"&&(si=Xn[0]);const _i=si.getAsFile(),ji=_i.name.split(".").pop();(0,Be.I)(_i,Si=>{var Yi,Ai,dr;Si.id?((Yi=_i==null?void 0:_i.type)==null?void 0:Yi.indexOf("image"))>-1?Lt.replaceSelection(`<img width="100%" src="/api/attachments/${Si.id}?type=${Si.content_type})" alt="" />`):((Ai=_i==null?void 0:_i.type)==null?void 0:Ai.indexOf("video"))>-1?Lt.replaceSelection(`<video width="100%" controls src="/api/attachments/${Si.id}"></video>`):((dr=_i==null?void 0:_i.type)==null?void 0:dr.indexOf("pdf"))>-1?Lt.replaceSelection(`<a href="/api/attachments/${Si.id}?type=${_i.type}&disposition=inline" target="_blank">${_i.name}</a>`):Dn.includes(ji)?Lt.replaceSelection(`<a href="/api/attachments/${Si.id}?type=office&disposition=inline" target="_blank">${_i.name}</a>`):Lt.replaceSelection(`[${_i.name}](/api/attachments/${Si.id}?type=${Si.content_type})`):(Si==null?void 0:Si.status)===401&&(document.location.href="/user/login")})}catch(si){St.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const Lt=ze().fromTextArea(li.current,{mode:rn,lineNumbers:!Qn,lineWrapping:!0,value:Gt,autoCloseTags:!0,autoCloseBrackets:!0});return Lt.on("keyup",function(jt,Xt){Xt.keyCode===8&&(jt.getValue()==""?Lt.setOption("placeholder",dn):Lt.setOption("placeholder",null))}),Lt.on("keydown",function(jt,Xt){if(Xt.keyCode===8){var Wn=Zi(jt);Wn&&Xt.preventDefault()}}),Cn&&Lt.focus(),Lt.on("paste",Nt),Ut&&Lt.on("beforeChange",function(jt,Xt){(Xt.origin==="paste"||Xt.origin==="+input")&&Xt.cancel()}),Tn(Lt),()=>{Lt.off("paste",Nt)}}},[]);const Bi=(0,ie.useCallback)(()=>{if(fi.current)try{}catch(Nt){console.log(Nt,"---- to set md editor body height")}},[gi,fi,Hn]);(0,ie.useEffect)(()=>{function Nt(){let Lt=new pe.Z(jt=>{for(let Xt of jt)(Xt.target.offsetHeight>0||Xt.target.offsetWidth>0)&&(Bi(),Ae.setSize("100%","100%"),Ae.refresh())});return Lt.observe(li.current.parentElement),Lt}if(Ae){const Lt=Nt();return()=>{var jt,Xt;(jt=li.current)!=null&&jt.parentElement&&Lt.unobserve((Xt=li.current)==null?void 0:Xt.parentElement)}}},[Ae,Bi]),(0,ie.useEffect)(()=>{if(Ae){let Nt=[];for(const[Lt,jt]of Object.entries(Sn)){let Xt={[Lt]:()=>{Gi(jt)}};Nt.push(Xt),Ae.addKeyMap(Xt)}return()=>{for(let Lt of Nt)Ae.removeKeyMap(Lt)}}},[Ae]),(0,ie.useEffect)(()=>{Se!==Hn&&mi(Se)},[Se]),(0,_n.Z)(()=>{if(!Ze&&ci>0){let Nt=new Date().getTime(),Lt=window.sessionStorage.getItem(nn);Nt>=ci+Gn&&(!Lt||Lt!==qt)&&(window.sessionStorage.setItem(nn,qt),yi(!0))}},Gn),(0,ie.useEffect)(()=>{Mn(Fn)},[Ae,Fn]),(0,ie.useEffect)(()=>{Ae&&Cn&&Ae.focus()},[Ae,Cn]),(0,ie.useEffect)(()=>{if(mn&&Ae){let Nt=function(jt){let Xt=jt.target;if(Di.current){let Wn=Xt.scrollTop/Xt.scrollHeight;Di.current.scrollTop=Di.current.scrollHeight*Wn}};const Lt=Ae.getScrollerElement();return Lt.addEventListener("scroll",Nt),()=>{Lt.removeEventListener("scroll",Nt)}}},[Ae,mn]),(0,ie.useEffect)(()=>{if(Ae&&Et){let Nt=function(Lt,jt){Et(Lt,jt)};return Ae.on("beforeChange",Nt),()=>{Ae.off("beforeChange",Nt)}}},[Ae,Et]),(0,ie.useEffect)(()=>{if(Ae&&Ee){let Nt=function(){Ee(Ae.getValue())};return Ae.on("blur",Nt),()=>{Ae.off("blur",Nt)}}},[Ae,Ee]);function Zi(Nt,Lt){var jt=Nt.getDoc(),Xt=jt.getCursor(),Wn=jt.getLine(Xt.line),Kn=Wn.charAt(Xt.ch-1),Ei=Wn.lastIndexOf("@\u2581@",Xt.ch),Xn=Wn.lastIndexOf("@\u2581\u2581@",Xt.ch),si=Ei>Xn?Ei:Xn,_i=Ei>Xn?3:4;if(xi.indexOf(Kn)===-1)return null;if(console.log("change1:",Lt,Nt,Wn,Xt,si,Ei,Xn,Kn),si>=0&&Xt.ch-si<5){var ji=si+_i;return jt.replaceRange("",{line:Xt.line,ch:si},{line:Xt.line,ch:ji}),{line:Xt.line,ch:ji}}return null}(0,ie.useEffect)(()=>{if(Ae){let Nt=function(Lt,jt){const Xt=Lt.getValue();bn(Xt),zn(new Date().getTime()),Lt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),cn&&(hn?cn(Xt,Mt(Xt)):cn(Xt))};return Ae.on("change",Nt),()=>{Ae.off("change",Nt)}}},[Ae,cn]),(0,ie.useEffect)(()=>{if(Ae)if(Gt==null)Ae.setValue(""),bn("");else{const Nt=window.scrollY||window.pageYOffset;Gt!==Ae.getValue()&&(Ae.setValue(Gt),bn(Gt),Ae.setCursor(Ut?1:Ae.lineCount(),0),window.scrollTo(0,Nt))}},[Ae,Gt]);const Gi=(0,ie.useCallback)(Nt=>{const Lt=Ae.getCursor(),jt=Ae.getSelection();let Xt=jt.split(`
`);switch(Nt){case"bold":return Ae.replaceSelection("**"+jt+"**"),jt===""&&Ae.setCursor(Lt.line,Lt.ch+2),Ae.focus();case"italic":return Ae.replaceSelection("*"+jt+"*"),jt===""&&Ae.setCursor(Lt.line,Lt.ch+1),Ae.focus();case"code":return Ae.replaceSelection("`"+jt+"`"),jt===""&&Ae.setCursor(Lt.line,Lt.ch+1),Ae.focus();case"inline-latex":return(0,Rt.Ye)(ni)?void 0:(On("inline-latex"),Ae.focus());case"latex":return Ae.replaceSelection("```latex\n"+jt+"\n```"),Ae.setCursor(Lt.line+1,jt.length+1),Ae.focus();case"line-break":return Ae.replaceSelection(`<br/>
`),Ae.focus();case"list-ul":return jt===""?Ae.replaceSelection("- "+jt):Ae.replaceSelection(Xt.map(Wn=>Wn===""?"":`- ${Wn}`).join(`
`)),Ae.focus();case"list-ol":return jt===""?Ae.replaceSelection("1. "+jt):Ae.replaceSelection(Xt.map((Wn,Kn)=>Wn===""?"":`${Kn+1}. ${Wn}`).join(`
`)),Ae.focus();case"add-null-ch":return jt===""&&Ae.setCursor(Lt.line,Lt.ch),Ae.replaceSelection(bi),Ae.focus();case"add-signal":return jt===""&&Ae.setCursor(Lt.line,Lt.ch),Ae.replaceSelection(ei),Ae.focus();case"add-multiple":return jt===""&&Ae.setCursor(Lt.line,Lt.ch),Ae.replaceSelection(xi),Ae.focus();case"inster-template-1":return jt===""&&Ae.setCursor(Lt.line,Lt.ch),Ae.replaceSelection(Jn),Ae.focus();case"eraser":return Ae.setValue(""),Ae.focus();case"trigger-watch":return Mn(!mn),Ae.focus();case"trigger-full-screen":return mi(!Hn),Ae.focus();case _e:On(_e);return;case tn:On(tn);return;case xt:On(xt);return;case Qt:On(Qt);return;case"maths-latex":if((0,Rt.Ye)(ni))return;On("maths-latex");return;case Ft:pi.current="",sessionStorage.removeItem("file_id"),On(Ft);return;case ke:On(ke);return;default:throw new Error}},[Ae,mn,Hn]),oi=(0,ie.useCallback)((Nt,Lt)=>{var jt,Xt,Wn,Kn,Ei,Xn;Nt!=null&&Nt.disabledClose||On("");const{src:si,alt:_i,id:ji}=Nt||{};switch(Vn){case _e:const{title:zr,link:Ir}=Nt;return Ae.replaceSelection(`[${zr}](${Ir})`),Ae.focus();case tn:const{language:xr,content:mr}=Nt;return Ae.replaceSelection(["```"+xr,mr,"```"].join(`
`)),Ae.focus();case"maths-latex":for(var Si=atob(Nt),Yi=new Uint8Array(Si.length),Ai=0;Ai<Si.length;Ai++)Yi[Ai]=Si.charCodeAt(Ai);var dr=new Blob([Yi],{type:"image/png"});(0,Be.I)(dr,hr=>{hr.id?Ae.replaceSelection(`![,](/api/attachments/${hr.id}?type=${hr.content_type})`):(hr==null?void 0:hr.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":if((0,Rt.Ye)(ni))return;Ae.replaceSelection("`$$"+Nt+"$$`");break;case Ue:if(!ji)return;Ae.getValue().indexOf(si)===-1?Ae.replaceSelection(`<center><img id="${ji}" width="80%" src="${si}" class="draw-flowchart" alt="${_i||""}" /></center>`):document.getElementById(ji).src=ue.Z.API_SERVER+si+"?t="+Date.now();break;case xt:case Qt:const Li=Lt,wr=(Wn=(Xt=(jt=Li==null?void 0:Li.name)==null?void 0:jt.split("."))==null?void 0:Xt.pop)==null?void 0:Wn.call(Xt);return((Kn=Li==null?void 0:Li.type)==null?void 0:Kn.indexOf("image"))>-1||!(Li!=null&&Li.type)?Li!=null&&Li.align||Li!=null&&Li.width?Ae.replaceSelection(`<p style="text-align:${Li.align||"initial"}"><img width="${Li.width?Li.width+"%":"initial"}" src="${si}" alt="${_i||""}" /></p>`):Ae.replaceSelection(`<img width="100%" src="${si}" alt="${_i||""}" />`):((Ei=Li==null?void 0:Li.type)==null?void 0:Ei.indexOf("video"))>-1?Ae.replaceSelection(`<video width="100%" controls src="${si}"></video>`):((Xn=Li==null?void 0:Li.type)==null?void 0:Xn.indexOf("pdf"))>-1?Ae.replaceSelection(`<a href="${si}?type=${Li.type}&disposition=inline" target="_blank">${Li.name}</a>`):Dn.includes(wr)?Ae.replaceSelection(`<a href="${si}?type=office&disposition=inline" target="_blank">${Li.name}</a>`):Ae.replaceSelection(`[${Li.name}](${si})`),Ae.focus();case ke:const{row:eo,col:Xi,align:Nr}=Nt;let Xr=`
`;for(let hr=0;hr<eo;hr++){let ao=[],_r=[];for(let Oi=0;Oi<Xi;Oi++)hr===1&&_r.push(Zt[Nr]),ao.push(" ");hr===1&&(Xr+=`| ${_r.join(" | ")} |
`),Xr+=`| ${ao.join(Xi===1?"":" | ")} |
`}return Ae.replaceSelection(Xr+`
`),Ae.focus();default:throw new Error}},[Ae,Vn]),ar=(0,ie.useMemo)(()=>{switch(Vn){case _e:return ie.createElement(Jt,{callback:oi,onCancel:di});case tn:return ie.createElement(Ct.Z,{callback:oi,onCancel:di});case xt:return ie.createElement(Be.Z,{callback:oi,onCancel:di});case Ft:return ie.createElement(oe,{editImgId:pi.current,callback:oi,onCancel:di});case ke:return ie.createElement(bt,{callback:oi,onCancel:di});case"maths-latex":return ie.createElement(qe,{showSaveButton:!0,callback:oi});case"inline-latex":return ie.createElement(nt.Z,{showSaveButton:!0,callback:oi});default:return null}},[Vn]);function di(){On("")}(0,ie.useEffect)(()=>{if(Ci.current){let Nt=function(Ei){Wn=!0,Kn=Ei.pageY},Lt=function(){Wn=!1},jt=function(Ei){if(Wn){let Xn=Ei.pageY-Kn;Xn<0&&(Xn=0),Xn>300&&(Xn=300);let si=kn+Xn+"px";Ni(si)}},Xt=Ci.current,Wn=!1,Kn=0;return Xt.addEventListener("mousedown",Nt),document.addEventListener("mousemove",jt),document.addEventListener("mouseup",Lt),()=>{Xt.removeEventListener("mousedown",Nt),document.removeEventListener("mousemove",jt),document.removeEventListener("mouseup",Lt)}}},[Ae,Ci]),(0,ie.useEffect)(()=>{Ni(kn)},[kn]);const lr=ti(xn),tr=ti(gi),Ii={width:lr,height:tr},Un=(0,ie.useMemo)(()=>{if(ci){let Nt=new Date(ci),Lt=Nt.getHours(),jt=Nt.getMinutes(),Xt=Nt.getSeconds();return Lt=Lt<10?"0"+Lt:Lt,jt=jt<10?"0"+jt:jt,Xt=Xt<10?"0"+Xt:Xt,`${Lt}:${jt}:${Xt}`}return 0},[ci]),Mt=Nt=>{const Lt=[];if(hn){let jt=-1;Nt=Nt.replace(/(@▁▁@|@▁@)/g,function(Xt,Wn,Kn){Lt.push({multiLine:Xt!==ei})})}return Lt};function Ht(){window.sessionStorage.removeItem(nn),yi(!1),zn(0)}function gn(){yi(!1),zn(0),Ae.setValue(window.sessionStorage.getItem(nn))}(0,ie.useEffect)(()=>{En[Vn]&&Vn!==Qt&&Vn!==Ft&&setTimeout(()=>{const Nt=document.getElementsByClassName("markdown-popup-form")[0],Lt=window.innerWidth/2-Nt.offsetWidth/2,jt=window.innerHeight/2-Nt.offsetHeight/2;wi(Lt),Pi(jt)},0)},[Vn]);const on=Nt=>{Nt.preventDefault();const Lt=Nt.clientX-Mi,jt=Nt.clientY-ai;document.body.onmousemove=Xt=>{let Wn=Xt.clientX-Lt,Kn=Xt.clientY-jt;const Ei=document.getElementsByClassName("markdown-popup-form")[0],Xn=window.innerWidth-Ei.offsetWidth,si=window.innerHeight-Ei.offsetHeight;Wn=Math.max(0,Math.min(Wn,Xn)),Kn=Math.max(0,Math.min(Kn,si)),An(Xt.clientX,Xt.clientY,Lt,jt)&&(wi(Wn),Pi(Kn))},document.body.onmouseup=function(){document.body.onmousemove=null}},An=(Nt,Lt,jt,Xt)=>{const Wn=document.body.clientHeight,Kn=document.body.clientWidth;return Nt<20&&jt>Nt||Nt>Kn-20&&jt<Nt||Lt<20&&Xt>Lt||Lt>Wn-20&&Xt<Lt?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return ie.createElement(ie.Fragment,null,ie.createElement("div",{className:"markdown-editor-wrapper",ref:fi},ie.createElement("div",{className:`markdown-editor-container ${Re} ${mn?"on-preview":""} ${Qn?"mini":""} ${Hn?"full-screen":""}`,style:Ii},ie.createElement(Yt,{insertTemp:wn,watch:mn,fullScreen:Hn,showNullButton:Bt,showNullProgramButton:hn,onActionCallback:Gi,hidetoolBar:Rn,extraUse:Kt}),ie.createElement("div",{className:"markdown-editor-body"},ie.createElement("div",{className:"codemirror-container"},ie.createElement("textarea",{ref:li,placeholder:dn})),mn?ie.createElement("div",{ref:Di,className:"preview-container"},rn==="stex"&&ie.createElement(rt,{value:qt}),rn!=="stex"&&ie.createElement(me.Z,{edit:!0,disabledFill:sn,showProgramFill:hn,value:qt,openEditor:Nt=>{var Lt;pi.current=Nt,(Lt=ri.current)==null||Lt.setHeight("100vh"),setTimeout(()=>{On("add-flowchart")},150)}})):null))),dt?ie.createElement("a",{ref:Ci,className:"editor-resize"}):null,Vn===Qt&&ie.createElement(Pt,{callback:oi,onCancel:di}),Vn===Ft&&ie.createElement(oe,{ref:ri,editImgId:pi.current,callback:oi,onCancel:di}),ie.createElement(Ye.Z,null,En[Vn]&&Vn!==Qt&&Vn!==Ft?ie.createElement(tt.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:Mi,top:ai},title:ie.createElement("div",{style:{cursor:"move"},onMouseDown:on},En[Vn]),open:!0,onCancel:di,footer:null,destroyOnClose:!0,width:Vn===Ft?"1200px":null,height:Vn===Ft?"80vh":null,className:"markdown-popup-form"},ar):null))}},45596:function(At,_t,he){"use strict";he.d(_t,{Z:function(){return lt},I:function(){return Yt}});var ie=he(28284),et=he(6767),Me=he(37568),ze=he(77736),pe=he(71051),ge=he(47889),Fe=he(99571),Ie=he(67303),we=he(59301),fe=he(59301),Ke=Object.defineProperty,me=Object.defineProperties,rt=Object.getOwnPropertyDescriptors,Ne=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,Le=Object.prototype.propertyIsEnumerable,xe=(Ye,Ge,mt)=>Ge in Ye?Ke(Ye,Ge,{enumerable:!0,configurable:!0,writable:!0,value:mt}):Ye[Ge]=mt,Oe=(Ye,Ge)=>{for(var mt in Ge||(Ge={}))De.call(Ge,mt)&&xe(Ye,mt,Ge[mt]);if(Ne)for(var mt of Ne(Ge))Le.call(Ge,mt)&&xe(Ye,mt,Ge[mt]);return Ye},Xe=(Ye,Ge)=>me(Ye,rt(Ge));const{useForm:Je}=ie.default,st={width:280,marginRight:10},$e={labelCol:{span:5},wrapperCol:{span:19}};var lt=({callback:Ye,onCancel:Ge})=>{const[mt]=Je();let Te=(0,we.useRef)();function Qe($t){Te.current.width=mt.getFieldValue("width"),Te.current.align=mt.getFieldValue("align"),Ye($t,Te.current)}function Pe($t,wt){if($t.status===-1){et.ZP.error($t.message);return}mt.setFieldsValue({src:`/api/attachments/${$t.id}`,type:wt.type})}function ot($t){let wt=$t.target.files[0];Te.current=wt,Yt(wt,Pe)}return fe.createElement(ie.default,Xe(Oe({form:mt},$e),{className:"upload-image-panel",onFinish:Qe,style:{width:470,overflow:"hidden"}}),fe.createElement(ie.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},fe.createElement("div",{className:"flex-container"},fe.createElement(ie.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},fe.createElement(Me.default,{style:st})),fe.createElement(it,{onFileChange:ot}))),fe.createElement(ie.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},fe.createElement(Me.default,{style:{width:264}})),fe.createElement(ie.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},fe.createElement(ze.Z,null,fe.createElement(ie.default.Item,{name:"width",style:{margin:0}},fe.createElement(pe.Z,{style:{width:264}})),fe.createElement("span",{className:"ml8"},"%"))),fe.createElement(ie.default.Item,{label:"\u5BF9\u9F50\u65B9\u5F0F",name:"align"},fe.createElement(ge.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"}]})),fe.createElement("aside",null,fe.createElement(ie.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},fe.createElement(Fe.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),fe.createElement(Fe.ZP,{type:"default",onClick:Ge},"\u53D6\u6D88"))))};function it({onFileChange:Ye}){return fe.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",fe.createElement("input",{type:"file",onChange:Ye}))}function Yt(Ye,Ge){if(!Ye)throw new String("\u6CA1\u6709\u6587\u4EF6");let mt=new FormData;mt.append("editormd-image-file",Ye),mt.append("file_param_name","editormd-image-file"),mt.append("byxhr","true");var Te=new window.XMLHttpRequest;Te.withCredentials=!0,Te.addEventListener("load",function(Qe){Ge(JSON.parse(Qe.target.responseText),Ye)},!1),Te.addEventListener("error",function(Qe){console.error(Qe)},!1),Te.open("POST",`${Ie.KI}/api/attachments.json`),Te.send(mt)}},75790:function(At,_t,he){"use strict";he.d(_t,{Z:function(){return Me}});var ie=he(59301),et=he(4676);class Me extends ie.Component{constructor(pe){super(pe);const ge=window.document;this.node=ge.createElement("div"),ge.body.appendChild(this.node)}render(){const{children:pe}=this.props;return(0,et.createPortal)(pe,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},51124:function(At,_t,he){"use strict";he.d(_t,{SV:function(){return Pt},ZP:function(){return ct}});var ie=he(59301),et=he(76374);const Me={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},ze={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},pe={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},ge={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
`)}]},Fe={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],quickKey:[{label:"println",content:["println($0)"].join(`
`)}]};var Ie=he(53184),we=he.n(Ie),fe=(We,gt,St)=>new Promise((ae,te)=>{var z=ne=>{try{ue(St.next(ne))}catch(be){te(be)}},oe=ne=>{try{ue(St.throw(ne))}catch(be){te(be)}},ue=ne=>ne.done?ae(ne.value):Promise.resolve(ne.value).then(z,oe);ue((St=St.apply(We,gt)).next())});const Ke={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},me=(We,gt,St,ae)=>{const te=gt.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:St.lineNumber,endColumn:St.column});return Array.from(new Set(te.match(/\b\w{2,}\b/g)||[])).map(oe=>({label:oe,kind:We.languages.CompletionItemKind.Text,insertText:oe,range:ae}))},rt=(We,gt,St,ae)=>{We.languages.registerCompletionItemProvider(gt,{provideCompletionItems(te,z){const oe=te.getWordUntilPosition(z),ue={startLineNumber:z.lineNumber,endLineNumber:z.lineNumber,startColumn:oe.startColumn,endColumn:oe.endColumn},ne=te.getLineContent(z.lineNumber).substring(oe.startColumn-2,oe.endColumn);return{suggestions:[...me(We,te,z,ue),...St.map(Ve=>({label:Ve,kind:We.languages.CompletionItemKind.Keyword,documentation:Ve,insertText:Ve,insertTextRules:We.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ue})),...ae.map(Ve=>({label:Ve.label,kind:We.languages.CompletionItemKind.Snippet,documentation:Ve.content,insertText:ne.startsWith("#")?Ve.content.replace(/#/,""):Ve.content,insertTextRules:We.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ue}))]}}})};var Ne=We=>{Ke.languages.forEach(gt=>{We.languages.registerDocumentFormattingEditProvider(gt,{provideDocumentFormattingEdits(St){return fe(this,null,function*(){const ae=we()(St.getValue(),{indent_size:2,indent_char:" ",max_preserve_newlines:2,preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:0,indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1});return[{range:St.getFullModelRange(),text:ae}]})}})}),rt(We,"java",ze.keywords,ze.quickKey),rt(We,"cpp",pe.keywords,pe.quickKey),rt(We,"c",Me.keywords,[]),rt(We,"python",ge.keywords,ge.quickKey),rt(We,"scala",Fe.keywords,Fe.quickKey)};const De="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var Le=Object.defineProperty,xe=(We,gt,St)=>gt in We?Le(We,gt,{enumerable:!0,configurable:!0,writable:!0,value:St}):We[gt]=St,Oe=(We,gt,St)=>xe(We,typeof gt!="symbol"?gt+"":gt,St);const Xe=class Os{constructor(gt,St,ae){this.placeholder=gt,this.editor=St,this.monaco=ae,St.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return Os.ID}getDomNode(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.style.width="max-content",this.domNode.textContent=this.placeholder,this.domNode.style.fontStyle="initial",this.domNode.style.color="#D7D7D7",this.domNode.style.pointerEvents="none",this.editor.applyFontInfo(this.domNode)),this.domNode}getPosition(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}dispose(){this.editor.removeContentWidget(this)}};Oe(Xe,"ID","editor.widget.placeholderHint");var st=Xe,$e=he(96236),lt=he(6767),it=he(25399),Yt=he(89392),Ye=he(33796),Ge=he(56102),mt=Object.defineProperty,Te=Object.defineProperties,Qe=Object.getOwnPropertyDescriptors,Pe=Object.getOwnPropertySymbols,ot=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable,wt=(We,gt,St)=>gt in We?mt(We,gt,{enumerable:!0,configurable:!0,writable:!0,value:St}):We[gt]=St,pn=(We,gt)=>{for(var St in gt||(gt={}))ot.call(gt,St)&&wt(We,St,gt[St]);if(Pe)for(var St of Pe(gt))$t.call(gt,St)&&wt(We,St,gt[St]);return We},Ot=(We,gt)=>Te(We,Qe(gt)),ve=(We,gt)=>{var St={};for(var ae in We)ot.call(We,ae)&&gt.indexOf(ae)<0&&(St[ae]=We[ae]);if(We!=null&&Pe)for(var ae of Pe(We))gt.indexOf(ae)<0&&$t.call(We,ae)&&(St[ae]=We[ae]);return St},de=(We,gt,St)=>new Promise((ae,te)=>{var z=ne=>{try{ue(St.next(ne))}catch(be){te(be)}},oe=ne=>{try{ue(St.throw(ne))}catch(be){te(be)}},ue=ne=>ne.done?ae(ne.value):Promise.resolve(ne.value).then(z,oe);ue((St=St.apply(We,gt)).next())});function ut(We){return/^\d+$/.test(We)?`${We}px`:We}function Jt(){}let Ct=!1;const Be={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python",Scala:"scale",solidity:"sol"};function tt(We=[]){let gt=We;if(Array.isArray(We)){for(let St=0;St<We.length;St++){let ae=Be[We[St]];if(ae)return ae}return gt[0]}return Be[gt]||gt}let at=null;const en=()=>de(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(We){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",We)}});var ct=We=>{var gt=We,{width:St="100%",height:ae="100%",value:te,language:z="javascript",style:oe={},options:ue={},overrideServices:ne={},theme:be="vs-dark",onEditBlur:Ve,isCopy:Tt=!1,onSave:bt,autoHeight:ft=!1,forbidCopy:yt=!1,onChange:Vt=Jt,editorDidMount:Wt=Jt,onFocus:qe=Jt,onBreakPoint:nt=Jt,breakPointValue:_e=[],filename:xt="educoder.txt",errorLine:Ft,errorContent:Qt="",highlightLine:Ue,openBreakPoint:tn=!1,placeholder:ke="",showMiniMap:kt=!0}=gt,Zt=ve(gt,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder","showMiniMap"]);const _n=(0,ie.useRef)(),Rt=(0,ie.useRef)({}),un=(0,ie.useRef)(),$n=(0,ie.useRef)(),Gn=(0,ie.useRef)([]),bi=(0,ie.useRef)(!1),xi=(0,ie.useRef)(),ei=(0,ie.useRef)(),Jn=(0,ie.useRef)(!1),[Dn,ti]=(0,ie.useState)(!1);function Bn(){let dt;return _n.current&&(dt=new et.Z(Ze=>{for(let Bt of Ze)(Bt.target.offsetHeight>0||Bt.target.offsetWidth>0)&&Rt.current.instance.layout()}),dt.observe(_n.current)),dt}function vn(){lt.ZP.warning({content:decodeURIComponent(De),key:"monaco-editor-tip"})}const Sn=()=>{let dt=Rt.current.instance;if(te!=null&&dt&&Dn){const Ze=dt.getModel();Ze&&te!==Ze.getValue()&&(Ct=!0,Ze.setValue(te),dt.layout(),Ct=!1)}};(0,ie.useEffect)(()=>{const dt=Ye.Z.subscribe("formatDocument",Ze=>{var Bt;let hn=Rt.current.instance;(Bt=hn==null?void 0:hn.getAction)==null||Bt.call(hn,"editor.action.formatDocument").run()});return window.updateMonacoValue=Ze=>{Vt(Ze)},dt},[]),(0,ie.useEffect)(()=>{var dt;let Ze=Rt.current.instance;$n.current&&clearTimeout($n.current),$n.current=setTimeout(()=>{Sn()},500),te&&(te!=null&&te.length)&&((dt=Ze==null?void 0:Ze.updateOptions)==null||dt.call(Ze,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(te.split(/\r\n|\r|\n/g).length))+3,5)}))},[te,Dn,Rt.current]),(0,ie.useEffect)(()=>{if(Ft&&Rt.current&&Rt.current.instance){let Ze=Rt.current.instance;Ze.changeViewZones(function(Bt){var hn=document.createElement("div");hn.style.padding="10px 20px",hn.style.width="calc(100% - 20px)",hn.className="my-error-line-wrp",hn.innerHTML=Qt,Bt.addZone({afterLineNumber:Ft||11,heightInLines:3,domNode:hn})});var dt={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};Ze.addOverlayWidget(dt),Ze.revealPositionInCenter({lineNumber:20,column:1})}},[Ft,Rt.current,Dn]);const En=(dt="",Ze)=>{if(!dt||dt.trim()==="")return!0;const hn=Rt.current.instance.getModel().getLineTokens(Ze);let Rn=!1;for(let Se=0;Se<2;Se++)hn.getStandardTokenType(Se)===1&&(Rn=!0);return Rn};(0,ie.useEffect)(()=>{var dt;const Ze=(dt=Rt.current)==null?void 0:dt.instance;if(Ze&&Dn&&yt){const Bt=Ze.onDidBlurEditorWidget(()=>{Jn.current=!1}),hn=Ze.onDidFocusEditorText(()=>{Jn.current=!0});return()=>{Bt.dispose(),hn.dispose()}}},[Rt.current,Dn,yt]),(0,ie.useEffect)(()=>{var dt;if((dt=Rt.current)!=null&&dt.instance&&Dn&&tn){let Ze=Rt.current.instance,Bt=Ze.getModel();if(!Bt)return;(()=>{var It;let Kt=[],Ae=[];const Tn=Bt.getAllDecorations();for(let bn of Tn)bn.options.className==="highlighted-line"&&(Kt.push((It=bn==null?void 0:bn.range)==null?void 0:It.startLineNumber),Ae.push(bn==null?void 0:bn.id));if(Ue===Kt[0])return;Bt.deltaDecorations(Ae,[]);const qt=Bt.getLineCount();Ue&&Ue<=qt&&(Ze.deltaDecorations([],[{range:new at.Range(Ue,1,Ue,Bt.getLineMaxColumn(Ue)),options:{isWholeLine:!0,className:"highlighted-line"}}]),Ze.revealLineInCenter(Ue))})();const Rn=(It=!1)=>{var Kt;let Ae=[],Tn=[];const qt=Bt.getAllDecorations();for(let bn of qt)bn.options.linesDecorationsClassName==="breakpoints-select"&&(Ae.push((Kt=bn==null?void 0:bn.range)==null?void 0:Kt.startLineNumber),Tn.push(bn==null?void 0:bn.id));if(It)return{lines:Ae,ids:Tn};nt(Ae)},Se=It=>de(void 0,null,function*(){let Kt={range:new at.Range(It,1,It,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield Bt.deltaDecorations([],[Kt]),Rn()}),Ee=It=>de(void 0,null,function*(){let Kt=[];const Ae=Ze.getLineDecorations(It);for(let Tn of Ae)Tn.options.linesDecorationsClassName==="breakpoints-select"&&Kt.push(Tn.id);yield Bt.deltaDecorations(Kt,[]),Rn()}),Et=It=>{let Kt=Ze.getLineDecorations(It);for(let Ae of Kt)if(Ae.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,Yt.isEqual)(_e,Rn(!0).lines)){Bt.deltaDecorations(Rn(!0).ids,[]);const It=_e.map(Kt=>({range:new at.Range(Kt,1,Kt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));Bt.deltaDecorations([],It)}const ht=Ze.onDidChangeModelContent(It=>{let Kt=Ze.getPosition();if(Kt){let Ae=Kt.lineNumber;clearTimeout(ei.current),ei.current=setTimeout(()=>{En(Bt.getLineContent(Ae),Ae)?Ee(Ae):Et(Ae)?(Ee(Ae),Se(Ae)):Rn()},100)}}),Re=Ze.onMouseDown(It=>{var Kt,Ae,Tn;if(It.target.detail&&((Tn=(Ae=(Kt=It.target)==null?void 0:Kt.element)==null?void 0:Ae.className)!=null&&Tn.includes("line-numbers"))){let qt=It.target.position.lineNumber;if(En(Bt.getLineContent(qt),qt))return;Et(qt)?Ee(qt):Se(qt)}}),pt=It=>{let Kt={range:new at.Range(It,1,It,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Gn.current=Ze.deltaDecorations(Gn.current,[Kt])},Ut=()=>{Gn.current=Ze.deltaDecorations(Gn.current,[])},sn=Ze.onMouseMove(It=>{var Kt,Ae,Tn;if(Ut(),It.target.detail&&((Tn=(Ae=(Kt=It.target)==null?void 0:Kt.element)==null?void 0:Ae.className)!=null&&Tn.includes("line-numbers"))){let qt=It.target.position.lineNumber;if(En(Bt.getLineContent(qt),qt))return;pt(qt)}}),dn=Ze.onMouseLeave(()=>{Ut()});return()=>{ht.dispose(),Re.dispose(),sn.dispose(),dn.dispose()}}},[Rt.current,Dn,_e,Ue,tn,z]),(0,ie.useEffect)(()=>{var dt;(dt=Rt.current)!=null&&dt.instance&&tn&&Rt.current.instance.setPosition({lineNumber:0,column:0})},[Ue]);function jn(){let dt=Rt.current.instance;if(dt){const Ze=dt.getSelection(),Bt=Rt.current.pastePos||{},hn=new at.Range(Bt.startLineNumber||Ze.endLineNumber,Bt.startColumn||Ze.endColumn,Bt.endLineNumber||Ze.endLineNumber,Bt.endColumn||Ze.endColumn);setTimeout(()=>{dt.executeEdits("",[{range:hn,text:""}])},300)}}function Gt(dt){(window.navigator.platform.match("Mac")?dt.metaKey:dt.ctrlKey)&&dt.keyCode==83&&(dt.preventDefault(),bt())}const cn=()=>{if(ft&&Rt.current.instance){const dt=Rt.current.instance.getContentHeight();rn(dt<ae?ae:dt)}else rn(ae)};function xn(dt){var Ze=document.createEvent("MouseEvents");Ze.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),dt.dispatchEvent(Ze)}const kn=dt=>{if(!Jn.current)return;const{keyCode:Ze,ctrlKey:Bt,metaKey:hn,target:Rn,type:Se}=dt;return(Se==="paste"||(Ze===67||Ze===86)&&(hn||Bt))&&Rn.nodeName==="TEXTAREA"&&(vn(),dt.preventDefault()),!1};function Qn(dt,Ze){var Bt=window.URL||window.webkitURL||window,hn=new Blob([Ze]),Rn=document.createElementNS("http://www.w3.org/1999/xhtml","a");Rn.href=Bt.createObjectURL(hn),Rn.download=dt,xn(Rn)}(0,ie.useEffect)(()=>{cn()},[cn]),(0,ie.useEffect)(()=>{_n.current&&!Dn&&Promise.all([he.e(8909),he.e(5028)]).then(he.bind(he,71448)).then(dt=>{try{at=dt,Rt.current.instance=at.editor.create(_n.current,{value:te,language:tt(z),theme:be,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:kt||!1}},ne);const Ze=Rt.current.instance;let Rn=[...$e.BH._menuItems].find(ht=>ht[0]._debugName=="EditorContext")[1],Se=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Ee=(ht,Re)=>{var pt,Ut;let sn=ht._first;do Re.includes((Ut=(pt=sn.element)==null?void 0:pt.command)==null?void 0:Ut.id)&&ht._remove(sn);while(sn=sn.next)};if(Wt(Ze,at),setTimeout(()=>{cn(),Rt.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{Qn(xt||"educoder.txt",Ze.getValue())}})},500),Rt.current.subscription=Ze.onDidChangeModelContent(ht=>{bi.current?clearTimeout(xi.current):(cn(),Vt(Ze.getValue(),ht)),xi.current=setTimeout(()=>{bi.current=!1},500)}),window.Monaco||Ne(at,tt(z)),yt&&(Ee(Rn,Se),_n.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",kn),window.removeEventListener("paste",kn),window.addEventListener("keydown",kn),window.addEventListener("paste",kn)),window.Monaco=at,Ve&&Ze.onDidBlurEditorWidget(()=>{Ve(Ze.getValue())}),qe&&Ze.onDidFocusEditorText(()=>{yt&&en(),qe(Ze.getValue())}),yt){en();try{Ze.onDidPaste(ht=>{const Re=Ze.getSelection(),pt=Rt.current.pastePos||{},Ut=new at.Range(pt.startLineNumber||Re.endLineNumber,pt.startColumn||Re.endColumn,pt.endLineNumber||Re.endLineNumber,pt.endColumn||Re.endColumn);Ze.executeEdits("",[{range:ht.range,text:""}])})}catch(ht){}}let Et=Bn();return ke&&typeof ke=="string"&&new st(ke,Ze,at),ti(!0),()=>{const ht=Rt.current.instance;ht.dispose();const Re=ht.getModel();Re&&Re.dispose(),Rt.current.subscription&&Rt.current.subscription.dispose(),Et.unobserve(_n.current)}}catch(Ze){}})},[]),(0,ie.useEffect)(()=>{if(Rt.current.instance&&Dn)return document.addEventListener("keydown",Gt,!1),()=>{document.removeEventListener("keydown",Gt)}},[bt,Dn]),(0,ie.useEffect)(()=>{let dt=Rt.current.instance;if(dt&&Dn){let Ze=tt(z);at.editor.setModelLanguage(dt.getModel(),Ze)}},[z,Dn]),(0,ie.useEffect)(()=>{Rt.current.instance&&Dn&&at.editor.setTheme(be)},[be,Dn]),(0,ie.useEffect)(()=>{let dt=Rt.current.instance;un.current=ue,dt&&Dn&&(dt.updateOptions(pn({},ue)),setTimeout(()=>{dt.getModel().updateOptions(pn({},ue))},200))},[JSON.stringify(ue),Dn]),(0,ie.useEffect)(()=>{let dt=Rt.current.instance;dt&&Dn&&dt.layout()},[St,ae,Dn]);const[Cn,Fn]=(0,ie.useState)(ut(St)),[wn,rn]=(0,ie.useState)(ut(ae)),nn=Ot(pn({},oe),{width:Cn,height:wn,position:"relative"});return ie.createElement("div",{className:"my-monaco-editor",ref:_n,style:nn},Tt&&ie.createElement(Ge.CopyToClipboard,{text:te,onCopy:()=>lt.ZP.success("\u590D\u5236\u6210\u529F")},ie.createElement(it.Z,{title:"\u590D\u5236\u4EE3\u7801"},ie.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},ie.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function Pt({width:We="100%",height:gt="100%",original:St,modified:ae,language:te,options:z={}}){const oe=(0,ie.useRef)(),[ue,ne]=(0,ie.useState)(null);function be(ft){let yt;return oe.current&&(yt=new et.Z(Vt=>{for(let Wt of Vt)(Wt.target.offsetHeight>0||Wt.target.offsetWidth>0)&&ft.layout()}),yt.observe(oe.current)),yt}(0,ie.useEffect)(()=>(oe.current&&Promise.all([he.e(8909),he.e(9404)]).then(he.bind(he,2550)).then(ft=>{at=ft;const yt=at.editor.createDiffEditor(oe.current,Ot(pn({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},z),{wordWrap:!0}));ne(yt);let Vt=be(yt);return()=>{yt.dispose();const Wt=yt.getModel();Wt&&Wt.dispose(),Vt.unobserve(oe.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,ie.useEffect)(()=>{ue&&ue.setModel({original:at.editor.createModel(St,te),modified:at.editor.createModel(ae,te)})},[St,ae,te,ue]);const Ve=ut(We),Tt=ut(gt),bt={width:Ve,height:Tt};return ie.createElement("div",{className:"my-diff-editor",ref:oe,style:bt})}},17904:function(At,_t,he){"use strict";he.d(_t,{Z:function(){return et}});var ie=he(59301);function et(Me,ze){const pe=(0,ie.useRef)();(0,ie.useEffect)(()=>{pe.current=Me}),(0,ie.useEffect)(()=>{function ge(){pe.current()}if(ze!==null){let Fe=setInterval(ge,ze);return()=>clearInterval(Fe)}},[ze])}},67391:function(At,_t,he){"use strict";he.r(_t),he.d(_t,{default:function(){return Wt}});var ie=he(59301),et=he(76560),Me=he(28284),ze=he(6767),pe=he(37285),ge=he(91882),Fe=he(77019),Ie=he(5269),we=he(25399),fe=he(37568),Ke=he(99571),me=he(32134),rt=he(79763),Ne=he(62957),De=he(62673),Le=he(82326),xe=he(38394),Oe={flex_box_center:"flex_box_center___z7AIK",flex_space_between:"flex_space_between___zcbqj",flex_box_vertical_center:"flex_box_vertical_center___dTgjR",flex_box_center_end:"flex_box_center_end___z9WhB",flex_box_column:"flex_box_column___fDtsr",wrap:"wrap___fuJ7x",modal:"modal___Gq9oV",titleWrap:"titleWrap___T__HP",required:"required___CzJ8q",title:"title___PM33R",colorGray:"colorGray___jFiKo",choiceWrap:"choiceWrap___Htfyz",answer:"answer___AW61F",activeAnswer:"activeAnswer___Bt5i9",deleteIcon:"deleteIcon___mbWjv",addIcon:"addIcon___K4tkj",editorWrap:"editorWrap___RqcyT",htmlWrap:"htmlWrap___QqgN2",radio:"radio___UBWFG",color333:"color333___bOiTN",color999:"color999___ead_D",questionType:"questionType___VkggW",questionChoices:"questionChoices___Erma4"},Xe=Object.defineProperty,Je=Object.getOwnPropertySymbols,st=Object.prototype.hasOwnProperty,$e=Object.prototype.propertyIsEnumerable,lt=(qe,nt,_e)=>nt in qe?Xe(qe,nt,{enumerable:!0,configurable:!0,writable:!0,value:_e}):qe[nt]=_e,it=(qe,nt)=>{for(var _e in nt||(nt={}))st.call(nt,_e)&&lt(qe,_e,nt[_e]);if(Je)for(var _e of Je(nt))$e.call(nt,_e)&&lt(qe,_e,nt[_e]);return qe},Yt=(qe,nt)=>{var _e={};for(var xt in qe)st.call(qe,xt)&&nt.indexOf(xt)<0&&(_e[xt]=qe[xt]);if(qe!=null&&Je)for(var xt of Je(qe))nt.indexOf(xt)<0&&$e.call(qe,xt)&&(_e[xt]=qe[xt]);return _e},Ye=(qe,nt,_e)=>new Promise((xt,Ft)=>{var Qt=ke=>{try{tn(_e.next(ke))}catch(kt){Ft(kt)}},Ue=ke=>{try{tn(_e.throw(ke))}catch(kt){Ft(kt)}},tn=ke=>ke.done?xt(ke.value):Promise.resolve(ke.value).then(Qt,Ue);tn((_e=_e.apply(qe,nt)).next())});const Ge=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],mt=(qe,nt)=>{var _e=qe,{problemset:xt,globalSetting:Ft,loading:Qt,dispatch:Ue,onRef:tn=()=>{},editData:ke,editKey:kt,callback:Zt}=_e,_n=Yt(_e,["problemset","globalSetting","loading","dispatch","onRef","editData","editKey","callback"]);const[Rt,un]=(0,ie.useState)([]),[$n,Gn]=(0,ie.useState)(),[bi,xi]=(0,ie.useState)([]),[ei,Jn]=(0,ie.useState)(""),[Dn,ti]=(0,ie.useState)(0),[Bn,vn]=(0,ie.useState)(!0),[Sn,En]=(0,ie.useState)(!1),jn=(0,et.useParams)(),[Gt,cn]=(0,ie.useState)(""),[xn,kn]=(0,ie.useState)("");(0,ie.useEffect)(()=>{var nn,dt,Ze,Bt,hn,Rn,Se,Ee;if(!((nn=ke==null?void 0:ke.question)!=null&&nn.question_title)){un([{disabled:!1,value:""},{disabled:!1,value:""},{disabled:!1,value:""},{disabled:!1,value:""}]),vn(!0),Jn(""),En(!1);return}cn((dt=ke==null?void 0:ke.question)==null?void 0:dt.max_choices),kn((Ze=ke==null?void 0:ke.question)==null?void 0:Ze.min_choices),Jn((Bt=ke==null?void 0:ke.question)==null?void 0:Bt.question_title),vn(!!((hn=ke==null?void 0:ke.question)!=null&&hn.is_necessary)),un((Rn=ke==null?void 0:ke.question)==null?void 0:Rn.answers.map(Et=>({value:Et.answer_text,disabled:Et.answer_text==="\u5176\u5B83"}))),En(!!((Ee=(Se=ke==null?void 0:ke.question)==null?void 0:Se.answers)!=null&&Ee.find(Et=>Et.answer_text==="\u5176\u5B83")))},[ke]),(0,ie.useImperativeHandle)(nt,()=>({onSave:Qn}));const Qn=nn=>Ye(void 0,null,function*(){var dt;if(Gt&&!xn||!Gt&&xn){ze.ZP.info('\u53EF\u9009\uFF1A\u6700\u5C0F\u548C\u6700\u5927\u9650\u5236\u987B\u540C\u65F6\u4E3A\u6570\u503C\u6216\u8005\u201C--"');return}if(xn>Gt){ze.ZP.info("\u53EF\u9009\u7684\u6700\u5927\u9650\u5236\u4E0D\u80FD\u5C0F\u4E8E\u6700\u5C0F\u9650\u5236");return}if(!ei)return ze.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),!1;const Ze=Rt.findIndex(Rn=>!Rn.value);if(Ze>-1)return ze.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${Ge[Ze]} \u9009\u9879\u7684\u5185\u5BB9`),!1;let Bt;const hn={question_title:ei,question_type:2,insert_id:ke.insert_id,is_necessary:Math.ceil(Bn),max_choices:Gt,min_choices:xn,question_answers:Rt.map(Rn=>Rn.value)};if((dt=ke.question)!=null&&dt.id?Bt=yield(0,rt.wo)(it({pollsId:ke.question.id},hn)):Bt=yield(0,rt.Fd)(it({exercise_bank_id:jn.topicId},hn)),Bt.status===0){ze.ZP.success("\u4FDD\u5B58\u6210\u529F"),Zt("edit",-1);const Rn=yield Ue({type:"polls/getExerciseBanks",payload:it({},jn)});if(nn){hn.answers=hn.question_answers.map(Ee=>({answer_text:Ee}));const Se=[...Rn==null?void 0:Rn.questions,{question:it({type:2,insert_id:ke.question.id,key:ke.key,question_type:2},hn)}];Zt("addContinue",{editData:Se})}}}),Cn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-xiangshangyi current",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiangxiayi current",id:"down"},{name:"\u6DFB\u52A0",icon:"iconfont c-green ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjidaibeijing current",id:"edit"}],Fn=nn=>Ye(void 0,null,function*(){var dt,Ze;switch(nn.id){case"del":let Bt;Ne.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return Ye(this,null,function*(){var hn;yield(0,rt.x$)({pollsId:(hn=ke==null?void 0:ke.question)==null?void 0:hn.id}),Ue({type:"polls/getExerciseBanks",payload:it({},jn)})})}});break;case"up":case"down":yield(0,rt.vf)({pollsId:(dt=ke==null?void 0:ke.question)==null?void 0:dt.id,opr:nn.id}),Ue({type:"polls/getExerciseBanks",payload:it({},jn)});break;case"edit":Zt("edit",ke.key);break;case"add":Zt("add",{type:2,key:ke.key,insert_id:(Ze=ke==null?void 0:ke.question)==null?void 0:Ze.id,question_type:2});break}}),wn=()=>{var nn,dt,Ze,Bt;return ie.createElement("aside",null,ie.createElement("div",{className:Oe.questionType},ie.createElement("div",null,ie.createElement("span",{className:"font16"},"\u7B2C",ke.key,"\u9898"),ie.createElement("span",{className:"font16 c-light-black ml10"},"\u591A\u9009\u9898"),ie.createElement("span",{className:"tag-grey-eae ml10 mr10"},((nn=ke==null?void 0:ke.question)==null?void 0:nn.is_necessary)===0?"\u9009\u7B54":"\u5FC5\u7B54"),"\u53EF\u9009",(dt=ke==null?void 0:ke.question)==null?void 0:dt.min_choices,"-",(Ze=ke==null?void 0:ke.question)==null?void 0:Ze.max_choices,"\u9879"),Cn.map(function(hn,Rn){return hn.id==="up"&&ke.key===1||hn.id==="down"&&ke.key===ke.len?null:ie.createElement(we.Z,{key:Rn,placement:"bottom",title:hn.name},ie.createElement("span",{onClick:()=>Fn(hn),className:hn.icon}))})),ie.createElement("div",{className:"mt5"},ie.createElement(xe.Z,{value:ke.question.question_title})),ie.createElement("div",{className:Oe.questionChoices},(Bt=ke==null?void 0:ke.question.answers)==null?void 0:Bt.map(function(hn,Rn){return ie.createElement(Fe.Z,null,ie.createElement(Ie.Z,null,ie.createElement(De.default,{key:Rn,disabled:!0},ie.createElement("span",{className:"c-black font14"},hn.answer_text))))})))},rn=()=>ie.createElement("aside",null,ie.createElement("div",{className:Oe.questionType},ie.createElement("div",null,ie.createElement("span",{className:"font16 c-blue"},"\u591A\u9009\u9898")," ",ie.createElement(De.default,{checked:!!Bn,className:"ml10",onChange:nn=>vn(nn.target.checked)},"\u5FC5\u7B54"))),ie.createElement("p",{className:Oe.titleWrap},ie.createElement(fe.default.TextArea,{autoSize:{maxRows:5},rows:1,value:ei,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE",onChange:nn=>Jn(nn.target.value)})),Rt.map((nn,dt)=>ie.createElement(Fe.Z,{className:Oe.choiceWrap,key:dt,gutter:[12,12]},ie.createElement(Ie.Z,null,ie.createElement("span",{className:"font16"},"\u9009\u9879")),ie.createElement(Ie.Z,{className:Oe.editorWrap,flex:"1"},ie.createElement(fe.default.TextArea,{autoSize:{maxRows:5},value:Rt[dt].value,rows:1,disabled:!!nn.disabled,onChange:Ze=>{Rt[dt].value=Ze.target.value,un([...Rt])}})),ie.createElement(Ie.Z,null,dt>1&&ie.createElement(we.Z,{title:"\u5220\u9664"},ie.createElement("i",{className:`${Oe.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>{un(Rt.filter((Ze,Bt)=>Bt!==dt)),nn.disabled&&En(!1)}}))))),ie.createElement(Fe.Z,{gutter:[12,12]},ie.createElement(Ie.Z,null,"\u53EF\u9009"),ie.createElement(Ie.Z,null,ie.createElement(Le.default,{value:xn||"",style:{width:120},onChange:nn=>kn(nn)},ie.createElement(Le.default.Option,{value:""},"--"),Rt.map(function(nn,dt){return ie.createElement(Le.default.Option,{value:String(dt+1)},dt+1)})),ie.createElement("span",{className:"ml10 mr10"},"~"),ie.createElement(Le.default,{style:{width:120},value:Gt||"",onChange:nn=>cn(nn)},ie.createElement(Le.default.Option,{value:""},"--"),Rt.map(function(nn,dt){return ie.createElement(Le.default.Option,{value:String(dt+1)},dt+1)})),ie.createElement("span",{className:"font14 c-grey-999"},"\uFF08\u5B66\u751F\u7B54\u9898\u65F6\uFF0C\u7CFB\u7EDF\u5BF9\u5176\u9009\u62E9\u7684\u9009\u9879\u4E2A\u6570\u8FDB\u884C\u9650\u5236\uFF0C--\u8868\u793A\u4E0D\u9650\u5236\uFF09"))),ie.createElement(Fe.Z,{gutter:[12,12]},ie.createElement(Ie.Z,{flex:"1"},ie.createElement(Ke.ZP,{type:"default",onClick:()=>{Rt.find(nn=>nn.value==="\u5176\u5B83")?un([...Rt.filter(nn=>nn.value!=="\u5176\u5B83"),{value:""},{value:"\u5176\u5B83",disabled:!0}]):un([...Rt,{value:""}])}},"\u65B0\u589E\u9009\u9879"),!Sn&&ie.createElement(Ke.ZP,{type:"default",className:"ml20",onClick:()=>{un([...Rt,{disabled:!0,value:"\u5176\u5B83"}]),En(!0)}},"\u65B0\u589E\u5176\u5B83\u9009\u9879")),ie.createElement(Ie.Z,{className:"tl"},ie.createElement(Ke.ZP,{type:"default",onClick:()=>{var nn;(nn=ke.question)!=null&&nn.id?Zt("edit",-1):Zt("del",ke.key)}},"\u53D6\u6D88"),ie.createElement(Ke.ZP,{className:"ml20",type:"primary",onClick:()=>Qn()},"\u4FDD\u5B58"),ie.createElement(Ke.ZP,{className:"ml20",type:"primary",onClick:()=>Qn(!0)},"\u4FDD\u5B58\u5E76\u7EE7\u7EED"))));return ie.createElement("section",{className:Oe.wrap},kt!==ke.key&&wn(),kt===ke.key&&rn())};var Te=(0,et.connect)(({problemset:qe,loading:nt,globalSetting:_e})=>({problemset:qe,globalSetting:_e,loading:nt.effects}),null,null,{forwardRef:!0})((0,ie.forwardRef)(mt)),Qe=he(47889),Pe=Object.defineProperty,ot=Object.getOwnPropertySymbols,$t=Object.prototype.hasOwnProperty,wt=Object.prototype.propertyIsEnumerable,pn=(qe,nt,_e)=>nt in qe?Pe(qe,nt,{enumerable:!0,configurable:!0,writable:!0,value:_e}):qe[nt]=_e,Ot=(qe,nt)=>{for(var _e in nt||(nt={}))$t.call(nt,_e)&&pn(qe,_e,nt[_e]);if(ot)for(var _e of ot(nt))wt.call(nt,_e)&&pn(qe,_e,nt[_e]);return qe},ve=(qe,nt)=>{var _e={};for(var xt in qe)$t.call(qe,xt)&&nt.indexOf(xt)<0&&(_e[xt]=qe[xt]);if(qe!=null&&ot)for(var xt of ot(qe))nt.indexOf(xt)<0&&wt.call(qe,xt)&&(_e[xt]=qe[xt]);return _e},de=(qe,nt,_e)=>new Promise((xt,Ft)=>{var Qt=ke=>{try{tn(_e.next(ke))}catch(kt){Ft(kt)}},Ue=ke=>{try{tn(_e.throw(ke))}catch(kt){Ft(kt)}},tn=ke=>ke.done?xt(ke.value):Promise.resolve(ke.value).then(Qt,Ue);tn((_e=_e.apply(qe,nt)).next())});const ut=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Jt=(qe,nt)=>{var _e=qe,{problemset:xt,globalSetting:Ft,loading:Qt,dispatch:Ue,onRef:tn=()=>{},editData:ke,editKey:kt,callback:Zt}=_e,_n=ve(_e,["problemset","globalSetting","loading","dispatch","onRef","editData","editKey","callback"]);const[Rt,un]=(0,ie.useState)([]),[$n,Gn]=(0,ie.useState)(),[bi,xi]=(0,ie.useState)([]),[ei,Jn]=(0,ie.useState)(""),[Dn,ti]=(0,ie.useState)(0),[Bn,vn]=(0,ie.useState)(!1),[Sn,En]=(0,ie.useState)(!1),jn=(0,et.useParams)();(0,ie.useEffect)(()=>{var Cn,Fn,wn,rn,nn,dt;if(!((Cn=ke==null?void 0:ke.question)!=null&&Cn.question_title)){un([{disabled:!1,value:""},{disabled:!1,value:""},{disabled:!1,value:""},{disabled:!1,value:""}]),vn(!1),Jn(""),En(!1);return}Jn((Fn=ke==null?void 0:ke.question)==null?void 0:Fn.question_title),vn(!!((wn=ke==null?void 0:ke.question)!=null&&wn.is_necessary)),un((rn=ke==null?void 0:ke.question)==null?void 0:rn.answers.map(Ze=>({value:Ze.answer_text,disabled:Ze.answer_text==="\u5176\u5B83"}))),En(!!((dt=(nn=ke==null?void 0:ke.question)==null?void 0:nn.answers)!=null&&dt.find(Ze=>Ze.answer_text==="\u5176\u5B83")))},[ke]),(0,ie.useImperativeHandle)(nt,()=>({onSave:Gt}));const Gt=Cn=>de(void 0,null,function*(){var Fn;if(!ei)return ze.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),!1;const wn=Rt.findIndex(dt=>!dt.value);if(wn>-1)return ze.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${ut[wn]} \u9009\u9879\u7684\u5185\u5BB9`),!1;let rn;const nn={question_title:ei,question_type:1,insert_id:ke.insert_id,is_necessary:Math.ceil(Bn),question_answers:Rt.map(dt=>dt.value)};if((Fn=ke.question)!=null&&Fn.id?rn=yield(0,rt.wo)(Ot({pollsId:ke.question.id},nn)):rn=yield(0,rt.Fd)(Ot({exercise_bank_id:jn.topicId},nn)),rn.status===0){ze.ZP.success("\u4FDD\u5B58\u6210\u529F"),Zt("edit",-1);const dt=yield Ue({type:"polls/getExerciseBanks",payload:Ot({},jn)});if(Cn){nn.answers=nn.question_answers.map(Bt=>({answer_text:Bt}));const Ze=[...dt==null?void 0:dt.questions,{question:Ot({type:1,insert_id:ke.question.id,key:ke.key,question_type:1},nn)}];Zt("addContinue",{editData:Ze})}}}),cn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-xiangshangyi current",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiangxiayi current",id:"down"},{name:"\u6DFB\u52A0",icon:"iconfont c-green ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjidaibeijing current",id:"edit"}],xn=Cn=>de(void 0,null,function*(){var Fn,wn;switch(Cn.id){case"del":let rn;Ne.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return de(this,null,function*(){var nn;yield(0,rt.x$)({pollsId:(nn=ke==null?void 0:ke.question)==null?void 0:nn.id}),Ue({type:"polls/getExerciseBanks",payload:Ot({},jn)})})}});break;case"up":case"down":yield(0,rt.vf)({pollsId:(Fn=ke==null?void 0:ke.question)==null?void 0:Fn.id,opr:Cn.id}),Ue({type:"polls/getExerciseBanks",payload:Ot({},jn)});break;case"edit":Zt("edit",ke.key);break;case"add":Zt("add",{type:1,key:ke.key,insert_id:(wn=ke==null?void 0:ke.question)==null?void 0:wn.id,question_type:1});break}}),kn=()=>{var Cn,Fn;return ie.createElement("aside",null,ie.createElement("div",{className:Oe.questionType},ie.createElement("div",null,ie.createElement("span",{className:"font16"},"\u7B2C",ke.key,"\u9898"),ie.createElement("span",{className:"font16 c-light-black ml10"},"\u5355\u9009\u9898"),ie.createElement("span",{className:"tag-grey-eae ml10"},((Cn=ke==null?void 0:ke.question)==null?void 0:Cn.is_necessary)===0?"\u9009\u7B54":"\u5FC5\u7B54")),cn.map(function(wn,rn){return wn.id==="up"&&ke.key===1||wn.id==="down"&&ke.key===ke.len?null:ie.createElement(we.Z,{key:rn,placement:"bottom",title:wn.name},ie.createElement("span",{onClick:()=>xn(wn),className:wn.icon}))})),ie.createElement("div",{className:"mt5"},ie.createElement(xe.Z,{value:ke.question.question_title})),ie.createElement("div",{className:Oe.questionChoices},(Fn=ke==null?void 0:ke.question.answers)==null?void 0:Fn.map(function(wn,rn){return ie.createElement(Fe.Z,null,ie.createElement(Ie.Z,null,ie.createElement(Qe.ZP,{key:rn,disabled:!0})),ie.createElement(Ie.Z,{flex:"1"},ie.createElement("span",{className:"c-black font14"},wn.answer_text)))})))},Qn=()=>ie.createElement("aside",null,ie.createElement("div",{className:Oe.questionType},ie.createElement("div",null,ie.createElement("span",{className:"font16 c-blue"},"\u5355\u9009\u9898")," ",ie.createElement(De.default,{checked:!!Bn,className:"ml10",onChange:Cn=>vn(Cn.target.checked)},"\u5FC5\u7B54"))),ie.createElement("p",{className:Oe.titleWrap},ie.createElement(fe.default.TextArea,{autoSize:{maxRows:5},rows:1,value:ei,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE",onChange:Cn=>Jn(Cn.target.value)})),Rt.map((Cn,Fn)=>ie.createElement(Fe.Z,{className:Oe.choiceWrap,key:Fn,gutter:[12,12]},ie.createElement(Ie.Z,null,ie.createElement("span",{className:"font16"},"\u9009\u9879")),ie.createElement(Ie.Z,{className:Oe.editorWrap,flex:"1"},ie.createElement(fe.default.TextArea,{autoSize:{maxRows:5},value:Rt[Fn].value,rows:1,disabled:!!Cn.disabled,onChange:wn=>{Rt[Fn].value=wn.target.value,un([...Rt])}})),ie.createElement(Ie.Z,null,Fn>1&&ie.createElement(we.Z,{title:"\u5220\u9664"},ie.createElement("i",{className:`${Oe.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>{un(Rt.filter((wn,rn)=>rn!==Fn)),Cn.disabled&&En(!1)}}))))),ie.createElement(Fe.Z,{gutter:[12,12]},ie.createElement(Ie.Z,{flex:"1"},ie.createElement(Ke.ZP,{type:"default",onClick:()=>{Rt.find(Cn=>Cn.value==="\u5176\u5B83")?un([...Rt.filter(Cn=>Cn.value!=="\u5176\u5B83"),{value:""},{value:"\u5176\u5B83",disabled:!0}]):un([...Rt,{value:""}])}},"\u65B0\u589E\u9009\u9879"),!Sn&&ie.createElement(Ke.ZP,{type:"default",className:"ml20",onClick:()=>{un([...Rt,{disabled:!0,value:"\u5176\u5B83"}]),En(!0)}},"\u65B0\u589E\u5176\u5B83\u9009\u9879")),ie.createElement(Ie.Z,{className:"tl"},ie.createElement(Ke.ZP,{type:"default",onClick:()=>{var Cn;(Cn=ke.question)!=null&&Cn.id?Zt("edit",-1):Zt("del",ke.key)}},"\u53D6\u6D88"),ie.createElement(Ke.ZP,{className:"ml20",type:"primary",onClick:()=>Gt()},"\u4FDD\u5B58"),ie.createElement(Ke.ZP,{className:"ml20",type:"primary",onClick:()=>Gt(!0)},"\u4FDD\u5B58\u5E76\u7EE7\u7EED"))));return ie.createElement("section",{className:Oe.wrap},kt!==ke.key&&kn(),kt===ke.key&&Qn())};var Ct=(0,et.connect)(({problemset:qe,loading:nt,globalSetting:_e})=>({problemset:qe,globalSetting:_e,loading:nt.effects}),null,null,{forwardRef:!0})((0,ie.forwardRef)(Jt)),Be=Object.defineProperty,tt=Object.getOwnPropertySymbols,at=Object.prototype.hasOwnProperty,en=Object.prototype.propertyIsEnumerable,ct=(qe,nt,_e)=>nt in qe?Be(qe,nt,{enumerable:!0,configurable:!0,writable:!0,value:_e}):qe[nt]=_e,Pt=(qe,nt)=>{for(var _e in nt||(nt={}))at.call(nt,_e)&&ct(qe,_e,nt[_e]);if(tt)for(var _e of tt(nt))en.call(nt,_e)&&ct(qe,_e,nt[_e]);return qe},We=(qe,nt)=>{var _e={};for(var xt in qe)at.call(qe,xt)&&nt.indexOf(xt)<0&&(_e[xt]=qe[xt]);if(qe!=null&&tt)for(var xt of tt(qe))nt.indexOf(xt)<0&&en.call(qe,xt)&&(_e[xt]=qe[xt]);return _e},gt=(qe,nt,_e)=>new Promise((xt,Ft)=>{var Qt=ke=>{try{tn(_e.next(ke))}catch(kt){Ft(kt)}},Ue=ke=>{try{tn(_e.throw(ke))}catch(kt){Ft(kt)}},tn=ke=>ke.done?xt(ke.value):Promise.resolve(ke.value).then(Qt,Ue);tn((_e=_e.apply(qe,nt)).next())});const St=null,ae=(qe,nt)=>{var _e=qe,{problemset:xt,globalSetting:Ft,loading:Qt,dispatch:Ue,onRef:tn=()=>{},editData:ke,editKey:kt,callback:Zt}=_e,_n=We(_e,["problemset","globalSetting","loading","dispatch","onRef","editData","editKey","callback"]);const[Rt,un]=(0,ie.useState)(""),[$n,Gn]=(0,ie.useState)(!0),bi=(0,et.useParams)();(0,ie.useEffect)(()=>{var Bn,vn,Sn;if(!((Bn=ke==null?void 0:ke.question)!=null&&Bn.question_title)){Gn(!0),un("");return}un((vn=ke==null?void 0:ke.question)==null?void 0:vn.question_title),Gn(!!((Sn=ke==null?void 0:ke.question)!=null&&Sn.is_necessary))},[ke]),(0,ie.useImperativeHandle)(nt,()=>({onSave:xi}));const xi=Bn=>gt(void 0,null,function*(){var vn;if(!Rt)return ze.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),!1;let Sn;const En={question_title:Rt,question_type:3,insert_id:ke.insert_id,is_necessary:Math.ceil($n)};if((vn=ke.question)!=null&&vn.id?Sn=yield(0,rt.wo)(Pt({pollsId:ke.question.id},En)):Sn=yield(0,rt.Fd)(Pt({exercise_bank_id:bi.topicId},En)),Sn.status===0){ze.ZP.success("\u4FDD\u5B58\u6210\u529F"),Zt("edit",-1);const jn=yield Ue({type:"polls/getExerciseBanks",payload:Pt({},bi)});if(Bn){const Gt=[...jn==null?void 0:jn.questions,{question:Pt({type:3,insert_id:ke.question.id,key:ke.key,question_type:3},En)}];Zt("addContinue",{editData:Gt})}}}),ei=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"\u4E0A\u79FB",icon:"iconfont c-green ml30 icon-xiangshangyi current",id:"up"},{name:"\u4E0B\u79FB",icon:"iconfont c-green ml30 icon-xiangxiayi current",id:"down"},{name:"\u6DFB\u52A0",icon:"iconfont c-green ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-green ml30 icon-bianjidaibeijing current",id:"edit"}],Jn=Bn=>gt(void 0,null,function*(){var vn,Sn;switch(Bn.id){case"del":let En;Ne.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u95EE\u9898\u5417\uFF1F",onOk(){return gt(this,null,function*(){var jn;yield(0,rt.x$)({pollsId:(jn=ke==null?void 0:ke.question)==null?void 0:jn.id}),Ue({type:"polls/getExerciseBanks",payload:Pt({},bi)})})}});break;case"up":case"down":yield(0,rt.vf)({pollsId:(vn=ke==null?void 0:ke.question)==null?void 0:vn.id,opr:Bn.id}),Ue({type:"polls/getExerciseBanks",payload:Pt({},bi)});break;case"edit":Zt("edit",ke.key);break;case"add":Zt("add",{type:3,key:ke.key,insert_id:(Sn=ke==null?void 0:ke.question)==null?void 0:Sn.id,question_type:3});break}}),Dn=()=>{var Bn,vn;return ie.createElement("aside",null,ie.createElement("div",{className:Oe.questionType},ie.createElement("div",null,ie.createElement("span",{className:"font16"},"\u7B2C",ke.key,"\u9898"),ie.createElement("span",{className:"font16 c-light-black ml10"},"\u4E3B\u89C2\u9898"),ie.createElement("span",{className:"tag-grey-eae ml10 mr10"},((Bn=ke==null?void 0:ke.question)==null?void 0:Bn.is_necessary)===0?"\u9009\u7B54":"\u5FC5\u7B54")),ei.map(function(Sn,En){return Sn.id==="up"&&ke.key===1||Sn.id==="down"&&ke.key===ke.len?null:ie.createElement(we.Z,{key:En,placement:"bottom",title:Sn.name},ie.createElement("span",{onClick:()=>Jn(Sn),className:Sn.icon}))})),ie.createElement("div",{className:"mt5"},ie.createElement(xe.Z,{value:ke.question.question_title}),ie.createElement("div",{className:"mt15"},ie.createElement(fe.default.TextArea,{placeholder:"\u5728\u6B64\u586B\u5165\u7B54\u6848",rows:5,disabled:!0}))),ie.createElement("div",{className:Oe.questionChoices},(vn=ke==null?void 0:ke.question.answers)==null?void 0:vn.map(function(Sn,En){return ie.createElement(Fe.Z,null,ie.createElement(Ie.Z,null,ie.createElement(De.default,{key:En,disabled:!0},ie.createElement("span",{className:"c-black font14"},Sn.answer_text))))})))},ti=()=>ie.createElement("aside",null,ie.createElement("div",{className:Oe.questionType},ie.createElement("div",null,ie.createElement("span",{className:"font16 c-blue"},"\u4E3B\u89C2\u9898")," ",ie.createElement(De.default,{checked:!!$n,className:"ml10",onChange:Bn=>Gn(Bn.target.checked)},"\u5FC5\u7B54"))),ie.createElement("p",{className:Oe.titleWrap},ie.createElement(fe.default.TextArea,{autoSize:{maxRows:5},rows:1,value:Rt,placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE",onChange:Bn=>un(Bn.target.value)})),ie.createElement(Fe.Z,{gutter:[12,12]},ie.createElement(Ie.Z,{flex:"1"}),ie.createElement(Ie.Z,{className:"tl"},ie.createElement(Ke.ZP,{type:"default",onClick:()=>{var Bn;(Bn=ke.question)!=null&&Bn.id?Zt("edit",-1):Zt("del",ke.key)}},"\u53D6\u6D88"),ie.createElement(Ke.ZP,{className:"ml20",type:"primary",onClick:()=>xi()},"\u4FDD\u5B58"),ie.createElement(Ke.ZP,{className:"ml20",type:"primary",onClick:()=>xi(!0)},"\u4FDD\u5B58\u5E76\u7EE7\u7EED"))));return ie.createElement("section",{className:Oe.wrap},kt!==ke.key&&Dn(),kt===ke.key&&ti())};var te=(0,et.connect)(({problemset:qe,loading:nt,globalSetting:_e})=>({problemset:qe,globalSetting:_e,loading:nt.effects}),null,null,{forwardRef:!0})((0,ie.forwardRef)(ae)),z={flex_box_center:"flex_box_center___jFb53",flex_space_between:"flex_space_between___eaFhb",flex_box_vertical_center:"flex_box_vertical_center___Rp5aN",flex_box_center_end:"flex_box_center_end___EpEQ2",flex_box_column:"flex_box_column___hEFHr",bg:"bg___Y7Bmz",containerTitle:"containerTitle___xdxGQ",containerDesc:"containerDesc___pXaV0",listItem:"listItem___P0Hq4",info:"info___nZ3vt",title:"title___p_v5i",titleLeft:"titleLeft___d8_hx",titleRight:"titleRight___xz4zW",acitons:"acitons___BCczQ"},oe=he(54657),ue=Object.defineProperty,ne=Object.getOwnPropertySymbols,be=Object.prototype.hasOwnProperty,Ve=Object.prototype.propertyIsEnumerable,Tt=(qe,nt,_e)=>nt in qe?ue(qe,nt,{enumerable:!0,configurable:!0,writable:!0,value:_e}):qe[nt]=_e,bt=(qe,nt)=>{for(var _e in nt||(nt={}))be.call(nt,_e)&&Tt(qe,_e,nt[_e]);if(ne)for(var _e of ne(nt))Ve.call(nt,_e)&&Tt(qe,_e,nt[_e]);return qe},ft=(qe,nt)=>{var _e={};for(var xt in qe)be.call(qe,xt)&&nt.indexOf(xt)<0&&(_e[xt]=qe[xt]);if(qe!=null&&ne)for(var xt of ne(qe))nt.indexOf(xt)<0&&Ve.call(qe,xt)&&(_e[xt]=qe[xt]);return _e},yt=(qe,nt,_e)=>new Promise((xt,Ft)=>{var Qt=ke=>{try{tn(_e.next(ke))}catch(kt){Ft(kt)}},Ue=ke=>{try{tn(_e.throw(ke))}catch(kt){Ft(kt)}},tn=ke=>ke.done?xt(ke.value):Promise.resolve(ke.value).then(Qt,Ue);tn((_e=_e.apply(qe,nt)).next())});const Vt=qe=>{var nt=qe,{polls:_e,globalSetting:xt,loading:Ft,user:Qt,dispatch:Ue}=nt,tn=ft(nt,["polls","globalSetting","loading","user","dispatch"]),ke,kt,Zt,_n,Rt,un,$n,Gn,bi,xi,ei,Jn;const Dn=(0,et.useParams)(),{userInfo:ti}=Qt,[Bn]=Me.default.useForm(),[vn,Sn]=(0,ie.useState)([]),[En,jn]=(0,ie.useState)(!1);let[Gt,cn]=(0,ie.useState)(-1);const xn=[{name:"\u5355\u9009\u9898",id:1},{name:"\u591A\u9009\u9898",id:2},{name:"\u4E3B\u89C2\u9898",id:3}],kn=(0,ie.useRef)();(0,ie.useEffect)(()=>{var rn,nn,dt,Ze,Bt,hn;(rn=_e.exerciseBanks)!=null&&rn.questions&&(Sn([...(nn=_e.exerciseBanks)==null?void 0:nn.questions]),Bn.setFieldsValue({exercise_name:(Ze=(dt=_e.exerciseBanks)==null?void 0:dt.poll)==null?void 0:Ze.name,exercise_description:(hn=(Bt=_e.exerciseBanks)==null?void 0:Bt.poll)==null?void 0:hn.description}))},[_e.exerciseBanks]),(0,ie.useEffect)(()=>{Ue({type:"polls/getExerciseBanks",payload:bt({},Dn)})},[Dn.categoryId]);const Qn=()=>yt(void 0,null,function*(){yield Bn.validateFields();const rn=Bn.getFieldValue();rn.is_md=!0,rn.topicId=Dn.topicId,jn(!1),yield(0,rt.hO)(bt({},rn)),Ue({type:"polls/getExerciseBanks",payload:bt({},Dn)})}),Cn=rn=>yt(void 0,null,function*(){const nn=kn==null?void 0:kn.current;if(Gt!==-1){ze.ZP.error("\u4E0D\u80FD\u540C\u65F6\u7F16\u8F91\u4E24\u9898");return}cn(vn.length+1),Sn([...vn,{question:{question_type:rn}}])}),Fn=(rn,nn,dt)=>{var Ze;switch(rn){case"edit":if(nn!==-1&&Gt!==-1&&nn!==Gt){ze.ZP.error("\u4E0D\u80FD\u540C\u65F6\u7F16\u8F91\u4E24\u9898");return}cn(nn);return;case"add":if(Gt!=-1){ze.ZP.error("\u4E0D\u80FD\u540C\u65F6\u7F16\u8F91\u4E24\u9898");return}cn(-1);break;case"addContinue":Sn([...nn==null?void 0:nn.editData]),cn((Ze=nn==null?void 0:nn.editData)==null?void 0:Ze.length);break;case"del":vn.splice(nn-1,1),Sn([...vn]),cn(-1);break}},wn=function(){return vn==null?void 0:vn.map((rn,nn)=>{var dt;if(rn.key=nn+1,rn.len=vn.length,rn.question.question_type===1)return ie.createElement("aside",{key:rn.id},ie.createElement(Ct,{ref:kn,editKey:Gt,callback:Fn,editData:rn}),ie.createElement(pe.Z,null));if(rn.question.question_type===2)return ie.createElement("aside",{key:rn.id},ie.createElement(Te,{ref:kn,editKey:Gt,callback:Fn,editData:rn}),ie.createElement(pe.Z,null));if(((dt=rn.question)==null?void 0:dt.question_type)===3)return ie.createElement("aside",{key:rn.id},ie.createElement(te,{ref:kn,editKey:Gt,callback:Fn,editData:rn}),ie.createElement(pe.Z,null))})};return ie.createElement("section",{className:"edu-container"},ie.createElement("section",{className:"animated fadeIn"},ie.createElement("aside",{className:"mt10"},ti&&ie.createElement(ge.Z,{separator:">"},ie.createElement(ge.Z.Item,null,ie.createElement(et.Link,{to:`/users/${Dn.username}/${Dn.topictype==="personal"?"topics":"topicbank"}/${Dn.topictype}`},Dn.topictype==="personal"?"\u6211\u7684\u8BFE\u5802\u8D44\u6E90":"\u516C\u5171\u9898\u5E93")),ie.createElement(ge.Z.Item,null,ie.createElement(et.Link,{to:`/users/${ti==null?void 0:ti.login}/topics/${Dn.topicId}/${Dn.topictype}/poll/detail`},"\u8BE6\u60C5")),ie.createElement(ge.Z.Item,null,"\u7F16\u8F91"))),ie.createElement("aside",{className:[z.title,"mt20"].join(" ")},ie.createElement(Fe.Z,{style:{width:"100%"}},ie.createElement(Ie.Z,{flex:"1"},ie.createElement("strong",{className:"font20 ml5"},"\u7F16\u8F91")),ie.createElement(Ie.Z,null,ie.createElement(et.Link,{className:"font16 c-light-black",to:`/users/${ti.login}/topics/${Dn.topictype}`},"\u8FD4\u56DE"))))),ie.createElement("section",{className:[z.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},!En&&ie.createElement("aside",null,ie.createElement("div",{className:z.containerDesc},ie.createElement("div",null,(kt=(ke=_e.exerciseBanks)==null?void 0:ke.poll)==null?void 0:kt.name),ie.createElement("div",null,ie.createElement(we.Z,{title:"\u7F16\u8F91"},ie.createElement("span",{onClick:()=>jn(!0),className:"iconfont c-green ml30 icon-bianjidaibeijing"})))),ie.createElement(xe.Z,{className:"c-light-black",value:(_n=(Zt=_e.exerciseBanks)==null?void 0:Zt.poll)==null?void 0:_n.description})),En&&ie.createElement(Me.default,{layout:"vertical",form:Bn},ie.createElement(Me.default.Item,{name:"exercise_name",label:"\u95EE\u5377\u6807\u9898\uFF1A",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u95EE\u5377\u6807\u9898"}]},ie.createElement(fe.default,{maxLength:60,placeholder:"\u95EE\u5377\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"})),ie.createElement(Me.default.Item,{label:"\u95EE\u5377\u987B\u77E5\uFF1A",name:"exercise_description"},ie.createElement(oe.h,{scrollId:"exercise_description",placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u672C\u6B21\u95EE\u5377\u7B54\u9898\u7684\u76F8\u5173\u8BF4\u660E\uFF0C\u6700\u5927\u9650\u5236100\u4E2A\u5B57\u7B26"})),ie.createElement(Me.default.Item,{className:"tr"},ie.createElement(Ke.ZP,{type:"primary",onClick:()=>{Qn()}},"\u4FDD\u5B58")))),ie.createElement("section",{className:"mt20"},ie.createElement(Fe.Z,null,ie.createElement(Ie.Z,{flex:1},ie.createElement("span",{className:"c-light-black mr20"},"\u5355\u9009\u9898 ",(un=(Rt=_e.exerciseBanks)==null?void 0:Rt.question_types)==null?void 0:un.q_singles," \u9898"),ie.createElement("span",{className:"c-light-black mr20"},"\u591A\u9009\u9898 ",(Gn=($n=_e.exerciseBanks)==null?void 0:$n.question_types)==null?void 0:Gn.q_doubles," \u9898"),ie.createElement("span",{className:"c-light-black"},"\u4E3B\u89C2\u9898 ",(xi=(bi=_e.exerciseBanks)==null?void 0:bi.question_types)==null?void 0:xi.q_mains," \u9898")),ie.createElement(Ie.Z,{className:"c-light-black"},"\u5408\u8BA1 ",ie.createElement("span",{className:"c-orange"},(Jn=(ei=_e.exerciseBanks)==null?void 0:ei.question_types)==null?void 0:Jn.q_counts)," \u9898"))),vn!=""&&ie.createElement("section",{className:[z.bg,"pt30","pl20","pr20","pb20","mt20"].join(" ")},wn()),ie.createElement("section",{className:[z.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},xn.map(function(rn,nn){return ie.createElement(Ke.ZP,{className:"mr20",type:"primary",onClick:()=>Cn(rn.id)},ie.createElement(me.Z,{className:"mr5"}),rn.name)})))};var Wt=(0,et.connect)(({polls:qe,loading:nt,user:_e,globalSetting:xt})=>({polls:qe,globalSetting:xt,user:_e,loading:nt.effects}))(Vt)},90290:function(At,_t,he){"use strict";he.d(_t,{AL:function(){return st},Iy:function(){return Ke},Qv:function(){return Ne},ez:function(){return Je},jb:function(){return me}});var ie=he(32834),et=he.n(ie),Me=he(11690),ze=he.n(Me);let pe=1;function ge(Ye,Ge){const mt=Ye.match(/^(\s+)(?:```)/);if(mt===null)return Ge;const Te=mt[1];return Ge.split(`
`).map(Qe=>{const Pe=Qe.match(/^\s+/);if(Pe===null)return Qe;const[ot]=Pe;return ot.length>=Te.length?Qe.slice(Te.length):Qe}).join(`
`)}let Fe=[],Ie=["<ul>"];const we=new(et()).Renderer,fe=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Ke(){Fe.length=0,Ie=["<ul>"]}const me={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function rt(Ye,Ge,mt,Te){if(Ge>=Ye.length||Ye[Ge].level<=mt)return Ge;var Qe=Ye[Ge];Te.push("<li><a href='#"+pe+Qe.anchor+"'>"+Qe.text+"</a>"),Ge++;var Pe=[];return Ge=rt(Ye,Ge,Qe.level,Pe),Pe.length>0&&(Te.push("<ul>"),Pe.forEach(function(ot){Te.push(ot)}),Te.push("</ul>")),Te.push("</li>"),Ge=rt(Ye,Ge,mt,Te),Ge}function Ne(){return rt(Fe,0,0,Ie),Ie.push("</ul>"),Ie.join("")}const De={heading(Ye){const Ge=fe.exec(Ye);if(pe+=1,Ge)return{type:"heading",raw:Ge[0],depth:Ge[1].length,text:Ge[2]}},fences(Ye){const Ge=this.rules.block.fences.exec(Ye);if(Ge){const mt=Ge[0];let Te=ge(mt,Ge[3]||"");const Qe=Ge[2]?Ge[2].trim():Ge[2];if(["latex","katex","math"].indexOf(Qe)>=0){const Pe=Oe(),ot=Te;Te=Pe,Xe[Pe]={type:"block",expression:ot}}return{type:"code",raw:mt,lang:Qe,text:Te}}}},Le=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let xe=0;const Oe=()=>`__special_katext_id_${xe++}__`;let Xe={};function Je(){return Xe}function st(){xe=0,Xe={}}function $e(Ye){return Ye=Ye.replace(Le,(Ge,mt)=>{const Te=Oe();return Xe[Te]={type:"inline",expression:mt},Te}),Ye}const lt=we.listitem;we.listitem=function(Ye){return lt($e(Ye))};const it=we.paragraph;we.paragraph=function(Ye){return it($e(Ye))};const Yt=we.tablecell;we.tablecell=function(Ye,Ge){return Yt($e(Ye),Ge)},we.code=function(Ye,Ge,mt){const Te=(Ge||"").match(/\S*/)[0];return Te?["latex","katex","math"].indexOf(Te)>=0?`<p class='editormd-tex'>${Ye}</p>`:`<pre class="prettyprint linenums"><code class="language-${Ge}">${mt?Ye:(0,Me.escape)(Ye,!0)}</code></pre>
`:'<pre class="prettyprint linenums"><code>'+(mt?Ye:(0,Me.escape)(Ye,!0))+"</code></pre>"},we.heading=function(Ye,Ge,mt){let Te=this.options.headerPrefix+mt.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return Fe.push({anchor:Te,level:Ge,text:Ye}),"<h"+Ge+' id="'+pe+Te+'">'+Ye+"</h"+Ge+">"},et().setOptions({silent:!0,gfm:!0,pedantic:!1}),et().use({tokenizer:De,renderer:we}),_t.ZP=et()},99498:function(At,_t,he){(function(ie){ie(he(89780))})(function(ie){ie.defineOption("placeholder","",function(Ie,we,fe){var Ke=fe&&fe!=ie.Init;if(we&&!Ke)Ie.on("blur",pe),Ie.on("change",ge),Ie.on("swapDoc",ge),ie.on(Ie.getInputField(),"compositionupdate",Ie.state.placeholderCompose=function(){ze(Ie)}),ge(Ie);else if(!we&&Ke){Ie.off("blur",pe),Ie.off("change",ge),Ie.off("swapDoc",ge),ie.off(Ie.getInputField(),"compositionupdate",Ie.state.placeholderCompose),et(Ie);var me=Ie.getWrapperElement();me.className=me.className.replace(" CodeMirror-empty","")}we&&!Ie.hasFocus()&&pe(Ie)});function et(Ie){Ie.state.placeholder&&(Ie.state.placeholder.parentNode.removeChild(Ie.state.placeholder),Ie.state.placeholder=null)}function Me(Ie){et(Ie);var we=Ie.state.placeholder=document.createElement("pre");we.style.cssText="height: 0; overflow: visible",we.style.direction=Ie.getOption("direction"),we.className="CodeMirror-placeholder CodeMirror-line-like";var fe=Ie.getOption("placeholder");typeof fe=="string"&&(fe=document.createTextNode(fe)),we.appendChild(fe),Ie.display.lineSpace.insertBefore(we,Ie.display.lineSpace.firstChild)}function ze(Ie){setTimeout(function(){var we=!1,fe=Ie.getInputField();fe.nodeName=="TEXTAREA"?we=!fe.value:Ie.lineCount()==1&&(we=!/[^\u200b]/.test(fe.querySelector(".CodeMirror-line").textContent)),we?Me(Ie):et(Ie)},20)}function pe(Ie){Fe(Ie)&&Me(Ie)}function ge(Ie){var we=Ie.getWrapperElement(),fe=Fe(Ie);we.className=we.className.replace(" CodeMirror-empty","")+(fe?" CodeMirror-empty":""),fe?Me(Ie):et(Ie)}function Fe(Ie){return Ie.lineCount()===1&&Ie.getLine(0)===""}})},25717:function(At,_t,he){(function(ie){ie(he(89780))})(function(ie){var et={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},Me=ie.Pos;ie.defineOption("autoCloseBrackets",!1,function(De,Le,xe){xe&&xe!=ie.Init&&(De.removeKeyMap(pe),De.state.closeBrackets=null),Le&&(ge(ze(Le,"pairs")),De.state.closeBrackets=Le,De.addKeyMap(pe))});function ze(De,Le){return Le=="pairs"&&typeof De=="string"?De:typeof De=="object"&&De[Le]!=null?De[Le]:et[Le]}var pe={Backspace:we,Enter:fe};function ge(De){for(var Le=0;Le<De.length;Le++){var xe=De.charAt(Le),Oe="'"+xe+"'";pe[Oe]||(pe[Oe]=Fe(xe))}}ge(et.pairs+"`");function Fe(De){return function(Le){return me(Le,De)}}function Ie(De){var Le=De.state.closeBrackets;if(!Le||Le.override)return Le;var xe=De.getModeAt(De.getCursor());return xe.closeBrackets||Le}function we(De){var Le=Ie(De);if(!Le||De.getOption("disableInput"))return ie.Pass;for(var xe=ze(Le,"pairs"),Oe=De.listSelections(),Xe=0;Xe<Oe.length;Xe++){if(!Oe[Xe].empty())return ie.Pass;var Je=rt(De,Oe[Xe].head);if(!Je||xe.indexOf(Je)%2!=0)return ie.Pass}for(var Xe=Oe.length-1;Xe>=0;Xe--){var st=Oe[Xe].head;De.replaceRange("",Me(st.line,st.ch-1),Me(st.line,st.ch+1),"+delete")}}function fe(De){var Le=Ie(De),xe=Le&&ze(Le,"explode");if(!xe||De.getOption("disableInput"))return ie.Pass;for(var Oe=De.listSelections(),Xe=0;Xe<Oe.length;Xe++){if(!Oe[Xe].empty())return ie.Pass;var Je=rt(De,Oe[Xe].head);if(!Je||xe.indexOf(Je)%2!=0)return ie.Pass}De.operation(function(){var st=De.lineSeparator()||`
`;De.replaceSelection(st+st,null),De.execCommand("goCharLeft"),Oe=De.listSelections();for(var $e=0;$e<Oe.length;$e++){var lt=Oe[$e].head.line;De.indentLine(lt,null,!0),De.indentLine(lt+1,null,!0)}})}function Ke(De){var Le=ie.cmpPos(De.anchor,De.head)>0;return{anchor:new Me(De.anchor.line,De.anchor.ch+(Le?-1:1)),head:new Me(De.head.line,De.head.ch+(Le?1:-1))}}function me(De,Le){var xe=Ie(De);if(!xe||De.getOption("disableInput"))return ie.Pass;var Oe=ze(xe,"pairs"),Xe=Oe.indexOf(Le);if(Xe==-1)return ie.Pass;for(var Je=ze(xe,"closeBefore"),st=ze(xe,"triples"),$e=Oe.charAt(Xe+1)==Le,lt=De.listSelections(),it=Xe%2==0,Yt,Ye=0;Ye<lt.length;Ye++){var Ge=lt[Ye],mt=Ge.head,Te,Qe=De.getRange(mt,Me(mt.line,mt.ch+1));if(it&&!Ge.empty())Te="surround";else if(($e||!it)&&Qe==Le)$e&&Ne(De,mt)?Te="both":st.indexOf(Le)>=0&&De.getRange(mt,Me(mt.line,mt.ch+3))==Le+Le+Le?Te="skipThree":Te="skip";else if($e&&mt.ch>1&&st.indexOf(Le)>=0&&De.getRange(Me(mt.line,mt.ch-2),mt)==Le+Le){if(mt.ch>2&&/\bstring/.test(De.getTokenTypeAt(Me(mt.line,mt.ch-2))))return ie.Pass;Te="addFour"}else if($e){var Pe=mt.ch==0?" ":De.getRange(Me(mt.line,mt.ch-1),mt);if(!ie.isWordChar(Qe)&&Pe!=Le&&!ie.isWordChar(Pe))Te="both";else return ie.Pass}else if(it&&(Qe.length===0||/\s/.test(Qe)||Je.indexOf(Qe)>-1))Te="both";else return ie.Pass;if(!Yt)Yt=Te;else if(Yt!=Te)return ie.Pass}var ot=Xe%2?Oe.charAt(Xe-1):Le,$t=Xe%2?Le:Oe.charAt(Xe+1);De.operation(function(){if(Yt=="skip")De.execCommand("goCharRight");else if(Yt=="skipThree")for(var wt=0;wt<3;wt++)De.execCommand("goCharRight");else if(Yt=="surround"){for(var pn=De.getSelections(),wt=0;wt<pn.length;wt++)pn[wt]=ot+pn[wt]+$t;De.replaceSelections(pn,"around"),pn=De.listSelections().slice();for(var wt=0;wt<pn.length;wt++)pn[wt]=Ke(pn[wt]);De.setSelections(pn)}else Yt=="both"?(De.replaceSelection(ot+$t,null),De.triggerElectric(ot+$t),De.execCommand("goCharLeft")):Yt=="addFour"&&(De.replaceSelection(ot+ot+ot+ot,"before"),De.execCommand("goCharRight"))})}function rt(De,Le){var xe=De.getRange(Me(Le.line,Le.ch-1),Me(Le.line,Le.ch+1));return xe.length==2?xe:null}function Ne(De,Le){var xe=De.getTokenAt(Me(Le.line,Le.ch+1));return/\bstring/.test(xe.type)&&xe.start==Le.ch&&(Le.ch==0||!/\bstring/.test(De.getTokenTypeAt(Le)))}})},6313:function(At,_t,he){(function(ie){ie(he(89780),he(52730))})(function(ie){ie.defineOption("autoCloseTags",!1,function(we,fe,Ke){if(Ke!=ie.Init&&Ke&&we.removeKeyMap("autoCloseTags"),!!fe){var me={name:"autoCloseTags"};(typeof fe!="object"||fe.whenClosing!==!1)&&(me["'/'"]=function(rt){return ge(rt)}),(typeof fe!="object"||fe.whenOpening!==!1)&&(me["'>'"]=function(rt){return ze(rt)}),we.addKeyMap(me)}});var et=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],Me=["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 ze(we){if(we.getOption("disableInput"))return ie.Pass;for(var fe=we.listSelections(),Ke=[],me=we.getOption("autoCloseTags"),rt=0;rt<fe.length;rt++){if(!fe[rt].empty())return ie.Pass;var Ne=fe[rt].head,De=we.getTokenAt(Ne),Le=ie.innerMode(we.getMode(),De.state),xe=Le.state,Oe=Le.mode.xmlCurrentTag&&Le.mode.xmlCurrentTag(xe),Xe=Oe&&Oe.name;if(!Xe)return ie.Pass;var Je=Le.mode.configuration=="html",st=typeof me=="object"&&me.dontCloseTags||Je&&et,$e=typeof me=="object"&&me.indentTags||Je&&Me;De.end>Ne.ch&&(Xe=Xe.slice(0,Xe.length-De.end+Ne.ch));var lt=Xe.toLowerCase();if(!Xe||De.type=="string"&&(De.end!=Ne.ch||!/[\"\']/.test(De.string.charAt(De.string.length-1))||De.string.length==1)||De.type=="tag"&&Oe.close||De.string.indexOf("/")==Ne.ch-De.start-1||st&&Fe(st,lt)>-1||Ie(we,Le.mode.xmlCurrentContext&&Le.mode.xmlCurrentContext(xe)||[],Xe,Ne,!0))return ie.Pass;var it=typeof me=="object"&&me.emptyTags;if(it&&Fe(it,Xe)>-1){Ke[rt]={text:"/>",newPos:ie.Pos(Ne.line,Ne.ch+2)};continue}var Yt=$e&&Fe($e,lt)>-1;Ke[rt]={indent:Yt,text:">"+(Yt?`
`:"")+"</"+Xe+">",newPos:Yt?ie.Pos(Ne.line+1,0):ie.Pos(Ne.line,Ne.ch+1)}}for(var Ye=typeof me=="object"&&me.dontIndentOnAutoClose,rt=fe.length-1;rt>=0;rt--){var Ge=Ke[rt];we.replaceRange(Ge.text,fe[rt].head,fe[rt].anchor,"+insert");var mt=we.listSelections().slice(0);mt[rt]={head:Ge.newPos,anchor:Ge.newPos},we.setSelections(mt),!Ye&&Ge.indent&&(we.indentLine(Ge.newPos.line,null,!0),we.indentLine(Ge.newPos.line+1,null,!0))}}function pe(we,fe){for(var Ke=we.listSelections(),me=[],rt=fe?"/":"</",Ne=we.getOption("autoCloseTags"),De=typeof Ne=="object"&&Ne.dontIndentOnSlash,Le=0;Le<Ke.length;Le++){if(!Ke[Le].empty())return ie.Pass;var xe=Ke[Le].head,Oe=we.getTokenAt(xe),Xe=ie.innerMode(we.getMode(),Oe.state),Je=Xe.state;if(fe&&(Oe.type=="string"||Oe.string.charAt(0)!="<"||Oe.start!=xe.ch-1))return ie.Pass;var st,$e=Xe.mode.name!="xml"&&we.getMode().name=="htmlmixed";if($e&&Xe.mode.name=="javascript")st=rt+"script";else if($e&&Xe.mode.name=="css")st=rt+"style";else{var lt=Xe.mode.xmlCurrentContext&&Xe.mode.xmlCurrentContext(Je);if(!lt||lt.length&&Ie(we,lt,lt[lt.length-1],xe))return ie.Pass;st=rt+lt[lt.length-1]}we.getLine(xe.line).charAt(Oe.end)!=">"&&(st+=">"),me[Le]=st}if(we.replaceSelections(me),Ke=we.listSelections(),!De)for(var Le=0;Le<Ke.length;Le++)(Le==Ke.length-1||Ke[Le].head.line<Ke[Le+1].head.line)&&we.indentLine(Ke[Le].head.line)}function ge(we){return we.getOption("disableInput")?ie.Pass:pe(we,!0)}ie.commands.closeTag=function(we){return pe(we)};function Fe(we,fe){if(we.indexOf)return we.indexOf(fe);for(var Ke=0,me=we.length;Ke<me;++Ke)if(we[Ke]==fe)return Ke;return-1}function Ie(we,fe,Ke,me,rt){if(!ie.scanForClosingTag)return!1;var Ne=Math.min(we.lastLine()+1,me.line+500),De=ie.scanForClosingTag(we,me,null,Ne);if(!De||De.tag!=Ke)return!1;for(var Le=rt?1:0,xe=fe.length-1;xe>=0&&fe[xe]==Ke;xe--)++Le;me=De.to;for(var xe=1;xe<Le;xe++){var Oe=ie.scanForClosingTag(we,me,null,Ne);if(!Oe||Oe.tag!=Ke)return!1;me=Oe.to}return!0}})},52730:function(At,_t,he){(function(ie){ie(he(89780))})(function(ie){"use strict";var et=ie.Pos;function Me(xe,Oe){return xe.line-Oe.line||xe.ch-Oe.ch}var ze="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",pe=ze+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",ge=new RegExp("<(/?)(["+ze+"]["+pe+"]*)","g");function Fe(xe,Oe,Xe,Je){this.line=Oe,this.ch=Xe,this.cm=xe,this.text=xe.getLine(Oe),this.min=Je?Math.max(Je.from,xe.firstLine()):xe.firstLine(),this.max=Je?Math.min(Je.to-1,xe.lastLine()):xe.lastLine()}function Ie(xe,Oe){var Xe=xe.cm.getTokenTypeAt(et(xe.line,Oe));return Xe&&/\btag\b/.test(Xe)}function we(xe){if(!(xe.line>=xe.max))return xe.ch=0,xe.text=xe.cm.getLine(++xe.line),!0}function fe(xe){if(!(xe.line<=xe.min))return xe.text=xe.cm.getLine(--xe.line),xe.ch=xe.text.length,!0}function Ke(xe){for(;;){var Oe=xe.text.indexOf(">",xe.ch);if(Oe==-1){if(we(xe))continue;return}if(!Ie(xe,Oe+1)){xe.ch=Oe+1;continue}var Xe=xe.text.lastIndexOf("/",Oe),Je=Xe>-1&&!/\S/.test(xe.text.slice(Xe+1,Oe));return xe.ch=Oe+1,Je?"selfClose":"regular"}}function me(xe){for(;;){var Oe=xe.ch?xe.text.lastIndexOf("<",xe.ch-1):-1;if(Oe==-1){if(fe(xe))continue;return}if(!Ie(xe,Oe+1)){xe.ch=Oe;continue}ge.lastIndex=Oe,xe.ch=Oe;var Xe=ge.exec(xe.text);if(Xe&&Xe.index==Oe)return Xe}}function rt(xe){for(;;){ge.lastIndex=xe.ch;var Oe=ge.exec(xe.text);if(!Oe){if(we(xe))continue;return}if(!Ie(xe,Oe.index+1)){xe.ch=Oe.index+1;continue}return xe.ch=Oe.index+Oe[0].length,Oe}}function Ne(xe){for(;;){var Oe=xe.ch?xe.text.lastIndexOf(">",xe.ch-1):-1;if(Oe==-1){if(fe(xe))continue;return}if(!Ie(xe,Oe+1)){xe.ch=Oe;continue}var Xe=xe.text.lastIndexOf("/",Oe),Je=Xe>-1&&!/\S/.test(xe.text.slice(Xe+1,Oe));return xe.ch=Oe+1,Je?"selfClose":"regular"}}function De(xe,Oe){for(var Xe=[];;){var Je=rt(xe),st,$e=xe.line,lt=xe.ch-(Je?Je[0].length:0);if(!Je||!(st=Ke(xe)))return;if(st!="selfClose")if(Je[1]){for(var it=Xe.length-1;it>=0;--it)if(Xe[it]==Je[2]){Xe.length=it;break}if(it<0&&(!Oe||Oe==Je[2]))return{tag:Je[2],from:et($e,lt),to:et(xe.line,xe.ch)}}else Xe.push(Je[2])}}function Le(xe,Oe){for(var Xe=[];;){var Je=Ne(xe);if(!Je)return;if(Je=="selfClose"){me(xe);continue}var st=xe.line,$e=xe.ch,lt=me(xe);if(!lt)return;if(lt[1])Xe.push(lt[2]);else{for(var it=Xe.length-1;it>=0;--it)if(Xe[it]==lt[2]){Xe.length=it;break}if(it<0&&(!Oe||Oe==lt[2]))return{tag:lt[2],from:et(xe.line,xe.ch),to:et(st,$e)}}}}ie.registerHelper("fold","xml",function(xe,Oe){for(var Xe=new Fe(xe,Oe.line,0);;){var Je=rt(Xe);if(!Je||Xe.line!=Oe.line)return;var st=Ke(Xe);if(!st)return;if(!Je[1]&&st!="selfClose"){var $e=et(Xe.line,Xe.ch),lt=De(Xe,Je[2]);return lt&&Me(lt.from,$e)>0?{from:$e,to:lt.from}:null}}}),ie.findMatchingTag=function(xe,Oe,Xe){var Je=new Fe(xe,Oe.line,Oe.ch,Xe);if(!(Je.text.indexOf(">")==-1&&Je.text.indexOf("<")==-1)){var st=Ke(Je),$e=st&&et(Je.line,Je.ch),lt=st&&me(Je);if(!(!st||!lt||Me(Je,Oe)>0)){var it={from:et(Je.line,Je.ch),to:$e,tag:lt[2]};return st=="selfClose"?{open:it,close:null,at:"open"}:lt[1]?{open:Le(Je,lt[2]),close:it,at:"close"}:(Je=new Fe(xe,$e.line,$e.ch,Xe),{open:it,close:De(Je,lt[2]),at:"open"})}}},ie.findEnclosingTag=function(xe,Oe,Xe,Je){for(var st=new Fe(xe,Oe.line,Oe.ch,Xe);;){var $e=Le(st,Je);if(!$e)break;var lt=new Fe(xe,Oe.line,Oe.ch,Xe),it=De(lt,$e.tag);if(it)return{open:$e,close:it}}},ie.scanForClosingTag=function(xe,Oe,Xe,Je){var st=new Fe(xe,Oe.line,Oe.ch,Je?{from:0,to:Je}:null);return De(st,Xe)}})},89780:function(At){(function(_t,he){At.exports=he()})(this,function(){"use strict";var _t=navigator.userAgent,he=navigator.platform,ie=/gecko\/\d/i.test(_t),et=/MSIE \d/.test(_t),Me=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(_t),ze=/Edge\/(\d+)/.exec(_t),pe=et||Me||ze,ge=pe&&(et?document.documentMode||6:+(ze||Me)[1]),Fe=!ze&&/WebKit\//.test(_t),Ie=Fe&&/Qt\/\d+\.\d+/.test(_t),we=!ze&&/Chrome\//.test(_t),fe=/Opera\//.test(_t),Ke=/Apple Computer/.test(navigator.vendor),me=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(_t),rt=/PhantomJS/.test(_t),Ne=!ze&&/AppleWebKit/.test(_t)&&/Mobile\/\w+/.test(_t),De=/Android/.test(_t),Le=Ne||De||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(_t),xe=Ne||/Mac/.test(he),Oe=/\bCrOS\b/.test(_t),Xe=/win/i.test(he),Je=fe&&_t.match(/Version\/(\d*\.\d*)/);Je&&(Je=Number(Je[1])),Je&&Je>=15&&(fe=!1,Fe=!0);var st=xe&&(Ie||fe&&(Je==null||Je<12.11)),$e=ie||pe&&ge>=9;function lt(a){return new RegExp("(^|\\s)"+a+"(?:$|\\s)\\s*")}var it=function(a,y){var x=a.className,b=lt(y).exec(x);if(b){var E=x.slice(b.index+b[0].length);a.className=x.slice(0,b.index)+(E?b[1]+E:"")}};function Yt(a){for(var y=a.childNodes.length;y>0;--y)a.removeChild(a.firstChild);return a}function Ye(a,y){return Yt(a).appendChild(y)}function Ge(a,y,x,b){var E=document.createElement(a);if(x&&(E.className=x),b&&(E.style.cssText=b),typeof y=="string")E.appendChild(document.createTextNode(y));else if(y)for(var ee=0;ee<y.length;++ee)E.appendChild(y[ee]);return E}function mt(a,y,x,b){var E=Ge(a,y,x,b);return E.setAttribute("role","presentation"),E}var Te;document.createRange?Te=function(a,y,x,b){var E=document.createRange();return E.setEnd(b||a,x),E.setStart(a,y),E}:Te=function(a,y,x){var b=document.body.createTextRange();try{b.moveToElementText(a.parentNode)}catch(E){return b}return b.collapse(!0),b.moveEnd("character",x),b.moveStart("character",y),b};function Qe(a,y){if(y.nodeType==3&&(y=y.parentNode),a.contains)return a.contains(y);do if(y.nodeType==11&&(y=y.host),y==a)return!0;while(y=y.parentNode)}function Pe(){var a;try{a=document.activeElement}catch(y){a=document.body||null}for(;a&&a.shadowRoot&&a.shadowRoot.activeElement;)a=a.shadowRoot.activeElement;return a}function ot(a,y){var x=a.className;lt(y).test(x)||(a.className+=(x?" ":"")+y)}function $t(a,y){for(var x=a.split(" "),b=0;b<x.length;b++)x[b]&&!lt(x[b]).test(y)&&(y+=" "+x[b]);return y}var wt=function(a){a.select()};Ne?wt=function(a){a.selectionStart=0,a.selectionEnd=a.value.length}:pe&&(wt=function(a){try{a.select()}catch(y){}});function pn(a){var y=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,y)}}function Ot(a,y,x){y||(y={});for(var b in a)a.hasOwnProperty(b)&&(x!==!1||!y.hasOwnProperty(b))&&(y[b]=a[b]);return y}function ve(a,y,x,b,E){y==null&&(y=a.search(/[^\s\u00a0]/),y==-1&&(y=a.length));for(var ee=b||0,re=E||0;;){var le=a.indexOf(" ",ee);if(le<0||le>=y)return re+(y-ee);re+=le-ee,re+=x-re%x,ee=le+1}}var de=function(){this.id=null,this.f=null,this.time=0,this.handler=pn(this.onTimeout,this)};de.prototype.onTimeout=function(a){a.id=0,a.time<=+new Date?a.f():setTimeout(a.handler,a.time-+new Date)},de.prototype.set=function(a,y){this.f=y;var x=+new Date+a;(!this.id||x<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,a),this.time=x)};function ut(a,y){for(var x=0;x<a.length;++x)if(a[x]==y)return x;return-1}var Jt=50,Ct={toString:function(){return"CodeMirror.Pass"}},Be={scroll:!1},tt={origin:"*mouse"},at={origin:"+move"};function en(a,y,x){for(var b=0,E=0;;){var ee=a.indexOf(" ",b);ee==-1&&(ee=a.length);var re=ee-b;if(ee==a.length||E+re>=y)return b+Math.min(re,y-E);if(E+=ee-b,E+=x-E%x,b=ee+1,E>=y)return b}}var ct=[""];function Pt(a){for(;ct.length<=a;)ct.push(We(ct)+" ");return ct[a]}function We(a){return a[a.length-1]}function gt(a,y){for(var x=[],b=0;b<a.length;b++)x[b]=y(a[b],b);return x}function St(a,y,x){for(var b=0,E=x(y);b<a.length&&x(a[b])<=E;)b++;a.splice(b,0,y)}function ae(){}function te(a,y){var x;return Object.create?x=Object.create(a):(ae.prototype=a,x=new ae),y&&Ot(y,x),x}var z=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function oe(a){return/\w/.test(a)||a>"\x80"&&(a.toUpperCase()!=a.toLowerCase()||z.test(a))}function ue(a,y){return y?y.source.indexOf("\\w")>-1&&oe(a)?!0:y.test(a):oe(a)}function ne(a){for(var y in a)if(a.hasOwnProperty(y)&&a[y])return!1;return!0}var be=/[\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 Ve(a){return a.charCodeAt(0)>=768&&be.test(a)}function Tt(a,y,x){for(;(x<0?y>0:y<a.length)&&Ve(a.charAt(y));)y+=x;return y}function bt(a,y,x){for(var b=y>x?-1:1;;){if(y==x)return y;var E=(y+x)/2,ee=b<0?Math.ceil(E):Math.floor(E);if(ee==y)return a(ee)?y:x;a(ee)?x=ee:y=ee+b}}function ft(a,y,x,b){if(!a)return b(y,x,"ltr",0);for(var E=!1,ee=0;ee<a.length;++ee){var re=a[ee];(re.from<x&&re.to>y||y==x&&re.to==y)&&(b(Math.max(re.from,y),Math.min(re.to,x),re.level==1?"rtl":"ltr",ee),E=!0)}E||b(y,x,"ltr")}var yt=null;function Vt(a,y,x){var b;yt=null;for(var E=0;E<a.length;++E){var ee=a[E];if(ee.from<y&&ee.to>y)return E;ee.to==y&&(ee.from!=ee.to&&x=="before"?b=E:yt=E),ee.from==y&&(ee.from!=ee.to&&x!="before"?b=E:yt=E)}return b!=null?b:yt}var Wt=function(){var a="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",y="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function x(ce){return ce<=247?a.charAt(ce):1424<=ce&&ce<=1524?"R":1536<=ce&&ce<=1785?y.charAt(ce-1536):1774<=ce&&ce<=2220?"r":8192<=ce&&ce<=8203?"w":ce==8204?"b":"L"}var b=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,E=/[stwN]/,ee=/[LRr]/,re=/[Lb1n]/,le=/[1n]/;function se(ce,ye,Ce){this.level=ce,this.from=ye,this.to=Ce}return function(ce,ye){var Ce=ye=="ltr"?"L":"R";if(ce.length==0||ye=="ltr"&&!b.test(ce))return!1;for(var je=ce.length,He=[],vt=0;vt<je;++vt)He.push(x(ce.charCodeAt(vt)));for(var Dt=0,zt=Ce;Dt<je;++Dt){var an=He[Dt];an=="m"?He[Dt]=zt:zt=an}for(var fn=0,ln=Ce;fn<je;++fn){var yn=He[fn];yn=="1"&&ln=="r"?He[fn]="n":ee.test(yn)&&(ln=yn,yn=="r"&&(He[fn]="R"))}for(var In=1,Ln=He[0];In<je-1;++In){var ii=He[In];ii=="+"&&Ln=="1"&&He[In+1]=="1"?He[In]="1":ii==","&&Ln==He[In+1]&&(Ln=="1"||Ln=="n")&&(He[In]=Ln),Ln=ii}for(var Ri=0;Ri<je;++Ri){var rr=He[Ri];if(rr==",")He[Ri]="N";else if(rr=="%"){var Hi=void 0;for(Hi=Ri+1;Hi<je&&He[Hi]=="%";++Hi);for(var Br=Ri&&He[Ri-1]=="!"||Hi<je&&He[Hi]=="1"?"1":"N",Er=Ri;Er<Hi;++Er)He[Er]=Br;Ri=Hi-1}}for(var Ji=0,Dr=Ce;Ji<je;++Ji){var cr=He[Ji];Dr=="L"&&cr=="1"?He[Ji]="L":ee.test(cr)&&(Dr=cr)}for(var er=0;er<je;++er)if(E.test(He[er])){var Qi=void 0;for(Qi=er+1;Qi<je&&E.test(He[Qi]);++Qi);for(var zi=(er?He[er-1]:Ce)=="L",Lr=(Qi<je?He[Qi]:Ce)=="L",Vo=zi==Lr?zi?"L":"R":Ce,bo=er;bo<Qi;++bo)He[bo]=Vo;er=Qi-1}for(var vr=[],$r,or=0;or<je;)if(re.test(He[or])){var bl=or;for(++or;or<je&&re.test(He[or]);++or);vr.push(new se(0,bl,or))}else{var oo=or,To=vr.length,Mo=ye=="rtl"?1:0;for(++or;or<je&&He[or]!="L";++or);for(var br=oo;br<or;)if(le.test(He[br])){oo<br&&(vr.splice(To,0,new se(1,oo,br)),To+=Mo);var Uo=br;for(++br;br<or&&le.test(He[br]);++br);vr.splice(To,0,new se(2,Uo,br)),To+=Mo,oo=br}else++br;oo<or&&vr.splice(To,0,new se(1,oo,or))}return ye=="ltr"&&(vr[0].level==1&&($r=ce.match(/^\s+/))&&(vr[0].from=$r[0].length,vr.unshift(new se(0,0,$r[0].length))),We(vr).level==1&&($r=ce.match(/\s+$/))&&(We(vr).to-=$r[0].length,vr.push(new se(0,je-$r[0].length,je)))),ye=="rtl"?vr.reverse():vr}}();function qe(a,y){var x=a.order;return x==null&&(x=a.order=Wt(a.text,y)),x}var nt=[],_e=function(a,y,x){if(a.addEventListener)a.addEventListener(y,x,!1);else if(a.attachEvent)a.attachEvent("on"+y,x);else{var b=a._handlers||(a._handlers={});b[y]=(b[y]||nt).concat(x)}};function xt(a,y){return a._handlers&&a._handlers[y]||nt}function Ft(a,y,x){if(a.removeEventListener)a.removeEventListener(y,x,!1);else if(a.detachEvent)a.detachEvent("on"+y,x);else{var b=a._handlers,E=b&&b[y];if(E){var ee=ut(E,x);ee>-1&&(b[y]=E.slice(0,ee).concat(E.slice(ee+1)))}}}function Qt(a,y){var x=xt(a,y);if(x.length)for(var b=Array.prototype.slice.call(arguments,2),E=0;E<x.length;++E)x[E].apply(null,b)}function Ue(a,y,x){return typeof y=="string"&&(y={type:y,preventDefault:function(){this.defaultPrevented=!0}}),Qt(a,x||y.type,a,y),Rt(y)||y.codemirrorIgnore}function tn(a){var y=a._handlers&&a._handlers.cursorActivity;if(y)for(var x=a.curOp.cursorActivityHandlers||(a.curOp.cursorActivityHandlers=[]),b=0;b<y.length;++b)ut(x,y[b])==-1&&x.push(y[b])}function ke(a,y){return xt(a,y).length>0}function kt(a){a.prototype.on=function(y,x){_e(this,y,x)},a.prototype.off=function(y,x){Ft(this,y,x)}}function Zt(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function _n(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function Rt(a){return a.defaultPrevented!=null?a.defaultPrevented:a.returnValue==!1}function un(a){Zt(a),_n(a)}function $n(a){return a.target||a.srcElement}function Gn(a){var y=a.which;return y==null&&(a.button&1?y=1:a.button&2?y=3:a.button&4&&(y=2)),xe&&a.ctrlKey&&y==1&&(y=3),y}var bi=function(){if(pe&&ge<9)return!1;var a=Ge("div");return"draggable"in a||"dragDrop"in a}(),xi;function ei(a){if(xi==null){var y=Ge("span","\u200B");Ye(a,Ge("span",[y,document.createTextNode("x")])),a.firstChild.offsetHeight!=0&&(xi=y.offsetWidth<=1&&y.offsetHeight>2&&!(pe&&ge<8))}var x=xi?Ge("span","\u200B"):Ge("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return x.setAttribute("cm-text",""),x}var Jn;function Dn(a){if(Jn!=null)return Jn;var y=Ye(a,document.createTextNode("A\u062EA")),x=Te(y,0,1).getBoundingClientRect(),b=Te(y,1,2).getBoundingClientRect();return Yt(a),!x||x.left==x.right?!1:Jn=b.right-x.right<3}var ti=`
b`.split(/\n/).length!=3?function(a){for(var y=0,x=[],b=a.length;y<=b;){var E=a.indexOf(`
`,y);E==-1&&(E=a.length);var ee=a.slice(y,a.charAt(E-1)=="\r"?E-1:E),re=ee.indexOf("\r");re!=-1?(x.push(ee.slice(0,re)),y+=re+1):(x.push(ee),y=E+1)}return x}:function(a){return a.split(/\r\n?|\n/)},Bn=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(y){return!1}}:function(a){var y;try{y=a.ownerDocument.selection.createRange()}catch(x){}return!y||y.parentElement()!=a?!1:y.compareEndPoints("StartToEnd",y)!=0},vn=function(){var a=Ge("div");return"oncopy"in a?!0:(a.setAttribute("oncopy","return;"),typeof a.oncopy=="function")}(),Sn=null;function En(a){if(Sn!=null)return Sn;var y=Ye(a,Ge("span","x")),x=y.getBoundingClientRect(),b=Te(y,0,1).getBoundingClientRect();return Sn=Math.abs(x.left-b.left)>1}var jn={},Gt={};function cn(a,y){arguments.length>2&&(y.dependencies=Array.prototype.slice.call(arguments,2)),jn[a]=y}function xn(a,y){Gt[a]=y}function kn(a){if(typeof a=="string"&&Gt.hasOwnProperty(a))a=Gt[a];else if(a&&typeof a.name=="string"&&Gt.hasOwnProperty(a.name)){var y=Gt[a.name];typeof y=="string"&&(y={name:y}),a=te(y,a),a.name=y.name}else{if(typeof a=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return kn("application/xml");if(typeof a=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(a))return kn("application/json")}return typeof a=="string"?{name:a}:a||{name:"null"}}function Qn(a,y){y=kn(y);var x=jn[y.name];if(!x)return Qn(a,"text/plain");var b=x(a,y);if(Cn.hasOwnProperty(y.name)){var E=Cn[y.name];for(var ee in E)E.hasOwnProperty(ee)&&(b.hasOwnProperty(ee)&&(b["_"+ee]=b[ee]),b[ee]=E[ee])}if(b.name=y.name,y.helperType&&(b.helperType=y.helperType),y.modeProps)for(var re in y.modeProps)b[re]=y.modeProps[re];return b}var Cn={};function Fn(a,y){var x=Cn.hasOwnProperty(a)?Cn[a]:Cn[a]={};Ot(y,x)}function wn(a,y){if(y===!0)return y;if(a.copyState)return a.copyState(y);var x={};for(var b in y){var E=y[b];E instanceof Array&&(E=E.concat([])),x[b]=E}return x}function rn(a,y){for(var x;a.innerMode&&(x=a.innerMode(y),!(!x||x.mode==a));)y=x.state,a=x.mode;return x||{mode:a,state:y}}function nn(a,y,x){return a.startState?a.startState(y,x):!0}var dt=function(a,y,x){this.pos=this.start=0,this.string=a,this.tabSize=y||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=x};dt.prototype.eol=function(){return this.pos>=this.string.length},dt.prototype.sol=function(){return this.pos==this.lineStart},dt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},dt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},dt.prototype.eat=function(a){var y=this.string.charAt(this.pos),x;if(typeof a=="string"?x=y==a:x=y&&(a.test?a.test(y):a(y)),x)return++this.pos,y},dt.prototype.eatWhile=function(a){for(var y=this.pos;this.eat(a););return this.pos>y},dt.prototype.eatSpace=function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},dt.prototype.skipToEnd=function(){this.pos=this.string.length},dt.prototype.skipTo=function(a){var y=this.string.indexOf(a,this.pos);if(y>-1)return this.pos=y,!0},dt.prototype.backUp=function(a){this.pos-=a},dt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=ve(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?ve(this.string,this.lineStart,this.tabSize):0)},dt.prototype.indentation=function(){return ve(this.string,null,this.tabSize)-(this.lineStart?ve(this.string,this.lineStart,this.tabSize):0)},dt.prototype.match=function(a,y,x){if(typeof a=="string"){var b=function(re){return x?re.toLowerCase():re},E=this.string.substr(this.pos,a.length);if(b(E)==b(a))return y!==!1&&(this.pos+=a.length),!0}else{var ee=this.string.slice(this.pos).match(a);return ee&&ee.index>0?null:(ee&&y!==!1&&(this.pos+=ee[0].length),ee)}},dt.prototype.current=function(){return this.string.slice(this.start,this.pos)},dt.prototype.hideFirstChars=function(a,y){this.lineStart+=a;try{return y()}finally{this.lineStart-=a}},dt.prototype.lookAhead=function(a){var y=this.lineOracle;return y&&y.lookAhead(a)},dt.prototype.baseToken=function(){var a=this.lineOracle;return a&&a.baseToken(this.pos)};function Ze(a,y){if(y-=a.first,y<0||y>=a.size)throw new Error("There is no line "+(y+a.first)+" in the document.");for(var x=a;!x.lines;)for(var b=0;;++b){var E=x.children[b],ee=E.chunkSize();if(y<ee){x=E;break}y-=ee}return x.lines[y]}function Bt(a,y,x){var b=[],E=y.line;return a.iter(y.line,x.line+1,function(ee){var re=ee.text;E==x.line&&(re=re.slice(0,x.ch)),E==y.line&&(re=re.slice(y.ch)),b.push(re),++E}),b}function hn(a,y,x){var b=[];return a.iter(y,x,function(E){b.push(E.text)}),b}function Rn(a,y){var x=y-a.height;if(x)for(var b=a;b;b=b.parent)b.height+=x}function Se(a){if(a.parent==null)return null;for(var y=a.parent,x=ut(y.lines,a),b=y.parent;b;y=b,b=b.parent)for(var E=0;b.children[E]!=y;++E)x+=b.children[E].chunkSize();return x+y.first}function Ee(a,y){var x=a.first;e:do{for(var b=0;b<a.children.length;++b){var E=a.children[b],ee=E.height;if(y<ee){a=E;continue e}y-=ee,x+=E.chunkSize()}return x}while(!a.lines);for(var re=0;re<a.lines.length;++re){var le=a.lines[re],se=le.height;if(y<se)break;y-=se}return x+re}function Et(a,y){return y>=a.first&&y<a.first+a.size}function ht(a,y){return String(a.lineNumberFormatter(y+a.firstLineNumber))}function Re(a,y,x){if(x===void 0&&(x=null),!(this instanceof Re))return new Re(a,y,x);this.line=a,this.ch=y,this.sticky=x}function pt(a,y){return a.line-y.line||a.ch-y.ch}function Ut(a,y){return a.sticky==y.sticky&&pt(a,y)==0}function sn(a){return Re(a.line,a.ch)}function dn(a,y){return pt(a,y)<0?y:a}function It(a,y){return pt(a,y)<0?a:y}function Kt(a,y){return Math.max(a.first,Math.min(y,a.first+a.size-1))}function Ae(a,y){if(y.line<a.first)return Re(a.first,0);var x=a.first+a.size-1;return y.line>x?Re(x,Ze(a,x).text.length):Tn(y,Ze(a,y.line).text.length)}function Tn(a,y){var x=a.ch;return x==null||x>y?Re(a.line,y):x<0?Re(a.line,0):a}function qt(a,y){for(var x=[],b=0;b<y.length;b++)x[b]=Ae(a,y[b]);return x}var bn=function(a,y){this.state=a,this.lookAhead=y},mn=function(a,y,x,b){this.state=y,this.doc=a,this.line=x,this.maxLookAhead=b||0,this.baseTokens=null,this.baseTokenPos=1};mn.prototype.lookAhead=function(a){var y=this.doc.getLine(this.line+a);return y!=null&&a>this.maxLookAhead&&(this.maxLookAhead=a),y},mn.prototype.baseToken=function(a){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=a;)this.baseTokenPos+=2;var y=this.baseTokens[this.baseTokenPos+1];return{type:y&&y.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-a}},mn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},mn.fromSaved=function(a,y,x){return y instanceof bn?new mn(a,wn(a.mode,y.state),x,y.lookAhead):new mn(a,wn(a.mode,y),x)},mn.prototype.save=function(a){var y=a!==!1?wn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new bn(y,this.maxLookAhead):y};function Mn(a,y,x,b){var E=[a.state.modeGen],ee={};hi(a,y.text,a.doc.mode,x,function(ce,ye){return E.push(ce,ye)},ee,b);for(var re=x.state,le=function(ce){x.baseTokens=E;var ye=a.state.overlays[ce],Ce=1,je=0;x.state=!0,hi(a,y.text,ye.mode,x,function(He,vt){for(var Dt=Ce;je<He;){var zt=E[Ce];zt>He&&E.splice(Ce,1,He,E[Ce+1],zt),Ce+=2,je=Math.min(He,zt)}if(vt)if(ye.opaque)E.splice(Dt,Ce-Dt,He,"overlay "+vt),Ce=Dt+2;else for(;Dt<Ce;Dt+=2){var an=E[Dt+1];E[Dt+1]=(an?an+" ":"")+"overlay "+vt}},ee),x.state=re,x.baseTokens=null,x.baseTokenPos=1},se=0;se<a.state.overlays.length;++se)le(se);return{styles:E,classes:ee.bgClass||ee.textClass?ee:null}}function Hn(a,y,x){if(!y.styles||y.styles[0]!=a.state.modeGen){var b=mi(a,Se(y)),E=y.text.length>a.options.maxHighlightLength&&wn(a.doc.mode,b.state),ee=Mn(a,y,b);E&&(b.state=E),y.stateAfter=b.save(!E),y.styles=ee.styles,ee.classes?y.styleClasses=ee.classes:y.styleClasses&&(y.styleClasses=null),x===a.doc.highlightFrontier&&(a.doc.modeFrontier=Math.max(a.doc.modeFrontier,++a.doc.highlightFrontier))}return y.styles}function mi(a,y,x){var b=a.doc,E=a.display;if(!b.mode.startState)return new mn(b,!0,y);var ee=yi(a,y,x),re=ee>b.first&&Ze(b,ee-1).stateAfter,le=re?mn.fromSaved(b,re,ee):new mn(b,nn(b.mode),ee);return b.iter(ee,y,function(se){Vn(a,se.text,le);var ce=le.line;se.stateAfter=ce==y-1||ce%5==0||ce>=E.viewFrom&&ce<E.viewTo?le.save():null,le.nextLine()}),x&&(b.modeFrontier=le.line),le}function Vn(a,y,x,b){var E=a.doc.mode,ee=new dt(y,a.options.tabSize,x);for(ee.start=ee.pos=b||0,y==""&&On(E,x.state);!ee.eol();)ci(E,ee,x.state),ee.start=ee.pos}function On(a,y){if(a.blankLine)return a.blankLine(y);if(a.innerMode){var x=rn(a,y);if(x.mode.blankLine)return x.mode.blankLine(x.state)}}function ci(a,y,x,b){for(var E=0;E<10;E++){b&&(b[0]=rn(a,x).mode);var ee=a.token(y,x);if(y.pos>y.start)return ee}throw new Error("Mode "+a.name+" failed to advance stream.")}var zn=function(a,y,x){this.start=a.start,this.end=a.pos,this.string=a.current(),this.type=y||null,this.state=x};function gi(a,y,x,b){var E=a.doc,ee=E.mode,re;y=Ae(E,y);var le=Ze(E,y.line),se=mi(a,y.line,x),ce=new dt(le.text,a.options.tabSize,se),ye;for(b&&(ye=[]);(b||ce.pos<y.ch)&&!ce.eol();)ce.start=ce.pos,re=ci(ee,ce,se.state),b&&ye.push(new zn(ce,re,wn(E.mode,se.state)));return b?ye:new zn(ce,re,se.state)}function Ni(a,y){if(a)for(;;){var x=a.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!x)break;a=a.slice(0,x.index)+a.slice(x.index+x[0].length);var b=x[1]?"bgClass":"textClass";y[b]==null?y[b]=x[2]:new RegExp("(?:^|\\s)"+x[2]+"(?:$|\\s)").test(y[b])||(y[b]+=" "+x[2])}return a}function hi(a,y,x,b,E,ee,re){var le=x.flattenSpans;le==null&&(le=a.options.flattenSpans);var se=0,ce=null,ye=new dt(y,a.options.tabSize,b),Ce,je=a.options.addModeClass&&[null];for(y==""&&Ni(On(x,b.state),ee);!ye.eol();){if(ye.pos>a.options.maxHighlightLength?(le=!1,re&&Vn(a,y,b,ye.pos),ye.pos=y.length,Ce=null):Ce=Ni(ci(x,ye,b.state,je),ee),je){var He=je[0].name;He&&(Ce="m-"+(Ce?He+" "+Ce:He))}if(!le||ce!=Ce){for(;se<ye.start;)se=Math.min(ye.start,se+5e3),E(se,ce);ce=Ce}ye.start=ye.pos}for(;se<ye.pos;){var vt=Math.min(ye.pos,se+5e3);E(vt,ce),se=vt}}function yi(a,y,x){for(var b,E,ee=a.doc,re=x?-1:y-(a.doc.mode.innerMode?1e3:100),le=y;le>re;--le){if(le<=ee.first)return ee.first;var se=Ze(ee,le-1),ce=se.stateAfter;if(ce&&(!x||le+(ce instanceof bn?ce.lookAhead:0)<=ee.modeFrontier))return le;var ye=ve(se.text,null,a.options.tabSize);(E==null||b>ye)&&(E=le-1,b=ye)}return E}function Mi(a,y){if(a.modeFrontier=Math.min(a.modeFrontier,y),!(a.highlightFrontier<y-10)){for(var x=a.first,b=y-1;b>x;b--){var E=Ze(a,b).stateAfter;if(E&&(!(E instanceof bn)||b+E.lookAhead<y)){x=b+1;break}}a.highlightFrontier=Math.min(a.highlightFrontier,x)}}var wi=!1,ai=!1;function Pi(){wi=!0}function li(){ai=!0}function fi(a,y,x){this.marker=a,this.from=y,this.to=x}function Ci(a,y){if(a)for(var x=0;x<a.length;++x){var b=a[x];if(b.marker==y)return b}}function Di(a,y){for(var x,b=0;b<a.length;++b)a[b]!=y&&(x||(x=[])).push(a[b]);return x}function pi(a,y){a.markedSpans=a.markedSpans?a.markedSpans.concat([y]):[y],y.marker.attachLine(a)}function ri(a,y,x){var b;if(a)for(var E=0;E<a.length;++E){var ee=a[E],re=ee.marker,le=ee.from==null||(re.inclusiveLeft?ee.from<=y:ee.from<y);if(le||ee.from==y&&re.type=="bookmark"&&(!x||!ee.marker.insertLeft)){var se=ee.to==null||(re.inclusiveRight?ee.to>=y:ee.to>y);(b||(b=[])).push(new fi(re,ee.from,se?null:ee.to))}}return b}function ni(a,y,x){var b;if(a)for(var E=0;E<a.length;++E){var ee=a[E],re=ee.marker,le=ee.to==null||(re.inclusiveRight?ee.to>=y:ee.to>y);if(le||ee.from==y&&re.type=="bookmark"&&(!x||ee.marker.insertLeft)){var se=ee.from==null||(re.inclusiveLeft?ee.from<=y:ee.from<y);(b||(b=[])).push(new fi(re,se?null:ee.from-y,ee.to==null?null:ee.to-y))}}return b}function Bi(a,y){if(y.full)return null;var x=Et(a,y.from.line)&&Ze(a,y.from.line).markedSpans,b=Et(a,y.to.line)&&Ze(a,y.to.line).markedSpans;if(!x&&!b)return null;var E=y.from.ch,ee=y.to.ch,re=pt(y.from,y.to)==0,le=ri(x,E,re),se=ni(b,ee,re),ce=y.text.length==1,ye=We(y.text).length+(ce?E:0);if(le)for(var Ce=0;Ce<le.length;++Ce){var je=le[Ce];if(je.to==null){var He=Ci(se,je.marker);He?ce&&(je.to=He.to==null?null:He.to+ye):je.to=E}}if(se)for(var vt=0;vt<se.length;++vt){var Dt=se[vt];if(Dt.to!=null&&(Dt.to+=ye),Dt.from==null){var zt=Ci(le,Dt.marker);zt||(Dt.from=ye,ce&&(le||(le=[])).push(Dt))}else Dt.from+=ye,ce&&(le||(le=[])).push(Dt)}le&&(le=Zi(le)),se&&se!=le&&(se=Zi(se));var an=[le];if(!ce){var fn=y.text.length-2,ln;if(fn>0&&le)for(var yn=0;yn<le.length;++yn)le[yn].to==null&&(ln||(ln=[])).push(new fi(le[yn].marker,null,null));for(var In=0;In<fn;++In)an.push(ln);an.push(se)}return an}function Zi(a){for(var y=0;y<a.length;++y){var x=a[y];x.from!=null&&x.from==x.to&&x.marker.clearWhenEmpty!==!1&&a.splice(y--,1)}return a.length?a:null}function Gi(a,y,x){var b=null;if(a.iter(y.line,x.line+1,function(He){if(He.markedSpans)for(var vt=0;vt<He.markedSpans.length;++vt){var Dt=He.markedSpans[vt].marker;Dt.readOnly&&(!b||ut(b,Dt)==-1)&&(b||(b=[])).push(Dt)}}),!b)return null;for(var E=[{from:y,to:x}],ee=0;ee<b.length;++ee)for(var re=b[ee],le=re.find(0),se=0;se<E.length;++se){var ce=E[se];if(!(pt(ce.to,le.from)<0||pt(ce.from,le.to)>0)){var ye=[se,1],Ce=pt(ce.from,le.from),je=pt(ce.to,le.to);(Ce<0||!re.inclusiveLeft&&!Ce)&&ye.push({from:ce.from,to:le.from}),(je>0||!re.inclusiveRight&&!je)&&ye.push({from:le.to,to:ce.to}),E.splice.apply(E,ye),se+=ye.length-3}}return E}function oi(a){var y=a.markedSpans;if(y){for(var x=0;x<y.length;++x)y[x].marker.detachLine(a);a.markedSpans=null}}function ar(a,y){if(y){for(var x=0;x<y.length;++x)y[x].marker.attachLine(a);a.markedSpans=y}}function di(a){return a.inclusiveLeft?-1:0}function lr(a){return a.inclusiveRight?1:0}function tr(a,y){var x=a.lines.length-y.lines.length;if(x!=0)return x;var b=a.find(),E=y.find(),ee=pt(b.from,E.from)||di(a)-di(y);if(ee)return-ee;var re=pt(b.to,E.to)||lr(a)-lr(y);return re||y.id-a.id}function Ii(a,y){var x=ai&&a.markedSpans,b;if(x)for(var E=void 0,ee=0;ee<x.length;++ee)E=x[ee],E.marker.collapsed&&(y?E.from:E.to)==null&&(!b||tr(b,E.marker)<0)&&(b=E.marker);return b}function Un(a){return Ii(a,!0)}function Mt(a){return Ii(a,!1)}function Ht(a,y){var x=ai&&a.markedSpans,b;if(x)for(var E=0;E<x.length;++E){var ee=x[E];ee.marker.collapsed&&(ee.from==null||ee.from<y)&&(ee.to==null||ee.to>y)&&(!b||tr(b,ee.marker)<0)&&(b=ee.marker)}return b}function gn(a,y,x,b,E){var ee=Ze(a,y),re=ai&&ee.markedSpans;if(re)for(var le=0;le<re.length;++le){var se=re[le];if(se.marker.collapsed){var ce=se.marker.find(0),ye=pt(ce.from,x)||di(se.marker)-di(E),Ce=pt(ce.to,b)||lr(se.marker)-lr(E);if(!(ye>=0&&Ce<=0||ye<=0&&Ce>=0)&&(ye<=0&&(se.marker.inclusiveRight&&E.inclusiveLeft?pt(ce.to,x)>=0:pt(ce.to,x)>0)||ye>=0&&(se.marker.inclusiveRight&&E.inclusiveLeft?pt(ce.from,b)<=0:pt(ce.from,b)<0)))return!0}}}function on(a){for(var y;y=Un(a);)a=y.find(-1,!0).line;return a}function An(a){for(var y;y=Mt(a);)a=y.find(1,!0).line;return a}function Nt(a){for(var y,x;y=Mt(a);)a=y.find(1,!0).line,(x||(x=[])).push(a);return x}function Lt(a,y){var x=Ze(a,y),b=on(x);return x==b?y:Se(b)}function jt(a,y){if(y>a.lastLine())return y;var x=Ze(a,y),b;if(!Xt(a,x))return y;for(;b=Mt(x);)x=b.find(1,!0).line;return Se(x)+1}function Xt(a,y){var x=ai&&y.markedSpans;if(x){for(var b=void 0,E=0;E<x.length;++E)if(b=x[E],!!b.marker.collapsed){if(b.from==null)return!0;if(!b.marker.widgetNode&&b.from==0&&b.marker.inclusiveLeft&&Wn(a,y,b))return!0}}}function Wn(a,y,x){if(x.to==null){var b=x.marker.find(1,!0);return Wn(a,b.line,Ci(b.line.markedSpans,x.marker))}if(x.marker.inclusiveRight&&x.to==y.text.length)return!0;for(var E=void 0,ee=0;ee<y.markedSpans.length;++ee)if(E=y.markedSpans[ee],E.marker.collapsed&&!E.marker.widgetNode&&E.from==x.to&&(E.to==null||E.to!=x.from)&&(E.marker.inclusiveLeft||x.marker.inclusiveRight)&&Wn(a,y,E))return!0}function Kn(a){a=on(a);for(var y=0,x=a.parent,b=0;b<x.lines.length;++b){var E=x.lines[b];if(E==a)break;y+=E.height}for(var ee=x.parent;ee;x=ee,ee=x.parent)for(var re=0;re<ee.children.length;++re){var le=ee.children[re];if(le==x)break;y+=le.height}return y}function Ei(a){if(a.height==0)return 0;for(var y=a.text.length,x,b=a;x=Un(b);){var E=x.find(0,!0);b=E.from.line,y+=E.from.ch-E.to.ch}for(b=a;x=Mt(b);){var ee=x.find(0,!0);y-=b.text.length-ee.from.ch,b=ee.to.line,y+=b.text.length-ee.to.ch}return y}function Xn(a){var y=a.display,x=a.doc;y.maxLine=Ze(x,x.first),y.maxLineLength=Ei(y.maxLine),y.maxLineChanged=!0,x.iter(function(b){var E=Ei(b);E>y.maxLineLength&&(y.maxLineLength=E,y.maxLine=b)})}var si=function(a,y,x){this.text=a,ar(this,y),this.height=x?x(this):1};si.prototype.lineNo=function(){return Se(this)},kt(si);function _i(a,y,x,b){a.text=y,a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null),a.order!=null&&(a.order=null),oi(a),ar(a,x);var E=b?b(a):1;E!=a.height&&Rn(a,E)}function ji(a){a.parent=null,oi(a)}var Si={},Yi={};function Ai(a,y){if(!a||/^\s*$/.test(a))return null;var x=y.addModeClass?Yi:Si;return x[a]||(x[a]=a.replace(/\S+/g,"cm-$&"))}function dr(a,y){var x=mt("span",null,null,Fe?"padding-right: .1px":null),b={pre:mt("pre",[x],"CodeMirror-line"),content:x,col:0,pos:0,cm:a,trailingSpace:!1,splitSpaces:a.getOption("lineWrapping")};y.measure={};for(var E=0;E<=(y.rest?y.rest.length:0);E++){var ee=E?y.rest[E-1]:y.line,re=void 0;b.pos=0,b.addToken=Ir,Dn(a.display.measure)&&(re=qe(ee,a.doc.direction))&&(b.addToken=mr(b.addToken,re)),b.map=[];var le=y!=a.display.externalMeasured&&Se(ee);wr(ee,b,Hn(a,ee,le)),ee.styleClasses&&(ee.styleClasses.bgClass&&(b.bgClass=$t(ee.styleClasses.bgClass,b.bgClass||"")),ee.styleClasses.textClass&&(b.textClass=$t(ee.styleClasses.textClass,b.textClass||""))),b.map.length==0&&b.map.push(0,0,b.content.appendChild(ei(a.display.measure))),E==0?(y.measure.map=b.map,y.measure.cache={}):((y.measure.maps||(y.measure.maps=[])).push(b.map),(y.measure.caches||(y.measure.caches=[])).push({}))}if(Fe){var se=b.content.lastChild;(/\bcm-tab\b/.test(se.className)||se.querySelector&&se.querySelector(".cm-tab"))&&(b.content.className="cm-tab-wrap-hack")}return Qt(a,"renderLine",a,y.line,b.pre),b.pre.className&&(b.textClass=$t(b.pre.className,b.textClass||"")),b}function zr(a){var y=Ge("span","\u2022","cm-invalidchar");return y.title="\\u"+a.charCodeAt(0).toString(16),y.setAttribute("aria-label",y.title),y}function Ir(a,y,x,b,E,ee,re){if(y){var le=a.splitSpaces?xr(y,a.trailingSpace):y,se=a.cm.state.specialChars,ce=!1,ye;if(!se.test(y))a.col+=y.length,ye=document.createTextNode(le),a.map.push(a.pos,a.pos+y.length,ye),pe&&ge<9&&(ce=!0),a.pos+=y.length;else{ye=document.createDocumentFragment();for(var Ce=0;;){se.lastIndex=Ce;var je=se.exec(y),He=je?je.index-Ce:y.length-Ce;if(He){var vt=document.createTextNode(le.slice(Ce,Ce+He));pe&&ge<9?ye.appendChild(Ge("span",[vt])):ye.appendChild(vt),a.map.push(a.pos,a.pos+He,vt),a.col+=He,a.pos+=He}if(!je)break;Ce+=He+1;var Dt=void 0;if(je[0]==" "){var zt=a.cm.options.tabSize,an=zt-a.col%zt;Dt=ye.appendChild(Ge("span",Pt(an),"cm-tab")),Dt.setAttribute("role","presentation"),Dt.setAttribute("cm-text"," "),a.col+=an}else je[0]=="\r"||je[0]==`
`?(Dt=ye.appendChild(Ge("span",je[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Dt.setAttribute("cm-text",je[0]),a.col+=1):(Dt=a.cm.options.specialCharPlaceholder(je[0]),Dt.setAttribute("cm-text",je[0]),pe&&ge<9?ye.appendChild(Ge("span",[Dt])):ye.appendChild(Dt),a.col+=1);a.map.push(a.pos,a.pos+1,Dt),a.pos++}}if(a.trailingSpace=le.charCodeAt(y.length-1)==32,x||b||E||ce||ee||re){var fn=x||"";b&&(fn+=b),E&&(fn+=E);var ln=Ge("span",[ye],fn,ee);if(re)for(var yn in re)re.hasOwnProperty(yn)&&yn!="style"&&yn!="class"&&ln.setAttribute(yn,re[yn]);return a.content.appendChild(ln)}a.content.appendChild(ye)}}function xr(a,y){if(a.length>1&&!/ /.test(a))return a;for(var x=y,b="",E=0;E<a.length;E++){var ee=a.charAt(E);ee==" "&&x&&(E==a.length-1||a.charCodeAt(E+1)==32)&&(ee="\xA0"),b+=ee,x=ee==" "}return b}function mr(a,y){return function(x,b,E,ee,re,le,se){E=E?E+" cm-force-border":"cm-force-border";for(var ce=x.pos,ye=ce+b.length;;){for(var Ce=void 0,je=0;je<y.length&&(Ce=y[je],!(Ce.to>ce&&Ce.from<=ce));je++);if(Ce.to>=ye)return a(x,b,E,ee,re,le,se);a(x,b.slice(0,Ce.to-ce),E,ee,null,le,se),ee=null,b=b.slice(Ce.to-ce),ce=Ce.to}}}function Li(a,y,x,b){var E=!b&&x.widgetNode;E&&a.map.push(a.pos,a.pos+y,E),!b&&a.cm.display.input.needsContentAttribute&&(E||(E=a.content.appendChild(document.createElement("span"))),E.setAttribute("cm-marker",x.id)),E&&(a.cm.display.input.setUneditable(E),a.content.appendChild(E)),a.pos+=y,a.trailingSpace=!1}function wr(a,y,x){var b=a.markedSpans,E=a.text,ee=0;if(!b){for(var re=1;re<x.length;re+=2)y.addToken(y,E.slice(ee,ee=x[re]),Ai(x[re+1],y.cm.options));return}for(var le=E.length,se=0,ce=1,ye="",Ce,je,He=0,vt,Dt,zt,an,fn;;){if(He==se){vt=Dt=zt=je="",fn=null,an=null,He=1/0;for(var ln=[],yn=void 0,In=0;In<b.length;++In){var Ln=b[In],ii=Ln.marker;if(ii.type=="bookmark"&&Ln.from==se&&ii.widgetNode)ln.push(ii);else if(Ln.from<=se&&(Ln.to==null||Ln.to>se||ii.collapsed&&Ln.to==se&&Ln.from==se)){if(Ln.to!=null&&Ln.to!=se&&He>Ln.to&&(He=Ln.to,Dt=""),ii.className&&(vt+=" "+ii.className),ii.css&&(je=(je?je+";":"")+ii.css),ii.startStyle&&Ln.from==se&&(zt+=" "+ii.startStyle),ii.endStyle&&Ln.to==He&&(yn||(yn=[])).push(ii.endStyle,Ln.to),ii.title&&((fn||(fn={})).title=ii.title),ii.attributes)for(var Ri in ii.attributes)(fn||(fn={}))[Ri]=ii.attributes[Ri];ii.collapsed&&(!an||tr(an.marker,ii)<0)&&(an=Ln)}else Ln.from>se&&He>Ln.from&&(He=Ln.from)}if(yn)for(var rr=0;rr<yn.length;rr+=2)yn[rr+1]==He&&(Dt+=" "+yn[rr]);if(!an||an.from==se)for(var Hi=0;Hi<ln.length;++Hi)Li(y,0,ln[Hi]);if(an&&(an.from||0)==se){if(Li(y,(an.to==null?le+1:an.to)-se,an.marker,an.from==null),an.to==null)return;an.to==se&&(an=!1)}}if(se>=le)break;for(var Br=Math.min(le,He);;){if(ye){var Er=se+ye.length;if(!an){var Ji=Er>Br?ye.slice(0,Br-se):ye;y.addToken(y,Ji,Ce?Ce+vt:vt,zt,se+Ji.length==He?Dt:"",je,fn)}if(Er>=Br){ye=ye.slice(Br-se),se=Br;break}se=Er,zt=""}ye=E.slice(ee,ee=x[ce++]),Ce=Ai(x[ce++],y.cm.options)}}}function eo(a,y,x){this.line=y,this.rest=Nt(y),this.size=this.rest?Se(We(this.rest))-x+1:1,this.node=this.text=null,this.hidden=Xt(a,y)}function Xi(a,y,x){for(var b=[],E,ee=y;ee<x;ee=E){var re=new eo(a.doc,Ze(a.doc,ee),ee);E=ee+re.size,b.push(re)}return b}var Nr=null;function Xr(a){Nr?Nr.ops.push(a):a.ownsGroup=Nr={ops:[a],delayedCallbacks:[]}}function hr(a){var y=a.delayedCallbacks,x=0;do{for(;x<y.length;x++)y[x].call(null);for(var b=0;b<a.ops.length;b++){var E=a.ops[b];if(E.cursorActivityHandlers)for(;E.cursorActivityCalled<E.cursorActivityHandlers.length;)E.cursorActivityHandlers[E.cursorActivityCalled++].call(null,E.cm)}}while(x<y.length)}function ao(a,y){var x=a.ownsGroup;if(x)try{hr(x)}finally{Nr=null,y(x)}}var _r=null;function Oi(a,y){var x=xt(a,y);if(x.length){var b=Array.prototype.slice.call(arguments,2),E;Nr?E=Nr.delayedCallbacks:_r?E=_r:(E=_r=[],setTimeout(to,0));for(var ee=function(le){E.push(function(){return x[le].apply(null,b)})},re=0;re<x.length;++re)ee(re)}}function to(){var a=_r;_r=null;for(var y=0;y<a.length;++y)a[y]()}function lo(a,y,x,b){for(var E=0;E<y.changes.length;E++){var ee=y.changes[E];ee=="text"?so(a,y):ee=="gutter"?Yn(a,y,x,b):ee=="class"?Pn(a,y):ee=="widget"&&Nn(a,y,b)}y.changes=null}function Zr(a){return a.node==a.text&&(a.node=Ge("div",null,null,"position: relative"),a.text.parentNode&&a.text.parentNode.replaceChild(a.node,a.text),a.node.appendChild(a.text),pe&&ge<8&&(a.node.style.zIndex=2)),a.node}function qi(a,y){var x=y.bgClass?y.bgClass+" "+(y.line.bgClass||""):y.line.bgClass;if(x&&(x+=" CodeMirror-linebackground"),y.background)x?y.background.className=x:(y.background.parentNode.removeChild(y.background),y.background=null);else if(x){var b=Zr(y);y.background=b.insertBefore(Ge("div",null,x),b.firstChild),a.display.input.setUneditable(y.background)}}function xo(a,y){var x=a.display.externalMeasured;return x&&x.line==y.line?(a.display.externalMeasured=null,y.measure=x.measure,x.built):dr(a,y)}function so(a,y){var x=y.text.className,b=xo(a,y);y.text==y.node&&(y.node=b.pre),y.text.parentNode.replaceChild(b.pre,y.text),y.text=b.pre,b.bgClass!=y.bgClass||b.textClass!=y.textClass?(y.bgClass=b.bgClass,y.textClass=b.textClass,Pn(a,y)):x&&(y.text.className=x)}function Pn(a,y){qi(a,y),y.line.wrapClass?Zr(y).className=y.line.wrapClass:y.node!=y.text&&(y.node.className="");var x=y.textClass?y.textClass+" "+(y.line.textClass||""):y.line.textClass;y.text.className=x||""}function Yn(a,y,x,b){if(y.gutter&&(y.node.removeChild(y.gutter),y.gutter=null),y.gutterBackground&&(y.node.removeChild(y.gutterBackground),y.gutterBackground=null),y.line.gutterClass){var E=Zr(y);y.gutterBackground=Ge("div",null,"CodeMirror-gutter-background "+y.line.gutterClass,"left: "+(a.options.fixedGutter?b.fixedPos:-b.gutterTotalWidth)+"px; width: "+b.gutterTotalWidth+"px"),a.display.input.setUneditable(y.gutterBackground),E.insertBefore(y.gutterBackground,y.text)}var ee=y.line.gutterMarkers;if(a.options.lineNumbers||ee){var re=Zr(y),le=y.gutter=Ge("div",null,"CodeMirror-gutter-wrapper","left: "+(a.options.fixedGutter?b.fixedPos:-b.gutterTotalWidth)+"px");if(a.display.input.setUneditable(le),re.insertBefore(le,y.text),y.line.gutterClass&&(le.className+=" "+y.line.gutterClass),a.options.lineNumbers&&(!ee||!ee["CodeMirror-linenumbers"])&&(y.lineNumber=le.appendChild(Ge("div",ht(a.options,x),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+b.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+a.display.lineNumInnerWidth+"px"))),ee)for(var se=0;se<a.display.gutterSpecs.length;++se){var ce=a.display.gutterSpecs[se].className,ye=ee.hasOwnProperty(ce)&&ee[ce];ye&&le.appendChild(Ge("div",[ye],"CodeMirror-gutter-elt","left: "+b.gutterLeft[ce]+"px; width: "+b.gutterWidth[ce]+"px"))}}}function Nn(a,y,x){y.alignable&&(y.alignable=null);for(var b=lt("CodeMirror-linewidget"),E=y.node.firstChild,ee=void 0;E;E=ee)ee=E.nextSibling,b.test(E.className)&&y.node.removeChild(E);vi(a,y,x)}function Zn(a,y,x,b){var E=xo(a,y);return y.text=y.node=E.pre,E.bgClass&&(y.bgClass=E.bgClass),E.textClass&&(y.textClass=E.textClass),Pn(a,y),Yn(a,y,x,b),vi(a,y,b),y.node}function vi(a,y,x){if(Fi(a,y.line,y,x,!0),y.rest)for(var b=0;b<y.rest.length;b++)Fi(a,y.rest[b],y,x,!1)}function Fi(a,y,x,b,E){if(y.widgets)for(var ee=Zr(x),re=0,le=y.widgets;re<le.length;++re){var se=le[re],ce=Ge("div",[se.node],"CodeMirror-linewidget"+(se.className?" "+se.className:""));se.handleMouseEvents||ce.setAttribute("cm-ignore-events","true"),Gr(se,ce,x,b),a.display.input.setUneditable(ce),E&&se.above?ee.insertBefore(ce,x.gutter||x.text):ee.appendChild(ce),Oi(se,"redraw")}}function Gr(a,y,x,b){if(a.noHScroll){(x.alignable||(x.alignable=[])).push(y);var E=b.wrapperWidth;y.style.left=b.fixedPos+"px",a.coverGutter||(E-=b.gutterTotalWidth,y.style.paddingLeft=b.gutterTotalWidth+"px"),y.style.width=E+"px"}a.coverGutter&&(y.style.zIndex=5,y.style.position="relative",a.noHScroll||(y.style.marginLeft=-b.gutterTotalWidth+"px"))}function gr(a){if(a.height!=null)return a.height;var y=a.doc.cm;if(!y)return 0;if(!Qe(document.body,a.node)){var x="position: relative;";a.coverGutter&&(x+="margin-left: -"+y.display.gutters.offsetWidth+"px;"),a.noHScroll&&(x+="width: "+y.display.wrapper.clientWidth+"px;"),Ye(y.display.measure,Ge("div",[a.node],null,x))}return a.height=a.node.parentNode.offsetHeight}function sr(a,y){for(var x=$n(y);x!=a.wrapper;x=x.parentNode)if(!x||x.nodeType==1&&x.getAttribute("cm-ignore-events")=="true"||x.parentNode==a.sizer&&x!=a.mover)return!0}function Vi(a){return a.lineSpace.offsetTop}function Or(a){return a.mover.offsetHeight-a.lineSpace.offsetHeight}function qr(a){if(a.cachedPaddingH)return a.cachedPaddingH;var y=Ye(a.measure,Ge("pre","x","CodeMirror-line-like")),x=window.getComputedStyle?window.getComputedStyle(y):y.currentStyle,b={left:parseInt(x.paddingLeft),right:parseInt(x.paddingRight)};return!isNaN(b.left)&&!isNaN(b.right)&&(a.cachedPaddingH=b),b}function Tr(a){return Jt-a.display.nativeBarWidth}function Jr(a){return a.display.scroller.clientWidth-Tr(a)-a.display.barWidth}function no(a){return a.display.scroller.clientHeight-Tr(a)-a.display.barHeight}function jr(a,y,x){var b=a.options.lineWrapping,E=b&&Jr(a);if(!y.measure.heights||b&&y.measure.width!=E){var ee=y.measure.heights=[];if(b){y.measure.width=E;for(var re=y.text.firstChild.getClientRects(),le=0;le<re.length-1;le++){var se=re[le],ce=re[le+1];Math.abs(se.bottom-ce.bottom)>2&&ee.push((se.bottom+ce.top)/2-x.top)}}ee.push(x.bottom-x.top)}}function Ao(a,y,x){if(a.line==y)return{map:a.measure.map,cache:a.measure.cache};for(var b=0;b<a.rest.length;b++)if(a.rest[b]==y)return{map:a.measure.maps[b],cache:a.measure.caches[b]};for(var E=0;E<a.rest.length;E++)if(Se(a.rest[E])>x)return{map:a.measure.maps[E],cache:a.measure.caches[E],before:!0}}function ja(a,y){y=on(y);var x=Se(y),b=a.display.externalMeasured=new eo(a.doc,y,x);b.lineN=x;var E=b.built=dr(a,b);return b.text=E.pre,Ye(a.display.lineMeasure,E.pre),b}function ya(a,y,x,b){return Wr(a,uo(a,y),x,b)}function Qr(a,y){if(y>=a.display.viewFrom&&y<a.display.viewTo)return a.display.view[So(a,y)];var x=a.display.externalMeasured;if(x&&y>=x.lineN&&y<x.lineN+x.size)return x}function uo(a,y){var x=Se(y),b=Qr(a,x);b&&!b.text?b=null:b&&b.changes&&(lo(a,b,x,co(a)),a.curOp.forceUpdate=!0),b||(b=ja(a,y));var E=Ao(b,y,x);return{line:y,view:b,rect:null,map:E.map,cache:E.cache,before:E.before,hasHeights:!1}}function Wr(a,y,x,b,E){y.before&&(x=-1);var ee=x+(b||""),re;return y.cache.hasOwnProperty(ee)?re=y.cache[ee]:(y.rect||(y.rect=y.view.text.getBoundingClientRect()),y.hasHeights||(jr(a,y.view,y.rect),y.hasHeights=!0),re=wa(a,y,x,b),re.bogus||(y.cache[ee]=re)),{left:re.left,right:re.right,top:E?re.rtop:re.top,bottom:E?re.rbottom:re.bottom}}var ba={left:0,right:0,top:0,bottom:0};function xa(a,y,x){for(var b,E,ee,re,le,se,ce=0;ce<a.length;ce+=3)if(le=a[ce],se=a[ce+1],y<le?(E=0,ee=1,re="left"):y<se?(E=y-le,ee=E+1):(ce==a.length-3||y==se&&a[ce+3]>y)&&(ee=se-le,E=ee-1,y>=se&&(re="right")),E!=null){if(b=a[ce+2],le==se&&x==(b.insertLeft?"left":"right")&&(re=x),x=="left"&&E==0)for(;ce&&a[ce-2]==a[ce-3]&&a[ce-1].insertLeft;)b=a[(ce-=3)+2],re="left";if(x=="right"&&E==se-le)for(;ce<a.length-3&&a[ce+3]==a[ce+4]&&!a[ce+5].insertLeft;)b=a[(ce+=3)+2],re="right";break}return{node:b,start:E,end:ee,collapse:re,coverStart:le,coverEnd:se}}function Va(a,y){var x=ba;if(y=="left")for(var b=0;b<a.length&&(x=a[b]).left==x.right;b++);else for(var E=a.length-1;E>=0&&(x=a[E]).left==x.right;E--);return x}function wa(a,y,x,b){var E=xa(y.map,x,b),ee=E.node,re=E.start,le=E.end,se=E.collapse,ce;if(ee.nodeType==3){for(var ye=0;ye<4;ye++){for(;re&&Ve(y.line.text.charAt(E.coverStart+re));)--re;for(;E.coverStart+le<E.coverEnd&&Ve(y.line.text.charAt(E.coverStart+le));)++le;if(pe&&ge<9&&re==0&&le==E.coverEnd-E.coverStart?ce=ee.parentNode.getBoundingClientRect():ce=Va(Te(ee,re,le).getClientRects(),b),ce.left||ce.right||re==0)break;le=re,re=re-1,se="right"}pe&&ge<11&&(ce=Ua(a.display.measure,ce))}else{re>0&&(se=b="right");var Ce;a.options.lineWrapping&&(Ce=ee.getClientRects()).length>1?ce=Ce[b=="right"?Ce.length-1:0]:ce=ee.getBoundingClientRect()}if(pe&&ge<9&&!re&&(!ce||!ce.left&&!ce.right)){var je=ee.parentNode.getClientRects()[0];je?ce={left:je.left,right:je.left+Ur(a.display),top:je.top,bottom:je.bottom}:ce=ba}for(var He=ce.top-y.rect.top,vt=ce.bottom-y.rect.top,Dt=(He+vt)/2,zt=y.view.measure.heights,an=0;an<zt.length-1&&!(Dt<zt[an]);an++);var fn=an?zt[an-1]:0,ln=zt[an],yn={left:(se=="right"?ce.right:ce.left)-y.rect.left,right:(se=="left"?ce.left:ce.right)-y.rect.left,top:fn,bottom:ln};return!ce.left&&!ce.right&&(yn.bogus=!0),a.options.singleCursorHeightPerLine||(yn.rtop=He,yn.rbottom=vt),yn}function Ua(a,y){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!En(a))return y;var x=screen.logicalXDPI/screen.deviceXDPI,b=screen.logicalYDPI/screen.deviceYDPI;return{left:y.left*x,right:y.right*x,top:y.top*b,bottom:y.bottom*b}}function Ko(a){if(a.measure&&(a.measure.cache={},a.measure.heights=null,a.rest))for(var y=0;y<a.rest.length;y++)a.measure.caches[y]={}}function Yo(a){a.display.externalMeasure=null,Yt(a.display.lineMeasure);for(var y=0;y<a.display.view.length;y++)Ko(a.display.view[y])}function wo(a){Yo(a),a.display.cachedCharWidth=a.display.cachedTextHeight=a.display.cachedPaddingH=null,a.options.lineWrapping||(a.display.maxLineChanged=!0),a.display.lineNumChars=null}function Xo(){return we&&De?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ca(){return we&&De?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function qo(a){var y=0;if(a.widgets)for(var x=0;x<a.widgets.length;++x)a.widgets[x].above&&(y+=gr(a.widgets[x]));return y}function Po(a,y,x,b,E){if(!E){var ee=qo(y);x.top+=ee,x.bottom+=ee}if(b=="line")return x;b||(b="local");var re=Kn(y);if(b=="local"?re+=Vi(a.display):re-=a.display.viewOffset,b=="page"||b=="window"){var le=a.display.lineSpace.getBoundingClientRect();re+=le.top+(b=="window"?0:Ca());var se=le.left+(b=="window"?0:Xo());x.left+=se,x.right+=se}return x.top+=re,x.bottom+=re,x}function Sa(a,y,x){if(x=="div")return y;var b=y.left,E=y.top;if(x=="page")b-=Xo(),E-=Ca();else if(x=="local"||!x){var ee=a.display.sizer.getBoundingClientRect();b+=ee.left,E+=ee.top}var re=a.display.lineSpace.getBoundingClientRect();return{left:b-re.left,top:E-re.top}}function Bo(a,y,x,b,E){return b||(b=Ze(a.doc,y.line)),Po(a,b,ya(a,b,y.ch,E),x)}function Cr(a,y,x,b,E,ee){b=b||Ze(a.doc,y.line),E||(E=uo(a,b));function re(vt,Dt){var zt=Wr(a,E,vt,Dt?"right":"left",ee);return Dt?zt.left=zt.right:zt.right=zt.left,Po(a,b,zt,x)}var le=qe(b,a.doc.direction),se=y.ch,ce=y.sticky;if(se>=b.text.length?(se=b.text.length,ce="before"):se<=0&&(se=0,ce="after"),!le)return re(ce=="before"?se-1:se,ce=="before");function ye(vt,Dt,zt){var an=le[Dt],fn=an.level==1;return re(zt?vt-1:vt,fn!=zt)}var Ce=Vt(le,se,ce),je=yt,He=ye(se,Ce,ce=="before");return je!=null&&(He.other=ye(se,je,ce!="before")),He}function ui(a,y){var x=0;y=Ae(a.doc,y),a.options.lineWrapping||(x=Ur(a.display)*y.ch);var b=Ze(a.doc,y.line),E=Kn(b)+Vi(a.display);return{left:x,right:x,top:E,bottom:E+b.height}}function qn(a,y,x,b,E){var ee=Re(a,y,x);return ee.xRel=E,b&&(ee.outside=b),ee}function ur(a,y,x){var b=a.doc;if(x+=a.display.viewOffset,x<0)return qn(b.first,0,null,-1,-1);var E=Ee(b,x),ee=b.first+b.size-1;if(E>ee)return qn(b.first+b.size-1,Ze(b,ee).text.length,null,1,1);y<0&&(y=0);for(var re=Ze(b,E);;){var le=Vr(a,re,E,y,x),se=Ht(re,le.ch+(le.xRel>0||le.outside>0?1:0));if(!se)return le;var ce=se.find(1);if(ce.line==E)return ce;re=Ze(b,E=ce.line)}}function fr(a,y,x,b){b-=qo(y);var E=y.text.length,ee=bt(function(re){return Wr(a,x,re-1).bottom<=b},E,0);return E=bt(function(re){return Wr(a,x,re).top>b},ee,E),{begin:ee,end:E}}function Ui(a,y,x,b){x||(x=uo(a,y));var E=Po(a,y,Wr(a,x,b),"line").top;return fr(a,y,x,E)}function $i(a,y,x,b){return a.bottom<=x?!1:a.top>x?!0:(b?a.left:a.right)>y}function Vr(a,y,x,b,E){E-=Kn(y);var ee=uo(a,y),re=qo(y),le=0,se=y.text.length,ce=!0,ye=qe(y,a.doc.direction);if(ye){var Ce=(a.options.lineWrapping?io:Hr)(a,y,x,ee,ye,b,E);ce=Ce.level!=1,le=ce?Ce.from:Ce.to-1,se=ce?Ce.to:Ce.from-1}var je=null,He=null,vt=bt(function(In){var Ln=Wr(a,ee,In);return Ln.top+=re,Ln.bottom+=re,$i(Ln,b,E,!1)?(Ln.top<=E&&Ln.left<=b&&(je=In,He=Ln),!0):!1},le,se),Dt,zt,an=!1;if(He){var fn=b-He.left<He.right-b,ln=fn==ce;vt=je+(ln?0:1),zt=ln?"after":"before",Dt=fn?He.left:He.right}else{!ce&&(vt==se||vt==le)&&vt++,zt=vt==0?"after":vt==y.text.length?"before":Wr(a,ee,vt-(ce?1:0)).bottom+re<=E==ce?"after":"before";var yn=Cr(a,Re(x,vt,zt),"line",y,ee);Dt=yn.left,an=E<yn.top?-1:E>=yn.bottom?1:0}return vt=Tt(y.text,vt,1),qn(x,vt,zt,an,b-Dt)}function Hr(a,y,x,b,E,ee,re){var le=bt(function(Ce){var je=E[Ce],He=je.level!=1;return $i(Cr(a,Re(x,He?je.to:je.from,He?"before":"after"),"line",y,b),ee,re,!0)},0,E.length-1),se=E[le];if(le>0){var ce=se.level!=1,ye=Cr(a,Re(x,ce?se.from:se.to,ce?"after":"before"),"line",y,b);$i(ye,ee,re,!0)&&ye.top>re&&(se=E[le-1])}return se}function io(a,y,x,b,E,ee,re){var le=fr(a,y,b,re),se=le.begin,ce=le.end;/\s/.test(y.text.charAt(ce-1))&&ce--;for(var ye=null,Ce=null,je=0;je<E.length;je++){var He=E[je];if(!(He.from>=ce||He.to<=se)){var vt=He.level!=1,Dt=Wr(a,b,vt?Math.min(ce,He.to)-1:Math.max(se,He.from)).right,zt=Dt<ee?ee-Dt+1e9:Dt-ee;(!ye||Ce>zt)&&(ye=He,Ce=zt)}}return ye||(ye=E[E.length-1]),ye.from<se&&(ye={from:se,to:ye.to,level:ye.level}),ye.to>ce&&(ye={from:ye.from,to:ce,level:ye.level}),ye}var Mr;function Ar(a){if(a.cachedTextHeight!=null)return a.cachedTextHeight;if(Mr==null){Mr=Ge("pre",null,"CodeMirror-line-like");for(var y=0;y<49;++y)Mr.appendChild(document.createTextNode("x")),Mr.appendChild(Ge("br"));Mr.appendChild(document.createTextNode("x"))}Ye(a.measure,Mr);var x=Mr.offsetHeight/50;return x>3&&(a.cachedTextHeight=x),Yt(a.measure),x||1}function Ur(a){if(a.cachedCharWidth!=null)return a.cachedCharWidth;var y=Ge("span","xxxxxxxxxx"),x=Ge("pre",[y],"CodeMirror-line-like");Ye(a.measure,x);var b=y.getBoundingClientRect(),E=(b.right-b.left)/10;return E>2&&(a.cachedCharWidth=E),E||10}function co(a){for(var y=a.display,x={},b={},E=y.gutters.clientLeft,ee=y.gutters.firstChild,re=0;ee;ee=ee.nextSibling,++re){var le=a.display.gutterSpecs[re].className;x[le]=ee.offsetLeft+ee.clientLeft+E,b[le]=ee.clientWidth}return{fixedPos:Ka(y),gutterTotalWidth:y.gutters.offsetWidth,gutterLeft:x,gutterWidth:b,wrapperWidth:y.wrapper.clientWidth}}function Ka(a){return a.scroller.getBoundingClientRect().left-a.sizer.getBoundingClientRect().left}function wl(a){var y=Ar(a.display),x=a.options.lineWrapping,b=x&&Math.max(5,a.display.scroller.clientWidth/Ur(a.display)-3);return function(E){if(Xt(a.doc,E))return 0;var ee=0;if(E.widgets)for(var re=0;re<E.widgets.length;re++)E.widgets[re].height&&(ee+=E.widgets[re].height);return x?ee+(Math.ceil(E.text.length/b)||1)*y:ee+y}}function Ya(a){var y=a.doc,x=wl(a);y.iter(function(b){var E=x(b);E!=b.height&&Rn(b,E)})}function Co(a,y,x,b){var E=a.display;if(!x&&$n(y).getAttribute("cm-not-content")=="true")return null;var ee,re,le=E.lineSpace.getBoundingClientRect();try{ee=y.clientX-le.left,re=y.clientY-le.top}catch(Ce){return null}var se=ur(a,ee,re),ce;if(b&&se.xRel>0&&(ce=Ze(a.doc,se.line).text).length==se.ch){var ye=ve(ce,ce.length,a.options.tabSize)-ce.length;se=Re(se.line,Math.max(0,Math.round((ee-qr(a.display).left)/Ur(a.display))-ye))}return se}function So(a,y){if(y>=a.display.viewTo||(y-=a.display.viewFrom,y<0))return null;for(var x=a.display.view,b=0;b<x.length;b++)if(y-=x[b].size,y<0)return b}function Sr(a,y,x,b){y==null&&(y=a.doc.first),x==null&&(x=a.doc.first+a.doc.size),b||(b=0);var E=a.display;if(b&&x<E.viewTo&&(E.updateLineNumbers==null||E.updateLineNumbers>y)&&(E.updateLineNumbers=y),a.curOp.viewChanged=!0,y>=E.viewTo)ai&&Lt(a.doc,y)<E.viewTo&&fo(a);else if(x<=E.viewFrom)ai&&jt(a.doc,x+b)>E.viewFrom?fo(a):(E.viewFrom+=b,E.viewTo+=b);else if(y<=E.viewFrom&&x>=E.viewTo)fo(a);else if(y<=E.viewFrom){var ee=ka(a,x,x+b,1);ee?(E.view=E.view.slice(ee.index),E.viewFrom=ee.lineN,E.viewTo+=b):fo(a)}else if(x>=E.viewTo){var re=ka(a,y,y,-1);re?(E.view=E.view.slice(0,re.index),E.viewTo=re.lineN):fo(a)}else{var le=ka(a,y,y,-1),se=ka(a,x,x+b,1);le&&se?(E.view=E.view.slice(0,le.index).concat(Xi(a,le.lineN,se.lineN)).concat(E.view.slice(se.index)),E.viewTo+=b):fo(a)}var ce=E.externalMeasured;ce&&(x<ce.lineN?ce.lineN+=b:y<ce.lineN+ce.size&&(E.externalMeasured=null))}function ho(a,y,x){a.curOp.viewChanged=!0;var b=a.display,E=a.display.externalMeasured;if(E&&y>=E.lineN&&y<E.lineN+E.size&&(b.externalMeasured=null),!(y<b.viewFrom||y>=b.viewTo)){var ee=b.view[So(a,y)];if(ee.node!=null){var re=ee.changes||(ee.changes=[]);ut(re,x)==-1&&re.push(x)}}}function fo(a){a.display.viewFrom=a.display.viewTo=a.doc.first,a.display.view=[],a.display.viewOffset=0}function ka(a,y,x,b){var E=So(a,y),ee,re=a.display.view;if(!ai||x==a.doc.first+a.doc.size)return{index:E,lineN:x};for(var le=a.display.viewFrom,se=0;se<E;se++)le+=re[se].size;if(le!=y){if(b>0){if(E==re.length-1)return null;ee=le+re[E].size-y,E++}else ee=le-y;y+=ee,x+=ee}for(;Lt(a.doc,x)!=x;){if(E==(b<0?0:re.length-1))return null;x+=b*re[E-(b<0?1:0)].size,E+=b}return{index:E,lineN:x}}function Ws(a,y,x){var b=a.display,E=b.view;E.length==0||y>=b.viewTo||x<=b.viewFrom?(b.view=Xi(a,y,x),b.viewFrom=y):(b.viewFrom>y?b.view=Xi(a,y,b.viewFrom).concat(b.view):b.viewFrom<y&&(b.view=b.view.slice(So(a,y))),b.viewFrom=y,b.viewTo<x?b.view=b.view.concat(Xi(a,b.viewTo,x)):b.viewTo>x&&(b.view=b.view.slice(0,So(a,x)))),b.viewTo=x}function Cl(a){for(var y=a.display.view,x=0,b=0;b<y.length;b++){var E=y[b];!E.hidden&&(!E.node||E.changes)&&++x}return x}function Jo(a){a.display.input.showSelection(a.display.input.prepareSelection())}function Sl(a,y){y===void 0&&(y=!0);for(var x=a.doc,b={},E=b.cursors=document.createDocumentFragment(),ee=b.selection=document.createDocumentFragment(),re=0;re<x.sel.ranges.length;re++)if(!(!y&&re==x.sel.primIndex)){var le=x.sel.ranges[re];if(!(le.from().line>=a.display.viewTo||le.to().line<a.display.viewFrom)){var se=le.empty();(se||a.options.showCursorWhenSelecting)&&kl(a,le.head,E),se||Hs(a,le,ee)}}return b}function kl(a,y,x){var b=Cr(a,y,"div",null,null,!a.options.singleCursorHeightPerLine),E=x.appendChild(Ge("div","\xA0","CodeMirror-cursor"));if(E.style.left=b.left+"px",E.style.top=b.top+"px",E.style.height=Math.max(0,b.bottom-b.top)*a.options.cursorHeight+"px",b.other){var ee=x.appendChild(Ge("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));ee.style.display="",ee.style.left=b.other.left+"px",ee.style.top=b.other.top+"px",ee.style.height=(b.other.bottom-b.other.top)*.85+"px"}}function Ea(a,y){return a.top-y.top||a.left-y.left}function Hs(a,y,x){var b=a.display,E=a.doc,ee=document.createDocumentFragment(),re=qr(a.display),le=re.left,se=Math.max(b.sizerWidth,Jr(a)-b.sizer.offsetLeft)-re.right,ce=E.direction=="ltr";function ye(ln,yn,In,Ln){yn<0&&(yn=0),yn=Math.round(yn),Ln=Math.round(Ln),ee.appendChild(Ge("div",null,"CodeMirror-selected","position: absolute; left: "+ln+`px;
top: `+yn+"px; width: "+(In==null?se-ln:In)+`px;
height: `+(Ln-yn)+"px"))}function Ce(ln,yn,In){var Ln=Ze(E,ln),ii=Ln.text.length,Ri,rr;function Hi(Ji,Dr){return Bo(a,Re(ln,Ji),"div",Ln,Dr)}function Br(Ji,Dr,cr){var er=Ui(a,Ln,null,Ji),Qi=Dr=="ltr"==(cr=="after")?"left":"right",zi=cr=="after"?er.begin:er.end-(/\s/.test(Ln.text.charAt(er.end-1))?2:1);return Hi(zi,Qi)[Qi]}var Er=qe(Ln,E.direction);return ft(Er,yn||0,In==null?ii:In,function(Ji,Dr,cr,er){var Qi=cr=="ltr",zi=Hi(Ji,Qi?"left":"right"),Lr=Hi(Dr-1,Qi?"right":"left"),Vo=yn==null&&Ji==0,bo=In==null&&Dr==ii,vr=er==0,$r=!Er||er==Er.length-1;if(Lr.top-zi.top<=3){var or=(ce?Vo:bo)&&vr,bl=(ce?bo:Vo)&&$r,oo=or?le:(Qi?zi:Lr).left,To=bl?se:(Qi?Lr:zi).right;ye(oo,zi.top,To-oo,zi.bottom)}else{var Mo,br,Uo,xl;Qi?(Mo=ce&&Vo&&vr?le:zi.left,br=ce?se:Br(Ji,cr,"before"),Uo=ce?le:Br(Dr,cr,"after"),xl=ce&&bo&&$r?se:Lr.right):(Mo=ce?Br(Ji,cr,"before"):le,br=!ce&&Vo&&vr?se:zi.right,Uo=!ce&&bo&&$r?le:Lr.left,xl=ce?Br(Dr,cr,"after"):se),ye(Mo,zi.top,br-Mo,zi.bottom),zi.bottom<Lr.top&&ye(le,zi.bottom,null,Lr.top),ye(Uo,Lr.top,xl-Uo,Lr.bottom)}(!Ri||Ea(zi,Ri)<0)&&(Ri=zi),Ea(Lr,Ri)<0&&(Ri=Lr),(!rr||Ea(zi,rr)<0)&&(rr=zi),Ea(Lr,rr)<0&&(rr=Lr)}),{start:Ri,end:rr}}var je=y.from(),He=y.to();if(je.line==He.line)Ce(je.line,je.ch,He.ch);else{var vt=Ze(E,je.line),Dt=Ze(E,He.line),zt=on(vt)==on(Dt),an=Ce(je.line,je.ch,zt?vt.text.length+1:null).end,fn=Ce(He.line,zt?0:null,He.ch).start;zt&&(an.top<fn.top-2?(ye(an.right,an.top,null,an.bottom),ye(le,fn.top,fn.left,fn.bottom)):ye(an.right,an.top,fn.left-an.right,an.bottom)),an.bottom<fn.top&&ye(le,an.bottom,null,fn.top)}x.appendChild(ee)}function Xa(a){if(a.state.focused){var y=a.display;clearInterval(y.blinker);var x=!0;y.cursorDiv.style.visibility="",a.options.cursorBlinkRate>0?y.blinker=setInterval(function(){a.hasFocus()||_o(a),y.cursorDiv.style.visibility=(x=!x)?"":"hidden"},a.options.cursorBlinkRate):a.options.cursorBlinkRate<0&&(y.cursorDiv.style.visibility="hidden")}}function El(a){a.state.focused||(a.display.input.focus(),qa(a))}function Dl(a){a.state.delayingBlurEvent=!0,setTimeout(function(){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1,_o(a))},100)}function qa(a,y){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1),a.options.readOnly!="nocursor"&&(a.state.focused||(Qt(a,"focus",a,y),a.state.focused=!0,ot(a.display.wrapper,"CodeMirror-focused"),!a.curOp&&a.display.selForContextMenu!=a.doc.sel&&(a.display.input.reset(),Fe&&setTimeout(function(){return a.display.input.reset(!0)},20)),a.display.input.receivedFocus()),Xa(a))}function _o(a,y){a.state.delayingBlurEvent||(a.state.focused&&(Qt(a,"blur",a,y),a.state.focused=!1,it(a.display.wrapper,"CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.display.shift=!1)},150))}function Da(a){for(var y=a.display,x=y.lineDiv.offsetTop,b=0;b<y.view.length;b++){var E=y.view[b],ee=a.options.lineWrapping,re=void 0,le=0;if(!E.hidden){if(pe&&ge<8){var se=E.node.offsetTop+E.node.offsetHeight;re=se-x,x=se}else{var ce=E.node.getBoundingClientRect();re=ce.bottom-ce.top,!ee&&E.text.firstChild&&(le=E.text.firstChild.getBoundingClientRect().right-ce.left-1)}var ye=E.line.height-re;if((ye>.005||ye<-.005)&&(Rn(E.line,re),Ll(E.line),E.rest))for(var Ce=0;Ce<E.rest.length;Ce++)Ll(E.rest[Ce]);if(le>a.display.sizerWidth){var je=Math.ceil(le/Ur(a.display));je>a.display.maxLineLength&&(a.display.maxLineLength=je,a.display.maxLine=E.line,a.display.maxLineChanged=!0)}}}}function Ll(a){if(a.widgets)for(var y=0;y<a.widgets.length;++y){var x=a.widgets[y],b=x.node.parentNode;b&&(x.height=b.offsetHeight)}}function La(a,y,x){var b=x&&x.top!=null?Math.max(0,x.top):a.scroller.scrollTop;b=Math.floor(b-Vi(a));var E=x&&x.bottom!=null?x.bottom:b+a.wrapper.clientHeight,ee=Ee(y,b),re=Ee(y,E);if(x&&x.ensure){var le=x.ensure.from.line,se=x.ensure.to.line;le<ee?(ee=le,re=Ee(y,Kn(Ze(y,le))+a.wrapper.clientHeight)):Math.min(se,y.lastLine())>=re&&(ee=Ee(y,Kn(Ze(y,se))-a.wrapper.clientHeight),re=se)}return{from:ee,to:Math.max(re,ee+1)}}function zs(a,y){if(!Ue(a,"scrollCursorIntoView")){var x=a.display,b=x.sizer.getBoundingClientRect(),E=null;if(y.top+b.top<0?E=!0:y.bottom+b.top>(window.innerHeight||document.documentElement.clientHeight)&&(E=!1),E!=null&&!rt){var ee=Ge("div","\u200B",null,`position: absolute;
top: `+(y.top-x.viewOffset-Vi(a.display))+`px;
height: `+(y.bottom-y.top+Tr(a)+x.barHeight)+`px;
left: `+y.left+"px; width: "+Math.max(2,y.right-y.left)+"px;");a.display.lineSpace.appendChild(ee),ee.scrollIntoView(E),a.display.lineSpace.removeChild(ee)}}}function Zs(a,y,x,b){b==null&&(b=0);var E;!a.options.lineWrapping&&y==x&&(y=y.ch?Re(y.line,y.sticky=="before"?y.ch-1:y.ch,"after"):y,x=y.sticky=="before"?Re(y.line,y.ch+1,"before"):y);for(var ee=0;ee<5;ee++){var re=!1,le=Cr(a,y),se=!x||x==y?le:Cr(a,x);E={left:Math.min(le.left,se.left),top:Math.min(le.top,se.top)-b,right:Math.max(le.left,se.left),bottom:Math.max(le.bottom,se.bottom)+b};var ce=Ja(a,E),ye=a.doc.scrollTop,Ce=a.doc.scrollLeft;if(ce.scrollTop!=null&&($o(a,ce.scrollTop),Math.abs(a.doc.scrollTop-ye)>1&&(re=!0)),ce.scrollLeft!=null&&(ko(a,ce.scrollLeft),Math.abs(a.doc.scrollLeft-Ce)>1&&(re=!0)),!re)break}return E}function Gs(a,y){var x=Ja(a,y);x.scrollTop!=null&&$o(a,x.scrollTop),x.scrollLeft!=null&&ko(a,x.scrollLeft)}function Ja(a,y){var x=a.display,b=Ar(a.display);y.top<0&&(y.top=0);var E=a.curOp&&a.curOp.scrollTop!=null?a.curOp.scrollTop:x.scroller.scrollTop,ee=no(a),re={};y.bottom-y.top>ee&&(y.bottom=y.top+ee);var le=a.doc.height+Or(x),se=y.top<b,ce=y.bottom>le-b;if(y.top<E)re.scrollTop=se?0:y.top;else if(y.bottom>E+ee){var ye=Math.min(y.top,(ce?le:y.bottom)-ee);ye!=E&&(re.scrollTop=ye)}var Ce=a.options.fixedGutter?0:x.gutters.offsetWidth,je=a.curOp&&a.curOp.scrollLeft!=null?a.curOp.scrollLeft:x.scroller.scrollLeft-Ce,He=Jr(a)-x.gutters.offsetWidth,vt=y.right-y.left>He;return vt&&(y.right=y.left+He),y.left<10?re.scrollLeft=0:y.left<je?re.scrollLeft=Math.max(0,y.left+Ce-(vt?0:10)):y.right>He+je-3&&(re.scrollLeft=y.right+(vt?0:10)-He),re}function Qa(a,y){y!=null&&(Ta(a),a.curOp.scrollTop=(a.curOp.scrollTop==null?a.doc.scrollTop:a.curOp.scrollTop)+y)}function Fo(a){Ta(a);var y=a.getCursor();a.curOp.scrollToPos={from:y,to:y,margin:a.options.cursorScrollMargin}}function Qo(a,y,x){(y!=null||x!=null)&&Ta(a),y!=null&&(a.curOp.scrollLeft=y),x!=null&&(a.curOp.scrollTop=x)}function js(a,y){Ta(a),a.curOp.scrollToPos=y}function Ta(a){var y=a.curOp.scrollToPos;if(y){a.curOp.scrollToPos=null;var x=ui(a,y.from),b=ui(a,y.to);Tl(a,x,b,y.margin)}}function Tl(a,y,x,b){var E=Ja(a,{left:Math.min(y.left,x.left),top:Math.min(y.top,x.top)-b,right:Math.max(y.right,x.right),bottom:Math.max(y.bottom,x.bottom)+b});Qo(a,E.scrollLeft,E.scrollTop)}function $o(a,y){Math.abs(a.doc.scrollTop-y)<2||(ie||el(a,{top:y}),Ml(a,y,!0),ie&&el(a),na(a,100))}function Ml(a,y,x){y=Math.max(0,Math.min(a.display.scroller.scrollHeight-a.display.scroller.clientHeight,y)),!(a.display.scroller.scrollTop==y&&!x)&&(a.doc.scrollTop=y,a.display.scrollbars.setScrollTop(y),a.display.scroller.scrollTop!=y&&(a.display.scroller.scrollTop=y))}function ko(a,y,x,b){y=Math.max(0,Math.min(y,a.display.scroller.scrollWidth-a.display.scroller.clientWidth)),!((x?y==a.doc.scrollLeft:Math.abs(a.doc.scrollLeft-y)<2)&&!b)&&(a.doc.scrollLeft=y,Fl(a),a.display.scroller.scrollLeft!=y&&(a.display.scroller.scrollLeft=y),a.display.scrollbars.setScrollLeft(y))}function ea(a){var y=a.display,x=y.gutters.offsetWidth,b=Math.round(a.doc.height+Or(a.display));return{clientHeight:y.scroller.clientHeight,viewHeight:y.wrapper.clientHeight,scrollWidth:y.scroller.scrollWidth,clientWidth:y.scroller.clientWidth,viewWidth:y.wrapper.clientWidth,barLeft:a.options.fixedGutter?x:0,docHeight:b,scrollHeight:b+Tr(a)+y.barHeight,nativeBarWidth:y.nativeBarWidth,gutterWidth:x}}var Eo=function(a,y,x){this.cm=x;var b=this.vert=Ge("div",[Ge("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),E=this.horiz=Ge("div",[Ge("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");b.tabIndex=E.tabIndex=-1,a(b),a(E),_e(b,"scroll",function(){b.clientHeight&&y(b.scrollTop,"vertical")}),_e(E,"scroll",function(){E.clientWidth&&y(E.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,pe&&ge<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Eo.prototype.update=function(a){var y=a.scrollWidth>a.clientWidth+1,x=a.scrollHeight>a.clientHeight+1,b=a.nativeBarWidth;if(x){this.vert.style.display="block",this.vert.style.bottom=y?b+"px":"0";var E=a.viewHeight-(y?b:0);this.vert.firstChild.style.height=Math.max(0,a.scrollHeight-a.clientHeight+E)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(y){this.horiz.style.display="block",this.horiz.style.right=x?b+"px":"0",this.horiz.style.left=a.barLeft+"px";var ee=a.viewWidth-a.barLeft-(x?b:0);this.horiz.firstChild.style.width=Math.max(0,a.scrollWidth-a.clientWidth+ee)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&a.clientHeight>0&&(b==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:x?b:0,bottom:y?b:0}},Eo.prototype.setScrollLeft=function(a){this.horiz.scrollLeft!=a&&(this.horiz.scrollLeft=a),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Eo.prototype.setScrollTop=function(a){this.vert.scrollTop!=a&&(this.vert.scrollTop=a),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Eo.prototype.zeroWidthHack=function(){var a=xe&&!me?"12px":"18px";this.horiz.style.height=this.vert.style.width=a,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new de,this.disableVert=new de},Eo.prototype.enableZeroWidthBar=function(a,y,x){a.style.pointerEvents="auto";function b(){var E=a.getBoundingClientRect(),ee=x=="vert"?document.elementFromPoint(E.right-1,(E.top+E.bottom)/2):document.elementFromPoint((E.right+E.left)/2,E.bottom-1);ee!=a?a.style.pointerEvents="none":y.set(1e3,b)}y.set(1e3,b)},Eo.prototype.clear=function(){var a=this.horiz.parentNode;a.removeChild(this.horiz),a.removeChild(this.vert)};var ta=function(){};ta.prototype.update=function(){return{bottom:0,right:0}},ta.prototype.setScrollLeft=function(){},ta.prototype.setScrollTop=function(){},ta.prototype.clear=function(){};function Ro(a,y){y||(y=ea(a));var x=a.display.barWidth,b=a.display.barHeight;Al(a,y);for(var E=0;E<4&&x!=a.display.barWidth||b!=a.display.barHeight;E++)x!=a.display.barWidth&&a.options.lineWrapping&&Da(a),Al(a,ea(a)),x=a.display.barWidth,b=a.display.barHeight}function Al(a,y){var x=a.display,b=x.scrollbars.update(y);x.sizer.style.paddingRight=(x.barWidth=b.right)+"px",x.sizer.style.paddingBottom=(x.barHeight=b.bottom)+"px",x.heightForcer.style.borderBottom=b.bottom+"px solid transparent",b.right&&b.bottom?(x.scrollbarFiller.style.display="block",x.scrollbarFiller.style.height=b.bottom+"px",x.scrollbarFiller.style.width=b.right+"px"):x.scrollbarFiller.style.display="",b.bottom&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(x.gutterFiller.style.display="block",x.gutterFiller.style.height=b.bottom+"px",x.gutterFiller.style.width=y.gutterWidth+"px"):x.gutterFiller.style.display=""}var Pl={native:Eo,null:ta};function Bl(a){a.display.scrollbars&&(a.display.scrollbars.clear(),a.display.scrollbars.addClass&&it(a.display.wrapper,a.display.scrollbars.addClass)),a.display.scrollbars=new Pl[a.options.scrollbarStyle](function(y){a.display.wrapper.insertBefore(y,a.display.scrollbarFiller),_e(y,"mousedown",function(){a.state.focused&&setTimeout(function(){return a.display.input.focus()},0)}),y.setAttribute("cm-not-content","true")},function(y,x){x=="horizontal"?ko(a,y):$o(a,y)},a),a.display.scrollbars.addClass&&ot(a.display.wrapper,a.display.scrollbars.addClass)}var Vs=0;function Do(a){a.curOp={cm:a,viewChanged:!1,startHeight:a.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:++Vs},Xr(a.curOp)}function Lo(a){var y=a.curOp;y&&ao(y,function(x){for(var b=0;b<x.ops.length;b++)x.ops[b].cm.curOp=null;Us(x)})}function Us(a){for(var y=a.ops,x=0;x<y.length;x++)Ks(y[x]);for(var b=0;b<y.length;b++)Ys(y[b]);for(var E=0;E<y.length;E++)Xs(y[E]);for(var ee=0;ee<y.length;ee++)qs(y[ee]);for(var re=0;re<y.length;re++)Js(y[re])}function Ks(a){var y=a.cm,x=y.display;$s(y),a.updateMaxLine&&Xn(y),a.mustUpdate=a.viewChanged||a.forceUpdate||a.scrollTop!=null||a.scrollToPos&&(a.scrollToPos.from.line<x.viewFrom||a.scrollToPos.to.line>=x.viewTo)||x.maxLineChanged&&y.options.lineWrapping,a.update=a.mustUpdate&&new Ma(y,a.mustUpdate&&{top:a.scrollTop,ensure:a.scrollToPos},a.forceUpdate)}function Ys(a){a.updatedDisplay=a.mustUpdate&&$a(a.cm,a.update)}function Xs(a){var y=a.cm,x=y.display;a.updatedDisplay&&Da(y),a.barMeasure=ea(y),x.maxLineChanged&&!y.options.lineWrapping&&(a.adjustWidthTo=ya(y,x.maxLine,x.maxLine.text.length).left+3,y.display.sizerWidth=a.adjustWidthTo,a.barMeasure.scrollWidth=Math.max(x.scroller.clientWidth,x.sizer.offsetLeft+a.adjustWidthTo+Tr(y)+y.display.barWidth),a.maxScrollLeft=Math.max(0,x.sizer.offsetLeft+a.adjustWidthTo-Jr(y))),(a.updatedDisplay||a.selectionChanged)&&(a.preparedSelection=x.input.prepareSelection())}function qs(a){var y=a.cm;a.adjustWidthTo!=null&&(y.display.sizer.style.minWidth=a.adjustWidthTo+"px",a.maxScrollLeft<y.doc.scrollLeft&&ko(y,Math.min(y.display.scroller.scrollLeft,a.maxScrollLeft),!0),y.display.maxLineChanged=!1);var x=a.focus&&a.focus==Pe();a.preparedSelection&&y.display.input.showSelection(a.preparedSelection,x),(a.updatedDisplay||a.startHeight!=y.doc.height)&&Ro(y,a.barMeasure),a.updatedDisplay&&nl(y,a.barMeasure),a.selectionChanged&&Xa(y),y.state.focused&&a.updateInput&&y.display.input.reset(a.typing),x&&El(a.cm)}function Js(a){var y=a.cm,x=y.display,b=y.doc;if(a.updatedDisplay&&_l(y,a.update),x.wheelStartX!=null&&(a.scrollTop!=null||a.scrollLeft!=null||a.scrollToPos)&&(x.wheelStartX=x.wheelStartY=null),a.scrollTop!=null&&Ml(y,a.scrollTop,a.forceScroll),a.scrollLeft!=null&&ko(y,a.scrollLeft,!0,!0),a.scrollToPos){var E=Zs(y,Ae(b,a.scrollToPos.from),Ae(b,a.scrollToPos.to),a.scrollToPos.margin);zs(y,E)}var ee=a.maybeHiddenMarkers,re=a.maybeUnhiddenMarkers;if(ee)for(var le=0;le<ee.length;++le)ee[le].lines.length||Qt(ee[le],"hide");if(re)for(var se=0;se<re.length;++se)re[se].lines.length&&Qt(re[se],"unhide");x.wrapper.offsetHeight&&(b.scrollTop=y.display.scroller.scrollTop),a.changeObjs&&Qt(y,"changes",y,a.changeObjs),a.update&&a.update.finish()}function Pr(a,y){if(a.curOp)return y();Do(a);try{return y()}finally{Lo(a)}}function nr(a,y){return function(){if(a.curOp)return y.apply(a,arguments);Do(a);try{return y.apply(a,arguments)}finally{Lo(a)}}}function yr(a){return function(){if(this.curOp)return a.apply(this,arguments);Do(this);try{return a.apply(this,arguments)}finally{Lo(this)}}}function ir(a){return function(){var y=this.cm;if(!y||y.curOp)return a.apply(this,arguments);Do(y);try{return a.apply(this,arguments)}finally{Lo(y)}}}function na(a,y){a.doc.highlightFrontier<a.display.viewTo&&a.state.highlight.set(y,pn(Qs,a))}function Qs(a){var y=a.doc;if(!(y.highlightFrontier>=a.display.viewTo)){var x=+new Date+a.options.workTime,b=mi(a,y.highlightFrontier),E=[];y.iter(b.line,Math.min(y.first+y.size,a.display.viewTo+500),function(ee){if(b.line>=a.display.viewFrom){var re=ee.styles,le=ee.text.length>a.options.maxHighlightLength?wn(y.mode,b.state):null,se=Mn(a,ee,b,!0);le&&(b.state=le),ee.styles=se.styles;var ce=ee.styleClasses,ye=se.classes;ye?ee.styleClasses=ye:ce&&(ee.styleClasses=null);for(var Ce=!re||re.length!=ee.styles.length||ce!=ye&&(!ce||!ye||ce.bgClass!=ye.bgClass||ce.textClass!=ye.textClass),je=0;!Ce&&je<re.length;++je)Ce=re[je]!=ee.styles[je];Ce&&E.push(b.line),ee.stateAfter=b.save(),b.nextLine()}else ee.text.length<=a.options.maxHighlightLength&&Vn(a,ee.text,b),ee.stateAfter=b.line%5==0?b.save():null,b.nextLine();if(+new Date>x)return na(a,a.options.workDelay),!0}),y.highlightFrontier=b.line,y.modeFrontier=Math.max(y.modeFrontier,b.line),E.length&&Pr(a,function(){for(var ee=0;ee<E.length;ee++)ho(a,E[ee],"text")})}}var Ma=function(a,y,x){var b=a.display;this.viewport=y,this.visible=La(b,a.doc,y),this.editorIsHidden=!b.wrapper.offsetWidth,this.wrapperHeight=b.wrapper.clientHeight,this.wrapperWidth=b.wrapper.clientWidth,this.oldDisplayWidth=Jr(a),this.force=x,this.dims=co(a),this.events=[]};Ma.prototype.signal=function(a,y){ke(a,y)&&this.events.push(arguments)},Ma.prototype.finish=function(){for(var a=0;a<this.events.length;a++)Qt.apply(null,this.events[a])};function $s(a){var y=a.display;!y.scrollbarsClipped&&y.scroller.offsetWidth&&(y.nativeBarWidth=y.scroller.offsetWidth-y.scroller.clientWidth,y.heightForcer.style.height=Tr(a)+"px",y.sizer.style.marginBottom=-y.nativeBarWidth+"px",y.sizer.style.borderRightWidth=Tr(a)+"px",y.scrollbarsClipped=!0)}function eu(a){if(a.hasFocus())return null;var y=Pe();if(!y||!Qe(a.display.lineDiv,y))return null;var x={activeElt:y};if(window.getSelection){var b=window.getSelection();b.anchorNode&&b.extend&&Qe(a.display.lineDiv,b.anchorNode)&&(x.anchorNode=b.anchorNode,x.anchorOffset=b.anchorOffset,x.focusNode=b.focusNode,x.focusOffset=b.focusOffset)}return x}function tu(a){if(!(!a||!a.activeElt||a.activeElt==Pe())&&(a.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(a.activeElt.nodeName)&&a.anchorNode&&Qe(document.body,a.anchorNode)&&Qe(document.body,a.focusNode))){var y=window.getSelection(),x=document.createRange();x.setEnd(a.anchorNode,a.anchorOffset),x.collapse(!1),y.removeAllRanges(),y.addRange(x),y.extend(a.focusNode,a.focusOffset)}}function $a(a,y){var x=a.display,b=a.doc;if(y.editorIsHidden)return fo(a),!1;if(!y.force&&y.visible.from>=x.viewFrom&&y.visible.to<=x.viewTo&&(x.updateLineNumbers==null||x.updateLineNumbers>=x.viewTo)&&x.renderedView==x.view&&Cl(a)==0)return!1;Rl(a)&&(fo(a),y.dims=co(a));var E=b.first+b.size,ee=Math.max(y.visible.from-a.options.viewportMargin,b.first),re=Math.min(E,y.visible.to+a.options.viewportMargin);x.viewFrom<ee&&ee-x.viewFrom<20&&(ee=Math.max(b.first,x.viewFrom)),x.viewTo>re&&x.viewTo-re<20&&(re=Math.min(E,x.viewTo)),ai&&(ee=Lt(a.doc,ee),re=jt(a.doc,re));var le=ee!=x.viewFrom||re!=x.viewTo||x.lastWrapHeight!=y.wrapperHeight||x.lastWrapWidth!=y.wrapperWidth;Ws(a,ee,re),x.viewOffset=Kn(Ze(a.doc,x.viewFrom)),a.display.mover.style.top=x.viewOffset+"px";var se=Cl(a);if(!le&&se==0&&!y.force&&x.renderedView==x.view&&(x.updateLineNumbers==null||x.updateLineNumbers>=x.viewTo))return!1;var ce=eu(a);return se>4&&(x.lineDiv.style.display="none"),nu(a,x.updateLineNumbers,y.dims),se>4&&(x.lineDiv.style.display=""),x.renderedView=x.view,tu(ce),Yt(x.cursorDiv),Yt(x.selectionDiv),x.gutters.style.height=x.sizer.style.minHeight=0,le&&(x.lastWrapHeight=y.wrapperHeight,x.lastWrapWidth=y.wrapperWidth,na(a,400)),x.updateLineNumbers=null,!0}function _l(a,y){for(var x=y.viewport,b=!0;;b=!1){if(!b||!a.options.lineWrapping||y.oldDisplayWidth==Jr(a)){if(x&&x.top!=null&&(x={top:Math.min(a.doc.height+Or(a.display)-no(a),x.top)}),y.visible=La(a.display,a.doc,x),y.visible.from>=a.display.viewFrom&&y.visible.to<=a.display.viewTo)break}else b&&(y.visible=La(a.display,a.doc,x));if(!$a(a,y))break;Da(a);var E=ea(a);Jo(a),Ro(a,E),nl(a,E),y.force=!1}y.signal(a,"update",a),(a.display.viewFrom!=a.display.reportedViewFrom||a.display.viewTo!=a.display.reportedViewTo)&&(y.signal(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo),a.display.reportedViewFrom=a.display.viewFrom,a.display.reportedViewTo=a.display.viewTo)}function el(a,y){var x=new Ma(a,y);if($a(a,x)){Da(a),_l(a,x);var b=ea(a);Jo(a),Ro(a,b),nl(a,b),x.finish()}}function nu(a,y,x){var b=a.display,E=a.options.lineNumbers,ee=b.lineDiv,re=ee.firstChild;function le(vt){var Dt=vt.nextSibling;return Fe&&xe&&a.display.currentWheelTarget==vt?vt.style.display="none":vt.parentNode.removeChild(vt),Dt}for(var se=b.view,ce=b.viewFrom,ye=0;ye<se.length;ye++){var Ce=se[ye];if(!Ce.hidden)if(!Ce.node||Ce.node.parentNode!=ee){var je=Zn(a,Ce,ce,x);ee.insertBefore(je,re)}else{for(;re!=Ce.node;)re=le(re);var He=E&&y!=null&&y<=ce&&Ce.lineNumber;Ce.changes&&(ut(Ce.changes,"gutter")>-1&&(He=!1),lo(a,Ce,ce,x)),He&&(Yt(Ce.lineNumber),Ce.lineNumber.appendChild(document.createTextNode(ht(a.options,ce)))),re=Ce.node.nextSibling}ce+=Ce.size}for(;re;)re=le(re)}function tl(a){var y=a.gutters.offsetWidth;a.sizer.style.marginLeft=y+"px"}function nl(a,y){a.display.sizer.style.minHeight=y.docHeight+"px",a.display.heightForcer.style.top=y.docHeight+"px",a.display.gutters.style.height=y.docHeight+a.display.barHeight+Tr(a)+"px"}function Fl(a){var y=a.display,x=y.view;if(!(!y.alignWidgets&&(!y.gutters.firstChild||!a.options.fixedGutter))){for(var b=Ka(y)-y.scroller.scrollLeft+a.doc.scrollLeft,E=y.gutters.offsetWidth,ee=b+"px",re=0;re<x.length;re++)if(!x[re].hidden){a.options.fixedGutter&&(x[re].gutter&&(x[re].gutter.style.left=ee),x[re].gutterBackground&&(x[re].gutterBackground.style.left=ee));var le=x[re].alignable;if(le)for(var se=0;se<le.length;se++)le[se].style.left=ee}a.options.fixedGutter&&(y.gutters.style.left=b+E+"px")}}function Rl(a){if(!a.options.lineNumbers)return!1;var y=a.doc,x=ht(a.options,y.first+y.size-1),b=a.display;if(x.length!=b.lineNumChars){var E=b.measure.appendChild(Ge("div",[Ge("div",x)],"CodeMirror-linenumber CodeMirror-gutter-elt")),ee=E.firstChild.offsetWidth,re=E.offsetWidth-ee;return b.lineGutter.style.width="",b.lineNumInnerWidth=Math.max(ee,b.lineGutter.offsetWidth-re)+1,b.lineNumWidth=b.lineNumInnerWidth+re,b.lineNumChars=b.lineNumInnerWidth?x.length:-1,b.lineGutter.style.width=b.lineNumWidth+"px",tl(a.display),!0}return!1}function il(a,y){for(var x=[],b=!1,E=0;E<a.length;E++){var ee=a[E],re=null;if(typeof ee!="string"&&(re=ee.style,ee=ee.className),ee=="CodeMirror-linenumbers")if(y)b=!0;else continue;x.push({className:ee,style:re})}return y&&!b&&x.push({className:"CodeMirror-linenumbers",style:null}),x}function Il(a){var y=a.gutters,x=a.gutterSpecs;Yt(y),a.lineGutter=null;for(var b=0;b<x.length;++b){var E=x[b],ee=E.className,re=E.style,le=y.appendChild(Ge("div",null,"CodeMirror-gutter "+ee));re&&(le.style.cssText=re),ee=="CodeMirror-linenumbers"&&(a.lineGutter=le,le.style.width=(a.lineNumWidth||1)+"px")}y.style.display=x.length?"":"none",tl(a)}function ia(a){Il(a.display),Sr(a),Fl(a)}function iu(a,y,x,b){var E=this;this.input=x,E.scrollbarFiller=Ge("div",null,"CodeMirror-scrollbar-filler"),E.scrollbarFiller.setAttribute("cm-not-content","true"),E.gutterFiller=Ge("div",null,"CodeMirror-gutter-filler"),E.gutterFiller.setAttribute("cm-not-content","true"),E.lineDiv=mt("div",null,"CodeMirror-code"),E.selectionDiv=Ge("div",null,null,"position: relative; z-index: 1"),E.cursorDiv=Ge("div",null,"CodeMirror-cursors"),E.measure=Ge("div",null,"CodeMirror-measure"),E.lineMeasure=Ge("div",null,"CodeMirror-measure"),E.lineSpace=mt("div",[E.measure,E.lineMeasure,E.selectionDiv,E.cursorDiv,E.lineDiv],null,"position: relative; outline: none");var ee=mt("div",[E.lineSpace],"CodeMirror-lines");E.mover=Ge("div",[ee],null,"position: relative"),E.sizer=Ge("div",[E.mover],"CodeMirror-sizer"),E.sizerWidth=null,E.heightForcer=Ge("div",null,null,"position: absolute; height: "+Jt+"px; width: 1px;"),E.gutters=Ge("div",null,"CodeMirror-gutters"),E.lineGutter=null,E.scroller=Ge("div",[E.sizer,E.heightForcer,E.gutters],"CodeMirror-scroll"),E.scroller.setAttribute("tabIndex","-1"),E.wrapper=Ge("div",[E.scrollbarFiller,E.gutterFiller,E.scroller],"CodeMirror"),pe&&ge<8&&(E.gutters.style.zIndex=-1,E.scroller.style.paddingRight=0),!Fe&&!(ie&&Le)&&(E.scroller.draggable=!0),a&&(a.appendChild?a.appendChild(E.wrapper):a(E.wrapper)),E.viewFrom=E.viewTo=y.first,E.reportedViewFrom=E.reportedViewTo=y.first,E.view=[],E.renderedView=null,E.externalMeasured=null,E.viewOffset=0,E.lastWrapHeight=E.lastWrapWidth=0,E.updateLineNumbers=null,E.nativeBarWidth=E.barHeight=E.barWidth=0,E.scrollbarsClipped=!1,E.lineNumWidth=E.lineNumInnerWidth=E.lineNumChars=null,E.alignWidgets=!1,E.cachedCharWidth=E.cachedTextHeight=E.cachedPaddingH=null,E.maxLine=null,E.maxLineLength=0,E.maxLineChanged=!1,E.wheelDX=E.wheelDY=E.wheelStartX=E.wheelStartY=null,E.shift=!1,E.selForContextMenu=null,E.activeTouch=null,E.gutterSpecs=il(b.gutters,b.lineNumbers),Il(E),x.init(E)}var Aa=0,Fr=null;pe?Fr=-.53:ie?Fr=15:we?Fr=-.7:Ke&&(Fr=-1/3);function Nl(a){var y=a.wheelDeltaX,x=a.wheelDeltaY;return y==null&&a.detail&&a.axis==a.HORIZONTAL_AXIS&&(y=a.detail),x==null&&a.detail&&a.axis==a.VERTICAL_AXIS?x=a.detail:x==null&&(x=a.wheelDelta),{x:y,y:x}}function ru(a){var y=Nl(a);return y.x*=Fr,y.y*=Fr,y}function Ol(a,y){var x=Nl(y),b=x.x,E=x.y,ee=a.display,re=ee.scroller,le=re.scrollWidth>re.clientWidth,se=re.scrollHeight>re.clientHeight;if(b&&le||E&&se){if(E&&xe&&Fe){e:for(var ce=y.target,ye=ee.view;ce!=re;ce=ce.parentNode)for(var Ce=0;Ce<ye.length;Ce++)if(ye[Ce].node==ce){a.display.currentWheelTarget=ce;break e}}if(b&&!ie&&!fe&&Fr!=null){E&&se&&$o(a,Math.max(0,re.scrollTop+E*Fr)),ko(a,Math.max(0,re.scrollLeft+b*Fr)),(!E||E&&se)&&Zt(y),ee.wheelStartX=null;return}if(E&&Fr!=null){var je=E*Fr,He=a.doc.scrollTop,vt=He+ee.wrapper.clientHeight;je<0?He=Math.max(0,He+je-50):vt=Math.min(a.doc.height,vt+je+50),el(a,{top:He,bottom:vt})}Aa<20&&(ee.wheelStartX==null?(ee.wheelStartX=re.scrollLeft,ee.wheelStartY=re.scrollTop,ee.wheelDX=b,ee.wheelDY=E,setTimeout(function(){if(ee.wheelStartX!=null){var Dt=re.scrollLeft-ee.wheelStartX,zt=re.scrollTop-ee.wheelStartY,an=zt&&ee.wheelDY&&zt/ee.wheelDY||Dt&&ee.wheelDX&&Dt/ee.wheelDX;ee.wheelStartX=ee.wheelStartY=null,an&&(Fr=(Fr*Aa+an)/(Aa+1),++Aa)}},200)):(ee.wheelDX+=b,ee.wheelDY+=E))}}var Rr=function(a,y){this.ranges=a,this.primIndex=y};Rr.prototype.primary=function(){return this.ranges[this.primIndex]},Rr.prototype.equals=function(a){if(a==this)return!0;if(a.primIndex!=this.primIndex||a.ranges.length!=this.ranges.length)return!1;for(var y=0;y<this.ranges.length;y++){var x=this.ranges[y],b=a.ranges[y];if(!Ut(x.anchor,b.anchor)||!Ut(x.head,b.head))return!1}return!0},Rr.prototype.deepCopy=function(){for(var a=[],y=0;y<this.ranges.length;y++)a[y]=new ki(sn(this.ranges[y].anchor),sn(this.ranges[y].head));return new Rr(a,this.primIndex)},Rr.prototype.somethingSelected=function(){for(var a=0;a<this.ranges.length;a++)if(!this.ranges[a].empty())return!0;return!1},Rr.prototype.contains=function(a,y){y||(y=a);for(var x=0;x<this.ranges.length;x++){var b=this.ranges[x];if(pt(y,b.from())>=0&&pt(a,b.to())<=0)return x}return-1};var ki=function(a,y){this.anchor=a,this.head=y};ki.prototype.from=function(){return It(this.anchor,this.head)},ki.prototype.to=function(){return dn(this.anchor,this.head)},ki.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Kr(a,y,x){var b=a&&a.options.selectionsMayTouch,E=y[x];y.sort(function(je,He){return pt(je.from(),He.from())}),x=ut(y,E);for(var ee=1;ee<y.length;ee++){var re=y[ee],le=y[ee-1],se=pt(le.to(),re.from());if(b&&!re.empty()?se>0:se>=0){var ce=It(le.from(),re.from()),ye=dn(le.to(),re.to()),Ce=le.empty()?re.from()==re.head:le.from()==le.head;ee<=x&&--x,y.splice(--ee,2,new ki(Ce?ye:ce,Ce?ce:ye))}}return new Rr(y,x)}function po(a,y){return new Rr([new ki(a,y||a)],0)}function vo(a){return a.text?Re(a.from.line+a.text.length-1,We(a.text).length+(a.text.length==1?a.from.ch:0)):a.to}function Wl(a,y){if(pt(a,y.from)<0)return a;if(pt(a,y.to)<=0)return vo(y);var x=a.line+y.text.length-(y.to.line-y.from.line)-1,b=a.ch;return a.line==y.to.line&&(b+=vo(y).ch-y.to.ch),Re(x,b)}function rl(a,y){for(var x=[],b=0;b<a.sel.ranges.length;b++){var E=a.sel.ranges[b];x.push(new ki(Wl(E.anchor,y),Wl(E.head,y)))}return Kr(a.cm,x,a.sel.primIndex)}function Hl(a,y,x){return a.line==y.line?Re(x.line,a.ch-y.ch+x.ch):Re(x.line+(a.line-y.line),a.ch)}function ou(a,y,x){for(var b=[],E=Re(a.first,0),ee=E,re=0;re<y.length;re++){var le=y[re],se=Hl(le.from,E,ee),ce=Hl(vo(le),E,ee);if(E=le.to,ee=ce,x=="around"){var ye=a.sel.ranges[re],Ce=pt(ye.head,ye.anchor)<0;b[re]=new ki(Ce?ce:se,Ce?se:ce)}else b[re]=new ki(se,se)}return new Rr(b,a.sel.primIndex)}function ol(a){a.doc.mode=Qn(a.options,a.doc.modeOption),ra(a)}function ra(a){a.doc.iter(function(y){y.stateAfter&&(y.stateAfter=null),y.styles&&(y.styles=null)}),a.doc.modeFrontier=a.doc.highlightFrontier=a.doc.first,na(a,100),a.state.modeGen++,a.curOp&&Sr(a)}function zl(a,y){return y.from.ch==0&&y.to.ch==0&&We(y.text)==""&&(!a.cm||a.cm.options.wholeLineUpdateBefore)}function al(a,y,x,b){function E(fn){return x?x[fn]:null}function ee(fn,ln,yn){_i(fn,ln,yn,b),Oi(fn,"change",fn,y)}function re(fn,ln){for(var yn=[],In=fn;In<ln;++In)yn.push(new si(ce[In],E(In),b));return yn}var le=y.from,se=y.to,ce=y.text,ye=Ze(a,le.line),Ce=Ze(a,se.line),je=We(ce),He=E(ce.length-1),vt=se.line-le.line;if(y.full)a.insert(0,re(0,ce.length)),a.remove(ce.length,a.size-ce.length);else if(zl(a,y)){var Dt=re(0,ce.length-1);ee(Ce,Ce.text,He),vt&&a.remove(le.line,vt),Dt.length&&a.insert(le.line,Dt)}else if(ye==Ce)if(ce.length==1)ee(ye,ye.text.slice(0,le.ch)+je+ye.text.slice(se.ch),He);else{var zt=re(1,ce.length-1);zt.push(new si(je+ye.text.slice(se.ch),He,b)),ee(ye,ye.text.slice(0,le.ch)+ce[0],E(0)),a.insert(le.line+1,zt)}else if(ce.length==1)ee(ye,ye.text.slice(0,le.ch)+ce[0]+Ce.text.slice(se.ch),E(0)),a.remove(le.line+1,vt);else{ee(ye,ye.text.slice(0,le.ch)+ce[0],E(0)),ee(Ce,je+Ce.text.slice(se.ch),He);var an=re(1,ce.length-1);vt>1&&a.remove(le.line+1,vt-1),a.insert(le.line+1,an)}Oi(a,"change",a,y)}function mo(a,y,x){function b(E,ee,re){if(E.linked)for(var le=0;le<E.linked.length;++le){var se=E.linked[le];if(se.doc!=ee){var ce=re&&se.sharedHist;x&&!ce||(y(se.doc,ce),b(se.doc,E,ce))}}}b(a,null,!0)}function Zl(a,y){if(y.cm)throw new Error("This document is already in use.");a.doc=y,y.cm=a,Ya(a),ol(a),Gl(a),a.options.lineWrapping||Xn(a),a.options.mode=y.modeOption,Sr(a)}function Gl(a){(a.doc.direction=="rtl"?ot:it)(a.display.lineDiv,"CodeMirror-rtl")}function au(a){Pr(a,function(){Gl(a),Sr(a)})}function Pa(a){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=a||1}function ll(a,y){var x={from:sn(y.from),to:vo(y),text:Bt(a,y.from,y.to)};return Ul(a,x,y.from.line,y.to.line+1),mo(a,function(b){return Ul(b,x,y.from.line,y.to.line+1)},!0),x}function jl(a){for(;a.length;){var y=We(a);if(y.ranges)a.pop();else break}}function lu(a,y){if(y)return jl(a.done),We(a.done);if(a.done.length&&!We(a.done).ranges)return We(a.done);if(a.done.length>1&&!a.done[a.done.length-2].ranges)return a.done.pop(),We(a.done)}function Vl(a,y,x,b){var E=a.history;E.undone.length=0;var ee=+new Date,re,le;if((E.lastOp==b||E.lastOrigin==y.origin&&y.origin&&(y.origin.charAt(0)=="+"&&E.lastModTime>ee-(a.cm?a.cm.options.historyEventDelay:500)||y.origin.charAt(0)=="*"))&&(re=lu(E,E.lastOp==b)))le=We(re.changes),pt(y.from,y.to)==0&&pt(y.from,le.to)==0?le.to=vo(y):re.changes.push(ll(a,y));else{var se=We(E.done);for((!se||!se.ranges)&&Ba(a.sel,E.done),re={changes:[ll(a,y)],generation:E.generation},E.done.push(re);E.done.length>E.undoDepth;)E.done.shift(),E.done[0].ranges||E.done.shift()}E.done.push(x),E.generation=++E.maxGeneration,E.lastModTime=E.lastSelTime=ee,E.lastOp=E.lastSelOp=b,E.lastOrigin=E.lastSelOrigin=y.origin,le||Qt(a,"historyAdded")}function su(a,y,x,b){var E=y.charAt(0);return E=="*"||E=="+"&&x.ranges.length==b.ranges.length&&x.somethingSelected()==b.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}function uu(a,y,x,b){var E=a.history,ee=b&&b.origin;x==E.lastSelOp||ee&&E.lastSelOrigin==ee&&(E.lastModTime==E.lastSelTime&&E.lastOrigin==ee||su(a,ee,We(E.done),y))?E.done[E.done.length-1]=y:Ba(y,E.done),E.lastSelTime=+new Date,E.lastSelOrigin=ee,E.lastSelOp=x,b&&b.clearRedo!==!1&&jl(E.undone)}function Ba(a,y){var x=We(y);x&&x.ranges&&x.equals(a)||y.push(a)}function Ul(a,y,x,b){var E=y["spans_"+a.id],ee=0;a.iter(Math.max(a.first,x),Math.min(a.first+a.size,b),function(re){re.markedSpans&&((E||(E=y["spans_"+a.id]={}))[ee]=re.markedSpans),++ee})}function cu(a){if(!a)return null;for(var y,x=0;x<a.length;++x)a[x].marker.explicitlyCleared?y||(y=a.slice(0,x)):y&&y.push(a[x]);return y?y.length?y:null:a}function du(a,y){var x=y["spans_"+a.id];if(!x)return null;for(var b=[],E=0;E<y.text.length;++E)b.push(cu(x[E]));return b}function Kl(a,y){var x=du(a,y),b=Bi(a,y);if(!x)return b;if(!b)return x;for(var E=0;E<x.length;++E){var ee=x[E],re=b[E];if(ee&&re)e:for(var le=0;le<re.length;++le){for(var se=re[le],ce=0;ce<ee.length;++ce)if(ee[ce].marker==se.marker)continue e;ee.push(se)}else re&&(x[E]=re)}return x}function Io(a,y,x){for(var b=[],E=0;E<a.length;++E){var ee=a[E];if(ee.ranges){b.push(x?Rr.prototype.deepCopy.call(ee):ee);continue}var re=ee.changes,le=[];b.push({changes:le});for(var se=0;se<re.length;++se){var ce=re[se],ye=void 0;if(le.push({from:ce.from,to:ce.to,text:ce.text}),y)for(var Ce in ce)(ye=Ce.match(/^spans_(\d+)$/))&&ut(y,Number(ye[1]))>-1&&(We(le)[Ce]=ce[Ce],delete ce[Ce])}}return b}function sl(a,y,x,b){if(b){var E=a.anchor;if(x){var ee=pt(y,E)<0;ee!=pt(x,E)<0?(E=y,y=x):ee!=pt(y,x)<0&&(y=x)}return new ki(E,y)}else return new ki(x||y,y)}function _a(a,y,x,b,E){E==null&&(E=a.cm&&(a.cm.display.shift||a.extend)),pr(a,new Rr([sl(a.sel.primary(),y,x,E)],0),b)}function Yl(a,y,x){for(var b=[],E=a.cm&&(a.cm.display.shift||a.extend),ee=0;ee<a.sel.ranges.length;ee++)b[ee]=sl(a.sel.ranges[ee],y[ee],null,E);var re=Kr(a.cm,b,a.sel.primIndex);pr(a,re,x)}function ul(a,y,x,b){var E=a.sel.ranges.slice(0);E[y]=x,pr(a,Kr(a.cm,E,a.sel.primIndex),b)}function Xl(a,y,x,b){pr(a,po(y,x),b)}function hu(a,y,x){var b={ranges:y.ranges,update:function(E){this.ranges=[];for(var ee=0;ee<E.length;ee++)this.ranges[ee]=new ki(Ae(a,E[ee].anchor),Ae(a,E[ee].head))},origin:x&&x.origin};return Qt(a,"beforeSelectionChange",a,b),a.cm&&Qt(a.cm,"beforeSelectionChange",a.cm,b),b.ranges!=y.ranges?Kr(a.cm,b.ranges,b.ranges.length-1):y}function ql(a,y,x){var b=a.history.done,E=We(b);E&&E.ranges?(b[b.length-1]=y,Fa(a,y,x)):pr(a,y,x)}function pr(a,y,x){Fa(a,y,x),uu(a,a.sel,a.cm?a.cm.curOp.id:NaN,x)}function Fa(a,y,x){(ke(a,"beforeSelectionChange")||a.cm&&ke(a.cm,"beforeSelectionChange"))&&(y=hu(a,y,x));var b=x&&x.bias||(pt(y.primary().head,a.sel.primary().head)<0?-1:1);Jl(a,$l(a,y,b,!0)),!(x&&x.scroll===!1)&&a.cm&&Fo(a.cm)}function Jl(a,y){y.equals(a.sel)||(a.sel=y,a.cm&&(a.cm.curOp.updateInput=1,a.cm.curOp.selectionChanged=!0,tn(a.cm)),Oi(a,"cursorActivity",a))}function Ql(a){Jl(a,$l(a,a.sel,null,!1))}function $l(a,y,x,b){for(var E,ee=0;ee<y.ranges.length;ee++){var re=y.ranges[ee],le=y.ranges.length==a.sel.ranges.length&&a.sel.ranges[ee],se=Ra(a,re.anchor,le&&le.anchor,x,b),ce=Ra(a,re.head,le&&le.head,x,b);(E||se!=re.anchor||ce!=re.head)&&(E||(E=y.ranges.slice(0,ee)),E[ee]=new ki(se,ce))}return E?Kr(a.cm,E,y.primIndex):y}function No(a,y,x,b,E){var ee=Ze(a,y.line);if(ee.markedSpans)for(var re=0;re<ee.markedSpans.length;++re){var le=ee.markedSpans[re],se=le.marker,ce="selectLeft"in se?!se.selectLeft:se.inclusiveLeft,ye="selectRight"in se?!se.selectRight:se.inclusiveRight;if((le.from==null||(ce?le.from<=y.ch:le.from<y.ch))&&(le.to==null||(ye?le.to>=y.ch:le.to>y.ch))){if(E&&(Qt(se,"beforeCursorEnter"),se.explicitlyCleared))if(ee.markedSpans){--re;continue}else break;if(!se.atomic)continue;if(x){var Ce=se.find(b<0?1:-1),je=void 0;if((b<0?ye:ce)&&(Ce=es(a,Ce,-b,Ce&&Ce.line==y.line?ee:null)),Ce&&Ce.line==y.line&&(je=pt(Ce,x))&&(b<0?je<0:je>0))return No(a,Ce,y,b,E)}var He=se.find(b<0?-1:1);return(b<0?ce:ye)&&(He=es(a,He,b,He.line==y.line?ee:null)),He?No(a,He,y,b,E):null}}return y}function Ra(a,y,x,b,E){var ee=b||1,re=No(a,y,x,ee,E)||!E&&No(a,y,x,ee,!0)||No(a,y,x,-ee,E)||!E&&No(a,y,x,-ee,!0);return re||(a.cantEdit=!0,Re(a.first,0))}function es(a,y,x,b){return x<0&&y.ch==0?y.line>a.first?Ae(a,Re(y.line-1)):null:x>0&&y.ch==(b||Ze(a,y.line)).text.length?y.line<a.first+a.size-1?Re(y.line+1,0):null:new Re(y.line,y.ch+x)}function ts(a){a.setSelection(Re(a.firstLine(),0),Re(a.lastLine()),Be)}function ns(a,y,x){var b={canceled:!1,from:y.from,to:y.to,text:y.text,origin:y.origin,cancel:function(){return b.canceled=!0}};return x&&(b.update=function(E,ee,re,le){E&&(b.from=Ae(a,E)),ee&&(b.to=Ae(a,ee)),re&&(b.text=re),le!==void 0&&(b.origin=le)}),Qt(a,"beforeChange",a,b),a.cm&&Qt(a.cm,"beforeChange",a.cm,b),b.canceled?(a.cm&&(a.cm.curOp.updateInput=2),null):{from:b.from,to:b.to,text:b.text,origin:b.origin}}function Oo(a,y,x){if(a.cm){if(!a.cm.curOp)return nr(a.cm,Oo)(a,y,x);if(a.cm.state.suppressEdits)return}if(!((ke(a,"beforeChange")||a.cm&&ke(a.cm,"beforeChange"))&&(y=ns(a,y,!0),!y))){var b=wi&&!x&&Gi(a,y.from,y.to);if(b)for(var E=b.length-1;E>=0;--E)is(a,{from:b[E].from,to:b[E].to,text:E?[""]:y.text,origin:y.origin});else is(a,y)}}function is(a,y){if(!(y.text.length==1&&y.text[0]==""&&pt(y.from,y.to)==0)){var x=rl(a,y);Vl(a,y,x,a.cm?a.cm.curOp.id:NaN),oa(a,y,x,Bi(a,y));var b=[];mo(a,function(E,ee){!ee&&ut(b,E.history)==-1&&(ls(E.history,y),b.push(E.history)),oa(E,y,null,Bi(E,y))})}}function Ia(a,y,x){var b=a.cm&&a.cm.state.suppressEdits;if(!(b&&!x)){for(var E=a.history,ee,re=a.sel,le=y=="undo"?E.done:E.undone,se=y=="undo"?E.undone:E.done,ce=0;ce<le.length&&(ee=le[ce],!(x?ee.ranges&&!ee.equals(a.sel):!ee.ranges));ce++);if(ce!=le.length){for(E.lastOrigin=E.lastSelOrigin=null;;)if(ee=le.pop(),ee.ranges){if(Ba(ee,se),x&&!ee.equals(a.sel)){pr(a,ee,{clearRedo:!1});return}re=ee}else if(b){le.push(ee);return}else break;var ye=[];Ba(re,se),se.push({changes:ye,generation:E.generation}),E.generation=ee.generation||++E.maxGeneration;for(var Ce=ke(a,"beforeChange")||a.cm&&ke(a.cm,"beforeChange"),je=function(Dt){var zt=ee.changes[Dt];if(zt.origin=y,Ce&&!ns(a,zt,!1))return le.length=0,{};ye.push(ll(a,zt));var an=Dt?rl(a,zt):We(le);oa(a,zt,an,Kl(a,zt)),!Dt&&a.cm&&a.cm.scrollIntoView({from:zt.from,to:vo(zt)});var fn=[];mo(a,function(ln,yn){!yn&&ut(fn,ln.history)==-1&&(ls(ln.history,zt),fn.push(ln.history)),oa(ln,zt,null,Kl(ln,zt))})},He=ee.changes.length-1;He>=0;--He){var vt=je(He);if(vt)return vt.v}}}}function rs(a,y){if(y!=0&&(a.first+=y,a.sel=new Rr(gt(a.sel.ranges,function(E){return new ki(Re(E.anchor.line+y,E.anchor.ch),Re(E.head.line+y,E.head.ch))}),a.sel.primIndex),a.cm)){Sr(a.cm,a.first,a.first-y,y);for(var x=a.cm.display,b=x.viewFrom;b<x.viewTo;b++)ho(a.cm,b,"gutter")}}function oa(a,y,x,b){if(a.cm&&!a.cm.curOp)return nr(a.cm,oa)(a,y,x,b);if(y.to.line<a.first){rs(a,y.text.length-1-(y.to.line-y.from.line));return}if(!(y.from.line>a.lastLine())){if(y.from.line<a.first){var E=y.text.length-1-(a.first-y.from.line);rs(a,E),y={from:Re(a.first,0),to:Re(y.to.line+E,y.to.ch),text:[We(y.text)],origin:y.origin}}var ee=a.lastLine();y.to.line>ee&&(y={from:y.from,to:Re(ee,Ze(a,ee).text.length),text:[y.text[0]],origin:y.origin}),y.removed=Bt(a,y.from,y.to),x||(x=rl(a,y)),a.cm?fu(a.cm,y,b):al(a,y,b),Fa(a,x,Be),a.cantEdit&&Ra(a,Re(a.firstLine(),0))&&(a.cantEdit=!1)}}function fu(a,y,x){var b=a.doc,E=a.display,ee=y.from,re=y.to,le=!1,se=ee.line;a.options.lineWrapping||(se=Se(on(Ze(b,ee.line))),b.iter(se,re.line+1,function(He){if(He==E.maxLine)return le=!0,!0})),b.sel.contains(y.from,y.to)>-1&&tn(a),al(b,y,x,wl(a)),a.options.lineWrapping||(b.iter(se,ee.line+y.text.length,function(He){var vt=Ei(He);vt>E.maxLineLength&&(E.maxLine=He,E.maxLineLength=vt,E.maxLineChanged=!0,le=!1)}),le&&(a.curOp.updateMaxLine=!0)),Mi(b,ee.line),na(a,400);var ce=y.text.length-(re.line-ee.line)-1;y.full?Sr(a):ee.line==re.line&&y.text.length==1&&!zl(a.doc,y)?ho(a,ee.line,"text"):Sr(a,ee.line,re.line+1,ce);var ye=ke(a,"changes"),Ce=ke(a,"change");if(Ce||ye){var je={from:ee,to:re,text:y.text,removed:y.removed,origin:y.origin};Ce&&Oi(a,"change",a,je),ye&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(je)}a.display.selForContextMenu=null}function Wo(a,y,x,b,E){var ee;b||(b=x),pt(b,x)<0&&(ee=[b,x],x=ee[0],b=ee[1]),typeof y=="string"&&(y=a.splitLines(y)),Oo(a,{from:x,to:b,text:y,origin:E})}function os(a,y,x,b){x<a.line?a.line+=b:y<a.line&&(a.line=y,a.ch=0)}function as(a,y,x,b){for(var E=0;E<a.length;++E){var ee=a[E],re=!0;if(ee.ranges){ee.copied||(ee=a[E]=ee.deepCopy(),ee.copied=!0);for(var le=0;le<ee.ranges.length;le++)os(ee.ranges[le].anchor,y,x,b),os(ee.ranges[le].head,y,x,b);continue}for(var se=0;se<ee.changes.length;++se){var ce=ee.changes[se];if(x<ce.from.line)ce.from=Re(ce.from.line+b,ce.from.ch),ce.to=Re(ce.to.line+b,ce.to.ch);else if(y<=ce.to.line){re=!1;break}}re||(a.splice(0,E+1),E=0)}}function ls(a,y){var x=y.from.line,b=y.to.line,E=y.text.length-(b-x)-1;as(a.done,x,b,E),as(a.undone,x,b,E)}function aa(a,y,x,b){var E=y,ee=y;return typeof y=="number"?ee=Ze(a,Kt(a,y)):E=Se(y),E==null?null:(b(ee,E)&&a.cm&&ho(a.cm,E,x),ee)}function la(a){this.lines=a,this.parent=null;for(var y=0,x=0;x<a.length;++x)a[x].parent=this,y+=a[x].height;this.height=y}la.prototype={chunkSize:function(){return this.lines.length},removeInner:function(a,y){for(var x=a,b=a+y;x<b;++x){var E=this.lines[x];this.height-=E.height,ji(E),Oi(E,"delete")}this.lines.splice(a,y)},collapse:function(a){a.push.apply(a,this.lines)},insertInner:function(a,y,x){this.height+=x,this.lines=this.lines.slice(0,a).concat(y).concat(this.lines.slice(a));for(var b=0;b<y.length;++b)y[b].parent=this},iterN:function(a,y,x){for(var b=a+y;a<b;++a)if(x(this.lines[a]))return!0}};function sa(a){this.children=a;for(var y=0,x=0,b=0;b<a.length;++b){var E=a[b];y+=E.chunkSize(),x+=E.height,E.parent=this}this.size=y,this.height=x,this.parent=null}sa.prototype={chunkSize:function(){return this.size},removeInner:function(a,y){this.size-=y;for(var x=0;x<this.children.length;++x){var b=this.children[x],E=b.chunkSize();if(a<E){var ee=Math.min(y,E-a),re=b.height;if(b.removeInner(a,ee),this.height-=re-b.height,E==ee&&(this.children.splice(x--,1),b.parent=null),(y-=ee)==0)break;a=0}else a-=E}if(this.size-y<25&&(this.children.length>1||!(this.children[0]instanceof la))){var le=[];this.collapse(le),this.children=[new la(le)],this.children[0].parent=this}},collapse:function(a){for(var y=0;y<this.children.length;++y)this.children[y].collapse(a)},insertInner:function(a,y,x){this.size+=y.length,this.height+=x;for(var b=0;b<this.children.length;++b){var E=this.children[b],ee=E.chunkSize();if(a<=ee){if(E.insertInner(a,y,x),E.lines&&E.lines.length>50){for(var re=E.lines.length%25+25,le=re;le<E.lines.length;){var se=new la(E.lines.slice(le,le+=25));E.height-=se.height,this.children.splice(++b,0,se),se.parent=this}E.lines=E.lines.slice(0,re),this.maybeSpill()}break}a-=ee}},maybeSpill:function(){if(!(this.children.length<=10)){var a=this;do{var y=a.children.splice(a.children.length-5,5),x=new sa(y);if(a.parent){a.size-=x.size,a.height-=x.height;var E=ut(a.parent.children,a);a.parent.children.splice(E+1,0,x)}else{var b=new sa(a.children);b.parent=a,a.children=[b,x],a=b}x.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()}},iterN:function(a,y,x){for(var b=0;b<this.children.length;++b){var E=this.children[b],ee=E.chunkSize();if(a<ee){var re=Math.min(y,ee-a);if(E.iterN(a,re,x))return!0;if((y-=re)==0)break;a=0}else a-=ee}}};var ua=function(a,y,x){if(x)for(var b in x)x.hasOwnProperty(b)&&(this[b]=x[b]);this.doc=a,this.node=y};ua.prototype.clear=function(){var a=this.doc.cm,y=this.line.widgets,x=this.line,b=Se(x);if(!(b==null||!y)){for(var E=0;E<y.length;++E)y[E]==this&&y.splice(E--,1);y.length||(x.widgets=null);var ee=gr(this);Rn(x,Math.max(0,x.height-ee)),a&&(Pr(a,function(){ss(a,x,-ee),ho(a,b,"widget")}),Oi(a,"lineWidgetCleared",a,this,b))}},ua.prototype.changed=function(){var a=this,y=this.height,x=this.doc.cm,b=this.line;this.height=null;var E=gr(this)-y;E&&(Xt(this.doc,b)||Rn(b,b.height+E),x&&Pr(x,function(){x.curOp.forceUpdate=!0,ss(x,b,E),Oi(x,"lineWidgetChanged",x,a,Se(b))}))},kt(ua);function ss(a,y,x){Kn(y)<(a.curOp&&a.curOp.scrollTop||a.doc.scrollTop)&&Qa(a,x)}function pu(a,y,x,b){var E=new ua(a,x,b),ee=a.cm;return ee&&E.noHScroll&&(ee.display.alignWidgets=!0),aa(a,y,"widget",function(re){var le=re.widgets||(re.widgets=[]);if(E.insertAt==null?le.push(E):le.splice(Math.min(le.length-1,Math.max(0,E.insertAt)),0,E),E.line=re,ee&&!Xt(a,re)){var se=Kn(re)<a.scrollTop;Rn(re,re.height+gr(E)),se&&Qa(ee,E.height),ee.curOp.forceUpdate=!0}return!0}),ee&&Oi(ee,"lineWidgetAdded",ee,E,typeof y=="number"?y:Se(y)),E}var us=0,go=function(a,y){this.lines=[],this.type=y,this.doc=a,this.id=++us};go.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,y=a&&!a.curOp;if(y&&Do(a),ke(this,"clear")){var x=this.find();x&&Oi(this,"clear",x.from,x.to)}for(var b=null,E=null,ee=0;ee<this.lines.length;++ee){var re=this.lines[ee],le=Ci(re.markedSpans,this);a&&!this.collapsed?ho(a,Se(re),"text"):a&&(le.to!=null&&(E=Se(re)),le.from!=null&&(b=Se(re))),re.markedSpans=Di(re.markedSpans,le),le.from==null&&this.collapsed&&!Xt(this.doc,re)&&a&&Rn(re,Ar(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(var se=0;se<this.lines.length;++se){var ce=on(this.lines[se]),ye=Ei(ce);ye>a.display.maxLineLength&&(a.display.maxLine=ce,a.display.maxLineLength=ye,a.display.maxLineChanged=!0)}b!=null&&a&&this.collapsed&&Sr(a,b,E+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&Ql(a.doc)),a&&Oi(a,"markerCleared",a,this,b,E),y&&Lo(a),this.parent&&this.parent.clear()}},go.prototype.find=function(a,y){a==null&&this.type=="bookmark"&&(a=1);for(var x,b,E=0;E<this.lines.length;++E){var ee=this.lines[E],re=Ci(ee.markedSpans,this);if(re.from!=null&&(x=Re(y?ee:Se(ee),re.from),a==-1))return x;if(re.to!=null&&(b=Re(y?ee:Se(ee),re.to),a==1))return b}return x&&{from:x,to:b}},go.prototype.changed=function(){var a=this,y=this.find(-1,!0),x=this,b=this.doc.cm;!y||!b||Pr(b,function(){var E=y.line,ee=Se(y.line),re=Qr(b,ee);if(re&&(Ko(re),b.curOp.selectionChanged=b.curOp.forceUpdate=!0),b.curOp.updateMaxLine=!0,!Xt(x.doc,E)&&x.height!=null){var le=x.height;x.height=null;var se=gr(x)-le;se&&Rn(E,E.height+se)}Oi(b,"markerChanged",b,a)})},go.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var y=this.doc.cm.curOp;(!y.maybeHiddenMarkers||ut(y.maybeHiddenMarkers,this)==-1)&&(y.maybeUnhiddenMarkers||(y.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)},go.prototype.detachLine=function(a){if(this.lines.splice(ut(this.lines,a),1),!this.lines.length&&this.doc.cm){var y=this.doc.cm.curOp;(y.maybeHiddenMarkers||(y.maybeHiddenMarkers=[])).push(this)}},kt(go);function Ho(a,y,x,b,E){if(b&&b.shared)return vu(a,y,x,b,E);if(a.cm&&!a.cm.curOp)return nr(a.cm,Ho)(a,y,x,b,E);var ee=new go(a,E),re=pt(y,x);if(b&&Ot(b,ee,!1),re>0||re==0&&ee.clearWhenEmpty!==!1)return ee;if(ee.replacedWith&&(ee.collapsed=!0,ee.widgetNode=mt("span",[ee.replacedWith],"CodeMirror-widget"),b.handleMouseEvents||ee.widgetNode.setAttribute("cm-ignore-events","true"),b.insertLeft&&(ee.widgetNode.insertLeft=!0)),ee.collapsed){if(gn(a,y.line,y,x,ee)||y.line!=x.line&&gn(a,x.line,y,x,ee))throw new Error("Inserting collapsed marker partially overlapping an existing one");li()}ee.addToHistory&&Vl(a,{from:y,to:x,origin:"markText"},a.sel,NaN);var le=y.line,se=a.cm,ce;if(a.iter(le,x.line+1,function(Ce){se&&ee.collapsed&&!se.options.lineWrapping&&on(Ce)==se.display.maxLine&&(ce=!0),ee.collapsed&&le!=y.line&&Rn(Ce,0),pi(Ce,new fi(ee,le==y.line?y.ch:null,le==x.line?x.ch:null)),++le}),ee.collapsed&&a.iter(y.line,x.line+1,function(Ce){Xt(a,Ce)&&Rn(Ce,0)}),ee.clearOnEnter&&_e(ee,"beforeCursorEnter",function(){return ee.clear()}),ee.readOnly&&(Pi(),(a.history.done.length||a.history.undone.length)&&a.clearHistory()),ee.collapsed&&(ee.id=++us,ee.atomic=!0),se){if(ce&&(se.curOp.updateMaxLine=!0),ee.collapsed)Sr(se,y.line,x.line+1);else if(ee.className||ee.startStyle||ee.endStyle||ee.css||ee.attributes||ee.title)for(var ye=y.line;ye<=x.line;ye++)ho(se,ye,"text");ee.atomic&&Ql(se.doc),Oi(se,"markerAdded",se,ee)}return ee}var ca=function(a,y){this.markers=a,this.primary=y;for(var x=0;x<a.length;++x)a[x].parent=this};ca.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var a=0;a<this.markers.length;++a)this.markers[a].clear();Oi(this,"clear")}},ca.prototype.find=function(a,y){return this.primary.find(a,y)},kt(ca);function vu(a,y,x,b,E){b=Ot(b),b.shared=!1;var ee=[Ho(a,y,x,b,E)],re=ee[0],le=b.widgetNode;return mo(a,function(se){le&&(b.widgetNode=le.cloneNode(!0)),ee.push(Ho(se,Ae(se,y),Ae(se,x),b,E));for(var ce=0;ce<se.linked.length;++ce)if(se.linked[ce].isParent)return;re=We(ee)}),new ca(ee,re)}function cs(a){return a.findMarks(Re(a.first,0),a.clipPos(Re(a.lastLine())),function(y){return y.parent})}function mu(a,y){for(var x=0;x<y.length;x++){var b=y[x],E=b.find(),ee=a.clipPos(E.from),re=a.clipPos(E.to);if(pt(ee,re)){var le=Ho(a,ee,re,b.primary,b.primary.type);b.markers.push(le),le.parent=b}}}function gu(a){for(var y=function(b){var E=a[b],ee=[E.primary.doc];mo(E.primary.doc,function(se){return ee.push(se)});for(var re=0;re<E.markers.length;re++){var le=E.markers[re];ut(ee,le.doc)==-1&&(le.parent=null,E.markers.splice(re--,1))}},x=0;x<a.length;x++)y(x)}var yu=0,kr=function(a,y,x,b,E){if(!(this instanceof kr))return new kr(a,y,x,b,E);x==null&&(x=0),sa.call(this,[new la([new si("",null)])]),this.first=x,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=x;var ee=Re(x,0);this.sel=po(ee),this.history=new Pa(null),this.id=++yu,this.modeOption=y,this.lineSep=b,this.direction=E=="rtl"?"rtl":"ltr",this.extend=!1,typeof a=="string"&&(a=this.splitLines(a)),al(this,{from:ee,to:ee,text:a}),pr(this,po(ee),Be)};kr.prototype=te(sa.prototype,{constructor:kr,iter:function(a,y,x){x?this.iterN(a-this.first,y-a,x):this.iterN(this.first,this.first+this.size,a)},insert:function(a,y){for(var x=0,b=0;b<y.length;++b)x+=y[b].height;this.insertInner(a-this.first,y,x)},remove:function(a,y){this.removeInner(a-this.first,y)},getValue:function(a){var y=hn(this,this.first,this.first+this.size);return a===!1?y:y.join(a||this.lineSeparator())},setValue:ir(function(a){var y=Re(this.first,0),x=this.first+this.size-1;Oo(this,{from:y,to:Re(x,Ze(this,x).text.length),text:this.splitLines(a),origin:"setValue",full:!0},!0),this.cm&&Qo(this.cm,0,0),pr(this,po(y),Be)}),replaceRange:function(a,y,x,b){y=Ae(this,y),x=x?Ae(this,x):y,Wo(this,a,y,x,b)},getRange:function(a,y,x){var b=Bt(this,Ae(this,a),Ae(this,y));return x===!1?b:b.join(x||this.lineSeparator())},getLine:function(a){var y=this.getLineHandle(a);return y&&y.text},getLineHandle:function(a){if(Et(this,a))return Ze(this,a)},getLineNumber:function(a){return Se(a)},getLineHandleVisualStart:function(a){return typeof a=="number"&&(a=Ze(this,a)),on(a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(a){return Ae(this,a)},getCursor:function(a){var y=this.sel.primary(),x;return a==null||a=="head"?x=y.head:a=="anchor"?x=y.anchor:a=="end"||a=="to"||a===!1?x=y.to():x=y.from(),x},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ir(function(a,y,x){Xl(this,Ae(this,typeof a=="number"?Re(a,y||0):a),null,x)}),setSelection:ir(function(a,y,x){Xl(this,Ae(this,a),Ae(this,y||a),x)}),extendSelection:ir(function(a,y,x){_a(this,Ae(this,a),y&&Ae(this,y),x)}),extendSelections:ir(function(a,y){Yl(this,qt(this,a),y)}),extendSelectionsBy:ir(function(a,y){var x=gt(this.sel.ranges,a);Yl(this,qt(this,x),y)}),setSelections:ir(function(a,y,x){if(a.length){for(var b=[],E=0;E<a.length;E++)b[E]=new ki(Ae(this,a[E].anchor),Ae(this,a[E].head));y==null&&(y=Math.min(a.length-1,this.sel.primIndex)),pr(this,Kr(this.cm,b,y),x)}}),addSelection:ir(function(a,y,x){var b=this.sel.ranges.slice(0);b.push(new ki(Ae(this,a),Ae(this,y||a))),pr(this,Kr(this.cm,b,b.length-1),x)}),getSelection:function(a){for(var y=this.sel.ranges,x,b=0;b<y.length;b++){var E=Bt(this,y[b].from(),y[b].to());x=x?x.concat(E):E}return a===!1?x:x.join(a||this.lineSeparator())},getSelections:function(a){for(var y=[],x=this.sel.ranges,b=0;b<x.length;b++){var E=Bt(this,x[b].from(),x[b].to());a!==!1&&(E=E.join(a||this.lineSeparator())),y[b]=E}return y},replaceSelection:function(a,y,x){for(var b=[],E=0;E<this.sel.ranges.length;E++)b[E]=a;this.replaceSelections(b,y,x||"+input")},replaceSelections:ir(function(a,y,x){for(var b=[],E=this.sel,ee=0;ee<E.ranges.length;ee++){var re=E.ranges[ee];b[ee]={from:re.from(),to:re.to(),text:this.splitLines(a[ee]),origin:x}}for(var le=y&&y!="end"&&ou(this,b,y),se=b.length-1;se>=0;se--)Oo(this,b[se]);le?ql(this,le):this.cm&&Fo(this.cm)}),undo:ir(function(){Ia(this,"undo")}),redo:ir(function(){Ia(this,"redo")}),undoSelection:ir(function(){Ia(this,"undo",!0)}),redoSelection:ir(function(){Ia(this,"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,y=0,x=0,b=0;b<a.done.length;b++)a.done[b].ranges||++y;for(var E=0;E<a.undone.length;E++)a.undone[E].ranges||++x;return{undo:y,redo:x}},clearHistory:function(){var a=this;this.history=new Pa(this.history.maxGeneration),mo(this,function(y){return y.history=a.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(a){return a&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(a){return this.history.generation==(a||this.cleanGeneration)},getHistory:function(){return{done:Io(this.history.done),undone:Io(this.history.undone)}},setHistory:function(a){var y=this.history=new Pa(this.history.maxGeneration);y.done=Io(a.done.slice(0),null,!0),y.undone=Io(a.undone.slice(0),null,!0)},setGutterMarker:ir(function(a,y,x){return aa(this,a,"gutter",function(b){var E=b.gutterMarkers||(b.gutterMarkers={});return E[y]=x,!x&&ne(E)&&(b.gutterMarkers=null),!0})}),clearGutter:ir(function(a){var y=this;this.iter(function(x){x.gutterMarkers&&x.gutterMarkers[a]&&aa(y,x,"gutter",function(){return x.gutterMarkers[a]=null,ne(x.gutterMarkers)&&(x.gutterMarkers=null),!0})})}),lineInfo:function(a){var y;if(typeof a=="number"){if(!Et(this,a)||(y=a,a=Ze(this,a),!a))return null}else if(y=Se(a),y==null)return null;return{line:y,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},addLineClass:ir(function(a,y,x){return aa(this,a,y=="gutter"?"gutter":"class",function(b){var E=y=="text"?"textClass":y=="background"?"bgClass":y=="gutter"?"gutterClass":"wrapClass";if(!b[E])b[E]=x;else{if(lt(x).test(b[E]))return!1;b[E]+=" "+x}return!0})}),removeLineClass:ir(function(a,y,x){return aa(this,a,y=="gutter"?"gutter":"class",function(b){var E=y=="text"?"textClass":y=="background"?"bgClass":y=="gutter"?"gutterClass":"wrapClass",ee=b[E];if(ee)if(x==null)b[E]=null;else{var re=ee.match(lt(x));if(!re)return!1;var le=re.index+re[0].length;b[E]=ee.slice(0,re.index)+(!re.index||le==ee.length?"":" ")+ee.slice(le)||null}else return!1;return!0})}),addLineWidget:ir(function(a,y,x){return pu(this,a,y,x)}),removeLineWidget:function(a){a.clear()},markText:function(a,y,x){return Ho(this,Ae(this,a),Ae(this,y),x,x&&x.type||"range")},setBookmark:function(a,y){var x={replacedWith:y&&(y.nodeType==null?y.widget:y),insertLeft:y&&y.insertLeft,clearWhenEmpty:!1,shared:y&&y.shared,handleMouseEvents:y&&y.handleMouseEvents};return a=Ae(this,a),Ho(this,a,a,x,"bookmark")},findMarksAt:function(a){a=Ae(this,a);var y=[],x=Ze(this,a.line).markedSpans;if(x)for(var b=0;b<x.length;++b){var E=x[b];(E.from==null||E.from<=a.ch)&&(E.to==null||E.to>=a.ch)&&y.push(E.marker.parent||E.marker)}return y},findMarks:function(a,y,x){a=Ae(this,a),y=Ae(this,y);var b=[],E=a.line;return this.iter(a.line,y.line+1,function(ee){var re=ee.markedSpans;if(re)for(var le=0;le<re.length;le++){var se=re[le];!(se.to!=null&&E==a.line&&a.ch>=se.to||se.from==null&&E!=a.line||se.from!=null&&E==y.line&&se.from>=y.ch)&&(!x||x(se.marker))&&b.push(se.marker.parent||se.marker)}++E}),b},getAllMarks:function(){var a=[];return this.iter(function(y){var x=y.markedSpans;if(x)for(var b=0;b<x.length;++b)x[b].from!=null&&a.push(x[b].marker)}),a},posFromIndex:function(a){var y,x=this.first,b=this.lineSeparator().length;return this.iter(function(E){var ee=E.text.length+b;if(ee>a)return y=a,!0;a-=ee,++x}),Ae(this,Re(x,y))},indexFromPos:function(a){a=Ae(this,a);var y=a.ch;if(a.line<this.first||a.ch<0)return 0;var x=this.lineSeparator().length;return this.iter(this.first,a.line,function(b){y+=b.text.length+x}),y},copy:function(a){var y=new kr(hn(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return y.scrollTop=this.scrollTop,y.scrollLeft=this.scrollLeft,y.sel=this.sel,y.extend=!1,a&&(y.history.undoDepth=this.history.undoDepth,y.setHistory(this.getHistory())),y},linkedDoc:function(a){a||(a={});var y=this.first,x=this.first+this.size;a.from!=null&&a.from>y&&(y=a.from),a.to!=null&&a.to<x&&(x=a.to);var b=new kr(hn(this,y,x),a.mode||this.modeOption,y,this.lineSep,this.direction);return a.sharedHist&&(b.history=this.history),(this.linked||(this.linked=[])).push({doc:b,sharedHist:a.sharedHist}),b.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}],mu(b,cs(this)),b},unlinkDoc:function(a){if(a instanceof Wi&&(a=a.doc),this.linked)for(var y=0;y<this.linked.length;++y){var x=this.linked[y];if(x.doc==a){this.linked.splice(y,1),a.unlinkDoc(this),gu(cs(this));break}}if(a.history==this.history){var b=[a.id];mo(a,function(E){return b.push(E.id)},!0),a.history=new Pa(null),a.history.done=Io(this.history.done,b),a.history.undone=Io(this.history.undone,b)}},iterLinkedDocs:function(a){mo(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(a){return this.lineSep?a.split(this.lineSep):ti(a)},lineSeparator:function(){return this.lineSep||`
`},setDirection:ir(function(a){a!="rtl"&&(a="ltr"),a!=this.direction&&(this.direction=a,this.iter(function(y){return y.order=null}),this.cm&&au(this.cm))})}),kr.prototype.eachLine=kr.prototype.iter;var ds=0;function bu(a){var y=this;if(hs(y),!(Ue(y,a)||sr(y.display,a))){Zt(a),pe&&(ds=+new Date);var x=Co(y,a,!0),b=a.dataTransfer.files;if(!(!x||y.isReadOnly()))if(b&&b.length&&window.FileReader&&window.File)for(var E=b.length,ee=Array(E),re=0,le=function(){++re==E&&nr(y,function(){x=Ae(y.doc,x);var He={from:x,to:x,text:y.doc.splitLines(ee.filter(function(vt){return vt!=null}).join(y.doc.lineSeparator())),origin:"paste"};Oo(y.doc,He),ql(y.doc,po(Ae(y.doc,x),Ae(y.doc,vo(He))))})()},se=function(He,vt){if(y.options.allowDropFileTypes&&ut(y.options.allowDropFileTypes,He.type)==-1){le();return}var Dt=new FileReader;Dt.onerror=function(){return le()},Dt.onload=function(){var zt=Dt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(zt)){le();return}ee[vt]=zt,le()},Dt.readAsText(He)},ce=0;ce<b.length;ce++)se(b[ce],ce);else{if(y.state.draggingText&&y.doc.sel.contains(x)>-1){y.state.draggingText(a),setTimeout(function(){return y.display.input.focus()},20);return}try{var ye=a.dataTransfer.getData("Text");if(ye){var Ce;if(y.state.draggingText&&!y.state.draggingText.copy&&(Ce=y.listSelections()),Fa(y.doc,po(x,x)),Ce)for(var je=0;je<Ce.length;++je)Wo(y.doc,"",Ce[je].anchor,Ce[je].head,"drag");y.replaceSelection(ye,"around","paste"),y.display.input.focus()}}catch(He){}}}}function xu(a,y){if(pe&&(!a.state.draggingText||+new Date-ds<100)){un(y);return}if(!(Ue(a,y)||sr(a.display,y))&&(y.dataTransfer.setData("Text",a.getSelection()),y.dataTransfer.effectAllowed="copyMove",y.dataTransfer.setDragImage&&!Ke)){var x=Ge("img",null,null,"position: fixed; left: 0; top: 0;");x.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",fe&&(x.width=x.height=1,a.display.wrapper.appendChild(x),x._top=x.offsetTop),y.dataTransfer.setDragImage(x,0,0),fe&&x.parentNode.removeChild(x)}}function wu(a,y){var x=Co(a,y);if(x){var b=document.createDocumentFragment();kl(a,x,b),a.display.dragCursor||(a.display.dragCursor=Ge("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),a.display.lineSpace.insertBefore(a.display.dragCursor,a.display.cursorDiv)),Ye(a.display.dragCursor,b)}}function hs(a){a.display.dragCursor&&(a.display.lineSpace.removeChild(a.display.dragCursor),a.display.dragCursor=null)}function fs(a){if(document.getElementsByClassName){for(var y=document.getElementsByClassName("CodeMirror"),x=[],b=0;b<y.length;b++){var E=y[b].CodeMirror;E&&x.push(E)}x.length&&x[0].operation(function(){for(var ee=0;ee<x.length;ee++)a(x[ee])})}}var ps=!1;function Cu(){ps||(Su(),ps=!0)}function Su(){var a;_e(window,"resize",function(){a==null&&(a=setTimeout(function(){a=null,fs(ku)},100))}),_e(window,"blur",function(){return fs(_o)})}function ku(a){var y=a.display;y.cachedCharWidth=y.cachedTextHeight=y.cachedPaddingH=null,y.scrollbarsClipped=!1,a.setSize()}for(var yo={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"},da=0;da<10;da++)yo[da+48]=yo[da+96]=String(da);for(var Na=65;Na<=90;Na++)yo[Na]=String.fromCharCode(Na);for(var ha=1;ha<=12;ha++)yo[ha+111]=yo[ha+63235]="F"+ha;var ro={};ro.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"},ro.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"},ro.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"},ro.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"]},ro.default=xe?ro.macDefault:ro.pcDefault;function Eu(a){var y=a.split(/-(?!$)/);a=y[y.length-1];for(var x,b,E,ee,re=0;re<y.length-1;re++){var le=y[re];if(/^(cmd|meta|m)$/i.test(le))ee=!0;else if(/^a(lt)?$/i.test(le))x=!0;else if(/^(c|ctrl|control)$/i.test(le))b=!0;else if(/^s(hift)?$/i.test(le))E=!0;else throw new Error("Unrecognized modifier name: "+le)}return x&&(a="Alt-"+a),b&&(a="Ctrl-"+a),ee&&(a="Cmd-"+a),E&&(a="Shift-"+a),a}function Du(a){var y={};for(var x in a)if(a.hasOwnProperty(x)){var b=a[x];if(/^(name|fallthrough|(de|at)tach)$/.test(x))continue;if(b=="..."){delete a[x];continue}for(var E=gt(x.split(" "),Eu),ee=0;ee<E.length;ee++){var re=void 0,le=void 0;ee==E.length-1?(le=E.join(" "),re=b):(le=E.slice(0,ee+1).join(" "),re="...");var se=y[le];if(!se)y[le]=re;else if(se!=re)throw new Error("Inconsistent bindings for "+le)}delete a[x]}for(var ce in y)a[ce]=y[ce];return a}function zo(a,y,x,b){y=Oa(y);var E=y.call?y.call(a,b):y[a];if(E===!1)return"nothing";if(E==="...")return"multi";if(E!=null&&x(E))return"handled";if(y.fallthrough){if(Object.prototype.toString.call(y.fallthrough)!="[object Array]")return zo(a,y.fallthrough,x,b);for(var ee=0;ee<y.fallthrough.length;ee++){var re=zo(a,y.fallthrough[ee],x,b);if(re)return re}}}function vs(a){var y=typeof a=="string"?a:yo[a.keyCode];return y=="Ctrl"||y=="Alt"||y=="Shift"||y=="Mod"}function ms(a,y,x){var b=a;return y.altKey&&b!="Alt"&&(a="Alt-"+a),(st?y.metaKey:y.ctrlKey)&&b!="Ctrl"&&(a="Ctrl-"+a),(st?y.ctrlKey:y.metaKey)&&b!="Mod"&&(a="Cmd-"+a),!x&&y.shiftKey&&b!="Shift"&&(a="Shift-"+a),a}function gs(a,y){if(fe&&a.keyCode==34&&a.char)return!1;var x=yo[a.keyCode];return x==null||a.altGraphKey?!1:(a.keyCode==3&&a.code&&(x=a.code),ms(x,a,y))}function Oa(a){return typeof a=="string"?ro[a]:a}function Zo(a,y){for(var x=a.doc.sel.ranges,b=[],E=0;E<x.length;E++){for(var ee=y(x[E]);b.length&&pt(ee.from,We(b).to)<=0;){var re=b.pop();if(pt(re.from,ee.from)<0){ee.from=re.from;break}}b.push(ee)}Pr(a,function(){for(var le=b.length-1;le>=0;le--)Wo(a.doc,"",b[le].from,b[le].to,"+delete");Fo(a)})}function cl(a,y,x){var b=Tt(a.text,y+x,x);return b<0||b>a.text.length?null:b}function dl(a,y,x){var b=cl(a,y.ch,x);return b==null?null:new Re(y.line,b,x<0?"after":"before")}function hl(a,y,x,b,E){if(a){y.doc.direction=="rtl"&&(E=-E);var ee=qe(x,y.doc.direction);if(ee){var re=E<0?We(ee):ee[0],le=E<0==(re.level==1),se=le?"after":"before",ce;if(re.level>0||y.doc.direction=="rtl"){var ye=uo(y,x);ce=E<0?x.text.length-1:0;var Ce=Wr(y,ye,ce).top;ce=bt(function(je){return Wr(y,ye,je).top==Ce},E<0==(re.level==1)?re.from:re.to-1,ce),se=="before"&&(ce=cl(x,ce,1))}else ce=E<0?re.to:re.from;return new Re(b,ce,se)}}return new Re(b,E<0?x.text.length:0,E<0?"before":"after")}function Lu(a,y,x,b){var E=qe(y,a.doc.direction);if(!E)return dl(y,x,b);x.ch>=y.text.length?(x.ch=y.text.length,x.sticky="before"):x.ch<=0&&(x.ch=0,x.sticky="after");var ee=Vt(E,x.ch,x.sticky),re=E[ee];if(a.doc.direction=="ltr"&&re.level%2==0&&(b>0?re.to>x.ch:re.from<x.ch))return dl(y,x,b);var le=function(an,fn){return cl(y,an instanceof Re?an.ch:an,fn)},se,ce=function(an){return a.options.lineWrapping?(se=se||uo(a,y),Ui(a,y,se,an)):{begin:0,end:y.text.length}},ye=ce(x.sticky=="before"?le(x,-1):x.ch);if(a.doc.direction=="rtl"||re.level==1){var Ce=re.level==1==b<0,je=le(x,Ce?1:-1);if(je!=null&&(Ce?je<=re.to&&je<=ye.end:je>=re.from&&je>=ye.begin)){var He=Ce?"before":"after";return new Re(x.line,je,He)}}var vt=function(an,fn,ln){for(var yn=function(Ri,rr){return rr?new Re(x.line,le(Ri,1),"before"):new Re(x.line,Ri,"after")};an>=0&&an<E.length;an+=fn){var In=E[an],Ln=fn>0==(In.level!=1),ii=Ln?ln.begin:le(ln.end,-1);if(In.from<=ii&&ii<In.to||(ii=Ln?In.from:le(In.to,-1),ln.begin<=ii&&ii<ln.end))return yn(ii,Ln)}},Dt=vt(ee+b,b,ye);if(Dt)return Dt;var zt=b>0?ye.end:le(ye.begin,-1);return zt!=null&&!(b>0&&zt==y.text.length)&&(Dt=vt(b>0?0:E.length-1,b,ce(zt)),Dt)?Dt:null}var fa={selectAll:ts,singleSelection:function(a){return a.setSelection(a.getCursor("anchor"),a.getCursor("head"),Be)},killLine:function(a){return Zo(a,function(y){if(y.empty()){var x=Ze(a.doc,y.head.line).text.length;return y.head.ch==x&&y.head.line<a.lastLine()?{from:y.head,to:Re(y.head.line+1,0)}:{from:y.head,to:Re(y.head.line,x)}}else return{from:y.from(),to:y.to()}})},deleteLine:function(a){return Zo(a,function(y){return{from:Re(y.from().line,0),to:Ae(a.doc,Re(y.to().line+1,0))}})},delLineLeft:function(a){return Zo(a,function(y){return{from:Re(y.from().line,0),to:y.from()}})},delWrappedLineLeft:function(a){return Zo(a,function(y){var x=a.charCoords(y.head,"div").top+5,b=a.coordsChar({left:0,top:x},"div");return{from:b,to:y.from()}})},delWrappedLineRight:function(a){return Zo(a,function(y){var x=a.charCoords(y.head,"div").top+5,b=a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:x},"div");return{from:y.from(),to:b}})},undo:function(a){return a.undo()},redo:function(a){return a.redo()},undoSelection:function(a){return a.undoSelection()},redoSelection:function(a){return a.redoSelection()},goDocStart:function(a){return a.extendSelection(Re(a.firstLine(),0))},goDocEnd:function(a){return a.extendSelection(Re(a.lastLine()))},goLineStart:function(a){return a.extendSelectionsBy(function(y){return ys(a,y.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(a){return a.extendSelectionsBy(function(y){return bs(a,y.head)},{origin:"+move",bias:1})},goLineEnd:function(a){return a.extendSelectionsBy(function(y){return Tu(a,y.head.line)},{origin:"+move",bias:-1})},goLineRight:function(a){return a.extendSelectionsBy(function(y){var x=a.cursorCoords(y.head,"div").top+5;return a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:x},"div")},at)},goLineLeft:function(a){return a.extendSelectionsBy(function(y){var x=a.cursorCoords(y.head,"div").top+5;return a.coordsChar({left:0,top:x},"div")},at)},goLineLeftSmart:function(a){return a.extendSelectionsBy(function(y){var x=a.cursorCoords(y.head,"div").top+5,b=a.coordsChar({left:0,top:x},"div");return b.ch<a.getLine(b.line).search(/\S/)?bs(a,y.head):b},at)},goLineUp:function(a){return a.moveV(-1,"line")},goLineDown:function(a){return a.moveV(1,"line")},goPageUp:function(a){return a.moveV(-1,"page")},goPageDown:function(a){return a.moveV(1,"page")},goCharLeft:function(a){return a.moveH(-1,"char")},goCharRight:function(a){return a.moveH(1,"char")},goColumnLeft:function(a){return a.moveH(-1,"column")},goColumnRight:function(a){return a.moveH(1,"column")},goWordLeft:function(a){return a.moveH(-1,"word")},goGroupRight:function(a){return a.moveH(1,"group")},goGroupLeft:function(a){return a.moveH(-1,"group")},goWordRight:function(a){return a.moveH(1,"word")},delCharBefore:function(a){return a.deleteH(-1,"codepoint")},delCharAfter:function(a){return a.deleteH(1,"char")},delWordBefore:function(a){return a.deleteH(-1,"word")},delWordAfter:function(a){return a.deleteH(1,"word")},delGroupBefore:function(a){return a.deleteH(-1,"group")},delGroupAfter:function(a){return a.deleteH(1,"group")},indentAuto:function(a){return a.indentSelection("smart")},indentMore:function(a){return a.indentSelection("add")},indentLess:function(a){return a.indentSelection("subtract")},insertTab:function(a){return a.replaceSelection(" ")},insertSoftTab:function(a){for(var y=[],x=a.listSelections(),b=a.options.tabSize,E=0;E<x.length;E++){var ee=x[E].from(),re=ve(a.getLine(ee.line),ee.ch,b);y.push(Pt(b-re%b))}a.replaceSelections(y)},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.execCommand("insertTab")},transposeChars:function(a){return Pr(a,function(){for(var y=a.listSelections(),x=[],b=0;b<y.length;b++)if(y[b].empty()){var E=y[b].head,ee=Ze(a.doc,E.line).text;if(ee){if(E.ch==ee.length&&(E=new Re(E.line,E.ch-1)),E.ch>0)E=new Re(E.line,E.ch+1),a.replaceRange(ee.charAt(E.ch-1)+ee.charAt(E.ch-2),Re(E.line,E.ch-2),E,"+transpose");else if(E.line>a.doc.first){var re=Ze(a.doc,E.line-1).text;re&&(E=new Re(E.line,1),a.replaceRange(ee.charAt(0)+a.doc.lineSeparator()+re.charAt(re.length-1),Re(E.line-1,re.length-1),E,"+transpose"))}}x.push(new ki(E,E))}a.setSelections(x)})},newlineAndIndent:function(a){return Pr(a,function(){for(var y=a.listSelections(),x=y.length-1;x>=0;x--)a.replaceRange(a.doc.lineSeparator(),y[x].anchor,y[x].head,"+input");y=a.listSelections();for(var b=0;b<y.length;b++)a.indentLine(y[b].from().line,null,!0);Fo(a)})},openLine:function(a){return a.replaceSelection(`
`,"start")},toggleOverwrite:function(a){return a.toggleOverwrite()}};function ys(a,y){var x=Ze(a.doc,y),b=on(x);return b!=x&&(y=Se(b)),hl(!0,a,b,y,1)}function Tu(a,y){var x=Ze(a.doc,y),b=An(x);return b!=x&&(y=Se(b)),hl(!0,a,x,y,-1)}function bs(a,y){var x=ys(a,y.line),b=Ze(a.doc,x.line),E=qe(b,a.doc.direction);if(!E||E[0].level==0){var ee=Math.max(x.ch,b.text.search(/\S/)),re=y.line==x.line&&y.ch<=ee&&y.ch;return Re(x.line,re?0:ee,x.sticky)}return x}function Wa(a,y,x){if(typeof y=="string"&&(y=fa[y],!y))return!1;a.display.input.ensurePolled();var b=a.display.shift,E=!1;try{a.isReadOnly()&&(a.state.suppressEdits=!0),x&&(a.display.shift=!1),E=y(a)!=Ct}finally{a.display.shift=b,a.state.suppressEdits=!1}return E}function Mu(a,y,x){for(var b=0;b<a.state.keyMaps.length;b++){var E=zo(y,a.state.keyMaps[b],x,a);if(E)return E}return a.options.extraKeys&&zo(y,a.options.extraKeys,x,a)||zo(y,a.options.keyMap,x,a)}var Au=new de;function pa(a,y,x,b){var E=a.state.keySeq;if(E){if(vs(y))return"handled";if(/\'$/.test(y)?a.state.keySeq=null:Au.set(50,function(){a.state.keySeq==E&&(a.state.keySeq=null,a.display.input.reset())}),xs(a,E+" "+y,x,b))return!0}return xs(a,y,x,b)}function xs(a,y,x,b){var E=Mu(a,y,b);return E=="multi"&&(a.state.keySeq=y),E=="handled"&&Oi(a,"keyHandled",a,y,x),(E=="handled"||E=="multi")&&(Zt(x),Xa(a)),!!E}function ws(a,y){var x=gs(y,!0);return x?y.shiftKey&&!a.state.keySeq?pa(a,"Shift-"+x,y,function(b){return Wa(a,b,!0)})||pa(a,x,y,function(b){if(typeof b=="string"?/^go[A-Z]/.test(b):b.motion)return Wa(a,b)}):pa(a,x,y,function(b){return Wa(a,b)}):!1}function Pu(a,y,x){return pa(a,"'"+x+"'",y,function(b){return Wa(a,b,!0)})}var fl=null;function Cs(a){var y=this;if(!(a.target&&a.target!=y.display.input.getField())&&(y.curOp.focus=Pe(),!Ue(y,a))){pe&&ge<11&&a.keyCode==27&&(a.returnValue=!1);var x=a.keyCode;y.display.shift=x==16||a.shiftKey;var b=ws(y,a);fe&&(fl=b?x:null,!b&&x==88&&!vn&&(xe?a.metaKey:a.ctrlKey)&&y.replaceSelection("",null,"cut")),ie&&!xe&&!b&&x==46&&a.shiftKey&&!a.ctrlKey&&document.execCommand&&document.execCommand("cut"),x==18&&!/\bCodeMirror-crosshair\b/.test(y.display.lineDiv.className)&&Bu(y)}}function Bu(a){var y=a.display.lineDiv;ot(y,"CodeMirror-crosshair");function x(b){(b.keyCode==18||!b.altKey)&&(it(y,"CodeMirror-crosshair"),Ft(document,"keyup",x),Ft(document,"mouseover",x))}_e(document,"keyup",x),_e(document,"mouseover",x)}function Ss(a){a.keyCode==16&&(this.doc.sel.shift=!1),Ue(this,a)}function ks(a){var y=this;if(!(a.target&&a.target!=y.display.input.getField())&&!(sr(y.display,a)||Ue(y,a)||a.ctrlKey&&!a.altKey||xe&&a.metaKey)){var x=a.keyCode,b=a.charCode;if(fe&&x==fl){fl=null,Zt(a);return}if(!(fe&&(!a.which||a.which<10)&&ws(y,a))){var E=String.fromCharCode(b==null?x:b);E!="\b"&&(Pu(y,a,E)||y.display.input.onKeyPress(a))}}}var _u=400,pl=function(a,y,x){this.time=a,this.pos=y,this.button=x};pl.prototype.compare=function(a,y,x){return this.time+_u>a&&pt(y,this.pos)==0&&x==this.button};var va,ma;function Fu(a,y){var x=+new Date;return ma&&ma.compare(x,a,y)?(va=ma=null,"triple"):va&&va.compare(x,a,y)?(ma=new pl(x,a,y),va=null,"double"):(va=new pl(x,a,y),ma=null,"single")}function Es(a){var y=this,x=y.display;if(!(Ue(y,a)||x.activeTouch&&x.input.supportsTouch())){if(x.input.ensurePolled(),x.shift=a.shiftKey,sr(x,a)){Fe||(x.scroller.draggable=!1,setTimeout(function(){return x.scroller.draggable=!0},100));return}if(!vl(y,a)){var b=Co(y,a),E=Gn(a),ee=b?Fu(b,E):"single";window.focus(),E==1&&y.state.selectingText&&y.state.selectingText(a),!(b&&Ru(y,E,b,ee,a))&&(E==1?b?Nu(y,b,ee,a):$n(a)==x.scroller&&Zt(a):E==2?(b&&_a(y.doc,b),setTimeout(function(){return x.input.focus()},20)):E==3&&($e?y.display.input.onContextMenu(a):Dl(y)))}}}function Ru(a,y,x,b,E){var ee="Click";return b=="double"?ee="Double"+ee:b=="triple"&&(ee="Triple"+ee),ee=(y==1?"Left":y==2?"Middle":"Right")+ee,pa(a,ms(ee,E),E,function(re){if(typeof re=="string"&&(re=fa[re]),!re)return!1;var le=!1;try{a.isReadOnly()&&(a.state.suppressEdits=!0),le=re(a,x)!=Ct}finally{a.state.suppressEdits=!1}return le})}function Iu(a,y,x){var b=a.getOption("configureMouse"),E=b?b(a,y,x):{};if(E.unit==null){var ee=Oe?x.shiftKey&&x.metaKey:x.altKey;E.unit=ee?"rectangle":y=="single"?"char":y=="double"?"word":"line"}return(E.extend==null||a.doc.extend)&&(E.extend=a.doc.extend||x.shiftKey),E.addNew==null&&(E.addNew=xe?x.metaKey:x.ctrlKey),E.moveOnDrag==null&&(E.moveOnDrag=!(xe?x.altKey:x.ctrlKey)),E}function Nu(a,y,x,b){pe?setTimeout(pn(El,a),0):a.curOp.focus=Pe();var E=Iu(a,x,b),ee=a.doc.sel,re;a.options.dragDrop&&bi&&!a.isReadOnly()&&x=="single"&&(re=ee.contains(y))>-1&&(pt((re=ee.ranges[re]).from(),y)<0||y.xRel>0)&&(pt(re.to(),y)>0||y.xRel<0)?Ou(a,b,y,E):Wu(a,b,y,E)}function Ou(a,y,x,b){var E=a.display,ee=!1,re=nr(a,function(ce){Fe&&(E.scroller.draggable=!1),a.state.draggingText=!1,Ft(E.wrapper.ownerDocument,"mouseup",re),Ft(E.wrapper.ownerDocument,"mousemove",le),Ft(E.scroller,"dragstart",se),Ft(E.scroller,"drop",re),ee||(Zt(ce),b.addNew||_a(a.doc,x,null,null,b.extend),Fe&&!Ke||pe&&ge==9?setTimeout(function(){E.wrapper.ownerDocument.body.focus({preventScroll:!0}),E.input.focus()},20):E.input.focus())}),le=function(ce){ee=ee||Math.abs(y.clientX-ce.clientX)+Math.abs(y.clientY-ce.clientY)>=10},se=function(){return ee=!0};Fe&&(E.scroller.draggable=!0),a.state.draggingText=re,re.copy=!b.moveOnDrag,E.scroller.dragDrop&&E.scroller.dragDrop(),_e(E.wrapper.ownerDocument,"mouseup",re),_e(E.wrapper.ownerDocument,"mousemove",le),_e(E.scroller,"dragstart",se),_e(E.scroller,"drop",re),Dl(a),setTimeout(function(){return E.input.focus()},20)}function Ds(a,y,x){if(x=="char")return new ki(y,y);if(x=="word")return a.findWordAt(y);if(x=="line")return new ki(Re(y.line,0),Ae(a.doc,Re(y.line+1,0)));var b=x(a,y);return new ki(b.from,b.to)}function Wu(a,y,x,b){var E=a.display,ee=a.doc;Zt(y);var re,le,se=ee.sel,ce=se.ranges;if(b.addNew&&!b.extend?(le=ee.sel.contains(x),le>-1?re=ce[le]:re=new ki(x,x)):(re=ee.sel.primary(),le=ee.sel.primIndex),b.unit=="rectangle")b.addNew||(re=new ki(x,x)),x=Co(a,y,!0,!0),le=-1;else{var ye=Ds(a,x,b.unit);b.extend?re=sl(re,ye.anchor,ye.head,b.extend):re=ye}b.addNew?le==-1?(le=ce.length,pr(ee,Kr(a,ce.concat([re]),le),{scroll:!1,origin:"*mouse"})):ce.length>1&&ce[le].empty()&&b.unit=="char"&&!b.extend?(pr(ee,Kr(a,ce.slice(0,le).concat(ce.slice(le+1)),0),{scroll:!1,origin:"*mouse"}),se=ee.sel):ul(ee,le,re,tt):(le=0,pr(ee,new Rr([re],0),tt),se=ee.sel);var Ce=x;function je(ln){if(pt(Ce,ln)!=0)if(Ce=ln,b.unit=="rectangle"){for(var yn=[],In=a.options.tabSize,Ln=ve(Ze(ee,x.line).text,x.ch,In),ii=ve(Ze(ee,ln.line).text,ln.ch,In),Ri=Math.min(Ln,ii),rr=Math.max(Ln,ii),Hi=Math.min(x.line,ln.line),Br=Math.min(a.lastLine(),Math.max(x.line,ln.line));Hi<=Br;Hi++){var Er=Ze(ee,Hi).text,Ji=en(Er,Ri,In);Ri==rr?yn.push(new ki(Re(Hi,Ji),Re(Hi,Ji))):Er.length>Ji&&yn.push(new ki(Re(Hi,Ji),Re(Hi,en(Er,rr,In))))}yn.length||yn.push(new ki(x,x)),pr(ee,Kr(a,se.ranges.slice(0,le).concat(yn),le),{origin:"*mouse",scroll:!1}),a.scrollIntoView(ln)}else{var Dr=re,cr=Ds(a,ln,b.unit),er=Dr.anchor,Qi;pt(cr.anchor,er)>0?(Qi=cr.head,er=It(Dr.from(),cr.anchor)):(Qi=cr.anchor,er=dn(Dr.to(),cr.head));var zi=se.ranges.slice(0);zi[le]=Hu(a,new ki(Ae(ee,er),Qi)),pr(ee,Kr(a,zi,le),tt)}}var He=E.wrapper.getBoundingClientRect(),vt=0;function Dt(ln){var yn=++vt,In=Co(a,ln,!0,b.unit=="rectangle");if(In)if(pt(In,Ce)!=0){a.curOp.focus=Pe(),je(In);var Ln=La(E,ee);(In.line>=Ln.to||In.line<Ln.from)&&setTimeout(nr(a,function(){vt==yn&&Dt(ln)}),150)}else{var ii=ln.clientY<He.top?-20:ln.clientY>He.bottom?20:0;ii&&setTimeout(nr(a,function(){vt==yn&&(E.scroller.scrollTop+=ii,Dt(ln))}),50)}}function zt(ln){a.state.selectingText=!1,vt=1/0,ln&&(Zt(ln),E.input.focus()),Ft(E.wrapper.ownerDocument,"mousemove",an),Ft(E.wrapper.ownerDocument,"mouseup",fn),ee.history.lastSelOrigin=null}var an=nr(a,function(ln){ln.buttons===0||!Gn(ln)?zt(ln):Dt(ln)}),fn=nr(a,zt);a.state.selectingText=fn,_e(E.wrapper.ownerDocument,"mousemove",an),_e(E.wrapper.ownerDocument,"mouseup",fn)}function Hu(a,y){var x=y.anchor,b=y.head,E=Ze(a.doc,x.line);if(pt(x,b)==0&&x.sticky==b.sticky)return y;var ee=qe(E);if(!ee)return y;var re=Vt(ee,x.ch,x.sticky),le=ee[re];if(le.from!=x.ch&&le.to!=x.ch)return y;var se=re+(le.from==x.ch==(le.level!=1)?0:1);if(se==0||se==ee.length)return y;var ce;if(b.line!=x.line)ce=(b.line-x.line)*(a.doc.direction=="ltr"?1:-1)>0;else{var ye=Vt(ee,b.ch,b.sticky),Ce=ye-re||(b.ch-x.ch)*(le.level==1?-1:1);ye==se-1||ye==se?ce=Ce<0:ce=Ce>0}var je=ee[se+(ce?-1:0)],He=ce==(je.level==1),vt=He?je.from:je.to,Dt=He?"after":"before";return x.ch==vt&&x.sticky==Dt?y:new ki(new Re(x.line,vt,Dt),b)}function Ls(a,y,x,b){var E,ee;if(y.touches)E=y.touches[0].clientX,ee=y.touches[0].clientY;else try{E=y.clientX,ee=y.clientY}catch(je){return!1}if(E>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;b&&Zt(y);var re=a.display,le=re.lineDiv.getBoundingClientRect();if(ee>le.bottom||!ke(a,x))return Rt(y);ee-=le.top-re.viewOffset;for(var se=0;se<a.display.gutterSpecs.length;++se){var ce=re.gutters.childNodes[se];if(ce&&ce.getBoundingClientRect().right>=E){var ye=Ee(a.doc,ee),Ce=a.display.gutterSpecs[se];return Qt(a,x,a,ye,Ce.className,y),Rt(y)}}}function vl(a,y){return Ls(a,y,"gutterClick",!0)}function Ts(a,y){sr(a.display,y)||zu(a,y)||Ue(a,y,"contextmenu")||$e||a.display.input.onContextMenu(y)}function zu(a,y){return ke(a,"gutterContextMenu")?Ls(a,y,"gutterContextMenu",!1):!1}function Ms(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-"),wo(a)}var Go={toString:function(){return"CodeMirror.Init"}},As={},Ha={};function Zu(a){var y=a.optionHandlers;function x(b,E,ee,re){a.defaults[b]=E,ee&&(y[b]=re?function(le,se,ce){ce!=Go&&ee(le,se,ce)}:ee)}a.defineOption=x,a.Init=Go,x("value","",function(b,E){return b.setValue(E)},!0),x("mode",null,function(b,E){b.doc.modeOption=E,ol(b)},!0),x("indentUnit",2,ol,!0),x("indentWithTabs",!1),x("smartIndent",!0),x("tabSize",4,function(b){ra(b),wo(b),Sr(b)},!0),x("lineSeparator",null,function(b,E){if(b.doc.lineSep=E,!!E){var ee=[],re=b.doc.first;b.doc.iter(function(se){for(var ce=0;;){var ye=se.text.indexOf(E,ce);if(ye==-1)break;ce=ye+E.length,ee.push(Re(re,ye))}re++});for(var le=ee.length-1;le>=0;le--)Wo(b.doc,E,ee[le],Re(ee[le].line,ee[le].ch+E.length))}}),x("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(b,E,ee){b.state.specialChars=new RegExp(E.source+(E.test(" ")?"":"| "),"g"),ee!=Go&&b.refresh()}),x("specialCharPlaceholder",zr,function(b){return b.refresh()},!0),x("electricChars",!0),x("inputStyle",Le?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),x("spellcheck",!1,function(b,E){return b.getInputField().spellcheck=E},!0),x("autocorrect",!1,function(b,E){return b.getInputField().autocorrect=E},!0),x("autocapitalize",!1,function(b,E){return b.getInputField().autocapitalize=E},!0),x("rtlMoveVisually",!Xe),x("wholeLineUpdateBefore",!0),x("theme","default",function(b){Ms(b),ia(b)},!0),x("keyMap","default",function(b,E,ee){var re=Oa(E),le=ee!=Go&&Oa(ee);le&&le.detach&&le.detach(b,re),re.attach&&re.attach(b,le||null)}),x("extraKeys",null),x("configureMouse",null),x("lineWrapping",!1,ju,!0),x("gutters",[],function(b,E){b.display.gutterSpecs=il(E,b.options.lineNumbers),ia(b)},!0),x("fixedGutter",!0,function(b,E){b.display.gutters.style.left=E?Ka(b.display)+"px":"0",b.refresh()},!0),x("coverGutterNextToScrollbar",!1,function(b){return Ro(b)},!0),x("scrollbarStyle","native",function(b){Bl(b),Ro(b),b.display.scrollbars.setScrollTop(b.doc.scrollTop),b.display.scrollbars.setScrollLeft(b.doc.scrollLeft)},!0),x("lineNumbers",!1,function(b,E){b.display.gutterSpecs=il(b.options.gutters,E),ia(b)},!0),x("firstLineNumber",1,ia,!0),x("lineNumberFormatter",function(b){return b},ia,!0),x("showCursorWhenSelecting",!1,Jo,!0),x("resetSelectionOnContextMenu",!0),x("lineWiseCopyCut",!0),x("pasteLinesPerSelection",!0),x("selectionsMayTouch",!1),x("readOnly",!1,function(b,E){E=="nocursor"&&(_o(b),b.display.input.blur()),b.display.input.readOnlyChanged(E)}),x("screenReaderLabel",null,function(b,E){E=E===""?null:E,b.display.input.screenReaderLabelChanged(E)}),x("disableInput",!1,function(b,E){E||b.display.input.reset()},!0),x("dragDrop",!0,Gu),x("allowDropFileTypes",null),x("cursorBlinkRate",530),x("cursorScrollMargin",0),x("cursorHeight",1,Jo,!0),x("singleCursorHeightPerLine",!0,Jo,!0),x("workTime",100),x("workDelay",100),x("flattenSpans",!0,ra,!0),x("addModeClass",!1,ra,!0),x("pollInterval",100),x("undoDepth",200,function(b,E){return b.doc.history.undoDepth=E}),x("historyEventDelay",1250),x("viewportMargin",10,function(b){return b.refresh()},!0),x("maxHighlightLength",1e4,ra,!0),x("moveInputWithCursor",!0,function(b,E){E||b.display.input.resetPosition()}),x("tabindex",null,function(b,E){return b.display.input.getField().tabIndex=E||""}),x("autofocus",null),x("direction","ltr",function(b,E){return b.doc.setDirection(E)},!0),x("phrases",null)}function Gu(a,y,x){var b=x&&x!=Go;if(!y!=!b){var E=a.display.dragFunctions,ee=y?_e:Ft;ee(a.display.scroller,"dragstart",E.start),ee(a.display.scroller,"dragenter",E.enter),ee(a.display.scroller,"dragover",E.over),ee(a.display.scroller,"dragleave",E.leave),ee(a.display.scroller,"drop",E.drop)}}function ju(a){a.options.lineWrapping?(ot(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth="",a.display.sizerWidth=null):(it(a.display.wrapper,"CodeMirror-wrap"),Xn(a)),Ya(a),Sr(a),wo(a),setTimeout(function(){return Ro(a)},100)}function Wi(a,y){var x=this;if(!(this instanceof Wi))return new Wi(a,y);this.options=y=y?Ot(y):{},Ot(As,y,!1);var b=y.value;typeof b=="string"?b=new kr(b,y.mode,null,y.lineSeparator,y.direction):y.mode&&(b.modeOption=y.mode),this.doc=b;var E=new Wi.inputStyles[y.inputStyle](this),ee=this.display=new iu(a,b,E,y);ee.wrapper.CodeMirror=this,Ms(this),y.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Bl(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 de,keySeq:null,specialChars:null},y.autofocus&&!Le&&ee.input.focus(),pe&&ge<11&&setTimeout(function(){return x.display.input.reset(!0)},20),Vu(this),Cu(),Do(this),this.curOp.forceUpdate=!0,Zl(this,b),y.autofocus&&!Le||this.hasFocus()?setTimeout(function(){x.hasFocus()&&!x.state.focused&&qa(x)},20):_o(this);for(var re in Ha)Ha.hasOwnProperty(re)&&Ha[re](this,y[re],Go);Rl(this),y.finishInit&&y.finishInit(this);for(var le=0;le<ml.length;++le)ml[le](this);Lo(this),Fe&&y.lineWrapping&&getComputedStyle(ee.lineDiv).textRendering=="optimizelegibility"&&(ee.lineDiv.style.textRendering="auto")}Wi.defaults=As,Wi.optionHandlers=Ha;function Vu(a){var y=a.display;_e(y.scroller,"mousedown",nr(a,Es)),pe&&ge<11?_e(y.scroller,"dblclick",nr(a,function(se){if(!Ue(a,se)){var ce=Co(a,se);if(!(!ce||vl(a,se)||sr(a.display,se))){Zt(se);var ye=a.findWordAt(ce);_a(a.doc,ye.anchor,ye.head)}}})):_e(y.scroller,"dblclick",function(se){return Ue(a,se)||Zt(se)}),_e(y.scroller,"contextmenu",function(se){return Ts(a,se)}),_e(y.input.getField(),"contextmenu",function(se){y.scroller.contains(se.target)||Ts(a,se)});var x,b={end:0};function E(){y.activeTouch&&(x=setTimeout(function(){return y.activeTouch=null},1e3),b=y.activeTouch,b.end=+new Date)}function ee(se){if(se.touches.length!=1)return!1;var ce=se.touches[0];return ce.radiusX<=1&&ce.radiusY<=1}function re(se,ce){if(ce.left==null)return!0;var ye=ce.left-se.left,Ce=ce.top-se.top;return ye*ye+Ce*Ce>20*20}_e(y.scroller,"touchstart",function(se){if(!Ue(a,se)&&!ee(se)&&!vl(a,se)){y.input.ensurePolled(),clearTimeout(x);var ce=+new Date;y.activeTouch={start:ce,moved:!1,prev:ce-b.end<=300?b:null},se.touches.length==1&&(y.activeTouch.left=se.touches[0].pageX,y.activeTouch.top=se.touches[0].pageY)}}),_e(y.scroller,"touchmove",function(){y.activeTouch&&(y.activeTouch.moved=!0)}),_e(y.scroller,"touchend",function(se){var ce=y.activeTouch;if(ce&&!sr(y,se)&&ce.left!=null&&!ce.moved&&new Date-ce.start<300){var ye=a.coordsChar(y.activeTouch,"page"),Ce;!ce.prev||re(ce,ce.prev)?Ce=new ki(ye,ye):!ce.prev.prev||re(ce,ce.prev.prev)?Ce=a.findWordAt(ye):Ce=new ki(Re(ye.line,0),Ae(a.doc,Re(ye.line+1,0))),a.setSelection(Ce.anchor,Ce.head),a.focus(),Zt(se)}E()}),_e(y.scroller,"touchcancel",E),_e(y.scroller,"scroll",function(){y.scroller.clientHeight&&($o(a,y.scroller.scrollTop),ko(a,y.scroller.scrollLeft,!0),Qt(a,"scroll",a))}),_e(y.scroller,"mousewheel",function(se){return Ol(a,se)}),_e(y.scroller,"DOMMouseScroll",function(se){return Ol(a,se)}),_e(y.wrapper,"scroll",function(){return y.wrapper.scrollTop=y.wrapper.scrollLeft=0}),y.dragFunctions={enter:function(se){Ue(a,se)||un(se)},over:function(se){Ue(a,se)||(wu(a,se),un(se))},start:function(se){return xu(a,se)},drop:nr(a,bu),leave:function(se){Ue(a,se)||hs(a)}};var le=y.input.getField();_e(le,"keyup",function(se){return Ss.call(a,se)}),_e(le,"keydown",nr(a,Cs)),_e(le,"keypress",nr(a,ks)),_e(le,"focus",function(se){return qa(a,se)}),_e(le,"blur",function(se){return _o(a,se)})}var ml=[];Wi.defineInitHook=function(a){return ml.push(a)};function ga(a,y,x,b){var E=a.doc,ee;x==null&&(x="add"),x=="smart"&&(E.mode.indent?ee=mi(a,y).state:x="prev");var re=a.options.tabSize,le=Ze(E,y),se=ve(le.text,null,re);le.stateAfter&&(le.stateAfter=null);var ce=le.text.match(/^\s*/)[0],ye;if(!b&&!/\S/.test(le.text))ye=0,x="not";else if(x=="smart"&&(ye=E.mode.indent(ee,le.text.slice(ce.length),le.text),ye==Ct||ye>150)){if(!b)return;x="prev"}x=="prev"?y>E.first?ye=ve(Ze(E,y-1).text,null,re):ye=0:x=="add"?ye=se+a.options.indentUnit:x=="subtract"?ye=se-a.options.indentUnit:typeof x=="number"&&(ye=se+x),ye=Math.max(0,ye);var Ce="",je=0;if(a.options.indentWithTabs)for(var He=Math.floor(ye/re);He;--He)je+=re,Ce+=" ";if(je<ye&&(Ce+=Pt(ye-je)),Ce!=ce)return Wo(E,Ce,Re(y,0),Re(y,ce.length),"+input"),le.stateAfter=null,!0;for(var vt=0;vt<E.sel.ranges.length;vt++){var Dt=E.sel.ranges[vt];if(Dt.head.line==y&&Dt.head.ch<ce.length){var zt=Re(y,ce.length);ul(E,vt,new ki(zt,zt));break}}}var Yr=null;function za(a){Yr=a}function gl(a,y,x,b,E){var ee=a.doc;a.display.shift=!1,b||(b=ee.sel);var re=+new Date-200,le=E=="paste"||a.state.pasteIncoming>re,se=ti(y),ce=null;if(le&&b.ranges.length>1)if(Yr&&Yr.text.join(`
`)==y){if(b.ranges.length%Yr.text.length==0){ce=[];for(var ye=0;ye<Yr.text.length;ye++)ce.push(ee.splitLines(Yr.text[ye]))}}else se.length==b.ranges.length&&a.options.pasteLinesPerSelection&&(ce=gt(se,function(an){return[an]}));for(var Ce=a.curOp.updateInput,je=b.ranges.length-1;je>=0;je--){var He=b.ranges[je],vt=He.from(),Dt=He.to();He.empty()&&(x&&x>0?vt=Re(vt.line,vt.ch-x):a.state.overwrite&&!le?Dt=Re(Dt.line,Math.min(Ze(ee,Dt.line).text.length,Dt.ch+We(se).length)):le&&Yr&&Yr.lineWise&&Yr.text.join(`
`)==se.join(`
`)&&(vt=Dt=Re(vt.line,0)));var zt={from:vt,to:Dt,text:ce?ce[je%ce.length]:se,origin:E||(le?"paste":a.state.cutIncoming>re?"cut":"+input")};Oo(a.doc,zt),Oi(a,"inputRead",a,zt)}y&&!le&&Bs(a,y),Fo(a),a.curOp.updateInput<2&&(a.curOp.updateInput=Ce),a.curOp.typing=!0,a.state.pasteIncoming=a.state.cutIncoming=-1}function Ps(a,y){var x=a.clipboardData&&a.clipboardData.getData("Text");if(x)return a.preventDefault(),!y.isReadOnly()&&!y.options.disableInput&&Pr(y,function(){return gl(y,x,0,null,"paste")}),!0}function Bs(a,y){if(!(!a.options.electricChars||!a.options.smartIndent))for(var x=a.doc.sel,b=x.ranges.length-1;b>=0;b--){var E=x.ranges[b];if(!(E.head.ch>100||b&&x.ranges[b-1].head.line==E.head.line)){var ee=a.getModeAt(E.head),re=!1;if(ee.electricChars){for(var le=0;le<ee.electricChars.length;le++)if(y.indexOf(ee.electricChars.charAt(le))>-1){re=ga(a,E.head.line,"smart");break}}else ee.electricInput&&ee.electricInput.test(Ze(a.doc,E.head.line).text.slice(0,E.head.ch))&&(re=ga(a,E.head.line,"smart"));re&&Oi(a,"electricInput",a,E.head.line)}}}function _s(a){for(var y=[],x=[],b=0;b<a.doc.sel.ranges.length;b++){var E=a.doc.sel.ranges[b].head.line,ee={anchor:Re(E,0),head:Re(E+1,0)};x.push(ee),y.push(a.getRange(ee.anchor,ee.head))}return{text:y,ranges:x}}function Fs(a,y,x,b){a.setAttribute("autocorrect",x?"":"off"),a.setAttribute("autocapitalize",b?"":"off"),a.setAttribute("spellcheck",!!y)}function Rs(){var a=Ge("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),y=Ge("div",[a],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return Fe?a.style.width="1000px":a.setAttribute("wrap","off"),Ne&&(a.style.border="1px solid black"),Fs(a),y}function Uu(a){var y=a.optionHandlers,x=a.helpers={};a.prototype={constructor:a,focus:function(){window.focus(),this.display.input.focus()},setOption:function(b,E){var ee=this.options,re=ee[b];ee[b]==E&&b!="mode"||(ee[b]=E,y.hasOwnProperty(b)&&nr(this,y[b])(this,E,re),Qt(this,"optionChange",this,b))},getOption:function(b){return this.options[b]},getDoc:function(){return this.doc},addKeyMap:function(b,E){this.state.keyMaps[E?"push":"unshift"](Oa(b))},removeKeyMap:function(b){for(var E=this.state.keyMaps,ee=0;ee<E.length;++ee)if(E[ee]==b||E[ee].name==b)return E.splice(ee,1),!0},addOverlay:yr(function(b,E){var ee=b.token?b:a.getMode(this.options,b);if(ee.startState)throw new Error("Overlays may not be stateful.");St(this.state.overlays,{mode:ee,modeSpec:b,opaque:E&&E.opaque,priority:E&&E.priority||0},function(re){return re.priority}),this.state.modeGen++,Sr(this)}),removeOverlay:yr(function(b){for(var E=this.state.overlays,ee=0;ee<E.length;++ee){var re=E[ee].modeSpec;if(re==b||typeof b=="string"&&re.name==b){E.splice(ee,1),this.state.modeGen++,Sr(this);return}}}),indentLine:yr(function(b,E,ee){typeof E!="string"&&typeof E!="number"&&(E==null?E=this.options.smartIndent?"smart":"prev":E=E?"add":"subtract"),Et(this.doc,b)&&ga(this,b,E,ee)}),indentSelection:yr(function(b){for(var E=this.doc.sel.ranges,ee=-1,re=0;re<E.length;re++){var le=E[re];if(le.empty())le.head.line>ee&&(ga(this,le.head.line,b,!0),ee=le.head.line,re==this.doc.sel.primIndex&&Fo(this));else{var se=le.from(),ce=le.to(),ye=Math.max(ee,se.line);ee=Math.min(this.lastLine(),ce.line-(ce.ch?0:1))+1;for(var Ce=ye;Ce<ee;++Ce)ga(this,Ce,b);var je=this.doc.sel.ranges;se.ch==0&&E.length==je.length&&je[re].from().ch>0&&ul(this.doc,re,new ki(se,je[re].to()),Be)}}}),getTokenAt:function(b,E){return gi(this,b,E)},getLineTokens:function(b,E){return gi(this,Re(b),E,!0)},getTokenTypeAt:function(b){b=Ae(this.doc,b);var E=Hn(this,Ze(this.doc,b.line)),ee=0,re=(E.length-1)/2,le=b.ch,se;if(le==0)se=E[2];else for(;;){var ce=ee+re>>1;if((ce?E[ce*2-1]:0)>=le)re=ce;else if(E[ce*2+1]<le)ee=ce+1;else{se=E[ce*2+2];break}}var ye=se?se.indexOf("overlay "):-1;return ye<0?se:ye==0?null:se.slice(0,ye-1)},getModeAt:function(b){var E=this.doc.mode;return E.innerMode?a.innerMode(E,this.getTokenAt(b).state).mode:E},getHelper:function(b,E){return this.getHelpers(b,E)[0]},getHelpers:function(b,E){var ee=[];if(!x.hasOwnProperty(E))return ee;var re=x[E],le=this.getModeAt(b);if(typeof le[E]=="string")re[le[E]]&&ee.push(re[le[E]]);else if(le[E])for(var se=0;se<le[E].length;se++){var ce=re[le[E][se]];ce&&ee.push(ce)}else le.helperType&&re[le.helperType]?ee.push(re[le.helperType]):re[le.name]&&ee.push(re[le.name]);for(var ye=0;ye<re._global.length;ye++){var Ce=re._global[ye];Ce.pred(le,this)&&ut(ee,Ce.val)==-1&&ee.push(Ce.val)}return ee},getStateAfter:function(b,E){var ee=this.doc;return b=Kt(ee,b==null?ee.first+ee.size-1:b),mi(this,b+1,E).state},cursorCoords:function(b,E){var ee,re=this.doc.sel.primary();return b==null?ee=re.head:typeof b=="object"?ee=Ae(this.doc,b):ee=b?re.from():re.to(),Cr(this,ee,E||"page")},charCoords:function(b,E){return Bo(this,Ae(this.doc,b),E||"page")},coordsChar:function(b,E){return b=Sa(this,b,E||"page"),ur(this,b.left,b.top)},lineAtHeight:function(b,E){return b=Sa(this,{top:b,left:0},E||"page").top,Ee(this.doc,b+this.display.viewOffset)},heightAtLine:function(b,E,ee){var re=!1,le;if(typeof b=="number"){var se=this.doc.first+this.doc.size-1;b<this.doc.first?b=this.doc.first:b>se&&(b=se,re=!0),le=Ze(this.doc,b)}else le=b;return Po(this,le,{top:0,left:0},E||"page",ee||re).top+(re?this.doc.height-Kn(le):0)},defaultTextHeight:function(){return Ar(this.display)},defaultCharWidth:function(){return Ur(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(b,E,ee,re,le){var se=this.display;b=Cr(this,Ae(this.doc,b));var ce=b.bottom,ye=b.left;if(E.style.position="absolute",E.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(E),se.sizer.appendChild(E),re=="over")ce=b.top;else if(re=="above"||re=="near"){var Ce=Math.max(se.wrapper.clientHeight,this.doc.height),je=Math.max(se.sizer.clientWidth,se.lineSpace.clientWidth);(re=="above"||b.bottom+E.offsetHeight>Ce)&&b.top>E.offsetHeight?ce=b.top-E.offsetHeight:b.bottom+E.offsetHeight<=Ce&&(ce=b.bottom),ye+E.offsetWidth>je&&(ye=je-E.offsetWidth)}E.style.top=ce+"px",E.style.left=E.style.right="",le=="right"?(ye=se.sizer.clientWidth-E.offsetWidth,E.style.right="0px"):(le=="left"?ye=0:le=="middle"&&(ye=(se.sizer.clientWidth-E.offsetWidth)/2),E.style.left=ye+"px"),ee&&Gs(this,{left:ye,top:ce,right:ye+E.offsetWidth,bottom:ce+E.offsetHeight})},triggerOnKeyDown:yr(Cs),triggerOnKeyPress:yr(ks),triggerOnKeyUp:Ss,triggerOnMouseDown:yr(Es),execCommand:function(b){if(fa.hasOwnProperty(b))return fa[b].call(null,this)},triggerElectric:yr(function(b){Bs(this,b)}),findPosH:function(b,E,ee,re){var le=1;E<0&&(le=-1,E=-E);for(var se=Ae(this.doc,b),ce=0;ce<E&&(se=yl(this.doc,se,le,ee,re),!se.hitSide);++ce);return se},moveH:yr(function(b,E){var ee=this;this.extendSelectionsBy(function(re){return ee.display.shift||ee.doc.extend||re.empty()?yl(ee.doc,re.head,b,E,ee.options.rtlMoveVisually):b<0?re.from():re.to()},at)}),deleteH:yr(function(b,E){var ee=this.doc.sel,re=this.doc;ee.somethingSelected()?re.replaceSelection("",null,"+delete"):Zo(this,function(le){var se=yl(re,le.head,b,E,!1);return b<0?{from:se,to:le.head}:{from:le.head,to:se}})}),findPosV:function(b,E,ee,re){var le=1,se=re;E<0&&(le=-1,E=-E);for(var ce=Ae(this.doc,b),ye=0;ye<E;++ye){var Ce=Cr(this,ce,"div");if(se==null?se=Ce.left:Ce.left=se,ce=Is(this,Ce,le,ee),ce.hitSide)break}return ce},moveV:yr(function(b,E){var ee=this,re=this.doc,le=[],se=!this.display.shift&&!re.extend&&re.sel.somethingSelected();if(re.extendSelectionsBy(function(ye){if(se)return b<0?ye.from():ye.to();var Ce=Cr(ee,ye.head,"div");ye.goalColumn!=null&&(Ce.left=ye.goalColumn),le.push(Ce.left);var je=Is(ee,Ce,b,E);return E=="page"&&ye==re.sel.primary()&&Qa(ee,Bo(ee,je,"div").top-Ce.top),je},at),le.length)for(var ce=0;ce<re.sel.ranges.length;ce++)re.sel.ranges[ce].goalColumn=le[ce]}),findWordAt:function(b){var E=this.doc,ee=Ze(E,b.line).text,re=b.ch,le=b.ch;if(ee){var se=this.getHelper(b,"wordChars");(b.sticky=="before"||le==ee.length)&&re?--re:++le;for(var ce=ee.charAt(re),ye=ue(ce,se)?function(Ce){return ue(Ce,se)}:/\s/.test(ce)?function(Ce){return/\s/.test(Ce)}:function(Ce){return!/\s/.test(Ce)&&!ue(Ce)};re>0&&ye(ee.charAt(re-1));)--re;for(;le<ee.length&&ye(ee.charAt(le));)++le}return new ki(Re(b.line,re),Re(b.line,le))},toggleOverwrite:function(b){b!=null&&b==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?ot(this.display.cursorDiv,"CodeMirror-overwrite"):it(this.display.cursorDiv,"CodeMirror-overwrite"),Qt(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Pe()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:yr(function(b,E){Qo(this,b,E)}),getScrollInfo:function(){var b=this.display.scroller;return{left:b.scrollLeft,top:b.scrollTop,height:b.scrollHeight-Tr(this)-this.display.barHeight,width:b.scrollWidth-Tr(this)-this.display.barWidth,clientHeight:no(this),clientWidth:Jr(this)}},scrollIntoView:yr(function(b,E){b==null?(b={from:this.doc.sel.primary().head,to:null},E==null&&(E=this.options.cursorScrollMargin)):typeof b=="number"?b={from:Re(b,0),to:null}:b.from==null&&(b={from:b,to:null}),b.to||(b.to=b.from),b.margin=E||0,b.from.line!=null?js(this,b):Tl(this,b.from,b.to,b.margin)}),setSize:yr(function(b,E){var ee=this,re=function(se){return typeof se=="number"||/^\d+$/.test(String(se))?se+"px":se};b!=null&&(this.display.wrapper.style.width=re(b)),E!=null&&(this.display.wrapper.style.height=re(E)),this.options.lineWrapping&&Yo(this);var le=this.display.viewFrom;this.doc.iter(le,this.display.viewTo,function(se){if(se.widgets){for(var ce=0;ce<se.widgets.length;ce++)if(se.widgets[ce].noHScroll){ho(ee,le,"widget");break}}++le}),this.curOp.forceUpdate=!0,Qt(this,"refresh",this)}),operation:function(b){return Pr(this,b)},startOperation:function(){return Do(this)},endOperation:function(){return Lo(this)},refresh:yr(function(){var b=this.display.cachedTextHeight;Sr(this),this.curOp.forceUpdate=!0,wo(this),Qo(this,this.doc.scrollLeft,this.doc.scrollTop),tl(this.display),(b==null||Math.abs(b-Ar(this.display))>.5||this.options.lineWrapping)&&Ya(this),Qt(this,"refresh",this)}),swapDoc:yr(function(b){var E=this.doc;return E.cm=null,this.state.selectingText&&this.state.selectingText(),Zl(this,b),wo(this),this.display.input.reset(),Qo(this,b.scrollLeft,b.scrollTop),this.curOp.forceScroll=!0,Oi(this,"swapDoc",this,E),E}),phrase:function(b){var E=this.options.phrases;return E&&Object.prototype.hasOwnProperty.call(E,b)?E[b]:b},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}},kt(a),a.registerHelper=function(b,E,ee){x.hasOwnProperty(b)||(x[b]=a[b]={_global:[]}),x[b][E]=ee},a.registerGlobalHelper=function(b,E,ee,re){a.registerHelper(b,E,re),x[b]._global.push({pred:ee,val:re})}}function yl(a,y,x,b,E){var ee=y,re=x,le=Ze(a,y.line),se=E&&a.direction=="rtl"?-x:x;function ce(){var fn=y.line+se;return fn<a.first||fn>=a.first+a.size?!1:(y=new Re(fn,y.ch,y.sticky),le=Ze(a,fn))}function ye(fn){var ln;if(b=="codepoint"){var yn=le.text.charCodeAt(y.ch+(b>0?0:-1));isNaN(yn)?ln=null:ln=new Re(y.line,Math.max(0,Math.min(le.text.length,y.ch+x*(yn>=55296&&yn<56320?2:1))),-x)}else E?ln=Lu(a.cm,le,y,x):ln=dl(le,y,x);if(ln==null)if(!fn&&ce())y=hl(E,a.cm,le,y.line,se);else return!1;else y=ln;return!0}if(b=="char"||b=="codepoint")ye();else if(b=="column")ye(!0);else if(b=="word"||b=="group")for(var Ce=null,je=b=="group",He=a.cm&&a.cm.getHelper(y,"wordChars"),vt=!0;!(x<0&&!ye(!vt));vt=!1){var Dt=le.text.charAt(y.ch)||`
`,zt=ue(Dt,He)?"w":je&&Dt==`
`?"n":!je||/\s/.test(Dt)?null:"p";if(je&&!vt&&!zt&&(zt="s"),Ce&&Ce!=zt){x<0&&(x=1,ye(),y.sticky="after");break}if(zt&&(Ce=zt),x>0&&!ye(!vt))break}var an=Ra(a,y,ee,re,!0);return Ut(ee,an)&&(an.hitSide=!0),an}function Is(a,y,x,b){var E=a.doc,ee=y.left,re;if(b=="page"){var le=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),se=Math.max(le-.5*Ar(a.display),3);re=(x>0?y.bottom:y.top)+x*se}else b=="line"&&(re=x>0?y.bottom+3:y.top-3);for(var ce;ce=ur(a,ee,re),!!ce.outside;){if(x<0?re<=0:re>=E.height){ce.hitSide=!0;break}re+=x*5}return ce}var Ti=function(a){this.cm=a,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new de,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ti.prototype.init=function(a){var y=this,x=this,b=x.cm,E=x.div=a.lineDiv;Fs(E,b.options.spellcheck,b.options.autocorrect,b.options.autocapitalize);function ee(le){for(var se=le.target;se;se=se.parentNode){if(se==E)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(se.className))break}return!1}_e(E,"paste",function(le){!ee(le)||Ue(b,le)||Ps(le,b)||ge<=11&&setTimeout(nr(b,function(){return y.updateFromDOM()}),20)}),_e(E,"compositionstart",function(le){y.composing={data:le.data,done:!1}}),_e(E,"compositionupdate",function(le){y.composing||(y.composing={data:le.data,done:!1})}),_e(E,"compositionend",function(le){y.composing&&(le.data!=y.composing.data&&y.readFromDOMSoon(),y.composing.done=!0)}),_e(E,"touchstart",function(){return x.forceCompositionEnd()}),_e(E,"input",function(){y.composing||y.readFromDOMSoon()});function re(le){if(!(!ee(le)||Ue(b,le))){if(b.somethingSelected())za({lineWise:!1,text:b.getSelections()}),le.type=="cut"&&b.replaceSelection("",null,"cut");else if(b.options.lineWiseCopyCut){var se=_s(b);za({lineWise:!0,text:se.text}),le.type=="cut"&&b.operation(function(){b.setSelections(se.ranges,0,Be),b.replaceSelection("",null,"cut")})}else return;if(le.clipboardData){le.clipboardData.clearData();var ce=Yr.text.join(`
`);if(le.clipboardData.setData("Text",ce),le.clipboardData.getData("Text")==ce){le.preventDefault();return}}var ye=Rs(),Ce=ye.firstChild;b.display.lineSpace.insertBefore(ye,b.display.lineSpace.firstChild),Ce.value=Yr.text.join(`
`);var je=document.activeElement;wt(Ce),setTimeout(function(){b.display.lineSpace.removeChild(ye),je.focus(),je==E&&x.showPrimarySelection()},50)}}_e(E,"copy",re),_e(E,"cut",re)},Ti.prototype.screenReaderLabelChanged=function(a){a?this.div.setAttribute("aria-label",a):this.div.removeAttribute("aria-label")},Ti.prototype.prepareSelection=function(){var a=Sl(this.cm,!1);return a.focus=document.activeElement==this.div,a},Ti.prototype.showSelection=function(a,y){!a||!this.cm.display.view.length||((a.focus||y)&&this.showPrimarySelection(),this.showMultipleSelections(a))},Ti.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ti.prototype.showPrimarySelection=function(){var a=this.getSelection(),y=this.cm,x=y.doc.sel.primary(),b=x.from(),E=x.to();if(y.display.viewTo==y.display.viewFrom||b.line>=y.display.viewTo||E.line<y.display.viewFrom){a.removeAllRanges();return}var ee=Za(y,a.anchorNode,a.anchorOffset),re=Za(y,a.focusNode,a.focusOffset);if(!(ee&&!ee.bad&&re&&!re.bad&&pt(It(ee,re),b)==0&&pt(dn(ee,re),E)==0)){var le=y.display.view,se=b.line>=y.display.viewFrom&&Ns(y,b)||{node:le[0].measure.map[2],offset:0},ce=E.line<y.display.viewTo&&Ns(y,E);if(!ce){var ye=le[le.length-1].measure,Ce=ye.maps?ye.maps[ye.maps.length-1]:ye.map;ce={node:Ce[Ce.length-1],offset:Ce[Ce.length-2]-Ce[Ce.length-3]}}if(!se||!ce){a.removeAllRanges();return}var je=a.rangeCount&&a.getRangeAt(0),He;try{He=Te(se.node,se.offset,ce.offset,ce.node)}catch(vt){}He&&(!ie&&y.state.focused?(a.collapse(se.node,se.offset),He.collapsed||(a.removeAllRanges(),a.addRange(He))):(a.removeAllRanges(),a.addRange(He)),je&&a.anchorNode==null?a.addRange(je):ie&&this.startGracePeriod()),this.rememberSelection()}},Ti.prototype.startGracePeriod=function(){var a=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){a.gracePeriod=!1,a.selectionChanged()&&a.cm.operation(function(){return a.cm.curOp.selectionChanged=!0})},20)},Ti.prototype.showMultipleSelections=function(a){Ye(this.cm.display.cursorDiv,a.cursors),Ye(this.cm.display.selectionDiv,a.selection)},Ti.prototype.rememberSelection=function(){var a=this.getSelection();this.lastAnchorNode=a.anchorNode,this.lastAnchorOffset=a.anchorOffset,this.lastFocusNode=a.focusNode,this.lastFocusOffset=a.focusOffset},Ti.prototype.selectionInEditor=function(){var a=this.getSelection();if(!a.rangeCount)return!1;var y=a.getRangeAt(0).commonAncestorContainer;return Qe(this.div,y)},Ti.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ti.prototype.blur=function(){this.div.blur()},Ti.prototype.getField=function(){return this.div},Ti.prototype.supportsTouch=function(){return!0},Ti.prototype.receivedFocus=function(){var a=this;this.selectionInEditor()?this.pollSelection():Pr(this.cm,function(){return a.cm.curOp.selectionChanged=!0});function y(){a.cm.state.focused&&(a.pollSelection(),a.polling.set(a.cm.options.pollInterval,y))}this.polling.set(this.cm.options.pollInterval,y)},Ti.prototype.selectionChanged=function(){var a=this.getSelection();return a.anchorNode!=this.lastAnchorNode||a.anchorOffset!=this.lastAnchorOffset||a.focusNode!=this.lastFocusNode||a.focusOffset!=this.lastFocusOffset},Ti.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var a=this.getSelection(),y=this.cm;if(De&&we&&this.cm.display.gutterSpecs.length&&Ku(a.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var x=Za(y,a.anchorNode,a.anchorOffset),b=Za(y,a.focusNode,a.focusOffset);x&&b&&Pr(y,function(){pr(y.doc,po(x,b),Be),(x.bad||b.bad)&&(y.curOp.selectionChanged=!0)})}}},Ti.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var a=this.cm,y=a.display,x=a.doc.sel.primary(),b=x.from(),E=x.to();if(b.ch==0&&b.line>a.firstLine()&&(b=Re(b.line-1,Ze(a.doc,b.line-1).length)),E.ch==Ze(a.doc,E.line).text.length&&E.line<a.lastLine()&&(E=Re(E.line+1,0)),b.line<y.viewFrom||E.line>y.viewTo-1)return!1;var ee,re,le;b.line==y.viewFrom||(ee=So(a,b.line))==0?(re=Se(y.view[0].line),le=y.view[0].node):(re=Se(y.view[ee].line),le=y.view[ee-1].node.nextSibling);var se=So(a,E.line),ce,ye;if(se==y.view.length-1?(ce=y.viewTo-1,ye=y.lineDiv.lastChild):(ce=Se(y.view[se+1].line)-1,ye=y.view[se+1].node.previousSibling),!le)return!1;for(var Ce=a.doc.splitLines(Yu(a,le,ye,re,ce)),je=Bt(a.doc,Re(re,0),Re(ce,Ze(a.doc,ce).text.length));Ce.length>1&&je.length>1;)if(We(Ce)==We(je))Ce.pop(),je.pop(),ce--;else if(Ce[0]==je[0])Ce.shift(),je.shift(),re++;else break;for(var He=0,vt=0,Dt=Ce[0],zt=je[0],an=Math.min(Dt.length,zt.length);He<an&&Dt.charCodeAt(He)==zt.charCodeAt(He);)++He;for(var fn=We(Ce),ln=We(je),yn=Math.min(fn.length-(Ce.length==1?He:0),ln.length-(je.length==1?He:0));vt<yn&&fn.charCodeAt(fn.length-vt-1)==ln.charCodeAt(ln.length-vt-1);)++vt;if(Ce.length==1&&je.length==1&&re==b.line)for(;He&&He>b.ch&&fn.charCodeAt(fn.length-vt-1)==ln.charCodeAt(ln.length-vt-1);)He--,vt++;Ce[Ce.length-1]=fn.slice(0,fn.length-vt).replace(/^\u200b+/,""),Ce[0]=Ce[0].slice(He).replace(/\u200b+$/,"");var In=Re(re,He),Ln=Re(ce,je.length?We(je).length-vt:0);if(Ce.length>1||Ce[0]||pt(In,Ln))return Wo(a.doc,Ce,In,Ln,"+input"),!0},Ti.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ti.prototype.reset=function(){this.forceCompositionEnd()},Ti.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ti.prototype.readFromDOMSoon=function(){var a=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(a.readDOMTimeout=null,a.composing)if(a.composing.done)a.composing=null;else return;a.updateFromDOM()},80))},Ti.prototype.updateFromDOM=function(){var a=this;(this.cm.isReadOnly()||!this.pollContent())&&Pr(this.cm,function(){return Sr(a.cm)})},Ti.prototype.setUneditable=function(a){a.contentEditable="false"},Ti.prototype.onKeyPress=function(a){a.charCode==0||this.composing||(a.preventDefault(),this.cm.isReadOnly()||nr(this.cm,gl)(this.cm,String.fromCharCode(a.charCode==null?a.keyCode:a.charCode),0))},Ti.prototype.readOnlyChanged=function(a){this.div.contentEditable=String(a!="nocursor")},Ti.prototype.onContextMenu=function(){},Ti.prototype.resetPosition=function(){},Ti.prototype.needsContentAttribute=!0;function Ns(a,y){var x=Qr(a,y.line);if(!x||x.hidden)return null;var b=Ze(a.doc,y.line),E=Ao(x,b,y.line),ee=qe(b,a.doc.direction),re="left";if(ee){var le=Vt(ee,y.ch);re=le%2?"right":"left"}var se=xa(E.map,y.ch,re);return se.offset=se.collapse=="right"?se.end:se.start,se}function Ku(a){for(var y=a;y;y=y.parentNode)if(/CodeMirror-gutter-wrapper/.test(y.className))return!0;return!1}function jo(a,y){return y&&(a.bad=!0),a}function Yu(a,y,x,b,E){var ee="",re=!1,le=a.doc.lineSeparator(),se=!1;function ce(He){return function(vt){return vt.id==He}}function ye(){re&&(ee+=le,se&&(ee+=le),re=se=!1)}function Ce(He){He&&(ye(),ee+=He)}function je(He){if(He.nodeType==1){var vt=He.getAttribute("cm-text");if(vt){Ce(vt);return}var Dt=He.getAttribute("cm-marker"),zt;if(Dt){var an=a.findMarks(Re(b,0),Re(E+1,0),ce(+Dt));an.length&&(zt=an[0].find(0))&&Ce(Bt(a.doc,zt.from,zt.to).join(le));return}if(He.getAttribute("contenteditable")=="false")return;var fn=/^(pre|div|p|li|table|br)$/i.test(He.nodeName);if(!/^br$/i.test(He.nodeName)&&He.textContent.length==0)return;fn&&ye();for(var ln=0;ln<He.childNodes.length;ln++)je(He.childNodes[ln]);/^(pre|p)$/i.test(He.nodeName)&&(se=!0),fn&&(re=!0)}else He.nodeType==3&&Ce(He.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;je(y),y!=x;)y=y.nextSibling,se=!1;return ee}function Za(a,y,x){var b;if(y==a.display.lineDiv){if(b=a.display.lineDiv.childNodes[x],!b)return jo(a.clipPos(Re(a.display.viewTo-1)),!0);y=null,x=0}else for(b=y;;b=b.parentNode){if(!b||b==a.display.lineDiv)return null;if(b.parentNode&&b.parentNode==a.display.lineDiv)break}for(var E=0;E<a.display.view.length;E++){var ee=a.display.view[E];if(ee.node==b)return Xu(ee,y,x)}}function Xu(a,y,x){var b=a.text.firstChild,E=!1;if(!y||!Qe(b,y))return jo(Re(Se(a.line),0),!0);if(y==b&&(E=!0,y=b.childNodes[x],x=0,!y)){var ee=a.rest?We(a.rest):a.line;return jo(Re(Se(ee),ee.text.length),E)}var re=y.nodeType==3?y:null,le=y;for(!re&&y.childNodes.length==1&&y.firstChild.nodeType==3&&(re=y.firstChild,x&&(x=re.nodeValue.length));le.parentNode!=b;)le=le.parentNode;var se=a.measure,ce=se.maps;function ye(zt,an,fn){for(var ln=-1;ln<(ce?ce.length:0);ln++)for(var yn=ln<0?se.map:ce[ln],In=0;In<yn.length;In+=3){var Ln=yn[In+2];if(Ln==zt||Ln==an){var ii=Se(ln<0?a.line:a.rest[ln]),Ri=yn[In]+fn;return(fn<0||Ln!=zt)&&(Ri=yn[In+(fn?1:0)]),Re(ii,Ri)}}}var Ce=ye(re,le,x);if(Ce)return jo(Ce,E);for(var je=le.nextSibling,He=re?re.nodeValue.length-x:0;je;je=je.nextSibling){if(Ce=ye(je,je.firstChild,0),Ce)return jo(Re(Ce.line,Ce.ch-He),E);He+=je.textContent.length}for(var vt=le.previousSibling,Dt=x;vt;vt=vt.previousSibling){if(Ce=ye(vt,vt.firstChild,-1),Ce)return jo(Re(Ce.line,Ce.ch+Dt),E);Dt+=vt.textContent.length}}var Ki=function(a){this.cm=a,this.prevInput="",this.pollingFast=!1,this.polling=new de,this.hasSelection=!1,this.composing=null};Ki.prototype.init=function(a){var y=this,x=this,b=this.cm;this.createField(a);var E=this.textarea;a.wrapper.insertBefore(this.wrapper,a.wrapper.firstChild),Ne&&(E.style.width="0px"),_e(E,"input",function(){pe&&ge>=9&&y.hasSelection&&(y.hasSelection=null),x.poll()}),_e(E,"paste",function(re){Ue(b,re)||Ps(re,b)||(b.state.pasteIncoming=+new Date,x.fastPoll())});function ee(re){if(!Ue(b,re)){if(b.somethingSelected())za({lineWise:!1,text:b.getSelections()});else if(b.options.lineWiseCopyCut){var le=_s(b);za({lineWise:!0,text:le.text}),re.type=="cut"?b.setSelections(le.ranges,null,Be):(x.prevInput="",E.value=le.text.join(`
`),wt(E))}else return;re.type=="cut"&&(b.state.cutIncoming=+new Date)}}_e(E,"cut",ee),_e(E,"copy",ee),_e(a.scroller,"paste",function(re){if(!(sr(a,re)||Ue(b,re))){if(!E.dispatchEvent){b.state.pasteIncoming=+new Date,x.focus();return}var le=new Event("paste");le.clipboardData=re.clipboardData,E.dispatchEvent(le)}}),_e(a.lineSpace,"selectstart",function(re){sr(a,re)||Zt(re)}),_e(E,"compositionstart",function(){var re=b.getCursor("from");x.composing&&x.composing.range.clear(),x.composing={start:re,range:b.markText(re,b.getCursor("to"),{className:"CodeMirror-composing"})}}),_e(E,"compositionend",function(){x.composing&&(x.poll(),x.composing.range.clear(),x.composing=null)})},Ki.prototype.createField=function(a){this.wrapper=Rs(),this.textarea=this.wrapper.firstChild},Ki.prototype.screenReaderLabelChanged=function(a){a?this.textarea.setAttribute("aria-label",a):this.textarea.removeAttribute("aria-label")},Ki.prototype.prepareSelection=function(){var a=this.cm,y=a.display,x=a.doc,b=Sl(a);if(a.options.moveInputWithCursor){var E=Cr(a,x.sel.primary().head,"div"),ee=y.wrapper.getBoundingClientRect(),re=y.lineDiv.getBoundingClientRect();b.teTop=Math.max(0,Math.min(y.wrapper.clientHeight-10,E.top+re.top-ee.top)),b.teLeft=Math.max(0,Math.min(y.wrapper.clientWidth-10,E.left+re.left-ee.left))}return b},Ki.prototype.showSelection=function(a){var y=this.cm,x=y.display;Ye(x.cursorDiv,a.cursors),Ye(x.selectionDiv,a.selection),a.teTop!=null&&(this.wrapper.style.top=a.teTop+"px",this.wrapper.style.left=a.teLeft+"px")},Ki.prototype.reset=function(a){if(!(this.contextMenuPending||this.composing)){var y=this.cm;if(y.somethingSelected()){this.prevInput="";var x=y.getSelection();this.textarea.value=x,y.state.focused&&wt(this.textarea),pe&&ge>=9&&(this.hasSelection=x)}else a||(this.prevInput=this.textarea.value="",pe&&ge>=9&&(this.hasSelection=null))}},Ki.prototype.getField=function(){return this.textarea},Ki.prototype.supportsTouch=function(){return!1},Ki.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!Le||Pe()!=this.textarea))try{this.textarea.focus()}catch(a){}},Ki.prototype.blur=function(){this.textarea.blur()},Ki.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ki.prototype.receivedFocus=function(){this.slowPoll()},Ki.prototype.slowPoll=function(){var a=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){a.poll(),a.cm.state.focused&&a.slowPoll()})},Ki.prototype.fastPoll=function(){var a=!1,y=this;y.pollingFast=!0;function x(){var b=y.poll();!b&&!a?(a=!0,y.polling.set(60,x)):(y.pollingFast=!1,y.slowPoll())}y.polling.set(20,x)},Ki.prototype.poll=function(){var a=this,y=this.cm,x=this.textarea,b=this.prevInput;if(this.contextMenuPending||!y.state.focused||Bn(x)&&!b&&!this.composing||y.isReadOnly()||y.options.disableInput||y.state.keySeq)return!1;var E=x.value;if(E==b&&!y.somethingSelected())return!1;if(pe&&ge>=9&&this.hasSelection===E||xe&&/[\uf700-\uf7ff]/.test(E))return y.display.input.reset(),!1;if(y.doc.sel==y.display.selForContextMenu){var ee=E.charCodeAt(0);if(ee==8203&&!b&&(b="\u200B"),ee==8666)return this.reset(),this.cm.execCommand("undo")}for(var re=0,le=Math.min(b.length,E.length);re<le&&b.charCodeAt(re)==E.charCodeAt(re);)++re;return Pr(y,function(){gl(y,E.slice(re),b.length-re,null,a.composing?"*compose":null),E.length>1e3||E.indexOf(`
`)>-1?x.value=a.prevInput="":a.prevInput=E,a.composing&&(a.composing.range.clear(),a.composing.range=y.markText(a.composing.start,y.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ki.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ki.prototype.onKeyPress=function(){pe&&ge>=9&&(this.hasSelection=null),this.fastPoll()},Ki.prototype.onContextMenu=function(a){var y=this,x=y.cm,b=x.display,E=y.textarea;y.contextMenuPending&&y.contextMenuPending();var ee=Co(x,a),re=b.scroller.scrollTop;if(!ee||fe)return;var le=x.options.resetSelectionOnContextMenu;le&&x.doc.sel.contains(ee)==-1&&nr(x,pr)(x.doc,po(ee),Be);var se=E.style.cssText,ce=y.wrapper.style.cssText,ye=y.wrapper.offsetParent.getBoundingClientRect();y.wrapper.style.cssText="position: static",E.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(a.clientY-ye.top-5)+"px; left: "+(a.clientX-ye.left-5)+`px;
z-index: 1000; background: `+(pe?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ce;Fe&&(Ce=window.scrollY),b.input.focus(),Fe&&window.scrollTo(null,Ce),b.input.reset(),x.somethingSelected()||(E.value=y.prevInput=" "),y.contextMenuPending=He,b.selForContextMenu=x.doc.sel,clearTimeout(b.detectingSelectAll);function je(){if(E.selectionStart!=null){var Dt=x.somethingSelected(),zt="\u200B"+(Dt?E.value:"");E.value="\u21DA",E.value=zt,y.prevInput=Dt?"":"\u200B",E.selectionStart=1,E.selectionEnd=zt.length,b.selForContextMenu=x.doc.sel}}function He(){if(y.contextMenuPending==He&&(y.contextMenuPending=!1,y.wrapper.style.cssText=ce,E.style.cssText=se,pe&&ge<9&&b.scrollbars.setScrollTop(b.scroller.scrollTop=re),E.selectionStart!=null)){(!pe||pe&&ge<9)&&je();var Dt=0,zt=function(){b.selForContextMenu==x.doc.sel&&E.selectionStart==0&&E.selectionEnd>0&&y.prevInput=="\u200B"?nr(x,ts)(x):Dt++<10?b.detectingSelectAll=setTimeout(zt,500):(b.selForContextMenu=null,b.input.reset())};b.detectingSelectAll=setTimeout(zt,200)}}if(pe&&ge>=9&&je(),$e){un(a);var vt=function(){Ft(window,"mouseup",vt),setTimeout(He,20)};_e(window,"mouseup",vt)}else setTimeout(He,50)},Ki.prototype.readOnlyChanged=function(a){a||this.reset(),this.textarea.disabled=a=="nocursor",this.textarea.readOnly=!!a},Ki.prototype.setUneditable=function(){},Ki.prototype.needsContentAttribute=!1;function qu(a,y){if(y=y?Ot(y):{},y.value=a.value,!y.tabindex&&a.tabIndex&&(y.tabindex=a.tabIndex),!y.placeholder&&a.placeholder&&(y.placeholder=a.placeholder),y.autofocus==null){var x=Pe();y.autofocus=x==a||a.getAttribute("autofocus")!=null&&x==document.body}function b(){a.value=le.getValue()}var E;if(a.form&&(_e(a.form,"submit",b),!y.leaveSubmitMethodAlone)){var ee=a.form;E=ee.submit;try{var re=ee.submit=function(){b(),ee.submit=E,ee.submit(),ee.submit=re}}catch(se){}}y.finishInit=function(se){se.save=b,se.getTextArea=function(){return a},se.toTextArea=function(){se.toTextArea=isNaN,b(),a.parentNode.removeChild(se.getWrapperElement()),a.style.display="",a.form&&(Ft(a.form,"submit",b),!y.leaveSubmitMethodAlone&&typeof a.form.submit=="function"&&(a.form.submit=E))}},a.style.display="none";var le=Wi(function(se){return a.parentNode.insertBefore(se,a.nextSibling)},y);return le}function Ju(a){a.off=Ft,a.on=_e,a.wheelEventPixels=ru,a.Doc=kr,a.splitLines=ti,a.countColumn=ve,a.findColumn=en,a.isWordChar=oe,a.Pass=Ct,a.signal=Qt,a.Line=si,a.changeEnd=vo,a.scrollbarModel=Pl,a.Pos=Re,a.cmpPos=pt,a.modes=jn,a.mimeModes=Gt,a.resolveMode=kn,a.getMode=Qn,a.modeExtensions=Cn,a.extendMode=Fn,a.copyState=wn,a.startState=nn,a.innerMode=rn,a.commands=fa,a.keyMap=ro,a.keyName=gs,a.isModifierKey=vs,a.lookupKey=zo,a.normalizeKeyMap=Du,a.StringStream=dt,a.SharedTextMarker=ca,a.TextMarker=go,a.LineWidget=ua,a.e_preventDefault=Zt,a.e_stopPropagation=_n,a.e_stop=un,a.addClass=ot,a.contains=Qe,a.rmClass=it,a.keyNames=yo}Zu(Wi),Uu(Wi);var Qu="iter insert remove copy getEditor constructor".split(" ");for(var Ga in kr.prototype)kr.prototype.hasOwnProperty(Ga)&&ut(Qu,Ga)<0&&(Wi.prototype[Ga]=function(a){return function(){return a.apply(this.doc,arguments)}}(kr.prototype[Ga]));return kt(kr),Wi.inputStyles={textarea:Ki,contenteditable:Ti},Wi.defineMode=function(a){!Wi.defaults.mode&&a!="null"&&(Wi.defaults.mode=a),cn.apply(this,arguments)},Wi.defineMIME=xn,Wi.defineMode("null",function(){return{token:function(a){return a.skipToEnd()}}}),Wi.defineMIME("text/plain","null"),Wi.defineExtension=function(a,y){Wi.prototype[a]=y},Wi.defineDocExtension=function(a,y){kr.prototype[a]=y},Wi.fromTextArea=qu,Ju(Wi),Wi.version="5.58.2",Wi})},25419:function(At,_t,he){(function(ie){ie(he(89780),he(15525),he(98101))})(function(ie){"use strict";ie.defineMode("markdown",function(et,Me){var ze=ie.getMode(et,"text/html"),pe=ze.name=="null";function ge(ve){if(ie.findModeByName){var de=ie.findModeByName(ve);de&&(ve=de.mime||de.mimes[0])}var ut=ie.getMode(et,ve);return ut.name=="null"?null:ut}Me.highlightFormatting===void 0&&(Me.highlightFormatting=!1),Me.maxBlockquoteDepth===void 0&&(Me.maxBlockquoteDepth=0),Me.taskLists===void 0&&(Me.taskLists=!1),Me.strikethrough===void 0&&(Me.strikethrough=!1),Me.emoji===void 0&&(Me.emoji=!1),Me.fencedCodeBlockHighlighting===void 0&&(Me.fencedCodeBlockHighlighting=!0),Me.fencedCodeBlockDefaultMode===void 0&&(Me.fencedCodeBlockDefaultMode="text/plain"),Me.xml===void 0&&(Me.xml=!0),Me.tokenTypeOverrides===void 0&&(Me.tokenTypeOverrides={});var Fe={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 Ie in Fe)Fe.hasOwnProperty(Ie)&&Me.tokenTypeOverrides[Ie]&&(Fe[Ie]=Me.tokenTypeOverrides[Ie]);var we=/^([*\-_])(?:\s*\1){2,}\s*$/,fe=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,Ke=/^\[(x| )\](?=\s)/i,me=Me.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,rt=/^ {0,3}(?:\={1,}|-{2,})\s*$/,Ne=/^[^#!\[\]*_\\<>` "'(~:]+/,De=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,Le=/^\s*\[[^\]]+?\]:.*$/,xe=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,Oe=" ";function Xe(ve,de,ut){return de.f=de.inline=ut,ut(ve,de)}function Je(ve,de,ut){return de.f=de.block=ut,ut(ve,de)}function st(ve){return!ve||!/\S/.test(ve.string)}function $e(ve){if(ve.linkTitle=!1,ve.linkHref=!1,ve.linkText=!1,ve.em=!1,ve.strong=!1,ve.strikethrough=!1,ve.quote=0,ve.indentedCode=!1,ve.f==it){var de=pe;if(!de){var ut=ie.innerMode(ze,ve.htmlState);de=ut.mode.name=="xml"&&ut.state.tagStart===null&&!ut.state.context&&ut.state.tokenize.isInText}de&&(ve.f=mt,ve.block=lt,ve.htmlState=null)}return ve.trailingSpace=0,ve.trailingSpaceNewLine=!1,ve.prevLine=ve.thisLine,ve.thisLine={stream:null},null}function lt(ve,de){var ut=ve.column()===de.indentation,Jt=st(de.prevLine.stream),Ct=de.indentedCode,Be=de.prevLine.hr,tt=de.list!==!1,at=(de.listStack[de.listStack.length-1]||0)+3;de.indentedCode=!1;var en=de.indentation;if(de.indentationDiff===null&&(de.indentationDiff=de.indentation,tt)){for(de.list=null;en<de.listStack[de.listStack.length-1];)de.listStack.pop(),de.listStack.length?de.indentation=de.listStack[de.listStack.length-1]:de.list=!1;de.list!==!1&&(de.indentationDiff=en-de.listStack[de.listStack.length-1])}var ct=!Jt&&!Be&&!de.prevLine.header&&(!tt||!Ct)&&!de.prevLine.fencedCodeEnd,Pt=(de.list===!1||Be||Jt)&&de.indentation<=at&&ve.match(we),We=null;if(de.indentationDiff>=4&&(Ct||de.prevLine.fencedCodeEnd||de.prevLine.header||Jt))return ve.skipToEnd(),de.indentedCode=!0,Fe.code;if(ve.eatSpace())return null;if(ut&&de.indentation<=at&&(We=ve.match(me))&&We[1].length<=6)return de.quote=0,de.header=We[1].length,de.thisLine.header=!0,Me.highlightFormatting&&(de.formatting="header"),de.f=de.inline,Ye(de);if(de.indentation<=at&&ve.eat(">"))return de.quote=ut?1:de.quote+1,Me.highlightFormatting&&(de.formatting="quote"),ve.eatSpace(),Ye(de);if(!Pt&&!de.setext&&ut&&de.indentation<=at&&(We=ve.match(fe))){var gt=We[1]?"ol":"ul";return de.indentation=en+ve.current().length,de.list=!0,de.quote=0,de.listStack.push(de.indentation),de.em=!1,de.strong=!1,de.code=!1,de.strikethrough=!1,Me.taskLists&&ve.match(Ke,!1)&&(de.taskList=!0),de.f=de.inline,Me.highlightFormatting&&(de.formatting=["list","list-"+gt]),Ye(de)}else{if(ut&&de.indentation<=at&&(We=ve.match(De,!0)))return de.quote=0,de.fencedEndRE=new RegExp(We[1]+"+ *$"),de.localMode=Me.fencedCodeBlockHighlighting&&ge(We[2]||Me.fencedCodeBlockDefaultMode),de.localMode&&(de.localState=ie.startState(de.localMode)),de.f=de.block=Yt,Me.highlightFormatting&&(de.formatting="code-block"),de.code=-1,Ye(de);if(de.setext||(!ct||!tt)&&!de.quote&&de.list===!1&&!de.code&&!Pt&&!Le.test(ve.string)&&(We=ve.lookAhead(1))&&(We=We.match(rt)))return de.setext?(de.header=de.setext,de.setext=0,ve.skipToEnd(),Me.highlightFormatting&&(de.formatting="header")):(de.header=We[0].charAt(0)=="="?1:2,de.setext=de.header),de.thisLine.header=!0,de.f=de.inline,Ye(de);if(Pt)return ve.skipToEnd(),de.hr=!0,de.thisLine.hr=!0,Fe.hr;if(ve.peek()==="[")return Xe(ve,de,$t)}return Xe(ve,de,de.inline)}function it(ve,de){var ut=ze.token(ve,de.htmlState);if(!pe){var Jt=ie.innerMode(ze,de.htmlState);(Jt.mode.name=="xml"&&Jt.state.tagStart===null&&!Jt.state.context&&Jt.state.tokenize.isInText||de.md_inside&&ve.current().indexOf(">")>-1)&&(de.f=mt,de.block=lt,de.htmlState=null)}return ut}function Yt(ve,de){var ut=de.listStack[de.listStack.length-1]||0,Jt=de.indentation<ut,Ct=ut+3;if(de.fencedEndRE&&de.indentation<=Ct&&(Jt||ve.match(de.fencedEndRE))){Me.highlightFormatting&&(de.formatting="code-block");var Be;return Jt||(Be=Ye(de)),de.localMode=de.localState=null,de.block=lt,de.f=mt,de.fencedEndRE=null,de.code=0,de.thisLine.fencedCodeEnd=!0,Jt?Je(ve,de,de.block):Be}else return de.localMode?de.localMode.token(ve,de.localState):(ve.skipToEnd(),Fe.code)}function Ye(ve){var de=[];if(ve.formatting){de.push(Fe.formatting),typeof ve.formatting=="string"&&(ve.formatting=[ve.formatting]);for(var ut=0;ut<ve.formatting.length;ut++)de.push(Fe.formatting+"-"+ve.formatting[ut]),ve.formatting[ut]==="header"&&de.push(Fe.formatting+"-"+ve.formatting[ut]+"-"+ve.header),ve.formatting[ut]==="quote"&&(!Me.maxBlockquoteDepth||Me.maxBlockquoteDepth>=ve.quote?de.push(Fe.formatting+"-"+ve.formatting[ut]+"-"+ve.quote):de.push("error"))}if(ve.taskOpen)return de.push("meta"),de.length?de.join(" "):null;if(ve.taskClosed)return de.push("property"),de.length?de.join(" "):null;if(ve.linkHref?de.push(Fe.linkHref,"url"):(ve.strong&&de.push(Fe.strong),ve.em&&de.push(Fe.em),ve.strikethrough&&de.push(Fe.strikethrough),ve.emoji&&de.push(Fe.emoji),ve.linkText&&de.push(Fe.linkText),ve.code&&de.push(Fe.code),ve.image&&de.push(Fe.image),ve.imageAltText&&de.push(Fe.imageAltText,"link"),ve.imageMarker&&de.push(Fe.imageMarker)),ve.header&&de.push(Fe.header,Fe.header+"-"+ve.header),ve.quote&&(de.push(Fe.quote),!Me.maxBlockquoteDepth||Me.maxBlockquoteDepth>=ve.quote?de.push(Fe.quote+"-"+ve.quote):de.push(Fe.quote+"-"+Me.maxBlockquoteDepth)),ve.list!==!1){var Jt=(ve.listStack.length-1)%3;Jt?Jt===1?de.push(Fe.list2):de.push(Fe.list3):de.push(Fe.list1)}return ve.trailingSpaceNewLine?de.push("trailing-space-new-line"):ve.trailingSpace&&de.push("trailing-space-"+(ve.trailingSpace%2?"a":"b")),de.length?de.join(" "):null}function Ge(ve,de){if(ve.match(Ne,!0))return Ye(de)}function mt(ve,de){var ut=de.text(ve,de);if(typeof ut!="undefined")return ut;if(de.list)return de.list=null,Ye(de);if(de.taskList){var Jt=ve.match(Ke,!0)[1]===" ";return Jt?de.taskOpen=!0:de.taskClosed=!0,Me.highlightFormatting&&(de.formatting="task"),de.taskList=!1,Ye(de)}if(de.taskOpen=!1,de.taskClosed=!1,de.header&&ve.match(/^#+$/,!0))return Me.highlightFormatting&&(de.formatting="header"),Ye(de);var Ct=ve.next();if(de.linkTitle){de.linkTitle=!1;var Be=Ct;Ct==="("&&(Be=")"),Be=(Be+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var tt="^\\s*(?:[^"+Be+"\\\\]+|\\\\\\\\|\\\\.)"+Be;if(ve.match(new RegExp(tt),!0))return Fe.linkHref}if(Ct==="`"){var at=de.formatting;Me.highlightFormatting&&(de.formatting="code"),ve.eatWhile("`");var en=ve.current().length;if(de.code==0&&(!de.quote||en==1))return de.code=en,Ye(de);if(en==de.code){var ct=Ye(de);return de.code=0,ct}else return de.formatting=at,Ye(de)}else if(de.code)return Ye(de);if(Ct==="\\"&&(ve.next(),Me.highlightFormatting)){var Pt=Ye(de),We=Fe.formatting+"-escape";return Pt?Pt+" "+We:We}if(Ct==="!"&&ve.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return de.imageMarker=!0,de.image=!0,Me.highlightFormatting&&(de.formatting="image"),Ye(de);if(Ct==="["&&de.imageMarker&&ve.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return de.imageMarker=!1,de.imageAltText=!0,Me.highlightFormatting&&(de.formatting="image"),Ye(de);if(Ct==="]"&&de.imageAltText){Me.highlightFormatting&&(de.formatting="image");var Pt=Ye(de);return de.imageAltText=!1,de.image=!1,de.inline=de.f=Qe,Pt}if(Ct==="["&&!de.image)return de.linkText&&ve.match(/^.*?\]/)||(de.linkText=!0,Me.highlightFormatting&&(de.formatting="link")),Ye(de);if(Ct==="]"&&de.linkText){Me.highlightFormatting&&(de.formatting="link");var Pt=Ye(de);return de.linkText=!1,de.inline=de.f=ve.match(/\(.*?\)| ?\[.*?\]/,!1)?Qe:mt,Pt}if(Ct==="<"&&ve.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){de.f=de.inline=Te,Me.highlightFormatting&&(de.formatting="link");var Pt=Ye(de);return Pt?Pt+=" ":Pt="",Pt+Fe.linkInline}if(Ct==="<"&&ve.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){de.f=de.inline=Te,Me.highlightFormatting&&(de.formatting="link");var Pt=Ye(de);return Pt?Pt+=" ":Pt="",Pt+Fe.linkEmail}if(Me.xml&&Ct==="<"&&ve.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var gt=ve.string.indexOf(">",ve.pos);if(gt!=-1){var St=ve.string.substring(ve.start,gt);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(St)&&(de.md_inside=!0)}return ve.backUp(1),de.htmlState=ie.startState(ze),Je(ve,de,it)}if(Me.xml&&Ct==="<"&&ve.match(/^\/\w*?>/))return de.md_inside=!1,"tag";if(Ct==="*"||Ct==="_"){for(var ae=1,te=ve.pos==1?" ":ve.string.charAt(ve.pos-2);ae<3&&ve.eat(Ct);)ae++;var z=ve.peek()||" ",oe=!/\s/.test(z)&&(!xe.test(z)||/\s/.test(te)||xe.test(te)),ue=!/\s/.test(te)&&(!xe.test(te)||/\s/.test(z)||xe.test(z)),ne=null,be=null;if(ae%2&&(!de.em&&oe&&(Ct==="*"||!ue||xe.test(te))?ne=!0:de.em==Ct&&ue&&(Ct==="*"||!oe||xe.test(z))&&(ne=!1)),ae>1&&(!de.strong&&oe&&(Ct==="*"||!ue||xe.test(te))?be=!0:de.strong==Ct&&ue&&(Ct==="*"||!oe||xe.test(z))&&(be=!1)),be!=null||ne!=null){Me.highlightFormatting&&(de.formatting=ne==null?"strong":be==null?"em":"strong em"),ne===!0&&(de.em=Ct),be===!0&&(de.strong=Ct);var ct=Ye(de);return ne===!1&&(de.em=!1),be===!1&&(de.strong=!1),ct}}else if(Ct===" "&&(ve.eat("*")||ve.eat("_"))){if(ve.peek()===" ")return Ye(de);ve.backUp(1)}if(Me.strikethrough){if(Ct==="~"&&ve.eatWhile(Ct)){if(de.strikethrough){Me.highlightFormatting&&(de.formatting="strikethrough");var ct=Ye(de);return de.strikethrough=!1,ct}else if(ve.match(/^[^\s]/,!1))return de.strikethrough=!0,Me.highlightFormatting&&(de.formatting="strikethrough"),Ye(de)}else if(Ct===" "&&ve.match(/^~~/,!0)){if(ve.peek()===" ")return Ye(de);ve.backUp(2)}}if(Me.emoji&&Ct===":"&&ve.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){de.emoji=!0,Me.highlightFormatting&&(de.formatting="emoji");var Ve=Ye(de);return de.emoji=!1,Ve}return Ct===" "&&(ve.match(/^ +$/,!1)?de.trailingSpace++:de.trailingSpace&&(de.trailingSpaceNewLine=!0)),Ye(de)}function Te(ve,de){var ut=ve.next();if(ut===">"){de.f=de.inline=mt,Me.highlightFormatting&&(de.formatting="link");var Jt=Ye(de);return Jt?Jt+=" ":Jt="",Jt+Fe.linkInline}return ve.match(/^[^>]+/,!0),Fe.linkInline}function Qe(ve,de){if(ve.eatSpace())return null;var ut=ve.next();return ut==="("||ut==="["?(de.f=de.inline=ot(ut==="("?")":"]"),Me.highlightFormatting&&(de.formatting="link-string"),de.linkHref=!0,Ye(de)):"error"}var Pe={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function ot(ve){return function(de,ut){var Jt=de.next();if(Jt===ve){ut.f=ut.inline=mt,Me.highlightFormatting&&(ut.formatting="link-string");var Ct=Ye(ut);return ut.linkHref=!1,Ct}return de.match(Pe[ve]),ut.linkHref=!0,Ye(ut)}}function $t(ve,de){return ve.match(/^([^\]\\]|\\.)*\]:/,!1)?(de.f=wt,ve.next(),Me.highlightFormatting&&(de.formatting="link"),de.linkText=!0,Ye(de)):Xe(ve,de,mt)}function wt(ve,de){if(ve.match(/^\]:/,!0)){de.f=de.inline=pn,Me.highlightFormatting&&(de.formatting="link");var ut=Ye(de);return de.linkText=!1,ut}return ve.match(/^([^\]\\]|\\.)+/,!0),Fe.linkText}function pn(ve,de){return ve.eatSpace()?null:(ve.match(/^[^\s]+/,!0),ve.peek()===void 0?de.linkTitle=!0:ve.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),de.f=de.inline=mt,Fe.linkHref+" url")}var Ot={startState:function(){return{f:lt,prevLine:{stream:null},thisLine:{stream:null},block:lt,htmlState:null,indentation:0,inline:mt,text:Ge,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(ve){return{f:ve.f,prevLine:ve.prevLine,thisLine:ve.thisLine,block:ve.block,htmlState:ve.htmlState&&ie.copyState(ze,ve.htmlState),indentation:ve.indentation,localMode:ve.localMode,localState:ve.localMode?ie.copyState(ve.localMode,ve.localState):null,inline:ve.inline,text:ve.text,formatting:!1,linkText:ve.linkText,linkTitle:ve.linkTitle,linkHref:ve.linkHref,code:ve.code,em:ve.em,strong:ve.strong,strikethrough:ve.strikethrough,emoji:ve.emoji,header:ve.header,setext:ve.setext,hr:ve.hr,taskList:ve.taskList,list:ve.list,listStack:ve.listStack.slice(0),quote:ve.quote,indentedCode:ve.indentedCode,trailingSpace:ve.trailingSpace,trailingSpaceNewLine:ve.trailingSpaceNewLine,md_inside:ve.md_inside,fencedEndRE:ve.fencedEndRE}},token:function(ve,de){if(de.formatting=!1,ve!=de.thisLine.stream){if(de.header=0,de.hr=!1,ve.match(/^\s*$/,!0))return $e(de),null;if(de.prevLine=de.thisLine,de.thisLine={stream:ve},de.taskList=!1,de.trailingSpace=0,de.trailingSpaceNewLine=!1,!de.localState&&(de.f=de.block,de.f!=it)){var ut=ve.match(/^\s*/,!0)[0].replace(/\t/g,Oe).length;if(de.indentation=ut,de.indentationDiff=null,ut>0)return null}}return de.f(ve,de)},innerMode:function(ve){return ve.block==it?{state:ve.htmlState,mode:ze}:ve.localState?{state:ve.localState,mode:ve.localMode}:{state:ve,mode:Ot}},indent:function(ve,de,ut){return ve.block==it&&ze.indent?ze.indent(ve.htmlState,de,ut):ve.localState&&ve.localMode.indent?ve.localMode.indent(ve.localState,de,ut):ie.Pass},blankLine:$e,getType:Ye,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Ot},"xml"),ie.defineMIME("text/markdown","markdown"),ie.defineMIME("text/x-markdown","markdown")})},98101:function(At,_t,he){(function(ie){ie(he(89780))})(function(ie){"use strict";ie.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 et=0;et<ie.modeInfo.length;et++){var Me=ie.modeInfo[et];Me.mimes&&(Me.mime=Me.mimes[0])}ie.findModeByMIME=function(ze){ze=ze.toLowerCase();for(var pe=0;pe<ie.modeInfo.length;pe++){var ge=ie.modeInfo[pe];if(ge.mime==ze)return ge;if(ge.mimes){for(var Fe=0;Fe<ge.mimes.length;Fe++)if(ge.mimes[Fe]==ze)return ge}}if(/\+xml$/.test(ze))return ie.findModeByMIME("application/xml");if(/\+json$/.test(ze))return ie.findModeByMIME("application/json")},ie.findModeByExtension=function(ze){ze=ze.toLowerCase();for(var pe=0;pe<ie.modeInfo.length;pe++){var ge=ie.modeInfo[pe];if(ge.ext){for(var Fe=0;Fe<ge.ext.length;Fe++)if(ge.ext[Fe]==ze)return ge}}},ie.findModeByFileName=function(ze){for(var pe=0;pe<ie.modeInfo.length;pe++){var ge=ie.modeInfo[pe];if(ge.file&&ge.file.test(ze))return ge}var Fe=ze.lastIndexOf("."),Ie=Fe>-1&&ze.substring(Fe+1,ze.length);if(Ie)return ie.findModeByExtension(Ie)},ie.findModeByName=function(ze){ze=ze.toLowerCase();for(var pe=0;pe<ie.modeInfo.length;pe++){var ge=ie.modeInfo[pe];if(ge.name.toLowerCase()==ze)return ge;if(ge.alias){for(var Fe=0;Fe<ge.alias.length;Fe++)if(ge.alias[Fe].toLowerCase()==ze)return ge}}}})},67549:function(At,_t,he){(function(ie){ie(he(89780))})(function(ie){"use strict";ie.defineMode("stex",function(et,Me){"use strict";function ze(Ne,De){Ne.cmdState.push(De)}function pe(Ne){return Ne.cmdState.length>0?Ne.cmdState[Ne.cmdState.length-1]:null}function ge(Ne){var De=Ne.cmdState.pop();De&&De.closeBracket()}function Fe(Ne){for(var De=Ne.cmdState,Le=De.length-1;Le>=0;Le--){var xe=De[Le];if(xe.name!="DEFAULT")return xe}return{styleIdentifier:function(){return null}}}function Ie(Ne,De,Le){return function(){this.name=Ne,this.bracketNo=0,this.style=De,this.styles=Le,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var we={};we.importmodule=Ie("importmodule","tag",["string","builtin"]),we.documentclass=Ie("documentclass","tag",["","atom"]),we.usepackage=Ie("usepackage","tag",["atom"]),we.begin=Ie("begin","tag",["atom"]),we.end=Ie("end","tag",["atom"]),we.label=Ie("label","tag",["atom"]),we.ref=Ie("ref","tag",["atom"]),we.eqref=Ie("eqref","tag",["atom"]),we.cite=Ie("cite","tag",["atom"]),we.bibitem=Ie("bibitem","tag",["atom"]),we.Bibitem=Ie("Bibitem","tag",["atom"]),we.RBibitem=Ie("RBibitem","tag",["atom"]),we.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function fe(Ne,De){Ne.f=De}function Ke(Ne,De){var Le;if(Ne.match(/^\\[a-zA-Z@]+/)){var xe=Ne.current().slice(1);return Le=we.hasOwnProperty(xe)?we[xe]:we.DEFAULT,Le=new Le,ze(De,Le),fe(De,rt),Le.style}if(Ne.match(/^\\[$&%#{}_]/)||Ne.match(/^\\[,;!\/\\]/))return"tag";if(Ne.match("\\["))return fe(De,function(Xe,Je){return me(Xe,Je,"\\]")}),"keyword";if(Ne.match("\\("))return fe(De,function(Xe,Je){return me(Xe,Je,"\\)")}),"keyword";if(Ne.match("$$"))return fe(De,function(Xe,Je){return me(Xe,Je,"$$")}),"keyword";if(Ne.match("$"))return fe(De,function(Xe,Je){return me(Xe,Je,"$")}),"keyword";var Oe=Ne.next();if(Oe=="%")return Ne.skipToEnd(),"comment";if(Oe=="}"||Oe=="]"){if(Le=pe(De),Le)Le.closeBracket(Oe),fe(De,rt);else return"error";return"bracket"}else return Oe=="{"||Oe=="["?(Le=we.DEFAULT,Le=new Le,ze(De,Le),"bracket"):/\d/.test(Oe)?(Ne.eatWhile(/[\w.%]/),"atom"):(Ne.eatWhile(/[\w\-_]/),Le=Fe(De),Le.name=="begin"&&(Le.argument=Ne.current()),Le.styleIdentifier())}function me(Ne,De,Le){if(Ne.eatSpace())return null;if(Le&&Ne.match(Le))return fe(De,Ke),"keyword";if(Ne.match(/^\\[a-zA-Z@]+/))return"tag";if(Ne.match(/^[a-zA-Z]+/))return"variable-2";if(Ne.match(/^\\[$&%#{}_]/)||Ne.match(/^\\[,;!\/]/)||Ne.match(/^[\^_&]/))return"tag";if(Ne.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(Ne.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var xe=Ne.next();return xe=="{"||xe=="}"||xe=="["||xe=="]"||xe=="("||xe==")"?"bracket":xe=="%"?(Ne.skipToEnd(),"comment"):"error"}function rt(Ne,De){var Le=Ne.peek(),xe;return Le=="{"||Le=="["?(xe=pe(De),xe.openBracket(Le),Ne.eat(Le),fe(De,Ke),"bracket"):/[ \t\r]/.test(Le)?(Ne.eat(Le),null):(fe(De,Ke),ge(De),Ke(Ne,De))}return{startState:function(){var Ne=Me.inMathMode?function(De,Le){return me(De,Le)}:Ke;return{cmdState:[],f:Ne}},copyState:function(Ne){return{cmdState:Ne.cmdState.slice(),f:Ne.f}},token:function(Ne,De){return De.f(Ne,De)},blankLine:function(Ne){Ne.f=Ke,Ne.cmdState.length=0},lineComment:"%"}}),ie.defineMIME("text/x-stex","stex"),ie.defineMIME("text/x-latex","stex")})},15525:function(At,_t,he){(function(ie){ie(he(89780))})(function(ie){"use strict";var et={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},Me={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ie.defineMode("xml",function(ze,pe){var ge=ze.indentUnit,Fe={},Ie=pe.htmlMode?et:Me;for(var we in Ie)Fe[we]=Ie[we];for(var we in pe)Fe[we]=pe[we];var fe,Ke;function me(Te,Qe){function Pe(wt){return Qe.tokenize=wt,wt(Te,Qe)}var ot=Te.next();if(ot=="<")return Te.eat("!")?Te.eat("[")?Te.match("CDATA[")?Pe(De("atom","]]>")):null:Te.match("--")?Pe(De("comment","-->")):Te.match("DOCTYPE",!0,!0)?(Te.eatWhile(/[\w\._\-]/),Pe(Le(1))):null:Te.eat("?")?(Te.eatWhile(/[\w\._\-]/),Qe.tokenize=De("meta","?>"),"meta"):(fe=Te.eat("/")?"closeTag":"openTag",Qe.tokenize=rt,"tag bracket");if(ot=="&"){var $t;return Te.eat("#")?Te.eat("x")?$t=Te.eatWhile(/[a-fA-F\d]/)&&Te.eat(";"):$t=Te.eatWhile(/[\d]/)&&Te.eat(";"):$t=Te.eatWhile(/[\w\.\-:]/)&&Te.eat(";"),$t?"atom":"error"}else return Te.eatWhile(/[^&<]/),null}me.isInText=!0;function rt(Te,Qe){var Pe=Te.next();if(Pe==">"||Pe=="/"&&Te.eat(">"))return Qe.tokenize=me,fe=Pe==">"?"endTag":"selfcloseTag","tag bracket";if(Pe=="=")return fe="equals",null;if(Pe=="<"){Qe.tokenize=me,Qe.state=Je,Qe.tagName=Qe.tagStart=null;var ot=Qe.tokenize(Te,Qe);return ot?ot+" tag error":"tag error"}else return/[\'\"]/.test(Pe)?(Qe.tokenize=Ne(Pe),Qe.stringStartCol=Te.column(),Qe.tokenize(Te,Qe)):(Te.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Ne(Te){var Qe=function(Pe,ot){for(;!Pe.eol();)if(Pe.next()==Te){ot.tokenize=rt;break}return"string"};return Qe.isInAttribute=!0,Qe}function De(Te,Qe){return function(Pe,ot){for(;!Pe.eol();){if(Pe.match(Qe)){ot.tokenize=me;break}Pe.next()}return Te}}function Le(Te){return function(Qe,Pe){for(var ot;(ot=Qe.next())!=null;){if(ot=="<")return Pe.tokenize=Le(Te+1),Pe.tokenize(Qe,Pe);if(ot==">")if(Te==1){Pe.tokenize=me;break}else return Pe.tokenize=Le(Te-1),Pe.tokenize(Qe,Pe)}return"meta"}}function xe(Te,Qe,Pe){this.prev=Te.context,this.tagName=Qe,this.indent=Te.indented,this.startOfLine=Pe,(Fe.doNotIndent.hasOwnProperty(Qe)||Te.context&&Te.context.noIndent)&&(this.noIndent=!0)}function Oe(Te){Te.context&&(Te.context=Te.context.prev)}function Xe(Te,Qe){for(var Pe;;){if(!Te.context||(Pe=Te.context.tagName,!Fe.contextGrabbers.hasOwnProperty(Pe)||!Fe.contextGrabbers[Pe].hasOwnProperty(Qe)))return;Oe(Te)}}function Je(Te,Qe,Pe){return Te=="openTag"?(Pe.tagStart=Qe.column(),st):Te=="closeTag"?$e:Je}function st(Te,Qe,Pe){return Te=="word"?(Pe.tagName=Qe.current(),Ke="tag",Yt):Fe.allowMissingTagName&&Te=="endTag"?(Ke="tag bracket",Yt(Te,Qe,Pe)):(Ke="error",st)}function $e(Te,Qe,Pe){if(Te=="word"){var ot=Qe.current();return Pe.context&&Pe.context.tagName!=ot&&Fe.implicitlyClosed.hasOwnProperty(Pe.context.tagName)&&Oe(Pe),Pe.context&&Pe.context.tagName==ot||Fe.matchClosing===!1?(Ke="tag",lt):(Ke="tag error",it)}else return Fe.allowMissingTagName&&Te=="endTag"?(Ke="tag bracket",lt(Te,Qe,Pe)):(Ke="error",it)}function lt(Te,Qe,Pe){return Te!="endTag"?(Ke="error",lt):(Oe(Pe),Je)}function it(Te,Qe,Pe){return Ke="error",lt(Te,Qe,Pe)}function Yt(Te,Qe,Pe){if(Te=="word")return Ke="attribute",Ye;if(Te=="endTag"||Te=="selfcloseTag"){var ot=Pe.tagName,$t=Pe.tagStart;return Pe.tagName=Pe.tagStart=null,Te=="selfcloseTag"||Fe.autoSelfClosers.hasOwnProperty(ot)?Xe(Pe,ot):(Xe(Pe,ot),Pe.context=new xe(Pe,ot,$t==Pe.indented)),Je}return Ke="error",Yt}function Ye(Te,Qe,Pe){return Te=="equals"?Ge:(Fe.allowMissing||(Ke="error"),Yt(Te,Qe,Pe))}function Ge(Te,Qe,Pe){return Te=="string"?mt:Te=="word"&&Fe.allowUnquoted?(Ke="string",Yt):(Ke="error",Yt(Te,Qe,Pe))}function mt(Te,Qe,Pe){return Te=="string"?mt:Yt(Te,Qe,Pe)}return{startState:function(Te){var Qe={tokenize:me,state:Je,indented:Te||0,tagName:null,tagStart:null,context:null};return Te!=null&&(Qe.baseIndent=Te),Qe},token:function(Te,Qe){if(!Qe.tagName&&Te.sol()&&(Qe.indented=Te.indentation()),Te.eatSpace())return null;fe=null;var Pe=Qe.tokenize(Te,Qe);return(Pe||fe)&&Pe!="comment"&&(Ke=null,Qe.state=Qe.state(fe||Pe,Te,Qe),Ke&&(Pe=Ke=="error"?Pe+" error":Ke)),Pe},indent:function(Te,Qe,Pe){var ot=Te.context;if(Te.tokenize.isInAttribute)return Te.tagStart==Te.indented?Te.stringStartCol+1:Te.indented+ge;if(ot&&ot.noIndent)return ie.Pass;if(Te.tokenize!=rt&&Te.tokenize!=me)return Pe?Pe.match(/^(\s*)/)[0].length:0;if(Te.tagName)return Fe.multilineTagIndentPastTag!==!1?Te.tagStart+Te.tagName.length+2:Te.tagStart+ge*(Fe.multilineTagIndentFactor||1);if(Fe.alignCDATA&&/<!\[CDATA\[/.test(Qe))return 0;var $t=Qe&&/^<(\/)?([\w_:\.-]*)/.exec(Qe);if($t&&$t[1])for(;ot;)if(ot.tagName==$t[2]){ot=ot.prev;break}else if(Fe.implicitlyClosed.hasOwnProperty(ot.tagName))ot=ot.prev;else break;else if($t)for(;ot;){var wt=Fe.contextGrabbers[ot.tagName];if(wt&&wt.hasOwnProperty($t[2]))ot=ot.prev;else break}for(;ot&&ot.prev&&!ot.startOfLine;)ot=ot.prev;return ot?ot.indent+ge:Te.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:Fe.htmlMode?"html":"xml",helperType:Fe.htmlMode?"html":"xml",skipAttribute:function(Te){Te.state==Ge&&(Te.state=Yt)},xmlCurrentTag:function(Te){return Te.tagName?{name:Te.tagName,close:Te.type=="closeTag"}:null},xmlCurrentContext:function(Te){for(var Qe=[],Pe=Te.context;Pe;Pe=Pe.prev)Pe.tagName&&Qe.push(Pe.tagName);return Qe.reverse()}}}),ie.defineMIME("text/xml","xml"),ie.defineMIME("application/xml","xml"),ie.mimeModes.hasOwnProperty("text/html")||ie.defineMIME("text/html",{name:"xml",htmlMode:!0})})},2859:function(At,_t,he){"use strict";he.d(_t,{hP:function(){return St}});var ie=function(ae,te){return(ie=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(z,oe){z.__proto__=oe}||function(z,oe){for(var ue in oe)Object.prototype.hasOwnProperty.call(oe,ue)&&(z[ue]=oe[ue])})(ae,te)};function et(ae,te){function z(){this.constructor=ae}ie(ae,te),ae.prototype=te===null?Object.create(te):(z.prototype=te.prototype,new z)}function Me(ae,te,z,oe){return new(z||(z=Promise))(function(ue,ne){function be(bt){try{Tt(oe.next(bt))}catch(ft){ne(ft)}}function Ve(bt){try{Tt(oe.throw(bt))}catch(ft){ne(ft)}}function Tt(bt){var ft;bt.done?ue(bt.value):(ft=bt.value,ft instanceof z?ft:new z(function(yt){yt(ft)})).then(be,Ve)}Tt((oe=oe.apply(ae,te||[])).next())})}function ze(ae,te){var z,oe,ue,ne,be={label:0,sent:function(){if(1&ue[0])throw ue[1];return ue[1]},trys:[],ops:[]};return ne={next:Ve(0),throw:Ve(1),return:Ve(2)},typeof Symbol=="function"&&(ne[Symbol.iterator]=function(){return this}),ne;function Ve(Tt){return function(bt){return function(ft){if(z)throw new TypeError("Generator is already executing.");for(;be;)try{if(z=1,oe&&(ue=2&ft[0]?oe.return:ft[0]?oe.throw||((ue=oe.return)&&ue.call(oe),0):oe.next)&&!(ue=ue.call(oe,ft[1])).done)return ue;switch(oe=0,ue&&(ft=[2&ft[0],ue.value]),ft[0]){case 0:case 1:ue=ft;break;case 4:return be.label++,{value:ft[1],done:!1};case 5:be.label++,oe=ft[1],ft=[0];continue;case 7:ft=be.ops.pop(),be.trys.pop();continue;default:if(ue=be.trys,!((ue=ue.length>0&&ue[ue.length-1])||ft[0]!==6&&ft[0]!==2)){be=0;continue}if(ft[0]===3&&(!ue||ft[1]>ue[0]&&ft[1]<ue[3])){be.label=ft[1];break}if(ft[0]===6&&be.label<ue[1]){be.label=ue[1],ue=ft;break}if(ue&&be.label<ue[2]){be.label=ue[2],be.ops.push(ft);break}ue[2]&&be.ops.pop(),be.trys.pop();continue}ft=te.call(ae,be)}catch(yt){ft=[6,yt],oe=0}finally{z=ue=0}if(5&ft[0])throw ft[1];return{value:ft[0]?ft[1]:void 0,done:!0}}([Tt,bt])}}}function pe(){for(var ae=0,te=0,z=arguments.length;te<z;te++)ae+=arguments[te].length;var oe=Array(ae),ue=0;for(te=0;te<z;te++)for(var ne=arguments[te],be=0,Ve=ne.length;be<Ve;be++,ue++)oe[ue]=ne[be];return oe}var ge=function(){function ae(){}return ae.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},ae.setAttributes=function(te,z){for(var oe=0,ue=z;oe<ue.length;oe++){var ne=ue[oe],be=ne[0],Ve=ne[1];te.setAttribute(be,Ve)}},ae.createRect=function(te,z,oe){var ue=document.createElementNS("http://www.w3.org/2000/svg","rect");return ue.setAttribute("width",te.toString()),ue.setAttribute("height",z.toString()),oe&&ae.setAttributes(ue,oe),ue},ae.createLine=function(te,z,oe,ue,ne){var be=document.createElementNS("http://www.w3.org/2000/svg","line");return be.setAttribute("x1",te.toString()),be.setAttribute("y1",z.toString()),be.setAttribute("x2",oe.toString()),be.setAttribute("y2",ue.toString()),ne&&ae.setAttributes(be,ne),be},ae.createPolygon=function(te,z){var oe=document.createElementNS("http://www.w3.org/2000/svg","polygon");return oe.setAttribute("points",te),z&&ae.setAttributes(oe,z),oe},ae.createCircle=function(te,z){var oe=document.createElementNS("http://www.w3.org/2000/svg","circle");return oe.setAttribute("cx",(te/2).toString()),oe.setAttribute("cy",(te/2).toString()),oe.setAttribute("r",te.toString()),z&&ae.setAttributes(oe,z),oe},ae.createEllipse=function(te,z,oe){var ue=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ue.setAttribute("cx",(te/2).toString()),ue.setAttribute("cy",(z/2).toString()),ue.setAttribute("rx",(te/2).toString()),ue.setAttribute("ry",(z/2).toString()),oe&&ae.setAttributes(ue,oe),ue},ae.createGroup=function(te){var z=document.createElementNS("http://www.w3.org/2000/svg","g");return te&&ae.setAttributes(z,te),z},ae.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},ae.createMarker=function(te,z,oe,ue,ne,be,Ve){var Tt=document.createElementNS("http://www.w3.org/2000/svg","marker");return ae.setAttributes(Tt,[["id",te],["orient",z],["markerWidth",oe.toString()],["markerHeight",ue.toString()],["refX",ne.toString()],["refY",be.toString()]]),Tt.appendChild(Ve),Tt},ae.createText=function(te){var z=document.createElementNS("http://www.w3.org/2000/svg","text");return z.setAttribute("x","0"),z.setAttribute("y","0"),te&&ae.setAttributes(z,te),z},ae.createTSpan=function(te,z){var oe=document.createElementNS("http://www.w3.org/2000/svg","tspan");return oe.textContent=te,z&&ae.setAttributes(oe,z),oe},ae.createImage=function(te){var z=document.createElementNS("http://www.w3.org/2000/svg","image");return te&&ae.setAttributes(z,te),z},ae.createPoint=function(te,z){var oe=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return oe.x=te,oe.y=z,oe},ae.createPath=function(te,z){var oe=document.createElementNS("http://www.w3.org/2000/svg","path");return oe.setAttribute("d",te),z&&ae.setAttributes(oe,z),oe},ae}(),Fe=function(){function ae(){}return ae.addKey=function(te){ae.key=te},Object.defineProperty(ae,"isLicensed",{get:function(){return!!ae.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(ae.key)},enumerable:!1,configurable:!0}),ae}(),Ie=function(){function ae(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return ae.prototype.rasterize=function(te,z,oe){var ue=this;return new Promise(function(ne){var be=oe!==void 0?oe:document.createElement("canvas");te===null&&(ue.markersOnly=!0,ue.naturalSize=!1);var Ve=document.createElementNS("http://www.w3.org/2000/svg","svg");Ve.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ve.setAttribute("width",z.width.baseVal.valueAsString),Ve.setAttribute("height",z.height.baseVal.valueAsString),Ve.setAttribute("viewBox","0 0 "+z.viewBox.baseVal.width.toString()+" "+z.viewBox.baseVal.height.toString()),Ve.innerHTML=z.innerHTML,ue.naturalSize===!0?(Ve.width.baseVal.value=te.naturalWidth,Ve.height.baseVal.value=te.naturalHeight):ue.width!==void 0&&ue.height!==void 0&&(Ve.width.baseVal.value=ue.width,Ve.height.baseVal.value=ue.height),be.width=Ve.width.baseVal.value,be.height=Ve.height.baseVal.value;var Tt=Ve.outerHTML,bt=be.getContext("2d");ue.markersOnly!==!0&&bt.drawImage(te,0,0,be.width,be.height);var ft=window.URL,yt=new Image(be.width,be.height);yt.setAttribute("crossOrigin","anonymous");var Vt=new Blob([Tt],{type:"image/svg+xml"}),Wt=ft.createObjectURL(Vt);yt.onload=function(){bt.drawImage(yt,0,0),ft.revokeObjectURL(Wt);var qe=be.toDataURL(ue.imageType,ue.imageQuality);ne(qe)},yt.src=Wt})},ae}(),we=function(){},fe=function(){function ae(te){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+te+"_"}return Object.defineProperty(ae.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(ae.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(ae.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),ae.prototype.addClass=function(te){return this.styleSheet===void 0&&this.addStyleSheet(),te.name=""+this.classNamePrefix+te.localName,this.classes.push(te),this.styleSheet.sheet.insertRule("."+te.name+" {"+te.style+"}",this.styleSheet.sheet.cssRules.length),te},ae.prototype.addRule=function(te){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(te),this.styleSheet.sheet.insertRule(te.selector+" {"+te.style+"}",this.styleSheet.sheet.cssRules.length)},ae.prototype.addStyleSheet=function(){var te;this.styleSheet=document.createElement("style"),((te=this.styleSheetRoot)!==null&&te!==void 0?te:document.head).appendChild(this.styleSheet),this.addRule(new Ke("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ke("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Ke("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new me("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new me("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},ae.prototype.removeStyleSheet=function(){var te;this.styleSheet&&(((te=this.styleSheetRoot)!==null&&te!==void 0?te:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},ae}(),Ke=function(ae,te){this.selector=ae,this.style=te},me=function(ae,te){this.localName=ae,this.style=te},rt=function(){function ae(te,z,oe,ue,ne){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=te,this.displayMode=z,this.markerItems=oe,this.uiStyleSettings=ue,this.styles=ne,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return ae.prototype.show=function(te){var z=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=te,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var oe=document.createElement("div");oe.className=this.toolbarBlockStyleClass.name,oe.style.whiteSpace="nowrap",this.uiContainer.appendChild(oe),this.addActionButton(oe,'<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(oe,'<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(oe,'<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(oe,'<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(oe,'<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(oe,'<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(oe,'<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(oe,'<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(ne){var be=document.createElement("div");be.className=""+z.toolbarButtonStyleClass.name,be.setAttribute("data-type-name",ne.typeName),be.innerHTML=ne.icon,be.addEventListener("click",function(){z.markerToolbarButtonClicked(be,ne)}),z.buttons.push(be),z.markerButtons.push(be)}),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 ue=document.createElement("div");ue.className=this.toolbarBlockStyleClass.name,ue.style.whiteSpace="nowrap",ue.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ue),this.addActionButton(ue,'<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(ue,'<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()},ae.prototype.addButtonClickListener=function(te){this.buttonClickListeners.push(te)},ae.prototype.removeButtonClickListener=function(te){this.buttonClickListeners.indexOf(te)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(te),1)},ae.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},ae.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var te=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var z=0;z<this.markerButtons.length;z++)z<te||z===te&&this.markerButtons.length-1===te?this.markerButtonBlock.appendChild(this.markerButtons[z]):(z===te&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[z]))}},ae.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")},ae.prototype.resetButtonStyles=function(){var te=this;this.buttons.forEach(function(z){z.className=z.className.replace(te.uiStyleSettings.toolbarButtonStyleColorsClassName?te.uiStyleSettings.toolbarButtonStyleColorsClassName:te.toolbarButtonStyleColorsClass.name,"").trim(),z.className=z.className.replace(te.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?te.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:te.toolbarActiveButtonStyleColorsClass.name,"").trim(),z.className+=" "+(te.uiStyleSettings.toolbarButtonStyleColorsClassName?te.uiStyleSettings.toolbarButtonStyleColorsClassName:te.toolbarButtonStyleColorsClass.name)})},ae.prototype.addActionButton=function(te,z,oe){var ue=this,ne=document.createElement("div");switch(ne.className=""+this.toolbarButtonStyleClass.name,ne.innerHTML=z,ne.setAttribute("data-action",oe),ne.addEventListener("click",function(){ue.actionToolbarButtonClicked(ne,oe)}),oe){case"select":ne.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":ne.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":ne.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":ne.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":ne.style.fill=this.uiStyleSettings.closeButtonColor}te.appendChild(ne),this.buttons.push(ne)},ae.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new me("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 me("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new me("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new me("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 me("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var te=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new me("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*te)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*te)+`px;
padding: `+te+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new me("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new me("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ke("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Ke("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},ae.prototype.markerToolbarButtonClicked=function(te,z){this.setActiveButton(te),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(oe){return oe("marker",z)}),this.markerButtonOverflowBlock.style.display="none"},ae.prototype.actionToolbarButtonClicked=function(te,z){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(oe){return oe("action",z)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},ae.prototype.setActiveButton=function(te){this.resetButtonStyles(),te.className=te.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),te.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},ae.prototype.setActiveMarkerButton=function(te){var z=this.markerButtons.find(function(oe){return oe.getAttribute("data-type-name")===te});z&&this.setActiveButton(z)},ae.prototype.setCurrentMarker=function(te){var z=this;this.currentMarker=te,this.buttons.filter(function(oe){return/delete|notes/.test(oe.getAttribute("data-action"))}).forEach(function(oe){z.currentMarker===void 0?(oe.style.fillOpacity="0.4",oe.style.pointerEvents="none"):(oe.style.fillOpacity="1",oe.style.pointerEvents="all")})},ae}(),Ne=function(){function ae(te,z,oe,ue){this.panels=[],this.panelButtons=[],this.markerjsContainer=te,this.displayMode=z,this.uiStyleSettings=oe,this.styles=ue,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return ae.prototype.addStyles=function(){var te;this.toolboxStyleClass=this.styles.addClass(new me("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 me("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var z=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new me("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new me("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new me("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 me("toolbox-panel-row_colors",`
background-color: `+((te=this.uiStyleSettings.toolboxBackgroundColor)!==null&&te!==void 0?te:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new me("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*z)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*z)+`px;
padding: `+z+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new me("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new me("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ke("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ke("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},ae.prototype.show=function(te){var z;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=te,this.uiContainer.className=this.toolboxStyleClass.name+" "+((z=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&z!==void 0?z:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},ae.prototype.setPanelButtons=function(te){var z,oe,ue=this;this.panels=te,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((z=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&z!==void 0?z:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((oe=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&oe!==void 0?oe:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(ne){var be;ne.uiStyleSettings=ue.uiStyleSettings;var Ve=document.createElement("div");Ve.className=ue.toolboxButtonStyleClass.name+" "+((be=ue.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&be!==void 0?be:ue.toolboxButtonStyleColorsClass.name),Ve.innerHTML=ne.icon,Ve.title=ne.title,Ve.addEventListener("click",function(){ue.panelButtonClick(ne)}),ue.panelButtons.push(Ve),ue.buttonRow.appendChild(Ve)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},ae.prototype.panelButtonClick=function(te){var z=this,oe=-1;if(te!==this.activePanel){oe=this.panels.indexOf(te),this.panelRow.innerHTML="";var ue=te.getUi();ue.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ue),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=te}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){z.displayMode==="inline"?z.panelRow.style.display="none":z.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(ne,be){var Ve,Tt;ne.className=z.toolboxButtonStyleClass.name+" "+(be===oe?""+((Ve=z.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ve!==void 0?Ve:z.toolboxActiveButtonStyleColorsClass.name):""+((Tt=z.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Tt!==void 0?Tt:z.toolboxButtonStyleColorsClass.name))})},ae}(),De=function(ae,te){this.title=ae,this.icon=te},Le=function(ae){function te(z,oe,ue,ne){var be=ae.call(this,z,ne||'<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 be.colors=[],be.addTransparent=!1,be.colorBoxes=[],be.colors=oe,be.currentColor=ue,be.setCurrentColor=be.setCurrentColor.bind(be),be.getColorBox=be.getColorBox.bind(be),be}return et(te,ae),te.prototype.getUi=function(){var z=this,oe=document.createElement("div");return oe.style.overflow="hidden",oe.style.whiteSpace="nowrap",this.colors.forEach(function(ue){var ne=z.getColorBox(ue);oe.appendChild(ne),z.colorBoxes.push(ne)}),oe},te.prototype.getColorBox=function(z){var oe=this,ue=this.uiStyleSettings.toolbarHeight/4,ne=this.uiStyleSettings.toolbarHeight-ue,be=document.createElement("div");be.style.display="inline-block",be.style.boxSizing="content-box",be.style.width=ne-2+"px",be.style.height=ne-2+"px",be.style.padding="1px",be.style.marginRight="2px",be.style.marginBottom="2px",be.style.borderWidth="2px",be.style.borderStyle="solid",be.style.borderRadius=(ne+2)/2+"px",be.style.borderColor=z===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",be.addEventListener("click",function(){oe.setCurrentColor(z,be)});var Ve=document.createElement("div");return Ve.style.display="inline-block",Ve.style.width=ne-2+"px",Ve.style.height=ne-2+"px",Ve.style.backgroundColor=z,Ve.style.borderRadius=ne/2+"px",z==="transparent"&&(Ve.style.fill=this.uiStyleSettings.toolboxAccentColor,Ve.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>`),be.appendChild(Ve),be},te.prototype.setCurrentColor=function(z,oe){var ue=this;this.currentColor=z,this.colorBoxes.forEach(function(ne){ne.style.borderColor=ne===oe?ue.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(z)},te}(De),xe=function(){function ae(te,z,oe){this._state="new",this._isSelected=!1,this._container=te,this._overlayContainer=z,this.globalSettings=oe,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(ae.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),ae.prototype.ownsTarget=function(te){return!1},Object.defineProperty(ae.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),ae.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},ae.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},ae.prototype.pointerDown=function(te,z){},ae.prototype.dblClick=function(te,z){},ae.prototype.manipulate=function(te){},ae.prototype.pointerUp=function(te){this.stateChanged()},ae.prototype.dispose=function(){},ae.prototype.addMarkerVisualToContainer=function(te){this.container.childNodes.length>0?this.container.insertBefore(te,this.container.childNodes[0]):this.container.appendChild(te)},ae.prototype.getState=function(){return{typeName:ae.typeName,state:this.state,notes:this.notes}},ae.prototype.restoreState=function(te){this._state=te.state,this.notes=te.notes},ae.prototype.scale=function(te,z){},ae.prototype.colorChanged=function(te){this.onColorChanged&&this.onColorChanged(te),this.stateChanged()},ae.prototype.fillColorChanged=function(te){this.onFillColorChanged&&this.onFillColorChanged(te),this.stateChanged()},ae.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var te=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),te.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(te)&&this.onStateChanged(this)}},ae.typeName="MarkerBase",ae}(),Oe=function(){function ae(){this.findGripByVisual=this.findGripByVisual.bind(this)}return ae.prototype.findGripByVisual=function(te){return this.topLeft.ownsTarget(te)?this.topLeft:this.topCenter.ownsTarget(te)?this.topCenter:this.topRight.ownsTarget(te)?this.topRight:this.centerLeft.ownsTarget(te)?this.centerLeft:this.centerRight.ownsTarget(te)?this.centerRight:this.bottomLeft.ownsTarget(te)?this.bottomLeft:this.bottomCenter.ownsTarget(te)?this.bottomCenter:this.bottomRight.ownsTarget(te)?this.bottomRight:void 0},ae}(),Xe=function(){function ae(){this.GRIP_SIZE=10,this.visual=ge.createGroup(),this.visual.appendChild(ge.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ge.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return ae.prototype.ownsTarget=function(te){return te===this.visual||te===this.visual.childNodes[0]||te===this.visual.childNodes[1]},ae}(),Je=function(){function ae(){}return ae.toITransformMatrix=function(te){return{a:te.a,b:te.b,c:te.c,d:te.d,e:te.e,f:te.f}},ae.toSVGMatrix=function(te,z){return te.a=z.a,te.b=z.b,te.c=z.c,te.d=z.d,te.e=z.e,te.f=z.f,te},ae}(),st=function(ae){function te(z,oe,ue){var ne=ae.call(this,z,oe,ue)||this;return ne.left=0,ne.top=0,ne.width=0,ne.height=0,ne.defaultSize={x:50,y:20},ne.offsetX=0,ne.offsetY=0,ne.rotationAngle=0,ne.CB_DISTANCE=10,ne._suppressMarkerCreateEvent=!1,ne.container.transform.baseVal.appendItem(ge.createTransform()),ne.setupControlBox(),ne}return et(te,ae),Object.defineProperty(te.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(te.prototype,"visual",{get:function(){return this._visual},set:function(z){this._visual=z;var oe=ge.createTransform();this._visual.transform.baseVal.appendItem(oe)},enumerable:!1,configurable:!0}),te.prototype.ownsTarget=function(z){return!!ae.prototype.ownsTarget.call(this,z)||!!(this.controlGrips.findGripByVisual(z)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(z))},te.prototype.pointerDown=function(z,oe){ae.prototype.pointerDown.call(this,z,oe),this.state==="new"&&(this.left=z.x,this.top=z.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ue=this.unrotatePoint(z);if(this.manipulationStartX=ue.x,this.manipulationStartY=ue.y,this.offsetX=ue.x-this.left,this.offsetY=ue.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(oe),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(oe)){this.activeGrip=this.rotatorGrip;var ne=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=ne.x-this.width/2,this.top=ne.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var be=this.container.transform.baseVal.getItem(0);be.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(be,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},te.prototype.pointerUp=function(z){var oe=this.state;ae.prototype.pointerUp.call(this,z),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(z),this._state="select",oe==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},te.prototype.moveVisual=function(z){this.visual.style.transform="translate("+z.x+"px, "+z.y+"px)"},te.prototype.manipulate=function(z){var oe=this.unrotatePoint(z);this.state==="creating"?this.resize(z):this.state==="move"?(this.left=this.manipulationStartLeft+(oe.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(oe.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(oe):this.state==="rotate"&&this.rotate(z)},te.prototype.resize=function(z){var oe=this.manipulationStartLeft,ue=this.manipulationStartWidth,ne=this.manipulationStartTop,be=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:oe=this.manipulationStartLeft+z.x-this.manipulationStartX,ue=this.manipulationStartWidth+this.manipulationStartLeft-oe;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ue=this.manipulationStartWidth+z.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:ne=this.manipulationStartTop+z.y-this.manipulationStartY,be=this.manipulationStartHeight+this.manipulationStartTop-ne;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:be=this.manipulationStartHeight+z.y-this.manipulationStartY}ue>=0?(this.left=oe,this.width=ue):(this.left=oe+ue,this.width=-ue),be>=0?(this.top=ne,this.height=be):(this.top=ne+be,this.height=-be),this.setSize()},te.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},te.prototype.rotate=function(z){if(Math.abs(z.x-this.centerX)>.1){var oe=Math.sign(z.x-this.centerX);this.rotationAngle=180*Math.atan((z.y-this.centerY)/(z.x-this.centerX))/Math.PI+90*oe,this.applyRotation()}},te.prototype.applyRotation=function(){var z=this.container.transform.baseVal.getItem(0);z.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(z,0)},te.prototype.rotatePoint=function(z){if(this.rotationAngle===0)return z;var oe=this.container.getCTM(),ue=ge.createPoint(z.x,z.y);return{x:(ue=ue.matrixTransform(oe)).x,y:ue.y}},te.prototype.unrotatePoint=function(z){if(this.rotationAngle===0)return z;var oe=this.container.getCTM();oe=oe.inverse();var ue=ge.createPoint(z.x,z.y);return{x:(ue=ue.matrixTransform(oe)).x,y:ue.y}},te.prototype.select=function(){ae.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},te.prototype.deselect=function(){ae.prototype.deselect.call(this),this.controlBox.style.display="none"},te.prototype.setupControlBox=function(){this.controlBox=ge.createGroup();var z=ge.createTransform();z.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(z),this.container.appendChild(this.controlBox),this.controlRect=ge.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=ge.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 Oe,this.addControlGrips(),this.controlBox.style.display="none"},te.prototype.adjustControlBox=function(){var z=this.controlBox.transform.baseVal.getItem(0);z.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(z,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()},te.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()},te.prototype.createGrip=function(){var z=new Xe;return z.visual.transform.baseVal.appendItem(ge.createTransform()),this.controlBox.appendChild(z.visual),z},te.prototype.positionGrips=function(){var z=this.controlGrips.topLeft.GRIP_SIZE,oe=-z/2,ue=oe,ne=(this.width+this.CB_DISTANCE)/2-z/2,be=(this.height+this.CB_DISTANCE)/2-z/2,Ve=this.height+this.CB_DISTANCE-z/2,Tt=this.width+this.CB_DISTANCE-z/2;this.positionGrip(this.controlGrips.topLeft.visual,oe,ue),this.positionGrip(this.controlGrips.topCenter.visual,ne,ue),this.positionGrip(this.controlGrips.topRight.visual,Tt,ue),this.positionGrip(this.controlGrips.centerLeft.visual,oe,be),this.positionGrip(this.controlGrips.centerRight.visual,Tt,be),this.positionGrip(this.controlGrips.bottomLeft.visual,oe,Ve),this.positionGrip(this.controlGrips.bottomCenter.visual,ne,Ve),this.positionGrip(this.controlGrips.bottomRight.visual,Tt,Ve),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,ne,ue-3*this.CB_DISTANCE)},te.prototype.positionGrip=function(z,oe,ue){var ne=z.transform.baseVal.getItem(0);ne.setTranslate(oe,ue),z.transform.baseVal.replaceItem(ne,0)},te.prototype.hideControlBox=function(){this.controlBox.style.display="none"},te.prototype.showControlBox=function(){this.controlBox.style.display=""},te.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Je.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Je.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},ae.prototype.getState.call(this))},te.prototype.restoreState=function(z){ae.prototype.restoreState.call(this,z);var oe=z;this.left=oe.left,this.top=oe.top,this.width=oe.width,this.height=oe.height,this.rotationAngle=oe.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Je.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,oe.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Je.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,oe.containerTransformMatrix))},te.prototype.scale=function(z,oe){ae.prototype.scale.call(this,z,oe);var ue=this.rotatePoint({x:this.left,y:this.top}),ne=this.unrotatePoint({x:ue.x*z,y:ue.y*oe});this.left=ne.x,this.top=ne.y,this.width=this.width*z,this.height=this.height*oe,this.adjustControlBox()},te}(xe),$e=function(ae){function te(z,oe,ue){var ne=ae.call(this,z,oe,ue)||this;return ne.fillColor="transparent",ne.strokeColor="transparent",ne.strokeWidth=0,ne.strokeDasharray="",ne.opacity=1,ne.setStrokeColor=ne.setStrokeColor.bind(ne),ne.setFillColor=ne.setFillColor.bind(ne),ne.setStrokeWidth=ne.setStrokeWidth.bind(ne),ne.setStrokeDasharray=ne.setStrokeDasharray.bind(ne),ne.createVisual=ne.createVisual.bind(ne),ne}return et(te,ae),te.prototype.ownsTarget=function(z){return!(!ae.prototype.ownsTarget.call(this,z)&&z!==this.visual)},te.prototype.createVisual=function(){this.visual=ge.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)},te.prototype.pointerDown=function(z,oe){ae.prototype.pointerDown.call(this,z,oe),this.state==="new"&&(this.createVisual(),this.moveVisual(z),this._state="creating")},te.prototype.manipulate=function(z){ae.prototype.manipulate.call(this,z)},te.prototype.resize=function(z){ae.prototype.resize.call(this,z),this.setSize()},te.prototype.setSize=function(){ae.prototype.setSize.call(this),ge.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},te.prototype.pointerUp=function(z){ae.prototype.pointerUp.call(this,z),this.setSize()},te.prototype.setStrokeColor=function(z){this.strokeColor=z,this.visual&&ge.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(z),this.stateChanged()},te.prototype.setFillColor=function(z){this.fillColor=z,this.visual&&ge.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},te.prototype.setStrokeWidth=function(z){this.strokeWidth=z,this.visual&&ge.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},te.prototype.setStrokeDasharray=function(z){this.strokeDasharray=z,this.visual&&ge.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},te.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ae.prototype.getState.call(this))},te.prototype.restoreState=function(z){var oe=z;this.fillColor=oe.fillColor,this.strokeColor=oe.strokeColor,this.strokeWidth=oe.strokeWidth,this.strokeDasharray=oe.strokeDasharray,this.opacity=oe.opacity,this.createVisual(),ae.prototype.restoreState.call(this,z),this.setSize()},te.prototype.scale=function(z,oe){ae.prototype.scale.call(this,z,oe),this.setSize()},te.title="Rectangle marker",te}(st),lt=function(ae){function te(z,oe,ue,ne){var be=ae.call(this,z,ne||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return be.widths=[],be.widthBoxes=[],be.widths=oe,be.currentWidth=ue,be.setCurrentWidth=be.setCurrentWidth.bind(be),be}return et(te,ae),te.prototype.getUi=function(){var z=this,oe=document.createElement("div");return oe.style.display="flex",oe.style.overflow="hidden",oe.style.flexGrow="2",this.widths.forEach(function(ue){var ne=document.createElement("div");ne.style.display="flex",ne.style.flexGrow="2",ne.style.alignItems="center",ne.style.justifyContent="space-between",ne.style.padding="5px",ne.style.borderWidth="2px",ne.style.borderStyle="solid",ne.style.borderColor=ue===z.currentWidth?z.uiStyleSettings.toolboxAccentColor:"transparent",ne.addEventListener("click",function(){z.setCurrentWidth(ue,ne)}),oe.appendChild(ne);var be=document.createElement("div");be.innerText=ue.toString(),be.style.marginRight="5px",ne.appendChild(be);var Ve=document.createElement("div");Ve.style.minHeight="20px",Ve.style.flexGrow="2",Ve.style.display="flex",Ve.style.alignItems="center";var Tt=document.createElement("hr");Tt.style.minWidth="20px",Tt.style.border="0px",Tt.style.borderTop=ue+"px solid "+z.uiStyleSettings.toolboxColor,Tt.style.flexGrow="2",Ve.appendChild(Tt),ne.appendChild(Ve),z.widthBoxes.push(ne)}),oe},te.prototype.setCurrentWidth=function(z,oe){var ue=this;this.currentWidth=z,this.widthBoxes.forEach(function(ne){ne.style.borderColor=ne===oe?ue.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},te}(De),it=function(ae){function te(z,oe,ue,ne){var be=ae.call(this,z,ne||'<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 be.styles=[],be.styleBoxes=[],be.styles=oe,be.currentStyle=ue,be.setCurrentStyle=be.setCurrentStyle.bind(be),be}return et(te,ae),te.prototype.getUi=function(){var z=this,oe=document.createElement("div");return oe.style.display="flex",oe.style.overflow="hidden",oe.style.flexGrow="2",this.styles.forEach(function(ue){var ne=document.createElement("div");ne.style.display="flex",ne.style.alignItems="center",ne.style.justifyContent="space-between",ne.style.padding="5px",ne.style.borderWidth="2px",ne.style.borderStyle="solid",ne.style.overflow="hidden",ne.style.maxWidth=100/z.styles.length-5+"%",ne.style.borderColor=ue===z.currentStyle?z.uiStyleSettings.toolboxAccentColor:"transparent",ne.addEventListener("click",function(){z.setCurrentStyle(ue,ne)}),oe.appendChild(ne);var be=document.createElement("div");be.style.minHeight="20px",be.style.flexGrow="2",be.style.overflow="hidden";var Ve=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+z.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ue!==""?'stroke-dasharray="'+ue+'"':"")+` />
</svg>`;be.innerHTML=Ve,ne.appendChild(be),z.styleBoxes.push(ne)}),oe},te.prototype.setCurrentStyle=function(z,oe){var ue=this;this.currentStyle=z,this.styleBoxes.forEach(function(ne){ne.style.borderColor=ne===oe?ue.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},te}(De),Yt=function(ae){function te(z,oe,ue){var ne=ae.call(this,z,oe,ue)||this;return ne.strokeColor=ue.defaultColor,ne.strokeWidth=ue.defaultStrokeWidth,ne.strokeDasharray=ue.defaultStrokeDasharray,ne.strokePanel=new Le("Line color",ue.defaultColorSet,ue.defaultColor),ne.strokePanel.onColorChanged=ne.setStrokeColor,ne.strokeWidthPanel=new lt("Line width",ue.defaultStrokeWidths,ue.defaultStrokeWidth),ne.strokeWidthPanel.onWidthChanged=ne.setStrokeWidth,ne.strokeStylePanel=new it("Line style",ue.defaultStrokeDasharrays,ue.defaultStrokeDasharray),ne.strokeStylePanel.onStyleChanged=ne.setStrokeDasharray,ne}return et(te,ae),Object.defineProperty(te.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),te.prototype.getState=function(){var z=ae.prototype.getState.call(this);return z.typeName=te.typeName,z},te.typeName="FrameMarker",te.title="Frame marker",te.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',te}($e),Ye=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"},Ge=function(ae){function te(z,oe,ue){var ne=ae.call(this,z,oe,ue)||this;return ne.x1=0,ne.y1=0,ne.x2=0,ne.y2=0,ne.defaultLength=50,ne.manipulationStartX=0,ne.manipulationStartY=0,ne.manipulationStartX1=0,ne.manipulationStartY1=0,ne.manipulationStartX2=0,ne.manipulationStartY2=0,ne.setupControlBox(),ne}return et(te,ae),te.prototype.ownsTarget=function(z){return!!ae.prototype.ownsTarget.call(this,z)||!(!this.grip1.ownsTarget(z)&&!this.grip2.ownsTarget(z))},te.prototype.pointerDown=function(z,oe){ae.prototype.pointerDown.call(this,z,oe),this.manipulationStartX=z.x,this.manipulationStartY=z.y,this.state==="new"&&(this.x1=z.x,this.y1=z.y,this.x2=z.x,this.y2=z.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(oe)?this.activeGrip=this.grip1:this.grip2.ownsTarget(oe)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},te.prototype.pointerUp=function(z){var oe=this.state;ae.prototype.pointerUp.call(this,z),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(z),this._state="select",oe==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},te.prototype.adjustVisual=function(){},te.prototype.manipulate=function(z){this.state==="creating"?this.resize(z):this.state==="move"?(this.x1=this.manipulationStartX1+z.x-this.manipulationStartX,this.y1=this.manipulationStartY1+z.y-this.manipulationStartY,this.x2=this.manipulationStartX2+z.x-this.manipulationStartX,this.y2=this.manipulationStartY2+z.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(z)},te.prototype.resize=function(z){switch(this.activeGrip){case this.grip1:this.x1=z.x,this.y1=z.y;break;case this.grip2:case void 0:this.x2=z.x,this.y2=z.y}this.adjustVisual(),this.adjustControlBox()},te.prototype.select=function(){ae.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},te.prototype.deselect=function(){ae.prototype.deselect.call(this),this.controlBox.style.display="none"},te.prototype.setupControlBox=function(){this.controlBox=ge.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},te.prototype.adjustControlBox=function(){this.positionGrips()},te.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},te.prototype.createGrip=function(){var z=new Xe;return z.visual.transform.baseVal.appendItem(ge.createTransform()),this.controlBox.appendChild(z.visual),z},te.prototype.positionGrips=function(){var z=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-z/2,this.y1-z/2),this.positionGrip(this.grip2.visual,this.x2-z/2,this.y2-z/2)},te.prototype.positionGrip=function(z,oe,ue){var ne=z.transform.baseVal.getItem(0);ne.setTranslate(oe,ue),z.transform.baseVal.replaceItem(ne,0)},te.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},ae.prototype.getState.call(this))},te.prototype.restoreState=function(z){ae.prototype.restoreState.call(this,z);var oe=z;this.x1=oe.x1,this.y1=oe.y1,this.x2=oe.x2,this.y2=oe.y2},te.prototype.scale=function(z,oe){ae.prototype.scale.call(this,z,oe),this.x1=this.x1*z,this.y1=this.y1*oe,this.x2=this.x2*z,this.y2=this.y2*oe,this.adjustVisual(),this.adjustControlBox()},te}(xe),mt=function(ae){function te(z,oe,ue){var ne=ae.call(this,z,oe,ue)||this;return ne.strokeColor="transparent",ne.strokeWidth=0,ne.strokeDasharray="",ne.setStrokeColor=ne.setStrokeColor.bind(ne),ne.setStrokeWidth=ne.setStrokeWidth.bind(ne),ne.setStrokeDasharray=ne.setStrokeDasharray.bind(ne),ne.strokeColor=ue.defaultColor,ne.strokeWidth=ue.defaultStrokeWidth,ne.strokeDasharray=ue.defaultStrokeDasharray,ne.strokePanel=new Le("Line color",ue.defaultColorSet,ue.defaultColor),ne.strokePanel.onColorChanged=ne.setStrokeColor,ne.strokeWidthPanel=new lt("Line width",ue.defaultStrokeWidths,ue.defaultStrokeWidth),ne.strokeWidthPanel.onWidthChanged=ne.setStrokeWidth,ne.strokeStylePanel=new it("Line style",ue.defaultStrokeDasharrays,ue.defaultStrokeDasharray),ne.strokeStylePanel.onStyleChanged=ne.setStrokeDasharray,ne}return et(te,ae),te.prototype.ownsTarget=function(z){return!(!ae.prototype.ownsTarget.call(this,z)&&z!==this.visual&&z!==this.selectorLine&&z!==this.visibleLine)},te.prototype.createVisual=function(){this.visual=ge.createGroup(),this.selectorLine=ge.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ge.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)},te.prototype.pointerDown=function(z,oe){ae.prototype.pointerDown.call(this,z,oe),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},te.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()),ge.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ge.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ge.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},te.prototype.setStrokeColor=function(z){this.strokeColor=z,this.adjustVisual(),this.colorChanged(z)},te.prototype.setStrokeWidth=function(z){this.strokeWidth=z,this.adjustVisual()},te.prototype.setStrokeDasharray=function(z){this.strokeDasharray=z,this.adjustVisual(),this.stateChanged()},Object.defineProperty(te.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),te.prototype.getState=function(){var z=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},ae.prototype.getState.call(this));return z.typeName=te.typeName,z},te.prototype.restoreState=function(z){ae.prototype.restoreState.call(this,z);var oe=z;this.strokeColor=oe.strokeColor,this.strokeWidth=oe.strokeWidth,this.strokeDasharray=oe.strokeDasharray,this.createVisual(),this.adjustVisual()},te.typeName="LineMarker",te.title="Line marker",te.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',te}(Ge),Te=function(ae){function te(z,oe,ue,ne){var be=ae.call(this,z,ne||'<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 be.fonts=[],be.fontBoxes=[],be.fonts=oe,be.currentFont=ue,be.setCurrentFont=be.setCurrentFont.bind(be),be}return et(te,ae),te.prototype.getUi=function(){var z=this,oe=document.createElement("div");return oe.style.overflow="hidden",oe.style.flexGrow="2",this.fonts.forEach(function(ue){var ne=document.createElement("div");ne.style.display="inline-block",ne.style.alignItems="center",ne.style.justifyContent="space-between",ne.style.padding="5px",ne.style.borderWidth="2px",ne.style.borderStyle="solid",ne.style.overflow="hidden",ne.style.maxWidth=100/z.fonts.length-5+"%",ne.style.borderColor=ue===z.currentFont?z.uiStyleSettings.toolboxAccentColor:"transparent",ne.addEventListener("click",function(){z.setCurrentFont(ue,ne)}),oe.appendChild(ne);var be=document.createElement("div");be.style.display="flex",be.style.minHeight="20px",be.style.flexGrow="2",be.style.fontFamily=ue,be.style.overflow="hidden";var Ve=document.createElement("div");Ve.style.whiteSpace="nowrap",Ve.style.overflow="hidden",Ve.style.textOverflow="ellipsis",Ve.innerHTML="The quick brown fox jumps over the lazy dog",be.appendChild(Ve),ne.appendChild(be),z.fontBoxes.push(ne)}),oe},te.prototype.setCurrentFont=function(z,oe){var ue=this;this.currentFont=z,this.fontBoxes.forEach(function(ne){ne.style.borderColor=ne===oe?ue.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},te}(De),Qe=function(ae){function te(z,oe,ue){var ne=ae.call(this,z,oe,ue)||this;return ne.color="transparent",ne.padding=5,ne.DEFAULT_TEXT="\u8BF7\u8F93\u5165\u6587\u672C",ne.text=ne.DEFAULT_TEXT,ne.isMoved=!1,ne.color=ue.defaultColor,ne.fontFamily=ue.defaultFontFamily,ne.defaultSize={x:100,y:30},ne.setColor=ne.setColor.bind(ne),ne.setFont=ne.setFont.bind(ne),ne.renderText=ne.renderText.bind(ne),ne.sizeText=ne.sizeText.bind(ne),ne.textEditDivClicked=ne.textEditDivClicked.bind(ne),ne.showTextEditor=ne.showTextEditor.bind(ne),ne.setSize=ne.setSize.bind(ne),ne.positionTextEditor=ne.positionTextEditor.bind(ne),ne.colorPanel=new Le("Color",ue.defaultColorSet,ue.defaultColor),ne.colorPanel.onColorChanged=ne.setColor,ne.fontFamilyPanel=new Te("Font",ue.defaultFontFamilies,ue.defaultFontFamily),ne.fontFamilyPanel.onFontChanged=ne.setFont,ne}return et(te,ae),te.prototype.ownsTarget=function(z){if(ae.prototype.ownsTarget.call(this,z)||z===this.visual||z===this.textElement||z===this.bgRectangle)return!0;var oe=!1;return this.textElement.childNodes.forEach(function(ue){ue===z&&(oe=!0)}),oe},te.prototype.createVisual=function(){this.visual=ge.createGroup(),this.bgRectangle=ge.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ge.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ge.createTransform()),this.textElement.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},te.prototype.pointerDown=function(z,oe){ae.prototype.pointerDown.call(this,z,oe),this.isMoved=!1,this.pointerDownPoint=z,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(z),this._state="creating")},te.prototype.renderText=function(){var z=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(oe){z.textElement.appendChild(ge.createTSpan(oe.trim()===""?" ":oe.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},te.prototype.getTextScale=function(){var z=this.textElement.getBBox(),oe=1;if(z.width>0&&z.height>0){var ue=(1*this.width-this.width*this.padding*2/100)/z.width,ne=(1*this.height-this.height*this.padding*2/100)/z.height;oe=Math.min(ue,ne)}return oe},te.prototype.getTextPosition=function(z){var oe=this.textElement.getBBox(),ue=0,ne=0;return oe.width>0&&oe.height>0&&(ue=(this.width-oe.width*z)/2,ne=this.height/2-oe.height*z/2),{x:ue,y:ne}},te.prototype.sizeText=function(){var z=this.textElement.getBBox(),oe=this.getTextScale(),ue=this.getTextPosition(oe);ue.y-=z.y*oe,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ue.x+"px, "+ue.y+"px) scale("+oe+", "+oe+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ue.x,ue.y),this.textElement.transform.baseVal.getItem(1).setScale(oe,oe))},te.prototype.manipulate=function(z){ae.prototype.manipulate.call(this,z),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(z.x-this.pointerDownPoint.x)>5||Math.abs(z.y-this.pointerDownPoint.y)>5)},te.prototype.resize=function(z){ae.prototype.resize.call(this,z),this.isMoved=!0,this.setSize(),this.sizeText()},te.prototype.setSize=function(){ae.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ge.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ge.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},te.prototype.pointerUp=function(z){var oe=this.state;oe==="creating"&&(this._suppressMarkerCreateEvent=!0),ae.prototype.pointerUp.call(this,z),this.setSize(),(oe==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},te.prototype.showTextEditor=function(){var z=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(oe){oe.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var oe=Number.parseFloat(z.textEditor.style.fontSize);z.textEditor.clientWidth>=Number.parseInt(z.textEditor.style.maxWidth)&&oe>.9;)oe-=.1,z.textEditor.style.fontSize=Math.max(oe,.9)+"em"}),this.textEditor.addEventListener("keyup",function(oe){oe.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(oe){if(oe.clipboardData){var ue=oe.clipboardData.getData("text"),ne=window.getSelection();if(!ne.rangeCount)return!1;ne.deleteFromDocument(),ne.getRangeAt(0).insertNode(document.createTextNode(ue)),oe.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){z.textEditDivClicked(z.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},te.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var z=this.getTextScale(),oe=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ue=this.textElement.getBBox(),ne={x:ue.width*z,y:ue.height*z};oe.x-=ne.x/2,oe.y-=ne.y/2,this.textEditor.style.top=oe.y+"px",this.textEditor.style.left=oe.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-oe.x+"px",this.textEditor.style.fontSize=Math.max(16*z,12)+"px",this.textElement.style.display="none"}},te.prototype.textEditDivClicked=function(z){this.text=z.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},te.prototype.select=function(){ae.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},te.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),ae.prototype.deselect.call(this)},te.prototype.dblClick=function(z,oe){ae.prototype.dblClick.call(this,z,oe),this.showTextEditor()},te.prototype.setColor=function(z){this.textElement&&ge.setAttributes(this.textElement,[["fill",z]]),this.color=z,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(z)},te.prototype.setFont=function(z){this.textElement&&ge.setAttributes(this.textElement,[["font-family",z]]),this.fontFamily=z,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},te.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},te.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(te.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),te.prototype.getState=function(){var z=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},ae.prototype.getState.call(this));return z.typeName=te.typeName,z},te.prototype.restoreState=function(z){var oe=z;this.color=oe.color,this.fontFamily=oe.fontFamily,this.padding=oe.padding,this.text=oe.text,this.createVisual(),ae.prototype.restoreState.call(this,z),this.setSize()},te.prototype.scale=function(z,oe){ae.prototype.scale.call(this,z,oe),this.setSize(),this.sizeText(),this.positionTextEditor()},te.typeName="TextMarker",te.title="Text marker",te.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>',te}(st),Pe=function(ae){function te(z,oe,ue){var ne=ae.call(this,z,oe,ue)||this;return ne.color="transparent",ne.lineWidth=3,ne.drawing=!1,ne.pixelRatio=1,ne.color=ue.defaultColor,ne.lineWidth=ue.defaultStrokeWidth,ne.pixelRatio=ue.freehandPixelRatio,ne.setColor=ne.setColor.bind(ne),ne.addCanvas=ne.addCanvas.bind(ne),ne.finishCreation=ne.finishCreation.bind(ne),ne.setLineWidth=ne.setLineWidth.bind(ne),ne.colorPanel=new Le("Color",ue.defaultColorSet,ue.defaultColor),ne.colorPanel.onColorChanged=ne.setColor,ne.lineWidthPanel=new lt("Line width",ue.defaultStrokeWidths,ue.defaultStrokeWidth),ne.lineWidthPanel.onWidthChanged=ne.setLineWidth,ne}return et(te,ae),te.prototype.ownsTarget=function(z){return!(!ae.prototype.ownsTarget.call(this,z)&&z!==this.visual&&z!==this.drawingImage)},te.prototype.createVisual=function(){this.visual=ge.createGroup(),this.drawingImage=ge.createImage(),this.visual.appendChild(this.drawingImage);var z=ge.createTransform();this.visual.transform.baseVal.appendItem(z),this.addMarkerVisualToContainer(this.visual)},te.prototype.pointerDown=function(z,oe){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(z.x,z.y),this.drawing=!0):ae.prototype.pointerDown.call(this,z,oe)},te.prototype.manipulate=function(z){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(z.x,z.y),this.canvasContext.stroke()):ae.prototype.manipulate.call(this,z)},te.prototype.resize=function(z){ae.prototype.resize.call(this,z),ge.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ge.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},te.prototype.pointerUp=function(z){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):ae.prototype.pointerUp.call(this,z)},te.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)},te.prototype.select=function(){this.state==="creating"&&this.finishCreation(),ae.prototype.select.call(this)},te.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),ae.prototype.deselect.call(this)},te.prototype.finishCreation=function(){for(var z=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),oe=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ue=oe[0],ne=oe[1],be=oe[2],Ve=oe[3],Tt=!1,bt=0;bt<this.canvasElement.height;bt++)for(var ft=0;ft<this.canvasElement.width;ft++)z.data[bt*this.canvasElement.width*4+4*ft+3]>0&&(Tt=!0,bt<ne&&(ne=bt),ft<ue&&(ue=ft),bt>Ve&&(Ve=bt),ft>be&&(be=ft));if(Tt){this.left=ue/this.pixelRatio,this.top=ne/this.pixelRatio,this.width=(be-ue)/this.pixelRatio,this.height=(Ve-ne)/this.pixelRatio;var yt=document.createElement("canvas");yt.width=be-ue,yt.height=Ve-ne,yt.getContext("2d").putImageData(this.canvasContext.getImageData(ue,ne,be-ue,Ve-ne),0,0),this.drawingImgUrl=yt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},te.prototype.setDrawingImage=function(){ge.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ge.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},te.prototype.setColor=function(z){this.color=z,this.colorChanged(z)},te.prototype.setLineWidth=function(z){this.lineWidth=z},Object.defineProperty(te.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),te.prototype.getState=function(){var z=Object.assign({drawingImgUrl:this.drawingImgUrl},ae.prototype.getState.call(this));return z.typeName=te.typeName,z},te.prototype.restoreState=function(z){this.createVisual(),ae.prototype.restoreState.call(this,z),this.drawingImgUrl=z.drawingImgUrl,this.setDrawingImage()},te.prototype.scale=function(z,oe){ae.prototype.scale.call(this,z,oe),this.setDrawingImage()},te.typeName="FreehandMarker",te.title="Freehand marker",te.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>',te}(st),ot=function(ae){function te(z,oe,ue){var ne=ae.call(this,z,ue||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return ne.typeBoxes=[],ne.currentType=oe,ne.setCurrentType=ne.setCurrentType.bind(ne),ne}return et(te,ae),te.prototype.getUi=function(){var z=this,oe=document.createElement("div");oe.style.display="flex",oe.style.overflow="hidden",oe.style.flexGrow="2";for(var ue=function(Ve){var Tt="both";switch(Ve){case 0:Tt="both";break;case 1:Tt="start";break;case 2:Tt="end";break;case 3:Tt="none"}var bt=document.createElement("div");if(bt.style.display="flex",bt.style.flexGrow="2",bt.style.alignItems="center",bt.style.justifyContent="space-between",bt.style.padding="5px",bt.style.borderWidth="2px",bt.style.borderStyle="solid",bt.style.borderColor=Tt===ne.currentType?ne.uiStyleSettings.toolboxAccentColor:"transparent",bt.addEventListener("click",function(){z.setCurrentType(Tt,bt)}),oe.appendChild(bt),Tt==="both"||Tt==="start"){var ft=document.createElement("div");ft.style.display="flex",ft.style.alignItems="center",ft.style.minHeight="20px",ft.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="`+(ne.uiStyleSettings!==void 0?ne.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,ft.style.marginLeft="5px",bt.appendChild(ft)}var yt=document.createElement("div");yt.style.display="flex",yt.style.alignItems="center",yt.style.minHeight="20px",yt.style.flexGrow="2";var Vt=document.createElement("hr");if(Vt.style.minWidth="20px",Vt.style.border="0px",Vt.style.borderTop="3px solid "+(ne.uiStyleSettings!==void 0?ne.uiStyleSettings.toolboxColor:"#eeeeee"),Vt.style.flexGrow="2",yt.appendChild(Vt),bt.appendChild(yt),Tt==="both"||Tt==="end"){var Wt=document.createElement("div");Wt.style.display="flex",Wt.style.alignItems="center",Wt.style.minHeight="20px",Wt.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="`+(ne.uiStyleSettings!==void 0?ne.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Wt.style.marginRight="5px",bt.appendChild(Wt)}ne.typeBoxes.push(bt)},ne=this,be=0;be<4;be++)ue(be);return oe},te.prototype.setCurrentType=function(z,oe){var ue=this;this.currentType=z,this.typeBoxes.forEach(function(ne){ne.style.borderColor=ne===oe?ue.uiStyleSettings!==void 0?ue.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},te}(De),$t=function(ae){function te(z,oe,ue){var ne=ae.call(this,z,oe,ue)||this;return ne.arrowType="end",ne.arrowBaseHeight=10,ne.arrowBaseWidth=10,ne.getArrowPoints=ne.getArrowPoints.bind(ne),ne.setArrowType=ne.setArrowType.bind(ne),ne.arrowTypePanel=new ot("Arrow type","end"),ne.arrowTypePanel.onArrowTypeChanged=ne.setArrowType,ne}return et(te,ae),te.prototype.ownsTarget=function(z){return!(!ae.prototype.ownsTarget.call(this,z)&&z!==this.arrow1&&z!==this.arrow2)},te.prototype.getArrowPoints=function(z,oe){var ue=this.arrowBaseWidth+2*this.strokeWidth,ne=this.arrowBaseHeight+2*this.strokeWidth;return z-ue/2+","+(oe+ne/2)+" "+z+","+(oe-ne/2)+" "+(z+ue/2)+","+(oe+ne/2)},te.prototype.createTips=function(){this.arrow1=ge.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ge.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.arrow2)},te.prototype.pointerDown=function(z,oe){ae.prototype.pointerDown.call(this,z,oe),this.state==="creating"&&this.createTips()},te.prototype.adjustVisual=function(){if(ae.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",ge.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ge.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var z=0;Math.abs(this.x1-this.x2)>.1&&(z=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var oe=this.arrow1.transform.baseVal.getItem(0);oe.setRotate(z,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(oe,0);var ue=this.arrow2.transform.baseVal.getItem(0);ue.setRotate(z+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ue,0)}},te.prototype.setArrowType=function(z){this.arrowType=z,this.adjustVisual(),this.stateChanged()},Object.defineProperty(te.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),te.prototype.getState=function(){var z=Object.assign({arrowType:this.arrowType},ae.prototype.getState.call(this));return z.typeName=te.typeName,z},te.prototype.restoreState=function(z){ae.prototype.restoreState.call(this,z);var oe=z;this.arrowType=oe.arrowType,this.createTips(),this.adjustVisual()},te.typeName="ArrowMarker",te.title="Arrow marker",te.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',te}(mt),wt=function(ae){function te(z,oe,ue){var ne=ae.call(this,z,oe,ue)||this;return ne.fillColor=ue.defaultFillColor,ne.strokeWidth=0,ne.fillPanel=new Le("Color",ue.defaultColorSet,ue.defaultFillColor),ne.fillPanel.onColorChanged=ne.setFillColor,ne}return et(te,ae),Object.defineProperty(te.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),te.prototype.getState=function(){var z=ae.prototype.getState.call(this);return z.typeName=te.typeName,z},te.typeName="CoverMarker",te.title="Cover marker",te.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',te}($e),pn=function(ae){function te(z,oe,ue,ne){var be=ae.call(this,z,ne||'<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 be.opacities=[],be.opacityBoxes=[],be.opacities=oe,be.currentOpacity=ue,be.setCurrentOpacity=be.setCurrentOpacity.bind(be),be}return et(te,ae),te.prototype.getUi=function(){var z=this,oe=document.createElement("div");return oe.style.display="flex",oe.style.overflow="hidden",oe.style.flexGrow="2",oe.style.justifyContent="space-between",this.opacities.forEach(function(ue){var ne=document.createElement("div");ne.style.display="flex",ne.style.alignItems="center",ne.style.justifyContent="center",ne.style.padding="5px",ne.style.borderWidth="2px",ne.style.borderStyle="solid",ne.style.borderColor=ue===z.currentOpacity?z.uiStyleSettings.toolboxAccentColor:"transparent",ne.addEventListener("click",function(){z.setCurrentOpacity(ue,ne)}),oe.appendChild(ne);var be=document.createElement("div");be.innerText=100*ue+"%",ne.appendChild(be),z.opacityBoxes.push(ne)}),oe},te.prototype.setCurrentOpacity=function(z,oe){var ue=this;this.currentOpacity=z,this.opacityBoxes.forEach(function(ne){ne.style.borderColor=ne===oe?ue.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},te}(De),Ot=function(ae){function te(z,oe,ue){var ne=ae.call(this,z,oe,ue)||this;return ne.setOpacity=ne.setOpacity.bind(ne),ne.fillColor=ue.defaultHighlightColor,ne.strokeWidth=0,ne.opacity=ue.defaultHighlightOpacity,ne.fillPanel=new Le("Color",ue.defaultColorSet,ne.fillColor),ne.fillPanel.onColorChanged=ne.setFillColor,ne.opacityPanel=new pn("Opacity",ue.defaultOpacitySteps,ne.opacity),ne.opacityPanel.onOpacityChanged=ne.setOpacity,ne}return et(te,ae),te.prototype.setOpacity=function(z){this.opacity=z,this.visual&&ge.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(te.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),te.prototype.getState=function(){var z=ae.prototype.getState.call(this);return z.typeName=te.typeName,z},te.typeName="HighlightMarker",te.title="Highlight marker",te.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>',te}(wt),ve='<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>',de='<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>',ut=function(ae){function te(z,oe,ue){var ne=ae.call(this,z,oe,ue)||this;return ne.bgColor="transparent",ne.tipPosition={x:0,y:0},ne.tipBase1Position={x:0,y:0},ne.tipBase2Position={x:0,y:0},ne.tipMoving=!1,ne.color=ue.defaultStrokeColor,ne.bgColor=ue.defaultFillColor,ne.fontFamily=ue.defaultFontFamily,ne.defaultSize={x:100,y:30},ne.setBgColor=ne.setBgColor.bind(ne),ne.getTipPoints=ne.getTipPoints.bind(ne),ne.positionTip=ne.positionTip.bind(ne),ne.setTipPoints=ne.setTipPoints.bind(ne),ne.colorPanel=new Le("Text color",ue.defaultColorSet,ne.color,ve),ne.colorPanel.onColorChanged=ne.setColor,ne.bgColorPanel=new Le("Fill color",ue.defaultColorSet,ne.bgColor,de),ne.bgColorPanel.onColorChanged=ne.setBgColor,ne.fontFamilyPanel=new Te("Font",ue.defaultFontFamilies,ue.defaultFontFamily),ne.fontFamilyPanel.onFontChanged=ne.setFont,ne.tipGrip=new Xe,ne.tipGrip.visual.transform.baseVal.appendItem(ge.createTransform()),ne.controlBox.appendChild(ne.tipGrip.visual),ne}return et(te,ae),te.prototype.ownsTarget=function(z){return ae.prototype.ownsTarget.call(this,z)||this.tipGrip.ownsTarget(z)||this.tip===z},te.prototype.createTip=function(){ge.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ge.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},te.prototype.pointerDown=function(z,oe){this.state==="new"&&ae.prototype.pointerDown.call(this,z,oe),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(oe)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):ae.prototype.pointerDown.call(this,z,oe)},te.prototype.pointerUp=function(z){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,ae.prototype.pointerUp.call(this,z);else{var oe=this.state==="creating";ae.prototype.pointerUp.call(this,z),this.setTipPoints(oe),this.positionTip()}},te.prototype.manipulate=function(z){if(this.tipMoving){var oe=this.unrotatePoint(z);this.tipPosition={x:oe.x-this.manipulationStartLeft,y:oe.y-this.manipulationStartTop},this.positionTip()}else ae.prototype.manipulate.call(this,z)},te.prototype.setBgColor=function(z){this.bgRectangle&&this.tip&&(ge.setAttributes(this.bgRectangle,[["fill",z]]),ge.setAttributes(this.tip,[["fill",z]])),this.bgColor=z,this.fillColorChanged(z)},te.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},te.prototype.setTipPoints=function(z){z===void 0&&(z=!1);var oe=Math.min(this.height/2,15),ue=this.height/5;z&&(this.tipPosition={x:oe+ue/2,y:this.height+20});var ne=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?ne<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ue=this.width/5,oe=Math.min(this.width/2,15),this.tipBase1Position={x:oe,y:0},this.tipBase2Position={x:oe+ue,y:0}):(this.tipBase1Position={x:0,y:oe},this.tipBase2Position={x:0,y:oe+ue}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?ne<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ue=this.width/5,oe=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-oe-ue,y:0},this.tipBase2Position={x:this.width-oe,y:0}):(this.tipBase1Position={x:this.width,y:oe},this.tipBase2Position={x:this.width,y:oe+ue}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?ne<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ue=this.width/5,oe=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-oe-ue,y:this.height},this.tipBase2Position={x:this.width-oe,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-oe-ue},this.tipBase2Position={x:this.width,y:this.height-oe}):ne<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ue=this.width/5,oe=Math.min(this.width/2,15),this.tipBase1Position={x:oe,y:this.height},this.tipBase2Position={x:oe+ue,y:this.height}):(this.tipBase1Position={x:0,y:this.height-oe},this.tipBase2Position={x:0,y:this.height-oe-ue})},te.prototype.resize=function(z){ae.prototype.resize.call(this,z),this.positionTip()},te.prototype.positionTip=function(){ge.setAttributes(this.tip,[["points",this.getTipPoints()]]);var z=this.tipGrip.visual.transform.baseVal.getItem(0);z.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(z,0)},Object.defineProperty(te.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),te.prototype.select=function(){this.positionTip(),ae.prototype.select.call(this)},te.prototype.getState=function(){var z=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},ae.prototype.getState.call(this));return z.typeName=te.typeName,z},te.prototype.restoreState=function(z){var oe=z;this.bgColor=oe.bgColor,this.tipPosition=oe.tipPosition,ae.prototype.restoreState.call(this,z),this.createTip(),this.setTipPoints()},te.prototype.scale=function(z,oe){ae.prototype.scale.call(this,z,oe),this.tipPosition={x:this.tipPosition.x*z,y:this.tipPosition.y*oe},this.positionTip()},te.typeName="CalloutMarker",te.title="Callout marker",te.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>',te}(Qe),Jt=function(ae){function te(z,oe,ue){var ne=ae.call(this,z,oe,ue)||this;return ne.fillColor="transparent",ne.strokeColor="transparent",ne.strokeWidth=0,ne.strokeDasharray="",ne.opacity=1,ne.strokeColor=ue.defaultColor,ne.strokeWidth=ue.defaultStrokeWidth,ne.strokeDasharray=ue.defaultStrokeDasharray,ne.fillColor=ue.defaultFillColor,ne.setStrokeColor=ne.setStrokeColor.bind(ne),ne.setFillColor=ne.setFillColor.bind(ne),ne.setStrokeWidth=ne.setStrokeWidth.bind(ne),ne.setStrokeDasharray=ne.setStrokeDasharray.bind(ne),ne.setOpacity=ne.setOpacity.bind(ne),ne.createVisual=ne.createVisual.bind(ne),ne.strokePanel=new Le("Line color",pe(ue.defaultColorSet,["transparent"]),ue.defaultColor),ne.strokePanel.onColorChanged=ne.setStrokeColor,ne.fillPanel=new Le("Fill color",pe(ue.defaultColorSet,["transparent"]),ne.fillColor,de),ne.fillPanel.onColorChanged=ne.setFillColor,ne.strokeWidthPanel=new lt("Line width",ue.defaultStrokeWidths,ue.defaultStrokeWidth),ne.strokeWidthPanel.onWidthChanged=ne.setStrokeWidth,ne.strokeStylePanel=new it("Line style",ue.defaultStrokeDasharrays,ue.defaultStrokeDasharray),ne.strokeStylePanel.onStyleChanged=ne.setStrokeDasharray,ne.opacityPanel=new pn("Opacity",ue.defaultOpacitySteps,ne.opacity),ne.opacityPanel.onOpacityChanged=ne.setOpacity,ne}return et(te,ae),te.prototype.ownsTarget=function(z){return!(!ae.prototype.ownsTarget.call(this,z)&&z!==this.visual)},te.prototype.createVisual=function(){this.visual=ge.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)},te.prototype.pointerDown=function(z,oe){ae.prototype.pointerDown.call(this,z,oe),this.state==="new"&&(this.createVisual(),this.moveVisual(z),this._state="creating")},te.prototype.manipulate=function(z){ae.prototype.manipulate.call(this,z)},te.prototype.resize=function(z){ae.prototype.resize.call(this,z),this.setSize()},te.prototype.setSize=function(){ae.prototype.setSize.call(this),ge.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},te.prototype.pointerUp=function(z){ae.prototype.pointerUp.call(this,z),this.setSize()},te.prototype.setStrokeColor=function(z){this.strokeColor=z,this.visual&&ge.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(z),this.stateChanged()},te.prototype.setFillColor=function(z){this.fillColor=z,this.visual&&ge.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(z),this.stateChanged()},te.prototype.setStrokeWidth=function(z){this.strokeWidth=z,this.visual&&ge.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},te.prototype.setStrokeDasharray=function(z){this.strokeDasharray=z,this.visual&&ge.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},te.prototype.setOpacity=function(z){this.opacity=z,this.visual&&ge.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(te.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),te.prototype.getState=function(){var z=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},ae.prototype.getState.call(this));return z.typeName=te.typeName,z},te.prototype.restoreState=function(z){var oe=z;this.fillColor=oe.fillColor,this.strokeColor=oe.strokeColor,this.strokeWidth=oe.strokeWidth,this.strokeDasharray=oe.strokeDasharray,this.opacity=oe.opacity,this.createVisual(),ae.prototype.restoreState.call(this,z),this.setSize()},te.prototype.scale=function(z,oe){ae.prototype.scale.call(this,z,oe),this.setSize()},te.typeName="EllipseMarker",te.title="Ellipse marker",te.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>',te}(st),Ct=function(ae){function te(z,oe,ue){return ae.call(this,z,oe,ue)||this}return et(te,ae),Object.defineProperty(te.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),te.prototype.ownsTarget=function(z){return!(!ae.prototype.ownsTarget.call(this,z)&&z!==this.tip1&&z!==this.tip2)},te.prototype.createTips=function(){this.tip1=ge.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(ge.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ge.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(ge.createTransform()),this.visual.appendChild(this.tip2)},te.prototype.pointerDown=function(z,oe){ae.prototype.pointerDown.call(this,z,oe),this.state==="creating"&&this.createTips()},te.prototype.adjustVisual=function(){if(ae.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ge.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()]]),ge.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 z=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),oe=this.tip1.transform.baseVal.getItem(0);oe.setRotate(z,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(oe,0);var ue=this.tip2.transform.baseVal.getItem(0);ue.setRotate(z+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ue,0)}},Object.defineProperty(te.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),te.prototype.getState=function(){var z=ae.prototype.getState.call(this);return z.typeName=te.typeName,z},te.prototype.restoreState=function(z){ae.prototype.restoreState.call(this,z),this.createTips(),this.adjustVisual()},te.typeName="MeasurementMarker",te.title="Measurement marker",te.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>',te}(mt),Be=function(ae){function te(z,oe,ue){var ne=ae.call(this,z,oe,ue)||this;return ne.strokePanel.colors=ue.defaultColorSet,ne.fillColor="transparent",ne}return et(te,ae),Object.defineProperty(te.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),te.prototype.getState=function(){var z=ae.prototype.getState.call(this);return z.typeName=te.typeName,z},te.typeName="EllipseFrameMarker",te.title="Ellipse frame marker",te.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>',te}(Jt),tt=function(){function ae(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(ae.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),ae.prototype.addUndoStep=function(te){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(te)||(this.undoStack.push(te),JSON.stringify(this.lastRedoStep)!==JSON.stringify(te)&&this.redoStack.splice(0,this.redoStack.length))},ae.prototype.replaceLastUndoStep=function(te){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=te)},ae.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},ae.prototype.undo=function(){if(this.undoStack.length>1){var te=this.undoStack.pop();return te!==void 0&&this.redoStack.push(te),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},ae.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},ae}(),at=function(ae){function te(z,oe,ue){var ne=ae.call(this,z,oe,ue)||this;return ne.strokeColor="transparent",ne.strokeWidth=0,ne.strokeDasharray="",ne.curveX=0,ne.curveY=0,ne.manipulationStartCurveX=0,ne.manipulationStartCurveY=0,ne.setStrokeColor=ne.setStrokeColor.bind(ne),ne.setStrokeWidth=ne.setStrokeWidth.bind(ne),ne.setStrokeDasharray=ne.setStrokeDasharray.bind(ne),ne.positionGrips=ne.positionGrips.bind(ne),ne.addControlGrips=ne.addControlGrips.bind(ne),ne.adjustVisual=ne.adjustVisual.bind(ne),ne.setupControlBox=ne.setupControlBox.bind(ne),ne.resize=ne.resize.bind(ne),ne.strokeColor=ue.defaultColor,ne.strokeWidth=ue.defaultStrokeWidth,ne.strokeDasharray=ue.defaultStrokeDasharray,ne.strokePanel=new Le("Line color",ue.defaultColorSet,ue.defaultColor),ne.strokePanel.onColorChanged=ne.setStrokeColor,ne.strokeWidthPanel=new lt("Line width",ue.defaultStrokeWidths,ue.defaultStrokeWidth),ne.strokeWidthPanel.onWidthChanged=ne.setStrokeWidth,ne.strokeStylePanel=new it("Line style",ue.defaultStrokeDasharrays,ue.defaultStrokeDasharray),ne.strokeStylePanel.onStyleChanged=ne.setStrokeDasharray,ne}return et(te,ae),te.prototype.ownsTarget=function(z){return!(!ae.prototype.ownsTarget.call(this,z)&&z!==this.visual&&z!==this.selectorCurve&&z!==this.visibleCurve&&!this.curveGrip.ownsTarget(z))},te.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},te.prototype.createVisual=function(){this.visual=ge.createGroup(),this.selectorCurve=ge.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ge.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)},te.prototype.pointerDown=function(z,oe){ae.prototype.pointerDown.call(this,z,oe),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=z.x,this.curveY=z.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(oe)&&(this.activeGrip=this.curveGrip,this._state="resize")},te.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ge.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ge.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ge.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},te.prototype.setupControlBox=function(){ae.prototype.setupControlBox.call(this),this.curveControlLine1=ge.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ge.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)},te.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,ae.prototype.addControlGrips.call(this)},te.prototype.positionGrips=function(){ae.prototype.positionGrips.call(this);var z=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-z/2,this.curveY-z/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()))},te.prototype.manipulate=function(z){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+z.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+z.y-this.manipulationStartY),ae.prototype.manipulate.call(this,z)},te.prototype.resize=function(z){this.activeGrip===this.curveGrip&&(this.curveX=z.x,this.curveY=z.y),ae.prototype.resize.call(this,z),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},te.prototype.setStrokeColor=function(z){this.strokeColor=z,this.adjustVisual(),this.colorChanged(z)},te.prototype.setStrokeWidth=function(z){this.strokeWidth=z,this.adjustVisual()},te.prototype.setStrokeDasharray=function(z){this.strokeDasharray=z,this.adjustVisual()},te.prototype.scale=function(z,oe){this.curveX=this.curveX*z,this.curveY=this.curveY*oe,ae.prototype.scale.call(this,z,oe)},Object.defineProperty(te.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),te.prototype.getState=function(){var z=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},ae.prototype.getState.call(this));return z.typeName=te.typeName,z},te.prototype.restoreState=function(z){ae.prototype.restoreState.call(this,z);var oe=z;this.strokeColor=oe.strokeColor,this.strokeWidth=oe.strokeWidth,this.strokeDasharray=oe.strokeDasharray,this.curveX=oe.curveX,this.curveY=oe.curveY,this.createVisual(),this.adjustVisual()},te.typeName="CurveMarker",te.title="Curve marker",te.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>',te}(Ge),en=function(ae){function te(z,oe,ue){var ne=ae.call(this,z,oe,ue)||this;return ne.fillColor="transparent",ne.strokeColor="transparent",ne.strokeWidth=0,ne.strokeDasharray="",ne.textColor="transparent",ne.fontSize="1rem",ne.isMoved=!1,ne.captionText="Caption",ne.PADDING=5,ne.captionBoxWidth=0,ne.captionBoxHeight=0,ne.strokeColor=ue.defaultColor,ne.strokeWidth=ue.defaultStrokeWidth,ne.strokeDasharray=ue.defaultStrokeDasharray,ne.fillColor=ue.defaultFillColor,ne.textColor=ue.defaultStrokeColor,ne.fontFamily=ue.defaultFontFamily,ne.fontSize=ue.defaultCaptionFontSize,ne.captionText=ue.defaultCaptionText,ne.setStrokeColor=ne.setStrokeColor.bind(ne),ne.setFillColor=ne.setFillColor.bind(ne),ne.setStrokeWidth=ne.setStrokeWidth.bind(ne),ne.setStrokeDasharray=ne.setStrokeDasharray.bind(ne),ne.createVisual=ne.createVisual.bind(ne),ne.sizeCaption=ne.sizeCaption.bind(ne),ne.setCaptionText=ne.setCaptionText.bind(ne),ne.showTextEditor=ne.showTextEditor.bind(ne),ne.positionTextEditor=ne.positionTextEditor.bind(ne),ne.finishTextEditing=ne.finishTextEditing.bind(ne),ne.setFont=ne.setFont.bind(ne),ne.setTextColor=ne.setTextColor.bind(ne),ne.strokePanel=new Le("Line color",pe(ue.defaultColorSet,["transparent"]),ne.strokeColor),ne.strokePanel.onColorChanged=ne.setStrokeColor,ne.fillPanel=new Le("Fill color",pe(ue.defaultColorSet,["transparent"]),ne.fillColor,de),ne.fillPanel.onColorChanged=ne.setFillColor,ne.strokeWidthPanel=new lt("Line width",ue.defaultStrokeWidths,ue.defaultStrokeWidth),ne.strokeWidthPanel.onWidthChanged=ne.setStrokeWidth,ne.strokeStylePanel=new it("Line style",ue.defaultStrokeDasharrays,ue.defaultStrokeDasharray),ne.strokeStylePanel.onStyleChanged=ne.setStrokeDasharray,ne.fontFamilyPanel=new Te("Font",ue.defaultFontFamilies,ue.defaultFontFamily),ne.fontFamilyPanel.onFontChanged=ne.setFont,ne.textColorPanel=new Le("Text color",ue.defaultColorSet,ne.textColor,ve),ne.textColorPanel.onColorChanged=ne.setTextColor,ne}return et(te,ae),te.prototype.ownsTarget=function(z){return!(!ae.prototype.ownsTarget.call(this,z)&&z!==this.visual&&z!==this.frame&&z!==this.captionBg&&z!==this.captionElement)},te.prototype.createVisual=function(){this.visual=ge.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=ge.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=ge.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=ge.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()},te.prototype.setCaptionText=function(z){this.captionText=z,this.captionElement.textContent=this.captionText,this.sizeCaption()},te.prototype.pointerDown=function(z,oe){ae.prototype.pointerDown.call(this,z,oe),this.isMoved=!1,this.pointerDownPoint=z,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(z),this._state="creating")},te.prototype.manipulate=function(z){ae.prototype.manipulate.call(this,z),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(z.x-this.pointerDownPoint.x)>5||Math.abs(z.y-this.pointerDownPoint.y)>5)},te.prototype.resize=function(z){ae.prototype.resize.call(this,z),this.setSize()},te.prototype.sizeCaption=function(){var z=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=z.width+2*this.PADDING,this.captionBoxHeight=z.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),ge.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')"]]),ge.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')"]])},te.prototype.showTextEditor=function(){var z=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(oe){oe.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(oe){oe.key==="Enter"&&z.finishTextEditing(z.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(oe){oe.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){z.finishTextEditing(z.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){z.finishTextEditing(z.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},te.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"))},te.prototype.finishTextEditing=function(z){this.setCaptionText(z.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},te.prototype.setFont=function(z){this.captionElement&&ge.setAttributes(this.captionElement,[["font-family",z]]),this.fontFamily=z,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},te.prototype.setTextColor=function(z){this.captionElement&&ge.setAttributes(this.captionElement,[["fill",z]]),this.textColor=z,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},te.prototype.setSize=function(){ae.prototype.setSize.call(this),ge.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},te.prototype.pointerUp=function(z){ae.prototype.pointerUp.call(this,z),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},te.prototype.dblClick=function(z,oe){ae.prototype.dblClick.call(this,z,oe),this.showTextEditor()},te.prototype.setStrokeColor=function(z){this.strokeColor=z,this.frame&&ge.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(z),this.stateChanged()},te.prototype.setFillColor=function(z){this.fillColor=z,this.captionBg&&ge.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(z),this.stateChanged()},te.prototype.setStrokeWidth=function(z){this.strokeWidth=z,this.frame&&ge.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},te.prototype.setStrokeDasharray=function(z){this.strokeDasharray=z,this.frame&&ge.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(te.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),te.prototype.getState=function(){var z=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},ae.prototype.getState.call(this));return z.typeName=this.typeName,z},te.prototype.restoreState=function(z){var oe=z;this.fillColor=oe.fillColor,this.strokeColor=oe.strokeColor,this.strokeWidth=oe.strokeWidth,this.strokeDasharray=oe.strokeDasharray,this.textColor=oe.textColor,this.fontFamily=oe.fontFamily,this.captionText=oe.captionText,this.fontSize=oe.fontSize,this.createVisual(),ae.prototype.restoreState.call(this,z),this.setSize()},te.prototype.scale=function(z,oe){ae.prototype.scale.call(this,z,oe),this.setSize()},te.typeName="CaptionFrameMarker",te.title="Caption frame marker",te.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>',te}(st),ct=function(){function ae(te,z){z===void 0&&(z=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=te,this.cancelable=z}return Object.defineProperty(ae.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),ae.prototype.preventDefault=function(){this._defaultPrevented=!0},ae}(),Pt=function(ae){function te(z,oe,ue){var ne=ae.call(this,z,!1)||this;return ne.dataUrl=oe,ne.state=ue,ne}return et(te,ae),te}(ct),We=function(ae){function te(z,oe,ue){ue===void 0&&(ue=!1);var ne=ae.call(this,z,ue)||this;return ne.marker=oe,ne}return et(te,ae),te}(ct),gt=function(){function ae(){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 ae.prototype.addEventListener=function(te,z){this[te].push(z)},ae.prototype.removeEventListener=function(te,z){var oe=this[te].indexOf(z);oe>-1&&this[te].splice(oe,1)},ae}(),St=function(){function ae(te){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ye,this._isOpen=!1,this.undoRedoManager=new tt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new gt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=ae.instanceCounter++,this.styles=new fe(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=te,this.targetRoot=document.body,this.width=te.clientWidth,this.height=te.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(ae.prototype,"ALL_MARKER_TYPES",{get:function(){return[Yt,Pe,$t,Qe,Be,Jt,Ot,ut,Ct,wt,mt,at,en]},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Yt,Pe,$t,Qe,Jt,Ot,ut]},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Yt,Pe,$t,Qe,Ot]},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(te){var z=this;this._availableMarkerTypes.splice(0),te.forEach(function(oe){if(typeof oe=="string"){var ue=z.ALL_MARKER_TYPES.find(function(ne){return ne.typeName===oe});ue!==void 0&&z._availableMarkerTypes.push(ue)}else z._availableMarkerTypes.push(oe)})},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(ae.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(te){this._zoomLevel=te,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(ae.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),ae.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Fe.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},ae.prototype.show=function(){var te=this;this.styles.styleSheetRoot===void 0&&we.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=we.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(z){return z(new ct(te))})},ae.prototype.render=function(){return Me(this,void 0,void 0,function(){var te;return ze(this,function(z){switch(z.label){case 0:return this.setCurrentMarker(),(te=new Ie).naturalSize=this.renderAtNaturalSize,te.imageType=this.renderImageType,te.imageQuality=this.renderImageQuality,te.markersOnly=this.renderMarkersOnly,te.width=this.renderWidth,te.height=this.renderHeight,[4,te.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return z.sent(),[4,te.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,z.sent()]}})})},ae.prototype.close=function(te){var z=this;if(te===void 0&&(te=!1),this.isOpen){var oe=!1;te||this.eventListeners.beforeclose.forEach(function(ue){var ne=new ct(z,!0);ue(ne),ne.defaultPrevented&&(oe=!0)}),oe||(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(ue){return ue(new ct(z))}),this.detachEvents(),this._isOpen=!1)}},ae.prototype.addMarkersToToolbar=function(){for(var te,z=[],oe=0;oe<arguments.length;oe++)z[oe]=arguments[oe];(te=this._availableMarkerTypes).push.apply(te,z)},ae.prototype.addRenderEventListener=function(te){this.addEventListener("render",function(z){te(z.dataUrl,z.state)})},ae.prototype.removeRenderEventListener=function(te){},ae.prototype.addCloseEventListener=function(te){this.addEventListener("close",function(){te()})},ae.prototype.removeCloseEventListener=function(te){},ae.prototype.setupResizeObserver=function(){var te=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){te.resize(te.target.clientWidth,te.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return te.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},ae.prototype.onPopupTargetResize=function(){var te=1*this.target.clientWidth/this.target.clientHeight,z=this.editorCanvas.clientWidth/te>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*te:this.editorCanvas.clientWidth,oe=z<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/te;this.resize(z,oe)},ae.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},ae.prototype.resize=function(te,z){this._isResizing=!0;var oe=te/this.imageWidth,ue=z/this.imageHeight;this.imageWidth=Math.round(te),this.imageHeight=Math.round(z),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(oe,ue),this._isResizing=!1},ae.prototype.scaleMarkers=function(te,z){var oe,ue=this;this._currentMarker&&this._currentMarker instanceof Qe?this._currentMarker.scale(te,z):(oe=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(ne){ne!==ue._currentMarker&&ne.scale(te,z)}),oe!==void 0&&this.setCurrentMarker(oe)},ae.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"},ae.prototype.setTopLeft=function(){var te=this.editingTarget.getBoundingClientRect(),z=this.editorCanvas.getBoundingClientRect();this.left=te.left-z.left,this.top=te.top-z.top},ae.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)},ae.prototype.addDefs=function(){for(var te,z=[],oe=0;oe<arguments.length;oe++)z[oe]=arguments[oe];this.defs=ge.createDefs(),this.addDefsToImage(),(te=this.defs).append.apply(te,z)},ae.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},ae.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)},ae.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},ae.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},ae.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)},ae.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},ae.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)},ae.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 te=document.createElement("a");te.href="https://markerjs.com/",te.target="_blank",te.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>',te.title="Powered by marker.js",te.style.display="grid",te.style.alignItems="center",te.style.justifyItems="center",te.style.padding="3px",te.style.width="20px",te.style.height="20px",this.logoUI.appendChild(te),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},ae.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")},ae.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"},ae.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},ae.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 te=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=te+"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 rt(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 Ne(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},ae.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},ae.prototype.removeMarker=function(te){this.markerImage.removeChild(te.container),this.markers.indexOf(te)>-1&&this.markers.splice(this.markers.indexOf(te),1),te.dispose()},ae.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())},ae.prototype.toolbarButtonClicked=function(te,z){if(te==="marker"&&z!==void 0)this.createNewMarker(z);else if(te==="action")switch(z){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()}},ae.prototype.deleteSelectedMarker=function(){var te=this;if(this._currentMarker!==void 0){var z=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ue){var ne=new We(te,te._currentMarker,!0);ue(ne),ne.defaultPrevented&&(z=!0)}),!z){var oe=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(ue){return ue(new We(te,oe))})}}},ae.prototype.clear=function(){var te=this,z=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(be){var Ve=new We(te,void 0,!0);be(Ve),Ve.defaultPrevented&&(z=!0)}),!z)){this.setCurrentMarker();for(var oe=function(be){var Ve=ue.markers[be];ue.setCurrentMarker(ue.markers[be]),ue._currentMarker.dispose(),ue.markerImage.removeChild(ue._currentMarker.container),ue.markers.splice(ue.markers.indexOf(ue._currentMarker),1),ue.eventListeners.markerdelete.forEach(function(Tt){return Tt(new We(te,Ve))})},ue=this,ne=this.markers.length-1;ne>=0;ne--)oe(ne);this.addUndoStep()}},Object.defineProperty(ae.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),ae.prototype.showNotesEditor=function(){var te;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=(te=this._currentMarker.notes)!==null&&te!==void 0?te:"",this.overlayContainer.appendChild(this.notesArea))},ae.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)},ae.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},ae.prototype.addUndoStep=function(){var te=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var z=this.getState(),oe=this.undoRedoManager.getLastUndoStep();if(!oe||oe.width===z.width&&oe.height===z.height){var ue=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(z),ue<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(ne){return ne(new ct(te))})}else this.undoRedoManager.replaceLastUndoStep(z),this.eventListeners.statechange.forEach(function(ne){return ne(new ct(te))})}},ae.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},ae.prototype.undoStep=function(){var te=this,z=this.undoRedoManager.undo();z!==void 0&&(this.restoreState(z),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(oe){return oe(new ct(te))}))},ae.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},ae.prototype.redoStep=function(){var te=this,z=this.undoRedoManager.redo();z!==void 0&&(this.restoreState(z),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(oe){return oe(new ct(te))}))},ae.prototype.stepZoom=function(){var te=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=te<this.zoomSteps.length-1?this.zoomSteps[te+1]:this.zoomSteps[0]},ae.prototype.panTo=function(te){this.contentDiv.scrollBy({left:this.prevPanPoint.x-te.x,top:this.prevPanPoint.y-te.y}),this.prevPanPoint=te},ae.prototype.startRenderAndClose=function(){return Me(this,void 0,void 0,function(){var te,z,oe=this;return ze(this,function(ue){switch(ue.label){case 0:return[4,this.render()];case 1:return te=ue.sent(),z=this.getState(),this.eventListeners.render.forEach(function(ne){return ne(new Pt(oe,te,z))}),this.close(!0),[2]}})})},ae.prototype.getState=function(te){te===!0&&this.setCurrentMarker();var z={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(oe){return z.markers.push(oe.getState())}),z},ae.prototype.restoreState=function(te){var z=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);te.markers.forEach(function(oe){var ue=z._availableMarkerTypes.find(function(be){return be.typeName===oe.typeName});if(ue!==void 0){var ne=z.addNewMarker(ue);ne.restoreState(oe),z.markers.push(ne)}}),te.width&&te.height&&(te.width!==this.imageWidth||te.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/te.width,this.imageHeight/te.height),this.eventListeners.restorestate.forEach(function(oe){return oe(new ct(z))})},ae.prototype.addNewMarker=function(te){var z=ge.createGroup();return this.markerImage.appendChild(z),new te(z,this.overlayContainer,this.settings)},ae.prototype.createNewMarker=function(te){var z,oe=this;(z=typeof te=="string"?this._availableMarkerTypes.find(function(ue){return ue.typeName===te}):te)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(z),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(z.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ue){return ue(new We(oe,oe._currentMarker))}))},ae.prototype.markerCreated=function(te){var z=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(te),this.setCurrentMarker(te),te instanceof Pe&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Pe):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(oe){return oe(new We(z,z._currentMarker))})},ae.prototype.colorChanged=function(te){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=te,this.settings.defaultStrokeColor=te)},ae.prototype.fillColorChanged=function(te){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=te)},ae.prototype.markerStateChanged=function(te){var z=this;this.eventListeners.markerchange.forEach(function(oe){return oe(new We(z,te))})},ae.prototype.setCurrentMarker=function(te){var z=this;this._currentMarker!==te&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(oe){return oe(new We(z,z._currentMarker))})),this._currentMarker=te,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(oe){return oe(new We(z,z._currentMarker))}))},ae.prototype.onPointerDown=function(te){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||te.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var z=this.markers.find(function(oe){return oe.ownsTarget(te.target)});z!==void 0?(this.setCurrentMarker(z),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(te.clientX,te.clientY),te.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:te.clientX,y:te.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(te.clientX,te.clientY))},ae.prototype.onDblClick=function(te){if(this._isFocused||this.focus(),this.mode==="select"){var z=this.markers.find(function(oe){return oe.ownsTarget(te.target)});z!==void 0&&z!==this._currentMarker&&this.setCurrentMarker(z),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(te.clientX,te.clientY),te.target):this.setCurrentMarker()}},ae.prototype.onPointerMove=function(te){this.touchPoints!==1&&te.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||te.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(te.clientX,te.clientY)):this.zoomLevel>1&&this.panTo({x:te.clientX,y:te.clientY}))},ae.prototype.onPointerUp=function(te){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(te.clientX,te.clientY)),this.isDragging=!1,this.addUndoStep()},ae.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},ae.prototype.onKeyUp=function(te){this._currentMarker===void 0||this.notesArea!==void 0||te.key!=="Delete"&&te.key!=="Backspace"||this.deleteSelectedMarker()},ae.prototype.clientToLocalCoordinates=function(te,z){var oe=this.markerImage.getBoundingClientRect();return{x:(te-oe.left)/this.zoomLevel,y:(z-oe.top)/this.zoomLevel}},ae.prototype.onWindowResize=function(){this.positionUI()},ae.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var te=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=te+"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()},ae.prototype.addLicenseKey=function(te){Fe.addKey(te)},ae.prototype.addEventListener=function(te,z){this.eventListeners.addEventListener(te,z)},ae.prototype.removeEventListener=function(te,z){this.eventListeners.removeEventListener(te,z)},ae.prototype.renderState=function(te){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(te),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(ae.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),ae.prototype.focus=function(){var te=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(z){return z(new ct(te))}))},ae.prototype.blur=function(){var te=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(z){return z(new ct(te))}))},ae.instanceCounter=0,ae}()},66042:function(At,_t,he){"use strict";he.d(_t,{Z:function(){return Qe}});var ie=he(27247),et=he(11913),Me=he(43403),ze=he(34280),pe=he(59301),ge=pe.createContext(null),Fe=pe.createContext({}),Ie=ge,we=he(74430),fe=he(32855),Ke=he(92310),me=he.n(Ke),rt=he(77900),Ne=he(10228),De=he(26112),Le=he(43079),xe=he(8654),Oe=["prefixCls","className","containerRef"],Xe=function(ot){var $t=ot.prefixCls,wt=ot.className,pn=ot.containerRef,Ot=(0,Le.Z)(ot,Oe),ve=pe.useContext(Fe),de=ve.panel,ut=(0,xe.x1)(de,pn);return pe.createElement("div",(0,fe.Z)({className:me()("".concat($t,"-content"),wt),role:"dialog",ref:ut},(0,De.Z)(ot,{aria:!0}),{"aria-modal":"true"},Ot))},Je=Xe,st=he(48736);function $e(Pe){return typeof Pe=="string"&&String(Number(Pe))===Pe?((0,st.ZP)(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(Pe)):Pe}function lt(Pe){warning(!("wrapperClassName"in Pe),"'wrapperClassName' is removed. Please use 'rootClassName' instead."),warning(canUseDom()||!Pe.open,"Drawer with 'open' in SSR is not work since no place to createPortal. Please move to 'useEffect' instead.")}var it={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function Yt(Pe,ot){var $t,wt,pn,Ot=Pe.prefixCls,ve=Pe.open,de=Pe.placement,ut=Pe.inline,Jt=Pe.push,Ct=Pe.forceRender,Be=Pe.autoFocus,tt=Pe.keyboard,at=Pe.classNames,en=Pe.rootClassName,ct=Pe.rootStyle,Pt=Pe.zIndex,We=Pe.className,gt=Pe.id,St=Pe.style,ae=Pe.motion,te=Pe.width,z=Pe.height,oe=Pe.children,ue=Pe.mask,ne=Pe.maskClosable,be=Pe.maskMotion,Ve=Pe.maskClassName,Tt=Pe.maskStyle,bt=Pe.afterOpenChange,ft=Pe.onClose,yt=Pe.onMouseEnter,Vt=Pe.onMouseOver,Wt=Pe.onMouseLeave,qe=Pe.onClick,nt=Pe.onKeyDown,_e=Pe.onKeyUp,xt=Pe.styles,Ft=Pe.drawerRender,Qt=pe.useRef(),Ue=pe.useRef(),tn=pe.useRef();pe.useImperativeHandle(ot,function(){return Qt.current});var ke=function(Sn){var En=Sn.keyCode,jn=Sn.shiftKey;switch(En){case Ne.Z.TAB:{if(En===Ne.Z.TAB){if(!jn&&document.activeElement===tn.current){var Gt;(Gt=Ue.current)===null||Gt===void 0||Gt.focus({preventScroll:!0})}else if(jn&&document.activeElement===Ue.current){var cn;(cn=tn.current)===null||cn===void 0||cn.focus({preventScroll:!0})}}break}case Ne.Z.ESC:{ft&&tt&&(Sn.stopPropagation(),ft(Sn));break}}};pe.useEffect(function(){if(ve&&Be){var vn;(vn=Qt.current)===null||vn===void 0||vn.focus({preventScroll:!0})}},[ve]);var kt=pe.useState(!1),Zt=(0,et.Z)(kt,2),_n=Zt[0],Rt=Zt[1],un=pe.useContext(Ie),$n;typeof Jt=="boolean"?$n=Jt?{}:{distance:0}:$n=Jt||{};var Gn=($t=(wt=(pn=$n)===null||pn===void 0?void 0:pn.distance)!==null&&wt!==void 0?wt:un==null?void 0:un.pushDistance)!==null&&$t!==void 0?$t:180,bi=pe.useMemo(function(){return{pushDistance:Gn,push:function(){Rt(!0)},pull:function(){Rt(!1)}}},[Gn]);pe.useEffect(function(){if(ve){var vn;un==null||(vn=un.push)===null||vn===void 0||vn.call(un)}else{var Sn;un==null||(Sn=un.pull)===null||Sn===void 0||Sn.call(un)}},[ve]),pe.useEffect(function(){return function(){var vn;un==null||(vn=un.pull)===null||vn===void 0||vn.call(un)}},[]);var xi=ue&&pe.createElement(rt.default,(0,fe.Z)({key:"mask"},be,{visible:ve}),function(vn,Sn){var En=vn.className,jn=vn.style;return pe.createElement("div",{className:me()("".concat(Ot,"-mask"),En,at==null?void 0:at.mask,Ve),style:(0,ie.Z)((0,ie.Z)((0,ie.Z)({},jn),Tt),xt==null?void 0:xt.mask),onClick:ne&&ve?ft:void 0,ref:Sn})}),ei=typeof ae=="function"?ae(de):ae,Jn={};if(_n&&Gn)switch(de){case"top":Jn.transform="translateY(".concat(Gn,"px)");break;case"bottom":Jn.transform="translateY(".concat(-Gn,"px)");break;case"left":Jn.transform="translateX(".concat(Gn,"px)");break;default:Jn.transform="translateX(".concat(-Gn,"px)");break}de==="left"||de==="right"?Jn.width=$e(te):Jn.height=$e(z);var Dn={onMouseEnter:yt,onMouseOver:Vt,onMouseLeave:Wt,onClick:qe,onKeyDown:nt,onKeyUp:_e},ti=pe.createElement(rt.default,(0,fe.Z)({key:"panel"},ei,{visible:ve,forceRender:Ct,onVisibleChanged:function(Sn){bt==null||bt(Sn)},removeOnLeave:!1,leavedClassName:"".concat(Ot,"-content-wrapper-hidden")}),function(vn,Sn){var En=vn.className,jn=vn.style,Gt=pe.createElement(Je,(0,fe.Z)({id:gt,containerRef:Sn,prefixCls:Ot,className:me()(We,at==null?void 0:at.content),style:(0,ie.Z)((0,ie.Z)({},St),xt==null?void 0:xt.content)},(0,De.Z)(Pe,{aria:!0}),Dn),oe);return pe.createElement("div",(0,fe.Z)({className:me()("".concat(Ot,"-content-wrapper"),at==null?void 0:at.wrapper,En),style:(0,ie.Z)((0,ie.Z)((0,ie.Z)({},Jn),jn),xt==null?void 0:xt.wrapper)},(0,De.Z)(Pe,{data:!0})),Ft?Ft(Gt):Gt)}),Bn=(0,ie.Z)({},ct);return Pt&&(Bn.zIndex=Pt),pe.createElement(Ie.Provider,{value:bi},pe.createElement("div",{className:me()(Ot,"".concat(Ot,"-").concat(de),en,(0,we.Z)((0,we.Z)({},"".concat(Ot,"-open"),ve),"".concat(Ot,"-inline"),ut)),style:Bn,tabIndex:-1,ref:Qt,onKeyDown:ke},xi,pe.createElement("div",{tabIndex:0,ref:Ue,style:it,"aria-hidden":"true","data-sentinel":"start"}),ti,pe.createElement("div",{tabIndex:0,ref:tn,style:it,"aria-hidden":"true","data-sentinel":"end"})))}var Ye=pe.forwardRef(Yt),Ge=Ye,mt=function(ot){var $t=ot.open,wt=$t===void 0?!1:$t,pn=ot.prefixCls,Ot=pn===void 0?"rc-drawer":pn,ve=ot.placement,de=ve===void 0?"right":ve,ut=ot.autoFocus,Jt=ut===void 0?!0:ut,Ct=ot.keyboard,Be=Ct===void 0?!0:Ct,tt=ot.width,at=tt===void 0?378:tt,en=ot.mask,ct=en===void 0?!0:en,Pt=ot.maskClosable,We=Pt===void 0?!0:Pt,gt=ot.getContainer,St=ot.forceRender,ae=ot.afterOpenChange,te=ot.destroyOnClose,z=ot.onMouseEnter,oe=ot.onMouseOver,ue=ot.onMouseLeave,ne=ot.onClick,be=ot.onKeyDown,Ve=ot.onKeyUp,Tt=ot.panelRef,bt=pe.useState(!1),ft=(0,et.Z)(bt,2),yt=ft[0],Vt=ft[1],Wt=pe.useState(!1),qe=(0,et.Z)(Wt,2),nt=qe[0],_e=qe[1];(0,ze.Z)(function(){_e(!0)},[]);var xt=nt?wt:!1,Ft=pe.useRef(),Qt=pe.useRef();(0,ze.Z)(function(){xt&&(Qt.current=document.activeElement)},[xt]);var Ue=function(_n){var Rt;if(Vt(_n),ae==null||ae(_n),!_n&&Qt.current&&!((Rt=Ft.current)!==null&&Rt!==void 0&&Rt.contains(Qt.current))){var un;(un=Qt.current)===null||un===void 0||un.focus({preventScroll:!0})}},tn=pe.useMemo(function(){return{panel:Tt}},[Tt]);if(!St&&!yt&&!xt&&te)return null;var ke={onMouseEnter:z,onMouseOver:oe,onMouseLeave:ue,onClick:ne,onKeyDown:be,onKeyUp:Ve},kt=(0,ie.Z)((0,ie.Z)({},ot),{},{open:xt,prefixCls:Ot,placement:de,autoFocus:Jt,keyboard:Be,width:at,mask:ct,maskClosable:We,inline:gt===!1,afterOpenChange:Ue,ref:Ft},ke);return pe.createElement(Fe.Provider,{value:tn},pe.createElement(Me.Z,{open:xt||St||yt,autoDestroy:!1,getContainer:gt,autoLock:ct&&(xt||yt)},pe.createElement(Ge,kt)))},Te=mt,Qe=Te},6551:function(At,_t,he){"use strict";he.d(_t,{ZP:function(){return Fe}});var ie=he(11913),et=he(59301),Me=he(47273),ze=0,pe=(0,Me.Z)();function ge(){var Ie;return pe?(Ie=ze,ze+=1):Ie="TEST_OR_SSR",Ie}function Fe(Ie){var we=et.useState(),fe=(0,ie.Z)(we,2),Ke=fe[0],me=fe[1];return et.useEffect(function(){me("rc_select_".concat(ge()))},[]),Ie||Ke}},37463:function(At,_t,he){"use strict";he.d(_t,{Ac:function(){return Ue},Xo:function(){return ke},Wx:function(){return Zt},ZP:function(){return Rn},lk:function(){return Je}});var ie=he(32855),et=he(3300),Me=he(74430),ze=he(27247),pe=he(11913),ge=he(43079),Fe=he(34666),Ie=he(18929),we=he(48736),fe=he(59301),Ke=he(92310),me=he.n(Ke),rt=he(34280),Ne=he(49658),De=he(8654),Le=function(Ee){var Et=Ee.className,ht=Ee.customizeIcon,Re=Ee.customizeIconProps,pt=Ee.children,Ut=Ee.onMouseDown,sn=Ee.onClick,dn=typeof ht=="function"?ht(Re):ht;return fe.createElement("span",{className:Et,onMouseDown:function(Kt){Kt.preventDefault(),Ut==null||Ut(Kt)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:sn,"aria-hidden":!0},dn!==void 0?dn:fe.createElement("span",{className:me()(Et.split(/\s+/).map(function(It){return"".concat(It,"-icon")}))},pt))},xe=Le,Oe=function(Ee,Et,ht,Re,pt){var Ut=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,sn=arguments.length>6?arguments[6]:void 0,dn=arguments.length>7?arguments[7]:void 0,It=fe.useMemo(function(){if((0,Fe.Z)(Re)==="object")return Re.clearIcon;if(pt)return pt},[Re,pt]),Kt=fe.useMemo(function(){return!!(!Ut&&Re&&(ht.length||sn)&&!(dn==="combobox"&&sn===""))},[Re,Ut,ht.length,sn,dn]);return{allowClear:Kt,clearIcon:fe.createElement(xe,{className:"".concat(Ee,"-clear"),onMouseDown:Et,customizeIcon:It},"\xD7")}},Xe=fe.createContext(null);function Je(){return fe.useContext(Xe)}function st(){var Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,Ee=fe.useState(!1),Et=(0,pe.Z)(Ee,2),ht=Et[0],Re=Et[1],pt=fe.useRef(null),Ut=function(){window.clearTimeout(pt.current)};fe.useEffect(function(){return Ut},[]);var sn=function(It,Kt){Ut(),pt.current=window.setTimeout(function(){Re(It),Kt&&Kt()},Se)};return[ht,sn,Ut]}function $e(){var Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,Ee=fe.useRef(null),Et=fe.useRef(null);fe.useEffect(function(){return function(){window.clearTimeout(Et.current)}},[]);function ht(Re){(Re||Ee.current===null)&&(Ee.current=Re),window.clearTimeout(Et.current),Et.current=window.setTimeout(function(){Ee.current=null},Se)}return[function(){return Ee.current},ht]}function lt(Se,Ee,Et,ht){var Re=fe.useRef(null);Re.current={open:Ee,triggerOpen:Et,customizedTrigger:ht},fe.useEffect(function(){function pt(Ut){var sn;if(!((sn=Re.current)!==null&&sn!==void 0&&sn.customizedTrigger)){var dn=Ut.target;dn.shadowRoot&&Ut.composed&&(dn=Ut.composedPath()[0]||dn),Re.current.open&&Se().filter(function(It){return It}).every(function(It){return!It.contains(dn)&&It!==dn})&&Re.current.triggerOpen(!1)}}return window.addEventListener("mousedown",pt),function(){return window.removeEventListener("mousedown",pt)}},[])}var it=he(10228);function Yt(Se){return Se&&![it.Z.ESC,it.Z.SHIFT,it.Z.BACKSPACE,it.Z.TAB,it.Z.WIN_KEY,it.Z.ALT,it.Z.META,it.Z.WIN_KEY_RIGHT,it.Z.CTRL,it.Z.SEMICOLON,it.Z.EQUALS,it.Z.CAPS_LOCK,it.Z.CONTEXT_MENU,it.Z.F1,it.Z.F2,it.Z.F3,it.Z.F4,it.Z.F5,it.Z.F6,it.Z.F7,it.Z.F8,it.Z.F9,it.Z.F10,it.Z.F11,it.Z.F12].includes(Se)}var Ye=he(26112),Ge=he(11780);function mt(Se,Ee,Et){var ht=(0,ze.Z)((0,ze.Z)({},Se),Et?Ee:{});return Object.keys(Ee).forEach(function(Re){var pt=Ee[Re];typeof pt=="function"&&(ht[Re]=function(){for(var Ut,sn=arguments.length,dn=new Array(sn),It=0;It<sn;It++)dn[It]=arguments[It];return pt.apply(void 0,dn),(Ut=Se[Re])===null||Ut===void 0?void 0:Ut.call.apply(Ut,[Se].concat(dn))})}),ht}var Te=mt,Qe=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],Pe=function(Ee,Et){var ht=Ee.prefixCls,Re=Ee.id,pt=Ee.inputElement,Ut=Ee.autoFocus,sn=Ee.autoComplete,dn=Ee.editable,It=Ee.activeDescendantId,Kt=Ee.value,Ae=Ee.open,Tn=Ee.attrs,qt=(0,ge.Z)(Ee,Qe),bn=pt||fe.createElement("input",null),mn=bn,Mn=mn.ref,Hn=mn.props;return(0,we.Kp)(!("maxLength"in bn.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),bn=fe.cloneElement(bn,(0,ze.Z)((0,ze.Z)((0,ze.Z)({type:"search"},Te(qt,Hn,!0)),{},{id:Re,ref:(0,De.sQ)(Et,Mn),autoComplete:sn||"off",autoFocus:Ut,className:me()("".concat(ht,"-selection-search-input"),Hn==null?void 0:Hn.className),role:"combobox","aria-expanded":Ae||!1,"aria-haspopup":"listbox","aria-owns":"".concat(Re,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(Re,"_list"),"aria-activedescendant":Ae?It:void 0},Tn),{},{value:dn?Kt:"",readOnly:!dn,unselectable:dn?null:"on",style:(0,ze.Z)((0,ze.Z)({},Hn.style),{},{opacity:dn?null:0})})),bn},ot=fe.forwardRef(Pe),$t=ot;function wt(Se){return Array.isArray(Se)?Se:Se!==void 0?[Se]:[]}var pn=typeof window!="undefined"&&window.document&&window.document.documentElement,Ot=pn;function ve(Se){return Se!=null}function de(Se){return!Se&&Se!==0}function ut(Se){return["string","number"].includes((0,Fe.Z)(Se))}function Jt(Se){var Ee=void 0;return Se&&(ut(Se.title)?Ee=Se.title.toString():ut(Se.label)&&(Ee=Se.label.toString())),Ee}function Ct(Se,Ee){Ot?fe.useLayoutEffect(Se,Ee):fe.useEffect(Se,Ee)}function Be(Se){var Ee;return(Ee=Se.key)!==null&&Ee!==void 0?Ee:Se.value}var tt=function(Ee){Ee.preventDefault(),Ee.stopPropagation()},at=function(Ee){var Et=Ee.id,ht=Ee.prefixCls,Re=Ee.values,pt=Ee.open,Ut=Ee.searchValue,sn=Ee.autoClearSearchValue,dn=Ee.inputRef,It=Ee.placeholder,Kt=Ee.disabled,Ae=Ee.mode,Tn=Ee.showSearch,qt=Ee.autoFocus,bn=Ee.autoComplete,mn=Ee.activeDescendantId,Mn=Ee.tabIndex,Hn=Ee.removeIcon,mi=Ee.maxTagCount,Vn=Ee.maxTagTextLength,On=Ee.maxTagPlaceholder,ci=On===void 0?function(gn){return"+ ".concat(gn.length," ...")}:On,zn=Ee.tagRender,gi=Ee.onToggleOpen,Ni=Ee.onRemove,hi=Ee.onInputChange,yi=Ee.onInputPaste,Mi=Ee.onInputKeyDown,wi=Ee.onInputMouseDown,ai=Ee.onInputCompositionStart,Pi=Ee.onInputCompositionEnd,li=Ee.onInputBlur,fi=fe.useRef(null),Ci=(0,fe.useState)(0),Di=(0,pe.Z)(Ci,2),pi=Di[0],ri=Di[1],ni=(0,fe.useState)(!1),Bi=(0,pe.Z)(ni,2),Zi=Bi[0],Gi=Bi[1],oi="".concat(ht,"-selection"),ar=pt||Ae==="multiple"&&sn===!1||Ae==="tags"?Ut:"",di=Ae==="tags"||Ae==="multiple"&&sn===!1||Tn&&(pt||Zi);Ct(function(){ri(fi.current.scrollWidth)},[ar]);var lr=function(on,An,Nt,Lt,jt){return fe.createElement("span",{title:Jt(on),className:me()("".concat(oi,"-item"),(0,Me.Z)({},"".concat(oi,"-item-disabled"),Nt))},fe.createElement("span",{className:"".concat(oi,"-item-content")},An),Lt&&fe.createElement(xe,{className:"".concat(oi,"-item-remove"),onMouseDown:tt,onClick:jt,customizeIcon:Hn},"\xD7"))},tr=function(on,An,Nt,Lt,jt,Xt){var Wn=function(Ei){tt(Ei),gi(!pt)};return fe.createElement("span",{onMouseDown:Wn},zn({label:An,value:on,disabled:Nt,closable:Lt,onClose:jt,isMaxTag:!!Xt}))},Ii=function(on){var An=on.disabled,Nt=on.label,Lt=on.value,jt=!Kt&&!An,Xt=Nt;if(typeof Vn=="number"&&(typeof Nt=="string"||typeof Nt=="number")){var Wn=String(Xt);Wn.length>Vn&&(Xt="".concat(Wn.slice(0,Vn),"..."))}var Kn=function(Xn){Xn&&Xn.stopPropagation(),Ni(on)};return typeof zn=="function"?tr(Lt,Xt,An,jt,Kn):lr(on,Xt,An,jt,Kn)},Un=function(on){if(!Re.length)return null;var An=typeof ci=="function"?ci(on):ci;return typeof zn=="function"?tr(void 0,An,!1,!1,void 0,!0):lr({title:An},An,!1)},Mt=fe.createElement("div",{className:"".concat(oi,"-search"),style:{width:pi},onFocus:function(){Gi(!0)},onBlur:function(){Gi(!1)}},fe.createElement($t,{ref:dn,open:pt,prefixCls:ht,id:Et,inputElement:null,disabled:Kt,autoFocus:qt,autoComplete:bn,editable:di,activeDescendantId:mn,value:ar,onKeyDown:Mi,onMouseDown:wi,onChange:hi,onPaste:yi,onCompositionStart:ai,onCompositionEnd:Pi,onBlur:li,tabIndex:Mn,attrs:(0,Ye.Z)(Ee,!0)}),fe.createElement("span",{ref:fi,className:"".concat(oi,"-search-mirror"),"aria-hidden":!0},ar,"\xA0")),Ht=fe.createElement(Ge.Z,{prefixCls:"".concat(oi,"-overflow"),data:Re,renderItem:Ii,renderRest:Un,suffix:Mt,itemKey:Be,maxCount:mi});return fe.createElement("span",{className:"".concat(oi,"-wrap")},Ht,!Re.length&&!ar&&fe.createElement("span",{className:"".concat(oi,"-placeholder")},It))},en=at,ct=function(Ee){var Et=Ee.inputElement,ht=Ee.prefixCls,Re=Ee.id,pt=Ee.inputRef,Ut=Ee.disabled,sn=Ee.autoFocus,dn=Ee.autoComplete,It=Ee.activeDescendantId,Kt=Ee.mode,Ae=Ee.open,Tn=Ee.values,qt=Ee.placeholder,bn=Ee.tabIndex,mn=Ee.showSearch,Mn=Ee.searchValue,Hn=Ee.activeValue,mi=Ee.maxLength,Vn=Ee.onInputKeyDown,On=Ee.onInputMouseDown,ci=Ee.onInputChange,zn=Ee.onInputPaste,gi=Ee.onInputCompositionStart,Ni=Ee.onInputCompositionEnd,hi=Ee.onInputBlur,yi=Ee.title,Mi=fe.useState(!1),wi=(0,pe.Z)(Mi,2),ai=wi[0],Pi=wi[1],li=Kt==="combobox",fi=li||mn,Ci=Tn[0],Di=Mn||"";li&&Hn&&!ai&&(Di=Hn),fe.useEffect(function(){li&&Pi(!1)},[li,Hn]);var pi=Kt!=="combobox"&&!Ae&&!mn?!1:!!Di,ri=yi===void 0?Jt(Ci):yi,ni=fe.useMemo(function(){return Ci?null:fe.createElement("span",{className:"".concat(ht,"-selection-placeholder"),style:pi?{visibility:"hidden"}:void 0},qt)},[Ci,pi,qt,ht]);return fe.createElement("span",{className:"".concat(ht,"-selection-wrap")},fe.createElement("span",{className:"".concat(ht,"-selection-search")},fe.createElement($t,{ref:pt,prefixCls:ht,id:Re,open:Ae,inputElement:Et,disabled:Ut,autoFocus:sn,autoComplete:dn,editable:fi,activeDescendantId:It,value:Di,onKeyDown:Vn,onMouseDown:On,onChange:function(Zi){Pi(!0),ci(Zi)},onPaste:zn,onCompositionStart:gi,onCompositionEnd:Ni,onBlur:hi,tabIndex:bn,attrs:(0,Ye.Z)(Ee,!0),maxLength:li?mi:void 0})),!li&&Ci?fe.createElement("span",{className:"".concat(ht,"-selection-item"),title:ri,style:pi?{visibility:"hidden"}:void 0},Ci.label):null,ni)},Pt=ct,We=function(Ee,Et){var ht=(0,fe.useRef)(null),Re=(0,fe.useRef)(!1),pt=Ee.prefixCls,Ut=Ee.open,sn=Ee.mode,dn=Ee.showSearch,It=Ee.tokenWithEnter,Kt=Ee.disabled,Ae=Ee.prefix,Tn=Ee.autoClearSearchValue,qt=Ee.onSearch,bn=Ee.onSearchSubmit,mn=Ee.onToggleOpen,Mn=Ee.onInputKeyDown,Hn=Ee.onInputBlur,mi=Ee.domRef;fe.useImperativeHandle(Et,function(){return{focus:function(ri){ht.current.focus(ri)},blur:function(){ht.current.blur()}}});var Vn=$e(0),On=(0,pe.Z)(Vn,2),ci=On[0],zn=On[1],gi=function(ri){var ni=ri.which,Bi=ht.current instanceof HTMLTextAreaElement;!Bi&&Ut&&(ni===it.Z.UP||ni===it.Z.DOWN)&&ri.preventDefault(),Mn&&Mn(ri),ni===it.Z.ENTER&&sn==="tags"&&!Re.current&&!Ut&&(bn==null||bn(ri.target.value)),!(Bi&&!Ut&&~[it.Z.UP,it.Z.DOWN,it.Z.LEFT,it.Z.RIGHT].indexOf(ni))&&Yt(ni)&&mn(!0)},Ni=function(){zn(!0)},hi=(0,fe.useRef)(null),yi=function(ri){qt(ri,!0,Re.current)!==!1&&mn(!0)},Mi=function(){Re.current=!0},wi=function(ri){Re.current=!1,sn!=="combobox"&&yi(ri.target.value)},ai=function(ri){var ni=ri.target.value;if(It&&hi.current&&/[\r\n]/.test(hi.current)){var Bi=hi.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");ni=ni.replace(Bi,hi.current)}hi.current=null,yi(ni)},Pi=function(ri){var ni=ri.clipboardData,Bi=ni==null?void 0:ni.getData("text");hi.current=Bi||""},li=function(ri){var ni=ri.target;if(ni!==ht.current){var Bi=document.body.style.msTouchAction!==void 0;Bi?setTimeout(function(){ht.current.focus()}):ht.current.focus()}},fi=function(ri){var ni=ci();ri.target!==ht.current&&!ni&&!(sn==="combobox"&&Kt)&&ri.preventDefault(),(sn!=="combobox"&&(!dn||!ni)||!Ut)&&(Ut&&Tn!==!1&&qt("",!0,!1),mn())},Ci={inputRef:ht,onInputKeyDown:gi,onInputMouseDown:Ni,onInputChange:ai,onInputPaste:Pi,onInputCompositionStart:Mi,onInputCompositionEnd:wi,onInputBlur:Hn},Di=sn==="multiple"||sn==="tags"?fe.createElement(en,(0,ie.Z)({},Ee,Ci)):fe.createElement(Pt,(0,ie.Z)({},Ee,Ci));return fe.createElement("div",{ref:mi,className:"".concat(pt,"-selector"),onClick:li,onMouseDown:fi},Ae&&fe.createElement("div",{className:"".concat(pt,"-prefix")},Ae),Di)},gt=fe.forwardRef(We),St=gt,ae=he(65030),te=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],z=function(Ee){var Et=Ee===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:Et,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:Et,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:Et,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:Et,adjustY:1},htmlRegion:"scroll"}}},oe=function(Ee,Et){var ht=Ee.prefixCls,Re=Ee.disabled,pt=Ee.visible,Ut=Ee.children,sn=Ee.popupElement,dn=Ee.animation,It=Ee.transitionName,Kt=Ee.dropdownStyle,Ae=Ee.dropdownClassName,Tn=Ee.direction,qt=Tn===void 0?"ltr":Tn,bn=Ee.placement,mn=Ee.builtinPlacements,Mn=Ee.dropdownMatchSelectWidth,Hn=Ee.dropdownRender,mi=Ee.dropdownAlign,Vn=Ee.getPopupContainer,On=Ee.empty,ci=Ee.getTriggerDOMNode,zn=Ee.onPopupVisibleChange,gi=Ee.onPopupMouseEnter,Ni=(0,ge.Z)(Ee,te),hi="".concat(ht,"-dropdown"),yi=sn;Hn&&(yi=Hn(sn));var Mi=fe.useMemo(function(){return mn||z(Mn)},[mn,Mn]),wi=dn?"".concat(hi,"-").concat(dn):It,ai=typeof Mn=="number",Pi=fe.useMemo(function(){return ai?null:Mn===!1?"minWidth":"width"},[Mn,ai]),li=Kt;ai&&(li=(0,ze.Z)((0,ze.Z)({},li),{},{width:Mn}));var fi=fe.useRef(null);return fe.useImperativeHandle(Et,function(){return{getPopupElement:function(){var Di;return(Di=fi.current)===null||Di===void 0?void 0:Di.popupElement}}}),fe.createElement(ae.Z,(0,ie.Z)({},Ni,{showAction:zn?["click"]:[],hideAction:zn?["click"]:[],popupPlacement:bn||(qt==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:Mi,prefixCls:hi,popupTransitionName:wi,popup:fe.createElement("div",{onMouseEnter:gi},yi),ref:fi,stretch:Pi,popupAlign:mi,popupVisible:pt,getPopupContainer:Vn,popupClassName:me()(Ae,(0,Me.Z)({},"".concat(hi,"-empty"),On)),popupStyle:li,getTriggerDOMNode:ci,onPopupVisibleChange:zn}),Ut)},ue=fe.forwardRef(oe),ne=ue,be=he(40954);function Ve(Se,Ee){var Et=Se.key,ht;return"value"in Se&&(ht=Se.value),Et!=null?Et:ht!==void 0?ht:"rc-index-key-".concat(Ee)}function Tt(Se){return typeof Se!="undefined"&&!Number.isNaN(Se)}function bt(Se,Ee){var Et=Se||{},ht=Et.label,Re=Et.value,pt=Et.options,Ut=Et.groupLabel,sn=ht||(Ee?"children":"label");return{label:sn,value:Re||"value",options:pt||"options",groupLabel:Ut||sn}}function ft(Se){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Et=Ee.fieldNames,ht=Ee.childrenAsData,Re=[],pt=bt(Et,!1),Ut=pt.label,sn=pt.value,dn=pt.options,It=pt.groupLabel;function Kt(Ae,Tn){Array.isArray(Ae)&&Ae.forEach(function(qt){if(Tn||!(dn in qt)){var bn=qt[sn];Re.push({key:Ve(qt,Re.length),groupOption:Tn,data:qt,label:qt[Ut],value:bn})}else{var mn=qt[It];mn===void 0&&ht&&(mn=qt.label),Re.push({key:Ve(qt,Re.length),group:!0,data:qt,label:mn}),Kt(qt[dn],!0)}})}return Kt(Se,!1),Re}function yt(Se){var Ee=(0,ze.Z)({},Se);return"props"in Ee||Object.defineProperty(Ee,"props",{get:function(){return(0,we.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),Ee}}),Ee}var Vt=function(Ee,Et,ht){if(!Et||!Et.length)return null;var Re=!1,pt=function sn(dn,It){var Kt=(0,be.Z)(It),Ae=Kt[0],Tn=Kt.slice(1);if(!Ae)return[dn];var qt=dn.split(Ae);return Re=Re||qt.length>1,qt.reduce(function(bn,mn){return[].concat((0,et.Z)(bn),(0,et.Z)(sn(mn,Tn)))},[]).filter(Boolean)},Ut=pt(Ee,Et);return Re?typeof ht!="undefined"?Ut.slice(0,ht):Ut:null},Wt=fe.createContext(null),qe=Wt;function nt(Se){var Ee=Se.visible,Et=Se.values;if(!Ee)return null;var ht=50;return fe.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(Et.slice(0,ht).map(function(Re){var pt=Re.label,Ut=Re.value;return["number","string"].includes((0,Fe.Z)(pt))?pt:Ut}).join(", ")),Et.length>ht?", ...":null)}var _e=["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","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],xt=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],Ft=function(Ee){return Ee==="tags"||Ee==="multiple"},Qt=fe.forwardRef(function(Se,Ee){var Et,ht=Se.id,Re=Se.prefixCls,pt=Se.className,Ut=Se.showSearch,sn=Se.tagRender,dn=Se.direction,It=Se.omitDomProps,Kt=Se.displayValues,Ae=Se.onDisplayValuesChange,Tn=Se.emptyOptions,qt=Se.notFoundContent,bn=qt===void 0?"Not Found":qt,mn=Se.onClear,Mn=Se.mode,Hn=Se.disabled,mi=Se.loading,Vn=Se.getInputElement,On=Se.getRawInputElement,ci=Se.open,zn=Se.defaultOpen,gi=Se.onDropdownVisibleChange,Ni=Se.activeValue,hi=Se.onActiveValueChange,yi=Se.activeDescendantId,Mi=Se.searchValue,wi=Se.autoClearSearchValue,ai=Se.onSearch,Pi=Se.onSearchSplit,li=Se.tokenSeparators,fi=Se.allowClear,Ci=Se.prefix,Di=Se.suffixIcon,pi=Se.clearIcon,ri=Se.OptionList,ni=Se.animation,Bi=Se.transitionName,Zi=Se.dropdownStyle,Gi=Se.dropdownClassName,oi=Se.dropdownMatchSelectWidth,ar=Se.dropdownRender,di=Se.dropdownAlign,lr=Se.placement,tr=Se.builtinPlacements,Ii=Se.getPopupContainer,Un=Se.showAction,Mt=Un===void 0?[]:Un,Ht=Se.onFocus,gn=Se.onBlur,on=Se.onKeyUp,An=Se.onKeyDown,Nt=Se.onMouseDown,Lt=(0,ge.Z)(Se,_e),jt=Ft(Mn),Xt=(Ut!==void 0?Ut:jt)||Mn==="combobox",Wn=(0,ze.Z)({},Lt);xt.forEach(function(ui){delete Wn[ui]}),It==null||It.forEach(function(ui){delete Wn[ui]});var Kn=fe.useState(!1),Ei=(0,pe.Z)(Kn,2),Xn=Ei[0],si=Ei[1];fe.useEffect(function(){si((0,Ne.Z)())},[]);var _i=fe.useRef(null),ji=fe.useRef(null),Si=fe.useRef(null),Yi=fe.useRef(null),Ai=fe.useRef(null),dr=fe.useRef(!1),zr=st(),Ir=(0,pe.Z)(zr,3),xr=Ir[0],mr=Ir[1],Li=Ir[2];fe.useImperativeHandle(Ee,function(){var ui,qn;return{focus:(ui=Yi.current)===null||ui===void 0?void 0:ui.focus,blur:(qn=Yi.current)===null||qn===void 0?void 0:qn.blur,scrollTo:function(fr){var Ui;return(Ui=Ai.current)===null||Ui===void 0?void 0:Ui.scrollTo(fr)},nativeElement:_i.current||ji.current}});var wr=fe.useMemo(function(){var ui;if(Mn!=="combobox")return Mi;var qn=(ui=Kt[0])===null||ui===void 0?void 0:ui.value;return typeof qn=="string"||typeof qn=="number"?String(qn):""},[Mi,Mn,Kt]),eo=Mn==="combobox"&&typeof Vn=="function"&&Vn()||null,Xi=typeof On=="function"&&On(),Nr=(0,De.x1)(ji,Xi==null||(Et=Xi.props)===null||Et===void 0?void 0:Et.ref),Xr=fe.useState(!1),hr=(0,pe.Z)(Xr,2),ao=hr[0],_r=hr[1];(0,rt.Z)(function(){_r(!0)},[]);var Oi=(0,Ie.Z)(!1,{defaultValue:zn,value:ci}),to=(0,pe.Z)(Oi,2),lo=to[0],Zr=to[1],qi=ao?lo:!1,xo=!bn&&Tn;(Hn||xo&&qi&&Mn==="combobox")&&(qi=!1);var so=xo?!1:qi,Pn=fe.useCallback(function(ui){var qn=ui!==void 0?ui:!qi;Hn||(Zr(qn),qi!==qn&&(gi==null||gi(qn)))},[Hn,qi,Zr,gi]),Yn=fe.useMemo(function(){return(li||[]).some(function(ui){return[`
`,`\r
`].includes(ui)})},[li]),Nn=fe.useContext(qe)||{},Zn=Nn.maxCount,vi=Nn.rawValues,Fi=function(qn,ur,fr){if(!(jt&&Tt(Zn)&&(vi==null?void 0:vi.size)>=Zn)){var Ui=!0,$i=qn;hi==null||hi(null);var Vr=Vt(qn,li,Tt(Zn)?Zn-vi.size:void 0),Hr=fr?null:Vr;return Mn!=="combobox"&&Hr&&($i="",Pi==null||Pi(Hr),Pn(!1),Ui=!1),ai&&wr!==$i&&ai($i,{source:ur?"typing":"effect"}),Ui}},Gr=function(qn){!qn||!qn.trim()||ai(qn,{source:"submit"})};fe.useEffect(function(){!qi&&!jt&&Mn!=="combobox"&&Fi("",!1,!1)},[qi]),fe.useEffect(function(){lo&&Hn&&Zr(!1),Hn&&!dr.current&&mr(!1)},[Hn]);var gr=$e(),sr=(0,pe.Z)(gr,2),Vi=sr[0],Or=sr[1],qr=fe.useRef(!1),Tr=function(qn){var ur=Vi(),fr=qn.key,Ui=fr==="Enter";if(Ui&&(Mn!=="combobox"&&qn.preventDefault(),qi||Pn(!0)),Or(!!wr),fr==="Backspace"&&!ur&&jt&&!wr&&Kt.length){for(var $i=(0,et.Z)(Kt),Vr=null,Hr=$i.length-1;Hr>=0;Hr-=1){var io=$i[Hr];if(!io.disabled){$i.splice(Hr,1),Vr=io;break}}Vr&&Ae($i,{type:"remove",values:[Vr]})}for(var Mr=arguments.length,Ar=new Array(Mr>1?Mr-1:0),Ur=1;Ur<Mr;Ur++)Ar[Ur-1]=arguments[Ur];if(qi&&(!Ui||!qr.current)){var co;Ui&&(qr.current=!0),(co=Ai.current)===null||co===void 0||co.onKeyDown.apply(co,[qn].concat(Ar))}An==null||An.apply(void 0,[qn].concat(Ar))},Jr=function(qn){for(var ur=arguments.length,fr=new Array(ur>1?ur-1:0),Ui=1;Ui<ur;Ui++)fr[Ui-1]=arguments[Ui];if(qi){var $i;($i=Ai.current)===null||$i===void 0||$i.onKeyUp.apply($i,[qn].concat(fr))}qn.key==="Enter"&&(qr.current=!1),on==null||on.apply(void 0,[qn].concat(fr))},no=function(qn){var ur=Kt.filter(function(fr){return fr!==qn});Ae(ur,{type:"remove",values:[qn]})},jr=function(){qr.current=!1},Ao=fe.useRef(!1),ja=function(){mr(!0),Hn||(Ht&&!Ao.current&&Ht.apply(void 0,arguments),Mt.includes("focus")&&Pn(!0)),Ao.current=!0},ya=function(){dr.current=!0,mr(!1,function(){Ao.current=!1,dr.current=!1,Pn(!1)}),!Hn&&(wr&&(Mn==="tags"?ai(wr,{source:"submit"}):Mn==="multiple"&&ai("",{source:"blur"})),gn&&gn.apply(void 0,arguments))},Qr=[];fe.useEffect(function(){return function(){Qr.forEach(function(ui){return clearTimeout(ui)}),Qr.splice(0,Qr.length)}},[]);var uo=function(qn){var ur,fr=qn.target,Ui=(ur=Si.current)===null||ur===void 0?void 0:ur.getPopupElement();if(Ui&&Ui.contains(fr)){var $i=setTimeout(function(){var Mr=Qr.indexOf($i);if(Mr!==-1&&Qr.splice(Mr,1),Li(),!Xn&&!Ui.contains(document.activeElement)){var Ar;(Ar=Yi.current)===null||Ar===void 0||Ar.focus()}});Qr.push($i)}for(var Vr=arguments.length,Hr=new Array(Vr>1?Vr-1:0),io=1;io<Vr;io++)Hr[io-1]=arguments[io];Nt==null||Nt.apply(void 0,[qn].concat(Hr))},Wr=fe.useState({}),ba=(0,pe.Z)(Wr,2),xa=ba[1];function Va(){xa({})}var wa;Xi&&(wa=function(qn){Pn(qn)}),lt(function(){var ui;return[_i.current,(ui=Si.current)===null||ui===void 0?void 0:ui.getPopupElement()]},so,Pn,!!Xi);var Ua=fe.useMemo(function(){return(0,ze.Z)((0,ze.Z)({},Se),{},{notFoundContent:bn,open:qi,triggerOpen:so,id:ht,showSearch:Xt,multiple:jt,toggleOpen:Pn})},[Se,bn,so,qi,ht,Xt,jt,Pn]),Ko=!!Di||mi,Yo;Ko&&(Yo=fe.createElement(xe,{className:me()("".concat(Re,"-arrow"),(0,Me.Z)({},"".concat(Re,"-arrow-loading"),mi)),customizeIcon:Di,customizeIconProps:{loading:mi,searchValue:wr,open:qi,focused:xr,showSearch:Xt}}));var wo=function(){var qn;mn==null||mn(),(qn=Yi.current)===null||qn===void 0||qn.focus(),Ae([],{type:"clear",values:Kt}),Fi("",!1,!1)},Xo=Oe(Re,wo,Kt,fi,pi,Hn,wr,Mn),Ca=Xo.allowClear,qo=Xo.clearIcon,Po=fe.createElement(ri,{ref:Ai}),Sa=me()(Re,pt,(0,Me.Z)((0,Me.Z)((0,Me.Z)((0,Me.Z)((0,Me.Z)((0,Me.Z)((0,Me.Z)((0,Me.Z)((0,Me.Z)((0,Me.Z)({},"".concat(Re,"-focused"),xr),"".concat(Re,"-multiple"),jt),"".concat(Re,"-single"),!jt),"".concat(Re,"-allow-clear"),fi),"".concat(Re,"-show-arrow"),Ko),"".concat(Re,"-disabled"),Hn),"".concat(Re,"-loading"),mi),"".concat(Re,"-open"),qi),"".concat(Re,"-customize-input"),eo),"".concat(Re,"-show-search"),Xt)),Bo=fe.createElement(ne,{ref:Si,disabled:Hn,prefixCls:Re,visible:so,popupElement:Po,animation:ni,transitionName:Bi,dropdownStyle:Zi,dropdownClassName:Gi,direction:dn,dropdownMatchSelectWidth:oi,dropdownRender:ar,dropdownAlign:di,placement:lr,builtinPlacements:tr,getPopupContainer:Ii,empty:Tn,getTriggerDOMNode:function(qn){return ji.current||qn},onPopupVisibleChange:wa,onPopupMouseEnter:Va},Xi?fe.cloneElement(Xi,{ref:Nr}):fe.createElement(St,(0,ie.Z)({},Se,{domRef:ji,prefixCls:Re,inputElement:eo,ref:Yi,id:ht,prefix:Ci,showSearch:Xt,autoClearSearchValue:wi,mode:Mn,activeDescendantId:yi,tagRender:sn,values:Kt,open:qi,onToggleOpen:Pn,activeValue:Ni,searchValue:wr,onSearch:Fi,onSearchSubmit:Gr,onRemove:no,tokenWithEnter:Yn,onInputBlur:jr}))),Cr;return Xi?Cr=Bo:Cr=fe.createElement("div",(0,ie.Z)({className:Sa},Wn,{ref:_i,onMouseDown:uo,onKeyDown:Tr,onKeyUp:Jr,onFocus:ja,onBlur:ya}),fe.createElement(nt,{visible:xr&&!qi,values:Kt}),Bo,Yo,Ca&&qo),fe.createElement(Xe.Provider,{value:Ua},Cr)}),Ue=Qt,tn=function(){return null};tn.isSelectOptGroup=!0;var ke=tn,kt=function(){return null};kt.isSelectOption=!0;var Zt=kt,_n=he(80547),Rt=he(2738),un=he(6790);function $n(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var Gn=["disabled","title","children","style","className"];function bi(Se){return typeof Se=="string"||typeof Se=="number"}var xi=function(Ee,Et){var ht=Je(),Re=ht.prefixCls,pt=ht.id,Ut=ht.open,sn=ht.multiple,dn=ht.mode,It=ht.searchValue,Kt=ht.toggleOpen,Ae=ht.notFoundContent,Tn=ht.onPopupScroll,qt=fe.useContext(qe),bn=qt.maxCount,mn=qt.flattenOptions,Mn=qt.onActiveValue,Hn=qt.defaultActiveFirstOption,mi=qt.onSelect,Vn=qt.menuItemSelectedIcon,On=qt.rawValues,ci=qt.fieldNames,zn=qt.virtual,gi=qt.direction,Ni=qt.listHeight,hi=qt.listItemHeight,yi=qt.optionRender,Mi="".concat(Re,"-item"),wi=(0,_n.Z)(function(){return mn},[Ut,mn],function(Un,Mt){return Mt[0]&&Un[1]!==Mt[1]}),ai=fe.useRef(null),Pi=fe.useMemo(function(){return sn&&Tt(bn)&&(On==null?void 0:On.size)>=bn},[sn,bn,On==null?void 0:On.size]),li=function(Mt){Mt.preventDefault()},fi=function(Mt){var Ht;(Ht=ai.current)===null||Ht===void 0||Ht.scrollTo(typeof Mt=="number"?{index:Mt}:Mt)},Ci=fe.useCallback(function(Un){return dn==="combobox"?!1:On.has(Un)},[dn,(0,et.Z)(On).toString(),On.size]),Di=function(Mt){for(var Ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,gn=wi.length,on=0;on<gn;on+=1){var An=(Mt+on*Ht+gn)%gn,Nt=wi[An]||{},Lt=Nt.group,jt=Nt.data;if(!Lt&&!(jt!=null&&jt.disabled)&&(Ci(jt.value)||!Pi))return An}return-1},pi=fe.useState(function(){return Di(0)}),ri=(0,pe.Z)(pi,2),ni=ri[0],Bi=ri[1],Zi=function(Mt){var Ht=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Bi(Mt);var gn={source:Ht?"keyboard":"mouse"},on=wi[Mt];if(!on){Mn(null,-1,gn);return}Mn(on.value,Mt,gn)};(0,fe.useEffect)(function(){Zi(Hn!==!1?Di(0):-1)},[wi.length,It]);var Gi=fe.useCallback(function(Un){return dn==="combobox"?String(Un).toLowerCase()===It.toLowerCase():On.has(Un)},[dn,It,(0,et.Z)(On).toString(),On.size]);(0,fe.useEffect)(function(){var Un=setTimeout(function(){if(!sn&&Ut&&On.size===1){var Ht=Array.from(On)[0],gn=wi.findIndex(function(on){var An=on.data;return It?String(An.value).startsWith(It):An.value===Ht});gn!==-1&&(Zi(gn),fi(gn))}});if(Ut){var Mt;(Mt=ai.current)===null||Mt===void 0||Mt.scrollTo(void 0)}return function(){return clearTimeout(Un)}},[Ut,It]);var oi=function(Mt){Mt!==void 0&&mi(Mt,{selected:!On.has(Mt)}),sn||Kt(!1)};if(fe.useImperativeHandle(Et,function(){return{onKeyDown:function(Mt){var Ht=Mt.which,gn=Mt.ctrlKey;switch(Ht){case it.Z.N:case it.Z.P:case it.Z.UP:case it.Z.DOWN:{var on=0;if(Ht===it.Z.UP?on=-1:Ht===it.Z.DOWN?on=1:$n()&&gn&&(Ht===it.Z.N?on=1:Ht===it.Z.P&&(on=-1)),on!==0){var An=Di(ni+on,on);fi(An),Zi(An,!0)}break}case it.Z.TAB:case it.Z.ENTER:{var Nt,Lt=wi[ni];Lt&&!(Lt!=null&&(Nt=Lt.data)!==null&&Nt!==void 0&&Nt.disabled)&&!Pi?oi(Lt.value):oi(void 0),Ut&&Mt.preventDefault();break}case it.Z.ESC:Kt(!1),Ut&&Mt.stopPropagation()}},onKeyUp:function(){},scrollTo:function(Mt){fi(Mt)}}}),wi.length===0)return fe.createElement("div",{role:"listbox",id:"".concat(pt,"_list"),className:"".concat(Mi,"-empty"),onMouseDown:li},Ae);var ar=Object.keys(ci).map(function(Un){return ci[Un]}),di=function(Mt){return Mt.label};function lr(Un,Mt){var Ht=Un.group;return{role:Ht?"presentation":"option",id:"".concat(pt,"_list_").concat(Mt)}}var tr=function(Mt){var Ht=wi[Mt];if(!Ht)return null;var gn=Ht.data||{},on=gn.value,An=Ht.group,Nt=(0,Ye.Z)(gn,!0),Lt=di(Ht);return Ht?fe.createElement("div",(0,ie.Z)({"aria-label":typeof Lt=="string"&&!An?Lt:null},Nt,{key:Mt},lr(Ht,Mt),{"aria-selected":Gi(on)}),on):null},Ii={role:"listbox",id:"".concat(pt,"_list")};return fe.createElement(fe.Fragment,null,zn&&fe.createElement("div",(0,ie.Z)({},Ii,{style:{height:0,width:0,overflow:"hidden"}}),tr(ni-1),tr(ni),tr(ni+1)),fe.createElement(un.Z,{itemKey:"key",ref:ai,data:wi,height:Ni,itemHeight:hi,fullHeight:!1,onMouseDown:li,onScroll:Tn,virtual:zn,direction:gi,innerProps:zn?null:Ii},function(Un,Mt){var Ht=Un.group,gn=Un.groupOption,on=Un.data,An=Un.label,Nt=Un.value,Lt=on.key;if(Ht){var jt,Xt=(jt=on.title)!==null&&jt!==void 0?jt:bi(An)?An.toString():void 0;return fe.createElement("div",{className:me()(Mi,"".concat(Mi,"-group"),on.className),title:Xt},An!==void 0?An:Lt)}var Wn=on.disabled,Kn=on.title,Ei=on.children,Xn=on.style,si=on.className,_i=(0,ge.Z)(on,Gn),ji=(0,Rt.Z)(_i,ar),Si=Ci(Nt),Yi=Wn||!Si&&Pi,Ai="".concat(Mi,"-option"),dr=me()(Mi,Ai,si,(0,Me.Z)((0,Me.Z)((0,Me.Z)((0,Me.Z)({},"".concat(Ai,"-grouped"),gn),"".concat(Ai,"-active"),ni===Mt&&!Yi),"".concat(Ai,"-disabled"),Yi),"".concat(Ai,"-selected"),Si)),zr=di(Un),Ir=!Vn||typeof Vn=="function"||Si,xr=typeof zr=="number"?zr:zr||Nt,mr=bi(xr)?xr.toString():void 0;return Kn!==void 0&&(mr=Kn),fe.createElement("div",(0,ie.Z)({},(0,Ye.Z)(ji),zn?{}:lr(Un,Mt),{"aria-selected":Gi(Nt),className:dr,title:mr,onMouseMove:function(){ni===Mt||Yi||Zi(Mt)},onClick:function(){Yi||oi(Nt)},style:Xn}),fe.createElement("div",{className:"".concat(Ai,"-content")},typeof yi=="function"?yi(Un,{index:Mt}):xr),fe.isValidElement(Vn)||Si,Ir&&fe.createElement(xe,{className:"".concat(Mi,"-option-state"),customizeIcon:Vn,customizeIconProps:{value:Nt,disabled:Yi,isSelected:Si}},Si?"\u2713":null))}))},ei=fe.forwardRef(xi),Jn=ei,Dn=function(Se,Ee){var Et=fe.useRef({values:new Map,options:new Map}),ht=fe.useMemo(function(){var pt=Et.current,Ut=pt.values,sn=pt.options,dn=Se.map(function(Ae){if(Ae.label===void 0){var Tn;return(0,ze.Z)((0,ze.Z)({},Ae),{},{label:(Tn=Ut.get(Ae.value))===null||Tn===void 0?void 0:Tn.label})}return Ae}),It=new Map,Kt=new Map;return dn.forEach(function(Ae){It.set(Ae.value,Ae),Kt.set(Ae.value,Ee.get(Ae.value)||sn.get(Ae.value))}),Et.current.values=It,Et.current.options=Kt,dn},[Se,Ee]),Re=fe.useCallback(function(pt){return Ee.get(pt)||Et.current.options.get(pt)},[Ee]);return[ht,Re]};function ti(Se,Ee){return wt(Se).join("").toUpperCase().includes(Ee)}var Bn=function(Se,Ee,Et,ht,Re){return fe.useMemo(function(){if(!Et||ht===!1)return Se;var pt=Ee.options,Ut=Ee.label,sn=Ee.value,dn=[],It=typeof ht=="function",Kt=Et.toUpperCase(),Ae=It?ht:function(qt,bn){return Re?ti(bn[Re],Kt):bn[pt]?ti(bn[Ut!=="children"?Ut:"label"],Kt):ti(bn[sn],Kt)},Tn=It?function(qt){return yt(qt)}:function(qt){return qt};return Se.forEach(function(qt){if(qt[pt]){var bn=Ae(Et,Tn(qt));if(bn)dn.push(qt);else{var mn=qt[pt].filter(function(Mn){return Ae(Et,Tn(Mn))});mn.length&&dn.push((0,ze.Z)((0,ze.Z)({},qt),{},(0,Me.Z)({},pt,mn)))}return}Ae(Et,Tn(qt))&&dn.push(qt)}),dn},[Se,ht,Re,Et,Ee])},vn=he(6551),Sn=he(11592),En=["children","value"],jn=["children"];function Gt(Se){var Ee=Se,Et=Ee.key,ht=Ee.props,Re=ht.children,pt=ht.value,Ut=(0,ge.Z)(ht,En);return(0,ze.Z)({key:Et,value:pt!==void 0?pt:Et,children:Re},Ut)}function cn(Se){var Ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,Sn.Z)(Se).map(function(Et,ht){if(!fe.isValidElement(Et)||!Et.type)return null;var Re=Et,pt=Re.type.isSelectOptGroup,Ut=Re.key,sn=Re.props,dn=sn.children,It=(0,ge.Z)(sn,jn);return Ee||!pt?Gt(Et):(0,ze.Z)((0,ze.Z)({key:"__RC_SELECT_GRP__".concat(Ut===null?ht:Ut,"__"),label:Ut},It),{},{options:cn(dn)})}).filter(function(Et){return Et})}var xn=function(Ee,Et,ht,Re,pt){return fe.useMemo(function(){var Ut=Ee,sn=!Ee;sn&&(Ut=cn(Et));var dn=new Map,It=new Map,Kt=function(qt,bn,mn){mn&&typeof mn=="string"&&qt.set(bn[mn],bn)},Ae=function Tn(qt){for(var bn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,mn=0;mn<qt.length;mn+=1){var Mn=qt[mn];!Mn[ht.options]||bn?(dn.set(Mn[ht.value],Mn),Kt(It,Mn,ht.label),Kt(It,Mn,Re),Kt(It,Mn,pt)):Tn(Mn[ht.options],!0)}};return Ae(Ut),{options:Ut,valueOptions:dn,labelOptions:It}},[Ee,Et,ht,Re,pt])},kn=xn;function Qn(Se){var Ee=fe.useRef();Ee.current=Se;var Et=fe.useCallback(function(){return Ee.current.apply(Ee,arguments)},[]);return Et}function Cn(Se){var Ee=Se.mode,Et=Se.options,ht=Se.children,Re=Se.backfill,pt=Se.allowClear,Ut=Se.placeholder,sn=Se.getInputElement,dn=Se.showSearch,It=Se.onSearch,Kt=Se.defaultOpen,Ae=Se.autoFocus,Tn=Se.labelInValue,qt=Se.value,bn=Se.inputValue,mn=Se.optionLabelProp,Mn=isMultiple(Ee),Hn=dn!==void 0?dn:Mn||Ee==="combobox",mi=Et||convertChildrenToData(ht);if(warning(Ee!=="tags"||mi.every(function(zn){return!zn.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Ee==="tags"||Ee==="combobox"){var Vn=mi.some(function(zn){return zn.options?zn.options.some(function(gi){return typeof("value"in gi?gi.value:gi.key)=="number"}):typeof("value"in zn?zn.value:zn.key)=="number"});warning(!Vn,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(Ee!=="combobox"||!mn,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(Ee==="combobox"||!Re,"`backfill` only works with `combobox` mode."),warning(Ee==="combobox"||!sn,"`getInputElement` only work with `combobox` mode."),noteOnce(Ee!=="combobox"||!sn||!pt||!Ut,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),It&&!Hn&&Ee!=="combobox"&&Ee!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!Kt||Ae,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),qt!=null){var On=toArray(qt);warning(!Tn||On.every(function(zn){return _typeof(zn)==="object"&&("key"in zn||"value"in zn)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!Mn||Array.isArray(qt),"`value` should be array when `mode` is `multiple` or `tags`")}if(ht){var ci=null;toNodeArray(ht).some(function(zn){if(!React.isValidElement(zn)||!zn.type)return!1;var gi=zn,Ni=gi.type;if(Ni.isSelectOption)return!1;if(Ni.isSelectOptGroup){var hi=toNodeArray(zn.props.children).every(function(yi){return!React.isValidElement(yi)||!zn.type||yi.type.isSelectOption?!0:(ci=yi.type,!1)});return!hi}return ci=Ni,!0}),ci&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ci.displayName||ci.name||ci,"`.")),warning(bn===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function Fn(Se,Ee){if(Se){var Et=function ht(Re){for(var pt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ut=0;Ut<Re.length;Ut++){var sn=Re[Ut];if(sn[Ee==null?void 0:Ee.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!pt&&Array.isArray(sn[Ee==null?void 0:Ee.options])&&ht(sn[Ee==null?void 0:Ee.options],!0))break}};Et(Se)}}var wn=null,rn=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],nn=["inputValue"];function dt(Se){return!Se||(0,Fe.Z)(Se)!=="object"}var Ze=fe.forwardRef(function(Se,Ee){var Et=Se.id,ht=Se.mode,Re=Se.prefixCls,pt=Re===void 0?"rc-select":Re,Ut=Se.backfill,sn=Se.fieldNames,dn=Se.inputValue,It=Se.searchValue,Kt=Se.onSearch,Ae=Se.autoClearSearchValue,Tn=Ae===void 0?!0:Ae,qt=Se.onSelect,bn=Se.onDeselect,mn=Se.dropdownMatchSelectWidth,Mn=mn===void 0?!0:mn,Hn=Se.filterOption,mi=Se.filterSort,Vn=Se.optionFilterProp,On=Se.optionLabelProp,ci=Se.options,zn=Se.optionRender,gi=Se.children,Ni=Se.defaultActiveFirstOption,hi=Se.menuItemSelectedIcon,yi=Se.virtual,Mi=Se.direction,wi=Se.listHeight,ai=wi===void 0?200:wi,Pi=Se.listItemHeight,li=Pi===void 0?20:Pi,fi=Se.labelRender,Ci=Se.value,Di=Se.defaultValue,pi=Se.labelInValue,ri=Se.onChange,ni=Se.maxCount,Bi=(0,ge.Z)(Se,rn),Zi=(0,vn.ZP)(Et),Gi=Ft(ht),oi=!!(!ci&&gi),ar=fe.useMemo(function(){return Hn===void 0&&ht==="combobox"?!1:Hn},[Hn,ht]),di=fe.useMemo(function(){return bt(sn,oi)},[JSON.stringify(sn),oi]),lr=(0,Ie.Z)("",{value:It!==void 0?It:dn,postState:function(Yn){return Yn||""}}),tr=(0,pe.Z)(lr,2),Ii=tr[0],Un=tr[1],Mt=kn(ci,gi,di,Vn,On),Ht=Mt.valueOptions,gn=Mt.labelOptions,on=Mt.options,An=fe.useCallback(function(Pn){var Yn=wt(Pn);return Yn.map(function(Nn){var Zn,vi,Fi,Gr,gr;if(dt(Nn))Zn=Nn;else{var sr;Fi=Nn.key,vi=Nn.label,Zn=(sr=Nn.value)!==null&&sr!==void 0?sr:Fi}var Vi=Ht.get(Zn);if(Vi){var Or;if(vi===void 0&&(vi=Vi==null?void 0:Vi[On||di.label]),Fi===void 0&&(Fi=(Or=Vi==null?void 0:Vi.key)!==null&&Or!==void 0?Or:Zn),Gr=Vi==null?void 0:Vi.disabled,gr=Vi==null?void 0:Vi.title,0)var qr}return{label:vi,value:Zn,key:Fi,disabled:Gr,title:gr}})},[di,On,Ht]),Nt=(0,Ie.Z)(Di,{value:Ci}),Lt=(0,pe.Z)(Nt,2),jt=Lt[0],Xt=Lt[1],Wn=fe.useMemo(function(){var Pn,Yn=Gi&&jt===null?[]:jt,Nn=An(Yn);return ht==="combobox"&&de((Pn=Nn[0])===null||Pn===void 0?void 0:Pn.value)?[]:Nn},[jt,An,ht,Gi]),Kn=Dn(Wn,Ht),Ei=(0,pe.Z)(Kn,2),Xn=Ei[0],si=Ei[1],_i=fe.useMemo(function(){if(!ht&&Xn.length===1){var Pn=Xn[0];if(Pn.value===null&&(Pn.label===null||Pn.label===void 0))return[]}return Xn.map(function(Yn){var Nn;return(0,ze.Z)((0,ze.Z)({},Yn),{},{label:(Nn=typeof fi=="function"?fi(Yn):Yn.label)!==null&&Nn!==void 0?Nn:Yn.value})})},[ht,Xn,fi]),ji=fe.useMemo(function(){return new Set(Xn.map(function(Pn){return Pn.value}))},[Xn]);fe.useEffect(function(){if(ht==="combobox"){var Pn,Yn=(Pn=Xn[0])===null||Pn===void 0?void 0:Pn.value;Un(ve(Yn)?String(Yn):"")}},[Xn]);var Si=Qn(function(Pn,Yn){var Nn=Yn!=null?Yn:Pn;return(0,Me.Z)((0,Me.Z)({},di.value,Pn),di.label,Nn)}),Yi=fe.useMemo(function(){if(ht!=="tags")return on;var Pn=(0,et.Z)(on),Yn=function(Zn){return Ht.has(Zn)};return(0,et.Z)(Xn).sort(function(Nn,Zn){return Nn.value<Zn.value?-1:1}).forEach(function(Nn){var Zn=Nn.value;Yn(Zn)||Pn.push(Si(Zn,Nn.label))}),Pn},[Si,on,Ht,Xn,ht]),Ai=Bn(Yi,di,Ii,ar,Vn),dr=fe.useMemo(function(){return ht!=="tags"||!Ii||Ai.some(function(Pn){return Pn[Vn||"value"]===Ii})||Ai.some(function(Pn){return Pn[di.value]===Ii})?Ai:[Si(Ii)].concat((0,et.Z)(Ai))},[Si,Vn,ht,Ai,Ii,di]),zr=function Pn(Yn){var Nn=(0,et.Z)(Yn).sort(function(Zn,vi){return mi(Zn,vi,{searchValue:Ii})});return Nn.map(function(Zn){return Array.isArray(Zn.options)?(0,ze.Z)((0,ze.Z)({},Zn),{},{options:Zn.options.length>0?Pn(Zn.options):Zn.options}):Zn})},Ir=fe.useMemo(function(){return mi?zr(dr):dr},[dr,mi,Ii]),xr=fe.useMemo(function(){return ft(Ir,{fieldNames:di,childrenAsData:oi})},[Ir,di,oi]),mr=function(Yn){var Nn=An(Yn);if(Xt(Nn),ri&&(Nn.length!==Xn.length||Nn.some(function(Fi,Gr){var gr;return((gr=Xn[Gr])===null||gr===void 0?void 0:gr.value)!==(Fi==null?void 0:Fi.value)}))){var Zn=pi?Nn:Nn.map(function(Fi){return Fi.value}),vi=Nn.map(function(Fi){return yt(si(Fi.value))});ri(Gi?Zn:Zn[0],Gi?vi:vi[0])}},Li=fe.useState(null),wr=(0,pe.Z)(Li,2),eo=wr[0],Xi=wr[1],Nr=fe.useState(0),Xr=(0,pe.Z)(Nr,2),hr=Xr[0],ao=Xr[1],_r=Ni!==void 0?Ni:ht!=="combobox",Oi=fe.useCallback(function(Pn,Yn){var Nn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Zn=Nn.source,vi=Zn===void 0?"keyboard":Zn;ao(Yn),Ut&&ht==="combobox"&&Pn!==null&&vi==="keyboard"&&Xi(String(Pn))},[Ut,ht]),to=function(Yn,Nn,Zn){var vi=function(){var no,jr=si(Yn);return[pi?{label:jr==null?void 0:jr[di.label],value:Yn,key:(no=jr==null?void 0:jr.key)!==null&&no!==void 0?no:Yn}:Yn,yt(jr)]};if(Nn&&qt){var Fi=vi(),Gr=(0,pe.Z)(Fi,2),gr=Gr[0],sr=Gr[1];qt(gr,sr)}else if(!Nn&&bn&&Zn!=="clear"){var Vi=vi(),Or=(0,pe.Z)(Vi,2),qr=Or[0],Tr=Or[1];bn(qr,Tr)}},lo=Qn(function(Pn,Yn){var Nn,Zn=Gi?Yn.selected:!0;Zn?Nn=Gi?[].concat((0,et.Z)(Xn),[Pn]):[Pn]:Nn=Xn.filter(function(vi){return vi.value!==Pn}),mr(Nn),to(Pn,Zn),ht==="combobox"?Xi(""):(!Ft||Tn)&&(Un(""),Xi(""))}),Zr=function(Yn,Nn){mr(Yn);var Zn=Nn.type,vi=Nn.values;(Zn==="remove"||Zn==="clear")&&vi.forEach(function(Fi){to(Fi.value,!1,Zn)})},qi=function(Yn,Nn){if(Un(Yn),Xi(null),Nn.source==="submit"){var Zn=(Yn||"").trim();if(Zn){var vi=Array.from(new Set([].concat((0,et.Z)(ji),[Zn])));mr(vi),to(Zn,!0),Un("")}return}Nn.source!=="blur"&&(ht==="combobox"&&mr(Yn),Kt==null||Kt(Yn))},xo=function(Yn){var Nn=Yn;ht!=="tags"&&(Nn=Yn.map(function(vi){var Fi=gn.get(vi);return Fi==null?void 0:Fi.value}).filter(function(vi){return vi!==void 0}));var Zn=Array.from(new Set([].concat((0,et.Z)(ji),(0,et.Z)(Nn))));mr(Zn),Zn.forEach(function(vi){to(vi,!0)})},so=fe.useMemo(function(){var Pn=yi!==!1&&Mn!==!1;return(0,ze.Z)((0,ze.Z)({},Mt),{},{flattenOptions:xr,onActiveValue:Oi,defaultActiveFirstOption:_r,onSelect:lo,menuItemSelectedIcon:hi,rawValues:ji,fieldNames:di,virtual:Pn,direction:Mi,listHeight:ai,listItemHeight:li,childrenAsData:oi,maxCount:ni,optionRender:zn})},[ni,Mt,xr,Oi,_r,lo,hi,ji,di,yi,Mn,Mi,ai,li,oi,zn]);return fe.createElement(qe.Provider,{value:so},fe.createElement(Ue,(0,ie.Z)({},Bi,{id:Zi,prefixCls:pt,ref:Ee,omitDomProps:nn,mode:ht,displayValues:_i,onDisplayValuesChange:Zr,direction:Mi,searchValue:Ii,onSearch:qi,autoClearSearchValue:Tn,onSearchSplit:xo,dropdownMatchSelectWidth:Mn,OptionList:Jn,emptyOptions:!xr.length,activeValue:eo,activeDescendantId:"".concat(Zi,"_list_").concat(hr)})))}),Bt=Ze;Bt.Option=Zt,Bt.OptGroup=ke;var hn=Bt,Rn=hn},63158:function(At,_t,he){"use strict";var ie=he(32855),et=he(74430),Me=he(11913),ze=he(43079),pe=he(59301),ge=he(92310),Fe=he.n(ge),Ie=he(18929),we=he(10228),fe=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],Ke=pe.forwardRef(function(me,rt){var Ne,De=me.prefixCls,Le=De===void 0?"rc-switch":De,xe=me.className,Oe=me.checked,Xe=me.defaultChecked,Je=me.disabled,st=me.loadingIcon,$e=me.checkedChildren,lt=me.unCheckedChildren,it=me.onClick,Yt=me.onChange,Ye=me.onKeyDown,Ge=(0,ze.Z)(me,fe),mt=(0,Ie.Z)(!1,{value:Oe,defaultValue:Xe}),Te=(0,Me.Z)(mt,2),Qe=Te[0],Pe=Te[1];function ot(Ot,ve){var de=Qe;return Je||(de=Ot,Pe(de),Yt==null||Yt(de,ve)),de}function $t(Ot){Ot.which===we.Z.LEFT?ot(!1,Ot):Ot.which===we.Z.RIGHT&&ot(!0,Ot),Ye==null||Ye(Ot)}function wt(Ot){var ve=ot(!Qe,Ot);it==null||it(ve,Ot)}var pn=Fe()(Le,xe,(Ne={},(0,et.Z)(Ne,"".concat(Le,"-checked"),Qe),(0,et.Z)(Ne,"".concat(Le,"-disabled"),Je),Ne));return pe.createElement("button",(0,ie.Z)({},Ge,{type:"button",role:"switch","aria-checked":Qe,disabled:Je,className:pn,ref:rt,onKeyDown:$t,onClick:wt}),st,pe.createElement("span",{className:"".concat(Le,"-inner")},pe.createElement("span",{className:"".concat(Le,"-inner-checked")},$e),pe.createElement("span",{className:"".concat(Le,"-inner-unchecked")},lt)))});Ke.displayName="Switch",_t.Z=Ke},22711:function(At,_t,he){"use strict";he.r(_t),he.d(_t,{ResizableTextArea:function(){return Te},default:function(){return $t}});var ie=he(32855),et=he(74430),Me=he(27247),ze=he(3300),pe=he(11913),ge=he(43079),Fe=he(92310),Ie=he.n(Fe),we=he(36901),fe=he(66003),Ke=he(30292),me=he(18929),rt=he(59301),Ne=he(34666),De=he(29301),Le=he(34280),xe=he(16089),Oe=`
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;
`,Xe=["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"],Je={},st;function $e(wt){var pn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ot=wt.getAttribute("id")||wt.getAttribute("data-reactid")||wt.getAttribute("name");if(pn&&Je[Ot])return Je[Ot];var ve=window.getComputedStyle(wt),de=ve.getPropertyValue("box-sizing")||ve.getPropertyValue("-moz-box-sizing")||ve.getPropertyValue("-webkit-box-sizing"),ut=parseFloat(ve.getPropertyValue("padding-bottom"))+parseFloat(ve.getPropertyValue("padding-top")),Jt=parseFloat(ve.getPropertyValue("border-bottom-width"))+parseFloat(ve.getPropertyValue("border-top-width")),Ct=Xe.map(function(tt){return"".concat(tt,":").concat(ve.getPropertyValue(tt))}).join(";"),Be={sizingStyle:Ct,paddingSize:ut,borderSize:Jt,boxSizing:de};return pn&&Ot&&(Je[Ot]=Be),Be}function lt(wt){var pn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ot=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ve=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;st||(st=document.createElement("textarea"),st.setAttribute("tab-index","-1"),st.setAttribute("aria-hidden","true"),st.setAttribute("name","hiddenTextarea"),document.body.appendChild(st)),wt.getAttribute("wrap")?st.setAttribute("wrap",wt.getAttribute("wrap")):st.removeAttribute("wrap");var de=$e(wt,pn),ut=de.paddingSize,Jt=de.borderSize,Ct=de.boxSizing,Be=de.sizingStyle;st.setAttribute("style","".concat(Be,";").concat(Oe)),st.value=wt.value||wt.placeholder||"";var tt=void 0,at=void 0,en,ct=st.scrollHeight;if(Ct==="border-box"?ct+=Jt:Ct==="content-box"&&(ct-=ut),Ot!==null||ve!==null){st.value=" ";var Pt=st.scrollHeight-ut;Ot!==null&&(tt=Pt*Ot,Ct==="border-box"&&(tt=tt+ut+Jt),ct=Math.max(tt,ct)),ve!==null&&(at=Pt*ve,Ct==="border-box"&&(at=at+ut+Jt),en=ct>at?"":"hidden",ct=Math.min(at,ct))}var We={height:ct,overflowY:en,resize:"none"};return tt&&(We.minHeight=tt),at&&(We.maxHeight=at),We}var it=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],Yt=0,Ye=1,Ge=2,mt=rt.forwardRef(function(wt,pn){var Ot=wt,ve=Ot.prefixCls,de=Ot.defaultValue,ut=Ot.value,Jt=Ot.autoSize,Ct=Ot.onResize,Be=Ot.className,tt=Ot.style,at=Ot.disabled,en=Ot.onChange,ct=Ot.onInternalAutoSize,Pt=(0,ge.Z)(Ot,it),We=(0,me.Z)(de,{value:ut,postState:function(Zt){return Zt!=null?Zt:""}}),gt=(0,pe.Z)(We,2),St=gt[0],ae=gt[1],te=function(Zt){ae(Zt.target.value),en==null||en(Zt)},z=rt.useRef();rt.useImperativeHandle(pn,function(){return{textArea:z.current}});var oe=rt.useMemo(function(){return Jt&&(0,Ne.Z)(Jt)==="object"?[Jt.minRows,Jt.maxRows]:[]},[Jt]),ue=(0,pe.Z)(oe,2),ne=ue[0],be=ue[1],Ve=!!Jt,Tt=function(){try{if(document.activeElement===z.current){var Zt=z.current,_n=Zt.selectionStart,Rt=Zt.selectionEnd,un=Zt.scrollTop;z.current.setSelectionRange(_n,Rt),z.current.scrollTop=un}}catch($n){}},bt=rt.useState(Ge),ft=(0,pe.Z)(bt,2),yt=ft[0],Vt=ft[1],Wt=rt.useState(),qe=(0,pe.Z)(Wt,2),nt=qe[0],_e=qe[1],xt=function(){Vt(Yt)};(0,Le.Z)(function(){Ve&&xt()},[ut,ne,be,Ve]),(0,Le.Z)(function(){if(yt===Yt)Vt(Ye);else if(yt===Ye){var kt=lt(z.current,!1,ne,be);Vt(Ge),_e(kt)}else Tt()},[yt]);var Ft=rt.useRef(),Qt=function(){xe.Z.cancel(Ft.current)},Ue=function(Zt){yt===Ge&&(Ct==null||Ct(Zt),Jt&&(Qt(),Ft.current=(0,xe.Z)(function(){xt()})))};rt.useEffect(function(){return Qt},[]);var tn=Ve?nt:null,ke=(0,Me.Z)((0,Me.Z)({},tt),tn);return(yt===Yt||yt===Ye)&&(ke.overflowY="hidden",ke.overflowX="hidden"),rt.createElement(De.Z,{onResize:Ue,disabled:!(Jt||Ct)},rt.createElement("textarea",(0,ie.Z)({},Pt,{ref:z,style:ke,className:Ie()(ve,Be,(0,et.Z)({},"".concat(ve,"-disabled"),at)),disabled:at,value:St,onChange:te})))}),Te=mt,Qe=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],Pe=rt.forwardRef(function(wt,pn){var Ot,ve=wt.defaultValue,de=wt.value,ut=wt.onFocus,Jt=wt.onBlur,Ct=wt.onChange,Be=wt.allowClear,tt=wt.maxLength,at=wt.onCompositionStart,en=wt.onCompositionEnd,ct=wt.suffix,Pt=wt.prefixCls,We=Pt===void 0?"rc-textarea":Pt,gt=wt.showCount,St=wt.count,ae=wt.className,te=wt.style,z=wt.disabled,oe=wt.hidden,ue=wt.classNames,ne=wt.styles,be=wt.onResize,Ve=wt.onClear,Tt=wt.onPressEnter,bt=wt.readOnly,ft=wt.autoSize,yt=wt.onKeyDown,Vt=(0,ge.Z)(wt,Qe),Wt=(0,me.Z)(ve,{value:de,defaultValue:ve}),qe=(0,pe.Z)(Wt,2),nt=qe[0],_e=qe[1],xt=nt==null?"":String(nt),Ft=rt.useState(!1),Qt=(0,pe.Z)(Ft,2),Ue=Qt[0],tn=Qt[1],ke=rt.useRef(!1),kt=rt.useState(null),Zt=(0,pe.Z)(kt,2),_n=Zt[0],Rt=Zt[1],un=(0,rt.useRef)(null),$n=(0,rt.useRef)(null),Gn=function(){var Bt;return(Bt=$n.current)===null||Bt===void 0?void 0:Bt.textArea},bi=function(){Gn().focus()};(0,rt.useImperativeHandle)(pn,function(){var Ze;return{resizableTextArea:$n.current,focus:bi,blur:function(){Gn().blur()},nativeElement:((Ze=un.current)===null||Ze===void 0?void 0:Ze.nativeElement)||Gn()}}),(0,rt.useEffect)(function(){tn(function(Ze){return!z&&Ze})},[z]);var xi=rt.useState(null),ei=(0,pe.Z)(xi,2),Jn=ei[0],Dn=ei[1];rt.useEffect(function(){if(Jn){var Ze;(Ze=Gn()).setSelectionRange.apply(Ze,(0,ze.Z)(Jn))}},[Jn]);var ti=(0,fe.Z)(St,gt),Bn=(Ot=ti.max)!==null&&Ot!==void 0?Ot:tt,vn=Number(Bn)>0,Sn=ti.strategy(xt),En=!!Bn&&Sn>Bn,jn=function(Bt,hn){var Rn=hn;!ke.current&&ti.exceedFormatter&&ti.max&&ti.strategy(hn)>ti.max&&(Rn=ti.exceedFormatter(hn,{max:ti.max}),hn!==Rn&&Dn([Gn().selectionStart||0,Gn().selectionEnd||0])),_e(Rn),(0,Ke.rJ)(Bt.currentTarget,Bt,Ct,Rn)},Gt=function(Bt){ke.current=!0,at==null||at(Bt)},cn=function(Bt){ke.current=!1,jn(Bt,Bt.currentTarget.value),en==null||en(Bt)},xn=function(Bt){jn(Bt,Bt.target.value)},kn=function(Bt){Bt.key==="Enter"&&Tt&&Tt(Bt),yt==null||yt(Bt)},Qn=function(Bt){tn(!0),ut==null||ut(Bt)},Cn=function(Bt){tn(!1),Jt==null||Jt(Bt)},Fn=function(Bt){_e(""),bi(),(0,Ke.rJ)(Gn(),Bt,Ct)},wn=ct,rn;ti.show&&(ti.showFormatter?rn=ti.showFormatter({value:xt,count:Sn,maxLength:Bn}):rn="".concat(Sn).concat(vn?" / ".concat(Bn):""),wn=rt.createElement(rt.Fragment,null,wn,rt.createElement("span",{className:Ie()("".concat(We,"-data-count"),ue==null?void 0:ue.count),style:ne==null?void 0:ne.count},rn)));var nn=function(Bt){var hn;be==null||be(Bt),(hn=Gn())!==null&&hn!==void 0&&hn.style.height&&Rt(!0)},dt=!ft&&!gt&&!Be;return rt.createElement(we.BaseInput,{ref:un,value:xt,allowClear:Be,handleReset:Fn,suffix:wn,prefixCls:We,classNames:(0,Me.Z)((0,Me.Z)({},ue),{},{affixWrapper:Ie()(ue==null?void 0:ue.affixWrapper,(0,et.Z)((0,et.Z)({},"".concat(We,"-show-count"),gt),"".concat(We,"-textarea-allow-clear"),Be))}),disabled:z,focused:Ue,className:Ie()(ae,En&&"".concat(We,"-out-of-range")),style:(0,Me.Z)((0,Me.Z)({},te),_n&&!dt?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof rn=="string"?rn:void 0}},hidden:oe,readOnly:bt,onClear:Ve},rt.createElement(Te,(0,ie.Z)({},Vt,{autoSize:ft,maxLength:tt,onKeyDown:kn,onChange:xn,onFocus:Qn,onBlur:Cn,onCompositionStart:Gt,onCompositionEnd:cn,className:Ie()(ue==null?void 0:ue.textarea),style:(0,Me.Z)((0,Me.Z)({},ne==null?void 0:ne.textarea),{},{resize:te==null?void 0:te.resize}),disabled:z,prefixCls:We,onResize:nn,ref:$n,readOnly:bt})))}),ot=Pe,$t=ot},6790:function(At,_t,he){"use strict";he.d(_t,{Z:function(){return St}});var ie=he(32855),et=he(34666),Me=he(27247),ze=he(74430),pe=he(11913),ge=he(43079),Fe=he(92310),Ie=he.n(Fe),we=he(29301),fe=he(70425),Ke=he(34280),me=he(59301),rt=he(4676),Ne=me.forwardRef(function(ae,te){var z=ae.height,oe=ae.offsetY,ue=ae.offsetX,ne=ae.children,be=ae.prefixCls,Ve=ae.onInnerResize,Tt=ae.innerProps,bt=ae.rtl,ft=ae.extra,yt={},Vt={display:"flex",flexDirection:"column"};return oe!==void 0&&(yt={height:z,position:"relative",overflow:"hidden"},Vt=(0,Me.Z)((0,Me.Z)({},Vt),{},(0,ze.Z)((0,ze.Z)((0,ze.Z)((0,ze.Z)((0,ze.Z)({transform:"translateY(".concat(oe,"px)")},bt?"marginRight":"marginLeft",-ue),"position","absolute"),"left",0),"right",0),"top",0))),me.createElement("div",{style:yt},me.createElement(we.Z,{onResize:function(qe){var nt=qe.offsetHeight;nt&&Ve&&Ve()}},me.createElement("div",(0,ie.Z)({style:Vt,className:Ie()((0,ze.Z)({},"".concat(be,"-holder-inner"),be)),ref:te},Tt),ne,ft)))});Ne.displayName="Filler";var De=Ne;function Le(ae){var te=ae.children,z=ae.setRef,oe=me.useCallback(function(ue){z(ue)},[]);return me.cloneElement(te,{ref:oe})}function xe(ae,te,z,oe,ue,ne,be,Ve){var Tt=Ve.getKey;return ae.slice(te,z+1).map(function(bt,ft){var yt=te+ft,Vt=be(bt,yt,{style:{width:oe},offsetX:ue}),Wt=Tt(bt);return me.createElement(Le,{key:Wt,setRef:function(nt){return ne(bt,nt)}},Vt)})}function Oe(ae,te,z,oe){var ue=z-ae,ne=te-z,be=Math.min(ue,ne)*2;if(oe<=be){var Ve=Math.floor(oe/2);return oe%2?z+Ve+1:z-Ve}return ue>ne?z-(oe-ne):z+(oe-ue)}function Xe(ae,te,z){var oe=ae.length,ue=te.length,ne,be;if(oe===0&&ue===0)return null;oe<ue?(ne=ae,be=te):(ne=te,be=ae);var Ve={__EMPTY_ITEM__:!0};function Tt(qe){return qe!==void 0?z(qe):Ve}for(var bt=null,ft=Math.abs(oe-ue)!==1,yt=0;yt<be.length;yt+=1){var Vt=Tt(ne[yt]),Wt=Tt(be[yt]);if(Vt!==Wt){bt=yt,ft=ft||Vt!==Tt(be[yt+1]);break}}return bt===null?null:{index:bt,multiple:ft}}function Je(ae,te,z){var oe=me.useState(ae),ue=(0,pe.Z)(oe,2),ne=ue[0],be=ue[1],Ve=me.useState(null),Tt=(0,pe.Z)(Ve,2),bt=Tt[0],ft=Tt[1];return me.useEffect(function(){var yt=Xe(ne||[],ae||[],te);(yt==null?void 0:yt.index)!==void 0&&(z==null||z(yt.index),ft(ae[yt.index])),be(ae)},[ae]),[bt]}var st=he(16089),$e=(typeof navigator=="undefined"?"undefined":(0,et.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),lt=$e,it=function(ae,te,z,oe){var ue=(0,me.useRef)(!1),ne=(0,me.useRef)(null);function be(){clearTimeout(ne.current),ue.current=!0,ne.current=setTimeout(function(){ue.current=!1},50)}var Ve=(0,me.useRef)({top:ae,bottom:te,left:z,right:oe});return Ve.current.top=ae,Ve.current.bottom=te,Ve.current.left=z,Ve.current.right=oe,function(Tt,bt){var ft=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,yt=Tt?bt<0&&Ve.current.left||bt>0&&Ve.current.right:bt<0&&Ve.current.top||bt>0&&Ve.current.bottom;return ft&&yt?(clearTimeout(ne.current),ue.current=!1):(!yt||ue.current)&&be(),!ue.current&&yt}};function Yt(ae,te,z,oe,ue,ne,be){var Ve=(0,me.useRef)(0),Tt=(0,me.useRef)(null),bt=(0,me.useRef)(null),ft=(0,me.useRef)(!1),yt=it(te,z,oe,ue);function Vt(Ft,Qt){if(st.Z.cancel(Tt.current),!yt(!1,Qt)){var Ue=Ft;if(!Ue._virtualHandled)Ue._virtualHandled=!0;else return;Ve.current+=Qt,bt.current=Qt,lt||Ue.preventDefault(),Tt.current=(0,st.Z)(function(){var tn=ft.current?10:1;be(Ve.current*tn,!1),Ve.current=0})}}function Wt(Ft,Qt){be(Qt,!0),lt||Ft.preventDefault()}var qe=(0,me.useRef)(null),nt=(0,me.useRef)(null);function _e(Ft){if(ae){st.Z.cancel(nt.current),nt.current=(0,st.Z)(function(){qe.current=null},2);var Qt=Ft.deltaX,Ue=Ft.deltaY,tn=Ft.shiftKey,ke=Qt,kt=Ue;(qe.current==="sx"||!qe.current&&tn&&Ue&&!Qt)&&(ke=Ue,kt=0,qe.current="sx");var Zt=Math.abs(ke),_n=Math.abs(kt);qe.current===null&&(qe.current=ne&&Zt>_n?"x":"y"),qe.current==="y"?Vt(Ft,kt):Wt(Ft,ke)}}function xt(Ft){ae&&(ft.current=Ft.detail===bt.current)}return[_e,xt]}function Ye(ae,te,z,oe){var ue=me.useMemo(function(){return[new Map,[]]},[ae,z.id,oe]),ne=(0,pe.Z)(ue,2),be=ne[0],Ve=ne[1],Tt=function(ft){var yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ft,Vt=be.get(ft),Wt=be.get(yt);if(Vt===void 0||Wt===void 0)for(var qe=ae.length,nt=Ve.length;nt<qe;nt+=1){var _e,xt=ae[nt],Ft=te(xt);be.set(Ft,nt);var Qt=(_e=z.get(Ft))!==null&&_e!==void 0?_e:oe;if(Ve[nt]=(Ve[nt-1]||0)+Qt,Ft===ft&&(Vt=nt),Ft===yt&&(Wt=nt),Vt!==void 0&&Wt!==void 0)break}return{top:Ve[Vt-1]||0,bottom:Ve[Wt]}};return Tt}var Ge=he(33377),mt=he(93912),Te=function(){function ae(){(0,Ge.Z)(this,ae),(0,ze.Z)(this,"maps",void 0),(0,ze.Z)(this,"id",0),(0,ze.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,mt.Z)(ae,[{key:"set",value:function(z,oe){this.diffRecords.set(z,this.maps[z]),this.maps[z]=oe,this.id+=1}},{key:"get",value:function(z){return this.maps[z]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),ae}(),Qe=Te;function Pe(ae){var te=parseFloat(ae);return isNaN(te)?0:te}function ot(ae,te,z){var oe=me.useState(0),ue=(0,pe.Z)(oe,2),ne=ue[0],be=ue[1],Ve=(0,me.useRef)(new Map),Tt=(0,me.useRef)(new Qe),bt=(0,me.useRef)(0);function ft(){bt.current+=1}function yt(){var Wt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;ft();var qe=function(){var xt=!1;Ve.current.forEach(function(Ft,Qt){if(Ft&&Ft.offsetParent){var Ue=Ft.offsetHeight,tn=getComputedStyle(Ft),ke=tn.marginTop,kt=tn.marginBottom,Zt=Pe(ke),_n=Pe(kt),Rt=Ue+Zt+_n;Tt.current.get(Qt)!==Rt&&(Tt.current.set(Qt,Rt),xt=!0)}}),xt&&be(function(Ft){return Ft+1})};if(Wt)qe();else{bt.current+=1;var nt=bt.current;Promise.resolve().then(function(){nt===bt.current&&qe()})}}function Vt(Wt,qe){var nt=ae(Wt),_e=Ve.current.get(nt);qe?(Ve.current.set(nt,qe),yt()):Ve.current.delete(nt),!_e!=!qe&&(qe?te==null||te(Wt):z==null||z(Wt))}return(0,me.useEffect)(function(){return ft},[]),[Vt,yt,Tt.current,ne]}var $t=14/15;function wt(ae,te,z){var oe=(0,me.useRef)(!1),ue=(0,me.useRef)(0),ne=(0,me.useRef)(0),be=(0,me.useRef)(null),Ve=(0,me.useRef)(null),Tt,bt=function(Wt){if(oe.current){var qe=Math.ceil(Wt.touches[0].pageX),nt=Math.ceil(Wt.touches[0].pageY),_e=ue.current-qe,xt=ne.current-nt,Ft=Math.abs(_e)>Math.abs(xt);Ft?ue.current=qe:ne.current=nt;var Qt=z(Ft,Ft?_e:xt,!1,Wt);Qt&&Wt.preventDefault(),clearInterval(Ve.current),Qt&&(Ve.current=setInterval(function(){Ft?_e*=$t:xt*=$t;var Ue=Math.floor(Ft?_e:xt);(!z(Ft,Ue,!0)||Math.abs(Ue)<=.1)&&clearInterval(Ve.current)},16))}},ft=function(){oe.current=!1,Tt()},yt=function(Wt){Tt(),Wt.touches.length===1&&!oe.current&&(oe.current=!0,ue.current=Math.ceil(Wt.touches[0].pageX),ne.current=Math.ceil(Wt.touches[0].pageY),be.current=Wt.target,be.current.addEventListener("touchmove",bt,{passive:!1}),be.current.addEventListener("touchend",ft,{passive:!0}))};Tt=function(){be.current&&(be.current.removeEventListener("touchmove",bt),be.current.removeEventListener("touchend",ft))},(0,Ke.Z)(function(){return ae&&te.current.addEventListener("touchstart",yt,{passive:!0}),function(){var Vt;(Vt=te.current)===null||Vt===void 0||Vt.removeEventListener("touchstart",yt),Tt(),clearInterval(Ve.current)}},[ae])}function pn(ae){return Math.floor(Math.pow(ae,.5))}function Ot(ae,te){var z="touches"in ae?ae.touches[0]:ae;return z[te?"pageX":"pageY"]-window[te?"scrollX":"scrollY"]}function ve(ae,te,z){me.useEffect(function(){var oe=te.current;if(ae&&oe){var ue=!1,ne,be,Ve=function(){st.Z.cancel(ne)},Tt=function Vt(){Ve(),ne=(0,st.Z)(function(){z(be),Vt()})},bt=function(Wt){if(!(Wt.target.draggable||Wt.button!==0)){var qe=Wt;qe._virtualHandled||(qe._virtualHandled=!0,ue=!0)}},ft=function(){ue=!1,Ve()},yt=function(Wt){if(ue){var qe=Ot(Wt,!1),nt=oe.getBoundingClientRect(),_e=nt.top,xt=nt.bottom;if(qe<=_e){var Ft=_e-qe;be=-pn(Ft),Tt()}else if(qe>=xt){var Qt=qe-xt;be=pn(Qt),Tt()}else Ve()}};return oe.addEventListener("mousedown",bt),oe.ownerDocument.addEventListener("mouseup",ft),oe.ownerDocument.addEventListener("mousemove",yt),function(){oe.removeEventListener("mousedown",bt),oe.ownerDocument.removeEventListener("mouseup",ft),oe.ownerDocument.removeEventListener("mousemove",yt),Ve()}}},[ae])}var de=10;function ut(ae,te,z,oe,ue,ne,be,Ve){var Tt=me.useRef(),bt=me.useState(null),ft=(0,pe.Z)(bt,2),yt=ft[0],Vt=ft[1];return(0,Ke.Z)(function(){if(yt&&yt.times<de){if(!ae.current){Vt(function(ti){return(0,Me.Z)({},ti)});return}ne();var Wt=yt.targetAlign,qe=yt.originAlign,nt=yt.index,_e=yt.offset,xt=ae.current.clientHeight,Ft=!1,Qt=Wt,Ue=null;if(xt){for(var tn=Wt||qe,ke=0,kt=0,Zt=0,_n=Math.min(te.length-1,nt),Rt=0;Rt<=_n;Rt+=1){var un=ue(te[Rt]);kt=ke;var $n=z.get(un);Zt=kt+($n===void 0?oe:$n),ke=Zt}for(var Gn=tn==="top"?_e:xt-_e,bi=_n;bi>=0;bi-=1){var xi=ue(te[bi]),ei=z.get(xi);if(ei===void 0){Ft=!0;break}if(Gn-=ei,Gn<=0)break}switch(tn){case"top":Ue=kt-_e;break;case"bottom":Ue=Zt-xt+_e;break;default:{var Jn=ae.current.scrollTop,Dn=Jn+xt;kt<Jn?Qt="top":Zt>Dn&&(Qt="bottom")}}Ue!==null&&be(Ue),Ue!==yt.lastTop&&(Ft=!0)}Ft&&Vt((0,Me.Z)((0,Me.Z)({},yt),{},{times:yt.times+1,targetAlign:Qt,lastTop:Ue}))}},[yt,ae.current]),function(Wt){if(Wt==null){Ve();return}if(st.Z.cancel(Tt.current),typeof Wt=="number")be(Wt);else if(Wt&&(0,et.Z)(Wt)==="object"){var qe,nt=Wt.align;"index"in Wt?qe=Wt.index:qe=te.findIndex(function(Ft){return ue(Ft)===Wt.key});var _e=Wt.offset,xt=_e===void 0?0:_e;Vt({times:0,index:qe,offset:xt,originAlign:nt})}}}var Jt=me.forwardRef(function(ae,te){var z=ae.prefixCls,oe=ae.rtl,ue=ae.scrollOffset,ne=ae.scrollRange,be=ae.onStartMove,Ve=ae.onStopMove,Tt=ae.onScroll,bt=ae.horizontal,ft=ae.spinSize,yt=ae.containerSize,Vt=ae.style,Wt=ae.thumbStyle,qe=ae.showScrollBar,nt=me.useState(!1),_e=(0,pe.Z)(nt,2),xt=_e[0],Ft=_e[1],Qt=me.useState(null),Ue=(0,pe.Z)(Qt,2),tn=Ue[0],ke=Ue[1],kt=me.useState(null),Zt=(0,pe.Z)(kt,2),_n=Zt[0],Rt=Zt[1],un=!oe,$n=me.useRef(),Gn=me.useRef(),bi=me.useState(qe),xi=(0,pe.Z)(bi,2),ei=xi[0],Jn=xi[1],Dn=me.useRef(),ti=function(){qe===!0||qe===!1||(clearTimeout(Dn.current),Jn(!0),Dn.current=setTimeout(function(){Jn(!1)},3e3))},Bn=ne-yt||0,vn=yt-ft||0,Sn=me.useMemo(function(){if(ue===0||Bn===0)return 0;var Fn=ue/Bn;return Fn*vn},[ue,Bn,vn]),En=function(wn){wn.stopPropagation(),wn.preventDefault()},jn=me.useRef({top:Sn,dragging:xt,pageY:tn,startTop:_n});jn.current={top:Sn,dragging:xt,pageY:tn,startTop:_n};var Gt=function(wn){Ft(!0),ke(Ot(wn,bt)),Rt(jn.current.top),be(),wn.stopPropagation(),wn.preventDefault()};me.useEffect(function(){var Fn=function(dt){dt.preventDefault()},wn=$n.current,rn=Gn.current;return wn.addEventListener("touchstart",Fn,{passive:!1}),rn.addEventListener("touchstart",Gt,{passive:!1}),function(){wn.removeEventListener("touchstart",Fn),rn.removeEventListener("touchstart",Gt)}},[]);var cn=me.useRef();cn.current=Bn;var xn=me.useRef();xn.current=vn,me.useEffect(function(){if(xt){var Fn,wn=function(dt){var Ze=jn.current,Bt=Ze.dragging,hn=Ze.pageY,Rn=Ze.startTop;st.Z.cancel(Fn);var Se=$n.current.getBoundingClientRect(),Ee=yt/(bt?Se.width:Se.height);if(Bt){var Et=(Ot(dt,bt)-hn)*Ee,ht=Rn;!un&&bt?ht-=Et:ht+=Et;var Re=cn.current,pt=xn.current,Ut=pt?ht/pt:0,sn=Math.ceil(Ut*Re);sn=Math.max(sn,0),sn=Math.min(sn,Re),Fn=(0,st.Z)(function(){Tt(sn,bt)})}},rn=function(){Ft(!1),Ve()};return window.addEventListener("mousemove",wn,{passive:!0}),window.addEventListener("touchmove",wn,{passive:!0}),window.addEventListener("mouseup",rn,{passive:!0}),window.addEventListener("touchend",rn,{passive:!0}),function(){window.removeEventListener("mousemove",wn),window.removeEventListener("touchmove",wn),window.removeEventListener("mouseup",rn),window.removeEventListener("touchend",rn),st.Z.cancel(Fn)}}},[xt]),me.useEffect(function(){return ti(),function(){clearTimeout(Dn.current)}},[ue]),me.useImperativeHandle(te,function(){return{delayHidden:ti}});var kn="".concat(z,"-scrollbar"),Qn={position:"absolute",visibility:ei?null:"hidden"},Cn={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return bt?(Object.assign(Qn,{height:8,left:0,right:0,bottom:0}),Object.assign(Cn,(0,ze.Z)({height:"100%",width:ft},un?"left":"right",Sn))):(Object.assign(Qn,(0,ze.Z)({width:8,top:0,bottom:0},un?"right":"left",0)),Object.assign(Cn,{width:"100%",height:ft,top:Sn})),me.createElement("div",{ref:$n,className:Ie()(kn,(0,ze.Z)((0,ze.Z)((0,ze.Z)({},"".concat(kn,"-horizontal"),bt),"".concat(kn,"-vertical"),!bt),"".concat(kn,"-visible"),ei)),style:(0,Me.Z)((0,Me.Z)({},Qn),Vt),onMouseDown:En,onMouseMove:ti},me.createElement("div",{ref:Gn,className:Ie()("".concat(kn,"-thumb"),(0,ze.Z)({},"".concat(kn,"-thumb-moving"),xt)),style:(0,Me.Z)((0,Me.Z)({},Cn),Wt),onMouseDown:Gt}))}),Ct=Jt,Be=20;function tt(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,z=ae/te*ae;return isNaN(z)&&(z=0),z=Math.max(z,Be),Math.floor(z)}var at=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],en=[],ct={overflowY:"auto",overflowAnchor:"none"};function Pt(ae,te){var z=ae.prefixCls,oe=z===void 0?"rc-virtual-list":z,ue=ae.className,ne=ae.height,be=ae.itemHeight,Ve=ae.fullHeight,Tt=Ve===void 0?!0:Ve,bt=ae.style,ft=ae.data,yt=ae.children,Vt=ae.itemKey,Wt=ae.virtual,qe=ae.direction,nt=ae.scrollWidth,_e=ae.component,xt=_e===void 0?"div":_e,Ft=ae.onScroll,Qt=ae.onVirtualScroll,Ue=ae.onVisibleChange,tn=ae.innerProps,ke=ae.extraRender,kt=ae.styles,Zt=ae.showScrollBar,_n=Zt===void 0?"optional":Zt,Rt=(0,ge.Z)(ae,at),un=me.useCallback(function(Mt){return typeof Vt=="function"?Vt(Mt):Mt==null?void 0:Mt[Vt]},[Vt]),$n=ot(un,null,null),Gn=(0,pe.Z)($n,4),bi=Gn[0],xi=Gn[1],ei=Gn[2],Jn=Gn[3],Dn=!!(Wt!==!1&&ne&&be),ti=me.useMemo(function(){return Object.values(ei.maps).reduce(function(Mt,Ht){return Mt+Ht},0)},[ei.id,ei.maps]),Bn=Dn&&ft&&(Math.max(be*ft.length,ti)>ne||!!nt),vn=qe==="rtl",Sn=Ie()(oe,(0,ze.Z)({},"".concat(oe,"-rtl"),vn),ue),En=ft||en,jn=(0,me.useRef)(),Gt=(0,me.useRef)(),cn=(0,me.useRef)(),xn=(0,me.useState)(0),kn=(0,pe.Z)(xn,2),Qn=kn[0],Cn=kn[1],Fn=(0,me.useState)(0),wn=(0,pe.Z)(Fn,2),rn=wn[0],nn=wn[1],dt=(0,me.useState)(!1),Ze=(0,pe.Z)(dt,2),Bt=Ze[0],hn=Ze[1],Rn=function(){hn(!0)},Se=function(){hn(!1)},Ee={getKey:un};function Et(Mt){Cn(function(Ht){var gn;typeof Mt=="function"?gn=Mt(Ht):gn=Mt;var on=Ni(gn);return jn.current.scrollTop=on,on})}var ht=(0,me.useRef)({start:0,end:En.length}),Re=(0,me.useRef)(),pt=Je(En,un),Ut=(0,pe.Z)(pt,1),sn=Ut[0];Re.current=sn;var dn=me.useMemo(function(){if(!Dn)return{scrollHeight:void 0,start:0,end:En.length-1,offset:void 0};if(!Bn){var Mt;return{scrollHeight:((Mt=Gt.current)===null||Mt===void 0?void 0:Mt.offsetHeight)||0,start:0,end:En.length-1,offset:void 0}}for(var Ht=0,gn,on,An,Nt=En.length,Lt=0;Lt<Nt;Lt+=1){var jt=En[Lt],Xt=un(jt),Wn=ei.get(Xt),Kn=Ht+(Wn===void 0?be:Wn);Kn>=Qn&&gn===void 0&&(gn=Lt,on=Ht),Kn>Qn+ne&&An===void 0&&(An=Lt),Ht=Kn}return gn===void 0&&(gn=0,on=0,An=Math.ceil(ne/be)),An===void 0&&(An=En.length-1),An=Math.min(An+1,En.length-1),{scrollHeight:Ht,start:gn,end:An,offset:on}},[Bn,Dn,Qn,En,Jn,ne]),It=dn.scrollHeight,Kt=dn.start,Ae=dn.end,Tn=dn.offset;ht.current.start=Kt,ht.current.end=Ae,me.useLayoutEffect(function(){var Mt=ei.getRecord();if(Mt.size===1){var Ht=Array.from(Mt.keys())[0],gn=Mt.get(Ht),on=En[Kt];if(on&&gn===void 0){var An=un(on);if(An===Ht){var Nt=ei.get(Ht),Lt=Nt-be;Et(function(jt){return jt+Lt})}}}ei.resetRecord()},[It]);var qt=me.useState({width:0,height:ne}),bn=(0,pe.Z)(qt,2),mn=bn[0],Mn=bn[1],Hn=function(Ht){Mn({width:Ht.offsetWidth,height:Ht.offsetHeight})},mi=(0,me.useRef)(),Vn=(0,me.useRef)(),On=me.useMemo(function(){return tt(mn.width,nt)},[mn.width,nt]),ci=me.useMemo(function(){return tt(mn.height,It)},[mn.height,It]),zn=It-ne,gi=(0,me.useRef)(zn);gi.current=zn;function Ni(Mt){var Ht=Mt;return Number.isNaN(gi.current)||(Ht=Math.min(Ht,gi.current)),Ht=Math.max(Ht,0),Ht}var hi=Qn<=0,yi=Qn>=zn,Mi=rn<=0,wi=rn>=nt,ai=it(hi,yi,Mi,wi),Pi=function(){return{x:vn?-rn:rn,y:Qn}},li=(0,me.useRef)(Pi()),fi=(0,fe.zX)(function(Mt){if(Qt){var Ht=(0,Me.Z)((0,Me.Z)({},Pi()),Mt);(li.current.x!==Ht.x||li.current.y!==Ht.y)&&(Qt(Ht),li.current=Ht)}});function Ci(Mt,Ht){var gn=Mt;Ht?((0,rt.flushSync)(function(){nn(gn)}),fi()):Et(gn)}function Di(Mt){var Ht=Mt.currentTarget.scrollTop;Ht!==Qn&&Et(Ht),Ft==null||Ft(Mt),fi()}var pi=function(Ht){var gn=Ht,on=nt?nt-mn.width:0;return gn=Math.max(gn,0),gn=Math.min(gn,on),gn},ri=(0,fe.zX)(function(Mt,Ht){Ht?((0,rt.flushSync)(function(){nn(function(gn){var on=gn+(vn?-Mt:Mt);return pi(on)})}),fi()):Et(function(gn){var on=gn+Mt;return on})}),ni=Yt(Dn,hi,yi,Mi,wi,!!nt,ri),Bi=(0,pe.Z)(ni,2),Zi=Bi[0],Gi=Bi[1];wt(Dn,jn,function(Mt,Ht,gn,on){var An=on;return ai(Mt,Ht,gn)?!1:!An||!An._virtualHandled?(An&&(An._virtualHandled=!0),Zi({preventDefault:function(){},deltaX:Mt?Ht:0,deltaY:Mt?0:Ht}),!0):!1}),ve(Bn,jn,function(Mt){Et(function(Ht){return Ht+Mt})}),(0,Ke.Z)(function(){function Mt(gn){var on=hi&&gn.detail<0,An=yi&&gn.detail>0;Dn&&!on&&!An&&gn.preventDefault()}var Ht=jn.current;return Ht.addEventListener("wheel",Zi,{passive:!1}),Ht.addEventListener("DOMMouseScroll",Gi,{passive:!0}),Ht.addEventListener("MozMousePixelScroll",Mt,{passive:!1}),function(){Ht.removeEventListener("wheel",Zi),Ht.removeEventListener("DOMMouseScroll",Gi),Ht.removeEventListener("MozMousePixelScroll",Mt)}},[Dn,hi,yi]),(0,Ke.Z)(function(){if(nt){var Mt=pi(rn);nn(Mt),fi({x:Mt})}},[mn.width,nt]);var oi=function(){var Ht,gn;(Ht=mi.current)===null||Ht===void 0||Ht.delayHidden(),(gn=Vn.current)===null||gn===void 0||gn.delayHidden()},ar=ut(jn,En,ei,be,un,function(){return xi(!0)},Et,oi);me.useImperativeHandle(te,function(){return{nativeElement:cn.current,getScrollInfo:Pi,scrollTo:function(Ht){function gn(on){return on&&(0,et.Z)(on)==="object"&&("left"in on||"top"in on)}gn(Ht)?(Ht.left!==void 0&&nn(pi(Ht.left)),ar(Ht.top)):ar(Ht)}}}),(0,Ke.Z)(function(){if(Ue){var Mt=En.slice(Kt,Ae+1);Ue(Mt,En)}},[Kt,Ae,En]);var di=Ye(En,un,ei,be),lr=ke==null?void 0:ke({start:Kt,end:Ae,virtual:Bn,offsetX:rn,offsetY:Tn,rtl:vn,getSize:di}),tr=xe(En,Kt,Ae,nt,rn,bi,yt,Ee),Ii=null;ne&&(Ii=(0,Me.Z)((0,ze.Z)({},Tt?"height":"maxHeight",ne),ct),Dn&&(Ii.overflowY="hidden",nt&&(Ii.overflowX="hidden"),Bt&&(Ii.pointerEvents="none")));var Un={};return vn&&(Un.dir="rtl"),me.createElement("div",(0,ie.Z)({ref:cn,style:(0,Me.Z)((0,Me.Z)({},bt),{},{position:"relative"}),className:Sn},Un,Rt),me.createElement(we.Z,{onResize:Hn},me.createElement(xt,{className:"".concat(oe,"-holder"),style:Ii,ref:jn,onScroll:Di,onMouseEnter:oi},me.createElement(De,{prefixCls:oe,height:It,offsetX:rn,offsetY:Tn,scrollWidth:nt,onInnerResize:xi,ref:Gt,innerProps:tn,rtl:vn,extra:lr},tr))),Bn&&It>ne&&me.createElement(Ct,{ref:mi,prefixCls:oe,scrollOffset:Qn,scrollRange:It,rtl:vn,onScroll:Ci,onStartMove:Rn,onStopMove:Se,spinSize:ci,containerSize:mn.height,style:kt==null?void 0:kt.verticalScrollBar,thumbStyle:kt==null?void 0:kt.verticalScrollBarThumb,showScrollBar:_n}),Bn&&nt>mn.width&&me.createElement(Ct,{ref:Vn,prefixCls:oe,scrollOffset:rn,scrollRange:nt,rtl:vn,onScroll:Ci,onStartMove:Rn,onStopMove:Se,spinSize:On,containerSize:mn.width,horizontal:!0,style:kt==null?void 0:kt.horizontalScrollBar,thumbStyle:kt==null?void 0:kt.horizontalScrollBarThumb,showScrollBar:_n}))}var We=me.forwardRef(Pt);We.displayName="List";var gt=We,St=gt},93314:function(At){"use strict";At.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAACaCAYAAADl9acYAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXQd4U1Ubfs/NaJtO9kzLahFQEJkiUBBFUFFkCCjiAAVFERT5FREQQQXBBcpysWRP2RtkKRsEOphNodCZdDfjnv85CU2TZt2bhABNDw9PmtzvrO+c957xLQIP0pkz1yrQIEmwwcDzHhTj91klEo7jpcG5zetWUJdmRjmPvTM9GI9JgSGvadOoLE9KJJ5kPp2YXLtZdO1kT8ooz2vigCNelvPYezPEG7z0CDAn4pJqPvJA5A3vdcl/S3LEy3Iee29OeIOX5YDx3nh4VFI5YDxin6DM5YARxKb7g6gcMHd+nMoBc+d57LKGhCQ1ZURBCoVL2nKCO8sBZWW50x1TOWDuLP8FlV4OGEFs8glROWB8wmbPKikHjGf882bucsB4k5t3qKxywNwhxrpRbJkGTOx0ehlA3d9e5VEtzA3ulGe55zmg1QOfrCVo34BgQGvr5rLDRl4RRZG+5NjBESBc4FHw1LlrCAuPsCo0JjKi7J5hYqfTXADBq4byCJLf82Nf3kA3OfD9LgKdgeCzZ4CUTJ1VKQFyKQgpmeMSjiKvQC+oplspN/wOMDcBVFv0Bo+KwYJ4VE50H3Jg7j6CWzkEX74A3MrSgTfeKZpSaBCHcAVn/JunBHlFPDR5BkG9LMjPt7mZLOtbskQADea9wqOW9coqiGHlRPcHBxYcJriQQvB9P+v2cqCwWFxgoOJk6JeTNX4HmJMAHv6xP4/6VXw/+OxNx/bM/pIohdUE9VW/VxwjOHiJYO5A6xolpGSpYW3jIW4w/A8wM+h+UHSY2pvHgzV9NXymeor0wPc7Cf7XzWJ/4Nsm+Ly2LzZx+OwZ3yuVbzhNsPEMwcI3rM8wMikHiURi5gNbbQoKrc84zpjkj2eYzQC6f96DomUd305ctrp8tp5gSk/f1utzlFhUOHYthy9f8D1gdpwnWHiEYOVQ6zNM6QM/AY+CImHnF9YtfwTMCgB9P+5G0SHa9xP3bk2gT9cBU3r6Hjp95nBYNcz3gDlwkRhX843vlfS59PmFHfjFzgC/2pJ1nEEnEIpIAG+834Wia2Ox7PJ8wt0twLz7J8Gsl3zf316zCVYPsz5oe85F1yUcu0YwcQPBjlElZyjL8wsrQeyBn+XxK8DETqefgyACFCPe6kjxfDPfT6C7BpilBLMG+L6/A34h+P1VikCZ60nuTYpzN4AxqznjCqPOMZ1RSp9f2OVLYZH1lbOrNvjVlswIGEAKYOyrj1K82NL3E+huAWbEMnbFSn1+Qzd4AcE3fajPZV6X04D3lnHGM4xOawKFJwLLYiD5H2AoCkHwJQMLA42v090CzJjVBBN7UCh8rN3AgDrqCYq6lX3L6RQ1MGQRhwWvA7UrALbnFzCJjOhG+d2WjFCkUYKZPZpSDIv1PWDGrycY34NCahI0+yxN/Ivg3c4UlUN8VqWxok/XEfRrSdG0tm/rzcoHBv7KYc5AILqqLWDcOb/45RmGEFyhFL8/0Yga33y+Tl9uJhjxOEVIoG9rnrqVKSJSRFb0fb3tG1A81sC39TLRSu85HL57Eaii0Bm3oqEKqZXSJaUURUxTU0Tyuy0ZAc5SYCUbxE+6+x4w3+0kGNiWooqP3/Qz9xB0bUTRsLqI2eEFUlbvA9WBJxv5ltdMit9jFocpLwB1InQIkBEQTmLUHStOBoMBOr24K2+/AwwPHOKArS2iKCY9VzKIg34jyMgTv6f1wpwqL8JLHKgUTLHwjZIxZTKg0V2Bzg2tLzvYBYA75xe/25J1mkEnGAzYyXE40KQmMK23uLeLN8b1j0ME7epTxFTzRmnCy/jzXyCqIny+NVryDzFeKfd+xLcrDOMMO8MMfgx45iFrOZA7AstiTvvVoZ91usM3tClHcLpeZWDmAN8DZtlRgkY1KJr5+BC87hQQLAeebCwcZN6gXH6MgG2P+rfyDmD+WLoV8xZugkIRiNh2TTHghcfRoF4tFBZpkXgpGQ81rmdu9puLOLzwMPBYPR1Cgzw/v7CC/WpLxjrc/jtaT2LApRrhwC+DfA+Y9aeI0dKzbT3vTCChk3r7eaBABzzfTGgO79CtPUmM9b7U2jv9bf3kOyjSlihLcoSg93MdkZ2Th227j2Hoq8/inTeeNzZ+xFIOsTHAsw/pAeL5+cUvAdPuG1pVRnArQgEsGex7wGw7RxAgBTo19M4EEjqtD1wEkrPYm15oDu/QbfkPSM0hHsu8du0/gSnfLkFGVrbThjFLynULJ6FOZHUw2RNbyd/qUJLFHZV+ywr9aksWO4Ou0BK8KueRz/bVq++CUuD+RGbhB3R/0LeAOZEEnFIRvPGYb+vdGw+cvU7w3uOe1dv+mfeRk5svCMUfvz8AA3o9jgkbCJQVgPe7lGTz5MDvj4f+VXs/JH1ip1PmAkHy17u8z42bjl4lxjf9C809m0CCZo4FUVwKsDPOJLz0ZTp6Fdh6jtnWe1bvuCm/4q/tRwQ1/b03e2LIwGfw1RaCkADg425AOvPkYCHZd0cG43dbsk4zaDFgWHiHcG85wjBQoEhnMhAzf5r/Jihkf9/+fjXDtDXqGA108+Eqcy0DYAfwMU95NnEFzVgLovibwK8HCab19qze61s24Pf5K7A5KwB5vHM1CblMij9m/Q87rtc1jsek54CMPIBayGD0BgP0ImUw/gwYFiqjllhHGAcvAkuPcijU8cgv0KGgSGv8LNJqweu1MOh14A3ss+S78W+Dzuo3RsPoTy0YgIjQALFz0C36tBzg570EE3p4NnHFVn5TA0zaSPDzy57Vu2bIS6jF67BDHYBHgnVI0kow+6ZjLyZNm9RD+35jkZINfNO7ZIVhEn+e16NQ6157/OqWjJ1h9n1IXoydTi8AeGD+KzxqinCEsfkswfBJC2HQacXOG7v0B+e9CGXVUK+U5aoQdm5iE3eqh296R/XoDEBu0e3/hcz3FzF+Z292trI91Zgav7N2tKrDrrfFTdgTI4dAl61BipZDDXYINRCMvBrusNvBikAMHT8LTM3/pwElK4xMAuQV6uBuKK4yA5hEVfY8SvmmHCETGyjDtzqbQLHf0KMgaCnWEcaW/whGT1mAHHZP6oW09bueaFy3khdKcl0EO+y+v4xgphs2MWxbs+K46bLCDIoi6+9iVLKY4PbTp8UB5t8h/UB53qimz1aJA9lyLExz7H1vyMCnUa15L/x9EfhtkIk/nh74y9ShPz5JnUGA26qFZIdcTofWqR5xxd5Uip1O9wDoJNYRxs4LBB9PXYxUdaHrGSqAYuWUp9GmSQ0BlN4h8cTq8qVfOGgKStpBeAoJb4DEYPrPsU89b/5e/LvEYPubLCIQX06NEtWpfwa/yA4h0FEgqVCK71OCUeTARdLLfbpg9PAXsfGsBBtOA0uHmKpyV0PZsqFl5lo5QaXWgRqNw4pTHiEYGa2M+KX0yMROpxsA9BDrCGNvAsG4GcuQdMt45eJx+nXsk3iyNbOY9k161wOry8/GqZCr1t4GBA/O3T0Nm7gSDl/89IBRHiU0nRk3CgU3knEmT4pZN51rrjI5TN2oGmCOMP44BKx7B8jINemP8ZRCK2Y5LNXAMrMlS0hSpwKw9TRGME+XHf5ekybEfPCInU7/BDBArCOMw5cIPvt+JRJUGqHj7JRu2rsd0P+JGBuanELTTVpwwO3/cnjFxNcTwMz95hquxud5pd+skIEfR6NJA+F2y6o1S3Fj4xpj/X9lBmK7OsDuChMUKMf+v36AXC4Fc4QxYwew/X0gM8/k5VKvN0BvcF9gfc8CJuGWuh4twgoQnJSBzK+nDP+3eLTsBahJSNL8DdD29kaUAFsDSU4vpVJp3FTETqdzAbwl1hHGySSCCTPX41RimlcmzthBrTCsV1Obss5cJ2hWXQupTIoiHUW+1nRYZkcn5kRbTzlIOQq5hBmimfRu2RwoeU4gl5rAFiI3Odpmb/NRK0zXu+zgKzZtWZWK/VvTxWZzSP/EK5HoEivcxsFQWIBzk8caVxmWmMT+g6thNlfMg/p1xYfv9DXSMEcYEzYAu247wnBXQ9myE/fslixRpf6FUgw2N5bgDChmk6Lw33MMqkqlg8JeVKmn8hRjHI0QIdgbiJynGWhiZ9AZoPhgaEeK50Q4wmDCvwmzt+HwGe8EcH67V1N8MshWV4UBpnlNLQID3Lcn5nkKrZ6iUEex4azEqC08di0BW1XDgsTP+2NHsrH6F+/0m9Xetns1PN9b3IWHPi8XyetXIOPoEeg1WbhYKMGK9CCoiiSoWq0SnuvWzqhLVuyoz+wI411mmi3epZI9Lt2zgElIUht9INtpdDJPMUsSGf59NCFFxc8TknI6AoZ9LqbCmj+V4X33zMAEAOMHtaXoJ0KLVpUJjJuzD3v+vSh+xtnJ0ffxaMwY0dHuCtO8pg6BAcK3LI4axCTai/4hRsBM3kww5DGK6o5vYx32S52pw9QxbEi8k6o2DMeoj2q5VVhqNnB29JsI0TP5M6Dj5Gg7dwmkpVZOsyOMtyg4joDyBhRq3d+Osbru3S2ZSp0LCmf+9ZM5CUY3qBWx3LREUy5RpbkKQOl0FAimvrksPAME08Q6wmD74DGz/8H2A/+5NdClM8U2r4VFE7rZBcwjtXQIkHsOGLbSLP7XBJhvdxD0fJiinhs+pVk5n41IBM/UFryQSHggvpxRooovpsgdFwjoD8MQri3ZIso/XYzm9a2FwDfUAFPxX/AaRYSCeCR/KW7fvQuYJE0RQF3vSQh2UQn3bsOaYXEJSZrPADrJBfP5BceCVx+4LO0r1hGG3gC8//Np/LXrmJjxdUhbv1YE9vzU22eAmbOPBRmieNCNFzvP8/jhaxVSL3vn4M9zBJN/bgSZgJsyplZ0KQ24oSZgq8vmE4V4+9hrkNIS8O5uPhbNOz+CprWpWRhd7Ahj9svMYM871rT38pbM/q2XvelHoeU4bpxBgt+Jjr8MAqfi80NXZEW/H1UEuOMIY/zCRPyxZr9XABMSJMP5pbelahYlsjNMi1p6402Pp8lyhWEhIBpVp2hdV1yp6nwgPAhYvzQF/+zOEpfZCfXgz6LRIMrxKsq0B5YcKsL6UxRFvBygelBdLjhZGMCx/RfTKWMCUGZzbAClvJEmtiGH97oEGLdhzBHGjL4UDyvLOmBUmn9AaamAay7GimAXgdErzG1RlX36k9el+PlgsPFtK9YRxtwtNzBl7havTZoLywYhuJRbSCNgauvBlAg9TQYDjyVHOeOWbOVxoEoo0Mn2JttpNZvOcmhfn0KTXoTr8TlITSnCrRSt8TMvV7gj79KVPDskCo+1tb/rZkLScavzcTlTARBrZUu+MB1coHNHZ8rQXEzvH4T+8yWY9DzQrj6QptFDzzRlPUj37JbM5pZMeCfZK5CNgsPt3PlbEny3LwSlHWEIqWLzcTWGfbFaCKkgml0zeyNaaa3QdqcAs+msSa2k+4OCmmYm2nyWQ98W9idabo4eqSla3EopMn6m3mRgKkJ6KlM6dV5Plz418ES3CjZE7Ar9w2X5UGXbv3bmC1NBAiqBEOf34zFhKlzLq40PuxK0i8qFutBzRdd7FjDx1zSDCKELxA2tmZoyyztqqc9tUdDlDAm+2hUCdxxhHIwrwOAJy5EvIkSCsz78Nq4rnmhpfU/BANOytgEydwQmpSpjQro/b68we+JNArzej4jjKouz0q+luDwGAzWCxnI1Kr0qPfpEZTzXv6pVwUzf6+MVBTiX6vi+hxoKQfUF4AJswWZZGF+UCUN2IsYMaINnbcVd4jp0m/qePcNcvJlTldcaUm5vVN3qnKNM1zUcJm4LhTuOMP65qMWYGWtxJcU76jGT3nwUrz1j7ZnCCBilAbLS96RucIFJtv88ZpLD/HMZSEgFXmkrrqANp2yjEYsroYRar6f44I3zxh9qNwnH8FHWNxBLj2ix6F85SKltmGV9lBrAF6RConCuh8fotCn7MSC2Fob3ELkPddDBexYwrL2JSZqtFPQpdwfHUT7mf+zjTWFwxxHG8St6zPhtCw6cZXcSnqdhLzTF2FethZcMMK2UBki9DBgmbz18mYAJbMUk5shiYBsxORzT5ucZ8PHbcUaC4OpBGDe55AbiShqP9/40gHLOt058UZbxXMPJnQuUKK+DLi8DEs0R/PJBLIIVwjULHPXgnt2SsQbHq7JeIJSYFIi8mNgeeeT6cFRQAItFOsL4L5li0do9WLrLriK06FZ2e7QO5v3PwugcgDcBo9MbsPT2CnMxFcYwdiNFuMhlKjcs/J23AMMEoONHJhj5JA2T44tvS2TTo5cX4kKqY5X9YuYacq9CEhzlMngmr8uGQasFLUpDPcUV/DCiKwrcNBwrrvueBsyKFVTSvG32aQraRPRMdJKBWaa+vSrcqNAo1hEGsyD8Y/1R/LzmjFea1EBZAbtn9rIqywiYSB5Siecey3U6A5YeN23JmCCPORIcK8IWhV0ps1Wpj8hzjyPmsDPN5P+ZNCWInMOXPz9g/PtgohZfbpEZ3SE5TxSGXBUkIa61vPnCDLCzFEuGrOMY1q02Xunq2VS6p7dkrKOJ17N7UAPP1PG9moatCoOBJ9go0hEGe+P+vC4e3yw84JX2VAoLxMmFL9sApnUkD4kXAKPV6bHsuNQIGDb5p28nmCwixmZSJnA5jeCZh1x3NzfpKi7M/xlFGRmo0qoNqnfohPAG1mcH1dUCfDP+sqkwjuCreY2Mf478swiJGa6V3Az518EFVgHhXMu0DYUZ4G8Dhuqy0Sg0EfM+8myHf88DhjEzIUmzAaA9XA+ZcIqR60KRp+XgjiOM3Sdu4s0vtyAkSIrgQCmCg6QIYZ+BMuPf7Dfzs9vP2bPi34ICZTh2szJ6NM41HuyrV7f2G8tWmNZRPCSc5yuMJWCYGcjHawm+7Sv8DPPfdSBfS9C5oWveHhg+GFqNyfRBEhgIeWgY2kz7AZysRDh5KT4fP0y5vZ0lwBdzGoO9FwbOK4S6KMDpCkP1eaD6fCNghCSDNhe8zmTsVznrMD59XIGa7Wx194SUVUxzT2/JihuZmJJThWoNZ0HgNY/EH28MRUY+B7GOMFibcrJzkJuXB3Z1zXHc7U9ivNlh0mX2aXpm/7ekLA57E6R44zHm5slWAs0A0ybKpDDoaWLhHJafMK0wLIm1ujx0iYD56WgrQO3ryuplSN6xzajkqM83+RCr1aUrol95A5zUJIT971QO5n2bZPybXYRNntsYvx4guLJrL1qkbsD2moOQHP6wlUskRkt5PfiCm5AEC/exa9DmgNcVoVL2KQy59RsqhAQg6tPvwAU5U1F0zvH7AjCsC4mqnE6UGpitvsfSJ0IIHb8lmNzIlkCsIwxPJzDLf10NrDtJMNyBjzDvAkaH5SdkbgOGOf5oVAN4sKawnl+YOwspf+81EzPIh9VvgCbvfoDAKlVx9JAai+ZcNz4PVBBE9W+M07uPo9/laeBgknSeC22ObbVeQ06QCRzselivuQhZBNveCX+JGAoyEZEThyE3fkIYNa00yh69UPdF6y2wsJ6ZqO6LLZl5pUlW9wHFMkrh6mTokgdf7QzG5UwpxDrCcFmwAAImPPztIMHorva3RkbA1GEhGoRPDkfVMj/EVoARaabM2vliCxj9QQtJ1GDAtU3rcGPXDmjVWWDfWWJbtHp9BiCwRScU6KQICJRg4VEp4g8ex4tXvrFSpGT0JxXNsKraIEgVFaHLuQ5ZSE1wAeLsEioRFZ5PnAVlTok5hiQwCG1+mAupwr1V5r4CDGNkgkrzEij93Znqi5CB/XafAhduySDWEYaQsl3RFGiB6Tsce4NkgGlbx+WtqatqjM9ZlOAVJ0tWmPeWEvzYX3gYcOY9cuKzsLE1EVK5oagQJ7/4DDlXS67gZTVqI6dlXxwNaIXrJ06j75UZkFhoHbNyK7Zqh2E3usHAlCupDgFhtSAJEmdsxsqJqZSHevmJaHPoC6vm1nvpNdTu7t6R+L4DjAk06t7M+tKuDb+QkQTw00EFTl2XQawjDIHFOyVj6h+frSeY4uC2it1MRVXgIeUIpBLTWcjdxMJArDgpN2/JPlpF8PlzwoPDjl9v0vZ1N2k1apz+ehJyVaZzS3HimUMKIoWUWrusqtDqUTR46308/bUKekghU1QBkbq+PbPXPkNuEog8DAOS5+ABzVEzSWj9GDSf+JVbXbovAcNs+oODFYSjsp8oqCm2gcj06z9BOHJNbjTZ7RDt/oQQWa2ZXEw0ZWY1yYzYGdCYuj5L7AJNwgBlvHRgj3mjnfvtx0YlS/Zcp9dj6wU5nmpiysccdLMYm5UECr3HruHwQ3/P+KPLzcWZ6VOQfdG5xWbVzl0R9fJgEI7DjO0Eu85rQSTuH1lbV45HbmYSzl1OR+2im4g0ZEJpyETdAC26zpnv1tDdt4AptulPNJ1rplMKUY6uFh8PxL5LARDrCMMtLtvJJAYw3qqTlcOCw7JYLUoBwWHZWWvBIYJxz3jeAiZxv7R0AZJ3bIetdT1B7T4voebTPc0VMbe2G08Wur26sII+6JyD5x4JQU6+FkfOp+DA2es4fO4GsvO1qFk5BE3qVEaTupWNn9G1K0AmILT1fQ8YxhhKqfTi9ewBoPQjSiFAxAasOh2AbfGBRr0qMY4wPJ86phLuFmBm7ibo2oSioYAL+uPXgKvpBIMe9VavgctnE5C7fyuyz58Bc2oRVKMWaj7XBxVbWGuELjxMsOxIAYjUtaqMo9Z90CkHz7WwXkoNPMXZy2k4ePYGDvx3HVdSTHIjBqCVn7verJQJwBQzjKnzJyRlPcZJuJ6UxwsAHEoP/joXgA3nAiHWEYa3ps7dAgyTeTwSRdHcuecDYzdXHCN4oBrwaH3v9Fqr55GWmY2ICNe3XWtOEvyy17MVZmRsLnq2dH4bdv5qBt6Ytg3d29TDOAFvhjIFmNLDGp+c1UxCycs8xTu3jcrMJDvi5VhxOghiHWF4Z+rcvRXGGBy2EvCYABB8sZHggycpqoa6f+lgya/MXC20RUUIDXV9gGJueb/d5tkZ5r0OOejd2nldm/+5gkkLDuOzQe3QrY1r2+0yDZjiwbp4PUNJeelKSqlZSX3/ZRkWHVNArCMMbwFm/AaC8c9Qt65rPWkDCw7Lggw9YVLhcprWnCCoH5qKGmHUaC4tl8sgl0kgl7FPqWhdt6upuQiWc1AoXN96MSd849ez62/31YPeeSwHL7Z1DpixvxzA7hNJWP9lL1RmjgtcJL8ADOOBSkWDCqiGaQoYlYn+TZJh/hEF3HGE4YqpQp7/sC0PrzRPhYxPg9yQjmCkoTA/HUV5aZDq0wBZBQQ0my6kKFE028/BGODpOYHBYfPy8qDT6aDT6Y2flolpUxeDhznscAWkfxKzEFNDAbncteIk8xIzYinxSBj1VrtcvPSo4y0Zs0Z96qPVqFpBgcXjnhXEx/saMCZfZNmTQCjTmZCAEC0oUglPU3iOnDEYtCcb16nCrDaN6ZxKU1HK0xOEIOrMDSlmHnDPEYZLzhoKAW0aivLSQXRpCKRp4HTpKMxNAy1KN36XE+cRAHjKIb/pckhk7h967bXz70STao47wWHZ9bZebwJOMYDY38Zrb4vEtKwZeAKMq5IJSDKZFOuPpqFr8yqCNBjYDd3AXwwgnPu+2Qa3zccrjzleNY7G3cR7P+7G8+2jMWaAMH8r9zVg4pKynudA1jmawExnjKf8fwRkAwF+j46MuJSoyupEKdkdnyoh0/e65wjDUX1c3MdA3hUEEO+YL6fU+BwRNUQa07tAM7v5OpNM8LoXg8PqDXrotHrojUDSQafXgXmrKZ3i0uV4vKkwiT2TJ/WcqYWBBLp8PzkieK1NIV5r71iO8/2qE1i2O8542GeHfiHpvgbMRVX2RzzlpwnpKCGEOa76i5dynxCeTriaTvpP2RnqliMMhwC9MBaBBaeFNEcQTU7FvpDWeU0QrVCiCynA7jjHip9Cy3FFxxz/mVYi0//sPD2u5wWgXUOBSmkAXvtVj7R819s3R215ta0Orz/m2FVVnwkbkJyWa7xOZtfKQtJ9DZiEpKzXAfKbkI6W0JAiQrDyZjZ5adyWUM4dRxiO6qOqRVCkLRPXHCfUt2gjhLXw7jmGBYdl18Uf+Tg47K4LBCz0uZh6P1oJnL/p/qH/5dYGvNnBfv5rN7PRb9JGVAoLwoavrC1enQ3gfQ2YC1ey6kil3CV2lhE7S7MKuMIxf4UGuuMIw1FdhszjCLk6XmxTHNLrqRT5TVdAJnNfPaR04cbgsPsIJjzrmbqL2E4evgxsPy+uXubM7+Vfmbss9661X2lDMdhuABRgyc4LmLnmJGKbKfHlW8KNyu5rwLBBS0zSbKBuWGOyWCoj1rrnCMPRZNEX5SLk3ACmVih2PjmkV9WYiso1RHrec1I7i1HJ5Ct3Kjiso6rPXgeY9P6bPsKB2uSRWKSlZbjNy3FjhuOTD5kIzja9891OnEhMxVs9muHVbsL5e98DJu5ydkNOxh934enfhmPsUDl0ZRgCZUS0IwyHWzJmqPPfcATorrk9yKUzZld5DTKlKUCQNxLr98jlJhV/X6ZrmcBXmwnmDBReb2R0CxQWmiOaiG5uj+5dsOyPH23yMd2ybmNWg6nJfDv8cbRpLDzO6H0PGMaN2zYyi8Q6/Ru+Ogw6A8FfIh1hOBs5evE7KLJ3ih5cRxluSR5FWLNxXiuPFeRJ6D53G5KWC3y4gmDhG8IAw7Ssa9Vlpsrup8jaNXHh+A6bAnYcu4bPfjto/H3z1D4IZ5JcgalMAIb1NVGlHkwpmQ1QwRf3H6wPRU6Re44wHPHXcGMTQm7+LJD9rsnU+soIaO2ux1z75Yu163fdStcUuYXA6wsIVg4VBpjMLDUeaOrgAOK6OjNFcvwhVCiluzbh90PYdvQqqlcMxuovSjSkhRRbZgDDOnsxOaczpYaFlEKQp4Sxm0KQlidxyxGGI+Zqs+IRfuUDIbwXTJMWsxghIc79CAsu7C6Ndg0lAAAdVklEQVStMEws88Jsgg3DhQEmSXUdLdt55hLJuIKs/g2x7UvcdrJtWPcxq40q/h2bKfGViAM/K69MAYZ16NKlzHCDlHwBwr0FUKdr7efbQpCs8a4jjMKCfITHDQRH3d97l578qmqTUblWczGYcErLzjDT+/hej63HLA5r32YOCl135dyFeHTuahtsynVOa4qvPv8II4aVyLJOXUzFsG9NW+bXuz+EISK9lJc5wBSz69KNzEheLxlFQVnEIrvmUlN3B+NiuncdYWi1OsjjP0KQznvxIDVVh0Bem1kreCcZg8N2pwhzX4juVkN6zebwx+u8oHr/OXoCPXrZBpsSW/GAvj3wy6yvzdl+WnsKi3aYnKFPHtIBnZu79qBpWWeZBUxxJ69coYE6ae4zlOqfIyBPM59uxc++36/AuZvedYTBJNz6+OkIL3AVn1b40N8K6oawRu8Jz+CCcvImgiEdKKoLF7p7pe4B8zl8148XVO+uPQcwYNAwj+tt0iga/+4t0Z4a8MUms9HY0vE9ECnUHc7tlpR5wFhyfA+l0lqq7L4A/QlAhTmHgnA8We51Rxh5FxejcvZSjwe7uIAk/cOo0nqK18qbsYPghebUGO7Dl+n1Pzh89iwvqN71G7fhzbc/9Lh5LALCzr+PQVMkR2w0Na4u566m49J1tVElRqyDEb8CTDH3LyblPMhTw67fjwZVPXTV+44wspP2oVq6IBU3QRPiprYWwtvOE0QrhGj2PoKO0dSoR+fL9O5SDm/H8oLq/XP5Gowc7R2tic9/XIlNyU2wY5RH1gJGVvklYFjHL6k0Ty85EbhxV6KceNsRRuatS6h1fYTX5mK+IQR5TZcbDb+8kVhw2MY1KFrV8UZpwsv4ZC3BCw8LC0o7/7fF+HRCydnDWS1FOSmQh1S363aX5XtlxGTEBfbCxveAIMFCB/s1+i1gGDsGL9Cvvpgm6eVtRxgZGZmomTQYHNUKn01OKHlIcEG5AfWE+eB2WefKY0DVMCDWO0G5XNZXTMDOTu3qUzxuinDhNH0/cx6+nGYrpS+diflxLkhPgFRRGfIQ+wzq9OxA5DUei5VDgYruObw0V+vXgOn8LR3L85jibUcY6iw1KiV9CLnhpqt5Ieg5DxkOV16PRyKFyTBcFbrxDPNZJj44rKtyXT1nvsYaVqeC4k1OmfoDfpjl2ncYb9CiMOOS0edyUOVoEGM4cuvUuGkrBHdbgIVvALWs4++6arLNc78GTOx0yq6efvS2I4zs7ByEJY1HkNYUactZ4kkg9FwE9JIKMEgijH8bjN/Z36bftCQcudLaeKC6q9KEPd8dB2Tliw8OK6x0x1Q/7SWoGkrRt4XrksZN/Brzfl3skpB59S9IN13hy0KrQxZkK+ANCQ1Do7ePYO5AoIF1DFqX5Zcm8G/AfENfB8Fv3naEkZubi6CkbxCou2yc9CZARJgBwcCRVlgZV3KC0aSmAhwnQYBcYowHI5FIwIN9MjPfkt/shcUQPdq3Mxy5DLDwfQNFBod1t77ifMyxuVxCBdX7wZgJWLzUdXh3Zh7NtmSgPCQBIQgIt+8/qtmw3fj5zep4yDoGregu+TVgOk2nTNl8pbcdYeTnFyA9U2MMDhQYIIFcwoGTSGCgnHHLECTnIJVIMG2H1BjywtcCRBYc9shlgrdEBocVPbtKZVjyDwGLLyqk3mHvjsGa9ZtdV0k4FGZdBa/NM/JbUcX+wSy692z8PDoWAjwpOa3TvwEzjXajHLa0b0DxSXfvnA9cj3AJxfe7TG5bq4aKyeU5bWIqsOkswcguvu3zyuPE6IBDSL2DBr+Hrdv3uOxshVqNkZqwH7q8NCNtYKUG4CS2V2G1OozE7ClvoZOHFx3+DZjptD0F/m4RRTHpOd9OHja4c/cRdHuQGh3r+TKxScuMuXz9kmDRmM/dgKB6+wwYgv0HjrhkS6+Bb2PlbzNQpDbZILEtGdualU4VH3gaX0/92ii89HZSVpY7NQllzvOLfYG7W7d7Nqe3a/NGA1hR7WfQZhKKU0yAN62396wkhTKFyUPa1qVo6KXDvNB62YH/2x0EXzzv/cnjrA07zhPsT4SgepkeGdMnc5V++nE6Phz/PTITmEIlhSykOmQK24M/W3mmzV2Lpxp7f5z9BjCPT6P1DRwuetMRhqsBtnzOnFHEVAMeVvp24hbpmata4lHcFzH9LKZl8TJXn4Cgep98+kWcPmtSknSWVi/7BZNmrsc/G2eC1xVAqqgEeYjtVRjhpPji1wN49qE7x+uYyAi7C4E3XvA+XWFU6Vo1ABsP2MzJwvDlMnjTEYarAbZ8zrYoVUKBR+vduUF01J67YUR2OhmYs49g9suu+9uhy/OIT2DyFedpz/bVWLXtFL77/F3o8zMhCQxHQJh9nZ/RU5diYJc7p95QZgCTnKHLppTaHK3Zm3bwYhkqKIDFg72/VLsabLZFYbYhnRu6nkCuyhL7/G4AJuEWwKT9QsyUWz3WDdeSkl1268zR3ThwLgtDBzyFIo0KnDwYgRH2VfYrP/jCzKTdX3pPZ8ll60wE990Kk5yhi6OU2kSaZx5OBy2UIkDqPUcYAnloJDtwkSC7AHj6Dm4THK4wIoPDiumXI1pVJjBqBcGqYa5fEA+16IxbqaabL2cp+dJJ3MqRoGXL1si7cRKcNAiBFe2vIopqDZemn133kqsyvf38fgTMJkops4WxSUOWSFGoI9joRUcYQhl+SgUkZZK7EtBp3DpgsjhzdqHdckiXlQcMWcReTq4Bw+z5mV2/sxQcrMCVuH+NoQof7DwESf/+aTz4B1WyH8tDHl7zhDpxlwA9A4+7alXAfQcYVYb2V1C8YY8N7y6XQl1AsGoojyD3vZK6zWHm9siDmK9u13u3Mgrtb71GbZCbm+e0mbVq1cDJIyavMK99OAvrfp0IfVEOFJWj7earUKUG9mxZ45WuOzqv2Cv8vgNMcqZuCuXpWHudGb1GipvZxKuOMLwyIn5eSGSDR8AiQDtLDzZ+ALu3rTKSzPrzAMa//xK0OSlQVLHZfd8uhuDQ/p1QKDyPiFCmAaNK17KD3g/2mP/ZXxJcyeAw/xUeNT3UZPXzOe7V7tes2wx6vcFpme3btcaa5SbX2gfP56Dnk62NipiKqo7tB1at+BMPPdjE47a6kr1YVnD/rTAZ+r6U8ivscWnyVgnibnL4sT+P+l6yN/F4NMoLQLXIh2zizpRmy9PduuCP+ab3YE4h8OCjzyMzfrvDMwyjm/rVZPR8vofHHC7TgLmRpetoMFC7Ximm75TgVDJn1G96srHrw6jHnC4vQBAHqipd+zvu/2JP/Dhjsrm8zv0n4sSWHx3KYRjh0DcH44NRnt8sl2nApGTROnqD7oq9kZq1T4IjV0Q7/xc06OVE7nPg6DS2bXL+AqvW4hVEdvnEXEna2bW4uGY4pEGO99ZPPv4YZs3y3DNpmQYM42hyujaBAjbXJxvOcFhxggHGI+UD92dGeU67HDg6/SGAd36GqfHoMNTuULJaFGZexem5T4CTOL7ufCCmAf7dv0EQ11MyrWN6WmYq84C5lqEdyVF8J4hTlkQc+URZUSbMG4PowsVlSEhSO3zlBtm5+alR0UOPD+KaZ5fa0aQryM+3oi/d/ocfaYOCQudxQCeOHYUPRrxpLocZk8U0i8Wt1HSHLQ+Qy3Hj0jFjzE1Xya8Bw4IuJWfoFgJ42RWjip8TQlbVqijtbwz3dw8kfwJM23YdkaXWOOX6tMljMWzIQCuawW9/hJVrNznNt37Fr+jc8VGXI+rXgCnmjipT353w/Es80IIALDAIM56QMFBQSpmkLAUEJzmeX1qrSuBfLrnqQwJ/AkyXJ7sh+bo5ALZdLs+cPgmvDuxj9ezPFesxbETJucZexrfeeAnTv3QdQqTMAyY5TdeZEspcjdjXjfDm5Ka4REDerF1F5tos0Ev1+hNger7QGxfiLzrl3PyfpqJfb+sr4vSMTDR4qCOYy15HSVmrJs4ddx3Dp8wDRpWhvQQKYfGjvTGJCS4rK8nvPDhvt9WfADPwlUE4etx5ROpFv/6A55950mYkn+zxMv45etLpCB/esw5NGjm3Vy77gEnX+lyQIua2xFOM+hNghg8fjp17Djhl2aolc9C1i21A1x9//h3jJn3jNO+EsaPwocWFgT3isg+Y8hXGatzv51uyTz75GGvWb3E66Teu+h0dLYIlFRNfuapCs7bOgzG1a9MCW9ezKI+OU5kHTPkZxnrw72fAfP3VFPy+yK42k7mTOzf+idYt7cfB7PBkH6cmzsz/29ULhxAe5thlT5kHjOV0SUzKfp6CLwkMAnIjJjLcyo3bRZV6Kk8xxpyPIjsmqiQgYkKS5jpAzfauBFzP6Miw9Z5urdzN709bsjmzZ+K7mb84ZdWBnavR9MFGdmm+/XE+Jn7pXOy2cP536NnD8UrkX4BRaSZQSieauUnIphhl+LNWoFJpFlFKSy7yCYmLUYabRyBBpdkISp8pzkMImRitDP/c3QnvaT5/AsyyJQswYcq3Tll29O+NaBht/45HyLZs0Et9MOvbSQ7r8DfArKOUPm/BjSkxkRFWl++JKvUuSvF4CSCwO1oZ0aX4e0KSmmn2fWoBmPXRynAf2ymW9MCfALNt8zqMGD3BKWDOHt2BKKVj36+du/XD8VNnHZZRu2YNnD+xqxwwjAOJKvU1SlHiDYGgT4wywspZb8I19QUQlBhPULokJqqCecVJUKl7g8JkocS0zQiSopURUZ6uFO7m9yfA/HtoL14Z8r5TViWe2Y9qVR2HUftp7kJ84iLGjLNVqsysMKcTk2s3i67t0KXIheTsSlJK0yilJRqVFPVjoiIuW59z1Ew5q8T9EsE3McoI85km4Zq6HgjMvn4IIVRPSJVGtcMy3J30nuTzJ8AkXjiJZ3uXRD+2xzdV/BGEhzsO1JlyMxWNHnncqRDzmymfYuhg+9pS3gKMq/kqZE54pBp85sy1CjRIEmww2BfnKoKC23NEsrzk/IKc/PycRjzTzrudQoLCAi3BwH6mlH6eV5Bjjo3HEUIUitALoDBfpfDU0C+/IM+5gEAIB9ygCVGEXXeUrawpX2bcvIx2jzuPHJ167SQCA5yHZevR9w3s+9uxy9mnn+qMZQtYyFPb5Awwaek3BcUBkEg4jhQY8po2jcpyY8gtprAnuV3kTVCpPwKFOcgkIdgbrYzobJntokrTgKfUKjY4B/RvEBlRAjTT1m4Ppehk0fIxMcoI51KxO9Q3f1phaFEmHmhuNWQ2XNWknHMYpq+YePGytXhnpPkYalNGSEgwkuIOQyq11V721grjjeng0QrjqgGJKs0SSqmF/ynyfUxk+CjLfAlJWR0BYmWFKZVyHevVDPvbmk7zHUBHFv9GCPkzWhkuWOPZVVvFPPcnwFQI5lE1qrlD9jA1/bSkUy7Zl52TiwYPdkBhUZFD2u0blqBta9u6/AcwSZrzFNR8PcxR8mqDqHCm2m9O8Uma/gTUKjY4R0h0A2W4lcbfxWuaQTyhC8yAAbkQHRne2OVI3QECfwIME7pWr9sC+QUFdjkZFhqK5MR/BHH5taEfOtUa+GT0u/hk9Ds2ZfkFYG7coIo8gyabUpiDHUqItGl9ZYjV/WJikmYUBbW66A+RhgfXrEmsLJsuqXIfMlD9mZIVBoZgSXhYaTpBI+chkb8BpknLJ6BKvmGXa1WrVMbFs/sFcXT7rv3o8/Iwh7SO1GT8AjCJydmPUp4/ZMGdwmhleCghRG+11VKpp4HiI4vfNDGRETbG4JRSaaJKk8Ni9ZhBw3HtomuHHRY0Wl4kEgsYL1bt9aJcWVyyCnv1HYBz5+x78K9Zswb27NwqqF16gwGxnZ9Eerr9y01mffnv4QNQKIIElceIfKl0y+q7Y2eY+CTNOwS05NqDkKMxyvDWpTmRqNIsppRanEXIhRgHW60ElYb5I21VXAYFGd4wMtxzTwqCh8dE6G+AGfzW2zhwwPLdV8KwunXqYOtm4VpKX0+bjt//cKxs+cu8n9Gh/WOCR6TMACZRlT2PUr7E0Jtw82KUYUNLcyL+mno3ISi5hiFkV4wy/Al7HEtQZc8F5d8q2ZZx86OVYebvgrnsIaG/Aeaj/43Fhr/smxs3bBiDDWtXCubohbg49OzVzyH9kMGv46MPzXc7LsstO4BJ0hyloC3Nkxt4JzoyYnZpDiRcU8eBwOxTlFK6uGFUhVfscSoxSf02BcwrCgE5Fh0Zbl5xXHLXSwRiAXM/ayuztn88/mv8PM/qrsbMyRbNH8KeLVYSAJdcZnKd/87H26Vr3uxB7NtmrR1d5s8w7LxxUZWdQ0Etzhvk0eja4TaSq4Qko4cFs5iYI9y0Bsqw/9kFTLKmLeWp+cxCQAobKMNszkUuR8xDAn8DzLTv5mDy1B/tcq1d25bYus4+mByxedacBRg7cardxxzH4VrcYSt1/zIPmMuqzKZ6ylnatRpCpPlhNWvWtLr5unmTBmdrNbmWnCOUjIqOCv/eHjdv3LihyNUrspmzjOLnUsI3q6esaL498xALgrL7G2B+W7gcI8fYVw5/PPYxrFvO3DcIT2npGWj4cGfo9Vb3P+YCmMSfSf6LU5kHTPy17FcJ4f8o2Y6R89GR4Taepy+pNNEGShOsAYN+0VERDi2WEpM05yioWf5CKfdaw6gws3xG+LC5T+lvgNmwaQcGDravgNm9a2csX2hfpcUZh/u/+i42b9ttl2T40Ffx1eclm4wyD5jEJM131FoqvyRaGW7tuMqo7pIVSynZa8k1Cr5jw8iKVlJ+y+elb9UIyPfRpbQH3IeCsJz+BphDR46jW0+7x0qj4RczABObNm7ZhZdef89uNmaMxozS/GaFSVSp91KKWAtufBQTGTG9NHcuXtf05w3WUn4CNIiOjHAYhTQhST0agFmHjBDsi1ZGlOiYiR05N+j9DTDxiZfRqoOVzZ+Za/369MD8WfbPI85Yq9Pp0fDhTmDumEondo5hZssRtzWgy/QKw1T5L6o0WZbq+pTiiYZRETYWQolJ2R9Q8DMsGRakDFcoCbGvhwEg/pq6CyEwO7MigKaBMrwCU/l3Y+67lcXfAMNC9tVp1M4ur159uQ9mznBsLemMwWMnTMOsueaduxXp0j9m4ZluJpvCMg2YxCR1fQqY9cDYRA4MC6usDCc2r5KEJDVbKdiKUZzUMZERFZwxWaXSVCwE0i1tbFytSm6hwkkmR4Cxp9rPirnfr5WZM75KymYwGGw99Qr1XmmPnefjEtG2k6UxbgmV5TmmbAMmWd2H8jBLsgjBtWhlhN1wuglJmiWAlTbz+Rg7lwOlmZ2oUl+lFGaLS8Khb3TtCLNFprcBUro8fwMM6z/zYpmaZutc/L23X8eUCZaaTeK437l7Pxw/aWu+3Oyhxvh7h2lIyzZgktRTKGCOY0kI1kUrI+xaICUkqZl715LzB8WumKgIu1J+y2FIVKnXUgqzTT8BvoyOjHBsbCFuDF1SiwWMywLvIoEQXTLWvB49+yAhwcpsydjqYUOHYNT79g/vQrq1bPkqTPj8CxtSdo759/DfCA1lLrcdp/te0p+g0myCRWhx5jGmYVQFu5f4CSpNHCg1S/kJIYuileGDXDE6/lrWBOY5xkxHyOYYZbjZq4yr/J4+90fAvPbGWzh8xFaNf8S772D4OzYaT4JZnJubi/Ydu9gNqTF39kx0irX1qGlZuM8Bc+PGZa86k8jVVzwGwOwRQQLD4CCpxq5LkFxDxXOgCC5mAOEwO5jLdHnlUqAP72KA5FcLxqWHSDPNajiCR8tNwlx9xav2sjo6w9ymTeCobjTR3bpjQlaDvLbddjnrptAV5oPRH2PTZlsPmLVrVv1q7+bf57rJSmO2Zu36TM3LLzArmAVWqo+qD/dD96c6Y1T3CiASx/F1JNpku9t9T9rjLO8d01a+Uw0uL/fucCCoSqPvCYGN9JJS8n5B2nn7ejMCmxpUpUl7TsL9HRHdBVWbD0CYspXRNZA+Lz394IQq91SI4HLACBxUfydTVGs8FpROseUDHZafGufRCtNxOh1nyM+YKFVUMqs86fLSaW7y0U1n5j/teahlLw5eOWC8yMyyXJSiWqMhoLBRGiOUvpaXFueRalLsdPongAGMfwUZl6G4sARtcw4e/XrXNhv7qbvN43sCMGcSUyy1Asw8aRpdw+gcw9FzMcwrLktMnnLaEg4oqjV8DpSzsRSjPAYUpF9Y5gmvOs2gbXke069tm8A9l7enaYNQWXCAhKMNK4ZFdl6yxqHfO0/qdDfvPQEYdxtfns93HIj9xpBm0BVUpgYteH0ReL0W1FAEWXDl/w5+VvEhIS1JSbli98VYnLdGjbr7furWZVGYXDawYlAAgmTSMY8vXn1XXGk56k+ZBYw3ViV7TLvXVipXk1DIRHZGwyYxex47nf4LwJ6xXuK+0cR5CDERjdjzWs8IXsvdvJRTGDDt7HXt9QLtmIJbF34QUcQdJS2zgLmjXPPHwmu2UCj0+SxYr1XiCN8l91a8fT19kXwqBv9Xg975fuHZaw9reZN6YLWqlfYe2rGoRO4motxiwIvI4pS0HDDe4qSflDPrqS5aA6UyAtAR23dz3u52gyffH3vj9HYWrcE0Nyl0lCOjC255dnXtrXaWA8ZbnPSTcna/3PsyBa0LILPLkjWVvN3tyk2emp+fljTEVC5N43j0zU2Ps/KM6u06xZRXDhgx3Cqnxe6Xe12gYKFJSF6XJaudK3qJ5xdRVG3ETNvZJcI5nqPPFt6ME629IL5a4TnKNGAopfLkbIRIDAgBj2BQnUJPiUIqQRD7JNSgAIgCBIGUkkCOIIAHH0gIFwBKAkH5QEogJwRyUCKn4OWEcDJCIQeBnFLIACoFAfOgLQX7TnH7O5UCHAdQCQjhQKkEIKbvAGf8m4DAFAqEEGIcCnLbbMH4m3FDAtDbtj70dtADCmb7w/6B8gB4gBiMfxNiAGW/se8sogLRg0IPYvyvA2D6DqIn7DuFlhJoKeV1BJwWhGophZZQaEG4QhBaSClfxIEr/HbR1mZrli2unp/8X6tcHW92bhJdv/6cLRvW/AIiyweHPIMEubXDkEsI0QqfhibK4KqNXqEA86hxOF9X1B1Zl5mDlHsq3dOASU2lIQYZKuv0usrgSCUJIRUBvgLlSQVKEMGBhPOgEaB8OEDCKBBGYAyJEUKBEAI2ocuTOxw4dfoMzp0/j/j4RJw5+x/i4uJZGBKbotq0boWFf9jGwKSAjgDMwUkuBXIIkA3QbBBOw4GoeVANoVATjmYBXJaB0syWrR79SSaX33rhuef7zpr2P/u+ad3pjBfz3BXAUEq5lCzUNhj0dQmhUQBRArQWBalBCGoAtBqlqAZAuM9QLzKlvCjgzaHDceCgydslc+Eqk8nNoSiYIRn7r9PpUCEiAn/vMxvAepN1BYTgFkBuUYoUApoCEBYcWEUpuSaRSK/UqIBkQghbZX2W7jhgKKWylCx9WwOPdoTQhylIE0IRbemzzGe9La+oTHGA+aWjBIkE9Byl5JSEw6EaFaRHCCFs+3lH0h0FTHK6bjIFhoNtm8pTOQd8wgGiJsBPtSvLrAIPe6vqOw8YguGg5YDx1oCVl+OCA4SoCb1PAcO6Zt6SAe0IpQ9TigcBRANwHhSxfGaUc8A1B1g4s0RC8B8l5JQE9/mWzFF/iw/9hOjrGkCiYKDmQz9AaxKCqpSSagAtP/S7njRllIIUEELZgT+VgqZwIDeMh34JUUlAr1FaRg/9noxm8bUy1esq6+1cK5vORiS8/FrZEy7fmbzOrpUBqgGImhCoCUqulaU8zSBSWbpEh/SqVYmVz+0700rxpd7RM4z45ng3hz3BJSREoadQSDkSZKBQgPIKUAeCS8IHMiElE16aBZeAnICTWQouCYHUJMQ0Ci9vCy6JlIJKOJOAkqNMcGkrwCTMFJdYCCwtBZilBZbsO5NWwiQPoaUFlsQouGQSS8oTkzCzRHAJGIWVtLTgEryOAtpiwSUTWjJhJqi14JKnKCKEFoKgEITLlxDk63laICXIh4Hme0Nw6d3RvzOl/R8AdGoXzom1qQAAAABJRU5ErkJggg=="},16722:function(At,_t,he){"use strict";he.d(_t,{Z:function(){return Ie}});const ie=we=>typeof we=="object"&&we!=null&&we.nodeType===1,et=(we,fe)=>(!fe||we!=="hidden")&&we!=="visible"&&we!=="clip",Me=(we,fe)=>{if(we.clientHeight<we.scrollHeight||we.clientWidth<we.scrollWidth){const Ke=getComputedStyle(we,null);return et(Ke.overflowY,fe)||et(Ke.overflowX,fe)||(me=>{const rt=(Ne=>{if(!Ne.ownerDocument||!Ne.ownerDocument.defaultView)return null;try{return Ne.ownerDocument.defaultView.frameElement}catch(De){return null}})(me);return!!rt&&(rt.clientHeight<me.scrollHeight||rt.clientWidth<me.scrollWidth)})(we)}return!1},ze=(we,fe,Ke,me,rt,Ne,De,Le)=>Ne<we&&De>fe||Ne>we&&De<fe?0:Ne<=we&&Le<=Ke||De>=fe&&Le>=Ke?Ne-we-me:De>fe&&Le<Ke||Ne<we&&Le>Ke?De-fe+rt:0,pe=we=>{const fe=we.parentElement;return fe==null?we.getRootNode().host||null:fe},ge=(we,fe)=>{var Ke,me,rt,Ne;if(typeof document=="undefined")return[];const{scrollMode:De,block:Le,inline:xe,boundary:Oe,skipOverflowHiddenElements:Xe}=fe,Je=typeof Oe=="function"?Oe:Ct=>Ct!==Oe;if(!ie(we))throw new TypeError("Invalid target");const st=document.scrollingElement||document.documentElement,$e=[];let lt=we;for(;ie(lt)&&Je(lt);){if(lt=pe(lt),lt===st){$e.push(lt);break}lt!=null&&lt===document.body&&Me(lt)&&!Me(document.documentElement)||lt!=null&&Me(lt,Xe)&&$e.push(lt)}const it=(me=(Ke=window.visualViewport)==null?void 0:Ke.width)!=null?me:innerWidth,Yt=(Ne=(rt=window.visualViewport)==null?void 0:rt.height)!=null?Ne:innerHeight,{scrollX:Ye,scrollY:Ge}=window,{height:mt,width:Te,top:Qe,right:Pe,bottom:ot,left:$t}=we.getBoundingClientRect(),{top:wt,right:pn,bottom:Ot,left:ve}=(Ct=>{const Be=window.getComputedStyle(Ct);return{top:parseFloat(Be.scrollMarginTop)||0,right:parseFloat(Be.scrollMarginRight)||0,bottom:parseFloat(Be.scrollMarginBottom)||0,left:parseFloat(Be.scrollMarginLeft)||0}})(we);let de=Le==="start"||Le==="nearest"?Qe-wt:Le==="end"?ot+Ot:Qe+mt/2-wt+Ot,ut=xe==="center"?$t+Te/2-ve+pn:xe==="end"?Pe+pn:$t-ve;const Jt=[];for(let Ct=0;Ct<$e.length;Ct++){const Be=$e[Ct],{height:tt,width:at,top:en,right:ct,bottom:Pt,left:We}=Be.getBoundingClientRect();if(De==="if-needed"&&Qe>=0&&$t>=0&&ot<=Yt&&Pe<=it&&(Be===st&&!Me(Be)||Qe>=en&&ot<=Pt&&$t>=We&&Pe<=ct))return Jt;const gt=getComputedStyle(Be),St=parseInt(gt.borderLeftWidth,10),ae=parseInt(gt.borderTopWidth,10),te=parseInt(gt.borderRightWidth,10),z=parseInt(gt.borderBottomWidth,10);let oe=0,ue=0;const ne="offsetWidth"in Be?Be.offsetWidth-Be.clientWidth-St-te:0,be="offsetHeight"in Be?Be.offsetHeight-Be.clientHeight-ae-z:0,Ve="offsetWidth"in Be?Be.offsetWidth===0?0:at/Be.offsetWidth:0,Tt="offsetHeight"in Be?Be.offsetHeight===0?0:tt/Be.offsetHeight:0;if(st===Be)oe=Le==="start"?de:Le==="end"?de-Yt:Le==="nearest"?ze(Ge,Ge+Yt,Yt,ae,z,Ge+de,Ge+de+mt,mt):de-Yt/2,ue=xe==="start"?ut:xe==="center"?ut-it/2:xe==="end"?ut-it:ze(Ye,Ye+it,it,St,te,Ye+ut,Ye+ut+Te,Te),oe=Math.max(0,oe+Ge),ue=Math.max(0,ue+Ye);else{oe=Le==="start"?de-en-ae:Le==="end"?de-Pt+z+be:Le==="nearest"?ze(en,Pt,tt,ae,z+be,de,de+mt,mt):de-(en+tt/2)+be/2,ue=xe==="start"?ut-We-St:xe==="center"?ut-(We+at/2)+ne/2:xe==="end"?ut-ct+te+ne:ze(We,ct,at,St,te+ne,ut,ut+Te,Te);const{scrollLeft:bt,scrollTop:ft}=Be;oe=Tt===0?0:Math.max(0,Math.min(ft+oe/Tt,Be.scrollHeight-tt/Tt+be)),ue=Ve===0?0:Math.max(0,Math.min(bt+ue/Ve,Be.scrollWidth-at/Ve+ne)),de+=ft-oe,ut+=bt-ue}Jt.push({el:Be,top:oe,left:ue})}return Jt},Fe=we=>we===!1?{block:"end",inline:"nearest"}:(fe=>fe===Object(fe)&&Object.keys(fe).length!==0)(we)?we:{block:"start",inline:"nearest"};function Ie(we,fe){if(!we.isConnected||!(rt=>{let Ne=rt;for(;Ne&&Ne.parentNode;){if(Ne.parentNode===document)return!0;Ne=Ne.parentNode instanceof ShadowRoot?Ne.parentNode.host:Ne.parentNode}return!1})(we))return;const Ke=(rt=>{const Ne=window.getComputedStyle(rt);return{top:parseFloat(Ne.scrollMarginTop)||0,right:parseFloat(Ne.scrollMarginRight)||0,bottom:parseFloat(Ne.scrollMarginBottom)||0,left:parseFloat(Ne.scrollMarginLeft)||0}})(we);if((rt=>typeof rt=="object"&&typeof rt.behavior=="function")(fe))return fe.behavior(ge(we,fe));const me=typeof fe=="boolean"||fe==null?void 0:fe.behavior;for(const{el:rt,top:Ne,left:De}of ge(we,Fe(fe))){const Le=Ne-Ke.top+Ke.bottom,xe=De-Ke.left+Ke.right;rt.scroll({top:Le,left:xe,behavior:me})}}}}]);