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.
33 lines
87 KiB
33 lines
87 KiB
(self.webpackChunk=self.webpackChunk||[]).push([[7688],{39592: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={},Le="5.0",z={},y=null,Me=!1,De=!1,Ce=null,te=!1,de=null,be=null,Ee=0;Ee<arguments.length;Ee++){var ve=arguments[Ee];if(ve!==null)switch(typeof ve){case"number":Le=ve.toFixed(1);break;case"string":ve.match(new RegExp("^[0-9]\\.[0-9]+$"))?Le=ve:Ce=ve;break;case"object":typeof ve.is3D!="undefined"?y=ve:z=ve;break;case"boolean":Me=ve,De=!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&&!De&&(Me=!0)),Ce!==null&&z.id===void 0&&(z.id=Ce);var _e="",Fe="",Be=!1,ye=null,ke=null,Xe=null,Ze=!1,qe=null,tt=null,nt=null,Ne=null,Ue=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,jt(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=mn(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")Et(We,z);else{var ot=!1;z.hasOwnProperty("playButton")&&z.playButton||z.hasOwnProperty("clickToLoad")&&z.clickToLoad?ot=!0:z.hasOwnProperty("playButtonAutoDecide")&&z.playButtonAutoDecide&&(ot=(!Pe()||ee())&&xe()),ot?(ye="screenshot",St(We,z,a,ie)):dt(We,z,a)}}};function Pe(){try{return window.self!==window.top}catch(ee){return!0}}function xe(){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(Qe){return Qe.type=="G"||Qe.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 ot="https://www.geogebra.org/images/";ae.setPreviewImage(qe||We.previewUrl,ot+"GeoGebra_loading.png",ot+"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";Ie("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 Ie(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 st=function(ee,ie,ce){var Oe=document.createElement("param");Oe.setAttribute("name",ie),Oe.setAttribute("value",ce),ee.appendChild(Oe)},Ke=function(ee){return ee&&ee!=="false"},dt=function(ee,ie,ce){Ge(ke)<=4.2&&(ce=!0);var Oe=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==ke||ggbHTML5LoadedCodebaseIsWebSimple&&!Ze)&&(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)Ke(ie.showToolBar)&&(ie.height-=7),Ke(ie.showAlgebraInput)&&(ie.height-=37),ie.width<605&&Ke(ie.showToolBar)&&(ie.width=605,ue=605);else{var He=100;(Ke(ie.showToolBar)||Ke(ie.showMenuBar))&&(ie.hasOwnProperty("customToolBar")&&(ie.customToolbar=ie.customToolBar),He=Ke(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(vt){ae.resize()});var ot=typeof ie.appletOnLoad=="function"?ie.appletOnLoad:function(){};if(!ce&&ie.width!==void 0){ie.hasOwnProperty("showSplash")||a.setAttribute("data-param-showSplash","false");var Qe=ee.querySelector(".applet_scaler.prerender"),Lt=Qe!==null;if(Lt)var ut=Qe.querySelector(".ggb_preview");else{var ut=Wt(ue,Te,ie.borderColor,!1);Qe=document.createElement("div"),Qe.className="applet_scaler",Qe.style.position="relative",Qe.style.display="block",Qe.style.width=ue+"px",Qe.style.height=Te+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Qe,"66%"),Ge(ke)>=5?(ie.appletOnLoad=function(vt){var Bt=ee.querySelector(".ggb_preview");Bt&&Bt.parentNode.removeChild(Bt),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(Qe),window.GGBT_wsf_view&&$(window).trigger("resize"),ot(vt)},Lt||Qe.appendChild(ut)):a.appendChild(ut),Qe.appendChild(a),Lt||ee.appendChild(Qe),setTimeout(function(){ae.resize()},1)}else{var zt=document.createElement("div");zt.className="applet_scaler",zt.style.position="relative",zt.style.display="block",zt.appendChild(a),ee.appendChild(zt),ie.appletOnLoad=function(vt){ae.resize(),ot(vt)}}function pn(vt,Bt){Bt&&typeof Bt.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(vt,Bt.appletOnLoad):renderGGBElement(vt),nn("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",Bt)}function on(vt,Bt){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:vt,params:Bt}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(vn){pn(vn.article,vn.params)}),html5AppletsToProcess=null)},Ge(ke)<5&&(vt.className+=" geogebraweb")):pn(vt,Bt)}if(Oe){scriptLoadStarted=!0;for(var _t=0;_t<a.childNodes.length;_t++){var hn=a.childNodes[_t].tagName;hn==="TABLE"&&(a.removeChild(a.childNodes[_t]),_t--)}if(ggbHTML5LoadedScript!==null){var Vt=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');Vt!=null&&Vt.parentNode.removeChild(Vt)}var Dt=document.createElement("script"),rn=function(){on(a,ie)};Dt.src=Fe+Xe,ggbHTML5LoadedCodebaseIsWebSimple=Ze,ggbHTML5LoadedCodebaseVersion=ke,ggbHTML5LoadedScript=Dt.src,nn("GeoGebra HTML5 codebase loaded: '"+Fe+"'.",ie),!be&&(!de||de=="5.0")?(Ze?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),rn()):Fe.requirejs?__webpack_require__.e(4891).then(function(){var vt=[__webpack_require__(34891)];rn.apply(null,vt)}.bind(this)).catch(__webpack_require__.oe):(Dt.onload=rn,ee.appendChild(Dt))}else on(a,ie);ie.height=Te,ie.width=ue},Et=function(ee,ie,ce){var Oe=Wt(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(Ht()),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(){kt(ee,Oe,a,ce)},window.addEventListener("resize",function(Te){ae.resize()}),ae.resize()};function kt(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 St=function(ee,ie,ce,Oe){Et(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),ot=document.getElementById("fullscreencontainer"),Qe=jQuery(ee).find(".fullscreencontent");Qe.length>0?(We.remove(),Qe.attr("id","fullscreencontent").show(),jQuery(ot).append(Qe),window.dispatchEvent(new Event("resize"))):dt(We,ie,!1),window.GGBT_wsf_view.launchFullScreen(ot)}else ye=Oe,dt(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),xe()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},Ht=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},Wt=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,ot;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),ot=We/5.8,He.setAttribute("src",tt),He.setAttribute("width",We),He.setAttribute("height",ot);var Qe=(ee-We)/2,Lt=(ie-ot)/2;He.style.left=Qe+"px",He.style.top=Lt+"px",a.appendChild(He)}}return a.appendChild(Te),a},mn=function(ee){return ee=ee.toLowerCase(),ee==="html5"||ee==="screenshot"?ee:"html5"},It=["web","webSimple","web3d","tablet","tablet3d","phone"],tn=function(ee,ie){if(ke=ee,ie){jt(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 It)if(ke.slice(It[He].length*-1)===It[He]||ke.slice((It[He].length+1)*-1)===It[He]+"/"){jt(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&&!Ke(z.showToolBar)&&!Ke(z.showMenuBar)&&!Ke(z.showAlgebraInput)&&!Ke(z.enableRightClick)&&(!z.appName||z.appName=="classic")?ue+="webSimple/":ue+="web3d/",jt(ue,!1)},jt=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",Ze=!1;var ce=Fe.split("/");ce.length>1&&(!ie&&ce[ce.length-2]==="webSimple"?(Xe="webSimple.nocache.js",Ze=!0):It.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(gn):gn();function gn(){var ee=Le;de!==null?ee=de:parseFloat(ee)<5&&(ee="5.0"),tn(ee,!1),be!==null&&jt(be,Be),te=!0}return ae},GGBAppletUtils=function(){"use strict";function ae(){return window.GGBT_wsf_edit!==void 0}function Le(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,ve,_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,Ze=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&&(ve===void 0||!ve)&&(document.dir==="rtl"?(qe=ye-Ne.width-Ne.left,tt=Xe<=480?10:30):(tt=Ne.left,qe=Xe<=480?10:30),Ze=tt+qe)}if(te&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var Ue=te.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(Ze=40,nt=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(Ze=0,nt=40)}}return te&&((be===void 0||!be)&&de>0&&de+Ze<ye?ye=de:ye-=Ze,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,ve){if(te.isScreenshoGenerator)return 1;var _e=Ee!==void 0&&Ee,Fe=te.noScaleMargin!=null&&te.noScaleMargin,Be=function(Ue){return Ue&&Ue!=="false"},ye=Be(te.autoHeight),ke=z(de,te.width,be,ye,_e&&window.GGBT_wsf_view||Fe,ve),Xe=parseInt(ke.width),Ze=te.width,qe=te.height;if(Ze===void 0){var tt=de.querySelector(".appletParameters");tt&&(Ze=tt.offsetWidth,qe=tt.offsetHeight)}var nt=Xe/Ze,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,ve,_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))ve=y(te,de,_e,be,te.scaleContainerClass);else return Ee;return _e&&(!te.hasOwnProperty("scale")||Ee===1)?ve:Math.min(Ee,ve)}function De(te){var de=Math.min(window.innerWidth,document.documentElement.clientWidth),be=Math.min(window.innerHeight,document.documentElement.clientHeight),Ee=te.getBoundingClientRect(),ve=(de-Ee.width)/2,_e=(be-Ee.height)/2;_e<0&&(_e=0),te.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(ve<40?te.style.left="40px":te.style.left=ve+"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=ve+"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 ve=null,_e=0;_e<te.childNodes.length;_e++)if(te.childNodes[_e].className!==void 0&&te.childNodes[_e].className.match(/^applet_scaler/)){ve=te.childNodes[_e];break}if(ve!==null&&ve.querySelector(".noscale")!==null)return;var Fe=de.id!==void 0?de.id:"ggbApplet",Be=window[Fe];(Be==null||!Be.recalculateEnvironments)&&ve!==null&&!ve.className.match(/fullscreen/)&&(ve.parentNode.style.transform="",!isNaN(Ee)&&Ee!==1?(ve.parentNode.style.width=de.width*Ee+"px",ve.parentNode.style.height=de.height*Ee+"px",Le(ve,Ee)):(Le(ve,1),ve.parentNode.style.width=de.width+"px",ve.parentNode.style.height=de.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&De(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:De,getScale:Me,scaleElement:Le}}();__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,Le){}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 Le=s[L].bindings;s[L].bindings=function(){for(var z=Le?Le():{},y=ae[webModule.__softPermutationId],Me=O;Me<y.length;Me++){var De=y[Me];z[De[O]]=De[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 Le=document.compatMode==U?V:W;t.write(Le+X),t.close()}}}function w(ae){function Le(y){function Me(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var De=Me();if(De){y();return}function Ce(){if(!De){if(!Me())return;De=!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(),De=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))}),De.appendChild(Ce)}Le(function(){z(ae)})}webModule.__startLoadingFragment=function(ae){return C(ae)},webModule.__installRunAsyncCode=function(ae){var Le=u(),z=Le.body,y=Le.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 Le=c[ae];return Le==null?null:Le},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 Le(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 De(){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&&De()&&(Ce=ae(o.location.href)),Ce=Le(Ce),Ce}function C(ae){return ae.match(/^\//)||ae.match(/^[a-zA-Z]+:\/\//)?ae:webModule.__moduleBase+ae}function D(){var ae=[],Le=O,z=[],y=[];function Me(te){var de=y[te](),be=z[te];if(de in be)return de;var Ee=[];for(var ve in be)Ee[be[ve]]=ve;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 De;try{De=Cb;var Ce=De.indexOf(Db);Ce!=-1&&(Le=parseInt(De.substring(Ce+P),$),De=De.substring(O,Ce))}catch(te){}return webModule.__softPermutationId=Le,C(De+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})()},31662:function(ae,Le,z){"use strict";z.d(Le,{Ax:function(){return Ce},Ds:function(){return te},KI:function(){return be},SI:function(){return De},f1:function(){return Me}});var y=z(36714);function Me(Ee){let ve=!0;if(Ee.length>0){for(let _e=0;_e<Ee.length;_e++)if(Ee[_e].compile_success==0||!Ee[_e].compile_success){ve=!1;break}}else ve=!1;return ve}function De(Ee,ve=""){let _e=[];for(let Fe=0;Fe<Ee.length;Fe++){let Be=Ee[Fe],ye=ve?`${ve}/${Be.name}`:`${Be.name}`;_e.push({title:Be.name,type:Be.type,isLeaf:Be.type!=="tree",key:ye})}return _e}function Ce(Ee,ve,_e){for(let Fe=0;Fe<Ee.length;Fe++){let Be=Ee[Fe];if(Be.key===ve){Be.children=_e;break}Be.children&&Ce(Be.children,ve,_e)}return Ee}function te(Ee,ve,_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,ve),Xe&&Ee.apply(Be,ye)}}const de=!0,be=y.Z.API_SERVER},27808:function(ae,Le,z){"use strict";z.d(Le,{Z:function(){return Fe}});var y=z(59301),Me={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},De=z(92310),Ce=z.n(De),te=z(71418),de=z(2859),be=z(82833),Ee=z(62475),ve=(Be,ye,ke)=>new Promise((Xe,Ze)=>{var qe=Ne=>{try{nt(ke.next(Ne))}catch(Ue){Ze(Ue)}},tt=Ne=>{try{nt(ke.throw(Ne))}catch(Ue){Ze(Ue)}},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:Ze,onOk:qe,showFullTools:tt,noAssociationId:nt})=>{const Ne=(0,y.useRef)(null),Ue=(0,y.useRef)(null),Ge=(0,y.useRef)(null),Pe=(0,y.useRef)(null),[xe,je]=(0,y.useState)(!1),[it,Ie]=(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&&st()):(document.body.removeAttribute("data-custom"),Ge.current&&(document.head.removeChild(Ge.current),Ge.current=null))},[Be==null?void 0:Be.visible]);const st=()=>ve(void 0,null,function*(){je(!0),Ie("\u6B63\u5728\u52A0\u8F7D\u4E2D");const kt=yield(0,Ee.ZJ)(Be==null?void 0:Be.src);Ne.current.src="",Ne.current.src=kt,Ne.current.onload=function(){Et()},je(!1),Ie("")}),Ke=kt=>ve(void 0,null,function*(){je(!0),Ie("\u6B63\u5728\u4FDD\u5B58\u4E2D");const St=yield(0,be.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Be.title,file:kt.dataUrl}});St!=null&&St.id&&!nt?(yield(0,be.ZP)(`/api/attachments/${Be.id}/add_subitem.json`,{method:"post",body:{subitem_id:St==null?void 0:St.id,settings:JSON.stringify(kt.state)}})).status===0&&qe():St!=null&&St.id&&qe(St),je(!1),Ie("")}),dt=()=>{const kt=document.querySelector('a[href="https://markerjs.com/"]');kt&&kt.parentNode&&(kt.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(Ht=>{const Wt=document.querySelector(Ht.name);Wt&&Wt.setAttribute("title",Ht.title)})},Et=()=>{Ue.current=new de.hP(Ne.current),Ue.current.targetRoot=Pe.current,Ue.current.addEventListener("render",Ke),Ue.current.addEventListener("beforeclose",Ze),tt&&(Ue.current.availableMarkerTypes=Ue.current.ALL_MARKER_TYPES,Ue.current.uiStyleSettings.redoButtonVisible=!0,Ue.current.uiStyleSettings.notesButtonVisible=!0,Ue.current.uiStyleSettings.zoomButtonVisible=!0,Ue.current.uiStyleSettings.zoomOutButtonVisible=!0,Ue.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=Ue.current.uiStyleSettings,Ue.current.show(),Be!=null&&Be.snapshotData&&Ue.current.restoreState(Be.snapshotData),setTimeout(()=>{window.scrollTo(0,0),dt()},300)};return y.createElement(y.Fragment,null,(Be==null?void 0:Be.visible)&&y.createElement(te.Z,{spinning:xe,tip:it,style:{position:"absolute"}},y.createElement("div",{ref:Pe,className:Ce()(Me.imageDimensions,ye,ke?Me.fullWidth:""),style:Xe},y.createElement("img",{className:Me.img,ref:Ne}))))}},31756:function(ae,Le,z){"use strict";z.d(Le,{h:function(){return Ue}});var y=z(59301),Me=z(57809),De=z(78700),Ce=z(3113),te=z(89780),de=z.n(te),be=z(97752),Ee=z(96765),ve=Object.defineProperty,_e=Object.defineProperties,Fe=Object.getOwnPropertyDescriptors,Be=Object.getOwnPropertySymbols,ye=Object.prototype.hasOwnProperty,ke=Object.prototype.propertyIsEnumerable,Xe=(Ge,Pe,xe)=>Pe in Ge?ve(Ge,Pe,{enumerable:!0,configurable:!0,writable:!0,value:xe}):Ge[Pe]=xe,Ze=(Ge,Pe)=>{for(var xe in Pe||(Pe={}))ye.call(Pe,xe)&&Xe(Ge,xe,Pe[xe]);if(Be)for(var xe of Be(Pe))ke.call(Pe,xe)&&Xe(Ge,xe,Pe[xe]);return Ge},qe=(Ge,Pe)=>_e(Ge,Fe(Pe));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"]};Le.Z=({callback:Ge,onCancel:Pe})=>{const[xe,je]=(0,y.useState)("python");function it(st){je(Ne[st][1])}function Ie(st){Ge(st)}return y.createElement(De.default,qe(Ze({},nt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Ie,style:{width:500}}),y.createElement(De.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},y.createElement(Me.default,{getPopupContainer:st=>st.parentNode,onChange:it},Object.keys(Ne).map(st=>y.createElement(tt,{key:st,value:st},Ne[st][0])))),y.createElement(De.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},y.createElement(Ue,{mode:xe})),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:Pe},"\u53D6\u6D88")))};function Ue({value:Ge,onChange:Pe,mode:xe,options:je={}}){const it=(0,y.useRef)(),[Ie,st]=(0,y.useState)();return(0,y.useEffect)(()=>{if(Ie){let Ke=function(dt){const Et=dt.getValue();Pe&&Pe(Et)};return Ie.on("change",Ke),()=>{Ie.off("change",Ke)}}},[Ie,Pe]),(0,y.useEffect)(()=>{Ie&&Ie.setOption("mode",xe)},[Ie,xe]),(0,y.useEffect)(()=>{Ie&&(Ge!==Ie.getValue()||Ge==="")&&setTimeout(()=>{Ie.setValue(Ge||"")},300)},[Ie,Ge]),(0,y.useEffect)(()=>{if(it.current&&!Ie){const Ke=de().fromTextArea(it.current,Ze({mode:xe,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},je));st(Ke)}},[it.current,Ie]),y.createElement("div",{className:"my-codemirror-container"},y.createElement("textarea",{ref:it}))}},93539:function(ae,Le,z){"use strict";z.d(Le,{Z:function(){return ni}});var y=z(59301),Me=z(89780),De=z.n(Me),Ce=z(76374),te=z(97752),de=z(6313),be=z(25717),Ee=z(99498),ve=z(25419),_e=z(67549),Fe=z(57119),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,Ze=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,Ue=(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,Ze(x));let Pe=[{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 xe({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:Re})=>{const Ye=[...Pe,{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&&Ye.map((rt,xt)=>ye.createElement("li",{key:xt},rt.actionName?ye.createElement(xe,Ge(Ue({},rt),{onActionCallback:le})):ye.createElement("span",{className:"v-line"}))),x?ye.createElement("li",null,ye.createElement(xe,{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(xe,{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(xe,{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(xe,{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"))),Re&&ye.createElement("li",null,Re),ye.createElement("li",{className:"btn-full-screen"},ye.createElement(xe,{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(36174),Ie=z(78700),st=z(92832),Ke=z(3113),dt=Object.defineProperty,Et=Object.defineProperties,kt=Object.getOwnPropertyDescriptors,St=Object.getOwnPropertySymbols,Ht=Object.prototype.hasOwnProperty,Wt=Object.prototype.propertyIsEnumerable,mn=(b,x,E)=>x in b?dt(b,x,{enumerable:!0,configurable:!0,writable:!0,value:E}):b[x]=E,It=(b,x)=>{for(var E in x||(x={}))Ht.call(x,E)&&mn(b,E,x[E]);if(St)for(var E of St(x))Wt.call(x,E)&&mn(b,E,x[E]);return b},tn=(b,x)=>Et(b,kt(x));const jt={labelCol:{span:4},wrapperCol:{span:20}};var nn=({callback:b,onCancel:x})=>{function E(le){b(le)}return y.createElement(Ie.default,tn(It({},jt),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:E,style:{width:500}}),y.createElement(Ie.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},y.createElement(st.default,null)),y.createElement(Ie.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},y.createElement(st.default,null)),y.createElement("div",{className:"flex-container flex-end"},y.createElement(Ke.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.createElement(Ke.ZP,{type:"ghost",onClick:x},"\u53D6\u6D88")))},gn=z(31756),ee=z(73140),ie=z(95237),ce=z(27808),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(Re){Re instanceof go.Link||E.push(Re)});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(Re){Re instanceof go.Link||E.push(Re)});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 Re=le[Ve];if(Re!==x&&Re.canSelect()){var Ye=Re.actualBounds.center,rt=E.directionPoint(Ye),xt=this._angleCloseness(rt,b);if(xt<=45){var oe=E.distanceSquaredPoint(Ye);oe*=1+Math.sin(xt*Math.PI/180),oe<Se&&(Se=oe,we=Re)}}}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 Re=we.elt(Ve-1);Re!==null&&Re.isTreeExpanded&&!Re.isTreeLeaf;){var Ye=this._sortTreeChildrenByY(Re);Re=Ye.last()}Re!==null&&b.select(Re)}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 rt=b.selection.first();rt!==null&&b.scrollToRect(rt.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(63066),We=z(43418),ot=z(43604),Qe=z(82833),Lt={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},ut=z(59301),zt=(b,x,E)=>new Promise((le,Se)=>{var we=Ye=>{try{Re(E.next(Ye))}catch(rt){Se(rt)}},Ve=Ye=>{try{Re(E.throw(Ye))}catch(rt){Se(rt)}},Re=Ye=>Ye.done?le(Ye.value):Promise.resolve(Ye.value).then(we,Ve);Re((E=E.apply(b,x)).next())});function pn({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),[Re,Ye]=(0,y.useState)(0);function rt(){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 me=re.diagram.commandHandler.addTopLevelParts(re.diagram.selection,!0);me||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 me=re.subject;me.location=me.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 me=re.subject;setTimeout(()=>{re.diagram.commandHandler.editTextBlock()})},LinkRelinked:re=>{var me=re.parameter.part;me.invalidateConnectedLinks();var Ae=re.subject;re.diagram.toolManager.linkingTool.isForwards?Ae.toNode.invalidateConnectedLinks():Ae.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 Tt(re,me){var Ae=(ge,Je)=>{ge.handled=!0,ge.diagram.model.commit(at=>{var pt=Je.part.adornedPart,yt=new a.Point().setRectSpot(pt.actualBounds,re);yt.subtract(pt.location),yt.scale(2,2),yt.x+=Math.sign(yt.x)*130,yt.y+=Math.sign(yt.y)*130,yt.add(pt.location),yt.snapToGridPoint(ge.diagram.grid.gridOrigin,ge.diagram.grid.gridCellSize);var Pt=at.copyNodeData(pt.data);at.setGroupKeyForNodeData(Pt,at.getGroupKeyForNodeData(pt.data)),at.addNodeData(Pt);var Nn={from:pt.key,to:at.getKeyForNodeData(Pt)};at.addLinkData(Nn);var Qt=ge.diagram.findNodeForData(Pt);Qt.location=yt,ge.diagram.select(Qt),setTimeout(()=>{ge.diagram.commandHandler.editTextBlock()},20)})};return oe(a.Shape,{figure:me,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:(ge,Je)=>Je.fill="dodgerblue",mouseLeave:(ge,Je)=>Je.fill="orange",isActionable:!0,click:Ae,contextClick:Ae})}function Ft(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:(me,Ae)=>Ae.fill="dodgerblue",mouseLeave:(me,Ae)=>Ae.fill="orange",click:(me,Ae)=>{me.diagram.commandHandler.showContextMenu(Ae.part.adornedPart)}},re||{})}E.current.nodeTemplate.selectionAdornmentTemplate=oe(a.Adornment,"Spot",oe(a.Placeholder,{padding:10}),Tt(a.Spot.Top,"TriangleUp"),Tt(a.Spot.Left,"TriangleLeft"),Tt(a.Spot.Right,"TriangleRight"),Tt(a.Spot.Bottom,"TriangleDown"),Ft({alignment:new a.Spot(.75,0)}));function ft(re,me){return(Ae,ge)=>{Ae.handled=!0,Ae.diagram.model.commit(Je=>{Je.set(ge.part.adornedPart.data,re,me)})}}function lt(re,me){return me||(me="color"),oe(a.Shape,{width:16,height:16,stroke:"lightgray",fill:re,margin:1,background:"transparent",mouseEnter:(Ae,ge)=>ge.stroke="dodgerblue",mouseLeave:(Ae,ge)=>ge.stroke="lightgray",click:ft(me,re),contextClick:ft(me,re)})}function Zt(){return[oe("ContextMenuButton",oe(a.Panel,"Horizontal",lt(ze.white,"fill"),lt(ze.beige,"fill"),lt(ze.extralightblue,"fill"),lt(ze.extralightred,"fill"))),oe("ContextMenuButton",oe(a.Panel,"Horizontal",lt(ze.lightgray,"fill"),lt(ze.lightgreen,"fill"),lt(ze.lightblue,"fill"),lt(ze.lightred,"fill")))]}function Kt(){return[oe("ContextMenuButton",oe(a.Panel,"Horizontal",lt(ze.black),lt(ze.green),lt(ze.blue),lt(ze.red))),oe("ContextMenuButton",oe(a.Panel,"Horizontal",lt(ze.white),lt(ze.magenta),lt(ze.purple),lt(ze.orange)))]}function Yt(re,me){return me||(me="thickness"),oe(a.Shape,"LineH",{width:16,height:16,strokeWidth:re,margin:1,background:"transparent",mouseEnter:(Ae,ge)=>ge.background="dodgerblue",mouseLeave:(Ae,ge)=>ge.background="transparent",click:ft(me,re),contextClick:ft(me,re)})}function cn(re,me){return me||(me="dash"),oe(a.Shape,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:re,margin:1,background:"transparent",mouseEnter:(Ae,ge)=>ge.background="dodgerblue",mouseLeave:(Ae,ge)=>ge.background="transparent",click:ft(me,re),contextClick:ft(me,re)})}function Jt(){return[oe("ContextMenuButton",oe(a.Panel,"Horizontal",Yt(1),Yt(2),Yt(3),Yt(4))),oe("ContextMenuButton",oe(a.Panel,"Horizontal",cn(null),cn([2,4]),cn([4,4])))]}function wt(re,me){return me||(me="figure"),oe(a.Shape,{width:32,height:32,scale:.5,fill:"lightgray",figure:re,margin:1,background:"transparent",mouseEnter:(Ae,ge)=>ge.fill="dodgerblue",mouseLeave:(Ae,ge)=>ge.fill="lightgray",click:ft(me,re),contextClick:ft(me,re)})}E.current.nodeTemplate.contextMenu=oe("ContextMenu",oe("ContextMenuButton",oe(a.Panel,"Horizontal",wt("Rectangle"),wt("RoundedRectangle"),wt("Ellipse"),wt("Diamond"))),oe("ContextMenuButton",oe(a.Panel,"Horizontal",wt("Parallelogram2"),wt("ManualOperation"),wt("Procedure"),wt("Cylinder1"))),oe("ContextMenuButton",oe(a.Panel,"Horizontal",wt("Terminator"),wt("CreateRequest"),wt("Document"),wt("TriangleDown"))),Zt(),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,me)=>{var Ae=me.addMembers(me.diagram.selection,!0);Ae||me.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})),Ft({alignment:a.Spot.TopRight,alignmentFocus:a.Spot.BottomRight})),E.current.groupTemplate.contextMenu=oe("ContextMenu",Zt(),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:dn(2)},new a.Binding("pathPattern","thickness",dn)),Ft({alignmentFocus:new a.Spot(0,0,-6,-4)}));function dn(re){return oe(a.Shape,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(re+4).toString()+" H3"})}function Ut(re){var me="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return re===0?me="M0 0 M16 16 M0 8 L16 8":re===2&&(me="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),oe(a.Shape,{geometryString:me,margin:2,background:"transparent",mouseEnter:(Ae,ge)=>ge.background="dodgerblue",mouseLeave:(Ae,ge)=>ge.background="transparent",click:ft("dir",re),contextClick:ft("dir",re)})}function yn(re){var me=(Ae,ge)=>{Ae.handled=!0,Ae.diagram.model.commit(Je=>{var at=ge.part.adornedPart;Je.set(at.data,re?"toSpot":"fromSpot",a.Spot.stringify(a.Spot.AllSides)),(re?at.toNode:at.fromNode).invalidateConnectedLinks()})};return oe(a.Shape,{width:12,height:12,fill:"transparent",mouseEnter:(Ae,ge)=>ge.background="dodgerblue",mouseLeave:(Ae,ge)=>ge.background="transparent",click:me,contextClick:me})}function ne(re,me){var Ae=0,ge=a.Spot.RightSide;re.equals(a.Spot.Top)?(Ae=270,ge=a.Spot.TopSide):re.equals(a.Spot.Left)?(Ae=180,ge=a.Spot.LeftSide):re.equals(a.Spot.Bottom)&&(Ae=90,ge=a.Spot.BottomSide),me||(Ae-=180);var Je=(at,pt)=>{at.handled=!0,at.diagram.model.commit(yt=>{var Pt=pt.part.adornedPart;yt.set(Pt.data,me?"toSpot":"fromSpot",a.Spot.stringify(ge)),(me?Pt.toNode:Pt.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:Ae,background:"transparent",mouseEnter:(at,pt)=>pt.background="dodgerblue",mouseLeave:(at,pt)=>pt.background="transparent",click:Je,contextClick:Je})}E.current.linkTemplate.contextMenu=oe("ContextMenu",Kt(),Jt(),oe("ContextMenuButton",oe(a.Panel,"Horizontal",Ut(0),Ut(1),Ut(2))),oe("ContextMenuButton",oe(a.Panel,"Horizontal",oe(a.Panel,"Spot",yn(!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)},yn(!0),ne(a.Spot.Top,!0),ne(a.Spot.Left,!0),ne(a.Spot.Right,!0),ne(a.Spot.Bottom,!0)))));const On=`{ "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 fn(re){return console.log("shapeName:",re),Xt.indexOf(re)>=0}var Ot=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 E.current.addDiagramListener("TextEdited",function(re){var me;const Ae=re.subject.part;var ge=(me=document.activeElement)==null?void 0:me.value;typeof ge=="string"&&ge.trim()===""&&E.current.model.commit(function(Je){Je.set(Ae.data,"text","\u672A\u547D\u540D"),E.current.commandHandler.stopCommand()},"increment")}),Ot.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 xt=()=>zt(this,null,function*(){var oe=E.current.makeImage();const ze=yield(0,Qe.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)(()=>(setTimeout(()=>{rt()},500),Ye(Re+1),()=>{E.current=null}),[]),ut.createElement("div",{ref:Ve,className:we.current?`${Lt.maxH60} body-overflow-initial`:"body-overflow-initial"},ut.createElement(We.default,{width:1200,icon:null,footer:null,closable:!0,visible:!!Re,destroyOnClose:!0,maskClosable:!1,getContainer:Ve.current,rootClassName:"zIndex-9999",title:ut.createElement(ie.Z,null,ut.createElement(ot.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),ut.createElement(ot.Z,{onClick:()=>{var oe,ze,Tt=E.current.selection.first();if(we.current=!we.current,document.activeElement&&Tt){let Ft=(ze=(oe=document.activeElement)==null?void 0:oe.value)==null?void 0:ze.trim();typeof Ft=="string"&&E.current.model.commit(function(ft){ft.set(Tt.data,"text",Ft||"\u672A\u547D\u540D"),E.current.commandHandler.stopCommand()},"increment")}Ye(Re+1)}},ut.createElement("span",{className:"current c-blue mr30",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77"))),onCancel:b},ut.createElement("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative"},className:Lt.flowChartWrp},ut.createElement("div",{style:{display:"flex",height:"100%"}},ut.createElement("div",{style:{width:"300px",height:"100%"}},ut.createElement("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"}},"\u56FE\u5F62\u5E93"),ut.createElement("div",{style:{height:"calc(100% - 50px)"},className:Lt.myPaletteDiv,ref:Se})),ut.createElement("div",{style:{flex:1,position:"relative"}},ut.createElement("div",{ref:le,style:{height:"80vh"}}))),ut.createElement("div",{className:"tr"},ut.createElement(Ke.ZP,{size:"large",onClick:xt,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))))}var on=pn,_t=z(98554),hn=z(83542);const Vt=_t.ZP.Group,Dt={margin:"0 8px"};var rn=({callback:b,onCancel:x})=>{function E(le){b(le)}return y.createElement(Ie.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:Dt},"\u5355\u5143\u683C\u6570\uFF1A"),y.createElement("span",{style:Dt},"\u884C\u6570"),y.createElement(Ie.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},y.createElement(hn.Z,null)),y.createElement("span",{style:Dt},"\u5217\u6570"),y.createElement(Ie.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},y.createElement(hn.Z,null))),y.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},y.createElement("span",{style:Dt},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),y.createElement(Ie.default.Item,{name:"align"},y.createElement(Vt,null,y.createElement(_t.ZP,{value:"default"},y.createElement("i",{className:"fa fa-align-justify"})),y.createElement(_t.ZP,{value:"left"},y.createElement("i",{className:"fa fa-align-left"})),y.createElement(_t.ZP,{value:"center"},y.createElement("i",{className:"fa fa-align-center"})),y.createElement(_t.ZP,{value:"right"},y.createElement("i",{className:"fa fa-align-right"}))))),y.createElement("div",{className:"flex-container flex-end"},y.createElement(Ke.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.createElement(Ke.ZP,{type:"ghost",onClick:x},"\u53D6\u6D88")))},vt=z(78673),Bt=z(39592),vn=z.n(Bt),Zn=(0,y.forwardRef)(({use3d:b,width:x,height:E,callback:le,showSaveButton:Se},we)=>{const Ve=(0,y.useRef)(),Re=(0,y.useRef)(),[Ye,rt]=(0,y.useState)(!1),xt=(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)(()=>{Re.current=new(vn())(xt.current,!0),window.onload=function(){Re.current.inject("applet_container")}},[]);const oe=()=>{var ze=window.ggbApplet.getPNGBase64(1,!0,72);return le&&le(ze),ze};return(0,y.useEffect)(()=>{xt.current.appName=Ye?"3D":"graphing",Re.current.inject("applet_container")},[Ye]),(0,y.useEffect)(()=>{rt(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(ot.Z,{flex:1},y.createElement(vt.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:Ye,onChange:ze=>rt(ze)})),y.createElement(ot.Z,null,y.createElement(Ke.ZP,{size:"large",onClick:oe,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),Kn=z(2035),Yn=z(8591);const an="link",ln="upload-image",Mt="add-flowchart",$t="draw-image",Jn="add-flowchart",sn="code-block",un="add-table",wn="------------",Xn={default:wn,left:`:${wn}`,center:`:${wn}:`,right:`${wn}:`};var Qn=z(8894);function hi(){}let vi=0;const Pn=1e4,qn="\u2581",An="@\u2581\u2581@",Ln="@\u2581@",ei=`
|
|
**\u6A21\u677F\u6807\u9898**
|
|
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`,Dn=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"];function Mn(b){return/^\d+$/.test(b)?`${b}px`:b}const Fn=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",ti={[Fn+"-B"]:"bold",[Fn+"-I"]:"italic"},Tn={[an]:"\u6DFB\u52A0\u94FE\u63A5",[sn]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[ln]:"\u6DFB\u52A0\u56FE\u7247",[$t]:"\u6DFB\u52A0\u753B\u56FE",[Mt]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[un]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var ni=({defaultValue:b="",onChange:x,width:E="100%",height:le=400,miniToolbar:Se=!1,isFocus:we=!1,watch:Ve,insertTemp:Re,mode:Ye="markdown",id:rt="markdown-editor-id",showResizeBar:xt=!1,noStorage:oe=!1,showNullButton:ze=!1,showNullProgramButton:Tt=!1,hidetoolBar:Ft=!1,fullScreen:ft=!1,onBlur:lt,onCMBeforeChange:Zt,onFullScreen:Kt,className:Yt="",disablePaste:cn=!1,disabled:Jt=!1,disabledFill:wt=!1,placeholder:dn="",values:Ut="",extraUse:yn})=>{const[ne,On]=(0,y.useState)(null),[Xt,fn]=(0,y.useState)(b),[Ot,re]=(0,y.useState)(Ve),[me,Ae]=(0,y.useState)(ft),[ge,Je]=(0,y.useState)(""),[at,pt]=(0,y.useState)(0),[yt,Pt]=(0,y.useState)(le),[Nn,Qt]=(0,y.useState)(!1),[Gn,In]=(0,y.useState)(0),[Rn,Hn]=(0,y.useState)(0),qt=(0,y.useRef)(),Cn=(0,y.useRef)(),bn=(0,y.useRef)(),En=(0,y.useRef)();(0,y.useEffect)(()=>{const pe=window.scrollY||window.pageYOffset;fn(Ut),ne==null||ne.setValue(Ut),window.scrollTo(0,pe)},[Ut]),(0,y.useEffect)(()=>{Kt==null||Kt(me)},[me]),(0,y.useEffect)(()=>{if(qt.current){let pe=function(he,fe){var $e;if(cn){fe.preventDefault();return}const et=fe.clipboardData;if(et){const ht=et.types.toString(),ct=et.items;if(ht==="Files"||et.types.indexOf("Files")>-1){if(fe.preventDefault(),Ye=="stex")return;try{let mt=ct[1];(($e=ct[0])==null?void 0:$e.kind)==="file"&&(mt=ct[0]);const gt=mt.getAsFile(),Gt=gt.name.split(".").pop();(0,ee.I)(gt,Ct=>{var Sn,Bn,kn;Ct.id?((Sn=gt==null?void 0:gt.type)==null?void 0:Sn.indexOf("image"))>-1?se.replaceSelection(``):((Bn=gt==null?void 0:gt.type)==null?void 0:Bn.indexOf("video"))>-1?se.replaceSelection(`<video width="100%" controls src="/api/attachments/${Ct.id}"></video>`):((kn=gt==null?void 0:gt.type)==null?void 0:kn.indexOf("pdf"))>-1?se.replaceSelection(`<a href="/api/attachments/${Ct.id}?type=${gt.type}&disposition=inline" target="_blank">${gt.name}</a>`):Dn.includes(Gt)?se.replaceSelection(`<a href="/api/attachments/${Ct.id}?type=office&disposition=inline" target="_blank">${gt.name}</a>`):se.replaceSelection(`[${gt.name}](/api/attachments/${Ct.id}?type=${Ct.content_type})`):(Ct==null?void 0:Ct.status)===401&&(document.location.href="/user/login")})}catch(mt){Yn.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const se=De().fromTextArea(qt.current,{mode:Ye,lineNumbers:!Se,lineWrapping:!0,value:b,autoCloseTags:!0,autoCloseBrackets:!0});return se.on("keyup",function(he,fe){fe.keyCode===8&&(he.getValue()==""?se.setOption("placeholder",dn):se.setOption("placeholder",null))}),se.on("keydown",function(he,fe){if(fe.keyCode===8){var $e=ii(he);$e&&fe.preventDefault()}}),we&&se.focus(),se.on("paste",pe),Jt&&se.on("beforeChange",function(he,fe){(fe.origin==="paste"||fe.origin==="+input")&&fe.cancel()}),On(se),()=>{se.off("paste",pe)}}},[]);const Wn=(0,y.useCallback)(()=>{if(Cn.current)try{}catch(pe){console.log(pe,"---- to set md editor body height")}},[yt,Cn,me]);(0,y.useEffect)(()=>{function pe(){let se=new Ce.Z(he=>{for(let fe of he)(fe.target.offsetHeight>0||fe.target.offsetWidth>0)&&(Wn(),ne.setSize("100%","100%"),ne.refresh())});return se.observe(qt.current.parentElement),se}if(ne){const se=pe();return()=>{var he,fe;(he=qt.current)!=null&&he.parentElement&&se.unobserve((fe=qt.current)==null?void 0:fe.parentElement)}}},[ne,Wn]),(0,y.useEffect)(()=>{if(ne){let pe=[];for(const[se,he]of Object.entries(ti)){let fe={[se]:()=>{jn(he)}};pe.push(fe),ne.addKeyMap(fe)}return()=>{for(let se of pe)ne.removeKeyMap(se)}}},[ne]),(0,y.useEffect)(()=>{ft!==me&&Ae(ft)},[ft]),(0,Qn.Z)(()=>{if(!oe&&at>0){let pe=new Date().getTime(),se=window.sessionStorage.getItem(rt);pe>=at+Pn&&(!se||se!==Xt)&&(window.sessionStorage.setItem(rt,Xt),Qt(!0))}},Pn),(0,y.useEffect)(()=>{re(Ve)},[ne,Ve]),(0,y.useEffect)(()=>{ne&&we&&ne.focus()},[ne,we]),(0,y.useEffect)(()=>{if(Ot&&ne){let pe=function(he){let fe=he.target;if(En.current){let $e=fe.scrollTop/fe.scrollHeight;En.current.scrollTop=En.current.scrollHeight*$e}};const se=ne.getScrollerElement();return se.addEventListener("scroll",pe),()=>{se.removeEventListener("scroll",pe)}}},[ne,Ot]),(0,y.useEffect)(()=>{if(ne&&Zt){let pe=function(se,he){Zt(se,he)};return ne.on("beforeChange",pe),()=>{ne.off("beforeChange",pe)}}},[ne,Zt]),(0,y.useEffect)(()=>{if(ne&<){let pe=function(){lt(ne.getValue())};return ne.on("blur",pe),()=>{ne.off("blur",pe)}}},[ne,lt]);function ii(pe,se){var he=pe.getDoc(),fe=he.getCursor(),$e=he.getLine(fe.line),et=$e.charAt(fe.ch-1),ht=$e.lastIndexOf("@\u2581@",fe.ch),ct=$e.lastIndexOf("@\u2581\u2581@",fe.ch),mt=ht>ct?ht:ct,gt=ht>ct?3:4;if(An.indexOf(et)===-1)return null;if(console.log("change1:",se,pe,$e,fe,mt,ht,ct,et),mt>=0&&fe.ch-mt<5){var Gt=mt+gt;return he.replaceRange("",{line:fe.line,ch:mt},{line:fe.line,ch:Gt}),{line:fe.line,ch:Gt}}return null}(0,y.useEffect)(()=>{if(ne){let pe=function(se,he){const fe=se.getValue();fn(fe),pt(new Date().getTime()),se.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),x&&(Tt?x(fe,si(fe)):x(fe))};return ne.on("change",pe),()=>{ne.off("change",pe)}}},[ne,x]),(0,y.useEffect)(()=>{if(ne)if(b==null)ne.setValue(""),fn("");else{const pe=window.scrollY||window.pageYOffset;b!==ne.getValue()&&(ne.setValue(b),fn(b),ne.setCursor(Jt?1:ne.lineCount(),0),window.scrollTo(0,pe))}},[ne,b]);const jn=(0,y.useCallback)(pe=>{const se=ne.getCursor(),he=ne.getSelection();let fe=he.split(`
|
|
`);switch(pe){case"bold":return ne.replaceSelection("**"+he+"**"),he===""&&ne.setCursor(se.line,se.ch+2),ne.focus();case"italic":return ne.replaceSelection("*"+he+"*"),he===""&&ne.setCursor(se.line,se.ch+1),ne.focus();case"code":return ne.replaceSelection("`"+he+"`"),he===""&&ne.setCursor(se.line,se.ch+1),ne.focus();case"inline-latex":return Je("inline-latex"),ne.focus();case"latex":return ne.replaceSelection("```latex\n"+he+"\n```"),ne.setCursor(se.line+1,he.length+1),ne.focus();case"line-break":return ne.replaceSelection(`<br/>
|
|
`),ne.focus();case"list-ul":return he===""?ne.replaceSelection("- "+he):ne.replaceSelection(fe.map($e=>$e===""?"":`- ${$e}`).join(`
|
|
`)),ne.focus();case"list-ol":return he===""?ne.replaceSelection("1. "+he):ne.replaceSelection(fe.map(($e,et)=>$e===""?"":`${et+1}. ${$e}`).join(`
|
|
`)),ne.focus();case"add-null-ch":return he===""&&ne.setCursor(se.line,se.ch),ne.replaceSelection(qn),ne.focus();case"add-signal":return he===""&&ne.setCursor(se.line,se.ch),ne.replaceSelection(Ln),ne.focus();case"add-multiple":return he===""&&ne.setCursor(se.line,se.ch),ne.replaceSelection(An),ne.focus();case"inster-template-1":return he===""&&ne.setCursor(se.line,se.ch),ne.replaceSelection(ei),ne.focus();case"eraser":return ne.setValue(""),ne.focus();case"trigger-watch":return re(!Ot),ne.focus();case"trigger-full-screen":return Ae(!me),ne.focus();case an:Je(an);return;case sn:Je(sn);return;case ln:Je(ln);return;case $t:Je($t);return;case"maths-latex":Je("maths-latex");return;case Mt:Je(Mt);return;case un:Je(un);return;default:throw new Error}},[ne,Ot,me]),Nt=(0,y.useCallback)((pe,se)=>{var he,fe,$e,et,ht,ct;switch(Je(""),ge){case an:const{title:Sn,link:Bn}=pe;return ne.replaceSelection(`[${Sn}](${Bn})`),ne.focus();case sn:const{language:kn,content:di}=pe;return ne.replaceSelection(["```"+kn,di,"```"].join(`
|
|
`)),ne.focus();case"maths-latex":for(var mt=atob(pe),gt=new Uint8Array(mt.length),Gt=0;Gt<mt.length;Gt++)gt[Gt]=mt.charCodeAt(Gt);var Ct=new Blob([gt],{type:"image/png"});(0,ee.I)(Ct,At=>{At.id?ne.replaceSelection(``):(At==null?void 0:At.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":ne.replaceSelection("`$$"+pe+"$$`");break;case ln:case $t:case Jn:const{src:en,alt:_n}=pe,bt=se,fi=($e=(fe=(he=bt==null?void 0:bt.name)==null?void 0:he.split("."))==null?void 0:fe.pop)==null?void 0:$e.call(fe);return((et=bt==null?void 0:bt.type)==null?void 0:et.indexOf("image"))>-1||!(bt!=null&&bt.type)?_n?ne.replaceSelection(``):ne.replaceSelection(``):((ht=bt==null?void 0:bt.type)==null?void 0:ht.indexOf("video"))>-1?ne.replaceSelection(`<video width="100%" controls src="${en}"></video>`):((ct=bt==null?void 0:bt.type)==null?void 0:ct.indexOf("pdf"))>-1?ne.replaceSelection(`<a href="${en}?type=${bt.type}&disposition=inline" target="_blank">${bt.name}</a>`):Dn.includes(fi)?ne.replaceSelection(`<a href="${en}?type=office&disposition=inline" target="_blank">${bt.name}</a>`):ne.replaceSelection(`[${bt.name}](${en})`),ne.focus();case un:const{row:mi,col:zn,align:gi}=pe;let xn=`
|
|
`;for(let At=0;At<mi;At++){let $n=[],Un=[];for(let Vn=0;Vn<zn;Vn++)At===1&&Un.push(Xn[gi]),$n.push(" ");At===1&&(xn+=`| ${Un.join(" | ")} |
|
|
`),xn+=`| ${$n.join(zn===1?"":" | ")} |
|
|
`}return ne.replaceSelection(xn+`
|
|
`),ne.focus();default:throw new Error}},[ne,ge]),oi=(0,y.useMemo)(()=>{switch(ge){case an:return y.createElement(nn,{callback:Nt,onCancel:Rt});case sn:return y.createElement(gn.Z,{callback:Nt,onCancel:Rt});case ln:return y.createElement(ee.Z,{callback:Nt,onCancel:Rt});case Mt:return y.createElement(on,{callback:Nt,onCancel:Rt});case un:return y.createElement(rn,{callback:Nt,onCancel:Rt});case"maths-latex":return y.createElement(Zn,{showSaveButton:!0,callback:Nt});case"inline-latex":return y.createElement(Kn.Z,{showSaveButton:!0,callback:Nt});default:return null}},[ge]);function Rt(){Je("")}(0,y.useEffect)(()=>{if(bn.current){let pe=function(ht){$e=!0,et=ht.pageY},se=function(){$e=!1},he=function(ht){if($e){let ct=ht.pageY-et;ct<0&&(ct=0),ct>300&&(ct=300);let mt=le+ct+"px";Pt(mt)}},fe=bn.current,$e=!1,et=0;return fe.addEventListener("mousedown",pe),document.addEventListener("mousemove",he),document.addEventListener("mouseup",se),()=>{fe.removeEventListener("mousedown",pe),document.removeEventListener("mousemove",he),document.removeEventListener("mouseup",se)}}},[ne,bn]),(0,y.useEffect)(()=>{Pt(le)},[le]);const ri=Mn(E),ai=Mn(yt),li={width:ri,height:ai},yi=(0,y.useMemo)(()=>{if(at){let pe=new Date(at),se=pe.getHours(),he=pe.getMinutes(),fe=pe.getSeconds();return se=se<10?"0"+se:se,he=he<10?"0"+he:he,fe=fe<10?"0"+fe:fe,`${se}:${he}:${fe}`}return 0},[at]),si=pe=>{const se=[];if(Tt){let he=-1;pe=pe.replace(/(@▁▁@|@▁@)/g,function(fe,$e,et){se.push({multiLine:fe!==Ln})})}return se};function bi(){window.sessionStorage.removeItem(rt),Qt(!1),pt(0)}function Ei(){Qt(!1),pt(0),ne.setValue(window.sessionStorage.getItem(rt))}(0,y.useEffect)(()=>{Tn[ge]&&ge!==$t&&ge!==Mt&&setTimeout(()=>{const pe=document.getElementsByClassName("markdown-popup-form")[0],se=window.innerWidth/2-pe.offsetWidth/2,he=window.innerHeight/2-pe.offsetHeight/2;In(se),Hn(he)},0)},[ge]);const ui=pe=>{pe.preventDefault();const se=pe.clientX-Gn,he=pe.clientY-Rn;document.body.onmousemove=fe=>{let $e=fe.clientX-se,et=fe.clientY-he;const ht=document.getElementsByClassName("markdown-popup-form")[0],ct=window.innerWidth-ht.offsetWidth,mt=window.innerHeight-ht.offsetHeight;$e=Math.max(0,Math.min($e,ct)),et=Math.max(0,Math.min(et,mt)),ci(fe.clientX,fe.clientY,se,he)&&(In($e),Hn(et))},document.body.onmouseup=function(){document.body.onmousemove=null}},ci=(pe,se,he,fe)=>{const $e=document.body.clientHeight,et=document.body.clientWidth;return pe<20&&he>pe||pe>et-20&&he<pe||se<20&&fe>se||se>$e-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:Cn},y.createElement("div",{className:`markdown-editor-container ${Yt} ${Ot?"on-preview":""} ${Se?"mini":""} ${me?"full-screen":""}`,style:li},y.createElement(je,{insertTemp:Re,watch:Ot,fullScreen:me,showNullButton:ze,showNullProgramButton:Tt,onActionCallback:jn,hidetoolBar:Ft,extraUse:yn}),y.createElement("div",{className:"markdown-editor-body"},y.createElement("div",{className:"codemirror-container"},y.createElement("textarea",{ref:qt,placeholder:dn})),Ot?y.createElement("div",{ref:En,className:"preview-container"},Ye==="stex"&&y.createElement(Be,{value:Xt}),Ye!=="stex"&&y.createElement(Fe.Z,{disabledFill:wt,showProgramFill:Tt,value:Xt})):null))),xt?y.createElement("a",{ref:bn,className:"editor-resize"}):null,ge===$t&&y.createElement(Oe,{callback:Nt,onCancel:Rt}),ge===Mt&&y.createElement(on,{callback:Nt,onCancel:Rt}),y.createElement(it.Z,null,Tn[ge]&&ge!==$t&&ge!==Mt?y.createElement(We.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:Gn,top:Rn},title:y.createElement("div",{style:{cursor:"move"},onMouseDown:ui},Tn[ge]),open:!0,onCancel:Rt,footer:null,destroyOnClose:!0,width:ge===Mt?"1200px":null,height:ge===Mt?"80vh":null,className:"markdown-popup-form"},oi):null))}},73140:function(ae,Le,z){"use strict";z.d(Le,{Z:function(){return Ne},I:function(){return Ge}});var y=z(78700),Me=z(8591),De=z(92832),Ce=z(3113),te=z(31662),de=z(59301),be=z(59301),Ee=Object.defineProperty,ve=Object.defineProperties,_e=Object.getOwnPropertyDescriptors,Fe=Object.getOwnPropertySymbols,Be=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable,ke=(Pe,xe,je)=>xe in Pe?Ee(Pe,xe,{enumerable:!0,configurable:!0,writable:!0,value:je}):Pe[xe]=je,Xe=(Pe,xe)=>{for(var je in xe||(xe={}))Be.call(xe,je)&&ke(Pe,je,xe[je]);if(Fe)for(var je of Fe(xe))ye.call(xe,je)&&ke(Pe,je,xe[je]);return Pe},Ze=(Pe,xe)=>ve(Pe,_e(xe));const{useForm:qe}=y.default,tt={width:280,marginRight:10},nt={labelCol:{span:5},wrapperCol:{span:19}};var Ne=({callback:Pe,onCancel:xe})=>{const[je]=qe();let it=(0,de.useRef)();function Ie(dt){Pe(dt,it.current)}function st(dt,Et){if(dt.status===-1){Me.ZP.error(dt.message);return}je.setFieldsValue({src:`/api/attachments/${dt.id}`,type:Et.type})}function Ke(dt){let Et=dt.target.files[0];it.current=Et,Ge(Et,st)}return be.createElement(y.default,Ze(Xe({form:je},nt),{className:"upload-image-panel",onFinish:Ie,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(De.default,{style:tt})),be.createElement(Ue,{onFileChange:Ke}))),be.createElement(y.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},be.createElement(De.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:xe},"\u53D6\u6D88")))};function Ue({onFileChange:Pe}){return be.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",be.createElement("input",{type:"file",onChange:Pe}))}function Ge(Pe,xe){if(!Pe)throw new String("\u6CA1\u6709\u6587\u4EF6");let je=new FormData;je.append("editormd-image-file",Pe),je.append("file_param_name","editormd-image-file"),je.append("byxhr","true");var it=new window.XMLHttpRequest;it.withCredentials=!0,it.addEventListener("load",function(Ie){xe(JSON.parse(Ie.target.responseText),Pe)},!1),it.addEventListener("error",function(Ie){console.error(Ie)},!1),it.open("POST",`${te.KI}/api/attachments.json`),it.send(je)}},36174:function(ae,Le,z){"use strict";z.d(Le,{Z:function(){return De}});var y=z(59301),Me=z(4676);class De 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)}}},8894:function(ae,Le,z){"use strict";z.d(Le,{Z:function(){return Me}});var y=z(59301);function Me(De,Ce){const te=(0,y.useRef)();(0,y.useEffect)(()=>{te.current=De}),(0,y.useEffect)(()=>{function de(){te.current()}if(Ce!==null){let be=setInterval(de,Ce);return()=>clearInterval(be)}},[Ce])}}}]);
|