|
|
(self.webpackChunk=self.webpackChunk||[]).push([[7043],{32464:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,_typeof=__webpack_require__(31468).default;(function(){if("function"!=typeof window.GGBApplet){var isRenderGGBElementEnabled=!1,scriptLoadStarted=!1,html5AppletsToProcess=null,ggbHTML5LoadedCodebaseIsWebSimple=!1,ggbHTML5LoadedCodebaseVersion=null,ggbHTML5LoadedScript=null,GGBApplet=function(){"use strict";for(var e={},t="5.0",n={},i=null,r=!1,o=!1,a=null,s=!1,l=null,c=null,u=0;u<arguments.length;u++){var d=arguments[u];if(null!==d)switch(_typeof(d)){case"number":t=d.toFixed(1);break;case"string":d.match(new RegExp("^[0-9]\\.[0-9]+$"))?t=d:a=d;break;case"object":void 0!==d.is3D?i=d:n=d;break;case"boolean":r=d,o=!0}}null===i&&(i={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},void 0===n.material_id||o||(r=!0)),null!==a&&void 0===n.id&&(n.id=a);var h="",p=!1,f=null,m=null,g=null,v=!1,y=null,x=null,b=null;void 0!==n.height&&(n.height=Math.round(n.height)),void 0!==n.width&&(n.width=Math.round(n.width));var w=function(e){return parseFloat(e)>4?parseFloat(e):5};function C(){try{return window.self!==window.top}catch(e){return!0}}function k(){return(!n.hasOwnProperty("screenshotGenerator")||!n.screenshotGenerator)&&Math.max(screen.width,screen.height)<800}e.setHTML5Codebase=function(e,t){c=e,R(e,t)},e.setJavaCodebase=e.setJavaCodebaseVersion=e.isCompiledInstalled=e.setPreCompiledScriptPath=e.setPreCompiledResourcePath=function(){},e.setHTML5CodebaseVersion=function(e,t){var n=parseFloat(e);NaN!==n&&n<5?console.log("The GeoGebra HTML5 codebase version "+n+" is deprecated. Using version latest instead."):(l=e,I(e,t))},e.getHTML5CodebaseVersion=function(){return m},e.getParameters=function(){return n},e.setFontsCSSURL=function(e){b=e},e.setGiacJSURL=function(e){},e.setJNLPFile=function(e){e},e.setJNLPBaseDir=function(e){},e.inject=function(){function t(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var i,r="auto",o=n.id,a=!1,l=0;l<arguments.length;l++){var c=arguments[l];"string"==typeof c?(c=c.toLowerCase()).match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?r=c:o=arguments[l]:"boolean"==typeof c?a=c:c instanceof HTMLElement&&(i=c)}function u(){if(s){r=B(r);var l=i||document.getElementById(o);if(l)if(e.removeExistingApplet(l,!1),void 0===n.width&&l.clientWidth&&(n.width=l.clientWidth),void 0===n.height&&l.clientHeight&&(n.height=l.clientHeight),n.width&&n.height||"html5"!==r||(delete n.width,delete n.height),f=r,"screenshot"===r)_(l,n);else{var c=!1;n.hasOwnProperty("playButton")&&n.playButton||n.hasOwnProperty("clickToLoad")&&n.clickToLoad?c=!0:n.hasOwnProperty("playButtonAutoDecide")&&n.playButtonAutoDecide&&(c=(!C()||t())&&k()),c?(f="screenshot",A(l,n,a,r)):L(l,n,a)}else console.log("possibly bug on ajax loading? ")}else setTimeout(u,200)}u()},e.getViews=function(){return i},e.isJavaInstalled=function(){return!1};var S=function(t){var r=function(){n.onError&&n.onError(),O("Error: Fetching material (id "+n.material_id+") failed.",n)},o=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",a="/materials/"+n.material_id+"?scope=basic";M("https://"+o+"/api/proxy.php?path="+encodeURIComponent(a),(function(o){var a=JSON.parse(o),s=a.elements?a.elements.filter((function(e){return"G"==e.type||"E"==e.type}))[0]:a;if(s&&s.url){n.fileName=s.url,E(s.settings||{}),i.is3D=!0;var l="https://www.geogebra.org/images/";e.setPreviewImage(y||s.previewUrl,l+"GeoGebra_loading.png",l+"applet_play.png"),t()}else r()}),r)};function E(e){["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach((function(t){e[t]=!!e[t]})),["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"].forEach((function(t){void 0===n[t]&&void 0!==e[t]&&(n[t]=e[t])})),void 0===n.showToolBarHelp&&(n.showToolBarHelp=n.showToolBar)}function M(e,t,n){var i=new XMLHttpRequest;i.open("GET",e),i.onload=function(){t(i.responseText)},i.onerror=n,i.send()}e.isHTML5Installed=function(){return!0},e.getLoadedAppletType=function(){return f},e.setPreviewImage=function(e,t,n){y=e,x=t,n},e.removeExistingApplet=function(e,t){var i;"string"==typeof e&&(e=document.getElementById(e)),f=null;var r=null;for(i=0;i<e.childNodes.length;i++){var o=e.childNodes[i],a=o.className;"applet_screenshot"===a?t?(o.style.display="block",f="screenshot"):o.style.display="none":"applet_scaler prerender"!==a&&(e.removeChild(o),r=a&&-1!=a.indexOf("appletParameters")?o.id:null,i--)}var s=void 0!==n.id?n.id:r,l=window[s];l&&"function"==typeof l.getBase64&&(l.remove(),window[s]=null)},e.refreshHitPoints=function(){if(w(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var t=e.getAppletObject();return!(!t||"function"!=typeof t.recalculateEnvironments)&&(t.recalculateEnvironments(),!0)},e.startAnimation=function(){var t=e.getAppletObject();return!(!t||"function"!=typeof t.startAnimation)&&(t.startAnimation(),!0)},e.stopAnimation=function(){var t=e.getAppletObject();return!(!t||"function"!=typeof t.stopAnimation)&&(t.stopAnimation(),!0)},e.getAppletObject=function(){var e=void 0!==n.id?n.id:"ggbApplet";return window[e]},e.resize=function(){};var T=function(e){return e&&"false"!==e},L=function(t,n,i){w(m)<=4.2&&(i=!0);var r=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==m||ggbHTML5LoadedCodebaseIsWebSimple&&!v)&&(r=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var o=document.createElement("div");o.classList.add("appletParameters","notranslate");var a=n.width,s=n.height;if(n.disableAutoScale=void 0===n.disableAutoScale?GGBAppletUtils.isFlexibleWorksheetEditor():n.disableAutoScale,void 0!==n.width)if(w(m)<=4.4)T(n.showToolBar)&&(n.height-=7),T(n.showAlgebraInput)&&(n.height-=37),n.width<605&&T(n.showToolBar)&&(n.width=605,a=605);else{var u=100;(T(n.showToolBar)||T(n.showMenuBar))&&(n.hasOwnProperty("customToolBar")&&(n.customToolbar=n.customToolBar),u=T(n.showMenuBar)?245:155),a<u&&(n.width=u,a=u)}for(var d in o.style.border="none",o.style.display="inline-block",n)n.hasOwnProperty(d)&&"appletOnLoad"!==d&&o.setAttribute("data-param-"+d,n[d]);b&&o.setAttribute("data-param-fontscssurl",b),e.resize=function(){GGBAppletUtils.responsiveResize(t,n)},window.addEventListener("resize",(function(t){e.resize()}));var p="function"==typeof n.appletOnLoad?n.appletOnLoad:function(){};if(i||void 0===n.width){var f=document.createElement("div");f.className="applet_scaler",f.style.position="relative",f.style.display="block",f.appendChild(o),t.appendChild(f),n.appletOnLoad=function(t){e.resize(),p(t)}}else{n.hasOwnProperty("showSplash")||o.setAttribute("data-param-showSplash","false");var y=t.querySelector(".applet_scaler.prerender"),x=null!==y;if(x)C=y.querySelector(".ggb_preview");else{var C=D(a,s,n.borderColor,!1);(y=document.createElement("div")).className="applet_scaler",y.style.position="relative",y.style.display="block",y.style.width=a+"px",y.style.height=s+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(y,"66%"),w(m)>=5?(n.appletOnLoad=function(e){var n=t.querySelector(".ggb_preview");n&&n.parentNode.removeChild(n),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(y),window.GGBT_wsf_view&&$(window).trigger("resize"),p(e)},x||y.appendChild(C)):o.appendChild(C),y.appendChild(o),x||t.appendChild(y),setTimeout((function(){e.resize()}),1)}function k(e,t){t&&"function"==typeof t.appletOnLoad&&"function"==typeof renderGGBElement?renderGGBElement(e,t.appletOnLoad):renderGGBElement(e),O("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",t)}function S(e,t){"undefined"==typeof renderGGBElement?(null===html5AppletsToProcess&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:e,params:t}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,null!==html5AppletsToProcess&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach((function(e){k(e.article,e.params)})),html5AppletsToProcess=null)},w(m)<5&&(e.className+=" geogebraweb")):k(e,t)}if(r){scriptLoadStarted=!0;for(var E=0;E<o.childNodes.length;E++){"TABLE"===o.childNodes[E].tagName&&(o.removeChild(o.childNodes[E]),E--)}if(null!==ggbHTML5LoadedScript){var M=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');null!=M&&M.parentNode.removeChild(M)}var L=document.createElement("script"),_=function(){S(o,n)};L.src=h+g,ggbHTML5LoadedCodebaseIsWebSimple=v,ggbHTML5LoadedCodebaseVersion=m,ggbHTML5LoadedScript=L.src,O("GeoGebra HTML5 codebase loaded: '"+h+"'.",n),c||l&&"5.0"!=l?h.requirejs?__webpack_require__.e(5803).then(function(){var e=[__webpack_require__(55803)];_.apply(null,e)}.bind(this)).catch(__webpack_require__.oe):(L.onload=_,t.appendChild(L)):(v?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),_())}else S(o,n);n.height=s,n.width=a},_=function(t,n,i){var r=D(n.width,n.height,n.borderColor,i),o=document.createElement("div");o.style.position="relative",o.style.display="block",o.style.width=n.width+"px",o.style.height=n.height+"px",o.className="applet_screenshot applet_scaler"+(i?" applet_screenshot_play":""),o.appendChild(r);var a=GGBAppletUtils.getScale(n,t,i);i?(t.appendChild(P()),window.GGBT_wsf_view||(t.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(o,"66%"),t.appendChild(o),1===a||isNaN(a)||(GGBAppletUtils.scaleElement(o,a),o.style.width=n.width+"px",o.style.height=n.height+"px",o.parentNode.style.width=n.width*a+"px",o.parentNode.style.height=n.height*a+"px"),e.resize=function(){N(t,r,o,i)},window.addEventListener("resize",(function(t){e.resize()})),e.resize()};function N(e,t,i,r){if(e.contains(t)){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if("fullscreencontent"!==e.id)return;window.GGBT_wsf_view.setCloseBtnPosition(e)}var o=GGBAppletUtils.getScale(n,e,r);null!==i.parentNode&&(isNaN(o)||1===o?(GGBAppletUtils.scaleElement(i,1),i.parentNode.style.width=n.width+"px",i.parentNode.style.height=n.height+"px"):(GGBAppletUtils.scaleElement(i,o),i.parentNode.style.width=n.width*o+"px",i.parentNode.style.height=n.height*o+"px")),"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(e),"object"===_typeof(window.GGBT_ws_header_footer)&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}e.onExitFullscreen=function(e,t){t.appendChild(e)};var A=function(e,t,n,i){_(e,t,!0);for(var r=function(){var n=[];for(a=0;a<e.childNodes.length;a++)n.push(e.childNodes[a]);if(window.GGBT_wsf_view){var r=window.GGBT_wsf_view.renderFullScreen(e,t.id),o=document.getElementById("fullscreencontainer"),s=jQuery(e).find(".fullscreencontent");s.length>0?(r.remove(),s.attr("id","fullscreencontent").show(),jQuery(o).append(s),window.dispatchEvent(new Event("resize"))):L(r,t,!1),window.GGBT_wsf_view.launchFullScreen(o)}else f=i,L(e,t,!1);if(!window.GGBT_wsf_view)for(a=0;a<n.length;a++)e.removeChild(n[a])},o=e.getElementsByClassName("ggb_preview_play"),a=0;a<o.length;a++)o[a].addEventListener("click",r,!1),o[a].addEventListener("ontouchstart",r,!1);"function"==typeof window.ggbAppletPlayerOnload&&window.ggbAppletPlayerOnload(e),k()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},P=function(){var e=document.createElement("div");if(e.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var t='.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");}',n=document.createElement("style");n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(n)}return e},D=function(e,t,n,i){var r=document.createElement("div");r.className="ggb_preview",r.style.position="absolute",r.style.zIndex="90",r.style.width=e-2+"px",r.style.height=t-2+"px",r.style.top="0px",r.style.left="0px",r.style.overflow="hidden",r.style.backgroundColor="white";var o="lightgrey";void 0!==n&&(o="none"===n?"transparent":n),r.style.border="1px solid "+o;var a,s,l,c=document.createElement("img");if((c.style.position="relative",c.style.zIndex="1000",c.style.top="-1px",c.style.left="-1px",null!==y&&c.setAttribute("src",y),c.style.opacity=.7,null!==x)&&!i){(a=document.createElement("img")).style.position="absolute",a.style.zIndex="1001",a.style.opacity=1,c.style.opacity=.3,(s=360)>e/4*3&&(s=e/4*3),l=s/5.8,a.setAttribute("src",x),a.setAttribute("width",s),a.setAttribute("height",l);var u=(e-s)/2,d=(t-l)/2;a.style.left=u+"px",a.style.top=d+"px",r.appendChild(a)}return r.appendChild(c),r},B=function(e){return"html5"===(e=e.toLowerCase())||"screenshot"===e?e:"html5"},j=["web","webSimple","web3d","tablet","tablet3d","phone"],I=function(e,t){if(m=e,t)R(m,!0);else{var o,a,s=!r;if(s){var l=w(m);!isNaN(l)&&l<4.4&&(s=!1)}o="http"===window.location.protocol.substr(0,4)?window.location.protocol:"http:";var c=m.indexOf("//");for(var u in a=c>0?m:0===c?o+m:"https://www.geogebra.org/apps/5.2.814.0/",j)if(m.slice(-1*j[u].length)===j[u]||m.slice(-1*(j[u].length+1))===j[u]+"/")return void R(a,!1);GGBAppletUtils.isFlexibleWorksheetEditor()||!s||i.is3D||i.AV||i.SV||i.CV||i.EV2||i.CP||i.PC||i.DA||i.FI||i.PV||T(n.showToolBar)||T(n.showMenuBar)||T(n.showAlgebraInput)||T(n.enableRightClick)||n.appName&&"classic"!=n.appName?a+="web3d/":a+="webSimple/",R(a,!1)}},R=function(e,t){if(e.requirejs)h=e;else{"/"!==e.slice(-1)&&(e+="/"),h=e,null===t&&(t=-1===e.indexOf("http")),p=t,g="web.nocache.js",v=!1;var n=h.split("/");n.length>1&&(t||"webSimple"!==n[n.length-2]?j.indexOf(n[n.length-2])>=0&&(g=n[n.length-2]+".nocache.js"):(g="webSimple.nocache.js",v=!0)),n=e.split("/"),"test"===(m=n[n.length-3]).substr(0,4)?m=m.substr(4,1)+"."+m.substr(5,1):"war"!==m.substr(0,3)&&"beta"!==m.substr(0,4)||(m="5.0");var i=parseFloat(m);NaN!==i&&i<5&&e.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+i+" is deprecated. Using version latest instead."),I("5.0",t))}},O=function(e,t){window.console&&window.console.log&&(!t||void 0===t.showLogging||t.showLogging&&"false"!==t.showLogging)&&console.log(e)};function Z(){var e=t;null!==l?e=l:parseFloat(e)<5&&(e="5.0"),I(e,!1),null!==c&&R(c,p),s=!0}return void 0!==n.material_id?S(Z):Z(),e},GGBAppletUtils=function(){"use strict";function e(){return void 0!==window.GGBT_wsf_edit}function t(e,t){1!=t?(e.style.transformOrigin="0% 0% 0px",e.style.webkitTransformOrigin="0% 0% 0px",e.style.transform="scale("+t+","+t+")",e.style.webkitTransform="scale("+t+","+t+")",e.style.maxWidth="initial",null!==e.querySelector(".ggb_preview")&&(e.querySelector(".ggb_preview").style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[0]&&(e.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[1]&&(e.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(e.style.transform="none",e.style.webkitTransform="none")}function n(e,t,n,i,r){if(e.isScreenshoGenerator)return 1;var o,a=void 0!==i&&i,s=null!=e.noScaleMargin&&e.noScaleMargin,l=(o=e.autoHeight)&&"false"!==o,c=function(e,t,n,i,r,o){var a=null;if(null!=o&&""!=o)for(var s=e.parentNode;null!=s;){if((" "+s.className+" ").indexOf(" "+o+" ")>-1){a=s;break}s=s.parentNode}var l=0,c=0,u=0,d=0,h=0,p=0,f=0;if(a)l=a.offsetWidth,c=Math.max(i?a.offsetWidth:0,a.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(l=Math.min(window.innerWidth,document.documentElement.clientWidth),c=Math.min(window.innerHeight,document.documentElement.clientHeight),u=l):(l=window.innerWidth,c=window.innerHeight,u=window.innerWidth),e){var m=e.getBoundingClientRect();m.left>0&&m.left<=l&&(void 0===r||!r)&&("rtl"===document.dir?(h=l-m.width-m.left,p=u<=480?10:30):(p=m.left,h=u<=480?10:30),d=p+h)}e&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(e.getBoundingClientRect(),"closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(d=40,f=0):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(d=0,f=40))}return e&&((void 0===n||!n)&&t>0&&t+d<l?l=t:l-=d,"object"!==_typeof(window.GGBT_wsf_view)||!window.GGBT_wsf_view.isFullscreen()||void 0!==n&&n||(c-=f)),{width:l,height:c}}(t,e.width,n,l,a&&window.GGBT_wsf_view||s,r),u=parseInt(c.width),d=e.width,h=e.height;if(void 0===d){var p=t.querySelector(".appletParameters");p&&(d=p.offsetWidth,h=p.offsetHeight)}var f=u/d,m=a?1:c.height/h;return void 0===n||n||(f=Math.min(1,f),m=Math.min(1,m)),Math.min(f,m)}function i(e,t,i){var r,o=1,a=!1;return e.hasOwnProperty("allowUpscale")&&(a=e.allowUpscale),e.hasOwnProperty("scale")&&(o=parseFloat(e.scale),(isNaN(o)||null===o||0===o)&&(o=1),o>1&&(a=!0)),t&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(a=!0),e.hasOwnProperty("disableAutoScale")&&e.disableAutoScale?o:(r=n(e,t,a,i,e.scaleContainerClass),!a||e.hasOwnProperty("scale")&&1!==o?Math.min(o,r):r)}function r(e){var t=Math.min(window.innerWidth,document.documentElement.clientWidth),n=Math.min(window.innerHeight,document.documentElement.clientHeight),i=e.getBoundingClientRect(),r=(t-i.width)/2,o=(n-i.height)/2;o<0&&(o=0),e.style.position="relative","closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(e.style.left=r<40?"40px":r+"px",e.style.top=o+"px"):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(e.style.top=o<40?"40px":o+"px",e.style.left=r+"px")}return{responsiveResize:function(n,o){var a=n.querySelector(".appletParameters");if(a){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if(o.id!==a.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(n)}if(a.parentElement&&/fullscreen/.test(a.parentElement.className))return;var s=i(o,n);e()&&a.setAttribute("data-param-scale",s);for(var l=null,c=0;c<n.childNodes.length;c++)if(void 0!==n.childNodes[c].className&&n.childNodes[c].className.match(/^applet_scaler/)){l=n.childNodes[c];break}if(null!==l&&null!==l.querySelector(".noscale"))return;var u=void 0!==o.id?o.id:"ggbApplet",d=window[u];null!=d&&d.recalculateEnvironments||null===l||l.className.match(/fullscreen/)||(l.parentNode.style.transform="",isNaN(s)||1===s?(t(l,1),l.parentNode.style.width=o.width+"px",l.parentNode.style.height=o.height+"px"):(l.parentNode.style.width=o.width*s+"px",l.parentNode.style.height=o.height*s+"px",t(l,s))),"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&r(n),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(a).parents(".content-added-content"))}},isFlexibleWorksheetEditor:e,positionCenter:r,getScale:i,scaleElement:t}}();__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return GGBApplet}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(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 e=n.location.search;return-1!=e.indexOf(J)||-1!=e.indexOf(K)}function q(e,t){}q(H,I),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||{},t;function u(){return v(),t}function v(){if(!t){var e=o.createElement(Q);if(e.id=L,e.style.cssText=R+S,e.tabIndex=-1,o.body.appendChild(e),t=e.contentWindow.document,-1==navigator.userAgent.indexOf(T)){t.open();var n=document.compatMode==U?V:W;t.write(n+X),t.close()}}}function w(e){q(cb,eb),function(e){function t(){return _typeof(o.readyState)==Y?_typeof(o.body)!=Y&&null!=o.body:/loaded|complete/.test(o.readyState)}var n=t();if(n)e();else{o.addEventListener&&o.addEventListener(Z,r,!1);var i=setInterval((function(){r()}),$)}function r(){if(!n){if(!t())return;n=!0,e(),o.removeEventListener&&o.removeEventListener(Z,r,!1),i&&clearInterval(i)}}}((function(){var t,n,i,r;t=e,n=u(),i=n.body,(r=n.createElement(_)).language=ab,r.crossOrigin=W,r.src=t,webModule.__errFn&&(r.onerror=function(){webModule.__errFn(L,new Error(bb+t))}),i.appendChild(r),q(cb,db)}))}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(e){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(e){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(e){var t=c[e];return null==t?null:t},r=d,webModule.__errFn=e}function B(){function e(e){var t=e.lastIndexOf(rb);-1==t&&(t=e.length);var n=e.indexOf(sb);-1==n&&(n=e.length);var i=e.lastIndexOf(tb,Math.min(n,t));return i>=O?e.substring(O,i+P):W}var t,n=null!=(t=__gwt_getMetaProperty(wb))?t:W;return n==W&&(n=function(){for(var t=o.getElementsByTagName(_),n=O;n<t.length;++n)if(-1!=t[n].src.indexOf(xb))return e(t[n].src);return W}()),n==W&&(n=function(){var e=o.getElementsByTagName(yb);return e.length>O?e[e.length-P].href:W}()),n==W&&function(){var e=o.location;return e.href==e.protocol+zb+e.host+e.pathname+e.search+e.hash}()&&(n=e(o.location.href)),n=function(t){if(t.match(/^\w+:\/\//));else{var n=o.createElement(ub);n.src=t+vb,t=e(n.src)}return t}(n),n}function C(e){return e.match(/^\//)||e.match(/^[a-zA-Z]+:\/\//)?e:webModule.__moduleBase+e}function D(){var e,t=O,i=[],o=[];function a(e){var t=o[e](),n=i[e];if(t in n)return t;var a=[];for(var s in n)a[n[s]]=s;throw r&&r(e,a,t),null}if(__gwt_isKnownPropertyValue=function(e,t){return t in i[e]},webModule.__getPropMap=function(){var e={};for(var t in i)i.hasOwnProperty(t)&&(e[t]=a(t));return e},webModule.__computePropValue=a,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);try{var s=(e=Cb).indexOf(Db);-1!=s&&(t=parseInt(e.substring(s+P),$),e=e.substring(O,s))}catch(e){}return webModule.__softPermutationId=t,C(e+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}s[L]={moduleName:L},webModule.__moduleStartupDone=function(e){var t=s[L].bindings;s[L].bindings=function(){for(var n=t?t():{},i=e[webModule.__softPermutationId],r=O;r<i.length;r++){var o=i[r];n[o[O]]=o[P]}return n}},webModule.__startLoadingFragment=function(e){return C(e)},webModule.__installRunAsyncCode=function(e){var t=u(),n=t.body,i=t.createElement(_);i.language=ab,i.text=e,n.appendChild(i),n.removeChild(i)},A(),webModule.__moduleBase="/react/build/js/mathematicalGraphics/"+name+"/",s[L].moduleBase=webModule.__moduleBase;var G=D();return F(),w(G),!0}return webModule},"function"!=typeof window.web3d&&(window.web3d=GGBAppletUtils.makeModule("web3d","A18F540516513B1292CA7CEF2F6AFC7E")),"function"!=typeof window.webSimple&&(window.webSimple=GGBAppletUtils.makeModule("webSimple","96B09BF1B436BF53F0DF54116700F16A")),window.GGBApplet=GGBApplet}else console.warn("deployggb.js was loaded twice")})()},78988:function(e,t,n){"use strict";function i(e){var t=!0;if(e.length>0){for(var n=0;n<e.length;n++)if(0==e[n].compile_success||!e[n].compile_success){t=!1;break}}else t=!1;return t}function r(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=[],i=0;i<e.length;i++){var r=e[i],o=t?"".concat(t,"/").concat(r.name):"".concat(r.name);n.push({title:r.name,type:r.type,isLeaf:"tree"!==r.type,key:o})}return n}function o(e,t,n){for(var i=0;i<e.length;i++){var r=e[i];if(r.key===t){r.children=n;break}r.children&&o(r.children,t,n)}return e}function a(e,t,n){var i;return function(){var r=this,o=arguments,a=function(){i=null,n||e.apply(r,o)},s=n&&!i;clearTimeout(i),i=setTimeout(a,t),s&&e.apply(r,o)}}n.d(t,{Ax:function(){return o},Ds:function(){return a},KI:function(){return s},SI:function(){return r},f1:function(){return i}});var s=n(91689).Z.API_SERVER},28791:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var i=n(82100),r=n.n(i),o=n(29186),a=n.n(o),s=n(80619),l=n.n(s),c=n(47074),u=n.n(c),d=n(59301),h=n(37568),p=n(96599),f=n(6767),m="flex___eLcnP",g="color666___TiUhG",v=n(62772),y=n(37712),x=(h.Z.TextArea,function(e){l()(n,e);var t=u()(n);function n(e){var i;return r()(this,n),(i=t.call(this,e)).state={inputVisible:!1,EditInputIndex:-1},i}return a()(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.index,i=t.onAnswerChange,r=t.addChildAnswer,o=(t.exerciseIsPublish,t.answers);t.activeOptionErrorIndex,t.flex;console.log("----",o);var a=this.state,s=a.inputVisible,l=a.EditInputIndex;return(0,y.jsxs)("div",{className:m,children:[(0,y.jsxs)("div",{className:"".concat(g," mb5 mt6"),style:{flex:"0 0 90px"},children:["答案(填空",n+1,"):"]}),(0,y.jsxs)("div",{style:{border:"1px solid #f6f6f6",flex:1,padding:10},children:[null==o?void 0:o.map((function(t,r){return(0,y.jsx)(y.Fragment,{children:l!==r&&(null==t?void 0:t.length)>0?(0,y.jsx)(p.Z,{className:"edit-tag",closable:!(0===n&&0===r),onClose:function(t){t.preventDefault(),1===(null==o?void 0:o.length)&&0===r?e.props.deleteChildAnswermain(n,r):e.props.deleteChildAnswer(n,r)},children:(0,y.jsx)("span",{onDoubleClick:function(t){e.setState({EditInputIndex:r}),t.preventDefault()},children:t})},t):(0,y.jsx)(h.Z,{defaultValue:t,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:function(t){t.target.value.replaceAll(" ","").length<=0?f.ZP.info("内容不能为纯空格"):(i(n,r,t.target.value),e.setState({EditInputIndex:-1,inputVisible:!1}))}})})})),!s&&(0,y.jsxs)(p.Z,{className:"site-tag-plus",onClick:function(){r(n),e.setState({inputVisible:!0})},children:[(0,y.jsx)(v.Z,{})," 新增答案"]})]})]})}}]),n}(d.Component))},38375:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var i=n(82242),r=n.n(i),o=n(82100),a=n.n(o),s=n(29186),l=n.n(s),c=n(13720),u=n.n(c),d=n(80619),h=n.n(d),p=n(47074),f=n.n(p),m=n(85573),g=n.n(m),v=n(59301),y=n(58358),x=n(37712),b="▁",w=function(e){h()(n,e);var t=f()(n);function n(){var e;a()(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return e=t.call.apply(t,[this].concat(r)),g()(u()(e),"getChCountBeforeCursor",(function(e,t){for(var n=t.line,i=0,r=0;r<n;r++)i+=e.getLine(r).split(b).length-1;return i+=e.getLine(n).substring(0,t.ch).split(b).length-1})),g()(u()(e),"onCMBeforeChange",(function(t,n){var i=t.getRange(n.from,n.to),r=0;if(n.text.forEach((function(e){r+=e.split(b).length-1})),i&&-1!=i.indexOf(b)){var o=i.split(b).length-1,a=e.getChCountBeforeCursor(t,n.from);console.log("删除".concat(o,"个, 之前有").concat(a,"个,新增").concat(r,"个")),e.props.deleteEmptyDisabled?n.cancel():e.props.onPlaceholderChange&&e.props.onPlaceholderChange(a,o,r)}else if(r){var s=e.getChCountBeforeCursor(t,n.from);console.log("新增".concat(r,"个,之前有").concat(s,"个")),e.props.onPlaceholderChange&&e.props.onPlaceholderChange(s,0,r)}})),e}return l()(n,[{key:"render",value:function(){return(0,x.jsx)(y.Z,r()(r()({},this.props),{},{onCMBeforeChange:this.onCMBeforeChange}))}}]),n}(v.Component)},11933:function(e,t,n){"use strict";n.d(t,{Z:function(){return b}});var i=n(7557),r=n.n(i),o=n(41498),a=n.n(o),s=n(79800),l=n.n(s),c=n(59301),u="imageDimensions___a7crR",d="img___Kroat",h="fullWidth___c492T",p=n(92310),f=n.n(p),m=n(29787),g=n(2859),v=n(94171),y=n(83287),x=n(37712),b=function(e){var t=e.data,n=e.className,i=e.fullWidth,o=e.style,s=void 0===o?{}:o,p=e.onClose,b=e.onOk,w=e.showFullTools,C=e.noAssociationId,k=(0,c.useRef)(null),S=(0,c.useRef)(null),E=(0,c.useRef)(null),M=(0,c.useRef)(null),T=(0,c.useState)(!1),L=l()(T,2),_=L[0],N=L[1],A=(0,c.useState)("正在加载中"),P=l()(A,2),D=P[0],B=P[1];(0,c.useEffect)((function(){return E.current||(E.current=document.createElement("style"),document.head.appendChild(E.current)),null!=t&&t.visible?(document.body.setAttribute("data-custom","y-hidden"),E.current.innerHTML=" html { overflow-y: hidden; }",null!=t&&t.src&&j()):(document.body.removeAttribute("data-custom"),E.current&&(document.head.removeChild(E.current),E.current=null)),function(){document.body.removeAttribute("data-custom"),E.current&&(document.head.removeChild(E.current),E.current=null)}}),[null==t?void 0:t.visible]);var j=function(){var e=a()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return N(!0),B("正在加载中"),e.next=4,(0,y.ZJ)(null==t?void 0:t.src);case 4:n=e.sent,k.current.src="",k.current.src=n,k.current.onload=function(){R()},N(!1),B("");case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),I=function(){var e=a()(r()().mark((function e(n){var i;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return N(!0),B("正在保存中"),e.next=4,(0,v.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:t.title,file:n.dataUrl}});case 4:if(null==(i=e.sent)||!i.id||C){e.next=12;break}return e.next=8,(0,v.ZP)("/api/attachments/".concat(t.id,"/add_subitem.json"),{method:"post",body:{subitem_id:null==i?void 0:i.id,settings:JSON.stringify(n.state)}});case 8:0===e.sent.status&&b(),e.next=13;break;case 12:null!=i&&i.id&&b(i);case 13:N(!1),B("");case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),R=function(){S.current=new g.hP(k.current),S.current.targetRoot=M.current,S.current.addEventListener("render",I),S.current.addEventListener("beforeclose",p),w&&(S.current.availableMarkerTypes=S.current.ALL_MARKER_TYPES,S.current.uiStyleSettings.redoButtonVisible=!0,S.current.uiStyleSettings.notesButtonVisible=!0,S.current.uiStyleSettings.zoomButtonVisible=!0,S.current.uiStyleSettings.zoomOutButtonVisible=!0,S.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=S.current.uiStyleSettings,S.current.show(),null!=t&&t.snapshotData&&S.current.restoreState(t.snapshotData),setTimeout((function(){var e;window.scrollTo(0,0),(e=document.querySelector('a[href="https://markerjs.com/"]'))&&e.parentNode&&(e.parentNode.style.display="none"),[{name:'[data-action="select"]',title:"选择"},{name:'[data-action="delete"]',title:"删除元素"},{name:'[data-action="undo"]',title:"撤销"},{name:'[data-type-name="FrameMarker"]',title:"矩形"},{name:'[data-type-name="FreehandMarker"]',title:"画线"},{name:'[data-type-name="ArrowMarker"]',title:"箭头"},{name:'[data-type-name="TextMarker"]',title:"文本"},{name:'[data-type-name="EllipseMarker"]',title:"椭圆"},{name:'[data-type-name="HighlightMarker"]',title:"方块"},{name:'[data-type-name="CalloutMarker"]',title:"注释"},{name:'[data-action="render"]',title:"保存"},{name:'[data-action="close"]',title:"退出"}].forEach((function(e){var t=document.querySelector(e.name);t&&t.setAttribute("title",e.title)}))}),300)};return(0,x.jsx)(c.Fragment,{children:(null==t?void 0:t.visible)&&(0,x.jsx)(m.Z,{spinning:_,tip:D,style:{position:"absolute",width:"100vw"},children:(0,x.jsx)("div",{ref:M,className:f()(u,n,i?h:""),style:s,children:(0,x.jsx)("img",{className:d,ref:k})})})})}},55893:function(e,t,n){"use strict";var i=n(59301),r=n(77019),o=n(5269),a=n(20554),s=n(99571),l=n(74889),c=n(21697),u=(n(48136),n(37712)),d=(0,i.forwardRef)((function(e,t){var n=e.callback,d=e.showSaveButton,h=e.value,p=void 0===h?"":h,f=(0,i.useRef)(),m=function(e){f.current.setValue(f.current.getValue()+" "+e.value+" ")},g=[{key:"1",label:"快捷模板",children:(0,u.jsx)(r.Z,{className:c.Z.lists,gutter:[10,10],children:[{name:"分数得分",value:"\\frac{x}{y}",children:[{name:"分数 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:"导数 Derivative",data:[{value:"\\dot{a} "},{value:"\\ddot{a}"},{value:"{f}^{\\prime}"},{value:"{f}^{\\prime\\prime}"},{value:"{f}^{(n)}"}]},{name:"模算术 Modular arithmetic",data:[{value:"a \\bmod b"},{value:"a \\equiv b \\pmod{m} "},{value:"\\gcd(m, n) "},{value:"\\operatorname{lcm}(m, n) "}]}]},{name:"根式角标",value:"\\sqrt{x}",children:[{name:"根式 Radicals",data:[{value:"\\sqrt{x}"},{value:"\\sqrt[y]{x}"}]},{name:"上下标 Sub&Super",data:[{value:"x^{a}"},{value:"x_{a}"},{value:"x_{a}^{b} "},{value:"_{a}^{b} x"},{value:"x_{a}^{b} "}]},{name:"重音符及其他 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:"极限对数",value:"\\lim_{x \\to 0}",children:[{name:"极限 Limits",data:[{value:"\\lim a"},{value:"\\lim_{x \\to 0}"},{value:"\\lim_{x \\to \\infty}"},{value:"\\max_b{a}"},{value:"\\min_a{b}"}]},{name:"对数指数 Logarithms and exponentials",data:[{value:"\\log_{a}{b}"},{value:"\\lg_{a}{b}"},{value:"\\ln_{a}{b}"},{value:"\\exp a"}]},{name:"界限 Bounds",data:[{value:"\\min x"},{value:"\\sup t"},{value:"\\inf s"},{value:"\\lim u"},{value:"\\limsup w"},{value:"\\dim p"},{value:"\\ker\\phi "}]}]},{name:"三角函数",value:"\\sin a",children:[{name:"三角函数 Trigonometric functions",data:[{value:"\\sin a"},{value:"\\cos a"},{value:"\\tan a"},{value:"\\cot a "},{value:"\\sec a "},{value:"\\csc a "}]},{name:"反三角函数 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:"双曲函数 Hyperblic functions",data:[{value:"\\sinh a"},{value:"\\cosh a"},{value:"\\tanh a"},{value:"\\coth a"},{value:"\\operatorname{sech} a"},{value:"\\operatorname{csch} a"}]},{name:"反双曲函数 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:"积分运算",value:"\\int_{a}^{b}",children:[{name:"积分 Integral",data:[{value:"\\int"},{value:"\\int_{a}^{b}"},{value:"\\int\\limits_{a}^{b}"}]},{name:"双重积分 Double integral",data:[{value:"\\iint"},{value:"\\iint_{a}^{b} "},{value:"\\iint\\limits_{a}^{b} "}]},{name:"三重积分 Triple integral",data:[{value:"\\iiint"},{value:"\\iiint_{a}^{b}"},{value:"\\iiint\\limits_{a}^{b} "}]},{name:"曲线积分 Closed line or path integral",data:[{value:"\\oint"},{value:"\\oint_{a}^{b} "}]}]},{name:"大型运算",value:"\\sum_{a}^{b}",children:[{name:"求和 Summation",data:[{value:"\\sum"},{value:"\\sum_{a}^{b}"},{value:"{\\textstyle \\sum_{a}^{b}} "}]},{name:"乘积余积 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:"并集交集 Union and intersection",data:[{value:"\\bigcup"},{value:"\\bigcup_{a}^{b}"},{value:"{\\textstyle \\bigcup_{a}^{b}}"},{value:"\\bigcap"},{value:"\\bigcap_{a}^{b}"}]},{name:"析取合取 Disjunction and conjunction",data:[{value:"\\bigvee"},{value:"\\bigvee_{a}^{b}"},{value:"\\bigwedge"},{value:"\\bigwedge_{a}^{b}"}]}]},{name:"括号取整",value:"\\left [ \\left ( \\right ) \\right ] ",children:[{name:"括号 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 "}]}]}].map((function(e,t){return(0,u.jsxs)(o.Z,{flex:"110px",className:c.Z.item,children:[(0,u.jsxs)("div",{children:[(0,u.jsx)(l.Z,{value:"$$".concat(e.value,"$$")}),e.name]}),(0,u.jsx)("div",{className:c.Z.children,children:e.children.map((function(e,t){return(0,u.jsxs)("div",{children:[(0,u.jsx)("h1",{children:e.name}),(0,u.jsx)(r.Z,{gutter:[10,10],children:e.data.map((function(e,t){return(0,u.jsx)(o.Z,{onClick:function(){return m(e)},className:c.Z.diamond,children:(0,u.jsx)(l.Z,{value:"`$$"+e.value+"$$`"})},t)}))})]},t)}))})]})}))})},{key:"2",label:"公式模板",children:(0,u.jsx)(r.Z,{className:c.Z.lists,gutter:[10,10],children:[{name:"代数",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\n x=a + r\\text{cos}\\theta \\ \r\n y=b + r\\text{sin}\\theta \r\n\\end{matrix}\\right. "},{value:"\\begin{array}{l} \r\n \\text{对于方程形如:}x^{3}-1=0 \\ \r\n \\text{设}\\text{:}\\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r\n x_{1}=1,x_{2}= \\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r\n x_{3}= \\omega ^{2}=\\frac{-1-\\sqrt{3}i}{2} \r\n\\end{array} "},{value:"\\begin{array}{l} \r\n a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r\n \\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r\n \\left\\{\\begin{matrix} \r\n \\Delta \\gt 0\\text{方程有两个不相等的实根} \\ \r\n \\Delta = 0\\text{方程有两个相等的实根} \\ \r\n \\Delta \\lt 0\\text{方程无实根} \r\n\\end{matrix}\\right. \r\n\\end{array} "},{value:"\\begin{array}{l} \r\n a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r\n \\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r\n \\mathop{{x}}\\nolimits_{{1,2}}=\\frac{{-b \\pm \r\n \\sqrt{{\\mathop{{b}}\\nolimits^{{2}}-4ac}}}}{{2a}} \\ \r\n \\mathop{{x}}\\nolimits_{{1}}+\\mathop{{x}}\\nolimits_{{2}}=-\\frac{{b}}{{a}} \\ \r\n \\mathop{{x}}\\nolimits_{{1}}\\mathop{{x}}\\nolimits_{{2}}=\\frac{{c}}{{a}} \r\n\\end{array} "}]}]},{name:"几何",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\n a \\perp \\alpha \\ \r\n b \\perp \\alpha \r\n\\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\n \\Rightarrow a \\perp \\beta "},{value:"\\left.\\begin{matrix} \r\n a \\subset \\beta ,b \\subset \\beta ,a \\cap b=P \\ \r\n a \\parallel \\partial ,b \\parallel \\partial \r\n\\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\n m \\subset \\alpha ,n \\subset \\alpha ,m \\cap n=P \\ \r\n a \\perp m,a \\perp n \r\n\\end{matrix}\\right\\}\\Rightarrow a \\perp \\alpha "},{value:"\\begin{array}{c} \r\n \\text{直角三角形中,直角边长a,b,斜边边长c} \\ \r\n a^{2}+b^{2}=c^{2} \r\n\\end{array}"}]}]},{name:"不等式",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\n a \\gt b,c \\gt 0 \\Rightarrow ac \\gt bc \\ \r\n a \\gt b,c \\lt 0 \\Rightarrow ac \\lt bc \r\n\\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\n a \\gt b \\gt 0,n \\in N^{\\ast},n \\gt 1 \\ \r\n \\Rightarrow a^{n}\\gt b^{n}, \\sqrt[n]{a}\\gt \\sqrt[n]{b} \r\n\\end{array}"},{value:"\\left( \\sum_{k=1}^n a_k b_k \\right)^{\\!\\!2}\\leq \r\n\\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right) "},{value:"\\begin{array}{c} \r\n a,b \\in R^{+} \\ \r\n \\Rightarrow \\frac{a+b}{{2}}\\ge \\sqrt{ab} \\ \r\n \\left( \\text{当且仅当}a=b\\text{时取“}=\\text{”号}\\right) \r\n\\end{array}"},{value:"\\begin{array}{c} \r\n a,b \\in R \\ \r\n \\Rightarrow a^{2}+b^{2}\\gt 2ab \\ \r\n \\left( \\text{当且仅当}a=b\\text{时取“}=\\text{”号}\\right) \r\n\\end{array}"},{value:"\\begin{array}{c} \r\n 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\n\\end{array}"}]}]},{name:"积分",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:"三角",value:"e^{i \\theta}",children:[{name:"求和 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:"统计",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\n \\text{若}P \\left( AB \\right) =P \\left( A \\right) P \\left( B \\right) \\\\ \r\n \\text{则}P \\left( A \\left| B\\right. \\right) =P \\left({B}\\right) \r\n\\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\n P \\left( \\emptyset \\right) =0 \\\\ \r\n P \\left( S \\right) =1 \r\n\\end{array}"},{value:"\\begin{array}{c} \r\n \\forall A \\in S \\\\ \r\n P \\left( A \\right) \\ge 0 \r\n\\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\n S= \\binom{N}{n},A_{k}=\\binom{M}{k}\\cdot \\binom{N-M}{n-k} \\\\ \r\n P\\left ( A_{k}\\right ) = \\frac{\\binom{M}{k}\\cdot \\binom{N-M}{n-k}}{\\binom{N}{n}} \r\n\\end{array}"},{value:"\\begin{array}{c} \r\n P_{n}=n! \\\\ \r\n A_{n}^{k}=\\frac{n!}{\\left( n-k \\left) !\\right. \\right.} \r\n\\end{array}"}]}]}].map((function(e,t){return(0,u.jsxs)(o.Z,{flex:"110px",className:c.Z.item,children:[(0,u.jsxs)("div",{children:[(0,u.jsx)(l.Z,{value:"`$$"+e.value+"$$`"}),e.name]}),(0,u.jsx)("div",{className:c.Z.children,children:e.children.map((function(e,t){return(0,u.jsxs)("div",{children:[e.name&&(0,u.jsx)("h1",{children:e.name}),(0,u.jsx)(r.Z,{gutter:[10,10],children:e.data.map((function(e,t){return(0,u.jsx)(o.Z,{onClick:function(){return m(e)},className:c.Z.diamond,children:(0,u.jsx)(l.Z,{value:"`$$"+e.value+"$$`"})},t)}))})]},t)}))})]})}))})}],v=function(){var e=document.createElement("div");e.innerHTML=f.current.getValue();var t=e.innerText;return n&&n(t),t};return(0,i.useImperativeHandle)(t,(function(){return{getData:v}})),(0,u.jsxs)("div",{className:c.Z.mathWrap,children:[(0,u.jsx)(a.Z,{defaultActiveKey:"1",items:g}),(0,u.jsx)("math-field",{locale:"zh_cn",className:c.Z.mathField,placeholder:"请打开键盘,输入公式",ref:f,style:{width:800,marginTop:30,fontSize:18},children:p||""}),d&&(0,u.jsx)("div",{className:c.Z.button,children:(0,u.jsx)(s.ZP,{size:"large",onClick:v,style:{zIndex:8,marginTop:10},type:"primary",children:"保存到编辑器"})})]})}));t.Z=d},13767:function(e,t,n){"use strict";var i=n(82242),r=n.n(i),o=(n(59301),n(93314)),a=n(99571),s=n(37712);t.Z=function(e){var t=e.img,n=e.buttonProps,i=void 0===n?{}:n,l=e.styles,c=void 0===l?{}:l,u=e.customText,d=e.ButtonText,h=e.ButtonClick,p=e.Buttonclass,f=e.ButtonTwo,m=e.imgStyles,g=e.loading,v=void 0!==g&&g,y=e.className,x=void 0===y?"":y;return(0,s.jsxs)("section",{className:"tc animated fadeIn ".concat(x),style:r()({color:"#999",margin:"100px auto",visibility:v?"hidden":"visible"},c),children:[(0,s.jsx)("img",{src:t||o,style:r()(r()({},m),{},{pointerEvents:"none",userSelect:"none"})}),(0,s.jsx)("p",{className:"mt20 font14",children:u||"暂时还没有相关数据哦!"}),d&&(0,s.jsx)(a.ZP,r()(r()({className:p,onClick:h},i),{},{children:d})),f&&f]})}},32831:function(e,t,n){"use strict";n.d(t,{Z:function(){return k}});var i=n(82242),r=n.n(i),o=n(7557),a=n.n(o),s=n(41498),l=n.n(s),c=n(79800),u=n.n(c),d=n(59301),h={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},p=n(99571),f=n(70557),m=n(92068),g=n(25399),v=n(83287),y=n(94280),x=n(13767),b=n(91689),w=n(8814),C=n(37712),k=function(e){var t,n,i,o,s,c,k=e.editOffice,S=void 0===k?"view":k,E=e.data,M=e.issaver,T=e.onSaver,L=(e.theme,e.type),_=e.filename,N=e.monacoEditor,A=e.className,P=e.style,D=e.close,B=e.onClose,j=e.hasMask,I=e.disabledDownload,R=e.onImgDimensions,O=e.showNodata,Z=e.recordInfo,F=(0,d.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),z=u()(F,2),H=(z[0],z[1],(0,d.useState)("")),W=u()(H,2),G=(W[0],W[1]),V=(0,d.useState)(),q=u()(V,2),U=q[0],K=q[1],Y="build"===window.ENV?"/react/build":"",X=location.host.startsWith("localhost")?b.Z.PROXY_SERVER:b.Z.API_SERVER,J=(0,d.useRef)();null!==(t=E)&&void 0!==t&&t.startsWith("/api")&&"txt"!==L&&(E=b.Z.API_SERVER+E);function Q(e){return $.apply(this,arguments)}function $(){return($=l()(a()().mark((function e(t){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"pdfdata"===t.data.type&&(T(t.data.data),window.removeEventListener("message",Q,!1)),console.log("mess---:",t.data);case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}_&&N&&(N.filename=_),(0,d.useEffect)((function(){var e,t=null===(e=document.cookie)||void 0===e||null===(e=e.replace(/\s/g,""))||void 0===e?void 0:e.split(";");null==t||t.map((function(e){var t=e.split("=");"_educoder_session"===t[0]&&G(t[1])}))}),[]),(0,d.useEffect)((function(){var e;"office"===L&&(E.indexOf("bigfilescdn.")>-1||E.indexOf("bigfiles1")>-1?K({url:E,fileType:(e=E,e.substring(e.lastIndexOf("/")+1).split(".").pop()),model:E.indexOf("model=edit")?"edit":"view"}):ee())}),[L,E]);var ee=function(){var e=l()(a()().mark((function e(){var t,n,i;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("data:",E),t=E,E.startsWith("http")||(t=location.origin+t),n=new URL(t).pathname.split("/").pop(),e.next=6,(0,y.gJ)({attachment_id:n});case 6:(i=e.sent).url=X+i.url,K(i);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),te=function(){E.startsWith("http")||E.startsWith("blob:")?ne():(0,v.Sv)(_||"educoder",E,_)},ne=function(){Z&&(0,w.fc)({id:null==Z?void 0:Z.id,watch_type:1,course_id:null==Z?void 0:Z.course_id}),(0,v.Nd)(_||"educoder",decodeURIComponent(E))};return(0,C.jsxs)("div",{style:r()({},P||{}),className:"".concat(j&&h.bgBlack," ").concat(L?h.wrp:"hide"),children:[D&&(0,C.jsxs)("div",{className:h.close,ref:J,children:[!!R&&(0,C.jsx)(g.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return J.current},children:(0,C.jsx)("span",{onClick:function(){B(),R()},children:(0,C.jsx)("i",{className:"icon-yulanpizhu"})})}),!I&&(0,C.jsx)(g.Z,{title:"点击下载此文件",getPopupContainer:function(){return J.current},children:(0,C.jsx)("span",{onClick:ne,children:(0,C.jsx)("i",{className:"icon-quxiaozhiding"})})}),M&&(0,C.jsx)(g.Z,{title:"保存pdf并退出",getPopupContainer:function(){return J.current},children:(0,C.jsx)("span",{className:"",onClick:function(){var e=document.getElementById("pdfiframe");window.addEventListener("message",Q,!1),setTimeout((function(){e.contentWindow.postMessage("getData","*")}),300)},children:(0,C.jsx)("i",{className:"icon-baocun"})})}),(0,C.jsx)(g.Z,{title:"关闭",getPopupContainer:function(){return J.current},children:(0,C.jsx)("span",{className:"",onClick:function(){B()},children:(0,C.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,C.jsx)("div",{className:"".concat(h[A]," ").concat(A," ").concat(h.monaco," ").concat("txt"===L?"show":"hide"),children:"txt"===L&&(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(m.ZP,r()({},N))})}),"audio"===L&&(0,C.jsx)("audio",{src:"".concat((null===(n=E)||void 0===n?void 0:n.indexOf("http://"))>-1||(null===(i=E)||void 0===i?void 0:i.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(E),autoPlay:!0}),"video"===L&&(0,C.jsx)(C.Fragment,{children:(null===(o=E)||void 0===o?void 0:o.indexOf("http"))>-1?(0,C.jsx)("video",{controls:!0,src:"".concat(E),autoPlay:!0}):(0,C.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(E),autoPlay:!0})}),"office"===L&&U&&(0,C.jsx)("iframe",{src:"".concat(Y,"/office.html?key=").concat(U.key,"&url=").concat(btoa(U.url),"&callbackUrl=").concat(X+(U.callbackUrl||""),"&fileType=").concat(U.fileType,"&title=").concat(U.title||"","&model=").concat(S,"&officeServer=").concat(b.Z.ONLYOFFICE,"&disabledDownload=").concat(!!I)}),"html"===L&&(0,C.jsx)("iframe",{src:E+"&disposition=inline"}),"pdf"===L&&(0,C.jsx)("iframe",{id:"pdfiframe",src:"".concat(Y,"/js/pdfview/index.html?filename=").concat(_||"educoder.pdf","&url=").concat(encodeURIComponent(E),"&disabledDownload=").concat(!!I,"&model=").concat(S)}),"image"===L&&(0,C.jsx)("img",{src:"".concat((null===(s=E)||void 0===s?void 0:s.indexOf("http://"))>-1||(null===(c=E)||void 0===c?void 0:c.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(E)}),("other"===L||"download"===L)&&(0,C.jsx)(C.Fragment,{children:O?(0,C.jsx)(x.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,C.jsx)(p.ZP,{icon:(0,C.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:te,disabled:I,children:"下载"})}):(0,C.jsxs)(p.ZP,{type:"primary",size:"middle",onClick:te,disabled:I,children:[(0,C.jsx)(f.Z,{}),"点击下载"]})}),"flowChart"===L&&(0,C.jsx)("div",{className:"embed",children:(0,C.jsx)("iframe",{src:"/drawio/src/main/webapp/viewer.html?id=".concat(E||"","&gapi=0&od=0&db=0&gh=0&gl=0"),width:"100%",height:"100%",frameBorder:"0"})})]})}},74889:function(e,t,n){"use strict";n.d(t,{z:function(){return L},Z:function(){return _}});var i=n(82242),r=n.n(i),o=n(37205),a=n.n(o),s=n(91232),l=n.n(s),c=n(79800),u=n.n(c),d=n(59301),h=(n(88831),n(75359)),p=(n(64018),n(44523)),f=n(91689),m=n(83287),g=n(15342),v=n(77736),y=n(99571),x=n(1012),b=n(32831),w=n(37712),C=function(e){var t=e.html,n=(0,d.useRef)(null),i=(0,d.useRef)(null);return(0,d.useEffect)((function(){var e=n.current.attachShadow({mode:"open"});i.current=document.createElement("div"),i.current.className="markdown-body",i.current.innerHTML=t,e.appendChild(i.current);var r=document.createElement("style");return r.textContent='.markdown-body p {\n margin: 0 0 16px 0 !important;\n line-height: 28px;\n white-space: pre-wrap;\n }\n\n ol,\n ul,\n li {\n list-style-type: none\n }\n\n ol,\n ul,\n dl {\n margin-bottom: 0px;\n }\n\n .markdown-body {\n -ms-text-size-adjust: 100%;\n -webkit-text-size-adjust: 100%;\n color: #333;\n overflow: hidden;\n font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "华文细黑", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "宋体", Heiti, "黑体", sans-serif;\n word-break: break-word;\n font-size: 16px;\n line-height: 1.6;\n white-space: normal;\n word-wrap: break-word;\n position: relative;\n }\n\n .markdown-body ul>li {\n list-style-type: disc;\n }\n\n .markdown-body ol>li {\n list-style-type: decimal;\n }\n\n .markdown-body a {\n background: transparent;\n }\n\n .markdown-body a:active,\n .markdown-body a:hover {\n outline: 0;\n }\n\n .markdown-body strong {\n font-weight: bold;\n }\n\n .markdown-body h1 {\n font-size: 2em;\n margin: 0.67em 0;\n }\n\n .markdown-body img {\n border: 0;\n }\n\n .markdown-body hr {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n height: 0;\n }\n\n .markdown-body pre {\n overflow: auto;\n }\n\n .markdown-body code,\n .markdown-body kbd,\n .markdown-body pre {\n font-family: "Meiryo UI", "YaHei Consolas Hybrid", Consolas, "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace;\n font-size: 1em;\n }\n\n .markdown-body input {\n color: inherit;\n font: inherit;\n margin: 0;\n }\n\n .markdown-body html input[disabled] {\n cursor: default;\n }\n\n .markdown-body input {\n line-height: normal;\n }\n\n .markdown-body input[type="checkbox"] {\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n padding: 0;\n }\n\n .markdown-body table {\n border-collapse: collapse;\n border-spacing: 0;\n }\n\n .markdown-body td,\n .markdown-body th {\n padding: 0;\n }\n\n .markdown-body * {\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n .markdown-body input {\n font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";\n }\n\n .markdown-body a {\n color: #4183c4;\n text-decoration: none;\n }\n\n .markdown-body a:hover,\n .markdown-body a:active {\n text-decoration: underline;\n }\n\n .markdown-body hr {\n height: 0;\n margin: 15px 0;\n overflow: hidden;\n background: transparent;\n border: 0;\n border-bottom: 1px solid #ddd;\n }\n\n .markdown-body hr:before {\n display: table;\n content: "";\n }\n\n .markdown-body hr:after {\n display: table;\n clear: both;\n content: "";\n }\n\n .markdown-body h1,\n .markdown-body h2,\n .markdown-body h3,\n .markdown-body h4,\n .markdown-body h5,\n .markdown-body h6 {\n margin-top: 15px;\n margin-bottom: 15px;\n line-height: 1.1;\n }\n\n .markdown-body h1 {\n font-size: 30px;\n }\n\n .markdown-body h2 {\n font-size: 21px;\n }\n\n .markdown-body h3 {\n font-size: 16px;\n }\n\n .markdown-body h4 {\n font-size: 14px;\n }\n\n .markdown-body h5 {\n font-size: 12px;\n }\n\n .markdown-body h6 {\n font-size: 11px;\n }\n\n .markdown-body blockquote {\n margin: 0;\n }\n\n .markdown-body ul,\n .markdown-body ol {\n padding: 0;\n margin-top: 0;\n margin-bottom: 0;\n }\n\n ul.linenums,\n ol.linenums {\n padding: 16px 0 0 56px !important;\n }\n\n .markdown-body ul,\n .markdown-body ol {\n padding-left: 2em;\n }\n\n\n .markdown-body ol ol,\n .markdown-body ul ol {\n list-style-type: lower-roman;\n }\n\n .markdown-body ul ul ol,\n .markdown-body ul ol ol,\n .markdown-body ol ul ol,\n .markdown-body ol ol ol {\n list-style-type: lower-alpha;\n }\n\n .markdown-body dd {\n margin-left: 0;\n }\n\n .markdown-body code {\n font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;\n font-size: 12px;\n }\n\n .markdown-body pre {\n margin-top: 0;\n margin-bottom: 0;\n font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;\n }\n\n .markdown-body .octicon {\n font: normal normal 16px octicons-anchor;\n line-height: 1;\n display: inline-block;\n text-decoration: none;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n\n .markdown-body .octicon-link:before {\n content: \'\f05c\';\n }\n\n .markdown-body>*:first-child {\n margin-top: 0 !important;\n }\n\n .markdown-body>*:last-child {\n margin-bottom: 0 !important;\n }\n\n .markdown-body .anchor {\n position: absolute;\n top: 0;\n left: 0;\n display: block;\n padding-right: 6px;\n padding-left: 30px;\n margin-left: -30px;\n }\n\n .markdown-body .anchor:focus {\n outline: none;\n }\n\n .markdown-body h1,\n .markdown-body h2,\n .markdown-body h3,\n .markdown-body h4,\n .markdown-body h5,\n .markdown-body h6 {\n position: relative;\n margin-top: 1em;\n margin-bottom: 16px;\n font-weight: bold;\n line-height: 1.4;\n }\n\n .markdown-body h1 .octicon-link,\n .markdown-body h2 .octicon-link,\n .markdown-body h3 .octicon-link,\n .markdown-body h4 .octicon-link,\n .markdown-body h5 .octicon-link,\n .markdown-body h6 .octicon-link {\n display: none;\n color: #000;\n vertical-align: middle;\n }\n\n .markdown-body h1:hover .anchor,\n .markdown-body h2:hover .anchor,\n .markdown-body h3:hover .anchor,\n .markdown-body h4:hover .anchor,\n .markdown-body h5:hover .anchor,\n .markdown-body h6:hover .anchor {\n padding-left: 8px;\n margin-left: -30px;\n text-decoration: none;\n }\n\n .markdown-body h1:hover .anchor .octicon-link,\n .markdown-body h2:hover .anchor .octicon-link,\n .markdown-body h3:hover .anchor .octicon-link,\n .markdown-body h4:hover .anchor .octicon-link,\n .markdown-body h5:hover .anchor .octicon-link,\n .markdown-body h6:hover .anchor .octicon-link {\n display: inline-block;\n }\n\n .markdown-body h1 {\n padding-bottom: 0.3em;\n font-size: 2.25em;\n line-height: 1.2;\n border-bottom: 1px solid #eee;\n }\n\n .markdown-body h1 .anchor {\n line-height: 1;\n }\n\n .markdown-body h2 {\n padding-bottom: 0.3em;\n font-size: 1.75em;\n line-height: 1.225;\n border-bottom: 1px solid #eee;\n }\n\n .markdown-body h2 .anchor {\n line-height: 1;\n }\n\n .markdown-body h3 {\n font-size: 1.5em;\n line-height: 1.43;\n }\n\n .markdown-body h3 .anchor {\n line-height: 1.2;\n }\n\n .markdown-body h4 {\n font-size: 1.25em;\n }\n\n .markdown-body h4 .anchor {\n line-height: 1.2;\n }\n\n .markdown-body h5 {\n font-size: 1em;\n }\n\n .markdown-body h5 .anchor {\n line-height: 1.1;\n }\n\n .markdown-body h6 {\n font-size: 1em;\n color: #777;\n }\n\n .markdown-body h6 .anchor {\n line-height: 1.1;\n }\n\n .markdown-body p,\n .markdown-body blockquote,\n .markdown-body ul,\n .markdown-body ol,\n .markdown-body dl,\n .markdown-body table,\n .markdown-body pre {\n margin-top: 0;\n margin-bottom: 16px;\n }\n\n .markdown-body ul ul,\n .markdown-body ul ol,\n .markdown-body ol ol,\n .markdown-body ol ul {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n .markdown-body li>p {\n margin-top: 16px;\n }\n\n .markdown-body dl {\n padding: 0;\n }\n\n .markdown-body dl dt {\n padding: 0;\n margin-top: 16px;\n font-size: 1em;\n font-style: italic;\n font-weight: bold;\n }\n\n .markdown-body dl dd {\n padding: 0 16px;\n margin-bottom: 16px;\n }\n\n .markdown-body blockquote {\n padding: 0 15px;\n color: #777;\n border-left: 4px solid #ddd;\n }\n\n .markdown-body blockquote> :first-child {\n margin-top: 0;\n }\n\n .markdown-body blockquote> :last-child {\n margin-bottom: 0;\n }\n\n .markdown-body table {\n display: block;\n width: 100%;\n overflow: auto;\n word-break: normal;\n word-break: keep-all;\n }\n\n .markdown-body table th {\n font-weight: bold;\n text-align: revert;\n }\n\n .markdown-body table th,\n .markdown-body table td {\n padding: 6px 13px;\n border: 1px solid #ddd;\n }\n\n .markdown-body table tr {\n background-color: #fff;\n border-top: 1px solid #ccc;\n }\n\n .markdown-body table tr:nth-child(2n) {\n background-color: #f8f8f8;\n }\n\n .markdown-body img {\n max-width: 100%;\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n .markdown-body code {\n padding: 0;\n padding-top: 0.2em;\n padding-bottom: 0.2em;\n margin: 0;\n font-size: 85%;\n background-color: rgba(0, 0, 0, 0.04);\n border-radius: 3px;\n }\n\n .markdown-body code:has(.katex) {\n background-color: transparent;\n }\n\n .markdown-body code:before,\n .markdown-body code:after {\n letter-spacing: -0.2em;\n content: "\\00a0";\n }\n\n .markdown-body pre>code {\n padding: 0;\n margin: 0;\n font-size: 100%;\n word-break: normal;\n white-space: pre;\n background: transparent;\n border: 0;\n }\n\n .markdown-body .highlight {\n margin-bottom: 16px;\n }\n\n .markdown-body .highlight pre,\n .markdown-body pre {\n padding: 16px;\n overflow: auto;\n font-size: 85%;\n line-height: 1.45;\n background-color: #f7f7f7;\n border-radius: 3px;\n }\n\n .markdown-body .highlight pre {\n margin-bottom: 0;\n word-break: normal;\n }\n\n .markdown-body pre {\n word-wrap: normal;\n }\n\n .markdown-body pre code {\n display: inline;\n max-width: initial;\n padding: 0;\n margin: 0;\n overflow: initial;\n line-height: inherit;\n word-wrap: normal;\n background-color: transparent;\n border: 0;\n }\n\n .markdown-body pre code:before,\n .markdown-body pre code:after {\n content: normal;\n }\n\n .markdown-body kbd {\n display: inline-block;\n padding: 3px 5px;\n font-size: 11px;\n line-height: 10px;\n color: #555;\n vertical-align: middle;\n background-color: #fcfcfc;\n border: solid 1px #ccc;\n border-bottom-color: #bbb;\n border-radius: 3px;\n box-shadow: inset 0 -1px 0 #bbb;\n }\n\n .markdown-body .pl-c {\n color: #969896;\n }\n\n .markdown-body .pl-c1,\n .markdown-body .pl-mdh,\n .markdown-body .pl-mm,\n .markdown-body .pl-mp,\n .markdown-body .pl-mr,\n .markdown-body .pl-s1 .pl-v,\n .markdown-body .pl-s3,\n .markdown-body .pl-sc,\n .markdown-body .pl-sv {\n color: #0086b3;\n }\n\n .markdown-body .pl-e,\n .markdown-body .pl-en {\n color: #795da3;\n }\n\n .markdown-body .pl-s1 .pl-s2,\n .markdown-body .pl-smi,\n .markdown-body .pl-smp,\n .markdown-body .pl-stj,\n .markdown-body .pl-vo,\n .markdown-body .pl-vpf {\n color: #333;\n }\n\n .markdown-body .pl-ent {\n color: #63a35c;\n }\n\n .markdown-body .pl-k,\n .markdown-body .pl-s,\n .markdown-body .pl-st {\n color: #a71d5d;\n }\n\n .markdown-body .pl-pds,\n .markdown-body .pl-s1,\n .markdown-body .pl-s1 .pl-pse .pl-s2,\n .markdown-body .pl-sr,\n .markdown-body .pl-sr .pl-cce,\n .markdown-body .pl-sr .pl-sra,\n .markdown-body .pl-sr .pl-sre,\n .markdown-body .pl-src {\n color: #df5000;\n }\n\n .markdown-body .pl-mo,\n .markdown-body .pl-v {\n color: #1d3e81;\n }\n\n .markdown-body .pl-id {\n color: #b52a1d;\n }\n\n .markdown-body .pl-ii {\n background-color: #b52a1d;\n color: #f8f8f8;\n }\n\n .markdown-body .pl-sr .pl-cce {\n color: #63a35c;\n font-weight: bold;\n }\n\n .markdown-body .pl-ml {\n color: #693a17;\n }\n\n .markdown-body .pl-mh,\n .markdown-body .pl-mh .pl-en,\n .markdown-body .pl-ms {\n color: #1d3e81;\n font-weight: bold;\n }\n\n .markdown-body .pl-mq {\n color: #008080;\n }\n\n .markdown-body .pl-mi {\n color: #333;\n font-style: italic;\n }\n\n .markdown-body .pl-mb {\n color: #333;\n font-weight: bold;\n }\n\n .markdown-body .pl-md,\n .markdown-body .pl-mdhf {\n background-color: #ffecec;\n color: #bd2c00;\n }\n\n .markdown-body .pl-mdht,\n .markdown-body .pl-mi1 {\n background-color: #eaffea;\n color: #55a532;\n }\n\n .markdown-body .pl-mdr {\n color: #795da3;\n font-weight: bold;\n }\n\n .markdown-body kbd {\n display: inline-block;\n padding: 3px 5px;\n font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;\n line-height: 10px;\n color: #555;\n vertical-align: middle;\n background-color: #fcfcfc;\n border: solid 1px #ccc;\n border-bottom-color: #bbb;\n border-radius: 3px;\n box-shadow: inset 0 -1px 0 #bbb;\n }\n\n .markdown-body .task-list-item {\n list-style-type: none;\n }\n\n .markdown-body .task-list-item+.task-list-item {\n margin-top: 3px;\n }\n\n .markdown-body .task-list-item input {\n float: left;\n margin: 0.3em 0 0.25em -1.6em;\n vertical-align: middle;\n }\n\n .markdown-body :checked+.radio-label {\n z-index: 1;\n position: relative;\n border-color: #4183c4;\n }\n\n\n /*! Pretty printing styles. Used with prettify.js. */\n /* SPAN elements with the classes below are added by prettyprint. */\n .pln {\n color: #000\n }\n\n /* plain text */\n\n @media screen {\n .str {\n color: #080\n }\n\n /* string content */\n .kwd {\n color: #008\n }\n\n /* a keyword */\n .com {\n color: #800\n }\n\n /* a comment */\n .typ {\n color: #606\n }\n\n /* a type name */\n .lit {\n color: #066\n }\n\n /* a literal value */\n /* punctuation, lisp open bracket, lisp close bracket */\n .pun,\n .opn,\n .clo {\n color: #660\n }\n\n .tag {\n color: #008\n }\n\n /* a markup tag name */\n .atn {\n color: #606\n }\n\n /* a markup attribute name */\n .atv {\n color: #080\n }\n\n /* a markup attribute value */\n .dec,\n .var {\n color: #606\n }\n\n /* a declaration; a variable name */\n .fun {\n color: red\n }\n\n /* a function name */\n }\n\n /* Use higher contrast and text-weight for printable form. */\n @media print,\n projection {\n .str {\n color: #060\n }\n\n .kwd {\n color: #006;\n font-weight: bold\n }\n\n .com {\n color: #600;\n font-style: italic\n }\n\n .typ {\n color: #404;\n font-weight: bold\n }\n\n .lit {\n color: #044\n }\n\n .pun,\n .opn,\n .clo {\n color: #440\n }\n\n .tag {\n color: #006;\n font-weight: bold\n }\n\n .atn {\n color: #404\n }\n\n .atv {\n color: #060\n }\n }\n\n /* Put a border around prettyprinted code snippets. */\n pre.prettyprint {\n padding: 2px;\n /* border: 1px solid #888 */\n }\n\n /* Specify class=linenums on a pre to get line numbering */\n ol.linenums {\n margin-top: 0;\n margin-bottom: 0\n }\n\n /* IE indents via margin-left */\n li.L0,\n li.L1,\n li.L2,\n li.L3,\n li.L5,\n li.L6,\n li.L7,\n li.L8 {\n list-style-type: none\n }\n\n /* Alternate shading for lines */\n li.L1,\n li.L3,\n li.L5,\n li.L7,\n li.L9 {\n background: #eee\n }\n\n .markdown-body p,\n .markdown-body blockquote,\n .markdown-body ul,\n .markdown-body ol,\n .markdown-body dl,\n .markdown-body table,\n .markdown-body pre {\n margin-top: 0;\n margin-bottom: 16px;\n }',e.appendChild(r),function(){e.innerHTML=""}}),[]),(0,d.useEffect)((function(){i.current&&(i.current.innerHTML=t)}),[t]),(0,w.jsx)("div",{ref:n})};var k="mdBody___raKXb",S="button___Ch5Pc",E="previewFlowChart___vY1dq",M="@▁@",T=/<pre[^>]*>/g;var L=function(e,t){e=e||"";var n=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return t?e.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(n,(function(e,t,n,i,r,o,a){var s=t||i||o,l=n||r||a||"?";return f.Z.API_SERVER+"/api/attachments/"+s+l+"&t="+(0,m.Jn)(s,Date.now())+(e.indexOf(")")>-1?")":"&")})).replaceAll('src="(','src="').replaceAll("src='(",'src="'):e=e.replace(/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,(function(e,t,n,i,r,o,a){var s=t||i||o,l=n||r||a||"?";return f.Z.API_SERVER+"/attachments/download/"+s+l+"&t="+(0,m.Jn)(s,Date.now())+(e.indexOf(")")>-1?")":"&")})).replace(n,(function(e,t,n,i,r,o,a){var s=t||i||o,l=n||r||a||"?";return f.Z.API_SERVER+"/api/attachments/"+s+l+"&t="+(0,m.Jn)(s,Date.now())+(e.indexOf(")")>-1?")":"&")})).replace(/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,(function(e,t,n,i,r){var o=t||i,a=n||r||"";return'"'+f.Z.API_SERVER+"/api/attachments/"+o+a+o+a+"&t="+(0,m.Jn)(o,Date.now())})).replace(/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,(function(e,t,n,i,r){var o=t||i,a=n||r||"";return"("+f.Z.API_SERVER+"/files/uploads/"+o+a+o+a+"&t="+(0,m.Jn)(o,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,"\n")},_=function(e){var t=e.value,n=void 0===t?"":t,i=e.edit,o=void 0!==i&&i,s=e.className,c=e.showTextOnly,m=e.showLines,L=e.style,_=void 0===L?{}:L,N=e.stylesPrev,A=void 0===N?{}:N,P=e.highlightKeywords,D=e.showProgramFill,B=(e.isProgramFill,e.disabledFill),j=void 0!==B&&B,I=e.programFillValue,R=e.openEditor,O=void 0===R?function(){}:R,Z=e.onFillChange,F=void 0===Z?function(e){}:Z,z=e.onFillBlur,H=void 0===z?function(){}:z,W=e.onFillFocus,G=void 0===W?function(){}:W,V=function(e){var t=new RegExp("\\b(".concat(["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"].join("|"),")\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s>]*)"),"gi");return e.replace(t,"").trim()}(String(n||"")),q=(0,d.useRef)(),U=(0,d.useRef)(),K=(0,d.useState)(""),Y=u()(K,2),X=Y[0],J=Y[1],Q=(0,d.useState)("office"),$=u()(Q,2),ee=$[0],te=$[1],ne=(0,d.useState)([]),ie=u()(ne,2),re=ie[0],oe=ie[1],ae=(0,d.useRef)("a"+(0,x.Z)()),se={},le=function(e){return/<style[\s\S]*?>/i.test(e||"")};var ce=function(e){return!c&&le(V)?e:e.replace(/<style.*?>([\s\S]+?)<\/style>/gim,(function(e,t){var n=t.replace(/(\n|\r)/g,"").split("}"),i=[];return n.map((function(e){""!=e&&i.push(".".concat(ae.current," ").concat(e))})),"<style>".concat(i.join("}"),"</style>")}))},ue=(0,d.useMemo)((function(){try{V=V.replace(/\(\/attachments\/download\//g,"("+f.Z.API_SERVER+"/attachments/download/").replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,"("+f.Z.API_SERVER+"/api/attachments/").replace(/\"\/api\/attachments\/|\"\/attachments\/download\//g,'"'+f.Z.API_SERVER+"/api/attachments/").replace(/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,'"'+f.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,"\n"),q.current.style.display="none"}catch(e){}if(D){var e=-1;return V=V.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,(function(t,n,i){var r;return function(e,t,n){var i=document.createElement(e===M?"input":"textarea");i.style.width="100%",i.style.height=e===M?"40px":"151px",i.rows=5,i.spellcheck=!1,i.name="edu-program-fill",i.placeholder="请输入",i.dataset.id=t;var r=Object.keys(se).length;return se[r]=i,'<span class="edu-program-fill-wrap '.concat(e===M?"":"show",'" style="width:').concat(e===M?"600px":"100%",'" title=').concat(n||"","><span>").concat(i.outerHTML,'<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>')}(t,++e,null==I||null===(r=I[e])||void 0===r?void 0:r.value.replaceAll("<","<").replaceAll(">",">"))})),'<pre style="background:#fff;padding:4px">'.concat(ce(V||""),"</pre>")}var t=ce(V);t=(0,h.ZP)(t);var n=(0,h.ez)();V.match(/\[TOC\]/)&&(t=t.replace("<p>[TOC]</p>",(0,h.Qv)()),(0,h.Iy)()),t=t.replace(/(__special_katext_id_\d+__)/g,(function(e,t){var i=n[t],r=i.type,o=i.expression;return(0,g.renderToString)(function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue}(o)||"",{displayMode:"block"===r,throwOnError:!1,output:"html"})})),t=t.replace(/▁/g,"▁▁▁▁▁"),(0,h.AL)();var i=document.createElement("div");return i.innerHTML=t,c?i.innerText:P?(fe(i,P.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),i.innerHTML):(setTimeout((function(){return ve()}),500),i.innerHTML)}),[V,P]);(0,d.useEffect)((function(){me.current&&me.current.querySelectorAll(["input","textarea"]).forEach((function(e){e.oninput=de,e.onblur=he,e.onfocus=pe}))}),[re]),(0,d.useEffect)((function(){if(null!=I&&I.length)try{var e,t=me.current.querySelectorAll(".edu-program-fill-score"),n=me.current.querySelectorAll('[name="edu-program-fill"]'),i=l()(n.entries());try{for(i.s();!(e=i.n()).done;){var r,o,a,s=u()(e.value,2),c=s[0],d=s[1];d.value=(null==I||null===(r=I[c])||void 0===r?void 0:r.value)||"","warning"===(null==I||null===(o=I[c])||void 0===o?void 0:o.type)?d.className="program-fill-warning":"success"===(null==I||null===(a=I[c])||void 0===a?void 0:a.type)?d.className="program-fill-success":d.className=""}}catch(e){i.e(e)}finally{i.f()}var h,p=l()(t.entries());try{for(p.s();!(h=p.n()).done;){var f,m,g=u()(h.value,2),v=g[0];g[1].innerHTML=null!=I&&null!==(f=I[v])&&void 0!==f&&f.score?"".concat(null==I||null===(m=I[v])||void 0===m?void 0:m.score,"分"):""}}catch(e){p.e(e)}finally{p.f()}oe(I)}catch(e){console.log(e,"error")}}),[I]);var de=function(e){re[e.target.dataset.id]=re[e.target.dataset.id]||{},re[e.target.dataset.id].value=e.target.value,oe(a()(re)),F(re,e.target.dataset.id)},he=function(e){re[e.target.dataset.id]=re[e.target.dataset.id]||{},re[e.target.dataset.id].value=e.target.value,oe(a()(re)),H(re,e.target.dataset.id)},pe=function(e){re[e.target.dataset.id]=re[e.target.dataset.id]||{},re[e.target.dataset.id].value=e.target.value,oe(a()(re)),G(re,e.target.dataset.id)};function fe(e,t){return e.childNodes.forEach((function(e){if(e.childNodes.length>0)fe(e,t);else if("IMG"!==e.nodeName)if(e.innerHTML){var n;e.innerHTML=null===(n=e.innerHTML)||void 0===n?void 0:n.replace(new RegExp(t,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>')}else{var i=document.createElement("span");i.innerHTML=e.textContent.replace(new RegExp(t,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),e.replaceWith(i)}}))}var me=(0,d.useRef)();function ge(e){var t=e.target;if("A"===t.tagName.toUpperCase()){var n=t.getAttribute("href");if(n.indexOf("office")>-1)e.preventDefault(),J(n),te("office");else if(n.indexOf("application/pdf")>-1)e.preventDefault(),J(n),te("pdf");else if(n.indexOf("text/html")>-1)e.preventDefault(),J(n),te("html");else if(n.startsWith("#")){e.preventDefault();var i=document.getElementById(n.replace("#",""));i&&i.scrollIntoView(!0)}}}h.jb.WebkitLineClamp=m,m&&(_=r()(r()({},_),h.jb));var ve=function(){var e,t=null===(e=me.current)||void 0===e?void 0:e.querySelectorAll("video");null==t||t.forEach((function(e){if(e.oncontextmenu=function(){return!1},e.src.indexOf(".m3u8")>-1)if(e.canPlayType("application/vnd.apple.mpegurl"));else if(p.ZP.isSupported()){var t=new p.ZP;t.loadSource(e.src),t.attachMedia(e)}}))};(0,d.useEffect)((function(){if(me.current&&ue&&ue.match(T)&&window.PR.prettyPrint(),me.current)return me.current.addEventListener("click",ge),function(){var e;null===(e=me.current)||void 0===e||e.removeEventListener("click",ge),(0,h.AL)(),(0,h.Iy)()}}),[ue,me.current,ge]);return(0,d.useEffect)((function(){var e,t=function(e){e.preventDefault(),e.clipboardData.setData("text",window.getSelection().toString())};return null===(e=me.current)||void 0===e||e.addEventListener("copy",t),function(){var e;null===(e=me.current)||void 0===e||e.removeEventListener("copy",t)}}),[me.current]),(0,w.jsxs)("div",{style:{position:"relative"},onMouseLeave:function(){q.current.style.display="none"},children:[c&&(0,w.jsx)("div",{ref:me,className:"".concat(k," "),children:ue}),!c&&!le(ue)&&(0,w.jsx)("div",{ref:me,style:r()({},_),onMouseOver:function(e){"IMG"===e.target.nodeName&&e.target.className.indexOf("draw-flowchart")>-1?(q.current.style.zIndex=1,q.current.style.display="flex",q.current.style.width=e.target.clientWidth+"px",q.current.style.height=e.target.clientHeight+"px",q.current.style.top=e.target.offsetTop+"px",q.current.style.left=e.target.offsetLeft+"px",e.target.id&&(U.current=e.target.id)):q.current.style.display="none"},className:"".concat(s||""," ").concat(j?"disabled-fill":""," markdown-body ").concat(k," ").concat(ae.current),dangerouslySetInnerHTML:{__html:ue}}),!c&&le(ue)&&(0,w.jsx)(C,{html:ue}),(0,w.jsx)("div",{ref:q,className:"".concat(S," ").concat(o?"":E),children:(0,w.jsx)(v.Z,{children:(0,w.jsx)(y.ZP,{onClick:function(){o?O(U.current):(J(U.current),te("flowChart"))},children:o?"编辑":"预览"})})}),(0,w.jsx)(b.Z,{close:!0,data:X,type:null!=X&&X.length?ee:"",style:r()({},A),onClose:function(){return J("")}})]})}},17124:function(e,t,n){"use strict";n.d(t,{h:function(){return v}});var i=n(82242),r=n.n(i),o=n(79800),a=n.n(o),s=n(59301),l=n(82326),c=n(28284),u=n(99571),d=n(89780),h=n.n(d),p=(n(66543),n(59598),n(37712)),f=l.default.Option,m={labelCol:{span:4},wrapperCol:{span:20}},g={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"]};function v(e){var t=e.value,n=e.onChange,i=e.mode,o=e.options,l=void 0===o?{}:o,c=(0,s.useRef)(),u=(0,s.useState)(),d=a()(u,2),f=d[0],m=d[1];return(0,s.useEffect)((function(){if(f){var e=function(e){var t=e.getValue();n&&n(t)};return f.on("change",e),function(){f.off("change",e)}}}),[f,n]),(0,s.useEffect)((function(){f&&f.setOption("mode",i)}),[f,i]),(0,s.useEffect)((function(){f&&(t===f.getValue()&&""!==t||setTimeout((function(){f.setValue(t||"")}),300))}),[f,t]),(0,s.useEffect)((function(){if(c.current&&!f){var e=h().fromTextArea(c.current,r()({mode:i,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},l));m(e)}}),[c.current,f]),(0,p.jsx)("div",{className:"my-codemirror-container",children:(0,p.jsx)("textarea",{ref:c})})}t.Z=function(e){var t=e.callback,n=e.onCancel,i=(0,s.useState)("python"),o=a()(i,2),d=o[0],h=o[1];return(0,p.jsxs)(c.Z,r()(r()({},m),{},{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){t(e)},style:{width:500},children:[(0,p.jsx)(c.Z.Item,{label:"代码语言",name:"language",children:(0,p.jsx)(l.default,{getPopupContainer:function(e){return e.parentNode},onChange:function(e){h(g[e][1])},children:Object.keys(g).map((function(e){return(0,p.jsx)(f,{value:e,children:g[e][0]},e)}))})}),(0,p.jsx)(c.Z.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}],children:(0,p.jsx)(v,{mode:d})}),(0,p.jsxs)("div",{className:"flex-container flex-end",children:[(0,p.jsx)(u.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,p.jsx)(u.ZP,{type:"ghost",onClick:n,children:"取消"})]})]}))}},58358:function(e,t,n){"use strict";n.d(t,{Z:function(){return he}});var i=n(91232),r=n.n(i),o=n(79800),a=n.n(o),s=n(85573),l=n.n(s),c=n(59301),u=n(53260),d=n(89780),h=n.n(d),p=n(76374),f=(n(66543),n(6313),n(25717),n(99498),n(25419),n(67549),n(74889)),m=n(37712),g=function(e){var t=e.value,n=void 0===t?"":t,i=(e.className,e.showTextOnly,e.showLines,e.style,(0,c.useMemo)((function(){return""}),[n]));return(0,m.jsx)(m.Fragment,{children:(0,m.jsx)("div",{dangerouslySetInnerHTML:{__html:i}})})},v=n(82242),y=n.n(v),x=[{title:"粗体",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"斜体",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"md-iconfont icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"链接",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"行内公式",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"数学公式",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"多行公式",icon:"md-iconfont icon-formula",actionName:"latex"},"|",{title:"添加图片",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"插入画图",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"插入流程图",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"表格",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"换行",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"清空",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function b(e){var t=e.onActionCallback,n=e.title,i=e.icon,r=e.actionName,o=e.className,a=void 0===o?"":o,s=e.children;return(0,m.jsxs)("a",{title:n,className:a,onClick:function(){t(r)},children:[(0,m.jsx)("i",{className:"".concat(i)}),s]})}var w=function(e){var t=e.watch,n=e.showNullButton,i=e.showNullProgramButton,r=e.onActionCallback,o=e.fullScreen,a=e.insertTemp,s=e.hidetoolBar,l=e.extraUse,c=[].concat(x,[{title:"".concat(t?"关闭实时预览":"开启实时预览"),icon:"".concat(t?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"),actionName:"trigger-watch"}]);return(0,m.jsxs)("ul",{className:"markdown-toolbar-container",children:[!s&&c.map((function(e,t){return(0,m.jsx)("li",{children:e.actionName?(0,m.jsx)(b,y()(y()({},e),{},{onActionCallback:r})):(0,m.jsx)("span",{className:"v-line"})},t)})),n?(0,m.jsx)("li",{children:(0,m.jsx)(b,{icon:"iconfont icon-tianjia5 insert-blank",className:"btn-null ml5",title:"增加填空",actionName:"add-null-ch",onActionCallback:r,children:(0,m.jsx)("span",{className:"fill-tip",children:"点击新增填空项"})})}):null,i?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("li",{children:(0,m.jsx)(b,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-signal",onActionCallback:r,children:(0,m.jsx)("span",{className:"fill-tip",children:"添加单行填空项"})})}),(0,m.jsx)("li",{children:(0,m.jsx)(b,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"增加填空",actionName:"add-multiple",onActionCallback:r,children:(0,m.jsx)("span",{className:"fill-tip",children:"添加多行填空项"})})})]}):null,a&&(0,m.jsx)("li",{children:(0,m.jsx)(b,{icon:"md-iconfont icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(a),onActionCallback:r,children:(0,m.jsx)("span",{className:"fill-tip",children:"插入模板"})})}),l&&(0,m.jsx)("li",{children:l}),(0,m.jsx)("li",{className:"btn-full-screen",children:(0,m.jsx)(b,{icon:"".concat(o?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"),title:o?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:r})})]})},C=n(82255),k=n(28284),S=n(37568),E=n(99571),M={labelCol:{span:4},wrapperCol:{span:20}},T=function(e){var t=e.callback,n=e.onCancel;return(0,m.jsxs)(k.Z,y()(y()({},M),{},{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){t(e)},style:{width:500},children:[(0,m.jsx)(k.Z.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}],children:(0,m.jsx)(S.Z,{})}),(0,m.jsx)(k.Z.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}],children:(0,m.jsx)(S.Z,{})}),(0,m.jsxs)("div",{className:"flex-container flex-end",children:[(0,m.jsx)(E.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,m.jsx)(E.ZP,{type:"ghost",onClick:n,children:"取消"})]})]}))},L=n(17124),_=n(13889),N=n(62957),A=n(77019),P=n(11933),D=function(e){var t=e.callback,n=e.onCancel,i=document.createElement("canvas"),r=i.getContext("2d");i.width=1e3,i.height=800,r.fillStyle="#ffffff",r.fillRect(0,0,i.width,i.height);var o=i.toDataURL("image/png");return(0,m.jsx)(N.Z,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1,children:(0,m.jsx)(A.Z,{style:{height:"100vh"},children:(0,m.jsx)(P.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:o,visible:!0,title:String(Date.now())},onOk:function(e){t({src:e.url})},onClose:n})})})},B=n(30641),j=n(5269),I=n(6767),R="drawerWrap___MfDw8",O=(0,c.forwardRef)((function(e,t){e.onCancel;var n=e.editImgId,i=e.callback,r=((0,c.useRef)(),(0,c.useRef)()),o=((0,c.useRef)(),(0,c.useRef)(!1),(0,c.useRef)(!1));console.log("ref:",t);var s=(0,c.useState)(0),l=a()(s,2),u=l[0],d=l[1],h=(0,c.useState)("100vh"),p=a()(h,2),f=p[0],g=p[1];return(0,c.useEffect)((function(){d(1)}),[]),(0,c.useImperativeHandle)(t,(function(){return{setHeight:g}})),(0,m.jsx)("div",{ref:o,className:"body-overflow-initial",children:(0,m.jsx)(B.Z,{width:"100vw",height:f,footer:null,closable:!0,placement:"bottom",open:!!u,destroyOnClose:!0,maskClosable:!1,mask:!1,rootClassName:"zIndex-9999 ".concat(R),onClose:function(){window.saveDrawData((function(e){i({src:"/api/attachments/".concat(e),id:e})}))},title:(0,m.jsxs)(A.Z,{align:"middle",children:[(0,m.jsx)(j.Z,{flex:1,children:"插入流程图"}),(0,m.jsx)(j.Z,{onClick:function(){g("60px"===f?"100vh":"60px")},children:(0,m.jsx)("span",{className:"current c-blue",style:{fontWeight:400},children:"展开/收起"})}),(0,m.jsx)(j.Z,{onClick:function(){window.saveDrawData((function(e){null!==e?(I.ZP.success({content:"保存成功",key:"saveFlowChart",style:{zIndex:999999999}}),i({src:"/api/attachments/".concat(e),id:e,disabledClose:!0})):I.ZP.warning({content:"内容为空,请先绘制流程图",key:"saveFlowChart"})}))},children:(0,m.jsx)(E.ZP,{type:"primary",className:"ml20",children:"保存"})})]}),children:(0,m.jsx)("iframe",{src:"/drawio/src/main/webapp/?id=".concat(n||"","&gapi=0&od=0&db=0&gh=0&gl=0&local=0"),width:"100%",height:"100%",frameBorder:"0",ref:r})})})})),Z=n(91689),F=n(47889),z=n(71051),H=F.ZP.Group,W={margin:"0 8px"},G=function(e){var t=e.callback,n=e.onCancel;return(0,m.jsxs)(k.Z,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){t(e)},children:[(0,m.jsxs)("div",{className:"flex-container",style:{alignItems:"baseline"},children:[(0,m.jsx)("span",{style:W,children:"单元格数:"}),(0,m.jsx)("span",{style:W,children:"行数"}),(0,m.jsx)(k.Z.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}],children:(0,m.jsx)(z.Z,{})}),(0,m.jsx)("span",{style:W,children:"列数"}),(0,m.jsx)(k.Z.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}],children:(0,m.jsx)(z.Z,{})})]}),(0,m.jsxs)("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"},children:[(0,m.jsx)("span",{style:W,children:"对齐方式:"}),(0,m.jsx)(k.Z.Item,{name:"align",children:(0,m.jsxs)(H,{children:[(0,m.jsx)(F.ZP,{value:"default",children:(0,m.jsx)("i",{className:"fa fa-align-justify"})}),(0,m.jsx)(F.ZP,{value:"left",children:(0,m.jsx)("i",{className:"fa fa-align-left"})}),(0,m.jsx)(F.ZP,{value:"center",children:(0,m.jsx)("i",{className:"fa fa-align-center"})}),(0,m.jsx)(F.ZP,{value:"right",children:(0,m.jsx)("i",{className:"fa fa-align-right"})})]})})]}),(0,m.jsxs)("div",{className:"flex-container flex-end",children:[(0,m.jsx)(E.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,m.jsx)(E.ZP,{type:"ghost",onClick:n,children:"取消"})]})]})},V=n(71411),q=n(32464),U=n.n(q),K=(0,c.forwardRef)((function(e,t){var n=e.use3d,i=e.width,r=e.height,o=e.callback,s=(e.showSaveButton,(0,c.useRef)()),l=(0,c.useRef)(),u=(0,c.useState)(!1),d=a()(u,2),h=d[0],p=d[1],f=(0,c.useRef)({id:s,appName:"graphing",width:i||1e3,height:r||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,c.useEffect)((function(){l.current=new(U())(f.current,!0),window.onload=function(){l.current.inject("applet_container")}}),[]);var g=function(){var e=window.ggbApplet.getPNGBase64(1,!0,72);return o&&o(e),e};return(0,c.useEffect)((function(){f.current.appName=h?"3D":"graphing",l.current.inject("applet_container")}),[h]),(0,c.useEffect)((function(){p(n)}),[n]),(0,c.useImperativeHandle)(t,(function(){return{getImgData:g}})),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:s}),(0,m.jsxs)(A.Z,{align:"middle",children:[(0,m.jsx)(j.Z,{flex:1,children:(0,m.jsx)(V.Z,{size:"default",checkedChildren:"关闭3D图像",unCheckedChildren:"开启3D图像",checked:h,onChange:function(e){return p(e)}})}),(0,m.jsx)(j.Z,{children:(0,m.jsx)(E.ZP,{size:"large",onClick:g,style:{zIndex:8,marginTop:10},type:"primary",children:"保存到编辑器"})})]})]})})),Y=n(55893),X="link",J="upload-image",Q="add-flowchart",$="draw-image",ee="code-block",te="add-table",ne="------------",ie={default:ne,left:":".concat(ne),center:":".concat(ne,":"),right:"".concat(ne,":")},re=n(22336),oe=n(83287);var ae="@▁▁@",se=["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 le(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var ce=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",ue=l()(l()({},ce+"-B","bold"),ce+"-I","italic"),de=l()(l()(l()(l()(l()(l()(l()(l()({},X,"添加链接"),ee,"添加代码块"),J,"添加图片"),$,"添加画图"),Q,"插入流程图"),te,"添加表格"),"maths-latex","数学图像"),"inline-latex","LATEX公式"),he=function(e){var t=e.defaultValue,n=void 0===t?"":t,i=e.onChange,o=e.width,s=void 0===o?"100%":o,d=e.height,v=void 0===d?400:d,y=e.miniToolbar,x=void 0!==y&&y,b=e.isFocus,k=void 0!==b&&b,S=e.watch,E=e.insertTemp,M=e.mode,A=void 0===M?"markdown":M,P=e.id,B=void 0===P?"markdown-editor-id":P,j=e.showResizeBar,R=void 0!==j&&j,F=e.noStorage,z=void 0!==F&&F,H=e.showNullButton,W=void 0!==H&&H,V=e.showNullProgramButton,q=void 0!==V&&V,U=e.hidetoolBar,ne=void 0!==U&&U,ce=e.fullScreen,he=void 0!==ce&&ce,pe=e.onBlur,fe=e.onCMBeforeChange,me=e.onFullScreen,ge=e.className,ve=void 0===ge?"":ge,ye=e.disablePaste,xe=void 0!==ye&&ye,be=e.disabled,we=void 0!==be&&be,Ce=e.disabledFill,ke=void 0!==Ce&&Ce,Se=e.placeholder,Ee=void 0===Se?"":Se,Me=e.values,Te=void 0===Me?"":Me,Le=e.extraUse,_e=e.onAddBlank,Ne=(0,c.useState)(null),Ae=a()(Ne,2),Pe=Ae[0],De=Ae[1],Be=(0,c.useState)(n),je=a()(Be,2),Ie=je[0],Re=je[1],Oe=(0,c.useState)(S),Ze=a()(Oe,2),Fe=Ze[0],ze=Ze[1],He=(0,c.useState)(he),We=a()(He,2),Ge=We[0],Ve=We[1],qe=(0,c.useState)(""),Ue=a()(qe,2),Ke=Ue[0],Ye=Ue[1],Xe=(0,c.useState)(0),Je=a()(Xe,2),Qe=Je[0],$e=Je[1],et=(0,c.useState)(v),tt=a()(et,2),nt=tt[0],it=tt[1],rt=(0,c.useState)(!1),ot=a()(rt,2),at=(ot[0],ot[1]),st=(0,c.useState)(0),lt=a()(st,2),ct=lt[0],ut=lt[1],dt=(0,c.useState)(0),ht=a()(dt,2),pt=ht[0],ft=ht[1],mt=(0,c.useRef)(),gt=(0,c.useRef)(),vt=(0,c.useRef)(),yt=(0,c.useRef)(),xt=(0,c.useRef)(),bt=(0,c.useRef)(),wt=(0,u.useDispatch)();(0,c.useEffect)((function(){var e=window.scrollY||window.pageYOffset;Re(Te),null==Pe||Pe.setValue(Te),window.scrollTo(0,e)}),[Te]),(0,c.useEffect)((function(){null==me||me(Ge)}),[Ge]),(0,c.useEffect)((function(){if(mt.current){var e=function(e,n){if(!xe){var i=n.clipboardData;if(i){var r=i.types.toString(),o=i.items;if("Files"===r||i.types.indexOf("Files")>-1){if(n.preventDefault(),"stex"==A)return;try{var a,s=o[1];"file"===(null===(a=o[0])||void 0===a?void 0:a.kind)&&(s=o[0]);var l=s.getAsFile(),c=l.name.split(".").pop();(0,_.I)(l,(function(e){var n,i,r;e.id?(null==l||null===(n=l.type)||void 0===n?void 0:n.indexOf("image"))>-1?t.replaceSelection('<img width="100%" src="/api/attachments/'.concat(e.id,"?type=").concat(e.content_type,')" alt="','" />')):(null==l||null===(i=l.type)||void 0===i?void 0:i.indexOf("video"))>-1?t.replaceSelection('<video width="100%" controls src="/api/attachments/'.concat(e.id,'"></video>')):(null==l||null===(r=l.type)||void 0===r?void 0:r.indexOf("pdf"))>-1?t.replaceSelection('<a href="/api/attachments/'.concat(e.id,"?type=").concat(l.type,'&disposition=inline" target="_blank">').concat(l.name,"</a>")):se.includes(c)?t.replaceSelection('<a href="/api/attachments/'.concat(e.id,'?type=office&disposition=inline" target="_blank">').concat(l.name,"</a>")):t.replaceSelection("[".concat(l.name,"](/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}))}catch(n){I.ZP.warning("请使用chrome浏览器粘贴")}return!0}return!0}return!0}n.preventDefault()},t=h().fromTextArea(mt.current,{mode:A,lineNumbers:!x,lineWrapping:!0,value:n,autoCloseTags:!0,autoCloseBrackets:!0});return t.on("keyup",(function(e,n){8===n.keyCode&&(""==e.getValue()?t.setOption("placeholder",Ee):t.setOption("placeholder",null))})),t.on("keydown",(function(e,t){if(8===t.keyCode){var n=function(e,t){var n=e.getDoc(),i=n.getCursor(),r=n.getLine(i.line),o=r.charAt(i.ch-1),a=r.lastIndexOf("@▁@",i.ch),s=r.lastIndexOf("@▁▁@",i.ch),l=a>s?a:s,c=a>s?3:4;if(-1===ae.indexOf(o))return null;if(console.log("change1:",t,e,r,i,l,a,s,o),l>=0&&i.ch-l<5){var u=l+c;return n.replaceRange("",{line:i.line,ch:l},{line:i.line,ch:u}),{line:i.line,ch:u}}return null}(e);n&&t.preventDefault()}})),k&&t.focus(),t.on("paste",e),we&&t.on("beforeChange",(function(e,t){"paste"!==t.origin&&"+input"!==t.origin||t.cancel()})),De(t),function(){t.off("paste",e)}}}),[]);var Ct=(0,c.useCallback)((function(){gt.current}),[nt,gt,Ge]);(0,c.useEffect)((function(){if(Pe){var e=function(){var e=new p.Z((function(e){var t,n=r()(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&(Ct(),Pe.setSize("100%","100%"),Pe.refresh())}}catch(e){n.e(e)}finally{n.f()}}));return e.observe(mt.current.parentElement),e}();return function(){var t,n;null!==(t=mt.current)&&void 0!==t&&t.parentElement&&e.unobserve(null===(n=mt.current)||void 0===n?void 0:n.parentElement)}}}),[Pe,Ct]),(0,c.useEffect)((function(){if(Pe){for(var e=[],t=function(){var t=a()(i[n],2),r=t[0],o=t[1],s=l()({},r,(function(){kt(o)}));e.push(s),Pe.addKeyMap(s)},n=0,i=Object.entries(ue);n<i.length;n++)t();return function(){for(var t=0,n=e;t<n.length;t++){var i=n[t];Pe.removeKeyMap(i)}}}}),[Pe]),(0,c.useEffect)((function(){he!==Ge&&Ve(he)}),[he]),(0,re.Z)((function(){if(!z&&Qe>0){var e=(new Date).getTime(),t=window.sessionStorage.getItem(B);e>=Qe+1e4&&(!t||t!==Ie)&&(window.sessionStorage.setItem(B,Ie),at(!0))}}),1e4),(0,c.useEffect)((function(){ze(S)}),[Pe,S]),(0,c.useEffect)((function(){Pe&&k&&Pe.focus()}),[Pe,k]),(0,c.useEffect)((function(){if(Fe&&Pe){var e=function(e){var t=e.target;if(yt.current){var n=t.scrollTop/t.scrollHeight;yt.current.scrollTop=yt.current.scrollHeight*n}},t=Pe.getScrollerElement();return t.addEventListener("scroll",e),function(){t.removeEventListener("scroll",e)}}}),[Pe,Fe]),(0,c.useEffect)((function(){if(Pe&&fe){var e=function(e,t){fe(e,t)};return Pe.on("beforeChange",e),function(){Pe.off("beforeChange",e)}}}),[Pe,fe]),(0,c.useEffect)((function(){if(Pe&&pe){var e=function(){pe(Pe.getValue())};return Pe.on("blur",e),function(){Pe.off("blur",e)}}}),[Pe,pe]),(0,c.useEffect)((function(){if(Pe){var e=function(e,t){var n=e.getValue();Re(n),$e((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),i&&(q?i(n,Lt(n)):i(n))};return Pe.on("change",e),function(){Pe.off("change",e)}}}),[Pe,i]),(0,c.useEffect)((function(){if(Pe)if(null==n)Pe.setValue(""),Re("");else{var e=window.scrollY||window.pageYOffset;n!==Pe.getValue()&&(Pe.setValue(n),Re(n),Pe.setCursor(we?1:Pe.lineCount(),0),window.scrollTo(0,e))}}),[Pe,n]);var kt=(0,c.useCallback)((function(e){var t=Pe.getCursor(),n=Pe.getSelection(),i=n.split("\n");switch(e){case"bold":return Pe.replaceSelection("**"+n+"**"),""===n&&Pe.setCursor(t.line,t.ch+2),Pe.focus();case"italic":return Pe.replaceSelection("*"+n+"*"),""===n&&Pe.setCursor(t.line,t.ch+1),Pe.focus();case"code":return Pe.replaceSelection("`"+n+"`"),""===n&&Pe.setCursor(t.line,t.ch+1),Pe.focus();case"inline-latex":if((0,oe.Ye)(wt))return;return Ye("inline-latex"),Pe.focus();case"latex":return Pe.replaceSelection("```latex\n"+n+"\n```"),Pe.setCursor(t.line+1,n.length+1),Pe.focus();case"line-break":return Pe.replaceSelection("<br/>\n"),Pe.focus();case"list-ul":return""===n?Pe.replaceSelection("- "+n):Pe.replaceSelection(i.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),Pe.focus();case"list-ol":return""===n?Pe.replaceSelection("1. "+n):Pe.replaceSelection(i.map((function(e,t){return""===e?"":"".concat(t+1,". ").concat(e)})).join("\n")),Pe.focus();case"add-null-ch":return void(null==_e||_e());case"add-signal":return""===n&&Pe.setCursor(t.line,t.ch),Pe.replaceSelection("@▁@"),Pe.focus();case"add-multiple":return""===n&&Pe.setCursor(t.line,t.ch),Pe.replaceSelection(ae),Pe.focus();case"inster-template-1":return""===n&&Pe.setCursor(t.line,t.ch),Pe.replaceSelection("\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作"),Pe.focus();case"eraser":return Pe.setValue(""),Pe.focus();case"trigger-watch":return ze(!Fe),Pe.focus();case"trigger-full-screen":return Ve(!Ge),Pe.focus();case X:return void Ye(X);case ee:return void Ye(ee);case J:return void Ye(J);case $:return void Ye($);case"maths-latex":if((0,oe.Ye)(wt))return;return void Ye("maths-latex");case Q:return xt.current="",sessionStorage.removeItem("file_id"),void Ye(Q);case te:return void Ye(te);default:throw new Error}}),[Pe,Fe,Ge]),St=(0,c.useCallback)((function(e,t){var n,i,r,o,a;null!=e&&e.disabledClose||Ye("");var s=e||{},l=s.src,c=s.alt,u=s.id;switch(Ke){case X:var d=e.title,h=e.link;return Pe.replaceSelection("[".concat(d,"](").concat(h,")")),Pe.focus();case ee:var p=e.language,f=e.content;return Pe.replaceSelection(["```"+p,f,"```"].join("\n")),Pe.focus();case"maths-latex":for(var m=atob(e),g=new Uint8Array(m.length),v=0;v<m.length;v++)g[v]=m.charCodeAt(v);var y=new Blob([g],{type:"image/png"});(0,_.I)(y,(function(e){e.id?Pe.replaceSelection(".concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}));break;case"inline-latex":if((0,oe.Ye)(wt))return;Pe.replaceSelection("`$$"+e+"$$`");break;case"add-flowchart":if(!u)return;-1===Pe.getValue().indexOf(l)?Pe.replaceSelection('<center><img id="'.concat(u,'" width="80%" src="').concat(l,'" class="draw-flowchart" alt="').concat(c||"",'" /></center>')):document.getElementById(u).src=Z.Z.API_SERVER+l+"?t="+Date.now();break;case J:case $:var x=t,b=null==x||null===(n=x.name)||void 0===n||null===(n=n.split("."))||void 0===n||null===(i=n.pop)||void 0===i?void 0:i.call(n);return(null==x||null===(r=x.type)||void 0===r?void 0:r.indexOf("image"))>-1||null==x||!x.type?null!=x&&x.align||null!=x&&x.width?Pe.replaceSelection('<p style="text-align:'.concat(x.align||"initial",'"><img width="').concat(x.width?x.width+"%":"initial",'" src="').concat(l,'" alt="').concat(c||"",'" /></p>')):Pe.replaceSelection('<img width="100%" src="'.concat(l,'" alt="').concat(c||"",'" />')):(null==x||null===(o=x.type)||void 0===o?void 0:o.indexOf("video"))>-1?Pe.replaceSelection('<video width="100%" controls src="'.concat(l,'"></video>')):(null==x||null===(a=x.type)||void 0===a?void 0:a.indexOf("pdf"))>-1?Pe.replaceSelection('<a href="'.concat(l,"?type=").concat(x.type,'&disposition=inline" target="_blank">').concat(x.name,"</a>")):se.includes(b)?Pe.replaceSelection('<a href="'.concat(l,'?type=office&disposition=inline" target="_blank">').concat(x.name,"</a>")):Pe.replaceSelection("[".concat(x.name,"](").concat(l,")")),Pe.focus();case te:for(var w=e.row,C=e.col,k=e.align,S="\n",E=0;E<w;E++){for(var M=[],T=[],L=0;L<C;L++)1===E&&T.push(ie[k]),M.push(" ");1===E&&(S+="| ".concat(T.join(" | ")," |\n")),S+="| ".concat(M.join(1===C?"":" | ")," |\n")}return Pe.replaceSelection(S+"\n"),Pe.focus();default:throw new Error}}),[Pe,Ke]),Et=(0,c.useMemo)((function(){switch(Ke){case X:return(0,m.jsx)(T,{callback:St,onCancel:Mt});case ee:return(0,m.jsx)(L.Z,{callback:St,onCancel:Mt});case J:return(0,m.jsx)(_.Z,{callback:St,onCancel:Mt});case Q:return(0,m.jsx)(O,{editImgId:xt.current,callback:St,onCancel:Mt});case te:return(0,m.jsx)(G,{callback:St,onCancel:Mt});case"maths-latex":return(0,m.jsx)(K,{showSaveButton:!0,callback:St});case"inline-latex":return(0,m.jsx)(Y.Z,{showSaveButton:!0,callback:St});default:return null}}),[Ke]);function Mt(){Ye("")}(0,c.useEffect)((function(){if(vt.current){var e=function(e){r=!0,o=e.pageY},t=function(){r=!1},n=function(e){if(r){var t=e.pageY-o;t<0&&(t=0),t>300&&(t=300),it(v+t+"px")}},i=vt.current,r=!1,o=0;return i.addEventListener("mousedown",e),document.addEventListener("mousemove",n),document.addEventListener("mouseup",t),function(){i.removeEventListener("mousedown",e),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",t)}}}),[Pe,vt]),(0,c.useEffect)((function(){it(v)}),[v]);var Tt={width:le(s),height:le(nt)},Lt=((0,c.useMemo)((function(){if(Qe){var e=new Date(Qe),t=e.getHours(),n=e.getMinutes(),i=e.getSeconds();return n=n<10?"0"+n:n,i=i<10?"0"+i:i,"".concat(t=t<10?"0"+t:t,":").concat(n,":").concat(i)}return 0}),[Qe]),function(e){var t=[];if(q){e=e.replace(/(@▁▁@|@▁@)/g,(function(e,n,i){t.push({multiLine:!("@▁@"===e)})}))}return t});(0,c.useEffect)((function(){de[Ke]&&Ke!==$&&Ke!==Q&&setTimeout((function(){var e=document.getElementsByClassName("markdown-popup-form")[0],t=window.innerWidth/2-e.offsetWidth/2,n=window.innerHeight/2-e.offsetHeight/2;ut(t),ft(n)}),0)}),[Ke]);var _t=function(e,t,n,i){var r=document.body.clientHeight,o=document.body.clientWidth;return!(e<20&&n>e||e>o-20&&n<e||t<20&&i>t||t>r-20&&i<t)||(document.body.onmousemove=null,document.body.onmouseup=null,!1)};return(0,m.jsxs)(c.Fragment,{children:[(0,m.jsx)("div",{className:"markdown-editor-wrapper",ref:gt,children:(0,m.jsxs)("div",{className:"markdown-editor-container ".concat(ve," ").concat(Fe?"on-preview":""," ").concat(x?"mini":""," ").concat(Ge?"full-screen":""),style:Tt,children:[(0,m.jsx)(w,{insertTemp:E,watch:Fe,fullScreen:Ge,showNullButton:W,showNullProgramButton:q,onActionCallback:kt,hidetoolBar:ne,extraUse:Le}),(0,m.jsxs)("div",{className:"markdown-editor-body",children:[(0,m.jsx)("div",{className:"codemirror-container",children:(0,m.jsx)("textarea",{ref:mt,placeholder:Ee})}),Fe?(0,m.jsxs)("div",{ref:yt,className:"preview-container",children:["stex"===A&&(0,m.jsx)(g,{value:Ie}),"stex"!==A&&(0,m.jsx)(f.Z,{edit:!0,disabledFill:ke,showProgramFill:q,value:Ie,openEditor:function(e){var t;xt.current=e,null===(t=bt.current)||void 0===t||t.setHeight("100vh"),setTimeout((function(){Ye("add-flowchart")}),150)}})]}):null]})]})}),R?(0,m.jsx)("a",{ref:vt,className:"editor-resize"}):null,Ke===$&&(0,m.jsx)(D,{callback:St,onCancel:Mt}),Ke===Q&&(0,m.jsx)(O,{ref:bt,editImgId:xt.current,callback:St,onCancel:Mt}),(0,m.jsx)(C.Z,{children:de[Ke]&&Ke!==$&&Ke!==Q?(0,m.jsx)(N.Z,{maskClosable:!1,centered:!0,style:{position:"absolute",left:ct,top:pt},title:(0,m.jsx)("div",{style:{cursor:"move"},onMouseDown:function(e){e.preventDefault();var t=e.clientX-ct,n=e.clientY-pt;document.body.onmousemove=function(e){var i=e.clientX-t,r=e.clientY-n,o=document.getElementsByClassName("markdown-popup-form")[0],a=window.innerWidth-o.offsetWidth,s=window.innerHeight-o.offsetHeight;i=Math.max(0,Math.min(i,a)),r=Math.max(0,Math.min(r,s)),_t(e.clientX,e.clientY,t,n)&&(ut(i),ft(r))},document.body.onmouseup=function(){document.body.onmousemove=null}},children:de[Ke]}),open:!0,onCancel:Mt,footer:null,destroyOnClose:!0,width:Ke===Q?"1200px":null,height:Ke===Q?"80vh":null,className:"markdown-popup-form",children:Et}):null})]})}},13889:function(e,t,n){"use strict";n.d(t,{Z:function(){return b},I:function(){return C}});var i=n(82242),r=n.n(i),o=n(79800),a=n.n(o),s=n(28284),l=n(6767),c=n(37568),u=n(77736),d=n(71051),h=n(47889),p=n(99571),f=n(78988),m=n(59301),g=n(37712),v=s.Z.useForm,y={width:280,marginRight:10},x={labelCol:{span:5},wrapperCol:{span:19}},b=function(e){var t=e.callback,n=e.onCancel,i=v(),o=a()(i,1)[0],f=(0,m.useRef)();function b(e,t){-1!==e.status?o.setFieldsValue({src:"/api/attachments/".concat(e.id),type:t.type}):l.ZP.error(e.message)}return(0,g.jsxs)(s.Z,r()(r()({form:o},x),{},{className:"upload-image-panel",onFinish:function(e){f.current.width=o.getFieldValue("width"),f.current.align=o.getFieldValue("align"),t(e,f.current)},style:{width:470,overflow:"hidden"},children:[(0,g.jsx)(s.Z.Item,{label:"图片地址",required:!0,children:(0,g.jsxs)("div",{className:"flex-container",children:[(0,g.jsx)(s.Z.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入图片地址"}],children:(0,g.jsx)(c.Z,{style:y})}),(0,g.jsx)(w,{onFileChange:function(e){var t=e.target.files[0];f.current=t,C(t,b)}})]})}),(0,g.jsx)(s.Z.Item,{label:"图片描述",name:"alt",children:(0,g.jsx)(c.Z,{style:{width:264}})}),(0,g.jsx)(s.Z.Item,{label:"图片宽度",name:"width",children:(0,g.jsxs)(u.Z,{children:[(0,g.jsx)(s.Z.Item,{name:"width",style:{margin:0},children:(0,g.jsx)(d.Z,{style:{width:264}})}),(0,g.jsx)("span",{className:"ml8",children:"%"})]})}),(0,g.jsx)(s.Z.Item,{label:"对齐方式",name:"align",children:(0,g.jsx)(h.ZP.Group,{name:"align",defaultValue:1,options:[{value:"left",label:"左对齐"},{value:"center",label:"居中对齐"},{value:"right",label:"右对齐"}]})}),(0,g.jsx)("aside",{children:(0,g.jsxs)(s.Z.Item,{style:{textAlign:"right",position:"relative",right:-98},children:[(0,g.jsx)(p.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,g.jsx)(p.ZP,{type:"default",onClick:n,children:"取消"})]})})]}))};function w(e){var t=e.onFileChange;return(0,g.jsxs)("label",{className:"upload-button",style:{cursor:"pointer"},children:["本地上传",(0,g.jsx)("input",{type:"file",onChange:t})]})}function C(e,t){if(!e)throw new String("没有文件");var n=new FormData;n.append("editormd-image-file",e),n.append("file_param_name","editormd-image-file"),n.append("byxhr","true");var i=new window.XMLHttpRequest;i.withCredentials=!0,i.addEventListener("load",(function(n){t(JSON.parse(n.target.responseText),e)}),!1),i.addEventListener("error",(function(e){console.error(e)}),!1),i.open("POST","".concat(f.KI,"/api/attachments.json")),i.send(n)}},82255:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var i=n(82100),r=n.n(i),o=n(29186),a=n.n(o),s=n(80619),l=n.n(s),c=n(47074),u=n.n(c),d=n(59301),h=n(4676),p=function(e){l()(n,e);var t=u()(n);function n(e){var i;r()(this,n),i=t.call(this,e);var o=window.document;return i.node=o.createElement("div"),o.body.appendChild(i.node),i}return a()(n,[{key:"render",value:function(){var e=this.props.children;return(0,h.createPortal)(e,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),n}(d.Component)},92068:function(e,t,n){"use strict";n.d(t,{SV:function(){return J},ZP:function(){return X}});var i=n(82242),r=n.n(i),o=n(37205),a=n.n(o),s=n(91232),l=n.n(s),c=n(79800),u=n.n(c),d=n(39647),h=n.n(d),p=n(7557),f=n.n(p),m=n(41498),g=n.n(m),v=n(59301),y=n(76374),x=["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"],b={quickKey:[{label:"main",content:["public static void main(String[] args) {","\t$0","}"].join("\n")},{label:"System.out.println",content:["System.out.println($0)"].join("\n")},{label:"System.out.print",content:["System.out.print($0)"].join("\n")}],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"]},w={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}) {","\t$0","} else {","\t","}"].join("\n")},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {","\t$0","}"].join("\n")},{label:"if",content:["if () {","\t$0","}"].join("\n")},{label:"for",content:["for(int j=0 ; j<10; j++){","\t$0","}"].join("\n")},{label:"trycatch",content:["try{","\t$0","}catch(ExceptionName e){","}"].join("\n")},{label:"using namespace std;",content:["using namespace std;"].join("\n")},{label:"include <iostream>",content:["#include <iostream>"].join("\n")},{label:"include <vector>",content:["#include <vector>"].join("\n")},{label:"include <cstdio>",content:["#include <cstdio>"].join("\n")},{label:"include <cstring>",content:["#include <cstring>"].join("\n")},{label:"include <sstream>",content:["#include <sstream>"].join("\n")},{label:"include <fstream>",content:["#include <fstream>"].join("\n")},{label:"include <map>",content:["#include <map>"].join("\n")},{label:"include <string>",content:["#include <string>"].join("\n")},{label:"include <cmath>",content:["#include <cmath>"].join("\n")}]},C={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("\n")}]},k={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("\n")}]},S=n(53184),E=n.n(S),M={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"]}},T=function(e,t,n,i){e.languages.registerCompletionItemProvider(t,{provideCompletionItems:function(t,r){var o=t.getWordUntilPosition(r),s={startLineNumber:r.lineNumber,endLineNumber:r.lineNumber,startColumn:o.startColumn,endColumn:o.endColumn},l=t.getLineContent(r.lineNumber).substring(o.startColumn-2,o.endColumn),c=function(e,t,n,i){var r=t.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column});return Array.from(new Set(r.match(/\b\w{2,}\b/g)||[])).map((function(t){return{label:t,kind:e.languages.CompletionItemKind.Text,insertText:t,range:i}}))}(e,t,r,s);return{suggestions:[].concat(a()(c),a()(n.map((function(t){return{label:t,kind:e.languages.CompletionItemKind.Keyword,documentation:t,insertText:t,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:s}}))),a()(i.map((function(t){return{label:t.label,kind:e.languages.CompletionItemKind.Snippet,documentation:t.content,insertText:l.startsWith("#")?t.content.replace(/#/,""):t.content,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:s}}))))}}})},L=n(82100),_=n.n(L),N=n(29186),A=n.n(N),P=n(85573),D=n.n(P),B=function(){function e(t,n,i){var r=this;_()(this,e),this.placeholder=t,this.editor=n,this.monaco=i,n.onDidChangeModelContent((function(){return r.onDidChangeModelContent()})),this.onDidChangeModelContent()}return A()(e,[{key:"onDidChangeModelContent",value:function(){""===this.editor.getValue()?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}},{key:"getId",value:function(){return e.ID}},{key:"getDomNode",value:function(){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}},{key:"getPosition",value:function(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}},{key:"dispose",value:function(){this.editor.removeContentWidget(this)}}]),e}();D()(B,"ID","editor.widget.placeholderHint");var j=B,I=n(96236),R=n(6767),O=n(25399),Z=n(89392),F=n(70717),z=n(56102),H=n(37712),W=["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"];function G(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}function V(){}var q={"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 U(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e;if(Array.isArray(e)){for(var n=0;n<e.length;n++){var i=q[e[n]];if(i)return i}return t[0]}return q[t]||t}var K=null,Y=function(){var e=g()(f()().mark((function e(){return f()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,navigator.clipboard.writeText(" ");case 3:console.log("内容已自动复制到剪贴板:"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.error("自动复制失败:",e.t0);case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(){return e.apply(this,arguments)}}(),X=function(e){var t=e.width,i=void 0===t?"100%":t,o=e.height,s=void 0===o?"100%":o,c=e.value,d=e.language,p=void 0===d?"javascript":d,m=e.style,S=void 0===m?{}:m,L=e.options,_=void 0===L?{}:L,N=e.overrideServices,A=void 0===N?{}:N,P=e.theme,D=void 0===P?"vs-dark":P,B=e.onEditBlur,q=e.isCopy,X=void 0!==q&&q,J=e.onSave,Q=e.autoHeight,$=void 0!==Q&&Q,ee=e.forbidCopy,te=void 0!==ee&&ee,ne=e.onChange,ie=void 0===ne?V:ne,re=e.editorDidMount,oe=void 0===re?V:re,ae=e.onFocus,se=void 0===ae?V:ae,le=e.onBreakPoint,ce=void 0===le?V:le,ue=e.breakPointValue,de=void 0===ue?[]:ue,he=e.filename,pe=void 0===he?"educoder.txt":he,fe=e.errorLine,me=e.errorContent,ge=void 0===me?"":me,ve=e.highlightLine,ye=e.openBreakPoint,xe=void 0!==ye&&ye,be=e.placeholder,we=void 0===be?"":be,Ce=e.showMiniMap,ke=void 0===Ce||Ce,Se=(h()(e,W),(0,v.useRef)()),Ee=(0,v.useRef)({}),Me=(0,v.useRef)(),Te=(0,v.useRef)(),Le=(0,v.useRef)([]),_e=(0,v.useRef)(!1),Ne=(0,v.useRef)(),Ae=(0,v.useRef)(),Pe=(0,v.useRef)(!1),De=(0,v.useState)(!1),Be=u()(De,2),je=Be[0],Ie=Be[1];(0,v.useEffect)((function(){var e=F.Z.subscribe("formatDocument",(function(e){var t,n=Ee.current.instance;null==n||null===(t=n.getAction)||void 0===t||t.call(n,"editor.action.formatDocument").run()}));return window.updateMonacoValue=function(e){ie(e)},e}),[]),(0,v.useEffect)((function(){var e,t=Ee.current.instance;(Te.current&&clearTimeout(Te.current),Te.current=setTimeout((function(){!function(){var e=Ee.current.instance;if(null!=c&&e&&je){var t=e.getModel();t&&c!==t.getValue()&&(!0,t.setValue(c),e.layout(),!1)}}()}),500),c&&null!=c&&c.length)&&(null==t||null===(e=t.updateOptions)||void 0===e||e.call(t,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(c.split(/\r\n|\r|\n/g).length))+3,5)}))}),[c,je,Ee.current]),(0,v.useEffect)((function(){if(fe&&Ee.current&&Ee.current.instance){var e=Ee.current.instance;e.changeViewZones((function(e){var t=document.createElement("div");t.style.padding="10px 20px",t.style.width="calc(100% - 20px)",t.className="my-error-line-wrp",t.innerHTML=ge,e.addZone({afterLineNumber:fe||11,heightInLines:3,domNode:t})}));var t={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}};e.addOverlayWidget(t),e.revealPositionInCenter({lineNumber:20,column:1})}}),[fe,Ee.current,je]);var Re=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!e||""===e.trim())return!0;for(var n=Ee.current.instance.getModel(),i=n.getLineTokens(t),r=!1,o=0;o<2;o++)1===i.getStandardTokenType(o)&&(r=!0);return r};function Oe(e){(window.navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)&&83==e.keyCode&&(e.preventDefault(),J())}(0,v.useEffect)((function(){var e,t=null===(e=Ee.current)||void 0===e?void 0:e.instance;if(t&&je&&te){var n=t.onDidBlurEditorWidget((function(){Pe.current=!1})),i=t.onDidFocusEditorText((function(){Pe.current=!0}));return function(){n.dispose(),i.dispose()}}}),[Ee.current,je,te]),(0,v.useEffect)((function(){var e;if(null!==(e=Ee.current)&&void 0!==e&&e.instance&&je&&xe){var t=Ee.current.instance,n=t.getModel();if(!n)return;!function(){var e,i=[],r=[],o=n.getAllDecorations(),a=l()(o);try{for(a.s();!(e=a.n()).done;){var s,c=e.value;if("highlighted-line"===c.options.className)i.push(null==c||null===(s=c.range)||void 0===s?void 0:s.startLineNumber),r.push(null==c?void 0:c.id)}}catch(e){a.e(e)}finally{a.f()}if(ve!==i[0]){n.deltaDecorations(r,[]);var u=n.getLineCount();ve&&ve<=u&&(t.deltaDecorations([],[{range:new K.Range(ve,1,ve,n.getLineMaxColumn(ve)),options:{isWholeLine:!0,className:"highlighted-line"}}]),t.revealLineInCenter(ve))}}();var i=function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=[],r=[],o=n.getAllDecorations(),a=l()(o);try{for(a.s();!(e=a.n()).done;){var s,c=e.value;if("breakpoints-select"===c.options.linesDecorationsClassName)i.push(null==c||null===(s=c.range)||void 0===s?void 0:s.startLineNumber),r.push(null==c?void 0:c.id)}}catch(e){a.e(e)}finally{a.f()}if(t)return{lines:i,ids:r};ce(i)},r=function(){var e=g()(f()().mark((function e(t){var r;return f()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={range:new K.Range(t,1,t,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}},e.next=3,n.deltaDecorations([],[r]);case 3:i();case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),o=function(){var e=g()(f()().mark((function e(r){var o,a,s,c,u;return f()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=t.getLineDecorations(r),s=l()(a);try{for(s.s();!(c=s.n()).done;)"breakpoints-select"===(u=c.value).options.linesDecorationsClassName&&o.push(u.id)}catch(e){s.e(e)}finally{s.f()}return e.next=6,n.deltaDecorations(o,[]);case 6:i();case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),a=function(e){var n,i=t.getLineDecorations(e),r=l()(i);try{for(r.s();!(n=r.n()).done;){if("breakpoints-select"===n.value.options.linesDecorationsClassName)return!0}}catch(e){r.e(e)}finally{r.f()}return!1};if(!(0,Z.isEqual)(de,i(!0).lines)){n.deltaDecorations(i(!0).ids,[]);var s=de.map((function(e){return{range:new K.Range(e,1,e,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}}));n.deltaDecorations([],s)}var c=t.onDidChangeModelContent((function(e){var s=t.getPosition();if(s){var l=s.lineNumber;clearTimeout(Ae.current),Ae.current=setTimeout((function(){Re(n.getLineContent(l),l)?o(l):a(l)?(o(l),r(l)):i()}),100)}})),u=t.onMouseDown((function(e){var t;if(e.target.detail&&null!==(t=e.target)&&void 0!==t&&null!==(t=t.element)&&void 0!==t&&null!==(t=t.className)&&void 0!==t&&t.includes("line-numbers")){var i=e.target.position.lineNumber;if(Re(n.getLineContent(i),i))return;a(i)?o(i):r(i)}})),d=function(){Le.current=t.deltaDecorations(Le.current,[])},h=t.onMouseMove((function(e){var i;if(d(),e.target.detail&&null!==(i=e.target)&&void 0!==i&&null!==(i=i.element)&&void 0!==i&&null!==(i=i.className)&&void 0!==i&&i.includes("line-numbers")){var r=e.target.position.lineNumber;if(Re(n.getLineContent(r),r))return;!function(e){var n={range:new K.Range(e,1,e,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Le.current=t.deltaDecorations(Le.current,[n])}(r)}})),p=t.onMouseLeave((function(){d()}));return function(){c.dispose(),u.dispose(),h.dispose(),p.dispose()}}}),[Ee.current,je,de,ve,xe,p]),(0,v.useEffect)((function(){var e;null!==(e=Ee.current)&&void 0!==e&&e.instance&&xe&&Ee.current.instance.setPosition({lineNumber:0,column:0})}),[ve]);var Ze=function(){if($&&Ee.current.instance){var e=Ee.current.instance.getContentHeight();Ke(e<s?s:e)}else Ke(s)};var Fe=function(e){if(Pe.current){var t=e.keyCode,n=e.ctrlKey,i=e.metaKey,r=e.target;return"paste"!==e.type&&(67!==t&&86!==t||!i&&!n)||"TEXTAREA"!==r.nodeName||(R.ZP.warning({content:decodeURIComponent("该任务关卡设置了禁止复制粘贴,请手动输入代码。"),key:"monaco-editor-tip"}),e.preventDefault()),!1}};function ze(e,t){var n,i,r=window.URL||window.webkitURL||window,o=new Blob([t]),a=document.createElementNS("http://www.w3.org/1999/xhtml","a");a.href=r.createObjectURL(o),a.download=e,n=a,(i=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}(0,v.useEffect)((function(){Ze()}),[Ze]),(0,v.useEffect)((function(){Se.current&&!je&&Promise.all([n.e(8909),n.e(5028)]).then(n.bind(n,71448)).then((function(e){try{K=e,Ee.current.instance=K.editor.create(Se.current,{value:c,language:U(p),theme:D,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:ke||!1}},A);var t=Ee.current.instance,n=I.BH._menuItems,i=a()(n).find((function(e){return"EditorContext"==e[0]._debugName}))[1];if(oe(t,K),setTimeout((function(){Ze(),Ee.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){ze(pe||"educoder.txt",t.getValue())}})}),500),Ee.current.subscription=t.onDidChangeModelContent((function(e){_e.current?clearTimeout(Ne.current):(Ze(),ie(t.getValue(),e)),Ne.current=setTimeout((function(){_e.current=!1}),500)})),window.Monaco||function(e){M.languages.forEach((function(t){e.languages.registerDocumentFormattingEditProvider(t,{provideDocumentFormattingEdits:function(e){return g()(f()().mark((function t(){var n;return f()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=E()(e.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}),t.abrupt("return",[{range:e.getFullModelRange(),text:n}]);case 2:case"end":return t.stop()}}),t)})))()}})})),T(e,"java",b.keywords,b.quickKey),T(e,"cpp",w.keywords,w.quickKey),T(e,"c",x,[]),T(e,"python",C.keywords,C.quickKey),T(e,"scala",k.keywords,k.quickKey)}(K,U(p)),te&&(!function(e,t){var n=e._first;do{var i;t.includes(null===(i=n.element)||void 0===i||null===(i=i.command)||void 0===i?void 0:i.id)&&e._remove(n)}while(n=n.next)}(i,["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"]),Se.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Fe),window.removeEventListener("paste",Fe),window.addEventListener("keydown",Fe),window.addEventListener("paste",Fe)),window.Monaco=K,B&&t.onDidBlurEditorWidget((function(){B(t.getValue())})),se&&t.onDidFocusEditorText((function(){te&&Y(),se(t.getValue())})),te){Y();try{t.onDidPaste((function(e){var n=t.getSelection(),i=Ee.current.pastePos||{};new K.Range(i.startLineNumber||n.endLineNumber,i.startColumn||n.endColumn,i.endLineNumber||n.endLineNumber,i.endColumn||n.endColumn);t.executeEdits("",[{range:e.range,text:""}])}))}catch(e){}}var r=function(){var e;return Se.current&&(e=new y.Z((function(e){var t,n=l()(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&Ee.current.instance.layout()}}catch(e){n.e(e)}finally{n.f()}}))).observe(Se.current),e}();return we&&"string"==typeof we&&new j(we,t,K),Ie(!0),function(){var e=Ee.current.instance;e.dispose();var t=e.getModel();t&&t.dispose(),Ee.current.subscription&&Ee.current.subscription.dispose(),r.unobserve(Se.current)}}catch(e){}}))}),[]),(0,v.useEffect)((function(){if(Ee.current.instance&&je)return document.addEventListener("keydown",Oe,!1),function(){document.removeEventListener("keydown",Oe)}}),[J,je]),(0,v.useEffect)((function(){var e=Ee.current.instance;if(e&&je){var t=U(p);K.editor.setModelLanguage(e.getModel(),t)}}),[p,je]),(0,v.useEffect)((function(){Ee.current.instance&&je&&K.editor.setTheme(D)}),[D,je]),(0,v.useEffect)((function(){var e=Ee.current.instance;Me.current=_,e&&je&&(e.updateOptions(r()({},_)),setTimeout((function(){e.getModel().updateOptions(r()({},_))}),200))}),[JSON.stringify(_),je]),(0,v.useEffect)((function(){var e=Ee.current.instance;e&&je&&e.layout()}),[i,s,je]);var He=(0,v.useState)(G(i)),We=u()(He,2),Ge=We[0],Ve=(We[1],(0,v.useState)(G(s))),qe=u()(Ve,2),Ue=qe[0],Ke=qe[1],Ye=r()(r()({},S),{},{width:Ge,height:Ue,position:"relative"});return(0,H.jsx)("div",{className:"my-monaco-editor",ref:Se,style:Ye,children:X&&(0,H.jsx)(z.CopyToClipboard,{text:c,onCopy:function(){return R.ZP.success("复制成功")},children:(0,H.jsx)(O.Z,{title:"复制代码",children:(0,H.jsxs)("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"},children:[(0,H.jsx)("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," 复制代码"]})})})})};function J(e){var t=e.width,i=void 0===t?"100%":t,o=e.height,a=void 0===o?"100%":o,s=e.original,c=e.modified,d=e.language,h=e.options,p=void 0===h?{}:h,f=(0,v.useRef)(),m=(0,v.useState)(null),g=u()(m,2),x=g[0],b=g[1];(0,v.useEffect)((function(){return f.current&&Promise.all([n.e(8909),n.e(9404)]).then(n.bind(n,2550)).then((function(e){var t=(K=e).editor.createDiffEditor(f.current,r()(r()({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},p),{},{wordWrap:!0}));b(t);var n=function(e){var t;return f.current&&(t=new y.Z((function(t){var n,i=l()(t);try{for(i.s();!(n=i.n()).done;){var r=n.value;(r.target.offsetHeight>0||r.target.offsetWidth>0)&&e.layout()}}catch(e){i.e(e)}finally{i.f()}}))).observe(f.current),t}(t);return function(){t.dispose();var e=t.getModel();e&&e.dispose(),n.unobserve(f.current)}})),function(){window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}}),[]),(0,v.useEffect)((function(){x&&x.setModel({original:K.editor.createModel(s,d),modified:K.editor.createModel(c,d)})}),[s,c,d,x]);var w={width:G(i),height:G(a)};return(0,H.jsx)("div",{className:"my-diff-editor",ref:f,style:w})}},22336:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});var i=n(59301);function r(e,t){var n=(0,i.useRef)();(0,i.useEffect)((function(){n.current=e})),(0,i.useEffect)((function(){if(null!==t){var e=setInterval((function(){n.current()}),t);return function(){return clearInterval(e)}}}),[t])}},69933:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return He}});var i=n(7557),r=n.n(i),o=n(41498),a=n.n(o),s=n(82242),l=n.n(s),c=n(37205),u=n.n(c),d=n(79800),h=n.n(d),p=n(39647),f=n.n(p),m=n(59301),g=n(53260),v=n(93041),y=n(24404),x=n(28284),b=n(6767),w=n(37285),C=n(91882),k=n(77019),S=n(5269),E=n(25399),M=n(37568),T=n(99571),L=n(32134),_=n(68081),N=n(62957),A=n(62673),P=n(71051),D=n(94280),B=n(58358),j=n(74889),I="wrap___GtXAk",R="modal___mDuC3",O="titleWrap___EzCZh",Z="required___KgfdI",F="title___TMgfc",z="colorGray___xNVTs",H="choiceWrap___Rv9ug",W="answer___hVpls",G="activeAnswer___oJoq9",V="deleteIcon___bkn4b",q="addIcon___S2pDY",U="editorWrap___BOx_r",K="htmlWrap___ERVlQ",Y="radio___lrt5b",X="color333___pz3OT",J="color999___jtQ7e",Q="questionType___qUnUb",$="questionChoices___n36qp",ee=n(37712),te=["problemset","globalSetting","loading","dispatch","onRef","editData"],ne=["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"],ie=function(e,t){e.problemset,e.globalSetting,e.loading;var n=e.dispatch,i=(e.onRef,e.editData),o=(f()(e,te),(0,m.useState)([])),s=h()(o,2),c=s[0],d=s[1],p=(0,m.useState)(),v=h()(p,2),y=v[0],x=v[1],w=(0,m.useState)([]),C=h()(w,2),M=C[0],L=C[1],_=(0,m.useState)(""),R=h()(_,2),z=R[0],Y=R[1],X=(0,m.useState)(5),J=h()(X,2),ie=J[0],re=J[1],oe=(0,m.useState)(!1),ae=h()(oe,2),se=ae[0],le=ae[1],ce=(0,g.useParams)();(0,m.useEffect)((function(){d(["","","",""])}),[]),(0,m.useEffect)((function(){if(null!=i&&i.question_choices){Y(null==i?void 0:i.question_title),re(parseInt(null==i?void 0:i.question_score)),d(null==i?void 0:i.question_choices.map((function(e){return e.choice_text})));var e=[];null==i||i.standard_answer.map((function(t,n){e.push(t-1)})),L(e)}else le(!0)}),[i]),(0,m.useImperativeHandle)(t,(function(){return{onSave:de,isEdit:se}}));var ue,de=function(){var e=a()(r()().mark((function e(){var t,o,a;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(z){e.next=3;break}return b.ZP.info("请您输入题目"),e.abrupt("return",!1);case 3:if(!((t=c.findIndex((function(e){return!e})))>-1)){e.next=7;break}return b.ZP.info("请先输入 ".concat(ne[t]," 选项的内容")),e.abrupt("return",!1);case 7:if(M.length){e.next=10;break}return b.ZP.info("请设置本题的正确答案,点击选项A/B...即可完成设置"),e.abrupt("return",!1);case 10:if(!(M.length<1)){e.next=13;break}return b.ZP.info("请选择答案"),e.abrupt("return",!1);case 13:if(o=c.map((function(e,t){return{choice_text:e,is_answer:M.includes(t)?t+1:0}})),!i.question_id){e.next=20;break}return e.next=17,n({type:"exercise/editExerciseQuestion",payload:{id:i.question_id,question_title:z,question_type:1,question_score:"5.0",question_choices:o.map((function(e){return e.choice_text})),standard_answers:o.filter((function(e){return e.is_answer})).map((function(e){return e.is_answer}))}});case 17:a=e.sent,e.next=23;break;case 20:return e.next=22,n({type:"exercise/addExerciseQuestion",payload:{categoryId:ce.categoryId,question_title:z,question_type:1,question_score:"5.0",question_choices:o.map((function(e){return e.choice_text})),standard_answers:o.filter((function(e){return e.is_answer})).map((function(e){return e.is_answer}))}});case 22:a=e.sent;case 23:0===a.status&&(b.ZP.success("保存成功"),le(!1),n({type:"exercise/editExercise",payload:l()({},ce)}));case 24:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),he=[{name:"删除",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"上移",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"下移",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"编辑",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],pe=function(){var e=a()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.id,e.next="del"===e.t0?3:"up"===e.t0||"down"===e.t0?5:"edit"===e.t0?9:11;break;case 3:return N.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"确认要删除这个问题吗?",onOk:function(){return a()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,D.Fl)({id:i.question_id});case 2:n({type:"exercise/editExercise",payload:l()({},ce)});case 3:case"end":return e.stop()}}),e)})))()}}),e.abrupt("break",11);case 5:return e.next=7,n({type:"exercise/exeriseMoveUpDown",payload:{id:i.question_id,opr:t.id}});case 7:return n({type:"exercise/editExercise",payload:l()({},ce)}),e.abrupt("break",11);case 9:return le(!0),e.abrupt("break",11);case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,ee.jsxs)("section",{className:I,children:[!se&&(0,ee.jsxs)("aside",{children:[(0,ee.jsxs)("div",{className:Q,children:[(0,ee.jsxs)("div",{children:[(0,ee.jsxs)("span",{className:"font16 c-blue",children:[i.key,"、多选题"]}),"(",i.question_score,"分)"]}),!i.hideAction&&he.map((function(e,t){return"up"===e.id&&1===i.key||"down"===e.id&&i.key===i.len?null:(0,ee.jsx)(E.Z,{placement:"bottom",title:e.name,children:(0,ee.jsx)("span",{onClick:function(){return pe(e)},className:e.icon})},t)}))]}),(0,ee.jsx)("div",{className:"mt5",children:(0,ee.jsx)(j.Z,{value:i.question_title})}),(0,ee.jsx)("div",{className:$,children:null==i||null===(ue=i.question_choices)||void 0===ue?void 0:ue.map((function(e,t){return(0,ee.jsxs)(k.Z,{children:[(0,ee.jsx)(S.Z,{children:(0,ee.jsxs)(A.Z,{checked:i.standard_answer.includes(t+1),disabled:!0,children:[ne[t],"."]},t)}),(0,ee.jsx)(S.Z,{flex:"1",children:(0,ee.jsx)("span",{className:"c-black font14",children:(0,ee.jsx)(j.Z,{value:e.choice_text})})})]})}))})]}),se&&(0,ee.jsxs)("aside",{children:[(0,ee.jsx)("div",{className:Q,children:(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{className:"font16 c-blue",children:"选择题"}),"(客观题,由系统自动评分,请设置标准答案)"]})}),(0,ee.jsxs)("p",{className:O,children:[(0,ee.jsx)("span",{className:Z,children:"*"}),(0,ee.jsx)("span",{className:F,children:"题干:"})]}),(0,ee.jsx)(B.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:z,onChange:function(e){return Y(e)}}),c.map((function(e,t){return(0,ee.jsxs)("div",{className:H,children:[(0,ee.jsx)(E.Z,{title:"点击设置为标准答案",placement:"left",children:(0,ee.jsx)("div",{className:"".concat(W," ").concat(M.includes(t)?G:""),onClick:function(){M.includes(t)?L(M.filter((function(e){return e!==t}))):L([].concat(u()(M),[t]))},children:ne[t]})}),(0,ee.jsx)("div",{className:U,children:y===t?(0,ee.jsx)(B.Z,{id:"single-question-option-".concat(t),watch:!0,height:155,placeholder:"请您输入选项",defaultValue:e,onChange:function(e){c[t]=e,d(c)}}):(0,ee.jsx)("div",{className:K,onClick:function(){return x(t)},children:(0,ee.jsx)(j.Z,{value:e})})}),t>1&&(0,ee.jsx)(E.Z,{title:"删除",children:(0,ee.jsx)("i",{className:"".concat(V," iconfont icon-htmal5icon19"),onClick:function(){return d(c.filter((function(e,n){return n!==t})))}})}),t<7&&t===c.length-1&&(0,ee.jsx)(E.Z,{title:"新增参考答案",children:(0,ee.jsx)("i",{className:"".concat(q," iconfont icon-roundaddfill ml6"),onClick:function(){return d([].concat(u()(c),[""]))}})})]},t)})),(0,ee.jsx)("p",{className:"c-orange",children:"温馨提示:点击选项输入框可设置答案;选中的选项即为正确答案,选择多个答案即为多选题"}),(0,ee.jsxs)("p",{className:"",children:["分值:",(0,ee.jsx)(P.Z,{value:ie,max:1e4,min:-1,onChange:function(e){re(e)}})," 分"]}),(0,ee.jsxs)("aside",{className:"tr",children:[i.question_id&&(0,ee.jsx)(T.ZP,{type:"default",onClick:function(){return le(!1)},children:"取消"}),(0,ee.jsx)(T.ZP,{className:"ml20",type:"primary",onClick:function(){return de()},children:"保存"})]})]})]})},re=(0,g.connect)((function(e){var t=e.problemset,n=e.loading;return{problemset:t,globalSetting:e.globalSetting,loading:n.effects}}),null,null,{forwardRef:!0})((0,m.forwardRef)(ie)),oe=n(47889),ae=["problemset","globalSetting","loading","dispatch","onRef","editData"],se=["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"],le=function(e,t){e.problemset,e.globalSetting,e.loading;var n=e.dispatch,i=(e.onRef,e.editData),o=(f()(e,ae),(0,m.useState)([])),s=h()(o,2),c=s[0],d=s[1],p=(0,m.useState)(),v=h()(p,2),y=v[0],x=v[1],w=(0,m.useState)([]),C=h()(w,2),M=C[0],L=C[1],A=(0,m.useState)(""),D=h()(A,2),R=D[0],z=D[1],Y=(0,m.useState)(0),X=h()(Y,2),J=X[0],te=X[1],ne=(0,m.useState)(!1),ie=h()(ne,2),re=ie[0],le=ie[1],ce=(0,g.useParams)();(0,m.useEffect)((function(){d(["","","",""])}),[]),(0,m.useEffect)((function(){if(null!=i&&i.question_choices){z(null==i?void 0:i.question_title),te(parseInt(null==i?void 0:i.question_score)),d(null==i?void 0:i.question_choices.map((function(e){return e.choice_text})));var e=[];null==i||i.standard_answer.map((function(t,n){e.push(t-1)})),L(e)}else le(!0)}),[i]),(0,m.useImperativeHandle)(t,(function(){return{onSave:de,isEdit:re}}));var ue,de=function(){var e=a()(r()().mark((function e(){var t,o,a;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(R){e.next=3;break}return b.ZP.info("请您输入题目"),e.abrupt("return",!1);case 3:if(!((t=c.findIndex((function(e){return!e})))>-1)){e.next=7;break}return b.ZP.info("请先输入 ".concat(se[t]," 选项的内容")),e.abrupt("return",!1);case 7:if(M.length){e.next=10;break}return b.ZP.info("请设置本题的正确答案,点击选项A/B...即可完成设置"),e.abrupt("return",!1);case 10:if(!(M.length<1)){e.next=13;break}return b.ZP.info("请选择答案"),e.abrupt("return",!1);case 13:if(o=c.map((function(e,t){return{choice_text:e,is_answer:M.includes(t)?t+1:0}})),!i.question_id){e.next=20;break}return e.next=17,(0,_.Kc)({id:i.question_id,question_title:R,question_type:1,question_score:J,question_choices:o.map((function(e){return e.choice_text})),standard_answers:o.filter((function(e){return e.is_answer})).map((function(e){return e.is_answer}))});case 17:a=e.sent,e.next=23;break;case 20:return e.next=22,(0,_.iV)({exercise_bank_id:ce.topicId,question_title:R,question_type:1,question_score:"5.0",question_choices:o.map((function(e){return e.choice_text})),standard_answers:o.filter((function(e){return e.is_answer})).map((function(e){return e.is_answer}))});case 22:a=e.sent;case 23:return 0===a.status&&(b.ZP.success("保存成功"),le(!1)),e.next=26,n({type:"polls/getExerciseBanks",payload:l()({},ce)});case 26:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),he=[{name:"删除",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"上移",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"下移",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"编辑",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],pe=function(){var e=a()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.id,e.next="del"===e.t0?3:"up"===e.t0||"down"===e.t0?5:"edit"===e.t0?9:11;break;case 3:return N.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"确认要删除这个问题吗?",onOk:function(){return a()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.x$)({pollsId:i.question_id});case 2:n({type:"polls/getExerciseBanks",payload:l()({},ce)});case 3:case"end":return e.stop()}}),e)})))()}}),e.abrupt("break",11);case 5:return e.next=7,(0,_.W)({exerciseId:null==i?void 0:i.question_id,opr:t.id});case 7:return n({type:"polls/getExerciseBanks",payload:l()({},ce)}),e.abrupt("break",11);case 9:return le(!0),e.abrupt("break",11);case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,ee.jsxs)("section",{className:I,children:[!re&&(0,ee.jsxs)("aside",{children:[(0,ee.jsxs)("div",{className:Q,children:[(0,ee.jsxs)("div",{children:[(0,ee.jsxs)("span",{className:"font16 c-blue",children:[i.key,"、单选题"]}),"(",i.question_score,"分)"]}),!i.hideAction&&he.map((function(e,t){return"up"===e.id&&1===i.key||"down"===e.id&&i.key===i.len?null:(0,ee.jsx)(E.Z,{placement:"bottom",title:e.name,children:(0,ee.jsx)("span",{onClick:function(){return pe(e)},className:e.icon})},t)}))]}),(0,ee.jsx)("div",{className:"mt5",children:(0,ee.jsx)(j.Z,{value:i.question_title})}),(0,ee.jsx)("div",{className:$,children:null==i||null===(ue=i.question_choices)||void 0===ue?void 0:ue.map((function(e,t){return(0,ee.jsxs)(k.Z,{children:[(0,ee.jsx)(S.Z,{children:(0,ee.jsxs)(oe.ZP,{checked:i.standard_answer.includes(t+1),disabled:!0,children:[se[t],"."]},t)}),(0,ee.jsx)(S.Z,{flex:"1",children:(0,ee.jsx)("span",{className:"c-black font14",children:(0,ee.jsx)(j.Z,{value:e.choice_text})})})]})}))})]}),re&&(0,ee.jsxs)("aside",{children:[(0,ee.jsx)("div",{className:Q,children:(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{className:"font16 c-blue",children:"选择题"}),"(客观题,由系统自动评分,请设置标准答案)"]})}),(0,ee.jsxs)("p",{className:O,children:[(0,ee.jsx)("span",{className:Z,children:"*"}),(0,ee.jsx)("span",{className:F,children:"题干:"})]}),(0,ee.jsx)(B.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:R,onChange:function(e){return z(e)}}),c.map((function(e,t){return(0,ee.jsxs)("div",{className:H,children:[(0,ee.jsx)(E.Z,{title:"点击设置为标准答案",placement:"left",children:(0,ee.jsx)("div",{className:"".concat(W," ").concat(M.includes(t)?G:""),onClick:function(){M.includes(t)?L(M.filter((function(e){return e!==t}))):L([].concat(u()(M),[t]))},children:se[t]})}),(0,ee.jsx)("div",{className:U,children:y===t?(0,ee.jsx)(B.Z,{id:"single-question-option-".concat(t),watch:!0,height:155,placeholder:"请您输入选项",defaultValue:e,onChange:function(e){c[t]=e,d(c)}}):(0,ee.jsx)("div",{className:K,onClick:function(){return x(t)},children:(0,ee.jsx)(j.Z,{value:e})})}),t>1&&(0,ee.jsx)(E.Z,{title:"删除",children:(0,ee.jsx)("i",{className:"".concat(V," iconfont icon-htmal5icon19"),onClick:function(){return d(c.filter((function(e,n){return n!==t})))}})}),t<7&&t===c.length-1&&(0,ee.jsx)(E.Z,{title:"新增参考答案",children:(0,ee.jsx)("i",{className:"".concat(q," iconfont icon-roundaddfill ml6"),onClick:function(){return d([].concat(u()(c),[""]))}})})]},t)})),(0,ee.jsx)("p",{className:"c-orange",children:"温馨提示:点击选项输入框可设置答案;选中的选项即为正确答案,选择多个答案即为多选题"}),(0,ee.jsxs)("p",{className:"",children:["分值:",(0,ee.jsx)(P.Z,{value:J,max:1e4,min:-1,onChange:function(e){te(e)}})," 分"]}),(0,ee.jsxs)("aside",{className:"tr",children:[i.question_id&&(0,ee.jsx)(T.ZP,{type:"default",onClick:function(){return le(!1)},children:"取消"}),(0,ee.jsx)(T.ZP,{className:"ml20",type:"primary",onClick:function(){return de()},children:"保存"})]})]})]})},ce=(0,g.connect)((function(e){var t=e.problemset,n=e.loading;return{problemset:t,globalSetting:e.globalSetting,loading:n.effects}}),null,null,{forwardRef:!0})((0,m.forwardRef)(le)),ue=["problemset","globalSetting","loading","dispatch","onRef","editData"],de=["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"],he=function(e,t){e.problemset,e.globalSetting,e.loading;var n=e.dispatch,i=(e.onRef,e.editData),o=(f()(e,ue),(0,m.useState)()),s=h()(o,2),c=s[0],u=s[1],d=(0,m.useState)(""),p=h()(d,2),v=p[0],y=p[1],x=(0,m.useState)(!1),w=h()(x,2),C=w[0],k=w[1],S=(0,m.useState)(5),M=h()(S,2),L=M[0],A=M[1],D=(0,g.useParams)();(0,m.useEffect)((function(){null!=i&&i.question_choices?(y(null==i?void 0:i.question_title),A(null==i?void 0:i.question_score),u(i.standard_answer[0]+"")):k(!0)}),[i]),(0,m.useImperativeHandle)(t,(function(){return{onSave:R,isEdit:C}}));var j,R=function(){var e=a()(r()().mark((function e(){var t,o;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(v){e.next=3;break}return b.ZP.info("请您输入题干"),e.abrupt("return",!1);case 3:if(c){e.next=6;break}return b.ZP.info("请先点击选择本选择题的正确选项"),e.abrupt("return",!1);case 6:if(t=[{choice_text:"正确",is_answer:"1"===c?1:0},{choice_text:"错误",is_answer:"2"===c?2:0}],!i.question_id){e.next=13;break}return e.next=10,(0,_.Kc)({id:i.question_id,question_title:v,question_type:2,question_score:L,question_choices:t.map((function(e){return e.choice_text})),standard_answers:t.filter((function(e){return e.is_answer})).map((function(e){return e.is_answer}))});case 10:o=e.sent,e.next=16;break;case 13:return e.next=15,(0,_.iV)({exercise_bank_id:D.topicId,question_title:v,question_type:2,question_score:L,question_choices:t.map((function(e){return e.choice_text})),standard_answers:t.filter((function(e){return e.is_answer})).map((function(e){return e.is_answer}))});case 15:o=e.sent;case 16:return 0===o.status&&(b.ZP.success("保存成功"),k(!1)),n({type:"polls/getExerciseBanks",payload:l()({},D)}),e.abrupt("return",{name:v,choices:t});case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),H=[{name:"删除",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"上移",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"下移",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"编辑",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],W=function(){var e=a()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.id,e.next="del"===e.t0?3:"up"===e.t0||"down"===e.t0?5:"edit"===e.t0?9:11;break;case 3:return N.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"确认要删除这个问题吗?",onOk:function(){return a()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.x$)({pollsId:i.question_id});case 2:n({type:"polls/getExerciseBanks",payload:l()({},D)});case 3:case"end":return e.stop()}}),e)})))()}}),e.abrupt("break",11);case 5:return e.next=7,(0,_.W)({exerciseId:null==i?void 0:i.question_id,opr:t.id});case 7:return n({type:"polls/getExerciseBanks",payload:l()({},D)}),e.abrupt("break",11);case 9:return k(!0),e.abrupt("break",11);case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,ee.jsxs)("section",{className:I,children:[!C&&(0,ee.jsxs)("aside",{children:[(0,ee.jsxs)("div",{className:Q,children:[(0,ee.jsxs)("div",{children:[(0,ee.jsxs)("span",{className:"font16 c-blue",children:[i.key,"、判断题"]}),"(",i.question_score,"分)"]}),!i.hideAction&&H.map((function(e,t){return"up"===e.id&&1===i.key||"down"===e.id&&i.key===i.len?null:(0,ee.jsx)(E.Z,{placement:"bottom",title:e.name,children:(0,ee.jsx)("span",{onClick:function(){return W(e)},className:e.icon})},t)}))]}),(0,ee.jsx)("div",{className:"mt5",children:i.question_title}),(0,ee.jsx)("div",{className:$,children:null==i||null===(j=i.question_choices)||void 0===j?void 0:j.map((function(e,t){return(0,ee.jsxs)(oe.ZP,{checked:i.standard_answer.includes(t+1),disabled:!0,children:[de[t],". ",(0,ee.jsx)("span",{className:"c-black font14",children:e.choice_text})]},t)}))})]}),C&&(0,ee.jsxs)("aside",{children:[(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{className:"font16 c-blue",children:"判断题"}),"(客观题,由系统自动评分,请设置标准答案)"]}),(0,ee.jsxs)("p",{className:O,children:[(0,ee.jsx)("span",{className:Z,children:"*"}),(0,ee.jsx)("span",{className:F,children:"题干:"})]}),(0,ee.jsx)(B.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:v,onChange:function(e){return y(e)}}),(0,ee.jsxs)("p",{className:O,children:[(0,ee.jsx)("span",{className:Z,children:"*"}),(0,ee.jsxs)("span",{className:F,children:["答案选项:",(0,ee.jsx)("span",{className:z,children:"点击选项可设置正确答案"})]})]}),(0,ee.jsxs)(oe.ZP.Group,{buttonStyle:"solid",value:c,onChange:function(e){return u(e.target.value)},children:[(0,ee.jsx)(oe.ZP.Button,{value:"1",className:"".concat(Y," mr40"),children:"正确"}),(0,ee.jsx)(oe.ZP.Button,{value:"2",className:Y,children:"错误"})]}),(0,ee.jsx)("p",{className:"c-orange",children:"温馨提示:点击选项,可以直接设置标准答案"}),(0,ee.jsxs)("p",{className:"",children:["分值:",(0,ee.jsx)(P.Z,{value:L,max:1e4,min:-1,onChange:function(e){A(e)}})," 分"]}),(0,ee.jsxs)("aside",{className:"tr",children:[i.question_id&&(0,ee.jsx)(T.ZP,{type:"default",onClick:function(){return k(!1)},children:"取消"}),(0,ee.jsx)(T.ZP,{className:"ml20",type:"primary",onClick:function(){return R()},children:"保存"})]})]})]})},pe=(0,g.connect)((function(e){var t=e.problemset,n=e.loading;return{problemset:t,globalSetting:e.globalSetting,loading:n.effects}}),null,null,{forwardRef:!0})((0,m.forwardRef)(he)),fe=n(38375),me=n(28791),ge=n(83287),ve=["problemset","globalSetting","loading","dispatch","editData"],ye=function(e,t){var n=e.problemset,i=(e.globalSetting,e.loading,e.dispatch),o=e.editData,s=(f()(e,ve),(0,m.useState)("")),c=h()(s,2),d=c[0],p=c[1],v=(0,m.useState)(""),y=h()(v,2),x=y[0],w=(y[1],(0,m.useState)([])),C=h()(w,2),L=C[0],D=C[1],B=(0,m.useState)(""),j=h()(B,2),O=j[0],Z=j[1],F=(0,m.useState)(),z=h()(F,2),H=z[0],W=z[1],G=(0,m.useState)(!1),V=h()(G,2),q=V[0],U=V[1],K=(0,m.useState)(5),Y=h()(K,2),te=Y[0],ne=Y[1],ie=(0,m.useState)(!1),re=h()(ie,2),oe=re[0],ae=re[1],se=(0,g.useParams)();(0,m.useEffect)((function(){if(null!=o&&o.question_title){p(null==o?void 0:o.question_title),W(null==o?void 0:o.is_ordered),ne(null==o?void 0:o.question_score);var e=null==o?void 0:o.standard_answer.map((function(e){return e.answer_text}));D(e)}else ae(!0)}),[n.editData]),(0,m.useEffect)((function(){U(!1)}),[oe]),(0,m.useImperativeHandle)(t,(function(){return{onSave:ce,isEdit:oe}}));var le,ce=function(){var e=a()(r()().mark((function e(){var t,n,a;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=[],n=!1,L.forEach((function(e,i){t.push({choice_id:i+1,answer_text:[]}),e.forEach((function(e,r){t[i].answer_text.push(e),e&&(0,ge.eR)(e,1e4)||(Z("".concat(i,"-").concat(r)),b.ZP.info(e?"答案不能超过10000字符":"答案:不能为空"),n=!0)}))})),!n){e.next=5;break}return e.abrupt("return",!1);case 5:if(!o.question_id){e.next=11;break}return e.next=8,(0,_.Kc)({id:o.question_id,question_title:d,question_type:3,question_score:te,is_ordered:H,standard_answers:t});case 8:a=e.sent,e.next=14;break;case 11:return e.next=13,(0,_.iV)({exercise_bank_id:se.topicId,question_title:d,question_type:3,question_score:te,is_ordered:H,standard_answers:t});case 13:a=e.sent;case 14:return 0===a.status&&(b.ZP.success("保存成功"),ae(!1)),i({type:"polls/getExerciseBanks",payload:l()({},se)}),e.abrupt("return",{name:d,analysis:x,standard_answers:t,is_ordered:H});case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ue=function(e,t,n){var i=L.slice();if(t&&i.splice(e,t),n&&q)for(var r=0;r<n;r++)i.splice(e+r,0,[""]);U(!0),D(i)},de=function(e,t,n){Z("");var i=L.slice();i[e][t]=n,D(i)},he=function(e){var t=L.slice();t[e]=[].concat(u()(t[e]),[""]),D(t)},pe=function(e,t){var n=L.slice();if(!n[e][t])return n[e]=n[e].filter((function(e,n){return n!==t})),void D(n);N.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:R,onOk:function(){n[e]=n[e].filter((function(e,n){return n!==t})),D(n)}})},ye=function(e){N.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:R,onOk:function(){var t=L.slice();t=L.filter((function(t,n){return e!==n})),D(t)}})},xe=[{name:"删除",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"上移",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"下移",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"编辑",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],be=function(){var e=a()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.id,e.next="del"===e.t0?3:"up"===e.t0||"down"===e.t0?5:"edit"===e.t0?9:11;break;case 3:return N.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"确认要删除这个问题吗?",onOk:function(){return a()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.x$)({pollsId:o.question_id});case 2:i({type:"polls/getExerciseBanks",payload:l()({},se)});case 3:case"end":return e.stop()}}),e)})))()}}),e.abrupt("break",11);case 5:return e.next=7,(0,_.W)({exerciseId:null==o?void 0:o.question_id,opr:t.id});case 7:return i({type:"polls/getExerciseBanks",payload:l()({},se)}),e.abrupt("break",11);case 9:return ae(!0),e.abrupt("break",11);case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,ee.jsxs)("section",{className:I,children:[!oe&&(0,ee.jsxs)("aside",{children:[(0,ee.jsxs)("div",{className:Q,children:[(0,ee.jsxs)("div",{children:[(0,ee.jsxs)("span",{className:"font16 c-blue",children:[o.key,"、填空题"]}),"(",o.question_score,"分)"]}),!o.hideAction&&xe.map((function(e,t){return"up"===e.id&&1===o.key||"down"===e.id&&o.key===o.len?null:(0,ee.jsx)(E.Z,{placement:"bottom",title:e.name,children:(0,ee.jsx)("span",{onClick:function(){return be(e)},className:e.icon})},t)}))]}),(0,ee.jsx)("div",{className:"mt5",children:o.question_title}),(0,ee.jsx)("div",{className:$,children:null==o||null===(le=o.standard_answer)||void 0===le?void 0:le.map((function(e,t){return(0,ee.jsxs)(k.Z,{children:[(0,ee.jsxs)(S.Z,{children:["答案(填空",e.choice_id,"):"]}),(0,ee.jsx)(S.Z,{flex:"1",children:(0,ee.jsx)(M.Z,{checked:o.standard_answer.includes(t),disabled:!0,value:e.answer_text},t)})]})}))})]}),oe&&(0,ee.jsxs)("aside",{children:[(0,ee.jsx)("div",{className:Q,children:(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{className:"font16 c-blue",children:"填空题"}),"(客观题,由系统自动评分,允许手动调分,请设置标准答案 ;支持最多5个空,每空得分按照本题的总分平均计算)"]})}),(0,ee.jsx)("div",{children:(0,ee.jsx)(fe.Z,{id:"completion-question-tittle",placeholder:"请您输入题目",height:155,defaultValue:d,onChange:function(e){return p(e)},showNullButton:!0,onPlaceholderChange:ue})}),(0,ee.jsx)("div",{className:"mt20",children:L.map((function(e,t){return(0,ee.jsx)(me.Z,{answers:e,index:t,is_md:!0,activeOptionErrorIndex:O,onAnswerChange:de,addChildAnswer:he,deleteChildAnswer:pe,deleteChildAnswermain:ye},t)}))}),(0,ee.jsx)("div",{className:"mt20",children:L.length>1&&(0,ee.jsxs)("span",{children:[(0,ee.jsx)(A.Z,{checked:H,onChange:function(e){return W(e.target.checked)},className:"".concat(X," font14"),children:"多个填空的答案有顺序要求"}),(0,ee.jsx)("span",{className:"".concat(J," font12"),children:"(选中,每个填空的答案顺序必须与参考答案一致)"})]})}),(0,ee.jsxs)("p",{className:"",children:["分值:",(0,ee.jsx)(P.Z,{value:te,max:1e4,min:-1,onChange:function(e){ne(e)}})," 分"]}),(0,ee.jsxs)("aside",{className:"tr",children:[o.question_id&&(0,ee.jsx)(T.ZP,{type:"default",onClick:function(){return ae(!1)},children:"取消"}),(0,ee.jsx)(T.ZP,{className:"ml20",type:"primary",onClick:function(){return ce()},children:"保存"})]})]})]})},xe=(0,g.connect)((function(e){var t=e.problemset,n=e.loading;return{problemset:t,globalSetting:e.globalSetting,loading:n.effects}}),null,null,{forwardRef:!0})((0,m.forwardRef)(ye)),be=["problemset","globalSetting","loading","dispatch","onRef","editData"],we=function(e,t){var n=e.problemset,i=(e.globalSetting,e.loading,e.dispatch),o=(e.onRef,e.editData),s=(f()(e,be),(0,m.useState)("")),c=h()(s,2),u=c[0],d=c[1],p=(0,m.useState)(""),v=h()(p,2),y=v[0],x=(v[1],(0,m.useState)("")),w=h()(x,2),C=w[0],k=w[1],S=(0,m.useState)(5),M=h()(S,2),L=M[0],A=M[1],D=(0,m.useState)(!1),R=h()(D,2),Z=R[0],z=R[1],H=(0,g.useParams)();(0,m.useEffect)((function(){var e;null!=o&&o.question_title?(d(null==o?void 0:o.question_title),k(null==o||null===(e=o.standard_answer)||void 0===e?void 0:e[0]),A(null==o?void 0:o.question_score)):z(!0)}),[n.editData]),(0,m.useImperativeHandle)(t,(function(){return{onSave:W,isEdit:Z}}));var W=function(){var e=a()(r()().mark((function e(){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u){e.next=3;break}return b.ZP.info("请您输入题干"),e.abrupt("return",!1);case 3:if(!o.question_id){e.next=9;break}return e.next=6,(0,_.Kc)({id:o.question_id,question_title:u,question_type:4,question_score:L,standard_answers:[C]});case 6:t=e.sent,e.next=12;break;case 9:return e.next=11,(0,_.iV)({exercise_bank_id:H.topicId,question_title:u,question_type:4,question_score:L,standard_answers:[C]});case 11:t=e.sent;case 12:return 0===t.status&&(b.ZP.success("保存成功"),z(!1),i({type:"polls/getExerciseBanks",payload:l()({},H)})),e.abrupt("return",{name:u,answer_texts:[C],analysis:y});case 14:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),G=[{name:"删除",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"上移",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"下移",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"编辑",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],V=function(){var e=a()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.id,e.next="del"===e.t0?3:"up"===e.t0||"down"===e.t0?5:"edit"===e.t0?9:11;break;case 3:return N.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"确认要删除这个问题吗?",onOk:function(){return a()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.x$)({pollsId:o.question_id});case 2:i({type:"polls/getExerciseBanks",payload:l()({},H)});case 3:case"end":return e.stop()}}),e)})))()}}),e.abrupt("break",11);case 5:return e.next=7,(0,_.W)({exerciseId:null==o?void 0:o.question_id,opr:t.id});case 7:return i({type:"polls/getExerciseBanks",payload:l()({},H)}),e.abrupt("break",11);case 9:return z(!0),e.abrupt("break",11);case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,ee.jsxs)("section",{className:I,children:[!Z&&(0,ee.jsxs)("aside",{children:[(0,ee.jsxs)("div",{className:Q,children:[(0,ee.jsxs)("div",{children:[(0,ee.jsxs)("span",{className:"font16 c-blue",children:[o.key,"、简答题"]}),"(",o.question_score,"分)"]}),!o.hideAction&&G.map((function(e,t){return"up"===e.id&&1===o.key||"down"===e.id&&o.key===o.len?null:(0,ee.jsx)(E.Z,{placement:"bottom",title:e.name,children:(0,ee.jsx)("span",{onClick:function(){return V(e)},className:e.icon})},t)}))]}),(0,ee.jsx)("div",{className:"mt5",children:o.question_title}),(0,ee.jsxs)("div",{className:$,children:[(0,ee.jsx)("p",{children:(0,ee.jsx)("strong",{children:"参考答案:"})}),(0,ee.jsx)(j.Z,{value:C})]})]}),Z&&(0,ee.jsxs)("aside",{children:[(0,ee.jsx)("div",{className:Q,children:(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{className:"font16 c-blue",children:"简答题"}),"(主观题,未作答的情况下自动评为零分)"]})}),(0,ee.jsx)(B.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:u,onChange:function(e){return d(e)}}),(0,ee.jsx)("p",{className:O,children:(0,ee.jsx)("span",{className:F,children:"参考答案:"})}),(0,ee.jsx)(B.Z,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"请您输入参考答案",defaultValue:C,onChange:function(e){return k(e)}}),(0,ee.jsxs)("p",{className:"",children:["分值:",(0,ee.jsx)(P.Z,{value:L,max:1e4,min:-1,onChange:function(e){A(e)}})," 分"]}),(0,ee.jsxs)("aside",{className:"tr",children:[o.question_id&&(0,ee.jsx)(T.ZP,{type:"default",onClick:function(){return z(!1)},children:"取消"}),(0,ee.jsx)(T.ZP,{className:"ml20",type:"primary",onClick:function(){return W()},children:"保存"})]})]})]})},Ce=(0,g.connect)((function(e){var t=e.problemset,n=e.loading;return{problemset:t,globalSetting:e.globalSetting,loading:n.effects}}),null,null,{forwardRef:!0})((0,m.forwardRef)(we)),ke=["problemset","globalSetting","loading","dispatch","editData"],Se=function(e,t){e.problemset,e.globalSetting,e.loading;var n=e.dispatch,i=e.editData,o=(f()(e,ke),(0,m.useState)("")),s=h()(o,2),c=s[0],u=s[1],d=(0,m.useState)(""),p=h()(d,2),v=p[0],y=p[1],x=(0,m.useState)(""),w=h()(x,2),C=w[0],L=(w[1],(0,m.useState)([])),D=h()(L,2),j=D[0],R=(D[1],(0,m.useState)("")),O=h()(R,2),Z=(O[0],O[1],(0,m.useState)()),F=h()(Z,2),z=F[0],H=F[1],W=(0,m.useState)(!1),G=h()(W,2),V=(G[0],G[1]),q=(0,m.useState)([]),U=h()(q,2),K=U[0],Y=U[1],$=(0,m.useState)(!1),te=h()($,2),ne=te[0],ie=te[1],re=(0,g.useParams)();(0,m.useEffect)((function(){var e;i.edit&&ie(!0),u(i.shixun_name),y(i.question_title);var t=[];null===(e=i.shixun)||void 0===e||e.map((function(e){t.push(e.challenge_score)})),Y(t)}),[i]),(0,m.useEffect)((function(){V(!1)}),[ne]),(0,m.useImperativeHandle)(t,(function(){return{onSave:se,isEdit:ne}}));var oe,ae,se=function(){var e=a()(r()().mark((function e(){var t,o;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=[],!1,e.next=4;break;case 4:if(!i.question_id){e.next=10;break}return e.next=7,(0,_.Kc)({id:i.question_id,question_title:v,shixun_name:c,shixun_id:i.shixun_id,question_type:5,question_scores:K});case 7:o=e.sent,e.next=13;break;case 10:return e.next=12,(0,_.iV)({exercise_bank_id:re.topicId,question_title:v,shixun_name:c,shixun_id:i.shixun_id,question_type:5,question_scores:K});case 12:o=e.sent;case 13:return 0===o.status&&(b.ZP.success("保存成功"),ie(!1)),e.next=16,n({type:"polls/getExerciseBanks",payload:l()({},re)});case 16:return e.abrupt("return",{name:v,analysis:C,standard_answers:t,is_ordered:z});case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),le=[{name:"删除",icon:"iconfont c-light-black ml30 icon-shanchu",id:"del"},{name:"上移",icon:"iconfont c-green ml30 icon-shangyi_Hover",id:"up"},{name:"下移",icon:"iconfont c-green ml30 icon-xiayi_moren",id:"down"},{name:"编辑",icon:"iconfont c-green ml30 icon-bianjishijuan3x",id:"edit"}],ce=function(){var e=a()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.id,e.next="del"===e.t0?3:"up"===e.t0||"down"===e.t0?5:"edit"===e.t0?9:11;break;case 3:return N.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"确认要删除这个问题吗?",onOk:function(){return a()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.x$)({pollsId:i.question_id});case 2:n({type:"polls/getExerciseBanks",payload:l()({},re)});case 3:case"end":return e.stop()}}),e)})))()}}),e.abrupt("break",11);case 5:return e.next=7,(0,_.W)({exerciseId:null==i?void 0:i.question_id,opr:t.id});case 7:return n({type:"polls/getExerciseBanks",payload:l()({},re)}),e.abrupt("break",11);case 9:return ie(!0),e.abrupt("break",11);case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,ee.jsxs)("section",{className:I,children:[!ne&&(0,ee.jsxs)("aside",{children:[(0,ee.jsxs)("div",{className:Q,children:[(0,ee.jsxs)("div",{children:[(0,ee.jsxs)("span",{className:"font16 c-blue",children:[i.key,"、实训题"]}),"(",i.question_score,"分)"]}),(0,ee.jsxs)("div",{className:"tr",children:[(0,ee.jsx)(g.Link,{target:"_blank",to:"/shixuns/".concat(i.shixun_identifier,"/challenges"),children:"实训详情"}),!i.hideAction&&le.map((function(e,t){return"up"===e.id&&1===i.key||"down"===e.id&&i.key===i.len?null:(0,ee.jsx)(E.Z,{placement:"bottom",title:e.name,children:(0,ee.jsx)("span",{onClick:function(){return ce(e)},className:e.icon})},t)}))]})]}),(0,ee.jsx)("div",{className:"font16",children:i.shixun_name}),(0,ee.jsx)("div",{className:"mt30"}),null===(ae=i.shixun)||void 0===ae?void 0:ae.map((function(e,t){return(0,ee.jsxs)("div",{children:["第",t+1,"关 ",(0,ee.jsx)("span",{className:"ml10",children:e.challenge_name})," ",(0,ee.jsx)("span",{className:"ml10",children:e.challenge_score})]},t)}))]}),ne&&(0,ee.jsxs)("aside",{children:[(0,ee.jsx)("div",{className:Q,children:(0,ee.jsxs)("div",{children:[(0,ee.jsx)("span",{className:"font16 c-blue",children:"实训题"}),"(客观题,由系统自动评分,允许手动调分)"]})}),(0,ee.jsx)("div",{className:"mt10",children:(0,ee.jsx)(M.Z,{defaultValue:c,onChange:function(e){u(e.target.value)}})}),(0,ee.jsx)("div",{className:"mt10",children:(0,ee.jsx)(B.Z,{id:"single-question-option-0",height:155,placeholder:"请输入实训题完成要求",defaultValue:v,onChange:function(e){y(e)}})}),(0,ee.jsx)("div",{className:"mt20",children:null===(oe=i.shixun)||void 0===oe?void 0:oe.map((function(e,t){return(0,ee.jsxs)(k.Z,{gutter:[20,20],children:[(0,ee.jsxs)(S.Z,{flex:"1",children:[t+1,".",e.challenge_name]}),(0,ee.jsx)(S.Z,{children:(0,ee.jsx)(P.Z,{defaultValue:K[t],onChange:function(e){K[t]=e,Y(K),console.log("srore:L",K[t])}})})]})}))}),(0,ee.jsx)("div",{className:"mt20",children:j.length>1&&(0,ee.jsxs)("span",{children:[(0,ee.jsx)(A.Z,{checked:z,onChange:function(e){return H(e.target.checked)},className:"".concat(X," font14"),children:"多个填空的答案有顺序要求"}),(0,ee.jsx)("span",{className:"".concat(J," font12"),children:"(选中,每个填空的答案顺序必须与参考答案一致)"})]})}),(0,ee.jsxs)("aside",{className:"tr",children:[!(null!=i&&i.edit)&&(0,ee.jsx)(T.ZP,{type:"default",onClick:function(){return ie(!1)},children:"取消"}),(0,ee.jsx)(T.ZP,{className:"ml20",type:"primary",onClick:function(){return se()},children:"保存"})]})]})]})},Ee=(0,g.connect)((function(e){var t=e.problemset,n=e.loading;return{problemset:t,globalSetting:e.globalSetting,loading:n.effects}}),null,null,{forwardRef:!0})((0,m.forwardRef)(Se)),Me=n(30641),Te=n(13747),Le="drawer___aMsAr",_e="menu___EdF6h",Ne="actived___rUgO6",Ae="listItem___Ixzli",Pe="info___KHkuz",De="title___pDJPn",Be="titleLeft___UBBKz",je="search___AEwRm",Ie="description___CYPQc",Re=M.Z.Search,Oe=[{id:"type",name:"筛选",children:[{name:"全部实训",id:"all",type:"type"},{name:"我的实训",id:"mine",type:"type"}]},{id:"diff",name:"难度",children:[{name:"全部",id:"",type:"diff"},{name:"初级",id:1,type:"diff"},{name:"中级",id:2,type:"diff"},{name:"中高级",id:3,type:"diff"},{name:"高级",id:4,type:"diff"}]}],Ze=(0,g.connect)((function(e){return{classroomList:e.classroomList,loading:e.loading}}))((function(e){var t,n=e.classroomList,i=(e.loading,e.dispatch),o=e.callback,s=(0,g.useParams)(),c=((0,g.useLocation)(),n.actionTabs,x.Z.useForm()),u=(h()(c,1)[0],n.shixunLists),d=(0,m.useState)([]),p=h()(d,2),f=p[0],v=p[1],y=(0,m.useState)({page:1,type:"all",diff:"",status:"published",order:"desc",limit:20,sort:"publish_time",no_jupyter:1}),C=h()(y,2),k=C[0],S=C[1];return(0,m.useEffect)((function(){i({type:"classroomList/getShixunLists",payload:l()({},k)})}),[s.categoryId]),(0,m.useEffect)((function(){v([])}),[n.actionTabs.key]),"选用实践项目"!==n.actionTabs.key?null:(0,ee.jsxs)(Me.Z,{title:"选用实践项目",placement:"bottom",height:"100%",closable:!1,open:"选用实践项目"===n.actionTabs.key,rootClassName:Le,footer:(0,ee.jsxs)("div",{className:"tc",children:[(0,ee.jsx)(T.ZP,{size:"middle",onClick:function(){i({type:"classroomList/setActionTabs",payload:{key:""}})},style:{marginRight:8},children:"取消"}),(0,ee.jsx)(T.ZP,{size:"middle",onClick:a()(r()().mark((function e(){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f.length>1?b.ZP.error("只能选择一个实践项目"):0===f.length?b.ZP.error("请选择实践项目"):(o&&o(null==u||null===(t=u.shixun_list)||void 0===t?void 0:t.filter((function(e){return e.id===f[0]}))[0]),i({type:"classroomList/setActionTabs",payload:{key:""}}));case 1:case"end":return e.stop()}}),e)}))),type:"primary",children:"确定"})]}),children:[(0,ee.jsx)("section",{className:"tc",children:(0,ee.jsx)(Re,{placeholder:"实训信息/院校名称/创建者",enterButton:"搜索",size:"middle",className:je,onSearch:function(e){k.keyword=e,i({type:"classroomList/getShixunLists",payload:l()({},k)})}})}),(0,ee.jsxs)("section",{className:"edu-container",children:[Oe.map((function(e,t){var n;return(0,ee.jsxs)("ul",{className:_e,children:[(0,ee.jsx)("li",{children:e.name}),null==e||null===(n=e.children)||void 0===n?void 0:n.map((function(t,n){return(0,ee.jsx)("li",{className:k[e.id]==t.id?Ne:"",onClick:function(){k[e.id]=t.id,S(l()({},k)),i({type:"classroomList/getShixunLists",payload:l()({},k)})},children:(0,ee.jsx)("strong",{children:t.name})},n)}))]},t)})),null==u||null===(t=u.shixun_list)||void 0===t?void 0:t.map((function(e,t){return(0,ee.jsxs)("div",{className:Ae,children:[(0,ee.jsx)(A.Z,{checked:f.includes(e.id),value:e.id,onChange:function(t){f.indexOf(e.id);f.indexOf(e.id)>-1?v(f.filter((function(t){return t!==e.id}))):v(f.concat(e.id))}}),(0,ee.jsxs)("div",{className:Pe,children:[(0,ee.jsx)("div",{className:De,children:(0,ee.jsx)("div",{className:Be,children:(0,ee.jsx)("strong",{className:"font16",dangerouslySetInnerHTML:{__html:e.title}})})}),(0,ee.jsx)("div",{className:"flex-wrp mt10 font14 c-light-black",children:(0,ee.jsx)("span",{className:Ie,dangerouslySetInnerHTML:{__html:e.description}})}),(0,ee.jsx)("div",{className:" mt15",children:e.challenge_names.map((function(e,t){return(0,ee.jsxs)("span",{className:"mr30",children:["第",t+1,"关 ",e," "]},t)}))}),(0,ee.jsx)(w.Z,{dashed:!0}),(0,ee.jsxs)("div",{className:"c-light-black mt20",children:[(0,ee.jsx)("span",{children:e.author_name}),(0,ee.jsx)("span",{className:"ml15 mr15",children:"|"}),(0,ee.jsx)("span",{children:e.author_school_name}),(0,ee.jsx)("span",{className:"ml15 mr15",children:"|"}),(0,ee.jsxs)("span",{children:["难度系数:",e.level]}),(0,ee.jsx)("span",{className:"ml15 mr15",children:"|"}),(0,ee.jsx)("span",{children:"学习人数:"}),(0,ee.jsx)("span",{children:e.study_count})]})]})]},t)})),(0,ee.jsx)("p",{})]}),(0,ee.jsx)("div",{className:"tc",children:(0,ee.jsx)(Te.Z,{defaultCurrent:1,hideOnSinglePage:!0,defaultPageSize:20,showQuickJumper:!0,total:null==u?void 0:u.shixuns_count,onChange:function(e){k.page=e,v([]),i({type:"classroomList/getShixunLists",payload:l()({},k)})}})})]},"bottom")})),Fe={flex_box_center:"flex_box_center___SQWFF",flex_space_between:"flex_space_between___CnFKV",flex_box_vertical_center:"flex_box_vertical_center___pIPP9",flex_box_center_end:"flex_box_center_end___wiYA8",flex_box_column:"flex_box_column___elCPc",bg:"bg___EaPuT",containerTitle:"containerTitle___ixpkx",containerDesc:"containerDesc___r2R0u",listItem:"listItem___jvD98",info:"info___dCwGz",title:"title___UW6TT",titleLeft:"titleLeft___MquHc",titleRight:"titleRight___aWhE3",acitons:"acitons___yle7y"},ze=["polls","globalSetting","loading","user","dispatch"],He=(v.Z.SubMenu,y.Z.Content,y.Z.Sider,(0,g.connect)((function(e){var t=e.polls,n=e.loading,i=e.user;return{polls:t,globalSetting:e.globalSetting,user:i,loading:n.effects}}))((function(e){var t,n,i,o,s,c,d,p,v,y,N,A,P,D,B,j,I,R,O,Z,F,z,H,W,G,V,q,U,K=e.polls,Y=(e.globalSetting,e.loading,e.user),X=e.dispatch,J=(f()(e,ze),(0,g.useParams)()),Q=((0,g.useLocation)(),Y.userInfo),$=x.Z.useForm(),te=h()($,1)[0],ne=(0,m.useState)([]),ie=h()(ne,2),oe=ie[0],ae=ie[1],se=(0,m.useState)(!1),le=h()(se,2),ue=le[0],de=le[1],he=(0,m.useRef)();(0,m.useEffect)((function(){var e,t,n,i;null!==(e=K.exerciseBanks)&&void 0!==e&&e.exercise_questions&&(ae(u()(null===(t=K.exerciseBanks)||void 0===t?void 0:t.exercise_questions)),te.setFieldsValue({exercise_name:null===(n=K.exerciseBanks)||void 0===n||null===(n=n.exercise)||void 0===n?void 0:n.exercise_name,exercise_description:null===(i=K.exerciseBanks)||void 0===i||null===(i=i.exercise)||void 0===i?void 0:i.exercise_description}))}),[K.exerciseBanks]),(0,m.useEffect)((function(){X({type:"polls/getExerciseBanks",payload:l()({},J)})}),[J.categoryId]);var fe=function(){var e=a()(r()().mark((function e(){var t,n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,te.validateFields();case 2:return(n=te.getFieldValue()).is_md=!0,n.topicId=null===(t=K.exerciseBanks)||void 0===t||null===(t=t.exercise)||void 0===t?void 0:t.id,de(!1),e.next=8,(0,_.hO)(l()({},n));case 8:X({type:"polls/getExerciseBanks",payload:l()({},J)});case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),me=function(){var e=a()(r()().mark((function e(t){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null==he?void 0:he.current;case 2:if(null==(n=e.sent)||!n.isEdit){e.next=6;break}return b.ZP.error("不能同时编辑两题"),e.abrupt("return");case 6:5===t?X({type:"classroomList/setActionTabs",payload:{key:"选用实践项目"}}):ae([].concat(u()(oe),[{question_type:t}]));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,ee.jsxs)("section",{className:"edu-container",children:[(0,ee.jsxs)("section",{className:"animated fadeIn",children:[(0,ee.jsx)("aside",{className:"mt10",children:Q&&(0,ee.jsxs)(C.Z,{separator:">",children:[(0,ee.jsx)(C.Z.Item,{children:(0,ee.jsx)(g.Link,{to:"/users/".concat(Q.login,"/topics/personal"),children:"我的题库"})}),(0,ee.jsx)(C.Z.Item,{children:(0,ee.jsx)(g.Link,{to:"/users/".concat(null==Q?void 0:Q.login,"/topics/").concat(J.topicId,"/").concat(J.topictype,"/exercise/detail"),children:"详情"})}),(0,ee.jsx)(C.Z.Item,{children:"编辑"})]})}),(0,ee.jsx)("aside",{className:[Fe.title,"mt20"].join(" "),children:(0,ee.jsxs)(k.Z,{style:{width:"100%"},align:"middle",children:[(0,ee.jsxs)(S.Z,{flex:"1",children:[(0,ee.jsx)("strong",{className:"font20 ml5",children:"编辑试卷"}),(0,ee.jsx)(ge.VV,{status:[null!==(t=K.exerciseBanks)&&void 0!==t&&null!==(t=t.exercise)&&void 0!==t&&t.is_public?"公开":"私有"]})]}),(0,ee.jsx)(S.Z,{children:(0,ee.jsx)(g.Link,{className:"font16 c-light-black",to:"/users/".concat(Q.login,"/topics/personal"),children:"返回"})})]})})]}),(0,ee.jsxs)("section",{className:[Fe.bg,"pt30","pl30","pr30","pb30","mt20"].join(" "),children:[!ue&&(0,ee.jsxs)("aside",{children:[(0,ee.jsxs)("div",{className:Fe.containerDesc,children:[(0,ee.jsx)("div",{children:null===(n=K.exerciseBanks)||void 0===n||null===(n=n.exercise)||void 0===n?void 0:n.exercise_name}),(0,ee.jsx)("div",{children:(0,ee.jsx)(E.Z,{title:"编辑",children:(0,ee.jsx)("span",{onClick:function(){return de(!0)},className:"iconfont c-green ml30 icon-bianjishijuan3x"})})})]}),(0,ee.jsx)("div",{className:"c-light-black",children:null===(i=K.exerciseBanks)||void 0===i||null===(i=i.exercise)||void 0===i?void 0:i.exercise_description})]}),ue&&(0,ee.jsxs)(x.Z,{layout:"vertical",form:te,children:[(0,ee.jsx)(x.Z.Item,{name:"exercise_name",label:"试卷标题:",rules:[{required:!0,message:"请填写试卷标题"}],children:(0,ee.jsx)(M.Z,{maxLength:60,placeholder:"试卷标题,最大限制60个字符"})}),(0,ee.jsx)(x.Z.Item,{label:"试卷须知:",name:"exercise_description",children:(0,ee.jsx)(M.Z.TextArea,{rows:6,placeholder:"请在此输入本次试卷答题的相关说明,最大限制100个字符"})}),(0,ee.jsx)(x.Z.Item,{className:"tr",children:(0,ee.jsx)(T.ZP,{type:"primary",onClick:function(){fe()},children:"保存"})})]})]}),(0,ee.jsxs)("p",{className:"mt10",style:{display:"flex"},children:[(0,ee.jsxs)("span",{className:"fl",style:{flex:"1"},children:[!(null===(o=K.exerciseBanks)||void 0===o||null===(o=o.exercise_types)||void 0===o||!o.q_singles)&&(0,ee.jsxs)("span",{className:"ml20",children:["单选题",null===(s=K.exerciseBanks)||void 0===s||null===(s=s.exercise_types)||void 0===s?void 0:s.q_singles,"题,共",null===(c=K.exerciseBanks)||void 0===c||null===(c=c.exercise_types)||void 0===c?void 0:c.q_singles_scores,"分"]}),!(null===(d=K.exerciseBanks)||void 0===d||null===(d=d.exercise_types)||void 0===d||!d.q_doubles)&&(0,ee.jsxs)("span",{className:"ml20",children:["多选题",null===(p=K.exerciseBanks)||void 0===p||null===(p=p.exercise_types)||void 0===p?void 0:p.q_doubles,"题,共",null===(v=K.exerciseBanks)||void 0===v||null===(v=v.exercise_types)||void 0===v?void 0:v.q_doubles_scores,"分"]}),!(null===(y=K.exerciseBanks)||void 0===y||null===(y=y.exercise_types)||void 0===y||!y.q_judges)&&(0,ee.jsxs)("span",{className:"ml20",children:["判断题",null===(N=K.exerciseBanks)||void 0===N||null===(N=N.exercise_types)||void 0===N?void 0:N.q_judges,"题,共",null===(A=K.exerciseBanks)||void 0===A||null===(A=A.exercise_types)||void 0===A?void 0:A.q_judges_scores,"分"]}),!(null===(P=K.exerciseBanks)||void 0===P||null===(P=P.exercise_types)||void 0===P||!P.q_nulls)&&(0,ee.jsxs)("span",{className:"ml20",children:["填空题",null===(D=K.exerciseBanks)||void 0===D||null===(D=D.exercise_types)||void 0===D?void 0:D.q_nulls,"题,共",null===(B=K.exerciseBanks)||void 0===B||null===(B=B.exercise_types)||void 0===B?void 0:B.q_nulls_scores,"分"]}),!(null===(j=K.exerciseBanks)||void 0===j||null===(j=j.exercise_types)||void 0===j||!j.q_mains)&&(0,ee.jsxs)("span",{className:"ml20",children:["简答题",null===(I=K.exerciseBanks)||void 0===I||null===(I=I.exercise_types)||void 0===I?void 0:I.q_mains,"题,共",null===(R=K.exerciseBanks)||void 0===R||null===(R=R.exercise_types)||void 0===R?void 0:R.q_mains_scores,"分"]}),!(null===(O=K.exerciseBanks)||void 0===O||null===(O=O.exercise_types)||void 0===O||!O.q_shixuns)&&(0,ee.jsxs)("span",{className:"ml20",children:["实训题",null===(Z=K.exerciseBanks)||void 0===Z||null===(Z=Z.exercise_types)||void 0===Z?void 0:Z.q_shixuns,"题,共",null===(F=K.exerciseBanks)||void 0===F||null===(F=F.exercise_types)||void 0===F?void 0:F.q_shixuns_scores,"分"]}),!(null===(z=K.exerciseBanks)||void 0===z||null===(z=z.exercise_types)||void 0===z||!z.q_pros)&&(0,ee.jsxs)("span",{className:"ml20",children:["编程题",null===(H=K.exerciseBanks)||void 0===H||null===(H=H.exercise_types)||void 0===H?void 0:H.q_pros,"题,共",null===(W=K.exerciseBanks)||void 0===W||null===(W=W.exercise_types)||void 0===W?void 0:W.q_pros_scores,"分"]})]}),(0,ee.jsx)("span",{className:"fr",children:!(null===(G=K.exerciseBanks)||void 0===G||null===(G=G.exercise_types)||void 0===G||!G.q_counts)&&(0,ee.jsxs)("span",{children:["合计 ",(0,ee.jsx)("span",{className:"color-blue",children:null===(V=K.exerciseBanks)||void 0===V||null===(V=V.exercise_types)||void 0===V?void 0:V.q_counts})," 题, 共 ",(0,ee.jsx)("span",{className:"".concat((null===(q=K.exerciseBanks)||void 0===q||null===(q=q.exercise_types)||void 0===q?void 0:q.q_scores)>100?"color-red font-bd":"color-orange"),children:null===(U=K.exerciseBanks)||void 0===U||null===(U=U.exercise_types)||void 0===U?void 0:U.q_scores})," 分"]})})]}),""!=oe&&(0,ee.jsx)("section",{className:[Fe.bg,"pt30","pl20","pr20","pb20","mt20"].join(" "),children:null==oe?void 0:oe.map((function(e,t){return e.key=t+1,e.len=oe.length,0===e.question_type?(0,ee.jsxs)("aside",{children:[(0,ee.jsx)(ce,{ref:he,editData:e}),(0,ee.jsx)(w.Z,{})]}):1===e.question_type?(0,ee.jsxs)("aside",{children:[(0,ee.jsx)(re,{ref:he,editData:e}),(0,ee.jsx)(w.Z,{})]}):2===e.question_type?(0,ee.jsxs)("aside",{children:[(0,ee.jsx)(pe,{ref:he,editData:e}),(0,ee.jsx)(w.Z,{})]}):3===e.question_type?(0,ee.jsxs)("aside",{children:[(0,ee.jsx)(xe,{editData:e}),(0,ee.jsx)(w.Z,{})]}):4===e.question_type?(0,ee.jsxs)("aside",{children:[(0,ee.jsx)(Ce,{editData:e}),(0,ee.jsx)(w.Z,{})]}):5===e.question_type?(0,ee.jsxs)("aside",{children:[(0,ee.jsx)(Ee,{editData:e}),(0,ee.jsx)(w.Z,{})]}):void 0}))}),(0,ee.jsx)("section",{style:{display:"flex"},className:[Fe.bg,"pt30","pl30","pr30","pb30","mt20"].join(" "),children:(0,ee.jsx)("div",{style:{flex:"1"},children:[{name:"选择题",id:0},{name:"判断题",id:2},{name:"填空题",id:3},{name:"简答题",id:4},{name:"实训题",id:5}].map((function(e,t){return(0,ee.jsxs)(T.ZP,{className:"mr20",type:"primary",onClick:function(){return me(e.id)},children:[(0,ee.jsx)(L.Z,{className:"mr5"}),e.name]})}))})}),(0,ee.jsx)(Ze,{callback:function(e){oe.push({shixun:e.challenge_names.map((function(e){return{challenge_name:e,challenge_score:5}})),shixun_name:e.title,shixun_id:e.id,question_type:5,edit:!0}),ae(u()(oe))}})]})})))},75359:function(e,t,n){"use strict";n.d(t,{AL:function(){return k},Iy:function(){return p},Qv:function(){return g},ez:function(){return C},jb:function(){return f}});var i=n(79800),r=n.n(i),o=n(32834),a=n.n(o),s=n(11690),l=1;var c=[],u=["<ul>"],d=new(a().Renderer),h=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function p(){c.length=0,u=["<ul>"]}var f={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(e,t,n,i){if(t>=e.length||e[t].level<=n)return t;var r=e[t];i.push("<li><a href='#"+l+r.anchor+"'>"+r.text+"</a>");var o=[];return t=m(e,++t,r.level,o),o.length>0&&(i.push("<ul>"),o.forEach((function(e){i.push(e)})),i.push("</ul>")),i.push("</li>"),t=m(e,t,n,i)}function g(){return m(c,0,0,u),u.push("</ul>"),u.join("")}var v={heading:function(e){var t=h.exec(e);if(l+=1,t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}},fences:function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],i=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var i=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:r()(t,1)[0].length>=i.length?e.slice(i.length):e})).join("\n")}(n,t[3]||""),o=t[2]?t[2].trim():t[2];if(["latex","katex","math"].indexOf(o)>=0){var a=b(),s=i;i=a,w[a]={type:"block",expression:s}}return{type:"code",raw:n,lang:o,text:i}}}},y=/(?:\${2})([^\n`]+?)(?:\${2})/gi,x=0,b=function(){return"__special_katext_id_".concat(x++,"__")},w={};function C(){return w}function k(){x=0,w={}}function S(e){return e=e.replace(y,(function(e,t){var n=b();return w[n]={type:"inline",expression:t},n}))}var E=d.listitem;d.listitem=function(e){return E(S(e))};var M=d.paragraph;d.paragraph=function(e){return M(S(e))};var T=d.tablecell;d.tablecell=function(e,t){return T(S(e),t)},d.code=function(e,t,n){var i=(t||"").match(/\S*/)[0];return i?["latex","katex","math"].indexOf(i)>=0?"<p class='editormd-tex'>".concat(e,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(t,'">').concat(n?e:(0,s.escape)(e,!0),"</code></pre>\n"):'<pre class="prettyprint linenums"><code>'+(n?e:(0,s.escape)(e,!0))+"</code></pre>"},d.heading=function(e,t,n){var i=this.options.headerPrefix+n.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return c.push({anchor:i,level:t,text:e}),"<h"+t+' id="'+l+i+'">'+e+"</h"+t+">"},a().setOptions({silent:!0,gfm:!0,pedantic:!1}),a().use({tokenizer:v,renderer:d}),t.ZP=a()},66543:function(){},59598:function(){},21697:function(e,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"}},99498:function(e,t,n){!function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=e.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var i=e.getOption("placeholder");"string"==typeof i&&(i=document.createTextNode(i)),n.appendChild(i),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function i(e){setTimeout((function(){var i=!1,r=e.getInputField();"TEXTAREA"==r.nodeName?i=!r.value:1==e.lineCount()&&(i=!/[^\u200b]/.test(r.querySelector(".CodeMirror-line").textContent)),i?n(e):t(e)}),20)}function r(e){a(e)&&n(e)}function o(e){var i=e.getWrapperElement(),r=a(e);i.className=i.className.replace(" CodeMirror-empty","")+(r?" CodeMirror-empty":""),r?n(e):t(e)}function a(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",(function(n,a,s){var l=s&&s!=e.Init;if(a&&!l)n.on("blur",r),n.on("change",o),n.on("swapDoc",o),e.on(n.getInputField(),"compositionupdate",n.state.placeholderCompose=function(){i(n)}),o(n);else if(!a&&l){n.off("blur",r),n.off("change",o),n.off("swapDoc",o),e.off(n.getInputField(),"compositionupdate",n.state.placeholderCompose),t(n);var c=n.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}a&&!n.hasFocus()&&r(n)}))}(n(89780))},25717:function(e,t,n){!function(e){var t={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},n=e.Pos;function i(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==typeof e&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,(function(t,n,a){a&&a!=e.Init&&(t.removeKeyMap(r),t.state.closeBrackets=null),n&&(o(i(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(r))}));var r={Backspace:l,Enter:c};function o(e){for(var t=0;t<e.length;t++){var n=e.charAt(t),i="'"+n+"'";r[i]||(r[i]=a(n))}}function a(e){return function(t){return d(t,e)}}function s(e){var t=e.state.closeBrackets;return!t||t.override?t:e.getModeAt(e.getCursor()).closeBrackets||t}function l(t){var r=s(t);if(!r||t.getOption("disableInput"))return e.Pass;for(var o=i(r,"pairs"),a=t.listSelections(),l=0;l<a.length;l++){if(!a[l].empty())return e.Pass;var c=h(t,a[l].head);if(!c||o.indexOf(c)%2!=0)return e.Pass}for(l=a.length-1;l>=0;l--){var u=a[l].head;t.replaceRange("",n(u.line,u.ch-1),n(u.line,u.ch+1),"+delete")}}function c(t){var n=s(t),r=n&&i(n,"explode");if(!r||t.getOption("disableInput"))return e.Pass;for(var o=t.listSelections(),a=0;a<o.length;a++){if(!o[a].empty())return e.Pass;var l=h(t,o[a].head);if(!l||r.indexOf(l)%2!=0)return e.Pass}t.operation((function(){var e=t.lineSeparator()||"\n";t.replaceSelection(e+e,null),t.execCommand("goCharLeft"),o=t.listSelections();for(var n=0;n<o.length;n++){var i=o[n].head.line;t.indentLine(i,null,!0),t.indentLine(i+1,null,!0)}}))}function u(t){var i=e.cmpPos(t.anchor,t.head)>0;return{anchor:new n(t.anchor.line,t.anchor.ch+(i?-1:1)),head:new n(t.head.line,t.head.ch+(i?1:-1))}}function d(t,r){var o=s(t);if(!o||t.getOption("disableInput"))return e.Pass;var a=i(o,"pairs"),l=a.indexOf(r);if(-1==l)return e.Pass;for(var c,d=i(o,"closeBefore"),h=i(o,"triples"),f=a.charAt(l+1)==r,m=t.listSelections(),g=l%2==0,v=0;v<m.length;v++){var y,x=m[v],b=x.head,w=t.getRange(b,n(b.line,b.ch+1));if(g&&!x.empty())y="surround";else if(!f&&g||w!=r)if(f&&b.ch>1&&h.indexOf(r)>=0&&t.getRange(n(b.line,b.ch-2),b)==r+r){if(b.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(b.line,b.ch-2))))return e.Pass;y="addFour"}else if(f){var C=0==b.ch?" ":t.getRange(n(b.line,b.ch-1),b);if(e.isWordChar(w)||C==r||e.isWordChar(C))return e.Pass;y="both"}else{if(!g||!(0===w.length||/\s/.test(w)||d.indexOf(w)>-1))return e.Pass;y="both"}else y=f&&p(t,b)?"both":h.indexOf(r)>=0&&t.getRange(b,n(b.line,b.ch+3))==r+r+r?"skipThree":"skip";if(c){if(c!=y)return e.Pass}else c=y}var k=l%2?a.charAt(l-1):r,S=l%2?r:a.charAt(l+1);t.operation((function(){if("skip"==c)t.execCommand("goCharRight");else if("skipThree"==c)for(var e=0;e<3;e++)t.execCommand("goCharRight");else if("surround"==c){var n=t.getSelections();for(e=0;e<n.length;e++)n[e]=k+n[e]+S;for(t.replaceSelections(n,"around"),n=t.listSelections().slice(),e=0;e<n.length;e++)n[e]=u(n[e]);t.setSelections(n)}else"both"==c?(t.replaceSelection(k+S,null),t.triggerElectric(k+S),t.execCommand("goCharLeft")):"addFour"==c&&(t.replaceSelection(k+k+k+k,"before"),t.execCommand("goCharRight"))}))}function h(e,t){var i=e.getRange(n(t.line,t.ch-1),n(t.line,t.ch+1));return 2==i.length?i:null}function p(e,t){var i=e.getTokenAt(n(t.line,t.ch+1));return/\bstring/.test(i.type)&&i.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}o(t.pairs+"`")}(n(89780))},6313:function(e,t,n){!function(e){e.defineOption("autoCloseTags",!1,(function(t,n,r){if(r!=e.Init&&r&&t.removeKeyMap("autoCloseTags"),n){var a={name:"autoCloseTags"};"object"==typeof n&&!1===n.whenClosing||(a["'/'"]=function(e){return o(e)}),"object"==typeof n&&!1===n.whenOpening||(a["'>'"]=function(e){return i(e)}),t.addKeyMap(a)}}));var t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],n=["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 i(i){if(i.getOption("disableInput"))return e.Pass;for(var r=i.listSelections(),o=[],l=i.getOption("autoCloseTags"),c=0;c<r.length;c++){if(!r[c].empty())return e.Pass;var u=r[c].head,d=i.getTokenAt(u),h=e.innerMode(i.getMode(),d.state),p=h.state,f=h.mode.xmlCurrentTag&&h.mode.xmlCurrentTag(p),m=f&&f.name;if(!m)return e.Pass;var g="html"==h.mode.configuration,v="object"==typeof l&&l.dontCloseTags||g&&t,y="object"==typeof l&&l.indentTags||g&&n;d.end>u.ch&&(m=m.slice(0,m.length-d.end+u.ch));var x=m.toLowerCase();if(!m||"string"==d.type&&(d.end!=u.ch||!/[\"\']/.test(d.string.charAt(d.string.length-1))||1==d.string.length)||"tag"==d.type&&f.close||d.string.indexOf("/")==u.ch-d.start-1||v&&a(v,x)>-1||s(i,h.mode.xmlCurrentContext&&h.mode.xmlCurrentContext(p)||[],m,u,!0))return e.Pass;var b="object"==typeof l&&l.emptyTags;if(b&&a(b,m)>-1)o[c]={text:"/>",newPos:e.Pos(u.line,u.ch+2)};else{var w=y&&a(y,x)>-1;o[c]={indent:w,text:">"+(w?"\n\n":"")+"</"+m+">",newPos:w?e.Pos(u.line+1,0):e.Pos(u.line,u.ch+1)}}}var C="object"==typeof l&&l.dontIndentOnAutoClose;for(c=r.length-1;c>=0;c--){var k=o[c];i.replaceRange(k.text,r[c].head,r[c].anchor,"+insert");var S=i.listSelections().slice(0);S[c]={head:k.newPos,anchor:k.newPos},i.setSelections(S),!C&&k.indent&&(i.indentLine(k.newPos.line,null,!0),i.indentLine(k.newPos.line+1,null,!0))}}function r(t,n){for(var i=t.listSelections(),r=[],o=n?"/":"</",a=t.getOption("autoCloseTags"),l="object"==typeof a&&a.dontIndentOnSlash,c=0;c<i.length;c++){if(!i[c].empty())return e.Pass;var u=i[c].head,d=t.getTokenAt(u),h=e.innerMode(t.getMode(),d.state),p=h.state;if(n&&("string"==d.type||"<"!=d.string.charAt(0)||d.start!=u.ch-1))return e.Pass;var f,m="xml"!=h.mode.name&&"htmlmixed"==t.getMode().name;if(m&&"javascript"==h.mode.name)f=o+"script";else if(m&&"css"==h.mode.name)f=o+"style";else{var g=h.mode.xmlCurrentContext&&h.mode.xmlCurrentContext(p);if(!g||g.length&&s(t,g,g[g.length-1],u))return e.Pass;f=o+g[g.length-1]}">"!=t.getLine(u.line).charAt(d.end)&&(f+=">"),r[c]=f}if(t.replaceSelections(r),i=t.listSelections(),!l)for(c=0;c<i.length;c++)(c==i.length-1||i[c].head.line<i[c+1].head.line)&&t.indentLine(i[c].head.line)}function o(t){return t.getOption("disableInput")?e.Pass:r(t,!0)}function a(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,i=e.length;n<i;++n)if(e[n]==t)return n;return-1}function s(t,n,i,r,o){if(!e.scanForClosingTag)return!1;var a=Math.min(t.lastLine()+1,r.line+500),s=e.scanForClosingTag(t,r,null,a);if(!s||s.tag!=i)return!1;for(var l=o?1:0,c=n.length-1;c>=0&&n[c]==i;c--)++l;for(r=s.to,c=1;c<l;c++){var u=e.scanForClosingTag(t,r,null,a);if(!u||u.tag!=i)return!1;r=u.to}return!0}e.commands.closeTag=function(e){return r(e)}}(n(89780),n(32855))},32855:function(e,t,n){!function(e){"use strict";var t=e.Pos;function n(e,t){return e.line-t.line||e.ch-t.ch}var i="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",r=new RegExp("<(/?)(["+i+"]["+i+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function o(e,t,n,i){this.line=t,this.ch=n,this.cm=e,this.text=e.getLine(t),this.min=i?Math.max(i.from,e.firstLine()):e.firstLine(),this.max=i?Math.min(i.to-1,e.lastLine()):e.lastLine()}function a(e,n){var i=e.cm.getTokenTypeAt(t(e.line,n));return i&&/\btag\b/.test(i)}function s(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function l(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function c(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(s(e))continue;return}if(a(e,t+1)){var n=e.text.lastIndexOf("/",t),i=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t+1}}function u(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(l(e))continue;return}if(a(e,t+1)){r.lastIndex=t,e.ch=t;var n=r.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function d(e){for(;;){r.lastIndex=e.ch;var t=r.exec(e.text);if(!t){if(s(e))continue;return}if(a(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function h(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(l(e))continue;return}if(a(e,t+1)){var n=e.text.lastIndexOf("/",t),i=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t}}function p(e,n){for(var i=[];;){var r,o=d(e),a=e.line,s=e.ch-(o?o[0].length:0);if(!o||!(r=c(e)))return;if("selfClose"!=r)if(o[1]){for(var l=i.length-1;l>=0;--l)if(i[l]==o[2]){i.length=l;break}if(l<0&&(!n||n==o[2]))return{tag:o[2],from:t(a,s),to:t(e.line,e.ch)}}else i.push(o[2])}}function f(e,n){for(var i=[];;){var r=h(e);if(!r)return;if("selfClose"!=r){var o=e.line,a=e.ch,s=u(e);if(!s)return;if(s[1])i.push(s[2]);else{for(var l=i.length-1;l>=0;--l)if(i[l]==s[2]){i.length=l;break}if(l<0&&(!n||n==s[2]))return{tag:s[2],from:t(e.line,e.ch),to:t(o,a)}}}else u(e)}}e.registerHelper("fold","xml",(function(e,i){for(var r=new o(e,i.line,0);;){var a=d(r);if(!a||r.line!=i.line)return;var s=c(r);if(!s)return;if(!a[1]&&"selfClose"!=s){var l=t(r.line,r.ch),u=p(r,a[2]);return u&&n(u.from,l)>0?{from:l,to:u.from}:null}}})),e.findMatchingTag=function(e,i,r){var a=new o(e,i.line,i.ch,r);if(-1!=a.text.indexOf(">")||-1!=a.text.indexOf("<")){var s=c(a),l=s&&t(a.line,a.ch),d=s&&u(a);if(s&&d&&!(n(a,i)>0)){var h={from:t(a.line,a.ch),to:l,tag:d[2]};return"selfClose"==s?{open:h,close:null,at:"open"}:d[1]?{open:f(a,d[2]),close:h,at:"close"}:{open:h,close:p(a=new o(e,l.line,l.ch,r),d[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,n,i){for(var r=new o(e,t.line,t.ch,n);;){var a=f(r,i);if(!a)break;var s=p(new o(e,t.line,t.ch,n),a.tag);if(s)return{open:a,close:s}}},e.scanForClosingTag=function(e,t,n,i){return p(new o(e,t.line,t.ch,i?{from:0,to:i}:null),n)}}(n(89780))},89780:function(e){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),i=/MSIE \d/.test(e),r=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=i||r||o,s=a&&(i?document.documentMode||6:+(o||r)[1]),l=!o&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),u=!o&&/Chrome\//.test(e),d=/Opera\//.test(e),h=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),f=/PhantomJS/.test(e),m=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),g=/Android/.test(e),v=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),x=/\bCrOS\b/.test(e),b=/win/i.test(t),w=d&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(d=!1,l=!0);var C=y&&(c||d&&(null==w||w<12.11)),k=n||a&&s>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var E,M=function(e,t){var n=e.className,i=S(t).exec(n);if(i){var r=n.slice(i.index+i[0].length);e.className=n.slice(0,i.index)+(r?i[1]+r:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function L(e,t){return T(e).appendChild(t)}function _(e,t,n,i){var r=document.createElement(e);if(n&&(r.className=n),i&&(r.style.cssText=i),"string"==typeof t)r.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)r.appendChild(t[o]);return r}function N(e,t,n,i){var r=_(e,t,n,i);return r.setAttribute("role","presentation"),r}function A(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function P(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function D(e,t){var n=e.className;S(t).test(n)||(e.className+=(n?" ":"")+t)}function B(e,t){for(var n=e.split(" "),i=0;i<n.length;i++)n[i]&&!S(n[i]).test(t)&&(t+=" "+n[i]);return t}E=document.createRange?function(e,t,n,i){var r=document.createRange();return r.setEnd(i||e,n),r.setStart(e,t),r}:function(e,t,n){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(e){return i}return i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",t),i};var j=function(e){e.select()};function I(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function R(e,t,n){for(var i in t||(t={}),e)!e.hasOwnProperty(i)||!1===n&&t.hasOwnProperty(i)||(t[i]=e[i]);return t}function O(e,t,n,i,r){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=i||0,a=r||0;;){var s=e.indexOf("\t",o);if(s<0||s>=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}m?j=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(j=function(e){try{e.select()}catch(e){}});var Z=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};function F(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}Z.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Z.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var z=50,H={toString:function(){return"CodeMirror.Pass"}},W={scroll:!1},G={origin:"*mouse"},V={origin:"+move"};function q(e,t,n){for(var i=0,r=0;;){var o=e.indexOf("\t",i);-1==o&&(o=e.length);var a=o-i;if(o==e.length||r+a>=t)return i+Math.min(a,t-r);if(r+=o-i,i=o+1,(r+=n-r%n)>=t)return i}}var U=[""];function K(e){for(;U.length<=e;)U.push(Y(U)+" ");return U[e]}function Y(e){return e[e.length-1]}function X(e,t){for(var n=[],i=0;i<e.length;i++)n[i]=t(e[i],i);return n}function J(e,t,n){for(var i=0,r=n(t);i<e.length&&n(e[i])<=r;)i++;e.splice(i,0,t)}function Q(){}function $(e,t){var n;return Object.create?n=Object.create(e):(Q.prototype=e,n=new Q),t&&R(t,n),n}var ee=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function te(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||ee.test(e))}function ne(e,t){return t?!!(t.source.indexOf("\\w")>-1&&te(e))||t.test(e):te(e)}function ie(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\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 oe(e){return e.charCodeAt(0)>=768&&re.test(e)}function ae(e,t,n){for(;(n<0?t>0:t<e.length)&&oe(e.charAt(t));)t+=n;return t}function se(e,t,n){for(var i=t>n?-1:1;;){if(t==n)return t;var r=(t+n)/2,o=i<0?Math.ceil(r):Math.floor(r);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+i}}function le(e,t,n,i){if(!e)return i(t,n,"ltr",0);for(var r=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(i(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),r=!0)}r||i(t,n,"ltr")}var ce=null;function ue(e,t,n){var i;ce=null;for(var r=0;r<e.length;++r){var o=e[r];if(o.from<t&&o.to>t)return r;o.to==t&&(o.from!=o.to&&"before"==n?i=r:ce=r),o.from==t&&(o.from!=o.to&&"before"!=n?i=r:ce=r)}return null!=i?i:ce}var de=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(e,t,n){this.level=e,this.from=t,this.to=n}return function(e,t){var c="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!i.test(e))return!1;for(var u=e.length,d=[],h=0;h<u;++h)d.push(n(e.charCodeAt(h)));for(var p=0,f=c;p<u;++p){var m=d[p];"m"==m?d[p]=f:f=m}for(var g=0,v=c;g<u;++g){var y=d[g];"1"==y&&"r"==v?d[g]="n":o.test(y)&&(v=y,"r"==y&&(d[g]="R"))}for(var x=1,b=d[0];x<u-1;++x){var w=d[x];"+"==w&&"1"==b&&"1"==d[x+1]?d[x]="1":","!=w||b!=d[x+1]||"1"!=b&&"n"!=b||(d[x]=b),b=w}for(var C=0;C<u;++C){var k=d[C];if(","==k)d[C]="N";else if("%"==k){var S=void 0;for(S=C+1;S<u&&"%"==d[S];++S);for(var E=C&&"!"==d[C-1]||S<u&&"1"==d[S]?"1":"N",M=C;M<S;++M)d[M]=E;C=S-1}}for(var T=0,L=c;T<u;++T){var _=d[T];"L"==L&&"1"==_?d[T]="L":o.test(_)&&(L=_)}for(var N=0;N<u;++N)if(r.test(d[N])){var A=void 0;for(A=N+1;A<u&&r.test(d[A]);++A);for(var P="L"==(N?d[N-1]:c),D=P==("L"==(A<u?d[A]:c))?P?"L":"R":c,B=N;B<A;++B)d[B]=D;N=A-1}for(var j,I=[],R=0;R<u;)if(a.test(d[R])){var O=R;for(++R;R<u&&a.test(d[R]);++R);I.push(new l(0,O,R))}else{var Z=R,F=I.length,z="rtl"==t?1:0;for(++R;R<u&&"L"!=d[R];++R);for(var H=Z;H<R;)if(s.test(d[H])){Z<H&&(I.splice(F,0,new l(1,Z,H)),F+=z);var W=H;for(++H;H<R&&s.test(d[H]);++H);I.splice(F,0,new l(2,W,H)),F+=z,Z=H}else++H;Z<R&&I.splice(F,0,new l(1,Z,R))}return"ltr"==t&&(1==I[0].level&&(j=e.match(/^\s+/))&&(I[0].from=j[0].length,I.unshift(new l(0,0,j[0].length))),1==Y(I).level&&(j=e.match(/\s+$/))&&(Y(I).to-=j[0].length,I.push(new l(0,u-j[0].length,u)))),"rtl"==t?I.reverse():I}}();function he(e,t){var n=e.order;return null==n&&(n=e.order=de(e.text,t)),n}var pe=[],fe=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var i=e._handlers||(e._handlers={});i[t]=(i[t]||pe).concat(n)}};function me(e,t){return e._handlers&&e._handlers[t]||pe}function ge(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var i=e._handlers,r=i&&i[t];if(r){var o=F(r,n);o>-1&&(i[t]=r.slice(0,o).concat(r.slice(o+1)))}}}function ve(e,t){var n=me(e,t);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r<n.length;++r)n[r].apply(null,i)}function ye(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ve(e,n||t.type,e,t),Se(t)||t.codemirrorIgnore}function xe(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)-1==F(n,t[i])&&n.push(t[i])}function be(e,t){return me(e,t).length>0}function we(e){e.prototype.on=function(e,t){fe(this,e,t)},e.prototype.off=function(e,t){ge(this,e,t)}}function Ce(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ke(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Se(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ee(e){Ce(e),ke(e)}function Me(e){return e.target||e.srcElement}function Te(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var Le,_e,Ne=function(){if(a&&s<9)return!1;var e=_("div");return"draggable"in e||"dragDrop"in e}();function Ae(e){if(null==Le){var t=_("span","");L(e,_("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Le=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=Le?_("span",""):_("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Pe(e){if(null!=_e)return _e;var t=L(e,document.createTextNode("AخA")),n=E(t,0,1).getBoundingClientRect(),i=E(t,1,2).getBoundingClientRect();return T(e),!(!n||n.left==n.right)&&(_e=i.right-n.right<3)}var De,Be=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],i=e.length;t<=i;){var r=e.indexOf("\n",t);-1==r&&(r=e.length);var o=e.slice(t,"\r"==e.charAt(r-1)?r-1:r),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=r+1)}return n}:function(e){return e.split(/\r\n?|\n/)},je=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ie="oncopy"in(De=_("div"))||(De.setAttribute("oncopy","return;"),"function"==typeof De.oncopy),Re=null;function Oe(e){if(null!=Re)return Re;var t=L(e,_("span","x")),n=t.getBoundingClientRect(),i=E(t,0,1).getBoundingClientRect();return Re=Math.abs(n.left-i.left)>1}var Ze={},Fe={};function ze(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ze[e]=t}function He(e,t){Fe[e]=t}function We(e){if("string"==typeof e&&Fe.hasOwnProperty(e))e=Fe[e];else if(e&&"string"==typeof e.name&&Fe.hasOwnProperty(e.name)){var t=Fe[e.name];"string"==typeof t&&(t={name:t}),(e=$(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return We("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return We("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ge(e,t){t=We(t);var n=Ze[t.name];if(!n)return Ge(e,"text/plain");var i=n(e,t);if(Ve.hasOwnProperty(t.name)){var r=Ve[t.name];for(var o in r)r.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(i["_"+o]=i[o]),i[o]=r[o])}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)i[a]=t.modeProps[a];return i}var Ve={};function qe(e,t){R(t,Ve.hasOwnProperty(e)?Ve[e]:Ve[e]={})}function Ue(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var i in t){var r=t[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function Ke(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Ye(e,t,n){return!e.startState||e.startState(t,n)}var Xe=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Je(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var i=0;;++i){var r=n.children[i],o=r.chunkSize();if(t<o){n=r;break}t-=o}return n.lines[t]}function Qe(e,t,n){var i=[],r=t.line;return e.iter(t.line,n.line+1,(function(e){var o=e.text;r==n.line&&(o=o.slice(0,n.ch)),r==t.line&&(o=o.slice(t.ch)),i.push(o),++r})),i}function $e(e,t,n){var i=[];return e.iter(t,n,(function(e){i.push(e.text)})),i}function et(e,t){var n=t-e.height;if(n)for(var i=e;i;i=i.parent)i.height+=n}function tt(e){if(null==e.parent)return null;for(var t=e.parent,n=F(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var r=0;i.children[r]!=t;++r)n+=i.children[r].chunkSize();return n+t.first}function nt(e,t){var n=e.first;e:do{for(var i=0;i<e.children.length;++i){var r=e.children[i],o=r.height;if(t<o){e=r;continue e}t-=o,n+=r.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var s=e.lines[a].height;if(t<s)break;t-=s}return n+a}function it(e,t){return t>=e.first&&t<e.first+e.size}function rt(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ot(e,t,n){if(void 0===n&&(n=null),!(this instanceof ot))return new ot(e,t,n);this.line=e,this.ch=t,this.sticky=n}function at(e,t){return e.line-t.line||e.ch-t.ch}function st(e,t){return e.sticky==t.sticky&&0==at(e,t)}function lt(e){return ot(e.line,e.ch)}function ct(e,t){return at(e,t)<0?t:e}function ut(e,t){return at(e,t)<0?e:t}function dt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ht(e,t){if(t.line<e.first)return ot(e.first,0);var n=e.first+e.size-1;return t.line>n?ot(n,Je(e,n).text.length):pt(t,Je(e,t.line).text.length)}function pt(e,t){var n=e.ch;return null==n||n>t?ot(e.line,t):n<0?ot(e.line,0):e}function ft(e,t){for(var n=[],i=0;i<t.length;i++)n[i]=ht(e,t[i]);return n}Xe.prototype.eol=function(){return this.pos>=this.string.length},Xe.prototype.sol=function(){return this.pos==this.lineStart},Xe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Xe.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Xe.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Xe.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Xe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Xe.prototype.skipToEnd=function(){this.pos=this.string.length},Xe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Xe.prototype.backUp=function(e){this.pos-=e},Xe.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=O(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?O(this.string,this.lineStart,this.tabSize):0)},Xe.prototype.indentation=function(){return O(this.string,null,this.tabSize)-(this.lineStart?O(this.string,this.lineStart,this.tabSize):0)},Xe.prototype.match=function(e,t,n){if("string"!=typeof e){var i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}var r=function(e){return n?e.toLowerCase():e};if(r(this.string.substr(this.pos,e.length))==r(e))return!1!==t&&(this.pos+=e.length),!0},Xe.prototype.current=function(){return this.string.slice(this.start,this.pos)},Xe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Xe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Xe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var mt=function(e,t){this.state=e,this.lookAhead=t},gt=function(e,t,n,i){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};function vt(e,t,n,i){var r=[e.state.modeGen],o={};Mt(e,t.text,e.doc.mode,n,(function(e,t){return r.push(e,t)}),o,i);for(var a=n.state,s=function(i){n.baseTokens=r;var s=e.state.overlays[i],l=1,c=0;n.state=!0,Mt(e,t.text,s.mode,n,(function(e,t){for(var n=l;c<e;){var i=r[l];i>e&&r.splice(l,1,e,r[l+1],i),l+=2,c=Math.min(e,i)}if(t)if(s.opaque)r.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;n<l;n+=2){var o=r[n+1];r[n+1]=(o?o+" ":"")+"overlay "+t}}),o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:r,classes:o.bgClass||o.textClass?o:null}}function yt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=xt(e,tt(t)),r=t.text.length>e.options.maxHighlightLength&&Ue(e.doc.mode,i.state),o=vt(e,t,i);r&&(i.state=r),t.stateAfter=i.save(!r),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function xt(e,t,n){var i=e.doc,r=e.display;if(!i.mode.startState)return new gt(i,!0,t);var o=Tt(e,t,n),a=o>i.first&&Je(i,o-1).stateAfter,s=a?gt.fromSaved(i,a,o):new gt(i,Ye(i.mode),o);return i.iter(o,t,(function(n){bt(e,n.text,s);var i=s.line;n.stateAfter=i==t-1||i%5==0||i>=r.viewFrom&&i<r.viewTo?s.save():null,s.nextLine()})),n&&(i.modeFrontier=s.line),s}function bt(e,t,n,i){var r=e.doc.mode,o=new Xe(t,e.options.tabSize,n);for(o.start=o.pos=i||0,""==t&&wt(r,n.state);!o.eol();)Ct(r,o,n.state),o.start=o.pos}function wt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Ke(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Ct(e,t,n,i){for(var r=0;r<10;r++){i&&(i[0]=Ke(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}gt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},gt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},gt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},gt.fromSaved=function(e,t,n){return t instanceof mt?new gt(e,Ue(e.mode,t.state),n,t.lookAhead):new gt(e,Ue(e.mode,t),n)},gt.prototype.save=function(e){var t=!1!==e?Ue(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new mt(t,this.maxLookAhead):t};var kt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function St(e,t,n,i){var r,o,a=e.doc,s=a.mode,l=Je(a,(t=ht(a,t)).line),c=xt(e,t.line,n),u=new Xe(l.text,e.options.tabSize,c);for(i&&(o=[]);(i||u.pos<t.ch)&&!u.eol();)u.start=u.pos,r=Ct(s,u,c.state),i&&o.push(new kt(u,r,Ue(a.mode,c.state)));return i?o:new kt(u,r,c.state)}function Et(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var i=n[1]?"bgClass":"textClass";null==t[i]?t[i]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+n[2])}return e}function Mt(e,t,n,i,r,o,a){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,c=0,u=null,d=new Xe(t,e.options.tabSize,i),h=e.options.addModeClass&&[null];for(""==t&&Et(wt(n,i.state),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(s=!1,a&&bt(e,t,i,d.pos),d.pos=t.length,l=null):l=Et(Ct(n,d,i.state,h),o),h){var p=h[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!s||u!=l){for(;c<d.start;)r(c=Math.min(d.start,c+5e3),u);u=l}d.start=d.pos}for(;c<d.pos;){var f=Math.min(d.pos,c+5e3);r(f,u),c=f}}function Tt(e,t,n){for(var i,r,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var l=Je(o,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof mt?c.lookAhead:0)<=o.modeFrontier))return s;var u=O(l.text,null,e.options.tabSize);(null==r||i>u)&&(r=s-1,i=u)}return r}function Lt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,i=t-1;i>n;i--){var r=Je(e,i).stateAfter;if(r&&(!(r instanceof mt)||i+r.lookAhead<t)){n=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var _t=!1,Nt=!1;function At(){_t=!0}function Pt(){Nt=!0}function Dt(e,t,n){this.marker=e,this.from=t,this.to=n}function Bt(e,t){if(e)for(var n=0;n<e.length;++n){var i=e[n];if(i.marker==t)return i}}function jt(e,t){for(var n,i=0;i<e.length;++i)e[i]!=t&&(n||(n=[])).push(e[i]);return n}function It(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Rt(e,t,n){var i;if(e)for(var r=0;r<e.length;++r){var o=e[r],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(i||(i=[])).push(new Dt(a,o.from,s?null:o.to))}}return i}function Ot(e,t,n){var i;if(e)for(var r=0;r<e.length;++r){var o=e[r],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(i||(i=[])).push(new Dt(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return i}function Zt(e,t){if(t.full)return null;var n=it(e,t.from.line)&&Je(e,t.from.line).markedSpans,i=it(e,t.to.line)&&Je(e,t.to.line).markedSpans;if(!n&&!i)return null;var r=t.from.ch,o=t.to.ch,a=0==at(t.from,t.to),s=Rt(n,r,a),l=Ot(i,o,a),c=1==t.text.length,u=Y(t.text).length+(c?r:0);if(s)for(var d=0;d<s.length;++d){var h=s[d];if(null==h.to){var p=Bt(l,h.marker);p?c&&(h.to=null==p.to?null:p.to+u):h.to=r}}if(l)for(var f=0;f<l.length;++f){var m=l[f];null!=m.to&&(m.to+=u),null==m.from?Bt(s,m.marker)||(m.from=u,c&&(s||(s=[])).push(m)):(m.from+=u,c&&(s||(s=[])).push(m))}s&&(s=Ft(s)),l&&l!=s&&(l=Ft(l));var g=[s];if(!c){var v,y=t.text.length-2;if(y>0&&s)for(var x=0;x<s.length;++x)null==s[x].to&&(v||(v=[])).push(new Dt(s[x].marker,null,null));for(var b=0;b<y;++b)g.push(v);g.push(l)}return g}function Ft(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function zt(e,t,n){var i=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||i&&-1!=F(i,n)||(i||(i=[])).push(n)}})),!i)return null;for(var r=[{from:t,to:n}],o=0;o<i.length;++o)for(var a=i[o],s=a.find(0),l=0;l<r.length;++l){var c=r[l];if(!(at(c.to,s.from)<0||at(c.from,s.to)>0)){var u=[l,1],d=at(c.from,s.from),h=at(c.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:s.from}),(h>0||!a.inclusiveRight&&!h)&&u.push({from:s.to,to:c.to}),r.splice.apply(r,u),l+=u.length-3}}return r}function Ht(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Wt(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Gt(e){return e.inclusiveLeft?-1:0}function Vt(e){return e.inclusiveRight?1:0}function qt(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var i=e.find(),r=t.find(),o=at(i.from,r.from)||Gt(e)-Gt(t);if(o)return-o;var a=at(i.to,r.to)||Vt(e)-Vt(t);return a||t.id-e.id}function Ut(e,t){var n,i=Nt&&e.markedSpans;if(i)for(var r=void 0,o=0;o<i.length;++o)(r=i[o]).marker.collapsed&&null==(t?r.from:r.to)&&(!n||qt(n,r.marker)<0)&&(n=r.marker);return n}function Kt(e){return Ut(e,!0)}function Yt(e){return Ut(e,!1)}function Xt(e,t){var n,i=Nt&&e.markedSpans;if(i)for(var r=0;r<i.length;++r){var o=i[r];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||qt(n,o.marker)<0)&&(n=o.marker)}return n}function Jt(e,t,n,i,r){var o=Je(e,t),a=Nt&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var c=l.marker.find(0),u=at(c.from,n)||Gt(l.marker)-Gt(r),d=at(c.to,i)||Vt(l.marker)-Vt(r);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?at(c.to,n)>=0:at(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?at(c.from,i)<=0:at(c.from,i)<0)))return!0}}}function Qt(e){for(var t;t=Kt(e);)e=t.find(-1,!0).line;return e}function $t(e){for(var t;t=Yt(e);)e=t.find(1,!0).line;return e}function en(e){for(var t,n;t=Yt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function tn(e,t){var n=Je(e,t),i=Qt(n);return n==i?t:tt(i)}function nn(e,t){if(t>e.lastLine())return t;var n,i=Je(e,t);if(!rn(e,i))return t;for(;n=Yt(i);)i=n.find(1,!0).line;return tt(i)+1}function rn(e,t){var n=Nt&&t.markedSpans;if(n)for(var i=void 0,r=0;r<n.length;++r)if((i=n[r]).marker.collapsed){if(null==i.from)return!0;if(!i.marker.widgetNode&&0==i.from&&i.marker.inclusiveLeft&&on(e,t,i))return!0}}function on(e,t,n){if(null==n.to){var i=n.marker.find(1,!0);return on(e,i.line,Bt(i.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var r=void 0,o=0;o<t.markedSpans.length;++o)if((r=t.markedSpans[o]).marker.collapsed&&!r.marker.widgetNode&&r.from==n.to&&(null==r.to||r.to!=n.from)&&(r.marker.inclusiveLeft||n.marker.inclusiveRight)&&on(e,t,r))return!0}function an(e){for(var t=0,n=(e=Qt(e)).parent,i=0;i<n.lines.length;++i){var r=n.lines[i];if(r==e)break;t+=r.height}for(var o=n.parent;o;o=(n=o).parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==n)break;t+=s.height}return t}function sn(e){if(0==e.height)return 0;for(var t,n=e.text.length,i=e;t=Kt(i);){var r=t.find(0,!0);i=r.from.line,n+=r.from.ch-r.to.ch}for(i=e;t=Yt(i);){var o=t.find(0,!0);n-=i.text.length-o.from.ch,n+=(i=o.to.line).text.length-o.to.ch}return n}function ln(e){var t=e.display,n=e.doc;t.maxLine=Je(n,n.first),t.maxLineLength=sn(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=sn(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var cn=function(e,t,n){this.text=e,Wt(this,t),this.height=n?n(this):1};function un(e,t,n,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Ht(e),Wt(e,n);var r=i?i(e):1;r!=e.height&&et(e,r)}function dn(e){e.parent=null,Ht(e)}cn.prototype.lineNo=function(){return tt(this)},we(cn);var hn={},pn={};function fn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?pn:hn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function mn(e,t){var n=N("span",null,null,l?"padding-right: .1px":null),i={pre:N("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var o=r?t.rest[r-1]:t.line,a=void 0;i.pos=0,i.addToken=vn,Pe(e.display.measure)&&(a=he(o,e.doc.direction))&&(i.addToken=xn(i.addToken,a)),i.map=[],wn(o,i,yt(e,o,t!=e.display.externalMeasured&&tt(o))),o.styleClasses&&(o.styleClasses.bgClass&&(i.bgClass=B(o.styleClasses.bgClass,i.bgClass||"")),o.styleClasses.textClass&&(i.textClass=B(o.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Ae(e.display.measure))),0==r?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var s=i.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return ve(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=B(i.pre.className,i.textClass||"")),i}function gn(e){var t=_("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function vn(e,t,n,i,r,o,l){if(t){var c,u=e.splitSpaces?yn(t,e.trailingSpace):t,d=e.cm.state.specialChars,h=!1;if(d.test(t)){c=document.createDocumentFragment();for(var p=0;;){d.lastIndex=p;var f=d.exec(t),m=f?f.index-p:t.length-p;if(m){var g=document.createTextNode(u.slice(p,p+m));a&&s<9?c.appendChild(_("span",[g])):c.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!f)break;p+=m+1;var v=void 0;if("\t"==f[0]){var y=e.cm.options.tabSize,x=y-e.col%y;(v=c.appendChild(_("span",K(x),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=x}else"\r"==f[0]||"\n"==f[0]?((v=c.appendChild(_("span","\r"==f[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",f[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(f[0])).setAttribute("cm-text",f[0]),a&&s<9?c.appendChild(_("span",[v])):c.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),a&&s<9&&(h=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||i||r||h||o||l){var b=n||"";i&&(b+=i),r&&(b+=r);var w=_("span",[c],b,o);if(l)for(var C in l)l.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&w.setAttribute(C,l[C]);return e.content.appendChild(w)}e.content.appendChild(c)}}function yn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,i="",r=0;r<e.length;r++){var o=e.charAt(r);" "!=o||!n||r!=e.length-1&&32!=e.charCodeAt(r+1)||(o=" "),i+=o,n=" "==o}return i}function xn(e,t){return function(n,i,r,o,a,s,l){r=r?r+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+i.length;;){for(var d=void 0,h=0;h<t.length&&!((d=t[h]).to>c&&d.from<=c);h++);if(d.to>=u)return e(n,i,r,o,a,s,l);e(n,i.slice(0,d.to-c),r,o,null,s,l),o=null,i=i.slice(d.to-c),c=d.to}}}function bn(e,t,n,i){var r=!i&&n.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!i&&e.cm.display.input.needsContentAttribute&&(r||(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function wn(e,t,n){var i=e.markedSpans,r=e.text,o=0;if(i)for(var a,s,l,c,u,d,h,p=r.length,f=0,m=1,g="",v=0;;){if(v==f){l=c=u=s="",h=null,d=null,v=1/0;for(var y=[],x=void 0,b=0;b<i.length;++b){var w=i[b],C=w.marker;if("bookmark"==C.type&&w.from==f&&C.widgetNode)y.push(C);else if(w.from<=f&&(null==w.to||w.to>f||C.collapsed&&w.to==f&&w.from==f)){if(null!=w.to&&w.to!=f&&v>w.to&&(v=w.to,c=""),C.className&&(l+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&w.from==f&&(u+=" "+C.startStyle),C.endStyle&&w.to==v&&(x||(x=[])).push(C.endStyle,w.to),C.title&&((h||(h={})).title=C.title),C.attributes)for(var k in C.attributes)(h||(h={}))[k]=C.attributes[k];C.collapsed&&(!d||qt(d.marker,C)<0)&&(d=w)}else w.from>f&&v>w.from&&(v=w.from)}if(x)for(var S=0;S<x.length;S+=2)x[S+1]==v&&(c+=" "+x[S]);if(!d||d.from==f)for(var E=0;E<y.length;++E)bn(t,0,y[E]);if(d&&(d.from||0)==f){if(bn(t,(null==d.to?p+1:d.to)-f,d.marker,null==d.from),null==d.to)return;d.to==f&&(d=!1)}}if(f>=p)break;for(var M=Math.min(p,v);;){if(g){var T=f+g.length;if(!d){var L=T>M?g.slice(0,M-f):g;t.addToken(t,L,a?a+l:l,u,f+L.length==v?c:"",s,h)}if(T>=M){g=g.slice(M-f),f=M;break}f=T,u=""}g=r.slice(o,o=n[m++]),a=fn(n[m++],t.cm.options)}}else for(var _=1;_<n.length;_+=2)t.addToken(t,r.slice(o,o=n[_]),fn(n[_+1],t.cm.options))}function Cn(e,t,n){this.line=t,this.rest=en(t),this.size=this.rest?tt(Y(this.rest))-n+1:1,this.node=this.text=null,this.hidden=rn(e,t)}function kn(e,t,n){for(var i,r=[],o=t;o<n;o=i){var a=new Cn(e.doc,Je(e.doc,o),o);i=o+a.size,r.push(a)}return r}var Sn=null;function En(e){Sn?Sn.ops.push(e):e.ownsGroup=Sn={ops:[e],delayedCallbacks:[]}}function Mn(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var i=0;i<e.ops.length;i++){var r=e.ops[i];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}}while(n<t.length)}function Tn(e,t){var n=e.ownsGroup;if(n)try{Mn(n)}finally{Sn=null,t(n)}}var Ln=null;function _n(e,t){var n=me(e,t);if(n.length){var i,r=Array.prototype.slice.call(arguments,2);Sn?i=Sn.delayedCallbacks:Ln?i=Ln:(i=Ln=[],setTimeout(Nn,0));for(var o=function(e){i.push((function(){return n[e].apply(null,r)}))},a=0;a<n.length;++a)o(a)}}function Nn(){var e=Ln;Ln=null;for(var t=0;t<e.length;++t)e[t]()}function An(e,t,n,i){for(var r=0;r<t.changes.length;r++){var o=t.changes[r];"text"==o?jn(e,t):"gutter"==o?Rn(e,t,n,i):"class"==o?In(e,t):"widget"==o&&On(e,t,i)}t.changes=null}function Pn(e){return e.node==e.text&&(e.node=_("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&s<8&&(e.node.style.zIndex=2)),e.node}function Dn(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var i=Pn(t);t.background=i.insertBefore(_("div",null,n),i.firstChild),e.display.input.setUneditable(t.background)}}function Bn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):mn(e,t)}function jn(e,t){var n=t.text.className,i=Bn(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,In(e,t)):n&&(t.text.className=n)}function In(e,t){Dn(e,t),t.line.wrapClass?Pn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Rn(e,t,n,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var r=Pn(t);t.gutterBackground=_("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),r.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=Pn(t),s=t.gutter=_("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(_("div",rt(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<e.display.gutterSpecs.length;++l){var c=e.display.gutterSpecs[l].className,u=o.hasOwnProperty(c)&&o[c];u&&s.appendChild(_("div",[u],"CodeMirror-gutter-elt","left: "+i.gutterLeft[c]+"px; width: "+i.gutterWidth[c]+"px"))}}}function On(e,t,n){t.alignable&&(t.alignable=null);for(var i=S("CodeMirror-linewidget"),r=t.node.firstChild,o=void 0;r;r=o)o=r.nextSibling,i.test(r.className)&&t.node.removeChild(r);Fn(e,t,n)}function Zn(e,t,n,i){var r=Bn(e,t);return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),In(e,t),Rn(e,t,n,i),Fn(e,t,i),t.node}function Fn(e,t,n){if(zn(e,t.line,t,n,!0),t.rest)for(var i=0;i<t.rest.length;i++)zn(e,t.rest[i],t,n,!1)}function zn(e,t,n,i,r){if(t.widgets)for(var o=Pn(n),a=0,s=t.widgets;a<s.length;++a){var l=s[a],c=_("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),Hn(l,c,n,i),e.display.input.setUneditable(c),r&&l.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),_n(l,"redraw")}}function Hn(e,t,n,i){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var r=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(r-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=r+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function Wn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!A(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),L(t.display.measure,_("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Gn(e,t){for(var n=Me(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Vn(e){return e.lineSpace.offsetTop}function qn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Un(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=L(e.measure,_("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(i.left)||isNaN(i.right)||(e.cachedPaddingH=i),i}function Kn(e){return z-e.display.nativeBarWidth}function Yn(e){return e.display.scroller.clientWidth-Kn(e)-e.display.barWidth}function Xn(e){return e.display.scroller.clientHeight-Kn(e)-e.display.barHeight}function Jn(e,t,n){var i=e.options.lineWrapping,r=i&&Yn(e);if(!t.measure.heights||i&&t.measure.width!=r){var o=t.measure.heights=[];if(i){t.measure.width=r;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],c=a[s+1];Math.abs(l.bottom-c.bottom)>2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Qn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var r=0;r<e.rest.length;r++)if(tt(e.rest[r])>n)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function $n(e,t){var n=tt(t=Qt(t)),i=e.display.externalMeasured=new Cn(e.doc,t,n);i.lineN=n;var r=i.built=mn(e,i);return i.text=r.pre,L(e.display.lineMeasure,r.pre),i}function ei(e,t,n,i){return ii(e,ni(e,t),n,i)}function ti(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ii(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function ni(e,t){var n=tt(t),i=ti(e,n);i&&!i.text?i=null:i&&i.changes&&(An(e,i,n,Ai(e)),e.curOp.forceUpdate=!0),i||(i=$n(e,t));var r=Qn(i,t,n);return{line:t,view:i,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function ii(e,t,n,i,r){t.before&&(n=-1);var o,a=n+(i||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Jn(e,t.view,t.rect),t.hasHeights=!0),(o=li(e,t,n,i)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:r?o.rtop:o.top,bottom:r?o.rbottom:o.bottom}}var ri,oi={left:0,right:0,top:0,bottom:0};function ai(e,t,n){for(var i,r,o,a,s,l,c=0;c<e.length;c+=3)if(s=e[c],l=e[c+1],t<s?(r=0,o=1,a="left"):t<l?o=1+(r=t-s):(c==e.length-3||t==l&&e[c+3]>t)&&(r=(o=l-s)-1,t>=l&&(a="right")),null!=r){if(i=e[c+2],s==l&&n==(i.insertLeft?"left":"right")&&(a=n),"left"==n&&0==r)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)i=e[2+(c-=3)],a="left";if("right"==n&&r==l-s)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)i=e[(c+=3)+2],a="right";break}return{node:i,start:r,end:o,collapse:a,coverStart:s,coverEnd:l}}function si(e,t){var n=oi;if("left"==t)for(var i=0;i<e.length&&(n=e[i]).left==n.right;i++);else for(var r=e.length-1;r>=0&&(n=e[r]).left==n.right;r--);return n}function li(e,t,n,i){var r,o=ai(t.map,n,i),l=o.node,c=o.start,u=o.end,d=o.collapse;if(3==l.nodeType){for(var h=0;h<4;h++){for(;c&&oe(t.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u<o.coverEnd&&oe(t.line.text.charAt(o.coverStart+u));)++u;if((r=a&&s<9&&0==c&&u==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():si(E(l,c,u).getClientRects(),i)).left||r.right||0==c)break;u=c,c-=1,d="right"}a&&s<11&&(r=ci(e.display.measure,r))}else{var p;c>0&&(d=i="right"),r=e.options.lineWrapping&&(p=l.getClientRects()).length>1?p["right"==i?p.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!r||!r.left&&!r.right)){var f=l.parentNode.getClientRects()[0];r=f?{left:f.left,right:f.left+Ni(e.display),top:f.top,bottom:f.bottom}:oi}for(var m=r.top-t.rect.top,g=r.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,x=0;x<y.length-1&&!(v<y[x]);x++);var b=x?y[x-1]:0,w=y[x],C={left:("right"==d?r.right:r.left)-t.rect.left,right:("left"==d?r.left:r.right)-t.rect.left,top:b,bottom:w};return r.left||r.right||(C.bogus=!0),e.options.singleCursorHeightPerLine||(C.rtop=m,C.rbottom=g),C}function ci(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Oe(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*i,bottom:t.bottom*i}}function ui(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function di(e){e.display.externalMeasure=null,T(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ui(e.display.view[t])}function hi(e){di(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function pi(){return u&&g?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function fi(){return u&&g?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function mi(e){var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;++n)e.widgets[n].above&&(t+=Wn(e.widgets[n]));return t}function gi(e,t,n,i,r){if(!r){var o=mi(t);n.top+=o,n.bottom+=o}if("line"==i)return n;i||(i="local");var a=an(t);if("local"==i?a+=Vn(e.display):a-=e.display.viewOffset,"page"==i||"window"==i){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==i?0:fi());var l=s.left+("window"==i?0:pi());n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function vi(e,t,n){if("div"==n)return t;var i=t.left,r=t.top;if("page"==n)i-=pi(),r-=fi();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();i+=o.left,r+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:i-a.left,top:r-a.top}}function yi(e,t,n,i,r){return i||(i=Je(e.doc,t.line)),gi(e,i,ei(e,i,t.ch,r),n)}function xi(e,t,n,i,r,o){function a(t,a){var s=ii(e,r,t,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,gi(e,i,s,n)}i=i||Je(e.doc,t.line),r||(r=ni(e,i));var s=he(i,e.doc.direction),l=t.ch,c=t.sticky;if(l>=i.text.length?(l=i.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(e,t,n){return a(n?e-1:e,1==s[t].level!=n)}var d=ue(s,l,c),h=ce,p=u(l,d,"before"==c);return null!=h&&(p.other=u(l,h,"before"!=c)),p}function bi(e,t){var n=0;t=ht(e.doc,t),e.options.lineWrapping||(n=Ni(e.display)*t.ch);var i=Je(e.doc,t.line),r=an(i)+Vn(e.display);return{left:n,right:n,top:r,bottom:r+i.height}}function wi(e,t,n,i,r){var o=ot(e,t,n);return o.xRel=r,i&&(o.outside=i),o}function Ci(e,t,n){var i=e.doc;if((n+=e.display.viewOffset)<0)return wi(i.first,0,null,-1,-1);var r=nt(i,n),o=i.first+i.size-1;if(r>o)return wi(i.first+i.size-1,Je(i,o).text.length,null,1,1);t<0&&(t=0);for(var a=Je(i,r);;){var s=Mi(e,a,r,t,n),l=Xt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==r)return c;a=Je(i,r=c.line)}}function ki(e,t,n,i){i-=mi(t);var r=t.text.length,o=se((function(t){return ii(e,n,t-1).bottom<=i}),r,0);return{begin:o,end:r=se((function(t){return ii(e,n,t).top>i}),o,r)}}function Si(e,t,n,i){return n||(n=ni(e,t)),ki(e,t,n,gi(e,t,ii(e,n,i),"line").top)}function Ei(e,t,n,i){return!(e.bottom<=n)&&(e.top>n||(i?e.left:e.right)>t)}function Mi(e,t,n,i,r){r-=an(t);var o=ni(e,t),a=mi(t),s=0,l=t.text.length,c=!0,u=he(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?Li:Ti)(e,t,n,o,u,i,r);s=(c=1!=d.level)?d.from:d.to-1,l=c?d.to:d.from-1}var h,p,f=null,m=null,g=se((function(t){var n=ii(e,o,t);return n.top+=a,n.bottom+=a,!!Ei(n,i,r,!1)&&(n.top<=r&&n.left<=i&&(f=t,m=n),!0)}),s,l),v=!1;if(m){var y=i-m.left<m.right-i,x=y==c;g=f+(x?0:1),p=x?"after":"before",h=y?m.left:m.right}else{c||g!=l&&g!=s||g++,p=0==g?"after":g==t.text.length?"before":ii(e,o,g-(c?1:0)).bottom+a<=r==c?"after":"before";var b=xi(e,ot(n,g,p),"line",t,o);h=b.left,v=r<b.top?-1:r>=b.bottom?1:0}return wi(n,g=ae(t.text,g,1),p,v,i-h)}function Ti(e,t,n,i,r,o,a){var s=se((function(s){var l=r[s],c=1!=l.level;return Ei(xi(e,ot(n,c?l.to:l.from,c?"before":"after"),"line",t,i),o,a,!0)}),0,r.length-1),l=r[s];if(s>0){var c=1!=l.level,u=xi(e,ot(n,c?l.from:l.to,c?"after":"before"),"line",t,i);Ei(u,o,a,!0)&&u.top>a&&(l=r[s-1])}return l}function Li(e,t,n,i,r,o,a){var s=ki(e,t,i,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,h=0;h<r.length;h++){var p=r[h];if(!(p.from>=c||p.to<=l)){var f=ii(e,i,1!=p.level?Math.min(c,p.to)-1:Math.max(l,p.from)).right,m=f<o?o-f+1e9:f-o;(!u||d>m)&&(u=p,d=m)}}return u||(u=r[r.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function _i(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==ri){ri=_("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ri.appendChild(document.createTextNode("x")),ri.appendChild(_("br"));ri.appendChild(document.createTextNode("x"))}L(e.measure,ri);var n=ri.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),T(e.measure),n||1}function Ni(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=_("span","xxxxxxxxxx"),n=_("pre",[t],"CodeMirror-line-like");L(e.measure,n);var i=t.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function Ai(e){for(var t=e.display,n={},i={},r=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+r,i[s]=o.clientWidth}return{fixedPos:Pi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function Pi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Di(e){var t=_i(e.display),n=e.options.lineWrapping,i=n&&Math.max(5,e.display.scroller.clientWidth/Ni(e.display)-3);return function(r){if(rn(e.doc,r))return 0;var o=0;if(r.widgets)for(var a=0;a<r.widgets.length;a++)r.widgets[a].height&&(o+=r.widgets[a].height);return n?o+(Math.ceil(r.text.length/i)||1)*t:o+t}}function Bi(e){var t=e.doc,n=Di(e);t.iter((function(e){var t=n(e);t!=e.height&&et(e,t)}))}function ji(e,t,n,i){var r=e.display;if(!n&&"true"==Me(t).getAttribute("cm-not-content"))return null;var o,a,s=r.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,a=t.clientY-s.top}catch(e){return null}var l,c=Ci(e,o,a);if(i&&c.xRel>0&&(l=Je(e.doc,c.line).text).length==c.ch){var u=O(l,l.length,e.options.tabSize)-l.length;c=ot(c.line,Math.max(0,Math.round((o-Un(e.display).left)/Ni(e.display))-u))}return c}function Ii(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,i=0;i<n.length;i++)if((t-=n[i].size)<0)return i}function Ri(e,t,n,i){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),i||(i=0);var r=e.display;if(i&&n<r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>t)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)Nt&&tn(e.doc,t)<r.viewTo&&Zi(e);else if(n<=r.viewFrom)Nt&&nn(e.doc,n+i)>r.viewFrom?Zi(e):(r.viewFrom+=i,r.viewTo+=i);else if(t<=r.viewFrom&&n>=r.viewTo)Zi(e);else if(t<=r.viewFrom){var o=Fi(e,n,n+i,1);o?(r.view=r.view.slice(o.index),r.viewFrom=o.lineN,r.viewTo+=i):Zi(e)}else if(n>=r.viewTo){var a=Fi(e,t,t,-1);a?(r.view=r.view.slice(0,a.index),r.viewTo=a.lineN):Zi(e)}else{var s=Fi(e,t,t,-1),l=Fi(e,n,n+i,1);s&&l?(r.view=r.view.slice(0,s.index).concat(kn(e,s.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=i):Zi(e)}var c=r.externalMeasured;c&&(n<c.lineN?c.lineN+=i:t<c.lineN+c.size&&(r.externalMeasured=null))}function Oi(e,t,n){e.curOp.viewChanged=!0;var i=e.display,r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size&&(i.externalMeasured=null),!(t<i.viewFrom||t>=i.viewTo)){var o=i.view[Ii(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==F(a,n)&&a.push(n)}}}function Zi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Fi(e,t,n,i){var r,o=Ii(e,t),a=e.display.view;if(!Nt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l<o;l++)s+=a[l].size;if(s!=t){if(i>0){if(o==a.length-1)return null;r=s+a[o].size-t,o++}else r=s-t;t+=r,n+=r}for(;tn(e.doc,n)!=n;){if(o==(i<0?0:a.length-1))return null;n+=i*a[o-(i<0?1:0)].size,o+=i}return{index:o,lineN:n}}function zi(e,t,n){var i=e.display;0==i.view.length||t>=i.viewTo||n<=i.viewFrom?(i.view=kn(e,t,n),i.viewFrom=t):(i.viewFrom>t?i.view=kn(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(Ii(e,t))),i.viewFrom=t,i.viewTo<n?i.view=i.view.concat(kn(e,i.viewTo,n)):i.viewTo>n&&(i.view=i.view.slice(0,Ii(e,n)))),i.viewTo=n}function Hi(e){for(var t=e.display.view,n=0,i=0;i<t.length;i++){var r=t[i];r.hidden||r.node&&!r.changes||++n}return n}function Wi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Gi(e,t){void 0===t&&(t=!0);for(var n=e.doc,i={},r=i.cursors=document.createDocumentFragment(),o=i.selection=document.createDocumentFragment(),a=0;a<n.sel.ranges.length;a++)if(t||a!=n.sel.primIndex){var s=n.sel.ranges[a];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var l=s.empty();(l||e.options.showCursorWhenSelecting)&&Vi(e,s.head,r),l||Ui(e,s,o)}}return i}function Vi(e,t,n){var i=xi(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=n.appendChild(_("div"," ","CodeMirror-cursor"));if(r.style.left=i.left+"px",r.style.top=i.top+"px",r.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var o=n.appendChild(_("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=i.other.left+"px",o.style.top=i.other.top+"px",o.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function qi(e,t){return e.top-t.top||e.left-t.left}function Ui(e,t,n){var i=e.display,r=e.doc,o=document.createDocumentFragment(),a=Un(e.display),s=a.left,l=Math.max(i.sizerWidth,Yn(e)-i.sizer.offsetLeft)-a.right,c="ltr"==r.direction;function u(e,t,n,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),o.appendChild(_("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?l-e:n)+"px;\n height: "+(i-t)+"px"))}function d(t,n,i){var o,a,d=Je(r,t),h=d.text.length;function p(n,i){return yi(e,ot(t,n),"div",d,i)}function f(t,n,i){var r=Si(e,d,null,t),o="ltr"==n==("after"==i)?"left":"right";return p("after"==i?r.begin:r.end-(/\s/.test(d.text.charAt(r.end-1))?2:1),o)[o]}var m=he(d,r.direction);return le(m,n||0,null==i?h:i,(function(e,t,r,d){var g="ltr"==r,v=p(e,g?"left":"right"),y=p(t-1,g?"right":"left"),x=null==n&&0==e,b=null==i&&t==h,w=0==d,C=!m||d==m.length-1;if(y.top-v.top<=3){var k=(c?b:x)&&C,S=(c?x:b)&&w?s:(g?v:y).left,E=k?l:(g?y:v).right;u(S,v.top,E-S,v.bottom)}else{var M,T,L,_;g?(M=c&&x&&w?s:v.left,T=c?l:f(e,r,"before"),L=c?s:f(t,r,"after"),_=c&&b&&C?l:y.right):(M=c?f(e,r,"before"):s,T=!c&&x&&w?l:v.right,L=!c&&b&&C?s:y.left,_=c?f(t,r,"after"):l),u(M,v.top,T-M,v.bottom),v.bottom<y.top&&u(s,v.bottom,null,y.top),u(L,y.top,_-L,y.bottom)}(!o||qi(v,o)<0)&&(o=v),qi(y,o)<0&&(o=y),(!a||qi(v,a)<0)&&(a=v),qi(y,a)<0&&(a=y)})),{start:o,end:a}}var h=t.from(),p=t.to();if(h.line==p.line)d(h.line,h.ch,p.ch);else{var f=Je(r,h.line),m=Je(r,p.line),g=Qt(f)==Qt(m),v=d(h.line,h.ch,g?f.text.length+1:null).end,y=d(p.line,g?0:null,p.ch).start;g&&(v.top<y.top-2?(u(v.right,v.top,null,v.bottom),u(s,y.top,y.left,y.bottom)):u(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&u(s,v.bottom,null,y.top)}n.appendChild(o)}function Ki(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||Qi(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Yi(e){e.state.focused||(e.display.input.focus(),Ji(e))}function Xi(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Qi(e))}),100)}function Ji(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ve(e,"focus",e,t),e.state.focused=!0,D(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Ki(e))}function Qi(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ve(e,"blur",e,t),e.state.focused=!1,M(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function $i(e){for(var t=e.display,n=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var r=t.view[i],o=e.options.lineWrapping,l=void 0,c=0;if(!r.hidden){if(a&&s<8){var u=r.node.offsetTop+r.node.offsetHeight;l=u-n,n=u}else{var d=r.node.getBoundingClientRect();l=d.bottom-d.top,!o&&r.text.firstChild&&(c=r.text.firstChild.getBoundingClientRect().right-d.left-1)}var h=r.line.height-l;if((h>.005||h<-.005)&&(et(r.line,l),er(r.line),r.rest))for(var p=0;p<r.rest.length;p++)er(r.rest[p]);if(c>e.display.sizerWidth){var f=Math.ceil(c/Ni(e.display));f>e.display.maxLineLength&&(e.display.maxLineLength=f,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}}function er(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],i=n.node.parentNode;i&&(n.height=i.offsetHeight)}}function tr(e,t,n){var i=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;i=Math.floor(i-Vn(e));var r=n&&null!=n.bottom?n.bottom:i+e.wrapper.clientHeight,o=nt(t,i),a=nt(t,r);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<o?(o=s,a=nt(t,an(Je(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=a&&(o=nt(t,an(Je(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function nr(e,t){if(!ye(e,"scrollCursorIntoView")){var n=e.display,i=n.sizer.getBoundingClientRect(),r=null;if(t.top+i.top<0?r=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!f){var o=_("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Vn(e.display))+"px;\n height: "+(t.bottom-t.top+Kn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(r),e.display.lineSpace.removeChild(o)}}}function ir(e,t,n,i){var r;null==i&&(i=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?ot(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?ot(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=xi(e,t),l=n&&n!=t?xi(e,n):s,c=or(e,r={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-i,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+i}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(hr(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(fr(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return r}function rr(e,t){var n=or(e,t);null!=n.scrollTop&&hr(e,n.scrollTop),null!=n.scrollLeft&&fr(e,n.scrollLeft)}function or(e,t){var n=e.display,i=_i(e.display);t.top<0&&(t.top=0);var r=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Xn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+qn(n),l=t.top<i,c=t.bottom>s-i;if(t.top<r)a.scrollTop=l?0:t.top;else if(t.bottom>r+o){var u=Math.min(t.top,(c?s:t.bottom)-o);u!=r&&(a.scrollTop=u)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-d,p=Yn(e)-n.gutters.offsetWidth,f=t.right-t.left>p;return f&&(t.right=t.left+p),t.left<10?a.scrollLeft=0:t.left<h?a.scrollLeft=Math.max(0,t.left+d-(f?0:10)):t.right>p+h-3&&(a.scrollLeft=t.right+(f?0:10)-p),a}function ar(e,t){null!=t&&(ur(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function sr(e){ur(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function lr(e,t,n){null==t&&null==n||ur(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function cr(e,t){ur(e),e.curOp.scrollToPos=t}function ur(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,dr(e,bi(e,t.from),bi(e,t.to),t.margin))}function dr(e,t,n,i){var r=or(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-i,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+i});lr(e,r.scrollLeft,r.scrollTop)}function hr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Wr(e,{top:t}),pr(e,t,!0),n&&Wr(e),jr(e,100))}function pr(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function fr(e,t,n,i){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i||(e.doc.scrollLeft=t,Ur(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function mr(e){var t=e.display,n=t.gutters.offsetWidth,i=Math.round(e.doc.height+qn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+Kn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var gr=function(e,t,n){this.cm=n;var i=this.vert=_("div",[_("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=_("div",[_("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=r.tabIndex=-1,e(i),e(r),fe(i,"scroll",(function(){i.clientHeight&&t(i.scrollTop,"vertical")})),fe(r,"scroll",(function(){r.clientWidth&&t(r.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};gr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var r=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:t?i:0}},gr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},gr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},gr.prototype.zeroWidthHack=function(){var e=y&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Z,this.disableVert=new Z},gr.prototype.enableZeroWidthBar=function(e,t,n){function i(){var r=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,i)}e.style.pointerEvents="auto",t.set(1e3,i)},gr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var vr=function(){};function yr(e,t){t||(t=mr(e));var n=e.display.barWidth,i=e.display.barHeight;xr(e,t);for(var r=0;r<4&&n!=e.display.barWidth||i!=e.display.barHeight;r++)n!=e.display.barWidth&&e.options.lineWrapping&&$i(e),xr(e,mr(e)),n=e.display.barWidth,i=e.display.barHeight}function xr(e,t){var n=e.display,i=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}vr.prototype.update=function(){return{bottom:0,right:0}},vr.prototype.setScrollLeft=function(){},vr.prototype.setScrollTop=function(){},vr.prototype.clear=function(){};var br={native:gr,null:vr};function wr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&M(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new br[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),fe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?fr(e,t):hr(e,t)}),e),e.display.scrollbars.addClass&&D(e.display.wrapper,e.display.scrollbars.addClass)}var Cr=0;function kr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.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:++Cr},En(e.curOp)}function Sr(e){var t=e.curOp;t&&Tn(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;Er(e)}))}function Er(e){for(var t=e.ops,n=0;n<t.length;n++)Mr(t[n]);for(var i=0;i<t.length;i++)Tr(t[i]);for(var r=0;r<t.length;r++)Lr(t[r]);for(var o=0;o<t.length;o++)_r(t[o]);for(var a=0;a<t.length;a++)Nr(t[a])}function Mr(e){var t=e.cm,n=t.display;Or(t),e.updateMaxLine&&ln(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Rr(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Tr(e){e.updatedDisplay=e.mustUpdate&&zr(e.cm,e.update)}function Lr(e){var t=e.cm,n=t.display;e.updatedDisplay&&$i(t),e.barMeasure=mr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ei(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Kn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Yn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function _r(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&fr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==P();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&yr(t,e.barMeasure),e.updatedDisplay&&qr(t,e.barMeasure),e.selectionChanged&&Ki(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Yi(e.cm)}function Nr(e){var t=e.cm,n=t.display,i=t.doc;e.updatedDisplay&&Hr(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&pr(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&fr(t,e.scrollLeft,!0,!0),e.scrollToPos&&nr(t,ir(t,ht(i,e.scrollToPos.from),ht(i,e.scrollToPos.to),e.scrollToPos.margin));var r=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(r)for(var a=0;a<r.length;++a)r[a].lines.length||ve(r[a],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&ve(o[s],"unhide");n.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ve(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Ar(e,t){if(e.curOp)return t();kr(e);try{return t()}finally{Sr(e)}}function Pr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);kr(e);try{return t.apply(e,arguments)}finally{Sr(e)}}}function Dr(e){return function(){if(this.curOp)return e.apply(this,arguments);kr(this);try{return e.apply(this,arguments)}finally{Sr(this)}}}function Br(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);kr(t);try{return e.apply(this,arguments)}finally{Sr(t)}}}function jr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,I(Ir,e))}function Ir(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,i=xt(e,t.highlightFrontier),r=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(i.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?Ue(t.mode,i.state):null,l=vt(e,o,i,!0);s&&(i.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!d&&h<a.length;++h)d=a[h]!=o.styles[h];d&&r.push(i.line),o.stateAfter=i.save(),i.nextLine()}else o.text.length<=e.options.maxHighlightLength&&bt(e,o.text,i),o.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>n)return jr(e,e.options.workDelay),!0})),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),r.length&&Ar(e,(function(){for(var t=0;t<r.length;t++)Oi(e,r[t],"text")}))}}var Rr=function(e,t,n){var i=e.display;this.viewport=t,this.visible=tr(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Yn(e),this.force=n,this.dims=Ai(e),this.events=[]};function Or(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Kn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Kn(e)+"px",t.scrollbarsClipped=!0)}function Zr(e){if(e.hasFocus())return null;var t=P();if(!t||!A(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&A(e.display.lineDiv,i.anchorNode)&&(n.anchorNode=i.anchorNode,n.anchorOffset=i.anchorOffset,n.focusNode=i.focusNode,n.focusOffset=i.focusOffset)}return n}function Fr(e){if(e&&e.activeElt&&e.activeElt!=P()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&A(document.body,e.anchorNode)&&A(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}function zr(e,t){var n=e.display,i=e.doc;if(t.editorIsHidden)return Zi(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Hi(e))return!1;Kr(e)&&(Zi(e),t.dims=Ai(e));var r=i.first+i.size,o=Math.max(t.visible.from-e.options.viewportMargin,i.first),a=Math.min(r,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(i.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(r,n.viewTo)),Nt&&(o=tn(e.doc,o),a=nn(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;zi(e,o,a),n.viewOffset=an(Je(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=Hi(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Zr(e);return l>4&&(n.lineDiv.style.display="none"),Gr(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Fr(c),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,jr(e,400)),n.updateLineNumbers=null,!0}function Hr(e,t){for(var n=t.viewport,i=!0;;i=!1){if(i&&e.options.lineWrapping&&t.oldDisplayWidth!=Yn(e))i&&(t.visible=tr(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+qn(e.display)-Xn(e),n.top)}),t.visible=tr(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!zr(e,t))break;$i(e);var r=mr(e);Wi(e),yr(e,r),qr(e,r),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Wr(e,t){var n=new Rr(e,t);if(zr(e,n)){$i(e),Hr(e,n);var i=mr(e);Wi(e),yr(e,i),qr(e,i),n.finish()}}function Gr(e,t,n){var i=e.display,r=e.options.lineNumbers,o=i.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return l&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=i.view,u=i.viewFrom,d=0;d<c.length;d++){var h=c[d];if(h.hidden);else if(h.node&&h.node.parentNode==o){for(;a!=h.node;)a=s(a);var p=r&&null!=t&&t<=u&&h.lineNumber;h.changes&&(F(h.changes,"gutter")>-1&&(p=!1),An(e,h,u,n)),p&&(T(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(rt(e.options,u)))),a=h.node.nextSibling}else{var f=Zn(e,h,u,n);o.insertBefore(f,a)}u+=h.size}for(;a;)a=s(a)}function Vr(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function qr(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Kn(e)+"px"}function Ur(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var i=Pi(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,o=i+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=i+r+"px")}}function Kr(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=rt(e.options,t.first+t.size-1),i=e.display;if(n.length!=i.lineNumChars){var r=i.measure.appendChild(_("div",[_("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=r.firstChild.offsetWidth,a=r.offsetWidth-o;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(o,i.lineGutter.offsetWidth-a)+1,i.lineNumWidth=i.lineNumInnerWidth+a,i.lineNumChars=i.lineNumInnerWidth?n.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Vr(e.display),!0}return!1}function Yr(e,t){for(var n=[],i=!1,r=0;r<e.length;r++){var o=e[r],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;i=!0}n.push({className:o,style:a})}return t&&!i&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Xr(e){var t=e.gutters,n=e.gutterSpecs;T(t),e.lineGutter=null;for(var i=0;i<n.length;++i){var r=n[i],o=r.className,a=r.style,s=t.appendChild(_("div",null,"CodeMirror-gutter "+o));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==o&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Vr(e)}function Jr(e){Xr(e.display),Ri(e),Ur(e)}function Qr(e,t,i,r){var o=this;this.input=i,o.scrollbarFiller=_("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=_("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=N("div",null,"CodeMirror-code"),o.selectionDiv=_("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=_("div",null,"CodeMirror-cursors"),o.measure=_("div",null,"CodeMirror-measure"),o.lineMeasure=_("div",null,"CodeMirror-measure"),o.lineSpace=N("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var c=N("div",[o.lineSpace],"CodeMirror-lines");o.mover=_("div",[c],null,"position: relative"),o.sizer=_("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=_("div",null,null,"position: absolute; height: "+z+"px; width: 1px;"),o.gutters=_("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=_("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=_("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),a&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||n&&v||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=Yr(r.gutters,r.lineNumbers),Xr(o),i.init(o)}Rr.prototype.signal=function(e,t){be(e,t)&&this.events.push(arguments)},Rr.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ve.apply(null,this.events[e])};var $r=0,eo=null;function to(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function no(e){var t=to(e);return t.x*=eo,t.y*=eo,t}function io(e,t){var i=to(t),r=i.x,o=i.y,a=e.display,s=a.scroller,c=s.scrollWidth>s.clientWidth,u=s.scrollHeight>s.clientHeight;if(r&&c||o&&u){if(o&&y&&l)e:for(var h=t.target,p=a.view;h!=s;h=h.parentNode)for(var f=0;f<p.length;f++)if(p[f].node==h){e.display.currentWheelTarget=h;break e}if(r&&!n&&!d&&null!=eo)return o&&u&&hr(e,Math.max(0,s.scrollTop+o*eo)),fr(e,Math.max(0,s.scrollLeft+r*eo)),(!o||o&&u)&&Ce(t),void(a.wheelStartX=null);if(o&&null!=eo){var m=o*eo,g=e.doc.scrollTop,v=g+a.wrapper.clientHeight;m<0?g=Math.max(0,g+m-50):v=Math.min(e.doc.height,v+m+50),Wr(e,{top:g,bottom:v})}$r<20&&(null==a.wheelStartX?(a.wheelStartX=s.scrollLeft,a.wheelStartY=s.scrollTop,a.wheelDX=r,a.wheelDY=o,setTimeout((function(){if(null!=a.wheelStartX){var e=s.scrollLeft-a.wheelStartX,t=s.scrollTop-a.wheelStartY,n=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,n&&(eo=(eo*$r+n)/($r+1),++$r)}}),200)):(a.wheelDX+=r,a.wheelDY+=o))}}a?eo=-.53:n?eo=15:u?eo=-.7:h&&(eo=-1/3);var ro=function(e,t){this.ranges=e,this.primIndex=t};ro.prototype.primary=function(){return this.ranges[this.primIndex]},ro.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],i=e.ranges[t];if(!st(n.anchor,i.anchor)||!st(n.head,i.head))return!1}return!0},ro.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new oo(lt(this.ranges[t].anchor),lt(this.ranges[t].head));return new ro(e,this.primIndex)},ro.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},ro.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var i=this.ranges[n];if(at(t,i.from())>=0&&at(e,i.to())<=0)return n}return-1};var oo=function(e,t){this.anchor=e,this.head=t};function ao(e,t,n){var i=e&&e.options.selectionsMayTouch,r=t[n];t.sort((function(e,t){return at(e.from(),t.from())})),n=F(t,r);for(var o=1;o<t.length;o++){var a=t[o],s=t[o-1],l=at(s.to(),a.from());if(i&&!a.empty()?l>0:l>=0){var c=ut(s.from(),a.from()),u=ct(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new oo(d?u:c,d?c:u))}}return new ro(t,n)}function so(e,t){return new ro([new oo(e,t||e)],0)}function lo(e){return e.text?ot(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function co(e,t){if(at(e,t.from)<0)return e;if(at(e,t.to)<=0)return lo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=lo(t).ch-t.to.ch),ot(n,i)}function uo(e,t){for(var n=[],i=0;i<e.sel.ranges.length;i++){var r=e.sel.ranges[i];n.push(new oo(co(r.anchor,t),co(r.head,t)))}return ao(e.cm,n,e.sel.primIndex)}function ho(e,t,n){return e.line==t.line?ot(n.line,e.ch-t.ch+n.ch):ot(n.line+(e.line-t.line),e.ch)}function po(e,t,n){for(var i=[],r=ot(e.first,0),o=r,a=0;a<t.length;a++){var s=t[a],l=ho(s.from,r,o),c=ho(lo(s),r,o);if(r=s.to,o=c,"around"==n){var u=e.sel.ranges[a],d=at(u.head,u.anchor)<0;i[a]=new oo(d?c:l,d?l:c)}else i[a]=new oo(l,l)}return new ro(i,e.sel.primIndex)}function fo(e){e.doc.mode=Ge(e.options,e.doc.modeOption),mo(e)}function mo(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,jr(e,100),e.state.modeGen++,e.curOp&&Ri(e)}function go(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Y(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function vo(e,t,n,i){function r(e){return n?n[e]:null}function o(e,n,r){un(e,n,r,i),_n(e,"change",e,t)}function a(e,t){for(var n=[],o=e;o<t;++o)n.push(new cn(c[o],r(o),i));return n}var s=t.from,l=t.to,c=t.text,u=Je(e,s.line),d=Je(e,l.line),h=Y(c),p=r(c.length-1),f=l.line-s.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(go(e,t)){var m=a(0,c.length-1);o(d,d.text,p),f&&e.remove(s.line,f),m.length&&e.insert(s.line,m)}else if(u==d)if(1==c.length)o(u,u.text.slice(0,s.ch)+h+u.text.slice(l.ch),p);else{var g=a(1,c.length-1);g.push(new cn(h+u.text.slice(l.ch),p,i)),o(u,u.text.slice(0,s.ch)+c[0],r(0)),e.insert(s.line+1,g)}else if(1==c.length)o(u,u.text.slice(0,s.ch)+c[0]+d.text.slice(l.ch),r(0)),e.remove(s.line+1,f);else{o(u,u.text.slice(0,s.ch)+c[0],r(0)),o(d,h+d.text.slice(l.ch),p);var v=a(1,c.length-1);f>1&&e.remove(s.line+1,f-1),e.insert(s.line+1,v)}_n(e,"change",e,t)}function yo(e,t,n){function i(e,r,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var s=e.linked[a];if(s.doc!=r){var l=o&&s.sharedHist;n&&!l||(t(s.doc,l),i(s.doc,e,l))}}}i(e,null,!0)}function xo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Bi(e),fo(e),bo(e),e.options.lineWrapping||ln(e),e.options.mode=t.modeOption,Ri(e)}function bo(e){("rtl"==e.doc.direction?D:M)(e.display.lineDiv,"CodeMirror-rtl")}function wo(e){Ar(e,(function(){bo(e),Ri(e)}))}function Co(e){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=e||1}function ko(e,t){var n={from:lt(t.from),to:lo(t),text:Qe(e,t.from,t.to)};return No(e,n,t.from.line,t.to.line+1),yo(e,(function(e){return No(e,n,t.from.line,t.to.line+1)}),!0),n}function So(e){for(;e.length&&Y(e).ranges;)e.pop()}function Eo(e,t){return t?(So(e.done),Y(e.done)):e.done.length&&!Y(e.done).ranges?Y(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Y(e.done)):void 0}function Mo(e,t,n,i){var r=e.history;r.undone.length=0;var o,a,s=+new Date;if((r.lastOp==i||r.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&r.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=Eo(r,r.lastOp==i)))a=Y(o.changes),0==at(t.from,t.to)&&0==at(t.from,a.to)?a.to=lo(t):o.changes.push(ko(e,t));else{var l=Y(r.done);for(l&&l.ranges||_o(e.sel,r.done),o={changes:[ko(e,t)],generation:r.generation},r.done.push(o);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=s,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=t.origin,a||ve(e,"historyAdded")}function To(e,t,n,i){var r=t.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Lo(e,t,n,i){var r=e.history,o=i&&i.origin;n==r.lastSelOp||o&&r.lastSelOrigin==o&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==o||To(e,o,Y(r.done),t))?r.done[r.done.length-1]=t:_o(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=o,r.lastSelOp=n,i&&!1!==i.clearRedo&&So(r.undone)}function _o(e,t){var n=Y(t);n&&n.ranges&&n.equals(e)||t.push(e)}function No(e,t,n,i){var r=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,i),(function(n){n.markedSpans&&((r||(r=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Ao(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Po(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var i=[],r=0;r<t.text.length;++r)i.push(Ao(n[r]));return i}function Do(e,t){var n=Po(e,t),i=Zt(e,t);if(!n)return i;if(!i)return n;for(var r=0;r<n.length;++r){var o=n[r],a=i[r];if(o&&a)e:for(var s=0;s<a.length;++s){for(var l=a[s],c=0;c<o.length;++c)if(o[c].marker==l.marker)continue e;o.push(l)}else a&&(n[r]=a)}return n}function Bo(e,t,n){for(var i=[],r=0;r<e.length;++r){var o=e[r];if(o.ranges)i.push(n?ro.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];i.push({changes:s});for(var l=0;l<a.length;++l){var c=a[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&F(t,Number(u[1]))>-1&&(Y(s)[d]=c[d],delete c[d])}}}return i}function jo(e,t,n,i){if(i){var r=e.anchor;if(n){var o=at(t,r)<0;o!=at(n,r)<0?(r=t,t=n):o!=at(t,n)<0&&(t=n)}return new oo(r,t)}return new oo(n||t,t)}function Io(e,t,n,i,r){null==r&&(r=e.cm&&(e.cm.display.shift||e.extend)),Ho(e,new ro([jo(e.sel.primary(),t,n,r)],0),i)}function Ro(e,t,n){for(var i=[],r=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)i[o]=jo(e.sel.ranges[o],t[o],null,r);Ho(e,ao(e.cm,i,e.sel.primIndex),n)}function Oo(e,t,n,i){var r=e.sel.ranges.slice(0);r[t]=n,Ho(e,ao(e.cm,r,e.sel.primIndex),i)}function Zo(e,t,n,i){Ho(e,so(t,n),i)}function Fo(e,t,n){var i={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new oo(ht(e,t[n].anchor),ht(e,t[n].head))},origin:n&&n.origin};return ve(e,"beforeSelectionChange",e,i),e.cm&&ve(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?ao(e.cm,i.ranges,i.ranges.length-1):t}function zo(e,t,n){var i=e.history.done,r=Y(i);r&&r.ranges?(i[i.length-1]=t,Wo(e,t,n)):Ho(e,t,n)}function Ho(e,t,n){Wo(e,t,n),Lo(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Wo(e,t,n){(be(e,"beforeSelectionChange")||e.cm&&be(e.cm,"beforeSelectionChange"))&&(t=Fo(e,t,n));var i=n&&n.bias||(at(t.primary().head,e.sel.primary().head)<0?-1:1);Go(e,qo(e,t,i,!0)),n&&!1===n.scroll||!e.cm||sr(e.cm)}function Go(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,xe(e.cm)),_n(e,"cursorActivity",e))}function Vo(e){Go(e,qo(e,e.sel,null,!1))}function qo(e,t,n,i){for(var r,o=0;o<t.ranges.length;o++){var a=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],l=Ko(e,a.anchor,s&&s.anchor,n,i),c=Ko(e,a.head,s&&s.head,n,i);(r||l!=a.anchor||c!=a.head)&&(r||(r=t.ranges.slice(0,o)),r[o]=new oo(l,c))}return r?ao(e.cm,r,t.primIndex):t}function Uo(e,t,n,i,r){var o=Je(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],l=s.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(c?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(u?s.to>=t.ch:s.to>t.ch))){if(r&&(ve(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var d=l.find(i<0?1:-1),h=void 0;if((i<0?u:c)&&(d=Yo(e,d,-i,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(h=at(d,n))&&(i<0?h<0:h>0))return Uo(e,d,t,i,r)}var p=l.find(i<0?-1:1);return(i<0?c:u)&&(p=Yo(e,p,i,p.line==t.line?o:null)),p?Uo(e,p,t,i,r):null}}return t}function Ko(e,t,n,i,r){var o=i||1,a=Uo(e,t,n,o,r)||!r&&Uo(e,t,n,o,!0)||Uo(e,t,n,-o,r)||!r&&Uo(e,t,n,-o,!0);return a||(e.cantEdit=!0,ot(e.first,0))}function Yo(e,t,n,i){return n<0&&0==t.ch?t.line>e.first?ht(e,ot(t.line-1)):null:n>0&&t.ch==(i||Je(e,t.line)).text.length?t.line<e.first+e.size-1?ot(t.line+1,0):null:new ot(t.line,t.ch+n)}function Xo(e){e.setSelection(ot(e.firstLine(),0),ot(e.lastLine()),W)}function Jo(e,t,n){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return n&&(i.update=function(t,n,r,o){t&&(i.from=ht(e,t)),n&&(i.to=ht(e,n)),r&&(i.text=r),void 0!==o&&(i.origin=o)}),ve(e,"beforeChange",e,i),e.cm&&ve(e.cm,"beforeChange",e.cm,i),i.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function Qo(e,t,n){if(e.cm){if(!e.cm.curOp)return Pr(e.cm,Qo)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(be(e,"beforeChange")||e.cm&&be(e.cm,"beforeChange"))||(t=Jo(e,t,!0))){var i=_t&&!n&&zt(e,t.from,t.to);if(i)for(var r=i.length-1;r>=0;--r)$o(e,{from:i[r].from,to:i[r].to,text:r?[""]:t.text,origin:t.origin});else $o(e,t)}}function $o(e,t){if(1!=t.text.length||""!=t.text[0]||0!=at(t.from,t.to)){var n=uo(e,t);Mo(e,t,n,e.cm?e.cm.curOp.id:NaN),na(e,t,n,Zt(e,t));var i=[];yo(e,(function(e,n){n||-1!=F(i,e.history)||(sa(e.history,t),i.push(e.history)),na(e,t,null,Zt(e,t))}))}}function ea(e,t,n){var i=e.cm&&e.cm.state.suppressEdits;if(!i||n){for(var r,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,c=0;c<s.length&&(r=s[c],n?!r.ranges||r.equals(e.sel):r.ranges);c++);if(c!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(r=s.pop()).ranges){if(i)return void s.push(r);break}if(_o(r,l),n&&!r.equals(e.sel))return void Ho(e,r,{clearRedo:!1});a=r}var u=[];_o(a,l),l.push({changes:u,generation:o.generation}),o.generation=r.generation||++o.maxGeneration;for(var d=be(e,"beforeChange")||e.cm&&be(e.cm,"beforeChange"),h=function(n){var i=r.changes[n];if(i.origin=t,d&&!Jo(e,i,!1))return s.length=0,{};u.push(ko(e,i));var o=n?uo(e,i):Y(s);na(e,i,o,Do(e,i)),!n&&e.cm&&e.cm.scrollIntoView({from:i.from,to:lo(i)});var a=[];yo(e,(function(e,t){t||-1!=F(a,e.history)||(sa(e.history,i),a.push(e.history)),na(e,i,null,Do(e,i))}))},p=r.changes.length-1;p>=0;--p){var f=h(p);if(f)return f.v}}}}function ta(e,t){if(0!=t&&(e.first+=t,e.sel=new ro(X(e.sel.ranges,(function(e){return new oo(ot(e.anchor.line+t,e.anchor.ch),ot(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Ri(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,i=n.viewFrom;i<n.viewTo;i++)Oi(e.cm,i,"gutter")}}function na(e,t,n,i){if(e.cm&&!e.cm.curOp)return Pr(e.cm,na)(e,t,n,i);if(t.to.line<e.first)ta(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var r=t.text.length-1-(e.first-t.from.line);ta(e,r),t={from:ot(e.first,0),to:ot(t.to.line+r,t.to.ch),text:[Y(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:ot(o,Je(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Qe(e,t.from,t.to),n||(n=uo(e,t)),e.cm?ia(e.cm,t,i):vo(e,t,i),Wo(e,n,W),e.cantEdit&&Ko(e,ot(e.firstLine(),0))&&(e.cantEdit=!1)}}function ia(e,t,n){var i=e.doc,r=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=tt(Qt(Je(i,o.line))),i.iter(l,a.line+1,(function(e){if(e==r.maxLine)return s=!0,!0}))),i.sel.contains(t.from,t.to)>-1&&xe(e),vo(i,t,n,Di(e)),e.options.lineWrapping||(i.iter(l,o.line+t.text.length,(function(e){var t=sn(e);t>r.maxLineLength&&(r.maxLine=e,r.maxLineLength=t,r.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),Lt(i,o.line),jr(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?Ri(e):o.line!=a.line||1!=t.text.length||go(e.doc,t)?Ri(e,o.line,a.line+1,c):Oi(e,o.line,"text");var u=be(e,"changes"),d=be(e,"change");if(d||u){var h={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&_n(e,"change",e,h),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function ra(e,t,n,i,r){var o;i||(i=n),at(i,n)<0&&(n=(o=[i,n])[0],i=o[1]),"string"==typeof t&&(t=e.splitLines(t)),Qo(e,{from:n,to:i,text:t,origin:r})}function oa(e,t,n,i){n<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function aa(e,t,n,i){for(var r=0;r<e.length;++r){var o=e[r],a=!0;if(o.ranges){o.copied||((o=e[r]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)oa(o.ranges[s].anchor,t,n,i),oa(o.ranges[s].head,t,n,i)}else{for(var l=0;l<o.changes.length;++l){var c=o.changes[l];if(n<c.from.line)c.from=ot(c.from.line+i,c.from.ch),c.to=ot(c.to.line+i,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,r+1),r=0)}}}function sa(e,t){var n=t.from.line,i=t.to.line,r=t.text.length-(i-n)-1;aa(e.done,n,i,r),aa(e.undone,n,i,r)}function la(e,t,n,i){var r=t,o=t;return"number"==typeof t?o=Je(e,dt(e,t)):r=tt(t),null==r?null:(i(o,r)&&e.cm&&Oi(e.cm,r,n),o)}function ca(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function ua(e){this.children=e;for(var t=0,n=0,i=0;i<e.length;++i){var r=e[i];t+=r.chunkSize(),n+=r.height,r.parent=this}this.size=t,this.height=n,this.parent=null}oo.prototype.from=function(){return ut(this.anchor,this.head)},oo.prototype.to=function(){return ct(this.anchor,this.head)},oo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},ca.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,i=e+t;n<i;++n){var r=this.lines[n];this.height-=r.height,dn(r),_n(r,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=this},iterN:function(e,t,n){for(var i=e+t;e<i;++e)if(n(this.lines[e]))return!0}},ua.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var i=this.children[n],r=i.chunkSize();if(e<r){var o=Math.min(t,r-e),a=i.height;if(i.removeInner(e,o),this.height-=a-i.height,r==o&&(this.children.splice(n--,1),i.parent=null),0==(t-=o))break;e=0}else e-=r}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ca))){var s=[];this.collapse(s),this.children=[new ca(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var i=0;i<this.children.length;++i){var r=this.children[i],o=r.chunkSize();if(e<=o){if(r.insertInner(e,t,n),r.lines&&r.lines.length>50){for(var a=r.lines.length%25+25,s=a;s<r.lines.length;){var l=new ca(r.lines.slice(s,s+=25));r.height-=l.height,this.children.splice(++i,0,l),l.parent=this}r.lines=r.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new ua(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=F(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var i=new ua(e.children);i.parent=e,e.children=[i,t],e=i}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var i=0;i<this.children.length;++i){var r=this.children[i],o=r.chunkSize();if(e<o){var a=Math.min(t,o-e);if(r.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var da=function(e,t,n){if(n)for(var i in n)n.hasOwnProperty(i)&&(this[i]=n[i]);this.doc=e,this.node=t};function ha(e,t,n){an(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&ar(e,n)}function pa(e,t,n,i){var r=new da(e,n,i),o=e.cm;return o&&r.noHScroll&&(o.display.alignWidgets=!0),la(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==r.insertAt?n.push(r):n.splice(Math.min(n.length-1,Math.max(0,r.insertAt)),0,r),r.line=t,o&&!rn(e,t)){var i=an(t)<e.scrollTop;et(t,t.height+Wn(r)),i&&ar(o,r.height),o.curOp.forceUpdate=!0}return!0})),o&&_n(o,"lineWidgetAdded",o,r,"number"==typeof t?t:tt(t)),r}da.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,i=tt(n);if(null!=i&&t){for(var r=0;r<t.length;++r)t[r]==this&&t.splice(r--,1);t.length||(n.widgets=null);var o=Wn(this);et(n,Math.max(0,n.height-o)),e&&(Ar(e,(function(){ha(e,n,-o),Oi(e,i,"widget")})),_n(e,"lineWidgetCleared",e,this,i))}},da.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,i=this.line;this.height=null;var r=Wn(this)-t;r&&(rn(this.doc,i)||et(i,i.height+r),n&&Ar(n,(function(){n.curOp.forceUpdate=!0,ha(n,i,r),_n(n,"lineWidgetChanged",n,e,tt(i))})))},we(da);var fa=0,ma=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++fa};function ga(e,t,n,i,r){if(i&&i.shared)return ya(e,t,n,i,r);if(e.cm&&!e.cm.curOp)return Pr(e.cm,ga)(e,t,n,i,r);var o=new ma(e,r),a=at(t,n);if(i&&R(i,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=N("span",[o.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Jt(e,t.line,t,n,o)||t.line!=n.line&&Jt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Pt()}o.addToHistory&&Mo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,(function(e){c&&o.collapsed&&!c.options.lineWrapping&&Qt(e)==c.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&et(e,0),It(e,new Dt(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){rn(e,t)&&et(t,0)})),o.clearOnEnter&&fe(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(At(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++fa,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)Ri(c,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=n.line;u++)Oi(c,u,"text");o.atomic&&Vo(c.doc),_n(c,"markerAdded",c,o)}return o}ma.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&kr(e),be(this,"clear")){var n=this.find();n&&_n(this,"clear",n.from,n.to)}for(var i=null,r=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=Bt(a.markedSpans,this);e&&!this.collapsed?Oi(e,tt(a),"text"):e&&(null!=s.to&&(r=tt(a)),null!=s.from&&(i=tt(a))),a.markedSpans=jt(a.markedSpans,s),null==s.from&&this.collapsed&&!rn(this.doc,a)&&e&&et(a,_i(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=Qt(this.lines[l]),u=sn(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=i&&e&&this.collapsed&&Ri(e,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Vo(e.doc)),e&&_n(e,"markerCleared",e,this,i,r),t&&Sr(e),this.parent&&this.parent.clear()}},ma.prototype.find=function(e,t){var n,i;null==e&&"bookmark"==this.type&&(e=1);for(var r=0;r<this.lines.length;++r){var o=this.lines[r],a=Bt(o.markedSpans,this);if(null!=a.from&&(n=ot(t?o:tt(o),a.from),-1==e))return n;if(null!=a.to&&(i=ot(t?o:tt(o),a.to),1==e))return i}return n&&{from:n,to:i}},ma.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,i=this.doc.cm;t&&i&&Ar(i,(function(){var r=t.line,o=tt(t.line),a=ti(i,o);if(a&&(ui(a),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!rn(n.doc,r)&&null!=n.height){var s=n.height;n.height=null;var l=Wn(n)-s;l&&et(r,r.height+l)}_n(i,"markerChanged",i,e)}))},ma.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=F(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ma.prototype.detachLine=function(e){if(this.lines.splice(F(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},we(ma);var va=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function ya(e,t,n,i,r){(i=R(i)).shared=!1;var o=[ga(e,t,n,i,r)],a=o[0],s=i.widgetNode;return yo(e,(function(e){s&&(i.widgetNode=s.cloneNode(!0)),o.push(ga(e,ht(e,t),ht(e,n),i,r));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;a=Y(o)})),new va(o,a)}function xa(e){return e.findMarks(ot(e.first,0),e.clipPos(ot(e.lastLine())),(function(e){return e.parent}))}function ba(e,t){for(var n=0;n<t.length;n++){var i=t[n],r=i.find(),o=e.clipPos(r.from),a=e.clipPos(r.to);if(at(o,a)){var s=ga(e,o,a,i.primary,i.primary.type);i.markers.push(s),s.parent=i}}}function wa(e){for(var t=function(t){var n=e[t],i=[n.primary.doc];yo(n.primary.doc,(function(e){return i.push(e)}));for(var r=0;r<n.markers.length;r++){var o=n.markers[r];-1==F(i,o.doc)&&(o.parent=null,n.markers.splice(r--,1))}},n=0;n<e.length;n++)t(n)}va.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();_n(this,"clear")}},va.prototype.find=function(e,t){return this.primary.find(e,t)},we(va);var Ca=0,ka=function(e,t,n,i,r){if(!(this instanceof ka))return new ka(e,t,n,i,r);null==n&&(n=0),ua.call(this,[new ca([new cn("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=ot(n,0);this.sel=so(o),this.history=new Co(null),this.id=++Ca,this.modeOption=t,this.lineSep=i,this.direction="rtl"==r?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),vo(this,{from:o,to:o,text:e}),Ho(this,so(o),W)};ka.prototype=$(ua.prototype,{constructor:ka,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,i=0;i<t.length;++i)n+=t[i].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=$e(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Br((function(e){var t=ot(this.first,0),n=this.first+this.size-1;Qo(this,{from:t,to:ot(n,Je(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&lr(this.cm,0,0),Ho(this,so(t),W)})),replaceRange:function(e,t,n,i){ra(this,e,t=ht(this,t),n=n?ht(this,n):t,i)},getRange:function(e,t,n){var i=Qe(this,ht(this,e),ht(this,t));return!1===n?i:i.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(it(this,e))return Je(this,e)},getLineNumber:function(e){return tt(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Je(this,e)),Qt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ht(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Br((function(e,t,n){Zo(this,ht(this,"number"==typeof e?ot(e,t||0):e),null,n)})),setSelection:Br((function(e,t,n){Zo(this,ht(this,e),ht(this,t||e),n)})),extendSelection:Br((function(e,t,n){Io(this,ht(this,e),t&&ht(this,t),n)})),extendSelections:Br((function(e,t){Ro(this,ft(this,e),t)})),extendSelectionsBy:Br((function(e,t){Ro(this,ft(this,X(this.sel.ranges,e)),t)})),setSelections:Br((function(e,t,n){if(e.length){for(var i=[],r=0;r<e.length;r++)i[r]=new oo(ht(this,e[r].anchor),ht(this,e[r].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Ho(this,ao(this.cm,i,t),n)}})),addSelection:Br((function(e,t,n){var i=this.sel.ranges.slice(0);i.push(new oo(ht(this,e),ht(this,t||e))),Ho(this,ao(this.cm,i,i.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,i=0;i<n.length;i++){var r=Qe(this,n[i].from(),n[i].to());t=t?t.concat(r):r}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,i=0;i<n.length;i++){var r=Qe(this,n[i].from(),n[i].to());!1!==e&&(r=r.join(e||this.lineSeparator())),t[i]=r}return t},replaceSelection:function(e,t,n){for(var i=[],r=0;r<this.sel.ranges.length;r++)i[r]=e;this.replaceSelections(i,t,n||"+input")},replaceSelections:Br((function(e,t,n){for(var i=[],r=this.sel,o=0;o<r.ranges.length;o++){var a=r.ranges[o];i[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var s=t&&"end"!=t&&po(this,i,t),l=i.length-1;l>=0;l--)Qo(this,i[l]);s?zo(this,s):this.cm&&sr(this.cm)})),undo:Br((function(){ea(this,"undo")})),redo:Br((function(){ea(this,"redo")})),undoSelection:Br((function(){ea(this,"undo",!0)})),redoSelection:Br((function(){ea(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Co(this.history.maxGeneration),yo(this,(function(t){return t.history=e.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Bo(this.history.done),undone:Bo(this.history.undone)}},setHistory:function(e){var t=this.history=new Co(this.history.maxGeneration);t.done=Bo(e.done.slice(0),null,!0),t.undone=Bo(e.undone.slice(0),null,!0)},setGutterMarker:Br((function(e,t,n){return la(this,e,"gutter",(function(e){var i=e.gutterMarkers||(e.gutterMarkers={});return i[t]=n,!n&&ie(i)&&(e.gutterMarkers=null),!0}))})),clearGutter:Br((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&la(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,ie(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!it(this,e))return null;if(t=e,!(e=Je(this,e)))return null}else if(null==(t=tt(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Br((function(e,t,n){return la(this,e,"gutter"==t?"gutter":"class",(function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[i]){if(S(n).test(e[i]))return!1;e[i]+=" "+n}else e[i]=n;return!0}))})),removeLineClass:Br((function(e,t,n){return la(this,e,"gutter"==t?"gutter":"class",(function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",r=e[i];if(!r)return!1;if(null==n)e[i]=null;else{var o=r.match(S(n));if(!o)return!1;var a=o.index+o[0].length;e[i]=r.slice(0,o.index)+(o.index&&a!=r.length?" ":"")+r.slice(a)||null}return!0}))})),addLineWidget:Br((function(e,t,n){return pa(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return ga(this,ht(this,e),ht(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return ga(this,e=ht(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=Je(this,(e=ht(this,e)).line).markedSpans;if(n)for(var i=0;i<n.length;++i){var r=n[i];(null==r.from||r.from<=e.ch)&&(null==r.to||r.to>=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,n){e=ht(this,e),t=ht(this,t);var i=[],r=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];null!=l.to&&r==e.line&&e.ch>=l.to||null==l.from&&r!=e.line||null!=l.from&&r==t.line&&l.from>=t.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++r})),i},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var i=0;i<n.length;++i)null!=n[i].from&&e.push(n[i].marker)})),e},posFromIndex:function(e){var t,n=this.first,i=this.lineSeparator().length;return this.iter((function(r){var o=r.text.length+i;if(o>e)return t=e,!0;e-=o,++n})),ht(this,ot(n,t))},indexFromPos:function(e){var t=(e=ht(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new ka($e(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var i=new ka($e(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],ba(i,xa(this)),i},unlinkDoc:function(e){if(e instanceof Rs&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),wa(xa(this));break}if(e.history==this.history){var n=[e.id];yo(e,(function(e){return n.push(e.id)}),!0),e.history=new Co(null),e.history.done=Bo(this.history.done,n),e.history.undone=Bo(this.history.undone,n)}},iterLinkedDocs:function(e){yo(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Be(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Br((function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&wo(this.cm))}))}),ka.prototype.eachLine=ka.prototype.iter;var Sa=0;function Ea(e){var t=this;if(La(t),!ye(t,e)&&!Gn(t.display,e)){Ce(e),a&&(Sa=+new Date);var n=ji(t,e,!0),i=e.dataTransfer.files;if(n&&!t.isReadOnly())if(i&&i.length&&window.FileReader&&window.File)for(var r=i.length,o=Array(r),s=0,l=function(){++s==r&&Pr(t,(function(){var e={from:n=ht(t.doc,n),to:n,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};Qo(t.doc,e),zo(t.doc,so(ht(t.doc,n),ht(t.doc,lo(e))))}))()},c=function(e,n){if(t.options.allowDropFileTypes&&-1==F(t.options.allowDropFileTypes,e.type))l();else{var i=new FileReader;i.onerror=function(){return l()},i.onload=function(){var e=i.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[n]=e),l()},i.readAsText(e)}},u=0;u<i.length;u++)c(i[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d=e.dataTransfer.getData("Text");if(d){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),Wo(t.doc,so(n,n)),h)for(var p=0;p<h.length;++p)ra(t.doc,"",h[p].anchor,h[p].head,"drag");t.replaceSelection(d,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Ma(e,t){if(a&&(!e.state.draggingText||+new Date-Sa<100))Ee(t);else if(!ye(e,t)&&!Gn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!h)){var n=_("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}function Ta(e,t){var n=ji(e,t);if(n){var i=document.createDocumentFragment();Vi(e,n,i),e.display.dragCursor||(e.display.dragCursor=_("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),L(e.display.dragCursor,i)}}function La(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function _a(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],i=0;i<t.length;i++){var r=t[i].CodeMirror;r&&n.push(r)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var Na=!1;function Aa(){Na||(Pa(),Na=!0)}function Pa(){var e;fe(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,_a(Da)}),100))})),fe(window,"blur",(function(){return _a(Qi)}))}function Da(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ba={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"},ja=0;ja<10;ja++)Ba[ja+48]=Ba[ja+96]=String(ja);for(var Ia=65;Ia<=90;Ia++)Ba[Ia]=String.fromCharCode(Ia);for(var Ra=1;Ra<=12;Ra++)Ba[Ra+111]=Ba[Ra+63235]="F"+Ra;var Oa={};function Za(e){var t,n,i,r,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))r=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);i=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),r&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Fa(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==i){delete e[n];continue}for(var r=X(n.split(" "),Za),o=0;o<r.length;o++){var a=void 0,s=void 0;o==r.length-1?(s=r.join(" "),a=i):(s=r.slice(0,o+1).join(" "),a="...");var l=t[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[n]}for(var c in t)e[c]=t[c];return e}function za(e,t,n,i){var r=(t=Va(t)).call?t.call(e,i):t[e];if(!1===r)return"nothing";if("..."===r)return"multi";if(null!=r&&n(r))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return za(e,t.fallthrough,n,i);for(var o=0;o<t.fallthrough.length;o++){var a=za(e,t.fallthrough[o],n,i);if(a)return a}}}function Ha(e){var t="string"==typeof e?e:Ba[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Wa(e,t,n){var i=e;return t.altKey&&"Alt"!=i&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&"Ctrl"!=i&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&"Mod"!=i&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=i&&(e="Shift-"+e),e}function Ga(e,t){if(d&&34==e.keyCode&&e.char)return!1;var n=Ba[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Wa(n,e,t))}function Va(e){return"string"==typeof e?Oa[e]:e}function qa(e,t){for(var n=e.doc.sel.ranges,i=[],r=0;r<n.length;r++){for(var o=t(n[r]);i.length&&at(o.from,Y(i).to)<=0;){var a=i.pop();if(at(a.from,o.from)<0){o.from=a.from;break}}i.push(o)}Ar(e,(function(){for(var t=i.length-1;t>=0;t--)ra(e.doc,"",i[t].from,i[t].to,"+delete");sr(e)}))}function Ua(e,t,n){var i=ae(e.text,t+n,n);return i<0||i>e.text.length?null:i}function Ka(e,t,n){var i=Ua(e,t.ch,n);return null==i?null:new ot(t.line,i,n<0?"after":"before")}function Ya(e,t,n,i,r){if(e){"rtl"==t.doc.direction&&(r=-r);var o=he(n,t.doc.direction);if(o){var a,s=r<0?Y(o):o[0],l=r<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=ni(t,n);a=r<0?n.text.length-1:0;var u=ii(t,c,a).top;a=se((function(e){return ii(t,c,e).top==u}),r<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Ua(n,a,1))}else a=r<0?s.to:s.from;return new ot(i,a,l)}}return new ot(i,r<0?n.text.length:0,r<0?"before":"after")}function Xa(e,t,n,i){var r=he(t,e.doc.direction);if(!r)return Ka(t,n,i);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ue(r,n.ch,n.sticky),a=r[o];if("ltr"==e.doc.direction&&a.level%2==0&&(i>0?a.to>n.ch:a.from<n.ch))return Ka(t,n,i);var s,l=function(e,n){return Ua(t,e instanceof ot?e.ch:e,n)},c=function(n){return e.options.lineWrapping?(s=s||ni(e,t),Si(e,t,s,n)):{begin:0,end:t.text.length}},u=c("before"==n.sticky?l(n,-1):n.ch);if("rtl"==e.doc.direction||1==a.level){var d=1==a.level==i<0,h=l(n,d?1:-1);if(null!=h&&(d?h<=a.to&&h<=u.end:h>=a.from&&h>=u.begin)){var p=d?"before":"after";return new ot(n.line,h,p)}}var f=function(e,t,i){for(var o=function(e,t){return t?new ot(n.line,l(e,1),"before"):new ot(n.line,e,"after")};e>=0&&e<r.length;e+=t){var a=r[e],s=t>0==(1!=a.level),c=s?i.begin:l(i.end,-1);if(a.from<=c&&c<a.to)return o(c,s);if(c=s?a.from:l(a.to,-1),i.begin<=c&&c<i.end)return o(c,s)}},m=f(o+i,i,u);if(m)return m;var g=i>0?u.end:l(u.begin,-1);return null==g||i>0&&g==t.text.length||!(m=f(i>0?0:r.length-1,i,c(g)))?null:m}Oa.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"},Oa.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"},Oa.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"},Oa.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"]},Oa.default=y?Oa.macDefault:Oa.pcDefault;var Ja={selectAll:Xo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),W)},killLine:function(e){return qa(e,(function(t){if(t.empty()){var n=Je(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:ot(t.head.line+1,0)}:{from:t.head,to:ot(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return qa(e,(function(t){return{from:ot(t.from().line,0),to:ht(e.doc,ot(t.to().line+1,0))}}))},delLineLeft:function(e){return qa(e,(function(e){return{from:ot(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return qa(e,(function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return qa(e,(function(t){var n=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:i}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ot(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ot(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return Qa(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return es(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return $a(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")}),V)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),V)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:n},"div");return i.ch<e.getLine(i.line).search(/\S/)?es(e,t.head):i}),V)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),i=e.options.tabSize,r=0;r<n.length;r++){var o=n[r].from(),a=O(e.getLine(o.line),o.ch,i);t.push(K(i-a%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ar(e,(function(){for(var t=e.listSelections(),n=[],i=0;i<t.length;i++)if(t[i].empty()){var r=t[i].head,o=Je(e.doc,r.line).text;if(o)if(r.ch==o.length&&(r=new ot(r.line,r.ch-1)),r.ch>0)r=new ot(r.line,r.ch+1),e.replaceRange(o.charAt(r.ch-1)+o.charAt(r.ch-2),ot(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var a=Je(e.doc,r.line-1).text;a&&(r=new ot(r.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),ot(r.line-1,a.length-1),r,"+transpose"))}n.push(new oo(r,r))}e.setSelections(n)}))},newlineAndIndent:function(e){return Ar(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var i=0;i<t.length;i++)e.indentLine(t[i].from().line,null,!0);sr(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Qa(e,t){var n=Je(e.doc,t),i=Qt(n);return i!=n&&(t=tt(i)),Ya(!0,e,i,t,1)}function $a(e,t){var n=Je(e.doc,t),i=$t(n);return i!=n&&(t=tt(i)),Ya(!0,e,n,t,-1)}function es(e,t){var n=Qa(e,t.line),i=Je(e.doc,n.line),r=he(i,e.doc.direction);if(!r||0==r[0].level){var o=Math.max(n.ch,i.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return ot(n.line,a?0:o,n.sticky)}return n}function ts(e,t,n){if("string"==typeof t&&!(t=Ja[t]))return!1;e.display.input.ensurePolled();var i=e.display.shift,r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),r=t(e)!=H}finally{e.display.shift=i,e.state.suppressEdits=!1}return r}function ns(e,t,n){for(var i=0;i<e.state.keyMaps.length;i++){var r=za(t,e.state.keyMaps[i],n,e);if(r)return r}return e.options.extraKeys&&za(t,e.options.extraKeys,n,e)||za(t,e.options.keyMap,n,e)}var is=new Z;function rs(e,t,n,i){var r=e.state.keySeq;if(r){if(Ha(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:is.set(50,(function(){e.state.keySeq==r&&(e.state.keySeq=null,e.display.input.reset())})),os(e,r+" "+t,n,i))return!0}return os(e,t,n,i)}function os(e,t,n,i){var r=ns(e,t,i);return"multi"==r&&(e.state.keySeq=t),"handled"==r&&_n(e,"keyHandled",e,t,n),"handled"!=r&&"multi"!=r||(Ce(n),Ki(e)),!!r}function as(e,t){var n=Ga(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?rs(e,"Shift-"+n,t,(function(t){return ts(e,t,!0)}))||rs(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return ts(e,t)})):rs(e,n,t,(function(t){return ts(e,t)})))}function ss(e,t,n){return rs(e,"'"+n+"'",t,(function(t){return ts(e,t,!0)}))}var ls=null;function cs(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=P(),ye(t,e)))){a&&s<11&&27==e.keyCode&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=16==i||e.shiftKey;var r=as(t,e);d&&(ls=r?i:null,r||88!=i||Ie||!(y?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!y&&!r&&46==i&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=i||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||us(t)}}function us(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(M(t,"CodeMirror-crosshair"),ge(document,"keyup",n),ge(document,"mouseover",n))}D(t,"CodeMirror-crosshair"),fe(document,"keyup",n),fe(document,"mouseover",n)}function ds(e){16==e.keyCode&&(this.doc.sel.shift=!1),ye(this,e)}function hs(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||Gn(t.display,e)||ye(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,i=e.charCode;if(d&&n==ls)return ls=null,void Ce(e);if(!d||e.which&&!(e.which<10)||!as(t,e)){var r=String.fromCharCode(null==i?n:i);"\b"!=r&&(ss(t,e,r)||t.display.input.onKeyPress(e))}}}var ps,fs,ms=400,gs=function(e,t,n){this.time=e,this.pos=t,this.button=n};function vs(e,t){var n=+new Date;return fs&&fs.compare(n,e,t)?(ps=fs=null,"triple"):ps&&ps.compare(n,e,t)?(fs=new gs(n,e,t),ps=null,"double"):(ps=new gs(n,e,t),fs=null,"single")}function ys(e){var t=this,n=t.display;if(!(ye(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,Gn(n,e))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!Ts(t,e)){var i=ji(t,e),r=Te(e),o=i?vs(i,r):"single";window.focus(),1==r&&t.state.selectingText&&t.state.selectingText(e),i&&xs(t,r,i,o,e)||(1==r?i?ws(t,i,o,e):Me(e)==n.scroller&&Ce(e):2==r?(i&&Io(t.doc,i),setTimeout((function(){return n.input.focus()}),20)):3==r&&(k?t.display.input.onContextMenu(e):Xi(t)))}}function xs(e,t,n,i,r){var o="Click";return"double"==i?o="Double"+o:"triple"==i&&(o="Triple"+o),rs(e,Wa(o=(1==t?"Left":2==t?"Middle":"Right")+o,r),r,(function(t){if("string"==typeof t&&(t=Ja[t]),!t)return!1;var i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i=t(e,n)!=H}finally{e.state.suppressEdits=!1}return i}))}function bs(e,t,n){var i=e.getOption("configureMouse"),r=i?i(e,t,n):{};if(null==r.unit){var o=x?n.shiftKey&&n.metaKey:n.altKey;r.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==r.extend||e.doc.extend)&&(r.extend=e.doc.extend||n.shiftKey),null==r.addNew&&(r.addNew=y?n.metaKey:n.ctrlKey),null==r.moveOnDrag&&(r.moveOnDrag=!(y?n.altKey:n.ctrlKey)),r}function ws(e,t,n,i){a?setTimeout(I(Yi,e),0):e.curOp.focus=P();var r,o=bs(e,n,i),s=e.doc.sel;e.options.dragDrop&&Ne&&!e.isReadOnly()&&"single"==n&&(r=s.contains(t))>-1&&(at((r=s.ranges[r]).from(),t)<0||t.xRel>0)&&(at(r.to(),t)>0||t.xRel<0)?Cs(e,i,t,o):Ss(e,i,t,o)}function Cs(e,t,n,i){var r=e.display,o=!1,c=Pr(e,(function(t){l&&(r.scroller.draggable=!1),e.state.draggingText=!1,ge(r.wrapper.ownerDocument,"mouseup",c),ge(r.wrapper.ownerDocument,"mousemove",u),ge(r.scroller,"dragstart",d),ge(r.scroller,"drop",c),o||(Ce(t),i.addNew||Io(e.doc,n,null,null,i.extend),l&&!h||a&&9==s?setTimeout((function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()}),20):r.input.focus())})),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return o=!0};l&&(r.scroller.draggable=!0),e.state.draggingText=c,c.copy=!i.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),fe(r.wrapper.ownerDocument,"mouseup",c),fe(r.wrapper.ownerDocument,"mousemove",u),fe(r.scroller,"dragstart",d),fe(r.scroller,"drop",c),Xi(e),setTimeout((function(){return r.input.focus()}),20)}function ks(e,t,n){if("char"==n)return new oo(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new oo(ot(t.line,0),ht(e.doc,ot(t.line+1,0)));var i=n(e,t);return new oo(i.from,i.to)}function Ss(e,t,n,i){var r=e.display,o=e.doc;Ce(t);var a,s,l=o.sel,c=l.ranges;if(i.addNew&&!i.extend?(s=o.sel.contains(n),a=s>-1?c[s]:new oo(n,n)):(a=o.sel.primary(),s=o.sel.primIndex),"rectangle"==i.unit)i.addNew||(a=new oo(n,n)),n=ji(e,t,!0,!0),s=-1;else{var u=ks(e,n,i.unit);a=i.extend?jo(a,u.anchor,u.head,i.extend):u}i.addNew?-1==s?(s=c.length,Ho(o,ao(e,c.concat([a]),s),{scroll:!1,origin:"*mouse"})):c.length>1&&c[s].empty()&&"char"==i.unit&&!i.extend?(Ho(o,ao(e,c.slice(0,s).concat(c.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):Oo(o,s,a,G):(s=0,Ho(o,new ro([a],0),G),l=o.sel);var d=n;function h(t){if(0!=at(d,t))if(d=t,"rectangle"==i.unit){for(var r=[],c=e.options.tabSize,u=O(Je(o,n.line).text,n.ch,c),h=O(Je(o,t.line).text,t.ch,c),p=Math.min(u,h),f=Math.max(u,h),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=Je(o,m).text,y=q(v,p,c);p==f?r.push(new oo(ot(m,y),ot(m,y))):v.length>y&&r.push(new oo(ot(m,y),ot(m,q(v,f,c))))}r.length||r.push(new oo(n,n)),Ho(o,ao(e,l.ranges.slice(0,s).concat(r),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x,b=a,w=ks(e,t,i.unit),C=b.anchor;at(w.anchor,C)>0?(x=w.head,C=ut(b.from(),w.anchor)):(x=w.anchor,C=ct(b.to(),w.head));var k=l.ranges.slice(0);k[s]=Es(e,new oo(ht(o,C),x)),Ho(o,ao(e,k,s),G)}}var p=r.wrapper.getBoundingClientRect(),f=0;function m(t){var n=++f,a=ji(e,t,!0,"rectangle"==i.unit);if(a)if(0!=at(a,d)){e.curOp.focus=P(),h(a);var s=tr(r,o);(a.line>=s.to||a.line<s.from)&&setTimeout(Pr(e,(function(){f==n&&m(t)})),150)}else{var l=t.clientY<p.top?-20:t.clientY>p.bottom?20:0;l&&setTimeout(Pr(e,(function(){f==n&&(r.scroller.scrollTop+=l,m(t))})),50)}}function g(t){e.state.selectingText=!1,f=1/0,t&&(Ce(t),r.input.focus()),ge(r.wrapper.ownerDocument,"mousemove",v),ge(r.wrapper.ownerDocument,"mouseup",y),o.history.lastSelOrigin=null}var v=Pr(e,(function(e){0!==e.buttons&&Te(e)?m(e):g(e)})),y=Pr(e,g);e.state.selectingText=y,fe(r.wrapper.ownerDocument,"mousemove",v),fe(r.wrapper.ownerDocument,"mouseup",y)}function Es(e,t){var n=t.anchor,i=t.head,r=Je(e.doc,n.line);if(0==at(n,i)&&n.sticky==i.sticky)return t;var o=he(r);if(!o)return t;var a=ue(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return t;if(i.line!=n.line)l=(i.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=ue(o,i.ch,i.sticky),d=u-a||(i.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?d<0:d>0}var h=o[c+(l?-1:0)],p=l==(1==h.level),f=p?h.from:h.to,m=p?"after":"before";return n.ch==f&&n.sticky==m?t:new oo(new ot(n.line,f,m),i)}function Ms(e,t,n,i){var r,o;if(t.touches)r=t.touches[0].clientX,o=t.touches[0].clientY;else try{r=t.clientX,o=t.clientY}catch(e){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&Ce(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!be(e,n))return Se(t);o-=s.top-a.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var c=a.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=r)return ve(e,n,e,nt(e.doc,o),e.display.gutterSpecs[l].className,t),Se(t)}}function Ts(e,t){return Ms(e,t,"gutterClick",!0)}function Ls(e,t){Gn(e.display,t)||_s(e,t)||ye(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function _s(e,t){return!!be(e,"gutterContextMenu")&&Ms(e,t,"gutterContextMenu",!1)}function Ns(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),hi(e)}gs.prototype.compare=function(e,t,n){return this.time+ms>e&&0==at(t,this.pos)&&n==this.button};var As={toString:function(){return"CodeMirror.Init"}},Ps={},Ds={};function Bs(e){var t=e.optionHandlers;function n(n,i,r,o){e.defaults[n]=i,r&&(t[n]=o?function(e,t,n){n!=As&&r(e,t,n)}:r)}e.defineOption=n,e.Init=As,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,fo(e)}),!0),n("indentUnit",2,fo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){mo(e),hi(e),Ri(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],i=e.doc.first;e.doc.iter((function(e){for(var r=0;;){var o=e.text.indexOf(t,r);if(-1==o)break;r=o+t.length,n.push(ot(i,o))}i++}));for(var r=n.length-1;r>=0;r--)ra(e.doc,t,n[r],ot(n[r].line,n[r].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=As&&e.refresh()})),n("specialCharPlaceholder",gn,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!b),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Ns(e),Jr(e)}),!0),n("keyMap","default",(function(e,t,n){var i=Va(t),r=n!=As&&Va(n);r&&r.detach&&r.detach(e,i),i.attach&&i.attach(e,r||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Is,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=Yr(t,e.options.lineNumbers),Jr(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Pi(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return yr(e)}),!0),n("scrollbarStyle","native",(function(e){wr(e),yr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Yr(e.options.gutters,t),Jr(e)}),!0),n("firstLineNumber",1,Jr,!0),n("lineNumberFormatter",(function(e){return e}),Jr,!0),n("showCursorWhenSelecting",!1,Wi,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Qi(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,js),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Wi,!0),n("singleCursorHeightPerLine",!0,Wi,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,mo,!0),n("addModeClass",!1,mo,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,mo,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}function js(e,t,n){if(!t!=!(n&&n!=As)){var i=e.display.dragFunctions,r=t?fe:ge;r(e.display.scroller,"dragstart",i.start),r(e.display.scroller,"dragenter",i.enter),r(e.display.scroller,"dragover",i.over),r(e.display.scroller,"dragleave",i.leave),r(e.display.scroller,"drop",i.drop)}}function Is(e){e.options.lineWrapping?(D(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(M(e.display.wrapper,"CodeMirror-wrap"),ln(e)),Bi(e),Ri(e),hi(e),setTimeout((function(){return yr(e)}),100)}function Rs(e,t){var n=this;if(!(this instanceof Rs))return new Rs(e,t);this.options=t=t?R(t):{},R(Ps,t,!1);var i=t.value;"string"==typeof i?i=new ka(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var r=new Rs.inputStyles[t.inputStyle](this),o=this.display=new Qr(e,i,r,t);for(var c in o.wrapper.CodeMirror=this,Ns(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),wr(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 Z,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Os(this),Aa(),kr(this),this.curOp.forceUpdate=!0,xo(this,i),t.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Ji(n)}),20):Qi(this),Ds)Ds.hasOwnProperty(c)&&Ds[c](this,t[c],As);Kr(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Zs.length;++u)Zs[u](this);Sr(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function Os(e){var t=e.display;fe(t.scroller,"mousedown",Pr(e,ys)),fe(t.scroller,"dblclick",a&&s<11?Pr(e,(function(t){if(!ye(e,t)){var n=ji(e,t);if(n&&!Ts(e,t)&&!Gn(e.display,t)){Ce(t);var i=e.findWordAt(n);Io(e.doc,i.anchor,i.head)}}})):function(t){return ye(e,t)||Ce(t)}),fe(t.scroller,"contextmenu",(function(t){return Ls(e,t)})),fe(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||Ls(e,n)}));var n,i={end:0};function r(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(i=t.activeTouch).end=+new Date)}function o(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function l(e,t){if(null==t.left)return!0;var n=t.left-e.left,i=t.top-e.top;return n*n+i*i>400}fe(t.scroller,"touchstart",(function(r){if(!ye(e,r)&&!o(r)&&!Ts(e,r)){t.input.ensurePolled(),clearTimeout(n);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-i.end<=300?i:null},1==r.touches.length&&(t.activeTouch.left=r.touches[0].pageX,t.activeTouch.top=r.touches[0].pageY)}})),fe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),fe(t.scroller,"touchend",(function(n){var i=t.activeTouch;if(i&&!Gn(t,n)&&null!=i.left&&!i.moved&&new Date-i.start<300){var o,a=e.coordsChar(t.activeTouch,"page");o=!i.prev||l(i,i.prev)?new oo(a,a):!i.prev.prev||l(i,i.prev.prev)?e.findWordAt(a):new oo(ot(a.line,0),ht(e.doc,ot(a.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),Ce(n)}r()})),fe(t.scroller,"touchcancel",r),fe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(hr(e,t.scroller.scrollTop),fr(e,t.scroller.scrollLeft,!0),ve(e,"scroll",e))})),fe(t.scroller,"mousewheel",(function(t){return io(e,t)})),fe(t.scroller,"DOMMouseScroll",(function(t){return io(e,t)})),fe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ye(e,t)||Ee(t)},over:function(t){ye(e,t)||(Ta(e,t),Ee(t))},start:function(t){return Ma(e,t)},drop:Pr(e,Ea),leave:function(t){ye(e,t)||La(e)}};var c=t.input.getField();fe(c,"keyup",(function(t){return ds.call(e,t)})),fe(c,"keydown",Pr(e,cs)),fe(c,"keypress",Pr(e,hs)),fe(c,"focus",(function(t){return Ji(e,t)})),fe(c,"blur",(function(t){return Qi(e,t)}))}Rs.defaults=Ps,Rs.optionHandlers=Ds;var Zs=[];function Fs(e,t,n,i){var r,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?r=xt(e,t).state:n="prev");var a=e.options.tabSize,s=Je(o,t),l=O(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(i||/\S/.test(s.text)){if("smart"==n&&((c=o.mode.indent(r,s.text.slice(u.length),s.text))==H||c>150)){if(!i)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?O(Je(o,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var d="",h=0;if(e.options.indentWithTabs)for(var p=Math.floor(c/a);p;--p)h+=a,d+="\t";if(h<c&&(d+=K(c-h)),d!=u)return ra(o,d,ot(t,0),ot(t,u.length),"+input"),s.stateAfter=null,!0;for(var f=0;f<o.sel.ranges.length;f++){var m=o.sel.ranges[f];if(m.head.line==t&&m.head.ch<u.length){var g=ot(t,u.length);Oo(o,f,new oo(g,g));break}}}Rs.defineInitHook=function(e){return Zs.push(e)};var zs=null;function Hs(e){zs=e}function Ws(e,t,n,i,r){var o=e.doc;e.display.shift=!1,i||(i=o.sel);var a=+new Date-200,s="paste"==r||e.state.pasteIncoming>a,l=Be(t),c=null;if(s&&i.ranges.length>1)if(zs&&zs.text.join("\n")==t){if(i.ranges.length%zs.text.length==0){c=[];for(var u=0;u<zs.text.length;u++)c.push(o.splitLines(zs.text[u]))}}else l.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(c=X(l,(function(e){return[e]})));for(var d=e.curOp.updateInput,h=i.ranges.length-1;h>=0;h--){var p=i.ranges[h],f=p.from(),m=p.to();p.empty()&&(n&&n>0?f=ot(f.line,f.ch-n):e.state.overwrite&&!s?m=ot(m.line,Math.min(Je(o,m.line).text.length,m.ch+Y(l).length)):s&&zs&&zs.lineWise&&zs.text.join("\n")==l.join("\n")&&(f=m=ot(f.line,0)));var g={from:f,to:m,text:c?c[h%c.length]:l,origin:r||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};Qo(e.doc,g),_n(e,"inputRead",e,g)}t&&!s&&Vs(e,t),sr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Gs(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Ar(t,(function(){return Ws(t,n,0,null,"paste")})),!0}function Vs(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var o=e.getModeAt(r.head),a=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){a=Fs(e,r.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Je(e.doc,r.head.line).text.slice(0,r.head.ch))&&(a=Fs(e,r.head.line,"smart"));a&&_n(e,"electricInput",e,r.head.line)}}}function qs(e){for(var t=[],n=[],i=0;i<e.doc.sel.ranges.length;i++){var r=e.doc.sel.ranges[i].head.line,o={anchor:ot(r,0),head:ot(r+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Us(e,t,n,i){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",i?"":"off"),e.setAttribute("spellcheck",!!t)}function Ks(){var e=_("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=_("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),Us(e),t}function Ys(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var i=this.options,r=i[e];i[e]==n&&"mode"!=e||(i[e]=n,t.hasOwnProperty(e)&&Pr(this,t[e])(this,n,r),ve(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Va(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Dr((function(t,n){var i=t.token?t:e.getMode(this.options,t);if(i.startState)throw new Error("Overlays may not be stateful.");J(this.state.overlays,{mode:i,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,Ri(this)})),removeOverlay:Dr((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var i=t[n].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return t.splice(n,1),this.state.modeGen++,void Ri(this)}})),indentLine:Dr((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),it(this.doc,e)&&Fs(this,e,t,n)})),indentSelection:Dr((function(e){for(var t=this.doc.sel.ranges,n=-1,i=0;i<t.length;i++){var r=t[i];if(r.empty())r.head.line>n&&(Fs(this,r.head.line,e,!0),n=r.head.line,i==this.doc.sel.primIndex&&sr(this));else{var o=r.from(),a=r.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l<n;++l)Fs(this,l,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[i].from().ch>0&&Oo(this.doc,i,new oo(o,c[i].to()),W)}}})),getTokenAt:function(e,t){return St(this,e,t)},getLineTokens:function(e,t){return St(this,ot(e),t,!0)},getTokenTypeAt:function(e){e=ht(this.doc,e);var t,n=yt(this,Je(this.doc,e.line)),i=0,r=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=i+r>>1;if((a?n[2*a-1]:0)>=o)r=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}i=a+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var i=[];if(!n.hasOwnProperty(t))return i;var r=n[t],o=this.getModeAt(e);if("string"==typeof o[t])r[o[t]]&&i.push(r[o[t]]);else if(o[t])for(var a=0;a<o[t].length;a++){var s=r[o[t][a]];s&&i.push(s)}else o.helperType&&r[o.helperType]?i.push(r[o.helperType]):r[o.name]&&i.push(r[o.name]);for(var l=0;l<r._global.length;l++){var c=r._global[l];c.pred(o,this)&&-1==F(i,c.val)&&i.push(c.val)}return i},getStateAfter:function(e,t){var n=this.doc;return xt(this,(e=dt(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return xi(this,null==e?n.head:"object"==typeof e?ht(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return yi(this,ht(this.doc,e),t||"page")},coordsChar:function(e,t){return Ci(this,(e=vi(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=vi(this,{top:e,left:0},t||"page").top,nt(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var i,r=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,r=!0),i=Je(this.doc,e)}else i=e;return gi(this,i,{top:0,left:0},t||"page",n||r).top+(r?this.doc.height-an(i):0)},defaultTextHeight:function(){return _i(this.display)},defaultCharWidth:function(){return Ni(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,i,r){var o=this.display,a=(e=xi(this,ht(this.doc,e))).bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==i)a=e.top;else if("above"==i||"near"==i){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==i||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom),s+t.offsetWidth>c&&(s=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==r?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==r?s=0:"middle"==r&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&rr(this,{left:s,top:a,right:s+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:Dr(cs),triggerOnKeyPress:Dr(hs),triggerOnKeyUp:ds,triggerOnMouseDown:Dr(ys),execCommand:function(e){if(Ja.hasOwnProperty(e))return Ja[e].call(null,this)},triggerElectric:Dr((function(e){Vs(this,e)})),findPosH:function(e,t,n,i){var r=1;t<0&&(r=-1,t=-t);for(var o=ht(this.doc,e),a=0;a<t&&!(o=Xs(this.doc,o,r,n,i)).hitSide;++a);return o},moveH:Dr((function(e,t){var n=this;this.extendSelectionsBy((function(i){return n.display.shift||n.doc.extend||i.empty()?Xs(n.doc,i.head,e,t,n.options.rtlMoveVisually):e<0?i.from():i.to()}),V)})),deleteH:Dr((function(e,t){var n=this.doc.sel,i=this.doc;n.somethingSelected()?i.replaceSelection("",null,"+delete"):qa(this,(function(n){var r=Xs(i,n.head,e,t,!1);return e<0?{from:r,to:n.head}:{from:n.head,to:r}}))})),findPosV:function(e,t,n,i){var r=1,o=i;t<0&&(r=-1,t=-t);for(var a=ht(this.doc,e),s=0;s<t;++s){var l=xi(this,a,"div");if(null==o?o=l.left:l.left=o,(a=Js(this,l,r,n)).hitSide)break}return a},moveV:Dr((function(e,t){var n=this,i=this.doc,r=[],o=!this.display.shift&&!i.extend&&i.sel.somethingSelected();if(i.extendSelectionsBy((function(a){if(o)return e<0?a.from():a.to();var s=xi(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),r.push(s.left);var l=Js(n,s,e,t);return"page"==t&&a==i.sel.primary()&&ar(n,yi(n,l,"div").top-s.top),l}),V),r.length)for(var a=0;a<i.sel.ranges.length;a++)i.sel.ranges[a].goalColumn=r[a]})),findWordAt:function(e){var t=Je(this.doc,e.line).text,n=e.ch,i=e.ch;if(t){var r=this.getHelper(e,"wordChars");"before"!=e.sticky&&i!=t.length||!n?++i:--n;for(var o=t.charAt(n),a=ne(o,r)?function(e){return ne(e,r)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ne(e)};n>0&&a(t.charAt(n-1));)--n;for(;i<t.length&&a(t.charAt(i));)++i}return new oo(ot(e.line,n),ot(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?D(this.display.cursorDiv,"CodeMirror-overwrite"):M(this.display.cursorDiv,"CodeMirror-overwrite"),ve(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==P()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Dr((function(e,t){lr(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Kn(this)-this.display.barHeight,width:e.scrollWidth-Kn(this)-this.display.barWidth,clientHeight:Xn(this),clientWidth:Yn(this)}},scrollIntoView:Dr((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ot(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?cr(this,e):dr(this,e.from,e.to,e.margin)})),setSize:Dr((function(e,t){var n=this,i=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=i(e)),null!=t&&(this.display.wrapper.style.height=i(t)),this.options.lineWrapping&&di(this);var r=this.display.viewFrom;this.doc.iter(r,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Oi(n,r,"widget");break}++r})),this.curOp.forceUpdate=!0,ve(this,"refresh",this)})),operation:function(e){return Ar(this,e)},startOperation:function(){return kr(this)},endOperation:function(){return Sr(this)},refresh:Dr((function(){var e=this.display.cachedTextHeight;Ri(this),this.curOp.forceUpdate=!0,hi(this),lr(this,this.doc.scrollLeft,this.doc.scrollTop),Vr(this.display),(null==e||Math.abs(e-_i(this.display))>.5||this.options.lineWrapping)&&Bi(this),ve(this,"refresh",this)})),swapDoc:Dr((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),xo(this,e),hi(this),this.display.input.reset(),lr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,_n(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},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}},we(e),e.registerHelper=function(t,i,r){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][i]=r},e.registerGlobalHelper=function(t,i,r,o){e.registerHelper(t,i,o),n[t]._global.push({pred:r,val:o})}}function Xs(e,t,n,i,r){var o=t,a=n,s=Je(e,t.line),l=r&&"rtl"==e.direction?-n:n;function c(){var n=t.line+l;return!(n<e.first||n>=e.first+e.size)&&(t=new ot(n,t.ch,t.sticky),s=Je(e,n))}function u(o){var a;if("codepoint"==i){var u=s.text.charCodeAt(t.ch+(i>0?0:-1));a=isNaN(u)?null:new ot(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(u>=55296&&u<56320?2:1))),-n)}else a=r?Xa(e.cm,s,t,n):Ka(s,t,n);if(null==a){if(o||!c())return!1;t=Ya(r,e.cm,s,t.line,l)}else t=a;return!0}if("char"==i||"codepoint"==i)u();else if("column"==i)u(!0);else if("word"==i||"group"==i)for(var d=null,h="group"==i,p=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(n<0)||u(!f);f=!1){var m=s.text.charAt(t.ch)||"\n",g=ne(m,p)?"w":h&&"\n"==m?"n":!h||/\s/.test(m)?null:"p";if(!h||f||g||(g="s"),d&&d!=g){n<0&&(n=1,u(),t.sticky="after");break}if(g&&(d=g),n>0&&!u(!f))break}var v=Ko(e,t,o,a,!0);return st(o,v)&&(v.hitSide=!0),v}function Js(e,t,n,i){var r,o,a=e.doc,s=t.left;if("page"==i){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*_i(e.display),3);r=(n>0?t.bottom:t.top)+n*c}else"line"==i&&(r=n>0?t.bottom+3:t.top-3);for(;(o=Ci(e,s,r)).outside;){if(n<0?r<=0:r>=a.height){o.hitSide=!0;break}r+=5*n}return o}var Qs=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function $s(e,t){var n=ti(e,t.line);if(!n||n.hidden)return null;var i=Je(e.doc,t.line),r=Qn(n,i,t.line),o=he(i,e.doc.direction),a="left";o&&(a=ue(o,t.ch)%2?"right":"left");var s=ai(r.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function el(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function tl(e,t){return t&&(e.bad=!0),e}function nl(e,t,n,i,r){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function c(e){return function(t){return t.id==e}}function u(){a&&(o+=s,l&&(o+=s),a=l=!1)}function d(e){e&&(u(),o+=e)}function h(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void d(n);var o,p=t.getAttribute("cm-marker");if(p){var f=e.findMarks(ot(i,0),ot(r+1,0),c(+p));return void(f.length&&(o=f[0].find(0))&&d(Qe(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;m&&u();for(var g=0;g<t.childNodes.length;g++)h(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),m&&(a=!0)}else 3==t.nodeType&&d(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;h(t),t!=n;)t=t.nextSibling,l=!1;return o}function il(e,t,n){var i;if(t==e.display.lineDiv){if(!(i=e.display.lineDiv.childNodes[n]))return tl(e.clipPos(ot(e.display.viewTo-1)),!0);t=null,n=0}else for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var r=0;r<e.display.view.length;r++){var o=e.display.view[r];if(o.node==i)return rl(o,t,n)}}function rl(e,t,n){var i=e.text.firstChild,r=!1;if(!t||!A(i,t))return tl(ot(tt(e.line),0),!0);if(t==i&&(r=!0,t=i.childNodes[n],n=0,!t)){var o=e.rest?Y(e.rest):e.line;return tl(ot(tt(o),o.text.length),r)}var a=3==t.nodeType?t:null,s=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));s.parentNode!=i;)s=s.parentNode;var l=e.measure,c=l.maps;function u(t,n,i){for(var r=-1;r<(c?c.length:0);r++)for(var o=r<0?l.map:c[r],a=0;a<o.length;a+=3){var s=o[a+2];if(s==t||s==n){var u=tt(r<0?e.line:e.rest[r]),d=o[a]+i;return(i<0||s!=t)&&(d=o[a+(i?1:0)]),ot(u,d)}}}var d=u(a,s,n);if(d)return tl(d,r);for(var h=s.nextSibling,p=a?a.nodeValue.length-n:0;h;h=h.nextSibling){if(d=u(h,h.firstChild,0))return tl(ot(d.line,d.ch-p),r);p+=h.textContent.length}for(var f=s.previousSibling,m=n;f;f=f.previousSibling){if(d=u(f,f.firstChild,-1))return tl(ot(d.line,d.ch+m),r);m+=f.textContent.length}}Qs.prototype.init=function(e){var t=this,n=this,i=n.cm,r=n.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function a(e){if(o(e)&&!ye(i,e)){if(i.somethingSelected())Hs({lineWise:!1,text:i.getSelections()}),"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=qs(i);Hs({lineWise:!0,text:t.text}),"cut"==e.type&&i.operation((function(){i.setSelections(t.ranges,0,W),i.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var a=zs.text.join("\n");if(e.clipboardData.setData("Text",a),e.clipboardData.getData("Text")==a)return void e.preventDefault()}var s=Ks(),l=s.firstChild;i.display.lineSpace.insertBefore(s,i.display.lineSpace.firstChild),l.value=zs.text.join("\n");var c=document.activeElement;j(l),setTimeout((function(){i.display.lineSpace.removeChild(s),c.focus(),c==r&&n.showPrimarySelection()}),50)}}Us(r,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize),fe(r,"paste",(function(e){!o(e)||ye(i,e)||Gs(e,i)||s<=11&&setTimeout(Pr(i,(function(){return t.updateFromDOM()})),20)})),fe(r,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),fe(r,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),fe(r,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),fe(r,"touchstart",(function(){return n.forceCompositionEnd()})),fe(r,"input",(function(){t.composing||t.readFromDOMSoon()})),fe(r,"copy",a),fe(r,"cut",a)},Qs.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Qs.prototype.prepareSelection=function(){var e=Gi(this.cm,!1);return e.focus=document.activeElement==this.div,e},Qs.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Qs.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Qs.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),o=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var a=il(t,e.anchorNode,e.anchorOffset),s=il(t,e.focusNode,e.focusOffset);if(!a||a.bad||!s||s.bad||0!=at(ut(a,s),r)||0!=at(ct(a,s),o)){var l=t.display.view,c=r.line>=t.display.viewFrom&&$s(t,r)||{node:l[0].measure.map[2],offset:0},u=o.line<t.display.viewTo&&$s(t,o);if(!u){var d=l[l.length-1].measure,h=d.maps?d.maps[d.maps.length-1]:d.map;u={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(c&&u){var p,f=e.rangeCount&&e.getRangeAt(0);try{p=E(c.node,c.offset,u.offset,u.node)}catch(e){}p&&(!n&&t.state.focused?(e.collapse(c.node,c.offset),p.collapsed||(e.removeAllRanges(),e.addRange(p))):(e.removeAllRanges(),e.addRange(p)),f&&null==e.anchorNode?e.addRange(f):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Qs.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},Qs.prototype.showMultipleSelections=function(e){L(this.cm.display.cursorDiv,e.cursors),L(this.cm.display.selectionDiv,e.selection)},Qs.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Qs.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return A(this.div,t)},Qs.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Qs.prototype.blur=function(){this.div.blur()},Qs.prototype.getField=function(){return this.div},Qs.prototype.supportsTouch=function(){return!0},Qs.prototype.receivedFocus=function(){var e=this;function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.selectionInEditor()?this.pollSelection():Ar(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,t)},Qs.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Qs.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(g&&u&&this.cm.display.gutterSpecs.length&&el(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=il(t,e.anchorNode,e.anchorOffset),i=il(t,e.focusNode,e.focusOffset);n&&i&&Ar(t,(function(){Ho(t.doc,so(n,i),W),(n.bad||i.bad)&&(t.curOp.selectionChanged=!0)}))}}},Qs.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,i=this.cm,r=i.display,o=i.doc.sel.primary(),a=o.from(),s=o.to();if(0==a.ch&&a.line>i.firstLine()&&(a=ot(a.line-1,Je(i.doc,a.line-1).length)),s.ch==Je(i.doc,s.line).text.length&&s.line<i.lastLine()&&(s=ot(s.line+1,0)),a.line<r.viewFrom||s.line>r.viewTo-1)return!1;a.line==r.viewFrom||0==(e=Ii(i,a.line))?(t=tt(r.view[0].line),n=r.view[0].node):(t=tt(r.view[e].line),n=r.view[e-1].node.nextSibling);var l,c,u=Ii(i,s.line);if(u==r.view.length-1?(l=r.viewTo-1,c=r.lineDiv.lastChild):(l=tt(r.view[u+1].line)-1,c=r.view[u+1].node.previousSibling),!n)return!1;for(var d=i.doc.splitLines(nl(i,n,c,t,l)),h=Qe(i.doc,ot(t,0),ot(l,Je(i.doc,l).text.length));d.length>1&&h.length>1;)if(Y(d)==Y(h))d.pop(),h.pop(),l--;else{if(d[0]!=h[0])break;d.shift(),h.shift(),t++}for(var p=0,f=0,m=d[0],g=h[0],v=Math.min(m.length,g.length);p<v&&m.charCodeAt(p)==g.charCodeAt(p);)++p;for(var y=Y(d),x=Y(h),b=Math.min(y.length-(1==d.length?p:0),x.length-(1==h.length?p:0));f<b&&y.charCodeAt(y.length-f-1)==x.charCodeAt(x.length-f-1);)++f;if(1==d.length&&1==h.length&&t==a.line)for(;p&&p>a.ch&&y.charCodeAt(y.length-f-1)==x.charCodeAt(x.length-f-1);)p--,f++;d[d.length-1]=y.slice(0,y.length-f).replace(/^\u200b+/,""),d[0]=d[0].slice(p).replace(/\u200b+$/,"");var w=ot(t,p),C=ot(l,h.length?Y(h).length-f:0);return d.length>1||d[0]||at(w,C)?(ra(i.doc,d,w,C,"+input"),!0):void 0},Qs.prototype.ensurePolled=function(){this.forceCompositionEnd()},Qs.prototype.reset=function(){this.forceCompositionEnd()},Qs.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Qs.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Qs.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Ar(this.cm,(function(){return Ri(e.cm)}))},Qs.prototype.setUneditable=function(e){e.contentEditable="false"},Qs.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Pr(this.cm,Ws)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Qs.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Qs.prototype.onContextMenu=function(){},Qs.prototype.resetPosition=function(){},Qs.prototype.needsContentAttribute=!0;var ol=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Z,this.hasSelection=!1,this.composing=null};function al(e,t){if((t=t?R(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=P();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function i(){e.value=s.getValue()}var r;if(e.form&&(fe(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var o=e.form;r=o.submit;try{var a=o.submit=function(){i(),o.submit=r,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(n){n.save=i,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,i(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(ge(e.form,"submit",i),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=r))}},e.style.display="none";var s=Rs((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s}function sl(e){e.off=ge,e.on=fe,e.wheelEventPixels=no,e.Doc=ka,e.splitLines=Be,e.countColumn=O,e.findColumn=q,e.isWordChar=te,e.Pass=H,e.signal=ve,e.Line=cn,e.changeEnd=lo,e.scrollbarModel=br,e.Pos=ot,e.cmpPos=at,e.modes=Ze,e.mimeModes=Fe,e.resolveMode=We,e.getMode=Ge,e.modeExtensions=Ve,e.extendMode=qe,e.copyState=Ue,e.startState=Ye,e.innerMode=Ke,e.commands=Ja,e.keyMap=Oa,e.keyName=Ga,e.isModifierKey=Ha,e.lookupKey=za,e.normalizeKeyMap=Fa,e.StringStream=Xe,e.SharedTextMarker=va,e.TextMarker=ma,e.LineWidget=da,e.e_preventDefault=Ce,e.e_stopPropagation=ke,e.e_stop=Ee,e.addClass=D,e.contains=A,e.rmClass=M,e.keyNames=Ba}ol.prototype.init=function(e){var t=this,n=this,i=this.cm;this.createField(e);var r=this.textarea;function o(e){if(!ye(i,e)){if(i.somethingSelected())Hs({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=qs(i);Hs({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,W):(n.prevInput="",r.value=t.text.join("\n"),j(r))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(r.style.width="0px"),fe(r,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),fe(r,"paste",(function(e){ye(i,e)||Gs(e,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())})),fe(r,"cut",o),fe(r,"copy",o),fe(e.scroller,"paste",(function(t){if(!Gn(e,t)&&!ye(i,t)){if(!r.dispatchEvent)return i.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,r.dispatchEvent(o)}})),fe(e.lineSpace,"selectstart",(function(t){Gn(e,t)||Ce(t)})),fe(r,"compositionstart",(function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}})),fe(r,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},ol.prototype.createField=function(e){this.wrapper=Ks(),this.textarea=this.wrapper.firstChild},ol.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ol.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,i=Gi(e);if(e.options.moveInputWithCursor){var r=xi(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+a.top-o.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+a.left-o.left))}return i},ol.prototype.showSelection=function(e){var t=this.cm.display;L(t.cursorDiv,e.cursors),L(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ol.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&j(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},ol.prototype.getField=function(){return this.textarea},ol.prototype.supportsTouch=function(){return!1},ol.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||P()!=this.textarea))try{this.textarea.focus()}catch(e){}},ol.prototype.blur=function(){this.textarea.blur()},ol.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ol.prototype.receivedFocus=function(){this.slowPoll()},ol.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},ol.prototype.fastPoll=function(){var e=!1,t=this;function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}t.pollingFast=!0,t.polling.set(20,n)},ol.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||je(n)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var r=n.value;if(r==i&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===r||y&&/[\uf700-\uf7ff]/.test(r))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=r.charCodeAt(0);if(8203!=o||i||(i=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(i.length,r.length);l<c&&i.charCodeAt(l)==r.charCodeAt(l);)++l;return Ar(t,(function(){Ws(t,r.slice(l),i.length-l,null,e.composing?"*compose":null),r.length>1e3||r.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=r,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},ol.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ol.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},ol.prototype.onContextMenu=function(e){var t=this,n=t.cm,i=n.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=ji(n,e),c=i.scroller.scrollTop;if(o&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Pr(n,Ho)(n.doc,so(o),W);var u,h=r.style.cssText,p=t.wrapper.style.cssText,f=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",r.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=window.scrollY),i.input.focus(),l&&window.scrollTo(null,u),i.input.reset(),n.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=v,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),a&&s>=9&&g(),k){Ee(e);var m=function(){ge(window,"mouseup",m),setTimeout(v,20)};fe(window,"mouseup",m)}else setTimeout(v,50)}function g(){if(null!=r.selectionStart){var e=n.somethingSelected(),o=""+(e?r.value:"");r.value="⇚",r.value=o,t.prevInput=e?"":"",r.selectionStart=1,r.selectionEnd=o.length,i.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,r.style.cssText=h,a&&s<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=c),null!=r.selectionStart)){(!a||a&&s<9)&&g();var e=0,o=function(){i.selForContextMenu==n.doc.sel&&0==r.selectionStart&&r.selectionEnd>0&&""==t.prevInput?Pr(n,Xo)(n):e++<10?i.detectingSelectAll=setTimeout(o,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(o,200)}}},ol.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},ol.prototype.setUneditable=function(){},ol.prototype.needsContentAttribute=!1,Bs(Rs),Ys(Rs);var ll="iter insert remove copy getEditor constructor".split(" ");for(var cl in ka.prototype)ka.prototype.hasOwnProperty(cl)&&F(ll,cl)<0&&(Rs.prototype[cl]=function(e){return function(){return e.apply(this.doc,arguments)}}(ka.prototype[cl]));return we(ka),Rs.inputStyles={textarea:ol,contenteditable:Qs},Rs.defineMode=function(e){Rs.defaults.mode||"null"==e||(Rs.defaults.mode=e),ze.apply(this,arguments)},Rs.defineMIME=He,Rs.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Rs.defineMIME("text/plain","null"),Rs.defineExtension=function(e,t){Rs.prototype[e]=t},Rs.defineDocExtension=function(e,t){ka.prototype[e]=t},Rs.fromTextArea=al,sl(Rs),Rs.version="5.58.2",Rs}()},25419:function(e,t,n){!function(e){"use strict";e.defineMode("markdown",(function(t,n){var i=e.getMode(t,"text/html"),r="null"==i.name;function o(n){if(e.findModeByName){var i=e.findModeByName(n);i&&(n=i.mime||i.mimes[0])}var r=e.getMode(t,n);return"null"==r.name?null:r}void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1),void 0===n.emoji&&(n.emoji=!1),void 0===n.fencedCodeBlockHighlighting&&(n.fencedCodeBlockHighlighting=!0),void 0===n.fencedCodeBlockDefaultMode&&(n.fencedCodeBlockDefaultMode="text/plain"),void 0===n.xml&&(n.xml=!0),void 0===n.tokenTypeOverrides&&(n.tokenTypeOverrides={});var a={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 s in a)a.hasOwnProperty(s)&&n.tokenTypeOverrides[s]&&(a[s]=n.tokenTypeOverrides[s]);var l=/^([*\-_])(?:\s*\1){2,}\s*$/,c=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,u=/^\[(x| )\](?=\s)/i,d=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,h=/^ {0,3}(?:\={1,}|-{2,})\s*$/,p=/^[^#!\[\]*_\\<>` "'(~:]+/,f=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,m=/^\s*\[[^\]]+?\]:.*$/,g=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,v=" ";function y(e,t,n){return t.f=t.inline=n,n(e,t)}function x(e,t,n){return t.f=t.block=n,n(e,t)}function b(e){return!e||!/\S/.test(e.string)}function w(t){if(t.linkTitle=!1,t.linkHref=!1,t.linkText=!1,t.em=!1,t.strong=!1,t.strikethrough=!1,t.quote=0,t.indentedCode=!1,t.f==k){var n=r;if(!n){var o=e.innerMode(i,t.htmlState);n="xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText}n&&(t.f=T,t.block=C,t.htmlState=null)}return t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.prevLine=t.thisLine,t.thisLine={stream:null},null}function C(t,i){var r=t.column()===i.indentation,s=b(i.prevLine.stream),p=i.indentedCode,g=i.prevLine.hr,v=!1!==i.list,x=(i.listStack[i.listStack.length-1]||0)+3;i.indentedCode=!1;var w=i.indentation;if(null===i.indentationDiff&&(i.indentationDiff=i.indentation,v)){for(i.list=null;w<i.listStack[i.listStack.length-1];)i.listStack.pop(),i.listStack.length?i.indentation=i.listStack[i.listStack.length-1]:i.list=!1;!1!==i.list&&(i.indentationDiff=w-i.listStack[i.listStack.length-1])}var C=!(s||g||i.prevLine.header||v&&p||i.prevLine.fencedCodeEnd),k=(!1===i.list||g||s)&&i.indentation<=x&&t.match(l),M=null;if(i.indentationDiff>=4&&(p||i.prevLine.fencedCodeEnd||i.prevLine.header||s))return t.skipToEnd(),i.indentedCode=!0,a.code;if(t.eatSpace())return null;if(r&&i.indentation<=x&&(M=t.match(d))&&M[1].length<=6)return i.quote=0,i.header=M[1].length,i.thisLine.header=!0,n.highlightFormatting&&(i.formatting="header"),i.f=i.inline,E(i);if(i.indentation<=x&&t.eat(">"))return i.quote=r?1:i.quote+1,n.highlightFormatting&&(i.formatting="quote"),t.eatSpace(),E(i);if(!k&&!i.setext&&r&&i.indentation<=x&&(M=t.match(c))){var T=M[1]?"ol":"ul";return i.indentation=w+t.current().length,i.list=!0,i.quote=0,i.listStack.push(i.indentation),i.em=!1,i.strong=!1,i.code=!1,i.strikethrough=!1,n.taskLists&&t.match(u,!1)&&(i.taskList=!0),i.f=i.inline,n.highlightFormatting&&(i.formatting=["list","list-"+T]),E(i)}return r&&i.indentation<=x&&(M=t.match(f,!0))?(i.quote=0,i.fencedEndRE=new RegExp(M[1]+"+ *$"),i.localMode=n.fencedCodeBlockHighlighting&&o(M[2]||n.fencedCodeBlockDefaultMode),i.localMode&&(i.localState=e.startState(i.localMode)),i.f=i.block=S,n.highlightFormatting&&(i.formatting="code-block"),i.code=-1,E(i)):i.setext||!(C&&v||i.quote||!1!==i.list||i.code||k||m.test(t.string))&&(M=t.lookAhead(1))&&(M=M.match(h))?(i.setext?(i.header=i.setext,i.setext=0,t.skipToEnd(),n.highlightFormatting&&(i.formatting="header")):(i.header="="==M[0].charAt(0)?1:2,i.setext=i.header),i.thisLine.header=!0,i.f=i.inline,E(i)):k?(t.skipToEnd(),i.hr=!0,i.thisLine.hr=!0,a.hr):"["===t.peek()?y(t,i,P):y(t,i,i.inline)}function k(t,n){var o=i.token(t,n.htmlState);if(!r){var a=e.innerMode(i,n.htmlState);("xml"==a.mode.name&&null===a.state.tagStart&&!a.state.context&&a.state.tokenize.isInText||n.md_inside&&t.current().indexOf(">")>-1)&&(n.f=T,n.block=C,n.htmlState=null)}return o}function S(e,t){var i,r=t.listStack[t.listStack.length-1]||0,o=t.indentation<r,s=r+3;return t.fencedEndRE&&t.indentation<=s&&(o||e.match(t.fencedEndRE))?(n.highlightFormatting&&(t.formatting="code-block"),o||(i=E(t)),t.localMode=t.localState=null,t.block=C,t.f=T,t.fencedEndRE=null,t.code=0,t.thisLine.fencedCodeEnd=!0,o?x(e,t,t.block):i):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),a.code)}function E(e){var t=[];if(e.formatting){t.push(a.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var i=0;i<e.formatting.length;i++)t.push(a.formatting+"-"+e.formatting[i]),"header"===e.formatting[i]&&t.push(a.formatting+"-"+e.formatting[i]+"-"+e.header),"quote"===e.formatting[i]&&(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(a.formatting+"-"+e.formatting[i]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(a.linkHref,"url"):(e.strong&&t.push(a.strong),e.em&&t.push(a.em),e.strikethrough&&t.push(a.strikethrough),e.emoji&&t.push(a.emoji),e.linkText&&t.push(a.linkText),e.code&&t.push(a.code),e.image&&t.push(a.image),e.imageAltText&&t.push(a.imageAltText,"link"),e.imageMarker&&t.push(a.imageMarker)),e.header&&t.push(a.header,a.header+"-"+e.header),e.quote&&(t.push(a.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(a.quote+"-"+e.quote):t.push(a.quote+"-"+n.maxBlockquoteDepth)),!1!==e.list){var r=(e.listStack.length-1)%3;r?1===r?t.push(a.list2):t.push(a.list3):t.push(a.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function M(e,t){if(e.match(p,!0))return E(t)}function T(t,r){var o=r.text(t,r);if(void 0!==o)return o;if(r.list)return r.list=null,E(r);if(r.taskList)return" "===t.match(u,!0)[1]?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,E(r);if(r.taskOpen=!1,r.taskClosed=!1,r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"),E(r);var s=t.next();if(r.linkTitle){r.linkTitle=!1;var l=s;"("===s&&(l=")");var c="^\\s*(?:[^"+(l=(l+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+l;if(t.match(new RegExp(c),!0))return a.linkHref}if("`"===s){var d=r.formatting;n.highlightFormatting&&(r.formatting="code"),t.eatWhile("`");var h=t.current().length;if(0!=r.code||r.quote&&1!=h){if(h==r.code){var p=E(r);return r.code=0,p}return r.formatting=d,E(r)}return r.code=h,E(r)}if(r.code)return E(r);if("\\"===s&&(t.next(),n.highlightFormatting)){var f=E(r),m=a.formatting+"-escape";return f?f+" "+m:m}if("!"===s&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return r.imageMarker=!0,r.image=!0,n.highlightFormatting&&(r.formatting="image"),E(r);if("["===s&&r.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return r.imageMarker=!1,r.imageAltText=!0,n.highlightFormatting&&(r.formatting="image"),E(r);if("]"===s&&r.imageAltText){n.highlightFormatting&&(r.formatting="image");var f=E(r);return r.imageAltText=!1,r.image=!1,r.inline=r.f=_,f}if("["===s&&!r.image)return r.linkText&&t.match(/^.*?\]/)||(r.linkText=!0,n.highlightFormatting&&(r.formatting="link")),E(r);if("]"===s&&r.linkText){n.highlightFormatting&&(r.formatting="link");var f=E(r);return r.linkText=!1,r.inline=r.f=t.match(/\(.*?\)| ?\[.*?\]/,!1)?_:T,f}if("<"===s&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return r.f=r.inline=L,n.highlightFormatting&&(r.formatting="link"),(f=E(r))?f+=" ":f="",f+a.linkInline;if("<"===s&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return r.f=r.inline=L,n.highlightFormatting&&(r.formatting="link"),(f=E(r))?f+=" ":f="",f+a.linkEmail;if(n.xml&&"<"===s&&t.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var v=t.string.indexOf(">",t.pos);if(-1!=v){var y=t.string.substring(t.start,v);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(y)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(i),x(t,r,k)}if(n.xml&&"<"===s&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";if("*"===s||"_"===s){for(var b=1,w=1==t.pos?" ":t.string.charAt(t.pos-2);b<3&&t.eat(s);)b++;var C=t.peek()||" ",S=!/\s/.test(C)&&(!g.test(C)||/\s/.test(w)||g.test(w)),M=!/\s/.test(w)&&(!g.test(w)||/\s/.test(C)||g.test(C)),N=null,A=null;if(b%2&&(r.em||!S||"*"!==s&&M&&!g.test(w)?r.em!=s||!M||"*"!==s&&S&&!g.test(C)||(N=!1):N=!0),b>1&&(r.strong||!S||"*"!==s&&M&&!g.test(w)?r.strong!=s||!M||"*"!==s&&S&&!g.test(C)||(A=!1):A=!0),null!=A||null!=N)return n.highlightFormatting&&(r.formatting=null==N?"strong":null==A?"em":"strong em"),!0===N&&(r.em=s),!0===A&&(r.strong=s),p=E(r),!1===N&&(r.em=!1),!1===A&&(r.strong=!1),p}else if(" "===s&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return E(r);t.backUp(1)}if(n.strikethrough)if("~"===s&&t.eatWhile(s)){if(r.strikethrough)return n.highlightFormatting&&(r.formatting="strikethrough"),p=E(r),r.strikethrough=!1,p;if(t.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),E(r)}else if(" "===s&&t.match(/^~~/,!0)){if(" "===t.peek())return E(r);t.backUp(2)}if(n.emoji&&":"===s&&t.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){r.emoji=!0,n.highlightFormatting&&(r.formatting="emoji");var P=E(r);return r.emoji=!1,P}return" "===s&&(t.match(/^ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),E(r)}function L(e,t){if(">"===e.next()){t.f=t.inline=T,n.highlightFormatting&&(t.formatting="link");var i=E(t);return i?i+=" ":i="",i+a.linkInline}return e.match(/^[^>]+/,!0),a.linkInline}function _(e,t){if(e.eatSpace())return null;var i=e.next();return"("===i||"["===i?(t.f=t.inline=A("("===i?")":"]"),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,E(t)):"error"}var N={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function A(e){return function(t,i){if(t.next()===e){i.f=i.inline=T,n.highlightFormatting&&(i.formatting="link-string");var r=E(i);return i.linkHref=!1,r}return t.match(N[e]),i.linkHref=!0,E(i)}}function P(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=D,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,E(t)):y(e,t,T)}function D(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=B,n.highlightFormatting&&(t.formatting="link");var i=E(t);return t.linkText=!1,i}return e.match(/^([^\]\\]|\\.)+/,!0),a.linkText}function B(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=T,a.linkHref+" url")}var j={startState:function(){return{f:C,prevLine:{stream:null},thisLine:{stream:null},block:C,htmlState:null,indentation:0,inline:T,text:M,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(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(i,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkText:t.linkText,linkTitle:t.linkTitle,linkHref:t.linkHref,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,emoji:t.emoji,header:t.header,setext:t.setext,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedEndRE:t.fencedEndRE}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine.stream){if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0))return w(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:e},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=k)){var n=e.match(/^\s*/,!0)[0].replace(/\t/g,v).length;if(t.indentation=n,t.indentationDiff=null,n>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==k?{state:e.htmlState,mode:i}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:j}},indent:function(t,n,r){return t.block==k&&i.indent?i.indent(t.htmlState,n,r):t.localState&&t.localMode.indent?t.localMode.indent(t.localState,n,r):e.Pass},blankLine:w,getType:E,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return j}),"xml"),e.defineMIME("text/markdown","markdown"),e.defineMIME("text/x-markdown","markdown")}(n(89780),n(15525),n(98101))},98101:function(e,t,n){!function(e){"use strict";e.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 t=0;t<e.modeInfo.length;t++){var n=e.modeInfo[t];n.mimes&&(n.mime=n.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.mime==t)return i;if(i.mimes)for(var r=0;r<i.mimes.length;r++)if(i.mimes[r]==t)return i}return/\+xml$/.test(t)?e.findModeByMIME("application/xml"):/\+json$/.test(t)?e.findModeByMIME("application/json"):void 0},e.findModeByExtension=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.ext)for(var r=0;r<i.ext.length;r++)if(i.ext[r]==t)return i}},e.findModeByFileName=function(t){for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.file&&i.file.test(t))return i}var r=t.lastIndexOf("."),o=r>-1&&t.substring(r+1,t.length);if(o)return e.findModeByExtension(o)},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.name.toLowerCase()==t)return i;if(i.alias)for(var r=0;r<i.alias.length;r++)if(i.alias[r].toLowerCase()==t)return i}}}(n(89780))},67549:function(e,t,n){!function(e){"use strict";e.defineMode("stex",(function(e,t){function n(e,t){e.cmdState.push(t)}function i(e){return e.cmdState.length>0?e.cmdState[e.cmdState.length-1]:null}function r(e){var t=e.cmdState.pop();t&&t.closeBracket()}function o(e){for(var t=e.cmdState,n=t.length-1;n>=0;n--){var i=t[n];if("DEFAULT"!=i.name)return i}return{styleIdentifier:function(){return null}}}function a(e,t,n){return function(){this.name=e,this.bracketNo=0,this.style=t,this.styles=n,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var s={};function l(e,t){e.f=t}function c(e,t){var r;if(e.match(/^\\[a-zA-Z@]+/)){var a=e.current().slice(1);return n(t,r=new(r=s.hasOwnProperty(a)?s[a]:s.DEFAULT)),l(t,d),r.style}if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/\\]/))return"tag";if(e.match("\\["))return l(t,(function(e,t){return u(e,t,"\\]")})),"keyword";if(e.match("\\("))return l(t,(function(e,t){return u(e,t,"\\)")})),"keyword";if(e.match("$$"))return l(t,(function(e,t){return u(e,t,"$$")})),"keyword";if(e.match("$"))return l(t,(function(e,t){return u(e,t,"$")})),"keyword";var c=e.next();return"%"==c?(e.skipToEnd(),"comment"):"}"==c||"]"==c?(r=i(t))?(r.closeBracket(c),l(t,d),"bracket"):"error":"{"==c||"["==c?(n(t,r=new(r=s.DEFAULT)),"bracket"):/\d/.test(c)?(e.eatWhile(/[\w.%]/),"atom"):(e.eatWhile(/[\w\-_]/),"begin"==(r=o(t)).name&&(r.argument=e.current()),r.styleIdentifier())}function u(e,t,n){if(e.eatSpace())return null;if(n&&e.match(n))return l(t,c),"keyword";if(e.match(/^\\[a-zA-Z@]+/))return"tag";if(e.match(/^[a-zA-Z]+/))return"variable-2";if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/]/))return"tag";if(e.match(/^[\^_&]/))return"tag";if(e.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(e.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var i=e.next();return"{"==i||"}"==i||"["==i||"]"==i||"("==i||")"==i?"bracket":"%"==i?(e.skipToEnd(),"comment"):"error"}function d(e,t){var n=e.peek();return"{"==n||"["==n?(i(t).openBracket(n),e.eat(n),l(t,c),"bracket"):/[ \t\r]/.test(n)?(e.eat(n),null):(l(t,c),r(t),c(e,t))}return s.importmodule=a("importmodule","tag",["string","builtin"]),s.documentclass=a("documentclass","tag",["","atom"]),s.usepackage=a("usepackage","tag",["atom"]),s.begin=a("begin","tag",["atom"]),s.end=a("end","tag",["atom"]),s.label=a("label","tag",["atom"]),s.ref=a("ref","tag",["atom"]),s.eqref=a("eqref","tag",["atom"]),s.cite=a("cite","tag",["atom"]),s.bibitem=a("bibitem","tag",["atom"]),s.Bibitem=a("Bibitem","tag",["atom"]),s.RBibitem=a("RBibitem","tag",["atom"]),s.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{startState:function(){return{cmdState:[],f:t.inMathMode?function(e,t){return u(e,t)}:c}},copyState:function(e){return{cmdState:e.cmdState.slice(),f:e.f}},token:function(e,t){return t.f(e,t)},blankLine:function(e){e.f=c,e.cmdState.length=0},lineComment:"%"}})),e.defineMIME("text/x-stex","stex"),e.defineMIME("text/x-latex","stex")}(n(89780))},15525:function(e,t,n){!function(e){"use strict";var t={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},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(i,r){var o,a,s=i.indentUnit,l={},c=r.htmlMode?t:n;for(var u in c)l[u]=c[u];for(var u in r)l[u]=r[u];function d(e,t){function n(n){return t.tokenize=n,n(e,t)}var i=e.next();return"<"==i?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(f("atom","]]>")):null:e.match("--")?n(f("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(m(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=f("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=h,"tag bracket"):"&"==i?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function h(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=d,o=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return o="equals",null;if("<"==n){t.tokenize=d,t.state=x,t.tagName=t.tagStart=null;var i=t.tokenize(e,t);return i?i+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=p(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=h;break}return"string"};return t.isInAttribute=!0,t}function f(e,t){return function(n,i){for(;!n.eol();){if(n.match(t)){i.tokenize=d;break}n.next()}return e}}function m(e){return function(t,n){for(var i;null!=(i=t.next());){if("<"==i)return n.tokenize=m(e+1),n.tokenize(t,n);if(">"==i){if(1==e){n.tokenize=d;break}return n.tokenize=m(e-1),n.tokenize(t,n)}}return"meta"}}function g(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function v(e){e.context&&(e.context=e.context.prev)}function y(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(t))return;v(e)}}function x(e,t,n){return"openTag"==e?(n.tagStart=t.column(),b):"closeTag"==e?w:x}function b(e,t,n){return"word"==e?(n.tagName=t.current(),a="tag",S):l.allowMissingTagName&&"endTag"==e?(a="tag bracket",S(e,t,n)):(a="error",b)}function w(e,t,n){if("word"==e){var i=t.current();return n.context&&n.context.tagName!=i&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&v(n),n.context&&n.context.tagName==i||!1===l.matchClosing?(a="tag",C):(a="tag error",k)}return l.allowMissingTagName&&"endTag"==e?(a="tag bracket",C(e,t,n)):(a="error",k)}function C(e,t,n){return"endTag"!=e?(a="error",C):(v(n),x)}function k(e,t,n){return a="error",C(e,t,n)}function S(e,t,n){if("word"==e)return a="attribute",E;if("endTag"==e||"selfcloseTag"==e){var i=n.tagName,r=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(i)?y(n,i):(y(n,i),n.context=new g(n,i,r==n.indented)),x}return a="error",S}function E(e,t,n){return"equals"==e?M:(l.allowMissing||(a="error"),S(e,t,n))}function M(e,t,n){return"string"==e?T:"word"==e&&l.allowUnquoted?(a="string",S):(a="error",S(e,t,n))}function T(e,t,n){return"string"==e?T:S(e,t,n)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:x,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(a=null,t.state=t.state(o||n,e,t),a&&(n="error"==a?n+" error":a)),n},indent:function(t,n,i){var r=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(r&&r.noIndent)return e.Pass;if(t.tokenize!=h&&t.tokenize!=d)return i?i.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var o=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(o&&o[1])for(;r;){if(r.tagName==o[2]){r=r.prev;break}if(!l.implicitlyClosed.hasOwnProperty(r.tagName))break;r=r.prev}else if(o)for(;r;){var a=l.contextGrabbers[r.tagName];if(!a||!a.hasOwnProperty(o[2]))break;r=r.prev}for(;r&&r.prev&&!r.startOfLine;)r=r.prev;return r?r.indent+s:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==M&&(e.state=S)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)n.tagName&&t.push(n.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(89780))},2859:function(e,t,n){"use strict";n.d(t,{hP:function(){return Q}});var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function r(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function o(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}function a(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function s(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),r=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,r++)i[r]=o[a];return i}var l=function(){function e(){}return e.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},e.setAttributes=function(e,t){for(var n=0,i=t;n<i.length;n++){var r=i[n],o=r[0],a=r[1];e.setAttribute(o,a)}},e.createRect=function(t,n,i){var r=document.createElementNS("http://www.w3.org/2000/svg","rect");return r.setAttribute("width",t.toString()),r.setAttribute("height",n.toString()),i&&e.setAttributes(r,i),r},e.createLine=function(t,n,i,r,o){var a=document.createElementNS("http://www.w3.org/2000/svg","line");return a.setAttribute("x1",t.toString()),a.setAttribute("y1",n.toString()),a.setAttribute("x2",i.toString()),a.setAttribute("y2",r.toString()),o&&e.setAttributes(a,o),a},e.createPolygon=function(t,n){var i=document.createElementNS("http://www.w3.org/2000/svg","polygon");return i.setAttribute("points",t),n&&e.setAttributes(i,n),i},e.createCircle=function(t,n){var i=document.createElementNS("http://www.w3.org/2000/svg","circle");return i.setAttribute("cx",(t/2).toString()),i.setAttribute("cy",(t/2).toString()),i.setAttribute("r",t.toString()),n&&e.setAttributes(i,n),i},e.createEllipse=function(t,n,i){var r=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return r.setAttribute("cx",(t/2).toString()),r.setAttribute("cy",(n/2).toString()),r.setAttribute("rx",(t/2).toString()),r.setAttribute("ry",(n/2).toString()),i&&e.setAttributes(r,i),r},e.createGroup=function(t){var n=document.createElementNS("http://www.w3.org/2000/svg","g");return t&&e.setAttributes(n,t),n},e.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},e.createMarker=function(t,n,i,r,o,a,s){var l=document.createElementNS("http://www.w3.org/2000/svg","marker");return e.setAttributes(l,[["id",t],["orient",n],["markerWidth",i.toString()],["markerHeight",r.toString()],["refX",o.toString()],["refY",a.toString()]]),l.appendChild(s),l},e.createText=function(t){var n=document.createElementNS("http://www.w3.org/2000/svg","text");return n.setAttribute("x","0"),n.setAttribute("y","0"),t&&e.setAttributes(n,t),n},e.createTSpan=function(t,n){var i=document.createElementNS("http://www.w3.org/2000/svg","tspan");return i.textContent=t,n&&e.setAttributes(i,n),i},e.createImage=function(t){var n=document.createElementNS("http://www.w3.org/2000/svg","image");return t&&e.setAttributes(n,t),n},e.createPoint=function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return n.x=e,n.y=t,n},e.createPath=function(t,n){var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",t),n&&e.setAttributes(i,n),i},e}(),c=function(){function e(){}return e.addKey=function(t){e.key=t},Object.defineProperty(e,"isLicensed",{get:function(){return!!e.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(e.key)},enumerable:!1,configurable:!0}),e}(),u=function(){function e(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return e.prototype.rasterize=function(e,t,n){var i=this;return new Promise((function(r){var o=void 0!==n?n:document.createElement("canvas");null===e&&(i.markersOnly=!0,i.naturalSize=!1);var a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("width",t.width.baseVal.valueAsString),a.setAttribute("height",t.height.baseVal.valueAsString),a.setAttribute("viewBox","0 0 "+t.viewBox.baseVal.width.toString()+" "+t.viewBox.baseVal.height.toString()),a.innerHTML=t.innerHTML,!0===i.naturalSize?(a.width.baseVal.value=e.naturalWidth,a.height.baseVal.value=e.naturalHeight):void 0!==i.width&&void 0!==i.height&&(a.width.baseVal.value=i.width,a.height.baseVal.value=i.height),o.width=a.width.baseVal.value,o.height=a.height.baseVal.value;var s=a.outerHTML,l=o.getContext("2d");!0!==i.markersOnly&&l.drawImage(e,0,0,o.width,o.height);var c=window.URL,u=new Image(o.width,o.height);u.setAttribute("crossOrigin","anonymous");var d=new Blob([s],{type:"image/svg+xml"}),h=c.createObjectURL(d);u.onload=function(){l.drawImage(u,0,0),c.revokeObjectURL(h);var e=o.toDataURL(i.imageType,i.imageQuality);r(e)},u.src=h}))},e}(),d=function(){},h=function(){function e(e){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+e+"_"}return Object.defineProperty(e.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(e.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(e.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),e.prototype.addClass=function(e){return void 0===this.styleSheet&&this.addStyleSheet(),e.name=""+this.classNamePrefix+e.localName,this.classes.push(e),this.styleSheet.sheet.insertRule("."+e.name+" {"+e.style+"}",this.styleSheet.sheet.cssRules.length),e},e.prototype.addRule=function(e){void 0===this.styleSheet&&this.addStyleSheet(),this.rules.push(e),this.styleSheet.sheet.insertRule(e.selector+" {"+e.style+"}",this.styleSheet.sheet.cssRules.length)},e.prototype.addStyleSheet=function(){var e;this.styleSheet=document.createElement("style"),(null!==(e=this.styleSheetRoot)&&void 0!==e?e:document.head).appendChild(this.styleSheet),this.addRule(new p("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new p("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames","\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n ")),this.addRule(new p("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames","\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n ")),this.addClass(new f("fade_in","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_in_animation_frames;\n ")),this.addClass(new f("fade_out","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_out_animation_frames;\n "))},e.prototype.removeStyleSheet=function(){var e;this.styleSheet&&((null!==(e=this.styleSheetRoot)&&void 0!==e?e:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},e}(),p=function(e,t){this.selector=e,this.style=t},f=function(e,t){this.localName=e,this.style=t},m=function(){function e(e,t,n,i,r){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=e,this.displayMode=t,this.markerItems=n,this.uiStyleSettings=i,this.styles=r,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return e.prototype.show=function(e){var t=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=e,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var n=document.createElement("div");n.className=this.toolbarBlockStyleClass.name,n.style.whiteSpace="nowrap",this.uiContainer.appendChild(n),this.addActionButton(n,'<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(n,'<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(n,'<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(n,'<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(n,'<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(n,'<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(n,'<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(n,'<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(e){var n=document.createElement("div");n.className=""+t.toolbarButtonStyleClass.name,n.setAttribute("data-type-name",e.typeName),n.innerHTML=e.icon,n.addEventListener("click",(function(){t.markerToolbarButtonClicked(n,e)})),t.buttons.push(n),t.markerButtons.push(n)})),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 i=document.createElement("div");i.className=this.toolbarBlockStyleClass.name,i.style.whiteSpace="nowrap",i.style.display=!1!==this.uiStyleSettings.resultButtonBlockVisible?"":"none",this.uiContainer.appendChild(i),this.addActionButton(i,'<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(i,'<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()},e.prototype.addButtonClickListener=function(e){this.buttonClickListeners.push(e)},e.prototype.removeButtonClickListener=function(e){this.buttonClickListeners.indexOf(e)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(e),1)},e.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},e.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var e=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var t=0;t<this.markerButtons.length;t++)t<e||t===e&&this.markerButtons.length-1===e?this.markerButtonBlock.appendChild(this.markerButtons[t]):(t===e&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[t]))}},e.prototype.overflowButtonClicked=function(){"none"!==this.markerButtonOverflowBlock.style.display?(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")},e.prototype.resetButtonStyles=function(){var e=this;this.buttons.forEach((function(t){t.className=t.className.replace(e.uiStyleSettings.toolbarButtonStyleColorsClassName?e.uiStyleSettings.toolbarButtonStyleColorsClassName:e.toolbarButtonStyleColorsClass.name,"").trim(),t.className=t.className.replace(e.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?e.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:e.toolbarActiveButtonStyleColorsClass.name,"").trim(),t.className+=" "+(e.uiStyleSettings.toolbarButtonStyleColorsClassName?e.uiStyleSettings.toolbarButtonStyleColorsClassName:e.toolbarButtonStyleColorsClass.name)}))},e.prototype.addActionButton=function(e,t,n){var i=this,r=document.createElement("div");switch(r.className=""+this.toolbarButtonStyleClass.name,r.innerHTML=t,r.setAttribute("data-action",n),r.addEventListener("click",(function(){i.actionToolbarButtonClicked(r,n)})),n){case"select":case"undo":case"redo":r.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":r.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"render":r.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":r.style.fill=this.uiStyleSettings.closeButtonColor}e.appendChild(r),this.buttons.push(r)},e.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new f("toolbar","\n width: 100%;\n flex-shrink: 0;\n display: flex;\n flex-direction: row;\n justify-content: space-between; \n height: "+this.uiStyleSettings.toolbarHeight+"px;\n box-sizing: content-box;\n "+("inline"===this.displayMode?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n "+("inline"===this.displayMode?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n overflow: hidden;\n ")),this.toolbarStyleColorsClass=this.styles.addClass(new f("toolbar_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n box-shadow: 0px 3px rgba(33, 33, 33, 0.1);\n ")),this.toolbarBlockStyleClass=this.styles.addClass(new f("toolbar-block","\n display: inline-block;\n box-sizing: content-box;\n ")),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new f("toolbar-overflow-block","\n position: absolute;\n top: "+this.uiStyleSettings.toolbarHeight+"px;\n max-width: "+2*this.uiStyleSettings.toolbarHeight+"px;\n z-index: 10;\n box-sizing: content-box;\n ")),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new f("toolbar-overflow-block_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n "));var e=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new f("toolbar_button","\n display: inline-block;\n width: "+(this.uiStyleSettings.toolbarHeight-2*e)+"px;\n height: "+(this.uiStyleSettings.toolbarHeight-2*e)+"px;\n padding: "+e+"px;\n box-sizing: content-box;\n ")),this.toolbarButtonStyleColorsClass=this.styles.addClass(new f("toolbar_button_colors","\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new f("toolbar_active_button","\n fill: "+this.uiStyleSettings.toolbarColor+";\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n ")),this.styles.addRule(new p("."+this.toolbarButtonStyleClass.name+" svg","\n height: "+this.uiStyleSettings.toolbarHeight/2+"px;\n ")),this.styles.addRule(new p("."+this.toolbarButtonStyleColorsClass.name+":hover","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n "))},e.prototype.markerToolbarButtonClicked=function(e,t){this.setActiveButton(e),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach((function(e){return e("marker",t)})),this.markerButtonOverflowBlock.style.display="none"},e.prototype.actionToolbarButtonClicked=function(e,t){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach((function(e){return e("action",t)})),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},e.prototype.setActiveButton=function(e){this.resetButtonStyles(),e.className=e.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),e.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},e.prototype.setActiveMarkerButton=function(e){var t=this.markerButtons.find((function(t){return t.getAttribute("data-type-name")===e}));t&&this.setActiveButton(t)},e.prototype.setCurrentMarker=function(e){var t=this;this.currentMarker=e,this.buttons.filter((function(e){return/delete|notes/.test(e.getAttribute("data-action"))})).forEach((function(e){void 0===t.currentMarker?(e.style.fillOpacity="0.4",e.style.pointerEvents="none"):(e.style.fillOpacity="1",e.style.pointerEvents="all")}))},e}(),g=function(){function e(e,t,n,i){this.panels=[],this.panelButtons=[],this.markerjsContainer=e,this.displayMode=t,this.uiStyleSettings=n,this.styles=i,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return e.prototype.addStyles=function(){var e;this.toolboxStyleClass=this.styles.addClass(new f("toolbox","\n width: 100%;\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n font-family: sans-serif;\n "+("popup"===this.displayMode?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+"\n box-sizing: content-box;\n "+("popup"===this.displayMode?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+"\n "+("inline"===this.displayMode?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n "+("inline"===this.displayMode?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n overflow: hidden;\n ")),this.toolboxStyleColorsClass=this.styles.addClass(new f("toolbox_colors","\n color: "+this.uiStyleSettings.toolboxColor+";\n "));var t=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new f("toolbox-button-row","\n display: flex;\n cursor: default;\n box-sizing: content-box;\n ")),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new f("toolbox-button-row_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n ")),this.toolboxPanelRowStyleClass=this.styles.addClass(new f("toolbox-panel-row","\n display: flex;\n "+("inline"===this.displayMode?"position: absolute;":"")+"\n "+("inline"===this.displayMode?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+"\n cursor: default;\n height: "+1.5*this.uiStyleSettings.toolbarHeight+"px;\n "+("inline"===this.displayMode?"width: 100%;":"")+"\n box-sizing: content-box;\n ")),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new f("toolbox-panel-row_colors","\n background-color: "+(null!==(e=this.uiStyleSettings.toolboxBackgroundColor)&&void 0!==e?e:this.uiStyleSettings.toolbarBackgroundHoverColor)+";\n ")),this.toolboxButtonStyleClass=this.styles.addClass(new f("toolbox_button","\n display: inline-block;\n width: "+(this.uiStyleSettings.toolbarHeight-2*t)+"px;\n height: "+(this.uiStyleSettings.toolbarHeight-2*t)+"px;\n padding: "+t+"px;\n box-sizing: content-box;\n ")),this.toolboxButtonStyleColorsClass=this.styles.addClass(new f("toolbox-button_colors","\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new f("toolbox-active-button_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+";\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.styles.addRule(new p("."+this.toolboxButtonStyleColorsClass.name+":hover","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n ")),this.styles.addRule(new p("."+this.toolboxButtonStyleClass.name+" svg","\n height: "+this.uiStyleSettings.toolbarHeight/2+"px;\n "))},e.prototype.show=function(e){var t;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=e,this.uiContainer.className=this.toolboxStyleClass.name+" "+(null!==(t=this.uiStyleSettings.toolboxStyleColorsClassName)&&void 0!==t?t:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},e.prototype.setPanelButtons=function(e){var t,n,i=this;this.panels=e,void 0!==this.uiContainer&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+(null!==(t=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)&&void 0!==t?t:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+(null!==(n=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)&&void 0!==n?n:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach((function(e){var t;e.uiStyleSettings=i.uiStyleSettings;var n=document.createElement("div");n.className=i.toolboxButtonStyleClass.name+" "+(null!==(t=i.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==t?t:i.toolboxButtonStyleColorsClass.name),n.innerHTML=e.icon,n.title=e.title,n.addEventListener("click",(function(){i.panelButtonClick(e)})),i.panelButtons.push(n),i.buttonRow.appendChild(n)})),"inline"===this.displayMode?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},e.prototype.panelButtonClick=function(e){var t=this,n=-1;if(e!==this.activePanel){n=this.panels.indexOf(e),this.panelRow.innerHTML="";var i=e.getUi();i.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(i),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=e}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout((function(){"inline"===t.displayMode?t.panelRow.style.display="none":t.panelRow.style.visibility="hidden"}),200);this.panelButtons.forEach((function(e,i){var r,o;e.className=t.toolboxButtonStyleClass.name+" "+(i===n?""+(null!==(r=t.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)&&void 0!==r?r:t.toolboxActiveButtonStyleColorsClass.name):""+(null!==(o=t.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==o?o:t.toolboxButtonStyleColorsClass.name))}))},e}(),v=function(e,t){this.title=e,this.icon=t},y=function(e){function t(t,n,i,r){var o=e.call(this,t,r||'<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 o.colors=[],o.addTransparent=!1,o.colorBoxes=[],o.colors=n,o.currentColor=i,o.setCurrentColor=o.setCurrentColor.bind(o),o.getColorBox=o.getColorBox.bind(o),o}return r(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.overflow="hidden",t.style.whiteSpace="nowrap",this.colors.forEach((function(n){var i=e.getColorBox(n);t.appendChild(i),e.colorBoxes.push(i)})),t},t.prototype.getColorBox=function(e){var t=this,n=this.uiStyleSettings.toolbarHeight/4,i=this.uiStyleSettings.toolbarHeight-n,r=document.createElement("div");r.style.display="inline-block",r.style.boxSizing="content-box",r.style.width=i-2+"px",r.style.height=i-2+"px",r.style.padding="1px",r.style.marginRight="2px",r.style.marginBottom="2px",r.style.borderWidth="2px",r.style.borderStyle="solid",r.style.borderRadius=(i+2)/2+"px",r.style.borderColor=e===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){t.setCurrentColor(e,r)}));var o=document.createElement("div");return o.style.display="inline-block",o.style.width=i-2+"px",o.style.height=i-2+"px",o.style.backgroundColor=e,o.style.borderRadius=i/2+"px","transparent"===e&&(o.style.fill=this.uiStyleSettings.toolboxAccentColor,o.innerHTML='<svg viewBox="0 0 24 24">\n <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" />\n </svg>'),r.appendChild(o),r},t.prototype.setCurrentColor=function(e,t){var n=this;this.currentColor=e,this.colorBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onColorChanged&&this.onColorChanged(e)},t}(v),x=function(){function e(e,t,n){this._state="new",this._isSelected=!1,this._container=e,this._overlayContainer=t,this.globalSettings=n,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(e.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),e.prototype.ownsTarget=function(e){return!1},Object.defineProperty(e.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),e.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},e.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},e.prototype.pointerDown=function(e,t){},e.prototype.dblClick=function(e,t){},e.prototype.manipulate=function(e){},e.prototype.pointerUp=function(e){this.stateChanged()},e.prototype.dispose=function(){},e.prototype.addMarkerVisualToContainer=function(e){this.container.childNodes.length>0?this.container.insertBefore(e,this.container.childNodes[0]):this.container.appendChild(e)},e.prototype.getState=function(){return{typeName:e.typeName,state:this.state,notes:this.notes}},e.prototype.restoreState=function(e){this._state=e.state,this.notes=e.notes},e.prototype.scale=function(e,t){},e.prototype.colorChanged=function(e){this.onColorChanged&&this.onColorChanged(e),this.stateChanged()},e.prototype.fillColorChanged=function(e){this.onFillColorChanged&&this.onFillColorChanged(e),this.stateChanged()},e.prototype.stateChanged=function(){if(this.onStateChanged&&"creating"!==this.state&&"new"!==this.state){var e=this.getState();void 0!==this.manipulationStartState&&(this.manipulationStartState.state="select"),e.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(e)&&this.onStateChanged(this)}},e.typeName="MarkerBase",e}(),b=function(){function e(){this.findGripByVisual=this.findGripByVisual.bind(this)}return e.prototype.findGripByVisual=function(e){return this.topLeft.ownsTarget(e)?this.topLeft:this.topCenter.ownsTarget(e)?this.topCenter:this.topRight.ownsTarget(e)?this.topRight:this.centerLeft.ownsTarget(e)?this.centerLeft:this.centerRight.ownsTarget(e)?this.centerRight:this.bottomLeft.ownsTarget(e)?this.bottomLeft:this.bottomCenter.ownsTarget(e)?this.bottomCenter:this.bottomRight.ownsTarget(e)?this.bottomRight:void 0},e}(),w=function(){function e(){this.GRIP_SIZE=10,this.visual=l.createGroup(),this.visual.appendChild(l.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(l.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return e.prototype.ownsTarget=function(e){return e===this.visual||e===this.visual.childNodes[0]||e===this.visual.childNodes[1]},e}(),C=function(){function e(){}return e.toITransformMatrix=function(e){return{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e,f:e.f}},e.toSVGMatrix=function(e,t){return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e},e}(),k=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.left=0,r.top=0,r.width=0,r.height=0,r.defaultSize={x:50,y:20},r.offsetX=0,r.offsetY=0,r.rotationAngle=0,r.CB_DISTANCE=10,r._suppressMarkerCreateEvent=!1,r.container.transform.baseVal.appendItem(l.createTransform()),r.setupControlBox(),r}return r(t,e),Object.defineProperty(t.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visual",{get:function(){return this._visual},set:function(e){this._visual=e;var t=l.createTransform();this._visual.transform.baseVal.appendItem(t)},enumerable:!1,configurable:!0}),t.prototype.ownsTarget=function(t){return!!e.prototype.ownsTarget.call(this,t)||!!(void 0!==this.controlGrips.findGripByVisual(t)||void 0!==this.rotatorGrip&&this.rotatorGrip.ownsTarget(t))},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"new"===this.state&&(this.left=t.x,this.top=t.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var i=this.unrotatePoint(t);if(this.manipulationStartX=i.x,this.manipulationStartY=i.y,this.offsetX=i.x-this.left,this.offsetY=i.y-this.top,"new"!==this.state)if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(n),void 0!==this.activeGrip)this._state="resize";else if(void 0!==this.rotatorGrip&&this.rotatorGrip.ownsTarget(n)){this.activeGrip=this.rotatorGrip;var r=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=r.x-this.width/2,this.top=r.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var o=this.container.transform.baseVal.getItem(0);o.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(o,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},t.prototype.pointerUp=function(t){var n=this.state;e.prototype.pointerUp.call(this,t),"creating"===this.state&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(t),this._state="select","creating"===n&&this.onMarkerCreated&&!1===this._suppressMarkerCreateEvent&&this.onMarkerCreated(this)},t.prototype.moveVisual=function(e){this.visual.style.transform="translate("+e.x+"px, "+e.y+"px)"},t.prototype.manipulate=function(e){var t=this.unrotatePoint(e);"creating"===this.state?this.resize(e):"move"===this.state?(this.left=this.manipulationStartLeft+(t.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(t.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):"resize"===this.state?this.resize(t):"rotate"===this.state&&this.rotate(e)},t.prototype.resize=function(e){var t=this.manipulationStartLeft,n=this.manipulationStartWidth,i=this.manipulationStartTop,r=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:t=this.manipulationStartLeft+e.x-this.manipulationStartX,n=this.manipulationStartWidth+this.manipulationStartLeft-t;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:n=this.manipulationStartWidth+e.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:i=this.manipulationStartTop+e.y-this.manipulationStartY,r=this.manipulationStartHeight+this.manipulationStartTop-i;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:r=this.manipulationStartHeight+e.y-this.manipulationStartY}n>=0?(this.left=t,this.width=n):(this.left=t+n,this.width=-n),r>=0?(this.top=i,this.height=r):(this.top=i+r,this.height=-r),this.setSize()},t.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},t.prototype.rotate=function(e){if(Math.abs(e.x-this.centerX)>.1){var t=Math.sign(e.x-this.centerX);this.rotationAngle=180*Math.atan((e.y-this.centerY)/(e.x-this.centerX))/Math.PI+90*t,this.applyRotation()}},t.prototype.applyRotation=function(){var e=this.container.transform.baseVal.getItem(0);e.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(e,0)},t.prototype.rotatePoint=function(e){if(0===this.rotationAngle)return e;var t=this.container.getCTM(),n=l.createPoint(e.x,e.y);return{x:(n=n.matrixTransform(t)).x,y:n.y}},t.prototype.unrotatePoint=function(e){if(0===this.rotationAngle)return e;var t=this.container.getCTM();t=t.inverse();var n=l.createPoint(e.x,e.y);return{x:(n=n.matrixTransform(t)).x,y:n.y}},t.prototype.select=function(){e.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},t.prototype.deselect=function(){e.prototype.deselect.call(this),this.controlBox.style.display="none"},t.prototype.setupControlBox=function(){this.controlBox=l.createGroup();var e=l.createTransform();e.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(e),this.container.appendChild(this.controlBox),this.controlRect=l.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),!0!==this.globalSettings.disableRotation&&(this.rotatorGripLine=l.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 b,this.addControlGrips(),this.controlBox.style.display="none"},t.prototype.adjustControlBox=function(){var e=this.controlBox.transform.baseVal.getItem(0);e.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(e,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),void 0!==this.rotatorGripLine&&(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()},t.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(),!0!==this.globalSettings.disableRotation&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},t.prototype.createGrip=function(){var e=new w;return e.visual.transform.baseVal.appendItem(l.createTransform()),this.controlBox.appendChild(e.visual),e},t.prototype.positionGrips=function(){var e=this.controlGrips.topLeft.GRIP_SIZE,t=-e/2,n=t,i=(this.width+this.CB_DISTANCE)/2-e/2,r=(this.height+this.CB_DISTANCE)/2-e/2,o=this.height+this.CB_DISTANCE-e/2,a=this.width+this.CB_DISTANCE-e/2;this.positionGrip(this.controlGrips.topLeft.visual,t,n),this.positionGrip(this.controlGrips.topCenter.visual,i,n),this.positionGrip(this.controlGrips.topRight.visual,a,n),this.positionGrip(this.controlGrips.centerLeft.visual,t,r),this.positionGrip(this.controlGrips.centerRight.visual,a,r),this.positionGrip(this.controlGrips.bottomLeft.visual,t,o),this.positionGrip(this.controlGrips.bottomCenter.visual,i,o),this.positionGrip(this.controlGrips.bottomRight.visual,a,o),void 0!==this.rotatorGrip&&this.positionGrip(this.rotatorGrip.visual,i,n-3*this.CB_DISTANCE)},t.prototype.positionGrip=function(e,t,n){var i=e.transform.baseVal.getItem(0);i.setTranslate(t,n),e.transform.baseVal.replaceItem(i,0)},t.prototype.hideControlBox=function(){this.controlBox.style.display="none"},t.prototype.showControlBox=function(){this.controlBox.style.display=""},t.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:C.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:C.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},e.prototype.getState.call(this))},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.left=n.left,this.top=n.top,this.width=n.width,this.height=n.height,this.rotationAngle=n.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(C.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,n.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(C.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,n.containerTransformMatrix))},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n);var i=this.rotatePoint({x:this.left,y:this.top}),r=this.unrotatePoint({x:i.x*t,y:i.y*n});this.left=r.x,this.top=r.y,this.width=this.width*t,this.height=this.height*n,this.adjustControlBox()},t}(x),S=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.fillColor="transparent",r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.opacity=1,r.setStrokeColor=r.setStrokeColor.bind(r),r.setFillColor=r.setFillColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.createVisual=r.createVisual.bind(r),r}return r(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual)},t.prototype.createVisual=function(){this.visual=l.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)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"new"===this.state&&(this.createVisual(),this.moveVisual(t),this._state="creating")},t.prototype.manipulate=function(t){e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.setSize()},t.prototype.setSize=function(){e.prototype.setSize.call(this),l.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},t.prototype.pointerUp=function(t){e.prototype.pointerUp.call(this,t),this.setSize()},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.visual&&l.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(e),this.stateChanged()},t.prototype.setFillColor=function(e){this.fillColor=e,this.visual&&l.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.visual&&l.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.visual&&l.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},t.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},e.prototype.getState.call(this))},t.prototype.restoreState=function(t){var n=t;this.fillColor=n.fillColor,this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.opacity=n.opacity,this.createVisual(),e.prototype.restoreState.call(this,t),this.setSize()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.setSize()},t.title="Rectangle marker",t}(k),E=function(e){function t(t,n,i,r){var o=e.call(this,t,r||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return o.widths=[],o.widthBoxes=[],o.widths=n,o.currentWidth=i,o.setCurrentWidth=o.setCurrentWidth.bind(o),o}return r(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.display="flex",t.style.overflow="hidden",t.style.flexGrow="2",this.widths.forEach((function(n){var i=document.createElement("div");i.style.display="flex",i.style.flexGrow="2",i.style.alignItems="center",i.style.justifyContent="space-between",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.borderColor=n===e.currentWidth?e.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){e.setCurrentWidth(n,i)})),t.appendChild(i);var r=document.createElement("div");r.innerText=n.toString(),r.style.marginRight="5px",i.appendChild(r);var o=document.createElement("div");o.style.minHeight="20px",o.style.flexGrow="2",o.style.display="flex",o.style.alignItems="center";var a=document.createElement("hr");a.style.minWidth="20px",a.style.border="0px",a.style.borderTop=n+"px solid "+e.uiStyleSettings.toolboxColor,a.style.flexGrow="2",o.appendChild(a),i.appendChild(o),e.widthBoxes.push(i)})),t},t.prototype.setCurrentWidth=function(e,t){var n=this;this.currentWidth=e,this.widthBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},t}(v),M=function(e){function t(t,n,i,r){var o=e.call(this,t,r||'<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 o.styles=[],o.styleBoxes=[],o.styles=n,o.currentStyle=i,o.setCurrentStyle=o.setCurrentStyle.bind(o),o}return r(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.display="flex",t.style.overflow="hidden",t.style.flexGrow="2",this.styles.forEach((function(n){var i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="space-between",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.overflow="hidden",i.style.maxWidth=100/e.styles.length-5+"%",i.style.borderColor=n===e.currentStyle?e.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){e.setCurrentStyle(n,i)})),t.appendChild(i);var r=document.createElement("div");r.style.minHeight="20px",r.style.flexGrow="2",r.style.overflow="hidden";var o='<svg width="100" height="20">\n <line x1="0" y1="10" x2="100" y2="10" stroke="'+e.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(""!==n?'stroke-dasharray="'+n+'"':"")+" />\n </svg>";r.innerHTML=o,i.appendChild(r),e.styleBoxes.push(i)})),t},t.prototype.setCurrentStyle=function(e,t){var n=this;this.currentStyle=e,this.styleBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},t}(v),T=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.strokePanel=new y("Line color",i.defaultColorSet,i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new E("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new M("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return r(t,e),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.typeName="FrameMarker",t.title="Frame marker",t.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',t}(S),L=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"},_=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.x1=0,r.y1=0,r.x2=0,r.y2=0,r.defaultLength=50,r.manipulationStartX=0,r.manipulationStartY=0,r.manipulationStartX1=0,r.manipulationStartY1=0,r.manipulationStartX2=0,r.manipulationStartY2=0,r.setupControlBox(),r}return r(t,e),t.prototype.ownsTarget=function(t){return!!e.prototype.ownsTarget.call(this,t)||!(!this.grip1.ownsTarget(t)&&!this.grip2.ownsTarget(t))},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),this.manipulationStartX=t.x,this.manipulationStartY=t.y,"new"===this.state&&(this.x1=t.x,this.y1=t.y,this.x2=t.x,this.y2=t.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,"new"!==this.state&&(this.select(),this.grip1.ownsTarget(n)?this.activeGrip=this.grip1:this.grip2.ownsTarget(n)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},t.prototype.pointerUp=function(t){var n=this.state;e.prototype.pointerUp.call(this,t),"creating"===this.state&&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(t),this._state="select","creating"===n&&this.onMarkerCreated&&this.onMarkerCreated(this)},t.prototype.adjustVisual=function(){},t.prototype.manipulate=function(e){"creating"===this.state?this.resize(e):"move"===this.state?(this.x1=this.manipulationStartX1+e.x-this.manipulationStartX,this.y1=this.manipulationStartY1+e.y-this.manipulationStartY,this.x2=this.manipulationStartX2+e.x-this.manipulationStartX,this.y2=this.manipulationStartY2+e.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):"resize"===this.state&&this.resize(e)},t.prototype.resize=function(e){switch(this.activeGrip){case this.grip1:this.x1=e.x,this.y1=e.y;break;case this.grip2:case void 0:this.x2=e.x,this.y2=e.y}this.adjustVisual(),this.adjustControlBox()},t.prototype.select=function(){e.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},t.prototype.deselect=function(){e.prototype.deselect.call(this),this.controlBox.style.display="none"},t.prototype.setupControlBox=function(){this.controlBox=l.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},t.prototype.adjustControlBox=function(){this.positionGrips()},t.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},t.prototype.createGrip=function(){var e=new w;return e.visual.transform.baseVal.appendItem(l.createTransform()),this.controlBox.appendChild(e.visual),e},t.prototype.positionGrips=function(){var e=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-e/2,this.y1-e/2),this.positionGrip(this.grip2.visual,this.x2-e/2,this.y2-e/2)},t.prototype.positionGrip=function(e,t,n){var i=e.transform.baseVal.getItem(0);i.setTranslate(t,n),e.transform.baseVal.replaceItem(i,0)},t.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},e.prototype.getState.call(this))},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.x1=n.x1,this.y1=n.y1,this.x2=n.x2,this.y2=n.y2},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.x1=this.x1*t,this.y1=this.y1*n,this.x2=this.x2*t,this.y2=this.y2*n,this.adjustVisual(),this.adjustControlBox()},t}(x),N=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.setStrokeColor=r.setStrokeColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.strokePanel=new y("Line color",i.defaultColorSet,i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new E("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new M("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return r(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual&&t!==this.selectorLine&&t!==this.visibleLine)},t.prototype.createVisual=function(){this.visual=l.createGroup(),this.selectorLine=l.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=l.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)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"new"===this.state&&(this.createVisual(),this.adjustVisual(),this._state="creating")},t.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()),l.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),l.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),l.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.adjustVisual(),this.colorChanged(e)},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.adjustVisual()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.adjustVisual(),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.createVisual(),this.adjustVisual()},t.typeName="LineMarker",t.title="Line marker",t.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',t}(_),A=function(e){function t(t,n,i,r){var o=e.call(this,t,r||'<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 o.fonts=[],o.fontBoxes=[],o.fonts=n,o.currentFont=i,o.setCurrentFont=o.setCurrentFont.bind(o),o}return r(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.overflow="hidden",t.style.flexGrow="2",this.fonts.forEach((function(n){var i=document.createElement("div");i.style.display="inline-block",i.style.alignItems="center",i.style.justifyContent="space-between",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.overflow="hidden",i.style.maxWidth=100/e.fonts.length-5+"%",i.style.borderColor=n===e.currentFont?e.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){e.setCurrentFont(n,i)})),t.appendChild(i);var r=document.createElement("div");r.style.display="flex",r.style.minHeight="20px",r.style.flexGrow="2",r.style.fontFamily=n,r.style.overflow="hidden";var o=document.createElement("div");o.style.whiteSpace="nowrap",o.style.overflow="hidden",o.style.textOverflow="ellipsis",o.innerHTML="The quick brown fox jumps over the lazy dog",r.appendChild(o),i.appendChild(r),e.fontBoxes.push(i)})),t},t.prototype.setCurrentFont=function(e,t){var n=this;this.currentFont=e,this.fontBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onFontChanged&&this.onFontChanged(this.currentFont)},t}(v),P=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.color="transparent",r.padding=5,r.DEFAULT_TEXT="请输入文本",r.text=r.DEFAULT_TEXT,r.isMoved=!1,r.color=i.defaultColor,r.fontFamily=i.defaultFontFamily,r.defaultSize={x:100,y:30},r.setColor=r.setColor.bind(r),r.setFont=r.setFont.bind(r),r.renderText=r.renderText.bind(r),r.sizeText=r.sizeText.bind(r),r.textEditDivClicked=r.textEditDivClicked.bind(r),r.showTextEditor=r.showTextEditor.bind(r),r.setSize=r.setSize.bind(r),r.positionTextEditor=r.positionTextEditor.bind(r),r.colorPanel=new y("Color",i.defaultColorSet,i.defaultColor),r.colorPanel.onColorChanged=r.setColor,r.fontFamilyPanel=new A("Font",i.defaultFontFamilies,i.defaultFontFamily),r.fontFamilyPanel.onFontChanged=r.setFont,r}return r(t,e),t.prototype.ownsTarget=function(t){if(e.prototype.ownsTarget.call(this,t)||t===this.visual||t===this.textElement||t===this.bgRectangle)return!0;var n=!1;return this.textElement.childNodes.forEach((function(e){e===t&&(n=!0)})),n},t.prototype.createVisual=function(){this.visual=l.createGroup(),this.bgRectangle=l.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=l.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(l.createTransform()),this.textElement.transform.baseVal.appendItem(l.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),this.isMoved=!1,this.pointerDownPoint=t,this.pointerDownTimestamp=Date.now(),"new"===this.state&&(this.createVisual(),this.moveVisual(t),this._state="creating")},t.prototype.renderText=function(){var e=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(t){e.textElement.appendChild(l.createTSpan(""===t.trim()?" ":t.trim(),[["x","0"],["dy","1.2em"]]))})),setTimeout(this.sizeText,10)}},t.prototype.getTextScale=function(){var e=this.textElement.getBBox(),t=1;if(e.width>0&&e.height>0){var n=(1*this.width-this.width*this.padding*2/100)/e.width,i=(1*this.height-this.height*this.padding*2/100)/e.height;t=Math.min(n,i)}return t},t.prototype.getTextPosition=function(e){var t=this.textElement.getBBox(),n=0,i=0;return t.width>0&&t.height>0&&(n=(this.width-t.width*e)/2,i=this.height/2-t.height*e/2),{x:n,y:i}},t.prototype.sizeText=function(){var e=this.textElement.getBBox(),t=this.getTextScale(),n=this.getTextPosition(t);n.y-=e.y*t,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+n.x+"px, "+n.y+"px) scale("+t+", "+t+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(n.x,n.y),this.textElement.transform.baseVal.getItem(1).setScale(t,t))},t.prototype.manipulate=function(t){e.prototype.manipulate.call(this,t),void 0!==this.pointerDownPoint&&(this.isMoved=Math.abs(t.x-this.pointerDownPoint.x)>5||Math.abs(t.y-this.pointerDownPoint.y)>5)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.isMoved=!0,this.setSize(),this.sizeText()},t.prototype.setSize=function(){e.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(l.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),l.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},t.prototype.pointerUp=function(t){var n=this.state;"creating"===n&&(this._suppressMarkerCreateEvent=!0),e.prototype.pointerUp.call(this,t),this.setSize(),("creating"===n||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},t.prototype.showTextEditor=function(){var e=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(e){e.stopPropagation()})),this.textEditor.addEventListener("input",(function(){for(var t=Number.parseFloat(e.textEditor.style.fontSize);e.textEditor.clientWidth>=Number.parseInt(e.textEditor.style.maxWidth)&&t>.9;)t-=.1,e.textEditor.style.fontSize=Math.max(t,.9)+"em"})),this.textEditor.addEventListener("keyup",(function(e){e.cancelBubble=!0})),this.textEditor.addEventListener("paste",(function(e){if(e.clipboardData){var t=e.clipboardData.getData("text"),n=window.getSelection();if(!n.rangeCount)return!1;n.deleteFromDocument(),n.getRangeAt(0).insertNode(document.createTextNode(t)),e.preventDefault()}})),this.textEditDiv.addEventListener("pointerup",(function(){e.textEditDivClicked(e.textEditor.innerText)})),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},t.prototype.positionTextEditor=function(){if("edit"===this.state)if(void 0===this.textEditor)this.showTextEditor();else{this.textElement.style.display="";var e=this.getTextScale(),t=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),n=this.textElement.getBBox(),i={x:n.width*e,y:n.height*e};t.x-=i.x/2,t.y-=i.y/2,this.textEditor.style.top=t.y+"px",this.textEditor.style.left=t.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-t.x+"px",this.textEditor.style.fontSize=Math.max(16*e,12)+"px",this.textElement.style.display="none"}},t.prototype.textEditDivClicked=function(e){this.text=e.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},t.prototype.select=function(){e.prototype.select.call(this),"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText)},t.prototype.deselect=function(){"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText),e.prototype.deselect.call(this)},t.prototype.dblClick=function(t,n){e.prototype.dblClick.call(this,t,n),this.showTextEditor()},t.prototype.setColor=function(e){this.textElement&&l.setAttributes(this.textElement,[["fill",e]]),this.color=e,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(e)},t.prototype.setFont=function(e){this.textElement&&l.setAttributes(this.textElement,[["font-family",e]]),this.fontFamily=e,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},t.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},t.prototype.showVisual=function(){"edit"===this.state&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){var n=t;this.color=n.color,this.fontFamily=n.fontFamily,this.padding=n.padding,this.text=n.text,this.createVisual(),e.prototype.restoreState.call(this,t),this.setSize()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.setSize(),this.sizeText(),this.positionTextEditor()},t.typeName="TextMarker",t.title="Text marker",t.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>',t}(k),D=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.color="transparent",r.lineWidth=3,r.drawing=!1,r.pixelRatio=1,r.color=i.defaultColor,r.lineWidth=i.defaultStrokeWidth,r.pixelRatio=i.freehandPixelRatio,r.setColor=r.setColor.bind(r),r.addCanvas=r.addCanvas.bind(r),r.finishCreation=r.finishCreation.bind(r),r.setLineWidth=r.setLineWidth.bind(r),r.colorPanel=new y("Color",i.defaultColorSet,i.defaultColor),r.colorPanel.onColorChanged=r.setColor,r.lineWidthPanel=new E("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.lineWidthPanel.onWidthChanged=r.setLineWidth,r}return r(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual&&t!==this.drawingImage)},t.prototype.createVisual=function(){this.visual=l.createGroup(),this.drawingImage=l.createImage(),this.visual.appendChild(this.drawingImage);var e=l.createTransform();this.visual.transform.baseVal.appendItem(e),this.addMarkerVisualToContainer(this.visual)},t.prototype.pointerDown=function(t,n){"new"===this.state&&(this.addCanvas(),this.createVisual(),this._state="creating"),"creating"===this.state?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(t.x,t.y),this.drawing=!0):e.prototype.pointerDown.call(this,t,n)},t.prototype.manipulate=function(t){"creating"===this.state?this.drawing&&(this.canvasContext.lineTo(t.x,t.y),this.canvasContext.stroke()):e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),l.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),l.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},t.prototype.pointerUp=function(t){"creating"===this._state?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):e.prototype.pointerUp.call(this,t)},t.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)},t.prototype.select=function(){"creating"===this.state&&this.finishCreation(),e.prototype.select.call(this)},t.prototype.deselect=function(){"creating"===this.state&&this.finishCreation(),e.prototype.deselect.call(this)},t.prototype.finishCreation=function(){for(var e=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),t=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],n=t[0],i=t[1],r=t[2],o=t[3],a=!1,s=0;s<this.canvasElement.height;s++)for(var l=0;l<this.canvasElement.width;l++)e.data[s*this.canvasElement.width*4+4*l+3]>0&&(a=!0,s<i&&(i=s),l<n&&(n=l),s>o&&(o=s),l>r&&(r=l));if(a){this.left=n/this.pixelRatio,this.top=i/this.pixelRatio,this.width=(r-n)/this.pixelRatio,this.height=(o-i)/this.pixelRatio;var c=document.createElement("canvas");c.width=r-n,c.height=o-i,c.getContext("2d").putImageData(this.canvasContext.getImageData(n,i,r-n,o-i),0,0),this.drawingImgUrl=c.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},t.prototype.setDrawingImage=function(){l.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),l.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},t.prototype.setColor=function(e){this.color=e,this.colorChanged(e)},t.prototype.setLineWidth=function(e){this.lineWidth=e},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return"new"===this.state||"creating"===this.state?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({drawingImgUrl:this.drawingImgUrl},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){this.createVisual(),e.prototype.restoreState.call(this,t),this.drawingImgUrl=t.drawingImgUrl,this.setDrawingImage()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.setDrawingImage()},t.typeName="FreehandMarker",t.title="Freehand marker",t.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>',t}(k),B=function(e){function t(t,n,i){var r=e.call(this,t,i||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return r.typeBoxes=[],r.currentType=n,r.setCurrentType=r.setCurrentType.bind(r),r}return r(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");t.style.display="flex",t.style.overflow="hidden",t.style.flexGrow="2";for(var n=function(n){var r="both";switch(n){case 0:r="both";break;case 1:r="start";break;case 2:r="end";break;case 3:r="none"}var o=document.createElement("div");if(o.style.display="flex",o.style.flexGrow="2",o.style.alignItems="center",o.style.justifyContent="space-between",o.style.padding="5px",o.style.borderWidth="2px",o.style.borderStyle="solid",o.style.borderColor=r===i.currentType?i.uiStyleSettings.toolboxAccentColor:"transparent",o.addEventListener("click",(function(){e.setCurrentType(r,o)})),t.appendChild(o),"both"===r||"start"===r){var a=document.createElement("div");a.style.display="flex",a.style.alignItems="center",a.style.minHeight="20px",a.innerHTML='<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">\n <polygon points="0,5 10,0 10,10" fill="'+(void 0!==i.uiStyleSettings?i.uiStyleSettings.toolboxColor:"#eeeeee")+'" />\n </svg>',a.style.marginLeft="5px",o.appendChild(a)}var s=document.createElement("div");s.style.display="flex",s.style.alignItems="center",s.style.minHeight="20px",s.style.flexGrow="2";var l=document.createElement("hr");if(l.style.minWidth="20px",l.style.border="0px",l.style.borderTop="3px solid "+(void 0!==i.uiStyleSettings?i.uiStyleSettings.toolboxColor:"#eeeeee"),l.style.flexGrow="2",s.appendChild(l),o.appendChild(s),"both"===r||"end"===r){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.minHeight="20px",c.innerHTML='<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">\n <polygon points="0,0 10,5 0,10" fill="'+(void 0!==i.uiStyleSettings?i.uiStyleSettings.toolboxColor:"#eeeeee")+'" />\n </svg>',c.style.marginRight="5px",o.appendChild(c)}i.typeBoxes.push(o)},i=this,r=0;r<4;r++)n(r);return t},t.prototype.setCurrentType=function(e,t){var n=this;this.currentType=e,this.typeBoxes.forEach((function(e){e.style.borderColor=e===t?void 0!==n.uiStyleSettings?n.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"})),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},t}(v),j=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.arrowType="end",r.arrowBaseHeight=10,r.arrowBaseWidth=10,r.getArrowPoints=r.getArrowPoints.bind(r),r.setArrowType=r.setArrowType.bind(r),r.arrowTypePanel=new B("Arrow type","end"),r.arrowTypePanel.onArrowTypeChanged=r.setArrowType,r}return r(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.arrow1&&t!==this.arrow2)},t.prototype.getArrowPoints=function(e,t){var n=this.arrowBaseWidth+2*this.strokeWidth,i=this.arrowBaseHeight+2*this.strokeWidth;return e-n/2+","+(t+i/2)+" "+e+","+(t-i/2)+" "+(e+n/2)+","+(t+i/2)},t.prototype.createTips=function(){this.arrow1=l.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(l.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=l.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(l.createTransform()),this.visual.appendChild(this.arrow2)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"creating"===this.state&&this.createTips()},t.prototype.adjustVisual=function(){if(e.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2){this.arrow1.style.display="both"===this.arrowType||"start"===this.arrowType?"":"none",this.arrow2.style.display="both"===this.arrowType||"end"===this.arrowType?"":"none",l.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),l.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var t=0;Math.abs(this.x1-this.x2)>.1&&(t=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var n=this.arrow1.transform.baseVal.getItem(0);n.setRotate(t,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(n,0);var i=this.arrow2.transform.baseVal.getItem(0);i.setRotate(t+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(i,0)}},t.prototype.setArrowType=function(e){this.arrowType=e,this.adjustVisual(),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({arrowType:this.arrowType},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.arrowType=n.arrowType,this.createTips(),this.adjustVisual()},t.typeName="ArrowMarker",t.title="Arrow marker",t.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',t}(N),I=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.fillColor=i.defaultFillColor,r.strokeWidth=0,r.fillPanel=new y("Color",i.defaultColorSet,i.defaultFillColor),r.fillPanel.onColorChanged=r.setFillColor,r}return r(t,e),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.typeName="CoverMarker",t.title="Cover marker",t.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',t}(S),R=function(e){function t(t,n,i,r){var o=e.call(this,t,r||'<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 o.opacities=[],o.opacityBoxes=[],o.opacities=n,o.currentOpacity=i,o.setCurrentOpacity=o.setCurrentOpacity.bind(o),o}return r(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.display="flex",t.style.overflow="hidden",t.style.flexGrow="2",t.style.justifyContent="space-between",this.opacities.forEach((function(n){var i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="center",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.borderColor=n===e.currentOpacity?e.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){e.setCurrentOpacity(n,i)})),t.appendChild(i);var r=document.createElement("div");r.innerText=100*n+"%",i.appendChild(r),e.opacityBoxes.push(i)})),t},t.prototype.setCurrentOpacity=function(e,t){var n=this;this.currentOpacity=e,this.opacityBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},t}(v),O=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.setOpacity=r.setOpacity.bind(r),r.fillColor=i.defaultHighlightColor,r.strokeWidth=0,r.opacity=i.defaultHighlightOpacity,r.fillPanel=new y("Color",i.defaultColorSet,r.fillColor),r.fillPanel.onColorChanged=r.setFillColor,r.opacityPanel=new R("Opacity",i.defaultOpacitySteps,r.opacity),r.opacityPanel.onOpacityChanged=r.setOpacity,r}return r(t,e),t.prototype.setOpacity=function(e){this.opacity=e,this.visual&&l.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.typeName="HighlightMarker",t.title="Highlight marker",t.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>',t}(I),Z='<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>',F='<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>',z=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.bgColor="transparent",r.tipPosition={x:0,y:0},r.tipBase1Position={x:0,y:0},r.tipBase2Position={x:0,y:0},r.tipMoving=!1,r.color=i.defaultStrokeColor,r.bgColor=i.defaultFillColor,r.fontFamily=i.defaultFontFamily,r.defaultSize={x:100,y:30},r.setBgColor=r.setBgColor.bind(r),r.getTipPoints=r.getTipPoints.bind(r),r.positionTip=r.positionTip.bind(r),r.setTipPoints=r.setTipPoints.bind(r),r.colorPanel=new y("Text color",i.defaultColorSet,r.color,Z),r.colorPanel.onColorChanged=r.setColor,r.bgColorPanel=new y("Fill color",i.defaultColorSet,r.bgColor,F),r.bgColorPanel.onColorChanged=r.setBgColor,r.fontFamilyPanel=new A("Font",i.defaultFontFamilies,i.defaultFontFamily),r.fontFamilyPanel.onFontChanged=r.setFont,r.tipGrip=new w,r.tipGrip.visual.transform.baseVal.appendItem(l.createTransform()),r.controlBox.appendChild(r.tipGrip.visual),r}return r(t,e),t.prototype.ownsTarget=function(t){return e.prototype.ownsTarget.call(this,t)||this.tipGrip.ownsTarget(t)||this.tip===t},t.prototype.createTip=function(){l.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=l.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},t.prototype.pointerDown=function(t,n){"new"===this.state&&e.prototype.pointerDown.call(this,t,n),"creating"===this.state?this.createTip():this.tipGrip.ownsTarget(n)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):e.prototype.pointerDown.call(this,t,n)},t.prototype.pointerUp=function(t){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,e.prototype.pointerUp.call(this,t);else{var n="creating"===this.state;e.prototype.pointerUp.call(this,t),this.setTipPoints(n),this.positionTip()}},t.prototype.manipulate=function(t){if(this.tipMoving){var n=this.unrotatePoint(t);this.tipPosition={x:n.x-this.manipulationStartLeft,y:n.y-this.manipulationStartTop},this.positionTip()}else e.prototype.manipulate.call(this,t)},t.prototype.setBgColor=function(e){this.bgRectangle&&this.tip&&(l.setAttributes(this.bgRectangle,[["fill",e]]),l.setAttributes(this.tip,[["fill",e]])),this.bgColor=e,this.fillColorChanged(e)},t.prototype.getTipPoints=function(){return this.setTipPoints("creating"===this.state),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},t.prototype.setTipPoints=function(e){void 0===e&&(e=!1);var t=Math.min(this.height/2,15),n=this.height/5;e&&(this.tipPosition={x:t+n/2,y:this.height+20});var i=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?i<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(n=this.width/5,t=Math.min(this.width/2,15),this.tipBase1Position={x:t,y:0},this.tipBase2Position={x:t+n,y:0}):(this.tipBase1Position={x:0,y:t},this.tipBase2Position={x:0,y:t+n}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?i<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(n=this.width/5,t=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-t-n,y:0},this.tipBase2Position={x:this.width-t,y:0}):(this.tipBase1Position={x:this.width,y:t},this.tipBase2Position={x:this.width,y:t+n}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?i<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(n=this.width/5,t=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-t-n,y:this.height},this.tipBase2Position={x:this.width-t,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-t-n},this.tipBase2Position={x:this.width,y:this.height-t}):i<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(n=this.width/5,t=Math.min(this.width/2,15),this.tipBase1Position={x:t,y:this.height},this.tipBase2Position={x:t+n,y:this.height}):(this.tipBase1Position={x:0,y:this.height-t},this.tipBase2Position={x:0,y:this.height-t-n})},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.positionTip()},t.prototype.positionTip=function(){l.setAttributes(this.tip,[["points",this.getTipPoints()]]);var e=this.tipGrip.visual.transform.baseVal.getItem(0);e.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(e,0)},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),t.prototype.select=function(){this.positionTip(),e.prototype.select.call(this)},t.prototype.getState=function(){var n=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){var n=t;this.bgColor=n.bgColor,this.tipPosition=n.tipPosition,e.prototype.restoreState.call(this,t),this.createTip(),this.setTipPoints()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.tipPosition={x:this.tipPosition.x*t,y:this.tipPosition.y*n},this.positionTip()},t.typeName="CalloutMarker",t.title="Callout marker",t.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>',t}(P),H=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.fillColor="transparent",r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.opacity=1,r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.fillColor=i.defaultFillColor,r.setStrokeColor=r.setStrokeColor.bind(r),r.setFillColor=r.setFillColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.setOpacity=r.setOpacity.bind(r),r.createVisual=r.createVisual.bind(r),r.strokePanel=new y("Line color",s(i.defaultColorSet,["transparent"]),i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.fillPanel=new y("Fill color",s(i.defaultColorSet,["transparent"]),r.fillColor,F),r.fillPanel.onColorChanged=r.setFillColor,r.strokeWidthPanel=new E("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new M("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r.opacityPanel=new R("Opacity",i.defaultOpacitySteps,r.opacity),r.opacityPanel.onOpacityChanged=r.setOpacity,r}return r(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual)},t.prototype.createVisual=function(){this.visual=l.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)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"new"===this.state&&(this.createVisual(),this.moveVisual(t),this._state="creating")},t.prototype.manipulate=function(t){e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.setSize()},t.prototype.setSize=function(){e.prototype.setSize.call(this),l.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},t.prototype.pointerUp=function(t){e.prototype.pointerUp.call(this,t),this.setSize()},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.visual&&l.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(e),this.stateChanged()},t.prototype.setFillColor=function(e){this.fillColor=e,this.visual&&l.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(e),this.stateChanged()},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.visual&&l.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.visual&&l.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},t.prototype.setOpacity=function(e){this.opacity=e,this.visual&&l.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){var n=t;this.fillColor=n.fillColor,this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.opacity=n.opacity,this.createVisual(),e.prototype.restoreState.call(this,t),this.setSize()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.setSize()},t.typeName="EllipseMarker",t.title="Ellipse marker",t.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>',t}(k),W=function(e){function t(t,n,i){return e.call(this,t,n,i)||this}return r(t,e),Object.defineProperty(t.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.tip1&&t!==this.tip2)},t.prototype.createTips=function(){this.tip1=l.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(l.createTransform()),this.visual.appendChild(this.tip1),this.tip2=l.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(l.createTransform()),this.visual.appendChild(this.tip2)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"creating"===this.state&&this.createTips()},t.prototype.adjustVisual=function(){if(e.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(l.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()]]),l.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 t=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),n=this.tip1.transform.baseVal.getItem(0);n.setRotate(t,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(n,0);var i=this.tip2.transform.baseVal.getItem(0);i.setRotate(t+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(i,0)}},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t),this.createTips(),this.adjustVisual()},t.typeName="MeasurementMarker",t.title="Measurement marker",t.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>',t}(N),G=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.strokePanel.colors=i.defaultColorSet,r.fillColor="transparent",r}return r(t,e),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.typeName="EllipseFrameMarker",t.title="Ellipse frame marker",t.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>',t}(H),V=function(){function e(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(e.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),e.prototype.addUndoStep=function(e){0!==this.undoStack.length&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(e)||(this.undoStack.push(e),JSON.stringify(this.lastRedoStep)!==JSON.stringify(e)&&this.redoStack.splice(0,this.redoStack.length))},e.prototype.replaceLastUndoStep=function(e){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=e)},e.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},e.prototype.undo=function(){if(this.undoStack.length>1){var e=this.undoStack.pop();return void 0!==e&&this.redoStack.push(e),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},e.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},e}(),q=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.curveX=0,r.curveY=0,r.manipulationStartCurveX=0,r.manipulationStartCurveY=0,r.setStrokeColor=r.setStrokeColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.positionGrips=r.positionGrips.bind(r),r.addControlGrips=r.addControlGrips.bind(r),r.adjustVisual=r.adjustVisual.bind(r),r.setupControlBox=r.setupControlBox.bind(r),r.resize=r.resize.bind(r),r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.strokePanel=new y("Line color",i.defaultColorSet,i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new E("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new M("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return r(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual&&t!==this.selectorCurve&&t!==this.visibleCurve&&!this.curveGrip.ownsTarget(t))},t.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},t.prototype.createVisual=function(){this.visual=l.createGroup(),this.selectorCurve=l.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=l.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)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,"new"===this.state&&(this.curveX=t.x,this.curveY=t.y),"new"===this.state?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(n)&&(this.activeGrip=this.curveGrip,this._state="resize")},t.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),l.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),l.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),l.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},t.prototype.setupControlBox=function(){e.prototype.setupControlBox.call(this),this.curveControlLine1=l.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=l.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)},t.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,e.prototype.addControlGrips.call(this)},t.prototype.positionGrips=function(){e.prototype.positionGrips.call(this);var t=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-t/2,this.curveY-t/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()))},t.prototype.manipulate=function(t){"move"===this.state&&(this.curveX=this.manipulationStartCurveX+t.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+t.y-this.manipulationStartY),e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){this.activeGrip===this.curveGrip&&(this.curveX=t.x,this.curveY=t.y),e.prototype.resize.call(this,t),"creating"===this.state&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.adjustVisual(),this.colorChanged(e)},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.adjustVisual()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.adjustVisual()},t.prototype.scale=function(t,n){this.curveX=this.curveX*t,this.curveY=this.curveY*n,e.prototype.scale.call(this,t,n)},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.curveX=n.curveX,this.curveY=n.curveY,this.createVisual(),this.adjustVisual()},t.typeName="CurveMarker",t.title="Curve marker",t.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>',t}(_),U=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.fillColor="transparent",r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.textColor="transparent",r.fontSize="1rem",r.isMoved=!1,r.captionText="Caption",r.PADDING=5,r.captionBoxWidth=0,r.captionBoxHeight=0,r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.fillColor=i.defaultFillColor,r.textColor=i.defaultStrokeColor,r.fontFamily=i.defaultFontFamily,r.fontSize=i.defaultCaptionFontSize,r.captionText=i.defaultCaptionText,r.setStrokeColor=r.setStrokeColor.bind(r),r.setFillColor=r.setFillColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.createVisual=r.createVisual.bind(r),r.sizeCaption=r.sizeCaption.bind(r),r.setCaptionText=r.setCaptionText.bind(r),r.showTextEditor=r.showTextEditor.bind(r),r.positionTextEditor=r.positionTextEditor.bind(r),r.finishTextEditing=r.finishTextEditing.bind(r),r.setFont=r.setFont.bind(r),r.setTextColor=r.setTextColor.bind(r),r.strokePanel=new y("Line color",s(i.defaultColorSet,["transparent"]),r.strokeColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.fillPanel=new y("Fill color",s(i.defaultColorSet,["transparent"]),r.fillColor,F),r.fillPanel.onColorChanged=r.setFillColor,r.strokeWidthPanel=new E("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new M("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r.fontFamilyPanel=new A("Font",i.defaultFontFamilies,i.defaultFontFamily),r.fontFamilyPanel.onFontChanged=r.setFont,r.textColorPanel=new y("Text color",i.defaultColorSet,r.textColor,Z),r.textColorPanel.onColorChanged=r.setTextColor,r}return r(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual&&t!==this.frame&&t!==this.captionBg&&t!==this.captionElement)},t.prototype.createVisual=function(){this.visual=l.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=l.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=l.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=l.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()},t.prototype.setCaptionText=function(e){this.captionText=e,this.captionElement.textContent=this.captionText,this.sizeCaption()},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),this.isMoved=!1,this.pointerDownPoint=t,this.pointerDownTimestamp=Date.now(),"new"===this.state&&(this.createVisual(),this.moveVisual(t),this._state="creating")},t.prototype.manipulate=function(t){e.prototype.manipulate.call(this,t),void 0!==this.pointerDownPoint&&(this.isMoved=Math.abs(t.x-this.pointerDownPoint.x)>5||Math.abs(t.y-this.pointerDownPoint.y)>5)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.setSize()},t.prototype.sizeCaption=function(){var e=this.captionElement.getBBox();""!==this.captionText.trim()?(this.captionBoxWidth=e.width+2*this.PADDING,this.captionBoxHeight=e.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),l.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')"]]),l.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')"]])},t.prototype.showTextEditor=function(){var e=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(e){e.stopPropagation()})),this.textEditBox.addEventListener("keypress",(function(t){"Enter"===t.key&&e.finishTextEditing(e.textEditBox.value)})),this.textEditBox.addEventListener("keyup",(function(e){e.cancelBubble=!0})),this.textEditBox.addEventListener("blur",(function(){e.finishTextEditing(e.textEditBox.value)})),this.textEditDiv.addEventListener("pointerup",(function(){e.finishTextEditing(e.textEditBox.value)})),this.positionTextEditor(),this.textEditBox.focus()},t.prototype.positionTextEditor=function(){"edit"===this.state&&(void 0===this.textEditBox?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"))},t.prototype.finishTextEditing=function(e){this.setCaptionText(e.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},t.prototype.setFont=function(e){this.captionElement&&l.setAttributes(this.captionElement,[["font-family",e]]),this.fontFamily=e,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},t.prototype.setTextColor=function(e){this.captionElement&&l.setAttributes(this.captionElement,[["fill",e]]),this.textColor=e,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},t.prototype.setSize=function(){e.prototype.setSize.call(this),l.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},t.prototype.pointerUp=function(t){e.prototype.pointerUp.call(this,t),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},t.prototype.dblClick=function(t,n){e.prototype.dblClick.call(this,t,n),this.showTextEditor()},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.frame&&l.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(e),this.stateChanged()},t.prototype.setFillColor=function(e){this.fillColor=e,this.captionBg&&l.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(e),this.stateChanged()},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.frame&&l.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.frame&&l.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var t=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},e.prototype.getState.call(this));return t.typeName=this.typeName,t},t.prototype.restoreState=function(t){var n=t;this.fillColor=n.fillColor,this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.textColor=n.textColor,this.fontFamily=n.fontFamily,this.captionText=n.captionText,this.fontSize=n.fontSize,this.createVisual(),e.prototype.restoreState.call(this,t),this.setSize()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.setSize()},t.typeName="CaptionFrameMarker",t.title="Caption frame marker",t.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>',t}(k),K=function(){function e(e,t){void 0===t&&(t=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=e,this.cancelable=t}return Object.defineProperty(e.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){this._defaultPrevented=!0},e}(),Y=function(e){function t(t,n,i){var r=e.call(this,t,!1)||this;return r.dataUrl=n,r.state=i,r}return r(t,e),t}(K),X=function(e){function t(t,n,i){void 0===i&&(i=!1);var r=e.call(this,t,i)||this;return r.marker=n,r}return r(t,e),t}(K),J=function(){function e(){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 e.prototype.addEventListener=function(e,t){this[e].push(t)},e.prototype.removeEventListener=function(e,t){var n=this[e].indexOf(t);n>-1&&this[e].splice(n,1)},e}(),Q=function(){function e(t){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new L,this._isOpen=!1,this.undoRedoManager=new V,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 J,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=e.instanceCounter++,this.styles=new h(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=t,this.targetRoot=document.body,this.width=t.clientWidth,this.height=t.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(e.prototype,"ALL_MARKER_TYPES",{get:function(){return[T,D,j,P,G,H,O,z,W,I,N,q,U]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[T,D,j,P,H,O,z]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"BASIC_MARKER_TYPES",{get:function(){return[T,D,j,P,O]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(e){var t=this;this._availableMarkerTypes.splice(0),e.forEach((function(e){if("string"==typeof e){var n=t.ALL_MARKER_TYPES.find((function(t){return t.typeName===e}));void 0!==n&&t._availableMarkerTypes.push(n)}else t._availableMarkerTypes.push(e)}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(e){this._zoomLevel=e,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(e.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),e.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),"popup"===this.settings.displayMode&&this.onPopupTargetResize(),c.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},e.prototype.show=function(){var e=this;void 0===this.styles.styleSheetRoot&&void 0!==d.styleSheetRoot&&(this.styles.styleSheetRoot=d.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach((function(t){return t(new K(e))}))},e.prototype.render=function(){return o(this,void 0,void 0,(function(){var e;return a(this,(function(t){switch(t.label){case 0:return this.setCurrentMarker(),(e=new u).naturalSize=this.renderAtNaturalSize,e.imageType=this.renderImageType,e.imageQuality=this.renderImageQuality,e.markersOnly=this.renderMarkersOnly,e.width=this.renderWidth,e.height=this.renderHeight,[4,e.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return t.sent(),[4,e.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,t.sent()]}}))}))},e.prototype.close=function(e){var t=this;if(void 0===e&&(e=!1),this.isOpen){var n=!1;e||this.eventListeners.beforeclose.forEach((function(e){var i=new K(t,!0);e(i),i.defaultPrevented&&(n=!0)})),n||(this.coverDiv&&this.closeUI(),this.targetObserver&&(this.targetObserver.unobserve(this.target),this.targetObserver.unobserve(this.editorCanvas)),"popup"===this.settings.displayMode&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach((function(e){return e(new K(t))})),this.detachEvents(),this._isOpen=!1)}},e.prototype.addMarkersToToolbar=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];(e=this._availableMarkerTypes).push.apply(e,t)},e.prototype.addRenderEventListener=function(e){this.addEventListener("render",(function(t){e(t.dataUrl,t.state)}))},e.prototype.removeRenderEventListener=function(e){},e.prototype.addCloseEventListener=function(e){this.addEventListener("close",(function(){e()}))},e.prototype.removeCloseEventListener=function(e){},e.prototype.setupResizeObserver=function(){var e=this;"inline"===this.settings.displayMode?window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){e.resize(e.target.clientWidth,e.target.clientHeight)})),this.targetObserver.observe(this.target)):"popup"===this.settings.displayMode&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){return e.onPopupTargetResize()})),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},e.prototype.onPopupTargetResize=function(){var e=1*this.target.clientWidth/this.target.clientHeight,t=this.editorCanvas.clientWidth/e>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*e:this.editorCanvas.clientWidth,n=t<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/e;this.resize(t,n)},e.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},e.prototype.resize=function(e,t){this._isResizing=!0;var n=e/this.imageWidth,i=t/this.imageHeight;this.imageWidth=Math.round(e),this.imageHeight=Math.round(t),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","popup"!==this.settings.displayMode?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),void 0!==this.toolbar&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(n,i),this._isResizing=!1},e.prototype.scaleMarkers=function(e,t){var n,i=this;this._currentMarker&&this._currentMarker instanceof P?this._currentMarker.scale(e,t):(n=this._currentMarker,this.setCurrentMarker()),this.markers.forEach((function(n){n!==i._currentMarker&&n.scale(e,t)})),void 0!==n&&this.setCurrentMarker(n)},e.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"},e.prototype.setTopLeft=function(){var e=this.editingTarget.getBoundingClientRect(),t=this.editorCanvas.getBoundingClientRect();this.left=e.left-t.left,this.top=e.top-t.top},e.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)},e.prototype.addDefs=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.defs=l.createDefs(),this.addDefsToImage(),(e=this.defs).append.apply(e,t)},e.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},e.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)},e.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},e.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},e.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)},e.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},e.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)},e.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 e=document.createElement("a");e.href="https://markerjs.com/",e.target="_blank",e.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>',e.title="Powered by marker.js",e.style.display="grid",e.style.alignItems="center",e.style.justifyItems="center",e.style.padding="3px",e.style.width="20px",e.style.height="20px",this.logoUI.appendChild(e),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},e.prototype.positionLogo=function(){this.logoUI&&("right"!==this.uiStyleSettings.logoPosition?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")},e.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"},e.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},e.prototype.showUI=function(){switch("popup"===this.settings.displayMode&&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 e=void 0!==this.settings.uiOffsetTop?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=e+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=void 0!==this.uiStyleSettings.zIndex?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=void 0!==this.uiStyleSettings.zIndex?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="popup"===this.settings.displayMode?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new m(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","popup"===this.settings.displayMode&&(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","popup"===this.settings.displayMode&&(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"),void 0===this.settings.uiOffsetTop&&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 g(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},e.prototype.closeUI=function(){"popup"===this.settings.displayMode&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},e.prototype.removeMarker=function(e){this.markerImage.removeChild(e.container),this.markers.indexOf(e)>-1&&this.markers.splice(this.markers.indexOf(e),1),e.dispose()},e.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),void 0!==this._currentMarker&&("new"!==this._currentMarker.state?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},e.prototype.toolbarButtonClicked=function(e,t){if("marker"===e&&void 0!==t)this.createNewMarker(t);else if("action"===e)switch(t){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":void 0===this.notesArea?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},e.prototype.deleteSelectedMarker=function(){var e=this;if(void 0!==this._currentMarker){var t=!1;if(this.eventListeners.markerbeforedelete.forEach((function(n){var i=new X(e,e._currentMarker,!0);n(i),i.defaultPrevented&&(t=!0)})),!t){var n=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(t){return t(new X(e,n))}))}}},e.prototype.clear=function(){var e=this,t=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach((function(n){var i=new X(e,void 0,!0);n(i),i.defaultPrevented&&(t=!0)})),!t)){this.setCurrentMarker();for(var n=function(t){var n=i.markers[t];i.setCurrentMarker(i.markers[t]),i._currentMarker.dispose(),i.markerImage.removeChild(i._currentMarker.container),i.markers.splice(i.markers.indexOf(i._currentMarker),1),i.eventListeners.markerdelete.forEach((function(t){return t(new X(e,n))}))},i=this,r=this.markers.length-1;r>=0;r--)n(r);this.addUndoStep()}},Object.defineProperty(e.prototype,"isNotesAreaOpen",{get:function(){return void 0!==this.notesArea},enumerable:!1,configurable:!0}),e.prototype.showNotesEditor=function(){var e;void 0!==this._currentMarker&&(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=null!==(e=this._currentMarker.notes)&&void 0!==e?e:"",this.overlayContainer.appendChild(this.notesArea))},e.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(void 0!==this._currentMarker&&(this._currentMarker.notes=""!==this.notesArea.value.trim()?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},e.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},e.prototype.addUndoStep=function(){var e=this;if(void 0===this._currentMarker||"edit"!==this._currentMarker.state){var t=this.getState(),n=this.undoRedoManager.getLastUndoStep();if(!n||n.width===t.width&&n.height===t.height){var i=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(t),i<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach((function(t){return t(new K(e))}))}else this.undoRedoManager.replaceLastUndoStep(t),this.eventListeners.statechange.forEach((function(t){return t(new K(e))}))}},e.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},e.prototype.undoStep=function(){var e=this,t=this.undoRedoManager.undo();void 0!==t&&(this.restoreState(t),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach((function(t){return t(new K(e))})))},e.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},e.prototype.redoStep=function(){var e=this,t=this.undoRedoManager.redo();void 0!==t&&(this.restoreState(t),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach((function(t){return t(new K(e))})))},e.prototype.stepZoom=function(){var e=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=e<this.zoomSteps.length-1?this.zoomSteps[e+1]:this.zoomSteps[0]},e.prototype.panTo=function(e){this.contentDiv.scrollBy({left:this.prevPanPoint.x-e.x,top:this.prevPanPoint.y-e.y}),this.prevPanPoint=e},e.prototype.startRenderAndClose=function(){return o(this,void 0,void 0,(function(){var e,t,n=this;return a(this,(function(i){switch(i.label){case 0:return[4,this.render()];case 1:return e=i.sent(),t=this.getState(),this.eventListeners.render.forEach((function(i){return i(new Y(n,e,t))})),this.close(!0),[2]}}))}))},e.prototype.getState=function(e){!0===e&&this.setCurrentMarker();var t={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach((function(e){return t.markers.push(e.getState())})),t},e.prototype.restoreState=function(e){var t=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);e.markers.forEach((function(e){var n=t._availableMarkerTypes.find((function(t){return t.typeName===e.typeName}));if(void 0!==n){var i=t.addNewMarker(n);i.restoreState(e),t.markers.push(i)}})),e.width&&e.height&&(e.width!==this.imageWidth||e.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/e.width,this.imageHeight/e.height),this.eventListeners.restorestate.forEach((function(e){return e(new K(t))}))},e.prototype.addNewMarker=function(e){var t=l.createGroup();return this.markerImage.appendChild(t),new e(t,this.overlayContainer,this.settings)},e.prototype.createNewMarker=function(e){var t,n=this;(t="string"==typeof e?this._availableMarkerTypes.find((function(t){return t.typeName===e})):e)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(t),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(t.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach((function(e){return e(new X(n,n._currentMarker))})))},e.prototype.markerCreated=function(e){var t=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(e),this.setCurrentMarker(e),e instanceof D&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(D):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach((function(e){return e(new X(t,t._currentMarker))}))},e.prototype.colorChanged=function(e){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=e,this.settings.defaultStrokeColor=e)},e.prototype.fillColorChanged=function(e){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=e)},e.prototype.markerStateChanged=function(e){var t=this;this.eventListeners.markerchange.forEach((function(n){return n(new X(t,e))}))},e.prototype.setCurrentMarker=function(e){var t=this;this._currentMarker!==e&&void 0!==this._currentMarker&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach((function(e){return e(new X(t,t._currentMarker))}))),this._currentMarker=e,void 0===this._currentMarker||this._currentMarker.isSelected||("new"!==this._currentMarker.state&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach((function(e){return e(new X(t,t._currentMarker))})))},e.prototype.onPointerDown=function(e){if(this._isFocused||this.focus(),this.touchPoints++,1===this.touchPoints||"touch"!==e.pointerType)if(void 0===this._currentMarker||"new"!==this._currentMarker.state&&"creating"!==this._currentMarker.state){if("select"===this.mode){var t=this.markers.find((function(t){return t.ownsTarget(e.target)}));void 0!==t?(this.setCurrentMarker(t),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(e.clientX,e.clientY),e.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:e.clientX,y:e.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(e.clientX,e.clientY))},e.prototype.onDblClick=function(e){if(this._isFocused||this.focus(),"select"===this.mode){var t=this.markers.find((function(t){return t.ownsTarget(e.target)}));void 0!==t&&t!==this._currentMarker&&this.setCurrentMarker(t),void 0!==this._currentMarker?this._currentMarker.dblClick(this.clientToLocalCoordinates(e.clientX,e.clientY),e.target):this.setCurrentMarker()}},e.prototype.onPointerMove=function(e){1!==this.touchPoints&&"touch"===e.pointerType||(void 0!==this._currentMarker||this.isDragging)&&(void 0!==this._currentMarker&&"edit"===this._currentMarker.state||e.preventDefault(),void 0!==this._currentMarker?this._currentMarker.manipulate(this.clientToLocalCoordinates(e.clientX,e.clientY)):this.zoomLevel>1&&this.panTo({x:e.clientX,y:e.clientY}))},e.prototype.onPointerUp=function(e){this.touchPoints>0&&this.touchPoints--,0===this.touchPoints&&this.isDragging&&void 0!==this._currentMarker&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(e.clientX,e.clientY)),this.isDragging=!1,this.addUndoStep()},e.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},e.prototype.onKeyUp=function(e){void 0===this._currentMarker||void 0!==this.notesArea||"Delete"!==e.key&&"Backspace"!==e.key||this.deleteSelectedMarker()},e.prototype.clientToLocalCoordinates=function(e,t){var n=this.markerImage.getBoundingClientRect();return{x:(e-n.left)/this.zoomLevel,y:(t-n.top)/this.zoomLevel}},e.prototype.onWindowResize=function(){this.positionUI()},e.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var e=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=e+"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()},e.prototype.addLicenseKey=function(e){c.addKey(e)},e.prototype.addEventListener=function(e,t){this.eventListeners.addEventListener(e,t)},e.prototype.removeEventListener=function(e,t){this.eventListeners.removeEventListener(e,t)},e.prototype.renderState=function(e){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(e),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(e.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),e.prototype.focus=function(){var e=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,void 0!==this._previousCurrentMarker&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach((function(t){return t(new K(e))})))},e.prototype.blur=function(){var e=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach((function(t){return t(new K(e))})))},e.instanceCounter=0,e}()},66042:function(e,t,n){"use strict";n.d(t,{Z:function(){return T}});var i=n(33885),r=n(42978),o=n(43403),a=n(34280),s=n(59301),l=s.createContext(null),c=s.createContext({}),u=l,d=n(20068),h=n(54476),p=n(92310),f=n.n(p),m=n(77900),g=n(10228),v=n(26112),y=n(75931),x=n(8654),b=["prefixCls","className","containerRef"];var w=function(e){var t=e.prefixCls,n=e.className,i=e.containerRef,r=(0,y.Z)(e,b),o=s.useContext(c).panel,a=(0,x.x1)(o,i);return s.createElement("div",(0,h.Z)({className:f()("".concat(t,"-content"),n),role:"dialog",ref:a},(0,v.Z)(e,{aria:!0}),{"aria-modal":"true"},r))},C=n(48736);function k(e){return"string"==typeof e&&String(Number(e))===e?((0,C.ZP)(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(e)):e}var S={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function E(e,t){var n,o,a,l=e.prefixCls,c=e.open,p=e.placement,y=e.inline,x=e.push,b=e.forceRender,C=e.autoFocus,E=e.keyboard,M=e.classNames,T=e.rootClassName,L=e.rootStyle,_=e.zIndex,N=e.className,A=e.id,P=e.style,D=e.motion,B=e.width,j=e.height,I=e.children,R=e.mask,O=e.maskClosable,Z=e.maskMotion,F=e.maskClassName,z=e.maskStyle,H=e.afterOpenChange,W=e.onClose,G=e.onMouseEnter,V=e.onMouseOver,q=e.onMouseLeave,U=e.onClick,K=e.onKeyDown,Y=e.onKeyUp,X=e.styles,J=e.drawerRender,Q=s.useRef(),$=s.useRef(),ee=s.useRef();s.useImperativeHandle(t,(function(){return Q.current}));s.useEffect((function(){var e;c&&C&&(null===(e=Q.current)||void 0===e||e.focus({preventScroll:!0}))}),[c]);var te=s.useState(!1),ne=(0,r.Z)(te,2),ie=ne[0],re=ne[1],oe=s.useContext(u),ae=null!==(n=null!==(o=null===(a="boolean"==typeof x?x?{}:{distance:0}:x||{})||void 0===a?void 0:a.distance)&&void 0!==o?o:null==oe?void 0:oe.pushDistance)&&void 0!==n?n:180,se=s.useMemo((function(){return{pushDistance:ae,push:function(){re(!0)},pull:function(){re(!1)}}}),[ae]);s.useEffect((function(){var e,t;c?null==oe||null===(e=oe.push)||void 0===e||e.call(oe):null==oe||null===(t=oe.pull)||void 0===t||t.call(oe)}),[c]),s.useEffect((function(){return function(){var e;null==oe||null===(e=oe.pull)||void 0===e||e.call(oe)}}),[]);var le=R&&s.createElement(m.default,(0,h.Z)({key:"mask"},Z,{visible:c}),(function(e,t){var n=e.className,r=e.style;return s.createElement("div",{className:f()("".concat(l,"-mask"),n,null==M?void 0:M.mask,F),style:(0,i.Z)((0,i.Z)((0,i.Z)({},r),z),null==X?void 0:X.mask),onClick:O&&c?W:void 0,ref:t})})),ce="function"==typeof D?D(p):D,ue={};if(ie&&ae)switch(p){case"top":ue.transform="translateY(".concat(ae,"px)");break;case"bottom":ue.transform="translateY(".concat(-ae,"px)");break;case"left":ue.transform="translateX(".concat(ae,"px)");break;default:ue.transform="translateX(".concat(-ae,"px)")}"left"===p||"right"===p?ue.width=k(B):ue.height=k(j);var de={onMouseEnter:G,onMouseOver:V,onMouseLeave:q,onClick:U,onKeyDown:K,onKeyUp:Y},he=s.createElement(m.default,(0,h.Z)({key:"panel"},ce,{visible:c,forceRender:b,onVisibleChanged:function(e){null==H||H(e)},removeOnLeave:!1,leavedClassName:"".concat(l,"-content-wrapper-hidden")}),(function(t,n){var r=t.className,o=t.style,a=s.createElement(w,(0,h.Z)({id:A,containerRef:n,prefixCls:l,className:f()(N,null==M?void 0:M.content),style:(0,i.Z)((0,i.Z)({},P),null==X?void 0:X.content)},(0,v.Z)(e,{aria:!0}),de),I);return s.createElement("div",(0,h.Z)({className:f()("".concat(l,"-content-wrapper"),null==M?void 0:M.wrapper,r),style:(0,i.Z)((0,i.Z)((0,i.Z)({},ue),o),null==X?void 0:X.wrapper)},(0,v.Z)(e,{data:!0})),J?J(a):a)})),pe=(0,i.Z)({},L);return _&&(pe.zIndex=_),s.createElement(u.Provider,{value:se},s.createElement("div",{className:f()(l,"".concat(l,"-").concat(p),T,(0,d.Z)((0,d.Z)({},"".concat(l,"-open"),c),"".concat(l,"-inline"),y)),style:pe,tabIndex:-1,ref:Q,onKeyDown:function(e){var t=e.keyCode,n=e.shiftKey;switch(t){case g.Z.TAB:var i;if(t===g.Z.TAB)if(n||document.activeElement!==ee.current){if(n&&document.activeElement===$.current){var r;null===(r=ee.current)||void 0===r||r.focus({preventScroll:!0})}}else null===(i=$.current)||void 0===i||i.focus({preventScroll:!0});break;case g.Z.ESC:W&&E&&(e.stopPropagation(),W(e))}}},le,s.createElement("div",{tabIndex:0,ref:$,style:S,"aria-hidden":"true","data-sentinel":"start"}),he,s.createElement("div",{tabIndex:0,ref:ee,style:S,"aria-hidden":"true","data-sentinel":"end"})))}var M=s.forwardRef(E);var T=function(e){var t=e.open,n=void 0!==t&&t,l=e.prefixCls,u=void 0===l?"rc-drawer":l,d=e.placement,h=void 0===d?"right":d,p=e.autoFocus,f=void 0===p||p,m=e.keyboard,g=void 0===m||m,v=e.width,y=void 0===v?378:v,x=e.mask,b=void 0===x||x,w=e.maskClosable,C=void 0===w||w,k=e.getContainer,S=e.forceRender,E=e.afterOpenChange,T=e.destroyOnClose,L=e.onMouseEnter,_=e.onMouseOver,N=e.onMouseLeave,A=e.onClick,P=e.onKeyDown,D=e.onKeyUp,B=e.panelRef,j=s.useState(!1),I=(0,r.Z)(j,2),R=I[0],O=I[1];var Z=s.useState(!1),F=(0,r.Z)(Z,2),z=F[0],H=F[1];(0,a.Z)((function(){H(!0)}),[]);var W=!!z&&n,G=s.useRef(),V=s.useRef();(0,a.Z)((function(){W&&(V.current=document.activeElement)}),[W]);var q=s.useMemo((function(){return{panel:B}}),[B]);if(!S&&!R&&!W&&T)return null;var U={onMouseEnter:L,onMouseOver:_,onMouseLeave:N,onClick:A,onKeyDown:P,onKeyUp:D},K=(0,i.Z)((0,i.Z)({},e),{},{open:W,prefixCls:u,placement:h,autoFocus:f,keyboard:g,width:y,mask:b,maskClosable:C,inline:!1===k,afterOpenChange:function(e){var t,n;(O(e),null==E||E(e),e||!V.current||null!==(t=G.current)&&void 0!==t&&t.contains(V.current))||(null===(n=V.current)||void 0===n||n.focus({preventScroll:!0}))},ref:G},U);return s.createElement(c.Provider,{value:q},s.createElement(o.Z,{open:W||S||R,autoDestroy:!1,getContainer:k,autoLock:b&&(W||R)},s.createElement(M,K)))}},23425:function(e,t,n){"use strict";n.d(t,{Z:function(){return C}});var i=n(20068),r=n(54476),o=n(76190),a=n(33885),s=n(42978),l=n(92310),c=n.n(l),u=n(18929),d=n(10228),h=n(26112),p=(n(48736),n(59301)),f=n(17119),m=[10,20,50,100];var g=function(e){var t=e.pageSizeOptions,n=void 0===t?m:t,i=e.locale,r=e.changeSize,o=e.pageSize,a=e.goButton,l=e.quickGo,c=e.rootPrefixCls,u=e.disabled,h=e.buildOptionText,f=e.showSizeChanger,g=e.sizeChangerRender,v=p.useState(""),y=(0,s.Z)(v,2),x=y[0],b=y[1],w=function(){return!x||Number.isNaN(x)?void 0:Number(x)},C="function"==typeof h?h:function(e){return"".concat(e," ").concat(i.items_per_page)},k=function(e){""!==x&&(e.keyCode!==d.Z.ENTER&&"click"!==e.type||(b(""),null==l||l(w())))},S="".concat(c,"-options");if(!f&&!l)return null;var E=null,M=null,T=null;return f&&g&&(E=g({disabled:u,size:o,onSizeChange:function(e){null==r||r(Number(e))},"aria-label":i.page_size,className:"".concat(S,"-size-changer"),options:(n.some((function(e){return e.toString()===o.toString()}))?n:n.concat([o]).sort((function(e,t){return(Number.isNaN(Number(e))?0:Number(e))-(Number.isNaN(Number(t))?0:Number(t))}))).map((function(e){return{label:C(e),value:e}}))})),l&&(a&&(T="boolean"==typeof a?p.createElement("button",{type:"button",onClick:k,onKeyUp:k,disabled:u,className:"".concat(S,"-quick-jumper-button")},i.jump_to_confirm):p.createElement("span",{onClick:k,onKeyUp:k},a)),M=p.createElement("div",{className:"".concat(S,"-quick-jumper")},i.jump_to,p.createElement("input",{disabled:u,type:"text",value:x,onChange:function(e){b(e.target.value)},onKeyUp:k,onBlur:function(e){a||""===x||(b(""),e.relatedTarget&&(e.relatedTarget.className.indexOf("".concat(c,"-item-link"))>=0||e.relatedTarget.className.indexOf("".concat(c,"-item"))>=0)||null==l||l(w()))},"aria-label":i.page}),i.page,T)),p.createElement("li",{className:S},E,M)};var v=function(e){var t=e.rootPrefixCls,n=e.page,r=e.active,o=e.className,a=e.showTitle,s=e.onClick,l=e.onKeyPress,u=e.itemRender,d="".concat(t,"-item"),h=c()(d,"".concat(d,"-").concat(n),(0,i.Z)((0,i.Z)({},"".concat(d,"-active"),r),"".concat(d,"-disabled"),!n),o),f=u(n,"page",p.createElement("a",{rel:"nofollow"},n));return f?p.createElement("li",{title:a?String(n):null,className:h,onClick:function(){s(n)},onKeyDown:function(e){l(e,s,n)},tabIndex:0},f):null},y=function(e,t,n){return n};function x(){}function b(e){var t=Number(e);return"number"==typeof t&&!Number.isNaN(t)&&isFinite(t)&&Math.floor(t)===t}function w(e,t,n){var i=void 0===e?t:e;return Math.floor((n-1)/i)+1}var C=function(e){var t=e.prefixCls,n=void 0===t?"rc-pagination":t,l=e.selectPrefixCls,m=void 0===l?"rc-select":l,C=e.className,k=e.current,S=e.defaultCurrent,E=void 0===S?1:S,M=e.total,T=void 0===M?0:M,L=e.pageSize,_=e.defaultPageSize,N=void 0===_?10:_,A=e.onChange,P=void 0===A?x:A,D=e.hideOnSinglePage,B=e.align,j=e.showPrevNextJumpers,I=void 0===j||j,R=e.showQuickJumper,O=e.showLessItems,Z=e.showTitle,F=void 0===Z||Z,z=e.onShowSizeChange,H=void 0===z?x:z,W=e.locale,G=void 0===W?f.Z:W,V=e.style,q=e.totalBoundaryShowSizeChanger,U=void 0===q?50:q,K=e.disabled,Y=e.simple,X=e.showTotal,J=e.showSizeChanger,Q=void 0===J?T>U:J,$=e.sizeChangerRender,ee=e.pageSizeOptions,te=e.itemRender,ne=void 0===te?y:te,ie=e.jumpPrevIcon,re=e.jumpNextIcon,oe=e.prevIcon,ae=e.nextIcon,se=p.useRef(null),le=(0,u.Z)(10,{value:L,defaultValue:N}),ce=(0,s.Z)(le,2),ue=ce[0],de=ce[1],he=(0,u.Z)(1,{value:k,defaultValue:E,postState:function(e){return Math.max(1,Math.min(e,w(void 0,ue,T)))}}),pe=(0,s.Z)(he,2),fe=pe[0],me=pe[1],ge=p.useState(fe),ve=(0,s.Z)(ge,2),ye=ve[0],xe=ve[1];(0,p.useEffect)((function(){xe(fe)}),[fe]);var be=Math.max(1,fe-(O?3:5)),we=Math.min(w(void 0,ue,T),fe+(O?3:5));function Ce(t,i){var r=t||p.createElement("button",{type:"button","aria-label":i,className:"".concat(n,"-item-link")});return"function"==typeof t&&(r=p.createElement(t,(0,a.Z)({},e))),r}function ke(e){var t=e.target.value,n=w(void 0,ue,T);return""===t?t:Number.isNaN(Number(t))?ye:t>=n?n:Number(t)}var Se=T>ue&&R;function Ee(e){var t=ke(e);switch(t!==ye&&xe(t),e.keyCode){case d.Z.ENTER:Me(t);break;case d.Z.UP:Me(t-1);break;case d.Z.DOWN:Me(t+1)}}function Me(e){if(function(e){return b(e)&&e!==fe&&b(T)&&T>0}(e)&&!K){var t=w(void 0,ue,T),n=e;return e>t?n=t:e<1&&(n=1),n!==ye&&xe(n),me(n),null==P||P(n,ue),n}return fe}var Te=fe>1,Le=fe<w(void 0,ue,T);function _e(){Te&&Me(fe-1)}function Ne(){Le&&Me(fe+1)}function Ae(){Me(be)}function Pe(){Me(we)}function De(e,t){if("Enter"===e.key||e.charCode===d.Z.ENTER||e.keyCode===d.Z.ENTER){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];t.apply(void 0,i)}}function Be(e){"click"!==e.type&&e.keyCode!==d.Z.ENTER||Me(ye)}var je=null,Ie=(0,h.Z)(e,{aria:!0,data:!0}),Re=X&&p.createElement("li",{className:"".concat(n,"-total-text")},X(T,[0===T?0:(fe-1)*ue+1,fe*ue>T?T:fe*ue])),Oe=null,Ze=w(void 0,ue,T);if(D&&T<=ue)return null;var Fe=[],ze={rootPrefixCls:n,onClick:Me,onKeyPress:De,showTitle:F,itemRender:ne,page:-1},He=fe-1>0?fe-1:0,We=fe+1<Ze?fe+1:Ze,Ge=R&&R.goButton,Ve="object"===(0,o.Z)(Y)?Y.readOnly:!Y,qe=Ge,Ue=null;Y&&(Ge&&(qe="boolean"==typeof Ge?p.createElement("button",{type:"button",onClick:Be,onKeyUp:Be},G.jump_to_confirm):p.createElement("span",{onClick:Be,onKeyUp:Be},Ge),qe=p.createElement("li",{title:F?"".concat(G.jump_to).concat(fe,"/").concat(Ze):null,className:"".concat(n,"-simple-pager")},qe)),Ue=p.createElement("li",{title:F?"".concat(fe,"/").concat(Ze):null,className:"".concat(n,"-simple-pager")},Ve?ye:p.createElement("input",{type:"text","aria-label":G.jump_to,value:ye,disabled:K,onKeyDown:function(e){e.keyCode!==d.Z.UP&&e.keyCode!==d.Z.DOWN||e.preventDefault()},onKeyUp:Ee,onChange:Ee,onBlur:function(e){Me(ke(e))},size:3}),p.createElement("span",{className:"".concat(n,"-slash")},"/"),Ze));var Ke=O?1:2;if(Ze<=3+2*Ke){Ze||Fe.push(p.createElement(v,(0,r.Z)({},ze,{key:"noPager",page:1,className:"".concat(n,"-item-disabled")})));for(var Ye=1;Ye<=Ze;Ye+=1)Fe.push(p.createElement(v,(0,r.Z)({},ze,{key:Ye,page:Ye,active:fe===Ye})))}else{var Xe=O?G.prev_3:G.prev_5,Je=O?G.next_3:G.next_5,Qe=ne(be,"jump-prev",Ce(ie,"prev page")),$e=ne(we,"jump-next",Ce(re,"next page"));I&&(je=Qe?p.createElement("li",{title:F?Xe:null,key:"prev",onClick:Ae,tabIndex:0,onKeyDown:function(e){De(e,Ae)},className:c()("".concat(n,"-jump-prev"),(0,i.Z)({},"".concat(n,"-jump-prev-custom-icon"),!!ie))},Qe):null,Oe=$e?p.createElement("li",{title:F?Je:null,key:"next",onClick:Pe,tabIndex:0,onKeyDown:function(e){De(e,Pe)},className:c()("".concat(n,"-jump-next"),(0,i.Z)({},"".concat(n,"-jump-next-custom-icon"),!!re))},$e):null);var et=Math.max(1,fe-Ke),tt=Math.min(fe+Ke,Ze);fe-1<=Ke&&(tt=1+2*Ke),Ze-fe<=Ke&&(et=Ze-2*Ke);for(var nt=et;nt<=tt;nt+=1)Fe.push(p.createElement(v,(0,r.Z)({},ze,{key:nt,page:nt,active:fe===nt})));if(fe-1>=2*Ke&&3!==fe&&(Fe[0]=p.cloneElement(Fe[0],{className:c()("".concat(n,"-item-after-jump-prev"),Fe[0].props.className)}),Fe.unshift(je)),Ze-fe>=2*Ke&&fe!==Ze-2){var it=Fe[Fe.length-1];Fe[Fe.length-1]=p.cloneElement(it,{className:c()("".concat(n,"-item-before-jump-next"),it.props.className)}),Fe.push(Oe)}1!==et&&Fe.unshift(p.createElement(v,(0,r.Z)({},ze,{key:1,page:1}))),tt!==Ze&&Fe.push(p.createElement(v,(0,r.Z)({},ze,{key:Ze,page:Ze})))}var rt=function(e){var t=ne(e,"prev",Ce(oe,"prev page"));return p.isValidElement(t)?p.cloneElement(t,{disabled:!Te}):t}(He);if(rt){var ot=!Te||!Ze;rt=p.createElement("li",{title:F?G.prev_page:null,onClick:_e,tabIndex:ot?null:0,onKeyDown:function(e){De(e,_e)},className:c()("".concat(n,"-prev"),(0,i.Z)({},"".concat(n,"-disabled"),ot)),"aria-disabled":ot},rt)}var at,st,lt=function(e){var t=ne(e,"next",Ce(ae,"next page"));return p.isValidElement(t)?p.cloneElement(t,{disabled:!Le}):t}(We);lt&&(Y?(at=!Le,st=Te?0:null):st=(at=!Le||!Ze)?null:0,lt=p.createElement("li",{title:F?G.next_page:null,onClick:Ne,tabIndex:st,onKeyDown:function(e){De(e,Ne)},className:c()("".concat(n,"-next"),(0,i.Z)({},"".concat(n,"-disabled"),at)),"aria-disabled":at},lt));var ct=c()(n,C,(0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)({},"".concat(n,"-start"),"start"===B),"".concat(n,"-center"),"center"===B),"".concat(n,"-end"),"end"===B),"".concat(n,"-simple"),Y),"".concat(n,"-disabled"),K));return p.createElement("ul",(0,r.Z)({className:ct,style:V,ref:se},Ie),Re,rt,Y?Ue:Fe,lt,p.createElement(g,{locale:G,rootPrefixCls:n,disabled:K,selectPrefixCls:m,changeSize:function(e){var t=w(e,ue,T),n=fe>t&&0!==t?t:fe;de(e),xe(n),null==H||H(fe,e),me(n),null==P||P(n,e)},pageSize:ue,pageSizeOptions:ee,quickGo:Se?Me:null,goButton:qe,showSizeChanger:Q,sizeChangerRender:$}))}},6551:function(e,t,n){"use strict";n.d(t,{ZP:function(){return l}});var i=n(42978),r=n(59301),o=n(47273),a=0,s=(0,o.Z)();function l(e){var t=r.useState(),n=(0,i.Z)(t,2),o=n[0],l=n[1];return r.useEffect((function(){var e;l("rc_select_".concat((s?(e=a,a+=1):e="TEST_OR_SSR",e)))}),[]),e||o}},37463:function(e,t,n){"use strict";n.d(t,{Ac:function(){return ee},Xo:function(){return ne},Wx:function(){return re},ZP:function(){return Ee},lk:function(){return b}});var i=n(54476),r=n(94480),o=n(20068),a=n(33885),s=n(42978),l=n(75931),c=n(76190),u=n(18929),d=n(48736),h=n(59301),p=n(92310),f=n.n(p),m=n(34280),g=n(49658),v=n(8654),y=function(e){var t=e.className,n=e.customizeIcon,i=e.customizeIconProps,r=e.children,o=e.onMouseDown,a=e.onClick,s="function"==typeof n?n(i):n;return h.createElement("span",{className:t,onMouseDown:function(e){e.preventDefault(),null==o||o(e)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:a,"aria-hidden":!0},void 0!==s?s:h.createElement("span",{className:f()(t.split(/\s+/).map((function(e){return"".concat(e,"-icon")})))},r))},x=h.createContext(null);function b(){return h.useContext(x)}function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,t=h.useRef(null),n=h.useRef(null);function i(i){(i||null===t.current)&&(t.current=i),window.clearTimeout(n.current),n.current=window.setTimeout((function(){t.current=null}),e)}return h.useEffect((function(){return function(){window.clearTimeout(n.current)}}),[]),[function(){return t.current},i]}var C=n(10228);var k=n(26112),S=n(11780);var E=function(e,t,n){var i=(0,a.Z)((0,a.Z)({},e),n?t:{});return Object.keys(t).forEach((function(n){var r=t[n];"function"==typeof r&&(i[n]=function(){for(var t,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r.apply(void 0,o),null===(t=e[n])||void 0===t?void 0:t.call.apply(t,[e].concat(o))})})),i},M=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],T=function(e,t){var n=e.prefixCls,i=e.id,r=e.inputElement,o=e.autoFocus,s=e.autoComplete,c=e.editable,u=e.activeDescendantId,p=e.value,m=e.open,g=e.attrs,y=(0,l.Z)(e,M),x=r||h.createElement("input",null),b=x,w=b.ref,C=b.props;return(0,d.Kp)(!("maxLength"in x.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),x=h.cloneElement(x,(0,a.Z)((0,a.Z)((0,a.Z)({type:"search"},E(y,C,!0)),{},{id:i,ref:(0,v.sQ)(t,w),autoComplete:s||"off",autoFocus:o,className:f()("".concat(n,"-selection-search-input"),null==C?void 0:C.className),role:"combobox","aria-expanded":m||!1,"aria-haspopup":"listbox","aria-owns":"".concat(i,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(i,"_list"),"aria-activedescendant":m?u:void 0},g),{},{value:c?p:"",readOnly:!c,unselectable:c?null:"on",style:(0,a.Z)((0,a.Z)({},C.style),{},{opacity:c?null:0})}))};var L=h.forwardRef(T);function _(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}var N="undefined"!=typeof window&&window.document&&window.document.documentElement;function A(e){return["string","number"].includes((0,c.Z)(e))}function P(e){var t=void 0;return e&&(A(e.title)?t=e.title.toString():A(e.label)&&(t=e.label.toString())),t}function D(e){var t;return null!==(t=e.key)&&void 0!==t?t:e.value}var B=function(e){e.preventDefault(),e.stopPropagation()},j=function(e){var t,n,i=e.id,r=e.prefixCls,a=e.values,l=e.open,c=e.searchValue,u=e.autoClearSearchValue,d=e.inputRef,p=e.placeholder,m=e.disabled,g=e.mode,v=e.showSearch,x=e.autoFocus,b=e.autoComplete,w=e.activeDescendantId,C=e.tabIndex,E=e.removeIcon,M=e.maxTagCount,T=e.maxTagTextLength,_=e.maxTagPlaceholder,A=void 0===_?function(e){return"+ ".concat(e.length," ...")}:_,j=e.tagRender,I=e.onToggleOpen,R=e.onRemove,O=e.onInputChange,Z=e.onInputPaste,F=e.onInputKeyDown,z=e.onInputMouseDown,H=e.onInputCompositionStart,W=e.onInputCompositionEnd,G=e.onInputBlur,V=h.useRef(null),q=(0,h.useState)(0),U=(0,s.Z)(q,2),K=U[0],Y=U[1],X=(0,h.useState)(!1),J=(0,s.Z)(X,2),Q=J[0],$=J[1],ee="".concat(r,"-selection"),te=l||"multiple"===g&&!1===u||"tags"===g?c:"",ne="tags"===g||"multiple"===g&&!1===u||v&&(l||Q);t=function(){Y(V.current.scrollWidth)},n=[te],N?h.useLayoutEffect(t,n):h.useEffect(t,n);var ie=function(e,t,n,i,r){return h.createElement("span",{title:P(e),className:f()("".concat(ee,"-item"),(0,o.Z)({},"".concat(ee,"-item-disabled"),n))},h.createElement("span",{className:"".concat(ee,"-item-content")},t),i&&h.createElement(y,{className:"".concat(ee,"-item-remove"),onMouseDown:B,onClick:r,customizeIcon:E},"×"))},re=function(e,t,n,i,r,o){return h.createElement("span",{onMouseDown:function(e){B(e),I(!l)}},j({label:t,value:e,disabled:n,closable:i,onClose:r,isMaxTag:!!o}))},oe=h.createElement("div",{className:"".concat(ee,"-search"),style:{width:K},onFocus:function(){$(!0)},onBlur:function(){$(!1)}},h.createElement(L,{ref:d,open:l,prefixCls:r,id:i,inputElement:null,disabled:m,autoFocus:x,autoComplete:b,editable:ne,activeDescendantId:w,value:te,onKeyDown:F,onMouseDown:z,onChange:O,onPaste:Z,onCompositionStart:H,onCompositionEnd:W,onBlur:G,tabIndex:C,attrs:(0,k.Z)(e,!0)}),h.createElement("span",{ref:V,className:"".concat(ee,"-search-mirror"),"aria-hidden":!0},te," ")),ae=h.createElement(S.Z,{prefixCls:"".concat(ee,"-overflow"),data:a,renderItem:function(e){var t=e.disabled,n=e.label,i=e.value,r=!m&&!t,o=n;if("number"==typeof T&&("string"==typeof n||"number"==typeof n)){var a=String(o);a.length>T&&(o="".concat(a.slice(0,T),"..."))}var s=function(t){t&&t.stopPropagation(),R(e)};return"function"==typeof j?re(i,o,t,r,s):ie(e,o,t,r,s)},renderRest:function(e){if(!a.length)return null;var t="function"==typeof A?A(e):A;return"function"==typeof j?re(void 0,t,!1,!1,void 0,!0):ie({title:t},t,!1)},suffix:oe,itemKey:D,maxCount:M});return h.createElement("span",{className:"".concat(ee,"-wrap")},ae,!a.length&&!te&&h.createElement("span",{className:"".concat(ee,"-placeholder")},p))},I=function(e){var t=e.inputElement,n=e.prefixCls,i=e.id,r=e.inputRef,o=e.disabled,a=e.autoFocus,l=e.autoComplete,c=e.activeDescendantId,u=e.mode,d=e.open,p=e.values,f=e.placeholder,m=e.tabIndex,g=e.showSearch,v=e.searchValue,y=e.activeValue,x=e.maxLength,b=e.onInputKeyDown,w=e.onInputMouseDown,C=e.onInputChange,S=e.onInputPaste,E=e.onInputCompositionStart,M=e.onInputCompositionEnd,T=e.onInputBlur,_=e.title,N=h.useState(!1),A=(0,s.Z)(N,2),D=A[0],B=A[1],j="combobox"===u,I=j||g,R=p[0],O=v||"";j&&y&&!D&&(O=y),h.useEffect((function(){j&&B(!1)}),[j,y]);var Z=!("combobox"!==u&&!d&&!g)&&!!O,F=void 0===_?P(R):_,z=h.useMemo((function(){return R?null:h.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:Z?{visibility:"hidden"}:void 0},f)}),[R,Z,f,n]);return h.createElement("span",{className:"".concat(n,"-selection-wrap")},h.createElement("span",{className:"".concat(n,"-selection-search")},h.createElement(L,{ref:r,prefixCls:n,id:i,open:d,inputElement:t,disabled:o,autoFocus:a,autoComplete:l,editable:I,activeDescendantId:c,value:O,onKeyDown:b,onMouseDown:w,onChange:function(e){B(!0),C(e)},onPaste:S,onCompositionStart:E,onCompositionEnd:M,onBlur:T,tabIndex:m,attrs:(0,k.Z)(e,!0),maxLength:j?x:void 0})),!j&&R?h.createElement("span",{className:"".concat(n,"-selection-item"),title:F,style:Z?{visibility:"hidden"}:void 0},R.label):null,z)},R=function(e,t){var n=(0,h.useRef)(null),r=(0,h.useRef)(!1),o=e.prefixCls,a=e.open,l=e.mode,c=e.showSearch,u=e.tokenWithEnter,d=e.disabled,p=e.prefix,f=e.autoClearSearchValue,m=e.onSearch,g=e.onSearchSubmit,v=e.onToggleOpen,y=e.onInputKeyDown,x=e.onInputBlur,b=e.domRef;h.useImperativeHandle(t,(function(){return{focus:function(e){n.current.focus(e)},blur:function(){n.current.blur()}}}));var k=w(0),S=(0,s.Z)(k,2),E=S[0],M=S[1],T=(0,h.useRef)(null),L=function(e){!1!==m(e,!0,r.current)&&v(!0)},_={inputRef:n,onInputKeyDown:function(e){var t,i=e.which,o=n.current instanceof HTMLTextAreaElement;(o||!a||i!==C.Z.UP&&i!==C.Z.DOWN||e.preventDefault(),y&&y(e),i!==C.Z.ENTER||"tags"!==l||r.current||a||null==g||g(e.target.value),o&&!a&&~[C.Z.UP,C.Z.DOWN,C.Z.LEFT,C.Z.RIGHT].indexOf(i))||(t=i)&&![C.Z.ESC,C.Z.SHIFT,C.Z.BACKSPACE,C.Z.TAB,C.Z.WIN_KEY,C.Z.ALT,C.Z.META,C.Z.WIN_KEY_RIGHT,C.Z.CTRL,C.Z.SEMICOLON,C.Z.EQUALS,C.Z.CAPS_LOCK,C.Z.CONTEXT_MENU,C.Z.F1,C.Z.F2,C.Z.F3,C.Z.F4,C.Z.F5,C.Z.F6,C.Z.F7,C.Z.F8,C.Z.F9,C.Z.F10,C.Z.F11,C.Z.F12].includes(t)&&v(!0)},onInputMouseDown:function(){M(!0)},onInputChange:function(e){var t=e.target.value;if(u&&T.current&&/[\r\n]/.test(T.current)){var n=T.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");t=t.replace(n,T.current)}T.current=null,L(t)},onInputPaste:function(e){var t=e.clipboardData,n=null==t?void 0:t.getData("text");T.current=n||""},onInputCompositionStart:function(){r.current=!0},onInputCompositionEnd:function(e){r.current=!1,"combobox"!==l&&L(e.target.value)},onInputBlur:x},N="multiple"===l||"tags"===l?h.createElement(j,(0,i.Z)({},e,_)):h.createElement(I,(0,i.Z)({},e,_));return h.createElement("div",{ref:b,className:"".concat(o,"-selector"),onClick:function(e){e.target!==n.current&&(void 0!==document.body.style.msTouchAction?setTimeout((function(){n.current.focus()})):n.current.focus())},onMouseDown:function(e){var t=E();e.target===n.current||t||"combobox"===l&&d||e.preventDefault(),("combobox"===l||c&&t)&&a||(a&&!1!==f&&m("",!0,!1),v())}},p&&h.createElement("div",{className:"".concat(o,"-prefix")},p),N)};var O=h.forwardRef(R),Z=n(65030),F=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],z=function(e,t){var n=e.prefixCls,r=(e.disabled,e.visible),s=e.children,c=e.popupElement,u=e.animation,d=e.transitionName,p=e.dropdownStyle,m=e.dropdownClassName,g=e.direction,v=void 0===g?"ltr":g,y=e.placement,x=e.builtinPlacements,b=e.dropdownMatchSelectWidth,w=e.dropdownRender,C=e.dropdownAlign,k=e.getPopupContainer,S=e.empty,E=e.getTriggerDOMNode,M=e.onPopupVisibleChange,T=e.onPopupMouseEnter,L=(0,l.Z)(e,F),_="".concat(n,"-dropdown"),N=c;w&&(N=w(c));var A=h.useMemo((function(){return x||function(e){var t=!0===e?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"}}}(b)}),[x,b]),P=u?"".concat(_,"-").concat(u):d,D="number"==typeof b,B=h.useMemo((function(){return D?null:!1===b?"minWidth":"width"}),[b,D]),j=p;D&&(j=(0,a.Z)((0,a.Z)({},j),{},{width:b}));var I=h.useRef(null);return h.useImperativeHandle(t,(function(){return{getPopupElement:function(){var e;return null===(e=I.current)||void 0===e?void 0:e.popupElement}}})),h.createElement(Z.Z,(0,i.Z)({},L,{showAction:M?["click"]:[],hideAction:M?["click"]:[],popupPlacement:y||("rtl"===v?"bottomRight":"bottomLeft"),builtinPlacements:A,prefixCls:_,popupTransitionName:P,popup:h.createElement("div",{onMouseEnter:T},N),ref:I,stretch:B,popupAlign:C,popupVisible:r,getPopupContainer:k,popupClassName:f()(m,(0,o.Z)({},"".concat(_,"-empty"),S)),popupStyle:j,getTriggerDOMNode:E,onPopupVisibleChange:M}),s)};var H=h.forwardRef(z),W=n(66712);function G(e,t){var n,i=e.key;return"value"in e&&(n=e.value),null!=i?i:void 0!==n?n:"rc-index-key-".concat(t)}function V(e){return void 0!==e&&!Number.isNaN(e)}function q(e,t){var n=e||{},i=n.label||(t?"children":"label");return{label:i,value:n.value||"value",options:n.options||"options",groupLabel:n.groupLabel||i}}function U(e){var t=(0,a.Z)({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return(0,d.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}var K=h.createContext(null);function Y(e){var t=e.visible,n=e.values;if(!t)return null;return h.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(n.slice(0,50).map((function(e){var t=e.label,n=e.value;return["number","string"].includes((0,c.Z)(t))?t:n})).join(", ")),n.length>50?", ...":null)}var X=["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"],J=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],Q=function(e){return"tags"===e||"multiple"===e},$=h.forwardRef((function(e,t){var n,d=e.id,p=e.prefixCls,b=e.className,C=e.showSearch,k=e.tagRender,S=e.direction,E=e.omitDomProps,M=e.displayValues,T=e.onDisplayValuesChange,L=e.emptyOptions,_=e.notFoundContent,N=void 0===_?"Not Found":_,A=e.onClear,P=e.mode,D=e.disabled,B=e.loading,j=e.getInputElement,I=e.getRawInputElement,R=e.open,Z=e.defaultOpen,F=e.onDropdownVisibleChange,z=e.activeValue,G=e.onActiveValueChange,q=e.activeDescendantId,U=e.searchValue,$=e.autoClearSearchValue,ee=e.onSearch,te=e.onSearchSplit,ne=e.tokenSeparators,ie=e.allowClear,re=e.prefix,oe=e.suffixIcon,ae=e.clearIcon,se=e.OptionList,le=e.animation,ce=e.transitionName,ue=e.dropdownStyle,de=e.dropdownClassName,he=e.dropdownMatchSelectWidth,pe=e.dropdownRender,fe=e.dropdownAlign,me=e.placement,ge=e.builtinPlacements,ve=e.getPopupContainer,ye=e.showAction,xe=void 0===ye?[]:ye,be=e.onFocus,we=e.onBlur,Ce=e.onKeyUp,ke=e.onKeyDown,Se=e.onMouseDown,Ee=(0,l.Z)(e,X),Me=Q(P),Te=(void 0!==C?C:Me)||"combobox"===P,Le=(0,a.Z)({},Ee);J.forEach((function(e){delete Le[e]})),null==E||E.forEach((function(e){delete Le[e]}));var _e=h.useState(!1),Ne=(0,s.Z)(_e,2),Ae=Ne[0],Pe=Ne[1];h.useEffect((function(){Pe((0,g.Z)())}),[]);var De=h.useRef(null),Be=h.useRef(null),je=h.useRef(null),Ie=h.useRef(null),Re=h.useRef(null),Oe=h.useRef(!1),Ze=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=h.useState(!1),n=(0,s.Z)(t,2),i=n[0],r=n[1],o=h.useRef(null),a=function(){window.clearTimeout(o.current)};return h.useEffect((function(){return a}),[]),[i,function(t,n){a(),o.current=window.setTimeout((function(){r(t),n&&n()}),e)},a]}(),Fe=(0,s.Z)(Ze,3),ze=Fe[0],He=Fe[1],We=Fe[2];h.useImperativeHandle(t,(function(){var e,t;return{focus:null===(e=Ie.current)||void 0===e?void 0:e.focus,blur:null===(t=Ie.current)||void 0===t?void 0:t.blur,scrollTo:function(e){var t;return null===(t=Re.current)||void 0===t?void 0:t.scrollTo(e)},nativeElement:De.current||Be.current}}));var Ge=h.useMemo((function(){var e;if("combobox"!==P)return U;var t=null===(e=M[0])||void 0===e?void 0:e.value;return"string"==typeof t||"number"==typeof t?String(t):""}),[U,P,M]),Ve="combobox"===P&&"function"==typeof j&&j()||null,qe="function"==typeof I&&I(),Ue=(0,v.x1)(Be,null==qe||null===(n=qe.props)||void 0===n?void 0:n.ref),Ke=h.useState(!1),Ye=(0,s.Z)(Ke,2),Xe=Ye[0],Je=Ye[1];(0,m.Z)((function(){Je(!0)}),[]);var Qe=(0,u.Z)(!1,{defaultValue:Z,value:R}),$e=(0,s.Z)(Qe,2),et=$e[0],tt=$e[1],nt=!!Xe&&et,it=!N&&L;(D||it&&nt&&"combobox"===P)&&(nt=!1);var rt=!it&&nt,ot=h.useCallback((function(e){var t=void 0!==e?e:!nt;D||(tt(t),nt!==t&&(null==F||F(t)))}),[D,nt,tt,F]),at=h.useMemo((function(){return(ne||[]).some((function(e){return["\n","\r\n"].includes(e)}))}),[ne]),st=h.useContext(K)||{},lt=st.maxCount,ct=st.rawValues,ut=function(e,t,n){if(!(Me&&V(lt)&&(null==ct?void 0:ct.size)>=lt)){var i=!0,o=e;null==G||G(null);var a=function(e,t,n){if(!t||!t.length)return null;var i=!1,o=function e(t,n){var o=(0,W.Z)(n),a=o[0],s=o.slice(1);if(!a)return[t];var l=t.split(a);return i=i||l.length>1,l.reduce((function(t,n){return[].concat((0,r.Z)(t),(0,r.Z)(e(n,s)))}),[]).filter(Boolean)}(e,t);return i?void 0!==n?o.slice(0,n):o:null}(e,ne,V(lt)?lt-ct.size:void 0),s=n?null:a;return"combobox"!==P&&s&&(o="",null==te||te(s),ot(!1),i=!1),ee&&Ge!==o&&ee(o,{source:t?"typing":"effect"}),i}};h.useEffect((function(){nt||Me||"combobox"===P||ut("",!1,!1)}),[nt]),h.useEffect((function(){et&&D&&tt(!1),D&&!Oe.current&&He(!1)}),[D]);var dt=w(),ht=(0,s.Z)(dt,2),pt=ht[0],ft=ht[1],mt=h.useRef(!1),gt=h.useRef(!1),vt=[];h.useEffect((function(){return function(){vt.forEach((function(e){return clearTimeout(e)})),vt.splice(0,vt.length)}}),[]);var yt,xt=h.useState({}),bt=(0,s.Z)(xt,2)[1];qe&&(yt=function(e){ot(e)}),function(e,t,n,i){var r=h.useRef(null);r.current={open:t,triggerOpen:n,customizedTrigger:i},h.useEffect((function(){function t(t){var n;if(null===(n=r.current)||void 0===n||!n.customizedTrigger){var i=t.target;i.shadowRoot&&t.composed&&(i=t.composedPath()[0]||i),r.current.open&&e().filter((function(e){return e})).every((function(e){return!e.contains(i)&&e!==i}))&&r.current.triggerOpen(!1)}}return window.addEventListener("mousedown",t),function(){return window.removeEventListener("mousedown",t)}}),[])}((function(){var e;return[De.current,null===(e=je.current)||void 0===e?void 0:e.getPopupElement()]}),rt,ot,!!qe);var wt,Ct=h.useMemo((function(){return(0,a.Z)((0,a.Z)({},e),{},{notFoundContent:N,open:nt,triggerOpen:rt,id:d,showSearch:Te,multiple:Me,toggleOpen:ot})}),[e,N,rt,nt,d,Te,Me,ot]),kt=!!oe||B;kt&&(wt=h.createElement(y,{className:f()("".concat(p,"-arrow"),(0,o.Z)({},"".concat(p,"-arrow-loading"),B)),customizeIcon:oe,customizeIconProps:{loading:B,searchValue:Ge,open:nt,focused:ze,showSearch:Te}}));var St,Et=function(e,t,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=arguments.length>6?arguments[6]:void 0,s=arguments.length>7?arguments[7]:void 0,l=h.useMemo((function(){return"object"===(0,c.Z)(i)?i.clearIcon:r||void 0}),[i,r]),u=h.useMemo((function(){return!(o||!i||!n.length&&!a||"combobox"===s&&""===a)}),[i,o,n.length,a,s]);return{allowClear:u,clearIcon:h.createElement(y,{className:"".concat(e,"-clear"),onMouseDown:t,customizeIcon:l},"×")}}(p,(function(){var e;null==A||A(),null===(e=Ie.current)||void 0===e||e.focus(),T([],{type:"clear",values:M}),ut("",!1,!1)}),M,ie,ae,D,Ge,P),Mt=Et.allowClear,Tt=Et.clearIcon,Lt=h.createElement(se,{ref:Re}),_t=f()(p,b,(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},"".concat(p,"-focused"),ze),"".concat(p,"-multiple"),Me),"".concat(p,"-single"),!Me),"".concat(p,"-allow-clear"),ie),"".concat(p,"-show-arrow"),kt),"".concat(p,"-disabled"),D),"".concat(p,"-loading"),B),"".concat(p,"-open"),nt),"".concat(p,"-customize-input"),Ve),"".concat(p,"-show-search"),Te)),Nt=h.createElement(H,{ref:je,disabled:D,prefixCls:p,visible:rt,popupElement:Lt,animation:le,transitionName:ce,dropdownStyle:ue,dropdownClassName:de,direction:S,dropdownMatchSelectWidth:he,dropdownRender:pe,dropdownAlign:fe,placement:me,builtinPlacements:ge,getPopupContainer:ve,empty:L,getTriggerDOMNode:function(e){return Be.current||e},onPopupVisibleChange:yt,onPopupMouseEnter:function(){bt({})}},qe?h.cloneElement(qe,{ref:Ue}):h.createElement(O,(0,i.Z)({},e,{domRef:Be,prefixCls:p,inputElement:Ve,ref:Ie,id:d,prefix:re,showSearch:Te,autoClearSearchValue:$,mode:P,activeDescendantId:q,tagRender:k,values:M,open:nt,onToggleOpen:ot,activeValue:z,searchValue:Ge,onSearch:ut,onSearchSubmit:function(e){e&&e.trim()&&ee(e,{source:"submit"})},onRemove:function(e){var t=M.filter((function(t){return t!==e}));T(t,{type:"remove",values:[e]})},tokenWithEnter:at,onInputBlur:function(){mt.current=!1}})));return St=qe?Nt:h.createElement("div",(0,i.Z)({className:_t},Le,{ref:De,onMouseDown:function(e){var t,n=e.target,i=null===(t=je.current)||void 0===t?void 0:t.getPopupElement();if(i&&i.contains(n)){var r=setTimeout((function(){var e,t=vt.indexOf(r);-1!==t&&vt.splice(t,1),We(),Ae||i.contains(document.activeElement)||null===(e=Ie.current)||void 0===e||e.focus()}));vt.push(r)}for(var o=arguments.length,a=new Array(o>1?o-1:0),s=1;s<o;s++)a[s-1]=arguments[s];null==Se||Se.apply(void 0,[e].concat(a))},onKeyDown:function(e){var t,n=pt(),i=e.key,o="Enter"===i;if(o&&("combobox"!==P&&e.preventDefault(),nt||ot(!0)),ft(!!Ge),"Backspace"===i&&!n&&Me&&!Ge&&M.length){for(var a=(0,r.Z)(M),s=null,l=a.length-1;l>=0;l-=1){var c=a[l];if(!c.disabled){a.splice(l,1),s=c;break}}s&&T(a,{type:"remove",values:[s]})}for(var u=arguments.length,d=new Array(u>1?u-1:0),h=1;h<u;h++)d[h-1]=arguments[h];!nt||o&&mt.current||(o&&(mt.current=!0),null===(t=Re.current)||void 0===t||t.onKeyDown.apply(t,[e].concat(d))),null==ke||ke.apply(void 0,[e].concat(d))},onKeyUp:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var r;nt&&(null===(r=Re.current)||void 0===r||r.onKeyUp.apply(r,[e].concat(n))),"Enter"===e.key&&(mt.current=!1),null==Ce||Ce.apply(void 0,[e].concat(n))},onFocus:function(){He(!0),D||(be&&!gt.current&&be.apply(void 0,arguments),xe.includes("focus")&&ot(!0)),gt.current=!0},onBlur:function(){Oe.current=!0,He(!1,(function(){gt.current=!1,Oe.current=!1,ot(!1)})),D||(Ge&&("tags"===P?ee(Ge,{source:"submit"}):"multiple"===P&&ee("",{source:"blur"})),we&&we.apply(void 0,arguments))}}),h.createElement(Y,{visible:ze&&!nt,values:M}),Nt,wt,Mt&&Tt),h.createElement(x.Provider,{value:Ct},St)}));var ee=$,te=function(){return null};te.isSelectOptGroup=!0;var ne=te,ie=function(){return null};ie.isSelectOption=!0;var re=ie,oe=n(80547),ae=n(2738),se=n(48911);var le=["disabled","title","children","style","className"];function ce(e){return"string"==typeof e||"number"==typeof e}var ue=function(e,t){var n=b(),a=n.prefixCls,c=n.id,u=n.open,d=n.multiple,p=n.mode,m=n.searchValue,g=n.toggleOpen,v=n.notFoundContent,x=n.onPopupScroll,w=h.useContext(K),S=w.maxCount,E=w.flattenOptions,M=w.onActiveValue,T=w.defaultActiveFirstOption,L=w.onSelect,_=w.menuItemSelectedIcon,N=w.rawValues,A=w.fieldNames,P=w.virtual,D=w.direction,B=w.listHeight,j=w.listItemHeight,I=w.optionRender,R="".concat(a,"-item"),O=(0,oe.Z)((function(){return E}),[u,E],(function(e,t){return t[0]&&e[1]!==t[1]})),Z=h.useRef(null),F=h.useMemo((function(){return d&&V(S)&&(null==N?void 0:N.size)>=S}),[d,S,null==N?void 0:N.size]),z=function(e){e.preventDefault()},H=function(e){var t;null===(t=Z.current)||void 0===t||t.scrollTo("number"==typeof e?{index:e}:e)},W=h.useCallback((function(e){return"combobox"!==p&&N.has(e)}),[p,(0,r.Z)(N).toString(),N.size]),G=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=O.length,i=0;i<n;i+=1){var r=(e+i*t+n)%n,o=O[r]||{},a=o.group,s=o.data;if(!a&&(null==s||!s.disabled)&&(W(s.value)||!F))return r}return-1},q=h.useState((function(){return G(0)})),U=(0,s.Z)(q,2),Y=U[0],X=U[1],J=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];X(e);var n={source:t?"keyboard":"mouse"},i=O[e];i?M(i.value,e,n):M(null,-1,n)};(0,h.useEffect)((function(){J(!1!==T?G(0):-1)}),[O.length,m]);var Q=h.useCallback((function(e){return"combobox"===p?String(e).toLowerCase()===m.toLowerCase():N.has(e)}),[p,m,(0,r.Z)(N).toString(),N.size]);(0,h.useEffect)((function(){var e,t=setTimeout((function(){if(!d&&u&&1===N.size){var e=Array.from(N)[0],t=O.findIndex((function(t){var n=t.data;return m?String(n.value).startsWith(m):n.value===e}));-1!==t&&(J(t),H(t))}}));u&&(null===(e=Z.current)||void 0===e||e.scrollTo(void 0));return function(){return clearTimeout(t)}}),[u,m]);var $=function(e){void 0!==e&&L(e,{selected:!N.has(e)}),d||g(!1)};if(h.useImperativeHandle(t,(function(){return{onKeyDown:function(e){var t=e.which,n=e.ctrlKey;switch(t){case C.Z.N:case C.Z.P:case C.Z.UP:case C.Z.DOWN:var i=0;if(t===C.Z.UP?i=-1:t===C.Z.DOWN?i=1:/(mac\sos|macintosh)/i.test(navigator.appVersion)&&n&&(t===C.Z.N?i=1:t===C.Z.P&&(i=-1)),0!==i){var r=G(Y+i,i);H(r),J(r,!0)}break;case C.Z.TAB:case C.Z.ENTER:var o,a=O[Y];!a||null!=a&&null!==(o=a.data)&&void 0!==o&&o.disabled||F?$(void 0):$(a.value),u&&e.preventDefault();break;case C.Z.ESC:g(!1),u&&e.stopPropagation()}},onKeyUp:function(){},scrollTo:function(e){H(e)}}})),0===O.length)return h.createElement("div",{role:"listbox",id:"".concat(c,"_list"),className:"".concat(R,"-empty"),onMouseDown:z},v);var ee=Object.keys(A).map((function(e){return A[e]})),te=function(e){return e.label};function ne(e,t){return{role:e.group?"presentation":"option",id:"".concat(c,"_list_").concat(t)}}var ie=function(e){var t=O[e];if(!t)return null;var n=t.data||{},r=n.value,o=t.group,a=(0,k.Z)(n,!0),s=te(t);return t?h.createElement("div",(0,i.Z)({"aria-label":"string"!=typeof s||o?null:s},a,{key:e},ne(t,e),{"aria-selected":Q(r)}),r):null},re={role:"listbox",id:"".concat(c,"_list")};return h.createElement(h.Fragment,null,P&&h.createElement("div",(0,i.Z)({},re,{style:{height:0,width:0,overflow:"hidden"}}),ie(Y-1),ie(Y),ie(Y+1)),h.createElement(se.Z,{itemKey:"key",ref:Z,data:O,height:B,itemHeight:j,fullHeight:!1,onMouseDown:z,onScroll:x,virtual:P,direction:D,innerProps:P?null:re},(function(e,t){var n=e.group,r=e.groupOption,a=e.data,s=e.label,c=e.value,u=a.key;if(n){var d,p=null!==(d=a.title)&&void 0!==d?d:ce(s)?s.toString():void 0;return h.createElement("div",{className:f()(R,"".concat(R,"-group"),a.className),title:p},void 0!==s?s:u)}var m=a.disabled,g=a.title,v=(a.children,a.style),x=a.className,b=(0,l.Z)(a,le),w=(0,ae.Z)(b,ee),C=W(c),S=m||!C&&F,E="".concat(R,"-option"),M=f()(R,E,x,(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},"".concat(E,"-grouped"),r),"".concat(E,"-active"),Y===t&&!S),"".concat(E,"-disabled"),S),"".concat(E,"-selected"),C)),T=te(e),L=!_||"function"==typeof _||C,N="number"==typeof T?T:T||c,A=ce(N)?N.toString():void 0;return void 0!==g&&(A=g),h.createElement("div",(0,i.Z)({},(0,k.Z)(w),P?{}:ne(e,t),{"aria-selected":Q(c),className:M,title:A,onMouseMove:function(){Y===t||S||J(t)},onClick:function(){S||$(c)},style:v}),h.createElement("div",{className:"".concat(E,"-content")},"function"==typeof I?I(e,{index:t}):N),h.isValidElement(_)||C,L&&h.createElement(y,{className:"".concat(R,"-option-state"),customizeIcon:_,customizeIconProps:{value:c,disabled:S,isSelected:C}},C?"✓":null))})))};var de=h.forwardRef(ue);function he(e,t){return _(e).join("").toUpperCase().includes(t)}var pe=n(6551),fe=n(11592),me=["children","value"],ge=["children"];function ve(e){var t=e,n=t.key,i=t.props,r=i.children,o=i.value,s=(0,l.Z)(i,me);return(0,a.Z)({key:n,value:void 0!==o?o:n,children:r},s)}function ye(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,fe.Z)(e).map((function(e,n){if(!h.isValidElement(e)||!e.type)return null;var i=e,r=i.type.isSelectOptGroup,o=i.key,s=i.props,c=s.children,u=(0,l.Z)(s,ge);return t||!r?ve(e):(0,a.Z)((0,a.Z)({key:"__RC_SELECT_GRP__".concat(null===o?n:o,"__"),label:o},u),{},{options:ye(c)})})).filter((function(e){return e}))}var xe=function(e,t,n,i,r){return h.useMemo((function(){var o=e;!e&&(o=ye(t));var a=new Map,s=new Map,l=function(e,t,n){n&&"string"==typeof n&&e.set(t[n],t)};return function e(t){for(var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c=0;c<t.length;c+=1){var u=t[c];!u[n.options]||o?(a.set(u[n.value],u),l(s,u,n.label),l(s,u,i),l(s,u,r)):e(u[n.options],!0)}}(o),{options:o,valueOptions:a,labelOptions:s}}),[e,t,n,i,r])};function be(e){var t=h.useRef();t.current=e;var n=h.useCallback((function(){return t.current.apply(t,arguments)}),[]);return n}var we=["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"],Ce=["inputValue"];var ke=h.forwardRef((function(e,t){var n=e.id,d=e.mode,p=e.prefixCls,f=void 0===p?"rc-select":p,m=e.backfill,g=e.fieldNames,v=e.inputValue,y=e.searchValue,x=e.onSearch,b=e.autoClearSearchValue,w=void 0===b||b,C=e.onSelect,k=e.onDeselect,S=e.dropdownMatchSelectWidth,E=void 0===S||S,M=e.filterOption,T=e.filterSort,L=e.optionFilterProp,N=e.optionLabelProp,A=e.options,P=e.optionRender,D=e.children,B=e.defaultActiveFirstOption,j=e.menuItemSelectedIcon,I=e.virtual,R=e.direction,O=e.listHeight,Z=void 0===O?200:O,F=e.listItemHeight,z=void 0===F?20:F,H=e.labelRender,W=e.value,V=e.defaultValue,Y=e.labelInValue,X=e.onChange,J=e.maxCount,$=(0,l.Z)(e,we),te=(0,pe.ZP)(n),ne=Q(d),ie=!(A||!D),re=h.useMemo((function(){return(void 0!==M||"combobox"!==d)&&M}),[M,d]),oe=h.useMemo((function(){return q(g,ie)}),[JSON.stringify(g),ie]),ae=(0,u.Z)("",{value:void 0!==y?y:v,postState:function(e){return e||""}}),se=(0,s.Z)(ae,2),le=se[0],ce=se[1],ue=xe(A,D,oe,L,N),fe=ue.valueOptions,me=ue.labelOptions,ge=ue.options,ve=h.useCallback((function(e){return _(e).map((function(e){var t,n,i,r,o,a;(function(e){return!e||"object"!==(0,c.Z)(e)})(e)?t=e:(i=e.key,n=e.label,t=null!==(a=e.value)&&void 0!==a?a:i);var s,l=fe.get(t);l&&(void 0===n&&(n=null==l?void 0:l[N||oe.label]),void 0===i&&(i=null!==(s=null==l?void 0:l.key)&&void 0!==s?s:t),r=null==l?void 0:l.disabled,o=null==l?void 0:l.title);return{label:n,value:t,key:i,disabled:r,title:o}}))}),[oe,N,fe]),ye=(0,u.Z)(V,{value:W}),ke=(0,s.Z)(ye,2),Se=ke[0],Ee=ke[1],Me=h.useMemo((function(){var e,t=ve(ne&&null===Se?[]:Se);return"combobox"===d&&function(e){return!e&&0!==e}(null===(e=t[0])||void 0===e?void 0:e.value)?[]:t}),[Se,ve,d,ne]),Te=function(e,t){var n=h.useRef({values:new Map,options:new Map});return[h.useMemo((function(){var i=n.current,r=i.values,o=i.options,s=e.map((function(e){var t;return void 0===e.label?(0,a.Z)((0,a.Z)({},e),{},{label:null===(t=r.get(e.value))||void 0===t?void 0:t.label}):e})),l=new Map,c=new Map;return s.forEach((function(e){l.set(e.value,e),c.set(e.value,t.get(e.value)||o.get(e.value))})),n.current.values=l,n.current.options=c,s}),[e,t]),h.useCallback((function(e){return t.get(e)||n.current.options.get(e)}),[t])]}(Me,fe),Le=(0,s.Z)(Te,2),_e=Le[0],Ne=Le[1],Ae=h.useMemo((function(){if(!d&&1===_e.length){var e=_e[0];if(null===e.value&&(null===e.label||void 0===e.label))return[]}return _e.map((function(e){var t;return(0,a.Z)((0,a.Z)({},e),{},{label:null!==(t="function"==typeof H?H(e):e.label)&&void 0!==t?t:e.value})}))}),[d,_e,H]),Pe=h.useMemo((function(){return new Set(_e.map((function(e){return e.value})))}),[_e]);h.useEffect((function(){if("combobox"===d){var e,t=null===(e=_e[0])||void 0===e?void 0:e.value;ce(function(e){return null!=e}(t)?String(t):"")}}),[_e]);var De=be((function(e,t){var n=null!=t?t:e;return(0,o.Z)((0,o.Z)({},oe.value,e),oe.label,n)})),Be=function(e,t,n,i,r){return h.useMemo((function(){if(!n||!1===i)return e;var s=t.options,l=t.label,c=t.value,u=[],d="function"==typeof i,h=n.toUpperCase(),p=d?i:function(e,t){return r?he(t[r],h):t[s]?he(t["children"!==l?l:"label"],h):he(t[c],h)},f=d?function(e){return U(e)}:function(e){return e};return e.forEach((function(e){if(e[s])if(p(n,f(e)))u.push(e);else{var t=e[s].filter((function(e){return p(n,f(e))}));t.length&&u.push((0,a.Z)((0,a.Z)({},e),{},(0,o.Z)({},s,t)))}else p(n,f(e))&&u.push(e)})),u}),[e,i,r,n,t])}(h.useMemo((function(){if("tags"!==d)return ge;var e=(0,r.Z)(ge);return(0,r.Z)(_e).sort((function(e,t){return e.value<t.value?-1:1})).forEach((function(t){var n=t.value;(function(e){return fe.has(e)})(n)||e.push(De(n,t.label))})),e}),[De,ge,fe,_e,d]),oe,le,re,L),je=h.useMemo((function(){return"tags"!==d||!le||Be.some((function(e){return e[L||"value"]===le}))||Be.some((function(e){return e[oe.value]===le}))?Be:[De(le)].concat((0,r.Z)(Be))}),[De,L,d,Be,le,oe]),Ie=function e(t){return(0,r.Z)(t).sort((function(e,t){return T(e,t,{searchValue:le})})).map((function(t){return Array.isArray(t.options)?(0,a.Z)((0,a.Z)({},t),{},{options:t.options.length>0?e(t.options):t.options}):t}))},Re=h.useMemo((function(){return T?Ie(je):je}),[je,T,le]),Oe=h.useMemo((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.fieldNames,i=t.childrenAsData,r=[],o=q(n,!1),a=o.label,s=o.value,l=o.options,c=o.groupLabel;function u(e,t){Array.isArray(e)&&e.forEach((function(e){if(t||!(l in e)){var n=e[s];r.push({key:G(e,r.length),groupOption:t,data:e,label:e[a],value:n})}else{var o=e[c];void 0===o&&i&&(o=e.label),r.push({key:G(e,r.length),group:!0,data:e,label:o}),u(e[l],!0)}}))}return u(e,!1),r}(Re,{fieldNames:oe,childrenAsData:ie})}),[Re,oe,ie]),Ze=function(e){var t=ve(e);if(Ee(t),X&&(t.length!==_e.length||t.some((function(e,t){var n;return(null===(n=_e[t])||void 0===n?void 0:n.value)!==(null==e?void 0:e.value)})))){var n=Y?t:t.map((function(e){return e.value})),i=t.map((function(e){return U(Ne(e.value))}));X(ne?n:n[0],ne?i:i[0])}},Fe=h.useState(null),ze=(0,s.Z)(Fe,2),He=ze[0],We=ze[1],Ge=h.useState(0),Ve=(0,s.Z)(Ge,2),qe=Ve[0],Ue=Ve[1],Ke=void 0!==B?B:"combobox"!==d,Ye=h.useCallback((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.source,r=void 0===i?"keyboard":i;Ue(t),m&&"combobox"===d&&null!==e&&"keyboard"===r&&We(String(e))}),[m,d]),Xe=function(e,t,n){var i=function(){var t,n=Ne(e);return[Y?{label:null==n?void 0:n[oe.label],value:e,key:null!==(t=null==n?void 0:n.key)&&void 0!==t?t:e}:e,U(n)]};if(t&&C){var r=i(),o=(0,s.Z)(r,2),a=o[0],l=o[1];C(a,l)}else if(!t&&k&&"clear"!==n){var c=i(),u=(0,s.Z)(c,2),d=u[0],h=u[1];k(d,h)}},Je=be((function(e,t){var n,i=!ne||t.selected;n=i?ne?[].concat((0,r.Z)(_e),[e]):[e]:_e.filter((function(t){return t.value!==e})),Ze(n),Xe(e,i),"combobox"===d?We(""):Q&&!w||(ce(""),We(""))})),Qe=h.useMemo((function(){var e=!1!==I&&!1!==E;return(0,a.Z)((0,a.Z)({},ue),{},{flattenOptions:Oe,onActiveValue:Ye,defaultActiveFirstOption:Ke,onSelect:Je,menuItemSelectedIcon:j,rawValues:Pe,fieldNames:oe,virtual:e,direction:R,listHeight:Z,listItemHeight:z,childrenAsData:ie,maxCount:J,optionRender:P})}),[J,ue,Oe,Ye,Ke,Je,j,Pe,oe,I,E,R,Z,z,ie,P]);return h.createElement(K.Provider,{value:Qe},h.createElement(ee,(0,i.Z)({},$,{id:te,prefixCls:f,ref:t,omitDomProps:Ce,mode:d,displayValues:Ae,onDisplayValuesChange:function(e,t){Ze(e);var n=t.type,i=t.values;"remove"!==n&&"clear"!==n||i.forEach((function(e){Xe(e.value,!1,n)}))},direction:R,searchValue:le,onSearch:function(e,t){if(ce(e),We(null),"submit"!==t.source)"blur"!==t.source&&("combobox"===d&&Ze(e),null==x||x(e));else{var n=(e||"").trim();if(n){var i=Array.from(new Set([].concat((0,r.Z)(Pe),[n])));Ze(i),Xe(n,!0),ce("")}}},autoClearSearchValue:w,onSearchSplit:function(e){var t=e;"tags"!==d&&(t=e.map((function(e){var t=me.get(e);return null==t?void 0:t.value})).filter((function(e){return void 0!==e})));var n=Array.from(new Set([].concat((0,r.Z)(Pe),(0,r.Z)(t))));Ze(n),n.forEach((function(e){Xe(e,!0)}))},dropdownMatchSelectWidth:E,OptionList:de,emptyOptions:!Oe.length,activeValue:He,activeDescendantId:"".concat(te,"_list_").concat(qe)})))}));var Se=ke;Se.Option=re,Se.OptGroup=ne;var Ee=Se},63158:function(e,t,n){"use strict";var i=n(54476),r=n(20068),o=n(42978),a=n(75931),s=n(59301),l=n(92310),c=n.n(l),u=n(18929),d=n(10228),h=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],p=s.forwardRef((function(e,t){var n,l=e.prefixCls,p=void 0===l?"rc-switch":l,f=e.className,m=e.checked,g=e.defaultChecked,v=e.disabled,y=e.loadingIcon,x=e.checkedChildren,b=e.unCheckedChildren,w=e.onClick,C=e.onChange,k=e.onKeyDown,S=(0,a.Z)(e,h),E=(0,u.Z)(!1,{value:m,defaultValue:g}),M=(0,o.Z)(E,2),T=M[0],L=M[1];function _(e,t){var n=T;return v||(L(n=e),null==C||C(n,t)),n}var N=c()(p,f,(n={},(0,r.Z)(n,"".concat(p,"-checked"),T),(0,r.Z)(n,"".concat(p,"-disabled"),v),n));return s.createElement("button",(0,i.Z)({},S,{type:"button",role:"switch","aria-checked":T,disabled:v,className:N,ref:t,onKeyDown:function(e){e.which===d.Z.LEFT?_(!1,e):e.which===d.Z.RIGHT&&_(!0,e),null==k||k(e)},onClick:function(e){var t=_(!T,e);null==w||w(t,e)}}),y,s.createElement("span",{className:"".concat(p,"-inner")},s.createElement("span",{className:"".concat(p,"-inner-checked")},x),s.createElement("span",{className:"".concat(p,"-inner-unchecked")},b)))}));p.displayName="Switch",t.Z=p},22711:function(e,t,n){"use strict";n.r(t),n.d(t,{ResizableTextArea:function(){return T},default:function(){return _}});var i,r=n(54476),o=n(20068),a=n(33885),s=n(94480),l=n(42978),c=n(75931),u=n(92310),d=n.n(u),h=n(36901),p=n(66003),f=n(30292),m=n(18929),g=n(59301),v=n(76190),y=n(29301),x=n(34280),b=n(16089),w="\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n pointer-events: none !important;\n",C=["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"],k={};function S(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&k[n])return k[n];var i=window.getComputedStyle(e),r=i.getPropertyValue("box-sizing")||i.getPropertyValue("-moz-box-sizing")||i.getPropertyValue("-webkit-box-sizing"),o=parseFloat(i.getPropertyValue("padding-bottom"))+parseFloat(i.getPropertyValue("padding-top")),a=parseFloat(i.getPropertyValue("border-bottom-width"))+parseFloat(i.getPropertyValue("border-top-width")),s=C.map((function(e){return"".concat(e,":").concat(i.getPropertyValue(e))})).join(";"),l={sizingStyle:s,paddingSize:o,borderSize:a,boxSizing:r};return t&&n&&(k[n]=l),l}var E=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],M=g.forwardRef((function(e,t){var n=e,s=n.prefixCls,u=n.defaultValue,h=n.value,p=n.autoSize,f=n.onResize,C=n.className,k=n.style,M=n.disabled,T=n.onChange,L=(n.onInternalAutoSize,(0,c.Z)(n,E)),_=(0,m.Z)(u,{value:h,postState:function(e){return null!=e?e:""}}),N=(0,l.Z)(_,2),A=N[0],P=N[1],D=g.useRef();g.useImperativeHandle(t,(function(){return{textArea:D.current}}));var B=g.useMemo((function(){return p&&"object"===(0,v.Z)(p)?[p.minRows,p.maxRows]:[]}),[p]),j=(0,l.Z)(B,2),I=j[0],R=j[1],O=!!p,Z=g.useState(2),F=(0,l.Z)(Z,2),z=F[0],H=F[1],W=g.useState(),G=(0,l.Z)(W,2),V=G[0],q=G[1],U=function(){H(0)};(0,x.Z)((function(){O&&U()}),[h,I,R,O]),(0,x.Z)((function(){if(0===z)H(1);else if(1===z){var e=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;i||((i=document.createElement("textarea")).setAttribute("tab-index","-1"),i.setAttribute("aria-hidden","true"),i.setAttribute("name","hiddenTextarea"),document.body.appendChild(i)),e.getAttribute("wrap")?i.setAttribute("wrap",e.getAttribute("wrap")):i.removeAttribute("wrap");var o=S(e,t),a=o.paddingSize,s=o.borderSize,l=o.boxSizing,c=o.sizingStyle;i.setAttribute("style","".concat(c,";").concat(w)),i.value=e.value||e.placeholder||"";var u,d=void 0,h=void 0,p=i.scrollHeight;if("border-box"===l?p+=s:"content-box"===l&&(p-=a),null!==n||null!==r){i.value=" ";var f=i.scrollHeight-a;null!==n&&(d=f*n,"border-box"===l&&(d=d+a+s),p=Math.max(d,p)),null!==r&&(h=f*r,"border-box"===l&&(h=h+a+s),u=p>h?"":"hidden",p=Math.min(h,p))}var m={height:p,overflowY:u,resize:"none"};return d&&(m.minHeight=d),h&&(m.maxHeight=h),m}(D.current,!1,I,R);H(2),q(e)}else!function(){try{if(document.activeElement===D.current){var e=D.current,t=e.selectionStart,n=e.selectionEnd,i=e.scrollTop;D.current.setSelectionRange(t,n),D.current.scrollTop=i}}catch(e){}}()}),[z]);var K=g.useRef(),Y=function(){b.Z.cancel(K.current)};g.useEffect((function(){return Y}),[]);var X=O?V:null,J=(0,a.Z)((0,a.Z)({},k),X);return 0!==z&&1!==z||(J.overflowY="hidden",J.overflowX="hidden"),g.createElement(y.Z,{onResize:function(e){2===z&&(null==f||f(e),p&&(Y(),K.current=(0,b.Z)((function(){U()}))))},disabled:!(p||f)},g.createElement("textarea",(0,r.Z)({},L,{ref:D,style:J,className:d()(s,C,(0,o.Z)({},"".concat(s,"-disabled"),M)),disabled:M,value:A,onChange:function(e){P(e.target.value),null==T||T(e)}})))})),T=M,L=["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"],_=g.forwardRef((function(e,t){var n,i=e.defaultValue,u=e.value,v=e.onFocus,y=e.onBlur,x=e.onChange,b=e.allowClear,w=e.maxLength,C=e.onCompositionStart,k=e.onCompositionEnd,S=e.suffix,E=e.prefixCls,M=void 0===E?"rc-textarea":E,_=e.showCount,N=e.count,A=e.className,P=e.style,D=e.disabled,B=e.hidden,j=e.classNames,I=e.styles,R=e.onResize,O=e.onClear,Z=e.onPressEnter,F=e.readOnly,z=e.autoSize,H=e.onKeyDown,W=(0,c.Z)(e,L),G=(0,m.Z)(i,{value:u,defaultValue:i}),V=(0,l.Z)(G,2),q=V[0],U=V[1],K=null==q?"":String(q),Y=g.useState(!1),X=(0,l.Z)(Y,2),J=X[0],Q=X[1],$=g.useRef(!1),ee=g.useState(null),te=(0,l.Z)(ee,2),ne=te[0],ie=te[1],re=(0,g.useRef)(null),oe=(0,g.useRef)(null),ae=function(){var e;return null===(e=oe.current)||void 0===e?void 0:e.textArea},se=function(){ae().focus()};(0,g.useImperativeHandle)(t,(function(){var e;return{resizableTextArea:oe.current,focus:se,blur:function(){ae().blur()},nativeElement:(null===(e=re.current)||void 0===e?void 0:e.nativeElement)||ae()}})),(0,g.useEffect)((function(){Q((function(e){return!D&&e}))}),[D]);var le=g.useState(null),ce=(0,l.Z)(le,2),ue=ce[0],de=ce[1];g.useEffect((function(){var e;ue&&(e=ae()).setSelectionRange.apply(e,(0,s.Z)(ue))}),[ue]);var he,pe=(0,p.Z)(N,_),fe=null!==(n=pe.max)&&void 0!==n?n:w,me=Number(fe)>0,ge=pe.strategy(K),ve=!!fe&&ge>fe,ye=function(e,t){var n=t;!$.current&&pe.exceedFormatter&&pe.max&&pe.strategy(t)>pe.max&&t!==(n=pe.exceedFormatter(t,{max:pe.max}))&&de([ae().selectionStart||0,ae().selectionEnd||0]),U(n),(0,f.rJ)(e.currentTarget,e,x,n)},xe=S;pe.show&&(he=pe.showFormatter?pe.showFormatter({value:K,count:ge,maxLength:fe}):"".concat(ge).concat(me?" / ".concat(fe):""),xe=g.createElement(g.Fragment,null,xe,g.createElement("span",{className:d()("".concat(M,"-data-count"),null==j?void 0:j.count),style:null==I?void 0:I.count},he)));var be=!z&&!_&&!b;return g.createElement(h.BaseInput,{ref:re,value:K,allowClear:b,handleReset:function(e){U(""),se(),(0,f.rJ)(ae(),e,x)},suffix:xe,prefixCls:M,classNames:(0,a.Z)((0,a.Z)({},j),{},{affixWrapper:d()(null==j?void 0:j.affixWrapper,(0,o.Z)((0,o.Z)({},"".concat(M,"-show-count"),_),"".concat(M,"-textarea-allow-clear"),b))}),disabled:D,focused:J,className:d()(A,ve&&"".concat(M,"-out-of-range")),style:(0,a.Z)((0,a.Z)({},P),ne&&!be?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":"string"==typeof he?he:void 0}},hidden:B,readOnly:F,onClear:O},g.createElement(T,(0,r.Z)({},W,{autoSize:z,maxLength:w,onKeyDown:function(e){"Enter"===e.key&&Z&&Z(e),null==H||H(e)},onChange:function(e){ye(e,e.target.value)},onFocus:function(e){Q(!0),null==v||v(e)},onBlur:function(e){Q(!1),null==y||y(e)},onCompositionStart:function(e){$.current=!0,null==C||C(e)},onCompositionEnd:function(e){$.current=!1,ye(e,e.currentTarget.value),null==k||k(e)},className:d()(null==j?void 0:j.textarea),style:(0,a.Z)((0,a.Z)({},null==I?void 0:I.textarea),{},{resize:null==P?void 0:P.resize}),disabled:D,prefixCls:M,onResize:function(e){var t;null==R||R(e),null!==(t=ae())&&void 0!==t&&t.style.height&&ie(!0)},ref:oe,readOnly:F})))}))},48911:function(e,t,n){"use strict";n.d(t,{Z:function(){return O}});var i=n(54476),r=n(76190),o=n(33885),a=n(20068),s=n(42978),l=n(75931),c=n(92310),u=n.n(c),d=n(29301),h=n(70425),p=n(34280),f=n(59301),m=n(4676),g=f.forwardRef((function(e,t){var n=e.height,r=e.offsetY,s=e.offsetX,l=e.children,c=e.prefixCls,h=e.onInnerResize,p=e.innerProps,m=e.rtl,g=e.extra,v={},y={display:"flex",flexDirection:"column"};return void 0!==r&&(v={height:n,position:"relative",overflow:"hidden"},y=(0,o.Z)((0,o.Z)({},y),{},(0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)({transform:"translateY(".concat(r,"px)")},m?"marginRight":"marginLeft",-s),"position","absolute"),"left",0),"right",0),"top",0))),f.createElement("div",{style:v},f.createElement(d.Z,{onResize:function(e){e.offsetHeight&&h&&h()}},f.createElement("div",(0,i.Z)({style:y,className:u()((0,a.Z)({},"".concat(c,"-holder-inner"),c)),ref:t},p),l,g)))}));g.displayName="Filler";var v=g;function y(e){var t=e.children,n=e.setRef,i=f.useCallback((function(e){n(e)}),[]);return f.cloneElement(t,{ref:i})}function x(e,t,n){var i=f.useState(e),r=(0,s.Z)(i,2),o=r[0],a=r[1],l=f.useState(null),c=(0,s.Z)(l,2),u=c[0],d=c[1];return f.useEffect((function(){var i=function(e,t,n){var i,r,o=e.length,a=t.length;if(0===o&&0===a)return null;o<a?(i=e,r=t):(i=t,r=e);var s={__EMPTY_ITEM__:!0};function l(e){return void 0!==e?n(e):s}for(var c=null,u=1!==Math.abs(o-a),d=0;d<r.length;d+=1){var h=l(i[d]);if(h!==l(r[d])){c=d,u=u||h!==l(r[d+1]);break}}return null===c?null:{index:c,multiple:u}}(o||[],e||[],t);void 0!==(null==i?void 0:i.index)&&(null==n||n(i.index),d(e[i.index])),a(e)}),[e]),[u]}var b=n(16089),w="object"===("undefined"==typeof navigator?"undefined":(0,r.Z)(navigator))&&/Firefox/i.test(navigator.userAgent),C=function(e,t,n,i){var r=(0,f.useRef)(!1),o=(0,f.useRef)(null);function a(){clearTimeout(o.current),r.current=!0,o.current=setTimeout((function(){r.current=!1}),50)}var s=(0,f.useRef)({top:e,bottom:t,left:n,right:i});return s.current.top=e,s.current.bottom=t,s.current.left=n,s.current.right=i,function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e?t<0&&s.current.left||t>0&&s.current.right:t<0&&s.current.top||t>0&&s.current.bottom;return n&&i?(clearTimeout(o.current),r.current=!1):i&&!r.current||a(),!r.current&&i}};function k(e,t,n,i,r,o,a){var s=(0,f.useRef)(0),l=(0,f.useRef)(null),c=(0,f.useRef)(null),u=(0,f.useRef)(!1),d=C(t,n,i,r);var h=(0,f.useRef)(null),p=(0,f.useRef)(null);return[function(t){if(e){b.Z.cancel(p.current),p.current=(0,b.Z)((function(){h.current=null}),2);var n=t.deltaX,i=t.deltaY,r=t.shiftKey,f=n,m=i;("sx"===h.current||!h.current&&r&&i&&!n)&&(f=i,m=0,h.current="sx");var g=Math.abs(f),v=Math.abs(m);null===h.current&&(h.current=o&&g>v?"x":"y"),"y"===h.current?function(e,t){if(b.Z.cancel(l.current),!d(!1,t)){var n=e;n._virtualHandled||(n._virtualHandled=!0,s.current+=t,c.current=t,w||n.preventDefault(),l.current=(0,b.Z)((function(){var e=u.current?10:1;a(s.current*e,!1),s.current=0})))}}(t,m):function(e,t){a(t,!0),w||e.preventDefault()}(t,f)}},function(t){e&&(u.current=t.detail===c.current)}]}var S=n(67732),E=n(83652),M=function(){function e(){(0,S.Z)(this,e),(0,a.Z)(this,"maps",void 0),(0,a.Z)(this,"id",0),(0,a.Z)(this,"diffRecords",new Map),this.maps=Object.create(null)}return(0,E.Z)(e,[{key:"set",value:function(e,t){this.diffRecords.set(e,this.maps[e]),this.maps[e]=t,this.id+=1}},{key:"get",value:function(e){return this.maps[e]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),e}();function T(e){var t=parseFloat(e);return isNaN(t)?0:t}var L=14/15;function _(e){return Math.floor(Math.pow(e,.5))}function N(e,t){return("touches"in e?e.touches[0]:e)[t?"pageX":"pageY"]-window[t?"scrollX":"scrollY"]}var A=f.forwardRef((function(e,t){var n=e.prefixCls,i=e.rtl,r=e.scrollOffset,l=e.scrollRange,c=e.onStartMove,d=e.onStopMove,h=e.onScroll,p=e.horizontal,m=e.spinSize,g=e.containerSize,v=e.style,y=e.thumbStyle,x=e.showScrollBar,w=f.useState(!1),C=(0,s.Z)(w,2),k=C[0],S=C[1],E=f.useState(null),M=(0,s.Z)(E,2),T=M[0],L=M[1],_=f.useState(null),A=(0,s.Z)(_,2),P=A[0],D=A[1],B=!i,j=f.useRef(),I=f.useRef(),R=f.useState(x),O=(0,s.Z)(R,2),Z=O[0],F=O[1],z=f.useRef(),H=function(){!0!==x&&!1!==x&&(clearTimeout(z.current),F(!0),z.current=setTimeout((function(){F(!1)}),3e3))},W=l-g||0,G=g-m||0,V=f.useMemo((function(){return 0===r||0===W?0:r/W*G}),[r,W,G]),q=f.useRef({top:V,dragging:k,pageY:T,startTop:P});q.current={top:V,dragging:k,pageY:T,startTop:P};var U=function(e){S(!0),L(N(e,p)),D(q.current.top),c(),e.stopPropagation(),e.preventDefault()};f.useEffect((function(){var e=function(e){e.preventDefault()},t=j.current,n=I.current;return t.addEventListener("touchstart",e,{passive:!1}),n.addEventListener("touchstart",U,{passive:!1}),function(){t.removeEventListener("touchstart",e),n.removeEventListener("touchstart",U)}}),[]);var K=f.useRef();K.current=W;var Y=f.useRef();Y.current=G,f.useEffect((function(){if(k){var e,t=function(t){var n=q.current,i=n.dragging,r=n.pageY,o=n.startTop;b.Z.cancel(e);var a=j.current.getBoundingClientRect(),s=g/(p?a.width:a.height);if(i){var l=(N(t,p)-r)*s,c=o;!B&&p?c-=l:c+=l;var u=K.current,d=Y.current,f=d?c/d:0,m=Math.ceil(f*u);m=Math.max(m,0),m=Math.min(m,u),e=(0,b.Z)((function(){h(m,p)}))}},n=function(){S(!1),d()};return window.addEventListener("mousemove",t,{passive:!0}),window.addEventListener("touchmove",t,{passive:!0}),window.addEventListener("mouseup",n,{passive:!0}),window.addEventListener("touchend",n,{passive:!0}),function(){window.removeEventListener("mousemove",t),window.removeEventListener("touchmove",t),window.removeEventListener("mouseup",n),window.removeEventListener("touchend",n),b.Z.cancel(e)}}}),[k]),f.useEffect((function(){return H(),function(){clearTimeout(z.current)}}),[r]),f.useImperativeHandle(t,(function(){return{delayHidden:H}}));var X="".concat(n,"-scrollbar"),J={position:"absolute",visibility:Z?null:"hidden"},Q={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return p?(Object.assign(J,{height:8,left:0,right:0,bottom:0}),Object.assign(Q,(0,a.Z)({height:"100%",width:m},B?"left":"right",V))):(Object.assign(J,(0,a.Z)({width:8,top:0,bottom:0},B?"right":"left",0)),Object.assign(Q,{width:"100%",height:m,top:V})),f.createElement("div",{ref:j,className:u()(X,(0,a.Z)((0,a.Z)((0,a.Z)({},"".concat(X,"-horizontal"),p),"".concat(X,"-vertical"),!p),"".concat(X,"-visible"),Z)),style:(0,o.Z)((0,o.Z)({},J),v),onMouseDown:function(e){e.stopPropagation(),e.preventDefault()},onMouseMove:H},f.createElement("div",{ref:I,className:u()("".concat(X,"-thumb"),(0,a.Z)({},"".concat(X,"-thumb-moving"),k)),style:(0,o.Z)((0,o.Z)({},Q),y),onMouseDown:U}))}));function P(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e/t*e;return isNaN(n)&&(n=0),n=Math.max(n,20),Math.floor(n)}var D=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],B=[],j={overflowY:"auto",overflowAnchor:"none"};function I(e,t){var n=e.prefixCls,c=void 0===n?"rc-virtual-list":n,g=e.className,w=e.height,S=e.itemHeight,E=e.fullHeight,I=void 0===E||E,R=e.style,O=e.data,Z=e.children,F=e.itemKey,z=e.virtual,H=e.direction,W=e.scrollWidth,G=e.component,V=void 0===G?"div":G,q=e.onScroll,U=e.onVirtualScroll,K=e.onVisibleChange,Y=e.innerProps,X=e.extraRender,J=e.styles,Q=e.showScrollBar,$=void 0===Q?"optional":Q,ee=(0,l.Z)(e,D),te=f.useCallback((function(e){return"function"==typeof F?F(e):null==e?void 0:e[F]}),[F]),ne=function(e,t,n){var i=f.useState(0),r=(0,s.Z)(i,2),o=r[0],a=r[1],l=(0,f.useRef)(new Map),c=(0,f.useRef)(new M),u=(0,f.useRef)(0);function d(){u.current+=1}function h(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];d();var t=function(){var e=!1;l.current.forEach((function(t,n){if(t&&t.offsetParent){var i=t.offsetHeight,r=getComputedStyle(t),o=r.marginTop,a=r.marginBottom,s=i+T(o)+T(a);c.current.get(n)!==s&&(c.current.set(n,s),e=!0)}})),e&&a((function(e){return e+1}))};if(e)t();else{u.current+=1;var n=u.current;Promise.resolve().then((function(){n===u.current&&t()}))}}return(0,f.useEffect)((function(){return d}),[]),[function(i,r){var o=e(i),a=l.current.get(o);r?(l.current.set(o,r),h()):l.current.delete(o),!a!=!r&&(r?null==t||t(i):null==n||n(i))},h,c.current,o]}(te,null,null),ie=(0,s.Z)(ne,4),re=ie[0],oe=ie[1],ae=ie[2],se=ie[3],le=!(!1===z||!w||!S),ce=f.useMemo((function(){return Object.values(ae.maps).reduce((function(e,t){return e+t}),0)}),[ae.id,ae.maps]),ue=le&&O&&(Math.max(S*O.length,ce)>w||!!W),de="rtl"===H,he=u()(c,(0,a.Z)({},"".concat(c,"-rtl"),de),g),pe=O||B,fe=(0,f.useRef)(),me=(0,f.useRef)(),ge=(0,f.useRef)(),ve=(0,f.useState)(0),ye=(0,s.Z)(ve,2),xe=ye[0],be=ye[1],we=(0,f.useState)(0),Ce=(0,s.Z)(we,2),ke=Ce[0],Se=Ce[1],Ee=(0,f.useState)(!1),Me=(0,s.Z)(Ee,2),Te=Me[0],Le=Me[1],_e=function(){Le(!0)},Ne=function(){Le(!1)},Ae={getKey:te};function Pe(e){be((function(t){var n=function(e){var t=e;Number.isNaN(Je.current)||(t=Math.min(t,Je.current));return t=Math.max(t,0),t}("function"==typeof e?e(t):e);return fe.current.scrollTop=n,n}))}var De=(0,f.useRef)({start:0,end:pe.length}),Be=(0,f.useRef)(),je=x(pe,te),Ie=(0,s.Z)(je,1)[0];Be.current=Ie;var Re=f.useMemo((function(){if(!le)return{scrollHeight:void 0,start:0,end:pe.length-1,offset:void 0};var e;if(!ue)return{scrollHeight:(null===(e=me.current)||void 0===e?void 0:e.offsetHeight)||0,start:0,end:pe.length-1,offset:void 0};for(var t,n,i,r=0,o=pe.length,a=0;a<o;a+=1){var s=pe[a],l=te(s),c=ae.get(l),u=r+(void 0===c?S:c);u>=xe&&void 0===t&&(t=a,n=r),u>xe+w&&void 0===i&&(i=a),r=u}return void 0===t&&(t=0,n=0,i=Math.ceil(w/S)),void 0===i&&(i=pe.length-1),{scrollHeight:r,start:t,end:i=Math.min(i+1,pe.length-1),offset:n}}),[ue,le,xe,pe,se,w]),Oe=Re.scrollHeight,Ze=Re.start,Fe=Re.end,ze=Re.offset;De.current.start=Ze,De.current.end=Fe,f.useLayoutEffect((function(){var e=ae.getRecord();if(1===e.size){var t=Array.from(e.keys())[0],n=e.get(t),i=pe[Ze];if(i&&void 0===n)if(te(i)===t){var r=ae.get(t)-S;Pe((function(e){return e+r}))}}ae.resetRecord()}),[Oe]);var He=f.useState({width:0,height:w}),We=(0,s.Z)(He,2),Ge=We[0],Ve=We[1],qe=(0,f.useRef)(),Ue=(0,f.useRef)(),Ke=f.useMemo((function(){return P(Ge.width,W)}),[Ge.width,W]),Ye=f.useMemo((function(){return P(Ge.height,Oe)}),[Ge.height,Oe]),Xe=Oe-w,Je=(0,f.useRef)(Xe);Je.current=Xe;var Qe=xe<=0,$e=xe>=Xe,et=ke<=0,tt=ke>=W,nt=C(Qe,$e,et,tt),it=function(){return{x:de?-ke:ke,y:xe}},rt=(0,f.useRef)(it()),ot=(0,h.zX)((function(e){if(U){var t=(0,o.Z)((0,o.Z)({},it()),e);rt.current.x===t.x&&rt.current.y===t.y||(U(t),rt.current=t)}}));function at(e,t){var n=e;t?((0,m.flushSync)((function(){Se(n)})),ot()):Pe(n)}var st=function(e){var t=e,n=W?W-Ge.width:0;return t=Math.max(t,0),t=Math.min(t,n)},lt=(0,h.zX)((function(e,t){t?((0,m.flushSync)((function(){Se((function(t){return st(t+(de?-e:e))}))})),ot()):Pe((function(t){return t+e}))})),ct=k(le,Qe,$e,et,tt,!!W,lt),ut=(0,s.Z)(ct,2),dt=ut[0],ht=ut[1];!function(e,t,n){var i,r=(0,f.useRef)(!1),o=(0,f.useRef)(0),a=(0,f.useRef)(0),s=(0,f.useRef)(null),l=(0,f.useRef)(null),c=function(e){if(r.current){var t=Math.ceil(e.touches[0].pageX),i=Math.ceil(e.touches[0].pageY),s=o.current-t,c=a.current-i,u=Math.abs(s)>Math.abs(c);u?o.current=t:a.current=i;var d=n(u,u?s:c,!1,e);d&&e.preventDefault(),clearInterval(l.current),d&&(l.current=setInterval((function(){u?s*=L:c*=L;var e=Math.floor(u?s:c);(!n(u,e,!0)||Math.abs(e)<=.1)&&clearInterval(l.current)}),16))}},u=function(){r.current=!1,i()},d=function(e){i(),1!==e.touches.length||r.current||(r.current=!0,o.current=Math.ceil(e.touches[0].pageX),a.current=Math.ceil(e.touches[0].pageY),s.current=e.target,s.current.addEventListener("touchmove",c,{passive:!1}),s.current.addEventListener("touchend",u,{passive:!0}))};i=function(){s.current&&(s.current.removeEventListener("touchmove",c),s.current.removeEventListener("touchend",u))},(0,p.Z)((function(){return e&&t.current.addEventListener("touchstart",d,{passive:!0}),function(){var e;null===(e=t.current)||void 0===e||e.removeEventListener("touchstart",d),i(),clearInterval(l.current)}}),[e])}(le,fe,(function(e,t,n,i){var r=i;return!nt(e,t,n)&&((!r||!r._virtualHandled)&&(r&&(r._virtualHandled=!0),dt({preventDefault:function(){},deltaX:e?t:0,deltaY:e?0:t}),!0))})),function(e,t,n){f.useEffect((function(){var i=t.current;if(e&&i){var r,o,a=!1,s=function(){b.Z.cancel(r)},l=function e(){s(),r=(0,b.Z)((function(){n(o),e()}))},c=function(){a=!1,s()},u=function(e){if(!e.target.draggable&&0===e.button){var t=e;t._virtualHandled||(t._virtualHandled=!0,a=!0)}},d=function(e){if(a){var t=N(e,!1),n=i.getBoundingClientRect(),r=n.top,c=n.bottom;t<=r?(o=-_(r-t),l()):t>=c?(o=_(t-c),l()):s()}};return i.addEventListener("mousedown",u),i.ownerDocument.addEventListener("mouseup",c),i.ownerDocument.addEventListener("mousemove",d),i.ownerDocument.addEventListener("dragend",c),function(){i.removeEventListener("mousedown",u),i.ownerDocument.removeEventListener("mouseup",c),i.ownerDocument.removeEventListener("mousemove",d),i.ownerDocument.removeEventListener("dragend",c),s()}}}),[e])}(ue,fe,(function(e){Pe((function(t){return t+e}))})),(0,p.Z)((function(){function e(e){var t=Qe&&e.detail<0,n=$e&&e.detail>0;!le||t||n||e.preventDefault()}var t=fe.current;return t.addEventListener("wheel",dt,{passive:!1}),t.addEventListener("DOMMouseScroll",ht,{passive:!0}),t.addEventListener("MozMousePixelScroll",e,{passive:!1}),function(){t.removeEventListener("wheel",dt),t.removeEventListener("DOMMouseScroll",ht),t.removeEventListener("MozMousePixelScroll",e)}}),[le,Qe,$e]),(0,p.Z)((function(){if(W){var e=st(ke);Se(e),ot({x:e})}}),[Ge.width,W]);var pt=function(){var e,t;null===(e=qe.current)||void 0===e||e.delayHidden(),null===(t=Ue.current)||void 0===t||t.delayHidden()},ft=function(e,t,n,i,a,l,c,u){var d=f.useRef(),h=f.useState(null),m=(0,s.Z)(h,2),g=m[0],v=m[1];return(0,p.Z)((function(){if(g&&g.times<10){if(!e.current)return void v((function(e){return(0,o.Z)({},e)}));l();var r=g.targetAlign,s=g.originAlign,u=g.index,d=g.offset,h=e.current.clientHeight,p=!1,f=r,m=null;if(h){for(var y=r||s,x=0,b=0,w=0,C=Math.min(t.length-1,u),k=0;k<=C;k+=1){var S=a(t[k]);b=x;var E=n.get(S);x=w=b+(void 0===E?i:E)}for(var M="top"===y?d:h-d,T=C;T>=0;T-=1){var L=a(t[T]),_=n.get(L);if(void 0===_){p=!0;break}if((M-=_)<=0)break}switch(y){case"top":m=b-d;break;case"bottom":m=w-h+d;break;default:var N=e.current.scrollTop;b<N?f="top":w>N+h&&(f="bottom")}null!==m&&c(m),m!==g.lastTop&&(p=!0)}p&&v((0,o.Z)((0,o.Z)({},g),{},{times:g.times+1,targetAlign:f,lastTop:m}))}}),[g,e.current]),function(e){if(null!=e){if(b.Z.cancel(d.current),"number"==typeof e)c(e);else if(e&&"object"===(0,r.Z)(e)){var n,i=e.align;n="index"in e?e.index:t.findIndex((function(t){return a(t)===e.key}));var o=e.offset;v({times:0,index:n,offset:void 0===o?0:o,originAlign:i})}}else u()}}(fe,pe,ae,S,te,(function(){return oe(!0)}),Pe,pt);f.useImperativeHandle(t,(function(){return{nativeElement:ge.current,getScrollInfo:it,scrollTo:function(e){var t;(t=e)&&"object"===(0,r.Z)(t)&&("left"in t||"top"in t)?(void 0!==e.left&&Se(st(e.left)),ft(e.top)):ft(e)}}})),(0,p.Z)((function(){if(K){var e=pe.slice(Ze,Fe+1);K(e,pe)}}),[Ze,Fe,pe]);var mt=function(e,t,n,i){var r=f.useMemo((function(){return[new Map,[]]}),[e,n.id,i]),o=(0,s.Z)(r,2),a=o[0],l=o[1];return function(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,s=a.get(r),c=a.get(o);if(void 0===s||void 0===c)for(var u=e.length,d=l.length;d<u;d+=1){var h,p=e[d],f=t(p);a.set(f,d);var m=null!==(h=n.get(f))&&void 0!==h?h:i;if(l[d]=(l[d-1]||0)+m,f===r&&(s=d),f===o&&(c=d),void 0!==s&&void 0!==c)break}return{top:l[s-1]||0,bottom:l[c]}}}(pe,te,ae,S),gt=null==X?void 0:X({start:Ze,end:Fe,virtual:ue,offsetX:ke,offsetY:ze,rtl:de,getSize:mt}),vt=function(e,t,n,i,r,o,a,s){var l=s.getKey;return e.slice(t,n+1).map((function(e,n){var s=a(e,t+n,{style:{width:i},offsetX:r}),c=l(e);return f.createElement(y,{key:c,setRef:function(t){return o(e,t)}},s)}))}(pe,Ze,Fe,W,ke,re,Z,Ae),yt=null;w&&(yt=(0,o.Z)((0,a.Z)({},I?"height":"maxHeight",w),j),le&&(yt.overflowY="hidden",W&&(yt.overflowX="hidden"),Te&&(yt.pointerEvents="none")));var xt={};return de&&(xt.dir="rtl"),f.createElement("div",(0,i.Z)({ref:ge,style:(0,o.Z)((0,o.Z)({},R),{},{position:"relative"}),className:he},xt,ee),f.createElement(d.Z,{onResize:function(e){Ve({width:e.offsetWidth,height:e.offsetHeight})}},f.createElement(V,{className:"".concat(c,"-holder"),style:yt,ref:fe,onScroll:function(e){var t=e.currentTarget.scrollTop;t!==xe&&Pe(t),null==q||q(e),ot()},onMouseEnter:pt},f.createElement(v,{prefixCls:c,height:Oe,offsetX:ke,offsetY:ze,scrollWidth:W,onInnerResize:oe,ref:me,innerProps:Y,rtl:de,extra:gt},vt))),ue&&Oe>w&&f.createElement(A,{ref:qe,prefixCls:c,scrollOffset:xe,scrollRange:Oe,rtl:de,onScroll:at,onStartMove:_e,onStopMove:Ne,spinSize:Ye,containerSize:Ge.height,style:null==J?void 0:J.verticalScrollBar,thumbStyle:null==J?void 0:J.verticalScrollBarThumb,showScrollBar:$}),ue&&W>Ge.width&&f.createElement(A,{ref:Ue,prefixCls:c,scrollOffset:ke,scrollRange:W,rtl:de,onScroll:at,onStartMove:_e,onStopMove:Ne,spinSize:Ke,containerSize:Ge.width,horizontal:!0,style:null==J?void 0:J.horizontalScrollBar,thumbStyle:null==J?void 0:J.horizontalScrollBarThumb,showScrollBar:$}))}var R=f.forwardRef(I);R.displayName="List";var O=R},93314:function(e){"use strict";e.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(e,t,n){"use strict";n.d(t,{Z:function(){return c}});const i=e=>"object"==typeof e&&null!=e&&1===e.nodeType,r=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,o=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const n=getComputedStyle(e,null);return r(n.overflowY,t)||r(n.overflowX,t)||(e=>{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},a=(e,t,n,i,r,o,a,s)=>o<e&&a>t||o>e&&a<t?0:o<=e&&s<=n||a>=t&&s>=n?o-e-i:a>t&&s<n||o<e&&s>n?a-t+r:0,s=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t},l=(e,t)=>{var n,r,l,c;if("undefined"==typeof document)return[];const{scrollMode:u,block:d,inline:h,boundary:p,skipOverflowHiddenElements:f}=t,m="function"==typeof p?p:e=>e!==p;if(!i(e))throw new TypeError("Invalid target");const g=document.scrollingElement||document.documentElement,v=[];let y=e;for(;i(y)&&m(y);){if(y=s(y),y===g){v.push(y);break}null!=y&&y===document.body&&o(y)&&!o(document.documentElement)||null!=y&&o(y,f)&&v.push(y)}const x=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,b=null!=(c=null==(l=window.visualViewport)?void 0:l.height)?c:innerHeight,{scrollX:w,scrollY:C}=window,{height:k,width:S,top:E,right:M,bottom:T,left:L}=e.getBoundingClientRect(),{top:_,right:N,bottom:A,left:P}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let D="start"===d||"nearest"===d?E-_:"end"===d?T+A:E+k/2-_+A,B="center"===h?L+S/2-P+N:"end"===h?M+N:L-P;const j=[];for(let e=0;e<v.length;e++){const t=v[e],{height:n,width:i,top:r,right:s,bottom:l,left:c}=t.getBoundingClientRect();if("if-needed"===u&&E>=0&&L>=0&&T<=b&&M<=x&&(t===g&&!o(t)||E>=r&&T<=l&&L>=c&&M<=s))return j;const p=getComputedStyle(t),f=parseInt(p.borderLeftWidth,10),m=parseInt(p.borderTopWidth,10),y=parseInt(p.borderRightWidth,10),_=parseInt(p.borderBottomWidth,10);let N=0,A=0;const P="offsetWidth"in t?t.offsetWidth-t.clientWidth-f-y:0,I="offsetHeight"in t?t.offsetHeight-t.clientHeight-m-_:0,R="offsetWidth"in t?0===t.offsetWidth?0:i/t.offsetWidth:0,O="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(g===t)N="start"===d?D:"end"===d?D-b:"nearest"===d?a(C,C+b,b,m,_,C+D,C+D+k,k):D-b/2,A="start"===h?B:"center"===h?B-x/2:"end"===h?B-x:a(w,w+x,x,f,y,w+B,w+B+S,S),N=Math.max(0,N+C),A=Math.max(0,A+w);else{N="start"===d?D-r-m:"end"===d?D-l+_+I:"nearest"===d?a(r,l,n,m,_+I,D,D+k,k):D-(r+n/2)+I/2,A="start"===h?B-c-f:"center"===h?B-(c+i/2)+P/2:"end"===h?B-s+y+P:a(c,s,i,f,y+P,B,B+S,S);const{scrollLeft:e,scrollTop:o}=t;N=0===O?0:Math.max(0,Math.min(o+N/O,t.scrollHeight-n/O+I)),A=0===R?0:Math.max(0,Math.min(e+A/R,t.scrollWidth-i/R+P)),D+=o-N,B+=e-A}j.push({el:t,top:N,left:A})}return j};function c(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;const n=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>"object"==typeof e&&"function"==typeof e.behavior)(t))return t.behavior(l(e,t));const i="boolean"==typeof t||null==t?void 0:t.behavior;for(const{el:r,top:o,left:a}of l(e,(e=>!1===e?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&0!==Object.keys(e).length)(e)?e:{block:"start",inline:"nearest"})(t))){const e=o-n.top+n.bottom,t=a-n.left+n.right;r.scroll({top:e,left:t,behavior:i})}}}}]); |