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

33 lines
86 KiB

(self.webpackChunk=self.webpackChunk||[]).push([[1298],{2901:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(){if(typeof window.GGBApplet=="function"){console.warn("deployggb.js was loaded twice");return}var isRenderGGBElementEnabled=!1,scriptLoadStarted=!1,html5AppletsToProcess=null,ggbHTML5LoadedCodebaseIsWebSimple=!1,ggbHTML5LoadedCodebaseVersion=null,ggbHTML5LoadedScript=null,GGBApplet=function(){"use strict";for(var ae={},Ae="5.0",z={},y=null,Me=!1,Le=!1,Ce=null,te=!1,de=null,be=null,Ee=0;Ee<arguments.length;Ee++){var pe=arguments[Ee];if(pe!==null)switch(typeof pe){case"number":Ae=pe.toFixed(1);break;case"string":pe.match(new RegExp("^[0-9]\\.[0-9]+$"))?Ae=pe:Ce=pe;break;case"object":typeof pe.is3D!="undefined"?y=pe:z=pe;break;case"boolean":Me=pe,Le=!0;break}}y===null&&(y={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},z.material_id!==void 0&&!Le&&(Me=!0)),Ce!==null&&z.id===void 0&&(z.id=Ce);var _e="",Fe="",Be=!1,ye=null,ke=null,Xe=null,Ue=!1,Qe=null,tt=null,nt=null,Ne=null,$e=null;z.height!==void 0&&(z.height=Math.round(z.height)),z.width!==void 0&&(z.width=Math.round(z.width));var Ge=function(ee){return parseFloat(ee)>4?parseFloat(ee):5};ae.setHTML5Codebase=function(ee,ie){be=ee,Ht(ee,ie)},ae.setJavaCodebase=ae.setJavaCodebaseVersion=ae.isCompiledInstalled=ae.setPreCompiledScriptPath=ae.setPreCompiledResourcePath=function(){},ae.setHTML5CodebaseVersion=function(ee,ie){var ce=parseFloat(ee);if(ce!==NaN&&ce<5){console.log("The GeoGebra HTML5 codebase version "+ce+" is deprecated. Using version latest instead.");return}de=ee,tn(ee,ie)},ae.getHTML5CodebaseVersion=function(){return ke},ae.getParameters=function(){return z},ae.setFontsCSSURL=function(ee){Ne=ee},ae.setGiacJSURL=function(ee){},ae.setJNLPFile=function(ee){_e=ee},ae.setJNLPBaseDir=function(ee){},ae.inject=function(){function ee(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var ie="auto",ce=z.id,Oe,a=!1,ue=0;ue<arguments.length;ue++){var Te=arguments[ue];typeof Te=="string"?(Te=Te.toLowerCase(),Te.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?ie=Te:ce=arguments[ue]):typeof Te=="boolean"?a=Te:Te instanceof HTMLElement&&(Oe=Te)}He();function He(){if(!te){setTimeout(He,200);return}ie=gn(ie);var We=Oe||document.getElementById(ce);if(!We){console.log("possibly bug on ajax loading? ");return}if(ae.removeExistingApplet(We,!1),z.width===void 0&&We.clientWidth&&(z.width=We.clientWidth),z.height===void 0&&We.clientHeight&&(z.height=We.clientHeight),!(z.width&&z.height)&&ie==="html5"&&(delete z.width,delete z.height),ye=ie,ie==="screenshot")bt(We,z);else{var st=!1;z.hasOwnProperty("playButton")&&z.playButton||z.hasOwnProperty("clickToLoad")&&z.clickToLoad?st=!0:z.hasOwnProperty("playButtonAutoDecide")&&z.playButtonAutoDecide&&(st=(!xe()||ee())&&Pe()),st?(ye="screenshot",Et(We,z,a,ie)):ct(We,z,a)}}};function xe(){try{return window.self!==window.top}catch(ee){return!0}}function Pe(){return z.hasOwnProperty("screenshotGenerator")&&z.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}ae.getViews=function(){return y},ae.isJavaInstalled=function(){return!1};var je=function(ee){var ie=function(ue){var Te=JSON.parse(ue),He=function(Ke){return Ke.type=="G"||Ke.type=="E"},We=Te.elements?Te.elements.filter(He)[0]:Te;if(!We||!We.url){ce();return}z.fileName=We.url,it(We.settings||{}),y.is3D=!0;var st="https://www.geogebra.org/images/";ae.setPreviewImage(Qe||We.previewUrl,st+"GeoGebra_loading.png",st+"applet_play.png"),ee()},ce=function(){z.onError&&z.onError(),nn("Error: Fetching material (id "+z.material_id+") failed.",z)},Oe=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",a="/materials/"+z.material_id+"?scope=basic";Re("https://"+Oe+"/api/proxy.php?path="+encodeURIComponent(a),ie,ce)};function it(ee){var ie=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(ce){ee[ce]=!!ee[ce]}),ie.forEach(function(ce){z[ce]===void 0&&ee[ce]!==void 0&&(z[ce]=ee[ce])}),z.showToolBarHelp===void 0&&(z.showToolBarHelp=z.showToolBar)}function Re(ee,ie,ce){var Oe=new XMLHttpRequest;Oe.open("GET",ee),Oe.onload=function(){ie(Oe.responseText)},Oe.onerror=ce,Oe.send()}ae.isHTML5Installed=function(){return!0},ae.getLoadedAppletType=function(){return ye},ae.setPreviewImage=function(ee,ie,ce){Qe=ee,tt=ie,nt=ce},ae.removeExistingApplet=function(ee,ie){var ce;typeof ee=="string"&&(ee=document.getElementById(ee)),ye=null;var Oe=null;for(ce=0;ce<ee.childNodes.length;ce++){var a=ee.childNodes[ce],ue=a.className;ue==="applet_screenshot"?ie?(a.style.display="block",ye="screenshot"):a.style.display="none":ue!=="applet_scaler prerender"&&(ee.removeChild(a),Oe=ue&&ue.indexOf("appletParameters")!=-1?a.id:null,ce--)}var Te=z.id!==void 0?z.id:Oe,He=window[Te];He&&typeof He.getBase64=="function"&&(He.remove(),window[Te]=null)},ae.refreshHitPoints=function(){if(Ge(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var ee=ae.getAppletObject();return ee&&typeof ee.recalculateEnvironments=="function"?(ee.recalculateEnvironments(),!0):!1},ae.startAnimation=function(){var ee=ae.getAppletObject();return ee&&typeof ee.startAnimation=="function"?(ee.startAnimation(),!0):!1},ae.stopAnimation=function(){var ee=ae.getAppletObject();return ee&&typeof ee.stopAnimation=="function"?(ee.stopAnimation(),!0):!1},ae.getAppletObject=function(){var ee=z.id!==void 0?z.id:"ggbApplet";return window[ee]},ae.resize=function(){};var lt=function(ee,ie,ce){var Oe=document.createElement("param");Oe.setAttribute("name",ie),Oe.setAttribute("value",ce),ee.appendChild(Oe)},Ye=function(ee){return ee&&ee!=="false"},ct=function(ee,ie,ce){Ge(ke)<=4.2&&(ce=!0);var Oe=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==ke||ggbHTML5LoadedCodebaseIsWebSimple&&!Ue)&&(Oe=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var a=document.createElement("div");a.classList.add("appletParameters","notranslate");var ue=ie.width,Te=ie.height;if(ie.disableAutoScale=ie.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():ie.disableAutoScale,ie.width!==void 0)if(Ge(ke)<=4.4)Ye(ie.showToolBar)&&(ie.height-=7),Ye(ie.showAlgebraInput)&&(ie.height-=37),ie.width<605&&Ye(ie.showToolBar)&&(ie.width=605,ue=605);else{var He=100;(Ye(ie.showToolBar)||Ye(ie.showMenuBar))&&(ie.hasOwnProperty("customToolBar")&&(ie.customToolbar=ie.customToolBar),He=Ye(ie.showMenuBar)?245:155),ue<He&&(ie.width=He,ue=He)}a.style.border="none",a.style.display="inline-block";for(var We in ie)ie.hasOwnProperty(We)&&We!=="appletOnLoad"&&a.setAttribute("data-param-"+We,ie[We]);Ne&&a.setAttribute("data-param-fontscssurl",Ne),ae.resize=function(){GGBAppletUtils.responsiveResize(ee,ie)},window.addEventListener("resize",function(pt){ae.resize()});var st=typeof ie.appletOnLoad=="function"?ie.appletOnLoad:function(){};if(!ce&&ie.width!==void 0){ie.hasOwnProperty("showSplash")||a.setAttribute("data-param-showSplash","false");var Ke=ee.querySelector(".applet_scaler.prerender"),Wt=Ke!==null;if(Wt)var Vt=Ke.querySelector(".ggb_preview");else{var Vt=It(ue,Te,ie.borderColor,!1);Ke=document.createElement("div"),Ke.className="applet_scaler",Ke.style.position="relative",Ke.style.display="block",Ke.style.width=ue+"px",Ke.style.height=Te+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Ke,"66%"),Ge(ke)>=5?(ie.appletOnLoad=function(pt){var St=ee.querySelector(".ggb_preview");St&&St.parentNode.removeChild(St),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(Ke),window.GGBT_wsf_view&&$(window).trigger("resize"),st(pt)},Wt||Ke.appendChild(Vt)):a.appendChild(Vt),Ke.appendChild(a),Wt||ee.appendChild(Ke),setTimeout(function(){ae.resize()},1)}else{var jt=document.createElement("div");jt.className="applet_scaler",jt.style.position="relative",jt.style.display="block",jt.appendChild(a),ee.appendChild(jt),ie.appletOnLoad=function(pt){ae.resize(),st(pt)}}function hn(pt,St){St&&typeof St.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(pt,St.appletOnLoad):renderGGBElement(pt),nn("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",St)}function on(pt,St){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:pt,params:St}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(wn){hn(wn.article,wn.params)}),html5AppletsToProcess=null)},Ge(ke)<5&&(pt.className+=" geogebraweb")):hn(pt,St)}if(Oe){scriptLoadStarted=!0;for(var Tt=0;Tt<a.childNodes.length;Tt++){var vn=a.childNodes[Tt].tagName;vn==="TABLE"&&(a.removeChild(a.childNodes[Tt]),Tt--)}if(ggbHTML5LoadedScript!==null){var Zt=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');Zt!=null&&Zt.parentNode.removeChild(Zt)}var xt=document.createElement("script"),rn=function(){on(a,ie)};xt.src=Fe+Xe,ggbHTML5LoadedCodebaseIsWebSimple=Ue,ggbHTML5LoadedCodebaseVersion=ke,ggbHTML5LoadedScript=xt.src,nn("GeoGebra HTML5 codebase loaded: '"+Fe+"'.",ie),!be&&(!de||de=="5.0")?(Ue?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),rn()):Fe.requirejs?__webpack_require__.e(7226).then(function(){var pt=[__webpack_require__(77226)];rn.apply(null,pt)}.bind(this)).catch(__webpack_require__.oe):(xt.onload=rn,ee.appendChild(xt))}else on(a,ie);ie.height=Te,ie.width=ue},bt=function(ee,ie,ce){var Oe=It(ie.width,ie.height,ie.borderColor,ce),a=document.createElement("div");a.style.position="relative",a.style.display="block",a.style.width=ie.width+"px",a.style.height=ie.height+"px",a.className="applet_screenshot applet_scaler"+(ce?" applet_screenshot_play":""),a.appendChild(Oe);var ue=GGBAppletUtils.getScale(ie,ee,ce);ce?(ee.appendChild(Rt()),window.GGBT_wsf_view||(ee.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(a,"66%"),ee.appendChild(a),ue!==1&&!isNaN(ue)&&(GGBAppletUtils.scaleElement(a,ue),a.style.width=ie.width+"px",a.style.height=ie.height+"px",a.parentNode.style.width=ie.width*ue+"px",a.parentNode.style.height=ie.height*ue+"px"),ae.resize=function(){Bt(ee,Oe,a,ce)},window.addEventListener("resize",function(Te){ae.resize()}),ae.resize()};function Bt(ee,ie,ce,Oe){if(ee.contains(ie)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(ee.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(ee)}var a=GGBAppletUtils.getScale(z,ee,Oe);ce.parentNode!==null&&(!isNaN(a)&&a!==1?(GGBAppletUtils.scaleElement(ce,a),ce.parentNode.style.width=z.width*a+"px",ce.parentNode.style.height=z.height*a+"px"):(GGBAppletUtils.scaleElement(ce,1),ce.parentNode.style.width=z.width+"px",ce.parentNode.style.height=z.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(ee),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}ae.onExitFullscreen=function(ee,ie){ie.appendChild(ee)};var Et=function(ee,ie,ce,Oe){bt(ee,ie,!0);for(var a=function(){var He=[];for(Te=0;Te<ee.childNodes.length;Te++)He.push(ee.childNodes[Te]);if(window.GGBT_wsf_view){var We=window.GGBT_wsf_view.renderFullScreen(ee,ie.id),st=document.getElementById("fullscreencontainer"),Ke=jQuery(ee).find(".fullscreencontent");Ke.length>0?(We.remove(),Ke.attr("id","fullscreencontent").show(),jQuery(st).append(Ke),window.dispatchEvent(new Event("resize"))):ct(We,ie,!1),window.GGBT_wsf_view.launchFullScreen(st)}else ye=Oe,ct(ee,ie,!1);if(!window.GGBT_wsf_view)for(Te=0;Te<He.length;Te++)ee.removeChild(He[Te])},ue=ee.getElementsByClassName("ggb_preview_play"),Te=0;Te<ue.length;Te++)ue[Te].addEventListener("click",a,!1),ue[Te].addEventListener("ontouchstart",a,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(ee),Pe()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},Rt=function(){var ee=document.createElement("div");if(ee.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var ie='.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");}',ce=document.createElement("style");ce.styleSheet?ce.styleSheet.cssText=ie:ce.appendChild(document.createTextNode(ie)),document.getElementsByTagName("head")[0].appendChild(ce)}return ee},It=function(ee,ie,ce,Oe){var a=document.createElement("div");a.className="ggb_preview",a.style.position="absolute",a.style.zIndex="90",a.style.width=ee-2+"px",a.style.height=ie-2+"px",a.style.top="0px",a.style.left="0px",a.style.overflow="hidden",a.style.backgroundColor="white";var ue="lightgrey";ce!==void 0&&(ce==="none"?ue="transparent":ue=ce),a.style.border="1px solid "+ue;var Te=document.createElement("img");if(Te.style.position="relative",Te.style.zIndex="1000",Te.style.top="-1px",Te.style.left="-1px",Qe!==null&&Te.setAttribute("src",Qe),Te.style.opacity=.7,tt!==null){var He,We,st;if(!Oe){He=document.createElement("img"),He.style.position="absolute",He.style.zIndex="1001",He.style.opacity=1,Te.style.opacity=.3,We=360,We>ee/4*3&&(We=ee/4*3),st=We/5.8,He.setAttribute("src",tt),He.setAttribute("width",We),He.setAttribute("height",st);var Ke=(ee-We)/2,Wt=(ie-st)/2;He.style.left=Ke+"px",He.style.top=Wt+"px",a.appendChild(He)}}return a.appendChild(Te),a},gn=function(ee){return ee=ee.toLowerCase(),ee==="html5"||ee==="screenshot"?ee:"html5"},Ot=["web","webSimple","web3d","tablet","tablet3d","phone"],tn=function(ee,ie){if(ke=ee,ie){Ht(ke,!0);return}var ce=!Me;if(ce){var Oe=Ge(ke);!isNaN(Oe)&&Oe<4.4&&(ce=!1)}var a,ue;window.location.protocol.substr(0,4)==="http"?a=window.location.protocol:a="http:";var Te=ke.indexOf("//");Te>0?ue=ke:Te===0?ue=a+ke:ue="https://www.geogebra.org/apps/5.2.814.0/";for(var He in Ot)if(ke.slice(Ot[He].length*-1)===Ot[He]||ke.slice((Ot[He].length+1)*-1)===Ot[He]+"/"){Ht(ue,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&ce&&!y.is3D&&!y.AV&&!y.SV&&!y.CV&&!y.EV2&&!y.CP&&!y.PC&&!y.DA&&!y.FI&&!y.PV&&!Ye(z.showToolBar)&&!Ye(z.showMenuBar)&&!Ye(z.showAlgebraInput)&&!Ye(z.enableRightClick)&&(!z.appName||z.appName=="classic")?ue+="webSimple/":ue+="web3d/",Ht(ue,!1)},Ht=function(ee,ie){if(ee.requirejs){Fe=ee;return}ee.slice(-1)!=="/"&&(ee+="/"),Fe=ee,ie===null&&(ie=ee.indexOf("http")===-1),Be=ie,Xe="web.nocache.js",Ue=!1;var ce=Fe.split("/");ce.length>1&&(!ie&&ce[ce.length-2]==="webSimple"?(Xe="webSimple.nocache.js",Ue=!0):Ot.indexOf(ce[ce.length-2])>=0&&(Xe=ce[ce.length-2]+".nocache.js")),ce=ee.split("/"),ke=ce[ce.length-3],ke.substr(0,4)==="test"?ke=ke.substr(4,1)+"."+ke.substr(5,1):(ke.substr(0,3)==="war"||ke.substr(0,4)==="beta")&&(ke="5.0");var Oe=parseFloat(ke);Oe!==NaN&&Oe<5&&ee.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+Oe+" is deprecated. Using version latest instead."),tn("5.0",ie))},nn=function(ee,ie){window.console&&window.console.log&&(!ie||typeof ie.showLogging=="undefined"||ie.showLogging&&ie.showLogging!=="false")&&console.log(ee)};z.material_id!==void 0?je(pn):pn();function pn(){var ee=Ae;de!==null?ee=de:parseFloat(ee)<5&&(ee="5.0"),tn(ee,!1),be!==null&&Ht(be,Be),te=!0}return ae},GGBAppletUtils=function(){"use strict";function ae(){return window.GGBT_wsf_edit!==void 0}function Ae(te,de){de!=1?(te.style.transformOrigin="0% 0% 0px",te.style.webkitTransformOrigin="0% 0% 0px",te.style.transform="scale("+de+","+de+")",te.style.webkitTransform="scale("+de+","+de+")",te.style.maxWidth="initial",te.querySelector(".ggb_preview")!==null&&(te.querySelector(".ggb_preview").style.maxWidth="initial"),te.querySelectorAll(".ggb_preview img")[0]!==void 0&&(te.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),te.querySelectorAll(".ggb_preview img")[1]!==void 0&&(te.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(te.style.transform="none",te.style.webkitTransform="none")}function z(te,de,be,Ee,pe,_e){var Fe=null;if(_e!=null&&_e!="")for(var Be=te.parentNode;Be!=null;)if((" "+Be.className+" ").indexOf(" "+_e+" ")>-1){Fe=Be;break}else Be=Be.parentNode;var ye=0,ke=0,Xe=0,Ue=0,Qe=0,tt=0,nt=0;if(Fe)ye=Fe.offsetWidth,ke=Math.max(Ee?Fe.offsetWidth:0,Fe.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(ye=Math.min(window.innerWidth,document.documentElement.clientWidth),ke=Math.min(window.innerHeight,document.documentElement.clientHeight),Xe=ye):(ye=window.innerWidth,ke=window.innerHeight,Xe=window.innerWidth),te){var Ne=te.getBoundingClientRect();Ne.left>0&&Ne.left<=ye&&(pe===void 0||!pe)&&(document.dir==="rtl"?(Qe=ye-Ne.width-Ne.left,tt=Xe<=480?10:30):(tt=Ne.left,Qe=Xe<=480?10:30),Ue=tt+Qe)}if(te&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var $e=te.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(Ue=40,nt=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(Ue=0,nt=40)}}return te&&((be===void 0||!be)&&de>0&&de+Ue<ye?ye=de:ye-=Ue,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(be===void 0||!be)&&(ke-=nt)),{width:ye,height:ke}}function y(te,de,be,Ee,pe){if(te.isScreenshoGenerator)return 1;var _e=Ee!==void 0&&Ee,Fe=te.noScaleMargin!=null&&te.noScaleMargin,Be=function($e){return $e&&$e!=="false"},ye=Be(te.autoHeight),ke=z(de,te.width,be,ye,_e&&window.GGBT_wsf_view||Fe,pe),Xe=parseInt(ke.width),Ue=te.width,Qe=te.height;if(Ue===void 0){var tt=de.querySelector(".appletParameters");tt&&(Ue=tt.offsetWidth,Qe=tt.offsetHeight)}var nt=Xe/Ue,Ne=_e?1:ke.height/Qe;return be!==void 0&&!be&&(nt=Math.min(1,nt),Ne=Math.min(1,Ne)),Math.min(nt,Ne)}function Me(te,de,be){var Ee=1,pe,_e=!1;if(te.hasOwnProperty("allowUpscale")&&(_e=te.allowUpscale),te.hasOwnProperty("scale")&&(Ee=parseFloat(te.scale),(isNaN(Ee)||Ee===null||Ee===0)&&(Ee=1),Ee>1&&(_e=!0)),de&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(_e=!0),!(te.hasOwnProperty("disableAutoScale")&&te.disableAutoScale))pe=y(te,de,_e,be,te.scaleContainerClass);else return Ee;return _e&&(!te.hasOwnProperty("scale")||Ee===1)?pe:Math.min(Ee,pe)}function Le(te){var de=Math.min(window.innerWidth,document.documentElement.clientWidth),be=Math.min(window.innerHeight,document.documentElement.clientHeight),Ee=te.getBoundingClientRect(),pe=(de-Ee.width)/2,_e=(be-Ee.height)/2;_e<0&&(_e=0),te.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(pe<40?te.style.left="40px":te.style.left=pe+"px",te.style.top=_e+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(_e<40?te.style.top="40px":te.style.top=_e+"px",te.style.left=pe+"px")}function Ce(te,de){var be=te.querySelector(".appletParameters");if(be){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(de.id!==be.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(te)}if(be.parentElement&&/fullscreen/.test(be.parentElement.className))return;var Ee=Me(de,te);ae()&&be.setAttribute("data-param-scale",Ee);for(var pe=null,_e=0;_e<te.childNodes.length;_e++)if(te.childNodes[_e].className!==void 0&&te.childNodes[_e].className.match(/^applet_scaler/)){pe=te.childNodes[_e];break}if(pe!==null&&pe.querySelector(".noscale")!==null)return;var Fe=de.id!==void 0?de.id:"ggbApplet",Be=window[Fe];(Be==null||!Be.recalculateEnvironments)&&pe!==null&&!pe.className.match(/fullscreen/)&&(pe.parentNode.style.transform="",!isNaN(Ee)&&Ee!==1?(pe.parentNode.style.width=de.width*Ee+"px",pe.parentNode.style.height=de.height*Ee+"px",Ae(pe,Ee)):(Ae(pe,1),pe.parentNode.style.width=de.width+"px",pe.parentNode.style.height=de.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&Le(te),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(be).parents(".content-added-content"))}}return{responsiveResize:Ce,isFlexibleWorksheetEditor:ae,positionCenter:Le,getScale:Me,scaleElement:Ae}}();__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return GGBApplet}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),__WEBPACK_AMD_DEFINE_RESULT__!==void 0&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__),GGBAppletUtils.makeModule=function(name,permutation){function webModule(){var H="bootstrap",I="begin",J="gwt.codesvr."+name+"=",K="gwt.codesvr=",L=name,M="startup",N="DUMMY",O=0,P=1,Q="iframe",R="position:absolute; width:0; height:0; border:none; left: -1000px;",S=" top: -1000px;",T="Chrome",U="CSS1Compat",V="<!doctype html>",W="",X="<html><head></head><body></body></html>",Y="undefined",Z="readystatechange",$=10,_="script",ab="javascript",bb="Failed to load ",cb="moduleStartup",db="scriptTagAdded",eb="moduleRequested",fb="meta",gb="name",hb=name+"::",ib="::",jb="gwt:property",kb="content",lb="=",mb="gwt:onPropertyErrorFn",nb='Bad handler "',ob='" for "gwt:onPropertyErrorFn"',pb="gwt:onLoadErrorFn",qb='" for "gwt:onLoadErrorFn"',rb="#",sb="?",tb="/",ub="img",vb="clear.cache.gif",wb="baseUrl",xb=name+".nocache.js",yb="base",zb="//",Ab="selectingPermutation",Bb=name+".devmode.js",Cb=permutation,Db=":",Eb=".cache.js",Fb="loadExternalRefs",Gb="end",n=window,o=document;function p(){var ae=n.location.search;return ae.indexOf(J)!=-1||ae.indexOf(K)!=-1}function q(ae,Ae){}webModule.__sendStats=q,webModule.__moduleName=L,webModule.__errFn=null,webModule.__moduleBase=N,webModule.__softPermutationId=O,webModule.__computePropValue=null,webModule.__getPropMap=null,webModule.__installRunAsyncCode=function(){},webModule.__gwtStartLoadingFragment=function(){return null},webModule.__gwt_isKnownPropertyValue=function(){return!1},webModule.__gwt_getMetaProperty=function(){return null};var r=null,s=n.__gwt_activeModules=n.__gwt_activeModules||{};s[L]={moduleName:L},webModule.__moduleStartupDone=function(ae){var Ae=s[L].bindings;s[L].bindings=function(){for(var z=Ae?Ae():{},y=ae[webModule.__softPermutationId],Me=O;Me<y.length;Me++){var Le=y[Me];z[Le[O]]=Le[P]}return z}};var t;function u(){return v(),t}function v(){if(!t){var ae=o.createElement(Q);if(ae.id=L,ae.style.cssText=R+S,ae.tabIndex=-1,o.body.appendChild(ae),t=ae.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var Ae=document.compatMode==U?V:W;t.write(Ae+X),t.close()}}}function w(ae){function Ae(y){function Me(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var Le=Me();if(Le){y();return}function Ce(){if(!Le){if(!Me())return;Le=!0,y(),o.removeEventListener&&o.removeEventListener(Z,Ce,!1),te&&clearInterval(te)}}o.addEventListener&&o.addEventListener(Z,Ce,!1);var te=setInterval(function(){Ce()},$)}function z(y){var Me=u(),Le=Me.body,Ce=Me.createElement(_);Ce.language=ab,Ce.crossOrigin=W,Ce.src=y,webModule.__errFn&&(Ce.onerror=function(){webModule.__errFn(L,new Error(bb+y))}),Le.appendChild(Ce)}Ae(function(){z(ae)})}webModule.__startLoadingFragment=function(ae){return C(ae)},webModule.__installRunAsyncCode=function(ae){var Ae=u(),z=Ae.body,y=Ae.createElement(_);y.language=ab,y.text=ae,z.appendChild(y),z.removeChild(y)};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(ae){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(ae){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(ae){var Ae=c[ae];return Ae==null?null:Ae},r=d,webModule.__errFn=e}function B(){function ae(te){var de=te.lastIndexOf(rb);de==-1&&(de=te.length);var be=te.indexOf(sb);be==-1&&(be=te.length);var Ee=te.lastIndexOf(tb,Math.min(be,de));return Ee>=O?te.substring(O,Ee+P):W}function Ae(te){if(!te.match(/^\w+:\/\//)){var de=o.createElement(ub);de.src=te+vb,te=ae(de.src)}return te}function z(){var te=__gwt_getMetaProperty(wb);return te!=null?te:W}function y(){for(var te=o.getElementsByTagName(_),de=O;de<te.length;++de)if(te[de].src.indexOf(xb)!=-1)return ae(te[de].src);return W}function Me(){var te=o.getElementsByTagName(yb);return te.length>O?te[te.length-P].href:W}function Le(){var te=o.location;return te.href==te.protocol+zb+te.host+te.pathname+te.search+te.hash}var Ce=z();return Ce==W&&(Ce=y()),Ce==W&&(Ce=Me()),Ce==W&&Le()&&(Ce=ae(o.location.href)),Ce=Ae(Ce),Ce}function C(ae){return ae.match(/^\//)||ae.match(/^[a-zA-Z]+:\/\//)?ae:webModule.__moduleBase+ae}function D(){var ae=[],Ae=O,z=[],y=[];function Me(te){var de=y[te](),be=z[te];if(de in be)return de;var Ee=[];for(var pe in be)Ee[be[pe]]=pe;throw r&&r(te,Ee,de),null}if(__gwt_isKnownPropertyValue=function(te,de){return de in z[te]},webModule.__getPropMap=function(){var te={};for(var de in z)z.hasOwnProperty(de)&&(te[de]=Me(de));return te},webModule.__computePropValue=Me,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var Le;try{Le=Cb;var Ce=Le.indexOf(Db);Ce!=-1&&(Ae=parseInt(Le.substring(Ce+P),$),Le=Le.substring(O,Ce))}catch(te){}return webModule.__softPermutationId=Ae,C(Le+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}A(),webModule.__moduleBase="/js/mathematicalGraphics/"+name+"/",s[L].moduleBase=webModule.__moduleBase;var G=D();return F(),w(G),!0}return webModule},typeof window.web3d!="function"&&(window.web3d=GGBAppletUtils.makeModule("web3d","A18F540516513B1292CA7CEF2F6AFC7E")),typeof window.webSimple!="function"&&(window.webSimple=GGBAppletUtils.makeModule("webSimple","96B09BF1B436BF53F0DF54116700F16A")),window.GGBApplet=GGBApplet})()},28979:function(ae,Ae,z){"use strict";z.d(Ae,{Ax:function(){return Ce},Ds:function(){return te},KI:function(){return be},SI:function(){return Le},f1:function(){return Me}});var y=z(66593);function Me(Ee){let pe=!0;if(Ee.length>0){for(let _e=0;_e<Ee.length;_e++)if(Ee[_e].compile_success==0||!Ee[_e].compile_success){pe=!1;break}}else pe=!1;return pe}function Le(Ee,pe=""){let _e=[];for(let Fe=0;Fe<Ee.length;Fe++){let Be=Ee[Fe],ye=pe?`${pe}/${Be.name}`:`${Be.name}`;_e.push({title:Be.name,type:Be.type,isLeaf:Be.type!=="tree",key:ye})}return _e}function Ce(Ee,pe,_e){for(let Fe=0;Fe<Ee.length;Fe++){let Be=Ee[Fe];if(Be.key===pe){Be.children=_e;break}Be.children&&Ce(Be.children,pe,_e)}return Ee}function te(Ee,pe,_e){let Fe;return function(){let Be=this,ye=arguments,ke=function(){Fe=null,_e||Ee.apply(Be,ye)},Xe=_e&&!Fe;clearTimeout(Fe),Fe=setTimeout(ke,pe),Xe&&Ee.apply(Be,ye)}}const de=!0,be=y.Z.API_SERVER},87716:function(ae,Ae,z){"use strict";z.d(Ae,{Z:function(){return Fe}});var y=z(59301),Me={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},Le=z(92310),Ce=z.n(Le),te=z(71418),de=z(2859),be=z(40117),Ee=z(16427),pe=(Be,ye,ke)=>new Promise((Xe,Ue)=>{var Qe=Ne=>{try{nt(ke.next(Ne))}catch($e){Ue($e)}},tt=Ne=>{try{nt(ke.throw(Ne))}catch($e){Ue($e)}},nt=Ne=>Ne.done?Xe(Ne.value):Promise.resolve(Ne.value).then(Qe,tt);nt((ke=ke.apply(Be,ye)).next())}),Fe=({data:Be,className:ye,fullWidth:ke,style:Xe={},onClose:Ue,onOk:Qe,showFullTools:tt,noAssociationId:nt})=>{const Ne=(0,y.useRef)(null),$e=(0,y.useRef)(null),Ge=(0,y.useRef)(null),xe=(0,y.useRef)(null),[Pe,je]=(0,y.useState)(!1),[it,Re]=(0,y.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,y.useEffect)(()=>{Ge.current||(Ge.current=document.createElement("style"),document.head.appendChild(Ge.current)),Be!=null&&Be.visible?(document.body.setAttribute("data-custom","y-hidden"),Ge.current.innerHTML=" html { overflow-y: hidden; }",Be!=null&&Be.src&&lt()):(document.body.removeAttribute("data-custom"),Ge.current&&(document.head.removeChild(Ge.current),Ge.current=null))},[Be==null?void 0:Be.visible]);const lt=()=>pe(void 0,null,function*(){je(!0),Re("\u6B63\u5728\u52A0\u8F7D\u4E2D");const Bt=yield(0,Ee.ZJ)(Be==null?void 0:Be.src);Ne.current.src="",Ne.current.src=Bt,Ne.current.onload=function(){bt()},je(!1),Re("")}),Ye=Bt=>pe(void 0,null,function*(){je(!0),Re("\u6B63\u5728\u4FDD\u5B58\u4E2D");const Et=yield(0,be.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Be.title,file:Bt.dataUrl}});Et!=null&&Et.id&&!nt?(yield(0,be.ZP)(`/api/attachments/${Be.id}/add_subitem.json`,{method:"post",body:{subitem_id:Et==null?void 0:Et.id,settings:JSON.stringify(Bt.state)}})).status===0&&Qe():Et!=null&&Et.id&&Qe(Et),je(!1),Re("")}),ct=()=>{const Bt=document.querySelector('a[href="https://markerjs.com/"]');Bt&&Bt.parentNode&&(Bt.parentNode.style.display="none"),[{name:'[data-action="select"]',title:"\u9009\u62E9"},{name:'[data-action="delete"]',title:"\u5220\u9664\u5143\u7D20"},{name:'[data-action="undo"]',title:"\u64A4\u9500"},{name:'[data-type-name="FrameMarker"]',title:"\u77E9\u5F62"},{name:'[data-type-name="FreehandMarker"]',title:"\u753B\u7EBF"},{name:'[data-type-name="ArrowMarker"]',title:"\u7BAD\u5934"},{name:'[data-type-name="TextMarker"]',title:"\u6587\u672C"},{name:'[data-type-name="EllipseMarker"]',title:"\u692D\u5706"},{name:'[data-type-name="HighlightMarker"]',title:"\u65B9\u5757"},{name:'[data-type-name="CalloutMarker"]',title:"\u6CE8\u91CA"},{name:'[data-action="render"]',title:"\u4FDD\u5B58"},{name:'[data-action="close"]',title:"\u9000\u51FA"}].forEach(Rt=>{const It=document.querySelector(Rt.name);It&&It.setAttribute("title",Rt.title)})},bt=()=>{$e.current=new de.hP(Ne.current),$e.current.targetRoot=xe.current,$e.current.addEventListener("render",Ye),$e.current.addEventListener("beforeclose",Ue),tt&&($e.current.availableMarkerTypes=$e.current.ALL_MARKER_TYPES,$e.current.uiStyleSettings.redoButtonVisible=!0,$e.current.uiStyleSettings.notesButtonVisible=!0,$e.current.uiStyleSettings.zoomButtonVisible=!0,$e.current.uiStyleSettings.zoomOutButtonVisible=!0,$e.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=$e.current.uiStyleSettings,$e.current.show(),Be!=null&&Be.snapshotData&&$e.current.restoreState(Be.snapshotData),setTimeout(()=>{window.scrollTo(0,0),ct()},300)};return y.createElement(y.Fragment,null,(Be==null?void 0:Be.visible)&&y.createElement(te.Z,{spinning:Pe,tip:it,style:{position:"absolute"}},y.createElement("div",{ref:xe,className:Ce()(Me.imageDimensions,ye,ke?Me.fullWidth:""),style:Xe},y.createElement("img",{className:Me.img,ref:Ne}))))}},6370:function(ae,Ae,z){"use strict";z.d(Ae,{h:function(){return $e}});var y=z(59301),Me=z(57809),Le=z(78700),Ce=z(3113),te=z(89780),de=z.n(te),be=z(82963),Ee=z(55286),pe=Object.defineProperty,_e=Object.defineProperties,Fe=Object.getOwnPropertyDescriptors,Be=Object.getOwnPropertySymbols,ye=Object.prototype.hasOwnProperty,ke=Object.prototype.propertyIsEnumerable,Xe=(Ge,xe,Pe)=>xe in Ge?pe(Ge,xe,{enumerable:!0,configurable:!0,writable:!0,value:Pe}):Ge[xe]=Pe,Ue=(Ge,xe)=>{for(var Pe in xe||(xe={}))ye.call(xe,Pe)&&Xe(Ge,Pe,xe[Pe]);if(Be)for(var Pe of Be(xe))ke.call(xe,Pe)&&Xe(Ge,Pe,xe[Pe]);return Ge},Qe=(Ge,xe)=>_e(Ge,Fe(xe));const tt=Me.default.Option,nt={labelCol:{span:4},wrapperCol:{span:20}},Ne={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"]};Ae.Z=({callback:Ge,onCancel:xe})=>{const[Pe,je]=(0,y.useState)("python");function it(lt){je(Ne[lt][1])}function Re(lt){Ge(lt)}return y.createElement(Le.default,Qe(Ue({},nt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Re,style:{width:500}}),y.createElement(Le.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},y.createElement(Me.default,{getPopupContainer:lt=>lt.parentNode,onChange:it},Object.keys(Ne).map(lt=>y.createElement(tt,{key:lt,value:lt},Ne[lt][0])))),y.createElement(Le.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},y.createElement($e,{mode:Pe})),y.createElement("div",{className:"flex-container flex-end"},y.createElement(Ce.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.createElement(Ce.ZP,{type:"ghost",onClick:xe},"\u53D6\u6D88")))};function $e({value:Ge,onChange:xe,mode:Pe,options:je={}}){const it=(0,y.useRef)(),[Re,lt]=(0,y.useState)();return(0,y.useEffect)(()=>{if(Re){let Ye=function(ct){const bt=ct.getValue();xe&&xe(bt)};return Re.on("change",Ye),()=>{Re.off("change",Ye)}}},[Re,xe]),(0,y.useEffect)(()=>{Re&&Re.setOption("mode",Pe)},[Re,Pe]),(0,y.useEffect)(()=>{Re&&(Ge!==Re.getValue()||Ge==="")&&setTimeout(()=>{Re.setValue(Ge||"")},300)},[Re,Ge]),(0,y.useEffect)(()=>{if(it.current&&!Re){const Ye=de().fromTextArea(it.current,Ue({mode:Pe,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},je));lt(Ye)}},[it.current,Re]),y.createElement("div",{className:"my-codemirror-container"},y.createElement("textarea",{ref:it}))}},57455:function(ae,Ae,z){"use strict";z.d(Ae,{Z:function(){return ii}});var y=z(59301),Me=z(89780),Le=z.n(Me),Ce=z(76374),te=z(82963),de=z(6313),be=z(25717),Ee=z(99498),pe=z(25419),_e=z(67549),Fe=z(83900),Be=({value:b="",className:x,showTextOnly:E,showLines:le,style:Se={}})=>{const we=(0,y.useMemo)(()=>"",[b]);return y.createElement(y.Fragment,null,y.createElement("div",{dangerouslySetInnerHTML:{__html:we}}))},ye=z(59301),ke=Object.defineProperty,Xe=Object.defineProperties,Ue=Object.getOwnPropertyDescriptors,Qe=Object.getOwnPropertySymbols,tt=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,Ne=(b,x,E)=>x in b?ke(b,x,{enumerable:!0,configurable:!0,writable:!0,value:E}):b[x]=E,$e=(b,x)=>{for(var E in x||(x={}))tt.call(x,E)&&Ne(b,E,x[E]);if(Qe)for(var E of Qe(x))nt.call(x,E)&&Ne(b,E,x[E]);return b},Ge=(b,x)=>Xe(b,Ue(x));let xe=[{title:"\u7C97\u4F53",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"md-iconfont icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"\u6570\u5B66\u56FE\u50CF",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"iconfont icon-jisuan1",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"\u63D2\u5165\u753B\u56FE",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"\u63D2\u5165\u6D41\u7A0B\u56FE",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"\u8868\u683C",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function Pe({onActionCallback:b,title:x,icon:E,actionName:le,className:Se="",children:we}){function Ve(){b(le)}return ye.createElement("a",{title:x,className:Se,onClick:Ve},ye.createElement("i",{className:`${E}`}),we)}var je=({watch:b,showNullButton:x,showNullProgramButton:E,onActionCallback:le,fullScreen:Se,insertTemp:we,hidetoolBar:Ve,extraUse:Ie})=>{const Je=[...xe,{title:`${b?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${b?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return ye.createElement("ul",{className:"markdown-toolbar-container"},!Ve&&Je.map((ot,Ct)=>ye.createElement("li",{key:Ct},ot.actionName?ye.createElement(Pe,Ge($e({},ot),{onActionCallback:le})):ye.createElement("span",{className:"v-line"}))),x?ye.createElement("li",null,ye.createElement(Pe,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:le},ye.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,E?ye.createElement(ye.Fragment,null,ye.createElement("li",null,ye.createElement(Pe,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:le},ye.createElement("span",{className:"fill-tip"},"+\u5355\u884C\u586B\u7A7A\u9879"))),ye.createElement("li",null,ye.createElement(Pe,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:le},ye.createElement("span",{className:"fill-tip"},"+\u591A\u884C\u586B\u7A7A\u9879")))):null,we&&ye.createElement("li",null,ye.createElement(Pe,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${we}`,onActionCallback:le},ye.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),Ie&&ye.createElement("li",null,Ie),ye.createElement("li",{className:"btn-full-screen"},ye.createElement(Pe,{icon:`${Se?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:Se?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:le})))},it=z(89767),Re=z(78700),lt=z(92832),Ye=z(3113),ct=Object.defineProperty,bt=Object.defineProperties,Bt=Object.getOwnPropertyDescriptors,Et=Object.getOwnPropertySymbols,Rt=Object.prototype.hasOwnProperty,It=Object.prototype.propertyIsEnumerable,gn=(b,x,E)=>x in b?ct(b,x,{enumerable:!0,configurable:!0,writable:!0,value:E}):b[x]=E,Ot=(b,x)=>{for(var E in x||(x={}))Rt.call(x,E)&&gn(b,E,x[E]);if(Et)for(var E of Et(x))It.call(x,E)&&gn(b,E,x[E]);return b},tn=(b,x)=>bt(b,Bt(x));const Ht={labelCol:{span:4},wrapperCol:{span:20}};var nn=({callback:b,onCancel:x})=>{function E(le){b(le)}return y.createElement(Re.default,tn(Ot({},Ht),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:E,style:{width:500}}),y.createElement(Re.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},y.createElement(lt.default,null)),y.createElement(Re.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},y.createElement(lt.default,null)),y.createElement("div",{className:"flex-container flex-end"},y.createElement(Ye.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.createElement(Ye.ZP,{type:"ghost",onClick:x},"\u53D6\u6D88")))},pn=z(6370),ee=z(57213),ie=z(95237),ce=z(87716),Oe=({callback:b,onCancel:x})=>{const E=document.createElement("canvas"),le=E.getContext("2d");E.width=1e3,E.height=800,le.fillStyle="#ffffff",le.fillRect(0,0,E.width,E.height);const Se=E.toDataURL("image/png");return y.createElement(ie.Z,{style:{height:"100vh"}},y.createElement(ce.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:Se,visible:!0,title:String(Date.now())},onOk:we=>{b({src:we.url})},onClose:x}))},a=z(12378);function ue(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(ue,go.CommandHandler),ue.prototype.canAlignSelection=function(){var b=this.diagram;return!(b===null||b.isReadOnly||b.isModelReadOnly||b.selection.count<2)},ue.prototype.alignLeft=function(){var b=this.diagram;b.startTransaction("aligning left");var x=1/0;b.selection.each(function(E){E instanceof go.Link||(x=Math.min(E.position.x,x))}),b.selection.each(function(E){E instanceof go.Link||E.move(new go.Point(x,E.position.y))}),b.commitTransaction("aligning left")},ue.prototype.alignRight=function(){var b=this.diagram;b.startTransaction("aligning right");var x=-1/0;b.selection.each(function(E){if(!(E instanceof go.Link)){var le=E.actualBounds.x+E.actualBounds.width;x=Math.max(le,x)}}),b.selection.each(function(E){E instanceof go.Link||E.move(new go.Point(x-E.actualBounds.width,E.position.y))}),b.commitTransaction("aligning right")},ue.prototype.alignTop=function(){var b=this.diagram;b.startTransaction("alignTop");var x=1/0;b.selection.each(function(E){E instanceof go.Link||(x=Math.min(E.position.y,x))}),b.selection.each(function(E){E instanceof go.Link||E.move(new go.Point(E.position.x,x))}),b.commitTransaction("alignTop")},ue.prototype.alignBottom=function(){var b=this.diagram;b.startTransaction("aligning bottom");var x=-1/0;b.selection.each(function(E){if(!(E instanceof go.Link)){var le=E.actualBounds.y+E.actualBounds.height;x=Math.max(le,x)}}),b.selection.each(function(E){E instanceof go.Link||E.move(new go.Point(E.actualBounds.x,x-E.actualBounds.height))}),b.commitTransaction("aligning bottom")},ue.prototype.alignCenterX=function(){var b=this.diagram,x=b.selection.first();if(x){b.startTransaction("aligning Center X");var E=x.actualBounds.x+x.actualBounds.width/2;b.selection.each(function(le){le instanceof go.Link||le.move(new go.Point(E-le.actualBounds.width/2,le.actualBounds.y))}),b.commitTransaction("aligning Center X")}},ue.prototype.alignCenterY=function(){var b=this.diagram,x=b.selection.first();if(x){b.startTransaction("aligning Center Y");var E=x.actualBounds.y+x.actualBounds.height/2;b.selection.each(function(le){le instanceof go.Link||le.move(new go.Point(le.actualBounds.x,E-le.actualBounds.height/2))}),b.commitTransaction("aligning Center Y")}},ue.prototype.alignColumn=function(b){var x=this.diagram;x.startTransaction("align Column"),b===void 0&&(b=0),b=parseFloat(b);var E=new Array;x.selection.each(function(Ie){Ie instanceof go.Link||E.push(Ie)});for(var le=0;le<E.length-1;le++){var Se=E[le],we=Se.actualBounds.y+Se.actualBounds.height+b,Ve=E[le+1];Ve.move(new go.Point(Se.actualBounds.x,we))}x.commitTransaction("align Column")},ue.prototype.alignRow=function(b){b===void 0&&(b=0),b=parseFloat(b);var x=this.diagram;x.startTransaction("align Row");var E=new Array;x.selection.each(function(Ie){Ie instanceof go.Link||E.push(Ie)});for(var le=0;le<E.length-1;le++){var Se=E[le],we=Se.actualBounds.x+Se.actualBounds.width+b,Ve=E[le+1];Ve.move(new go.Point(we,Se.actualBounds.y))}x.commitTransaction("align Row")},ue.prototype.canRotate=function(b){var x=this.diagram;return!(x===null||x.isReadOnly||x.isModelReadOnly||x.selection.count<1)},ue.prototype.rotate=function(b){b===void 0&&(b=90);var x=this.diagram;x.startTransaction("rotate "+b.toString());var x=this.diagram;x.selection.each(function(E){E instanceof go.Link||E instanceof go.Group||(E.angle+=b)}),x.commitTransaction("rotate "+b.toString())},ue.prototype.pullToFront=function(){var b=this.diagram;b.startTransaction("pullToFront");var x=new go.Map;b.selection.each(function(E){x.set(E.layer,0)}),x.iteratorKeys.each(function(E){var le=0;E.parts.each(function(Se){if(!Se.isSelected){var we=Se.zOrder;isNaN(we)?Se.zOrder=0:le=Math.max(le,we)}}),x.set(E,le)}),b.selection.each(function(E){ue._assignZOrder(E,x.get(E.layer)+1)}),b.commitTransaction("pullToFront")},ue.prototype.pushToBack=function(){var b=this.diagram;b.startTransaction("pushToBack");var x=new go.Map;b.selection.each(function(E){x.set(E.layer,0)}),x.iteratorKeys.each(function(E){var le=0;E.parts.each(function(Se){if(!Se.isSelected){var we=Se.zOrder;isNaN(we)?Se.zOrder=0:le=Math.min(le,we)}}),x.set(E,le)}),b.selection.each(function(E){ue._assignZOrder(E,x.get(E.layer)-1-ue._findGroupDepth(E))}),b.commitTransaction("pushToBack")},ue._assignZOrder=function(b,x,E){E===void 0&&(E=b),b.layer===E.layer&&(b.zOrder=x),b instanceof go.Group&&b.memberParts.each(function(le){ue._assignZOrder(le,x+1,E)})},ue._findGroupDepth=function(b){if(b instanceof go.Group){var x=0;return b.memberParts.each(function(E){x=Math.max(x,ue._findGroupDepth(E))}),x+1}else return 0},ue.prototype.doKeyDown=function(){var b=this.diagram;if(b!==null){var x=b.lastInput;if(x.key==="Up"||x.key==="Down"||x.key==="Left"||x.key==="Right"){var E=this.arrowKeyBehavior;if(E==="none")return;if(E==="select"){this._arrowKeySelect();return}else if(E==="move"){this._arrowKeyMove();return}else if(E==="tree"){this._arrowKeyTree();return}}go.CommandHandler.prototype.doKeyDown.call(this)}},ue.prototype._getAllParts=function(){var b=new Array;return this.diagram.nodes.each(function(x){b.push(x)}),this.diagram.parts.each(function(x){b.push(x)}),b},ue.prototype._arrowKeyMove=function(){var b=this.diagram,x=b.lastInput,E=0,le=0;if(x.control||x.meta)E=1,le=1;else if(b.grid!==null){var Se=b.grid.gridCellSize;le=Se.width,E=Se.height}b.startTransaction("arrowKeyMove"),b.selection.each(function(we){x.key==="Up"?we.move(new go.Point(we.actualBounds.x,we.actualBounds.y-E)):x.key==="Down"?we.move(new go.Point(we.actualBounds.x,we.actualBounds.y+E)):x.key==="Left"?we.move(new go.Point(we.actualBounds.x-le,we.actualBounds.y)):x.key==="Right"&&we.move(new go.Point(we.actualBounds.x+le,we.actualBounds.y))}),b.commitTransaction("arrowKeyMove")},ue.prototype._arrowKeySelect=function(){var b=this.diagram,x=b.lastInput,E=null;x.key==="Up"?E=this._findNearestPartTowards(270):x.key==="Down"?E=this._findNearestPartTowards(90):x.key==="Left"?E=this._findNearestPartTowards(180):x.key==="Right"&&(E=this._findNearestPartTowards(0)),E!==null&&(x.shift?E.isSelected=!0:x.control||x.meta?E.isSelected=!E.isSelected:b.select(E))},ue.prototype._findNearestPartTowards=function(b){var x=this.diagram.selection.first();if(x===null)return null;for(var E=x.actualBounds.center,le=this._getAllParts(),Se=1/0,we=x,Ve=0;Ve<le.length;Ve++){var Ie=le[Ve];if(Ie!==x&&Ie.canSelect()){var Je=Ie.actualBounds.center,ot=E.directionPoint(Je),Ct=this._angleCloseness(ot,b);if(Ct<=45){var oe=E.distanceSquaredPoint(Je);oe*=1+Math.sin(Ct*Math.PI/180),oe<Se&&(Se=oe,we=Ie)}}}return we},ue.prototype._angleCloseness=function(b,x){return Math.min(Math.abs(x-b),Math.min(Math.abs(x+360-b),Math.abs(x-360-b)))},ue.prototype._arrowKeyTree=function(){var b=this.diagram,x=b.selection.first();if(x instanceof go.Node){var E=b.lastInput;if(E.key==="Right"){if(!x.isTreeLeaf)if(!x.isTreeExpanded)b.commandHandler.canExpandTree(x)&&b.commandHandler.expandTree(x);else{var le=this._sortTreeChildrenByY(x).first();le!==null&&b.select(le)}}else if(E.key==="Left")if(!x.isTreeLeaf&&x.isTreeExpanded)b.commandHandler.canCollapseTree(x)&&b.commandHandler.collapseTree(x);else{var Se=x.findTreeParentNode();Se!==null&&b.select(Se)}else if(E.key==="Up"){var Se=x.findTreeParentNode();if(Se!==null){var we=this._sortTreeChildrenByY(Se),Ve=we.indexOf(x);if(Ve>0){for(var Ie=we.elt(Ve-1);Ie!==null&&Ie.isTreeExpanded&&!Ie.isTreeLeaf;){var Je=this._sortTreeChildrenByY(Ie);Ie=Je.last()}Ie!==null&&b.select(Ie)}else b.select(Se)}}else if(E.key==="Down")if(x.isTreeExpanded&&!x.isTreeLeaf){var le=this._sortTreeChildrenByY(x).first();le!==null&&b.select(le)}else for(;x!==null;){var Se=x.findTreeParentNode();if(Se===null)break;var we=this._sortTreeChildrenByY(Se),Ve=we.indexOf(x);if(Ve<we.length-1){b.select(we.elt(Ve+1));break}else x=Se}var ot=b.selection.first();ot!==null&&b.scrollToRect(ot.actualBounds)}},ue.prototype._sortTreeChildrenByY=function(b){var x=new go.List().addAll(b.findTreeChildrenNodes());return x.sort(function(E,le){var Se=E.location,we=le.location;return Se.y<we.y?-1:Se.y>we.y?1:Se.x<we.x?-1:Se.x>we.x?1:0}),x},ue.prototype.copyToClipboard=function(b){go.CommandHandler.prototype.copyToClipboard.call(this,b),this._lastPasteOffset.set(this.pasteOffset)},ue.prototype.pasteFromClipboard=function(){var b=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(b,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),b},Object.defineProperty(ue.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(b){if(b!=="move"&&b!=="select"&&b!=="scroll"&&b!=="tree"&&b!=="none")throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+b);this._arrowKeyBehavior=b}}),Object.defineProperty(ue.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(b){if(!(b instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+b);this._pasteOffset.set(b)}});var Te=ue,He=z(68125),We=z(85160),st=z(43418),Ke=z(43604),Wt=z(40117),Vt={myPaletteDiv:"myPaletteDiv___Xjz2I",maxH60:"maxH60___Pd4Re"},jt=(b,x,E)=>new Promise((le,Se)=>{var we=Je=>{try{Ie(E.next(Je))}catch(ot){Se(ot)}},Ve=Je=>{try{Ie(E.throw(Je))}catch(ot){Se(ot)}},Ie=Je=>Je.done?le(Je.value):Promise.resolve(Je.value).then(we,Ve);Ie((E=E.apply(b,x)).next())});window.go=a;function hn({onCancel:b,callback:x}){let E=(0,y.useRef)(),le=(0,y.useRef)(),Se=(0,y.useRef)(),we=(0,y.useRef)(!1);const Ve=(0,y.useRef)(!1),[Ie,Je]=(0,y.useState)(0);function ot(){const oe=a.GraphObject.make,Ze={red:"#ff3333",blue:"#3358ff",green:"#25ad23",magenta:"#d533ff",purple:"#7d33ff",orange:"#ff6233",brown:"#8e571e",white:"#ffffff",black:"#000000",beige:"#fffcd5",extralightblue:"#d5ebff",extralightred:"#f2dfe0",lightblue:"#a5d2fa",lightgray:"#cccccc",lightgreen:"#b3e6b3",lightred:"#fcbbbd"};E.current=new a.Diagram(le.current,{padding:20,grid:oe(a.Panel,"Grid",oe(a.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),oe(a.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:re=>{var he=re.diagram.commandHandler.addTopLevelParts(re.diagram.selection,!0);he||re.diagram.currentTool.doCancel()},commandHandler:oe(Te),"clickCreatingTool.archetypeNodeData":{text:"\u672A\u547D\u540D",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:re=>{var he=re.subject;he.location=he.location.copy().snapToGridPoint(re.diagram.grid.gridOrigin,re.diagram.grid.gridCellSize),setTimeout(()=>{re.diagram.commandHandler.editTextBlock()},20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:re=>{var he=re.subject;setTimeout(()=>{re.diagram.commandHandler.editTextBlock()})},LinkRelinked:re=>{var he=re.parameter.part;he.invalidateConnectedLinks();var De=re.subject;re.diagram.toolManager.linkingTool.isForwards?De.toNode.invalidateConnectedLinks():De.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),E.current.nodeTemplate=oe(a.Node,"Auto",{locationSpot:a.Spot.Center,locationObjectName:"SHAPE",desiredSize:new a.Size(120,60),minSize:new a.Size(40,40),resizable:!0,resizeCellSize:new a.Size(10,10),rotatable:!0},new a.Binding("location","loc",a.Point.parse).makeTwoWay(a.Point.stringify),new a.Binding("desiredSize","size",a.Size.parse).makeTwoWay(a.Size.stringify),oe(a.Shape,{name:"SHAPE",fill:Ze.white,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:a.Spot.AllSides,toSpot:a.Spot.AllSides},new a.Binding("figure"),new a.Binding("fill"),new a.Binding("stroke","borderColor"),new a.Binding("strokeWidth","thickness"),new a.Binding("strokeDashArray","dash")),oe(a.Shape,{width:100,height:20,strokeWidth:0,fill:"transparent"}),oe(a.TextBlock,{margin:1,textAlign:"center",overflow:a.TextBlock.OverflowEllipsis,editable:!0},new a.Binding("text").makeTwoWay(),new a.Binding("stroke","color"))),E.current.nodeTemplate.toolTip=oe("ToolTip",oe(a.Panel,"Vertical",{maxSize:new a.Size(200,NaN)},oe(a.TextBlock,{font:"bold 10pt sans-serif",textAlign:"center"},new a.Binding("text")),oe(a.TextBlock,{font:"10pt sans-serif",textAlign:"center"},new a.Binding("text","details"))));function Lt(re,he){var De=(ve,qe)=>{ve.handled=!0,ve.diagram.model.commit(rt=>{var mt=qe.part.adornedPart,wt=new a.Point().setRectSpot(mt.actualBounds,re);wt.subtract(mt.location),wt.scale(2,2),wt.x+=Math.sign(wt.x)*130,wt.y+=Math.sign(wt.y)*130,wt.add(mt.location),wt.snapToGridPoint(ve.diagram.grid.gridOrigin,ve.diagram.grid.gridCellSize);var _t=rt.copyNodeData(mt.data);rt.setGroupKeyForNodeData(_t,rt.getGroupKeyForNodeData(mt.data)),rt.addNodeData(_t);var Gn={from:mt.key,to:rt.getKeyForNodeData(_t)};rt.addLinkData(Gn);var Qt=ve.diagram.findNodeForData(_t);Qt.location=wt,ve.diagram.select(Qt),setTimeout(()=>{ve.diagram.commandHandler.editTextBlock()},20)})};return oe(a.Shape,{figure:he,alignment:re,alignmentFocus:re.opposite(),width:re.equals(a.Spot.Top)||re.equals(a.Spot.Bottom)?25:18,height:re.equals(a.Spot.Top)||re.equals(a.Spot.Bottom)?18:25,fill:"orange",stroke:Ze.white,strokeWidth:4,mouseEnter:(ve,qe)=>qe.fill="dodgerblue",mouseLeave:(ve,qe)=>qe.fill="orange",isActionable:!0,click:De,contextClick:De})}function cn(re){return oe(a.Shape,{fill:"orange",stroke:"rgba(0, 0, 0, 0)",strokeWidth:15,background:"transparent",geometryString:"F1 M0 0 b 0 360 -4 0 4 z M10 0 b 0 360 -4 0 4 z M20 0 b 0 360 -4 0 4",isActionable:!0,cursor:"context-menu",mouseEnter:(he,De)=>De.fill="dodgerblue",mouseLeave:(he,De)=>De.fill="orange",click:(he,De)=>{he.diagram.commandHandler.showContextMenu(De.part.adornedPart)}},re||{})}E.current.nodeTemplate.selectionAdornmentTemplate=oe(a.Adornment,"Spot",oe(a.Placeholder,{padding:10}),Lt(a.Spot.Top,"TriangleUp"),Lt(a.Spot.Left,"TriangleLeft"),Lt(a.Spot.Right,"TriangleRight"),Lt(a.Spot.Bottom,"TriangleDown"),cn({alignment:new a.Spot(.75,0)}));function ht(re,he){return(De,ve)=>{De.handled=!0,De.diagram.model.commit(qe=>{qe.set(ve.part.adornedPart.data,re,he)})}}function at(re,he){return he||(he="color"),oe(a.Shape,{width:16,height:16,stroke:"lightgray",fill:re,margin:1,background:"transparent",mouseEnter:(De,ve)=>ve.stroke="dodgerblue",mouseLeave:(De,ve)=>ve.stroke="lightgray",click:ht(he,re),contextClick:ht(he,re)})}function Ut(){return[oe("ContextMenuButton",oe(a.Panel,"Horizontal",at(Ze.white,"fill"),at(Ze.beige,"fill"),at(Ze.extralightblue,"fill"),at(Ze.extralightred,"fill"))),oe("ContextMenuButton",oe(a.Panel,"Horizontal",at(Ze.lightgray,"fill"),at(Ze.lightgreen,"fill"),at(Ze.lightblue,"fill"),at(Ze.lightred,"fill")))]}function Kt(){return[oe("ContextMenuButton",oe(a.Panel,"Horizontal",at(Ze.black),at(Ze.green),at(Ze.blue),at(Ze.red))),oe("ContextMenuButton",oe(a.Panel,"Horizontal",at(Ze.white),at(Ze.magenta),at(Ze.purple),at(Ze.orange)))]}function Yt(re,he){return he||(he="thickness"),oe(a.Shape,"LineH",{width:16,height:16,strokeWidth:re,margin:1,background:"transparent",mouseEnter:(De,ve)=>ve.background="dodgerblue",mouseLeave:(De,ve)=>ve.background="transparent",click:ht(he,re),contextClick:ht(he,re)})}function dn(re,he){return he||(he="dash"),oe(a.Shape,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:re,margin:1,background:"transparent",mouseEnter:(De,ve)=>ve.background="dodgerblue",mouseLeave:(De,ve)=>ve.background="transparent",click:ht(he,re),contextClick:ht(he,re)})}function Jt(){return[oe("ContextMenuButton",oe(a.Panel,"Horizontal",Yt(1),Yt(2),Yt(3),Yt(4))),oe("ContextMenuButton",oe(a.Panel,"Horizontal",dn(null),dn([2,4]),dn([4,4])))]}function vt(re,he){return he||(he="figure"),oe(a.Shape,{width:32,height:32,scale:.5,fill:"lightgray",figure:re,margin:1,background:"transparent",mouseEnter:(De,ve)=>ve.fill="dodgerblue",mouseLeave:(De,ve)=>ve.fill="lightgray",click:ht(he,re),contextClick:ht(he,re)})}E.current.nodeTemplate.contextMenu=oe("ContextMenu",oe("ContextMenuButton",oe(a.Panel,"Horizontal",vt("Rectangle"),vt("RoundedRectangle"),vt("Ellipse"),vt("Diamond"))),oe("ContextMenuButton",oe(a.Panel,"Horizontal",vt("Parallelogram2"),vt("ManualOperation"),vt("Procedure"),vt("Cylinder1"))),oe("ContextMenuButton",oe(a.Panel,"Horizontal",vt("Terminator"),vt("CreateRequest"),vt("Document"),vt("TriangleDown"))),Ut(),Kt(),Jt()),E.current.groupTemplate=oe(a.Group,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:a.Spot.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:(re,he)=>{var De=he.addMembers(he.diagram.selection,!0);De||he.diagram.currentTool.doCancel()},avoidable:!1},new a.Binding("location","loc",a.Point.parse).makeTwoWay(a.Point.stringify),oe(a.Panel,"Auto",{name:"BODY"},oe(a.Shape,{parameter1:10,fill:Ze.white,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:a.Spot.AllSides,toSpot:a.Spot.AllSides},new a.Binding("fill"),new a.Binding("stroke","color"),new a.Binding("strokeWidth","thickness"),new a.Binding("strokeDashArray","dash")),oe(a.Placeholder,{background:"transparent",margin:20})),oe(a.TextBlock,{alignment:a.Spot.Top,alignmentFocus:a.Spot.Bottom,font:"bold 12pt sans-serif",editable:!0},new a.Binding("text"),new a.Binding("stroke","color"))),E.current.groupTemplate.selectionAdornmentTemplate=oe(a.Adornment,"Spot",oe(a.Panel,"Auto",oe(a.Shape,{fill:null,stroke:"dodgerblue",strokeWidth:3}),oe(a.Placeholder,{margin:1.5})),cn({alignment:a.Spot.TopRight,alignmentFocus:a.Spot.BottomRight})),E.current.groupTemplate.contextMenu=oe("ContextMenu",Ut(),Kt(),Jt()),E.current.linkTemplate=oe(a.Link,{layerName:"Foreground",routing:a.Link.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new a.Binding("fromSpot","fromSpot",a.Spot.parse),new a.Binding("toSpot","toSpot",a.Spot.parse),new a.Binding("fromShortLength","dir",re=>re>=1?10:0),new a.Binding("toShortLength","dir",re=>re>=1?10:0),new a.Binding("points").makeTwoWay(),oe(a.Shape,{strokeWidth:2},new a.Binding("stroke","color"),new a.Binding("strokeWidth","thickness"),new a.Binding("strokeDashArray","dash")),oe(a.Shape,{segmentIndex:0,segmentOffset:new a.Point(15,0),segmentOrientation:a.Link.OrientAlong,alignmentFocus:a.Spot.Right,figure:"circle",width:10,strokeWidth:0},new a.Binding("fill","color"),new a.Binding("visible","dir",re=>re===1)),oe(a.Shape,{segmentIndex:-1,segmentOffset:new a.Point(-10,6),segmentOrientation:a.Link.OrientPlus90,alignmentFocus:a.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new a.Binding("fill","color"),new a.Binding("visible","dir",re=>re>=1),new a.Binding("width","thickness",re=>7+3*re),new a.Binding("height","thickness",re=>7+3*re),new a.Binding("segmentOffset","thickness",re=>new a.Point(-15,4+1.5*re))),oe(a.Shape,{segmentIndex:0,segmentOffset:new a.Point(15,-6),segmentOrientation:a.Link.OrientMinus90,alignmentFocus:a.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new a.Binding("fill","color"),new a.Binding("visible","dir",re=>re===2),new a.Binding("width","thickness",re=>7+3*re),new a.Binding("height","thickness",re=>7+3*re),new a.Binding("segmentOffset","thickness",re=>new a.Point(-15,4+1.5*re))),oe(a.TextBlock,{alignmentFocus:new a.Spot(0,1,-4,0),editable:!0},new a.Binding("text").makeTwoWay(),new a.Binding("stroke","color"))),E.current.linkTemplate.selectionAdornmentTemplate=oe(a.Adornment,oe(a.Shape,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:fn(2)},new a.Binding("pathPattern","thickness",fn)),cn({alignmentFocus:new a.Spot(0,0,-6,-4)}));function fn(re){return oe(a.Shape,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(re+4).toString()+" H3"})}function $t(re){var he="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return re===0?he="M0 0 M16 16 M0 8 L16 8":re===2&&(he="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),oe(a.Shape,{geometryString:he,margin:2,background:"transparent",mouseEnter:(De,ve)=>ve.background="dodgerblue",mouseLeave:(De,ve)=>ve.background="transparent",click:ht("dir",re),contextClick:ht("dir",re)})}function bn(re){var he=(De,ve)=>{De.handled=!0,De.diagram.model.commit(qe=>{var rt=ve.part.adornedPart;qe.set(rt.data,re?"toSpot":"fromSpot",a.Spot.stringify(a.Spot.AllSides)),(re?rt.toNode:rt.fromNode).invalidateConnectedLinks()})};return oe(a.Shape,{width:12,height:12,fill:"transparent",mouseEnter:(De,ve)=>ve.background="dodgerblue",mouseLeave:(De,ve)=>ve.background="transparent",click:he,contextClick:he})}function ne(re,he){var De=0,ve=a.Spot.RightSide;re.equals(a.Spot.Top)?(De=270,ve=a.Spot.TopSide):re.equals(a.Spot.Left)?(De=180,ve=a.Spot.LeftSide):re.equals(a.Spot.Bottom)&&(De=90,ve=a.Spot.BottomSide),he||(De-=180);var qe=(rt,mt)=>{rt.handled=!0,rt.diagram.model.commit(wt=>{var _t=mt.part.adornedPart;wt.set(_t.data,he?"toSpot":"fromSpot",a.Spot.stringify(ve)),(he?_t.toNode:_t.fromNode).invalidateConnectedLinks()})};return oe(a.Shape,{alignment:re,alignmentFocus:re.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:De,background:"transparent",mouseEnter:(rt,mt)=>mt.background="dodgerblue",mouseLeave:(rt,mt)=>mt.background="transparent",click:qe,contextClick:qe})}E.current.linkTemplate.contextMenu=oe("ContextMenu",Kt(),Jt(),oe("ContextMenuButton",oe(a.Panel,"Horizontal",$t(0),$t(1),$t(2))),oe("ContextMenuButton",oe(a.Panel,"Horizontal",oe(a.Panel,"Spot",bn(!1),ne(a.Spot.Top,!1),ne(a.Spot.Left,!1),ne(a.Spot.Right,!1),ne(a.Spot.Bottom,!1)),oe(a.Panel,"Spot",{margin:new a.Margin(0,0,0,2)},bn(!0),ne(a.Spot.Top,!0),ne(a.Spot.Left,!0),ne(a.Spot.Right,!0),ne(a.Spot.Bottom,!0)))));const Nn=`{ "class": "GraphLinksModel",
"nodeDataArray": [
{"text":"Find Problem","key":-9,"loc":"-20 -140","color":"#3358ff","fill":"white","figure":"Procedure","thickness":3},
{"text":"What do we want?","key":-10,"loc":"-65 -324.305","group":-16,"figure":"Ellipse","fill":"white"},
{"text":"What do our users want?","key":-11,"loc":"105 -334.305","group":-20,"figure":"Ellipse","fill":"#ffffff","color":"black"},
{"text":"Meetings","key":-12,"loc":"-65 -444.305","group":-16,"figure":"TriangleDown","fill":"#ffffff"},
{"text":"Reviews","key":-13,"loc":"105 -454.305","group":-20,"figure":"TriangleDown","fill":"#ffffff","color":"black"},
{"text":"Can we solve it?","key":-14,"loc":"190 -140","color":"#7d33ff","fill":"#ffffff","figure":"Diamond","size":"140 80","thickness":3},
{"isGroup":true,"text":"Internal","key":-16,"loc":"-65 -384.305","fill":"#d5ebff","dash":null,"thickness":1,"group":-22},
{"isGroup":true,"text":"External","key":-20,"loc":"105 -394.305","fill":"#d5ebff","dash":null,"thickness":1,"group":-22},
{"isGroup":true,"text":"Sources","key":-22,"loc":"20 -400","fill":"#a5d2fa","dash":[4,4],"color":"#3358ff"}
],
"linkDataArray": [
{"from":-12,"to":-10,"points":[-65,-414.305,-65,-404.305,-65,-384.305,-65,-384.305,-65,-364.305,-65,-354.305],"dash":null,"dir":1},
{"from":-13,"to":-11,"points":[105,-424.305,105,-414.305,105,-394.305,105,-394.305,105,-374.305,105,-364.305],"dash":null,"color":"#000000","dir":1},
{"from":-10,"to":-9,"points":[-65,-294.305,-65,-284.305,-65,-232.1525,-40,-232.1525,-40,-180,-40,-170],"dir":2,"dash":[4,4]},
{"from":-11,"to":-9,"points":[105,-304.305,105,-294.305,105,-237.1525,0,-237.1525,0,-180,0,-170],"dash":[4,4],"dir":2},
{"from":-9,"to":-14,"points":[40,-150,58,-150,80,-150,80,-153.33333333333331,102,-153.33333333333331,120,-153.33333333333331],"dir":1,"color":"#3358ff"},
{"from":-14,"to":-9,"points":[190,-100,190,-90,-20,-90,-20,-95,-20,-100,-20,-110],"fromSpot":"BottomSide","toSpot":"BottomSide","text":"No","color":"#ff3333","thickness":2,"dir":1},
{"from":-9,"to":-14,"points":[40,-130,58,-130,80,-130,80,-126.66666666666666,102,-126.66666666666666,120,-126.66666666666666]}
]}`;var Xt=["Rectangle","Square","RoundedRectangle","Border","Ellipse","Circle","TriangleRight","TriangleDown","TriangleLeft","TriangleUp","Triangle","Diamond","LineH","LineV","None","BarH","BarV","MinusLine","PlusLine","XLine","LineRight","LineDown","LineLeft","LineUp"];function mn(re){return console.log("shapeName:",re),Xt.indexOf(re)>=0}var Dt=new a.Palette(Se.current,{maxSelectionCount:1,linkTemplate:oe(a.Link,{locationSpot:a.Spot.Center,selectionAdornmentTemplate:oe(a.Adornment,"Link",{locationSpot:a.Spot.Center},oe(a.Shape,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),oe(a.Shape,{toArrow:"Standard",stroke:null}))},{routing:a.Link.AvoidsNodes,curve:a.Link.JumpOver,corner:5,toShortLength:4},new a.Binding("points"),oe(a.Shape,{isPanelMain:!0,strokeWidth:2}),oe(a.Shape,{toArrow:"Standard",stroke:null})),model:new a.GraphLinksModel([{text:"\u672A\u547D\u540D",size:"100 100",fill:null,stroke:"#000"},...a.Shape.getFigureGenerators().toArray().map(re=>({text:"\u672A\u547D\u540D",size:"100 100",figure:re.key,fill:"white",stroke:"#666",borderColor:"#000"}))])});return Dt.nodeTemplate=oe(a.Node,"Auto",{locationSpot:a.Spot.Center},new a.Binding("location","location",a.Point.parse).makeTwoWay(a.Point.stringify),oe(a.Shape,"Circle",{fill:"white",stroke:"gray",strokeWidth:2,width:20,height:20,portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromLinkableSelfNode:!0,toLinkableSelfNode:!0},new a.Binding("stroke").makeTwoWay(),new a.Binding("fill").makeTwoWay(),new a.Binding("figure")),oe(a.TextBlock,{margin:new a.Margin(5,5,3,5),font:"10pt sans-serif",minSize:new a.Size(16,16),maxSize:new a.Size(10,NaN),textAlign:"center",editable:!0},new a.Binding("key").makeTwoWay())),setTimeout(()=>{E.current.grid=oe(a.Panel,"Grid",oe(a.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),oe(a.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),E.current.grid.visible=!0,E.current.grid.gridCellStroke="darkgray",E.current.grid.gridCellStrokeWidth=1},300),window.myDiagrams=E.current,E.current}const Ct=()=>jt(this,null,function*(){var oe=E.current.makeImage();const Ze=yield(0,Wt.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:oe.src}});x({src:Ze.url})});return(0,y.useEffect)(()=>{Je(Ie+1)},[]),y.createElement("div",{ref:Ve,className:we.current?`${Vt.maxH60} body-overflow-initial`:"body-overflow-initial"},y.createElement(st.default,{width:1200,icon:null,footer:null,closable:!0,visible:!!Ie,destroyOnClose:!0,maskClosable:!1,getContainer:Ve.current,rootClassName:"zIndex-9999",title:y.createElement(ie.Z,null,y.createElement(Ke.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),y.createElement(Ke.Z,{onClick:()=>{we.current=!we.current,Je(Ie+1)}},y.createElement("span",{className:"current c-blue mr30",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77"))),onCancel:b},y.createElement("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative"}},y.createElement("div",{style:{display:"flex",height:"100%"}},y.createElement("div",{style:{width:"300px",height:"100%"}},y.createElement("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"}},"\u56FE\u5F62\u5E93"),y.createElement("div",{style:{height:"calc(100% - 50px)"},className:Vt.myPaletteDiv,ref:Se})),y.createElement("div",{style:{flex:1,position:"relative"}},y.createElement(We.FI,{initDiagram:ot,divClassName:"diagram-component",style:{height:"80vh"}}),y.createElement("div",{ref:le}))),y.createElement("div",{className:"tr"},y.createElement(Ye.ZP,{size:"large",onClick:Ct,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))))}var on=hn,Tt=z(98554),vn=z(25560);const Zt=Tt.ZP.Group,xt={margin:"0 8px"};var rn=({callback:b,onCancel:x})=>{function E(le){b(le)}return y.createElement(Re.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:E},y.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},y.createElement("span",{style:xt},"\u5355\u5143\u683C\u6570\uFF1A"),y.createElement("span",{style:xt},"\u884C\u6570"),y.createElement(Re.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},y.createElement(vn.Z,null)),y.createElement("span",{style:xt},"\u5217\u6570"),y.createElement(Re.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},y.createElement(vn.Z,null))),y.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},y.createElement("span",{style:xt},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),y.createElement(Re.default.Item,{name:"align"},y.createElement(Zt,null,y.createElement(Tt.ZP,{value:"default"},y.createElement("i",{className:"fa fa-align-justify"})),y.createElement(Tt.ZP,{value:"left"},y.createElement("i",{className:"fa fa-align-left"})),y.createElement(Tt.ZP,{value:"center"},y.createElement("i",{className:"fa fa-align-center"})),y.createElement(Tt.ZP,{value:"right"},y.createElement("i",{className:"fa fa-align-right"}))))),y.createElement("div",{className:"flex-container flex-end"},y.createElement(Ye.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.createElement(Ye.ZP,{type:"ghost",onClick:x},"\u53D6\u6D88")))},pt=z(78673),St=z(2901),wn=z.n(St),Kn=(0,y.forwardRef)(({use3d:b,width:x,height:E,callback:le,showSaveButton:Se},we)=>{const Ve=(0,y.useRef)(),Ie=(0,y.useRef)(),[Je,ot]=(0,y.useState)(!1),Ct=(0,y.useRef)({id:Ve,appName:"graphing",width:x||1e3,height:E||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,y.useEffect)(()=>{Ie.current=new(wn())(Ct.current,!0),window.onload=function(){Ie.current.inject("applet_container")}},[]);const oe=()=>{var Ze=window.ggbApplet.getPNGBase64(1,!0,72);return le&&le(Ze),Ze};return(0,y.useEffect)(()=>{Ct.current.appName=Je?"3D":"graphing",Ie.current.inject("applet_container")},[Je]),(0,y.useEffect)(()=>{ot(b)},[b]),(0,y.useImperativeHandle)(we,()=>({getImgData:oe})),y.createElement(y.Fragment,null,y.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:Ve}),y.createElement(ie.Z,{align:"middle"},y.createElement(Ke.Z,{flex:1},y.createElement(pt.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:Je,onChange:Ze=>ot(Ze)})),y.createElement(Ke.Z,null,y.createElement(Ye.ZP,{size:"large",onClick:oe,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),Yn=z(10582),Nt=z(66593),Jn=z(8591);const an="link",ln="upload-image",At="add-flowchart",zt="draw-image",Xn="add-flowchart",sn="code-block",un="add-table",yn="------------",Qn={default:yn,left:`:${yn}`,center:`:${yn}:`,right:`${yn}:`};var qn=z(68568);function vi(){}let wi=0;const An=1e4,ei="\u2581",Ln="@\u2581\u2581@",Dn="@\u2581@",ti=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`,Mn=["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 Fn(b){return/^\d+$/.test(b)?`${b}px`:b}const On=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",ni={[On+"-B"]:"bold",[On+"-I"]:"italic"},Cn={[an]:"\u6DFB\u52A0\u94FE\u63A5",[sn]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[ln]:"\u6DFB\u52A0\u56FE\u7247",[zt]:"\u6DFB\u52A0\u753B\u56FE",[At]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[un]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var ii=({defaultValue:b="",onChange:x,width:E="100%",height:le=400,miniToolbar:Se=!1,isFocus:we=!1,watch:Ve,insertTemp:Ie,mode:Je="markdown",id:ot="markdown-editor-id",showResizeBar:Ct=!1,noStorage:oe=!1,showNullButton:Ze=!1,showNullProgramButton:Lt=!1,hidetoolBar:cn=!1,fullScreen:ht=!1,onBlur:at,onCMBeforeChange:Ut,onFullScreen:Kt,className:Yt="",disablePaste:dn=!1,disabled:Jt=!1,disabledFill:vt=!1,placeholder:fn="",values:$t="",extraUse:bn})=>{const[ne,Nn]=(0,y.useState)(null),[Xt,mn]=(0,y.useState)(b),[Dt,re]=(0,y.useState)(Ve),[he,De]=(0,y.useState)(ht),[ve,qe]=(0,y.useState)(""),[rt,mt]=(0,y.useState)(0),[wt,_t]=(0,y.useState)(le),[Gn,Qt]=(0,y.useState)(!1),[Rn,In]=(0,y.useState)(0),[Hn,Wn]=(0,y.useState)(0),qt=(0,y.useRef)(),_n=(0,y.useRef)(),En=(0,y.useRef)(),Sn=(0,y.useRef)();(0,y.useEffect)(()=>{const me=window.scrollY||window.pageYOffset;mn($t),ne==null||ne.setValue($t),window.scrollTo(0,me)},[$t]),(0,y.useEffect)(()=>{Kt==null||Kt(he)},[he]),(0,y.useEffect)(()=>{if(qt.current){let me=function(ge,fe){var ze;if(dn){fe.preventDefault();return}const et=fe.clipboardData;if(et){const gt=et.types.toString(),ut=et.items;if(gt==="Files"||et.types.indexOf("Files")>-1){if(fe.preventDefault(),Je=="stex")return;try{let dt=ut[1];((ze=ut[0])==null?void 0:ze.kind)==="file"&&(dt=ut[0]);const ft=dt.getAsFile(),Ft=ft.name.split(".").pop();(0,ee.I)(ft,kt=>{var Bn,kn,Tn;kt.id?((Bn=ft==null?void 0:ft.type)==null?void 0:Bn.indexOf("image"))>-1?se.replaceSelection(`![,](/api/attachments/${kt.id}?type=${kt.content_type})`):((kn=ft==null?void 0:ft.type)==null?void 0:kn.indexOf("video"))>-1?se.replaceSelection(`<video width="100%" controls src="${Nt.Z.API_SERVER}/api/attachments/${kt.id}"></video>`):((Tn=ft==null?void 0:ft.type)==null?void 0:Tn.indexOf("pdf"))>-1?se.replaceSelection(`<a href="${Nt.Z.API_SERVER}/api/attachments/${kt.id}?type=${ft.type}&disposition=inline" target="_blank">${ft.name}</a>`):Mn.includes(Ft)?se.replaceSelection(`<a href="${Nt.Z.API_SERVER}/api/attachments/${kt.id}?type=office&disposition=inline" target="_blank">${ft.name}</a>`):se.replaceSelection(`[${ft.name}](${Nt.Z.API_SERVER}/api/attachments/${kt.id}?type=${kt.content_type})`):(kt==null?void 0:kt.status)===401&&(document.location.href="/user/login")})}catch(dt){Jn.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const se=Le().fromTextArea(qt.current,{mode:Je,lineNumbers:!Se,lineWrapping:!0,value:b,autoCloseTags:!0,autoCloseBrackets:!0});return se.on("keyup",function(ge,fe){fe.keyCode===8&&(ge.getValue()==""?se.setOption("placeholder",fn):se.setOption("placeholder",null))}),se.on("keydown",function(ge,fe){if(fe.keyCode===8){var ze=oi(ge);ze&&fe.preventDefault()}}),we&&se.focus(),se.on("paste",me),Jt&&se.on("beforeChange",function(ge,fe){(fe.origin==="paste"||fe.origin==="+input")&&fe.cancel()}),Nn(se),()=>{se.off("paste",me)}}},[]);const jn=(0,y.useCallback)(()=>{if(_n.current)try{}catch(me){console.log(me,"---- to set md editor body height")}},[wt,_n,he]);(0,y.useEffect)(()=>{function me(){let se=new Ce.Z(ge=>{for(let fe of ge)(fe.target.offsetHeight>0||fe.target.offsetWidth>0)&&(jn(),ne.setSize("100%","100%"),ne.refresh())});return se.observe(qt.current.parentElement),se}if(ne){const se=me();return()=>{var ge,fe;(ge=qt.current)!=null&&ge.parentElement&&se.unobserve((fe=qt.current)==null?void 0:fe.parentElement)}}},[ne,jn]),(0,y.useEffect)(()=>{if(ne){let me=[];for(const[se,ge]of Object.entries(ni)){let fe={[se]:()=>{zn(ge)}};me.push(fe),ne.addKeyMap(fe)}return()=>{for(let se of me)ne.removeKeyMap(se)}}},[ne]),(0,y.useEffect)(()=>{ht!==he&&De(ht)},[ht]),(0,qn.Z)(()=>{if(!oe&&rt>0){let me=new Date().getTime(),se=window.sessionStorage.getItem(ot);me>=rt+An&&(!se||se!==Xt)&&(window.sessionStorage.setItem(ot,Xt),Qt(!0))}},An),(0,y.useEffect)(()=>{re(Ve)},[ne,Ve]),(0,y.useEffect)(()=>{ne&&we&&ne.focus()},[ne,we]),(0,y.useEffect)(()=>{if(Dt&&ne){let me=function(ge){let fe=ge.target;if(Sn.current){let ze=fe.scrollTop/fe.scrollHeight;Sn.current.scrollTop=Sn.current.scrollHeight*ze}};const se=ne.getScrollerElement();return se.addEventListener("scroll",me),()=>{se.removeEventListener("scroll",me)}}},[ne,Dt]),(0,y.useEffect)(()=>{if(ne&&Ut){let me=function(se,ge){Ut(se,ge)};return ne.on("beforeChange",me),()=>{ne.off("beforeChange",me)}}},[ne,Ut]),(0,y.useEffect)(()=>{if(ne&&at){let me=function(){at(ne.getValue())};return ne.on("blur",me),()=>{ne.off("blur",me)}}},[ne,at]);function oi(me,se){var ge=me.getDoc(),fe=ge.getCursor(),ze=ge.getLine(fe.line),et=ze.charAt(fe.ch-1),gt=ze.lastIndexOf("@\u2581@",fe.ch),ut=ze.lastIndexOf("@\u2581\u2581@",fe.ch),dt=gt>ut?gt:ut,ft=gt>ut?3:4;if(Ln.indexOf(et)===-1)return null;if(console.log("change1:",se,me,ze,fe,dt,gt,ut,et),dt>=0&&fe.ch-dt<5){var Ft=dt+ft;return ge.replaceRange("",{line:fe.line,ch:dt},{line:fe.line,ch:Ft}),{line:fe.line,ch:Ft}}return null}(0,y.useEffect)(()=>{if(ne){let me=function(se,ge){const fe=se.getValue();mn(fe),mt(new Date().getTime()),se.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),x&&(Lt?x(fe,ui(fe)):x(fe))};return ne.on("change",me),()=>{ne.off("change",me)}}},[ne,x]),(0,y.useEffect)(()=>{if(ne)if(b==null)ne.setValue(""),mn("");else{const me=window.scrollY||window.pageYOffset;b!==ne.getValue()&&(ne.setValue(b),mn(b),ne.setCursor(Jt?1:ne.lineCount(),0),window.scrollTo(0,me))}},[ne,b]);const zn=(0,y.useCallback)(me=>{const se=ne.getCursor(),ge=ne.getSelection();let fe=ge.split(`
`);switch(me){case"bold":return ne.replaceSelection("**"+ge+"**"),ge===""&&ne.setCursor(se.line,se.ch+2),ne.focus();case"italic":return ne.replaceSelection("*"+ge+"*"),ge===""&&ne.setCursor(se.line,se.ch+1),ne.focus();case"code":return ne.replaceSelection("`"+ge+"`"),ge===""&&ne.setCursor(se.line,se.ch+1),ne.focus();case"inline-latex":return qe("inline-latex"),ne.focus();case"latex":return ne.replaceSelection("```latex\n"+ge+"\n```"),ne.setCursor(se.line+1,ge.length+1),ne.focus();case"line-break":return ne.replaceSelection(`<br/>
`),ne.focus();case"list-ul":return ge===""?ne.replaceSelection("- "+ge):ne.replaceSelection(fe.map(ze=>ze===""?"":`- ${ze}`).join(`
`)),ne.focus();case"list-ol":return ge===""?ne.replaceSelection("1. "+ge):ne.replaceSelection(fe.map((ze,et)=>ze===""?"":`${et+1}. ${ze}`).join(`
`)),ne.focus();case"add-null-ch":return ge===""&&ne.setCursor(se.line,se.ch),ne.replaceSelection(ei),ne.focus();case"add-signal":return ge===""&&ne.setCursor(se.line,se.ch),ne.replaceSelection(Dn),ne.focus();case"add-multiple":return ge===""&&ne.setCursor(se.line,se.ch),ne.replaceSelection(Ln),ne.focus();case"inster-template-1":return ge===""&&ne.setCursor(se.line,se.ch),ne.replaceSelection(ti),ne.focus();case"eraser":return ne.setValue(""),ne.focus();case"trigger-watch":return re(!Dt),ne.focus();case"trigger-full-screen":return De(!he),ne.focus();case an:qe(an);return;case sn:qe(sn);return;case ln:qe(ln);return;case zt:qe(zt);return;case"maths-latex":qe("maths-latex");return;case At:qe(At);return;case un:qe(un);return;default:throw new Error}},[ne,Dt,he]),Mt=(0,y.useCallback)((me,se)=>{var ge,fe,ze,et,gt,ut;switch(qe(""),ve){case an:const{title:Bn,link:kn}=me;return ne.replaceSelection(`[${Bn}](${kn})`),ne.focus();case sn:const{language:Tn,content:fi}=me;return ne.replaceSelection(["```"+Tn,fi,"```"].join(`
`)),ne.focus();case"maths-latex":for(var dt=atob(me),ft=new Uint8Array(dt.length),Ft=0;Ft<dt.length;Ft++)ft[Ft]=dt.charCodeAt(Ft);var kt=new Blob([ft],{type:"image/png"});(0,ee.I)(kt,Pt=>{Pt.id?ne.replaceSelection(`![,](/api/attachments/${Pt.id}?type=${Pt.content_type})`):(Pt==null?void 0:Pt.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":ne.replaceSelection("`$$"+me+"$$`");break;case ln:case zt:case Xn:const{src:en,alt:Pn}=me,yt=se,mi=(ze=(fe=(ge=yt==null?void 0:yt.name)==null?void 0:ge.split("."))==null?void 0:fe.pop)==null?void 0:ze.call(fe);return((et=yt==null?void 0:yt.type)==null?void 0:et.indexOf("image"))>-1||!(yt!=null&&yt.type)?Pn?ne.replaceSelection(`![ ${Pn} ]( ${en} "${Pn}" )`):ne.replaceSelection(`![,](${en})`):((gt=yt==null?void 0:yt.type)==null?void 0:gt.indexOf("video"))>-1?ne.replaceSelection(`<video width="100%" controls src="${Nt.Z.API_SERVER}${en}"></video>`):((ut=yt==null?void 0:yt.type)==null?void 0:ut.indexOf("pdf"))>-1?ne.replaceSelection(`<a href="${Nt.Z.API_SERVER}${en}?type=${yt.type}&disposition=inline" target="_blank">${yt.name}</a>`):Mn.includes(mi)?ne.replaceSelection(`<a href="${Nt.Z.API_SERVER}${en}?type=office&disposition=inline" target="_blank">${yt.name}</a>`):ne.replaceSelection(`[${yt.name}](${Nt.Z.API_SERVER}${en})`),ne.focus();case un:const{row:gi,col:$n,align:pi}=me;let xn=`
`;for(let Pt=0;Pt<gi;Pt++){let Vn=[],Zn=[];for(let Un=0;Un<$n;Un++)Pt===1&&Zn.push(Qn[pi]),Vn.push(" ");Pt===1&&(xn+=`| ${Zn.join(" | ")} |
`),xn+=`| ${Vn.join($n===1?"":" | ")} |
`}return ne.replaceSelection(xn+`
`),ne.focus();default:throw new Error}},[ne,ve]),ri=(0,y.useMemo)(()=>{switch(ve){case an:return y.createElement(nn,{callback:Mt,onCancel:Gt});case sn:return y.createElement(pn.Z,{callback:Mt,onCancel:Gt});case ln:return y.createElement(ee.Z,{callback:Mt,onCancel:Gt});case At:return y.createElement(on,{callback:Mt,onCancel:Gt});case un:return y.createElement(rn,{callback:Mt,onCancel:Gt});case"maths-latex":return y.createElement(Kn,{showSaveButton:!0,callback:Mt});case"inline-latex":return y.createElement(Yn.Z,{showSaveButton:!0,callback:Mt});default:return null}},[ve]);function Gt(){qe("")}(0,y.useEffect)(()=>{if(En.current){let me=function(gt){ze=!0,et=gt.pageY},se=function(){ze=!1},ge=function(gt){if(ze){let ut=gt.pageY-et;ut<0&&(ut=0),ut>300&&(ut=300);let dt=le+ut+"px";_t(dt)}},fe=En.current,ze=!1,et=0;return fe.addEventListener("mousedown",me),document.addEventListener("mousemove",ge),document.addEventListener("mouseup",se),()=>{fe.removeEventListener("mousedown",me),document.removeEventListener("mousemove",ge),document.removeEventListener("mouseup",se)}}},[ne,En]),(0,y.useEffect)(()=>{_t(le)},[le]);const ai=Fn(E),li=Fn(wt),si={width:ai,height:li},bi=(0,y.useMemo)(()=>{if(rt){let me=new Date(rt),se=me.getHours(),ge=me.getMinutes(),fe=me.getSeconds();return se=se<10?"0"+se:se,ge=ge<10?"0"+ge:ge,fe=fe<10?"0"+fe:fe,`${se}:${ge}:${fe}`}return 0},[rt]),ui=me=>{const se=[];if(Lt){let ge=-1;me=me.replace(/(@▁▁@|@▁@)/g,function(fe,ze,et){se.push({multiLine:fe!==Dn})})}return se};function Ei(){window.sessionStorage.removeItem(ot),Qt(!1),mt(0)}function Si(){Qt(!1),mt(0),ne.setValue(window.sessionStorage.getItem(ot))}(0,y.useEffect)(()=>{Cn[ve]&&ve!==zt&&ve!==At&&setTimeout(()=>{const me=document.getElementsByClassName("markdown-popup-form")[0],se=window.innerWidth/2-me.offsetWidth/2,ge=window.innerHeight/2-me.offsetHeight/2;In(se),Wn(ge)},0)},[ve]);const ci=me=>{me.preventDefault();const se=me.clientX-Rn,ge=me.clientY-Hn;document.body.onmousemove=fe=>{let ze=fe.clientX-se,et=fe.clientY-ge;const gt=document.getElementsByClassName("markdown-popup-form")[0],ut=window.innerWidth-gt.offsetWidth,dt=window.innerHeight-gt.offsetHeight;ze=Math.max(0,Math.min(ze,ut)),et=Math.max(0,Math.min(et,dt)),di(fe.clientX,fe.clientY,se,ge)&&(In(ze),Wn(et))},document.body.onmouseup=function(){document.body.onmousemove=null}},di=(me,se,ge,fe)=>{const ze=document.body.clientHeight,et=document.body.clientWidth;return me<20&&ge>me||me>et-20&&ge<me||se<20&&fe>se||se>ze-20&&fe<se?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return y.createElement(y.Fragment,null,y.createElement("div",{className:"markdown-editor-wrapper",ref:_n},y.createElement("div",{className:`markdown-editor-container ${Yt} ${Dt?"on-preview":""} ${Se?"mini":""} ${he?"full-screen":""}`,style:si},y.createElement(je,{insertTemp:Ie,watch:Dt,fullScreen:he,showNullButton:Ze,showNullProgramButton:Lt,onActionCallback:zn,hidetoolBar:cn,extraUse:bn}),y.createElement("div",{className:"markdown-editor-body"},y.createElement("div",{className:"codemirror-container"},y.createElement("textarea",{ref:qt,placeholder:fn})),Dt?y.createElement("div",{ref:Sn,className:"preview-container"},Je==="stex"&&y.createElement(Be,{value:Xt}),Je!=="stex"&&y.createElement(Fe.Z,{disabledFill:vt,showProgramFill:Lt,value:Xt})):null))),Ct?y.createElement("a",{ref:En,className:"editor-resize"}):null,ve===zt&&y.createElement(Oe,{callback:Mt,onCancel:Gt}),ve===At&&y.createElement(on,{callback:Mt,onCancel:Gt}),y.createElement(it.Z,null,Cn[ve]&&ve!==zt&&ve!==At?y.createElement(st.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:Rn,top:Hn},title:y.createElement("div",{style:{cursor:"move"},onMouseDown:ci},Cn[ve]),open:!0,onCancel:Gt,footer:null,destroyOnClose:!0,width:ve===At?"1200px":null,height:ve===At?"80vh":null,className:"markdown-popup-form"},ri):null))}},57213:function(ae,Ae,z){"use strict";z.d(Ae,{Z:function(){return Ne},I:function(){return Ge}});var y=z(78700),Me=z(8591),Le=z(92832),Ce=z(3113),te=z(28979),de=z(59301),be=z(59301),Ee=Object.defineProperty,pe=Object.defineProperties,_e=Object.getOwnPropertyDescriptors,Fe=Object.getOwnPropertySymbols,Be=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable,ke=(xe,Pe,je)=>Pe in xe?Ee(xe,Pe,{enumerable:!0,configurable:!0,writable:!0,value:je}):xe[Pe]=je,Xe=(xe,Pe)=>{for(var je in Pe||(Pe={}))Be.call(Pe,je)&&ke(xe,je,Pe[je]);if(Fe)for(var je of Fe(Pe))ye.call(Pe,je)&&ke(xe,je,Pe[je]);return xe},Ue=(xe,Pe)=>pe(xe,_e(Pe));const{useForm:Qe}=y.default,tt={width:280,marginRight:10},nt={labelCol:{span:5},wrapperCol:{span:19}};var Ne=({callback:xe,onCancel:Pe})=>{const[je]=Qe();let it=(0,de.useRef)();function Re(ct){xe(ct,it.current)}function lt(ct,bt){if(ct.status===-1){Me.ZP.error(ct.message);return}je.setFieldsValue({src:`/api/attachments/${ct.id}`,type:bt.type})}function Ye(ct){let bt=ct.target.files[0];it.current=bt,Ge(bt,lt)}return be.createElement(y.default,Ue(Xe({form:je},nt),{className:"upload-image-panel",onFinish:Re,style:{width:470,overflow:"hidden"}}),be.createElement(y.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},be.createElement("div",{className:"flex-container"},be.createElement(y.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},be.createElement(Le.default,{style:tt})),be.createElement($e,{onFileChange:Ye}))),be.createElement(y.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},be.createElement(Le.default,{style:{width:264}})),be.createElement(y.default.Item,{style:{textAlign:"right"}},be.createElement(Ce.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),be.createElement(Ce.ZP,{type:"default",onClick:Pe},"\u53D6\u6D88")))};function $e({onFileChange:xe}){return be.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",be.createElement("input",{type:"file",onChange:xe}))}function Ge(xe,Pe){if(!xe)throw new String("\u6CA1\u6709\u6587\u4EF6");let je=new FormData;je.append("editormd-image-file",xe),je.append("file_param_name","editormd-image-file"),je.append("byxhr","true");var it=new window.XMLHttpRequest;it.withCredentials=!0,it.addEventListener("load",function(Re){Pe(JSON.parse(Re.target.responseText),xe)},!1),it.addEventListener("error",function(Re){console.error(Re)},!1),it.open("POST",`${te.KI}/api/attachments.json`),it.send(je)}},89767:function(ae,Ae,z){"use strict";z.d(Ae,{Z:function(){return Le}});var y=z(59301),Me=z(4676);class Le extends y.Component{constructor(te){super(te);const de=window.document;this.node=de.createElement("div"),de.body.appendChild(this.node)}render(){const{children:te}=this.props;return(0,Me.createPortal)(te,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},68568:function(ae,Ae,z){"use strict";z.d(Ae,{Z:function(){return Me}});var y=z(59301);function Me(Le,Ce){const te=(0,y.useRef)();(0,y.useEffect)(()=>{te.current=Le}),(0,y.useEffect)(()=>{function de(){te.current()}if(Ce!==null){let be=setInterval(de,Ce);return()=>clearInterval(be)}},[Ce])}}}]);