(self.webpackChunk=self.webpackChunk||[]).push([[34741,4977,39752],{78091:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var i=n(1565),a=n(59301),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"minus-circle",theme:"outlined"},r=n(68475),s=function(e,t){return a.createElement(r.Z,(0,i.Z)({},e,{ref:t,icon:o}))};var l=a.forwardRef(s)},57703:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var i=n(1565),a=n(59301),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"plus-circle",theme:"outlined"},r=n(68475),s=function(e,t){return a.createElement(r.Z,(0,i.Z)({},e,{ref:t,icon:o}))};var l=a.forwardRef(s)},66455:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,_typeof=__webpack_require__(31468).default;(function(){if("function"!=typeof window.GGBApplet){var isRenderGGBElementEnabled=!1,scriptLoadStarted=!1,html5AppletsToProcess=null,ggbHTML5LoadedCodebaseIsWebSimple=!1,ggbHTML5LoadedCodebaseVersion=null,ggbHTML5LoadedScript=null,GGBApplet=function(){"use strict";for(var e={},t="5.0",n={},i=null,a=!1,o=!1,r=null,s=!1,l=null,c=null,u=0;u4?parseFloat(e):5};function _(){try{return window.self!==window.top}catch(e){return!0}}function k(){return(!n.hasOwnProperty("screenshotGenerator")||!n.screenshotGenerator)&&Math.max(screen.width,screen.height)<800}e.setHTML5Codebase=function(e,t){c=e,G(e,t)},e.setJavaCodebase=e.setJavaCodebaseVersion=e.isCompiledInstalled=e.setPreCompiledScriptPath=e.setPreCompiledResourcePath=function(){},e.setHTML5CodebaseVersion=function(e,t){var n=parseFloat(e);NaN!==n&&n<5?console.log("The GeoGebra HTML5 codebase version "+n+" is deprecated. Using version latest instead."):(l=e,M(e,t))},e.getHTML5CodebaseVersion=function(){return m},e.getParameters=function(){return n},e.setFontsCSSURL=function(e){y=e},e.setGiacJSURL=function(e){},e.setJNLPFile=function(e){e},e.setJNLPBaseDir=function(e){},e.inject=function(){function t(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var i,a="auto",o=n.id,r=!1,l=0;l=5)return!0;var t=e.getAppletObject();return!(!t||"function"!=typeof t.recalculateEnvironments)&&(t.recalculateEnvironments(),!0)},e.startAnimation=function(){var t=e.getAppletObject();return!(!t||"function"!=typeof t.startAnimation)&&(t.startAnimation(),!0)},e.stopAnimation=function(){var t=e.getAppletObject();return!(!t||"function"!=typeof t.stopAnimation)&&(t.stopAnimation(),!0)},e.getAppletObject=function(){var e=void 0!==n.id?n.id:"ggbApplet";return window[e]},e.resize=function(){};var A=function(e){return e&&"false"!==e},T=function(t,n,i){x(m)<=4.2&&(i=!0);var a=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==m||ggbHTML5LoadedCodebaseIsWebSimple&&!v)&&(a=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var o=document.createElement("div");o.classList.add("appletParameters","notranslate");var r=n.width,s=n.height;if(n.disableAutoScale=void 0===n.disableAutoScale?GGBAppletUtils.isFlexibleWorksheetEditor():n.disableAutoScale,void 0!==n.width)if(x(m)<=4.4)A(n.showToolBar)&&(n.height-=7),A(n.showAlgebraInput)&&(n.height-=37),n.width<605&&A(n.showToolBar)&&(n.width=605,r=605);else{var u=100;(A(n.showToolBar)||A(n.showMenuBar))&&(n.hasOwnProperty("customToolBar")&&(n.customToolbar=n.customToolBar),u=A(n.showMenuBar)?245:155),r=5?(n.appletOnLoad=function(e){var n=t.querySelector(".ggb_preview");n&&n.parentNode.removeChild(n),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(w),window.GGBT_wsf_view&&$(window).trigger("resize"),h(e)},b||w.appendChild(_)):o.appendChild(_),w.appendChild(o),b||t.appendChild(w),setTimeout((function(){e.resize()}),1)}function k(e,t){t&&"function"==typeof t.appletOnLoad&&"function"==typeof renderGGBElement?renderGGBElement(e,t.appletOnLoad):renderGGBElement(e),D("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",t)}function j(e,t){"undefined"==typeof renderGGBElement?(null===html5AppletsToProcess&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:e,params:t}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,null!==html5AppletsToProcess&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach((function(e){k(e.article,e.params)})),html5AppletsToProcess=null)},x(m)<5&&(e.className+=" geogebraweb")):k(e,t)}if(a){scriptLoadStarted=!0;for(var C=0;C0?(a.remove(),s.attr("id","fullscreencontent").show(),jQuery(o).append(s),window.dispatchEvent(new Event("resize"))):T(a,t,!1),window.GGBT_wsf_view.launchFullScreen(o)}else f=i,T(e,t,!1);if(!window.GGBT_wsf_view)for(r=0;re/4*3&&(s=e/4*3),l=s/5.8,r.setAttribute("src",b),r.setAttribute("width",s),r.setAttribute("height",l);var u=(e-s)/2,d=(t-l)/2;r.style.left=u+"px",r.style.top=d+"px",a.appendChild(r)}return a.appendChild(c),a},L=function(e){return"html5"===(e=e.toLowerCase())||"screenshot"===e?e:"html5"},Z=["web","webSimple","web3d","tablet","tablet3d","phone"],M=function(e,t){if(m=e,t)G(m,!0);else{var o,r,s=!a;if(s){var l=x(m);!isNaN(l)&&l<4.4&&(s=!1)}o="http"===window.location.protocol.substr(0,4)?window.location.protocol:"http:";var c=m.indexOf("//");for(var u in r=c>0?m:0===c?o+m:"https://www.geogebra.org/apps/5.2.814.0/",Z)if(m.slice(-1*Z[u].length)===Z[u]||m.slice(-1*(Z[u].length+1))===Z[u]+"/")return void G(r,!1);GGBAppletUtils.isFlexibleWorksheetEditor()||!s||i.is3D||i.AV||i.SV||i.CV||i.EV2||i.CP||i.PC||i.DA||i.FI||i.PV||A(n.showToolBar)||A(n.showMenuBar)||A(n.showAlgebraInput)||A(n.enableRightClick)||n.appName&&"classic"!=n.appName?r+="web3d/":r+="webSimple/",G(r,!1)}},G=function(e,t){if(e.requirejs)p=e;else{"/"!==e.slice(-1)&&(e+="/"),p=e,null===t&&(t=-1===e.indexOf("http")),h=t,g="web.nocache.js",v=!1;var n=p.split("/");n.length>1&&(t||"webSimple"!==n[n.length-2]?Z.indexOf(n[n.length-2])>=0&&(g=n[n.length-2]+".nocache.js"):(g="webSimple.nocache.js",v=!0)),n=e.split("/"),"test"===(m=n[n.length-3]).substr(0,4)?m=m.substr(4,1)+"."+m.substr(5,1):"war"!==m.substr(0,3)&&"beta"!==m.substr(0,4)||(m="5.0");var i=parseFloat(m);NaN!==i&&i<5&&e.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+i+" is deprecated. Using version latest instead."),M("5.0",t))}},D=function(e,t){window.console&&window.console.log&&(!t||void 0===t.showLogging||t.showLogging&&"false"!==t.showLogging)&&console.log(e)};function F(){var e=t;null!==l?e=l:parseFloat(e)<5&&(e="5.0"),M(e,!1),null!==c&&G(c,h),s=!0}return void 0!==n.material_id?j(F):F(),e},GGBAppletUtils=function(){"use strict";function e(){return void 0!==window.GGBT_wsf_edit}function t(e,t){1!=t?(e.style.transformOrigin="0% 0% 0px",e.style.webkitTransformOrigin="0% 0% 0px",e.style.transform="scale("+t+","+t+")",e.style.webkitTransform="scale("+t+","+t+")",e.style.maxWidth="initial",null!==e.querySelector(".ggb_preview")&&(e.querySelector(".ggb_preview").style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[0]&&(e.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),void 0!==e.querySelectorAll(".ggb_preview img")[1]&&(e.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(e.style.transform="none",e.style.webkitTransform="none")}function n(e,t,n,i,a){if(e.isScreenshoGenerator)return 1;var o,r=void 0!==i&&i,s=null!=e.noScaleMargin&&e.noScaleMargin,l=(o=e.autoHeight)&&"false"!==o,c=function(e,t,n,i,a,o){var r=null;if(null!=o&&""!=o)for(var s=e.parentNode;null!=s;){if((" "+s.className+" ").indexOf(" "+o+" ")>-1){r=s;break}s=s.parentNode}var l=0,c=0,u=0,d=0,p=0,h=0,f=0;if(r)l=r.offsetWidth,c=Math.max(i?r.offsetWidth:0,r.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(l=Math.min(window.innerWidth,document.documentElement.clientWidth),c=Math.min(window.innerHeight,document.documentElement.clientHeight),u=l):(l=window.innerWidth,c=window.innerHeight,u=window.innerWidth),e){var m=e.getBoundingClientRect();m.left>0&&m.left<=l&&(void 0===a||!a)&&("rtl"===document.dir?(p=l-m.width-m.left,h=u<=480?10:30):(h=m.left,p=u<=480?10:30),d=h+p)}e&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(e.getBoundingClientRect(),"closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(d=40,f=0):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(d=0,f=40))}return e&&((void 0===n||!n)&&t>0&&t+d1&&(r=!0)),t&&"object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()&&(r=!0),e.hasOwnProperty("disableAutoScale")&&e.disableAutoScale?o:(a=n(e,t,r,i,e.scaleContainerClass),!r||e.hasOwnProperty("scale")&&1!==o?Math.min(o,a):a)}function a(e){var t=Math.min(window.innerWidth,document.documentElement.clientWidth),n=Math.min(window.innerHeight,document.documentElement.clientHeight),i=e.getBoundingClientRect(),a=(t-i.width)/2,o=(n-i.height)/2;o<0&&(o=0),e.style.position="relative","closePositionRight"===window.GGBT_wsf_view.getCloseBtnPosition()?(e.style.left=a<40?"40px":a+"px",e.style.top=o+"px"):"closePositionTop"===window.GGBT_wsf_view.getCloseBtnPosition()&&(e.style.top=o<40?"40px":o+"px",e.style.left=a+"px")}return{responsiveResize:function(n,o){var r=n.querySelector(".appletParameters");if(r){if("object"===_typeof(window.GGBT_wsf_view)&&window.GGBT_wsf_view.isFullscreen()){if(o.id!==r.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(n)}if(r.parentElement&&/fullscreen/.test(r.parentElement.className))return;var s=i(o,n);e()&&r.setAttribute("data-param-scale",s);for(var l=null,c=0;c=O)continue;if(j==jb){if(k=i.getAttribute(kb),k){var l,m=k.indexOf(lb);m>=O?(j=k.substring(O,m),l=k.substring(m+P)):(j=k,l=W),c[j]=l}}else if(j==mb){if(k=i.getAttribute(kb),k)try{d=eval(k)}catch(e){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(e){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(e){var t=c[e];return null==t?null:t},r=d,webModule.__errFn=e}function B(){function e(e){var t=e.lastIndexOf(rb);-1==t&&(t=e.length);var n=e.indexOf(sb);-1==n&&(n=e.length);var i=e.lastIndexOf(tb,Math.min(n,t));return i>=O?e.substring(O,i+P):W}var t,n=null!=(t=__gwt_getMetaProperty(wb))?t:W;return n==W&&(n=function(){for(var t=o.getElementsByTagName(_),n=O;nO?e[e.length-P].href:W}()),n==W&&function(){var e=o.location;return e.href==e.protocol+zb+e.host+e.pathname+e.search+e.hash}()&&(n=e(o.location.href)),n=function(t){if(t.match(/^\w+:\/\//));else{var n=o.createElement(ub);n.src=t+vb,t=e(n.src)}return t}(n),n}function C(e){return e.match(/^\//)||e.match(/^[a-zA-Z]+:\/\//)?e:webModule.__moduleBase+e}function D(){var e,t=O,i=[],a=[];function o(e){var t=a[e](),n=i[e];if(t in n)return t;var o=[];for(var s in n)o[n[s]]=s;throw r&&r(e,o,t),null}if(__gwt_isKnownPropertyValue=function(e,t){return t in i[e]},webModule.__getPropMap=function(){var e={};for(var t in i)i.hasOwnProperty(t)&&(e[t]=o(t));return e},webModule.__computePropValue=o,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);try{var s=(e=Cb).indexOf(Db);-1!=s&&(t=parseInt(e.substring(s+P),$),e=e.substring(O,s))}catch(e){}return webModule.__softPermutationId=t,C(e+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}s[L]={moduleName:L},webModule.__moduleStartupDone=function(e){var t=s[L].bindings;s[L].bindings=function(){for(var n=t?t():{},i=e[webModule.__softPermutationId],a=O;a0){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"",n=[],i=0;i0&&(0,w.jsx)("div",{id:i||"",children:(0,w.jsx)(p.Z,a()({showLine:{showLeafIcon:!1},showIcon:!0,treeData:c,className:h,onSelect:n,onExpand:function(e,t){b((function(e){return _(e,t.node.key,t.expanded)}))}},k))})}},74908:function(e,t,n){"use strict";n.d(t,{Z:function(){return y}});var i=n(7557),a=n.n(i),o=n(41498),r=n.n(o),s=n(79800),l=n.n(s),c=n(59301),u="imageDimensions___a7crR",d="img___Kroat",p="fullWidth___c492T",h=n(92310),f=n.n(h),m=n(71418),g=n(2859),v=n(51136),w=n(6457),b=n(37712),y=function(e){var t=e.data,n=e.className,i=e.fullWidth,o=e.style,s=void 0===o?{}:o,h=e.onClose,y=e.onOk,x=e.showFullTools,_=e.noAssociationId,k=(0,c.useRef)(null),j=(0,c.useRef)(null),C=(0,c.useState)(!1),S=l()(C,2),A=S[0],T=S[1],B=(0,c.useState)("正在加载中"),N=l()(B,2),P=N[0],E=N[1];(0,c.useEffect)((function(){null!=t&&t.visible?document.body.setAttribute("data-custom","y-hidden"):document.body.removeAttribute("data-custom"),null!=t&&t.src&&I()}),[null==t?void 0:t.visible]);var I=function(){var e=r()(a()().mark((function e(){var n;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(!0),E("正在加载中"),e.next=4,(0,w.ZJ)(null==t?void 0:t.src);case 4:n=e.sent,k.current.src="",k.current.src=n,k.current.onload=function(){Z()},T(!1),E("");case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),L=function(){var e=r()(a()().mark((function e(n){var i;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T(!0),E("正在保存中"),e.next=4,(0,v.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:t.title,file:n.dataUrl}});case 4:if(null==(i=e.sent)||!i.id||_){e.next=12;break}return e.next=8,(0,v.ZP)("/api/attachments/".concat(t.id,"/add_subitem.json"),{method:"post",body:{subitem_id:null==i?void 0:i.id,settings:JSON.stringify(n.state)}});case 8:0===e.sent.status&&y(),e.next=13;break;case 12:null!=i&&i.id&&y(i);case 13:T(!1),E("");case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Z=function(){j.current=new g.hP(k.current),j.current.addEventListener("render",L),j.current.addEventListener("beforeclose",h),x&&(j.current.availableMarkerTypes=j.current.ALL_MARKER_TYPES,j.current.uiStyleSettings.redoButtonVisible=!0,j.current.uiStyleSettings.notesButtonVisible=!0,j.current.uiStyleSettings.zoomButtonVisible=!0,j.current.uiStyleSettings.zoomOutButtonVisible=!0,j.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=j.current.uiStyleSettings,j.current.show(),null!=t&&t.snapshotData&&j.current.restoreState(t.snapshotData),setTimeout((function(){var e;(e=document.querySelector('a[href="https://markerjs.com/"]'))&&e.parentNode&&(e.parentNode.style.display="none"),[{name:'[data-action="select"]',title:"选择"},{name:'[data-action="delete"]',title:"删除元素"},{name:'[data-action="undo"]',title:"撤销"},{name:'[data-type-name="FrameMarker"]',title:"矩形"},{name:'[data-type-name="FreehandMarker"]',title:"画线"},{name:'[data-type-name="ArrowMarker"]',title:"箭头"},{name:'[data-type-name="TextMarker"]',title:"文本"},{name:'[data-type-name="EllipseMarker"]',title:"椭圆"},{name:'[data-type-name="HighlightMarker"]',title:"方块"},{name:'[data-type-name="CalloutMarker"]',title:"注释"},{name:'[data-action="render"]',title:"保存"},{name:'[data-action="close"]',title:"退出"}].forEach((function(e){var t=document.querySelector(e.name);t&&t.setAttribute("title",e.title)}))}),300)};return(0,b.jsx)(c.Fragment,{children:(null==t?void 0:t.visible)&&(0,b.jsxs)("div",{className:f()(u,n,i?p:""),style:s,children:[(0,b.jsx)(m.Z,{spinning:A,tip:P,style:{position:"absolute"}}),(0,b.jsx)("img",{className:d,ref:k})]})})}},29325:function(e,t,n){"use strict";n.d(t,{N:function(){return A}});var i=n(7557),a=n.n(i),o=n(41498),r=n.n(o),s=n(37205),l=n.n(s),c=n(79800),u=n.n(c),d=n(59301),p=n(57809),h=n(43418),f=n(95237),m=n(43604),g=n(98135),v=n(8591),w=n(51136),b="wrap___F7E3F",y="selectWrapper____kESB",x="tips___aHjQY",_="linkBtn___uggVr",k="mainText____S1I0",j=n(88289),C=n(37712),S=p.default.Option,A=function(e){var t=e.subId,n=e.value,i=e.selectvalues,o=e.disabled,s=e.knowledgeOptions,c=void 0===s?[]:s,A=e.onChange,T=void 0===A?function(){}:A,B=e.onAddKnowledgeFinish,N=void 0===B?function(){}:B,P=(0,d.useRef)(),E=(0,d.useState)([]),I=u()(E,2),L=I[0],Z=I[1];n=n||[];(0,d.useEffect)((function(){(null==i?void 0:i.length)>0&&(Z(l()(i)),T(l()(i)))}),[c]),(0,d.useEffect)((function(){var e;(null===(e=n)||void 0===e?void 0:e.length)>0&&T(l()(n))}),[c]);return(0,C.jsxs)(f.Z,{wrap:!1,align:"middle",className:b,children:[(0,C.jsx)(m.Z,{children:(0,C.jsx)(p.default,{mode:"multiple",disabled:!t||o,className:y,placeholder:"请选择知识点,支持选择多个",onChange:function(e,t){e?(Z(l()(t)),T(l()(t))):(Z([]),T([]))},style:{width:490},showSearch:!0,allowClear:!0,value:L,filterOption:function(e,t){return t.label.indexOf(e.toLowerCase())>=0},children:null==c?void 0:c.map((function(e){return(0,C.jsx)(S,{value:e.id,label:e.name,children:(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,C.jsx)("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:e.name}),"personal"===(null==e?void 0:e.type)&&(0,C.jsx)("div",{style:{marginLeft:"5px",border:"1px solid #24C074",color:"#24C074",padding:"0 4px",borderRadius:"2px",fontSize:"12px",height:"20px",lineHeight:"20px"},children:"自用"})]})},e.id)}))})}),t&&(0,C.jsxs)(m.Z,{className:"ml20",children:[(0,C.jsx)("span",{className:x,children:"没有合适的知识点?"}),(0,C.jsx)("span",{className:_,onClick:function(e){e.preventDefault(),P.current="",h.Z.confirm({centered:!0,width:640,okText:"确定",cancelText:"取消",icon:null,title:"新建知识点",className:"custom-modal-divider",content:(0,C.jsxs)("div",{className:"font14",children:[(0,C.jsxs)(f.Z,{className:"mb20",children:[(0,C.jsx)(m.Z,{children:(0,C.jsx)(j.Z,{style:{color:"#FF8C29"}})}),(0,C.jsxs)(m.Z,{className:"ml10 ".concat(k),children:["新建的知识点仅本人可见,平台审核列入公开知识点后,对所有用户可见。",(0,C.jsx)("br",{}),"平台有权删除不合适的知识点,请认真填写知识点名称。"]})]}),(0,C.jsx)(g.Z,{maxLength:20,size:"middle",showCount:!0,placeholder:"请输入知识点名称",defaultValue:P.current,onChange:function(e){P.current=e.target.value}})]}),onOk:function(){return new Promise(function(){var e=r()(a()().mark((function e(n,o){var r,s;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(P.current){e.next=3;break}return v.ZP.warning("请输入知识点名称"),e.abrupt("return",o());case 3:if(!(P.current.length>20)){e.next=6;break}return v.ZP.warning("请输入不超过20字的知识点名称"),e.abrupt("return",o());case 6:return e.next=8,(0,w.ZP)("/api/tag_disciplines.json",{method:"post",body:{name:P.current,sub_discipline_id:t}});case 8:return 0===(null==(r=e.sent)?void 0:r.status)&&(N({id:r.tag_discipline_id,name:P.current,type:"personal"}),(s=i||[]).push(r.tag_discipline_id),T(l()(s)),Z(l()(s)),T(l()(s))),e.abrupt("return",n());case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}())}})},children:"新建知识点"})]})]})}},36017:function(e,t,n){"use strict";n.d(t,{h:function(){return p},x:function(){return h}});var i=n(82242),a=n.n(i),o=n(39647),r=n.n(o),s=n(11094),l=n(5547),c=n(42783),u=n(37712),d=["value","onChange","scrollId"],p=function(e){var t=e.value,n=e.onChange,i=e.scrollId,o=r()(e,d);return(0,u.jsx)("div",{id:i||"",children:(0,u.jsx)(s.Z,a()(a()({},o),{},{defaultValue:t,onChange:function(e,t){console.log("a:",e,t),null!=t&&t.length?n(e,t):n(e)}}))})},h=function(e){var t=e.value,n=e.onChange,i=e.placeholder,a=e.height,o=void 0===a?140:a;return e.isEdit?(0,u.jsx)(s.Z,{watch:!0,isFocus:!0,height:o,placeholder:i,defaultValue:t,onChange:n}):(0,u.jsx)("div",{style:{cursor:"pointer"},children:t?(0,u.jsx)(c.Z,{className:l.Z.inputBorder,value:t}):(0,u.jsx)("div",{className:"".concat(l.Z.inputBorder," ").concat(l.Z.placeholder," inputBorderError"),children:i})})}},37507:function(e,t,n){"use strict";n.d(t,{h:function(){return v}});var i=n(82242),a=n.n(i),o=n(79800),r=n.n(o),s=n(59301),l=n(57809),c=n(78241),u=n(3113),d=n(89780),p=n.n(d),h=(n(81974),n(3693),n(37712)),f=l.default.Option,m={labelCol:{span:4},wrapperCol:{span:20}},g={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};function v(e){var t=e.value,n=e.onChange,i=e.mode,o=e.options,l=void 0===o?{}:o,c=(0,s.useRef)(),u=(0,s.useState)(),d=r()(u,2),f=d[0],m=d[1];return(0,s.useEffect)((function(){if(f){var e=function(e){var t=e.getValue();n&&n(t)};return f.on("change",e),function(){f.off("change",e)}}}),[f,n]),(0,s.useEffect)((function(){f&&f.setOption("mode",i)}),[f,i]),(0,s.useEffect)((function(){f&&(t===f.getValue()&&""!==t||setTimeout((function(){f.setValue(t||"")}),300))}),[f,t]),(0,s.useEffect)((function(){if(c.current&&!f){var e=p().fromTextArea(c.current,a()({mode:i,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},l));m(e)}}),[c.current,f]),(0,h.jsx)("div",{className:"my-codemirror-container",children:(0,h.jsx)("textarea",{ref:c})})}t.Z=function(e){var t=e.callback,n=e.onCancel,i=(0,s.useState)("python"),o=r()(i,2),d=o[0],p=o[1];return(0,h.jsxs)(c.Z,a()(a()({},m),{},{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){t(e)},style:{width:500},children:[(0,h.jsx)(c.Z.Item,{label:"代码语言",name:"language",children:(0,h.jsx)(l.default,{getPopupContainer:function(e){return e.parentNode},onChange:function(e){p(g[e][1])},children:Object.keys(g).map((function(e){return(0,h.jsx)(f,{value:e,children:g[e][0]},e)}))})}),(0,h.jsx)(c.Z.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}],children:(0,h.jsx)(v,{mode:d})}),(0,h.jsxs)("div",{className:"flex-container flex-end",children:[(0,h.jsx)(u.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,h.jsx)(u.ZP,{type:"ghost",onClick:n,children:"取消"})]})]}))}},11094:function(e,t,n){"use strict";n.d(t,{Z:function(){return Ae}});var i=n(91232),a=n.n(i),o=n(79800),r=n.n(o),s=n(85573),l=n.n(s),c=n(59301),u=n(89780),d=n.n(u),p=n(76374),h=(n(81974),n(6313),n(25717),n(99498),n(25419),n(67549),n(42783)),f=n(37712),m=function(e){var t=e.value,n=void 0===t?"":t,i=(e.className,e.showTextOnly,e.showLines,e.style,(0,c.useMemo)((function(){return""}),[n]));return(0,f.jsx)(f.Fragment,{children:(0,f.jsx)("div",{dangerouslySetInnerHTML:{__html:i}})})},g=n(82242),v=n.n(g),w=[{title:"粗体",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"斜体",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"md-iconfont icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"链接",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"行内公式",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"数学图像",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"多行公式",icon:"iconfont icon-jisuan1",actionName:"latex"},"|",{title:"添加图片",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"插入画图",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"插入流程图",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"表格",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"换行",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"清空",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function b(e){var t=e.onActionCallback,n=e.title,i=e.icon,a=e.actionName,o=e.className,r=void 0===o?"":o,s=e.children;return(0,f.jsxs)("a",{title:n,className:r,onClick:function(){t(a)},children:[(0,f.jsx)("i",{className:"".concat(i)}),s]})}var y=function(e){var t=e.watch,n=e.showNullButton,i=e.showNullProgramButton,a=e.onActionCallback,o=e.fullScreen,r=e.insertTemp,s=e.hidetoolBar,l=e.extraUse,c=[].concat(w,[{title:"".concat(t?"关闭实时预览":"开启实时预览"),icon:"".concat(t?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"),actionName:"trigger-watch"}]);return(0,f.jsxs)("ul",{className:"markdown-toolbar-container",children:[!s&&c.map((function(e,t){return(0,f.jsx)("li",{children:e.actionName?(0,f.jsx)(b,v()(v()({},e),{},{onActionCallback:a})):(0,f.jsx)("span",{className:"v-line"})},t)})),n?(0,f.jsx)("li",{children:(0,f.jsx)(b,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:a,children:(0,f.jsx)("span",{className:"fill-tip",children:"点击插入\b填空项"})})}):null,i?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("li",{children:(0,f.jsx)(b,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"增加填空",actionName:"add-signal",onActionCallback:a,children:(0,f.jsx)("span",{className:"fill-tip",children:"+单行填空项"})})}),(0,f.jsx)("li",{children:(0,f.jsx)(b,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"增加填空",actionName:"add-multiple",onActionCallback:a,children:(0,f.jsx)("span",{className:"fill-tip",children:"+多行填空项"})})})]}):null,r&&(0,f.jsx)("li",{children:(0,f.jsx)(b,{icon:"md-iconfont icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(r),onActionCallback:a,children:(0,f.jsx)("span",{className:"fill-tip",children:"插入模板"})})}),l&&(0,f.jsx)("li",{children:l}),(0,f.jsx)("li",{className:"btn-full-screen",children:(0,f.jsx)(b,{icon:"".concat(o?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"),title:o?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:a})})]})},x=n(27308),_=n(78241),k=n(98135),j=n(3113),C={labelCol:{span:4},wrapperCol:{span:20}},S=function(e){var t=e.callback,n=e.onCancel;return(0,f.jsxs)(_.Z,v()(v()({},C),{},{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){t(e)},style:{width:500},children:[(0,f.jsx)(_.Z.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}],children:(0,f.jsx)(k.Z,{})}),(0,f.jsx)(_.Z.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}],children:(0,f.jsx)(k.Z,{})}),(0,f.jsxs)("div",{className:"flex-container flex-end",children:[(0,f.jsx)(j.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,f.jsx)(j.ZP,{type:"ghost",onClick:n,children:"取消"})]})]}))},A=n(37507),T=n(8591),B=n(55087),N=_.Z.useForm,P={width:280,marginRight:10},E={labelCol:{span:5},wrapperCol:{span:19}},I=function(e){var t=e.callback,n=e.onCancel,i=N(),a=r()(i,1)[0],o=(0,c.useRef)();function s(e,t){-1!==e.status?a.setFieldsValue({src:"/api/attachments/".concat(e.id),type:t.type}):T.ZP.error(e.message)}return(0,f.jsxs)(_.Z,v()(v()({form:a},E),{},{className:"upload-image-panel",onFinish:function(e){t(e,o.current)},style:{width:470,overflow:"hidden"},children:[(0,f.jsx)(_.Z.Item,{label:"图片地址",required:!0,children:(0,f.jsxs)("div",{className:"flex-container",children:[(0,f.jsx)(_.Z.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入图片地址"}],children:(0,f.jsx)(k.Z,{style:P})}),(0,f.jsx)(L,{onFileChange:function(e){var t=e.target.files[0];o.current=t,Z(t,s)}})]})}),(0,f.jsx)(_.Z.Item,{label:"图片描述",name:"alt",children:(0,f.jsx)(k.Z,{style:{width:264}})}),(0,f.jsxs)(_.Z.Item,{style:{textAlign:"right"},children:[(0,f.jsx)(j.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,f.jsx)(j.ZP,{type:"default",onClick:n,children:"取消"})]})]}))};function L(e){var t=e.onFileChange;return(0,f.jsxs)("label",{className:"upload-button",style:{cursor:"pointer"},children:["本地上传",(0,f.jsx)("input",{type:"file",onChange:t})]})}function Z(e,t){if(!e)throw new String("没有文件");var n=new FormData;n.append("editormd-image-file",e),n.append("file_param_name","editormd-image-file"),n.append("byxhr","true");var i=new window.XMLHttpRequest;i.withCredentials=!0,i.addEventListener("load",(function(n){t(JSON.parse(n.target.responseText),e)}),!1),i.addEventListener("error",(function(e){console.error(e)}),!1),i.open("POST","".concat(B.KI,"/api/attachments.json")),i.send(n)}var M=n(95237),G=n(74908),D=function(e){var t=e.callback,n=e.onCancel,i=document.createElement("canvas"),a=i.getContext("2d");i.width=1e3,i.height=800,a.fillStyle="#ffffff",a.fillRect(0,0,i.width,i.height);var o=i.toDataURL("image/png");return(0,f.jsx)(M.Z,{style:{height:"100vh"},children:(0,f.jsx)(G.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:o,visible:!0,title:String(Date.now())},onOk:function(e){t({src:e.url})},onClose:n})})},F=n(7557),R=n.n(F),O=n(41498),z=n.n(O),H=n(37205),W=n.n(H),V=n(12378);function U(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(U,go.CommandHandler),U.prototype.canAlignSelection=function(){var e=this.diagram;return null!==e&&!e.isReadOnly&&!e.isModelReadOnly&&!(e.selection.count<2)},U.prototype.alignLeft=function(){var e=this.diagram;e.startTransaction("aligning left");var t=1/0;e.selection.each((function(e){e instanceof go.Link||(t=Math.min(e.position.x,t))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(t,e.position.y))})),e.commitTransaction("aligning left")},U.prototype.alignRight=function(){var e=this.diagram;e.startTransaction("aligning right");var t=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var n=e.actualBounds.x+e.actualBounds.width;t=Math.max(n,t)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(t-e.actualBounds.width,e.position.y))})),e.commitTransaction("aligning right")},U.prototype.alignTop=function(){var e=this.diagram;e.startTransaction("alignTop");var t=1/0;e.selection.each((function(e){e instanceof go.Link||(t=Math.min(e.position.y,t))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.position.x,t))})),e.commitTransaction("alignTop")},U.prototype.alignBottom=function(){var e=this.diagram;e.startTransaction("aligning bottom");var t=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var n=e.actualBounds.y+e.actualBounds.height;t=Math.max(n,t)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,t-e.actualBounds.height))})),e.commitTransaction("aligning bottom")},U.prototype.alignCenterX=function(){var e=this.diagram,t=e.selection.first();if(t){e.startTransaction("aligning Center X");var n=t.actualBounds.x+t.actualBounds.width/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(n-e.actualBounds.width/2,e.actualBounds.y))})),e.commitTransaction("aligning Center X")}},U.prototype.alignCenterY=function(){var e=this.diagram,t=e.selection.first();if(t){e.startTransaction("aligning Center Y");var n=t.actualBounds.y+t.actualBounds.height/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,n-e.actualBounds.height/2))})),e.commitTransaction("aligning Center Y")}},U.prototype.alignColumn=function(e){var t=this.diagram;t.startTransaction("align Column"),void 0===e&&(e=0),e=parseFloat(e);var n=new Array;t.selection.each((function(e){e instanceof go.Link||n.push(e)}));for(var i=0;i0){for(var i=r.elt(s-1);null!==i&&i.isTreeExpanded&&!i.isTreeLeaf;){i=this._sortTreeChildrenByY(i).last()}null!==i&&e.select(i)}else e.select(o)}else if("Down"===n.key){var a;if(t.isTreeExpanded&&!t.isTreeLeaf)null!==(a=this._sortTreeChildrenByY(t).first())&&e.select(a);else for(;null!==t;){var o,r,s;if(null===(o=t.findTreeParentNode()))break;if((s=(r=this._sortTreeChildrenByY(o)).indexOf(t))i.y?1:n.xi.x?1:0})),t},U.prototype.copyToClipboard=function(e){go.CommandHandler.prototype.copyToClipboard.call(this,e),this._lastPasteOffset.set(this.pasteOffset)},U.prototype.pasteFromClipboard=function(){var e=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(e,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),e},Object.defineProperty(U.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(e){if("move"!==e&&"select"!==e&&"scroll"!==e&&"tree"!==e&&"none"!==e)throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+e);this._arrowKeyBehavior=e}}),Object.defineProperty(U.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(e){if(!(e instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+e);this._pasteOffset.set(e)}});var K=U,q=(n(31270),n(85160)),Y=n(43418),J=n(43604),Q=n(51136),X="myPaletteDiv___Xjz2I",$="maxH60___Pd4Re";window.go=V;var ee=function(e){var t=e.onCancel,n=e.callback,i=(0,c.useRef)(),a=(0,c.useRef)(),o=(0,c.useRef)(),s=(0,c.useRef)(!1),l=(0,c.useRef)(!1),u=(0,c.useState)(0),d=r()(u,2),p=d[0],h=d[1],m=function(){var e=z()(R()().mark((function e(){var t,a;return R()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.current.makeImage(),e.next=3,(0,Q.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:t.src}});case 3:a=e.sent,n({src:a.url});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,c.useEffect)((function(){h(p+1)}),[]),(0,f.jsx)("div",{ref:l,className:s.current?"".concat($," body-overflow-initial"):"body-overflow-initial",children:(0,f.jsx)(Y.Z,{width:1200,icon:null,footer:null,closable:!0,visible:!!p,destroyOnClose:!0,maskClosable:!1,getContainer:l.current,rootClassName:"zIndex-9999",title:(0,f.jsxs)(M.Z,{children:[(0,f.jsx)(J.Z,{flex:1,children:"插入流程图"}),(0,f.jsx)(J.Z,{onClick:function(){s.current=!s.current,h(p+1)},children:(0,f.jsx)("span",{className:"current c-blue mr30",style:{fontWeight:400},children:"展开/收起"})})]}),onCancel:t,children:(0,f.jsxs)("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative"},children:[(0,f.jsxs)("div",{style:{display:"flex",height:"100%"},children:[(0,f.jsxs)("div",{style:{width:"300px",height:"100%"},children:[(0,f.jsx)("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"},children:"图形库"}),(0,f.jsx)("div",{style:{height:"calc(100% - 50px)"},className:X,ref:o})]}),(0,f.jsxs)("div",{style:{flex:1,position:"relative"},children:[(0,f.jsx)(q.FI,{initDiagram:function(){var e=V.GraphObject.make,t="#ff3333",n="#3358ff",r="#25ad23",s="#d533ff",l="#7d33ff",c="#ff6233",u="#ffffff",d="#000000",p="#fffcd5",h="#d5ebff",f="#f2dfe0",m="#a5d2fa",g="#cccccc",v="#b3e6b3",w="#fcbbbd";function b(t,n){var i=function(e,n){e.handled=!0,e.diagram.model.commit((function(i){var a=n.part.adornedPart,o=(new V.Point).setRectSpot(a.actualBounds,t);o.subtract(a.location),o.scale(2,2),o.x+=130*Math.sign(o.x),o.y+=130*Math.sign(o.y),o.add(a.location),o.snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize);var r=i.copyNodeData(a.data);i.setGroupKeyForNodeData(r,i.getGroupKeyForNodeData(a.data)),i.addNodeData(r);var s={from:a.key,to:i.getKeyForNodeData(r)};i.addLinkData(s);var l=e.diagram.findNodeForData(r);l.location=o,e.diagram.select(l),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)}))};return e(V.Shape,{figure:n,alignment:t,alignmentFocus:t.opposite(),width:t.equals(V.Spot.Top)||t.equals(V.Spot.Bottom)?25:18,height:t.equals(V.Spot.Top)||t.equals(V.Spot.Bottom)?18:25,fill:"orange",stroke:u,strokeWidth:4,mouseEnter:function(e,t){return t.fill="dodgerblue"},mouseLeave:function(e,t){return t.fill="orange"},isActionable:!0,click:i,contextClick:i})}function y(t){return e(V.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:function(e,t){return t.fill="dodgerblue"},mouseLeave:function(e,t){return t.fill="orange"},click:function(e,t){e.diagram.commandHandler.showContextMenu(t.part.adornedPart)}},t||{})}function x(e,t){return function(n,i){n.handled=!0,n.diagram.model.commit((function(n){n.set(i.part.adornedPart.data,e,t)}))}}function _(t,n){return n||(n="color"),e(V.Shape,{width:16,height:16,stroke:"lightgray",fill:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.stroke="dodgerblue"},mouseLeave:function(e,t){return t.stroke="lightgray"},click:x(n,t),contextClick:x(n,t)})}function k(){return[e("ContextMenuButton",e(V.Panel,"Horizontal",_(u,"fill"),_(p,"fill"),_(h,"fill"),_(f,"fill"))),e("ContextMenuButton",e(V.Panel,"Horizontal",_(g,"fill"),_(v,"fill"),_(m,"fill"),_(w,"fill")))]}function j(){return[e("ContextMenuButton",e(V.Panel,"Horizontal",_(d),_(r),_(n),_(t))),e("ContextMenuButton",e(V.Panel,"Horizontal",_(u),_(s),_(l),_(c)))]}function C(t,n){return n||(n="thickness"),e(V.Shape,"LineH",{width:16,height:16,strokeWidth:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:x(n,t),contextClick:x(n,t)})}function S(t,n){return n||(n="dash"),e(V.Shape,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:x(n,t),contextClick:x(n,t)})}function A(){return[e("ContextMenuButton",e(V.Panel,"Horizontal",C(1),C(2),C(3),C(4))),e("ContextMenuButton",e(V.Panel,"Horizontal",S(null),S([2,4]),S([4,4])))]}function T(t,n){return n||(n="figure"),e(V.Shape,{width:32,height:32,scale:.5,fill:"lightgray",figure:t,margin:1,background:"transparent",mouseEnter:function(e,t){return t.fill="dodgerblue"},mouseLeave:function(e,t){return t.fill="lightgray"},click:x(n,t),contextClick:x(n,t)})}function B(t){return e(V.Shape,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(t+4).toString()+" H3"})}function N(t){var n="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return 0===t?n="M0 0 M16 16 M0 8 L16 8":2===t&&(n="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),e(V.Shape,{geometryString:n,margin:2,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:x("dir",t),contextClick:x("dir",t)})}function P(t){var n=function(e,n){e.handled=!0,e.diagram.model.commit((function(e){var i=n.part.adornedPart;e.set(i.data,t?"toSpot":"fromSpot",V.Spot.stringify(V.Spot.AllSides)),(t?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(V.Shape,{width:12,height:12,fill:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:n,contextClick:n})}function E(t,n){var i=0,a=V.Spot.RightSide;t.equals(V.Spot.Top)?(i=270,a=V.Spot.TopSide):t.equals(V.Spot.Left)?(i=180,a=V.Spot.LeftSide):t.equals(V.Spot.Bottom)&&(i=90,a=V.Spot.BottomSide),n||(i-=180);var o=function(e,t){e.handled=!0,e.diagram.model.commit((function(e){var i=t.part.adornedPart;e.set(i.data,n?"toSpot":"fromSpot",V.Spot.stringify(a)),(n?i.toNode:i.fromNode).invalidateConnectedLinks()}))};return e(V.Shape,{alignment:t,alignmentFocus:t.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:i,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:o,contextClick:o})}return i.current=new V.Diagram(a.current,{padding:20,grid:e(V.Panel,"Grid",e(V.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(V.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:function(e){e.diagram.commandHandler.addTopLevelParts(e.diagram.selection,!0)||e.diagram.currentTool.doCancel()},commandHandler:e(K),"clickCreatingTool.archetypeNodeData":{text:"未命名",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:function(e){var t=e.subject;t.location=t.location.copy().snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:function(e){e.subject;setTimeout((function(){e.diagram.commandHandler.editTextBlock()}))},LinkRelinked:function(e){e.parameter.part.invalidateConnectedLinks();var t=e.subject;e.diagram.toolManager.linkingTool.isForwards?t.toNode.invalidateConnectedLinks():t.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),i.current.nodeTemplate=e(V.Node,"Auto",{locationSpot:V.Spot.Center,locationObjectName:"SHAPE",desiredSize:new V.Size(120,60),minSize:new V.Size(40,40),resizable:!0,resizeCellSize:new V.Size(10,10),rotatable:!0},new V.Binding("location","loc",V.Point.parse).makeTwoWay(V.Point.stringify),new V.Binding("desiredSize","size",V.Size.parse).makeTwoWay(V.Size.stringify),e(V.Shape,{name:"SHAPE",fill:u,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:V.Spot.AllSides,toSpot:V.Spot.AllSides},new V.Binding("figure"),new V.Binding("fill"),new V.Binding("stroke","borderColor"),new V.Binding("strokeWidth","thickness"),new V.Binding("strokeDashArray","dash")),e(V.Shape,{width:100,height:20,strokeWidth:0,fill:"transparent"}),e(V.TextBlock,{margin:1,textAlign:"center",overflow:V.TextBlock.OverflowEllipsis,editable:!0},new V.Binding("text").makeTwoWay(),new V.Binding("stroke","color"))),i.current.nodeTemplate.toolTip=e("ToolTip",e(V.Panel,"Vertical",{maxSize:new V.Size(200,NaN)},e(V.TextBlock,{font:"bold 10pt sans-serif",textAlign:"center"},new V.Binding("text")),e(V.TextBlock,{font:"10pt sans-serif",textAlign:"center"},new V.Binding("text","details")))),i.current.nodeTemplate.selectionAdornmentTemplate=e(V.Adornment,"Spot",e(V.Placeholder,{padding:10}),b(V.Spot.Top,"TriangleUp"),b(V.Spot.Left,"TriangleLeft"),b(V.Spot.Right,"TriangleRight"),b(V.Spot.Bottom,"TriangleDown"),y({alignment:new V.Spot(.75,0)})),i.current.nodeTemplate.contextMenu=e("ContextMenu",e("ContextMenuButton",e(V.Panel,"Horizontal",T("Rectangle"),T("RoundedRectangle"),T("Ellipse"),T("Diamond"))),e("ContextMenuButton",e(V.Panel,"Horizontal",T("Parallelogram2"),T("ManualOperation"),T("Procedure"),T("Cylinder1"))),e("ContextMenuButton",e(V.Panel,"Horizontal",T("Terminator"),T("CreateRequest"),T("Document"),T("TriangleDown"))),k(),j(),A()),i.current.groupTemplate=e(V.Group,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:V.Spot.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:function(e,t){t.addMembers(t.diagram.selection,!0)||t.diagram.currentTool.doCancel()},avoidable:!1},new V.Binding("location","loc",V.Point.parse).makeTwoWay(V.Point.stringify),e(V.Panel,"Auto",{name:"BODY"},e(V.Shape,{parameter1:10,fill:u,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:V.Spot.AllSides,toSpot:V.Spot.AllSides},new V.Binding("fill"),new V.Binding("stroke","color"),new V.Binding("strokeWidth","thickness"),new V.Binding("strokeDashArray","dash")),e(V.Placeholder,{background:"transparent",margin:20})),e(V.TextBlock,{alignment:V.Spot.Top,alignmentFocus:V.Spot.Bottom,font:"bold 12pt sans-serif",editable:!0},new V.Binding("text"),new V.Binding("stroke","color"))),i.current.groupTemplate.selectionAdornmentTemplate=e(V.Adornment,"Spot",e(V.Panel,"Auto",e(V.Shape,{fill:null,stroke:"dodgerblue",strokeWidth:3}),e(V.Placeholder,{margin:1.5})),y({alignment:V.Spot.TopRight,alignmentFocus:V.Spot.BottomRight})),i.current.groupTemplate.contextMenu=e("ContextMenu",k(),j(),A()),i.current.linkTemplate=e(V.Link,{layerName:"Foreground",routing:V.Link.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new V.Binding("fromSpot","fromSpot",V.Spot.parse),new V.Binding("toSpot","toSpot",V.Spot.parse),new V.Binding("fromShortLength","dir",(function(e){return e>=1?10:0})),new V.Binding("toShortLength","dir",(function(e){return e>=1?10:0})),new V.Binding("points").makeTwoWay(),e(V.Shape,{strokeWidth:2},new V.Binding("stroke","color"),new V.Binding("strokeWidth","thickness"),new V.Binding("strokeDashArray","dash")),e(V.Shape,{segmentIndex:0,segmentOffset:new V.Point(15,0),segmentOrientation:V.Link.OrientAlong,alignmentFocus:V.Spot.Right,figure:"circle",width:10,strokeWidth:0},new V.Binding("fill","color"),new V.Binding("visible","dir",(function(e){return 1===e}))),e(V.Shape,{segmentIndex:-1,segmentOffset:new V.Point(-10,6),segmentOrientation:V.Link.OrientPlus90,alignmentFocus:V.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new V.Binding("fill","color"),new V.Binding("visible","dir",(function(e){return e>=1})),new V.Binding("width","thickness",(function(e){return 7+3*e})),new V.Binding("height","thickness",(function(e){return 7+3*e})),new V.Binding("segmentOffset","thickness",(function(e){return new V.Point(-15,4+1.5*e)}))),e(V.Shape,{segmentIndex:0,segmentOffset:new V.Point(15,-6),segmentOrientation:V.Link.OrientMinus90,alignmentFocus:V.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new V.Binding("fill","color"),new V.Binding("visible","dir",(function(e){return 2===e})),new V.Binding("width","thickness",(function(e){return 7+3*e})),new V.Binding("height","thickness",(function(e){return 7+3*e})),new V.Binding("segmentOffset","thickness",(function(e){return new V.Point(-15,4+1.5*e)}))),e(V.TextBlock,{alignmentFocus:new V.Spot(0,1,-4,0),editable:!0},new V.Binding("text").makeTwoWay(),new V.Binding("stroke","color"))),i.current.linkTemplate.selectionAdornmentTemplate=e(V.Adornment,e(V.Shape,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:B(2)},new V.Binding("pathPattern","thickness",B)),y({alignmentFocus:new V.Spot(0,0,-6,-4)})),i.current.linkTemplate.contextMenu=e("ContextMenu",j(),A(),e("ContextMenuButton",e(V.Panel,"Horizontal",N(0),N(1),N(2))),e("ContextMenuButton",e(V.Panel,"Horizontal",e(V.Panel,"Spot",P(!1),E(V.Spot.Top,!1),E(V.Spot.Left,!1),E(V.Spot.Right,!1),E(V.Spot.Bottom,!1)),e(V.Panel,"Spot",{margin:new V.Margin(0,0,0,2)},P(!0),E(V.Spot.Top,!0),E(V.Spot.Left,!0),E(V.Spot.Right,!0),E(V.Spot.Bottom,!0))))),new V.Palette(o.current,{maxSelectionCount:1,linkTemplate:e(V.Link,{locationSpot:V.Spot.Center,selectionAdornmentTemplate:e(V.Adornment,"Link",{locationSpot:V.Spot.Center},e(V.Shape,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),e(V.Shape,{toArrow:"Standard",stroke:null}))},{routing:V.Link.AvoidsNodes,curve:V.Link.JumpOver,corner:5,toShortLength:4},new V.Binding("points"),e(V.Shape,{isPanelMain:!0,strokeWidth:2}),e(V.Shape,{toArrow:"Standard",stroke:null})),model:new V.GraphLinksModel([{text:"未命名",size:"100 100",fill:null,stroke:"#000"}].concat(W()(V.Shape.getFigureGenerators().toArray().map((function(e){return{text:"未命名",size:"100 100",figure:e.key,fill:"white",stroke:"#666",borderColor:"#000"}})))))}).nodeTemplate=e(V.Node,"Auto",{locationSpot:V.Spot.Center},new V.Binding("location","location",V.Point.parse).makeTwoWay(V.Point.stringify),e(V.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 V.Binding("stroke").makeTwoWay(),new V.Binding("fill").makeTwoWay(),new V.Binding("figure")),e(V.TextBlock,{margin:new V.Margin(5,5,3,5),font:"10pt sans-serif",minSize:new V.Size(16,16),maxSize:new V.Size(10,NaN),textAlign:"center",editable:!0},new V.Binding("key").makeTwoWay())),setTimeout((function(){i.current.grid=e(V.Panel,"Grid",e(V.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),e(V.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),i.current.grid.visible=!0,i.current.grid.gridCellStroke="darkgray",i.current.grid.gridCellStrokeWidth=1}),300),window.myDiagrams=i.current,i.current},divClassName:"diagram-component",style:{height:"80vh"}}),(0,f.jsx)("div",{ref:a})]})]}),(0,f.jsx)("div",{className:"tr",children:(0,f.jsx)(j.ZP,{size:"large",onClick:m,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary",children:"保存到编辑器"})})]})})})},te=n(5112),ne=n(54449),ie=te.ZP.Group,ae={margin:"0 8px"},oe=function(e){var t=e.callback,n=e.onCancel;return(0,f.jsxs)(_.Z,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){t(e)},children:[(0,f.jsxs)("div",{className:"flex-container",style:{alignItems:"baseline"},children:[(0,f.jsx)("span",{style:ae,children:"单元格数:"}),(0,f.jsx)("span",{style:ae,children:"行数"}),(0,f.jsx)(_.Z.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}],children:(0,f.jsx)(ne.Z,{})}),(0,f.jsx)("span",{style:ae,children:"列数"}),(0,f.jsx)(_.Z.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}],children:(0,f.jsx)(ne.Z,{})})]}),(0,f.jsxs)("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"},children:[(0,f.jsx)("span",{style:ae,children:"对齐方式:"}),(0,f.jsx)(_.Z.Item,{name:"align",children:(0,f.jsxs)(ie,{children:[(0,f.jsx)(te.ZP,{value:"default",children:(0,f.jsx)("i",{className:"fa fa-align-justify"})}),(0,f.jsx)(te.ZP,{value:"left",children:(0,f.jsx)("i",{className:"fa fa-align-left"})}),(0,f.jsx)(te.ZP,{value:"center",children:(0,f.jsx)("i",{className:"fa fa-align-center"})}),(0,f.jsx)(te.ZP,{value:"right",children:(0,f.jsx)("i",{className:"fa fa-align-right"})})]})})]}),(0,f.jsxs)("div",{className:"flex-container flex-end",children:[(0,f.jsx)(j.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10},children:"确定"}),(0,f.jsx)(j.ZP,{type:"ghost",onClick:n,children:"取消"})]})]})},re=n(78673),se=n(66455),le=n.n(se),ce=(0,c.forwardRef)((function(e,t){var n=e.use3d,i=e.width,a=e.height,o=e.callback,s=(e.showSaveButton,(0,c.useRef)()),l=(0,c.useRef)(),u=(0,c.useState)(!1),d=r()(u,2),p=d[0],h=d[1],m=(0,c.useRef)({id:s,appName:"graphing",width:i||1e3,height:a||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,c.useEffect)((function(){l.current=new(le())(m.current,!0),window.onload=function(){l.current.inject("applet_container")}}),[]);var g=function(){var e=window.ggbApplet.getPNGBase64(1,!0,72);return o&&o(e),e};return(0,c.useEffect)((function(){m.current.appName=p?"3D":"graphing",l.current.inject("applet_container")}),[p]),(0,c.useEffect)((function(){h(n)}),[n]),(0,c.useImperativeHandle)(t,(function(){return{getImgData:g}})),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:s}),(0,f.jsxs)(M.Z,{align:"middle",children:[(0,f.jsx)(J.Z,{flex:1,children:(0,f.jsx)(re.Z,{size:"default",checkedChildren:"关闭3D图像",unCheckedChildren:"开启3D图像",checked:p,onChange:function(e){return h(e)}})}),(0,f.jsx)(J.Z,{children:(0,f.jsx)(j.ZP,{size:"large",onClick:g,style:{zIndex:8,marginTop:10},type:"primary",children:"保存到编辑器"})})]})]})})),ue=n(33773),de=n(27065),pe="link",he="upload-image",fe="add-flowchart",me="draw-image",ge="code-block",ve="add-table",we="------------",be={default:we,left:":".concat(we),center:":".concat(we,":"),right:"".concat(we,":")},ye=n(56266);var xe="@▁▁@",_e=["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 ke(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var je=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",Ce=l()(l()({},je+"-B","bold"),je+"-I","italic"),Se=l()(l()(l()(l()(l()(l()(l()(l()({},pe,"添加链接"),ge,"添加代码块"),he,"添加图片"),me,"添加画图"),fe,"插入流程图"),ve,"添加表格"),"maths-latex","数学图像"),"inline-latex","LATEX公式"),Ae=function(e){var t=e.defaultValue,n=void 0===t?"":t,i=e.onChange,o=e.width,s=void 0===o?"100%":o,u=e.height,g=void 0===u?400:u,v=e.miniToolbar,w=void 0!==v&&v,b=e.isFocus,_=void 0!==b&&b,k=e.watch,j=e.insertTemp,C=e.mode,B=void 0===C?"markdown":C,N=e.id,P=void 0===N?"markdown-editor-id":N,E=e.showResizeBar,L=void 0!==E&&E,M=e.noStorage,G=void 0!==M&&M,F=e.showNullButton,R=void 0!==F&&F,O=e.showNullProgramButton,z=void 0!==O&&O,H=e.hidetoolBar,W=void 0!==H&&H,V=e.fullScreen,U=void 0!==V&&V,K=e.onBlur,q=e.onCMBeforeChange,J=e.onFullScreen,Q=e.className,X=void 0===Q?"":Q,$=e.disablePaste,te=void 0!==$&&$,ne=e.disabled,ie=void 0!==ne&&ne,ae=e.disabledFill,re=void 0!==ae&&ae,se=e.placeholder,le=void 0===se?"":se,we=e.values,je=void 0===we?"":we,Ae=e.extraUse,Te=(0,c.useState)(null),Be=r()(Te,2),Ne=Be[0],Pe=Be[1],Ee=(0,c.useState)(n),Ie=r()(Ee,2),Le=Ie[0],Ze=Ie[1],Me=(0,c.useState)(k),Ge=r()(Me,2),De=Ge[0],Fe=Ge[1],Re=(0,c.useState)(U),Oe=r()(Re,2),ze=Oe[0],He=Oe[1],We=(0,c.useState)(""),Ve=r()(We,2),Ue=Ve[0],Ke=Ve[1],qe=(0,c.useState)(0),Ye=r()(qe,2),Je=Ye[0],Qe=Ye[1],Xe=(0,c.useState)(g),$e=r()(Xe,2),et=$e[0],tt=$e[1],nt=(0,c.useState)(!1),it=r()(nt,2),at=(it[0],it[1]),ot=(0,c.useState)(0),rt=r()(ot,2),st=rt[0],lt=rt[1],ct=(0,c.useState)(0),ut=r()(ct,2),dt=ut[0],pt=ut[1],ht=(0,c.useRef)(),ft=(0,c.useRef)(),mt=(0,c.useRef)(),gt=(0,c.useRef)();(0,c.useEffect)((function(){var e=window.scrollY||window.pageYOffset;Ze(je),null==Ne||Ne.setValue(je),window.scrollTo(0,e)}),[je]),(0,c.useEffect)((function(){null==J||J(ze)}),[ze]),(0,c.useEffect)((function(){if(ht.current){var e=function(e,n){if(!te){var i=n.clipboardData;if(i){var a=i.types.toString(),o=i.items;if("Files"===a||i.types.indexOf("Files")>-1){if(n.preventDefault(),"stex"==B)return;try{var r,s=o[1];"file"===(null===(r=o[0])||void 0===r?void 0:r.kind)&&(s=o[0]);var l=s.getAsFile(),c=l.name.split(".").pop();Z(l,(function(e){var n,i,a;e.id?(null==l||null===(n=l.type)||void 0===n?void 0:n.indexOf("image"))>-1?t.replaceSelection("![,](/api/attachments/".concat(e.id,"?type=").concat(e.content_type,")")):(null==l||null===(i=l.type)||void 0===i?void 0:i.indexOf("video"))>-1?t.replaceSelection('')):(null==l||null===(a=l.type)||void 0===a?void 0:a.indexOf("pdf"))>-1?t.replaceSelection('').concat(l.name,"")):_e.includes(c)?t.replaceSelection('').concat(l.name,"")):t.replaceSelection("[".concat(l.name,"](").concat(de.Z.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}))}catch(n){T.ZP.warning("请使用chrome浏览器粘贴")}return!0}return!0}return!0}n.preventDefault()},t=d().fromTextArea(ht.current,{mode:B,lineNumbers:!w,lineWrapping:!0,value:n,autoCloseTags:!0,autoCloseBrackets:!0});return t.on("keyup",(function(e,n){8===n.keyCode&&(""==e.getValue()?t.setOption("placeholder",le):t.setOption("placeholder",null))})),t.on("keydown",(function(e,t){if(8===t.keyCode){var n=function(e,t){var n=e.getDoc(),i=n.getCursor(),a=n.getLine(i.line),o=a.charAt(i.ch-1),r=a.lastIndexOf("@▁@",i.ch),s=a.lastIndexOf("@▁▁@",i.ch),l=r>s?r:s,c=r>s?3:4;if(-1===xe.indexOf(o))return null;if(console.log("change1:",t,e,a,i,l,r,s,o),l>=0&&i.ch-l<5){var u=l+c;return n.replaceRange("",{line:i.line,ch:l},{line:i.line,ch:u}),{line:i.line,ch:u}}return null}(e);n&&t.preventDefault()}})),_&&t.focus(),t.on("paste",e),ie&&t.on("beforeChange",(function(e,t){"paste"!==t.origin&&"+input"!==t.origin||t.cancel()})),Pe(t),function(){t.off("paste",e)}}}),[]);var vt=(0,c.useCallback)((function(){ft.current}),[et,ft,ze]);(0,c.useEffect)((function(){if(Ne){var e=function(){var e=new p.Z((function(e){var t,n=a()(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;(i.target.offsetHeight>0||i.target.offsetWidth>0)&&(vt(),Ne.setSize("100%","100%"),Ne.refresh())}}catch(e){n.e(e)}finally{n.f()}}));return e.observe(ht.current.parentElement),e}();return function(){var t,n;null!==(t=ht.current)&&void 0!==t&&t.parentElement&&e.unobserve(null===(n=ht.current)||void 0===n?void 0:n.parentElement)}}}),[Ne,vt]),(0,c.useEffect)((function(){if(Ne){for(var e=[],t=function(){var t=r()(i[n],2),a=t[0],o=t[1],s=l()({},a,(function(){wt(o)}));e.push(s),Ne.addKeyMap(s)},n=0,i=Object.entries(Ce);n0){var e=(new Date).getTime(),t=window.sessionStorage.getItem(P);e>=Je+1e4&&(!t||t!==Le)&&(window.sessionStorage.setItem(P,Le),at(!0))}}),1e4),(0,c.useEffect)((function(){Fe(k)}),[Ne,k]),(0,c.useEffect)((function(){Ne&&_&&Ne.focus()}),[Ne,_]),(0,c.useEffect)((function(){if(De&&Ne){var e=function(e){var t=e.target;if(gt.current){var n=t.scrollTop/t.scrollHeight;gt.current.scrollTop=gt.current.scrollHeight*n}},t=Ne.getScrollerElement();return t.addEventListener("scroll",e),function(){t.removeEventListener("scroll",e)}}}),[Ne,De]),(0,c.useEffect)((function(){if(Ne&&q){var e=function(e,t){q(e,t)};return Ne.on("beforeChange",e),function(){Ne.off("beforeChange",e)}}}),[Ne,q]),(0,c.useEffect)((function(){if(Ne&&K){var e=function(){K(Ne.getValue())};return Ne.on("blur",e),function(){Ne.off("blur",e)}}}),[Ne,K]),(0,c.useEffect)((function(){if(Ne){var e=function(e,t){var n=e.getValue();Ze(n),Qe((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),i&&(z?i(n,kt(n)):i(n))};return Ne.on("change",e),function(){Ne.off("change",e)}}}),[Ne,i]),(0,c.useEffect)((function(){if(Ne)if(null==n)Ne.setValue(""),Ze("");else{var e=window.scrollY||window.pageYOffset;n!==Ne.getValue()&&(Ne.setValue(n),Ze(n),Ne.setCursor(ie?1:Ne.lineCount(),0),window.scrollTo(0,e))}}),[Ne,n]);var wt=(0,c.useCallback)((function(e){var t=Ne.getCursor(),n=Ne.getSelection(),i=n.split("\n");switch(e){case"bold":return Ne.replaceSelection("**"+n+"**"),""===n&&Ne.setCursor(t.line,t.ch+2),Ne.focus();case"italic":return Ne.replaceSelection("*"+n+"*"),""===n&&Ne.setCursor(t.line,t.ch+1),Ne.focus();case"code":return Ne.replaceSelection("`"+n+"`"),""===n&&Ne.setCursor(t.line,t.ch+1),Ne.focus();case"inline-latex":return Ke("inline-latex"),Ne.focus();case"latex":return Ne.replaceSelection("```latex\n"+n+"\n```"),Ne.setCursor(t.line+1,n.length+1),Ne.focus();case"line-break":return Ne.replaceSelection("
\n"),Ne.focus();case"list-ul":return""===n?Ne.replaceSelection("- "+n):Ne.replaceSelection(i.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),Ne.focus();case"list-ol":return""===n?Ne.replaceSelection("1. "+n):Ne.replaceSelection(i.map((function(e,t){return""===e?"":"".concat(t+1,". ").concat(e)})).join("\n")),Ne.focus();case"add-null-ch":return""===n&&Ne.setCursor(t.line,t.ch),Ne.replaceSelection("▁"),Ne.focus();case"add-signal":return""===n&&Ne.setCursor(t.line,t.ch),Ne.replaceSelection("@▁@"),Ne.focus();case"add-multiple":return""===n&&Ne.setCursor(t.line,t.ch),Ne.replaceSelection(xe),Ne.focus();case"inster-template-1":return""===n&&Ne.setCursor(t.line,t.ch),Ne.replaceSelection("\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作"),Ne.focus();case"eraser":return Ne.setValue(""),Ne.focus();case"trigger-watch":return Fe(!De),Ne.focus();case"trigger-full-screen":return He(!ze),Ne.focus();case pe:return void Ke(pe);case ge:return void Ke(ge);case he:return void Ke(he);case me:return void Ke(me);case"maths-latex":return void Ke("maths-latex");case fe:return void Ke(fe);case ve:return void Ke(ve);default:throw new Error}}),[Ne,De,ze]),bt=(0,c.useCallback)((function(e,t){var n,i,a,o,r;switch(Ke(""),Ue){case pe:var s=e.title,l=e.link;return Ne.replaceSelection("[".concat(s,"](").concat(l,")")),Ne.focus();case ge:var c=e.language,u=e.content;return Ne.replaceSelection(["```"+c,u,"```"].join("\n")),Ne.focus();case"maths-latex":for(var d=atob(e),p=new Uint8Array(d.length),h=0;h-1||null==g||!g.type?m?Ne.replaceSelection("![ ".concat(m," ]( ").concat(f,' "').concat(m,'" )')):Ne.replaceSelection("![,](".concat(f,")")):(null==g||null===(o=g.type)||void 0===o?void 0:o.indexOf("video"))>-1?Ne.replaceSelection('')):(null==g||null===(r=g.type)||void 0===r?void 0:r.indexOf("pdf"))>-1?Ne.replaceSelection('').concat(g.name,"")):_e.includes(v)?Ne.replaceSelection('').concat(g.name,"")):Ne.replaceSelection("[".concat(g.name,"](").concat(de.Z.API_SERVER).concat(f,")")),Ne.focus();case ve:for(var w=e.row,b=e.col,y=e.align,x="\n",_=0;_300&&(t=300),tt(g+t+"px")}},i=mt.current,a=!1,o=0;return i.addEventListener("mousedown",e),document.addEventListener("mousemove",n),document.addEventListener("mouseup",t),function(){i.removeEventListener("mousedown",e),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",t)}}}),[Ne,mt]),(0,c.useEffect)((function(){tt(g)}),[g]);var _t={width:ke(s),height:ke(et)},kt=((0,c.useMemo)((function(){if(Je){var e=new Date(Je),t=e.getHours(),n=e.getMinutes(),i=e.getSeconds();return n=n<10?"0"+n:n,i=i<10?"0"+i:i,"".concat(t=t<10?"0"+t:t,":").concat(n,":").concat(i)}return 0}),[Je]),function(e){var t=[];if(z){e=e.replace(/(@▁▁@|@▁@)/g,(function(e,n,i){t.push({multiLine:!("@▁@"===e)})}))}return t});(0,c.useEffect)((function(){if(Se[Ue]&&Ue!==me&&Ue!==fe){var e=document.getElementsByClassName("ant-modal")[0],t=window.innerWidth/2-e.offsetWidth/2,n=window.innerHeight/2-e.offsetHeight/2;lt(t),pt(n)}}),[Ue]);var jt=function(e,t,n,i){var a=document.body.clientHeight,o=document.body.clientWidth;return!(e<20&&n>e||e>o-20&&nt||t>a-20&&i0&&(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(K.Z,{className:g.add,onClick:function(e){ye(e),x()}}),(0,ee.jsx)(U.Z,{okText:"确定",cancelText:"取消",title:"确定删除测试集"+(t+1),onCancel:ye,onConfirm:function(e){ye(e),j(t)},children:(0,ee.jsx)(q.Z,{className:"".concat(g.remove," ml20"),onClick:ye})})]})})]})})]}),children:[(0,ee.jsx)(v.Z.Item,{label:"输入",labelCol:{span:24},name:[e.name,"input"],children:(0,ee.jsx)(te,{rows:4})}),(0,ee.jsx)(v.Z.Item,{label:"输出",labelCol:{span:24},name:[e.name,"output"],rules:[{required:!0,message:"请输入输出内容"}],children:(0,ee.jsx)(te,{rows:4})})]},e.key)}))})}}),(0,ee.jsx)("div",{style:{display:me?"block":"none"}}),(0,ee.jsx)(X.ZP,{rootIdentifier:null,visible:we,onClose:function(){return be(!1)},onOK:function(e){if(null!=e&&e.length){if(null!=e&&e[0].is_file){E(e,!0)();var t=A.concat(e);u.test_set_average?B(t):T(t)}null!=e&&e[0].is_file||E(e)}},multiple:!0,defaultMultipleValue:null==u?void 0:u.is_file})]})},ae=n(89392),oe=n(88289);function re(){return(new Date).getTime()}var se={loading:!0,user:null,disciplines:[],dicts:null,status:0,data:void 0,lastedUpdateTime:0},le=function(e){return e[e.SET_INITAL_DATA=0]="SET_INITAL_DATA",e[e.SET_LOADING=1]="SET_LOADING",e[e.SET_STATUS=2]="SET_STATUS",e}({});function ce(e,t){switch(t.type){case le.SET_INITAL_DATA:return f()(f()({},e),t.payload);case le.SET_LOADING:return f()(f()({},e),{},{loading:t.payload});case le.SET_STATUS:return f()(f()({},e),{},{status:t.payload});default:throw new Error}}var ue=function(){var e,t,n=(0,j.useSearchParams)(),i=p()(n,1)[0],o=(0,j.useParams)().id,s=v.Z.useForm(),c=p()(s,1)[0],d=(0,m.useState)(),h=p()(d,2),Z=h[0],M=h[1],G=(0,m.useState)([]),D=p()(G,2),F=D[0],R=D[1],O=(0,m.useState)([]),z=p()(O,2),H=z[0],W=z[1],V=(0,m.useReducer)(ce,se),U=p()(V,2),K=U[0],q=U[1],Y=K.loading,J=K.data,Q=K.user,X=K.disciplines,$=K.dicts,te=K.status,ne=null==J?void 0:J.hack_sets,ue=null==J||null===(e=J.hack)||void 0===e?void 0:e.test_set_average,de=(0,P.oP)(),pe=de.callback_url,he=de.express_id,fe=de.score,me=de.question_id,ge=de.type,ve=(0,m.useState)([]),we=p()(ve,2),be=we[0],ye=we[1],xe=(0,m.useState)(!1),_e=p()(xe,2),ke=_e[0],je=_e[1],Ce=(0,m.useState)(!1),Se=p()(Ce,2),Ae=Se[0],Te=Se[1],Be=(0,m.useState)(),Ne=p()(Be,2),Pe=Ne[0],Ee=Ne[1],Ie="1"===ge,Le=(0,m.useMemo)((function(){var e=[];return X&&(0,k.D0)(X,e),e}),[X]),Ze=(0,m.useCallback)(u()(l()().mark((function e(){var t,n,i,a,r,s,u,d,h,m,g,v,w,b,y,x,_,j,A,T,B,N,E,I,L,Z,G,D,F,R,O,z,H,V,U,K,Y,J,Q,$,ee,te,ne,ie,ae,oe,re,se,ce,ue,de,pe,he,me,ge,ve=arguments;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=ve.length>0&&void 0!==ve[0]?ve[0]:0,0!==(n=X).length){e.next=7;break}return e.next=5,(0,S.d1)("new_question");case 5:i=e.sent,n=i.disciplines;case 7:if(!o){e.next=15;break}return a={disciplines:n},e.next=11,(0,S.fu)(o);case 11:(r=e.sent).message?"401"===r.status&&(document.location.href="/user/login"):(s=r.category,u=r.user,d=r.code,h=r.language,m=r.hack_sets,g=r.description,v=r.difficult,w=r.name,b=r.open_or_not,y=r.sub_discipline_id,r.tag_discipline_id,x=r.analysis,_=r.time_limit,j=r.test_set_average,A=r.test_set_score,T=r.status,B=r.tag_discipline_ids,N=r.item_banks_group_id,E=r.is_file,I=void 0!==E&&E,L=r.hide_actual_output,Z=r.code_compile_score,G=r.languages,D=r.is_my,F=r.codes,R=r.answer_text,O=r.submit_rule,z=r.show_case,H=(0,k.y3)(n,y),V=p()(H,2),U=V[0],K=V[1],Y=I?[{input:"",output:"",score:100,position:1}]:m,I?(W(m),c.setFieldsValue({hack_sets:Y})):W([]),J=(0,P.oP)(),Q=J.lastedUpdateTime,$=null==F?void 0:F.map((function(e){return f()(f()({},e),{},{code:C.Base64.decode(null==e?void 0:e.code)})})),a=f()(f()({},a),{},{loading:!1,user:u,dicts:K,status:T,lastedUpdateTime:t||(Q||0),data:{hack_codes:{language:h,code:C.Base64.decode(d)},hack:{category:s,difficult:v,name:w,description:g,open_or_not:b,time_limit:_,test_set_average:j,test_set_score:A,sub_discipline_id:U,tag_discipline_ids:B,languages:G,score:fe||1,item_banks_group_ids:N,is_file:I,is_my:D,code_compile_score:Z,hide_actual_output:L,show_case:z,analysis:x,answer_text:R,submit_rule:O},hack_sets:Y,tags:B,codes:$}}),parseInt(Z)>0&&je(!0),q({type:le.SET_INITAL_DATA,payload:a}),M({hack:{category:s,difficult:v,name:w,description:g,open_or_not:b,time_limit:_,test_set_average:j,test_set_score:A,sub_discipline_id:U,tag_discipline_ids:B,score:fe||1,item_banks_group_ids:N,is_file:I,analysis:x,answer_text:R},codes:$}),Me(null==U?void 0:U[0],null==U?void 0:U[1],n)),e.next=26;break;case 15:return e.next=17,(0,S.PR)();case 17:ne=e.sent,ie=ne.user,ae=(0,P.oP)(),oe=ae.sub_discipline_id,re=ae.tag_discipline_id,se=ae.tagIds,ce=ae.banksIds,ue=2,de=(0,k.y3)(n,parseInt(oe,10)),pe=p()(de,2),he=pe[0],me=pe[1],ge=[Number(ce||0)],q({type:le.SET_INITAL_DATA,payload:{loading:!1,user:ie,disciplines:n,status:0,dicts:me,data:{hack_codes:{language:"C",code:""},hack:{category:null,difficult:ue,time_limit:3,description:"",test_set_score:!0,test_set_average:!0,open_or_not:!0,sub_discipline_id:[],tag_discipline_id:se&&(null==se||null===(ee=se.split(","))||void 0===ee?void 0:ee.map((function(e){return Number(e)}))),name:"",item_banks_group_ids:ge,is_file:!1,answer_text:"",submit_rule:1},tags:re?null==re?void 0:re.split(",").map((function(e){return parseInt(e,10)})):[],hack_sets:[{input:"",output:"",score:100,position:1}]}}}),M({hack:{category:null,difficult:ue,time_limit:3,description:"",test_set_average:!0,open_or_not:!0,sub_discipline_id:[],tag_discipline_id:se&&(null==se||null===(te=se.split(","))||void 0===te?void 0:te.map((function(e){return Number(e)}))),name:"",item_banks_group_id:ge,is_file:!1,answer_text:""}}),Me(null==he?void 0:he[0],null==he?void 0:he[1],n);case 26:case"end":return e.stop()}}),e)}))),[o,X]);(0,m.useEffect)((function(){try{Ze()}catch(e){console.log(e,"----")}}),[]),(0,m.useEffect)((function(){function e(){return e=u()(l()().mark((function e(){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,N.U2)("item_banks_groups/mine.json");case 2:t=e.sent,ye(t);case 4:case"end":return e.stop()}}),e)}))),e.apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[]);var Me=function(e,t,n){var i;null==n||null===(i=n.find((function(t){return t.id===e})))||void 0===i||null===(i=i.sub_disciplines)||void 0===i||null===(i=i.find((function(e){return e.id===t})))||void 0===i||i.tag_disciplines};function Ge(e,t,n){return De.apply(this,arguments)}function De(){return De=u()(l()().mark((function e(t,n,r){var s,c,d,p,h,m,g,v,y,x,_,k,A,T,B,N,P,E,Z,M,G,D,F;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=f()({},t),d=c.hack_sets,p=c.hack_codes,h=c.hack,m=c.tags,g=c.codes,v=[],(null==h||null===(s=h.tag_discipline_ids)||void 0===s?void 0:s.length)>0&&(null!=h&&null!==(y=h.tag_discipline_ids)&&void 0!==y&&null!==(y=y[0])&&void 0!==y&&y.value?null==h||null===(x=h.tag_discipline_ids)||void 0===x||x.map((function(e){v.push(null==e?void 0:e.value)})):v=null==h?void 0:h.tag_discipline_ids),h.tag_discipline_ids=v,_=[],k=[],A=0,T=null!=h&&h.is_file?H.map((function(e,t){return f()(f()({},e),{},{position:t+1})})):d.map((function(e){return f()(f()({},e),{},{is_file:!1})})),B=a()(T);try{for(B.s();!(N=B.n()).done;)P=N.value,A+=P.score,P.id&&P.id>=0?_.push(P):k.push(P)}catch(e){B.e(e)}finally{B.f()}if(null!=T&&T.length){e.next=13;break}return w.ZP.error("测试集不能为空"),e.abrupt("return");case 13:if(100===(A+=parseInt(h.code_compile_score||0))||h.test_set_score){e.next=17;break}return w.ZP.error("测试集的评分占比之和必须等于100"),e.abrupt("return");case 17:if(null==T||!T.some((function(e){return!e.output}))){e.next=22;break}return Ye(null==T?void 0:T.map((function(e){return(null==e?void 0:e.position)-1}))),$e(!0),w.ZP.error("测试集输出不能为空"),e.abrupt("return");case 22:if(E={},Ie?null==g||g.forEach((function(e){E[e.language]=null!=e&&e.code?C.Base64.encode(null==e?void 0:e.code):""})):p.code=C.Base64.encode(null==p?void 0:p.code),h.sub_discipline_id=h.sub_discipline_id[1],q({type:le.SET_LOADING,payload:!0}),pe||(h.score=100*h.difficult),!o){e.next=60;break}return e.next=30,(0,S.l_)(o,{hack:h,hack_codes:p,hack_sets:k,update_hack_sets:_,tags:m,is_cover:r,languages:h.languages,codes:E});case 30:if(0===e.sent.status){e.next=34;break}return q({type:le.SET_LOADING,payload:!1}),e.abrupt("return");case 34:if(!pe){e.next=54;break}return e.next=38,(0,S.j2)(o);case 38:if(!pe.includes("paperlibrary")){e.next=44;break}return e.next=41,(0,I.oF)({id:he,question_id:me,item_type:L.c.Program,name:h.name,question_score:h.score,difficulty:h.difficult,sub_discipline_id:h.sub_discipline_id,tag_discipline_ids:h.tag_discipline_ids,item_banks_group_ids:h.item_banks_group_ids,analysis:h.analysis});case 41:return 0===e.sent.status&&("course"==i.get("pageType")?"course"==i.get("updateType")?j.history.replace(i.get("callback_url")+"&defaultActiveKey=0&pageType=course&updateType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):j.history.replace(i.get("callback_url")+"&pageType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):j.history.replace(i.get("callback_url"))),e.abrupt("return");case 44:return e.next=46,(0,S.GM)(me,{question_type:6,question_score:h.score,question_title:h.name,description:h.description,sub_discipline_id:h.sub_discipline_id,tag_discipline_ids:h.tag_discipline_ids,item_banks_group_ids:h.item_banks_group_ids,identifier:o,analysis:h.analysis});case 46:if(Z=e.sent,0!==Z.status){e.next=52;break}if("start"!==n){e.next=51;break}return e.abrupt("return");case 51:"course"==i.get("pageType")?"course"==i.get("updateType")?j.history.replace(i.get("callback_url")+"&defaultActiveKey=0&pageType=course&updateType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):j.history.replace(i.get("callback_url")+"&pageType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):j.history.replace(i.get("callback_url"));case 52:e.next=57;break;case 54:w.ZP.success("保存成功"),Ze(re()),"start"!==n&&0===te&&b.Z.confirm({icon:null,title:"提示",width:452,centered:!0,content:(0,ee.jsx)("div",{children:"编程题已保存!目前外于未发布状态,发布后即可应用到自己管理的课堂,是否立即发布?"}),cancelText:"稍后再说",okText:"立即发布",onCancel:function(){j.history.replace("/problemset")},onOk:function(){var e=u()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Fe(o);case 2:j.history.replace("/problemset");case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()});case 57:q({type:le.SET_LOADING,payload:!1}),e.next=91;break;case 60:return e.next=62,(0,S.zQ)({hack:h,hack_codes:p,hack_sets:T,tags:m,examination_bank_id:he||null});case 62:if(M=e.sent,G=M.identifier,D=M.exam_identifier,q({type:le.SET_LOADING,payload:!1}),"start"!==n){e.next=68;break}return e.abrupt("return");case 68:if(!G){e.next=91;break}if(pe){e.next=74;break}Ee(G),Te(!0),e.next=91;break;case 74:return e.next=76,(0,S.j2)(G);case 76:if(o){e.next=90;break}if(!pe.includes("paperlibrary")){e.next=83;break}return e.next=80,(0,I.oF)({id:he,item_type:L.c.Program,name:h.name,question_score:h.score,difficulty:h.difficult,sub_discipline_id:h.sub_discipline_id,tag_discipline_ids:h.tag_discipline_ids,identifier:D,analysis:h.analysis});case 80:return 0===e.sent.status&&("course"==i.get("pageType")?"course"==i.get("updateType")?j.history.replace(i.get("callback_url")+"&defaultActiveKey=0&pageType=course&updateType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):j.history.replace(i.get("callback_url")+"&pageType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):j.history.replace(i.get("callback_url"))),e.abrupt("return");case 83:return e.next=85,(0,S.MK)(parseInt(he,10),{question_type:6,question_score:h.score,question_title:h.name,identifier:G,tag_discipline_ids:h.tag_discipline_ids,analysis:h.analysis});case 85:F=e.sent,0===F.status&&("course"==i.get("pageType")?"course"==i.get("updateType")?j.history.replace(i.get("callback_url")+"&defaultActiveKey=0&pageType=course&updateType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):j.history.replace(i.get("callback_url")+"&pageType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):j.history.replace(i.get("callback_url"))),e.next=91;break;case 90:"course"==i.get("pageType")?"course"==i.get("updateType")?j.history.replace(i.get("callback_url")+"&defaultActiveKey=0&pageType=course&updateType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):j.history.replace(i.get("callback_url")+"&pageType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):j.history.replace(i.get("callback_url"));case 91:case"end":return e.stop()}}),e)}))),De.apply(this,arguments)}function Fe(e){return Re.apply(this,arguments)}function Re(){return(Re=u()(l()().mark((function e(t){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.j2)(t);case 2:0===(n=e.sent).status?(w.ZP.success("发布成功"),q({type:le.SET_STATUS,payload:1})):w.ZP.info(n.message);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Oe(){return(Oe=u()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Ge(c.getFieldsValue(),"start"),setTimeout(u()(l()().mark((function e(){var t,n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.uE)(o);case 2:t=e.sent,n=t.identifier,window.location.href=Ie?"/myproblems/".concat(n,"?type=1"):"/myproblems/".concat(n);case 5:case"end":return e.stop()}}),e)}))),400);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ze(){if("course"==i.get("pageType"))"course"==i.get("updateType")?j.history.replace(i.get("callback_url")+"&defaultActiveKey=0&pageType=course&updateType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId"))):j.history.replace(i.get("callback_url")+"&pageType=course&courseId=".concat(i.get("courseId"),"&stageId=").concat(i.get("stageId")));else if(pe)j.history.replace(i.get("callback_url"));else if(Ie){var e,t=null===(e=localStorage.getItem("program_homework"))||void 0===e?void 0:e.split(",");j.history.push("/classrooms/".concat(null==t?void 0:t[0],"/program_homework/").concat(null==t?void 0:t[1],"/detail"))}else j.history.replace("/problemset")}var He=function(e){var t=parseInt(c.getFieldValue("hack").code_compile_score)||0,n=Math.floor((100-t)/e.length),i=n+(100-t)%e.length,a=e.map((function(t,a){return a===e.length-1?f()(f()({},t),{},{score:i}):f()(f()({},t),{},{score:n})}));W(a)};(0,m.useEffect)((function(){if(ue){var e=parseInt(c.getFieldValue("hack").code_compile_score)||0,t=null==ne?void 0:ne.length,n=Math.floor((100-e)/t),i=(100-e)%t;null==ne||ne.map((function(e,a){return e.score=n,e.position=a+1,a===t-1&&(e.score=n+i),e})),q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack_sets:ne})}}),c.setFieldsValue({hack_sets:ne})}}),[ue]);(0,m.useEffect)((function(){var e,t;null!=J&&null!==(e=J.hack)&&void 0!==e&&null!==(e=e.sub_discipline_id)&&void 0!==e&&e[1]&&We(null==J||null===(t=J.hack)||void 0===t||null===(t=t.sub_discipline_id)||void 0===t?void 0:t[1])}),[null==J||null===(t=J.hack)||void 0===t?void 0:t.sub_discipline_id]);var We=function(){var e=u()(l()().mark((function e(t){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,A.YY)({sub_discipline_id:t});case 2:n=e.sent,R(n.tag_disciplines);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();var Ve=function(){var e=u()(l()().mark((function e(){var t,n,a,o,r,s;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,c.validateFields();case 3:if(t=c.getFieldsValue(),!i.get("exercise")||pe.includes("paperlibrary")){e.next=7;break}return b.Z.confirm({title:"保存提示",content:"此题目已存在试题库中,是否将修改后的试题覆盖试题库的原题?",okText:"覆盖原题",cancelText:"不覆盖",onOk:function(){return Ge(t,"",1)},onCancel:function(){return Ge(t,"",0)}}),e.abrupt("return");case 7:Ge(t,"",1),e.next=17;break;case 10:e.prev=10,e.t0=e.catch(0),(r=null===e.t0||void 0===e.t0||null===(n=e.t0.errorFields)||void 0===n||null===(n=n.filter((function(e){var t;return"hack_sets"==(null==e||null===(t=e.name)||void 0===t?void 0:t[0])})))||void 0===n?void 0:n.map((function(e){var t;return null==e||null===(t=e.name)||void 0===t?void 0:t[1]}))).length>0&&Ye(r),c.scrollToField(null===e.t0||void 0===e.t0||null===(a=e.t0.errorFields)||void 0===a||null===(a=a[0])||void 0===a?void 0:a.name,{behavior:"smooth",block:"start"}),s=null===e.t0||void 0===e.t0||null===(o=e.t0.errorFields)||void 0===o||null===(o=o[0])||void 0===o||null===(o=o.errors)||void 0===o?void 0:o[0],w.ZP.error(s);case 17:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),Ue=(0,m.useState)(0),Ke=p()(Ue,2),qe=Ke[0],Ye=Ke[1],Je=(0,m.useState)(!1),Qe=p()(Je,2),Xe=Qe[0],$e=Qe[1];return(0,m.useEffect)((function(){if(Xe){var e=document.getElementById("scroll-key-".concat(qe));null==e||e.scrollIntoView({behavior:"smooth"}),$e(!1)}}),[qe,Xe]),(0,ee.jsxs)(y.Z,{spinning:Y,delay:500,children:[J?(0,ee.jsxs)("div",{className:g.bg,children:[(0,ee.jsxs)("header",{className:g.header,children:[(0,ee.jsxs)("div",{className:g.avatar,children:[(0,ee.jsx)("img",{src:"".concat(E.Z.IMG_SERVER,"/images/").concat(null==Q?void 0:Q.image_url),alt:"user"}),(0,ee.jsx)("span",{children:null==Q?void 0:Q.name})]}),(0,ee.jsxs)("div",{className:g.title,children:[" ",(null==J?void 0:J.hack.name)||"编程题"," "]}),(0,ee.jsxs)("div",{className:g.exitBtn,onClick:ze,children:[(0,ee.jsx)("i",{className:"icon iconfont icon-tuichu1"}),(0,ee.jsx)("span",{children:"退出"})]})]}),(0,ee.jsx)(v.Z,{colon:!1,form:c,initialValues:J,scrollToFirstError:!0,onValuesChange:function(e){var t;if(null!=e&&null!==(t=e.hack)&&void 0!==t&&t.sub_discipline_id){var n,i,a,o=null==e||null===(n=e.hack)||void 0===n?void 0:n.sub_discipline_id,r=p()(o,2),s=r[0],l=r[1],u=(null==X||null===(i=X.find((function(e){return e.id===s})))||void 0===i||null===(i=i.sub_disciplines)||void 0===i||null===(i=i.find((function(e){return e.id===l})))||void 0===i||i.tag_disciplines,f()(f()({},c.getFieldsValue()),{},{hack:f()(f()({},null===(a=c.getFieldsValue())||void 0===a?void 0:a.hack),{},{tag_discipline_ids:[]})}));c.setFieldsValue(u),M(u)}else M(f()({},c.getFieldsValue()))},labelCol:{flex:"200px"},children:(0,ee.jsx)("div",{className:g.contentWrapper,children:(0,ee.jsx)(x.Z,{defaultActiveKey:"2"==i.get("tabKey")?"2":"1",className:g.tabWrapper,tabBarGutter:180,centered:!0,items:[{label:"基础信息",key:"1",forceRender:!0,children:(0,ee.jsx)(ie,{onAddTestCases:function(){var e=c.getFieldValue("hack_sets"),t=parseInt(c.getFieldValue("hack").code_compile_score)||0,n=e.length,i=Math.floor((100-t)/n),a=(100-t)%n;e.map((function(t,n){return ue&&(t.score=i,n===e.length-1&&(t.score=i+a)),t.position=n+1,t})),c.setFieldsValue({hack_sets:e}),q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack_sets:e})}})},form:c,handleAddKnowledgeFinish:function(e){R([].concat(r()(F),[f()({},e)]))},MyGroup:be,formValue:Z,knowledgeOptions:F,onChangeLanguage:function(e){q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack_codes:f()(f()({},J.hack_codes),{},{language:e})})}})},onChangeSubDiscipline:function(e){var t=e[1],n=(0,k.y3)(X,t),i=p()(n,2)[1];c.setFieldsValue({tags:[]}),q({type:le.SET_INITAL_DATA,payload:{dicts:i,data:f()(f()({},J),{},{hack:f()(f()({},J.hack),{},{sub_discipline_id:e}),tags:[]})}})},onRemoveTestCase:function(e){var t=c.getFieldValue("hack_sets"),n=parseInt(c.getFieldValue("hack").code_compile_score)||0,i=(null==t?void 0:t.length)-1,a=Math.floor((100-n)/i),o=(100-n)%i;t.splice(e,1),null==t||t.map((function(e,t){return ue&&(e.score=a,t===i-1&&(e.score=a+o)),e.position=t+1,e})),q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack_sets:t})}}),c.setFieldsValue({hack_sets:t})},onAddTestCase:function(){var e=c.getFieldValue("hack_sets"),t=parseInt(c.getFieldValue("hack").code_compile_score)||0,n=e.length+1,i=Math.floor((100-t)/n),a=(100-t)%n;e.map((function(e,t){return ue&&(e.score=i),e.position=t+1,e})),e.push({input:"",output:"",position:n,score:ue?i+a:0}),c.setFieldsValue({hack_sets:e}),q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack_sets:e})}}),Ye(e.length-1),$e(!0)},dicts:$,categorys:Le,callback_url:pe,hack:J.hack,onChangeScore:function(e){e.target.value||He(H),q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack:f()(f()({},J.hack),{},{test_set_score:e.target.value})})}})},onChangeAverage:function(e){var t=e.target.value;t&&He(H);var n=c.getFieldValue("hack_sets");q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack_sets:n,hack:f()(f()({},J.hack),{},{test_set_average:t})})}})},onChangeFile:function(e){q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack:f()(f()({},J.hack),{},{is_file:e.target.value})})}})},uploadData:H,setUploadData:W,handleUploadRatio:He,isshows:ke,isProgram:Ie,addUploadFnc:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(n)return function(){q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack:f()(f()({},J.hack),{},{is_file:!0})})}}),c.setFieldsValue({hack:{is_file:!0}})};var i=null==e?void 0:e.map((function(e){return{input:e.input,output:e.output,score:0,position:1}})),a=null===(t=c.getFieldValue("hack_sets"))||void 0===t||null===(t=t.filter((function(e){return e.input||e.output})))||void 0===t?void 0:t.concat(i),o=parseInt(c.getFieldValue("hack").code_compile_score)||0,r=null==a?void 0:a.length,s=Math.floor((100-o)/r),l=(100-o)%r;null==a||a.map((function(e,t){return ue&&(e.score=s,t===r-1&&(e.score=s+l)),e.position=t+1,e})),q({type:le.SET_INITAL_DATA,payload:{data:f()(f()({},J),{},{hack_sets:a,hack:f()(f()({},J.hack),{},{is_file:!1})})}}),c.setFieldsValue({hack_sets:a,hack:{is_file:!1}})},activeKey:qe,setActiveKey:Ye})},{label:"学员初始代码",key:"2",forceRender:!0,children:(0,ee.jsx)("div",{className:g.codePanelWrapper,children:Ie?(0,ee.jsx)(v.Z.Item,{name:"codes",noStyle:!0,children:(0,ee.jsx)(B.Z,{})}):(0,ee.jsx)(v.Z.Item,{name:["hack_codes","code"],noStyle:!0,children:(0,ee.jsx)(T.Z,{language:J.hack_codes.language,onUpdateCode:function(){}})})})}]})})}),(0,ee.jsx)("div",{className:g.buttonFixed,children:o?(0,ee.jsxs)(m.Fragment,{children:[(0,ee.jsx)("div",{className:g.cancelBtn,onClick:ze,children:"取消"}),(0,ee.jsx)(_.ZP,{className:"".concat(g.saveBtn," ml20"),loading:Y,type:"primary",onClick:(0,ae.throttle)(Ve,1e3),children:"保存"}),(0,ee.jsx)(_.ZP,{type:"primary",className:"".concat(g.challengeBtn," ml20"),onClick:(0,ae.throttle)((function(){return Oe.apply(this,arguments)}),1e3),icon:(0,ee.jsx)("i",{className:"icon iconfont icon-kaishitiaozhan1 mr5 font14"}),children:te?"开始挑战":"模拟挑战"})]}):(0,ee.jsxs)(m.Fragment,{children:[(0,ee.jsx)("div",{className:g.cancelBtn,onClick:ze,children:"取消"}),(0,ee.jsx)(_.ZP,{className:"".concat(g.saveBtn," ml20"),loading:Y,type:"primary",onClick:(0,ae.throttle)(Ve,1e3),children:"保存"})]})})]}):(0,ee.jsx)("div",{className:"vh100"}),(0,ee.jsxs)(b.Z,{centered:!0,maskClosable:!1,open:Ae,title:"提示",width:"484px",onCancel:function(){j.history.push("/problems/newedit/".concat(Pe)),Te(!1)},footer:null,children:[(0,ee.jsxs)("div",{children:[(0,ee.jsx)("div",{style:{lineHeight:"26px"},children:"本次试题内容修改已保存成功,可点击“退出”返回到试题库页面,点击“模拟实战”进行代码调试"}),(0,ee.jsxs)("div",{style:{color:"#E99237",fontSize:12,marginTop:12},children:[(0,ee.jsx)(oe.Z,{style:{marginRight:10}}),"如本试题学生进入需要展示初始代码,请点击",(0,ee.jsx)("span",{style:{color:"#165DFF",cursor:"pointer",textDecoration:"underline"},onClick:function(){j.history.push("/problems/newedit/".concat(Pe,"?tabKey=2"))},children:"设置初始代码"}),"进行设置"]})]}),(0,ee.jsxs)("div",{className:"mt30 mb20",style:{display:"flex",justifyContent:"flex-end"},children:[(0,ee.jsx)(_.ZP,{className:"mr20",onClick:function(){j.history.replace("/problemset")},children:"退出"}),(0,ee.jsx)(_.ZP,{type:"primary",onClick:u()(l()().mark((function e(){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.uE)(Pe);case 2:t=e.sent,window.location.href=Ie?"/myproblems/".concat(null==t?void 0:t.identifier,"?type=1"):"/myproblems/".concat(null==t?void 0:t.identifier);case 4:case"end":return e.stop()}}),e)}))),children:"模拟实战"})]})]})]})}},12402:function(e,t,n){"use strict";n.d(t,{GM:function(){return u},MK:function(){return c},PR:function(){return a},ZS:function(){return p},d1:function(){return o},fu:function(){return r},j2:function(){return d},l_:function(){return s},uE:function(){return h},zQ:function(){return l}});var i=n(51136);function a(){return(0,i.U2)("problems/new.json")}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"question";return(0,i.U2)("disciplines.json",{source:e})}function r(e){return(0,i.U2)("problems/".concat(e,"/edit.json"))}function s(e,t){return(0,i.gz)("problems/".concat(e,".json"),t)}function l(e){return(0,i.v_)("problems.json",e)}function c(e,t){return(0,i.v_)("exercises/".concat(e,"/exercise_questions.json"),t)}function u(e,t){return(0,i.gz)("exercise_questions/".concat(e,".json"),t)}function d(e){return(0,i.v_)("problems/".concat(e,"/publish.json"))}function p(e){return(0,i.v_)("problems/".concat(e,"/cancel_publish.json"))}function h(e){return(0,i.U2)("problems/".concat(e,"/start.json"))}},99764:function(e,t,n){"use strict";n.d(t,{D0:function(){return d},R8:function(){return l},jw:function(){return u},y3:function(){return p}});var i=n(85573),a=n.n(i),o=n(57809),r=(n(59301),n(37712)),s=o.default.Option,l=function(e){return e[e.language=0]="language",e[e.difficult=1]="difficult",e[e.category=2]="category",e[e.openOrNot=3]="openOrNot",e}({}),c=a()(a()(a()(a()({},l.language,[{title:"C",key:"C"},{title:"C++",key:"C++"},{title:"Python",key:"Python"},{title:"Java",key:"Java"},{title:"JavaScript",key:"JavaScript"},{title:"Ruby",key:"Ruby"}]),l.difficult,[{title:"简单",key:1},{title:"中等",key:2},{title:"困难",key:3}]),l.category,[{title:"程序设计",key:1},{title:"算法",key:2}]),l.openOrNot,[{title:"公开",key:1},{title:"私有",key:0}]);function u(e){return c[e].map((function(e){return(0,r.jsxs)(s,{value:e.key,children:[" ",e.title," "]},e.title)}))}function d(e,t){e.map((function(e){var n=e.id,i=e.name,a=e.sub_disciplines,o={value:n,label:i};t.push(o),a&&a.length>0&&(o.children=[],d(a,o.children))}))}function p(e,t){for(var n=[],i=0;i0){n[0]=o.id;for(var r=0;r