|
|
(self.webpackChunk=self.webpackChunk||[]).push([[257],{70746: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,u=null,c=0;c<arguments.length;c++){var h=arguments[c];if(null!==h)switch(_typeof(h)){case"number":t=h.toFixed(1);break;case"string":h.match(new RegExp("^[0-9]\\.[0-9]+$"))?t=h:a=h;break;case"object":void 0!==h.is3D?i=h:n=h;break;case"boolean":r=h,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 d="",f=!1,p=null,m=null,v=null,g=!1,y=null,b=null,x=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 _(){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){u=e,O(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){x=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 u=arguments[l];"string"==typeof u?(u=u.toLowerCase()).match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?r=u:o=arguments[l]:"boolean"==typeof u?a=u:u instanceof HTMLElement&&(i=u)}function c(){if(s){r=N(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),p=r,"screenshot"===r)T(l,n);else{var u=!1;n.hasOwnProperty("playButton")&&n.playButton||n.hasOwnProperty("clickToLoad")&&n.clickToLoad?u=!0:n.hasOwnProperty("playButtonAutoDecide")&&n.playButtonAutoDecide&&(u=(!_()||t())&&k()),u?(p="screenshot",D(l,n,a,r)):A(l,n,a)}else console.log("possibly bug on ajax loading? ")}else setTimeout(c,200)}c()},e.getViews=function(){return i},e.isJavaInstalled=function(){return!1};var C=function(t){var r=function(){n.onError&&n.onError(),F("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";E("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,S(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 S(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 E(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 p},e.setPreviewImage=function(e,t,n){y=e,b=t,n},e.removeExistingApplet=function(e,t){var i;"string"==typeof e&&(e=document.getElementById(e)),p=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",p="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 L=function(e){return e&&"false"!==e},A=function(t,n,i){w(m)<=4.2&&(i=!0);var r=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==m||ggbHTML5LoadedCodebaseIsWebSimple&&!g)&&(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)L(n.showToolBar)&&(n.height-=7),L(n.showAlgebraInput)&&(n.height-=37),n.width<605&&L(n.showToolBar)&&(n.width=605,a=605);else{var c=100;(L(n.showToolBar)||L(n.showMenuBar))&&(n.hasOwnProperty("customToolBar")&&(n.customToolbar=n.customToolBar),c=L(n.showMenuBar)?245:155),a<c&&(n.width=c,a=c)}for(var h in o.style.border="none",o.style.display="inline-block",n)n.hasOwnProperty(h)&&"appletOnLoad"!==h&&o.setAttribute("data-param-"+h,n[h]);x&&o.setAttribute("data-param-fontscssurl",x),e.resize=function(){GGBAppletUtils.responsiveResize(t,n)},window.addEventListener("resize",(function(t){e.resize()}));var f="function"==typeof n.appletOnLoad?n.appletOnLoad:function(){};if(i||void 0===n.width){var p=document.createElement("div");p.className="applet_scaler",p.style.position="relative",p.style.display="block",p.appendChild(o),t.appendChild(p),n.appletOnLoad=function(t){e.resize(),f(t)}}else{n.hasOwnProperty("showSplash")||o.setAttribute("data-param-showSplash","false");var y=t.querySelector(".applet_scaler.prerender"),b=null!==y;if(b)_=y.querySelector(".ggb_preview");else{var _=B(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"),f(e)},b||y.appendChild(_)):o.appendChild(_),y.appendChild(o),b||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),F("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",t)}function C(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 S=0;S<o.childNodes.length;S++){"TABLE"===o.childNodes[S].tagName&&(o.removeChild(o.childNodes[S]),S--)}if(null!==ggbHTML5LoadedScript){var E=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');null!=E&&E.parentNode.removeChild(E)}var A=document.createElement("script"),T=function(){C(o,n)};A.src=d+v,ggbHTML5LoadedCodebaseIsWebSimple=g,ggbHTML5LoadedCodebaseVersion=m,ggbHTML5LoadedScript=A.src,F("GeoGebra HTML5 codebase loaded: '"+d+"'.",n),u||l&&"5.0"!=l?d.requirejs?__webpack_require__.e(5575).then(function(){var e=[__webpack_require__(15575)];T.apply(null,e)}.bind(this)).catch(__webpack_require__.oe):(A.onload=T,t.appendChild(A)):(g?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),T())}else C(o,n);n.height=s,n.width=a},T=function(t,n,i){var r=B(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(R()),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(){M(t,r,o,i)},window.addEventListener("resize",(function(t){e.resize()})),e.resize()};function M(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 D=function(e,t,n,i){T(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"))):A(r,t,!1),window.GGBT_wsf_view.launchFullScreen(o)}else p=i,A(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()},R=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},B=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,u=document.createElement("img");if((u.style.position="relative",u.style.zIndex="1000",u.style.top="-1px",u.style.left="-1px",null!==y&&u.setAttribute("src",y),u.style.opacity=.7,null!==b)&&!i){(a=document.createElement("img")).style.position="absolute",a.style.zIndex="1001",a.style.opacity=1,u.style.opacity=.3,(s=360)>e/4*3&&(s=e/4*3),l=s/5.8,a.setAttribute("src",b),a.setAttribute("width",s),a.setAttribute("height",l);var c=(e-s)/2,h=(t-l)/2;a.style.left=c+"px",a.style.top=h+"px",r.appendChild(a)}return r.appendChild(u),r},N=function(e){return"html5"===(e=e.toLowerCase())||"screenshot"===e?e:"html5"},P=["web","webSimple","web3d","tablet","tablet3d","phone"],I=function(e,t){if(m=e,t)O(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 u=m.indexOf("//");for(var c in a=u>0?m:0===u?o+m:"https://www.geogebra.org/apps/5.2.814.0/",P)if(m.slice(-1*P[c].length)===P[c]||m.slice(-1*(P[c].length+1))===P[c]+"/")return void O(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||L(n.showToolBar)||L(n.showMenuBar)||L(n.showAlgebraInput)||L(n.enableRightClick)||n.appName&&"classic"!=n.appName?a+="web3d/":a+="webSimple/",O(a,!1)}},O=function(e,t){if(e.requirejs)d=e;else{"/"!==e.slice(-1)&&(e+="/"),d=e,null===t&&(t=-1===e.indexOf("http")),f=t,v="web.nocache.js",g=!1;var n=d.split("/");n.length>1&&(t||"webSimple"!==n[n.length-2]?P.indexOf(n[n.length-2])>=0&&(v=n[n.length-2]+".nocache.js"):(v="webSimple.nocache.js",g=!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))}},F=function(e,t){window.console&&window.console.log&&(!t||void 0===t.showLogging||t.showLogging&&"false"!==t.showLogging)&&console.log(e)};function j(){var e=t;null!==l?e=l:parseFloat(e)<5&&(e="5.0"),I(e,!1),null!==u&&O(u,f),s=!0}return void 0!==n.material_id?C(j):j(),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,u=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,u=0,c=0,h=0,d=0,f=0,p=0;if(a)l=a.offsetWidth,u=Math.max(i?a.offsetWidth:0,a.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(l=Math.min(window.innerWidth,document.documentElement.clientWidth),u=Math.min(window.innerHeight,document.documentElement.clientHeight),c=l):(l=window.innerWidth,u=window.innerHeight,c=window.innerWidth),e){var m=e.getBoundingClientRect();m.left>0&&m.left<=l&&(void 0===r||!r)&&("rtl"===document.dir?(d=l-m.width-m.left,f=c<=480?10:30):(f=m.left,d=c<=480?10:30),h=f+d)}e&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(e.getBoundingClientRect(),"closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(h=40,p=0):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(h=0,p=40))}return e&&((void 0===n||!n)&&t>0&&t+h<l?l=t:l-=h,"object"!==_typeof(window.GGBT_wsf_view)||!window.GGBT_wsf_view.isFullscreen()||void 0!==n&&n||(u-=p)),{width:l,height:u}}(t,e.width,n,l,a&&window.GGBT_wsf_view||s,r),c=parseInt(u.width),h=e.width,d=e.height;if(void 0===h){var f=t.querySelector(".appletParameters");f&&(h=f.offsetWidth,d=f.offsetHeight)}var p=c/h,m=a?1:u.height/d;return void 0===n||n||(p=Math.min(1,p),m=Math.min(1,m)),Math.min(p,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,u=0;u<n.childNodes.length;u++)if(void 0!==n.childNodes[u].className&&n.childNodes[u].className.match(/^applet_scaler/)){l=n.childNodes[u];break}if(null!==l&&null!==l.querySelector(".noscale"))return;var c=void 0!==o.id?o.id:"ggbApplet",h=window[c];null!=h&&h.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")})()},22065: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(51200).Z.API_SERVER},32110:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var i=n(7557),r=n.n(i),o=n(41498),a=n.n(o),s=n(79800),l=n.n(s),u=n(59301),c="imageDimensions___a7crR",h="img___Kroat",d="fullWidth___c492T",f=n(92310),p=n.n(f),m=n(29787),v=n(2859),g=n(87281),y=n(30406),b=n(37712),x=function(e){var t=e.data,n=e.className,i=e.fullWidth,o=e.style,s=void 0===o?{}:o,f=e.onClose,x=e.onOk,w=e.showFullTools,_=e.noAssociationId,k=(0,u.useRef)(null),C=(0,u.useRef)(null),S=(0,u.useRef)(null),E=(0,u.useRef)(null),L=(0,u.useState)(!1),A=l()(L,2),T=A[0],M=A[1],D=(0,u.useState)("正在加载中"),R=l()(D,2),B=R[0],N=R[1];(0,u.useEffect)((function(){return S.current||(S.current=document.createElement("style"),document.head.appendChild(S.current)),null!=t&&t.visible?(document.body.setAttribute("data-custom","y-hidden"),S.current.innerHTML=" html { overflow-y: hidden; }",null!=t&&t.src&&P()):(document.body.removeAttribute("data-custom"),S.current&&(document.head.removeChild(S.current),S.current=null)),function(){document.body.removeAttribute("data-custom"),S.current&&(document.head.removeChild(S.current),S.current=null)}}),[null==t?void 0:t.visible]);var P=function(){var e=a()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return M(!0),N("正在加载中"),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(){O()},M(!1),N("");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 M(!0),N("正在保存中"),e.next=4,(0,g.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||_){e.next=12;break}return e.next=8,(0,g.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&&x(),e.next=13;break;case 12:null!=i&&i.id&&x(i);case 13:M(!1),N("");case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),O=function(){C.current=new v.hP(k.current),C.current.targetRoot=E.current,C.current.addEventListener("render",I),C.current.addEventListener("beforeclose",f),w&&(C.current.availableMarkerTypes=C.current.ALL_MARKER_TYPES,C.current.uiStyleSettings.redoButtonVisible=!0,C.current.uiStyleSettings.notesButtonVisible=!0,C.current.uiStyleSettings.zoomButtonVisible=!0,C.current.uiStyleSettings.zoomOutButtonVisible=!0,C.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=C.current.uiStyleSettings,C.current.show(),null!=t&&t.snapshotData&&C.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,b.jsx)(u.Fragment,{children:(null==t?void 0:t.visible)&&(0,b.jsx)(m.Z,{spinning:T,tip:B,style:{position:"absolute",width:"100vw"},children:(0,b.jsx)("div",{ref:E,className:p()(c,n,i?d:""),style:s,children:(0,b.jsx)("img",{className:h,ref:k})})})})}},90786:function(e,t,n){"use strict";var i=n(59301),r=n(77019),o=n(5269),a=n(20554),s=n(99571),l=n(83449),u=n(40862),c=(n(48136),n(37712)),h=(0,i.forwardRef)((function(e,t){var n=e.callback,h=e.showSaveButton,d=e.value,f=void 0===d?"":d,p=(0,i.useRef)(),m=function(e){p.current.setValue(p.current.getValue()+" "+e.value+" ")},v=[{key:"1",label:"快捷模板",children:(0,c.jsx)(r.Z,{className:u.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,c.jsxs)(o.Z,{flex:"110px",className:u.Z.item,children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(l.Z,{value:"$$".concat(e.value,"$$")}),e.name]}),(0,c.jsx)("div",{className:u.Z.children,children:e.children.map((function(e,t){return(0,c.jsxs)("div",{children:[(0,c.jsx)("h1",{children:e.name}),(0,c.jsx)(r.Z,{gutter:[10,10],children:e.data.map((function(e,t){return(0,c.jsx)(o.Z,{onClick:function(){return m(e)},className:u.Z.diamond,children:(0,c.jsx)(l.Z,{value:"`$$"+e.value+"$$`"})},t)}))})]},t)}))})]})}))})},{key:"2",label:"公式模板",children:(0,c.jsx)(r.Z,{className:u.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,c.jsxs)(o.Z,{flex:"110px",className:u.Z.item,children:[(0,c.jsxs)("div",{children:[(0,c.jsx)(l.Z,{value:"`$$"+e.value+"$$`"}),e.name]}),(0,c.jsx)("div",{className:u.Z.children,children:e.children.map((function(e,t){return(0,c.jsxs)("div",{children:[e.name&&(0,c.jsx)("h1",{children:e.name}),(0,c.jsx)(r.Z,{gutter:[10,10],children:e.data.map((function(e,t){return(0,c.jsx)(o.Z,{onClick:function(){return m(e)},className:u.Z.diamond,children:(0,c.jsx)(l.Z,{value:"`$$"+e.value+"$$`"})},t)}))})]},t)}))})]})}))})}],g=function(){var e=document.createElement("div");e.innerHTML=p.current.getValue();var t=e.innerText;return n&&n(t),t};return(0,i.useImperativeHandle)(t,(function(){return{getData:g}})),(0,c.jsxs)("div",{className:u.Z.mathWrap,children:[(0,c.jsx)(a.Z,{defaultActiveKey:"1",items:v}),(0,c.jsx)("math-field",{locale:"zh_cn",className:u.Z.mathField,placeholder:"请打开键盘,输入公式",ref:p,style:{width:800,marginTop:30,fontSize:18},children:f||""}),h&&(0,c.jsx)("div",{className:u.Z.button,children:(0,c.jsx)(s.ZP,{size:"large",onClick:g,style:{zIndex:8,marginTop:10},type:"primary",children:"保存到编辑器"})})]})}));t.Z=h},37286: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,u=void 0===l?{}:l,c=e.customText,h=e.ButtonText,d=e.ButtonClick,f=e.Buttonclass,p=e.ButtonTwo,m=e.imgStyles,v=e.loading,g=void 0!==v&&v,y=e.className,b=void 0===y?"":y;return(0,s.jsxs)("section",{className:"tc animated fadeIn ".concat(b),style:r()({color:"#999",margin:"100px auto",visibility:g?"hidden":"visible"},u),children:[(0,s.jsx)("img",{src:t||o,style:r()(r()({},m),{},{pointerEvents:"none",userSelect:"none"})}),(0,s.jsx)("p",{className:"mt20 font14",children:c||"暂时还没有相关数据哦!"}),h&&(0,s.jsx)(a.ZP,r()(r()({className:f,onClick:d},i),{},{children:h})),p&&p]})}},92216: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),u=n(79800),c=n.n(u),h=n(59301),d={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},f=n(99571),p=n(70557),m=n(50062),v=n(25399),g=n(30406),y=n(62928),b=n(37286),x=n(51200),w=n(12116),_=n(37712),k=function(e){var t,n,i,o,s,u,k=e.editOffice,C=void 0===k?"view":k,S=e.data,E=e.issaver,L=e.onSaver,A=(e.theme,e.type),T=e.filename,M=e.monacoEditor,D=e.className,R=e.style,B=e.close,N=e.onClose,P=e.hasMask,I=e.disabledDownload,O=e.onImgDimensions,F=e.showNodata,j=e.recordInfo,z=(0,h.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),H=c()(z,2),W=(H[0],H[1],(0,h.useState)("")),G=c()(W,2),U=(G[0],G[1]),Z=(0,h.useState)(),V=c()(Z,2),q=V[0],K=V[1],Y="build"===window.ENV?"/react/build":"",X=location.host.startsWith("localhost")?x.Z.PROXY_SERVER:x.Z.API_SERVER,J=(0,h.useRef)();null!==(t=S)&&void 0!==t&&t.startsWith("/api")&&"txt"!==A&&(S=x.Z.API_SERVER+S);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&&(L(t.data.data),window.removeEventListener("message",Q,!1)),console.log("mess---:",t.data);case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}T&&M&&(M.filename=T),(0,h.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]&&U(t[1])}))}),[]),(0,h.useEffect)((function(){var e;"office"===A&&(S.indexOf("bigfilescdn.")>-1||S.indexOf("bigfiles1")>-1?K({url:S,fileType:(e=S,e.substring(e.lastIndexOf("/")+1).split(".").pop()),model:S.indexOf("model=edit")?"edit":"view"}):ee())}),[A,S]);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:",S),t=S,S.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(){S.startsWith("http")||S.startsWith("blob:")?ne():(0,g.Sv)(T||"educoder",S,T)},ne=function(){j&&(0,w.fc)({id:null==j?void 0:j.id,watch_type:1,course_id:null==j?void 0:j.course_id}),(0,g.Nd)(T||"educoder",decodeURIComponent(S))};return(0,_.jsxs)("div",{style:r()({},R||{}),className:"".concat(P&&d.bgBlack," ").concat(A?d.wrp:"hide"),children:[B&&(0,_.jsxs)("div",{className:d.close,ref:J,children:[!!O&&(0,_.jsx)(v.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return J.current},children:(0,_.jsx)("span",{onClick:function(){N(),O()},children:(0,_.jsx)("i",{className:"icon-yulanpizhu"})})}),!I&&(0,_.jsx)(v.Z,{title:"点击下载此文件",getPopupContainer:function(){return J.current},children:(0,_.jsx)("span",{onClick:ne,children:(0,_.jsx)("i",{className:"icon-quxiaozhiding"})})}),E&&(0,_.jsx)(v.Z,{title:"保存pdf并退出",getPopupContainer:function(){return J.current},children:(0,_.jsx)("span",{className:"",onClick:function(){var e=document.getElementById("pdfiframe");window.addEventListener("message",Q,!1),setTimeout((function(){e.contentWindow.postMessage("getData","*")}),300)},children:(0,_.jsx)("i",{className:"icon-baocun"})})}),(0,_.jsx)(v.Z,{title:"关闭",getPopupContainer:function(){return J.current},children:(0,_.jsx)("span",{className:"",onClick:function(){N()},children:(0,_.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,_.jsx)("div",{className:"".concat(d[D]," ").concat(D," ").concat(d.monaco," ").concat("txt"===A?"show":"hide"),children:"txt"===A&&(0,_.jsx)(_.Fragment,{children:(0,_.jsx)(m.ZP,r()({},M))})}),"audio"===A&&(0,_.jsx)("audio",{src:"".concat((null===(n=S)||void 0===n?void 0:n.indexOf("http://"))>-1||(null===(i=S)||void 0===i?void 0:i.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(S),autoPlay:!0}),"video"===A&&(0,_.jsx)(_.Fragment,{children:(null===(o=S)||void 0===o?void 0:o.indexOf("http"))>-1?(0,_.jsx)("video",{controls:!0,src:"".concat(S),autoPlay:!0}):(0,_.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(S),autoPlay:!0})}),"office"===A&&q&&(0,_.jsx)("iframe",{src:"".concat(Y,"/office.html?key=").concat(q.key,"&url=").concat(btoa(q.url),"&callbackUrl=").concat(X+(q.callbackUrl||""),"&fileType=").concat(q.fileType,"&title=").concat(q.title||"","&model=").concat(C,"&officeServer=").concat(x.Z.ONLYOFFICE,"&disabledDownload=").concat(!!I)}),"html"===A&&(0,_.jsx)("iframe",{src:S+"&disposition=inline"}),"pdf"===A&&(0,_.jsx)("iframe",{id:"pdfiframe",src:"".concat(Y,"/js/pdfview/index.html?filename=").concat(T||"educoder.pdf","&url=").concat(encodeURIComponent(S),"&disabledDownload=").concat(!!I,"&model=").concat(C)}),"image"===A&&(0,_.jsx)("img",{src:"".concat((null===(s=S)||void 0===s?void 0:s.indexOf("http://"))>-1||(null===(u=S)||void 0===u?void 0:u.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(S)}),("other"===A||"download"===A)&&(0,_.jsx)(_.Fragment,{children:F?(0,_.jsx)(b.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,_.jsx)(f.ZP,{icon:(0,_.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:te,disabled:I,children:"下载"})}):(0,_.jsxs)(f.ZP,{type:"primary",size:"middle",onClick:te,disabled:I,children:[(0,_.jsx)(p.Z,{}),"点击下载"]})}),"flowChart"===A&&(0,_.jsx)("div",{className:"embed",children:(0,_.jsx)("iframe",{src:"/drawio/src/main/webapp/viewer.html?id=".concat(S||"","&gapi=0&od=0&db=0&gh=0&gl=0"),width:"100%",height:"100%",frameBorder:"0"})})]})}},83449:function(e,t,n){"use strict";n.d(t,{z:function(){return A},Z:function(){return T}});var i=n(82242),r=n.n(i),o=n(37205),a=n.n(o),s=n(91232),l=n.n(s),u=n(79800),c=n.n(u),h=n(59301),d=(n(54196),n(8426)),f=(n(64018),n(80360)),p=n(51200),m=n(30406),v=n(15342),g=n(77736),y=n(99571),b=n(1012),x=n(92216),w=n(37712),_=function(e){var t=e.html,n=(0,h.useRef)(null),i=(0,h.useRef)(null);return(0,h.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,h.useEffect)((function(){i.current&&(i.current.innerHTML=t)}),[t]),(0,w.jsx)("div",{ref:n})};var k="mdBody___raKXb",C="button___Ch5Pc",S="previewFlowChart___vY1dq",E="@▁@",L=/<pre[^>]*>/g;var A=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 p.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 p.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 p.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'"'+p.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"("+p.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")},T=function(e){var t=e.value,n=void 0===t?"":t,i=e.edit,o=void 0!==i&&i,s=e.className,u=e.showTextOnly,m=e.showLines,A=e.style,T=void 0===A?{}:A,M=e.stylesPrev,D=void 0===M?{}:M,R=e.highlightKeywords,B=e.showProgramFill,N=(e.isProgramFill,e.disabledFill),P=void 0!==N&&N,I=e.programFillValue,O=e.openEditor,F=void 0===O?function(){}:O,j=e.onFillChange,z=void 0===j?function(e){}:j,H=e.onFillBlur,W=void 0===H?function(){}:H,G=e.onFillFocus,U=void 0===G?function(){}:G,Z=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||"")),V=(0,h.useRef)(),q=(0,h.useRef)(),K=(0,h.useState)(""),Y=c()(K,2),X=Y[0],J=Y[1],Q=(0,h.useState)("office"),$=c()(Q,2),ee=$[0],te=$[1],ne=(0,h.useState)([]),ie=c()(ne,2),re=ie[0],oe=ie[1],ae=(0,h.useRef)("a"+(0,b.Z)()),se={},le=function(e){return/<style[\s\S]*?>/i.test(e||"")};var ue=function(e){return!u&&le(Z)?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>")}))},ce=(0,h.useMemo)((function(){try{Z=Z.replace(/\(\/attachments\/download\//g,"("+p.Z.API_SERVER+"/attachments/download/").replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,"("+p.Z.API_SERVER+"/api/attachments/").replace(/\"\/api\/attachments\/|\"\/attachments\/download\//g,'"'+p.Z.API_SERVER+"/api/attachments/").replace(/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,'"'+p.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"),V.current.style.display="none"}catch(e){}if(B){var e=-1;return Z=Z.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,(function(t,n,i){var r;return function(e,t,n){var i=document.createElement(e===E?"input":"textarea");i.style.width="100%",i.style.height=e===E?"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===E?"":"show",'" style="width:').concat(e===E?"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(ue(Z||""),"</pre>")}var t=ue(Z);t=(0,d.ZP)(t);var n=(0,d.ez)();Z.match(/\[TOC\]/)&&(t=t.replace("<p>[TOC]</p>",(0,d.Qv)()),(0,d.Iy)()),t=t.replace(/(__special_katext_id_\d+__)/g,(function(e,t){var i=n[t],r=i.type,o=i.expression;return(0,v.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,d.AL)();var i=document.createElement("div");return i.innerHTML=t,u?i.innerText:R?(pe(i,R.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),i.innerHTML):(setTimeout((function(){return ge()}),500),i.innerHTML)}),[Z,R]);(0,h.useEffect)((function(){me.current&&me.current.querySelectorAll(["input","textarea"]).forEach((function(e){e.oninput=he,e.onblur=de,e.onfocus=fe}))}),[re]),(0,h.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=c()(e.value,2),u=s[0],h=s[1];h.value=(null==I||null===(r=I[u])||void 0===r?void 0:r.value)||"","warning"===(null==I||null===(o=I[u])||void 0===o?void 0:o.type)?h.className="program-fill-warning":"success"===(null==I||null===(a=I[u])||void 0===a?void 0:a.type)?h.className="program-fill-success":h.className=""}}catch(e){i.e(e)}finally{i.f()}var d,f=l()(t.entries());try{for(f.s();!(d=f.n()).done;){var p,m,v=c()(d.value,2),g=v[0];v[1].innerHTML=null!=I&&null!==(p=I[g])&&void 0!==p&&p.score?"".concat(null==I||null===(m=I[g])||void 0===m?void 0:m.score,"分"):""}}catch(e){f.e(e)}finally{f.f()}oe(I)}catch(e){console.log(e,"error")}}),[I]);var 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)),z(re,e.target.dataset.id)},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)),W(re,e.target.dataset.id)},fe=function(e){re[e.target.dataset.id]=re[e.target.dataset.id]||{},re[e.target.dataset.id].value=e.target.value,oe(a()(re)),U(re,e.target.dataset.id)};function pe(e,t){return e.childNodes.forEach((function(e){if(e.childNodes.length>0)pe(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,h.useRef)();function ve(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)}}}d.jb.WebkitLineClamp=m,m&&(T=r()(r()({},T),d.jb));var ge=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(f.ZP.isSupported()){var t=new f.ZP;t.loadSource(e.src),t.attachMedia(e)}}))};(0,h.useEffect)((function(){if(me.current&&ce&&ce.match(L)&&window.PR.prettyPrint(),me.current)return me.current.addEventListener("click",ve),function(){var e;null===(e=me.current)||void 0===e||e.removeEventListener("click",ve),(0,d.AL)(),(0,d.Iy)()}}),[ce,me.current,ve]);return(0,h.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(){V.current.style.display="none"},children:[u&&(0,w.jsx)("div",{ref:me,className:"".concat(k," "),children:ce}),!u&&!le(ce)&&(0,w.jsx)("div",{ref:me,style:r()({},T),onMouseOver:function(e){"IMG"===e.target.nodeName&&e.target.className.indexOf("draw-flowchart")>-1?(V.current.style.zIndex=1,V.current.style.display="flex",V.current.style.width=e.target.clientWidth+"px",V.current.style.height=e.target.clientHeight+"px",V.current.style.top=e.target.offsetTop+"px",V.current.style.left=e.target.offsetLeft+"px",e.target.id&&(q.current=e.target.id)):V.current.style.display="none"},className:"".concat(s||""," ").concat(P?"disabled-fill":""," markdown-body ").concat(k," ").concat(ae.current),dangerouslySetInnerHTML:{__html:ce}}),!u&&le(ce)&&(0,w.jsx)(_,{html:ce}),(0,w.jsx)("div",{ref:V,className:"".concat(C," ").concat(o?"":S),children:(0,w.jsx)(g.Z,{children:(0,w.jsx)(y.ZP,{onClick:function(){o?F(q.current):(J(q.current),te("flowChart"))},children:o?"编辑":"预览"})})}),(0,w.jsx)(x.Z,{close:!0,data:X,type:null!=X&&X.length?ee:"",style:r()({},D),onClose:function(){return J("")}})]})}},51572:function(e,t,n){"use strict";n.d(t,{Z:function(){return k}});var i=n(79800),r=n.n(i),o=n(7557),a=n.n(o),s=n(41498),l=n.n(s),u=n(59301),c=n(6767),h=n(75727),d=n(79921),f=n(80360),p=n(40189),m=n(56102),v=n(16993),g={watermark:"watermark___hNYlv",videovideo:"videovideo___ovOkV",animate__loop:"animate__loop___mvL6s",upDown:"upDown___SlgHv",container:"container___g1WYG","video-container":"video-container___XPkWR","video-controls":"video-controls___to0Zq",hide:"hide___NA3DV","video-progress":"video-progress___gqHsd",seek:"seek___iZHBm","seek-tooltip":"seek-tooltip___uWyXx","bottom-controls":"bottom-controls___uoIBm","left-controls":"left-controls___mBEx4","right-controls":"right-controls___e9L6r",rateOverlay:"rateOverlay___HHBWe",controlText:"controlText___M_BWR","volume-controls":"volume-controls___fa3mE","fullscreen-button":"fullscreen-button___ur0es","fullscreen-button1":"fullscreen-button1___rfaXm","pip-button":"pip-button___GFO8W","playback-animation":"playback-animation___ndURq",volume:"volume___OTmpP",hidden:"hidden___o7GkT"},y=n(37712);function b(e){if(isNaN(e))return{minutes:"00",seconds:"00"};var t=new Date(1e3*e).toISOString().substr(11,8);return{hour:t.substr(0,2),minutes:t.substr(3,2),seconds:t.substr(6,2)}}function x(e,t){return e-t}function w(e){e.sort(x);for(var t=0,n=0;n<e.length-1;n++){var i=Math.abs(e[n+1]-e[n]);i<21&&(t+=i)}return t}Object.defineProperty(HTMLMediaElement.prototype,"playing",{get:function(){return!!(this.currentTime>0&&!this.paused&&!this.ended&&this.readyState>2)}});var _=/(android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini)/i,k=(0,u.forwardRef)((function(e,t){var n,i=e.allow_skip,o=e.src,s=e.toLog,x=e.videoId,k=e.logWatchHistory,C=e.courseId,S=void 0===C?null:C,E=e.startTime,L=e.handlePause,A=void 0===L?function(){}:L,T=e.handlePlay,M=void 0===T?function(){}:T,D=e.handlePlayEnded,R=void 0===D?function(){}:D,B=e.autoPlay,N=void 0!==B&&B,P=e.onPlayEnded,I=void 0===P?function(){}:P,O=e.isShowWaterMark,F=void 0===O||O,j="flv"===(null==o||null===(n=o.split("."))||void 0===n?void 0:n.pop()),z=(0,u.useRef)(),H=(0,u.useRef)(),W=(0,u.useRef)(),G=(0,u.useRef)(),U=(0,u.useRef)(),Z=(0,u.useRef)(),V=(0,u.useRef)(),q=(0,u.useRef)(),K=(0,u.useRef)(),Y=(0,u.useRef)(),X=(0,u.useRef)(),J=(0,u.useRef)(),Q=(0,u.useRef)(),$=(0,u.useRef)(),ee=navigator.userAgent.toLowerCase().match(_),te=ee?ee[0]:"pc",ne=(0,u.useRef)(!1),ie=(0,p.eY)(),re=0,oe=0,ae=0,se=null,le=!1,ue=20,ce=1,he=!1,de=!1,fe=[];(0,u.useImperativeHandle)(t,(function(){return{getLastUpdatedTime:function(){return z.current.currentTime},getDuration:function(){return z.current.duration}}})),c.ZP.config({maxCount:1,getContainer:function(){return W.current}});var pe=(0,u.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={point:z.current.currentTime};function i(){return r.apply(this,arguments)}function r(){return(r=l()(a()().mark((function t(){var i;return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return he=!0,t.next=3,null==k?void 0:k(n);case 3:i=t.sent,se=i,he=!1,e&&e();case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}se?(n.log_id=se,n.watch_duration=w(fe),n.total_duration=oe):(S?(n.video_id=parseInt(x,10),n.course_id=S):n.video_id=x,n.duration=re,n.device=te),t&&(n.ed="1"),i()}),[x,S]);function me(){z.current.paused?(G.current.style.display="none",U.current.style.display="block"):(G.current.style.display="block",U.current.style.display="none")}function ve(){X.current.style.display="none",Q.current.style.display="none",J.current.style.display="none",z.current.muted||0===z.current.volume?X.current.style.display="block":z.current.volume>0&&z.current.volume<=.5?Q.current.style.display="block":J.current.style.display="block"}(0,u.useEffect)((function(){z.current&&(G.current.style.display="none",U.current.style.display="block"),c.ZP.destroy();var e=null;return d.Z.isSupported&&j&&o&&(null==o?void 0:o.indexOf(".m3u8"))<0?(e=d.Z.createPlayer({type:"flv",volume:.8,cors:!0,url:o,muted:!1}),z.current&&(e.attachMediaElement(z.current),e.load())):z.current.setAttribute("src",o),ve(),function(){e&&(e.unload(),e.pause(),e.destroy(),e=null)}}),[z,j,o]),(0,u.useEffect)((function(){document.getElementById("play"),document.querySelectorAll(".playback-icons use");function e(){M(),E&&!ne.current&&(z.current.currentTime=E),ne.current=!0,fe.push(z.current.currentTime),le||(le=!0,s&&pe())}function t(){return n.apply(this,arguments)}function n(){return(n=l()(a()().mark((function e(){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:me(),fe.push(z.current.currentTime),s&&pe((function(){se=null,ae=0,le=!1,he=!1,de=!1,fe=[],oe=0,ce=1}),!0),I();case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function r(){Z.current.value=Math.round(z.current.currentTime),V.current.value=Math.round(z.current.currentTime)}function o(){var e,t,n,i,r,o=Math.round(null===(e=z.current)||void 0===e?void 0:e.duration);null===(t=Z.current)||void 0===t||null===(n=t.setAttribute)||void 0===n||n.call(t,"max",o),null===(i=V.current)||void 0===i||null===(r=i.setAttribute)||void 0===r||r.call(i,"max",o);var a,s,l=b(o);q.current&&(q.current.innerText="".concat(l.hour>0?l.hour+":":"").concat(l.minutes,":").concat(l.seconds),null===(a=(s=q.current).setAttribute)||void 0===a||a.call(s,"datetime","".concat(l.hour>0?" "+l.hour+" ":"").concat(l.minutes,"m ").concat(l.seconds,"s")))}function u(){try{var e=Math.round(z.current.duration);Z.current.setAttribute("max",e),V.current.setAttribute("max",e);var t=b(e);q.current.innerText="".concat(t.hour>0?t.hour+":":"").concat(t.minutes,":").concat(t.seconds),q.current.setAttribute("datetime","".concat(t.hour>0?" "+t.hour+" ":"").concat(t.minutes,"m ").concat(t.seconds,"s")),r(),function(){var e=b(Math.round(z.current.currentTime));K.current.innerText="".concat(e.hour>0?e.hour+":":"").concat(e.minutes,":").concat(e.seconds),K.current.setAttribute("datetime","".concat(e.hour>0?" "+e.hour+" ":"").concat(e.minutes,"m ").concat(e.seconds,"s"))}();var n=H.current.getBoundingClientRect();n.width,n.height,n.x,n.y;if(!de){var i=z.current.currentTime,o=i-ae;Math.abs(o)<10?(oe+=Math.abs(o),ae=i,he||oe-ce*ue>=0&&(ce++,fe.push(ae),s&&pe())):(ae=i,s&&pe())}}catch(e){console.log("videoplaying:",e)}}function h(){de=!0}function d(){z.current.playing&&fe.push(z.current.currentTime,ae),ae=z.current.currentTime,de=!1}function f(){(re=z.current.duration)<=20&&(ue=re/3),z.current.addEventListener("play",e)}function p(){A()}function m(e){if(i){var t=e.target.dataset.seek?e.target.dataset.seek:e.target.value;z.current.currentTime=t,V.current.value=t,Z.current.value=t}else c.ZP.warning("该视频禁止快进/后退播放")}function g(e){var t=Math.round(e.offsetX/e.target.clientWidth*parseInt(e.target.getAttribute("max"),10));Z.current.setAttribute("data-seek",t);var n=b(t);Y.current.textContent="".concat(n.hour>0?n.hour+":":"").concat(n.minutes,":").concat(n.seconds);var i=z.current.getBoundingClientRect();Y.current.style.left="".concat(e.pageX-i.left,"px")}function y(e){switch(e.code){case"Space":e.preventDefault(),xe();break;case"ArrowRight":if(e.preventDefault(),!i){c.ZP.warning("该视频禁止快进/后退播放");break}if(z.current.currentTime>=z.current.duration)break;z.current.currentTime=parseInt(z.current.currentTime)+5,r();break;case"ArrowLeft":if(e.preventDefault(),!i){c.ZP.warning("该视频禁止快进/后退播放");break}if(0===z.current.currentTime)break;z.current.currentTime=parseInt(z.current.currentTime)-5,r();break;case"ArrowUp":e.preventDefault(),z.current.volume<1&&(z.current.volume=(parseInt(10*z.current.volume)+1)/10);break;case"ArrowDown":e.preventDefault(),z.current.volume>0&&(z.current.volume=(parseInt(10*z.current.volume)-1)/10)}}return W.current.addEventListener((0,v.gH)(),(function(e){e.preventDefault(),(0,v.vp)()?(z.current.style.width="100%",z.current.style.height="100%"):z.current.style.cssText=""})),z.current.addEventListener("canplay",f),z.current.addEventListener("ended",t),z.current.addEventListener("seeking",h),z.current.addEventListener("seeked",d),z.current.addEventListener("loadedmetadata",o),Z.current.addEventListener("mousemove",g),Z.current.addEventListener("input",m),z.current.addEventListener("timeupdate",u),z.current.addEventListener("pause",p),z.current.addEventListener("volumechange",ve),document.addEventListener("keydown",y),function(){var n,i,r,a,l,c,v,b,x,w,_,k;null===(n=z.current)||void 0===n||n.removeEventListener("canplay",f),null===(i=z.current)||void 0===i||i.removeEventListener("play",e),null===(r=z.current)||void 0===r||r.removeEventListener("ended",t),null===(a=z.current)||void 0===a||a.removeEventListener("seeking",h),null===(l=z.current)||void 0===l||l.removeEventListener("seeked",d),null===(c=Z.current)||void 0===c||c.removeEventListener("mousemove",g),null===(v=Z.current)||void 0===v||v.removeEventListener("input",m),null===(b=z.current)||void 0===b||b.removeEventListener("timeupdate",u),null===(x=z.current)||void 0===x||x.removeEventListener("pause",p),null===(w=z.current)||void 0===w||w.removeEventListener("loadedmetadata",o),null===(_=z.current)||void 0===_||_.removeEventListener("volumechange",ve),document.removeEventListener("keydown",y),null!==(k=z.current)&&void 0!==k&&k.playing&&(fe.push(ae,z.current.currentTime),s&&pe())}}),[z,o]),(0,u.useEffect)((function(){if(z.current.onended=function(){R(z)},z.current.oncontextmenu=function(){return!1},(null==o?void 0:o.indexOf(".m3u8"))>-1)if(z.current.canPlayType("application/vnd.apple.mpegurl"))z.current.src=o;else if(f.ZP.isSupported()){var e=new f.ZP;e.loadSource(o),e.attachMedia(z.current)}}),[o]);var ge=(0,u.useState)(1),ye=r()(ge,2),be=(ye[0],ye[1]),xe=function(){z.current.paused||z.current.ended?z.current.play():z.current.pause(),me()};return(0,y.jsxs)("div",{style:{position:"relative"},ref:W,children:[(0,y.jsx)("div",{ref:H,className:"".concat(g.watermark," animated_alternate animate__animated_10s animate__infinite animate__stepstart ").concat(g.animate__loop),children:F&&ie?ie.login:" "}),(0,y.jsx)("div",{className:g.container,children:(0,y.jsxs)("div",{className:g["video-container"],id:"video-container",children:[(0,y.jsx)("div",{className:g["playback-animation"],id:"playback-animation",children:(0,y.jsxs)("svg",{className:g["playback-icons"],children:[(0,y.jsx)("use",{className:"hidden",href:"#play-icon"}),(0,y.jsx)("use",{href:"#pause"})]})}),(0,y.jsx)("video",{className:g.video,id:"video",preload:"auto",disablePictureInPicture:!0,ref:z,autoPlay:N}),(0,y.jsxs)("div",{className:"".concat(g["video-controls"]," "),id:"video-controls",children:[(0,y.jsxs)("div",{className:g["bottom-controls"],children:[(0,y.jsxs)("div",{className:g["left-controls"],children:[(0,y.jsx)("button",{"data-title":"播放/暂停",id:"play",onClick:xe,children:(0,y.jsxs)("svg",{className:g["playback-icons"],children:[(0,y.jsx)("use",{ref:U,href:"#play-icon"}),(0,y.jsx)("use",{ref:G,style:{display:"none"},href:"#pause"})]})}),(0,y.jsxs)("div",{className:g.time,children:[(0,y.jsx)("time",{id:"time-elapsed",ref:K,children:"00:00"}),(0,y.jsx)("span",{children:" / "}),(0,y.jsx)("time",{id:"duration",ref:q,children:"00:00"})]})]}),(0,y.jsxs)("div",{className:g["right-controls"],children:[i&&(0,y.jsx)(h.Z,{placement:"top",overlayClassName:g.rateOverlay,getPopupContainer:function(e){return e.parentNode},menu:{items:[{key:"1",label:(0,y.jsx)("span",{onClick:function(){be(1),z.current.playbackRate=1},children:"1.0x"})},{key:"2",label:(0,y.jsx)("span",{onClick:function(){be(1.5),z.current.playbackRate=1.5},children:"1.5x"})},{key:"3",label:(0,y.jsx)("span",{onClick:function(){be(2),z.current.playbackRate=2},children:"2.0x"})}]},children:(0,y.jsx)("div",{className:"".concat(g.controlText," mr5"),children:"倍速"})}),(0,y.jsx)(m.CopyToClipboard,{text:o,onCopy:function(){return c.ZP.success("复制成功")},children:(0,y.jsx)("button",{"data-title":"复制链接",children:(0,y.jsx)("i",{className:"icon-lianjie2 iconfont",style:{fontSize:"12px",color:"white"}})})}),(0,y.jsxs)("div",{className:g["volume-controls"],children:[(0,y.jsxs)("button",{"data-title":"开启/关闭声音",className:g["volume-button"],id:"volume-button",onClick:function(){z.current.muted=!z.current.muted,z.current.muted?($.current.setAttribute("data-volume",volume.value),$.current.value=0):$.current.value=$.current.dataset.volume},children:[(0,y.jsx)("i",{ref:X,className:"icon-a-bianzu8 iconfont",style:{fontSize:"14px",color:"white"}}),(0,y.jsx)("i",{ref:Q,className:"icon-shengyinkaibeifen iconfont",style:{fontSize:"14px",color:"white"}}),(0,y.jsx)("i",{ref:J,className:"icon-shengyinkai iconfont",style:{fontSize:"14px",color:"white"}})]}),(0,y.jsx)("input",{className:g.volume,id:"volume",value:"1","data-mute":"0.5",type:"range",max:"1",min:"0",step:"0.01",ref:$,style:{display:"none"},onClick:ve})]}),(0,y.jsx)("button",{"data-title":"全屏/退出全屏",className:g["fullscreen-button"],onClick:function(){(0,v.vp)()?(0,v.BU)():(0,v.Dj)(W.current)},children:(0,y.jsx)("i",{className:"icon-fangda1 iconfont",style:{fontSize:"12px",color:"white"}})})]})]}),(0,y.jsxs)("div",{className:g["video-progress"],children:[(0,y.jsx)("progress",{ref:V,value:"0",min:"0"}),(0,y.jsx)("input",{className:g.seek,ref:Z,value:"0",min:"0",type:"range",step:"1"}),(0,y.jsx)("div",{className:g["seek-tooltip"],ref:Y,id:"seek-tooltip",children:"00:00"})]})]})]})}),(0,y.jsx)("svg",{style:{display:"none"},children:(0,y.jsxs)("defs",{children:[(0,y.jsx)("symbol",{id:"pause",viewBox:"0 0 24 24",children:(0,y.jsx)("path",{d:"M14.016 5.016h3.984v13.969h-3.984v-13.969zM6 18.984v-13.969h3.984v13.969h-3.984z"})}),(0,y.jsx)("symbol",{id:"play-icon",viewBox:"0 0 24 24",children:(0,y.jsx)("path",{d:"M8.016 5.016l10.969 6.984-10.969 6.984v-13.969z"})}),(0,y.jsx)("symbol",{id:"volume-high",viewBox:"0 0 24 24",children:(0,y.jsx)("path",{d:"M14.016 3.234q3.047 0.656 5.016 3.117t1.969 5.648-1.969 5.648-5.016 3.117v-2.063q2.203-0.656 3.586-2.484t1.383-4.219-1.383-4.219-3.586-2.484v-2.063zM16.5 12q0 2.813-2.484 4.031v-8.063q1.031 0.516 1.758 1.688t0.727 2.344zM3 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6z"})}),(0,y.jsx)("symbol",{id:"volume-low",viewBox:"0 0 24 24",children:(0,y.jsx)("path",{d:"M5.016 9h3.984l5.016-5.016v16.031l-5.016-5.016h-3.984v-6zM18.516 12q0 2.766-2.531 4.031v-8.063q1.031 0.516 1.781 1.711t0.75 2.32z"})}),(0,y.jsx)("symbol",{id:"volume-mute",viewBox:"0 0 24 24",children:(0,y.jsx)("path",{d:"M12 3.984v4.219l-2.109-2.109zM4.266 3l16.734 16.734-1.266 1.266-2.063-2.063q-1.547 1.313-3.656 1.828v-2.063q1.172-0.328 2.25-1.172l-4.266-4.266v6.75l-5.016-5.016h-3.984v-6h4.734l-4.734-4.734zM18.984 12q0-2.391-1.383-4.219t-3.586-2.484v-2.063q3.047 0.656 5.016 3.117t1.969 5.648q0 2.203-1.031 4.172l-1.5-1.547q0.516-1.266 0.516-2.625zM16.5 12q0 0.422-0.047 0.609l-2.438-2.438v-2.203q1.031 0.516 1.758 1.688t0.727 2.344z"})}),(0,y.jsx)("symbol",{id:"fullscreen",viewBox:"0 0 24 24",children:(0,y.jsx)("path",{d:"M14.016 5.016h4.969v4.969h-1.969v-3h-3v-1.969zM17.016 17.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 9.984v-4.969h4.969v1.969h-3v3h-1.969zM6.984 14.016v3h3v1.969h-4.969v-4.969h1.969z"})}),(0,y.jsx)("symbol",{id:"fullscreen-exit",viewBox:"0 0 24 24",children:(0,y.jsx)("path",{d:"M15.984 8.016h3v1.969h-4.969v-4.969h1.969v3zM14.016 18.984v-4.969h4.969v1.969h-3v3h-1.969zM8.016 8.016v-3h1.969v4.969h-4.969v-1.969h3zM5.016 15.984v-1.969h4.969v4.969h-1.969v-3h-3z"})}),(0,y.jsx)("symbol",{id:"pip",viewBox:"0 0 24 24",children:(0,y.jsx)("path",{d:"M21 19.031v-14.063h-18v14.063h18zM23.016 18.984q0 0.797-0.609 1.406t-1.406 0.609h-18q-0.797 0-1.406-0.609t-0.609-1.406v-14.016q0-0.797 0.609-1.383t1.406-0.586h18q0.797 0 1.406 0.586t0.609 1.383v14.016zM18.984 11.016v6h-7.969v-6h7.969z"})})]})})]})}))},51168:function(e,t,n){"use strict";n.d(t,{h:function(){return g}});var i=n(82242),r=n.n(i),o=n(79800),a=n.n(o),s=n(59301),l=n(82326),u=n(28284),c=n(99571),h=n(89780),d=n.n(h),f=(n(2018),n(66551),n(37712)),p=l.default.Option,m={labelCol:{span:4},wrapperCol:{span:20}},v={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 g(e){var t=e.value,n=e.onChange,i=e.mode,o=e.options,l=void 0===o?{}:o,u=(0,s.useRef)(),c=(0,s.useState)(),h=a()(c,2),p=h[0],m=h[1];return(0,s.useEffect)((function(){if(p){var e=function(e){var t=e.getValue();n&&n(t)};return p.on("change",e),function(){p.off("change",e)}}}),[p,n]),(0,s.useEffect)((function(){p&&p.setOption("mode",i)}),[p,i]),(0,s.useEffect)((function(){p&&(t===p.getValue()&&""!==t||setTimeout((function(){p.setValue(t||"")}),300))}),[p,t]),(0,s.useEffect)((function(){if(u.current&&!p){var e=d().fromTextArea(u.current,r()({mode:i,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},l));m(e)}}),[u.current,p]),(0,f.jsx)("div",{className:"my-codemirror-container",children:(0,f.jsx)("textarea",{ref:u})})}t.Z=function(e){var t=e.callback,n=e.onCancel,i=(0,s.useState)("python"),o=a()(i,2),h=o[0],d=o[1];return(0,f.jsxs)(u.Z,r()(r()({},m),{},{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){t(e)},style:{width:500},children:[(0,f.jsx)(u.Z.Item,{label:"代码语言",name:"language",children:(0,f.jsx)(l.default,{getPopupContainer:function(e){return e.parentNode},onChange:function(e){d(v[e][1])},children:Object.keys(v).map((function(e){return(0,f.jsx)(p,{value:e,children:v[e][0]},e)}))})}),(0,f.jsx)(u.Z.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}],children:(0,f.jsx)(g,{mode:h})}),(0,f.jsxs)("div",{className:"flex-container flex-end",children:[(0,f.jsx)(c.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,f.jsx)(c.ZP,{type:"ghost",onClick:n,children:"取消"})]})]}))}},16039:function(e,t,n){"use strict";n.d(t,{Z:function(){return de}});var i=n(91232),r=n.n(i),o=n(79800),a=n.n(o),s=n(85573),l=n.n(s),u=n(59301),c=n(76805),h=n(89780),d=n.n(h),f=n(76374),p=(n(2018),n(6313),n(25717),n(99498),n(25419),n(67549),n(83449)),m=n(37712),v=function(e){var t=e.value,n=void 0===t?"":t,i=(e.className,e.showTextOnly,e.showLines,e.style,(0,u.useMemo)((function(){return""}),[n]));return(0,m.jsx)(m.Fragment,{children:(0,m.jsx)("div",{dangerouslySetInnerHTML:{__html:i}})})},g=n(82242),y=n.n(g),b=[{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 x(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,u=[].concat(b,[{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&&u.map((function(e,t){return(0,m.jsx)("li",{children:e.actionName?(0,m.jsx)(x,y()(y()({},e),{},{onActionCallback:r})):(0,m.jsx)("span",{className:"v-line"})},t)})),n?(0,m.jsx)("li",{children:(0,m.jsx)(x,{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)(x,{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)(x,{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)(x,{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)(x,{icon:"".concat(o?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"),title:o?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:r})})]})},_=n(34858),k=n(28284),C=n(37568),S=n(99571),E={labelCol:{span:4},wrapperCol:{span:20}},L=function(e){var t=e.callback,n=e.onCancel;return(0,m.jsxs)(k.Z,y()(y()({},E),{},{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)(C.Z,{})}),(0,m.jsx)(k.Z.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}],children:(0,m.jsx)(C.Z,{})}),(0,m.jsxs)("div",{className:"flex-container flex-end",children:[(0,m.jsx)(S.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,m.jsx)(S.ZP,{type:"ghost",onClick:n,children:"取消"})]})]}))},A=n(51168),T=n(83016),M=n(62957),D=n(77019),R=n(32110),B=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)(M.Z,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1,children:(0,m.jsx)(D.Z,{style:{height:"100vh"},children:(0,m.jsx)(R.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})})})},N=n(30641),P=n(5269),I=n(6767),O="drawerWrap___MfDw8",F=(0,u.forwardRef)((function(e,t){e.onCancel;var n=e.editImgId,i=e.callback,r=((0,u.useRef)(),(0,u.useRef)()),o=((0,u.useRef)(),(0,u.useRef)(!1),(0,u.useRef)(!1));console.log("ref:",t);var s=(0,u.useState)(0),l=a()(s,2),c=l[0],h=l[1],d=(0,u.useState)("100vh"),f=a()(d,2),p=f[0],v=f[1];return(0,u.useEffect)((function(){h(1)}),[]),(0,u.useImperativeHandle)(t,(function(){return{setHeight:v}})),(0,m.jsx)("div",{ref:o,className:"body-overflow-initial",children:(0,m.jsx)(N.Z,{width:"100vw",height:p,footer:null,closable:!0,placement:"bottom",open:!!c,destroyOnClose:!0,maskClosable:!1,mask:!1,rootClassName:"zIndex-9999 ".concat(O),onClose:function(){window.saveDrawData((function(e){i({src:"/api/attachments/".concat(e),id:e})}))},title:(0,m.jsxs)(D.Z,{align:"middle",children:[(0,m.jsx)(P.Z,{flex:1,children:"插入流程图"}),(0,m.jsx)(P.Z,{onClick:function(){v("60px"===p?"100vh":"60px")},children:(0,m.jsx)("span",{className:"current c-blue",style:{fontWeight:400},children:"展开/收起"})}),(0,m.jsx)(P.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)(S.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})})})})),j=n(51200),z=n(47889),H=n(71051),W=z.ZP.Group,G={margin:"0 8px"},U=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:G,children:"单元格数:"}),(0,m.jsx)("span",{style:G,children:"行数"}),(0,m.jsx)(k.Z.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}],children:(0,m.jsx)(H.Z,{})}),(0,m.jsx)("span",{style:G,children:"列数"}),(0,m.jsx)(k.Z.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}],children:(0,m.jsx)(H.Z,{})})]}),(0,m.jsxs)("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"},children:[(0,m.jsx)("span",{style:G,children:"对齐方式:"}),(0,m.jsx)(k.Z.Item,{name:"align",children:(0,m.jsxs)(W,{children:[(0,m.jsx)(z.ZP,{value:"default",children:(0,m.jsx)("i",{className:"fa fa-align-justify"})}),(0,m.jsx)(z.ZP,{value:"left",children:(0,m.jsx)("i",{className:"fa fa-align-left"})}),(0,m.jsx)(z.ZP,{value:"center",children:(0,m.jsx)("i",{className:"fa fa-align-center"})}),(0,m.jsx)(z.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)(S.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,m.jsx)(S.ZP,{type:"ghost",onClick:n,children:"取消"})]})]})},Z=n(71411),V=n(70746),q=n.n(V),K=(0,u.forwardRef)((function(e,t){var n=e.use3d,i=e.width,r=e.height,o=e.callback,s=(e.showSaveButton,(0,u.useRef)()),l=(0,u.useRef)(),c=(0,u.useState)(!1),h=a()(c,2),d=h[0],f=h[1],p=(0,u.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,u.useEffect)((function(){l.current=new(q())(p.current,!0),window.onload=function(){l.current.inject("applet_container")}}),[]);var v=function(){var e=window.ggbApplet.getPNGBase64(1,!0,72);return o&&o(e),e};return(0,u.useEffect)((function(){p.current.appName=d?"3D":"graphing",l.current.inject("applet_container")}),[d]),(0,u.useEffect)((function(){f(n)}),[n]),(0,u.useImperativeHandle)(t,(function(){return{getImgData:v}})),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:s}),(0,m.jsxs)(D.Z,{align:"middle",children:[(0,m.jsx)(P.Z,{flex:1,children:(0,m.jsx)(Z.Z,{size:"default",checkedChildren:"关闭3D图像",unCheckedChildren:"开启3D图像",checked:d,onChange:function(e){return f(e)}})}),(0,m.jsx)(P.Z,{children:(0,m.jsx)(S.ZP,{size:"large",onClick:v,style:{zIndex:8,marginTop:10},type:"primary",children:"保存到编辑器"})})]})]})})),Y=n(90786),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(28329),oe=n(30406);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 ue=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",ce=l()(l()({},ue+"-B","bold"),ue+"-I","italic"),he=l()(l()(l()(l()(l()(l()(l()(l()({},X,"添加链接"),ee,"添加代码块"),J,"添加图片"),$,"添加画图"),Q,"插入流程图"),te,"添加表格"),"maths-latex","数学图像"),"inline-latex","LATEX公式"),de=function(e){var t=e.defaultValue,n=void 0===t?"":t,i=e.onChange,o=e.width,s=void 0===o?"100%":o,h=e.height,g=void 0===h?400:h,y=e.miniToolbar,b=void 0!==y&&y,x=e.isFocus,k=void 0!==x&&x,C=e.watch,S=e.insertTemp,E=e.mode,D=void 0===E?"markdown":E,R=e.id,N=void 0===R?"markdown-editor-id":R,P=e.showResizeBar,O=void 0!==P&&P,z=e.noStorage,H=void 0!==z&&z,W=e.showNullButton,G=void 0!==W&&W,Z=e.showNullProgramButton,V=void 0!==Z&&Z,q=e.hidetoolBar,ne=void 0!==q&&q,ue=e.fullScreen,de=void 0!==ue&&ue,fe=e.onBlur,pe=e.onCMBeforeChange,me=e.onFullScreen,ve=e.className,ge=void 0===ve?"":ve,ye=e.disablePaste,be=void 0!==ye&&ye,xe=e.disabled,we=void 0!==xe&&xe,_e=e.disabledFill,ke=void 0!==_e&&_e,Ce=e.placeholder,Se=void 0===Ce?"":Ce,Ee=e.values,Le=void 0===Ee?"":Ee,Ae=e.extraUse,Te=e.onAddBlank,Me=(0,u.useState)(null),De=a()(Me,2),Re=De[0],Be=De[1],Ne=(0,u.useState)(n),Pe=a()(Ne,2),Ie=Pe[0],Oe=Pe[1],Fe=(0,u.useState)(C),je=a()(Fe,2),ze=je[0],He=je[1],We=(0,u.useState)(de),Ge=a()(We,2),Ue=Ge[0],Ze=Ge[1],Ve=(0,u.useState)(""),qe=a()(Ve,2),Ke=qe[0],Ye=qe[1],Xe=(0,u.useState)(0),Je=a()(Xe,2),Qe=Je[0],$e=Je[1],et=(0,u.useState)(g),tt=a()(et,2),nt=tt[0],it=tt[1],rt=(0,u.useState)(!1),ot=a()(rt,2),at=(ot[0],ot[1]),st=(0,u.useState)(0),lt=a()(st,2),ut=lt[0],ct=lt[1],ht=(0,u.useState)(0),dt=a()(ht,2),ft=dt[0],pt=dt[1],mt=(0,u.useRef)(),vt=(0,u.useRef)(),gt=(0,u.useRef)(),yt=(0,u.useRef)(),bt=(0,u.useRef)(),xt=(0,u.useRef)(),wt=(0,c.useDispatch)();(0,u.useEffect)((function(){var e=window.scrollY||window.pageYOffset;Oe(Le),null==Re||Re.setValue(Le),window.scrollTo(0,e)}),[Le]),(0,u.useEffect)((function(){null==me||me(Ue)}),[Ue]),(0,u.useEffect)((function(){if(mt.current){var e=function(e,n){if(!be){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"==D)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(),u=l.name.split(".").pop();(0,T.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(u)?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=d().fromTextArea(mt.current,{mode:D,lineNumbers:!b,lineWrapping:!0,value:n,autoCloseTags:!0,autoCloseBrackets:!0});return t.on("keyup",(function(e,n){8===n.keyCode&&(""==e.getValue()?t.setOption("placeholder",Se):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,u=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 c=l+u;return n.replaceRange("",{line:i.line,ch:l},{line:i.line,ch:c}),{line:i.line,ch:c}}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()})),Be(t),function(){t.off("paste",e)}}}),[]);var _t=(0,u.useCallback)((function(){vt.current}),[nt,vt,Ue]);(0,u.useEffect)((function(){if(Re){var e=function(){var e=new f.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)&&(_t(),Re.setSize("100%","100%"),Re.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)}}}),[Re,_t]),(0,u.useEffect)((function(){if(Re){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),Re.addKeyMap(s)},n=0,i=Object.entries(ce);n<i.length;n++)t();return function(){for(var t=0,n=e;t<n.length;t++){var i=n[t];Re.removeKeyMap(i)}}}}),[Re]),(0,u.useEffect)((function(){de!==Ue&&Ze(de)}),[de]),(0,re.Z)((function(){if(!H&&Qe>0){var e=(new Date).getTime(),t=window.sessionStorage.getItem(N);e>=Qe+1e4&&(!t||t!==Ie)&&(window.sessionStorage.setItem(N,Ie),at(!0))}}),1e4),(0,u.useEffect)((function(){He(C)}),[Re,C]),(0,u.useEffect)((function(){Re&&k&&Re.focus()}),[Re,k]),(0,u.useEffect)((function(){if(ze&&Re){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=Re.getScrollerElement();return t.addEventListener("scroll",e),function(){t.removeEventListener("scroll",e)}}}),[Re,ze]),(0,u.useEffect)((function(){if(Re&&pe){var e=function(e,t){pe(e,t)};return Re.on("beforeChange",e),function(){Re.off("beforeChange",e)}}}),[Re,pe]),(0,u.useEffect)((function(){if(Re&&fe){var e=function(){fe(Re.getValue())};return Re.on("blur",e),function(){Re.off("blur",e)}}}),[Re,fe]),(0,u.useEffect)((function(){if(Re){var e=function(e,t){var n=e.getValue();Oe(n),$e((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),i&&(V?i(n,At(n)):i(n))};return Re.on("change",e),function(){Re.off("change",e)}}}),[Re,i]),(0,u.useEffect)((function(){if(Re)if(null==n)Re.setValue(""),Oe("");else{var e=window.scrollY||window.pageYOffset;n!==Re.getValue()&&(Re.setValue(n),Oe(n),Re.setCursor(we?1:Re.lineCount(),0),window.scrollTo(0,e))}}),[Re,n]);var kt=(0,u.useCallback)((function(e){var t=Re.getCursor(),n=Re.getSelection(),i=n.split("\n");switch(e){case"bold":return Re.replaceSelection("**"+n+"**"),""===n&&Re.setCursor(t.line,t.ch+2),Re.focus();case"italic":return Re.replaceSelection("*"+n+"*"),""===n&&Re.setCursor(t.line,t.ch+1),Re.focus();case"code":return Re.replaceSelection("`"+n+"`"),""===n&&Re.setCursor(t.line,t.ch+1),Re.focus();case"inline-latex":if((0,oe.Ye)(wt))return;return Ye("inline-latex"),Re.focus();case"latex":return Re.replaceSelection("```latex\n"+n+"\n```"),Re.setCursor(t.line+1,n.length+1),Re.focus();case"line-break":return Re.replaceSelection("<br/>\n"),Re.focus();case"list-ul":return""===n?Re.replaceSelection("- "+n):Re.replaceSelection(i.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),Re.focus();case"list-ol":return""===n?Re.replaceSelection("1. "+n):Re.replaceSelection(i.map((function(e,t){return""===e?"":"".concat(t+1,". ").concat(e)})).join("\n")),Re.focus();case"add-null-ch":return void(null==Te||Te());case"add-signal":return""===n&&Re.setCursor(t.line,t.ch),Re.replaceSelection("@▁@"),Re.focus();case"add-multiple":return""===n&&Re.setCursor(t.line,t.ch),Re.replaceSelection(ae),Re.focus();case"inster-template-1":return""===n&&Re.setCursor(t.line,t.ch),Re.replaceSelection("\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作"),Re.focus();case"eraser":return Re.setValue(""),Re.focus();case"trigger-watch":return He(!ze),Re.focus();case"trigger-full-screen":return Ze(!Ue),Re.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 bt.current="",sessionStorage.removeItem("file_id"),void Ye(Q);case te:return void Ye(te);default:throw new Error}}),[Re,ze,Ue]),Ct=(0,u.useCallback)((function(e,t){var n,i,r,o,a;null!=e&&e.disabledClose||Ye("");var s=e||{},l=s.src,u=s.alt,c=s.id;switch(Ke){case X:var h=e.title,d=e.link;return Re.replaceSelection("[".concat(h,"](").concat(d,")")),Re.focus();case ee:var f=e.language,p=e.content;return Re.replaceSelection(["```"+f,p,"```"].join("\n")),Re.focus();case"maths-latex":for(var m=atob(e),v=new Uint8Array(m.length),g=0;g<m.length;g++)v[g]=m.charCodeAt(g);var y=new Blob([v],{type:"image/png"});(0,T.I)(y,(function(e){e.id?Re.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;Re.replaceSelection("`$$"+e+"$$`");break;case"add-flowchart":if(!c)return;-1===Re.getValue().indexOf(l)?Re.replaceSelection('<center><img id="'.concat(c,'" width="80%" src="').concat(l,'" class="draw-flowchart" alt="').concat(u||"",'" /></center>')):document.getElementById(c).src=j.Z.API_SERVER+l+"?t="+Date.now();break;case J:case $:var b=t,x=null==b||null===(n=b.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==b||null===(r=b.type)||void 0===r?void 0:r.indexOf("image"))>-1||null==b||!b.type?null!=b&&b.align||null!=b&&b.width?Re.replaceSelection('<p style="text-align:'.concat(b.align||"initial",'"><img width="').concat(b.width?b.width+"%":"initial",'" src="').concat(l,'" alt="').concat(u||"",'" /></p>')):Re.replaceSelection('<img width="100%" src="'.concat(l,'" alt="').concat(u||"",'" />')):(null==b||null===(o=b.type)||void 0===o?void 0:o.indexOf("video"))>-1?Re.replaceSelection('<video width="100%" controls src="'.concat(l,'"></video>')):(null==b||null===(a=b.type)||void 0===a?void 0:a.indexOf("pdf"))>-1?Re.replaceSelection('<a href="'.concat(l,"?type=").concat(b.type,'&disposition=inline" target="_blank">').concat(b.name,"</a>")):se.includes(x)?Re.replaceSelection('<a href="'.concat(l,'?type=office&disposition=inline" target="_blank">').concat(b.name,"</a>")):Re.replaceSelection("[".concat(b.name,"](").concat(l,")")),Re.focus();case te:for(var w=e.row,_=e.col,k=e.align,C="\n",S=0;S<w;S++){for(var E=[],L=[],A=0;A<_;A++)1===S&&L.push(ie[k]),E.push(" ");1===S&&(C+="| ".concat(L.join(" | ")," |\n")),C+="| ".concat(E.join(1===_?"":" | ")," |\n")}return Re.replaceSelection(C+"\n"),Re.focus();default:throw new Error}}),[Re,Ke]),St=(0,u.useMemo)((function(){switch(Ke){case X:return(0,m.jsx)(L,{callback:Ct,onCancel:Et});case ee:return(0,m.jsx)(A.Z,{callback:Ct,onCancel:Et});case J:return(0,m.jsx)(T.Z,{callback:Ct,onCancel:Et});case Q:return(0,m.jsx)(F,{editImgId:bt.current,callback:Ct,onCancel:Et});case te:return(0,m.jsx)(U,{callback:Ct,onCancel:Et});case"maths-latex":return(0,m.jsx)(K,{showSaveButton:!0,callback:Ct});case"inline-latex":return(0,m.jsx)(Y.Z,{showSaveButton:!0,callback:Ct});default:return null}}),[Ke]);function Et(){Ye("")}(0,u.useEffect)((function(){if(gt.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(g+t+"px")}},i=gt.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)}}}),[Re,gt]),(0,u.useEffect)((function(){it(g)}),[g]);var Lt={width:le(s),height:le(nt)},At=((0,u.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(V){e=e.replace(/(@▁▁@|@▁@)/g,(function(e,n,i){t.push({multiLine:!("@▁@"===e)})}))}return t});(0,u.useEffect)((function(){he[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;ct(t),pt(n)}),0)}),[Ke]);var Tt=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)(u.Fragment,{children:[(0,m.jsx)("div",{className:"markdown-editor-wrapper",ref:vt,children:(0,m.jsxs)("div",{className:"markdown-editor-container ".concat(ge," ").concat(ze?"on-preview":""," ").concat(b?"mini":""," ").concat(Ue?"full-screen":""),style:Lt,children:[(0,m.jsx)(w,{insertTemp:S,watch:ze,fullScreen:Ue,showNullButton:G,showNullProgramButton:V,onActionCallback:kt,hidetoolBar:ne,extraUse:Ae}),(0,m.jsxs)("div",{className:"markdown-editor-body",children:[(0,m.jsx)("div",{className:"codemirror-container",children:(0,m.jsx)("textarea",{ref:mt,placeholder:Se})}),ze?(0,m.jsxs)("div",{ref:yt,className:"preview-container",children:["stex"===D&&(0,m.jsx)(v,{value:Ie}),"stex"!==D&&(0,m.jsx)(p.Z,{edit:!0,disabledFill:ke,showProgramFill:V,value:Ie,openEditor:function(e){var t;bt.current=e,null===(t=xt.current)||void 0===t||t.setHeight("100vh"),setTimeout((function(){Ye("add-flowchart")}),150)}})]}):null]})]})}),O?(0,m.jsx)("a",{ref:gt,className:"editor-resize"}):null,Ke===$&&(0,m.jsx)(B,{callback:Ct,onCancel:Et}),Ke===Q&&(0,m.jsx)(F,{ref:xt,editImgId:bt.current,callback:Ct,onCancel:Et}),(0,m.jsx)(_.Z,{children:he[Ke]&&Ke!==$&&Ke!==Q?(0,m.jsx)(M.Z,{maskClosable:!1,centered:!0,style:{position:"absolute",left:ut,top:ft},title:(0,m.jsx)("div",{style:{cursor:"move"},onMouseDown:function(e){e.preventDefault();var t=e.clientX-ut,n=e.clientY-ft;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)),Tt(e.clientX,e.clientY,t,n)&&(ct(i),pt(r))},document.body.onmouseup=function(){document.body.onmousemove=null}},children:he[Ke]}),open:!0,onCancel:Et,footer:null,destroyOnClose:!0,width:Ke===Q?"1200px":null,height:Ke===Q?"80vh":null,className:"markdown-popup-form",children:St}):null})]})}},83016:function(e,t,n){"use strict";n.d(t,{Z:function(){return x},I:function(){return _}});var i=n(82242),r=n.n(i),o=n(79800),a=n.n(o),s=n(28284),l=n(6767),u=n(37568),c=n(77736),h=n(71051),d=n(47889),f=n(99571),p=n(22065),m=n(59301),v=n(37712),g=s.Z.useForm,y={width:280,marginRight:10},b={labelCol:{span:5},wrapperCol:{span:19}},x=function(e){var t=e.callback,n=e.onCancel,i=g(),o=a()(i,1)[0],p=(0,m.useRef)();function x(e,t){-1!==e.status?o.setFieldsValue({src:"/api/attachments/".concat(e.id),type:t.type}):l.ZP.error(e.message)}return(0,v.jsxs)(s.Z,r()(r()({form:o},b),{},{className:"upload-image-panel",onFinish:function(e){p.current.width=o.getFieldValue("width"),p.current.align=o.getFieldValue("align"),t(e,p.current)},style:{width:470,overflow:"hidden"},children:[(0,v.jsx)(s.Z.Item,{label:"图片地址",required:!0,children:(0,v.jsxs)("div",{className:"flex-container",children:[(0,v.jsx)(s.Z.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入图片地址"}],children:(0,v.jsx)(u.Z,{style:y})}),(0,v.jsx)(w,{onFileChange:function(e){var t=e.target.files[0];p.current=t,_(t,x)}})]})}),(0,v.jsx)(s.Z.Item,{label:"图片描述",name:"alt",children:(0,v.jsx)(u.Z,{style:{width:264}})}),(0,v.jsx)(s.Z.Item,{label:"图片宽度",name:"width",children:(0,v.jsxs)(c.Z,{children:[(0,v.jsx)(s.Z.Item,{name:"width",style:{margin:0},children:(0,v.jsx)(h.Z,{style:{width:264}})}),(0,v.jsx)("span",{className:"ml8",children:"%"})]})}),(0,v.jsx)(s.Z.Item,{label:"对齐方式",name:"align",children:(0,v.jsx)(d.ZP.Group,{name:"align",defaultValue:1,options:[{value:"left",label:"左对齐"},{value:"center",label:"居中对齐"},{value:"right",label:"右对齐"}]})}),(0,v.jsx)("aside",{children:(0,v.jsxs)(s.Z.Item,{style:{textAlign:"right",position:"relative",right:-98},children:[(0,v.jsx)(f.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,v.jsx)(f.ZP,{type:"default",onClick:n,children:"取消"})]})})]}))};function w(e){var t=e.onFileChange;return(0,v.jsxs)("label",{className:"upload-button",style:{cursor:"pointer"},children:["本地上传",(0,v.jsx)("input",{type:"file",onChange:t})]})}function _(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(p.KI,"/api/attachments.json")),i.send(n)}},34858:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var i=n(82100),r=n.n(i),o=n(29186),a=n.n(o),s=n(80619),l=n.n(s),u=n(47074),c=n.n(u),h=n(59301),d=n(4676),f=function(e){l()(n,e);var t=c()(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,d.createPortal)(e,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),n}(h.Component)},50062: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),u=n(79800),c=n.n(u),h=n(39647),d=n.n(h),f=n(7557),p=n.n(f),m=n(41498),v=n.n(m),g=n(59301),y=n(76374),b=["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"],x={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")}]},_={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")}]},C=n(53184),S=n.n(C),E={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"]}},L=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),u=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()(u),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}}))))}}})},A=n(82100),T=n.n(A),M=n(29186),D=n.n(M),R=n(85573),B=n.n(R),N=function(){function e(t,n,i){var r=this;T()(this,e),this.placeholder=t,this.editor=n,this.monaco=i,n.onDidChangeModelContent((function(){return r.onDidChangeModelContent()})),this.onDidChangeModelContent()}return D()(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}();B()(N,"ID","editor.widget.placeholderHint");var P=N,I=n(96236),O=n(6767),F=n(25399),j=n(89392),z=n(82210),H=n(56102),W=n(37712),G=["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 U(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}function Z(){}var V={"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 q(){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=V[e[n]];if(i)return i}return t[0]}return V[t]||t}var K=null,Y=function(){var e=v()(p()().mark((function e(){return p()().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,u=e.value,h=e.language,f=void 0===h?"javascript":h,m=e.style,C=void 0===m?{}:m,A=e.options,T=void 0===A?{}:A,M=e.overrideServices,D=void 0===M?{}:M,R=e.theme,B=void 0===R?"vs-dark":R,N=e.onEditBlur,V=e.isCopy,X=void 0!==V&&V,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?Z:ne,re=e.editorDidMount,oe=void 0===re?Z:re,ae=e.onFocus,se=void 0===ae?Z:ae,le=e.onBreakPoint,ue=void 0===le?Z:le,ce=e.breakPointValue,he=void 0===ce?[]:ce,de=e.filename,fe=void 0===de?"educoder.txt":de,pe=e.errorLine,me=e.errorContent,ve=void 0===me?"":me,ge=e.highlightLine,ye=e.openBreakPoint,be=void 0!==ye&&ye,xe=e.placeholder,we=void 0===xe?"":xe,_e=e.showMiniMap,ke=void 0===_e||_e,Ce=(d()(e,G),(0,g.useRef)()),Se=(0,g.useRef)({}),Ee=(0,g.useRef)(),Le=(0,g.useRef)(),Ae=(0,g.useRef)([]),Te=(0,g.useRef)(!1),Me=(0,g.useRef)(),De=(0,g.useRef)(),Re=(0,g.useRef)(!1),Be=(0,g.useState)(!1),Ne=c()(Be,2),Pe=Ne[0],Ie=Ne[1];(0,g.useEffect)((function(){var e=z.Z.subscribe("formatDocument",(function(e){var t,n=Se.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,g.useEffect)((function(){var e,t=Se.current.instance;(Le.current&&clearTimeout(Le.current),Le.current=setTimeout((function(){!function(){var e=Se.current.instance;if(null!=u&&e&&Pe){var t=e.getModel();t&&u!==t.getValue()&&(!0,t.setValue(u),e.layout(),!1)}}()}),500),u&&null!=u&&u.length)&&(null==t||null===(e=t.updateOptions)||void 0===e||e.call(t,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(u.split(/\r\n|\r|\n/g).length))+3,5)}))}),[u,Pe,Se.current]),(0,g.useEffect)((function(){if(pe&&Se.current&&Se.current.instance){var e=Se.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=ve,e.addZone({afterLineNumber:pe||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})}}),[pe,Se.current,Pe]);var Oe=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=Se.current.instance.getModel(),i=n.getLineTokens(t),r=!1,o=0;o<2;o++)1===i.getStandardTokenType(o)&&(r=!0);return r};function Fe(e){(window.navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)&&83==e.keyCode&&(e.preventDefault(),J())}(0,g.useEffect)((function(){var e,t=null===(e=Se.current)||void 0===e?void 0:e.instance;if(t&&Pe&&te){var n=t.onDidBlurEditorWidget((function(){Re.current=!1})),i=t.onDidFocusEditorText((function(){Re.current=!0}));return function(){n.dispose(),i.dispose()}}}),[Se.current,Pe,te]),(0,g.useEffect)((function(){var e;if(null!==(e=Se.current)&&void 0!==e&&e.instance&&Pe&&be){var t=Se.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,u=e.value;if("highlighted-line"===u.options.className)i.push(null==u||null===(s=u.range)||void 0===s?void 0:s.startLineNumber),r.push(null==u?void 0:u.id)}}catch(e){a.e(e)}finally{a.f()}if(ge!==i[0]){n.deltaDecorations(r,[]);var c=n.getLineCount();ge&&ge<=c&&(t.deltaDecorations([],[{range:new K.Range(ge,1,ge,n.getLineMaxColumn(ge)),options:{isWholeLine:!0,className:"highlighted-line"}}]),t.revealLineInCenter(ge))}}();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,u=e.value;if("breakpoints-select"===u.options.linesDecorationsClassName)i.push(null==u||null===(s=u.range)||void 0===s?void 0:s.startLineNumber),r.push(null==u?void 0:u.id)}}catch(e){a.e(e)}finally{a.f()}if(t)return{lines:i,ids:r};ue(i)},r=function(){var e=v()(p()().mark((function e(t){var r;return p()().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=v()(p()().mark((function e(r){var o,a,s,u,c;return p()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=t.getLineDecorations(r),s=l()(a);try{for(s.s();!(u=s.n()).done;)"breakpoints-select"===(c=u.value).options.linesDecorationsClassName&&o.push(c.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,j.isEqual)(he,i(!0).lines)){n.deltaDecorations(i(!0).ids,[]);var s=he.map((function(e){return{range:new K.Range(e,1,e,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}}));n.deltaDecorations([],s)}var u=t.onDidChangeModelContent((function(e){var s=t.getPosition();if(s){var l=s.lineNumber;clearTimeout(De.current),De.current=setTimeout((function(){Oe(n.getLineContent(l),l)?o(l):a(l)?(o(l),r(l)):i()}),100)}})),c=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(Oe(n.getLineContent(i),i))return;a(i)?o(i):r(i)}})),h=function(){Ae.current=t.deltaDecorations(Ae.current,[])},d=t.onMouseMove((function(e){var i;if(h(),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(Oe(n.getLineContent(r),r))return;!function(e){var n={range:new K.Range(e,1,e,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Ae.current=t.deltaDecorations(Ae.current,[n])}(r)}})),f=t.onMouseLeave((function(){h()}));return function(){u.dispose(),c.dispose(),d.dispose(),f.dispose()}}}),[Se.current,Pe,he,ge,be,f]),(0,g.useEffect)((function(){var e;null!==(e=Se.current)&&void 0!==e&&e.instance&&be&&Se.current.instance.setPosition({lineNumber:0,column:0})}),[ge]);var je=function(){if($&&Se.current.instance){var e=Se.current.instance.getContentHeight();Ke(e<s?s:e)}else Ke(s)};var ze=function(e){if(Re.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||(O.ZP.warning({content:decodeURIComponent("该任务关卡设置了禁止复制粘贴,请手动输入代码。"),key:"monaco-editor-tip"}),e.preventDefault()),!1}};function He(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,g.useEffect)((function(){je()}),[je]),(0,g.useEffect)((function(){Ce.current&&!Pe&&Promise.all([n.e(8909),n.e(4474)]).then(n.bind(n,71448)).then((function(e){try{K=e,Se.current.instance=K.editor.create(Ce.current,{value:u,language:q(f),theme:B,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:ke||!1}},D);var t=Se.current.instance,n=I.BH._menuItems,i=a()(n).find((function(e){return"EditorContext"==e[0]._debugName}))[1];if(oe(t,K),setTimeout((function(){je(),Se.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){He(fe||"educoder.txt",t.getValue())}})}),500),Se.current.subscription=t.onDidChangeModelContent((function(e){Te.current?clearTimeout(Me.current):(je(),ie(t.getValue(),e)),Me.current=setTimeout((function(){Te.current=!1}),500)})),window.Monaco||function(e){E.languages.forEach((function(t){e.languages.registerDocumentFormattingEditProvider(t,{provideDocumentFormattingEdits:function(e){return v()(p()().mark((function t(){var n;return p()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=S()(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)})))()}})})),L(e,"java",x.keywords,x.quickKey),L(e,"cpp",w.keywords,w.quickKey),L(e,"c",b,[]),L(e,"python",_.keywords,_.quickKey),L(e,"scala",k.keywords,k.quickKey)}(K,q(f)),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"]),Ce.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",ze),window.removeEventListener("paste",ze),window.addEventListener("keydown",ze),window.addEventListener("paste",ze)),window.Monaco=K,N&&t.onDidBlurEditorWidget((function(){N(t.getValue())})),se&&t.onDidFocusEditorText((function(){te&&Y(),se(t.getValue())})),te){Y();try{t.onDidPaste((function(e){var n=t.getSelection(),i=Se.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 Ce.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)&&Se.current.instance.layout()}}catch(e){n.e(e)}finally{n.f()}}))).observe(Ce.current),e}();return we&&"string"==typeof we&&new P(we,t,K),Ie(!0),function(){var e=Se.current.instance;e.dispose();var t=e.getModel();t&&t.dispose(),Se.current.subscription&&Se.current.subscription.dispose(),r.unobserve(Ce.current)}}catch(e){}}))}),[]),(0,g.useEffect)((function(){if(Se.current.instance&&Pe)return document.addEventListener("keydown",Fe,!1),function(){document.removeEventListener("keydown",Fe)}}),[J,Pe]),(0,g.useEffect)((function(){var e=Se.current.instance;if(e&&Pe){var t=q(f);K.editor.setModelLanguage(e.getModel(),t)}}),[f,Pe]),(0,g.useEffect)((function(){Se.current.instance&&Pe&&K.editor.setTheme(B)}),[B,Pe]),(0,g.useEffect)((function(){var e=Se.current.instance;Ee.current=T,e&&Pe&&(e.updateOptions(r()({},T)),setTimeout((function(){e.getModel().updateOptions(r()({},T))}),200))}),[JSON.stringify(T),Pe]),(0,g.useEffect)((function(){var e=Se.current.instance;e&&Pe&&e.layout()}),[i,s,Pe]);var We=(0,g.useState)(U(i)),Ge=c()(We,2),Ue=Ge[0],Ze=(Ge[1],(0,g.useState)(U(s))),Ve=c()(Ze,2),qe=Ve[0],Ke=Ve[1],Ye=r()(r()({},C),{},{width:Ue,height:qe,position:"relative"});return(0,W.jsx)("div",{className:"my-monaco-editor",ref:Ce,style:Ye,children:X&&(0,W.jsx)(H.CopyToClipboard,{text:u,onCopy:function(){return O.ZP.success("复制成功")},children:(0,W.jsx)(F.Z,{title:"复制代码",children:(0,W.jsxs)("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"},children:[(0,W.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,u=e.modified,h=e.language,d=e.options,f=void 0===d?{}:d,p=(0,g.useRef)(),m=(0,g.useState)(null),v=c()(m,2),b=v[0],x=v[1];(0,g.useEffect)((function(){return p.current&&Promise.all([n.e(8909),n.e(9404)]).then(n.bind(n,2550)).then((function(e){var t=(K=e).editor.createDiffEditor(p.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},f),{},{wordWrap:!0}));x(t);var n=function(e){var t;return p.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(p.current),t}(t);return function(){t.dispose();var e=t.getModel();e&&e.dispose(),n.unobserve(p.current)}})),function(){window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}}),[]),(0,g.useEffect)((function(){b&&b.setModel({original:K.editor.createModel(s,h),modified:K.editor.createModel(u,h)})}),[s,u,h,b]);var w={width:U(i),height:U(a)};return(0,W.jsx)("div",{className:"my-diff-editor",ref:p,style:w})}},28329: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])}},75532:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return I}});var i=n(82242),r=n.n(i),o=n(7557),a=n.n(o),s=n(41498),l=n.n(s),u=n(79800),c=n.n(u),h=n(59301),d=n(62957),f=n(6767),p=n(25399),m=n(99571),v=n(458),g={flex_box_center:"flex_box_center___o6PS7",flex_space_between:"flex_space_between___jFqYR",flex_box_vertical_center:"flex_box_vertical_center___bkCsE",flex_box_center_end:"flex_box_center_end___mOjnB",flex_box_column:"flex_box_column___XDXIy",con_warp:"con_warp___q8d5e",all_wrap:"all_wrap___z_EMH",top:"top___pg2nl",left_warp:"left_warp___V0WlV",right_warp:"right_warp___csDNh",right_top:"right_top___hIcQZ",right_center:"right_center___NaPUB",sc_type:"sc_type___hRc_d",sc_lable:"sc_lable___LXq9N",interaction_warp:"interaction_warp___w7H1E",interaction_item:"interaction_item___eL48P",discuss:"discuss___U6lDy",item_warp:"item_warp___YuCMs",user_img:"user_img___Rqz2R",message:"message___JXxin",user_header:"user_header___UmCKv",user_name:"user_name___R8LoK",time:"time___Gk1um",reply:"reply___u_W1X",del_icon:"del_icon___kgB3r",pl_icon:"pl_icon___uTltN",close:"close___M9nrI"},y=n(51200),b=n(76805),x=n(51572),w=n(16039),_=n(88242),k=n(56656),C=n.n(k),S={wrp:"wrp___pCffY",bgBlack:"bgBlack___thUxV",monaco:"monaco___Ldorp",darkBlue:"darkBlue___U50In",close:"close___KlqKs",embed:"embed___Gw1Ga"},E=n(70557),L=n(50062),A=n(30406),T=n(62928),M=n(37286),D=n(87281),R=n(37712),B=function(e){var t,n,i,o,s,u,d,f=e.editOffice,v=void 0===f?"view":f,g=e.data,b=(e.theme,e.type),x=e.filename,w=e.monacoEditor,_=e.className,k=e.style,C=(e.close,e.onClose,e.hasMask),B=e.disabledDownload,N=(e.onImgDimensions,e.showNodata),P=e.resourceId,I=(0,h.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),O=c()(I,2),F=(O[0],O[1],(0,h.useState)("")),j=c()(F,2),z=(j[0],j[1]),H=(0,h.useState)(),W=c()(H,2),G=W[0],U=W[1],Z="build"===window.ENV?"/react/build":"",V=location.host.startsWith("localhost")?y.Z.PROXY_SERVER:y.Z.API_SERVER;console.log("disabledDownload---",B);var q=(0,h.useRef)();null!==(t=g)&&void 0!==t&&t.startsWith("/api")&&"txt"!==b&&(g=y.Z.API_SERVER+g),x&&(w.filename=x),(0,h.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]&&z(t[1])}))}),[]),(0,h.useEffect)((function(){"office"===b&&K()}),[b,g]);var K=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:",g),t=g,g.startsWith("http")||(t=location.origin+t),n=new URL(t).pathname.split("/").pop(),e.next=6,(0,T.gJ)({attachment_id:n});case 6:i=e.sent,U(i);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Y=function(){(0,A.Nd)(x||"educoder",decodeURIComponent(g)),X()},X=function(){(0,D.ZP)("/api/resource_libraries/".concat(P,"/add_download_count.json"),{method:"post"})};return console.log(g,"data"),(0,R.jsxs)("div",{style:r()({},k||{}),className:"".concat(C&&S.bgBlack," ").concat(b?S.wrp:"hide"),children:[(0,R.jsx)("div",{className:S.close,ref:q,children:!B&&(0,R.jsx)(p.Z,{title:"点击下载此文件",getPopupContainer:function(){return q.current},children:(0,R.jsx)("span",{onClick:Y,children:(0,R.jsx)("i",{className:"icon-quxiaozhiding"})})})}),(0,R.jsx)("div",{className:"".concat(S[_]," ").concat(_," ").concat(S.monaco," ").concat("txt"===b?"show":"hide"),children:"txt"===b&&(0,R.jsx)(L.ZP,r()({},w))}),"audio"===b&&(0,R.jsx)("audio",{src:(null===(n=g)||void 0===n?void 0:n.indexOf("http"))>-1||null!==(i=g)&&void 0!==i&&i.startsWith("/api")?g:"data:image/png;base64,".concat(g),autoPlay:!0}),"video"===b&&(0,R.jsx)(R.Fragment,{children:(null===(o=g)||void 0===o?void 0:o.indexOf("http"))>-1||null!==(s=g)&&void 0!==s&&s.startsWith("/api")?(0,R.jsx)("video",{controls:!0,src:"".concat(g),autoPlay:!0}):(0,R.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(g),autoPlay:!0})}),"office"===b&&G&&(0,R.jsx)("iframe",{src:"".concat(Z,"/office.html?key=").concat(G.key,"&url=").concat(V+G.url,"&callbackUrl=").concat(V+G.callbackUrl,"&fileType=").concat(G.fileType,"&title=").concat(G.title,"&model=").concat(v,"&officeServer=").concat(y.Z.ONLYOFFICE,"&disabledDownload=").concat(!!B)}),"html"===b&&(0,R.jsx)("iframe",{src:g+"&disposition=inline"}),"pdf"===b&&(0,R.jsx)("iframe",{src:"".concat(Z,"/js/pdfview/index.html?url=").concat(g,"&disabledDownload=").concat(!!B)}),"image"===b&&(0,R.jsx)("img",{src:(null===(u=g)||void 0===u?void 0:u.indexOf("http"))>-1||null!==(d=g)&&void 0!==d&&d.startsWith("/api")?g:"data:image/png;base64,".concat(g)}),("other"===b||"download"===b)&&(0,R.jsx)(R.Fragment,{children:N?(0,R.jsx)(M.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,R.jsx)(m.ZP,{icon:(0,R.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:function(){X(),g.startsWith("http")||g.startsWith("blob:")?Y():(0,A.Sv)(x||"educoder",g,x)},children:"下载"})}):(0,R.jsxs)(m.ZP,{type:"primary",size:"middle",onClick:Y,children:[(0,R.jsx)(E.Z,{}),"点击下载"]})})]})},N=n(25457),P=n(28329),I=(0,b.connect)((function(e){var t=e.virtualSpaces;return{globalSetting:e.globalSetting,virtualSpaces:t,user:e.user}}))((function(e){e.globalSetting,e.dispatch;var t,n,i,o,s,u,k,S,E,L,T,M,D=e.user,I=(e.virtualSpaces,(0,b.useLocation)()),O=new URLSearchParams(I.search),F=(0,b.useSearchParams)(),j=c()(F,1)[0],z=(0,b.useParams)(),H=(0,h.useState)(null),W=c()(H,2),G=W[0],U=W[1],Z=(0,h.useState)(!1),V=c()(Z,2),q=V[0],K=V[1],Y=(0,h.useState)(!1),X=c()(Y,2),J=X[0],Q=X[1],$=(0,h.useState)(!1),ee=c()($,2),te=ee[0],ne=ee[1],ie=(0,h.useState)({list:[],size:0}),re=c()(ie,2),oe=re[0],ae=re[1],se=(0,h.useState)(""),le=c()(se,2),ue=le[0],ce=le[1],he=(0,h.useState)(null),de=c()(he,2),fe=de[0],pe=de[1],me=(0,h.useState)(!1),ve=c()(me,2),ge=ve[0],ye=ve[1];(0,h.useEffect)((function(){be(),xe()}),[z.id]);var be=function(){var e=l()(a()().mark((function e(){var t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.Vs)(z.id);case 2:0===(null==(t=e.sent)?void 0:t.status)&&U(null==t?void 0:t.data);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),xe=function(){var e=l()(a()().mark((function e(){var t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ne(!0),e.next=3,(0,_.ur)(z.id);case 3:0===(null==(t=e.sent)?void 0:t.status)&&ae(null==t?void 0:t.data),ne(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),we=function(){var e=l()(a()().mark((function e(){var t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ye(!0),e.next=3,(0,_.eP)({id:z.id,comment:ue,parent_id:fe});case 3:0===(null==(t=e.sent)?void 0:t.status)&&(xe(),q?K(!1):Q(!1)),ye(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),_e=(0,h.useRef)(),ke=(0,h.useRef)(),Ce=(0,h.useRef)(5);(0,P.Z)(l()(a()().mark((function e(){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ke.current){e.next=3;break}return e.next=3,Se();case 3:case"end":return e.stop()}}),e)}))),1e3*Ce.current);var Se=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=e?{is_f:1}:{};return(0,N.DH)(r()(r()({},t),{id:null==G?void 0:G.video_item_id,point:_e.current.getLastUpdatedTime(),total:_e.current.getDuration()}))};return(0,R.jsxs)("div",{className:g.con_warp,children:[(0,R.jsxs)("div",{className:g.all_wrap,children:[(0,R.jsxs)("div",{className:g.top,children:[(0,R.jsxs)("div",{style:{color:"#999",cursor:"pointer",marginRight:10},onClick:function(){var e=O.get("activeTab");e?b.history.push("/account/newInfo?tabName=".concat(e)):b.history.push(j.get("backUrl"))},children:["<","返回"]}),(0,R.jsx)("div",{style:{color:"#333"},children:null==G?void 0:G.name})]}),(0,R.jsxs)("div",{style:{display:"flex",minHeight:735},children:[(0,R.jsxs)("div",{className:g.left_warp,children:["video"==(null==G||null===(t=G.attachment)||void 0===t?void 0:t.file_type)&&"teacher"==(null==D||null===(n=D.userInfo)||void 0===n?void 0:n.identity)&&(0,R.jsx)("div",{className:g.close,children:(0,R.jsx)(p.Z,{title:"点击下载此文件",children:(0,R.jsx)("span",{onClick:function(){var e,t;(0,A.Nd)((null==G||null===(e=G.attachment)||void 0===e?void 0:e.title)||"educoder",decodeURIComponent(null==G||null===(t=G.attachment)||void 0===t?void 0:t.url))},children:(0,R.jsx)("i",{className:"icon-quxiaozhiding"})})})}),"video"==(null==G||null===(i=G.attachment)||void 0===i?void 0:i.file_type)?(0,R.jsx)("div",{style:{padding:"30px 20px"},children:(0,R.jsx)(x.Z,{ref:_e,startTime:0,src:null==G||null===(o=G.attachment)||void 0===o?void 0:o.url,videoId:null==G?void 0:G.video_item_id,handlePause:function(){ke.current=!1},handlePlay:function(){ke.current=!0},toLog:function(){}})}):(0,R.jsx)(B,{close:!0,data:null==G||null===(s=G.attachment)||void 0===s?void 0:s.url,type:null==G||null===(u=G.attachment)||void 0===u?void 0:u.file_type,disabledDownload:"teacher"!=(null==D||null===(k=D.userInfo)||void 0===k?void 0:k.identity),resourceId:null==z?void 0:z.id})]}),(0,R.jsxs)("div",{className:g.right_warp,children:[(0,R.jsxs)("div",{className:g.right_top,children:[(0,R.jsxs)("div",{className:g.sc_type,children:[(0,R.jsx)("span",{children:"知识点"}),(0,R.jsx)("div",{style:{maxWidth:200},children:(null==G||null===(S=G.resource_knowledge_point)||void 0===S?void 0:S.name)||"--"})]}),(0,R.jsxs)("div",{style:{display:"flex"},children:[(0,R.jsxs)("div",{className:g.sc_type,children:[(0,R.jsx)("span",{children:"思政点"}),(0,R.jsx)("div",{children:(null==G||null===(E=G.political_point)||void 0===E?void 0:E.name)||"--"})]}),(0,R.jsxs)("div",{className:g.sc_type,style:{marginLeft:20},children:[(0,R.jsx)("span",{children:"实施方式"}),(0,R.jsx)("div",{children:(null==G||null===(L=G.embodiment)||void 0===L?void 0:L.name)||"--"})]})]}),(0,R.jsx)("div",{style:{display:"flex",flexWrap:"wrap"},children:null==G||null===(T=G.tags)||void 0===T?void 0:T.map((function(e,t){return(0,R.jsx)("div",{className:g.sc_lable,children:null==e?void 0:e.name},t)}))}),(0,R.jsxs)("div",{className:g.interaction_warp,children:[(0,R.jsxs)("div",{className:g.interaction_item,onClick:function(){(0,_.sv)(null==G?void 0:G.user_like,null==G?void 0:G.id,(function(){G.user_like?(G.user_like=!1,G.like_count=G.like_count-1):(G.user_like=!0,G.like_count=G.like_count+1),U(r()({},G))}))},children:[(0,R.jsx)("i",{className:"iconfont icon-dianzan7 mt5",style:{color:(null==G?void 0:G.user_like)&&"#37AD83"}}),(0,R.jsxs)("span",{children:[null!=G&&G.user_like?"已点赞":"点赞","(",null==G?void 0:G.like_count,")"]})]}),(0,R.jsxs)("div",{className:g.interaction_item,onClick:function(){(0,_._L)(null==G?void 0:G.user_collect,null==G?void 0:G.id,(function(){G.user_collect?(G.user_collect=!1,G.collect_count=G.collect_count-1):(G.user_collect=!0,G.collect_count=G.collect_count+1),U(r()({},G))}))},children:[(0,R.jsx)("i",{className:"iconfont icon-shoucang2 mt5",style:{color:(null==G?void 0:G.user_collect)&&"#FFB538"}}),(0,R.jsxs)("span",{children:[null!=G&&G.user_collect?"已收藏":"收藏","(",null==G?void 0:G.collect_count,")"]})]}),(0,R.jsxs)("div",{className:g.interaction_item,children:[(0,R.jsx)("i",{className:"iconfont icon-xiazai7 mt5",style:{color:"#666"}}),(0,R.jsxs)("span",{children:["下载(",null==G?void 0:G.download_count,")"]})]})]})]}),(0,R.jsxs)("div",{className:g.right_center,children:[(0,R.jsxs)("div",{style:{display:"flex"},children:[(0,R.jsx)("i",{className:"iconfont icon-hudongpinglunshu",style:{position:"relative",top:1,color:"#50DCB6",fontSize:20}}),(0,R.jsxs)("span",{style:{margin:"0 10px 0 8px"},children:["评论(",null==oe?void 0:oe.size,")"]})]}),(0,R.jsxs)(m.ZP,{color:"primary",style:{borderColor:"rgba(1,88,39,0.3)",color:"#1B8565",padding:"0 9px"},onClick:function(){pe(null),Q(!0)},children:[(0,R.jsx)("i",{className:"iconfont icon-bianji12",style:{fontSize:14,marginRight:6}}),(0,R.jsx)("span",{children:"发布新评论"})]})]}),(0,R.jsx)("div",{className:g.discuss,children:(0,R.jsx)(v.Z,{loading:te,style:{margin:"20px 0"},children:null==oe||null===(M=oe.list)||void 0===M?void 0:M.map((function(e,t){var n,i,r,o;return(0,R.jsxs)("div",{className:g.item_warp,children:[(0,R.jsx)("img",{src:"".concat(null===y.Z||void 0===y.Z?void 0:y.Z.IMG_SERVER,"/images/").concat(null==e||null===(n=e.user)||void 0===n?void 0:n.image_url),className:g.user_img}),(0,R.jsxs)("div",{style:{width:"100%"},children:[(0,R.jsxs)("div",{className:g.user_header,children:[(0,R.jsx)("div",{className:g.user_name,children:null==e||null===(i=e.user)||void 0===i?void 0:i.name}),(0,R.jsx)("div",{className:g.time,children:C()(null==e?void 0:e.created_at).format("YYYY-MM-DD HH:mm:ss")})]}),(0,R.jsx)("div",{className:g.message,dangerouslySetInnerHTML:{__html:null==e?void 0:e.comment}}),(null==e||null===(r=e.children)||void 0===r?void 0:r.length)>0&&(0,R.jsx)("div",{className:g.reply,children:null==e||null===(o=e.children)||void 0===o?void 0:o.map((function(t,n){var i,r;return(0,R.jsxs)("div",{className:g.reply_item,children:[(0,R.jsxs)("div",{className:g.user_header,children:[(0,R.jsx)("div",{className:g.user_name,children:null==t||null===(i=t.user)||void 0===i?void 0:i.name}),(0,R.jsx)("div",{className:g.time,children:C()(null==t?void 0:t.created_at).format("YYYY-MM-DD HH:mm:ss")})]}),(0,R.jsx)("div",{dangerouslySetInnerHTML:{__html:null==t?void 0:t.comment},className:g.message,style:{marginBottom:n==(null==e||null===(r=e.children)||void 0===r?void 0:r.length)-1?"0":"8px"}})]},n)}))}),(0,R.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",color:"#B2BACB"},children:[(0,R.jsx)("i",{className:"iconfont icon-a-huifupinglun ".concat(null==g?void 0:g.pl_icon),onClick:function(){pe(null==e?void 0:e.id),K(!0)}}),(0,R.jsx)("i",{className:"iconfont icon-yishanchu ".concat(null==g?void 0:g.del_icon),onClick:function(){var t,n;t={id:null==e?void 0:e.id},d.Z.confirm({centered:!0,width:480,okText:"确定",cancelText:"取消",title:"提示",content:(0,R.jsx)("div",{className:"tc font16",children:"是否确认删除评论?"}),onOk:(n=l()(a()().mark((function e(){var n;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.tr)(t);case 2:0==(null==(n=e.sent)?void 0:n.status)&&(f.ZP.success("删除成功"),xe());case 4:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})})}})]})]})]},t)}))})})]})]})]}),(0,R.jsx)(d.Z,{title:q?"发布评论":"发布新评论",open:q||J,width:700,afterClose:function(){ce("")},centered:!0,onOk:we,onCancel:function(){q?K(!1):Q(!1)},okText:"发送",confirmLoading:ge,children:(0,R.jsx)(w.Z,{defaultValue:ue,onChange:function(e){ce(e)}})})]})}))},88242:function(e,t,n){"use strict";n.d(t,{Em:function(){return d},FW:function(){return c},Vj:function(){return _},Vs:function(){return p},_L:function(){return B},_w:function(){return E},a6:function(){return C},eP:function(){return y},iq:function(){return l},sv:function(){return R},tr:function(){return x},ur:function(){return v}});var i=n(7557),r=n.n(i),o=n(41498),a=n.n(o),s=n(87281);function l(){return u.apply(this,arguments)}function u(){return(u=a()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,s.ZP)("/api/resource_libraries/get_create_info.json",{method:"get"}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function c(e){return h.apply(this,arguments)}function h(){return(h=a()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,s.ZP)("/api/resource_libraries.json",{method:"post",body:t}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function d(e){return f.apply(this,arguments)}function f(){return(f=a()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,s.ZP)("/api/resource_libraries/".concat(null==t?void 0:t.id,".json"),{method:"put",body:t}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e){return m.apply(this,arguments)}function m(){return(m=a()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,s.ZP)("/api/resource_libraries/".concat(t,".json"),{method:"get"}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(e){return g.apply(this,arguments)}function g(){return(g=a()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,s.ZP)("/api/resource_libraries/".concat(t,"/resource_comments.json"),{method:"get"}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function y(e){return b.apply(this,arguments)}function b(){return(b=a()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,s.ZP)("/api/resource_libraries/".concat(null==t?void 0:t.id,"/send_comments"),{method:"post",body:t}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function x(e){return w.apply(this,arguments)}function w(){return(w=a()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,s.ZP)("/api/resource_libraries/destroy_comment.json",{method:"post",body:t}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _(e){return k.apply(this,arguments)}function k(){return(k=a()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,s.ZP)("/api/resource_libraries/".concat(null==t?void 0:t.id,"/submit_review.json"),{method:"post",body:t}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function C(e){return S.apply(this,arguments)}function S(){return(S=a()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,s.ZP)("/api/resource_libraries/".concat(null==t?void 0:t.id,"/cancel_public.json"),{method:"post",body:t}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function E(e){return L.apply(this,arguments)}function L(){return(L=a()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,s.ZP)("/api/resource_libraries/".concat(null==t?void 0:t.id,".json"),{method:"delete",body:t}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function A(e){return T.apply(this,arguments)}function T(){return(T=a()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,s.ZP)("/api/resource_libraries/".concat(null==t?void 0:t.id,"/like.json"),{method:"post",body:t}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function M(e){return D.apply(this,arguments)}function D(){return(D=a()(r()().mark((function e(t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,s.ZP)("/api/resource_libraries/".concat(null==t?void 0:t.id,"/collect.json"),{method:"post",body:t}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var R=function(){var e=a()(r()().mark((function e(t,n,i){var o;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,A({id:n,type:t?2:1});case 2:0==(null==(o=e.sent)?void 0:o.status)&&i();case 4:case"end":return e.stop()}}),e)})));return function(t,n,i){return e.apply(this,arguments)}}(),B=function(){var e=a()(r()().mark((function e(t,n,i){var o;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M({id:n,type:t?2:1});case 2:0==(null==(o=e.sent)?void 0:o.status)&&i();case 4:case"end":return e.stop()}}),e)})));return function(t,n,i){return e.apply(this,arguments)}}()},16993:function(e,t,n){"use strict";function i(e){try{e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen&&e.webkitRequestFullScreen()}catch(e){console.log(e,":e")}}function r(){window.top.document.webkitExitFullscreen?window.top.document.webkitExitFullscreen():document.exitFullscreen?window.top.document.exitFullscreen():document.msExitFullscreen?window.top.document.msExitFullscreen():document.mozCancelFullScreen&&window.top.document.mozCancelFullScreen()}n.d(t,{BU:function(){return r},Dj:function(){return i},gH:function(){return o},vp:function(){return a}});var o=function(){return document.webkitExitFullscreen?"webkitfullscreenchange":document.exitFullscreen?"fullscreenchange":document.msExitFullscreen?"msfullscreenchange":document.mozCancelFullScreen?"mozfullscreenchange":void 0};function a(){var e=window.top.document.fullscreenElement||window.top.document.mozFullscreenElement||window.top.document.webkitFullscreenElement;document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled;return console.log("fullscreenElement",e),window.isFullScreen?window.isFullScreen:null!=e}},8426:function(e,t,n){"use strict";n.d(t,{AL:function(){return k},Iy:function(){return f},Qv:function(){return v},ez:function(){return _},jb:function(){return p}});var i=n(79800),r=n.n(i),o=n(32834),a=n.n(o),s=n(11690),l=1;var u=[],c=["<ul>"],h=new(a().Renderer),d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function f(){u.length=0,c=["<ul>"]}var p={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 v(){return m(u,0,0,c),c.push("</ul>"),c.join("")}var g={heading:function(e){var t=d.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=x(),s=i;i=a,w[a]={type:"block",expression:s}}return{type:"code",raw:n,lang:o,text:i}}}},y=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,x=function(){return"__special_katext_id_".concat(b++,"__")},w={};function _(){return w}function k(){b=0,w={}}function C(e){return e=e.replace(y,(function(e,t){var n=x();return w[n]={type:"inline",expression:t},n}))}var S=h.listitem;h.listitem=function(e){return S(C(e))};var E=h.paragraph;h.paragraph=function(e){return E(C(e))};var L=h.tablecell;h.tablecell=function(e,t){return L(C(e),t)},h.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>"},h.heading=function(e,t,n){var i=this.options.headerPrefix+n.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return u.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:g,renderer:h}),t.ZP=a()},79921:function(e,t,n){"use strict";n.d(t,{Z:function(){return ke}});var i=n(31468),r=n.n(i),o=n(82100),a=n.n(o),s=n(29186),l=n.n(s),u=function(){function e(){a()(this,e)}return l()(e,null,[{key:"install",value:function(){Object.setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Object.assign=Object.assign||function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r])}return t},"function"!=typeof self.Promise&&n(3867).polyfill()}}]),e}();u.install();var c=u,h=n(86204),d=n.n(h),f=function(){function e(){a()(this,e)}return l()(e,null,[{key:"e",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&e.emitter.emit("log","error",i),e.ENABLE_ERROR&&(console.error?console.error(i):console.warn?console.warn(i):console.log(i))}},{key:"i",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&e.emitter.emit("log","info",i),e.ENABLE_INFO&&(console.info?console.info(i):console.log(i))}},{key:"w",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&e.emitter.emit("log","warn",i),e.ENABLE_WARN&&(console.warn?console.warn(i):console.log(i))}},{key:"d",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&e.emitter.emit("log","debug",i),e.ENABLE_DEBUG&&(console.debug?console.debug(i):console.log(i))}},{key:"v",value:function(t,n){t&&!e.FORCE_GLOBAL_TAG||(t=e.GLOBAL_TAG);var i="[".concat(t,"] > ").concat(n);e.ENABLE_CALLBACK&&e.emitter.emit("log","verbose",i),e.ENABLE_VERBOSE&&console.log(i)}}]),e}();f.GLOBAL_TAG="flv.js",f.FORCE_GLOBAL_TAG=!1,f.ENABLE_ERROR=!0,f.ENABLE_INFO=!0,f.ENABLE_WARN=!0,f.ENABLE_DEBUG=!0,f.ENABLE_VERBOSE=!0,f.ENABLE_CALLBACK=!1,f.emitter=new(d());var p=f,m=function(){function e(){a()(this,e),this._firstCheckpoint=0,this._lastCheckpoint=0,this._intervalBytes=0,this._totalBytes=0,this._lastSecondBytes=0,self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now}return l()(e,[{key:"reset",value:function(){this._firstCheckpoint=this._lastCheckpoint=0,this._totalBytes=this._intervalBytes=0,this._lastSecondBytes=0}},{key:"addBytes",value:function(e){0===this._firstCheckpoint?(this._firstCheckpoint=this._now(),this._lastCheckpoint=this._firstCheckpoint,this._intervalBytes+=e,this._totalBytes+=e):this._now()-this._lastCheckpoint<1e3?(this._intervalBytes+=e,this._totalBytes+=e):(this._lastSecondBytes=this._intervalBytes,this._intervalBytes=e,this._totalBytes+=e,this._lastCheckpoint=this._now())}},{key:"currentKBps",get:function(){this.addBytes(0);var e=(this._now()-this._lastCheckpoint)/1e3;return 0==e&&(e=1),this._intervalBytes/e/1024}},{key:"lastSecondKBps",get:function(){return this.addBytes(0),0!==this._lastSecondBytes?this._lastSecondBytes/1024:this._now()-this._lastCheckpoint>=500?this.currentKBps:0}},{key:"averageKBps",get:function(){var e=(this._now()-this._firstCheckpoint)/1e3;return this._totalBytes/e/1024}}]),e}(),v=n(80619),g=n.n(v),y=n(47074),b=n.n(y),x=function(){function e(t){a()(this,e),this._message=t}return l()(e,[{key:"name",get:function(){return"RuntimeException"}},{key:"message",get:function(){return this._message}},{key:"toString",value:function(){return this.name+": "+this.message}}]),e}(),w=function(e){g()(n,e);var t=b()(n);function n(e){return a()(this,n),t.call(this,e)}return l()(n,[{key:"name",get:function(){return"IllegalStateException"}}]),n}(x),_=function(e){g()(n,e);var t=b()(n);function n(e){return a()(this,n),t.call(this,e)}return l()(n,[{key:"name",get:function(){return"InvalidArgumentException"}}]),n}(x),k=function(e){g()(n,e);var t=b()(n);function n(e){return a()(this,n),t.call(this,e)}return l()(n,[{key:"name",get:function(){return"NotImplementedException"}}]),n}(x),C={kIdle:0,kConnecting:1,kBuffering:2,kError:3,kComplete:4},S={OK:"OK",EXCEPTION:"Exception",HTTP_STATUS_CODE_INVALID:"HttpStatusCodeInvalid",CONNECTING_TIMEOUT:"ConnectingTimeout",EARLY_EOF:"EarlyEof",UNRECOVERABLE_EARLY_EOF:"UnrecoverableEarlyEof"},E=function(){function e(t){a()(this,e),this._type=t||"undefined",this._status=C.kIdle,this._needStash=!1,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}return l()(e,[{key:"destroy",value:function(){this._status=C.kIdle,this._onContentLengthKnown=null,this._onURLRedirect=null,this._onDataArrival=null,this._onError=null,this._onComplete=null}},{key:"isWorking",value:function(){return this._status===C.kConnecting||this._status===C.kBuffering}},{key:"type",get:function(){return this._type}},{key:"status",get:function(){return this._status}},{key:"needStashBuffer",get:function(){return this._needStash}},{key:"onContentLengthKnown",get:function(){return this._onContentLengthKnown},set:function(e){this._onContentLengthKnown=e}},{key:"onURLRedirect",get:function(){return this._onURLRedirect},set:function(e){this._onURLRedirect=e}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e}},{key:"onError",get:function(){return this._onError},set:function(e){this._onError=e}},{key:"onComplete",get:function(){return this._onComplete},set:function(e){this._onComplete=e}},{key:"open",value:function(e,t){throw new k("Unimplemented abstract function!")}},{key:"abort",value:function(){throw new k("Unimplemented abstract function!")}}]),e}(),L=n(4811),A=n.n(L),T=n(34577),M=n.n(T),D={};!function(){var e=self.navigator.userAgent.toLowerCase(),t=/(edge)\/([\w.]+)/.exec(e)||/(opr)[\/]([\w.]+)/.exec(e)||/(chrome)[ \/]([\w.]+)/.exec(e)||/(iemobile)[\/]([\w.]+)/.exec(e)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(firefox)[ \/]([\w.]+)/.exec(e)||[],n=/(ipad)/.exec(e)||/(ipod)/.exec(e)||/(windows phone)/.exec(e)||/(iphone)/.exec(e)||/(kindle)/.exec(e)||/(android)/.exec(e)||/(windows)/.exec(e)||/(mac)/.exec(e)||/(linux)/.exec(e)||/(cros)/.exec(e)||[],i={browser:t[5]||t[3]||t[1]||"",version:t[2]||t[4]||"0",majorVersion:t[4]||t[2]||"0",platform:n[0]||""},r={};if(i.browser){r[i.browser]=!0;var o=i.majorVersion.split(".");r.version={major:parseInt(i.majorVersion,10),string:i.version},o.length>1&&(r.version.minor=parseInt(o[1],10)),o.length>2&&(r.version.build=parseInt(o[2],10))}if(i.platform&&(r[i.platform]=!0),(r.chrome||r.opr||r.safari)&&(r.webkit=!0),r.rv||r.iemobile){r.rv&&delete r.rv;var a="msie";i.browser=a,r[a]=!0}if(r.edge){delete r.edge;var s="msedge";i.browser=s,r[s]=!0}if(r.opr){var l="opera";i.browser=l,r[l]=!0}if(r.safari&&r.android){var u="android";i.browser=u,r[u]=!0}for(var c in r.name=i.browser,r.platform=i.platform,D)D.hasOwnProperty(c)&&delete D[c];Object.assign(D,r)}();var R=D,B=function(e){g()(n,e);var t=b()(n);function n(e,i){var r;return a()(this,n),(r=t.call(this,"fetch-stream-loader")).TAG="FetchStreamLoader",r._seekHandler=e,r._config=i,r._needStash=!0,r._requestAbort=!1,r._contentLength=null,r._receivedLength=0,r}return l()(n,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),A()(M()(n.prototype),"destroy",this).call(this)}},{key:"open",value:function(e,t){var n=this;this._dataSource=e,this._range=t;var i=e.url;this._config.reuseRedirectedURL&&null!=e.redirectedURL&&(i=e.redirectedURL);var o=this._seekHandler.getConfig(i,t),a=new self.Headers;if("object"===r()(o.headers)){var s=o.headers;for(var l in s)s.hasOwnProperty(l)&&a.append(l,s[l])}var u={method:"GET",headers:a,mode:"cors",cache:"default",referrerPolicy:"no-referrer-when-downgrade"};if("object"===r()(this._config.headers))for(var c in this._config.headers)a.append(c,this._config.headers[c]);!1===e.cors&&(u.mode="same-origin"),e.withCredentials&&(u.credentials="include"),e.referrerPolicy&&(u.referrerPolicy=e.referrerPolicy),this._status=C.kConnecting,self.fetch(o.url,u).then((function(e){if(n._requestAbort)return n._requestAbort=!1,void(n._status=C.kIdle);if(e.ok&&e.status>=200&&e.status<=299){if(e.url!==o.url&&n._onURLRedirect){var t=n._seekHandler.removeURLParameters(e.url);n._onURLRedirect(t)}var i=e.headers.get("Content-Length");return null!=i&&(n._contentLength=parseInt(i),0!==n._contentLength&&n._onContentLengthKnown&&n._onContentLengthKnown(n._contentLength)),n._pump.call(n,e.body.getReader())}if(n._status=C.kError,!n._onError)throw new x("FetchStreamLoader: Http code invalid, "+e.status+" "+e.statusText);n._onError(S.HTTP_STATUS_CODE_INVALID,{code:e.status,msg:e.statusText})})).catch((function(e){if(n._status=C.kError,!n._onError)throw e;n._onError(S.EXCEPTION,{code:-1,msg:e.message})}))}},{key:"abort",value:function(){this._requestAbort=!0}},{key:"_pump",value:function(e){var t=this;return e.read().then((function(n){if(n.done)if(null!==t._contentLength&&t._receivedLength<t._contentLength){t._status=C.kError;var i=S.EARLY_EOF,r={code:-1,msg:"Fetch stream meet Early-EOF"};if(!t._onError)throw new x(r.msg);t._onError(i,r)}else t._status=C.kComplete,t._onComplete&&t._onComplete(t._range.from,t._range.from+t._receivedLength-1);else{if(!0===t._requestAbort)return t._requestAbort=!1,t._status=C.kComplete,e.cancel();t._status=C.kBuffering;var o=n.value.buffer,a=t._range.from+t._receivedLength;t._receivedLength+=o.byteLength,t._onDataArrival&&t._onDataArrival(o,a,t._receivedLength),t._pump(e)}})).catch((function(e){if(11!==e.code||!R.msedge){t._status=C.kError;var n=0,i=null;if(19!==e.code&&"network error"!==e.message||!(null===t._contentLength||null!==t._contentLength&&t._receivedLength<t._contentLength)?(n=S.EXCEPTION,i={code:e.code,msg:e.message}):(n=S.EARLY_EOF,i={code:e.code,msg:"Fetch stream meet Early-EOF"}),!t._onError)throw new x(i.msg);t._onError(n,i)}}))}}],[{key:"isSupported",value:function(){try{var e=R.msedge&&R.version.minor>=15048,t=!R.msedge||e;return self.fetch&&self.ReadableStream&&t}catch(e){return!1}}}]),n}(E),N=function(e){g()(n,e);var t=b()(n);function n(e,i){var r;return a()(this,n),(r=t.call(this,"xhr-moz-chunked-loader")).TAG="MozChunkedLoader",r._seekHandler=e,r._config=i,r._needStash=!0,r._xhr=null,r._requestAbort=!1,r._contentLength=null,r._receivedLength=0,r}return l()(n,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onloadend=null,this._xhr.onerror=null,this._xhr=null),A()(M()(n.prototype),"destroy",this).call(this)}},{key:"open",value:function(e,t){this._dataSource=e,this._range=t;var n=e.url;this._config.reuseRedirectedURL&&null!=e.redirectedURL&&(n=e.redirectedURL);var i=this._seekHandler.getConfig(n,t);this._requestURL=i.url;var o=this._xhr=new XMLHttpRequest;if(o.open("GET",i.url,!0),o.responseType="moz-chunked-arraybuffer",o.onreadystatechange=this._onReadyStateChange.bind(this),o.onprogress=this._onProgress.bind(this),o.onloadend=this._onLoadEnd.bind(this),o.onerror=this._onXhrError.bind(this),e.withCredentials&&(o.withCredentials=!0),"object"===r()(i.headers)){var a=i.headers;for(var s in a)a.hasOwnProperty(s)&&o.setRequestHeader(s,a[s])}if("object"===r()(this._config.headers)){var l=this._config.headers;for(var u in l)l.hasOwnProperty(u)&&o.setRequestHeader(u,l[u])}this._status=C.kConnecting,o.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._xhr&&this._xhr.abort(),this._status=C.kComplete}},{key:"_onReadyStateChange",value:function(e){var t=e.target;if(2===t.readyState){if(null!=t.responseURL&&t.responseURL!==this._requestURL&&this._onURLRedirect){var n=this._seekHandler.removeURLParameters(t.responseURL);this._onURLRedirect(n)}if(0!==t.status&&(t.status<200||t.status>299)){if(this._status=C.kError,!this._onError)throw new x("MozChunkedLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(S.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}else this._status=C.kBuffering}}},{key:"_onProgress",value:function(e){if(this._status!==C.kError){null===this._contentLength&&null!==e.total&&0!==e.total&&(this._contentLength=e.total,this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength));var t=e.target.response,n=this._range.from+this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,n,this._receivedLength)}}},{key:"_onLoadEnd",value:function(e){!0!==this._requestAbort?this._status!==C.kError&&(this._status=C.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1)):this._requestAbort=!1}},{key:"_onXhrError",value:function(e){this._status=C.kError;var t=0,n=null;if(this._contentLength&&e.loaded<this._contentLength?(t=S.EARLY_EOF,n={code:-1,msg:"Moz-Chunked stream meet Early-Eof"}):(t=S.EXCEPTION,n={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new x(n.msg);this._onError(t,n)}}],[{key:"isSupported",value:function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="moz-chunked-arraybuffer","moz-chunked-arraybuffer"===e.responseType}catch(e){return p.w("MozChunkedLoader",e.message),!1}}}]),n}(E),P=function(e){g()(n,e);var t=b()(n);function n(e,i){var r;return a()(this,n),(r=t.call(this,"xhr-range-loader")).TAG="RangeLoader",r._seekHandler=e,r._config=i,r._needStash=!1,r._chunkSizeKBList=[128,256,384,512,768,1024,1536,2048,3072,4096,5120,6144,7168,8192],r._currentChunkSizeKB=384,r._currentSpeedNormalized=0,r._zeroSpeedChunkCount=0,r._xhr=null,r._speedSampler=new m,r._requestAbort=!1,r._waitForTotalLength=!1,r._totalLengthReceived=!1,r._currentRequestURL=null,r._currentRedirectedURL=null,r._currentRequestRange=null,r._totalLength=null,r._contentLength=null,r._receivedLength=0,r._lastTimeLoaded=0,r}return l()(n,[{key:"destroy",value:function(){this.isWorking()&&this.abort(),this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr=null),A()(M()(n.prototype),"destroy",this).call(this)}},{key:"currentSpeed",get:function(){return this._speedSampler.lastSecondKBps}},{key:"open",value:function(e,t){this._dataSource=e,this._range=t,this._status=C.kConnecting;var n=!1;null!=this._dataSource.filesize&&0!==this._dataSource.filesize&&(n=!0,this._totalLength=this._dataSource.filesize),this._totalLengthReceived||n?this._openSubRange():(this._waitForTotalLength=!0,this._internalOpen(this._dataSource,{from:0,to:-1}))}},{key:"_openSubRange",value:function(){var e=1024*this._currentChunkSizeKB,t=this._range.from+this._receivedLength,n=t+e;null!=this._contentLength&&n-this._range.from>=this._contentLength&&(n=this._range.from+this._contentLength-1),this._currentRequestRange={from:t,to:n},this._internalOpen(this._dataSource,this._currentRequestRange)}},{key:"_internalOpen",value:function(e,t){this._lastTimeLoaded=0;var n=e.url;this._config.reuseRedirectedURL&&(null!=this._currentRedirectedURL?n=this._currentRedirectedURL:null!=e.redirectedURL&&(n=e.redirectedURL));var i=this._seekHandler.getConfig(n,t);this._currentRequestURL=i.url;var o=this._xhr=new XMLHttpRequest;if(o.open("GET",i.url,!0),o.responseType="arraybuffer",o.onreadystatechange=this._onReadyStateChange.bind(this),o.onprogress=this._onProgress.bind(this),o.onload=this._onLoad.bind(this),o.onerror=this._onXhrError.bind(this),e.withCredentials&&(o.withCredentials=!0),"object"===r()(i.headers)){var a=i.headers;for(var s in a)a.hasOwnProperty(s)&&o.setRequestHeader(s,a[s])}if("object"===r()(this._config.headers)){var l=this._config.headers;for(var u in l)l.hasOwnProperty(u)&&o.setRequestHeader(u,l[u])}o.send()}},{key:"abort",value:function(){this._requestAbort=!0,this._internalAbort(),this._status=C.kComplete}},{key:"_internalAbort",value:function(){this._xhr&&(this._xhr.onreadystatechange=null,this._xhr.onprogress=null,this._xhr.onload=null,this._xhr.onerror=null,this._xhr.abort(),this._xhr=null)}},{key:"_onReadyStateChange",value:function(e){var t=e.target;if(2===t.readyState){if(null!=t.responseURL){var n=this._seekHandler.removeURLParameters(t.responseURL);t.responseURL!==this._currentRequestURL&&n!==this._currentRedirectedURL&&(this._currentRedirectedURL=n,this._onURLRedirect&&this._onURLRedirect(n))}if(t.status>=200&&t.status<=299){if(this._waitForTotalLength)return;this._status=C.kBuffering}else{if(this._status=C.kError,!this._onError)throw new x("RangeLoader: Http code invalid, "+t.status+" "+t.statusText);this._onError(S.HTTP_STATUS_CODE_INVALID,{code:t.status,msg:t.statusText})}}}},{key:"_onProgress",value:function(e){if(this._status!==C.kError){if(null===this._contentLength){var t=!1;if(this._waitForTotalLength){this._waitForTotalLength=!1,this._totalLengthReceived=!0,t=!0;var n=e.total;this._internalAbort(),null!=n&0!==n&&(this._totalLength=n)}if(-1===this._range.to?this._contentLength=this._totalLength-this._range.from:this._contentLength=this._range.to-this._range.from+1,t)return void this._openSubRange();this._onContentLengthKnown&&this._onContentLengthKnown(this._contentLength)}var i=e.loaded-this._lastTimeLoaded;this._lastTimeLoaded=e.loaded,this._speedSampler.addBytes(i)}}},{key:"_normalizeSpeed",value:function(e){var t=this._chunkSizeKBList,n=t.length-1,i=0,r=0,o=n;if(e<t[0])return t[0];for(;r<=o;){if((i=r+Math.floor((o-r)/2))===n||e>=t[i]&&e<t[i+1])return t[i];t[i]<e?r=i+1:o=i-1}}},{key:"_onLoad",value:function(e){if(this._status!==C.kError)if(this._waitForTotalLength)this._waitForTotalLength=!1;else{this._lastTimeLoaded=0;var t=this._speedSampler.lastSecondKBps;if(0===t&&(this._zeroSpeedChunkCount++,this._zeroSpeedChunkCount>=3&&(t=this._speedSampler.currentKBps)),0!==t){var n=this._normalizeSpeed(t);this._currentSpeedNormalized!==n&&(this._currentSpeedNormalized=n,this._currentChunkSizeKB=n)}var i=e.target.response,r=this._range.from+this._receivedLength;this._receivedLength+=i.byteLength;var o=!1;null!=this._contentLength&&this._receivedLength<this._contentLength?this._openSubRange():o=!0,this._onDataArrival&&this._onDataArrival(i,r,this._receivedLength),o&&(this._status=C.kComplete,this._onComplete&&this._onComplete(this._range.from,this._range.from+this._receivedLength-1))}}},{key:"_onXhrError",value:function(e){this._status=C.kError;var t=0,n=null;if(this._contentLength&&this._receivedLength>0&&this._receivedLength<this._contentLength?(t=S.EARLY_EOF,n={code:-1,msg:"RangeLoader meet Early-Eof"}):(t=S.EXCEPTION,n={code:-1,msg:e.constructor.name+" "+e.type}),!this._onError)throw new x(n.msg);this._onError(t,n)}}],[{key:"isSupported",value:function(){try{var e=new XMLHttpRequest;return e.open("GET","https://example.com",!0),e.responseType="arraybuffer","arraybuffer"===e.responseType}catch(e){return p.w("RangeLoader",e.message),!1}}}]),n}(E),I=function(e){g()(n,e);var t=b()(n);function n(){var e;return a()(this,n),(e=t.call(this,"websocket-loader")).TAG="WebSocketLoader",e._needStash=!0,e._ws=null,e._requestAbort=!1,e._receivedLength=0,e}return l()(n,[{key:"destroy",value:function(){this._ws&&this.abort(),A()(M()(n.prototype),"destroy",this).call(this)}},{key:"open",value:function(e){try{var t=this._ws=new self.WebSocket(e.url);t.binaryType="arraybuffer",t.onopen=this._onWebSocketOpen.bind(this),t.onclose=this._onWebSocketClose.bind(this),t.onmessage=this._onWebSocketMessage.bind(this),t.onerror=this._onWebSocketError.bind(this),this._status=C.kConnecting}catch(e){this._status=C.kError;var n={code:e.code,msg:e.message};if(!this._onError)throw new x(n.msg);this._onError(S.EXCEPTION,n)}}},{key:"abort",value:function(){var e=this._ws;!e||0!==e.readyState&&1!==e.readyState||(this._requestAbort=!0,e.close()),this._ws=null,this._status=C.kComplete}},{key:"_onWebSocketOpen",value:function(e){this._status=C.kBuffering}},{key:"_onWebSocketClose",value:function(e){!0!==this._requestAbort?(this._status=C.kComplete,this._onComplete&&this._onComplete(0,this._receivedLength-1)):this._requestAbort=!1}},{key:"_onWebSocketMessage",value:function(e){var t=this;if(e.data instanceof ArrayBuffer)this._dispatchArrayBuffer(e.data);else if(e.data instanceof Blob){var n=new FileReader;n.onload=function(){t._dispatchArrayBuffer(n.result)},n.readAsArrayBuffer(e.data)}else{this._status=C.kError;var i={code:-1,msg:"Unsupported WebSocket message type: "+e.data.constructor.name};if(!this._onError)throw new x(i.msg);this._onError(S.EXCEPTION,i)}}},{key:"_dispatchArrayBuffer",value:function(e){var t=e,n=this._receivedLength;this._receivedLength+=t.byteLength,this._onDataArrival&&this._onDataArrival(t,n,this._receivedLength)}},{key:"_onWebSocketError",value:function(e){this._status=C.kError;var t={code:e.code,msg:e.message};if(!this._onError)throw new x(t.msg);this._onError(S.EXCEPTION,t)}}],[{key:"isSupported",value:function(){try{return void 0!==self.WebSocket}catch(e){return!1}}}]),n}(E),O=function(){function e(t){a()(this,e),this._zeroStart=t||!1}return l()(e,[{key:"getConfig",value:function(e,t){var n,i={};0!==t.from||-1!==t.to?(n=-1!==t.to?"bytes=".concat(t.from.toString(),"-").concat(t.to.toString()):"bytes=".concat(t.from.toString(),"-"),i.Range=n):this._zeroStart&&(i.Range="bytes=0-");return{url:e,headers:i}}},{key:"removeURLParameters",value:function(e){return e}}]),e}(),F=function(){function e(t,n){a()(this,e),this._startName=t,this._endName=n}return l()(e,[{key:"getConfig",value:function(e,t){var n=e;if(0!==t.from||-1!==t.to){var i=!0;-1===n.indexOf("?")&&(n+="?",i=!1),i&&(n+="&"),n+="".concat(this._startName,"=").concat(t.from.toString()),-1!==t.to&&(n+="&".concat(this._endName,"=").concat(t.to.toString()))}return{url:n,headers:{}}}},{key:"removeURLParameters",value:function(e){var t=e.split("?")[0],n=void 0,i=e.indexOf("?");-1!==i&&(n=e.substring(i+1));var r="";if(null!=n&&n.length>0)for(var o=n.split("&"),a=0;a<o.length;a++){var s=o[a].split("="),l=a>0;s[0]!==this._startName&&s[0]!==this._endName&&(l&&(r+="&"),r+=o[a])}return 0===r.length?t:t+"?"+r}}]),e}(),j=function(){function e(t,n,i){a()(this,e),this.TAG="IOController",this._config=n,this._extraData=i,this._stashInitialSize=393216,null!=n.stashInitialSize&&n.stashInitialSize>0&&(this._stashInitialSize=n.stashInitialSize),this._stashUsed=0,this._stashSize=this._stashInitialSize,this._bufferSize=3145728,this._stashBuffer=new ArrayBuffer(this._bufferSize),this._stashByteStart=0,this._enableStash=!0,!1===n.enableStashBuffer&&(this._enableStash=!1),this._loader=null,this._loaderClass=null,this._seekHandler=null,this._dataSource=t,this._isWebSocketURL=/wss?:\/\/(.+?)/.test(t.url),this._refTotalLength=t.filesize?t.filesize:null,this._totalLength=this._refTotalLength,this._fullRequestFlag=!1,this._currentRange=null,this._redirectedURL=null,this._speedNormalized=0,this._speedSampler=new m,this._speedNormalizeList=[64,128,256,384,512,768,1024,1536,2048,3072,4096],this._isEarlyEofReconnecting=!1,this._paused=!1,this._resumeFrom=0,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._selectSeekHandler(),this._selectLoader(),this._createLoader()}return l()(e,[{key:"destroy",value:function(){this._loader.isWorking()&&this._loader.abort(),this._loader.destroy(),this._loader=null,this._loaderClass=null,this._dataSource=null,this._stashBuffer=null,this._stashUsed=this._stashSize=this._bufferSize=this._stashByteStart=0,this._currentRange=null,this._speedSampler=null,this._isEarlyEofReconnecting=!1,this._onDataArrival=null,this._onSeeked=null,this._onError=null,this._onComplete=null,this._onRedirect=null,this._onRecoveredEarlyEof=null,this._extraData=null}},{key:"isWorking",value:function(){return this._loader&&this._loader.isWorking()&&!this._paused}},{key:"isPaused",value:function(){return this._paused}},{key:"status",get:function(){return this._loader.status}},{key:"extraData",get:function(){return this._extraData},set:function(e){this._extraData=e}},{key:"onDataArrival",get:function(){return this._onDataArrival},set:function(e){this._onDataArrival=e}},{key:"onSeeked",get:function(){return this._onSeeked},set:function(e){this._onSeeked=e}},{key:"onError",get:function(){return this._onError},set:function(e){this._onError=e}},{key:"onComplete",get:function(){return this._onComplete},set:function(e){this._onComplete=e}},{key:"onRedirect",get:function(){return this._onRedirect},set:function(e){this._onRedirect=e}},{key:"onRecoveredEarlyEof",get:function(){return this._onRecoveredEarlyEof},set:function(e){this._onRecoveredEarlyEof=e}},{key:"currentURL",get:function(){return this._dataSource.url}},{key:"hasRedirect",get:function(){return null!=this._redirectedURL||null!=this._dataSource.redirectedURL}},{key:"currentRedirectedURL",get:function(){return this._redirectedURL||this._dataSource.redirectedURL}},{key:"currentSpeed",get:function(){return this._loaderClass===P?this._loader.currentSpeed:this._speedSampler.lastSecondKBps}},{key:"loaderType",get:function(){return this._loader.type}},{key:"_selectSeekHandler",value:function(){var e=this._config;if("range"===e.seekType)this._seekHandler=new O(this._config.rangeLoadZeroStart);else if("param"===e.seekType){var t=e.seekParamStart||"bstart",n=e.seekParamEnd||"bend";this._seekHandler=new F(t,n)}else{if("custom"!==e.seekType)throw new _("Invalid seekType in config: ".concat(e.seekType));if("function"!=typeof e.customSeekHandler)throw new _("Custom seekType specified in config but invalid customSeekHandler!");this._seekHandler=new e.customSeekHandler}}},{key:"_selectLoader",value:function(){if(null!=this._config.customLoader)this._loaderClass=this._config.customLoader;else if(this._isWebSocketURL)this._loaderClass=I;else if(B.isSupported())this._loaderClass=B;else if(N.isSupported())this._loaderClass=N;else{if(!P.isSupported())throw new x("Your browser doesn't support xhr with arraybuffer responseType!");this._loaderClass=P}}},{key:"_createLoader",value:function(){this._loader=new this._loaderClass(this._seekHandler,this._config),!1===this._loader.needStashBuffer&&(this._enableStash=!1),this._loader.onContentLengthKnown=this._onContentLengthKnown.bind(this),this._loader.onURLRedirect=this._onURLRedirect.bind(this),this._loader.onDataArrival=this._onLoaderChunkArrival.bind(this),this._loader.onComplete=this._onLoaderComplete.bind(this),this._loader.onError=this._onLoaderError.bind(this)}},{key:"open",value:function(e){this._currentRange={from:0,to:-1},e&&(this._currentRange.from=e),this._speedSampler.reset(),e||(this._fullRequestFlag=!0),this._loader.open(this._dataSource,Object.assign({},this._currentRange))}},{key:"abort",value:function(){this._loader.abort(),this._paused&&(this._paused=!1,this._resumeFrom=0)}},{key:"pause",value:function(){this.isWorking()&&(this._loader.abort(),0!==this._stashUsed?(this._resumeFrom=this._stashByteStart,this._currentRange.to=this._stashByteStart-1):this._resumeFrom=this._currentRange.to+1,this._stashUsed=0,this._stashByteStart=0,this._paused=!0)}},{key:"resume",value:function(){if(this._paused){this._paused=!1;var e=this._resumeFrom;this._resumeFrom=0,this._internalSeek(e,!0)}}},{key:"seek",value:function(e){this._paused=!1,this._stashUsed=0,this._stashByteStart=0,this._internalSeek(e,!0)}},{key:"_internalSeek",value:function(e,t){this._loader.isWorking()&&this._loader.abort(),this._flushStashBuffer(t),this._loader.destroy(),this._loader=null;var n={from:e,to:-1};this._currentRange={from:n.from,to:-1},this._speedSampler.reset(),this._stashSize=this._stashInitialSize,this._createLoader(),this._loader.open(this._dataSource,n),this._onSeeked&&this._onSeeked()}},{key:"updateUrl",value:function(e){if(!e||"string"!=typeof e||0===e.length)throw new _("Url must be a non-empty string!");this._dataSource.url=e}},{key:"_expandBuffer",value:function(e){for(var t=this._stashSize;t+1048576<e;)t*=2;if((t+=1048576)!==this._bufferSize){var n=new ArrayBuffer(t);if(this._stashUsed>0){var i=new Uint8Array(this._stashBuffer,0,this._stashUsed);new Uint8Array(n,0,t).set(i,0)}this._stashBuffer=n,this._bufferSize=t}}},{key:"_normalizeSpeed",value:function(e){var t=this._speedNormalizeList,n=t.length-1,i=0,r=0,o=n;if(e<t[0])return t[0];for(;r<=o;){if((i=r+Math.floor((o-r)/2))===n||e>=t[i]&&e<t[i+1])return t[i];t[i]<e?r=i+1:o=i-1}}},{key:"_adjustStashSize",value:function(e){var t=0;(t=this._config.isLive||e<512?e:e>=512&&e<=1024?Math.floor(1.5*e):2*e)>8192&&(t=8192);var n=1024*t+1048576;this._bufferSize<n&&this._expandBuffer(n),this._stashSize=1024*t}},{key:"_dispatchChunks",value:function(e,t){return this._currentRange.to=t+e.byteLength-1,this._onDataArrival(e,t)}},{key:"_onURLRedirect",value:function(e){this._redirectedURL=e,this._onRedirect&&this._onRedirect(e)}},{key:"_onContentLengthKnown",value:function(e){e&&this._fullRequestFlag&&(this._totalLength=e,this._fullRequestFlag=!1)}},{key:"_onLoaderChunkArrival",value:function(e,t,n){if(!this._onDataArrival)throw new w("IOController: No existing consumer (onDataArrival) callback!");if(!this._paused){this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,this._onRecoveredEarlyEof&&this._onRecoveredEarlyEof()),this._speedSampler.addBytes(e.byteLength);var i=this._speedSampler.lastSecondKBps;if(0!==i){var r=this._normalizeSpeed(i);this._speedNormalized!==r&&(this._speedNormalized=r,this._adjustStashSize(r))}if(this._enableStash)if(0===this._stashUsed&&0===this._stashByteStart&&(this._stashByteStart=t),this._stashUsed+e.byteLength<=this._stashSize){new Uint8Array(this._stashBuffer,0,this._stashSize).set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{var o=new Uint8Array(this._stashBuffer,0,this._bufferSize);if(this._stashUsed>0){var a=this._stashBuffer.slice(0,this._stashUsed),s=this._dispatchChunks(a,this._stashByteStart);if(s<a.byteLength){if(s>0){var l=new Uint8Array(a,s);o.set(l,0),this._stashUsed=l.byteLength,this._stashByteStart+=s}}else this._stashUsed=0,this._stashByteStart+=s;this._stashUsed+e.byteLength>this._bufferSize&&(this._expandBuffer(this._stashUsed+e.byteLength),o=new Uint8Array(this._stashBuffer,0,this._bufferSize)),o.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength}else{var u=this._dispatchChunks(e,t);if(u<e.byteLength){var c=e.byteLength-u;c>this._bufferSize&&(this._expandBuffer(c),o=new Uint8Array(this._stashBuffer,0,this._bufferSize)),o.set(new Uint8Array(e,u),0),this._stashUsed+=c,this._stashByteStart=t+u}}}else if(0===this._stashUsed){var h=this._dispatchChunks(e,t);if(h<e.byteLength){var d=e.byteLength-h;d>this._bufferSize&&this._expandBuffer(d),new Uint8Array(this._stashBuffer,0,this._bufferSize).set(new Uint8Array(e,h),0),this._stashUsed+=d,this._stashByteStart=t+h}}else{this._stashUsed+e.byteLength>this._bufferSize&&this._expandBuffer(this._stashUsed+e.byteLength);var f=new Uint8Array(this._stashBuffer,0,this._bufferSize);f.set(new Uint8Array(e),this._stashUsed),this._stashUsed+=e.byteLength;var p=this._dispatchChunks(this._stashBuffer.slice(0,this._stashUsed),this._stashByteStart);if(p<this._stashUsed&&p>0){var m=new Uint8Array(this._stashBuffer,p);f.set(m,0)}this._stashUsed-=p,this._stashByteStart+=p}}}},{key:"_flushStashBuffer",value:function(e){if(this._stashUsed>0){var t=this._stashBuffer.slice(0,this._stashUsed),n=this._dispatchChunks(t,this._stashByteStart),i=t.byteLength-n;if(n<t.byteLength){if(!e){if(n>0){var r=new Uint8Array(this._stashBuffer,0,this._bufferSize),o=new Uint8Array(t,n);r.set(o,0),this._stashUsed=o.byteLength,this._stashByteStart+=n}return 0}p.w(this.TAG,"".concat(i," bytes unconsumed data remain when flush buffer, dropped"))}return this._stashUsed=0,this._stashByteStart=0,i}return 0}},{key:"_onLoaderComplete",value:function(e,t){this._flushStashBuffer(!0),this._onComplete&&this._onComplete(this._extraData)}},{key:"_onLoaderError",value:function(e,t){if(p.e(this.TAG,"Loader error, code = ".concat(t.code,", msg = ").concat(t.msg)),this._flushStashBuffer(!1),this._isEarlyEofReconnecting&&(this._isEarlyEofReconnecting=!1,e=S.UNRECOVERABLE_EARLY_EOF),e===S.EARLY_EOF){if(!this._config.isLive&&this._totalLength){var n=this._currentRange.to+1;return void(n<this._totalLength&&(p.w(this.TAG,"Connection lost, trying reconnect..."),this._isEarlyEofReconnecting=!0,this._internalSeek(n,!1)))}e=S.UNRECOVERABLE_EARLY_EOF}if(!this._onError)throw new x("IOException: "+t.msg);this._onError(e,t)}}]),e}(),z={enableWorker:!1,enableStashBuffer:!0,stashInitialSize:void 0,isLive:!1,lazyLoad:!0,lazyLoadMaxDuration:180,lazyLoadRecoverDuration:30,deferLoadAfterSourceOpen:!0,autoCleanupMaxBackwardDuration:180,autoCleanupMinBackwardDuration:120,statisticsInfoReportInterval:600,fixAudioTimestampGap:!0,accurateSeek:!1,seekType:"range",seekParamStart:"bstart",seekParamEnd:"bend",rangeLoadZeroStart:!1,customSeekHandler:void 0,reuseRedirectedURL:!1,headers:void 0,customLoader:void 0};function H(){return Object.assign({},z)}var W=function(){function e(){a()(this,e)}return l()(e,null,[{key:"supportMSEH264Playback",value:function(){return window.MediaSource&&window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')}},{key:"supportNetworkStreamIO",value:function(){var e=new j({},H()),t=e.loaderType;return e.destroy(),"fetch-stream-loader"==t||"xhr-moz-chunked-loader"==t}},{key:"getNetworkLoaderTypeName",value:function(){var e=new j({},H()),t=e.loaderType;return e.destroy(),t}},{key:"supportNativeMediaPlayback",value:function(t){null==e.videoElement&&(e.videoElement=window.document.createElement("video"));var n=e.videoElement.canPlayType(t);return"probably"===n||"maybe"==n}},{key:"getFeatureList",value:function(){var t={mseFlvPlayback:!1,mseLiveFlvPlayback:!1,networkStreamIO:!1,networkLoaderName:"",nativeMP4H264Playback:!1,nativeWebmVP8Playback:!1,nativeWebmVP9Playback:!1};return t.mseFlvPlayback=e.supportMSEH264Playback(),t.networkStreamIO=e.supportNetworkStreamIO(),t.networkLoaderName=e.getNetworkLoaderTypeName(),t.mseLiveFlvPlayback=t.mseFlvPlayback&&t.networkStreamIO,t.nativeMP4H264Playback=e.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"'),t.nativeWebmVP8Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"'),t.nativeWebmVP9Playback=e.supportNativeMediaPlayback('video/webm; codecs="vp9"'),t}}]),e}(),G=W,U={ERROR:"error",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info"},Z=function(){function e(){a()(this,e)}return l()(e,null,[{key:"forceGlobalTag",get:function(){return p.FORCE_GLOBAL_TAG},set:function(t){p.FORCE_GLOBAL_TAG=t,e._notifyChange()}},{key:"globalTag",get:function(){return p.GLOBAL_TAG},set:function(t){p.GLOBAL_TAG=t,e._notifyChange()}},{key:"enableAll",get:function(){return p.ENABLE_VERBOSE&&p.ENABLE_DEBUG&&p.ENABLE_INFO&&p.ENABLE_WARN&&p.ENABLE_ERROR},set:function(t){p.ENABLE_VERBOSE=t,p.ENABLE_DEBUG=t,p.ENABLE_INFO=t,p.ENABLE_WARN=t,p.ENABLE_ERROR=t,e._notifyChange()}},{key:"enableDebug",get:function(){return p.ENABLE_DEBUG},set:function(t){p.ENABLE_DEBUG=t,e._notifyChange()}},{key:"enableVerbose",get:function(){return p.ENABLE_VERBOSE},set:function(t){p.ENABLE_VERBOSE=t,e._notifyChange()}},{key:"enableInfo",get:function(){return p.ENABLE_INFO},set:function(t){p.ENABLE_INFO=t,e._notifyChange()}},{key:"enableWarn",get:function(){return p.ENABLE_WARN},set:function(t){p.ENABLE_WARN=t,e._notifyChange()}},{key:"enableError",get:function(){return p.ENABLE_ERROR},set:function(t){p.ENABLE_ERROR=t,e._notifyChange()}},{key:"getConfig",value:function(){return{globalTag:p.GLOBAL_TAG,forceGlobalTag:p.FORCE_GLOBAL_TAG,enableVerbose:p.ENABLE_VERBOSE,enableDebug:p.ENABLE_DEBUG,enableInfo:p.ENABLE_INFO,enableWarn:p.ENABLE_WARN,enableError:p.ENABLE_ERROR,enableCallback:p.ENABLE_CALLBACK}}},{key:"applyConfig",value:function(e){p.GLOBAL_TAG=e.globalTag,p.FORCE_GLOBAL_TAG=e.forceGlobalTag,p.ENABLE_VERBOSE=e.enableVerbose,p.ENABLE_DEBUG=e.enableDebug,p.ENABLE_INFO=e.enableInfo,p.ENABLE_WARN=e.enableWarn,p.ENABLE_ERROR=e.enableError,p.ENABLE_CALLBACK=e.enableCallback}},{key:"_notifyChange",value:function(){var t=e.emitter;if(t.listenerCount("change")>0){var n=e.getConfig();t.emit("change",n)}}},{key:"registerListener",value:function(t){e.emitter.addListener("change",t)}},{key:"removeListener",value:function(t){e.emitter.removeListener("change",t)}},{key:"addLogListener",value:function(t){p.emitter.addListener("log",t),p.emitter.listenerCount("log")>0&&(p.ENABLE_CALLBACK=!0,e._notifyChange())}},{key:"removeLogListener",value:function(t){p.emitter.removeListener("log",t),0===p.emitter.listenerCount("log")&&(p.ENABLE_CALLBACK=!1,e._notifyChange())}}]),e}();Z.emitter=new(d());var V=Z,q=function(){function e(){a()(this,e),this.mimeType=null,this.duration=null,this.hasAudio=null,this.hasVideo=null,this.audioCodec=null,this.videoCodec=null,this.audioDataRate=null,this.videoDataRate=null,this.audioSampleRate=null,this.audioChannelCount=null,this.width=null,this.height=null,this.fps=null,this.profile=null,this.level=null,this.refFrames=null,this.chromaFormat=null,this.sarNum=null,this.sarDen=null,this.metadata=null,this.segments=null,this.segmentCount=null,this.hasKeyframesIndex=null,this.keyframesIndex=null}return l()(e,[{key:"isComplete",value:function(){var e=!1===this.hasAudio||!0===this.hasAudio&&null!=this.audioCodec&&null!=this.audioSampleRate&&null!=this.audioChannelCount,t=!1===this.hasVideo||!0===this.hasVideo&&null!=this.videoCodec&&null!=this.width&&null!=this.height&&null!=this.fps&&null!=this.profile&&null!=this.level&&null!=this.refFrames&&null!=this.chromaFormat&&null!=this.sarNum&&null!=this.sarDen;return null!=this.mimeType&&null!=this.duration&&null!=this.metadata&&null!=this.hasKeyframesIndex&&e&&t}},{key:"isSeekable",value:function(){return!0===this.hasKeyframesIndex}},{key:"getNearestKeyframe",value:function(e){if(null==this.keyframesIndex)return null;var t=this.keyframesIndex,n=this._search(t.times,e);return{index:n,milliseconds:t.times[n],fileposition:t.filepositions[n]}}},{key:"_search",value:function(e,t){var n=0,i=e.length-1,r=0,o=0,a=i;for(t<e[0]&&(n=0,o=a+1);o<=a;){if((r=o+Math.floor((a-o)/2))===i||t>=e[r]&&t<e[r+1]){n=r;break}e[r]<t?o=r+1:a=r-1}return n}}]),e}();function K(e,t,n){var i=e;if(t+n<i.length){for(;n--;)if(128!=(192&i[++t]))return!1;return!0}return!1}var Y,X=function(e){for(var t=[],n=e,i=0,r=e.length;i<r;)if(n[i]<128)t.push(String.fromCharCode(n[i])),++i;else{if(n[i]<192);else if(n[i]<224){if(K(n,i,1)){var o=(31&n[i])<<6|63&n[i+1];if(o>=128){t.push(String.fromCharCode(65535&o)),i+=2;continue}}}else if(n[i]<240){if(K(n,i,2)){var a=(15&n[i])<<12|(63&n[i+1])<<6|63&n[i+2];if(a>=2048&&55296!=(63488&a)){t.push(String.fromCharCode(65535&a)),i+=3;continue}}}else if(n[i]<248&&K(n,i,3)){var s=(7&n[i])<<18|(63&n[i+1])<<12|(63&n[i+2])<<6|63&n[i+3];if(s>65536&&s<1114112){s-=65536,t.push(String.fromCharCode(s>>>10|55296)),t.push(String.fromCharCode(1023&s|56320)),i+=4;continue}}t.push(String.fromCharCode(65533)),++i}return t.join("")},J=(Y=new ArrayBuffer(2),new DataView(Y).setInt16(0,256,!0),256===new Int16Array(Y)[0]),Q=function(){function e(){a()(this,e)}return l()(e,null,[{key:"parseScriptData",value:function(t,n,i){var r={};try{var o=e.parseValue(t,n,i),a=e.parseValue(t,n+o.size,i-o.size);r[o.data]=a.data}catch(e){p.e("AMF",e.toString())}return r}},{key:"parseObject",value:function(t,n,i){if(i<3)throw new w("Data not enough when parse ScriptDataObject");var r=e.parseString(t,n,i),o=e.parseValue(t,n+r.size,i-r.size),a=o.objectEnd;return{data:{name:r.data,value:o.data},size:r.size+o.size,objectEnd:a}}},{key:"parseVariable",value:function(t,n,i){return e.parseObject(t,n,i)}},{key:"parseString",value:function(e,t,n){if(n<2)throw new w("Data not enough when parse String");var i=new DataView(e,t,n).getUint16(0,!J);return{data:i>0?X(new Uint8Array(e,t+2,i)):"",size:2+i}}},{key:"parseLongString",value:function(e,t,n){if(n<4)throw new w("Data not enough when parse LongString");var i=new DataView(e,t,n).getUint32(0,!J);return{data:i>0?X(new Uint8Array(e,t+4,i)):"",size:4+i}}},{key:"parseDate",value:function(e,t,n){if(n<10)throw new w("Data size invalid when parse Date");var i=new DataView(e,t,n),r=i.getFloat64(0,!J),o=i.getInt16(8,!J);return{data:new Date(r+=60*o*1e3),size:10}}},{key:"parseValue",value:function(t,n,i){if(i<1)throw new w("Data not enough when parse Value");var r,o=new DataView(t,n,i),a=1,s=o.getUint8(0),l=!1;try{switch(s){case 0:r=o.getFloat64(1,!J),a+=8;break;case 1:r=!!o.getUint8(1),a+=1;break;case 2:var u=e.parseString(t,n+1,i-1);r=u.data,a+=u.size;break;case 3:r={};var c=0;for(9==(16777215&o.getUint32(i-4,!J))&&(c=3);a<i-4;){var h=e.parseObject(t,n+a,i-a-c);if(h.objectEnd)break;r[h.data.name]=h.data.value,a+=h.size}if(a<=i-3)9===(16777215&o.getUint32(a-1,!J))&&(a+=3);break;case 8:r={},a+=4;var d=0;for(9==(16777215&o.getUint32(i-4,!J))&&(d=3);a<i-8;){var f=e.parseVariable(t,n+a,i-a-d);if(f.objectEnd)break;r[f.data.name]=f.data.value,a+=f.size}if(a<=i-3)9===(16777215&o.getUint32(a-1,!J))&&(a+=3);break;case 9:r=void 0,a=1,l=!0;break;case 10:r=[];var m=o.getUint32(1,!J);a+=4;for(var v=0;v<m;v++){var g=e.parseValue(t,n+a,i-a);r.push(g.data),a+=g.size}break;case 11:var y=e.parseDate(t,n+1,i-1);r=y.data,a+=y.size;break;case 12:var b=e.parseString(t,n+1,i-1);r=b.data,a+=b.size;break;default:a=i,p.w("AMF","Unsupported AMF value type "+s)}}catch(e){p.e("AMF",e.toString())}return{data:r,size:a,objectEnd:l}}}]),e}(),$=function(){function e(t){a()(this,e),this.TAG="ExpGolomb",this._buffer=t,this._buffer_index=0,this._total_bytes=t.byteLength,this._total_bits=8*t.byteLength,this._current_word=0,this._current_word_bits_left=0}return l()(e,[{key:"destroy",value:function(){this._buffer=null}},{key:"_fillCurrentWord",value:function(){var e=this._total_bytes-this._buffer_index;if(e<=0)throw new w("ExpGolomb: _fillCurrentWord() but no bytes available");var t=Math.min(4,e),n=new Uint8Array(4);n.set(this._buffer.subarray(this._buffer_index,this._buffer_index+t)),this._current_word=new DataView(n.buffer).getUint32(0,!1),this._buffer_index+=t,this._current_word_bits_left=8*t}},{key:"readBits",value:function(e){if(e>32)throw new _("ExpGolomb: readBits() bits exceeded max 32bits!");if(e<=this._current_word_bits_left){var t=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,t}var n=this._current_word_bits_left?this._current_word:0;n>>>=32-this._current_word_bits_left;var i=e-this._current_word_bits_left;this._fillCurrentWord();var r=Math.min(i,this._current_word_bits_left),o=this._current_word>>>32-r;return this._current_word<<=r,this._current_word_bits_left-=r,n=n<<r|o}},{key:"readBool",value:function(){return 1===this.readBits(1)}},{key:"readByte",value:function(){return this.readBits(8)}},{key:"_skipLeadingZero",value:function(){var e;for(e=0;e<this._current_word_bits_left;e++)if(0!=(this._current_word&2147483648>>>e))return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()}},{key:"readUEG",value:function(){var e=this._skipLeadingZero();return this.readBits(e+1)-1}},{key:"readSEG",value:function(){var e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)}}]),e}(),ee=function(){function e(){a()(this,e)}return l()(e,null,[{key:"_ebsp2rbsp",value:function(e){for(var t=e,n=t.byteLength,i=new Uint8Array(n),r=0,o=0;o<n;o++)o>=2&&3===t[o]&&0===t[o-1]&&0===t[o-2]||(i[r]=t[o],r++);return new Uint8Array(i.buffer,0,r)}},{key:"parseSPS",value:function(t){var n=e._ebsp2rbsp(t),i=new $(n);i.readByte();var r=i.readByte();i.readByte();var o=i.readByte();i.readUEG();var a=e.getProfileString(r),s=e.getLevelString(o),l=1,u=420,c=8;if((100===r||110===r||122===r||244===r||44===r||83===r||86===r||118===r||128===r||138===r||144===r)&&(3===(l=i.readUEG())&&i.readBits(1),l<=3&&(u=[0,420,422,444][l]),c=i.readUEG()+8,i.readUEG(),i.readBits(1),i.readBool()))for(var h=3!==l?8:12,d=0;d<h;d++)i.readBool()&&(d<6?e._skipScalingList(i,16):e._skipScalingList(i,64));i.readUEG();var f=i.readUEG();if(0===f)i.readUEG();else if(1===f){i.readBits(1),i.readSEG(),i.readSEG();for(var p=i.readUEG(),m=0;m<p;m++)i.readSEG()}var v=i.readUEG();i.readBits(1);var g=i.readUEG(),y=i.readUEG(),b=i.readBits(1);0===b&&i.readBits(1),i.readBits(1);var x=0,w=0,_=0,k=0;i.readBool()&&(x=i.readUEG(),w=i.readUEG(),_=i.readUEG(),k=i.readUEG());var C=1,S=1,E=0,L=!0,A=0,T=0;if(i.readBool()){if(i.readBool()){var M=i.readByte();M>0&&M<16?(C=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][M-1],S=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][M-1]):255===M&&(C=i.readByte()<<8|i.readByte(),S=i.readByte()<<8|i.readByte())}if(i.readBool()&&i.readBool(),i.readBool()&&(i.readBits(4),i.readBool()&&i.readBits(24)),i.readBool()&&(i.readUEG(),i.readUEG()),i.readBool()){var D=i.readBits(32),R=i.readBits(32);L=i.readBool(),E=(A=R)/(T=2*D)}}var B=1;1===C&&1===S||(B=C/S);var N=0,P=0;0===l?(N=1,P=2-b):(N=3===l?1:2,P=(1===l?2:1)*(2-b));var I=16*(g+1),O=16*(y+1)*(2-b);I-=(x+w)*N,O-=(_+k)*P;var F=Math.ceil(I*B);return i.destroy(),i=null,{profile_string:a,level_string:s,bit_depth:c,ref_frames:v,chroma_format:u,chroma_format_string:e.getChromaFormatString(u),frame_rate:{fixed:L,fps:E,fps_den:T,fps_num:A},sar_ratio:{width:C,height:S},codec_size:{width:I,height:O},present_size:{width:F,height:O}}}},{key:"_skipScalingList",value:function(e,t){for(var n=8,i=8,r=0;r<t;r++)0!==i&&(i=(n+e.readSEG()+256)%256),n=0===i?n:i}},{key:"getProfileString",value:function(e){switch(e){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}},{key:"getLevelString",value:function(e){return(e/10).toFixed(1)}},{key:"getChromaFormatString",value:function(e){switch(e){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}]),e}(),te={OK:"OK",FORMAT_ERROR:"FormatError",FORMAT_UNSUPPORTED:"FormatUnsupported",CODEC_UNSUPPORTED:"CodecUnsupported"};var ne=function(){function e(t,n){a()(this,e),this.TAG="FLVDemuxer",this._config=n,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null,this._dataOffset=t.dataOffset,this._firstParse=!0,this._dispatch=!1,this._hasAudio=t.hasAudioTrack,this._hasVideo=t.hasVideoTrack,this._hasAudioFlagOverrided=!1,this._hasVideoFlagOverrided=!1,this._audioInitialMetadataDispatched=!1,this._videoInitialMetadataDispatched=!1,this._mediaInfo=new q,this._mediaInfo.hasAudio=this._hasAudio,this._mediaInfo.hasVideo=this._hasVideo,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._naluLengthSize=4,this._timestampBase=0,this._timescale=1e3,this._duration=0,this._durationOverrided=!1,this._referenceFrameRate={fixed:!0,fps:23.976,fps_num:23976,fps_den:1e3},this._flvSoundRateTable=[5500,11025,22050,44100,48e3],this._mpegSamplingRates=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],this._mpegAudioV10SampleRateTable=[44100,48e3,32e3,0],this._mpegAudioV20SampleRateTable=[22050,24e3,16e3,0],this._mpegAudioV25SampleRateTable=[11025,12e3,8e3,0],this._mpegAudioL1BitRateTable=[0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,-1],this._mpegAudioL2BitRateTable=[0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,-1],this._mpegAudioL3BitRateTable=[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,-1],this._videoTrack={type:"video",id:1,sequenceNumber:0,samples:[],length:0},this._audioTrack={type:"audio",id:2,sequenceNumber:0,samples:[],length:0},this._littleEndian=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}()}return l()(e,[{key:"destroy",value:function(){this._mediaInfo=null,this._metadata=null,this._audioMetadata=null,this._videoMetadata=null,this._videoTrack=null,this._audioTrack=null,this._onError=null,this._onMediaInfo=null,this._onMetaDataArrived=null,this._onScriptDataArrived=null,this._onTrackMetadata=null,this._onDataAvailable=null}},{key:"bindDataSource",value:function(e){return e.onDataArrival=this.parseChunks.bind(this),this}},{key:"onTrackMetadata",get:function(){return this._onTrackMetadata},set:function(e){this._onTrackMetadata=e}},{key:"onMediaInfo",get:function(){return this._onMediaInfo},set:function(e){this._onMediaInfo=e}},{key:"onMetaDataArrived",get:function(){return this._onMetaDataArrived},set:function(e){this._onMetaDataArrived=e}},{key:"onScriptDataArrived",get:function(){return this._onScriptDataArrived},set:function(e){this._onScriptDataArrived=e}},{key:"onError",get:function(){return this._onError},set:function(e){this._onError=e}},{key:"onDataAvailable",get:function(){return this._onDataAvailable},set:function(e){this._onDataAvailable=e}},{key:"timestampBase",get:function(){return this._timestampBase},set:function(e){this._timestampBase=e}},{key:"overridedDuration",get:function(){return this._duration},set:function(e){this._durationOverrided=!0,this._duration=e,this._mediaInfo.duration=e}},{key:"overridedHasAudio",set:function(e){this._hasAudioFlagOverrided=!0,this._hasAudio=e,this._mediaInfo.hasAudio=e}},{key:"overridedHasVideo",set:function(e){this._hasVideoFlagOverrided=!0,this._hasVideo=e,this._mediaInfo.hasVideo=e}},{key:"resetMediaInfo",value:function(){this._mediaInfo=new q}},{key:"_isInitialMetadataDispatched",value:function(){return this._hasAudio&&this._hasVideo?this._audioInitialMetadataDispatched&&this._videoInitialMetadataDispatched:this._hasAudio&&!this._hasVideo?this._audioInitialMetadataDispatched:!(this._hasAudio||!this._hasVideo)&&this._videoInitialMetadataDispatched}},{key:"parseChunks",value:function(t,n){if(!(this._onError&&this._onMediaInfo&&this._onTrackMetadata&&this._onDataAvailable))throw new w("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");var i=0,r=this._littleEndian;if(0===n){if(!(t.byteLength>13))return 0;i=e.probe(t).dataOffset}this._firstParse&&(this._firstParse=!1,n+i!==this._dataOffset&&p.w(this.TAG,"First time parsing but chunk byteStart invalid!"),0!==new DataView(t,i).getUint32(0,!r)&&p.w(this.TAG,"PrevTagSize0 !== 0 !!!"),i+=4);for(;i<t.byteLength;){this._dispatch=!0;var o=new DataView(t,i);if(i+11+4>t.byteLength)break;var a=o.getUint8(0),s=16777215&o.getUint32(0,!r);if(i+11+s+4>t.byteLength)break;if(8===a||9===a||18===a){var l=o.getUint8(4),u=o.getUint8(5),c=o.getUint8(6)|u<<8|l<<16|o.getUint8(7)<<24;0!==(16777215&o.getUint32(7,!r))&&p.w(this.TAG,"Meet tag which has StreamID != 0!");var h=i+11;switch(a){case 8:this._parseAudioData(t,h,s,c);break;case 9:this._parseVideoData(t,h,s,c,n+i);break;case 18:this._parseScriptData(t,h,s)}var d=o.getUint32(11+s,!r);d!==11+s&&p.w(this.TAG,"Invalid PrevTagSize ".concat(d)),i+=11+s+4}else p.w(this.TAG,"Unsupported tag type ".concat(a,", skipped")),i+=11+s+4}return this._isInitialMetadataDispatched()&&this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack),i}},{key:"_parseScriptData",value:function(e,t,n){var i=Q.parseScriptData(e,t,n);if(i.hasOwnProperty("onMetaData")){if(null==i.onMetaData||"object"!==r()(i.onMetaData))return void p.w(this.TAG,"Invalid onMetaData structure!");this._metadata&&p.w(this.TAG,"Found another onMetaData tag!"),this._metadata=i;var o=this._metadata.onMetaData;if(this._onMetaDataArrived&&this._onMetaDataArrived(Object.assign({},o)),"boolean"==typeof o.hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=o.hasAudio,this._mediaInfo.hasAudio=this._hasAudio),"boolean"==typeof o.hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=o.hasVideo,this._mediaInfo.hasVideo=this._hasVideo),"number"==typeof o.audiodatarate&&(this._mediaInfo.audioDataRate=o.audiodatarate),"number"==typeof o.videodatarate&&(this._mediaInfo.videoDataRate=o.videodatarate),"number"==typeof o.width&&(this._mediaInfo.width=o.width),"number"==typeof o.height&&(this._mediaInfo.height=o.height),"number"==typeof o.duration){if(!this._durationOverrided){var a=Math.floor(o.duration*this._timescale);this._duration=a,this._mediaInfo.duration=a}}else this._mediaInfo.duration=0;if("number"==typeof o.framerate){var s=Math.floor(1e3*o.framerate);if(s>0){var l=s/1e3;this._referenceFrameRate.fixed=!0,this._referenceFrameRate.fps=l,this._referenceFrameRate.fps_num=s,this._referenceFrameRate.fps_den=1e3,this._mediaInfo.fps=l}}if("object"===r()(o.keyframes)){this._mediaInfo.hasKeyframesIndex=!0;var u=o.keyframes;this._mediaInfo.keyframesIndex=this._parseKeyframesIndex(u),o.keyframes=null}else this._mediaInfo.hasKeyframesIndex=!1;this._dispatch=!1,this._mediaInfo.metadata=o,p.v(this.TAG,"Parsed onMetaData"),this._mediaInfo.isComplete()&&this._onMediaInfo(this._mediaInfo)}Object.keys(i).length>0&&this._onScriptDataArrived&&this._onScriptDataArrived(Object.assign({},i))}},{key:"_parseKeyframesIndex",value:function(e){for(var t=[],n=[],i=1;i<e.times.length;i++){var r=this._timestampBase+Math.floor(1e3*e.times[i]);t.push(r),n.push(e.filepositions[i])}return{times:t,filepositions:n}}},{key:"_parseAudioData",value:function(e,t,n,i){if(n<=1)p.w(this.TAG,"Flv: Invalid audio packet, missing SoundData payload!");else if(!0!==this._hasAudioFlagOverrided||!1!==this._hasAudio){this._littleEndian;var r=new DataView(e,t,n).getUint8(0),o=r>>>4;if(2===o||10===o){var a=0,s=(12&r)>>>2;if(s>=0&&s<=4){a=this._flvSoundRateTable[s];var l=1&r,u=this._audioMetadata,c=this._audioTrack;if(u||(!1===this._hasAudio&&!1===this._hasAudioFlagOverrided&&(this._hasAudio=!0,this._mediaInfo.hasAudio=!0),(u=this._audioMetadata={}).type="audio",u.id=c.id,u.timescale=this._timescale,u.duration=this._duration,u.audioSampleRate=a,u.channelCount=0===l?1:2),10===o){var h=this._parseAACAudioData(e,t+1,n-1);if(null==h)return;if(0===h.packetType){u.config&&p.w(this.TAG,"Found another AudioSpecificConfig!");var d=h.data;u.audioSampleRate=d.samplingRate,u.channelCount=d.channelCount,u.codec=d.codec,u.originalCodec=d.originalCodec,u.config=d.config,u.refSampleDuration=1024/u.audioSampleRate*u.timescale,p.v(this.TAG,"Parsed AudioSpecificConfig"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._audioInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("audio",u);var f=this._mediaInfo;f.audioCodec=u.originalCodec,f.audioSampleRate=u.audioSampleRate,f.audioChannelCount=u.channelCount,f.hasVideo?null!=f.videoCodec&&(f.mimeType='video/x-flv; codecs="'+f.videoCodec+","+f.audioCodec+'"'):f.mimeType='video/x-flv; codecs="'+f.audioCodec+'"',f.isComplete()&&this._onMediaInfo(f)}else if(1===h.packetType){var m=this._timestampBase+i,v={unit:h.data,length:h.data.byteLength,dts:m,pts:m};c.samples.push(v),c.length+=h.data.length}else p.e(this.TAG,"Flv: Unsupported AAC data type ".concat(h.packetType))}else if(2===o){if(!u.codec){var g=this._parseMP3AudioData(e,t+1,n-1,!0);if(null==g)return;u.audioSampleRate=g.samplingRate,u.channelCount=g.channelCount,u.codec=g.codec,u.originalCodec=g.originalCodec,u.refSampleDuration=1152/u.audioSampleRate*u.timescale,p.v(this.TAG,"Parsed MPEG Audio Frame Header"),this._audioInitialMetadataDispatched=!0,this._onTrackMetadata("audio",u);var y=this._mediaInfo;y.audioCodec=u.codec,y.audioSampleRate=u.audioSampleRate,y.audioChannelCount=u.channelCount,y.audioDataRate=g.bitRate,y.hasVideo?null!=y.videoCodec&&(y.mimeType='video/x-flv; codecs="'+y.videoCodec+","+y.audioCodec+'"'):y.mimeType='video/x-flv; codecs="'+y.audioCodec+'"',y.isComplete()&&this._onMediaInfo(y)}var b=this._parseMP3AudioData(e,t+1,n-1,!1);if(null==b)return;var x=this._timestampBase+i,w={unit:b,length:b.byteLength,dts:x,pts:x};c.samples.push(w),c.length+=b.length}}else this._onError(te.FORMAT_ERROR,"Flv: Invalid audio sample rate idx: "+s)}else this._onError(te.CODEC_UNSUPPORTED,"Flv: Unsupported audio codec idx: "+o)}}},{key:"_parseAACAudioData",value:function(e,t,n){if(!(n<=1)){var i={},r=new Uint8Array(e,t,n);return i.packetType=r[0],0===r[0]?i.data=this._parseAACAudioSpecificConfig(e,t+1,n-1):i.data=r.subarray(1),i}p.w(this.TAG,"Flv: Invalid AAC packet, missing AACPacketType or/and Data!")}},{key:"_parseAACAudioSpecificConfig",value:function(e,t,n){var i,r,o=new Uint8Array(e,t,n),a=null,s=0,l=null;if(s=i=o[0]>>>3,(r=(7&o[0])<<1|o[1]>>>7)<0||r>=this._mpegSamplingRates.length)this._onError(te.FORMAT_ERROR,"Flv: AAC invalid sampling frequency index!");else{var u=this._mpegSamplingRates[r],c=(120&o[1])>>>3;if(!(c<0||c>=8)){5===s&&(l=(7&o[1])<<1|o[2]>>>7,(124&o[2])>>>2);var h=self.navigator.userAgent.toLowerCase();return-1!==h.indexOf("firefox")?r>=6?(s=5,a=new Array(4),l=r-3):(s=2,a=new Array(2),l=r):-1!==h.indexOf("android")?(s=2,a=new Array(2),l=r):(s=5,l=r,a=new Array(4),r>=6?l=r-3:1===c&&(s=2,a=new Array(2),l=r)),a[0]=s<<3,a[0]|=(15&r)>>>1,a[1]=(15&r)<<7,a[1]|=(15&c)<<3,5===s&&(a[1]|=(15&l)>>>1,a[2]=(1&l)<<7,a[2]|=8,a[3]=0),{config:a,samplingRate:u,channelCount:c,codec:"mp4a.40."+s,originalCodec:"mp4a.40."+i}}this._onError(te.FORMAT_ERROR,"Flv: AAC invalid channel configuration")}}},{key:"_parseMP3AudioData",value:function(e,t,n,i){if(!(n<4)){this._littleEndian;var r=new Uint8Array(e,t,n),o=null;if(i){if(255!==r[0])return;var a=r[1]>>>3&3,s=(6&r[1])>>1,l=(240&r[2])>>>4,u=(12&r[2])>>>2,c=3!==(r[3]>>>6&3)?2:1,h=0,d=0;switch(a){case 0:h=this._mpegAudioV25SampleRateTable[u];break;case 2:h=this._mpegAudioV20SampleRateTable[u];break;case 3:h=this._mpegAudioV10SampleRateTable[u]}switch(s){case 1:34,l<this._mpegAudioL3BitRateTable.length&&(d=this._mpegAudioL3BitRateTable[l]);break;case 2:33,l<this._mpegAudioL2BitRateTable.length&&(d=this._mpegAudioL2BitRateTable[l]);break;case 3:32,l<this._mpegAudioL1BitRateTable.length&&(d=this._mpegAudioL1BitRateTable[l])}o={bitRate:d,samplingRate:h,channelCount:c,codec:"mp3",originalCodec:"mp3"}}else o=r;return o}p.w(this.TAG,"Flv: Invalid MP3 packet, header missing!")}},{key:"_parseVideoData",value:function(e,t,n,i,r){if(n<=1)p.w(this.TAG,"Flv: Invalid video packet, missing VideoData payload!");else if(!0!==this._hasVideoFlagOverrided||!1!==this._hasVideo){var o=new Uint8Array(e,t,n)[0],a=(240&o)>>>4,s=15&o;7===s?this._parseAVCVideoPacket(e,t+1,n-1,i,r,a):this._onError(te.CODEC_UNSUPPORTED,"Flv: Unsupported codec in video frame: ".concat(s))}}},{key:"_parseAVCVideoPacket",value:function(e,t,n,i,r,o){if(n<4)p.w(this.TAG,"Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");else{var a=this._littleEndian,s=new DataView(e,t,n),l=s.getUint8(0),u=(16777215&s.getUint32(0,!a))<<8>>8;if(0===l)this._parseAVCDecoderConfigurationRecord(e,t+4,n-4);else if(1===l)this._parseAVCVideoData(e,t+4,n-4,i,r,o,u);else if(2!==l)return void this._onError(te.FORMAT_ERROR,"Flv: Invalid video packet type ".concat(l))}}},{key:"_parseAVCDecoderConfigurationRecord",value:function(e,t,n){if(n<7)p.w(this.TAG,"Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");else{var i=this._videoMetadata,r=this._videoTrack,o=this._littleEndian,a=new DataView(e,t,n);i?void 0!==i.avcc&&p.w(this.TAG,"Found another AVCDecoderConfigurationRecord!"):(!1===this._hasVideo&&!1===this._hasVideoFlagOverrided&&(this._hasVideo=!0,this._mediaInfo.hasVideo=!0),(i=this._videoMetadata={}).type="video",i.id=r.id,i.timescale=this._timescale,i.duration=this._duration);var s=a.getUint8(0),l=a.getUint8(1);a.getUint8(2),a.getUint8(3);if(1===s&&0!==l)if(this._naluLengthSize=1+(3&a.getUint8(4)),3===this._naluLengthSize||4===this._naluLengthSize){var u=31&a.getUint8(5);if(0!==u){u>1&&p.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ".concat(u));for(var c=6,h=0;h<u;h++){var d=a.getUint16(c,!o);if(c+=2,0!==d){var f=new Uint8Array(e,t+c,d);c+=d;var m=ee.parseSPS(f);if(0===h){i.codecWidth=m.codec_size.width,i.codecHeight=m.codec_size.height,i.presentWidth=m.present_size.width,i.presentHeight=m.present_size.height,i.profile=m.profile_string,i.level=m.level_string,i.bitDepth=m.bit_depth,i.chromaFormat=m.chroma_format,i.sarRatio=m.sar_ratio,i.frameRate=m.frame_rate,!1!==m.frame_rate.fixed&&0!==m.frame_rate.fps_num&&0!==m.frame_rate.fps_den||(i.frameRate=this._referenceFrameRate);var v=i.frameRate.fps_den,g=i.frameRate.fps_num;i.refSampleDuration=i.timescale*(v/g);for(var y=f.subarray(1,4),b="avc1.",x=0;x<3;x++){var w=y[x].toString(16);w.length<2&&(w="0"+w),b+=w}i.codec=b;var _=this._mediaInfo;_.width=i.codecWidth,_.height=i.codecHeight,_.fps=i.frameRate.fps,_.profile=i.profile,_.level=i.level,_.refFrames=m.ref_frames,_.chromaFormat=m.chroma_format_string,_.sarNum=i.sarRatio.width,_.sarDen=i.sarRatio.height,_.videoCodec=b,_.hasAudio?null!=_.audioCodec&&(_.mimeType='video/x-flv; codecs="'+_.videoCodec+","+_.audioCodec+'"'):_.mimeType='video/x-flv; codecs="'+_.videoCodec+'"',_.isComplete()&&this._onMediaInfo(_)}}}var k=a.getUint8(c);if(0!==k){k>1&&p.w(this.TAG,"Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ".concat(k)),c++;for(var C=0;C<k;C++){var S=a.getUint16(c,!o);c+=2,0!==S&&(c+=S)}i.avcc=new Uint8Array(n),i.avcc.set(new Uint8Array(e,t,n),0),p.v(this.TAG,"Parsed AVCDecoderConfigurationRecord"),this._isInitialMetadataDispatched()?this._dispatch&&(this._audioTrack.length||this._videoTrack.length)&&this._onDataAvailable(this._audioTrack,this._videoTrack):this._videoInitialMetadataDispatched=!0,this._dispatch=!1,this._onTrackMetadata("video",i)}else this._onError(te.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No PPS")}else this._onError(te.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord: No SPS")}else this._onError(te.FORMAT_ERROR,"Flv: Strange NaluLengthSizeMinusOne: ".concat(this._naluLengthSize-1));else this._onError(te.FORMAT_ERROR,"Flv: Invalid AVCDecoderConfigurationRecord")}}},{key:"_parseAVCVideoData",value:function(e,t,n,i,r,o,a){for(var s=this._littleEndian,l=new DataView(e,t,n),u=[],c=0,h=0,d=this._naluLengthSize,f=this._timestampBase+i,m=1===o;h<n;){if(h+4>=n){p.w(this.TAG,"Malformed Nalu near timestamp ".concat(f,", offset = ").concat(h,", dataSize = ").concat(n));break}var v=l.getUint32(h,!s);if(3===d&&(v>>>=8),v>n-d)return void p.w(this.TAG,"Malformed Nalus near timestamp ".concat(f,", NaluSize > DataSize!"));var g=31&l.getUint8(h+d);5===g&&(m=!0);var y=new Uint8Array(e,t+h,d+v),b={type:g,data:y};u.push(b),c+=y.byteLength,h+=d+v}if(u.length){var x=this._videoTrack,w={units:u,length:c,isKeyframe:m,dts:f,cts:a,pts:f+a};m&&(w.fileposition=r),x.samples.push(w),x.length+=c}}}],[{key:"probe",value:function(e){var t=new Uint8Array(e),n={match:!1};if(70!==t[0]||76!==t[1]||86!==t[2]||1!==t[3])return n;var i,r,o=(4&t[4])>>>2!=0,a=0!=(1&t[4]),s=(i=t)[r=5]<<24|i[r+1]<<16|i[r+2]<<8|i[r+3];return s<9?n:{match:!0,consumed:s,dataOffset:s,hasAudioTrack:o,hasVideoTrack:a}}}]),e}(),ie=ne,re=function(){function e(){a()(this,e)}return l()(e,null,[{key:"init",value:function(){for(var t in e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var n=e.constants={};n.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),n.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),n.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),n.STSC=n.STCO=n.STTS,n.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),n.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),n.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),n.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),n.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),n.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(e){for(var t=8,n=null,i=Array.prototype.slice.call(arguments,1),r=i.length,o=0;o<r;o++)t+=i[o].byteLength;(n=new Uint8Array(t))[0]=t>>>24&255,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n.set(e,4);for(var a=8,s=0;s<r;s++)n.set(i[s],a),a+=i[s].byteLength;return n}},{key:"generateInitSegment",value:function(t){var n=e.box(e.types.ftyp,e.constants.FTYP),i=e.moov(t),r=new Uint8Array(n.byteLength+i.byteLength);return r.set(n,0),r.set(i,n.byteLength),r}},{key:"moov",value:function(t){var n=e.mvhd(t.timescale,t.duration),i=e.trak(t),r=e.mvex(t);return e.box(e.types.moov,n,i,r)}},{key:"mvhd",value:function(t,n){return e.box(e.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))}},{key:"trak",value:function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"tkhd",value:function(t){var n=t.id,i=t.duration,r=t.presentWidth,o=t.presentHeight;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,r>>>8&255,255&r,0,0,o>>>8&255,255&o,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))}},{key:"mdhd",value:function(t){var n=t.timescale,i=t.duration;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,i>>>24&255,i>>>16&255,i>>>8&255,255&i,85,196,0,0]))}},{key:"hdlr",value:function(t){var n=null;return n="audio"===t.type?e.constants.HDLR_AUDIO:e.constants.HDLR_VIDEO,e.box(e.types.hdlr,n)}},{key:"minf",value:function(t){var n=null;return n="audio"===t.type?e.box(e.types.smhd,e.constants.SMHD):e.box(e.types.vmhd,e.constants.VMHD),e.box(e.types.minf,n,e.dinf(),e.stbl(t))}},{key:"dinf",value:function(){return e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF))}},{key:"stbl",value:function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.constants.STTS),e.box(e.types.stsc,e.constants.STSC),e.box(e.types.stsz,e.constants.STSZ),e.box(e.types.stco,e.constants.STCO))}},{key:"stsd",value:function(t){return"audio"===t.type?"mp3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t))}},{key:"mp3",value:function(t){var n=t.channelCount,i=t.audioSampleRate,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return e.box(e.types[".mp3"],r)}},{key:"mp4a",value:function(t){var n=t.channelCount,i=t.audioSampleRate,r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n,0,16,0,0,0,0,i>>>8&255,255&i,0,0]);return e.box(e.types.mp4a,r,e.esds(t))}},{key:"esds",value:function(t){var n=t.config||[],i=n.length,r=new Uint8Array([0,0,0,0,3,23+i,0,1,0,4,15+i,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([i]).concat(n).concat([6,1,2]));return e.box(e.types.esds,r)}},{key:"avc1",value:function(t){var n=t.avcc,i=t.codecWidth,r=t.codecHeight,o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,i>>>8&255,255&i,r>>>8&255,255&r,0,72,0,0,0,72,0,0,0,0,0,0,0,1,10,120,113,113,47,102,108,118,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.avc1,o,e.box(e.types.avcC,n))}},{key:"mvex",value:function(t){return e.box(e.types.mvex,e.trex(t))}},{key:"trex",value:function(t){var n=t.id,i=new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.box(e.types.trex,i)}},{key:"moof",value:function(t,n){return e.box(e.types.moof,e.mfhd(t.sequenceNumber),e.traf(t,n))}},{key:"mfhd",value:function(t){var n=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]);return e.box(e.types.mfhd,n)}},{key:"traf",value:function(t,n){var i=t.id,r=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),o=e.box(e.types.tfdt,new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n])),a=e.sdtp(t),s=e.trun(t,a.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,r,o,s,a)}},{key:"sdtp",value:function(t){for(var n=t.samples||[],i=n.length,r=new Uint8Array(4+i),o=0;o<i;o++){var a=n[o].flags;r[o+4]=a.isLeading<<6|a.dependsOn<<4|a.isDependedOn<<2|a.hasRedundancy}return e.box(e.types.sdtp,r)}},{key:"trun",value:function(t,n){var i=t.samples||[],r=i.length,o=12+16*r,a=new Uint8Array(o);n+=8+o,a.set([0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,255&r,n>>>24&255,n>>>16&255,n>>>8&255,255&n],0);for(var s=0;s<r;s++){var l=i[s].duration,u=i[s].size,c=i[s].flags,h=i[s].cts;a.set([l>>>24&255,l>>>16&255,l>>>8&255,255&l,u>>>24&255,u>>>16&255,u>>>8&255,255&u,c.isLeading<<2|c.dependsOn,c.isDependedOn<<6|c.hasRedundancy<<4|c.isNonSync,0,0,h>>>24&255,h>>>16&255,h>>>8&255,255&h],12+16*s)}return e.box(e.types.trun,a)}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}}]),e}();re.init();var oe=re,ae=function(){function e(){a()(this,e)}return l()(e,null,[{key:"getSilentFrame",value:function(e,t){if("mp4a.40.2"===e){if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===t)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===t)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null}}]),e}(),se=l()((function e(t,n,i,r,o){a()(this,e),this.dts=t,this.pts=n,this.duration=i,this.originalDts=r,this.isSyncPoint=o,this.fileposition=null})),le=function(){function e(){a()(this,e),this.beginDts=0,this.endDts=0,this.beginPts=0,this.endPts=0,this.originalBeginDts=0,this.originalEndDts=0,this.syncPoints=[],this.firstSample=null,this.lastSample=null}return l()(e,[{key:"appendSyncPoint",value:function(e){e.isSyncPoint=!0,this.syncPoints.push(e)}}]),e}(),ue=function(){function e(){a()(this,e),this._list=[]}return l()(e,[{key:"clear",value:function(){this._list=[]}},{key:"appendArray",value:function(e){var t=this._list;0!==e.length&&(t.length>0&&e[0].originalDts<t[t.length-1].originalDts&&this.clear(),Array.prototype.push.apply(t,e))}},{key:"getLastSyncPointBeforeDts",value:function(e){if(0==this._list.length)return null;var t=this._list,n=0,i=t.length-1,r=0,o=0,a=i;for(e<t[0].dts&&(n=0,o=a+1);o<=a;){if((r=o+Math.floor((a-o)/2))===i||e>=t[r].dts&&e<t[r+1].dts){n=r;break}t[r].dts<e?o=r+1:a=r-1}return this._list[n]}}]),e}(),ce=function(){function e(t){a()(this,e),this._type=t,this._list=[],this._lastAppendLocation=-1}return l()(e,[{key:"type",get:function(){return this._type}},{key:"length",get:function(){return this._list.length}},{key:"isEmpty",value:function(){return 0===this._list.length}},{key:"clear",value:function(){this._list=[],this._lastAppendLocation=-1}},{key:"_searchNearestSegmentBefore",value:function(e){var t=this._list;if(0===t.length)return-2;var n=t.length-1,i=0,r=0,o=n,a=0;if(e<t[0].originalBeginDts)return a=-1;for(;r<=o;){if((i=r+Math.floor((o-r)/2))===n||e>t[i].lastSample.originalDts&&e<t[i+1].originalBeginDts){a=i;break}t[i].originalBeginDts<e?r=i+1:o=i-1}return a}},{key:"_searchNearestSegmentAfter",value:function(e){return this._searchNearestSegmentBefore(e)+1}},{key:"append",value:function(e){var t=this._list,n=e,i=this._lastAppendLocation,r=0;-1!==i&&i<t.length&&n.originalBeginDts>=t[i].lastSample.originalDts&&(i===t.length-1||i<t.length-1&&n.originalBeginDts<t[i+1].originalBeginDts)?r=i+1:t.length>0&&(r=this._searchNearestSegmentBefore(n.originalBeginDts)+1),this._lastAppendLocation=r,this._list.splice(r,0,n)}},{key:"getLastSegmentBefore",value:function(e){var t=this._searchNearestSegmentBefore(e);return t>=0?this._list[t]:null}},{key:"getLastSampleBefore",value:function(e){var t=this.getLastSegmentBefore(e);return null!=t?t.lastSample:null}},{key:"getLastSyncPointBefore",value:function(e){for(var t=this._searchNearestSegmentBefore(e),n=this._list[t].syncPoints;0===n.length&&t>0;)t--,n=this._list[t].syncPoints;return n.length>0?n[n.length-1]:null}}]),e}(),he=function(){function e(t){a()(this,e),this.TAG="MP4Remuxer",this._config=t,this._isLive=!0===t.isLive,this._dtsBase=-1,this._dtsBaseInited=!1,this._audioDtsBase=1/0,this._videoDtsBase=1/0,this._audioNextDts=void 0,this._videoNextDts=void 0,this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList=new ce("audio"),this._videoSegmentInfoList=new ce("video"),this._onInitSegment=null,this._onMediaSegment=null,this._forceFirstIDR=!(!R.chrome||!(R.version.major<50||50===R.version.major&&R.version.build<2661)),this._fillSilentAfterSeek=R.msedge||R.msie,this._mp3UseMpegAudio=!R.firefox,this._fillAudioTimestampGap=this._config.fixAudioTimestampGap}return l()(e,[{key:"destroy",value:function(){this._dtsBase=-1,this._dtsBaseInited=!1,this._audioMeta=null,this._videoMeta=null,this._audioSegmentInfoList.clear(),this._audioSegmentInfoList=null,this._videoSegmentInfoList.clear(),this._videoSegmentInfoList=null,this._onInitSegment=null,this._onMediaSegment=null}},{key:"bindDataSource",value:function(e){return e.onDataAvailable=this.remux.bind(this),e.onTrackMetadata=this._onTrackMetadataReceived.bind(this),this}},{key:"onInitSegment",get:function(){return this._onInitSegment},set:function(e){this._onInitSegment=e}},{key:"onMediaSegment",get:function(){return this._onMediaSegment},set:function(e){this._onMediaSegment=e}},{key:"insertDiscontinuity",value:function(){this._audioNextDts=this._videoNextDts=void 0}},{key:"seek",value:function(e){this._audioStashedLastSample=null,this._videoStashedLastSample=null,this._videoSegmentInfoList.clear(),this._audioSegmentInfoList.clear()}},{key:"remux",value:function(e,t){if(!this._onMediaSegment)throw new w("MP4Remuxer: onMediaSegment callback must be specificed!");this._dtsBaseInited||this._calculateDtsBase(e,t),this._remuxVideo(t),this._remuxAudio(e)}},{key:"_onTrackMetadataReceived",value:function(e,t){var n=null,i="mp4",r=t.codec;if("audio"===e)this._audioMeta=t,"mp3"===t.codec&&this._mp3UseMpegAudio?(i="mpeg",r="",n=new Uint8Array):n=oe.generateInitSegment(t);else{if("video"!==e)return;this._videoMeta=t,n=oe.generateInitSegment(t)}if(!this._onInitSegment)throw new w("MP4Remuxer: onInitSegment callback must be specified!");this._onInitSegment(e,{type:e,data:n.buffer,codec:r,container:"".concat(e,"/").concat(i),mediaDuration:t.duration})}},{key:"_calculateDtsBase",value:function(e,t){this._dtsBaseInited||(e.samples&&e.samples.length&&(this._audioDtsBase=e.samples[0].dts),t.samples&&t.samples.length&&(this._videoDtsBase=t.samples[0].dts),this._dtsBase=Math.min(this._audioDtsBase,this._videoDtsBase),this._dtsBaseInited=!0)}},{key:"flushStashedSamples",value:function(){var e=this._videoStashedLastSample,t=this._audioStashedLastSample,n={type:"video",id:1,sequenceNumber:0,samples:[],length:0};null!=e&&(n.samples.push(e),n.length=e.length);var i={type:"audio",id:2,sequenceNumber:0,samples:[],length:0};null!=t&&(i.samples.push(t),i.length=t.length),this._videoStashedLastSample=null,this._audioStashedLastSample=null,this._remuxVideo(n,!0),this._remuxAudio(i,!0)}},{key:"_remuxAudio",value:function(e,t){if(null!=this._audioMeta){var n,i=e,r=i.samples,o=void 0,a=-1,s=this._audioMeta.refSampleDuration,l="mp3"===this._audioMeta.codec&&this._mp3UseMpegAudio,u=this._dtsBaseInited&&void 0===this._audioNextDts,c=!1;if(r&&0!==r.length&&(1!==r.length||t)){var h=0,d=null,f=0;l?(h=0,f=i.length):(h=8,f=8+i.length);var m=null;if(r.length>1&&(f-=(m=r.pop()).length),null!=this._audioStashedLastSample){var v=this._audioStashedLastSample;this._audioStashedLastSample=null,r.unshift(v),f+=v.length}null!=m&&(this._audioStashedLastSample=m);var g=r[0].dts-this._dtsBase;if(this._audioNextDts)o=g-this._audioNextDts;else if(this._audioSegmentInfoList.isEmpty())o=0,this._fillSilentAfterSeek&&!this._videoSegmentInfoList.isEmpty()&&"mp3"!==this._audioMeta.originalCodec&&(c=!0);else{var y=this._audioSegmentInfoList.getLastSampleBefore(g);if(null!=y){var b=g-(y.originalDts+y.duration);b<=3&&(b=0),o=g-(y.dts+y.duration+b)}else o=0}if(c){var x=g-o,w=this._videoSegmentInfoList.getLastSegmentBefore(g);if(null!=w&&w.beginDts<x){var _=ae.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);if(_){var k=w.beginDts,C=x-w.beginDts;p.v(this.TAG,"InsertPrefixSilentAudio: dts: ".concat(k,", duration: ").concat(C)),r.unshift({unit:_,dts:k,pts:k}),f+=_.byteLength}}else c=!1}for(var S=[],E=0;E<r.length;E++){var L=r[E],A=L.unit,T=L.dts-this._dtsBase,M=T-o;-1===a&&(a=M);var D=0;if(E!==r.length-1)D=r[E+1].dts-this._dtsBase-o-M;else if(null!=m)D=m.dts-this._dtsBase-o-M;else D=S.length>=1?S[S.length-1].duration:Math.floor(s);var B=!1,N=null;if(D>1.5*s&&"mp3"!==this._audioMeta.codec&&this._fillAudioTimestampGap&&!R.safari){B=!0;var P=Math.abs(D-s),I=Math.ceil(P/s),O=M+s;p.w(this.TAG,"Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\n"+"dts: ".concat(M+D," ms, expected: ").concat(M+Math.round(s)," ms, ")+"delta: ".concat(Math.round(P)," ms, generate: ").concat(I," frames"));var F=ae.getSilentFrame(this._audioMeta.originalCodec,this._audioMeta.channelCount);null==F&&(p.w(this.TAG,"Unable to generate silent frame for "+"".concat(this._audioMeta.originalCodec," with ").concat(this._audioMeta.channelCount," channels, repeat last frame")),F=A),N=[];for(var j=0;j<I;j++){var z=Math.round(O);if(N.length>0){var H=N[N.length-1];H.duration=z-H.dts}var W={dts:z,pts:z,cts:0,unit:F,size:F.byteLength,duration:0,originalDts:T,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}};N.push(W),f+=W.size,O+=s}var G=N[N.length-1];G.duration=M+D-G.dts,D=Math.round(s)}S.push({dts:M,pts:M,cts:0,unit:L.unit,size:L.unit.byteLength,duration:D,originalDts:T,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}),B&&S.push.apply(S,N)}l?d=new Uint8Array(f):((d=new Uint8Array(f))[0]=f>>>24&255,d[1]=f>>>16&255,d[2]=f>>>8&255,d[3]=255&f,d.set(oe.types.mdat,4));for(var U=0;U<S.length;U++){var Z=S[U].unit;d.set(Z,h),h+=Z.byteLength}var V=S[S.length-1];n=V.dts+V.duration,this._audioNextDts=n;var q=new le;q.beginDts=a,q.endDts=n,q.beginPts=a,q.endPts=n,q.originalBeginDts=S[0].originalDts,q.originalEndDts=V.originalDts+V.duration,q.firstSample=new se(S[0].dts,S[0].pts,S[0].duration,S[0].originalDts,!1),q.lastSample=new se(V.dts,V.pts,V.duration,V.originalDts,!1),this._isLive||this._audioSegmentInfoList.append(q),i.samples=S,i.sequenceNumber++;var K=null;K=l?new Uint8Array:oe.moof(i,a),i.samples=[],i.length=0;var Y={type:"audio",data:this._mergeBoxes(K,d).buffer,sampleCount:S.length,info:q};l&&u&&(Y.timestampOffset=a),this._onMediaSegment("audio",Y)}}}},{key:"_remuxVideo",value:function(e,t){if(null!=this._videoMeta){var n,i,r=e,o=r.samples,a=void 0,s=-1,l=-1;if(o&&0!==o.length&&(1!==o.length||t)){var u=8,c=null,h=8+e.length,d=null;if(o.length>1&&(h-=(d=o.pop()).length),null!=this._videoStashedLastSample){var f=this._videoStashedLastSample;this._videoStashedLastSample=null,o.unshift(f),h+=f.length}null!=d&&(this._videoStashedLastSample=d);var p=o[0].dts-this._dtsBase;if(this._videoNextDts)a=p-this._videoNextDts;else if(this._videoSegmentInfoList.isEmpty())a=0;else{var m=this._videoSegmentInfoList.getLastSampleBefore(p);if(null!=m){var v=p-(m.originalDts+m.duration);v<=3&&(v=0),a=p-(m.dts+m.duration+v)}else a=0}for(var g=new le,y=[],b=0;b<o.length;b++){var x=o[b],w=x.dts-this._dtsBase,_=x.isKeyframe,k=w-a,C=x.cts,S=k+C;-1===s&&(s=k,l=S);var E=0;if(b!==o.length-1)E=o[b+1].dts-this._dtsBase-a-k;else if(null!=d)E=d.dts-this._dtsBase-a-k;else E=y.length>=1?y[y.length-1].duration:Math.floor(this._videoMeta.refSampleDuration);if(_){var L=new se(k,S,E,x.dts,!0);L.fileposition=x.fileposition,g.appendSyncPoint(L)}y.push({dts:k,pts:S,cts:C,units:x.units,size:x.length,isKeyframe:_,duration:E,originalDts:w,flags:{isLeading:0,dependsOn:_?2:1,isDependedOn:_?1:0,hasRedundancy:0,isNonSync:_?0:1}})}(c=new Uint8Array(h))[0]=h>>>24&255,c[1]=h>>>16&255,c[2]=h>>>8&255,c[3]=255&h,c.set(oe.types.mdat,4);for(var A=0;A<y.length;A++)for(var T=y[A].units;T.length;){var M=T.shift().data;c.set(M,u),u+=M.byteLength}var D=y[y.length-1];if(n=D.dts+D.duration,i=D.pts+D.duration,this._videoNextDts=n,g.beginDts=s,g.endDts=n,g.beginPts=l,g.endPts=i,g.originalBeginDts=y[0].originalDts,g.originalEndDts=D.originalDts+D.duration,g.firstSample=new se(y[0].dts,y[0].pts,y[0].duration,y[0].originalDts,y[0].isKeyframe),g.lastSample=new se(D.dts,D.pts,D.duration,D.originalDts,D.isKeyframe),this._isLive||this._videoSegmentInfoList.append(g),r.samples=y,r.sequenceNumber++,this._forceFirstIDR){var R=y[0].flags;R.dependsOn=2,R.isNonSync=0}var B=oe.moof(r,s);r.samples=[],r.length=0,this._onMediaSegment("video",{type:"video",data:this._mergeBoxes(B,c).buffer,sampleCount:y.length,info:g})}}}},{key:"_mergeBoxes",value:function(e,t){var n=new Uint8Array(e.byteLength+t.byteLength);return n.set(e,0),n.set(t,e.byteLength),n}}]),e}(),de={IO_ERROR:"io_error",DEMUX_ERROR:"demux_error",INIT_SEGMENT:"init_segment",MEDIA_SEGMENT:"media_segment",LOADING_COMPLETE:"loading_complete",RECOVERED_EARLY_EOF:"recovered_early_eof",MEDIA_INFO:"media_info",METADATA_ARRIVED:"metadata_arrived",SCRIPTDATA_ARRIVED:"scriptdata_arrived",STATISTICS_INFO:"statistics_info",RECOMMEND_SEEKPOINT:"recommend_seekpoint"},fe=function(){function e(t,n){a()(this,e),this.TAG="TransmuxingController",this._emitter=new(d()),this._config=n,t.segments||(t.segments=[{duration:t.duration,filesize:t.filesize,url:t.url}]),"boolean"!=typeof t.cors&&(t.cors=!0),"boolean"!=typeof t.withCredentials&&(t.withCredentials=!1),this._mediaDataSource=t,this._currentSegmentIndex=0;var i=0;this._mediaDataSource.segments.forEach((function(e){e.timestampBase=i,i+=e.duration,e.cors=t.cors,e.withCredentials=t.withCredentials,n.referrerPolicy&&(e.referrerPolicy=n.referrerPolicy)})),isNaN(i)||this._mediaDataSource.duration===i||(this._mediaDataSource.duration=i),this._mediaInfo=null,this._demuxer=null,this._remuxer=null,this._ioctl=null,this._pendingSeekTime=null,this._pendingResolveSeekPoint=null,this._statisticsReporter=null}return l()(e,[{key:"destroy",value:function(){this._mediaInfo=null,this._mediaDataSource=null,this._statisticsReporter&&this._disableStatisticsReporter(),this._ioctl&&(this._ioctl.destroy(),this._ioctl=null),this._demuxer&&(this._demuxer.destroy(),this._demuxer=null),this._remuxer&&(this._remuxer.destroy(),this._remuxer=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"start",value:function(){this._loadSegment(0),this._enableStatisticsReporter()}},{key:"_loadSegment",value:function(e,t){this._currentSegmentIndex=e;var n=this._mediaDataSource.segments[e],i=this._ioctl=new j(n,this._config,e);i.onError=this._onIOException.bind(this),i.onSeeked=this._onIOSeeked.bind(this),i.onComplete=this._onIOComplete.bind(this),i.onRedirect=this._onIORedirect.bind(this),i.onRecoveredEarlyEof=this._onIORecoveredEarlyEof.bind(this),t?this._demuxer.bindDataSource(this._ioctl):i.onDataArrival=this._onInitChunkArrival.bind(this),i.open(t)}},{key:"stop",value:function(){this._internalAbort(),this._disableStatisticsReporter()}},{key:"_internalAbort",value:function(){this._ioctl&&(this._ioctl.destroy(),this._ioctl=null)}},{key:"pause",value:function(){this._ioctl&&this._ioctl.isWorking()&&(this._ioctl.pause(),this._disableStatisticsReporter())}},{key:"resume",value:function(){this._ioctl&&this._ioctl.isPaused()&&(this._ioctl.resume(),this._enableStatisticsReporter())}},{key:"seek",value:function(e){if(null!=this._mediaInfo&&this._mediaInfo.isSeekable()){var t=this._searchSegmentIndexContains(e);if(t===this._currentSegmentIndex){var n=this._mediaInfo.segments[t];if(null==n)this._pendingSeekTime=e;else{var i=n.getNearestKeyframe(e);this._remuxer.seek(i.milliseconds),this._ioctl.seek(i.fileposition),this._pendingResolveSeekPoint=i.milliseconds}}else{var r=this._mediaInfo.segments[t];if(null==r)this._pendingSeekTime=e,this._internalAbort(),this._remuxer.seek(),this._remuxer.insertDiscontinuity(),this._loadSegment(t);else{var o=r.getNearestKeyframe(e);this._internalAbort(),this._remuxer.seek(e),this._remuxer.insertDiscontinuity(),this._demuxer.resetMediaInfo(),this._demuxer.timestampBase=this._mediaDataSource.segments[t].timestampBase,this._loadSegment(t,o.fileposition),this._pendingResolveSeekPoint=o.milliseconds,this._reportSegmentMediaInfo(t)}}this._enableStatisticsReporter()}}},{key:"_searchSegmentIndexContains",value:function(e){for(var t=this._mediaDataSource.segments,n=t.length-1,i=0;i<t.length;i++)if(e<t[i].timestampBase){n=i-1;break}return n}},{key:"_onInitChunkArrival",value:function(e,t){var n=this,i=null,r=0;if(t>0)this._demuxer.bindDataSource(this._ioctl),this._demuxer.timestampBase=this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase,r=this._demuxer.parseChunks(e,t);else if((i=ie.probe(e)).match){this._demuxer=new ie(i,this._config),this._remuxer||(this._remuxer=new he(this._config));var o=this._mediaDataSource;null==o.duration||isNaN(o.duration)||(this._demuxer.overridedDuration=o.duration),"boolean"==typeof o.hasAudio&&(this._demuxer.overridedHasAudio=o.hasAudio),"boolean"==typeof o.hasVideo&&(this._demuxer.overridedHasVideo=o.hasVideo),this._demuxer.timestampBase=o.segments[this._currentSegmentIndex].timestampBase,this._demuxer.onError=this._onDemuxException.bind(this),this._demuxer.onMediaInfo=this._onMediaInfo.bind(this),this._demuxer.onMetaDataArrived=this._onMetaDataArrived.bind(this),this._demuxer.onScriptDataArrived=this._onScriptDataArrived.bind(this),this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl)),this._remuxer.onInitSegment=this._onRemuxerInitSegmentArrival.bind(this),this._remuxer.onMediaSegment=this._onRemuxerMediaSegmentArrival.bind(this),r=this._demuxer.parseChunks(e,t)}else i=null,p.e(this.TAG,"Non-FLV, Unsupported media type!"),Promise.resolve().then((function(){n._internalAbort()})),this._emitter.emit(de.DEMUX_ERROR,te.FORMAT_UNSUPPORTED,"Non-FLV, Unsupported media type"),r=0;return r}},{key:"_onMediaInfo",value:function(e){var t=this;null==this._mediaInfo&&(this._mediaInfo=Object.assign({},e),this._mediaInfo.keyframesIndex=null,this._mediaInfo.segments=[],this._mediaInfo.segmentCount=this._mediaDataSource.segments.length,Object.setPrototypeOf(this._mediaInfo,q.prototype));var n=Object.assign({},e);Object.setPrototypeOf(n,q.prototype),this._mediaInfo.segments[this._currentSegmentIndex]=n,this._reportSegmentMediaInfo(this._currentSegmentIndex),null!=this._pendingSeekTime&&Promise.resolve().then((function(){var e=t._pendingSeekTime;t._pendingSeekTime=null,t.seek(e)}))}},{key:"_onMetaDataArrived",value:function(e){this._emitter.emit(de.METADATA_ARRIVED,e)}},{key:"_onScriptDataArrived",value:function(e){this._emitter.emit(de.SCRIPTDATA_ARRIVED,e)}},{key:"_onIOSeeked",value:function(){this._remuxer.insertDiscontinuity()}},{key:"_onIOComplete",value:function(e){var t=e+1;t<this._mediaDataSource.segments.length?(this._internalAbort(),this._remuxer.flushStashedSamples(),this._loadSegment(t)):(this._remuxer.flushStashedSamples(),this._emitter.emit(de.LOADING_COMPLETE),this._disableStatisticsReporter())}},{key:"_onIORedirect",value:function(e){var t=this._ioctl.extraData;this._mediaDataSource.segments[t].redirectedURL=e}},{key:"_onIORecoveredEarlyEof",value:function(){this._emitter.emit(de.RECOVERED_EARLY_EOF)}},{key:"_onIOException",value:function(e,t){p.e(this.TAG,"IOException: type = ".concat(e,", code = ").concat(t.code,", msg = ").concat(t.msg)),this._emitter.emit(de.IO_ERROR,e,t),this._disableStatisticsReporter()}},{key:"_onDemuxException",value:function(e,t){p.e(this.TAG,"DemuxException: type = ".concat(e,", info = ").concat(t)),this._emitter.emit(de.DEMUX_ERROR,e,t)}},{key:"_onRemuxerInitSegmentArrival",value:function(e,t){this._emitter.emit(de.INIT_SEGMENT,e,t)}},{key:"_onRemuxerMediaSegmentArrival",value:function(e,t){if(null==this._pendingSeekTime&&(this._emitter.emit(de.MEDIA_SEGMENT,e,t),null!=this._pendingResolveSeekPoint&&"video"===e)){var n=t.info.syncPoints,i=this._pendingResolveSeekPoint;this._pendingResolveSeekPoint=null,R.safari&&n.length>0&&n[0].originalDts===i&&(i=n[0].pts),this._emitter.emit(de.RECOMMEND_SEEKPOINT,i)}}},{key:"_enableStatisticsReporter",value:function(){null==this._statisticsReporter&&(this._statisticsReporter=self.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval))}},{key:"_disableStatisticsReporter",value:function(){this._statisticsReporter&&(self.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"_reportSegmentMediaInfo",value:function(e){var t=this._mediaInfo.segments[e],n=Object.assign({},t);n.duration=this._mediaInfo.duration,n.segmentCount=this._mediaInfo.segmentCount,delete n.segments,delete n.keyframesIndex,this._emitter.emit(de.MEDIA_INFO,n)}},{key:"_reportStatisticsInfo",value:function(){var e={};e.url=this._ioctl.currentURL,e.hasRedirect=this._ioctl.hasRedirect,e.hasRedirect&&(e.redirectedURL=this._ioctl.currentRedirectedURL),e.speed=this._ioctl.currentSpeed,e.loaderType=this._ioctl.loaderType,e.currentSegmentIndex=this._currentSegmentIndex,e.totalSegmentCount=this._mediaDataSource.segments.length,this._emitter.emit(de.STATISTICS_INFO,e)}}]),e}(),pe=function(e){var t=null,n=function(t,n){e.postMessage({msg:"logcat_callback",data:{type:t,logcat:n}})}.bind(this);function i(t,n){var i={msg:de.INIT_SEGMENT,data:{type:t,data:n}};e.postMessage(i,[n.data])}function r(t,n){var i={msg:de.MEDIA_SEGMENT,data:{type:t,data:n}};e.postMessage(i,[n.data])}function o(){var t={msg:de.LOADING_COMPLETE};e.postMessage(t)}function a(){var t={msg:de.RECOVERED_EARLY_EOF};e.postMessage(t)}function s(t){var n={msg:de.MEDIA_INFO,data:t};e.postMessage(n)}function l(t){var n={msg:de.METADATA_ARRIVED,data:t};e.postMessage(n)}function u(t){var n={msg:de.SCRIPTDATA_ARRIVED,data:t};e.postMessage(n)}function h(t){var n={msg:de.STATISTICS_INFO,data:t};e.postMessage(n)}function d(t,n){e.postMessage({msg:de.IO_ERROR,data:{type:t,info:n}})}function f(t,n){e.postMessage({msg:de.DEMUX_ERROR,data:{type:t,info:n}})}function p(t){e.postMessage({msg:de.RECOMMEND_SEEKPOINT,data:t})}c.install(),e.addEventListener("message",(function(c){switch(c.data.cmd){case"init":(t=new fe(c.data.param[0],c.data.param[1])).on(de.IO_ERROR,d.bind(this)),t.on(de.DEMUX_ERROR,f.bind(this)),t.on(de.INIT_SEGMENT,i.bind(this)),t.on(de.MEDIA_SEGMENT,r.bind(this)),t.on(de.LOADING_COMPLETE,o.bind(this)),t.on(de.RECOVERED_EARLY_EOF,a.bind(this)),t.on(de.MEDIA_INFO,s.bind(this)),t.on(de.METADATA_ARRIVED,l.bind(this)),t.on(de.SCRIPTDATA_ARRIVED,u.bind(this)),t.on(de.STATISTICS_INFO,h.bind(this)),t.on(de.RECOMMEND_SEEKPOINT,p.bind(this));break;case"destroy":t&&(t.destroy(),t=null),e.postMessage({msg:"destroyed"});break;case"start":t.start();break;case"stop":t.stop();break;case"seek":t.seek(c.data.param);break;case"pause":t.pause();break;case"resume":t.resume();break;case"logging_config":var m=c.data.param;V.applyConfig(m),!0===m.enableCallback?V.addLogListener(n):V.removeLogListener(n)}}))},me=function(){function e(t,i){if(a()(this,e),this.TAG="Transmuxer",this._emitter=new(d()),i.enableWorker&&"undefined"!=typeof Worker)try{var r=n(82059);this._worker=r(pe),this._workerDestroying=!1,this._worker.addEventListener("message",this._onWorkerMessage.bind(this)),this._worker.postMessage({cmd:"init",param:[t,i]}),this.e={onLoggingConfigChanged:this._onLoggingConfigChanged.bind(this)},V.registerListener(this.e.onLoggingConfigChanged),this._worker.postMessage({cmd:"logging_config",param:V.getConfig()})}catch(e){p.e(this.TAG,"Error while initialize transmuxing worker, fallback to inline transmuxing"),this._worker=null,this._controller=new fe(t,i)}else this._controller=new fe(t,i);if(this._controller){var o=this._controller;o.on(de.IO_ERROR,this._onIOError.bind(this)),o.on(de.DEMUX_ERROR,this._onDemuxError.bind(this)),o.on(de.INIT_SEGMENT,this._onInitSegment.bind(this)),o.on(de.MEDIA_SEGMENT,this._onMediaSegment.bind(this)),o.on(de.LOADING_COMPLETE,this._onLoadingComplete.bind(this)),o.on(de.RECOVERED_EARLY_EOF,this._onRecoveredEarlyEof.bind(this)),o.on(de.MEDIA_INFO,this._onMediaInfo.bind(this)),o.on(de.METADATA_ARRIVED,this._onMetaDataArrived.bind(this)),o.on(de.SCRIPTDATA_ARRIVED,this._onScriptDataArrived.bind(this)),o.on(de.STATISTICS_INFO,this._onStatisticsInfo.bind(this)),o.on(de.RECOMMEND_SEEKPOINT,this._onRecommendSeekpoint.bind(this))}}return l()(e,[{key:"destroy",value:function(){this._worker?this._workerDestroying||(this._workerDestroying=!0,this._worker.postMessage({cmd:"destroy"}),V.removeListener(this.e.onLoggingConfigChanged),this.e=null):(this._controller.destroy(),this._controller=null),this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"hasWorker",value:function(){return null!=this._worker}},{key:"open",value:function(){this._worker?this._worker.postMessage({cmd:"start"}):this._controller.start()}},{key:"close",value:function(){this._worker?this._worker.postMessage({cmd:"stop"}):this._controller.stop()}},{key:"seek",value:function(e){this._worker?this._worker.postMessage({cmd:"seek",param:e}):this._controller.seek(e)}},{key:"pause",value:function(){this._worker?this._worker.postMessage({cmd:"pause"}):this._controller.pause()}},{key:"resume",value:function(){this._worker?this._worker.postMessage({cmd:"resume"}):this._controller.resume()}},{key:"_onInitSegment",value:function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(de.INIT_SEGMENT,e,t)}))}},{key:"_onMediaSegment",value:function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(de.MEDIA_SEGMENT,e,t)}))}},{key:"_onLoadingComplete",value:function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(de.LOADING_COMPLETE)}))}},{key:"_onRecoveredEarlyEof",value:function(){var e=this;Promise.resolve().then((function(){e._emitter.emit(de.RECOVERED_EARLY_EOF)}))}},{key:"_onMediaInfo",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(de.MEDIA_INFO,e)}))}},{key:"_onMetaDataArrived",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(de.METADATA_ARRIVED,e)}))}},{key:"_onScriptDataArrived",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(de.SCRIPTDATA_ARRIVED,e)}))}},{key:"_onStatisticsInfo",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(de.STATISTICS_INFO,e)}))}},{key:"_onIOError",value:function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(de.IO_ERROR,e,t)}))}},{key:"_onDemuxError",value:function(e,t){var n=this;Promise.resolve().then((function(){n._emitter.emit(de.DEMUX_ERROR,e,t)}))}},{key:"_onRecommendSeekpoint",value:function(e){var t=this;Promise.resolve().then((function(){t._emitter.emit(de.RECOMMEND_SEEKPOINT,e)}))}},{key:"_onLoggingConfigChanged",value:function(e){this._worker&&this._worker.postMessage({cmd:"logging_config",param:e})}},{key:"_onWorkerMessage",value:function(e){var t=e.data,n=t.data;if("destroyed"===t.msg||this._workerDestroying)return this._workerDestroying=!1,this._worker.terminate(),void(this._worker=null);switch(t.msg){case de.INIT_SEGMENT:case de.MEDIA_SEGMENT:this._emitter.emit(t.msg,n.type,n.data);break;case de.LOADING_COMPLETE:case de.RECOVERED_EARLY_EOF:this._emitter.emit(t.msg);break;case de.MEDIA_INFO:Object.setPrototypeOf(n,q.prototype),this._emitter.emit(t.msg,n);break;case de.METADATA_ARRIVED:case de.SCRIPTDATA_ARRIVED:case de.STATISTICS_INFO:this._emitter.emit(t.msg,n);break;case de.IO_ERROR:case de.DEMUX_ERROR:this._emitter.emit(t.msg,n.type,n.info);break;case de.RECOMMEND_SEEKPOINT:this._emitter.emit(t.msg,n);break;case"logcat_callback":p.emitter.emit("log",n.type,n.logcat)}}}]),e}(),ve={ERROR:"error",SOURCE_OPEN:"source_open",UPDATE_END:"update_end",BUFFER_FULL:"buffer_full"},ge=function(){function e(t){a()(this,e),this.TAG="MSEController",this._config=t,this._emitter=new(d()),this._config.isLive&&null==this._config.autoCleanupSourceBuffer&&(this._config.autoCleanupSourceBuffer=!0),this.e={onSourceOpen:this._onSourceOpen.bind(this),onSourceEnded:this._onSourceEnded.bind(this),onSourceClose:this._onSourceClose.bind(this),onSourceBufferError:this._onSourceBufferError.bind(this),onSourceBufferUpdateEnd:this._onSourceBufferUpdateEnd.bind(this)},this._mediaSource=null,this._mediaSourceObjectURL=null,this._mediaElement=null,this._isBufferFull=!1,this._hasPendingEos=!1,this._requireSetMediaDuration=!1,this._pendingMediaDuration=0,this._pendingSourceBufferInit=[],this._mimeTypes={video:null,audio:null},this._sourceBuffers={video:null,audio:null},this._lastInitSegments={video:null,audio:null},this._pendingSegments={video:[],audio:[]},this._pendingRemoveRanges={video:[],audio:[]},this._idrList=new ue}return l()(e,[{key:"destroy",value:function(){(this._mediaElement||this._mediaSource)&&this.detachMediaElement(),this.e=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"attachMediaElement",value:function(e){if(this._mediaSource)throw new w("MediaSource has been attached to an HTMLMediaElement!");var t=this._mediaSource=new window.MediaSource;t.addEventListener("sourceopen",this.e.onSourceOpen),t.addEventListener("sourceended",this.e.onSourceEnded),t.addEventListener("sourceclose",this.e.onSourceClose),this._mediaElement=e,this._mediaSourceObjectURL=window.URL.createObjectURL(this._mediaSource),e.src=this._mediaSourceObjectURL}},{key:"detachMediaElement",value:function(){if(this._mediaSource){var e=this._mediaSource;for(var t in this._sourceBuffers){var n=this._pendingSegments[t];n.splice(0,n.length),this._pendingSegments[t]=null,this._pendingRemoveRanges[t]=null,this._lastInitSegments[t]=null;var i=this._sourceBuffers[t];if(i){if("closed"!==e.readyState){try{e.removeSourceBuffer(i)}catch(e){p.e(this.TAG,e.message)}i.removeEventListener("error",this.e.onSourceBufferError),i.removeEventListener("updateend",this.e.onSourceBufferUpdateEnd)}this._mimeTypes[t]=null,this._sourceBuffers[t]=null}}if("open"===e.readyState)try{e.endOfStream()}catch(e){p.e(this.TAG,e.message)}e.removeEventListener("sourceopen",this.e.onSourceOpen),e.removeEventListener("sourceended",this.e.onSourceEnded),e.removeEventListener("sourceclose",this.e.onSourceClose),this._pendingSourceBufferInit=[],this._isBufferFull=!1,this._idrList.clear(),this._mediaSource=null}this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement=null),this._mediaSourceObjectURL&&(window.URL.revokeObjectURL(this._mediaSourceObjectURL),this._mediaSourceObjectURL=null)}},{key:"appendInitSegment",value:function(e,t){if(!this._mediaSource||"open"!==this._mediaSource.readyState)return this._pendingSourceBufferInit.push(e),void this._pendingSegments[e.type].push(e);var n=e,i="".concat(n.container);n.codec&&n.codec.length>0&&(i+=";codecs=".concat(n.codec));var r=!1;if(p.v(this.TAG,"Received Initialization Segment, mimeType: "+i),this._lastInitSegments[n.type]=n,i!==this._mimeTypes[n.type]){if(this._mimeTypes[n.type])p.v(this.TAG,"Notice: ".concat(n.type," mimeType changed, origin: ").concat(this._mimeTypes[n.type],", target: ").concat(i));else{r=!0;try{var o=this._sourceBuffers[n.type]=this._mediaSource.addSourceBuffer(i);o.addEventListener("error",this.e.onSourceBufferError),o.addEventListener("updateend",this.e.onSourceBufferUpdateEnd)}catch(e){return p.e(this.TAG,e.message),void this._emitter.emit(ve.ERROR,{code:e.code,msg:e.message})}}this._mimeTypes[n.type]=i}t||this._pendingSegments[n.type].push(n),r||this._sourceBuffers[n.type]&&!this._sourceBuffers[n.type].updating&&this._doAppendSegments(),R.safari&&"audio/mpeg"===n.container&&n.mediaDuration>0&&(this._requireSetMediaDuration=!0,this._pendingMediaDuration=n.mediaDuration/1e3,this._updateMediaSourceDuration())}},{key:"appendMediaSegment",value:function(e){var t=e;this._pendingSegments[t.type].push(t),this._config.autoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanupSourceBuffer();var n=this._sourceBuffers[t.type];!n||n.updating||this._hasPendingRemoveRanges()||this._doAppendSegments()}},{key:"seek",value:function(e){for(var t in this._sourceBuffers)if(this._sourceBuffers[t]){var n=this._sourceBuffers[t];if("open"===this._mediaSource.readyState)try{n.abort()}catch(e){p.e(this.TAG,e.message)}this._idrList.clear();var i=this._pendingSegments[t];if(i.splice(0,i.length),"closed"!==this._mediaSource.readyState){for(var r=0;r<n.buffered.length;r++){var o=n.buffered.start(r),a=n.buffered.end(r);this._pendingRemoveRanges[t].push({start:o,end:a})}if(n.updating||this._doRemoveRanges(),R.safari){var s=this._lastInitSegments[t];s&&(this._pendingSegments[t].push(s),n.updating||this._doAppendSegments())}}}}},{key:"endOfStream",value:function(){var e=this._mediaSource,t=this._sourceBuffers;e&&"open"===e.readyState?t.video&&t.video.updating||t.audio&&t.audio.updating?this._hasPendingEos=!0:(this._hasPendingEos=!1,e.endOfStream()):e&&"closed"===e.readyState&&this._hasPendingSegments()&&(this._hasPendingEos=!0)}},{key:"getNearestKeyframe",value:function(e){return this._idrList.getLastSyncPointBeforeDts(e)}},{key:"_needCleanupSourceBuffer",value:function(){if(!this._config.autoCleanupSourceBuffer)return!1;var e=this._mediaElement.currentTime;for(var t in this._sourceBuffers){var n=this._sourceBuffers[t];if(n){var i=n.buffered;if(i.length>=1&&e-i.start(0)>=this._config.autoCleanupMaxBackwardDuration)return!0}}return!1}},{key:"_doCleanupSourceBuffer",value:function(){var e=this._mediaElement.currentTime;for(var t in this._sourceBuffers){var n=this._sourceBuffers[t];if(n){for(var i=n.buffered,r=!1,o=0;o<i.length;o++){var a=i.start(o),s=i.end(o);if(a<=e&&e<s+3){if(e-a>=this._config.autoCleanupMaxBackwardDuration){r=!0;var l=e-this._config.autoCleanupMinBackwardDuration;this._pendingRemoveRanges[t].push({start:a,end:l})}}else s<e&&(r=!0,this._pendingRemoveRanges[t].push({start:a,end:s}))}r&&!n.updating&&this._doRemoveRanges()}}}},{key:"_updateMediaSourceDuration",value:function(){var e=this._sourceBuffers;if(0!==this._mediaElement.readyState&&"open"===this._mediaSource.readyState&&!(e.video&&e.video.updating||e.audio&&e.audio.updating)){var t=this._mediaSource.duration,n=this._pendingMediaDuration;n>0&&(isNaN(t)||n>t)&&(p.v(this.TAG,"Update MediaSource duration from ".concat(t," to ").concat(n)),this._mediaSource.duration=n),this._requireSetMediaDuration=!1,this._pendingMediaDuration=0}}},{key:"_doRemoveRanges",value:function(){for(var e in this._pendingRemoveRanges)if(this._sourceBuffers[e]&&!this._sourceBuffers[e].updating)for(var t=this._sourceBuffers[e],n=this._pendingRemoveRanges[e];n.length&&!t.updating;){var i=n.shift();t.remove(i.start,i.end)}}},{key:"_doAppendSegments",value:function(){var e=this._pendingSegments;for(var t in e)if(this._sourceBuffers[t]&&!this._sourceBuffers[t].updating&&e[t].length>0){var n=e[t].shift();if(n.timestampOffset){var i=this._sourceBuffers[t].timestampOffset,r=n.timestampOffset/1e3;Math.abs(i-r)>.1&&(p.v(this.TAG,"Update MPEG audio timestampOffset from ".concat(i," to ").concat(r)),this._sourceBuffers[t].timestampOffset=r),delete n.timestampOffset}if(!n.data||0===n.data.byteLength)continue;try{this._sourceBuffers[t].appendBuffer(n.data),this._isBufferFull=!1,"video"===t&&n.hasOwnProperty("info")&&this._idrList.appendArray(n.info.syncPoints)}catch(e){this._pendingSegments[t].unshift(n),22===e.code?(this._isBufferFull||this._emitter.emit(ve.BUFFER_FULL),this._isBufferFull=!0):(p.e(this.TAG,e.message),this._emitter.emit(ve.ERROR,{code:e.code,msg:e.message}))}}}},{key:"_onSourceOpen",value:function(){if(p.v(this.TAG,"MediaSource onSourceOpen"),this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._pendingSourceBufferInit.length>0)for(var e=this._pendingSourceBufferInit;e.length;){var t=e.shift();this.appendInitSegment(t,!0)}this._hasPendingSegments()&&this._doAppendSegments(),this._emitter.emit(ve.SOURCE_OPEN)}},{key:"_onSourceEnded",value:function(){p.v(this.TAG,"MediaSource onSourceEnded")}},{key:"_onSourceClose",value:function(){p.v(this.TAG,"MediaSource onSourceClose"),this._mediaSource&&null!=this.e&&(this._mediaSource.removeEventListener("sourceopen",this.e.onSourceOpen),this._mediaSource.removeEventListener("sourceended",this.e.onSourceEnded),this._mediaSource.removeEventListener("sourceclose",this.e.onSourceClose))}},{key:"_hasPendingSegments",value:function(){var e=this._pendingSegments;return e.video.length>0||e.audio.length>0}},{key:"_hasPendingRemoveRanges",value:function(){var e=this._pendingRemoveRanges;return e.video.length>0||e.audio.length>0}},{key:"_onSourceBufferUpdateEnd",value:function(){this._requireSetMediaDuration?this._updateMediaSourceDuration():this._hasPendingRemoveRanges()?this._doRemoveRanges():this._hasPendingSegments()?this._doAppendSegments():this._hasPendingEos&&this.endOfStream(),this._emitter.emit(ve.UPDATE_END)}},{key:"_onSourceBufferError",value:function(e){p.e(this.TAG,"SourceBuffer Error: ".concat(e))}}]),e}(),ye={NETWORK_ERROR:"NetworkError",MEDIA_ERROR:"MediaError",OTHER_ERROR:"OtherError"},be={NETWORK_EXCEPTION:S.EXCEPTION,NETWORK_STATUS_CODE_INVALID:S.HTTP_STATUS_CODE_INVALID,NETWORK_TIMEOUT:S.CONNECTING_TIMEOUT,NETWORK_UNRECOVERABLE_EARLY_EOF:S.UNRECOVERABLE_EARLY_EOF,MEDIA_MSE_ERROR:"MediaMSEError",MEDIA_FORMAT_ERROR:te.FORMAT_ERROR,MEDIA_FORMAT_UNSUPPORTED:te.FORMAT_UNSUPPORTED,MEDIA_CODEC_UNSUPPORTED:te.CODEC_UNSUPPORTED},xe=function(){function e(t,n){if(a()(this,e),this.TAG="FlvPlayer",this._type="FlvPlayer",this._emitter=new(d()),this._config=H(),"object"===r()(n)&&Object.assign(this._config,n),"flv"!==t.type.toLowerCase())throw new _("FlvPlayer requires an flv MediaDataSource input!");!0===t.isLive&&(this._config.isLive=!0),this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this),onvSeeking:this._onvSeeking.bind(this),onvCanPlay:this._onvCanPlay.bind(this),onvStalled:this._onvStalled.bind(this),onvProgress:this._onvProgress.bind(this)},self.performance&&self.performance.now?this._now=self.performance.now.bind(self.performance):this._now=Date.now,this._pendingSeekTime=null,this._requestSetTime=!1,this._seekpointRecord=null,this._progressChecker=null,this._mediaDataSource=t,this._mediaElement=null,this._msectl=null,this._transmuxer=null,this._mseSourceOpened=!1,this._hasPendingLoad=!1,this._receivedCanPlay=!1,this._mediaInfo=null,this._statisticsInfo=null;var i=R.chrome&&(R.version.major<50||50===R.version.major&&R.version.build<2661);this._alwaysSeekKeyframe=!!(i||R.msedge||R.msie),this._alwaysSeekKeyframe&&(this._config.accurateSeek=!1)}return l()(e,[{key:"destroy",value:function(){null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._transmuxer&&this.unload(),this._mediaElement&&this.detachMediaElement(),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){var n=this;e===U.MEDIA_INFO?null!=this._mediaInfo&&Promise.resolve().then((function(){n._emitter.emit(U.MEDIA_INFO,n.mediaInfo)})):e===U.STATISTICS_INFO&&null!=this._statisticsInfo&&Promise.resolve().then((function(){n._emitter.emit(U.STATISTICS_INFO,n.statisticsInfo)})),this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"attachMediaElement",value:function(e){var t=this;if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),e.addEventListener("seeking",this.e.onvSeeking),e.addEventListener("canplay",this.e.onvCanPlay),e.addEventListener("stalled",this.e.onvStalled),e.addEventListener("progress",this.e.onvProgress),this._msectl=new ge(this._config),this._msectl.on(ve.UPDATE_END,this._onmseUpdateEnd.bind(this)),this._msectl.on(ve.BUFFER_FULL,this._onmseBufferFull.bind(this)),this._msectl.on(ve.SOURCE_OPEN,(function(){t._mseSourceOpened=!0,t._hasPendingLoad&&(t._hasPendingLoad=!1,t.load())})),this._msectl.on(ve.ERROR,(function(e){t._emitter.emit(U.ERROR,ye.MEDIA_ERROR,be.MEDIA_MSE_ERROR,e)})),this._msectl.attachMediaElement(e),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._msectl.detachMediaElement(),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement.removeEventListener("seeking",this.e.onvSeeking),this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay),this._mediaElement.removeEventListener("stalled",this.e.onvStalled),this._mediaElement.removeEventListener("progress",this.e.onvProgress),this._mediaElement=null),this._msectl&&(this._msectl.destroy(),this._msectl=null)}},{key:"load",value:function(){var e=this;if(!this._mediaElement)throw new w("HTMLMediaElement must be attached before load()!");if(this._transmuxer)throw new w("FlvPlayer.load() has been called, please call unload() first!");this._hasPendingLoad||(this._config.deferLoadAfterSourceOpen&&!1===this._mseSourceOpened?this._hasPendingLoad=!0:(this._mediaElement.readyState>0&&(this._requestSetTime=!0,this._mediaElement.currentTime=0),this._transmuxer=new me(this._mediaDataSource,this._config),this._transmuxer.on(de.INIT_SEGMENT,(function(t,n){e._msectl.appendInitSegment(n)})),this._transmuxer.on(de.MEDIA_SEGMENT,(function(t,n){if(e._msectl.appendMediaSegment(n),e._config.lazyLoad&&!e._config.isLive){var i=e._mediaElement.currentTime;n.info.endDts>=1e3*(i+e._config.lazyLoadMaxDuration)&&null==e._progressChecker&&(p.v(e.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),e._suspendTransmuxer())}})),this._transmuxer.on(de.LOADING_COMPLETE,(function(){e._msectl.endOfStream(),e._emitter.emit(U.LOADING_COMPLETE)})),this._transmuxer.on(de.RECOVERED_EARLY_EOF,(function(){e._emitter.emit(U.RECOVERED_EARLY_EOF)})),this._transmuxer.on(de.IO_ERROR,(function(t,n){e._emitter.emit(U.ERROR,ye.NETWORK_ERROR,t,n)})),this._transmuxer.on(de.DEMUX_ERROR,(function(t,n){e._emitter.emit(U.ERROR,ye.MEDIA_ERROR,t,{code:-1,msg:n})})),this._transmuxer.on(de.MEDIA_INFO,(function(t){e._mediaInfo=t,e._emitter.emit(U.MEDIA_INFO,Object.assign({},t))})),this._transmuxer.on(de.METADATA_ARRIVED,(function(t){e._emitter.emit(U.METADATA_ARRIVED,t)})),this._transmuxer.on(de.SCRIPTDATA_ARRIVED,(function(t){e._emitter.emit(U.SCRIPTDATA_ARRIVED,t)})),this._transmuxer.on(de.STATISTICS_INFO,(function(t){e._statisticsInfo=e._fillStatisticsInfo(t),e._emitter.emit(U.STATISTICS_INFO,Object.assign({},e._statisticsInfo))})),this._transmuxer.on(de.RECOMMEND_SEEKPOINT,(function(t){e._mediaElement&&!e._config.accurateSeek&&(e._requestSetTime=!0,e._mediaElement.currentTime=t/1e3)})),this._transmuxer.open()))}},{key:"unload",value:function(){this._mediaElement&&this._mediaElement.pause(),this._msectl&&this._msectl.seek(0),this._transmuxer&&(this._transmuxer.close(),this._transmuxer.destroy(),this._transmuxer=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._internalSeek(e):this._pendingSeekTime=e}},{key:"mediaInfo",get:function(){return Object.assign({},this._mediaInfo)}},{key:"statisticsInfo",get:function(){return null==this._statisticsInfo&&(this._statisticsInfo={}),this._statisticsInfo=this._fillStatisticsInfo(this._statisticsInfo),Object.assign({},this._statisticsInfo)}},{key:"_fillStatisticsInfo",value:function(e){if(e.playerType=this._type,!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,n=0,i=0;if(this._mediaElement.getVideoPlaybackQuality){var r=this._mediaElement.getVideoPlaybackQuality();n=r.totalVideoFrames,i=r.droppedVideoFrames}else null!=this._mediaElement.webkitDecodedFrameCount?(n=this._mediaElement.webkitDecodedFrameCount,i=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=n,e.droppedFrames=i),e}},{key:"_onmseUpdateEnd",value:function(){if(this._config.lazyLoad&&!this._config.isLive){for(var e=this._mediaElement.buffered,t=this._mediaElement.currentTime,n=0,i=0;i<e.length;i++){var r=e.start(i),o=e.end(i);if(r<=t&&t<o){r,n=o;break}}n>=t+this._config.lazyLoadMaxDuration&&null==this._progressChecker&&(p.v(this.TAG,"Maximum buffering duration exceeded, suspend transmuxing task"),this._suspendTransmuxer())}}},{key:"_onmseBufferFull",value:function(){p.v(this.TAG,"MSE SourceBuffer is full, suspend transmuxing task"),null==this._progressChecker&&this._suspendTransmuxer()}},{key:"_suspendTransmuxer",value:function(){this._transmuxer&&(this._transmuxer.pause(),null==this._progressChecker&&(this._progressChecker=window.setInterval(this._checkProgressAndResume.bind(this),1e3)))}},{key:"_checkProgressAndResume",value:function(){for(var e=this._mediaElement.currentTime,t=this._mediaElement.buffered,n=!1,i=0;i<t.length;i++){var r=t.start(i),o=t.end(i);if(e>=r&&e<o){e>=o-this._config.lazyLoadRecoverDuration&&(n=!0);break}}n&&(window.clearInterval(this._progressChecker),this._progressChecker=null,n&&(p.v(this.TAG,"Continue loading from paused position"),this._transmuxer.resume()))}},{key:"_isTimepointBuffered",value:function(e){for(var t=this._mediaElement.buffered,n=0;n<t.length;n++){var i=t.start(n),r=t.end(n);if(e>=i&&e<r)return!0}return!1}},{key:"_internalSeek",value:function(e){var t=this._isTimepointBuffered(e),n=!1,i=0;if(e<1&&this._mediaElement.buffered.length>0){var r=this._mediaElement.buffered.start(0);(r<1&&e<r||R.safari)&&(n=!0,i=R.safari?.1:r)}if(n)this._requestSetTime=!0,this._mediaElement.currentTime=i;else if(t){if(this._alwaysSeekKeyframe){var o=this._msectl.getNearestKeyframe(Math.floor(1e3*e));this._requestSetTime=!0,this._mediaElement.currentTime=null!=o?o.dts/1e3:e}else this._requestSetTime=!0,this._mediaElement.currentTime=e;null!=this._progressChecker&&this._checkProgressAndResume()}else null!=this._progressChecker&&(window.clearInterval(this._progressChecker),this._progressChecker=null),this._msectl.seek(e),this._transmuxer.seek(Math.floor(1e3*e)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=e)}},{key:"_checkAndApplyUnbufferedSeekpoint",value:function(){if(this._seekpointRecord)if(this._seekpointRecord.recordTime<=this._now()-100){var e=this._mediaElement.currentTime;this._seekpointRecord=null,this._isTimepointBuffered(e)||(null!=this._progressChecker&&(window.clearTimeout(this._progressChecker),this._progressChecker=null),this._msectl.seek(e),this._transmuxer.seek(Math.floor(1e3*e)),this._config.accurateSeek&&(this._requestSetTime=!0,this._mediaElement.currentTime=e))}else window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}},{key:"_checkAndResumeStuckPlayback",value:function(e){var t=this._mediaElement;if(e||!this._receivedCanPlay||t.readyState<2){var n=t.buffered;n.length>0&&t.currentTime<n.start(0)&&(p.w(this.TAG,"Playback seems stuck at ".concat(t.currentTime,", seek to ").concat(n.start(0))),this._requestSetTime=!0,this._mediaElement.currentTime=n.start(0),this._mediaElement.removeEventListener("progress",this.e.onvProgress))}else this._mediaElement.removeEventListener("progress",this.e.onvProgress)}},{key:"_onvLoadedMetadata",value:function(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null)}},{key:"_onvSeeking",value:function(e){var t=this._mediaElement.currentTime,n=this._mediaElement.buffered;if(this._requestSetTime)this._requestSetTime=!1;else{if(t<1&&n.length>0){var i=n.start(0);if(i<1&&t<i||R.safari)return this._requestSetTime=!0,void(this._mediaElement.currentTime=R.safari?.1:i)}if(this._isTimepointBuffered(t)){if(this._alwaysSeekKeyframe){var r=this._msectl.getNearestKeyframe(Math.floor(1e3*t));null!=r&&(this._requestSetTime=!0,this._mediaElement.currentTime=r.dts/1e3)}null!=this._progressChecker&&this._checkProgressAndResume()}else this._seekpointRecord={seekPoint:t,recordTime:this._now()},window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this),50)}}},{key:"_onvCanPlay",value:function(e){this._receivedCanPlay=!0,this._mediaElement.removeEventListener("canplay",this.e.onvCanPlay)}},{key:"_onvStalled",value:function(e){this._checkAndResumeStuckPlayback(!0)}},{key:"_onvProgress",value:function(e){this._checkAndResumeStuckPlayback()}}]),e}(),we=function(){function e(t,n){if(a()(this,e),this.TAG="NativePlayer",this._type="NativePlayer",this._emitter=new(d()),this._config=H(),"object"===r()(n)&&Object.assign(this._config,n),"flv"===t.type.toLowerCase())throw new _("NativePlayer does't support flv MediaDataSource input!");if(t.hasOwnProperty("segments"))throw new _("NativePlayer(".concat(t.type,") doesn't support multipart playback!"));this.e={onvLoadedMetadata:this._onvLoadedMetadata.bind(this)},this._pendingSeekTime=null,this._statisticsReporter=null,this._mediaDataSource=t,this._mediaElement=null}return l()(e,[{key:"destroy",value:function(){this._mediaElement&&(this.unload(),this.detachMediaElement()),this.e=null,this._mediaDataSource=null,this._emitter.removeAllListeners(),this._emitter=null}},{key:"on",value:function(e,t){var n=this;e===U.MEDIA_INFO?null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((function(){n._emitter.emit(U.MEDIA_INFO,n.mediaInfo)})):e===U.STATISTICS_INFO&&null!=this._mediaElement&&0!==this._mediaElement.readyState&&Promise.resolve().then((function(){n._emitter.emit(U.STATISTICS_INFO,n.statisticsInfo)})),this._emitter.addListener(e,t)}},{key:"off",value:function(e,t){this._emitter.removeListener(e,t)}},{key:"attachMediaElement",value:function(e){if(this._mediaElement=e,e.addEventListener("loadedmetadata",this.e.onvLoadedMetadata),null!=this._pendingSeekTime)try{e.currentTime=this._pendingSeekTime,this._pendingSeekTime=null}catch(e){}}},{key:"detachMediaElement",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src"),this._mediaElement.removeEventListener("loadedmetadata",this.e.onvLoadedMetadata),this._mediaElement=null),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"load",value:function(){if(!this._mediaElement)throw new w("HTMLMediaElement must be attached before load()!");this._mediaElement.src=this._mediaDataSource.url,this._mediaElement.readyState>0&&(this._mediaElement.currentTime=0),this._mediaElement.preload="auto",this._mediaElement.load(),this._statisticsReporter=window.setInterval(this._reportStatisticsInfo.bind(this),this._config.statisticsInfoReportInterval)}},{key:"unload",value:function(){this._mediaElement&&(this._mediaElement.src="",this._mediaElement.removeAttribute("src")),null!=this._statisticsReporter&&(window.clearInterval(this._statisticsReporter),this._statisticsReporter=null)}},{key:"play",value:function(){return this._mediaElement.play()}},{key:"pause",value:function(){this._mediaElement.pause()}},{key:"type",get:function(){return this._type}},{key:"buffered",get:function(){return this._mediaElement.buffered}},{key:"duration",get:function(){return this._mediaElement.duration}},{key:"volume",get:function(){return this._mediaElement.volume},set:function(e){this._mediaElement.volume=e}},{key:"muted",get:function(){return this._mediaElement.muted},set:function(e){this._mediaElement.muted=e}},{key:"currentTime",get:function(){return this._mediaElement?this._mediaElement.currentTime:0},set:function(e){this._mediaElement?this._mediaElement.currentTime=e:this._pendingSeekTime=e}},{key:"mediaInfo",get:function(){var e={mimeType:(this._mediaElement instanceof HTMLAudioElement?"audio/":"video/")+this._mediaDataSource.type};return this._mediaElement&&(e.duration=Math.floor(1e3*this._mediaElement.duration),this._mediaElement instanceof HTMLVideoElement&&(e.width=this._mediaElement.videoWidth,e.height=this._mediaElement.videoHeight)),e}},{key:"statisticsInfo",get:function(){var e={playerType:this._type,url:this._mediaDataSource.url};if(!(this._mediaElement instanceof HTMLVideoElement))return e;var t=!0,n=0,i=0;if(this._mediaElement.getVideoPlaybackQuality){var r=this._mediaElement.getVideoPlaybackQuality();n=r.totalVideoFrames,i=r.droppedVideoFrames}else null!=this._mediaElement.webkitDecodedFrameCount?(n=this._mediaElement.webkitDecodedFrameCount,i=this._mediaElement.webkitDroppedFrameCount):t=!1;return t&&(e.decodedFrames=n,e.droppedFrames=i),e}},{key:"_onvLoadedMetadata",value:function(e){null!=this._pendingSeekTime&&(this._mediaElement.currentTime=this._pendingSeekTime,this._pendingSeekTime=null),this._emitter.emit(U.MEDIA_INFO,this.mediaInfo)}},{key:"_reportStatisticsInfo",value:function(){this._emitter.emit(U.STATISTICS_INFO,this.statisticsInfo)}}]),e}();c.install();var _e={createPlayer:function(e,t){var n=e;if(null==n||"object"!==r()(n))throw new _("MediaDataSource must be an javascript object!");if(!n.hasOwnProperty("type"))throw new _("MediaDataSource must has type field to indicate video file type!");return"flv"===n.type?new xe(n,t):new we(n,t)},isSupported:function(){return G.supportMSEH264Playback()},getFeatureList:function(){return G.getFeatureList()}};_e.BaseLoader=E,_e.LoaderStatus=C,_e.LoaderErrors=S,_e.Events=U,_e.ErrorTypes=ye,_e.ErrorDetails=be,_e.FlvPlayer=xe,_e.NativePlayer=we,_e.LoggingControl=V,Object.defineProperty(_e,"version",{enumerable:!0,get:function(){return"__VERSION__"}});var ke=_e},2018:function(){},66551:function(){},40862: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 u=n.getWrapperElement();u.className=u.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:u};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 h(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 u=d(t,a[l].head);if(!u||o.indexOf(u)%2!=0)return e.Pass}for(l=a.length-1;l>=0;l--){var c=a[l].head;t.replaceRange("",n(c.line,c.ch-1),n(c.line,c.ch+1),"+delete")}}function u(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=d(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 c(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 h(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 u,h=i(o,"closeBefore"),d=i(o,"triples"),p=a.charAt(l+1)==r,m=t.listSelections(),v=l%2==0,g=0;g<m.length;g++){var y,b=m[g],x=b.head,w=t.getRange(x,n(x.line,x.ch+1));if(v&&!b.empty())y="surround";else if(!p&&v||w!=r)if(p&&x.ch>1&&d.indexOf(r)>=0&&t.getRange(n(x.line,x.ch-2),x)==r+r){if(x.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(x.line,x.ch-2))))return e.Pass;y="addFour"}else if(p){var _=0==x.ch?" ":t.getRange(n(x.line,x.ch-1),x);if(e.isWordChar(w)||_==r||e.isWordChar(_))return e.Pass;y="both"}else{if(!v||!(0===w.length||/\s/.test(w)||h.indexOf(w)>-1))return e.Pass;y="both"}else y=p&&f(t,x)?"both":d.indexOf(r)>=0&&t.getRange(x,n(x.line,x.ch+3))==r+r+r?"skipThree":"skip";if(u){if(u!=y)return e.Pass}else u=y}var k=l%2?a.charAt(l-1):r,C=l%2?r:a.charAt(l+1);t.operation((function(){if("skip"==u)t.execCommand("goCharRight");else if("skipThree"==u)for(var e=0;e<3;e++)t.execCommand("goCharRight");else if("surround"==u){var n=t.getSelections();for(e=0;e<n.length;e++)n[e]=k+n[e]+C;for(t.replaceSelections(n,"around"),n=t.listSelections().slice(),e=0;e<n.length;e++)n[e]=c(n[e]);t.setSelections(n)}else"both"==u?(t.replaceSelection(k+C,null),t.triggerElectric(k+C),t.execCommand("goCharLeft")):"addFour"==u&&(t.replaceSelection(k+k+k+k,"before"),t.execCommand("goCharRight"))}))}function d(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 f(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"),u=0;u<r.length;u++){if(!r[u].empty())return e.Pass;var c=r[u].head,h=i.getTokenAt(c),d=e.innerMode(i.getMode(),h.state),f=d.state,p=d.mode.xmlCurrentTag&&d.mode.xmlCurrentTag(f),m=p&&p.name;if(!m)return e.Pass;var v="html"==d.mode.configuration,g="object"==typeof l&&l.dontCloseTags||v&&t,y="object"==typeof l&&l.indentTags||v&&n;h.end>c.ch&&(m=m.slice(0,m.length-h.end+c.ch));var b=m.toLowerCase();if(!m||"string"==h.type&&(h.end!=c.ch||!/[\"\']/.test(h.string.charAt(h.string.length-1))||1==h.string.length)||"tag"==h.type&&p.close||h.string.indexOf("/")==c.ch-h.start-1||g&&a(g,b)>-1||s(i,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(f)||[],m,c,!0))return e.Pass;var x="object"==typeof l&&l.emptyTags;if(x&&a(x,m)>-1)o[u]={text:"/>",newPos:e.Pos(c.line,c.ch+2)};else{var w=y&&a(y,b)>-1;o[u]={indent:w,text:">"+(w?"\n\n":"")+"</"+m+">",newPos:w?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}}var _="object"==typeof l&&l.dontIndentOnAutoClose;for(u=r.length-1;u>=0;u--){var k=o[u];i.replaceRange(k.text,r[u].head,r[u].anchor,"+insert");var C=i.listSelections().slice(0);C[u]={head:k.newPos,anchor:k.newPos},i.setSelections(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,u=0;u<i.length;u++){if(!i[u].empty())return e.Pass;var c=i[u].head,h=t.getTokenAt(c),d=e.innerMode(t.getMode(),h.state),f=d.state;if(n&&("string"==h.type||"<"!=h.string.charAt(0)||h.start!=c.ch-1))return e.Pass;var p,m="xml"!=d.mode.name&&"htmlmixed"==t.getMode().name;if(m&&"javascript"==d.mode.name)p=o+"script";else if(m&&"css"==d.mode.name)p=o+"style";else{var v=d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(f);if(!v||v.length&&s(t,v,v[v.length-1],c))return e.Pass;p=o+v[v.length-1]}">"!=t.getLine(c.line).charAt(h.end)&&(p+=">"),r[u]=p}if(t.replaceSelections(r),i=t.listSelections(),!l)for(u=0;u<i.length;u++)(u==i.length-1||i[u].head.line<i[u+1].head.line)&&t.indentLine(i[u].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,u=n.length-1;u>=0&&n[u]==i;u--)++l;for(r=s.to,u=1;u<l;u++){var c=e.scanForClosingTag(t,r,null,a);if(!c||c.tag!=i)return!1;r=c.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 u(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 c(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 h(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 d(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 f(e,n){for(var i=[];;){var r,o=h(e),a=e.line,s=e.ch-(o?o[0].length:0);if(!o||!(r=u(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 p(e,n){for(var i=[];;){var r=d(e);if(!r)return;if("selfClose"!=r){var o=e.line,a=e.ch,s=c(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 c(e)}}e.registerHelper("fold","xml",(function(e,i){for(var r=new o(e,i.line,0);;){var a=h(r);if(!a||r.line!=i.line)return;var s=u(r);if(!s)return;if(!a[1]&&"selfClose"!=s){var l=t(r.line,r.ch),c=f(r,a[2]);return c&&n(c.from,l)>0?{from:l,to:c.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=u(a),l=s&&t(a.line,a.ch),h=s&&c(a);if(s&&h&&!(n(a,i)>0)){var d={from:t(a.line,a.ch),to:l,tag:h[2]};return"selfClose"==s?{open:d,close:null,at:"open"}:h[1]?{open:p(a,h[2]),close:d,at:"close"}:{open:d,close:f(a=new o(e,l.line,l.ch,r),h[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,n,i){for(var r=new o(e,t.line,t.ch,n);;){var a=p(r,i);if(!a)break;var s=f(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 f(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),u=l&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\//.test(e),h=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),m=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),v=/Android/.test(e),g=m||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),w=h&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(h=!1,l=!0);var _=y&&(u||h&&(null==w||w<12.11)),k=n||a&&s>=9;function C(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var S,E=function(e,t){var n=e.className,i=C(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 L(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function A(e,t){return L(e).appendChild(t)}function T(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 M(e,t,n,i){var r=T(e,t,n,i);return r.setAttribute("role","presentation"),r}function D(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 R(){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 B(e,t){var n=e.className;C(t).test(n)||(e.className+=(n?" ":"")+t)}function N(e,t){for(var n=e.split(" "),i=0;i<n.length;i++)n[i]&&!C(n[i]).test(t)&&(t+=" "+n[i]);return t}S=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 P=function(e){e.select()};function I(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function O(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 F(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?P=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(P=function(e){try{e.select()}catch(e){}});var j=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};function z(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}j.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},j.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 H=50,W={toString:function(){return"CodeMirror.Pass"}},G={scroll:!1},U={origin:"*mouse"},Z={origin:"+move"};function V(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 q=[""];function K(e){for(;q.length<=e;)q.push(Y(q)+" ");return q[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&&O(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 ue=null;function ce(e,t,n){var i;ue=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:ue=r),o.from==t&&(o.from!=o.to&&"before"!=n?i=r:ue=r)}return null!=i?i:ue}var he=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 u="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!i.test(e))return!1;for(var c=e.length,h=[],d=0;d<c;++d)h.push(n(e.charCodeAt(d)));for(var f=0,p=u;f<c;++f){var m=h[f];"m"==m?h[f]=p:p=m}for(var v=0,g=u;v<c;++v){var y=h[v];"1"==y&&"r"==g?h[v]="n":o.test(y)&&(g=y,"r"==y&&(h[v]="R"))}for(var b=1,x=h[0];b<c-1;++b){var w=h[b];"+"==w&&"1"==x&&"1"==h[b+1]?h[b]="1":","!=w||x!=h[b+1]||"1"!=x&&"n"!=x||(h[b]=x),x=w}for(var _=0;_<c;++_){var k=h[_];if(","==k)h[_]="N";else if("%"==k){var C=void 0;for(C=_+1;C<c&&"%"==h[C];++C);for(var S=_&&"!"==h[_-1]||C<c&&"1"==h[C]?"1":"N",E=_;E<C;++E)h[E]=S;_=C-1}}for(var L=0,A=u;L<c;++L){var T=h[L];"L"==A&&"1"==T?h[L]="L":o.test(T)&&(A=T)}for(var M=0;M<c;++M)if(r.test(h[M])){var D=void 0;for(D=M+1;D<c&&r.test(h[D]);++D);for(var R="L"==(M?h[M-1]:u),B=R==("L"==(D<c?h[D]:u))?R?"L":"R":u,N=M;N<D;++N)h[N]=B;M=D-1}for(var P,I=[],O=0;O<c;)if(a.test(h[O])){var F=O;for(++O;O<c&&a.test(h[O]);++O);I.push(new l(0,F,O))}else{var j=O,z=I.length,H="rtl"==t?1:0;for(++O;O<c&&"L"!=h[O];++O);for(var W=j;W<O;)if(s.test(h[W])){j<W&&(I.splice(z,0,new l(1,j,W)),z+=H);var G=W;for(++W;W<O&&s.test(h[W]);++W);I.splice(z,0,new l(2,G,W)),z+=H,j=W}else++W;j<O&&I.splice(z,0,new l(1,j,O))}return"ltr"==t&&(1==I[0].level&&(P=e.match(/^\s+/))&&(I[0].from=P[0].length,I.unshift(new l(0,0,P[0].length))),1==Y(I).level&&(P=e.match(/\s+$/))&&(Y(I).to-=P[0].length,I.push(new l(0,c-P[0].length,c)))),"rtl"==t?I.reverse():I}}();function de(e,t){var n=e.order;return null==n&&(n=e.order=he(e.text,t)),n}var fe=[],pe=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]||fe).concat(n)}};function me(e,t){return e._handlers&&e._handlers[t]||fe}function ve(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=z(r,n);o>-1&&(i[t]=r.slice(0,o).concat(r.slice(o+1)))}}}function ge(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}}),ge(e,n||t.type,e,t),Ce(t)||t.codemirrorIgnore}function be(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==z(n,t[i])&&n.push(t[i])}function xe(e,t){return me(e,t).length>0}function we(e){e.prototype.on=function(e,t){pe(this,e,t)},e.prototype.off=function(e,t){ve(this,e,t)}}function _e(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ke(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ce(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Se(e){_e(e),ke(e)}function Ee(e){return e.target||e.srcElement}function Le(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 Ae,Te,Me=function(){if(a&&s<9)return!1;var e=T("div");return"draggable"in e||"dragDrop"in e}();function De(e){if(null==Ae){var t=T("span","");A(e,T("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ae=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=Ae?T("span",""):T("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Re(e){if(null!=Te)return Te;var t=A(e,document.createTextNode("AخA")),n=S(t,0,1).getBoundingClientRect(),i=S(t,1,2).getBoundingClientRect();return L(e),!(!n||n.left==n.right)&&(Te=i.right-n.right<3)}var Be,Ne=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/)},Pe=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(Be=T("div"))||(Be.setAttribute("oncopy","return;"),"function"==typeof Be.oncopy),Oe=null;function Fe(e){if(null!=Oe)return Oe;var t=A(e,T("span","x")),n=t.getBoundingClientRect(),i=S(t,0,1).getBoundingClientRect();return Oe=Math.abs(n.left-i.left)>1}var je={},ze={};function He(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),je[e]=t}function We(e,t){ze[e]=t}function Ge(e){if("string"==typeof e&&ze.hasOwnProperty(e))e=ze[e];else if(e&&"string"==typeof e.name&&ze.hasOwnProperty(e.name)){var t=ze[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 Ge("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ge("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ue(e,t){t=Ge(t);var n=je[t.name];if(!n)return Ue(e,"text/plain");var i=n(e,t);if(Ze.hasOwnProperty(t.name)){var r=Ze[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 Ze={};function Ve(e,t){O(t,Ze.hasOwnProperty(e)?Ze[e]:Ze[e]={})}function qe(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=z(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 ut(e,t){return at(e,t)<0?t:e}function ct(e,t){return at(e,t)<0?e:t}function ht(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function dt(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):ft(t,Je(e,t.line).text.length)}function ft(e,t){var n=e.ch;return null==n||n>t?ot(e.line,t):n<0?ot(e.line,0):e}function pt(e,t){for(var n=[],i=0;i<t.length;i++)n[i]=dt(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=F(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?F(this.string,this.lineStart,this.tabSize):0)},Xe.prototype.indentation=function(){return F(this.string,null,this.tabSize)-(this.lineStart?F(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},vt=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 gt(e,t,n,i){var r=[e.state.modeGen],o={};Et(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,u=0;n.state=!0,Et(e,t.text,s.mode,n,(function(e,t){for(var n=l;u<e;){var i=r[l];i>e&&r.splice(l,1,e,r[l+1],i),l+=2,u=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=bt(e,tt(t)),r=t.text.length>e.options.maxHighlightLength&&qe(e.doc.mode,i.state),o=gt(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 bt(e,t,n){var i=e.doc,r=e.display;if(!i.mode.startState)return new vt(i,!0,t);var o=Lt(e,t,n),a=o>i.first&&Je(i,o-1).stateAfter,s=a?vt.fromSaved(i,a,o):new vt(i,Ye(i.mode),o);return i.iter(o,t,(function(n){xt(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 xt(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();)_t(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 _t(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.")}vt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},vt.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}},vt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},vt.fromSaved=function(e,t,n){return t instanceof mt?new vt(e,qe(e.mode,t.state),n,t.lookAhead):new vt(e,qe(e.mode,t),n)},vt.prototype.save=function(e){var t=!1!==e?qe(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 Ct(e,t,n,i){var r,o,a=e.doc,s=a.mode,l=Je(a,(t=dt(a,t)).line),u=bt(e,t.line,n),c=new Xe(l.text,e.options.tabSize,u);for(i&&(o=[]);(i||c.pos<t.ch)&&!c.eol();)c.start=c.pos,r=_t(s,c,u.state),i&&o.push(new kt(c,r,qe(a.mode,u.state)));return i?o:new kt(c,r,u.state)}function St(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 Et(e,t,n,i,r,o,a){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,u=0,c=null,h=new Xe(t,e.options.tabSize,i),d=e.options.addModeClass&&[null];for(""==t&&St(wt(n,i.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(s=!1,a&&xt(e,t,i,h.pos),h.pos=t.length,l=null):l=St(_t(n,h,i.state,d),o),d){var f=d[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||c!=l){for(;u<h.start;)r(u=Math.min(h.start,u+5e3),c);c=l}h.start=h.pos}for(;u<h.pos;){var p=Math.min(h.pos,u+5e3);r(p,c),u=p}}function Lt(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),u=l.stateAfter;if(u&&(!n||s+(u instanceof mt?u.lookAhead:0)<=o.modeFrontier))return s;var c=F(l.text,null,e.options.tabSize);(null==r||i>c)&&(r=s-1,i=c)}return r}function At(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 Tt=!1,Mt=!1;function Dt(){Tt=!0}function Rt(){Mt=!0}function Bt(e,t,n){this.marker=e,this.from=t,this.to=n}function Nt(e,t){if(e)for(var n=0;n<e.length;++n){var i=e[n];if(i.marker==t)return i}}function Pt(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 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.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 Bt(a,o.from,s?null:o.to))}}return i}function Ft(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 Bt(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return i}function jt(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=Ot(n,r,a),l=Ft(i,o,a),u=1==t.text.length,c=Y(t.text).length+(u?r:0);if(s)for(var h=0;h<s.length;++h){var d=s[h];if(null==d.to){var f=Nt(l,d.marker);f?u&&(d.to=null==f.to?null:f.to+c):d.to=r}}if(l)for(var p=0;p<l.length;++p){var m=l[p];null!=m.to&&(m.to+=c),null==m.from?Nt(s,m.marker)||(m.from=c,u&&(s||(s=[])).push(m)):(m.from+=c,u&&(s||(s=[])).push(m))}s&&(s=zt(s)),l&&l!=s&&(l=zt(l));var v=[s];if(!u){var g,y=t.text.length-2;if(y>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(g||(g=[])).push(new Bt(s[b].marker,null,null));for(var x=0;x<y;++x)v.push(g);v.push(l)}return v}function zt(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 Ht(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!=z(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 u=r[l];if(!(at(u.to,s.from)<0||at(u.from,s.to)>0)){var c=[l,1],h=at(u.from,s.from),d=at(u.to,s.to);(h<0||!a.inclusiveLeft&&!h)&&c.push({from:u.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&c.push({from:s.to,to:u.to}),r.splice.apply(r,c),l+=c.length-3}}return r}function Wt(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Gt(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Ut(e){return e.inclusiveLeft?-1:0}function Zt(e){return e.inclusiveRight?1:0}function Vt(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)||Ut(e)-Ut(t);if(o)return-o;var a=at(i.to,r.to)||Zt(e)-Zt(t);return a||t.id-e.id}function qt(e,t){var n,i=Mt&&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||Vt(n,r.marker)<0)&&(n=r.marker);return n}function Kt(e){return qt(e,!0)}function Yt(e){return qt(e,!1)}function Xt(e,t){var n,i=Mt&&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||Vt(n,o.marker)<0)&&(n=o.marker)}return n}function Jt(e,t,n,i,r){var o=Je(e,t),a=Mt&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var u=l.marker.find(0),c=at(u.from,n)||Ut(l.marker)-Ut(r),h=at(u.to,i)||Zt(l.marker)-Zt(r);if(!(c>=0&&h<=0||c<=0&&h>=0)&&(c<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?at(u.to,n)>=0:at(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?at(u.from,i)<=0:at(u.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=Mt&&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,Nt(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 un=function(e,t,n){this.text=e,Gt(this,t),this.height=n?n(this):1};function cn(e,t,n,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Wt(e),Gt(e,n);var r=i?i(e):1;r!=e.height&&et(e,r)}function hn(e){e.parent=null,Wt(e)}un.prototype.lineNo=function(){return tt(this)},we(un);var dn={},fn={};function pn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?fn:dn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function mn(e,t){var n=M("span",null,null,l?"padding-right: .1px":null),i={pre:M("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=gn,Re(e.display.measure)&&(a=de(o,e.doc.direction))&&(i.addToken=bn(i.addToken,a)),i.map=[],wn(o,i,yt(e,o,t!=e.display.externalMeasured&&tt(o))),o.styleClasses&&(o.styleClasses.bgClass&&(i.bgClass=N(o.styleClasses.bgClass,i.bgClass||"")),o.styleClasses.textClass&&(i.textClass=N(o.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(De(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 ge(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=N(i.pre.className,i.textClass||"")),i}function vn(e){var t=T("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function gn(e,t,n,i,r,o,l){if(t){var u,c=e.splitSpaces?yn(t,e.trailingSpace):t,h=e.cm.state.specialChars,d=!1;if(h.test(t)){u=document.createDocumentFragment();for(var f=0;;){h.lastIndex=f;var p=h.exec(t),m=p?p.index-f:t.length-f;if(m){var v=document.createTextNode(c.slice(f,f+m));a&&s<9?u.appendChild(T("span",[v])):u.appendChild(v),e.map.push(e.pos,e.pos+m,v),e.col+=m,e.pos+=m}if(!p)break;f+=m+1;var g=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(g=u.appendChild(T("span",K(b),"cm-tab"))).setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?((g=u.appendChild(T("span","\r"==p[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((g=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),a&&s<9?u.appendChild(T("span",[g])):u.appendChild(g),e.col+=1);e.map.push(e.pos,e.pos+1,g),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),a&&s<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),n||i||r||d||o||l){var x=n||"";i&&(x+=i),r&&(x+=r);var w=T("span",[u],x,o);if(l)for(var _ in l)l.hasOwnProperty(_)&&"style"!=_&&"class"!=_&&w.setAttribute(_,l[_]);return e.content.appendChild(w)}e.content.appendChild(u)}}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 bn(e,t){return function(n,i,r,o,a,s,l){r=r?r+" cm-force-border":"cm-force-border";for(var u=n.pos,c=u+i.length;;){for(var h=void 0,d=0;d<t.length&&!((h=t[d]).to>u&&h.from<=u);d++);if(h.to>=c)return e(n,i,r,o,a,s,l);e(n,i.slice(0,h.to-u),r,o,null,s,l),o=null,i=i.slice(h.to-u),u=h.to}}}function xn(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,u,c,h,d,f=r.length,p=0,m=1,v="",g=0;;){if(g==p){l=u=c=s="",d=null,h=null,g=1/0;for(var y=[],b=void 0,x=0;x<i.length;++x){var w=i[x],_=w.marker;if("bookmark"==_.type&&w.from==p&&_.widgetNode)y.push(_);else if(w.from<=p&&(null==w.to||w.to>p||_.collapsed&&w.to==p&&w.from==p)){if(null!=w.to&&w.to!=p&&g>w.to&&(g=w.to,u=""),_.className&&(l+=" "+_.className),_.css&&(s=(s?s+";":"")+_.css),_.startStyle&&w.from==p&&(c+=" "+_.startStyle),_.endStyle&&w.to==g&&(b||(b=[])).push(_.endStyle,w.to),_.title&&((d||(d={})).title=_.title),_.attributes)for(var k in _.attributes)(d||(d={}))[k]=_.attributes[k];_.collapsed&&(!h||Vt(h.marker,_)<0)&&(h=w)}else w.from>p&&g>w.from&&(g=w.from)}if(b)for(var C=0;C<b.length;C+=2)b[C+1]==g&&(u+=" "+b[C]);if(!h||h.from==p)for(var S=0;S<y.length;++S)xn(t,0,y[S]);if(h&&(h.from||0)==p){if(xn(t,(null==h.to?f+1:h.to)-p,h.marker,null==h.from),null==h.to)return;h.to==p&&(h=!1)}}if(p>=f)break;for(var E=Math.min(f,g);;){if(v){var L=p+v.length;if(!h){var A=L>E?v.slice(0,E-p):v;t.addToken(t,A,a?a+l:l,c,p+A.length==g?u:"",s,d)}if(L>=E){v=v.slice(E-p),p=E;break}p=L,c=""}v=r.slice(o,o=n[m++]),a=pn(n[m++],t.cm.options)}}else for(var T=1;T<n.length;T+=2)t.addToken(t,r.slice(o,o=n[T]),pn(n[T+1],t.cm.options))}function _n(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 _n(e.doc,Je(e.doc,o),o);i=o+a.size,r.push(a)}return r}var Cn=null;function Sn(e){Cn?Cn.ops.push(e):e.ownsGroup=Cn={ops:[e],delayedCallbacks:[]}}function En(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 Ln(e,t){var n=e.ownsGroup;if(n)try{En(n)}finally{Cn=null,t(n)}}var An=null;function Tn(e,t){var n=me(e,t);if(n.length){var i,r=Array.prototype.slice.call(arguments,2);Cn?i=Cn.delayedCallbacks:An?i=An:(i=An=[],setTimeout(Mn,0));for(var o=function(e){i.push((function(){return n[e].apply(null,r)}))},a=0;a<n.length;++a)o(a)}}function Mn(){var e=An;An=null;for(var t=0;t<e.length;++t)e[t]()}function Dn(e,t,n,i){for(var r=0;r<t.changes.length;r++){var o=t.changes[r];"text"==o?Pn(e,t):"gutter"==o?On(e,t,n,i):"class"==o?In(e,t):"widget"==o&&Fn(e,t,i)}t.changes=null}function Rn(e){return e.node==e.text&&(e.node=T("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 Bn(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=Rn(t);t.background=i.insertBefore(T("div",null,n),i.firstChild),e.display.input.setUneditable(t.background)}}function Nn(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 Pn(e,t){var n=t.text.className,i=Nn(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){Bn(e,t),t.line.wrapClass?Rn(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 On(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=Rn(t);t.gutterBackground=T("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=Rn(t),s=t.gutter=T("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(T("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 u=e.display.gutterSpecs[l].className,c=o.hasOwnProperty(u)&&o[u];c&&s.appendChild(T("div",[c],"CodeMirror-gutter-elt","left: "+i.gutterLeft[u]+"px; width: "+i.gutterWidth[u]+"px"))}}}function Fn(e,t,n){t.alignable&&(t.alignable=null);for(var i=C("CodeMirror-linewidget"),r=t.node.firstChild,o=void 0;r;r=o)o=r.nextSibling,i.test(r.className)&&t.node.removeChild(r);zn(e,t,n)}function jn(e,t,n,i){var r=Nn(e,t);return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),In(e,t),On(e,t,n,i),zn(e,t,i),t.node}function zn(e,t,n){if(Hn(e,t.line,t,n,!0),t.rest)for(var i=0;i<t.rest.length;i++)Hn(e,t.rest[i],t,n,!1)}function Hn(e,t,n,i,r){if(t.widgets)for(var o=Rn(n),a=0,s=t.widgets;a<s.length;++a){var l=s[a],u=T("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),Wn(l,u,n,i),e.display.input.setUneditable(u),r&&l.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),Tn(l,"redraw")}}function Wn(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 Gn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!D(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;"),A(t.display.measure,T("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Un(e,t){for(var n=Ee(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 Zn(e){return e.lineSpace.offsetTop}function Vn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function qn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=A(e.measure,T("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 H-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],u=a[s+1];Math.abs(l.bottom-u.bottom)>2&&o.push((l.bottom+u.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 _n(e.doc,t,n);i.lineN=n;var r=i.built=mn(e,i);return i.text=r.pre,A(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&&(Dn(e,i,n,Di(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,u=0;u<e.length;u+=3)if(s=e[u],l=e[u+1],t<s?(r=0,o=1,a="left"):t<l?o=1+(r=t-s):(u==e.length-3||t==l&&e[u+3]>t)&&(r=(o=l-s)-1,t>=l&&(a="right")),null!=r){if(i=e[u+2],s==l&&n==(i.insertLeft?"left":"right")&&(a=n),"left"==n&&0==r)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)i=e[2+(u-=3)],a="left";if("right"==n&&r==l-s)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)i=e[(u+=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,u=o.start,c=o.end,h=o.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;u&&oe(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c<o.coverEnd&&oe(t.line.text.charAt(o.coverStart+c));)++c;if((r=a&&s<9&&0==u&&c==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():si(S(l,u,c).getClientRects(),i)).left||r.right||0==u)break;c=u,u-=1,h="right"}a&&s<11&&(r=ui(e.display.measure,r))}else{var f;u>0&&(h=i="right"),r=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==i?f.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!u&&(!r||!r.left&&!r.right)){var p=l.parentNode.getClientRects()[0];r=p?{left:p.left,right:p.left+Mi(e.display),top:p.top,bottom:p.bottom}:oi}for(var m=r.top-t.rect.top,v=r.bottom-t.rect.top,g=(m+v)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(g<y[b]);b++);var x=b?y[b-1]:0,w=y[b],_={left:("right"==h?r.right:r.left)-t.rect.left,right:("left"==h?r.left:r.right)-t.rect.left,top:x,bottom:w};return r.left||r.right||(_.bogus=!0),e.options.singleCursorHeightPerLine||(_.rtop=m,_.rbottom=v),_}function ui(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Fe(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 ci(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 hi(e){e.display.externalMeasure=null,L(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ci(e.display.view[t])}function di(e){hi(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function fi(){return c&&v?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function pi(){return c&&v?-(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+=Gn(e.widgets[n]));return t}function vi(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+=Zn(e.display):a-=e.display.viewOffset,"page"==i||"window"==i){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==i?0:pi());var l=s.left+("window"==i?0:fi());n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function gi(e,t,n){if("div"==n)return t;var i=t.left,r=t.top;if("page"==n)i-=fi(),r-=pi();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)),vi(e,i,ei(e,i,t.ch,r),n)}function bi(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,vi(e,i,s,n)}i=i||Je(e.doc,t.line),r||(r=ni(e,i));var s=de(i,e.doc.direction),l=t.ch,u=t.sticky;if(l>=i.text.length?(l=i.text.length,u="before"):l<=0&&(l=0,u="after"),!s)return a("before"==u?l-1:l,"before"==u);function c(e,t,n){return a(n?e-1:e,1==s[t].level!=n)}var h=ce(s,l,u),d=ue,f=c(l,h,"before"==u);return null!=d&&(f.other=c(l,d,"before"!=u)),f}function xi(e,t){var n=0;t=dt(e.doc,t),e.options.lineWrapping||(n=Mi(e.display)*t.ch);var i=Je(e.doc,t.line),r=an(i)+Zn(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 _i(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=Ei(e,a,r,t,n),l=Xt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var u=l.find(1);if(u.line==r)return u;a=Je(i,r=u.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 Ci(e,t,n,i){return n||(n=ni(e,t)),ki(e,t,n,vi(e,t,ii(e,n,i),"line").top)}function Si(e,t,n,i){return!(e.bottom<=n)&&(e.top>n||(i?e.left:e.right)>t)}function Ei(e,t,n,i,r){r-=an(t);var o=ni(e,t),a=mi(t),s=0,l=t.text.length,u=!0,c=de(t,e.doc.direction);if(c){var h=(e.options.lineWrapping?Ai:Li)(e,t,n,o,c,i,r);s=(u=1!=h.level)?h.from:h.to-1,l=u?h.to:h.from-1}var d,f,p=null,m=null,v=se((function(t){var n=ii(e,o,t);return n.top+=a,n.bottom+=a,!!Si(n,i,r,!1)&&(n.top<=r&&n.left<=i&&(p=t,m=n),!0)}),s,l),g=!1;if(m){var y=i-m.left<m.right-i,b=y==u;v=p+(b?0:1),f=b?"after":"before",d=y?m.left:m.right}else{u||v!=l&&v!=s||v++,f=0==v?"after":v==t.text.length?"before":ii(e,o,v-(u?1:0)).bottom+a<=r==u?"after":"before";var x=bi(e,ot(n,v,f),"line",t,o);d=x.left,g=r<x.top?-1:r>=x.bottom?1:0}return wi(n,v=ae(t.text,v,1),f,g,i-d)}function Li(e,t,n,i,r,o,a){var s=se((function(s){var l=r[s],u=1!=l.level;return Si(bi(e,ot(n,u?l.to:l.from,u?"before":"after"),"line",t,i),o,a,!0)}),0,r.length-1),l=r[s];if(s>0){var u=1!=l.level,c=bi(e,ot(n,u?l.from:l.to,u?"after":"before"),"line",t,i);Si(c,o,a,!0)&&c.top>a&&(l=r[s-1])}return l}function Ai(e,t,n,i,r,o,a){var s=ki(e,t,i,a),l=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,h=null,d=0;d<r.length;d++){var f=r[d];if(!(f.from>=u||f.to<=l)){var p=ii(e,i,1!=f.level?Math.min(u,f.to)-1:Math.max(l,f.from)).right,m=p<o?o-p+1e9:p-o;(!c||h>m)&&(c=f,h=m)}}return c||(c=r[r.length-1]),c.from<l&&(c={from:l,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}function Ti(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==ri){ri=T("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ri.appendChild(document.createTextNode("x")),ri.appendChild(T("br"));ri.appendChild(document.createTextNode("x"))}A(e.measure,ri);var n=ri.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),L(e.measure),n||1}function Mi(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=T("span","xxxxxxxxxx"),n=T("pre",[t],"CodeMirror-line-like");A(e.measure,n);var i=t.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function Di(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:Ri(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function Ri(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Bi(e){var t=Ti(e.display),n=e.options.lineWrapping,i=n&&Math.max(5,e.display.scroller.clientWidth/Mi(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 Ni(e){var t=e.doc,n=Bi(e);t.iter((function(e){var t=n(e);t!=e.height&&et(e,t)}))}function Pi(e,t,n,i){var r=e.display;if(!n&&"true"==Ee(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,u=_i(e,o,a);if(i&&u.xRel>0&&(l=Je(e.doc,u.line).text).length==u.ch){var c=F(l,l.length,e.options.tabSize)-l.length;u=ot(u.line,Math.max(0,Math.round((o-qn(e.display).left)/Mi(e.display))-c))}return u}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 Oi(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)Mt&&tn(e.doc,t)<r.viewTo&&ji(e);else if(n<=r.viewFrom)Mt&&nn(e.doc,n+i)>r.viewFrom?ji(e):(r.viewFrom+=i,r.viewTo+=i);else if(t<=r.viewFrom&&n>=r.viewTo)ji(e);else if(t<=r.viewFrom){var o=zi(e,n,n+i,1);o?(r.view=r.view.slice(o.index),r.viewFrom=o.lineN,r.viewTo+=i):ji(e)}else if(n>=r.viewTo){var a=zi(e,t,t,-1);a?(r.view=r.view.slice(0,a.index),r.viewTo=a.lineN):ji(e)}else{var s=zi(e,t,t,-1),l=zi(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):ji(e)}var u=r.externalMeasured;u&&(n<u.lineN?u.lineN+=i:t<u.lineN+u.size&&(r.externalMeasured=null))}function Fi(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==z(a,n)&&a.push(n)}}}function ji(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function zi(e,t,n,i){var r,o=Ii(e,t),a=e.display.view;if(!Mt||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 Hi(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 Wi(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 Gi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Ui(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)&&Zi(e,s.head,r),l||qi(e,s,o)}}return i}function Zi(e,t,n){var i=bi(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=n.appendChild(T("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(T("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 Vi(e,t){return e.top-t.top||e.left-t.left}function qi(e,t,n){var i=e.display,r=e.doc,o=document.createDocumentFragment(),a=qn(e.display),s=a.left,l=Math.max(i.sizerWidth,Yn(e)-i.sizer.offsetLeft)-a.right,u="ltr"==r.direction;function c(e,t,n,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),o.appendChild(T("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 h(t,n,i){var o,a,h=Je(r,t),d=h.text.length;function f(n,i){return yi(e,ot(t,n),"div",h,i)}function p(t,n,i){var r=Ci(e,h,null,t),o="ltr"==n==("after"==i)?"left":"right";return f("after"==i?r.begin:r.end-(/\s/.test(h.text.charAt(r.end-1))?2:1),o)[o]}var m=de(h,r.direction);return le(m,n||0,null==i?d:i,(function(e,t,r,h){var v="ltr"==r,g=f(e,v?"left":"right"),y=f(t-1,v?"right":"left"),b=null==n&&0==e,x=null==i&&t==d,w=0==h,_=!m||h==m.length-1;if(y.top-g.top<=3){var k=(u?x:b)&&_,C=(u?b:x)&&w?s:(v?g:y).left,S=k?l:(v?y:g).right;c(C,g.top,S-C,g.bottom)}else{var E,L,A,T;v?(E=u&&b&&w?s:g.left,L=u?l:p(e,r,"before"),A=u?s:p(t,r,"after"),T=u&&x&&_?l:y.right):(E=u?p(e,r,"before"):s,L=!u&&b&&w?l:g.right,A=!u&&x&&_?s:y.left,T=u?p(t,r,"after"):l),c(E,g.top,L-E,g.bottom),g.bottom<y.top&&c(s,g.bottom,null,y.top),c(A,y.top,T-A,y.bottom)}(!o||Vi(g,o)<0)&&(o=g),Vi(y,o)<0&&(o=y),(!a||Vi(g,a)<0)&&(a=g),Vi(y,a)<0&&(a=y)})),{start:o,end:a}}var d=t.from(),f=t.to();if(d.line==f.line)h(d.line,d.ch,f.ch);else{var p=Je(r,d.line),m=Je(r,f.line),v=Qt(p)==Qt(m),g=h(d.line,d.ch,v?p.text.length+1:null).end,y=h(f.line,v?0:null,f.ch).start;v&&(g.top<y.top-2?(c(g.right,g.top,null,g.bottom),c(s,y.top,y.left,y.bottom)):c(g.right,g.top,y.left-g.right,g.bottom)),g.bottom<y.top&&c(s,g.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||(ge(e,"focus",e,t),e.state.focused=!0,B(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&&(ge(e,"blur",e,t),e.state.focused=!1,E(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,u=0;if(!r.hidden){if(a&&s<8){var c=r.node.offsetTop+r.node.offsetHeight;l=c-n,n=c}else{var h=r.node.getBoundingClientRect();l=h.bottom-h.top,!o&&r.text.firstChild&&(u=r.text.firstChild.getBoundingClientRect().right-h.left-1)}var d=r.line.height-l;if((d>.005||d<-.005)&&(et(r.line,l),er(r.line),r.rest))for(var f=0;f<r.rest.length;f++)er(r.rest[f]);if(u>e.display.sizerWidth){var p=Math.ceil(u/Mi(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,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-Zn(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&&!p){var o=T("div","",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Zn(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=bi(e,t),l=n&&n!=t?bi(e,n):s,u=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}),c=e.doc.scrollTop,h=e.doc.scrollLeft;if(null!=u.scrollTop&&(dr(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(pr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(a=!0)),!a)break}return r}function rr(e,t){var n=or(e,t);null!=n.scrollTop&&dr(e,n.scrollTop),null!=n.scrollLeft&&pr(e,n.scrollLeft)}function or(e,t){var n=e.display,i=Ti(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+Vn(n),l=t.top<i,u=t.bottom>s-i;if(t.top<r)a.scrollTop=l?0:t.top;else if(t.bottom>r+o){var c=Math.min(t.top,(u?s:t.bottom)-o);c!=r&&(a.scrollTop=c)}var h=e.options.fixedGutter?0:n.gutters.offsetWidth,d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-h,f=Yn(e)-n.gutters.offsetWidth,p=t.right-t.left>f;return p&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.left<d?a.scrollLeft=Math.max(0,t.left+h-(p?0:10)):t.right>f+d-3&&(a.scrollLeft=t.right+(p?0:10)-f),a}function ar(e,t){null!=t&&(cr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function sr(e){cr(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||cr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function ur(e,t){cr(e),e.curOp.scrollToPos=t}function cr(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,hr(e,xi(e,t.from),xi(e,t.to),t.margin))}function hr(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 dr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Gr(e,{top:t}),fr(e,t,!0),n&&Gr(e),Pr(e,100))}function fr(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 pr(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,qr(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+Vn(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 vr=function(e,t,n){this.cm=n;var i=this.vert=T("div",[T("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=T("div",[T("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=r.tabIndex=-1,e(i),e(r),pe(i,"scroll",(function(){i.clientHeight&&t(i.scrollTop,"vertical")})),pe(r,"scroll",(function(){r.clientWidth&&t(r.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};vr.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}},vr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},vr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},vr.prototype.zeroWidthHack=function(){var e=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new j,this.disableVert=new j},vr.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)},vr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var gr=function(){};function yr(e,t){t||(t=mr(e));var n=e.display.barWidth,i=e.display.barHeight;br(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),br(e,mr(e)),n=e.display.barWidth,i=e.display.barHeight}function br(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=""}gr.prototype.update=function(){return{bottom:0,right:0}},gr.prototype.setScrollLeft=function(){},gr.prototype.setScrollTop=function(){},gr.prototype.clear=function(){};var xr={native:vr,null:gr};function wr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new xr[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),pe(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?pr(e,t):dr(e,t)}),e),e.display.scrollbars.addClass&&B(e.display.wrapper,e.display.scrollbars.addClass)}var _r=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:++_r},Sn(e.curOp)}function Cr(e){var t=e.curOp;t&&Ln(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;Sr(e)}))}function Sr(e){for(var t=e.ops,n=0;n<t.length;n++)Er(t[n]);for(var i=0;i<t.length;i++)Lr(t[i]);for(var r=0;r<t.length;r++)Ar(t[r]);for(var o=0;o<t.length;o++)Tr(t[o]);for(var a=0;a<t.length;a++)Mr(t[a])}function Er(e){var t=e.cm,n=t.display;Fr(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 Or(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Lr(e){e.updatedDisplay=e.mustUpdate&&Hr(e.cm,e.update)}function Ar(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 Tr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&pr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==R();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&yr(t,e.barMeasure),e.updatedDisplay&&Vr(t,e.barMeasure),e.selectionChanged&&Ki(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Yi(e.cm)}function Mr(e){var t=e.cm,n=t.display,i=t.doc;e.updatedDisplay&&Wr(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&fr(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&pr(t,e.scrollLeft,!0,!0),e.scrollToPos&&nr(t,ir(t,dt(i,e.scrollToPos.from),dt(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||ge(r[a],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&ge(o[s],"unhide");n.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ge(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Dr(e,t){if(e.curOp)return t();kr(e);try{return t()}finally{Cr(e)}}function Rr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);kr(e);try{return t.apply(e,arguments)}finally{Cr(e)}}}function Br(e){return function(){if(this.curOp)return e.apply(this,arguments);kr(this);try{return e.apply(this,arguments)}finally{Cr(this)}}}function Nr(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{Cr(t)}}}function Pr(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=bt(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?qe(t.mode,i.state):null,l=gt(e,o,i,!0);s&&(i.state=s),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var h=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),d=0;!h&&d<a.length;++d)h=a[d]!=o.styles[d];h&&r.push(i.line),o.stateAfter=i.save(),i.nextLine()}else o.text.length<=e.options.maxHighlightLength&&xt(e,o.text,i),o.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>n)return Pr(e,e.options.workDelay),!0})),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),r.length&&Dr(e,(function(){for(var t=0;t<r.length;t++)Fi(e,r[t],"text")}))}}var Or=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=Di(e),this.events=[]};function Fr(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 jr(e){if(e.hasFocus())return null;var t=R();if(!t||!D(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&D(e.display.lineDiv,i.anchorNode)&&(n.anchorNode=i.anchorNode,n.anchorOffset=i.anchorOffset,n.focusNode=i.focusNode,n.focusOffset=i.focusOffset)}return n}function zr(e){if(e&&e.activeElt&&e.activeElt!=R()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&D(document.body,e.anchorNode)&&D(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 Hr(e,t){var n=e.display,i=e.doc;if(t.editorIsHidden)return ji(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==Wi(e))return!1;Kr(e)&&(ji(e),t.dims=Di(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)),Mt&&(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;Hi(e,o,a),n.viewOffset=an(Je(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=Wi(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=jr(e);return l>4&&(n.lineDiv.style.display="none"),Ur(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,zr(u),L(n.cursorDiv),L(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Pr(e,400)),n.updateLineNumbers=null,!0}function Wr(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+Vn(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(!Hr(e,t))break;$i(e);var r=mr(e);Gi(e),yr(e,r),Vr(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 Gr(e,t){var n=new Or(e,t);if(Hr(e,n)){$i(e),Wr(e,n);var i=mr(e);Gi(e),yr(e,i),Vr(e,i),n.finish()}}function Ur(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 u=i.view,c=i.viewFrom,h=0;h<u.length;h++){var d=u[h];if(d.hidden);else if(d.node&&d.node.parentNode==o){for(;a!=d.node;)a=s(a);var f=r&&null!=t&&t<=c&&d.lineNumber;d.changes&&(z(d.changes,"gutter")>-1&&(f=!1),Dn(e,d,c,n)),f&&(L(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(rt(e.options,c)))),a=d.node.nextSibling}else{var p=jn(e,d,c,n);o.insertBefore(p,a)}c+=d.size}for(;a;)a=s(a)}function Zr(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Vr(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 qr(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var i=Ri(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(T("div",[T("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",Zr(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;L(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(T("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",Zr(e)}function Jr(e){Xr(e.display),Oi(e),qr(e)}function Qr(e,t,i,r){var o=this;this.input=i,o.scrollbarFiller=T("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=T("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=M("div",null,"CodeMirror-code"),o.selectionDiv=T("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=T("div",null,"CodeMirror-cursors"),o.measure=T("div",null,"CodeMirror-measure"),o.lineMeasure=T("div",null,"CodeMirror-measure"),o.lineSpace=M("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var u=M("div",[o.lineSpace],"CodeMirror-lines");o.mover=T("div",[u],null,"position: relative"),o.sizer=T("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=T("div",null,null,"position: absolute; height: "+H+"px; width: 1px;"),o.gutters=T("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=T("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=T("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),a&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||n&&g||(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)}Or.prototype.signal=function(e,t){xe(e,t)&&this.events.push(arguments)},Or.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ge.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,u=s.scrollWidth>s.clientWidth,c=s.scrollHeight>s.clientHeight;if(r&&u||o&&c){if(o&&y&&l)e:for(var d=t.target,f=a.view;d!=s;d=d.parentNode)for(var p=0;p<f.length;p++)if(f[p].node==d){e.display.currentWheelTarget=d;break e}if(r&&!n&&!h&&null!=eo)return o&&c&&dr(e,Math.max(0,s.scrollTop+o*eo)),pr(e,Math.max(0,s.scrollLeft+r*eo)),(!o||o&&c)&&_e(t),void(a.wheelStartX=null);if(o&&null!=eo){var m=o*eo,v=e.doc.scrollTop,g=v+a.wrapper.clientHeight;m<0?v=Math.max(0,v+m-50):g=Math.min(e.doc.height,g+m+50),Gr(e,{top:v,bottom:g})}$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:c?eo=-.7:d&&(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=z(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 u=ct(s.from(),a.from()),c=ut(s.to(),a.to()),h=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new oo(h?c:u,h?u:c))}}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 uo(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 co(e,t){for(var n=[],i=0;i<e.sel.ranges.length;i++){var r=e.sel.ranges[i];n.push(new oo(uo(r.anchor,t),uo(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 fo(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),u=ho(lo(s),r,o);if(r=s.to,o=u,"around"==n){var c=e.sel.ranges[a],h=at(c.head,c.anchor)<0;i[a]=new oo(h?u:l,h?l:u)}else i[a]=new oo(l,l)}return new ro(i,e.sel.primIndex)}function po(e){e.doc.mode=Ue(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,Pr(e,100),e.state.modeGen++,e.curOp&&Oi(e)}function vo(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Y(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function go(e,t,n,i){function r(e){return n?n[e]:null}function o(e,n,r){cn(e,n,r,i),Tn(e,"change",e,t)}function a(e,t){for(var n=[],o=e;o<t;++o)n.push(new un(u[o],r(o),i));return n}var s=t.from,l=t.to,u=t.text,c=Je(e,s.line),h=Je(e,l.line),d=Y(u),f=r(u.length-1),p=l.line-s.line;if(t.full)e.insert(0,a(0,u.length)),e.remove(u.length,e.size-u.length);else if(vo(e,t)){var m=a(0,u.length-1);o(h,h.text,f),p&&e.remove(s.line,p),m.length&&e.insert(s.line,m)}else if(c==h)if(1==u.length)o(c,c.text.slice(0,s.ch)+d+c.text.slice(l.ch),f);else{var v=a(1,u.length-1);v.push(new un(d+c.text.slice(l.ch),f,i)),o(c,c.text.slice(0,s.ch)+u[0],r(0)),e.insert(s.line+1,v)}else if(1==u.length)o(c,c.text.slice(0,s.ch)+u[0]+h.text.slice(l.ch),r(0)),e.remove(s.line+1,p);else{o(c,c.text.slice(0,s.ch)+u[0],r(0)),o(h,d+h.text.slice(l.ch),f);var g=a(1,u.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,g)}Tn(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 bo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ni(e),po(e),xo(e),e.options.lineWrapping||ln(e),e.options.mode=t.modeOption,Oi(e)}function xo(e){("rtl"==e.doc.direction?B:E)(e.display.lineDiv,"CodeMirror-rtl")}function wo(e){Dr(e,(function(){xo(e),Oi(e)}))}function _o(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 Mo(e,n,t.from.line,t.to.line+1),yo(e,(function(e){return Mo(e,n,t.from.line,t.to.line+1)}),!0),n}function Co(e){for(;e.length&&Y(e).ranges;)e.pop()}function So(e,t){return t?(Co(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 Eo(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=So(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||To(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||ge(e,"historyAdded")}function Lo(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 Ao(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||Lo(e,o,Y(r.done),t))?r.done[r.done.length-1]=t:To(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=o,r.lastSelOp=n,i&&!1!==i.clearRedo&&Co(r.undone)}function To(e,t){var n=Y(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Mo(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 Do(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 Ro(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var i=[],r=0;r<t.text.length;++r)i.push(Do(n[r]));return i}function Bo(e,t){var n=Ro(e,t),i=jt(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],u=0;u<o.length;++u)if(o[u].marker==l.marker)continue e;o.push(l)}else a&&(n[r]=a)}return n}function No(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 u=a[l],c=void 0;if(s.push({from:u.from,to:u.to,text:u.text}),t)for(var h in u)(c=h.match(/^spans_(\d+)$/))&&z(t,Number(c[1]))>-1&&(Y(s)[h]=u[h],delete u[h])}}}return i}function Po(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)),Wo(e,new ro([Po(e.sel.primary(),t,n,r)],0),i)}function Oo(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]=Po(e.sel.ranges[o],t[o],null,r);Wo(e,ao(e.cm,i,e.sel.primIndex),n)}function Fo(e,t,n,i){var r=e.sel.ranges.slice(0);r[t]=n,Wo(e,ao(e.cm,r,e.sel.primIndex),i)}function jo(e,t,n,i){Wo(e,so(t,n),i)}function zo(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(dt(e,t[n].anchor),dt(e,t[n].head))},origin:n&&n.origin};return ge(e,"beforeSelectionChange",e,i),e.cm&&ge(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?ao(e.cm,i.ranges,i.ranges.length-1):t}function Ho(e,t,n){var i=e.history.done,r=Y(i);r&&r.ranges?(i[i.length-1]=t,Go(e,t,n)):Wo(e,t,n)}function Wo(e,t,n){Go(e,t,n),Ao(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Go(e,t,n){(xe(e,"beforeSelectionChange")||e.cm&&xe(e.cm,"beforeSelectionChange"))&&(t=zo(e,t,n));var i=n&&n.bias||(at(t.primary().head,e.sel.primary().head)<0?-1:1);Uo(e,Vo(e,t,i,!0)),n&&!1===n.scroll||!e.cm||sr(e.cm)}function Uo(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,be(e.cm)),Tn(e,"cursorActivity",e))}function Zo(e){Uo(e,Vo(e,e.sel,null,!1))}function Vo(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),u=Ko(e,a.head,s&&s.head,n,i);(r||l!=a.anchor||u!=a.head)&&(r||(r=t.ranges.slice(0,o)),r[o]=new oo(l,u))}return r?ao(e.cm,r,t.primIndex):t}function qo(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,u="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,c="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(u?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(c?s.to>=t.ch:s.to>t.ch))){if(r&&(ge(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var h=l.find(i<0?1:-1),d=void 0;if((i<0?c:u)&&(h=Yo(e,h,-i,h&&h.line==t.line?o:null)),h&&h.line==t.line&&(d=at(h,n))&&(i<0?d<0:d>0))return qo(e,h,t,i,r)}var f=l.find(i<0?-1:1);return(i<0?u:c)&&(f=Yo(e,f,i,f.line==t.line?o:null)),f?qo(e,f,t,i,r):null}}return t}function Ko(e,t,n,i,r){var o=i||1,a=qo(e,t,n,o,r)||!r&&qo(e,t,n,o,!0)||qo(e,t,n,-o,r)||!r&&qo(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?dt(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()),G)}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=dt(e,t)),n&&(i.to=dt(e,n)),r&&(i.text=r),void 0!==o&&(i.origin=o)}),ge(e,"beforeChange",e,i),e.cm&&ge(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 Rr(e.cm,Qo)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(xe(e,"beforeChange")||e.cm&&xe(e.cm,"beforeChange"))||(t=Jo(e,t,!0))){var i=Tt&&!n&&Ht(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=co(e,t);Eo(e,t,n,e.cm?e.cm.curOp.id:NaN),na(e,t,n,jt(e,t));var i=[];yo(e,(function(e,n){n||-1!=z(i,e.history)||(sa(e.history,t),i.push(e.history)),na(e,t,null,jt(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,u=0;u<s.length&&(r=s[u],n?!r.ranges||r.equals(e.sel):r.ranges);u++);if(u!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(r=s.pop()).ranges){if(i)return void s.push(r);break}if(To(r,l),n&&!r.equals(e.sel))return void Wo(e,r,{clearRedo:!1});a=r}var c=[];To(a,l),l.push({changes:c,generation:o.generation}),o.generation=r.generation||++o.maxGeneration;for(var h=xe(e,"beforeChange")||e.cm&&xe(e.cm,"beforeChange"),d=function(n){var i=r.changes[n];if(i.origin=t,h&&!Jo(e,i,!1))return s.length=0,{};c.push(ko(e,i));var o=n?co(e,i):Y(s);na(e,i,o,Bo(e,i)),!n&&e.cm&&e.cm.scrollIntoView({from:i.from,to:lo(i)});var a=[];yo(e,(function(e,t){t||-1!=z(a,e.history)||(sa(e.history,i),a.push(e.history)),na(e,i,null,Bo(e,i))}))},f=r.changes.length-1;f>=0;--f){var p=d(f);if(p)return p.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)){Oi(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,i=n.viewFrom;i<n.viewTo;i++)Fi(e.cm,i,"gutter")}}function na(e,t,n,i){if(e.cm&&!e.cm.curOp)return Rr(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=co(e,t)),e.cm?ia(e.cm,t,i):go(e,t,i),Go(e,n,G),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&&be(e),go(i,t,n,Bi(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)),At(i,o.line),Pr(e,400);var u=t.text.length-(a.line-o.line)-1;t.full?Oi(e):o.line!=a.line||1!=t.text.length||vo(e.doc,t)?Oi(e,o.line,a.line+1,u):Fi(e,o.line,"text");var c=xe(e,"changes"),h=xe(e,"change");if(h||c){var d={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};h&&Tn(e,"change",e,d),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}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 u=o.changes[l];if(n<u.from.line)u.from=ot(u.from.line+i,u.from.ch),u.to=ot(u.to.line+i,u.to.ch);else if(t<=u.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,ht(e,t)):r=tt(t),null==r?null:(i(o,r)&&e.cm&&Fi(e.cm,r,n),o)}function ua(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 ca(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 ct(this.anchor,this.head)},oo.prototype.to=function(){return ut(this.anchor,this.head)},oo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},ua.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,hn(r),Tn(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}},ca.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 ua))){var s=[];this.collapse(s),this.children=[new ua(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 ua(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 ca(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=z(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var i=new ca(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 ha=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 da(e,t,n){an(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&ar(e,n)}function fa(e,t,n,i){var r=new ha(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+Gn(r)),i&&ar(o,r.height),o.curOp.forceUpdate=!0}return!0})),o&&Tn(o,"lineWidgetAdded",o,r,"number"==typeof t?t:tt(t)),r}ha.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=Gn(this);et(n,Math.max(0,n.height-o)),e&&(Dr(e,(function(){da(e,n,-o),Fi(e,i,"widget")})),Tn(e,"lineWidgetCleared",e,this,i))}},ha.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,i=this.line;this.height=null;var r=Gn(this)-t;r&&(rn(this.doc,i)||et(i,i.height+r),n&&Dr(n,(function(){n.curOp.forceUpdate=!0,da(n,i,r),Tn(n,"lineWidgetChanged",n,e,tt(i))})))},we(ha);var pa=0,ma=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++pa};function va(e,t,n,i,r){if(i&&i.shared)return ya(e,t,n,i,r);if(e.cm&&!e.cm.curOp)return Rr(e.cm,va)(e,t,n,i,r);var o=new ma(e,r),a=at(t,n);if(i&&O(i,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=M("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");Rt()}o.addToHistory&&Eo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,u=e.cm;if(e.iter(l,n.line+1,(function(e){u&&o.collapsed&&!u.options.lineWrapping&&Qt(e)==u.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&et(e,0),It(e,new Bt(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&&pe(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Dt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++pa,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)Oi(u,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=n.line;c++)Fi(u,c,"text");o.atomic&&Zo(u.doc),Tn(u,"markerAdded",u,o)}return o}ma.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&kr(e),xe(this,"clear")){var n=this.find();n&&Tn(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=Nt(a.markedSpans,this);e&&!this.collapsed?Fi(e,tt(a),"text"):e&&(null!=s.to&&(r=tt(a)),null!=s.from&&(i=tt(a))),a.markedSpans=Pt(a.markedSpans,s),null==s.from&&this.collapsed&&!rn(this.doc,a)&&e&&et(a,Ti(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var u=Qt(this.lines[l]),c=sn(u);c>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=i&&e&&this.collapsed&&Oi(e,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Zo(e.doc)),e&&Tn(e,"markerCleared",e,this,i,r),t&&Cr(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=Nt(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&&Dr(i,(function(){var r=t.line,o=tt(t.line),a=ti(i,o);if(a&&(ci(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=Gn(n)-s;l&&et(r,r.height+l)}Tn(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!=z(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ma.prototype.detachLine=function(e){if(this.lines.splice(z(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 ga=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=O(i)).shared=!1;var o=[va(e,t,n,i,r)],a=o[0],s=i.widgetNode;return yo(e,(function(e){s&&(i.widgetNode=s.cloneNode(!0)),o.push(va(e,dt(e,t),dt(e,n),i,r));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;a=Y(o)})),new ga(o,a)}function ba(e){return e.findMarks(ot(e.first,0),e.clipPos(ot(e.lastLine())),(function(e){return e.parent}))}function xa(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=va(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==z(i,o.doc)&&(o.parent=null,n.markers.splice(r--,1))}},n=0;n<e.length;n++)t(n)}ga.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Tn(this,"clear")}},ga.prototype.find=function(e,t){return this.primary.find(e,t)},we(ga);var _a=0,ka=function(e,t,n,i,r){if(!(this instanceof ka))return new ka(e,t,n,i,r);null==n&&(n=0),ca.call(this,[new ua([new un("",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 _o(null),this.id=++_a,this.modeOption=t,this.lineSep=i,this.direction="rtl"==r?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),go(this,{from:o,to:o,text:e}),Wo(this,so(o),G)};ka.prototype=$(ca.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:Nr((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),Wo(this,so(t),G)})),replaceRange:function(e,t,n,i){ra(this,e,t=dt(this,t),n=n?dt(this,n):t,i)},getRange:function(e,t,n){var i=Qe(this,dt(this,e),dt(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 dt(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:Nr((function(e,t,n){jo(this,dt(this,"number"==typeof e?ot(e,t||0):e),null,n)})),setSelection:Nr((function(e,t,n){jo(this,dt(this,e),dt(this,t||e),n)})),extendSelection:Nr((function(e,t,n){Io(this,dt(this,e),t&&dt(this,t),n)})),extendSelections:Nr((function(e,t){Oo(this,pt(this,e),t)})),extendSelectionsBy:Nr((function(e,t){Oo(this,pt(this,X(this.sel.ranges,e)),t)})),setSelections:Nr((function(e,t,n){if(e.length){for(var i=[],r=0;r<e.length;r++)i[r]=new oo(dt(this,e[r].anchor),dt(this,e[r].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Wo(this,ao(this.cm,i,t),n)}})),addSelection:Nr((function(e,t,n){var i=this.sel.ranges.slice(0);i.push(new oo(dt(this,e),dt(this,t||e))),Wo(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:Nr((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&&fo(this,i,t),l=i.length-1;l>=0;l--)Qo(this,i[l]);s?Ho(this,s):this.cm&&sr(this.cm)})),undo:Nr((function(){ea(this,"undo")})),redo:Nr((function(){ea(this,"redo")})),undoSelection:Nr((function(){ea(this,"undo",!0)})),redoSelection:Nr((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 _o(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:No(this.history.done),undone:No(this.history.undone)}},setHistory:function(e){var t=this.history=new _o(this.history.maxGeneration);t.done=No(e.done.slice(0),null,!0),t.undone=No(e.undone.slice(0),null,!0)},setGutterMarker:Nr((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:Nr((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:Nr((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(C(n).test(e[i]))return!1;e[i]+=" "+n}else e[i]=n;return!0}))})),removeLineClass:Nr((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(C(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:Nr((function(e,t,n){return fa(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return va(this,dt(this,e),dt(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 va(this,e=dt(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=Je(this,(e=dt(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=dt(this,e),t=dt(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})),dt(this,ot(n,t))},indexFromPos:function(e){var t=(e=dt(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}],xa(i,ba(this)),i},unlinkDoc:function(e){if(e instanceof Os&&(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(ba(this));break}if(e.history==this.history){var n=[e.id];yo(e,(function(e){return n.push(e.id)}),!0),e.history=new _o(null),e.history.done=No(this.history.done,n),e.history.undone=No(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):Ne(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Nr((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 Ca=0;function Sa(e){var t=this;if(Aa(t),!ye(t,e)&&!Un(t.display,e)){_e(e),a&&(Ca=+new Date);var n=Pi(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&&Rr(t,(function(){var e={from:n=dt(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),Ho(t.doc,so(dt(t.doc,n),dt(t.doc,lo(e))))}))()},u=function(e,n){if(t.options.allowDropFileTypes&&-1==z(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)}},c=0;c<i.length;c++)u(i[c],c);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 h=e.dataTransfer.getData("Text");if(h){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),Go(t.doc,so(n,n)),d)for(var f=0;f<d.length;++f)ra(t.doc,"",d[f].anchor,d[f].head,"drag");t.replaceSelection(h,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Ea(e,t){if(a&&(!e.state.draggingText||+new Date-Ca<100))Se(t);else if(!ye(e,t)&&!Un(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var n=T("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),h&&n.parentNode.removeChild(n)}}function La(e,t){var n=Pi(e,t);if(n){var i=document.createDocumentFragment();Zi(e,n,i),e.display.dragCursor||(e.display.dragCursor=T("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),A(e.display.dragCursor,i)}}function Aa(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ta(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 Ma=!1;function Da(){Ma||(Ra(),Ma=!0)}function Ra(){var e;pe(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Ta(Ba)}),100))})),pe(window,"blur",(function(){return Ta(Qi)}))}function Ba(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Na={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"},Pa=0;Pa<10;Pa++)Na[Pa+48]=Na[Pa+96]=String(Pa);for(var Ia=65;Ia<=90;Ia++)Na[Ia]=String.fromCharCode(Ia);for(var Oa=1;Oa<=12;Oa++)Na[Oa+111]=Na[Oa+63235]="F"+Oa;var Fa={};function ja(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 za(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(" "),ja),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 u in t)e[u]=t[u];return e}function Ha(e,t,n,i){var r=(t=Za(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 Ha(e,t.fallthrough,n,i);for(var o=0;o<t.fallthrough.length;o++){var a=Ha(e,t.fallthrough[o],n,i);if(a)return a}}}function Wa(e){var t="string"==typeof e?e:Na[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Ga(e,t,n){var i=e;return t.altKey&&"Alt"!=i&&(e="Alt-"+e),(_?t.metaKey:t.ctrlKey)&&"Ctrl"!=i&&(e="Ctrl-"+e),(_?t.ctrlKey:t.metaKey)&&"Mod"!=i&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=i&&(e="Shift-"+e),e}function Ua(e,t){if(h&&34==e.keyCode&&e.char)return!1;var n=Na[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Ga(n,e,t))}function Za(e){return"string"==typeof e?Fa[e]:e}function Va(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)}Dr(e,(function(){for(var t=i.length-1;t>=0;t--)ra(e.doc,"",i[t].from,i[t].to,"+delete");sr(e)}))}function qa(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=qa(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=de(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 u=ni(t,n);a=r<0?n.text.length-1:0;var c=ii(t,u,a).top;a=se((function(e){return ii(t,u,e).top==c}),r<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=qa(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=de(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=ce(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 qa(t,e instanceof ot?e.ch:e,n)},u=function(n){return e.options.lineWrapping?(s=s||ni(e,t),Ci(e,t,s,n)):{begin:0,end:t.text.length}},c=u("before"==n.sticky?l(n,-1):n.ch);if("rtl"==e.doc.direction||1==a.level){var h=1==a.level==i<0,d=l(n,h?1:-1);if(null!=d&&(h?d<=a.to&&d<=c.end:d>=a.from&&d>=c.begin)){var f=h?"before":"after";return new ot(n.line,d,f)}}var p=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),u=s?i.begin:l(i.end,-1);if(a.from<=u&&u<a.to)return o(u,s);if(u=s?a.from:l(a.to,-1),i.begin<=u&&u<i.end)return o(u,s)}},m=p(o+i,i,c);if(m)return m;var v=i>0?c.end:l(c.begin,-1);return null==v||i>0&&v==t.text.length||!(m=p(i>0?0:r.length-1,i,u(v)))?null:m}Fa.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"},Fa.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"},Fa.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"},Fa.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"]},Fa.default=y?Fa.macDefault:Fa.pcDefault;var Ja={selectAll:Xo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),G)},killLine:function(e){return Va(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 Va(e,(function(t){return{from:ot(t.from().line,0),to:dt(e.doc,ot(t.to().line+1,0))}}))},delLineLeft:function(e){return Va(e,(function(e){return{from:ot(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Va(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 Va(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")}),Z)},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")}),Z)},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}),Z)},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=F(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 Dr(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 Dr(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=de(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)!=W}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=Ha(t,e.state.keyMaps[i],n,e);if(r)return r}return e.options.extraKeys&&Ha(t,e.options.extraKeys,n,e)||Ha(t,e.options.keyMap,n,e)}var is=new j;function rs(e,t,n,i){var r=e.state.keySeq;if(r){if(Wa(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&&Tn(e,"keyHandled",e,t,n),"handled"!=r&&"multi"!=r||(_e(n),Ki(e)),!!r}function as(e,t){var n=Ua(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 us(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=R(),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);h&&(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)||cs(t)}}function cs(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(E(t,"CodeMirror-crosshair"),ve(document,"keyup",n),ve(document,"mouseover",n))}B(t,"CodeMirror-crosshair"),pe(document,"keyup",n),pe(document,"mouseover",n)}function hs(e){16==e.keyCode&&(this.doc.sel.shift=!1),ye(this,e)}function ds(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||Un(t.display,e)||ye(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,i=e.charCode;if(h&&n==ls)return ls=null,void _e(e);if(!h||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 fs,ps,ms=400,vs=function(e,t,n){this.time=e,this.pos=t,this.button=n};function gs(e,t){var n=+new Date;return ps&&ps.compare(n,e,t)?(fs=ps=null,"triple"):fs&&fs.compare(n,e,t)?(ps=new vs(n,e,t),fs=null,"double"):(fs=new vs(n,e,t),ps=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,Un(n,e))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!Ls(t,e)){var i=Pi(t,e),r=Le(e),o=i?gs(i,r):"single";window.focus(),1==r&&t.state.selectingText&&t.state.selectingText(e),i&&bs(t,r,i,o,e)||(1==r?i?ws(t,i,o,e):Ee(e)==n.scroller&&_e(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 bs(e,t,n,i,r){var o="Click";return"double"==i?o="Double"+o:"triple"==i&&(o="Triple"+o),rs(e,Ga(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)!=W}finally{e.state.suppressEdits=!1}return i}))}function xs(e,t,n){var i=e.getOption("configureMouse"),r=i?i(e,t,n):{};if(null==r.unit){var o=b?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=R();var r,o=xs(e,n,i),s=e.doc.sel;e.options.dragDrop&&Me&&!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)?_s(e,i,t,o):Cs(e,i,t,o)}function _s(e,t,n,i){var r=e.display,o=!1,u=Rr(e,(function(t){l&&(r.scroller.draggable=!1),e.state.draggingText=!1,ve(r.wrapper.ownerDocument,"mouseup",u),ve(r.wrapper.ownerDocument,"mousemove",c),ve(r.scroller,"dragstart",h),ve(r.scroller,"drop",u),o||(_e(t),i.addNew||Io(e.doc,n,null,null,i.extend),l&&!d||a&&9==s?setTimeout((function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()}),20):r.input.focus())})),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},h=function(){return o=!0};l&&(r.scroller.draggable=!0),e.state.draggingText=u,u.copy=!i.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),pe(r.wrapper.ownerDocument,"mouseup",u),pe(r.wrapper.ownerDocument,"mousemove",c),pe(r.scroller,"dragstart",h),pe(r.scroller,"drop",u),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),dt(e.doc,ot(t.line+1,0)));var i=n(e,t);return new oo(i.from,i.to)}function Cs(e,t,n,i){var r=e.display,o=e.doc;_e(t);var a,s,l=o.sel,u=l.ranges;if(i.addNew&&!i.extend?(s=o.sel.contains(n),a=s>-1?u[s]:new oo(n,n)):(a=o.sel.primary(),s=o.sel.primIndex),"rectangle"==i.unit)i.addNew||(a=new oo(n,n)),n=Pi(e,t,!0,!0),s=-1;else{var c=ks(e,n,i.unit);a=i.extend?Po(a,c.anchor,c.head,i.extend):c}i.addNew?-1==s?(s=u.length,Wo(o,ao(e,u.concat([a]),s),{scroll:!1,origin:"*mouse"})):u.length>1&&u[s].empty()&&"char"==i.unit&&!i.extend?(Wo(o,ao(e,u.slice(0,s).concat(u.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):Fo(o,s,a,U):(s=0,Wo(o,new ro([a],0),U),l=o.sel);var h=n;function d(t){if(0!=at(h,t))if(h=t,"rectangle"==i.unit){for(var r=[],u=e.options.tabSize,c=F(Je(o,n.line).text,n.ch,u),d=F(Je(o,t.line).text,t.ch,u),f=Math.min(c,d),p=Math.max(c,d),m=Math.min(n.line,t.line),v=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=v;m++){var g=Je(o,m).text,y=V(g,f,u);f==p?r.push(new oo(ot(m,y),ot(m,y))):g.length>y&&r.push(new oo(ot(m,y),ot(m,V(g,p,u))))}r.length||r.push(new oo(n,n)),Wo(o,ao(e,l.ranges.slice(0,s).concat(r),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,x=a,w=ks(e,t,i.unit),_=x.anchor;at(w.anchor,_)>0?(b=w.head,_=ct(x.from(),w.anchor)):(b=w.anchor,_=ut(x.to(),w.head));var k=l.ranges.slice(0);k[s]=Ss(e,new oo(dt(o,_),b)),Wo(o,ao(e,k,s),U)}}var f=r.wrapper.getBoundingClientRect(),p=0;function m(t){var n=++p,a=Pi(e,t,!0,"rectangle"==i.unit);if(a)if(0!=at(a,h)){e.curOp.focus=R(),d(a);var s=tr(r,o);(a.line>=s.to||a.line<s.from)&&setTimeout(Rr(e,(function(){p==n&&m(t)})),150)}else{var l=t.clientY<f.top?-20:t.clientY>f.bottom?20:0;l&&setTimeout(Rr(e,(function(){p==n&&(r.scroller.scrollTop+=l,m(t))})),50)}}function v(t){e.state.selectingText=!1,p=1/0,t&&(_e(t),r.input.focus()),ve(r.wrapper.ownerDocument,"mousemove",g),ve(r.wrapper.ownerDocument,"mouseup",y),o.history.lastSelOrigin=null}var g=Rr(e,(function(e){0!==e.buttons&&Le(e)?m(e):v(e)})),y=Rr(e,v);e.state.selectingText=y,pe(r.wrapper.ownerDocument,"mousemove",g),pe(r.wrapper.ownerDocument,"mouseup",y)}function Ss(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=de(r);if(!o)return t;var a=ce(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,u=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==u||u==o.length)return t;if(i.line!=n.line)l=(i.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=ce(o,i.ch,i.sticky),h=c-a||(i.ch-n.ch)*(1==s.level?-1:1);l=c==u-1||c==u?h<0:h>0}var d=o[u+(l?-1:0)],f=l==(1==d.level),p=f?d.from:d.to,m=f?"after":"before";return n.ch==p&&n.sticky==m?t:new oo(new ot(n.line,p,m),i)}function Es(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&&_e(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!xe(e,n))return Ce(t);o-=s.top-a.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var u=a.gutters.childNodes[l];if(u&&u.getBoundingClientRect().right>=r)return ge(e,n,e,nt(e.doc,o),e.display.gutterSpecs[l].className,t),Ce(t)}}function Ls(e,t){return Es(e,t,"gutterClick",!0)}function As(e,t){Un(e.display,t)||Ts(e,t)||ye(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function Ts(e,t){return!!xe(e,"gutterContextMenu")&&Es(e,t,"gutterContextMenu",!1)}function Ms(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),di(e)}vs.prototype.compare=function(e,t,n){return this.time+ms>e&&0==at(t,this.pos)&&n==this.button};var Ds={toString:function(){return"CodeMirror.Init"}},Rs={},Bs={};function Ns(e){var t=e.optionHandlers;function n(n,i,r,o){e.defaults[n]=i,r&&(t[n]=o?function(e,t,n){n!=Ds&&r(e,t,n)}:r)}e.defineOption=n,e.Init=Ds,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,po(e)}),!0),n("indentUnit",2,po,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){mo(e),di(e),Oi(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!=Ds&&e.refresh()})),n("specialCharPlaceholder",vn,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",g?"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",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Ms(e),Jr(e)}),!0),n("keyMap","default",(function(e,t,n){var i=Za(t),r=n!=Ds&&Za(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?Ri(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,Gi,!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,Ps),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Gi,!0),n("singleCursorHeightPerLine",!0,Gi,!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 Ps(e,t,n){if(!t!=!(n&&n!=Ds)){var i=e.display.dragFunctions,r=t?pe:ve;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?(B(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(E(e.display.wrapper,"CodeMirror-wrap"),ln(e)),Ni(e),Oi(e),di(e),setTimeout((function(){return yr(e)}),100)}function Os(e,t){var n=this;if(!(this instanceof Os))return new Os(e,t);this.options=t=t?O(t):{},O(Rs,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 Os.inputStyles[t.inputStyle](this),o=this.display=new Qr(e,i,r,t);for(var u in o.wrapper.CodeMirror=this,Ms(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 j,keySeq:null,specialChars:null},t.autofocus&&!g&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Fs(this),Da(),kr(this),this.curOp.forceUpdate=!0,bo(this,i),t.autofocus&&!g||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Ji(n)}),20):Qi(this),Bs)Bs.hasOwnProperty(u)&&Bs[u](this,t[u],Ds);Kr(this),t.finishInit&&t.finishInit(this);for(var c=0;c<js.length;++c)js[c](this);Cr(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function Fs(e){var t=e.display;pe(t.scroller,"mousedown",Rr(e,ys)),pe(t.scroller,"dblclick",a&&s<11?Rr(e,(function(t){if(!ye(e,t)){var n=Pi(e,t);if(n&&!Ls(e,t)&&!Un(e.display,t)){_e(t);var i=e.findWordAt(n);Io(e.doc,i.anchor,i.head)}}})):function(t){return ye(e,t)||_e(t)}),pe(t.scroller,"contextmenu",(function(t){return As(e,t)})),pe(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||As(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}pe(t.scroller,"touchstart",(function(r){if(!ye(e,r)&&!o(r)&&!Ls(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)}})),pe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),pe(t.scroller,"touchend",(function(n){var i=t.activeTouch;if(i&&!Un(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),dt(e.doc,ot(a.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),_e(n)}r()})),pe(t.scroller,"touchcancel",r),pe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(dr(e,t.scroller.scrollTop),pr(e,t.scroller.scrollLeft,!0),ge(e,"scroll",e))})),pe(t.scroller,"mousewheel",(function(t){return io(e,t)})),pe(t.scroller,"DOMMouseScroll",(function(t){return io(e,t)})),pe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ye(e,t)||Se(t)},over:function(t){ye(e,t)||(La(e,t),Se(t))},start:function(t){return Ea(e,t)},drop:Rr(e,Sa),leave:function(t){ye(e,t)||Aa(e)}};var u=t.input.getField();pe(u,"keyup",(function(t){return hs.call(e,t)})),pe(u,"keydown",Rr(e,us)),pe(u,"keypress",Rr(e,ds)),pe(u,"focus",(function(t){return Ji(e,t)})),pe(u,"blur",(function(t){return Qi(e,t)}))}Os.defaults=Rs,Os.optionHandlers=Bs;var js=[];function zs(e,t,n,i){var r,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?r=bt(e,t).state:n="prev");var a=e.options.tabSize,s=Je(o,t),l=F(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(i||/\S/.test(s.text)){if("smart"==n&&((u=o.mode.indent(r,s.text.slice(c.length),s.text))==W||u>150)){if(!i)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>o.first?F(Je(o,t-1).text,null,a):0:"add"==n?u=l+e.options.indentUnit:"subtract"==n?u=l-e.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var h="",d=0;if(e.options.indentWithTabs)for(var f=Math.floor(u/a);f;--f)d+=a,h+="\t";if(d<u&&(h+=K(u-d)),h!=c)return ra(o,h,ot(t,0),ot(t,c.length),"+input"),s.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var m=o.sel.ranges[p];if(m.head.line==t&&m.head.ch<c.length){var v=ot(t,c.length);Fo(o,p,new oo(v,v));break}}}Os.defineInitHook=function(e){return js.push(e)};var Hs=null;function Ws(e){Hs=e}function Gs(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=Ne(t),u=null;if(s&&i.ranges.length>1)if(Hs&&Hs.text.join("\n")==t){if(i.ranges.length%Hs.text.length==0){u=[];for(var c=0;c<Hs.text.length;c++)u.push(o.splitLines(Hs.text[c]))}}else l.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(u=X(l,(function(e){return[e]})));for(var h=e.curOp.updateInput,d=i.ranges.length-1;d>=0;d--){var f=i.ranges[d],p=f.from(),m=f.to();f.empty()&&(n&&n>0?p=ot(p.line,p.ch-n):e.state.overwrite&&!s?m=ot(m.line,Math.min(Je(o,m.line).text.length,m.ch+Y(l).length)):s&&Hs&&Hs.lineWise&&Hs.text.join("\n")==l.join("\n")&&(p=m=ot(p.line,0)));var v={from:p,to:m,text:u?u[d%u.length]:l,origin:r||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};Qo(e.doc,v),Tn(e,"inputRead",e,v)}t&&!s&&Zs(e,t),sr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Us(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Dr(t,(function(){return Gs(t,n,0,null,"paste")})),!0}function Zs(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=zs(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=zs(e,r.head.line,"smart"));a&&Tn(e,"electricInput",e,r.head.line)}}}function Vs(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 qs(e,t,n,i){e.setAttribute("autocorrect",n?"":"off"),e.setAttribute("autocapitalize",i?"":"off"),e.setAttribute("spellcheck",!!t)}function Ks(){var e=T("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=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"),qs(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)&&Rr(this,t[e])(this,n,r),ge(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"](Za(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:Br((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++,Oi(this)})),removeOverlay:Br((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 Oi(this)}})),indentLine:Br((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)&&zs(this,e,t,n)})),indentSelection:Br((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&&(zs(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)zs(this,l,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[i].from().ch>0&&Fo(this.doc,i,new oo(o,u[i].to()),G)}}})),getTokenAt:function(e,t){return Ct(this,e,t)},getLineTokens:function(e,t){return Ct(this,ot(e),t,!0)},getTokenTypeAt:function(e){e=dt(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 u=r._global[l];u.pred(o,this)&&-1==z(i,u.val)&&i.push(u.val)}return i},getStateAfter:function(e,t){var n=this.doc;return bt(this,(e=ht(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return bi(this,null==e?n.head:"object"==typeof e?dt(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return yi(this,dt(this.doc,e),t||"page")},coordsChar:function(e,t){return _i(this,(e=gi(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=gi(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 vi(this,i,{top:0,left:0},t||"page",n||r).top+(r?this.doc.height-an(i):0)},defaultTextHeight:function(){return Ti(this.display)},defaultCharWidth:function(){return Mi(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=bi(this,dt(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),u=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>u&&(s=u-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:Br(us),triggerOnKeyPress:Br(ds),triggerOnKeyUp:hs,triggerOnMouseDown:Br(ys),execCommand:function(e){if(Ja.hasOwnProperty(e))return Ja[e].call(null,this)},triggerElectric:Br((function(e){Zs(this,e)})),findPosH:function(e,t,n,i){var r=1;t<0&&(r=-1,t=-t);for(var o=dt(this.doc,e),a=0;a<t&&!(o=Xs(this.doc,o,r,n,i)).hitSide;++a);return o},moveH:Br((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()}),Z)})),deleteH:Br((function(e,t){var n=this.doc.sel,i=this.doc;n.somethingSelected()?i.replaceSelection("",null,"+delete"):Va(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=dt(this.doc,e),s=0;s<t;++s){var l=bi(this,a,"div");if(null==o?o=l.left:l.left=o,(a=Js(this,l,r,n)).hitSide)break}return a},moveV:Br((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=bi(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}),Z),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)?B(this.display.cursorDiv,"CodeMirror-overwrite"):E(this.display.cursorDiv,"CodeMirror-overwrite"),ge(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==R()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Br((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:Br((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?ur(this,e):hr(this,e.from,e.to,e.margin)})),setSize:Br((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&&hi(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){Fi(n,r,"widget");break}++r})),this.curOp.forceUpdate=!0,ge(this,"refresh",this)})),operation:function(e){return Dr(this,e)},startOperation:function(){return kr(this)},endOperation:function(){return Cr(this)},refresh:Br((function(){var e=this.display.cachedTextHeight;Oi(this),this.curOp.forceUpdate=!0,di(this),lr(this,this.doc.scrollLeft,this.doc.scrollTop),Zr(this.display),(null==e||Math.abs(e-Ti(this.display))>.5||this.options.lineWrapping)&&Ni(this),ge(this,"refresh",this)})),swapDoc:Br((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),bo(this,e),di(this),this.display.input.reset(),lr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Tn(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 u(){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 c(o){var a;if("codepoint"==i){var c=s.text.charCodeAt(t.ch+(i>0?0:-1));a=isNaN(c)?null:new ot(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(c>=55296&&c<56320?2:1))),-n)}else a=r?Xa(e.cm,s,t,n):Ka(s,t,n);if(null==a){if(o||!u())return!1;t=Ya(r,e.cm,s,t.line,l)}else t=a;return!0}if("char"==i||"codepoint"==i)c();else if("column"==i)c(!0);else if("word"==i||"group"==i)for(var h=null,d="group"==i,f=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(n<0)||c(!p);p=!1){var m=s.text.charAt(t.ch)||"\n",v=ne(m,f)?"w":d&&"\n"==m?"n":!d||/\s/.test(m)?null:"p";if(!d||p||v||(v="s"),h&&h!=v){n<0&&(n=1,c(),t.sticky="after");break}if(v&&(h=v),n>0&&!c(!p))break}var g=Ko(e,t,o,a,!0);return st(o,g)&&(g.hitSide=!0),g}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),u=Math.max(l-.5*Ti(e.display),3);r=(n>0?t.bottom:t.top)+n*u}else"line"==i&&(r=n>0?t.bottom+3:t.top-3);for(;(o=_i(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 j,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=de(i,e.doc.direction),a="left";o&&(a=ce(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 u(e){return function(t){return t.id==e}}function c(){a&&(o+=s,l&&(o+=s),a=l=!1)}function h(e){e&&(c(),o+=e)}function d(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void h(n);var o,f=t.getAttribute("cm-marker");if(f){var p=e.findMarks(ot(i,0),ot(r+1,0),u(+f));return void(p.length&&(o=p[0].find(0))&&h(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&&c();for(var v=0;v<t.childNodes.length;v++)d(t.childNodes[v]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),m&&(a=!0)}else 3==t.nodeType&&h(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;d(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||!D(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,u=l.maps;function c(t,n,i){for(var r=-1;r<(u?u.length:0);r++)for(var o=r<0?l.map:u[r],a=0;a<o.length;a+=3){var s=o[a+2];if(s==t||s==n){var c=tt(r<0?e.line:e.rest[r]),h=o[a]+i;return(i<0||s!=t)&&(h=o[a+(i?1:0)]),ot(c,h)}}}var h=c(a,s,n);if(h)return tl(h,r);for(var d=s.nextSibling,f=a?a.nodeValue.length-n:0;d;d=d.nextSibling){if(h=c(d,d.firstChild,0))return tl(ot(h.line,h.ch-f),r);f+=d.textContent.length}for(var p=s.previousSibling,m=n;p;p=p.previousSibling){if(h=c(p,p.firstChild,-1))return tl(ot(h.line,h.ch+m),r);m+=p.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())Ws({lineWise:!1,text:i.getSelections()}),"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=Vs(i);Ws({lineWise:!0,text:t.text}),"cut"==e.type&&i.operation((function(){i.setSelections(t.ranges,0,G),i.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var a=Hs.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=Hs.text.join("\n");var u=document.activeElement;P(l),setTimeout((function(){i.display.lineSpace.removeChild(s),u.focus(),u==r&&n.showPrimarySelection()}),50)}}qs(r,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize),pe(r,"paste",(function(e){!o(e)||ye(i,e)||Us(e,i)||s<=11&&setTimeout(Rr(i,(function(){return t.updateFromDOM()})),20)})),pe(r,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),pe(r,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),pe(r,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),pe(r,"touchstart",(function(){return n.forceCompositionEnd()})),pe(r,"input",(function(){t.composing||t.readFromDOMSoon()})),pe(r,"copy",a),pe(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=Ui(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(ct(a,s),r)||0!=at(ut(a,s),o)){var l=t.display.view,u=r.line>=t.display.viewFrom&&$s(t,r)||{node:l[0].measure.map[2],offset:0},c=o.line<t.display.viewTo&&$s(t,o);if(!c){var h=l[l.length-1].measure,d=h.maps?h.maps[h.maps.length-1]:h.map;c={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(u&&c){var f,p=e.rangeCount&&e.getRangeAt(0);try{f=S(u.node,u.offset,c.offset,c.node)}catch(e){}f&&(!n&&t.state.focused?(e.collapse(u.node,u.offset),f.collapsed||(e.removeAllRanges(),e.addRange(f))):(e.removeAllRanges(),e.addRange(f)),p&&null==e.anchorNode?e.addRange(p):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){A(this.cm.display.cursorDiv,e.cursors),A(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 D(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():Dr(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(v&&c&&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&&Dr(t,(function(){Wo(t.doc,so(n,i),G),(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,u,c=Ii(i,s.line);if(c==r.view.length-1?(l=r.viewTo-1,u=r.lineDiv.lastChild):(l=tt(r.view[c+1].line)-1,u=r.view[c+1].node.previousSibling),!n)return!1;for(var h=i.doc.splitLines(nl(i,n,u,t,l)),d=Qe(i.doc,ot(t,0),ot(l,Je(i.doc,l).text.length));h.length>1&&d.length>1;)if(Y(h)==Y(d))h.pop(),d.pop(),l--;else{if(h[0]!=d[0])break;h.shift(),d.shift(),t++}for(var f=0,p=0,m=h[0],v=d[0],g=Math.min(m.length,v.length);f<g&&m.charCodeAt(f)==v.charCodeAt(f);)++f;for(var y=Y(h),b=Y(d),x=Math.min(y.length-(1==h.length?f:0),b.length-(1==d.length?f:0));p<x&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==h.length&&1==d.length&&t==a.line)for(;f&&f>a.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)f--,p++;h[h.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(f).replace(/\u200b+$/,"");var w=ot(t,f),_=ot(l,d.length?Y(d).length-p:0);return h.length>1||h[0]||at(w,_)?(ra(i.doc,h,w,_,"+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()||Dr(this.cm,(function(){return Oi(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()||Rr(this.cm,Gs)(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 j,this.hasSelection=!1,this.composing=null};function al(e,t){if((t=t?O(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=R();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function i(){e.value=s.getValue()}var r;if(e.form&&(pe(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&&(ve(e.form,"submit",i),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=r))}},e.style.display="none";var s=Os((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s}function sl(e){e.off=ve,e.on=pe,e.wheelEventPixels=no,e.Doc=ka,e.splitLines=Ne,e.countColumn=F,e.findColumn=V,e.isWordChar=te,e.Pass=W,e.signal=ge,e.Line=un,e.changeEnd=lo,e.scrollbarModel=xr,e.Pos=ot,e.cmpPos=at,e.modes=je,e.mimeModes=ze,e.resolveMode=Ge,e.getMode=Ue,e.modeExtensions=Ze,e.extendMode=Ve,e.copyState=qe,e.startState=Ye,e.innerMode=Ke,e.commands=Ja,e.keyMap=Fa,e.keyName=Ua,e.isModifierKey=Wa,e.lookupKey=Ha,e.normalizeKeyMap=za,e.StringStream=Xe,e.SharedTextMarker=ga,e.TextMarker=ma,e.LineWidget=ha,e.e_preventDefault=_e,e.e_stopPropagation=ke,e.e_stop=Se,e.addClass=B,e.contains=D,e.rmClass=E,e.keyNames=Na}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())Ws({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=Vs(i);Ws({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,G):(n.prevInput="",r.value=t.text.join("\n"),P(r))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(r.style.width="0px"),pe(r,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),pe(r,"paste",(function(e){ye(i,e)||Us(e,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())})),pe(r,"cut",o),pe(r,"copy",o),pe(e.scroller,"paste",(function(t){if(!Un(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)}})),pe(e.lineSpace,"selectstart",(function(t){Un(e,t)||_e(t)})),pe(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"})}})),pe(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=Ui(e);if(e.options.moveInputWithCursor){var r=bi(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;A(t.cursorDiv,e.cursors),A(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&&P(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&&(!g||R()!=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||Pe(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,u=Math.min(i.length,r.length);l<u&&i.charCodeAt(l)==r.charCodeAt(l);)++l;return Dr(t,(function(){Gs(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=Pi(n,e),u=i.scroller.scrollTop;if(o&&!h){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Rr(n,Wo)(n.doc,so(o),G);var c,d=r.style.cssText,f=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",r.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.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&&(c=window.scrollY),i.input.focus(),l&&window.scrollTo(null,c),i.input.reset(),n.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=g,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),a&&s>=9&&v(),k){Se(e);var m=function(){ve(window,"mouseup",m),setTimeout(g,20)};pe(window,"mouseup",m)}else setTimeout(g,50)}function v(){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 g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=f,r.style.cssText=d,a&&s<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=u),null!=r.selectionStart)){(!a||a&&s<9)&&v();var e=0,o=function(){i.selForContextMenu==n.doc.sel&&0==r.selectionStart&&r.selectionEnd>0&&""==t.prevInput?Rr(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,Ns(Os),Ys(Os);var ll="iter insert remove copy getEditor constructor".split(" ");for(var ul in ka.prototype)ka.prototype.hasOwnProperty(ul)&&z(ll,ul)<0&&(Os.prototype[ul]=function(e){return function(){return e.apply(this.doc,arguments)}}(ka.prototype[ul]));return we(ka),Os.inputStyles={textarea:ol,contenteditable:Qs},Os.defineMode=function(e){Os.defaults.mode||"null"==e||(Os.defaults.mode=e),He.apply(this,arguments)},Os.defineMIME=We,Os.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Os.defineMIME("text/plain","null"),Os.defineExtension=function(e,t){Os.prototype[e]=t},Os.defineDocExtension=function(e,t){ka.prototype[e]=t},Os.fromTextArea=al,sl(Os),Os.version="5.58.2",Os}()},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*$/,u=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,c=/^\[(x| )\](?=\s)/i,h=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,d=/^ {0,3}(?:\={1,}|-{2,})\s*$/,f=/^[^#!\[\]*_\\<>` "'(~:]+/,p=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,m=/^\s*\[[^\]]+?\]:.*$/,v=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,g=" ";function y(e,t,n){return t.f=t.inline=n,n(e,t)}function b(e,t,n){return t.f=t.block=n,n(e,t)}function x(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=L,t.block=_,t.htmlState=null)}return t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.prevLine=t.thisLine,t.thisLine={stream:null},null}function _(t,i){var r=t.column()===i.indentation,s=x(i.prevLine.stream),f=i.indentedCode,v=i.prevLine.hr,g=!1!==i.list,b=(i.listStack[i.listStack.length-1]||0)+3;i.indentedCode=!1;var w=i.indentation;if(null===i.indentationDiff&&(i.indentationDiff=i.indentation,g)){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 _=!(s||v||i.prevLine.header||g&&f||i.prevLine.fencedCodeEnd),k=(!1===i.list||v||s)&&i.indentation<=b&&t.match(l),E=null;if(i.indentationDiff>=4&&(f||i.prevLine.fencedCodeEnd||i.prevLine.header||s))return t.skipToEnd(),i.indentedCode=!0,a.code;if(t.eatSpace())return null;if(r&&i.indentation<=b&&(E=t.match(h))&&E[1].length<=6)return i.quote=0,i.header=E[1].length,i.thisLine.header=!0,n.highlightFormatting&&(i.formatting="header"),i.f=i.inline,S(i);if(i.indentation<=b&&t.eat(">"))return i.quote=r?1:i.quote+1,n.highlightFormatting&&(i.formatting="quote"),t.eatSpace(),S(i);if(!k&&!i.setext&&r&&i.indentation<=b&&(E=t.match(u))){var L=E[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(c,!1)&&(i.taskList=!0),i.f=i.inline,n.highlightFormatting&&(i.formatting=["list","list-"+L]),S(i)}return r&&i.indentation<=b&&(E=t.match(p,!0))?(i.quote=0,i.fencedEndRE=new RegExp(E[1]+"+ *$"),i.localMode=n.fencedCodeBlockHighlighting&&o(E[2]||n.fencedCodeBlockDefaultMode),i.localMode&&(i.localState=e.startState(i.localMode)),i.f=i.block=C,n.highlightFormatting&&(i.formatting="code-block"),i.code=-1,S(i)):i.setext||!(_&&g||i.quote||!1!==i.list||i.code||k||m.test(t.string))&&(E=t.lookAhead(1))&&(E=E.match(d))?(i.setext?(i.header=i.setext,i.setext=0,t.skipToEnd(),n.highlightFormatting&&(i.formatting="header")):(i.header="="==E[0].charAt(0)?1:2,i.setext=i.header),i.thisLine.header=!0,i.f=i.inline,S(i)):k?(t.skipToEnd(),i.hr=!0,i.thisLine.hr=!0,a.hr):"["===t.peek()?y(t,i,R):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=L,n.block=_,n.htmlState=null)}return o}function C(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=S(t)),t.localMode=t.localState=null,t.block=_,t.f=L,t.fencedEndRE=null,t.code=0,t.thisLine.fencedCodeEnd=!0,o?b(e,t,t.block):i):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),a.code)}function S(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 E(e,t){if(e.match(f,!0))return S(t)}function L(t,r){var o=r.text(t,r);if(void 0!==o)return o;if(r.list)return r.list=null,S(r);if(r.taskList)return" "===t.match(c,!0)[1]?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,S(r);if(r.taskOpen=!1,r.taskClosed=!1,r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"),S(r);var s=t.next();if(r.linkTitle){r.linkTitle=!1;var l=s;"("===s&&(l=")");var u="^\\s*(?:[^"+(l=(l+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+l;if(t.match(new RegExp(u),!0))return a.linkHref}if("`"===s){var h=r.formatting;n.highlightFormatting&&(r.formatting="code"),t.eatWhile("`");var d=t.current().length;if(0!=r.code||r.quote&&1!=d){if(d==r.code){var f=S(r);return r.code=0,f}return r.formatting=h,S(r)}return r.code=d,S(r)}if(r.code)return S(r);if("\\"===s&&(t.next(),n.highlightFormatting)){var p=S(r),m=a.formatting+"-escape";return p?p+" "+m:m}if("!"===s&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return r.imageMarker=!0,r.image=!0,n.highlightFormatting&&(r.formatting="image"),S(r);if("["===s&&r.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return r.imageMarker=!1,r.imageAltText=!0,n.highlightFormatting&&(r.formatting="image"),S(r);if("]"===s&&r.imageAltText){n.highlightFormatting&&(r.formatting="image");var p=S(r);return r.imageAltText=!1,r.image=!1,r.inline=r.f=T,p}if("["===s&&!r.image)return r.linkText&&t.match(/^.*?\]/)||(r.linkText=!0,n.highlightFormatting&&(r.formatting="link")),S(r);if("]"===s&&r.linkText){n.highlightFormatting&&(r.formatting="link");var p=S(r);return r.linkText=!1,r.inline=r.f=t.match(/\(.*?\)| ?\[.*?\]/,!1)?T:L,p}if("<"===s&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return r.f=r.inline=A,n.highlightFormatting&&(r.formatting="link"),(p=S(r))?p+=" ":p="",p+a.linkInline;if("<"===s&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return r.f=r.inline=A,n.highlightFormatting&&(r.formatting="link"),(p=S(r))?p+=" ":p="",p+a.linkEmail;if(n.xml&&"<"===s&&t.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var g=t.string.indexOf(">",t.pos);if(-1!=g){var y=t.string.substring(t.start,g);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(y)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(i),b(t,r,k)}if(n.xml&&"<"===s&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";if("*"===s||"_"===s){for(var x=1,w=1==t.pos?" ":t.string.charAt(t.pos-2);x<3&&t.eat(s);)x++;var _=t.peek()||" ",C=!/\s/.test(_)&&(!v.test(_)||/\s/.test(w)||v.test(w)),E=!/\s/.test(w)&&(!v.test(w)||/\s/.test(_)||v.test(_)),M=null,D=null;if(x%2&&(r.em||!C||"*"!==s&&E&&!v.test(w)?r.em!=s||!E||"*"!==s&&C&&!v.test(_)||(M=!1):M=!0),x>1&&(r.strong||!C||"*"!==s&&E&&!v.test(w)?r.strong!=s||!E||"*"!==s&&C&&!v.test(_)||(D=!1):D=!0),null!=D||null!=M)return n.highlightFormatting&&(r.formatting=null==M?"strong":null==D?"em":"strong em"),!0===M&&(r.em=s),!0===D&&(r.strong=s),f=S(r),!1===M&&(r.em=!1),!1===D&&(r.strong=!1),f}else if(" "===s&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return S(r);t.backUp(1)}if(n.strikethrough)if("~"===s&&t.eatWhile(s)){if(r.strikethrough)return n.highlightFormatting&&(r.formatting="strikethrough"),f=S(r),r.strikethrough=!1,f;if(t.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),S(r)}else if(" "===s&&t.match(/^~~/,!0)){if(" "===t.peek())return S(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 R=S(r);return r.emoji=!1,R}return" "===s&&(t.match(/^ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),S(r)}function A(e,t){if(">"===e.next()){t.f=t.inline=L,n.highlightFormatting&&(t.formatting="link");var i=S(t);return i?i+=" ":i="",i+a.linkInline}return e.match(/^[^>]+/,!0),a.linkInline}function T(e,t){if(e.eatSpace())return null;var i=e.next();return"("===i||"["===i?(t.f=t.inline=D("("===i?")":"]"),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,S(t)):"error"}var M={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function D(e){return function(t,i){if(t.next()===e){i.f=i.inline=L,n.highlightFormatting&&(i.formatting="link-string");var r=S(i);return i.linkHref=!1,r}return t.match(M[e]),i.linkHref=!0,S(i)}}function R(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=B,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,S(t)):y(e,t,L)}function B(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=N,n.highlightFormatting&&(t.formatting="link");var i=S(t);return t.linkText=!1,i}return e.match(/^([^\]\\]|\\.)+/,!0),a.linkText}function N(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=L,a.linkHref+" url")}var P={startState:function(){return{f:_,prevLine:{stream:null},thisLine:{stream:null},block:_,htmlState:null,indentation:0,inline:L,text:E,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,g).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:P}},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:S,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return P}),"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 u(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,h),r.style}if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/\\]/))return"tag";if(e.match("\\["))return l(t,(function(e,t){return c(e,t,"\\]")})),"keyword";if(e.match("\\("))return l(t,(function(e,t){return c(e,t,"\\)")})),"keyword";if(e.match("$$"))return l(t,(function(e,t){return c(e,t,"$$")})),"keyword";if(e.match("$"))return l(t,(function(e,t){return c(e,t,"$")})),"keyword";var u=e.next();return"%"==u?(e.skipToEnd(),"comment"):"}"==u||"]"==u?(r=i(t))?(r.closeBracket(u),l(t,h),"bracket"):"error":"{"==u||"["==u?(n(t,r=new(r=s.DEFAULT)),"bracket"):/\d/.test(u)?(e.eatWhile(/[\w.%]/),"atom"):(e.eatWhile(/[\w\-_]/),"begin"==(r=o(t)).name&&(r.argument=e.current()),r.styleIdentifier())}function c(e,t,n){if(e.eatSpace())return null;if(n&&e.match(n))return l(t,u),"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 h(e,t){var n=e.peek();return"{"==n||"["==n?(i(t).openBracket(n),e.eat(n),l(t,u),"bracket"):/[ \t\r]/.test(n)?(e.eat(n),null):(l(t,u),r(t),u(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 c(e,t)}:u}},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=u,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={},u=r.htmlMode?t:n;for(var c in u)l[c]=u[c];for(var c in r)l[c]=r[c];function h(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(p("atom","]]>")):null:e.match("--")?n(p("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(m(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=p("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=d,"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 d(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=h,o=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return o="equals",null;if("<"==n){t.tokenize=h,t.state=b,t.tagName=t.tagStart=null;var i=t.tokenize(e,t);return i?i+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=f(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=d;break}return"string"};return t.isInAttribute=!0,t}function p(e,t){return function(n,i){for(;!n.eol();){if(n.match(t)){i.tokenize=h;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=h;break}return n.tokenize=m(e-1),n.tokenize(t,n)}}return"meta"}}function v(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 g(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;g(e)}}function b(e,t,n){return"openTag"==e?(n.tagStart=t.column(),x):"closeTag"==e?w:b}function x(e,t,n){return"word"==e?(n.tagName=t.current(),a="tag",C):l.allowMissingTagName&&"endTag"==e?(a="tag bracket",C(e,t,n)):(a="error",x)}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)&&g(n),n.context&&n.context.tagName==i||!1===l.matchClosing?(a="tag",_):(a="tag error",k)}return l.allowMissingTagName&&"endTag"==e?(a="tag bracket",_(e,t,n)):(a="error",k)}function _(e,t,n){return"endTag"!=e?(a="error",_):(g(n),b)}function k(e,t,n){return a="error",_(e,t,n)}function C(e,t,n){if("word"==e)return a="attribute",S;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 v(n,i,r==n.indented)),b}return a="error",C}function S(e,t,n){return"equals"==e?E:(l.allowMissing||(a="error"),C(e,t,n))}function E(e,t,n){return"string"==e?L:"word"==e&&l.allowUnquoted?(a="string",C):(a="error",C(e,t,n))}function L(e,t,n){return"string"==e?L:C(e,t,n)}return h.isInText=!0,{startState:function(e){var t={tokenize:h,state:b,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!=d&&t.tokenize!=h)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==E&&(e.state=C)},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))},3867:function(e,t,n){var i=n(97671);e.exports=function(){"use strict";function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},o=0,a=void 0,s=void 0,l=function(e,t){w[o]=e,w[o+1]=t,2===(o+=2)&&(s?s(_):C())};function u(e){s=e}function c(e){l=e}var h="undefined"!=typeof window?window:void 0,d=h||{},f=d.MutationObserver||d.WebKitMutationObserver,p="undefined"==typeof self&&void 0!==i&&"[object process]"==={}.toString.call(i),m="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function v(){return function(){return i.nextTick(_)}}function g(){return void 0!==a?function(){a(_)}:x()}function y(){var e=0,t=new f(_),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function b(){var e=new MessageChannel;return e.port1.onmessage=_,function(){return e.port2.postMessage(0)}}function x(){var e=setTimeout;return function(){return e(_,1)}}var w=new Array(1e3);function _(){for(var e=0;e<o;e+=2)(0,w[e])(w[e+1]),w[e]=void 0,w[e+1]=void 0;o=0}function k(){try{var e=Function("return this")().require("vertx");return a=e.runOnLoop||e.runOnContext,g()}catch(e){return x()}}var C=void 0;function S(e,t){var n=this,i=new this.constructor(A);void 0===i[L]&&K(i);var r=n._state;if(r){var o=arguments[r-1];l((function(){return U(r,i,o,n._result)}))}else W(n,i,e,t);return i}function E(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var n=new t(A);return F(n,e),n}C=p?v():f?y():m?b():void 0===h?k():x();var L=Math.random().toString(36).substring(2);function A(){}var T=void 0,M=1,D=2;function R(){return new TypeError("You cannot resolve a promise with itself")}function B(){return new TypeError("A promises callback cannot return that same promise.")}function N(e,t,n,i){try{e.call(t,n,i)}catch(e){return e}}function P(e,t,n){l((function(e){var i=!1,r=N(n,t,(function(n){i||(i=!0,t!==n?F(e,n):z(e,n))}),(function(t){i||(i=!0,H(e,t))}),"Settle: "+(e._label||" unknown promise"));!i&&r&&(i=!0,H(e,r))}),e)}function I(e,t){t._state===M?z(e,t._result):t._state===D?H(e,t._result):W(t,void 0,(function(t){return F(e,t)}),(function(t){return H(e,t)}))}function O(e,n,i){n.constructor===e.constructor&&i===S&&n.constructor.resolve===E?I(e,n):void 0===i?z(e,n):t(i)?P(e,n,i):z(e,n)}function F(t,n){if(t===n)H(t,R());else if(e(n)){var i=void 0;try{i=n.then}catch(e){return void H(t,e)}O(t,n,i)}else z(t,n)}function j(e){e._onerror&&e._onerror(e._result),G(e)}function z(e,t){e._state===T&&(e._result=t,e._state=M,0!==e._subscribers.length&&l(G,e))}function H(e,t){e._state===T&&(e._state=D,e._result=t,l(j,e))}function W(e,t,n,i){var r=e._subscribers,o=r.length;e._onerror=null,r[o]=t,r[o+M]=n,r[o+D]=i,0===o&&e._state&&l(G,e)}function G(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var i=void 0,r=void 0,o=e._result,a=0;a<t.length;a+=3)i=t[a],r=t[a+n],i?U(n,i,r,o):r(o);e._subscribers.length=0}}function U(e,n,i,r){var o=t(i),a=void 0,s=void 0,l=!0;if(o){try{a=i(r)}catch(e){l=!1,s=e}if(n===a)return void H(n,B())}else a=r;n._state!==T||(o&&l?F(n,a):!1===l?H(n,s):e===M?z(n,a):e===D&&H(n,a))}function Z(e,t){try{t((function(t){F(e,t)}),(function(t){H(e,t)}))}catch(t){H(e,t)}}var V=0;function q(){return V++}function K(e){e[L]=V++,e._state=void 0,e._result=void 0,e._subscribers=[]}function Y(){return new Error("Array Methods must be provided an Array")}var X=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(A),this.promise[L]||K(this.promise),r(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?z(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&z(this.promise,this._result))):H(this.promise,Y())}return e.prototype._enumerate=function(e){for(var t=0;this._state===T&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,i=n.resolve;if(i===E){var r=void 0,o=void 0,a=!1;try{r=e.then}catch(e){a=!0,o=e}if(r===S&&e._state!==T)this._settledAt(e._state,t,e._result);else if("function"!=typeof r)this._remaining--,this._result[t]=e;else if(n===ne){var s=new n(A);a?H(s,o):O(s,e,r),this._willSettleAt(s,t)}else this._willSettleAt(new n((function(t){return t(e)})),t)}else this._willSettleAt(i(e),t)},e.prototype._settledAt=function(e,t,n){var i=this.promise;i._state===T&&(this._remaining--,e===D?H(i,n):this._result[t]=n),0===this._remaining&&z(i,this._result)},e.prototype._willSettleAt=function(e,t){var n=this;W(e,void 0,(function(e){return n._settledAt(M,t,e)}),(function(e){return n._settledAt(D,t,e)}))},e}();function J(e){return new X(this,e).promise}function Q(e){var t=this;return r(e)?new t((function(n,i){for(var r=e.length,o=0;o<r;o++)t.resolve(e[o]).then(n,i)})):new t((function(e,t){return t(new TypeError("You must pass an array to race."))}))}function $(e){var t=new this(A);return H(t,e),t}function ee(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function te(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var ne=function(){function e(t){this[L]=q(),this._result=this._state=void 0,this._subscribers=[],A!==t&&("function"!=typeof t&&ee(),this instanceof e?Z(this,t):te())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var n=this,i=n.constructor;return t(e)?n.then((function(t){return i.resolve(e()).then((function(){return t}))}),(function(t){return i.resolve(e()).then((function(){throw t}))})):n.then(e,e)},e}();function ie(){var e=void 0;if(void 0!==n.g)e=n.g;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var i=null;try{i=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===i&&!t.cast)return}e.Promise=ne}return ne.prototype.then=S,ne.all=J,ne.race=Q,ne.resolve=E,ne.reject=$,ne._setScheduler=u,ne._setAsap=c,ne._asap=l,ne.polyfill=ie,ne.Promise=ne,ne}()},86204:function(e){"use strict";var t,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(n,i){function r(n){e.removeListener(t,o),i(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",r),n([].slice.call(arguments))}m(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&m(e,"error",t,n)}(e,r,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function u(e,t,n,i){var r,o,a;if(s(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"==typeof a?a=o[t]=i?[n,a]:[a,n]:i?a.unshift(n):a.push(n),(r=l(e))>0&&a.length>r&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,function(e){console&&console.warn&&console.warn(e)}(u)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=c.bind(i);return r.listener=n,i.wrapFn=r,r}function d(e,t,n){var i=e._events;if(void 0===i)return[];var r=i[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(r):p(r,r.length)}function f(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e[i];return n}function m(e,t,n,i){if("function"==typeof e.on)i.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function r(o){i.once&&e.removeEventListener(t,r),n(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)i(l,this,t);else{var u=l.length,c=p(l,u);for(n=0;n<u;++n)i(c[n],this,t)}return!0},o.prototype.addListener=function(e,t){return u(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return u(this,e,t,!0)},o.prototype.once=function(e,t){return s(t),this.on(e,h(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,h(this,e,t)),this},o.prototype.removeListener=function(e,t){var n,i,r,o,a;if(s(t),void 0===(i=this._events))return this;if(void 0===(n=i[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(r=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,r=o;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,r),1===n.length&&(i[e]=n[0]),void 0!==i.removeListener&&this.emit("removeListener",e,a||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,i;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var r,o=Object.keys(n);for(i=0;i<o.length;++i)"removeListener"!==(r=o[i])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},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}(),u=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}(),c=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 u=window.URL,c=new Image(o.width,o.height);c.setAttribute("crossOrigin","anonymous");var h=new Blob([s],{type:"image/svg+xml"}),d=u.createObjectURL(h);c.onload=function(){l.drawImage(c,0,0),u.revokeObjectURL(d);var e=o.toDataURL(i.imageType,i.imageQuality);r(e)},c.src=d}))},e}(),h=function(){},d=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 f("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new f("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames","\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n ")),this.addRule(new f("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames","\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n ")),this.addClass(new p("fade_in","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_in_animation_frames;\n ")),this.addClass(new p("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}(),f=function(e,t){this.selector=e,this.style=t},p=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 p("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 p("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 p("toolbar-block","\n display: inline-block;\n box-sizing: content-box;\n ")),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new p("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 p("toolbar-overflow-block_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n "));var e=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new p("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 p("toolbar_button_colors","\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new p("toolbar_active_button","\n fill: "+this.uiStyleSettings.toolbarColor+";\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n ")),this.styles.addRule(new f("."+this.toolbarButtonStyleClass.name+" svg","\n height: "+this.uiStyleSettings.toolbarHeight/2+"px;\n ")),this.styles.addRule(new f("."+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}(),v=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 p("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 p("toolbox_colors","\n color: "+this.uiStyleSettings.toolboxColor+";\n "));var t=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new p("toolbox-button-row","\n display: flex;\n cursor: default;\n box-sizing: content-box;\n ")),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new p("toolbox-button-row_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n ")),this.toolboxPanelRowStyleClass=this.styles.addClass(new p("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 p("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 p("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 p("toolbox-button_colors","\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new p("toolbox-active-button_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+";\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.styles.addRule(new f("."+this.toolboxButtonStyleColorsClass.name+":hover","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n ")),this.styles.addRule(new f("."+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}(),g=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}(g),b=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}(),x=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}(),_=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 x,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:_.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:_.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(_.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,n.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(_.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}(b),C=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),S=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}(g),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 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}(g),L=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 S("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new E("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}(C),A=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"},T=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}(b),M=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 S("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new E("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}(T),D=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}(g),R=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 D("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),B=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 S("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 u=document.createElement("canvas");u.width=r-n,u.height=o-i,u.getContext("2d").putImageData(this.canvasContext.getImageData(n,i,r-n,o-i),0,0),this.drawingImgUrl=u.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),N=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 u=document.createElement("div");u.style.display="flex",u.style.alignItems="center",u.style.minHeight="20px",u.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>',u.style.marginRight="5px",o.appendChild(u)}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}(g),P=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 N("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}(M),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}(C),O=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}(g),F=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 O("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),j='<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>',z='<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>',H=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,j),r.colorPanel.onColorChanged=r.setColor,r.bgColorPanel=new y("Fill color",i.defaultColorSet,r.bgColor,z),r.bgColorPanel.onColorChanged=r.setBgColor,r.fontFamilyPanel=new D("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}(R),W=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,z),r.fillPanel.onColorChanged=r.setFillColor,r.strokeWidthPanel=new S("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new E("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r.opacityPanel=new O("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),G=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}(M),U=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}(W),Z=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}(),V=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 S("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new E("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}(T),q=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,z),r.fillPanel.onColorChanged=r.setFillColor,r.strokeWidthPanel=new S("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new E("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r.fontFamilyPanel=new D("Font",i.defaultFontFamilies,i.defaultFontFamily),r.fontFamilyPanel.onFontChanged=r.setFont,r.textColorPanel=new y("Text color",i.defaultColorSet,r.textColor,j),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 A,this._isOpen=!1,this.undoRedoManager=new Z,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 d(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[L,B,P,R,U,W,F,H,G,I,M,V,q]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[L,B,P,R,W,F,H]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"BASIC_MARKER_TYPES",{get:function(){return[L,B,P,R,F]},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(),u.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},e.prototype.show=function(){var e=this;void 0===this.styles.styleSheetRoot&&void 0!==h.styleSheetRoot&&(this.styles.styleSheetRoot=h.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 c).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 R?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 v(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 B&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(B):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){u.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 L}});var i=n(33885),r=n(42978),o=n(43403),a=n(34280),s=n(59301),l=s.createContext(null),u=s.createContext({}),c=l,h=n(20068),d=n(54476),f=n(92310),p=n.n(f),m=n(77900),v=n(10228),g=n(26112),y=n(75931),b=n(8654),x=["prefixCls","className","containerRef"];var w=function(e){var t=e.prefixCls,n=e.className,i=e.containerRef,r=(0,y.Z)(e,x),o=s.useContext(u).panel,a=(0,b.x1)(o,i);return s.createElement("div",(0,d.Z)({className:p()("".concat(t,"-content"),n),role:"dialog",ref:a},(0,g.Z)(e,{aria:!0}),{"aria-modal":"true"},r))},_=n(48736);function k(e){return"string"==typeof e&&String(Number(e))===e?((0,_.ZP)(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(e)):e}var C={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function S(e,t){var n,o,a,l=e.prefixCls,u=e.open,f=e.placement,y=e.inline,b=e.push,x=e.forceRender,_=e.autoFocus,S=e.keyboard,E=e.classNames,L=e.rootClassName,A=e.rootStyle,T=e.zIndex,M=e.className,D=e.id,R=e.style,B=e.motion,N=e.width,P=e.height,I=e.children,O=e.mask,F=e.maskClosable,j=e.maskMotion,z=e.maskClassName,H=e.maskStyle,W=e.afterOpenChange,G=e.onClose,U=e.onMouseEnter,Z=e.onMouseOver,V=e.onMouseLeave,q=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;u&&_&&(null===(e=Q.current)||void 0===e||e.focus({preventScroll:!0}))}),[u]);var te=s.useState(!1),ne=(0,r.Z)(te,2),ie=ne[0],re=ne[1],oe=s.useContext(c),ae=null!==(n=null!==(o=null===(a="boolean"==typeof b?b?{}:{distance:0}:b||{})||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;u?null==oe||null===(e=oe.push)||void 0===e||e.call(oe):null==oe||null===(t=oe.pull)||void 0===t||t.call(oe)}),[u]),s.useEffect((function(){return function(){var e;null==oe||null===(e=oe.pull)||void 0===e||e.call(oe)}}),[]);var le=O&&s.createElement(m.default,(0,d.Z)({key:"mask"},j,{visible:u}),(function(e,t){var n=e.className,r=e.style;return s.createElement("div",{className:p()("".concat(l,"-mask"),n,null==E?void 0:E.mask,z),style:(0,i.Z)((0,i.Z)((0,i.Z)({},r),H),null==X?void 0:X.mask),onClick:F&&u?G:void 0,ref:t})})),ue="function"==typeof B?B(f):B,ce={};if(ie&&ae)switch(f){case"top":ce.transform="translateY(".concat(ae,"px)");break;case"bottom":ce.transform="translateY(".concat(-ae,"px)");break;case"left":ce.transform="translateX(".concat(ae,"px)");break;default:ce.transform="translateX(".concat(-ae,"px)")}"left"===f||"right"===f?ce.width=k(N):ce.height=k(P);var he={onMouseEnter:U,onMouseOver:Z,onMouseLeave:V,onClick:q,onKeyDown:K,onKeyUp:Y},de=s.createElement(m.default,(0,d.Z)({key:"panel"},ue,{visible:u,forceRender:x,onVisibleChanged:function(e){null==W||W(e)},removeOnLeave:!1,leavedClassName:"".concat(l,"-content-wrapper-hidden")}),(function(t,n){var r=t.className,o=t.style,a=s.createElement(w,(0,d.Z)({id:D,containerRef:n,prefixCls:l,className:p()(M,null==E?void 0:E.content),style:(0,i.Z)((0,i.Z)({},R),null==X?void 0:X.content)},(0,g.Z)(e,{aria:!0}),he),I);return s.createElement("div",(0,d.Z)({className:p()("".concat(l,"-content-wrapper"),null==E?void 0:E.wrapper,r),style:(0,i.Z)((0,i.Z)((0,i.Z)({},ce),o),null==X?void 0:X.wrapper)},(0,g.Z)(e,{data:!0})),J?J(a):a)})),fe=(0,i.Z)({},A);return T&&(fe.zIndex=T),s.createElement(c.Provider,{value:se},s.createElement("div",{className:p()(l,"".concat(l,"-").concat(f),L,(0,h.Z)((0,h.Z)({},"".concat(l,"-open"),u),"".concat(l,"-inline"),y)),style:fe,tabIndex:-1,ref:Q,onKeyDown:function(e){var t=e.keyCode,n=e.shiftKey;switch(t){case v.Z.TAB:var i;if(t===v.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 v.Z.ESC:G&&S&&(e.stopPropagation(),G(e))}}},le,s.createElement("div",{tabIndex:0,ref:$,style:C,"aria-hidden":"true","data-sentinel":"start"}),de,s.createElement("div",{tabIndex:0,ref:ee,style:C,"aria-hidden":"true","data-sentinel":"end"})))}var E=s.forwardRef(S);var L=function(e){var t=e.open,n=void 0!==t&&t,l=e.prefixCls,c=void 0===l?"rc-drawer":l,h=e.placement,d=void 0===h?"right":h,f=e.autoFocus,p=void 0===f||f,m=e.keyboard,v=void 0===m||m,g=e.width,y=void 0===g?378:g,b=e.mask,x=void 0===b||b,w=e.maskClosable,_=void 0===w||w,k=e.getContainer,C=e.forceRender,S=e.afterOpenChange,L=e.destroyOnClose,A=e.onMouseEnter,T=e.onMouseOver,M=e.onMouseLeave,D=e.onClick,R=e.onKeyDown,B=e.onKeyUp,N=e.panelRef,P=s.useState(!1),I=(0,r.Z)(P,2),O=I[0],F=I[1];var j=s.useState(!1),z=(0,r.Z)(j,2),H=z[0],W=z[1];(0,a.Z)((function(){W(!0)}),[]);var G=!!H&&n,U=s.useRef(),Z=s.useRef();(0,a.Z)((function(){G&&(Z.current=document.activeElement)}),[G]);var V=s.useMemo((function(){return{panel:N}}),[N]);if(!C&&!O&&!G&&L)return null;var q={onMouseEnter:A,onMouseOver:T,onMouseLeave:M,onClick:D,onKeyDown:R,onKeyUp:B},K=(0,i.Z)((0,i.Z)({},e),{},{open:G,prefixCls:c,placement:d,autoFocus:p,keyboard:v,width:y,mask:x,maskClosable:_,inline:!1===k,afterOpenChange:function(e){var t,n;(F(e),null==S||S(e),e||!Z.current||null!==(t=U.current)&&void 0!==t&&t.contains(Z.current))||(null===(n=Z.current)||void 0===n||n.focus({preventScroll:!0}))},ref:U},q);return s.createElement(u.Provider,{value:V},s.createElement(o.Z,{open:G||C||O,autoDestroy:!1,getContainer:k,autoLock:x&&(G||O)},s.createElement(E,K)))}},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 Se},lk:function(){return x}});var i=n(54476),r=n(94480),o=n(20068),a=n(33885),s=n(42978),l=n(75931),u=n(76190),c=n(18929),h=n(48736),d=n(59301),f=n(92310),p=n.n(f),m=n(34280),v=n(49658),g=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 d.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:d.createElement("span",{className:p()(t.split(/\s+/).map((function(e){return"".concat(e,"-icon")})))},r))},b=d.createContext(null);function x(){return d.useContext(b)}function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,t=d.useRef(null),n=d.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 d.useEffect((function(){return function(){window.clearTimeout(n.current)}}),[]),[function(){return t.current},i]}var _=n(10228);var k=n(26112),C=n(11780);var S=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},E=["prefixCls","id","inputElement","autoFocus","autoComplete","editable","activeDescendantId","value","open","attrs"],L=function(e,t){var n=e.prefixCls,i=e.id,r=e.inputElement,o=e.autoFocus,s=e.autoComplete,u=e.editable,c=e.activeDescendantId,f=e.value,m=e.open,v=e.attrs,y=(0,l.Z)(e,E),b=r||d.createElement("input",null),x=b,w=x.ref,_=x.props;return(0,h.Kp)(!("maxLength"in b.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),b=d.cloneElement(b,(0,a.Z)((0,a.Z)((0,a.Z)({type:"search"},S(y,_,!0)),{},{id:i,ref:(0,g.sQ)(t,w),autoComplete:s||"off",autoFocus:o,className:p()("".concat(n,"-selection-search-input"),null==_?void 0:_.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?c:void 0},v),{},{value:u?f:"",readOnly:!u,unselectable:u?null:"on",style:(0,a.Z)((0,a.Z)({},_.style),{},{opacity:u?null:0})}))};var A=d.forwardRef(L);function T(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}var M="undefined"!=typeof window&&window.document&&window.document.documentElement;function D(e){return["string","number"].includes((0,u.Z)(e))}function R(e){var t=void 0;return e&&(D(e.title)?t=e.title.toString():D(e.label)&&(t=e.label.toString())),t}function B(e){var t;return null!==(t=e.key)&&void 0!==t?t:e.value}var N=function(e){e.preventDefault(),e.stopPropagation()},P=function(e){var t,n,i=e.id,r=e.prefixCls,a=e.values,l=e.open,u=e.searchValue,c=e.autoClearSearchValue,h=e.inputRef,f=e.placeholder,m=e.disabled,v=e.mode,g=e.showSearch,b=e.autoFocus,x=e.autoComplete,w=e.activeDescendantId,_=e.tabIndex,S=e.removeIcon,E=e.maxTagCount,L=e.maxTagTextLength,T=e.maxTagPlaceholder,D=void 0===T?function(e){return"+ ".concat(e.length," ...")}:T,P=e.tagRender,I=e.onToggleOpen,O=e.onRemove,F=e.onInputChange,j=e.onInputPaste,z=e.onInputKeyDown,H=e.onInputMouseDown,W=e.onInputCompositionStart,G=e.onInputCompositionEnd,U=e.onInputBlur,Z=d.useRef(null),V=(0,d.useState)(0),q=(0,s.Z)(V,2),K=q[0],Y=q[1],X=(0,d.useState)(!1),J=(0,s.Z)(X,2),Q=J[0],$=J[1],ee="".concat(r,"-selection"),te=l||"multiple"===v&&!1===c||"tags"===v?u:"",ne="tags"===v||"multiple"===v&&!1===c||g&&(l||Q);t=function(){Y(Z.current.scrollWidth)},n=[te],M?d.useLayoutEffect(t,n):d.useEffect(t,n);var ie=function(e,t,n,i,r){return d.createElement("span",{title:R(e),className:p()("".concat(ee,"-item"),(0,o.Z)({},"".concat(ee,"-item-disabled"),n))},d.createElement("span",{className:"".concat(ee,"-item-content")},t),i&&d.createElement(y,{className:"".concat(ee,"-item-remove"),onMouseDown:N,onClick:r,customizeIcon:S},"×"))},re=function(e,t,n,i,r,o){return d.createElement("span",{onMouseDown:function(e){N(e),I(!l)}},P({label:t,value:e,disabled:n,closable:i,onClose:r,isMaxTag:!!o}))},oe=d.createElement("div",{className:"".concat(ee,"-search"),style:{width:K},onFocus:function(){$(!0)},onBlur:function(){$(!1)}},d.createElement(A,{ref:h,open:l,prefixCls:r,id:i,inputElement:null,disabled:m,autoFocus:b,autoComplete:x,editable:ne,activeDescendantId:w,value:te,onKeyDown:z,onMouseDown:H,onChange:F,onPaste:j,onCompositionStart:W,onCompositionEnd:G,onBlur:U,tabIndex:_,attrs:(0,k.Z)(e,!0)}),d.createElement("span",{ref:Z,className:"".concat(ee,"-search-mirror"),"aria-hidden":!0},te," ")),ae=d.createElement(C.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 L&&("string"==typeof n||"number"==typeof n)){var a=String(o);a.length>L&&(o="".concat(a.slice(0,L),"..."))}var s=function(t){t&&t.stopPropagation(),O(e)};return"function"==typeof P?re(i,o,t,r,s):ie(e,o,t,r,s)},renderRest:function(e){if(!a.length)return null;var t="function"==typeof D?D(e):D;return"function"==typeof P?re(void 0,t,!1,!1,void 0,!0):ie({title:t},t,!1)},suffix:oe,itemKey:B,maxCount:E});return d.createElement("span",{className:"".concat(ee,"-wrap")},ae,!a.length&&!te&&d.createElement("span",{className:"".concat(ee,"-placeholder")},f))},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,u=e.activeDescendantId,c=e.mode,h=e.open,f=e.values,p=e.placeholder,m=e.tabIndex,v=e.showSearch,g=e.searchValue,y=e.activeValue,b=e.maxLength,x=e.onInputKeyDown,w=e.onInputMouseDown,_=e.onInputChange,C=e.onInputPaste,S=e.onInputCompositionStart,E=e.onInputCompositionEnd,L=e.onInputBlur,T=e.title,M=d.useState(!1),D=(0,s.Z)(M,2),B=D[0],N=D[1],P="combobox"===c,I=P||v,O=f[0],F=g||"";P&&y&&!B&&(F=y),d.useEffect((function(){P&&N(!1)}),[P,y]);var j=!("combobox"!==c&&!h&&!v)&&!!F,z=void 0===T?R(O):T,H=d.useMemo((function(){return O?null:d.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:j?{visibility:"hidden"}:void 0},p)}),[O,j,p,n]);return d.createElement("span",{className:"".concat(n,"-selection-wrap")},d.createElement("span",{className:"".concat(n,"-selection-search")},d.createElement(A,{ref:r,prefixCls:n,id:i,open:h,inputElement:t,disabled:o,autoFocus:a,autoComplete:l,editable:I,activeDescendantId:u,value:F,onKeyDown:x,onMouseDown:w,onChange:function(e){N(!0),_(e)},onPaste:C,onCompositionStart:S,onCompositionEnd:E,onBlur:L,tabIndex:m,attrs:(0,k.Z)(e,!0),maxLength:P?b:void 0})),!P&&O?d.createElement("span",{className:"".concat(n,"-selection-item"),title:z,style:j?{visibility:"hidden"}:void 0},O.label):null,H)},O=function(e,t){var n=(0,d.useRef)(null),r=(0,d.useRef)(!1),o=e.prefixCls,a=e.open,l=e.mode,u=e.showSearch,c=e.tokenWithEnter,h=e.disabled,f=e.prefix,p=e.autoClearSearchValue,m=e.onSearch,v=e.onSearchSubmit,g=e.onToggleOpen,y=e.onInputKeyDown,b=e.onInputBlur,x=e.domRef;d.useImperativeHandle(t,(function(){return{focus:function(e){n.current.focus(e)},blur:function(){n.current.blur()}}}));var k=w(0),C=(0,s.Z)(k,2),S=C[0],E=C[1],L=(0,d.useRef)(null),A=function(e){!1!==m(e,!0,r.current)&&g(!0)},T={inputRef:n,onInputKeyDown:function(e){var t,i=e.which,o=n.current instanceof HTMLTextAreaElement;(o||!a||i!==_.Z.UP&&i!==_.Z.DOWN||e.preventDefault(),y&&y(e),i!==_.Z.ENTER||"tags"!==l||r.current||a||null==v||v(e.target.value),o&&!a&&~[_.Z.UP,_.Z.DOWN,_.Z.LEFT,_.Z.RIGHT].indexOf(i))||(t=i)&&![_.Z.ESC,_.Z.SHIFT,_.Z.BACKSPACE,_.Z.TAB,_.Z.WIN_KEY,_.Z.ALT,_.Z.META,_.Z.WIN_KEY_RIGHT,_.Z.CTRL,_.Z.SEMICOLON,_.Z.EQUALS,_.Z.CAPS_LOCK,_.Z.CONTEXT_MENU,_.Z.F1,_.Z.F2,_.Z.F3,_.Z.F4,_.Z.F5,_.Z.F6,_.Z.F7,_.Z.F8,_.Z.F9,_.Z.F10,_.Z.F11,_.Z.F12].includes(t)&&g(!0)},onInputMouseDown:function(){E(!0)},onInputChange:function(e){var t=e.target.value;if(c&&L.current&&/[\r\n]/.test(L.current)){var n=L.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");t=t.replace(n,L.current)}L.current=null,A(t)},onInputPaste:function(e){var t=e.clipboardData,n=null==t?void 0:t.getData("text");L.current=n||""},onInputCompositionStart:function(){r.current=!0},onInputCompositionEnd:function(e){r.current=!1,"combobox"!==l&&A(e.target.value)},onInputBlur:b},M="multiple"===l||"tags"===l?d.createElement(P,(0,i.Z)({},e,T)):d.createElement(I,(0,i.Z)({},e,T));return d.createElement("div",{ref:x,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=S();e.target===n.current||t||"combobox"===l&&h||e.preventDefault(),("combobox"===l||u&&t)&&a||(a&&!1!==p&&m("",!0,!1),g())}},f&&d.createElement("div",{className:"".concat(o,"-prefix")},f),M)};var F=d.forwardRef(O),j=n(65030),z=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],H=function(e,t){var n=e.prefixCls,r=(e.disabled,e.visible),s=e.children,u=e.popupElement,c=e.animation,h=e.transitionName,f=e.dropdownStyle,m=e.dropdownClassName,v=e.direction,g=void 0===v?"ltr":v,y=e.placement,b=e.builtinPlacements,x=e.dropdownMatchSelectWidth,w=e.dropdownRender,_=e.dropdownAlign,k=e.getPopupContainer,C=e.empty,S=e.getTriggerDOMNode,E=e.onPopupVisibleChange,L=e.onPopupMouseEnter,A=(0,l.Z)(e,z),T="".concat(n,"-dropdown"),M=u;w&&(M=w(u));var D=d.useMemo((function(){return b||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"}}}(x)}),[b,x]),R=c?"".concat(T,"-").concat(c):h,B="number"==typeof x,N=d.useMemo((function(){return B?null:!1===x?"minWidth":"width"}),[x,B]),P=f;B&&(P=(0,a.Z)((0,a.Z)({},P),{},{width:x}));var I=d.useRef(null);return d.useImperativeHandle(t,(function(){return{getPopupElement:function(){var e;return null===(e=I.current)||void 0===e?void 0:e.popupElement}}})),d.createElement(j.Z,(0,i.Z)({},A,{showAction:E?["click"]:[],hideAction:E?["click"]:[],popupPlacement:y||("rtl"===g?"bottomRight":"bottomLeft"),builtinPlacements:D,prefixCls:T,popupTransitionName:R,popup:d.createElement("div",{onMouseEnter:L},M),ref:I,stretch:N,popupAlign:_,popupVisible:r,getPopupContainer:k,popupClassName:p()(m,(0,o.Z)({},"".concat(T,"-empty"),C)),popupStyle:P,getTriggerDOMNode:S,onPopupVisibleChange:E}),s)};var W=d.forwardRef(H),G=n(66712);function U(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 Z(e){return void 0!==e&&!Number.isNaN(e)}function V(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 q(e){var t=(0,a.Z)({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return(0,h.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}var K=d.createContext(null);function Y(e){var t=e.visible,n=e.values;if(!t)return null;return d.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,u.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},$=d.forwardRef((function(e,t){var n,h=e.id,f=e.prefixCls,x=e.className,_=e.showSearch,k=e.tagRender,C=e.direction,S=e.omitDomProps,E=e.displayValues,L=e.onDisplayValuesChange,A=e.emptyOptions,T=e.notFoundContent,M=void 0===T?"Not Found":T,D=e.onClear,R=e.mode,B=e.disabled,N=e.loading,P=e.getInputElement,I=e.getRawInputElement,O=e.open,j=e.defaultOpen,z=e.onDropdownVisibleChange,H=e.activeValue,U=e.onActiveValueChange,V=e.activeDescendantId,q=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,ue=e.transitionName,ce=e.dropdownStyle,he=e.dropdownClassName,de=e.dropdownMatchSelectWidth,fe=e.dropdownRender,pe=e.dropdownAlign,me=e.placement,ve=e.builtinPlacements,ge=e.getPopupContainer,ye=e.showAction,be=void 0===ye?[]:ye,xe=e.onFocus,we=e.onBlur,_e=e.onKeyUp,ke=e.onKeyDown,Ce=e.onMouseDown,Se=(0,l.Z)(e,X),Ee=Q(R),Le=(void 0!==_?_:Ee)||"combobox"===R,Ae=(0,a.Z)({},Se);J.forEach((function(e){delete Ae[e]})),null==S||S.forEach((function(e){delete Ae[e]}));var Te=d.useState(!1),Me=(0,s.Z)(Te,2),De=Me[0],Re=Me[1];d.useEffect((function(){Re((0,v.Z)())}),[]);var Be=d.useRef(null),Ne=d.useRef(null),Pe=d.useRef(null),Ie=d.useRef(null),Oe=d.useRef(null),Fe=d.useRef(!1),je=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=d.useState(!1),n=(0,s.Z)(t,2),i=n[0],r=n[1],o=d.useRef(null),a=function(){window.clearTimeout(o.current)};return d.useEffect((function(){return a}),[]),[i,function(t,n){a(),o.current=window.setTimeout((function(){r(t),n&&n()}),e)},a]}(),ze=(0,s.Z)(je,3),He=ze[0],We=ze[1],Ge=ze[2];d.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=Oe.current)||void 0===t?void 0:t.scrollTo(e)},nativeElement:Be.current||Ne.current}}));var Ue=d.useMemo((function(){var e;if("combobox"!==R)return q;var t=null===(e=E[0])||void 0===e?void 0:e.value;return"string"==typeof t||"number"==typeof t?String(t):""}),[q,R,E]),Ze="combobox"===R&&"function"==typeof P&&P()||null,Ve="function"==typeof I&&I(),qe=(0,g.x1)(Ne,null==Ve||null===(n=Ve.props)||void 0===n?void 0:n.ref),Ke=d.useState(!1),Ye=(0,s.Z)(Ke,2),Xe=Ye[0],Je=Ye[1];(0,m.Z)((function(){Je(!0)}),[]);var Qe=(0,c.Z)(!1,{defaultValue:j,value:O}),$e=(0,s.Z)(Qe,2),et=$e[0],tt=$e[1],nt=!!Xe&&et,it=!M&&A;(B||it&&nt&&"combobox"===R)&&(nt=!1);var rt=!it&&nt,ot=d.useCallback((function(e){var t=void 0!==e?e:!nt;B||(tt(t),nt!==t&&(null==z||z(t)))}),[B,nt,tt,z]),at=d.useMemo((function(){return(ne||[]).some((function(e){return["\n","\r\n"].includes(e)}))}),[ne]),st=d.useContext(K)||{},lt=st.maxCount,ut=st.rawValues,ct=function(e,t,n){if(!(Ee&&Z(lt)&&(null==ut?void 0:ut.size)>=lt)){var i=!0,o=e;null==U||U(null);var a=function(e,t,n){if(!t||!t.length)return null;var i=!1,o=function e(t,n){var o=(0,G.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,Z(lt)?lt-ut.size:void 0),s=n?null:a;return"combobox"!==R&&s&&(o="",null==te||te(s),ot(!1),i=!1),ee&&Ue!==o&&ee(o,{source:t?"typing":"effect"}),i}};d.useEffect((function(){nt||Ee||"combobox"===R||ct("",!1,!1)}),[nt]),d.useEffect((function(){et&&B&&tt(!1),B&&!Fe.current&&We(!1)}),[B]);var ht=w(),dt=(0,s.Z)(ht,2),ft=dt[0],pt=dt[1],mt=d.useRef(!1),vt=d.useRef(!1),gt=[];d.useEffect((function(){return function(){gt.forEach((function(e){return clearTimeout(e)})),gt.splice(0,gt.length)}}),[]);var yt,bt=d.useState({}),xt=(0,s.Z)(bt,2)[1];Ve&&(yt=function(e){ot(e)}),function(e,t,n,i){var r=d.useRef(null);r.current={open:t,triggerOpen:n,customizedTrigger:i},d.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[Be.current,null===(e=Pe.current)||void 0===e?void 0:e.getPopupElement()]}),rt,ot,!!Ve);var wt,_t=d.useMemo((function(){return(0,a.Z)((0,a.Z)({},e),{},{notFoundContent:M,open:nt,triggerOpen:rt,id:h,showSearch:Le,multiple:Ee,toggleOpen:ot})}),[e,M,rt,nt,h,Le,Ee,ot]),kt=!!oe||N;kt&&(wt=d.createElement(y,{className:p()("".concat(f,"-arrow"),(0,o.Z)({},"".concat(f,"-arrow-loading"),N)),customizeIcon:oe,customizeIconProps:{loading:N,searchValue:Ue,open:nt,focused:He,showSearch:Le}}));var Ct,St=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=d.useMemo((function(){return"object"===(0,u.Z)(i)?i.clearIcon:r||void 0}),[i,r]),c=d.useMemo((function(){return!(o||!i||!n.length&&!a||"combobox"===s&&""===a)}),[i,o,n.length,a,s]);return{allowClear:c,clearIcon:d.createElement(y,{className:"".concat(e,"-clear"),onMouseDown:t,customizeIcon:l},"×")}}(f,(function(){var e;null==D||D(),null===(e=Ie.current)||void 0===e||e.focus(),L([],{type:"clear",values:E}),ct("",!1,!1)}),E,ie,ae,B,Ue,R),Et=St.allowClear,Lt=St.clearIcon,At=d.createElement(se,{ref:Oe}),Tt=p()(f,x,(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(f,"-focused"),He),"".concat(f,"-multiple"),Ee),"".concat(f,"-single"),!Ee),"".concat(f,"-allow-clear"),ie),"".concat(f,"-show-arrow"),kt),"".concat(f,"-disabled"),B),"".concat(f,"-loading"),N),"".concat(f,"-open"),nt),"".concat(f,"-customize-input"),Ze),"".concat(f,"-show-search"),Le)),Mt=d.createElement(W,{ref:Pe,disabled:B,prefixCls:f,visible:rt,popupElement:At,animation:le,transitionName:ue,dropdownStyle:ce,dropdownClassName:he,direction:C,dropdownMatchSelectWidth:de,dropdownRender:fe,dropdownAlign:pe,placement:me,builtinPlacements:ve,getPopupContainer:ge,empty:A,getTriggerDOMNode:function(e){return Ne.current||e},onPopupVisibleChange:yt,onPopupMouseEnter:function(){xt({})}},Ve?d.cloneElement(Ve,{ref:qe}):d.createElement(F,(0,i.Z)({},e,{domRef:Ne,prefixCls:f,inputElement:Ze,ref:Ie,id:h,prefix:re,showSearch:Le,autoClearSearchValue:$,mode:R,activeDescendantId:V,tagRender:k,values:E,open:nt,onToggleOpen:ot,activeValue:H,searchValue:Ue,onSearch:ct,onSearchSubmit:function(e){e&&e.trim()&&ee(e,{source:"submit"})},onRemove:function(e){var t=E.filter((function(t){return t!==e}));L(t,{type:"remove",values:[e]})},tokenWithEnter:at,onInputBlur:function(){mt.current=!1}})));return Ct=Ve?Mt:d.createElement("div",(0,i.Z)({className:Tt},Ae,{ref:Be,onMouseDown:function(e){var t,n=e.target,i=null===(t=Pe.current)||void 0===t?void 0:t.getPopupElement();if(i&&i.contains(n)){var r=setTimeout((function(){var e,t=gt.indexOf(r);-1!==t&>.splice(t,1),Ge(),De||i.contains(document.activeElement)||null===(e=Ie.current)||void 0===e||e.focus()}));gt.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==Ce||Ce.apply(void 0,[e].concat(a))},onKeyDown:function(e){var t,n=ft(),i=e.key,o="Enter"===i;if(o&&("combobox"!==R&&e.preventDefault(),nt||ot(!0)),pt(!!Ue),"Backspace"===i&&!n&&Ee&&!Ue&&E.length){for(var a=(0,r.Z)(E),s=null,l=a.length-1;l>=0;l-=1){var u=a[l];if(!u.disabled){a.splice(l,1),s=u;break}}s&&L(a,{type:"remove",values:[s]})}for(var c=arguments.length,h=new Array(c>1?c-1:0),d=1;d<c;d++)h[d-1]=arguments[d];!nt||o&&mt.current||(o&&(mt.current=!0),null===(t=Oe.current)||void 0===t||t.onKeyDown.apply(t,[e].concat(h))),null==ke||ke.apply(void 0,[e].concat(h))},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=Oe.current)||void 0===r||r.onKeyUp.apply(r,[e].concat(n))),"Enter"===e.key&&(mt.current=!1),null==_e||_e.apply(void 0,[e].concat(n))},onFocus:function(){We(!0),B||(xe&&!vt.current&&xe.apply(void 0,arguments),be.includes("focus")&&ot(!0)),vt.current=!0},onBlur:function(){Fe.current=!0,We(!1,(function(){vt.current=!1,Fe.current=!1,ot(!1)})),B||(Ue&&("tags"===R?ee(Ue,{source:"submit"}):"multiple"===R&&ee("",{source:"blur"})),we&&we.apply(void 0,arguments))}}),d.createElement(Y,{visible:He&&!nt,values:E}),Mt,wt,Et&&Lt),d.createElement(b.Provider,{value:_t},Ct)}));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 ue(e){return"string"==typeof e||"number"==typeof e}var ce=function(e,t){var n=x(),a=n.prefixCls,u=n.id,c=n.open,h=n.multiple,f=n.mode,m=n.searchValue,v=n.toggleOpen,g=n.notFoundContent,b=n.onPopupScroll,w=d.useContext(K),C=w.maxCount,S=w.flattenOptions,E=w.onActiveValue,L=w.defaultActiveFirstOption,A=w.onSelect,T=w.menuItemSelectedIcon,M=w.rawValues,D=w.fieldNames,R=w.virtual,B=w.direction,N=w.listHeight,P=w.listItemHeight,I=w.optionRender,O="".concat(a,"-item"),F=(0,oe.Z)((function(){return S}),[c,S],(function(e,t){return t[0]&&e[1]!==t[1]})),j=d.useRef(null),z=d.useMemo((function(){return h&&Z(C)&&(null==M?void 0:M.size)>=C}),[h,C,null==M?void 0:M.size]),H=function(e){e.preventDefault()},W=function(e){var t;null===(t=j.current)||void 0===t||t.scrollTo("number"==typeof e?{index:e}:e)},G=d.useCallback((function(e){return"combobox"!==f&&M.has(e)}),[f,(0,r.Z)(M).toString(),M.size]),U=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=F.length,i=0;i<n;i+=1){var r=(e+i*t+n)%n,o=F[r]||{},a=o.group,s=o.data;if(!a&&(null==s||!s.disabled)&&(G(s.value)||!z))return r}return-1},V=d.useState((function(){return U(0)})),q=(0,s.Z)(V,2),Y=q[0],X=q[1],J=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];X(e);var n={source:t?"keyboard":"mouse"},i=F[e];i?E(i.value,e,n):E(null,-1,n)};(0,d.useEffect)((function(){J(!1!==L?U(0):-1)}),[F.length,m]);var Q=d.useCallback((function(e){return"combobox"===f?String(e).toLowerCase()===m.toLowerCase():M.has(e)}),[f,m,(0,r.Z)(M).toString(),M.size]);(0,d.useEffect)((function(){var e,t=setTimeout((function(){if(!h&&c&&1===M.size){var e=Array.from(M)[0],t=F.findIndex((function(t){var n=t.data;return m?String(n.value).startsWith(m):n.value===e}));-1!==t&&(J(t),W(t))}}));c&&(null===(e=j.current)||void 0===e||e.scrollTo(void 0));return function(){return clearTimeout(t)}}),[c,m]);var $=function(e){void 0!==e&&A(e,{selected:!M.has(e)}),h||v(!1)};if(d.useImperativeHandle(t,(function(){return{onKeyDown:function(e){var t=e.which,n=e.ctrlKey;switch(t){case _.Z.N:case _.Z.P:case _.Z.UP:case _.Z.DOWN:var i=0;if(t===_.Z.UP?i=-1:t===_.Z.DOWN?i=1:/(mac\sos|macintosh)/i.test(navigator.appVersion)&&n&&(t===_.Z.N?i=1:t===_.Z.P&&(i=-1)),0!==i){var r=U(Y+i,i);W(r),J(r,!0)}break;case _.Z.TAB:case _.Z.ENTER:var o,a=F[Y];!a||null!=a&&null!==(o=a.data)&&void 0!==o&&o.disabled||z?$(void 0):$(a.value),c&&e.preventDefault();break;case _.Z.ESC:v(!1),c&&e.stopPropagation()}},onKeyUp:function(){},scrollTo:function(e){W(e)}}})),0===F.length)return d.createElement("div",{role:"listbox",id:"".concat(u,"_list"),className:"".concat(O,"-empty"),onMouseDown:H},g);var ee=Object.keys(D).map((function(e){return D[e]})),te=function(e){return e.label};function ne(e,t){return{role:e.group?"presentation":"option",id:"".concat(u,"_list_").concat(t)}}var ie=function(e){var t=F[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?d.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(u,"_list")};return d.createElement(d.Fragment,null,R&&d.createElement("div",(0,i.Z)({},re,{style:{height:0,width:0,overflow:"hidden"}}),ie(Y-1),ie(Y),ie(Y+1)),d.createElement(se.Z,{itemKey:"key",ref:j,data:F,height:N,itemHeight:P,fullHeight:!1,onMouseDown:H,onScroll:b,virtual:R,direction:B,innerProps:R?null:re},(function(e,t){var n=e.group,r=e.groupOption,a=e.data,s=e.label,u=e.value,c=a.key;if(n){var h,f=null!==(h=a.title)&&void 0!==h?h:ue(s)?s.toString():void 0;return d.createElement("div",{className:p()(O,"".concat(O,"-group"),a.className),title:f},void 0!==s?s:c)}var m=a.disabled,v=a.title,g=(a.children,a.style),b=a.className,x=(0,l.Z)(a,le),w=(0,ae.Z)(x,ee),_=G(u),C=m||!_&&z,S="".concat(O,"-option"),E=p()(O,S,b,(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},"".concat(S,"-grouped"),r),"".concat(S,"-active"),Y===t&&!C),"".concat(S,"-disabled"),C),"".concat(S,"-selected"),_)),L=te(e),A=!T||"function"==typeof T||_,M="number"==typeof L?L:L||u,D=ue(M)?M.toString():void 0;return void 0!==v&&(D=v),d.createElement("div",(0,i.Z)({},(0,k.Z)(w),R?{}:ne(e,t),{"aria-selected":Q(u),className:E,title:D,onMouseMove:function(){Y===t||C||J(t)},onClick:function(){C||$(u)},style:g}),d.createElement("div",{className:"".concat(S,"-content")},"function"==typeof I?I(e,{index:t}):M),d.isValidElement(T)||_,A&&d.createElement(y,{className:"".concat(O,"-option-state"),customizeIcon:T,customizeIconProps:{value:u,disabled:C,isSelected:_}},_?"✓":null))})))};var he=d.forwardRef(ce);function de(e,t){return T(e).join("").toUpperCase().includes(t)}var fe=n(6551),pe=n(11592),me=["children","value"],ve=["children"];function ge(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,pe.Z)(e).map((function(e,n){if(!d.isValidElement(e)||!e.type)return null;var i=e,r=i.type.isSelectOptGroup,o=i.key,s=i.props,u=s.children,c=(0,l.Z)(s,ve);return t||!r?ge(e):(0,a.Z)((0,a.Z)({key:"__RC_SELECT_GRP__".concat(null===o?n:o,"__"),label:o},c),{},{options:ye(u)})})).filter((function(e){return e}))}var be=function(e,t,n,i,r){return d.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],u=0;u<t.length;u+=1){var c=t[u];!c[n.options]||o?(a.set(c[n.value],c),l(s,c,n.label),l(s,c,i),l(s,c,r)):e(c[n.options],!0)}}(o),{options:o,valueOptions:a,labelOptions:s}}),[e,t,n,i,r])};function xe(e){var t=d.useRef();t.current=e;var n=d.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"],_e=["inputValue"];var ke=d.forwardRef((function(e,t){var n=e.id,h=e.mode,f=e.prefixCls,p=void 0===f?"rc-select":f,m=e.backfill,v=e.fieldNames,g=e.inputValue,y=e.searchValue,b=e.onSearch,x=e.autoClearSearchValue,w=void 0===x||x,_=e.onSelect,k=e.onDeselect,C=e.dropdownMatchSelectWidth,S=void 0===C||C,E=e.filterOption,L=e.filterSort,A=e.optionFilterProp,M=e.optionLabelProp,D=e.options,R=e.optionRender,B=e.children,N=e.defaultActiveFirstOption,P=e.menuItemSelectedIcon,I=e.virtual,O=e.direction,F=e.listHeight,j=void 0===F?200:F,z=e.listItemHeight,H=void 0===z?20:z,W=e.labelRender,G=e.value,Z=e.defaultValue,Y=e.labelInValue,X=e.onChange,J=e.maxCount,$=(0,l.Z)(e,we),te=(0,fe.ZP)(n),ne=Q(h),ie=!(D||!B),re=d.useMemo((function(){return(void 0!==E||"combobox"!==h)&&E}),[E,h]),oe=d.useMemo((function(){return V(v,ie)}),[JSON.stringify(v),ie]),ae=(0,c.Z)("",{value:void 0!==y?y:g,postState:function(e){return e||""}}),se=(0,s.Z)(ae,2),le=se[0],ue=se[1],ce=be(D,B,oe,A,M),pe=ce.valueOptions,me=ce.labelOptions,ve=ce.options,ge=d.useCallback((function(e){return T(e).map((function(e){var t,n,i,r,o,a;(function(e){return!e||"object"!==(0,u.Z)(e)})(e)?t=e:(i=e.key,n=e.label,t=null!==(a=e.value)&&void 0!==a?a:i);var s,l=pe.get(t);l&&(void 0===n&&(n=null==l?void 0:l[M||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,M,pe]),ye=(0,c.Z)(Z,{value:G}),ke=(0,s.Z)(ye,2),Ce=ke[0],Se=ke[1],Ee=d.useMemo((function(){var e,t=ge(ne&&null===Ce?[]:Ce);return"combobox"===h&&function(e){return!e&&0!==e}(null===(e=t[0])||void 0===e?void 0:e.value)?[]:t}),[Ce,ge,h,ne]),Le=function(e,t){var n=d.useRef({values:new Map,options:new Map});return[d.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,u=new Map;return s.forEach((function(e){l.set(e.value,e),u.set(e.value,t.get(e.value)||o.get(e.value))})),n.current.values=l,n.current.options=u,s}),[e,t]),d.useCallback((function(e){return t.get(e)||n.current.options.get(e)}),[t])]}(Ee,pe),Ae=(0,s.Z)(Le,2),Te=Ae[0],Me=Ae[1],De=d.useMemo((function(){if(!h&&1===Te.length){var e=Te[0];if(null===e.value&&(null===e.label||void 0===e.label))return[]}return Te.map((function(e){var t;return(0,a.Z)((0,a.Z)({},e),{},{label:null!==(t="function"==typeof W?W(e):e.label)&&void 0!==t?t:e.value})}))}),[h,Te,W]),Re=d.useMemo((function(){return new Set(Te.map((function(e){return e.value})))}),[Te]);d.useEffect((function(){if("combobox"===h){var e,t=null===(e=Te[0])||void 0===e?void 0:e.value;ue(function(e){return null!=e}(t)?String(t):"")}}),[Te]);var Be=xe((function(e,t){var n=null!=t?t:e;return(0,o.Z)((0,o.Z)({},oe.value,e),oe.label,n)})),Ne=function(e,t,n,i,r){return d.useMemo((function(){if(!n||!1===i)return e;var s=t.options,l=t.label,u=t.value,c=[],h="function"==typeof i,d=n.toUpperCase(),f=h?i:function(e,t){return r?de(t[r],d):t[s]?de(t["children"!==l?l:"label"],d):de(t[u],d)},p=h?function(e){return q(e)}:function(e){return e};return e.forEach((function(e){if(e[s])if(f(n,p(e)))c.push(e);else{var t=e[s].filter((function(e){return f(n,p(e))}));t.length&&c.push((0,a.Z)((0,a.Z)({},e),{},(0,o.Z)({},s,t)))}else f(n,p(e))&&c.push(e)})),c}),[e,i,r,n,t])}(d.useMemo((function(){if("tags"!==h)return ve;var e=(0,r.Z)(ve);return(0,r.Z)(Te).sort((function(e,t){return e.value<t.value?-1:1})).forEach((function(t){var n=t.value;(function(e){return pe.has(e)})(n)||e.push(Be(n,t.label))})),e}),[Be,ve,pe,Te,h]),oe,le,re,A),Pe=d.useMemo((function(){return"tags"!==h||!le||Ne.some((function(e){return e[A||"value"]===le}))||Ne.some((function(e){return e[oe.value]===le}))?Ne:[Be(le)].concat((0,r.Z)(Ne))}),[Be,A,h,Ne,le,oe]),Ie=function e(t){return(0,r.Z)(t).sort((function(e,t){return L(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}))},Oe=d.useMemo((function(){return L?Ie(Pe):Pe}),[Pe,L,le]),Fe=d.useMemo((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.fieldNames,i=t.childrenAsData,r=[],o=V(n,!1),a=o.label,s=o.value,l=o.options,u=o.groupLabel;function c(e,t){Array.isArray(e)&&e.forEach((function(e){if(t||!(l in e)){var n=e[s];r.push({key:U(e,r.length),groupOption:t,data:e,label:e[a],value:n})}else{var o=e[u];void 0===o&&i&&(o=e.label),r.push({key:U(e,r.length),group:!0,data:e,label:o}),c(e[l],!0)}}))}return c(e,!1),r}(Oe,{fieldNames:oe,childrenAsData:ie})}),[Oe,oe,ie]),je=function(e){var t=ge(e);if(Se(t),X&&(t.length!==Te.length||t.some((function(e,t){var n;return(null===(n=Te[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 q(Me(e.value))}));X(ne?n:n[0],ne?i:i[0])}},ze=d.useState(null),He=(0,s.Z)(ze,2),We=He[0],Ge=He[1],Ue=d.useState(0),Ze=(0,s.Z)(Ue,2),Ve=Ze[0],qe=Ze[1],Ke=void 0!==N?N:"combobox"!==h,Ye=d.useCallback((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.source,r=void 0===i?"keyboard":i;qe(t),m&&"combobox"===h&&null!==e&&"keyboard"===r&&Ge(String(e))}),[m,h]),Xe=function(e,t,n){var i=function(){var t,n=Me(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,q(n)]};if(t&&_){var r=i(),o=(0,s.Z)(r,2),a=o[0],l=o[1];_(a,l)}else if(!t&&k&&"clear"!==n){var u=i(),c=(0,s.Z)(u,2),h=c[0],d=c[1];k(h,d)}},Je=xe((function(e,t){var n,i=!ne||t.selected;n=i?ne?[].concat((0,r.Z)(Te),[e]):[e]:Te.filter((function(t){return t.value!==e})),je(n),Xe(e,i),"combobox"===h?Ge(""):Q&&!w||(ue(""),Ge(""))})),Qe=d.useMemo((function(){var e=!1!==I&&!1!==S;return(0,a.Z)((0,a.Z)({},ce),{},{flattenOptions:Fe,onActiveValue:Ye,defaultActiveFirstOption:Ke,onSelect:Je,menuItemSelectedIcon:P,rawValues:Re,fieldNames:oe,virtual:e,direction:O,listHeight:j,listItemHeight:H,childrenAsData:ie,maxCount:J,optionRender:R})}),[J,ce,Fe,Ye,Ke,Je,P,Re,oe,I,S,O,j,H,ie,R]);return d.createElement(K.Provider,{value:Qe},d.createElement(ee,(0,i.Z)({},$,{id:te,prefixCls:p,ref:t,omitDomProps:_e,mode:h,displayValues:De,onDisplayValuesChange:function(e,t){je(e);var n=t.type,i=t.values;"remove"!==n&&"clear"!==n||i.forEach((function(e){Xe(e.value,!1,n)}))},direction:O,searchValue:le,onSearch:function(e,t){if(ue(e),Ge(null),"submit"!==t.source)"blur"!==t.source&&("combobox"===h&&je(e),null==b||b(e));else{var n=(e||"").trim();if(n){var i=Array.from(new Set([].concat((0,r.Z)(Re),[n])));je(i),Xe(n,!0),ue("")}}},autoClearSearchValue:w,onSearchSplit:function(e){var t=e;"tags"!==h&&(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)(Re),(0,r.Z)(t))));je(n),n.forEach((function(e){Xe(e,!0)}))},dropdownMatchSelectWidth:S,OptionList:he,emptyOptions:!Fe.length,activeValue:We,activeDescendantId:"".concat(te,"_list_").concat(Ve)})))}));var Ce=ke;Ce.Option=re,Ce.OptGroup=ne;var Se=Ce},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),u=n.n(l),c=n(18929),h=n(10228),d=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],f=s.forwardRef((function(e,t){var n,l=e.prefixCls,f=void 0===l?"rc-switch":l,p=e.className,m=e.checked,v=e.defaultChecked,g=e.disabled,y=e.loadingIcon,b=e.checkedChildren,x=e.unCheckedChildren,w=e.onClick,_=e.onChange,k=e.onKeyDown,C=(0,a.Z)(e,d),S=(0,c.Z)(!1,{value:m,defaultValue:v}),E=(0,o.Z)(S,2),L=E[0],A=E[1];function T(e,t){var n=L;return g||(A(n=e),null==_||_(n,t)),n}var M=u()(f,p,(n={},(0,r.Z)(n,"".concat(f,"-checked"),L),(0,r.Z)(n,"".concat(f,"-disabled"),g),n));return s.createElement("button",(0,i.Z)({},C,{type:"button",role:"switch","aria-checked":L,disabled:g,className:M,ref:t,onKeyDown:function(e){e.which===h.Z.LEFT?T(!1,e):e.which===h.Z.RIGHT&&T(!0,e),null==k||k(e)},onClick:function(e){var t=T(!L,e);null==w||w(t,e)}}),y,s.createElement("span",{className:"".concat(f,"-inner")},s.createElement("span",{className:"".concat(f,"-inner-checked")},b),s.createElement("span",{className:"".concat(f,"-inner-unchecked")},x)))}));f.displayName="Switch",t.Z=f},22711:function(e,t,n){"use strict";n.r(t),n.d(t,{ResizableTextArea:function(){return L},default:function(){return T}});var i,r=n(54476),o=n(20068),a=n(33885),s=n(94480),l=n(42978),u=n(75931),c=n(92310),h=n.n(c),d=n(36901),f=n(66003),p=n(30292),m=n(18929),v=n(59301),g=n(76190),y=n(29301),b=n(34280),x=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",_=["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 C(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=_.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 S=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],E=v.forwardRef((function(e,t){var n=e,s=n.prefixCls,c=n.defaultValue,d=n.value,f=n.autoSize,p=n.onResize,_=n.className,k=n.style,E=n.disabled,L=n.onChange,A=(n.onInternalAutoSize,(0,u.Z)(n,S)),T=(0,m.Z)(c,{value:d,postState:function(e){return null!=e?e:""}}),M=(0,l.Z)(T,2),D=M[0],R=M[1],B=v.useRef();v.useImperativeHandle(t,(function(){return{textArea:B.current}}));var N=v.useMemo((function(){return f&&"object"===(0,g.Z)(f)?[f.minRows,f.maxRows]:[]}),[f]),P=(0,l.Z)(N,2),I=P[0],O=P[1],F=!!f,j=v.useState(2),z=(0,l.Z)(j,2),H=z[0],W=z[1],G=v.useState(),U=(0,l.Z)(G,2),Z=U[0],V=U[1],q=function(){W(0)};(0,b.Z)((function(){F&&q()}),[d,I,O,F]),(0,b.Z)((function(){if(0===H)W(1);else if(1===H){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=C(e,t),a=o.paddingSize,s=o.borderSize,l=o.boxSizing,u=o.sizingStyle;i.setAttribute("style","".concat(u,";").concat(w)),i.value=e.value||e.placeholder||"";var c,h=void 0,d=void 0,f=i.scrollHeight;if("border-box"===l?f+=s:"content-box"===l&&(f-=a),null!==n||null!==r){i.value=" ";var p=i.scrollHeight-a;null!==n&&(h=p*n,"border-box"===l&&(h=h+a+s),f=Math.max(h,f)),null!==r&&(d=p*r,"border-box"===l&&(d=d+a+s),c=f>d?"":"hidden",f=Math.min(d,f))}var m={height:f,overflowY:c,resize:"none"};return h&&(m.minHeight=h),d&&(m.maxHeight=d),m}(B.current,!1,I,O);W(2),V(e)}else!function(){try{if(document.activeElement===B.current){var e=B.current,t=e.selectionStart,n=e.selectionEnd,i=e.scrollTop;B.current.setSelectionRange(t,n),B.current.scrollTop=i}}catch(e){}}()}),[H]);var K=v.useRef(),Y=function(){x.Z.cancel(K.current)};v.useEffect((function(){return Y}),[]);var X=F?Z:null,J=(0,a.Z)((0,a.Z)({},k),X);return 0!==H&&1!==H||(J.overflowY="hidden",J.overflowX="hidden"),v.createElement(y.Z,{onResize:function(e){2===H&&(null==p||p(e),f&&(Y(),K.current=(0,x.Z)((function(){q()}))))},disabled:!(f||p)},v.createElement("textarea",(0,r.Z)({},A,{ref:B,style:J,className:h()(s,_,(0,o.Z)({},"".concat(s,"-disabled"),E)),disabled:E,value:D,onChange:function(e){R(e.target.value),null==L||L(e)}})))})),L=E,A=["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"],T=v.forwardRef((function(e,t){var n,i=e.defaultValue,c=e.value,g=e.onFocus,y=e.onBlur,b=e.onChange,x=e.allowClear,w=e.maxLength,_=e.onCompositionStart,k=e.onCompositionEnd,C=e.suffix,S=e.prefixCls,E=void 0===S?"rc-textarea":S,T=e.showCount,M=e.count,D=e.className,R=e.style,B=e.disabled,N=e.hidden,P=e.classNames,I=e.styles,O=e.onResize,F=e.onClear,j=e.onPressEnter,z=e.readOnly,H=e.autoSize,W=e.onKeyDown,G=(0,u.Z)(e,A),U=(0,m.Z)(i,{value:c,defaultValue:i}),Z=(0,l.Z)(U,2),V=Z[0],q=Z[1],K=null==V?"":String(V),Y=v.useState(!1),X=(0,l.Z)(Y,2),J=X[0],Q=X[1],$=v.useRef(!1),ee=v.useState(null),te=(0,l.Z)(ee,2),ne=te[0],ie=te[1],re=(0,v.useRef)(null),oe=(0,v.useRef)(null),ae=function(){var e;return null===(e=oe.current)||void 0===e?void 0:e.textArea},se=function(){ae().focus()};(0,v.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,v.useEffect)((function(){Q((function(e){return!B&&e}))}),[B]);var le=v.useState(null),ue=(0,l.Z)(le,2),ce=ue[0],he=ue[1];v.useEffect((function(){var e;ce&&(e=ae()).setSelectionRange.apply(e,(0,s.Z)(ce))}),[ce]);var de,fe=(0,f.Z)(M,T),pe=null!==(n=fe.max)&&void 0!==n?n:w,me=Number(pe)>0,ve=fe.strategy(K),ge=!!pe&&ve>pe,ye=function(e,t){var n=t;!$.current&&fe.exceedFormatter&&fe.max&&fe.strategy(t)>fe.max&&t!==(n=fe.exceedFormatter(t,{max:fe.max}))&&he([ae().selectionStart||0,ae().selectionEnd||0]),q(n),(0,p.rJ)(e.currentTarget,e,b,n)},be=C;fe.show&&(de=fe.showFormatter?fe.showFormatter({value:K,count:ve,maxLength:pe}):"".concat(ve).concat(me?" / ".concat(pe):""),be=v.createElement(v.Fragment,null,be,v.createElement("span",{className:h()("".concat(E,"-data-count"),null==P?void 0:P.count),style:null==I?void 0:I.count},de)));var xe=!H&&!T&&!x;return v.createElement(d.BaseInput,{ref:re,value:K,allowClear:x,handleReset:function(e){q(""),se(),(0,p.rJ)(ae(),e,b)},suffix:be,prefixCls:E,classNames:(0,a.Z)((0,a.Z)({},P),{},{affixWrapper:h()(null==P?void 0:P.affixWrapper,(0,o.Z)((0,o.Z)({},"".concat(E,"-show-count"),T),"".concat(E,"-textarea-allow-clear"),x))}),disabled:B,focused:J,className:h()(D,ge&&"".concat(E,"-out-of-range")),style:(0,a.Z)((0,a.Z)({},R),ne&&!xe?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":"string"==typeof de?de:void 0}},hidden:N,readOnly:z,onClear:F},v.createElement(L,(0,r.Z)({},G,{autoSize:H,maxLength:w,onKeyDown:function(e){"Enter"===e.key&&j&&j(e),null==W||W(e)},onChange:function(e){ye(e,e.target.value)},onFocus:function(e){Q(!0),null==g||g(e)},onBlur:function(e){Q(!1),null==y||y(e)},onCompositionStart:function(e){$.current=!0,null==_||_(e)},onCompositionEnd:function(e){$.current=!1,ye(e,e.currentTarget.value),null==k||k(e)},className:h()(null==P?void 0:P.textarea),style:(0,a.Z)((0,a.Z)({},null==I?void 0:I.textarea),{},{resize:null==R?void 0:R.resize}),disabled:B,prefixCls:E,onResize:function(e){var t;null==O||O(e),null!==(t=ae())&&void 0!==t&&t.style.height&&ie(!0)},ref:oe,readOnly:z})))}))},48911:function(e,t,n){"use strict";n.d(t,{Z:function(){return F}});var i=n(54476),r=n(76190),o=n(33885),a=n(20068),s=n(42978),l=n(75931),u=n(92310),c=n.n(u),h=n(29301),d=n(70425),f=n(34280),p=n(59301),m=n(4676),v=p.forwardRef((function(e,t){var n=e.height,r=e.offsetY,s=e.offsetX,l=e.children,u=e.prefixCls,d=e.onInnerResize,f=e.innerProps,m=e.rtl,v=e.extra,g={},y={display:"flex",flexDirection:"column"};return void 0!==r&&(g={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))),p.createElement("div",{style:g},p.createElement(h.Z,{onResize:function(e){e.offsetHeight&&d&&d()}},p.createElement("div",(0,i.Z)({style:y,className:c()((0,a.Z)({},"".concat(u,"-holder-inner"),u)),ref:t},f),l,v)))}));v.displayName="Filler";var g=v;function y(e){var t=e.children,n=e.setRef,i=p.useCallback((function(e){n(e)}),[]);return p.cloneElement(t,{ref:i})}function b(e,t,n){var i=p.useState(e),r=(0,s.Z)(i,2),o=r[0],a=r[1],l=p.useState(null),u=(0,s.Z)(l,2),c=u[0],h=u[1];return p.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 u=null,c=1!==Math.abs(o-a),h=0;h<r.length;h+=1){var d=l(i[h]);if(d!==l(r[h])){u=h,c=c||d!==l(r[h+1]);break}}return null===u?null:{index:u,multiple:c}}(o||[],e||[],t);void 0!==(null==i?void 0:i.index)&&(null==n||n(i.index),h(e[i.index])),a(e)}),[e]),[c]}var x=n(16089),w="object"===("undefined"==typeof navigator?"undefined":(0,r.Z)(navigator))&&/Firefox/i.test(navigator.userAgent),_=function(e,t,n,i){var r=(0,p.useRef)(!1),o=(0,p.useRef)(null);function a(){clearTimeout(o.current),r.current=!0,o.current=setTimeout((function(){r.current=!1}),50)}var s=(0,p.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,p.useRef)(0),l=(0,p.useRef)(null),u=(0,p.useRef)(null),c=(0,p.useRef)(!1),h=_(t,n,i,r);var d=(0,p.useRef)(null),f=(0,p.useRef)(null);return[function(t){if(e){x.Z.cancel(f.current),f.current=(0,x.Z)((function(){d.current=null}),2);var n=t.deltaX,i=t.deltaY,r=t.shiftKey,p=n,m=i;("sx"===d.current||!d.current&&r&&i&&!n)&&(p=i,m=0,d.current="sx");var v=Math.abs(p),g=Math.abs(m);null===d.current&&(d.current=o&&v>g?"x":"y"),"y"===d.current?function(e,t){if(x.Z.cancel(l.current),!h(!1,t)){var n=e;n._virtualHandled||(n._virtualHandled=!0,s.current+=t,u.current=t,w||n.preventDefault(),l.current=(0,x.Z)((function(){var e=c.current?10:1;a(s.current*e,!1),s.current=0})))}}(t,m):function(e,t){a(t,!0),w||e.preventDefault()}(t,p)}},function(t){e&&(c.current=t.detail===u.current)}]}var C=n(67732),S=n(83652),E=function(){function e(){(0,C.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,S.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 L(e){var t=parseFloat(e);return isNaN(t)?0:t}var A=14/15;function T(e){return Math.floor(Math.pow(e,.5))}function M(e,t){return("touches"in e?e.touches[0]:e)[t?"pageX":"pageY"]-window[t?"scrollX":"scrollY"]}var D=p.forwardRef((function(e,t){var n=e.prefixCls,i=e.rtl,r=e.scrollOffset,l=e.scrollRange,u=e.onStartMove,h=e.onStopMove,d=e.onScroll,f=e.horizontal,m=e.spinSize,v=e.containerSize,g=e.style,y=e.thumbStyle,b=e.showScrollBar,w=p.useState(!1),_=(0,s.Z)(w,2),k=_[0],C=_[1],S=p.useState(null),E=(0,s.Z)(S,2),L=E[0],A=E[1],T=p.useState(null),D=(0,s.Z)(T,2),R=D[0],B=D[1],N=!i,P=p.useRef(),I=p.useRef(),O=p.useState(b),F=(0,s.Z)(O,2),j=F[0],z=F[1],H=p.useRef(),W=function(){!0!==b&&!1!==b&&(clearTimeout(H.current),z(!0),H.current=setTimeout((function(){z(!1)}),3e3))},G=l-v||0,U=v-m||0,Z=p.useMemo((function(){return 0===r||0===G?0:r/G*U}),[r,G,U]),V=p.useRef({top:Z,dragging:k,pageY:L,startTop:R});V.current={top:Z,dragging:k,pageY:L,startTop:R};var q=function(e){C(!0),A(M(e,f)),B(V.current.top),u(),e.stopPropagation(),e.preventDefault()};p.useEffect((function(){var e=function(e){e.preventDefault()},t=P.current,n=I.current;return t.addEventListener("touchstart",e,{passive:!1}),n.addEventListener("touchstart",q,{passive:!1}),function(){t.removeEventListener("touchstart",e),n.removeEventListener("touchstart",q)}}),[]);var K=p.useRef();K.current=G;var Y=p.useRef();Y.current=U,p.useEffect((function(){if(k){var e,t=function(t){var n=V.current,i=n.dragging,r=n.pageY,o=n.startTop;x.Z.cancel(e);var a=P.current.getBoundingClientRect(),s=v/(f?a.width:a.height);if(i){var l=(M(t,f)-r)*s,u=o;!N&&f?u-=l:u+=l;var c=K.current,h=Y.current,p=h?u/h:0,m=Math.ceil(p*c);m=Math.max(m,0),m=Math.min(m,c),e=(0,x.Z)((function(){d(m,f)}))}},n=function(){C(!1),h()};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),x.Z.cancel(e)}}}),[k]),p.useEffect((function(){return W(),function(){clearTimeout(H.current)}}),[r]),p.useImperativeHandle(t,(function(){return{delayHidden:W}}));var X="".concat(n,"-scrollbar"),J={position:"absolute",visibility:j?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 f?(Object.assign(J,{height:8,left:0,right:0,bottom:0}),Object.assign(Q,(0,a.Z)({height:"100%",width:m},N?"left":"right",Z))):(Object.assign(J,(0,a.Z)({width:8,top:0,bottom:0},N?"right":"left",0)),Object.assign(Q,{width:"100%",height:m,top:Z})),p.createElement("div",{ref:P,className:c()(X,(0,a.Z)((0,a.Z)((0,a.Z)({},"".concat(X,"-horizontal"),f),"".concat(X,"-vertical"),!f),"".concat(X,"-visible"),j)),style:(0,o.Z)((0,o.Z)({},J),g),onMouseDown:function(e){e.stopPropagation(),e.preventDefault()},onMouseMove:W},p.createElement("div",{ref:I,className:c()("".concat(X,"-thumb"),(0,a.Z)({},"".concat(X,"-thumb-moving"),k)),style:(0,o.Z)((0,o.Z)({},Q),y),onMouseDown:q}))}));function R(){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 B=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],N=[],P={overflowY:"auto",overflowAnchor:"none"};function I(e,t){var n=e.prefixCls,u=void 0===n?"rc-virtual-list":n,v=e.className,w=e.height,C=e.itemHeight,S=e.fullHeight,I=void 0===S||S,O=e.style,F=e.data,j=e.children,z=e.itemKey,H=e.virtual,W=e.direction,G=e.scrollWidth,U=e.component,Z=void 0===U?"div":U,V=e.onScroll,q=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,B),te=p.useCallback((function(e){return"function"==typeof z?z(e):null==e?void 0:e[z]}),[z]),ne=function(e,t,n){var i=p.useState(0),r=(0,s.Z)(i,2),o=r[0],a=r[1],l=(0,p.useRef)(new Map),u=(0,p.useRef)(new E),c=(0,p.useRef)(0);function h(){c.current+=1}function d(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];h();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+L(o)+L(a);u.current.get(n)!==s&&(u.current.set(n,s),e=!0)}})),e&&a((function(e){return e+1}))};if(e)t();else{c.current+=1;var n=c.current;Promise.resolve().then((function(){n===c.current&&t()}))}}return(0,p.useEffect)((function(){return h}),[]),[function(i,r){var o=e(i),a=l.current.get(o);r?(l.current.set(o,r),d()):l.current.delete(o),!a!=!r&&(r?null==t||t(i):null==n||n(i))},d,u.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===H||!w||!C),ue=p.useMemo((function(){return Object.values(ae.maps).reduce((function(e,t){return e+t}),0)}),[ae.id,ae.maps]),ce=le&&F&&(Math.max(C*F.length,ue)>w||!!G),he="rtl"===W,de=c()(u,(0,a.Z)({},"".concat(u,"-rtl"),he),v),fe=F||N,pe=(0,p.useRef)(),me=(0,p.useRef)(),ve=(0,p.useRef)(),ge=(0,p.useState)(0),ye=(0,s.Z)(ge,2),be=ye[0],xe=ye[1],we=(0,p.useState)(0),_e=(0,s.Z)(we,2),ke=_e[0],Ce=_e[1],Se=(0,p.useState)(!1),Ee=(0,s.Z)(Se,2),Le=Ee[0],Ae=Ee[1],Te=function(){Ae(!0)},Me=function(){Ae(!1)},De={getKey:te};function Re(e){xe((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 pe.current.scrollTop=n,n}))}var Be=(0,p.useRef)({start:0,end:fe.length}),Ne=(0,p.useRef)(),Pe=b(fe,te),Ie=(0,s.Z)(Pe,1)[0];Ne.current=Ie;var Oe=p.useMemo((function(){if(!le)return{scrollHeight:void 0,start:0,end:fe.length-1,offset:void 0};var e;if(!ce)return{scrollHeight:(null===(e=me.current)||void 0===e?void 0:e.offsetHeight)||0,start:0,end:fe.length-1,offset:void 0};for(var t,n,i,r=0,o=fe.length,a=0;a<o;a+=1){var s=fe[a],l=te(s),u=ae.get(l),c=r+(void 0===u?C:u);c>=be&&void 0===t&&(t=a,n=r),c>be+w&&void 0===i&&(i=a),r=c}return void 0===t&&(t=0,n=0,i=Math.ceil(w/C)),void 0===i&&(i=fe.length-1),{scrollHeight:r,start:t,end:i=Math.min(i+1,fe.length-1),offset:n}}),[ce,le,be,fe,se,w]),Fe=Oe.scrollHeight,je=Oe.start,ze=Oe.end,He=Oe.offset;Be.current.start=je,Be.current.end=ze,p.useLayoutEffect((function(){var e=ae.getRecord();if(1===e.size){var t=Array.from(e.keys())[0],n=e.get(t),i=fe[je];if(i&&void 0===n)if(te(i)===t){var r=ae.get(t)-C;Re((function(e){return e+r}))}}ae.resetRecord()}),[Fe]);var We=p.useState({width:0,height:w}),Ge=(0,s.Z)(We,2),Ue=Ge[0],Ze=Ge[1],Ve=(0,p.useRef)(),qe=(0,p.useRef)(),Ke=p.useMemo((function(){return R(Ue.width,G)}),[Ue.width,G]),Ye=p.useMemo((function(){return R(Ue.height,Fe)}),[Ue.height,Fe]),Xe=Fe-w,Je=(0,p.useRef)(Xe);Je.current=Xe;var Qe=be<=0,$e=be>=Xe,et=ke<=0,tt=ke>=G,nt=_(Qe,$e,et,tt),it=function(){return{x:he?-ke:ke,y:be}},rt=(0,p.useRef)(it()),ot=(0,d.zX)((function(e){if(q){var t=(0,o.Z)((0,o.Z)({},it()),e);rt.current.x===t.x&&rt.current.y===t.y||(q(t),rt.current=t)}}));function at(e,t){var n=e;t?((0,m.flushSync)((function(){Ce(n)})),ot()):Re(n)}var st=function(e){var t=e,n=G?G-Ue.width:0;return t=Math.max(t,0),t=Math.min(t,n)},lt=(0,d.zX)((function(e,t){t?((0,m.flushSync)((function(){Ce((function(t){return st(t+(he?-e:e))}))})),ot()):Re((function(t){return t+e}))})),ut=k(le,Qe,$e,et,tt,!!G,lt),ct=(0,s.Z)(ut,2),ht=ct[0],dt=ct[1];!function(e,t,n){var i,r=(0,p.useRef)(!1),o=(0,p.useRef)(0),a=(0,p.useRef)(0),s=(0,p.useRef)(null),l=(0,p.useRef)(null),u=function(e){if(r.current){var t=Math.ceil(e.touches[0].pageX),i=Math.ceil(e.touches[0].pageY),s=o.current-t,u=a.current-i,c=Math.abs(s)>Math.abs(u);c?o.current=t:a.current=i;var h=n(c,c?s:u,!1,e);h&&e.preventDefault(),clearInterval(l.current),h&&(l.current=setInterval((function(){c?s*=A:u*=A;var e=Math.floor(c?s:u);(!n(c,e,!0)||Math.abs(e)<=.1)&&clearInterval(l.current)}),16))}},c=function(){r.current=!1,i()},h=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",u,{passive:!1}),s.current.addEventListener("touchend",c,{passive:!0}))};i=function(){s.current&&(s.current.removeEventListener("touchmove",u),s.current.removeEventListener("touchend",c))},(0,f.Z)((function(){return e&&t.current.addEventListener("touchstart",h,{passive:!0}),function(){var e;null===(e=t.current)||void 0===e||e.removeEventListener("touchstart",h),i(),clearInterval(l.current)}}),[e])}(le,pe,(function(e,t,n,i){var r=i;return!nt(e,t,n)&&((!r||!r._virtualHandled)&&(r&&(r._virtualHandled=!0),ht({preventDefault:function(){},deltaX:e?t:0,deltaY:e?0:t}),!0))})),function(e,t,n){p.useEffect((function(){var i=t.current;if(e&&i){var r,o,a=!1,s=function(){x.Z.cancel(r)},l=function e(){s(),r=(0,x.Z)((function(){n(o),e()}))},u=function(){a=!1,s()},c=function(e){if(!e.target.draggable&&0===e.button){var t=e;t._virtualHandled||(t._virtualHandled=!0,a=!0)}},h=function(e){if(a){var t=M(e,!1),n=i.getBoundingClientRect(),r=n.top,u=n.bottom;t<=r?(o=-T(r-t),l()):t>=u?(o=T(t-u),l()):s()}};return i.addEventListener("mousedown",c),i.ownerDocument.addEventListener("mouseup",u),i.ownerDocument.addEventListener("mousemove",h),i.ownerDocument.addEventListener("dragend",u),function(){i.removeEventListener("mousedown",c),i.ownerDocument.removeEventListener("mouseup",u),i.ownerDocument.removeEventListener("mousemove",h),i.ownerDocument.removeEventListener("dragend",u),s()}}}),[e])}(ce,pe,(function(e){Re((function(t){return t+e}))})),(0,f.Z)((function(){function e(e){var t=Qe&&e.detail<0,n=$e&&e.detail>0;!le||t||n||e.preventDefault()}var t=pe.current;return t.addEventListener("wheel",ht,{passive:!1}),t.addEventListener("DOMMouseScroll",dt,{passive:!0}),t.addEventListener("MozMousePixelScroll",e,{passive:!1}),function(){t.removeEventListener("wheel",ht),t.removeEventListener("DOMMouseScroll",dt),t.removeEventListener("MozMousePixelScroll",e)}}),[le,Qe,$e]),(0,f.Z)((function(){if(G){var e=st(ke);Ce(e),ot({x:e})}}),[Ue.width,G]);var ft=function(){var e,t;null===(e=Ve.current)||void 0===e||e.delayHidden(),null===(t=qe.current)||void 0===t||t.delayHidden()},pt=function(e,t,n,i,a,l,u,c){var h=p.useRef(),d=p.useState(null),m=(0,s.Z)(d,2),v=m[0],g=m[1];return(0,f.Z)((function(){if(v&&v.times<10){if(!e.current)return void g((function(e){return(0,o.Z)({},e)}));l();var r=v.targetAlign,s=v.originAlign,c=v.index,h=v.offset,d=e.current.clientHeight,f=!1,p=r,m=null;if(d){for(var y=r||s,b=0,x=0,w=0,_=Math.min(t.length-1,c),k=0;k<=_;k+=1){var C=a(t[k]);x=b;var S=n.get(C);b=w=x+(void 0===S?i:S)}for(var E="top"===y?h:d-h,L=_;L>=0;L-=1){var A=a(t[L]),T=n.get(A);if(void 0===T){f=!0;break}if((E-=T)<=0)break}switch(y){case"top":m=x-h;break;case"bottom":m=w-d+h;break;default:var M=e.current.scrollTop;x<M?p="top":w>M+d&&(p="bottom")}null!==m&&u(m),m!==v.lastTop&&(f=!0)}f&&g((0,o.Z)((0,o.Z)({},v),{},{times:v.times+1,targetAlign:p,lastTop:m}))}}),[v,e.current]),function(e){if(null!=e){if(x.Z.cancel(h.current),"number"==typeof e)u(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;g({times:0,index:n,offset:void 0===o?0:o,originAlign:i})}}else c()}}(pe,fe,ae,C,te,(function(){return oe(!0)}),Re,ft);p.useImperativeHandle(t,(function(){return{nativeElement:ve.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&&Ce(st(e.left)),pt(e.top)):pt(e)}}})),(0,f.Z)((function(){if(K){var e=fe.slice(je,ze+1);K(e,fe)}}),[je,ze,fe]);var mt=function(e,t,n,i){var r=p.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),u=a.get(o);if(void 0===s||void 0===u)for(var c=e.length,h=l.length;h<c;h+=1){var d,f=e[h],p=t(f);a.set(p,h);var m=null!==(d=n.get(p))&&void 0!==d?d:i;if(l[h]=(l[h-1]||0)+m,p===r&&(s=h),p===o&&(u=h),void 0!==s&&void 0!==u)break}return{top:l[s-1]||0,bottom:l[u]}}}(fe,te,ae,C),vt=null==X?void 0:X({start:je,end:ze,virtual:ce,offsetX:ke,offsetY:He,rtl:he,getSize:mt}),gt=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}),u=l(e);return p.createElement(y,{key:u,setRef:function(t){return o(e,t)}},s)}))}(fe,je,ze,G,ke,re,j,De),yt=null;w&&(yt=(0,o.Z)((0,a.Z)({},I?"height":"maxHeight",w),P),le&&(yt.overflowY="hidden",G&&(yt.overflowX="hidden"),Le&&(yt.pointerEvents="none")));var bt={};return he&&(bt.dir="rtl"),p.createElement("div",(0,i.Z)({ref:ve,style:(0,o.Z)((0,o.Z)({},O),{},{position:"relative"}),className:de},bt,ee),p.createElement(h.Z,{onResize:function(e){Ze({width:e.offsetWidth,height:e.offsetHeight})}},p.createElement(Z,{className:"".concat(u,"-holder"),style:yt,ref:pe,onScroll:function(e){var t=e.currentTarget.scrollTop;t!==be&&Re(t),null==V||V(e),ot()},onMouseEnter:ft},p.createElement(g,{prefixCls:u,height:Fe,offsetX:ke,offsetY:He,scrollWidth:G,onInnerResize:oe,ref:me,innerProps:Y,rtl:he,extra:vt},gt))),ce&&Fe>w&&p.createElement(D,{ref:Ve,prefixCls:u,scrollOffset:be,scrollRange:Fe,rtl:he,onScroll:at,onStartMove:Te,onStopMove:Me,spinSize:Ye,containerSize:Ue.height,style:null==J?void 0:J.verticalScrollBar,thumbStyle:null==J?void 0:J.verticalScrollBarThumb,showScrollBar:$}),ce&&G>Ue.width&&p.createElement(D,{ref:qe,prefixCls:u,scrollOffset:ke,scrollRange:G,rtl:he,onScroll:at,onStartMove:Te,onStopMove:Me,spinSize:Ke,containerSize:Ue.width,horizontal:!0,style:null==J?void 0:J.horizontalScrollBar,thumbStyle:null==J?void 0:J.horizontalScrollBarThumb,showScrollBar:$}))}var O=p.forwardRef(I);O.displayName="List";var F=O},82059:function(e){var t=arguments[3],n=arguments[4],i=arguments[5],r=JSON.stringify;e.exports=function(e,o){for(var a,s=Object.keys(i),l=0,u=s.length;l<u;l++){var c=s[l],h=i[c].exports;if(h===e||h&&h.default===e){a=c;break}}if(!a){a=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var d={};for(l=0,u=s.length;l<u;l++){d[c=s[l]]=c}n[a]=["function(require,module,exports){"+e+"(self); }",d]}var f=Math.floor(Math.pow(16,8)*Math.random()).toString(16),p={};p[a]=a,n[f]=["function(require,module,exports){var f = require("+r(a)+");(f.default ? f.default : f)(self);}",p];var m={};!function e(t){for(var i in m[t]=!0,n[t][1]){var r=n[t][1][i];m[r]||e(r)}}(f);var v="("+t+")({"+Object.keys(m).map((function(e){return r(e)+":["+n[e][0]+","+r(n[e][1])+"]"})).join(",")+"},{},["+r(f)+"])",g=window.URL||window.webkitURL||window.mozURL||window.msURL,y=new Blob([v],{type:"text/javascript"});if(o&&o.bare)return y;var b=g.createObjectURL(y),x=new Worker(b);return x.objectURL=b,x}},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=="},4811:function(e,t,n){var i=n(22652);function r(){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=r=Reflect.get.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=r=function(e,t,n){var r=i(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},e.exports.__esModule=!0,e.exports.default=e.exports),r.apply(this,arguments)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},22652:function(e,t,n){var i=n(34577);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=i(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},16722:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});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,u;if("undefined"==typeof document)return[];const{scrollMode:c,block:h,inline:d,boundary:f,skipOverflowHiddenElements:p}=t,m="function"==typeof f?f:e=>e!==f;if(!i(e))throw new TypeError("Invalid target");const v=document.scrollingElement||document.documentElement,g=[];let y=e;for(;i(y)&&m(y);){if(y=s(y),y===v){g.push(y);break}null!=y&&y===document.body&&o(y)&&!o(document.documentElement)||null!=y&&o(y,p)&&g.push(y)}const b=null!=(r=null==(n=window.visualViewport)?void 0:n.width)?r:innerWidth,x=null!=(u=null==(l=window.visualViewport)?void 0:l.height)?u:innerHeight,{scrollX:w,scrollY:_}=window,{height:k,width:C,top:S,right:E,bottom:L,left:A}=e.getBoundingClientRect(),{top:T,right:M,bottom:D,left:R}=(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 B="start"===h||"nearest"===h?S-T:"end"===h?L+D:S+k/2-T+D,N="center"===d?A+C/2-R+M:"end"===d?E+M:A-R;const P=[];for(let e=0;e<g.length;e++){const t=g[e],{height:n,width:i,top:r,right:s,bottom:l,left:u}=t.getBoundingClientRect();if("if-needed"===c&&S>=0&&A>=0&&L<=x&&E<=b&&(t===v&&!o(t)||S>=r&&L<=l&&A>=u&&E<=s))return P;const f=getComputedStyle(t),p=parseInt(f.borderLeftWidth,10),m=parseInt(f.borderTopWidth,10),y=parseInt(f.borderRightWidth,10),T=parseInt(f.borderBottomWidth,10);let M=0,D=0;const R="offsetWidth"in t?t.offsetWidth-t.clientWidth-p-y:0,I="offsetHeight"in t?t.offsetHeight-t.clientHeight-m-T:0,O="offsetWidth"in t?0===t.offsetWidth?0:i/t.offsetWidth:0,F="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(v===t)M="start"===h?B:"end"===h?B-x:"nearest"===h?a(_,_+x,x,m,T,_+B,_+B+k,k):B-x/2,D="start"===d?N:"center"===d?N-b/2:"end"===d?N-b:a(w,w+b,b,p,y,w+N,w+N+C,C),M=Math.max(0,M+_),D=Math.max(0,D+w);else{M="start"===h?B-r-m:"end"===h?B-l+T+I:"nearest"===h?a(r,l,n,m,T+I,B,B+k,k):B-(r+n/2)+I/2,D="start"===d?N-u-p:"center"===d?N-(u+i/2)+R/2:"end"===d?N-s+y+R:a(u,s,i,p,y+R,N,N+C,C);const{scrollLeft:e,scrollTop:o}=t;M=0===F?0:Math.max(0,Math.min(o+M/F,t.scrollHeight-n/F+I)),D=0===O?0:Math.max(0,Math.min(e+D/O,t.scrollWidth-i/O+R)),B+=o-M,N+=e-D}P.push({el:t,top:M,left:D})}return P};function u(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})}}}}]); |